@eclipse-glsp/client 1.1.0-next.698b9de.254 → 1.1.0-next.69a77b0.259
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/lib/base/action-dispatcher.d.ts.map +1 -1
- package/lib/base/action-dispatcher.js +5 -3
- package/lib/base/action-dispatcher.js.map +1 -1
- package/lib/base/actions/focus-change-action.js +1 -1
- package/lib/base/actions/focus-change-action.js.map +1 -1
- package/lib/base/auto-complete/auto-complete-actions.js +1 -1
- package/lib/base/auto-complete/auto-complete-actions.js.map +1 -1
- package/lib/base/auto-complete/validation-decorator.js +1 -1
- package/lib/base/auto-complete/validation-decorator.js.map +1 -1
- package/lib/base/command-stack.d.ts +17 -2
- package/lib/base/command-stack.d.ts.map +1 -1
- package/lib/base/command-stack.js +43 -3
- package/lib/base/command-stack.js.map +1 -1
- package/lib/base/di.config.d.ts.map +1 -1
- package/lib/base/di.config.js +21 -3
- package/lib/base/di.config.js.map +1 -1
- package/lib/base/drag-aware-mouse-listener.d.ts +2 -2
- package/lib/base/drag-aware-mouse-listener.d.ts.map +1 -1
- package/lib/base/drag-aware-mouse-listener.js.map +1 -1
- package/lib/base/editor-context-service.d.ts +10 -7
- package/lib/base/editor-context-service.d.ts.map +1 -1
- package/lib/base/editor-context-service.js +27 -10
- package/lib/base/editor-context-service.js.map +1 -1
- package/lib/{features/tool-feedback → base/feedback}/css-feedback.d.ts +1 -1
- package/lib/base/feedback/css-feedback.d.ts.map +1 -0
- package/lib/{features/tool-feedback → base/feedback}/css-feedback.js +5 -6
- package/lib/base/feedback/css-feedback.js.map +1 -0
- package/lib/{features/tool-feedback → base/feedback}/feedback-action-dispatcher.d.ts +11 -9
- package/lib/base/feedback/feedback-action-dispatcher.d.ts.map +1 -0
- package/lib/{features/tool-feedback → base/feedback}/feedback-action-dispatcher.js +26 -20
- package/lib/base/feedback/feedback-action-dispatcher.js.map +1 -0
- package/lib/{features/tool-feedback/model.d.ts → base/feedback/feedback-command.d.ts} +1 -1
- package/lib/base/feedback/feedback-command.d.ts.map +1 -0
- package/lib/{features/tool-feedback/model.js → base/feedback/feedback-command.js} +1 -1
- package/lib/base/feedback/feedback-command.js.map +1 -0
- package/lib/base/{model → feedback}/update-model-command.d.ts +3 -15
- package/lib/base/feedback/update-model-command.d.ts.map +1 -0
- package/lib/base/{model → feedback}/update-model-command.js +3 -27
- package/lib/base/feedback/update-model-command.js.map +1 -0
- package/lib/base/focus-tracker.js +2 -3
- package/lib/base/focus-tracker.js.map +1 -1
- package/lib/base/model/model-registry.js +2 -3
- package/lib/base/model/model-registry.js.map +1 -1
- package/lib/base/model-initialization-constraint.js +4 -6
- package/lib/base/model-initialization-constraint.js.map +1 -1
- package/lib/base/ranked.d.ts +34 -0
- package/lib/base/ranked.d.ts.map +1 -0
- package/lib/base/ranked.js +38 -0
- package/lib/base/ranked.js.map +1 -0
- package/lib/base/selection-clearing-mouse-listener.js +2 -3
- package/lib/base/selection-clearing-mouse-listener.js.map +1 -1
- package/lib/{features/select → base}/selection-service.d.ts +34 -13
- package/lib/base/selection-service.d.ts.map +1 -0
- package/lib/{features/select → base}/selection-service.js +73 -29
- package/lib/base/selection-service.js.map +1 -0
- package/lib/base/selection-service.spec.d.ts +2 -0
- package/lib/base/selection-service.spec.d.ts.map +1 -0
- package/lib/base/selection-service.spec.js +281 -0
- package/lib/base/selection-service.spec.js.map +1 -0
- package/lib/base/tool-manager/glsp-tool-manager.d.ts +3 -3
- package/lib/base/tool-manager/glsp-tool-manager.d.ts.map +1 -1
- package/lib/base/tool-manager/glsp-tool-manager.js +5 -6
- package/lib/base/tool-manager/glsp-tool-manager.js.map +1 -1
- package/lib/base/view/key-tool.d.ts +5 -0
- package/lib/base/view/key-tool.d.ts.map +1 -0
- package/lib/base/view/key-tool.js +36 -0
- package/lib/base/view/key-tool.js.map +1 -0
- package/lib/base/view/mouse-tool.d.ts +19 -0
- package/lib/base/view/mouse-tool.d.ts.map +1 -0
- package/lib/{features/mouse-tool → base/view}/mouse-tool.js +14 -11
- package/lib/base/view/mouse-tool.js.map +1 -0
- package/lib/base/view/view-registry.js +2 -3
- package/lib/base/view/view-registry.js.map +1 -1
- package/lib/{base/container-modules.d.ts → container-modules.d.ts} +2 -2
- package/lib/container-modules.d.ts.map +1 -0
- package/lib/{base/container-modules.js → container-modules.js} +49 -41
- package/lib/container-modules.js.map +1 -0
- package/lib/features/accessibility/move-zoom/move-handler.js +6 -8
- package/lib/features/accessibility/move-zoom/move-handler.js.map +1 -1
- package/lib/features/accessibility/move-zoom/zoom-handler.js +6 -8
- package/lib/features/accessibility/move-zoom/zoom-handler.js.map +1 -1
- package/lib/features/accessibility/resize-key-tool/resize-key-handler.js +4 -5
- package/lib/features/accessibility/resize-key-tool/resize-key-handler.js.map +1 -1
- package/lib/features/accessibility/resize-key-tool/resize-key-tool.d.ts +1 -1
- package/lib/features/accessibility/resize-key-tool/resize-key-tool.d.ts.map +1 -1
- package/lib/features/accessibility/resize-key-tool/resize-key-tool.js +6 -8
- package/lib/features/accessibility/resize-key-tool/resize-key-tool.js.map +1 -1
- package/lib/features/accessibility/search/search-palette.js +3 -4
- package/lib/features/accessibility/search/search-palette.js.map +1 -1
- package/lib/features/accessibility/search/search-tool.js +2 -3
- package/lib/features/accessibility/search/search-tool.js.map +1 -1
- package/lib/features/accessibility/view-key-tools/deselect-key-tool.js +2 -3
- package/lib/features/accessibility/view-key-tools/deselect-key-tool.js.map +1 -1
- package/lib/features/accessibility/view-key-tools/movement-key-tool.d.ts +1 -1
- 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 +5 -6
- package/lib/features/accessibility/view-key-tools/movement-key-tool.js.map +1 -1
- package/lib/features/accessibility/view-key-tools/zoom-key-tool.d.ts +1 -1
- package/lib/features/accessibility/view-key-tools/zoom-key-tool.d.ts.map +1 -1
- package/lib/features/accessibility/view-key-tools/zoom-key-tool.js +5 -6
- package/lib/features/accessibility/view-key-tools/zoom-key-tool.js.map +1 -1
- package/lib/features/autocomplete-palette/base-autocomplete-palette.js +1 -1
- package/lib/features/autocomplete-palette/base-autocomplete-palette.js.map +1 -1
- package/lib/features/bounds/freeform-layout.js +2 -3
- package/lib/features/bounds/freeform-layout.js.map +1 -1
- package/lib/features/bounds/freeform-layout.spec.d.ts +3 -0
- package/lib/features/bounds/freeform-layout.spec.d.ts.map +1 -0
- package/lib/features/bounds/freeform-layout.spec.js +201 -0
- package/lib/features/bounds/freeform-layout.spec.js.map +1 -0
- package/lib/features/bounds/glsp-hidden-bounds-updater.js +2 -3
- package/lib/features/bounds/glsp-hidden-bounds-updater.js.map +1 -1
- package/lib/features/bounds/hbox-layout.js +2 -3
- package/lib/features/bounds/hbox-layout.js.map +1 -1
- package/lib/features/bounds/hbox-layout.spec.d.ts +3 -0
- package/lib/features/bounds/hbox-layout.spec.d.ts.map +1 -0
- package/lib/features/bounds/hbox-layout.spec.js +160 -0
- package/lib/features/bounds/hbox-layout.spec.js.map +1 -0
- package/lib/features/bounds/layouter-test-util.spec.d.ts +32 -0
- package/lib/features/bounds/layouter-test-util.spec.d.ts.map +1 -0
- package/lib/features/bounds/layouter-test-util.spec.js +96 -0
- package/lib/features/bounds/layouter-test-util.spec.js.map +1 -0
- package/lib/features/bounds/layouter.js +2 -3
- package/lib/features/bounds/layouter.js.map +1 -1
- package/lib/features/bounds/vbox-layout.js +2 -3
- package/lib/features/bounds/vbox-layout.js.map +1 -1
- package/lib/features/bounds/vbox-layout.spec.d.ts +3 -0
- package/lib/features/bounds/vbox-layout.spec.d.ts.map +1 -0
- package/lib/features/bounds/vbox-layout.spec.js +160 -0
- package/lib/features/bounds/vbox-layout.spec.js.map +1 -0
- package/lib/features/change-bounds/model.js +2 -2
- package/lib/features/change-bounds/model.js.map +1 -1
- package/lib/features/change-bounds/movement-restrictor.d.ts +1 -1
- package/lib/features/change-bounds/movement-restrictor.d.ts.map +1 -1
- package/lib/features/change-bounds/movement-restrictor.js +3 -4
- package/lib/features/change-bounds/movement-restrictor.js.map +1 -1
- package/lib/features/change-bounds/snap.js +2 -3
- package/lib/features/change-bounds/snap.js.map +1 -1
- package/lib/features/{rank/model.d.ts → change-bounds/snap.spec.d.ts} +3 -8
- package/lib/features/change-bounds/snap.spec.d.ts.map +1 -0
- package/lib/features/change-bounds/snap.spec.js +82 -0
- package/lib/features/change-bounds/snap.spec.js.map +1 -0
- package/lib/features/command-palette/command-palette-tool.js +2 -3
- package/lib/features/command-palette/command-palette-tool.js.map +1 -1
- package/lib/features/command-palette/server-command-palette-provider.js +3 -4
- package/lib/features/command-palette/server-command-palette-provider.js.map +1 -1
- package/lib/features/context-menu/delete-element-context-menu.js +2 -3
- package/lib/features/context-menu/delete-element-context-menu.js.map +1 -1
- package/lib/features/context-menu/selection-service-aware-context-menu-mouse-listener.d.ts +1 -1
- package/lib/features/context-menu/selection-service-aware-context-menu-mouse-listener.d.ts.map +1 -1
- package/lib/features/context-menu/selection-service-aware-context-menu-mouse-listener.js +4 -5
- package/lib/features/context-menu/selection-service-aware-context-menu-mouse-listener.js.map +1 -1
- package/lib/features/context-menu/server-context-menu-provider.js +3 -4
- package/lib/features/context-menu/server-context-menu-provider.js.map +1 -1
- package/lib/features/copy-paste/copy-paste-context-menu.js +6 -8
- package/lib/features/copy-paste/copy-paste-context-menu.js.map +1 -1
- package/lib/features/copy-paste/copy-paste-handler.js +4 -6
- package/lib/features/copy-paste/copy-paste-handler.js.map +1 -1
- package/lib/features/decoration/decoration-placer.js +2 -3
- package/lib/features/decoration/decoration-placer.js.map +1 -1
- package/lib/features/edit-label/edit-label-tool.d.ts +0 -3
- package/lib/features/edit-label/edit-label-tool.d.ts.map +1 -1
- package/lib/features/edit-label/edit-label-tool.js +3 -11
- package/lib/features/edit-label/edit-label-tool.js.map +1 -1
- package/lib/features/edit-label/edit-label-validator.js +5 -7
- package/lib/features/edit-label/edit-label-validator.js.map +1 -1
- package/lib/features/export/glsp-svg-exporter.js +2 -3
- package/lib/features/export/glsp-svg-exporter.js.map +1 -1
- package/lib/features/hints/type-hints.d.ts +2 -2
- package/lib/features/hints/type-hints.d.ts.map +1 -1
- package/lib/features/hints/type-hints.js +9 -11
- package/lib/features/hints/type-hints.js.map +1 -1
- package/lib/features/hover/hover.d.ts.map +1 -1
- package/lib/features/hover/hover.js +3 -4
- package/lib/features/hover/hover.js.map +1 -1
- package/lib/features/layout/di.config.js +1 -1
- package/lib/features/layout/di.config.js.map +1 -1
- package/lib/features/layout/layout-elements-action.d.ts +1 -1
- package/lib/features/layout/layout-elements-action.d.ts.map +1 -1
- package/lib/features/layout/layout-elements-action.js +14 -17
- package/lib/features/layout/layout-elements-action.js.map +1 -1
- package/lib/features/layout/layout-elements-action.spec.d.ts +3 -0
- package/lib/features/layout/layout-elements-action.spec.d.ts.map +1 -0
- package/lib/features/layout/layout-elements-action.spec.js +321 -0
- package/lib/features/layout/layout-elements-action.spec.js.map +1 -0
- package/lib/features/navigation/navigation-action-handler.js +5 -6
- package/lib/features/navigation/navigation-action-handler.js.map +1 -1
- package/lib/features/navigation/navigation-target-resolver.js +2 -3
- package/lib/features/navigation/navigation-target-resolver.js.map +1 -1
- package/lib/features/navigation/navigation-target-resolver.spec.d.ts +3 -0
- package/lib/features/navigation/navigation-target-resolver.spec.d.ts.map +1 -0
- package/lib/features/navigation/navigation-target-resolver.spec.js +53 -0
- package/lib/features/navigation/navigation-target-resolver.spec.js.map +1 -0
- package/lib/features/routing/di.config.d.ts +22 -0
- package/lib/features/routing/di.config.d.ts.map +1 -0
- package/lib/features/routing/di.config.js +57 -0
- package/lib/features/routing/di.config.js.map +1 -0
- package/lib/features/routing/glsp-manhattan-edge-router.d.ts.map +1 -0
- package/lib/features/routing/glsp-manhattan-edge-router.js.map +1 -0
- package/lib/features/select/di.config.d.ts.map +1 -1
- package/lib/features/select/di.config.js +3 -5
- package/lib/features/select/di.config.js.map +1 -1
- package/lib/features/select/select-feedback-command.d.ts +12 -0
- package/lib/features/select/select-feedback-command.d.ts.map +1 -0
- package/lib/features/select/{select-feedback-action.js → select-feedback-command.js} +6 -30
- package/lib/features/select/select-feedback-command.js.map +1 -0
- package/lib/features/select/select-mouse-listener.d.ts +1 -1
- package/lib/features/select/select-mouse-listener.d.ts.map +1 -1
- package/lib/features/select/select-mouse-listener.js +2 -2
- package/lib/features/select/select-mouse-listener.js.map +1 -1
- package/lib/features/source-model-watcher/source-model-changed-action-handler.js +5 -7
- package/lib/features/source-model-watcher/source-model-changed-action-handler.js.map +1 -1
- package/lib/features/svg-metadata/metadata-placer.js +2 -3
- package/lib/features/svg-metadata/metadata-placer.js.map +1 -1
- package/lib/features/tool-palette/tool-palette.d.ts +4 -4
- package/lib/features/tool-palette/tool-palette.d.ts.map +1 -1
- package/lib/features/tool-palette/tool-palette.js +12 -13
- package/lib/features/tool-palette/tool-palette.js.map +1 -1
- package/lib/features/tools/base-glsp-creation-tool.d.ts +10 -0
- package/lib/features/tools/base-glsp-creation-tool.d.ts.map +1 -0
- package/lib/features/tools/base-glsp-creation-tool.js +45 -0
- package/lib/features/tools/base-glsp-creation-tool.js.map +1 -0
- package/lib/features/tools/base-glsp-tool.d.ts +26 -8
- package/lib/features/tools/base-glsp-tool.d.ts.map +1 -1
- package/lib/features/tools/base-glsp-tool.js +34 -11
- package/lib/features/tools/base-glsp-tool.js.map +1 -1
- package/lib/features/{tool-feedback → tools/change-bounds}/change-bounds-tool-feedback.d.ts +12 -5
- package/lib/features/tools/change-bounds/change-bounds-tool-feedback.d.ts.map +1 -0
- package/lib/features/{tool-feedback → tools/change-bounds}/change-bounds-tool-feedback.js +45 -27
- package/lib/features/tools/change-bounds/change-bounds-tool-feedback.js.map +1 -0
- package/lib/features/tools/{change-bounds-tool.d.ts → change-bounds/change-bounds-tool.d.ts} +13 -14
- package/lib/features/tools/change-bounds/change-bounds-tool.d.ts.map +1 -0
- package/lib/features/tools/{change-bounds-tool.js → change-bounds/change-bounds-tool.js} +50 -35
- package/lib/features/tools/change-bounds/change-bounds-tool.js.map +1 -0
- package/lib/features/tools/change-bounds/di.config.d.ts +19 -0
- package/lib/features/tools/change-bounds/di.config.d.ts.map +1 -0
- package/lib/features/tools/change-bounds/di.config.js +32 -0
- package/lib/features/tools/change-bounds/di.config.js.map +1 -0
- package/lib/features/tools/change-bounds/view.d.ts +9 -0
- package/lib/features/tools/change-bounds/view.d.ts.map +1 -0
- package/lib/features/{tool-feedback → tools/change-bounds}/view.js +5 -21
- package/lib/features/tools/change-bounds/view.js.map +1 -0
- package/lib/features/tools/{delete-tool.d.ts → deletion/delete-tool.d.ts} +4 -9
- package/lib/features/tools/deletion/delete-tool.d.ts.map +1 -0
- package/lib/features/tools/{delete-tool.js → deletion/delete-tool.js} +13 -29
- package/lib/features/tools/deletion/delete-tool.js.map +1 -0
- package/lib/features/{tool-feedback → tools/deletion}/di.config.d.ts +2 -2
- package/lib/features/tools/deletion/di.config.d.ts.map +1 -0
- package/lib/features/{mouse-tool → tools/deletion}/di.config.js +7 -7
- package/lib/features/tools/deletion/di.config.js.map +1 -0
- package/lib/features/{tool-feedback/creation-tool-feedback.d.ts → tools/edge-creation/dangling-edge-feedback.d.ts} +5 -10
- package/lib/features/tools/edge-creation/dangling-edge-feedback.d.ts.map +1 -0
- package/lib/features/{tool-feedback/creation-tool-feedback.js → tools/edge-creation/dangling-edge-feedback.js} +25 -87
- package/lib/features/tools/edge-creation/dangling-edge-feedback.js.map +1 -0
- package/lib/features/tools/edge-creation/di.config.d.ts +19 -0
- package/lib/features/tools/edge-creation/di.config.d.ts.map +1 -0
- package/lib/features/tools/edge-creation/di.config.js +29 -0
- package/lib/features/tools/edge-creation/di.config.js.map +1 -0
- package/lib/features/tools/edge-creation/edge-creation-tool-feedback.d.ts +26 -0
- package/lib/features/tools/edge-creation/edge-creation-tool-feedback.d.ts.map +1 -0
- package/lib/features/tools/edge-creation/edge-creation-tool-feedback.js +74 -0
- package/lib/features/tools/edge-creation/edge-creation-tool-feedback.js.map +1 -0
- package/lib/features/tools/{edge-creation-tool.d.ts → edge-creation/edge-creation-tool.d.ts} +6 -11
- package/lib/features/tools/edge-creation/edge-creation-tool.d.ts.map +1 -0
- package/lib/features/tools/{edge-creation-tool.js → edge-creation/edge-creation-tool.js} +29 -40
- package/lib/features/tools/edge-creation/edge-creation-tool.js.map +1 -0
- package/lib/features/tools/edge-creation/view.d.ts +10 -0
- package/lib/features/tools/edge-creation/view.d.ts.map +1 -0
- package/lib/features/tools/edge-creation/view.js +43 -0
- package/lib/features/tools/edge-creation/view.js.map +1 -0
- package/lib/features/{mouse-tool → tools/edge-edit}/di.config.d.ts +2 -2
- package/lib/features/tools/edge-edit/di.config.d.ts.map +1 -0
- package/lib/features/tools/edge-edit/di.config.js +35 -0
- package/lib/features/tools/edge-edit/di.config.js.map +1 -0
- package/lib/features/{tool-feedback → tools/edge-edit}/edge-edit-tool-feedback.d.ts +14 -8
- package/lib/features/tools/edge-edit/edge-edit-tool-feedback.d.ts.map +1 -0
- package/lib/features/{tool-feedback → tools/edge-edit}/edge-edit-tool-feedback.js +42 -37
- package/lib/features/tools/edge-edit/edge-edit-tool-feedback.js.map +1 -0
- package/lib/features/tools/{edge-edit-tool.d.ts → edge-edit/edge-edit-tool.d.ts} +7 -9
- package/lib/features/tools/edge-edit/edge-edit-tool.d.ts.map +1 -0
- package/lib/features/tools/{edge-edit-tool.js → edge-edit/edge-edit-tool.js} +28 -33
- package/lib/features/tools/edge-edit/edge-edit-tool.js.map +1 -0
- package/lib/features/tools/enable-default-tools-on-focus-loss.d.ts +21 -0
- package/lib/features/tools/enable-default-tools-on-focus-loss.d.ts.map +1 -1
- package/lib/features/tools/enable-default-tools-on-focus-loss.js +9 -3
- package/lib/features/tools/enable-default-tools-on-focus-loss.js.map +1 -1
- package/lib/features/tools/marquee-selection/di.config.d.ts +19 -0
- package/lib/features/tools/marquee-selection/di.config.d.ts.map +1 -0
- package/lib/features/tools/marquee-selection/di.config.js +34 -0
- package/lib/features/tools/marquee-selection/di.config.js.map +1 -0
- package/lib/features/tools/{marquee-behavior.d.ts → marquee-selection/marquee-behavior.d.ts} +10 -10
- package/lib/features/tools/marquee-selection/marquee-behavior.d.ts.map +1 -0
- package/lib/features/tools/{marquee-behavior.js → marquee-selection/marquee-behavior.js} +2 -2
- package/lib/features/tools/marquee-selection/marquee-behavior.js.map +1 -0
- package/lib/features/tools/marquee-selection/marquee-behavior.spec.d.ts +17 -0
- package/lib/features/tools/marquee-selection/marquee-behavior.spec.d.ts.map +1 -0
- package/lib/features/tools/marquee-selection/marquee-behavior.spec.js +165 -0
- package/lib/features/tools/marquee-selection/marquee-behavior.spec.js.map +1 -0
- package/lib/features/tools/{marquee-mouse-tool.d.ts → marquee-selection/marquee-mouse-tool.d.ts} +4 -6
- package/lib/features/tools/marquee-selection/marquee-mouse-tool.d.ts.map +1 -0
- package/lib/features/tools/{marquee-mouse-tool.js → marquee-selection/marquee-mouse-tool.js} +12 -22
- package/lib/features/tools/marquee-selection/marquee-mouse-tool.js.map +1 -0
- package/lib/features/{tool-feedback → tools/marquee-selection}/marquee-tool-feedback.d.ts +2 -2
- package/lib/features/tools/marquee-selection/marquee-tool-feedback.d.ts.map +1 -0
- package/lib/features/{tool-feedback → tools/marquee-selection}/marquee-tool-feedback.js +8 -10
- package/lib/features/tools/marquee-selection/marquee-tool-feedback.js.map +1 -0
- package/lib/features/tools/marquee-selection/marquee-tool.d.ts +12 -0
- package/lib/features/tools/marquee-selection/marquee-tool.d.ts.map +1 -0
- package/lib/features/tools/{marquee-tool.js → marquee-selection/marquee-tool.js} +8 -20
- package/lib/features/tools/marquee-selection/marquee-tool.js.map +1 -0
- package/lib/features/tools/{model.d.ts → marquee-selection/model.d.ts} +1 -1
- package/lib/features/tools/marquee-selection/model.d.ts.map +1 -0
- package/lib/features/tools/{model.js → marquee-selection/model.js} +2 -2
- package/lib/features/tools/marquee-selection/model.js.map +1 -0
- package/lib/features/tools/{view.d.ts → marquee-selection/view.d.ts} +1 -1
- package/lib/features/tools/marquee-selection/view.d.ts.map +1 -0
- package/lib/features/tools/{view.js → marquee-selection/view.js} +3 -4
- package/lib/features/tools/marquee-selection/view.js.map +1 -0
- package/lib/features/tools/node-creation/di.config.d.ts +19 -0
- package/lib/features/tools/node-creation/di.config.d.ts.map +1 -0
- package/lib/features/{rank/model.js → tools/node-creation/di.config.js} +12 -13
- package/lib/features/tools/node-creation/di.config.js.map +1 -0
- package/lib/features/tools/{node-creation-tool.d.ts → node-creation/node-creation-tool.d.ts} +7 -10
- package/lib/features/tools/node-creation/node-creation-tool.d.ts.map +1 -0
- package/lib/features/tools/{node-creation-tool.js → node-creation/node-creation-tool.js} +17 -30
- package/lib/features/tools/node-creation/node-creation-tool.js.map +1 -0
- package/lib/features/validation/marker-navigator.d.ts +4 -3
- package/lib/features/validation/marker-navigator.d.ts.map +1 -1
- package/lib/features/validation/marker-navigator.js +16 -20
- package/lib/features/validation/marker-navigator.js.map +1 -1
- package/lib/features/validation/marker-navigator.spec.d.ts +3 -0
- package/lib/features/validation/marker-navigator.spec.d.ts.map +1 -0
- package/lib/features/validation/marker-navigator.spec.js +182 -0
- package/lib/features/validation/marker-navigator.spec.js.map +1 -0
- package/lib/features/validation/validate.d.ts +2 -2
- package/lib/features/validation/validate.d.ts.map +1 -1
- package/lib/features/validation/validate.js +12 -17
- package/lib/features/validation/validate.js.map +1 -1
- package/lib/features/viewport/glsp-scroll-mouse-listener.js +3 -4
- package/lib/features/viewport/glsp-scroll-mouse-listener.js.map +1 -1
- package/lib/glsp-sprotty/index.d.ts +1 -1
- package/lib/glsp-sprotty/index.d.ts.map +1 -1
- package/lib/glsp-sprotty/index.js +26 -25
- package/lib/glsp-sprotty/index.js.map +1 -1
- package/lib/glsp-sprotty/types.d.ts +4 -8
- package/lib/glsp-sprotty/types.d.ts.map +1 -1
- package/lib/glsp-sprotty/types.js +1 -1
- package/lib/glsp-sprotty/types.js.map +1 -1
- package/lib/index.d.ts +36 -27
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +58 -46
- package/lib/index.js.map +1 -1
- package/lib/lib/model.js +1 -1
- package/lib/lib/model.js.map +1 -1
- package/lib/model-source/glsp-diagram-server.d.ts.map +1 -1
- package/lib/model-source/glsp-diagram-server.js +5 -3
- package/lib/model-source/glsp-diagram-server.js.map +1 -1
- package/lib/utils/argument-utils.js +3 -3
- package/lib/utils/argument-utils.js.map +1 -1
- package/lib/utils/marker.js +1 -1
- package/lib/utils/marker.js.map +1 -1
- package/lib/utils/smodel-util.spec.d.ts +2 -0
- package/lib/utils/smodel-util.spec.d.ts.map +1 -0
- package/lib/utils/smodel-util.spec.js +184 -0
- package/lib/utils/smodel-util.spec.js.map +1 -0
- package/lib/utils/viewpoint-util.d.ts +20 -1
- package/lib/utils/viewpoint-util.d.ts.map +1 -1
- package/lib/utils/viewpoint-util.js +30 -1
- package/lib/utils/viewpoint-util.js.map +1 -1
- package/lib/views/compartments.js +2 -3
- package/lib/views/compartments.js.map +1 -1
- package/lib/views/glsp-edge-view.js +2 -3
- package/lib/views/glsp-edge-view.js.map +1 -1
- package/lib/views/glsp-projection-view.js +2 -3
- package/lib/views/glsp-projection-view.js.map +1 -1
- package/lib/views/issue-marker-view.js +2 -3
- package/lib/views/issue-marker-view.js.map +1 -1
- package/lib/views/rounded-corner-view.js +2 -3
- package/lib/views/rounded-corner-view.js.map +1 -1
- package/package.json +3 -3
- package/src/base/action-dispatcher.ts +3 -1
- package/src/base/command-stack.ts +55 -3
- package/src/base/di.config.ts +34 -9
- package/src/base/drag-aware-mouse-listener.ts +2 -2
- package/src/base/editor-context-service.ts +28 -13
- package/src/{features/tool-feedback → base/feedback}/css-feedback.ts +1 -1
- package/src/{features/tool-feedback → base/feedback}/feedback-action-dispatcher.ts +31 -23
- package/src/base/{model → feedback}/update-model-command.ts +3 -29
- package/src/base/ranked.ts +42 -0
- package/src/{features/select → base}/selection-service.spec.ts +51 -121
- package/src/{features/select → base}/selection-service.ts +82 -31
- package/src/base/tool-manager/glsp-tool-manager.ts +4 -4
- package/src/{features/rank/model.ts → base/view/key-tool.ts} +9 -13
- package/src/{features/mouse-tool → base/view}/mouse-tool.ts +14 -15
- package/src/{base/container-modules.ts → container-modules.ts} +33 -26
- package/src/features/accessibility/resize-key-tool/resize-key-tool.ts +2 -2
- package/src/features/accessibility/search/search-palette.ts +1 -1
- package/src/features/accessibility/view-key-tools/movement-key-tool.ts +2 -2
- package/src/features/accessibility/view-key-tools/zoom-key-tool.ts +3 -3
- package/src/features/bounds/layouter-test-util.spec.ts +1 -1
- package/src/features/change-bounds/movement-restrictor.ts +1 -1
- package/src/features/context-menu/selection-service-aware-context-menu-mouse-listener.ts +2 -2
- package/src/features/copy-paste/copy-paste-context-menu.ts +1 -1
- package/src/features/edit-label/edit-label-tool.ts +4 -12
- package/src/features/hints/type-hints.ts +2 -2
- package/src/features/hover/hover.ts +2 -1
- package/src/features/layout/di.config.ts +1 -1
- package/src/features/layout/layout-elements-action.spec.ts +1 -3
- package/src/features/layout/layout-elements-action.ts +2 -2
- package/src/features/navigation/navigation-action-handler.ts +1 -1
- package/src/features/routing/di.config.ts +82 -0
- package/src/features/select/di.config.ts +2 -4
- package/src/features/select/{select-feedback-action.ts → select-feedback-command.ts} +2 -38
- package/src/features/select/select-mouse-listener.ts +2 -2
- package/src/features/source-model-watcher/source-model-changed-action-handler.ts +1 -1
- package/src/features/tool-palette/tool-palette.ts +12 -12
- package/src/features/tools/base-glsp-creation-tool.ts +40 -0
- package/src/features/tools/base-glsp-tool.ts +32 -10
- package/src/features/{tool-feedback → tools/change-bounds}/change-bounds-tool-feedback.ts +52 -21
- package/src/features/tools/{change-bounds-tool.ts → change-bounds/change-bounds-tool.ts} +64 -35
- package/src/features/tools/change-bounds/di.config.ts +31 -0
- package/src/features/{tool-feedback → tools/change-bounds}/view.tsx +2 -14
- package/src/features/tools/{delete-tool.ts → deletion/delete-tool.ts} +8 -18
- package/src/features/{mouse-tool → tools/deletion}/di.config.ts +7 -7
- package/src/features/{tool-feedback/creation-tool-feedback.ts → tools/edge-creation/dangling-edge-feedback.ts} +18 -88
- package/src/features/tools/edge-creation/di.config.ts +28 -0
- package/src/features/tools/edge-creation/edge-creation-tool-feedback.ts +89 -0
- package/src/features/tools/{edge-creation-tool.ts → edge-creation/edge-creation-tool.ts} +26 -43
- package/src/features/tools/edge-creation/view.tsx +33 -0
- package/src/features/tools/edge-edit/di.config.ts +41 -0
- package/src/features/{tool-feedback → tools/edge-edit}/edge-edit-tool-feedback.ts +27 -15
- package/src/features/tools/{edge-edit-tool.ts → edge-edit/edge-edit-tool.ts} +29 -27
- package/src/features/tools/enable-default-tools-on-focus-loss.ts +11 -2
- package/src/features/tools/marquee-selection/di.config.ts +35 -0
- package/src/features/tools/{marquee-behavior.ts → marquee-selection/marquee-behavior.ts} +9 -9
- package/src/features/tools/{marquee-mouse-tool.ts → marquee-selection/marquee-mouse-tool.ts} +11 -17
- package/src/features/{tool-feedback → tools/marquee-selection}/marquee-tool-feedback.ts +1 -1
- package/src/features/tools/{marquee-tool.ts → marquee-selection/marquee-tool.ts} +5 -11
- package/{lib/features/tools/di.config.d.ts → src/features/tools/node-creation/di.config.ts} +10 -12
- package/src/features/tools/{node-creation-tool.ts → node-creation/node-creation-tool.ts} +14 -31
- package/src/features/validation/marker-navigator.ts +5 -5
- package/src/features/validation/validate.ts +2 -2
- package/src/features/viewport/glsp-scroll-mouse-listener.ts +1 -1
- package/src/glsp-sprotty/index.ts +1 -1
- package/src/glsp-sprotty/types.ts +2 -4
- package/src/index.ts +63 -49
- package/src/model-source/glsp-diagram-server.ts +7 -1
- package/src/utils/smodel-util.spec.ts +3 -3
- package/src/utils/viewpoint-util.ts +32 -0
- package/lib/base/container-modules.d.ts.map +0 -1
- package/lib/base/container-modules.js.map +0 -1
- package/lib/base/model/update-model-command.d.ts.map +0 -1
- package/lib/base/model/update-model-command.js.map +0 -1
- package/lib/features/mouse-tool/di.config.d.ts.map +0 -1
- package/lib/features/mouse-tool/di.config.js.map +0 -1
- package/lib/features/mouse-tool/mouse-tool.d.ts +0 -22
- package/lib/features/mouse-tool/mouse-tool.d.ts.map +0 -1
- package/lib/features/mouse-tool/mouse-tool.js.map +0 -1
- package/lib/features/rank/model.d.ts.map +0 -1
- package/lib/features/rank/model.js.map +0 -1
- package/lib/features/select/select-feedback-action.d.ts +0 -25
- package/lib/features/select/select-feedback-action.d.ts.map +0 -1
- package/lib/features/select/select-feedback-action.js.map +0 -1
- package/lib/features/select/selection-service.d.ts.map +0 -1
- package/lib/features/select/selection-service.js.map +0 -1
- package/lib/features/tool-feedback/change-bounds-tool-feedback.d.ts.map +0 -1
- package/lib/features/tool-feedback/change-bounds-tool-feedback.js.map +0 -1
- package/lib/features/tool-feedback/creation-tool-feedback.d.ts.map +0 -1
- package/lib/features/tool-feedback/creation-tool-feedback.js.map +0 -1
- package/lib/features/tool-feedback/css-feedback.d.ts.map +0 -1
- package/lib/features/tool-feedback/css-feedback.js.map +0 -1
- package/lib/features/tool-feedback/di.config.d.ts.map +0 -1
- package/lib/features/tool-feedback/di.config.js +0 -53
- package/lib/features/tool-feedback/di.config.js.map +0 -1
- package/lib/features/tool-feedback/edge-edit-tool-feedback.d.ts.map +0 -1
- package/lib/features/tool-feedback/edge-edit-tool-feedback.js.map +0 -1
- package/lib/features/tool-feedback/feedback-action-dispatcher.d.ts.map +0 -1
- package/lib/features/tool-feedback/feedback-action-dispatcher.js.map +0 -1
- package/lib/features/tool-feedback/marquee-tool-feedback.d.ts.map +0 -1
- package/lib/features/tool-feedback/marquee-tool-feedback.js.map +0 -1
- package/lib/features/tool-feedback/model.d.ts.map +0 -1
- package/lib/features/tool-feedback/model.js.map +0 -1
- package/lib/features/tool-feedback/view.d.ts +0 -16
- package/lib/features/tool-feedback/view.d.ts.map +0 -1
- package/lib/features/tool-feedback/view.js.map +0 -1
- package/lib/features/tools/change-bounds-tool.d.ts.map +0 -1
- package/lib/features/tools/change-bounds-tool.js.map +0 -1
- package/lib/features/tools/delete-tool.d.ts.map +0 -1
- package/lib/features/tools/delete-tool.js.map +0 -1
- package/lib/features/tools/di.config.d.ts.map +0 -1
- package/lib/features/tools/di.config.js +0 -66
- package/lib/features/tools/di.config.js.map +0 -1
- package/lib/features/tools/edge-creation-tool.d.ts.map +0 -1
- package/lib/features/tools/edge-creation-tool.js.map +0 -1
- package/lib/features/tools/edge-edit-tool.d.ts.map +0 -1
- package/lib/features/tools/edge-edit-tool.js.map +0 -1
- package/lib/features/tools/glsp-manhattan-edge-router.d.ts.map +0 -1
- package/lib/features/tools/glsp-manhattan-edge-router.js.map +0 -1
- package/lib/features/tools/marquee-behavior.d.ts.map +0 -1
- package/lib/features/tools/marquee-behavior.js.map +0 -1
- package/lib/features/tools/marquee-mouse-tool.d.ts.map +0 -1
- package/lib/features/tools/marquee-mouse-tool.js.map +0 -1
- package/lib/features/tools/marquee-tool.d.ts +0 -14
- package/lib/features/tools/marquee-tool.d.ts.map +0 -1
- package/lib/features/tools/marquee-tool.js.map +0 -1
- package/lib/features/tools/model.d.ts.map +0 -1
- package/lib/features/tools/model.js.map +0 -1
- package/lib/features/tools/node-creation-tool.d.ts.map +0 -1
- package/lib/features/tools/node-creation-tool.js.map +0 -1
- package/lib/features/tools/view.d.ts.map +0 -1
- package/lib/features/tools/view.js.map +0 -1
- package/src/features/tool-feedback/di.config.ts +0 -65
- package/src/features/tools/di.config.ts +0 -77
- /package/lib/features/{tools → routing}/glsp-manhattan-edge-router.d.ts +0 -0
- /package/lib/features/{tools → routing}/glsp-manhattan-edge-router.js +0 -0
- /package/src/{features/tool-feedback/model.ts → base/feedback/feedback-command.ts} +0 -0
- /package/src/features/{tools → routing}/glsp-manhattan-edge-router.ts +0 -0
- /package/src/features/tools/{marquee-behavior.spec.ts → marquee-selection/marquee-behavior.spec.ts} +0 -0
- /package/src/features/tools/{model.ts → marquee-selection/model.ts} +0 -0
- /package/src/features/tools/{view.tsx → marquee-selection/view.tsx} +0 -0
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
import { inject, injectable, optional } from 'inversify';
|
|
17
|
+
|
|
17
18
|
import {
|
|
18
19
|
Action,
|
|
19
20
|
Bounds,
|
|
@@ -22,6 +23,7 @@ import {
|
|
|
22
23
|
ChangeRoutingPointsOperation,
|
|
23
24
|
CompoundOperation,
|
|
24
25
|
Dimension,
|
|
26
|
+
Disposable,
|
|
25
27
|
EdgeRouterRegistry,
|
|
26
28
|
ElementAndBounds,
|
|
27
29
|
ElementAndRoutingPoints,
|
|
@@ -39,29 +41,29 @@ import {
|
|
|
39
41
|
findParentByFeature,
|
|
40
42
|
isSelected
|
|
41
43
|
} from '~glsp-sprotty';
|
|
42
|
-
import { DragAwareMouseListener } from '
|
|
43
|
-
import {
|
|
44
|
+
import { DragAwareMouseListener } from '../../../base/drag-aware-mouse-listener';
|
|
45
|
+
import { CursorCSS, applyCssClasses, cursorFeedbackAction, deleteCssClasses } from '../../../base/feedback/css-feedback';
|
|
46
|
+
import { ISelectionListener, SelectionService } from '../../../base/selection-service';
|
|
47
|
+
import { PointPositionUpdater } from '../../../features/change-bounds/snap';
|
|
48
|
+
import { isValidMove, isValidSize } from '../../../utils/layout-utils';
|
|
44
49
|
import {
|
|
45
50
|
calcElementAndRoutingPoints,
|
|
46
51
|
forEachElement,
|
|
47
52
|
isNonRoutableSelectedMovableBoundsAware,
|
|
48
53
|
toElementAndBounds
|
|
49
|
-
} from '
|
|
50
|
-
import { Resizable, ResizeHandleLocation, SResizeHandle, isBoundsAwareMoveable, isResizable } from '
|
|
54
|
+
} from '../../../utils/smodel-util';
|
|
55
|
+
import { Resizable, ResizeHandleLocation, SResizeHandle, isBoundsAwareMoveable, isResizable } from '../../change-bounds/model';
|
|
51
56
|
import {
|
|
52
57
|
IMovementRestrictor,
|
|
53
58
|
createMovementRestrictionFeedback,
|
|
54
59
|
removeMovementRestrictionFeedback
|
|
55
|
-
} from '
|
|
56
|
-
import {
|
|
57
|
-
import { SelectionListener, SelectionService } from '../select/selection-service';
|
|
60
|
+
} from '../../change-bounds/movement-restrictor';
|
|
61
|
+
import { BaseGLSPTool } from '../base-glsp-tool';
|
|
58
62
|
import {
|
|
59
63
|
FeedbackMoveMouseListener,
|
|
60
64
|
HideChangeBoundsToolResizeFeedbackAction,
|
|
61
65
|
ShowChangeBoundsToolResizeFeedbackAction
|
|
62
|
-
} from '
|
|
63
|
-
import { CursorCSS, applyCssClasses, cursorFeedbackAction, deleteCssClasses } from '../tool-feedback/css-feedback';
|
|
64
|
-
import { BaseGLSPTool } from './base-glsp-tool';
|
|
66
|
+
} from './change-bounds-tool-feedback';
|
|
65
67
|
|
|
66
68
|
/**
|
|
67
69
|
* The change bounds tool has the license to move multiple elements or resize a single element by implementing the ChangeBounds operation.
|
|
@@ -80,12 +82,10 @@ import { BaseGLSPTool } from './base-glsp-tool';
|
|
|
80
82
|
export class ChangeBoundsTool extends BaseGLSPTool {
|
|
81
83
|
static ID = 'glsp.change-bounds-tool';
|
|
82
84
|
|
|
83
|
-
@inject(
|
|
85
|
+
@inject(SelectionService) protected selectionService: SelectionService;
|
|
84
86
|
@inject(EdgeRouterRegistry) @optional() readonly edgeRouterRegistry?: EdgeRouterRegistry;
|
|
85
87
|
@inject(TYPES.ISnapper) @optional() readonly snapper?: ISnapper;
|
|
86
88
|
@inject(TYPES.IMovementRestrictor) @optional() readonly movementRestrictor?: IMovementRestrictor;
|
|
87
|
-
protected feedbackMoveMouseListener: MouseListener;
|
|
88
|
-
protected changeBoundsListener: MouseListener & SelectionListener;
|
|
89
89
|
|
|
90
90
|
get id(): string {
|
|
91
91
|
return ChangeBoundsTool.ID;
|
|
@@ -93,33 +93,36 @@ export class ChangeBoundsTool extends BaseGLSPTool {
|
|
|
93
93
|
|
|
94
94
|
enable(): void {
|
|
95
95
|
// install feedback move mouse listener for client-side move updates
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
const feedbackMoveMouseListener = this.createMoveMouseListener();
|
|
97
|
+
if (Disposable.is(feedbackMoveMouseListener)) {
|
|
98
|
+
this.toDisposeOnDisable.push(feedbackMoveMouseListener);
|
|
99
|
+
}
|
|
98
100
|
|
|
99
101
|
// install change bounds listener for client-side resize updates and server-side updates
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
102
|
+
const changeBoundsListener = this.createChangeBoundsListener();
|
|
103
|
+
if (Disposable.is(changeBoundsListener)) {
|
|
104
|
+
this.toDisposeOnDisable.push(changeBoundsListener);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
this.toDisposeOnDisable.push(
|
|
108
|
+
this.mouseTool.registerListener(feedbackMoveMouseListener),
|
|
109
|
+
this.mouseTool.registerListener(changeBoundsListener),
|
|
110
|
+
Disposable.create(() => this.deregisterFeedback(feedbackMoveMouseListener)),
|
|
111
|
+
Disposable.create(() => this.deregisterFeedback(changeBoundsListener, [HideChangeBoundsToolResizeFeedbackAction.create()])),
|
|
112
|
+
this.selectionService.onSelectionChanged(change => changeBoundsListener.selectionChanged(change.root, change.selectedElements))
|
|
113
|
+
);
|
|
103
114
|
}
|
|
104
115
|
|
|
105
116
|
protected createMoveMouseListener(): MouseListener {
|
|
106
117
|
return new FeedbackMoveMouseListener(this);
|
|
107
118
|
}
|
|
108
119
|
|
|
109
|
-
protected createChangeBoundsListener(): MouseListener &
|
|
120
|
+
protected createChangeBoundsListener(): MouseListener & ISelectionListener {
|
|
110
121
|
return new ChangeBoundsListener(this);
|
|
111
122
|
}
|
|
112
|
-
|
|
113
|
-
disable(): void {
|
|
114
|
-
this.mouseTool.deregister(this.changeBoundsListener);
|
|
115
|
-
this.selectionService.deregister(this.changeBoundsListener);
|
|
116
|
-
this.mouseTool.deregister(this.feedbackMoveMouseListener);
|
|
117
|
-
this.deregisterFeedback([], this.feedbackMoveMouseListener);
|
|
118
|
-
this.deregisterFeedback([HideChangeBoundsToolResizeFeedbackAction.create()], this.changeBoundsListener);
|
|
119
|
-
}
|
|
120
123
|
}
|
|
121
124
|
|
|
122
|
-
export class ChangeBoundsListener extends DragAwareMouseListener implements
|
|
125
|
+
export class ChangeBoundsListener extends DragAwareMouseListener implements ISelectionListener, Disposable {
|
|
123
126
|
static readonly CSS_CLASS_ACTIVE = 'active';
|
|
124
127
|
|
|
125
128
|
// members for calculating the correct position change
|
|
@@ -170,12 +173,12 @@ export class ChangeBoundsListener extends DragAwareMouseListener implements Sele
|
|
|
170
173
|
const resizeActions = this.handleResizeOnClient(positionUpdate);
|
|
171
174
|
actions.push(...resizeActions);
|
|
172
175
|
}
|
|
173
|
-
|
|
176
|
+
this.tool.registerFeedback(actions, this);
|
|
174
177
|
}
|
|
175
178
|
return [];
|
|
176
179
|
}
|
|
177
180
|
|
|
178
|
-
override draggingMouseUp(target: SModelElement,
|
|
181
|
+
override draggingMouseUp(target: SModelElement, _event: MouseEvent): Action[] {
|
|
179
182
|
if (this.pointPositionUpdater.isLastDragPositionUndefined()) {
|
|
180
183
|
this.resetPosition();
|
|
181
184
|
return [];
|
|
@@ -190,6 +193,7 @@ export class ChangeBoundsListener extends DragAwareMouseListener implements Sele
|
|
|
190
193
|
actions.push(...this.handleMoveOnServer(target));
|
|
191
194
|
}
|
|
192
195
|
this.resetPosition();
|
|
196
|
+
this.tool.deregisterFeedback(this, [cursorFeedbackAction(CursorCSS.DEFAULT)]);
|
|
193
197
|
return actions;
|
|
194
198
|
}
|
|
195
199
|
|
|
@@ -289,7 +293,10 @@ export class ChangeBoundsListener extends DragAwareMouseListener implements Sele
|
|
|
289
293
|
// only allow one element to have the element resize handles
|
|
290
294
|
this.activeResizeElement = moveableElement;
|
|
291
295
|
if (isResizable(this.activeResizeElement)) {
|
|
292
|
-
this.tool.
|
|
296
|
+
this.tool.registerFeedback(
|
|
297
|
+
[ShowChangeBoundsToolResizeFeedbackAction.create(this.activeResizeElement.id)],
|
|
298
|
+
this.activeResizeElement
|
|
299
|
+
);
|
|
293
300
|
}
|
|
294
301
|
return true;
|
|
295
302
|
}
|
|
@@ -313,12 +320,34 @@ export class ChangeBoundsListener extends DragAwareMouseListener implements Sele
|
|
|
313
320
|
}
|
|
314
321
|
}
|
|
315
322
|
|
|
316
|
-
|
|
323
|
+
dispose(): void {
|
|
324
|
+
this.reset(true);
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
protected reset(resetBounds = false): void {
|
|
328
|
+
this.resetFeedback(resetBounds);
|
|
329
|
+
this.resetPosition();
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
protected resetFeedback(resetBounds = false): void {
|
|
333
|
+
const resetFeedback: Action[] = [];
|
|
317
334
|
if (this.activeResizeElement && isResizable(this.activeResizeElement)) {
|
|
318
|
-
this.
|
|
335
|
+
if (this.initialBounds && this.activeResizeHandle && resetBounds) {
|
|
336
|
+
// we only reset the bounds if an active resize operation was cancelled due to the tool being disabled
|
|
337
|
+
resetFeedback.push(
|
|
338
|
+
SetBoundsAction.create([
|
|
339
|
+
{
|
|
340
|
+
elementId: this.activeResizeElement.id,
|
|
341
|
+
newPosition: this.initialBounds,
|
|
342
|
+
newSize: this.initialBounds
|
|
343
|
+
}
|
|
344
|
+
])
|
|
345
|
+
);
|
|
346
|
+
}
|
|
347
|
+
this.tool.deregisterFeedback(this.activeResizeElement, [HideChangeBoundsToolResizeFeedbackAction.create()]);
|
|
319
348
|
}
|
|
320
|
-
|
|
321
|
-
this.
|
|
349
|
+
resetFeedback.push(cursorFeedbackAction(CursorCSS.DEFAULT));
|
|
350
|
+
this.tool.deregisterFeedback(this, resetFeedback);
|
|
322
351
|
}
|
|
323
352
|
|
|
324
353
|
protected resetPosition(): void {
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2019-2023 EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
*
|
|
8
|
+
* This Source Code may also be made available under the following Secondary
|
|
9
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
* with the GNU Classpath Exception which is available at
|
|
12
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
*
|
|
14
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
+
********************************************************************************/
|
|
16
|
+
import { ContainerModule } from 'inversify';
|
|
17
|
+
import { TYPES, bindAsService, configureCommand, configureView } from '~glsp-sprotty';
|
|
18
|
+
import { SResizeHandle } from '../../../features/change-bounds/model';
|
|
19
|
+
import { ChangeBoundsTool } from './change-bounds-tool';
|
|
20
|
+
import { HideChangeBoundsToolResizeFeedbackCommand, ShowChangeBoundsToolResizeFeedbackCommand } from './change-bounds-tool-feedback';
|
|
21
|
+
import { SResizeHandleView } from './view';
|
|
22
|
+
|
|
23
|
+
const changeBoundsToolModule = new ContainerModule((bind, unbind, isBound, rebind) => {
|
|
24
|
+
const context = { bind, unbind, isBound, rebind };
|
|
25
|
+
bindAsService(context, TYPES.IDefaultTool, ChangeBoundsTool);
|
|
26
|
+
configureCommand(context, ShowChangeBoundsToolResizeFeedbackCommand);
|
|
27
|
+
configureCommand(context, HideChangeBoundsToolResizeFeedbackCommand);
|
|
28
|
+
configureView(context, SResizeHandle.TYPE, SResizeHandleView);
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
export default changeBoundsToolModule;
|
|
@@ -15,24 +15,12 @@
|
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
import { injectable } from 'inversify';
|
|
17
17
|
import { VNode } from 'snabbdom';
|
|
18
|
-
import { IView, Point, RenderingContext, setAttr,
|
|
19
|
-
import {
|
|
18
|
+
import { IView, Point, RenderingContext, setAttr, svg } from '~glsp-sprotty';
|
|
19
|
+
import { ResizeHandleLocation, SResizeHandle, isResizable } from '../../change-bounds/model';
|
|
20
20
|
|
|
21
21
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
22
22
|
const JSX = { createElement: svg };
|
|
23
23
|
|
|
24
|
-
/**
|
|
25
|
-
* This view is used for the invisible end of the feedback edge.
|
|
26
|
-
* A feedback edge is shown as a visual feedback when creating edges.
|
|
27
|
-
*/
|
|
28
|
-
@injectable()
|
|
29
|
-
export class FeedbackEdgeEndView implements IView {
|
|
30
|
-
render(model: Readonly<SModelElement>, context: RenderingContext): VNode {
|
|
31
|
-
const position: Point = (model as any).position ?? Point.ORIGIN;
|
|
32
|
-
return <g x={position.x} y={position.y} />;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
24
|
@injectable()
|
|
37
25
|
export class SResizeHandleView implements IView {
|
|
38
26
|
render(handle: SResizeHandle, context: RenderingContext): VNode {
|
|
@@ -22,17 +22,15 @@ import {
|
|
|
22
22
|
KeyTool,
|
|
23
23
|
MouseListener,
|
|
24
24
|
SModelElement,
|
|
25
|
-
TYPES,
|
|
26
25
|
findParentByFeature,
|
|
27
26
|
isCtrlOrCmd,
|
|
28
27
|
isDeletable,
|
|
29
28
|
isSelectable,
|
|
30
29
|
matchesKeystroke
|
|
31
30
|
} from '~glsp-sprotty';
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import { IFeedbackActionDispatcher } from '../tool-feedback/feedback-action-dispatcher';
|
|
31
|
+
import { CursorCSS, cursorFeedbackAction } from '../../../base/feedback/css-feedback';
|
|
32
|
+
import { GLSPTool } from '../../../base/tool-manager/glsp-tool-manager';
|
|
33
|
+
import { BaseGLSPTool } from '../base-glsp-tool';
|
|
36
34
|
|
|
37
35
|
/**
|
|
38
36
|
* Deletes selected elements when hitting the `Del` key.
|
|
@@ -82,28 +80,20 @@ export class DeleteKeyListener extends KeyListener {
|
|
|
82
80
|
* Deletes selected elements when clicking on them.
|
|
83
81
|
*/
|
|
84
82
|
@injectable()
|
|
85
|
-
export class MouseDeleteTool
|
|
83
|
+
export class MouseDeleteTool extends BaseGLSPTool {
|
|
86
84
|
static ID = 'glsp.delete-mouse';
|
|
87
85
|
|
|
88
|
-
isEditTool = true;
|
|
89
|
-
|
|
90
86
|
protected deleteToolMouseListener: DeleteToolMouseListener = new DeleteToolMouseListener();
|
|
91
87
|
|
|
92
|
-
@inject(TYPES.MouseTool) protected mouseTool: IMouseTool;
|
|
93
|
-
@inject(TYPES.IFeedbackActionDispatcher) protected readonly feedbackDispatcher: IFeedbackActionDispatcher;
|
|
94
|
-
|
|
95
88
|
get id(): string {
|
|
96
89
|
return MouseDeleteTool.ID;
|
|
97
90
|
}
|
|
98
91
|
|
|
99
92
|
enable(): void {
|
|
100
|
-
this.
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
disable(): void {
|
|
105
|
-
this.mouseTool.deregister(this.deleteToolMouseListener);
|
|
106
|
-
this.feedbackDispatcher.registerFeedback(this, [cursorFeedbackAction()]);
|
|
93
|
+
this.toDisposeOnDisable.push(
|
|
94
|
+
this.mouseTool.registerListener(this.deleteToolMouseListener),
|
|
95
|
+
this.registerFeedback([cursorFeedbackAction(CursorCSS.ELEMENT_DELETION)], this, [cursorFeedbackAction()])
|
|
96
|
+
);
|
|
107
97
|
}
|
|
108
98
|
}
|
|
109
99
|
|
|
@@ -14,13 +14,13 @@
|
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
import { ContainerModule } from 'inversify';
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
17
|
+
import { TYPES, bindAsService } from '~glsp-sprotty';
|
|
18
|
+
import { DelKeyDeleteTool, MouseDeleteTool } from './delete-tool';
|
|
19
19
|
|
|
20
|
-
const
|
|
21
|
-
bind
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
const deletionToolModule = new ContainerModule((bind, unbind, isBound, rebind) => {
|
|
21
|
+
const context = { bind, unbind, isBound, rebind };
|
|
22
|
+
bindAsService(context, TYPES.IDefaultTool, DelKeyDeleteTool);
|
|
23
|
+
bindAsService(context, TYPES.ITool, MouseDeleteTool);
|
|
24
24
|
});
|
|
25
25
|
|
|
26
|
-
export default
|
|
26
|
+
export default deletionToolModule;
|
|
@@ -16,30 +16,26 @@
|
|
|
16
16
|
import { inject, injectable } from 'inversify';
|
|
17
17
|
import {
|
|
18
18
|
Action,
|
|
19
|
-
|
|
20
|
-
Bounds,
|
|
19
|
+
BindingContext,
|
|
21
20
|
CommandExecutionContext,
|
|
22
21
|
CommandReturn,
|
|
23
|
-
MouseListener,
|
|
24
|
-
MoveAction,
|
|
25
|
-
Point,
|
|
26
|
-
PolylineEdgeRouter,
|
|
27
22
|
SChildElement,
|
|
28
|
-
SConnectableElement,
|
|
29
23
|
SDanglingAnchor,
|
|
30
24
|
SEdgeSchema,
|
|
31
|
-
SModelElement,
|
|
32
25
|
SModelRoot,
|
|
33
26
|
SRoutableElement,
|
|
34
27
|
TYPES,
|
|
35
|
-
|
|
28
|
+
configureCommand,
|
|
29
|
+
configureView,
|
|
36
30
|
findParentByFeature,
|
|
37
31
|
isBoundsAware,
|
|
38
32
|
isConnectable
|
|
39
33
|
} from '~glsp-sprotty';
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
34
|
+
import { FeedbackCommand } from '../../../base/feedback/feedback-command';
|
|
35
|
+
import { isRoutable } from '../../../utils/smodel-util';
|
|
36
|
+
import { toAbsolutePosition } from '../../../utils/viewpoint-util';
|
|
37
|
+
import { FeedbackEdgeEndView } from './view';
|
|
38
|
+
|
|
43
39
|
export interface DrawFeedbackEdgeAction extends Action {
|
|
44
40
|
kind: typeof DrawFeedbackEdgeAction.KIND;
|
|
45
41
|
elementTypeId: string;
|
|
@@ -101,7 +97,7 @@ export class RemoveFeedbackEdgeCommand extends FeedbackCommand {
|
|
|
101
97
|
static readonly KIND = RemoveFeedbackEdgeAction.KIND;
|
|
102
98
|
|
|
103
99
|
execute(context: CommandExecutionContext): CommandReturn {
|
|
104
|
-
|
|
100
|
+
removeDanglingFeedbackEdge(context.root);
|
|
105
101
|
return context.root;
|
|
106
102
|
}
|
|
107
103
|
}
|
|
@@ -118,80 +114,6 @@ export class FeedbackEdgeEnd extends SDanglingAnchor {
|
|
|
118
114
|
}
|
|
119
115
|
}
|
|
120
116
|
|
|
121
|
-
export class FeedbackEdgeEndMovingMouseListener extends MouseListener {
|
|
122
|
-
constructor(protected anchorRegistry: AnchorComputerRegistry) {
|
|
123
|
-
super();
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
override mouseMove(target: SModelElement, event: MouseEvent): Action[] {
|
|
127
|
-
const root = target.root;
|
|
128
|
-
const edgeEnd = root.index.getById(feedbackEdgeEndId(root));
|
|
129
|
-
if (!(edgeEnd instanceof FeedbackEdgeEnd) || !edgeEnd.feedbackEdge) {
|
|
130
|
-
return [];
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
const edge = edgeEnd.feedbackEdge;
|
|
134
|
-
const position = getAbsolutePosition(edgeEnd, event);
|
|
135
|
-
const endAtMousePosition = findChildrenAtPosition(target.root, position)
|
|
136
|
-
.reverse()
|
|
137
|
-
.find(element => isConnectable(element) && element.canConnect(edge, 'target'));
|
|
138
|
-
|
|
139
|
-
if (endAtMousePosition instanceof SConnectableElement && edge.source && isBoundsAware(edge.source)) {
|
|
140
|
-
const anchor = this.computeAbsoluteAnchor(endAtMousePosition, Bounds.center(toAbsoluteBounds(edge.source)));
|
|
141
|
-
if (Point.euclideanDistance(anchor, edgeEnd.position) > 1) {
|
|
142
|
-
return [MoveAction.create([{ elementId: edgeEnd.id, toPosition: anchor }], { animate: false })];
|
|
143
|
-
}
|
|
144
|
-
} else {
|
|
145
|
-
return [MoveAction.create([{ elementId: edgeEnd.id, toPosition: position }], { animate: false })];
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
return [];
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
protected computeAbsoluteAnchor(element: SConnectableElement, absoluteReferencePoint: Point, offset?: number): Point {
|
|
152
|
-
const referencePointInParent = absoluteToParent(element, absoluteReferencePoint);
|
|
153
|
-
const anchorComputer = this.anchorRegistry.get(PolylineEdgeRouter.KIND, element.anchorKind);
|
|
154
|
-
let anchor = anchorComputer.getAnchor(element, referencePointInParent, offset);
|
|
155
|
-
// The anchor is computed in the local coordinate system of the element.
|
|
156
|
-
// If the element is a nested child element we have to add the absolute position of its parent to the anchor.
|
|
157
|
-
if (element.parent !== element.root) {
|
|
158
|
-
const parent = findParentByFeature(element.parent, isBoundsAware);
|
|
159
|
-
if (parent) {
|
|
160
|
-
const absoluteParentPosition = toAbsoluteBounds(parent);
|
|
161
|
-
anchor = Point.add(absoluteParentPosition, anchor);
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
return anchor;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
/**
|
|
169
|
-
* Convert a point, specified in absolute coordinates, to a point relative
|
|
170
|
-
* to the parent of the specified child element.
|
|
171
|
-
* @param element the child element
|
|
172
|
-
* @param absolutePoint a point in absolute coordinates
|
|
173
|
-
* @returns the equivalent point, relative to the element's parent coordinates
|
|
174
|
-
*/
|
|
175
|
-
function absoluteToParent(element: BoundsAwareModelElement & SChildElement, absolutePoint: Point): Point {
|
|
176
|
-
if (isBoundsAware(element.parent)) {
|
|
177
|
-
return absoluteToLocal(element.parent, absolutePoint);
|
|
178
|
-
}
|
|
179
|
-
// If the parent is not bounds-aware, assume it's at 0; 0 and proceed
|
|
180
|
-
return absoluteToLocal(element, absolutePoint);
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
/**
|
|
184
|
-
* Convert a point, specified in absolute coordinates, to a point relative
|
|
185
|
-
* to the specified element.
|
|
186
|
-
* @param element the element
|
|
187
|
-
* @param absolutePoint a point in absolute coordinates
|
|
188
|
-
* @returns the equivalent point, relative to the element's coordinates
|
|
189
|
-
*/
|
|
190
|
-
function absoluteToLocal(element: BoundsAwareModelElement, absolutePoint: Point): Point {
|
|
191
|
-
const absoluteElementBounds = toAbsoluteBounds(element);
|
|
192
|
-
return { x: absolutePoint.x - absoluteElementBounds.x, y: absolutePoint.y - absoluteElementBounds.y };
|
|
193
|
-
}
|
|
194
|
-
|
|
195
117
|
export function feedbackEdgeId(root: SModelRoot): string {
|
|
196
118
|
return root.id + '_feedback_edge';
|
|
197
119
|
}
|
|
@@ -243,7 +165,7 @@ export function drawFeedbackEdge(
|
|
|
243
165
|
}
|
|
244
166
|
}
|
|
245
167
|
|
|
246
|
-
export function
|
|
168
|
+
export function removeDanglingFeedbackEdge(root: SModelRoot): void {
|
|
247
169
|
const feedbackEdge = root.index.getById(feedbackEdgeId(root));
|
|
248
170
|
const feedbackEdgeEnd = root.index.getById(feedbackEdgeEndId(root));
|
|
249
171
|
if (feedbackEdge instanceof SChildElement) {
|
|
@@ -253,3 +175,11 @@ export function removeFeedbackEdge(root: SModelRoot): void {
|
|
|
253
175
|
root.remove(feedbackEdgeEnd);
|
|
254
176
|
}
|
|
255
177
|
}
|
|
178
|
+
|
|
179
|
+
export function configureDanglingFeedbackEdge(context: BindingContext): void {
|
|
180
|
+
if (!context.isBound(DrawFeedbackEdgeCommand) && !context.isBound(RemoveFeedbackEdgeCommand) && !context.isBound(FeedbackEdgeEndView)) {
|
|
181
|
+
configureCommand(context, DrawFeedbackEdgeCommand);
|
|
182
|
+
configureCommand(context, RemoveFeedbackEdgeCommand);
|
|
183
|
+
configureView(context, FeedbackEdgeEnd.TYPE, FeedbackEdgeEndView);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2019-2023 EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
*
|
|
8
|
+
* This Source Code may also be made available under the following Secondary
|
|
9
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
* with the GNU Classpath Exception which is available at
|
|
12
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
*
|
|
14
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
+
********************************************************************************/
|
|
16
|
+
import { ContainerModule } from 'inversify';
|
|
17
|
+
import { TYPES, TriggerEdgeCreationAction, bindAsService, configureActionHandler } from '~glsp-sprotty';
|
|
18
|
+
import { configureDanglingFeedbackEdge } from './dangling-edge-feedback';
|
|
19
|
+
import { EdgeCreationTool } from './edge-creation-tool';
|
|
20
|
+
|
|
21
|
+
const edgeCreationToolModule = new ContainerModule((bind, unbind, isBound, rebind) => {
|
|
22
|
+
const context = { bind, unbind, isBound, rebind };
|
|
23
|
+
bindAsService(context, TYPES.ITool, EdgeCreationTool);
|
|
24
|
+
configureActionHandler(context, TriggerEdgeCreationAction.KIND, EdgeCreationTool);
|
|
25
|
+
configureDanglingFeedbackEdge(context);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export default edgeCreationToolModule;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2019-2023 EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
*
|
|
8
|
+
* This Source Code may also be made available under the following Secondary
|
|
9
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
* with the GNU Classpath Exception which is available at
|
|
12
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
*
|
|
14
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
+
********************************************************************************/
|
|
16
|
+
import {
|
|
17
|
+
Action,
|
|
18
|
+
AnchorComputerRegistry,
|
|
19
|
+
Bounds,
|
|
20
|
+
Disposable,
|
|
21
|
+
MouseListener,
|
|
22
|
+
MoveAction,
|
|
23
|
+
Point,
|
|
24
|
+
PolylineEdgeRouter,
|
|
25
|
+
SConnectableElement,
|
|
26
|
+
SModelElement,
|
|
27
|
+
findChildrenAtPosition,
|
|
28
|
+
findParentByFeature,
|
|
29
|
+
isBoundsAware,
|
|
30
|
+
isConnectable
|
|
31
|
+
} from '~glsp-sprotty';
|
|
32
|
+
import { IFeedbackActionDispatcher } from '../../../base/feedback/feedback-action-dispatcher';
|
|
33
|
+
import { absoluteToParent, getAbsolutePosition, toAbsoluteBounds } from '../../../utils/viewpoint-util';
|
|
34
|
+
import { FeedbackEdgeEnd, feedbackEdgeEndId } from './dangling-edge-feedback';
|
|
35
|
+
|
|
36
|
+
export class FeedbackEdgeEndMovingMouseListener extends MouseListener implements Disposable {
|
|
37
|
+
constructor(protected anchorRegistry: AnchorComputerRegistry, protected feedbackDispatcher: IFeedbackActionDispatcher) {
|
|
38
|
+
super();
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
override mouseMove(target: SModelElement, event: MouseEvent): Action[] {
|
|
42
|
+
const root = target.root;
|
|
43
|
+
const edgeEnd = root.index.getById(feedbackEdgeEndId(root));
|
|
44
|
+
if (!(edgeEnd instanceof FeedbackEdgeEnd) || !edgeEnd.feedbackEdge) {
|
|
45
|
+
return [];
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const edge = edgeEnd.feedbackEdge;
|
|
49
|
+
const position = getAbsolutePosition(edgeEnd, event);
|
|
50
|
+
const endAtMousePosition = findChildrenAtPosition(target.root, position)
|
|
51
|
+
.reverse()
|
|
52
|
+
.find(element => isConnectable(element) && element.canConnect(edge, 'target'));
|
|
53
|
+
|
|
54
|
+
if (endAtMousePosition instanceof SConnectableElement && edge.source && isBoundsAware(edge.source)) {
|
|
55
|
+
const anchor = this.computeAbsoluteAnchor(endAtMousePosition, Bounds.center(toAbsoluteBounds(edge.source)));
|
|
56
|
+
if (Point.euclideanDistance(anchor, edgeEnd.position) > 1) {
|
|
57
|
+
this.feedbackDispatcher.registerFeedback(this, [
|
|
58
|
+
MoveAction.create([{ elementId: edgeEnd.id, toPosition: anchor }], { animate: false })
|
|
59
|
+
]);
|
|
60
|
+
}
|
|
61
|
+
} else {
|
|
62
|
+
this.feedbackDispatcher.registerFeedback(this, [
|
|
63
|
+
MoveAction.create([{ elementId: edgeEnd.id, toPosition: position }], { animate: false })
|
|
64
|
+
]);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return [];
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
protected computeAbsoluteAnchor(element: SConnectableElement, absoluteReferencePoint: Point, offset?: number): Point {
|
|
71
|
+
const referencePointInParent = absoluteToParent(element, absoluteReferencePoint);
|
|
72
|
+
const anchorComputer = this.anchorRegistry.get(PolylineEdgeRouter.KIND, element.anchorKind);
|
|
73
|
+
let anchor = anchorComputer.getAnchor(element, referencePointInParent, offset);
|
|
74
|
+
// The anchor is computed in the local coordinate system of the element.
|
|
75
|
+
// If the element is a nested child element we have to add the absolute position of its parent to the anchor.
|
|
76
|
+
if (element.parent !== element.root) {
|
|
77
|
+
const parent = findParentByFeature(element.parent, isBoundsAware);
|
|
78
|
+
if (parent) {
|
|
79
|
+
const absoluteParentPosition = toAbsoluteBounds(parent);
|
|
80
|
+
anchor = Point.add(absoluteParentPosition, anchor);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return anchor;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
dispose(): void {
|
|
87
|
+
this.feedbackDispatcher.deregisterFeedback(this);
|
|
88
|
+
}
|
|
89
|
+
}
|