@finos/legend-code-editor 1.2.73

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +3 -0
  3. package/lib/CodeEditorTheme.d.ts +41 -0
  4. package/lib/CodeEditorTheme.d.ts.map +1 -0
  5. package/lib/CodeEditorTheme.js +99 -0
  6. package/lib/CodeEditorTheme.js.map +1 -0
  7. package/lib/CodeEditorUtils.d.ts +66 -0
  8. package/lib/CodeEditorUtils.d.ts.map +1 -0
  9. package/lib/CodeEditorUtils.js +139 -0
  10. package/lib/CodeEditorUtils.js.map +1 -0
  11. package/lib/PureLanguage.d.ts +38 -0
  12. package/lib/PureLanguage.d.ts.map +1 -0
  13. package/lib/PureLanguage.js +39 -0
  14. package/lib/PureLanguage.js.map +1 -0
  15. package/lib/PureLanguageCodeEditorSupport.d.ts +71 -0
  16. package/lib/PureLanguageCodeEditorSupport.d.ts.map +1 -0
  17. package/lib/PureLanguageCodeEditorSupport.js +238 -0
  18. package/lib/PureLanguageCodeEditorSupport.js.map +1 -0
  19. package/lib/PureLanguageService.d.ts +19 -0
  20. package/lib/PureLanguageService.d.ts.map +1 -0
  21. package/lib/PureLanguageService.js +373 -0
  22. package/lib/PureLanguageService.js.map +1 -0
  23. package/lib/index.d.ts +21 -0
  24. package/lib/index.d.ts.map +1 -0
  25. package/lib/index.js +21 -0
  26. package/lib/index.js.map +1 -0
  27. package/lib/themes/Github-Theme-dark-dimmed.json +613 -0
  28. package/lib/themes/Github-Theme-dark.json +513 -0
  29. package/lib/themes/Github-Theme-light.json +598 -0
  30. package/lib/themes/Material-Theme-Darker.json +816 -0
  31. package/lib/themes/Material-Theme-Default.json +816 -0
  32. package/lib/themes/MonacoEditorThemeUtils.d.ts +31 -0
  33. package/lib/themes/MonacoEditorThemeUtils.d.ts.map +1 -0
  34. package/lib/themes/MonacoEditorThemeUtils.js +88 -0
  35. package/lib/themes/MonacoEditorThemeUtils.js.map +1 -0
  36. package/lib/themes/OneDark-Pro-darker.json +2061 -0
  37. package/lib/themes/OneDark-Pro.json +2090 -0
  38. package/lib/themes/solarized-dark-color-theme.json +398 -0
  39. package/package.json +66 -0
  40. package/src/CodeEditorTheme.ts +151 -0
  41. package/src/CodeEditorUtils.ts +241 -0
  42. package/src/PureLanguage.ts +42 -0
  43. package/src/PureLanguageCodeEditorSupport.ts +341 -0
  44. package/src/PureLanguageService.ts +416 -0
  45. package/src/index.ts +22 -0
  46. package/src/themes/Github-Theme-dark-dimmed.json +613 -0
  47. package/src/themes/Github-Theme-dark.json +513 -0
  48. package/src/themes/Github-Theme-light.json +598 -0
  49. package/src/themes/Material-Theme-Darker.json +816 -0
  50. package/src/themes/Material-Theme-Default.json +816 -0
  51. package/src/themes/MonacoEditorThemeUtils.ts +128 -0
  52. package/src/themes/OneDark-Pro-darker.json +2061 -0
  53. package/src/themes/OneDark-Pro.json +2090 -0
  54. package/src/themes/README.md +8 -0
  55. package/src/themes/solarized-dark-color-theme.json +423 -0
  56. package/tsconfig.json +72 -0
@@ -0,0 +1,398 @@
1
+ {
2
+ "name": "Solarized (dark)",
3
+ "tokenColors": [
4
+ {
5
+ "settings": {
6
+ "foreground": "#839496"
7
+ }
8
+ },
9
+ {
10
+ "scope": [
11
+ "meta.embedded",
12
+ "source.groovy.embedded",
13
+ "string meta.image.inline.markdown"
14
+ ],
15
+ "settings": {
16
+ "foreground": "#839496"
17
+ }
18
+ },
19
+ {
20
+ "name": "Comment",
21
+ "scope": "comment",
22
+ "settings": {
23
+ "fontStyle": "italic",
24
+ "foreground": "#586E75"
25
+ }
26
+ },
27
+ {
28
+ "name": "String",
29
+ "scope": "string",
30
+ "settings": {
31
+ "foreground": "#2AA198"
32
+ }
33
+ },
34
+ {
35
+ "name": "Regexp",
36
+ "scope": "string.regexp",
37
+ "settings": {
38
+ "foreground": "#DC322F"
39
+ }
40
+ },
41
+ {
42
+ "name": "Number",
43
+ "scope": "constant.numeric",
44
+ "settings": {
45
+ "foreground": "#D33682"
46
+ }
47
+ },
48
+ {
49
+ "name": "Variable",
50
+ "scope": ["variable.language", "variable.other"],
51
+ "settings": {
52
+ "foreground": "#268BD2"
53
+ }
54
+ },
55
+ {
56
+ "name": "Keyword",
57
+ "scope": "keyword",
58
+ "settings": {
59
+ "foreground": "#859900"
60
+ }
61
+ },
62
+ {
63
+ "name": "Storage",
64
+ "scope": "storage",
65
+ "settings": {
66
+ "fontStyle": "bold",
67
+ "foreground": "#93A1A1"
68
+ }
69
+ },
70
+ {
71
+ "name": "Class name",
72
+ "scope": [
73
+ "entity.name.class",
74
+ "entity.name.type",
75
+ "entity.name.namespace",
76
+ "entity.name.scope-resolution"
77
+ ],
78
+ "settings": {
79
+ "fontStyle": "",
80
+ "foreground": "#CB4B16"
81
+ }
82
+ },
83
+ {
84
+ "name": "Function name",
85
+ "scope": "entity.name.function",
86
+ "settings": {
87
+ "foreground": "#268BD2"
88
+ }
89
+ },
90
+ {
91
+ "name": "Variable start",
92
+ "scope": "punctuation.definition.variable",
93
+ "settings": {
94
+ "foreground": "#859900"
95
+ }
96
+ },
97
+ {
98
+ "name": "Embedded code markers",
99
+ "scope": [
100
+ "punctuation.section.embedded.begin",
101
+ "punctuation.section.embedded.end"
102
+ ],
103
+ "settings": {
104
+ "foreground": "#DC322F"
105
+ }
106
+ },
107
+ {
108
+ "name": "Built-in constant",
109
+ "scope": ["constant.language", "meta.preprocessor"],
110
+ "settings": {
111
+ "foreground": "#B58900"
112
+ }
113
+ },
114
+ {
115
+ "name": "Support.construct",
116
+ "scope": ["support.function.construct", "keyword.other.new"],
117
+ "settings": {
118
+ "foreground": "#CB4B16"
119
+ }
120
+ },
121
+ {
122
+ "name": "User-defined constant",
123
+ "scope": ["constant.character", "constant.other"],
124
+ "settings": {
125
+ "foreground": "#CB4B16"
126
+ }
127
+ },
128
+ {
129
+ "name": "Inherited class",
130
+ "scope": "entity.other.inherited-class",
131
+ "settings": {
132
+ "foreground": "#6C71C4"
133
+ }
134
+ },
135
+ {
136
+ "name": "Function argument",
137
+ "scope": "variable.parameter",
138
+ "settings": {}
139
+ },
140
+ {
141
+ "name": "Tag name",
142
+ "scope": "entity.name.tag",
143
+ "settings": {
144
+ "foreground": "#268BD2"
145
+ }
146
+ },
147
+ {
148
+ "name": "Tag start/end",
149
+ "scope": "punctuation.definition.tag",
150
+ "settings": {
151
+ "foreground": "#586E75"
152
+ }
153
+ },
154
+ {
155
+ "name": "Tag attribute",
156
+ "scope": "entity.other.attribute-name",
157
+ "settings": {
158
+ "foreground": "#93A1A1"
159
+ }
160
+ },
161
+ {
162
+ "name": "Library function",
163
+ "scope": "support.function",
164
+ "settings": {
165
+ "foreground": "#268BD2"
166
+ }
167
+ },
168
+ {
169
+ "name": "Continuation",
170
+ "scope": "punctuation.separator.continuation",
171
+ "settings": {
172
+ "foreground": "#DC322F"
173
+ }
174
+ },
175
+ {
176
+ "name": "Library constant",
177
+ "scope": ["support.constant", "support.variable"],
178
+ "settings": {}
179
+ },
180
+ {
181
+ "name": "Library class/type",
182
+ "scope": ["support.type", "support.class"],
183
+ "settings": {
184
+ "foreground": "#859900"
185
+ }
186
+ },
187
+ {
188
+ "name": "Library Exception",
189
+ "scope": "support.type.exception",
190
+ "settings": {
191
+ "foreground": "#CB4B16"
192
+ }
193
+ },
194
+ {
195
+ "name": "Library variable",
196
+ "scope": "support.other.variable",
197
+ "settings": {}
198
+ },
199
+ {
200
+ "name": "Invalid",
201
+ "scope": "invalid",
202
+ "settings": {
203
+ "foreground": "#DC322F"
204
+ }
205
+ },
206
+ {
207
+ "name": "diff: header",
208
+ "scope": ["meta.diff", "meta.diff.header"],
209
+ "settings": {
210
+ "fontStyle": "italic",
211
+ "foreground": "#268BD2"
212
+ }
213
+ },
214
+ {
215
+ "name": "diff: deleted",
216
+ "scope": "markup.deleted",
217
+ "settings": {
218
+ "fontStyle": "",
219
+ "foreground": "#DC322F"
220
+ }
221
+ },
222
+ {
223
+ "name": "diff: changed",
224
+ "scope": "markup.changed",
225
+ "settings": {
226
+ "fontStyle": "",
227
+ "foreground": "#CB4B16"
228
+ }
229
+ },
230
+ {
231
+ "name": "diff: inserted",
232
+ "scope": "markup.inserted",
233
+ "settings": {
234
+ "foreground": "#859900"
235
+ }
236
+ },
237
+ {
238
+ "name": "Markup Quote",
239
+ "scope": "markup.quote",
240
+ "settings": {
241
+ "foreground": "#859900"
242
+ }
243
+ },
244
+ {
245
+ "name": "Markup Lists",
246
+ "scope": "markup.list",
247
+ "settings": {
248
+ "foreground": "#B58900"
249
+ }
250
+ },
251
+ {
252
+ "name": "Markup Styling",
253
+ "scope": ["markup.bold", "markup.italic"],
254
+ "settings": {
255
+ "foreground": "#D33682"
256
+ }
257
+ },
258
+ {
259
+ "name": "Markup: Strong",
260
+ "scope": "markup.bold",
261
+ "settings": {
262
+ "fontStyle": "bold"
263
+ }
264
+ },
265
+ {
266
+ "name": "Markup: Emphasis",
267
+ "scope": "markup.italic",
268
+ "settings": {
269
+ "fontStyle": "italic"
270
+ }
271
+ },
272
+ {
273
+ "scope": "markup.strikethrough",
274
+ "settings": {
275
+ "fontStyle": "strikethrough"
276
+ }
277
+ },
278
+ {
279
+ "name": "Markup Inline",
280
+ "scope": "markup.inline.raw",
281
+ "settings": {
282
+ "fontStyle": "",
283
+ "foreground": "#2AA198"
284
+ }
285
+ },
286
+ {
287
+ "name": "Markup Headings",
288
+ "scope": "markup.heading",
289
+ "settings": {
290
+ "fontStyle": "bold",
291
+ "foreground": "#268BD2"
292
+ }
293
+ },
294
+ {
295
+ "name": "Markup Setext Header",
296
+ "scope": "markup.heading.setext",
297
+ "settings": {
298
+ "fontStyle": "",
299
+ "foreground": "#268BD2"
300
+ }
301
+ }
302
+ ],
303
+ "colors": {
304
+ "focusBorder": "#2AA19899",
305
+ "selection.background": "#2AA19899",
306
+ "input.background": "#003847",
307
+ "input.foreground": "#93A1A1",
308
+ "input.placeholderForeground": "#93A1A1AA",
309
+ "inputOption.activeBorder": "#2AA19899",
310
+ "inputValidation.infoBorder": "#363b5f",
311
+ "inputValidation.infoBackground": "#052730",
312
+ "inputValidation.warningBackground": "#5d5938",
313
+ "inputValidation.warningBorder": "#9d8a5e",
314
+ "inputValidation.errorBackground": "#571b26",
315
+ "inputValidation.errorBorder": "#a92049",
316
+ "errorForeground": "#ffeaea",
317
+ "badge.background": "#047aa6",
318
+ "progressBar.background": "#047aa6",
319
+ "dropdown.background": "#00212B",
320
+ "dropdown.border": "#2AA19899",
321
+ "button.background": "#2AA19899",
322
+ "list.activeSelectionBackground": "#005A6F",
323
+ "quickInputList.focusBackground": "#005A6F",
324
+ "list.hoverBackground": "#004454AA",
325
+ "list.inactiveSelectionBackground": "#00445488",
326
+ "list.dropBackground": "#00445488",
327
+ "list.highlightForeground": "#1ebcc5",
328
+ "editor.background": "#002B36",
329
+ "editor.foreground": "#839496",
330
+ "editorWidget.background": "#00212B",
331
+ "editorCursor.foreground": "#D30102",
332
+ "editorWhitespace.foreground": "#93A1A180",
333
+ "editor.lineHighlightBackground": "#073642",
334
+ "editorLineNumber.activeForeground": "#949494",
335
+ "editor.selectionBackground": "#274642",
336
+ "minimap.selectionHighlight": "#274642",
337
+ "editorIndentGuide.background": "#93A1A180",
338
+ "editorIndentGuide.activeBackground": "#C3E1E180",
339
+ "editorHoverWidget.background": "#004052",
340
+ "editorMarkerNavigationError.background": "#AB395B",
341
+ "editorMarkerNavigationWarning.background": "#5B7E7A",
342
+ "editor.selectionHighlightBackground": "#005A6FAA",
343
+ "editor.wordHighlightBackground": "#004454AA",
344
+ "editor.wordHighlightStrongBackground": "#005A6FAA",
345
+ "editorBracketHighlight.foreground1": "#cdcdcdff",
346
+ "editorBracketHighlight.foreground2": "#b58900ff",
347
+ "editorBracketHighlight.foreground3": "#d33682ff",
348
+ "peekViewResult.background": "#00212B",
349
+ "peekViewEditor.background": "#10192c",
350
+ "peekViewTitle.background": "#00212B",
351
+ "peekView.border": "#2b2b4a",
352
+ "peekViewEditor.matchHighlightBackground": "#7744AA40",
353
+ "titleBar.activeBackground": "#002C39",
354
+ "editorGroup.border": "#00212B",
355
+ "editorGroup.dropBackground": "#2AA19844",
356
+ "editorGroupHeader.tabsBackground": "#004052",
357
+ "tab.activeForeground": "#d6dbdb",
358
+ "tab.activeBackground": "#002B37",
359
+ "tab.inactiveForeground": "#93A1A1",
360
+ "tab.inactiveBackground": "#004052",
361
+ "tab.border": "#003847",
362
+ "tab.lastPinnedBorder": "#2AA19844",
363
+ "activityBar.background": "#003847",
364
+ "panel.border": "#2b2b4a",
365
+ "sideBar.background": "#00212B",
366
+ "sideBarTitle.foreground": "#93A1A1",
367
+ "statusBar.foreground": "#93A1A1",
368
+ "statusBar.background": "#00212B",
369
+ "statusBar.debuggingBackground": "#00212B",
370
+ "statusBar.noFolderBackground": "#00212B",
371
+ "statusBarItem.remoteBackground": "#2AA19899",
372
+ "ports.iconRunningProcessForeground": "#369432",
373
+ "statusBarItem.prominentBackground": "#003847",
374
+ "statusBarItem.prominentHoverBackground": "#003847",
375
+ "debugToolBar.background": "#00212B",
376
+ "debugExceptionWidget.background": "#00212B",
377
+ "debugExceptionWidget.border": "#AB395B",
378
+ "pickerGroup.foreground": "#2AA19899",
379
+ "pickerGroup.border": "#2AA19899",
380
+ "terminal.ansiBlack": "#073642",
381
+ "terminal.ansiRed": "#dc322f",
382
+ "terminal.ansiGreen": "#859900",
383
+ "terminal.ansiYellow": "#b58900",
384
+ "terminal.ansiBlue": "#268bd2",
385
+ "terminal.ansiMagenta": "#d33682",
386
+ "terminal.ansiCyan": "#2aa198",
387
+ "terminal.ansiWhite": "#eee8d5",
388
+ "terminal.ansiBrightBlack": "#002b36",
389
+ "terminal.ansiBrightRed": "#cb4b16",
390
+ "terminal.ansiBrightGreen": "#586e75",
391
+ "terminal.ansiBrightYellow": "#657b83",
392
+ "terminal.ansiBrightBlue": "#839496",
393
+ "terminal.ansiBrightMagenta": "#6c71c4",
394
+ "terminal.ansiBrightCyan": "#93a1a1",
395
+ "terminal.ansiBrightWhite": "#fdf6e3"
396
+ },
397
+ "semanticHighlighting": true
398
+ }
package/package.json ADDED
@@ -0,0 +1,66 @@
1
+ {
2
+ "name": "@finos/legend-code-editor",
3
+ "version": "1.2.73",
4
+ "description": "Legend shared advanced application components and building blocks",
5
+ "keywords": [
6
+ "legend",
7
+ "component",
8
+ "shared-component"
9
+ ],
10
+ "homepage": "https://github.com/finos/legend-studio/tree/master/packages/legend-code-editor",
11
+ "bugs": {
12
+ "url": "https://github.com/finos/legend-studio/issues"
13
+ },
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "https://github.com/finos/legend-studio.git",
17
+ "directory": "packages/legend-code-editor"
18
+ },
19
+ "license": "Apache-2.0",
20
+ "sideEffects": false,
21
+ "type": "module",
22
+ "exports": {
23
+ ".": "./lib/index.js"
24
+ },
25
+ "module": "lib/index.js",
26
+ "types": "lib/index.d.ts",
27
+ "scripts": {
28
+ "build": "yarn clean && yarn build:sass && yarn build:ts",
29
+ "build:sass": "cross-env INIT_CWD=$INIT_CWD node ../../scripts/workflow/buildSass.js",
30
+ "build:ts": "tsc --project ./tsconfig.build.json",
31
+ "clean": "npm-run-all clean:cache clean:lib",
32
+ "clean:cache": "rimraf \"build\"",
33
+ "clean:lib": "rimraf \"lib\"",
34
+ "dev": "npm-run-all --parallel dev:sass dev:ts",
35
+ "dev:sass": "sass style:lib --watch --load-path=../../node_modules/@finos/legend-art/scss",
36
+ "dev:ts": "tsc --watch --preserveWatchOutput",
37
+ "lint:js": "cross-env NODE_ENV=production eslint --cache --cache-location ./build/.eslintcache --report-unused-disable-directives --parser-options=project:\"./tsconfig.json\" \"./src/**/*.{js,ts,tsx}\"",
38
+ "publish:prepare": "node ../../scripts/release/preparePublishContent.js",
39
+ "publish:snapshot": "node ../../scripts/release/publishDevSnapshot.js",
40
+ "test": "jest",
41
+ "test:watch": "jest --watch"
42
+ },
43
+ "dependencies": {
44
+ "@finos/legend-graph": "31.10.34",
45
+ "@finos/legend-shared": "10.0.56",
46
+ "@types/css-font-loading-module": "0.0.13",
47
+ "monaco-editor": "0.52.0"
48
+ },
49
+ "devDependencies": {
50
+ "@finos/legend-dev-utils": "2.1.23",
51
+ "@jest/globals": "29.7.0",
52
+ "cross-env": "7.0.3",
53
+ "eslint": "8.57.1",
54
+ "jest": "29.7.0",
55
+ "npm-run-all": "4.1.5",
56
+ "rimraf": "6.0.1",
57
+ "sass": "1.79.3",
58
+ "typescript": "5.6.2"
59
+ },
60
+ "peerDependencies": {
61
+ "react": "^18.0.0"
62
+ },
63
+ "publishConfig": {
64
+ "directory": "build/publishContent"
65
+ }
66
+ }
@@ -0,0 +1,151 @@
1
+ /**
2
+ * Copyright (c) 2020-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import { PURE_GRAMMAR_TOKEN } from './PureLanguage.js';
18
+ import type { editor as monacoEditorAPI } from 'monaco-editor';
19
+ import { buildCodeEditorTheme } from './themes/MonacoEditorThemeUtils.js';
20
+ import SOLARIZED_DARK_THEME_DATA from './themes/solarized-dark-color-theme.json' with { type: 'json' };
21
+ import GITHUB_DARK_THEME_DATA from './themes/Github-Theme-dark.json' with { type: 'json' };
22
+ import GITHUB_DARK_DIMMED_THEME_DATA from './themes/Github-Theme-dark-dimmed.json' with { type: 'json' };
23
+ import GITHUB_LIGHT_THEME_DATA from './themes/Github-Theme-light.json' with { type: 'json' };
24
+ import MATERIAL_DEFAULT_THEME_DATA from './themes/Material-Theme-Default.json' with { type: 'json' };
25
+ import MATERIAL_DARKER_THEME_DATA from './themes/Material-Theme-Darker.json' with { type: 'json' };
26
+ import ONE_DARK_PRO_THEME_DATA from './themes/OneDark-Pro.json' with { type: 'json' };
27
+ import ONE_DARK_PRO_DARKER_THEME_DATA from './themes/OneDark-Pro-darker.json' with { type: 'json' };
28
+
29
+ const BASE_PURE_LANGUAGE_COLOR_TOKENS: monacoEditorAPI.ITokenThemeRule[] = [
30
+ // NOTE: `monaco-editor` only accepts HEX values, not CSS variables
31
+ { token: PURE_GRAMMAR_TOKEN.IDENTIFIER, foreground: 'dcdcaa' },
32
+ { token: PURE_GRAMMAR_TOKEN.NUMBER, foreground: 'b5cea8' },
33
+ { token: PURE_GRAMMAR_TOKEN.DATE, foreground: 'b5cea8' },
34
+ { token: PURE_GRAMMAR_TOKEN.COLOR, foreground: 'b5cea8' },
35
+ { token: PURE_GRAMMAR_TOKEN.PACKAGE, foreground: '808080' },
36
+ { token: PURE_GRAMMAR_TOKEN.PARSER, foreground: 'c586c0' },
37
+ { token: PURE_GRAMMAR_TOKEN.LANGUAGE_STRUCT, foreground: 'c586c0' },
38
+ { token: PURE_GRAMMAR_TOKEN.MULTIPLICITY, foreground: '2d796b' },
39
+ { token: PURE_GRAMMAR_TOKEN.GENERICS, foreground: '2d796b' },
40
+ { token: PURE_GRAMMAR_TOKEN.PROPERTY, foreground: '9cdcfe' },
41
+ { token: PURE_GRAMMAR_TOKEN.PARAMETER, foreground: '9cdcfe' },
42
+ { token: PURE_GRAMMAR_TOKEN.VARIABLE, foreground: '4fc1ff' },
43
+ { token: PURE_GRAMMAR_TOKEN.TYPE, foreground: '3dc9b0' },
44
+ { token: `${PURE_GRAMMAR_TOKEN.STRING}.escape`, foreground: 'd7ba7d' },
45
+ ];
46
+
47
+ export enum CODE_EDITOR_THEME {
48
+ DEFAULT_DARK = 'default-dark',
49
+ GITHUB_LIGHT = 'github-light',
50
+ GITHUB_DARK = 'github-dark',
51
+ GITHUB_DARK_DIMMED = 'github-dark-dimmed',
52
+ SOLARIZED_DARK = 'solarized-dark',
53
+ ONE_DARK_PRO = 'one-dark-pro',
54
+ ONE_DARK_PRO_DARKER = 'one-dark-pro-darker',
55
+ MATERIAL_DEFAULT = 'material-default',
56
+ MATERIAL_DARKER = 'material-darker',
57
+
58
+ // default themes in Monaco editor
59
+ // See https://github.com/microsoft/vscode/blob/main/src/vs/editor/standalone/common/themes.ts
60
+ BUILT_IN__VSCODE_LIGHT = 'vs',
61
+ BUILT_IN__VSCODE_DARK = 'vs-dark',
62
+ BUILT_IN__VSCODE_HC_BLACK = 'hc-black',
63
+ BUILT_IN__VSCODE_HC_LIGHT = 'hc-light',
64
+ }
65
+
66
+ export const DEFAULT_DARK_THEME: monacoEditorAPI.IStandaloneThemeData = {
67
+ base: 'vs-dark',
68
+ inherit: true,
69
+ colors: {},
70
+ rules: [
71
+ ...BASE_PURE_LANGUAGE_COLOR_TOKENS,
72
+ // NOTE: correct a problem with syntax highlighting of string in SQL
73
+ { token: 'string.sql', foreground: 'ce9178' },
74
+ { token: 'white.sql', foreground: 'd4d4d4' },
75
+ { token: 'identifier.sql', foreground: 'd4d4d4' },
76
+ { token: 'operator.sql', foreground: 'd4d4d4' },
77
+ ],
78
+ };
79
+
80
+ export const SOLARIZED_DARK_THEME = buildCodeEditorTheme(
81
+ SOLARIZED_DARK_THEME_DATA,
82
+ CODE_EDITOR_THEME.BUILT_IN__VSCODE_DARK,
83
+ {},
84
+ [],
85
+ );
86
+
87
+ export const GITHUB_DARK_THEME = buildCodeEditorTheme(
88
+ GITHUB_DARK_THEME_DATA,
89
+ CODE_EDITOR_THEME.BUILT_IN__VSCODE_DARK,
90
+ {},
91
+ [],
92
+ );
93
+
94
+ export const GITHUB_LIGHT_THEME = buildCodeEditorTheme(
95
+ GITHUB_LIGHT_THEME_DATA,
96
+ CODE_EDITOR_THEME.BUILT_IN__VSCODE_LIGHT,
97
+ {},
98
+ [
99
+ // NOTE: `monaco-editor` only accepts HEX values, not CSS variables
100
+ // { token: PURE_GRAMMAR_TOKEN.IDENTIFIER, foreground: '000000' },
101
+ // { token: PURE_GRAMMAR_TOKEN.NUMBER, foreground: 'b5cea8' },
102
+ // { token: PURE_GRAMMAR_TOKEN.DATE, foreground: 'b5cea8' },
103
+ // { token: PURE_GRAMMAR_TOKEN.COLOR, foreground: 'b5cea8' },
104
+ // { token: PURE_GRAMMAR_TOKEN.PACKAGE, foreground: '808080' },
105
+ // { token: PURE_GRAMMAR_TOKEN.PARSER, foreground: 'c586c0' },
106
+ // { token: PURE_GRAMMAR_TOKEN.LANGUAGE_STRUCT, foreground: 'c586c0' },
107
+ // { token: PURE_GRAMMAR_TOKEN.MULTIPLICITY, foreground: '2d796b' },
108
+ // { token: PURE_GRAMMAR_TOKEN.GENERICS, foreground: '2d796b' },
109
+ // { token: PURE_GRAMMAR_TOKEN.PROPERTY, foreground: '9cdcfe' },
110
+ // { token: PURE_GRAMMAR_TOKEN.PARAMETER, foreground: '9cdcfe' },
111
+ // { token: PURE_GRAMMAR_TOKEN.VARIABLE, foreground: '4fc1ff' },
112
+ // { token: PURE_GRAMMAR_TOKEN.TYPE, foreground: '3dc9b0' },
113
+ // { token: `${PURE_GRAMMAR_TOKEN.STRING}.escape`, foreground: 'd7ba7d' },
114
+ // TODO: handle SQL formatting like in dark theme?
115
+ ],
116
+ );
117
+
118
+ export const GITHUB_DARK_DIMMED_THEME = buildCodeEditorTheme(
119
+ GITHUB_DARK_DIMMED_THEME_DATA,
120
+ CODE_EDITOR_THEME.BUILT_IN__VSCODE_DARK,
121
+ {},
122
+ [],
123
+ );
124
+
125
+ export const MATERIAL_DEFAULT_THEME = buildCodeEditorTheme(
126
+ MATERIAL_DEFAULT_THEME_DATA,
127
+ CODE_EDITOR_THEME.BUILT_IN__VSCODE_DARK,
128
+ {},
129
+ [],
130
+ );
131
+
132
+ export const MATERIAL_DARKER_THEME = buildCodeEditorTheme(
133
+ MATERIAL_DARKER_THEME_DATA,
134
+ CODE_EDITOR_THEME.BUILT_IN__VSCODE_DARK,
135
+ {},
136
+ [],
137
+ );
138
+
139
+ export const ONE_DARK_PRO_THEME = buildCodeEditorTheme(
140
+ ONE_DARK_PRO_THEME_DATA,
141
+ CODE_EDITOR_THEME.BUILT_IN__VSCODE_DARK,
142
+ {},
143
+ [],
144
+ );
145
+
146
+ export const ONE_DARK_PRO_DARKER_THEME = buildCodeEditorTheme(
147
+ ONE_DARK_PRO_DARKER_THEME_DATA,
148
+ CODE_EDITOR_THEME.BUILT_IN__VSCODE_DARK,
149
+ {},
150
+ [],
151
+ );