@finos/legend-extension-dsl-text 2.0.2 → 3.0.1
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/DSLText_Extension.d.ts +0 -2
- package/lib/DSLText_Extension.d.ts.map +1 -1
- package/lib/DSLText_Extension.js +8 -9
- package/lib/DSLText_Extension.js.map +1 -1
- package/lib/components/studio/DSLText_LegendStudioDocumentation.d.ts +4 -14
- package/lib/components/studio/DSLText_LegendStudioDocumentation.d.ts.map +1 -1
- package/lib/components/studio/DSLText_LegendStudioDocumentation.js +8 -6
- package/lib/components/studio/DSLText_LegendStudioDocumentation.js.map +1 -1
- package/lib/components/studio/DSLText_LegendStudioPlugin.d.ts.map +1 -1
- package/lib/components/studio/DSLText_LegendStudioPlugin.js +11 -10
- package/lib/components/studio/DSLText_LegendStudioPlugin.js.map +1 -1
- package/lib/components/studio/TextElementEditor.d.ts +1 -1
- package/lib/components/studio/TextElementEditor.d.ts.map +1 -1
- package/lib/components/studio/TextElementEditor.js +5 -6
- package/lib/components/studio/TextElementEditor.js.map +1 -1
- package/lib/graph/DSLText_PureGraphPlugin.js +1 -1
- package/lib/graph/DSLText_PureGraphPlugin.js.map +1 -1
- package/lib/graphManager/DSLText_GraphManagerHelper.d.ts +1 -1
- package/lib/graphManager/DSLText_GraphManagerHelper.d.ts.map +1 -1
- package/lib/graphManager/DSLText_GraphManagerHelper.js +1 -1
- package/lib/graphManager/DSLText_GraphManagerHelper.js.map +1 -1
- package/lib/graphManager/DSLText_PureGraphManagerPlugin.js +2 -2
- package/lib/graphManager/DSLText_PureGraphManagerPlugin.js.map +1 -1
- package/lib/graphManager/action/changeDetection/DSLText_ObserverHelper.d.ts +1 -1
- package/lib/graphManager/action/changeDetection/DSLText_ObserverHelper.d.ts.map +1 -1
- package/lib/helper/DSLText_Helper.d.ts +22 -0
- package/lib/helper/DSLText_Helper.d.ts.map +1 -0
- package/lib/helper/DSLText_Helper.js +28 -0
- package/lib/helper/DSLText_Helper.js.map +1 -0
- package/lib/index.css +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib/models/DSLText_ModelUtils.js +1 -1
- package/lib/models/DSLText_ModelUtils.js.map +1 -1
- package/lib/models/metamodels/pure/model/packageableElements/text/DSLText_Text.d.ts +1 -6
- 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 -12
- 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 +6 -7
- package/lib/models/protocols/pure/DSLText_PureProtocolProcessorPlugin.js.map +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/text/V1_DSLText_Text.js +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/text/V1_DSLText_Text.js.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureGraph/V1_DSLText_GraphBuilderHelper.d.ts +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureGraph/V1_DSLText_GraphBuilderHelper.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureGraph/V1_DSLText_GraphBuilderHelper.js +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureGraph/V1_DSLText_GraphBuilderHelper.js.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLText_ProtocolHelper.d.ts +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLText_ProtocolHelper.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLText_ProtocolHelper.js +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLText_ProtocolHelper.js.map +1 -1
- package/lib/package.json +11 -10
- package/lib/stores/studio/DSLText_GraphModifierHelper.d.ts +2 -2
- package/lib/stores/studio/DSLText_GraphModifierHelper.d.ts.map +1 -1
- package/lib/stores/studio/DSLText_GraphModifierHelper.js.map +1 -1
- package/lib/stores/studio/TextEditorState.d.ts +1 -1
- package/lib/stores/studio/TextEditorState.d.ts.map +1 -1
- package/lib/stores/studio/TextEditorState.js +1 -1
- package/lib/stores/studio/TextEditorState.js.map +1 -1
- package/package.json +18 -17
- package/src/DSLText_Extension.ts +8 -11
- package/src/components/studio/DSLText_LegendStudioDocumentation.ts +13 -6
- package/src/components/studio/DSLText_LegendStudioPlugin.tsx +15 -13
- package/src/components/studio/TextElementEditor.tsx +7 -12
- package/src/graph/DSLText_PureGraphPlugin.ts +1 -1
- package/src/graphManager/DSLText_GraphManagerHelper.ts +1 -1
- package/src/graphManager/DSLText_PureGraphManagerPlugin.ts +2 -2
- package/src/graphManager/action/changeDetection/DSLText_ObserverHelper.ts +1 -1
- package/src/helper/DSLText_Helper.ts +30 -0
- package/src/index.ts +2 -2
- package/src/models/metamodels/pure/model/packageableElements/text/DSLText_Text.ts +3 -15
- package/src/models/protocols/pure/DSLText_PureProtocolProcessorPlugin.ts +6 -12
- package/src/models/protocols/pure/v1/model/packageableElements/text/V1_DSLText_Text.ts +1 -1
- package/src/models/protocols/pure/v1/transformation/pureGraph/V1_DSLText_GraphBuilderHelper.ts +2 -2
- package/src/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLText_ProtocolHelper.ts +1 -1
- package/src/stores/studio/DSLText_GraphModifierHelper.ts +3 -5
- package/src/stores/studio/TextEditorState.ts +1 -1
- package/tsconfig.json +4 -8
- package/tsconfig.package.json +1 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"V1_DSLText_Text.js","sourceRoot":"","sources":["../../../../../../../../src/models/protocols/pure/v1/model/packageableElements/text/V1_DSLText_Text.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,SAAS,EAAiB,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"V1_DSLText_Text.js","sourceRoot":"","sources":["../../../../../../../../src/models/protocols/pure/v1/model/packageableElements/text/V1_DSLText_Text.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,SAAS,EAAiB,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAC9E,OAAO,EAEL,qBAAqB,GACtB,MAAM,qBAAqB,CAAC;AAE7B,MAAM,OAAO,OAAQ,SAAQ,qBAAqB;IAChD,IAAI,CAAU;IACd,OAAO,CAAU;IAEjB,IAAa,QAAQ;QACnB,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,OAAwC;QAExC,OAAO,OAAO,CAAC,wBAAwB,CAAC,IAAI,CAAC,CAAC;IAChD,CAAC;CACF"}
|
package/lib/models/protocols/pure/v1/transformation/pureGraph/V1_DSLText_GraphBuilderHelper.d.ts
CHANGED
|
@@ -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 type { Text } from '../../../../../metamodels/pure/model/packageableElements/text/DSLText_Text';
|
|
16
|
+
import type { Text } from '../../../../../metamodels/pure/model/packageableElements/text/DSLText_Text.js';
|
|
17
17
|
import type { PackageableElementImplicitReference, V1_GraphBuilderContext } from '@finos/legend-graph';
|
|
18
18
|
export declare const V1_resolveText: (path: string, context: V1_GraphBuilderContext) => PackageableElementImplicitReference<Text>;
|
|
19
19
|
//# sourceMappingURL=V1_DSLText_GraphBuilderHelper.d.ts.map
|
package/lib/models/protocols/pure/v1/transformation/pureGraph/V1_DSLText_GraphBuilderHelper.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"V1_DSLText_GraphBuilderHelper.d.ts","sourceRoot":"","sources":["../../../../../../../src/models/protocols/pure/v1/transformation/pureGraph/V1_DSLText_GraphBuilderHelper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"V1_DSLText_GraphBuilderHelper.d.ts","sourceRoot":"","sources":["../../../../../../../src/models/protocols/pure/v1/transformation/pureGraph/V1_DSLText_GraphBuilderHelper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,+EAA+E,CAAC;AAC1G,OAAO,KAAK,EACV,mCAAmC,EACnC,sBAAsB,EACvB,MAAM,qBAAqB,CAAC;AAE7B,eAAO,MAAM,cAAc,SACnB,MAAM,WACH,sBAAsB,KAC9B,oCAAoC,IAAI,CAGxC,CAAC"}
|
package/lib/models/protocols/pure/v1/transformation/pureGraph/V1_DSLText_GraphBuilderHelper.js
CHANGED
|
@@ -13,6 +13,6 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { getText } from '../../../../../../graphManager/DSLText_GraphManagerHelper';
|
|
16
|
+
import { getText } from '../../../../../../graphManager/DSLText_GraphManagerHelper.js';
|
|
17
17
|
export const V1_resolveText = (path, context) => context.createImplicitPackageableElementReference(path, (_path) => getText(_path, context.graph));
|
|
18
18
|
//# sourceMappingURL=V1_DSLText_GraphBuilderHelper.js.map
|
package/lib/models/protocols/pure/v1/transformation/pureGraph/V1_DSLText_GraphBuilderHelper.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"V1_DSLText_GraphBuilderHelper.js","sourceRoot":"","sources":["../../../../../../../src/models/protocols/pure/v1/transformation/pureGraph/V1_DSLText_GraphBuilderHelper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"V1_DSLText_GraphBuilderHelper.js","sourceRoot":"","sources":["../../../../../../../src/models/protocols/pure/v1/transformation/pureGraph/V1_DSLText_GraphBuilderHelper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,8DAA8D,CAAC;AAOvF,MAAM,CAAC,MAAM,cAAc,GAAG,CAC5B,IAAY,EACZ,OAA+B,EACY,EAAE,CAC7C,OAAO,CAAC,yCAAyC,CAAC,IAAI,EAAE,CAAC,KAAa,EAAE,EAAE,CACxE,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,CAC9B,CAAC"}
|
package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLText_ProtocolHelper.d.ts
CHANGED
|
@@ -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 { V1_Text } from '../../model/packageableElements/text/V1_DSLText_Text';
|
|
16
|
+
import { V1_Text } from '../../model/packageableElements/text/V1_DSLText_Text.js';
|
|
17
17
|
export declare const V1_TEXT_ELEMENT_PROTOCOL_TYPE = "text";
|
|
18
18
|
export declare const V1_textModelSchema: import("serializr").ModelSchema<V1_Text>;
|
|
19
19
|
//# sourceMappingURL=V1_DSLText_ProtocolHelper.d.ts.map
|
package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLText_ProtocolHelper.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"V1_DSLText_ProtocolHelper.d.ts","sourceRoot":"","sources":["../../../../../../../src/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLText_ProtocolHelper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"V1_DSLText_ProtocolHelper.d.ts","sourceRoot":"","sources":["../../../../../../../src/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLText_ProtocolHelper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,EAAE,OAAO,EAAE,MAAM,yDAAyD,CAAC;AAElF,eAAO,MAAM,6BAA6B,SAAS,CAAC;AAEpD,eAAO,MAAM,kBAAkB,0CAM7B,CAAC"}
|
package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLText_ProtocolHelper.js
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { usingConstantValueSchema } from '@finos/legend-shared';
|
|
17
17
|
import { createModelSchema, primitive } from 'serializr';
|
|
18
|
-
import { V1_Text } from '../../model/packageableElements/text/V1_DSLText_Text';
|
|
18
|
+
import { V1_Text } from '../../model/packageableElements/text/V1_DSLText_Text.js';
|
|
19
19
|
export const V1_TEXT_ELEMENT_PROTOCOL_TYPE = 'text';
|
|
20
20
|
export const V1_textModelSchema = createModelSchema(V1_Text, {
|
|
21
21
|
_type: usingConstantValueSchema(V1_TEXT_ELEMENT_PROTOCOL_TYPE),
|
package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLText_ProtocolHelper.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"V1_DSLText_ProtocolHelper.js","sourceRoot":"","sources":["../../../../../../../src/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLText_ProtocolHelper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"V1_DSLText_ProtocolHelper.js","sourceRoot":"","sources":["../../../../../../../src/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLText_ProtocolHelper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,yDAAyD,CAAC;AAElF,MAAM,CAAC,MAAM,6BAA6B,GAAG,MAAM,CAAC;AAEpD,MAAM,CAAC,MAAM,kBAAkB,GAAG,iBAAiB,CAAC,OAAO,EAAE;IAC3D,KAAK,EAAE,wBAAwB,CAAC,6BAA6B,CAAC;IAC9D,OAAO,EAAE,SAAS,EAAE;IACpB,IAAI,EAAE,SAAS,EAAE;IACjB,OAAO,EAAE,SAAS,EAAE;IACpB,IAAI,EAAE,SAAS,EAAE;CAClB,CAAC,CAAC"}
|
package/lib/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@finos/legend-extension-dsl-text",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "Legend extension for Text DSL",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"legend",
|
|
@@ -49,24 +49,25 @@
|
|
|
49
49
|
"@finos/legend-model-storage": "workspace:*",
|
|
50
50
|
"@finos/legend-shared": "workspace:*",
|
|
51
51
|
"@finos/legend-studio": "workspace:*",
|
|
52
|
-
"@types/react": "
|
|
53
|
-
"mobx": "6.
|
|
54
|
-
"mobx-react-lite": "3.
|
|
55
|
-
"react": "
|
|
52
|
+
"@types/react": "18.0.14",
|
|
53
|
+
"mobx": "6.6.0",
|
|
54
|
+
"mobx-react-lite": "3.4.0",
|
|
55
|
+
"react": "18.2.0",
|
|
56
56
|
"serializr": "2.0.5"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@finos/legend-dev-utils": "workspace:*",
|
|
60
|
+
"@jest/globals": "28.1.1",
|
|
60
61
|
"cross-env": "7.0.3",
|
|
61
|
-
"eslint": "8.
|
|
62
|
-
"jest": "28.
|
|
62
|
+
"eslint": "8.18.0",
|
|
63
|
+
"jest": "28.1.1",
|
|
63
64
|
"npm-run-all": "4.1.5",
|
|
64
65
|
"rimraf": "3.0.2",
|
|
65
|
-
"sass": "1.
|
|
66
|
-
"typescript": "4.
|
|
66
|
+
"sass": "1.52.3",
|
|
67
|
+
"typescript": "4.7.4"
|
|
67
68
|
},
|
|
68
69
|
"peerDependencies": {
|
|
69
|
-
"react": "^
|
|
70
|
+
"react": "^18.0.0"
|
|
70
71
|
},
|
|
71
72
|
"publishConfig": {
|
|
72
73
|
"directory": "build/publishContent"
|
|
@@ -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 type {
|
|
17
|
-
export declare const text_setType: (text: Text, type:
|
|
16
|
+
import type { Text } from '../../models/metamodels/pure/model/packageableElements/text/DSLText_Text.js';
|
|
17
|
+
export declare const text_setType: (text: Text, type: string) => void;
|
|
18
18
|
export declare const text_setContent: (text: Text, content: string) => void;
|
|
19
19
|
//# sourceMappingURL=DSLText_GraphModifierHelper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DSLText_GraphModifierHelper.d.ts","sourceRoot":"","sources":["../../../src/stores/studio/DSLText_GraphModifierHelper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"DSLText_GraphModifierHelper.d.ts","sourceRoot":"","sources":["../../../src/stores/studio/DSLText_GraphModifierHelper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,6EAA6E,CAAC;AAExG,eAAO,MAAM,YAAY,SAAiB,IAAI,QAAQ,MAAM,KAAG,IAE7D,CAAC;AAEH,eAAO,MAAM,eAAe,SAAiB,IAAI,WAAW,MAAM,KAAG,IAEnE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DSLText_GraphModifierHelper.js","sourceRoot":"","sources":["../../../src/stores/studio/DSLText_GraphModifierHelper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"DSLText_GraphModifierHelper.js","sourceRoot":"","sources":["../../../src/stores/studio/DSLText_GraphModifierHelper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAG9B,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,CAAC,IAAU,EAAE,IAAY,EAAQ,EAAE;IACpE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;AACnB,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,CAAC,IAAU,EAAE,OAAe,EAAQ,EAAE;IAC1E,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;AACzB,CAAC,CAAC,CAAC"}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { type EditorStore, ElementEditorState } from '@finos/legend-studio';
|
|
17
17
|
import type { PackageableElement } from '@finos/legend-graph';
|
|
18
|
-
import { Text } from '../../models/metamodels/pure/model/packageableElements/text/DSLText_Text';
|
|
18
|
+
import { Text } from '../../models/metamodels/pure/model/packageableElements/text/DSLText_Text.js';
|
|
19
19
|
export declare class TextEditorState extends ElementEditorState {
|
|
20
20
|
constructor(editorStore: EditorStore, element: PackageableElement);
|
|
21
21
|
get textElement(): Text;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextEditorState.d.ts","sourceRoot":"","sources":["../../../src/stores/studio/TextEditorState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,EAAE,KAAK,WAAW,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC5E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"TextEditorState.d.ts","sourceRoot":"","sources":["../../../src/stores/studio/TextEditorState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,EAAE,KAAK,WAAW,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC5E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,MAAM,6EAA6E,CAAC;AAEnG,qBAAa,eAAgB,SAAQ,kBAAkB;gBACzC,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,kBAAkB;IASjE,IAAI,WAAW,IAAI,IAAI,CAMtB;IAED,SAAS,CACP,UAAU,EAAE,kBAAkB,EAC9B,WAAW,EAAE,WAAW,GACvB,kBAAkB;CAItB"}
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
import { computed, action, makeObservable } from 'mobx';
|
|
17
17
|
import { guaranteeType } from '@finos/legend-shared';
|
|
18
18
|
import { ElementEditorState } from '@finos/legend-studio';
|
|
19
|
-
import { Text } from '../../models/metamodels/pure/model/packageableElements/text/DSLText_Text';
|
|
19
|
+
import { Text } from '../../models/metamodels/pure/model/packageableElements/text/DSLText_Text.js';
|
|
20
20
|
export class TextEditorState extends ElementEditorState {
|
|
21
21
|
constructor(editorStore, element) {
|
|
22
22
|
super(editorStore, element);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextEditorState.js","sourceRoot":"","sources":["../../../src/stores/studio/TextEditorState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAoB,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE5E,OAAO,EAAE,IAAI,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"TextEditorState.js","sourceRoot":"","sources":["../../../src/stores/studio/TextEditorState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAoB,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE5E,OAAO,EAAE,IAAI,EAAE,MAAM,6EAA6E,CAAC;AAEnG,MAAM,OAAO,eAAgB,SAAQ,kBAAkB;IACrD,YAAY,WAAwB,EAAE,OAA2B;QAC/D,KAAK,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QAE5B,cAAc,CAAC,IAAI,EAAE;YACnB,WAAW,EAAE,QAAQ;YACrB,SAAS,EAAE,MAAM;SAClB,CAAC,CAAC;IACL,CAAC;IAED,IAAI,WAAW;QACb,OAAO,aAAa,CAClB,IAAI,CAAC,OAAO,EACZ,IAAI,EACJ,iEAAiE,CAClE,CAAC;IACJ,CAAC;IAED,SAAS,CACP,UAA8B,EAC9B,WAAwB;QAExB,MAAM,eAAe,GAAG,IAAI,eAAe,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;QACrE,OAAO,eAAe,CAAC;IACzB,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@finos/legend-extension-dsl-text",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "Legend extension for Text DSL",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"legend",
|
|
@@ -43,30 +43,31 @@
|
|
|
43
43
|
"test:watch": "jest --watch"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@finos/legend-application": "
|
|
47
|
-
"@finos/legend-art": "
|
|
48
|
-
"@finos/legend-graph": "
|
|
49
|
-
"@finos/legend-model-storage": "
|
|
50
|
-
"@finos/legend-shared": "
|
|
51
|
-
"@finos/legend-studio": "
|
|
52
|
-
"@types/react": "
|
|
53
|
-
"mobx": "6.
|
|
54
|
-
"mobx-react-lite": "3.
|
|
55
|
-
"react": "
|
|
46
|
+
"@finos/legend-application": "4.0.1",
|
|
47
|
+
"@finos/legend-art": "2.0.1",
|
|
48
|
+
"@finos/legend-graph": "8.0.1",
|
|
49
|
+
"@finos/legend-model-storage": "2.0.1",
|
|
50
|
+
"@finos/legend-shared": "3.0.1",
|
|
51
|
+
"@finos/legend-studio": "10.1.0",
|
|
52
|
+
"@types/react": "18.0.14",
|
|
53
|
+
"mobx": "6.6.0",
|
|
54
|
+
"mobx-react-lite": "3.4.0",
|
|
55
|
+
"react": "18.2.0",
|
|
56
56
|
"serializr": "2.0.5"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@finos/legend-dev-utils": "
|
|
59
|
+
"@finos/legend-dev-utils": "2.0.1",
|
|
60
|
+
"@jest/globals": "28.1.1",
|
|
60
61
|
"cross-env": "7.0.3",
|
|
61
|
-
"eslint": "8.
|
|
62
|
-
"jest": "28.
|
|
62
|
+
"eslint": "8.18.0",
|
|
63
|
+
"jest": "28.1.1",
|
|
63
64
|
"npm-run-all": "4.1.5",
|
|
64
65
|
"rimraf": "3.0.2",
|
|
65
|
-
"sass": "1.
|
|
66
|
-
"typescript": "4.
|
|
66
|
+
"sass": "1.52.3",
|
|
67
|
+
"typescript": "4.7.4"
|
|
67
68
|
},
|
|
68
69
|
"peerDependencies": {
|
|
69
|
-
"react": "^
|
|
70
|
+
"react": "^18.0.0"
|
|
70
71
|
},
|
|
71
72
|
"publishConfig": {
|
|
72
73
|
"directory": "build/publishContent"
|
package/src/DSLText_Extension.ts
CHANGED
|
@@ -16,19 +16,16 @@
|
|
|
16
16
|
|
|
17
17
|
import packageJson from '../package.json';
|
|
18
18
|
import { AbstractPreset } from '@finos/legend-shared';
|
|
19
|
-
import { DSLText_PureGraphManagerPlugin } from './graphManager/DSLText_PureGraphManagerPlugin';
|
|
20
|
-
import { DSLText_PureProtocolProcessorPlugin } from './models/protocols/pure/DSLText_PureProtocolProcessorPlugin';
|
|
21
|
-
import
|
|
22
|
-
import { DSLText_PureGraphPlugin } from './graph/DSLText_PureGraphPlugin';
|
|
19
|
+
import { DSLText_PureGraphManagerPlugin } from './graphManager/DSLText_PureGraphManagerPlugin.js';
|
|
20
|
+
import { DSLText_PureProtocolProcessorPlugin } from './models/protocols/pure/DSLText_PureProtocolProcessorPlugin.js';
|
|
21
|
+
import { DSLText_PureGraphPlugin } from './graph/DSLText_PureGraphPlugin.js';
|
|
23
22
|
|
|
24
23
|
export class DSLText_GraphPreset extends AbstractPreset {
|
|
25
24
|
constructor() {
|
|
26
|
-
super(packageJson.extensions.graphPreset, packageJson.version
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
new DSLText_PureGraphManagerPlugin().install(pluginManager);
|
|
32
|
-
new DSLText_PureProtocolProcessorPlugin().install(pluginManager);
|
|
25
|
+
super(packageJson.extensions.graphPreset, packageJson.version, [
|
|
26
|
+
new DSLText_PureGraphPlugin(),
|
|
27
|
+
new DSLText_PureGraphManagerPlugin(),
|
|
28
|
+
new DSLText_PureProtocolProcessorPlugin(),
|
|
29
|
+
]);
|
|
33
30
|
}
|
|
34
31
|
}
|
|
@@ -14,20 +14,27 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
+
import type { LegendApplicationDocumentationEntryConfig } from '@finos/legend-application';
|
|
18
|
+
|
|
17
19
|
export enum DSL_TEXT_LEGEND_STUDIO_DOCUMENTATION_KEY {
|
|
18
|
-
GRAMMAR_PARSER = 'dsl-
|
|
19
|
-
|
|
20
|
+
GRAMMAR_PARSER = 'dsl-text.grammar.parser',
|
|
21
|
+
GRAMMAR_ELEMENT_TEXT = 'dsl-text.grammar.element.text',
|
|
20
22
|
}
|
|
21
23
|
|
|
22
|
-
export const DSL_TEXT_DOCUMENTATION_ENTRIES
|
|
24
|
+
export const DSL_TEXT_DOCUMENTATION_ENTRIES: Record<
|
|
25
|
+
string,
|
|
26
|
+
LegendApplicationDocumentationEntryConfig
|
|
27
|
+
> = {
|
|
23
28
|
[DSL_TEXT_LEGEND_STUDIO_DOCUMENTATION_KEY.GRAMMAR_PARSER]: {
|
|
29
|
+
title: 'What is Text DSL about?',
|
|
24
30
|
markdownText: {
|
|
25
|
-
value:
|
|
31
|
+
value: `\`Text DSL\` (corresponding to header \`###DataSpace\` section in \`Pure\`) concerns with storing data in plain-text`,
|
|
26
32
|
},
|
|
27
33
|
},
|
|
28
|
-
[DSL_TEXT_LEGEND_STUDIO_DOCUMENTATION_KEY.
|
|
34
|
+
[DSL_TEXT_LEGEND_STUDIO_DOCUMENTATION_KEY.GRAMMAR_ELEMENT_TEXT]: {
|
|
35
|
+
title: 'What is a text element?',
|
|
29
36
|
markdownText: {
|
|
30
|
-
value: `A
|
|
37
|
+
value: `A \`Text\` element stores plain-text content with a specified content-type, which can be used for formatting, syntax-highlighting`,
|
|
31
38
|
},
|
|
32
39
|
},
|
|
33
40
|
};
|
|
@@ -34,10 +34,10 @@ import {
|
|
|
34
34
|
type PureGrammarParserElementDocumentationGetter,
|
|
35
35
|
} from '@finos/legend-studio';
|
|
36
36
|
import { FileIcon } from '@finos/legend-art';
|
|
37
|
-
import { TextEditorState } from '../../stores/studio/TextEditorState';
|
|
38
|
-
import { TextElementEditor } from './TextElementEditor';
|
|
37
|
+
import { TextEditorState } from '../../stores/studio/TextEditorState.js';
|
|
38
|
+
import { TextElementEditor } from './TextElementEditor.js';
|
|
39
39
|
import type { PackageableElement } from '@finos/legend-graph';
|
|
40
|
-
import { Text } from '../../models/metamodels/pure/model/packageableElements/text/DSLText_Text';
|
|
40
|
+
import { Text } from '../../models/metamodels/pure/model/packageableElements/text/DSLText_Text.js';
|
|
41
41
|
import {
|
|
42
42
|
collectKeyedDocumnetationEntriesFromConfig,
|
|
43
43
|
type LegendApplicationDocumentationEntry,
|
|
@@ -46,15 +46,16 @@ import {
|
|
|
46
46
|
import {
|
|
47
47
|
DSL_TEXT_DOCUMENTATION_ENTRIES,
|
|
48
48
|
DSL_TEXT_LEGEND_STUDIO_DOCUMENTATION_KEY,
|
|
49
|
-
} from './DSLText_LegendStudioDocumentation';
|
|
49
|
+
} from './DSLText_LegendStudioDocumentation.js';
|
|
50
50
|
import {
|
|
51
51
|
PURE_GRAMMAR_TEXT_ELEMENT_TYPE_LABEL,
|
|
52
52
|
PURE_GRAMMAR_TEXT_PARSER_NAME,
|
|
53
|
-
} from '../../graphManager/DSLText_PureGraphManagerPlugin';
|
|
53
|
+
} from '../../graphManager/DSLText_PureGraphManagerPlugin.js';
|
|
54
54
|
import {
|
|
55
55
|
MARKDOWN_TEXT_SNIPPET,
|
|
56
56
|
PLAIN_TEXT_SNIPPET,
|
|
57
|
-
} from './DSLText_CodeSnippets';
|
|
57
|
+
} from './DSLText_CodeSnippets.js';
|
|
58
|
+
import { create_TextElement } from '../../helper/DSLText_Helper.js';
|
|
58
59
|
|
|
59
60
|
const TEXT_ELEMENT_TYPE = 'TEXT';
|
|
60
61
|
const TEXT_ELEMENT_PROJECT_EXPLORER_DND_TYPE = 'PROJECT_EXPLORER_TEXT';
|
|
@@ -122,7 +123,7 @@ export class DSLText_LegendStudioPlugin
|
|
|
122
123
|
state: NewElementState,
|
|
123
124
|
): PackageableElement | undefined => {
|
|
124
125
|
if (type === TEXT_ELEMENT_TYPE) {
|
|
125
|
-
return
|
|
126
|
+
return create_TextElement(name);
|
|
126
127
|
}
|
|
127
128
|
return undefined;
|
|
128
129
|
},
|
|
@@ -167,8 +168,8 @@ export class DSLText_LegendStudioPlugin
|
|
|
167
168
|
): LegendApplicationDocumentationEntry | undefined => {
|
|
168
169
|
if (parserKeyword === PURE_GRAMMAR_TEXT_PARSER_NAME) {
|
|
169
170
|
if (elementKeyword === PURE_GRAMMAR_TEXT_ELEMENT_TYPE_LABEL) {
|
|
170
|
-
return editorStore.applicationStore.
|
|
171
|
-
DSL_TEXT_LEGEND_STUDIO_DOCUMENTATION_KEY.
|
|
171
|
+
return editorStore.applicationStore.documentationService.getDocEntry(
|
|
172
|
+
DSL_TEXT_LEGEND_STUDIO_DOCUMENTATION_KEY.GRAMMAR_ELEMENT_TEXT,
|
|
172
173
|
);
|
|
173
174
|
}
|
|
174
175
|
}
|
|
@@ -184,7 +185,7 @@ export class DSLText_LegendStudioPlugin
|
|
|
184
185
|
parserKeyword: string,
|
|
185
186
|
): LegendApplicationDocumentationEntry | undefined => {
|
|
186
187
|
if (parserKeyword === PURE_GRAMMAR_TEXT_PARSER_NAME) {
|
|
187
|
-
return editorStore.applicationStore.
|
|
188
|
+
return editorStore.applicationStore.documentationService.getDocEntry(
|
|
188
189
|
DSL_TEXT_LEGEND_STUDIO_DOCUMENTATION_KEY.GRAMMAR_PARSER,
|
|
189
190
|
);
|
|
190
191
|
}
|
|
@@ -199,9 +200,10 @@ export class DSLText_LegendStudioPlugin
|
|
|
199
200
|
{
|
|
200
201
|
text: PURE_GRAMMAR_TEXT_PARSER_NAME,
|
|
201
202
|
description: `(dsl)`,
|
|
202
|
-
documentation:
|
|
203
|
-
|
|
204
|
-
|
|
203
|
+
documentation:
|
|
204
|
+
editorStore.applicationStore.documentationService.getDocEntry(
|
|
205
|
+
DSL_TEXT_LEGEND_STUDIO_DOCUMENTATION_KEY.GRAMMAR_PARSER,
|
|
206
|
+
),
|
|
205
207
|
insertText: PURE_GRAMMAR_TEXT_PARSER_NAME,
|
|
206
208
|
},
|
|
207
209
|
],
|
|
@@ -16,12 +16,9 @@
|
|
|
16
16
|
|
|
17
17
|
import { useRef, useEffect } from 'react';
|
|
18
18
|
import { observer } from 'mobx-react-lite';
|
|
19
|
-
import {
|
|
20
|
-
prettyCONSTName,
|
|
21
|
-
UnsupportedOperationError,
|
|
22
|
-
} from '@finos/legend-shared';
|
|
19
|
+
import { prettyCONSTName } from '@finos/legend-shared';
|
|
23
20
|
import { StudioTextInputEditor, useEditorStore } from '@finos/legend-studio';
|
|
24
|
-
import { TextEditorState } from '../../stores/studio/TextEditorState';
|
|
21
|
+
import { TextEditorState } from '../../stores/studio/TextEditorState.js';
|
|
25
22
|
import {
|
|
26
23
|
LockIcon,
|
|
27
24
|
CaretDownIcon,
|
|
@@ -30,22 +27,19 @@ import {
|
|
|
30
27
|
MenuContentItem,
|
|
31
28
|
} from '@finos/legend-art';
|
|
32
29
|
import { EDITOR_LANGUAGE } from '@finos/legend-application';
|
|
33
|
-
import { TEXT_TYPE } from '../../models/metamodels/pure/model/packageableElements/text/DSLText_Text';
|
|
34
30
|
import {
|
|
35
31
|
text_setContent,
|
|
36
32
|
text_setType,
|
|
37
|
-
} from '../../stores/studio/DSLText_GraphModifierHelper';
|
|
33
|
+
} from '../../stores/studio/DSLText_GraphModifierHelper.js';
|
|
34
|
+
import { TEXT_TYPE } from '../../helper/DSLText_Helper.js';
|
|
38
35
|
|
|
39
|
-
const getTextElementEditorLanguage = (type:
|
|
36
|
+
const getTextElementEditorLanguage = (type: string): EDITOR_LANGUAGE => {
|
|
40
37
|
switch (type) {
|
|
41
38
|
case TEXT_TYPE.MARKDOWN:
|
|
42
39
|
return EDITOR_LANGUAGE.MARKDOWN;
|
|
43
40
|
case TEXT_TYPE.PLAIN_TEXT:
|
|
44
|
-
return EDITOR_LANGUAGE.TEXT;
|
|
45
41
|
default:
|
|
46
|
-
|
|
47
|
-
`Can't derive text editor format for text content of type '${type}'`,
|
|
48
|
-
);
|
|
42
|
+
return EDITOR_LANGUAGE.TEXT;
|
|
49
43
|
}
|
|
50
44
|
};
|
|
51
45
|
|
|
@@ -83,6 +77,7 @@ export const TextElementEditor = observer(() => {
|
|
|
83
77
|
className="edit-panel__element-view"
|
|
84
78
|
content={
|
|
85
79
|
<MenuContent>
|
|
80
|
+
{/* TODO: account for unknown types */}
|
|
86
81
|
{Object.values(TEXT_TYPE).map((mode) => (
|
|
87
82
|
<MenuContentItem
|
|
88
83
|
key={mode}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import packageJson from '../../package.json';
|
|
18
|
-
import { Text } from '../models/metamodels/pure/model/packageableElements/text/DSLText_Text';
|
|
18
|
+
import { Text } from '../models/metamodels/pure/model/packageableElements/text/DSLText_Text.js';
|
|
19
19
|
import type { Clazz } from '@finos/legend-shared';
|
|
20
20
|
import { type PackageableElement, PureGraphPlugin } from '@finos/legend-graph';
|
|
21
21
|
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
import type { BasicModel, PureModel } from '@finos/legend-graph';
|
|
18
18
|
import { guaranteeNonNullable } from '@finos/legend-shared';
|
|
19
|
-
import { Text } from '../models/metamodels/pure/model/packageableElements/text/DSLText_Text';
|
|
19
|
+
import { Text } from '../models/metamodels/pure/model/packageableElements/text/DSLText_Text.js';
|
|
20
20
|
|
|
21
21
|
export const getText = (path: string, graph: PureModel): Text =>
|
|
22
22
|
graph.getExtensionElement(path, Text, `Can't find text element '${path}'`);
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import packageJson from '../../package.json';
|
|
18
|
-
import { Text } from '../models/metamodels/pure/model/packageableElements/text/DSLText_Text';
|
|
18
|
+
import { Text } from '../models/metamodels/pure/model/packageableElements/text/DSLText_Text.js';
|
|
19
19
|
import {
|
|
20
20
|
PureGraphManagerPlugin,
|
|
21
21
|
type ObserverContext,
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
type PackageableElement,
|
|
24
24
|
type PureGrammarElementLabeler,
|
|
25
25
|
} from '@finos/legend-graph';
|
|
26
|
-
import { observe_Text } from './action/changeDetection/DSLText_ObserverHelper';
|
|
26
|
+
import { observe_Text } from './action/changeDetection/DSLText_ObserverHelper.js';
|
|
27
27
|
|
|
28
28
|
export const PURE_GRAMMAR_TEXT_PARSER_NAME = 'Text';
|
|
29
29
|
export const PURE_GRAMMAR_TEXT_ELEMENT_TYPE_LABEL = 'Text';
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
skipObserved,
|
|
20
20
|
} from '@finos/legend-graph';
|
|
21
21
|
import { makeObservable, observable, override } from 'mobx';
|
|
22
|
-
import type { Text } from '../../../models/metamodels/pure/model/packageableElements/text/DSLText_Text';
|
|
22
|
+
import type { Text } from '../../../models/metamodels/pure/model/packageableElements/text/DSLText_Text.js';
|
|
23
23
|
|
|
24
24
|
export const observe_Text = skipObserved((metamodel: Text): Text => {
|
|
25
25
|
observe_Abstract_PackageableElement(metamodel);
|
|
@@ -0,0 +1,30 @@
|
|
|
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
|
+
import { Text } from '../models/metamodels/pure/model/packageableElements/text/DSLText_Text.js';
|
|
18
|
+
|
|
19
|
+
export enum TEXT_TYPE {
|
|
20
|
+
PLAIN_TEXT = 'plainText',
|
|
21
|
+
MARKDOWN = 'markdown',
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const create_TextElement = (name: string): Text => {
|
|
25
|
+
const metamodel = new Text(name);
|
|
26
|
+
metamodel.type = TEXT_TYPE.PLAIN_TEXT;
|
|
27
|
+
metamodel.content = '';
|
|
28
|
+
|
|
29
|
+
return metamodel;
|
|
30
|
+
};
|
package/src/index.ts
CHANGED
|
@@ -14,5 +14,5 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
export * from './DSLText_Extension';
|
|
18
|
-
export { DSLText_LegendStudioPlugin } from './components/studio/DSLText_LegendStudioPlugin';
|
|
17
|
+
export * from './DSLText_Extension.js';
|
|
18
|
+
export { DSLText_LegendStudioPlugin } from './components/studio/DSLText_LegendStudioPlugin.js';
|
|
@@ -15,27 +15,15 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import { hashArray, type Hashable } from '@finos/legend-shared';
|
|
18
|
-
import { TEXT_HASH_STRUCTURE } from '../../../../../DSLText_ModelUtils';
|
|
18
|
+
import { TEXT_HASH_STRUCTURE } from '../../../../../DSLText_ModelUtils.js';
|
|
19
19
|
import {
|
|
20
20
|
type PackageableElementVisitor,
|
|
21
21
|
PackageableElement,
|
|
22
22
|
} from '@finos/legend-graph';
|
|
23
23
|
|
|
24
|
-
// TODO: to be moved out of metamodel
|
|
25
|
-
export enum TEXT_TYPE {
|
|
26
|
-
PLAIN_TEXT = 'plainText',
|
|
27
|
-
MARKDOWN = 'markdown',
|
|
28
|
-
}
|
|
29
|
-
|
|
30
24
|
export class Text extends PackageableElement implements Hashable {
|
|
31
|
-
type
|
|
32
|
-
content
|
|
33
|
-
|
|
34
|
-
constructor(name: string) {
|
|
35
|
-
super(name);
|
|
36
|
-
this.type = TEXT_TYPE.PLAIN_TEXT;
|
|
37
|
-
this.content = '';
|
|
38
|
-
}
|
|
25
|
+
type!: string;
|
|
26
|
+
content!: string;
|
|
39
27
|
|
|
40
28
|
protected override get _elementHashCode(): string {
|
|
41
29
|
return hashArray([
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import packageJson from '../../../../package.json';
|
|
18
|
-
import { V1_Text } from './v1/model/packageableElements/text/V1_DSLText_Text';
|
|
18
|
+
import { V1_Text } from './v1/model/packageableElements/text/V1_DSLText_Text.js';
|
|
19
19
|
import {
|
|
20
20
|
type PlainObject,
|
|
21
21
|
guaranteeNonNullable,
|
|
@@ -25,12 +25,9 @@ import { deserialize, serialize } from 'serializr';
|
|
|
25
25
|
import {
|
|
26
26
|
V1_textModelSchema,
|
|
27
27
|
V1_TEXT_ELEMENT_PROTOCOL_TYPE,
|
|
28
|
-
} from './v1/transformation/pureProtocol/V1_DSLText_ProtocolHelper';
|
|
29
|
-
import { getOwnText } from '../../../graphManager/DSLText_GraphManagerHelper';
|
|
30
|
-
import {
|
|
31
|
-
Text,
|
|
32
|
-
TEXT_TYPE,
|
|
33
|
-
} from '../../metamodels/pure/model/packageableElements/text/DSLText_Text';
|
|
28
|
+
} from './v1/transformation/pureProtocol/V1_DSLText_ProtocolHelper.js';
|
|
29
|
+
import { getOwnText } from '../../../graphManager/DSLText_GraphManagerHelper.js';
|
|
30
|
+
import { Text } from '../../metamodels/pure/model/packageableElements/text/DSLText_Text.js';
|
|
34
31
|
import {
|
|
35
32
|
type PackageableElement,
|
|
36
33
|
type V1_ElementProtocolClassifierPathGetter,
|
|
@@ -84,10 +81,7 @@ export class DSLText_PureProtocolProcessorPlugin extends PureProtocolProcessorPl
|
|
|
84
81
|
elementProtocol.name,
|
|
85
82
|
);
|
|
86
83
|
const element = getOwnText(path, context.currentSubGraph);
|
|
87
|
-
element.type =
|
|
88
|
-
Object.values(TEXT_TYPE).find(
|
|
89
|
-
(type) => type === elementProtocol.type,
|
|
90
|
-
) ?? TEXT_TYPE.PLAIN_TEXT;
|
|
84
|
+
element.type = elementProtocol.type;
|
|
91
85
|
element.content = guaranteeNonNullable(
|
|
92
86
|
elementProtocol.content,
|
|
93
87
|
`Text element 'content' field is missing`,
|
|
@@ -146,7 +140,7 @@ export class DSLText_PureProtocolProcessorPlugin extends PureProtocolProcessorPl
|
|
|
146
140
|
const protocol = new V1_Text();
|
|
147
141
|
V1_initPackageableElement(protocol, metamodel);
|
|
148
142
|
protocol.name = metamodel.name;
|
|
149
|
-
protocol.package = metamodel.package?.
|
|
143
|
+
protocol.package = metamodel.package?.path ?? '';
|
|
150
144
|
protocol.content = metamodel.content;
|
|
151
145
|
protocol.type = metamodel.type;
|
|
152
146
|
return protocol;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import { hashArray, type Hashable } from '@finos/legend-shared';
|
|
18
|
-
import { TEXT_HASH_STRUCTURE } from '../../../../../../DSLText_ModelUtils';
|
|
18
|
+
import { TEXT_HASH_STRUCTURE } from '../../../../../../DSLText_ModelUtils.js';
|
|
19
19
|
import {
|
|
20
20
|
type V1_PackageableElementVisitor,
|
|
21
21
|
V1_PackageableElement,
|
package/src/models/protocols/pure/v1/transformation/pureGraph/V1_DSLText_GraphBuilderHelper.ts
CHANGED
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import { getText } from '../../../../../../graphManager/DSLText_GraphManagerHelper';
|
|
18
|
-
import type { Text } from '../../../../../metamodels/pure/model/packageableElements/text/DSLText_Text';
|
|
17
|
+
import { getText } from '../../../../../../graphManager/DSLText_GraphManagerHelper.js';
|
|
18
|
+
import type { Text } from '../../../../../metamodels/pure/model/packageableElements/text/DSLText_Text.js';
|
|
19
19
|
import type {
|
|
20
20
|
PackageableElementImplicitReference,
|
|
21
21
|
V1_GraphBuilderContext,
|
package/src/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLText_ProtocolHelper.ts
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
import { usingConstantValueSchema } from '@finos/legend-shared';
|
|
18
18
|
import { createModelSchema, primitive } from 'serializr';
|
|
19
|
-
import { V1_Text } from '../../model/packageableElements/text/V1_DSLText_Text';
|
|
19
|
+
import { V1_Text } from '../../model/packageableElements/text/V1_DSLText_Text.js';
|
|
20
20
|
|
|
21
21
|
export const V1_TEXT_ELEMENT_PROTOCOL_TYPE = 'text';
|
|
22
22
|
|