@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
package/src/utils/gmodel-util.ts
CHANGED
|
@@ -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
|
|
@@ -31,6 +31,7 @@ import {
|
|
|
31
31
|
RoutedPoint,
|
|
32
32
|
Selectable,
|
|
33
33
|
TypeGuard,
|
|
34
|
+
createFeatureSet,
|
|
34
35
|
distinctAdd,
|
|
35
36
|
getAbsoluteBounds,
|
|
36
37
|
getZoom,
|
|
@@ -250,6 +251,27 @@ export function toggleCssClass(element: GModelElement, cssClass: string, toggle:
|
|
|
250
251
|
return toggle ? addCssClasses(element, cssClass) : removeCssClasses(element, cssClass);
|
|
251
252
|
}
|
|
252
253
|
|
|
254
|
+
/**
|
|
255
|
+
* Enables the given model features on a single {@link GModelElement}.
|
|
256
|
+
*
|
|
257
|
+
* The feature set is shared by all instances of a registered element type, so the element is given
|
|
258
|
+
* a copy of it rather than having the shared one extended. A feature set that is not a `Set` cannot
|
|
259
|
+
* be enumerated and is left untouched.
|
|
260
|
+
*
|
|
261
|
+
* @param element The element for which the features should be enabled.
|
|
262
|
+
* @param features The features to enable.
|
|
263
|
+
*/
|
|
264
|
+
export function enableFeatures(element: GModelElement, features: symbol[]): void;
|
|
265
|
+
export function enableFeatures(element: GModelElement, ...features: symbol[]): void;
|
|
266
|
+
export function enableFeatures(element: GModelElement, ...features: symbol[] | [symbol[]]): void {
|
|
267
|
+
const toEnable = Array.isArray(features[0]) ? features[0] : (features as symbol[]);
|
|
268
|
+
if (element.features === undefined) {
|
|
269
|
+
element.features = createFeatureSet(toEnable);
|
|
270
|
+
} else if (element.features instanceof Set) {
|
|
271
|
+
element.features = createFeatureSet([...element.features], { enable: toEnable });
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
|
|
253
275
|
export function isNonRoutableSelectedMovableBoundsAware(element: GModelElement): element is SelectableBoundsAware {
|
|
254
276
|
return isNonRoutableSelectedBoundsAware(element) && isMoveable(element);
|
|
255
277
|
}
|