@gooddata/sdk-ui-metric-component 11.67.0-alpha.2 → 11.67.0-alpha.3
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.
- package/NOTICE +943 -2401
- package/esm/MaqlEditor/codemirror/CodeEditor.d.ts +52 -0
- package/esm/MaqlEditor/codemirror/CodeEditor.d.ts.map +1 -0
- package/esm/MaqlEditor/codemirror/CodeEditor.js +170 -0
- package/esm/MaqlEditor/codemirror/CodeEditor.styles.d.ts +95 -0
- package/esm/MaqlEditor/codemirror/CodeEditor.styles.d.ts.map +1 -0
- package/esm/MaqlEditor/codemirror/CodeEditor.styles.js +536 -0
- package/esm/MaqlEditor/codemirror/ContextMenu.d.ts +52 -0
- package/esm/MaqlEditor/codemirror/ContextMenu.d.ts.map +1 -0
- package/esm/MaqlEditor/codemirror/ContextMenu.js +204 -0
- package/esm/MaqlEditor/codemirror/baseExtensions.d.ts +22 -0
- package/esm/MaqlEditor/codemirror/baseExtensions.d.ts.map +1 -0
- package/esm/MaqlEditor/codemirror/baseExtensions.js +95 -0
- package/esm/MaqlEditor/codemirror/commands.d.ts +21 -0
- package/esm/MaqlEditor/codemirror/commands.d.ts.map +1 -0
- package/esm/MaqlEditor/codemirror/commands.js +98 -0
- package/esm/MaqlEditor/codemirror/hooks/useAutofocus.d.ts +7 -0
- package/esm/MaqlEditor/codemirror/hooks/useAutofocus.d.ts.map +1 -0
- package/esm/MaqlEditor/{monaco → codemirror}/hooks/useAutofocus.js +4 -0
- package/esm/MaqlEditor/codemirror/lsp.d.ts +28 -0
- package/esm/MaqlEditor/codemirror/lsp.d.ts.map +1 -0
- package/esm/MaqlEditor/codemirror/lsp.js +70 -0
- package/esm/MaqlEditor/codemirror/markdown.d.ts +11 -0
- package/esm/MaqlEditor/codemirror/markdown.d.ts.map +1 -0
- package/esm/MaqlEditor/codemirror/markdown.js +28 -0
- package/esm/MaqlEditor/codemirror/types.d.ts +8 -0
- package/esm/MaqlEditor/codemirror/types.d.ts.map +1 -0
- package/esm/MaqlEditor/codemirror/types.js +2 -0
- package/esm/MaqlEditor/hooks/useCodeTheme.d.ts +15 -2
- package/esm/MaqlEditor/hooks/useCodeTheme.d.ts.map +1 -1
- package/esm/MaqlEditor/hooks/useCodeTheme.js +36 -43
- package/esm/MaqlEditor/hooks/useCopyToClipboard.d.ts +7 -2
- package/esm/MaqlEditor/hooks/useCopyToClipboard.d.ts.map +1 -1
- package/esm/MaqlEditor/hooks/useCopyToClipboard.js +53 -10
- package/esm/MaqlEditor/maql/MaqlEditor.d.ts +25 -9
- package/esm/MaqlEditor/maql/MaqlEditor.d.ts.map +1 -1
- package/esm/MaqlEditor/maql/MaqlEditor.js +179 -30
- package/esm/MaqlEditor/maql/MaqlEditor.styles.d.ts.map +1 -1
- package/esm/MaqlEditor/maql/MaqlEditor.styles.js +13 -17
- package/esm/MaqlEditor/maql/MaqlEditor.tooltip.d.ts.map +1 -1
- package/esm/MaqlEditor/maql/MaqlEditor.tooltip.js +15 -20
- package/esm/MaqlEditor/maql/extensions/completion.d.ts +101 -0
- package/esm/MaqlEditor/maql/extensions/completion.d.ts.map +1 -0
- package/esm/MaqlEditor/maql/extensions/completion.js +420 -0
- package/esm/MaqlEditor/maql/extensions/decorations.d.ts +19 -0
- package/esm/MaqlEditor/maql/extensions/decorations.d.ts.map +1 -0
- package/esm/MaqlEditor/maql/extensions/decorations.js +137 -0
- package/esm/MaqlEditor/maql/extensions/formatting.d.ts +22 -0
- package/esm/MaqlEditor/maql/extensions/formatting.d.ts.map +1 -0
- package/esm/MaqlEditor/maql/extensions/formatting.js +78 -0
- package/esm/MaqlEditor/maql/extensions/hover.d.ts +22 -0
- package/esm/MaqlEditor/maql/extensions/hover.d.ts.map +1 -0
- package/esm/MaqlEditor/maql/extensions/hover.js +98 -0
- package/esm/MaqlEditor/maql/extensions/semanticTokens.d.ts +15 -0
- package/esm/MaqlEditor/maql/extensions/semanticTokens.d.ts.map +1 -0
- package/esm/MaqlEditor/maql/extensions/semanticTokens.js +79 -0
- package/esm/MaqlEditor/maql/extensions/validation.d.ts +41 -0
- package/esm/MaqlEditor/maql/extensions/validation.d.ts.map +1 -0
- package/esm/MaqlEditor/maql/extensions/validation.js +202 -0
- package/esm/MaqlEditor/maql/hooks/hover/doHover.d.ts +19 -4
- package/esm/MaqlEditor/maql/hooks/hover/doHover.d.ts.map +1 -1
- package/esm/MaqlEditor/maql/hooks/hover/doHover.js +71 -61
- package/esm/MaqlEditor/maql/maqlLanguage.d.ts +16 -0
- package/esm/MaqlEditor/maql/maqlLanguage.d.ts.map +1 -0
- package/esm/MaqlEditor/maql/maqlLanguage.js +72 -0
- package/esm/MaqlEditor/mock/editor-shim.d.ts +7 -0
- package/esm/MaqlEditor/mock/editor-shim.d.ts.map +1 -0
- package/esm/MaqlEditor/mock/{monaco-shim.js → editor-shim.js} +27 -1
- package/esm/MaqlEditor/sql/SqlEditor.d.ts +15 -7
- package/esm/MaqlEditor/sql/SqlEditor.d.ts.map +1 -1
- package/esm/MaqlEditor/sql/SqlEditor.js +55 -30
- package/esm/MaqlEditor/sql/formatter.d.ts +6 -5
- package/esm/MaqlEditor/sql/formatter.d.ts.map +1 -1
- package/esm/MaqlEditor/sql/formatter.js +14 -14
- package/esm/MaqlEditor/sql/sqlLanguage.d.ts +3 -0
- package/esm/MaqlEditor/sql/sqlLanguage.d.ts.map +1 -0
- package/esm/MaqlEditor/sql/sqlLanguage.js +19 -0
- package/esm/MaqlEditor/statusBar/SuggestionStatusBar.d.ts +5 -2
- package/esm/MaqlEditor/statusBar/SuggestionStatusBar.d.ts.map +1 -1
- package/esm/MaqlEditor/statusBar/SuggestionStatusBar.js +20 -8
- package/esm/MetricComponent/Form/MaqlEditorField/MaqlEditorEditor.d.ts.map +1 -1
- package/esm/MetricComponent/Form/MaqlEditorField/MaqlEditorEditor.js +28 -27
- package/esm/MetricComponent/Form/MaqlEditorField/suggestionDetailsFunctions.d.ts +0 -1
- package/esm/MetricComponent/Form/MaqlEditorField/suggestionDetailsFunctions.d.ts.map +1 -1
- package/esm/MetricComponent/Form/MaqlEditorField/suggestionDetailsFunctions.js +4 -29
- package/esm/MetricComponent/Form/MaqlResult/MaqlSql.d.ts.map +1 -1
- package/esm/MetricComponent/Form/MaqlResult/MaqlSql.js +4 -2
- package/esm/MetricComponent/Form/maqlFieldFunctions.d.ts +2 -5
- package/esm/MetricComponent/Form/maqlFieldFunctions.d.ts.map +1 -1
- package/esm/MetricComponent/Form/maqlFieldFunctions.js +1 -4
- package/esm/index.d.ts +3 -3
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +1 -1
- package/esm/sdk-ui-metric-component.d.ts +50 -39
- package/esm/shared/permissions.d.ts.map +1 -1
- package/esm/shared/permissions.js +1 -0
- package/esm/translations/en-US.json +36 -0
- package/package.json +33 -30
- package/esm/MaqlEditor/hooks/useAutoformat.d.ts +0 -3
- package/esm/MaqlEditor/hooks/useAutoformat.d.ts.map +0 -1
- package/esm/MaqlEditor/hooks/useAutoformat.js +0 -15
- package/esm/MaqlEditor/hooks/useCleanCallback.d.ts +0 -4
- package/esm/MaqlEditor/hooks/useCleanCallback.d.ts.map +0 -1
- package/esm/MaqlEditor/hooks/useCleanCallback.js +0 -12
- package/esm/MaqlEditor/hooks/useMountCallback.d.ts +0 -13
- package/esm/MaqlEditor/hooks/useMountCallback.d.ts.map +0 -1
- package/esm/MaqlEditor/hooks/useMountCallback.js +0 -26
- package/esm/MaqlEditor/hooks/useUpdateCallback.d.ts +0 -19
- package/esm/MaqlEditor/hooks/useUpdateCallback.d.ts.map +0 -1
- package/esm/MaqlEditor/hooks/useUpdateCallback.js +0 -63
- package/esm/MaqlEditor/hooks/useValueCallbacks.d.ts +0 -6
- package/esm/MaqlEditor/hooks/useValueCallbacks.d.ts.map +0 -1
- package/esm/MaqlEditor/hooks/useValueCallbacks.js +0 -14
- package/esm/MaqlEditor/maql/formatter.d.ts +0 -6
- package/esm/MaqlEditor/maql/formatter.d.ts.map +0 -1
- package/esm/MaqlEditor/maql/formatter.js +0 -14
- package/esm/MaqlEditor/maql/hooks/hover/useHoverEvent.d.ts +0 -4
- package/esm/MaqlEditor/maql/hooks/hover/useHoverEvent.d.ts.map +0 -1
- package/esm/MaqlEditor/maql/hooks/hover/useHoverEvent.js +0 -32
- package/esm/MaqlEditor/maql/hooks/useAutocomplete.d.ts +0 -4
- package/esm/MaqlEditor/maql/hooks/useAutocomplete.d.ts.map +0 -1
- package/esm/MaqlEditor/maql/hooks/useAutocomplete.js +0 -60
- package/esm/MaqlEditor/maql/hooks/useDecoration.d.ts +0 -4
- package/esm/MaqlEditor/maql/hooks/useDecoration.d.ts.map +0 -1
- package/esm/MaqlEditor/maql/hooks/useDecoration.js +0 -73
- package/esm/MaqlEditor/maql/hooks/useDocumentFormatting.d.ts +0 -3
- package/esm/MaqlEditor/maql/hooks/useDocumentFormatting.d.ts.map +0 -1
- package/esm/MaqlEditor/maql/hooks/useDocumentFormatting.js +0 -29
- package/esm/MaqlEditor/maql/hooks/useHover.d.ts +0 -6
- package/esm/MaqlEditor/maql/hooks/useHover.d.ts.map +0 -1
- package/esm/MaqlEditor/maql/hooks/useHover.js +0 -77
- package/esm/MaqlEditor/maql/hooks/useLanguageConfiguration.d.ts +0 -4
- package/esm/MaqlEditor/maql/hooks/useLanguageConfiguration.d.ts.map +0 -1
- package/esm/MaqlEditor/maql/hooks/useLanguageConfiguration.js +0 -21
- package/esm/MaqlEditor/maql/hooks/useMonaco.d.ts +0 -21
- package/esm/MaqlEditor/maql/hooks/useMonaco.d.ts.map +0 -1
- package/esm/MaqlEditor/maql/hooks/useMonaco.js +0 -75
- package/esm/MaqlEditor/maql/hooks/useSemanticHighlight.d.ts +0 -4
- package/esm/MaqlEditor/maql/hooks/useSemanticHighlight.d.ts.map +0 -1
- package/esm/MaqlEditor/maql/hooks/useSemanticHighlight.js +0 -33
- package/esm/MaqlEditor/maql/hooks/useSyntaxHighlight.d.ts +0 -2
- package/esm/MaqlEditor/maql/hooks/useSyntaxHighlight.d.ts.map +0 -1
- package/esm/MaqlEditor/maql/hooks/useSyntaxHighlight.js +0 -28
- package/esm/MaqlEditor/maql/hooks/useValidation.d.ts +0 -4
- package/esm/MaqlEditor/maql/hooks/useValidation.d.ts.map +0 -1
- package/esm/MaqlEditor/maql/hooks/useValidation.js +0 -56
- package/esm/MaqlEditor/maql/monacoConverter.d.ts +0 -80
- package/esm/MaqlEditor/maql/monacoConverter.d.ts.map +0 -1
- package/esm/MaqlEditor/maql/monacoConverter.js +0 -528
- package/esm/MaqlEditor/maql/utils.d.ts +0 -4
- package/esm/MaqlEditor/maql/utils.d.ts.map +0 -1
- package/esm/MaqlEditor/maql/utils.js +0 -6
- package/esm/MaqlEditor/mock/monaco-shim.d.ts +0 -5
- package/esm/MaqlEditor/mock/monaco-shim.d.ts.map +0 -1
- package/esm/MaqlEditor/monaco/MonacoEditor.d.ts +0 -64
- package/esm/MaqlEditor/monaco/MonacoEditor.d.ts.map +0 -1
- package/esm/MaqlEditor/monaco/MonacoEditor.js +0 -71
- package/esm/MaqlEditor/monaco/MonacoEditor.styles.d.ts +0 -53
- package/esm/MaqlEditor/monaco/MonacoEditor.styles.d.ts.map +0 -1
- package/esm/MaqlEditor/monaco/MonacoEditor.styles.js +0 -427
- package/esm/MaqlEditor/monaco/hooks/useAutofocus.d.ts +0 -3
- package/esm/MaqlEditor/monaco/hooks/useAutofocus.d.ts.map +0 -1
- package/esm/MaqlEditor/monaco/hooks/useDefaultValue.d.ts +0 -3
- package/esm/MaqlEditor/monaco/hooks/useDefaultValue.d.ts.map +0 -1
- package/esm/MaqlEditor/monaco/hooks/useDefaultValue.js +0 -14
- package/esm/MaqlEditor/monaco/hooks/useEditorInit.d.ts +0 -3
- package/esm/MaqlEditor/monaco/hooks/useEditorInit.d.ts.map +0 -1
- package/esm/MaqlEditor/monaco/hooks/useEditorInit.js +0 -84
- package/esm/MaqlEditor/monaco/hooks/useEditorOptions.d.ts +0 -3
- package/esm/MaqlEditor/monaco/hooks/useEditorOptions.d.ts.map +0 -1
- package/esm/MaqlEditor/monaco/hooks/useEditorOptions.js +0 -51
- package/esm/MaqlEditor/monaco/hooks/useMonaco.d.ts +0 -3
- package/esm/MaqlEditor/monaco/hooks/useMonaco.d.ts.map +0 -1
- package/esm/MaqlEditor/monaco/hooks/useMonaco.js +0 -24
- package/esm/MaqlEditor/monaco/monacoContributions.d.ts +0 -74
- package/esm/MaqlEditor/monaco/monacoContributions.d.ts.map +0 -1
- package/esm/MaqlEditor/monaco/monacoContributions.js +0 -88
- package/esm/MaqlEditor/monaco/monacoWorkers.d.ts +0 -53
- package/esm/MaqlEditor/monaco/monacoWorkers.d.ts.map +0 -1
- package/esm/MaqlEditor/monaco/monacoWorkers.js +0 -176
- package/esm/MaqlEditor/sql/hooks/useDocumentFormatting.d.ts +0 -2
- package/esm/MaqlEditor/sql/hooks/useDocumentFormatting.d.ts.map +0 -1
- package/esm/MaqlEditor/sql/hooks/useDocumentFormatting.js +0 -26
- package/esm/MaqlEditor/sql/hooks/useLanguageConfiguration.d.ts +0 -4
- package/esm/MaqlEditor/sql/hooks/useLanguageConfiguration.d.ts.map +0 -1
- package/esm/MaqlEditor/sql/hooks/useLanguageConfiguration.js +0 -29
- package/esm/MaqlEditor/sql/hooks/useMonaco.d.ts +0 -14
- package/esm/MaqlEditor/sql/hooks/useMonaco.d.ts.map +0 -1
- package/esm/MaqlEditor/sql/hooks/useMonaco.js +0 -26
- package/esm/MaqlEditor/sql/hooks/useSyntaxHighlight.d.ts +0 -2
- package/esm/MaqlEditor/sql/hooks/useSyntaxHighlight.d.ts.map +0 -1
- package/esm/MaqlEditor/sql/hooks/useSyntaxHighlight.js +0 -796
- package/esm/MaqlEditor/sql/utils.d.ts +0 -4
- package/esm/MaqlEditor/sql/utils.d.ts.map +0 -1
- package/esm/MaqlEditor/sql/utils.js +0 -6
- package/worker/monaco-editor-worker.js +0 -33
- package/worker/monaco-editor-worker.source.js +0 -1
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
// (C) 2021-2026 GoodData Corporation
|
|
2
|
-
//more info in README.md
|
|
3
|
-
import { useEffect, useRef } from "react";
|
|
4
|
-
import * as monaco from "monaco-editor/editor/editor.api.js";
|
|
5
|
-
import { setupMonacoWorkers } from "../monacoWorkers.js";
|
|
6
|
-
import { useEditorOptions } from "./useEditorOptions.js";
|
|
7
|
-
export function useEditorInit(element, editor, setEditor, props) {
|
|
8
|
-
const { inline = false, readonly = false, defaultValue = "", options, themeName, themeData, language, languageConfiguration, className, onEditorMount = () => { }, onEditorUpdate = () => { }, onContentSizeChange = () => { }, } = props;
|
|
9
|
-
const init = useRef(false);
|
|
10
|
-
const defaultOptions = useEditorOptions(readonly, inline, options);
|
|
11
|
-
useEffect(() => {
|
|
12
|
-
if (!element) {
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
15
|
-
//NOTE: if editor is already initialized and editor is set, update editor
|
|
16
|
-
if (init.current && editor) {
|
|
17
|
-
onEditorUpdate(editor, monaco);
|
|
18
|
-
return initDisposable(editor, onContentSizeChange);
|
|
19
|
-
}
|
|
20
|
-
//NOTE: if editor is already initialized, do not initialize it again
|
|
21
|
-
// This is case where editor is initialized but still not in state
|
|
22
|
-
if (init.current) {
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
// Must run before the first `monaco.editor.create` — Monaco reads `MonacoEnvironment` when it
|
|
26
|
-
// lazily spawns its editor worker.
|
|
27
|
-
setupMonacoWorkers();
|
|
28
|
-
const opts = { ...defaultOptions, automaticLayout: true };
|
|
29
|
-
updateTheme(opts, themeName, themeData);
|
|
30
|
-
updateLanguage(opts, language, languageConfiguration);
|
|
31
|
-
updateClassName(opts, className);
|
|
32
|
-
opts.value = defaultValue;
|
|
33
|
-
init.current = true;
|
|
34
|
-
const currentEditor = monaco.editor.create(element, opts);
|
|
35
|
-
setEditor(currentEditor);
|
|
36
|
-
onEditorMount(currentEditor, monaco);
|
|
37
|
-
onEditorUpdate(currentEditor, monaco);
|
|
38
|
-
return initDisposable(currentEditor, onContentSizeChange);
|
|
39
|
-
}, [
|
|
40
|
-
defaultValue,
|
|
41
|
-
defaultOptions,
|
|
42
|
-
themeName,
|
|
43
|
-
themeData,
|
|
44
|
-
language,
|
|
45
|
-
languageConfiguration,
|
|
46
|
-
className,
|
|
47
|
-
element,
|
|
48
|
-
editor,
|
|
49
|
-
onEditorMount,
|
|
50
|
-
onEditorUpdate,
|
|
51
|
-
onContentSizeChange,
|
|
52
|
-
setEditor,
|
|
53
|
-
]);
|
|
54
|
-
}
|
|
55
|
-
function updateTheme(options, themeName, themeData) {
|
|
56
|
-
if (themeName && themeData) {
|
|
57
|
-
monaco.editor.defineTheme(themeName, themeData);
|
|
58
|
-
options.theme = themeName;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
function updateLanguage(options, language, configuration) {
|
|
62
|
-
if (language) {
|
|
63
|
-
monaco.languages.register({ id: language });
|
|
64
|
-
if (configuration) {
|
|
65
|
-
monaco.languages.setLanguageConfiguration(language, configuration);
|
|
66
|
-
}
|
|
67
|
-
options.language = language;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
function updateClassName(options, className) {
|
|
71
|
-
if (className) {
|
|
72
|
-
options.extraEditorClassName = className;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
function initDisposable(editor, onContentSizeChange) {
|
|
76
|
-
const disposable = [];
|
|
77
|
-
disposable.push(onContentSizeChanged(editor, onContentSizeChange));
|
|
78
|
-
return () => disposable.forEach((dis) => {
|
|
79
|
-
dis.dispose();
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
function onContentSizeChanged(editor, onContentSizeChange) {
|
|
83
|
-
return editor.onDidContentSizeChange(() => onContentSizeChange?.(editor, monaco, editor.getContentWidth(), editor.getContentHeight()));
|
|
84
|
-
}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { type IStandaloneEditorConstructionOptions } from "../MonacoEditor.js";
|
|
2
|
-
export declare function useEditorOptions(readonly: boolean, inline: boolean | undefined, options?: Partial<IStandaloneEditorConstructionOptions>): IStandaloneEditorConstructionOptions;
|
|
3
|
-
//# sourceMappingURL=useEditorOptions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useEditorOptions.d.ts","sourceRoot":"","sources":["../../../../src/MaqlEditor/monaco/hooks/useEditorOptions.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,oCAAoC,EAAE,MAAM,oBAAoB,CAAC;AAE/E,wBAAgB,gBAAgB,CAC5B,QAAQ,EAAE,OAAO,EACjB,MAAM,EAAE,OAAO,GAAG,SAAS,EAC3B,OAAO,GAAE,OAAO,CAAC,oCAAoC,CAAM,GAC5D,oCAAoC,CAmDtC"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
// (C) 2021-2026 GoodData Corporation
|
|
2
|
-
import { useMemo } from "react";
|
|
3
|
-
export function useEditorOptions(readonly, inline, options = {}) {
|
|
4
|
-
return useMemo(() => ({
|
|
5
|
-
"semanticHighlighting.enabled": true,
|
|
6
|
-
padding: { top: 15 },
|
|
7
|
-
scrollBeyondLastLine: false,
|
|
8
|
-
renderLineHighlight: "none",
|
|
9
|
-
wordBasedSuggestions: "off",
|
|
10
|
-
minimap: { enabled: false },
|
|
11
|
-
fontFamily: "monospace",
|
|
12
|
-
fontSize: 14,
|
|
13
|
-
lineHeight: 22,
|
|
14
|
-
glyphMargin: false,
|
|
15
|
-
lineDecorationsWidth: 0,
|
|
16
|
-
lineNumbersMinChars: 4,
|
|
17
|
-
scrollbar: {
|
|
18
|
-
...(inline
|
|
19
|
-
? {
|
|
20
|
-
verticalScrollbarSize: 12,
|
|
21
|
-
}
|
|
22
|
-
: {
|
|
23
|
-
vertical: "hidden",
|
|
24
|
-
verticalScrollbarSize: 0,
|
|
25
|
-
}),
|
|
26
|
-
alwaysConsumeMouseWheel: !readonly,
|
|
27
|
-
},
|
|
28
|
-
overviewRulerBorder: false,
|
|
29
|
-
overviewRulerLanes: 0,
|
|
30
|
-
hideCursorInOverviewRuler: true,
|
|
31
|
-
suggest: {
|
|
32
|
-
snippetsPreventQuickSuggestions: false,
|
|
33
|
-
showStatusBar: false,
|
|
34
|
-
},
|
|
35
|
-
suggestLineHeight: 22,
|
|
36
|
-
suggestFontSize: 13,
|
|
37
|
-
tabSize: 2,
|
|
38
|
-
detectIndentation: false,
|
|
39
|
-
readOnly: readonly,
|
|
40
|
-
domReadOnly: readonly,
|
|
41
|
-
...(inline
|
|
42
|
-
? {
|
|
43
|
-
padding: { top: 10, bottom: 10, right: 0, left: 0 },
|
|
44
|
-
fontSize: 12,
|
|
45
|
-
lineHeight: 18,
|
|
46
|
-
}
|
|
47
|
-
: {}),
|
|
48
|
-
...options,
|
|
49
|
-
editContext: false,
|
|
50
|
-
}), [inline, readonly, options]);
|
|
51
|
-
}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { IMonacoEditorProps, IStandaloneCodeEditor } from "../MonacoEditor.js";
|
|
2
|
-
export declare function useMonaco(element: HTMLDivElement | null, props: Omit<IMonacoEditorProps, "autofocus" | "icons">): IStandaloneCodeEditor | null;
|
|
3
|
-
//# sourceMappingURL=useMonaco.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useMonaco.d.ts","sourceRoot":"","sources":["../../../../src/MaqlEditor/monaco/hooks/useMonaco.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAKpF,wBAAgB,SAAS,CACrB,OAAO,EAAE,cAAc,GAAG,IAAI,EAC9B,KAAK,EAAE,IAAI,CAAC,kBAAkB,EAAE,WAAW,GAAG,OAAO,CAAC,GACvD,qBAAqB,GAAG,IAAI,CAkC9B"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
// (C) 2021-2026 GoodData Corporation
|
|
2
|
-
import { useState } from "react";
|
|
3
|
-
import { useDefaultValue } from "./useDefaultValue.js";
|
|
4
|
-
import { useEditorInit } from "./useEditorInit.js";
|
|
5
|
-
export function useMonaco(element, props) {
|
|
6
|
-
const { defaultValue = "", themeName, themeData, language, languageConfiguration, className, inline, readonly, options, onEditorMount = () => { }, onEditorUpdate = () => { }, onContentSizeChange = () => { }, } = props;
|
|
7
|
-
const [editor, setEditor] = useState(null);
|
|
8
|
-
useDefaultValue(editor, defaultValue);
|
|
9
|
-
useEditorInit(element, editor, setEditor, {
|
|
10
|
-
inline,
|
|
11
|
-
options,
|
|
12
|
-
readonly,
|
|
13
|
-
defaultValue,
|
|
14
|
-
themeData,
|
|
15
|
-
language,
|
|
16
|
-
languageConfiguration,
|
|
17
|
-
themeName,
|
|
18
|
-
className,
|
|
19
|
-
onEditorMount,
|
|
20
|
-
onEditorUpdate,
|
|
21
|
-
onContentSizeChange,
|
|
22
|
-
});
|
|
23
|
-
return editor;
|
|
24
|
-
}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import "./monacoWorkers.js";
|
|
2
|
-
import "monaco-editor/editor/contrib/anchorSelect/browser/anchorSelect.js";
|
|
3
|
-
import "monaco-editor/editor/contrib/bracketMatching/browser/bracketMatching.js";
|
|
4
|
-
import "monaco-editor/editor/contrib/caretOperations/browser/transpose.js";
|
|
5
|
-
import "monaco-editor/editor/contrib/clipboard/browser/clipboard.js";
|
|
6
|
-
import "monaco-editor/editor/contrib/codeAction/browser/codeActionContributions.js";
|
|
7
|
-
import "monaco-editor/editor/browser/widget/codeEditor/codeEditorWidget.js";
|
|
8
|
-
import "monaco-editor/editor/contrib/codelens/browser/codelensController.js";
|
|
9
|
-
import "monaco-editor/editor/contrib/colorPicker/browser/colorPickerContribution.js";
|
|
10
|
-
import "monaco-editor/editor/contrib/comment/browser/comment.js";
|
|
11
|
-
import "monaco-editor/editor/contrib/contextmenu/browser/contextmenu.js";
|
|
12
|
-
import "monaco-editor/editor/contrib/cursorUndo/browser/cursorUndo.js";
|
|
13
|
-
import "monaco-editor/editor/browser/widget/diffEditor/diffEditor.contribution.js";
|
|
14
|
-
import "monaco-editor/editor/contrib/diffEditorBreadcrumbs/browser/contribution.js";
|
|
15
|
-
import "monaco-editor/editor/contrib/dnd/browser/dnd.js";
|
|
16
|
-
import "monaco-editor/editor/contrib/documentSymbols/browser/documentSymbols.js";
|
|
17
|
-
import "monaco-editor/editor/contrib/dropOrPasteInto/browser/dropIntoEditorContribution.js";
|
|
18
|
-
import "monaco-editor/features/find/register.js";
|
|
19
|
-
import "monaco-editor/editor/contrib/floatingMenu/browser/floatingMenu.contribution.js";
|
|
20
|
-
import "monaco-editor/editor/contrib/folding/browser/folding.js";
|
|
21
|
-
import "monaco-editor/editor/contrib/fontZoom/browser/fontZoom.js";
|
|
22
|
-
import "monaco-editor/editor/contrib/format/browser/formatActions.js";
|
|
23
|
-
import "monaco-editor/editor/contrib/gotoError/browser/gotoError.js";
|
|
24
|
-
import "monaco-editor/editor/standalone/browser/quickAccess/standaloneGotoLineQuickAccess.js";
|
|
25
|
-
import "monaco-editor/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.js";
|
|
26
|
-
import "monaco-editor/editor/contrib/gpu/browser/gpuActions.js";
|
|
27
|
-
import "monaco-editor/editor/contrib/hover/browser/hoverContribution.js";
|
|
28
|
-
import "monaco-editor/editor/contrib/indentation/browser/indentation.js";
|
|
29
|
-
import "monaco-editor/editor/contrib/inlayHints/browser/inlayHintsContribution.js";
|
|
30
|
-
import "monaco-editor/editor/contrib/inlineCompletions/browser/inlineCompletions.contribution.js";
|
|
31
|
-
import "monaco-editor/editor/contrib/inlineProgress/browser/inlineProgress.js";
|
|
32
|
-
import "monaco-editor/editor/contrib/inPlaceReplace/browser/inPlaceReplace.js";
|
|
33
|
-
import "monaco-editor/editor/contrib/insertFinalNewLine/browser/insertFinalNewLine.js";
|
|
34
|
-
import "monaco-editor/editor/standalone/browser/inspectTokens/inspectTokens.js";
|
|
35
|
-
import "monaco-editor/editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard.js";
|
|
36
|
-
import "monaco-editor/editor/contrib/lineSelection/browser/lineSelection.js";
|
|
37
|
-
import "monaco-editor/editor/contrib/linesOperations/browser/linesOperations.js";
|
|
38
|
-
import "monaco-editor/editor/contrib/linkedEditing/browser/linkedEditing.js";
|
|
39
|
-
import "monaco-editor/editor/contrib/links/browser/links.js";
|
|
40
|
-
import "monaco-editor/editor/contrib/longLinesHelper/browser/longLinesHelper.js";
|
|
41
|
-
import "monaco-editor/editor/contrib/middleScroll/browser/middleScroll.contribution.js";
|
|
42
|
-
import "monaco-editor/editor/contrib/multicursor/browser/multicursor.js";
|
|
43
|
-
import "monaco-editor/editor/contrib/parameterHints/browser/parameterHints.js";
|
|
44
|
-
import "monaco-editor/editor/contrib/placeholderText/browser/placeholderText.contribution.js";
|
|
45
|
-
import "monaco-editor/editor/standalone/browser/quickAccess/standaloneCommandsQuickAccess.js";
|
|
46
|
-
import "monaco-editor/editor/standalone/browser/quickAccess/standaloneHelpQuickAccess.js";
|
|
47
|
-
import "monaco-editor/editor/standalone/browser/quickAccess/standaloneGotoSymbolQuickAccess.js";
|
|
48
|
-
import "monaco-editor/editor/contrib/readOnlyMessage/browser/contribution.js";
|
|
49
|
-
import "monaco-editor/editor/standalone/browser/referenceSearch/standaloneReferenceSearch.js";
|
|
50
|
-
import "monaco-editor/editor/contrib/rename/browser/rename.js";
|
|
51
|
-
import "monaco-editor/editor/contrib/sectionHeaders/browser/sectionHeaders.js";
|
|
52
|
-
import "monaco-editor/editor/contrib/semanticTokens/browser/viewportSemanticTokens.js";
|
|
53
|
-
import "monaco-editor/editor/contrib/smartSelect/browser/smartSelect.js";
|
|
54
|
-
import "monaco-editor/editor/contrib/snippet/browser/snippetController2.js";
|
|
55
|
-
import "monaco-editor/editor/contrib/stickyScroll/browser/stickyScrollContribution.js";
|
|
56
|
-
import "monaco-editor/editor/contrib/suggest/browser/suggestInlineCompletions.js";
|
|
57
|
-
import "monaco-editor/editor/standalone/browser/toggleHighContrast/toggleHighContrast.js";
|
|
58
|
-
import "monaco-editor/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode.js";
|
|
59
|
-
import "monaco-editor/editor/contrib/tokenization/browser/tokenization.js";
|
|
60
|
-
import "monaco-editor/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js";
|
|
61
|
-
import "monaco-editor/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.js";
|
|
62
|
-
import "monaco-editor/editor/contrib/wordHighlighter/browser/wordHighlighter.js";
|
|
63
|
-
import "monaco-editor/editor/contrib/wordOperations/browser/wordOperations.js";
|
|
64
|
-
import "monaco-editor/editor/contrib/wordPartOperations/browser/wordPartOperations.js";
|
|
65
|
-
import "monaco-editor/editor/browser/coreCommands.js";
|
|
66
|
-
import "monaco-editor/editor/contrib/caretOperations/browser/caretOperations.js";
|
|
67
|
-
import "monaco-editor/editor/contrib/dropOrPasteInto/browser/copyPasteContribution.js";
|
|
68
|
-
import "monaco-editor/editor/contrib/find/browser/findController.js";
|
|
69
|
-
import "monaco-editor/editor/contrib/gotoSymbol/browser/goToCommands.js";
|
|
70
|
-
import "monaco-editor/editor/contrib/gotoError/browser/markerSelectionStatus.js";
|
|
71
|
-
import "monaco-editor/editor/contrib/semanticTokens/browser/documentSemanticTokens.js";
|
|
72
|
-
import "monaco-editor/editor/contrib/suggest/browser/suggestController.js";
|
|
73
|
-
import "monaco-editor/editor/common/standaloneStrings.js";
|
|
74
|
-
//# sourceMappingURL=monacoContributions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"monacoContributions.d.ts","sourceRoot":"","sources":["../../../src/MaqlEditor/monaco/monacoContributions.ts"],"names":[],"mappings":"AAkBA,OAAO,oBAAoB,CAAC;AAC5B,OAAO,mEAAmE,CAAC;AAC3E,OAAO,yEAAyE,CAAC;AACjF,OAAO,mEAAmE,CAAC;AAC3E,OAAO,6DAA6D,CAAC;AACrE,OAAO,4EAA4E,CAAC;AACpF,OAAO,oEAAoE,CAAC;AAC5E,OAAO,qEAAqE,CAAC;AAC7E,OAAO,6EAA6E,CAAC;AACrF,OAAO,yDAAyD,CAAC;AACjE,OAAO,iEAAiE,CAAC;AACzE,OAAO,+DAA+D,CAAC;AACvE,OAAO,2EAA2E,CAAC;AACnF,OAAO,4EAA4E,CAAC;AACpF,OAAO,iDAAiD,CAAC;AACzD,OAAO,yEAAyE,CAAC;AACjF,OAAO,oFAAoF,CAAC;AAC5F,OAAO,yCAAyC,CAAC;AACjD,OAAO,gFAAgF,CAAC;AACxF,OAAO,yDAAyD,CAAC;AACjE,OAAO,2DAA2D,CAAC;AACnE,OAAO,8DAA8D,CAAC;AACtE,OAAO,6DAA6D,CAAC;AACrE,OAAO,sFAAsF,CAAC;AAC9F,OAAO,kFAAkF,CAAC;AAC1F,OAAO,wDAAwD,CAAC;AAChE,OAAO,iEAAiE,CAAC;AACzE,OAAO,iEAAiE,CAAC;AACzE,OAAO,2EAA2E,CAAC;AACnF,OAAO,0FAA0F,CAAC;AAClG,OAAO,uEAAuE,CAAC;AAC/E,OAAO,uEAAuE,CAAC;AAC/E,OAAO,+EAA+E,CAAC;AACvF,OAAO,wEAAwE,CAAC;AAChF,OAAO,8EAA8E,CAAC;AACtF,OAAO,qEAAqE,CAAC;AAC7E,OAAO,yEAAyE,CAAC;AACjF,OAAO,qEAAqE,CAAC;AAC7E,OAAO,qDAAqD,CAAC;AAC7D,OAAO,yEAAyE,CAAC;AACjF,OAAO,gFAAgF,CAAC;AACxF,OAAO,iEAAiE,CAAC;AACzE,OAAO,uEAAuE,CAAC;AAC/E,OAAO,sFAAsF,CAAC;AAC9F,OAAO,sFAAsF,CAAC;AAC9F,OAAO,kFAAkF,CAAC;AAC1F,OAAO,wFAAwF,CAAC;AAChG,OAAO,sEAAsE,CAAC;AAC9E,OAAO,sFAAsF,CAAC;AAC9F,OAAO,uDAAuD,CAAC;AAC/D,OAAO,uEAAuE,CAAC;AAC/E,OAAO,+EAA+E,CAAC;AACvF,OAAO,iEAAiE,CAAC;AACzE,OAAO,oEAAoE,CAAC;AAC5E,OAAO,+EAA+E,CAAC;AACvF,OAAO,0EAA0E,CAAC;AAClF,OAAO,kFAAkF,CAAC;AAC1F,OAAO,+EAA+E,CAAC;AACvF,OAAO,mEAAmE,CAAC;AAC3E,OAAO,+EAA+E,CAAC;AACvF,OAAO,uFAAuF,CAAC;AAC/F,OAAO,yEAAyE,CAAC;AACjF,OAAO,uEAAuE,CAAC;AAC/E,OAAO,+EAA+E,CAAC;AACvF,OAAO,8CAA8C,CAAC;AACtD,OAAO,yEAAyE,CAAC;AACjF,OAAO,+EAA+E,CAAC;AACvF,OAAO,6DAA6D,CAAC;AACrE,OAAO,iEAAiE,CAAC;AACzE,OAAO,yEAAyE,CAAC;AACjF,OAAO,+EAA+E,CAAC;AACvF,OAAO,mEAAmE,CAAC;AAC3E,OAAO,kDAAkD,CAAC"}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
// (C) 2021-2026 GoodData Corporation
|
|
2
|
-
// oxlint-disable import/no-unassigned-import -- monaco editor contributions register themselves as a side effect of being imported
|
|
3
|
-
// Monaco 0.56 removed the `editor.all.js` aggregate. Its "batteries-included" replacement,
|
|
4
|
-
// `editor.main.js`, bundles the same editor contributions but ALSO eagerly registers every basic
|
|
5
|
-
// language (~80 of them) plus the css/html/json and (~12 MB) TypeScript language-feature services.
|
|
6
|
-
// None of that is used by our editors, yet all of it lands in the bundle (~10 MB+). This module
|
|
7
|
-
// reproduces exactly the editor *contribution* block of `editor.main.js` WITHOUT any language
|
|
8
|
-
// definition or language-feature imports; callers register only the language(s) they actually need.
|
|
9
|
-
//
|
|
10
|
-
// Keep this list in sync with the contribution block of
|
|
11
|
-
// `monaco-editor/esm/vs/editor/editor.main.js` (i.e. everything except its `languages/definitions/*`
|
|
12
|
-
// and `languages/features/*` imports). All required CSS (codicons, widgets, etc.) is pulled in
|
|
13
|
-
// transitively through these contribution modules' own relative imports.
|
|
14
|
-
// First, so `MonacoEnvironment` is wired before any Monaco module below is evaluated and can reach
|
|
15
|
-
// for the editor worker. See monacoWorkers.ts.
|
|
16
|
-
import "./monacoWorkers.js";
|
|
17
|
-
import "monaco-editor/editor/contrib/anchorSelect/browser/anchorSelect.js";
|
|
18
|
-
import "monaco-editor/editor/contrib/bracketMatching/browser/bracketMatching.js";
|
|
19
|
-
import "monaco-editor/editor/contrib/caretOperations/browser/transpose.js";
|
|
20
|
-
import "monaco-editor/editor/contrib/clipboard/browser/clipboard.js";
|
|
21
|
-
import "monaco-editor/editor/contrib/codeAction/browser/codeActionContributions.js";
|
|
22
|
-
import "monaco-editor/editor/browser/widget/codeEditor/codeEditorWidget.js";
|
|
23
|
-
import "monaco-editor/editor/contrib/codelens/browser/codelensController.js";
|
|
24
|
-
import "monaco-editor/editor/contrib/colorPicker/browser/colorPickerContribution.js";
|
|
25
|
-
import "monaco-editor/editor/contrib/comment/browser/comment.js";
|
|
26
|
-
import "monaco-editor/editor/contrib/contextmenu/browser/contextmenu.js";
|
|
27
|
-
import "monaco-editor/editor/contrib/cursorUndo/browser/cursorUndo.js";
|
|
28
|
-
import "monaco-editor/editor/browser/widget/diffEditor/diffEditor.contribution.js";
|
|
29
|
-
import "monaco-editor/editor/contrib/diffEditorBreadcrumbs/browser/contribution.js";
|
|
30
|
-
import "monaco-editor/editor/contrib/dnd/browser/dnd.js";
|
|
31
|
-
import "monaco-editor/editor/contrib/documentSymbols/browser/documentSymbols.js";
|
|
32
|
-
import "monaco-editor/editor/contrib/dropOrPasteInto/browser/dropIntoEditorContribution.js";
|
|
33
|
-
import "monaco-editor/features/find/register.js";
|
|
34
|
-
import "monaco-editor/editor/contrib/floatingMenu/browser/floatingMenu.contribution.js";
|
|
35
|
-
import "monaco-editor/editor/contrib/folding/browser/folding.js";
|
|
36
|
-
import "monaco-editor/editor/contrib/fontZoom/browser/fontZoom.js";
|
|
37
|
-
import "monaco-editor/editor/contrib/format/browser/formatActions.js";
|
|
38
|
-
import "monaco-editor/editor/contrib/gotoError/browser/gotoError.js";
|
|
39
|
-
import "monaco-editor/editor/standalone/browser/quickAccess/standaloneGotoLineQuickAccess.js";
|
|
40
|
-
import "monaco-editor/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.js";
|
|
41
|
-
import "monaco-editor/editor/contrib/gpu/browser/gpuActions.js";
|
|
42
|
-
import "monaco-editor/editor/contrib/hover/browser/hoverContribution.js";
|
|
43
|
-
import "monaco-editor/editor/contrib/indentation/browser/indentation.js";
|
|
44
|
-
import "monaco-editor/editor/contrib/inlayHints/browser/inlayHintsContribution.js";
|
|
45
|
-
import "monaco-editor/editor/contrib/inlineCompletions/browser/inlineCompletions.contribution.js";
|
|
46
|
-
import "monaco-editor/editor/contrib/inlineProgress/browser/inlineProgress.js";
|
|
47
|
-
import "monaco-editor/editor/contrib/inPlaceReplace/browser/inPlaceReplace.js";
|
|
48
|
-
import "monaco-editor/editor/contrib/insertFinalNewLine/browser/insertFinalNewLine.js";
|
|
49
|
-
import "monaco-editor/editor/standalone/browser/inspectTokens/inspectTokens.js";
|
|
50
|
-
import "monaco-editor/editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard.js";
|
|
51
|
-
import "monaco-editor/editor/contrib/lineSelection/browser/lineSelection.js";
|
|
52
|
-
import "monaco-editor/editor/contrib/linesOperations/browser/linesOperations.js";
|
|
53
|
-
import "monaco-editor/editor/contrib/linkedEditing/browser/linkedEditing.js";
|
|
54
|
-
import "monaco-editor/editor/contrib/links/browser/links.js";
|
|
55
|
-
import "monaco-editor/editor/contrib/longLinesHelper/browser/longLinesHelper.js";
|
|
56
|
-
import "monaco-editor/editor/contrib/middleScroll/browser/middleScroll.contribution.js";
|
|
57
|
-
import "monaco-editor/editor/contrib/multicursor/browser/multicursor.js";
|
|
58
|
-
import "monaco-editor/editor/contrib/parameterHints/browser/parameterHints.js";
|
|
59
|
-
import "monaco-editor/editor/contrib/placeholderText/browser/placeholderText.contribution.js";
|
|
60
|
-
import "monaco-editor/editor/standalone/browser/quickAccess/standaloneCommandsQuickAccess.js";
|
|
61
|
-
import "monaco-editor/editor/standalone/browser/quickAccess/standaloneHelpQuickAccess.js";
|
|
62
|
-
import "monaco-editor/editor/standalone/browser/quickAccess/standaloneGotoSymbolQuickAccess.js";
|
|
63
|
-
import "monaco-editor/editor/contrib/readOnlyMessage/browser/contribution.js";
|
|
64
|
-
import "monaco-editor/editor/standalone/browser/referenceSearch/standaloneReferenceSearch.js";
|
|
65
|
-
import "monaco-editor/editor/contrib/rename/browser/rename.js";
|
|
66
|
-
import "monaco-editor/editor/contrib/sectionHeaders/browser/sectionHeaders.js";
|
|
67
|
-
import "monaco-editor/editor/contrib/semanticTokens/browser/viewportSemanticTokens.js";
|
|
68
|
-
import "monaco-editor/editor/contrib/smartSelect/browser/smartSelect.js";
|
|
69
|
-
import "monaco-editor/editor/contrib/snippet/browser/snippetController2.js";
|
|
70
|
-
import "monaco-editor/editor/contrib/stickyScroll/browser/stickyScrollContribution.js";
|
|
71
|
-
import "monaco-editor/editor/contrib/suggest/browser/suggestInlineCompletions.js";
|
|
72
|
-
import "monaco-editor/editor/standalone/browser/toggleHighContrast/toggleHighContrast.js";
|
|
73
|
-
import "monaco-editor/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode.js";
|
|
74
|
-
import "monaco-editor/editor/contrib/tokenization/browser/tokenization.js";
|
|
75
|
-
import "monaco-editor/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js";
|
|
76
|
-
import "monaco-editor/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.js";
|
|
77
|
-
import "monaco-editor/editor/contrib/wordHighlighter/browser/wordHighlighter.js";
|
|
78
|
-
import "monaco-editor/editor/contrib/wordOperations/browser/wordOperations.js";
|
|
79
|
-
import "monaco-editor/editor/contrib/wordPartOperations/browser/wordPartOperations.js";
|
|
80
|
-
import "monaco-editor/editor/browser/coreCommands.js";
|
|
81
|
-
import "monaco-editor/editor/contrib/caretOperations/browser/caretOperations.js";
|
|
82
|
-
import "monaco-editor/editor/contrib/dropOrPasteInto/browser/copyPasteContribution.js";
|
|
83
|
-
import "monaco-editor/editor/contrib/find/browser/findController.js";
|
|
84
|
-
import "monaco-editor/editor/contrib/gotoSymbol/browser/goToCommands.js";
|
|
85
|
-
import "monaco-editor/editor/contrib/gotoError/browser/markerSelectionStatus.js";
|
|
86
|
-
import "monaco-editor/editor/contrib/semanticTokens/browser/documentSemanticTokens.js";
|
|
87
|
-
import "monaco-editor/editor/contrib/suggest/browser/suggestController.js";
|
|
88
|
-
import "monaco-editor/editor/common/standaloneStrings.js";
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* URL of the self-contained editor worker file that this package ships, relative to this module.
|
|
3
|
-
*
|
|
4
|
-
* @remarks
|
|
5
|
-
* The relative path is the same from `src/MaqlEditor/monaco/` and from `esm/MaqlEditor/monaco/`, so
|
|
6
|
-
* it also holds when a dev server serves this package from its sources. webpack and Vite recognise
|
|
7
|
-
* the `new URL("...", import.meta.url)` pattern and emit the file as an asset. A pre-bundled
|
|
8
|
-
* dependency, other bundlers and a Module Federation remote on another origin leave a URL that does
|
|
9
|
-
* not exist or that the page cannot start a worker from. The URL must therefore be checked before
|
|
10
|
-
* the worker starts, see {@link resolveEditorWorkerUrl}.
|
|
11
|
-
*
|
|
12
|
-
* @internal
|
|
13
|
-
*/
|
|
14
|
-
export declare function getBundledEditorWorkerUrl(): string;
|
|
15
|
-
/**
|
|
16
|
-
* Resolves the URL the editor worker starts from: the bundled worker file when the bundler emitted
|
|
17
|
-
* it next to the page, the inline worker otherwise.
|
|
18
|
-
*
|
|
19
|
-
* @param assetUrl - URL of the bundled worker file, defaults to {@link getBundledEditorWorkerUrl}
|
|
20
|
-
* @internal
|
|
21
|
-
*/
|
|
22
|
-
export declare function resolveEditorWorkerUrl(assetUrl?: string): Promise<string>;
|
|
23
|
-
/**
|
|
24
|
-
* Name of the Trusted Types policy that turns the worker URL into a `TrustedScriptURL`. A page whose
|
|
25
|
-
* content security policy lists the allowed policy names must allow this one.
|
|
26
|
-
*
|
|
27
|
-
* @internal
|
|
28
|
-
*/
|
|
29
|
-
export declare const EDITOR_WORKER_TRUSTED_TYPES_POLICY = "gdMetricEditorWorker";
|
|
30
|
-
/**
|
|
31
|
-
* Creates the `MonacoEnvironment.getWorker` that starts the bundled editor worker.
|
|
32
|
-
*
|
|
33
|
-
* @remarks
|
|
34
|
-
* The worker URL and the Trusted Types policy are created once and shared by all workers, which is why
|
|
35
|
-
* the cache lives in the created function: tests create their own, the runtime uses one. A failed
|
|
36
|
-
* resolution is not cached, so the next worker tries again.
|
|
37
|
-
*
|
|
38
|
-
* @param resolveWorkerUrl - resolves the URL of the worker this package ships
|
|
39
|
-
* @internal
|
|
40
|
-
*/
|
|
41
|
-
export declare function createEditorWorkerFactory(resolveWorkerUrl?: () => Promise<string>): (workerId: string, label: string) => Promise<Worker>;
|
|
42
|
-
/**
|
|
43
|
-
* Point Monaco at the bundled `editorWorkerService` worker.
|
|
44
|
-
*
|
|
45
|
-
* Called at module load (below) as well as before each `monaco.editor.create`, because Monaco can
|
|
46
|
-
* reach for the worker at any point after its own modules are evaluated — not only once an editor
|
|
47
|
-
* exists. Whoever gets there first wins; the rest are no-ops.
|
|
48
|
-
*
|
|
49
|
-
* Idempotent, and never overrides a `MonacoEnvironment` already provided by the hosting
|
|
50
|
-
* application — a host that wires its own workers stays in charge.
|
|
51
|
-
*/
|
|
52
|
-
export declare function setupMonacoWorkers(): void;
|
|
53
|
-
//# sourceMappingURL=monacoWorkers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"monacoWorkers.d.ts","sourceRoot":"","sources":["../../../src/MaqlEditor/monaco/monacoWorkers.ts"],"names":[],"mappings":"AAsBA;;;;;;;;;;;;GAYG;AACH,wBAAgB,yBAAyB,IAAI,MAAM,CAElD;AAiED;;;;;;GAMG;AACH,wBAAsB,sBAAsB,CACxC,QAAQ,GAAE,MAAoC,GAC/C,OAAO,CAAC,MAAM,CAAC,CAEjB;AAKD;;;;;GAKG;AACH,eAAO,MAAM,kCAAkC,yBAAyB,CAAC;AA2BzE;;;;;;;;;;GAUG;AACH,wBAAgB,yBAAyB,CACrC,gBAAgB,GAAE,MAAM,OAAO,CAAC,MAAM,CAA0B,GACjE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAetD;AAID;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CASzC"}
|
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
// (C) 2026 GoodData Corporation
|
|
2
|
-
// Monaco lazily spawns one web worker of its own (label `editorWorkerService`) for the work it keeps
|
|
3
|
-
// off the UI thread: diff computation, word-based suggestions, link detection. We never construct it,
|
|
4
|
-
// so its script URL comes from Monaco's bundler fallback in
|
|
5
|
-
// `monaco-editor/esm/vs/editor/browser/services/editorWorkerService.js`:
|
|
6
|
-
//
|
|
7
|
-
// new URL("../../common/services/editorWebWorkerMain.js", import.meta.url)
|
|
8
|
-
//
|
|
9
|
-
// Bundlers read a bare `new URL(..., import.meta.url)` (not wrapped in `new Worker(...)`) as a plain
|
|
10
|
-
// *asset* reference, so they copy or inline the untouched 544 B entry instead of bundling it. The
|
|
11
|
-
// worker then fails on its own first relative import:
|
|
12
|
-
//
|
|
13
|
-
// Failed to load worker script for label: editorWorkerService.
|
|
14
|
-
// TypeError: Failed to resolve module specifier "../../../base/common/worker/webWorkerBootstrap.js".
|
|
15
|
-
//
|
|
16
|
-
// The fix is to hand Monaco a properly bundled worker. The build of this package bundles the entry
|
|
17
|
-
// with its whole dependency graph into the self-contained `worker/monaco-editor-worker.js` and wraps
|
|
18
|
-
// the same code into a string module (see the `build-worker` script). sdk-ui-geo ships its MapLibre
|
|
19
|
-
// worker the same way. Nothing here depends on a bundler feature, so the package works in any bundler
|
|
20
|
-
// and in the Vite dev server, which pre-bundles it from node_modules.
|
|
21
|
-
/**
|
|
22
|
-
* URL of the self-contained editor worker file that this package ships, relative to this module.
|
|
23
|
-
*
|
|
24
|
-
* @remarks
|
|
25
|
-
* The relative path is the same from `src/MaqlEditor/monaco/` and from `esm/MaqlEditor/monaco/`, so
|
|
26
|
-
* it also holds when a dev server serves this package from its sources. webpack and Vite recognise
|
|
27
|
-
* the `new URL("...", import.meta.url)` pattern and emit the file as an asset. A pre-bundled
|
|
28
|
-
* dependency, other bundlers and a Module Federation remote on another origin leave a URL that does
|
|
29
|
-
* not exist or that the page cannot start a worker from. The URL must therefore be checked before
|
|
30
|
-
* the worker starts, see {@link resolveEditorWorkerUrl}.
|
|
31
|
-
*
|
|
32
|
-
* @internal
|
|
33
|
-
*/
|
|
34
|
-
export function getBundledEditorWorkerUrl() {
|
|
35
|
-
return new URL("../../../worker/monaco-editor-worker.js", import.meta.url).href;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* How long the check of the bundled worker file may take before the inline worker is used instead.
|
|
39
|
-
*/
|
|
40
|
-
const WORKER_FILE_CHECK_TIMEOUT_MS = 5000;
|
|
41
|
-
/**
|
|
42
|
-
* Tells whether the worker can start from the URL directly: the URL is a same-origin `http(s)` URL
|
|
43
|
-
* and the server has the file as JavaScript.
|
|
44
|
-
*
|
|
45
|
-
* @remarks
|
|
46
|
-
* A cross-origin URL is not used even when the file exists: the browser does not start a worker from
|
|
47
|
-
* another origin, which is the case of this editor loaded from a Module Federation remote. The same
|
|
48
|
-
* holds for a same-origin URL that redirects to another origin.
|
|
49
|
-
*
|
|
50
|
-
* The MIME type is checked because single-page application servers often answer a missing file with
|
|
51
|
-
* `index.html` and status 200, and browsers do not start a module worker from HTML.
|
|
52
|
-
*/
|
|
53
|
-
async function isReachableSameOriginScript(url) {
|
|
54
|
-
const pageOrigin = typeof location === "undefined" ? undefined : location.origin;
|
|
55
|
-
if (!pageOrigin) {
|
|
56
|
-
return false;
|
|
57
|
-
}
|
|
58
|
-
let parsed;
|
|
59
|
-
try {
|
|
60
|
-
parsed = new URL(url);
|
|
61
|
-
}
|
|
62
|
-
catch {
|
|
63
|
-
return false;
|
|
64
|
-
}
|
|
65
|
-
if (!/^https?:$/.test(parsed.protocol) || parsed.origin !== pageOrigin) {
|
|
66
|
-
return false;
|
|
67
|
-
}
|
|
68
|
-
try {
|
|
69
|
-
const response = await fetch(url, {
|
|
70
|
-
method: "HEAD",
|
|
71
|
-
signal: AbortSignal.timeout(WORKER_FILE_CHECK_TIMEOUT_MS),
|
|
72
|
-
});
|
|
73
|
-
return (response.ok &&
|
|
74
|
-
(!response.url || new URL(response.url).origin === pageOrigin) &&
|
|
75
|
-
/^(text|application)\/(javascript|ecmascript)\b/.test(response.headers.get("content-type") ?? ""));
|
|
76
|
-
}
|
|
77
|
-
catch {
|
|
78
|
-
return false;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Makes a worker URL from the worker code this package ships inline. The Blob URL carries the origin
|
|
83
|
-
* of the page, so the worker starts from it on any page. The URL is never revoked: Monaco creates its
|
|
84
|
-
* worker lazily and the one Blob lives as long as the page.
|
|
85
|
-
*/
|
|
86
|
-
async function createInlineWorkerUrl() {
|
|
87
|
-
const { default: source } = await import("../../../worker/monaco-editor-worker.source.js");
|
|
88
|
-
return URL.createObjectURL(new Blob([source], { type: "text/javascript" }));
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Resolves the URL the editor worker starts from: the bundled worker file when the bundler emitted
|
|
92
|
-
* it next to the page, the inline worker otherwise.
|
|
93
|
-
*
|
|
94
|
-
* @param assetUrl - URL of the bundled worker file, defaults to {@link getBundledEditorWorkerUrl}
|
|
95
|
-
* @internal
|
|
96
|
-
*/
|
|
97
|
-
export async function resolveEditorWorkerUrl(assetUrl = getBundledEditorWorkerUrl()) {
|
|
98
|
-
return (await isReachableSameOriginScript(assetUrl)) ? assetUrl : createInlineWorkerUrl();
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* Name of the Trusted Types policy that turns the worker URL into a `TrustedScriptURL`. A page whose
|
|
102
|
-
* content security policy lists the allowed policy names must allow this one.
|
|
103
|
-
*
|
|
104
|
-
* @internal
|
|
105
|
-
*/
|
|
106
|
-
export const EDITOR_WORKER_TRUSTED_TYPES_POLICY = "gdMetricEditorWorker";
|
|
107
|
-
/**
|
|
108
|
-
* Creates the Trusted Types policy for the worker URL the way Monaco creates its own: through the
|
|
109
|
-
* host's `MonacoEnvironment.createTrustedTypesPolicy` when it has one, through the browser otherwise.
|
|
110
|
-
* Without the policy, a page that enforces Trusted Types does not start a worker from a plain string.
|
|
111
|
-
* Monaco itself already uses the name `defaultWorkerFactory`, and a page that enforces Trusted Types
|
|
112
|
-
* may not allow a second policy of the same name.
|
|
113
|
-
*/
|
|
114
|
-
function createWorkerUrlPolicy() {
|
|
115
|
-
const options = { createScriptURL: (url) => url };
|
|
116
|
-
const environment = globalThis.MonacoEnvironment;
|
|
117
|
-
// The DOM typings of TypeScript do not declare Trusted Types; the browser API has the same shape.
|
|
118
|
-
const { trustedTypes } = globalThis;
|
|
119
|
-
try {
|
|
120
|
-
return environment?.createTrustedTypesPolicy
|
|
121
|
-
? environment.createTrustedTypesPolicy(EDITOR_WORKER_TRUSTED_TYPES_POLICY, options)
|
|
122
|
-
: trustedTypes?.createPolicy(EDITOR_WORKER_TRUSTED_TYPES_POLICY, options);
|
|
123
|
-
}
|
|
124
|
-
catch (error) {
|
|
125
|
-
console.error("The Trusted Types policy of the metric editor worker cannot be created.", error);
|
|
126
|
-
return undefined;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
/**
|
|
130
|
-
* Creates the `MonacoEnvironment.getWorker` that starts the bundled editor worker.
|
|
131
|
-
*
|
|
132
|
-
* @remarks
|
|
133
|
-
* The worker URL and the Trusted Types policy are created once and shared by all workers, which is why
|
|
134
|
-
* the cache lives in the created function: tests create their own, the runtime uses one. A failed
|
|
135
|
-
* resolution is not cached, so the next worker tries again.
|
|
136
|
-
*
|
|
137
|
-
* @param resolveWorkerUrl - resolves the URL of the worker this package ships
|
|
138
|
-
* @internal
|
|
139
|
-
*/
|
|
140
|
-
export function createEditorWorkerFactory(resolveWorkerUrl = resolveEditorWorkerUrl) {
|
|
141
|
-
let resolvedWorkerUrl;
|
|
142
|
-
let workerUrlPolicy;
|
|
143
|
-
return async (_workerId, label) => {
|
|
144
|
-
resolvedWorkerUrl ??= resolveWorkerUrl().catch((error) => {
|
|
145
|
-
resolvedWorkerUrl = undefined;
|
|
146
|
-
throw error;
|
|
147
|
-
});
|
|
148
|
-
const workerUrl = await resolvedWorkerUrl;
|
|
149
|
-
workerUrlPolicy ??= { value: createWorkerUrlPolicy() };
|
|
150
|
-
const scriptUrl = workerUrlPolicy.value?.createScriptURL?.(workerUrl) ?? workerUrl;
|
|
151
|
-
return new Worker(scriptUrl, { type: "module", name: label });
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
const getEditorWorker = createEditorWorkerFactory();
|
|
155
|
-
/**
|
|
156
|
-
* Point Monaco at the bundled `editorWorkerService` worker.
|
|
157
|
-
*
|
|
158
|
-
* Called at module load (below) as well as before each `monaco.editor.create`, because Monaco can
|
|
159
|
-
* reach for the worker at any point after its own modules are evaluated — not only once an editor
|
|
160
|
-
* exists. Whoever gets there first wins; the rest are no-ops.
|
|
161
|
-
*
|
|
162
|
-
* Idempotent, and never overrides a `MonacoEnvironment` already provided by the hosting
|
|
163
|
-
* application — a host that wires its own workers stays in charge.
|
|
164
|
-
*/
|
|
165
|
-
export function setupMonacoWorkers() {
|
|
166
|
-
if (globalThis.MonacoEnvironment?.getWorker || globalThis.MonacoEnvironment?.getWorkerUrl) {
|
|
167
|
-
return;
|
|
168
|
-
}
|
|
169
|
-
globalThis.MonacoEnvironment = {
|
|
170
|
-
...globalThis.MonacoEnvironment,
|
|
171
|
-
getWorker: getEditorWorker,
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
// Run on import, so the environment is in place before any Monaco module can ask for the worker —
|
|
175
|
-
// importers of this module get the wiring by depending on it, without an ordering contract.
|
|
176
|
-
setupMonacoWorkers();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useDocumentFormatting.d.ts","sourceRoot":"","sources":["../../../../src/MaqlEditor/sql/hooks/useDocumentFormatting.ts"],"names":[],"mappings":"AAUA,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAwB9D"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
// (C) 2022-2026 GoodData Corporation
|
|
2
|
-
import { useEffect } from "react";
|
|
3
|
-
import * as monaco from "monaco-editor/editor/editor.api.js";
|
|
4
|
-
//more info in README.md
|
|
5
|
-
import { formatDocument } from "../formatter.js";
|
|
6
|
-
import { createDocument } from "../utils.js";
|
|
7
|
-
export function useDocumentFormatting(languageId) {
|
|
8
|
-
useEffect(() => {
|
|
9
|
-
const disposeFormatting = monaco.languages.registerDocumentFormattingEditProvider(languageId, {
|
|
10
|
-
provideDocumentFormattingEdits: (model, options) => {
|
|
11
|
-
const document = createDocument(model);
|
|
12
|
-
return formatDocument(document, options, model.getFullModelRange());
|
|
13
|
-
},
|
|
14
|
-
});
|
|
15
|
-
const disposeRangeFormatting = monaco.languages.registerDocumentRangeFormattingEditProvider(languageId, {
|
|
16
|
-
provideDocumentRangeFormattingEdits: (model, range, options) => {
|
|
17
|
-
const document = createDocument(model, range);
|
|
18
|
-
return formatDocument(document, options, range);
|
|
19
|
-
},
|
|
20
|
-
});
|
|
21
|
-
return () => {
|
|
22
|
-
disposeFormatting.dispose();
|
|
23
|
-
disposeRangeFormatting.dispose();
|
|
24
|
-
};
|
|
25
|
-
}, [languageId]);
|
|
26
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type * as monaco from "monaco-editor/editor/editor.api.js";
|
|
2
|
-
export type ILanguageConfiguration = monaco.languages.LanguageConfiguration;
|
|
3
|
-
export declare function useLanguageConfiguration(): ILanguageConfiguration;
|
|
4
|
-
//# sourceMappingURL=useLanguageConfiguration.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useLanguageConfiguration.d.ts","sourceRoot":"","sources":["../../../../src/MaqlEditor/sql/hooks/useLanguageConfiguration.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,MAAM,oCAAoC,CAAC;AAGlE,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC,SAAS,CAAC,qBAAqB,CAAC;AAE5E,wBAAgB,wBAAwB,IAAI,sBAAsB,CA6BjE"}
|