@eclipse-glsp/client 2.1.0-next.301 → 2.1.0-next.302
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/glsp-sprotty.css +1 -0
- package/css/helper-lines.css +33 -0
- package/lib/base/auto-complete/index.d.ts +21 -0
- package/lib/base/auto-complete/index.d.ts.map +1 -0
- package/lib/base/auto-complete/index.js +37 -0
- package/lib/base/auto-complete/index.js.map +1 -0
- package/lib/base/feedback/index.d.ts +20 -0
- package/lib/base/feedback/index.d.ts.map +1 -0
- package/lib/base/feedback/index.js +36 -0
- package/lib/base/feedback/index.js.map +1 -0
- package/lib/base/focus/index.d.ts +18 -0
- package/lib/base/focus/index.d.ts.map +1 -0
- package/lib/base/focus/index.js +34 -0
- package/lib/base/focus/index.js.map +1 -0
- package/lib/base/index.d.ts +32 -0
- package/lib/base/index.d.ts.map +1 -0
- package/lib/base/index.js +48 -0
- package/lib/base/index.js.map +1 -0
- package/lib/base/model/index.d.ts +20 -0
- package/lib/base/model/index.d.ts.map +1 -0
- package/lib/base/model/index.js +36 -0
- package/lib/base/model/index.js.map +1 -0
- package/lib/base/tool-manager/index.d.ts +18 -0
- package/lib/base/tool-manager/index.d.ts.map +1 -0
- package/lib/base/tool-manager/index.js +34 -0
- package/lib/base/tool-manager/index.js.map +1 -0
- package/lib/base/view/index.d.ts +19 -0
- package/lib/base/view/index.d.ts.map +1 -0
- package/lib/base/view/index.js +35 -0
- package/lib/base/view/index.js.map +1 -0
- package/lib/default-modules.js +4 -4
- package/lib/default-modules.js.map +1 -1
- package/lib/features/accessibility/edge-autocomplete/index.d.ts +20 -0
- package/lib/features/accessibility/edge-autocomplete/index.d.ts.map +1 -0
- package/lib/features/accessibility/edge-autocomplete/index.js +36 -0
- package/lib/features/accessibility/edge-autocomplete/index.js.map +1 -0
- package/lib/features/accessibility/element-navigation/index.d.ts +22 -0
- package/lib/features/accessibility/element-navigation/index.d.ts.map +1 -0
- package/lib/features/accessibility/element-navigation/index.js +38 -0
- package/lib/features/accessibility/element-navigation/index.js.map +1 -0
- package/lib/features/accessibility/focus-tracker/index.d.ts +18 -0
- package/lib/features/accessibility/focus-tracker/index.d.ts.map +1 -0
- package/lib/features/accessibility/focus-tracker/index.js +34 -0
- package/lib/features/accessibility/focus-tracker/index.js.map +1 -0
- package/lib/features/accessibility/index.d.ts +31 -0
- package/lib/features/accessibility/index.d.ts.map +1 -0
- package/lib/features/accessibility/index.js +47 -0
- package/lib/features/accessibility/index.js.map +1 -0
- package/lib/features/accessibility/key-shortcut/index.d.ts +19 -0
- package/lib/features/accessibility/key-shortcut/index.d.ts.map +1 -0
- package/lib/features/accessibility/key-shortcut/index.js +35 -0
- package/lib/features/accessibility/key-shortcut/index.js.map +1 -0
- package/lib/features/accessibility/keyboard-grid/index.d.ts +21 -0
- package/lib/features/accessibility/keyboard-grid/index.d.ts.map +1 -0
- package/lib/features/accessibility/keyboard-grid/index.js +37 -0
- package/lib/features/accessibility/keyboard-grid/index.js.map +1 -0
- package/lib/features/accessibility/keyboard-pointer/index.d.ts +22 -0
- package/lib/features/accessibility/keyboard-pointer/index.d.ts.map +1 -0
- package/lib/features/accessibility/keyboard-pointer/index.js +38 -0
- package/lib/features/accessibility/keyboard-pointer/index.js.map +1 -0
- package/lib/features/accessibility/keyboard-tool-palette/index.d.ts +18 -0
- package/lib/features/accessibility/keyboard-tool-palette/index.d.ts.map +1 -0
- package/lib/features/accessibility/keyboard-tool-palette/index.js +34 -0
- package/lib/features/accessibility/keyboard-tool-palette/index.js.map +1 -0
- package/lib/features/accessibility/move-zoom/index.d.ts +19 -0
- package/lib/features/accessibility/move-zoom/index.d.ts.map +1 -0
- package/lib/features/accessibility/move-zoom/index.js +35 -0
- package/lib/features/accessibility/move-zoom/index.js.map +1 -0
- package/lib/features/accessibility/resize-key-tool/index.d.ts +19 -0
- package/lib/features/accessibility/resize-key-tool/index.d.ts.map +1 -0
- package/lib/features/accessibility/resize-key-tool/index.js +35 -0
- package/lib/features/accessibility/resize-key-tool/index.js.map +1 -0
- package/lib/features/accessibility/search/index.d.ts +19 -0
- package/lib/features/accessibility/search/index.d.ts.map +1 -0
- package/lib/features/accessibility/search/index.js +35 -0
- package/lib/features/accessibility/search/index.js.map +1 -0
- package/lib/features/accessibility/toast/index.d.ts +19 -0
- package/lib/features/accessibility/toast/index.d.ts.map +1 -0
- package/lib/features/accessibility/toast/index.js +35 -0
- package/lib/features/accessibility/toast/index.js.map +1 -0
- package/lib/features/accessibility/view-key-tools/index.d.ts +20 -0
- package/lib/features/accessibility/view-key-tools/index.d.ts.map +1 -0
- package/lib/features/accessibility/view-key-tools/index.js +36 -0
- package/lib/features/accessibility/view-key-tools/index.js.map +1 -0
- package/lib/features/accessibility/view-key-tools/movement-key-tool.d.ts +6 -3
- package/lib/features/accessibility/view-key-tools/movement-key-tool.d.ts.map +1 -1
- package/lib/features/accessibility/view-key-tools/movement-key-tool.js +12 -17
- package/lib/features/accessibility/view-key-tools/movement-key-tool.js.map +1 -1
- package/lib/features/bounds/bounds-module.d.ts.map +1 -1
- package/lib/features/bounds/bounds-module.js +3 -1
- package/lib/features/bounds/bounds-module.js.map +1 -1
- package/lib/features/bounds/index.d.ts +24 -0
- package/lib/features/bounds/index.d.ts.map +1 -0
- package/lib/features/bounds/index.js +40 -0
- package/lib/features/bounds/index.js.map +1 -0
- package/lib/features/bounds/local-bounds.d.ts +2 -1
- package/lib/features/bounds/local-bounds.d.ts.map +1 -1
- package/lib/features/bounds/local-bounds.js +7 -0
- package/lib/features/bounds/local-bounds.js.map +1 -1
- package/lib/features/bounds/set-bounds-feedback-command.d.ts +1 -1
- package/lib/features/bounds/set-bounds-feedback-command.d.ts.map +1 -1
- package/lib/features/bounds/set-bounds-feedback-command.js +7 -7
- package/lib/features/bounds/set-bounds-feedback-command.js.map +1 -1
- package/lib/features/change-bounds/index.d.ts +21 -0
- package/lib/features/change-bounds/index.d.ts.map +1 -0
- package/lib/features/change-bounds/index.js +37 -0
- package/lib/features/change-bounds/index.js.map +1 -0
- package/lib/features/change-bounds/model.d.ts +4 -0
- package/lib/features/change-bounds/model.d.ts.map +1 -1
- package/lib/features/change-bounds/model.js +14 -2
- package/lib/features/change-bounds/model.js.map +1 -1
- package/lib/features/change-bounds/point-position-updater.d.ts +63 -0
- package/lib/features/change-bounds/point-position-updater.d.ts.map +1 -0
- package/lib/features/change-bounds/point-position-updater.js +87 -0
- package/lib/features/change-bounds/point-position-updater.js.map +1 -0
- package/lib/features/change-bounds/position-snapper.d.ts +28 -0
- package/lib/features/change-bounds/position-snapper.d.ts.map +1 -0
- package/lib/features/change-bounds/position-snapper.js +88 -0
- package/lib/features/change-bounds/position-snapper.js.map +1 -0
- package/lib/features/change-bounds/snap.d.ts +19 -42
- package/lib/features/change-bounds/snap.d.ts.map +1 -1
- package/lib/features/change-bounds/snap.js +9 -92
- package/lib/features/change-bounds/snap.js.map +1 -1
- package/lib/features/change-bounds/snap.spec.js +6 -5
- package/lib/features/change-bounds/snap.spec.js.map +1 -1
- package/lib/features/command-palette/index.d.ts +19 -0
- package/lib/features/command-palette/index.d.ts.map +1 -0
- package/lib/features/command-palette/index.js +35 -0
- package/lib/features/command-palette/index.js.map +1 -0
- package/lib/features/context-menu/index.d.ts +20 -0
- package/lib/features/context-menu/index.d.ts.map +1 -0
- package/lib/features/context-menu/index.js +36 -0
- package/lib/features/context-menu/index.js.map +1 -0
- package/lib/features/copy-paste/index.d.ts +20 -0
- package/lib/features/copy-paste/index.d.ts.map +1 -0
- package/lib/features/copy-paste/index.js +36 -0
- package/lib/features/copy-paste/index.js.map +1 -0
- package/lib/features/decoration/index.d.ts +18 -0
- package/lib/features/decoration/index.d.ts.map +1 -0
- package/lib/features/decoration/index.js +34 -0
- package/lib/features/decoration/index.js.map +1 -0
- package/lib/features/element-template/index.d.ts +20 -0
- package/lib/features/element-template/index.d.ts.map +1 -0
- package/lib/features/element-template/index.js +36 -0
- package/lib/features/element-template/index.js.map +1 -0
- package/lib/features/element-template/mouse-tracking-element-position-listener.d.ts +6 -3
- 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 +23 -18
- package/lib/features/element-template/mouse-tracking-element-position-listener.js.map +1 -1
- package/lib/features/export/index.d.ts +19 -0
- package/lib/features/export/index.d.ts.map +1 -0
- package/lib/features/export/index.js +35 -0
- package/lib/features/export/index.js.map +1 -0
- package/lib/features/helper-lines/helper-line-feedback.d.ts +64 -0
- package/lib/features/helper-lines/helper-line-feedback.d.ts.map +1 -0
- package/lib/features/helper-lines/helper-line-feedback.js +218 -0
- package/lib/features/helper-lines/helper-line-feedback.js.map +1 -0
- package/lib/features/helper-lines/helper-line-manager-default.d.ts +46 -0
- package/lib/features/helper-lines/helper-line-manager-default.d.ts.map +1 -0
- package/lib/features/helper-lines/helper-line-manager-default.js +122 -0
- package/lib/features/helper-lines/helper-line-manager-default.js.map +1 -0
- package/lib/features/helper-lines/helper-line-manager.d.ts +21 -0
- package/lib/features/helper-lines/helper-line-manager.d.ts.map +1 -0
- package/lib/features/helper-lines/helper-line-manager.js +3 -0
- package/lib/features/helper-lines/helper-line-manager.js.map +1 -0
- package/lib/features/helper-lines/helper-line-module.d.ts +18 -0
- package/lib/features/helper-lines/helper-line-module.d.ts.map +1 -0
- package/lib/features/helper-lines/helper-line-module.js +39 -0
- package/lib/features/helper-lines/helper-line-module.js.map +1 -0
- package/lib/features/helper-lines/index.d.ts +22 -0
- package/lib/features/helper-lines/index.d.ts.map +1 -0
- package/lib/features/helper-lines/index.js +38 -0
- package/lib/features/helper-lines/index.js.map +1 -0
- package/lib/features/helper-lines/model.d.ts +62 -0
- package/lib/features/helper-lines/model.d.ts.map +1 -0
- package/lib/features/helper-lines/model.js +123 -0
- package/lib/features/helper-lines/model.js.map +1 -0
- package/lib/features/helper-lines/view.d.ts +25 -0
- package/lib/features/helper-lines/view.d.ts.map +1 -0
- package/lib/features/helper-lines/view.js +52 -0
- package/lib/features/helper-lines/view.js.map +1 -0
- package/lib/features/hints/index.d.ts +19 -0
- package/lib/features/hints/index.d.ts.map +1 -0
- package/lib/features/hints/index.js +35 -0
- package/lib/features/hints/index.js.map +1 -0
- package/lib/features/hover/index.d.ts +18 -0
- package/lib/features/hover/index.d.ts.map +1 -0
- package/lib/features/hover/index.js +34 -0
- package/lib/features/hover/index.js.map +1 -0
- package/lib/features/index.d.ts +43 -0
- package/lib/features/index.d.ts.map +1 -0
- package/lib/features/index.js +59 -0
- package/lib/features/index.js.map +1 -0
- package/lib/features/label-edit/index.d.ts +19 -0
- package/lib/features/label-edit/index.d.ts.map +1 -0
- package/lib/features/label-edit/index.js +35 -0
- package/lib/features/label-edit/index.js.map +1 -0
- package/lib/features/layout/index.d.ts +18 -0
- package/lib/features/layout/index.d.ts.map +1 -0
- package/lib/features/layout/index.js +34 -0
- package/lib/features/layout/index.js.map +1 -0
- package/lib/features/navigation/index.d.ts +19 -0
- package/lib/features/navigation/index.d.ts.map +1 -0
- package/lib/features/navigation/index.js +35 -0
- package/lib/features/navigation/index.js.map +1 -0
- package/lib/features/reconnect/index.d.ts +17 -0
- package/lib/features/reconnect/index.d.ts.map +1 -0
- package/lib/features/reconnect/index.js +33 -0
- package/lib/features/reconnect/index.js.map +1 -0
- package/lib/features/routing/index.d.ts +18 -0
- package/lib/features/routing/index.d.ts.map +1 -0
- package/lib/features/routing/index.js +34 -0
- package/lib/features/routing/index.js.map +1 -0
- package/lib/features/save/index.d.ts +18 -0
- package/lib/features/save/index.d.ts.map +1 -0
- package/lib/features/save/index.js +34 -0
- package/lib/features/save/index.js.map +1 -0
- package/lib/features/select/index.d.ts +19 -0
- package/lib/features/select/index.d.ts.map +1 -0
- package/lib/features/select/index.js +35 -0
- package/lib/features/select/index.js.map +1 -0
- package/lib/features/source-model-watcher/index.d.ts +18 -0
- package/lib/features/source-model-watcher/index.d.ts.map +1 -0
- package/lib/features/source-model-watcher/index.js +34 -0
- package/lib/features/source-model-watcher/index.js.map +1 -0
- package/lib/features/source-model-watcher/{source-model-wacher-module.d.ts → source-model-watcher-module.d.ts} +1 -1
- package/lib/features/source-model-watcher/source-model-watcher-module.d.ts.map +1 -0
- package/lib/features/source-model-watcher/{source-model-wacher-module.js → source-model-watcher-module.js} +1 -1
- package/lib/features/source-model-watcher/source-model-watcher-module.js.map +1 -0
- package/lib/features/status/index.d.ts +18 -0
- package/lib/features/status/index.d.ts.map +1 -0
- package/lib/features/status/index.js +34 -0
- package/lib/features/status/index.js.map +1 -0
- package/lib/features/svg-metadata/index.d.ts +18 -0
- package/lib/features/svg-metadata/index.d.ts.map +1 -0
- package/lib/features/svg-metadata/index.js +34 -0
- package/lib/features/svg-metadata/index.js.map +1 -0
- package/lib/features/tool-palette/index.d.ts +18 -0
- package/lib/features/tool-palette/index.d.ts.map +1 -0
- package/lib/features/tool-palette/index.js +34 -0
- package/lib/features/tool-palette/index.js.map +1 -0
- package/lib/features/tools/change-bounds/change-bounds-tool-feedback.d.ts +28 -12
- 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 +91 -51
- package/lib/features/tools/change-bounds/change-bounds-tool-feedback.js.map +1 -1
- package/lib/features/tools/change-bounds/{change-boounds-tool-module.d.ts → change-bounds-tool-module.d.ts} +1 -1
- package/lib/features/tools/change-bounds/change-bounds-tool-module.d.ts.map +1 -0
- package/lib/features/tools/change-bounds/{change-boounds-tool-module.js → change-bounds-tool-module.js} +1 -1
- package/lib/features/tools/change-bounds/change-bounds-tool-module.js.map +1 -0
- package/lib/features/tools/change-bounds/change-bounds-tool.d.ts +4 -4
- package/lib/features/tools/change-bounds/change-bounds-tool.d.ts.map +1 -1
- package/lib/features/tools/change-bounds/change-bounds-tool.js +11 -13
- package/lib/features/tools/change-bounds/change-bounds-tool.js.map +1 -1
- package/lib/features/tools/change-bounds/index.d.ts +20 -0
- package/lib/features/tools/change-bounds/index.d.ts.map +1 -0
- package/lib/features/tools/change-bounds/index.js +36 -0
- package/lib/features/tools/change-bounds/index.js.map +1 -0
- package/lib/features/tools/deletion/index.d.ts +18 -0
- package/lib/features/tools/deletion/index.d.ts.map +1 -0
- package/lib/features/tools/deletion/index.js +34 -0
- package/lib/features/tools/deletion/index.js.map +1 -0
- package/lib/features/tools/edge-creation/index.d.ts +21 -0
- package/lib/features/tools/edge-creation/index.d.ts.map +1 -0
- package/lib/features/tools/edge-creation/index.js +37 -0
- package/lib/features/tools/edge-creation/index.js.map +1 -0
- package/lib/features/tools/edge-edit/edge-edit-tool-feedback.d.ts +20 -6
- 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 +10 -14
- 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 +18 -2
- package/lib/features/tools/edge-edit/edge-edit-tool.d.ts.map +1 -1
- package/lib/features/tools/edge-edit/edge-edit-tool.js +6 -6
- package/lib/features/tools/edge-edit/edge-edit-tool.js.map +1 -1
- package/lib/features/tools/edge-edit/index.d.ts +19 -0
- package/lib/features/tools/edge-edit/index.d.ts.map +1 -0
- package/lib/features/tools/edge-edit/index.js +35 -0
- package/lib/features/tools/edge-edit/index.js.map +1 -0
- package/lib/features/tools/index.d.ts +24 -0
- package/lib/features/tools/index.d.ts.map +1 -0
- package/lib/features/tools/index.js +40 -0
- package/lib/features/tools/index.js.map +1 -0
- package/lib/features/tools/marquee-selection/index.d.ts +23 -0
- package/lib/features/tools/marquee-selection/index.d.ts.map +1 -0
- package/lib/features/tools/marquee-selection/index.js +39 -0
- package/lib/features/tools/marquee-selection/index.js.map +1 -0
- package/lib/features/tools/marquee-selection/marquee-tool.d.ts +20 -1
- package/lib/features/tools/marquee-selection/marquee-tool.d.ts.map +1 -1
- package/lib/features/tools/marquee-selection/marquee-tool.js +19 -7
- package/lib/features/tools/marquee-selection/marquee-tool.js.map +1 -1
- package/lib/features/tools/node-creation/index.d.ts +18 -0
- package/lib/features/tools/node-creation/index.d.ts.map +1 -0
- package/lib/features/tools/node-creation/index.js +34 -0
- package/lib/features/tools/node-creation/index.js.map +1 -0
- package/lib/features/tools/node-creation/node-creation-tool.d.ts +3 -2
- package/lib/features/tools/node-creation/node-creation-tool.d.ts.map +1 -1
- package/lib/features/tools/node-creation/node-creation-tool.js +11 -15
- package/lib/features/tools/node-creation/node-creation-tool.js.map +1 -1
- package/lib/features/undo-redo/index.d.ts +18 -0
- package/lib/features/undo-redo/index.d.ts.map +1 -0
- package/lib/features/undo-redo/index.js +34 -0
- package/lib/features/undo-redo/index.js.map +1 -0
- package/lib/features/validation/index.d.ts +20 -0
- package/lib/features/validation/index.d.ts.map +1 -0
- package/lib/features/validation/index.js +36 -0
- package/lib/features/validation/index.js.map +1 -0
- package/lib/features/viewport/index.d.ts +20 -0
- package/lib/features/viewport/index.d.ts.map +1 -0
- package/lib/features/viewport/index.js +36 -0
- package/lib/features/viewport/index.js.map +1 -0
- package/lib/index.d.ts +5 -139
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +19 -157
- package/lib/index.js.map +1 -1
- package/lib/re-exports.d.ts +17 -0
- package/lib/re-exports.d.ts.map +1 -0
- package/lib/re-exports.js +33 -0
- package/lib/re-exports.js.map +1 -0
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/utils/geometry-util.d.ts +38 -0
- package/lib/utils/geometry-util.d.ts.map +1 -0
- package/lib/utils/geometry-util.js +103 -0
- package/lib/utils/geometry-util.js.map +1 -0
- package/lib/utils/gmodel-util.d.ts +3 -1
- package/lib/utils/gmodel-util.d.ts.map +1 -1
- package/lib/utils/gmodel-util.js +27 -1
- package/lib/utils/gmodel-util.js.map +1 -1
- package/lib/utils/html-utils.d.ts +1 -15
- package/lib/utils/html-utils.d.ts.map +1 -1
- package/lib/utils/html-utils.js +6 -1
- package/lib/utils/html-utils.js.map +1 -1
- package/lib/utils/index.d.ts +23 -0
- package/lib/utils/index.d.ts.map +1 -0
- package/lib/utils/index.js +39 -0
- package/lib/utils/index.js.map +1 -0
- package/lib/utils/viewpoint-util.d.ts +1 -0
- package/lib/utils/viewpoint-util.d.ts.map +1 -1
- package/lib/utils/viewpoint-util.js +8 -1
- package/lib/utils/viewpoint-util.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/package.json +3 -3
- package/src/base/auto-complete/index.ts +20 -0
- package/src/base/feedback/index.ts +19 -0
- package/src/base/focus/index.ts +17 -0
- package/src/base/index.ts +31 -0
- package/src/base/model/index.ts +19 -0
- package/src/base/tool-manager/index.ts +17 -0
- package/src/base/view/index.ts +18 -0
- package/src/default-modules.ts +2 -2
- package/src/features/accessibility/edge-autocomplete/index.ts +19 -0
- package/src/features/accessibility/element-navigation/index.ts +21 -0
- package/src/features/accessibility/focus-tracker/index.ts +17 -0
- package/src/features/accessibility/index.ts +30 -0
- package/src/features/accessibility/key-shortcut/index.ts +18 -0
- package/src/features/accessibility/keyboard-grid/index.ts +20 -0
- package/src/features/accessibility/keyboard-pointer/index.ts +21 -0
- package/src/features/accessibility/keyboard-tool-palette/index.ts +17 -0
- package/src/features/accessibility/move-zoom/index.ts +18 -0
- package/src/features/accessibility/resize-key-tool/index.ts +18 -0
- package/src/features/accessibility/search/index.ts +18 -0
- package/src/features/accessibility/toast/index.ts +18 -0
- package/src/features/accessibility/view-key-tools/index.ts +19 -0
- package/src/features/accessibility/view-key-tools/movement-key-tool.ts +15 -19
- package/src/features/bounds/bounds-module.ts +5 -2
- package/src/features/bounds/index.ts +23 -0
- package/src/features/bounds/local-bounds.ts +7 -1
- package/src/features/bounds/set-bounds-feedback-command.ts +1 -1
- package/src/features/change-bounds/index.ts +20 -0
- package/src/features/change-bounds/model.ts +18 -2
- package/src/features/change-bounds/point-position-updater.ts +120 -0
- package/src/features/change-bounds/position-snapper.ts +69 -0
- package/src/features/change-bounds/snap.spec.ts +3 -2
- package/src/features/change-bounds/snap.ts +8 -82
- package/src/features/command-palette/index.ts +18 -0
- package/src/features/context-menu/index.ts +19 -0
- package/src/features/copy-paste/index.ts +19 -0
- package/src/features/decoration/index.ts +17 -0
- package/src/features/element-template/index.ts +19 -0
- package/src/features/element-template/mouse-tracking-element-position-listener.ts +29 -22
- package/src/features/export/index.ts +18 -0
- package/src/features/helper-lines/helper-line-feedback.ts +269 -0
- package/src/features/helper-lines/helper-line-manager-default.ts +114 -0
- package/src/features/helper-lines/helper-line-manager.ts +21 -0
- package/src/features/helper-lines/helper-line-module.ts +47 -0
- package/src/features/helper-lines/index.ts +21 -0
- package/src/features/helper-lines/model.ts +140 -0
- package/src/features/helper-lines/view.tsx +60 -0
- package/src/features/hints/index.ts +18 -0
- package/src/features/hover/index.ts +17 -0
- package/src/features/index.ts +42 -0
- package/src/features/label-edit/index.ts +18 -0
- package/src/features/layout/index.ts +17 -0
- package/src/features/navigation/index.ts +18 -0
- package/src/features/reconnect/index.ts +16 -0
- package/src/features/routing/index.ts +17 -0
- package/src/features/save/index.ts +17 -0
- package/src/features/select/index.ts +18 -0
- package/src/features/source-model-watcher/index.ts +17 -0
- package/src/features/status/index.ts +17 -0
- package/src/features/svg-metadata/index.ts +17 -0
- package/src/features/tool-palette/index.ts +17 -0
- package/src/features/tools/change-bounds/change-bounds-tool-feedback.ts +99 -69
- package/src/features/tools/change-bounds/change-bounds-tool.ts +12 -11
- package/src/features/tools/change-bounds/index.ts +19 -0
- package/src/features/tools/deletion/index.ts +17 -0
- package/src/features/tools/edge-creation/index.ts +20 -0
- package/src/features/tools/edge-edit/edge-edit-tool-feedback.ts +20 -21
- package/src/features/tools/edge-edit/edge-edit-tool.ts +5 -6
- package/src/features/tools/edge-edit/index.ts +18 -0
- package/src/features/tools/index.ts +23 -0
- package/src/features/tools/marquee-selection/index.ts +22 -0
- package/src/features/tools/marquee-selection/marquee-tool.ts +14 -4
- package/src/features/tools/node-creation/index.ts +17 -0
- package/src/features/tools/node-creation/node-creation-tool.ts +9 -13
- package/src/features/undo-redo/index.ts +17 -0
- package/src/features/validation/index.ts +19 -0
- package/src/features/viewport/index.ts +19 -0
- package/src/index.ts +5 -147
- package/src/re-exports.ts +16 -0
- package/src/utils/geometry-util.ts +101 -0
- package/src/utils/gmodel-util.ts +41 -10
- package/src/utils/html-utils.ts +6 -0
- package/src/utils/index.ts +22 -0
- package/src/utils/viewpoint-util.ts +8 -0
- package/src/views/index.ts +2 -2
- package/lib/features/source-model-watcher/source-model-wacher-module.d.ts.map +0 -1
- package/lib/features/source-model-watcher/source-model-wacher-module.js.map +0 -1
- package/lib/features/tools/change-bounds/change-boounds-tool-module.d.ts.map +0 -1
- package/lib/features/tools/change-bounds/change-boounds-tool-module.js.map +0 -1
- /package/src/features/source-model-watcher/{source-model-wacher-module.ts → source-model-watcher-module.ts} +0 -0
- /package/src/features/tools/change-bounds/{change-boounds-tool-module.ts → change-bounds-tool-module.ts} +0 -0
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2020-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
|
+
/* eslint-disable @typescript-eslint/no-shadow */
|
|
17
|
+
import { GModelElement, ISnapper, Point, Writable } from '@eclipse-glsp/sprotty';
|
|
18
|
+
import { calculateDeltaBetweenPoints } from '../../utils/gmodel-util';
|
|
19
|
+
import { isMouseEvent } from '../../utils/html-utils';
|
|
20
|
+
import { IHelperLineManager } from '../helper-lines/helper-line-manager';
|
|
21
|
+
import { Direction, getDirectionOf } from '../helper-lines/model';
|
|
22
|
+
import { PositionSnapper } from './position-snapper';
|
|
23
|
+
import { useSnap } from './snap';
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* This class can be used to calculate the current position, when an element is
|
|
27
|
+
* moved. This includes node movements, node resizing (resize handle movement)
|
|
28
|
+
* or edge routing-point movements.
|
|
29
|
+
*
|
|
30
|
+
* You can initialize a this class with a optional {@link ISnapper}. If a
|
|
31
|
+
* snapper is present, the positions will be snapped to the defined grid.
|
|
32
|
+
*/
|
|
33
|
+
export class PointPositionUpdater {
|
|
34
|
+
protected positionSnapper: PositionSnapper;
|
|
35
|
+
protected lastDragPosition?: Point;
|
|
36
|
+
protected positionDelta: Writable<Point> = { x: 0, y: 0 };
|
|
37
|
+
|
|
38
|
+
constructor(snapper?: PositionSnapper);
|
|
39
|
+
constructor(snapper?: ISnapper, helperLineManager?: IHelperLineManager);
|
|
40
|
+
constructor(first?: PositionSnapper | ISnapper, helperLineManager?: IHelperLineManager) {
|
|
41
|
+
this.positionSnapper = first instanceof PositionSnapper ? first : new PositionSnapper(first, helperLineManager);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Init the position with the {@link Point} of your mouse cursor.
|
|
46
|
+
* This method is normally called in the `mouseDown` event.
|
|
47
|
+
* @param mousePosition current mouse position e.g `{x: event.pageX, y: event.pageY }`
|
|
48
|
+
*/
|
|
49
|
+
public updateLastDragPosition(mousePosition: Point): void;
|
|
50
|
+
public updateLastDragPosition(mouseEvent: MouseEvent): void;
|
|
51
|
+
public updateLastDragPosition(first: Point | MouseEvent): void {
|
|
52
|
+
this.lastDragPosition = isMouseEvent(first) ? { x: first.pageX, y: first.pageY } : first;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Check if the mouse is currently not in a drag mode.
|
|
57
|
+
* @returns true if the last drag position is undefined
|
|
58
|
+
*/
|
|
59
|
+
public isLastDragPositionUndefined(): boolean {
|
|
60
|
+
return this.lastDragPosition === undefined;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Reset the updater for new movements.
|
|
65
|
+
* This method is normally called in the `mouseUp` event.
|
|
66
|
+
*/
|
|
67
|
+
public resetPosition(): void {
|
|
68
|
+
this.lastDragPosition = undefined;
|
|
69
|
+
this.positionDelta = { x: 0, y: 0 };
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Calculate the current position of your movement.
|
|
74
|
+
* This method is normally called in the `mouseMove` event.
|
|
75
|
+
* @param target node which is moved around
|
|
76
|
+
* @param mousePosition current mouse position e.g `{x: event.pageX, y: event.pageY }`
|
|
77
|
+
* @param useSnap if a snapper is defined you can disable it, e.g when a specific key is pressed `!event.shiftKey`
|
|
78
|
+
* @param direction the direction in which the position is updated, will be calculated if not provided
|
|
79
|
+
* @returns delta to previous position or undefined if no delta should be applied
|
|
80
|
+
*/
|
|
81
|
+
public updatePosition(target: GModelElement, mousePosition: Point, useSnap: boolean, direction?: Direction[]): Point | undefined;
|
|
82
|
+
public updatePosition(target: GModelElement, mouseEvent: MouseEvent, direction?: Direction[]): Point | undefined;
|
|
83
|
+
public updatePosition(
|
|
84
|
+
target: GModelElement,
|
|
85
|
+
second: Point | MouseEvent,
|
|
86
|
+
third?: boolean | Direction[],
|
|
87
|
+
fourth?: Direction[]
|
|
88
|
+
): Point | undefined {
|
|
89
|
+
if (!this.lastDragPosition) {
|
|
90
|
+
return undefined;
|
|
91
|
+
}
|
|
92
|
+
const mousePosition = isMouseEvent(second) ? { x: second.pageX, y: second.pageY } : second;
|
|
93
|
+
const shouldSnap = typeof third === 'boolean' ? third : useSnap(second as MouseEvent);
|
|
94
|
+
const direction = typeof third !== 'boolean' ? third : fourth;
|
|
95
|
+
|
|
96
|
+
// calculate update to last drag position
|
|
97
|
+
const deltaToLastPosition = calculateDeltaBetweenPoints(mousePosition, this.lastDragPosition, target);
|
|
98
|
+
this.lastDragPosition = mousePosition;
|
|
99
|
+
if (Point.equals(deltaToLastPosition, Point.ORIGIN)) {
|
|
100
|
+
return undefined;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// accumulate position delta with latest delta
|
|
104
|
+
this.positionDelta.x += deltaToLastPosition.x;
|
|
105
|
+
this.positionDelta.y += deltaToLastPosition.y;
|
|
106
|
+
|
|
107
|
+
const directions = direction ?? getDirectionOf(this.positionDelta);
|
|
108
|
+
|
|
109
|
+
// only send update if the position actually changes
|
|
110
|
+
// otherwise accumulate delta until we get to an update
|
|
111
|
+
const positionUpdate = this.positionSnapper.snapDelta(this.positionDelta, target, shouldSnap, directions);
|
|
112
|
+
if (Point.equals(positionUpdate, Point.ORIGIN)) {
|
|
113
|
+
return undefined;
|
|
114
|
+
}
|
|
115
|
+
// we update our position so we update our delta by the snapped position
|
|
116
|
+
this.positionDelta.x -= positionUpdate.x;
|
|
117
|
+
this.positionDelta.y -= positionUpdate.y;
|
|
118
|
+
return positionUpdate;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2023 EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
*
|
|
8
|
+
* This Source Code may also be made available under the following Secondary
|
|
9
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
* with the GNU Classpath Exception which is available at
|
|
12
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
*
|
|
14
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
+
********************************************************************************/
|
|
16
|
+
import { GModelElement, ISnapper, Point, TYPES, Writable } from '@eclipse-glsp/sprotty';
|
|
17
|
+
import { inject, injectable, optional } from 'inversify';
|
|
18
|
+
import { IHelperLineManager } from '../helper-lines/helper-line-manager';
|
|
19
|
+
import { Direction, HelperLine, isHelperLine } from '../helper-lines/model';
|
|
20
|
+
|
|
21
|
+
@injectable()
|
|
22
|
+
export class PositionSnapper {
|
|
23
|
+
constructor(
|
|
24
|
+
@optional() @inject(TYPES.ISnapper) protected snapper?: ISnapper,
|
|
25
|
+
@optional() @inject(TYPES.IHelperLineManager) protected helperLineManager?: IHelperLineManager
|
|
26
|
+
) {}
|
|
27
|
+
|
|
28
|
+
snapPosition(position: Point, element: GModelElement, isSnap: boolean = true): Point {
|
|
29
|
+
return isSnap && this.snapper ? this.snapper.snap(position, element) : { x: position.x, y: position.y };
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
snapDelta(positionDelta: Point, element: GModelElement, isSnap: boolean, directions: Direction[]): Point {
|
|
33
|
+
const delta: Writable<Point> = this.snapPosition(positionDelta, element, isSnap);
|
|
34
|
+
const minimumDelta = this.getMinimumDelta(element, isSnap, directions);
|
|
35
|
+
if (!minimumDelta) {
|
|
36
|
+
return delta;
|
|
37
|
+
}
|
|
38
|
+
delta.x = Math.abs(delta.x) >= minimumDelta.x ? delta.x : 0;
|
|
39
|
+
delta.y = Math.abs(delta.y) >= minimumDelta.y ? delta.y : 0;
|
|
40
|
+
return delta;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
protected getMinimumDelta(target: GModelElement, isSnap: boolean, directions: Direction[]): Point | undefined {
|
|
44
|
+
return this.getHelperLineMinimum(target, isSnap, directions);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
protected getHelperLineMinimum(target: GModelElement, isSnap: boolean, directions: Direction[]): Point | undefined {
|
|
48
|
+
if (!this.helperLineManager) {
|
|
49
|
+
return undefined;
|
|
50
|
+
}
|
|
51
|
+
const helperLines = target.root.children.filter(child => isHelperLine(child)) as HelperLine[];
|
|
52
|
+
if (helperLines.length === 0) {
|
|
53
|
+
return undefined;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const minimum: Writable<Point> = { x: 0, y: 0 };
|
|
57
|
+
if (directions.includes(Direction.Left) && helperLines.some(line => line.isLeft || line.isCenter)) {
|
|
58
|
+
minimum.x = this.helperLineManager.getHelperLineSnapping(target, isSnap, Direction.Left);
|
|
59
|
+
} else if (directions.includes(Direction.Right) && helperLines.some(line => line.isRight || line.isCenter)) {
|
|
60
|
+
minimum.x = this.helperLineManager.getHelperLineSnapping(target, isSnap, Direction.Right);
|
|
61
|
+
}
|
|
62
|
+
if (directions.includes(Direction.Up) && helperLines.some(line => line.isTop || line.isMiddle)) {
|
|
63
|
+
minimum.y = this.helperLineManager.getHelperLineSnapping(target, isSnap, Direction.Up);
|
|
64
|
+
} else if (directions.includes(Direction.Down) && helperLines.some(line => line.isBottom || line.isMiddle)) {
|
|
65
|
+
minimum.y = this.helperLineManager.getHelperLineSnapping(target, isSnap, Direction.Down);
|
|
66
|
+
}
|
|
67
|
+
return minimum;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -14,9 +14,10 @@
|
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
|
|
17
|
-
import { expect } from 'chai';
|
|
18
17
|
import { GModelElement } from '@eclipse-glsp/sprotty';
|
|
19
|
-
import {
|
|
18
|
+
import { expect } from 'chai';
|
|
19
|
+
import { PointPositionUpdater } from './point-position-updater';
|
|
20
|
+
import { GridSnapper } from './snap';
|
|
20
21
|
|
|
21
22
|
describe('GridSnapper', () => {
|
|
22
23
|
it('snap', () => {
|
|
@@ -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
|
+
/* eslint-disable @typescript-eslint/no-shadow */
|
|
17
|
+
import { GModelElement, ISnapper, KeyboardModifier, Point } from '@eclipse-glsp/sprotty';
|
|
16
18
|
import { injectable } from 'inversify';
|
|
17
|
-
import { ISnapper, Point, GModelElement, Writable, findParentByFeature, isViewport } from '@eclipse-glsp/sprotty';
|
|
18
19
|
|
|
19
20
|
/**
|
|
20
21
|
* A {@link ISnapper} implementation that snaps all elements onto a fixed gride size.
|
|
@@ -30,7 +31,7 @@ import { ISnapper, Point, GModelElement, Writable, findParentByFeature, isViewpo
|
|
|
30
31
|
export class GridSnapper implements ISnapper {
|
|
31
32
|
constructor(public grid: { x: number; y: number } = { x: 10, y: 10 }) {}
|
|
32
33
|
|
|
33
|
-
snap(position: Point,
|
|
34
|
+
snap(position: Point, _element: GModelElement): Point {
|
|
34
35
|
return {
|
|
35
36
|
x: Math.round(position.x / this.grid.x) * this.grid.x,
|
|
36
37
|
y: Math.round(position.y / this.grid.y) * this.grid.y
|
|
@@ -38,85 +39,10 @@ export class GridSnapper implements ISnapper {
|
|
|
38
39
|
}
|
|
39
40
|
}
|
|
40
41
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
* or edge routing-point movements.
|
|
45
|
-
*
|
|
46
|
-
* You can initialize a this class with a optional {@link ISnapper}. If a
|
|
47
|
-
* snapper is present, the positions will be snapped to the defined grid.
|
|
48
|
-
*/
|
|
49
|
-
export class PointPositionUpdater {
|
|
50
|
-
protected lastDragPosition?: Point;
|
|
51
|
-
protected positionDelta: Writable<Point> = { x: 0, y: 0 };
|
|
52
|
-
|
|
53
|
-
constructor(protected snapper?: ISnapper) {}
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Init the position with the {@link Point} of your mouse cursor.
|
|
57
|
-
* This method is normally called in the `mouseDown` event.
|
|
58
|
-
* @param mousePosition current mouse position e.g `{x: event.pageX, y: event.pageY }`
|
|
59
|
-
*/
|
|
60
|
-
public updateLastDragPosition(mousePosition: Point): void {
|
|
61
|
-
this.lastDragPosition = mousePosition;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Check if the mouse is currently not in a drag mode.
|
|
66
|
-
* @returns true if the last drag position is undefined
|
|
67
|
-
*/
|
|
68
|
-
public isLastDragPositionUndefined(): boolean {
|
|
69
|
-
return this.lastDragPosition === undefined;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Reset the updater for new movements.
|
|
74
|
-
* This method is normally called in the `mouseUp` event.
|
|
75
|
-
*/
|
|
76
|
-
public resetPosition(): void {
|
|
77
|
-
this.lastDragPosition = undefined;
|
|
78
|
-
this.positionDelta = { x: 0, y: 0 };
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Calculate the current position of your movement.
|
|
83
|
-
* This method is normally called in the `mouseMove` event.
|
|
84
|
-
* @param target node which is moved around
|
|
85
|
-
* @param mousePosition current mouse position e.g `{x: event.pageX, y: event.pageY }`
|
|
86
|
-
* @param isSnapEnabled if a snapper is defined you can disable it, e.g when a specific key is pressed `!event.altKey`
|
|
87
|
-
* @returns current position or undefined if updater has no last drag position initialized
|
|
88
|
-
*/
|
|
89
|
-
public updatePosition(target: GModelElement, mousePosition: Point, isSnapEnabled: boolean): Point | undefined {
|
|
90
|
-
if (this.lastDragPosition) {
|
|
91
|
-
const newDragPosition = mousePosition;
|
|
92
|
-
|
|
93
|
-
const viewport = findParentByFeature(target, isViewport);
|
|
94
|
-
const zoom = viewport?.zoom ?? 1;
|
|
95
|
-
const dx = (mousePosition.x - this.lastDragPosition.x) / zoom;
|
|
96
|
-
const dy = (mousePosition.y - this.lastDragPosition.y) / zoom;
|
|
97
|
-
const deltaToLastPosition = { x: dx, y: dy };
|
|
98
|
-
this.lastDragPosition = newDragPosition;
|
|
99
|
-
|
|
100
|
-
// update position delta with latest delta
|
|
101
|
-
this.positionDelta.x += deltaToLastPosition.x;
|
|
102
|
-
this.positionDelta.y += deltaToLastPosition.y;
|
|
103
|
-
|
|
104
|
-
// snap our delta and only send update if the position actually changes
|
|
105
|
-
// otherwise accumulate delta until we do snap to an update
|
|
106
|
-
const positionUpdate = this.snap(this.positionDelta, target, isSnapEnabled);
|
|
107
|
-
if (positionUpdate.x === 0 && positionUpdate.y === 0) {
|
|
108
|
-
return undefined;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
// we update our position so we update our delta by the snapped position
|
|
112
|
-
this.positionDelta.x -= positionUpdate.x;
|
|
113
|
-
this.positionDelta.y -= positionUpdate.y;
|
|
114
|
-
return positionUpdate;
|
|
115
|
-
}
|
|
116
|
-
return undefined;
|
|
117
|
-
}
|
|
42
|
+
export function useSnap(event: MouseEvent | KeyboardEvent): boolean {
|
|
43
|
+
return !event.shiftKey;
|
|
44
|
+
}
|
|
118
45
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}
|
|
46
|
+
export function unsnapModifier(): KeyboardModifier {
|
|
47
|
+
return 'shift';
|
|
122
48
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2023 EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
*
|
|
8
|
+
* This Source Code may also be made available under the following Secondary
|
|
9
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
* with the GNU Classpath Exception which is available at
|
|
12
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
*
|
|
14
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
+
********************************************************************************/
|
|
16
|
+
export * from './command-palette-module';
|
|
17
|
+
export * from './command-palette-tool';
|
|
18
|
+
export * from './server-command-palette-provider';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2023 EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
*
|
|
8
|
+
* This Source Code may also be made available under the following Secondary
|
|
9
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
* with the GNU Classpath Exception which is available at
|
|
12
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
*
|
|
14
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
+
********************************************************************************/
|
|
16
|
+
export * from './context-menu-module';
|
|
17
|
+
export * from './delete-element-context-menu';
|
|
18
|
+
export * from './glsp-context-menu-mouse-listener';
|
|
19
|
+
export * from './server-context-menu-provider';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2023 EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
*
|
|
8
|
+
* This Source Code may also be made available under the following Secondary
|
|
9
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
* with the GNU Classpath Exception which is available at
|
|
12
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
*
|
|
14
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
+
********************************************************************************/
|
|
16
|
+
export * from './copy-paste-context-menu';
|
|
17
|
+
export * from './copy-paste-handler';
|
|
18
|
+
export * from './copy-paste-modules';
|
|
19
|
+
export * from './copy-paste-standalone';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2023 EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
*
|
|
8
|
+
* This Source Code may also be made available under the following Secondary
|
|
9
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
* with the GNU Classpath Exception which is available at
|
|
12
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
*
|
|
14
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
+
********************************************************************************/
|
|
16
|
+
export * from './decoration-module';
|
|
17
|
+
export * from './decoration-placer';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2023 EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
*
|
|
8
|
+
* This Source Code may also be made available under the following Secondary
|
|
9
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
* with the GNU Classpath Exception which is available at
|
|
12
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
*
|
|
14
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
+
********************************************************************************/
|
|
16
|
+
export * from './add-template-element';
|
|
17
|
+
export * from './element-template-module';
|
|
18
|
+
export * from './mouse-tracking-element-position-listener';
|
|
19
|
+
export * from './remove-template-element';
|
|
@@ -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 { Action, Disposable, GModelElement,
|
|
17
|
+
import { Action, Disposable, GModelElement, Locateable, MoveAction, Point, isBoundsAware, isMoveable } from '@eclipse-glsp/sprotty';
|
|
18
18
|
import { injectable } from 'inversify';
|
|
19
19
|
import { DragAwareMouseListener } from '../../base/drag-aware-mouse-listener';
|
|
20
20
|
import { CSS_HIDDEN, ModifyCSSFeedbackAction } from '../../base/feedback/css-feedback';
|
|
@@ -26,9 +26,12 @@ import {
|
|
|
26
26
|
createMovementRestrictionFeedback,
|
|
27
27
|
removeMovementRestrictionFeedback
|
|
28
28
|
} from '../change-bounds/movement-restrictor';
|
|
29
|
+
import { PositionSnapper } from '../change-bounds/position-snapper';
|
|
30
|
+
import { PointPositionUpdater } from '../change-bounds/point-position-updater';
|
|
31
|
+
import { useSnap } from '../change-bounds/snap';
|
|
29
32
|
|
|
30
33
|
export interface PositioningTool extends Tool {
|
|
31
|
-
readonly
|
|
34
|
+
readonly positionSnapper: PositionSnapper;
|
|
32
35
|
readonly movementRestrictor?: IMovementRestrictor;
|
|
33
36
|
|
|
34
37
|
registerFeedback(feedbackActions: Action[], feedbackEmitter?: IFeedbackEmitter, cleanupActions?: Action[]): Disposable;
|
|
@@ -37,57 +40,61 @@ export interface PositioningTool extends Tool {
|
|
|
37
40
|
|
|
38
41
|
@injectable()
|
|
39
42
|
export class MouseTrackingElementPositionListener extends DragAwareMouseListener {
|
|
40
|
-
element?: GModelElement;
|
|
41
43
|
currentPosition?: Point;
|
|
42
44
|
|
|
45
|
+
protected positionUpdater: PointPositionUpdater;
|
|
46
|
+
|
|
43
47
|
constructor(
|
|
44
48
|
protected elementId: string,
|
|
45
49
|
protected tool: PositioningTool,
|
|
46
50
|
protected cursorPosition: 'top-left' | 'middle' = 'top-left'
|
|
47
51
|
) {
|
|
48
52
|
super();
|
|
53
|
+
this.positionUpdater = new PointPositionUpdater(this.tool.positionSnapper);
|
|
49
54
|
}
|
|
50
55
|
|
|
51
56
|
override mouseMove(target: GModelElement, event: MouseEvent): Action[] {
|
|
52
57
|
super.mouseMove(target, event);
|
|
53
58
|
const element = target.root.index.getById(this.elementId);
|
|
54
|
-
|
|
55
|
-
if (!element) {
|
|
59
|
+
if (!element || !isMoveable(element)) {
|
|
56
60
|
return [];
|
|
57
61
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
newPosition = Point.subtract(newPosition, { x: element.bounds.width / 2, y: element.bounds.height / 2 });
|
|
62
|
+
let targetPosition = this.getTargetPosition(target, event, element);
|
|
63
|
+
if (this.positionUpdater.isLastDragPositionUndefined()) {
|
|
64
|
+
this.positionUpdater.updateLastDragPosition(targetPosition);
|
|
62
65
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
if (isMoveable(element)) {
|
|
67
|
-
newPosition = this.validateMove(this.currentPosition ?? newPosition, newPosition, element, finished);
|
|
66
|
+
const delta = this.positionUpdater.updatePosition(element, targetPosition, useSnap(event));
|
|
67
|
+
if (!delta) {
|
|
68
|
+
return [];
|
|
68
69
|
}
|
|
69
|
-
this.currentPosition
|
|
70
|
+
targetPosition = this.validateMove(this.currentPosition ?? targetPosition, targetPosition, element, false);
|
|
70
71
|
const moveGhostElement = MoveAction.create(
|
|
71
72
|
[
|
|
72
73
|
{
|
|
73
74
|
elementId: element.id,
|
|
74
|
-
|
|
75
|
+
fromPosition: this.currentPosition,
|
|
76
|
+
toPosition: targetPosition
|
|
75
77
|
}
|
|
76
78
|
],
|
|
77
|
-
{ animate: false, finished }
|
|
79
|
+
{ animate: false, finished: false }
|
|
78
80
|
);
|
|
81
|
+
this.currentPosition = targetPosition;
|
|
79
82
|
this.tool.registerFeedback([moveGhostElement], this);
|
|
80
83
|
return element.cssClasses?.includes(CSS_HIDDEN)
|
|
81
84
|
? [ModifyCSSFeedbackAction.create({ elements: [element.id], remove: [CSS_HIDDEN] })]
|
|
82
85
|
: [];
|
|
83
86
|
}
|
|
84
87
|
|
|
85
|
-
protected
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
return position;
|
|
88
|
+
protected getTargetPosition(target: GModelElement, event: MouseEvent, element: GModelElement & Locateable): Point {
|
|
89
|
+
let targetPosition = getAbsolutePosition(target, event);
|
|
90
|
+
if (this.cursorPosition === 'middle' && isBoundsAware(element)) {
|
|
91
|
+
targetPosition = Point.subtract(targetPosition, { x: element.bounds.width / 2, y: element.bounds.height / 2 });
|
|
90
92
|
}
|
|
93
|
+
return targetPosition;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
protected snap(position: Point, element: GModelElement, isSnap = true): Point {
|
|
97
|
+
return this.tool.positionSnapper.snapPosition(position, element, isSnap);
|
|
91
98
|
}
|
|
92
99
|
|
|
93
100
|
protected validateMove(startPosition: Point, toPosition: Point, element: GModelElement, isFinished: boolean): Point {
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2023 EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
*
|
|
8
|
+
* This Source Code may also be made available under the following Secondary
|
|
9
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
* with the GNU Classpath Exception which is available at
|
|
12
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
*
|
|
14
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
+
********************************************************************************/
|
|
16
|
+
export * from './export-modules';
|
|
17
|
+
export * from './export-svg-action-handler';
|
|
18
|
+
export * from './glsp-svg-exporter';
|