@finos/legend-extension-dsl-diagram 1.0.3 → 1.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (126) 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 -2
  9. package/lib/components/studio/DSLDiagram_LegendStudioPlugin.d.ts.map +1 -1
  10. package/lib/components/studio/DSLDiagram_LegendStudioPlugin.js +1 -1
  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 -2
  21. package/lib/graph/DSLDiagram_PureGraphPlugin.d.ts.map +1 -1
  22. package/lib/graph/DSLDiagram_PureGraphPlugin.js +1 -1
  23. package/lib/graph/DSLDiagram_PureGraphPlugin.js.map +1 -1
  24. package/lib/graphManager/DSLDiagram_PureGraphManagerPlugin.d.ts +1 -2
  25. package/lib/graphManager/DSLDiagram_PureGraphManagerPlugin.d.ts.map +1 -1
  26. package/lib/graphManager/DSLDiagram_PureGraphManagerPlugin.js +1 -1
  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 -2
  64. package/lib/models/protocols/pure/DSLDiagram_PureProtocolProcessorPlugin.d.ts.map +1 -1
  65. package/lib/models/protocols/pure/DSLDiagram_PureProtocolProcessorPlugin.js.map +1 -1
  66. package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_ClassView.d.ts +1 -1
  67. package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_ClassView.d.ts.map +1 -1
  68. package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_ClassView.js.map +1 -1
  69. package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_Diagram.d.ts +2 -3
  70. package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_Diagram.d.ts.map +1 -1
  71. package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_Diagram.js +1 -1
  72. package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_Diagram.js.map +1 -1
  73. package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_GeneralizationView.d.ts +1 -1
  74. package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_GeneralizationView.d.ts.map +1 -1
  75. package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_GeneralizationView.js.map +1 -1
  76. package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_PropertyHolderView.d.ts +1 -1
  77. package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_PropertyHolderView.d.ts.map +1 -1
  78. package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_PropertyHolderView.js.map +1 -1
  79. package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_PropertyView.d.ts +1 -1
  80. package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_PropertyView.d.ts.map +1 -1
  81. package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_PropertyView.js.map +1 -1
  82. package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_RelationshipView.d.ts +1 -1
  83. package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_RelationshipView.d.ts.map +1 -1
  84. package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_RelationshipView.js.map +1 -1
  85. package/lib/models/protocols/pure/v1/model/packageableElements/diagram/geometry/V1_Point.d.ts +1 -1
  86. package/lib/models/protocols/pure/v1/model/packageableElements/diagram/geometry/V1_Point.d.ts.map +1 -1
  87. package/lib/models/protocols/pure/v1/model/packageableElements/diagram/geometry/V1_Point.js.map +1 -1
  88. package/lib/models/protocols/pure/v1/model/packageableElements/diagram/geometry/V1_PositionedRectangle.d.ts +1 -1
  89. package/lib/models/protocols/pure/v1/model/packageableElements/diagram/geometry/V1_PositionedRectangle.d.ts.map +1 -1
  90. package/lib/models/protocols/pure/v1/model/packageableElements/diagram/geometry/V1_PositionedRectangle.js.map +1 -1
  91. package/lib/models/protocols/pure/v1/model/packageableElements/diagram/geometry/V1_Rectangle.d.ts +1 -1
  92. package/lib/models/protocols/pure/v1/model/packageableElements/diagram/geometry/V1_Rectangle.d.ts.map +1 -1
  93. package/lib/models/protocols/pure/v1/model/packageableElements/diagram/geometry/V1_Rectangle.js.map +1 -1
  94. package/lib/stores/studio/DiagramEditorState.d.ts +3 -4
  95. package/lib/stores/studio/DiagramEditorState.d.ts.map +1 -1
  96. package/lib/stores/studio/DiagramEditorState.js +5 -3
  97. package/lib/stores/studio/DiagramEditorState.js.map +1 -1
  98. package/package.json +20 -20
  99. package/src/DiagramRenderer.ts +54 -29
  100. package/src/components/studio/DSLDiagram_LegendStudioPlugin.tsx +15 -15
  101. package/src/components/studio/DiagramEditor.tsx +34 -34
  102. package/src/components/studio/InheritanceDiagramRenderer.ts +4 -2
  103. package/src/graph/DSLDiagram_PureGraphPlugin.ts +5 -5
  104. package/src/graphManager/DSLDiagram_PureGraphManagerPlugin.ts +4 -4
  105. package/src/models/metamodels/pure/packageableElements/diagram/AssociationView.ts +1 -2
  106. package/src/models/metamodels/pure/packageableElements/diagram/ClassView.ts +1 -2
  107. package/src/models/metamodels/pure/packageableElements/diagram/ClassViewReference.ts +2 -4
  108. package/src/models/metamodels/pure/packageableElements/diagram/Diagram.ts +10 -4
  109. package/src/models/metamodels/pure/packageableElements/diagram/GeneralizationView.ts +1 -2
  110. package/src/models/metamodels/pure/packageableElements/diagram/PropertyHolderView.ts +1 -2
  111. package/src/models/metamodels/pure/packageableElements/diagram/PropertyView.ts +1 -2
  112. package/src/models/metamodels/pure/packageableElements/diagram/RelationshipView.ts +1 -2
  113. package/src/models/metamodels/pure/packageableElements/diagram/geometry/Point.ts +1 -2
  114. package/src/models/metamodels/pure/packageableElements/diagram/geometry/PositionedRectangle.ts +1 -2
  115. package/src/models/metamodels/pure/packageableElements/diagram/geometry/Rectangle.ts +1 -2
  116. package/src/models/protocols/pure/DSLDiagram_PureProtocolProcessorPlugin.ts +9 -12
  117. package/src/models/protocols/pure/v1/model/packageableElements/diagram/V1_ClassView.ts +1 -2
  118. package/src/models/protocols/pure/v1/model/packageableElements/diagram/V1_Diagram.ts +5 -4
  119. package/src/models/protocols/pure/v1/model/packageableElements/diagram/V1_GeneralizationView.ts +1 -2
  120. package/src/models/protocols/pure/v1/model/packageableElements/diagram/V1_PropertyHolderView.ts +1 -2
  121. package/src/models/protocols/pure/v1/model/packageableElements/diagram/V1_PropertyView.ts +1 -2
  122. package/src/models/protocols/pure/v1/model/packageableElements/diagram/V1_RelationshipView.ts +1 -2
  123. package/src/models/protocols/pure/v1/model/packageableElements/diagram/geometry/V1_Point.ts +1 -2
  124. package/src/models/protocols/pure/v1/model/packageableElements/diagram/geometry/V1_PositionedRectangle.ts +1 -2
  125. package/src/models/protocols/pure/v1/model/packageableElements/diagram/geometry/V1_Rectangle.ts +1 -2
  126. package/src/stores/studio/DiagramEditorState.ts +15 -10
@@ -16,24 +16,21 @@
16
16
 
17
17
  import packageJson from '../../../../package.json';
18
18
  import { V1_Diagram } from './v1/model/packageableElements/diagram/V1_Diagram';
19
- import type { PlainObject } from '@finos/legend-shared';
20
- import { assertType } from '@finos/legend-shared';
19
+ import { type PlainObject, assertType } from '@finos/legend-shared';
21
20
  import { deserialize, serialize } from 'serializr';
22
21
  import {
23
22
  V1_diagramModelSchema,
24
23
  V1_DIAGRAM_ELEMENT_PROTOCOL_TYPE,
25
24
  } from './v1/transformation/pureProtocol/V1_DSLDiagram_ProtocolHelper';
26
- import type {
27
- PackageableElement,
28
- V1_ElementProtocolClassifierPathGetter,
29
- V1_ElementProtocolDeserializer,
30
- V1_ElementProtocolSerializer,
31
- V1_ElementTransformer,
32
- V1_GraphBuilderContext,
33
- V1_GraphTransformerContext,
34
- V1_PackageableElement,
35
- } from '@finos/legend-graph';
36
25
  import {
26
+ type PackageableElement,
27
+ type V1_ElementProtocolClassifierPathGetter,
28
+ type V1_ElementProtocolDeserializer,
29
+ type V1_ElementProtocolSerializer,
30
+ type V1_ElementTransformer,
31
+ type V1_GraphBuilderContext,
32
+ type V1_GraphTransformerContext,
33
+ type V1_PackageableElement,
37
34
  PureProtocolProcessorPlugin,
38
35
  V1_ElementBuilder,
39
36
  } from '@finos/legend-graph';
@@ -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 { V1_PositionedRectangle } from './geometry/V1_PositionedRectangle';
20
19
  import { DIAGRAM_HASH_STRUCTURE } from '../../../../../../DSLDiagram_ModelUtils';
21
20
 
@@ -14,13 +14,14 @@
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 type { V1_ClassView } from './V1_ClassView';
20
19
  import type { V1_PropertyView } from './V1_PropertyView';
21
20
  import type { V1_GeneralizationView } from './V1_GeneralizationView';
22
- import type { V1_PackageableElementVisitor } from '@finos/legend-graph';
23
- import { V1_PackageableElement } from '@finos/legend-graph';
21
+ import {
22
+ type V1_PackageableElementVisitor,
23
+ V1_PackageableElement,
24
+ } from '@finos/legend-graph';
24
25
  import { DIAGRAM_HASH_STRUCTURE } from '../../../../../../DSLDiagram_ModelUtils';
25
26
 
26
27
  export class V1_Diagram extends V1_PackageableElement implements Hashable {
@@ -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 { V1_RelationshipView } from './V1_RelationshipView';
20
19
  import type { V1_Line } from './geometry/V1_Line';
21
20
  import { DIAGRAM_HASH_STRUCTURE } from '../../../../../../DSLDiagram_ModelUtils';
@@ -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 { V1_RelationshipView } from './V1_RelationshipView';
20
19
  import { DIAGRAM_HASH_STRUCTURE } from '../../../../../../DSLDiagram_ModelUtils';
21
20
  import type { V1_PropertyPointer } from '@finos/legend-graph';
@@ -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 { V1_PropertyHolderView } from './V1_PropertyHolderView';
20
19
  import { DIAGRAM_HASH_STRUCTURE } from '../../../../../../DSLDiagram_ModelUtils';
21
20
  import type { V1_PropertyPointer } from '@finos/legend-graph';
@@ -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 type { V1_Line } from './geometry/V1_Line';
20
19
  import { DIAGRAM_HASH_STRUCTURE } from '../../../../../../DSLDiagram_ModelUtils';
21
20
 
@@ -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 V1_Point implements Hashable {
@@ -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 type { V1_Point } from './V1_Point';
20
19
  import type { V1_Rectangle } from './V1_Rectangle';
21
20
  import { DIAGRAM_HASH_STRUCTURE } from '../../../../../../../DSLDiagram_ModelUtils';
@@ -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 V1_Rectangle implements Hashable {
@@ -20,15 +20,15 @@ import {
20
20
  guaranteeType,
21
21
  uuid,
22
22
  } from '@finos/legend-shared';
23
- import type { DiagramRenderer } from '../../DiagramRenderer';
24
- import { DIAGRAM_INTERACTION_MODE } from '../../DiagramRenderer';
23
+ import {
24
+ type DiagramRenderer,
25
+ DIAGRAM_INTERACTION_MODE,
26
+ } from '../../DiagramRenderer';
25
27
  import { HotkeyConfiguration, PanelDisplayState } from '@finos/legend-art';
26
- import type {
27
- PackageableElement,
28
- AbstractProperty,
29
- PropertyReference,
30
- } from '@finos/legend-graph';
31
28
  import {
29
+ type PackageableElement,
30
+ type AbstractProperty,
31
+ type PropertyReference,
32
32
  GenericTypeExplicitReference,
33
33
  PRIMITIVE_TYPE,
34
34
  TYPICAL_MULTIPLICITY_TYPE,
@@ -36,8 +36,11 @@ import {
36
36
  GenericType,
37
37
  PropertyExplicitReference,
38
38
  } from '@finos/legend-graph';
39
- import type { EditorStore } from '@finos/legend-studio';
40
- import { ClassEditorState, ElementEditorState } from '@finos/legend-studio';
39
+ import {
40
+ type EditorStore,
41
+ ClassEditorState,
42
+ ElementEditorState,
43
+ } from '@finos/legend-studio';
41
44
  import type { ClassView } from '../../models/metamodels/pure/packageableElements/diagram/ClassView';
42
45
  import type { Point } from '../../models/metamodels/pure/packageableElements/diagram/geometry/Point';
43
46
  import { Diagram } from '../../models/metamodels/pure/packageableElements/diagram/Diagram';
@@ -377,7 +380,7 @@ export class DiagramEditorState extends ElementEditorState {
377
380
  );
378
381
  }
379
382
  };
380
- this.renderer.handleEditProperty = (
383
+ const editProperty = (
381
384
  property: AbstractProperty,
382
385
  point: Point,
383
386
  propertyHolderView: PropertyHolderView | undefined,
@@ -393,6 +396,8 @@ export class DiagramEditorState extends ElementEditorState {
393
396
  );
394
397
  }
395
398
  };
399
+ this.renderer.onClassPropertyDoubleClick = editProperty;
400
+ this.renderer.handleEditProperty = editProperty;
396
401
  this.renderer.handleAddSimpleProperty = (classView: ClassView): void => {
397
402
  if (!this.isReadOnly && !classView.class.value.isReadOnly) {
398
403
  const _class = classView.class.value;