@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
package/css/decoration.css
CHANGED
|
@@ -14,13 +14,6 @@
|
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
|
|
17
|
-
:root {
|
|
18
|
-
--glsp-error-foreground: red;
|
|
19
|
-
--glsp-warning-foreground: yellow;
|
|
20
|
-
--glsp-info-foreground: lightblue;
|
|
21
|
-
--glsp-issue-background: rgb(255 255 255 / 85%);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
17
|
.sprotty-issue-background {
|
|
25
18
|
fill: var(--glsp-issue-background);
|
|
26
19
|
background-color: var(--glsp-issue-background);
|
package/css/glsp-sprotty.css
CHANGED
|
@@ -14,6 +14,13 @@
|
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
|
|
17
|
+
:root {
|
|
18
|
+
--glsp-error-foreground: red;
|
|
19
|
+
--glsp-warning-foreground: yellow;
|
|
20
|
+
--glsp-info-foreground: lightblue;
|
|
21
|
+
--glsp-issue-background: rgb(255 255 255 / 85%);
|
|
22
|
+
}
|
|
23
|
+
|
|
17
24
|
.sprotty {
|
|
18
25
|
padding: 0px;
|
|
19
26
|
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
package/css/key-shortcut.css
CHANGED
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
cursor: pointer;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
.
|
|
95
|
+
.column-title {
|
|
96
96
|
text-align: left;
|
|
97
97
|
}
|
|
98
98
|
|
|
@@ -105,3 +105,7 @@
|
|
|
105
105
|
justify-content: space-between;
|
|
106
106
|
flex-wrap: wrap;
|
|
107
107
|
}
|
|
108
|
+
|
|
109
|
+
.shortcut-table thead th {
|
|
110
|
+
border-bottom: 2px solid #000;
|
|
111
|
+
}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isSourceUriAware = void 0;
|
|
4
1
|
/********************************************************************************
|
|
5
|
-
* Copyright (c)
|
|
2
|
+
* Copyright (c) 2023 Business Informatics Group (TU Wien) and others.
|
|
6
3
|
*
|
|
7
4
|
* This program and the accompanying materials are made available under the
|
|
8
5
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -16,9 +13,14 @@ exports.isSourceUriAware = void 0;
|
|
|
16
13
|
*
|
|
17
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
18
15
|
********************************************************************************/
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
|
|
17
|
+
:root {
|
|
18
|
+
--glsp-navigation-highlight: rgba(136, 68, 68, 0.2);
|
|
19
|
+
}
|
|
20
|
+
.navigable-element {
|
|
21
|
+
stroke: var(--glsp-navigation-highlight) !important;
|
|
22
|
+
}
|
|
23
|
+
.navigable-element .sprotty-edge.arrow {
|
|
24
|
+
fill: var(--glsp-navigation-highlight) !important;
|
|
25
|
+
stroke: var(--glsp-navigation-highlight) !important;
|
|
22
26
|
}
|
|
23
|
-
exports.isSourceUriAware = isSourceUriAware;
|
|
24
|
-
//# sourceMappingURL=source-uri-aware.js.map
|
|
@@ -0,0 +1,75 @@
|
|
|
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
|
+
.sprotty-status {
|
|
18
|
+
position: absolute;
|
|
19
|
+
top: 5px;
|
|
20
|
+
left: 10px;
|
|
21
|
+
display: flex;
|
|
22
|
+
align-items: center;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.sprotty-status .fatal {
|
|
26
|
+
color: var(--glsp-error-foreground);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.sprotty-status .error {
|
|
30
|
+
color: var(--glsp-error-foreground);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.sprotty-status .warning {
|
|
34
|
+
color: var(--glsp-warning-foreground);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.sprotty-status .info {
|
|
38
|
+
color: var(--glsp-info-foreground);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.sprotty-error {
|
|
42
|
+
fill: var(--glsp-issue-background);
|
|
43
|
+
color: var(--glsp-error-foreground);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.sprotty-warning {
|
|
47
|
+
fill: var(--glsp-issue-background);
|
|
48
|
+
color: var(--glsp-warning-foreground);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.sprotty-info {
|
|
52
|
+
fill: var(--glsp-issue-background);
|
|
53
|
+
color: var();
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.sprotty-infoRow .codicon {
|
|
57
|
+
margin-right: 8px;
|
|
58
|
+
}
|
|
59
|
+
.sprotty-status .ok {
|
|
60
|
+
visibility: hidden;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.sprotty-status-message {
|
|
64
|
+
visibility: hidden;
|
|
65
|
+
padding-left: 10px;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.sprotty-status-message.fatal {
|
|
69
|
+
visibility: visible;
|
|
70
|
+
padding-left: 10px;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.sprotty-status:hover .sprotty-status-message {
|
|
74
|
+
visibility: visible;
|
|
75
|
+
}
|
package/css/toast.css
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
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
|
+
.toast {
|
|
17
|
+
position: absolute;
|
|
18
|
+
bottom: 1rem;
|
|
19
|
+
width: 100%;
|
|
20
|
+
display: grid;
|
|
21
|
+
grid-template-columns: 1fr 1fr 1fr;
|
|
22
|
+
grid-column-gap: 1rem;
|
|
23
|
+
margin: 0 1rem;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.toast-column-left {
|
|
27
|
+
grid-column: 1 / span 1;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.toast-column-center {
|
|
31
|
+
grid-column: 2 / span 1;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.toast-column-right {
|
|
35
|
+
grid-column: 3 / span 1;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.toast-container {
|
|
39
|
+
display: inline-block;
|
|
40
|
+
min-width: 256px;
|
|
41
|
+
max-width: 516px;
|
|
42
|
+
background-color: #ccc;
|
|
43
|
+
color: #000;
|
|
44
|
+
padding: 0.5rem;
|
|
45
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { Action, ActionDispatcher, RequestAction, ResponseAction } from '../glsp-sprotty/index';
|
|
3
|
-
import { ModelInitializationConstraint } from './model-initialization-constraint';
|
|
3
|
+
import { ModelInitializationConstraint } from './model/model-initialization-constraint';
|
|
4
4
|
export declare class GLSPActionDispatcher extends ActionDispatcher {
|
|
5
5
|
protected readonly timeouts: Map<string, NodeJS.Timeout>;
|
|
6
6
|
protected initializedConstraint: boolean;
|
|
@@ -9,6 +9,12 @@ export declare class GLSPActionDispatcher extends ActionDispatcher {
|
|
|
9
9
|
startModelInitialization(): void;
|
|
10
10
|
onceModelInitialized(): Promise<void>;
|
|
11
11
|
hasHandler(action: Action): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Processes all given actions, by dispatching them to the corresponding handlers, after the model initialization is completed.
|
|
14
|
+
*
|
|
15
|
+
* @param actions The actions that should be dispatched after the model initialization
|
|
16
|
+
*/
|
|
17
|
+
dispatchOnceModelInitialized(...actions: Action[]): void;
|
|
12
18
|
dispatch(action: Action): Promise<void>;
|
|
13
19
|
protected handleAction(action: Action): Promise<void>;
|
|
14
20
|
request<Res extends ResponseAction>(action: RequestAction<Res>): Promise<Res>;
|
|
@@ -22,6 +28,6 @@ export declare class GLSPActionDispatcher extends ActionDispatcher {
|
|
|
22
28
|
* If `rejectOnTimeout` is set to false (default) the returned promise will be resolved with
|
|
23
29
|
* no value, otherwise it will be rejected.
|
|
24
30
|
*/
|
|
25
|
-
requestUntil<Res extends ResponseAction>(action: RequestAction<Res>, timeoutMs?: number, rejectOnTimeout?: boolean): Promise<Res>;
|
|
31
|
+
requestUntil<Res extends ResponseAction>(action: RequestAction<Res>, timeoutMs?: number, rejectOnTimeout?: boolean): Promise<Res | undefined>;
|
|
26
32
|
}
|
|
27
33
|
//# sourceMappingURL=action-dispatcher.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-dispatcher.d.ts","sourceRoot":"","sources":["../../src/base/action-dispatcher.ts"],"names":[],"mappings":";AAgBA,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACxF,OAAO,EAAE,6BAA6B,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"action-dispatcher.d.ts","sourceRoot":"","sources":["../../src/base/action-dispatcher.ts"],"names":[],"mappings":";AAgBA,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACxF,OAAO,EAAE,6BAA6B,EAAE,MAAM,yCAAyC,CAAC;AAExF,qBACa,oBAAqB,SAAQ,gBAAgB;IACtD,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,CAAa;IACrE,SAAS,CAAC,qBAAqB,UAAS;IAGxC,SAAS,CAAC,wBAAwB,EAAE,6BAA6B,CAAC;IAEzD,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAIpC,wBAAwB,IAAI,IAAI;IAQhC,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC;IAIrC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;IAInC;;;;OAIG;IACH,4BAA4B,CAAC,GAAG,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI;IAIzC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;cAMnC,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAmBrD,OAAO,CAAC,GAAG,SAAS,cAAc,EAAE,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC;IAQtF;;;;;;;;;OASG;IACH,YAAY,CAAC,GAAG,SAAS,cAAc,EACnC,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,EAC1B,SAAS,SAAO,EAChB,eAAe,UAAQ,GACxB,OAAO,CAAC,GAAG,GAAG,SAAS,CAAC;CA2B9B"}
|
|
@@ -27,7 +27,7 @@ exports.GLSPActionDispatcher = void 0;
|
|
|
27
27
|
********************************************************************************/
|
|
28
28
|
const inversify_1 = require("inversify");
|
|
29
29
|
const _glsp_sprotty_1 = require("../glsp-sprotty/index");
|
|
30
|
-
const model_initialization_constraint_1 = require("./model-initialization-constraint");
|
|
30
|
+
const model_initialization_constraint_1 = require("./model/model-initialization-constraint");
|
|
31
31
|
let GLSPActionDispatcher = exports.GLSPActionDispatcher = class GLSPActionDispatcher extends _glsp_sprotty_1.ActionDispatcher {
|
|
32
32
|
constructor() {
|
|
33
33
|
super(...arguments);
|
|
@@ -40,7 +40,7 @@ let GLSPActionDispatcher = exports.GLSPActionDispatcher = class GLSPActionDispat
|
|
|
40
40
|
startModelInitialization() {
|
|
41
41
|
if (!this.initializedConstraint) {
|
|
42
42
|
this.logger.log(this, 'Starting model initialization mode');
|
|
43
|
-
this.initializationConstraint.onInitialized(
|
|
43
|
+
this.initializationConstraint.onInitialized(() => this.logger.log(this, 'Model initialization completed'));
|
|
44
44
|
this.initializedConstraint = true;
|
|
45
45
|
}
|
|
46
46
|
}
|
|
@@ -50,8 +50,16 @@ let GLSPActionDispatcher = exports.GLSPActionDispatcher = class GLSPActionDispat
|
|
|
50
50
|
hasHandler(action) {
|
|
51
51
|
return this.actionHandlerRegistry.get(action.kind).length > 0;
|
|
52
52
|
}
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
/**
|
|
54
|
+
* Processes all given actions, by dispatching them to the corresponding handlers, after the model initialization is completed.
|
|
55
|
+
*
|
|
56
|
+
* @param actions The actions that should be dispatched after the model initialization
|
|
57
|
+
*/
|
|
58
|
+
dispatchOnceModelInitialized(...actions) {
|
|
59
|
+
this.initializationConstraint.onInitialized(() => this.dispatchAll(actions));
|
|
60
|
+
}
|
|
61
|
+
async dispatch(action) {
|
|
62
|
+
const result = await super.dispatch(action);
|
|
55
63
|
this.initializationConstraint.notifyDispatched(action);
|
|
56
64
|
return result;
|
|
57
65
|
}
|
|
@@ -63,11 +71,11 @@ let GLSPActionDispatcher = exports.GLSPActionDispatcher = class GLSPActionDispat
|
|
|
63
71
|
clearTimeout(timeout);
|
|
64
72
|
this.timeouts.delete(action.responseId);
|
|
65
73
|
}
|
|
66
|
-
// we
|
|
74
|
+
// Check if we have a pending request for the response.
|
|
75
|
+
// If not the we clear the responseId => action will be dispatched normally
|
|
67
76
|
const deferred = this.requests.get(action.responseId);
|
|
68
77
|
if (deferred === undefined) {
|
|
69
|
-
|
|
70
|
-
return Promise.resolve();
|
|
78
|
+
action.responseId = '';
|
|
71
79
|
}
|
|
72
80
|
}
|
|
73
81
|
return super.handleAction(action);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-dispatcher.js","sourceRoot":"","sources":["../../src/base/action-dispatcher.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,yCAA+C;AAC/C,iDAAwF;AACxF,
|
|
1
|
+
{"version":3,"file":"action-dispatcher.js","sourceRoot":"","sources":["../../src/base/action-dispatcher.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,yCAA+C;AAC/C,iDAAwF;AACxF,6FAAwF;AAGjF,IAAM,oBAAoB,kCAA1B,MAAM,oBAAqB,SAAQ,gCAAgB;IAAnD;;QACgB,aAAQ,GAAgC,IAAI,GAAG,EAAE,CAAC;QAC3D,0BAAqB,GAAG,KAAK,CAAC;IA4G5C,CAAC;IAvGY,UAAU;QACf,OAAO,KAAK,CAAC,UAAU,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,wBAAwB,EAAE,CAAC,CAAC;IAC1E,CAAC;IAED,wBAAwB;QACpB,IAAI,CAAC,IAAI,CAAC,qBAAqB,EAAE;YAC7B,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,oCAAoC,CAAC,CAAC;YAC5D,IAAI,CAAC,wBAAwB,CAAC,aAAa,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,gCAAgC,CAAC,CAAC,CAAC;YAC3G,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAC;SACrC;IACL,CAAC;IAED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GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QAEtC,OAAO,KAAK,CAAC,OAAO,CAAM,MAAM,CAAC,CAAC;IACtC,CAAC;CACJ,CAAA;AAzGa;IADT,IAAA,kBAAM,EAAC,+DAA6B,CAAC;8BACF,+DAA6B;sEAAC;+BALzD,oBAAoB;IADhC,IAAA,sBAAU,GAAE;GACA,oBAAoB,CA8GhC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-dispatcher.spec.d.ts","sourceRoot":"","sources":["../../src/base/action-dispatcher.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/********************************************************************************
|
|
4
|
+
* Copyright (c) 2023 EclipseSource and others.
|
|
5
|
+
*
|
|
6
|
+
* This program and the accompanying materials are made available under the
|
|
7
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
8
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
9
|
+
*
|
|
10
|
+
* This Source Code may also be made available under the following Secondary
|
|
11
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
12
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
13
|
+
* with the GNU Classpath Exception which is available at
|
|
14
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
15
|
+
*
|
|
16
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
17
|
+
********************************************************************************/
|
|
18
|
+
const chai_1 = require("chai");
|
|
19
|
+
const inversify_1 = require("inversify");
|
|
20
|
+
const _glsp_sprotty_1 = require("../glsp-sprotty/index");
|
|
21
|
+
const action_dispatcher_1 = require("./action-dispatcher");
|
|
22
|
+
const default_module_1 = require("./default.module");
|
|
23
|
+
const container = new inversify_1.Container();
|
|
24
|
+
container.load(default_module_1.defaultModule);
|
|
25
|
+
container.bind(_glsp_sprotty_1.TYPES.IDiagramOptions).toConstantValue({
|
|
26
|
+
clientId: 'client1',
|
|
27
|
+
diagramType: 'diagramType',
|
|
28
|
+
glspClientProvider: async () => ({})
|
|
29
|
+
});
|
|
30
|
+
const registry = container.get(_glsp_sprotty_1.ActionHandlerRegistry);
|
|
31
|
+
const actionDispatcher = container.get(action_dispatcher_1.GLSPActionDispatcher);
|
|
32
|
+
let testHandlerDelay = 0;
|
|
33
|
+
const testHandler = {
|
|
34
|
+
handle: action => {
|
|
35
|
+
const request = action;
|
|
36
|
+
new Promise(resolve => setTimeout(resolve, testHandlerDelay)).then(() => actionDispatcher.dispatch({
|
|
37
|
+
kind: 'response',
|
|
38
|
+
responseId: request.requestId
|
|
39
|
+
}));
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
registry.register('request', testHandler);
|
|
43
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
44
|
+
registry.register('response', { handle: () => { } });
|
|
45
|
+
actionDispatcher.initialize().then(() => {
|
|
46
|
+
actionDispatcher['blockUntil'] = undefined;
|
|
47
|
+
});
|
|
48
|
+
describe('GLSPActionDispatcher', () => {
|
|
49
|
+
describe('requestUntil', () => {
|
|
50
|
+
it('should resolve successfully if response dispatched within timeout', async () => {
|
|
51
|
+
testHandlerDelay = 15;
|
|
52
|
+
const requestAction = { kind: 'request', requestId: '' };
|
|
53
|
+
const response = await actionDispatcher.requestUntil(requestAction, 150);
|
|
54
|
+
(0, chai_1.expect)(response === null || response === void 0 ? void 0 : response.responseId).to.be.equal(requestAction.requestId);
|
|
55
|
+
});
|
|
56
|
+
it('should resolve to `undefined` if no response dispatched within timeout & `rejectOnTimeout` flag is false', async () => {
|
|
57
|
+
testHandlerDelay = 30;
|
|
58
|
+
const requestAction = { kind: 'request', requestId: '' };
|
|
59
|
+
const response = await actionDispatcher.requestUntil(requestAction, 5);
|
|
60
|
+
(0, chai_1.expect)(response).to.be.undefined;
|
|
61
|
+
});
|
|
62
|
+
it('should be rejected if no response dispatched within timeout & `rejectOnTimeout` flag is true', async () => {
|
|
63
|
+
testHandlerDelay = 30;
|
|
64
|
+
const requestAction = { kind: 'request', requestId: '' };
|
|
65
|
+
const gotRejected = await actionDispatcher.requestUntil(requestAction, 5, true).then(() => false, () => true);
|
|
66
|
+
(0, chai_1.expect)(gotRejected, 'Response promise should be rejected').to.be.true;
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
describe('request & re-dispatch', () => {
|
|
70
|
+
it('should be possible to re-dispatch the response of a `request` call', async () => {
|
|
71
|
+
const requestAction = { kind: 'request', requestId: '' };
|
|
72
|
+
const response = await actionDispatcher.request(requestAction);
|
|
73
|
+
const dispatchSuccessful = await actionDispatcher.dispatch(response).then(() => true, err => false);
|
|
74
|
+
(0, chai_1.expect)(dispatchSuccessful, 'Promise of re-dispatch should resolve successfully').to.be.true;
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
//# sourceMappingURL=action-dispatcher.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-dispatcher.spec.js","sourceRoot":"","sources":["../../src/base/action-dispatcher.spec.ts"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,+BAA8B;AAC9B,yCAAsC;AACtC,iDAA4G;AAE5G,2DAA2D;AAC3D,qDAAiD;AAEjD,MAAM,SAAS,GAAG,IAAI,qBAAS,EAAE,CAAC;AAClC,SAAS,CAAC,IAAI,CAAC,8BAAa,CAAC,CAAC;AAC9B,SAAS,CAAC,IAAI,CAAC,qBAAK,CAAC,eAAe,CAAC,CAAC,eAAe,CAA4B;IAC7E,QAAQ,EAAE,SAAS;IACnB,WAAW,EAAE,aAAa;IAC1B,kBAAkB,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,EAAU,CAAA;CAC7C,CAAC,CAAC;AACJ,MAAM,QAAQ,GAAG,SAAS,CAAC,GAAG,CAAC,qCAAqB,CAAC,CAAC;AACtD,M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,CAAC,CAAC,IAAI,CACrE,GAAG,EAAE,CAAC,IAAI,EACV,GAAG,CAAC,EAAE,CAAC,KAAK,CACf,CAAC;YACF,IAAA,aAAM,EAAC,kBAAkB,EAAE,oDAAoD,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC;QAChG,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
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 { ActionHandlerRegistry } from '../glsp-sprotty/index';
|
|
17
|
+
export declare class GLSPActionHandlerRegistry extends ActionHandlerRegistry {
|
|
18
|
+
/**
|
|
19
|
+
* Retrieve a set of all action kinds for which (at least) one
|
|
20
|
+
* handler is registered
|
|
21
|
+
* @returns the set of handled action kinds
|
|
22
|
+
*/
|
|
23
|
+
getHandledActionKinds(): string[];
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=action-handler-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-handler-registry.d.ts","sourceRoot":"","sources":["../../src/base/action-handler-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAGlF,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAEtD,qBACa,yBAA0B,SAAQ,qBAAqB;IAChE;;;;OAIG;IACH,qBAAqB,IAAI,MAAM,EAAE;CAGpC"}
|
|
@@ -1,12 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.BaseGLSPCreationTool = void 0;
|
|
10
2
|
/********************************************************************************
|
|
11
3
|
* Copyright (c) 2023 EclipseSource and others.
|
|
12
4
|
*
|
|
@@ -22,24 +14,27 @@ exports.BaseGLSPCreationTool = void 0;
|
|
|
22
14
|
*
|
|
23
15
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
24
16
|
********************************************************************************/
|
|
17
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
+
};
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.GLSPActionHandlerRegistry = void 0;
|
|
25
25
|
const inversify_1 = require("inversify");
|
|
26
|
-
const _glsp_sprotty_1 = require("
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
enable() {
|
|
36
|
-
if (this.triggerAction === undefined) {
|
|
37
|
-
throw new TypeError(`Could not enable tool ${this.id}. The triggerAction cannot be undefined.`);
|
|
38
|
-
}
|
|
39
|
-
this.doEnable();
|
|
26
|
+
const _glsp_sprotty_1 = require("../glsp-sprotty/index");
|
|
27
|
+
let GLSPActionHandlerRegistry = exports.GLSPActionHandlerRegistry = class GLSPActionHandlerRegistry extends _glsp_sprotty_1.ActionHandlerRegistry {
|
|
28
|
+
/**
|
|
29
|
+
* Retrieve a set of all action kinds for which (at least) one
|
|
30
|
+
* handler is registered
|
|
31
|
+
* @returns the set of handled action kinds
|
|
32
|
+
*/
|
|
33
|
+
getHandledActionKinds() {
|
|
34
|
+
return Array.from(this.elements.keys());
|
|
40
35
|
}
|
|
41
36
|
};
|
|
42
|
-
exports.
|
|
37
|
+
exports.GLSPActionHandlerRegistry = GLSPActionHandlerRegistry = __decorate([
|
|
43
38
|
(0, inversify_1.injectable)()
|
|
44
|
-
],
|
|
45
|
-
//# sourceMappingURL=
|
|
39
|
+
], GLSPActionHandlerRegistry);
|
|
40
|
+
//# sourceMappingURL=action-handler-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-handler-registry.js","sourceRoot":"","sources":["../../src/base/action-handler-registry.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;AAElF,yCAAuC;AACvC,iDAAsD;AAG/C,IAAM,yBAAyB,uCAA/B,MAAM,yBAA0B,SAAQ,qCAAqB;IAChE;;;;OAIG;IACH,qBAAqB;QACjB,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;IAC5C,CAAC;CACJ,CAAA;oCATY,yBAAyB;IADrC,IAAA,sBAAU,GAAE;GACA,yBAAyB,CASrC"}
|
|
@@ -14,20 +14,11 @@
|
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
import '@vscode/codicons/dist/codicon.css';
|
|
17
|
-
import {
|
|
18
|
-
import { FeatureModule, InitializeResult } from '../glsp-sprotty/index';
|
|
17
|
+
import { FeatureModule } from '../glsp-sprotty/index';
|
|
19
18
|
import '../../css/glsp-sprotty.css';
|
|
20
19
|
/**
|
|
21
20
|
* The default module provides all of GLSP's base functionality and services.
|
|
22
21
|
* It builds on top of sprotty's default module {@link `sprottyDefaultModule`}.
|
|
23
22
|
*/
|
|
24
23
|
export declare const defaultModule: FeatureModule;
|
|
25
|
-
/**
|
|
26
|
-
* Utility function to configure the {@link ModelSource}, i.e. the `DiagramServer`, as action handler for all server actions for the given
|
|
27
|
-
* diagramType.
|
|
28
|
-
* @param result A promise that resolves after all server actions have been registered.
|
|
29
|
-
* @param diagramType The diagram type.
|
|
30
|
-
* @param container The di container.
|
|
31
|
-
*/
|
|
32
|
-
export declare function configureServerActions(result: InitializeResult, diagramType: string, container: Container): Promise<void>;
|
|
33
24
|
//# sourceMappingURL=default.module.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default.module.d.ts","sourceRoot":"","sources":["../../src/base/default.module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,mCAAmC,CAAC;AAC3C,OAAO,
|
|
1
|
+
{"version":3,"file":"default.module.d.ts","sourceRoot":"","sources":["../../src/base/default.module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,mCAAmC,CAAC;AAC3C,OAAO,EAEH,aAAa,EAahB,MAAM,eAAe,CAAC;AACvB,OAAO,4BAA4B,CAAC;AAsBpC;;;GAGG;AACH,eAAO,MAAM,aAAa,eA0DxB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.defaultModule = void 0;
|
|
4
4
|
/********************************************************************************
|
|
5
5
|
* Copyright (c) 2019-2023 EclipseSource and others.
|
|
6
6
|
*
|
|
@@ -20,6 +20,7 @@ require("@vscode/codicons/dist/codicon.css");
|
|
|
20
20
|
const _glsp_sprotty_1 = require("../glsp-sprotty/index");
|
|
21
21
|
require("../../css/glsp-sprotty.css");
|
|
22
22
|
const action_dispatcher_1 = require("./action-dispatcher");
|
|
23
|
+
const action_handler_registry_1 = require("./action-handler-registry");
|
|
23
24
|
const command_stack_1 = require("./command-stack");
|
|
24
25
|
const editor_context_service_1 = require("./editor-context-service");
|
|
25
26
|
const css_feedback_1 = require("./feedback/css-feedback");
|
|
@@ -27,11 +28,14 @@ const feedback_action_dispatcher_1 = require("./feedback/feedback-action-dispatc
|
|
|
27
28
|
const update_model_command_1 = require("./feedback/update-model-command");
|
|
28
29
|
const focus_state_change_action_1 = require("./focus/focus-state-change-action");
|
|
29
30
|
const focus_tracker_1 = require("./focus/focus-tracker");
|
|
30
|
-
const
|
|
31
|
+
const diagram_loader_1 = require("./model/diagram-loader");
|
|
32
|
+
const glsp_model_source_1 = require("./model/glsp-model-source");
|
|
33
|
+
const model_initialization_constraint_1 = require("./model/model-initialization-constraint");
|
|
31
34
|
const model_registry_1 = require("./model/model-registry");
|
|
32
35
|
const selection_clearing_mouse_listener_1 = require("./selection-clearing-mouse-listener");
|
|
33
36
|
const selection_service_1 = require("./selection-service");
|
|
34
|
-
const
|
|
37
|
+
const tool_1 = require("./tool-manager/tool");
|
|
38
|
+
const tool_manager_1 = require("./tool-manager/tool-manager");
|
|
35
39
|
const key_tool_1 = require("./view/key-tool");
|
|
36
40
|
const mouse_tool_1 = require("./view/mouse-tool");
|
|
37
41
|
const view_registry_1 = require("./view/view-registry");
|
|
@@ -44,15 +48,9 @@ exports.defaultModule = new _glsp_sprotty_1.FeatureModule((bind, unbind, isBound
|
|
|
44
48
|
_glsp_sprotty_1.sprottyDefaultModule.registry(bind, unbind, isBound, rebind, ...rest);
|
|
45
49
|
const context = { bind, unbind, isBound, rebind };
|
|
46
50
|
bind(editor_context_service_1.EditorContextService).toSelf().inSingletonScope();
|
|
47
|
-
bind(_glsp_sprotty_1.TYPES.IEditorContextServiceProvider).toProvider(ctx => () =>
|
|
48
|
-
if (ctx.container.isBound(editor_context_service_1.EditorContextService)) {
|
|
49
|
-
resolve(ctx.container.get(editor_context_service_1.EditorContextService));
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
reject();
|
|
53
|
-
}
|
|
54
|
-
}));
|
|
51
|
+
bind(_glsp_sprotty_1.TYPES.IEditorContextServiceProvider).toProvider(ctx => async () => ctx.container.get(editor_context_service_1.EditorContextService));
|
|
55
52
|
(0, _glsp_sprotty_1.configureActionHandler)(context, _glsp_sprotty_1.SetEditModeAction.KIND, editor_context_service_1.EditorContextService);
|
|
53
|
+
(0, _glsp_sprotty_1.configureActionHandler)(context, _glsp_sprotty_1.SetDirtyStateAction.KIND, editor_context_service_1.EditorContextService);
|
|
56
54
|
bind(focus_tracker_1.FocusTracker).toSelf().inSingletonScope();
|
|
57
55
|
(0, _glsp_sprotty_1.configureActionHandler)(context, focus_state_change_action_1.FocusStateChangedAction.KIND, focus_tracker_1.FocusTracker);
|
|
58
56
|
// Model update initialization ------------------------------------
|
|
@@ -64,10 +62,12 @@ exports.defaultModule = new _glsp_sprotty_1.FeatureModule((bind, unbind, isBound
|
|
|
64
62
|
(0, _glsp_sprotty_1.bindOrRebind)(context, _glsp_sprotty_1.KeyTool).toService(key_tool_1.GLSPKeyTool);
|
|
65
63
|
(0, _glsp_sprotty_1.bindAsService)(context, _glsp_sprotty_1.TYPES.MouseListener, selection_clearing_mouse_listener_1.SelectionClearingMouseListener);
|
|
66
64
|
(0, _glsp_sprotty_1.bindOrRebind)(context, _glsp_sprotty_1.TYPES.ICommandStack).to(command_stack_1.GLSPCommandStack).inSingletonScope();
|
|
67
|
-
bind(glsp_tool_manager_1.GLSPToolManager).toSelf().inSingletonScope();
|
|
68
|
-
(0, _glsp_sprotty_1.bindOrRebind)(context, _glsp_sprotty_1.TYPES.IToolManager).toService(glsp_tool_manager_1.GLSPToolManager);
|
|
69
65
|
bind(action_dispatcher_1.GLSPActionDispatcher).toSelf().inSingletonScope();
|
|
70
66
|
(0, _glsp_sprotty_1.bindOrRebind)(context, _glsp_sprotty_1.TYPES.IActionDispatcher).toService(action_dispatcher_1.GLSPActionDispatcher);
|
|
67
|
+
bind(action_handler_registry_1.GLSPActionHandlerRegistry).toSelf().inSingletonScope();
|
|
68
|
+
(0, _glsp_sprotty_1.bindOrRebind)(context, _glsp_sprotty_1.ActionHandlerRegistry).toService(action_handler_registry_1.GLSPActionHandlerRegistry);
|
|
69
|
+
(0, _glsp_sprotty_1.bindAsService)(context, _glsp_sprotty_1.TYPES.ModelSource, glsp_model_source_1.GLSPModelSource);
|
|
70
|
+
bind(diagram_loader_1.DiagramLoader).toSelf().inSingletonScope();
|
|
71
71
|
bind(model_initialization_constraint_1.ModelInitializationConstraint).to(model_initialization_constraint_1.DefaultModelInitializationConstraint).inSingletonScope();
|
|
72
72
|
// support re-registration of model elements and views
|
|
73
73
|
(0, _glsp_sprotty_1.bindOrRebind)(context, _glsp_sprotty_1.TYPES.SModelRegistry).to(model_registry_1.GLSPModelRegistry).inSingletonScope();
|
|
@@ -81,22 +81,12 @@ exports.defaultModule = new _glsp_sprotty_1.FeatureModule((bind, unbind, isBound
|
|
|
81
81
|
(0, _glsp_sprotty_1.configureCommand)(context, _glsp_sprotty_1.MoveCommand);
|
|
82
82
|
(0, _glsp_sprotty_1.bindAsService)(context, _glsp_sprotty_1.TYPES.IVNodePostprocessor, _glsp_sprotty_1.LocationPostprocessor);
|
|
83
83
|
bind(_glsp_sprotty_1.TYPES.HiddenVNodePostprocessor).toService(_glsp_sprotty_1.LocationPostprocessor);
|
|
84
|
+
// Tool manager initialization ------------------------------------
|
|
85
|
+
bind(_glsp_sprotty_1.TYPES.IToolManager).to(tool_manager_1.ToolManager).inSingletonScope();
|
|
86
|
+
bind(tool_manager_1.DefaultToolsEnablingKeyListener).toSelf().inSingletonScope();
|
|
87
|
+
bind(_glsp_sprotty_1.TYPES.KeyListener).toService(tool_manager_1.DefaultToolsEnablingKeyListener);
|
|
88
|
+
bind(tool_manager_1.ToolManagerActionHandler).toSelf().inSingletonScope();
|
|
89
|
+
(0, _glsp_sprotty_1.configureActionHandler)(context, tool_1.EnableDefaultToolsAction.KIND, tool_manager_1.ToolManagerActionHandler);
|
|
90
|
+
(0, _glsp_sprotty_1.configureActionHandler)(context, tool_1.EnableToolsAction.KIND, tool_manager_1.ToolManagerActionHandler);
|
|
84
91
|
});
|
|
85
|
-
/**
|
|
86
|
-
* Utility function to configure the {@link ModelSource}, i.e. the `DiagramServer`, as action handler for all server actions for the given
|
|
87
|
-
* diagramType.
|
|
88
|
-
* @param result A promise that resolves after all server actions have been registered.
|
|
89
|
-
* @param diagramType The diagram type.
|
|
90
|
-
* @param container The di container.
|
|
91
|
-
*/
|
|
92
|
-
async function configureServerActions(result, diagramType, container) {
|
|
93
|
-
const modelSource = container.get(_glsp_sprotty_1.TYPES.ModelSource);
|
|
94
|
-
const actionHandlerRegistry = container.get(_glsp_sprotty_1.ActionHandlerRegistry);
|
|
95
|
-
const serverActions = result.serverActions[diagramType];
|
|
96
|
-
if (serverActions.length === 0) {
|
|
97
|
-
throw new Error(`No server-handled actions could be derived from the initialize result for diagramType: ${diagramType}!`);
|
|
98
|
-
}
|
|
99
|
-
serverActions.forEach(actionKind => actionHandlerRegistry.register(actionKind, modelSource));
|
|
100
|
-
}
|
|
101
|
-
exports.configureServerActions = configureServerActions;
|
|
102
92
|
//# sourceMappingURL=default.module.js.map
|