|
2 | 2 | import query from "./query.js"; |
3 | 3 | import ls from "./local_storage.js"; |
4 | 4 |
|
| 5 | +const DEFAULT_STYLE_OPTIONS = { |
| 6 | + showLogo: true, |
| 7 | + showFileMenu: true, |
| 8 | + showHelpMenu: true, |
| 9 | + showSelectLanguage: true, |
| 10 | + showCompilerOptions: true, |
| 11 | + showCommandLineArguments: true, |
| 12 | + showRunButton: true, |
| 13 | + showThemeButton: true, |
| 14 | + showPuterSignInOutButton: true, |
| 15 | + showStatusLine: true, |
| 16 | + showCopyright: true, |
| 17 | + showNavigation: true |
| 18 | +}; |
| 19 | + |
| 20 | +const DEFAULT_APP_OPTIONS = { |
| 21 | + showAIAssistant: true, |
| 22 | + ioLayout: "stack", |
| 23 | + assistantLayout: "column", |
| 24 | + mainLayout: "row", |
| 25 | + showInput: true, |
| 26 | + showOutput: true, |
| 27 | + apiKey: "" |
| 28 | +}; |
| 29 | + |
| 30 | +const DEFAULT_CONFIGURATION = { |
| 31 | + theme: "system", |
| 32 | + style: "default", |
| 33 | + styleOptions: DEFAULT_STYLE_OPTIONS, |
| 34 | + appOptions: DEFAULT_APP_OPTIONS |
| 35 | +}; |
| 36 | + |
5 | 37 | const DEFAULT_CONFIGURATIONS = { |
6 | | - default: { |
7 | | - theme: "system", |
8 | | - style: "default", |
9 | | - styleOptions: { |
10 | | - showLogo: true, |
11 | | - showFileMenu: true, |
12 | | - showHelpMenu: true, |
13 | | - showSelectLanguage: true, |
14 | | - showCompilerOptions: true, |
15 | | - showCommandLineArguments: true, |
16 | | - showRunButton: true, |
17 | | - showThemeButton: true, |
18 | | - showPuterSignInOutButton: true, |
19 | | - showStatusLine: true, |
20 | | - showCopyright: true, |
21 | | - showNavigation: true |
22 | | - }, |
23 | | - appOptions: { |
24 | | - showAIAssistant: true, |
25 | | - ioLayout: "stack", |
26 | | - assistantLayout: "column", |
27 | | - mainLayout: "row", |
28 | | - showInput: true, |
29 | | - showOutput: true |
30 | | - } |
31 | | - }, |
| 38 | + default: DEFAULT_CONFIGURATION, |
32 | 39 | minimal: { |
33 | | - theme: "system", |
| 40 | + ...DEFAULT_CONFIGURATION, |
34 | 41 | style: "minimal", |
35 | 42 | styleOptions: { |
| 43 | + ...DEFAULT_STYLE_OPTIONS, |
36 | 44 | showLogo: false, |
37 | 45 | showFileMenu: false, |
38 | 46 | showHelpMenu: false, |
39 | | - showSelectLanguage: true, |
40 | 47 | showCompilerOptions: false, |
41 | 48 | showCommandLineArguments: false, |
42 | | - showRunButton: true, |
43 | 49 | showThemeButton: false, |
44 | 50 | showPuterSignInOutButton: false, |
45 | 51 | showStatusLine: false, |
46 | | - showCopyright: false, |
47 | | - showNavigation: true |
| 52 | + showCopyright: false |
48 | 53 | }, |
49 | 54 | appOptions: { |
| 55 | + ...DEFAULT_APP_OPTIONS, |
50 | 56 | showAIAssistant: false, |
51 | 57 | ioLayout: "column", |
52 | | - assistantLayout: "column", |
53 | | - mainLayout: "row", |
54 | | - showInput: true, |
55 | | - showOutput: true |
56 | 58 | } |
57 | 59 | }, |
58 | 60 | standalone: { |
59 | | - theme: "system", |
| 61 | + ...DEFAULT_CONFIGURATION, |
60 | 62 | style: "standalone", |
61 | 63 | styleOptions: { |
| 64 | + ...DEFAULT_STYLE_OPTIONS, |
62 | 65 | showLogo: false, |
63 | | - showFileMenu: true, |
64 | | - showHelpMenu: true, |
65 | | - showSelectLanguage: true, |
66 | | - showCompilerOptions: true, |
67 | | - showCommandLineArguments: true, |
68 | | - showRunButton: true, |
69 | | - showThemeButton: true, |
70 | | - showPuterSignInOutButton: true, |
71 | | - showStatusLine: true, |
72 | | - showCopyright: false, |
73 | | - showNavigation: true |
74 | | - }, |
75 | | - appOptions: { |
76 | | - showAIAssistant: true, |
77 | | - ioLayout: "stack", |
78 | | - assistantLayout: "column", |
79 | | - mainLayout: "row", |
80 | | - showInput: true, |
81 | | - showOutput: true |
| 66 | + showCopyright: false |
82 | 67 | } |
83 | 68 | }, |
84 | 69 | electron: { |
85 | | - theme: "system", |
| 70 | + ...DEFAULT_CONFIGURATION, |
86 | 71 | style: "electron", |
87 | 72 | styleOptions: { |
| 73 | + ...DEFAULT_STYLE_OPTIONS, |
88 | 74 | showLogo: false, |
89 | | - showFileMenu: true, |
90 | | - showHelpMenu: true, |
91 | | - showSelectLanguage: true, |
92 | | - showCompilerOptions: true, |
93 | | - showCommandLineArguments: true, |
94 | | - showRunButton: true, |
95 | | - showThemeButton: true, |
96 | | - showPuterSignInOutButton: true, |
97 | | - showStatusLine: true, |
98 | | - showCopyright: false, |
99 | | - showNavigation: true |
100 | | - }, |
101 | | - appOptions: { |
102 | | - showAIAssistant: true, |
103 | | - ioLayout: "stack", |
104 | | - assistantLayout: "column", |
105 | | - mainLayout: "row", |
106 | | - showInput: true, |
107 | | - showOutput: true |
| 75 | + showCopyright: false |
108 | 76 | } |
109 | 77 | }, |
110 | 78 | puter: { |
111 | | - theme: "system", |
| 79 | + ...DEFAULT_CONFIGURATION, |
112 | 80 | style: "puter", |
113 | 81 | styleOptions: { |
114 | | - showLogo: false, |
115 | | - showFileMenu: true, |
116 | | - showHelpMenu: true, |
117 | | - showSelectLanguage: true, |
118 | | - showCompilerOptions: true, |
119 | | - showCommandLineArguments: true, |
120 | | - showRunButton: true, |
121 | | - showThemeButton: true, |
122 | | - showPuterSignInOutButton: false, |
123 | | - showStatusLine: true, |
124 | | - showCopyright: true, |
125 | | - showNavigation: true |
126 | | - }, |
127 | | - appOptions: { |
128 | | - showAIAssistant: true, |
129 | | - ioLayout: "stack", |
130 | | - assistantLayout: "column", |
131 | | - mainLayout: "row", |
132 | | - showInput: true, |
133 | | - showOutput: true |
| 82 | + ...DEFAULT_STYLE_OPTIONS, |
| 83 | + showLogo: false |
134 | 84 | } |
135 | 85 | } |
136 | 86 | }; |
|
0 commit comments