@eclipse-glsp/graph 1.1.0-next.cfb461f.25 → 1.1.0-next.dc6b980.47
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 +7 -4
- package/lib/default-types.js.map +1 -1
- package/lib/galignable.d.ts +2 -2
- package/lib/galignable.d.ts.map +1 -1
- package/lib/galignable.js +1 -1
- package/lib/galignable.js.map +1 -1
- package/lib/{gbound-aware.d.ts → gbounds-aware.d.ts} +3 -3
- package/lib/gbounds-aware.d.ts.map +1 -0
- package/lib/{gbound-aware.js → gbounds-aware.js} +2 -2
- package/lib/gbounds-aware.js.map +1 -0
- package/lib/gcompartment.d.ts +3 -25
- package/lib/gcompartment.d.ts.map +1 -1
- package/lib/gcompartment.js +4 -12
- package/lib/gcompartment.js.map +1 -1
- package/lib/gedge-layoutable.d.ts +6 -6
- package/lib/gedge-layoutable.d.ts.map +1 -1
- package/lib/gedge-layoutable.js +2 -5
- package/lib/gedge-layoutable.js.map +1 -1
- package/lib/ggraph.d.ts +9 -3
- package/lib/ggraph.d.ts.map +1 -1
- package/lib/ggraph.js +13 -5
- package/lib/ggraph.js.map +1 -1
- package/lib/ghtmlroot.d.ts +14 -0
- package/lib/ghtmlroot.d.ts.map +1 -0
- package/lib/ghtmlroot.js +42 -0
- package/lib/ghtmlroot.js.map +1 -0
- package/lib/gissue-marker.d.ts +2 -1
- package/lib/gissue-marker.d.ts.map +1 -1
- package/lib/gissue-marker.js +3 -0
- package/lib/gissue-marker.js.map +1 -1
- package/lib/glabel.d.ts +3 -3
- package/lib/glabel.d.ts.map +1 -1
- package/lib/glabel.js.map +1 -1
- package/lib/glayoutable.d.ts +2 -2
- package/lib/glayoutable.d.ts.map +1 -1
- package/lib/glayoutable.js +1 -1
- package/lib/glayoutable.js.map +1 -1
- package/lib/{glayout-container.d.ts → glayouting.d.ts} +9 -9
- package/lib/glayouting.d.ts.map +1 -0
- package/lib/glayouting.js +17 -0
- package/lib/glayouting.js.map +1 -0
- package/lib/gmodel-element.d.ts +6 -5
- package/lib/gmodel-element.d.ts.map +1 -1
- package/lib/gmodel-element.js +2 -5
- package/lib/gmodel-element.js.map +1 -1
- package/lib/gmodel-util.d.ts +1 -1
- package/lib/gmodel-util.d.ts.map +1 -1
- package/lib/gnode.d.ts +7 -3
- package/lib/gnode.d.ts.map +1 -1
- package/lib/gnode.js +9 -4
- package/lib/gnode.js.map +1 -1
- package/lib/gshape-element.d.ts +1 -1
- package/lib/gshape-element.d.ts.map +1 -1
- package/lib/gshape-element.js +4 -4
- package/lib/gshape-element.js.map +1 -1
- package/lib/{gpre-shape-prerendered-element.d.ts → gshaped-prerendered-element.d.ts} +6 -6
- package/lib/gshaped-prerendered-element.d.ts.map +1 -0
- package/lib/{gpre-shape-prerendered-element.js → gshaped-prerendered-element.js} +9 -9
- package/lib/gshaped-prerendered-element.js.map +1 -0
- package/lib/index.d.ts +4 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +9 -4
- package/lib/index.js.map +1 -1
- package/package.json +22 -21
- package/src/default-types.ts +8 -4
- package/src/galignable.ts +2 -2
- package/src/{gbound-aware.ts → gbounds-aware.ts} +2 -2
- package/src/gcompartment.ts +5 -18
- package/src/gedge-layoutable.ts +5 -5
- package/src/ggraph.ts +16 -3
- package/src/ghtmlroot.ts +38 -0
- package/src/gissue-marker.ts +4 -0
- package/src/glabel.ts +3 -3
- package/src/glayoutable.ts +2 -2
- package/src/{glayout-container.ts → glayouting.ts} +9 -9
- package/src/gmodel-element.ts +3 -2
- package/src/gnode.ts +11 -4
- package/src/gshape-element.ts +1 -1
- package/src/{gpre-shape-prerendered-element.ts → gshaped-prerendered-element.ts} +6 -6
- package/src/{gmodel-element.spec.ts → index.spec.ts} +11 -2
- package/src/index.ts +4 -3
- package/lib/gbound-aware.d.ts.map +0 -1
- package/lib/gbound-aware.js.map +0 -1
- package/lib/glayout-container.d.ts.map +0 -1
- package/lib/glayout-container.js +0 -17
- package/lib/glayout-container.js.map +0 -1
- package/lib/gpre-shape-prerendered-element.d.ts.map +0 -1
- package/lib/gpre-shape-prerendered-element.js.map +0 -1
package/src/gcompartment.ts
CHANGED
|
@@ -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 {
|
|
17
|
-
import {
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
}
|
package/src/gedge-layoutable.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2022 STMicroelectronics and others.
|
|
2
|
+
* Copyright (c) 2022-2023 STMicroelectronics and others.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made available under the
|
|
5
5
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -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
|
|
20
|
+
export interface GEdgePlacement {
|
|
21
21
|
rotate: boolean;
|
|
22
22
|
side: EdgeSide;
|
|
23
23
|
position: number;
|
|
@@ -27,18 +27,18 @@ export class EdgePlacement extends Object {
|
|
|
27
27
|
export const GEdgeLayoutable = Symbol('GEdgeLayoutable');
|
|
28
28
|
|
|
29
29
|
export interface GEdgeLayoutable {
|
|
30
|
-
edgePlacement?:
|
|
30
|
+
edgePlacement?: GEdgePlacement;
|
|
31
31
|
[GEdgeLayoutable]: boolean;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
export function isGEdgeLayoutable<G extends GModelElement>(element: G): element is G & GEdgeLayoutable {
|
|
35
|
-
return
|
|
35
|
+
return GEdgeLayoutable in element && element[GEdgeLayoutable] === true;
|
|
36
36
|
}
|
|
37
37
|
|
|
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?:
|
|
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 './
|
|
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
|
}
|
package/src/ghtmlroot.ts
ADDED
|
@@ -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
|
+
}
|
package/src/gissue-marker.ts
CHANGED
|
@@ -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 {
|
|
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?:
|
|
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:
|
|
47
|
+
edgePlacement(placement: GEdgePlacement): this {
|
|
48
48
|
return GEdgeLayoutableBuilder.edgePlacement(this, placement);
|
|
49
49
|
}
|
|
50
50
|
}
|
package/src/glayoutable.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2022 STMicroelectronics and others.
|
|
2
|
+
* Copyright (c) 2022-2023 STMicroelectronics and others.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made available under the
|
|
5
5
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -24,7 +24,7 @@ export interface GLayoutable {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
export function isGLayoutable<G extends GModelElement>(element: G): element is G & GLayoutable {
|
|
27
|
-
return
|
|
27
|
+
return GLayoutable in element && element[GLayoutable] === true;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
export type GLayoutableBuilder = GModelElementBuilder<GModelElement & GLayoutable>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2022 STMicroelectronics and others.
|
|
2
|
+
* Copyright (c) 2022-2023 STMicroelectronics and others.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made available under the
|
|
5
5
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -15,21 +15,21 @@
|
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
import { GModelElement, GModelElementBuilder } from './gmodel-element';
|
|
17
17
|
|
|
18
|
-
export const
|
|
18
|
+
export const GLayouting = Symbol('GLayouting');
|
|
19
19
|
|
|
20
|
-
export interface
|
|
20
|
+
export interface GLayouting {
|
|
21
21
|
layout?: string;
|
|
22
|
-
[
|
|
22
|
+
[GLayouting]: boolean;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
export function
|
|
26
|
-
return
|
|
25
|
+
export function isGLayouting<G extends GModelElement>(element: G): element is G & GLayouting {
|
|
26
|
+
return GLayouting in element && element[GLayouting] === true;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
export type
|
|
29
|
+
export type GLayoutingBuilder = GModelElementBuilder<GModelElement & GLayouting>;
|
|
30
30
|
|
|
31
|
-
export namespace
|
|
32
|
-
export function layout<B extends
|
|
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
|
}
|
package/src/gmodel-element.ts
CHANGED
|
@@ -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
|
-
/**
|
|
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
|
|
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 {
|
|
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
|
|
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
|
-
[
|
|
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
|
|
39
|
+
return GLayoutingBuilder.layout(this, layout);
|
|
33
40
|
}
|
|
34
41
|
}
|
package/src/gshape-element.ts
CHANGED
|
@@ -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 './
|
|
17
|
+
import { GBoundsAware, GBoundsAwareBuilder } from './gbounds-aware';
|
|
18
18
|
import { GLayoutable, GLayoutableBuilder } from './glayoutable';
|
|
19
19
|
import { GModelElement, GModelElementBuilder } from './gmodel-element';
|
|
20
20
|
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
import { Dimension, Point } from '@eclipse-glsp/protocol';
|
|
18
18
|
import { GAlignable } from './galignable';
|
|
19
|
-
import { GBoundsAware, GBoundsAwareBuilder } from './
|
|
19
|
+
import { GBoundsAware, GBoundsAwareBuilder } from './gbounds-aware';
|
|
20
20
|
import { GModelElementBuilder } from './gmodel-element';
|
|
21
21
|
import { GPreRenderedElement } from './gpre-rendered-element';
|
|
22
22
|
|
|
@@ -27,20 +27,20 @@ import { GPreRenderedElement } from './gpre-rendered-element';
|
|
|
27
27
|
* A popup model is rendered when hovering over a element and for many common use cases e.g rendering a tooltip
|
|
28
28
|
* this model can be computed entirely on the server side.
|
|
29
29
|
*/
|
|
30
|
-
export class
|
|
30
|
+
export class GShapedPreRenderedElement extends GPreRenderedElement implements GBoundsAware, GAlignable {
|
|
31
31
|
static override builder(): GShapePreRenderedElementBuilder {
|
|
32
|
-
return new GShapePreRenderedElementBuilder(
|
|
32
|
+
return new GShapePreRenderedElementBuilder(GShapedPreRenderedElement);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
[GBoundsAware] = true;
|
|
36
|
-
[GAlignable] = true;
|
|
37
35
|
position: Point;
|
|
38
36
|
size: Dimension;
|
|
39
37
|
alignment: Point;
|
|
38
|
+
[GBoundsAware] = true;
|
|
39
|
+
[GAlignable] = true;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
export class GShapePreRenderedElementBuilder<
|
|
43
|
-
G extends
|
|
43
|
+
G extends GShapedPreRenderedElement = GShapedPreRenderedElement
|
|
44
44
|
> extends GModelElementBuilder<G> {
|
|
45
45
|
code(code: string): this {
|
|
46
46
|
this.proxy.code = code;
|
|
@@ -13,6 +13,15 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
|
|
17
|
+
/* note: this bogus test file is required so that
|
|
18
|
+
we are able to run mocha unit tests on this
|
|
19
|
+
package, without having any actual unit tests in it.
|
|
20
|
+
This way a coverage report will be generated,
|
|
21
|
+
showing 0% coverage, instead of no report.
|
|
22
|
+
This file can be removed once we have real unit
|
|
23
|
+
tests in place. */
|
|
24
|
+
|
|
25
|
+
describe('graph package', () => {
|
|
26
|
+
it('should support code coverage statistics', () => true);
|
|
18
27
|
});
|
package/src/index.ts
CHANGED
|
@@ -15,20 +15,21 @@
|
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
export * from './default-types';
|
|
17
17
|
export * from './galignable';
|
|
18
|
-
export * from './
|
|
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';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gbound-aware.d.ts","sourceRoot":"","sources":["../src/gbound-aware.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;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,SAAS,aAAa,EAAE,OAAO,EAAE,CAAC,GAAG,OAAO,IAAI,CAAC,GAAG,gBAAgB,CAEvG;AAED,oBAAY,uBAAuB,GAAG,oBAAoB,CAAC,aAAa,GAAG,gBAAgB,CAAC,CAAC;AAE7F,yBAAiB,uBAAuB,CAAC;IACrC,SAAgB,MAAM,CAAC,CAAC,SAAS,uBAAuB,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,CAAC,CAG3F;CACJ"}
|
package/lib/glayout-container.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GLayoutContainerBuilder = exports.isGLayoutContainer = exports.GLayoutContainer = void 0;
|
|
4
|
-
exports.GLayoutContainer = Symbol('GLayoutContainer');
|
|
5
|
-
function isGLayoutContainer(element) {
|
|
6
|
-
return (element[exports.GLayoutContainer] = true);
|
|
7
|
-
}
|
|
8
|
-
exports.isGLayoutContainer = isGLayoutContainer;
|
|
9
|
-
var GLayoutContainerBuilder;
|
|
10
|
-
(function (GLayoutContainerBuilder) {
|
|
11
|
-
function layout(builder, newLayout) {
|
|
12
|
-
builder['proxy'].layout = newLayout;
|
|
13
|
-
return builder;
|
|
14
|
-
}
|
|
15
|
-
GLayoutContainerBuilder.layout = layout;
|
|
16
|
-
})(GLayoutContainerBuilder = exports.GLayoutContainerBuilder || (exports.GLayoutContainerBuilder = {}));
|
|
17
|
-
//# sourceMappingURL=glayout-container.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"glayout-container.js","sourceRoot":"","sources":["../src/glayout-container.ts"],"names":[],"mappings":";;;AAiBa,QAAA,gBAAgB,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAC;AAO3D,SAAgB,kBAAkB,CAA0B,OAAU;IAClE,OAAO,CAAE,OAAe,CAAC,wBAAgB,CAAC,GAAG,IAAI,CAAC,CAAC;A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