@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.
- package/CHANGELOG.md +14 -0
- package/lib/DiagramRenderer.d.ts +6 -6
- package/lib/DiagramRenderer.d.ts.map +1 -1
- package/lib/DiagramRenderer.js +27 -16
- package/lib/DiagramRenderer.js.map +1 -1
- package/lib/components/studio/ClassDiagramPreview.d.ts +1 -0
- package/lib/components/studio/ClassDiagramPreview.d.ts.map +1 -1
- package/lib/components/studio/DSLDiagram_LegendStudioPlugin.d.ts +1 -2
- package/lib/components/studio/DSLDiagram_LegendStudioPlugin.d.ts.map +1 -1
- package/lib/components/studio/DSLDiagram_LegendStudioPlugin.js +1 -1
- package/lib/components/studio/DSLDiagram_LegendStudioPlugin.js.map +1 -1
- package/lib/components/studio/DiagramEditor.d.ts +1 -0
- package/lib/components/studio/DiagramEditor.d.ts.map +1 -1
- package/lib/components/studio/DiagramEditor.js +13 -15
- package/lib/components/studio/DiagramEditor.js.map +1 -1
- package/lib/components/studio/InheritanceDiagramRenderer.d.ts +1 -1
- package/lib/components/studio/InheritanceDiagramRenderer.d.ts.map +1 -1
- package/lib/components/studio/InheritanceDiagramRenderer.js +1 -1
- package/lib/components/studio/InheritanceDiagramRenderer.js.map +1 -1
- package/lib/graph/DSLDiagram_PureGraphPlugin.d.ts +1 -2
- package/lib/graph/DSLDiagram_PureGraphPlugin.d.ts.map +1 -1
- package/lib/graph/DSLDiagram_PureGraphPlugin.js +1 -1
- package/lib/graph/DSLDiagram_PureGraphPlugin.js.map +1 -1
- package/lib/graphManager/DSLDiagram_PureGraphManagerPlugin.d.ts +1 -2
- package/lib/graphManager/DSLDiagram_PureGraphManagerPlugin.d.ts.map +1 -1
- package/lib/graphManager/DSLDiagram_PureGraphManagerPlugin.js +1 -1
- package/lib/graphManager/DSLDiagram_PureGraphManagerPlugin.js.map +1 -1
- package/lib/index.css +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/AssociationView.d.ts +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/AssociationView.d.ts.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/AssociationView.js.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/ClassView.d.ts +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/ClassView.d.ts.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/ClassView.js.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/ClassViewReference.d.ts +1 -2
- package/lib/models/metamodels/pure/packageableElements/diagram/ClassViewReference.d.ts.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/ClassViewReference.js.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/Diagram.d.ts +2 -3
- package/lib/models/metamodels/pure/packageableElements/diagram/Diagram.d.ts.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/Diagram.js +2 -2
- package/lib/models/metamodels/pure/packageableElements/diagram/Diagram.js.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/GeneralizationView.d.ts +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/GeneralizationView.d.ts.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/GeneralizationView.js.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/PropertyHolderView.d.ts +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/PropertyHolderView.d.ts.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/PropertyHolderView.js.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/PropertyView.d.ts +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/PropertyView.d.ts.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/PropertyView.js.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/RelationshipView.d.ts +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/RelationshipView.d.ts.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/RelationshipView.js.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/geometry/Point.d.ts +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/geometry/Point.d.ts.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/geometry/Point.js.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/geometry/PositionedRectangle.d.ts +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/geometry/PositionedRectangle.d.ts.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/geometry/PositionedRectangle.js.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/geometry/Rectangle.d.ts +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/geometry/Rectangle.d.ts.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/geometry/Rectangle.js.map +1 -1
- package/lib/models/protocols/pure/DSLDiagram_PureProtocolProcessorPlugin.d.ts +1 -2
- package/lib/models/protocols/pure/DSLDiagram_PureProtocolProcessorPlugin.d.ts.map +1 -1
- package/lib/models/protocols/pure/DSLDiagram_PureProtocolProcessorPlugin.js.map +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_ClassView.d.ts +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_ClassView.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_ClassView.js.map +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_Diagram.d.ts +2 -3
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_Diagram.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_Diagram.js +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_Diagram.js.map +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_GeneralizationView.d.ts +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_GeneralizationView.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_GeneralizationView.js.map +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_PropertyHolderView.d.ts +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_PropertyHolderView.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_PropertyHolderView.js.map +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_PropertyView.d.ts +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_PropertyView.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_PropertyView.js.map +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_RelationshipView.d.ts +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_RelationshipView.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/V1_RelationshipView.js.map +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/geometry/V1_Point.d.ts +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/geometry/V1_Point.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/geometry/V1_Point.js.map +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/geometry/V1_PositionedRectangle.d.ts +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/geometry/V1_PositionedRectangle.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/geometry/V1_PositionedRectangle.js.map +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/geometry/V1_Rectangle.d.ts +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/geometry/V1_Rectangle.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/diagram/geometry/V1_Rectangle.js.map +1 -1
- package/lib/stores/studio/DiagramEditorState.d.ts +3 -4
- package/lib/stores/studio/DiagramEditorState.d.ts.map +1 -1
- package/lib/stores/studio/DiagramEditorState.js +5 -3
- package/lib/stores/studio/DiagramEditorState.js.map +1 -1
- package/package.json +20 -20
- package/src/DiagramRenderer.ts +54 -29
- package/src/components/studio/DSLDiagram_LegendStudioPlugin.tsx +15 -15
- package/src/components/studio/DiagramEditor.tsx +34 -34
- package/src/components/studio/InheritanceDiagramRenderer.ts +4 -2
- package/src/graph/DSLDiagram_PureGraphPlugin.ts +5 -5
- package/src/graphManager/DSLDiagram_PureGraphManagerPlugin.ts +4 -4
- package/src/models/metamodels/pure/packageableElements/diagram/AssociationView.ts +1 -2
- package/src/models/metamodels/pure/packageableElements/diagram/ClassView.ts +1 -2
- package/src/models/metamodels/pure/packageableElements/diagram/ClassViewReference.ts +2 -4
- package/src/models/metamodels/pure/packageableElements/diagram/Diagram.ts +10 -4
- package/src/models/metamodels/pure/packageableElements/diagram/GeneralizationView.ts +1 -2
- package/src/models/metamodels/pure/packageableElements/diagram/PropertyHolderView.ts +1 -2
- package/src/models/metamodels/pure/packageableElements/diagram/PropertyView.ts +1 -2
- package/src/models/metamodels/pure/packageableElements/diagram/RelationshipView.ts +1 -2
- package/src/models/metamodels/pure/packageableElements/diagram/geometry/Point.ts +1 -2
- package/src/models/metamodels/pure/packageableElements/diagram/geometry/PositionedRectangle.ts +1 -2
- package/src/models/metamodels/pure/packageableElements/diagram/geometry/Rectangle.ts +1 -2
- package/src/models/protocols/pure/DSLDiagram_PureProtocolProcessorPlugin.ts +9 -12
- package/src/models/protocols/pure/v1/model/packageableElements/diagram/V1_ClassView.ts +1 -2
- package/src/models/protocols/pure/v1/model/packageableElements/diagram/V1_Diagram.ts +5 -4
- package/src/models/protocols/pure/v1/model/packageableElements/diagram/V1_GeneralizationView.ts +1 -2
- package/src/models/protocols/pure/v1/model/packageableElements/diagram/V1_PropertyHolderView.ts +1 -2
- package/src/models/protocols/pure/v1/model/packageableElements/diagram/V1_PropertyView.ts +1 -2
- package/src/models/protocols/pure/v1/model/packageableElements/diagram/V1_RelationshipView.ts +1 -2
- package/src/models/protocols/pure/v1/model/packageableElements/diagram/geometry/V1_Point.ts +1 -2
- package/src/models/protocols/pure/v1/model/packageableElements/diagram/geometry/V1_PositionedRectangle.ts +1 -2
- package/src/models/protocols/pure/v1/model/packageableElements/diagram/geometry/V1_Rectangle.ts +1 -2
- 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
|
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
|
23
|
-
|
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 {
|
package/src/models/protocols/pure/v1/model/packageableElements/diagram/V1_GeneralizationView.ts
CHANGED
@@ -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';
|
package/src/models/protocols/pure/v1/model/packageableElements/diagram/V1_PropertyHolderView.ts
CHANGED
@@ -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';
|
package/src/models/protocols/pure/v1/model/packageableElements/diagram/V1_RelationshipView.ts
CHANGED
@@ -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';
|
package/src/models/protocols/pure/v1/model/packageableElements/diagram/geometry/V1_Rectangle.ts
CHANGED
@@ -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
|
24
|
-
|
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
|
40
|
-
|
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
|
-
|
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;
|