@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.
Files changed (81) hide show
  1. package/lib/DSLText_Extension.d.ts +0 -2
  2. package/lib/DSLText_Extension.d.ts.map +1 -1
  3. package/lib/DSLText_Extension.js +8 -9
  4. package/lib/DSLText_Extension.js.map +1 -1
  5. package/lib/components/studio/DSLText_LegendStudioDocumentation.d.ts +4 -14
  6. package/lib/components/studio/DSLText_LegendStudioDocumentation.d.ts.map +1 -1
  7. package/lib/components/studio/DSLText_LegendStudioDocumentation.js +8 -6
  8. package/lib/components/studio/DSLText_LegendStudioDocumentation.js.map +1 -1
  9. package/lib/components/studio/DSLText_LegendStudioPlugin.d.ts.map +1 -1
  10. package/lib/components/studio/DSLText_LegendStudioPlugin.js +11 -10
  11. package/lib/components/studio/DSLText_LegendStudioPlugin.js.map +1 -1
  12. package/lib/components/studio/TextElementEditor.d.ts +1 -1
  13. package/lib/components/studio/TextElementEditor.d.ts.map +1 -1
  14. package/lib/components/studio/TextElementEditor.js +5 -6
  15. package/lib/components/studio/TextElementEditor.js.map +1 -1
  16. package/lib/graph/DSLText_PureGraphPlugin.js +1 -1
  17. package/lib/graph/DSLText_PureGraphPlugin.js.map +1 -1
  18. package/lib/graphManager/DSLText_GraphManagerHelper.d.ts +1 -1
  19. package/lib/graphManager/DSLText_GraphManagerHelper.d.ts.map +1 -1
  20. package/lib/graphManager/DSLText_GraphManagerHelper.js +1 -1
  21. package/lib/graphManager/DSLText_GraphManagerHelper.js.map +1 -1
  22. package/lib/graphManager/DSLText_PureGraphManagerPlugin.js +2 -2
  23. package/lib/graphManager/DSLText_PureGraphManagerPlugin.js.map +1 -1
  24. package/lib/graphManager/action/changeDetection/DSLText_ObserverHelper.d.ts +1 -1
  25. package/lib/graphManager/action/changeDetection/DSLText_ObserverHelper.d.ts.map +1 -1
  26. package/lib/helper/DSLText_Helper.d.ts +22 -0
  27. package/lib/helper/DSLText_Helper.d.ts.map +1 -0
  28. package/lib/helper/DSLText_Helper.js +28 -0
  29. package/lib/helper/DSLText_Helper.js.map +1 -0
  30. package/lib/index.css +1 -1
  31. package/lib/index.d.ts +2 -2
  32. package/lib/index.d.ts.map +1 -1
  33. package/lib/index.js +2 -2
  34. package/lib/index.js.map +1 -1
  35. package/lib/models/DSLText_ModelUtils.js +1 -1
  36. package/lib/models/DSLText_ModelUtils.js.map +1 -1
  37. package/lib/models/metamodels/pure/model/packageableElements/text/DSLText_Text.d.ts +1 -6
  38. package/lib/models/metamodels/pure/model/packageableElements/text/DSLText_Text.d.ts.map +1 -1
  39. package/lib/models/metamodels/pure/model/packageableElements/text/DSLText_Text.js +1 -12
  40. package/lib/models/metamodels/pure/model/packageableElements/text/DSLText_Text.js.map +1 -1
  41. package/lib/models/protocols/pure/DSLText_PureProtocolProcessorPlugin.d.ts.map +1 -1
  42. package/lib/models/protocols/pure/DSLText_PureProtocolProcessorPlugin.js +6 -7
  43. package/lib/models/protocols/pure/DSLText_PureProtocolProcessorPlugin.js.map +1 -1
  44. package/lib/models/protocols/pure/v1/model/packageableElements/text/V1_DSLText_Text.js +1 -1
  45. package/lib/models/protocols/pure/v1/model/packageableElements/text/V1_DSLText_Text.js.map +1 -1
  46. package/lib/models/protocols/pure/v1/transformation/pureGraph/V1_DSLText_GraphBuilderHelper.d.ts +1 -1
  47. package/lib/models/protocols/pure/v1/transformation/pureGraph/V1_DSLText_GraphBuilderHelper.d.ts.map +1 -1
  48. package/lib/models/protocols/pure/v1/transformation/pureGraph/V1_DSLText_GraphBuilderHelper.js +1 -1
  49. package/lib/models/protocols/pure/v1/transformation/pureGraph/V1_DSLText_GraphBuilderHelper.js.map +1 -1
  50. package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLText_ProtocolHelper.d.ts +1 -1
  51. package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLText_ProtocolHelper.d.ts.map +1 -1
  52. package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLText_ProtocolHelper.js +1 -1
  53. package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLText_ProtocolHelper.js.map +1 -1
  54. package/lib/package.json +11 -10
  55. package/lib/stores/studio/DSLText_GraphModifierHelper.d.ts +2 -2
  56. package/lib/stores/studio/DSLText_GraphModifierHelper.d.ts.map +1 -1
  57. package/lib/stores/studio/DSLText_GraphModifierHelper.js.map +1 -1
  58. package/lib/stores/studio/TextEditorState.d.ts +1 -1
  59. package/lib/stores/studio/TextEditorState.d.ts.map +1 -1
  60. package/lib/stores/studio/TextEditorState.js +1 -1
  61. package/lib/stores/studio/TextEditorState.js.map +1 -1
  62. package/package.json +18 -17
  63. package/src/DSLText_Extension.ts +8 -11
  64. package/src/components/studio/DSLText_LegendStudioDocumentation.ts +13 -6
  65. package/src/components/studio/DSLText_LegendStudioPlugin.tsx +15 -13
  66. package/src/components/studio/TextElementEditor.tsx +7 -12
  67. package/src/graph/DSLText_PureGraphPlugin.ts +1 -1
  68. package/src/graphManager/DSLText_GraphManagerHelper.ts +1 -1
  69. package/src/graphManager/DSLText_PureGraphManagerPlugin.ts +2 -2
  70. package/src/graphManager/action/changeDetection/DSLText_ObserverHelper.ts +1 -1
  71. package/src/helper/DSLText_Helper.ts +30 -0
  72. package/src/index.ts +2 -2
  73. package/src/models/metamodels/pure/model/packageableElements/text/DSLText_Text.ts +3 -15
  74. package/src/models/protocols/pure/DSLText_PureProtocolProcessorPlugin.ts +6 -12
  75. package/src/models/protocols/pure/v1/model/packageableElements/text/V1_DSLText_Text.ts +1 -1
  76. package/src/models/protocols/pure/v1/transformation/pureGraph/V1_DSLText_GraphBuilderHelper.ts +2 -2
  77. package/src/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLText_ProtocolHelper.ts +1 -1
  78. package/src/stores/studio/DSLText_GraphModifierHelper.ts +3 -5
  79. package/src/stores/studio/TextEditorState.ts +1 -1
  80. package/tsconfig.json +4 -8
  81. 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,sCAAsC,CAAC;AAC3E,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"}
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"}
@@ -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
@@ -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,4EAA4E,CAAC;AACvG,OAAO,KAAK,EACV,mCAAmC,EACnC,sBAAsB,EACvB,MAAM,qBAAqB,CAAC;AAE7B,eAAO,MAAM,cAAc,SACnB,MAAM,WACH,sBAAsB,KAC9B,oCAAoC,IAAI,CAGxC,CAAC"}
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"}
@@ -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
@@ -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,2DAA2D,CAAC;AAOpF,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"}
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"}
@@ -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
@@ -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,sDAAsD,CAAC;AAE/E,eAAO,MAAM,6BAA6B,SAAS,CAAC;AAEpD,eAAO,MAAM,kBAAkB,0CAM7B,CAAC"}
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"}
@@ -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),
@@ -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,sDAAsD,CAAC;AAE/E,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"}
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": "2.0.2",
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": "17.0.44",
53
- "mobx": "6.5.0",
54
- "mobx-react-lite": "3.3.0",
55
- "react": "17.0.2",
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.14.0",
62
- "jest": "28.0.3",
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.51.0",
66
- "typescript": "4.6.4"
66
+ "sass": "1.52.3",
67
+ "typescript": "4.7.4"
67
68
  },
68
69
  "peerDependencies": {
69
- "react": "^17.0.0"
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 { TEXT_TYPE, Text } from '../../models/metamodels/pure/model/packageableElements/text/DSLText_Text';
17
- export declare const text_setType: (text: Text, type: TEXT_TYPE) => void;
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,EACV,SAAS,EACT,IAAI,EACL,MAAM,0EAA0E,CAAC;AAElF,eAAO,MAAM,YAAY,SAAiB,IAAI,QAAQ,SAAS,KAAG,IAEhE,CAAC;AACH,eAAO,MAAM,eAAe,SAAiB,IAAI,WAAW,MAAM,KAAG,IAEnE,CAAC"}
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;AAM9B,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,CAAC,IAAU,EAAE,IAAe,EAAQ,EAAE;IACvE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;AACnB,CAAC,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,CAAC,IAAU,EAAE,OAAe,EAAQ,EAAE;IAC1E,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;AACzB,CAAC,CAAC,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,0EAA0E,CAAC;AAEhG,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"}
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,0EAA0E,CAAC;AAEhG,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"}
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": "2.0.2",
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": "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",
53
- "mobx": "6.5.0",
54
- "mobx-react-lite": "3.3.0",
55
- "react": "17.0.2",
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": "1.0.0",
59
+ "@finos/legend-dev-utils": "2.0.1",
60
+ "@jest/globals": "28.1.1",
60
61
  "cross-env": "7.0.3",
61
- "eslint": "8.14.0",
62
- "jest": "28.0.3",
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.51.0",
66
- "typescript": "4.6.4"
66
+ "sass": "1.52.3",
67
+ "typescript": "4.7.4"
67
68
  },
68
69
  "peerDependencies": {
69
- "react": "^17.0.0"
70
+ "react": "^18.0.0"
70
71
  },
71
72
  "publishConfig": {
72
73
  "directory": "build/publishContent"
@@ -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 type { GraphPluginManager } from '@finos/legend-graph';
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
- install(pluginManager: GraphPluginManager): void {
30
- new DSLText_PureGraphPlugin().install(pluginManager);
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-text__grammar-parser',
19
- GRAMMAR_TEXT_ELEMENT = 'dsl-text__grammar-text-element',
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: `DSL Text (\`###Text\`) concerns with storing data in plain-text`,
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.GRAMMAR_TEXT_ELEMENT]: {
34
+ [DSL_TEXT_LEGEND_STUDIO_DOCUMENTATION_KEY.GRAMMAR_ELEMENT_TEXT]: {
35
+ title: 'What is a text element?',
29
36
  markdownText: {
30
- value: `A text element stores plain-text content with a specified content-type, which can be used for formatting, syntax-highlighting`,
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 new Text(name);
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.docRegistry.getEntry(
171
- DSL_TEXT_LEGEND_STUDIO_DOCUMENTATION_KEY.GRAMMAR_TEXT_ELEMENT,
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.docRegistry.getEntry(
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: editorStore.applicationStore.docRegistry.getEntry(
203
- DSL_TEXT_LEGEND_STUDIO_DOCUMENTATION_KEY.GRAMMAR_PARSER,
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: TEXT_TYPE): EDITOR_LANGUAGE => {
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
- throw new UnsupportedOperationError(
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: TEXT_TYPE;
32
- content: string;
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?.fullPath ?? '';
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,
@@ -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,
@@ -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