@eclipse-glsp/graph 0.9.0-next.397cddd.4

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 (94) hide show
  1. package/LICENSE +642 -0
  2. package/README.md +8 -0
  3. package/lib/default-types.d.ts +3 -0
  4. package/lib/default-types.d.ts.map +1 -0
  5. package/lib/default-types.js +50 -0
  6. package/lib/default-types.js.map +1 -0
  7. package/lib/galignable.d.ts +28 -0
  8. package/lib/galignable.d.ts.map +1 -0
  9. package/lib/galignable.js +23 -0
  10. package/lib/galignable.js.map +1 -0
  11. package/lib/gbound-aware.d.ts +30 -0
  12. package/lib/gbound-aware.d.ts.map +1 -0
  13. package/lib/gbound-aware.js +34 -0
  14. package/lib/gbound-aware.js.map +1 -0
  15. package/lib/gbutton.d.ts +11 -0
  16. package/lib/gbutton.d.ts.map +1 -0
  17. package/lib/gbutton.js +39 -0
  18. package/lib/gbutton.js.map +1 -0
  19. package/lib/gcompartment.d.ts +34 -0
  20. package/lib/gcompartment.d.ts.map +1 -0
  21. package/lib/gcompartment.js +49 -0
  22. package/lib/gcompartment.js.map +1 -0
  23. package/lib/gedge-layoutable.d.ts +34 -0
  24. package/lib/gedge-layoutable.d.ts.map +1 -0
  25. package/lib/gedge-layoutable.js +20 -0
  26. package/lib/gedge-layoutable.js.map +1 -0
  27. package/lib/gedge.d.ts +46 -0
  28. package/lib/gedge.d.ts.map +1 -0
  29. package/lib/gedge.js +88 -0
  30. package/lib/gedge.js.map +1 -0
  31. package/lib/ggraph.d.ts +38 -0
  32. package/lib/ggraph.d.ts.map +1 -0
  33. package/lib/ggraph.js +51 -0
  34. package/lib/ggraph.js.map +1 -0
  35. package/lib/gissue-marker.d.ts +17 -0
  36. package/lib/gissue-marker.d.ts.map +1 -0
  37. package/lib/gissue-marker.js +48 -0
  38. package/lib/gissue-marker.js.map +1 -0
  39. package/lib/glabel.d.ts +36 -0
  40. package/lib/glabel.d.ts.map +1 -0
  41. package/lib/glabel.js +51 -0
  42. package/lib/glabel.js.map +1 -0
  43. package/lib/glayout-container.d.ts +27 -0
  44. package/lib/glayout-container.d.ts.map +1 -0
  45. package/lib/glayout-container.js +17 -0
  46. package/lib/glayout-container.js.map +1 -0
  47. package/lib/glayoutable.d.ts +29 -0
  48. package/lib/glayoutable.d.ts.map +1 -0
  49. package/lib/glayoutable.js +39 -0
  50. package/lib/glayoutable.js.map +1 -0
  51. package/lib/gmodel-element.d.ts +97 -0
  52. package/lib/gmodel-element.d.ts.map +1 -0
  53. package/lib/gmodel-element.js +161 -0
  54. package/lib/gmodel-element.js.map +1 -0
  55. package/lib/gnode.d.ts +12 -0
  56. package/lib/gnode.d.ts.map +1 -0
  57. package/lib/gnode.js +41 -0
  58. package/lib/gnode.js.map +1 -0
  59. package/lib/gport.d.ts +21 -0
  60. package/lib/gport.d.ts.map +1 -0
  61. package/lib/gport.js +31 -0
  62. package/lib/gport.js.map +1 -0
  63. package/lib/gpre-rendered-element.d.ts +31 -0
  64. package/lib/gpre-rendered-element.d.ts.map +1 -0
  65. package/lib/gpre-rendered-element.js +41 -0
  66. package/lib/gpre-rendered-element.js.map +1 -0
  67. package/lib/gshape-element.d.ts +36 -0
  68. package/lib/gshape-element.d.ts.map +1 -0
  69. package/lib/gshape-element.js +32 -0
  70. package/lib/gshape-element.js.map +1 -0
  71. package/lib/index.d.ts +33 -0
  72. package/lib/index.d.ts.map +1 -0
  73. package/lib/index.js +45 -0
  74. package/lib/index.js.map +1 -0
  75. package/package.json +63 -0
  76. package/src/default-types.ts +48 -0
  77. package/src/galignable.ts +42 -0
  78. package/src/gbound-aware.ts +53 -0
  79. package/src/gbutton.ts +34 -0
  80. package/src/gcompartment.ts +47 -0
  81. package/src/gedge-layoutable.ts +45 -0
  82. package/src/gedge.ts +100 -0
  83. package/src/ggraph.ts +49 -0
  84. package/src/gissue-marker.ts +49 -0
  85. package/src/glabel.ts +50 -0
  86. package/src/glayout-container.ts +36 -0
  87. package/src/glayoutable.ts +57 -0
  88. package/src/gmodel-element.spec.ts +18 -0
  89. package/src/gmodel-element.ts +216 -0
  90. package/src/gnode.ts +34 -0
  91. package/src/gport.ts +26 -0
  92. package/src/gpre-rendered-element.ts +40 -0
  93. package/src/gshape-element.ts +51 -0
  94. package/src/index.ts +32 -0
package/src/gnode.ts ADDED
@@ -0,0 +1,34 @@
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 { DefaultTypes } from '@eclipse-glsp/protocol';
17
+ import { GLayoutContainer, GLayoutContainerBuilder } from './glayout-container';
18
+ import { GShapeElement, GShapeElementBuilder } from './gshape-element';
19
+
20
+ export class GNode extends GShapeElement implements GLayoutContainer {
21
+ static builder(): GNodeBuilder {
22
+ return new GNodeBuilder(GNode).type(DefaultTypes.NODE);
23
+ }
24
+
25
+ type = DefaultTypes.NODE;
26
+ layout?: string;
27
+ [GLayoutContainer] = true;
28
+ }
29
+
30
+ export class GNodeBuilder<G extends GNode = GNode> extends GShapeElementBuilder<G> {
31
+ layout(layout?: string): this {
32
+ return GLayoutContainerBuilder.layout(this, layout);
33
+ }
34
+ }
package/src/gport.ts ADDED
@@ -0,0 +1,26 @@
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 { DefaultTypes } from '@eclipse-glsp/protocol';
18
+ import { GShapeElement, GShapeElementBuilder } from './gshape-element';
19
+
20
+ export class GPort extends GShapeElement {
21
+ static builder(): GShapeElementBuilder<GPort> {
22
+ return new GShapeElementBuilder(GPort).type(DefaultTypes.PORT);
23
+ }
24
+
25
+ type = DefaultTypes.PORT;
26
+ }
@@ -0,0 +1,40 @@
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 { GModelElement, GModelElementBuilder } from './gmodel-element';
18
+ import { DefaultTypes } from '@eclipse-glsp/protocol';
19
+
20
+ /**
21
+ * Pre-rendered elements contain HTML or SVG code to be transferred to the DOM. This can be useful to
22
+ * render complex figures or to compute the view on the server instead of the client code.
23
+ * Pre rendered elements are often used for the popup model that is created by a `PopupModelFactory`.
24
+ * A popup model is rendered when hovering over a element and for many common use cases e.g rendering a tooltip
25
+ * this model can be computed entirely on the server side.
26
+ */
27
+ export class GPreRenderedElement extends GModelElement {
28
+ static builder(): GPreRenderedElementBuilder {
29
+ return new GPreRenderedElementBuilder(GPreRenderedElement).type(DefaultTypes.PRE_RENDERED);
30
+ }
31
+
32
+ code: string;
33
+ }
34
+
35
+ export class GPreRenderedElementBuilder<G extends GPreRenderedElement = GPreRenderedElement> extends GModelElementBuilder<G> {
36
+ code(code: string): this {
37
+ this.proxy.code = code;
38
+ return this;
39
+ }
40
+ }
@@ -0,0 +1,51 @@
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 { Args, Dimension, JsonPrimitive, Point } from '@eclipse-glsp/protocol';
17
+ import { GBoundsAware, GBoundsAwareBuilder } from './gbound-aware';
18
+ import { GLayoutable, GLayoutableBuilder } from './glayoutable';
19
+ import { GModelElement, GModelElementBuilder } from './gmodel-element';
20
+
21
+ export abstract class GShapeElement extends GModelElement implements GBoundsAware, GLayoutable {
22
+ layoutOptions?: Args;
23
+ position: Point;
24
+ size: Dimension;
25
+ [GBoundsAware] = true;
26
+ [GLayoutable] = true;
27
+ }
28
+
29
+ export class GShapeElementBuilder<G extends GShapeElement> extends GModelElementBuilder<G> {
30
+ position(x: number, y: number): this;
31
+ position(position: Point): this;
32
+ position(pointOrX: Point | number, y?: number): this {
33
+ return GBoundsAwareBuilder.position(this, pointOrX, y);
34
+ }
35
+
36
+ size(width: number, height: number): this;
37
+ size(size: Dimension): this;
38
+ size(sizeOrWidth: Dimension | number, height?: number): this {
39
+ return GBoundsAwareBuilder.size(this, sizeOrWidth, height);
40
+ }
41
+
42
+ addLayoutOption(key: string, value: JsonPrimitive): this {
43
+ return GLayoutableBuilder.addLayoutOption(this, key, value);
44
+ }
45
+
46
+ addLayoutOptions(layoutOptions: Args): this;
47
+ addLayoutOptions(layoutOptions: Map<string, JsonPrimitive>): this;
48
+ addLayoutOptions(layoutOptions: Args | Map<string, JsonPrimitive>): this {
49
+ return GLayoutableBuilder.addLayoutOptions(this, layoutOptions);
50
+ }
51
+ }
package/src/index.ts ADDED
@@ -0,0 +1,32 @@
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
+ export * from './default-types';
17
+ export * from './galignable';
18
+ export * from './gbound-aware';
19
+ export * from './gbutton';
20
+ export * from './gcompartment';
21
+ export * from './gedge';
22
+ export * from './gedge-layoutable';
23
+ export * from './ggraph';
24
+ export * from './gissue-marker';
25
+ export * from './glabel';
26
+ export * from './glayout-container';
27
+ export * from './glayoutable';
28
+ export * from './gpre-rendered-element';
29
+ export * from './gmodel-element';
30
+ export * from './gnode';
31
+ export * from './gport';
32
+ export * from './gshape-element';