@eclipse-glsp/client 2.7.0-next.1 → 2.7.0-next.12
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/base/action-dispatcher.d.ts.map +1 -1
- package/lib/base/action-dispatcher.js +9 -3
- package/lib/base/action-dispatcher.js.map +1 -1
- package/lib/base/auto-complete/auto-complete-widget.d.ts +1 -1
- package/lib/base/auto-complete/auto-complete-widget.js +3 -5
- package/lib/base/auto-complete/auto-complete-widget.js.map +1 -1
- package/lib/base/auto-complete/validation-decorator.d.ts +1 -1
- package/lib/base/auto-complete/validation-decorator.d.ts.map +1 -1
- package/lib/base/auto-complete/validation-decorator.js +1 -4
- package/lib/base/auto-complete/validation-decorator.js.map +1 -1
- package/lib/base/default.module.d.ts +1 -1
- package/lib/base/default.module.d.ts.map +1 -1
- package/lib/base/default.module.js +4 -2
- package/lib/base/default.module.js.map +1 -1
- package/lib/base/editor-context-service.d.ts +4 -3
- package/lib/base/editor-context-service.d.ts.map +1 -1
- package/lib/base/editor-context-service.js +11 -1
- package/lib/base/editor-context-service.js.map +1 -1
- package/lib/base/feedback/feedback-action-dispatcher.d.ts +1 -1
- package/lib/base/feedback/feedback-action-dispatcher.js +2 -4
- package/lib/base/feedback/feedback-action-dispatcher.js.map +1 -1
- package/lib/base/feedback/feedback-command.d.ts +1 -1
- package/lib/base/feedback/feedback-command.js +2 -2
- package/lib/base/feedback/feedback-command.js.map +1 -1
- package/lib/base/focus/focus-tracker.d.ts +1 -1
- package/lib/base/focus/focus-tracker.js +1 -1
- package/lib/base/model/glsp-model-source.d.ts +5 -2
- package/lib/base/model/glsp-model-source.d.ts.map +1 -1
- package/lib/base/model/glsp-model-source.js +28 -1
- package/lib/base/model/glsp-model-source.js.map +1 -1
- package/lib/base/model/model-change-service.d.ts +1 -1
- package/lib/base/model/model-change-service.js +1 -1
- package/lib/base/selection-service.d.ts +4 -3
- package/lib/base/selection-service.d.ts.map +1 -1
- package/lib/base/selection-service.js +6 -1
- package/lib/base/selection-service.js.map +1 -1
- package/lib/base/ui-extension/ui-extension.d.ts +1 -1
- package/lib/base/ui-extension/ui-extension.js +1 -1
- package/lib/features/accessibility/keyboard-tool-palette/keyboard-tool-palette.d.ts +1 -1
- package/lib/features/accessibility/keyboard-tool-palette/keyboard-tool-palette.js +1 -1
- package/lib/features/bounds/bounds-module.d.ts +1 -1
- package/lib/features/bounds/bounds-module.js +2 -2
- package/lib/features/bounds/bounds-module.js.map +1 -1
- package/lib/features/bounds/glsp-hidden-bounds-updater.d.ts +1 -1
- package/lib/features/bounds/glsp-hidden-bounds-updater.js +1 -1
- package/lib/features/bounds/hbox-layout.d.ts +1 -1
- package/lib/features/bounds/hbox-layout.js +1 -2
- package/lib/features/bounds/hbox-layout.js.map +1 -1
- package/lib/features/bounds/vbox-layout.d.ts +1 -1
- package/lib/features/bounds/vbox-layout.js +1 -2
- package/lib/features/bounds/vbox-layout.js.map +1 -1
- package/lib/features/change-bounds/model.d.ts +1 -1
- package/lib/features/change-bounds/model.d.ts.map +1 -1
- package/lib/features/change-bounds/model.js +1 -2
- package/lib/features/change-bounds/model.js.map +1 -1
- package/lib/features/change-bounds/point-position-updater.d.ts +1 -1
- package/lib/features/change-bounds/point-position-updater.js +3 -4
- package/lib/features/change-bounds/point-position-updater.js.map +1 -1
- package/lib/features/change-bounds/snap.d.ts +1 -1
- package/lib/features/change-bounds/snap.js +15 -0
- package/lib/features/change-bounds/snap.js.map +1 -1
- package/lib/features/command-palette/command-palette.d.ts +1 -1
- package/lib/features/command-palette/command-palette.js +1 -1
- package/lib/features/context-menu/context-menu-module.d.ts +1 -1
- package/lib/features/context-menu/context-menu-module.js +1 -2
- package/lib/features/context-menu/context-menu-module.js.map +1 -1
- package/lib/features/context-menu/delete-element-context-menu.d.ts +1 -1
- package/lib/features/context-menu/delete-element-context-menu.js +1 -1
- package/lib/features/copy-paste/copy-paste-context-menu.d.ts +1 -1
- package/lib/features/copy-paste/copy-paste-context-menu.js +2 -2
- package/lib/features/copy-paste/copy-paste-context-menu.js.map +1 -1
- package/lib/features/debug/debug-bounds-decorator.d.ts +1 -1
- package/lib/features/debug/debug-bounds-decorator.js +12 -13
- package/lib/features/debug/debug-bounds-decorator.js.map +1 -1
- package/lib/features/label-edit-ui/label-edit-ui.d.ts +4 -1
- package/lib/features/label-edit-ui/label-edit-ui.d.ts.map +1 -1
- package/lib/features/label-edit-ui/label-edit-ui.js +38 -1
- package/lib/features/label-edit-ui/label-edit-ui.js.map +1 -1
- package/lib/features/navigation/navigation-action-handler.d.ts +1 -1
- package/lib/features/navigation/navigation-action-handler.js +1 -1
- package/lib/features/routing/edge-router.d.ts +2 -1
- package/lib/features/routing/edge-router.d.ts.map +1 -1
- package/lib/features/routing/edge-router.js +2 -1
- package/lib/features/routing/edge-router.js.map +1 -1
- package/lib/features/routing/routing-module.d.ts +1 -1
- package/lib/features/routing/routing-module.d.ts.map +1 -1
- package/lib/features/routing/routing-module.js +7 -1
- package/lib/features/routing/routing-module.js.map +1 -1
- package/lib/features/routing/sticky-manhattan-anchors.d.ts +29 -0
- package/lib/features/routing/sticky-manhattan-anchors.d.ts.map +1 -0
- package/lib/features/routing/sticky-manhattan-anchors.js +62 -0
- package/lib/features/routing/sticky-manhattan-anchors.js.map +1 -0
- package/lib/features/routing/sticky-manhattan-edge-router.d.ts +107 -0
- package/lib/features/routing/sticky-manhattan-edge-router.d.ts.map +1 -0
- package/lib/features/routing/sticky-manhattan-edge-router.js +626 -0
- package/lib/features/routing/sticky-manhattan-edge-router.js.map +1 -0
- package/lib/features/select/select-module.d.ts +1 -1
- package/lib/features/select/select-module.js +1 -1
- package/lib/features/tool-palette/tool-palette.d.ts +1 -1
- package/lib/features/tool-palette/tool-palette.d.ts.map +1 -1
- package/lib/features/tool-palette/tool-palette.js +1 -3
- package/lib/features/tool-palette/tool-palette.js.map +1 -1
- package/lib/index.d.ts +5 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +5 -1
- package/lib/index.js.map +1 -1
- package/lib/views/gedge-view-with-gaps-on-intersections.d.ts +39 -0
- package/lib/views/gedge-view-with-gaps-on-intersections.d.ts.map +1 -0
- package/lib/views/gedge-view-with-gaps-on-intersections.js +85 -0
- package/lib/views/gedge-view-with-gaps-on-intersections.js.map +1 -0
- package/lib/views/issue-marker-view.d.ts +1 -1
- package/lib/views/issue-marker-view.js +9 -10
- package/lib/views/issue-marker-view.js.map +1 -1
- package/lib/views/rounded-corner-manhattan-edge-view.d.ts +58 -0
- package/lib/views/rounded-corner-manhattan-edge-view.d.ts.map +1 -0
- package/lib/views/rounded-corner-manhattan-edge-view.js +170 -0
- package/lib/views/rounded-corner-manhattan-edge-view.js.map +1 -0
- package/package.json +4 -4
- package/src/base/action-dispatcher.spec.ts +2 -2
- package/src/base/action-dispatcher.ts +7 -4
- package/src/base/auto-complete/auto-complete-widget.ts +3 -3
- package/src/base/auto-complete/validation-decorator.ts +3 -4
- package/src/base/default.module.ts +6 -2
- package/src/base/editor-context-service.ts +17 -5
- package/src/base/feedback/feedback-action-dispatcher.ts +2 -2
- package/src/base/feedback/feedback-command.ts +2 -2
- package/src/base/focus/focus-tracker.ts +1 -1
- package/src/base/model/glsp-model-source.ts +35 -1
- package/src/base/model/model-change-service.ts +1 -1
- package/src/base/model/model-initialization-constraint.spec.ts +2 -2
- package/src/base/selection-service.spec.ts +3 -4
- package/src/base/selection-service.ts +11 -2
- package/src/base/ui-extension/ui-extension.ts +1 -1
- package/src/default-modules.spec.ts +2 -2
- package/src/features/accessibility/keyboard-tool-palette/keyboard-tool-palette.ts +1 -1
- package/src/features/bounds/bounds-module.ts +2 -2
- package/src/features/bounds/glsp-hidden-bounds-updater.ts +1 -1
- package/src/features/bounds/hbox-layout.spec.ts +2 -2
- package/src/features/bounds/hbox-layout.ts +2 -2
- package/src/features/bounds/vbox-layout.spec.ts +2 -2
- package/src/features/bounds/vbox-layout.ts +2 -2
- package/src/features/change-bounds/model.ts +1 -2
- package/src/features/change-bounds/point-position-updater.spec.ts +3 -3
- package/src/features/change-bounds/point-position-updater.ts +4 -4
- package/src/features/change-bounds/snap.ts +2 -2
- package/src/features/command-palette/command-palette.ts +1 -1
- package/src/features/context-menu/context-menu-module.ts +2 -2
- package/src/features/context-menu/delete-element-context-menu.ts +2 -2
- package/src/features/copy-paste/copy-paste-context-menu.ts +2 -2
- package/src/features/debug/debug-bounds-decorator.tsx +2 -2
- package/src/features/label-edit-ui/label-edit-ui.ts +36 -3
- package/src/features/layout/layout-elements-action.spec.ts +2 -2
- package/src/features/navigation/navigation-action-handler.ts +3 -3
- package/src/features/routing/edge-router.ts +2 -2
- package/src/features/routing/routing-module.ts +8 -1
- package/src/features/routing/sticky-manhattan-anchors.ts +53 -0
- package/src/features/routing/sticky-manhattan-edge-router.spec.ts +212 -0
- package/src/features/routing/sticky-manhattan-edge-router.ts +713 -0
- package/src/features/select/select-module.ts +1 -1
- package/src/features/tool-palette/tool-palette.ts +1 -3
- package/src/index.ts +5 -1
- package/src/views/gedge-view-with-gaps-on-intersections.tsx +99 -0
- package/src/views/issue-marker-view.tsx +2 -2
- package/src/views/rounded-corner-manhattan-edge-view.ts +171 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2024 EclipseSource and others.
|
|
2
|
+
* Copyright (c) 2024-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
|
|
@@ -46,7 +46,7 @@ describe('default-modules', () => {
|
|
|
46
46
|
it('should throw an error if the base (default) module is removed via configuration', () => {
|
|
47
47
|
expect(() => initializeDiagramContainer(container, { remove: defaultModule })).to.throw(/Invalid module configuration/);
|
|
48
48
|
});
|
|
49
|
-
|
|
49
|
+
|
|
50
50
|
it('should throw an error if the base (default) module is not the first module of the resolved configured (removed and added again)', () => {
|
|
51
51
|
expect(() => initializeDiagramContainer(container, { remove: defaultModule, add: defaultModule })).to.throw(
|
|
52
52
|
/Invalid module configuration/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2023-
|
|
2
|
+
* Copyright (c) 2023-2026 Business Informatics Group (TU Wien) 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
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2022-
|
|
2
|
+
* Copyright (c) 2022-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
|
|
@@ -60,7 +60,7 @@ export const boundsModule = new FeatureModule(
|
|
|
60
60
|
configureActionHandler(context, MoveElementRelativeAction.KIND, MoveElementHandler);
|
|
61
61
|
|
|
62
62
|
// backwards compatibility
|
|
63
|
-
// eslint-disable-next-line
|
|
63
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
64
64
|
bind(PositionSnapper).toSelf();
|
|
65
65
|
},
|
|
66
66
|
{ featureId: Symbol('bounds') }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2022-
|
|
2
|
+
* Copyright (c) 2022-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
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2022-
|
|
2
|
+
* Copyright (c) 2022-2026 TypeFox, 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
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
|
|
16
|
+
|
|
17
17
|
import { expect } from 'chai';
|
|
18
18
|
import 'mocha';
|
|
19
19
|
import 'reflect-metadata';
|
|
@@ -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
|
|
@@ -204,7 +204,7 @@ export class HBoxLayouterExt extends HBoxLayouter {
|
|
|
204
204
|
layouter: StatefulLayouter
|
|
205
205
|
): Bounds {
|
|
206
206
|
const currentContainer = container;
|
|
207
|
-
|
|
207
|
+
|
|
208
208
|
if (isBoundsAware(currentContainer)) {
|
|
209
209
|
const bounds = currentContainer.bounds;
|
|
210
210
|
const elementOptions = this.getElementLayoutOptions(currentContainer);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2022-
|
|
2
|
+
* Copyright (c) 2022-2026 TypeFox, 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
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
|
|
16
|
+
|
|
17
17
|
import { expect } from 'chai';
|
|
18
18
|
import 'mocha';
|
|
19
19
|
import 'reflect-metadata';
|
|
@@ -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
|
|
@@ -204,7 +204,7 @@ export class VBoxLayouterExt extends VBoxLayouter {
|
|
|
204
204
|
layouter: StatefulLayouter
|
|
205
205
|
): Bounds {
|
|
206
206
|
const currentContainer = container;
|
|
207
|
-
|
|
207
|
+
|
|
208
208
|
if (isBoundsAware(currentContainer)) {
|
|
209
209
|
const bounds = currentContainer.bounds;
|
|
210
210
|
const elementOptions = this.getElementLayoutOptions(currentContainer);
|
|
@@ -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
|
|
@@ -35,7 +35,6 @@ export function isResizable(element: GModelElement): element is ResizableModelEl
|
|
|
35
35
|
return isBoundsAware(element) && isSelectable(element) && element instanceof GParentElement && element.hasFeature(resizeFeature);
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
// eslint-disable-next-line no-shadow
|
|
39
38
|
export enum ResizeHandleLocation {
|
|
40
39
|
TopLeft = 'top-left',
|
|
41
40
|
Top = 'top',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2022-
|
|
2
|
+
* Copyright (c) 2022-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
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
/* eslint-disable import/no-deprecated */
|
|
17
|
-
/* eslint-disable
|
|
16
|
+
/* eslint-disable import-x/no-deprecated */
|
|
17
|
+
/* eslint-disable @typescript-eslint/no-deprecated */
|
|
18
18
|
|
|
19
19
|
import { GModelElement } from '@eclipse-glsp/sprotty';
|
|
20
20
|
import { expect } from 'chai';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2020-
|
|
2
|
+
* Copyright (c) 2020-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
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
|
|
17
|
-
/* eslint-disable import/no-deprecated */
|
|
18
|
-
/* eslint-disable
|
|
16
|
+
|
|
17
|
+
/* eslint-disable import-x/no-deprecated */
|
|
18
|
+
/* eslint-disable @typescript-eslint/no-deprecated */
|
|
19
19
|
|
|
20
20
|
import { GModelElement, ISnapper, Point, Writable } from '@eclipse-glsp/sprotty';
|
|
21
21
|
import { calculateDeltaBetweenPoints } from '../../utils/gmodel-util';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2020-
|
|
2
|
+
* Copyright (c) 2020-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
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
|
|
16
|
+
|
|
17
17
|
import { KeyboardModifier } from '@eclipse-glsp/sprotty';
|
|
18
18
|
|
|
19
19
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2024 EclipseSource and others.
|
|
2
|
+
* Copyright (c) 2024-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
|
|
@@ -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
|
|
@@ -24,7 +24,7 @@ export const contextMenuModule = new FeatureModule(
|
|
|
24
24
|
return ctx.container.get<IContextMenuService>(TYPES.IContextMenuService);
|
|
25
25
|
}
|
|
26
26
|
console.warn("'TYPES.IContextMenuService' is not bound. Use no-op implementation instead");
|
|
27
|
-
|
|
27
|
+
|
|
28
28
|
return { show: () => {} };
|
|
29
29
|
});
|
|
30
30
|
|
|
@@ -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
|
|
@@ -21,7 +21,7 @@ import { messages } from '../../base/messages';
|
|
|
21
21
|
@injectable()
|
|
22
22
|
export class DeleteElementContextMenuItemProvider implements IContextMenuItemProvider {
|
|
23
23
|
/** @deprecated No longer used. The {@link EditorContextService} is now directly injected.*/
|
|
24
|
-
// eslint-disable-next-line
|
|
24
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
25
25
|
@inject(TYPES.IEditorContextServiceProvider) editorContextServiceProvider: EditorContextServiceProvider;
|
|
26
26
|
|
|
27
27
|
@inject(EditorContextService)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2020-
|
|
2
|
+
* Copyright (c) 2020-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
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
/* eslint-disable
|
|
16
|
+
/* eslint-disable @typescript-eslint/no-deprecated */
|
|
17
17
|
import {
|
|
18
18
|
Action,
|
|
19
19
|
ClientMenuItem,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2024 Axon Ivy AG and others.
|
|
2
|
+
* Copyright (c) 2024-2026 Axon Ivy AG 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
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
|
|
16
|
+
|
|
17
17
|
/** @jsx svg */
|
|
18
18
|
import { Bounds, GModelElement, IVNodePostprocessor, Point, TYPES, isDecoration, isSizeable, setClass, svg } from '@eclipse-glsp/sprotty';
|
|
19
19
|
import { inject, injectable, optional } from 'inversify';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2024 EclipseSource and others.
|
|
2
|
+
* Copyright (c) 2024-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
|
|
@@ -13,15 +13,32 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
import { EditLabelUI } from '@eclipse-glsp/sprotty';
|
|
17
|
-
import { injectable } from 'inversify';
|
|
16
|
+
import { Bounds, EditLabelUI } from '@eclipse-glsp/sprotty';
|
|
17
|
+
import { inject, injectable } from 'inversify';
|
|
18
|
+
import { EditorContextService } from '../../base/editor-context-service';
|
|
18
19
|
import { CSS_HIDDEN_EXTENSION_CLASS, CSS_UI_EXTENSION_CLASS } from '../../base/ui-extension/ui-extension';
|
|
19
20
|
|
|
20
21
|
@injectable()
|
|
21
22
|
export class GlspEditLabelUI extends EditLabelUI {
|
|
23
|
+
@inject(EditorContextService)
|
|
24
|
+
protected editorContextService: EditorContextService;
|
|
25
|
+
|
|
22
26
|
protected override initializeContents(containerElement: HTMLElement): void {
|
|
23
27
|
super.initializeContents(containerElement);
|
|
24
28
|
containerElement.classList.add(CSS_UI_EXTENSION_CLASS);
|
|
29
|
+
this.editorContextService.onViewportChanged(() => {
|
|
30
|
+
window.requestAnimationFrame(() => {
|
|
31
|
+
if (this.isActive && this.containerElement) {
|
|
32
|
+
if (this.isLabelInVisibleViewport()) {
|
|
33
|
+
this.setPosition(this.containerElement);
|
|
34
|
+
this.applyFontStyling();
|
|
35
|
+
} else {
|
|
36
|
+
// Cancel editing if the label moved out of the visible viewport
|
|
37
|
+
this.hide();
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
});
|
|
25
42
|
}
|
|
26
43
|
|
|
27
44
|
protected override setContainerVisible(visible: boolean): void {
|
|
@@ -32,4 +49,20 @@ export class GlspEditLabelUI extends EditLabelUI {
|
|
|
32
49
|
this.containerElement?.classList.add(CSS_HIDDEN_EXTENSION_CLASS);
|
|
33
50
|
}
|
|
34
51
|
}
|
|
52
|
+
|
|
53
|
+
protected isLabelInVisibleViewport(): boolean {
|
|
54
|
+
if (!this.labelElement) {
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
const canvasBounds = this.editorContextService.canvasBounds;
|
|
58
|
+
const scroll = { x: window.scrollX, y: window.scrollY };
|
|
59
|
+
const canvasScreenBounds: Bounds = {
|
|
60
|
+
x: canvasBounds.x - scroll.x,
|
|
61
|
+
y: canvasBounds.y - scroll.y,
|
|
62
|
+
width: canvasBounds.width,
|
|
63
|
+
height: canvasBounds.height
|
|
64
|
+
};
|
|
65
|
+
const labelBounds = this.labelElement.getBoundingClientRect();
|
|
66
|
+
return Bounds.overlap(labelBounds, canvasScreenBounds);
|
|
67
|
+
}
|
|
35
68
|
}
|
|
@@ -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
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
|
|
16
|
+
|
|
17
17
|
import {
|
|
18
18
|
Action,
|
|
19
19
|
AnimationFrameSyncer,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2020-
|
|
2
|
+
* Copyright (c) 2020-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
|
|
@@ -141,10 +141,10 @@ export class NavigationActionHandler implements IActionHandler {
|
|
|
141
141
|
@inject(TYPES.ILogger) protected logger: ILogger;
|
|
142
142
|
@inject(TYPES.IActionDispatcher) protected dispatcher: IActionDispatcher;
|
|
143
143
|
/** @deprecated No longer in used. The {@link ActionHandlerRegistry} is now directly injected */
|
|
144
|
-
// eslint-disable-next-line
|
|
144
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
145
145
|
@inject(TYPES.ActionHandlerRegistryProvider) protected actionHandlerRegistryProvider: () => Promise<ActionHandlerRegistry>;
|
|
146
146
|
/** @deprecated No longer in used. The {@link EditorContextService} is now directly injected */
|
|
147
|
-
// eslint-disable-next-line
|
|
147
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
148
148
|
@inject(TYPES.IEditorContextServiceProvider) protected editorContextService: EditorContextServiceProvider;
|
|
149
149
|
@inject(ActionHandlerRegistry) protected actionHandlerRegistry: ActionHandlerRegistry;
|
|
150
150
|
@inject(NavigationTargetResolver) protected resolver: NavigationTargetResolver;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2024 EclipseSource and others.
|
|
2
|
+
* Copyright (c) 2024-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
|
|
@@ -114,7 +114,7 @@ export class GLSPBezierEdgeRouter extends BezierEdgeRouter {
|
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
function ensureBounds(element?: GConnectableElement): boolean {
|
|
117
|
+
export function ensureBounds(element?: GConnectableElement): boolean {
|
|
118
118
|
if (!element) {
|
|
119
119
|
return false;
|
|
120
120
|
}
|
|
@@ -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
|
|
@@ -32,6 +32,8 @@ import {
|
|
|
32
32
|
configureCommand
|
|
33
33
|
} from '@eclipse-glsp/sprotty';
|
|
34
34
|
import { GLSPBezierEdgeRouter, GLSPManhattanEdgeRouter, GLSPPolylineEdgeRouter } from './edge-router';
|
|
35
|
+
import { StickyManhattanDiamondAnchor, StickyManhattanEllipticAnchor, StickyManhattanRectangularAnchor } from './sticky-manhattan-anchors';
|
|
36
|
+
import { GLSPStickyManhattanEdgeRouter } from './sticky-manhattan-edge-router';
|
|
35
37
|
|
|
36
38
|
export const routingModule = new FeatureModule(
|
|
37
39
|
(bind, unbind, isBound, rebind) => {
|
|
@@ -54,6 +56,11 @@ export const routingModule = new FeatureModule(
|
|
|
54
56
|
bindAsService(context, TYPES.IAnchorComputer, BezierRectangleAnchor);
|
|
55
57
|
bindAsService(context, TYPES.IAnchorComputer, BezierDiamondAnchor);
|
|
56
58
|
|
|
59
|
+
bindAsService(context, TYPES.IEdgeRouter, GLSPStickyManhattanEdgeRouter);
|
|
60
|
+
bindAsService(context, TYPES.IAnchorComputer, StickyManhattanEllipticAnchor);
|
|
61
|
+
bindAsService(context, TYPES.IAnchorComputer, StickyManhattanRectangularAnchor);
|
|
62
|
+
bindAsService(context, TYPES.IAnchorComputer, StickyManhattanDiamondAnchor);
|
|
63
|
+
|
|
57
64
|
configureCommand({ bind, isBound }, AddRemoveBezierSegmentCommand);
|
|
58
65
|
},
|
|
59
66
|
{ featureId: Symbol('routing') }
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2026 EclipseSource 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 {
|
|
17
|
+
DIAMOND_ANCHOR_KIND,
|
|
18
|
+
ELLIPTIC_ANCHOR_KIND,
|
|
19
|
+
ManhattanDiamondAnchor,
|
|
20
|
+
ManhattanEllipticAnchor,
|
|
21
|
+
ManhattanRectangularAnchor,
|
|
22
|
+
RECTANGULAR_ANCHOR_KIND
|
|
23
|
+
} from '@eclipse-glsp/sprotty';
|
|
24
|
+
import { injectable } from 'inversify';
|
|
25
|
+
import { GLSPStickyManhattanEdgeRouter } from './sticky-manhattan-edge-router';
|
|
26
|
+
|
|
27
|
+
// Anchor computers are keyed by `<routerKind>:<anchorKind>` in the AnchorComputerRegistry.
|
|
28
|
+
// The sticky router has its own routerKind, so dedicated subclasses must be registered even
|
|
29
|
+
// though their geometry behavior is identical to the standard Manhattan anchors.
|
|
30
|
+
|
|
31
|
+
@injectable()
|
|
32
|
+
export class StickyManhattanRectangularAnchor extends ManhattanRectangularAnchor {
|
|
33
|
+
static override readonly KIND = GLSPStickyManhattanEdgeRouter.KIND + ':' + RECTANGULAR_ANCHOR_KIND;
|
|
34
|
+
override get kind(): string {
|
|
35
|
+
return StickyManhattanRectangularAnchor.KIND;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@injectable()
|
|
40
|
+
export class StickyManhattanDiamondAnchor extends ManhattanDiamondAnchor {
|
|
41
|
+
static override readonly KIND = GLSPStickyManhattanEdgeRouter.KIND + ':' + DIAMOND_ANCHOR_KIND;
|
|
42
|
+
override get kind(): string {
|
|
43
|
+
return StickyManhattanDiamondAnchor.KIND;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@injectable()
|
|
48
|
+
export class StickyManhattanEllipticAnchor extends ManhattanEllipticAnchor {
|
|
49
|
+
static override readonly KIND = GLSPStickyManhattanEdgeRouter.KIND + ':' + ELLIPTIC_ANCHOR_KIND;
|
|
50
|
+
override get kind(): string {
|
|
51
|
+
return StickyManhattanEllipticAnchor.KIND;
|
|
52
|
+
}
|
|
53
|
+
}
|