@eclipse-glsp/graph 0.9.0-next.a3fa8d1.14 → 0.9.0-next.b178eb2.24
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/default-types.d.ts.map +1 -1
- package/lib/default-types.js +3 -6
- package/lib/default-types.js.map +1 -1
- package/lib/gpre-rendered-element.d.ts.map +1 -1
- package/lib/gpre-rendered-element.js +1 -1
- package/lib/gpre-rendered-element.js.map +1 -1
- package/lib/gpre-shape-prerendered-element.d.ts +43 -0
- package/lib/gpre-shape-prerendered-element.d.ts.map +1 -0
- package/lib/gpre-shape-prerendered-element.js +56 -0
- package/lib/gpre-shape-prerendered-element.js.map +1 -0
- 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/default-types.ts +3 -7
- package/src/gpre-rendered-element.ts +1 -1
- package/src/gpre-shape-prerendered-element.ts +61 -0
- package/src/index.ts +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-types.d.ts","sourceRoot":"","sources":["../src/default-types.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,wBAAwB,EAAc,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"default-types.d.ts","sourceRoot":"","sources":["../src/default-types.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,wBAAwB,EAAc,MAAM,kBAAkB,CAAC;AAMxE,wBAAgB,iBAAiB,IAAI,GAAG,CAAC,MAAM,EAAE,wBAAwB,CAAC,CAezE"}
|
package/lib/default-types.js
CHANGED
|
@@ -27,6 +27,7 @@ const gmodel_element_1 = require("./gmodel-element");
|
|
|
27
27
|
const gnode_1 = require("./gnode");
|
|
28
28
|
const gport_1 = require("./gport");
|
|
29
29
|
const gpre_rendered_element_1 = require("./gpre-rendered-element");
|
|
30
|
+
const gpre_shape_prerendered_element_1 = require("./gpre-shape-prerendered-element");
|
|
30
31
|
function getDefaultMapping() {
|
|
31
32
|
const mapping = new Map();
|
|
32
33
|
mapping.set(protocol_1.DefaultTypes.GRAPH, ggraph_1.GGraph);
|
|
@@ -35,15 +36,11 @@ function getDefaultMapping() {
|
|
|
35
36
|
mapping.set(protocol_1.DefaultTypes.PORT, gport_1.GPort);
|
|
36
37
|
mapping.set(protocol_1.DefaultTypes.LABEL, glabel_1.GLabel);
|
|
37
38
|
mapping.set(protocol_1.DefaultTypes.COMPARTMENT, gcompartment_1.GCompartment);
|
|
38
|
-
mapping.set(protocol_1.DefaultTypes.
|
|
39
|
-
// TODO: mapping.set(types.BUTTON, GButton);
|
|
40
|
-
mapping.set(protocol_1.DefaultTypes.BUTTON_EXPAND, gbutton_1.GButton);
|
|
39
|
+
mapping.set(protocol_1.DefaultTypes.BUTTON, gbutton_1.GButton);
|
|
41
40
|
mapping.set(protocol_1.DefaultTypes.ISSUE_MARKER, gissue_marker_1.GIssueMarker);
|
|
42
|
-
mapping.set(protocol_1.DefaultTypes.NODE_CIRCLE, gnode_1.GNode);
|
|
43
|
-
mapping.set(protocol_1.DefaultTypes.NODE_RECTANGLE, gnode_1.GNode);
|
|
44
|
-
mapping.set(protocol_1.DefaultTypes.NODE_DIAMOND, gnode_1.GNode);
|
|
45
41
|
mapping.set(protocol_1.DefaultTypes.HTML, gmodel_element_1.GModelRoot);
|
|
46
42
|
mapping.set(protocol_1.DefaultTypes.PRE_RENDERED, gpre_rendered_element_1.GPreRenderedElement);
|
|
43
|
+
mapping.set(protocol_1.DefaultTypes.FOREIGN_OBJECT, gpre_shape_prerendered_element_1.GShapePreRenderedElement);
|
|
47
44
|
return mapping;
|
|
48
45
|
}
|
|
49
46
|
exports.getDefaultMapping = getDefaultMapping;
|
package/lib/default-types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-types.js","sourceRoot":"","sources":["../src/default-types.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,qDAA+D;AAC/D,uCAAoC;AACpC,iDAA8C;AAC9C,mCAAgC;AAChC,qCAAkC;AAClC,mDAA+C;AAC/C,qCAAkC;AAClC,qDAAwE;AACxE,mCAAgC;AAChC,mCAAgC;AAChC,mEAA8D;
|
|
1
|
+
{"version":3,"file":"default-types.js","sourceRoot":"","sources":["../src/default-types.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,qDAA+D;AAC/D,uCAAoC;AACpC,iDAA8C;AAC9C,mCAAgC;AAChC,qCAAkC;AAClC,mDAA+C;AAC/C,qCAAkC;AAClC,qDAAwE;AACxE,mCAAgC;AAChC,mCAAgC;AAChC,mEAA8D;AAC9D,qFAA4E;AAE5E,SAAgB,iBAAiB;IAC7B,MAAM,OAAO,GAAG,IAAI,GAAG,EAAoC,CAAC;IAC5D,OAAO,CAAC,GAAG,CAAC,uBAAK,CAAC,KAAK,EAAE,eAAM,CAAC,CAAC;IACjC,OAAO,CAAC,GAAG,CAAC,uBAAK,CAAC,IAAI,EAAE,aAAK,CAAC,CAAC;IAC/B,OAAO,CAAC,GAAG,CAAC,uBAAK,CAAC,IAAI,EAAE,aAAK,CAAC,CAAC;IAC/B,OAAO,CAAC,GAAG,CAAC,uBAAK,CAAC,IAAI,EAAE,aAAK,CAAC,CAAC;IAC/B,OAAO,CAAC,GAAG,CAAC,uBAAK,CAAC,KAAK,EAAE,eAAM,CAAC,CAAC;IACjC,OAAO,CAAC,GAAG,CAAC,uBAAK,CAAC,WAAW,EAAE,2BAAY,CAAC,CAAC;IAC7C,OAAO,CAAC,GAAG,CAAC,uBAAK,CAAC,MAAM,EAAE,iBAAO,CAAC,CAAC;IACnC,OAAO,CAAC,GAAG,CAAC,uBAAK,CAAC,YAAY,EAAE,4BAAY,CAAC,CAAC;IAE9C,OAAO,CAAC,GAAG,CAAC,uBAAK,CAAC,IAAI,EAAE,2BAAU,CAAC,CAAC;IACpC,OAAO,CAAC,GAAG,CAAC,uBAAK,CAAC,YAAY,EAAE,2CAAmB,CAAC,CAAC;IACrD,OAAO,CAAC,GAAG,CAAC,uBAAK,CAAC,cAAc,EAAE,yDAAwB,CAAC,CAAC;IAC5D,OAAO,OAAO,CAAC;AACnB,CAAC;AAfD,8CAeC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gpre-rendered-element.d.ts","sourceRoot":"","sources":["../src/gpre-rendered-element.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;
|
|
1
|
+
{"version":3,"file":"gpre-rendered-element.d.ts","sourceRoot":"","sources":["../src/gpre-rendered-element.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAGlF,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAEvE;;;;;;GAMG;AACH,qBAAa,mBAAoB,SAAQ,aAAa;IAClD,MAAM,CAAC,OAAO,IAAI,0BAA0B;IAI5C,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,qBAAa,0BAA0B,CAAC,CAAC,SAAS,mBAAmB,GAAG,mBAAmB,CAAE,SAAQ,oBAAoB,CAAC,CAAC,CAAC;IACxH,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;CAI3B"}
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
********************************************************************************/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.GPreRenderedElementBuilder = exports.GPreRenderedElement = void 0;
|
|
19
|
-
const gmodel_element_1 = require("./gmodel-element");
|
|
20
19
|
const protocol_1 = require("@eclipse-glsp/protocol");
|
|
20
|
+
const gmodel_element_1 = require("./gmodel-element");
|
|
21
21
|
/**
|
|
22
22
|
* Pre-rendered elements contain HTML or SVG code to be transferred to the DOM. This can be useful to
|
|
23
23
|
* render complex figures or to compute the view on the server instead of the client code.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gpre-rendered-element.js","sourceRoot":"","sources":["../src/gpre-rendered-element.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAElF,
|
|
1
|
+
{"version":3,"file":"gpre-rendered-element.js","sourceRoot":"","sources":["../src/gpre-rendered-element.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAElF,qDAAsD;AACtD,qDAAuE;AAEvE;;;;;;GAMG;AACH,MAAa,mBAAoB,SAAQ,8BAAa;IAClD,MAAM,CAAC,OAAO;QACV,OAAO,IAAI,0BAA0B,CAAC,mBAAmB,CAAC,CAAC,IAAI,CAAC,uBAAY,CAAC,YAAY,CAAC,CAAC;IAC/F,CAAC;CAGJ;AAND,kDAMC;AAED,MAAa,0BAAgF,SAAQ,qCAAuB;IACxH,IAAI,CAAC,IAAY;QACb,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC;QACvB,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AALD,gEAKC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
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
|
+
import { Dimension, Point } from '@eclipse-glsp/protocol';
|
|
17
|
+
import { GAlignable } from './galignable';
|
|
18
|
+
import { GBoundsAware } from './gbound-aware';
|
|
19
|
+
import { GModelElementBuilder } from './gmodel-element';
|
|
20
|
+
import { GPreRenderedElement } from './gpre-rendered-element';
|
|
21
|
+
/**
|
|
22
|
+
* Pre-rendered elements contain HTML or SVG code to be transferred to the DOM. This can be useful to
|
|
23
|
+
* render complex figures or to compute the view on the server instead of the client code.
|
|
24
|
+
* Pre rendered elements are often used for the popup model that is created by a `PopupModelFactory`.
|
|
25
|
+
* A popup model is rendered when hovering over a element and for many common use cases e.g rendering a tooltip
|
|
26
|
+
* this model can be computed entirely on the server side.
|
|
27
|
+
*/
|
|
28
|
+
export declare class GShapePreRenderedElement extends GPreRenderedElement implements GBoundsAware, GAlignable {
|
|
29
|
+
static builder(): GShapePreRenderedElementBuilder;
|
|
30
|
+
[GBoundsAware]: boolean;
|
|
31
|
+
[GAlignable]: boolean;
|
|
32
|
+
position: Point;
|
|
33
|
+
size: Dimension;
|
|
34
|
+
alignment: Point;
|
|
35
|
+
}
|
|
36
|
+
export declare class GShapePreRenderedElementBuilder<G extends GShapePreRenderedElement = GShapePreRenderedElement> extends GModelElementBuilder<G> {
|
|
37
|
+
code(code: string): this;
|
|
38
|
+
position(x: number, y: number): this;
|
|
39
|
+
position(position: Point): this;
|
|
40
|
+
size(width: number, height: number): this;
|
|
41
|
+
size(size: Dimension): this;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=gpre-shape-prerendered-element.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gpre-shape-prerendered-element.d.ts","sourceRoot":"","sources":["../src/gpre-shape-prerendered-element.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAuB,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D;;;;;;GAMG;AACH,qBAAa,wBAAyB,SAAQ,mBAAoB,YAAW,YAAY,EAAE,UAAU;WACjF,OAAO,IAAI,+BAA+B;IAI1D,CAAC,YAAY,CAAC,UAAQ;IACtB,CAAC,UAAU,CAAC,UAAQ;IACpB,QAAQ,EAAE,KAAK,CAAC;IAChB,IAAI,EAAE,SAAS,CAAC;IAChB,SAAS,EAAE,KAAK,CAAC;CACpB;AAED,qBAAa,+BAA+B,CACxC,CAAC,SAAS,wBAAwB,GAAG,wBAAwB,CAC/D,SAAQ,oBAAoB,CAAC,CAAC,CAAC;IAC7B,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAKxB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI;IACpC,QAAQ,CAAC,QAAQ,EAAE,KAAK,GAAG,IAAI;IAK/B,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IACzC,IAAI,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI;CAI9B"}
|
|
@@ -0,0 +1,56 @@
|
|
|
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
|
+
var _a, _b;
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.GShapePreRenderedElementBuilder = exports.GShapePreRenderedElement = void 0;
|
|
20
|
+
const galignable_1 = require("./galignable");
|
|
21
|
+
const gbound_aware_1 = require("./gbound-aware");
|
|
22
|
+
const gmodel_element_1 = require("./gmodel-element");
|
|
23
|
+
const gpre_rendered_element_1 = require("./gpre-rendered-element");
|
|
24
|
+
/**
|
|
25
|
+
* Pre-rendered elements contain HTML or SVG code to be transferred to the DOM. This can be useful to
|
|
26
|
+
* render complex figures or to compute the view on the server instead of the client code.
|
|
27
|
+
* Pre rendered elements are often used for the popup model that is created by a `PopupModelFactory`.
|
|
28
|
+
* A popup model is rendered when hovering over a element and for many common use cases e.g rendering a tooltip
|
|
29
|
+
* this model can be computed entirely on the server side.
|
|
30
|
+
*/
|
|
31
|
+
class GShapePreRenderedElement extends gpre_rendered_element_1.GPreRenderedElement {
|
|
32
|
+
constructor() {
|
|
33
|
+
super(...arguments);
|
|
34
|
+
this[_a] = true;
|
|
35
|
+
this[_b] = true;
|
|
36
|
+
}
|
|
37
|
+
static builder() {
|
|
38
|
+
return new GShapePreRenderedElementBuilder(GShapePreRenderedElement);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
exports.GShapePreRenderedElement = GShapePreRenderedElement;
|
|
42
|
+
_a = gbound_aware_1.GBoundsAware, _b = galignable_1.GAlignable;
|
|
43
|
+
class GShapePreRenderedElementBuilder extends gmodel_element_1.GModelElementBuilder {
|
|
44
|
+
code(code) {
|
|
45
|
+
this.proxy.code = code;
|
|
46
|
+
return this;
|
|
47
|
+
}
|
|
48
|
+
position(pointOrX, y) {
|
|
49
|
+
return gbound_aware_1.GBoundsAwareBuilder.position(this, pointOrX, y);
|
|
50
|
+
}
|
|
51
|
+
size(sizeOrWidth, height) {
|
|
52
|
+
return gbound_aware_1.GBoundsAwareBuilder.size(this, sizeOrWidth, height);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
exports.GShapePreRenderedElementBuilder = GShapePreRenderedElementBuilder;
|
|
56
|
+
//# sourceMappingURL=gpre-shape-prerendered-element.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gpre-shape-prerendered-element.js","sourceRoot":"","sources":["../src/gpre-shape-prerendered-element.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;AAGlF,6CAA0C;AAC1C,iDAAmE;AACnE,qDAAwD;AACxD,mEAA8D;AAE9D;;;;;;GAMG;AACH,MAAa,wBAAyB,SAAQ,2CAAmB;IAAjE;;QAKI,QAAc,GAAG,IAAI,CAAC;QACtB,QAAY,GAAG,IAAI,CAAC;IAIxB,CAAC;IATG,MAAM,CAAU,OAAO;QACnB,OAAO,IAAI,+BAA+B,CAAC,wBAAwB,CAAC,CAAC;IACzE,CAAC;CAOJ;AAVD,4DAUC;KALI,2BAAY,OACZ,uBAAU;AAMf,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,kCAAmB,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;IAC3D,CAAC;IAID,IAAI,CAAC,WAA+B,EAAE,MAAe;QACjD,OAAO,kCAAmB,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;IAC/D,CAAC;CACJ;AAnBD,0EAmBC"}
|
package/lib/index.d.ts
CHANGED
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,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,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,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,yBAAyB,CAAC;AACxC,cAAc,kCAAkC,CAAC;AACjD,cAAc,kBAAkB,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -42,5 +42,6 @@ __exportStar(require("./gmodel-util"), exports);
|
|
|
42
42
|
__exportStar(require("./gnode"), exports);
|
|
43
43
|
__exportStar(require("./gport"), exports);
|
|
44
44
|
__exportStar(require("./gpre-rendered-element"), exports);
|
|
45
|
+
__exportStar(require("./gpre-shape-prerendered-element"), exports);
|
|
45
46
|
__exportStar(require("./gshape-element"), exports);
|
|
46
47
|
//# 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,iDAA+B;AAC/B,4CAA0B;AAC1B,iDAA+B;AAC/B,0CAAwB;AACxB,qDAAmC;AACnC,2CAAyB;AACzB,kDAAgC;AAChC,2CAAyB;AACzB,sDAAoC;AACpC,gDAA8B;AAC9B,mDAAiC;AACjC,gDAA8B;AAC9B,0CAAwB;AACxB,0CAAwB;AACxB,0DAAwC;AACxC,mDAAiC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,kDAAgC;AAChC,+CAA6B;AAC7B,iDAA+B;AAC/B,4CAA0B;AAC1B,iDAA+B;AAC/B,0CAAwB;AACxB,qDAAmC;AACnC,2CAAyB;AACzB,kDAAgC;AAChC,2CAAyB;AACzB,sDAAoC;AACpC,gDAA8B;AAC9B,mDAAiC;AACjC,gDAA8B;AAC9B,0CAAwB;AACxB,0CAAwB;AACxB,0DAAwC;AACxC,mEAAiD;AACjD,mDAAiC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eclipse-glsp/graph",
|
|
3
|
-
"version": "0.9.0-next.
|
|
3
|
+
"version": "0.9.0-next.b178eb2.24+b178eb2",
|
|
4
4
|
"description": "The typescript implementation of the GLSP graphical model (GModel)",
|
|
5
5
|
"license": "(EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0)",
|
|
6
6
|
"keywords": [
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
},
|
|
58
58
|
"main": "lib/index",
|
|
59
59
|
"types": "lib/index",
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "b178eb2cf7509fdfa3349e012b33c651340dc0bb"
|
|
61
61
|
}
|
package/src/default-types.ts
CHANGED
|
@@ -24,6 +24,7 @@ import { GModelElementConstructor, GModelRoot } from './gmodel-element';
|
|
|
24
24
|
import { GNode } from './gnode';
|
|
25
25
|
import { GPort } from './gport';
|
|
26
26
|
import { GPreRenderedElement } from './gpre-rendered-element';
|
|
27
|
+
import { GShapePreRenderedElement } from './gpre-shape-prerendered-element';
|
|
27
28
|
|
|
28
29
|
export function getDefaultMapping(): Map<string, GModelElementConstructor> {
|
|
29
30
|
const mapping = new Map<string, GModelElementConstructor>();
|
|
@@ -33,16 +34,11 @@ export function getDefaultMapping(): Map<string, GModelElementConstructor> {
|
|
|
33
34
|
mapping.set(types.PORT, GPort);
|
|
34
35
|
mapping.set(types.LABEL, GLabel);
|
|
35
36
|
mapping.set(types.COMPARTMENT, GCompartment);
|
|
36
|
-
mapping.set(types.
|
|
37
|
-
// TODO: mapping.set(types.BUTTON, GButton);
|
|
38
|
-
mapping.set(types.BUTTON_EXPAND, GButton);
|
|
37
|
+
mapping.set(types.BUTTON, GButton);
|
|
39
38
|
mapping.set(types.ISSUE_MARKER, GIssueMarker);
|
|
40
39
|
|
|
41
|
-
mapping.set(types.NODE_CIRCLE, GNode);
|
|
42
|
-
mapping.set(types.NODE_RECTANGLE, GNode);
|
|
43
|
-
mapping.set(types.NODE_DIAMOND, GNode);
|
|
44
|
-
|
|
45
40
|
mapping.set(types.HTML, GModelRoot);
|
|
46
41
|
mapping.set(types.PRE_RENDERED, GPreRenderedElement);
|
|
42
|
+
mapping.set(types.FOREIGN_OBJECT, GShapePreRenderedElement);
|
|
47
43
|
return mapping;
|
|
48
44
|
}
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
|
|
17
|
-
import { GModelElement, GModelElementBuilder } from './gmodel-element';
|
|
18
17
|
import { DefaultTypes } from '@eclipse-glsp/protocol';
|
|
18
|
+
import { GModelElement, GModelElementBuilder } from './gmodel-element';
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* Pre-rendered elements contain HTML or SVG code to be transferred to the DOM. This can be useful to
|
|
@@ -0,0 +1,61 @@
|
|
|
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
|
+
import { Dimension, Point } from '@eclipse-glsp/protocol';
|
|
18
|
+
import { GAlignable } from './galignable';
|
|
19
|
+
import { GBoundsAware, GBoundsAwareBuilder } from './gbound-aware';
|
|
20
|
+
import { GModelElementBuilder } from './gmodel-element';
|
|
21
|
+
import { GPreRenderedElement } from './gpre-rendered-element';
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Pre-rendered elements contain HTML or SVG code to be transferred to the DOM. This can be useful to
|
|
25
|
+
* render complex figures or to compute the view on the server instead of the client code.
|
|
26
|
+
* Pre rendered elements are often used for the popup model that is created by a `PopupModelFactory`.
|
|
27
|
+
* A popup model is rendered when hovering over a element and for many common use cases e.g rendering a tooltip
|
|
28
|
+
* this model can be computed entirely on the server side.
|
|
29
|
+
*/
|
|
30
|
+
export class GShapePreRenderedElement extends GPreRenderedElement implements GBoundsAware, GAlignable {
|
|
31
|
+
static override builder(): GShapePreRenderedElementBuilder {
|
|
32
|
+
return new GShapePreRenderedElementBuilder(GShapePreRenderedElement);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
[GBoundsAware] = true;
|
|
36
|
+
[GAlignable] = true;
|
|
37
|
+
position: Point;
|
|
38
|
+
size: Dimension;
|
|
39
|
+
alignment: Point;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export class GShapePreRenderedElementBuilder<
|
|
43
|
+
G extends GShapePreRenderedElement = GShapePreRenderedElement
|
|
44
|
+
> extends GModelElementBuilder<G> {
|
|
45
|
+
code(code: string): this {
|
|
46
|
+
this.proxy.code = code;
|
|
47
|
+
return this;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
position(x: number, y: number): this;
|
|
51
|
+
position(position: Point): this;
|
|
52
|
+
position(pointOrX: Point | number, y?: number): this {
|
|
53
|
+
return GBoundsAwareBuilder.position(this, pointOrX, y);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
size(width: number, height: number): this;
|
|
57
|
+
size(size: Dimension): this;
|
|
58
|
+
size(sizeOrWidth: Dimension | number, height?: number): this {
|
|
59
|
+
return GBoundsAwareBuilder.size(this, sizeOrWidth, height);
|
|
60
|
+
}
|
|
61
|
+
}
|