@finos/legend-lego 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- package/LICENSE +201 -0
- package/README.md +3 -0
- package/lib/code-editor/CodeEditor.d.ts +28 -0
- package/lib/code-editor/CodeEditor.d.ts.map +1 -0
- package/lib/code-editor/CodeEditor.js +109 -0
- package/lib/code-editor/CodeEditor.js.map +1 -0
- package/lib/code-editor/CodeEditorUtils.d.ts +61 -0
- package/lib/code-editor/CodeEditorUtils.d.ts.map +1 -0
- package/lib/code-editor/CodeEditorUtils.js +134 -0
- package/lib/code-editor/CodeEditorUtils.js.map +1 -0
- package/lib/code-editor/index.d.ts +18 -0
- package/lib/code-editor/index.d.ts.map +1 -0
- package/lib/code-editor/index.js +18 -0
- package/lib/code-editor/index.js.map +1 -0
- package/lib/code-editor/testing/MockedMonacoEditor.d.ts +17 -0
- package/lib/code-editor/testing/MockedMonacoEditor.d.ts.map +1 -0
- package/lib/code-editor/testing/MockedMonacoEditor.js +17 -0
- package/lib/code-editor/testing/MockedMonacoEditor.js.map +1 -0
- package/lib/code-editor/testing/MonacoEditorMockUtils.d.ts +99 -0
- package/lib/code-editor/testing/MonacoEditorMockUtils.d.ts.map +1 -0
- package/lib/code-editor/testing/MonacoEditorMockUtils.js +105 -0
- package/lib/code-editor/testing/MonacoEditorMockUtils.js.map +1 -0
- package/lib/code-editor/testing/index.d.ts +17 -0
- package/lib/code-editor/testing/index.d.ts.map +1 -0
- package/lib/code-editor/testing/index.js +17 -0
- package/lib/code-editor/testing/index.js.map +1 -0
- package/lib/data-grid/DataGrid.d.ts +22 -0
- package/lib/data-grid/DataGrid.d.ts.map +1 -0
- package/lib/data-grid/DataGrid.js +26 -0
- package/lib/data-grid/DataGrid.js.map +1 -0
- package/lib/data-grid/index.d.ts +17 -0
- package/lib/data-grid/index.d.ts.map +1 -0
- package/lib/data-grid/index.js +17 -0
- package/lib/data-grid/index.js.map +1 -0
- package/lib/index.css +17 -0
- package/lib/index.css.map +1 -0
- package/package.json +80 -0
- package/src/code-editor/CodeEditor.tsx +157 -0
- package/src/code-editor/CodeEditorUtils.ts +201 -0
- package/src/code-editor/index.ts +18 -0
- package/src/code-editor/testing/MockedMonacoEditor.ts +24 -0
- package/src/code-editor/testing/MonacoEditorMockUtils.tsx +111 -0
- package/src/code-editor/testing/index.ts +17 -0
- package/src/data-grid/DataGrid.tsx +42 -0
- package/src/data-grid/index.ts +17 -0
- package/tsconfig.json +48 -0
package/LICENSE
ADDED
@@ -0,0 +1,201 @@
|
|
1
|
+
Apache License
|
2
|
+
Version 2.0, January 2004
|
3
|
+
http://www.apache.org/licenses/
|
4
|
+
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
6
|
+
|
7
|
+
1. Definitions.
|
8
|
+
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
11
|
+
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
13
|
+
the copyright owner that is granting the License.
|
14
|
+
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
16
|
+
other entities that control, are controlled by, or are under common
|
17
|
+
control with that entity. For the purposes of this definition,
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
19
|
+
direction or management of such entity, whether by contract or
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
22
|
+
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
24
|
+
exercising permissions granted by this License.
|
25
|
+
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
27
|
+
including but not limited to software source code, documentation
|
28
|
+
source, and configuration files.
|
29
|
+
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
31
|
+
transformation or translation of a Source form, including but
|
32
|
+
not limited to compiled object code, generated documentation,
|
33
|
+
and conversions to other media types.
|
34
|
+
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
36
|
+
Object form, made available under the License, as indicated by a
|
37
|
+
copyright notice that is included in or attached to the work
|
38
|
+
(an example is provided in the Appendix below).
|
39
|
+
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
46
|
+
the Work and Derivative Works thereof.
|
47
|
+
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
49
|
+
the original version of the Work and any modifications or additions
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
61
|
+
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
64
|
+
subsequently incorporated within the Work.
|
65
|
+
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
72
|
+
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
78
|
+
where such license applies only to those patent claims licensable
|
79
|
+
by such Contributor that are necessarily infringed by their
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
82
|
+
institute patent litigation against any entity (including a
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
85
|
+
or contributory patent infringement, then any patent licenses
|
86
|
+
granted to You under this License for that Work shall terminate
|
87
|
+
as of the date such litigation is filed.
|
88
|
+
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
91
|
+
modifications, and in Source or Object form, provided that You
|
92
|
+
meet the following conditions:
|
93
|
+
|
94
|
+
(a) You must give any other recipients of the Work or
|
95
|
+
Derivative Works a copy of this License; and
|
96
|
+
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
98
|
+
stating that You changed the files; and
|
99
|
+
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
102
|
+
attribution notices from the Source form of the Work,
|
103
|
+
excluding those notices that do not pertain to any part of
|
104
|
+
the Derivative Works; and
|
105
|
+
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
108
|
+
include a readable copy of the attribution notices contained
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
111
|
+
of the following places: within a NOTICE text file distributed
|
112
|
+
as part of the Derivative Works; within the Source form or
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
114
|
+
within a display generated by the Derivative Works, if and
|
115
|
+
wherever such third-party notices normally appear. The contents
|
116
|
+
of the NOTICE file are for informational purposes only and
|
117
|
+
do not modify the License. You may add Your own attribution
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
120
|
+
that such additional attribution notices cannot be construed
|
121
|
+
as modifying the License.
|
122
|
+
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
124
|
+
may provide additional or different license terms and conditions
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
128
|
+
the conditions stated in this License.
|
129
|
+
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
133
|
+
this License, without any additional terms or conditions.
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
135
|
+
the terms of any separate license agreement you may have executed
|
136
|
+
with Licensor regarding such Contributions.
|
137
|
+
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
140
|
+
except as required for reasonable and customary use in describing the
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
142
|
+
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
152
|
+
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
158
|
+
incidental, or consequential damages of any character arising as a
|
159
|
+
result of this License or out of the use or inability to use the
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
162
|
+
other commercial damages or losses), even if such Contributor
|
163
|
+
has been advised of the possibility of such damages.
|
164
|
+
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
168
|
+
or other liability obligations and/or rights consistent with this
|
169
|
+
License. However, in accepting such obligations, You may act only
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
174
|
+
of your accepting any such warranty or additional liability.
|
175
|
+
|
176
|
+
END OF TERMS AND CONDITIONS
|
177
|
+
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
179
|
+
|
180
|
+
To apply the Apache License to your work, attach the following
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "{}"
|
182
|
+
replaced with your own identifying information. (Don't include
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
184
|
+
comment syntax for the file format. We also recommend that a
|
185
|
+
file or class name and description of purpose be included on the
|
186
|
+
same "printed page" as the copyright notice for easier
|
187
|
+
identification within third-party archives.
|
188
|
+
|
189
|
+
Copyright (c) 2020-present, Goldman Sachs
|
190
|
+
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
192
|
+
you may not use this file except in compliance with the License.
|
193
|
+
You may obtain a copy of the License at
|
194
|
+
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
196
|
+
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
200
|
+
See the License for the specific language governing permissions and
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
@@ -0,0 +1,28 @@
|
|
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
|
+
/// <reference types="react" resolution-mode="require"/>
|
17
|
+
import { editor as monacoEditorAPI } from 'monaco-editor';
|
18
|
+
import { type CODE_EDITOR_LANGUAGE } from '@finos/legend-application';
|
19
|
+
export declare const CodeEditor: React.FC<{
|
20
|
+
inputValue: string;
|
21
|
+
isReadOnly?: boolean | undefined;
|
22
|
+
language: CODE_EDITOR_LANGUAGE;
|
23
|
+
showMiniMap?: boolean | undefined;
|
24
|
+
hideGutter?: boolean | undefined;
|
25
|
+
extraEditorOptions?: (monacoEditorAPI.IEditorOptions & monacoEditorAPI.IGlobalEditorOptions) | undefined;
|
26
|
+
updateInput?: ((val: string) => void) | undefined;
|
27
|
+
}>;
|
28
|
+
//# sourceMappingURL=CodeEditor.d.ts.map
|
@@ -0,0 +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;AAS5E,OAAO,EACL,KAAK,oBAAoB,EAI1B,MAAM,2BAA2B,CAAC;AAEnC,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACjC,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,WAAW,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAClC,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACjC,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,CAiHA,CAAC"}
|
@@ -0,0 +1,109 @@
|
|
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 { useState, useRef, useEffect } from 'react';
|
18
|
+
import { editor as monacoEditorAPI } from 'monaco-editor';
|
19
|
+
import { disposeCodeEditor, getBaseCodeEditorOptions, resetLineNumberGutterWidth, getCodeEditorValue, normalizeLineEnding, } from './CodeEditorUtils.js';
|
20
|
+
import { useResizeDetector } from '@finos/legend-art';
|
21
|
+
import { CODE_EDITOR_THEME, TAB_SIZE, useApplicationStore, } from '@finos/legend-application';
|
22
|
+
export const CodeEditor = (props) => {
|
23
|
+
const { inputValue, updateInput, language, isReadOnly, showMiniMap, hideGutter, extraEditorOptions, } = props;
|
24
|
+
const applicationStore = useApplicationStore();
|
25
|
+
const [editor, setEditor] = useState();
|
26
|
+
const onDidChangeModelContentEventDisposer = useRef(undefined);
|
27
|
+
/**
|
28
|
+
* NOTE: we want to normalize line ending here since if the original
|
29
|
+
* input value includes CR '\r' character, it will get normalized, calling
|
30
|
+
* the updateInput method and cause a rerender. With the way we setup
|
31
|
+
* `onChange` method, React will warn about `setState` being called in
|
32
|
+
* `render` method.
|
33
|
+
* See https://github.com/finos/legend-studio/issues/608
|
34
|
+
*/
|
35
|
+
const value = normalizeLineEnding(inputValue);
|
36
|
+
const textInputRef = useRef(null);
|
37
|
+
const { ref, width, height } = useResizeDetector();
|
38
|
+
useEffect(() => {
|
39
|
+
if (width !== undefined && height !== undefined) {
|
40
|
+
editor?.layout({ width, height });
|
41
|
+
}
|
42
|
+
}, [editor, width, height]);
|
43
|
+
useEffect(() => {
|
44
|
+
if (!editor && textInputRef.current) {
|
45
|
+
const element = textInputRef.current;
|
46
|
+
const _editor = monacoEditorAPI.create(element, {
|
47
|
+
...getBaseCodeEditorOptions(),
|
48
|
+
theme: applicationStore.layoutService
|
49
|
+
.TEMPORARY__isLightColorThemeEnabled
|
50
|
+
? CODE_EDITOR_THEME.TEMPORARY__VSCODE_LIGHT
|
51
|
+
: CODE_EDITOR_THEME.LEGEND,
|
52
|
+
formatOnType: true,
|
53
|
+
formatOnPaste: true,
|
54
|
+
});
|
55
|
+
setEditor(_editor);
|
56
|
+
}
|
57
|
+
}, [applicationStore, editor]);
|
58
|
+
useEffect(() => {
|
59
|
+
if (editor) {
|
60
|
+
resetLineNumberGutterWidth(editor);
|
61
|
+
const model = editor.getModel();
|
62
|
+
if (model) {
|
63
|
+
monacoEditorAPI.setModelLanguage(model, language);
|
64
|
+
}
|
65
|
+
}
|
66
|
+
}, [editor, language]);
|
67
|
+
if (editor) {
|
68
|
+
// dispose the old editor content setter in case the `updateInput` handler changes
|
69
|
+
// for a more extensive note on this, see `LambdaEditor`
|
70
|
+
onDidChangeModelContentEventDisposer.current?.dispose();
|
71
|
+
onDidChangeModelContentEventDisposer.current =
|
72
|
+
editor.onDidChangeModelContent(() => {
|
73
|
+
const currentVal = getCodeEditorValue(editor);
|
74
|
+
if (currentVal !== value) {
|
75
|
+
updateInput?.(currentVal);
|
76
|
+
}
|
77
|
+
});
|
78
|
+
// Set the text value and editor options
|
79
|
+
const currentValue = getCodeEditorValue(editor);
|
80
|
+
if (currentValue !== value) {
|
81
|
+
editor.setValue(value);
|
82
|
+
}
|
83
|
+
editor.updateOptions({
|
84
|
+
readOnly: Boolean(isReadOnly),
|
85
|
+
minimap: { enabled: Boolean(showMiniMap) },
|
86
|
+
// Hide the line number gutter
|
87
|
+
// See https://github.com/microsoft/vscode/issues/30795
|
88
|
+
...(hideGutter
|
89
|
+
? {
|
90
|
+
glyphMargin: false,
|
91
|
+
folding: false,
|
92
|
+
lineNumbers: 'off',
|
93
|
+
lineDecorationsWidth: 10,
|
94
|
+
lineNumbersMinChars: 0,
|
95
|
+
}
|
96
|
+
: {}),
|
97
|
+
...(extraEditorOptions ?? {}),
|
98
|
+
});
|
99
|
+
const model = editor.getModel();
|
100
|
+
model?.updateOptions({ tabSize: TAB_SIZE });
|
101
|
+
}
|
102
|
+
useEffect(() => () => {
|
103
|
+
if (editor) {
|
104
|
+
disposeCodeEditor(editor);
|
105
|
+
}
|
106
|
+
}, [editor]); // dispose editor
|
107
|
+
return (_jsx("div", { ref: ref, className: "code-editor__container", children: _jsx("div", { className: "code-editor__body", ref: textInputRef }) }));
|
108
|
+
};
|
109
|
+
//# sourceMappingURL=CodeEditor.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"CodeEditor.js","sourceRoot":"","sources":["../../src/code-editor/CodeEditor.tsx"],"names":[],"mappings":";AAAA;;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,IAAI,YAAY,KAAK,KAAK,EAAE;YAC1B,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;SACxB;QACD,MAAM,CAAC,aAAa,CAAC;YACnB,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC;YAC7B,OAAO,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,WAAW,CAAC,EAAE;YAC1C,8BAA8B;YAC9B,uDAAuD;YACvD,GAAG,CAAC,UAAU;gBACZ,CAAC,CAAC;oBACE,WAAW,EAAE,KAAK;oBAClB,OAAO,EAAE,KAAK;oBACd,WAAW,EAAE,KAAK;oBAClB,oBAAoB,EAAE,EAAE;oBACxB,mBAAmB,EAAE,CAAC;iBACvB;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,QAAQ,EAAE,CAAC,CAAC;KAC7C;IAED,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,CAAC,iBAAiB;IAEpB,OAAO,CACL,cAAK,GAAG,EAAE,GAAG,EAAE,SAAS,EAAC,wBAAwB,YAC/C,cAAK,SAAS,EAAC,mBAAmB,EAAC,GAAG,EAAE,YAAY,GAAI,GACpD,CACP,CAAC;AACJ,CAAC,CAAC"}
|
@@ -0,0 +1,61 @@
|
|
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 { editor as monacoEditorAPI } from 'monaco-editor';
|
17
|
+
export type CodeEditorPosition = {
|
18
|
+
lineNumber: number;
|
19
|
+
column: number;
|
20
|
+
};
|
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;
|
26
|
+
export declare const disposeDiffCodeEditor: (editor: monacoEditorAPI.IStandaloneDiffEditor) => void;
|
27
|
+
/**
|
28
|
+
* Get the text value with LF line ending.
|
29
|
+
* This is needed since if there are CR `\r` characters in the text input
|
30
|
+
* (e.g. users of Windows doing copy/paste)
|
31
|
+
* the default mode of `monaco-editor` is `TextDefined` which means if the text
|
32
|
+
* contains CR character(s), it will automatically be treated as CRLF. As such, we want
|
33
|
+
* an utility method to extract the text value with line ending option LF
|
34
|
+
* to force omission of CR characters
|
35
|
+
* See https://github.com/finos/legend-studio/issues/608
|
36
|
+
*/
|
37
|
+
export declare const getCodeEditorValue: (editor: monacoEditorAPI.IStandaloneCodeEditor) => string;
|
38
|
+
export declare const getBaseCodeEditorOptions: () => monacoEditorAPI.IStandaloneEditorConstructionOptions;
|
39
|
+
export declare const getBaseConsoleOptions: () => monacoEditorAPI.IStandaloneEditorConstructionOptions;
|
40
|
+
export declare const moveCursorToPosition: (editor: monacoEditorAPI.ICodeEditor, position: CodeEditorPosition) => void;
|
41
|
+
export declare const setErrorMarkers: (editorModel: monacoEditorAPI.ITextModel, errors: {
|
42
|
+
message: string;
|
43
|
+
startLineNumber: number;
|
44
|
+
startColumn: number;
|
45
|
+
endLineNumber: number;
|
46
|
+
endColumn: number;
|
47
|
+
}[], ownerId?: string) => void;
|
48
|
+
export declare const setWarningMarkers: (editorModel: monacoEditorAPI.ITextModel, warnings: {
|
49
|
+
message: string;
|
50
|
+
startLineNumber: number;
|
51
|
+
startColumn: number;
|
52
|
+
endLineNumber: number;
|
53
|
+
endColumn: number;
|
54
|
+
}[], ownerId?: string) => void;
|
55
|
+
export declare const clearMarkers: (ownerId?: string) => void;
|
56
|
+
/**
|
57
|
+
* This method eliminates CR '\r' character(s) in the provided text value.
|
58
|
+
*/
|
59
|
+
export declare const normalizeLineEnding: (val: string) => string;
|
60
|
+
export declare const resetLineNumberGutterWidth: (editor: monacoEditorAPI.ICodeEditor) => void;
|
61
|
+
//# sourceMappingURL=CodeEditorUtils.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"CodeEditorUtils.d.ts","sourceRoot":"","sources":["../../src/code-editor/CodeEditorUtils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,MAAM,IAAI,eAAe,EAAkB,MAAM,eAAe,CAAC;AAE1E,MAAM,MAAM,kBAAkB,GAAG;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,WACpB,gBAAgB,qBAAqB,KAC5C,IAIF,CAAC;AAEF,eAAO,MAAM,qBAAqB,WACxB,gBAAgB,qBAAqB,KAC5C,IAIF,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,kBAAkB,WACrB,gBAAgB,qBAAqB,KAC5C,MACwE,CAAC;AAE5E,eAAO,MAAM,wBAAwB,QAC/B,gBAAgB,oCAyBwC,CAAC;AAE/D,eAAO,MAAM,qBAAqB,QAC5B,gBAAgB,oCAqBlB,CAAC;AAEL,eAAO,MAAM,oBAAoB,WACvB,gBAAgB,WAAW,YACzB,kBAAkB,KAC3B,IAMF,CAAC;AAIF,eAAO,MAAM,eAAe,gBACb,gBAAgB,UAAU,UAC/B;IACN,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;CACnB,EAAE,YACO,MAAM,KACf,IAcF,CAAC;AAEF,eAAO,MAAM,iBAAiB,gBACf,gBAAgB,UAAU,YAC7B;IACR,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;CACnB,EAAE,YACO,MAAM,KACf,IAcF,CAAC;AAEF,eAAO,MAAM,YAAY,aAAc,MAAM,KAAG,IAI/C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,QAAS,MAAM,KAAG,MAC1B,CAAC;AAKzB,eAAO,MAAM,0BAA0B,WAC7B,gBAAgB,WAAW,KAClC,IAQF,CAAC"}
|
@@ -0,0 +1,134 @@
|
|
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 { editor as monacoEditorAPI, MarkerSeverity } from 'monaco-editor';
|
17
|
+
/**
|
18
|
+
* Normally `monaco-editor` worker disposes after 5 minutes staying idle, but we fasten
|
19
|
+
* this pace just in case the usage of the editor causes memory-leak somehow
|
20
|
+
*/
|
21
|
+
export const disposeCodeEditor = (editor) => {
|
22
|
+
editor.dispose();
|
23
|
+
// NOTE: just to be sure, we dispose the model after disposing the editor
|
24
|
+
editor.getModel()?.dispose();
|
25
|
+
};
|
26
|
+
export const disposeDiffCodeEditor = (editor) => {
|
27
|
+
editor.dispose();
|
28
|
+
editor.getOriginalEditor().getModel()?.dispose();
|
29
|
+
editor.getModifiedEditor().getModel()?.dispose();
|
30
|
+
};
|
31
|
+
/**
|
32
|
+
* Get the text value with LF line ending.
|
33
|
+
* This is needed since if there are CR `\r` characters in the text input
|
34
|
+
* (e.g. users of Windows doing copy/paste)
|
35
|
+
* the default mode of `monaco-editor` is `TextDefined` which means if the text
|
36
|
+
* contains CR character(s), it will automatically be treated as CRLF. As such, we want
|
37
|
+
* an utility method to extract the text value with line ending option LF
|
38
|
+
* to force omission of CR characters
|
39
|
+
* See https://github.com/finos/legend-studio/issues/608
|
40
|
+
*/
|
41
|
+
export const getCodeEditorValue = (editor) => editor.getModel()?.getValue(monacoEditorAPI.EndOfLinePreference.LF) ?? '';
|
42
|
+
export const getBaseCodeEditorOptions = () => ({
|
43
|
+
contextmenu: false,
|
44
|
+
copyWithSyntaxHighlighting: false,
|
45
|
+
// NOTE: These following font options are needed (and CSS font-size option `.monaco-editor * { font-size: ... }` as well)
|
46
|
+
// in order to make the editor appear properly on multiple platform, the ligatures option is needed for Mac to display properly
|
47
|
+
// otherwise the cursor position relatively to text would be off
|
48
|
+
// Another potential cause for this misaligment is that the fonts are being lazy-loaded and made available after `monaco-editor`
|
49
|
+
// calculated the font-width, for this, we can use `remeasureFonts`, but our case here, `fontLigatures: true` seems
|
50
|
+
// to do the trick
|
51
|
+
// See https://github.com/microsoft/monaco-editor/issues/392
|
52
|
+
fontSize: 14,
|
53
|
+
// Enforce a fixed font-family to make cross platform display consistent (i.e. Mac defaults to use `Menlo` which is bigger than
|
54
|
+
// `Consolas` on Windows, etc.)
|
55
|
+
fontFamily: 'Roboto Mono',
|
56
|
+
// Enable font ligature: glyphs which combine the shapes of certain sequences of characters into a new form that makes for
|
57
|
+
// a more harmonious reading experience.
|
58
|
+
fontLigatures: true,
|
59
|
+
// Make sure hover or widget shown near boundary are not truncated by setting their position to `fixed`
|
60
|
+
fixedOverflowWidgets: true,
|
61
|
+
detectIndentation: false,
|
62
|
+
tabSize: 2,
|
63
|
+
// The typing is currently not correct for `bracketPairColorization`, until this is fixed, we will remove the cast
|
64
|
+
// See https://github.com/microsoft/monaco-editor/issues/3013
|
65
|
+
'bracketPairColorization.enabled': false,
|
66
|
+
});
|
67
|
+
export const getBaseConsoleOptions = () => ({
|
68
|
+
...getBaseCodeEditorOptions(),
|
69
|
+
fontSize: 12,
|
70
|
+
extraEditorClassName: 'monaco-editor--small-font',
|
71
|
+
readOnly: true,
|
72
|
+
glyphMargin: false,
|
73
|
+
folding: false,
|
74
|
+
lineNumbers: 'off',
|
75
|
+
lineDecorationsWidth: 10,
|
76
|
+
lineNumbersMinChars: 0,
|
77
|
+
minimap: {
|
78
|
+
enabled: false,
|
79
|
+
},
|
80
|
+
guides: {
|
81
|
+
bracketPairs: false,
|
82
|
+
bracketPairsHorizontal: false,
|
83
|
+
highlightActiveBracketPair: false,
|
84
|
+
indentation: false,
|
85
|
+
highlightActiveIndentation: false,
|
86
|
+
},
|
87
|
+
renderLineHighlight: 'none',
|
88
|
+
});
|
89
|
+
export const moveCursorToPosition = (editor, position) => {
|
90
|
+
if (!editor.hasTextFocus()) {
|
91
|
+
editor.focus();
|
92
|
+
} // focus the editor first so that it can shows the cursor
|
93
|
+
editor.revealPositionInCenter(position, 0);
|
94
|
+
editor.setPosition(position);
|
95
|
+
};
|
96
|
+
const INTERNAL__DUMMY_PROBLEM_MARKER_OWNER = 'dummy_problem_marker_owner';
|
97
|
+
export const setErrorMarkers = (editorModel, errors, ownerId) => {
|
98
|
+
monacoEditorAPI.setModelMarkers(editorModel, ownerId ?? INTERNAL__DUMMY_PROBLEM_MARKER_OWNER, errors.map((error) => ({
|
99
|
+
startLineNumber: error.startLineNumber,
|
100
|
+
startColumn: error.startColumn,
|
101
|
+
endLineNumber: error.endLineNumber,
|
102
|
+
endColumn: error.endColumn + 1,
|
103
|
+
// NOTE: when the message is empty, no error tooltip is shown, we want to avoid this
|
104
|
+
message: error.message === '' ? '(no error message)' : error.message,
|
105
|
+
severity: MarkerSeverity.Error,
|
106
|
+
})));
|
107
|
+
};
|
108
|
+
export const setWarningMarkers = (editorModel, warnings, ownerId) => {
|
109
|
+
monacoEditorAPI.setModelMarkers(editorModel, ownerId ?? INTERNAL__DUMMY_PROBLEM_MARKER_OWNER, warnings.map((warning) => ({
|
110
|
+
startLineNumber: warning.startLineNumber,
|
111
|
+
startColumn: warning.startColumn,
|
112
|
+
endColumn: warning.endColumn,
|
113
|
+
endLineNumber: warning.endLineNumber,
|
114
|
+
message: warning.message === '' ? '(no warning message)' : warning.message,
|
115
|
+
severity: MarkerSeverity.Warning,
|
116
|
+
})));
|
117
|
+
};
|
118
|
+
export const clearMarkers = (ownerId) => {
|
119
|
+
monacoEditorAPI.removeAllMarkers(ownerId ?? INTERNAL__DUMMY_PROBLEM_MARKER_OWNER);
|
120
|
+
};
|
121
|
+
/**
|
122
|
+
* This method eliminates CR '\r' character(s) in the provided text value.
|
123
|
+
*/
|
124
|
+
export const normalizeLineEnding = (val) => val.replace(/\r/g, '');
|
125
|
+
// We need to dynamically adjust the width of the line number gutter, otherwise as the document gets
|
126
|
+
// larger, the left margin will start to shrink
|
127
|
+
// See https://github.com/microsoft/monaco-editor/issues/2206
|
128
|
+
export const resetLineNumberGutterWidth = (editor) => {
|
129
|
+
const currentValue = editor.getValue();
|
130
|
+
editor.updateOptions({
|
131
|
+
lineNumbersMinChars: Math.max(Math.floor(Math.log10(currentValue.split(/\r\n|\r|\n/g).length)) + 3, 5),
|
132
|
+
});
|
133
|
+
};
|
134
|
+
//# sourceMappingURL=CodeEditorUtils.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"CodeEditorUtils.js","sourceRoot":"","sources":["../../src/code-editor/CodeEditorUtils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAO1E;;;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,kBAAkB,GAAG,CAChC,MAA6C,EACrC,EAAE,CACV,MAAM,CAAC,QAAQ,EAAE,EAAE,QAAQ,CAAC,eAAe,CAAC,mBAAmB,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC;AAE5E,MAAM,CAAC,MAAM,wBAAwB,GACnC,GAAyD,EAAE,CACzD,CAAC;IACC,WAAW,EAAE,KAAK;IAClB,0BAA0B,EAAE,KAAK;IACjC,yHAAyH;IACzH,+HAA+H;IAC/H,gEAAgE;IAChE,gIAAgI;IAChI,mHAAmH;IACnH,kBAAkB;IAClB,4DAA4D;IAC5D,QAAQ,EAAE,EAAE;IACZ,+HAA+H;IAC/H,+BAA+B;IAC/B,UAAU,EAAE,aAAa;IACzB,0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U,EAAE,CACzD,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AAEzB,oGAAoG;AACpG,+CAA+C;AAC/C,6DAA6D;AAC7D,MAAM,CAAC,MAAM,0BAA0B,GAAG,CACxC,MAAmC,EAC7B,EAAE;IACR,MAAM,YAAY,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC;IACvC,MAAM,CAAC,aAAa,CAAC;QACnB,mBAAmB,EAAE,IAAI,CAAC,GAAG,CAC3B,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,EACpE,CAAC,CACF;KACF,CAAC,CAAC;AACL,CAAC,CAAC"}
|
@@ -0,0 +1,18 @@
|
|
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 * from './CodeEditor.js';
|
17
|
+
export * from './CodeEditorUtils.js';
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/code-editor/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC"}
|
@@ -0,0 +1,18 @@
|
|
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 * from './CodeEditor.js';
|
17
|
+
export * from './CodeEditorUtils.js';
|
18
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/code-editor/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC"}
|
@@ -0,0 +1,17 @@
|
|
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 { MockedMonacoEditorKeyCode as KeyCode, MockedMonacoEditorMarkerSeverity as MarkerSeverity, MockedMonacoEditorModel as MOCK__MonacoEditorModel, MockedMonacoEditorInstance as MOCK__MonacoEditorInstance, MockedMonacoEditorAPI as editor, MockedMonacoEditorLanguagesAPI as languages, } from './MonacoEditorMockUtils.js';
|
17
|
+
//# sourceMappingURL=MockedMonacoEditor.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"MockedMonacoEditor.d.ts","sourceRoot":"","sources":["../../../src/code-editor/testing/MockedMonacoEditor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,yBAAyB,IAAI,OAAO,EACpC,gCAAgC,IAAI,cAAc,EAClD,uBAAuB,IAAI,uBAAuB,EAClD,0BAA0B,IAAI,0BAA0B,EACxD,qBAAqB,IAAI,MAAM,EAC/B,8BAA8B,IAAI,SAAS,GAC5C,MAAM,4BAA4B,CAAC"}
|
@@ -0,0 +1,17 @@
|
|
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 { MockedMonacoEditorKeyCode as KeyCode, MockedMonacoEditorMarkerSeverity as MarkerSeverity, MockedMonacoEditorModel as MOCK__MonacoEditorModel, MockedMonacoEditorInstance as MOCK__MonacoEditorInstance, MockedMonacoEditorAPI as editor, MockedMonacoEditorLanguagesAPI as languages, } from './MonacoEditorMockUtils.js';
|
17
|
+
//# sourceMappingURL=MockedMonacoEditor.js.map
|