@finos/legend-lego 0.1.4 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/application/DocumentationLink.d.ts +27 -0
- package/lib/application/DocumentationLink.d.ts.map +1 -0
- package/lib/application/DocumentationLink.js +45 -0
- package/lib/application/DocumentationLink.js.map +1 -0
- package/lib/application/FuzzySearchAdvancedConfigMenu.d.ts +23 -0
- package/lib/application/FuzzySearchAdvancedConfigMenu.d.ts.map +1 -0
- package/lib/application/FuzzySearchAdvancedConfigMenu.js +35 -0
- package/lib/application/FuzzySearchAdvancedConfigMenu.js.map +1 -0
- package/lib/application/TabManager.d.ts +24 -0
- package/lib/application/TabManager.d.ts.map +1 -0
- package/lib/application/TabManager.js +117 -0
- package/lib/application/TabManager.js.map +1 -0
- package/lib/application/TabManagerState.d.ts +40 -0
- package/lib/application/TabManagerState.d.ts.map +1 -0
- package/lib/application/TabManagerState.js +93 -0
- package/lib/application/TabManagerState.js.map +1 -0
- package/lib/application/index.d.ts +20 -0
- package/lib/application/index.d.ts.map +1 -0
- package/lib/application/index.js +20 -0
- package/lib/application/index.js.map +1 -0
- package/lib/code-editor/CodeDiffView.d.ts +35 -0
- package/lib/code-editor/CodeDiffView.d.ts.map +1 -0
- package/lib/code-editor/CodeDiffView.js +78 -0
- package/lib/code-editor/CodeDiffView.js.map +1 -0
- package/lib/code-editor/CodeEditor.d.ts +1 -1
- package/lib/code-editor/CodeEditor.d.ts.map +1 -1
- package/lib/code-editor/CodeEditor.js +5 -3
- package/lib/code-editor/CodeEditor.js.map +1 -1
- package/lib/code-editor/CodeEditorConfig.d.ts +31 -0
- package/lib/code-editor/CodeEditorConfig.d.ts.map +1 -0
- package/lib/code-editor/CodeEditorConfig.js +33 -0
- package/lib/code-editor/CodeEditorConfig.js.map +1 -0
- package/lib/code-editor/CodeEditorUtils.d.ts +2 -0
- package/lib/code-editor/CodeEditorUtils.d.ts.map +1 -1
- package/lib/code-editor/CodeEditorUtils.js +46 -1
- package/lib/code-editor/CodeEditorUtils.js.map +1 -1
- package/lib/code-editor/PureLanguageCodeEditorSupport.d.ts +70 -0
- package/lib/code-editor/PureLanguageCodeEditorSupport.d.ts.map +1 -0
- package/lib/code-editor/PureLanguageCodeEditorSupport.js +237 -0
- package/lib/code-editor/PureLanguageCodeEditorSupport.js.map +1 -0
- package/lib/code-editor/PureLanguageService.d.ts +42 -0
- package/lib/code-editor/PureLanguageService.d.ts.map +1 -0
- package/lib/code-editor/PureLanguageService.js +437 -0
- package/lib/code-editor/PureLanguageService.js.map +1 -0
- package/lib/code-editor/__test-utils__/MockedMonacoEditor.d.ts.map +1 -0
- package/lib/code-editor/__test-utils__/MockedMonacoEditor.js.map +1 -0
- package/lib/code-editor/__test-utils__/MonacoEditorMockUtils.d.ts.map +1 -0
- package/lib/code-editor/{testing → __test-utils__}/MonacoEditorMockUtils.js +1 -1
- package/lib/code-editor/__test-utils__/MonacoEditorMockUtils.js.map +1 -0
- package/lib/code-editor/__test__.d.ts +17 -0
- package/lib/code-editor/__test__.d.ts.map +1 -0
- package/lib/code-editor/{testing/index.js → __test__.js} +2 -2
- package/lib/code-editor/__test__.js.map +1 -0
- package/lib/code-editor/index.d.ts +4 -0
- package/lib/code-editor/index.d.ts.map +1 -1
- package/lib/code-editor/index.js +4 -0
- package/lib/code-editor/index.js.map +1 -1
- package/lib/graph-editor/ElementIconUtils.d.ts +18 -0
- package/lib/graph-editor/ElementIconUtils.d.ts.map +1 -0
- package/lib/graph-editor/ElementIconUtils.js +37 -0
- package/lib/graph-editor/ElementIconUtils.js.map +1 -0
- package/lib/graph-editor/PackageableElementOption.d.ts +25 -0
- package/lib/graph-editor/PackageableElementOption.d.ts.map +1 -0
- package/lib/graph-editor/PackageableElementOption.js +46 -0
- package/lib/graph-editor/PackageableElementOption.js.map +1 -0
- package/lib/graph-editor/index.d.ts +18 -0
- package/lib/graph-editor/index.d.ts.map +1 -0
- package/lib/graph-editor/index.js +18 -0
- package/lib/graph-editor/index.js.map +1 -0
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/package.json +14 -9
- package/src/application/DocumentationLink.tsx +82 -0
- package/src/application/FuzzySearchAdvancedConfigMenu.tsx +66 -0
- package/src/application/TabManager.tsx +285 -0
- package/src/application/TabManagerState.ts +124 -0
- package/src/application/index.ts +22 -0
- package/src/code-editor/CodeDiffView.tsx +128 -0
- package/src/code-editor/CodeEditor.tsx +8 -5
- package/src/code-editor/CodeEditorConfig.ts +32 -0
- package/src/code-editor/CodeEditorUtils.ts +76 -1
- package/src/code-editor/PureLanguageCodeEditorSupport.ts +338 -0
- package/src/code-editor/PureLanguageService.ts +501 -0
- package/src/code-editor/{testing → __test-utils__}/MonacoEditorMockUtils.tsx +1 -1
- package/src/code-editor/{testing/index.ts → __test__.ts} +1 -1
- package/src/code-editor/index.ts +8 -0
- package/src/graph-editor/ElementIconUtils.tsx +47 -0
- package/src/graph-editor/PackageableElementOption.tsx +86 -0
- package/{lib/code-editor/testing/index.d.ts → src/graph-editor/index.ts} +3 -2
- package/tsconfig.json +16 -4
- package/lib/code-editor/testing/MockedMonacoEditor.d.ts.map +0 -1
- package/lib/code-editor/testing/MockedMonacoEditor.js.map +0 -1
- package/lib/code-editor/testing/MonacoEditorMockUtils.d.ts.map +0 -1
- package/lib/code-editor/testing/MonacoEditorMockUtils.js.map +0 -1
- package/lib/code-editor/testing/index.d.ts.map +0 -1
- package/lib/code-editor/testing/index.js.map +0 -1
- /package/lib/code-editor/{testing → __test-utils__}/MockedMonacoEditor.d.ts +0 -0
- /package/lib/code-editor/{testing → __test-utils__}/MockedMonacoEditor.js +0 -0
- /package/lib/code-editor/{testing → __test-utils__}/MonacoEditorMockUtils.d.ts +0 -0
- /package/src/code-editor/{testing → __test-utils__}/MockedMonacoEditor.ts +0 -0
@@ -0,0 +1,437 @@
|
|
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
|
+
/* eslint-disable prefer-named-capture-group */
|
17
|
+
import { PARSER_SECTION_MARKER, PURE_ELEMENT_NAME, PURE_CONNECTION_NAME, PURE_PARSER, } from '@finos/legend-graph';
|
18
|
+
import { editor as monacoEditorAPI, languages as monacoLanguagesAPI, } from 'monaco-editor';
|
19
|
+
import { CODE_EDITOR_LANGUAGE, CODE_EDITOR_THEME } from './CodeEditorConfig.js';
|
20
|
+
/**
|
21
|
+
* The postfix to be added to all token types, i.e. identifier.pure, number.pure, etc.
|
22
|
+
*/
|
23
|
+
const PURE_GRAMMAR_TOKEN_POSTFIX = '.pure';
|
24
|
+
export var PURE_GRAMMAR_TOKEN;
|
25
|
+
(function (PURE_GRAMMAR_TOKEN) {
|
26
|
+
PURE_GRAMMAR_TOKEN["WHITESPACE"] = "";
|
27
|
+
PURE_GRAMMAR_TOKEN["KEYWORD"] = "keyword";
|
28
|
+
PURE_GRAMMAR_TOKEN["IDENTIFIER"] = "identifier";
|
29
|
+
PURE_GRAMMAR_TOKEN["OPERATOR"] = "operator";
|
30
|
+
PURE_GRAMMAR_TOKEN["DELIMITER"] = "delimiter";
|
31
|
+
PURE_GRAMMAR_TOKEN["PARSER"] = "parser";
|
32
|
+
PURE_GRAMMAR_TOKEN["NUMBER"] = "number";
|
33
|
+
PURE_GRAMMAR_TOKEN["DATE"] = "date";
|
34
|
+
PURE_GRAMMAR_TOKEN["COLOR"] = "color";
|
35
|
+
PURE_GRAMMAR_TOKEN["PACKAGE"] = "package";
|
36
|
+
PURE_GRAMMAR_TOKEN["STRING"] = "string";
|
37
|
+
PURE_GRAMMAR_TOKEN["COMMENT"] = "comment";
|
38
|
+
PURE_GRAMMAR_TOKEN["LANGUAGE_STRUCT"] = "language-struct";
|
39
|
+
PURE_GRAMMAR_TOKEN["MULTIPLICITY"] = "multiplicity";
|
40
|
+
PURE_GRAMMAR_TOKEN["GENERICS"] = "generics";
|
41
|
+
PURE_GRAMMAR_TOKEN["PROPERTY"] = "property";
|
42
|
+
PURE_GRAMMAR_TOKEN["PARAMETER"] = "property";
|
43
|
+
PURE_GRAMMAR_TOKEN["VARIABLE"] = "variable";
|
44
|
+
PURE_GRAMMAR_TOKEN["TYPE"] = "type";
|
45
|
+
PURE_GRAMMAR_TOKEN["INVALID"] = "invalid";
|
46
|
+
})(PURE_GRAMMAR_TOKEN = PURE_GRAMMAR_TOKEN || (PURE_GRAMMAR_TOKEN = {}));
|
47
|
+
const theme = {
|
48
|
+
base: 'vs-dark',
|
49
|
+
inherit: true,
|
50
|
+
colors: {},
|
51
|
+
rules: [
|
52
|
+
// NOTE: unfortunately, `monaco-editor` only accepts HEX values, not CSS variables
|
53
|
+
{ token: PURE_GRAMMAR_TOKEN.IDENTIFIER, foreground: 'dcdcaa' },
|
54
|
+
{ token: PURE_GRAMMAR_TOKEN.NUMBER, foreground: 'b5cea8' },
|
55
|
+
{ token: PURE_GRAMMAR_TOKEN.DATE, foreground: 'b5cea8' },
|
56
|
+
{ token: PURE_GRAMMAR_TOKEN.COLOR, foreground: 'b5cea8' },
|
57
|
+
{ token: PURE_GRAMMAR_TOKEN.PACKAGE, foreground: '808080' },
|
58
|
+
{ token: PURE_GRAMMAR_TOKEN.PARSER, foreground: 'c586c0' },
|
59
|
+
{ token: PURE_GRAMMAR_TOKEN.LANGUAGE_STRUCT, foreground: 'c586c0' },
|
60
|
+
{ token: PURE_GRAMMAR_TOKEN.MULTIPLICITY, foreground: '2d796b' },
|
61
|
+
{ token: PURE_GRAMMAR_TOKEN.GENERICS, foreground: '2d796b' },
|
62
|
+
{ token: PURE_GRAMMAR_TOKEN.PROPERTY, foreground: '9cdcfe' },
|
63
|
+
{ token: PURE_GRAMMAR_TOKEN.PARAMETER, foreground: '9cdcfe' },
|
64
|
+
{ token: PURE_GRAMMAR_TOKEN.VARIABLE, foreground: '4fc1ff' },
|
65
|
+
{ token: PURE_GRAMMAR_TOKEN.TYPE, foreground: '3dc9b0' },
|
66
|
+
{ token: `${PURE_GRAMMAR_TOKEN.STRING}.escape`, foreground: 'd7ba7d' },
|
67
|
+
],
|
68
|
+
};
|
69
|
+
// Taken from `monaco-languages` configuration for Java in order to do propert brace matching
|
70
|
+
// See https://github.com/microsoft/monaco-languages/blob/master/src/java/java.ts
|
71
|
+
const configuration = {
|
72
|
+
// NOTE: Pure identifier includes $ but not in the first position (as that is parsed as a variable)
|
73
|
+
wordPattern: /(-?\d*\.\d\w*)|([^`~!@#%^$&*()\-=+[{\]}\\|;:'",.<>/?\s][^`~!@#%^&*()\-=+[{\]}\\|;:'",.<>/?\s]*)/,
|
74
|
+
comments: {
|
75
|
+
lineComment: '//',
|
76
|
+
blockComment: ['/*', '*/'],
|
77
|
+
},
|
78
|
+
brackets: [
|
79
|
+
['{', '}'],
|
80
|
+
['[', ']'],
|
81
|
+
['(', ')'],
|
82
|
+
],
|
83
|
+
autoClosingPairs: [
|
84
|
+
{ open: '{', close: '}' },
|
85
|
+
{ open: '[', close: ']' },
|
86
|
+
{ open: '(', close: ')' },
|
87
|
+
{ open: '"', close: '"' },
|
88
|
+
{ open: "'", close: "'" },
|
89
|
+
],
|
90
|
+
surroundingPairs: [
|
91
|
+
{ open: '{', close: '}' },
|
92
|
+
{ open: '[', close: ']' },
|
93
|
+
{ open: '(', close: ')' },
|
94
|
+
{ open: '"', close: '"' },
|
95
|
+
{ open: "'", close: "'" },
|
96
|
+
{ open: '<', close: '>' },
|
97
|
+
{ open: '<<', close: '>>' },
|
98
|
+
],
|
99
|
+
folding: {
|
100
|
+
markers: {
|
101
|
+
start: new RegExp('^\\s*//\\s*(?:(?:#?region\\b)|(?:<editor-fold\\b))'),
|
102
|
+
end: new RegExp('^\\s*//\\s*(?:(?:#?endregion\\b)|(?:</editor-fold>))'),
|
103
|
+
},
|
104
|
+
},
|
105
|
+
};
|
106
|
+
/**
|
107
|
+
* Create new monarch definition to support syntax-highlighting
|
108
|
+
* See https://microsoft.github.io/monaco-editor/monarch.html
|
109
|
+
*
|
110
|
+
* The way SQL monarch definition is organized is good and worth learning from
|
111
|
+
* See https://github.com/microsoft/monaco-languages/blob/master/src/sql/sql.ts
|
112
|
+
*
|
113
|
+
* NOTE: using `monarch` only allows fairly very basic syntax-highlighting
|
114
|
+
* to actually do full AST analysis, we might need something more serious like
|
115
|
+
* using TextMate grammar which is used by VSCode itself
|
116
|
+
* See https://github.com/microsoft/monaco-editor#faq
|
117
|
+
* See https://code.visualstudio.com/api/language-extensions/syntax-highlight-guide
|
118
|
+
*/
|
119
|
+
const generateLanguageMonarch = (extraKeywords, extraParsers) =>
|
120
|
+
// TODO: complete syntax-highlighter for core features like constraint, derived properties, etc.
|
121
|
+
// TODO: add syntax highlighting for modules/plugins (come up with a plugin mechanism to do this).
|
122
|
+
({
|
123
|
+
defaultToken: 'invalid',
|
124
|
+
tokenPostfix: PURE_GRAMMAR_TOKEN_POSTFIX,
|
125
|
+
keywords: [
|
126
|
+
...extraKeywords,
|
127
|
+
// relational
|
128
|
+
'Schema',
|
129
|
+
'Table',
|
130
|
+
'Join',
|
131
|
+
'View',
|
132
|
+
'primaryKey',
|
133
|
+
'groupBy',
|
134
|
+
'mainTable',
|
135
|
+
// native
|
136
|
+
'let',
|
137
|
+
'extends',
|
138
|
+
'true',
|
139
|
+
'false',
|
140
|
+
'projects',
|
141
|
+
// elements
|
142
|
+
PURE_ELEMENT_NAME.CLASS,
|
143
|
+
PURE_ELEMENT_NAME.ASSOCIATION,
|
144
|
+
PURE_ELEMENT_NAME.ENUMERATION,
|
145
|
+
PURE_ELEMENT_NAME.MEASURE,
|
146
|
+
PURE_ELEMENT_NAME.PROFILE,
|
147
|
+
PURE_ELEMENT_NAME.FUNCTION,
|
148
|
+
PURE_ELEMENT_NAME.MAPPING,
|
149
|
+
PURE_ELEMENT_NAME.RUNTIME,
|
150
|
+
PURE_ELEMENT_NAME.CONNECTION,
|
151
|
+
PURE_ELEMENT_NAME.FILE_GENERATION,
|
152
|
+
PURE_ELEMENT_NAME.GENERATION_SPECIFICATION,
|
153
|
+
PURE_ELEMENT_NAME.DATA_ELEMENT,
|
154
|
+
// connections
|
155
|
+
PURE_CONNECTION_NAME.JSON_MODEL_CONNECTION,
|
156
|
+
PURE_CONNECTION_NAME.MODEL_CHAIN_CONNECTION,
|
157
|
+
PURE_CONNECTION_NAME.XML_MODEL_CONNECTION,
|
158
|
+
// mapping
|
159
|
+
'include',
|
160
|
+
'EnumerationMapping',
|
161
|
+
'Pure',
|
162
|
+
'AssociationMapping',
|
163
|
+
'XStore',
|
164
|
+
'AggregationAware',
|
165
|
+
/**
|
166
|
+
* @modularize
|
167
|
+
* See https://github.com/finos/legend-studio/issues/65
|
168
|
+
*/
|
169
|
+
PURE_ELEMENT_NAME.SERVICE,
|
170
|
+
PURE_ELEMENT_NAME.FLAT_DATA,
|
171
|
+
PURE_ELEMENT_NAME.DATABASE,
|
172
|
+
PURE_CONNECTION_NAME.FLAT_DATA_CONNECTION,
|
173
|
+
PURE_CONNECTION_NAME.RELATIONAL_DATABASE_CONNECTION,
|
174
|
+
'Relational',
|
175
|
+
],
|
176
|
+
operators: [
|
177
|
+
'=',
|
178
|
+
'>',
|
179
|
+
'<',
|
180
|
+
'!',
|
181
|
+
'~',
|
182
|
+
'?',
|
183
|
+
':',
|
184
|
+
'==',
|
185
|
+
'<=',
|
186
|
+
'>=',
|
187
|
+
'&&',
|
188
|
+
'||',
|
189
|
+
'++',
|
190
|
+
'--',
|
191
|
+
'+',
|
192
|
+
'-',
|
193
|
+
'*',
|
194
|
+
'/',
|
195
|
+
'&',
|
196
|
+
'|',
|
197
|
+
'^',
|
198
|
+
'%',
|
199
|
+
'->',
|
200
|
+
'#{',
|
201
|
+
'}#',
|
202
|
+
'@',
|
203
|
+
'<<',
|
204
|
+
'>>',
|
205
|
+
],
|
206
|
+
languageStructs: ['import', 'native'],
|
207
|
+
parsers: [
|
208
|
+
PURE_PARSER.PURE,
|
209
|
+
PURE_PARSER.CONNECTION,
|
210
|
+
PURE_PARSER.RUNTIME,
|
211
|
+
PURE_PARSER.MAPPING,
|
212
|
+
PURE_PARSER.SERVICE,
|
213
|
+
PURE_PARSER.FLATDATA,
|
214
|
+
PURE_PARSER.RELATIONAL,
|
215
|
+
PURE_PARSER.GENERATION_SPECIFICATION,
|
216
|
+
PURE_PARSER.FILE_GENERATION_SPECIFICATION,
|
217
|
+
PURE_PARSER.DATA,
|
218
|
+
]
|
219
|
+
.concat(extraParsers)
|
220
|
+
.map((parser) => `${PARSER_SECTION_MARKER}${parser}`),
|
221
|
+
// common regular expressions to be used in tokenizer
|
222
|
+
identifier: /[a-zA-Z_$][\w$]*/,
|
223
|
+
symbols: /[=><!~?:&|+\-*/^%#@]+/,
|
224
|
+
escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
|
225
|
+
digits: /\d+(_+\d+)*/,
|
226
|
+
octaldigits: /[0-7]+(_+[0-7]+)*/,
|
227
|
+
binarydigits: /[0-1]+(_+[0-1]+)*/,
|
228
|
+
hexdigits: /[[0-9a-fA-F]+(_+[0-9a-fA-F]+)*/,
|
229
|
+
multiplicity: /\[(?:[a-zA-Z0-9]+(?:\.\.(?:[a-zA-Z0-9]+|\*|))?|\*)\]/,
|
230
|
+
package: /(?:[\w_]+::)+/,
|
231
|
+
// NOTE: generics is a little tricky because in order to do it right, we have to
|
232
|
+
// do some sort of bracket matching, but we just can use a simple tokenizer here
|
233
|
+
// so to account for cases like `<Nil,Any|*>)->` `Function<{T[1]->Boolean[1]}>[1]`
|
234
|
+
// we have to make sure the content does not contain any `:` or `.` characters
|
235
|
+
// in order to avoid the accidental greedy match with inputs like
|
236
|
+
// `function doSomething<T>(a: Function<T[1]->Boolean[1]>)`
|
237
|
+
// nor we want to make sure the last character of the content is not `-` to avoid
|
238
|
+
// accidentally matching `->` as the end of the generics
|
239
|
+
generics: /(?:(?:<\w+>)|(?:<[^:.@^()]+[^-]>))/,
|
240
|
+
date: /%-?\d+(?:-\d+(?:-\d+(?:T(?:\d+(?::\d+(?::\d+(?:.\d+)?)?)?)(?:[+-][0-9]{4})?)))/,
|
241
|
+
time: /%\d+(?::\d+(?::\d+(?:.\d+)?)?)?/,
|
242
|
+
tokenizer: {
|
243
|
+
root: [
|
244
|
+
// NOTE: since `monaco-editor` Monarch is only meant for tokenizing
|
245
|
+
// and the need to highlight Pure syntax is more than just token-based,
|
246
|
+
// but semantic/syntax-based we have to create these complex rules.
|
247
|
+
// the things to note here is these are not meant to match multilines
|
248
|
+
// and they must be placed before identifier rules since token matching
|
249
|
+
// is run in order
|
250
|
+
// See https://github.com/microsoft/monaco-editor/issues/316#issuecomment-273555698
|
251
|
+
// See https://github.com/microsoft/monaco-editor/issues/571#issuecomment-342555050
|
252
|
+
// See https://microsoft.github.io/monaco-editor/monarch.html
|
253
|
+
{ include: '@pure' },
|
254
|
+
{ include: '@date' },
|
255
|
+
{ include: '@color' },
|
256
|
+
// parser markers
|
257
|
+
[
|
258
|
+
// NOTE: any leading whitespace to the section header is considered invalid syntax
|
259
|
+
/^\s*###[\w]+/,
|
260
|
+
{
|
261
|
+
cases: {
|
262
|
+
'@parsers': PURE_GRAMMAR_TOKEN.PARSER,
|
263
|
+
'@default': PURE_GRAMMAR_TOKEN.INVALID,
|
264
|
+
},
|
265
|
+
},
|
266
|
+
],
|
267
|
+
// identifiers and keywords
|
268
|
+
[
|
269
|
+
/(@identifier)/,
|
270
|
+
{
|
271
|
+
cases: {
|
272
|
+
'@languageStructs': PURE_GRAMMAR_TOKEN.LANGUAGE_STRUCT,
|
273
|
+
'@keywords': `${PURE_GRAMMAR_TOKEN.KEYWORD}.$0`,
|
274
|
+
// function descriptor
|
275
|
+
'([a-zA-Z_$][\\w$]*)_((\\w+_(([a-zA-Z0-9]+)|(\\$[a-zA-Z0-9]+_[a-zA-Z0-9]+\\$)))__)*(\\w+_(([a-zA-Z0-9]+)|(\\$[a-zA-Z0-9]+_[a-zA-Z0-9]+\\$)))_': PURE_GRAMMAR_TOKEN.TYPE,
|
276
|
+
'@default': PURE_GRAMMAR_TOKEN.IDENTIFIER,
|
277
|
+
},
|
278
|
+
},
|
279
|
+
],
|
280
|
+
// whitespace
|
281
|
+
{ include: '@whitespace' },
|
282
|
+
// delimiters and operators
|
283
|
+
[/[{}()[\]]/, '@brackets'],
|
284
|
+
[/[<>](?!@symbols)/, '@brackets'],
|
285
|
+
[
|
286
|
+
/@symbols/,
|
287
|
+
{
|
288
|
+
cases: {
|
289
|
+
'@operators': PURE_GRAMMAR_TOKEN.OPERATOR,
|
290
|
+
'@default': PURE_GRAMMAR_TOKEN.IDENTIFIER,
|
291
|
+
},
|
292
|
+
},
|
293
|
+
],
|
294
|
+
{ include: '@number' },
|
295
|
+
// delimiter: after number because of .\d floats
|
296
|
+
[/[;,.]/, PURE_GRAMMAR_TOKEN.DELIMITER],
|
297
|
+
// strings
|
298
|
+
// NOTE: including non-teminated string so as people type ', we can start showing them that they're working on a string
|
299
|
+
[/'([^'\\]|\\.)*$/, `${PURE_GRAMMAR_TOKEN.STRING}.invalid`],
|
300
|
+
[/'/, PURE_GRAMMAR_TOKEN.STRING, '@string'],
|
301
|
+
{ include: '@characters' },
|
302
|
+
],
|
303
|
+
pure: [
|
304
|
+
// type
|
305
|
+
[/(@package\*)/, [PURE_GRAMMAR_TOKEN.PACKAGE]],
|
306
|
+
[
|
307
|
+
/(@package?)(@identifier)(@generics?)(\s*)(@multiplicity)/,
|
308
|
+
[
|
309
|
+
PURE_GRAMMAR_TOKEN.PACKAGE,
|
310
|
+
PURE_GRAMMAR_TOKEN.TYPE,
|
311
|
+
PURE_GRAMMAR_TOKEN.GENERICS,
|
312
|
+
PURE_GRAMMAR_TOKEN.WHITESPACE,
|
313
|
+
PURE_GRAMMAR_TOKEN.MULTIPLICITY,
|
314
|
+
],
|
315
|
+
],
|
316
|
+
[
|
317
|
+
/(@package)(@identifier)(@generics?)/,
|
318
|
+
[
|
319
|
+
PURE_GRAMMAR_TOKEN.PACKAGE,
|
320
|
+
PURE_GRAMMAR_TOKEN.TYPE,
|
321
|
+
PURE_GRAMMAR_TOKEN.GENERICS,
|
322
|
+
],
|
323
|
+
],
|
324
|
+
// special operators that uses type (e.g. constructor, cast)
|
325
|
+
[
|
326
|
+
/([@^])(\s*)(@package?)(@identifier)(@generics?)(@multiplicity?)/,
|
327
|
+
[
|
328
|
+
`${PURE_GRAMMAR_TOKEN.TYPE}.operator`,
|
329
|
+
PURE_GRAMMAR_TOKEN.WHITESPACE,
|
330
|
+
PURE_GRAMMAR_TOKEN.PACKAGE,
|
331
|
+
PURE_GRAMMAR_TOKEN.TYPE,
|
332
|
+
PURE_GRAMMAR_TOKEN.GENERICS,
|
333
|
+
PURE_GRAMMAR_TOKEN.MULTIPLICITY,
|
334
|
+
],
|
335
|
+
],
|
336
|
+
// property / parameter
|
337
|
+
[
|
338
|
+
/(\.\s*)(@identifier)/,
|
339
|
+
[PURE_GRAMMAR_TOKEN.DELIMITER, PURE_GRAMMAR_TOKEN.PROPERTY],
|
340
|
+
],
|
341
|
+
[
|
342
|
+
/(@identifier)(\s*=)/,
|
343
|
+
[PURE_GRAMMAR_TOKEN.PROPERTY, PURE_GRAMMAR_TOKEN.OPERATOR],
|
344
|
+
],
|
345
|
+
[
|
346
|
+
/(@identifier)(\.)(@identifier)/,
|
347
|
+
[
|
348
|
+
PURE_GRAMMAR_TOKEN.TYPE,
|
349
|
+
PURE_GRAMMAR_TOKEN.OPERATOR,
|
350
|
+
PURE_GRAMMAR_TOKEN.PROPERTY,
|
351
|
+
],
|
352
|
+
],
|
353
|
+
[
|
354
|
+
/(@identifier)(\s*:)/,
|
355
|
+
[PURE_GRAMMAR_TOKEN.PARAMETER, PURE_GRAMMAR_TOKEN.OPERATOR],
|
356
|
+
],
|
357
|
+
// variables
|
358
|
+
[
|
359
|
+
/(let)(\s+)(@identifier)(\s*=)/,
|
360
|
+
[
|
361
|
+
PURE_GRAMMAR_TOKEN.KEYWORD,
|
362
|
+
PURE_GRAMMAR_TOKEN.WHITESPACE,
|
363
|
+
PURE_GRAMMAR_TOKEN.VARIABLE,
|
364
|
+
PURE_GRAMMAR_TOKEN.OPERATOR,
|
365
|
+
],
|
366
|
+
],
|
367
|
+
[/(\$@identifier)/, [`${PURE_GRAMMAR_TOKEN.VARIABLE}.reference`]],
|
368
|
+
],
|
369
|
+
date: [
|
370
|
+
[/(%latest)/, [`${PURE_GRAMMAR_TOKEN.DATE}.latest`]],
|
371
|
+
[/(@date)/, [PURE_GRAMMAR_TOKEN.DATE]],
|
372
|
+
[/(@time)/, [`${PURE_GRAMMAR_TOKEN.DATE}.time`]],
|
373
|
+
],
|
374
|
+
color: [[/(#[0-9a-fA-F]{6})/, [PURE_GRAMMAR_TOKEN.COLOR]]],
|
375
|
+
number: [
|
376
|
+
[
|
377
|
+
/(@digits)[eE]([-+]?(@digits))?[fFdD]?/,
|
378
|
+
`${PURE_GRAMMAR_TOKEN.NUMBER}.float`,
|
379
|
+
],
|
380
|
+
[
|
381
|
+
/(@digits)\.(@digits)([eE][-+]?(@digits))?[fFdD]?/,
|
382
|
+
`${PURE_GRAMMAR_TOKEN.NUMBER}.float`,
|
383
|
+
],
|
384
|
+
[/0[xX](@hexdigits)[Ll]?/, `${PURE_GRAMMAR_TOKEN.NUMBER}.hex`],
|
385
|
+
[/0(@octaldigits)[Ll]?/, `${PURE_GRAMMAR_TOKEN.NUMBER}.octal`],
|
386
|
+
[/0[bB](@binarydigits)[Ll]?/, `${PURE_GRAMMAR_TOKEN.NUMBER}.binary`],
|
387
|
+
[/(@digits)[fFdD]/, `${PURE_GRAMMAR_TOKEN.NUMBER}.float`],
|
388
|
+
[/(@digits)[lL]?/, PURE_GRAMMAR_TOKEN.NUMBER],
|
389
|
+
],
|
390
|
+
whitespace: [
|
391
|
+
[/[ \t\r\n]+/, PURE_GRAMMAR_TOKEN.WHITESPACE],
|
392
|
+
[/\/\*\*(?!\/)/, `${PURE_GRAMMAR_TOKEN.COMMENT}.doc`, '@doc'],
|
393
|
+
[/\/\*/, PURE_GRAMMAR_TOKEN.COMMENT, '@comment'],
|
394
|
+
[/\/\/.*$/, PURE_GRAMMAR_TOKEN.COMMENT],
|
395
|
+
],
|
396
|
+
comment: [
|
397
|
+
[/[^/*]+/, PURE_GRAMMAR_TOKEN.COMMENT],
|
398
|
+
// [/\/\*/, PURE_GRAMMAR_TOKEN.COMMENT, '@push' ], // nested comment not allowed :-(
|
399
|
+
// [/\/\*/, ${PURE_GRAMMAR_TOKEN.COMMENT}.invalid` ], // this breaks block comments in the shape of /* //*/
|
400
|
+
[/\*\//, PURE_GRAMMAR_TOKEN.COMMENT, '@pop'],
|
401
|
+
[/[/*]/, PURE_GRAMMAR_TOKEN.COMMENT],
|
402
|
+
],
|
403
|
+
// Identical copy of comment above, except for the addition of .doc
|
404
|
+
doc: [
|
405
|
+
[/[^/*]+/, `${PURE_GRAMMAR_TOKEN.COMMENT}.doc`],
|
406
|
+
// [/\/\*/, `${PURE_GRAMMAR_TOKEN.COMMENT}.doc`, '@push' ], // nested comment not allowed :-(
|
407
|
+
[/\/\*/, `${PURE_GRAMMAR_TOKEN.COMMENT}.doc.invalid`],
|
408
|
+
[/\*\//, `${PURE_GRAMMAR_TOKEN.COMMENT}.doc`, '@pop'],
|
409
|
+
[/[/*]/, `${PURE_GRAMMAR_TOKEN.COMMENT}.doc`],
|
410
|
+
],
|
411
|
+
string: [
|
412
|
+
[/[^\\']+/, PURE_GRAMMAR_TOKEN.STRING],
|
413
|
+
[/@escapes/, `${PURE_GRAMMAR_TOKEN.STRING}.escape`],
|
414
|
+
[/\\./, `${PURE_GRAMMAR_TOKEN.STRING}.escape.invalid`],
|
415
|
+
[/'/, PURE_GRAMMAR_TOKEN.STRING, '@pop'],
|
416
|
+
],
|
417
|
+
characters: [
|
418
|
+
[/'[^\\']'/, PURE_GRAMMAR_TOKEN.STRING],
|
419
|
+
[
|
420
|
+
/(')(@escapes)(')/,
|
421
|
+
[
|
422
|
+
PURE_GRAMMAR_TOKEN.STRING,
|
423
|
+
`${PURE_GRAMMAR_TOKEN.STRING}.escape`,
|
424
|
+
PURE_GRAMMAR_TOKEN.STRING,
|
425
|
+
],
|
426
|
+
],
|
427
|
+
[/'/, `${PURE_GRAMMAR_TOKEN.STRING}.invalid`],
|
428
|
+
],
|
429
|
+
},
|
430
|
+
});
|
431
|
+
export function setupPureLanguageService(options) {
|
432
|
+
monacoEditorAPI.defineTheme(CODE_EDITOR_THEME.LEGEND, theme);
|
433
|
+
monacoLanguagesAPI.register({ id: CODE_EDITOR_LANGUAGE.PURE });
|
434
|
+
monacoLanguagesAPI.setLanguageConfiguration(CODE_EDITOR_LANGUAGE.PURE, configuration);
|
435
|
+
monacoLanguagesAPI.setMonarchTokensProvider(CODE_EDITOR_LANGUAGE.PURE, generateLanguageMonarch(options?.extraKeywords ?? [], options?.extraParserKeywords ?? []));
|
436
|
+
}
|
437
|
+
//# sourceMappingURL=PureLanguageService.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"PureLanguageService.js","sourceRoot":"","sources":["../../src/code-editor/PureLanguageService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,+CAA+C;AAC/C,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,oBAAoB,EACpB,WAAW,GACZ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,MAAM,IAAI,eAAe,EACzB,SAAS,IAAI,kBAAkB,GAChC,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,uB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AE,kBAAkB,CAAC,MAAM,CAAC;YACvC;gBACE,kBAAkB;gBAClB;oBACE,kBAAkB,CAAC,MAAM;oBACzB,GAAG,kBAAkB,CAAC,MAAM,SAAS;oBACrC,kBAAkB,CAAC,MAAM;iBAC1B;aACF;YACD,CAAC,GAAG,EAAE,GAAG,kBAAkB,CAAC,MAAM,UAAU,CAAC;SAC9C;KACF;CACsC,CAAA,CAAC;AAE5C,MAAM,UAAU,wBAAwB,CAAC,OAGxC;IACC,eAAe,CAAC,WAAW,CAAC,iBAAiB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAC7D,kBAAkB,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,oBAAoB,CAAC,IAAI,EAAE,CAAC,CAAC;IAC/D,kBAAkB,CAAC,wBAAwB,CACzC,oBAAoB,CAAC,IAAI,EACzB,aAAa,CACd,CAAC;IACF,kBAAkB,CAAC,wBAAwB,CACzC,oBAAoB,CAAC,IAAI,EACzB,uBAAuB,CACrB,OAAO,EAAE,aAAa,IAAI,EAAE,EAC5B,OAAO,EAAE,mBAAmB,IAAI,EAAE,CACnC,CACF,CAAC;AACJ,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"MockedMonacoEditor.d.ts","sourceRoot":"","sources":["../../../src/code-editor/__test-utils__/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 @@
|
|
1
|
+
{"version":3,"file":"MockedMonacoEditor.js","sourceRoot":"","sources":["../../../src/code-editor/__test-utils__/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 @@
|
|
1
|
+
{"version":3,"file":"MonacoEditorMockUtils.d.ts","sourceRoot":"","sources":["../../../src/code-editor/__test-utils__/MonacoEditorMockUtils.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH;;;;;;GAMG;AACH,oBAAY,yBAAyB;IACnC,EAAE,KAAK;IACP,EAAE,KAAK;IACP,EAAE,KAAK;IACP,GAAG,KAAK;CACT;AAED,oBAAY,gCAAgC;IAC1C,IAAI,IAAI;IACR,IAAI,IAAI;IACR,OAAO,IAAI;IACX,KAAK,IAAI;CACV;AAED,oBAAY,qCAAqC;IAC/C,EAAE,IAAI;CACP;AAED,eAAO,MAAM,uBAAuB;;;;;;;;;CASnC,CAAC;AAEF,eAAO,MAAM,0BAA0B;;;;;;oBAMvB,8BAA8B;;;;;;;;;;;;;CAa7C,CAAC;AAEF,eAAO,MAAM,qBAAqB;kBACpB,iCAAiC;;;;iCAIpB,iCAAiC;iCAEjC,iCAAiC;;;;;;;CAQ3D,CAAC;AAEF,oBAAY,sCAAsC;IAChD,OAAO,KAAK;IACZ,OAAO,KAAK;CACb;AAED,oBAAY,gDAAgD;IAC1D,eAAe,IAAI;CACpB;AAED,eAAO,MAAM,8BAA8B;;;;;;;;;CAS1C,CAAC"}
|
@@ -13,7 +13,7 @@
|
|
13
13
|
* See the License for the specific language governing permissions and
|
14
14
|
* limitations under the License.
|
15
15
|
*/
|
16
|
-
import { createMock } from '@finos/legend-shared';
|
16
|
+
import { createMock } from '@finos/legend-shared/test';
|
17
17
|
/**
|
18
18
|
* NOTE: we have tried different ways to mock `monaco-editor`. But those ways often involve
|
19
19
|
* trying to load `monaco-editor` from `node_modules` and that takes a long time, so we'd better just mock
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"MonacoEditorMockUtils.js","sourceRoot":"","sources":["../../../src/code-editor/__test-utils__/MonacoEditorMockUtils.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAEvD;;;;;;GAMG;AACH,MAAM,CAAN,IAAY,yBAKX;AALD,WAAY,yBAAyB;IACnC,sEAAO,CAAA;IACP,sEAAO,CAAA;IACP,sEAAO,CAAA;IACP,wEAAQ,CAAA;AACV,CAAC,EALW,yBAAyB,GAAzB,yBAAyB,KAAzB,yBAAyB,QAKpC;AAED,MAAM,CAAN,IAAY,gCAKX;AALD,WAAY,gCAAgC;IAC1C,uFAAQ,CAAA;IACR,uFAAQ,CAAA;IACR,6FAAW,CAAA;IACX,yFAAS,CAAA;AACX,CAAC,EALW,gCAAgC,GAAhC,gCAAgC,KAAhC,gCAAgC,QAK3C;AAED,MAAM,CAAN,IAAY,qCAEX;AAFD,WAAY,qCAAqC;IAC/C,6FAAM,CAAA;AACR,CAAC,EAFW,qCAAqC,GAArC,qCAAqC,KAArC,qCAAqC,QAEhD;AAED,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,OAAO,EAAE,UAAU,EAAE;IACrB,aAAa,EAAE,UAAU,EAAE;IAC3B,QAAQ,EAAE,UAAU,EAAE;IACtB,YAAY,EAAE,UAAU,EAAE;IAC1B,gBAAgB,EAAE,UAAU,EAAE;IAC9B,gBAAgB,EAAE,UAAU,EAAE;IAC9B,kBAAkB,EAAE,UAAU,EAAE;IAChC,WAAW,EAAE,UAAU,EAAE;CAC1B,CAAC;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,OAAO,EAAE,UAAU,EAAE;IACrB,UAAU,EAAE,UAAU,EAAE;IACxB,QAAQ,EAAE,UAAU,EAAE;IACtB,WAAW,EA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gDAAgD,QAE3D;AAED,MAAM,CAAC,MAAM,8BAA8B,GAAG;IAC5C,QAAQ,EAAE,UAAU,EAAE;IACtB,wBAAwB,EAAE,UAAU,EAAE;IACtC,wBAAwB,EAAE,UAAU,EAAE;IACtC,wBAAwB,EAAE,UAAU,EAAE;IACtC,qBAAqB,EAAE,UAAU,EAAE;IACnC,8BAA8B,EAAE,UAAU,EAAE;IAC5C,kBAAkB,EAAE,sCAAsC;IAC1D,4BAA4B,EAAE,sCAAsC;CACrE,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 * from './__test-utils__/MonacoEditorMockUtils.js';
|
17
|
+
//# sourceMappingURL=__test__.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"__test__.d.ts","sourceRoot":"","sources":["../../src/code-editor/__test__.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,2CAA2C,CAAC"}
|
@@ -13,5 +13,5 @@
|
|
13
13
|
* See the License for the specific language governing permissions and
|
14
14
|
* limitations under the License.
|
15
15
|
*/
|
16
|
-
export * from './MonacoEditorMockUtils.js';
|
17
|
-
//# sourceMappingURL=
|
16
|
+
export * from './__test-utils__/MonacoEditorMockUtils.js';
|
17
|
+
//# sourceMappingURL=__test__.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"__test__.js","sourceRoot":"","sources":["../../src/code-editor/__test__.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,2CAA2C,CAAC"}
|
@@ -13,6 +13,10 @@
|
|
13
13
|
* See the License for the specific language governing permissions and
|
14
14
|
* limitations under the License.
|
15
15
|
*/
|
16
|
+
export { PURE_GRAMMAR_TOKEN, setupPureLanguageService, } from './PureLanguageService.js';
|
17
|
+
export * from './PureLanguageCodeEditorSupport.js';
|
18
|
+
export * from './CodeEditorConfig.js';
|
16
19
|
export * from './CodeEditor.js';
|
17
20
|
export * from './CodeEditorUtils.js';
|
21
|
+
export * from './CodeDiffView.js';
|
18
22
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/code-editor/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC"}
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/code-editor/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,kBAAkB,EAClB,wBAAwB,GACzB,MAAM,0BAA0B,CAAC;AAClC,cAAc,oCAAoC,CAAC;AAEnD,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC"}
|
package/lib/code-editor/index.js
CHANGED
@@ -13,6 +13,10 @@
|
|
13
13
|
* See the License for the specific language governing permissions and
|
14
14
|
* limitations under the License.
|
15
15
|
*/
|
16
|
+
export { PURE_GRAMMAR_TOKEN, setupPureLanguageService, } from './PureLanguageService.js';
|
17
|
+
export * from './PureLanguageCodeEditorSupport.js';
|
18
|
+
export * from './CodeEditorConfig.js';
|
16
19
|
export * from './CodeEditor.js';
|
17
20
|
export * from './CodeEditorUtils.js';
|
21
|
+
export * from './CodeDiffView.js';
|
18
22
|
//# sourceMappingURL=index.js.map
|
@@ -1 +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"}
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/code-editor/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,kBAAkB,EAClB,wBAAwB,GACzB,MAAM,0BAA0B,CAAC;AAClC,cAAc,oCAAoC,CAAC;AAEnD,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,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
|
+
import { type Type } from '@finos/legend-graph';
|
17
|
+
export declare const getClassPropertyIcon: (type: Type) => React.ReactNode;
|
18
|
+
//# sourceMappingURL=ElementIconUtils.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ElementIconUtils.d.ts","sourceRoot":"","sources":["../../src/graph-editor/ElementIconUtils.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,KAAK,IAAI,EAMV,MAAM,qBAAqB,CAAC;AAU7B,eAAO,MAAM,oBAAoB,SAAU,IAAI,KAAG,MAAM,SAavD,CAAC"}
|
@@ -0,0 +1,37 @@
|
|
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 { Class, Enumeration, Measure, Unit, PrimitiveType, } from '@finos/legend-graph';
|
18
|
+
import { PURE_ClassIcon, PURE_PrimitiveTypeIcon, PURE_EnumerationIcon, PURE_MeasureIcon, PURE_UnknownElementTypeIcon, PURE_UnitIcon, } from '@finos/legend-art';
|
19
|
+
export const getClassPropertyIcon = (type) => {
|
20
|
+
if (type instanceof PrimitiveType) {
|
21
|
+
return _jsx(PURE_PrimitiveTypeIcon, {});
|
22
|
+
}
|
23
|
+
else if (type instanceof Class) {
|
24
|
+
return _jsx(PURE_ClassIcon, {});
|
25
|
+
}
|
26
|
+
else if (type instanceof Enumeration) {
|
27
|
+
return _jsx(PURE_EnumerationIcon, {});
|
28
|
+
}
|
29
|
+
else if (type instanceof Measure) {
|
30
|
+
return _jsx(PURE_MeasureIcon, {});
|
31
|
+
}
|
32
|
+
else if (type instanceof Unit) {
|
33
|
+
return _jsx(PURE_UnitIcon, {});
|
34
|
+
}
|
35
|
+
return _jsx(PURE_UnknownElementTypeIcon, {});
|
36
|
+
};
|
37
|
+
//# sourceMappingURL=ElementIconUtils.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ElementIconUtils.js","sourceRoot":"","sources":["../../src/graph-editor/ElementIconUtils.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAEL,KAAK,EACL,WAAW,EACX,OAAO,EACP,IAAI,EACJ,aAAa,GACd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,cAAc,EACd,sBAAsB,EACtB,oBAAoB,EACpB,gBAAgB,EAChB,2BAA2B,EAC3B,aAAa,GACd,MAAM,mBAAmB,CAAC;AAE3B,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,IAAU,EAAmB,EAAE;IAClE,IAAI,IAAI,YAAY,aAAa,EAAE;QACjC,OAAO,KAAC,sBAAsB,KAAG,CAAC;KACnC;SAAM,IAAI,IAAI,YAAY,KAAK,EAAE;QAChC,OAAO,KAAC,cAAc,KAAG,CAAC;KAC3B;SAAM,IAAI,IAAI,YAAY,WAAW,EAAE;QACtC,OAAO,KAAC,oBAAoB,KAAG,CAAC;KACjC;SAAM,IAAI,IAAI,YAAY,OAAO,EAAE;QAClC,OAAO,KAAC,gBAAgB,KAAG,CAAC;KAC7B;SAAM,IAAI,IAAI,YAAY,IAAI,EAAE;QAC/B,OAAO,KAAC,aAAa,KAAG,CAAC;KAC1B;IACD,OAAO,KAAC,2BAA2B,KAAG,CAAC;AACzC,CAAC,CAAC"}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
import { type PackageableElement } from '@finos/legend-graph';
|
17
|
+
export interface PackageableElementOption<T extends PackageableElement> {
|
18
|
+
label: string;
|
19
|
+
value: T;
|
20
|
+
}
|
21
|
+
export declare const buildElementOption: <T extends PackageableElement>(element: T) => PackageableElementOption<T>;
|
22
|
+
export declare const getPackageableElementOptionFormatter: (props: {
|
23
|
+
darkMode?: boolean | undefined;
|
24
|
+
}) => (option: PackageableElementOption<PackageableElement>) => React.ReactNode;
|
25
|
+
//# sourceMappingURL=PackageableElementOption.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"PackageableElementOption.d.ts","sourceRoot":"","sources":["../../src/graph-editor/PackageableElementOption.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,KAAK,kBAAkB,EAIxB,MAAM,qBAAqB,CAAC;AAE7B,MAAM,WAAW,wBAAwB,CAAC,CAAC,SAAS,kBAAkB;IACpE,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,CAAC,CAAC;CACV;AAED,eAAO,MAAM,kBAAkB,2EAK7B,CAAC;AAsBH,eAAO,MAAM,oCAAoC,UAAW;IAC1D,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAChC,cACS,yBAAyB,kBAAkB,CAAC,KACjD,MAAM,SA0BR,CAAC"}
|