@eclipse-glsp/client 2.2.0-next.336 → 2.2.0-next.338
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/ghost-element.css +7 -0
- package/lib/base/default.module.js +4 -4
- package/lib/base/default.module.js.map +1 -1
- package/lib/base/drag-aware-mouse-listener.d.ts +5 -2
- package/lib/base/drag-aware-mouse-listener.d.ts.map +1 -1
- package/lib/base/drag-aware-mouse-listener.js +13 -3
- package/lib/base/drag-aware-mouse-listener.js.map +1 -1
- package/lib/base/feedback/feedback-action-dispatcher-default.d.ts +34 -0
- package/lib/base/feedback/feedback-action-dispatcher-default.d.ts.map +1 -0
- package/lib/base/feedback/feedback-action-dispatcher-default.js +120 -0
- package/lib/base/feedback/feedback-action-dispatcher-default.js.map +1 -0
- package/lib/base/feedback/feedback-action-dispatcher.d.ts +2 -17
- package/lib/base/feedback/feedback-action-dispatcher.d.ts.map +1 -1
- package/lib/base/feedback/feedback-action-dispatcher.js +1 -100
- package/lib/base/feedback/feedback-action-dispatcher.js.map +1 -1
- package/lib/base/feedback/{feeback-emitter.d.ts → feedback-emitter.d.ts} +8 -1
- package/lib/base/feedback/feedback-emitter.d.ts.map +1 -0
- package/lib/base/feedback/{feeback-emitter.js → feedback-emitter.js} +21 -6
- package/lib/base/feedback/feedback-emitter.js.map +1 -0
- package/lib/base/selection-service.d.ts +1 -1
- package/lib/base/selection-service.d.ts.map +1 -1
- package/lib/base/tool-manager/tool-manager.d.ts +1 -1
- package/lib/base/tool-manager/tool-manager.d.ts.map +1 -1
- package/lib/base/ui-extension/ui-extension-registry.d.ts +1 -1
- package/lib/base/ui-extension/ui-extension-registry.d.ts.map +1 -1
- package/lib/base/view/key-tool.d.ts +1 -1
- package/lib/base/view/key-tool.d.ts.map +1 -1
- package/lib/base/view/mouse-tool.d.ts +1 -1
- package/lib/base/view/mouse-tool.d.ts.map +1 -1
- package/lib/features/accessibility/move-zoom/move-handler.d.ts +2 -2
- package/lib/features/accessibility/move-zoom/move-handler.d.ts.map +1 -1
- package/lib/features/accessibility/move-zoom/move-handler.js +1 -1
- package/lib/features/accessibility/move-zoom/move-handler.js.map +1 -1
- package/lib/features/accessibility/resize-key-tool/resize-key-handler.d.ts +3 -3
- package/lib/features/accessibility/resize-key-tool/resize-key-handler.d.ts.map +1 -1
- package/lib/features/accessibility/resize-key-tool/resize-key-handler.js +1 -1
- package/lib/features/accessibility/resize-key-tool/resize-key-handler.js.map +1 -1
- package/lib/features/accessibility/view-key-tools/movement-key-tool.d.ts +3 -3
- 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 -4
- package/lib/features/accessibility/view-key-tools/movement-key-tool.js.map +1 -1
- package/lib/features/bounds/set-bounds-feedback-command.d.ts.map +1 -1
- package/lib/features/bounds/set-bounds-feedback-command.js +2 -2
- package/lib/features/bounds/set-bounds-feedback-command.js.map +1 -1
- package/lib/features/change-bounds/model.d.ts +7 -3
- package/lib/features/change-bounds/model.d.ts.map +1 -1
- package/lib/features/change-bounds/model.js +46 -20
- package/lib/features/change-bounds/model.js.map +1 -1
- package/lib/features/change-bounds/movement-restrictor.d.ts +3 -2
- package/lib/features/change-bounds/movement-restrictor.d.ts.map +1 -1
- package/lib/features/change-bounds/movement-restrictor.js +9 -10
- package/lib/features/change-bounds/movement-restrictor.js.map +1 -1
- package/lib/features/debug/debug-bounds-decorator.d.ts +1 -1
- package/lib/features/debug/debug-bounds-decorator.d.ts.map +1 -1
- package/lib/features/debug/debug-bounds-decorator.js +6 -6
- package/lib/features/debug/debug-bounds-decorator.js.map +1 -1
- package/lib/features/debug/debug-manager.d.ts +2 -1
- package/lib/features/debug/debug-manager.d.ts.map +1 -1
- package/lib/features/debug/debug-manager.js.map +1 -1
- package/lib/features/debug/debug-model.d.ts +1 -1
- package/lib/features/debug/debug-model.d.ts.map +1 -1
- package/lib/features/debug/debug-model.js +5 -5
- package/lib/features/debug/debug-model.js.map +1 -1
- package/lib/features/debug/debug-module.js +1 -1
- package/lib/features/debug/debug-module.js.map +1 -1
- package/lib/features/element-template/mouse-tracking-element-position-listener.d.ts +8 -6
- package/lib/features/element-template/mouse-tracking-element-position-listener.d.ts.map +1 -1
- package/lib/features/element-template/mouse-tracking-element-position-listener.js +14 -15
- package/lib/features/element-template/mouse-tracking-element-position-listener.js.map +1 -1
- package/lib/features/grid/grid-manager.d.ts +2 -1
- package/lib/features/grid/grid-manager.d.ts.map +1 -1
- package/lib/features/grid/grid-manager.js.map +1 -1
- package/lib/features/grid/grid-model.d.ts +1 -1
- package/lib/features/grid/grid-model.d.ts.map +1 -1
- package/lib/features/grid/grid-model.js +5 -5
- package/lib/features/grid/grid-model.js.map +1 -1
- package/lib/features/grid/grid-module.d.ts +1 -1
- package/lib/features/grid/grid-module.d.ts.map +1 -1
- package/lib/features/grid/grid-module.js +2 -2
- package/lib/features/grid/grid-module.js.map +1 -1
- package/lib/features/helper-lines/helper-line-feedback.d.ts +2 -2
- package/lib/features/helper-lines/helper-line-feedback.js +3 -3
- package/lib/features/helper-lines/helper-line-feedback.js.map +1 -1
- package/lib/features/helper-lines/helper-line-manager-default.d.ts +16 -4
- package/lib/features/helper-lines/helper-line-manager-default.d.ts.map +1 -1
- package/lib/features/helper-lines/helper-line-manager-default.js +56 -15
- package/lib/features/helper-lines/helper-line-manager-default.js.map +1 -1
- package/lib/features/hints/model.d.ts +6 -2
- package/lib/features/hints/model.d.ts.map +1 -1
- package/lib/features/hints/model.js.map +1 -1
- package/lib/features/hints/type-hint-provider.d.ts +1 -1
- package/lib/features/hints/type-hint-provider.d.ts.map +1 -1
- package/lib/features/hints/type-hint-provider.js.map +1 -1
- package/lib/features/select/select-mouse-listener.d.ts +3 -3
- package/lib/features/select/select-mouse-listener.d.ts.map +1 -1
- package/lib/features/select/select-mouse-listener.js +6 -6
- package/lib/features/select/select-mouse-listener.js.map +1 -1
- package/lib/features/tool-palette/tool-palette.d.ts +3 -3
- package/lib/features/tool-palette/tool-palette.d.ts.map +1 -1
- package/lib/features/tool-palette/tool-palette.js +9 -9
- package/lib/features/tool-palette/tool-palette.js.map +1 -1
- package/lib/features/tools/base-tools.d.ts +2 -2
- package/lib/features/tools/base-tools.d.ts.map +1 -1
- package/lib/features/tools/base-tools.js +1 -1
- package/lib/features/tools/change-bounds/change-bounds-manager.d.ts +15 -7
- package/lib/features/tools/change-bounds/change-bounds-manager.d.ts.map +1 -1
- package/lib/features/tools/change-bounds/change-bounds-manager.js +51 -17
- package/lib/features/tools/change-bounds/change-bounds-manager.js.map +1 -1
- package/lib/features/tools/change-bounds/change-bounds-tool-feedback.d.ts.map +1 -1
- package/lib/features/tools/change-bounds/change-bounds-tool-feedback.js +3 -3
- package/lib/features/tools/change-bounds/change-bounds-tool-feedback.js.map +1 -1
- package/lib/features/tools/change-bounds/change-bounds-tool-module.d.ts +1 -1
- package/lib/features/tools/change-bounds/change-bounds-tool-module.js +2 -2
- package/lib/features/tools/change-bounds/change-bounds-tool-module.js.map +1 -1
- package/lib/features/tools/change-bounds/change-bounds-tool-move-feedback.d.ts +5 -5
- package/lib/features/tools/change-bounds/change-bounds-tool-move-feedback.d.ts.map +1 -1
- package/lib/features/tools/change-bounds/change-bounds-tool-move-feedback.js +9 -12
- package/lib/features/tools/change-bounds/change-bounds-tool-move-feedback.js.map +1 -1
- package/lib/features/tools/change-bounds/change-bounds-tool.d.ts +4 -3
- package/lib/features/tools/change-bounds/change-bounds-tool.d.ts.map +1 -1
- package/lib/features/tools/change-bounds/change-bounds-tool.js +13 -32
- package/lib/features/tools/change-bounds/change-bounds-tool.js.map +1 -1
- package/lib/features/tools/change-bounds/change-bounds-tracker.d.ts +11 -4
- package/lib/features/tools/change-bounds/change-bounds-tracker.d.ts.map +1 -1
- package/lib/features/tools/change-bounds/change-bounds-tracker.js +46 -28
- package/lib/features/tools/change-bounds/change-bounds-tracker.js.map +1 -1
- package/lib/features/tools/edge-creation/dangling-edge-feedback.d.ts +1 -1
- package/lib/features/tools/edge-creation/dangling-edge-feedback.js +3 -3
- package/lib/features/tools/edge-creation/dangling-edge-feedback.js.map +1 -1
- package/lib/features/tools/edge-creation/edge-creation-tool-feedback.d.ts +1 -1
- package/lib/features/tools/edge-creation/edge-creation-tool-feedback.d.ts.map +1 -1
- package/lib/features/tools/edge-creation/edge-creation-tool.d.ts +6 -3
- package/lib/features/tools/edge-creation/edge-creation-tool.d.ts.map +1 -1
- package/lib/features/tools/edge-creation/edge-creation-tool.js +13 -11
- package/lib/features/tools/edge-creation/edge-creation-tool.js.map +1 -1
- package/lib/features/tools/edge-edit/edge-edit-tool-feedback.d.ts +4 -3
- package/lib/features/tools/edge-edit/edge-edit-tool-feedback.d.ts.map +1 -1
- package/lib/features/tools/edge-edit/edge-edit-tool-feedback.js +4 -4
- package/lib/features/tools/edge-edit/edge-edit-tool-feedback.js.map +1 -1
- package/lib/features/tools/edge-edit/edge-edit-tool.d.ts +3 -3
- package/lib/features/tools/edge-edit/edge-edit-tool.d.ts.map +1 -1
- package/lib/features/tools/edge-edit/edge-edit-tool.js +4 -4
- 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 +3 -3
- package/lib/features/tools/marquee-selection/marquee-mouse-tool.js.map +1 -1
- package/lib/features/tools/node-creation/container-manager.d.ts +41 -0
- package/lib/features/tools/node-creation/container-manager.d.ts.map +1 -0
- package/lib/features/tools/node-creation/container-manager.js +73 -0
- package/lib/features/tools/node-creation/container-manager.js.map +1 -0
- package/lib/{base/ui-extension/index.d.ts → features/tools/node-creation/insert-indicator.d.ts} +15 -3
- package/lib/features/tools/node-creation/insert-indicator.d.ts.map +1 -0
- package/lib/features/tools/node-creation/insert-indicator.js +40 -0
- package/lib/features/tools/node-creation/insert-indicator.js.map +1 -0
- package/lib/features/tools/node-creation/node-creation-module.d.ts +1 -1
- package/lib/features/tools/node-creation/node-creation-module.d.ts.map +1 -1
- package/lib/features/tools/node-creation/node-creation-module.js +6 -1
- package/lib/features/tools/node-creation/node-creation-module.js.map +1 -1
- package/lib/features/tools/node-creation/node-creation-tool.d.ts +26 -16
- package/lib/features/tools/node-creation/node-creation-tool.d.ts.map +1 -1
- package/lib/features/tools/node-creation/node-creation-tool.js +82 -78
- package/lib/features/tools/node-creation/node-creation-tool.js.map +1 -1
- package/lib/features/{debug/index.d.ts → tools/node-creation/node-creation-views.d.ts} +10 -5
- package/lib/features/tools/node-creation/node-creation-views.d.ts.map +1 -0
- package/lib/features/tools/node-creation/node-creation-views.js +60 -0
- package/lib/features/tools/node-creation/node-creation-views.js.map +1 -0
- package/lib/features/validation/validate.d.ts +1 -1
- package/lib/features/validation/validate.d.ts.map +1 -1
- package/lib/features/validation/validate.js.map +1 -1
- package/lib/features/viewport/viewport-handler.d.ts +1 -1
- package/lib/features/viewport/viewport-handler.d.ts.map +1 -1
- package/lib/features/viewport/viewport-handler.js +3 -3
- package/lib/features/viewport/viewport-handler.js.map +1 -1
- package/lib/index.d.ts +223 -5
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +223 -5
- package/lib/index.js.map +1 -1
- package/lib/utils/gmodel-util.d.ts +2 -0
- package/lib/utils/gmodel-util.d.ts.map +1 -1
- package/lib/utils/gmodel-util.js.map +1 -1
- package/lib/views/ggraph-view.d.ts +1 -1
- package/lib/views/ggraph-view.d.ts.map +1 -1
- package/lib/views/ggraph-view.js +4 -4
- package/lib/views/ggraph-view.js.map +1 -1
- package/lib/views/glsp-projection-view.d.ts +2 -2
- package/lib/views/glsp-projection-view.d.ts.map +1 -1
- package/lib/views/glsp-projection-view.js +5 -5
- package/lib/views/glsp-projection-view.js.map +1 -1
- package/package.json +4 -4
- package/src/base/action-dispatcher.spec.ts +1 -1
- package/src/base/default.module.ts +2 -2
- package/src/base/drag-aware-mouse-listener.ts +18 -2
- package/src/base/feedback/feedback-action-dispatcher-default.ts +119 -0
- package/src/base/feedback/feedback-action-dispatcher.ts +2 -106
- package/src/base/feedback/feedback-emitter.spec.ts +176 -0
- package/src/base/feedback/{feeback-emitter.ts → feedback-emitter.ts} +24 -5
- package/src/base/selection-service.spec.ts +1 -1
- package/src/base/selection-service.ts +1 -1
- package/src/base/tool-manager/tool-manager.ts +1 -1
- package/src/base/ui-extension/ui-extension-registry.ts +1 -1
- package/src/base/view/key-tool.ts +1 -1
- package/src/base/view/mouse-tool.ts +1 -1
- package/src/features/accessibility/move-zoom/move-handler.ts +2 -2
- package/src/features/accessibility/resize-key-tool/resize-key-handler.ts +3 -3
- package/src/features/accessibility/view-key-tools/movement-key-tool.ts +4 -4
- package/src/features/bounds/set-bounds-feedback-command.ts +1 -1
- package/src/features/change-bounds/model.ts +41 -16
- package/src/features/change-bounds/movement-restrictor.ts +13 -13
- package/src/features/change-bounds/point-position-updater.spec.ts +1 -1
- package/src/features/debug/debug-bounds-decorator.tsx +8 -8
- package/src/features/debug/debug-manager.ts +2 -1
- package/src/features/debug/debug-model.ts +2 -2
- package/src/features/debug/debug-module.ts +1 -1
- package/src/features/element-template/mouse-tracking-element-position-listener.ts +17 -24
- package/src/features/grid/grid-manager.ts +2 -1
- package/src/features/grid/grid-model.ts +2 -2
- package/src/features/grid/grid-module.ts +3 -3
- package/src/features/helper-lines/helper-line-feedback.ts +1 -1
- package/src/features/helper-lines/helper-line-manager-default.ts +68 -12
- package/src/features/hints/model.ts +7 -2
- package/src/features/hints/type-hint-provider.spec.ts +3 -3
- package/src/features/hints/type-hint-provider.ts +1 -1
- package/src/features/select/select-mouse-listener.ts +6 -6
- package/src/features/tool-palette/tool-palette.ts +6 -7
- package/src/features/tools/base-tools.ts +2 -2
- package/src/features/tools/change-bounds/change-bounds-manager.ts +75 -17
- package/src/features/tools/change-bounds/change-bounds-tool-feedback.ts +5 -2
- package/src/features/tools/change-bounds/change-bounds-tool-module.ts +2 -2
- package/src/features/tools/change-bounds/change-bounds-tool-move-feedback.ts +13 -11
- package/src/features/tools/change-bounds/change-bounds-tool.ts +12 -57
- package/src/features/tools/change-bounds/change-bounds-tracker.ts +29 -7
- package/src/features/tools/edge-creation/dangling-edge-feedback.ts +2 -2
- package/src/features/tools/edge-creation/edge-creation-tool-feedback.ts +1 -1
- package/src/features/tools/edge-creation/edge-creation-tool.ts +15 -8
- package/src/features/tools/edge-edit/edge-edit-tool-feedback.ts +4 -3
- package/src/features/tools/edge-edit/edge-edit-tool.ts +4 -5
- package/src/features/tools/marquee-selection/marquee-mouse-tool.ts +2 -2
- package/src/features/tools/node-creation/container-manager.ts +76 -0
- package/src/features/tools/node-creation/insert-indicator.ts +41 -0
- package/src/features/tools/node-creation/node-creation-module.ts +14 -2
- package/src/features/tools/node-creation/node-creation-tool.ts +101 -92
- package/src/features/tools/node-creation/node-creation-views.tsx +49 -0
- package/src/features/validation/validate.ts +1 -1
- package/src/features/viewport/viewport-handler.ts +1 -1
- package/src/index.ts +223 -5
- package/src/utils/gmodel-util.ts +4 -1
- package/src/views/ggraph-view.tsx +4 -4
- package/src/views/glsp-projection-view.tsx +4 -5
- package/lib/base/auto-complete/index.d.ts +0 -21
- package/lib/base/auto-complete/index.d.ts.map +0 -1
- package/lib/base/auto-complete/index.js +0 -37
- package/lib/base/auto-complete/index.js.map +0 -1
- package/lib/base/feedback/feeback-emitter.d.ts.map +0 -1
- package/lib/base/feedback/feeback-emitter.js.map +0 -1
- package/lib/base/feedback/index.d.ts +0 -22
- package/lib/base/feedback/index.d.ts.map +0 -1
- package/lib/base/feedback/index.js +0 -38
- package/lib/base/feedback/index.js.map +0 -1
- package/lib/base/focus/index.d.ts +0 -18
- package/lib/base/focus/index.d.ts.map +0 -1
- package/lib/base/focus/index.js +0 -34
- package/lib/base/focus/index.js.map +0 -1
- package/lib/base/index.d.ts +0 -34
- package/lib/base/index.d.ts.map +0 -1
- package/lib/base/index.js +0 -50
- package/lib/base/index.js.map +0 -1
- package/lib/base/model/index.d.ts +0 -20
- package/lib/base/model/index.d.ts.map +0 -1
- package/lib/base/model/index.js +0 -36
- package/lib/base/model/index.js.map +0 -1
- package/lib/base/tool-manager/index.d.ts +0 -18
- package/lib/base/tool-manager/index.d.ts.map +0 -1
- package/lib/base/tool-manager/index.js +0 -34
- package/lib/base/tool-manager/index.js.map +0 -1
- package/lib/base/ui-extension/index.d.ts.map +0 -1
- package/lib/base/ui-extension/index.js +0 -34
- package/lib/base/ui-extension/index.js.map +0 -1
- package/lib/base/view/index.d.ts +0 -19
- package/lib/base/view/index.d.ts.map +0 -1
- package/lib/base/view/index.js +0 -35
- package/lib/base/view/index.js.map +0 -1
- package/lib/features/accessibility/edge-autocomplete/index.d.ts +0 -20
- package/lib/features/accessibility/edge-autocomplete/index.d.ts.map +0 -1
- package/lib/features/accessibility/edge-autocomplete/index.js +0 -36
- package/lib/features/accessibility/edge-autocomplete/index.js.map +0 -1
- package/lib/features/accessibility/element-navigation/index.d.ts +0 -22
- package/lib/features/accessibility/element-navigation/index.d.ts.map +0 -1
- package/lib/features/accessibility/element-navigation/index.js +0 -38
- package/lib/features/accessibility/element-navigation/index.js.map +0 -1
- package/lib/features/accessibility/focus-tracker/index.d.ts +0 -18
- package/lib/features/accessibility/focus-tracker/index.d.ts.map +0 -1
- package/lib/features/accessibility/focus-tracker/index.js +0 -34
- package/lib/features/accessibility/focus-tracker/index.js.map +0 -1
- package/lib/features/accessibility/index.d.ts +0 -31
- package/lib/features/accessibility/index.d.ts.map +0 -1
- package/lib/features/accessibility/index.js +0 -47
- package/lib/features/accessibility/index.js.map +0 -1
- package/lib/features/accessibility/key-shortcut/index.d.ts +0 -19
- package/lib/features/accessibility/key-shortcut/index.d.ts.map +0 -1
- package/lib/features/accessibility/key-shortcut/index.js +0 -35
- package/lib/features/accessibility/key-shortcut/index.js.map +0 -1
- package/lib/features/accessibility/keyboard-grid/index.d.ts +0 -21
- package/lib/features/accessibility/keyboard-grid/index.d.ts.map +0 -1
- package/lib/features/accessibility/keyboard-grid/index.js +0 -37
- package/lib/features/accessibility/keyboard-grid/index.js.map +0 -1
- package/lib/features/accessibility/keyboard-pointer/index.d.ts +0 -22
- package/lib/features/accessibility/keyboard-pointer/index.d.ts.map +0 -1
- package/lib/features/accessibility/keyboard-pointer/index.js +0 -38
- package/lib/features/accessibility/keyboard-pointer/index.js.map +0 -1
- package/lib/features/accessibility/keyboard-tool-palette/index.d.ts +0 -18
- package/lib/features/accessibility/keyboard-tool-palette/index.d.ts.map +0 -1
- package/lib/features/accessibility/keyboard-tool-palette/index.js +0 -34
- package/lib/features/accessibility/keyboard-tool-palette/index.js.map +0 -1
- package/lib/features/accessibility/move-zoom/index.d.ts +0 -19
- package/lib/features/accessibility/move-zoom/index.d.ts.map +0 -1
- package/lib/features/accessibility/move-zoom/index.js +0 -35
- package/lib/features/accessibility/move-zoom/index.js.map +0 -1
- package/lib/features/accessibility/resize-key-tool/index.d.ts +0 -19
- package/lib/features/accessibility/resize-key-tool/index.d.ts.map +0 -1
- package/lib/features/accessibility/resize-key-tool/index.js +0 -35
- package/lib/features/accessibility/resize-key-tool/index.js.map +0 -1
- package/lib/features/accessibility/search/index.d.ts +0 -19
- package/lib/features/accessibility/search/index.d.ts.map +0 -1
- package/lib/features/accessibility/search/index.js +0 -35
- package/lib/features/accessibility/search/index.js.map +0 -1
- package/lib/features/accessibility/toast/index.d.ts +0 -19
- package/lib/features/accessibility/toast/index.d.ts.map +0 -1
- package/lib/features/accessibility/toast/index.js +0 -35
- package/lib/features/accessibility/toast/index.js.map +0 -1
- package/lib/features/accessibility/view-key-tools/index.d.ts +0 -20
- package/lib/features/accessibility/view-key-tools/index.d.ts.map +0 -1
- package/lib/features/accessibility/view-key-tools/index.js +0 -36
- package/lib/features/accessibility/view-key-tools/index.js.map +0 -1
- package/lib/features/bounds/index.d.ts +0 -25
- package/lib/features/bounds/index.d.ts.map +0 -1
- package/lib/features/bounds/index.js +0 -41
- package/lib/features/bounds/index.js.map +0 -1
- package/lib/features/change-bounds/index.d.ts +0 -22
- package/lib/features/change-bounds/index.d.ts.map +0 -1
- package/lib/features/change-bounds/index.js +0 -38
- package/lib/features/change-bounds/index.js.map +0 -1
- package/lib/features/command-palette/index.d.ts +0 -20
- package/lib/features/command-palette/index.d.ts.map +0 -1
- package/lib/features/command-palette/index.js +0 -36
- package/lib/features/command-palette/index.js.map +0 -1
- package/lib/features/context-menu/index.d.ts +0 -20
- package/lib/features/context-menu/index.d.ts.map +0 -1
- package/lib/features/context-menu/index.js +0 -36
- package/lib/features/context-menu/index.js.map +0 -1
- package/lib/features/copy-paste/index.d.ts +0 -20
- package/lib/features/copy-paste/index.d.ts.map +0 -1
- package/lib/features/copy-paste/index.js +0 -36
- package/lib/features/copy-paste/index.js.map +0 -1
- package/lib/features/debug/index.d.ts.map +0 -1
- package/lib/features/debug/index.js +0 -36
- package/lib/features/debug/index.js.map +0 -1
- package/lib/features/decoration/index.d.ts +0 -18
- package/lib/features/decoration/index.d.ts.map +0 -1
- package/lib/features/decoration/index.js +0 -34
- package/lib/features/decoration/index.js.map +0 -1
- package/lib/features/element-template/index.d.ts +0 -20
- package/lib/features/element-template/index.d.ts.map +0 -1
- package/lib/features/element-template/index.js +0 -36
- package/lib/features/element-template/index.js.map +0 -1
- package/lib/features/export/index.d.ts +0 -19
- package/lib/features/export/index.d.ts.map +0 -1
- package/lib/features/export/index.js +0 -35
- package/lib/features/export/index.js.map +0 -1
- package/lib/features/grid/index.d.ts +0 -21
- package/lib/features/grid/index.d.ts.map +0 -1
- package/lib/features/grid/index.js +0 -37
- package/lib/features/grid/index.js.map +0 -1
- package/lib/features/helper-lines/index.d.ts +0 -22
- package/lib/features/helper-lines/index.d.ts.map +0 -1
- package/lib/features/helper-lines/index.js +0 -38
- package/lib/features/helper-lines/index.js.map +0 -1
- package/lib/features/hints/index.d.ts +0 -19
- package/lib/features/hints/index.d.ts.map +0 -1
- package/lib/features/hints/index.js +0 -35
- package/lib/features/hints/index.js.map +0 -1
- package/lib/features/hover/index.d.ts +0 -18
- package/lib/features/hover/index.d.ts.map +0 -1
- package/lib/features/hover/index.js +0 -34
- package/lib/features/hover/index.js.map +0 -1
- package/lib/features/index.d.ts +0 -46
- package/lib/features/index.d.ts.map +0 -1
- package/lib/features/index.js +0 -62
- package/lib/features/index.js.map +0 -1
- package/lib/features/label-edit/index.d.ts +0 -19
- package/lib/features/label-edit/index.d.ts.map +0 -1
- package/lib/features/label-edit/index.js +0 -35
- package/lib/features/label-edit/index.js.map +0 -1
- package/lib/features/label-edit-ui/index.d.ts +0 -18
- package/lib/features/label-edit-ui/index.d.ts.map +0 -1
- package/lib/features/label-edit-ui/index.js +0 -34
- package/lib/features/label-edit-ui/index.js.map +0 -1
- package/lib/features/layout/index.d.ts +0 -18
- package/lib/features/layout/index.d.ts.map +0 -1
- package/lib/features/layout/index.js +0 -34
- package/lib/features/layout/index.js.map +0 -1
- package/lib/features/navigation/index.d.ts +0 -19
- package/lib/features/navigation/index.d.ts.map +0 -1
- package/lib/features/navigation/index.js +0 -35
- package/lib/features/navigation/index.js.map +0 -1
- package/lib/features/reconnect/index.d.ts +0 -17
- package/lib/features/reconnect/index.d.ts.map +0 -1
- package/lib/features/reconnect/index.js +0 -33
- package/lib/features/reconnect/index.js.map +0 -1
- package/lib/features/routing/index.d.ts +0 -18
- package/lib/features/routing/index.d.ts.map +0 -1
- package/lib/features/routing/index.js +0 -34
- package/lib/features/routing/index.js.map +0 -1
- package/lib/features/save/index.d.ts +0 -18
- package/lib/features/save/index.d.ts.map +0 -1
- package/lib/features/save/index.js +0 -34
- package/lib/features/save/index.js.map +0 -1
- package/lib/features/select/index.d.ts +0 -19
- package/lib/features/select/index.d.ts.map +0 -1
- package/lib/features/select/index.js +0 -35
- package/lib/features/select/index.js.map +0 -1
- package/lib/features/source-model-watcher/index.d.ts +0 -18
- package/lib/features/source-model-watcher/index.d.ts.map +0 -1
- package/lib/features/source-model-watcher/index.js +0 -34
- package/lib/features/source-model-watcher/index.js.map +0 -1
- package/lib/features/status/index.d.ts +0 -18
- package/lib/features/status/index.d.ts.map +0 -1
- package/lib/features/status/index.js +0 -34
- package/lib/features/status/index.js.map +0 -1
- package/lib/features/svg-metadata/index.d.ts +0 -18
- package/lib/features/svg-metadata/index.d.ts.map +0 -1
- package/lib/features/svg-metadata/index.js +0 -34
- package/lib/features/svg-metadata/index.js.map +0 -1
- package/lib/features/tool-palette/index.d.ts +0 -18
- package/lib/features/tool-palette/index.d.ts.map +0 -1
- package/lib/features/tool-palette/index.js +0 -34
- package/lib/features/tool-palette/index.js.map +0 -1
- package/lib/features/tools/change-bounds/index.d.ts +0 -23
- package/lib/features/tools/change-bounds/index.d.ts.map +0 -1
- package/lib/features/tools/change-bounds/index.js +0 -39
- package/lib/features/tools/change-bounds/index.js.map +0 -1
- package/lib/features/tools/deletion/index.d.ts +0 -18
- package/lib/features/tools/deletion/index.d.ts.map +0 -1
- package/lib/features/tools/deletion/index.js +0 -34
- package/lib/features/tools/deletion/index.js.map +0 -1
- package/lib/features/tools/edge-creation/index.d.ts +0 -21
- package/lib/features/tools/edge-creation/index.d.ts.map +0 -1
- package/lib/features/tools/edge-creation/index.js +0 -37
- package/lib/features/tools/edge-creation/index.js.map +0 -1
- package/lib/features/tools/edge-edit/index.d.ts +0 -19
- package/lib/features/tools/edge-edit/index.d.ts.map +0 -1
- package/lib/features/tools/edge-edit/index.js +0 -35
- package/lib/features/tools/edge-edit/index.js.map +0 -1
- package/lib/features/tools/index.d.ts +0 -24
- package/lib/features/tools/index.d.ts.map +0 -1
- package/lib/features/tools/index.js +0 -40
- package/lib/features/tools/index.js.map +0 -1
- package/lib/features/tools/marquee-selection/index.d.ts +0 -23
- package/lib/features/tools/marquee-selection/index.d.ts.map +0 -1
- package/lib/features/tools/marquee-selection/index.js +0 -39
- package/lib/features/tools/marquee-selection/index.js.map +0 -1
- package/lib/features/tools/node-creation/index.d.ts +0 -18
- package/lib/features/tools/node-creation/index.d.ts.map +0 -1
- package/lib/features/tools/node-creation/index.js +0 -34
- package/lib/features/tools/node-creation/index.js.map +0 -1
- package/lib/features/undo-redo/index.d.ts +0 -18
- package/lib/features/undo-redo/index.d.ts.map +0 -1
- package/lib/features/undo-redo/index.js +0 -34
- package/lib/features/undo-redo/index.js.map +0 -1
- package/lib/features/validation/index.d.ts +0 -20
- package/lib/features/validation/index.d.ts.map +0 -1
- package/lib/features/validation/index.js +0 -36
- package/lib/features/validation/index.js.map +0 -1
- package/lib/features/viewport/index.d.ts +0 -21
- package/lib/features/viewport/index.d.ts.map +0 -1
- package/lib/features/viewport/index.js +0 -37
- package/lib/features/viewport/index.js.map +0 -1
- package/lib/utils/index.d.ts +0 -23
- package/lib/utils/index.d.ts.map +0 -1
- package/lib/utils/index.js +0 -39
- package/lib/utils/index.js.map +0 -1
- package/lib/views/index.d.ts +0 -24
- package/lib/views/index.d.ts.map +0 -1
- package/lib/views/index.js +0 -40
- package/lib/views/index.js.map +0 -1
- package/src/base/auto-complete/index.ts +0 -20
- package/src/base/feedback/index.ts +0 -21
- package/src/base/focus/index.ts +0 -17
- package/src/base/index.ts +0 -33
- package/src/base/model/index.ts +0 -19
- package/src/base/tool-manager/index.ts +0 -17
- package/src/base/ui-extension/index.ts +0 -17
- package/src/base/view/index.ts +0 -18
- package/src/features/accessibility/edge-autocomplete/index.ts +0 -19
- package/src/features/accessibility/element-navigation/index.ts +0 -21
- package/src/features/accessibility/focus-tracker/index.ts +0 -17
- package/src/features/accessibility/index.ts +0 -30
- package/src/features/accessibility/key-shortcut/index.ts +0 -18
- package/src/features/accessibility/keyboard-grid/index.ts +0 -20
- package/src/features/accessibility/keyboard-pointer/index.ts +0 -21
- package/src/features/accessibility/keyboard-tool-palette/index.ts +0 -17
- package/src/features/accessibility/move-zoom/index.ts +0 -18
- package/src/features/accessibility/resize-key-tool/index.ts +0 -18
- package/src/features/accessibility/search/index.ts +0 -18
- package/src/features/accessibility/toast/index.ts +0 -18
- package/src/features/accessibility/view-key-tools/index.ts +0 -19
- package/src/features/bounds/index.ts +0 -24
- package/src/features/change-bounds/index.ts +0 -21
- package/src/features/command-palette/index.ts +0 -19
- package/src/features/context-menu/index.ts +0 -19
- package/src/features/copy-paste/index.ts +0 -19
- package/src/features/debug/index.ts +0 -19
- package/src/features/decoration/index.ts +0 -17
- package/src/features/element-template/index.ts +0 -19
- package/src/features/export/index.ts +0 -18
- package/src/features/grid/index.ts +0 -20
- package/src/features/helper-lines/index.ts +0 -21
- package/src/features/hints/index.ts +0 -18
- package/src/features/hover/index.ts +0 -17
- package/src/features/index.ts +0 -45
- package/src/features/label-edit/index.ts +0 -18
- package/src/features/label-edit-ui/index.ts +0 -17
- package/src/features/layout/index.ts +0 -17
- package/src/features/navigation/index.ts +0 -18
- package/src/features/reconnect/index.ts +0 -16
- package/src/features/routing/index.ts +0 -17
- package/src/features/save/index.ts +0 -17
- package/src/features/select/index.ts +0 -18
- package/src/features/source-model-watcher/index.ts +0 -17
- package/src/features/status/index.ts +0 -17
- package/src/features/svg-metadata/index.ts +0 -17
- package/src/features/tool-palette/index.ts +0 -17
- package/src/features/tools/change-bounds/index.ts +0 -22
- package/src/features/tools/deletion/index.ts +0 -17
- package/src/features/tools/edge-creation/index.ts +0 -20
- package/src/features/tools/edge-edit/index.ts +0 -18
- package/src/features/tools/index.ts +0 -23
- package/src/features/tools/marquee-selection/index.ts +0 -22
- package/src/features/tools/node-creation/index.ts +0 -17
- package/src/features/undo-redo/index.ts +0 -17
- package/src/features/validation/index.ts +0 -19
- package/src/features/viewport/index.ts +0 -20
- package/src/utils/index.ts +0 -22
- package/src/views/index.ts +0 -23
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2024 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 { Action, Command, CommandExecutionContext, Disposable } from '@eclipse-glsp/sprotty';
|
|
17
|
+
import { expect } from 'chai';
|
|
18
|
+
import { IFeedbackActionDispatcher, IFeedbackEmitter } from './feedback-action-dispatcher';
|
|
19
|
+
import { FeedbackEmitter } from './feedback-emitter';
|
|
20
|
+
|
|
21
|
+
class MockFeedbackActionDispatcher implements IFeedbackActionDispatcher {
|
|
22
|
+
protected feedbackEmitters: Map<IFeedbackEmitter, Action[]> = new Map();
|
|
23
|
+
|
|
24
|
+
registerFeedback(feedbackEmitter: IFeedbackEmitter, actions: Action[]): Disposable {
|
|
25
|
+
this.feedbackEmitters.set(feedbackEmitter, actions);
|
|
26
|
+
return Disposable.create(() => this.deregisterFeedback(feedbackEmitter));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
deregisterFeedback(feedbackEmitter: IFeedbackEmitter, _actions?: Action[]): void {
|
|
30
|
+
this.feedbackEmitters.delete(feedbackEmitter);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
getRegisteredFeedback(): Action[] {
|
|
34
|
+
const result: Action[] = [];
|
|
35
|
+
this.feedbackEmitters.forEach((value, key) => result.push(...value));
|
|
36
|
+
return result;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
getFeedbackCommands(): Command[] {
|
|
40
|
+
return [];
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
createEmitter(): FeedbackEmitter {
|
|
44
|
+
return new FeedbackEmitter(this);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
async applyFeedbackCommands(context: CommandExecutionContext): Promise<void> {}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
describe('FeedbackEmitter', () => {
|
|
51
|
+
describe('Initial State', () => {
|
|
52
|
+
it('On creation nothing should be submitted.', () => {
|
|
53
|
+
const feedbackActionDispatcher = new MockFeedbackActionDispatcher();
|
|
54
|
+
const feedback = feedbackActionDispatcher.createEmitter();
|
|
55
|
+
feedback.submit();
|
|
56
|
+
expect(feedbackActionDispatcher['feedbackEmitters']).to.be.empty;
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
describe('Adding Feedback', () => {
|
|
61
|
+
it('Should add an action as part of the emitter feedback.', () => {
|
|
62
|
+
const feedbackActionDispatcher = new MockFeedbackActionDispatcher();
|
|
63
|
+
const feedback = feedbackActionDispatcher.createEmitter();
|
|
64
|
+
const action: Action = { kind: 'action' };
|
|
65
|
+
feedback.add(action);
|
|
66
|
+
expect(feedback['feedbackActions']).to.deep.equal([action]);
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
it('Should add an action and cleanup action as part of the emitter feedback.', () => {
|
|
70
|
+
const feedbackActionDispatcher = new MockFeedbackActionDispatcher();
|
|
71
|
+
const feedback = feedbackActionDispatcher.createEmitter();
|
|
72
|
+
const action: Action = { kind: 'action' };
|
|
73
|
+
const cleanupAction: Action = { kind: 'cleanup' };
|
|
74
|
+
feedback.add(action, cleanupAction);
|
|
75
|
+
expect(feedback['feedbackActions']).to.deep.equal([action]);
|
|
76
|
+
expect(feedback['cleanupActions']).to.deep.equal([cleanupAction]);
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
describe('Merging Feedback', () => {
|
|
81
|
+
it('Should merge the feedback of another emitter into this emitter.', () => {
|
|
82
|
+
const feedbackActionDispatcher = new MockFeedbackActionDispatcher();
|
|
83
|
+
const feedback1 = feedbackActionDispatcher.createEmitter();
|
|
84
|
+
const feedback2 = feedbackActionDispatcher.createEmitter();
|
|
85
|
+
const action1: Action = { kind: 'action1' };
|
|
86
|
+
const action2: Action = { kind: 'action2' };
|
|
87
|
+
feedback1.add(action1);
|
|
88
|
+
feedback2.add(action2);
|
|
89
|
+
feedback1.merge(feedback2);
|
|
90
|
+
expect(feedback1['feedbackActions']).to.deep.equal([action1, action2]);
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
describe('Removing Feedback', () => {
|
|
95
|
+
it('Should remove the action from the emitter feedback.', () => {
|
|
96
|
+
const feedbackActionDispatcher = new MockFeedbackActionDispatcher();
|
|
97
|
+
const feedback = feedbackActionDispatcher.createEmitter();
|
|
98
|
+
const action: Action = { kind: 'action' };
|
|
99
|
+
feedback.add(action);
|
|
100
|
+
feedback.remove(action);
|
|
101
|
+
expect(feedback['feedbackActions']).to.be.empty;
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
it('Should remove the action together with the cleanup action from the emitter feedback.', () => {
|
|
105
|
+
const feedbackActionDispatcher = new MockFeedbackActionDispatcher();
|
|
106
|
+
const feedback = feedbackActionDispatcher.createEmitter();
|
|
107
|
+
const action: Action = { kind: 'action' };
|
|
108
|
+
const cleanupAction: Action = { kind: 'cleanup' };
|
|
109
|
+
feedback.add(action, cleanupAction);
|
|
110
|
+
feedback.remove(action);
|
|
111
|
+
expect(feedback['feedbackActions']).to.be.empty;
|
|
112
|
+
expect(feedback['cleanupActions']).to.be.empty;
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
describe('Clearing Feedback', () => {
|
|
117
|
+
it('Should clear any pending feedback actions and cleanup actions.', () => {
|
|
118
|
+
const feedbackActionDispatcher = new MockFeedbackActionDispatcher();
|
|
119
|
+
const feedback = feedbackActionDispatcher.createEmitter();
|
|
120
|
+
const action: Action = { kind: 'action' };
|
|
121
|
+
const cleanupAction: Action = { kind: 'cleanup' };
|
|
122
|
+
feedback.add(action, cleanupAction);
|
|
123
|
+
feedback.clear();
|
|
124
|
+
expect(feedback['feedbackActions']).to.be.empty;
|
|
125
|
+
expect(feedback['cleanupActions']).to.be.empty;
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
describe('Submitting Feedback', () => {
|
|
130
|
+
it('Should register any pending actions as feedback.', () => {
|
|
131
|
+
const feedbackActionDispatcher = new MockFeedbackActionDispatcher();
|
|
132
|
+
const feedback = feedbackActionDispatcher.createEmitter();
|
|
133
|
+
const action: Action = { kind: 'action' };
|
|
134
|
+
feedback.add(action);
|
|
135
|
+
feedback.submit();
|
|
136
|
+
expect(feedbackActionDispatcher['feedbackEmitters'].size).to.equal(1);
|
|
137
|
+
expect(feedbackActionDispatcher['feedbackEmitters'].get(feedback)).to.deep.equal([action]);
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
describe('Discarding Feedback', () => {
|
|
142
|
+
it('Should remove the registered feedback without calling any cleanup actions.', () => {
|
|
143
|
+
const feedbackActionDispatcher = new MockFeedbackActionDispatcher();
|
|
144
|
+
const feedback = feedbackActionDispatcher.createEmitter();
|
|
145
|
+
const action: Action = { kind: 'action' };
|
|
146
|
+
feedback.add(action);
|
|
147
|
+
feedback.submit();
|
|
148
|
+
feedback.discard();
|
|
149
|
+
expect(feedbackActionDispatcher['feedbackEmitters']).to.be.empty;
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
describe('Reverting Feedback', () => {
|
|
154
|
+
it('Should remove the registered feedback and call the registered cleanup actions.', () => {
|
|
155
|
+
const feedbackActionDispatcher = new MockFeedbackActionDispatcher();
|
|
156
|
+
const feedback = feedbackActionDispatcher.createEmitter();
|
|
157
|
+
const action: Action = { kind: 'action' };
|
|
158
|
+
const cleanupAction: Action = { kind: 'cleanup' };
|
|
159
|
+
feedback.add(action, cleanupAction);
|
|
160
|
+
feedback.submit();
|
|
161
|
+
feedback.revert();
|
|
162
|
+
expect(feedbackActionDispatcher['feedbackEmitters']).to.be.empty;
|
|
163
|
+
});
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
describe('Disposing Feedback', () => {
|
|
167
|
+
it('Should dispose the registered feedback and any pending feedback actions.', () => {
|
|
168
|
+
const feedbackActionDispatcher = new MockFeedbackActionDispatcher();
|
|
169
|
+
const feedback = feedbackActionDispatcher.createEmitter();
|
|
170
|
+
const action: Action = { kind: 'action' };
|
|
171
|
+
feedback.add(action);
|
|
172
|
+
feedback.dispose();
|
|
173
|
+
expect(feedbackActionDispatcher['feedbackEmitters']).to.be.empty;
|
|
174
|
+
});
|
|
175
|
+
});
|
|
176
|
+
});
|
|
@@ -17,10 +17,14 @@
|
|
|
17
17
|
import { Action, Disposable, arrayOf } from '@eclipse-glsp/sprotty';
|
|
18
18
|
import { IFeedbackActionDispatcher, IFeedbackEmitter, MaybeActions } from './feedback-action-dispatcher';
|
|
19
19
|
|
|
20
|
+
// counter for internal id, mainly useful for debugging
|
|
21
|
+
let idCounter = 0;
|
|
22
|
+
|
|
20
23
|
/**
|
|
21
24
|
* A helper object to collect, submit and undo feedback consisting of several actions.
|
|
22
25
|
*/
|
|
23
26
|
export class FeedbackEmitter implements IFeedbackEmitter, Disposable {
|
|
27
|
+
protected id = idCounter++;
|
|
24
28
|
protected feedbackActions: (Action | undefined)[] = [];
|
|
25
29
|
protected cleanupActions: MaybeActions[] = [];
|
|
26
30
|
protected deregistration?: Disposable;
|
|
@@ -46,6 +50,17 @@ export class FeedbackEmitter implements IFeedbackEmitter, Disposable {
|
|
|
46
50
|
return this;
|
|
47
51
|
}
|
|
48
52
|
|
|
53
|
+
/**
|
|
54
|
+
* Merges the feedback of another emitter into this emitter.
|
|
55
|
+
*
|
|
56
|
+
* @param feedback feedback to merge
|
|
57
|
+
*/
|
|
58
|
+
merge(feedback: FeedbackEmitter): this {
|
|
59
|
+
this.feedbackActions.push(...feedback.feedbackActions);
|
|
60
|
+
this.cleanupActions.push(...feedback.cleanupActions);
|
|
61
|
+
return this;
|
|
62
|
+
}
|
|
63
|
+
|
|
49
64
|
/**
|
|
50
65
|
* Removes the action as part of this emitters feedback. If the action cannot be found, this is a no-op.
|
|
51
66
|
* Please note that this also removed the corresponding cleanup action.
|
|
@@ -56,9 +71,9 @@ export class FeedbackEmitter implements IFeedbackEmitter, Disposable {
|
|
|
56
71
|
*/
|
|
57
72
|
remove(action: Action): this {
|
|
58
73
|
const idx = this.feedbackActions.indexOf(action);
|
|
59
|
-
if (idx) {
|
|
60
|
-
|
|
61
|
-
|
|
74
|
+
if (idx >= 0) {
|
|
75
|
+
this.feedbackActions.splice(idx, 1);
|
|
76
|
+
this.cleanupActions.splice(idx, 1);
|
|
62
77
|
}
|
|
63
78
|
return this;
|
|
64
79
|
}
|
|
@@ -79,8 +94,12 @@ export class FeedbackEmitter implements IFeedbackEmitter, Disposable {
|
|
|
79
94
|
// with 'arrayOf' we skip undefined entries that are created for non-cleanup actions or cleanup-only actions
|
|
80
95
|
const actions = arrayOf(...this.feedbackActions);
|
|
81
96
|
const cleanupActions = arrayOf(...this.cleanupActions);
|
|
82
|
-
|
|
83
|
-
|
|
97
|
+
if (actions.length > 0 || cleanupActions.length > 0) {
|
|
98
|
+
this.deregistration = this.feedbackDispatcher.registerFeedback(this, actions, () =>
|
|
99
|
+
cleanupActions.flatMap(MaybeActions.asArray)
|
|
100
|
+
);
|
|
101
|
+
this.clear();
|
|
102
|
+
}
|
|
84
103
|
return this;
|
|
85
104
|
}
|
|
86
105
|
|
|
@@ -18,8 +18,8 @@ import { AssertionError, expect } from 'chai';
|
|
|
18
18
|
import { Container, injectable } from 'inversify';
|
|
19
19
|
import * as sinon from 'sinon';
|
|
20
20
|
import { defaultModule } from './default.module';
|
|
21
|
-
import { FeedbackEmitter } from './feedback/feeback-emitter';
|
|
22
21
|
import { IFeedbackActionDispatcher, IFeedbackEmitter } from './feedback/feedback-action-dispatcher';
|
|
22
|
+
import { FeedbackEmitter } from './feedback/feedback-emitter';
|
|
23
23
|
import { ISelectionListener, SelectFeedbackAction, SelectionService } from './selection-service';
|
|
24
24
|
|
|
25
25
|
@injectable()
|
|
@@ -39,7 +39,7 @@ import { inject, injectable, postConstruct, preDestroy } from 'inversify';
|
|
|
39
39
|
import { SelectableElement, getElements, getMatchingElements } from '../utils/gmodel-util';
|
|
40
40
|
import { IGModelRootListener } from './editor-context-service';
|
|
41
41
|
import { IFeedbackActionDispatcher } from './feedback/feedback-action-dispatcher';
|
|
42
|
-
import { IDiagramStartup } from './model';
|
|
42
|
+
import { IDiagramStartup } from './model/diagram-loader';
|
|
43
43
|
|
|
44
44
|
export interface ISelectionListener {
|
|
45
45
|
selectionChanged(root: Readonly<GModelRoot>, selectedElements: string[], deselectedElements?: string[]): void;
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
} from '@eclipse-glsp/sprotty';
|
|
30
30
|
import { inject, injectable } from 'inversify';
|
|
31
31
|
import { EditorContextService, IEditModeListener } from '../editor-context-service';
|
|
32
|
-
import { IDiagramStartup } from '../model';
|
|
32
|
+
import { IDiagramStartup } from '../model/diagram-loader';
|
|
33
33
|
import { Ranked } from '../ranked';
|
|
34
34
|
import { EnableDefaultToolsAction, EnableToolsAction, Tool } from './tool';
|
|
35
35
|
/**
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
import { IUIExtension, LazyInjector, MaybePromise, TYPES, UIExtensionRegistry } from '@eclipse-glsp/sprotty';
|
|
18
18
|
import { inject, injectable, optional } from 'inversify';
|
|
19
|
-
import { IDiagramStartup } from '../model';
|
|
19
|
+
import { IDiagramStartup } from '../model/diagram-loader';
|
|
20
20
|
|
|
21
21
|
@injectable()
|
|
22
22
|
export class GLSPUIExtensionRegistry extends UIExtensionRegistry implements IDiagramStartup {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
import { Disposable, KeyListener, KeyTool, LazyInjector, MaybePromise, TYPES } from '@eclipse-glsp/sprotty';
|
|
17
17
|
import { inject, injectable, optional } from 'inversify';
|
|
18
|
-
import { IDiagramStartup } from '../model';
|
|
18
|
+
import { IDiagramStartup } from '../model/diagram-loader';
|
|
19
19
|
|
|
20
20
|
@injectable()
|
|
21
21
|
export class GLSPKeyTool extends KeyTool implements IDiagramStartup {
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
TYPES
|
|
26
26
|
} from '@eclipse-glsp/sprotty';
|
|
27
27
|
import { inject, injectable, optional } from 'inversify';
|
|
28
|
-
import { IDiagramStartup } from '../model';
|
|
28
|
+
import { IDiagramStartup } from '../model/diagram-loader';
|
|
29
29
|
import { Ranked } from '../ranked';
|
|
30
30
|
|
|
31
31
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2023 Business Informatics Group (TU Wien) and others.
|
|
2
|
+
* Copyright (c) 2023-2024 Business Informatics Group (TU Wien) and others.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made available under the
|
|
5
5
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -35,9 +35,9 @@ import {
|
|
|
35
35
|
} from '@eclipse-glsp/sprotty';
|
|
36
36
|
import { inject, injectable, optional, postConstruct } from 'inversify';
|
|
37
37
|
import { DebouncedFunc, debounce } from 'lodash';
|
|
38
|
-
import { FeedbackEmitter } from '../../../base';
|
|
39
38
|
import { EditorContextService } from '../../../base/editor-context-service';
|
|
40
39
|
import { IFeedbackActionDispatcher } from '../../../base/feedback/feedback-action-dispatcher';
|
|
40
|
+
import { FeedbackEmitter } from '../../../base/feedback/feedback-emitter';
|
|
41
41
|
import { SelectableBoundsAware, getElements, isSelectableAndBoundsAware } from '../../../utils/gmodel-util';
|
|
42
42
|
import { isValidMove } from '../../../utils/layout-utils';
|
|
43
43
|
import { outsideOfViewport } from '../../../utils/viewpoint-util';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2023 Business Informatics Group (TU Wien) and others.
|
|
2
|
+
* Copyright (c) 2023-2024 Business Informatics Group (TU Wien) and others.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made available under the
|
|
5
5
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -31,12 +31,12 @@ import {
|
|
|
31
31
|
} from '@eclipse-glsp/sprotty';
|
|
32
32
|
import { inject, injectable, optional, postConstruct } from 'inversify';
|
|
33
33
|
import { DebouncedFunc, debounce } from 'lodash';
|
|
34
|
-
import { FeedbackEmitter } from '../../../base';
|
|
35
34
|
import { EditorContextService } from '../../../base/editor-context-service';
|
|
36
35
|
import { IFeedbackActionDispatcher } from '../../../base/feedback/feedback-action-dispatcher';
|
|
36
|
+
import { FeedbackEmitter } from '../../../base/feedback/feedback-emitter';
|
|
37
37
|
import { Resizable, SelectableBoundsAware, getElements, isSelectableAndBoundsAware, toElementAndBounds } from '../../../utils/gmodel-util';
|
|
38
38
|
import { isValidMove, isValidSize, minHeight, minWidth } from '../../../utils/layout-utils';
|
|
39
|
-
import { Grid } from '../../grid';
|
|
39
|
+
import { Grid } from '../../grid/grid';
|
|
40
40
|
|
|
41
41
|
export enum ResizeType {
|
|
42
42
|
Increase,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2023 Business Informatics Group (TU Wien) and others.
|
|
2
|
+
* Copyright (c) 2023-2024 Business Informatics Group (TU Wien) and others.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made available under the
|
|
5
5
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -20,8 +20,8 @@ import { matchesKeystroke } from 'sprotty/lib/utils/keyboard';
|
|
|
20
20
|
import { GLSPActionDispatcher } from '../../../base/action-dispatcher';
|
|
21
21
|
import { SelectionService } from '../../../base/selection-service';
|
|
22
22
|
import { Tool } from '../../../base/tool-manager/tool';
|
|
23
|
-
import { Grid } from '../../grid';
|
|
24
|
-
import { ChangeBoundsManager } from '../../tools';
|
|
23
|
+
import { Grid } from '../../grid/grid';
|
|
24
|
+
import { ChangeBoundsManager } from '../../tools/change-bounds/change-bounds-manager';
|
|
25
25
|
import { AccessibleKeyShortcutProvider, SetAccessibleKeyShortcutAction } from '../key-shortcut/accessible-key-shortcut';
|
|
26
26
|
import { MoveElementAction, MoveViewportAction } from '../move-zoom/move-handler';
|
|
27
27
|
|
|
@@ -41,7 +41,7 @@ export class MovementKeyTool implements Tool {
|
|
|
41
41
|
@inject(TYPES.ISnapper) @optional() readonly snapper?: ISnapper;
|
|
42
42
|
@inject(TYPES.IActionDispatcher) readonly actionDispatcher: GLSPActionDispatcher;
|
|
43
43
|
@inject(TYPES.Grid) @optional() protected grid: Grid;
|
|
44
|
-
@inject(
|
|
44
|
+
@inject(ChangeBoundsManager) readonly changeBoundsManager: ChangeBoundsManager;
|
|
45
45
|
|
|
46
46
|
get id(): string {
|
|
47
47
|
return MovementKeyTool.ID;
|
|
@@ -24,9 +24,9 @@ import {
|
|
|
24
24
|
isLayoutContainer
|
|
25
25
|
} from '@eclipse-glsp/sprotty';
|
|
26
26
|
import { inject, injectable } from 'inversify';
|
|
27
|
-
import { Ranked } from '../../base';
|
|
28
27
|
import { GLSPActionDispatcher } from '../../base/action-dispatcher';
|
|
29
28
|
import { FeedbackCommand } from '../../base/feedback/feedback-command';
|
|
29
|
+
import { Ranked } from '../../base/ranked';
|
|
30
30
|
import { LocalRequestBoundsAction } from './local-bounds';
|
|
31
31
|
|
|
32
32
|
export interface SetBoundsFeedbackAction extends Omit<SetBoundsAction, 'kind'> {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2019-
|
|
2
|
+
* Copyright (c) 2019-2024 EclipseSource and others.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made available under the
|
|
5
5
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
import {
|
|
17
17
|
Bounds,
|
|
18
|
+
Direction,
|
|
18
19
|
GChildElement,
|
|
19
20
|
GModelElement,
|
|
20
21
|
GParentElement,
|
|
@@ -25,8 +26,8 @@ import {
|
|
|
25
26
|
isMoveable,
|
|
26
27
|
isSelectable
|
|
27
28
|
} from '@eclipse-glsp/sprotty';
|
|
28
|
-
import { CursorCSS } from '../../base';
|
|
29
|
-
import { BoundsAwareModelElement, MoveableElement, ResizableModelElement } from '../../utils';
|
|
29
|
+
import { CursorCSS } from '../../base/feedback/css-feedback';
|
|
30
|
+
import { BoundsAwareModelElement, MoveableElement, ResizableModelElement } from '../../utils/gmodel-util';
|
|
30
31
|
|
|
31
32
|
export const resizeFeature = Symbol('resizeFeature');
|
|
32
33
|
|
|
@@ -47,6 +48,20 @@ export enum ResizeHandleLocation {
|
|
|
47
48
|
}
|
|
48
49
|
|
|
49
50
|
export namespace ResizeHandleLocation {
|
|
51
|
+
export const CORNERS: ResizeHandleLocation[] = [
|
|
52
|
+
ResizeHandleLocation.TopLeft,
|
|
53
|
+
ResizeHandleLocation.TopRight,
|
|
54
|
+
ResizeHandleLocation.BottomRight,
|
|
55
|
+
ResizeHandleLocation.BottomLeft
|
|
56
|
+
];
|
|
57
|
+
export const CROSS: ResizeHandleLocation[] = [
|
|
58
|
+
ResizeHandleLocation.Top,
|
|
59
|
+
ResizeHandleLocation.Right,
|
|
60
|
+
ResizeHandleLocation.Bottom,
|
|
61
|
+
ResizeHandleLocation.Left
|
|
62
|
+
];
|
|
63
|
+
export const ALL = Object.values(ResizeHandleLocation).filter(value => typeof value !== 'function') as ResizeHandleLocation[];
|
|
64
|
+
|
|
50
65
|
export function opposite(location: ResizeHandleLocation): ResizeHandleLocation {
|
|
51
66
|
switch (location) {
|
|
52
67
|
case ResizeHandleLocation.TopLeft:
|
|
@@ -67,6 +82,27 @@ export namespace ResizeHandleLocation {
|
|
|
67
82
|
return ResizeHandleLocation.Right;
|
|
68
83
|
}
|
|
69
84
|
}
|
|
85
|
+
|
|
86
|
+
export function direction(location: ResizeHandleLocation): Direction[] {
|
|
87
|
+
switch (location) {
|
|
88
|
+
case ResizeHandleLocation.TopLeft:
|
|
89
|
+
return [Direction.Up, Direction.Left];
|
|
90
|
+
case ResizeHandleLocation.Top:
|
|
91
|
+
return [Direction.Up];
|
|
92
|
+
case ResizeHandleLocation.TopRight:
|
|
93
|
+
return [Direction.Up, Direction.Right];
|
|
94
|
+
case ResizeHandleLocation.Right:
|
|
95
|
+
return [Direction.Right];
|
|
96
|
+
case ResizeHandleLocation.BottomRight:
|
|
97
|
+
return [Direction.Down, Direction.Right];
|
|
98
|
+
case ResizeHandleLocation.Bottom:
|
|
99
|
+
return [Direction.Down];
|
|
100
|
+
case ResizeHandleLocation.BottomLeft:
|
|
101
|
+
return [Direction.Down, Direction.Left];
|
|
102
|
+
case ResizeHandleLocation.Left:
|
|
103
|
+
return [Direction.Left];
|
|
104
|
+
}
|
|
105
|
+
}
|
|
70
106
|
}
|
|
71
107
|
|
|
72
108
|
export function isBoundsAwareMoveable(element: GModelElement): element is BoundsAwareModelElement & MoveableElement {
|
|
@@ -182,19 +218,8 @@ export class SResizeHandle extends GChildElement implements Hoverable {
|
|
|
182
218
|
}
|
|
183
219
|
}
|
|
184
220
|
|
|
185
|
-
export function addResizeHandles(
|
|
186
|
-
|
|
187
|
-
locations: ResizeHandleLocation[] = [
|
|
188
|
-
ResizeHandleLocation.TopLeft,
|
|
189
|
-
ResizeHandleLocation.Top,
|
|
190
|
-
ResizeHandleLocation.BottomLeft,
|
|
191
|
-
ResizeHandleLocation.BottomRight
|
|
192
|
-
]
|
|
193
|
-
): void {
|
|
194
|
-
for (const location of Object.values(ResizeHandleLocation)) {
|
|
195
|
-
if (typeof location === 'function') {
|
|
196
|
-
continue;
|
|
197
|
-
}
|
|
221
|
+
export function addResizeHandles(element: ResizableModelElement, locations: ResizeHandleLocation[] = ResizeHandleLocation.CORNERS): void {
|
|
222
|
+
for (const location of ResizeHandleLocation.ALL) {
|
|
198
223
|
const existing = element.children.find(child => child instanceof SResizeHandle && child.location === location);
|
|
199
224
|
if (locations.includes(location) && !existing) {
|
|
200
225
|
// add missing handle
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2019-
|
|
2
|
+
* Copyright (c) 2019-2024 EclipseSource and others.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made available under the
|
|
5
5
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -13,12 +13,12 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
import { Bounds, GModelElement, GNode, GParentElement, Point } from '@eclipse-glsp/sprotty';
|
|
16
|
+
import { Bounds, Dimension, GModelElement, GNode, GParentElement, Point, isBoundsAware, isMoveable } from '@eclipse-glsp/sprotty';
|
|
17
17
|
import { injectable } from 'inversify';
|
|
18
18
|
import { ModifyCSSFeedbackAction } from '../../base/feedback/css-feedback';
|
|
19
|
-
import { BoundsAwareModelElement } from '../../utils';
|
|
19
|
+
import { BoundsAwareModelElement } from '../../utils/gmodel-util';
|
|
20
20
|
import { toAbsoluteBounds } from '../../utils/viewpoint-util';
|
|
21
|
-
import { SResizeHandle
|
|
21
|
+
import { SResizeHandle } from './model';
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
* A `MovementRestrictor` is an optional service that can be used by tools to validate
|
|
@@ -48,27 +48,27 @@ export class NoOverlapMovementRestrictor implements IMovementRestrictor {
|
|
|
48
48
|
cssClasses = ['movement-not-allowed'];
|
|
49
49
|
|
|
50
50
|
validate(element: GModelElement, newLocation?: Point): boolean {
|
|
51
|
-
if (!
|
|
51
|
+
if (!isMoveable(element) || !newLocation) {
|
|
52
52
|
return false;
|
|
53
53
|
}
|
|
54
54
|
// Create ghost element at the newLocation
|
|
55
|
+
const dimensions: Dimension = isBoundsAware(element) ? element.bounds : { width: 1, height: 1 };
|
|
55
56
|
const ghostElement = Object.create(element) as BoundsAwareModelElement;
|
|
56
|
-
ghostElement.bounds = {
|
|
57
|
-
x: newLocation.x,
|
|
58
|
-
y: newLocation.y,
|
|
59
|
-
width: element.bounds.width,
|
|
60
|
-
height: element.bounds.height
|
|
61
|
-
};
|
|
57
|
+
ghostElement.bounds = { ...dimensions, ...newLocation };
|
|
62
58
|
ghostElement.type = 'Ghost';
|
|
63
59
|
ghostElement.id = element.id;
|
|
64
60
|
return !Array.from(
|
|
65
61
|
element.root.index
|
|
66
62
|
.all()
|
|
67
|
-
.filter(
|
|
68
|
-
.map(
|
|
63
|
+
.filter(node => node.id !== ghostElement.id && node !== ghostElement.root && node instanceof GNode)
|
|
64
|
+
.map(node => node as BoundsAwareModelElement)
|
|
69
65
|
).some(e => this.areOverlapping(e, ghostElement));
|
|
70
66
|
}
|
|
71
67
|
|
|
68
|
+
protected isBoundsRelevant(element: GModelElement, ghostElement: BoundsAwareModelElement): element is BoundsAwareModelElement {
|
|
69
|
+
return element.id !== ghostElement.id && element !== ghostElement.root && element instanceof GNode && isBoundsAware(element);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
72
|
protected areOverlapping(element1: BoundsAwareModelElement, element2: BoundsAwareModelElement): boolean {
|
|
73
73
|
return Bounds.overlap(toAbsoluteBounds(element1), toAbsoluteBounds(element2));
|
|
74
74
|
}
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
import { GModelElement } from '@eclipse-glsp/sprotty';
|
|
20
20
|
import { expect } from 'chai';
|
|
21
|
-
import { GridSnapper } from '
|
|
21
|
+
import { GridSnapper } from './../grid/grid-snapper';
|
|
22
22
|
import { PointPositionUpdater } from './point-position-updater';
|
|
23
23
|
|
|
24
24
|
describe('PointPositionUpdater', () => {
|
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
/* eslint-disable max-len */
|
|
17
17
|
|
|
18
|
-
import { Bounds, GModelElement, IVNodePostprocessor, Point,
|
|
18
|
+
import { Bounds, GModelElement, IVNodePostprocessor, Point, isDecoration, isSizeable, setClass, svg } from '@eclipse-glsp/sprotty';
|
|
19
19
|
import { inject, injectable, optional } from 'inversify';
|
|
20
20
|
import { VNode } from 'snabbdom';
|
|
21
21
|
import { GGraph } from '../../model';
|
|
22
|
-
import { BoundsAwareModelElement } from '../../utils';
|
|
22
|
+
import { BoundsAwareModelElement } from '../../utils/gmodel-util';
|
|
23
23
|
import { DebugManager } from './debug-manager';
|
|
24
24
|
|
|
25
25
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -29,7 +29,7 @@ export const CSS_DEBUG_BOUNDS = 'debug-bounds';
|
|
|
29
29
|
|
|
30
30
|
@injectable()
|
|
31
31
|
export class DebugBoundsDecorator implements IVNodePostprocessor {
|
|
32
|
-
@inject(
|
|
32
|
+
@inject(DebugManager) @optional() protected debugManager?: DebugManager;
|
|
33
33
|
|
|
34
34
|
decorate(vnode: VNode, element: GModelElement): VNode {
|
|
35
35
|
if (!this.debugManager?.isDebugEnabled) {
|
|
@@ -87,7 +87,7 @@ export class DebugBoundsDecorator implements IVNodePostprocessor {
|
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
protected renderTopLeftCorner(element: BoundsAwareModelElement): VNode {
|
|
90
|
-
const position = Bounds.
|
|
90
|
+
const position = Bounds.position(element.bounds);
|
|
91
91
|
const topLeft = Bounds.topLeft(element.bounds);
|
|
92
92
|
const corner = Point.subtract(topLeft, position);
|
|
93
93
|
return (
|
|
@@ -104,7 +104,7 @@ export class DebugBoundsDecorator implements IVNodePostprocessor {
|
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
protected renderTopRightCorner(element: BoundsAwareModelElement): VNode {
|
|
107
|
-
const position = Bounds.
|
|
107
|
+
const position = Bounds.position(element.bounds);
|
|
108
108
|
const topRight = Bounds.topRight(element.bounds);
|
|
109
109
|
const corner = Point.subtract(topRight, position);
|
|
110
110
|
return (
|
|
@@ -121,7 +121,7 @@ export class DebugBoundsDecorator implements IVNodePostprocessor {
|
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
protected renderBottomLeftCorner(element: BoundsAwareModelElement): VNode {
|
|
124
|
-
const position = Bounds.
|
|
124
|
+
const position = Bounds.position(element.bounds);
|
|
125
125
|
const bottomLeft = Bounds.bottomLeft(element.bounds);
|
|
126
126
|
const corner = Point.subtract(bottomLeft, position);
|
|
127
127
|
return (
|
|
@@ -138,7 +138,7 @@ export class DebugBoundsDecorator implements IVNodePostprocessor {
|
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
protected renderBottomRightCorner(element: BoundsAwareModelElement): VNode {
|
|
141
|
-
const position = Bounds.
|
|
141
|
+
const position = Bounds.position(element.bounds);
|
|
142
142
|
const bottomRight = Bounds.bottomRight(element.bounds);
|
|
143
143
|
const corner = Point.subtract(bottomRight, position);
|
|
144
144
|
return (
|
|
@@ -156,7 +156,7 @@ export class DebugBoundsDecorator implements IVNodePostprocessor {
|
|
|
156
156
|
|
|
157
157
|
protected renderCenter(element: BoundsAwareModelElement): VNode {
|
|
158
158
|
const bounds = element.bounds;
|
|
159
|
-
const position = Bounds.
|
|
159
|
+
const position = Bounds.position(bounds);
|
|
160
160
|
const center = Bounds.center(bounds);
|
|
161
161
|
const corner = Point.subtract(center, position);
|
|
162
162
|
return (
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
|
|
17
17
|
import { IActionHandler, TYPES } from '@eclipse-glsp/sprotty';
|
|
18
18
|
import { inject, injectable, postConstruct } from 'inversify';
|
|
19
|
-
import {
|
|
19
|
+
import { IFeedbackActionDispatcher } from '../../base/feedback/feedback-action-dispatcher';
|
|
20
|
+
import { FeedbackEmitter } from '../../base/feedback/feedback-emitter';
|
|
20
21
|
import { EnableDebugModeAction } from './debug-model';
|
|
21
22
|
|
|
22
23
|
@injectable()
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
|
|
17
17
|
import { Action, CommandExecutionContext, CommandReturn, GModelRoot, TYPES, hasBooleanProp } from '@eclipse-glsp/sprotty';
|
|
18
18
|
import { inject, injectable } from 'inversify';
|
|
19
|
-
import { FeedbackCommand } from '../../base';
|
|
20
|
-
import { addCssClasses, removeCssClasses } from '../../utils';
|
|
19
|
+
import { FeedbackCommand } from '../../base/feedback/feedback-command';
|
|
20
|
+
import { addCssClasses, removeCssClasses } from '../../utils/gmodel-util';
|
|
21
21
|
|
|
22
22
|
export interface EnableDebugModeAction extends Action {
|
|
23
23
|
kind: typeof EnableDebugModeAction.KIND;
|
|
@@ -25,7 +25,7 @@ export const debugModule = new FeatureModule((bind, unbind, isBound, rebind) =>
|
|
|
25
25
|
|
|
26
26
|
configureCommand(context, EnableDebugModeCommand);
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
bind(DebugManager).toSelf().inSingletonScope();
|
|
29
29
|
configureActionHandler(context, EnableDebugModeAction.KIND, DebugManager);
|
|
30
30
|
|
|
31
31
|
bindAsService(context, TYPES.IVNodePostprocessor, DebugBoundsDecorator);
|