@eclipse-glsp/client 2.2.0-next.328 → 2.2.0-next.330
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/change-bounds.css +15 -0
- package/css/glsp-sprotty.css +17 -0
- package/lib/base/action-dispatcher.js.map +1 -1
- package/lib/base/action-handler-registry.js.map +1 -1
- package/lib/base/args-feature.js.map +1 -1
- package/lib/base/auto-complete/auto-complete-widget.js.map +1 -1
- package/lib/base/auto-complete/validation-decorator.js.map +1 -1
- package/lib/base/command-stack.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 +11 -0
- package/lib/base/drag-aware-mouse-listener.js.map +1 -1
- package/lib/base/editor-context-service.js.map +1 -1
- package/lib/base/feedback/css-feedback.d.ts +4 -0
- package/lib/base/feedback/css-feedback.d.ts.map +1 -1
- package/lib/base/feedback/css-feedback.js +4 -0
- package/lib/base/feedback/css-feedback.js.map +1 -1
- package/lib/base/feedback/feeback-emitter.d.ts +67 -0
- package/lib/base/feedback/feeback-emitter.d.ts.map +1 -0
- package/lib/base/feedback/feeback-emitter.js +109 -0
- package/lib/base/feedback/feeback-emitter.js.map +1 -0
- package/lib/base/feedback/feedback-action-dispatcher.d.ts +17 -5
- package/lib/base/feedback/feedback-action-dispatcher.d.ts.map +1 -1
- package/lib/base/feedback/feedback-action-dispatcher.js +23 -3
- package/lib/base/feedback/feedback-action-dispatcher.js.map +1 -1
- package/lib/base/feedback/index.d.ts +1 -0
- package/lib/base/feedback/index.d.ts.map +1 -1
- package/lib/base/feedback/index.js +1 -0
- package/lib/base/feedback/index.js.map +1 -1
- package/lib/base/focus/focus-tracker.js.map +1 -1
- package/lib/base/model/diagram-loader.js.map +1 -1
- package/lib/base/model/glsp-model-source.js.map +1 -1
- package/lib/base/model/model-initialization-constraint.js.map +1 -1
- package/lib/base/model/model-registry.js.map +1 -1
- package/lib/base/selection-clearing-mouse-listener.js.map +1 -1
- package/lib/base/selection-service.d.ts +3 -2
- package/lib/base/selection-service.d.ts.map +1 -1
- package/lib/base/selection-service.js.map +1 -1
- package/lib/base/tool-manager/index.d.ts +2 -2
- package/lib/base/tool-manager/index.d.ts.map +1 -1
- package/lib/base/tool-manager/index.js +2 -2
- package/lib/base/tool-manager/index.js.map +1 -1
- package/lib/base/tool-manager/tool-manager.js.map +1 -1
- package/lib/base/view/mouse-tool.js.map +1 -1
- package/lib/base/view/view-registry.js.map +1 -1
- package/lib/default-modules.d.ts +1 -1
- package/lib/default-modules.js +1 -1
- package/lib/default-modules.js.map +1 -1
- package/lib/features/accessibility/edge-autocomplete/edge-autocomplete-palette.js.map +1 -1
- package/lib/features/accessibility/edge-autocomplete/edge-autocomplete-tool.js.map +1 -1
- package/lib/features/accessibility/element-navigation/diagram-navigation-tool.js.map +1 -1
- package/lib/features/accessibility/element-navigation/left-right-top-bottom-navigator.js.map +1 -1
- package/lib/features/accessibility/element-navigation/local-element-navigator.d.ts +3 -3
- package/lib/features/accessibility/element-navigation/local-element-navigator.d.ts.map +1 -1
- package/lib/features/accessibility/element-navigation/local-element-navigator.js.map +1 -1
- package/lib/features/accessibility/element-navigation/position-navigator.js.map +1 -1
- package/lib/features/accessibility/focus-tracker/focus-tracker-tool.js.map +1 -1
- package/lib/features/accessibility/global-keylistener-tool.js.map +1 -1
- package/lib/features/accessibility/key-shortcut/accessible-key-shortcut-tool.js.map +1 -1
- package/lib/features/accessibility/key-shortcut/accessible-key-shortcut.js.map +1 -1
- package/lib/features/accessibility/key-shortcut/index.d.ts +2 -2
- package/lib/features/accessibility/key-shortcut/index.d.ts.map +1 -1
- package/lib/features/accessibility/key-shortcut/index.js +2 -2
- package/lib/features/accessibility/key-shortcut/index.js.map +1 -1
- package/lib/features/accessibility/keyboard-grid/index.d.ts +2 -2
- package/lib/features/accessibility/keyboard-grid/index.d.ts.map +1 -1
- package/lib/features/accessibility/keyboard-grid/index.js +2 -2
- package/lib/features/accessibility/keyboard-grid/index.js.map +1 -1
- package/lib/features/accessibility/keyboard-grid/keyboard-grid.js.map +1 -1
- package/lib/features/accessibility/keyboard-grid/keyboard-node-grid.js.map +1 -1
- package/lib/features/accessibility/keyboard-pointer/index.d.ts +2 -2
- package/lib/features/accessibility/keyboard-pointer/index.d.ts.map +1 -1
- package/lib/features/accessibility/keyboard-pointer/index.js +2 -2
- package/lib/features/accessibility/keyboard-pointer/index.js.map +1 -1
- package/lib/features/accessibility/keyboard-pointer/keyboard-pointer-listener.d.ts +1 -1
- package/lib/features/accessibility/keyboard-pointer/keyboard-pointer-listener.d.ts.map +1 -1
- package/lib/features/accessibility/keyboard-pointer/keyboard-pointer-listener.js +1 -1
- package/lib/features/accessibility/keyboard-pointer/keyboard-pointer-listener.js.map +1 -1
- package/lib/features/accessibility/keyboard-pointer/keyboard-pointer.js.map +1 -1
- package/lib/features/accessibility/keyboard-tool-palette/index.d.ts +2 -2
- package/lib/features/accessibility/keyboard-tool-palette/index.d.ts.map +1 -1
- package/lib/features/accessibility/keyboard-tool-palette/index.js +2 -2
- package/lib/features/accessibility/keyboard-tool-palette/index.js.map +1 -1
- package/lib/features/accessibility/keyboard-tool-palette/keyboard-tool-palette.js.map +1 -1
- package/lib/features/accessibility/move-zoom/move-handler.d.ts +4 -2
- package/lib/features/accessibility/move-zoom/move-handler.d.ts.map +1 -1
- package/lib/features/accessibility/move-zoom/move-handler.js +10 -4
- package/lib/features/accessibility/move-zoom/move-handler.js.map +1 -1
- package/lib/features/accessibility/move-zoom/zoom-handler.js.map +1 -1
- package/lib/features/accessibility/resize-key-tool/resize-key-handler.d.ts +4 -2
- 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 +11 -3
- package/lib/features/accessibility/resize-key-tool/resize-key-handler.js.map +1 -1
- package/lib/features/accessibility/resize-key-tool/resize-key-tool.js.map +1 -1
- package/lib/features/accessibility/search/index.d.ts +2 -2
- package/lib/features/accessibility/search/index.d.ts.map +1 -1
- package/lib/features/accessibility/search/index.js +2 -2
- package/lib/features/accessibility/search/index.js.map +1 -1
- package/lib/features/accessibility/search/search-palette.js.map +1 -1
- package/lib/features/accessibility/search/search-tool.js.map +1 -1
- package/lib/features/accessibility/toast/toast-tool.js.map +1 -1
- package/lib/features/accessibility/view-key-tools/deselect-key-tool.js.map +1 -1
- package/lib/features/accessibility/view-key-tools/movement-key-tool.js.map +1 -1
- package/lib/features/accessibility/view-key-tools/zoom-key-tool.js.map +1 -1
- package/lib/features/bounds/freeform-layout.js.map +1 -1
- package/lib/features/bounds/glsp-hidden-bounds-updater.js.map +1 -1
- package/lib/features/bounds/hbox-layout.js.map +1 -1
- package/lib/features/bounds/layouter.js.map +1 -1
- package/lib/features/bounds/local-bounds.js.map +1 -1
- package/lib/features/bounds/set-bounds-feedback-command.js.map +1 -1
- package/lib/features/bounds/vbox-layout.js.map +1 -1
- package/lib/features/change-bounds/model.d.ts +8 -8
- package/lib/features/change-bounds/model.d.ts.map +1 -1
- package/lib/features/change-bounds/model.js +17 -5
- 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.map +1 -1
- package/lib/features/change-bounds/point-position-updater.js.map +1 -1
- package/lib/features/change-bounds/position-snapper.js.map +1 -1
- package/lib/features/command-palette/command-palette-module.d.ts +1 -1
- package/lib/features/command-palette/command-palette-module.js +1 -1
- package/lib/features/command-palette/command-palette.js.map +1 -1
- package/lib/features/command-palette/index.d.ts +1 -1
- package/lib/features/command-palette/index.js +1 -1
- package/lib/features/command-palette/server-command-palette-provider.js.map +1 -1
- package/lib/features/context-menu/context-menu-module.js.map +1 -1
- package/lib/features/context-menu/glsp-context-menu-mouse-listener.js.map +1 -1
- package/lib/features/context-menu/server-context-menu-provider.js.map +1 -1
- package/lib/features/copy-paste/copy-paste-context-menu.js.map +1 -1
- package/lib/features/copy-paste/copy-paste-handler.js.map +1 -1
- package/lib/features/copy-paste/copy-paste-standalone.js.map +1 -1
- package/lib/features/decoration/decoration-placer.js.map +1 -1
- package/lib/features/element-template/add-template-element.js.map +1 -1
- package/lib/features/element-template/mouse-tracking-element-position-listener.d.ts +15 -5
- 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 +27 -38
- package/lib/features/element-template/mouse-tracking-element-position-listener.js.map +1 -1
- package/lib/features/element-template/remove-template-element.js.map +1 -1
- package/lib/features/export/glsp-svg-exporter.js.map +1 -1
- package/lib/features/helper-lines/helper-line-feedback.js.map +1 -1
- package/lib/features/helper-lines/helper-line-manager-default.d.ts +4 -2
- package/lib/features/helper-lines/helper-line-manager-default.d.ts.map +1 -1
- package/lib/features/helper-lines/helper-line-manager-default.js +8 -12
- package/lib/features/helper-lines/helper-line-manager-default.js.map +1 -1
- package/lib/features/helper-lines/index.d.ts +2 -2
- package/lib/features/helper-lines/index.d.ts.map +1 -1
- package/lib/features/helper-lines/index.js +2 -2
- package/lib/features/helper-lines/index.js.map +1 -1
- package/lib/features/helper-lines/model.js.map +1 -1
- package/lib/features/helper-lines/view.js.map +1 -1
- package/lib/features/hints/type-hint-provider.d.ts +3 -0
- package/lib/features/hints/type-hint-provider.d.ts.map +1 -1
- package/lib/features/hints/type-hint-provider.js +10 -1
- package/lib/features/hints/type-hint-provider.js.map +1 -1
- package/lib/features/hover/hover.js.map +1 -1
- package/lib/features/hover/index.d.ts +2 -2
- package/lib/features/hover/index.d.ts.map +1 -1
- package/lib/features/hover/index.js +2 -2
- package/lib/features/hover/index.js.map +1 -1
- package/lib/features/index.d.ts +2 -1
- package/lib/features/index.d.ts.map +1 -1
- package/lib/features/index.js +2 -1
- package/lib/features/index.js.map +1 -1
- package/lib/features/label-edit/edit-label-validator.js.map +1 -1
- package/lib/features/label-edit-ui/label-edit-ui.js.map +1 -1
- package/lib/features/layout/layout-elements-action.js.map +1 -1
- package/lib/features/navigation/navigation-action-handler.js.map +1 -1
- package/lib/features/navigation/navigation-target-resolver.js.map +1 -1
- package/lib/features/reconnect/model.js.map +1 -1
- package/lib/features/routing/glsp-manhattan-edge-router.js.map +1 -1
- package/lib/features/save/save-keylistener.js.map +1 -1
- package/lib/features/select/select-mouse-listener.d.ts +4 -3
- package/lib/features/select/select-mouse-listener.d.ts.map +1 -1
- package/lib/features/select/select-mouse-listener.js.map +1 -1
- package/lib/features/source-model-watcher/source-model-changed-action-handler.js.map +1 -1
- package/lib/features/status/status-overlay.js.map +1 -1
- package/lib/features/svg-metadata/metadata-placer.js.map +1 -1
- package/lib/features/tool-palette/index.d.ts +2 -2
- package/lib/features/tool-palette/index.d.ts.map +1 -1
- package/lib/features/tool-palette/index.js +2 -2
- package/lib/features/tool-palette/index.js.map +1 -1
- package/lib/features/tool-palette/tool-palette.js.map +1 -1
- package/lib/features/tools/base-tools.d.ts +23 -4
- package/lib/features/tools/base-tools.d.ts.map +1 -1
- package/lib/features/tools/base-tools.js +11 -6
- package/lib/features/tools/base-tools.js.map +1 -1
- package/lib/features/tools/change-bounds/change-bounds-tool-feedback.d.ts +1 -35
- 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 +5 -206
- 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 -0
- package/lib/features/tools/change-bounds/change-bounds-tool-module.d.ts.map +1 -1
- package/lib/features/tools/change-bounds/change-bounds-tool-module.js +1 -0
- 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 +67 -0
- package/lib/features/tools/change-bounds/change-bounds-tool-move-feedback.d.ts.map +1 -0
- package/lib/features/tools/change-bounds/change-bounds-tool-move-feedback.js +227 -0
- package/lib/features/tools/change-bounds/change-bounds-tool-move-feedback.js.map +1 -0
- package/lib/features/tools/change-bounds/change-bounds-tool.d.ts +34 -24
- package/lib/features/tools/change-bounds/change-bounds-tool.d.ts.map +1 -1
- package/lib/features/tools/change-bounds/change-bounds-tool.js +172 -180
- package/lib/features/tools/change-bounds/change-bounds-tool.js.map +1 -1
- package/lib/features/tools/change-bounds/index.d.ts +3 -2
- package/lib/features/tools/change-bounds/index.d.ts.map +1 -1
- package/lib/features/tools/change-bounds/index.js +3 -2
- package/lib/features/tools/change-bounds/index.js.map +1 -1
- package/lib/features/tools/change-bounds/view.d.ts +1 -1
- package/lib/features/tools/change-bounds/view.d.ts.map +1 -1
- package/lib/features/tools/change-bounds/view.js +3 -0
- package/lib/features/tools/change-bounds/view.js.map +1 -1
- package/lib/features/tools/deletion/delete-tool.d.ts +16 -1
- package/lib/features/tools/deletion/delete-tool.d.ts.map +1 -1
- package/lib/features/tools/deletion/delete-tool.js +5 -2
- package/lib/features/tools/deletion/delete-tool.js.map +1 -1
- package/lib/features/tools/edge-creation/dangling-edge-feedback.d.ts +17 -1
- package/lib/features/tools/edge-creation/dangling-edge-feedback.d.ts.map +1 -1
- package/lib/features/tools/edge-creation/dangling-edge-feedback.js +3 -1
- 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 +4 -2
- package/lib/features/tools/edge-creation/edge-creation-tool-feedback.d.ts.map +1 -1
- package/lib/features/tools/edge-creation/edge-creation-tool-feedback.js +5 -8
- package/lib/features/tools/edge-creation/edge-creation-tool-feedback.js.map +1 -1
- package/lib/features/tools/edge-creation/edge-creation-tool.d.ts +20 -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 +23 -18
- package/lib/features/tools/edge-creation/edge-creation-tool.js.map +1 -1
- package/lib/features/tools/edge-creation/index.d.ts +2 -2
- package/lib/features/tools/edge-creation/index.d.ts.map +1 -1
- package/lib/features/tools/edge-creation/index.js +2 -2
- package/lib/features/tools/edge-creation/index.js.map +1 -1
- package/lib/features/tools/edge-edit/edge-edit-tool-feedback.d.ts +3 -1
- 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 +5 -8
- 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 +4 -4
- package/lib/features/tools/edge-edit/edge-edit-tool.d.ts.map +1 -1
- package/lib/features/tools/edge-edit/edge-edit-tool.js +27 -44
- package/lib/features/tools/edge-edit/edge-edit-tool.js.map +1 -1
- package/lib/features/tools/edge-edit/index.d.ts +2 -2
- package/lib/features/tools/edge-edit/index.d.ts.map +1 -1
- package/lib/features/tools/edge-edit/index.js +2 -2
- package/lib/features/tools/edge-edit/index.js.map +1 -1
- package/lib/features/tools/marquee-selection/index.d.ts +2 -2
- package/lib/features/tools/marquee-selection/index.d.ts.map +1 -1
- package/lib/features/tools/marquee-selection/index.js +2 -2
- package/lib/features/tools/marquee-selection/index.js.map +1 -1
- package/lib/features/tools/marquee-selection/marquee-behavior.js.map +1 -1
- package/lib/features/tools/marquee-selection/marquee-mouse-tool.d.ts +3 -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 +4 -2
- package/lib/features/tools/marquee-selection/marquee-mouse-tool.js.map +1 -1
- package/lib/features/tools/marquee-selection/marquee-tool-feedback.js.map +1 -1
- package/lib/features/tools/marquee-selection/marquee-tool.js.map +1 -1
- package/lib/features/tools/node-creation/node-creation-tool.d.ts +14 -5
- package/lib/features/tools/node-creation/node-creation-tool.d.ts.map +1 -1
- package/lib/features/tools/node-creation/node-creation-tool.js +58 -24
- package/lib/features/tools/node-creation/node-creation-tool.js.map +1 -1
- package/lib/features/tools/tool-focus-loss-module.js.map +1 -1
- package/lib/features/undo-redo/undo-redo-key-listener.js.map +1 -1
- package/lib/features/validation/issue-marker.js.map +1 -1
- package/lib/features/validation/marker-navigator.d.ts +7 -6
- package/lib/features/validation/marker-navigator.d.ts.map +1 -1
- package/lib/features/validation/marker-navigator.js.map +1 -1
- package/lib/features/validation/validate.d.ts +2 -5
- package/lib/features/validation/validate.d.ts.map +1 -1
- package/lib/features/validation/validate.js +4 -16
- package/lib/features/validation/validate.js.map +1 -1
- package/lib/features/viewport/glsp-scroll-mouse-listener.js.map +1 -1
- package/lib/features/viewport/reposition.js.map +1 -1
- package/lib/features/viewport/viewport-handler.js.map +1 -1
- package/lib/model.js.map +1 -1
- package/lib/standalone-modules.js.map +1 -1
- package/lib/utils/argument-utils.js.map +1 -1
- package/lib/utils/geometry-util.d.ts +1 -1
- package/lib/utils/geometry-util.d.ts.map +1 -1
- package/lib/utils/gmodel-util.d.ts +27 -2
- package/lib/utils/gmodel-util.d.ts.map +1 -1
- package/lib/utils/gmodel-util.js +30 -1
- package/lib/utils/gmodel-util.js.map +1 -1
- package/lib/utils/html-utils.js.map +1 -1
- package/lib/utils/layout-utils.d.ts +8 -7
- package/lib/utils/layout-utils.d.ts.map +1 -1
- package/lib/utils/layout-utils.js +2 -4
- package/lib/utils/layout-utils.js.map +1 -1
- package/lib/utils/marker.js.map +1 -1
- package/lib/utils/viewpoint-util.d.ts +4 -4
- package/lib/utils/viewpoint-util.d.ts.map +1 -1
- package/lib/utils/viewpoint-util.js.map +1 -1
- package/lib/views/compartments.js.map +1 -1
- package/lib/views/gedge-view.js.map +1 -1
- package/lib/views/glsp-projection-view.js.map +1 -1
- package/lib/views/index.d.ts +2 -2
- package/lib/views/index.d.ts.map +1 -1
- package/lib/views/index.js +2 -2
- package/lib/views/index.js.map +1 -1
- package/lib/views/issue-marker-view.js.map +1 -1
- package/lib/views/rounded-corner-view.js.map +1 -1
- package/lib/views/rounded-corner.d.ts +1 -1
- package/lib/views/rounded-corner.d.ts.map +1 -1
- package/lib/views/rounded-corner.js.map +1 -1
- package/package.json +3 -3
- package/src/base/drag-aware-mouse-listener.ts +16 -2
- package/src/base/feedback/css-feedback.ts +4 -0
- package/src/base/feedback/feeback-emitter.ts +112 -0
- package/src/base/feedback/feedback-action-dispatcher.ts +41 -6
- package/src/base/feedback/index.ts +1 -0
- package/src/base/selection-service.spec.ts +5 -0
- package/src/base/selection-service.ts +2 -3
- package/src/features/accessibility/element-navigation/local-element-navigator.ts +4 -4
- package/src/features/accessibility/move-zoom/move-handler.ts +11 -6
- package/src/features/accessibility/resize-key-tool/resize-key-handler.ts +11 -7
- package/src/features/change-bounds/model.ts +25 -13
- package/src/features/change-bounds/movement-restrictor.ts +6 -22
- package/src/features/element-template/mouse-tracking-element-position-listener.ts +55 -45
- package/src/features/helper-lines/helper-line-feedback.ts +50 -57
- package/src/features/helper-lines/helper-line-manager-default.ts +12 -21
- package/src/features/helper-lines/model.ts +6 -25
- package/src/features/hints/type-hint-provider.spec.ts +4 -1
- package/src/features/hints/type-hint-provider.ts +9 -2
- package/src/features/layout/layout-elements-action.ts +10 -7
- package/src/features/select/select-mouse-listener.ts +4 -3
- package/src/features/tools/base-tools.ts +15 -8
- package/src/features/tools/change-bounds/change-bounds-tool-feedback.ts +6 -232
- package/src/features/tools/change-bounds/change-bounds-tool-module.ts +1 -0
- package/src/features/tools/change-bounds/change-bounds-tool-move-feedback.ts +254 -0
- package/src/features/tools/change-bounds/change-bounds-tool.ts +217 -226
- package/src/features/tools/change-bounds/index.ts +1 -0
- package/src/features/tools/change-bounds/view.tsx +4 -1
- package/src/features/tools/deletion/delete-tool.ts +6 -6
- package/src/features/tools/edge-creation/dangling-edge-feedback.ts +7 -4
- package/src/features/tools/edge-creation/edge-creation-tool-feedback.ts +9 -9
- package/src/features/tools/edge-creation/edge-creation-tool.ts +33 -23
- package/src/features/tools/edge-edit/edge-edit-tool-feedback.ts +8 -8
- package/src/features/tools/edge-edit/edge-edit-tool.ts +42 -49
- package/src/features/tools/marquee-selection/marquee-mouse-tool.ts +7 -6
- package/src/features/tools/node-creation/node-creation-tool.ts +69 -25
- package/src/features/validation/marker-navigator.ts +6 -8
- package/src/features/validation/validate.ts +5 -20
- package/src/features/viewport/reposition.ts +11 -14
- package/src/utils/geometry-util.ts +45 -64
- package/src/utils/gmodel-util.ts +45 -2
- package/src/utils/layout-utils.ts +9 -20
- package/src/utils/viewpoint-util.ts +13 -25
- package/lib/base/action-dispatcher.spec.d.ts +0 -2
- package/lib/base/action-dispatcher.spec.d.ts.map +0 -1
- package/lib/base/action-dispatcher.spec.js +0 -78
- package/lib/base/action-dispatcher.spec.js.map +0 -1
- package/lib/base/model/model-initialization-constraint.spec.d.ts +0 -2
- package/lib/base/model/model-initialization-constraint.spec.d.ts.map +0 -1
- package/lib/base/model/model-initialization-constraint.spec.js +0 -97
- package/lib/base/model/model-initialization-constraint.spec.js.map +0 -1
- package/lib/base/selection-service.spec.d.ts +0 -2
- package/lib/base/selection-service.spec.d.ts.map +0 -1
- package/lib/base/selection-service.spec.js +0 -287
- package/lib/base/selection-service.spec.js.map +0 -1
- package/lib/features/bounds/freeform-layout.spec.d.ts +0 -3
- package/lib/features/bounds/freeform-layout.spec.d.ts.map +0 -1
- package/lib/features/bounds/freeform-layout.spec.js +0 -201
- package/lib/features/bounds/freeform-layout.spec.js.map +0 -1
- package/lib/features/bounds/hbox-layout.spec.d.ts +0 -3
- package/lib/features/bounds/hbox-layout.spec.d.ts.map +0 -1
- package/lib/features/bounds/hbox-layout.spec.js +0 -160
- package/lib/features/bounds/hbox-layout.spec.js.map +0 -1
- package/lib/features/bounds/layouter-test-util.spec.d.ts +0 -32
- package/lib/features/bounds/layouter-test-util.spec.d.ts.map +0 -1
- package/lib/features/bounds/layouter-test-util.spec.js +0 -96
- package/lib/features/bounds/layouter-test-util.spec.js.map +0 -1
- package/lib/features/bounds/vbox-layout.spec.d.ts +0 -3
- package/lib/features/bounds/vbox-layout.spec.d.ts.map +0 -1
- package/lib/features/bounds/vbox-layout.spec.js +0 -160
- package/lib/features/bounds/vbox-layout.spec.js.map +0 -1
- package/lib/features/change-bounds/snap.spec.d.ts +0 -17
- package/lib/features/change-bounds/snap.spec.d.ts.map +0 -1
- package/lib/features/change-bounds/snap.spec.js +0 -83
- package/lib/features/change-bounds/snap.spec.js.map +0 -1
- package/lib/features/hints/type-hint-provider.spec.d.ts +0 -2
- package/lib/features/hints/type-hint-provider.spec.d.ts.map +0 -1
- package/lib/features/hints/type-hint-provider.spec.js +0 -333
- package/lib/features/hints/type-hint-provider.spec.js.map +0 -1
- package/lib/features/layout/layout-elements-action.spec.d.ts +0 -3
- package/lib/features/layout/layout-elements-action.spec.d.ts.map +0 -1
- package/lib/features/layout/layout-elements-action.spec.js +0 -329
- package/lib/features/layout/layout-elements-action.spec.js.map +0 -1
- package/lib/features/navigation/navigation-target-resolver.spec.d.ts +0 -3
- package/lib/features/navigation/navigation-target-resolver.spec.d.ts.map +0 -1
- package/lib/features/navigation/navigation-target-resolver.spec.js +0 -53
- package/lib/features/navigation/navigation-target-resolver.spec.js.map +0 -1
- package/lib/features/tools/marquee-selection/marquee-behavior.spec.d.ts +0 -17
- package/lib/features/tools/marquee-selection/marquee-behavior.spec.d.ts.map +0 -1
- package/lib/features/tools/marquee-selection/marquee-behavior.spec.js +0 -165
- package/lib/features/tools/marquee-selection/marquee-behavior.spec.js.map +0 -1
- package/lib/features/validation/marker-navigator.spec.d.ts +0 -3
- package/lib/features/validation/marker-navigator.spec.d.ts.map +0 -1
- package/lib/features/validation/marker-navigator.spec.js +0 -166
- package/lib/features/validation/marker-navigator.spec.js.map +0 -1
- package/lib/utils/gmodel-util.spec.d.ts +0 -2
- package/lib/utils/gmodel-util.spec.d.ts.map +0 -1
- package/lib/utils/gmodel-util.spec.js +0 -186
- package/lib/utils/gmodel-util.spec.js.map +0 -1
|
@@ -36,25 +36,6 @@ import { inject, injectable } from 'inversify';
|
|
|
36
36
|
import { partition } from 'lodash';
|
|
37
37
|
import '../../../css/helper-lines.css';
|
|
38
38
|
import { FeedbackCommand } from '../../base/feedback/feedback-command';
|
|
39
|
-
import {
|
|
40
|
-
bottom,
|
|
41
|
-
bottomCenter,
|
|
42
|
-
bottomLeft,
|
|
43
|
-
bottomRight,
|
|
44
|
-
center,
|
|
45
|
-
isAbove,
|
|
46
|
-
isBefore,
|
|
47
|
-
left,
|
|
48
|
-
middle,
|
|
49
|
-
middleLeft,
|
|
50
|
-
middleRight,
|
|
51
|
-
right,
|
|
52
|
-
sortBy,
|
|
53
|
-
top,
|
|
54
|
-
topCenter,
|
|
55
|
-
topLeft,
|
|
56
|
-
topRight
|
|
57
|
-
} from '../../utils/geometry-util';
|
|
58
39
|
import {
|
|
59
40
|
BoundsAwareModelElement,
|
|
60
41
|
findTopLevelElementByFeature,
|
|
@@ -191,12 +172,12 @@ export class DrawHelperLinesFeedbackCommand extends FeedbackCommand {
|
|
|
191
172
|
const helperLines: HelperLine[] = [];
|
|
192
173
|
this.log('Find helperlines for viewport:', root);
|
|
193
174
|
const viewportBounds = getViewportBounds(root, root.canvasBounds);
|
|
194
|
-
if (lineTypes.includes(HelperLineType.Center) && this.isAligned(
|
|
195
|
-
helperLines.push(new HelperLine(topCenter(viewportBounds), bottomCenter(viewportBounds), HelperLineType.Center));
|
|
175
|
+
if (lineTypes.includes(HelperLineType.Center) && this.isAligned(Bounds.centerX, viewportBounds, bounds, 2)) {
|
|
176
|
+
helperLines.push(new HelperLine(Bounds.topCenter(viewportBounds), Bounds.bottomCenter(viewportBounds), HelperLineType.Center));
|
|
196
177
|
this.log('- Reference bounds center align with viewport.', viewportBounds);
|
|
197
178
|
}
|
|
198
|
-
if (lineTypes.includes(HelperLineType.Middle) && this.isAligned(middle, viewportBounds, bounds, 2)) {
|
|
199
|
-
helperLines.push(new HelperLine(middleLeft(viewportBounds), middleRight(viewportBounds), HelperLineType.Middle));
|
|
179
|
+
if (lineTypes.includes(HelperLineType.Middle) && this.isAligned(Bounds.middle, viewportBounds, bounds, 2)) {
|
|
180
|
+
helperLines.push(new HelperLine(Bounds.middleLeft(viewportBounds), Bounds.middleRight(viewportBounds), HelperLineType.Middle));
|
|
200
181
|
this.log('- Reference bounds middle align with viewport.', viewportBounds);
|
|
201
182
|
}
|
|
202
183
|
if (helperLines.length > 0) {
|
|
@@ -213,78 +194,90 @@ export class DrawHelperLinesFeedbackCommand extends FeedbackCommand {
|
|
|
213
194
|
protected calcHelperLinesForBounds(elementBounds: Bounds, bounds: Bounds, lineTypes: HelperLineType[]): HelperLine[] {
|
|
214
195
|
const helperLines: HelperLine[] = [];
|
|
215
196
|
|
|
216
|
-
if (lineTypes.includes(HelperLineType.Left) && this.isAligned(left, elementBounds, bounds, this.alignmentEpsilon)) {
|
|
217
|
-
const [above, below] = sortBy(top, elementBounds, bounds); // higher top-value ==> lower
|
|
218
|
-
helperLines.push(new HelperLine(bottomLeft(below), topLeft(above), HelperLineType.Left));
|
|
197
|
+
if (lineTypes.includes(HelperLineType.Left) && this.isAligned(Bounds.left, elementBounds, bounds, this.alignmentEpsilon)) {
|
|
198
|
+
const [above, below] = Bounds.sortBy(Bounds.top, elementBounds, bounds); // higher top-value ==> lower
|
|
199
|
+
helperLines.push(new HelperLine(Bounds.bottomLeft(below), Bounds.topLeft(above), HelperLineType.Left));
|
|
219
200
|
this.log('- Reference bounds left align with element', elementBounds);
|
|
220
201
|
}
|
|
221
202
|
|
|
222
|
-
if (lineTypes.includes(HelperLineType.Center) && this.isAligned(
|
|
223
|
-
const [above, below] = sortBy(top, elementBounds, bounds); // higher top-value ==> lower
|
|
224
|
-
helperLines.push(new HelperLine(topCenter(above), bottomCenter(below), HelperLineType.Center));
|
|
203
|
+
if (lineTypes.includes(HelperLineType.Center) && this.isAligned(Bounds.centerX, elementBounds, bounds, this.alignmentEpsilon)) {
|
|
204
|
+
const [above, below] = Bounds.sortBy(Bounds.top, elementBounds, bounds); // higher top-value ==> lower
|
|
205
|
+
helperLines.push(new HelperLine(Bounds.topCenter(above), Bounds.bottomCenter(below), HelperLineType.Center));
|
|
225
206
|
this.log('- Reference bounds center align with element', elementBounds);
|
|
226
207
|
}
|
|
227
208
|
|
|
228
|
-
if (lineTypes.includes(HelperLineType.Right) && this.isAligned(right, elementBounds, bounds, this.alignmentEpsilon)) {
|
|
229
|
-
const [above, below] = sortBy(top, elementBounds, bounds); // higher top-value ==> lower
|
|
230
|
-
helperLines.push(new HelperLine(bottomRight(below), topRight(above), HelperLineType.Right));
|
|
209
|
+
if (lineTypes.includes(HelperLineType.Right) && this.isAligned(Bounds.right, elementBounds, bounds, this.alignmentEpsilon)) {
|
|
210
|
+
const [above, below] = Bounds.sortBy(Bounds.top, elementBounds, bounds); // higher top-value ==> lower
|
|
211
|
+
helperLines.push(new HelperLine(Bounds.bottomRight(below), Bounds.topRight(above), HelperLineType.Right));
|
|
231
212
|
this.log('- Reference bounds right align with element', elementBounds);
|
|
232
213
|
}
|
|
233
214
|
|
|
234
|
-
if (lineTypes.includes(HelperLineType.Bottom) && this.isAligned(bottom, elementBounds, bounds, this.alignmentEpsilon)) {
|
|
235
|
-
const [before, after] = sortBy(left, elementBounds, bounds); // higher left-value ==> more to the right
|
|
236
|
-
helperLines.push(new HelperLine(bottomLeft(before), bottomRight(after), HelperLineType.Bottom));
|
|
215
|
+
if (lineTypes.includes(HelperLineType.Bottom) && this.isAligned(Bounds.bottom, elementBounds, bounds, this.alignmentEpsilon)) {
|
|
216
|
+
const [before, after] = Bounds.sortBy(Bounds.left, elementBounds, bounds); // higher left-value ==> more to the right
|
|
217
|
+
helperLines.push(new HelperLine(Bounds.bottomLeft(before), Bounds.bottomRight(after), HelperLineType.Bottom));
|
|
237
218
|
this.log('- Reference bounds bottom align with element', elementBounds);
|
|
238
219
|
}
|
|
239
220
|
|
|
240
|
-
if (lineTypes.includes(HelperLineType.Middle) && this.isAligned(
|
|
241
|
-
const [before, after] = sortBy(left, elementBounds, bounds); // higher left-value ==> more to the right
|
|
242
|
-
helperLines.push(new HelperLine(middleLeft(before), middleRight(after), HelperLineType.Middle));
|
|
221
|
+
if (lineTypes.includes(HelperLineType.Middle) && this.isAligned(Bounds.centerY, elementBounds, bounds, this.alignmentEpsilon)) {
|
|
222
|
+
const [before, after] = Bounds.sortBy(Bounds.left, elementBounds, bounds); // higher left-value ==> more to the right
|
|
223
|
+
helperLines.push(new HelperLine(Bounds.middleLeft(before), Bounds.middleRight(after), HelperLineType.Middle));
|
|
243
224
|
this.log('- Reference bounds middle align with element', elementBounds);
|
|
244
225
|
}
|
|
245
226
|
|
|
246
|
-
if (lineTypes.includes(HelperLineType.Top) && this.isAligned(top, elementBounds, bounds, this.alignmentEpsilon)) {
|
|
247
|
-
const [before, after] = sortBy(left, elementBounds, bounds); // higher left-value ==> more to the right
|
|
248
|
-
helperLines.push(new HelperLine(topLeft(before), topRight(after), HelperLineType.Top));
|
|
227
|
+
if (lineTypes.includes(HelperLineType.Top) && this.isAligned(Bounds.top, elementBounds, bounds, this.alignmentEpsilon)) {
|
|
228
|
+
const [before, after] = Bounds.sortBy(Bounds.left, elementBounds, bounds); // higher left-value ==> more to the right
|
|
229
|
+
helperLines.push(new HelperLine(Bounds.topLeft(before), Bounds.topRight(after), HelperLineType.Top));
|
|
249
230
|
this.log('- Reference bounds top align with element', elementBounds);
|
|
250
231
|
}
|
|
251
232
|
|
|
252
|
-
if (
|
|
253
|
-
|
|
254
|
-
|
|
233
|
+
if (
|
|
234
|
+
lineTypes.includes(HelperLineType.LeftRight) &&
|
|
235
|
+
this.isMatch(Bounds.left(elementBounds), Bounds.right(bounds), this.alignmentEpsilon)
|
|
236
|
+
) {
|
|
237
|
+
if (Bounds.isAbove(bounds, elementBounds)) {
|
|
238
|
+
helperLines.push(new HelperLine(Bounds.bottomLeft(elementBounds), Bounds.topRight(bounds), HelperLineType.RightLeft));
|
|
255
239
|
this.log('- Reference bounds right aligns with element left', elementBounds);
|
|
256
240
|
} else {
|
|
257
|
-
helperLines.push(new HelperLine(topLeft(elementBounds), bottomRight(bounds), HelperLineType.RightLeft));
|
|
241
|
+
helperLines.push(new HelperLine(Bounds.topLeft(elementBounds), Bounds.bottomRight(bounds), HelperLineType.RightLeft));
|
|
258
242
|
this.log('- Reference bounds right aligns with element left', elementBounds);
|
|
259
243
|
}
|
|
260
244
|
}
|
|
261
245
|
|
|
262
|
-
if (
|
|
263
|
-
|
|
264
|
-
|
|
246
|
+
if (
|
|
247
|
+
lineTypes.includes(HelperLineType.LeftRight) &&
|
|
248
|
+
this.isMatch(Bounds.right(elementBounds), Bounds.left(bounds), this.alignmentEpsilon)
|
|
249
|
+
) {
|
|
250
|
+
if (Bounds.isAbove(bounds, elementBounds)) {
|
|
251
|
+
helperLines.push(new HelperLine(Bounds.bottomRight(elementBounds), Bounds.topLeft(bounds), HelperLineType.LeftRight));
|
|
265
252
|
this.log('- Reference bounds left aligns with element right', elementBounds);
|
|
266
253
|
} else {
|
|
267
|
-
helperLines.push(new HelperLine(topRight(elementBounds), bottomLeft(bounds), HelperLineType.LeftRight));
|
|
254
|
+
helperLines.push(new HelperLine(Bounds.topRight(elementBounds), Bounds.bottomLeft(bounds), HelperLineType.LeftRight));
|
|
268
255
|
this.log('- Reference bounds left aligns with element right', elementBounds);
|
|
269
256
|
}
|
|
270
257
|
}
|
|
271
258
|
|
|
272
|
-
if (
|
|
273
|
-
|
|
274
|
-
|
|
259
|
+
if (
|
|
260
|
+
lineTypes.includes(HelperLineType.TopBottom) &&
|
|
261
|
+
this.isMatch(Bounds.top(elementBounds), Bounds.bottom(bounds), this.alignmentEpsilon)
|
|
262
|
+
) {
|
|
263
|
+
if (Bounds.isBefore(bounds, elementBounds)) {
|
|
264
|
+
helperLines.push(new HelperLine(Bounds.topRight(elementBounds), Bounds.bottomLeft(bounds), HelperLineType.BottomTop));
|
|
275
265
|
this.log('- Reference bounds bottom aligns with element top', elementBounds);
|
|
276
266
|
} else {
|
|
277
|
-
helperLines.push(new HelperLine(topLeft(elementBounds), bottomRight(bounds), HelperLineType.BottomTop));
|
|
267
|
+
helperLines.push(new HelperLine(Bounds.topLeft(elementBounds), Bounds.bottomRight(bounds), HelperLineType.BottomTop));
|
|
278
268
|
this.log('- Reference bounds bottom aligns with element top', elementBounds);
|
|
279
269
|
}
|
|
280
270
|
}
|
|
281
271
|
|
|
282
|
-
if (
|
|
283
|
-
|
|
284
|
-
|
|
272
|
+
if (
|
|
273
|
+
lineTypes.includes(HelperLineType.TopBottom) &&
|
|
274
|
+
this.isMatch(Bounds.bottom(elementBounds), Bounds.top(bounds), this.alignmentEpsilon)
|
|
275
|
+
) {
|
|
276
|
+
if (Bounds.isBefore(bounds, elementBounds)) {
|
|
277
|
+
helperLines.push(new HelperLine(Bounds.bottomRight(elementBounds), Bounds.topLeft(bounds), HelperLineType.TopBottom));
|
|
285
278
|
this.log('- Reference bounds top aligns with element bottom', elementBounds);
|
|
286
279
|
} else {
|
|
287
|
-
helperLines.push(new HelperLine(bottomLeft(elementBounds), topRight(bounds), HelperLineType.TopBottom));
|
|
280
|
+
helperLines.push(new HelperLine(Bounds.bottomLeft(elementBounds), Bounds.topRight(bounds), HelperLineType.TopBottom));
|
|
288
281
|
this.log('- Reference bounds top aligns with element bottom', elementBounds);
|
|
289
282
|
}
|
|
290
283
|
}
|
|
@@ -13,18 +13,9 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
import {
|
|
17
|
-
Action,
|
|
18
|
-
DisposableCollection,
|
|
19
|
-
GModelElement,
|
|
20
|
-
GModelRoot,
|
|
21
|
-
IActionHandler,
|
|
22
|
-
MoveAction,
|
|
23
|
-
Point,
|
|
24
|
-
SetBoundsAction,
|
|
25
|
-
TYPES
|
|
26
|
-
} from '@eclipse-glsp/sprotty';
|
|
16
|
+
import { Action, GModelElement, GModelRoot, IActionHandler, MoveAction, Point, SetBoundsAction, TYPES } from '@eclipse-glsp/sprotty';
|
|
27
17
|
import { inject, injectable, optional, postConstruct } from 'inversify';
|
|
18
|
+
import { FeedbackEmitter } from '../../base';
|
|
28
19
|
import { IFeedbackActionDispatcher } from '../../base/feedback/feedback-action-dispatcher';
|
|
29
20
|
import { ISelectionListener, SelectionService } from '../../base/selection-service';
|
|
30
21
|
import { SetBoundsFeedbackAction } from '../bounds/set-bounds-feedback-command';
|
|
@@ -95,10 +86,11 @@ export class HelperLineManager implements IActionHandler, ISelectionListener, IH
|
|
|
95
86
|
@optional() @inject(TYPES.IHelperLineOptions) protected userOptions?: IHelperLineOptions;
|
|
96
87
|
|
|
97
88
|
protected options: Required<IHelperLineOptions>;
|
|
98
|
-
protected feedback:
|
|
89
|
+
protected feedback: FeedbackEmitter;
|
|
99
90
|
|
|
100
91
|
@postConstruct()
|
|
101
92
|
protected init(): void {
|
|
93
|
+
this.feedback = this.feedbackDispatcher.createEmitter();
|
|
102
94
|
this.options = { ...DEFAULT_HELPER_LINE_OPTIONS, ...this.userOptions };
|
|
103
95
|
this.selectionService.onSelectionChanged(change =>
|
|
104
96
|
this.selectionChanged(change.root, change.selectedElements, change.deselectedElements)
|
|
@@ -118,9 +110,7 @@ export class HelperLineManager implements IActionHandler, ISelectionListener, IH
|
|
|
118
110
|
}
|
|
119
111
|
|
|
120
112
|
protected handleMoveInitializedAction(_action: MoveInitializedEventAction): void {
|
|
121
|
-
this.
|
|
122
|
-
const feedback = this.createHelperLineFeedback(this.selectionService.getSelectedElementIDs());
|
|
123
|
-
this.feedback.push(this.feedbackDispatcher.registerFeedback(this, [feedback], [RemoveHelperLinesFeedbackAction.create()]));
|
|
113
|
+
this.submitHelperLineFeedback();
|
|
124
114
|
}
|
|
125
115
|
|
|
126
116
|
protected handleMoveFinishedAction(_action: MoveFinishedEventAction): void {
|
|
@@ -129,22 +119,23 @@ export class HelperLineManager implements IActionHandler, ISelectionListener, IH
|
|
|
129
119
|
|
|
130
120
|
protected handleMoveAction(action: MoveAction): void {
|
|
131
121
|
if (!action.finished) {
|
|
132
|
-
|
|
133
|
-
const feedback = this.createHelperLineFeedback(elementIds);
|
|
134
|
-
this.feedback.push(this.feedbackDispatcher.registerFeedback(this, [feedback], [RemoveHelperLinesFeedbackAction.create()]));
|
|
122
|
+
this.submitHelperLineFeedback(action.moves.map(move => move.elementId));
|
|
135
123
|
} else {
|
|
136
124
|
this.feedback.dispose();
|
|
137
125
|
}
|
|
138
126
|
}
|
|
139
127
|
|
|
128
|
+
protected submitHelperLineFeedback(elementIds: string[] = this.selectionService.getSelectedElementIDs()): void {
|
|
129
|
+
const feedback = this.createHelperLineFeedback(elementIds);
|
|
130
|
+
this.feedback.add(feedback, [RemoveHelperLinesFeedbackAction.create()]).submit();
|
|
131
|
+
}
|
|
132
|
+
|
|
140
133
|
protected createHelperLineFeedback(elementIds: string[]): DrawHelperLinesFeedbackAction {
|
|
141
134
|
return DrawHelperLinesFeedbackAction.create({ elementIds, ...this.options });
|
|
142
135
|
}
|
|
143
136
|
|
|
144
137
|
protected handleSetBoundsAction(action: SetBoundsAction | SetBoundsFeedbackAction): void {
|
|
145
|
-
|
|
146
|
-
const feedback = this.createHelperLineFeedback(elementIds);
|
|
147
|
-
this.feedback.push(this.feedbackDispatcher.registerFeedback(this, [feedback], [RemoveHelperLinesFeedbackAction.create()]));
|
|
138
|
+
this.submitHelperLineFeedback(action.bounds.map(bound => bound.elementId));
|
|
148
139
|
}
|
|
149
140
|
|
|
150
141
|
selectionChanged(root: Readonly<GModelRoot>, selectedElements: string[], deselectedElements?: string[] | undefined): void {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
|
|
17
|
-
import { Args, Bounds, GChildElement, GModelElement, GShapeElement, Point } from '@eclipse-glsp/sprotty';
|
|
17
|
+
import { Args, Bounds, Direction, GChildElement, GModelElement, GShapeElement, Point, Vector } from '@eclipse-glsp/sprotty';
|
|
18
18
|
import { v4 as uuid } from 'uuid';
|
|
19
19
|
import { ArgsAware } from '../../base/args-feature';
|
|
20
20
|
import { ResizeHandleLocation } from '../change-bounds/model';
|
|
@@ -98,30 +98,8 @@ export function isSelectionBounds(element: GModelElement): element is SelectionB
|
|
|
98
98
|
return element.type === SELECTION_BOUNDS;
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
Right: 'right',
|
|
104
|
-
Up: 'up',
|
|
105
|
-
Down: 'down'
|
|
106
|
-
} as const;
|
|
107
|
-
|
|
108
|
-
// allow any string to be set as helper line type to support customization
|
|
109
|
-
export type Direction = (typeof Direction)[keyof typeof Direction];
|
|
110
|
-
|
|
111
|
-
export function getDirectionOf(point: Point): Direction[] {
|
|
112
|
-
const directions: Direction[] = [];
|
|
113
|
-
if (point.x < 0) {
|
|
114
|
-
directions.push(Direction.Left);
|
|
115
|
-
} else if (point.x > 0) {
|
|
116
|
-
directions.push(Direction.Right);
|
|
117
|
-
}
|
|
118
|
-
if (point.y < 0) {
|
|
119
|
-
directions.push(Direction.Up);
|
|
120
|
-
} else if (point.y > 0) {
|
|
121
|
-
directions.push(Direction.Down);
|
|
122
|
-
}
|
|
123
|
-
return directions;
|
|
124
|
-
}
|
|
101
|
+
// kept for backwards compatibility after moving the definition
|
|
102
|
+
export const getDirectionOf = Vector.direction;
|
|
125
103
|
|
|
126
104
|
export function getDirectionFrom(resize?: ResizeHandleLocation): Direction[] {
|
|
127
105
|
if (resize === ResizeHandleLocation.TopLeft) {
|
|
@@ -138,3 +116,6 @@ export function getDirectionFrom(resize?: ResizeHandleLocation): Direction[] {
|
|
|
138
116
|
}
|
|
139
117
|
return [];
|
|
140
118
|
}
|
|
119
|
+
|
|
120
|
+
// re-export for backwards compatibility after moving the definition
|
|
121
|
+
export { Direction } from '@eclipse-glsp/sprotty';
|
|
@@ -35,6 +35,7 @@ import {
|
|
|
35
35
|
import { expect } from 'chai';
|
|
36
36
|
import { Container } from 'inversify';
|
|
37
37
|
import * as sinon from 'sinon';
|
|
38
|
+
import { FeedbackEmitter } from '../../base';
|
|
38
39
|
import { GLSPActionDispatcher } from '../../base/action-dispatcher';
|
|
39
40
|
import { FeedbackActionDispatcher } from '../../base/feedback/feedback-action-dispatcher';
|
|
40
41
|
import { GEdge } from '../../model';
|
|
@@ -45,7 +46,9 @@ import { ApplyTypeHintsAction, ApplyTypeHintsCommand, ITypeHintProvider, TypeHin
|
|
|
45
46
|
describe('TypeHintProvider', () => {
|
|
46
47
|
const container = new Container();
|
|
47
48
|
container.bind(GLSPActionDispatcher).toConstantValue(sinon.createStubInstance(GLSPActionDispatcher));
|
|
48
|
-
|
|
49
|
+
const stub = sinon.createStubInstance(FeedbackActionDispatcher);
|
|
50
|
+
stub.createEmitter.returns(new FeedbackEmitter(stub));
|
|
51
|
+
container.bind(TYPES.IFeedbackActionDispatcher).toConstantValue(stub);
|
|
49
52
|
const typeHintProvider = container.resolve(TypeHintProvider);
|
|
50
53
|
|
|
51
54
|
describe('getShapeTypeHint', () => {
|
|
@@ -35,8 +35,9 @@ import {
|
|
|
35
35
|
isConnectable,
|
|
36
36
|
moveFeature
|
|
37
37
|
} from '@eclipse-glsp/sprotty';
|
|
38
|
-
import { inject, injectable } from 'inversify';
|
|
38
|
+
import { inject, injectable, postConstruct } from 'inversify';
|
|
39
39
|
|
|
40
|
+
import { FeedbackEmitter } from '../../base';
|
|
40
41
|
import { GLSPActionDispatcher } from '../../base/action-dispatcher';
|
|
41
42
|
import { IFeedbackActionDispatcher } from '../../base/feedback/feedback-action-dispatcher';
|
|
42
43
|
import { FeedbackCommand } from '../../base/feedback/feedback-command';
|
|
@@ -204,15 +205,21 @@ export class TypeHintProvider implements IActionHandler, ITypeHintProvider, IDia
|
|
|
204
205
|
@inject(GLSPActionDispatcher)
|
|
205
206
|
protected actionDispatcher: GLSPActionDispatcher;
|
|
206
207
|
|
|
208
|
+
protected typeHintsFeedback: FeedbackEmitter;
|
|
207
209
|
protected shapeHints: Map<string, ShapeTypeHint> = new Map();
|
|
208
210
|
protected edgeHints: Map<string, EdgeTypeHint> = new Map();
|
|
209
211
|
|
|
212
|
+
@postConstruct()
|
|
213
|
+
protected init(): void {
|
|
214
|
+
this.typeHintsFeedback = this.feedbackActionDispatcher.createEmitter();
|
|
215
|
+
}
|
|
216
|
+
|
|
210
217
|
handle(action: SetTypeHintsAction): void {
|
|
211
218
|
this.shapeHints.clear();
|
|
212
219
|
this.edgeHints.clear();
|
|
213
220
|
action.shapeHints.forEach(hint => this.shapeHints.set(hint.elementTypeId, hint));
|
|
214
221
|
action.edgeHints.forEach(hint => this.edgeHints.set(hint.elementTypeId, hint));
|
|
215
|
-
this.
|
|
222
|
+
this.typeHintsFeedback.add(ApplyTypeHintsAction.create()).submit();
|
|
216
223
|
}
|
|
217
224
|
|
|
218
225
|
getShapeTypeHint(input: GModelElement | GModelElementSchema | string): ShapeTypeHint | undefined {
|
|
@@ -13,17 +13,18 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
import { inject, injectable, optional } from 'inversify';
|
|
17
16
|
import {
|
|
18
17
|
Action,
|
|
19
18
|
ChangeBoundsOperation,
|
|
19
|
+
Dimension,
|
|
20
20
|
ElementAndBounds,
|
|
21
21
|
ElementMove,
|
|
22
|
+
GModelElement,
|
|
22
23
|
IActionDispatcher,
|
|
23
24
|
IActionHandler,
|
|
24
25
|
ICommand,
|
|
25
26
|
MoveAction,
|
|
26
|
-
|
|
27
|
+
Point,
|
|
27
28
|
SetBoundsAction,
|
|
28
29
|
TYPES,
|
|
29
30
|
Writable,
|
|
@@ -31,9 +32,10 @@ import {
|
|
|
31
32
|
hasNumberProp,
|
|
32
33
|
hasStringProp
|
|
33
34
|
} from '@eclipse-glsp/sprotty';
|
|
35
|
+
import { inject, injectable, optional } from 'inversify';
|
|
34
36
|
import { SelectionService } from '../../base/selection-service';
|
|
35
|
-
import { toValidElementAndBounds, toValidElementMove } from '../../utils/layout-utils';
|
|
36
37
|
import { BoundsAwareModelElement, getElements } from '../../utils/gmodel-util';
|
|
38
|
+
import { toValidElementAndBounds, toValidElementMove } from '../../utils/layout-utils';
|
|
37
39
|
import { isBoundsAwareMoveable, isResizable } from '../change-bounds/model';
|
|
38
40
|
import { IMovementRestrictor } from '../change-bounds/movement-restrictor';
|
|
39
41
|
|
|
@@ -227,12 +229,13 @@ export class ResizeElementsActionHandler extends LayoutElementsActionHandler {
|
|
|
227
229
|
resizeWidthAndHeight(elements: BoundsAwareModelElement[], reduceFn: ReduceFunction): void {
|
|
228
230
|
const targetWidth = reduceFn(...elements.map(element => element.bounds.width));
|
|
229
231
|
const targetHeight = reduceFn(...elements.map(element => element.bounds.height));
|
|
232
|
+
const targetDimension: Dimension = { width: targetWidth, height: targetHeight };
|
|
230
233
|
this.dispatchResizeActions(elements, (element, bounds) => {
|
|
231
234
|
// resize around center and middle (horizontal & vertical)
|
|
232
|
-
const
|
|
233
|
-
const
|
|
234
|
-
bounds.newPosition =
|
|
235
|
-
bounds.newSize =
|
|
235
|
+
const difference = Dimension.subtract(targetDimension, element.bounds);
|
|
236
|
+
const center = Dimension.center(difference);
|
|
237
|
+
bounds.newPosition = Point.subtract(element.bounds, center);
|
|
238
|
+
bounds.newSize = targetDimension;
|
|
236
239
|
});
|
|
237
240
|
}
|
|
238
241
|
|
|
@@ -13,8 +13,9 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
import { Action, BringToFrontAction, GModelElement, SelectAction, SelectMouseListener
|
|
16
|
+
import { Action, BringToFrontAction, GModelElement, SelectAction, SelectMouseListener } from '@eclipse-glsp/sprotty';
|
|
17
17
|
import { Ranked } from '../../base/ranked';
|
|
18
|
+
import { SelectableElement } from '../../utils';
|
|
18
19
|
|
|
19
20
|
/**
|
|
20
21
|
* Ranked select mouse listener that is executed before default mouse listeners when using the RankedMouseTool.
|
|
@@ -24,7 +25,7 @@ export class RankedSelectMouseListener extends SelectMouseListener implements Ra
|
|
|
24
25
|
rank: number = Ranked.DEFAULT_RANK - 100; /* we want to be executed before all default mouse listeners */
|
|
25
26
|
|
|
26
27
|
protected override handleSelectTarget(
|
|
27
|
-
selectableTarget:
|
|
28
|
+
selectableTarget: SelectableElement,
|
|
28
29
|
deselectedElements: GModelElement[],
|
|
29
30
|
event: MouseEvent
|
|
30
31
|
): (Action | Promise<Action>)[] {
|
|
@@ -40,7 +41,7 @@ export class RankedSelectMouseListener extends SelectMouseListener implements Ra
|
|
|
40
41
|
return result;
|
|
41
42
|
}
|
|
42
43
|
|
|
43
|
-
protected override handleDeselectTarget(selectableTarget:
|
|
44
|
+
protected override handleDeselectTarget(selectableTarget: SelectableElement, event: MouseEvent): (Action | Promise<Action>)[] {
|
|
44
45
|
const result: Action[] = [];
|
|
45
46
|
result.push(SelectAction.create({ selectedElementsIDs: [], deselectedElementsIDs: [selectableTarget.id] }));
|
|
46
47
|
return result;
|
|
@@ -13,11 +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 { inject, injectable } from 'inversify';
|
|
17
16
|
import { Action, Disposable, DisposableCollection, IActionHandler, TYPES } from '@eclipse-glsp/sprotty';
|
|
17
|
+
import { inject, injectable } from 'inversify';
|
|
18
18
|
import { GLSPActionDispatcher } from '../../base/action-dispatcher';
|
|
19
19
|
import { EditorContextService } from '../../base/editor-context-service';
|
|
20
|
-
import {
|
|
20
|
+
import { FeedbackEmitter } from '../../base/feedback/feeback-emitter';
|
|
21
|
+
import { IFeedbackActionDispatcher, IFeedbackEmitter, MaybeActions } from '../../base/feedback/feedback-action-dispatcher';
|
|
21
22
|
import { EnableToolsAction, Tool } from '../../base/tool-manager/tool';
|
|
22
23
|
import { GLSPKeyTool } from '../../base/view/key-tool';
|
|
23
24
|
import { GLSPMouseTool } from '../../base/view/mouse-tool';
|
|
@@ -47,8 +48,12 @@ export abstract class BaseEditTool implements Tool {
|
|
|
47
48
|
return true;
|
|
48
49
|
}
|
|
49
50
|
|
|
50
|
-
dispatchActions(actions: Action[]): void {
|
|
51
|
-
this.actionDispatcher.dispatchAll(actions);
|
|
51
|
+
dispatchActions(actions: Action[]): Promise<void> {
|
|
52
|
+
return this.actionDispatcher.dispatchAll(actions);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
createFeedbackEmitter(): FeedbackEmitter {
|
|
56
|
+
return this.feedbackDispatcher.createEmitter();
|
|
52
57
|
}
|
|
53
58
|
|
|
54
59
|
/**
|
|
@@ -59,9 +64,10 @@ export abstract class BaseEditTool implements Tool {
|
|
|
59
64
|
* @param feedbackEmitter the emitter sending out feedback actions (this tool by default).
|
|
60
65
|
* @param cleanupActions the actions to be sent out when the feedback is de-registered through the returned Disposable.
|
|
61
66
|
* @returns A 'Disposable' that de-registers the feedback and cleans up any pending feedback with the given `cleanupActions`.
|
|
67
|
+
* @deprecated It is recommended to create a {@link createFeedbackEmitter dedicated emitter} per feedback instead of using the tool.
|
|
62
68
|
*/
|
|
63
|
-
registerFeedback(feedbackActions: Action[], feedbackEmitter
|
|
64
|
-
return this.feedbackDispatcher.registerFeedback(feedbackEmitter
|
|
69
|
+
registerFeedback(feedbackActions: Action[], feedbackEmitter: IFeedbackEmitter = this, cleanupActions?: MaybeActions): Disposable {
|
|
70
|
+
return this.feedbackDispatcher.registerFeedback(feedbackEmitter, feedbackActions, cleanupActions);
|
|
65
71
|
}
|
|
66
72
|
|
|
67
73
|
/**
|
|
@@ -70,9 +76,10 @@ export abstract class BaseEditTool implements Tool {
|
|
|
70
76
|
*
|
|
71
77
|
* @param feedbackEmitter the emitter to be deregistered (this tool by default).
|
|
72
78
|
* @param cleanupActions the actions to be dispatched right after the deregistration to clean up any pending feedback.
|
|
79
|
+
* @deprecated It is recommended to create a {@link createFeedbackEmitter dedicated emitter} per feedback and dispose it like that.
|
|
73
80
|
*/
|
|
74
|
-
deregisterFeedback(feedbackEmitter
|
|
75
|
-
this.feedbackDispatcher.deregisterFeedback(feedbackEmitter
|
|
81
|
+
deregisterFeedback(feedbackEmitter: IFeedbackEmitter = this, cleanupActions?: MaybeActions): void {
|
|
82
|
+
this.feedbackDispatcher.deregisterFeedback(feedbackEmitter, cleanupActions);
|
|
76
83
|
}
|
|
77
84
|
}
|
|
78
85
|
|