@finos/legend-extension-dsl-diagram 0.1.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/lib/DSLDiagram_Extension.d.ts +0 -5
- package/lib/DSLDiagram_Extension.d.ts.map +1 -1
- package/lib/DSLDiagram_Extension.js +0 -12
- package/lib/DSLDiagram_Extension.js.map +1 -1
- package/lib/DiagramRenderer.d.ts.map +1 -1
- package/lib/DiagramRenderer.js +76 -50
- package/lib/DiagramRenderer.js.map +1 -1
- package/lib/components/studio/ClassDiagramPreview.js +1 -1
- package/lib/components/studio/ClassDiagramPreview.js.map +1 -1
- package/lib/components/studio/{DSLDiagram_StudioPlugin.d.ts → DSLDiagram_LegendStudioPlugin.d.ts} +5 -5
- package/lib/components/studio/DSLDiagram_LegendStudioPlugin.d.ts.map +1 -0
- package/lib/components/studio/{DSLDiagram_StudioPlugin.js → DSLDiagram_LegendStudioPlugin.js} +4 -4
- package/lib/components/studio/DSLDiagram_LegendStudioPlugin.js.map +1 -0
- package/lib/components/studio/{DSLDiagram_StudioPlugin_Extension.d.ts → DSLDiagram_LegendStudioPlugin_Extension.d.ts} +3 -3
- package/lib/components/studio/DSLDiagram_LegendStudioPlugin_Extension.d.ts.map +1 -0
- package/lib/components/studio/{DSLDiagram_StudioPlugin_Extension.js → DSLDiagram_LegendStudioPlugin_Extension.js} +1 -1
- package/lib/components/studio/DSLDiagram_LegendStudioPlugin_Extension.js.map +1 -0
- package/lib/components/studio/DiagramEditor.js +36 -36
- package/lib/components/studio/DiagramEditor.js.map +1 -1
- package/lib/index.css +1 -1
- package/lib/index.css.map +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -1
- package/lib/index.js.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/RelationshipView.d.ts.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/diagram/RelationshipView.js +3 -0
- package/lib/models/metamodels/pure/packageableElements/diagram/RelationshipView.js.map +1 -1
- package/lib/stores/studio/DiagramEditorState.d.ts.map +1 -1
- package/lib/stores/studio/DiagramEditorState.js +3 -3
- package/lib/stores/studio/DiagramEditorState.js.map +1 -1
- package/package.json +15 -16
- package/src/DSLDiagram_Extension.ts +0 -15
- package/src/DiagramRenderer.ts +94 -73
- package/src/components/studio/{DSLDiagram_StudioPlugin.tsx → DSLDiagram_LegendStudioPlugin.tsx} +7 -7
- package/src/components/studio/{DSLDiagram_StudioPlugin_Extension.tsx → DSLDiagram_LegendStudioPlugin_Extension.tsx} +3 -3
- package/src/components/studio/DiagramEditor.tsx +2 -2
- package/src/index.ts +3 -1
- package/src/models/metamodels/pure/packageableElements/diagram/RelationshipView.ts +24 -14
- package/src/stores/studio/DiagramEditorState.ts +3 -7
- package/tsconfig.json +3 -2
- package/tsconfig.package.json +1 -0
- package/lib/components/studio/DSLDiagram_StudioPlugin.d.ts.map +0 -1
- package/lib/components/studio/DSLDiagram_StudioPlugin.js.map +0 -1
- package/lib/components/studio/DSLDiagram_StudioPlugin_Extension.d.ts.map +0 -1
- package/lib/components/studio/DSLDiagram_StudioPlugin_Extension.js.map +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"DiagramEditorState.js","sourceRoot":"","sources":["../../../src/stores/studio/DiagramEditorState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AACpE,OAAO,EACL,oBAAoB,EACpB,aAAa,EACb,IAAI,GACL,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;
|
1
|
+
{"version":3,"file":"DiagramEditorState.js","sourceRoot":"","sources":["../../../src/stores/studio/DiagramEditorState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CAAC,aAAa,CAAC,OAAO,CAAC,WAAW,EAAE,CAC7C,CAAC,EACJ;YACA,OAAO,CAAC,KAAK,CAAC,CAAC;SAChB;IACH,CAAC,EAAE,KAAK,CAAC,CAAC;IAEZ,SAAS,CACP,UAA8B,EAC9B,WAAwB;QAExB,MAAM,kBAAkB,GAAG,IAAI,kBAAkB,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;QAC3E,OAAO,kBAAkB,CAAC;IAC5B,CAAC;CACF"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@finos/legend-extension-dsl-diagram",
|
3
|
-
"version": "
|
3
|
+
"version": "1.0.2",
|
4
4
|
"description": "Legend extension for Diagram DSL",
|
5
5
|
"keywords": [
|
6
6
|
"legend",
|
@@ -25,11 +25,11 @@
|
|
25
25
|
"types": "lib/index.d.ts",
|
26
26
|
"scripts": {
|
27
27
|
"build": "yarn clean && yarn build:sass && yarn build:tsc",
|
28
|
-
"build:sass": "cross-env INIT_CWD=$INIT_CWD
|
28
|
+
"build:sass": "cross-env INIT_CWD=$INIT_CWD node ../../scripts/workflow/buildSass.js",
|
29
29
|
"build:tsc": "tsc --project ./tsconfig.build.json",
|
30
30
|
"clean": "rimraf \"lib\" \"build\"",
|
31
31
|
"dev": "npm-run-all --parallel dev:sass dev:tsc",
|
32
|
-
"dev:sass": "sass
|
32
|
+
"dev:sass": "sass style lib --watch --load-path=../../node_modules/@finos/legend-art/scss",
|
33
33
|
"dev:tsc": "tsc --watch --preserveWatchOutput",
|
34
34
|
"lint:js": "cross-env NODE_ENV=production eslint --cache --cache-location ./build/.eslintcache --report-unused-disable-directives --parser-options=project:\"./tsconfig.json\" \"./src/**/*.{js,ts,tsx}\"",
|
35
35
|
"publish:prepare": "node ../../scripts/release/preparePublishContent.js",
|
@@ -38,16 +38,16 @@
|
|
38
38
|
"test:watch": "jest --watch"
|
39
39
|
},
|
40
40
|
"dependencies": {
|
41
|
-
"@finos/legend-application": "0.
|
42
|
-
"@finos/legend-art": "0.
|
43
|
-
"@finos/legend-graph": "0.2.
|
44
|
-
"@finos/legend-model-storage": "0.0.
|
45
|
-
"@finos/legend-shared": "0.0.
|
46
|
-
"@finos/legend-studio": "0.
|
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
47
|
"@material-ui/core": "4.12.3",
|
48
|
-
"@types/react": "17.0.
|
49
|
-
"mobx": "6.3.
|
50
|
-
"mobx-react-lite": "3.2.
|
48
|
+
"@types/react": "17.0.36",
|
49
|
+
"mobx": "6.3.7",
|
50
|
+
"mobx-react-lite": "3.2.2",
|
51
51
|
"react": "17.0.2",
|
52
52
|
"react-dnd": "14.0.4",
|
53
53
|
"react-dom": "17.0.2",
|
@@ -56,16 +56,16 @@
|
|
56
56
|
"serializr": "2.0.5"
|
57
57
|
},
|
58
58
|
"devDependencies": {
|
59
|
-
"@finos/legend-dev-utils": "0.1
|
59
|
+
"@finos/legend-dev-utils": "0.2.1",
|
60
60
|
"@testing-library/react": "12.1.2",
|
61
61
|
"cross-env": "7.0.3",
|
62
|
-
"eslint": "8.
|
62
|
+
"eslint": "8.3.0",
|
63
63
|
"jest": "27.3.1",
|
64
64
|
"jest-canvas-mock": "2.3.1",
|
65
65
|
"npm-run-all": "4.1.5",
|
66
66
|
"rimraf": "3.0.2",
|
67
67
|
"sass": "1.43.4",
|
68
|
-
"typescript": "4.
|
68
|
+
"typescript": "4.5.2"
|
69
69
|
},
|
70
70
|
"peerDependencies": {
|
71
71
|
"react": "^17.0.0"
|
@@ -78,7 +78,6 @@
|
|
78
78
|
"pureProtocolProcessorPlugin": "@finos/legend-graph-plugin-dsl-diagram-pure-protocol-processor",
|
79
79
|
"pureGraphManagerPlugin": "@finos/legend-graph-plugin-dsl-diagram-pure-graph-manager",
|
80
80
|
"pureGraphPlugin": "@finos/legend-graph-plugin-dsl-diagram-pure-graph",
|
81
|
-
"studioPreset": "@finos/legend-studio-preset-dsl-diagram",
|
82
81
|
"studioPlugin": "@finos/legend-studio-plugin-dsl-diagram"
|
83
82
|
}
|
84
83
|
}
|
@@ -19,8 +19,6 @@ import { AbstractPreset } from '@finos/legend-shared';
|
|
19
19
|
import { DSLDiagram_PureGraphManagerPlugin } from './graphManager/DSLDiagram_PureGraphManagerPlugin';
|
20
20
|
import { DSLDiagram_PureProtocolProcessorPlugin } from './models/protocols/pure/DSLDiagram_PureProtocolProcessorPlugin';
|
21
21
|
import type { GraphPluginManager } from '@finos/legend-graph';
|
22
|
-
import type { StudioPluginManager } from '@finos/legend-studio';
|
23
|
-
import { DSLDiagram_StudioPlugin } from './components/studio/DSLDiagram_StudioPlugin';
|
24
22
|
import { DSLDiagram_PureGraphPlugin } from './graph/DSLDiagram_PureGraphPlugin';
|
25
23
|
|
26
24
|
export class DSLDiagram_GraphPreset extends AbstractPreset {
|
@@ -34,16 +32,3 @@ export class DSLDiagram_GraphPreset extends AbstractPreset {
|
|
34
32
|
new DSLDiagram_PureProtocolProcessorPlugin().install(pluginManager);
|
35
33
|
}
|
36
34
|
}
|
37
|
-
|
38
|
-
export class DSLDiagram_StudioPreset extends AbstractPreset {
|
39
|
-
constructor() {
|
40
|
-
super(packageJson.extensions.studioPreset, packageJson.version);
|
41
|
-
}
|
42
|
-
|
43
|
-
install(pluginManager: StudioPluginManager): void {
|
44
|
-
new DSLDiagram_StudioPlugin().install(pluginManager);
|
45
|
-
new DSLDiagram_PureGraphPlugin().install(pluginManager);
|
46
|
-
new DSLDiagram_PureGraphManagerPlugin().install(pluginManager);
|
47
|
-
new DSLDiagram_PureProtocolProcessorPlugin().install(pluginManager);
|
48
|
-
}
|
49
|
-
}
|
package/src/DiagramRenderer.ts
CHANGED
@@ -686,14 +686,11 @@ export class DiagramRenderer {
|
|
686
686
|
|
687
687
|
private manageVirtualScreen(): void {
|
688
688
|
if (this.diagram.classViews.length) {
|
689
|
-
|
690
|
-
let
|
691
|
-
let
|
692
|
-
|
693
|
-
|
694
|
-
let maxY =
|
695
|
-
this.diagram.classViews[0].position.y +
|
696
|
-
this.diagram.classViews[0].rectangle.height;
|
689
|
+
const firstClassView = guaranteeNonNullable(this.diagram.classViews[0]);
|
690
|
+
let minX = firstClassView.position.x;
|
691
|
+
let minY = firstClassView.position.y;
|
692
|
+
let maxX = firstClassView.position.x + firstClassView.rectangle.width;
|
693
|
+
let maxY = firstClassView.position.y + firstClassView.rectangle.height;
|
697
694
|
for (const classView of this.diagram.classViews) {
|
698
695
|
minX = Math.min(minX, classView.position.x);
|
699
696
|
minY = Math.min(minY, classView.position.y);
|
@@ -717,8 +714,10 @@ export class DiagramRenderer {
|
|
717
714
|
);
|
718
715
|
if (relationshipView instanceof PropertyView) {
|
719
716
|
const box = this.drawLinePropertyText(
|
720
|
-
|
721
|
-
|
717
|
+
// NOTE: by the way we compute the full path, it would guarantee
|
718
|
+
// to always have at least 2 points
|
719
|
+
fullPath[fullPath.length - 2] as Point,
|
720
|
+
fullPath[fullPath.length - 1] as Point,
|
722
721
|
relationshipView.to.classView.value,
|
723
722
|
relationshipView.property.value,
|
724
723
|
false,
|
@@ -1786,8 +1785,10 @@ export class DiagramRenderer {
|
|
1786
1785
|
// const toProperty = asso instanceof.property ? asso.property : asso.association.properties[1];
|
1787
1786
|
const toProperty = propertyView.property.value;
|
1788
1787
|
this.drawLinePropertyText(
|
1789
|
-
|
1790
|
-
|
1788
|
+
// NOTE: by the way we compute the full path, it would guarantee
|
1789
|
+
// to always have at least 2 points
|
1790
|
+
fullPath[fullPath.length - 2] as Point,
|
1791
|
+
fullPath[fullPath.length - 1] as Point,
|
1791
1792
|
propertyView.to.classView.value,
|
1792
1793
|
toProperty,
|
1793
1794
|
false,
|
@@ -1872,10 +1873,12 @@ export class DiagramRenderer {
|
|
1872
1873
|
inheritance.from.classView.value,
|
1873
1874
|
inheritance.to.classView.value,
|
1874
1875
|
);
|
1875
|
-
|
1876
|
-
|
1877
|
-
const
|
1878
|
-
const
|
1876
|
+
// NOTE: by the way we compute the full path, it would guarantee
|
1877
|
+
// to always have at least 2 points
|
1878
|
+
const startX = (fullPath[fullPath.length - 2] as Point).x;
|
1879
|
+
const startY = (fullPath[fullPath.length - 2] as Point).y;
|
1880
|
+
const endX = (fullPath[fullPath.length - 1] as Point).x;
|
1881
|
+
const endY = (fullPath[fullPath.length - 1] as Point).y;
|
1879
1882
|
let resultX = 0;
|
1880
1883
|
let resultY = 0;
|
1881
1884
|
if (endY > startY) {
|
@@ -1960,27 +1963,35 @@ export class DiagramRenderer {
|
|
1960
1963
|
this.ctx.beginPath();
|
1961
1964
|
this.ctx.moveTo(
|
1962
1965
|
resultX +
|
1963
|
-
(this.screenOffset.x + this.triangle[0].rotateX(angle)) *
|
1966
|
+
(this.screenOffset.x + (this.triangle[0] as Point).rotateX(angle)) *
|
1967
|
+
this.zoom,
|
1964
1968
|
resultY +
|
1965
|
-
(this.screenOffset.y + this.triangle[0].rotateY(angle)) *
|
1969
|
+
(this.screenOffset.y + (this.triangle[0] as Point).rotateY(angle)) *
|
1970
|
+
this.zoom,
|
1966
1971
|
);
|
1967
1972
|
this.ctx.lineTo(
|
1968
1973
|
resultX +
|
1969
|
-
(this.screenOffset.x + this.triangle[1].rotateX(angle)) *
|
1974
|
+
(this.screenOffset.x + (this.triangle[1] as Point).rotateX(angle)) *
|
1975
|
+
this.zoom,
|
1970
1976
|
resultY +
|
1971
|
-
(this.screenOffset.y + this.triangle[1].rotateY(angle)) *
|
1977
|
+
(this.screenOffset.y + (this.triangle[1] as Point).rotateY(angle)) *
|
1978
|
+
this.zoom,
|
1972
1979
|
);
|
1973
1980
|
this.ctx.lineTo(
|
1974
1981
|
resultX +
|
1975
|
-
(this.screenOffset.x + this.triangle[2].rotateX(angle)) *
|
1982
|
+
(this.screenOffset.x + (this.triangle[2] as Point).rotateX(angle)) *
|
1983
|
+
this.zoom,
|
1976
1984
|
resultY +
|
1977
|
-
(this.screenOffset.y + this.triangle[2].rotateY(angle)) *
|
1985
|
+
(this.screenOffset.y + (this.triangle[2] as Point).rotateY(angle)) *
|
1986
|
+
this.zoom,
|
1978
1987
|
);
|
1979
1988
|
this.ctx.lineTo(
|
1980
1989
|
resultX +
|
1981
|
-
(this.screenOffset.x + this.triangle[0].rotateX(angle)) *
|
1990
|
+
(this.screenOffset.x + (this.triangle[0] as Point).rotateX(angle)) *
|
1991
|
+
this.zoom,
|
1982
1992
|
resultY +
|
1983
|
-
(this.screenOffset.y + this.triangle[0].rotateY(angle)) *
|
1993
|
+
(this.screenOffset.y + (this.triangle[0] as Point).rotateY(angle)) *
|
1994
|
+
this.zoom,
|
1984
1995
|
);
|
1985
1996
|
this.ctx.fillStyle = this.generalizationViewInheritanceTriangeFillColor;
|
1986
1997
|
this.ctx.fill();
|
@@ -2099,13 +2110,13 @@ export class DiagramRenderer {
|
|
2099
2110
|
this.selectedPropertyOrAssociation.property.value,
|
2100
2111
|
this.selectedPoint ??
|
2101
2112
|
(this.selectedPropertyOrAssociation.path.length
|
2102
|
-
? this.selectedPropertyOrAssociation.path[0]
|
2113
|
+
? (this.selectedPropertyOrAssociation.path[0] as Point)
|
2103
2114
|
: this.selectedPropertyOrAssociation.from.classView.value.center()),
|
2104
2115
|
this.selectedPropertyOrAssociation,
|
2105
2116
|
);
|
2106
2117
|
e.preventDefault();
|
2107
2118
|
} else if (this.selectedClasses.length === 1) {
|
2108
|
-
this.handleEditClassView(this.selectedClasses[0]);
|
2119
|
+
this.handleEditClassView(this.selectedClasses[0] as ClassView);
|
2109
2120
|
}
|
2110
2121
|
}
|
2111
2122
|
|
@@ -2212,7 +2223,7 @@ export class DiagramRenderer {
|
|
2212
2223
|
// Add a new simple property to selected class
|
2213
2224
|
else if (e.altKey && 'ArrowDown' === e.code) {
|
2214
2225
|
if (!this.isReadOnly && this.selectedClasses.length === 1) {
|
2215
|
-
this.handleAddSimpleProperty(this.selectedClasses[0]);
|
2226
|
+
this.handleAddSimpleProperty(this.selectedClasses[0] as ClassView);
|
2216
2227
|
}
|
2217
2228
|
}
|
2218
2229
|
|
@@ -2333,11 +2344,11 @@ export class DiagramRenderer {
|
|
2333
2344
|
let nextZoomLevel: number;
|
2334
2345
|
// NOTE: below the smallest recommended zoom level, we will start decrement by 10
|
2335
2346
|
// and increment by 100 beyond the largest recommended zoom level.
|
2336
|
-
if (currentZoomLevel <= DIAGRAM_ZOOM_LEVELS[0] - 10) {
|
2347
|
+
if (currentZoomLevel <= (DIAGRAM_ZOOM_LEVELS[0] as number) - 10) {
|
2337
2348
|
nextZoomLevel = Math.floor(currentZoomLevel / 10) * 10 + 10;
|
2338
2349
|
} else if (
|
2339
2350
|
currentZoomLevel >=
|
2340
|
-
DIAGRAM_ZOOM_LEVELS[DIAGRAM_ZOOM_LEVELS.length - 1]
|
2351
|
+
(DIAGRAM_ZOOM_LEVELS[DIAGRAM_ZOOM_LEVELS.length - 1] as number)
|
2341
2352
|
) {
|
2342
2353
|
nextZoomLevel = Math.floor(currentZoomLevel / 100) * 100 + 100;
|
2343
2354
|
} else {
|
@@ -2353,11 +2364,12 @@ export class DiagramRenderer {
|
|
2353
2364
|
case DIAGRAM_INTERACTION_MODE.ZOOM_OUT: {
|
2354
2365
|
const currentZoomLevel = Math.round(this.zoom * 100);
|
2355
2366
|
let nextZoomLevel: number;
|
2356
|
-
if (currentZoomLevel <= DIAGRAM_ZOOM_LEVELS[0]) {
|
2367
|
+
if (currentZoomLevel <= (DIAGRAM_ZOOM_LEVELS[0] as number)) {
|
2357
2368
|
nextZoomLevel = Math.ceil(currentZoomLevel / 10) * 10 - 10;
|
2358
2369
|
} else if (
|
2359
2370
|
currentZoomLevel >=
|
2360
|
-
DIAGRAM_ZOOM_LEVELS[DIAGRAM_ZOOM_LEVELS.length - 1] +
|
2371
|
+
(DIAGRAM_ZOOM_LEVELS[DIAGRAM_ZOOM_LEVELS.length - 1] as number) +
|
2372
|
+
100
|
2361
2373
|
) {
|
2362
2374
|
nextZoomLevel = Math.ceil(currentZoomLevel / 100) * 100 - 100;
|
2363
2375
|
} else {
|
@@ -2382,17 +2394,17 @@ export class DiagramRenderer {
|
|
2382
2394
|
this.eventCoordinateToCanvasCoordinate(new Point(e.x, e.y)),
|
2383
2395
|
);
|
2384
2396
|
for (let i = this.diagram.classViews.length - 1; i >= 0; i--) {
|
2397
|
+
const targetClassView = this.diagram.classViews[i] as ClassView;
|
2398
|
+
|
2385
2399
|
if (
|
2386
|
-
|
2400
|
+
targetClassView.contains(
|
2387
2401
|
eventPointInModelCoordinate.x,
|
2388
2402
|
eventPointInModelCoordinate.y,
|
2389
2403
|
)
|
2390
2404
|
) {
|
2391
|
-
const targetClassView = this.diagram.classViews[i];
|
2392
|
-
|
2393
2405
|
const gview = this.handleAddRelationship(
|
2394
2406
|
this.startClassView,
|
2395
|
-
|
2407
|
+
targetClassView,
|
2396
2408
|
);
|
2397
2409
|
|
2398
2410
|
if (gview) {
|
@@ -2540,8 +2552,9 @@ export class DiagramRenderer {
|
|
2540
2552
|
// Check if the selection lies within the bottom right corner box of a box (so we can do resize of box here)
|
2541
2553
|
// NOTE: Traverse backwards the class views to preserve z-index buffer
|
2542
2554
|
for (let i = this.diagram.classViews.length - 1; i >= 0; i--) {
|
2555
|
+
const targetClassView = this.diagram.classViews[i] as ClassView;
|
2543
2556
|
if (
|
2544
|
-
|
2557
|
+
targetClassView
|
2545
2558
|
.buildBottomRightCornerBox()
|
2546
2559
|
.contains(
|
2547
2560
|
eventPointInModelCoordinate.x,
|
@@ -2577,24 +2590,24 @@ export class DiagramRenderer {
|
|
2577
2590
|
let anyClassesSelected = false;
|
2578
2591
|
// Traverse backwards the class views to preserve z-index buffer
|
2579
2592
|
for (let i = this.diagram.classViews.length - 1; i >= 0; i--) {
|
2593
|
+
const targetClassView = this.diagram.classViews[i] as ClassView;
|
2580
2594
|
if (
|
2581
|
-
|
2595
|
+
targetClassView.contains(
|
2582
2596
|
eventPointInModelCoordinate.x,
|
2583
2597
|
eventPointInModelCoordinate.y,
|
2584
2598
|
)
|
2585
2599
|
) {
|
2586
2600
|
if (
|
2587
2601
|
this.selectedClasses.length === 0 ||
|
2588
|
-
this.selectedClasses.indexOf(
|
2589
|
-
-1
|
2602
|
+
this.selectedClasses.indexOf(targetClassView) === -1
|
2590
2603
|
) {
|
2591
|
-
this.setSelectedClasses([
|
2604
|
+
this.setSelectedClasses([targetClassView]);
|
2592
2605
|
}
|
2593
2606
|
if (!this.isReadOnly) {
|
2594
2607
|
// Bring the class view to front
|
2595
2608
|
this.diagram.setClassViews(
|
2596
2609
|
this.reorderDiagramDomain(
|
2597
|
-
this.selectedClasses[0],
|
2610
|
+
this.selectedClasses[0] as ClassView,
|
2598
2611
|
this.diagram,
|
2599
2612
|
),
|
2600
2613
|
);
|
@@ -2690,13 +2703,14 @@ export class DiagramRenderer {
|
|
2690
2703
|
this.setSelectionStart(eventPointInModelCoordinate);
|
2691
2704
|
this.startClassView = undefined;
|
2692
2705
|
for (let i = this.diagram.classViews.length - 1; i >= 0; i--) {
|
2706
|
+
const targetClassView = this.diagram.classViews[i] as ClassView;
|
2693
2707
|
if (
|
2694
|
-
|
2708
|
+
targetClassView.contains(
|
2695
2709
|
eventPointInModelCoordinate.x,
|
2696
2710
|
eventPointInModelCoordinate.y,
|
2697
2711
|
)
|
2698
2712
|
) {
|
2699
|
-
this.startClassView =
|
2713
|
+
this.startClassView = targetClassView;
|
2700
2714
|
}
|
2701
2715
|
}
|
2702
2716
|
if (!this.startClassView) {
|
@@ -3067,8 +3081,10 @@ export class DiagramRenderer {
|
|
3067
3081
|
propertyHolderView.to.classView.value,
|
3068
3082
|
);
|
3069
3083
|
const propertyInfoBox = this.drawLinePropertyText(
|
3070
|
-
|
3071
|
-
|
3084
|
+
// NOTE: by the way we compute the full path, it would guarantee
|
3085
|
+
// to always have at least 2 points
|
3086
|
+
fullPath[fullPath.length - 2] as Point,
|
3087
|
+
fullPath[fullPath.length - 1] as Point,
|
3072
3088
|
propertyHolderView.to.classView.value,
|
3073
3089
|
propertyHolderView.property.value,
|
3074
3090
|
false,
|
@@ -3137,44 +3153,49 @@ export class DiagramRenderer {
|
|
3137
3153
|
positionInitialClass: boolean,
|
3138
3154
|
superType: boolean,
|
3139
3155
|
): [ClassView[], GeneralizationView[]] {
|
3140
|
-
//Offsets
|
3156
|
+
// Offsets
|
3141
3157
|
const spaceY = 30;
|
3142
3158
|
const spaceX = 10;
|
3143
3159
|
|
3144
3160
|
classViewLevels.reverse();
|
3145
3161
|
|
3146
|
-
const classViews = classViewLevels.flatMap((
|
3162
|
+
const classViews = classViewLevels.flatMap((levels, currentLevelIndex) => {
|
3147
3163
|
// Get the bounding box of the precedent level
|
3148
3164
|
let precedentTotalWidth = 0;
|
3149
3165
|
let precedentTotalHeight = 0;
|
3150
3166
|
let precedentX = 0;
|
3151
3167
|
let precedentY = 0;
|
3152
3168
|
if (currentLevelIndex > 0) {
|
3153
|
-
const
|
3154
|
-
|
3155
|
-
|
3156
|
-
|
3157
|
-
|
3158
|
-
precedentByX[
|
3159
|
-
|
3160
|
-
|
3161
|
-
|
3162
|
-
|
3163
|
-
|
3164
|
-
|
3165
|
-
|
3166
|
-
|
3167
|
-
|
3168
|
-
precedentByY[
|
3169
|
-
|
3169
|
+
const precedent = classViewLevels[currentLevelIndex - 1] as ClassView[];
|
3170
|
+
if (precedent.length) {
|
3171
|
+
const precedentByX = [...precedent].sort(
|
3172
|
+
(a, b) => a.position.x - b.position.x,
|
3173
|
+
);
|
3174
|
+
precedentX = (precedentByX[0] as ClassView).position.x;
|
3175
|
+
precedentTotalWidth =
|
3176
|
+
(precedentByX[precedentByX.length - 1] as ClassView).position.x +
|
3177
|
+
(precedentByX[precedentByX.length - 1] as ClassView).rectangle
|
3178
|
+
.width -
|
3179
|
+
(precedentByX[0] as ClassView).position.x;
|
3180
|
+
|
3181
|
+
const precedentByY = [...precedent].sort(
|
3182
|
+
(a, b) => a.position.y - b.position.y,
|
3183
|
+
);
|
3184
|
+
precedentY = (precedentByY[0] as ClassView).position.y;
|
3185
|
+
precedentTotalHeight =
|
3186
|
+
(precedentByY[precedentByY.length - 1] as ClassView).position.y +
|
3187
|
+
(precedentByY[precedentByY.length - 1] as ClassView).rectangle
|
3188
|
+
.height -
|
3189
|
+
(precedentByY[0] as ClassView).position.y;
|
3190
|
+
}
|
3170
3191
|
}
|
3171
3192
|
|
3172
3193
|
// Get the bounding box of current Level
|
3173
3194
|
const maxHeight = Math.max(
|
3174
|
-
...
|
3195
|
+
...levels.map((classView) => classView.rectangle.height),
|
3175
3196
|
);
|
3176
3197
|
|
3177
|
-
const totalWidth =
|
3198
|
+
const totalWidth = levels
|
3178
3199
|
.map((classView) => classView.rectangle.width)
|
3179
3200
|
.reduce((a, b) => a + b + spaceX);
|
3180
3201
|
|
@@ -3186,10 +3207,10 @@ export class DiagramRenderer {
|
|
3186
3207
|
|
3187
3208
|
// Set layout of current level
|
3188
3209
|
if (positionInitialClass || currentLevelIndex > 0) {
|
3189
|
-
|
3190
|
-
|
3191
|
-
if (
|
3192
|
-
const precedent =
|
3210
|
+
(levels[0] as ClassView).setPosition(new Point(startX, currentLevelY));
|
3211
|
+
levels.forEach((view, idx) => {
|
3212
|
+
if (idx > 0) {
|
3213
|
+
const precedent = levels[idx - 1] as ClassView;
|
3193
3214
|
view.setPosition(
|
3194
3215
|
new Point(
|
3195
3216
|
precedent.position.x + precedent.rectangle.width + spaceX,
|
@@ -3199,16 +3220,16 @@ export class DiagramRenderer {
|
|
3199
3220
|
}
|
3200
3221
|
});
|
3201
3222
|
}
|
3202
|
-
return
|
3223
|
+
return levels;
|
3203
3224
|
});
|
3204
3225
|
|
3205
3226
|
const generalizationViews = (
|
3206
3227
|
superType ? classViewLevels : classViewLevels.reverse()
|
3207
3228
|
)
|
3208
3229
|
.slice(0, classViewLevels.length - 1)
|
3209
|
-
.flatMap((level,
|
3230
|
+
.flatMap((level, idx) =>
|
3210
3231
|
level.flatMap((fromClassView) =>
|
3211
|
-
classViewLevels[
|
3232
|
+
(classViewLevels[idx + 1] as ClassView[]).flatMap((toClassView) => {
|
3212
3233
|
if (
|
3213
3234
|
fromClassView.class.value.generalizations
|
3214
3235
|
.map((g) => g.value.rawType)
|
package/src/components/studio/{DSLDiagram_StudioPlugin.tsx → DSLDiagram_LegendStudioPlugin.tsx}
RENAMED
@@ -16,7 +16,7 @@
|
|
16
16
|
|
17
17
|
import packageJson from '../../../package.json';
|
18
18
|
import type {
|
19
|
-
|
19
|
+
LegendStudioPluginManager,
|
20
20
|
NewElementFromStateCreator,
|
21
21
|
EditorStore,
|
22
22
|
ElementEditorState,
|
@@ -25,13 +25,13 @@ import type {
|
|
25
25
|
ElementProjectExplorerDnDTypeGetter,
|
26
26
|
ElementIconGetter,
|
27
27
|
ElementEditorRenderer,
|
28
|
-
|
28
|
+
DSL_LegendStudioPlugin_Extension,
|
29
29
|
NewElementState,
|
30
30
|
ElementEditorPostDeleteAction,
|
31
31
|
ElementEditorPostRenameAction,
|
32
32
|
ClassPreviewRenderer,
|
33
33
|
} from '@finos/legend-studio';
|
34
|
-
import {
|
34
|
+
import { LegendStudioPlugin } from '@finos/legend-studio';
|
35
35
|
import { ShapesIcon } from '@finos/legend-art';
|
36
36
|
import type { Class, PackageableElement } from '@finos/legend-graph';
|
37
37
|
import { Diagram } from '../../models/metamodels/pure/packageableElements/diagram/Diagram';
|
@@ -42,15 +42,15 @@ import { ClassDiagramPreview } from './ClassDiagramPreview';
|
|
42
42
|
const DIAGRAM_ELEMENT_TYPE = 'DIAGRAM';
|
43
43
|
const DIAGRAM_ELEMENT_PROJECT_EXPLORER_DND_TYPE = 'PROJECT_EXPLORER_DIAGRAM';
|
44
44
|
|
45
|
-
export class
|
46
|
-
extends
|
47
|
-
implements
|
45
|
+
export class DSLDiagram_LegendStudioPlugin
|
46
|
+
extends LegendStudioPlugin
|
47
|
+
implements DSL_LegendStudioPlugin_Extension
|
48
48
|
{
|
49
49
|
constructor() {
|
50
50
|
super(packageJson.extensions.studioPlugin, packageJson.version);
|
51
51
|
}
|
52
52
|
|
53
|
-
install(pluginManager:
|
53
|
+
install(pluginManager: LegendStudioPluginManager): void {
|
54
54
|
pluginManager.registerStudioPlugin(this);
|
55
55
|
}
|
56
56
|
|
@@ -14,7 +14,7 @@
|
|
14
14
|
* limitations under the License.
|
15
15
|
*/
|
16
16
|
|
17
|
-
import type {
|
17
|
+
import type { DSL_LegendStudioPlugin_Extension } from '@finos/legend-studio';
|
18
18
|
import type { ClassView } from '../../models/metamodels/pure/packageableElements/diagram/ClassView';
|
19
19
|
import type { DiagramEditorState } from '../../stores/studio/DiagramEditorState';
|
20
20
|
|
@@ -26,8 +26,8 @@ export type ClassViewContextMenuItemRendererConfiguration = {
|
|
26
26
|
) => React.ReactNode | undefined;
|
27
27
|
};
|
28
28
|
|
29
|
-
export interface
|
30
|
-
extends
|
29
|
+
export interface DSLDiagram_LegendStudioPlugin_Extension
|
30
|
+
extends DSL_LegendStudioPlugin_Extension {
|
31
31
|
/**
|
32
32
|
* Get the list of items to be rendered in the context menu of a class view.
|
33
33
|
*/
|
@@ -99,7 +99,7 @@ import {
|
|
99
99
|
} from '@finos/legend-studio';
|
100
100
|
import { cleanUpDeadReferencesInDiagram } from '../../helpers/DiagramHelper';
|
101
101
|
import { Point } from '../../models/metamodels/pure/packageableElements/diagram/geometry/Point';
|
102
|
-
import type {
|
102
|
+
import type { DSLDiagram_LegendStudioPlugin_Extension } from './DSLDiagram_LegendStudioPlugin_Extension';
|
103
103
|
|
104
104
|
const DiagramEditorContextMenu = observer(
|
105
105
|
(
|
@@ -117,7 +117,7 @@ const DiagramEditorContextMenu = observer(
|
|
117
117
|
.flatMap(
|
118
118
|
(plugin) =>
|
119
119
|
(
|
120
|
-
plugin as
|
120
|
+
plugin as DSLDiagram_LegendStudioPlugin_Extension
|
121
121
|
).getExtraClassViewContextMenuItemRendererConfigurations?.() ??
|
122
122
|
[],
|
123
123
|
)
|
package/src/index.ts
CHANGED
@@ -15,7 +15,9 @@
|
|
15
15
|
*/
|
16
16
|
|
17
17
|
export * from './DSLDiagram_Extension';
|
18
|
-
export
|
18
|
+
export { DSLDiagram_LegendStudioPlugin } from './components/studio/DSLDiagram_LegendStudioPlugin';
|
19
|
+
export * from './components/studio/DSLDiagram_LegendStudioPlugin_Extension';
|
20
|
+
|
19
21
|
export { DiagramEditorState } from './stores/studio/DiagramEditorState';
|
20
22
|
|
21
23
|
export { DiagramRenderer, DIAGRAM_INTERACTION_MODE } from './DiagramRenderer';
|