@finos/legend-lego 0.1.12 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/{src/code-editor/CodeEditorConfig.ts → lib/application/ActivityBar.d.ts} +7 -16
- package/lib/application/ActivityBar.d.ts.map +1 -0
- package/lib/application/ActivityBar.js +19 -0
- package/lib/application/ActivityBar.js.map +1 -0
- package/lib/application/index.d.ts +1 -0
- package/lib/application/index.d.ts.map +1 -1
- package/lib/application/index.js +1 -0
- package/lib/application/index.js.map +1 -1
- package/lib/code-editor/CodeDiffView.d.ts +1 -1
- package/lib/code-editor/CodeDiffView.d.ts.map +1 -1
- package/lib/code-editor/CodeDiffView.js +4 -11
- package/lib/code-editor/CodeDiffView.js.map +1 -1
- package/lib/code-editor/CodeEditor.d.ts +5 -2
- package/lib/code-editor/CodeEditor.d.ts.map +1 -1
- package/lib/code-editor/CodeEditor.js +15 -17
- package/lib/code-editor/CodeEditor.js.map +1 -1
- package/lib/code-editor/CodeEditorTheme.d.ts +39 -0
- package/lib/code-editor/CodeEditorTheme.d.ts.map +1 -0
- package/lib/code-editor/CodeEditorTheme.js +72 -0
- package/lib/code-editor/CodeEditorTheme.js.map +1 -0
- package/lib/code-editor/CodeEditorUtils.d.ts +11 -0
- package/lib/code-editor/CodeEditorUtils.d.ts.map +1 -1
- package/lib/code-editor/CodeEditorUtils.js +23 -0
- package/lib/code-editor/CodeEditorUtils.js.map +1 -1
- package/lib/code-editor/PureLanguage.d.ts +38 -0
- package/lib/code-editor/PureLanguage.d.ts.map +1 -0
- package/lib/code-editor/PureLanguage.js +39 -0
- package/lib/code-editor/PureLanguage.js.map +1 -0
- package/lib/code-editor/PureLanguageService.d.ts +0 -22
- package/lib/code-editor/PureLanguageService.d.ts.map +1 -1
- package/lib/code-editor/PureLanguageService.js +3 -48
- package/lib/code-editor/PureLanguageService.js.map +1 -1
- package/lib/code-editor/index.d.ts +3 -2
- package/lib/code-editor/index.d.ts.map +1 -1
- package/lib/code-editor/index.js +3 -2
- package/lib/code-editor/index.js.map +1 -1
- package/lib/code-editor/themes/Github-Theme-dark-dimmed.json +613 -0
- package/lib/code-editor/themes/Github-Theme-dark.json +513 -0
- package/lib/code-editor/themes/Material-Theme-Darker.json +816 -0
- package/lib/code-editor/themes/Material-Theme-Default.json +816 -0
- package/lib/code-editor/themes/MonacoEditorThemeUtils.d.ts +31 -0
- package/lib/code-editor/themes/MonacoEditorThemeUtils.d.ts.map +1 -0
- package/lib/code-editor/themes/MonacoEditorThemeUtils.js +88 -0
- package/lib/code-editor/themes/MonacoEditorThemeUtils.js.map +1 -0
- package/lib/code-editor/themes/OneDark-Pro-darker.json +2061 -0
- package/lib/code-editor/themes/OneDark-Pro.json +2090 -0
- package/lib/code-editor/themes/solarized-dark-color-theme.json +398 -0
- package/lib/data-grid/DataGrid.d.ts.map +1 -1
- package/lib/data-grid/DataGrid.js +13 -1
- package/lib/data-grid/DataGrid.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/package.json +7 -7
- package/{lib/code-editor/CodeEditorConfig.d.ts → src/application/ActivityBar.tsx} +16 -15
- package/src/application/index.ts +1 -0
- package/src/code-editor/CodeDiffView.tsx +4 -12
- package/src/code-editor/CodeEditor.tsx +25 -22
- package/src/code-editor/CodeEditorTheme.ts +118 -0
- package/src/code-editor/CodeEditorUtils.ts +55 -0
- package/src/code-editor/PureLanguage.ts +42 -0
- package/src/code-editor/PureLanguageService.ts +3 -56
- package/src/code-editor/index.ts +3 -5
- package/src/code-editor/themes/Github-Theme-dark-dimmed.json +613 -0
- package/src/code-editor/themes/Github-Theme-dark.json +513 -0
- package/src/code-editor/themes/Material-Theme-Darker.json +816 -0
- package/src/code-editor/themes/Material-Theme-Default.json +816 -0
- package/src/code-editor/themes/MonacoEditorThemeUtils.ts +128 -0
- package/src/code-editor/themes/OneDark-Pro-darker.json +2061 -0
- package/src/code-editor/themes/OneDark-Pro.json +2090 -0
- package/src/code-editor/themes/README.md +8 -0
- package/src/code-editor/themes/solarized-dark-color-theme.json +423 -0
- package/src/data-grid/DataGrid.tsx +12 -1
- package/tsconfig.json +12 -2
- package/lib/code-editor/CodeEditorConfig.d.ts.map +0 -1
- package/lib/code-editor/CodeEditorConfig.js +0 -33
- package/lib/code-editor/CodeEditorConfig.js.map +0 -1
@@ -13,20 +13,11 @@
|
|
13
13
|
* See the License for the specific language governing permissions and
|
14
14
|
* limitations under the License.
|
15
15
|
*/
|
16
|
-
|
17
|
-
export
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
export enum CODE_EDITOR_LANGUAGE {
|
23
|
-
TEXT = 'plaintext',
|
24
|
-
PURE = 'pure',
|
25
|
-
JSON = 'json',
|
26
|
-
JAVA = 'java',
|
27
|
-
MARKDOWN = 'markdown',
|
28
|
-
SQL = 'sql',
|
29
|
-
XML = 'xml',
|
30
|
-
YAML = 'yaml',
|
31
|
-
GRAPHQL = 'graphql',
|
16
|
+
/// <reference types="react" resolution-mode="require"/>
|
17
|
+
export interface ActivityBarItemConfig {
|
18
|
+
mode: string;
|
19
|
+
title: string;
|
20
|
+
icon: React.ReactElement;
|
32
21
|
}
|
22
|
+
export declare const ActivityBarItemExperimentalBadge: React.FC;
|
23
|
+
//# sourceMappingURL=ActivityBar.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ActivityBar.d.ts","sourceRoot":"","sources":["../../src/application/ActivityBar.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;AAIH,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,KAAK,CAAC,YAAY,CAAC;CAC1B;AAED,eAAO,MAAM,gCAAgC,EAAE,KAAK,CAAC,EAOpD,CAAC"}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
2
|
+
/**
|
3
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
4
|
+
*
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
* you may not use this file except in compliance with the License.
|
7
|
+
* You may obtain a copy of the License at
|
8
|
+
*
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
*
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
* See the License for the specific language governing permissions and
|
15
|
+
* limitations under the License.
|
16
|
+
*/
|
17
|
+
import { SparkleIcon } from '@finos/legend-art';
|
18
|
+
export const ActivityBarItemExperimentalBadge = () => (_jsx("div", { className: "activity-bar__item__experimental-badge", title: "This is an experimental feature", children: _jsx(SparkleIcon, {}) }));
|
19
|
+
//# sourceMappingURL=ActivityBar.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ActivityBar.js","sourceRoot":"","sources":["../../src/application/ActivityBar.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAQhD,MAAM,CAAC,MAAM,gCAAgC,GAAa,GAAG,EAAE,CAAC,CAC9D,cACE,SAAS,EAAC,wCAAwC,EAClD,KAAK,EAAC,iCAAiC,YAEvC,KAAC,WAAW,KAAG,GACX,CACP,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/application/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,wBAAwB,CAAC;AAEvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AAErC,cAAc,oCAAoC,CAAC"}
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/application/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,wBAAwB,CAAC;AAEvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AAErC,cAAc,oCAAoC,CAAC"}
|
package/lib/application/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/application/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,wBAAwB,CAAC;AAEvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AAErC,cAAc,oCAAoC,CAAC"}
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/application/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,wBAAwB,CAAC;AAEvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AAErC,cAAc,oCAAoC,CAAC"}
|
@@ -13,7 +13,7 @@
|
|
13
13
|
* See the License for the specific language governing permissions and
|
14
14
|
* limitations under the License.
|
15
15
|
*/
|
16
|
-
import { CODE_EDITOR_LANGUAGE } from './
|
16
|
+
import { CODE_EDITOR_LANGUAGE } from './CodeEditorUtils.js';
|
17
17
|
export declare const CodeDiffView: ((props: {
|
18
18
|
language: CODE_EDITOR_LANGUAGE;
|
19
19
|
from?: string | undefined;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CodeDiffView.d.ts","sourceRoot":"","sources":["../../src/code-editor/CodeDiffView.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;
|
1
|
+
{"version":3,"file":"CodeDiffView.d.ts","sourceRoot":"","sources":["../../src/code-editor/CodeDiffView.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAeH,OAAO,EACL,oBAAoB,EAGrB,MAAM,sBAAsB,CAAC;AAG9B,eAAO,MAAM,YAAY,WACf;IACN,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACzB;;CA8CF,CAAC;AAaF,eAAO,MAAM,YAAY,WACf;IACN,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,EAAE,CAAC,EAAE,OAAO,CAAC;IACb;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;;CAWF,CAAC"}
|
@@ -18,10 +18,9 @@ import { useEffect, useState, useRef } from 'react';
|
|
18
18
|
import { observer } from 'mobx-react-lite';
|
19
19
|
import { editor as monacoEditorAPI } from 'monaco-editor';
|
20
20
|
import { DEFAULT_TAB_SIZE, useApplicationStore, } from '@finos/legend-application';
|
21
|
-
import { useResizeDetector } from '@finos/legend-art';
|
22
21
|
import { isString, stringifyLosslessJSON, tryToFormatJSONString, tryToFormatLosslessJSONString, } from '@finos/legend-shared';
|
23
|
-
import { disposeDiffCodeEditor, getBaseCodeEditorOptions, } from './CodeEditorUtils.js';
|
24
|
-
import {
|
22
|
+
import { CODE_EDITOR_LANGUAGE, disposeDiffCodeEditor, getBaseCodeEditorOptions, } from './CodeEditorUtils.js';
|
23
|
+
import { CODE_EDITOR_THEME } from './CodeEditorTheme.js';
|
25
24
|
export const CodeDiffView = observer((props) => {
|
26
25
|
const { from, to, language } = props;
|
27
26
|
const applicationStore = useApplicationStore();
|
@@ -29,18 +28,12 @@ export const CodeDiffView = observer((props) => {
|
|
29
28
|
const editorRef = useRef(null);
|
30
29
|
const originalText = from ?? '';
|
31
30
|
const modifiedText = to ?? '';
|
32
|
-
const { ref, width, height } = useResizeDetector();
|
33
|
-
useEffect(() => {
|
34
|
-
if (width !== undefined && height !== undefined) {
|
35
|
-
editor?.layout({ width, height });
|
36
|
-
}
|
37
|
-
}, [editor, width, height]);
|
38
31
|
useEffect(() => {
|
39
32
|
if (!editor && editorRef.current) {
|
40
33
|
const element = editorRef.current;
|
41
34
|
const _editor = monacoEditorAPI.createDiffEditor(element, {
|
42
35
|
...getBaseCodeEditorOptions(),
|
43
|
-
theme: CODE_EDITOR_THEME.
|
36
|
+
theme: CODE_EDITOR_THEME.DEFAULT_DARK,
|
44
37
|
readOnly: true,
|
45
38
|
});
|
46
39
|
setEditor(_editor);
|
@@ -60,7 +53,7 @@ export const CodeDiffView = observer((props) => {
|
|
60
53
|
disposeDiffCodeEditor(editor);
|
61
54
|
}
|
62
55
|
}, [editor]);
|
63
|
-
return (_jsx("div", {
|
56
|
+
return (_jsx("div", { className: "code-editor__container", children: _jsx("div", { className: "code-editor__body", ref: editorRef }) }));
|
64
57
|
});
|
65
58
|
const formatJSONLikeValue = (value, lossless) => value
|
66
59
|
? isString(value)
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CodeDiffView.js","sourceRoot":"","sources":["../../src/code-editor/CodeDiffView.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EACL,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,2BAA2B,CAAC;AACnC,OAAO,
|
1
|
+
{"version":3,"file":"CodeDiffView.js","sourceRoot":"","sources":["../../src/code-editor/CodeDiffView.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EACL,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,QAAQ,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AAC,CACF,CAAC"}
|
@@ -15,13 +15,16 @@
|
|
15
15
|
*/
|
16
16
|
/// <reference types="react" resolution-mode="require"/>
|
17
17
|
import { editor as monacoEditorAPI } from 'monaco-editor';
|
18
|
-
import { type CODE_EDITOR_LANGUAGE } from './
|
18
|
+
import { type CODE_EDITOR_LANGUAGE } from './CodeEditorUtils.js';
|
19
|
+
import { CODE_EDITOR_THEME } from './CodeEditorTheme.js';
|
19
20
|
export declare const CodeEditor: React.FC<{
|
20
21
|
inputValue: string;
|
21
22
|
isReadOnly?: boolean | undefined;
|
23
|
+
lightTheme?: CODE_EDITOR_THEME;
|
22
24
|
language: CODE_EDITOR_LANGUAGE;
|
23
|
-
|
25
|
+
hideMinimap?: boolean | undefined;
|
24
26
|
hideGutter?: boolean | undefined;
|
27
|
+
hidePadding?: boolean | undefined;
|
25
28
|
extraEditorOptions?: (monacoEditorAPI.IEditorOptions & monacoEditorAPI.IGlobalEditorOptions) | undefined;
|
26
29
|
updateInput?: ((val: string) => void) | undefined;
|
27
30
|
}>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CodeEditor.d.ts","sourceRoot":"","sources":["../../src/code-editor/CodeEditor.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;AAGH,OAAO,EAAoB,MAAM,IAAI,eAAe,EAAE,MAAM,eAAe,CAAC;
|
1
|
+
{"version":3,"file":"CodeEditor.d.ts","sourceRoot":"","sources":["../../src/code-editor/CodeEditor.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;AAGH,OAAO,EAAoB,MAAM,IAAI,eAAe,EAAE,MAAM,eAAe,CAAC;AAC5E,OAAO,EAML,KAAK,oBAAoB,EAC1B,MAAM,sBAAsB,CAAC;AAK9B,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAGzD,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACjC,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAC/B,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,WAAW,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAClC,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACjC,WAAW,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAClC,kBAAkB,CAAC,EACf,CAAC,eAAe,CAAC,cAAc,GAAG,eAAe,CAAC,oBAAoB,CAAC,GACvE,SAAS,CAAC;IACd,WAAW,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;CACnD,CAqHA,CAAC"}
|
@@ -17,11 +17,11 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
17
|
import { useState, useRef, useEffect } from 'react';
|
18
18
|
import { editor as monacoEditorAPI } from 'monaco-editor';
|
19
19
|
import { disposeCodeEditor, getBaseCodeEditorOptions, resetLineNumberGutterWidth, getCodeEditorValue, normalizeLineEnding, } from './CodeEditorUtils.js';
|
20
|
-
import { useResizeDetector } from '@finos/legend-art';
|
21
20
|
import { DEFAULT_TAB_SIZE, useApplicationStore, } from '@finos/legend-application';
|
22
|
-
import { CODE_EDITOR_THEME
|
21
|
+
import { CODE_EDITOR_THEME } from './CodeEditorTheme.js';
|
22
|
+
import { clsx } from '@finos/legend-art';
|
23
23
|
export const CodeEditor = (props) => {
|
24
|
-
const { inputValue, updateInput, language, isReadOnly,
|
24
|
+
const { inputValue, updateInput, lightTheme, language, isReadOnly, hideMinimap, hideGutter, hidePadding, extraEditorOptions, } = props;
|
25
25
|
const applicationStore = useApplicationStore();
|
26
26
|
const [editor, setEditor] = useState();
|
27
27
|
const onDidChangeModelContentEventDisposer = useRef(undefined);
|
@@ -35,12 +35,6 @@ export const CodeEditor = (props) => {
|
|
35
35
|
*/
|
36
36
|
const value = normalizeLineEnding(inputValue);
|
37
37
|
const textInputRef = useRef(null);
|
38
|
-
const { ref, width, height } = useResizeDetector();
|
39
|
-
useEffect(() => {
|
40
|
-
if (width !== undefined && height !== undefined) {
|
41
|
-
editor?.layout({ width, height });
|
42
|
-
}
|
43
|
-
}, [editor, width, height]);
|
44
38
|
useEffect(() => {
|
45
39
|
if (!editor && textInputRef.current) {
|
46
40
|
const element = textInputRef.current;
|
@@ -48,14 +42,17 @@ export const CodeEditor = (props) => {
|
|
48
42
|
...getBaseCodeEditorOptions(),
|
49
43
|
theme: applicationStore.layoutService
|
50
44
|
.TEMPORARY__isLightColorThemeEnabled
|
51
|
-
? CODE_EDITOR_THEME.
|
52
|
-
: CODE_EDITOR_THEME.
|
45
|
+
? lightTheme ?? CODE_EDITOR_THEME.BUILT_IN__VSCODE_LIGHT
|
46
|
+
: CODE_EDITOR_THEME.DEFAULT_DARK,
|
47
|
+
// layout
|
48
|
+
glyphMargin: !hidePadding,
|
49
|
+
padding: !hidePadding ? { top: 20, bottom: 20 } : { top: 0, bottom: 0 },
|
53
50
|
formatOnType: true,
|
54
51
|
formatOnPaste: true,
|
55
52
|
});
|
56
53
|
setEditor(_editor);
|
57
54
|
}
|
58
|
-
}, [applicationStore, editor]);
|
55
|
+
}, [applicationStore, lightTheme, hidePadding, editor]);
|
59
56
|
useEffect(() => {
|
60
57
|
if (editor) {
|
61
58
|
resetLineNumberGutterWidth(editor);
|
@@ -83,16 +80,15 @@ export const CodeEditor = (props) => {
|
|
83
80
|
}
|
84
81
|
editor.updateOptions({
|
85
82
|
readOnly: Boolean(isReadOnly),
|
86
|
-
minimap: { enabled:
|
83
|
+
minimap: { enabled: !hideMinimap },
|
87
84
|
// Hide the line number gutter
|
88
85
|
// See https://github.com/microsoft/vscode/issues/30795
|
89
86
|
...(hideGutter
|
90
87
|
? {
|
91
|
-
glyphMargin:
|
88
|
+
glyphMargin: !hidePadding,
|
92
89
|
folding: false,
|
93
90
|
lineNumbers: 'off',
|
94
|
-
lineDecorationsWidth:
|
95
|
-
lineNumbersMinChars: 0,
|
91
|
+
lineDecorationsWidth: 0,
|
96
92
|
}
|
97
93
|
: {}),
|
98
94
|
...(extraEditorOptions ?? {}),
|
@@ -106,6 +102,8 @@ export const CodeEditor = (props) => {
|
|
106
102
|
disposeCodeEditor(editor);
|
107
103
|
}
|
108
104
|
}, [editor]);
|
109
|
-
return (_jsx("div", {
|
105
|
+
return (_jsx("div", { className: clsx('code-editor__container', {
|
106
|
+
'code-editor__container--padding': !hidePadding,
|
107
|
+
}), children: _jsx("div", { className: "code-editor__body", ref: textInputRef }) }));
|
110
108
|
};
|
111
109
|
//# sourceMappingURL=CodeEditor.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CodeEditor.js","sourceRoot":"","sources":["../../src/code-editor/CodeEditor.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAoB,MAAM,IAAI,eAAe,EAAE,MAAM,eAAe,CAAC;AAC5E,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EACxB,0BAA0B,EAC1B,kBAAkB,EAClB,mBAAmB,
|
1
|
+
{"version":3,"file":"CodeEditor.js","sourceRoot":"","sources":["../../src/code-editor/CodeEditor.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAoB,MAAM,IAAI,eAAe,EAAE,MAAM,eAAe,CAAC;AAC5E,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EACxB,0BAA0B,EAC1B,kBAAkB,EAClB,mBAAmB,GAEpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,iBAAiB,EAAE,MAAM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EAAE,CAAC;iBACxB;gBACH,CAAC,CAAC,EAAE,CAAC;YACP,GAAG,CAAC,kBAAkB,IAAI,EAAE,CAAC;SAC9B,CAAC,CAAC;QACH,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC;QAChC,KAAK,EAAE,aAAa,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,CAAC,CAAC;KACrD;IAED,iBAAiB;IACjB,SAAS,CACP,GAAG,EAAE,CAAC,GAAS,EAAE;QACf,IAAI,MAAM,EAAE;YACV,iBAAiB,CAAC,MAAM,CAAC,CAAC;SAC3B;IACH,CAAC,EACD,CAAC,MAAM,CAAC,CACT,CAAC;IAEF,OAAO,CACL,cACE,SAAS,EAAE,IAAI,CAAC,wBAAwB,EAAE;YACxC,iCAAiC,EAAE,CAAC,WAAW;SAChD,CAAC,YAEF,cAAK,SAAS,EAAC,mBAAmB,EAAC,GAAG,EAAE,YAAY,GAAI,GACpD,CACP,CAAC;AACJ,CAAC,CAAC"}
|
@@ -0,0 +1,39 @@
|
|
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
|
+
import type { editor as monacoEditorAPI } from 'monaco-editor';
|
17
|
+
export declare enum CODE_EDITOR_THEME {
|
18
|
+
DEFAULT_DARK = "default-dark",
|
19
|
+
GITHUB_DARK = "github-dark",
|
20
|
+
GITHUB_DARK_DIMMED = "github-dark-dimmed",
|
21
|
+
SOLARIZED_DARK = "solarized-dark",
|
22
|
+
ONE_DARK_PRO = "one-dark-pro",
|
23
|
+
ONE_DARK_PRO_DARKER = "one-dark-pro-darker",
|
24
|
+
MATERIAL_DEFAULT = "material-default",
|
25
|
+
MATERIAL_DARKER = "material-darker",
|
26
|
+
BUILT_IN__VSCODE_LIGHT = "vs",
|
27
|
+
BUILT_IN__VSCODE_DARK = "vs-dark",
|
28
|
+
BUILT_IN__VSCODE_HC_BLACK = "hc-black",
|
29
|
+
BUILT_IN__VSCODE_HC_LIGHT = "hc-light"
|
30
|
+
}
|
31
|
+
export declare const DEFAULT_DARK_THEME: monacoEditorAPI.IStandaloneThemeData;
|
32
|
+
export declare const SOLARIZED_DARK_THEME: monacoEditorAPI.IStandaloneThemeData;
|
33
|
+
export declare const GITHUB_DARK_THEME: monacoEditorAPI.IStandaloneThemeData;
|
34
|
+
export declare const GITHUB_DARK_DIMMED_THEME: monacoEditorAPI.IStandaloneThemeData;
|
35
|
+
export declare const MATERIAL_DEFAULT_THEME: monacoEditorAPI.IStandaloneThemeData;
|
36
|
+
export declare const MATERIAL_DARKER_THEME: monacoEditorAPI.IStandaloneThemeData;
|
37
|
+
export declare const ONE_DARK_PRO_THEME: monacoEditorAPI.IStandaloneThemeData;
|
38
|
+
export declare const ONE_DARK_PRO_DARKER_THEME: monacoEditorAPI.IStandaloneThemeData;
|
39
|
+
//# sourceMappingURL=CodeEditorTheme.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"CodeEditorTheme.d.ts","sourceRoot":"","sources":["../../src/code-editor/CodeEditorTheme.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,eAAe,CAAC;AA4B/D,oBAAY,iBAAiB;IAC3B,YAAY,iBAAiB;IAC7B,WAAW,gBAAgB;IAC3B,kBAAkB,uBAAuB;IACzC,cAAc,mBAAmB;IACjC,YAAY,iBAAiB;IAC7B,mBAAmB,wBAAwB;IAC3C,gBAAgB,qBAAqB;IACrC,eAAe,oBAAoB;IAInC,sBAAsB,OAAO;IAC7B,qBAAqB,YAAY;IACjC,yBAAyB,aAAa;IACtC,yBAAyB,aAAa;CACvC;AAED,eAAO,MAAM,kBAAkB,EAAE,eAAe,CAAC,oBAKhD,CAAC;AAEF,eAAO,MAAM,oBAAoB,sCAKhC,CAAC;AAEF,eAAO,MAAM,iBAAiB,sCAK7B,CAAC;AAEF,eAAO,MAAM,wBAAwB,sCAKpC,CAAC;AAEF,eAAO,MAAM,sBAAsB,sCAKlC,CAAC;AAEF,eAAO,MAAM,qBAAqB,sCAKjC,CAAC;AAEF,eAAO,MAAM,kBAAkB,sCAK9B,CAAC;AAEF,eAAO,MAAM,yBAAyB,sCAKrC,CAAC"}
|
@@ -0,0 +1,72 @@
|
|
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
|
+
import { PURE_GRAMMAR_TOKEN } from './PureLanguage.js';
|
17
|
+
import { buildCodeEditorTheme } from './themes/MonacoEditorThemeUtils.js';
|
18
|
+
import SOLARIZED_DARK_THEME_DATA from './themes/solarized-dark-color-theme.json';
|
19
|
+
import GITHUB_DARK_THEME_DATA from './themes/Github-Theme-dark.json';
|
20
|
+
import GITHUB_DARK_DIMMED_THEME_DATA from './themes/Github-Theme-dark-dimmed.json';
|
21
|
+
import MATERIAL_DEFAULT_THEME_DATA from './themes/Material-Theme-Default.json';
|
22
|
+
import MATERIAL_DARKER_THEME_DATA from './themes/Material-Theme-Darker.json';
|
23
|
+
import ONE_DARK_PRO_THEME_DATA from './themes/OneDark-Pro.json';
|
24
|
+
import ONE_DARK_PRO_DARKER_THEME_DATA from './themes/OneDark-Pro-darker.json';
|
25
|
+
const BASE_PURE_LANGUAGE_COLOR_TOKENS = [
|
26
|
+
// NOTE: `monaco-editor` only accepts HEX values, not CSS variables
|
27
|
+
{ token: PURE_GRAMMAR_TOKEN.IDENTIFIER, foreground: 'dcdcaa' },
|
28
|
+
{ token: PURE_GRAMMAR_TOKEN.NUMBER, foreground: 'b5cea8' },
|
29
|
+
{ token: PURE_GRAMMAR_TOKEN.DATE, foreground: 'b5cea8' },
|
30
|
+
{ token: PURE_GRAMMAR_TOKEN.COLOR, foreground: 'b5cea8' },
|
31
|
+
{ token: PURE_GRAMMAR_TOKEN.PACKAGE, foreground: '808080' },
|
32
|
+
{ token: PURE_GRAMMAR_TOKEN.PARSER, foreground: 'c586c0' },
|
33
|
+
{ token: PURE_GRAMMAR_TOKEN.LANGUAGE_STRUCT, foreground: 'c586c0' },
|
34
|
+
{ token: PURE_GRAMMAR_TOKEN.MULTIPLICITY, foreground: '2d796b' },
|
35
|
+
{ token: PURE_GRAMMAR_TOKEN.GENERICS, foreground: '2d796b' },
|
36
|
+
{ token: PURE_GRAMMAR_TOKEN.PROPERTY, foreground: '9cdcfe' },
|
37
|
+
{ token: PURE_GRAMMAR_TOKEN.PARAMETER, foreground: '9cdcfe' },
|
38
|
+
{ token: PURE_GRAMMAR_TOKEN.VARIABLE, foreground: '4fc1ff' },
|
39
|
+
{ token: PURE_GRAMMAR_TOKEN.TYPE, foreground: '3dc9b0' },
|
40
|
+
{ token: `${PURE_GRAMMAR_TOKEN.STRING}.escape`, foreground: 'd7ba7d' },
|
41
|
+
];
|
42
|
+
export var CODE_EDITOR_THEME;
|
43
|
+
(function (CODE_EDITOR_THEME) {
|
44
|
+
CODE_EDITOR_THEME["DEFAULT_DARK"] = "default-dark";
|
45
|
+
CODE_EDITOR_THEME["GITHUB_DARK"] = "github-dark";
|
46
|
+
CODE_EDITOR_THEME["GITHUB_DARK_DIMMED"] = "github-dark-dimmed";
|
47
|
+
CODE_EDITOR_THEME["SOLARIZED_DARK"] = "solarized-dark";
|
48
|
+
CODE_EDITOR_THEME["ONE_DARK_PRO"] = "one-dark-pro";
|
49
|
+
CODE_EDITOR_THEME["ONE_DARK_PRO_DARKER"] = "one-dark-pro-darker";
|
50
|
+
CODE_EDITOR_THEME["MATERIAL_DEFAULT"] = "material-default";
|
51
|
+
CODE_EDITOR_THEME["MATERIAL_DARKER"] = "material-darker";
|
52
|
+
// default themes in Monaco editor
|
53
|
+
// See https://github.com/microsoft/vscode/blob/main/src/vs/editor/standalone/common/themes.ts
|
54
|
+
CODE_EDITOR_THEME["BUILT_IN__VSCODE_LIGHT"] = "vs";
|
55
|
+
CODE_EDITOR_THEME["BUILT_IN__VSCODE_DARK"] = "vs-dark";
|
56
|
+
CODE_EDITOR_THEME["BUILT_IN__VSCODE_HC_BLACK"] = "hc-black";
|
57
|
+
CODE_EDITOR_THEME["BUILT_IN__VSCODE_HC_LIGHT"] = "hc-light";
|
58
|
+
})(CODE_EDITOR_THEME = CODE_EDITOR_THEME || (CODE_EDITOR_THEME = {}));
|
59
|
+
export const DEFAULT_DARK_THEME = {
|
60
|
+
base: 'vs-dark',
|
61
|
+
inherit: true,
|
62
|
+
colors: {},
|
63
|
+
rules: BASE_PURE_LANGUAGE_COLOR_TOKENS,
|
64
|
+
};
|
65
|
+
export const SOLARIZED_DARK_THEME = buildCodeEditorTheme(SOLARIZED_DARK_THEME_DATA, CODE_EDITOR_THEME.BUILT_IN__VSCODE_DARK, {}, []);
|
66
|
+
export const GITHUB_DARK_THEME = buildCodeEditorTheme(GITHUB_DARK_THEME_DATA, CODE_EDITOR_THEME.BUILT_IN__VSCODE_DARK, {}, []);
|
67
|
+
export const GITHUB_DARK_DIMMED_THEME = buildCodeEditorTheme(GITHUB_DARK_DIMMED_THEME_DATA, CODE_EDITOR_THEME.BUILT_IN__VSCODE_DARK, {}, []);
|
68
|
+
export const MATERIAL_DEFAULT_THEME = buildCodeEditorTheme(MATERIAL_DEFAULT_THEME_DATA, CODE_EDITOR_THEME.BUILT_IN__VSCODE_DARK, {}, []);
|
69
|
+
export const MATERIAL_DARKER_THEME = buildCodeEditorTheme(MATERIAL_DARKER_THEME_DATA, CODE_EDITOR_THEME.BUILT_IN__VSCODE_DARK, {}, []);
|
70
|
+
export const ONE_DARK_PRO_THEME = buildCodeEditorTheme(ONE_DARK_PRO_THEME_DATA, CODE_EDITOR_THEME.BUILT_IN__VSCODE_DARK, {}, []);
|
71
|
+
export const ONE_DARK_PRO_DARKER_THEME = buildCodeEditorTheme(ONE_DARK_PRO_DARKER_THEME_DATA, CODE_EDITOR_THEME.BUILT_IN__VSCODE_DARK, {}, []);
|
72
|
+
//# sourceMappingURL=CodeEditorTheme.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"CodeEditorTheme.js","sourceRoot":"","sources":["../../src/code-editor/CodeEditorTheme.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,yBAAyB,MAAM,0CAA0C,CAAC;AACjF,OAAO,sBAAsB,MAAM,iCAAiC,CAAC;AACrE,OAAO,6BAA6B,MAAM,wCAAwC,CAAC;AACnF,OAAO,2BAA2B,MAAM,sCAAsC,CAAC;AAC/E,OAAO,0BAA0B,MAAM,qCAAqC,CAAC;AAC7E,OAAO,uBAAuB,MAAM,2BAA2B,CAAC;AAChE,OAAO,8BAA8B,MAAM,kCAAkC,CAAC;AAE9E,MAAM,+BAA+B,GAAsC;I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,8BAA8B,EAC9B,iBAAiB,CAAC,qBAAqB,EACvC,EAAE,EACF,EAAE,CACH,CAAC"}
|
@@ -60,4 +60,15 @@ export declare const clearMarkers: (ownerId?: string) => void;
|
|
60
60
|
export declare const normalizeLineEnding: (val: string) => string;
|
61
61
|
export declare const resetLineNumberGutterWidth: (editor: monacoEditorAPI.ICodeEditor) => void;
|
62
62
|
export declare const configureCodeEditorComponent: (applicationStore: GenericLegendApplicationStore) => Promise<void>;
|
63
|
+
export declare enum CODE_EDITOR_LANGUAGE {
|
64
|
+
TEXT = "plaintext",
|
65
|
+
PURE = "pure",
|
66
|
+
JSON = "json",
|
67
|
+
JAVA = "java",
|
68
|
+
MARKDOWN = "markdown",
|
69
|
+
SQL = "sql",
|
70
|
+
XML = "xml",
|
71
|
+
YAML = "yaml",
|
72
|
+
GRAPHQL = "graphql"
|
73
|
+
}
|
63
74
|
//# sourceMappingURL=CodeEditorUtils.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CodeEditorUtils.d.ts","sourceRoot":"","sources":["../../src/code-editor/CodeEditorUtils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAGL,KAAK,6BAA6B,EACnC,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACL,MAAM,IAAI,eAAe,EAI1B,MAAM,eAAe,CAAC;
|
1
|
+
{"version":3,"file":"CodeEditorUtils.d.ts","sourceRoot":"","sources":["../../src/code-editor/CodeEditorUtils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAGL,KAAK,6BAA6B,EACnC,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACL,MAAM,IAAI,eAAe,EAI1B,MAAM,eAAe,CAAC;AAavB,MAAM,MAAM,kBAAkB,GAAG;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,i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AS;IACb,QAAQ,aAAa;IACrB,GAAG,QAAQ;IACX,GAAG,QAAQ;IACX,IAAI,SAAS;IACb,OAAO,YAAY;CACpB"}
|
@@ -16,6 +16,7 @@
|
|
16
16
|
import { APPLICATION_EVENT, DEFAULT_MONOSPACED_FONT_FAMILY, } from '@finos/legend-application';
|
17
17
|
import { LogEvent } from '@finos/legend-shared';
|
18
18
|
import { editor as monacoEditorAPI, KeyCode, KeyMod, MarkerSeverity, } from 'monaco-editor';
|
19
|
+
import { CODE_EDITOR_THEME, DEFAULT_DARK_THEME, GITHUB_DARK_DIMMED_THEME, GITHUB_DARK_THEME, MATERIAL_DARKER_THEME, MATERIAL_DEFAULT_THEME, ONE_DARK_PRO_DARKER_THEME, ONE_DARK_PRO_THEME, SOLARIZED_DARK_THEME, } from './CodeEditorTheme.js';
|
19
20
|
/**
|
20
21
|
* Normally `monaco-editor` worker disposes after 5 minutes staying idle, but we fasten
|
21
22
|
* this pace just in case the usage of the editor causes memory-leak somehow
|
@@ -65,6 +66,7 @@ export const getBaseCodeEditorOptions = () => ({
|
|
65
66
|
// The typing is currently not correct for `bracketPairColorization`, until this is fixed, we will remove the cast
|
66
67
|
// See https://github.com/microsoft/monaco-editor/issues/3013
|
67
68
|
'bracketPairColorization.enabled': false,
|
69
|
+
automaticLayout: true,
|
68
70
|
});
|
69
71
|
export const getBaseConsoleOptions = () => ({
|
70
72
|
...getBaseCodeEditorOptions(),
|
@@ -175,5 +177,26 @@ export const configureCodeEditorComponent = async (applicationStore) => {
|
|
175
177
|
command: OVERRIDE_DEFAULT_KEYBINDING_COMMAND,
|
176
178
|
commandArgs: keyCombination,
|
177
179
|
})));
|
180
|
+
// themes
|
181
|
+
monacoEditorAPI.defineTheme(CODE_EDITOR_THEME.DEFAULT_DARK, DEFAULT_DARK_THEME);
|
182
|
+
monacoEditorAPI.defineTheme(CODE_EDITOR_THEME.SOLARIZED_DARK, SOLARIZED_DARK_THEME);
|
183
|
+
monacoEditorAPI.defineTheme(CODE_EDITOR_THEME.GITHUB_DARK, GITHUB_DARK_THEME);
|
184
|
+
monacoEditorAPI.defineTheme(CODE_EDITOR_THEME.GITHUB_DARK_DIMMED, GITHUB_DARK_DIMMED_THEME);
|
185
|
+
monacoEditorAPI.defineTheme(CODE_EDITOR_THEME.MATERIAL_DEFAULT, MATERIAL_DEFAULT_THEME);
|
186
|
+
monacoEditorAPI.defineTheme(CODE_EDITOR_THEME.MATERIAL_DARKER, MATERIAL_DARKER_THEME);
|
187
|
+
monacoEditorAPI.defineTheme(CODE_EDITOR_THEME.ONE_DARK_PRO, ONE_DARK_PRO_THEME);
|
188
|
+
monacoEditorAPI.defineTheme(CODE_EDITOR_THEME.ONE_DARK_PRO_DARKER, ONE_DARK_PRO_DARKER_THEME);
|
178
189
|
};
|
190
|
+
export var CODE_EDITOR_LANGUAGE;
|
191
|
+
(function (CODE_EDITOR_LANGUAGE) {
|
192
|
+
CODE_EDITOR_LANGUAGE["TEXT"] = "plaintext";
|
193
|
+
CODE_EDITOR_LANGUAGE["PURE"] = "pure";
|
194
|
+
CODE_EDITOR_LANGUAGE["JSON"] = "json";
|
195
|
+
CODE_EDITOR_LANGUAGE["JAVA"] = "java";
|
196
|
+
CODE_EDITOR_LANGUAGE["MARKDOWN"] = "markdown";
|
197
|
+
CODE_EDITOR_LANGUAGE["SQL"] = "sql";
|
198
|
+
CODE_EDITOR_LANGUAGE["XML"] = "xml";
|
199
|
+
CODE_EDITOR_LANGUAGE["YAML"] = "yaml";
|
200
|
+
CODE_EDITOR_LANGUAGE["GRAPHQL"] = "graphql";
|
201
|
+
})(CODE_EDITOR_LANGUAGE = CODE_EDITOR_LANGUAGE || (CODE_EDITOR_LANGUAGE = {}));
|
179
202
|
//# sourceMappingURL=CodeEditorUtils.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CodeEditorUtils.js","sourceRoot":"","sources":["../../src/code-editor/CodeEditorUtils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,iBAAiB,EACjB,8BAA8B,GAE/B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EACL,MAAM,IAAI,eAAe,EACzB,OAAO,EACP,MAAM,EACN,cAAc,GACf,MAAM,eAAe,CAAC;
|
1
|
+
{"version":3,"file":"CodeEditorUtils.js","sourceRoot":"","sources":["../../src/code-editor/CodeEditorUtils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,iBAAiB,EACjB,8BAA8B,GAE/B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EACL,MAAM,IAAI,eAAe,EACzB,OAAO,EACP,MAAM,EACN,cAAc,GACf,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,wBAAwB,EACxB,iBAAiB,EACjB,qBAAqB,EACrB,sBAAsB,EACtB,yBAAyB,EACzB,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAO9B;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,MAA6C,EACvC,EAAE;IACR,MAAM,CAAC,OAAO,EAAE,CAAC;IACjB,yEAAyE;IACzE,MAAM,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,CAAC;AAC/B,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACnC,MAA6C,EACvC,EAAE;IACR,MAAM,CAAC,OAAO,EAAE,CAAC;IACjB,MAAM,CAAC,iBAAiB,EAAE,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,CAAC;IACjD,MAAM,CAAC,iBAAiB,EAAE,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,CAAC;AACnD,CAAC,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,kBA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B,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAN,IAAY,oBAUX;AAVD,WAAY,oBAAoB;IAC9B,0CAAkB,CAAA;IAClB,qCAAa,CAAA;IACb,qCAAa,CAAA;IACb,qCAAa,CAAA;IACb,6CAAqB,CAAA;IACrB,mCAAW,CAAA;IACX,mCAAW,CAAA;IACX,qCAAa,CAAA;IACb,2CAAmB,CAAA;AACrB,CAAC,EAVW,oBAAoB,GAApB,oBAAoB,KAApB,oBAAoB,QAU/B"}
|
@@ -0,0 +1,38 @@
|
|
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
|
+
export declare enum PURE_GRAMMAR_TOKEN {
|
17
|
+
WHITESPACE = "",
|
18
|
+
KEYWORD = "keyword",
|
19
|
+
IDENTIFIER = "identifier",
|
20
|
+
OPERATOR = "operator",
|
21
|
+
DELIMITER = "delimiter",
|
22
|
+
PARSER = "parser",
|
23
|
+
NUMBER = "number",
|
24
|
+
DATE = "date",
|
25
|
+
COLOR = "color",
|
26
|
+
PACKAGE = "package",
|
27
|
+
STRING = "string",
|
28
|
+
COMMENT = "comment",
|
29
|
+
LANGUAGE_STRUCT = "language-struct",
|
30
|
+
MULTIPLICITY = "multiplicity",
|
31
|
+
GENERICS = "generics",
|
32
|
+
PROPERTY = "property",
|
33
|
+
PARAMETER = "property",
|
34
|
+
VARIABLE = "variable",
|
35
|
+
TYPE = "type",
|
36
|
+
INVALID = "invalid"
|
37
|
+
}
|
38
|
+
//# sourceMappingURL=PureLanguage.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"PureLanguage.d.ts","sourceRoot":"","sources":["../../src/code-editor/PureLanguage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,oBAAY,kBAAkB;IAC5B,UAAU,KAAK;IAEf,OAAO,YAAY;IACnB,UAAU,eAAe;IACzB,QAAQ,aAAa;IACrB,SAAS,cAAc;IAEvB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,KAAK,UAAU;IACf,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,OAAO,YAAY;IAEnB,eAAe,oBAAoB;IACnC,YAAY,iBAAiB;IAC7B,QAAQ,aAAa;IACrB,QAAQ,aAAa;IACrB,SAAS,aAAa;IACtB,QAAQ,aAAa;IACrB,IAAI,SAAS;IAEb,OAAO,YAAY;CACpB"}
|
@@ -0,0 +1,39 @@
|
|
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
|
+
export var PURE_GRAMMAR_TOKEN;
|
17
|
+
(function (PURE_GRAMMAR_TOKEN) {
|
18
|
+
PURE_GRAMMAR_TOKEN["WHITESPACE"] = "";
|
19
|
+
PURE_GRAMMAR_TOKEN["KEYWORD"] = "keyword";
|
20
|
+
PURE_GRAMMAR_TOKEN["IDENTIFIER"] = "identifier";
|
21
|
+
PURE_GRAMMAR_TOKEN["OPERATOR"] = "operator";
|
22
|
+
PURE_GRAMMAR_TOKEN["DELIMITER"] = "delimiter";
|
23
|
+
PURE_GRAMMAR_TOKEN["PARSER"] = "parser";
|
24
|
+
PURE_GRAMMAR_TOKEN["NUMBER"] = "number";
|
25
|
+
PURE_GRAMMAR_TOKEN["DATE"] = "date";
|
26
|
+
PURE_GRAMMAR_TOKEN["COLOR"] = "color";
|
27
|
+
PURE_GRAMMAR_TOKEN["PACKAGE"] = "package";
|
28
|
+
PURE_GRAMMAR_TOKEN["STRING"] = "string";
|
29
|
+
PURE_GRAMMAR_TOKEN["COMMENT"] = "comment";
|
30
|
+
PURE_GRAMMAR_TOKEN["LANGUAGE_STRUCT"] = "language-struct";
|
31
|
+
PURE_GRAMMAR_TOKEN["MULTIPLICITY"] = "multiplicity";
|
32
|
+
PURE_GRAMMAR_TOKEN["GENERICS"] = "generics";
|
33
|
+
PURE_GRAMMAR_TOKEN["PROPERTY"] = "property";
|
34
|
+
PURE_GRAMMAR_TOKEN["PARAMETER"] = "property";
|
35
|
+
PURE_GRAMMAR_TOKEN["VARIABLE"] = "variable";
|
36
|
+
PURE_GRAMMAR_TOKEN["TYPE"] = "type";
|
37
|
+
PURE_GRAMMAR_TOKEN["INVALID"] = "invalid";
|
38
|
+
})(PURE_GRAMMAR_TOKEN = PURE_GRAMMAR_TOKEN || (PURE_GRAMMAR_TOKEN = {}));
|
39
|
+
//# sourceMappingURL=PureLanguage.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"PureLanguage.js","sourceRoot":"","sources":["../../src/code-editor/PureLanguage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,MAAM,CAAN,IAAY,kBAyBX;AAzBD,WAAY,kBAAkB;IAC5B,qCAAe,CAAA;IAEf,yCAAmB,CAAA;IACnB,+CAAyB,CAAA;IACzB,2CAAqB,CAAA;IACrB,6CAAuB,CAAA;IAEvB,uCAAiB,CAAA;IACjB,uCAAiB,CAAA;IACjB,mCAAa,CAAA;IACb,qCAAe,CAAA;IACf,yCAAmB,CAAA;IACnB,uCAAiB,CAAA;IACjB,yCAAmB,CAAA;IAEnB,yDAAmC,CAAA;IACnC,mDAA6B,CAAA;IAC7B,2CAAqB,CAAA;IACrB,2CAAqB,CAAA;IACrB,4CAAsB,CAAA;IACtB,2CAAqB,CAAA;IACrB,mCAAa,CAAA;IAEb,yCAAmB,CAAA;AACrB,CAAC,EAzBW,kBAAkB,GAAlB,kBAAkB,KAAlB,kBAAkB,QAyB7B"}
|