forked from decosoftware/deco-ide
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PreferencesConstants.js
112 lines (107 loc) · 2.88 KB
/
PreferencesConstants.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
/**
* Copyright (C) 2015 Deco Software Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
import _ from 'lodash'
export const ROOT_KEY = 'PREFERENCES'
export const CATEGORIES = _.mapKeys([
'GENERAL',
'SAVING',
'EDITOR',
])
export const PREFERENCES = {
[CATEGORIES.GENERAL]: _.mapKeys([
'ANDROID_HOME',
'GENYMOTION_APP',
'USE_GENYMOTION',
'PUBLISHING_FEATURE',
'DECO_THEME',
]),
[CATEGORIES.SAVING]: _.mapKeys([
'AUTOSAVE',
'PROPERTY_CHANGE',
'TEXT_EDIT',
'DEBOUNCE',
]),
[CATEGORIES.EDITOR]: _.mapKeys([
'THEME',
'FONT_SIZE',
'VIM_MODE',
'SHOW_INVISIBLES',
'SHOW_INDENT_GUIDES',
'SHOW_MINIMAP',
'HIGHLIGHT_ACTIVE_LINE',
'NPM_REGISTRY',
]),
}
export const METADATA = {
[CATEGORIES.GENERAL]: {
[PREFERENCES[CATEGORIES.GENERAL].DECO_THEME]: {
defaultValue: 'light',
},
[PREFERENCES[CATEGORIES.GENERAL].ANDROID_HOME]: {
defaultValue: '',
},
[PREFERENCES[CATEGORIES.GENERAL].GENYMOTION_APP]: {
defaultValue: '',
},
[PREFERENCES[CATEGORIES.GENERAL].USE_GENYMOTION]: {
defaultValue: false,
},
[PREFERENCES[CATEGORIES.GENERAL].PUBLISHING_FEATURE]: {
defaultValue: false,
},
},
[CATEGORIES.SAVING]: {
[PREFERENCES[CATEGORIES.SAVING].AUTOSAVE]: {
defaultValue: true,
},
[PREFERENCES[CATEGORIES.SAVING].PROPERTY_CHANGE]: {
defaultValue: true,
},
[PREFERENCES[CATEGORIES.SAVING].TEXT_EDIT]: {
defaultValue: true,
},
[PREFERENCES[CATEGORIES.SAVING].DEBOUNCE]: {
defaultValue: 1500,
},
},
[CATEGORIES.EDITOR]: {
[PREFERENCES[CATEGORIES.EDITOR].THEME]: {
defaultValue: 'deco',
},
[PREFERENCES[CATEGORIES.EDITOR].FONT_SIZE]: {
defaultValue: 12,
},
[PREFERENCES[CATEGORIES.EDITOR].VIM_MODE]: {
defaultValue: false,
},
[PREFERENCES[CATEGORIES.EDITOR].SHOW_INVISIBLES]: {
defaultValue: false,
},
[PREFERENCES[CATEGORIES.EDITOR].SHOW_INDENT_GUIDES]: {
defaultValue: false,
},
[PREFERENCES[CATEGORIES.EDITOR].SHOW_MINIMAP]: {
defaultValue: false,
},
[PREFERENCES[CATEGORIES.EDITOR].HIGHLIGHT_ACTIVE_LINE]: {
defaultValue: true,
},
[PREFERENCES[CATEGORIES.EDITOR].NPM_REGISTRY]: {
defaultValue: 'https://registry.npmjs.org',
},
}
}