@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
|
@@ -18,8 +18,6 @@ import {
|
|
|
18
18
|
Action,
|
|
19
19
|
Bounds,
|
|
20
20
|
EMPTY_ROOT,
|
|
21
|
-
EnableDefaultToolsAction,
|
|
22
|
-
EnableToolsAction,
|
|
23
21
|
HoverFeedbackAction,
|
|
24
22
|
HoverMouseListener,
|
|
25
23
|
IActionHandler,
|
|
@@ -32,6 +30,7 @@ import {
|
|
|
32
30
|
SetPopupModelAction
|
|
33
31
|
} from '~glsp-sprotty';
|
|
34
32
|
import { FocusStateChangedAction } from '../../base/focus/focus-state-change-action';
|
|
33
|
+
import { EnableDefaultToolsAction, EnableToolsAction } from '../../base/tool-manager/tool';
|
|
35
34
|
import { EdgeCreationTool } from '../tools/edge-creation/edge-creation-tool';
|
|
36
35
|
import { GIssueMarker, getSeverity } from '../validation/issue-marker';
|
|
37
36
|
|
|
@@ -75,7 +74,7 @@ export class GlspHoverMouseListener extends HoverMouseListener implements IActio
|
|
|
75
74
|
this.state.mouseOverTimer = window.setTimeout(() => {
|
|
76
75
|
const popupBounds = this.computePopupBounds(target, { x: event.pageX, y: event.pageY });
|
|
77
76
|
if (target instanceof GIssueMarker) {
|
|
78
|
-
resolve(SetPopupModelAction.create(this.createPopupModel(target
|
|
77
|
+
resolve(SetPopupModelAction.create(this.createPopupModel(target, popupBounds)));
|
|
79
78
|
} else {
|
|
80
79
|
resolve(RequestPopupModelAction.create({ elementId: target.id, bounds: popupBounds }));
|
|
81
80
|
}
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
import { injectable } from 'inversify';
|
|
17
17
|
import { EditLabelKeyListener, EditLabelMouseListener, KeyListener, MouseListener } from '~glsp-sprotty';
|
|
18
|
-
import {
|
|
18
|
+
import { BaseEditTool } from '../tools/base-tools';
|
|
19
19
|
|
|
20
20
|
@injectable()
|
|
21
|
-
export class DirectLabelEditTool extends
|
|
21
|
+
export class DirectLabelEditTool extends BaseEditTool {
|
|
22
22
|
static readonly ID = 'glsp.direct-label-edit-tool';
|
|
23
23
|
|
|
24
24
|
get id(): string {
|
|
@@ -34,11 +34,11 @@ export namespace LabelEditValidation {
|
|
|
34
34
|
|
|
35
35
|
export function toEditLabelValidationResult(status: ValidationStatus): EditLabelValidationResult {
|
|
36
36
|
const message = status.message;
|
|
37
|
-
let severity = 'ok'
|
|
37
|
+
let severity: Severity = 'ok';
|
|
38
38
|
if (ValidationStatus.isError(status)) {
|
|
39
|
-
severity = 'error'
|
|
39
|
+
severity = 'error';
|
|
40
40
|
} else if (ValidationStatus.isWarning(status)) {
|
|
41
|
-
severity = 'warning'
|
|
41
|
+
severity = 'warning';
|
|
42
42
|
}
|
|
43
43
|
return { message, severity };
|
|
44
44
|
}
|
|
@@ -52,16 +52,17 @@ export namespace LabelEditValidation {
|
|
|
52
52
|
export class ServerEditLabelValidator implements IEditLabelValidator {
|
|
53
53
|
@inject(TYPES.IActionDispatcher) protected actionDispatcher: GLSPActionDispatcher;
|
|
54
54
|
|
|
55
|
-
validate(value: string, label: EditableLabel & SModelElement): Promise<EditLabelValidationResult> {
|
|
55
|
+
async validate(value: string, label: EditableLabel & SModelElement): Promise<EditLabelValidationResult> {
|
|
56
56
|
const action = LabelEditValidation.createValidationRequestAction(value, label.id);
|
|
57
|
-
|
|
57
|
+
const response = await this.actionDispatcher.requestUntil(action);
|
|
58
|
+
return response ? this.getValidationResultFromResponse(response) : { severity: 'ok' };
|
|
58
59
|
}
|
|
59
60
|
|
|
60
61
|
getValidationResultFromResponse(action: Action): EditLabelValidationResult {
|
|
61
62
|
if (SetEditValidationResultAction.is(action)) {
|
|
62
63
|
return LabelEditValidation.toEditLabelValidationResult(action.status);
|
|
63
64
|
}
|
|
64
|
-
return { severity: 'ok'
|
|
65
|
+
return { severity: 'ok' };
|
|
65
66
|
}
|
|
66
67
|
}
|
|
67
68
|
|
|
@@ -23,17 +23,17 @@ import {
|
|
|
23
23
|
IActionHandler,
|
|
24
24
|
ICommand,
|
|
25
25
|
ILogger,
|
|
26
|
+
MessageAction,
|
|
26
27
|
NavigateToExternalTargetAction,
|
|
27
28
|
NavigateToTargetAction,
|
|
28
29
|
NavigationTarget,
|
|
29
30
|
RequestNavigationTargetsAction,
|
|
30
31
|
SelectAction,
|
|
31
32
|
SelectAllAction,
|
|
32
|
-
ServerMessageAction,
|
|
33
|
-
ServerSeverity,
|
|
34
|
-
ServerStatusAction,
|
|
35
33
|
SetNavigationTargetsAction,
|
|
36
34
|
SetResolvedNavigationTargetAction,
|
|
35
|
+
SeverityLevel,
|
|
36
|
+
StatusAction,
|
|
37
37
|
TYPES,
|
|
38
38
|
hasObjectProp,
|
|
39
39
|
hasStringProp
|
|
@@ -264,11 +264,8 @@ export class NavigationActionHandler implements IActionHandler {
|
|
|
264
264
|
this.notify('WARNING', message);
|
|
265
265
|
}
|
|
266
266
|
|
|
267
|
-
private notify(severity:
|
|
267
|
+
private notify(severity: SeverityLevel, message: string): void {
|
|
268
268
|
const timeout = this.notificationTimeout;
|
|
269
|
-
this.dispatcher.dispatchAll([
|
|
270
|
-
ServerStatusAction.create(message, { severity, timeout }),
|
|
271
|
-
ServerMessageAction.create(message, { severity })
|
|
272
|
-
]);
|
|
269
|
+
this.dispatcher.dispatchAll([StatusAction.create(message, { severity, timeout }), MessageAction.create(message, { severity })]);
|
|
273
270
|
}
|
|
274
271
|
}
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
SetResolvedNavigationTargetAction,
|
|
24
24
|
TYPES
|
|
25
25
|
} from '~glsp-sprotty';
|
|
26
|
-
import {
|
|
26
|
+
import { IDiagramOptions } from '../../base/model/diagram-loader';
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* Resolves `NavigationTargets` to element ids.
|
|
@@ -33,14 +33,17 @@ import { EditorContextServiceProvider } from '../../base/editor-context-service'
|
|
|
33
33
|
*/
|
|
34
34
|
@injectable()
|
|
35
35
|
export class NavigationTargetResolver {
|
|
36
|
-
@inject(TYPES.
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
@inject(TYPES.IActionDispatcher)
|
|
37
|
+
protected dispatcher: IActionDispatcher;
|
|
38
|
+
|
|
39
|
+
@inject(TYPES.ILogger)
|
|
40
|
+
protected logger: ILogger;
|
|
41
|
+
|
|
42
|
+
@inject(TYPES.IDiagramOptions)
|
|
43
|
+
protected diagramOptions: IDiagramOptions;
|
|
39
44
|
|
|
40
45
|
async resolve(navigationTarget: NavigationTarget): Promise<SetResolvedNavigationTargetAction | undefined> {
|
|
41
|
-
|
|
42
|
-
const sourceUri = await contextService.getSourceUri();
|
|
43
|
-
return this.resolveWithSourceUri(sourceUri, navigationTarget);
|
|
46
|
+
return this.resolveWithSourceUri(this.diagramOptions.sourceUri, navigationTarget);
|
|
44
47
|
}
|
|
45
48
|
|
|
46
49
|
async resolveWithSourceUri(
|
|
@@ -13,22 +13,7 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
import {
|
|
17
|
-
Action,
|
|
18
|
-
BringToFrontAction,
|
|
19
|
-
SButton,
|
|
20
|
-
SModelElement,
|
|
21
|
-
SModelRoot,
|
|
22
|
-
SRoutableElement,
|
|
23
|
-
SRoutingHandle,
|
|
24
|
-
SelectAction,
|
|
25
|
-
SelectMouseListener,
|
|
26
|
-
SwitchEditModeAction,
|
|
27
|
-
findParentByFeature,
|
|
28
|
-
isCtrlOrCmd,
|
|
29
|
-
isSelectable,
|
|
30
|
-
toArray
|
|
31
|
-
} from '~glsp-sprotty';
|
|
16
|
+
import { Action, BringToFrontAction, SModelElement, SelectAction, SelectMouseListener, Selectable } from '~glsp-sprotty';
|
|
32
17
|
import { Ranked } from '../../base/ranked';
|
|
33
18
|
|
|
34
19
|
/**
|
|
@@ -36,71 +21,34 @@ import { Ranked } from '../../base/ranked';
|
|
|
36
21
|
* This ensures that default mouse listeners are working on a model that has selection changes already applied.
|
|
37
22
|
*/
|
|
38
23
|
export class RankedSelectMouseListener extends SelectMouseListener implements Ranked {
|
|
39
|
-
rank: number = Ranked.DEFAULT_RANK -
|
|
24
|
+
rank: number = Ranked.DEFAULT_RANK - 100; /* we want to be executed before all default mouse listeners */
|
|
40
25
|
|
|
41
|
-
override
|
|
26
|
+
protected override handleSelectTarget(
|
|
27
|
+
selectableTarget: SModelElement & Selectable,
|
|
28
|
+
deselectedElements: SModelElement[],
|
|
29
|
+
event: MouseEvent
|
|
30
|
+
): (Action | Promise<Action>)[] {
|
|
42
31
|
const result: Action[] = [];
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
)
|
|
64
|
-
);
|
|
65
|
-
}
|
|
66
|
-
if (selectableTarget !== undefined) {
|
|
67
|
-
if (!selectableTarget.selected) {
|
|
68
|
-
this.wasSelected = false;
|
|
69
|
-
result.push(
|
|
70
|
-
SelectAction.create({
|
|
71
|
-
selectedElementsIDs: [selectableTarget.id],
|
|
72
|
-
deselectedElementsIDs: deselect.map(e => e.id)
|
|
73
|
-
})
|
|
74
|
-
);
|
|
75
|
-
result.push(BringToFrontAction.create([selectableTarget.id]));
|
|
76
|
-
const routableDeselect = deselect.filter(e => e instanceof SRoutableElement).map(e => e.id);
|
|
77
|
-
if (selectableTarget instanceof SRoutableElement) {
|
|
78
|
-
result.push(
|
|
79
|
-
SwitchEditModeAction.create({
|
|
80
|
-
elementsToActivate: [selectableTarget.id],
|
|
81
|
-
elementsToDeactivate: routableDeselect
|
|
82
|
-
})
|
|
83
|
-
);
|
|
84
|
-
} else if (routableDeselect.length > 0) {
|
|
85
|
-
result.push(SwitchEditModeAction.create({ elementsToDeactivate: routableDeselect }));
|
|
86
|
-
}
|
|
87
|
-
} else if (isCtrlOrCmd(event)) {
|
|
88
|
-
this.wasSelected = false;
|
|
89
|
-
result.push(SelectAction.create({ deselectedElementsIDs: [selectableTarget.id] }));
|
|
90
|
-
if (selectableTarget instanceof SRoutableElement) {
|
|
91
|
-
result.push(SwitchEditModeAction.create({ elementsToDeactivate: [selectableTarget.id] }));
|
|
92
|
-
}
|
|
93
|
-
} else {
|
|
94
|
-
this.wasSelected = true;
|
|
95
|
-
}
|
|
96
|
-
} else {
|
|
97
|
-
result.push(SelectAction.create({ deselectedElementsIDs: deselect.map(e => e.id) }));
|
|
98
|
-
const routableDeselect = deselect.filter(e => e instanceof SRoutableElement).map(e => e.id);
|
|
99
|
-
if (routableDeselect.length > 0) {
|
|
100
|
-
result.push(SwitchEditModeAction.create({ elementsToDeactivate: routableDeselect }));
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
}
|
|
32
|
+
result.push(
|
|
33
|
+
SelectAction.create({
|
|
34
|
+
selectedElementsIDs: [selectableTarget.id],
|
|
35
|
+
deselectedElementsIDs: deselectedElements.map(e => e.id)
|
|
36
|
+
})
|
|
37
|
+
);
|
|
38
|
+
result.push(BringToFrontAction.create([selectableTarget.id]));
|
|
39
|
+
|
|
40
|
+
return result;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
protected override handleDeselectTarget(selectableTarget: SModelElement & Selectable, event: MouseEvent): (Action | Promise<Action>)[] {
|
|
44
|
+
const result: Action[] = [];
|
|
45
|
+
result.push(SelectAction.create({ selectedElementsIDs: [], deselectedElementsIDs: [selectableTarget.id] }));
|
|
46
|
+
return result;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
protected override handleDeselectAll(deselectedElements: SModelElement[], event: MouseEvent): (Action | Promise<Action>)[] {
|
|
50
|
+
const result: Action[] = [];
|
|
51
|
+
result.push(SelectAction.create({ selectedElementsIDs: [], deselectedElementsIDs: deselectedElements.map(e => e.id) }));
|
|
104
52
|
return result;
|
|
105
53
|
}
|
|
106
54
|
}
|
|
@@ -18,9 +18,9 @@ import {
|
|
|
18
18
|
Action,
|
|
19
19
|
IActionDispatcher,
|
|
20
20
|
IActionHandler,
|
|
21
|
-
|
|
22
|
-
ServerStatusAction,
|
|
21
|
+
MessageAction,
|
|
23
22
|
SourceModelChangedAction,
|
|
23
|
+
StatusAction,
|
|
24
24
|
TYPES,
|
|
25
25
|
ViewerOptions
|
|
26
26
|
} from '~glsp-sprotty';
|
|
@@ -68,9 +68,6 @@ export class SourceModelChangedActionHandler implements IActionHandler {
|
|
|
68
68
|
const message = `The source model ${action.sourceModelName} has changed. You might want to consider reloading.`;
|
|
69
69
|
const timeout = 0;
|
|
70
70
|
const severity = 'WARNING';
|
|
71
|
-
this.dispatcher.dispatchAll([
|
|
72
|
-
ServerStatusAction.create(message, { severity, timeout }),
|
|
73
|
-
ServerMessageAction.create(message, { severity })
|
|
74
|
-
]);
|
|
71
|
+
this.dispatcher.dispatchAll([StatusAction.create(message, { severity, timeout }), MessageAction.create(message, { severity })]);
|
|
75
72
|
}
|
|
76
73
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
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 { FeatureModule, StatusAction, TYPES, bindAsService, configureActionHandler } from '~glsp-sprotty';
|
|
18
|
+
import '../../../css/status-overlay.css';
|
|
19
|
+
import { StatusOverlay } from './status-overlay';
|
|
20
|
+
|
|
21
|
+
export const statusModule = new FeatureModule((bind, unbind, isBound, rebind) => {
|
|
22
|
+
const context = { bind, unbind, isBound, rebind };
|
|
23
|
+
bindAsService(context, TYPES.IUIExtension, StatusOverlay);
|
|
24
|
+
bind(TYPES.IDiagramStartup).toService(StatusOverlay);
|
|
25
|
+
configureActionHandler(context, StatusAction.KIND, StatusOverlay);
|
|
26
|
+
});
|
|
@@ -0,0 +1,121 @@
|
|
|
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
|
+
import { inject, injectable } from 'inversify';
|
|
17
|
+
import { AbstractUIExtension, IActionHandler, StatusAction, codiconCSSClasses } from '~glsp-sprotty';
|
|
18
|
+
import { GLSPActionDispatcher } from '../../base/action-dispatcher';
|
|
19
|
+
import { EditorContextService } from '../../base/editor-context-service';
|
|
20
|
+
import { IDiagramStartup } from '../../base/model/diagram-loader';
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* A reusable status overlay for rendering (icon + message) and handling of {@link StatusAction}'s.
|
|
24
|
+
*/
|
|
25
|
+
@injectable()
|
|
26
|
+
export class StatusOverlay extends AbstractUIExtension implements IActionHandler, IDiagramStartup {
|
|
27
|
+
static readonly ID = 'glsp.server.status.overlay';
|
|
28
|
+
|
|
29
|
+
@inject(GLSPActionDispatcher)
|
|
30
|
+
protected actionDispatcher: GLSPActionDispatcher;
|
|
31
|
+
|
|
32
|
+
@inject(EditorContextService)
|
|
33
|
+
protected editorContext: EditorContextService;
|
|
34
|
+
|
|
35
|
+
protected statusIconDiv?: HTMLDivElement;
|
|
36
|
+
protected statusMessageDiv?: HTMLDivElement;
|
|
37
|
+
protected pendingTimeout?: number;
|
|
38
|
+
|
|
39
|
+
override id(): string {
|
|
40
|
+
return StatusOverlay.ID;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
override containerClass(): string {
|
|
44
|
+
return 'sprotty-status';
|
|
45
|
+
}
|
|
46
|
+
protected override initializeContents(containerElement: HTMLElement): void {
|
|
47
|
+
this.statusIconDiv = document.createElement('div');
|
|
48
|
+
containerElement.appendChild(this.statusIconDiv);
|
|
49
|
+
|
|
50
|
+
this.statusMessageDiv = document.createElement('div');
|
|
51
|
+
this.statusMessageDiv.classList.add('sprotty-status-message');
|
|
52
|
+
containerElement.appendChild(this.statusMessageDiv);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
protected setStatus(status: StatusAction): void {
|
|
56
|
+
if (this.statusMessageDiv) {
|
|
57
|
+
this.statusMessageDiv.textContent = status.message;
|
|
58
|
+
this.removeClasses(this.statusMessageDiv, 1);
|
|
59
|
+
this.statusMessageDiv.classList.add(status.severity.toLowerCase());
|
|
60
|
+
}
|
|
61
|
+
if (this.statusIconDiv) {
|
|
62
|
+
this.removeClasses(this.statusIconDiv, 0);
|
|
63
|
+
const classes = this.statusIconDiv.classList;
|
|
64
|
+
classes.add(status.severity.toLowerCase());
|
|
65
|
+
switch (status.severity) {
|
|
66
|
+
case 'FATAL':
|
|
67
|
+
classes.add(...codiconCSSClasses('error'));
|
|
68
|
+
break;
|
|
69
|
+
case 'ERROR':
|
|
70
|
+
classes.add(...codiconCSSClasses('warning'));
|
|
71
|
+
break;
|
|
72
|
+
case 'WARNING':
|
|
73
|
+
classes.add(...codiconCSSClasses('warning'));
|
|
74
|
+
break;
|
|
75
|
+
case 'INFO':
|
|
76
|
+
classes.add(...codiconCSSClasses('info'));
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
protected clearStatus(): void {
|
|
83
|
+
this.setStatus(StatusAction.create('', { severity: 'NONE' }));
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
protected clearTimeout(): void {
|
|
87
|
+
if (this.pendingTimeout) {
|
|
88
|
+
window.clearTimeout(this.pendingTimeout);
|
|
89
|
+
this.pendingTimeout = undefined;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
protected removeClasses(element: Element, keep: number): void {
|
|
94
|
+
const classes = element.classList;
|
|
95
|
+
while (classes.length > keep) {
|
|
96
|
+
const item = classes.item(classes.length - 1);
|
|
97
|
+
if (item) {
|
|
98
|
+
classes.remove(item);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
handle(action: StatusAction): void {
|
|
104
|
+
this.clearTimeout();
|
|
105
|
+
if (action.severity === 'NONE') {
|
|
106
|
+
this.clearStatus();
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
this.setStatus(action);
|
|
110
|
+
|
|
111
|
+
// Check for timeout
|
|
112
|
+
const statusTimeout = action.timeout ?? -1;
|
|
113
|
+
if (statusTimeout > 0) {
|
|
114
|
+
this.pendingTimeout = window.setTimeout(() => this.clearStatus(), statusTimeout);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
preInitialize(): void {
|
|
119
|
+
this.show(this.editorContext.modelRoot);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
@@ -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 { bindAsService, configureActionHandler,
|
|
16
|
+
import { bindAsService, configureActionHandler, FeatureModule, TYPES } from '~glsp-sprotty';
|
|
17
17
|
import '../../../css/tool-palette.css';
|
|
18
|
-
import {
|
|
18
|
+
import { EnableDefaultToolsAction } from '../../base/tool-manager/tool';
|
|
19
|
+
import { ToolPalette } from './tool-palette';
|
|
19
20
|
|
|
20
21
|
export const toolPaletteModule = new FeatureModule((bind, _unbind, isBound, _rebind) => {
|
|
21
22
|
bindAsService(bind, TYPES.IUIExtension, ToolPalette);
|
|
22
|
-
|
|
23
|
+
bind(TYPES.IDiagramStartup).toService(ToolPalette);
|
|
23
24
|
configureActionHandler({ bind, isBound }, EnableDefaultToolsAction.KIND, ToolPalette);
|
|
24
25
|
});
|
|
@@ -17,11 +17,8 @@ import { inject, injectable, postConstruct } from 'inversify';
|
|
|
17
17
|
import {
|
|
18
18
|
AbstractUIExtension,
|
|
19
19
|
Action,
|
|
20
|
-
EnableDefaultToolsAction,
|
|
21
|
-
EnableToolsAction,
|
|
22
20
|
IActionHandler,
|
|
23
21
|
ICommand,
|
|
24
|
-
IToolManager,
|
|
25
22
|
MarkersReason,
|
|
26
23
|
PaletteItem,
|
|
27
24
|
RequestContextActions,
|
|
@@ -29,13 +26,14 @@ import {
|
|
|
29
26
|
SModelRoot,
|
|
30
27
|
SetContextActions,
|
|
31
28
|
SetUIExtensionVisibilityAction,
|
|
32
|
-
TYPES,
|
|
33
29
|
codiconCSSClasses,
|
|
34
30
|
matchesKeystroke
|
|
35
31
|
} from '~glsp-sprotty';
|
|
36
32
|
import { GLSPActionDispatcher } from '../../base/action-dispatcher';
|
|
37
33
|
import { EditorContextService, IEditModeListener } from '../../base/editor-context-service';
|
|
38
34
|
import { FocusTracker } from '../../base/focus/focus-tracker';
|
|
35
|
+
import { IDiagramStartup } from '../../base/model/diagram-loader';
|
|
36
|
+
import { EnableDefaultToolsAction, EnableToolsAction } from '../../base/tool-manager/tool';
|
|
39
37
|
import { MouseDeleteTool } from '../tools/deletion/delete-tool';
|
|
40
38
|
import { MarqueeMouseTool } from '../tools/marquee-selection/marquee-mouse-tool';
|
|
41
39
|
|
|
@@ -61,13 +59,17 @@ export namespace EnableToolPaletteAction {
|
|
|
61
59
|
}
|
|
62
60
|
}
|
|
63
61
|
@injectable()
|
|
64
|
-
export class ToolPalette extends AbstractUIExtension implements IActionHandler, IEditModeListener {
|
|
62
|
+
export class ToolPalette extends AbstractUIExtension implements IActionHandler, IEditModeListener, IDiagramStartup {
|
|
65
63
|
static readonly ID = 'tool-palette';
|
|
66
64
|
|
|
67
|
-
@inject(
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
@inject(
|
|
65
|
+
@inject(GLSPActionDispatcher)
|
|
66
|
+
protected actionDispatcher: GLSPActionDispatcher;
|
|
67
|
+
|
|
68
|
+
@inject(EditorContextService)
|
|
69
|
+
protected editorContext: EditorContextService;
|
|
70
|
+
|
|
71
|
+
@inject(FocusTracker)
|
|
72
|
+
protected focusTracker: FocusTracker;
|
|
71
73
|
|
|
72
74
|
protected paletteItems: PaletteItem[];
|
|
73
75
|
protected paletteItemsCopy: PaletteItem[] = [];
|
|
@@ -96,10 +98,11 @@ export class ToolPalette extends AbstractUIExtension implements IActionHandler,
|
|
|
96
98
|
return super.initialize();
|
|
97
99
|
}
|
|
98
100
|
|
|
99
|
-
protected initializeContents(
|
|
101
|
+
protected initializeContents(containerElement: HTMLElement): void {
|
|
100
102
|
this.createHeader();
|
|
101
103
|
this.createBody();
|
|
102
104
|
this.lastActiveButton = this.defaultToolsButton;
|
|
105
|
+
containerElement.setAttribute('aria-label', 'Tool-Palette');
|
|
103
106
|
}
|
|
104
107
|
|
|
105
108
|
protected override onBeforeShow(_containerElement: HTMLElement, root: Readonly<SModelRoot>): void {
|
|
@@ -206,7 +209,9 @@ export class ToolPalette extends AbstractUIExtension implements IActionHandler,
|
|
|
206
209
|
const button = createIcon('inspect');
|
|
207
210
|
button.id = 'btn_default_tools';
|
|
208
211
|
button.title = 'Enable selection tool';
|
|
209
|
-
button.onclick = this.onClickStaticToolButton(
|
|
212
|
+
button.onclick = this.onClickStaticToolButton(button);
|
|
213
|
+
button.ariaLabel = button.title;
|
|
214
|
+
button.tabIndex = 1;
|
|
210
215
|
return button;
|
|
211
216
|
}
|
|
212
217
|
|
|
@@ -214,6 +219,8 @@ export class ToolPalette extends AbstractUIExtension implements IActionHandler,
|
|
|
214
219
|
const deleteToolButton = createIcon('chrome-close');
|
|
215
220
|
deleteToolButton.title = 'Enable deletion tool';
|
|
216
221
|
deleteToolButton.onclick = this.onClickStaticToolButton(deleteToolButton, MouseDeleteTool.ID);
|
|
222
|
+
deleteToolButton.ariaLabel = deleteToolButton.title;
|
|
223
|
+
deleteToolButton.tabIndex = 1;
|
|
217
224
|
return deleteToolButton;
|
|
218
225
|
}
|
|
219
226
|
|
|
@@ -221,6 +228,8 @@ export class ToolPalette extends AbstractUIExtension implements IActionHandler,
|
|
|
221
228
|
const marqueeToolButton = createIcon('screen-full');
|
|
222
229
|
marqueeToolButton.title = 'Enable marquee tool';
|
|
223
230
|
marqueeToolButton.onclick = this.onClickStaticToolButton(marqueeToolButton, MarqueeMouseTool.ID);
|
|
231
|
+
marqueeToolButton.ariaLabel = marqueeToolButton.title;
|
|
232
|
+
marqueeToolButton.tabIndex = 1;
|
|
224
233
|
return marqueeToolButton;
|
|
225
234
|
}
|
|
226
235
|
|
|
@@ -230,7 +239,10 @@ export class ToolPalette extends AbstractUIExtension implements IActionHandler,
|
|
|
230
239
|
validateActionButton.onclick = _event => {
|
|
231
240
|
const modelIds: string[] = [this.modelRootId];
|
|
232
241
|
this.actionDispatcher.dispatch(RequestMarkersAction.create(modelIds, { reason: MarkersReason.BATCH }));
|
|
242
|
+
validateActionButton.focus();
|
|
233
243
|
};
|
|
244
|
+
validateActionButton.ariaLabel = validateActionButton.title;
|
|
245
|
+
validateActionButton.tabIndex = 1;
|
|
234
246
|
return validateActionButton;
|
|
235
247
|
}
|
|
236
248
|
|
|
@@ -249,6 +261,8 @@ export class ToolPalette extends AbstractUIExtension implements IActionHandler,
|
|
|
249
261
|
};
|
|
250
262
|
searchIcon.classList.add('search-icon');
|
|
251
263
|
searchIcon.title = 'Filter palette entries';
|
|
264
|
+
searchIcon.ariaLabel = searchIcon.title;
|
|
265
|
+
searchIcon.tabIndex = 1;
|
|
252
266
|
return searchIcon;
|
|
253
267
|
}
|
|
254
268
|
|
|
@@ -319,28 +333,11 @@ export class ToolPalette extends AbstractUIExtension implements IActionHandler,
|
|
|
319
333
|
}
|
|
320
334
|
}
|
|
321
335
|
|
|
322
|
-
handle(action:
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
selectedElementIds: []
|
|
328
|
-
}
|
|
329
|
-
});
|
|
330
|
-
this.actionDispatcher.requestUntil(requestAction).then(response => {
|
|
331
|
-
if (SetContextActions.is(response)) {
|
|
332
|
-
this.paletteItems = response.actions.map(e => e as PaletteItem);
|
|
333
|
-
this.actionDispatcher.dispatch(
|
|
334
|
-
SetUIExtensionVisibilityAction.create({ extensionId: ToolPalette.ID, visible: !this.editorContext.isReadonly })
|
|
335
|
-
);
|
|
336
|
-
}
|
|
337
|
-
});
|
|
338
|
-
} else if (action.kind === EnableDefaultToolsAction.KIND) {
|
|
339
|
-
this.changeActiveButton();
|
|
340
|
-
if (this.focusTracker.hasFocus) {
|
|
341
|
-
// if focus was deliberately taken do not restore focus to the palette
|
|
342
|
-
this.restoreFocus();
|
|
343
|
-
}
|
|
336
|
+
handle(action: EnableDefaultToolsAction): ICommand | Action | void {
|
|
337
|
+
this.changeActiveButton();
|
|
338
|
+
if (this.focusTracker.hasFocus) {
|
|
339
|
+
// if focus was deliberately taken do not restore focus to the palette
|
|
340
|
+
this.focusTracker.diagramElement?.focus();
|
|
344
341
|
}
|
|
345
342
|
}
|
|
346
343
|
|
|
@@ -396,6 +393,20 @@ export class ToolPalette extends AbstractUIExtension implements IActionHandler,
|
|
|
396
393
|
this.paletteItems = filteredPaletteItems;
|
|
397
394
|
this.createBody();
|
|
398
395
|
}
|
|
396
|
+
|
|
397
|
+
async preRequestModel(): Promise<void> {
|
|
398
|
+
const requestAction = RequestContextActions.create({
|
|
399
|
+
contextId: ToolPalette.ID,
|
|
400
|
+
editorContext: {
|
|
401
|
+
selectedElementIds: []
|
|
402
|
+
}
|
|
403
|
+
});
|
|
404
|
+
const response = await this.actionDispatcher.request<SetContextActions>(requestAction);
|
|
405
|
+
this.paletteItems = response.actions.map(e => e as PaletteItem);
|
|
406
|
+
if (!this.editorContext.isReadonly) {
|
|
407
|
+
this.show(this.editorContext.modelRoot);
|
|
408
|
+
}
|
|
409
|
+
}
|
|
399
410
|
}
|
|
400
411
|
|
|
401
412
|
export function compare(a: PaletteItem, b: PaletteItem): number {
|