@eclipse-glsp/graph 2.8.0-next.3 → 2.8.0-next.6
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/lib/gbutton.js +1 -1
- package/lib/gbutton.js.map +1 -1
- package/lib/gcompartment.js +1 -1
- package/lib/gcompartment.js.map +1 -1
- package/lib/ggraph.js +1 -1
- package/lib/ggraph.js.map +1 -1
- package/lib/glabel.js +2 -2
- package/lib/glabel.js.map +1 -1
- package/lib/gmodel-element.d.ts +1 -1
- package/lib/gmodel-element.d.ts.map +1 -1
- package/lib/gmodel-element.js +2 -3
- package/lib/gmodel-element.js.map +1 -1
- package/lib/gnode.js +1 -1
- package/lib/gnode.js.map +1 -1
- package/lib/gshape-element.js +1 -1
- package/lib/gshape-element.js.map +1 -1
- package/lib/gshaped-prerendered-element.js +1 -1
- package/lib/gshaped-prerendered-element.js.map +1 -1
- package/package.json +11 -17
- package/src/gmodel-element.ts +4 -4
- package/lib/galignable.spec.d.ts +0 -2
- package/lib/galignable.spec.d.ts.map +0 -1
- package/lib/galignable.spec.js +0 -68
- package/lib/galignable.spec.js.map +0 -1
- package/lib/gbounds-aware.spec.d.ts +0 -2
- package/lib/gbounds-aware.spec.d.ts.map +0 -1
- package/lib/gbounds-aware.spec.js +0 -94
- package/lib/gbounds-aware.spec.js.map +0 -1
- package/lib/index.spec.d.ts +0 -16
- package/lib/index.spec.d.ts.map +0 -1
- package/lib/index.spec.js +0 -27
- package/lib/index.spec.js.map +0 -1
- package/src/galignable.spec.ts +0 -74
- package/src/gbounds-aware.spec.ts +0 -105
- package/src/index.spec.ts +0 -27
package/lib/gbutton.js
CHANGED
|
@@ -25,7 +25,7 @@ class GButton extends gshape_element_1.GShapeElement {
|
|
|
25
25
|
this.enabled = true;
|
|
26
26
|
}
|
|
27
27
|
static builder(constructor) {
|
|
28
|
-
return new GButtonBuilder(constructor
|
|
28
|
+
return new GButtonBuilder(constructor ?? GButton).type(protocol_1.DefaultTypes.BUTTON_EXPAND);
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
exports.GButton = GButton;
|
package/lib/gbutton.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gbutton.js","sourceRoot":"","sources":["../src/gbutton.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,qDAAsD;AAEtD,qDAAuE;AAEvE,MAAa,OAAQ,SAAQ,8BAAa;IAA1C;;QAKa,SAAI,GAAG,uBAAY,CAAC,aAAa,CAAC;QAC3C,YAAO,GAAG,IAAI,CAAC;IACnB,CAAC;IANG,MAAM,CAAC,OAAO,CAA8B,WAAyC;QACjF,OAAO,IAAI,cAAc,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"gbutton.js","sourceRoot":"","sources":["../src/gbutton.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,qDAAsD;AAEtD,qDAAuE;AAEvE,MAAa,OAAQ,SAAQ,8BAAa;IAA1C;;QAKa,SAAI,GAAG,uBAAY,CAAC,aAAa,CAAC;QAC3C,YAAO,GAAG,IAAI,CAAC;IACnB,CAAC;IANG,MAAM,CAAC,OAAO,CAA8B,WAAyC;QACjF,OAAO,IAAI,cAAc,CAAC,WAAW,IAAI,OAAO,CAAC,CAAC,IAAI,CAAC,uBAAY,CAAC,aAAa,CAAC,CAAC;IACvF,CAAC;CAIJ;AAPD,0BAOC;AAED,MAAa,cAA4C,SAAQ,qCAAuB;IACpF,OAAO,CAAC,OAAgB;QACpB,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,OAAO,CAAC;QAC7B,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AALD,wCAKC"}
|
package/lib/gcompartment.js
CHANGED
|
@@ -26,12 +26,12 @@ class GCompartment extends gshape_element_1.GShapeElement {
|
|
|
26
26
|
this.type = protocol_1.DefaultTypes.COMPARTMENT;
|
|
27
27
|
this[_a] = true;
|
|
28
28
|
}
|
|
29
|
+
static { _a = glayouting_1.GLayouting; }
|
|
29
30
|
static builder() {
|
|
30
31
|
return new GCompartmentBuilder(GCompartment).type(protocol_1.DefaultTypes.COMPARTMENT);
|
|
31
32
|
}
|
|
32
33
|
}
|
|
33
34
|
exports.GCompartment = GCompartment;
|
|
34
|
-
_a = glayouting_1.GLayouting;
|
|
35
35
|
class GCompartmentBuilder extends gshape_element_1.GShapeElementBuilder {
|
|
36
36
|
layout(layout) {
|
|
37
37
|
return glayouting_1.GLayoutingBuilder.layout(this, layout);
|
package/lib/gcompartment.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gcompartment.js","sourceRoot":"","sources":["../src/gcompartment.ts"],"names":[],"mappings":";;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,qDAAsD;AACtD,6CAA6D;AAC7D,qDAAuE;AAEvE,MAAa,YAAa,SAAQ,8BAAa;IAA/C;;QAKa,SAAI,GAAG,uBAAY,CAAC,WAAW,CAAC;QAEzC,QAAY,GAAG,IAAI,CAAC;IACxB,CAAC;
|
|
1
|
+
{"version":3,"file":"gcompartment.js","sourceRoot":"","sources":["../src/gcompartment.ts"],"names":[],"mappings":";;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,qDAAsD;AACtD,6CAA6D;AAC7D,qDAAuE;AAEvE,MAAa,YAAa,SAAQ,8BAAa;IAA/C;;QAKa,SAAI,GAAG,uBAAY,CAAC,WAAW,CAAC;QAEzC,QAAY,GAAG,IAAI,CAAC;IACxB,CAAC;kBADI,uBAAU;IANX,MAAM,CAAC,OAAO;QACV,OAAO,IAAI,mBAAmB,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,uBAAY,CAAC,WAAW,CAAC,CAAC;IAChF,CAAC;CAKJ;AARD,oCAQC;AAED,MAAa,mBAA2D,SAAQ,qCAAuB;IACnG,MAAM,CAAC,MAAe;QAClB,OAAO,8BAAiB,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAClD,CAAC;CACJ;AAJD,kDAIC"}
|
package/lib/ggraph.js
CHANGED
|
@@ -35,12 +35,12 @@ class GGraph extends gmodel_element_1.GModelRoot {
|
|
|
35
35
|
this[_a] = true;
|
|
36
36
|
this[_b] = true;
|
|
37
37
|
}
|
|
38
|
+
static { _a = gbounds_aware_1.GBoundsAware, _b = glayoutable_1.GLayoutable; }
|
|
38
39
|
static builder() {
|
|
39
40
|
return new GGraphBuilder(GGraph);
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
exports.GGraph = GGraph;
|
|
43
|
-
_a = gbounds_aware_1.GBoundsAware, _b = glayoutable_1.GLayoutable;
|
|
44
44
|
class GGraphBuilder extends gmodel_element_1.GModelRootBuilder {
|
|
45
45
|
position(positionOrX, y) {
|
|
46
46
|
return gbounds_aware_1.GBoundsAwareBuilder.position(this, positionOrX, y);
|
package/lib/ggraph.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ggraph.js","sourceRoot":"","sources":["../src/ggraph.ts"],"names":[],"mappings":";;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF;;;;;GAKG;AACH,qDAAsG;AACtG,mDAAoE;AACpE,+CAAgE;AAChE,qDAAiE;AAEjE,MAAa,MAAO,SAAQ,2BAAU;IAAtC;;QAKa,SAAI,GAAG,uBAAK,CAAC,KAAK,CAAC;QAC5B,aAAQ,GAAU,gBAAK,CAAC,MAAM,CAAC;QAG/B,QAAc,GAAG,IAAI,CAAC;QACtB,QAAa,GAAG,IAAI,CAAC;IACzB,CAAC;
|
|
1
|
+
{"version":3,"file":"ggraph.js","sourceRoot":"","sources":["../src/ggraph.ts"],"names":[],"mappings":";;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF;;;;;GAKG;AACH,qDAAsG;AACtG,mDAAoE;AACpE,+CAAgE;AAChE,qDAAiE;AAEjE,MAAa,MAAO,SAAQ,2BAAU;IAAtC;;QAKa,SAAI,GAAG,uBAAK,CAAC,KAAK,CAAC;QAC5B,aAAQ,GAAU,gBAAK,CAAC,MAAM,CAAC;QAG/B,QAAc,GAAG,IAAI,CAAC;QACtB,QAAa,GAAG,IAAI,CAAC;IACzB,CAAC;kBAFI,4BAAY,OACZ,yBAAW;IATZ,MAAM,CAAU,OAAO;QACnB,OAAO,IAAI,aAAa,CAAC,MAAM,CAAC,CAAC;IACrC,CAAC;CAQJ;AAXD,wBAWC;AAED,MAAa,aAAyC,SAAQ,kCAAoB;IAG9E,QAAQ,CAAC,WAA2B,EAAE,CAAU;QAC5C,OAAO,mCAAmB,CAAC,QAAQ,CAAC,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC;IAC9D,CAAC;IAID,IAAI,CAAC,WAA+B,EAAE,MAAe;QACjD,OAAO,mCAAmB,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;IAC/D,CAAC;IAED,eAAe,CAAC,GAAW,EAAE,KAAoB;QAC7C,OAAO,gCAAkB,CAAC,eAAe,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;IAChE,CAAC;IAID,gBAAgB,CAAC,aAAgD;QAC7D,OAAO,gCAAkB,CAAC,gBAAgB,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;IACpE,CAAC;CACJ;AAtBD,sCAsBC"}
|
package/lib/glabel.js
CHANGED
|
@@ -29,12 +29,12 @@ class GLabel extends gshape_element_1.GShapeElement {
|
|
|
29
29
|
this[_a] = true;
|
|
30
30
|
this[_b] = true;
|
|
31
31
|
}
|
|
32
|
+
static { _a = galignable_1.GAlignable, _b = gedge_layoutable_1.GEdgeLayoutable; }
|
|
32
33
|
static builder(constructor) {
|
|
33
|
-
return new GLabelBuilder(constructor
|
|
34
|
+
return new GLabelBuilder(constructor ?? GLabel).type(protocol_1.DefaultTypes.LABEL);
|
|
34
35
|
}
|
|
35
36
|
}
|
|
36
37
|
exports.GLabel = GLabel;
|
|
37
|
-
_a = galignable_1.GAlignable, _b = gedge_layoutable_1.GEdgeLayoutable;
|
|
38
38
|
class GLabelBuilder extends gshape_element_1.GShapeElementBuilder {
|
|
39
39
|
alignment(xOrAlign, y) {
|
|
40
40
|
return galignable_1.GAlignableBuilder.alignment(this, xOrAlign, y);
|
package/lib/glabel.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glabel.js","sourceRoot":"","sources":["../src/glabel.ts"],"names":[],"mappings":";;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,qDAA6D;AAC7D,6CAA6D;AAC7D,yDAA6F;AAE7F,qDAAuE;AAEvE,MAAa,MAAO,SAAQ,8BAAa;IAAzC;;QAKa,SAAI,GAAG,uBAAY,CAAC,KAAK,CAAC;QAEnC,cAAS,GAAU,gBAAK,CAAC,MAAM,CAAC;QAEhC,QAAY,GAAG,IAAI,CAAC;QACpB,QAAiB,GAAG,IAAI,CAAC;IAC7B,CAAC;
|
|
1
|
+
{"version":3,"file":"glabel.js","sourceRoot":"","sources":["../src/glabel.ts"],"names":[],"mappings":";;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,qDAA6D;AAC7D,6CAA6D;AAC7D,yDAA6F;AAE7F,qDAAuE;AAEvE,MAAa,MAAO,SAAQ,8BAAa;IAAzC;;QAKa,SAAI,GAAG,uBAAY,CAAC,KAAK,CAAC;QAEnC,cAAS,GAAU,gBAAK,CAAC,MAAM,CAAC;QAEhC,QAAY,GAAG,IAAI,CAAC;QACpB,QAAiB,GAAG,IAAI,CAAC;IAC7B,CAAC;kBAFI,uBAAU,OACV,kCAAe;IAThB,MAAM,CAAC,OAAO,CAA4B,WAAyC;QAC/E,OAAO,IAAI,aAAa,CAAC,WAAW,IAAI,MAAM,CAAC,CAAC,IAAI,CAAC,uBAAY,CAAC,KAAK,CAAC,CAAC;IAC7E,CAAC;CAQJ;AAXD,wBAWC;AAED,MAAa,aAAyC,SAAQ,qCAAuB;IAGjF,SAAS,CAAC,QAAwB,EAAE,CAAU;QAC1C,OAAO,8BAAiB,CAAC,SAAS,CAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;IAC1D,CAAC;IAED,IAAI,CAAC,IAAY;QACb,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC;QACvB,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,aAAa,CAAC,SAAyB;QACnC,OAAO,yCAAsB,CAAC,aAAa,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IACjE,CAAC;CACJ;AAfD,sCAeC"}
|
package/lib/gmodel-element.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2022-
|
|
2
|
+
* Copyright (c) 2022-2026 STMicroelectronics and others.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made available under the
|
|
5
5
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gmodel-element.d.ts","sourceRoot":"","sources":["../src/gmodel-element.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EACH,IAAI,EACJ,MAAM,EACN,SAAS,EACT,mBAAmB,EACnB,gBAAgB,EAChB,aAAa,EAEb,KAAK,
|
|
1
|
+
{"version":3,"file":"gmodel-element.d.ts","sourceRoot":"","sources":["../src/gmodel-element.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EACH,IAAI,EACJ,MAAM,EACN,SAAS,EACT,mBAAmB,EACnB,gBAAgB,EAChB,aAAa,EAEb,KAAK,EAGR,MAAM,wBAAwB,CAAC;AAEhC,MAAM,MAAM,wBAAwB,CAAC,CAAC,SAAS,aAAa,GAAG,aAAa,IAAI,UAAU,CAAC,CAAC;AAE5F;;;GAGG;AACH,8BAAsB,aAAc,YAAW,mBAAmB;IAC9D;;;;;;OAMG;IACH,IAAI,EAAE,MAAM,CAAC;I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AAW,gBAAgB;IACrE,MAAM,CAAC,OAAO,IAAI,iBAAiB;IAInC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,qBAAa,iBAAiB,CAAC,CAAC,SAAS,UAAU,GAAG,UAAU,CAAE,SAAQ,oBAAoB,CAAC,CAAC,CAAC;IAC7F,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAKhC,YAAY,CAAC,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,GAAG,IAAI;IACpD,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;CAWrC"}
|
package/lib/gmodel-element.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.GModelRootBuilder = exports.GModelRoot = exports.GModelElementBuilder = exports.GModelElement = void 0;
|
|
4
4
|
/********************************************************************************
|
|
5
|
-
* Copyright (c) 2022-
|
|
5
|
+
* Copyright (c) 2022-2026 STMicroelectronics and others.
|
|
6
6
|
*
|
|
7
7
|
* This program and the accompanying materials are made available under the
|
|
8
8
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -17,7 +17,6 @@ exports.GModelRootBuilder = exports.GModelRoot = exports.GModelElementBuilder =
|
|
|
17
17
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
18
18
|
********************************************************************************/
|
|
19
19
|
const protocol_1 = require("@eclipse-glsp/protocol");
|
|
20
|
-
const uuid = require("uuid");
|
|
21
20
|
/**
|
|
22
21
|
* Base type for all elements of the graphical model.
|
|
23
22
|
* Each model element must have a unique ID and a type that is used to look up its view.
|
|
@@ -59,7 +58,7 @@ class GModelElementBuilder {
|
|
|
59
58
|
this.proxy = new elementConstructor();
|
|
60
59
|
this.proxy.cssClasses = [];
|
|
61
60
|
this.proxy.children = [];
|
|
62
|
-
this.proxy.id =
|
|
61
|
+
this.proxy.id = (0, protocol_1.generateUuid)();
|
|
63
62
|
}
|
|
64
63
|
reset() {
|
|
65
64
|
this.proxy = new this.elementConstructor();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gmodel-element.js","sourceRoot":"","sources":["../src/gmodel-element.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,
|
|
1
|
+
{"version":3,"file":"gmodel-element.js","sourceRoot":"","sources":["../src/gmodel-element.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,qDAWgC;AAIhC;;;GAGG;AACH,MAAsB,aAAa;IAAnC;QAcI;;WAEG;QACH,eAAU,GAAa,EAAE,CAAC;QAC1B;;;;WAIG;QACH,aAAQ,GAAoB,EAAE,CAAC;IAqBnC,CAAC;IAVG;;OAEG;IACH,IAAI,IAAI;QACJ,IAAI,OAAO,GAAkB,IAAI,CAAC;QAClC,OAAO,CAAC,CAAC,OAAO,YAAY,UAAU,CAAC,EAAE,CAAC;YACtC,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;QAC7B,CAAC;QACD,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ;AA5CD,sCA4CC;AAED;;;;;GAKG;AACH,MAAsB,oBAAoB;IAItC,YAAY,kBAA+C;QACvD,IAAI,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;QAC7C,IAAI,CAAC,KAAK,GAAG,IAAI,kBAAkB,EAAE,CAAC;QACtC,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,EAAE,CAAC;QAC3B,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,EAAE,CAAC;QACzB,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,IAAA,uBAAY,GAAE,CAAC;IACnC,CAAC;IAED,KAAK;QACD,IAAI,CAAC,KAAK,GAAG,IAAI,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAC3C,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,KAAK;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C;IAC7C,CAAC;CAIJ;AAPD,gCAOC;AAED,MAAa,iBAAqD,SAAQ,oBAAuB;IAC7F,QAAQ,CAAC,QAAgB;QACrB,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAC/B,OAAO,IAAI,CAAC;IAChB,CAAC;IAID,YAAY,CAAC,gBAAgC,EAAE,IAAgB;QAC3D,IAAI,MAAc,CAAC;QACnB,IAAI,IAAI,EAAE,CAAC;YACP,MAAM,GAAG,EAAE,GAAG,gBAAgB,EAAE,GAAG,IAAI,EAAE,CAAC;QAC9C,CAAC;aAAM,CAAC;YACJ,MAAM,GAAG,gBAA0B,CAAC;QACxC,CAAC;QACD,IAAI,CAAC,KAAK,CAAC,YAAY,GAAG,MAAM,CAAC;QACjC,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAlBD,8CAkBC"}
|
package/lib/gnode.js
CHANGED
|
@@ -28,12 +28,12 @@ class GNode extends gshape_element_1.GShapeElement {
|
|
|
28
28
|
this[_a] = true;
|
|
29
29
|
this[_b] = true;
|
|
30
30
|
}
|
|
31
|
+
static { _a = gedge_layoutable_1.GEdgeLayoutable, _b = glayouting_1.GLayouting; }
|
|
31
32
|
static builder() {
|
|
32
33
|
return new GNodeBuilder(GNode).type(protocol_1.DefaultTypes.NODE);
|
|
33
34
|
}
|
|
34
35
|
}
|
|
35
36
|
exports.GNode = GNode;
|
|
36
|
-
_a = gedge_layoutable_1.GEdgeLayoutable, _b = glayouting_1.GLayouting;
|
|
37
37
|
class GNodeBuilder extends gshape_element_1.GShapeElementBuilder {
|
|
38
38
|
edgePlacement(placement) {
|
|
39
39
|
return gedge_layoutable_1.GEdgeLayoutableBuilder.edgePlacement(this, placement);
|
package/lib/gnode.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gnode.js","sourceRoot":"","sources":["../src/gnode.ts"],"names":[],"mappings":";;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,qDAAsD;AACtD,yDAA6F;AAC7F,6CAA6D;AAC7D,qDAAuE;AAEvE,MAAa,KAAM,SAAQ,8BAAa;IAAxC;;QAKa,SAAI,GAAG,uBAAY,CAAC,IAAI,CAAC;QAGlC,QAAiB,GAAG,IAAI,CAAC;QACzB,QAAY,GAAG,IAAI,CAAC;IACxB,CAAC;
|
|
1
|
+
{"version":3,"file":"gnode.js","sourceRoot":"","sources":["../src/gnode.ts"],"names":[],"mappings":";;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,qDAAsD;AACtD,yDAA6F;AAC7F,6CAA6D;AAC7D,qDAAuE;AAEvE,MAAa,KAAM,SAAQ,8BAAa;IAAxC;;QAKa,SAAI,GAAG,uBAAY,CAAC,IAAI,CAAC;QAGlC,QAAiB,GAAG,IAAI,CAAC;QACzB,QAAY,GAAG,IAAI,CAAC;IACxB,CAAC;kBAFI,kCAAe,OACf,uBAAU;IARX,MAAM,CAAC,OAAO;QACV,OAAO,IAAI,YAAY,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,uBAAY,CAAC,IAAI,CAAC,CAAC;IAC3D,CAAC;CAOJ;AAVD,sBAUC;AAED,MAAa,YAAsC,SAAQ,qCAAuB;IAC9E,aAAa,CAAC,SAAyB;QACnC,OAAO,yCAAsB,CAAC,aAAa,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IACjE,CAAC;IAED,MAAM,CAAC,MAAe;QAClB,OAAO,8BAAiB,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAClD,CAAC;CACJ;AARD,oCAQC"}
|
package/lib/gshape-element.js
CHANGED
|
@@ -13,9 +13,9 @@ class GShapeElement extends gmodel_element_1.GModelElement {
|
|
|
13
13
|
this[_b] = true;
|
|
14
14
|
this[_c] = true;
|
|
15
15
|
}
|
|
16
|
+
static { _a = gbounds_aware_1.GBoundsAware, _b = glayoutable_1.GLayoutable, _c = gresizable_1.GResizable; }
|
|
16
17
|
}
|
|
17
18
|
exports.GShapeElement = GShapeElement;
|
|
18
|
-
_a = gbounds_aware_1.GBoundsAware, _b = glayoutable_1.GLayoutable, _c = gresizable_1.GResizable;
|
|
19
19
|
class GShapeElementBuilder extends gmodel_element_1.GModelElementBuilder {
|
|
20
20
|
position(pointOrX, y) {
|
|
21
21
|
return gbounds_aware_1.GBoundsAwareBuilder.position(this, pointOrX, y);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gshape-element.js","sourceRoot":"","sources":["../src/gshape-element.ts"],"names":[],"mappings":";;;;AAgBA,mDAAoE;AACpE,+CAAgE;AAChE,qDAAuE;AACvE,6CAA8E;AAE9E,MAAsB,aAAc,SAAQ,8BAAa;IAAzD;;QAKI,QAAc,GAAG,IAAI,CAAC;QACtB,QAAa,GAAG,IAAI,CAAC;QACrB,QAAY,GAAG,IAAI,CAAC;IACxB,CAAC;
|
|
1
|
+
{"version":3,"file":"gshape-element.js","sourceRoot":"","sources":["../src/gshape-element.ts"],"names":[],"mappings":";;;;AAgBA,mDAAoE;AACpE,+CAAgE;AAChE,qDAAuE;AACvE,6CAA8E;AAE9E,MAAsB,aAAc,SAAQ,8BAAa;IAAzD;;QAKI,QAAc,GAAG,IAAI,CAAC;QACtB,QAAa,GAAG,IAAI,CAAC;QACrB,QAAY,GAAG,IAAI,CAAC;IACxB,CAAC;kBAHI,4BAAY,OACZ,yBAAW,OACX,uBAAU;CACd;AARD,sCAQC;AAED,MAAa,oBAA8C,SAAQ,qCAAuB;IAGtF,QAAQ,CAAC,QAAwB,EAAE,CAAU;QACzC,OAAO,mCAAmB,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;IAC3D,CAAC;IAID,IAAI,CAAC,WAA+B,EAAE,MAAe;QACjD,OAAO,mCAAmB,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;IAC/D,CAAC;IAED,eAAe,CAAC,GAAW,EAAE,KAAoB;QAC7C,OAAO,gCAAkB,CAAC,eAAe,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;IAChE,CAAC;IAID,gBAAgB,CAAC,aAAgD;QAC7D,OAAO,gCAAkB,CAAC,gBAAgB,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;IACpE,CAAC;IAED,eAAe,CAAC,eAAmC;QAC/C,OAAO,8BAAiB,CAAC,eAAe,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;IACpE,CAAC;CACJ;AA1BD,oDA0BC"}
|
|
@@ -34,12 +34,12 @@ class GShapedPreRenderedElement extends gpre_rendered_element_1.GPreRenderedElem
|
|
|
34
34
|
this[_a] = true;
|
|
35
35
|
this[_b] = true;
|
|
36
36
|
}
|
|
37
|
+
static { _a = gbounds_aware_1.GBoundsAware, _b = galignable_1.GAlignable; }
|
|
37
38
|
static builder() {
|
|
38
39
|
return new GShapePreRenderedElementBuilder(GShapedPreRenderedElement);
|
|
39
40
|
}
|
|
40
41
|
}
|
|
41
42
|
exports.GShapedPreRenderedElement = GShapedPreRenderedElement;
|
|
42
|
-
_a = gbounds_aware_1.GBoundsAware, _b = galignable_1.GAlignable;
|
|
43
43
|
class GShapePreRenderedElementBuilder extends gmodel_element_1.GModelElementBuilder {
|
|
44
44
|
code(code) {
|
|
45
45
|
this.proxy.code = code;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gshaped-prerendered-element.js","sourceRoot":"","sources":["../src/gshaped-prerendered-element.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;AAGlF,6CAA0C;AAC1C,mDAAoE;AACpE,qDAAwD;AACxD,mEAA8D;AAE9D;;;;;;GAMG;AACH,MAAa,yBAA0B,SAAQ,2CAAmB;IAAlE;;QAQI,QAAc,GAAG,IAAI,CAAC;QACtB,QAAY,GAAG,IAAI,CAAC;IACxB,CAAC;
|
|
1
|
+
{"version":3,"file":"gshaped-prerendered-element.js","sourceRoot":"","sources":["../src/gshaped-prerendered-element.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;AAGlF,6CAA0C;AAC1C,mDAAoE;AACpE,qDAAwD;AACxD,mEAA8D;AAE9D;;;;;;GAMG;AACH,MAAa,yBAA0B,SAAQ,2CAAmB;IAAlE;;QAQI,QAAc,GAAG,IAAI,CAAC;QACtB,QAAY,GAAG,IAAI,CAAC;IACxB,CAAC;kBAFI,4BAAY,OACZ,uBAAU;IARX,MAAM,CAAU,OAAO;QACnB,OAAO,IAAI,+BAA+B,CAAC,yBAAyB,CAAC,CAAC;IAC1E,CAAC;CAOJ;AAVD,8DAUC;AAED,MAAa,+BAEX,SAAQ,qCAAuB;IAC7B,IAAI,CAAC,IAAY;QACb,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC;QACvB,OAAO,IAAI,CAAC;IAChB,CAAC;IAID,QAAQ,CAAC,QAAwB,EAAE,CAAU;QACzC,OAAO,mCAAmB,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;IAC3D,CAAC;IAID,IAAI,CAAC,WAA+B,EAAE,MAAe;QACjD,OAAO,mCAAmB,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;IAC/D,CAAC;CACJ;AAnBD,0EAmBC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eclipse-glsp/graph",
|
|
3
|
-
"version": "2.8.0-next.
|
|
3
|
+
"version": "2.8.0-next.6",
|
|
4
4
|
"description": "The typescript implementation of the GLSP graphical model (GModel)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eclipse",
|
|
@@ -36,26 +36,20 @@
|
|
|
36
36
|
"types": "lib/index",
|
|
37
37
|
"files": [
|
|
38
38
|
"lib",
|
|
39
|
-
"src"
|
|
39
|
+
"src",
|
|
40
|
+
"!**/*.spec.ts",
|
|
41
|
+
"!**/*.spec.tsx"
|
|
40
42
|
],
|
|
41
|
-
"scripts": {
|
|
42
|
-
"build": "tsc -b",
|
|
43
|
-
"clean": "rimraf lib *.tsbuildinfo coverage .nyc_output",
|
|
44
|
-
"generate:index": "glsp generateIndex src -f -s",
|
|
45
|
-
"lint": "eslint ./src",
|
|
46
|
-
"test": "mocha --config ../../.mocharc \"./src/**/*.spec.?(ts|tsx)\"",
|
|
47
|
-
"test:ci": "yarn test --reporter mocha-ctrf-json-reporter",
|
|
48
|
-
"test:coverage": "nyc yarn test",
|
|
49
|
-
"watch": "tsc -w"
|
|
50
|
-
},
|
|
51
43
|
"dependencies": {
|
|
52
44
|
"@eclipse-glsp/protocol": "next"
|
|
53
45
|
},
|
|
54
|
-
"devDependencies": {
|
|
55
|
-
"@types/uuid": "8.3.1"
|
|
56
|
-
},
|
|
57
46
|
"publishConfig": {
|
|
58
47
|
"access": "public"
|
|
59
48
|
},
|
|
60
|
-
"
|
|
61
|
-
|
|
49
|
+
"scripts": {
|
|
50
|
+
"build": "tsc -b",
|
|
51
|
+
"clean": "rimraf lib *.tsbuildinfo coverage",
|
|
52
|
+
"generate:index": "glsp generateIndex src -f -s",
|
|
53
|
+
"lint": "eslint ./src"
|
|
54
|
+
}
|
|
55
|
+
}
|
package/src/gmodel-element.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2022-
|
|
2
|
+
* Copyright (c) 2022-2026 STMicroelectronics and others.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made available under the
|
|
5
5
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -22,9 +22,9 @@ import {
|
|
|
22
22
|
JsonPrimitive,
|
|
23
23
|
MaybeArray,
|
|
24
24
|
Point,
|
|
25
|
-
flatPush
|
|
25
|
+
flatPush,
|
|
26
|
+
generateUuid
|
|
26
27
|
} from '@eclipse-glsp/protocol';
|
|
27
|
-
import * as uuid from 'uuid';
|
|
28
28
|
|
|
29
29
|
export type GModelElementConstructor<G extends GModelElement = GModelElement> = new () => G;
|
|
30
30
|
|
|
@@ -93,7 +93,7 @@ export abstract class GModelElementBuilder<G extends GModelElement> {
|
|
|
93
93
|
this.proxy = new elementConstructor();
|
|
94
94
|
this.proxy.cssClasses = [];
|
|
95
95
|
this.proxy.children = [];
|
|
96
|
-
this.proxy.id =
|
|
96
|
+
this.proxy.id = generateUuid();
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
reset(): this {
|
package/lib/galignable.spec.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"galignable.spec.d.ts","sourceRoot":"","sources":["../src/galignable.spec.ts"],"names":[],"mappings":""}
|
package/lib/galignable.spec.js
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
/********************************************************************************
|
|
4
|
-
* Copyright (c) 2024 EclipseSource and others.
|
|
5
|
-
*
|
|
6
|
-
* This program and the accompanying materials are made available under the
|
|
7
|
-
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
8
|
-
* http://www.eclipse.org/legal/epl-2.0.
|
|
9
|
-
*
|
|
10
|
-
* This Source Code may also be made available under the following Secondary
|
|
11
|
-
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
12
|
-
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
13
|
-
* with the GNU Classpath Exception which is available at
|
|
14
|
-
* https://www.gnu.org/software/classpath/license.html.
|
|
15
|
-
*
|
|
16
|
-
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
17
|
-
********************************************************************************/
|
|
18
|
-
const protocol_1 = require("@eclipse-glsp/protocol");
|
|
19
|
-
const chai_1 = require("chai");
|
|
20
|
-
const galignable_1 = require("./galignable");
|
|
21
|
-
const glabel_1 = require("./glabel");
|
|
22
|
-
const gnode_1 = require("./gnode");
|
|
23
|
-
describe('GAlignable Tests', () => {
|
|
24
|
-
describe('isGAlignable function', () => {
|
|
25
|
-
it('should return true for a GAlignable element', () => {
|
|
26
|
-
const gLabelElement = new glabel_1.GLabelBuilder(glabel_1.GLabel) //
|
|
27
|
-
.type(protocol_1.DefaultTypes.LABEL) //
|
|
28
|
-
.build();
|
|
29
|
-
const result = (0, galignable_1.isGAlignable)(gLabelElement);
|
|
30
|
-
(0, chai_1.expect)(result).to.be.true;
|
|
31
|
-
});
|
|
32
|
-
it('should return false for a non-GAlignable element', () => {
|
|
33
|
-
const gNodeElement = new gnode_1.GNodeBuilder(gnode_1.GNode) //
|
|
34
|
-
.position(100, 50) //
|
|
35
|
-
.size(50, 15) //
|
|
36
|
-
.type(protocol_1.DefaultTypes.NODE) //
|
|
37
|
-
.build();
|
|
38
|
-
const result = (0, galignable_1.isGAlignable)(gNodeElement);
|
|
39
|
-
(0, chai_1.expect)(result).to.be.false;
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
describe('GAlignableBuilder alignment function', () => {
|
|
43
|
-
it('should set alignment using a point object', () => {
|
|
44
|
-
const builder = new glabel_1.GLabelBuilder(glabel_1.GLabel);
|
|
45
|
-
galignable_1.GAlignableBuilder.alignment(builder, { x: 45, y: 90 });
|
|
46
|
-
(0, chai_1.expect)(builder['proxy'].alignment).to.deep.equal({ x: 45, y: 90 });
|
|
47
|
-
});
|
|
48
|
-
it('should set alignment using x and y parameters', () => {
|
|
49
|
-
let builder = new glabel_1.GLabelBuilder(glabel_1.GLabel);
|
|
50
|
-
galignable_1.GAlignableBuilder.alignment(builder, 8, 16);
|
|
51
|
-
(0, chai_1.expect)(builder['proxy'].alignment).to.deep.equal({ x: 8, y: 16 });
|
|
52
|
-
builder = new glabel_1.GLabelBuilder(glabel_1.GLabel);
|
|
53
|
-
galignable_1.GAlignableBuilder.alignment(builder, 12, 0);
|
|
54
|
-
(0, chai_1.expect)(builder['proxy'].alignment).to.deep.equal({ x: 12, y: 0 });
|
|
55
|
-
});
|
|
56
|
-
it('should set alignment from point object if y is provided too', () => {
|
|
57
|
-
const builder = new glabel_1.GLabelBuilder(glabel_1.GLabel);
|
|
58
|
-
galignable_1.GAlignableBuilder.alignment(builder, { x: 17, y: 71 }, 15);
|
|
59
|
-
(0, chai_1.expect)(builder['proxy'].alignment).to.deep.equal({ x: 17, y: 71 });
|
|
60
|
-
});
|
|
61
|
-
it('should default y to 0 if y is not provided', () => {
|
|
62
|
-
const builder = new glabel_1.GLabelBuilder(glabel_1.GLabel);
|
|
63
|
-
galignable_1.GAlignableBuilder.alignment(builder, 77);
|
|
64
|
-
(0, chai_1.expect)(builder['proxy'].alignment).to.deep.equal({ x: 77, y: 0 });
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
});
|
|
68
|
-
//# sourceMappingURL=galignable.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"galignable.spec.js","sourceRoot":"","sources":["../src/galignable.spec.ts"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,qDAAsD;AACtD,+BAA8B;AAC9B,6CAA+D;AAC/D,qCAAiD;AACjD,mCAA8C;AAE9C,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAC9B,QAAQ,CAAC,uBAAuB,EAAE,GAAG,EAAE;QACnC,EAAE,CAAC,6CAA6C,EAAE,GAAG,EAAE;YACnD,MAAM,aAAa,GAAG,IAAI,sBAAa,CAAC,eAAM,CAAC,CAAC,EAAE;iBAC7C,IAAI,CAAC,uBAAY,CAAC,KAAK,CAAC,CAAC,EAAE;iBAC3B,KAAK,EAAE,CAAC;YAEb,MAAM,MAAM,GAAG,IAAA,yBAAY,EAAC,aAAa,CAAC,CAAC;YAC3C,IAAA,aAAM,EAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC;QAC9B,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,kDAAkD,EAAE,GAAG,EAAE;YACxD,MAAM,YAAY,GAA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3,"file":"gbounds-aware.spec.d.ts","sourceRoot":"","sources":["../src/gbounds-aware.spec.ts"],"names":[],"mappings":""}
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
/********************************************************************************
|
|
4
|
-
* Copyright (c) 2024 EclipseSource and others.
|
|
5
|
-
*
|
|
6
|
-
* This program and the accompanying materials are made available under the
|
|
7
|
-
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
8
|
-
* http://www.eclipse.org/legal/epl-2.0.
|
|
9
|
-
*
|
|
10
|
-
* This Source Code may also be made available under the following Secondary
|
|
11
|
-
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
12
|
-
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
13
|
-
* with the GNU Classpath Exception which is available at
|
|
14
|
-
* https://www.gnu.org/software/classpath/license.html.
|
|
15
|
-
*
|
|
16
|
-
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
17
|
-
********************************************************************************/
|
|
18
|
-
const protocol_1 = require("@eclipse-glsp/protocol");
|
|
19
|
-
const chai_1 = require("chai");
|
|
20
|
-
const gbounds_aware_1 = require("./gbounds-aware");
|
|
21
|
-
const gedge_1 = require("./gedge");
|
|
22
|
-
const gnode_1 = require("./gnode");
|
|
23
|
-
const gshape_element_1 = require("./gshape-element");
|
|
24
|
-
describe('GBoundsAware Tests', () => {
|
|
25
|
-
describe('isGBoundsAware function', () => {
|
|
26
|
-
it('should return true for a GBoundsAware element', () => {
|
|
27
|
-
const gNodeElement = new gnode_1.GNodeBuilder(gnode_1.GNode) //
|
|
28
|
-
.position(100, 50) //
|
|
29
|
-
.size(50, 15) //
|
|
30
|
-
.type(protocol_1.DefaultTypes.NODE) //
|
|
31
|
-
.build();
|
|
32
|
-
const result = (0, gbounds_aware_1.isGBoundsAware)(gNodeElement);
|
|
33
|
-
(0, chai_1.expect)(result).to.be.true;
|
|
34
|
-
});
|
|
35
|
-
it('should return false for a non-GBoundsAware element', () => {
|
|
36
|
-
const gEdgeElement = new gedge_1.GEdgeBuilder(gedge_1.GEdge) //
|
|
37
|
-
.type(protocol_1.DefaultTypes.EDGE) //
|
|
38
|
-
.build();
|
|
39
|
-
const result = (0, gbounds_aware_1.isGBoundsAware)(gEdgeElement);
|
|
40
|
-
(0, chai_1.expect)(result).to.be.false;
|
|
41
|
-
});
|
|
42
|
-
});
|
|
43
|
-
describe('GBoundsAwareBuilder position function', () => {
|
|
44
|
-
it('should set position using a point object', () => {
|
|
45
|
-
const builder = new gshape_element_1.GShapeElementBuilder(gnode_1.GNode);
|
|
46
|
-
gbounds_aware_1.GBoundsAwareBuilder.position(builder, { x: 5, y: 10 });
|
|
47
|
-
(0, chai_1.expect)(builder['proxy'].position).to.deep.equal({ x: 5, y: 10 });
|
|
48
|
-
});
|
|
49
|
-
it('should set position using x and y parameters', () => {
|
|
50
|
-
let builder = new gshape_element_1.GShapeElementBuilder(gnode_1.GNode);
|
|
51
|
-
gbounds_aware_1.GBoundsAwareBuilder.position(builder, 5, 10);
|
|
52
|
-
(0, chai_1.expect)(builder['proxy'].position).to.deep.equal({ x: 5, y: 10 });
|
|
53
|
-
builder = new gshape_element_1.GShapeElementBuilder(gnode_1.GNode);
|
|
54
|
-
gbounds_aware_1.GBoundsAwareBuilder.position(builder, 5, 0);
|
|
55
|
-
(0, chai_1.expect)(builder['proxy'].position).to.deep.equal({ x: 5, y: 0 });
|
|
56
|
-
});
|
|
57
|
-
it('should set position from point object if y is provided too', () => {
|
|
58
|
-
const builder = new gshape_element_1.GShapeElementBuilder(gnode_1.GNode);
|
|
59
|
-
gbounds_aware_1.GBoundsAwareBuilder.position(builder, { x: 17, y: 71 }, 15);
|
|
60
|
-
(0, chai_1.expect)(builder['proxy'].position).to.deep.equal({ x: 17, y: 71 });
|
|
61
|
-
});
|
|
62
|
-
it('should default y to 0 if y is not provided', () => {
|
|
63
|
-
const builder = new gshape_element_1.GShapeElementBuilder(gnode_1.GNode);
|
|
64
|
-
gbounds_aware_1.GBoundsAwareBuilder.position(builder, 35);
|
|
65
|
-
(0, chai_1.expect)(builder['proxy'].position).to.deep.equal({ x: 35, y: 0 });
|
|
66
|
-
});
|
|
67
|
-
});
|
|
68
|
-
describe('GBoundsAwareBuilder size function', () => {
|
|
69
|
-
it('should set size using a dimension object', () => {
|
|
70
|
-
const builder = new gshape_element_1.GShapeElementBuilder(gnode_1.GNode);
|
|
71
|
-
gbounds_aware_1.GBoundsAwareBuilder.size(builder, { width: 55, height: 15 });
|
|
72
|
-
(0, chai_1.expect)(builder['proxy'].size).to.deep.equal({ width: 55, height: 15 });
|
|
73
|
-
});
|
|
74
|
-
it('should set size using width and height parameters', () => {
|
|
75
|
-
let builder = new gshape_element_1.GShapeElementBuilder(gnode_1.GNode);
|
|
76
|
-
gbounds_aware_1.GBoundsAwareBuilder.size(builder, 50, 35);
|
|
77
|
-
(0, chai_1.expect)(builder['proxy'].size).to.deep.equal({ width: 50, height: 35 });
|
|
78
|
-
builder = new gshape_element_1.GShapeElementBuilder(gnode_1.GNode);
|
|
79
|
-
gbounds_aware_1.GBoundsAwareBuilder.size(builder, 70, 0);
|
|
80
|
-
(0, chai_1.expect)(builder['proxy'].size).to.deep.equal({ width: 70, height: 0 });
|
|
81
|
-
});
|
|
82
|
-
it('should set size from dimension object if height is provided too', () => {
|
|
83
|
-
const builder = new gshape_element_1.GShapeElementBuilder(gnode_1.GNode);
|
|
84
|
-
gbounds_aware_1.GBoundsAwareBuilder.size(builder, { width: 11, height: 33 }, 15);
|
|
85
|
-
(0, chai_1.expect)(builder['proxy'].size).to.deep.equal({ width: 11, height: 33 });
|
|
86
|
-
});
|
|
87
|
-
it('should default height to 0 if height is not provided', () => {
|
|
88
|
-
const builder = new gshape_element_1.GShapeElementBuilder(gnode_1.GNode);
|
|
89
|
-
gbounds_aware_1.GBoundsAwareBuilder.size(builder, 60);
|
|
90
|
-
(0, chai_1.expect)(builder['proxy'].size).to.deep.equal({ width: 60, height: 0 });
|
|
91
|
-
});
|
|
92
|
-
});
|
|
93
|
-
});
|
|
94
|
-
//# sourceMappingURL=gbounds-aware.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gbounds-aware.spec.js","sourceRoot":"","sources":["../src/gbounds-aware.spec.ts"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,qDAAsD;AACtD,+BAA8B;AAC9B,mDAAsE;AACtE,mCAA8C;AAC9C,mCAA8C;AAC9C,qDAAwD;AAExD,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAChC,QAAQ,CAAC,yBAAyB,EAAE,GAAG,EAAE;QACrC,EAAE,CAAC,+CAA+C,EAAE,GAAG,EAAE;YACrD,MAAM,YAAY,GAAG,IAAI,oBAAY,CAAC,aAAK,CAAC,CAAC,EAAE;iBAC1C,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,EAAE;iBACpB,IAAI,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE;iBACf,IAAI,CAAC,uBAAY,CAAC,IAAI,CAAC,CAAC,EAAE;iBAC1B,KAAK,EAAE,CAAC;YAEb,MAAM,MAAM,GAAG,IAAA,8BAAc,EAAC,YAAY,CAAC,CAAC;YAC5C,IAAA,aAAM,EAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC;QAC9B,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,oDAAoD,EAAE,GAAG,EAAE;YAC1D,MAAM,YAAY,GAAG,IAAI,oBAAY,CAAC,aAAK,CAAC,CAAC,EAAE;iBAC1C,IAAI,CAAC,uBAAY,CAAC,IAAI,CAAC,CAAC,EAAE;iBAC1B,KAAK,EAAE,CAAC;YAEb,MAAM,MAAM,GAAG,IAAA,8BAAc,EAAC,YAAY,CAAC,CAAC;YAC5C,IAAA,aAAM,EAAC,MAAM,CAAC,CAAC,EAAE,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;YAC5D,MAAM,OAAO,GAAG,IAAI,qCAAoB,CAAC,aAAK,CAAC,CAAC;YAChD,mCAAmB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;YACtC,IAAA,aAAM,EAAC,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC;QAC1E,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
package/lib/index.spec.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2022 STMicroelectronics and others.
|
|
3
|
-
*
|
|
4
|
-
* This program and the accompanying materials are made available under the
|
|
5
|
-
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
-
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
-
*
|
|
8
|
-
* This Source Code may also be made available under the following Secondary
|
|
9
|
-
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
-
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
-
* with the GNU Classpath Exception which is available at
|
|
12
|
-
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
-
*
|
|
14
|
-
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
-
********************************************************************************/
|
|
16
|
-
//# sourceMappingURL=index.spec.d.ts.map
|
package/lib/index.spec.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.spec.d.ts","sourceRoot":"","sources":["../src/index.spec.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF"}
|
package/lib/index.spec.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/********************************************************************************
|
|
3
|
-
* Copyright (c) 2022 STMicroelectronics and others.
|
|
4
|
-
*
|
|
5
|
-
* This program and the accompanying materials are made available under the
|
|
6
|
-
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
-
* http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
-
*
|
|
9
|
-
* This Source Code may also be made available under the following Secondary
|
|
10
|
-
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
-
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
-
* with the GNU Classpath Exception which is available at
|
|
13
|
-
* https://www.gnu.org/software/classpath/license.html.
|
|
14
|
-
*
|
|
15
|
-
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
16
|
-
********************************************************************************/
|
|
17
|
-
/* note: this bogus test file is required so that
|
|
18
|
-
we are able to run mocha unit tests on this
|
|
19
|
-
package, without having any actual unit tests in it.
|
|
20
|
-
This way a coverage report will be generated,
|
|
21
|
-
showing 0% coverage, instead of no report.
|
|
22
|
-
This file can be removed once we have real unit
|
|
23
|
-
tests in place. */
|
|
24
|
-
describe('graph package', () => {
|
|
25
|
-
it('should support code coverage statistics', () => true);
|
|
26
|
-
});
|
|
27
|
-
//# sourceMappingURL=index.spec.js.map
|
package/lib/index.spec.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.spec.js","sourceRoot":"","sources":["../src/index.spec.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;AAElF;;;;;;qBAMqB;AAErB,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC3B,EAAE,CAAC,yCAAyC,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;AAC9D,CAAC,CAAC,CAAC"}
|
package/src/galignable.spec.ts
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2024 EclipseSource and others.
|
|
3
|
-
*
|
|
4
|
-
* This program and the accompanying materials are made available under the
|
|
5
|
-
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
-
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
-
*
|
|
8
|
-
* This Source Code may also be made available under the following Secondary
|
|
9
|
-
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
-
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
-
* with the GNU Classpath Exception which is available at
|
|
12
|
-
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
-
*
|
|
14
|
-
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
-
********************************************************************************/
|
|
16
|
-
import { DefaultTypes } from '@eclipse-glsp/protocol';
|
|
17
|
-
import { expect } from 'chai';
|
|
18
|
-
import { GAlignableBuilder, isGAlignable } from './galignable';
|
|
19
|
-
import { GLabel, GLabelBuilder } from './glabel';
|
|
20
|
-
import { GNode, GNodeBuilder } from './gnode';
|
|
21
|
-
|
|
22
|
-
describe('GAlignable Tests', () => {
|
|
23
|
-
describe('isGAlignable function', () => {
|
|
24
|
-
it('should return true for a GAlignable element', () => {
|
|
25
|
-
const gLabelElement = new GLabelBuilder(GLabel) //
|
|
26
|
-
.type(DefaultTypes.LABEL) //
|
|
27
|
-
.build();
|
|
28
|
-
|
|
29
|
-
const result = isGAlignable(gLabelElement);
|
|
30
|
-
expect(result).to.be.true;
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
it('should return false for a non-GAlignable element', () => {
|
|
34
|
-
const gNodeElement = new GNodeBuilder(GNode) //
|
|
35
|
-
.position(100, 50) //
|
|
36
|
-
.size(50, 15) //
|
|
37
|
-
.type(DefaultTypes.NODE) //
|
|
38
|
-
.build();
|
|
39
|
-
|
|
40
|
-
const result = isGAlignable(gNodeElement);
|
|
41
|
-
expect(result).to.be.false;
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
describe('GAlignableBuilder alignment function', () => {
|
|
46
|
-
it('should set alignment using a point object', () => {
|
|
47
|
-
const builder = new GLabelBuilder(GLabel);
|
|
48
|
-
GAlignableBuilder.alignment(builder, { x: 45, y: 90 });
|
|
49
|
-
expect(builder['proxy'].alignment).to.deep.equal({ x: 45, y: 90 });
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
it('should set alignment using x and y parameters', () => {
|
|
53
|
-
let builder = new GLabelBuilder(GLabel);
|
|
54
|
-
GAlignableBuilder.alignment(builder, 8, 16);
|
|
55
|
-
expect(builder['proxy'].alignment).to.deep.equal({ x: 8, y: 16 });
|
|
56
|
-
|
|
57
|
-
builder = new GLabelBuilder(GLabel);
|
|
58
|
-
GAlignableBuilder.alignment(builder, 12, 0);
|
|
59
|
-
expect(builder['proxy'].alignment).to.deep.equal({ x: 12, y: 0 });
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
it('should set alignment from point object if y is provided too', () => {
|
|
63
|
-
const builder = new GLabelBuilder(GLabel);
|
|
64
|
-
GAlignableBuilder.alignment(builder, { x: 17, y: 71 }, 15);
|
|
65
|
-
expect(builder['proxy'].alignment).to.deep.equal({ x: 17, y: 71 });
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
it('should default y to 0 if y is not provided', () => {
|
|
69
|
-
const builder = new GLabelBuilder(GLabel);
|
|
70
|
-
GAlignableBuilder.alignment(builder, 77);
|
|
71
|
-
expect(builder['proxy'].alignment).to.deep.equal({ x: 77, y: 0 });
|
|
72
|
-
});
|
|
73
|
-
});
|
|
74
|
-
});
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2024 EclipseSource and others.
|
|
3
|
-
*
|
|
4
|
-
* This program and the accompanying materials are made available under the
|
|
5
|
-
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
-
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
-
*
|
|
8
|
-
* This Source Code may also be made available under the following Secondary
|
|
9
|
-
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
-
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
-
* with the GNU Classpath Exception which is available at
|
|
12
|
-
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
-
*
|
|
14
|
-
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
-
********************************************************************************/
|
|
16
|
-
import { DefaultTypes } from '@eclipse-glsp/protocol';
|
|
17
|
-
import { expect } from 'chai';
|
|
18
|
-
import { GBoundsAwareBuilder, isGBoundsAware } from './gbounds-aware';
|
|
19
|
-
import { GEdge, GEdgeBuilder } from './gedge';
|
|
20
|
-
import { GNode, GNodeBuilder } from './gnode';
|
|
21
|
-
import { GShapeElementBuilder } from './gshape-element';
|
|
22
|
-
|
|
23
|
-
describe('GBoundsAware Tests', () => {
|
|
24
|
-
describe('isGBoundsAware function', () => {
|
|
25
|
-
it('should return true for a GBoundsAware element', () => {
|
|
26
|
-
const gNodeElement = new GNodeBuilder(GNode) //
|
|
27
|
-
.position(100, 50) //
|
|
28
|
-
.size(50, 15) //
|
|
29
|
-
.type(DefaultTypes.NODE) //
|
|
30
|
-
.build();
|
|
31
|
-
|
|
32
|
-
const result = isGBoundsAware(gNodeElement);
|
|
33
|
-
expect(result).to.be.true;
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
it('should return false for a non-GBoundsAware element', () => {
|
|
37
|
-
const gEdgeElement = new GEdgeBuilder(GEdge) //
|
|
38
|
-
.type(DefaultTypes.EDGE) //
|
|
39
|
-
.build();
|
|
40
|
-
|
|
41
|
-
const result = isGBoundsAware(gEdgeElement);
|
|
42
|
-
expect(result).to.be.false;
|
|
43
|
-
});
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
describe('GBoundsAwareBuilder position function', () => {
|
|
47
|
-
it('should set position using a point object', () => {
|
|
48
|
-
const builder = new GShapeElementBuilder(GNode);
|
|
49
|
-
GBoundsAwareBuilder.position(builder, { x: 5, y: 10 });
|
|
50
|
-
expect(builder['proxy'].position).to.deep.equal({ x: 5, y: 10 });
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
it('should set position using x and y parameters', () => {
|
|
54
|
-
let builder = new GShapeElementBuilder(GNode);
|
|
55
|
-
GBoundsAwareBuilder.position(builder, 5, 10);
|
|
56
|
-
expect(builder['proxy'].position).to.deep.equal({ x: 5, y: 10 });
|
|
57
|
-
|
|
58
|
-
builder = new GShapeElementBuilder(GNode);
|
|
59
|
-
GBoundsAwareBuilder.position(builder, 5, 0);
|
|
60
|
-
expect(builder['proxy'].position).to.deep.equal({ x: 5, y: 0 });
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
it('should set position from point object if y is provided too', () => {
|
|
64
|
-
const builder = new GShapeElementBuilder(GNode);
|
|
65
|
-
GBoundsAwareBuilder.position(builder, { x: 17, y: 71 }, 15);
|
|
66
|
-
expect(builder['proxy'].position).to.deep.equal({ x: 17, y: 71 });
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
it('should default y to 0 if y is not provided', () => {
|
|
70
|
-
const builder = new GShapeElementBuilder(GNode);
|
|
71
|
-
GBoundsAwareBuilder.position(builder, 35);
|
|
72
|
-
expect(builder['proxy'].position).to.deep.equal({ x: 35, y: 0 });
|
|
73
|
-
});
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
describe('GBoundsAwareBuilder size function', () => {
|
|
77
|
-
it('should set size using a dimension object', () => {
|
|
78
|
-
const builder = new GShapeElementBuilder(GNode);
|
|
79
|
-
GBoundsAwareBuilder.size(builder, { width: 55, height: 15 });
|
|
80
|
-
expect(builder['proxy'].size).to.deep.equal({ width: 55, height: 15 });
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
it('should set size using width and height parameters', () => {
|
|
84
|
-
let builder = new GShapeElementBuilder(GNode);
|
|
85
|
-
GBoundsAwareBuilder.size(builder, 50, 35);
|
|
86
|
-
expect(builder['proxy'].size).to.deep.equal({ width: 50, height: 35 });
|
|
87
|
-
|
|
88
|
-
builder = new GShapeElementBuilder(GNode);
|
|
89
|
-
GBoundsAwareBuilder.size(builder, 70, 0);
|
|
90
|
-
expect(builder['proxy'].size).to.deep.equal({ width: 70, height: 0 });
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
it('should set size from dimension object if height is provided too', () => {
|
|
94
|
-
const builder = new GShapeElementBuilder(GNode);
|
|
95
|
-
GBoundsAwareBuilder.size(builder, { width: 11, height: 33 }, 15);
|
|
96
|
-
expect(builder['proxy'].size).to.deep.equal({ width: 11, height: 33 });
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
it('should default height to 0 if height is not provided', () => {
|
|
100
|
-
const builder = new GShapeElementBuilder(GNode);
|
|
101
|
-
GBoundsAwareBuilder.size(builder, 60);
|
|
102
|
-
expect(builder['proxy'].size).to.deep.equal({ width: 60, height: 0 });
|
|
103
|
-
});
|
|
104
|
-
});
|
|
105
|
-
});
|
package/src/index.spec.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2022 STMicroelectronics and others.
|
|
3
|
-
*
|
|
4
|
-
* This program and the accompanying materials are made available under the
|
|
5
|
-
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
-
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
-
*
|
|
8
|
-
* This Source Code may also be made available under the following Secondary
|
|
9
|
-
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
-
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
-
* with the GNU Classpath Exception which is available at
|
|
12
|
-
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
-
*
|
|
14
|
-
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
-
********************************************************************************/
|
|
16
|
-
|
|
17
|
-
/* note: this bogus test file is required so that
|
|
18
|
-
we are able to run mocha unit tests on this
|
|
19
|
-
package, without having any actual unit tests in it.
|
|
20
|
-
This way a coverage report will be generated,
|
|
21
|
-
showing 0% coverage, instead of no report.
|
|
22
|
-
This file can be removed once we have real unit
|
|
23
|
-
tests in place. */
|
|
24
|
-
|
|
25
|
-
describe('graph package', () => {
|
|
26
|
-
it('should support code coverage statistics', () => true);
|
|
27
|
-
});
|