@eclipse-glsp/client 1.1.0-next.335bc3d.213 → 1.1.0-next.35bf56e.230
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/README.md +1 -1
- package/css/decoration.css +1 -1
- package/lib/base/auto-complete/auto-complete-widget.d.ts +2 -2
- package/lib/base/auto-complete/auto-complete-widget.js +3 -3
- package/lib/base/command-stack.d.ts +1 -2
- package/lib/base/command-stack.d.ts.map +1 -1
- package/lib/base/command-stack.js +5 -14
- package/lib/base/command-stack.js.map +1 -1
- package/lib/base/container-modules.d.ts +15 -7
- package/lib/base/container-modules.d.ts.map +1 -1
- package/lib/base/container-modules.js +15 -5
- package/lib/base/container-modules.js.map +1 -1
- package/lib/base/editor-context-service.d.ts +3 -3
- package/lib/base/editor-context-service.d.ts.map +1 -1
- package/lib/base/editor-context-service.js +3 -3
- package/lib/base/editor-context-service.js.map +1 -1
- package/lib/base/selection-clearing-mouse-listener.js +1 -1
- package/lib/base/tool-manager/glsp-tool-manager.d.ts +4 -5
- package/lib/base/tool-manager/glsp-tool-manager.d.ts.map +1 -1
- package/lib/base/tool-manager/glsp-tool-manager.js +15 -8
- package/lib/base/tool-manager/glsp-tool-manager.js.map +1 -1
- package/lib/features/bounds/di.config.d.ts +1 -2
- package/lib/features/bounds/di.config.d.ts.map +1 -1
- package/lib/features/bounds/di.config.js +7 -5
- package/lib/features/bounds/di.config.js.map +1 -1
- package/lib/features/{layout → bounds}/freeform-layout.d.ts +2 -2
- package/lib/features/{layout → bounds}/freeform-layout.d.ts.map +1 -1
- package/lib/features/{layout → bounds}/freeform-layout.js +2 -2
- package/lib/features/{layout → bounds}/freeform-layout.js.map +1 -1
- package/lib/features/bounds/freeform-layout.spec.d.ts.map +1 -0
- package/lib/features/{layout/tests → bounds}/freeform-layout.spec.js +37 -37
- package/lib/features/bounds/freeform-layout.spec.js.map +1 -0
- package/lib/features/bounds/glsp-hidden-bounds-updater.d.ts +1 -1
- package/lib/features/bounds/glsp-hidden-bounds-updater.d.ts.map +1 -1
- package/lib/features/bounds/glsp-hidden-bounds-updater.js +3 -2
- package/lib/features/bounds/glsp-hidden-bounds-updater.js.map +1 -1
- package/lib/features/{layout → bounds}/hbox-layout.d.ts +1 -1
- package/lib/features/{layout → bounds}/hbox-layout.d.ts.map +1 -1
- package/lib/features/{layout → bounds}/hbox-layout.js +1 -1
- package/lib/features/{layout → bounds}/hbox-layout.js.map +1 -1
- package/lib/features/bounds/hbox-layout.spec.d.ts.map +1 -0
- package/lib/features/{layout/tests → bounds}/hbox-layout.spec.js +18 -18
- package/lib/features/bounds/hbox-layout.spec.js.map +1 -0
- package/lib/features/{layout/tests/layouter-test-util.d.ts → bounds/layouter-test-util.spec.d.ts} +2 -3
- package/lib/features/bounds/layouter-test-util.spec.d.ts.map +1 -0
- package/lib/features/{layout/tests/layouter-test-util.js → bounds/layouter-test-util.spec.js} +4 -5
- package/lib/features/bounds/layouter-test-util.spec.js.map +1 -0
- package/lib/features/{layout → bounds}/layouter.d.ts +1 -1
- package/lib/features/{layout → bounds}/layouter.d.ts.map +1 -1
- package/lib/features/{layout → bounds}/layouter.js +1 -1
- package/lib/features/{layout → bounds}/layouter.js.map +1 -1
- package/lib/features/{layout → bounds}/vbox-layout.d.ts +1 -1
- package/lib/features/{layout → bounds}/vbox-layout.d.ts.map +1 -1
- package/lib/features/{layout → bounds}/vbox-layout.js +1 -1
- package/lib/features/{layout → bounds}/vbox-layout.js.map +1 -1
- package/lib/features/bounds/vbox-layout.spec.d.ts.map +1 -0
- package/lib/features/{layout/tests → bounds}/vbox-layout.spec.js +18 -18
- package/lib/features/bounds/vbox-layout.spec.js.map +1 -0
- package/lib/features/command-palette/command-palette-tool.d.ts +1 -1
- package/lib/features/command-palette/command-palette-tool.d.ts.map +1 -1
- package/lib/features/command-palette/command-palette-tool.js +3 -3
- package/lib/features/command-palette/command-palette-tool.js.map +1 -1
- package/lib/features/copy-paste/copy-paste-handler.d.ts +2 -2
- package/lib/features/copy-paste/copy-paste-handler.d.ts.map +1 -1
- package/lib/features/copy-paste/copy-paste-handler.js +5 -5
- package/lib/features/copy-paste/copy-paste-handler.js.map +1 -1
- package/lib/features/export/glsp-svg-exporter.d.ts +1 -1
- package/lib/features/export/glsp-svg-exporter.d.ts.map +1 -1
- package/lib/features/export/glsp-svg-exporter.js +1 -2
- package/lib/features/export/glsp-svg-exporter.js.map +1 -1
- package/lib/features/layout/di.config.d.ts +1 -1
- package/lib/features/layout/di.config.d.ts.map +1 -1
- package/lib/features/layout/di.config.js +1 -9
- package/lib/features/layout/di.config.js.map +1 -1
- package/lib/features/navigation/di.config.d.ts +2 -1
- package/lib/features/navigation/di.config.d.ts.map +1 -1
- package/lib/features/navigation/di.config.js +3 -3
- package/lib/features/navigation/di.config.js.map +1 -1
- package/lib/features/navigation/navigation-action-handler.d.ts +2 -2
- package/lib/features/navigation/navigation-action-handler.js +2 -2
- package/lib/features/save/model.d.ts +1 -1
- package/lib/features/select/selection-service.spec.js +1 -1
- package/lib/features/select/selection-service.spec.js.map +1 -1
- package/lib/features/source-model-watcher/di.config.js +1 -1
- package/lib/features/tool-feedback/change-bounds-tool-feedback.d.ts +2 -2
- package/lib/features/tool-feedback/change-bounds-tool-feedback.d.ts.map +1 -1
- package/lib/features/tool-feedback/change-bounds-tool-feedback.js +3 -3
- package/lib/features/tool-feedback/change-bounds-tool-feedback.js.map +1 -1
- package/lib/features/tool-feedback/creation-tool-feedback.d.ts +6 -6
- package/lib/features/tool-feedback/creation-tool-feedback.d.ts.map +1 -1
- package/lib/features/tool-feedback/creation-tool-feedback.js +4 -8
- package/lib/features/tool-feedback/creation-tool-feedback.js.map +1 -1
- package/lib/features/tool-feedback/di.config.d.ts +1 -1
- package/lib/features/tool-feedback/di.config.js +2 -2
- package/lib/features/tool-feedback/edge-edit-tool-feedback.d.ts +1 -2
- package/lib/features/tool-feedback/edge-edit-tool-feedback.d.ts.map +1 -1
- package/lib/features/tool-feedback/edge-edit-tool-feedback.js +1 -7
- package/lib/features/tool-feedback/edge-edit-tool-feedback.js.map +1 -1
- package/lib/features/tools/change-bounds-tool.d.ts +1 -1
- package/lib/features/tools/change-bounds-tool.d.ts.map +1 -1
- package/lib/features/tools/change-bounds-tool.js +6 -6
- package/lib/features/tools/change-bounds-tool.js.map +1 -1
- package/lib/features/tools/di.config.js +2 -2
- package/lib/features/tools/glsp-manhattan-edge-router.d.ts +2 -2
- package/lib/features/tools/glsp-manhattan-edge-router.d.ts.map +1 -1
- package/lib/features/tools/glsp-manhattan-edge-router.js +4 -4
- package/lib/features/tools/glsp-manhattan-edge-router.js.map +1 -1
- package/lib/features/validation/issue-marker.d.ts +1 -1
- package/lib/features/validation/issue-marker.js +1 -1
- package/lib/index.d.ts +26 -4
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +33 -4
- package/lib/index.js.map +1 -1
- package/lib/lib/model.d.ts +7 -3
- package/lib/lib/model.d.ts.map +1 -1
- package/lib/lib/model.js +48 -1
- package/lib/lib/model.js.map +1 -1
- package/lib/sprotty-reexport.d.ts +2 -2
- package/lib/sprotty-reexport.d.ts.map +1 -1
- package/lib/sprotty-reexport.js +4 -4
- package/lib/sprotty-reexport.js.map +1 -1
- package/lib/utils/html-utils.d.ts +1 -1
- package/lib/utils/html-utils.js +1 -1
- package/lib/utils/smodel-util.d.ts +1 -1
- package/lib/utils/smodel-util.d.ts.map +1 -1
- package/lib/utils/smodel-util.js +1 -1
- package/lib/utils/smodel-util.js.map +1 -1
- package/lib/views/base-view-module.js +1 -1
- package/lib/views/glsp-edge-view.d.ts +2 -2
- package/lib/views/glsp-edge-view.d.ts.map +1 -1
- package/lib/views/glsp-edge-view.js +2 -2
- package/lib/views/glsp-edge-view.js.map +1 -1
- package/lib/views/glsp-projection-view.d.ts +1 -1
- package/lib/views/glsp-projection-view.js +1 -1
- package/lib/views/index.d.ts +1 -1
- package/lib/views/index.js +1 -1
- package/lib/views/rounded-corner-view.js +2 -2
- package/lib/views/rounded-corner.d.ts +1 -1
- package/lib/views/rounded-corner.js +1 -1
- package/package.json +17 -17
- package/src/base/auto-complete/auto-complete-widget.ts +3 -3
- package/src/base/command-stack.ts +13 -11
- package/src/base/container-modules.ts +22 -10
- package/src/base/editor-context-service.ts +4 -4
- package/src/base/selection-clearing-mouse-listener.ts +1 -1
- package/src/base/tool-manager/glsp-tool-manager.ts +15 -12
- package/src/features/bounds/di.config.ts +16 -7
- package/src/features/{layout/tests → bounds}/freeform-layout.spec.ts +2 -2
- package/src/features/{layout → bounds}/freeform-layout.ts +2 -2
- package/src/features/bounds/glsp-hidden-bounds-updater.ts +4 -7
- package/src/features/{layout/tests → bounds}/hbox-layout.spec.ts +2 -2
- package/src/features/{layout → bounds}/hbox-layout.ts +1 -1
- package/src/features/{layout/tests/layouter-test-util.ts → bounds/layouter-test-util.spec.ts} +3 -4
- package/src/features/{layout → bounds}/layouter.ts +1 -1
- package/src/features/{layout/tests → bounds}/vbox-layout.spec.ts +2 -2
- package/src/features/{layout → bounds}/vbox-layout.ts +1 -1
- package/src/features/command-palette/command-palette-tool.ts +3 -3
- package/src/features/copy-paste/copy-paste-handler.ts +5 -5
- package/src/features/export/glsp-svg-exporter.ts +8 -7
- package/src/features/layout/di.config.ts +2 -11
- package/src/features/navigation/di.config.ts +4 -2
- package/src/features/navigation/navigation-action-handler.ts +2 -2
- package/src/features/save/model.ts +1 -1
- package/src/features/select/selection-service.spec.ts +2 -2
- package/src/features/source-model-watcher/di.config.ts +1 -1
- package/src/features/tool-feedback/change-bounds-tool-feedback.ts +3 -3
- package/src/features/tool-feedback/creation-tool-feedback.ts +20 -14
- package/src/features/tool-feedback/di.config.ts +2 -2
- package/src/features/tool-feedback/edge-edit-tool-feedback.ts +1 -9
- package/src/features/tools/change-bounds-tool.ts +7 -7
- package/src/features/tools/di.config.ts +3 -3
- package/src/features/tools/glsp-manhattan-edge-router.ts +8 -5
- package/src/features/validation/issue-marker.ts +1 -1
- package/src/index.ts +33 -4
- package/src/lib/model.ts +35 -3
- package/src/sprotty-reexport.ts +18 -8
- package/src/utils/html-utils.ts +1 -1
- package/src/utils/smodel-util.ts +12 -5
- package/src/views/base-view-module.ts +1 -1
- package/src/views/glsp-edge-view.tsx +3 -3
- package/src/views/glsp-projection-view.tsx +1 -1
- package/src/views/index.ts +1 -2
- package/src/views/rounded-corner-view.tsx +2 -2
- package/src/views/rounded-corner.ts +2 -2
- package/lib/features/layout/tests/freeform-layout.spec.d.ts.map +0 -1
- package/lib/features/layout/tests/freeform-layout.spec.js.map +0 -1
- package/lib/features/layout/tests/hbox-layout.spec.d.ts.map +0 -1
- package/lib/features/layout/tests/hbox-layout.spec.js.map +0 -1
- package/lib/features/layout/tests/layouter-test-util.d.ts.map +0 -1
- package/lib/features/layout/tests/layouter-test-util.js.map +0 -1
- package/lib/features/layout/tests/vbox-layout.spec.d.ts.map +0 -1
- package/lib/features/layout/tests/vbox-layout.spec.js.map +0 -1
- /package/lib/features/{layout/tests → bounds}/freeform-layout.spec.d.ts +0 -0
- /package/lib/features/{layout/tests → bounds}/hbox-layout.spec.d.ts +0 -0
- /package/lib/features/{layout/tests → bounds}/vbox-layout.spec.d.ts +0 -0
package/src/features/{layout/tests/layouter-test-util.ts → bounds/layouter-test-util.spec.ts}
RENAMED
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
|
|
17
17
|
import { Dimension, Point } from '@eclipse-glsp/protocol';
|
|
18
18
|
import 'mocha';
|
|
19
|
-
import 'reflect-metadata';
|
|
20
19
|
import {
|
|
21
20
|
BoundsData,
|
|
22
21
|
ConsoleLogger,
|
|
@@ -30,9 +29,9 @@ import {
|
|
|
30
29
|
SParentElement,
|
|
31
30
|
TYPES
|
|
32
31
|
} from 'sprotty';
|
|
33
|
-
import { createDiagramContainer } from '
|
|
34
|
-
import { GLSPGraph } from '
|
|
35
|
-
import { StatefulLayouterExt } from '
|
|
32
|
+
import { createDiagramContainer } from '../../base/container-modules';
|
|
33
|
+
import { GLSPGraph } from '../../lib/model';
|
|
34
|
+
import { StatefulLayouterExt } from './layouter';
|
|
36
35
|
|
|
37
36
|
export function gModel(): GLSPGraph {
|
|
38
37
|
return new GLSPGraph();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2022 EclipseSource and others.
|
|
2
|
+
* Copyright (c) 2022-2023 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 TypeFox, STMicroelectronics and others.
|
|
2
|
+
* Copyright (c) 2022-2023 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
|
|
@@ -19,7 +19,7 @@ import { expect } from 'chai';
|
|
|
19
19
|
import 'mocha';
|
|
20
20
|
import 'reflect-metadata';
|
|
21
21
|
import { BoundsData, ConsoleLogger, SModelElement, SNode } from 'sprotty';
|
|
22
|
-
import { layout, setupLayoutRegistry, sLabel, sNode } from './layouter-test-util';
|
|
22
|
+
import { layout, setupLayoutRegistry, sLabel, sNode } from './layouter-test-util.spec';
|
|
23
23
|
|
|
24
24
|
describe('VBoxLayouter', () => {
|
|
25
25
|
const layoutRegistry = setupLayoutRegistry();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2021-
|
|
2
|
+
* Copyright (c) 2021-2023 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)
|
|
2
|
+
* Copyright (c) 2019-2023 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 class CommandPaletteTool implements Tool {
|
|
|
25
25
|
|
|
26
26
|
@postConstruct()
|
|
27
27
|
protected postConstruct(): void {
|
|
28
|
-
this.commandPaletteKeyListener = this.
|
|
28
|
+
this.commandPaletteKeyListener = this.createCommandPaletteKeyListener();
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
get id(): string {
|
|
@@ -40,7 +40,7 @@ export class CommandPaletteTool implements Tool {
|
|
|
40
40
|
this.keyTool.deregister(this.commandPaletteKeyListener);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
protected
|
|
43
|
+
protected createCommandPaletteKeyListener(): KeyListener {
|
|
44
44
|
return new CommandPaletteKeyListener();
|
|
45
45
|
}
|
|
46
46
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2019-
|
|
2
|
+
* Copyright (c) 2019-2023 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
|
|
@@ -96,7 +96,7 @@ const CLIPBOARD_DATA_FORMAT = 'text/plain';
|
|
|
96
96
|
export class ServerCopyPasteHandler implements ICopyPasteHandler {
|
|
97
97
|
@inject(TYPES.IActionDispatcher) protected actionDispatcher: GLSPActionDispatcher;
|
|
98
98
|
@inject(TYPES.ViewerOptions) protected viewerOptions: ViewerOptions;
|
|
99
|
-
@inject(TYPES.IAsyncClipboardService) protected
|
|
99
|
+
@inject(TYPES.IAsyncClipboardService) protected clipboardService: IAsyncClipboardService;
|
|
100
100
|
@inject(EditorContextService) protected editorContext: EditorContextService;
|
|
101
101
|
|
|
102
102
|
handleCopy(event: ClipboardEvent): void {
|
|
@@ -105,13 +105,13 @@ export class ServerCopyPasteHandler implements ICopyPasteHandler {
|
|
|
105
105
|
event.clipboardData.setData(CLIPBOARD_DATA_FORMAT, toClipboardId(clipboardId));
|
|
106
106
|
this.actionDispatcher
|
|
107
107
|
.request<SetClipboardDataAction>(RequestClipboardDataAction.create(this.editorContext.get()))
|
|
108
|
-
.then(action => this.
|
|
108
|
+
.then(action => this.clipboardService.put(action.clipboardData, clipboardId));
|
|
109
109
|
event.preventDefault();
|
|
110
110
|
} else {
|
|
111
111
|
if (event.clipboardData) {
|
|
112
112
|
event.clipboardData.clearData();
|
|
113
113
|
}
|
|
114
|
-
this.
|
|
114
|
+
this.clipboardService.clear();
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
|
|
@@ -126,7 +126,7 @@ export class ServerCopyPasteHandler implements ICopyPasteHandler {
|
|
|
126
126
|
handlePaste(event: ClipboardEvent): void {
|
|
127
127
|
if (event.clipboardData && this.shouldPaste(event)) {
|
|
128
128
|
const clipboardId = getClipboardIdFromDataTransfer(event.clipboardData);
|
|
129
|
-
const clipboardData = this.
|
|
129
|
+
const clipboardData = this.clipboardService.get(clipboardId);
|
|
130
130
|
if (clipboardData) {
|
|
131
131
|
this.actionDispatcher.dispatch(PasteOperation.create({ clipboardData, editorContext: this.editorContext.get() }));
|
|
132
132
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2022 EclipseSource and others.
|
|
2
|
+
* Copyright (c) 2022-2023 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
|
|
@@ -18,8 +18,8 @@ import { injectable } from 'inversify';
|
|
|
18
18
|
import { ExportSvgAction, SModelRoot, SvgExporter } from 'sprotty';
|
|
19
19
|
import { v4 as uuid } from 'uuid';
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
@injectable()
|
|
22
|
+
export class GLSPSvgExporter extends SvgExporter {
|
|
23
23
|
override export(root: SModelRoot, _request?: RequestAction<ExportSvgAction>): void {
|
|
24
24
|
if (typeof document !== 'undefined') {
|
|
25
25
|
const svgElement = this.findSvgElement();
|
|
@@ -30,9 +30,10 @@ import { v4 as uuid } from 'uuid';
|
|
|
30
30
|
svgElement.id = originalId || uuid();
|
|
31
31
|
// provide generated svg code with respective sizing for proper viewing in browser and remove undesired border
|
|
32
32
|
const bounds = this.getBounds(root);
|
|
33
|
-
const svg = this.createSvg(svgElement, root)
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
const svg = this.createSvg(svgElement, root).replace(
|
|
34
|
+
'style="',
|
|
35
|
+
`style="width: ${bounds.width}px !important;height: ${bounds.height}px !important;border: none !important;`
|
|
36
|
+
);
|
|
36
37
|
// do not give request/response id here as otherwise the action is treated as an unrequested response
|
|
37
38
|
this.actionDispatcher.dispatch(ExportSvgAction.create(svg, ''));
|
|
38
39
|
} finally {
|
|
@@ -47,4 +48,4 @@ import { v4 as uuid } from 'uuid';
|
|
|
47
48
|
// search for first svg element as hierarchy within Sprotty might change
|
|
48
49
|
return div && div.querySelector('svg');
|
|
49
50
|
}
|
|
50
|
-
|
|
51
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2019-
|
|
2
|
+
* Copyright (c) 2019-2023 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,27 +14,18 @@
|
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
import { ContainerModule } from 'inversify';
|
|
17
|
-
import { configureActionHandler
|
|
18
|
-
import { FreeFormLayouter } from './freeform-layout';
|
|
19
|
-
import { HBoxLayouterExt } from './hbox-layout';
|
|
17
|
+
import { configureActionHandler } from 'sprotty';
|
|
20
18
|
import {
|
|
21
19
|
AlignElementsAction,
|
|
22
20
|
AlignElementsActionHandler,
|
|
23
21
|
ResizeElementsAction,
|
|
24
22
|
ResizeElementsActionHandler
|
|
25
23
|
} from './layout-elements-action';
|
|
26
|
-
import { LayouterExt } from './layouter';
|
|
27
|
-
import { VBoxLayouterExt } from './vbox-layout';
|
|
28
24
|
|
|
29
25
|
const layoutModule = new ContainerModule((bind, _unbind, isBound, rebind) => {
|
|
30
26
|
const context = { bind, isBound };
|
|
31
27
|
configureActionHandler(context, ResizeElementsAction.KIND, ResizeElementsActionHandler);
|
|
32
28
|
configureActionHandler(context, AlignElementsAction.KIND, AlignElementsActionHandler);
|
|
33
|
-
|
|
34
|
-
rebind(VBoxLayouter).to(VBoxLayouterExt);
|
|
35
|
-
rebind(HBoxLayouter).to(HBoxLayouterExt);
|
|
36
|
-
rebind(TYPES.Layouter).to(LayouterExt);
|
|
37
|
-
configureLayout({ bind, isBound }, FreeFormLayouter.KIND, FreeFormLayouter);
|
|
38
29
|
});
|
|
39
30
|
|
|
40
31
|
export default layoutModule;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2020-
|
|
2
|
+
* Copyright (c) 2020-2023 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
|
|
@@ -19,7 +19,7 @@ import { configureActionHandler } from 'sprotty';
|
|
|
19
19
|
import { NavigateAction, NavigationActionHandler, ProcessNavigationArgumentsAction } from './navigation-action-handler';
|
|
20
20
|
import { NavigationTargetResolver } from './navigation-target-resolver';
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
const navigationModule = new ContainerModule((bind, _unbind, isBound) => {
|
|
23
23
|
bind(NavigationTargetResolver).toSelf().inSingletonScope();
|
|
24
24
|
bind(NavigationActionHandler).toSelf().inSingletonScope();
|
|
25
25
|
configureActionHandler({ bind, isBound }, NavigateAction.KIND, NavigationActionHandler);
|
|
@@ -27,3 +27,5 @@ export const navigationModule = new ContainerModule((bind, _unbind, isBound) =>
|
|
|
27
27
|
configureActionHandler({ bind, isBound }, ProcessNavigationArgumentsAction.KIND, NavigationActionHandler);
|
|
28
28
|
configureActionHandler({ bind, isBound }, NavigateToExternalTargetAction.KIND, NavigationActionHandler);
|
|
29
29
|
});
|
|
30
|
+
|
|
31
|
+
export default navigationModule;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2020-
|
|
2
|
+
* Copyright (c) 2020-2023 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
|
|
@@ -123,7 +123,7 @@ export namespace ProcessNavigationArgumentsAction {
|
|
|
123
123
|
* *(a)* the navigation target already specifies element IDs, in which case this action handler navigates
|
|
124
124
|
* to the specified elements directly, by the selecting them and centering them in the viewport.
|
|
125
125
|
* *(b)* the arguments of the navigation targets don't contain element IDs, but other arguments, the
|
|
126
|
-
* navigation target needs to be resolved into actual
|
|
126
|
+
* navigation target needs to be resolved into actual element IDs by the `NavigationTargetResolver`.
|
|
127
127
|
* This can for instance be useful, if the navigation deals with queries or some other more complex
|
|
128
128
|
* logic that can't be dealt with on the client.
|
|
129
129
|
* *(c)* the target isn't resolved by the `NavigationTargetResolver`, e.g. because the `uri` doesn't match
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2019 EclipseSource and others.
|
|
2
|
+
* Copyright (c) 2019-2021 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) 2020-
|
|
2
|
+
* Copyright (c) 2020-2023 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
|
|
@@ -200,7 +200,7 @@ describe('SelectionService', () => {
|
|
|
200
200
|
selectionService.modelRootChanged(newRoot);
|
|
201
201
|
assertSelectionAndFeedback(['node1'], ['node2']);
|
|
202
202
|
});
|
|
203
|
-
it('Changing root with new selection correctly selects
|
|
203
|
+
it('Changing root with new selection correctly selects matching elements and deselects not matching elements.', () => {
|
|
204
204
|
assertSelectionAndFeedback([], []);
|
|
205
205
|
selectionService.updateSelection(root, ['node1', 'node2'], []);
|
|
206
206
|
assertSelectionAndFeedback(['node1', 'node2'], []);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c)
|
|
2
|
+
* Copyright (c) 2019-2022 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-2023 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
|
|
@@ -221,7 +221,7 @@ export class FeedbackMoveMouseListener extends MouseListener {
|
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
223
|
|
|
224
|
-
protected validateMove(
|
|
224
|
+
protected validateMove(startPosition: Point, toPosition: Point, element: SModelElement, isFinished: boolean): Point {
|
|
225
225
|
let newPosition = toPosition;
|
|
226
226
|
if (this.tool.movementRestrictor) {
|
|
227
227
|
const valid = this.tool.movementRestrictor.validate(element, toPosition);
|
|
@@ -230,7 +230,7 @@ export class FeedbackMoveMouseListener extends MouseListener {
|
|
|
230
230
|
action = createMovementRestrictionFeedback(element, this.tool.movementRestrictor);
|
|
231
231
|
|
|
232
232
|
if (isFinished) {
|
|
233
|
-
newPosition =
|
|
233
|
+
newPosition = startPosition;
|
|
234
234
|
}
|
|
235
235
|
} else {
|
|
236
236
|
action = removeMovementRestrictionFeedback(element, this.tool.movementRestrictor);
|
|
@@ -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
|
-
import { Action, Bounds, Point } from '@eclipse-glsp/protocol';
|
|
16
|
+
import { Action, Bounds, Point, SEdgeSchema } from '@eclipse-glsp/protocol';
|
|
17
17
|
import { inject, injectable } from 'inversify';
|
|
18
18
|
import {
|
|
19
19
|
AnchorComputerRegistry,
|
|
@@ -28,7 +28,6 @@ import {
|
|
|
28
28
|
SChildElement,
|
|
29
29
|
SConnectableElement,
|
|
30
30
|
SDanglingAnchor,
|
|
31
|
-
SEdge as SEdgeSchema,
|
|
32
31
|
SModelElement,
|
|
33
32
|
SModelRoot,
|
|
34
33
|
SRoutableElement,
|
|
@@ -42,7 +41,7 @@ export interface DrawFeedbackEdgeAction extends Action {
|
|
|
42
41
|
kind: typeof DrawFeedbackEdgeAction.KIND;
|
|
43
42
|
elementTypeId: string;
|
|
44
43
|
sourceId: string;
|
|
45
|
-
edgeSchema?: SEdgeSchema
|
|
44
|
+
edgeSchema?: Partial<SEdgeSchema>;
|
|
46
45
|
}
|
|
47
46
|
|
|
48
47
|
export namespace DrawFeedbackEdgeAction {
|
|
@@ -52,7 +51,11 @@ export namespace DrawFeedbackEdgeAction {
|
|
|
52
51
|
return Action.hasKind(object, KIND);
|
|
53
52
|
}
|
|
54
53
|
|
|
55
|
-
export function create(options: {
|
|
54
|
+
export function create(options: {
|
|
55
|
+
elementTypeId: string;
|
|
56
|
+
sourceId: string;
|
|
57
|
+
edgeSchema?: Partial<SEdgeSchema>;
|
|
58
|
+
}): DrawFeedbackEdgeAction {
|
|
56
59
|
return {
|
|
57
60
|
kind: KIND,
|
|
58
61
|
...options
|
|
@@ -69,8 +72,7 @@ export class DrawFeedbackEdgeCommand extends FeedbackCommand {
|
|
|
69
72
|
}
|
|
70
73
|
|
|
71
74
|
execute(context: CommandExecutionContext): CommandReturn {
|
|
72
|
-
|
|
73
|
-
drawFeedbackEdge(context, this.action.sourceId, this.action.elementTypeId, feedbackEdgeSchema);
|
|
75
|
+
drawFeedbackEdge(context, this.action.sourceId, this.action.elementTypeId, this.action.edgeSchema);
|
|
74
76
|
return context.root;
|
|
75
77
|
}
|
|
76
78
|
}
|
|
@@ -195,16 +197,16 @@ export function feedbackEdgeEndId(root: SModelRoot): string {
|
|
|
195
197
|
return root.id + '_feedback_anchor';
|
|
196
198
|
}
|
|
197
199
|
|
|
198
|
-
export const defaultFeedbackEdgeSchema: SEdgeSchema = {
|
|
200
|
+
export const defaultFeedbackEdgeSchema: Partial<SEdgeSchema> = {
|
|
199
201
|
cssClasses: ['feedback-edge'],
|
|
200
202
|
opacity: 0.3
|
|
201
|
-
}
|
|
203
|
+
};
|
|
202
204
|
|
|
203
205
|
export function drawFeedbackEdge(
|
|
204
206
|
context: CommandExecutionContext,
|
|
205
207
|
sourceId: string,
|
|
206
208
|
elementTypeId: string,
|
|
207
|
-
|
|
209
|
+
edgeTemplate?: Partial<SEdgeSchema>
|
|
208
210
|
): void {
|
|
209
211
|
const root = context.root;
|
|
210
212
|
const sourceChild = root.index.getById(sourceId);
|
|
@@ -221,12 +223,16 @@ export function drawFeedbackEdge(
|
|
|
221
223
|
edgeEnd.id = feedbackEdgeEndId(root);
|
|
222
224
|
edgeEnd.position = toAbsolutePosition(source);
|
|
223
225
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
226
|
+
const edgeSchema: SEdgeSchema = {
|
|
227
|
+
id: feedbackEdgeId(root),
|
|
228
|
+
type: elementTypeId,
|
|
229
|
+
sourceId: source.id,
|
|
230
|
+
targetId: edgeEnd.id,
|
|
231
|
+
...defaultFeedbackEdgeSchema,
|
|
232
|
+
...edgeTemplate
|
|
233
|
+
};
|
|
228
234
|
|
|
229
|
-
const feedbackEdge = context.modelFactory.createElement(
|
|
235
|
+
const feedbackEdge = context.modelFactory.createElement(edgeSchema);
|
|
230
236
|
if (isRoutable(feedbackEdge)) {
|
|
231
237
|
edgeEnd.feedbackEdge = feedbackEdge;
|
|
232
238
|
root.add(edgeEnd);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2019-
|
|
2
|
+
* Copyright (c) 2019-2023 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
|
|
@@ -43,7 +43,7 @@ const toolFeedbackModule = new ContainerModule((bind, _unbind, isBound) => {
|
|
|
43
43
|
configureCommand({ bind, isBound }, RemoveMarqueeCommand);
|
|
44
44
|
|
|
45
45
|
configureView({ bind, isBound }, FeedbackEdgeEnd.TYPE, FeedbackEdgeEndView);
|
|
46
|
-
// move tool feedback: we use
|
|
46
|
+
// move tool feedback: we use sprotty's MoveCommand as client-side visual feedback
|
|
47
47
|
configureCommand({ bind, isBound }, MoveCommand);
|
|
48
48
|
|
|
49
49
|
// resize tool feedback
|
|
@@ -32,7 +32,6 @@ import {
|
|
|
32
32
|
PolylineEdgeRouter,
|
|
33
33
|
SConnectableElement,
|
|
34
34
|
SModelElement,
|
|
35
|
-
SModelRoot,
|
|
36
35
|
SRoutingHandle,
|
|
37
36
|
SwitchEditModeAction,
|
|
38
37
|
SwitchEditModeCommand,
|
|
@@ -326,14 +325,7 @@ export class FeedbackEdgeRouteMovingMouseListener extends MouseListener {
|
|
|
326
325
|
return undefined;
|
|
327
326
|
}
|
|
328
327
|
|
|
329
|
-
override
|
|
330
|
-
if (target instanceof SModelRoot && event.buttons === 0) {
|
|
331
|
-
this.mouseUp(target, event);
|
|
332
|
-
}
|
|
333
|
-
return [];
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
override mouseUp(_target: SModelElement, event: MouseEvent): Action[] {
|
|
328
|
+
override mouseUp(_target: SModelElement, _event: MouseEvent): Action[] {
|
|
337
329
|
this.pointPositionUpdater.resetPosition();
|
|
338
330
|
return [];
|
|
339
331
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2019-
|
|
2
|
+
* Copyright (c) 2019-2023 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
|
+
import {
|
|
17
17
|
Action,
|
|
18
18
|
Bounds,
|
|
19
19
|
ChangeBoundsOperation,
|
|
@@ -243,16 +243,16 @@ export class ChangeBoundsListener extends DragAwareMouseListener implements Sele
|
|
|
243
243
|
// If client routing is enabled -> delegate routingpoints of connected edges to server
|
|
244
244
|
forEachElement(target.index, isNonRoutableSelectedMovableBoundsAware, element => {
|
|
245
245
|
if (element instanceof SConnectableElement) {
|
|
246
|
-
element.incomingEdges
|
|
246
|
+
element.incomingEdges
|
|
247
|
+
.map(connectable => calcElementAndRoutingPoints(connectable, routerRegistry))
|
|
247
248
|
.forEach(ear => newRoutingPoints.push(ear));
|
|
248
|
-
element.outgoingEdges
|
|
249
|
+
element.outgoingEdges
|
|
250
|
+
.map(connectable => calcElementAndRoutingPoints(connectable, routerRegistry))
|
|
249
251
|
.forEach(ear => newRoutingPoints.push(ear));
|
|
250
252
|
}
|
|
251
253
|
});
|
|
252
254
|
}
|
|
253
|
-
return newRoutingPoints.length > 0
|
|
254
|
-
? [ChangeRoutingPointsOperation.create(newRoutingPoints)]
|
|
255
|
-
: [];
|
|
255
|
+
return newRoutingPoints.length > 0 ? [ChangeRoutingPointsOperation.create(newRoutingPoints)] : [];
|
|
256
256
|
}
|
|
257
257
|
|
|
258
258
|
protected handleResize(activeResizeHandle: SResizeHandle): Action[] {
|
|
@@ -24,7 +24,7 @@ import { DelKeyDeleteTool, MouseDeleteTool } from './delete-tool';
|
|
|
24
24
|
import { EdgeCreationTool } from './edge-creation-tool';
|
|
25
25
|
import { EdgeEditTool } from './edge-edit-tool';
|
|
26
26
|
import { EnableDefaultToolsOnFocusLossHandler } from './enable-default-tools-on-focus-loss';
|
|
27
|
-
import {
|
|
27
|
+
import { GLSPManhattanEdgeRouter } from './glsp-manhattan-edge-router';
|
|
28
28
|
import { MarqueeMouseTool } from './marquee-mouse-tool';
|
|
29
29
|
import { MarqueeTool } from './marquee-tool';
|
|
30
30
|
import { MarqueeNode } from './model';
|
|
@@ -52,8 +52,8 @@ export const toolsModule = new ContainerModule((bind, _unbind, isBound, rebind)
|
|
|
52
52
|
configureActionHandler({ bind, isBound }, TriggerNodeCreationAction.KIND, NodeCreationTool);
|
|
53
53
|
configureActionHandler({ bind, isBound }, TriggerEdgeCreationAction.KIND, EdgeCreationTool);
|
|
54
54
|
|
|
55
|
-
bind(
|
|
56
|
-
rebind(ManhattanEdgeRouter).toService(
|
|
55
|
+
bind(GLSPManhattanEdgeRouter).toSelf().inSingletonScope();
|
|
56
|
+
rebind(ManhattanEdgeRouter).toService(GLSPManhattanEdgeRouter);
|
|
57
57
|
});
|
|
58
58
|
|
|
59
59
|
export function configureMarqueeTool(context: { bind: interfaces.Bind; isBound: interfaces.IsBound }): void {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2022 EclipseSource and others.
|
|
2
|
+
* Copyright (c) 2022-2023 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
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
import { almostEquals } from '@eclipse-glsp/protocol';
|
|
18
18
|
import { ManhattanEdgeRouter, ResolvedHandleMove, SRoutableElement } from 'sprotty';
|
|
19
19
|
|
|
20
|
-
export class
|
|
20
|
+
export class GLSPManhattanEdgeRouter extends ManhattanEdgeRouter {
|
|
21
21
|
protected override applyInnerHandleMoves(edge: SRoutableElement, moves: ResolvedHandleMove[]): void {
|
|
22
22
|
const route = this.route(edge);
|
|
23
23
|
const routingPoints = edge.routingPoints;
|
|
@@ -33,9 +33,11 @@ export class GSLPManhattanEdgeRouter extends ManhattanEdgeRouter {
|
|
|
33
33
|
if (routingPoints.length === 0) {
|
|
34
34
|
routingPoints.push({ x: correctedX, y: correctedY });
|
|
35
35
|
move.handle.pointIndex = 0;
|
|
36
|
+
} else if (almostEquals(route[0].x, route[1].x)) {
|
|
37
|
+
this.alignX(routingPoints, 0, correctedX);
|
|
38
|
+
} else {
|
|
39
|
+
this.alignY(routingPoints, 0, correctedY);
|
|
36
40
|
}
|
|
37
|
-
else if (almostEquals(route[0].x, route[1].x)) { this.alignX(routingPoints, 0, correctedX); }
|
|
38
|
-
else { this.alignY(routingPoints, 0, correctedY); }
|
|
39
41
|
} else if (index < routingPoints.length - 1) {
|
|
40
42
|
if (almostEquals(routingPoints[index].x, routingPoints[index + 1].x)) {
|
|
41
43
|
this.alignX(routingPoints, index, correctedX);
|
|
@@ -47,8 +49,9 @@ export class GSLPManhattanEdgeRouter extends ManhattanEdgeRouter {
|
|
|
47
49
|
} else {
|
|
48
50
|
if (almostEquals(route[route.length - 2].x, route[route.length - 1].x)) {
|
|
49
51
|
this.alignX(routingPoints, routingPoints.length - 1, correctedX);
|
|
52
|
+
} else {
|
|
53
|
+
this.alignY(routingPoints, routingPoints.length - 1, correctedY);
|
|
50
54
|
}
|
|
51
|
-
else { this.alignY(routingPoints, routingPoints.length - 1, correctedY); }
|
|
52
55
|
}
|
|
53
56
|
break;
|
|
54
57
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2019-
|
|
2
|
+
* Copyright (c) 2019-2022 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
|