@eclipse-glsp/graph 1.0.0 → 1.1.0-RC02

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.
Files changed (76) hide show
  1. package/lib/default-types.d.ts.map +1 -1
  2. package/lib/default-types.js +7 -4
  3. package/lib/default-types.js.map +1 -1
  4. package/lib/{gbound-aware.d.ts → gbounds-aware.d.ts} +1 -1
  5. package/lib/gbounds-aware.d.ts.map +1 -0
  6. package/lib/{gbound-aware.js → gbounds-aware.js} +1 -1
  7. package/lib/gbounds-aware.js.map +1 -0
  8. package/lib/gcompartment.d.ts +3 -25
  9. package/lib/gcompartment.d.ts.map +1 -1
  10. package/lib/gcompartment.js +4 -12
  11. package/lib/gcompartment.js.map +1 -1
  12. package/lib/gedge-layoutable.d.ts +3 -3
  13. package/lib/gedge-layoutable.d.ts.map +1 -1
  14. package/lib/gedge-layoutable.js +1 -4
  15. package/lib/gedge-layoutable.js.map +1 -1
  16. package/lib/ggraph.d.ts +9 -3
  17. package/lib/ggraph.d.ts.map +1 -1
  18. package/lib/ggraph.js +13 -5
  19. package/lib/ggraph.js.map +1 -1
  20. package/lib/ghtmlroot.d.ts +14 -0
  21. package/lib/ghtmlroot.d.ts.map +1 -0
  22. package/lib/ghtmlroot.js +42 -0
  23. package/lib/ghtmlroot.js.map +1 -0
  24. package/lib/gissue-marker.d.ts +1 -0
  25. package/lib/gissue-marker.d.ts.map +1 -1
  26. package/lib/gissue-marker.js +3 -0
  27. package/lib/gissue-marker.js.map +1 -1
  28. package/lib/glabel.d.ts +3 -3
  29. package/lib/glabel.d.ts.map +1 -1
  30. package/lib/glabel.js.map +1 -1
  31. package/lib/{glayout-container.d.ts → glayouting.d.ts} +8 -8
  32. package/lib/glayouting.d.ts.map +1 -0
  33. package/lib/glayouting.js +17 -0
  34. package/lib/glayouting.js.map +1 -0
  35. package/lib/gmodel-element.d.ts +3 -2
  36. package/lib/gmodel-element.d.ts.map +1 -1
  37. package/lib/gmodel-element.js +2 -5
  38. package/lib/gmodel-element.js.map +1 -1
  39. package/lib/gnode.d.ts +7 -3
  40. package/lib/gnode.d.ts.map +1 -1
  41. package/lib/gnode.js +9 -4
  42. package/lib/gnode.js.map +1 -1
  43. package/lib/gshape-element.d.ts +1 -1
  44. package/lib/gshape-element.d.ts.map +1 -1
  45. package/lib/gshape-element.js +4 -4
  46. package/lib/gshape-element.js.map +1 -1
  47. package/lib/{gpre-shape-prerendered-element.d.ts → gshaped-prerendered-element.d.ts} +6 -6
  48. package/lib/gshaped-prerendered-element.d.ts.map +1 -0
  49. package/lib/{gpre-shape-prerendered-element.js → gshaped-prerendered-element.js} +9 -9
  50. package/lib/gshaped-prerendered-element.js.map +1 -0
  51. package/lib/index.d.ts +4 -3
  52. package/lib/index.d.ts.map +1 -1
  53. package/lib/index.js +4 -3
  54. package/lib/index.js.map +1 -1
  55. package/package.json +7 -6
  56. package/src/default-types.ts +8 -4
  57. package/src/{gbound-aware.ts → gbounds-aware.ts} +0 -0
  58. package/src/gcompartment.ts +5 -18
  59. package/src/gedge-layoutable.ts +3 -3
  60. package/src/ggraph.ts +16 -3
  61. package/src/ghtmlroot.ts +38 -0
  62. package/src/gissue-marker.ts +4 -0
  63. package/src/glabel.ts +3 -3
  64. package/src/{glayout-container.ts → glayouting.ts} +8 -8
  65. package/src/gmodel-element.ts +3 -2
  66. package/src/gnode.ts +11 -4
  67. package/src/gshape-element.ts +1 -1
  68. package/src/{gpre-shape-prerendered-element.ts → gshaped-prerendered-element.ts} +6 -6
  69. package/src/index.ts +4 -3
  70. package/lib/gbound-aware.d.ts.map +0 -1
  71. package/lib/gbound-aware.js.map +0 -1
  72. package/lib/glayout-container.d.ts.map +0 -1
  73. package/lib/glayout-container.js +0 -17
  74. package/lib/glayout-container.js.map +0 -1
  75. package/lib/gpre-shape-prerendered-element.d.ts.map +0 -1
  76. package/lib/gpre-shape-prerendered-element.js.map +0 -1
package/lib/gnode.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- var _a;
2
+ var _a, _b;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.GNodeBuilder = exports.GNode = void 0;
5
5
  /********************************************************************************
@@ -18,23 +18,28 @@ exports.GNodeBuilder = exports.GNode = void 0;
18
18
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
19
19
  ********************************************************************************/
20
20
  const protocol_1 = require("@eclipse-glsp/protocol");
21
- const glayout_container_1 = require("./glayout-container");
21
+ const gedge_layoutable_1 = require("./gedge-layoutable");
22
+ const glayouting_1 = require("./glayouting");
22
23
  const gshape_element_1 = require("./gshape-element");
23
24
  class GNode extends gshape_element_1.GShapeElement {
24
25
  constructor() {
25
26
  super(...arguments);
26
27
  this.type = protocol_1.DefaultTypes.NODE;
27
28
  this[_a] = true;
29
+ this[_b] = true;
28
30
  }
29
31
  static builder() {
30
32
  return new GNodeBuilder(GNode).type(protocol_1.DefaultTypes.NODE);
31
33
  }
32
34
  }
33
35
  exports.GNode = GNode;
34
- _a = glayout_container_1.GLayoutContainer;
36
+ _a = gedge_layoutable_1.GEdgeLayoutable, _b = glayouting_1.GLayouting;
35
37
  class GNodeBuilder extends gshape_element_1.GShapeElementBuilder {
38
+ edgePlacement(placement) {
39
+ return gedge_layoutable_1.GEdgeLayoutableBuilder.edgePlacement(this, placement);
40
+ }
36
41
  layout(layout) {
37
- return glayout_container_1.GLayoutContainerBuilder.layout(this, layout);
42
+ return glayouting_1.GLayoutingBuilder.layout(this, layout);
38
43
  }
39
44
  }
40
45
  exports.GNodeBuilder = GNodeBuilder;
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,2DAAgF;AAChF,qDAAuE;AAEvE,MAAa,KAAM,SAAQ,8BAAa;IAAxC;;QAKa,SAAI,GAAG,uB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
  ********************************************************************************/
16
16
  import { Args, Dimension, JsonPrimitive, Point } from '@eclipse-glsp/protocol';
17
- import { GBoundsAware } from './gbound-aware';
17
+ import { GBoundsAware } from './gbounds-aware';
18
18
  import { GLayoutable } from './glayoutable';
19
19
  import { GModelElement, GModelElementBuilder } from './gmodel-element';
20
20
  export declare abstract class GShapeElement extends GModelElement implements GBoundsAware, GLayoutable {
@@ -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,gBAAgB,CAAC;AACnE,OAAO,EAAE,WAAW,EAAsB,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAEvE,8BAAsB,aAAc,SAAQ,aAAc,YAAW,YAAY,EAAE,WAAW;IAC1F,aAAa,CAAC,EAAE,IAAI,CAAC;IACrB,QAAQ,EAAE,KAAK,CAAC;IAChB,IAAI,EAAE,SAAS,CAAC;IAChB,CAAC,YAAY,CAAC,UAAQ;IACtB,CAAC,WAAW,CAAC,UAAQ;CACxB;AAED,qBAAa,oBAAoB,CAAC,CAAC,SAAS,aAAa,CAAE,SAAQ,oBAAoB,CAAC,CAAC,CAAC;IACtF,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;IAK3B,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,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,CAAC,MAAM,EAAE,aAAa,CAAC,GAAG,IAAI;CAIpE"}
@@ -2,7 +2,7 @@
2
2
  var _a, _b;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.GShapeElementBuilder = exports.GShapeElement = void 0;
5
- const gbound_aware_1 = require("./gbound-aware");
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
8
  class GShapeElement extends gmodel_element_1.GModelElement {
@@ -13,13 +13,13 @@ class GShapeElement extends gmodel_element_1.GModelElement {
13
13
  }
14
14
  }
15
15
  exports.GShapeElement = GShapeElement;
16
- _a = gbound_aware_1.GBoundsAware, _b = glayoutable_1.GLayoutable;
16
+ _a = gbounds_aware_1.GBoundsAware, _b = glayoutable_1.GLayoutable;
17
17
  class GShapeElementBuilder extends gmodel_element_1.GModelElementBuilder {
18
18
  position(pointOrX, y) {
19
- return gbound_aware_1.GBoundsAwareBuilder.position(this, pointOrX, y);
19
+ return gbounds_aware_1.GBoundsAwareBuilder.position(this, pointOrX, y);
20
20
  }
21
21
  size(sizeOrWidth, height) {
22
- return gbound_aware_1.GBoundsAwareBuilder.size(this, sizeOrWidth, height);
22
+ return gbounds_aware_1.GBoundsAwareBuilder.size(this, sizeOrWidth, height);
23
23
  }
24
24
  addLayoutOption(key, value) {
25
25
  return glayoutable_1.GLayoutableBuilder.addLayoutOption(this, key, value);
@@ -1 +1 @@
1
- {"version":3,"file":"gshape-element.js","sourceRoot":"","sources":["../src/gshape-element.ts"],"names":[],"mappings":";;;;AAgBA,iDAAmE;AACnE,+CAAgE;AAChE,qDAAuE;AAEvE,MAAsB,aAAc,SAAQ,8BAAa;IAAzD;;QAII,QAAc,GAAG,IAAI,CAAC;QACtB,QAAa,GAAG,IAAI,CAAC;IACzB,CAAC;CAAA;AAND,sCAMC;KAFI,2BAAY,OACZ,yBAAW;AAGhB,MAAa,oBAA8C,SAAQ,qCAAuB;IA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,CAAC;IAID,gBAAgB,CAAC,aAAgD;QAC7D,OAAO,gCAAkB,CAAC,gBAAgB,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;IACpE,CAAC;CACJ;AAtBD,oDAsBC"}
@@ -15,7 +15,7 @@
15
15
  ********************************************************************************/
16
16
  import { Dimension, Point } from '@eclipse-glsp/protocol';
17
17
  import { GAlignable } from './galignable';
18
- import { GBoundsAware } from './gbound-aware';
18
+ import { GBoundsAware } from './gbounds-aware';
19
19
  import { GModelElementBuilder } from './gmodel-element';
20
20
  import { GPreRenderedElement } from './gpre-rendered-element';
21
21
  /**
@@ -25,19 +25,19 @@ import { GPreRenderedElement } from './gpre-rendered-element';
25
25
  * A popup model is rendered when hovering over a element and for many common use cases e.g rendering a tooltip
26
26
  * this model can be computed entirely on the server side.
27
27
  */
28
- export declare class GShapePreRenderedElement extends GPreRenderedElement implements GBoundsAware, GAlignable {
28
+ export declare class GShapedPreRenderedElement extends GPreRenderedElement implements GBoundsAware, GAlignable {
29
29
  static builder(): GShapePreRenderedElementBuilder;
30
- [GBoundsAware]: boolean;
31
- [GAlignable]: boolean;
32
30
  position: Point;
33
31
  size: Dimension;
34
32
  alignment: Point;
33
+ [GBoundsAware]: boolean;
34
+ [GAlignable]: boolean;
35
35
  }
36
- export declare class GShapePreRenderedElementBuilder<G extends GShapePreRenderedElement = GShapePreRenderedElement> extends GModelElementBuilder<G> {
36
+ export declare class GShapePreRenderedElementBuilder<G extends GShapedPreRenderedElement = GShapedPreRenderedElement> extends GModelElementBuilder<G> {
37
37
  code(code: string): this;
38
38
  position(x: number, y: number): this;
39
39
  position(position: Point): this;
40
40
  size(width: number, height: number): this;
41
41
  size(size: Dimension): this;
42
42
  }
43
- //# sourceMappingURL=gpre-shape-prerendered-element.d.ts.map
43
+ //# sourceMappingURL=gshaped-prerendered-element.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gshaped-prerendered-element.d.ts","sourceRoot":"","sources":["../src/gshaped-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,iBAAiB,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D;;;;;;GAMG;AACH,qBAAa,yBAA0B,SAAQ,mBAAoB,YAAW,YAAY,EAAE,UAAU;WAClF,OAAO,IAAI,+BAA+B;IAI1D,QAAQ,EAAE,KAAK,CAAC;IAChB,IAAI,EAAE,SAAS,CAAC;IAChB,SAAS,EAAE,KAAK,CAAC;IACjB,CAAC,YAAY,CAAC,UAAQ;IACtB,CAAC,UAAU,CAAC,UAAQ;CACvB;AAED,qBAAa,+BAA+B,CACxC,CAAC,SAAS,yBAAyB,GAAG,yBAAyB,CACjE,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"}
@@ -16,9 +16,9 @@
16
16
  ********************************************************************************/
17
17
  var _a, _b;
18
18
  Object.defineProperty(exports, "__esModule", { value: true });
19
- exports.GShapePreRenderedElementBuilder = exports.GShapePreRenderedElement = void 0;
19
+ exports.GShapePreRenderedElementBuilder = exports.GShapedPreRenderedElement = void 0;
20
20
  const galignable_1 = require("./galignable");
21
- const gbound_aware_1 = require("./gbound-aware");
21
+ const gbounds_aware_1 = require("./gbounds-aware");
22
22
  const gmodel_element_1 = require("./gmodel-element");
23
23
  const gpre_rendered_element_1 = require("./gpre-rendered-element");
24
24
  /**
@@ -28,29 +28,29 @@ const gpre_rendered_element_1 = require("./gpre-rendered-element");
28
28
  * A popup model is rendered when hovering over a element and for many common use cases e.g rendering a tooltip
29
29
  * this model can be computed entirely on the server side.
30
30
  */
31
- class GShapePreRenderedElement extends gpre_rendered_element_1.GPreRenderedElement {
31
+ class GShapedPreRenderedElement extends gpre_rendered_element_1.GPreRenderedElement {
32
32
  constructor() {
33
33
  super(...arguments);
34
34
  this[_a] = true;
35
35
  this[_b] = true;
36
36
  }
37
37
  static builder() {
38
- return new GShapePreRenderedElementBuilder(GShapePreRenderedElement);
38
+ return new GShapePreRenderedElementBuilder(GShapedPreRenderedElement);
39
39
  }
40
40
  }
41
- exports.GShapePreRenderedElement = GShapePreRenderedElement;
42
- _a = gbound_aware_1.GBoundsAware, _b = galignable_1.GAlignable;
41
+ 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;
46
46
  return this;
47
47
  }
48
48
  position(pointOrX, y) {
49
- return gbound_aware_1.GBoundsAwareBuilder.position(this, pointOrX, y);
49
+ return gbounds_aware_1.GBoundsAwareBuilder.position(this, pointOrX, y);
50
50
  }
51
51
  size(sizeOrWidth, height) {
52
- return gbound_aware_1.GBoundsAwareBuilder.size(this, sizeOrWidth, height);
52
+ return gbounds_aware_1.GBoundsAwareBuilder.size(this, sizeOrWidth, height);
53
53
  }
54
54
  }
55
55
  exports.GShapePreRenderedElementBuilder = GShapePreRenderedElementBuilder;
56
- //# sourceMappingURL=gpre-shape-prerendered-element.js.map
56
+ //# sourceMappingURL=gshaped-prerendered-element.js.map
@@ -0,0 +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;IATG,MAAM,CAAU,OAAO;QACnB,OAAO,IAAI,+BAA+B,CAAC,yBAAyB,CAAC,CAAC;IAC1E,CAAC;CAOJ;AAVD,8DAUC;KAFI,4BAAY,OACZ,uBAAU;AAGf,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/lib/index.d.ts CHANGED
@@ -15,21 +15,22 @@
15
15
  ********************************************************************************/
16
16
  export * from './default-types';
17
17
  export * from './galignable';
18
- export * from './gbound-aware';
18
+ export * from './gbounds-aware';
19
19
  export * from './gbutton';
20
20
  export * from './gcompartment';
21
21
  export * from './gedge';
22
22
  export * from './gedge-layoutable';
23
23
  export * from './ggraph';
24
+ export * from './ghtmlroot';
24
25
  export * from './gissue-marker';
25
26
  export * from './glabel';
26
- export * from './glayout-container';
27
27
  export * from './glayoutable';
28
+ export * from './glayouting';
28
29
  export * from './gmodel-element';
29
30
  export * from './gmodel-util';
30
31
  export * from './gnode';
31
32
  export * from './gport';
32
33
  export * from './gpre-rendered-element';
33
- export * from './gpre-shape-prerendered-element';
34
34
  export * from './gshape-element';
35
+ export * from './gshaped-prerendered-element';
35
36
  //# sourceMappingURL=index.d.ts.map
@@ -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,kCAAkC,CAAC;AACjD,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,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,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"}
package/lib/index.js CHANGED
@@ -27,21 +27,22 @@ Object.defineProperty(exports, "__esModule", { value: true });
27
27
  ********************************************************************************/
28
28
  __exportStar(require("./default-types"), exports);
29
29
  __exportStar(require("./galignable"), exports);
30
- __exportStar(require("./gbound-aware"), exports);
30
+ __exportStar(require("./gbounds-aware"), exports);
31
31
  __exportStar(require("./gbutton"), exports);
32
32
  __exportStar(require("./gcompartment"), exports);
33
33
  __exportStar(require("./gedge"), exports);
34
34
  __exportStar(require("./gedge-layoutable"), exports);
35
35
  __exportStar(require("./ggraph"), exports);
36
+ __exportStar(require("./ghtmlroot"), exports);
36
37
  __exportStar(require("./gissue-marker"), exports);
37
38
  __exportStar(require("./glabel"), exports);
38
- __exportStar(require("./glayout-container"), exports);
39
39
  __exportStar(require("./glayoutable"), exports);
40
+ __exportStar(require("./glayouting"), exports);
40
41
  __exportStar(require("./gmodel-element"), exports);
41
42
  __exportStar(require("./gmodel-util"), exports);
42
43
  __exportStar(require("./gnode"), exports);
43
44
  __exportStar(require("./gport"), exports);
44
45
  __exportStar(require("./gpre-rendered-element"), exports);
45
- __exportStar(require("./gpre-shape-prerendered-element"), exports);
46
46
  __exportStar(require("./gshape-element"), exports);
47
+ __exportStar(require("./gshaped-prerendered-element"), exports);
47
48
  //# 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,mEAAiD;AACjD,mDAAiC"}
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,2CAAyB;AACzB,8CAA4B;AAC5B,kDAAgC;AAChC,2CAAyB;AACzB,gDAA8B;AAC9B,+CAA6B;AAC7B,mDAAiC;AACjC,gDAA8B;AAC9B,0CAAwB;AACxB,0CAAwB;AACxB,0DAAwC;AACxC,mDAAiC;AACjC,gEAA8C"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eclipse-glsp/graph",
3
- "version": "1.0.0",
3
+ "version": "1.1.0-RC02",
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": [
@@ -38,18 +38,19 @@
38
38
  "css"
39
39
  ],
40
40
  "dependencies": {
41
- "@eclipse-glsp/protocol": "1.0.0"
41
+ "@eclipse-glsp/protocol": "1.1.0-RC02"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@types/uuid": "8.3.1"
45
45
  },
46
46
  "scripts": {
47
+ "prepare": "yarn clean && yarn build && yarn lint",
47
48
  "clean": "rimraf tsconfig.tsbuildinfo lib",
48
- "build": "yarn run clean && tsc",
49
+ "build": "tsc",
49
50
  "test": "mocha --config ../../.mocharc.json \"./src/**/*.spec.?(ts|tsx)\"",
50
51
  "test:ci": "export JUNIT_REPORT_PATH=./report.xml && yarn test --reporter mocha-jenkins-reporter",
51
- "lint": "eslint -c ../../.eslintrc.js --ext .ts,.tsx ./src",
52
- "lint:fix": "eslint --fix -c ../../.eslintrc.js --ext .ts,.tsx ./src",
52
+ "lint": "eslint --ext .ts,.tsx ./src",
53
+ "lint:fix": "eslint --fix --ext .ts,.tsx ./src",
53
54
  "watch": "tsc -w"
54
55
  },
55
56
  "publishConfig": {
@@ -57,5 +58,5 @@
57
58
  },
58
59
  "main": "lib/index",
59
60
  "types": "lib/index",
60
- "gitHead": "cfb461fdc599bb4de5b7936b4bb502083d5ba3b0"
61
+ "gitHead": "f52c5f2339efb410872f353df0cc910868ddbdec"
61
62
  }
@@ -18,15 +18,19 @@ import { GButton } from './gbutton';
18
18
  import { GCompartment } from './gcompartment';
19
19
  import { GEdge } from './gedge';
20
20
  import { GGraph } from './ggraph';
21
+ import { GHtmlRoot } from './ghtmlroot';
21
22
  import { GIssueMarker } from './gissue-marker';
22
23
  import { GLabel } from './glabel';
23
- import { GModelElementConstructor, GModelRoot } from './gmodel-element';
24
+ import { GModelElementConstructor } from './gmodel-element';
24
25
  import { GNode } from './gnode';
25
26
  import { GPort } from './gport';
26
27
  import { GPreRenderedElement } from './gpre-rendered-element';
27
- import { GShapePreRenderedElement } from './gpre-shape-prerendered-element';
28
+ import { GShapedPreRenderedElement } from './gshaped-prerendered-element';
28
29
 
29
30
  export function getDefaultMapping(): Map<string, GModelElementConstructor> {
31
+ // The GModelSerializer (packages/server-node/src/features/model/gmodel-serializer.ts)
32
+ // has a built-in subtype handling.
33
+ // If the mapping for a subtype, e.g. for comp:header, is not found it will use the mapping for comp instead.
30
34
  const mapping = new Map<string, GModelElementConstructor>();
31
35
  mapping.set(types.GRAPH, GGraph);
32
36
  mapping.set(types.NODE, GNode);
@@ -37,8 +41,8 @@ export function getDefaultMapping(): Map<string, GModelElementConstructor> {
37
41
  mapping.set(types.BUTTON, GButton);
38
42
  mapping.set(types.ISSUE_MARKER, GIssueMarker);
39
43
 
40
- mapping.set(types.HTML, GModelRoot);
44
+ mapping.set(types.HTML, GHtmlRoot);
41
45
  mapping.set(types.PRE_RENDERED, GPreRenderedElement);
42
- mapping.set(types.FOREIGN_OBJECT, GShapePreRenderedElement);
46
+ mapping.set(types.FOREIGN_OBJECT, GShapedPreRenderedElement);
43
47
  return mapping;
44
48
  }
File without changes
@@ -13,35 +13,22 @@
13
13
  *
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
- import { Args, DefaultTypes, JsonPrimitive } from '@eclipse-glsp/protocol';
17
- import { GLayoutContainer, GLayoutContainerBuilder } from './glayout-container';
18
- import { GLayoutable, GLayoutableBuilder } from './glayoutable';
16
+ import { DefaultTypes } from '@eclipse-glsp/protocol';
17
+ import { GLayouting, GLayoutingBuilder } from './glayouting';
19
18
  import { GShapeElement, GShapeElementBuilder } from './gshape-element';
20
19
 
21
- export class GCompartment extends GShapeElement implements GLayoutContainer, GLayoutable {
20
+ export class GCompartment extends GShapeElement implements GLayouting {
22
21
  static builder(): GCompartmentBuilder {
23
22
  return new GCompartmentBuilder(GCompartment).type(DefaultTypes.COMPARTMENT);
24
23
  }
25
24
 
26
25
  override type = DefaultTypes.COMPARTMENT;
27
26
  layout?: string;
28
- override layoutOptions?: Args;
29
- [GLayoutContainer] = true;
30
- [GLayoutable] = true;
27
+ [GLayouting] = true;
31
28
  }
32
29
 
33
30
  export class GCompartmentBuilder<G extends GCompartment = GCompartment> extends GShapeElementBuilder<G> {
34
31
  layout(layout?: string): this {
35
- return GLayoutContainerBuilder.layout(this, layout);
36
- }
37
-
38
- override addLayoutOption(key: string, value: JsonPrimitive): this {
39
- return GLayoutableBuilder.addLayoutOption(this, key, value);
40
- }
41
-
42
- override addLayoutOptions(layoutOptions: Args): this;
43
- override addLayoutOptions(layoutOptions: Map<string, JsonPrimitive>): this;
44
- override addLayoutOptions(layoutOptions: Args | Map<string, JsonPrimitive>): this {
45
- return GLayoutableBuilder.addLayoutOptions(this, layoutOptions);
32
+ return GLayoutingBuilder.layout(this, layout);
46
33
  }
47
34
  }
@@ -17,7 +17,7 @@ import { GModelElement, GModelElementBuilder } from './gmodel-element';
17
17
 
18
18
  export type EdgeSide = 'left' | 'right' | 'top' | 'bottom' | 'on';
19
19
 
20
- export class EdgePlacement extends Object {
20
+ export interface GEdgePlacement {
21
21
  rotate: boolean;
22
22
  side: EdgeSide;
23
23
  position: number;
@@ -27,7 +27,7 @@ export class EdgePlacement extends Object {
27
27
  export const GEdgeLayoutable = Symbol('GEdgeLayoutable');
28
28
 
29
29
  export interface GEdgeLayoutable {
30
- edgePlacement?: EdgePlacement;
30
+ edgePlacement?: GEdgePlacement;
31
31
  [GEdgeLayoutable]: boolean;
32
32
  }
33
33
 
@@ -38,7 +38,7 @@ export function isGEdgeLayoutable<G extends GModelElement>(element: G): element
38
38
  export type GEdgeLayoutableBuilder<G extends GModelElement = GModelElement> = GModelElementBuilder<G & GEdgeLayoutable>;
39
39
 
40
40
  export namespace GEdgeLayoutableBuilder {
41
- export function edgePlacement<B extends GEdgeLayoutableBuilder>(builder: B, placement?: EdgePlacement): B {
41
+ export function edgePlacement<B extends GEdgeLayoutableBuilder>(builder: B, placement?: GEdgePlacement): B {
42
42
  builder['proxy'].edgePlacement = placement;
43
43
  return builder;
44
44
  }
package/src/ggraph.ts CHANGED
@@ -19,11 +19,12 @@
19
19
  * Parts of the implementation is derived from Sprotty's SModel API
20
20
  * (https://github.com/eclipse/sprotty/blob/master/packages/sprotty/src/base/model/smodel.ts)
21
21
  */
22
- import { DefaultTypes as types, Dimension, Point } from '@eclipse-glsp/protocol';
23
- import { GBoundsAware, GBoundsAwareBuilder } from './gbound-aware';
22
+ import { Args, DefaultTypes as types, Dimension, JsonPrimitive, Point } from '@eclipse-glsp/protocol';
23
+ import { GBoundsAware, GBoundsAwareBuilder } from './gbounds-aware';
24
+ import { GLayoutable, GLayoutableBuilder } from './glayoutable';
24
25
  import { GModelRoot, GModelRootBuilder } from './gmodel-element';
25
26
 
26
- export class GGraph extends GModelRoot implements GBoundsAware {
27
+ export class GGraph extends GModelRoot implements GBoundsAware, GLayoutable {
27
28
  static override builder(): GGraphBuilder {
28
29
  return new GGraphBuilder(GGraph);
29
30
  }
@@ -31,7 +32,9 @@ export class GGraph extends GModelRoot implements GBoundsAware {
31
32
  override type = types.GRAPH;
32
33
  position: Point = Point.ORIGIN;
33
34
  size?: Dimension;
35
+ layoutOptions?: Args;
34
36
  [GBoundsAware] = true;
37
+ [GLayoutable] = true;
35
38
  }
36
39
 
37
40
  export class GGraphBuilder<G extends GGraph = GGraph> extends GModelRootBuilder<G> {
@@ -46,4 +49,14 @@ export class GGraphBuilder<G extends GGraph = GGraph> extends GModelRootBuilder<
46
49
  size(sizeOrWidth: Dimension | number, height?: number): this {
47
50
  return GBoundsAwareBuilder.size(this, sizeOrWidth, height);
48
51
  }
52
+
53
+ addLayoutOption(key: string, value: JsonPrimitive): this {
54
+ return GLayoutableBuilder.addLayoutOption(this, key, value);
55
+ }
56
+
57
+ addLayoutOptions(layoutOptions: Args): this;
58
+ addLayoutOptions(layoutOptions: Map<string, JsonPrimitive>): this;
59
+ addLayoutOptions(layoutOptions: Args | Map<string, JsonPrimitive>): this {
60
+ return GLayoutableBuilder.addLayoutOptions(this, layoutOptions);
61
+ }
49
62
  }
@@ -0,0 +1,38 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2022 StMicroelectronics.
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 as types, flatPush, MaybeArray } from '@eclipse-glsp/protocol';
17
+ import { GModelRoot, GModelRootBuilder } from './gmodel-element';
18
+
19
+ /**
20
+ * Root model element class for HTML content. Usually this is rendered with a `div` DOM element.
21
+ */
22
+ export class GHtmlRoot extends GModelRoot {
23
+ static override builder(): GHtmlRootBuilder {
24
+ return new GHtmlRootBuilder(GHtmlRoot);
25
+ }
26
+
27
+ override type = types.HTML;
28
+ classes: string[] = [];
29
+ }
30
+
31
+ export class GHtmlRootBuilder<G extends GHtmlRoot = GHtmlRoot> extends GModelRootBuilder<G> {
32
+ addClasses(classes: string[]): this;
33
+ addClasses(...classes: string[]): this;
34
+ addClasses(...classes: MaybeArray<string>[]): this {
35
+ flatPush(this.proxy.classes, classes);
36
+ return this;
37
+ }
38
+ }
@@ -24,6 +24,10 @@ export class GIssue {
24
24
  }
25
25
 
26
26
  export class GIssueMarker extends GShapeElement {
27
+ static builder(): GIssueMarkerBuilder {
28
+ return new GIssueMarkerBuilder(GIssueMarker).type(DefaultTypes.ISSUE_MARKER);
29
+ }
30
+
27
31
  override type = DefaultTypes.ISSUE_MARKER;
28
32
  issues: GIssue[] = [];
29
33
  }
package/src/glabel.ts CHANGED
@@ -15,7 +15,7 @@
15
15
  ********************************************************************************/
16
16
  import { DefaultTypes, Point } from '@eclipse-glsp/protocol';
17
17
  import { GAlignable, GAlignableBuilder } from './galignable';
18
- import { EdgePlacement, GEdgeLayoutable, GEdgeLayoutableBuilder } from './gedge-layoutable';
18
+ import { GEdgeLayoutable, GEdgeLayoutableBuilder, GEdgePlacement } from './gedge-layoutable';
19
19
  import { GModelElementConstructor } from './gmodel-element';
20
20
  import { GShapeElement, GShapeElementBuilder } from './gshape-element';
21
21
 
@@ -27,7 +27,7 @@ export class GLabel extends GShapeElement implements GAlignable, GEdgeLayoutable
27
27
  override type = DefaultTypes.LABEL;
28
28
  text: string;
29
29
  alignment: Point = Point.ORIGIN;
30
- edgePlacement?: EdgePlacement;
30
+ edgePlacement?: GEdgePlacement;
31
31
  [GAlignable] = true;
32
32
  [GEdgeLayoutable] = true;
33
33
  }
@@ -44,7 +44,7 @@ export class GLabelBuilder<G extends GLabel = GLabel> extends GShapeElementBuild
44
44
  return this;
45
45
  }
46
46
 
47
- edgePlacement(placement: EdgePlacement): this {
47
+ edgePlacement(placement: GEdgePlacement): this {
48
48
  return GEdgeLayoutableBuilder.edgePlacement(this, placement);
49
49
  }
50
50
  }
@@ -15,21 +15,21 @@
15
15
  ********************************************************************************/
16
16
  import { GModelElement, GModelElementBuilder } from './gmodel-element';
17
17
 
18
- export const GLayoutContainer = Symbol('GLayoutContainer');
18
+ export const GLayouting = Symbol('GLayouting');
19
19
 
20
- export interface GLayoutContainer {
20
+ export interface GLayouting {
21
21
  layout?: string;
22
- [GLayoutContainer]: boolean;
22
+ [GLayouting]: boolean;
23
23
  }
24
24
 
25
- export function isGLayoutContainer<G extends GModelElement>(element: G): element is G & GLayoutContainer {
26
- return ((element as any)[GLayoutContainer] = true);
25
+ export function isGLayouting<G extends GModelElement>(element: G): element is G & GLayouting {
26
+ return ((element as any)[GLayouting] = true);
27
27
  }
28
28
 
29
- export type GLayoutContainerBuilder = GModelElementBuilder<GModelElement & GLayoutContainer>;
29
+ export type GLayoutingBuilder = GModelElementBuilder<GModelElement & GLayouting>;
30
30
 
31
- export namespace GLayoutContainerBuilder {
32
- export function layout<B extends GLayoutContainerBuilder>(builder: B, newLayout?: string): B {
31
+ export namespace GLayoutingBuilder {
32
+ export function layout<B extends GLayoutingBuilder>(builder: B, newLayout?: string): B {
33
33
  builder['proxy'].layout = newLayout;
34
34
  return builder;
35
35
  }
@@ -63,7 +63,8 @@ export abstract class GModelElement implements GModelElementSchema {
63
63
  * A set of css classes that should be applied to the DOM element that corresponds to this element.
64
64
  */
65
65
  cssClasses: string[] = [];
66
- /** A `GModelElement can have an arbitrary amount of children. This parent-child relation ship is also reflected in
66
+ /**
67
+ * A `GModelElement can have an arbitrary amount of children. This parent-child relation ship is also reflected in
67
68
  * the corresponding DOM element i.e. DOM elements that reflect children of this element are also children
68
69
  * of the DOM element that reflects this element.
69
70
  */
@@ -194,7 +195,7 @@ export class GModelRoot extends GModelElement implements SModelRootSchema {
194
195
  }
195
196
 
196
197
  canvasBounds?: Bounds;
197
- revision = 0;
198
+ revision?: number;
198
199
  }
199
200
 
200
201
  export class GModelRootBuilder<G extends GModelRoot = GModelRoot> extends GModelElementBuilder<G> {
package/src/gnode.ts CHANGED
@@ -14,21 +14,28 @@
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
16
  import { DefaultTypes } from '@eclipse-glsp/protocol';
17
- import { GLayoutContainer, GLayoutContainerBuilder } from './glayout-container';
17
+ import { GEdgeLayoutable, GEdgeLayoutableBuilder, GEdgePlacement } from './gedge-layoutable';
18
+ import { GLayouting, GLayoutingBuilder } from './glayouting';
18
19
  import { GShapeElement, GShapeElementBuilder } from './gshape-element';
19
20
 
20
- export class GNode extends GShapeElement implements GLayoutContainer {
21
+ export class GNode extends GShapeElement implements GEdgeLayoutable, GLayouting {
21
22
  static builder(): GNodeBuilder {
22
23
  return new GNodeBuilder(GNode).type(DefaultTypes.NODE);
23
24
  }
24
25
 
25
26
  override type = DefaultTypes.NODE;
27
+ edgePlacement?: GEdgePlacement;
26
28
  layout?: string;
27
- [GLayoutContainer] = true;
29
+ [GEdgeLayoutable] = true;
30
+ [GLayouting] = true;
28
31
  }
29
32
 
30
33
  export class GNodeBuilder<G extends GNode = GNode> extends GShapeElementBuilder<G> {
34
+ edgePlacement(placement: GEdgePlacement): this {
35
+ return GEdgeLayoutableBuilder.edgePlacement(this, placement);
36
+ }
37
+
31
38
  layout(layout?: string): this {
32
- return GLayoutContainerBuilder.layout(this, layout);
39
+ return GLayoutingBuilder.layout(this, layout);
33
40
  }
34
41
  }
@@ -14,7 +14,7 @@
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
16
  import { Args, Dimension, JsonPrimitive, Point } from '@eclipse-glsp/protocol';
17
- import { GBoundsAware, GBoundsAwareBuilder } from './gbound-aware';
17
+ import { GBoundsAware, GBoundsAwareBuilder } from './gbounds-aware';
18
18
  import { GLayoutable, GLayoutableBuilder } from './glayoutable';
19
19
  import { GModelElement, GModelElementBuilder } from './gmodel-element';
20
20