@finos/legend-lego 1.2.72 → 2.0.1

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 (69) hide show
  1. package/lib/code-editor/CodeDiffView.d.ts +3 -1
  2. package/lib/code-editor/CodeDiffView.d.ts.map +1 -1
  3. package/lib/code-editor/CodeDiffView.js +6 -2
  4. package/lib/code-editor/CodeDiffView.js.map +1 -1
  5. package/lib/code-editor/CodeEditor.d.ts +8 -2
  6. package/lib/code-editor/CodeEditor.d.ts.map +1 -1
  7. package/lib/code-editor/CodeEditor.js +42 -4
  8. package/lib/code-editor/CodeEditor.js.map +1 -1
  9. package/lib/code-editor/index.d.ts +0 -5
  10. package/lib/code-editor/index.d.ts.map +1 -1
  11. package/lib/code-editor/index.js +0 -5
  12. package/lib/code-editor/index.js.map +1 -1
  13. package/lib/data-grid/DataGrid.d.ts.map +1 -1
  14. package/lib/data-grid/DataGrid.js +1 -13
  15. package/lib/data-grid/DataGrid.js.map +1 -1
  16. package/lib/index.css +1 -1
  17. package/package.json +29 -29
  18. package/src/code-editor/CodeDiffView.tsx +10 -3
  19. package/src/code-editor/CodeEditor.tsx +69 -4
  20. package/src/code-editor/index.ts +0 -6
  21. package/src/data-grid/DataGrid.tsx +0 -6
  22. package/tsconfig.json +1 -15
  23. package/lib/code-editor/CodeEditorTheme.d.ts +0 -41
  24. package/lib/code-editor/CodeEditorTheme.d.ts.map +0 -1
  25. package/lib/code-editor/CodeEditorTheme.js +0 -99
  26. package/lib/code-editor/CodeEditorTheme.js.map +0 -1
  27. package/lib/code-editor/CodeEditorUtils.d.ts +0 -74
  28. package/lib/code-editor/CodeEditorUtils.d.ts.map +0 -1
  29. package/lib/code-editor/CodeEditorUtils.js +0 -203
  30. package/lib/code-editor/CodeEditorUtils.js.map +0 -1
  31. package/lib/code-editor/PureLanguage.d.ts +0 -38
  32. package/lib/code-editor/PureLanguage.d.ts.map +0 -1
  33. package/lib/code-editor/PureLanguage.js +0 -39
  34. package/lib/code-editor/PureLanguage.js.map +0 -1
  35. package/lib/code-editor/PureLanguageCodeEditorSupport.d.ts +0 -71
  36. package/lib/code-editor/PureLanguageCodeEditorSupport.d.ts.map +0 -1
  37. package/lib/code-editor/PureLanguageCodeEditorSupport.js +0 -238
  38. package/lib/code-editor/PureLanguageCodeEditorSupport.js.map +0 -1
  39. package/lib/code-editor/PureLanguageService.d.ts +0 -19
  40. package/lib/code-editor/PureLanguageService.d.ts.map +0 -1
  41. package/lib/code-editor/PureLanguageService.js +0 -373
  42. package/lib/code-editor/PureLanguageService.js.map +0 -1
  43. package/lib/code-editor/themes/Github-Theme-dark-dimmed.json +0 -613
  44. package/lib/code-editor/themes/Github-Theme-dark.json +0 -513
  45. package/lib/code-editor/themes/Github-Theme-light.json +0 -598
  46. package/lib/code-editor/themes/Material-Theme-Darker.json +0 -816
  47. package/lib/code-editor/themes/Material-Theme-Default.json +0 -816
  48. package/lib/code-editor/themes/MonacoEditorThemeUtils.d.ts +0 -31
  49. package/lib/code-editor/themes/MonacoEditorThemeUtils.d.ts.map +0 -1
  50. package/lib/code-editor/themes/MonacoEditorThemeUtils.js +0 -88
  51. package/lib/code-editor/themes/MonacoEditorThemeUtils.js.map +0 -1
  52. package/lib/code-editor/themes/OneDark-Pro-darker.json +0 -2061
  53. package/lib/code-editor/themes/OneDark-Pro.json +0 -2090
  54. package/lib/code-editor/themes/solarized-dark-color-theme.json +0 -398
  55. package/src/code-editor/CodeEditorTheme.ts +0 -151
  56. package/src/code-editor/CodeEditorUtils.ts +0 -336
  57. package/src/code-editor/PureLanguage.ts +0 -42
  58. package/src/code-editor/PureLanguageCodeEditorSupport.ts +0 -341
  59. package/src/code-editor/PureLanguageService.ts +0 -416
  60. package/src/code-editor/themes/Github-Theme-dark-dimmed.json +0 -613
  61. package/src/code-editor/themes/Github-Theme-dark.json +0 -513
  62. package/src/code-editor/themes/Github-Theme-light.json +0 -598
  63. package/src/code-editor/themes/Material-Theme-Darker.json +0 -816
  64. package/src/code-editor/themes/Material-Theme-Default.json +0 -816
  65. package/src/code-editor/themes/MonacoEditorThemeUtils.ts +0 -128
  66. package/src/code-editor/themes/OneDark-Pro-darker.json +0 -2061
  67. package/src/code-editor/themes/OneDark-Pro.json +0 -2090
  68. package/src/code-editor/themes/README.md +0 -8
  69. package/src/code-editor/themes/solarized-dark-color-theme.json +0 -423
@@ -13,7 +13,9 @@
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 './CodeEditorUtils.js';
16
+ import { editor as monacoEditorAPI } from 'monaco-editor';
17
+ import { CODE_EDITOR_LANGUAGE } from '@finos/legend-code-editor';
18
+ export declare const disposeDiffCodeEditor: (editor: monacoEditorAPI.IStandaloneDiffEditor) => void;
17
19
  export declare const CodeDiffView: ((props: {
18
20
  language: CODE_EDITOR_LANGUAGE;
19
21
  from?: string | undefined;
@@ -1 +1 @@
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;;CAiDF,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"}
1
+ {"version":3,"file":"CodeDiffView.d.ts","sourceRoot":"","sources":["../../src/code-editor/CodeDiffView.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,eAAe,CAAC;AAW1D,OAAO,EACL,oBAAoB,EAGrB,MAAM,2BAA2B,CAAC;AAEnC,eAAO,MAAM,qBAAqB,WACxB,eAAe,CAAC,qBAAqB,KAC5C,IAIF,CAAC;AAEF,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;;CAiDF,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"}
@@ -19,8 +19,12 @@ 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
21
  import { isString, stringifyLosslessJSON, tryToFormatJSONString, tryToFormatLosslessJSONString, } from '@finos/legend-shared';
22
- import { CODE_EDITOR_LANGUAGE, disposeDiffCodeEditor, getBaseCodeEditorOptions, } from './CodeEditorUtils.js';
23
- import { CODE_EDITOR_THEME } from './CodeEditorTheme.js';
22
+ import { CODE_EDITOR_LANGUAGE, CODE_EDITOR_THEME, getBaseCodeEditorOptions, } from '@finos/legend-code-editor';
23
+ export const disposeDiffCodeEditor = (editor) => {
24
+ editor.dispose();
25
+ editor.getOriginalEditor().getModel()?.dispose();
26
+ editor.getModifiedEditor().getModel()?.dispose();
27
+ };
24
28
  export const CodeDiffView = observer((props) => {
25
29
  const { from, to, language } = props;
26
30
  const applicationStore = useApplicationStore();
@@ -1 +1 @@
1
- {"version":3,"file":"CodeDiffView.js","sourceRoot":"","sources":["../../src/code-editor/CodeDiffView.tsx"],"names":[],"mappings":";AAAA;;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ations under the License.
15
15
  */
16
16
  import { editor as monacoEditorAPI } from 'monaco-editor';
17
- import { type CODE_EDITOR_LANGUAGE } from './CodeEditorUtils.js';
18
- import { CODE_EDITOR_THEME } from './CodeEditorTheme.js';
17
+ import { type CODE_EDITOR_LANGUAGE, CODE_EDITOR_THEME } from '@finos/legend-code-editor';
18
+ import { type GenericLegendApplicationStore } from '@finos/legend-application';
19
19
  import type { CompilationError, ParserError } from '@finos/legend-graph';
20
+ export declare const configureCodeEditorComponent: (applicationStore: GenericLegendApplicationStore) => Promise<void>;
21
+ /**
22
+ * Normally `monaco-editor` worker disposes after 5 minutes staying idle, but we fasten
23
+ * this pace just in case the usage of the editor causes memory-leak somehow
24
+ */
25
+ export declare const disposeCodeEditor: (editor: monacoEditorAPI.IStandaloneCodeEditor) => void;
20
26
  export declare const CodeEditor: React.FC<{
21
27
  inputValue: string;
22
28
  isReadOnly?: boolean | undefined;
@@ -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;AAC5E,OAAO,EAML,KAAK,oBAAoB,EAG1B,MAAM,sBAAsB,CAAC;AAK9B,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEzE,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,GAA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C;IAClC,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACjC,WAAW,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAClC,aAAa,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACpC,WAAW,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IAClD,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,kBAAkB,CAAC,EACf,CAAC,eAAe,CAAC,cAAc,GAAG,eAAe,CAAC,oBAAoB,CAAC,GACvE,SAAS,CAAC;IACd,KAAK,CAAC,EAAE,WAAW,GAAG,gBAAgB,GAAG,SAAS,CAAC;CACpD,CAyKA,CAAC"}
@@ -15,11 +15,49 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
15
15
  * limitations under the License.
16
16
  */
17
17
  import { useState, useRef, useEffect } from 'react';
18
- import { editor as monacoEditorAPI } from 'monaco-editor';
19
- import { disposeCodeEditor, getBaseCodeEditorOptions, resetLineNumberGutterWidth, getCodeEditorValue, normalizeLineEnding, setErrorMarkers, clearMarkers, } from './CodeEditorUtils.js';
20
- import { DEFAULT_TAB_SIZE, useApplicationStore, } from '@finos/legend-application';
21
- import { CODE_EDITOR_THEME } from './CodeEditorTheme.js';
18
+ import { editor as monacoEditorAPI, KeyCode, KeyMod, } from 'monaco-editor';
19
+ import { getBaseCodeEditorOptions, resetLineNumberGutterWidth, getCodeEditorValue, normalizeLineEnding, setErrorMarkers, clearMarkers, CODE_EDITOR_THEME, configureCodeEditor, } from '@finos/legend-code-editor';
20
+ import { DEFAULT_TAB_SIZE, useApplicationStore, APPLICATION_EVENT, DEFAULT_MONOSPACED_FONT_FAMILY, } from '@finos/legend-application';
22
21
  import { clsx, WordWrapIcon } from '@finos/legend-art';
22
+ import { LogEvent } from '@finos/legend-shared';
23
+ export const configureCodeEditorComponent = async (applicationStore) => {
24
+ await configureCodeEditor(DEFAULT_MONOSPACED_FONT_FAMILY, (error) => applicationStore.logService.error(LogEvent.create(APPLICATION_EVENT.APPLICATION_SETUP__FAILURE), error.message));
25
+ // override native hotkeys supported by monaco-editor
26
+ // here we map these keys to a dummy command that would just dispatch the key combination
27
+ // to the application keyboard shortcut service, effectively bypassing the command associated
28
+ // with the native keybinding
29
+ const OVERRIDE_DEFAULT_KEYBINDING_COMMAND = 'legend.code-editor.override-default-keybinding';
30
+ monacoEditorAPI.registerCommand(OVERRIDE_DEFAULT_KEYBINDING_COMMAND, (accessor, ...args) => {
31
+ applicationStore.keyboardShortcutsService.dispatch(args[0]);
32
+ });
33
+ const hotkeyMapping = [
34
+ [KeyCode.F1, 'F1'], // show command center
35
+ [KeyCode.F8, 'F8'], // show error
36
+ [KeyCode.F9, 'F9'], // toggle debugger breakpoint
37
+ [KeyMod.WinCtrl | KeyCode.KeyG, 'Control+KeyG'], // go-to line command
38
+ [KeyMod.WinCtrl | KeyCode.KeyB, 'Control+KeyB'], // cursor move (core command)
39
+ [KeyMod.WinCtrl | KeyCode.KeyO, 'Control+KeyO'], // cursor move (core command)
40
+ [KeyMod.WinCtrl | KeyCode.KeyD, 'Control+KeyD'], // cursor move (core command)
41
+ [KeyMod.WinCtrl | KeyCode.KeyP, 'Control+KeyP'], // cursor move (core command)
42
+ [KeyMod.Shift | KeyCode.F10, 'Shift+F10'], // show editor context menu
43
+ [KeyMod.WinCtrl | KeyCode.F2, 'Control+F2'], // change all instances
44
+ [KeyMod.WinCtrl | KeyCode.F12, 'Control+F12'], // go-to definition
45
+ ];
46
+ monacoEditorAPI.addKeybindingRules(hotkeyMapping.map(([nativeCodeEditorKeyBinding, keyCombination]) => ({
47
+ keybinding: nativeCodeEditorKeyBinding,
48
+ command: OVERRIDE_DEFAULT_KEYBINDING_COMMAND,
49
+ commandArgs: keyCombination,
50
+ })));
51
+ };
52
+ /**
53
+ * Normally `monaco-editor` worker disposes after 5 minutes staying idle, but we fasten
54
+ * this pace just in case the usage of the editor causes memory-leak somehow
55
+ */
56
+ export const disposeCodeEditor = (editor) => {
57
+ editor.dispose();
58
+ // NOTE: just to be sure, we dispose the model after disposing the editor
59
+ editor.getModel()?.dispose();
60
+ };
23
61
  export const CodeEditor = (props) => {
24
62
  const { inputValue, updateInput, lightTheme, language, isReadOnly, hideMinimap, hideGutter, hidePadding, hideActionBar, lineToScroll, extraEditorOptions, error, } = props;
25
63
  const applicationStore = useApplicationStore();
@@ -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,EAEnB,eAAe,EACf,YAAY,GACb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGvD,MAAM,CAAC,MAAM,UAAU,GAelB,CAAC,KAAK,EAAE,EAAE;IACb,MAAM,EACJ,UAAU,EACV,WAAW,EACX,UAAU,EACV,QAAQ,EACR,UAAU,EACV,WAAW,EACX,UAAU,EACV,WAAW,EACX,aAAa,EACb,YAAY,EACZ,kBAAkB,EAClB,KAAK,GACN,GAAG,KAAK,CAAC;IACV,MAAM,gBAAgB,GAAG,mBAAmB,EAAE,CAAC;IAC/C,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,EAEjC,CAAC;IACJ,MAAM,CAAC,UAAU,EAAE,aAAa,CA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KAAK,oBAAoB,YAExD,KAAC,YAAY,KAAG,GACT,GACL,CACP,EACD,cACE,SAAS,EAAE,IAAI,CAAC,sBAAsB,EAAE;oBACtC,+BAA+B,EAAE,CAAC,WAAW;oBAC7C,oCAAoC,EAAE,CAAC,aAAa;iBACrD,CAAC,YAEF,cAAK,SAAS,EAAC,mBAAmB,EAAC,GAAG,EAAE,YAAY,GAAI,GACpD,IACF,CACP,CAAC;AACJ,CAAC,CAAC"}
@@ -13,11 +13,6 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- export { setupPureLanguageService } from './PureLanguageService.js';
17
- export { PURE_GRAMMAR_TOKEN } from './PureLanguage.js';
18
- export * from './PureLanguageCodeEditorSupport.js';
19
16
  export * from './CodeEditor.js';
20
- export * from './CodeEditorUtils.js';
21
- export * from './CodeEditorTheme.js';
22
17
  export * from './CodeDiffView.js';
23
18
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/code-editor/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,cAAc,oCAAoC,CAAC;AAEnD,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/code-editor/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC"}
@@ -13,11 +13,6 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- export { setupPureLanguageService } from './PureLanguageService.js';
17
- export { PURE_GRAMMAR_TOKEN } from './PureLanguage.js';
18
- export * from './PureLanguageCodeEditorSupport.js';
19
16
  export * from './CodeEditor.js';
20
- export * from './CodeEditorUtils.js';
21
- export * from './CodeEditorTheme.js';
22
17
  export * from './CodeDiffView.js';
23
18
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/code-editor/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,cAAc,oCAAoC,CAAC;AAEnD,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/code-editor/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"DataGrid.d.ts","sourceRoot":"","sources":["../../src/data-grid/DataGrid.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAa9E,OAAO,EACL,KAAK,SAAS,EACd,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,WAAW,EAChB,KAAK,MAAM,EACX,KAAK,WAAW,EAChB,KAAK,OAAO,EACZ,KAAK,QAAQ,EACb,KAAK,yBAAyB,EAC9B,KAAK,WAAW,EAChB,KAAK,cAAc,EAEpB,MAAM,yBAAyB,CAAC;AAGjC,eAAO,MAAM,gBAAgB,4CAA8C,CAAC;AAE5E,eAAO,MAAM,iBAAiB,4CAW7B,CAAC;AAEF,eAAO,MAAM,UAAU,4CAA6C,CAAC;AAIrE,wBAAg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kB,IAAI,0BAA0B,EAChD,mBAAmB,IAAI,0BAA0B,EACjD,WAAW,IAAI,eAAe,EAC9B,MAAM,IAAI,wBAAwB,EAClC,WAAW,IAAI,mBAAmB,EAClC,OAAO,IAAI,WAAW,EACtB,QAAQ,IAAI,gBAAgB,EAC5B,yBAAyB,IAAI,iCAAiC,EAC9D,WAAW,IAAI,mBAAmB,EAClC,cAAc,IAAI,sBAAsB,GACzC,CAAC"}
@@ -47,19 +47,7 @@ export function DataGrid(props) {
47
47
  if (AG_GRID_LICENSE) {
48
48
  LicenseManager.setLicenseKey(AG_GRID_LICENSE);
49
49
  }
50
- return (_jsx(AgGridReact
51
- // Temporarily disable usage the browser's ResizeObserver as sometimes, this causes the error
52
- // `ResizeObserver loop limit exceeded` when we zoom in too much, in our cases, the problem
53
- // seem to arise when the scrollbar visibility changes as row data is being supplied
54
- // one way to resolve this problem is to set `alwaysShowVerticalScroll={true}`
55
- // See https://github.com/ag-grid/ag-grid/issues/2588
56
- , {
57
- // Temporarily disable usage the browser's ResizeObserver as sometimes, this causes the error
58
- // `ResizeObserver loop limit exceeded` when we zoom in too much, in our cases, the problem
59
- // seem to arise when the scrollbar visibility changes as row data is being supplied
60
- // one way to resolve this problem is to set `alwaysShowVerticalScroll={true}`
61
- // See https://github.com/ag-grid/ag-grid/issues/2588
62
- suppressBrowserResizeObserver: true, ...props,
50
+ return (_jsx(AgGridReact, { ...props,
63
51
  // NOTE: for test, we don't want to handle the error messages outputed by ag-grid so
64
52
  // we disable enterprise features for now
65
53
  // eslint-disable-next-line no-process-env
@@ -1 +1 @@
1
- {"version":3,"file":"DataGrid.js","sourceRoot":"","sources":["../../src/data-grid/DataGrid.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,WAAW,EAAyB,MAAM,0BAA0B,CAAC;AAC9E,OAAO,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AACpF,OAAO,EAAE,eAAe,EAAE,MAAM,+B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ACf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,wBAAwB,EAAE,eAAe,CAAC,CAAC;AAE5E,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,eAAe;IACf,sBAAsB;IACtB,iBAAiB;IACjB,sBAAsB;IACtB,UAAU;IACV,oBAAoB;IACpB,iBAAiB;IACjB,wBAAwB;IACxB,aAAa;IACb,eAAe;CAChB,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,gBAAgB,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;AAIrE,MAAM,UAAU,QAAQ,CACtB,KAA8B;IAE9B,IAAI,eAAe,EAAE,CAAC;QACpB,cAAc,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC;IAChD,CAAC;IACD,OAAO,CACL,KAAC,WAAW,OACN,KAAK;QACT,oFAAoF;QACpF,yCAAyC;QACzC,0CAA0C;QAC1C,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,MAAM,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,UAAU,GACxE,CACH,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,0BAA0B,GAAG,GAAS,EAAE;IACnD,cAAc,CAAC,eAAe,CAAC,CAAC,wBAAwB,CAAC,CAAC,CAAC;AAC7D,CAAC,CAAC"}
package/lib/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /** @license @finos/legend-lego v1.2.72
1
+ /** @license @finos/legend-lego v2.0.1
2
2
  * Copyright (c) 2020-present, Goldman Sachs
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
package/package.json CHANGED
@@ -1,11 +1,10 @@
1
1
  {
2
2
  "name": "@finos/legend-lego",
3
- "version": "1.2.72",
4
- "description": "Legend shared advanced application components and building blocks",
3
+ "version": "2.0.1",
4
+ "description": "Legend code editor support",
5
5
  "keywords": [
6
6
  "legend",
7
- "component",
8
- "shared-component"
7
+ "code-editor"
9
8
  ],
10
9
  "homepage": "https://github.com/finos/legend-studio/tree/master/packages/legend-lego",
11
10
  "bugs": {
@@ -47,45 +46,46 @@
47
46
  "test:watch": "jest --watch"
48
47
  },
49
48
  "dependencies": {
50
- "@ag-grid-community/client-side-row-model": "32.2.0",
51
- "@ag-grid-community/core": "32.2.0",
52
- "@ag-grid-community/csv-export": "32.2.0",
53
- "@ag-grid-community/react": "32.2.0",
54
- "@ag-grid-community/styles": "32.2.0",
55
- "@ag-grid-enterprise/clipboard": "32.2.0",
56
- "@ag-grid-enterprise/column-tool-panel": "32.2.0",
57
- "@ag-grid-enterprise/core": "32.2.0",
58
- "@ag-grid-enterprise/excel-export": "32.2.0",
59
- "@ag-grid-enterprise/filter-tool-panel": "32.2.0",
60
- "@ag-grid-enterprise/menu": "32.2.0",
61
- "@ag-grid-enterprise/range-selection": "32.2.0",
62
- "@ag-grid-enterprise/row-grouping": "32.2.0",
63
- "@ag-grid-enterprise/server-side-row-model": "32.2.0",
64
- "@ag-grid-enterprise/side-bar": "32.2.0",
65
- "@ag-grid-enterprise/status-bar": "32.2.0",
66
- "@finos/legend-application": "15.1.31",
67
- "@finos/legend-art": "7.1.58",
68
- "@finos/legend-graph": "31.10.33",
69
- "@finos/legend-shared": "10.0.55",
49
+ "@ag-grid-community/client-side-row-model": "32.2.1",
50
+ "@ag-grid-community/core": "32.2.1",
51
+ "@ag-grid-community/csv-export": "32.2.1",
52
+ "@ag-grid-community/react": "32.2.1",
53
+ "@ag-grid-community/styles": "32.2.1",
54
+ "@ag-grid-enterprise/clipboard": "32.2.1",
55
+ "@ag-grid-enterprise/column-tool-panel": "32.2.1",
56
+ "@ag-grid-enterprise/core": "32.2.1",
57
+ "@ag-grid-enterprise/excel-export": "32.2.1",
58
+ "@ag-grid-enterprise/filter-tool-panel": "32.2.1",
59
+ "@ag-grid-enterprise/menu": "32.2.1",
60
+ "@ag-grid-enterprise/range-selection": "32.2.1",
61
+ "@ag-grid-enterprise/row-grouping": "32.2.1",
62
+ "@ag-grid-enterprise/server-side-row-model": "32.2.1",
63
+ "@ag-grid-enterprise/side-bar": "32.2.1",
64
+ "@ag-grid-enterprise/status-bar": "32.2.1",
65
+ "@finos/legend-application": "16.0.0",
66
+ "@finos/legend-art": "7.1.59",
67
+ "@finos/legend-code-editor": "2.0.0",
68
+ "@finos/legend-graph": "31.10.34",
69
+ "@finos/legend-shared": "10.0.56",
70
70
  "@types/css-font-loading-module": "0.0.13",
71
- "@types/react": "18.3.7",
71
+ "@types/react": "18.3.9",
72
72
  "@types/react-dom": "18.3.0",
73
- "mobx": "6.13.2",
73
+ "mobx": "6.13.3",
74
74
  "mobx-react-lite": "4.0.7",
75
- "monaco-editor": "0.51.0",
75
+ "monaco-editor": "0.52.0",
76
76
  "react": "18.3.1",
77
77
  "react-dnd": "16.0.1",
78
78
  "react-dom": "18.3.1"
79
79
  },
80
80
  "devDependencies": {
81
- "@finos/legend-dev-utils": "2.1.22",
81
+ "@finos/legend-dev-utils": "2.1.23",
82
82
  "@jest/globals": "29.7.0",
83
83
  "cross-env": "7.0.3",
84
84
  "eslint": "8.57.1",
85
85
  "jest": "29.7.0",
86
86
  "npm-run-all": "4.1.5",
87
87
  "rimraf": "6.0.1",
88
- "sass": "1.79.1",
88
+ "sass": "1.79.3",
89
89
  "typescript": "5.6.2"
90
90
  },
91
91
  "peerDependencies": {
@@ -29,10 +29,17 @@ import {
29
29
  } from '@finos/legend-shared';
30
30
  import {
31
31
  CODE_EDITOR_LANGUAGE,
32
- disposeDiffCodeEditor,
32
+ CODE_EDITOR_THEME,
33
33
  getBaseCodeEditorOptions,
34
- } from './CodeEditorUtils.js';
35
- import { CODE_EDITOR_THEME } from './CodeEditorTheme.js';
34
+ } from '@finos/legend-code-editor';
35
+
36
+ export const disposeDiffCodeEditor = (
37
+ editor: monacoEditorAPI.IStandaloneDiffEditor,
38
+ ): void => {
39
+ editor.dispose();
40
+ editor.getOriginalEditor().getModel()?.dispose();
41
+ editor.getModifiedEditor().getModel()?.dispose();
42
+ };
36
43
 
37
44
  export const CodeDiffView = observer(
38
45
  (props: {
@@ -15,9 +15,13 @@
15
15
  */
16
16
 
17
17
  import { useState, useRef, useEffect } from 'react';
18
- import { type IDisposable, editor as monacoEditorAPI } from 'monaco-editor';
19
18
  import {
20
- disposeCodeEditor,
19
+ type IDisposable,
20
+ editor as monacoEditorAPI,
21
+ KeyCode,
22
+ KeyMod,
23
+ } from 'monaco-editor';
24
+ import {
21
25
  getBaseCodeEditorOptions,
22
26
  resetLineNumberGutterWidth,
23
27
  getCodeEditorValue,
@@ -25,14 +29,75 @@ import {
25
29
  type CODE_EDITOR_LANGUAGE,
26
30
  setErrorMarkers,
27
31
  clearMarkers,
28
- } from './CodeEditorUtils.js';
32
+ CODE_EDITOR_THEME,
33
+ configureCodeEditor,
34
+ } from '@finos/legend-code-editor';
29
35
  import {
30
36
  DEFAULT_TAB_SIZE,
31
37
  useApplicationStore,
38
+ APPLICATION_EVENT,
39
+ DEFAULT_MONOSPACED_FONT_FAMILY,
40
+ type GenericLegendApplicationStore,
32
41
  } from '@finos/legend-application';
33
- import { CODE_EDITOR_THEME } from './CodeEditorTheme.js';
34
42
  import { clsx, WordWrapIcon } from '@finos/legend-art';
35
43
  import type { CompilationError, ParserError } from '@finos/legend-graph';
44
+ import { LogEvent } from '@finos/legend-shared';
45
+
46
+ export const configureCodeEditorComponent = async (
47
+ applicationStore: GenericLegendApplicationStore,
48
+ ): Promise<void> => {
49
+ await configureCodeEditor(DEFAULT_MONOSPACED_FONT_FAMILY, (error) =>
50
+ applicationStore.logService.error(
51
+ LogEvent.create(APPLICATION_EVENT.APPLICATION_SETUP__FAILURE),
52
+ error.message,
53
+ ),
54
+ );
55
+
56
+ // override native hotkeys supported by monaco-editor
57
+ // here we map these keys to a dummy command that would just dispatch the key combination
58
+ // to the application keyboard shortcut service, effectively bypassing the command associated
59
+ // with the native keybinding
60
+ const OVERRIDE_DEFAULT_KEYBINDING_COMMAND =
61
+ 'legend.code-editor.override-default-keybinding';
62
+ monacoEditorAPI.registerCommand(
63
+ OVERRIDE_DEFAULT_KEYBINDING_COMMAND,
64
+ (accessor, ...args) => {
65
+ applicationStore.keyboardShortcutsService.dispatch(args[0]);
66
+ },
67
+ );
68
+ const hotkeyMapping: [number, string][] = [
69
+ [KeyCode.F1, 'F1'], // show command center
70
+ [KeyCode.F8, 'F8'], // show error
71
+ [KeyCode.F9, 'F9'], // toggle debugger breakpoint
72
+ [KeyMod.WinCtrl | KeyCode.KeyG, 'Control+KeyG'], // go-to line command
73
+ [KeyMod.WinCtrl | KeyCode.KeyB, 'Control+KeyB'], // cursor move (core command)
74
+ [KeyMod.WinCtrl | KeyCode.KeyO, 'Control+KeyO'], // cursor move (core command)
75
+ [KeyMod.WinCtrl | KeyCode.KeyD, 'Control+KeyD'], // cursor move (core command)
76
+ [KeyMod.WinCtrl | KeyCode.KeyP, 'Control+KeyP'], // cursor move (core command)
77
+ [KeyMod.Shift | KeyCode.F10, 'Shift+F10'], // show editor context menu
78
+ [KeyMod.WinCtrl | KeyCode.F2, 'Control+F2'], // change all instances
79
+ [KeyMod.WinCtrl | KeyCode.F12, 'Control+F12'], // go-to definition
80
+ ];
81
+ monacoEditorAPI.addKeybindingRules(
82
+ hotkeyMapping.map(([nativeCodeEditorKeyBinding, keyCombination]) => ({
83
+ keybinding: nativeCodeEditorKeyBinding,
84
+ command: OVERRIDE_DEFAULT_KEYBINDING_COMMAND,
85
+ commandArgs: keyCombination,
86
+ })),
87
+ );
88
+ };
89
+
90
+ /**
91
+ * Normally `monaco-editor` worker disposes after 5 minutes staying idle, but we fasten
92
+ * this pace just in case the usage of the editor causes memory-leak somehow
93
+ */
94
+ export const disposeCodeEditor = (
95
+ editor: monacoEditorAPI.IStandaloneCodeEditor,
96
+ ): void => {
97
+ editor.dispose();
98
+ // NOTE: just to be sure, we dispose the model after disposing the editor
99
+ editor.getModel()?.dispose();
100
+ };
36
101
 
37
102
  export const CodeEditor: React.FC<{
38
103
  inputValue: string;
@@ -14,11 +14,5 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- export { setupPureLanguageService } from './PureLanguageService.js';
18
- export { PURE_GRAMMAR_TOKEN } from './PureLanguage.js';
19
- export * from './PureLanguageCodeEditorSupport.js';
20
-
21
17
  export * from './CodeEditor.js';
22
- export * from './CodeEditorUtils.js';
23
- export * from './CodeEditorTheme.js';
24
18
  export * from './CodeDiffView.js';
@@ -70,12 +70,6 @@ export function DataGrid<TData = unknown>(
70
70
  }
71
71
  return (
72
72
  <AgGridReact
73
- // Temporarily disable usage the browser's ResizeObserver as sometimes, this causes the error
74
- // `ResizeObserver loop limit exceeded` when we zoom in too much, in our cases, the problem
75
- // seem to arise when the scrollbar visibility changes as row data is being supplied
76
- // one way to resolve this problem is to set `alwaysShowVerticalScroll={true}`
77
- // See https://github.com/ag-grid/ag-grid/issues/2588
78
- suppressBrowserResizeObserver={true}
79
73
  {...props}
80
74
  // NOTE: for test, we don't want to handle the error messages outputed by ag-grid so
81
75
  // we disable enterprise features for now
package/tsconfig.json CHANGED
@@ -46,15 +46,9 @@
46
46
  "files": [
47
47
  "./src/application/TabManagerState.ts",
48
48
  "./src/application/index.ts",
49
- "./src/code-editor/CodeEditorTheme.ts",
50
- "./src/code-editor/CodeEditorUtils.ts",
51
- "./src/code-editor/PureLanguage.ts",
52
- "./src/code-editor/PureLanguageCodeEditorSupport.ts",
53
- "./src/code-editor/PureLanguageService.ts",
54
49
  "./src/code-editor/__test__.ts",
55
50
  "./src/code-editor/index.ts",
56
51
  "./src/code-editor/__test-utils__/MockedMonacoEditor.ts",
57
- "./src/code-editor/themes/MonacoEditorThemeUtils.ts",
58
52
  "./src/data-grid/index.ts",
59
53
  "./src/graph-editor/index.ts",
60
54
  "./src/application/ActivityBar.tsx",
@@ -68,15 +62,7 @@
68
62
  "./src/code-editor/__test-utils__/MonacoEditorMockUtils.tsx",
69
63
  "./src/data-grid/DataGrid.tsx",
70
64
  "./src/graph-editor/ElementIconUtils.tsx",
71
- "./src/graph-editor/PackageableElementOption.tsx",
72
- "./src/code-editor/themes/Github-Theme-dark-dimmed.json",
73
- "./src/code-editor/themes/Github-Theme-dark.json",
74
- "./src/code-editor/themes/Github-Theme-light.json",
75
- "./src/code-editor/themes/Material-Theme-Darker.json",
76
- "./src/code-editor/themes/Material-Theme-Default.json",
77
- "./src/code-editor/themes/OneDark-Pro-darker.json",
78
- "./src/code-editor/themes/OneDark-Pro.json",
79
- "./src/code-editor/themes/solarized-dark-color-theme.json"
65
+ "./src/graph-editor/PackageableElementOption.tsx"
80
66
  ],
81
67
  "include": [
82
68
  "src/**/*.ts",
@@ -1,41 +0,0 @@
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_LIGHT = "github-light",
20
- GITHUB_DARK = "github-dark",
21
- GITHUB_DARK_DIMMED = "github-dark-dimmed",
22
- SOLARIZED_DARK = "solarized-dark",
23
- ONE_DARK_PRO = "one-dark-pro",
24
- ONE_DARK_PRO_DARKER = "one-dark-pro-darker",
25
- MATERIAL_DEFAULT = "material-default",
26
- MATERIAL_DARKER = "material-darker",
27
- BUILT_IN__VSCODE_LIGHT = "vs",
28
- BUILT_IN__VSCODE_DARK = "vs-dark",
29
- BUILT_IN__VSCODE_HC_BLACK = "hc-black",
30
- BUILT_IN__VSCODE_HC_LIGHT = "hc-light"
31
- }
32
- export declare const DEFAULT_DARK_THEME: monacoEditorAPI.IStandaloneThemeData;
33
- export declare const SOLARIZED_DARK_THEME: monacoEditorAPI.IStandaloneThemeData;
34
- export declare const GITHUB_DARK_THEME: monacoEditorAPI.IStandaloneThemeData;
35
- export declare const GITHUB_LIGHT_THEME: monacoEditorAPI.IStandaloneThemeData;
36
- export declare const GITHUB_DARK_DIMMED_THEME: monacoEditorAPI.IStandaloneThemeData;
37
- export declare const MATERIAL_DEFAULT_THEME: monacoEditorAPI.IStandaloneThemeData;
38
- export declare const MATERIAL_DARKER_THEME: monacoEditorAPI.IStandaloneThemeData;
39
- export declare const ONE_DARK_PRO_THEME: monacoEditorAPI.IStandaloneThemeData;
40
- export declare const ONE_DARK_PRO_DARKER_THEME: monacoEditorAPI.IStandaloneThemeData;
41
- //# sourceMappingURL=CodeEditorTheme.d.ts.map
@@ -1 +0,0 @@
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;AA6B/D,oBAAY,iBAAiB;IAC3B,YAAY,iBAAiB;IAC7B,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,oBAYhD,CAAC;AAEF,eAAO,MAAM,oBAAoB,sCAKhC,CAAC;AAEF,eAAO,MAAM,iBAAiB,sCAK7B,CAAC;AAEF,eAAO,MAAM,kBAAkB,sCAsB9B,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"}