@eclipse-glsp/client 0.10.0-next.6bee8eb.163 → 0.10.0-next.82afe91.177
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 +1 -0
- package/lib/base/action-dispatcher.d.ts.map +1 -1
- package/lib/base/action-dispatcher.js +11 -3
- package/lib/base/action-dispatcher.js.map +1 -1
- package/lib/base/actions/focus-change-action.d.ts +16 -7
- package/lib/base/actions/focus-change-action.d.ts.map +1 -1
- package/lib/base/actions/focus-change-action.js +31 -12
- package/lib/base/actions/focus-change-action.js.map +1 -1
- package/lib/base/actions/sprotty-actions.d.ts +7 -0
- package/lib/base/actions/sprotty-actions.d.ts.map +1 -0
- package/lib/{features/tool-palette/palette-item.js → base/actions/sprotty-actions.js} +4 -20
- package/lib/base/actions/sprotty-actions.js.map +1 -0
- package/lib/base/auto-complete/auto-complete-actions.d.ts +5 -3
- package/lib/base/auto-complete/auto-complete-actions.d.ts.map +1 -1
- package/lib/base/auto-complete/auto-complete-actions.js +24 -5
- package/lib/base/auto-complete/auto-complete-actions.js.map +1 -1
- package/lib/base/auto-complete/auto-complete-widget.d.ts +9 -2
- package/lib/base/auto-complete/auto-complete-widget.d.ts.map +1 -1
- package/lib/base/auto-complete/auto-complete-widget.js +11 -4
- package/lib/base/auto-complete/auto-complete-widget.js.map +1 -1
- package/lib/base/command-stack.d.ts.map +1 -1
- package/lib/base/command-stack.js +4 -3
- package/lib/base/command-stack.js.map +1 -1
- package/lib/base/container-modules.d.ts.map +1 -1
- package/lib/base/container-modules.js +2 -1
- package/lib/base/container-modules.js.map +1 -1
- package/lib/base/di.config.d.ts +1 -1
- package/lib/base/di.config.d.ts.map +1 -1
- package/lib/base/di.config.js +9 -10
- package/lib/base/di.config.js.map +1 -1
- package/lib/base/editor-context-service.d.ts +15 -4
- package/lib/base/editor-context-service.d.ts.map +1 -1
- package/lib/base/editor-context-service.js +27 -16
- package/lib/base/editor-context-service.js.map +1 -1
- package/lib/base/focus-tracker.d.ts +1 -1
- package/lib/base/focus-tracker.d.ts.map +1 -1
- package/lib/base/focus-tracker.js +3 -3
- package/lib/base/focus-tracker.js.map +1 -1
- package/lib/base/model/update-model-command.d.ts +14 -7
- package/lib/base/model/update-model-command.d.ts.map +1 -1
- package/lib/base/model/update-model-command.js +38 -48
- package/lib/base/model/update-model-command.js.map +1 -1
- package/lib/base/model-initialization-constraint.d.ts +2 -3
- package/lib/base/model-initialization-constraint.d.ts.map +1 -1
- package/lib/base/model-initialization-constraint.js +3 -4
- package/lib/base/model-initialization-constraint.js.map +1 -1
- package/lib/base/source-uri-aware.d.ts +2 -17
- package/lib/base/source-uri-aware.d.ts.map +1 -1
- package/lib/base/source-uri-aware.js +4 -6
- package/lib/base/source-uri-aware.js.map +1 -1
- package/lib/base/tool-manager/glsp-tool-manager.d.ts.map +1 -1
- package/lib/base/tool-manager/glsp-tool-manager.js +3 -3
- package/lib/base/tool-manager/glsp-tool-manager.js.map +1 -1
- package/lib/base/tool-manager/tool-actions.d.ts +14 -0
- package/lib/base/tool-manager/tool-actions.d.ts.map +1 -0
- package/lib/base/tool-manager/tool-actions.js +25 -0
- package/lib/base/tool-manager/tool-actions.js.map +1 -0
- package/lib/base/types.d.ts +144 -20
- package/lib/base/types.d.ts.map +1 -1
- package/lib/base/types.js +14 -26
- package/lib/base/types.js.map +1 -1
- package/lib/features/change-bounds/movement-restrictor.d.ts +37 -7
- package/lib/features/change-bounds/movement-restrictor.d.ts.map +1 -1
- package/lib/features/change-bounds/movement-restrictor.js +54 -39
- package/lib/features/change-bounds/movement-restrictor.js.map +1 -1
- package/lib/features/change-bounds/snap.d.ts +60 -4
- package/lib/features/change-bounds/snap.d.ts.map +1 -1
- package/lib/features/change-bounds/snap.js +96 -9
- package/lib/features/change-bounds/snap.js.map +1 -1
- package/lib/features/change-bounds/snap.spec.d.ts +17 -0
- 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/di.config.d.ts +2 -2
- package/lib/features/command-palette/di.config.d.ts.map +1 -1
- package/lib/features/command-palette/di.config.js +6 -6
- package/lib/features/command-palette/di.config.js.map +1 -1
- package/lib/features/command-palette/server-command-palette-provider.d.ts +1 -1
- package/lib/features/command-palette/server-command-palette-provider.d.ts.map +1 -1
- package/lib/features/command-palette/server-command-palette-provider.js +11 -8
- package/lib/features/command-palette/server-command-palette-provider.js.map +1 -1
- package/lib/features/context-menu/delete-element-context-menu.d.ts +17 -1
- package/lib/features/context-menu/delete-element-context-menu.d.ts.map +1 -1
- package/lib/features/context-menu/delete-element-context-menu.js +3 -3
- package/lib/features/context-menu/delete-element-context-menu.js.map +1 -1
- package/lib/features/context-menu/di.config.d.ts +1 -1
- package/lib/features/context-menu/di.config.d.ts.map +1 -1
- package/lib/features/context-menu/di.config.js +8 -7
- package/lib/features/context-menu/di.config.js.map +1 -1
- package/lib/features/context-menu/selection-service-aware-context-menu-mouse-listener.d.ts +22 -8
- 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 +11 -33
- 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.d.ts +1 -1
- package/lib/features/context-menu/server-context-menu-provider.d.ts.map +1 -1
- package/lib/features/context-menu/server-context-menu-provider.js +6 -5
- package/lib/features/context-menu/server-context-menu-provider.js.map +1 -1
- package/lib/features/copy-paste/copy-paste-context-menu.d.ts +12 -15
- package/lib/features/copy-paste/copy-paste-context-menu.d.ts.map +1 -1
- package/lib/features/copy-paste/copy-paste-context-menu.js +24 -31
- package/lib/features/copy-paste/copy-paste-context-menu.js.map +1 -1
- package/lib/features/copy-paste/copy-paste-handler.d.ts +1 -1
- package/lib/features/copy-paste/copy-paste-handler.d.ts.map +1 -1
- package/lib/features/copy-paste/copy-paste-handler.js +6 -7
- package/lib/features/copy-paste/copy-paste-handler.js.map +1 -1
- package/lib/features/copy-paste/di.config.d.ts +1 -1
- package/lib/features/copy-paste/di.config.d.ts.map +1 -1
- package/lib/features/copy-paste/di.config.js +5 -7
- package/lib/features/copy-paste/di.config.js.map +1 -1
- package/lib/features/decoration/decoration-placer.d.ts.map +1 -1
- package/lib/features/decoration/decoration-placer.js +17 -1
- package/lib/features/decoration/decoration-placer.js.map +1 -1
- package/lib/features/decoration/di.config.d.ts +2 -2
- package/lib/features/decoration/di.config.d.ts.map +1 -1
- package/lib/features/decoration/di.config.js +4 -4
- package/lib/features/decoration/di.config.js.map +1 -1
- package/lib/features/edit-label/di.config.d.ts +1 -1
- package/lib/features/edit-label/di.config.d.ts.map +1 -1
- package/lib/features/edit-label/di.config.js +4 -4
- package/lib/features/edit-label/di.config.js.map +1 -1
- package/lib/features/edit-label/edit-label-tool.d.ts.map +1 -1
- package/lib/features/edit-label/edit-label-tool.js +1 -1
- package/lib/features/edit-label/edit-label-tool.js.map +1 -1
- package/lib/features/edit-label/edit-label-validator.d.ts +4 -6
- package/lib/features/edit-label/edit-label-validator.d.ts.map +1 -1
- package/lib/features/edit-label/edit-label-validator.js +8 -10
- package/lib/features/edit-label/edit-label-validator.js.map +1 -1
- package/lib/features/hints/di.config.js +2 -2
- package/lib/features/hints/di.config.js.map +1 -1
- package/lib/features/hints/type-hints.d.ts +14 -4
- package/lib/features/hints/type-hints.d.ts.map +1 -1
- package/lib/features/hints/type-hints.js +21 -18
- package/lib/features/hints/type-hints.js.map +1 -1
- package/lib/features/hover/di.config.d.ts.map +1 -1
- package/lib/features/hover/di.config.js +2 -0
- package/lib/features/hover/di.config.js.map +1 -1
- package/lib/features/hover/hover.d.ts +4 -2
- package/lib/features/hover/hover.d.ts.map +1 -1
- package/lib/features/hover/hover.js +22 -4
- package/lib/features/hover/hover.js.map +1 -1
- package/lib/features/layout/di.config.d.ts +3 -3
- package/lib/features/layout/di.config.d.ts.map +1 -1
- package/lib/features/layout/di.config.js +9 -6
- package/lib/features/layout/di.config.js.map +1 -1
- package/lib/features/layout/freeform-layout.d.ts +17 -1
- package/lib/features/layout/freeform-layout.d.ts.map +1 -1
- package/lib/features/layout/freeform-layout.js +2 -2
- package/lib/features/layout/freeform-layout.js.map +1 -1
- package/lib/features/layout/hbox-layout.d.ts +41 -0
- package/lib/features/layout/hbox-layout.d.ts.map +1 -0
- package/lib/features/layout/hbox-layout.js +189 -0
- package/lib/features/layout/hbox-layout.js.map +1 -0
- package/lib/features/layout/layout-elements-action.d.ts +198 -0
- package/lib/features/layout/layout-elements-action.d.ts.map +1 -0
- package/lib/features/layout/layout-elements-action.js +391 -0
- package/lib/features/layout/layout-elements-action.js.map +1 -0
- 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-commands.spec.js → layout-elements-action.spec.js} +75 -56
- package/lib/features/layout/layout-elements-action.spec.js.map +1 -0
- package/lib/features/layout/vbox-layout.d.ts +17 -1
- package/lib/features/layout/vbox-layout.d.ts.map +1 -1
- package/lib/features/layout/vbox-layout.js +4 -3
- package/lib/features/layout/vbox-layout.js.map +1 -1
- package/lib/features/model-source-watcher/model-source-changed-action-handler.d.ts +1 -1
- package/lib/features/model-source-watcher/model-source-changed-action-handler.d.ts.map +1 -1
- package/lib/features/model-source-watcher/model-source-changed-action-handler.js +7 -7
- package/lib/features/model-source-watcher/model-source-changed-action-handler.js.map +1 -1
- package/lib/features/mouse-tool/di.config.d.ts +1 -1
- package/lib/features/mouse-tool/di.config.d.ts.map +1 -1
- package/lib/features/mouse-tool/di.config.js +2 -2
- package/lib/features/mouse-tool/di.config.js.map +1 -1
- package/lib/features/mouse-tool/mouse-tool.d.ts +0 -1
- package/lib/features/mouse-tool/mouse-tool.d.ts.map +1 -1
- package/lib/features/mouse-tool/mouse-tool.js +3 -5
- package/lib/features/mouse-tool/mouse-tool.js.map +1 -1
- package/lib/features/navigation/navigation-action-handler.d.ts +31 -16
- package/lib/features/navigation/navigation-action-handler.d.ts.map +1 -1
- package/lib/features/navigation/navigation-action-handler.js +50 -66
- package/lib/features/navigation/navigation-action-handler.js.map +1 -1
- package/lib/features/navigation/navigation-target-resolver.d.ts +3 -3
- package/lib/features/navigation/navigation-target-resolver.d.ts.map +1 -1
- package/lib/features/navigation/navigation-target-resolver.js +7 -8
- package/lib/features/navigation/navigation-target-resolver.js.map +1 -1
- package/lib/features/navigation/navigation-target-resolver.spec.js +3 -3
- package/lib/features/navigation/navigation-target-resolver.spec.js.map +1 -1
- package/lib/features/save/di.config.d.ts +1 -1
- package/lib/features/save/di.config.d.ts.map +1 -1
- package/lib/features/save/di.config.js +3 -3
- package/lib/features/save/di.config.js.map +1 -1
- package/lib/features/save/save-keylistener.js +1 -1
- package/lib/features/save/save-keylistener.js.map +1 -1
- package/lib/features/select/di.config.d.ts +1 -1
- package/lib/features/select/di.config.d.ts.map +1 -1
- package/lib/features/select/di.config.js +4 -5
- package/lib/features/select/di.config.js.map +1 -1
- package/lib/features/select/select-feedback-action.d.ts +26 -22
- package/lib/features/select/select-feedback-action.d.ts.map +1 -1
- package/lib/features/select/select-feedback-action.js +18 -45
- package/lib/features/select/select-feedback-action.js.map +1 -1
- package/lib/features/select/select-mouse-listener.d.ts +4 -2
- package/lib/features/select/select-mouse-listener.d.ts.map +1 -1
- package/lib/features/select/select-mouse-listener.js +63 -1
- package/lib/features/select/select-mouse-listener.js.map +1 -1
- package/lib/features/select/selection-service.d.ts +12 -3
- package/lib/features/select/selection-service.d.ts.map +1 -1
- package/lib/features/select/selection-service.js +47 -58
- package/lib/features/select/selection-service.js.map +1 -1
- package/lib/features/select/selection-service.spec.js +10 -7
- package/lib/features/select/selection-service.spec.js.map +1 -1
- package/lib/features/tool-feedback/change-bounds-tool-feedback.d.ts +16 -8
- package/lib/features/tool-feedback/change-bounds-tool-feedback.d.ts.map +1 -1
- package/lib/features/tool-feedback/change-bounds-tool-feedback.js +51 -21
- package/lib/features/tool-feedback/change-bounds-tool-feedback.js.map +1 -1
- package/lib/features/tool-feedback/creation-tool-feedback.d.ts +22 -10
- package/lib/features/tool-feedback/creation-tool-feedback.d.ts.map +1 -1
- package/lib/features/tool-feedback/creation-tool-feedback.js +46 -21
- package/lib/features/tool-feedback/creation-tool-feedback.js.map +1 -1
- package/lib/features/tool-feedback/css-feedback.d.ts +17 -10
- package/lib/features/tool-feedback/css-feedback.d.ts.map +1 -1
- package/lib/features/tool-feedback/css-feedback.js +41 -37
- package/lib/features/tool-feedback/css-feedback.js.map +1 -1
- package/lib/features/tool-feedback/di.config.d.ts +1 -1
- package/lib/features/tool-feedback/di.config.d.ts.map +1 -1
- package/lib/features/tool-feedback/di.config.js +4 -4
- package/lib/features/tool-feedback/di.config.js.map +1 -1
- package/lib/features/tool-feedback/edge-edit-tool-feedback.d.ts +44 -21
- package/lib/features/tool-feedback/edge-edit-tool-feedback.d.ts.map +1 -1
- package/lib/features/tool-feedback/edge-edit-tool-feedback.js +124 -91
- package/lib/features/tool-feedback/edge-edit-tool-feedback.js.map +1 -1
- package/lib/features/tool-feedback/feedback-action-dispatcher.d.ts.map +1 -1
- package/lib/features/tool-feedback/feedback-action-dispatcher.js +3 -3
- package/lib/features/tool-feedback/feedback-action-dispatcher.js.map +1 -1
- package/lib/features/tool-feedback/marquee-tool-feedback.d.ts +20 -9
- package/lib/features/tool-feedback/marquee-tool-feedback.d.ts.map +1 -1
- package/lib/features/tool-feedback/marquee-tool-feedback.js +41 -15
- package/lib/features/tool-feedback/marquee-tool-feedback.js.map +1 -1
- package/lib/features/tool-feedback/view.d.ts +1 -1
- package/lib/features/tool-feedback/view.d.ts.map +1 -1
- package/lib/features/tool-feedback/view.js +18 -1
- package/lib/features/tool-feedback/view.js.map +1 -1
- package/lib/features/tool-palette/di.config.d.ts +1 -1
- package/lib/features/tool-palette/di.config.d.ts.map +1 -1
- package/lib/features/tool-palette/di.config.js +3 -2
- package/lib/features/tool-palette/di.config.js.map +1 -1
- package/lib/features/tool-palette/tool-palette.d.ts +9 -6
- package/lib/features/tool-palette/tool-palette.d.ts.map +1 -1
- package/lib/features/tool-palette/tool-palette.js +25 -20
- package/lib/features/tool-palette/tool-palette.js.map +1 -1
- package/lib/features/tools/base-glsp-tool.d.ts.map +1 -1
- package/lib/features/tools/base-glsp-tool.js +3 -3
- package/lib/features/tools/base-glsp-tool.js.map +1 -1
- package/lib/features/tools/change-bounds-tool.d.ts +6 -8
- package/lib/features/tools/change-bounds-tool.d.ts.map +1 -1
- package/lib/features/tools/change-bounds-tool.js +22 -45
- package/lib/features/tools/change-bounds-tool.js.map +1 -1
- package/lib/features/tools/delete-tool.d.ts.map +1 -1
- package/lib/features/tools/delete-tool.js +5 -5
- package/lib/features/tools/delete-tool.js.map +1 -1
- package/lib/features/tools/di.config.d.ts +9 -2
- package/lib/features/tools/di.config.d.ts.map +1 -1
- package/lib/features/tools/di.config.js +23 -12
- package/lib/features/tools/di.config.js.map +1 -1
- package/lib/features/tools/edge-creation-tool.d.ts.map +1 -1
- package/lib/features/tools/edge-creation-tool.js +16 -9
- package/lib/features/tools/edge-creation-tool.js.map +1 -1
- package/lib/features/tools/edge-edit-tool.d.ts +2 -1
- package/lib/features/tools/edge-edit-tool.d.ts.map +1 -1
- package/lib/features/tools/edge-edit-tool.js +20 -15
- package/lib/features/tools/edge-edit-tool.js.map +1 -1
- package/lib/features/{tool-palette/palette-item.d.ts → tools/enable-default-tools-on-focus-loss.d.ts} +11 -11
- package/lib/features/tools/enable-default-tools-on-focus-loss.d.ts.map +1 -0
- package/lib/features/tools/enable-default-tools-on-focus-loss.js +29 -0
- package/lib/features/tools/enable-default-tools-on-focus-loss.js.map +1 -0
- package/lib/features/tools/marquee-behavior.d.ts +1 -1
- package/lib/features/tools/marquee-behavior.js +2 -2
- package/lib/features/tools/marquee-behavior.js.map +1 -1
- package/lib/features/tools/marquee-mouse-tool.d.ts.map +1 -1
- package/lib/features/tools/marquee-mouse-tool.js +7 -7
- package/lib/features/tools/marquee-mouse-tool.js.map +1 -1
- package/lib/features/tools/marquee-tool.js +1 -1
- package/lib/features/tools/marquee-tool.js.map +1 -1
- package/lib/features/tools/model.d.ts +2 -1
- package/lib/features/tools/model.d.ts.map +1 -1
- package/lib/features/tools/model.js +0 -15
- package/lib/features/tools/model.js.map +1 -1
- package/lib/features/tools/node-creation-tool.d.ts.map +1 -1
- package/lib/features/tools/node-creation-tool.js +5 -5
- package/lib/features/tools/node-creation-tool.js.map +1 -1
- package/lib/features/validation/di.config.d.ts +0 -15
- package/lib/features/validation/di.config.d.ts.map +1 -1
- package/lib/features/validation/di.config.js +9 -7
- package/lib/features/validation/di.config.js.map +1 -1
- package/lib/features/validation/marker-navigator.d.ts +26 -24
- package/lib/features/validation/marker-navigator.d.ts.map +1 -1
- package/lib/features/validation/marker-navigator.js +50 -77
- package/lib/features/validation/marker-navigator.js.map +1 -1
- package/lib/features/validation/marker-navigator.spec.d.ts.map +1 -1
- package/lib/features/validation/marker-navigator.spec.js +2 -16
- package/lib/features/validation/marker-navigator.spec.js.map +1 -1
- package/lib/features/validation/validate.d.ts +16 -29
- package/lib/features/validation/validate.d.ts.map +1 -1
- package/lib/features/validation/validate.js +48 -76
- package/lib/features/validation/validate.js.map +1 -1
- package/lib/features/viewport/di.config.d.ts +1 -1
- package/lib/features/viewport/di.config.d.ts.map +1 -1
- package/lib/features/viewport/di.config.js +1 -1
- package/lib/features/viewport/di.config.js.map +1 -1
- package/lib/features/viewport/glsp-scroll-mouse-listener.js +2 -2
- package/lib/features/viewport/glsp-scroll-mouse-listener.js.map +1 -1
- package/lib/index.d.ts +8 -9
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +9 -9
- package/lib/index.js.map +1 -1
- package/lib/lib/model.d.ts +2 -1
- package/lib/lib/model.d.ts.map +1 -1
- package/lib/lib/model.js +3 -18
- package/lib/lib/model.js.map +1 -1
- package/lib/model-source/glsp-diagram-server.d.ts +5 -5
- package/lib/model-source/glsp-diagram-server.d.ts.map +1 -1
- package/lib/model-source/glsp-diagram-server.js +6 -6
- package/lib/model-source/glsp-diagram-server.js.map +1 -1
- package/lib/sprotty-reexport.d.ts +174 -0
- package/lib/sprotty-reexport.d.ts.map +1 -0
- package/lib/sprotty-reexport.js +299 -0
- package/lib/sprotty-reexport.js.map +1 -0
- package/lib/utils/layout-utils.d.ts +6 -22
- package/lib/utils/layout-utils.d.ts.map +1 -1
- package/lib/utils/layout-utils.js +1 -1
- package/lib/utils/layout-utils.js.map +1 -1
- package/lib/utils/smodel-util.d.ts +27 -18
- package/lib/utils/smodel-util.d.ts.map +1 -1
- package/lib/utils/smodel-util.js +30 -11
- package/lib/utils/smodel-util.js.map +1 -1
- package/lib/utils/viewpoint-util.d.ts +3 -3
- package/lib/utils/viewpoint-util.d.ts.map +1 -1
- package/lib/utils/viewpoint-util.js +17 -1
- package/lib/utils/viewpoint-util.js.map +1 -1
- package/lib/views/base-view-module.d.ts.map +1 -1
- package/lib/views/base-view-module.js +3 -1
- package/lib/views/base-view-module.js.map +1 -1
- package/package.json +5 -4
- package/src/base/action-dispatcher.ts +13 -4
- package/src/base/actions/focus-change-action.ts +25 -8
- package/src/base/actions/sprotty-actions.ts +26 -0
- package/src/base/auto-complete/auto-complete-actions.ts +7 -5
- package/src/base/auto-complete/auto-complete-widget.ts +15 -13
- package/src/base/command-stack.ts +4 -3
- package/src/base/container-modules.ts +4 -3
- package/src/base/di.config.ts +4 -5
- package/src/base/editor-context-service.ts +32 -12
- package/src/base/focus-tracker.ts +5 -4
- package/src/base/model/update-model-command.ts +52 -39
- package/src/base/model-initialization-constraint.ts +3 -4
- package/src/base/source-uri-aware.ts +5 -4
- package/src/base/tool-manager/glsp-tool-manager.ts +4 -4
- package/src/base/tool-manager/tool-actions.ts +37 -0
- package/src/base/types.ts +31 -24
- package/src/features/change-bounds/movement-restrictor.ts +74 -44
- package/src/features/change-bounds/snap.spec.ts +89 -0
- package/src/features/change-bounds/snap.ts +99 -12
- package/src/features/command-palette/di.config.ts +5 -7
- package/src/features/command-palette/server-command-palette-provider.ts +9 -8
- package/src/features/context-menu/delete-element-context-menu.ts +6 -6
- package/src/features/context-menu/di.config.ts +3 -2
- package/src/features/context-menu/selection-service-aware-context-menu-mouse-listener.ts +22 -29
- package/src/features/context-menu/server-context-menu-provider.ts +7 -6
- package/src/features/copy-paste/copy-paste-context-menu.ts +30 -23
- package/src/features/copy-paste/copy-paste-handler.ts +6 -6
- package/src/features/copy-paste/di.config.ts +7 -15
- package/src/features/decoration/decoration-placer.ts +2 -2
- package/src/features/decoration/di.config.ts +3 -5
- package/src/features/edit-label/di.config.ts +4 -5
- package/src/features/edit-label/edit-label-tool.ts +1 -2
- package/src/features/edit-label/edit-label-validator.ts +6 -10
- package/src/features/hints/di.config.ts +3 -3
- package/src/features/hints/type-hints.ts +31 -16
- package/src/features/hover/di.config.ts +4 -0
- package/src/features/hover/hover.ts +29 -11
- package/src/features/layout/di.config.ts +15 -7
- package/src/features/layout/freeform-layout.ts +3 -12
- package/src/features/layout/hbox-layout.ts +256 -0
- package/src/features/layout/{layout-commands.spec.ts → layout-elements-action.spec.ts} +89 -65
- package/src/features/layout/layout-elements-action.ts +486 -0
- package/src/features/layout/vbox-layout.ts +4 -8
- package/src/features/model-source-watcher/model-source-changed-action-handler.ts +7 -12
- package/src/features/mouse-tool/di.config.ts +3 -4
- package/src/features/mouse-tool/mouse-tool.ts +4 -7
- package/src/features/navigation/navigation-action-handler.ts +76 -42
- package/src/features/navigation/navigation-target-resolver.spec.ts +3 -3
- package/src/features/navigation/navigation-target-resolver.ts +8 -13
- package/src/features/save/di.config.ts +2 -3
- package/src/features/save/save-keylistener.ts +1 -1
- package/src/features/select/di.config.ts +6 -8
- package/src/features/select/select-feedback-action.ts +18 -46
- package/src/features/select/select-mouse-listener.ts +82 -3
- package/src/features/select/selection-service.spec.ts +12 -9
- package/src/features/select/selection-service.ts +49 -58
- package/src/features/tool-feedback/change-bounds-tool-feedback.ts +43 -14
- package/src/features/tool-feedback/creation-tool-feedback.ts +42 -21
- package/src/features/tool-feedback/css-feedback.ts +40 -37
- package/src/features/tool-feedback/di.config.ts +4 -5
- package/src/features/tool-feedback/edge-edit-tool-feedback.ts +130 -78
- package/src/features/tool-feedback/feedback-action-dispatcher.ts +2 -1
- package/src/features/tool-feedback/marquee-tool-feedback.ts +36 -11
- package/src/features/tool-feedback/view.tsx +3 -3
- package/src/features/tool-palette/di.config.ts +3 -2
- package/src/features/tool-palette/tool-palette.ts +30 -16
- package/src/features/tools/base-glsp-tool.ts +4 -4
- package/src/features/tools/change-bounds-tool.ts +31 -61
- package/src/features/tools/delete-tool.ts +6 -6
- package/src/features/tools/di.config.ts +23 -12
- package/src/features/tools/edge-creation-tool.ts +18 -9
- package/src/features/tools/edge-edit-tool.ts +20 -16
- package/src/features/tools/enable-default-tools-on-focus-loss.ts +33 -0
- package/src/features/tools/marquee-behavior.ts +2 -2
- package/src/features/tools/marquee-mouse-tool.ts +8 -9
- package/src/features/tools/marquee-tool.ts +1 -1
- package/src/features/tools/model.ts +2 -1
- package/src/features/tools/node-creation-tool.ts +5 -5
- package/src/features/validation/di.config.ts +13 -11
- package/src/features/validation/marker-navigator.spec.ts +4 -2
- package/src/features/validation/marker-navigator.ts +65 -82
- package/src/features/validation/validate.ts +55 -85
- package/src/features/viewport/di.config.ts +1 -2
- package/src/features/viewport/glsp-scroll-mouse-listener.ts +3 -3
- package/src/index.ts +9 -9
- package/src/lib/model.ts +2 -1
- package/src/model-source/glsp-diagram-server.ts +9 -11
- package/src/sprotty-reexport.ts +283 -0
- package/src/utils/layout-utils.ts +9 -29
- package/src/utils/smodel-util.ts +36 -20
- package/src/utils/viewpoint-util.ts +5 -14
- package/src/views/base-view-module.ts +5 -1
- package/lib/features/layout/layout-commands.d.ts +0 -153
- package/lib/features/layout/layout-commands.d.ts.map +0 -1
- package/lib/features/layout/layout-commands.js +0 -415
- package/lib/features/layout/layout-commands.js.map +0 -1
- package/lib/features/layout/layout-commands.spec.d.ts +0 -3
- package/lib/features/layout/layout-commands.spec.d.ts.map +0 -1
- package/lib/features/layout/layout-commands.spec.js.map +0 -1
- package/lib/features/tool-palette/palette-item.d.ts.map +0 -1
- package/lib/features/tool-palette/palette-item.js.map +0 -1
- package/lib/protocol-reexport.d.ts +0 -45
- package/lib/protocol-reexport.d.ts.map +0 -1
- package/lib/protocol-reexport.js +0 -80
- package/lib/protocol-reexport.js.map +0 -1
- package/src/features/layout/layout-commands.ts +0 -424
- package/src/features/tool-palette/palette-item.ts +0 -38
- package/src/protocol-reexport.ts +0 -64
package/src/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2019-
|
|
2
|
+
* Copyright (c) 2019-2022 EclipseSource and others.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made available under the
|
|
5
5
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -21,7 +21,7 @@ import glspDecorationModule from './features/decoration/di.config';
|
|
|
21
21
|
import glspEditLabelModule from './features/edit-label/di.config';
|
|
22
22
|
import modelHintsModule from './features/hints/di.config';
|
|
23
23
|
import glspHoverModule from './features/hover/di.config';
|
|
24
|
-
import
|
|
24
|
+
import layoutModule from './features/layout/di.config';
|
|
25
25
|
import modelSourceWatcherModule from './features/model-source-watcher/di.config';
|
|
26
26
|
import glspMouseToolModule from './features/mouse-tool/di.config';
|
|
27
27
|
import { navigationModule } from './features/navigation/di.config';
|
|
@@ -29,11 +29,10 @@ import saveModule from './features/save/di.config';
|
|
|
29
29
|
import glspSelectModule from './features/select/di.config';
|
|
30
30
|
import toolFeedbackModule from './features/tool-feedback/di.config';
|
|
31
31
|
import paletteModule from './features/tool-palette/di.config';
|
|
32
|
-
import toolsModule from './features/tools/di.config';
|
|
32
|
+
import { enableDefaultToolsOnFocusLossModule, toolsModule } from './features/tools/di.config';
|
|
33
33
|
import { markerNavigatorModule, validationModule } from './features/validation/di.config';
|
|
34
34
|
import glspViewportModule from './features/viewport/di.config';
|
|
35
35
|
|
|
36
|
-
export * from 'sprotty';
|
|
37
36
|
export * from './base/action-dispatcher';
|
|
38
37
|
export * from './base/actions/focus-change-action';
|
|
39
38
|
export * from './base/argumentable';
|
|
@@ -51,6 +50,7 @@ export * from './base/model/model-registry';
|
|
|
51
50
|
export * from './base/model/update-model-command';
|
|
52
51
|
export * from './base/selection-clearing-mouse-listener';
|
|
53
52
|
export * from './base/source-uri-aware';
|
|
53
|
+
export * from './base/tool-manager/tool-actions';
|
|
54
54
|
export * from './base/types';
|
|
55
55
|
export * from './base/view/view-registry';
|
|
56
56
|
export * from './features/change-bounds/model';
|
|
@@ -65,7 +65,7 @@ export * from './features/edit-label/edit-label-validator';
|
|
|
65
65
|
export * from './features/hints/model';
|
|
66
66
|
export * from './features/hints/type-hints';
|
|
67
67
|
export * from './features/hover/hover';
|
|
68
|
-
export * from './features/layout/layout-
|
|
68
|
+
export * from './features/layout/layout-elements-action';
|
|
69
69
|
export * from './features/model-source-watcher/model-source-changed-action-handler';
|
|
70
70
|
export * from './features/mouse-tool/mouse-tool';
|
|
71
71
|
export * from './features/navigation/navigation-action-handler';
|
|
@@ -80,22 +80,21 @@ export * from './features/tool-feedback/css-feedback';
|
|
|
80
80
|
export * from './features/tool-feedback/edge-edit-tool-feedback';
|
|
81
81
|
export * from './features/tool-feedback/feedback-action-dispatcher';
|
|
82
82
|
export * from './features/tool-feedback/model';
|
|
83
|
-
export * from './features/tool-palette/palette-item';
|
|
84
83
|
export * from './features/tool-palette/tool-palette';
|
|
85
84
|
export * from './features/tools/base-glsp-tool';
|
|
86
85
|
export * from './features/tools/change-bounds-tool';
|
|
87
86
|
export * from './features/tools/delete-tool';
|
|
88
87
|
export * from './features/tools/edge-creation-tool';
|
|
89
88
|
export * from './features/tools/edge-edit-tool';
|
|
90
|
-
export * from './features/tools/node-creation-tool';
|
|
91
89
|
export * from './features/tools/marquee-behavior';
|
|
90
|
+
export * from './features/tools/node-creation-tool';
|
|
92
91
|
export * from './features/validation/issue-marker';
|
|
93
92
|
export * from './features/validation/marker-navigator';
|
|
94
93
|
export * from './features/validation/validate';
|
|
95
94
|
export * from './features/viewport/glsp-scroll-mouse-listener';
|
|
96
95
|
export * from './lib/model';
|
|
97
96
|
export * from './model-source/glsp-diagram-server';
|
|
98
|
-
export * from './
|
|
97
|
+
export * from './sprotty-reexport';
|
|
99
98
|
export * from './utils/argument-utils';
|
|
100
99
|
export * from './utils/marker';
|
|
101
100
|
export * from './utils/smodel-util';
|
|
@@ -114,10 +113,11 @@ export {
|
|
|
114
113
|
copyPasteContextMenuModule,
|
|
115
114
|
glspSelectModule,
|
|
116
115
|
glspMouseToolModule,
|
|
117
|
-
|
|
116
|
+
layoutModule,
|
|
118
117
|
glspEditLabelModule,
|
|
119
118
|
glspHoverModule,
|
|
120
119
|
toolsModule,
|
|
120
|
+
enableDefaultToolsOnFocusLossModule,
|
|
121
121
|
navigationModule,
|
|
122
122
|
markerNavigatorModule,
|
|
123
123
|
glspDecorationModule,
|
package/src/lib/model.ts
CHANGED
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
import {
|
|
16
|
+
import { SModelElementSchema } from '@eclipse-glsp/protocol';
|
|
17
|
+
import { exportFeature, SGraph, SModelElement, viewportFeature } from 'sprotty';
|
|
17
18
|
import { Containable, containerFeature } from '../features/hints/model';
|
|
18
19
|
import { Saveable, saveFeature } from '../features/save/model';
|
|
19
20
|
|
|
@@ -15,23 +15,21 @@
|
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
import {
|
|
17
17
|
Action,
|
|
18
|
+
ActionMessage,
|
|
18
19
|
ComputedBoundsAction,
|
|
19
|
-
ExportSvgAction,
|
|
20
20
|
GLSPClient,
|
|
21
|
-
|
|
22
|
-
isServerMessageAction,
|
|
23
|
-
isSetEditModeAction,
|
|
21
|
+
RequestModelAction,
|
|
24
22
|
ServerMessageAction,
|
|
25
23
|
SetEditModeAction
|
|
26
24
|
} from '@eclipse-glsp/protocol';
|
|
27
25
|
import { injectable } from 'inversify';
|
|
28
|
-
import { ActionHandlerRegistry,
|
|
26
|
+
import { ActionHandlerRegistry, DiagramServerProxy, ExportSvgAction, ICommand, ServerStatusAction, SwitchEditModeCommand } from 'sprotty';
|
|
29
27
|
import { SourceUriAware } from '../base/source-uri-aware';
|
|
30
28
|
|
|
31
29
|
const receivedFromServerProperty = '__receivedFromServer';
|
|
32
30
|
|
|
33
31
|
@injectable()
|
|
34
|
-
export class GLSPDiagramServer extends
|
|
32
|
+
export class GLSPDiagramServer extends DiagramServerProxy implements SourceUriAware {
|
|
35
33
|
protected _sourceUri: string;
|
|
36
34
|
protected _glspClient?: GLSPClient;
|
|
37
35
|
protected ready = false;
|
|
@@ -63,17 +61,17 @@ export class GLSPDiagramServer extends DiagramServer implements SourceUriAware {
|
|
|
63
61
|
}
|
|
64
62
|
|
|
65
63
|
override handle(action: Action): void | ICommand | Action {
|
|
66
|
-
if (
|
|
64
|
+
if (RequestModelAction.is(action) && action.options) {
|
|
67
65
|
this._sourceUri = action.options.sourceUri as string;
|
|
68
66
|
}
|
|
69
67
|
return super.handle(action);
|
|
70
68
|
}
|
|
71
69
|
|
|
72
70
|
override handleLocally(action: Action): boolean {
|
|
73
|
-
if (
|
|
71
|
+
if (ServerMessageAction.is(action)) {
|
|
74
72
|
return this.handleServerMessageAction(action);
|
|
75
73
|
}
|
|
76
|
-
if (
|
|
74
|
+
if (SetEditModeAction.is(action)) {
|
|
77
75
|
return this.handleSetEditModeAction(action);
|
|
78
76
|
}
|
|
79
77
|
return super.handleLocally(action);
|
|
@@ -92,7 +90,7 @@ export class GLSPDiagramServer extends DiagramServer implements SourceUriAware {
|
|
|
92
90
|
return !isReceivedFromServer(action);
|
|
93
91
|
}
|
|
94
92
|
|
|
95
|
-
public
|
|
93
|
+
public get sourceURI(): string {
|
|
96
94
|
return this._sourceUri;
|
|
97
95
|
}
|
|
98
96
|
}
|
|
@@ -101,7 +99,7 @@ export function isReceivedFromServer(action: Action): boolean {
|
|
|
101
99
|
return (action as any)[receivedFromServerProperty] === true;
|
|
102
100
|
}
|
|
103
101
|
|
|
104
|
-
export function registerDefaultGLSPServerActions(registry: ActionHandlerRegistry, diagramServer:
|
|
102
|
+
export function registerDefaultGLSPServerActions(registry: ActionHandlerRegistry, diagramServer: DiagramServerProxy): void {
|
|
105
103
|
registry.register(ServerMessageAction.KIND, diagramServer);
|
|
106
104
|
registry.register(ServerStatusAction.KIND, diagramServer);
|
|
107
105
|
registry.register(ExportSvgAction.KIND, diagramServer);
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2022 STMicroelectronics and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
*
|
|
8
|
+
* This Source Code may also be made available under the following Secondary
|
|
9
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
* with the GNU Classpath Exception which is available at
|
|
12
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
*
|
|
14
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
+
********************************************************************************/
|
|
16
|
+
/**
|
|
17
|
+
* Sprotty still keeps the old class based action definitions as deprecated API.
|
|
18
|
+
* This causes name clashes with the GLSP protocol actions when reexport sprotty.
|
|
19
|
+
* The deprecated definitions are planned to be removed with Sprotty 1.0.0.
|
|
20
|
+
* Until then we have to manually reexport the sprotty main index and exclude the clashing types.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
export * from '@eclipse-glsp/protocol';
|
|
24
|
+
// sprotty-protocol
|
|
25
|
+
export { CollapseExpandAction, CollapseExpandAllAction, ElementAndAlignment, SetBoundsAction } from 'sprotty-protocol/lib/actions';
|
|
26
|
+
export { Viewport } from 'sprotty-protocol/lib/model';
|
|
27
|
+
// ------------------ Base ------------------
|
|
28
|
+
export * from 'sprotty/lib/base/actions/action-dispatcher';
|
|
29
|
+
export * from 'sprotty/lib/base/actions/action-handler';
|
|
30
|
+
export * from 'sprotty/lib/base/actions/diagram-locker';
|
|
31
|
+
export * from 'sprotty/lib/base/animations/animation';
|
|
32
|
+
export * from 'sprotty/lib/base/animations/animation-frame-syncer';
|
|
33
|
+
export * from 'sprotty/lib/base/animations/easing';
|
|
34
|
+
export * from 'sprotty/lib/base/commands/command';
|
|
35
|
+
export * from 'sprotty/lib/base/commands/command-registration';
|
|
36
|
+
export * from 'sprotty/lib/base/commands/command-stack';
|
|
37
|
+
export * from 'sprotty/lib/base/commands/command-stack-options';
|
|
38
|
+
export * from 'sprotty/lib/base/features/initialize-canvas';
|
|
39
|
+
export { SetModelCommand } from 'sprotty/lib/base/features/set-model';
|
|
40
|
+
export {
|
|
41
|
+
createRandomId,
|
|
42
|
+
FeatureSet,
|
|
43
|
+
IModelIndex,
|
|
44
|
+
isParent,
|
|
45
|
+
ModelIndexImpl,
|
|
46
|
+
SChildElement,
|
|
47
|
+
SModelElement,
|
|
48
|
+
SModelRoot,
|
|
49
|
+
SParentElement
|
|
50
|
+
} from 'sprotty/lib/base/model/smodel';
|
|
51
|
+
export * from 'sprotty/lib/base/model/smodel-extension';
|
|
52
|
+
export * from 'sprotty/lib/base/model/smodel-factory';
|
|
53
|
+
export {
|
|
54
|
+
containsSome,
|
|
55
|
+
findParent,
|
|
56
|
+
findParentByFeature,
|
|
57
|
+
registerModelElement,
|
|
58
|
+
translateBounds,
|
|
59
|
+
translatePoint
|
|
60
|
+
} from 'sprotty/lib/base/model/smodel-utils';
|
|
61
|
+
export * from 'sprotty/lib/base/tool-manager/tool';
|
|
62
|
+
export * from 'sprotty/lib/base/tool-manager/tool-manager';
|
|
63
|
+
export * from 'sprotty/lib/base/ui-extensions/ui-extension';
|
|
64
|
+
export * from 'sprotty/lib/base/ui-extensions/ui-extension-registry';
|
|
65
|
+
export * from 'sprotty/lib/base/views/key-tool';
|
|
66
|
+
export * from 'sprotty/lib/base/views/mouse-tool';
|
|
67
|
+
export * from 'sprotty/lib/base/views/thunk-view';
|
|
68
|
+
export * from 'sprotty/lib/base/views/view';
|
|
69
|
+
export * from 'sprotty/lib/base/views/viewer';
|
|
70
|
+
export * from 'sprotty/lib/base/views/viewer-cache';
|
|
71
|
+
export * from 'sprotty/lib/base/views/viewer-options';
|
|
72
|
+
export * from 'sprotty/lib/base/views/vnode-postprocessor';
|
|
73
|
+
export * from 'sprotty/lib/base/views/vnode-utils';
|
|
74
|
+
// ------------------ Features ------------------
|
|
75
|
+
export {
|
|
76
|
+
RequestBoundsCommand,
|
|
77
|
+
ResolvedElementAndAlignment,
|
|
78
|
+
ResolvedElementAndBounds,
|
|
79
|
+
SetBoundsCommand
|
|
80
|
+
} from 'sprotty/lib/features/bounds/bounds-manipulation';
|
|
81
|
+
export * from 'sprotty/lib/features/bounds/hbox-layout';
|
|
82
|
+
export * from 'sprotty/lib/features/bounds/hidden-bounds-updater';
|
|
83
|
+
export * from 'sprotty/lib/features/bounds/layout';
|
|
84
|
+
export {
|
|
85
|
+
Alignable,
|
|
86
|
+
alignFeature,
|
|
87
|
+
BoundsAware,
|
|
88
|
+
boundsFeature,
|
|
89
|
+
findChildrenAtPosition,
|
|
90
|
+
getAbsoluteBounds,
|
|
91
|
+
getAbsoluteClientBounds,
|
|
92
|
+
isAlignable,
|
|
93
|
+
isBoundsAware,
|
|
94
|
+
isLayoutableChild,
|
|
95
|
+
isLayoutContainer,
|
|
96
|
+
isSizeable,
|
|
97
|
+
LayoutableChild,
|
|
98
|
+
layoutableChildFeature,
|
|
99
|
+
LayoutContainer,
|
|
100
|
+
layoutContainerFeature,
|
|
101
|
+
ModelLayoutOptions,
|
|
102
|
+
SShapeElement
|
|
103
|
+
} from 'sprotty/lib/features/bounds/model';
|
|
104
|
+
export * from 'sprotty/lib/features/bounds/stack-layout';
|
|
105
|
+
export * from 'sprotty/lib/features/bounds/vbox-layout';
|
|
106
|
+
export * from 'sprotty/lib/features/bounds/views';
|
|
107
|
+
export * from 'sprotty/lib/features/button/button-handler';
|
|
108
|
+
export * from 'sprotty/lib/features/button/model';
|
|
109
|
+
export * from 'sprotty/lib/features/command-palette/action-providers';
|
|
110
|
+
export * from 'sprotty/lib/features/command-palette/command-palette';
|
|
111
|
+
export { Anchor, IContextMenuService, IContextMenuServiceProvider } from 'sprotty/lib/features/context-menu/context-menu-service';
|
|
112
|
+
export * from 'sprotty/lib/features/context-menu/menu-providers';
|
|
113
|
+
export * from 'sprotty/lib/features/context-menu/mouse-listener';
|
|
114
|
+
export * from 'sprotty/lib/features/decoration/decoration-placer';
|
|
115
|
+
export * from 'sprotty/lib/features/decoration/model';
|
|
116
|
+
export * from 'sprotty/lib/features/decoration/views';
|
|
117
|
+
export * from 'sprotty/lib/features/edge-intersection/intersection-finder';
|
|
118
|
+
export * from 'sprotty/lib/features/edge-intersection/sweepline';
|
|
119
|
+
export * from 'sprotty/lib/features/edge-layout/di.config';
|
|
120
|
+
export * from 'sprotty/lib/features/edge-layout/edge-layout';
|
|
121
|
+
export * from 'sprotty/lib/features/edge-layout/model';
|
|
122
|
+
export * from 'sprotty/lib/features/edit/create';
|
|
123
|
+
export * from 'sprotty/lib/features/edit/create-on-drag';
|
|
124
|
+
export * from 'sprotty/lib/features/edit/delete';
|
|
125
|
+
export * from 'sprotty/lib/features/edit/di.config';
|
|
126
|
+
export * from 'sprotty/lib/features/edit/edit-label';
|
|
127
|
+
export * from 'sprotty/lib/features/edit/edit-label-ui';
|
|
128
|
+
export * from 'sprotty/lib/features/edit/edit-routing';
|
|
129
|
+
export * from 'sprotty/lib/features/edit/model';
|
|
130
|
+
export * from 'sprotty/lib/features/edit/reconnect';
|
|
131
|
+
export * from 'sprotty/lib/features/expand/expand';
|
|
132
|
+
export * from 'sprotty/lib/features/expand/model';
|
|
133
|
+
export * from 'sprotty/lib/features/expand/views';
|
|
134
|
+
export { ExportSvgCommand, ExportSvgKeyListener, ExportSvgPostprocessor, RequestExportSvgAction } from 'sprotty/lib/features/export/export';
|
|
135
|
+
export * from 'sprotty/lib/features/export/model';
|
|
136
|
+
export { SvgExporter } from 'sprotty/lib/features/export/svg-exporter';
|
|
137
|
+
export * from 'sprotty/lib/features/fade/fade';
|
|
138
|
+
export * from 'sprotty/lib/features/fade/model';
|
|
139
|
+
export {
|
|
140
|
+
AbstractHoverMouseListener,
|
|
141
|
+
ClosePopupActionHandler,
|
|
142
|
+
HoverFeedbackAction,
|
|
143
|
+
HoverFeedbackCommand,
|
|
144
|
+
HoverKeyListener,
|
|
145
|
+
HoverMouseListener,
|
|
146
|
+
HoverState,
|
|
147
|
+
PopupHoverMouseListener,
|
|
148
|
+
SetPopupModelCommand
|
|
149
|
+
} from 'sprotty/lib/features/hover/hover';
|
|
150
|
+
export * from 'sprotty/lib/features/hover/model';
|
|
151
|
+
export * from 'sprotty/lib/features/move/model';
|
|
152
|
+
export * from 'sprotty/lib/features/move/move';
|
|
153
|
+
export * from 'sprotty/lib/features/move/snap';
|
|
154
|
+
export * from 'sprotty/lib/features/nameable/model';
|
|
155
|
+
export * from 'sprotty/lib/features/open/model';
|
|
156
|
+
export * from 'sprotty/lib/features/open/open';
|
|
157
|
+
export * from 'sprotty/lib/features/projection/model';
|
|
158
|
+
export * from 'sprotty/lib/features/projection/views';
|
|
159
|
+
export * from 'sprotty/lib/features/routing/abstract-edge-router';
|
|
160
|
+
export * from 'sprotty/lib/features/routing/anchor';
|
|
161
|
+
export * from 'sprotty/lib/features/routing/bezier-anchors';
|
|
162
|
+
export * from 'sprotty/lib/features/routing/bezier-edge-router';
|
|
163
|
+
export * from 'sprotty/lib/features/routing/manhattan-anchors';
|
|
164
|
+
export * from 'sprotty/lib/features/routing/manhattan-edge-router';
|
|
165
|
+
export * from 'sprotty/lib/features/routing/model';
|
|
166
|
+
export * from 'sprotty/lib/features/routing/polyline-anchors';
|
|
167
|
+
export * from 'sprotty/lib/features/routing/polyline-edge-router';
|
|
168
|
+
export * from 'sprotty/lib/features/routing/routing';
|
|
169
|
+
export * from 'sprotty/lib/features/routing/views';
|
|
170
|
+
export * from 'sprotty/lib/features/select/model';
|
|
171
|
+
export {
|
|
172
|
+
GetSelectionAction,
|
|
173
|
+
GetSelectionCommand,
|
|
174
|
+
SelectAllCommand,
|
|
175
|
+
SelectCommand,
|
|
176
|
+
SelectionResult,
|
|
177
|
+
SelectKeyboardListener,
|
|
178
|
+
SelectMouseListener
|
|
179
|
+
} from 'sprotty/lib/features/select/select';
|
|
180
|
+
export * from 'sprotty/lib/features/undo-redo/undo-redo';
|
|
181
|
+
export * from 'sprotty/lib/features/update/model-matching';
|
|
182
|
+
export { UpdateAnimationData, UpdateModelCommand } from 'sprotty/lib/features/update/update-model';
|
|
183
|
+
export {
|
|
184
|
+
BoundsAwareViewportCommand,
|
|
185
|
+
CenterCommand,
|
|
186
|
+
CenterKeyboardListener,
|
|
187
|
+
FitToScreenCommand
|
|
188
|
+
} from 'sprotty/lib/features/viewport/center-fit';
|
|
189
|
+
export * from 'sprotty/lib/features/viewport/model';
|
|
190
|
+
export * from 'sprotty/lib/features/viewport/scroll';
|
|
191
|
+
export {
|
|
192
|
+
GetViewportAction,
|
|
193
|
+
GetViewportCommand,
|
|
194
|
+
SetViewportCommand,
|
|
195
|
+
ViewportAnimation,
|
|
196
|
+
ViewportResult
|
|
197
|
+
} from 'sprotty/lib/features/viewport/viewport';
|
|
198
|
+
export * from 'sprotty/lib/features/viewport/viewport-root';
|
|
199
|
+
export * from 'sprotty/lib/features/viewport/zoom';
|
|
200
|
+
export * from 'sprotty/lib/features/zorder/zorder';
|
|
201
|
+
export { SCompartment, SEdge, SGraph, SGraphIndex, SLabel, SNode, SPort } from 'sprotty/lib/graph/sgraph';
|
|
202
|
+
// ------------------ Graph ------------------
|
|
203
|
+
export * from 'sprotty/lib/graph/sgraph-factory';
|
|
204
|
+
export * from 'sprotty/lib/graph/views';
|
|
205
|
+
export * from 'sprotty/lib/lib/generic-views';
|
|
206
|
+
export * from 'sprotty/lib/lib/html-views';
|
|
207
|
+
export * from 'sprotty/lib/lib/jsx';
|
|
208
|
+
export {
|
|
209
|
+
CircularNode,
|
|
210
|
+
CircularPort,
|
|
211
|
+
DiamondNode,
|
|
212
|
+
ForeignObjectElement,
|
|
213
|
+
HtmlRoot,
|
|
214
|
+
PreRenderedElement,
|
|
215
|
+
RectangularNode,
|
|
216
|
+
RectangularPort,
|
|
217
|
+
ShapedPreRenderedElement
|
|
218
|
+
} from 'sprotty/lib/lib/model';
|
|
219
|
+
// ------------------ Library ------------------
|
|
220
|
+
export * from 'sprotty/lib/lib/modules';
|
|
221
|
+
export * from 'sprotty/lib/lib/svg-views';
|
|
222
|
+
// ------------------ Model Source ------------------
|
|
223
|
+
export * from 'sprotty/lib/model-source/commit-model';
|
|
224
|
+
export { DiagramServerProxy } from 'sprotty/lib/model-source/diagram-server';
|
|
225
|
+
export * from 'sprotty/lib/model-source/local-model-source';
|
|
226
|
+
export * from 'sprotty/lib/model-source/logging';
|
|
227
|
+
export * from 'sprotty/lib/model-source/model-source';
|
|
228
|
+
export * from 'sprotty/lib/model-source/websocket';
|
|
229
|
+
// ------------------ Utilities ------------------
|
|
230
|
+
export * from 'sprotty/lib/utils/browser';
|
|
231
|
+
export * from 'sprotty/lib/utils/codicon';
|
|
232
|
+
export * from 'sprotty/lib/utils/color';
|
|
233
|
+
export { Diamond, Insets, intersection, Line, Orientation, PointToPointLine } from 'sprotty/lib/utils/geometry';
|
|
234
|
+
export * from 'sprotty/lib/utils/inversify';
|
|
235
|
+
export * from 'sprotty/lib/utils/logging';
|
|
236
|
+
export * from 'sprotty/lib/utils/registry';
|
|
237
|
+
export { defaultModule };
|
|
238
|
+
export {
|
|
239
|
+
graphModule,
|
|
240
|
+
boundsModule,
|
|
241
|
+
buttonModule,
|
|
242
|
+
commandPaletteModule,
|
|
243
|
+
contextMenuModule,
|
|
244
|
+
decorationModule,
|
|
245
|
+
edgeIntersectionModule,
|
|
246
|
+
edgeLayoutModule,
|
|
247
|
+
expandModule,
|
|
248
|
+
exportModule,
|
|
249
|
+
fadeModule,
|
|
250
|
+
hoverModule,
|
|
251
|
+
moveModule,
|
|
252
|
+
openModule,
|
|
253
|
+
routingModule,
|
|
254
|
+
selectModule,
|
|
255
|
+
undoRedoModule,
|
|
256
|
+
updateModule,
|
|
257
|
+
viewportModule,
|
|
258
|
+
zorderModule
|
|
259
|
+
};
|
|
260
|
+
export { modelSourceModule };
|
|
261
|
+
|
|
262
|
+
import defaultModule from 'sprotty/lib/base/di.config';
|
|
263
|
+
import boundsModule from 'sprotty/lib/features/bounds/di.config';
|
|
264
|
+
import buttonModule from 'sprotty/lib/features/button/di.config';
|
|
265
|
+
import commandPaletteModule from 'sprotty/lib/features/command-palette/di.config';
|
|
266
|
+
import contextMenuModule from 'sprotty/lib/features/context-menu/di.config';
|
|
267
|
+
import decorationModule from 'sprotty/lib/features/decoration/di.config';
|
|
268
|
+
import edgeIntersectionModule from 'sprotty/lib/features/edge-intersection/di.config';
|
|
269
|
+
import edgeLayoutModule from 'sprotty/lib/features/edge-layout/di.config';
|
|
270
|
+
import expandModule from 'sprotty/lib/features/expand/di.config';
|
|
271
|
+
import exportModule from 'sprotty/lib/features/export/di.config';
|
|
272
|
+
import fadeModule from 'sprotty/lib/features/fade/di.config';
|
|
273
|
+
import hoverModule from 'sprotty/lib/features/hover/di.config';
|
|
274
|
+
import moveModule from 'sprotty/lib/features/move/di.config';
|
|
275
|
+
import openModule from 'sprotty/lib/features/open/di.config';
|
|
276
|
+
import routingModule from 'sprotty/lib/features/routing/di.config';
|
|
277
|
+
import selectModule from 'sprotty/lib/features/select/di.config';
|
|
278
|
+
import undoRedoModule from 'sprotty/lib/features/undo-redo/di.config';
|
|
279
|
+
import updateModule from 'sprotty/lib/features/update/di.config';
|
|
280
|
+
import viewportModule from 'sprotty/lib/features/viewport/di.config';
|
|
281
|
+
import zorderModule from 'sprotty/lib/features/zorder/di.config';
|
|
282
|
+
import graphModule from 'sprotty/lib/graph/di.config';
|
|
283
|
+
import modelSourceModule from 'sprotty/lib/model-source/di.config';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2020-
|
|
2
|
+
* Copyright (c) 2020-2022 EclipseSource and others.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made available under the
|
|
5
5
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
import { Point } from '@eclipse-glsp/protocol';
|
|
17
|
-
import { BoundsAware,
|
|
16
|
+
import { Dimension, ElementAndBounds, Point, Writable } from '@eclipse-glsp/protocol';
|
|
17
|
+
import { BoundsAware, ElementMove, ModelLayoutOptions, SModelElement } from 'sprotty';
|
|
18
18
|
import { IMovementRestrictor } from '../features/change-bounds/movement-restrictor';
|
|
19
19
|
|
|
20
20
|
export function minWidth(element: SModelElement & BoundsAware): number {
|
|
@@ -45,18 +45,18 @@ export function isValidSize(element: SModelElement & BoundsAware, size: Dimensio
|
|
|
45
45
|
return size.width >= minWidth(element) && size.height >= minHeight(element);
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
export function isValidMove(element: SModelElement & BoundsAware, newPosition
|
|
48
|
+
export function isValidMove(element: SModelElement & BoundsAware, newPosition?: Point, movementRestrictor?: IMovementRestrictor): boolean {
|
|
49
49
|
if (movementRestrictor) {
|
|
50
|
-
return movementRestrictor.validate(
|
|
50
|
+
return movementRestrictor.validate(element, newPosition);
|
|
51
51
|
}
|
|
52
52
|
return true;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
export function toValidElementMove(
|
|
56
56
|
element: SModelElement & BoundsAware,
|
|
57
|
-
move:
|
|
57
|
+
move: ElementMove,
|
|
58
58
|
movementRestrictor?: IMovementRestrictor
|
|
59
|
-
):
|
|
59
|
+
): ElementMove | undefined {
|
|
60
60
|
if (!isValidMove(element, move.toPosition, movementRestrictor)) {
|
|
61
61
|
return;
|
|
62
62
|
}
|
|
@@ -65,9 +65,9 @@ export function toValidElementMove(
|
|
|
65
65
|
|
|
66
66
|
export function toValidElementAndBounds(
|
|
67
67
|
element: SModelElement & BoundsAware,
|
|
68
|
-
bounds:
|
|
68
|
+
bounds: Writable<ElementAndBounds>,
|
|
69
69
|
movementRestrictor?: IMovementRestrictor
|
|
70
|
-
):
|
|
70
|
+
): ElementAndBounds | undefined {
|
|
71
71
|
if (!isValidMove(element, bounds.newPosition, movementRestrictor)) {
|
|
72
72
|
return;
|
|
73
73
|
}
|
|
@@ -81,23 +81,3 @@ export function toValidElementAndBounds(
|
|
|
81
81
|
}
|
|
82
82
|
return bounds;
|
|
83
83
|
}
|
|
84
|
-
|
|
85
|
-
export interface WriteablePoint extends Point {
|
|
86
|
-
x: number;
|
|
87
|
-
y: number;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
export interface WriteableElementMove extends ElementMove {
|
|
91
|
-
fromPosition?: WriteablePoint;
|
|
92
|
-
toPosition: WriteablePoint;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
export interface WriteableDimension extends Dimension {
|
|
96
|
-
width: number;
|
|
97
|
-
height: number;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
export interface WriteableElementAndBounds extends ElementAndBounds {
|
|
101
|
-
newPosition: WriteablePoint;
|
|
102
|
-
newSize: WriteableDimension;
|
|
103
|
-
}
|
package/src/utils/smodel-util.ts
CHANGED
|
@@ -13,18 +13,16 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
import { distinctAdd, ElementAndRoutingPoints, remove } from '@eclipse-glsp/protocol';
|
|
16
|
+
import { distinctAdd, ElementAndBounds, ElementAndRoutingPoints, remove, SModelElementSchema, TypeGuard } from '@eclipse-glsp/protocol';
|
|
17
17
|
import {
|
|
18
18
|
BoundsAware,
|
|
19
|
-
ElementAndBounds,
|
|
20
19
|
isBoundsAware,
|
|
21
20
|
isMoveable,
|
|
22
21
|
isSelectable,
|
|
23
22
|
isSelected,
|
|
23
|
+
ModelIndexImpl,
|
|
24
24
|
Selectable,
|
|
25
25
|
SModelElement,
|
|
26
|
-
SModelElementSchema,
|
|
27
|
-
SModelIndex,
|
|
28
26
|
SRoutableElement,
|
|
29
27
|
SRoutingHandle
|
|
30
28
|
} from 'sprotty';
|
|
@@ -32,31 +30,31 @@ import { FluentIterable } from 'sprotty/lib/utils/iterable';
|
|
|
32
30
|
|
|
33
31
|
/**
|
|
34
32
|
* Helper type to represent a filter predicate for {@link SModelElement}s. This is used to retrieve
|
|
35
|
-
* elements from the {@link
|
|
33
|
+
* elements from the {@link ModelIndexImpl} that also conform to a second type `T`. Its mainly used for
|
|
36
34
|
* retrieving elements that also implement a certain model features (e.g. selectable)
|
|
37
35
|
*/
|
|
38
36
|
export type ModelFilterPredicate<T> = (modelElement: SModelElement) => modelElement is SModelElement & T;
|
|
39
37
|
|
|
40
38
|
/**
|
|
41
|
-
* Retrieves all elements from the given {@link
|
|
42
|
-
* @param index The {@link
|
|
39
|
+
* Retrieves all elements from the given {@link ModelIndexImpl} that match the given {@link ModelFilterPredicate}
|
|
40
|
+
* @param index The {@link ModelIndexImpl}.
|
|
43
41
|
* @param predicate The {@link ModelFilterPredicate} that should be used.
|
|
44
42
|
* @returns A {@link FluentIterable} of all indexed element that match the predicate
|
|
45
43
|
* (correctly casted to also include the additional type of the predicate).
|
|
46
44
|
*/
|
|
47
|
-
export function filter<T>(index:
|
|
45
|
+
export function filter<T>(index: ModelIndexImpl, predicate: ModelFilterPredicate<T>): FluentIterable<SModelElement & T> {
|
|
48
46
|
return index.all().filter(predicate) as FluentIterable<SModelElement & T>;
|
|
49
47
|
}
|
|
50
48
|
|
|
51
49
|
/**
|
|
52
|
-
* Retrieves all elements from the given {@link
|
|
50
|
+
* Retrieves all elements from the given {@link ModelIndexImpl} that match the given {@link ModelFilterPredicate} and executes
|
|
53
51
|
* the given runnable for each element of the result set.
|
|
54
|
-
* @param index The {@link
|
|
52
|
+
* @param index The {@link ModelIndexImpl}.
|
|
55
53
|
* @param predicate The {@link ModelFilterPredicate} that should be used.
|
|
56
54
|
* @param runnable The runnable that should be executed for each matching element.
|
|
57
55
|
*/
|
|
58
56
|
export function forEachElement<T>(
|
|
59
|
-
index:
|
|
57
|
+
index: ModelIndexImpl,
|
|
60
58
|
predicate: ModelFilterPredicate<T>,
|
|
61
59
|
runnable: (modelElement: SModelElement & T) => void
|
|
62
60
|
): void {
|
|
@@ -64,33 +62,51 @@ export function forEachElement<T>(
|
|
|
64
62
|
}
|
|
65
63
|
|
|
66
64
|
/**
|
|
67
|
-
* Retrieves an array of all elements that match the given {@link ModelFilterPredicate} from the given {@link
|
|
68
|
-
* @param index The {@link
|
|
65
|
+
* Retrieves an array of all elements that match the given {@link ModelFilterPredicate} from the given {@link ModelIndexImpl}.
|
|
66
|
+
* @param index The {@link ModelIndexImpl}.
|
|
69
67
|
* @param predicate The {@link ModelFilterPredicate} that should be used.
|
|
70
68
|
* @returns An array of all indexed element that match the predicate
|
|
71
69
|
* (correctly casted to also include the additional type of the predicate).
|
|
72
70
|
*/
|
|
73
|
-
export function getMatchingElements<T>(index:
|
|
71
|
+
export function getMatchingElements<T>(index: ModelIndexImpl, predicate: ModelFilterPredicate<T>): (SModelElement & T)[] {
|
|
74
72
|
return Array.from(filter(index, predicate));
|
|
75
73
|
}
|
|
76
74
|
|
|
77
75
|
/**
|
|
78
|
-
*
|
|
79
|
-
*
|
|
76
|
+
* Invokes the given model index to retrieve the corresponding model elements for the given set of ids. Ids that
|
|
77
|
+
* have no corresponding element in the index will be ignored.
|
|
78
|
+
* @param index THe model index.
|
|
79
|
+
* @param elementsIDs The element ids.
|
|
80
|
+
* @param guard Optional typeguard. If defined only elements that match the guard will be returned.
|
|
81
|
+
* @returns An array of the model elements that correspond to the given ids and filter predicate.
|
|
82
|
+
*/
|
|
83
|
+
export function getElements<S extends SModelElement>(index: ModelIndexImpl, elementsIDs: string[], guard?: TypeGuard<S>): S[] {
|
|
84
|
+
// Internal filter function that filters out undefined model elements and runs an optional typeguard check.
|
|
85
|
+
const filterFn = (element?: SModelElement): element is S => {
|
|
86
|
+
if (element !== undefined) {
|
|
87
|
+
return guard ? guard(element) : true;
|
|
88
|
+
}
|
|
89
|
+
return false;
|
|
90
|
+
};
|
|
91
|
+
return elementsIDs.map(id => index.getById(id)).filter(filterFn);
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Retrieves the amount of currently selected elements in the given {@link ModelIndexImpl}.
|
|
95
|
+
* @param index The {@link ModelIndexImpl}.
|
|
80
96
|
* @returns The amount of selected elements.
|
|
81
97
|
*/
|
|
82
|
-
export function getSelectedElementCount(index:
|
|
98
|
+
export function getSelectedElementCount(index: ModelIndexImpl): number {
|
|
83
99
|
let selected = 0;
|
|
84
100
|
forEachElement(index, isSelected, element => selected++);
|
|
85
101
|
return selected;
|
|
86
102
|
}
|
|
87
103
|
|
|
88
104
|
/**
|
|
89
|
-
* Helper function to check wether an any element is selected in the given {@link
|
|
90
|
-
* @param index The {@link
|
|
105
|
+
* Helper function to check wether an any element is selected in the given {@link ModelIndexImpl}.
|
|
106
|
+
* @param index The {@link ModelIndexImpl}.
|
|
91
107
|
* @returns `true` if at least one element is selected, `false` otherwise.
|
|
92
108
|
*/
|
|
93
|
-
export function hasSelectedElements(index:
|
|
109
|
+
export function hasSelectedElements(index: ModelIndexImpl): boolean {
|
|
94
110
|
return getSelectedElementCount(index) > 0;
|
|
95
111
|
}
|
|
96
112
|
|