@finos/legend-extension-dsl-diagram 1.0.2 → 1.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (127) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/lib/DiagramRenderer.d.ts +6 -6
  3. package/lib/DiagramRenderer.d.ts.map +1 -1
  4. package/lib/DiagramRenderer.js +27 -16
  5. package/lib/DiagramRenderer.js.map +1 -1
  6. package/lib/components/studio/ClassDiagramPreview.d.ts +1 -0
  7. package/lib/components/studio/ClassDiagramPreview.d.ts.map +1 -1
  8. package/lib/components/studio/DSLDiagram_LegendStudioPlugin.d.ts +1 -3
  9. package/lib/components/studio/DSLDiagram_LegendStudioPlugin.d.ts.map +1 -1
  10. package/lib/components/studio/DSLDiagram_LegendStudioPlugin.js +1 -4
  11. package/lib/components/studio/DSLDiagram_LegendStudioPlugin.js.map +1 -1
  12. package/lib/components/studio/DiagramEditor.d.ts +1 -0
  13. package/lib/components/studio/DiagramEditor.d.ts.map +1 -1
  14. package/lib/components/studio/DiagramEditor.js +13 -15
  15. package/lib/components/studio/DiagramEditor.js.map +1 -1
  16. package/lib/components/studio/InheritanceDiagramRenderer.d.ts +1 -1
  17. package/lib/components/studio/InheritanceDiagramRenderer.d.ts.map +1 -1
  18. package/lib/components/studio/InheritanceDiagramRenderer.js +1 -1
  19. package/lib/components/studio/InheritanceDiagramRenderer.js.map +1 -1
  20. package/lib/graph/DSLDiagram_PureGraphPlugin.d.ts +1 -3
  21. package/lib/graph/DSLDiagram_PureGraphPlugin.d.ts.map +1 -1
  22. package/lib/graph/DSLDiagram_PureGraphPlugin.js +1 -4
  23. package/lib/graph/DSLDiagram_PureGraphPlugin.js.map +1 -1
  24. package/lib/graphManager/DSLDiagram_PureGraphManagerPlugin.d.ts +1 -3
  25. package/lib/graphManager/DSLDiagram_PureGraphManagerPlugin.d.ts.map +1 -1
  26. package/lib/graphManager/DSLDiagram_PureGraphManagerPlugin.js +1 -4
  27. package/lib/graphManager/DSLDiagram_PureGraphManagerPlugin.js.map +1 -1
  28. package/lib/index.css +1 -1
  29. package/lib/models/metamodels/pure/packageableElements/diagram/AssociationView.d.ts +1 -1
  30. package/lib/models/metamodels/pure/packageableElements/diagram/AssociationView.d.ts.map +1 -1
  31. package/lib/models/metamodels/pure/packageableElements/diagram/AssociationView.js.map +1 -1
  32. package/lib/models/metamodels/pure/packageableElements/diagram/ClassView.d.ts +1 -1
  33. package/lib/models/metamodels/pure/packageableElements/diagram/ClassView.d.ts.map +1 -1
  34. package/lib/models/metamodels/pure/packageableElements/diagram/ClassView.js.map +1 -1
  35. package/lib/models/metamodels/pure/packageableElements/diagram/ClassViewReference.d.ts +1 -2
  36. package/lib/models/metamodels/pure/packageableElements/diagram/ClassViewReference.d.ts.map +1 -1
  37. package/lib/models/metamodels/pure/packageableElements/diagram/ClassViewReference.js.map +1 -1
  38. package/lib/models/metamodels/pure/packageableElements/diagram/Diagram.d.ts +2 -3
  39. package/lib/models/metamodels/pure/packageableElements/diagram/Diagram.d.ts.map +1 -1
  40. package/lib/models/metamodels/pure/packageableElements/diagram/Diagram.js +2 -2
  41. package/lib/models/metamodels/pure/packageableElements/diagram/Diagram.js.map +1 -1
  42. package/lib/models/metamodels/pure/packageableElements/diagram/GeneralizationView.d.ts +1 -1
  43. package/lib/models/metamodels/pure/packageableElements/diagram/GeneralizationView.d.ts.map +1 -1
  44. package/lib/models/metamodels/pure/packageableElements/diagram/GeneralizationView.js.map +1 -1
  45. package/lib/models/metamodels/pure/packageableElements/diagram/PropertyHolderView.d.ts +1 -1
  46. package/lib/models/metamodels/pure/packageableElements/diagram/PropertyHolderView.d.ts.map +1 -1
  47. package/lib/models/metamodels/pure/packageableElements/diagram/PropertyHolderView.js.map +1 -1
  48. package/lib/models/metamodels/pure/packageableElements/diagram/PropertyView.d.ts +1 -1
  49. package/lib/models/metamodels/pure/packageableElements/diagram/PropertyView.d.ts.map +1 -1
  50. package/lib/models/metamodels/pure/packageableElements/diagram/PropertyView.js.map +1 -1
  51. package/lib/models/metamodels/pure/packageableElements/diagram/RelationshipView.d.ts +1 -1
  52. package/lib/models/metamodels/pure/packageableElements/diagram/RelationshipView.d.ts.map +1 -1
  53. package/lib/models/metamodels/pure/packageableElements/diagram/RelationshipView.js.map +1 -1
  54. package/lib/models/metamodels/pure/packageableElements/diagram/geometry/Point.d.ts +1 -1
  55. package/lib/models/metamodels/pure/packageableElements/diagram/geometry/Point.d.ts.map +1 -1
  56. package/lib/models/metamodels/pure/packageableElements/diagram/geometry/Point.js.map +1 -1
  57. package/lib/models/metamodels/pure/packageableElements/diagram/geometry/PositionedRectangle.d.ts +1 -1
  58. package/lib/models/metamodels/pure/packageableElements/diagram/geometry/PositionedRectangle.d.ts.map +1 -1
  59. package/lib/models/metamodels/pure/packageableElements/diagram/geometry/PositionedRectangle.js.map +1 -1
  60. package/lib/models/metamodels/pure/packageableElements/diagram/geometry/Rectangle.d.ts +1 -1
  61. package/lib/models/metamodels/pure/packageableElements/diagram/geometry/Rectangle.d.ts.map +1 -1
  62. package/lib/models/metamodels/pure/packageableElements/diagram/geometry/Rectangle.js.map +1 -1
  63. package/lib/models/protocols/pure/DSLDiagram_PureProtocolProcessorPlugin.d.ts +1 -3
  64. package/lib/models/protocols/pure/DSLDiagram_PureProtocolProcessorPlugin.d.ts.map +1 -1
  65. package/lib/models/protocols/pure/DSLDiagram_PureProtocolProcessorPlugin.js +0 -3
  66. package/lib/models/protocols/pure/DSLDiagram_PureProtocolProcessorPlugin.js.map +1 -1
  67. package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_ClassView.d.ts +1 -1
  68. package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_ClassView.d.ts.map +1 -1
  69. package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_ClassView.js.map +1 -1
  70. package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_Diagram.d.ts +2 -3
  71. package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_Diagram.d.ts.map +1 -1
  72. package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_Diagram.js +1 -1
  73. package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_Diagram.js.map +1 -1
  74. package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_GeneralizationView.d.ts +1 -1
  75. package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_GeneralizationView.d.ts.map +1 -1
  76. package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_GeneralizationView.js.map +1 -1
  77. package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_PropertyHolderView.d.ts +1 -1
  78. package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_PropertyHolderView.d.ts.map +1 -1
  79. package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_PropertyHolderView.js.map +1 -1
  80. package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_PropertyView.d.ts +1 -1
  81. package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_PropertyView.d.ts.map +1 -1
  82. package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_PropertyView.js.map +1 -1
  83. package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_RelationshipView.d.ts +1 -1
  84. package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_RelationshipView.d.ts.map +1 -1
  85. package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_RelationshipView.js.map +1 -1
  86. package/lib/models/protocols/pure/v1/model/packageableElements/diagram/geometry/V1_Point.d.ts +1 -1
  87. package/lib/models/protocols/pure/v1/model/packageableElements/diagram/geometry/V1_Point.d.ts.map +1 -1
  88. package/lib/models/protocols/pure/v1/model/packageableElements/diagram/geometry/V1_Point.js.map +1 -1
  89. package/lib/models/protocols/pure/v1/model/packageableElements/diagram/geometry/V1_PositionedRectangle.d.ts +1 -1
  90. package/lib/models/protocols/pure/v1/model/packageableElements/diagram/geometry/V1_PositionedRectangle.d.ts.map +1 -1
  91. package/lib/models/protocols/pure/v1/model/packageableElements/diagram/geometry/V1_PositionedRectangle.js.map +1 -1
  92. package/lib/models/protocols/pure/v1/model/packageableElements/diagram/geometry/V1_Rectangle.d.ts +1 -1
  93. package/lib/models/protocols/pure/v1/model/packageableElements/diagram/geometry/V1_Rectangle.d.ts.map +1 -1
  94. package/lib/models/protocols/pure/v1/model/packageableElements/diagram/geometry/V1_Rectangle.js.map +1 -1
  95. package/lib/stores/studio/DiagramEditorState.d.ts +3 -4
  96. package/lib/stores/studio/DiagramEditorState.d.ts.map +1 -1
  97. package/lib/stores/studio/DiagramEditorState.js +5 -3
  98. package/lib/stores/studio/DiagramEditorState.js.map +1 -1
  99. package/package.json +20 -20
  100. package/src/DiagramRenderer.ts +54 -29
  101. package/src/components/studio/DSLDiagram_LegendStudioPlugin.tsx +15 -20
  102. package/src/components/studio/DiagramEditor.tsx +34 -34
  103. package/src/components/studio/InheritanceDiagramRenderer.ts +4 -2
  104. package/src/graph/DSLDiagram_PureGraphPlugin.ts +5 -10
  105. package/src/graphManager/DSLDiagram_PureGraphManagerPlugin.ts +4 -9
  106. package/src/models/metamodels/pure/packageableElements/diagram/AssociationView.ts +1 -2
  107. package/src/models/metamodels/pure/packageableElements/diagram/ClassView.ts +1 -2
  108. package/src/models/metamodels/pure/packageableElements/diagram/ClassViewReference.ts +2 -4
  109. package/src/models/metamodels/pure/packageableElements/diagram/Diagram.ts +10 -4
  110. package/src/models/metamodels/pure/packageableElements/diagram/GeneralizationView.ts +1 -2
  111. package/src/models/metamodels/pure/packageableElements/diagram/PropertyHolderView.ts +1 -2
  112. package/src/models/metamodels/pure/packageableElements/diagram/PropertyView.ts +1 -2
  113. package/src/models/metamodels/pure/packageableElements/diagram/RelationshipView.ts +1 -2
  114. package/src/models/metamodels/pure/packageableElements/diagram/geometry/Point.ts +1 -2
  115. package/src/models/metamodels/pure/packageableElements/diagram/geometry/PositionedRectangle.ts +1 -2
  116. package/src/models/metamodels/pure/packageableElements/diagram/geometry/Rectangle.ts +1 -2
  117. package/src/models/protocols/pure/DSLDiagram_PureProtocolProcessorPlugin.ts +9 -17
  118. package/src/models/protocols/pure/v1/model/packageableElements/diagram/V1_ClassView.ts +1 -2
  119. package/src/models/protocols/pure/v1/model/packageableElements/diagram/V1_Diagram.ts +5 -4
  120. package/src/models/protocols/pure/v1/model/packageableElements/diagram/V1_GeneralizationView.ts +1 -2
  121. package/src/models/protocols/pure/v1/model/packageableElements/diagram/V1_PropertyHolderView.ts +1 -2
  122. package/src/models/protocols/pure/v1/model/packageableElements/diagram/V1_PropertyView.ts +1 -2
  123. package/src/models/protocols/pure/v1/model/packageableElements/diagram/V1_RelationshipView.ts +1 -2
  124. package/src/models/protocols/pure/v1/model/packageableElements/diagram/geometry/V1_Point.ts +1 -2
  125. package/src/models/protocols/pure/v1/model/packageableElements/diagram/geometry/V1_PositionedRectangle.ts +1 -2
  126. package/src/models/protocols/pure/v1/model/packageableElements/diagram/geometry/V1_Rectangle.ts +1 -2
  127. package/src/stores/studio/DiagramEditorState.ts +15 -10
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finos/legend-extension-dsl-diagram",
3
- "version": "1.0.2",
3
+ "version": "1.0.7",
4
4
  "description": "Legend extension for Diagram DSL",
5
5
  "keywords": [
6
6
  "legend",
@@ -27,7 +27,9 @@
27
27
  "build": "yarn clean && yarn build:sass && yarn build:tsc",
28
28
  "build:sass": "cross-env INIT_CWD=$INIT_CWD node ../../scripts/workflow/buildSass.js",
29
29
  "build:tsc": "tsc --project ./tsconfig.build.json",
30
- "clean": "rimraf \"lib\" \"build\"",
30
+ "clean": "npm-run-all clean:cache clean:lib",
31
+ "clean:cache": "rimraf \"build\"",
32
+ "clean:lib": "rimraf \"lib\"",
31
33
  "dev": "npm-run-all --parallel dev:sass dev:tsc",
32
34
  "dev:sass": "sass style lib --watch --load-path=../../node_modules/@finos/legend-art/scss",
33
35
  "dev:tsc": "tsc --watch --preserveWatchOutput",
@@ -38,34 +40,32 @@
38
40
  "test:watch": "jest --watch"
39
41
  },
40
42
  "dependencies": {
41
- "@finos/legend-application": "0.2.2",
42
- "@finos/legend-art": "0.1.2",
43
- "@finos/legend-graph": "0.2.5",
44
- "@finos/legend-model-storage": "0.0.9",
45
- "@finos/legend-shared": "0.0.9",
46
- "@finos/legend-studio": "2.0.2",
47
- "@material-ui/core": "4.12.3",
48
- "@types/react": "17.0.36",
49
- "mobx": "6.3.7",
50
- "mobx-react-lite": "3.2.2",
43
+ "@finos/legend-application": "1.1.0",
44
+ "@finos/legend-art": "0.3.0",
45
+ "@finos/legend-graph": "1.0.0",
46
+ "@finos/legend-model-storage": "0.0.13",
47
+ "@finos/legend-shared": "1.1.0",
48
+ "@finos/legend-studio": "2.3.0",
49
+ "@types/react": "17.0.38",
50
+ "mobx": "6.3.12",
51
+ "mobx-react-lite": "3.2.3",
51
52
  "react": "17.0.2",
52
- "react-dnd": "14.0.4",
53
+ "react-dnd": "14.0.5",
53
54
  "react-dom": "17.0.2",
54
- "react-icons": "4.3.1",
55
- "react-resize-detector": "6.7.6",
55
+ "react-resize-detector": "7.0.0",
56
56
  "serializr": "2.0.5"
57
57
  },
58
58
  "devDependencies": {
59
- "@finos/legend-dev-utils": "0.2.1",
59
+ "@finos/legend-dev-utils": "0.3.4",
60
60
  "@testing-library/react": "12.1.2",
61
61
  "cross-env": "7.0.3",
62
- "eslint": "8.3.0",
63
- "jest": "27.3.1",
62
+ "eslint": "8.7.0",
63
+ "jest": "27.4.7",
64
64
  "jest-canvas-mock": "2.3.1",
65
65
  "npm-run-all": "4.1.5",
66
66
  "rimraf": "3.0.2",
67
- "sass": "1.43.4",
68
- "typescript": "4.5.2"
67
+ "sass": "1.49.0",
68
+ "typescript": "4.5.4"
69
69
  },
70
70
  "peerDependencies": {
71
71
  "react": "^17.0.0"
@@ -24,8 +24,8 @@ import {
24
24
  findLast,
25
25
  uniqBy,
26
26
  } from '@finos/legend-shared';
27
- import type { AbstractProperty } from '@finos/legend-graph';
28
27
  import {
28
+ type AbstractProperty,
29
29
  Class,
30
30
  Enumeration,
31
31
  PrimitiveType,
@@ -45,8 +45,10 @@ import { PositionedRectangle } from './models/metamodels/pure/packageableElement
45
45
  import { ClassView } from './models/metamodels/pure/packageableElements/diagram/ClassView';
46
46
  import type { PropertyHolderView } from './models/metamodels/pure/packageableElements/diagram/PropertyHolderView';
47
47
  import { GeneralizationView } from './models/metamodels/pure/packageableElements/diagram/GeneralizationView';
48
- import type { RelationshipView } from './models/metamodels/pure/packageableElements/diagram/RelationshipView';
49
- import { manageInsidePointsDynamically } from './models/metamodels/pure/packageableElements/diagram/RelationshipView';
48
+ import {
49
+ type RelationshipView,
50
+ manageInsidePointsDynamically,
51
+ } from './models/metamodels/pure/packageableElements/diagram/RelationshipView';
50
52
  import { PropertyView } from './models/metamodels/pure/packageableElements/diagram/PropertyView';
51
53
  import { getElementPosition } from './helpers/DiagramHelper';
52
54
  import { AssociationView } from './models/metamodels/pure/packageableElements/diagram/AssociationView';
@@ -222,9 +224,22 @@ export class DiagramRenderer {
222
224
  // interactions
223
225
  onAddClassViewClick: (point: Point) => void = noop();
224
226
  onClassViewRightClick: (classView: ClassView, point: Point) => void = noop();
225
- onBackgroundDoubleClick: (point: Point) => void = noop();
226
- onClassViewDoubleClick: (classView: ClassView, point: Point) => void = noop();
227
- onClassNameDoubleClick: (classView: ClassView, point: Point) => void = noop();
227
+
228
+ onBackgroundDoubleClick?: ((point: Point) => void) | undefined;
229
+ onClassViewDoubleClick?:
230
+ | ((classView: ClassView, point: Point) => void)
231
+ | undefined;
232
+ onClassNameDoubleClick?:
233
+ | ((classView: ClassView, point: Point) => void)
234
+ | undefined;
235
+ onClassPropertyDoubleClick?:
236
+ | ((
237
+ property: AbstractProperty,
238
+ point: Point,
239
+ propertyHolderView: PropertyHolderView | undefined,
240
+ ) => void)
241
+ | undefined;
242
+
228
243
  handleEditClassView: (classView: ClassView) => void = noop();
229
244
  handleEditProperty: (
230
245
  property: AbstractProperty,
@@ -557,11 +572,11 @@ export class DiagramRenderer {
557
572
  // Do not allow creating self-inheritance
558
573
  startClassView.class.value !== targetClassView.class.value &&
559
574
  // Avoid creating inhertance that already existed
560
- !startClassView.class.value.allSuperClasses.includes(
575
+ !startClassView.class.value.allSuperclasses.includes(
561
576
  targetClassView.class.value,
562
577
  ) &&
563
578
  // Avoid loop (might be expensive)
564
- !targetClassView.class.value.allSuperClasses.includes(
579
+ !targetClassView.class.value.allSuperclasses.includes(
565
580
  startClassView.class.value,
566
581
  )
567
582
  ) {
@@ -2278,7 +2293,7 @@ export class DiagramRenderer {
2278
2293
  else if ('ArrowDown' === e.key) {
2279
2294
  const views = uniqBy(
2280
2295
  this.selectedClasses.flatMap((x) =>
2281
- x.class.value._subClasses.flatMap(
2296
+ x.class.value.subclasses.flatMap(
2282
2297
  (c) =>
2283
2298
  new ClassView(
2284
2299
  this.diagram,
@@ -2477,21 +2492,25 @@ export class DiagramRenderer {
2477
2492
 
2478
2493
  // Check double click on class property
2479
2494
  if (this.mouseOverClassProperty) {
2480
- this.handleEditProperty(
2481
- this.mouseOverClassProperty,
2482
- eventPointInModelCoordinate,
2483
- undefined,
2484
- );
2485
- return;
2495
+ if (this.onClassPropertyDoubleClick) {
2496
+ this.onClassPropertyDoubleClick(
2497
+ this.mouseOverClassProperty,
2498
+ eventPointInModelCoordinate,
2499
+ undefined,
2500
+ );
2501
+ return;
2502
+ }
2486
2503
  }
2487
2504
 
2488
2505
  // Check double click on class name
2489
2506
  if (this.mouseOverClassName) {
2490
- this.onClassNameDoubleClick(
2491
- this.mouseOverClassName,
2492
- eventPointInModelCoordinate,
2493
- );
2494
- return;
2507
+ if (this.onClassNameDoubleClick) {
2508
+ this.onClassNameDoubleClick(
2509
+ this.mouseOverClassName,
2510
+ eventPointInModelCoordinate,
2511
+ );
2512
+ return;
2513
+ }
2495
2514
  }
2496
2515
 
2497
2516
  // Check double click on class view
@@ -2502,22 +2521,28 @@ export class DiagramRenderer {
2502
2521
  ),
2503
2522
  );
2504
2523
  if (selectedClass) {
2505
- this.onClassViewDoubleClick(selectedClass, eventPointInModelCoordinate);
2506
- return;
2524
+ if (this.onClassViewDoubleClick) {
2525
+ this.onClassViewDoubleClick(selectedClass, eventPointInModelCoordinate);
2526
+ return;
2527
+ }
2507
2528
  }
2508
2529
 
2509
2530
  // Check double click on line property label
2510
2531
  if (this.mouseOverPropertyHolderViewLabel) {
2511
- this.handleEditProperty(
2512
- this.mouseOverPropertyHolderViewLabel.property.value,
2513
- eventPointInModelCoordinate,
2514
- this.mouseOverPropertyHolderViewLabel,
2515
- );
2516
- return;
2532
+ if (this.onClassPropertyDoubleClick) {
2533
+ this.onClassPropertyDoubleClick(
2534
+ this.mouseOverPropertyHolderViewLabel.property.value,
2535
+ eventPointInModelCoordinate,
2536
+ this.mouseOverPropertyHolderViewLabel,
2537
+ );
2538
+ return;
2539
+ }
2517
2540
  }
2518
2541
 
2519
2542
  // Check double click on background
2520
- this.onBackgroundDoubleClick(eventPointInModelCoordinate);
2543
+ if (this.onBackgroundDoubleClick) {
2544
+ this.onBackgroundDoubleClick(eventPointInModelCoordinate);
2545
+ }
2521
2546
  return;
2522
2547
  }
2523
2548
 
@@ -15,23 +15,22 @@
15
15
  */
16
16
 
17
17
  import packageJson from '../../../package.json';
18
- import type {
19
- LegendStudioPluginManager,
20
- NewElementFromStateCreator,
21
- EditorStore,
22
- ElementEditorState,
23
- ElementEditorStateCreator,
24
- ElementTypeGetter,
25
- ElementProjectExplorerDnDTypeGetter,
26
- ElementIconGetter,
27
- ElementEditorRenderer,
28
- DSL_LegendStudioPlugin_Extension,
29
- NewElementState,
30
- ElementEditorPostDeleteAction,
31
- ElementEditorPostRenameAction,
32
- ClassPreviewRenderer,
18
+ import {
19
+ LegendStudioPlugin,
20
+ type NewElementFromStateCreator,
21
+ type EditorStore,
22
+ type ElementEditorState,
23
+ type ElementEditorStateCreator,
24
+ type ElementTypeGetter,
25
+ type ElementProjectExplorerDnDTypeGetter,
26
+ type ElementIconGetter,
27
+ type ElementEditorRenderer,
28
+ type DSL_LegendStudioPlugin_Extension,
29
+ type NewElementState,
30
+ type ElementEditorPostDeleteAction,
31
+ type ElementEditorPostRenameAction,
32
+ type ClassPreviewRenderer,
33
33
  } from '@finos/legend-studio';
34
- import { LegendStudioPlugin } from '@finos/legend-studio';
35
34
  import { ShapesIcon } from '@finos/legend-art';
36
35
  import type { Class, PackageableElement } from '@finos/legend-graph';
37
36
  import { Diagram } from '../../models/metamodels/pure/packageableElements/diagram/Diagram';
@@ -50,10 +49,6 @@ export class DSLDiagram_LegendStudioPlugin
50
49
  super(packageJson.extensions.studioPlugin, packageJson.version);
51
50
  }
52
51
 
53
- install(pluginManager: LegendStudioPluginManager): void {
54
- pluginManager.registerStudioPlugin(this);
55
- }
56
-
57
52
  override getExtraClassPreviewRenderers(): ClassPreviewRenderer[] {
58
53
  return [
59
54
  (_class: Class): React.ReactNode => (
@@ -16,9 +16,7 @@
16
16
 
17
17
  import { useRef, useState, useEffect, useCallback, Fragment } from 'react';
18
18
  import { useResizeDetector } from 'react-resize-detector';
19
- import type { DropTargetMonitor } from 'react-dnd';
20
- import { useDrop } from 'react-dnd';
21
- import { FaRegKeyboard } from 'react-icons/fa';
19
+ import { type DropTargetMonitor, useDrop } from 'react-dnd';
22
20
  import { observer } from 'mobx-react-lite';
23
21
  import {
24
22
  DiagramRenderer,
@@ -26,18 +24,16 @@ import {
26
24
  DIAGRAM_RELATIONSHIP_EDIT_MODE,
27
25
  DIAGRAM_ZOOM_LEVELS,
28
26
  } from '../../DiagramRenderer';
29
- import type {
30
- DiagramEditorInlineClassCreatorState,
31
- DiagramEditorInlineClassRenamerState,
32
- DiagramEditorInlinePropertyEditorState,
33
- } from '../../stores/studio/DiagramEditorState';
34
27
  import {
28
+ type DiagramEditorInlineClassCreatorState,
29
+ type DiagramEditorInlineClassRenamerState,
30
+ type DiagramEditorInlinePropertyEditorState,
35
31
  DIAGRAM_EDITOR_SIDE_PANEL_TAB,
36
32
  DiagramEditorClassViewEditorSidePanelState,
37
33
  DiagramEditorState,
38
34
  } from '../../stores/studio/DiagramEditorState';
39
- import type { ResizablePanelHandlerProps } from '@finos/legend-art';
40
35
  import {
36
+ type ResizablePanelHandlerProps,
41
37
  ContextMenu,
42
38
  getControlledResizablePanelProps,
43
39
  BasePopover,
@@ -47,6 +43,7 @@ import {
47
43
  clsx,
48
44
  createFilter,
49
45
  CustomSelectorInput,
46
+ KeyboardIcon,
50
47
  DropdownMenu,
51
48
  MenuContent,
52
49
  MenuContentDivider,
@@ -56,9 +53,19 @@ import {
56
53
  ResizablePanelGroup,
57
54
  ResizablePanelSplitter,
58
55
  ResizablePanel,
56
+ ResizeIcon,
57
+ MinusIcon,
58
+ MousePointerIcon,
59
+ MoveIcon,
60
+ PlusCircleIcon,
61
+ SidebarIcon,
62
+ TriangleIcon,
63
+ ZoomInIcon,
64
+ ZoomOutIcon,
65
+ Dialog,
59
66
  } from '@finos/legend-art';
60
- import type { Type } from '@finos/legend-graph';
61
67
  import {
68
+ type Type,
62
69
  Class,
63
70
  DerivedProperty,
64
71
  Property,
@@ -71,26 +78,16 @@ import {
71
78
  isValidPathIdentifier,
72
79
  resolvePackagePathAndElementName,
73
80
  } from '@finos/legend-graph';
74
- import {
75
- FiMinus,
76
- FiMousePointer,
77
- FiMove,
78
- FiPlusCircle,
79
- FiSidebar,
80
- FiTriangle,
81
- FiZoomIn,
82
- FiZoomOut,
83
- } from 'react-icons/fi';
84
- import { IoResize } from 'react-icons/io5';
85
- import { Dialog } from '@material-ui/core';
86
81
  import {
87
82
  guaranteeNonNullable,
88
83
  isNonNullable,
89
84
  prettyCONSTName,
90
85
  } from '@finos/legend-shared';
91
86
  import { flowResult } from 'mobx';
92
- import type { PackageableElementOption } from '@finos/legend-application';
93
- import { useApplicationStore } from '@finos/legend-application';
87
+ import {
88
+ type PackageableElementOption,
89
+ useApplicationStore,
90
+ } from '@finos/legend-application';
94
91
  import {
95
92
  ClassFormEditor,
96
93
  CORE_DND_TYPE,
@@ -148,6 +145,9 @@ const DiagramRendererHotkeyInfosModal = observer(
148
145
  container: 'editor-modal__container',
149
146
  paper: 'editor-modal__content--scrollable',
150
147
  }}
148
+ TransitionProps={{
149
+ appear: false, // disable transition
150
+ }}
151
151
  >
152
152
  <div className="modal modal--dark modal--scrollable diagram-editor__hotkeys__dialog">
153
153
  <div className="modal__header">
@@ -347,7 +347,7 @@ const DiagramEditorToolPanel = observer(
347
347
  )}
348
348
  title="View Tool (V)"
349
349
  >
350
- <FiMousePointer className="diagram-editor__icon--layout" />
350
+ <MousePointerIcon className="diagram-editor__icon--layout" />
351
351
  </button>
352
352
  <button
353
353
  className={clsx('diagram-editor__tool', {
@@ -361,7 +361,7 @@ const DiagramEditorToolPanel = observer(
361
361
  )}
362
362
  title="Pan Tool (M)"
363
363
  >
364
- <FiMove className="diagram-editor__icon--pan" />
364
+ <MoveIcon className="diagram-editor__icon--pan" />
365
365
  </button>
366
366
  <button
367
367
  className={clsx('diagram-editor__tool', {
@@ -375,7 +375,7 @@ const DiagramEditorToolPanel = observer(
375
375
  DIAGRAM_RELATIONSHIP_EDIT_MODE.NONE,
376
376
  )}
377
377
  >
378
- <FiZoomIn className="diagram-editor__icon--zoom-in" />
378
+ <ZoomInIcon className="diagram-editor__icon--zoom-in" />
379
379
  </button>
380
380
  <button
381
381
  className={clsx('diagram-editor__tool', {
@@ -389,7 +389,7 @@ const DiagramEditorToolPanel = observer(
389
389
  DIAGRAM_RELATIONSHIP_EDIT_MODE.NONE,
390
390
  )}
391
391
  >
392
- <FiZoomOut className="diagram-editor__icon--zoom-out" />
392
+ <ZoomOutIcon className="diagram-editor__icon--zoom-out" />
393
393
  </button>
394
394
  <div className="diagram-editor__tools__divider" />
395
395
  <button
@@ -408,7 +408,7 @@ const DiagramEditorToolPanel = observer(
408
408
  DIAGRAM_RELATIONSHIP_EDIT_MODE.PROPERTY,
409
409
  )}
410
410
  >
411
- <FiMinus className="diagram-editor__icon--property" />
411
+ <MinusIcon className="diagram-editor__icon--property" />
412
412
  </button>
413
413
  <button
414
414
  className={clsx('diagram-editor__tool', {
@@ -426,7 +426,7 @@ const DiagramEditorToolPanel = observer(
426
426
  DIAGRAM_RELATIONSHIP_EDIT_MODE.INHERITANCE,
427
427
  )}
428
428
  >
429
- <FiTriangle className="diagram-editor__icon--inheritance" />
429
+ <TriangleIcon className="diagram-editor__icon--inheritance" />
430
430
  </button>
431
431
  <button
432
432
  className={clsx('diagram-editor__tool', {
@@ -443,7 +443,7 @@ const DiagramEditorToolPanel = observer(
443
443
  // DIAGRAM_RELATIONSHIP_EDIT_MODE.ASSOCIATION,
444
444
  // )}
445
445
  >
446
- <IoResize className="diagram-editor__icon--association" />
446
+ <ResizeIcon className="diagram-editor__icon--association" />
447
447
  </button>
448
448
  <button
449
449
  className={clsx('diagram-editor__tool', {
@@ -458,7 +458,7 @@ const DiagramEditorToolPanel = observer(
458
458
  DIAGRAM_RELATIONSHIP_EDIT_MODE.NONE,
459
459
  )}
460
460
  >
461
- <FiPlusCircle className="diagram-editor__icon--add-class" />
461
+ <PlusCircleIcon className="diagram-editor__icon--add-class" />
462
462
  </button>
463
463
  <div className="diagram-editor__tools__divider" />
464
464
  <button
@@ -467,7 +467,7 @@ const DiagramEditorToolPanel = observer(
467
467
  title="Show Hotkeys"
468
468
  onClick={showDiagramRendererHokeysModal}
469
469
  >
470
- <FaRegKeyboard className="diagram-editor__icon--hotkey-info" />
470
+ <KeyboardIcon className="diagram-editor__icon--hotkey-info" />
471
471
  </button>
472
472
  <DiagramRendererHotkeyInfosModal
473
473
  open={diagramEditorState.showHotkeyInfosModal}
@@ -1297,7 +1297,7 @@ const DiagramEditorHeader = observer(
1297
1297
  tabIndex={-1}
1298
1298
  onClick={toggleSidePanel}
1299
1299
  >
1300
- <FiSidebar className="diagram-editor__icon--sidebar" />
1300
+ <SidebarIcon className="diagram-editor__icon--sidebar" />
1301
1301
  </button>
1302
1302
  </div>
1303
1303
  </>
@@ -16,8 +16,10 @@
16
16
 
17
17
  import { DiagramRenderer } from '../../DiagramRenderer';
18
18
  import { uuid } from '@finos/legend-shared';
19
- import type { Class } from '@finos/legend-graph';
20
- import { PackageableElementExplicitReference } from '@finos/legend-graph';
19
+ import {
20
+ type Class,
21
+ PackageableElementExplicitReference,
22
+ } from '@finos/legend-graph';
21
23
  import { Diagram } from '../../models/metamodels/pure/packageableElements/diagram/Diagram';
22
24
  import { ClassView } from '../../models/metamodels/pure/packageableElements/diagram/ClassView';
23
25
 
@@ -16,13 +16,12 @@
16
16
 
17
17
  import packageJson from '../../package.json';
18
18
  import type { Clazz } from '@finos/legend-shared';
19
- import type {
20
- DeadReferencesCleaner,
21
- GraphPluginManager,
22
- PackageableElement,
23
- PureModel,
19
+ import {
20
+ PureGraphPlugin,
21
+ type DeadReferencesCleaner,
22
+ type PackageableElement,
23
+ type PureModel,
24
24
  } from '@finos/legend-graph';
25
- import { PureGraphPlugin } from '@finos/legend-graph';
26
25
  import { Diagram } from '../models/metamodels/pure/packageableElements/diagram/Diagram';
27
26
  import { cleanUpDeadReferencesInDiagram } from '../helpers/DiagramHelper';
28
27
 
@@ -31,10 +30,6 @@ export class DSLDiagram_PureGraphPlugin extends PureGraphPlugin {
31
30
  super(packageJson.extensions.pureGraphPlugin, packageJson.version);
32
31
  }
33
32
 
34
- install(pluginManager: GraphPluginManager): void {
35
- pluginManager.registerPureGraphPlugin(this);
36
- }
37
-
38
33
  override getExtraPureGraphExtensionClasses(): Clazz<PackageableElement>[] {
39
34
  return [Diagram];
40
35
  }
@@ -15,12 +15,11 @@
15
15
  */
16
16
 
17
17
  import packageJson from '../../package.json';
18
- import type {
19
- GraphPluginManager,
20
- PackageableElement,
21
- PureGrammarElementLabeler,
18
+ import {
19
+ PureGraphManagerPlugin,
20
+ type PackageableElement,
21
+ type PureGrammarElementLabeler,
22
22
  } from '@finos/legend-graph';
23
- import { PureGraphManagerPlugin } from '@finos/legend-graph';
24
23
  import { Diagram } from '../models/metamodels/pure/packageableElements/diagram/Diagram';
25
24
 
26
25
  const PURE_GRAMMAR_DIAGRAM_PARSER_NAME = 'Diagram';
@@ -31,10 +30,6 @@ export class DSLDiagram_PureGraphManagerPlugin extends PureGraphManagerPlugin {
31
30
  super(packageJson.extensions.pureGraphManagerPlugin, packageJson.version);
32
31
  }
33
32
 
34
- install(pluginManager: GraphPluginManager): void {
35
- pluginManager.registerPureGraphManagerPlugin(this);
36
- }
37
-
38
33
  override getExtraPureGrammarParserNames(): string[] {
39
34
  return [PURE_GRAMMAR_DIAGRAM_PARSER_NAME];
40
35
  }
@@ -15,8 +15,7 @@
15
15
  */
16
16
 
17
17
  import { computed, makeObservable } from 'mobx';
18
- import { hashArray } from '@finos/legend-shared';
19
- import type { Hashable } from '@finos/legend-shared';
18
+ import { hashArray, type Hashable } from '@finos/legend-shared';
20
19
  import { PropertyHolderView } from './PropertyHolderView';
21
20
  import type { ClassView } from './ClassView';
22
21
  import type { Diagram } from './Diagram';
@@ -15,8 +15,7 @@
15
15
  */
16
16
 
17
17
  import { computed, observable, action, makeObservable } from 'mobx';
18
- import { hashArray } from '@finos/legend-shared';
19
- import type { Hashable } from '@finos/legend-shared';
18
+ import { hashArray, type Hashable } from '@finos/legend-shared';
20
19
  import { PositionedRectangle } from './geometry/PositionedRectangle';
21
20
  import { Rectangle } from './geometry/Rectangle';
22
21
  import { Point } from './geometry/Point';
@@ -20,10 +20,8 @@ import type { ClassView } from './ClassView';
20
20
  import {
21
21
  PackageableElementExplicitReference,
22
22
  ReferenceWithOwner,
23
- } from '@finos/legend-graph';
24
- import type {
25
- PackageableElementImplicitReference,
26
- PackageableElementReference,
23
+ type PackageableElementImplicitReference,
24
+ type PackageableElementReference,
27
25
  } from '@finos/legend-graph';
28
26
 
29
27
  export abstract class ClassViewReference extends ReferenceWithOwner {
@@ -15,14 +15,20 @@
15
15
  */
16
16
 
17
17
  import { observable, action, makeObservable, override } from 'mobx';
18
- import { hashArray, addUniqueEntry, deleteEntry } from '@finos/legend-shared';
19
- import type { Hashable } from '@finos/legend-shared';
18
+ import {
19
+ hashArray,
20
+ addUniqueEntry,
21
+ deleteEntry,
22
+ type Hashable,
23
+ } from '@finos/legend-shared';
20
24
  import type { ClassView } from './ClassView';
21
25
  import type { PropertyView } from './PropertyView';
22
26
  import type { GeneralizationView } from './GeneralizationView';
23
27
  import type { AssociationView } from './AssociationView';
24
- import type { PackageableElementVisitor } from '@finos/legend-graph';
25
- import { PackageableElement } from '@finos/legend-graph';
28
+ import {
29
+ type PackageableElementVisitor,
30
+ PackageableElement,
31
+ } from '@finos/legend-graph';
26
32
  import { DIAGRAM_HASH_STRUCTURE } from '../../../../DSLDiagram_ModelUtils';
27
33
 
28
34
  export class Diagram extends PackageableElement implements Hashable {
@@ -15,8 +15,7 @@
15
15
  */
16
16
 
17
17
  import { computed, makeObservable } from 'mobx';
18
- import { hashArray } from '@finos/legend-shared';
19
- import type { Hashable } from '@finos/legend-shared';
18
+ import { hashArray, type Hashable } from '@finos/legend-shared';
20
19
  import { RelationshipView } from './RelationshipView';
21
20
  import type { Diagram } from './Diagram';
22
21
  import type { ClassView } from './ClassView';
@@ -14,8 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import { hashArray } from '@finos/legend-shared';
18
- import type { Hashable } from '@finos/legend-shared';
17
+ import { hashArray, type Hashable } from '@finos/legend-shared';
19
18
  import { RelationshipView } from './RelationshipView';
20
19
  import type { ClassView } from './ClassView';
21
20
  import type { Diagram } from './Diagram';
@@ -15,8 +15,7 @@
15
15
  */
16
16
 
17
17
  import { computed, makeObservable } from 'mobx';
18
- import { hashArray } from '@finos/legend-shared';
19
- import type { Hashable } from '@finos/legend-shared';
18
+ import { hashArray, type Hashable } from '@finos/legend-shared';
20
19
  import { PropertyHolderView } from './PropertyHolderView';
21
20
  import type { Diagram } from './Diagram';
22
21
  import type { ClassView } from './ClassView';
@@ -15,8 +15,7 @@
15
15
  */
16
16
 
17
17
  import { observable, action, computed, makeObservable } from 'mobx';
18
- import { hashArray, changeEntry } from '@finos/legend-shared';
19
- import type { Hashable } from '@finos/legend-shared';
18
+ import { hashArray, changeEntry, type Hashable } from '@finos/legend-shared';
20
19
  import { RelationShipEdgeView as RelationshipEdgeView } from './RelationshipEdgeView';
21
20
  import { Point } from './geometry/Point';
22
21
  import type { ClassView } from './ClassView';
@@ -14,8 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import { hashArray } from '@finos/legend-shared';
18
- import type { Hashable } from '@finos/legend-shared';
17
+ import { hashArray, type Hashable } from '@finos/legend-shared';
19
18
  import { DIAGRAM_HASH_STRUCTURE } from '../../../../../DSLDiagram_ModelUtils';
20
19
 
21
20
  export class Point implements Hashable {
@@ -15,8 +15,7 @@
15
15
  */
16
16
 
17
17
  import { observable, action, makeObservable } from 'mobx';
18
- import { hashArray } from '@finos/legend-shared';
19
- import type { Hashable } from '@finos/legend-shared';
18
+ import { hashArray, type Hashable } from '@finos/legend-shared';
20
19
  import { Point } from './Point';
21
20
  import { Rectangle } from './Rectangle';
22
21
  import { DIAGRAM_HASH_STRUCTURE } from '../../../../../DSLDiagram_ModelUtils';