@finos/legend-extension-dsl-text 1.0.36 → 2.0.2
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/lib/components/studio/DSLText_CodeSnippets.d.ts +18 -0
- package/lib/components/studio/DSLText_CodeSnippets.d.ts.map +1 -0
- package/lib/components/studio/DSLText_CodeSnippets.js +26 -0
- package/lib/components/studio/DSLText_CodeSnippets.js.map +1 -0
- package/lib/components/studio/DSLText_LegendStudioDocumentation.d.ts +32 -0
- package/lib/components/studio/DSLText_LegendStudioDocumentation.d.ts.map +1 -0
- package/lib/components/studio/DSLText_LegendStudioDocumentation.js +33 -0
- package/lib/components/studio/DSLText_LegendStudioDocumentation.js.map +1 -0
- package/lib/components/studio/DSLText_LegendStudioPlugin.d.ts +8 -2
- package/lib/components/studio/DSLText_LegendStudioPlugin.d.ts.map +1 -1
- package/lib/components/studio/DSLText_LegendStudioPlugin.js +60 -1
- package/lib/components/studio/DSLText_LegendStudioPlugin.js.map +1 -1
- package/lib/graphManager/DSLText_PureGraphManagerPlugin.d.ts +2 -0
- package/lib/graphManager/DSLText_PureGraphManagerPlugin.d.ts.map +1 -1
- package/lib/graphManager/DSLText_PureGraphManagerPlugin.js +2 -2
- package/lib/graphManager/DSLText_PureGraphManagerPlugin.js.map +1 -1
- package/lib/index.css +1 -1
- package/lib/package.json +10 -7
- package/package.json +17 -14
- package/src/components/studio/DSLText_CodeSnippets.ts +27 -0
- package/src/components/studio/DSLText_LegendStudioDocumentation.ts +33 -0
- package/src/components/studio/DSLText_LegendStudioPlugin.tsx +102 -1
- package/src/graphManager/DSLText_PureGraphManagerPlugin.ts +2 -2
- package/tsconfig.json +2 -0
|
@@ -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 declare const PLAIN_TEXT_SNIPPET = "Text ${1:model::NewText}\n{\n type: plainText;\n content: '${2:}';\n}";
|
|
17
|
+
export declare const MARKDOWN_TEXT_SNIPPET = "Text ${1:model::NewText}\n{\n type: markdown;\n content: '${2:}';\n}";
|
|
18
|
+
//# sourceMappingURL=DSLText_CodeSnippets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DSLText_CodeSnippets.d.ts","sourceRoot":"","sources":["../../../src/components/studio/DSLText_CodeSnippets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,eAAO,MAAM,kBAAkB,4EAI7B,CAAC;AAEH,eAAO,MAAM,qBAAqB,2EAIhC,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
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 const PLAIN_TEXT_SNIPPET = `Text \${1:model::NewText}
|
|
17
|
+
{
|
|
18
|
+
type: plainText;
|
|
19
|
+
content: '\${2:}';
|
|
20
|
+
}`;
|
|
21
|
+
export const MARKDOWN_TEXT_SNIPPET = `Text \${1:model::NewText}
|
|
22
|
+
{
|
|
23
|
+
type: markdown;
|
|
24
|
+
content: '\${2:}';
|
|
25
|
+
}`;
|
|
26
|
+
//# sourceMappingURL=DSLText_CodeSnippets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DSLText_CodeSnippets.js","sourceRoot":"","sources":["../../../src/components/studio/DSLText_CodeSnippets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG;;;;EAIhC,CAAC;AAEH,MAAM,CAAC,MAAM,qBAAqB,GAAG;;;;EAInC,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export declare enum DSL_TEXT_LEGEND_STUDIO_DOCUMENTATION_KEY {
|
|
17
|
+
GRAMMAR_PARSER = "dsl-text__grammar-parser",
|
|
18
|
+
GRAMMAR_TEXT_ELEMENT = "dsl-text__grammar-text-element"
|
|
19
|
+
}
|
|
20
|
+
export declare const DSL_TEXT_DOCUMENTATION_ENTRIES: {
|
|
21
|
+
"dsl-text__grammar-parser": {
|
|
22
|
+
markdownText: {
|
|
23
|
+
value: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
"dsl-text__grammar-text-element": {
|
|
27
|
+
markdownText: {
|
|
28
|
+
value: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=DSLText_LegendStudioDocumentation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DSLText_LegendStudioDocumentation.d.ts","sourceRoot":"","sources":["../../../src/components/studio/DSLText_LegendStudioDocumentation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,oBAAY,wCAAwC;IAClD,cAAc,6BAA6B;IAC3C,oBAAoB,mCAAmC;CACxD;AAED,eAAO,MAAM,8BAA8B;;;;;;;;;;;CAW1C,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export var DSL_TEXT_LEGEND_STUDIO_DOCUMENTATION_KEY;
|
|
17
|
+
(function (DSL_TEXT_LEGEND_STUDIO_DOCUMENTATION_KEY) {
|
|
18
|
+
DSL_TEXT_LEGEND_STUDIO_DOCUMENTATION_KEY["GRAMMAR_PARSER"] = "dsl-text__grammar-parser";
|
|
19
|
+
DSL_TEXT_LEGEND_STUDIO_DOCUMENTATION_KEY["GRAMMAR_TEXT_ELEMENT"] = "dsl-text__grammar-text-element";
|
|
20
|
+
})(DSL_TEXT_LEGEND_STUDIO_DOCUMENTATION_KEY || (DSL_TEXT_LEGEND_STUDIO_DOCUMENTATION_KEY = {}));
|
|
21
|
+
export const DSL_TEXT_DOCUMENTATION_ENTRIES = {
|
|
22
|
+
[DSL_TEXT_LEGEND_STUDIO_DOCUMENTATION_KEY.GRAMMAR_PARSER]: {
|
|
23
|
+
markdownText: {
|
|
24
|
+
value: `DSL Text (\`###Text\`) concerns with storing data in plain-text`,
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
[DSL_TEXT_LEGEND_STUDIO_DOCUMENTATION_KEY.GRAMMAR_TEXT_ELEMENT]: {
|
|
28
|
+
markdownText: {
|
|
29
|
+
value: `A text element stores plain-text content with a specified content-type, which can be used for formatting, syntax-highlighting`,
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=DSLText_LegendStudioDocumentation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DSLText_LegendStudioDocumentation.js","sourceRoot":"","sources":["../../../src/components/studio/DSLText_LegendStudioDocumentation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,MAAM,CAAN,IAAY,wCAGX;AAHD,WAAY,wCAAwC;IAClD,uFAA2C,CAAA;IAC3C,mGAAuD,CAAA;AACzD,CAAC,EAHW,wCAAwC,KAAxC,wCAAwC,QAGnD;AAED,MAAM,CAAC,MAAM,8BAA8B,GAAG;IAC5C,CAAC,wCAAwC,CAAC,cAAc,CAAC,EAAE;QACzD,YAAY,EAAE;YACZ,KAAK,EAAE,iEAAiE;SACzE;KACF;IACD,CAAC,wCAAwC,CAAC,oBAAoB,CAAC,EAAE;QAC/D,YAAY,EAAE;YACZ,KAAK,EAAE,+HAA+H;SACvI;KACF;CACF,CAAC"}
|
|
@@ -13,9 +13,11 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { LegendStudioPlugin, type NewElementFromStateCreator, type ElementEditorStateCreator, type ElementTypeGetter, type ElementProjectExplorerDnDTypeGetter, type ElementIconGetter, type ElementEditorRenderer, type DSL_LegendStudioPlugin_Extension } from '@finos/legend-studio';
|
|
16
|
+
import { LegendStudioPlugin, type NewElementFromStateCreator, type ElementEditorStateCreator, type ElementTypeGetter, type ElementProjectExplorerDnDTypeGetter, type ElementIconGetter, type ElementEditorRenderer, type DSL_LegendStudioPlugin_Extension, type PureGrammarParserDocumentationGetter, type PureGrammarParserKeywordSuggestionGetter, type PureGrammarParserElementSnippetSuggestionsGetter, type PureGrammarParserElementDocumentationGetter } from '@finos/legend-studio';
|
|
17
|
+
import { type LegendApplicationKeyedDocumentationEntry } from '@finos/legend-application';
|
|
17
18
|
export declare class DSLText_LegendStudioPlugin extends LegendStudioPlugin implements DSL_LegendStudioPlugin_Extension {
|
|
18
19
|
constructor();
|
|
20
|
+
getExtraKeyedDocumentationEntries(): LegendApplicationKeyedDocumentationEntry[];
|
|
19
21
|
getExtraSupportedElementTypes(): string[];
|
|
20
22
|
getExtraElementTypeGetters(): ElementTypeGetter[];
|
|
21
23
|
getExtraElementIconGetters(): ElementIconGetter[];
|
|
@@ -23,6 +25,10 @@ export declare class DSLText_LegendStudioPlugin extends LegendStudioPlugin imple
|
|
|
23
25
|
getExtraNewElementFromStateCreators(): NewElementFromStateCreator[];
|
|
24
26
|
getExtraElementEditorStateCreators(): ElementEditorStateCreator[];
|
|
25
27
|
getExtraElementProjectExplorerDnDTypeGetters(): ElementProjectExplorerDnDTypeGetter[];
|
|
26
|
-
|
|
28
|
+
getExtraPureGrammarTextEditorDnDTypes(): string[];
|
|
29
|
+
getExtraPureGrammarParserElementDocumentationGetters(): PureGrammarParserElementDocumentationGetter[];
|
|
30
|
+
getExtraPureGrammarParserDocumentationGetters(): PureGrammarParserDocumentationGetter[];
|
|
31
|
+
getExtraPureGrammarParserKeywordSuggestionGetters(): PureGrammarParserKeywordSuggestionGetter[];
|
|
32
|
+
getExtraPureGrammarParserElementSnippetSuggestionsGetters(): PureGrammarParserElementSnippetSuggestionsGetter[];
|
|
27
33
|
}
|
|
28
34
|
//# sourceMappingURL=DSLText_LegendStudioPlugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DSLText_LegendStudioPlugin.d.ts","sourceRoot":"","sources":["../../../src/components/studio/DSLText_LegendStudioPlugin.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EACL,kBAAkB,EAClB,KAAK,0BAA0B,EAG/B,KAAK,yBAAyB,EAC9B,KAAK,iBAAiB,EACtB,KAAK,mCAAmC,EACxC,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,gCAAgC,
|
|
1
|
+
{"version":3,"file":"DSLText_LegendStudioPlugin.d.ts","sourceRoot":"","sources":["../../../src/components/studio/DSLText_LegendStudioPlugin.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EACL,kBAAkB,EAClB,KAAK,0BAA0B,EAG/B,KAAK,yBAAyB,EAC9B,KAAK,iBAAiB,EACtB,KAAK,mCAAmC,EACxC,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,gCAAgC,EAErC,KAAK,oCAAoC,EACzC,KAAK,wCAAwC,EAE7C,KAAK,gDAAgD,EACrD,KAAK,2CAA2C,EACjD,MAAM,sBAAsB,CAAC;AAM9B,OAAO,EAGL,KAAK,wCAAwC,EAC9C,MAAM,2BAA2B,CAAC;AAiBnC,qBAAa,0BACX,SAAQ,kBACR,YAAW,gCAAgC;;IAMlC,iCAAiC,IAAI,wCAAwC,EAAE;IAMxF,6BAA6B,IAAI,MAAM,EAAE;IAIzC,0BAA0B,IAAI,iBAAiB,EAAE;IAWjD,0BAA0B,IAAI,iBAAiB,EAAE;IAejD,8BAA8B,IAAI,qBAAqB,EAAE;IAWzD,mCAAmC,IAAI,0BAA0B,EAAE;IAenE,kCAAkC,IAAI,yBAAyB,EAAE;IAcjE,4CAA4C,IAAI,mCAAmC,EAAE;IAWrF,qCAAqC,IAAI,MAAM,EAAE;IAIjD,oDAAoD,IAAI,2CAA2C,EAAE;IAmBrG,6CAA6C,IAAI,oCAAoC,EAAE;IAgBvF,iDAAiD,IAAI,wCAAwC,EAAE;IAe/F,yDAAyD,IAAI,gDAAgD,EAAE;CAsBhH"}
|
|
@@ -20,12 +20,19 @@ import { FileIcon } from '@finos/legend-art';
|
|
|
20
20
|
import { TextEditorState } from '../../stores/studio/TextEditorState';
|
|
21
21
|
import { TextElementEditor } from './TextElementEditor';
|
|
22
22
|
import { Text } from '../../models/metamodels/pure/model/packageableElements/text/DSLText_Text';
|
|
23
|
+
import { collectKeyedDocumnetationEntriesFromConfig, } from '@finos/legend-application';
|
|
24
|
+
import { DSL_TEXT_DOCUMENTATION_ENTRIES, DSL_TEXT_LEGEND_STUDIO_DOCUMENTATION_KEY, } from './DSLText_LegendStudioDocumentation';
|
|
25
|
+
import { PURE_GRAMMAR_TEXT_ELEMENT_TYPE_LABEL, PURE_GRAMMAR_TEXT_PARSER_NAME, } from '../../graphManager/DSLText_PureGraphManagerPlugin';
|
|
26
|
+
import { MARKDOWN_TEXT_SNIPPET, PLAIN_TEXT_SNIPPET, } from './DSLText_CodeSnippets';
|
|
23
27
|
const TEXT_ELEMENT_TYPE = 'TEXT';
|
|
24
28
|
const TEXT_ELEMENT_PROJECT_EXPLORER_DND_TYPE = 'PROJECT_EXPLORER_TEXT';
|
|
25
29
|
export class DSLText_LegendStudioPlugin extends LegendStudioPlugin {
|
|
26
30
|
constructor() {
|
|
27
31
|
super(packageJson.extensions.studioPlugin, packageJson.version);
|
|
28
32
|
}
|
|
33
|
+
getExtraKeyedDocumentationEntries() {
|
|
34
|
+
return collectKeyedDocumnetationEntriesFromConfig(DSL_TEXT_DOCUMENTATION_ENTRIES);
|
|
35
|
+
}
|
|
29
36
|
getExtraSupportedElementTypes() {
|
|
30
37
|
return [TEXT_ELEMENT_TYPE];
|
|
31
38
|
}
|
|
@@ -89,8 +96,60 @@ export class DSLText_LegendStudioPlugin extends LegendStudioPlugin {
|
|
|
89
96
|
},
|
|
90
97
|
];
|
|
91
98
|
}
|
|
92
|
-
|
|
99
|
+
getExtraPureGrammarTextEditorDnDTypes() {
|
|
93
100
|
return [TEXT_ELEMENT_PROJECT_EXPLORER_DND_TYPE];
|
|
94
101
|
}
|
|
102
|
+
getExtraPureGrammarParserElementDocumentationGetters() {
|
|
103
|
+
return [
|
|
104
|
+
(editorStore, parserKeyword, elementKeyword) => {
|
|
105
|
+
if (parserKeyword === PURE_GRAMMAR_TEXT_PARSER_NAME) {
|
|
106
|
+
if (elementKeyword === PURE_GRAMMAR_TEXT_ELEMENT_TYPE_LABEL) {
|
|
107
|
+
return editorStore.applicationStore.docRegistry.getEntry(DSL_TEXT_LEGEND_STUDIO_DOCUMENTATION_KEY.GRAMMAR_TEXT_ELEMENT);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
return undefined;
|
|
111
|
+
},
|
|
112
|
+
];
|
|
113
|
+
}
|
|
114
|
+
getExtraPureGrammarParserDocumentationGetters() {
|
|
115
|
+
return [
|
|
116
|
+
(editorStore, parserKeyword) => {
|
|
117
|
+
if (parserKeyword === PURE_GRAMMAR_TEXT_PARSER_NAME) {
|
|
118
|
+
return editorStore.applicationStore.docRegistry.getEntry(DSL_TEXT_LEGEND_STUDIO_DOCUMENTATION_KEY.GRAMMAR_PARSER);
|
|
119
|
+
}
|
|
120
|
+
return undefined;
|
|
121
|
+
},
|
|
122
|
+
];
|
|
123
|
+
}
|
|
124
|
+
getExtraPureGrammarParserKeywordSuggestionGetters() {
|
|
125
|
+
return [
|
|
126
|
+
(editorStore) => [
|
|
127
|
+
{
|
|
128
|
+
text: PURE_GRAMMAR_TEXT_PARSER_NAME,
|
|
129
|
+
description: `(dsl)`,
|
|
130
|
+
documentation: editorStore.applicationStore.docRegistry.getEntry(DSL_TEXT_LEGEND_STUDIO_DOCUMENTATION_KEY.GRAMMAR_PARSER),
|
|
131
|
+
insertText: PURE_GRAMMAR_TEXT_PARSER_NAME,
|
|
132
|
+
},
|
|
133
|
+
],
|
|
134
|
+
];
|
|
135
|
+
}
|
|
136
|
+
getExtraPureGrammarParserElementSnippetSuggestionsGetters() {
|
|
137
|
+
return [
|
|
138
|
+
(editorStore, parserKeyword) => parserKeyword === PURE_GRAMMAR_TEXT_PARSER_NAME
|
|
139
|
+
? [
|
|
140
|
+
{
|
|
141
|
+
text: PURE_GRAMMAR_TEXT_ELEMENT_TYPE_LABEL,
|
|
142
|
+
description: 'plain text',
|
|
143
|
+
insertText: PLAIN_TEXT_SNIPPET,
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
text: PURE_GRAMMAR_TEXT_ELEMENT_TYPE_LABEL,
|
|
147
|
+
description: 'markdown',
|
|
148
|
+
insertText: MARKDOWN_TEXT_SNIPPET,
|
|
149
|
+
},
|
|
150
|
+
]
|
|
151
|
+
: undefined,
|
|
152
|
+
];
|
|
153
|
+
}
|
|
95
154
|
}
|
|
96
155
|
//# sourceMappingURL=DSLText_LegendStudioPlugin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DSLText_LegendStudioPlugin.js","sourceRoot":"","sources":["../../../src/components/studio/DSLText_LegendStudioPlugin.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,WAAW,MAAM,uBAAuB,CAAC;AAChD,OAAO,EACL,kBAAkB,
|
|
1
|
+
{"version":3,"file":"DSLText_LegendStudioPlugin.js","sourceRoot":"","sources":["../../../src/components/studio/DSLText_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|
|
16
16
|
import { PureGraphManagerPlugin, type ElementObserver, type PureGrammarElementLabeler } from '@finos/legend-graph';
|
|
17
|
+
export declare const PURE_GRAMMAR_TEXT_PARSER_NAME = "Text";
|
|
18
|
+
export declare const PURE_GRAMMAR_TEXT_ELEMENT_TYPE_LABEL = "Text";
|
|
17
19
|
export declare class DSLText_PureGraphManagerPlugin extends PureGraphManagerPlugin {
|
|
18
20
|
constructor();
|
|
19
21
|
getExtraPureGrammarParserNames(): string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DSLText_PureGraphManagerPlugin.d.ts","sourceRoot":"","sources":["../../src/graphManager/DSLText_PureGraphManagerPlugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,EACL,sBAAsB,EAEtB,KAAK,eAAe,EAEpB,KAAK,yBAAyB,EAC/B,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"DSLText_PureGraphManagerPlugin.d.ts","sourceRoot":"","sources":["../../src/graphManager/DSLText_PureGraphManagerPlugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,EACL,sBAAsB,EAEtB,KAAK,eAAe,EAEpB,KAAK,yBAAyB,EAC/B,MAAM,qBAAqB,CAAC;AAG7B,eAAO,MAAM,6BAA6B,SAAS,CAAC;AACpD,eAAO,MAAM,oCAAoC,SAAS,CAAC;AAE3D,qBAAa,8BAA+B,SAAQ,sBAAsB;;IAK/D,8BAA8B,IAAI,MAAM,EAAE;IAI1C,2BAA2B,IAAI,MAAM,EAAE;IAIvC,kCAAkC,IAAI,yBAAyB,EAAE;IAWjE,wBAAwB,IAAI,eAAe,EAAE;CAavD"}
|
|
@@ -17,8 +17,8 @@ import packageJson from '../../package.json';
|
|
|
17
17
|
import { Text } from '../models/metamodels/pure/model/packageableElements/text/DSLText_Text';
|
|
18
18
|
import { PureGraphManagerPlugin, } from '@finos/legend-graph';
|
|
19
19
|
import { observe_Text } from './action/changeDetection/DSLText_ObserverHelper';
|
|
20
|
-
const PURE_GRAMMAR_TEXT_PARSER_NAME = 'Text';
|
|
21
|
-
const PURE_GRAMMAR_TEXT_ELEMENT_TYPE_LABEL = 'Text';
|
|
20
|
+
export const PURE_GRAMMAR_TEXT_PARSER_NAME = 'Text';
|
|
21
|
+
export const PURE_GRAMMAR_TEXT_ELEMENT_TYPE_LABEL = 'Text';
|
|
22
22
|
export class DSLText_PureGraphManagerPlugin extends PureGraphManagerPlugin {
|
|
23
23
|
constructor() {
|
|
24
24
|
super(packageJson.extensions.pureGraphManagerPlugin, packageJson.version);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DSLText_PureGraphManagerPlugin.js","sourceRoot":"","sources":["../../src/graphManager/DSLText_PureGraphManagerPlugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,WAAW,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,uEAAuE,CAAC;AAC7F,OAAO,EACL,sBAAsB,GAKvB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,iDAAiD,CAAC;AAE/E,MAAM,6BAA6B,GAAG,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"DSLText_PureGraphManagerPlugin.js","sourceRoot":"","sources":["../../src/graphManager/DSLText_PureGraphManagerPlugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,WAAW,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,uEAAuE,CAAC;AAC7F,OAAO,EACL,sBAAsB,GAKvB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,iDAAiD,CAAC;AAE/E,MAAM,CAAC,MAAM,6BAA6B,GAAG,MAAM,CAAC;AACpD,MAAM,CAAC,MAAM,oCAAoC,GAAG,MAAM,CAAC;AAE3D,MAAM,OAAO,8BAA+B,SAAQ,sBAAsB;IACxE;QACE,KAAK,CAAC,WAAW,CAAC,UAAU,CAAC,sBAAsB,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC5E,CAAC;IAEQ,8BAA8B;QACrC,OAAO,CAAC,6BAA6B,CAAC,CAAC;IACzC,CAAC;IAEQ,2BAA2B;QAClC,OAAO,CAAC,oCAAoC,CAAC,CAAC;IAChD,CAAC;IAEQ,kCAAkC;QACzC,OAAO;YACL,CAAC,OAA2B,EAAsB,EAAE;gBAClD,IAAI,OAAO,YAAY,IAAI,EAAE;oBAC3B,OAAO,oCAAoC,CAAC;iBAC7C;gBACD,OAAO,SAAS,CAAC;YACnB,CAAC;SACF,CAAC;IACJ,CAAC;IAEQ,wBAAwB;QAC/B,OAAO;YACL,CACE,OAA2B,EAC3B,OAAwB,EACQ,EAAE;gBAClC,IAAI,OAAO,YAAY,IAAI,EAAE;oBAC3B,OAAO,YAAY,CAAC,OAAO,CAAC,CAAC;iBAC9B;gBACD,OAAO,SAAS,CAAC;YACnB,CAAC;SACF,CAAC;IACJ,CAAC;CACF"}
|
package/lib/index.css
CHANGED
package/lib/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@finos/legend-extension-dsl-text",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "Legend extension for Text DSL",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"legend",
|
|
@@ -20,7 +20,10 @@
|
|
|
20
20
|
"license": "Apache-2.0",
|
|
21
21
|
"sideEffects": false,
|
|
22
22
|
"type": "module",
|
|
23
|
-
"
|
|
23
|
+
"exports": {
|
|
24
|
+
".": "./lib/index.js",
|
|
25
|
+
"./lib/index.css": "./lib/index.css"
|
|
26
|
+
},
|
|
24
27
|
"module": "lib/index.js",
|
|
25
28
|
"types": "lib/index.d.ts",
|
|
26
29
|
"scripts": {
|
|
@@ -46,7 +49,7 @@
|
|
|
46
49
|
"@finos/legend-model-storage": "workspace:*",
|
|
47
50
|
"@finos/legend-shared": "workspace:*",
|
|
48
51
|
"@finos/legend-studio": "workspace:*",
|
|
49
|
-
"@types/react": "17.0.
|
|
52
|
+
"@types/react": "17.0.44",
|
|
50
53
|
"mobx": "6.5.0",
|
|
51
54
|
"mobx-react-lite": "3.3.0",
|
|
52
55
|
"react": "17.0.2",
|
|
@@ -55,12 +58,12 @@
|
|
|
55
58
|
"devDependencies": {
|
|
56
59
|
"@finos/legend-dev-utils": "workspace:*",
|
|
57
60
|
"cross-env": "7.0.3",
|
|
58
|
-
"eslint": "8.
|
|
59
|
-
"jest": "
|
|
61
|
+
"eslint": "8.14.0",
|
|
62
|
+
"jest": "28.0.3",
|
|
60
63
|
"npm-run-all": "4.1.5",
|
|
61
64
|
"rimraf": "3.0.2",
|
|
62
|
-
"sass": "1.
|
|
63
|
-
"typescript": "4.6.
|
|
65
|
+
"sass": "1.51.0",
|
|
66
|
+
"typescript": "4.6.4"
|
|
64
67
|
},
|
|
65
68
|
"peerDependencies": {
|
|
66
69
|
"react": "^17.0.0"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@finos/legend-extension-dsl-text",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "Legend extension for Text DSL",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"legend",
|
|
@@ -20,7 +20,10 @@
|
|
|
20
20
|
"license": "Apache-2.0",
|
|
21
21
|
"sideEffects": false,
|
|
22
22
|
"type": "module",
|
|
23
|
-
"
|
|
23
|
+
"exports": {
|
|
24
|
+
".": "./lib/index.js",
|
|
25
|
+
"./lib/index.css": "./lib/index.css"
|
|
26
|
+
},
|
|
24
27
|
"module": "lib/index.js",
|
|
25
28
|
"types": "lib/index.d.ts",
|
|
26
29
|
"scripts": {
|
|
@@ -40,27 +43,27 @@
|
|
|
40
43
|
"test:watch": "jest --watch"
|
|
41
44
|
},
|
|
42
45
|
"dependencies": {
|
|
43
|
-
"@finos/legend-application": "
|
|
44
|
-
"@finos/legend-art": "0.
|
|
45
|
-
"@finos/legend-graph": "
|
|
46
|
-
"@finos/legend-model-storage": "0.0
|
|
47
|
-
"@finos/legend-shared": "
|
|
48
|
-
"@finos/legend-studio": "
|
|
49
|
-
"@types/react": "17.0.
|
|
46
|
+
"@finos/legend-application": "3.0.2",
|
|
47
|
+
"@finos/legend-art": "1.0.0",
|
|
48
|
+
"@finos/legend-graph": "6.0.1",
|
|
49
|
+
"@finos/legend-model-storage": "1.0.0",
|
|
50
|
+
"@finos/legend-shared": "2.0.0",
|
|
51
|
+
"@finos/legend-studio": "9.0.2",
|
|
52
|
+
"@types/react": "17.0.44",
|
|
50
53
|
"mobx": "6.5.0",
|
|
51
54
|
"mobx-react-lite": "3.3.0",
|
|
52
55
|
"react": "17.0.2",
|
|
53
56
|
"serializr": "2.0.5"
|
|
54
57
|
},
|
|
55
58
|
"devDependencies": {
|
|
56
|
-
"@finos/legend-dev-utils": "0.
|
|
59
|
+
"@finos/legend-dev-utils": "1.0.0",
|
|
57
60
|
"cross-env": "7.0.3",
|
|
58
|
-
"eslint": "8.
|
|
59
|
-
"jest": "
|
|
61
|
+
"eslint": "8.14.0",
|
|
62
|
+
"jest": "28.0.3",
|
|
60
63
|
"npm-run-all": "4.1.5",
|
|
61
64
|
"rimraf": "3.0.2",
|
|
62
|
-
"sass": "1.
|
|
63
|
-
"typescript": "4.6.
|
|
65
|
+
"sass": "1.51.0",
|
|
66
|
+
"typescript": "4.6.4"
|
|
64
67
|
},
|
|
65
68
|
"peerDependencies": {
|
|
66
69
|
"react": "^17.0.0"
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
|
|
17
|
+
export const PLAIN_TEXT_SNIPPET = `Text \${1:model::NewText}
|
|
18
|
+
{
|
|
19
|
+
type: plainText;
|
|
20
|
+
content: '\${2:}';
|
|
21
|
+
}`;
|
|
22
|
+
|
|
23
|
+
export const MARKDOWN_TEXT_SNIPPET = `Text \${1:model::NewText}
|
|
24
|
+
{
|
|
25
|
+
type: markdown;
|
|
26
|
+
content: '\${2:}';
|
|
27
|
+
}`;
|
|
@@ -0,0 +1,33 @@
|
|
|
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
|
+
|
|
17
|
+
export enum DSL_TEXT_LEGEND_STUDIO_DOCUMENTATION_KEY {
|
|
18
|
+
GRAMMAR_PARSER = 'dsl-text__grammar-parser',
|
|
19
|
+
GRAMMAR_TEXT_ELEMENT = 'dsl-text__grammar-text-element',
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const DSL_TEXT_DOCUMENTATION_ENTRIES = {
|
|
23
|
+
[DSL_TEXT_LEGEND_STUDIO_DOCUMENTATION_KEY.GRAMMAR_PARSER]: {
|
|
24
|
+
markdownText: {
|
|
25
|
+
value: `DSL Text (\`###Text\`) concerns with storing data in plain-text`,
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
[DSL_TEXT_LEGEND_STUDIO_DOCUMENTATION_KEY.GRAMMAR_TEXT_ELEMENT]: {
|
|
29
|
+
markdownText: {
|
|
30
|
+
value: `A text element stores plain-text content with a specified content-type, which can be used for formatting, syntax-highlighting`,
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
};
|
|
@@ -27,12 +27,34 @@ import {
|
|
|
27
27
|
type ElementEditorRenderer,
|
|
28
28
|
type DSL_LegendStudioPlugin_Extension,
|
|
29
29
|
type NewElementState,
|
|
30
|
+
type PureGrammarParserDocumentationGetter,
|
|
31
|
+
type PureGrammarParserKeywordSuggestionGetter,
|
|
32
|
+
type PureGrammarTextSuggestion,
|
|
33
|
+
type PureGrammarParserElementSnippetSuggestionsGetter,
|
|
34
|
+
type PureGrammarParserElementDocumentationGetter,
|
|
30
35
|
} from '@finos/legend-studio';
|
|
31
36
|
import { FileIcon } from '@finos/legend-art';
|
|
32
37
|
import { TextEditorState } from '../../stores/studio/TextEditorState';
|
|
33
38
|
import { TextElementEditor } from './TextElementEditor';
|
|
34
39
|
import type { PackageableElement } from '@finos/legend-graph';
|
|
35
40
|
import { Text } from '../../models/metamodels/pure/model/packageableElements/text/DSLText_Text';
|
|
41
|
+
import {
|
|
42
|
+
collectKeyedDocumnetationEntriesFromConfig,
|
|
43
|
+
type LegendApplicationDocumentationEntry,
|
|
44
|
+
type LegendApplicationKeyedDocumentationEntry,
|
|
45
|
+
} from '@finos/legend-application';
|
|
46
|
+
import {
|
|
47
|
+
DSL_TEXT_DOCUMENTATION_ENTRIES,
|
|
48
|
+
DSL_TEXT_LEGEND_STUDIO_DOCUMENTATION_KEY,
|
|
49
|
+
} from './DSLText_LegendStudioDocumentation';
|
|
50
|
+
import {
|
|
51
|
+
PURE_GRAMMAR_TEXT_ELEMENT_TYPE_LABEL,
|
|
52
|
+
PURE_GRAMMAR_TEXT_PARSER_NAME,
|
|
53
|
+
} from '../../graphManager/DSLText_PureGraphManagerPlugin';
|
|
54
|
+
import {
|
|
55
|
+
MARKDOWN_TEXT_SNIPPET,
|
|
56
|
+
PLAIN_TEXT_SNIPPET,
|
|
57
|
+
} from './DSLText_CodeSnippets';
|
|
36
58
|
|
|
37
59
|
const TEXT_ELEMENT_TYPE = 'TEXT';
|
|
38
60
|
const TEXT_ELEMENT_PROJECT_EXPLORER_DND_TYPE = 'PROJECT_EXPLORER_TEXT';
|
|
@@ -45,6 +67,12 @@ export class DSLText_LegendStudioPlugin
|
|
|
45
67
|
super(packageJson.extensions.studioPlugin, packageJson.version);
|
|
46
68
|
}
|
|
47
69
|
|
|
70
|
+
override getExtraKeyedDocumentationEntries(): LegendApplicationKeyedDocumentationEntry[] {
|
|
71
|
+
return collectKeyedDocumnetationEntriesFromConfig(
|
|
72
|
+
DSL_TEXT_DOCUMENTATION_ENTRIES,
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
|
|
48
76
|
getExtraSupportedElementTypes(): string[] {
|
|
49
77
|
return [TEXT_ELEMENT_TYPE];
|
|
50
78
|
}
|
|
@@ -126,7 +154,80 @@ export class DSLText_LegendStudioPlugin
|
|
|
126
154
|
];
|
|
127
155
|
}
|
|
128
156
|
|
|
129
|
-
|
|
157
|
+
getExtraPureGrammarTextEditorDnDTypes(): string[] {
|
|
130
158
|
return [TEXT_ELEMENT_PROJECT_EXPLORER_DND_TYPE];
|
|
131
159
|
}
|
|
160
|
+
|
|
161
|
+
getExtraPureGrammarParserElementDocumentationGetters(): PureGrammarParserElementDocumentationGetter[] {
|
|
162
|
+
return [
|
|
163
|
+
(
|
|
164
|
+
editorStore: EditorStore,
|
|
165
|
+
parserKeyword: string,
|
|
166
|
+
elementKeyword: string,
|
|
167
|
+
): LegendApplicationDocumentationEntry | undefined => {
|
|
168
|
+
if (parserKeyword === PURE_GRAMMAR_TEXT_PARSER_NAME) {
|
|
169
|
+
if (elementKeyword === PURE_GRAMMAR_TEXT_ELEMENT_TYPE_LABEL) {
|
|
170
|
+
return editorStore.applicationStore.docRegistry.getEntry(
|
|
171
|
+
DSL_TEXT_LEGEND_STUDIO_DOCUMENTATION_KEY.GRAMMAR_TEXT_ELEMENT,
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
return undefined;
|
|
176
|
+
},
|
|
177
|
+
];
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
getExtraPureGrammarParserDocumentationGetters(): PureGrammarParserDocumentationGetter[] {
|
|
181
|
+
return [
|
|
182
|
+
(
|
|
183
|
+
editorStore: EditorStore,
|
|
184
|
+
parserKeyword: string,
|
|
185
|
+
): LegendApplicationDocumentationEntry | undefined => {
|
|
186
|
+
if (parserKeyword === PURE_GRAMMAR_TEXT_PARSER_NAME) {
|
|
187
|
+
return editorStore.applicationStore.docRegistry.getEntry(
|
|
188
|
+
DSL_TEXT_LEGEND_STUDIO_DOCUMENTATION_KEY.GRAMMAR_PARSER,
|
|
189
|
+
);
|
|
190
|
+
}
|
|
191
|
+
return undefined;
|
|
192
|
+
},
|
|
193
|
+
];
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
getExtraPureGrammarParserKeywordSuggestionGetters(): PureGrammarParserKeywordSuggestionGetter[] {
|
|
197
|
+
return [
|
|
198
|
+
(editorStore: EditorStore): PureGrammarTextSuggestion[] => [
|
|
199
|
+
{
|
|
200
|
+
text: PURE_GRAMMAR_TEXT_PARSER_NAME,
|
|
201
|
+
description: `(dsl)`,
|
|
202
|
+
documentation: editorStore.applicationStore.docRegistry.getEntry(
|
|
203
|
+
DSL_TEXT_LEGEND_STUDIO_DOCUMENTATION_KEY.GRAMMAR_PARSER,
|
|
204
|
+
),
|
|
205
|
+
insertText: PURE_GRAMMAR_TEXT_PARSER_NAME,
|
|
206
|
+
},
|
|
207
|
+
],
|
|
208
|
+
];
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
getExtraPureGrammarParserElementSnippetSuggestionsGetters(): PureGrammarParserElementSnippetSuggestionsGetter[] {
|
|
212
|
+
return [
|
|
213
|
+
(
|
|
214
|
+
editorStore: EditorStore,
|
|
215
|
+
parserKeyword: string,
|
|
216
|
+
): PureGrammarTextSuggestion[] | undefined =>
|
|
217
|
+
parserKeyword === PURE_GRAMMAR_TEXT_PARSER_NAME
|
|
218
|
+
? [
|
|
219
|
+
{
|
|
220
|
+
text: PURE_GRAMMAR_TEXT_ELEMENT_TYPE_LABEL,
|
|
221
|
+
description: 'plain text',
|
|
222
|
+
insertText: PLAIN_TEXT_SNIPPET,
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
text: PURE_GRAMMAR_TEXT_ELEMENT_TYPE_LABEL,
|
|
226
|
+
description: 'markdown',
|
|
227
|
+
insertText: MARKDOWN_TEXT_SNIPPET,
|
|
228
|
+
},
|
|
229
|
+
]
|
|
230
|
+
: undefined,
|
|
231
|
+
];
|
|
232
|
+
}
|
|
132
233
|
}
|
|
@@ -25,8 +25,8 @@ import {
|
|
|
25
25
|
} from '@finos/legend-graph';
|
|
26
26
|
import { observe_Text } from './action/changeDetection/DSLText_ObserverHelper';
|
|
27
27
|
|
|
28
|
-
const PURE_GRAMMAR_TEXT_PARSER_NAME = 'Text';
|
|
29
|
-
const PURE_GRAMMAR_TEXT_ELEMENT_TYPE_LABEL = 'Text';
|
|
28
|
+
export const PURE_GRAMMAR_TEXT_PARSER_NAME = 'Text';
|
|
29
|
+
export const PURE_GRAMMAR_TEXT_ELEMENT_TYPE_LABEL = 'Text';
|
|
30
30
|
|
|
31
31
|
export class DSLText_PureGraphManagerPlugin extends PureGraphManagerPlugin {
|
|
32
32
|
constructor() {
|
package/tsconfig.json
CHANGED
|
@@ -38,6 +38,8 @@
|
|
|
38
38
|
"files": [
|
|
39
39
|
"./src/DSLText_Extension.ts",
|
|
40
40
|
"./src/index.ts",
|
|
41
|
+
"./src/components/studio/DSLText_CodeSnippets.ts",
|
|
42
|
+
"./src/components/studio/DSLText_LegendStudioDocumentation.ts",
|
|
41
43
|
"./src/graph/DSLText_PureGraphPlugin.ts",
|
|
42
44
|
"./src/graphManager/DSLText_GraphManagerHelper.ts",
|
|
43
45
|
"./src/graphManager/DSLText_PureGraphManagerPlugin.ts",
|