@eclipse-glsp/client 1.1.0-next.383e4e9.264 → 1.1.0-next.3d1b3e6.280
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/css/decoration.css +0 -7
- package/css/glsp-sprotty.css +7 -0
- package/css/key-shortcut.css +5 -1
- package/{lib/base/source-uri-aware.js → css/navigation.css} +11 -9
- package/css/status-overlay.css +75 -0
- package/css/toast.css +45 -0
- package/lib/base/action-dispatcher.d.ts +8 -2
- package/lib/base/action-dispatcher.d.ts.map +1 -1
- package/lib/base/action-dispatcher.js +15 -7
- package/lib/base/action-dispatcher.js.map +1 -1
- package/lib/base/action-dispatcher.spec.d.ts +2 -0
- package/lib/base/action-dispatcher.spec.d.ts.map +1 -0
- package/lib/base/action-dispatcher.spec.js +78 -0
- package/lib/base/action-dispatcher.spec.js.map +1 -0
- package/lib/base/action-handler-registry.d.ts +25 -0
- package/lib/base/action-handler-registry.d.ts.map +1 -0
- package/lib/{features/tools/base-glsp-creation-tool.js → base/action-handler-registry.js} +20 -25
- package/lib/base/action-handler-registry.js.map +1 -0
- package/lib/base/default.module.d.ts +1 -10
- package/lib/base/default.module.d.ts.map +1 -1
- package/lib/base/default.module.js +20 -30
- package/lib/base/default.module.js.map +1 -1
- package/lib/base/editor-context-service.d.ts +17 -5
- package/lib/base/editor-context-service.d.ts.map +1 -1
- package/lib/base/editor-context-service.js +41 -14
- package/lib/base/editor-context-service.js.map +1 -1
- package/lib/base/feedback/feedback-action-dispatcher.d.ts.map +1 -1
- package/lib/base/feedback/feedback-action-dispatcher.js +5 -3
- package/lib/base/feedback/feedback-action-dispatcher.js.map +1 -1
- package/lib/base/focus/focus-tracker.d.ts +4 -0
- package/lib/base/focus/focus-tracker.d.ts.map +1 -1
- package/lib/base/focus/focus-tracker.js +12 -5
- package/lib/base/focus/focus-tracker.js.map +1 -1
- package/lib/base/model/diagram-loader.d.ts +116 -0
- package/lib/base/model/diagram-loader.d.ts.map +1 -0
- package/lib/base/model/diagram-loader.js +130 -0
- package/lib/base/model/diagram-loader.js.map +1 -0
- package/lib/base/model/glsp-model-source.d.ts +74 -0
- package/lib/base/model/glsp-model-source.d.ts.map +1 -0
- package/lib/base/model/glsp-model-source.js +178 -0
- package/lib/base/model/glsp-model-source.js.map +1 -0
- package/lib/base/{model-initialization-constraint.d.ts → model/model-initialization-constraint.d.ts} +24 -3
- package/lib/base/model/model-initialization-constraint.d.ts.map +1 -0
- package/lib/base/{model-initialization-constraint.js → model/model-initialization-constraint.js} +20 -10
- package/lib/base/model/model-initialization-constraint.js.map +1 -0
- package/lib/base/model/model-initialization-constraint.spec.d.ts +2 -0
- package/lib/base/model/model-initialization-constraint.spec.d.ts.map +1 -0
- package/lib/base/model/model-initialization-constraint.spec.js +97 -0
- package/lib/base/model/model-initialization-constraint.spec.js.map +1 -0
- package/lib/base/selection-service.spec.js +9 -8
- package/lib/base/selection-service.spec.js.map +1 -1
- package/lib/base/tool-manager/tool-manager.d.ts +82 -0
- package/lib/base/tool-manager/tool-manager.d.ts.map +1 -0
- package/lib/base/tool-manager/tool-manager.js +140 -0
- package/lib/base/tool-manager/tool-manager.js.map +1 -0
- package/lib/base/tool-manager/tool.d.ts +54 -0
- package/lib/base/tool-manager/tool.d.ts.map +1 -0
- package/lib/base/tool-manager/tool.js +60 -0
- package/lib/base/tool-manager/tool.js.map +1 -0
- package/lib/default-modules.d.ts +20 -26
- package/lib/default-modules.d.ts.map +1 -1
- package/lib/default-modules.js +31 -29
- package/lib/default-modules.js.map +1 -1
- package/lib/features/accessibility/accessibility-module.d.ts.map +1 -1
- package/lib/features/accessibility/accessibility-module.js +6 -0
- package/lib/features/accessibility/accessibility-module.js.map +1 -1
- package/lib/features/accessibility/element-navigation/diagram-navigation-tool.d.ts +65 -0
- package/lib/features/accessibility/element-navigation/diagram-navigation-tool.d.ts.map +1 -0
- package/lib/features/accessibility/element-navigation/diagram-navigation-tool.js +290 -0
- package/lib/features/accessibility/element-navigation/diagram-navigation-tool.js.map +1 -0
- package/lib/features/accessibility/element-navigation/element-navigation-module.d.ts +24 -0
- package/lib/features/accessibility/element-navigation/element-navigation-module.d.ts.map +1 -0
- package/lib/features/accessibility/element-navigation/element-navigation-module.js +38 -0
- package/lib/features/accessibility/element-navigation/element-navigation-module.js.map +1 -0
- package/lib/features/accessibility/element-navigation/element-navigator.d.ts +26 -0
- package/lib/features/accessibility/element-navigation/element-navigator.d.ts.map +1 -0
- package/{src/base/source-uri-aware.ts → lib/features/accessibility/element-navigation/element-navigator.js} +4 -9
- package/lib/features/accessibility/element-navigation/element-navigator.js.map +1 -0
- package/lib/features/accessibility/element-navigation/left-right-top-bottom-navigator.d.ts +28 -0
- package/lib/features/accessibility/element-navigation/left-right-top-bottom-navigator.d.ts.map +1 -0
- package/lib/features/accessibility/element-navigation/left-right-top-bottom-navigator.js +104 -0
- package/lib/features/accessibility/element-navigation/left-right-top-bottom-navigator.js.map +1 -0
- package/lib/features/accessibility/element-navigation/local-element-navigator.d.ts +35 -0
- package/lib/features/accessibility/element-navigation/local-element-navigator.d.ts.map +1 -0
- package/lib/features/accessibility/element-navigation/local-element-navigator.js +117 -0
- package/lib/features/accessibility/element-navigation/local-element-navigator.js.map +1 -0
- package/lib/features/accessibility/element-navigation/position-navigator.d.ts +32 -0
- package/lib/features/accessibility/element-navigation/position-navigator.d.ts.map +1 -0
- package/lib/features/accessibility/element-navigation/position-navigator.js +80 -0
- package/lib/features/accessibility/element-navigation/position-navigator.js.map +1 -0
- package/lib/features/accessibility/focus-tracker/focus-tracker-module.d.ts +23 -0
- package/lib/features/accessibility/focus-tracker/focus-tracker-module.d.ts.map +1 -0
- package/lib/features/accessibility/focus-tracker/focus-tracker-module.js +33 -0
- package/lib/features/accessibility/focus-tracker/focus-tracker-module.js.map +1 -0
- package/lib/features/accessibility/focus-tracker/focus-tracker-tool.d.ts +37 -0
- package/lib/features/accessibility/focus-tracker/focus-tracker-tool.d.ts.map +1 -0
- package/lib/features/accessibility/focus-tracker/focus-tracker-tool.js +133 -0
- package/lib/features/accessibility/focus-tracker/focus-tracker-tool.js.map +1 -0
- package/lib/features/accessibility/key-shortcut/accessible-key-shortcut-tool.d.ts +2 -2
- package/lib/features/accessibility/key-shortcut/accessible-key-shortcut-tool.d.ts.map +1 -1
- package/lib/features/accessibility/key-shortcut/accessible-key-shortcut-tool.js +2 -2
- package/lib/features/accessibility/key-shortcut/accessible-key-shortcut-tool.js.map +1 -1
- package/lib/features/accessibility/key-shortcut/accessible-key-shortcut.d.ts +1 -0
- package/lib/features/accessibility/key-shortcut/accessible-key-shortcut.d.ts.map +1 -1
- package/lib/features/accessibility/key-shortcut/accessible-key-shortcut.js +15 -3
- package/lib/features/accessibility/key-shortcut/accessible-key-shortcut.js.map +1 -1
- package/lib/features/accessibility/resize-key-tool/resize-key-tool.d.ts +2 -2
- package/lib/features/accessibility/resize-key-tool/resize-key-tool.d.ts.map +1 -1
- package/lib/features/accessibility/resize-key-tool/resize-key-tool.js +22 -15
- package/lib/features/accessibility/resize-key-tool/resize-key-tool.js.map +1 -1
- package/lib/features/accessibility/search/search-palette.d.ts.map +1 -1
- package/lib/features/accessibility/search/search-palette.js +3 -1
- package/lib/features/accessibility/search/search-palette.js.map +1 -1
- package/lib/features/accessibility/search/search-tool.d.ts +2 -1
- package/lib/features/accessibility/search/search-tool.d.ts.map +1 -1
- package/lib/features/accessibility/search/search-tool.js +4 -8
- package/lib/features/accessibility/search/search-tool.js.map +1 -1
- package/lib/features/accessibility/toast/messages.json +16 -0
- package/lib/features/accessibility/toast/toast-handler.d.ts +45 -0
- package/lib/features/accessibility/toast/toast-handler.d.ts.map +1 -0
- package/lib/features/accessibility/toast/toast-handler.js +54 -0
- package/lib/features/accessibility/toast/toast-handler.js.map +1 -0
- package/lib/features/accessibility/toast/toast-module.d.ts +24 -0
- package/lib/features/accessibility/toast/toast-module.d.ts.map +1 -0
- package/lib/features/accessibility/toast/toast-module.js +38 -0
- package/lib/features/accessibility/toast/toast-module.js.map +1 -0
- package/lib/features/accessibility/toast/toast-tool.d.ts +43 -0
- package/lib/features/accessibility/toast/toast-tool.d.ts.map +1 -0
- package/lib/features/accessibility/toast/toast-tool.js +115 -0
- package/lib/features/accessibility/toast/toast-tool.js.map +1 -0
- package/lib/features/accessibility/view-key-tools/deselect-key-tool.d.ts +2 -2
- package/lib/features/accessibility/view-key-tools/deselect-key-tool.d.ts.map +1 -1
- package/lib/features/accessibility/view-key-tools/movement-key-tool.d.ts +2 -2
- package/lib/features/accessibility/view-key-tools/movement-key-tool.d.ts.map +1 -1
- package/lib/features/accessibility/view-key-tools/movement-key-tool.js +4 -8
- package/lib/features/accessibility/view-key-tools/movement-key-tool.js.map +1 -1
- package/lib/features/accessibility/view-key-tools/zoom-key-tool.d.ts +2 -2
- package/lib/features/accessibility/view-key-tools/zoom-key-tool.d.ts.map +1 -1
- package/lib/features/accessibility/view-key-tools/zoom-key-tool.js +9 -13
- package/lib/features/accessibility/view-key-tools/zoom-key-tool.js.map +1 -1
- package/lib/features/bounds/bounds-module.d.ts.map +1 -1
- package/lib/features/bounds/bounds-module.js +2 -1
- package/lib/features/bounds/bounds-module.js.map +1 -1
- package/lib/features/command-palette/command-palette-tool.d.ts +2 -1
- package/lib/features/command-palette/command-palette-tool.d.ts.map +1 -1
- package/lib/features/command-palette/command-palette-tool.js.map +1 -1
- package/lib/features/command-palette/server-command-palette-provider.d.ts.map +1 -1
- package/lib/features/command-palette/server-command-palette-provider.js +3 -2
- package/lib/features/command-palette/server-command-palette-provider.js.map +1 -1
- package/lib/features/context-menu/context-menu-module.d.ts.map +1 -1
- package/lib/features/context-menu/context-menu-module.js +8 -8
- package/lib/features/context-menu/context-menu-module.js.map +1 -1
- package/lib/features/context-menu/{selection-service-aware-context-menu-mouse-listener.d.ts → glsp-context-menu-mouse-listener.d.ts} +2 -4
- package/lib/features/context-menu/glsp-context-menu-mouse-listener.d.ts.map +1 -0
- package/lib/features/context-menu/{selection-service-aware-context-menu-mouse-listener.js → glsp-context-menu-mouse-listener.js} +7 -12
- package/lib/features/context-menu/glsp-context-menu-mouse-listener.js.map +1 -0
- package/lib/features/context-menu/server-context-menu-provider.d.ts +1 -1
- package/lib/features/context-menu/server-context-menu-provider.d.ts.map +1 -1
- package/lib/features/context-menu/server-context-menu-provider.js +3 -2
- package/lib/features/context-menu/server-context-menu-provider.js.map +1 -1
- package/lib/features/copy-paste/copy-paste-context-menu.d.ts.map +1 -1
- package/lib/features/copy-paste/copy-paste-context-menu.js +1 -4
- package/lib/features/copy-paste/copy-paste-context-menu.js.map +1 -1
- package/lib/features/hints/type-hints-module.d.ts.map +1 -1
- package/lib/features/hints/type-hints-module.js +6 -5
- package/lib/features/hints/type-hints-module.js.map +1 -1
- package/lib/features/hints/type-hints.d.ts +6 -2
- package/lib/features/hints/type-hints.d.ts.map +1 -1
- package/lib/features/hints/type-hints.js +8 -0
- package/lib/features/hints/type-hints.js.map +1 -1
- package/lib/features/hover/hover-module.d.ts.map +1 -1
- package/lib/features/hover/hover-module.js +3 -2
- package/lib/features/hover/hover-module.js.map +1 -1
- package/lib/features/hover/hover.d.ts.map +1 -1
- package/lib/features/hover/hover.js +3 -2
- package/lib/features/hover/hover.js.map +1 -1
- package/lib/features/label-edit/edit-label-tool.d.ts +2 -2
- package/lib/features/label-edit/edit-label-tool.d.ts.map +1 -1
- package/lib/features/label-edit/edit-label-tool.js +2 -2
- package/lib/features/label-edit/edit-label-tool.js.map +1 -1
- package/lib/features/label-edit/edit-label-validator.d.ts.map +1 -1
- package/lib/features/label-edit/edit-label-validator.js +3 -2
- package/lib/features/label-edit/edit-label-validator.js.map +1 -1
- package/lib/features/navigation/navigation-action-handler.d.ts.map +1 -1
- package/lib/features/navigation/navigation-action-handler.js +1 -4
- package/lib/features/navigation/navigation-action-handler.js.map +1 -1
- package/lib/features/navigation/navigation-target-resolver.d.ts +3 -3
- package/lib/features/navigation/navigation-target-resolver.d.ts.map +1 -1
- package/lib/features/navigation/navigation-target-resolver.js +5 -7
- package/lib/features/navigation/navigation-target-resolver.js.map +1 -1
- package/lib/features/select/select-mouse-listener.d.ts +4 -2
- package/lib/features/select/select-mouse-listener.d.ts.map +1 -1
- package/lib/features/select/select-mouse-listener.js +17 -58
- package/lib/features/select/select-mouse-listener.js.map +1 -1
- package/lib/features/source-model-watcher/source-model-changed-action-handler.d.ts.map +1 -1
- package/lib/features/source-model-watcher/source-model-changed-action-handler.js +1 -4
- package/lib/features/source-model-watcher/source-model-changed-action-handler.js.map +1 -1
- package/lib/features/status/status-module.d.ts +19 -0
- package/lib/features/status/status-module.d.ts.map +1 -0
- package/lib/features/status/status-module.js +28 -0
- package/lib/features/status/status-module.js.map +1 -0
- package/lib/features/status/status-overlay.d.ts +25 -0
- package/lib/features/status/status-overlay.d.ts.map +1 -0
- package/lib/features/status/status-overlay.js +124 -0
- package/lib/features/status/status-overlay.js.map +1 -0
- package/lib/features/tool-palette/tool-palette-module.d.ts.map +1 -1
- package/lib/features/tool-palette/tool-palette-module.js +3 -2
- package/lib/features/tool-palette/tool-palette-module.js.map +1 -1
- package/lib/features/tool-palette/tool-palette.d.ts +10 -8
- package/lib/features/tool-palette/tool-palette.d.ts.map +1 -1
- package/lib/features/tool-palette/tool-palette.js +36 -29
- package/lib/features/tool-palette/tool-palette.js.map +1 -1
- package/lib/features/tools/{base-glsp-tool.d.ts → base-tools.d.ts} +14 -4
- package/lib/features/tools/base-tools.d.ts.map +1 -0
- package/lib/features/tools/{base-glsp-tool.js → base-tools.js} +31 -10
- package/lib/features/tools/base-tools.js.map +1 -0
- package/lib/features/tools/change-bounds/change-bounds-tool.d.ts +2 -2
- package/lib/features/tools/change-bounds/change-bounds-tool.d.ts.map +1 -1
- package/lib/features/tools/change-bounds/change-bounds-tool.js +2 -2
- package/lib/features/tools/change-bounds/change-bounds-tool.js.map +1 -1
- package/lib/features/tools/deletion/delete-tool.d.ts +4 -4
- package/lib/features/tools/deletion/delete-tool.d.ts.map +1 -1
- package/lib/features/tools/deletion/delete-tool.js +4 -3
- package/lib/features/tools/deletion/delete-tool.js.map +1 -1
- package/lib/features/tools/edge-creation/edge-creation-tool.d.ts +2 -2
- package/lib/features/tools/edge-creation/edge-creation-tool.d.ts.map +1 -1
- package/lib/features/tools/edge-creation/edge-creation-tool.js +5 -4
- package/lib/features/tools/edge-creation/edge-creation-tool.js.map +1 -1
- package/lib/features/tools/edge-edit/edge-edit-tool.d.ts +2 -2
- package/lib/features/tools/edge-edit/edge-edit-tool.d.ts.map +1 -1
- package/lib/features/tools/edge-edit/edge-edit-tool.js +2 -2
- package/lib/features/tools/edge-edit/edge-edit-tool.js.map +1 -1
- package/lib/features/tools/marquee-selection/marquee-mouse-tool.d.ts +2 -2
- package/lib/features/tools/marquee-selection/marquee-mouse-tool.d.ts.map +1 -1
- package/lib/features/tools/marquee-selection/marquee-mouse-tool.js +5 -4
- package/lib/features/tools/marquee-selection/marquee-mouse-tool.js.map +1 -1
- package/lib/features/tools/marquee-selection/marquee-tool.d.ts +2 -2
- package/lib/features/tools/marquee-selection/marquee-tool.d.ts.map +1 -1
- package/lib/features/tools/marquee-selection/marquee-tool.js +4 -3
- package/lib/features/tools/marquee-selection/marquee-tool.js.map +1 -1
- package/lib/features/tools/node-creation/node-creation-tool.d.ts +2 -2
- package/lib/features/tools/node-creation/node-creation-tool.d.ts.map +1 -1
- package/lib/features/tools/node-creation/node-creation-tool.js +4 -3
- package/lib/features/tools/node-creation/node-creation-tool.js.map +1 -1
- package/lib/features/tools/tool-focus-loss-module.d.ts.map +1 -1
- package/lib/features/tools/tool-focus-loss-module.js +2 -1
- package/lib/features/tools/tool-focus-loss-module.js.map +1 -1
- package/lib/features/validation/validate.js +1 -1
- package/lib/features/validation/validate.js.map +1 -1
- package/lib/features/viewport/glsp-scroll-mouse-listener.d.ts.map +1 -1
- package/lib/features/viewport/glsp-scroll-mouse-listener.js +3 -2
- package/lib/features/viewport/glsp-scroll-mouse-listener.js.map +1 -1
- package/lib/features/viewport/reposition.d.ts +38 -0
- package/lib/features/viewport/reposition.d.ts.map +1 -0
- package/lib/features/viewport/reposition.js +109 -0
- package/lib/features/viewport/reposition.js.map +1 -0
- package/lib/features/viewport/viewport-modules.d.ts.map +1 -1
- package/lib/features/viewport/viewport-modules.js +5 -2
- package/lib/features/viewport/viewport-modules.js.map +1 -1
- package/lib/glsp-sprotty/augmented-actions.d.ts +2 -10
- package/lib/glsp-sprotty/augmented-actions.d.ts.map +1 -1
- package/lib/glsp-sprotty/augmented-actions.js +2 -6
- package/lib/glsp-sprotty/augmented-actions.js.map +1 -1
- package/lib/glsp-sprotty/index.d.ts +3 -6
- package/lib/glsp-sprotty/index.d.ts.map +1 -1
- package/lib/glsp-sprotty/index.js +4 -7
- package/lib/glsp-sprotty/index.js.map +1 -1
- package/lib/glsp-sprotty/types.d.ts +5 -82
- package/lib/glsp-sprotty/types.d.ts.map +1 -1
- package/lib/glsp-sprotty/types.js +2 -8
- package/lib/glsp-sprotty/types.js.map +1 -1
- package/lib/index.d.ts +17 -7
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +17 -7
- package/lib/index.js.map +1 -1
- package/lib/standalone-modules.d.ts +11 -2
- package/lib/standalone-modules.d.ts.map +1 -1
- package/lib/standalone-modules.js +37 -1
- package/lib/standalone-modules.js.map +1 -1
- package/lib/views/base-view-module.d.ts.map +1 -1
- package/lib/views/base-view-module.js +2 -1
- package/lib/views/base-view-module.js.map +1 -1
- package/lib/views/glsp-projection-view.d.ts +2 -1
- package/lib/views/glsp-projection-view.d.ts.map +1 -1
- package/lib/views/glsp-projection-view.js +11 -2
- package/lib/views/glsp-projection-view.js.map +1 -1
- package/package.json +4 -4
- package/src/base/action-dispatcher.spec.ts +87 -0
- package/src/base/action-dispatcher.ts +24 -10
- package/src/{features/tools/base-glsp-creation-tool.ts → base/action-handler-registry.ts} +10 -20
- package/src/base/default.module.ts +21 -34
- package/src/base/editor-context-service.ts +49 -16
- package/src/base/feedback/feedback-action-dispatcher.ts +5 -3
- package/src/base/focus/focus-tracker.ts +16 -5
- package/src/base/model/diagram-loader.ts +215 -0
- package/src/base/model/glsp-model-source.ts +199 -0
- package/src/base/model/model-initialization-constraint.spec.ts +95 -0
- package/src/base/{model-initialization-constraint.ts → model/model-initialization-constraint.ts} +43 -10
- package/src/base/selection-service.spec.ts +10 -9
- package/src/base/tool-manager/tool-manager.ts +183 -0
- package/src/base/tool-manager/tool.ts +85 -0
- package/src/default-modules.ts +37 -28
- package/src/features/accessibility/README.md +18 -0
- package/src/features/accessibility/accessibility-module.ts +6 -1
- package/src/features/accessibility/element-navigation/diagram-navigation-tool.ts +307 -0
- package/src/features/accessibility/element-navigation/element-navigation-module.ts +36 -0
- package/src/features/accessibility/element-navigation/element-navigator.ts +57 -0
- package/src/features/accessibility/element-navigation/left-right-top-bottom-navigator.ts +113 -0
- package/src/features/accessibility/element-navigation/local-element-navigator.ts +147 -0
- package/src/features/accessibility/element-navigation/position-navigator.ts +102 -0
- package/src/features/accessibility/focus-tracker/focus-tracker-module.ts +32 -0
- package/src/features/accessibility/focus-tracker/focus-tracker-tool.ts +129 -0
- package/src/features/accessibility/key-shortcut/accessible-key-shortcut-tool.ts +3 -3
- package/src/features/accessibility/key-shortcut/accessible-key-shortcut.ts +18 -3
- package/src/features/accessibility/resize-key-tool/resize-key-tool.ts +30 -16
- package/src/features/accessibility/search/search-palette.ts +4 -2
- package/src/features/accessibility/search/search-tool.ts +8 -9
- package/src/features/accessibility/toast/messages.json +16 -0
- package/src/features/accessibility/toast/toast-handler.ts +69 -0
- package/src/features/accessibility/toast/toast-module.ts +36 -0
- package/src/features/accessibility/toast/toast-tool.ts +108 -0
- package/src/features/accessibility/view-key-tools/deselect-key-tool.ts +2 -2
- package/src/features/accessibility/view-key-tools/movement-key-tool.ts +8 -10
- package/src/features/accessibility/view-key-tools/zoom-key-tool.ts +13 -15
- package/src/features/bounds/bounds-module.ts +2 -2
- package/src/features/command-palette/command-palette-tool.ts +2 -1
- package/src/features/command-palette/server-command-palette-provider.ts +3 -2
- package/src/features/context-menu/context-menu-module.ts +11 -12
- package/src/features/context-menu/{selection-service-aware-context-menu-mouse-listener.ts → glsp-context-menu-mouse-listener.ts} +1 -5
- package/src/features/context-menu/server-context-menu-provider.ts +3 -2
- package/src/features/copy-paste/copy-paste-context-menu.ts +3 -6
- package/src/features/hints/type-hints-module.ts +7 -6
- package/src/features/hints/type-hints.ts +12 -1
- package/src/features/hover/hover-module.ts +1 -2
- package/src/features/hover/hover.ts +2 -3
- package/src/features/label-edit/edit-label-tool.ts +2 -2
- package/src/features/label-edit/edit-label-validator.ts +7 -6
- package/src/features/navigation/navigation-action-handler.ts +5 -8
- package/src/features/navigation/navigation-target-resolver.ts +10 -7
- package/src/features/select/select-mouse-listener.ts +27 -79
- package/src/features/source-model-watcher/source-model-changed-action-handler.ts +3 -6
- package/src/features/status/status-module.ts +26 -0
- package/src/features/status/status-overlay.ts +121 -0
- package/src/features/tool-palette/tool-palette-module.ts +4 -3
- package/src/features/tool-palette/tool-palette.ts +44 -33
- package/src/features/tools/{base-glsp-tool.ts → base-tools.ts} +28 -3
- package/src/features/tools/change-bounds/change-bounds-tool.ts +2 -2
- package/src/features/tools/deletion/delete-tool.ts +4 -5
- package/src/features/tools/edge-creation/edge-creation-tool.ts +3 -3
- package/src/features/tools/edge-edit/edge-edit-tool.ts +2 -2
- package/src/features/tools/marquee-selection/marquee-mouse-tool.ts +3 -3
- package/src/features/tools/marquee-selection/marquee-tool.ts +4 -3
- package/src/features/tools/node-creation/node-creation-tool.ts +3 -3
- package/src/features/tools/tool-focus-loss-module.ts +2 -1
- package/src/features/validation/validate.ts +1 -1
- package/src/features/viewport/glsp-scroll-mouse-listener.ts +2 -9
- package/src/features/viewport/reposition.ts +119 -0
- package/src/features/viewport/viewport-modules.ts +3 -2
- package/src/glsp-sprotty/augmented-actions.ts +1 -16
- package/src/glsp-sprotty/index.ts +4 -7
- package/src/glsp-sprotty/types.ts +6 -8
- package/src/index.ts +17 -7
- package/src/standalone-modules.ts +40 -1
- package/src/views/base-view-module.ts +2 -2
- package/src/views/glsp-projection-view.tsx +18 -8
- package/lib/base/model-initialization-constraint.d.ts.map +0 -1
- package/lib/base/model-initialization-constraint.js.map +0 -1
- package/lib/base/source-uri-aware.d.ts +0 -5
- package/lib/base/source-uri-aware.d.ts.map +0 -1
- package/lib/base/source-uri-aware.js.map +0 -1
- package/lib/base/tool-manager/glsp-tool-manager.d.ts +0 -21
- package/lib/base/tool-manager/glsp-tool-manager.d.ts.map +0 -1
- package/lib/base/tool-manager/glsp-tool-manager.js +0 -113
- package/lib/base/tool-manager/glsp-tool-manager.js.map +0 -1
- package/lib/features/context-menu/selection-service-aware-context-menu-mouse-listener.d.ts.map +0 -1
- package/lib/features/context-menu/selection-service-aware-context-menu-mouse-listener.js.map +0 -1
- package/lib/features/tools/base-glsp-creation-tool.d.ts +0 -10
- package/lib/features/tools/base-glsp-creation-tool.d.ts.map +0 -1
- package/lib/features/tools/base-glsp-creation-tool.js.map +0 -1
- package/lib/features/tools/base-glsp-tool.d.ts.map +0 -1
- package/lib/features/tools/base-glsp-tool.js.map +0 -1
- package/lib/model-source/glsp-diagram-server.d.ts +0 -21
- package/lib/model-source/glsp-diagram-server.d.ts.map +0 -1
- package/lib/model-source/glsp-diagram-server.js +0 -107
- package/lib/model-source/glsp-diagram-server.js.map +0 -1
- package/src/base/tool-manager/glsp-tool-manager.ts +0 -96
- package/src/model-source/glsp-diagram-server.ts +0 -125
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2023 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
|
+
|
|
17
|
+
import { Action, AnyObject, hasArrayProp, hasBooleanProp, hasFunctionProp, hasStringProp } from '~glsp-sprotty';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Action to enable the tools of the specified `toolIds`.
|
|
21
|
+
*/
|
|
22
|
+
export interface EnableToolsAction extends Action {
|
|
23
|
+
kind: typeof EnableToolsAction.KIND;
|
|
24
|
+
toolIds: string[];
|
|
25
|
+
}
|
|
26
|
+
export namespace EnableToolsAction {
|
|
27
|
+
export const KIND = 'enable-tools';
|
|
28
|
+
|
|
29
|
+
export function is(object: unknown): object is EnableToolsAction {
|
|
30
|
+
return Action.hasKind(object, KIND) && hasArrayProp(object, 'toolIds');
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function create(toolIds: string[]): EnableToolsAction {
|
|
34
|
+
return {
|
|
35
|
+
kind: KIND,
|
|
36
|
+
toolIds
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Action to disable the currently active tools and enable the default tools instead.
|
|
43
|
+
*/
|
|
44
|
+
export interface EnableDefaultToolsAction extends Action {
|
|
45
|
+
kind: typeof EnableDefaultToolsAction.KIND;
|
|
46
|
+
}
|
|
47
|
+
export namespace EnableDefaultToolsAction {
|
|
48
|
+
export const KIND = 'enable-default-tools';
|
|
49
|
+
|
|
50
|
+
export function is(object: unknown): object is EnableToolsAction {
|
|
51
|
+
return Action.hasKind(object, KIND);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function create(): EnableDefaultToolsAction {
|
|
55
|
+
return {
|
|
56
|
+
kind: KIND
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** A tool that can be managed by a `ToolManager`.
|
|
62
|
+
*/
|
|
63
|
+
export interface Tool {
|
|
64
|
+
readonly id: string;
|
|
65
|
+
/* Notifies the tool to become active. */
|
|
66
|
+
enable(): void;
|
|
67
|
+
/* Notifies the tool to become inactive. */
|
|
68
|
+
disable(): void;
|
|
69
|
+
/** Optional flag indicating wether this tool is an edit tool.
|
|
70
|
+
* Edit tools are inactive when a diagram is in `readonly` edit mode.
|
|
71
|
+
*/
|
|
72
|
+
isEditTool?: boolean;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export namespace Tool {
|
|
76
|
+
export function is(object: unknown): object is Tool {
|
|
77
|
+
return (
|
|
78
|
+
AnyObject.is(object) &&
|
|
79
|
+
hasStringProp(object, 'id') &&
|
|
80
|
+
hasFunctionProp(object, 'enable') &&
|
|
81
|
+
hasFunctionProp(object, 'disable') &&
|
|
82
|
+
hasBooleanProp(object, 'isEditTool', true)
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
}
|
package/src/default-modules.ts
CHANGED
|
@@ -14,11 +14,15 @@
|
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
|
|
17
|
-
import { Container
|
|
17
|
+
import { Container } from 'inversify';
|
|
18
18
|
import {
|
|
19
|
+
BindingContext,
|
|
19
20
|
ContainerConfiguration,
|
|
20
21
|
FeatureModule,
|
|
22
|
+
TYPES,
|
|
23
|
+
ViewerOptions,
|
|
21
24
|
buttonModule,
|
|
25
|
+
configureViewerOptions,
|
|
22
26
|
edgeIntersectionModule,
|
|
23
27
|
edgeLayoutModule,
|
|
24
28
|
expandModule,
|
|
@@ -29,6 +33,7 @@ import {
|
|
|
29
33
|
zorderModule
|
|
30
34
|
} from '~glsp-sprotty';
|
|
31
35
|
import { defaultModule } from './base/default.module';
|
|
36
|
+
import { IDiagramOptions } from './base/model/diagram-loader';
|
|
32
37
|
import { boundsModule } from './features/bounds/bounds-module';
|
|
33
38
|
import { commandPaletteModule } from './features/command-palette/command-palette-module';
|
|
34
39
|
import { contextMenuModule } from './features/context-menu/context-menu-module';
|
|
@@ -43,6 +48,7 @@ import { navigationModule } from './features/navigation/navigation-module';
|
|
|
43
48
|
import { routingModule } from './features/routing/routing-module';
|
|
44
49
|
import { selectModule } from './features/select/select-module';
|
|
45
50
|
import { sourceModelWatcherModule } from './features/source-model-watcher/source-model-wacher-module';
|
|
51
|
+
import { statusModule } from './features/status/status-module';
|
|
46
52
|
import { svgMetadataModule } from './features/svg-metadata/svg-metadata-module';
|
|
47
53
|
import { toolPaletteModule } from './features/tool-palette/tool-palette-module';
|
|
48
54
|
import { changeBoundsToolModule } from './features/tools/change-bounds/change-boounds-tool-module';
|
|
@@ -90,9 +96,38 @@ export const DEFAULT_MODULES = [
|
|
|
90
96
|
toolFocusLossModule,
|
|
91
97
|
validationModule,
|
|
92
98
|
zorderModule,
|
|
93
|
-
svgMetadataModule
|
|
99
|
+
svgMetadataModule,
|
|
100
|
+
statusModule
|
|
94
101
|
] as const;
|
|
95
102
|
|
|
103
|
+
/**
|
|
104
|
+
* Wraps the {@link configureDiagramOptions} utility function in a module. Adopters can either include this
|
|
105
|
+
* module into the container {@link ModuleConfiguration} or configure the container after its creation
|
|
106
|
+
* (e.g. using the {@link configureDiagramOptions} utility function).
|
|
107
|
+
* @param options The diagram instance specific configuration options
|
|
108
|
+
* @returns The corresponding {@link FeatureModule}
|
|
109
|
+
*/
|
|
110
|
+
export function createDiagramOptionsModule(options: IDiagramOptions): FeatureModule {
|
|
111
|
+
return new FeatureModule((bind, unbind, isBound, rebind) => configureDiagramOptions({ bind, unbind, isBound, rebind }, options));
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Utility function to bind the diagram instance specific configuration options.
|
|
116
|
+
* In addition to binding the {@link IDiagramOptions} this function also overrides the
|
|
117
|
+
* {@link ViewerOptions} to match the given client id.
|
|
118
|
+
* @param context The binding context
|
|
119
|
+
* @param options The {@link IDiagramOptions} that should be bound
|
|
120
|
+
*/
|
|
121
|
+
export function configureDiagramOptions(context: BindingContext, options: IDiagramOptions): void {
|
|
122
|
+
const viewerOptions: Partial<ViewerOptions> = {
|
|
123
|
+
baseDiv: options.clientId,
|
|
124
|
+
hiddenDiv: options.clientId + '_hidden'
|
|
125
|
+
};
|
|
126
|
+
configureViewerOptions(context, viewerOptions);
|
|
127
|
+
|
|
128
|
+
context.bind(TYPES.IDiagramOptions).toConstantValue(options);
|
|
129
|
+
}
|
|
130
|
+
|
|
96
131
|
/**
|
|
97
132
|
* Initializes a GLSP Diagram container with the GLSP default modules and the specified custom `modules`.
|
|
98
133
|
* Additional modules can be passed as direct arguments or as part of a {@link ModuleConfiguration}.
|
|
@@ -134,29 +169,3 @@ export function initializeDiagramContainer(container: Container, ...containerCon
|
|
|
134
169
|
container.load(...modules);
|
|
135
170
|
return container;
|
|
136
171
|
}
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* Creates a GLSP Client container with the GLSP default modules and the specified custom `modules`.
|
|
140
|
-
*
|
|
141
|
-
* You can still customize the default modules in two ways.
|
|
142
|
-
*
|
|
143
|
-
* First, you can unload default modules and load them again with your custom code.
|
|
144
|
-
*
|
|
145
|
-
* ```typescript
|
|
146
|
-
* const container = createClientContainer(myModule1, myModule2);
|
|
147
|
-
* container.unload(modelSourceWatcherModule);
|
|
148
|
-
* container.load(myModelSourceWatcherModule);
|
|
149
|
-
* ```
|
|
150
|
-
*
|
|
151
|
-
* Second, you can unbind or rebind implementations that are originally bound in one of the default modules.
|
|
152
|
-
*
|
|
153
|
-
* ```typescript
|
|
154
|
-
* rebind(NavigationTargetResolver).to(MyNavigationTargetResolver);
|
|
155
|
-
* ```
|
|
156
|
-
* @param modules Custom modules to be loaded in addition to the default modules.
|
|
157
|
-
* @returns The created container.
|
|
158
|
-
* @deprecated Please use `initializeDiagramContainer` from `@eclipse-glsp/client` instead
|
|
159
|
-
*/
|
|
160
|
-
export function createClientContainer(...modules: ContainerModule[]): Container {
|
|
161
|
-
return initializeDiagramContainer(new Container(), ...modules);
|
|
162
|
-
}
|
|
@@ -63,3 +63,21 @@ The resize functionality helps to set the size of the nodes, by either increasin
|
|
|
63
63
|
3. <kbd>+</kbd> or <kbd>-</kbd> to increase or decrease the size of the element(s) gradually.
|
|
64
64
|
4. <kbd>CTRL</kbd>+<kbd>0</kbd>: Set the size of the element(s) to default.
|
|
65
65
|
5. <kbd>ESC</kbd>: Deactivate the resize mode.
|
|
66
|
+
|
|
67
|
+
### Model Navigation
|
|
68
|
+
|
|
69
|
+
#### Default Navigation (following directions of relations)
|
|
70
|
+
|
|
71
|
+
1. Select element as starting point.
|
|
72
|
+
2. <kbd>N</kbd>: Activate default navigation.
|
|
73
|
+
3. Use arrow keys to iterate through model according to the directions of the given relations.
|
|
74
|
+
|
|
75
|
+
#### Position-based Navigation (following x and y coordinates)
|
|
76
|
+
|
|
77
|
+
1. Select element as starting point.
|
|
78
|
+
2. <kbd>ALT</kbd>+<kbd>N</kbd>: Activate position based navigation.
|
|
79
|
+
3. Use arrow keys (<kbd>←</kbd> || <kbd>↑</kbd> || <kbd>→</kbd> || <kbd>↓</kbd>) to iterate through model according to the positions of the elements, i.e. depending on the order of the elements' x and y coordinates.
|
|
80
|
+
|
|
81
|
+
### Help
|
|
82
|
+
|
|
83
|
+
1. <kbd>ALT</kbd>+<kbd>H</kbd>: Display list of keyboard shortcuts.
|
|
@@ -20,7 +20,9 @@ import { configureMoveZoom } from './move-zoom/move-zoom-module';
|
|
|
20
20
|
import { configureResizeTools } from './resize-key-tool/resize-key-module';
|
|
21
21
|
import { configureSearchPaletteModule } from './search/search-palette-module';
|
|
22
22
|
import { configureViewKeyTools } from './view-key-tools/view-key-tools-module';
|
|
23
|
-
|
|
23
|
+
import { configureElementNavigationTool } from './element-navigation/element-navigation-module';
|
|
24
|
+
import { configureFocusTrackerTool } from './focus-tracker/focus-tracker-module';
|
|
25
|
+
import { configureToastTool } from './toast/toast-module';
|
|
24
26
|
/**
|
|
25
27
|
* Enables the accessibility tools for a keyboard-only-usage
|
|
26
28
|
*/
|
|
@@ -31,4 +33,7 @@ export const accessibilityModule = new FeatureModule((bind, unbind, isBound, reb
|
|
|
31
33
|
configureMoveZoom(context);
|
|
32
34
|
configureSearchPaletteModule(context);
|
|
33
35
|
configureShortcutHelpTool(context);
|
|
36
|
+
configureElementNavigationTool(context);
|
|
37
|
+
configureFocusTrackerTool(context);
|
|
38
|
+
configureToastTool(context);
|
|
34
39
|
});
|
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2023 Business Informatics Group (TU Wien) 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
|
+
|
|
17
|
+
import { inject, injectable } from 'inversify';
|
|
18
|
+
import { toArray } from 'sprotty/lib/utils/iterable';
|
|
19
|
+
import { matchesKeystroke } from 'sprotty/lib/utils/keyboard';
|
|
20
|
+
import {
|
|
21
|
+
Action,
|
|
22
|
+
KeyListener,
|
|
23
|
+
KeyTool,
|
|
24
|
+
SEdge,
|
|
25
|
+
SModelElement,
|
|
26
|
+
SModelRoot,
|
|
27
|
+
SelectAction,
|
|
28
|
+
Selectable,
|
|
29
|
+
TYPES,
|
|
30
|
+
findParentByFeature,
|
|
31
|
+
isBoundsAware,
|
|
32
|
+
isSelectable,
|
|
33
|
+
isSelected
|
|
34
|
+
} from '~glsp-sprotty';
|
|
35
|
+
import { GLSPActionDispatcher } from '../../../base/action-dispatcher';
|
|
36
|
+
import { EnableDefaultToolsAction, EnableToolsAction, Tool } from '../../../base/tool-manager/tool';
|
|
37
|
+
import { SelectableBoundsAware } from '../../../utils/smodel-util';
|
|
38
|
+
import { RepositionAction } from '../../viewport/reposition';
|
|
39
|
+
import { SetAccessibleKeyShortcutAction } from '../key-shortcut/accessible-key-shortcut';
|
|
40
|
+
import { AccessibleKeyShortcutTool } from '../key-shortcut/accessible-key-shortcut-tool';
|
|
41
|
+
import { SearchAutocompletePaletteTool } from '../search/search-tool';
|
|
42
|
+
import * as messages from '../toast/messages.json';
|
|
43
|
+
import { ShowToastMessageAction } from '../toast/toast-handler';
|
|
44
|
+
import { ElementNavigator } from './element-navigator';
|
|
45
|
+
|
|
46
|
+
@injectable()
|
|
47
|
+
export class ElementNavigatorTool implements Tool {
|
|
48
|
+
static ID = 'glsp.diagram-navigation';
|
|
49
|
+
|
|
50
|
+
isEditTool = false;
|
|
51
|
+
|
|
52
|
+
protected elementNavigatorKeyListener: ElementNavigatorKeyListener = new ElementNavigatorKeyListener(this);
|
|
53
|
+
@inject(KeyTool) protected readonly keytool: KeyTool;
|
|
54
|
+
@inject(TYPES.IElementNavigator) readonly elementNavigator: ElementNavigator;
|
|
55
|
+
@inject(TYPES.ILocalElementNavigator) readonly localElementNavigator: ElementNavigator;
|
|
56
|
+
@inject(TYPES.IActionDispatcher) readonly actionDispatcher: GLSPActionDispatcher;
|
|
57
|
+
|
|
58
|
+
get id(): string {
|
|
59
|
+
return ElementNavigatorTool.ID;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
enable(): void {
|
|
63
|
+
this.keytool.register(this.elementNavigatorKeyListener);
|
|
64
|
+
this.elementNavigatorKeyListener.registerShortcutKey();
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
disable(): void {
|
|
68
|
+
this.keytool.deregister(this.elementNavigatorKeyListener);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
enum NavigationMode {
|
|
73
|
+
POSITION = 'position',
|
|
74
|
+
DEFAULT = 'default',
|
|
75
|
+
NONE = 'none'
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export class ElementNavigatorKeyListener extends KeyListener {
|
|
79
|
+
protected mode = NavigationMode.NONE;
|
|
80
|
+
protected previousNode?: SelectableBoundsAware;
|
|
81
|
+
protected navigator?: ElementNavigator;
|
|
82
|
+
protected readonly token = ElementNavigatorKeyListener.name;
|
|
83
|
+
|
|
84
|
+
constructor(protected readonly tool: ElementNavigatorTool) {
|
|
85
|
+
super();
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
registerShortcutKey(): void {
|
|
89
|
+
this.tool.actionDispatcher.dispatchOnceModelInitialized(
|
|
90
|
+
SetAccessibleKeyShortcutAction.create({
|
|
91
|
+
token: this.token,
|
|
92
|
+
keys: [
|
|
93
|
+
{ shortcuts: ['N'], description: 'Activate default navigation', group: 'Navigation', position: 0 },
|
|
94
|
+
{
|
|
95
|
+
shortcuts: ['ALT', 'N'],
|
|
96
|
+
description: 'Activate position based navigation',
|
|
97
|
+
group: 'Navigation',
|
|
98
|
+
position: 1
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
shortcuts: ['⬅ ⬆ ➡ ⬇'],
|
|
102
|
+
description: 'Navigate by relation or neighbors according to navigation mode',
|
|
103
|
+
group: 'Navigation',
|
|
104
|
+
position: 2
|
|
105
|
+
}
|
|
106
|
+
]
|
|
107
|
+
})
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
override keyDown(element: SModelElement, event: KeyboardEvent): Action[] {
|
|
112
|
+
this.resetOnEscape(event, element);
|
|
113
|
+
|
|
114
|
+
if (this.getSelectedElements(element.root).length > 0) {
|
|
115
|
+
if (!this.triggerPositionNavigationOnEvent(event, element)) {
|
|
116
|
+
this.triggerDefaultNavigationOnEvent(event, element);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
return this.navigate(element, event);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
this.resetPositionNavigationOnEvent(event, element);
|
|
123
|
+
this.resetDefaultNavigationOnEvent(event, element);
|
|
124
|
+
|
|
125
|
+
return [];
|
|
126
|
+
}
|
|
127
|
+
protected resetOnEscape(event: KeyboardEvent, element: SModelElement): void {
|
|
128
|
+
if (this.mode !== NavigationMode.NONE && this.matchesDeactivateNavigationMode(event)) {
|
|
129
|
+
this.navigator?.clean?.(element.root);
|
|
130
|
+
this.clean();
|
|
131
|
+
|
|
132
|
+
if (this.mode === NavigationMode.POSITION) {
|
|
133
|
+
this.tool.actionDispatcher.dispatchAll([
|
|
134
|
+
EnableDefaultToolsAction.create(),
|
|
135
|
+
ShowToastMessageAction.createWithTimeout({
|
|
136
|
+
id: Symbol.for(ElementNavigatorKeyListener.name),
|
|
137
|
+
message: messages.navigation.local_navigation_mode_deactivated
|
|
138
|
+
})
|
|
139
|
+
]);
|
|
140
|
+
} else if (this.mode === NavigationMode.DEFAULT) {
|
|
141
|
+
this.tool.actionDispatcher.dispatchAll([
|
|
142
|
+
EnableDefaultToolsAction.create(),
|
|
143
|
+
ShowToastMessageAction.createWithTimeout({
|
|
144
|
+
id: Symbol.for(ElementNavigatorKeyListener.name),
|
|
145
|
+
message: messages.navigation.default_navigation_mode_deactivated
|
|
146
|
+
})
|
|
147
|
+
]);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
this.mode = NavigationMode.NONE;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
protected triggerPositionNavigationOnEvent(event: KeyboardEvent, element: SModelElement): boolean {
|
|
155
|
+
if (this.matchesActivatePositionNavigation(event)) {
|
|
156
|
+
if (this.mode !== NavigationMode.POSITION) {
|
|
157
|
+
this.clean();
|
|
158
|
+
this.tool.actionDispatcher.dispatchAll([
|
|
159
|
+
EnableToolsAction.create([ElementNavigatorTool.ID, SearchAutocompletePaletteTool.ID, AccessibleKeyShortcutTool.ID]),
|
|
160
|
+
ShowToastMessageAction.create({
|
|
161
|
+
id: Symbol.for(ElementNavigatorKeyListener.name),
|
|
162
|
+
message: messages.navigation.local_navigation_mode_activated
|
|
163
|
+
})
|
|
164
|
+
]);
|
|
165
|
+
this.navigator = this.tool.elementNavigator;
|
|
166
|
+
this.mode = NavigationMode.POSITION;
|
|
167
|
+
} else {
|
|
168
|
+
this.resetPositionNavigationOnEvent(event, element);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
return true;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
return false;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
protected resetPositionNavigationOnEvent(event: KeyboardEvent, element: SModelElement): void {
|
|
178
|
+
if (this.mode === NavigationMode.POSITION && this.matchesActivatePositionNavigation(event)) {
|
|
179
|
+
this.navigator?.clean?.(element.root);
|
|
180
|
+
this.clean();
|
|
181
|
+
this.mode = NavigationMode.NONE;
|
|
182
|
+
this.tool.actionDispatcher.dispatchAll([
|
|
183
|
+
EnableDefaultToolsAction.create(),
|
|
184
|
+
ShowToastMessageAction.createWithTimeout({
|
|
185
|
+
id: Symbol.for(ElementNavigatorKeyListener.name),
|
|
186
|
+
message: messages.navigation.local_navigation_mode_deactivated
|
|
187
|
+
})
|
|
188
|
+
]);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
protected triggerDefaultNavigationOnEvent(event: KeyboardEvent, element: SModelElement): boolean {
|
|
192
|
+
if (this.matchesActivateDefaultNavigation(event)) {
|
|
193
|
+
if (this.mode !== NavigationMode.DEFAULT) {
|
|
194
|
+
this.clean();
|
|
195
|
+
|
|
196
|
+
this.tool.actionDispatcher.dispatchAll([
|
|
197
|
+
EnableToolsAction.create([ElementNavigatorTool.ID, SearchAutocompletePaletteTool.ID, AccessibleKeyShortcutTool.ID]),
|
|
198
|
+
ShowToastMessageAction.create({
|
|
199
|
+
id: Symbol.for(ElementNavigatorKeyListener.name),
|
|
200
|
+
message: messages.navigation.default_navigation_mode_activated
|
|
201
|
+
})
|
|
202
|
+
]);
|
|
203
|
+
this.navigator = this.tool.localElementNavigator;
|
|
204
|
+
this.mode = NavigationMode.DEFAULT;
|
|
205
|
+
} else {
|
|
206
|
+
this.resetDefaultNavigationOnEvent(event, element);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
return true;
|
|
210
|
+
}
|
|
211
|
+
return false;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
protected resetDefaultNavigationOnEvent(event: KeyboardEvent, element: SModelElement): void {
|
|
215
|
+
if (this.mode === NavigationMode.DEFAULT && this.matchesActivateDefaultNavigation(event)) {
|
|
216
|
+
this.navigator?.clean?.(element.root);
|
|
217
|
+
this.clean();
|
|
218
|
+
this.mode = NavigationMode.NONE;
|
|
219
|
+
this.tool.actionDispatcher.dispatchAll([
|
|
220
|
+
EnableDefaultToolsAction.create(),
|
|
221
|
+
ShowToastMessageAction.createWithTimeout({
|
|
222
|
+
id: Symbol.for(ElementNavigatorKeyListener.name),
|
|
223
|
+
message: messages.navigation.default_navigation_mode_deactivated
|
|
224
|
+
})
|
|
225
|
+
]);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
protected navigate(element: SModelElement, event: KeyboardEvent): Action[] {
|
|
230
|
+
const selected = this.getSelectedElements(element.root);
|
|
231
|
+
const current = selected.length > 0 ? selected[0] : undefined;
|
|
232
|
+
|
|
233
|
+
if (this.mode !== NavigationMode.NONE && this.navigator !== undefined && current !== undefined && isBoundsAware(current)) {
|
|
234
|
+
this.navigator.clean?.(current.root, current, this.previousNode);
|
|
235
|
+
|
|
236
|
+
const target = this.navigateOnEvent(event, this.navigator, current);
|
|
237
|
+
|
|
238
|
+
if (target !== undefined) {
|
|
239
|
+
this.navigator.process?.(current.root, current, target as SelectableBoundsAware, this.previousNode);
|
|
240
|
+
}
|
|
241
|
+
const selectableTarget = target ? findParentByFeature(target, isSelectable) : undefined;
|
|
242
|
+
|
|
243
|
+
if (selectableTarget) {
|
|
244
|
+
if (!(current instanceof SEdge)) {
|
|
245
|
+
this.previousNode = current;
|
|
246
|
+
}
|
|
247
|
+
const deselectedElementsIDs = selected.map(e => e.id).filter(id => id !== selectableTarget.id);
|
|
248
|
+
|
|
249
|
+
return [
|
|
250
|
+
SelectAction.create({ selectedElementsIDs: [selectableTarget.id], deselectedElementsIDs }),
|
|
251
|
+
RepositionAction.create([selectableTarget.id])
|
|
252
|
+
];
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
return [];
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
protected navigateOnEvent(
|
|
260
|
+
event: KeyboardEvent,
|
|
261
|
+
navigator: ElementNavigator,
|
|
262
|
+
current: SelectableBoundsAware
|
|
263
|
+
): SModelElement | undefined {
|
|
264
|
+
if (this.matchesNavigatePrevious(event)) {
|
|
265
|
+
return navigator.previous(current.root, current);
|
|
266
|
+
} else if (this.matchesNavigateNext(event)) {
|
|
267
|
+
return navigator.next(current.root, current);
|
|
268
|
+
} else if (this.matchesNavigateUp(event)) {
|
|
269
|
+
return navigator.up?.(current.root, current, this.previousNode);
|
|
270
|
+
} else if (this.matchesNavigateDown(event)) {
|
|
271
|
+
return navigator.down?.(current.root, current, this.previousNode);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
return undefined;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
protected clean(): void {
|
|
278
|
+
this.previousNode = undefined;
|
|
279
|
+
this.navigator = undefined;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
protected getSelectedElements(root: SModelRoot): (SModelElement & Selectable)[] {
|
|
283
|
+
return toArray(root.index.all().filter(e => isSelected(e))) as (SModelElement & Selectable)[];
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
protected matchesDeactivateNavigationMode(event: KeyboardEvent): boolean {
|
|
287
|
+
return matchesKeystroke(event, 'Escape');
|
|
288
|
+
}
|
|
289
|
+
protected matchesActivateDefaultNavigation(event: KeyboardEvent): boolean {
|
|
290
|
+
return matchesKeystroke(event, 'KeyN');
|
|
291
|
+
}
|
|
292
|
+
protected matchesActivatePositionNavigation(event: KeyboardEvent): boolean {
|
|
293
|
+
return matchesKeystroke(event, 'KeyN', 'alt');
|
|
294
|
+
}
|
|
295
|
+
protected matchesNavigatePrevious(event: KeyboardEvent): boolean {
|
|
296
|
+
return matchesKeystroke(event, 'ArrowLeft');
|
|
297
|
+
}
|
|
298
|
+
protected matchesNavigateNext(event: KeyboardEvent): boolean {
|
|
299
|
+
return matchesKeystroke(event, 'ArrowRight');
|
|
300
|
+
}
|
|
301
|
+
protected matchesNavigateUp(event: KeyboardEvent): boolean {
|
|
302
|
+
return matchesKeystroke(event, 'ArrowUp');
|
|
303
|
+
}
|
|
304
|
+
protected matchesNavigateDown(event: KeyboardEvent): boolean {
|
|
305
|
+
return matchesKeystroke(event, 'ArrowDown');
|
|
306
|
+
}
|
|
307
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2023 Business Informatics Group (TU Wien) 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 { ContainerModule } from 'inversify';
|
|
17
|
+
import { BindingContext, TYPES, bindAsService } from '~glsp-sprotty';
|
|
18
|
+
import { PositionNavigator } from './position-navigator';
|
|
19
|
+
import { LocalElementNavigator } from './local-element-navigator';
|
|
20
|
+
import { ElementNavigatorTool } from './diagram-navigation-tool';
|
|
21
|
+
import '../../../../css/navigation.css';
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Handles element navigation actions.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
export const glspElementNavigationModule = new ContainerModule((bind, unbind, isBound, rebind) => {
|
|
28
|
+
const context = { bind, unbind, isBound, rebind };
|
|
29
|
+
configureElementNavigationTool(context);
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
export function configureElementNavigationTool(context: BindingContext): void {
|
|
33
|
+
bindAsService(context, TYPES.IDefaultTool, ElementNavigatorTool);
|
|
34
|
+
bindAsService(context, TYPES.IElementNavigator, PositionNavigator);
|
|
35
|
+
bindAsService(context, TYPES.ILocalElementNavigator, LocalElementNavigator);
|
|
36
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2023 Business Informatics Group (TU Wien) 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
|
+
|
|
17
|
+
import { SModelElement, SModelRoot } from '~glsp-sprotty';
|
|
18
|
+
import { SelectableBoundsAware } from '../../../utils/smodel-util';
|
|
19
|
+
|
|
20
|
+
export interface ElementNavigator {
|
|
21
|
+
previous(
|
|
22
|
+
root: Readonly<SModelRoot>,
|
|
23
|
+
current: SelectableBoundsAware,
|
|
24
|
+
previousCurrent?: SelectableBoundsAware,
|
|
25
|
+
predicate?: (element: SModelElement) => boolean
|
|
26
|
+
): SModelElement | undefined;
|
|
27
|
+
|
|
28
|
+
next(
|
|
29
|
+
root: Readonly<SModelRoot>,
|
|
30
|
+
current: SelectableBoundsAware,
|
|
31
|
+
previousCurrent?: SelectableBoundsAware,
|
|
32
|
+
predicate?: (element: SModelElement) => boolean
|
|
33
|
+
): SModelElement | undefined;
|
|
34
|
+
|
|
35
|
+
up?(
|
|
36
|
+
root: Readonly<SModelRoot>,
|
|
37
|
+
current: SelectableBoundsAware,
|
|
38
|
+
previousCurrent?: SelectableBoundsAware,
|
|
39
|
+
predicate?: (element: SModelElement) => boolean
|
|
40
|
+
): SModelElement | undefined;
|
|
41
|
+
|
|
42
|
+
down?(
|
|
43
|
+
root: Readonly<SModelRoot>,
|
|
44
|
+
current: SelectableBoundsAware,
|
|
45
|
+
previousCurrent?: SelectableBoundsAware,
|
|
46
|
+
predicate?: (element: SModelElement) => boolean
|
|
47
|
+
): SModelElement | undefined;
|
|
48
|
+
|
|
49
|
+
process?(
|
|
50
|
+
root: Readonly<SModelRoot>,
|
|
51
|
+
current: SelectableBoundsAware,
|
|
52
|
+
target: SelectableBoundsAware,
|
|
53
|
+
previousCurrent?: SelectableBoundsAware,
|
|
54
|
+
predicate?: (element: SModelElement) => boolean
|
|
55
|
+
): void;
|
|
56
|
+
clean?(root: Readonly<SModelRoot>, current?: SelectableBoundsAware, previousCurrent?: SelectableBoundsAware): void;
|
|
57
|
+
}
|