@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
|
@@ -35,6 +35,7 @@ import { AutocompleteSuggestion, IAutocompleteSuggestionProvider } from '../../a
|
|
|
35
35
|
import { BaseAutocompletePalette } from '../../autocomplete-palette/base-autocomplete-palette';
|
|
36
36
|
|
|
37
37
|
import { applyCssClasses, deleteCssClasses } from '../../../base/feedback/css-feedback';
|
|
38
|
+
import { RepositionAction } from '../../../features/viewport/reposition';
|
|
38
39
|
|
|
39
40
|
const CSS_SEARCH_HIDDEN = 'search-hidden';
|
|
40
41
|
const CSS_SEARCH_HIGHLIGHTED = 'search-highlighted';
|
|
@@ -103,6 +104,7 @@ export class SearchAutocompletePalette extends BaseAutocompletePalette {
|
|
|
103
104
|
super.initializeContents(containerElement);
|
|
104
105
|
|
|
105
106
|
this.autocompleteWidget.inputField.placeholder = 'Search for elements';
|
|
107
|
+
containerElement.setAttribute('aria-label', 'Search Field');
|
|
106
108
|
}
|
|
107
109
|
protected getSuggestionProviders(root: Readonly<SModelRoot>, input: string): IAutocompleteSuggestionProvider[] {
|
|
108
110
|
return [new RevealNamedElementAutocompleteSuggestionProvider(), new RevealEdgeElementAutocompleteSuggestionProvider()];
|
|
@@ -132,8 +134,8 @@ export class SearchAutocompletePalette extends BaseAutocompletePalette {
|
|
|
132
134
|
if (labeledAction !== undefined) {
|
|
133
135
|
const suggestions = this.getSuggestionsFromLabeledActions([labeledAction]);
|
|
134
136
|
|
|
135
|
-
const actions:
|
|
136
|
-
suggestions.map(currElem => actions.push(
|
|
137
|
+
const actions: RepositionAction[] = [];
|
|
138
|
+
suggestions.map(currElem => actions.push(RepositionAction.create([currElem.element.id])));
|
|
137
139
|
|
|
138
140
|
this.actionDispatcher.dispatchAll(actions);
|
|
139
141
|
await this.applyCSS(
|
|
@@ -16,8 +16,9 @@
|
|
|
16
16
|
|
|
17
17
|
import { inject, injectable } from 'inversify';
|
|
18
18
|
import { matchesKeystroke } from 'sprotty/lib/utils/keyboard';
|
|
19
|
-
import { Action, KeyListener, KeyTool,
|
|
19
|
+
import { Action, KeyListener, KeyTool, SModelElement, SetUIExtensionVisibilityAction, TYPES } from '~glsp-sprotty';
|
|
20
20
|
import { GLSPActionDispatcher } from '../../../base/action-dispatcher';
|
|
21
|
+
import { Tool } from '../../../base/tool-manager/tool';
|
|
21
22
|
import { AccessibleKeyShortcutProvider, SetAccessibleKeyShortcutAction } from '../key-shortcut/accessible-key-shortcut';
|
|
22
23
|
import { SearchAutocompletePalette } from './search-palette';
|
|
23
24
|
@injectable()
|
|
@@ -50,14 +51,12 @@ export class SearchAutocompletePaletteKeyListener extends KeyListener implements
|
|
|
50
51
|
}
|
|
51
52
|
|
|
52
53
|
registerShortcutKey(): void {
|
|
53
|
-
this.tool.actionDispatcher.
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
]);
|
|
60
|
-
});
|
|
54
|
+
this.tool.actionDispatcher.dispatchOnceModelInitialized(
|
|
55
|
+
SetAccessibleKeyShortcutAction.create({
|
|
56
|
+
token: this.token,
|
|
57
|
+
keys: [{ shortcuts: ['CTRL', 'F'], description: 'Activate search for elements', group: 'Search', position: 0 }]
|
|
58
|
+
})
|
|
59
|
+
);
|
|
61
60
|
}
|
|
62
61
|
|
|
63
62
|
override keyDown(element: SModelElement, event: KeyboardEvent): Action[] {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"navigation": {
|
|
3
|
+
"default_navigation_mode_activated": "Navigation On: Use arrow keys to select preceding (←) or succeding (→) elements. Use the up (↑) and down (↓) arrows to navigate paths. Press 'N' to exit.",
|
|
4
|
+
"default_navigation_mode_deactivated": "Navigation Off: Press 'N' for default navigation, 'ALT+N' for position based navigation.",
|
|
5
|
+
"local_navigation_mode_activated": "Position based Nav On: Navigate nearest elements using arrow keys: (↑) for above, (↓) for below, (←) for previous, (→) for next element. Press 'ALT+N' to exit.",
|
|
6
|
+
"local_navigation_mode_deactivated": "Position based Nav Off: Press 'N' for default navigation, 'ALT+N' for position based navigation."
|
|
7
|
+
},
|
|
8
|
+
"focus": {
|
|
9
|
+
"focus_on": "Currently focused: ",
|
|
10
|
+
"focus_off": "Currently no element is focused."
|
|
11
|
+
},
|
|
12
|
+
"resize": {
|
|
13
|
+
"resize_mode_activated": "Resize On: Use plus(+) and minus(-) to resize, 'CTRL'+'0' for default size. Press 'ESC' to exit.",
|
|
14
|
+
"resize_mode_deactivated": "Resize Off: Press 'ALT'+'A' for resize mode."
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
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 { Action } from '~glsp-sprotty';
|
|
18
|
+
|
|
19
|
+
export interface HideToastAction extends Action {
|
|
20
|
+
kind: typeof HideToastAction.KIND;
|
|
21
|
+
options: HideToastAction.Options;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export namespace HideToastAction {
|
|
25
|
+
export const KIND = 'hideToastMessageAction';
|
|
26
|
+
|
|
27
|
+
export type Options = Pick<ToastOptions, 'id' | 'timeout'>;
|
|
28
|
+
|
|
29
|
+
export function is(object: any): object is HideToastAction {
|
|
30
|
+
return Action.hasKind(object, KIND);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function create(options: Options): HideToastAction {
|
|
34
|
+
return { kind: KIND, options };
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface ShowToastMessageAction extends Action {
|
|
39
|
+
kind: typeof ShowToastMessageAction.KIND;
|
|
40
|
+
options: ToastOptions;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export namespace ShowToastMessageAction {
|
|
44
|
+
export const KIND = 'showToastMessageAction';
|
|
45
|
+
export const TIMEOUT = 2000;
|
|
46
|
+
|
|
47
|
+
export type CreateOptions = Partial<ToastOptions> & Required<Pick<ToastOptions, 'message'>>;
|
|
48
|
+
|
|
49
|
+
export function is(object: any): object is ShowToastMessageAction {
|
|
50
|
+
return Action.hasKind(object, KIND);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function create(options: CreateOptions): ShowToastMessageAction {
|
|
54
|
+
return { kind: KIND, options: { ...options, position: options.position ?? 'center', id: options.id ?? Symbol('toast id') } };
|
|
55
|
+
}
|
|
56
|
+
export function createWithTimeout(options: CreateOptions): ShowToastMessageAction {
|
|
57
|
+
return {
|
|
58
|
+
kind: KIND,
|
|
59
|
+
options: { timeout: TIMEOUT, ...options, position: options.position ?? 'center', id: options.id ?? Symbol('toast id') }
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface ToastOptions {
|
|
65
|
+
id: symbol;
|
|
66
|
+
timeout?: number;
|
|
67
|
+
position: 'left' | 'center' | 'right';
|
|
68
|
+
message: string;
|
|
69
|
+
}
|
|
@@ -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 { bindAsService, BindingContext, configureActionHandler, TYPES } from '~glsp-sprotty';
|
|
18
|
+
import '../../../../css/toast.css';
|
|
19
|
+
import { HideToastAction, ShowToastMessageAction } from './toast-handler';
|
|
20
|
+
import { Toast } from './toast-tool';
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Handles toast/user notification actions.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
export const glspToastModule = new ContainerModule((bind, unbind, isBound, rebind) => {
|
|
27
|
+
const context = { bind, unbind, isBound, rebind };
|
|
28
|
+
configureToastTool(context);
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
export function configureToastTool(context: BindingContext): void {
|
|
32
|
+
bindAsService(context, TYPES.IUIExtension, Toast);
|
|
33
|
+
context.bind(TYPES.IDiagramStartup).toService(Toast);
|
|
34
|
+
configureActionHandler(context, ShowToastMessageAction.KIND, Toast);
|
|
35
|
+
configureActionHandler(context, HideToastAction.KIND, Toast);
|
|
36
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
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 { injectable, inject } from 'inversify';
|
|
18
|
+
import { Action, AbstractUIExtension, IActionHandler, ICommand, TYPES } from '~glsp-sprotty';
|
|
19
|
+
import { IDiagramStartup } from '../../../base/model/diagram-loader';
|
|
20
|
+
import { GLSPActionDispatcher } from '../../../base/action-dispatcher';
|
|
21
|
+
import { EditorContextService } from '../../../base/editor-context-service';
|
|
22
|
+
import { HideToastAction, ShowToastMessageAction, ToastOptions } from './toast-handler';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* This extension is used to create customized user notifications as toast messages.
|
|
26
|
+
*/
|
|
27
|
+
@injectable()
|
|
28
|
+
export class Toast extends AbstractUIExtension implements IActionHandler, IDiagramStartup {
|
|
29
|
+
static readonly ID = 'toast';
|
|
30
|
+
protected messages: { [key: symbol]: ToastOptions } = {};
|
|
31
|
+
|
|
32
|
+
@inject(TYPES.IActionDispatcher) protected readonly actionDispatcher: GLSPActionDispatcher;
|
|
33
|
+
@inject(EditorContextService)
|
|
34
|
+
protected editorContext: EditorContextService;
|
|
35
|
+
|
|
36
|
+
id(): string {
|
|
37
|
+
return Toast.ID;
|
|
38
|
+
}
|
|
39
|
+
containerClass(): string {
|
|
40
|
+
return Toast.ID;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
protected initializeContents(_containerElement: HTMLElement): void {
|
|
44
|
+
this.render();
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
handle(action: Action): ICommand | Action | void {
|
|
48
|
+
if (ShowToastMessageAction.is(action)) {
|
|
49
|
+
this.messages[action.options.id] = action.options;
|
|
50
|
+
this.render();
|
|
51
|
+
|
|
52
|
+
if (action.options.timeout) {
|
|
53
|
+
setTimeout(() => {
|
|
54
|
+
this.delete(action.options.id);
|
|
55
|
+
}, action.options.timeout);
|
|
56
|
+
}
|
|
57
|
+
} else if (HideToastAction.is(action)) {
|
|
58
|
+
if (action.options.timeout) {
|
|
59
|
+
setTimeout(() => {
|
|
60
|
+
this.delete(action.options.id);
|
|
61
|
+
}, action.options.timeout);
|
|
62
|
+
} else {
|
|
63
|
+
this.delete(action.options.id);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
protected render(): void {
|
|
69
|
+
if (this.containerElement === undefined) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
this.containerElement.innerHTML = '';
|
|
74
|
+
|
|
75
|
+
this.values(this.messages).forEach(message => {
|
|
76
|
+
this.containerElement.appendChild(this.createToastMessage(message));
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
protected delete(id: symbol): void {
|
|
81
|
+
delete this.messages[id];
|
|
82
|
+
this.render();
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
protected createToastMessage(option: ToastOptions): HTMLDivElement {
|
|
86
|
+
const cell = document.createElement('div');
|
|
87
|
+
cell.classList.add('toast-cell', `toast-column-${option.position}`);
|
|
88
|
+
|
|
89
|
+
const container = document.createElement('div');
|
|
90
|
+
container.classList.add('toast-container');
|
|
91
|
+
|
|
92
|
+
const text = document.createElement('span');
|
|
93
|
+
text.textContent = option.message;
|
|
94
|
+
|
|
95
|
+
container.appendChild(text);
|
|
96
|
+
cell.appendChild(container);
|
|
97
|
+
|
|
98
|
+
return cell;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
preInitialize(): void {
|
|
102
|
+
this.show(this.editorContext.modelRoot);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
values(obj: { [key: symbol]: ToastOptions }): ToastOptions[] {
|
|
106
|
+
return Object.getOwnPropertySymbols(obj).map(s => obj[s]);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
@@ -27,14 +27,14 @@ import {
|
|
|
27
27
|
SwitchEditModeAction,
|
|
28
28
|
isSelectable
|
|
29
29
|
} from '~glsp-sprotty';
|
|
30
|
-
import {
|
|
30
|
+
import { Tool } from '../../../base/tool-manager/tool';
|
|
31
31
|
import { SResizeHandle } from '../../change-bounds/model';
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
34
|
* Deselects the element if there is no interaction possible with element.
|
|
35
35
|
*/
|
|
36
36
|
@injectable()
|
|
37
|
-
export class DeselectKeyTool implements
|
|
37
|
+
export class DeselectKeyTool implements Tool {
|
|
38
38
|
static ID = 'glsp.deselect-key-tool';
|
|
39
39
|
|
|
40
40
|
isEditTool = true;
|
|
@@ -19,7 +19,7 @@ import { matchesKeystroke } from 'sprotty/lib/utils/keyboard';
|
|
|
19
19
|
import { Action, ISnapper, KeyListener, KeyTool, SModelElement, TYPES } from '~glsp-sprotty';
|
|
20
20
|
import { GLSPActionDispatcher } from '../../../base/action-dispatcher';
|
|
21
21
|
import { SelectionService } from '../../../base/selection-service';
|
|
22
|
-
import {
|
|
22
|
+
import { Tool } from '../../../base/tool-manager/tool';
|
|
23
23
|
import { GridSnapper } from '../../change-bounds/snap';
|
|
24
24
|
import { AccessibleKeyShortcutProvider, SetAccessibleKeyShortcutAction } from '../key-shortcut/accessible-key-shortcut';
|
|
25
25
|
import { MoveElementAction, MoveViewportAction } from '../move-zoom/move-handler';
|
|
@@ -28,7 +28,7 @@ import { MoveElementAction, MoveViewportAction } from '../move-zoom/move-handler
|
|
|
28
28
|
* Moves viewport and elements when its focused and arrow keys are hit.
|
|
29
29
|
*/
|
|
30
30
|
@injectable()
|
|
31
|
-
export class MovementKeyTool implements
|
|
31
|
+
export class MovementKeyTool implements Tool {
|
|
32
32
|
static ID = 'glsp.movement-key-tool';
|
|
33
33
|
|
|
34
34
|
isEditTool = true;
|
|
@@ -74,14 +74,12 @@ export class MoveKeyListener extends KeyListener implements AccessibleKeyShortcu
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
registerShortcutKey(): void {
|
|
77
|
-
this.tool.actionDispatcher.
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
]);
|
|
84
|
-
});
|
|
77
|
+
this.tool.actionDispatcher.dispatchOnceModelInitialized(
|
|
78
|
+
SetAccessibleKeyShortcutAction.create({
|
|
79
|
+
token: this.token,
|
|
80
|
+
keys: [{ shortcuts: ['⬅ ⬆ ➡ ⬇'], description: 'Move element or viewport', group: 'Move', position: 0 }]
|
|
81
|
+
})
|
|
82
|
+
);
|
|
85
83
|
}
|
|
86
84
|
|
|
87
85
|
override keyDown(element: SModelElement, event: KeyboardEvent): Action[] {
|
|
@@ -19,7 +19,7 @@ import { matchesKeystroke } from 'sprotty/lib/utils/keyboard';
|
|
|
19
19
|
import { Action, CenterAction, KeyListener, KeyTool, SModelElement, TYPES } from '~glsp-sprotty';
|
|
20
20
|
import { GLSPActionDispatcher } from '../../../base/action-dispatcher';
|
|
21
21
|
import { SelectionService } from '../../../base/selection-service';
|
|
22
|
-
import {
|
|
22
|
+
import { Tool } from '../../../base/tool-manager/tool';
|
|
23
23
|
import { SetAccessibleKeyShortcutAction } from '../key-shortcut/accessible-key-shortcut';
|
|
24
24
|
import { ZoomElementAction, ZoomViewportAction } from '../move-zoom/zoom-handler';
|
|
25
25
|
|
|
@@ -27,7 +27,7 @@ import { ZoomElementAction, ZoomViewportAction } from '../move-zoom/zoom-handler
|
|
|
27
27
|
* Zoom viewport and elements when its focused and arrow keys are hit.
|
|
28
28
|
*/
|
|
29
29
|
@injectable()
|
|
30
|
-
export class ZoomKeyTool implements
|
|
30
|
+
export class ZoomKeyTool implements Tool {
|
|
31
31
|
static ID = 'glsp.zoom-key-tool';
|
|
32
32
|
|
|
33
33
|
isEditTool = false;
|
|
@@ -62,19 +62,17 @@ export class ZoomKeyListener extends KeyListener {
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
registerShortcutKey(): void {
|
|
65
|
-
this.tool.actionDispatcher.
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
]);
|
|
77
|
-
});
|
|
65
|
+
this.tool.actionDispatcher.dispatchOnceModelInitialized(
|
|
66
|
+
SetAccessibleKeyShortcutAction.create({
|
|
67
|
+
token: this.token,
|
|
68
|
+
keys: [
|
|
69
|
+
{ shortcuts: ['+'], description: 'Zoom in to element or viewport', group: 'Zoom', position: 0 },
|
|
70
|
+
{ shortcuts: ['-'], description: 'Zoom out to element or viewport', group: 'Zoom', position: 1 },
|
|
71
|
+
{ shortcuts: ['CTRL', '0'], description: 'Reset zoom to default', group: 'Zoom', position: 2 },
|
|
72
|
+
{ shortcuts: ['CTRL', '+'], description: 'Zoom in via Grid', group: 'Zoom', position: 3 }
|
|
73
|
+
]
|
|
74
|
+
})
|
|
75
|
+
);
|
|
78
76
|
}
|
|
79
77
|
|
|
80
78
|
override keyDown(element: SModelElement, event: KeyboardEvent): Action[] {
|
|
@@ -18,7 +18,6 @@ import {
|
|
|
18
18
|
HBoxLayouter,
|
|
19
19
|
HiddenBoundsUpdater,
|
|
20
20
|
LayoutRegistry,
|
|
21
|
-
Layouter,
|
|
22
21
|
RequestBoundsCommand,
|
|
23
22
|
SetBoundsCommand,
|
|
24
23
|
TYPES,
|
|
@@ -30,6 +29,7 @@ import {
|
|
|
30
29
|
import { FreeFormLayouter } from './freeform-layout';
|
|
31
30
|
import { GLSPHiddenBoundsUpdater } from './glsp-hidden-bounds-updater';
|
|
32
31
|
import { HBoxLayouterExt } from './hbox-layout';
|
|
32
|
+
import { LayouterExt } from './layouter';
|
|
33
33
|
import { VBoxLayouterExt } from './vbox-layout';
|
|
34
34
|
|
|
35
35
|
export const boundsModule = new FeatureModule((bind, _unbind, isBound, _rebind) => {
|
|
@@ -38,7 +38,7 @@ export const boundsModule = new FeatureModule((bind, _unbind, isBound, _rebind)
|
|
|
38
38
|
configureCommand(context, RequestBoundsCommand);
|
|
39
39
|
bind(HiddenBoundsUpdater).toSelf().inSingletonScope();
|
|
40
40
|
bindAsService(context, TYPES.HiddenVNodePostprocessor, GLSPHiddenBoundsUpdater);
|
|
41
|
-
bind(TYPES.Layouter).to(
|
|
41
|
+
bind(TYPES.Layouter).to(LayouterExt).inSingletonScope();
|
|
42
42
|
bind(TYPES.LayoutRegistry).to(LayoutRegistry).inSingletonScope();
|
|
43
43
|
|
|
44
44
|
configureLayout(context, VBoxLayouter.KIND, VBoxLayouterExt);
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
import { inject, injectable, postConstruct } from 'inversify';
|
|
17
|
-
import { CommandPaletteKeyListener, KeyListener, KeyTool
|
|
17
|
+
import { CommandPaletteKeyListener, KeyListener, KeyTool } from '~glsp-sprotty';
|
|
18
|
+
import { Tool } from '../../base/tool-manager/tool';
|
|
18
19
|
|
|
19
20
|
@injectable()
|
|
20
21
|
export class CommandPaletteTool implements Tool {
|
|
@@ -38,7 +38,7 @@ export class ServerCommandPaletteActionProvider implements ICommandPaletteAction
|
|
|
38
38
|
@inject(TYPES.IActionDispatcher) protected actionDispatcher: GLSPActionDispatcher;
|
|
39
39
|
@inject(EditorContextService) protected editorContext: EditorContextService;
|
|
40
40
|
|
|
41
|
-
getActions(_root: Readonly<SModelElement>, text: string, _lastMousePosition?: Point, index?: number): Promise<LabeledAction[]> {
|
|
41
|
+
async getActions(_root: Readonly<SModelElement>, text: string, _lastMousePosition?: Point, index?: number): Promise<LabeledAction[]> {
|
|
42
42
|
const requestAction = RequestContextActions.create({
|
|
43
43
|
contextId: ServerCommandPalette.CONTEXT_ID,
|
|
44
44
|
editorContext: this.editorContext.get({
|
|
@@ -46,7 +46,8 @@ export class ServerCommandPaletteActionProvider implements ICommandPaletteAction
|
|
|
46
46
|
[ServerCommandPalette.INDEX]: index ? index : 0
|
|
47
47
|
})
|
|
48
48
|
});
|
|
49
|
-
|
|
49
|
+
const response = await this.actionDispatcher.requestUntil(requestAction);
|
|
50
|
+
return response ? this.getPaletteActionsFromResponse(response) : [];
|
|
50
51
|
}
|
|
51
52
|
|
|
52
53
|
getPaletteActionsFromResponse(action: Action): LabeledAction[] {
|
|
@@ -14,21 +14,20 @@
|
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
import { ContextMenuProviderRegistry, FeatureModule, IContextMenuService, TYPES, bindAsService } from '~glsp-sprotty';
|
|
17
|
-
import {
|
|
17
|
+
import { GLSPContextMenuMouseListener } from './glsp-context-menu-mouse-listener';
|
|
18
18
|
import { ServerContextMenuItemProvider } from './server-context-menu-provider';
|
|
19
19
|
|
|
20
20
|
export const contextMenuModule = new FeatureModule(bind => {
|
|
21
|
-
bind(TYPES.IContextMenuServiceProvider).toProvider<IContextMenuService>(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
);
|
|
31
|
-
bindAsService(bind, TYPES.MouseListener, SelectionServiceAwareContextMenuMouseListener);
|
|
21
|
+
bind(TYPES.IContextMenuServiceProvider).toProvider<IContextMenuService>(ctx => async () => {
|
|
22
|
+
if (ctx.container.isBound(TYPES.IContextMenuService)) {
|
|
23
|
+
return ctx.container.get<IContextMenuService>(TYPES.IContextMenuService);
|
|
24
|
+
}
|
|
25
|
+
console.warn("'TYPES.IContextMenuService' is not bound. Use no-op implementation instead");
|
|
26
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
27
|
+
return { show: () => {} };
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
bindAsService(bind, TYPES.MouseListener, GLSPContextMenuMouseListener);
|
|
32
31
|
bind(TYPES.IContextMenuProviderRegistry).to(ContextMenuProviderRegistry);
|
|
33
32
|
bindAsService(bind, TYPES.IContextMenuItemProvider, ServerContextMenuItemProvider);
|
|
34
33
|
});
|
|
@@ -16,10 +16,9 @@
|
|
|
16
16
|
import { inject, injectable, optional } from 'inversify';
|
|
17
17
|
import { Action, ContextMenuProviderRegistry, IContextMenuServiceProvider, MouseListener, SModelElement, TYPES } from '~glsp-sprotty';
|
|
18
18
|
import { FocusStateChangedAction } from '../../base/focus/focus-state-change-action';
|
|
19
|
-
import { SelectionService } from '../../base/selection-service';
|
|
20
19
|
|
|
21
20
|
@injectable()
|
|
22
|
-
export class
|
|
21
|
+
export class GLSPContextMenuMouseListener extends MouseListener {
|
|
23
22
|
@inject(TYPES.IContextMenuServiceProvider)
|
|
24
23
|
@optional()
|
|
25
24
|
protected readonly contextMenuService?: IContextMenuServiceProvider;
|
|
@@ -28,9 +27,6 @@ export class SelectionServiceAwareContextMenuMouseListener extends MouseListener
|
|
|
28
27
|
@optional()
|
|
29
28
|
protected readonly menuProvider?: ContextMenuProviderRegistry;
|
|
30
29
|
|
|
31
|
-
@inject(SelectionService)
|
|
32
|
-
protected selectionService: SelectionService;
|
|
33
|
-
|
|
34
30
|
/**
|
|
35
31
|
* Opens the context menu.
|
|
36
32
|
*/
|
|
@@ -37,7 +37,7 @@ export class ServerContextMenuItemProvider implements IContextMenuItemProvider {
|
|
|
37
37
|
@inject(TYPES.IActionDispatcher) protected actionDispatcher: GLSPActionDispatcher;
|
|
38
38
|
@inject(EditorContextService) protected editorContext: EditorContextService;
|
|
39
39
|
|
|
40
|
-
getItems(root: Readonly<SModelElement>,
|
|
40
|
+
async getItems(root: Readonly<SModelElement>, _lastMousePosition?: Point): Promise<LabeledAction[]> {
|
|
41
41
|
const selectedElementIds = Array.from(
|
|
42
42
|
root.index
|
|
43
43
|
.all()
|
|
@@ -46,7 +46,8 @@ export class ServerContextMenuItemProvider implements IContextMenuItemProvider {
|
|
|
46
46
|
);
|
|
47
47
|
const editorContext = this.editorContext.getWithSelection(selectedElementIds);
|
|
48
48
|
const requestAction = RequestContextActions.create({ contextId: ServerContextMenu.CONTEXT_ID, editorContext });
|
|
49
|
-
|
|
49
|
+
const response = await this.actionDispatcher.requestUntil(requestAction);
|
|
50
|
+
return response ? this.getContextActionsFromResponse(response) : [];
|
|
50
51
|
}
|
|
51
52
|
|
|
52
53
|
getContextActionsFromResponse(action: Action): LabeledAction[] {
|
|
@@ -23,8 +23,8 @@ import {
|
|
|
23
23
|
MenuItem,
|
|
24
24
|
Point,
|
|
25
25
|
SModelRoot,
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
MessageAction,
|
|
27
|
+
StatusAction,
|
|
28
28
|
TYPES,
|
|
29
29
|
hasStringProp,
|
|
30
30
|
isSelected
|
|
@@ -83,10 +83,7 @@ export class InvokeCopyPasteActionHandler implements IActionHandler {
|
|
|
83
83
|
const message = `Please use the browser's ${operation} command or shortcut.`;
|
|
84
84
|
const timeout = 10000;
|
|
85
85
|
const severity = 'WARNING';
|
|
86
|
-
this.dispatcher.dispatchAll([
|
|
87
|
-
ServerStatusAction.create(message, { severity, timeout }),
|
|
88
|
-
ServerMessageAction.create(message, { severity })
|
|
89
|
-
]);
|
|
86
|
+
this.dispatcher.dispatchAll([StatusAction.create(message, { severity, timeout }), MessageAction.create(message, { severity })]);
|
|
90
87
|
}
|
|
91
88
|
}
|
|
92
89
|
|
|
@@ -13,12 +13,13 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
import { FeatureModule, SetTypeHintsAction, TYPES, configureActionHandler, configureCommand } from '~glsp-sprotty';
|
|
16
|
+
import { FeatureModule, SetTypeHintsAction, TYPES, bindAsService, configureActionHandler, configureCommand } from '~glsp-sprotty';
|
|
17
17
|
import { ApplyTypeHintsCommand, TypeHintProvider } from './type-hints';
|
|
18
18
|
|
|
19
|
-
export const typeHintsModule = new FeatureModule((bind,
|
|
20
|
-
bind
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
export const typeHintsModule = new FeatureModule((bind, unbind, isBound) => {
|
|
20
|
+
const context = { bind, unbind, isBound };
|
|
21
|
+
bindAsService(context, TYPES.ITypeHintProvider, TypeHintProvider);
|
|
22
|
+
bind(TYPES.IDiagramStartup).toService(TypeHintProvider);
|
|
23
|
+
configureActionHandler(context, SetTypeHintsAction.KIND, TypeHintProvider);
|
|
24
|
+
configureCommand(context, ApplyTypeHintsCommand);
|
|
24
25
|
});
|
|
@@ -23,6 +23,8 @@ import {
|
|
|
23
23
|
FeatureSet,
|
|
24
24
|
IActionHandler,
|
|
25
25
|
ICommand,
|
|
26
|
+
MaybePromise,
|
|
27
|
+
RequestTypeHintsAction,
|
|
26
28
|
SEdge,
|
|
27
29
|
SModelElement,
|
|
28
30
|
SModelRoot,
|
|
@@ -36,8 +38,10 @@ import {
|
|
|
36
38
|
editFeature,
|
|
37
39
|
moveFeature
|
|
38
40
|
} from '~glsp-sprotty';
|
|
41
|
+
import { GLSPActionDispatcher } from '../../base/action-dispatcher';
|
|
39
42
|
import { IFeedbackActionDispatcher } from '../../base/feedback/feedback-action-dispatcher';
|
|
40
43
|
import { FeedbackCommand } from '../../base/feedback/feedback-command';
|
|
44
|
+
import { IDiagramStartup } from '../../base/model/diagram-loader';
|
|
41
45
|
import { getElementTypeId, hasCompatibleType } from '../../utils/smodel-util';
|
|
42
46
|
import { resizeFeature } from '../change-bounds/model';
|
|
43
47
|
import { reconnectFeature } from '../reconnect/model';
|
|
@@ -149,10 +153,13 @@ export interface ITypeHintProvider {
|
|
|
149
153
|
}
|
|
150
154
|
|
|
151
155
|
@injectable()
|
|
152
|
-
export class TypeHintProvider implements IActionHandler, ITypeHintProvider {
|
|
156
|
+
export class TypeHintProvider implements IActionHandler, ITypeHintProvider, IDiagramStartup {
|
|
153
157
|
@inject(TYPES.IFeedbackActionDispatcher)
|
|
154
158
|
protected feedbackActionDispatcher: IFeedbackActionDispatcher;
|
|
155
159
|
|
|
160
|
+
@inject(GLSPActionDispatcher)
|
|
161
|
+
protected actionDispatcher: GLSPActionDispatcher;
|
|
162
|
+
|
|
156
163
|
protected shapeHints: Map<string, ShapeTypeHint> = new Map();
|
|
157
164
|
protected edgeHints: Map<string, EdgeTypeHint> = new Map();
|
|
158
165
|
|
|
@@ -192,6 +199,10 @@ export class TypeHintProvider implements IActionHandler, ITypeHintProvider {
|
|
|
192
199
|
getEdgeTypeHint(input: SModelElement | SModelElement | string): EdgeTypeHint | undefined {
|
|
193
200
|
return getTypeHint(input, this.edgeHints);
|
|
194
201
|
}
|
|
202
|
+
|
|
203
|
+
postRequestModel(): MaybePromise<void> {
|
|
204
|
+
this.actionDispatcher.dispatch(RequestTypeHintsAction.create());
|
|
205
|
+
}
|
|
195
206
|
}
|
|
196
207
|
|
|
197
208
|
function getTypeHint<T extends TypeHint>(input: SModelElement | SModelElement | string, hints: Map<string, T>): T | undefined {
|
|
@@ -16,8 +16,6 @@
|
|
|
16
16
|
import {
|
|
17
17
|
CenterCommand,
|
|
18
18
|
ClosePopupActionHandler,
|
|
19
|
-
EnableDefaultToolsAction,
|
|
20
|
-
EnableToolsAction,
|
|
21
19
|
FeatureModule,
|
|
22
20
|
FitToScreenCommand,
|
|
23
21
|
HoverFeedbackCommand,
|
|
@@ -34,6 +32,7 @@ import {
|
|
|
34
32
|
configureCommand
|
|
35
33
|
} from '~glsp-sprotty';
|
|
36
34
|
import { FocusStateChangedAction } from '../../base/focus/focus-state-change-action';
|
|
35
|
+
import { EnableDefaultToolsAction, EnableToolsAction } from '../../base/tool-manager/tool';
|
|
37
36
|
import { GlspHoverMouseListener } from './hover';
|
|
38
37
|
|
|
39
38
|
export const hoverModule = new FeatureModule((bind, _unbind, isBound) => {
|