@eclipse-glsp/client 2.8.0-next.14 → 2.8.0-next.17
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/features/bounds/glsp-hidden-bounds-updater.d.ts +31 -1
- package/lib/features/bounds/glsp-hidden-bounds-updater.d.ts.map +1 -1
- package/lib/features/bounds/glsp-hidden-bounds-updater.js +119 -58
- package/lib/features/bounds/glsp-hidden-bounds-updater.js.map +1 -1
- package/lib/features/element-template/add-template-element.d.ts +6 -1
- package/lib/features/element-template/add-template-element.d.ts.map +1 -1
- package/lib/features/element-template/add-template-element.js +14 -1
- package/lib/features/element-template/add-template-element.js.map +1 -1
- package/lib/features/tools/edge-creation/dangling-edge-feedback.d.ts +1 -1
- package/lib/features/tools/edge-creation/dangling-edge-feedback.d.ts.map +1 -1
- package/lib/features/tools/edge-creation/dangling-edge-feedback.js +3 -1
- package/lib/features/tools/edge-creation/dangling-edge-feedback.js.map +1 -1
- package/lib/features/tools/edge-edit/edge-edit-tool-feedback.d.ts +1 -1
- package/lib/features/tools/edge-edit/edge-edit-tool-feedback.d.ts.map +1 -1
- package/lib/features/tools/edge-edit/edge-edit-tool-feedback.js +4 -1
- package/lib/features/tools/edge-edit/edge-edit-tool-feedback.js.map +1 -1
- package/lib/features/tools/marquee-selection/model.d.ts +1 -1
- package/lib/features/tools/marquee-selection/model.d.ts.map +1 -1
- package/lib/features/tools/marquee-selection/model.js +3 -2
- package/lib/features/tools/marquee-selection/model.js.map +1 -1
- package/lib/features/tools/node-creation/insert-indicator.d.ts.map +1 -1
- package/lib/features/tools/node-creation/insert-indicator.js +2 -1
- package/lib/features/tools/node-creation/insert-indicator.js.map +1 -1
- package/lib/features/validation/issue-marker.d.ts +2 -2
- package/lib/features/validation/issue-marker.d.ts.map +1 -1
- package/lib/features/validation/issue-marker.js +7 -2
- package/lib/features/validation/issue-marker.js.map +1 -1
- package/lib/utils/gmodel-util.d.ts +13 -1
- package/lib/utils/gmodel-util.d.ts.map +1 -1
- package/lib/utils/gmodel-util.js +11 -1
- package/lib/utils/gmodel-util.js.map +1 -1
- package/package.json +2 -2
- package/src/features/bounds/glsp-hidden-bounds-updater.ts +133 -60
- package/src/features/element-template/add-template-element.ts +17 -2
- package/src/features/tools/edge-creation/dangling-edge-feedback.ts +4 -2
- package/src/features/tools/edge-edit/edge-edit-tool-feedback.ts +5 -3
- package/src/features/tools/marquee-selection/model.ts +3 -2
- package/src/features/tools/node-creation/insert-indicator.ts +2 -1
- package/src/features/validation/issue-marker.ts +7 -2
- package/src/utils/gmodel-util.ts +23 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"insert-indicator.js","sourceRoot":"","sources":["../../../../src/features/tools/node-creation/insert-indicator.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAElF,mDAAuI;AACvI,6DAAoE;
|
|
1
|
+
{"version":3,"file":"insert-indicator.js","sourceRoot":"","sources":["../../../../src/features/tools/node-creation/insert-indicator.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAElF,mDAAuI;AACvI,6DAAoE;AACpE,kGAAoF;AAEvE,QAAA,UAAU,GAAG,QAAQ,CAAC;AAEnC,MAAa,eAAgB,SAAQ,eAAK;aACb,qBAAgB,GAAG,CAAC,uBAAa,EAAE,qBAAW,EAAE,0BAAW,EAAE,4CAAe,CAAC,AAA7D,CAA8D;aAEhG,SAAI,GAAG,uBAAuB,AAA1B,CAA2B;IAStC,YAAY,MAAe;QACvB,KAAK,EAAE,CAAC;QARH,OAAE,GAAW,IAAA,sBAAY,GAAE,CAAC;QAC5B,SAAI,GAAW,eAAe,CAAC,IAAI,CAAC;QACpC,aAAQ,GAAgB,IAAA,0BAAgB,EAAC,eAAe,CAAC,gBAAgB,CAAC,CAAC;QAC3E,eAAU,GAAa,CAAC,kBAAkB,EAAE,cAAc,CAAC,CAAC;QAC5D,SAAI,GAAc,mBAAS,CAAC,IAAI,CAAC;QAC1C,SAAI,GAAS,EAAE,CAAC;QAIZ,IAAI,MAAM,EAAE,CAAC;YACT,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC,kBAAU,CAAC,EAAE,MAAM,EAAE,CAAC;QACzC,CAAC;IACL,CAAC;;AAjBL,0CAkBC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2019-
|
|
2
|
+
* Copyright (c) 2019-2026 EclipseSource 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
|
|
@@ -25,7 +25,7 @@ export declare class GIssueMarker extends SIssueMarkerImpl implements Projectabl
|
|
|
25
25
|
/**
|
|
26
26
|
* Retrieves the `GIssueMarker` contained by the provided model element as
|
|
27
27
|
* direct child or a newly instantiated `GIssueMarker` if no child
|
|
28
|
-
* `GIssueMarker` exists.
|
|
28
|
+
* `GIssueMarker` exists. A newly created marker is marked as client-side feedback.
|
|
29
29
|
* @param modelElement for which the `GIssueMarker` should be retrieved or created.
|
|
30
30
|
* @returns the child `GIssueMarker` or a new `GIssueMarker` if no such child exists.
|
|
31
31
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"issue-marker.d.ts","sourceRoot":"","sources":["../../../src/features/validation/issue-marker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EACH,MAAM,EAEN,MAAM,EACN,cAAc,EACd,cAAc,EACd,MAAM,EAEN,WAAW,EACX,gBAAgB,EAEnB,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"issue-marker.d.ts","sourceRoot":"","sources":["../../../src/features/validation/issue-marker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EACH,MAAM,EAEN,MAAM,EACN,cAAc,EACd,cAAc,EACd,MAAM,EAEN,WAAW,EACX,gBAAgB,EAEnB,MAAM,uBAAuB,CAAC;AAI/B,qBAAa,YAAa,SAAQ,gBAAiB,YAAW,WAAW;;IAKrE,oBAAoB,EAAE,MAAM,EAAE,CAAC;IAC/B,eAAe,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,EAAE,CAAM;IACtB,IAAI,SAAY;IAEzB,2BAA2B,IAAI,IAAI;CAItC;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,YAAY,EAAE,cAAc,GAAG,YAAY,CAiBlF;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,YAAY,EAAE,cAAc,GAAG,YAAY,GAAG,SAAS,CAUtF;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,cAAc,GAAG,MAAM,CAoB5E;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,YAAY,GAAG,cAAc,CAWhE"}
|
|
@@ -6,7 +6,7 @@ exports.getGIssueMarker = getGIssueMarker;
|
|
|
6
6
|
exports.createGIssue = createGIssue;
|
|
7
7
|
exports.getSeverity = getSeverity;
|
|
8
8
|
/********************************************************************************
|
|
9
|
-
* Copyright (c) 2019-
|
|
9
|
+
* Copyright (c) 2019-2026 EclipseSource and others.
|
|
10
10
|
*
|
|
11
11
|
* This program and the accompanying materials are made available under the
|
|
12
12
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -21,6 +21,8 @@ exports.getSeverity = getSeverity;
|
|
|
21
21
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
22
22
|
********************************************************************************/
|
|
23
23
|
const sprotty_1 = require("@eclipse-glsp/sprotty");
|
|
24
|
+
const feedback_action_dispatcher_1 = require("../../base/feedback/feedback-action-dispatcher");
|
|
25
|
+
const gmodel_util_1 = require("../../utils/gmodel-util");
|
|
24
26
|
class GIssueMarker extends sprotty_1.SIssueMarkerImpl {
|
|
25
27
|
constructor() {
|
|
26
28
|
super();
|
|
@@ -37,7 +39,7 @@ exports.GIssueMarker = GIssueMarker;
|
|
|
37
39
|
/**
|
|
38
40
|
* Retrieves the `GIssueMarker` contained by the provided model element as
|
|
39
41
|
* direct child or a newly instantiated `GIssueMarker` if no child
|
|
40
|
-
* `GIssueMarker` exists.
|
|
42
|
+
* `GIssueMarker` exists. A newly created marker is marked as client-side feedback.
|
|
41
43
|
* @param modelElement for which the `GIssueMarker` should be retrieved or created.
|
|
42
44
|
* @returns the child `GIssueMarker` or a new `GIssueMarker` if no such child exists.
|
|
43
45
|
*/
|
|
@@ -46,6 +48,9 @@ function getOrCreateGIssueMarker(modelElement) {
|
|
|
46
48
|
issueMarker = getGIssueMarker(modelElement);
|
|
47
49
|
if (issueMarker === undefined) {
|
|
48
50
|
issueMarker = new GIssueMarker();
|
|
51
|
+
// a marker created here is unknown to the server, so it is kept out of server-bound
|
|
52
|
+
// requests. markers the server sends as part of the model keep reporting their bounds
|
|
53
|
+
(0, gmodel_util_1.enableFeatures)(issueMarker, feedback_action_dispatcher_1.feedbackFeature);
|
|
49
54
|
if ((0, sprotty_1.isBoundsAware)(modelElement)) {
|
|
50
55
|
issueMarker.projectedBounds = modelElement.parentToLocal(modelElement.bounds);
|
|
51
56
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"issue-marker.js","sourceRoot":"","sources":["../../../src/features/validation/issue-marker.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"issue-marker.js","sourceRoot":"","sources":["../../../src/features/validation/issue-marker.ts"],"names":[],"mappings":";;;AAqDA,0DAiBC;AAQD,0CAUC;AAQD,oCAoBC;AAED,kCAWC;AAjID;;;;;;;;;;;;;;kFAckF;AAClF,mDAW+B;AAC/B,+FAAiF;AACjF,yDAAyD;AAEzD,MAAa,YAAa,SAAQ,0BAAgB;IAC9C;QACI,KAAK,EAAE,CAAC;QAKH,WAAM,GAAa,EAAE,CAAC;QACtB,SAAI,GAAG,QAA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AE,MAAM;KACnB,CAAC;IACF,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;QAClB,KAAK,oBAAU,CAAC,KAAK,CAAC,CAAC,CAAC;YACpB,KAAK,CAAC,QAAQ,GAAG,OAAO,CAAC;YACzB,MAAM;QACV,CAAC;QACD,KAAK,oBAAU,CAAC,IAAI,CAAC,CAAC,CAAC;YACnB,KAAK,CAAC,QAAQ,GAAG,MAAM,CAAC;YACxB,MAAM;QACV,CAAC;QACD,KAAK,oBAAU,CAAC,OAAO,CAAC,CAAC,CAAC;YACtB,KAAK,CAAC,QAAQ,GAAG,SAAS,CAAC;YAC3B,MAAM;QACV,CAAC;IACL,CAAC;IACD,OAAO,KAAK,CAAC;AACjB,CAAC;AAED,SAAgB,WAAW,CAAC,MAAoB;IAC5C,IAAI,eAAe,GAAmB,MAAM,CAAC;IAC7C,KAAK,MAAM,QAAQ,IAAI,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC;QACxD,IAAI,QAAQ,KAAK,OAAO,EAAE,CAAC;YACvB,OAAO,QAAQ,CAAC;QACpB,CAAC;QACD,IAAI,QAAQ,KAAK,SAAS,IAAI,eAAe,KAAK,MAAM,EAAE,CAAC;YACvD,eAAe,GAAG,QAAQ,CAAC;QAC/B,CAAC;IACL,CAAC;IACD,OAAO,eAAe,CAAC;AAC3B,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2019-
|
|
2
|
+
* Copyright (c) 2019-2026 EclipseSource 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
|
|
@@ -133,6 +133,18 @@ export declare function removeCssClassOfElements(elements: GModelElement[], ...c
|
|
|
133
133
|
* Toggles a css class on a {@link GModelElement} based on the given toggle flag.
|
|
134
134
|
*/
|
|
135
135
|
export declare function toggleCssClass(element: GModelElement, cssClass: string, toggle: boolean): void;
|
|
136
|
+
/**
|
|
137
|
+
* Enables the given model features on a single {@link GModelElement}.
|
|
138
|
+
*
|
|
139
|
+
* The feature set is shared by all instances of a registered element type, so the element is given
|
|
140
|
+
* a copy of it rather than having the shared one extended. A feature set that is not a `Set` cannot
|
|
141
|
+
* be enumerated and is left untouched.
|
|
142
|
+
*
|
|
143
|
+
* @param element The element for which the features should be enabled.
|
|
144
|
+
* @param features The features to enable.
|
|
145
|
+
*/
|
|
146
|
+
export declare function enableFeatures(element: GModelElement, features: symbol[]): void;
|
|
147
|
+
export declare function enableFeatures(element: GModelElement, ...features: symbol[]): void;
|
|
136
148
|
export declare function isNonRoutableSelectedMovableBoundsAware(element: GModelElement): element is SelectableBoundsAware;
|
|
137
149
|
export declare function isNonRoutableMovableBoundsAware(element: GModelElement): element is BoundsAwareModelElement;
|
|
138
150
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gmodel-util.d.ts","sourceRoot":"","sources":["../../src/utils/gmodel-util.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EACH,WAAW,EACX,kBAAkB,EAClB,gBAAgB,EAChB,uBAAuB,EACvB,cAAc,EACd,aAAa,EACb,aAAa,EACb,mBAAmB,EACnB,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,cAAc,EACd,KAAK,EACL,WAAW,EACX,UAAU,EACV,SAAS,
|
|
1
|
+
{"version":3,"file":"gmodel-util.d.ts","sourceRoot":"","sources":["../../src/utils/gmodel-util.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EACH,WAAW,EACX,kBAAkB,EAClB,gBAAgB,EAChB,uBAAuB,EACvB,cAAc,EACd,aAAa,EACb,aAAa,EACb,mBAAmB,EACnB,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,cAAc,EACd,KA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AS,EAAE,CAAC,CAAC,EAAE,aAAa,KAAK,CAAC,IAAI,aAAa,GAAG,CAAC,EACvD,IAAI,GAAE,CAAC,CAAC,EAAE,aAAa,KAAK,OAAqB,GAClD,CAAC,aAAa,GAAG,CAAC,CAAC,GAAG,SAAS,CAcjC;AAED,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,aAAa,GAAG,KAAK,CAKvG;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,uBAAuB,GAAG,OAAO,CASzE;AAED,wBAAgB,gBAAgB,CAAC,OAAO,CAAC,EAAE,aAAa,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,EAAE,aAAa,KAAK,OAAO,GAAG,MAAM,EAAE,CAUxG;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,CAAC,SAAS,aAAa,EAAE,QAAQ,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,KAAK,OAAO,CAYzH;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,aAAa,EAAE,QAAQ,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAEzG"}
|
package/lib/utils/gmodel-util.js
CHANGED
|
@@ -15,6 +15,7 @@ exports.removeCssClasses = removeCssClasses;
|
|
|
15
15
|
exports.addCssClassToElements = addCssClassToElements;
|
|
16
16
|
exports.removeCssClassOfElements = removeCssClassOfElements;
|
|
17
17
|
exports.toggleCssClass = toggleCssClass;
|
|
18
|
+
exports.enableFeatures = enableFeatures;
|
|
18
19
|
exports.isNonRoutableSelectedMovableBoundsAware = isNonRoutableSelectedMovableBoundsAware;
|
|
19
20
|
exports.isNonRoutableMovableBoundsAware = isNonRoutableMovableBoundsAware;
|
|
20
21
|
exports.isNonRoutableSelectedBoundsAware = isNonRoutableSelectedBoundsAware;
|
|
@@ -35,7 +36,7 @@ exports.getDescendantIds = getDescendantIds;
|
|
|
35
36
|
exports.isNotDescendantOfAnyElement = isNotDescendantOfAnyElement;
|
|
36
37
|
exports.removeDescendants = removeDescendants;
|
|
37
38
|
/********************************************************************************
|
|
38
|
-
* Copyright (c) 2019-
|
|
39
|
+
* Copyright (c) 2019-2026 EclipseSource and others.
|
|
39
40
|
*
|
|
40
41
|
* This program and the accompanying materials are made available under the
|
|
41
42
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -190,6 +191,15 @@ function removeCssClassOfElements(elements, ...cssClasses) {
|
|
|
190
191
|
function toggleCssClass(element, cssClass, toggle) {
|
|
191
192
|
return toggle ? addCssClasses(element, cssClass) : removeCssClasses(element, cssClass);
|
|
192
193
|
}
|
|
194
|
+
function enableFeatures(element, ...features) {
|
|
195
|
+
const toEnable = Array.isArray(features[0]) ? features[0] : features;
|
|
196
|
+
if (element.features === undefined) {
|
|
197
|
+
element.features = (0, sprotty_1.createFeatureSet)(toEnable);
|
|
198
|
+
}
|
|
199
|
+
else if (element.features instanceof Set) {
|
|
200
|
+
element.features = (0, sprotty_1.createFeatureSet)([...element.features], { enable: toEnable });
|
|
201
|
+
}
|
|
202
|
+
}
|
|
193
203
|
function isNonRoutableSelectedMovableBoundsAware(element) {
|
|
194
204
|
return isNonRoutableSelectedBoundsAware(element) && (0, sprotty_1.isMoveable)(element);
|
|
195
205
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gmodel-util.js","sourceRoot":"","sources":["../../src/utils/gmodel-util.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"gmodel-util.js","sourceRoot":"","sources":["../../src/utils/gmodel-util.ts"],"names":[],"mappings":";;;AA2DA,wBAEC;AASD,wCAMC;AASD,kDAEC;AAkBD,gCAWC;AAgBD,kCAaC;AASD,kCASC;AAOD,0DAIC;AAOD,kDAEC;AAOD,wCAEC;AASD,sCAKC;AASD,4CAMC;AAQD,sDAIC;AAOD,4DAIC;A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IAAI,CAAC,CAAC,CAAC,CAAC;IACjF,CAAC;IACD,OAAO,GAAG,CAAC;AACf,CAAC;AAED;;;;;GAKG;AACH,SAAgB,2BAA2B,CAA0B,QAA2B;IAC5F,MAAM,WAAW,GAAG,IAAI,GAAG,CAAgB,QAAQ,CAAC,CAAC;IACrD,OAAO,CAAC,OAAU,EAAW,EAAE;QAC3B,IAAI,MAAM,GAAkB,OAAO,CAAC;QACpC,OAAO,MAAM,YAAY,uBAAa,EAAE,CAAC;YACrC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;YACvB,IAAI,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;gBAC1B,OAAO,KAAK,CAAC;YACjB,CAAC;QACL,CAAC;QACD,OAAO,IAAI,CAAC;IAChB,CAAC,CAAC;AACN,CAAC;AAED;;;;GAIG;AACH,SAAgB,iBAAiB,CAA0B,QAA2B;IAClF,OAAO,QAAQ,CAAC,MAAM,CAAC,2BAA2B,CAAC,QAAQ,CAAC,CAAC,CAAC;AAClE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eclipse-glsp/client",
|
|
3
|
-
"version": "2.8.0-next.
|
|
3
|
+
"version": "2.8.0-next.17",
|
|
4
4
|
"description": "A sprotty-based client for GLSP",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eclipse",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"file-saver": "^2.0.5",
|
|
45
45
|
"snabbdom": "~3.5.1",
|
|
46
46
|
"vscode-jsonrpc": "8.2.0",
|
|
47
|
-
"@eclipse-glsp/sprotty": "2.8.0-next.
|
|
47
|
+
"@eclipse-glsp/sprotty": "2.8.0-next.17"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@types/file-saver": "^2.0.5"
|
|
@@ -25,6 +25,8 @@ import {
|
|
|
25
25
|
ElementAndRoutingPoints,
|
|
26
26
|
GChildElement,
|
|
27
27
|
GModelElement,
|
|
28
|
+
GModelRoot,
|
|
29
|
+
GRoutableElement,
|
|
28
30
|
HiddenBoundsUpdater,
|
|
29
31
|
LayoutData,
|
|
30
32
|
ModelIndexImpl,
|
|
@@ -34,6 +36,8 @@ import {
|
|
|
34
36
|
import { inject, injectable, optional } from 'inversify';
|
|
35
37
|
import { VNode } from 'snabbdom';
|
|
36
38
|
import { EditorContextService } from '../../base/editor-context-service';
|
|
39
|
+
import { feedbackFeature } from '../../base/feedback/feedback-action-dispatcher';
|
|
40
|
+
import { ServerAction } from '../../base/model/glsp-model-source';
|
|
37
41
|
import { BoundsAwareModelElement, calcElementAndRoute, getDescendantIds, isRoutable } from '../../utils/gmodel-util';
|
|
38
42
|
import { LayoutAware } from './layout-data';
|
|
39
43
|
import { LocalComputedBoundsAction, LocalRequestBoundsAction } from './local-bounds';
|
|
@@ -54,87 +58,156 @@ export class GLSPHiddenBoundsUpdater extends HiddenBoundsUpdater {
|
|
|
54
58
|
|
|
55
59
|
protected element2route: ElementAndRoutingPoints[] = [];
|
|
56
60
|
|
|
61
|
+
/**
|
|
62
|
+
* Ids of the routable elements of {@link element2route} that only exist as client-side feedback.
|
|
63
|
+
* Recorded while decorating, as the routes outlive the root they were collected from.
|
|
64
|
+
*/
|
|
65
|
+
protected feedbackRouteIds = new Set<string>();
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Root of the hidden rendering currently being collected, used to detect the start of the next
|
|
69
|
+
* one. Referenced weakly, as a hidden root is a throwaway copy of the whole model.
|
|
70
|
+
*/
|
|
71
|
+
protected collectingForRoot?: WeakRef<GModelRoot>;
|
|
72
|
+
|
|
57
73
|
protected getElement2BoundsData(): Map<BoundsAwareModelElement, BoundsDataExt> {
|
|
58
74
|
return this['element2boundsData'];
|
|
59
75
|
}
|
|
60
76
|
|
|
61
77
|
override decorate(vnode: VNode, element: GModelElement): VNode {
|
|
78
|
+
this.resetOnNewRendering(element);
|
|
62
79
|
super.decorate(vnode, element);
|
|
63
80
|
if (isRoutable(element)) {
|
|
64
|
-
this.
|
|
81
|
+
const route = this.calcElementRoute(element);
|
|
82
|
+
if (route) {
|
|
83
|
+
this.element2route.push(route);
|
|
84
|
+
if (this.isFeedbackElement(element)) {
|
|
85
|
+
this.feedbackRouteIds.add(element.id);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
65
88
|
}
|
|
66
89
|
return vnode;
|
|
67
90
|
}
|
|
68
91
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
92
|
+
/**
|
|
93
|
+
* The route reported for the given element, or `undefined` to leave it out of the
|
|
94
|
+
* {@link ComputedBoundsAction} of this rendering. Override to substitute or to skip a route,
|
|
95
|
+
* which a later rendering reports again as soon as the edge can be routed.
|
|
96
|
+
*
|
|
97
|
+
* A route of fewer than two points, which is how a router reports an edge it cannot route, is
|
|
98
|
+
* skipped: approximating it from the endpoint positions would overwrite the route on the server.
|
|
99
|
+
*/
|
|
100
|
+
protected calcElementRoute(element: GRoutableElement): ElementAndRoutingPoints | undefined {
|
|
101
|
+
const elementAndRoute = calcElementAndRoute(element, this.edgeRouterRegistry);
|
|
102
|
+
return (elementAndRoute.newRoutingPoints?.length ?? 0) < 2 ? undefined : elementAndRoute;
|
|
103
|
+
}
|
|
73
104
|
|
|
74
|
-
|
|
75
|
-
|
|
105
|
+
/**
|
|
106
|
+
* Drops the data collected for the previous hidden rendering as soon as a new one starts.
|
|
107
|
+
* {@link postUpdate} cleans up on its way out, but a failing view or vdom patch aborts the
|
|
108
|
+
* rendering before the viewer gets there, leaving the collected bounds behind.
|
|
109
|
+
*
|
|
110
|
+
* Elements are decorated bottom-up, so the rendering is recognized by the root of the element
|
|
111
|
+
* at hand rather than by the root element itself.
|
|
112
|
+
*/
|
|
113
|
+
protected resetOnNewRendering(element: GModelElement): void {
|
|
114
|
+
if (this.collectingForRoot?.deref() !== element.root) {
|
|
115
|
+
this.cleanUp();
|
|
116
|
+
this.collectingForRoot = new WeakRef(element.root);
|
|
76
117
|
}
|
|
118
|
+
}
|
|
77
119
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
// prepare data for action
|
|
83
|
-
const resizes: ElementAndBounds[] = [];
|
|
84
|
-
const alignments: ElementAndAlignment[] = [];
|
|
85
|
-
const layoutData: ElementAndLayoutData[] = [];
|
|
86
|
-
this.getElement2BoundsData().forEach((boundsData, element) => {
|
|
87
|
-
if (boundsData.boundsChanged && boundsData.bounds !== undefined) {
|
|
88
|
-
const resize: ElementAndBounds = {
|
|
89
|
-
elementId: element.id,
|
|
90
|
-
newSize: {
|
|
91
|
-
width: boundsData.bounds.width,
|
|
92
|
-
height: boundsData.bounds.height
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
// don't copy position if the element is layouted by the server
|
|
96
|
-
if (element instanceof GChildElement && isLayoutContainer(element.parent)) {
|
|
97
|
-
resize.newPosition = {
|
|
98
|
-
x: boundsData.bounds.x,
|
|
99
|
-
y: boundsData.bounds.y
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
resizes.push(resize);
|
|
120
|
+
override postUpdate(cause?: Action): void {
|
|
121
|
+
try {
|
|
122
|
+
if (cause === undefined || cause.kind !== RequestBoundsAction.KIND) {
|
|
123
|
+
return;
|
|
103
124
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
newAlignment: boundsData.alignment
|
|
108
|
-
});
|
|
125
|
+
|
|
126
|
+
if (LocalRequestBoundsAction.is(cause) && cause.elementIDs) {
|
|
127
|
+
this.focusOnElements(cause.elementIDs);
|
|
109
128
|
}
|
|
110
|
-
|
|
111
|
-
|
|
129
|
+
|
|
130
|
+
// collect bounds and layout data in element2BoundsData
|
|
131
|
+
this.getBoundsFromDOM();
|
|
132
|
+
this.layouter.layout(this.getElement2BoundsData());
|
|
133
|
+
|
|
134
|
+
// the server can only resolve elements it sent us itself
|
|
135
|
+
const skipFeedback = ServerAction.is(cause);
|
|
136
|
+
|
|
137
|
+
// prepare data for action
|
|
138
|
+
const resizes: ElementAndBounds[] = [];
|
|
139
|
+
const alignments: ElementAndAlignment[] = [];
|
|
140
|
+
const layoutData: ElementAndLayoutData[] = [];
|
|
141
|
+
this.getElement2BoundsData().forEach((boundsData, element) => {
|
|
142
|
+
if (skipFeedback && this.isFeedbackElement(element)) {
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
if (boundsData.boundsChanged && boundsData.bounds !== undefined) {
|
|
146
|
+
const resize: ElementAndBounds = {
|
|
147
|
+
elementId: element.id,
|
|
148
|
+
newSize: {
|
|
149
|
+
width: boundsData.bounds.width,
|
|
150
|
+
height: boundsData.bounds.height
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
// don't copy position if the element is layouted by the server
|
|
154
|
+
if (element instanceof GChildElement && isLayoutContainer(element.parent)) {
|
|
155
|
+
resize.newPosition = {
|
|
156
|
+
x: boundsData.bounds.x,
|
|
157
|
+
y: boundsData.bounds.y
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
resizes.push(resize);
|
|
161
|
+
}
|
|
162
|
+
if (boundsData.alignmentChanged && boundsData.alignment !== undefined) {
|
|
163
|
+
alignments.push({
|
|
164
|
+
elementId: element.id,
|
|
165
|
+
newAlignment: boundsData.alignment
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
if (LayoutAware.is(boundsData)) {
|
|
169
|
+
layoutData.push({ elementId: element.id, layoutData: boundsData.layoutData });
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
const relevantRoutes = skipFeedback
|
|
173
|
+
? this.element2route.filter(route => !this.feedbackRouteIds.has(route.elementId))
|
|
174
|
+
: this.element2route;
|
|
175
|
+
const routes = relevantRoutes.length === 0 ? undefined : relevantRoutes;
|
|
176
|
+
|
|
177
|
+
// prepare and dispatch action
|
|
178
|
+
const responseId = (cause as RequestBoundsAction).requestId;
|
|
179
|
+
const revision = this.root !== undefined ? this.root.revision : undefined;
|
|
180
|
+
const canvasBounds = this.editorContext.canvasBounds;
|
|
181
|
+
const viewport = this.editorContext.viewportData;
|
|
182
|
+
const computedBoundsAction = ComputedBoundsAction.create(resizes, {
|
|
183
|
+
revision,
|
|
184
|
+
alignments,
|
|
185
|
+
layoutData,
|
|
186
|
+
routes,
|
|
187
|
+
responseId,
|
|
188
|
+
canvasBounds,
|
|
189
|
+
viewport
|
|
190
|
+
});
|
|
191
|
+
if (LocalRequestBoundsAction.is(cause)) {
|
|
192
|
+
LocalComputedBoundsAction.mark(computedBoundsAction);
|
|
112
193
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
const responseId = (cause as RequestBoundsAction).requestId;
|
|
118
|
-
const revision = this.root !== undefined ? this.root.revision : undefined;
|
|
119
|
-
const canvasBounds = this.editorContext.canvasBounds;
|
|
120
|
-
const viewport = this.editorContext.viewportData;
|
|
121
|
-
const computedBoundsAction = ComputedBoundsAction.create(resizes, {
|
|
122
|
-
revision,
|
|
123
|
-
alignments,
|
|
124
|
-
layoutData,
|
|
125
|
-
routes,
|
|
126
|
-
responseId,
|
|
127
|
-
canvasBounds,
|
|
128
|
-
viewport
|
|
129
|
-
});
|
|
130
|
-
if (LocalRequestBoundsAction.is(cause)) {
|
|
131
|
-
LocalComputedBoundsAction.mark(computedBoundsAction);
|
|
194
|
+
this.actionDispatcher.dispatch(computedBoundsAction);
|
|
195
|
+
} finally {
|
|
196
|
+
// always reset collected data so hidden renderings with other causes (e.g. exports/failures) do not leak into the next run
|
|
197
|
+
this.cleanUp();
|
|
132
198
|
}
|
|
133
|
-
|
|
199
|
+
}
|
|
134
200
|
|
|
135
|
-
|
|
201
|
+
protected cleanUp(): void {
|
|
136
202
|
this.getElement2BoundsData().clear();
|
|
137
203
|
this.element2route = [];
|
|
204
|
+
this.feedbackRouteIds.clear();
|
|
205
|
+
this.collectingForRoot = undefined;
|
|
206
|
+
this.root = undefined;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
protected isFeedbackElement(element: GModelElement): boolean {
|
|
210
|
+
return element.hasFeature(feedbackFeature);
|
|
138
211
|
}
|
|
139
212
|
|
|
140
213
|
protected focusOnElements(elementIDs: string[]): void {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2023-
|
|
2
|
+
* Copyright (c) 2023-2026 EclipseSource 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
|
|
@@ -21,14 +21,16 @@ import {
|
|
|
21
21
|
ElementTemplate,
|
|
22
22
|
GChildElement,
|
|
23
23
|
GModelElementSchema,
|
|
24
|
+
GParentElement,
|
|
24
25
|
IActionDispatcher,
|
|
25
26
|
TYPES,
|
|
26
27
|
distinctAdd,
|
|
27
28
|
remove
|
|
28
29
|
} from '@eclipse-glsp/sprotty';
|
|
29
30
|
import { inject, injectable } from 'inversify';
|
|
31
|
+
import { feedbackFeature } from '../../base/feedback/feedback-action-dispatcher';
|
|
30
32
|
import { FeedbackCommand } from '../../base/feedback/feedback-command';
|
|
31
|
-
import { isNotUndefined } from '../../utils/gmodel-util';
|
|
33
|
+
import { enableFeatures, isNotUndefined } from '../../utils/gmodel-util';
|
|
32
34
|
import { LocalRequestBoundsAction } from '../bounds/local-bounds';
|
|
33
35
|
|
|
34
36
|
export interface AddTemplateElementsAction extends Action {
|
|
@@ -68,12 +70,25 @@ export class AddTemplateElementsFeedbackCommand extends FeedbackCommand {
|
|
|
68
70
|
.map(template => templateToSchema(template, context))
|
|
69
71
|
.filter(isNotUndefined)
|
|
70
72
|
.map(schema => context.modelFactory.createElement(schema))
|
|
73
|
+
.map(element => this.markAsFeedback(element))
|
|
71
74
|
.map(element => this.applyRootCssClasses(element, this.action.addClasses, this.action.removeClasses));
|
|
72
75
|
templateElements.forEach(templateElement => context.root.add(templateElement));
|
|
73
76
|
const templateElementIDs = templateElements.map(element => element.id);
|
|
74
77
|
return LocalRequestBoundsAction.fromCommand(context, this.actionDispatcher, this.action, templateElementIDs);
|
|
75
78
|
}
|
|
76
79
|
|
|
80
|
+
/**
|
|
81
|
+
* Marks the given template element as feedback to keep it out of the bounds reported to the
|
|
82
|
+
* server. The bounds pass tests every element on its own, so the whole subtree is marked.
|
|
83
|
+
*/
|
|
84
|
+
protected markAsFeedback(element: GChildElement): GChildElement {
|
|
85
|
+
enableFeatures(element, feedbackFeature);
|
|
86
|
+
if (element instanceof GParentElement) {
|
|
87
|
+
element.children.forEach(child => this.markAsFeedback(child));
|
|
88
|
+
}
|
|
89
|
+
return element;
|
|
90
|
+
}
|
|
91
|
+
|
|
77
92
|
protected applyRootCssClasses(element: GChildElement, addClasses?: string[], removeClasses?: string[]): GChildElement {
|
|
78
93
|
element.cssClasses = modifyCssClasses(element.cssClasses, addClasses, removeClasses);
|
|
79
94
|
return element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2019-
|
|
2
|
+
* Copyright (c) 2019-2026 EclipseSource 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
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
import { inject, injectable } from 'inversify';
|
|
35
35
|
import { feedbackFeature } from '../../../base/feedback/feedback-action-dispatcher';
|
|
36
36
|
import { FeedbackCommand } from '../../../base/feedback/feedback-command';
|
|
37
|
-
import { isRoutable } from '../../../utils/gmodel-util';
|
|
37
|
+
import { enableFeatures, isRoutable } from '../../../utils/gmodel-util';
|
|
38
38
|
import { toAbsolutePosition } from '../../../utils/viewpoint-util';
|
|
39
39
|
import { FeedbackEdgeEndView } from './view';
|
|
40
40
|
|
|
@@ -162,6 +162,8 @@ export function drawFeedbackEdge(
|
|
|
162
162
|
|
|
163
163
|
const feedbackEdge = context.modelFactory.createElement(edgeSchema);
|
|
164
164
|
if (isRoutable(feedbackEdge)) {
|
|
165
|
+
// created from the adopter's own edge type, so it needs to be marked as feedback explicitly
|
|
166
|
+
enableFeatures(feedbackEdge, feedbackFeature);
|
|
165
167
|
edgeEnd.feedbackEdge = feedbackEdge;
|
|
166
168
|
root.add(edgeEnd);
|
|
167
169
|
root.add(feedbackEdge);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2019-
|
|
2
|
+
* Copyright (c) 2019-2026 EclipseSource 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
|
|
@@ -42,10 +42,10 @@ import {
|
|
|
42
42
|
} from '@eclipse-glsp/sprotty';
|
|
43
43
|
import { inject, injectable } from 'inversify';
|
|
44
44
|
import { DragAwareMouseListener } from '../../../base/drag-aware-mouse-listener';
|
|
45
|
-
import { IFeedbackActionDispatcher } from '../../../base/feedback/feedback-action-dispatcher';
|
|
45
|
+
import { IFeedbackActionDispatcher, feedbackFeature } from '../../../base/feedback/feedback-action-dispatcher';
|
|
46
46
|
import { FeedbackCommand } from '../../../base/feedback/feedback-command';
|
|
47
47
|
import { FeedbackEmitter } from '../../../base/feedback/feedback-emitter';
|
|
48
|
-
import { forEachElement, getMatchingElements, isRoutable, isRoutingHandle } from '../../../utils/gmodel-util';
|
|
48
|
+
import { enableFeatures, forEachElement, getMatchingElements, isRoutable, isRoutingHandle } from '../../../utils/gmodel-util';
|
|
49
49
|
import { getAbsolutePosition, toAbsoluteBounds } from '../../../utils/viewpoint-util';
|
|
50
50
|
import { addReconnectHandles, removeReconnectHandles } from '../../reconnect/model';
|
|
51
51
|
import { IChangeBoundsManager } from '../change-bounds/change-bounds-manager';
|
|
@@ -375,6 +375,8 @@ export function drawFeedbackEdgeSource(context: CommandExecutionContext, targetI
|
|
|
375
375
|
|
|
376
376
|
const feedbackEdge = context.modelFactory.createElement(feedbackEdgeSchema);
|
|
377
377
|
if (isRoutable(feedbackEdge)) {
|
|
378
|
+
// created from the adopter's own edge type, so it needs to be marked as feedback explicitly
|
|
379
|
+
enableFeatures(feedbackEdge, feedbackFeature);
|
|
378
380
|
edgeEnd.feedbackEdge = feedbackEdge;
|
|
379
381
|
root.add(edgeEnd);
|
|
380
382
|
root.add(feedbackEdge);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2021-
|
|
2
|
+
* Copyright (c) 2021-2026 EclipseSource 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
|
|
@@ -14,9 +14,10 @@
|
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
import { boundsFeature, Point, RectangularNode } from '@eclipse-glsp/sprotty';
|
|
17
|
+
import { feedbackFeature } from '../../../base/feedback/feedback-action-dispatcher';
|
|
17
18
|
|
|
18
19
|
export class MarqueeNode extends RectangularNode {
|
|
19
|
-
static override readonly DEFAULT_FEATURES = [boundsFeature];
|
|
20
|
+
static override readonly DEFAULT_FEATURES = [boundsFeature, feedbackFeature];
|
|
20
21
|
startPoint: Point;
|
|
21
22
|
endPoint: Point;
|
|
22
23
|
}
|
|
@@ -16,11 +16,12 @@
|
|
|
16
16
|
|
|
17
17
|
import { Args, Dimension, FeatureSet, GNode, boundsFeature, createFeatureSet, generateUuid, moveFeature } from '@eclipse-glsp/sprotty';
|
|
18
18
|
import { ArgsAware, argsFeature } from '../../../base/args-feature';
|
|
19
|
+
import { feedbackFeature } from '../../../base/feedback/feedback-action-dispatcher';
|
|
19
20
|
|
|
20
21
|
export const ARG_LENGTH = 'length';
|
|
21
22
|
|
|
22
23
|
export class InsertIndicator extends GNode implements ArgsAware {
|
|
23
|
-
static override readonly DEFAULT_FEATURES = [boundsFeature, moveFeature, argsFeature];
|
|
24
|
+
static override readonly DEFAULT_FEATURES = [boundsFeature, moveFeature, argsFeature, feedbackFeature];
|
|
24
25
|
|
|
25
26
|
static TYPE = 'node:insert-indicator';
|
|
26
27
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2019-
|
|
2
|
+
* Copyright (c) 2019-2026 EclipseSource 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
|
|
@@ -25,6 +25,8 @@ import {
|
|
|
25
25
|
SIssueMarkerImpl,
|
|
26
26
|
isBoundsAware
|
|
27
27
|
} from '@eclipse-glsp/sprotty';
|
|
28
|
+
import { feedbackFeature } from '../../base/feedback/feedback-action-dispatcher';
|
|
29
|
+
import { enableFeatures } from '../../utils/gmodel-util';
|
|
28
30
|
|
|
29
31
|
export class GIssueMarker extends SIssueMarkerImpl implements Projectable {
|
|
30
32
|
constructor() {
|
|
@@ -45,7 +47,7 @@ export class GIssueMarker extends SIssueMarkerImpl implements Projectable {
|
|
|
45
47
|
/**
|
|
46
48
|
* Retrieves the `GIssueMarker` contained by the provided model element as
|
|
47
49
|
* direct child or a newly instantiated `GIssueMarker` if no child
|
|
48
|
-
* `GIssueMarker` exists.
|
|
50
|
+
* `GIssueMarker` exists. A newly created marker is marked as client-side feedback.
|
|
49
51
|
* @param modelElement for which the `GIssueMarker` should be retrieved or created.
|
|
50
52
|
* @returns the child `GIssueMarker` or a new `GIssueMarker` if no such child exists.
|
|
51
53
|
*/
|
|
@@ -56,6 +58,9 @@ export function getOrCreateGIssueMarker(modelElement: GParentElement): GIssueMar
|
|
|
56
58
|
|
|
57
59
|
if (issueMarker === undefined) {
|
|
58
60
|
issueMarker = new GIssueMarker();
|
|
61
|
+
// a marker created here is unknown to the server, so it is kept out of server-bound
|
|
62
|
+
// requests. markers the server sends as part of the model keep reporting their bounds
|
|
63
|
+
enableFeatures(issueMarker, feedbackFeature);
|
|
59
64
|
if (isBoundsAware(modelElement)) {
|
|
60
65
|
issueMarker.projectedBounds = modelElement.parentToLocal(modelElement.bounds);
|
|
61
66
|
}
|