@eclipse-glsp/graph 2.2.0-next.91 → 2.2.0-next.93
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/gresizable.d.ts +42 -0
- package/lib/gresizable.d.ts.map +1 -0
- package/lib/gresizable.js +54 -0
- package/lib/gresizable.js.map +1 -0
- package/lib/gshape-element.d.ts +5 -1
- package/lib/gshape-element.d.ts.map +1 -1
- package/lib/gshape-element.js +7 -2
- package/lib/gshape-element.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/package.json +2 -2
- package/src/gresizable.ts +60 -0
- package/src/gshape-element.ts +8 -1
- package/src/index.ts +1 -0
|
@@ -0,0 +1,42 @@
|
|
|
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 { GModelElement, GModelElementBuilder } from './gmodel-element';
|
|
17
|
+
export declare const GResizable: unique symbol;
|
|
18
|
+
export interface GResizable {
|
|
19
|
+
resizeLocations?: GResizeLocation[];
|
|
20
|
+
[GResizable]: boolean;
|
|
21
|
+
}
|
|
22
|
+
export declare function isGResizable<G extends GModelElement>(element: G): element is G & GResizable;
|
|
23
|
+
export type GResizableBuilder<G extends GModelElement = GModelElement> = GModelElementBuilder<G & GResizable>;
|
|
24
|
+
export declare namespace GResizableBuilder {
|
|
25
|
+
function resizeLocations<B extends GResizableBuilder>(builder: B, resizeLocations?: GResizeLocation[]): B;
|
|
26
|
+
}
|
|
27
|
+
export declare enum GResizeLocation {
|
|
28
|
+
TopLeft = "top-left",
|
|
29
|
+
Top = "top",
|
|
30
|
+
TopRight = "top-right",
|
|
31
|
+
Right = "right",
|
|
32
|
+
BottomRight = "bottom-right",
|
|
33
|
+
Bottom = "bottom",
|
|
34
|
+
BottomLeft = "bottom-left",
|
|
35
|
+
Left = "left"
|
|
36
|
+
}
|
|
37
|
+
export declare namespace GResizeLocation {
|
|
38
|
+
const CORNERS: GResizeLocation[];
|
|
39
|
+
const CROSS: GResizeLocation[];
|
|
40
|
+
const ALL: GResizeLocation[];
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=gresizable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gresizable.d.ts","sourceRoot":"","sources":["../src/gresizable.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAEvE,eAAO,MAAM,UAAU,eAAuB,CAAC;AAE/C,MAAM,WAAW,UAAU;IACvB,eAAe,CAAC,EAAE,eAAe,EAAE,CAAC;IACpC,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,wBAAgB,YAAY,CAAC,CAAC,SAAS,aAAa,EAAE,OAAO,EAAE,CAAC,GAAG,OAAO,IAAI,CAAC,GAAG,UAAU,CAE3F;AAED,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,aAAa,GAAG,aAAa,IAAI,oBAAoB,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC;AAE9G,yBAAiB,iBAAiB,CAAC;IAC/B,SAAgB,eAAe,CAAC,CAAC,SAAS,iBAAiB,EAAE,OAAO,EAAE,CAAC,EAAE,eAAe,CAAC,EAAE,eAAe,EAAE,GAAG,CAAC,CAI/G;CACJ;AAED,oBAAY,eAAe;IACvB,OAAO,aAAa;IACpB,GAAG,QAAQ;IACX,QAAQ,cAAc;IACtB,KAAK,UAAU;IACf,WAAW,iBAAiB;IAC5B,MAAM,WAAW;IACjB,UAAU,gBAAgB;IAC1B,IAAI,SAAS;CAChB;AAED,yBAAiB,eAAe,CAAC;IACtB,MAAM,OAAO,EAAE,eAAe,EAKpC,CAAC;IACK,MAAM,KAAK,EAAE,eAAe,EAA+F,CAAC;IAC5H,MAAM,GAAG,EAAE,eAAe,EAA2D,CAAC;CAChG"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/********************************************************************************
|
|
3
|
+
* Copyright (c) 2024 EclipseSource 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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.GResizeLocation = exports.GResizableBuilder = exports.isGResizable = exports.GResizable = void 0;
|
|
19
|
+
exports.GResizable = Symbol('GResizable');
|
|
20
|
+
function isGResizable(element) {
|
|
21
|
+
return exports.GResizable in element && element[exports.GResizable] === true;
|
|
22
|
+
}
|
|
23
|
+
exports.isGResizable = isGResizable;
|
|
24
|
+
var GResizableBuilder;
|
|
25
|
+
(function (GResizableBuilder) {
|
|
26
|
+
function resizeLocations(builder, resizeLocations) {
|
|
27
|
+
const proxy = builder['proxy'];
|
|
28
|
+
proxy.resizeLocations = resizeLocations;
|
|
29
|
+
return builder;
|
|
30
|
+
}
|
|
31
|
+
GResizableBuilder.resizeLocations = resizeLocations;
|
|
32
|
+
})(GResizableBuilder || (exports.GResizableBuilder = GResizableBuilder = {}));
|
|
33
|
+
var GResizeLocation;
|
|
34
|
+
(function (GResizeLocation) {
|
|
35
|
+
GResizeLocation["TopLeft"] = "top-left";
|
|
36
|
+
GResizeLocation["Top"] = "top";
|
|
37
|
+
GResizeLocation["TopRight"] = "top-right";
|
|
38
|
+
GResizeLocation["Right"] = "right";
|
|
39
|
+
GResizeLocation["BottomRight"] = "bottom-right";
|
|
40
|
+
GResizeLocation["Bottom"] = "bottom";
|
|
41
|
+
GResizeLocation["BottomLeft"] = "bottom-left";
|
|
42
|
+
GResizeLocation["Left"] = "left";
|
|
43
|
+
})(GResizeLocation || (exports.GResizeLocation = GResizeLocation = {}));
|
|
44
|
+
(function (GResizeLocation) {
|
|
45
|
+
GResizeLocation.CORNERS = [
|
|
46
|
+
GResizeLocation.TopLeft,
|
|
47
|
+
GResizeLocation.TopRight,
|
|
48
|
+
GResizeLocation.BottomRight,
|
|
49
|
+
GResizeLocation.BottomLeft
|
|
50
|
+
];
|
|
51
|
+
GResizeLocation.CROSS = [GResizeLocation.Top, GResizeLocation.Right, GResizeLocation.Bottom, GResizeLocation.Left];
|
|
52
|
+
GResizeLocation.ALL = [...GResizeLocation.CORNERS, ...GResizeLocation.CROSS];
|
|
53
|
+
})(GResizeLocation || (exports.GResizeLocation = GResizeLocation = {}));
|
|
54
|
+
//# sourceMappingURL=gresizable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gresizable.js","sourceRoot":"","sources":["../src/gresizable.ts"],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 -17,12 +17,15 @@ import { Args, Dimension, JsonPrimitive, Point } from '@eclipse-glsp/protocol';
|
|
|
17
17
|
import { GBoundsAware } from './gbounds-aware';
|
|
18
18
|
import { GLayoutable } from './glayoutable';
|
|
19
19
|
import { GModelElement, GModelElementBuilder } from './gmodel-element';
|
|
20
|
-
|
|
20
|
+
import { GResizable, GResizeLocation } from './gresizable';
|
|
21
|
+
export declare abstract class GShapeElement extends GModelElement implements GBoundsAware, GLayoutable, GResizable {
|
|
21
22
|
layoutOptions?: Args;
|
|
22
23
|
position: Point;
|
|
23
24
|
size: Dimension;
|
|
25
|
+
resizeLocations?: GResizeLocation[];
|
|
24
26
|
[GBoundsAware]: boolean;
|
|
25
27
|
[GLayoutable]: boolean;
|
|
28
|
+
[GResizable]: boolean;
|
|
26
29
|
}
|
|
27
30
|
export declare class GShapeElementBuilder<G extends GShapeElement> extends GModelElementBuilder<G> {
|
|
28
31
|
position(x: number, y: number): this;
|
|
@@ -32,5 +35,6 @@ export declare class GShapeElementBuilder<G extends GShapeElement> extends GMode
|
|
|
32
35
|
addLayoutOption(key: string, value: JsonPrimitive): this;
|
|
33
36
|
addLayoutOptions(layoutOptions: Args): this;
|
|
34
37
|
addLayoutOptions(layoutOptions: Map<string, JsonPrimitive>): this;
|
|
38
|
+
resizeLocations(resizeLocations?: GResizeLocation[]): this;
|
|
35
39
|
}
|
|
36
40
|
//# sourceMappingURL=gshape-element.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gshape-element.d.ts","sourceRoot":"","sources":["../src/gshape-element.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAuB,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAAE,WAAW,EAAsB,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,aAAa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I;IAC3C,gBAAgB,CAAC,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,GAAG,IAAI;IAKjE,eAAe,CAAC,eAAe,CAAC,EAAE,eAAe,EAAE,GAAG,IAAI;CAG7D"}
|
package/lib/gshape-element.js
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var _a, _b;
|
|
2
|
+
var _a, _b, _c;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.GShapeElementBuilder = exports.GShapeElement = void 0;
|
|
5
5
|
const gbounds_aware_1 = require("./gbounds-aware");
|
|
6
6
|
const glayoutable_1 = require("./glayoutable");
|
|
7
7
|
const gmodel_element_1 = require("./gmodel-element");
|
|
8
|
+
const gresizable_1 = require("./gresizable");
|
|
8
9
|
class GShapeElement extends gmodel_element_1.GModelElement {
|
|
9
10
|
constructor() {
|
|
10
11
|
super(...arguments);
|
|
11
12
|
this[_a] = true;
|
|
12
13
|
this[_b] = true;
|
|
14
|
+
this[_c] = true;
|
|
13
15
|
}
|
|
14
16
|
}
|
|
15
17
|
exports.GShapeElement = GShapeElement;
|
|
16
|
-
_a = gbounds_aware_1.GBoundsAware, _b = glayoutable_1.GLayoutable;
|
|
18
|
+
_a = gbounds_aware_1.GBoundsAware, _b = glayoutable_1.GLayoutable, _c = gresizable_1.GResizable;
|
|
17
19
|
class GShapeElementBuilder extends gmodel_element_1.GModelElementBuilder {
|
|
18
20
|
position(pointOrX, y) {
|
|
19
21
|
return gbounds_aware_1.GBoundsAwareBuilder.position(this, pointOrX, y);
|
|
@@ -27,6 +29,9 @@ class GShapeElementBuilder extends gmodel_element_1.GModelElementBuilder {
|
|
|
27
29
|
addLayoutOptions(layoutOptions) {
|
|
28
30
|
return glayoutable_1.GLayoutableBuilder.addLayoutOptions(this, layoutOptions);
|
|
29
31
|
}
|
|
32
|
+
resizeLocations(resizeLocations) {
|
|
33
|
+
return gresizable_1.GResizableBuilder.resizeLocations(this, resizeLocations);
|
|
34
|
+
}
|
|
30
35
|
}
|
|
31
36
|
exports.GShapeElementBuilder = GShapeElementBuilder;
|
|
32
37
|
//# sourceMappingURL=gshape-element.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gshape-element.js","sourceRoot":"","sources":["../src/gshape-element.ts"],"names":[],"mappings":";;;;AAgBA,mDAAoE;AACpE,+CAAgE;AAChE,qDAAuE;
|
|
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;CAAA;AARD,sCAQC;KAHI,4BAAY,OACZ,yBAAW,OACX,uBAAU;AAGf,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"}
|
package/lib/index.d.ts
CHANGED
|
@@ -32,6 +32,7 @@ export * from './gmodel-util';
|
|
|
32
32
|
export * from './gnode';
|
|
33
33
|
export * from './gport';
|
|
34
34
|
export * from './gpre-rendered-element';
|
|
35
|
+
export * from './gresizable';
|
|
35
36
|
export * from './gshape-element';
|
|
36
37
|
export * from './gshaped-prerendered-element';
|
|
37
38
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,+BAA+B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,yBAAyB,CAAC;AACxC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,+BAA+B,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -48,6 +48,7 @@ __exportStar(require("./gmodel-util"), exports);
|
|
|
48
48
|
__exportStar(require("./gnode"), exports);
|
|
49
49
|
__exportStar(require("./gport"), exports);
|
|
50
50
|
__exportStar(require("./gpre-rendered-element"), exports);
|
|
51
|
+
__exportStar(require("./gresizable"), exports);
|
|
51
52
|
__exportStar(require("./gshape-element"), exports);
|
|
52
53
|
__exportStar(require("./gshaped-prerendered-element"), exports);
|
|
53
54
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,kDAAgC;AAChC,+CAA6B;AAC7B,kDAAgC;AAChC,4CAA0B;AAC1B,iDAA+B;AAC/B,0CAAwB;AACxB,qDAAmC;AACnC,4DAA0C;AAC1C,2CAAyB;AACzB,+CAA6B;AAC7B,kDAAgC;AAChC,2CAAyB;AACzB,gDAA8B;AAC9B,+CAA6B;AAC7B,mDAAiC;AACjC,gDAA8B;AAC9B,0CAAwB;AACxB,0CAAwB;AACxB,0DAAwC;AACxC,mDAAiC;AACjC,gEAA8C"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,kDAAgC;AAChC,+CAA6B;AAC7B,kDAAgC;AAChC,4CAA0B;AAC1B,iDAA+B;AAC/B,0CAAwB;AACxB,qDAAmC;AACnC,4DAA0C;AAC1C,2CAAyB;AACzB,+CAA6B;AAC7B,kDAAgC;AAChC,2CAAyB;AACzB,gDAA8B;AAC9B,+CAA6B;AAC7B,mDAAiC;AACjC,gDAA8B;AAC9B,0CAAwB;AACxB,0CAAwB;AACxB,0DAAwC;AACxC,+CAA6B;AAC7B,mDAAiC;AACjC,gEAA8C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eclipse-glsp/graph",
|
|
3
|
-
"version": "2.2.0-next.
|
|
3
|
+
"version": "2.2.0-next.93+f3f5d02",
|
|
4
4
|
"description": "The typescript implementation of the GLSP graphical model (GModel)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eclipse",
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"publishConfig": {
|
|
58
58
|
"access": "public"
|
|
59
59
|
},
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "f3f5d02d9ec73d6b0338ecc71b0c118f468267f6"
|
|
61
61
|
}
|
|
@@ -0,0 +1,60 @@
|
|
|
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
|
+
|
|
17
|
+
import { GModelElement, GModelElementBuilder } from './gmodel-element';
|
|
18
|
+
|
|
19
|
+
export const GResizable = Symbol('GResizable');
|
|
20
|
+
|
|
21
|
+
export interface GResizable {
|
|
22
|
+
resizeLocations?: GResizeLocation[];
|
|
23
|
+
[GResizable]: boolean;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function isGResizable<G extends GModelElement>(element: G): element is G & GResizable {
|
|
27
|
+
return GResizable in element && element[GResizable] === true;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export type GResizableBuilder<G extends GModelElement = GModelElement> = GModelElementBuilder<G & GResizable>;
|
|
31
|
+
|
|
32
|
+
export namespace GResizableBuilder {
|
|
33
|
+
export function resizeLocations<B extends GResizableBuilder>(builder: B, resizeLocations?: GResizeLocation[]): B {
|
|
34
|
+
const proxy = builder['proxy'];
|
|
35
|
+
proxy.resizeLocations = resizeLocations;
|
|
36
|
+
return builder;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export enum GResizeLocation {
|
|
41
|
+
TopLeft = 'top-left',
|
|
42
|
+
Top = 'top',
|
|
43
|
+
TopRight = 'top-right',
|
|
44
|
+
Right = 'right',
|
|
45
|
+
BottomRight = 'bottom-right',
|
|
46
|
+
Bottom = 'bottom',
|
|
47
|
+
BottomLeft = 'bottom-left',
|
|
48
|
+
Left = 'left'
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export namespace GResizeLocation {
|
|
52
|
+
export const CORNERS: GResizeLocation[] = [
|
|
53
|
+
GResizeLocation.TopLeft,
|
|
54
|
+
GResizeLocation.TopRight,
|
|
55
|
+
GResizeLocation.BottomRight,
|
|
56
|
+
GResizeLocation.BottomLeft
|
|
57
|
+
];
|
|
58
|
+
export const CROSS: GResizeLocation[] = [GResizeLocation.Top, GResizeLocation.Right, GResizeLocation.Bottom, GResizeLocation.Left];
|
|
59
|
+
export const ALL: GResizeLocation[] = [...GResizeLocation.CORNERS, ...GResizeLocation.CROSS];
|
|
60
|
+
}
|
package/src/gshape-element.ts
CHANGED
|
@@ -17,13 +17,16 @@ import { Args, Dimension, JsonPrimitive, Point } from '@eclipse-glsp/protocol';
|
|
|
17
17
|
import { GBoundsAware, GBoundsAwareBuilder } from './gbounds-aware';
|
|
18
18
|
import { GLayoutable, GLayoutableBuilder } from './glayoutable';
|
|
19
19
|
import { GModelElement, GModelElementBuilder } from './gmodel-element';
|
|
20
|
+
import { GResizable, GResizableBuilder, GResizeLocation } from './gresizable';
|
|
20
21
|
|
|
21
|
-
export abstract class GShapeElement extends GModelElement implements GBoundsAware, GLayoutable {
|
|
22
|
+
export abstract class GShapeElement extends GModelElement implements GBoundsAware, GLayoutable, GResizable {
|
|
22
23
|
layoutOptions?: Args;
|
|
23
24
|
position: Point;
|
|
24
25
|
size: Dimension;
|
|
26
|
+
resizeLocations?: GResizeLocation[];
|
|
25
27
|
[GBoundsAware] = true;
|
|
26
28
|
[GLayoutable] = true;
|
|
29
|
+
[GResizable] = true;
|
|
27
30
|
}
|
|
28
31
|
|
|
29
32
|
export class GShapeElementBuilder<G extends GShapeElement> extends GModelElementBuilder<G> {
|
|
@@ -48,4 +51,8 @@ export class GShapeElementBuilder<G extends GShapeElement> extends GModelElement
|
|
|
48
51
|
addLayoutOptions(layoutOptions: Args | Map<string, JsonPrimitive>): this {
|
|
49
52
|
return GLayoutableBuilder.addLayoutOptions(this, layoutOptions);
|
|
50
53
|
}
|
|
54
|
+
|
|
55
|
+
resizeLocations(resizeLocations?: GResizeLocation[]): this {
|
|
56
|
+
return GResizableBuilder.resizeLocations(this, resizeLocations);
|
|
57
|
+
}
|
|
51
58
|
}
|
package/src/index.ts
CHANGED