@finos/legend-extension-dsl-text 1.0.34 → 2.0.0
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_GraphManagerHelper.d.ts +2 -1
- package/lib/graphManager/DSLText_GraphManagerHelper.d.ts.map +1 -1
- package/lib/graphManager/DSLText_GraphManagerHelper.js +2 -0
- package/lib/graphManager/DSLText_GraphManagerHelper.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/models/metamodels/pure/model/packageableElements/text/DSLText_Text.d.ts.map +1 -1
- package/lib/models/metamodels/pure/model/packageableElements/text/DSLText_Text.js +1 -0
- package/lib/models/metamodels/pure/model/packageableElements/text/DSLText_Text.js.map +1 -1
- package/lib/models/protocols/pure/DSLText_PureProtocolProcessorPlugin.d.ts.map +1 -1
- package/lib/models/protocols/pure/DSLText_PureProtocolProcessorPlugin.js +5 -5
- package/lib/models/protocols/pure/DSLText_PureProtocolProcessorPlugin.js.map +1 -1
- package/lib/package.json +10 -8
- package/package.json +17 -15
- 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_GraphManagerHelper.ts +8 -1
- package/src/graphManager/DSLText_PureGraphManagerPlugin.ts +2 -2
- package/src/models/metamodels/pure/model/packageableElements/text/DSLText_Text.ts +1 -0
- package/src/models/protocols/pure/DSLText_PureProtocolProcessorPlugin.ts +5 -4
- 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_LegendStudioPlugin.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,WAAW,MAAM,uBAAuB,CAAC;AAChD,OAAO,EACL,kBAAkB,GAgBnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,IAAI,EAAE,MAAM,0EAA0E,CAAC;AAChG,OAAO,EACL,0CAA0C,GAG3C,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,8BAA8B,EAC9B,wCAAwC,GACzC,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACL,oCAAoC,EACpC,6BAA6B,GAC9B,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EACL,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,wB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,6BAA6B;oBACnC,WAAW,EAAE,OAAO;oBACpB,aAAa,EAAE,WAAW,CAAC,gBAAgB,CAAC,WAAW,CAAC,QAAQ,CAC9D,wCAAwC,CAAC,cAAc,CACxD;oBACD,UAAU,EAAE,6BAA6B;iBAC1C;aACF;SACF,CAAC;IACJ,CAAC;IAED,yDAAyD;QACvD,OAAO;YACL,CACE,WAAwB,EACxB,aAAqB,EACoB,EAAE,CAC3C,aAAa,KAAK,6BAA6B;gBAC7C,CAAC,CAAC;oBACE;wBACE,IAAI,EAAE,oCAAoC;wBAC1C,WAAW,EAAE,YAAY;wBACzB,UAAU,EAAE,kBAAkB;qBAC/B;oBACD;wBACE,IAAI,EAAE,oCAAoC;wBAC1C,WAAW,EAAE,UAAU;wBACvB,UAAU,EAAE,qBAAqB;qBAClC;iBACF;gBACH,CAAC,CAAC,SAAS;SAChB,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import type { PureModel } from '@finos/legend-graph';
|
|
16
|
+
import type { BasicModel, PureModel } from '@finos/legend-graph';
|
|
17
17
|
import { Text } from '../models/metamodels/pure/model/packageableElements/text/DSLText_Text';
|
|
18
18
|
export declare const getText: (path: string, graph: PureModel) => Text;
|
|
19
|
+
export declare const getOwnText: (path: string, graph: BasicModel) => Text;
|
|
19
20
|
//# sourceMappingURL=DSLText_GraphManagerHelper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DSLText_GraphManagerHelper.d.ts","sourceRoot":"","sources":["../../src/graphManager/DSLText_GraphManagerHelper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"DSLText_GraphManagerHelper.d.ts","sourceRoot":"","sources":["../../src/graphManager/DSLText_GraphManagerHelper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,EAAE,IAAI,EAAE,MAAM,uEAAuE,CAAC;AAE7F,eAAO,MAAM,OAAO,SAAU,MAAM,SAAS,SAAS,KAAG,IACmB,CAAC;AAE7E,eAAO,MAAM,UAAU,SAAU,MAAM,SAAS,UAAU,KAAG,IAI1D,CAAC"}
|
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
import { guaranteeNonNullable } from '@finos/legend-shared';
|
|
16
17
|
import { Text } from '../models/metamodels/pure/model/packageableElements/text/DSLText_Text';
|
|
17
18
|
export const getText = (path, graph) => graph.getExtensionElement(path, Text, `Can't find text element '${path}'`);
|
|
19
|
+
export const getOwnText = (path, graph) => guaranteeNonNullable(graph.getOwnNullableExtensionElement(path, Text), `Can't find text '${path}'`);
|
|
18
20
|
//# sourceMappingURL=DSLText_GraphManagerHelper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DSLText_GraphManagerHelper.js","sourceRoot":"","sources":["../../src/graphManager/DSLText_GraphManagerHelper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,IAAI,EAAE,MAAM,uEAAuE,CAAC;AAE7F,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,IAAY,EAAE,KAAgB,EAAQ,EAAE,CAC9D,KAAK,CAAC,mBAAmB,CAAC,IAAI,EAAE,IAAI,EAAE,4BAA4B,IAAI,GAAG,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"DSLText_GraphManagerHelper.js","sourceRoot":"","sources":["../../src/graphManager/DSLText_GraphManagerHelper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,MAAM,uEAAuE,CAAC;AAE7F,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,IAAY,EAAE,KAAgB,EAAQ,EAAE,CAC9D,KAAK,CAAC,mBAAmB,CAAC,IAAI,EAAE,IAAI,EAAE,4BAA4B,IAAI,GAAG,CAAC,CAAC;AAE7E,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,IAAY,EAAE,KAAiB,EAAQ,EAAE,CAClE,oBAAoB,CAClB,KAAK,CAAC,8BAA8B,CAAC,IAAI,EAAE,IAAI,CAAC,EAChD,oBAAoB,IAAI,GAAG,CAC5B,CAAC"}
|
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DSLText_Text.d.ts","sourceRoot":"","sources":["../../../../../../../src/models/metamodels/pure/model/packageableElements/text/DSLText_Text.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhE,OAAO,EACL,KAAK,yBAAyB,EAC9B,kBAAkB,EACnB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"DSLText_Text.d.ts","sourceRoot":"","sources":["../../../../../../../src/models/metamodels/pure/model/packageableElements/text/DSLText_Text.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhE,OAAO,EACL,KAAK,yBAAyB,EAC9B,kBAAkB,EACnB,MAAM,qBAAqB,CAAC;AAG7B,oBAAY,SAAS;IACnB,UAAU,cAAc;IACxB,QAAQ,aAAa;CACtB;AAED,qBAAa,IAAK,SAAQ,kBAAmB,YAAW,QAAQ;IAC9D,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;gBAEJ,IAAI,EAAE,MAAM;IAMxB,cAAuB,gBAAgB,IAAI,MAAM,CAOhD;IAED,gCAAgC,CAAC,CAAC,EAChC,OAAO,EAAE,yBAAyB,CAAC,CAAC,CAAC,GACpC,CAAC;CAGL"}
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
import { hashArray } from '@finos/legend-shared';
|
|
17
17
|
import { TEXT_HASH_STRUCTURE } from '../../../../../DSLText_ModelUtils';
|
|
18
18
|
import { PackageableElement, } from '@finos/legend-graph';
|
|
19
|
+
// TODO: to be moved out of metamodel
|
|
19
20
|
export var TEXT_TYPE;
|
|
20
21
|
(function (TEXT_TYPE) {
|
|
21
22
|
TEXT_TYPE["PLAIN_TEXT"] = "plainText";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DSLText_Text.js","sourceRoot":"","sources":["../../../../../../../src/models/metamodels/pure/model/packageableElements/text/DSLText_Text.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,SAAS,EAAiB,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAEL,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAE7B,MAAM,CAAN,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,qCAAwB,CAAA;IACxB,kCAAqB,CAAA;AACvB,CAAC,EAHW,SAAS,KAAT,SAAS,QAGpB;AAED,MAAM,OAAO,IAAK,SAAQ,kBAAkB;IAC1C,IAAI,CAAY;IAChB,OAAO,CAAS;IAEhB,YAAY,IAAY;QACtB,KAAK,CAAC,IAAI,CAAC,CAAC;QACZ,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC,UAAU,CAAC;QACjC,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;IACpB,CAAC;IAED,IAAuB,gBAAgB;QACrC,OAAO,SAAS,CAAC;YACf,mBAAmB,CAAC,IAAI;YACxB,IAAI,CAAC,IAAI;YACT,IAAI,CAAC,IAAI;YACT,IAAI,CAAC,OAAO;SACb,CAAC,CAAC;IACL,CAAC;IAED,gCAAgC,CAC9B,OAAqC;QAErC,OAAO,OAAO,CAAC,wBAAwB,CAAC,IAAI,CAAC,CAAC;IAChD,CAAC;CACF"}
|
|
1
|
+
{"version":3,"file":"DSLText_Text.js","sourceRoot":"","sources":["../../../../../../../src/models/metamodels/pure/model/packageableElements/text/DSLText_Text.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,SAAS,EAAiB,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAEL,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAE7B,qCAAqC;AACrC,MAAM,CAAN,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,qCAAwB,CAAA;IACxB,kCAAqB,CAAA;AACvB,CAAC,EAHW,SAAS,KAAT,SAAS,QAGpB;AAED,MAAM,OAAO,IAAK,SAAQ,kBAAkB;IAC1C,IAAI,CAAY;IAChB,OAAO,CAAS;IAEhB,YAAY,IAAY;QACtB,KAAK,CAAC,IAAI,CAAC,CAAC;QACZ,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC,UAAU,CAAC;QACjC,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;IACpB,CAAC;IAED,IAAuB,gBAAgB;QACrC,OAAO,SAAS,CAAC;YACf,mBAAmB,CAAC,IAAI;YACxB,IAAI,CAAC,IAAI;YACT,IAAI,CAAC,IAAI;YACT,IAAI,CAAC,OAAO;SACb,CAAC,CAAC;IACL,CAAC;IAED,gCAAgC,CAC9B,OAAqC;QAErC,OAAO,OAAO,CAAC,wBAAwB,CAAC,IAAI,CAAC,CAAC;IAChD,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DSLText_PureProtocolProcessorPlugin.d.ts","sourceRoot":"","sources":["../../../../src/models/protocols/pure/DSLText_PureProtocolProcessorPlugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAmBH,OAAO,EAEL,KAAK,sCAAsC,EAC3C,KAAK,8BAA8B,EACnC,KAAK,4BAA4B,EACjC,KAAK,qBAAqB,EAG1B,KAAK,qBAAqB,EAC1B,2BAA2B,EAC3B,iBAAiB,
|
|
1
|
+
{"version":3,"file":"DSLText_PureProtocolProcessorPlugin.d.ts","sourceRoot":"","sources":["../../../../src/models/protocols/pure/DSLText_PureProtocolProcessorPlugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAmBH,OAAO,EAEL,KAAK,sCAAsC,EAC3C,KAAK,8BAA8B,EACnC,KAAK,4BAA4B,EACjC,KAAK,qBAAqB,EAG1B,KAAK,qBAAqB,EAC1B,2BAA2B,EAC3B,iBAAiB,EAGlB,MAAM,qBAAqB,CAAC;AAI7B,qBAAa,mCAAoC,SAAQ,2BAA2B;;IAQzE,0BAA0B,IAAI,iBAAiB,CAAC,qBAAqB,CAAC,EAAE;IAyCxE,uCAAuC,IAAI,sCAAsC,EAAE;IAWnF,qCAAqC,IAAI,4BAA4B,EAAE;IAcvE,uCAAuC,IAAI,8BAA8B,EAAE;IAc3E,8BAA8B,IAAI,qBAAqB,EAAE;CAmBnE"}
|
|
@@ -18,9 +18,9 @@ import { V1_Text } from './v1/model/packageableElements/text/V1_DSLText_Text';
|
|
|
18
18
|
import { guaranteeNonNullable, assertType, } from '@finos/legend-shared';
|
|
19
19
|
import { deserialize, serialize } from 'serializr';
|
|
20
20
|
import { V1_textModelSchema, V1_TEXT_ELEMENT_PROTOCOL_TYPE, } from './v1/transformation/pureProtocol/V1_DSLText_ProtocolHelper';
|
|
21
|
-
import {
|
|
21
|
+
import { getOwnText } from '../../../graphManager/DSLText_GraphManagerHelper';
|
|
22
22
|
import { Text, TEXT_TYPE, } from '../../metamodels/pure/model/packageableElements/text/DSLText_Text';
|
|
23
|
-
import { PureProtocolProcessorPlugin, V1_ElementBuilder, V1_initPackageableElement, } from '@finos/legend-graph';
|
|
23
|
+
import { PureProtocolProcessorPlugin, V1_ElementBuilder, V1_initPackageableElement, V1_buildFullPath, } from '@finos/legend-graph';
|
|
24
24
|
const TEXT_ELEMENT_CLASSIFIER_PATH = 'meta::pure::metamodel::text::Text';
|
|
25
25
|
export class DSLText_PureProtocolProcessorPlugin extends PureProtocolProcessorPlugin {
|
|
26
26
|
constructor() {
|
|
@@ -34,14 +34,14 @@ export class DSLText_PureProtocolProcessorPlugin extends PureProtocolProcessorPl
|
|
|
34
34
|
firstPass: (elementProtocol, context) => {
|
|
35
35
|
assertType(elementProtocol, V1_Text);
|
|
36
36
|
const element = new Text(elementProtocol.name);
|
|
37
|
-
const path =
|
|
37
|
+
const path = V1_buildFullPath(elementProtocol.package, elementProtocol.name);
|
|
38
38
|
context.currentSubGraph.setOwnElementInExtension(path, element, Text);
|
|
39
39
|
return element;
|
|
40
40
|
},
|
|
41
41
|
secondPass: (elementProtocol, context) => {
|
|
42
42
|
assertType(elementProtocol, V1_Text);
|
|
43
|
-
const path =
|
|
44
|
-
const element =
|
|
43
|
+
const path = V1_buildFullPath(elementProtocol.package, elementProtocol.name);
|
|
44
|
+
const element = getOwnText(path, context.currentSubGraph);
|
|
45
45
|
element.type =
|
|
46
46
|
Object.values(TEXT_TYPE).find((type) => type === elementProtocol.type) ?? TEXT_TYPE.PLAIN_TEXT;
|
|
47
47
|
element.content = guaranteeNonNullable(elementProtocol.content, `Text element 'content' field is missing`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DSLText_PureProtocolProcessorPlugin.js","sourceRoot":"","sources":["../../../../src/models/protocols/pure/DSLText_PureProtocolProcessorPlugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,WAAW,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,qDAAqD,CAAC;AAC9E,OAAO,EAEL,oBAAoB,EACpB,UAAU,GACX,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EACL,kBAAkB,EAClB,6BAA6B,GAC9B,MAAM,4DAA4D,CAAC;AACpE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"DSLText_PureProtocolProcessorPlugin.js","sourceRoot":"","sources":["../../../../src/models/protocols/pure/DSLText_PureProtocolProcessorPlugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,WAAW,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,qDAAqD,CAAC;AAC9E,OAAO,EAEL,oBAAoB,EACpB,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AG,IAAI,OAAO,EAAE,CAAC;oBAC/B,yBAAyB,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;oBAC/C,QAAQ,CAAC,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC;oBAC/B,QAAQ,CAAC,OAAO,GAAG,SAAS,CAAC,OAAO,EAAE,QAAQ,IAAI,EAAE,CAAC;oBACrD,QAAQ,CAAC,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC;oBACrC,QAAQ,CAAC,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC;oBAC/B,OAAO,QAAQ,CAAC;iBACjB;gBACD,OAAO,SAAS,CAAC;YACnB,CAAC;SACF,CAAC;IACJ,CAAC;CACF"}
|
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.0",
|
|
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,22 +49,21 @@
|
|
|
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
|
-
"monaco-editor": "0.33.0",
|
|
53
55
|
"react": "17.0.2",
|
|
54
56
|
"serializr": "2.0.5"
|
|
55
57
|
},
|
|
56
58
|
"devDependencies": {
|
|
57
59
|
"@finos/legend-dev-utils": "workspace:*",
|
|
58
60
|
"cross-env": "7.0.3",
|
|
59
|
-
"eslint": "8.
|
|
60
|
-
"jest": "
|
|
61
|
+
"eslint": "8.14.0",
|
|
62
|
+
"jest": "28.0.3",
|
|
61
63
|
"npm-run-all": "4.1.5",
|
|
62
64
|
"rimraf": "3.0.2",
|
|
63
|
-
"sass": "1.
|
|
64
|
-
"typescript": "4.6.
|
|
65
|
+
"sass": "1.51.0",
|
|
66
|
+
"typescript": "4.6.4"
|
|
65
67
|
},
|
|
66
68
|
"peerDependencies": {
|
|
67
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.0",
|
|
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,28 +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.0",
|
|
47
|
+
"@finos/legend-art": "1.0.0",
|
|
48
|
+
"@finos/legend-graph": "6.0.0",
|
|
49
|
+
"@finos/legend-model-storage": "1.0.0",
|
|
50
|
+
"@finos/legend-shared": "2.0.0",
|
|
51
|
+
"@finos/legend-studio": "9.0.0",
|
|
52
|
+
"@types/react": "17.0.44",
|
|
50
53
|
"mobx": "6.5.0",
|
|
51
54
|
"mobx-react-lite": "3.3.0",
|
|
52
|
-
"monaco-editor": "0.33.0",
|
|
53
55
|
"react": "17.0.2",
|
|
54
56
|
"serializr": "2.0.5"
|
|
55
57
|
},
|
|
56
58
|
"devDependencies": {
|
|
57
|
-
"@finos/legend-dev-utils": "0.
|
|
59
|
+
"@finos/legend-dev-utils": "1.0.0",
|
|
58
60
|
"cross-env": "7.0.3",
|
|
59
|
-
"eslint": "8.
|
|
60
|
-
"jest": "
|
|
61
|
+
"eslint": "8.14.0",
|
|
62
|
+
"jest": "28.0.3",
|
|
61
63
|
"npm-run-all": "4.1.5",
|
|
62
64
|
"rimraf": "3.0.2",
|
|
63
|
-
"sass": "1.
|
|
64
|
-
"typescript": "4.6.
|
|
65
|
+
"sass": "1.51.0",
|
|
66
|
+
"typescript": "4.6.4"
|
|
65
67
|
},
|
|
66
68
|
"peerDependencies": {
|
|
67
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
|
}
|
|
@@ -14,8 +14,15 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import type { PureModel } from '@finos/legend-graph';
|
|
17
|
+
import type { BasicModel, PureModel } from '@finos/legend-graph';
|
|
18
|
+
import { guaranteeNonNullable } from '@finos/legend-shared';
|
|
18
19
|
import { Text } from '../models/metamodels/pure/model/packageableElements/text/DSLText_Text';
|
|
19
20
|
|
|
20
21
|
export const getText = (path: string, graph: PureModel): Text =>
|
|
21
22
|
graph.getExtensionElement(path, Text, `Can't find text element '${path}'`);
|
|
23
|
+
|
|
24
|
+
export const getOwnText = (path: string, graph: BasicModel): Text =>
|
|
25
|
+
guaranteeNonNullable(
|
|
26
|
+
graph.getOwnNullableExtensionElement(path, Text),
|
|
27
|
+
`Can't find text '${path}'`,
|
|
28
|
+
);
|
|
@@ -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() {
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
V1_textModelSchema,
|
|
27
27
|
V1_TEXT_ELEMENT_PROTOCOL_TYPE,
|
|
28
28
|
} from './v1/transformation/pureProtocol/V1_DSLText_ProtocolHelper';
|
|
29
|
-
import {
|
|
29
|
+
import { getOwnText } from '../../../graphManager/DSLText_GraphManagerHelper';
|
|
30
30
|
import {
|
|
31
31
|
Text,
|
|
32
32
|
TEXT_TYPE,
|
|
@@ -43,6 +43,7 @@ import {
|
|
|
43
43
|
PureProtocolProcessorPlugin,
|
|
44
44
|
V1_ElementBuilder,
|
|
45
45
|
V1_initPackageableElement,
|
|
46
|
+
V1_buildFullPath,
|
|
46
47
|
} from '@finos/legend-graph';
|
|
47
48
|
|
|
48
49
|
const TEXT_ELEMENT_CLASSIFIER_PATH = 'meta::pure::metamodel::text::Text';
|
|
@@ -66,7 +67,7 @@ export class DSLText_PureProtocolProcessorPlugin extends PureProtocolProcessorPl
|
|
|
66
67
|
): PackageableElement => {
|
|
67
68
|
assertType(elementProtocol, V1_Text);
|
|
68
69
|
const element = new Text(elementProtocol.name);
|
|
69
|
-
const path =
|
|
70
|
+
const path = V1_buildFullPath(
|
|
70
71
|
elementProtocol.package,
|
|
71
72
|
elementProtocol.name,
|
|
72
73
|
);
|
|
@@ -78,11 +79,11 @@ export class DSLText_PureProtocolProcessorPlugin extends PureProtocolProcessorPl
|
|
|
78
79
|
context: V1_GraphBuilderContext,
|
|
79
80
|
): void => {
|
|
80
81
|
assertType(elementProtocol, V1_Text);
|
|
81
|
-
const path =
|
|
82
|
+
const path = V1_buildFullPath(
|
|
82
83
|
elementProtocol.package,
|
|
83
84
|
elementProtocol.name,
|
|
84
85
|
);
|
|
85
|
-
const element =
|
|
86
|
+
const element = getOwnText(path, context.currentSubGraph);
|
|
86
87
|
element.type =
|
|
87
88
|
Object.values(TEXT_TYPE).find(
|
|
88
89
|
(type) => type === elementProtocol.type,
|
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",
|