@eclipse-glsp/sprotty 2.2.0-next.340 → 2.2.0-next.342
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.
|
@@ -23,10 +23,16 @@ export declare class CircularNodeView extends SprottyCircularNodeView {
|
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
25
|
* Creates a hidden rectangle with the bounds of the given element.
|
|
26
|
+
* This is typically used to fixate the size of an element and avoid size changes that may happen during rendering.
|
|
27
|
+
* Changes can happen if the resulting bounding box (BBox) of the rendered element is different form the given bounds.
|
|
28
|
+
* The created bounding rect needs to be placed within a root SVG group (g) element to take effect.
|
|
29
|
+
*
|
|
26
30
|
* @param withBounds The element to create the hidden rectangle for.
|
|
31
|
+
* @param context The rendering context. If provided, a rect is only created if the context is 'hidden'.
|
|
27
32
|
* @returns The hidden rectangle.
|
|
28
33
|
*/
|
|
29
34
|
export declare function hiddenBoundingRect(withBounds: BoundsAware): VNode;
|
|
35
|
+
export declare function hiddenBoundingRect(withBounds: BoundsAware, context: RenderingContext): VNode | undefined;
|
|
30
36
|
/**
|
|
31
37
|
* Applies a hidden bounding rectangle to the given view if we are in the hidden rendering context where sizes are being determined.
|
|
32
38
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"svg-views-override.d.ts","sourceRoot":"","sources":["../src/svg-views-override.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAIlF,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAEH,WAAW,EACX,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,UAAU,EACV,gBAAgB,IAAI,uBAAuB,EAC3C,eAAe,IAAI,sBAAsB,EAE5C,MAAM,SAAS,CAAC;AAKjB,qBACa,eAAgB,SAAQ,sBAAsB;IAC9C,MAAM,CACX,IAAI,EAAE,QAAQ,CAAC,iBAAiB,GAAG,SAAS,GAAG,UAAU,CAA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1G;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,SAAS,KAAK,GAAG,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,CAOnI"}
|
|
@@ -49,15 +49,10 @@ exports.CircularNodeView = CircularNodeView;
|
|
|
49
49
|
exports.CircularNodeView = CircularNodeView = __decorate([
|
|
50
50
|
(0, inversify_1.injectable)()
|
|
51
51
|
], CircularNodeView);
|
|
52
|
-
|
|
53
|
-
* Creates a hidden rectangle with the bounds of the given element.
|
|
54
|
-
* @param withBounds The element to create the hidden rectangle for.
|
|
55
|
-
* @returns The hidden rectangle.
|
|
56
|
-
*/
|
|
57
|
-
function hiddenBoundingRect(withBounds) {
|
|
52
|
+
function hiddenBoundingRect(withBounds, context) {
|
|
58
53
|
// an element with attribute ATTR_BBOX_ELEMENT is used by the hidden bounds updater to determine the bounds if it is within a g-element
|
|
59
54
|
// we set the fill to transparent since the SVG export uses the hidden rendering to generate the image and we do not want to be seen
|
|
60
|
-
return JSX.createElement("rect", Object.assign({ attrs: { [sprotty_1.ATTR_BBOX_ELEMENT]: true } }, protocol_1.Bounds.dimension(withBounds.bounds), { style: { fill: 'transparent' } }));
|
|
55
|
+
return !context || context.targetKind === 'hidden' ? (JSX.createElement("rect", Object.assign({ attrs: { [sprotty_1.ATTR_BBOX_ELEMENT]: true } }, protocol_1.Bounds.dimension(withBounds.bounds), { style: { fill: 'transparent' } }))) : undefined;
|
|
61
56
|
}
|
|
62
57
|
exports.hiddenBoundingRect = hiddenBoundingRect;
|
|
63
58
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"svg-views-override.js","sourceRoot":"","sources":["../src/svg-views-override.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;AAElF,qDAAgD;AAChD,yCAAuC;AAEvC,qCAWiB;AAEjB,6DAA6D;AAC7D,MAAM,GA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,UAAU,CAAC,CAAC,CAAC;QACzD,OAAO,MAAM,CAAC;IAClB,CAAC;IACD,OAAO,IAAI,CAAC;AAChB,CAAC;AAPD,0DAOC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eclipse-glsp/sprotty",
|
|
3
|
-
"version": "2.2.0-next.
|
|
3
|
+
"version": "2.2.0-next.342+fb31fc2",
|
|
4
4
|
"description": "Augmented reexport of the sprotty API for GLSP",
|
|
5
5
|
"homepage": "https://www.eclipse.org/glsp/",
|
|
6
6
|
"bugs": "https://github.com/eclipse-glsp/glsp/issues",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"watch": "tsc -w"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@eclipse-glsp/protocol": "2.2.0-next.
|
|
36
|
+
"@eclipse-glsp/protocol": "2.2.0-next.342+fb31fc2",
|
|
37
37
|
"autocompleter": "^9.1.0",
|
|
38
38
|
"snabbdom": "^3.5.1",
|
|
39
39
|
"sprotty": "1.0.0",
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"publishConfig": {
|
|
51
51
|
"access": "public"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "fb31fc22d9b5eb7244c7c0aa4a53f55d979e8d56"
|
|
54
54
|
}
|
|
@@ -61,13 +61,22 @@ export class CircularNodeView extends SprottyCircularNodeView {
|
|
|
61
61
|
|
|
62
62
|
/**
|
|
63
63
|
* Creates a hidden rectangle with the bounds of the given element.
|
|
64
|
+
* This is typically used to fixate the size of an element and avoid size changes that may happen during rendering.
|
|
65
|
+
* Changes can happen if the resulting bounding box (BBox) of the rendered element is different form the given bounds.
|
|
66
|
+
* The created bounding rect needs to be placed within a root SVG group (g) element to take effect.
|
|
67
|
+
*
|
|
64
68
|
* @param withBounds The element to create the hidden rectangle for.
|
|
69
|
+
* @param context The rendering context. If provided, a rect is only created if the context is 'hidden'.
|
|
65
70
|
* @returns The hidden rectangle.
|
|
66
71
|
*/
|
|
67
|
-
export function hiddenBoundingRect(withBounds: BoundsAware): VNode
|
|
72
|
+
export function hiddenBoundingRect(withBounds: BoundsAware): VNode;
|
|
73
|
+
export function hiddenBoundingRect(withBounds: BoundsAware, context: RenderingContext): VNode | undefined;
|
|
74
|
+
export function hiddenBoundingRect(withBounds: BoundsAware, context?: RenderingContext): VNode | undefined {
|
|
68
75
|
// an element with attribute ATTR_BBOX_ELEMENT is used by the hidden bounds updater to determine the bounds if it is within a g-element
|
|
69
76
|
// we set the fill to transparent since the SVG export uses the hidden rendering to generate the image and we do not want to be seen
|
|
70
|
-
return
|
|
77
|
+
return !context || context.targetKind === 'hidden' ? (
|
|
78
|
+
<rect attrs={{ [ATTR_BBOX_ELEMENT]: true }} {...Bounds.dimension(withBounds.bounds)} style={{ fill: 'transparent' }} />
|
|
79
|
+
) : undefined;
|
|
71
80
|
}
|
|
72
81
|
|
|
73
82
|
/**
|