@@ -10,6 +10,18 @@ import EntryInputContainer from '../containers/EntryInputContainer';
1010import * as types from '../constants/ActionTypes' ;
1111import * as actions from '../actions' ;
1212
13+ export const OPTIONS_PRESET_DEFAULT = 'default' ;
14+ export const OPTIONS_PRESET_LOW_OBFUSCATION = 'low-obfuscation' ;
15+ export const OPTIONS_PRESET_MEDIUM_OBFUSCATION = 'medium-obfuscation' ;
16+ export const OPTIONS_PRESET_HIGH_OBFUSCATION = 'high-obfuscation' ;
17+
18+ const OPTIONS_PRESET_OPTIONS = [
19+ { text : 'default' , value : OPTIONS_PRESET_DEFAULT } ,
20+ { text : 'low' , value : OPTIONS_PRESET_LOW_OBFUSCATION } ,
21+ { text : 'medium' , value : OPTIONS_PRESET_MEDIUM_OBFUSCATION } ,
22+ { text : 'high' , value : OPTIONS_PRESET_HIGH_OBFUSCATION } ,
23+ ] ;
24+
1325export const SOURCEMAP_OFF = 'off' ;
1426export const SOURCEMAP_INLINE = 'inline' ;
1527export const SOURCEMAP_SEPARATE = 'separate' ;
@@ -20,10 +32,14 @@ const SOURCEMAP_OPTIONS = [
2032 { text : 'Separate' , value : SOURCEMAP_SEPARATE } ,
2133] ;
2234
35+ export const STRING_ARRAY_ENCODING_NONE = 'none' ;
36+ export const STRING_ARRAY_ENCODING_BASE64 = 'base64' ;
37+ export const STRING_ARRAY_ENCODING_RC4 = 'rc4' ;
38+
2339const STRING_ARRAY_ENCODING_OPTIONS = [
24- { text : 'Off ' , value : 'false' } ,
25- { text : 'Base64' , value : 'base64' } ,
26- { text : 'RC4' , value : 'rc4' } ,
40+ { text : 'None ' , value : STRING_ARRAY_ENCODING_NONE } ,
41+ { text : 'Base64' , value : STRING_ARRAY_ENCODING_BASE64 } ,
42+ { text : 'RC4' , value : STRING_ARRAY_ENCODING_RC4 } ,
2743] ;
2844
2945export const TARGET_BROWSER = 'browser' ;
@@ -62,6 +78,15 @@ const Options = ({dispatch, options}) =>
6278
6379 < Divider />
6480
81+ < Form . Select
82+ label = 'Options Preset'
83+ value = { options . optionsPreset }
84+ fluid
85+ onChange = { ( event , { value} ) => dispatch ( actions . setOptionsPreset ( value ) ) }
86+ options = { OPTIONS_PRESET_OPTIONS } />
87+
88+ < Divider />
89+
6590 < Form . Checkbox
6691 label = 'Compact code'
6792 checked = { options . compact }
@@ -169,8 +194,16 @@ const Options = ({dispatch, options}) =>
169194 disabled = { ! options . stringArrayEncodingEnabled }
170195 label = 'String Array Encoding'
171196 fluid
197+ multiple
198+ placeholder = { STRING_ARRAY_ENCODING_NONE }
172199 value = { options . stringArrayEncoding }
173200 onChange = { ( event , { value} ) => dispatch ( actions . setStringArrayEncoding ( value ) ) }
201+ renderLabel = { ( item ) => {
202+ return ( {
203+ content : `${ item . value } ` ,
204+ ...item . value === STRING_ARRAY_ENCODING_NONE && { onRemove : undefined }
205+ } ) ;
206+ } }
174207 options = { STRING_ARRAY_ENCODING_OPTIONS } />
175208
176209 < Form . Input
0 commit comments