@eclipse-glsp/client 0.10.0-next.4ce46ea.160 → 0.10.0-next.6bee8eb.163
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 +1 -1
- package/lib/base/action-dispatcher.d.ts.map +1 -1
- package/lib/base/action-dispatcher.js +3 -3
- package/lib/base/action-dispatcher.js.map +1 -1
- package/lib/base/auto-complete/auto-complete-widget.js +8 -8
- package/lib/base/auto-complete/auto-complete-widget.js.map +1 -1
- package/lib/base/auto-complete/validation-decorator.js +2 -2
- package/lib/base/auto-complete/validation-decorator.js.map +1 -1
- package/lib/base/command-stack.d.ts.map +1 -1
- package/lib/base/command-stack.js +3 -3
- package/lib/base/command-stack.js.map +1 -1
- package/lib/base/di.config.js +4 -4
- package/lib/base/di.config.js.map +1 -1
- package/lib/base/drag-aware-mouse-listener.d.ts +1 -1
- package/lib/base/drag-aware-mouse-listener.d.ts.map +1 -1
- package/lib/base/drag-aware-mouse-listener.js.map +1 -1
- package/lib/base/editor-context-service.js +10 -9
- package/lib/base/editor-context-service.js.map +1 -1
- package/lib/base/focus-tracker.js +3 -3
- package/lib/base/focus-tracker.js.map +1 -1
- package/lib/base/model/model-registry.d.ts.map +1 -1
- package/lib/base/model/model-registry.js +2 -2
- package/lib/base/model/model-registry.js.map +1 -1
- package/lib/base/model/update-model-command.d.ts +1 -1
- package/lib/base/model/update-model-command.d.ts.map +1 -1
- package/lib/base/model/update-model-command.js +12 -12
- package/lib/base/model/update-model-command.js.map +1 -1
- package/lib/base/model-initialization-constraint.d.ts +2 -2
- package/lib/base/model-initialization-constraint.d.ts.map +1 -1
- package/lib/base/model-initialization-constraint.js +9 -10
- package/lib/base/model-initialization-constraint.js.map +1 -1
- package/lib/base/selection-clearing-mouse-listener.d.ts.map +1 -1
- package/lib/base/selection-clearing-mouse-listener.js +1 -1
- package/lib/base/selection-clearing-mouse-listener.js.map +1 -1
- package/lib/base/tool-manager/glsp-tool-manager.d.ts +1 -1
- package/lib/base/tool-manager/glsp-tool-manager.d.ts.map +1 -1
- package/lib/base/tool-manager/glsp-tool-manager.js +10 -10
- package/lib/base/tool-manager/glsp-tool-manager.js.map +1 -1
- package/lib/base/view/view-registry.d.ts.map +1 -1
- package/lib/base/view/view-registry.js +2 -2
- package/lib/base/view/view-registry.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 +3 -3
- package/lib/features/change-bounds/model.js.map +1 -1
- package/lib/features/change-bounds/movement-restrictor.js +4 -4
- package/lib/features/change-bounds/movement-restrictor.js.map +1 -1
- package/lib/features/change-bounds/snap.js +1 -1
- package/lib/features/change-bounds/snap.js.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/command-palette/server-command-palette-provider.js +4 -4
- package/lib/features/command-palette/server-command-palette-provider.js.map +1 -1
- package/lib/features/context-menu/delete-element-context-menu.js +2 -2
- package/lib/features/context-menu/delete-element-context-menu.js.map +1 -1
- package/lib/features/context-menu/selection-service-aware-context-menu-mouse-listener.d.ts.map +1 -1
- package/lib/features/context-menu/selection-service-aware-context-menu-mouse-listener.js +7 -7
- package/lib/features/context-menu/selection-service-aware-context-menu-mouse-listener.js.map +1 -1
- package/lib/features/context-menu/server-context-menu-provider.js +4 -4
- package/lib/features/context-menu/server-context-menu-provider.js.map +1 -1
- package/lib/features/copy-paste/copy-paste-context-menu.js +3 -3
- package/lib/features/copy-paste/copy-paste-context-menu.js.map +1 -1
- package/lib/features/copy-paste/copy-paste-handler.js +7 -7
- package/lib/features/copy-paste/copy-paste-handler.js.map +1 -1
- package/lib/features/copy-paste/di.config.js +3 -3
- package/lib/features/copy-paste/di.config.js.map +1 -1
- package/lib/features/decoration/decoration-placer.d.ts +1 -1
- package/lib/features/decoration/decoration-placer.d.ts.map +1 -1
- package/lib/features/decoration/decoration-placer.js +2 -2
- package/lib/features/decoration/decoration-placer.js.map +1 -1
- package/lib/features/edit-label/di.config.js +1 -1
- package/lib/features/edit-label/di.config.js.map +1 -1
- package/lib/features/edit-label/edit-label-tool.js +1 -1
- package/lib/features/edit-label/edit-label-tool.js.map +1 -1
- package/lib/features/edit-label/edit-label-validator.js +4 -4
- package/lib/features/edit-label/edit-label-validator.js.map +1 -1
- package/lib/features/hints/di.config.js +2 -2
- package/lib/features/hints/di.config.js.map +1 -1
- package/lib/features/hints/type-hints.d.ts +1 -1
- package/lib/features/hints/type-hints.d.ts.map +1 -1
- package/lib/features/hints/type-hints.js +13 -13
- package/lib/features/hints/type-hints.js.map +1 -1
- package/lib/features/hover/di.config.js +9 -9
- package/lib/features/hover/di.config.js.map +1 -1
- package/lib/features/hover/hover.d.ts.map +1 -1
- package/lib/features/hover/hover.js +2 -2
- package/lib/features/hover/hover.js.map +1 -1
- package/lib/features/layout/di.config.js +3 -3
- package/lib/features/layout/di.config.js.map +1 -1
- package/lib/features/layout/freeform-layout.d.ts.map +1 -1
- package/lib/features/layout/freeform-layout.js +3 -3
- package/lib/features/layout/freeform-layout.js.map +1 -1
- package/lib/features/layout/layout-commands.d.ts +1 -1
- package/lib/features/layout/layout-commands.d.ts.map +1 -1
- package/lib/features/layout/layout-commands.js +23 -20
- package/lib/features/layout/layout-commands.js.map +1 -1
- package/lib/features/layout/layout-commands.spec.js +6 -6
- package/lib/features/layout/layout-commands.spec.js.map +1 -1
- package/lib/features/layout/vbox-layout.d.ts.map +1 -1
- package/lib/features/layout/vbox-layout.js +7 -7
- package/lib/features/layout/vbox-layout.js.map +1 -1
- package/lib/features/model-source-watcher/di.config.js +1 -1
- package/lib/features/model-source-watcher/di.config.js.map +1 -1
- package/lib/features/model-source-watcher/model-source-changed-action-handler.js +7 -7
- package/lib/features/model-source-watcher/model-source-changed-action-handler.js.map +1 -1
- package/lib/features/mouse-tool/mouse-tool.d.ts +9 -5
- package/lib/features/mouse-tool/mouse-tool.d.ts.map +1 -1
- package/lib/features/mouse-tool/mouse-tool.js +9 -45
- package/lib/features/mouse-tool/mouse-tool.js.map +1 -1
- package/lib/features/navigation/di.config.js +4 -4
- package/lib/features/navigation/di.config.js.map +1 -1
- package/lib/features/navigation/navigation-action-handler.js +9 -9
- package/lib/features/navigation/navigation-action-handler.js.map +1 -1
- package/lib/features/navigation/navigation-target-resolver.js +5 -5
- package/lib/features/navigation/navigation-target-resolver.js.map +1 -1
- package/lib/features/navigation/navigation-target-resolver.spec.js +9 -9
- package/lib/features/navigation/navigation-target-resolver.spec.js.map +1 -1
- package/lib/features/reconnect/model.d.ts +1 -1
- package/lib/features/reconnect/model.d.ts.map +1 -1
- package/lib/features/reconnect/model.js +1 -1
- package/lib/features/reconnect/model.js.map +1 -1
- package/lib/features/save/save-keylistener.d.ts +1 -1
- package/lib/features/save/save-keylistener.d.ts.map +1 -1
- package/lib/features/save/save-keylistener.js +2 -2
- package/lib/features/save/save-keylistener.js.map +1 -1
- package/lib/features/select/di.config.js +4 -4
- package/lib/features/select/di.config.js.map +1 -1
- package/lib/features/select/select-feedback-action.js +4 -4
- package/lib/features/select/select-feedback-action.js.map +1 -1
- package/lib/features/select/selection-service.d.ts +3 -3
- package/lib/features/select/selection-service.d.ts.map +1 -1
- package/lib/features/select/selection-service.js +20 -18
- package/lib/features/select/selection-service.js.map +1 -1
- package/lib/features/select/selection-service.spec.js +19 -19
- package/lib/features/select/selection-service.spec.js.map +1 -1
- package/lib/features/tool-feedback/change-bounds-tool-feedback.d.ts +1 -1
- package/lib/features/tool-feedback/change-bounds-tool-feedback.d.ts.map +1 -1
- package/lib/features/tool-feedback/change-bounds-tool-feedback.js +19 -19
- package/lib/features/tool-feedback/change-bounds-tool-feedback.js.map +1 -1
- package/lib/features/tool-feedback/creation-tool-feedback.d.ts +1 -1
- package/lib/features/tool-feedback/creation-tool-feedback.d.ts.map +1 -1
- package/lib/features/tool-feedback/creation-tool-feedback.js +19 -17
- package/lib/features/tool-feedback/creation-tool-feedback.js.map +1 -1
- package/lib/features/tool-feedback/css-feedback.js +5 -5
- package/lib/features/tool-feedback/css-feedback.js.map +1 -1
- package/lib/features/tool-feedback/di.config.js +14 -14
- package/lib/features/tool-feedback/di.config.js.map +1 -1
- package/lib/features/tool-feedback/edge-edit-tool-feedback.d.ts +1 -1
- package/lib/features/tool-feedback/edge-edit-tool-feedback.d.ts.map +1 -1
- package/lib/features/tool-feedback/edge-edit-tool-feedback.js +32 -32
- package/lib/features/tool-feedback/edge-edit-tool-feedback.js.map +1 -1
- package/lib/features/tool-feedback/feedback-action-dispatcher.js +3 -3
- package/lib/features/tool-feedback/feedback-action-dispatcher.js.map +1 -1
- package/lib/features/tool-feedback/marquee-tool-feedback.d.ts +1 -1
- package/lib/features/tool-feedback/marquee-tool-feedback.d.ts.map +1 -1
- package/lib/features/tool-feedback/marquee-tool-feedback.js +3 -3
- package/lib/features/tool-feedback/marquee-tool-feedback.js.map +1 -1
- package/lib/features/tool-feedback/model.d.ts +1 -2
- package/lib/features/tool-feedback/model.d.ts.map +1 -1
- package/lib/features/tool-feedback/model.js +1 -1
- package/lib/features/tool-feedback/model.js.map +1 -1
- package/lib/features/tool-feedback/view.js +4 -4
- package/lib/features/tool-feedback/view.js.map +1 -1
- package/lib/features/tool-palette/di.config.js +2 -2
- package/lib/features/tool-palette/di.config.js.map +1 -1
- package/lib/features/tool-palette/palette-item.js +2 -2
- package/lib/features/tool-palette/palette-item.js.map +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 +16 -14
- package/lib/features/tool-palette/tool-palette.js.map +1 -1
- package/lib/features/tools/base-glsp-tool.js +6 -6
- package/lib/features/tools/base-glsp-tool.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 +31 -31
- package/lib/features/tools/change-bounds-tool.js.map +1 -1
- package/lib/features/tools/delete-tool.d.ts +1 -1
- package/lib/features/tools/delete-tool.d.ts.map +1 -1
- package/lib/features/tools/delete-tool.js +14 -14
- package/lib/features/tools/delete-tool.js.map +1 -1
- package/lib/features/tools/di.config.js +3 -3
- package/lib/features/tools/di.config.js.map +1 -1
- package/lib/features/tools/edge-creation-tool.d.ts +1 -1
- package/lib/features/tools/edge-creation-tool.d.ts.map +1 -1
- package/lib/features/tools/edge-creation-tool.js +14 -14
- package/lib/features/tools/edge-creation-tool.js.map +1 -1
- package/lib/features/tools/edge-edit-tool.d.ts +1 -1
- package/lib/features/tools/edge-edit-tool.d.ts.map +1 -1
- package/lib/features/tools/edge-edit-tool.js +23 -23
- package/lib/features/tools/edge-edit-tool.js.map +1 -1
- package/lib/features/tools/marquee-behavior.spec.js +63 -63
- package/lib/features/tools/marquee-behavior.spec.js.map +1 -1
- package/lib/features/tools/marquee-mouse-tool.d.ts +1 -1
- package/lib/features/tools/marquee-mouse-tool.d.ts.map +1 -1
- package/lib/features/tools/marquee-mouse-tool.js +15 -15
- package/lib/features/tools/marquee-mouse-tool.js.map +1 -1
- package/lib/features/tools/marquee-tool.d.ts +1 -1
- package/lib/features/tools/marquee-tool.d.ts.map +1 -1
- package/lib/features/tools/marquee-tool.js +3 -3
- package/lib/features/tools/marquee-tool.js.map +1 -1
- package/lib/features/tools/model.d.ts +1 -1
- package/lib/features/tools/model.d.ts.map +1 -1
- package/lib/features/tools/model.js +1 -1
- package/lib/features/tools/model.js.map +1 -1
- package/lib/features/tools/node-creation-tool.d.ts +1 -1
- package/lib/features/tools/node-creation-tool.d.ts.map +1 -1
- package/lib/features/tools/node-creation-tool.js +13 -13
- package/lib/features/tools/node-creation-tool.js.map +1 -1
- package/lib/features/tools/view.d.ts.map +1 -1
- package/lib/features/tools/view.js +2 -2
- package/lib/features/tools/view.js.map +1 -1
- package/lib/features/validation/di.config.js +4 -4
- package/lib/features/validation/di.config.js.map +1 -1
- package/lib/features/validation/marker-navigator.d.ts +1 -1
- package/lib/features/validation/marker-navigator.d.ts.map +1 -1
- package/lib/features/validation/marker-navigator.js +21 -21
- package/lib/features/validation/marker-navigator.js.map +1 -1
- package/lib/features/validation/marker-navigator.spec.js +21 -21
- package/lib/features/validation/marker-navigator.spec.js.map +1 -1
- package/lib/features/validation/validate.d.ts +1 -1
- package/lib/features/validation/validate.d.ts.map +1 -1
- package/lib/features/validation/validate.js +21 -21
- package/lib/features/validation/validate.js.map +1 -1
- package/lib/features/viewport/di.config.js +6 -6
- package/lib/features/viewport/di.config.js.map +1 -1
- package/lib/features/viewport/glsp-scroll-mouse-listener.d.ts +1 -1
- package/lib/features/viewport/glsp-scroll-mouse-listener.d.ts.map +1 -1
- package/lib/features/viewport/glsp-scroll-mouse-listener.js +1 -1
- package/lib/features/viewport/glsp-scroll-mouse-listener.js.map +1 -1
- package/lib/index.js +7 -3
- package/lib/index.js.map +1 -1
- package/lib/lib/model.d.ts +1 -1
- package/lib/lib/model.d.ts.map +1 -1
- package/lib/lib/model.js +1 -1
- package/lib/lib/model.js.map +1 -1
- package/lib/model-source/glsp-diagram-server.d.ts +1 -1
- package/lib/model-source/glsp-diagram-server.d.ts.map +1 -1
- package/lib/model-source/glsp-diagram-server.js +5 -5
- package/lib/model-source/glsp-diagram-server.js.map +1 -1
- package/lib/protocol-reexport.js +7 -2
- package/lib/protocol-reexport.js.map +1 -1
- package/lib/utils/argument-utils.js +5 -5
- package/lib/utils/argument-utils.js.map +1 -1
- package/lib/utils/smodel-util.d.ts +106 -9
- package/lib/utils/smodel-util.d.ts.map +1 -1
- package/lib/utils/smodel-util.js +124 -38
- package/lib/utils/smodel-util.js.map +1 -1
- package/lib/utils/viewpoint-util.js +3 -3
- package/lib/utils/viewpoint-util.js.map +1 -1
- package/lib/views/base-view-module.js +19 -19
- package/lib/views/base-view-module.js.map +1 -1
- package/lib/views/compartments.js +1 -1
- package/lib/views/compartments.js.map +1 -1
- package/lib/views/glsp-edge-view.d.ts +1 -1
- package/lib/views/glsp-edge-view.d.ts.map +1 -1
- package/lib/views/glsp-edge-view.js +1 -1
- package/lib/views/glsp-edge-view.js.map +1 -1
- package/lib/views/index.js +6 -2
- package/lib/views/index.js.map +1 -1
- package/lib/views/issue-marker-view.d.ts.map +1 -1
- package/lib/views/issue-marker-view.js +3 -3
- package/lib/views/issue-marker-view.js.map +1 -1
- package/lib/views/rounded-corner-view.d.ts.map +1 -1
- package/lib/views/rounded-corner-view.js +2 -2
- package/lib/views/rounded-corner-view.js.map +1 -1
- package/package.json +6 -17
- package/src/base/action-dispatcher.ts +4 -4
- package/src/base/command-stack.ts +3 -3
- package/src/base/drag-aware-mouse-listener.ts +4 -4
- package/src/base/model/model-registry.ts +2 -2
- package/src/base/model/update-model-command.ts +2 -2
- package/src/base/model-initialization-constraint.ts +8 -9
- package/src/base/selection-clearing-mouse-listener.ts +1 -1
- package/src/base/tool-manager/glsp-tool-manager.ts +7 -7
- package/src/base/view/view-registry.ts +2 -2
- package/src/features/change-bounds/model.ts +5 -5
- package/src/features/context-menu/selection-service-aware-context-menu-mouse-listener.ts +1 -1
- package/src/features/decoration/decoration-placer.ts +2 -2
- package/src/features/hints/type-hints.ts +2 -2
- package/src/features/hover/hover.ts +1 -1
- package/src/features/layout/freeform-layout.ts +3 -3
- package/src/features/layout/layout-commands.ts +9 -9
- package/src/features/layout/vbox-layout.ts +16 -12
- package/src/features/mouse-tool/mouse-tool.ts +14 -50
- package/src/features/reconnect/model.ts +2 -2
- package/src/features/save/save-keylistener.ts +2 -2
- package/src/features/select/selection-service.ts +5 -4
- package/src/features/tool-feedback/change-bounds-tool-feedback.ts +10 -9
- package/src/features/tool-feedback/creation-tool-feedback.ts +10 -10
- package/src/features/tool-feedback/edge-edit-tool-feedback.ts +15 -15
- package/src/features/tool-feedback/marquee-tool-feedback.ts +2 -2
- package/src/features/tool-feedback/model.ts +1 -3
- package/src/features/tool-palette/tool-palette.ts +5 -3
- package/src/features/tools/change-bounds-tool.ts +6 -6
- package/src/features/tools/delete-tool.ts +3 -3
- package/src/features/tools/edge-creation-tool.ts +3 -3
- package/src/features/tools/edge-edit-tool.ts +5 -5
- package/src/features/tools/marquee-mouse-tool.ts +6 -6
- package/src/features/tools/marquee-tool.ts +2 -2
- package/src/features/tools/model.ts +2 -2
- package/src/features/tools/node-creation-tool.ts +3 -3
- package/src/features/tools/view.tsx +2 -3
- package/src/features/validation/marker-navigator.ts +6 -4
- package/src/features/validation/validate.ts +4 -4
- package/src/features/viewport/glsp-scroll-mouse-listener.ts +2 -2
- package/src/lib/model.ts +2 -3
- package/src/model-source/glsp-diagram-server.ts +5 -5
- package/src/utils/smodel-util.ts +121 -41
- package/src/views/glsp-edge-view.tsx +4 -4
- package/src/views/issue-marker-view.tsx +2 -2
- package/src/views/rounded-corner-view.tsx +2 -3
|
@@ -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
|
|
@@ -151,7 +151,7 @@ export class ApplyMarkersAction implements MarkersAction {
|
|
|
151
151
|
@injectable()
|
|
152
152
|
export class ApplyMarkersCommand extends FeedbackCommand {
|
|
153
153
|
static KIND = 'applyMarkers';
|
|
154
|
-
readonly priority = 0;
|
|
154
|
+
override readonly priority = 0;
|
|
155
155
|
|
|
156
156
|
constructor(@inject(TYPES.Action) protected action: ApplyMarkersAction) {
|
|
157
157
|
super();
|
|
@@ -171,11 +171,11 @@ export class ApplyMarkersCommand extends FeedbackCommand {
|
|
|
171
171
|
return context.root;
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
-
undo(context: CommandExecutionContext): CommandReturn {
|
|
174
|
+
override undo(context: CommandExecutionContext): CommandReturn {
|
|
175
175
|
return context.root;
|
|
176
176
|
}
|
|
177
177
|
|
|
178
|
-
redo(context: CommandExecutionContext): CommandReturn {
|
|
178
|
+
override redo(context: CommandExecutionContext): CommandReturn {
|
|
179
179
|
return this.execute(context);
|
|
180
180
|
}
|
|
181
181
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2021 EclipseSource and others.
|
|
2
|
+
* Copyright (c) 2021-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
|
|
@@ -32,7 +32,7 @@ export class GLSPScrollMouseListener extends ScrollMouseListener implements IAct
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
mouseDown(target: SModelElement, event: MouseEvent): (Action | Promise<Action>)[] {
|
|
35
|
+
override mouseDown(target: SModelElement, event: MouseEvent): (Action | Promise<Action>)[] {
|
|
36
36
|
if (this.preventScrolling) {
|
|
37
37
|
return [];
|
|
38
38
|
}
|
package/src/lib/model.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2019 EclipseSource and others.
|
|
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
|
|
@@ -14,12 +14,11 @@
|
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
import { exportFeature, SGraph, SModelElement, SModelElementSchema, viewportFeature } from 'sprotty/lib';
|
|
17
|
-
|
|
18
17
|
import { Containable, containerFeature } from '../features/hints/model';
|
|
19
18
|
import { Saveable, saveFeature } from '../features/save/model';
|
|
20
19
|
|
|
21
20
|
export class GLSPGraph extends SGraph implements Saveable, Containable {
|
|
22
|
-
static readonly DEFAULT_FEATURES = [viewportFeature, exportFeature, saveFeature, containerFeature];
|
|
21
|
+
static override readonly DEFAULT_FEATURES = [viewportFeature, exportFeature, saveFeature, containerFeature];
|
|
23
22
|
dirty = false;
|
|
24
23
|
isContainableElement(input: string | SModelElement | SModelElementSchema): boolean {
|
|
25
24
|
return true;
|
|
@@ -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
|
|
@@ -55,21 +55,21 @@ export class GLSPDiagramServer extends DiagramServer implements SourceUriAware {
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
initialize(registry: ActionHandlerRegistry): void {
|
|
58
|
+
override initialize(registry: ActionHandlerRegistry): void {
|
|
59
59
|
registerDefaultGLSPServerActions(registry, this);
|
|
60
60
|
if (!this.clientId) {
|
|
61
61
|
this.clientId = this.viewerOptions.baseDiv;
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
handle(action: Action): void | ICommand | Action {
|
|
65
|
+
override handle(action: Action): void | ICommand | Action {
|
|
66
66
|
if (isRequestModelAction(action) && action.options) {
|
|
67
67
|
this._sourceUri = action.options.sourceUri as string;
|
|
68
68
|
}
|
|
69
69
|
return super.handle(action);
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
handleLocally(action: Action): boolean {
|
|
72
|
+
override handleLocally(action: Action): boolean {
|
|
73
73
|
if (isServerMessageAction(action)) {
|
|
74
74
|
return this.handleServerMessageAction(action);
|
|
75
75
|
}
|
|
@@ -84,7 +84,7 @@ export class GLSPDiagramServer extends DiagramServer implements SourceUriAware {
|
|
|
84
84
|
return false;
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
protected handleComputedBounds(_action: ComputedBoundsAction): boolean {
|
|
87
|
+
protected override handleComputedBounds(_action: ComputedBoundsAction): boolean {
|
|
88
88
|
return true;
|
|
89
89
|
}
|
|
90
90
|
|
package/src/utils/smodel-util.ts
CHANGED
|
@@ -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
|
|
@@ -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 { ElementAndRoutingPoints } from '@eclipse-glsp/protocol';
|
|
16
|
+
import { distinctAdd, ElementAndRoutingPoints, remove } from '@eclipse-glsp/protocol';
|
|
17
17
|
import {
|
|
18
18
|
BoundsAware,
|
|
19
19
|
ElementAndBounds,
|
|
@@ -28,93 +28,161 @@ import {
|
|
|
28
28
|
SRoutableElement,
|
|
29
29
|
SRoutingHandle
|
|
30
30
|
} from 'sprotty';
|
|
31
|
+
import { FluentIterable } from 'sprotty/lib/utils/iterable';
|
|
31
32
|
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
/**
|
|
34
|
+
* Helper type to represent a filter predicate for {@link SModelElement}s. This is used to retrieve
|
|
35
|
+
* elements from the {@link SModelIndex} that also conform to a second type `T`. Its mainly used for
|
|
36
|
+
* retrieving elements that also implement a certain model features (e.g. selectable)
|
|
37
|
+
*/
|
|
38
|
+
export type ModelFilterPredicate<T> = (modelElement: SModelElement) => modelElement is SModelElement & T;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Retrieves all elements from the given {@link SModelIndex} that match the given {@link ModelFilterPredicate}
|
|
42
|
+
* @param index The {@link SModelIndex}.
|
|
43
|
+
* @param predicate The {@link ModelFilterPredicate} that should be used.
|
|
44
|
+
* @returns A {@link FluentIterable} of all indexed element that match the predicate
|
|
45
|
+
* (correctly casted to also include the additional type of the predicate).
|
|
46
|
+
*/
|
|
47
|
+
export function filter<T>(index: SModelIndex<SModelElement>, predicate: ModelFilterPredicate<T>): FluentIterable<SModelElement & T> {
|
|
48
|
+
return index.all().filter(predicate) as FluentIterable<SModelElement & T>;
|
|
34
49
|
}
|
|
35
50
|
|
|
51
|
+
/**
|
|
52
|
+
* Retrieves all elements from the given {@link SModelIndex} that match the given {@link ModelFilterPredicate} and executes
|
|
53
|
+
* the given runnable for each element of the result set.
|
|
54
|
+
* @param index The {@link SModelIndex}.
|
|
55
|
+
* @param predicate The {@link ModelFilterPredicate} that should be used.
|
|
56
|
+
* @param runnable The runnable that should be executed for each matching element.
|
|
57
|
+
*/
|
|
36
58
|
export function forEachElement<T>(
|
|
37
|
-
|
|
38
|
-
predicate:
|
|
59
|
+
index: SModelIndex<SModelElement>,
|
|
60
|
+
predicate: ModelFilterPredicate<T>,
|
|
39
61
|
runnable: (modelElement: SModelElement & T) => void
|
|
40
62
|
): void {
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export function getMatchingElements<T>(
|
|
45
|
-
element: SModelElement,
|
|
46
|
-
predicate: (modelElement: SModelElement) => modelElement is SModelElement & T
|
|
47
|
-
): (SModelElement & T)[] {
|
|
48
|
-
const matching: (SModelElement & T)[] = [];
|
|
49
|
-
forEachElement(element, predicate, item => matching.push(item));
|
|
50
|
-
return matching;
|
|
63
|
+
filter(index, predicate).forEach(runnable);
|
|
51
64
|
}
|
|
52
65
|
|
|
53
|
-
|
|
54
|
-
|
|
66
|
+
/**
|
|
67
|
+
* Retrieves an array of all elements that match the given {@link ModelFilterPredicate} from the given {@link SModelIndex}.
|
|
68
|
+
* @param index The {@link SModelIndex}.
|
|
69
|
+
* @param predicate The {@link ModelFilterPredicate} that should be used.
|
|
70
|
+
* @returns An array of all indexed element that match the predicate
|
|
71
|
+
* (correctly casted to also include the additional type of the predicate).
|
|
72
|
+
*/
|
|
73
|
+
export function getMatchingElements<T>(index: SModelIndex<SModelElement>, predicate: ModelFilterPredicate<T>): (SModelElement & T)[] {
|
|
74
|
+
return Array.from(filter(index, predicate));
|
|
55
75
|
}
|
|
56
76
|
|
|
57
|
-
|
|
77
|
+
/**
|
|
78
|
+
* Retrieves the amount of currently selected elements in the given {@link SModelIndex}.
|
|
79
|
+
* @param index The {@link SModelIndex}.
|
|
80
|
+
* @returns The amount of selected elements.
|
|
81
|
+
*/
|
|
82
|
+
export function getSelectedElementCount(index: SModelIndex<SModelElement>): number {
|
|
58
83
|
let selected = 0;
|
|
59
|
-
|
|
60
|
-
.all()
|
|
61
|
-
.filter(isSelected)
|
|
62
|
-
.forEach(e => (selected = selected + 1));
|
|
84
|
+
forEachElement(index, isSelected, element => selected++);
|
|
63
85
|
return selected;
|
|
64
86
|
}
|
|
65
87
|
|
|
88
|
+
/**
|
|
89
|
+
* Helper function to check wether an any element is selected in the given {@link SModelIndex}.
|
|
90
|
+
* @param index The {@link SModelIndex}.
|
|
91
|
+
* @returns `true` if at least one element is selected, `false` otherwise.
|
|
92
|
+
*/
|
|
93
|
+
export function hasSelectedElements(index: SModelIndex<SModelElement>): boolean {
|
|
94
|
+
return getSelectedElementCount(index) > 0;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Helper function to check wether an element is defined. Can be used as {@link ModelFilterPredicate}.
|
|
99
|
+
* @param element The element that should be checked.
|
|
100
|
+
* @returns the type predicate for `T`
|
|
101
|
+
*/
|
|
66
102
|
export function isNotUndefined<T>(element: T | undefined): element is T {
|
|
67
103
|
return element !== undefined;
|
|
68
104
|
}
|
|
69
105
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
106
|
+
/**
|
|
107
|
+
* Adds a set of css classes to the given {@link SModelElement}.
|
|
108
|
+
* @param element The element to which the css classes should be added.
|
|
109
|
+
* @param cssClasses The set of css classes as string array.
|
|
110
|
+
*/
|
|
111
|
+
export function addCssClasses(element: SModelElement, cssClasses: string[]): void {
|
|
112
|
+
const elementCssClasses: string[] = element.cssClasses ?? [];
|
|
113
|
+
distinctAdd(elementCssClasses, ...cssClasses);
|
|
114
|
+
element.cssClasses = elementCssClasses;
|
|
79
115
|
}
|
|
80
116
|
|
|
117
|
+
/**
|
|
118
|
+
* Removes a set of css classes from the given {@link SModelElement}.
|
|
119
|
+
* @param element The element from which the css classes should be removed.
|
|
120
|
+
* @param cssClasses The set of css classes as string array.
|
|
121
|
+
*/
|
|
81
122
|
export function removeCssClasses(root: SModelElement, cssClasses: string[]): void {
|
|
82
|
-
if (root.cssClasses
|
|
123
|
+
if (!root.cssClasses || root.cssClasses.length === 0) {
|
|
83
124
|
return;
|
|
84
125
|
}
|
|
85
|
-
|
|
86
|
-
const index = root.cssClasses.indexOf(cssClass);
|
|
87
|
-
if (index !== -1) {
|
|
88
|
-
root.cssClasses.splice(root.cssClasses.indexOf(cssClass), 1);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
126
|
+
remove(root.cssClasses, ...cssClasses);
|
|
91
127
|
}
|
|
92
128
|
|
|
93
129
|
export function isNonRoutableSelectedMovableBoundsAware(element: SModelElement): element is SelectableBoundsAware {
|
|
94
130
|
return isNonRoutableSelectedBoundsAware(element) && isMoveable(element);
|
|
95
131
|
}
|
|
96
132
|
|
|
133
|
+
/**
|
|
134
|
+
* A typeguard function to check wether a given {@link SModelElement} implements the {@link BoundsAware} model feature,
|
|
135
|
+
* the {@link Selectable} model feature and is actually selected. In addition, the element must not be a {@link SRoutableElement}.
|
|
136
|
+
* @param element The element to check.
|
|
137
|
+
* @returns A type predicate indicating wether the element is of type {@link SelectableBoundsAware}.
|
|
138
|
+
*/
|
|
97
139
|
export function isNonRoutableSelectedBoundsAware(element: SModelElement): element is SelectableBoundsAware {
|
|
98
140
|
return isBoundsAware(element) && isSelected(element) && !isRoutable(element);
|
|
99
141
|
}
|
|
100
142
|
|
|
143
|
+
/**
|
|
144
|
+
* A type guard function to check wether a given {@link SModelElement} is a {@link SRoutableElement}.
|
|
145
|
+
* @param element The element to check.
|
|
146
|
+
* @returns A type predicate indicating wether the element is a {@link SRoutableElement}.
|
|
147
|
+
*/
|
|
101
148
|
export function isRoutable<T extends SModelElement>(element: T): element is T & SRoutableElement {
|
|
102
149
|
return element instanceof SRoutableElement && (element as any).routingPoints !== undefined;
|
|
103
150
|
}
|
|
104
151
|
|
|
152
|
+
/**
|
|
153
|
+
* A typeguard function to check wether a given {@link SModelElement} is a {@link SRoutingHandle}.
|
|
154
|
+
* @param element The element to check.
|
|
155
|
+
* @returns A type predicate indicating wether the element is a {@link SRoutingHandle}
|
|
156
|
+
*/
|
|
105
157
|
export function isRoutingHandle(element: SModelElement | undefined): element is SRoutingHandle {
|
|
106
158
|
return element !== undefined && element instanceof SRoutingHandle;
|
|
107
159
|
}
|
|
108
160
|
|
|
109
|
-
|
|
161
|
+
/**
|
|
162
|
+
* A typeguard function to check wether a given {@link SModelElement} implements the {@link Selectable} model feature and
|
|
163
|
+
* the {@link BoundsAware} model feature.
|
|
164
|
+
* @returns A type predicate indicating wether the element is of type {@link SelectableBoundsAware}.
|
|
165
|
+
*/
|
|
166
|
+
export function isSelectableAndBoundsAware(element: SModelElement): element is SelectableBoundsAware {
|
|
110
167
|
return isSelectable(element) && isBoundsAware(element);
|
|
111
168
|
}
|
|
112
169
|
|
|
170
|
+
/**
|
|
171
|
+
* Union type to describe {@link SModelElement}s that implement the {@link Selectable} and {@link BoundsAware} feature.
|
|
172
|
+
*/
|
|
113
173
|
export type SelectableBoundsAware = SModelElement & BoundsAware & Selectable;
|
|
114
174
|
|
|
175
|
+
/**
|
|
176
|
+
* Union type to describe {@link SModelElement}s that implement the {@link BoundsAware} feature.
|
|
177
|
+
*/
|
|
115
178
|
export type BoundsAwareModelElement = SModelElement & BoundsAware;
|
|
116
179
|
|
|
117
|
-
|
|
180
|
+
/**
|
|
181
|
+
* Helper function to translate a given {@link SModelElement} into its corresponding {@link ElementAndBounds} representation.
|
|
182
|
+
* @param element The element to translate.
|
|
183
|
+
* @returns The corresponding {@link ElementAndBounds} for the given element.
|
|
184
|
+
*/
|
|
185
|
+
export function toElementAndBounds(element: BoundsAwareModelElement): ElementAndBounds {
|
|
118
186
|
return {
|
|
119
187
|
elementId: element.id,
|
|
120
188
|
newPosition: {
|
|
@@ -128,6 +196,12 @@ export function toElementAndBounds(element: SModelElement & BoundsAware): Elemen
|
|
|
128
196
|
};
|
|
129
197
|
}
|
|
130
198
|
|
|
199
|
+
/**
|
|
200
|
+
* Helper function to translate a given {@link SRoutableElement} into its corresponding
|
|
201
|
+
* {@ElementAndRoutingPoints ElementAndBounds} representation.
|
|
202
|
+
* @param element The element to translate.
|
|
203
|
+
* @returns The corresponding {@link ElementAndRoutingPoints} for the given element.
|
|
204
|
+
*/
|
|
131
205
|
export function toElementAndRoutingPoints(element: SRoutableElement): ElementAndRoutingPoints {
|
|
132
206
|
return {
|
|
133
207
|
elementId: element.id,
|
|
@@ -144,6 +218,12 @@ export function hasCompatibleType(input: SModelElement | SModelElementSchema | s
|
|
|
144
218
|
return inputType === type ? true : inputType.split(':').includes(type);
|
|
145
219
|
}
|
|
146
220
|
|
|
221
|
+
/**
|
|
222
|
+
* Convenience function to retrieve the model element type from a given input. The input
|
|
223
|
+
* can either be a {@link SModelElement}, {@link SModelElementSchema} or a string.
|
|
224
|
+
* @param input The type input.
|
|
225
|
+
* @returns The corresponding model type as string.
|
|
226
|
+
*/
|
|
147
227
|
export function getElementTypeId(input: SModelElement | SModelElementSchema | string): string {
|
|
148
228
|
if (typeof input === 'string') {
|
|
149
229
|
return input as string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2021 EclipseSource and others.
|
|
2
|
+
* Copyright (c) 2021-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
|
|
@@ -24,7 +24,7 @@ const JSX = { createElement: svg };
|
|
|
24
24
|
|
|
25
25
|
@injectable()
|
|
26
26
|
export class GEdgeView extends PolylineEdgeView {
|
|
27
|
-
render(edge: Readonly<SEdge>, context: RenderingContext): VNode {
|
|
27
|
+
override render(edge: Readonly<SEdge>, context: RenderingContext): VNode {
|
|
28
28
|
const router = this.edgeRouterRegistry.get(edge.routerKind);
|
|
29
29
|
const route = router.route(edge);
|
|
30
30
|
if (route.length === 0) {
|
|
@@ -44,11 +44,11 @@ export class GEdgeView extends PolylineEdgeView {
|
|
|
44
44
|
return {};
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
protected renderLine(_edge: SEdge, segments: Point[], _context: RenderingContext): VNode {
|
|
47
|
+
protected override renderLine(_edge: SEdge, segments: Point[], _context: RenderingContext): VNode {
|
|
48
48
|
return <path d={this.createPathForSegments(segments)} />;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
protected renderAdditionals(edge: SEdge, segments: Point[], _context: RenderingContext): VNode[] {
|
|
51
|
+
protected override renderAdditionals(edge: SEdge, segments: Point[], _context: RenderingContext): VNode[] {
|
|
52
52
|
// for additional padding we draw another transparent path with larger stroke width
|
|
53
53
|
const edgePadding = EdgePadding.from(edge);
|
|
54
54
|
return edgePadding ? [this.renderMouseHandle(segments, edgePadding)] : [];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2020-
|
|
2
|
+
* Copyright (c) 2020-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
|
|
@@ -23,7 +23,7 @@ const JSX = { createElement: svg };
|
|
|
23
23
|
|
|
24
24
|
@injectable()
|
|
25
25
|
export class GIssueMarkerView extends IssueMarkerView {
|
|
26
|
-
render(marker: SIssueMarker, _context: RenderingContext): VNode {
|
|
26
|
+
override render(marker: SIssueMarker, _context: RenderingContext): VNode {
|
|
27
27
|
const maxSeverity = super.getMaxSeverity(marker);
|
|
28
28
|
const group = (
|
|
29
29
|
<g class-sprotty-issue={true}>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2021 EclipseSource and others.
|
|
2
|
+
* Copyright (c) 2021-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
|
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
import { injectable } from 'inversify';
|
|
17
17
|
import { Classes, VNode } from 'snabbdom';
|
|
18
18
|
import { Hoverable, RectangularNodeView, RenderingContext, Selectable, SNode, SPort, SShapeElement, svg } from 'sprotty';
|
|
19
|
-
|
|
20
19
|
import { CornerRadius } from '../utils/argument-utils';
|
|
21
20
|
import { RoundedCornerWrapper } from './rounded-corner';
|
|
22
21
|
|
|
@@ -25,7 +24,7 @@ const JSX = { createElement: svg };
|
|
|
25
24
|
|
|
26
25
|
@injectable()
|
|
27
26
|
export class RoundedCornerNodeView extends RectangularNodeView {
|
|
28
|
-
render(node: Readonly<SShapeElement & Hoverable & Selectable>, context: RenderingContext): VNode | undefined {
|
|
27
|
+
override render(node: Readonly<SShapeElement & Hoverable & Selectable>, context: RenderingContext): VNode | undefined {
|
|
29
28
|
const cornerRadius = CornerRadius.from(node);
|
|
30
29
|
if (!cornerRadius) {
|
|
31
30
|
return this.renderWithoutRadius(node, context);
|