@eclipse-glsp/client 0.9.0-next.d0112315 → 0.9.0-next.f12e3d87
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/README.md +2 -1
- package/css/command-palette.css +6 -5
- package/css/glsp-sprotty.css +17 -8
- package/css/tool-palette.css +14 -14
- package/lib/base/action-dispatcher.d.ts.map +1 -1
- package/lib/base/action-dispatcher.js +39 -60
- package/lib/base/action-dispatcher.js.map +1 -1
- package/lib/base/actions/context-actions.d.ts +1 -1
- package/lib/base/actions/context-actions.d.ts.map +1 -1
- package/lib/base/actions/context-actions.js +11 -18
- package/lib/base/actions/context-actions.js.map +1 -1
- package/lib/base/actions/edit-mode-action.d.ts.map +1 -1
- package/lib/base/actions/edit-mode-action.js +12 -17
- package/lib/base/actions/edit-mode-action.js.map +1 -1
- package/lib/base/actions/edit-validation-actions.d.ts +1 -1
- package/lib/base/actions/edit-validation-actions.d.ts.map +1 -1
- package/lib/base/actions/edit-validation-actions.js +23 -26
- package/lib/base/actions/edit-validation-actions.js.map +1 -1
- package/lib/base/actions/focus-change-action.js +4 -5
- package/lib/base/actions/focus-change-action.js.map +1 -1
- package/lib/base/args.d.ts +1 -1
- package/lib/base/args.d.ts.map +1 -1
- package/lib/base/args.js.map +1 -1
- package/lib/base/auto-complete/auto-complete-widget.d.ts +1 -1
- package/lib/base/auto-complete/auto-complete-widget.d.ts.map +1 -1
- package/lib/base/auto-complete/auto-complete-widget.js +100 -150
- package/lib/base/auto-complete/auto-complete-widget.js.map +1 -1
- package/lib/base/auto-complete/validation-decorator.d.ts +1 -1
- package/lib/base/auto-complete/validation-decorator.js +38 -60
- package/lib/base/auto-complete/validation-decorator.js.map +1 -1
- package/lib/base/command-stack.d.ts.map +1 -1
- package/lib/base/command-stack.js +19 -37
- package/lib/base/command-stack.js.map +1 -1
- package/lib/base/container-modules.d.ts +40 -0
- package/lib/base/container-modules.d.ts.map +1 -0
- package/lib/base/container-modules.js +84 -0
- package/lib/base/container-modules.js.map +1 -0
- package/lib/base/di.config.d.ts +11 -2
- package/lib/base/di.config.d.ts.map +1 -1
- package/lib/base/di.config.js +37 -37
- package/lib/base/di.config.js.map +1 -1
- package/lib/base/drag-aware-mouse-listener.d.ts +1 -1
- package/lib/base/drag-aware-mouse-listener.d.ts.map +1 -1
- package/lib/base/drag-aware-mouse-listener.js +24 -48
- package/lib/base/drag-aware-mouse-listener.js.map +1 -1
- package/lib/base/editor-context.d.ts.map +1 -1
- package/lib/base/editor-context.js +64 -128
- package/lib/base/editor-context.js.map +1 -1
- package/lib/base/focus-tracker.d.ts.map +1 -1
- package/lib/base/focus-tracker.js +19 -24
- package/lib/base/focus-tracker.js.map +1 -1
- package/lib/base/model/model-registry.js +10 -28
- package/lib/base/model/model-registry.js.map +1 -1
- package/lib/base/model/update-model-command.d.ts +2 -2
- package/lib/base/model/update-model-command.d.ts.map +1 -1
- package/lib/base/model/update-model-command.js +67 -88
- package/lib/base/model/update-model-command.js.map +1 -1
- package/lib/base/model-initialization-constraint.js +31 -52
- package/lib/base/model-initialization-constraint.js.map +1 -1
- package/lib/base/operations/operation.d.ts +5 -5
- package/lib/base/operations/operation.d.ts.map +1 -1
- package/lib/base/operations/operation.js +75 -115
- package/lib/base/operations/operation.js.map +1 -1
- package/lib/base/selection-clearing-mouse-listener.js +10 -28
- package/lib/base/selection-clearing-mouse-listener.js.map +1 -1
- package/lib/base/source-uri-aware.js +2 -5
- package/lib/base/source-uri-aware.js.map +1 -1
- package/lib/base/tool-manager/glsp-tool-manager.js +56 -137
- package/lib/base/tool-manager/glsp-tool-manager.js.map +1 -1
- package/lib/base/types.d.ts +2 -1
- package/lib/base/types.d.ts.map +1 -1
- package/lib/base/types.js +3 -2
- package/lib/base/types.js.map +1 -1
- package/lib/base/view/view-registry.js +10 -28
- package/lib/base/view/view-registry.js.map +1 -1
- package/lib/features/change-bounds/model.d.ts +3 -1
- package/lib/features/change-bounds/model.d.ts.map +1 -1
- package/lib/features/change-bounds/model.js +20 -31
- package/lib/features/change-bounds/model.js.map +1 -1
- package/lib/features/change-bounds/movement-restrictor.d.ts.map +1 -1
- package/lib/features/change-bounds/movement-restrictor.js +29 -28
- package/lib/features/change-bounds/movement-restrictor.js.map +1 -1
- package/lib/features/change-bounds/snap.js +13 -24
- package/lib/features/change-bounds/snap.js.map +1 -1
- package/lib/features/command-palette/command-palette-tool.js +30 -38
- package/lib/features/command-palette/command-palette-tool.js.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.map +1 -1
- package/lib/features/command-palette/server-command-palette-provider.js +27 -32
- package/lib/features/command-palette/server-command-palette-provider.js.map +1 -1
- package/lib/features/context-menu/delete-element-context-menu.js +19 -67
- 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 -8
- 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.map +1 -1
- package/lib/features/context-menu/selection-service-aware-context-menu-mouse-listener.js +29 -67
- 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.map +1 -1
- package/lib/features/context-menu/server-context-menu-provider.js +29 -30
- package/lib/features/context-menu/server-context-menu-provider.js.map +1 -1
- package/lib/features/copy-paste/copy-paste-actions.d.ts +1 -1
- package/lib/features/copy-paste/copy-paste-actions.d.ts.map +1 -1
- package/lib/features/copy-paste/copy-paste-actions.js +20 -30
- package/lib/features/copy-paste/copy-paste-actions.js.map +1 -1
- package/lib/features/copy-paste/copy-paste-context-menu.d.ts +5 -1
- package/lib/features/copy-paste/copy-paste-context-menu.d.ts.map +1 -1
- package/lib/features/copy-paste/copy-paste-context-menu.js +99 -72
- package/lib/features/copy-paste/copy-paste-context-menu.js.map +1 -1
- package/lib/features/copy-paste/copy-paste-handler.d.ts +2 -0
- package/lib/features/copy-paste/copy-paste-handler.d.ts.map +1 -1
- package/lib/features/copy-paste/copy-paste-handler.js +67 -67
- package/lib/features/copy-paste/copy-paste-handler.js.map +1 -1
- package/lib/features/copy-paste/di.config.js +10 -10
- 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 +13 -32
- package/lib/features/decoration/decoration-placer.js.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.js +7 -7
- package/lib/features/edit-label/di.config.js.map +1 -1
- package/lib/features/edit-label/edit-label-tool.js +20 -43
- package/lib/features/edit-label/edit-label-tool.js.map +1 -1
- package/lib/features/edit-label/edit-label-validator.d.ts.map +1 -1
- package/lib/features/edit-label/edit-label-validator.js +37 -59
- package/lib/features/edit-label/edit-label-validator.js.map +1 -1
- package/lib/features/hints/di.config.js +8 -8
- package/lib/features/hints/di.config.js.map +1 -1
- package/lib/features/hints/model.d.ts +1 -1
- package/lib/features/hints/model.d.ts.map +1 -1
- package/lib/features/hints/request-type-hints-action.d.ts +1 -1
- package/lib/features/hints/request-type-hints-action.d.ts.map +1 -1
- package/lib/features/hints/request-type-hints-action.js +12 -14
- package/lib/features/hints/request-type-hints-action.js.map +1 -1
- package/lib/features/hints/type-hints.d.ts +4 -4
- package/lib/features/hints/type-hints.d.ts.map +1 -1
- package/lib/features/hints/type-hints.js +91 -133
- package/lib/features/hints/type-hints.js.map +1 -1
- package/lib/features/hover/di.config.js +7 -7
- package/lib/features/hover/di.config.js.map +1 -1
- package/lib/features/hover/hover.d.ts.map +1 -1
- package/lib/features/hover/hover.js +35 -76
- package/lib/features/hover/hover.js.map +1 -1
- package/lib/features/layout/di.config.d.ts +5 -1
- package/lib/features/layout/di.config.d.ts.map +1 -1
- package/lib/features/layout/di.config.js +47 -7
- package/lib/features/layout/di.config.js.map +1 -1
- package/lib/features/layout/freeform-layout.d.ts +16 -0
- package/lib/features/layout/freeform-layout.d.ts.map +1 -0
- package/lib/features/layout/freeform-layout.js +107 -0
- package/lib/features/layout/freeform-layout.js.map +1 -0
- package/lib/features/layout/layout-commands.d.ts +2 -2
- package/lib/features/layout/layout-commands.d.ts.map +1 -1
- package/lib/features/layout/layout-commands.js +187 -263
- package/lib/features/layout/layout-commands.js.map +1 -1
- package/lib/features/layout/layout-commands.spec.d.ts +1 -1
- package/lib/features/layout/layout-commands.spec.js +94 -88
- package/lib/features/layout/layout-commands.spec.js.map +1 -1
- package/lib/features/layout/vbox-layout.d.ts +25 -0
- package/lib/features/layout/vbox-layout.d.ts.map +1 -0
- package/lib/features/layout/vbox-layout.js +187 -0
- package/lib/features/layout/vbox-layout.js.map +1 -0
- package/lib/features/model-source-watcher/di.config.js +6 -6
- package/lib/features/model-source-watcher/di.config.js.map +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 +38 -45
- package/lib/features/model-source-watcher/model-source-changed-action-handler.js.map +1 -1
- package/lib/features/model-source-watcher/model-source-changed-action.d.ts +1 -1
- package/lib/features/model-source-watcher/model-source-changed-action.js +4 -5
- package/lib/features/model-source-watcher/model-source-changed-action.js.map +1 -1
- package/lib/features/mouse-tool/di.config.js +5 -5
- package/lib/features/mouse-tool/di.config.js.map +1 -1
- package/lib/features/mouse-tool/mouse-tool.d.ts +2 -1
- package/lib/features/mouse-tool/mouse-tool.d.ts.map +1 -1
- package/lib/features/mouse-tool/mouse-tool.js +69 -215
- package/lib/features/mouse-tool/mouse-tool.js.map +1 -1
- package/lib/features/navigation/di.config.js +9 -9
- package/lib/features/navigation/di.config.js.map +1 -1
- package/lib/features/navigation/navigation-action-handler.d.ts.map +1 -1
- package/lib/features/navigation/navigation-action-handler.js +136 -217
- package/lib/features/navigation/navigation-action-handler.js.map +1 -1
- package/lib/features/navigation/navigation-target-resolver.d.ts.map +1 -1
- package/lib/features/navigation/navigation-target-resolver.js +57 -122
- package/lib/features/navigation/navigation-target-resolver.js.map +1 -1
- package/lib/features/navigation/navigation-target-resolver.spec.d.ts +1 -1
- package/lib/features/navigation/navigation-target-resolver.spec.js +12 -12
- package/lib/features/navigation/navigation-target-resolver.spec.js.map +1 -1
- package/lib/features/rank/model.d.ts +1 -1
- package/lib/features/rank/model.js +2 -2
- package/lib/features/rank/model.js.map +1 -1
- package/lib/features/reconnect/model.d.ts +1 -1
- package/lib/features/reconnect/model.d.ts.map +1 -1
- package/lib/features/reconnect/model.js +9 -27
- package/lib/features/reconnect/model.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 +5 -5
- package/lib/features/save/di.config.js.map +1 -1
- package/lib/features/save/save.d.ts +1 -1
- package/lib/features/save/save.js +11 -31
- package/lib/features/save/save.js.map +1 -1
- package/lib/features/select/di.config.js +11 -11
- package/lib/features/select/di.config.js.map +1 -1
- package/lib/features/select/select-feedback-action.d.ts.map +1 -1
- package/lib/features/select/select-feedback-action.js +45 -71
- package/lib/features/select/select-feedback-action.js.map +1 -1
- package/lib/features/select/select-mouse-listener.js +7 -23
- package/lib/features/select/select-mouse-listener.js.map +1 -1
- package/lib/features/select/selection-service.d.ts.map +1 -1
- package/lib/features/select/selection-service.js +132 -234
- package/lib/features/select/selection-service.js.map +1 -1
- package/lib/features/select/selection-service.spec.js +97 -124
- package/lib/features/select/selection-service.spec.js.map +1 -1
- package/lib/features/tool-feedback/change-bounds-tool-feedback.d.ts +2 -1
- package/lib/features/tool-feedback/change-bounds-tool-feedback.d.ts.map +1 -1
- package/lib/features/tool-feedback/change-bounds-tool-feedback.js +104 -127
- package/lib/features/tool-feedback/change-bounds-tool-feedback.js.map +1 -1
- package/lib/features/tool-feedback/creation-tool-feedback.d.ts.map +1 -1
- package/lib/features/tool-feedback/creation-tool-feedback.js +69 -103
- package/lib/features/tool-feedback/creation-tool-feedback.js.map +1 -1
- package/lib/features/tool-feedback/css-feedback.d.ts +3 -1
- package/lib/features/tool-feedback/css-feedback.d.ts.map +1 -1
- package/lib/features/tool-feedback/css-feedback.js +37 -81
- 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 +27 -27
- package/lib/features/tool-feedback/di.config.js.map +1 -1
- package/lib/features/tool-feedback/edge-edit-tool-feedback.d.ts +1 -1
- package/lib/features/tool-feedback/edge-edit-tool-feedback.d.ts.map +1 -1
- package/lib/features/tool-feedback/edge-edit-tool-feedback.js +147 -193
- package/lib/features/tool-feedback/edge-edit-tool-feedback.js.map +1 -1
- package/lib/features/tool-feedback/feedback-action-dispatcher.d.ts +2 -2
- package/lib/features/tool-feedback/feedback-action-dispatcher.d.ts.map +1 -1
- package/lib/features/tool-feedback/feedback-action-dispatcher.js +36 -58
- package/lib/features/tool-feedback/feedback-action-dispatcher.js.map +1 -1
- package/lib/features/tool-feedback/marquee-tool-feedback.d.ts.map +1 -1
- package/lib/features/tool-feedback/marquee-tool-feedback.js +41 -69
- package/lib/features/tool-feedback/marquee-tool-feedback.js.map +1 -1
- package/lib/features/tool-feedback/model.d.ts +1 -1
- package/lib/features/tool-feedback/model.js +11 -27
- package/lib/features/tool-feedback/model.js.map +1 -1
- package/lib/features/tool-feedback/view.d.ts +4 -4
- package/lib/features/tool-feedback/view.d.ts.map +1 -1
- package/lib/features/tool-feedback/view.js +30 -37
- package/lib/features/tool-feedback/view.js.map +1 -1
- package/lib/features/tool-palette/di.config.js +6 -6
- package/lib/features/tool-palette/di.config.js.map +1 -1
- package/lib/features/tool-palette/palette-item.d.ts +1 -1
- package/lib/features/tool-palette/palette-item.d.ts.map +1 -1
- package/lib/features/tool-palette/palette-item.js +6 -5
- package/lib/features/tool-palette/palette-item.js.map +1 -1
- package/lib/features/tool-palette/tool-palette.d.ts.map +1 -1
- package/lib/features/tool-palette/tool-palette.js +182 -259
- package/lib/features/tool-palette/tool-palette.js.map +1 -1
- package/lib/features/tools/base-glsp-tool.js +37 -44
- package/lib/features/tools/base-glsp-tool.js.map +1 -1
- package/lib/features/tools/change-bounds-tool.d.ts +3 -2
- package/lib/features/tools/change-bounds-tool.d.ts.map +1 -1
- package/lib/features/tools/change-bounds-tool.js +187 -237
- 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 +69 -102
- package/lib/features/tools/delete-tool.js.map +1 -1
- package/lib/features/tools/di.config.js +18 -18
- 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 +60 -85
- package/lib/features/tools/edge-creation-tool.js.map +1 -1
- package/lib/features/tools/edge-edit-tool.d.ts.map +1 -1
- package/lib/features/tools/edge-edit-tool.js +110 -181
- package/lib/features/tools/edge-edit-tool.js.map +1 -1
- package/lib/features/tools/marquee-mouse-tool.d.ts.map +1 -1
- package/lib/features/tools/marquee-mouse-tool.js +128 -149
- package/lib/features/tools/marquee-mouse-tool.js.map +1 -1
- package/lib/features/tools/marquee-tool.d.ts.map +1 -1
- package/lib/features/tools/marquee-tool.js +32 -58
- package/lib/features/tools/marquee-tool.js.map +1 -1
- package/lib/features/tools/model.js +4 -22
- 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 +59 -89
- package/lib/features/tools/node-creation-tool.js.map +1 -1
- package/lib/features/tools/view.d.ts +1 -1
- package/lib/features/tools/view.d.ts.map +1 -1
- package/lib/features/tools/view.js +12 -31
- package/lib/features/tools/view.js.map +1 -1
- package/lib/features/undo-redo/model.d.ts +1 -1
- package/lib/features/undo-redo/model.js +8 -12
- package/lib/features/undo-redo/model.js.map +1 -1
- package/lib/features/validation/di.config.js +12 -12
- package/lib/features/validation/di.config.js.map +1 -1
- package/lib/features/validation/issue-marker.js +13 -51
- package/lib/features/validation/issue-marker.js.map +1 -1
- package/lib/features/validation/marker-navigator.d.ts.map +1 -1
- package/lib/features/validation/marker-navigator.js +129 -163
- package/lib/features/validation/marker-navigator.js.map +1 -1
- package/lib/features/validation/marker-navigator.spec.d.ts +1 -1
- package/lib/features/validation/marker-navigator.spec.js +79 -73
- package/lib/features/validation/marker-navigator.spec.js.map +1 -1
- package/lib/features/validation/validate.d.ts +2 -2
- package/lib/features/validation/validate.d.ts.map +1 -1
- package/lib/features/validation/validate.js +161 -276
- package/lib/features/validation/validate.js.map +1 -1
- package/lib/features/viewport/di.config.js +10 -10
- package/lib/features/viewport/di.config.js.map +1 -1
- package/lib/features/viewport/glsp-scroll-mouse-listener.d.ts.map +1 -1
- package/lib/features/viewport/glsp-scroll-mouse-listener.js +16 -32
- package/lib/features/viewport/glsp-scroll-mouse-listener.js.map +1 -1
- package/lib/index.d.ts +5 -4
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +25 -23
- package/lib/index.js.map +1 -1
- package/lib/lib/model.js +11 -27
- package/lib/lib/model.js.map +1 -1
- package/lib/model-source/glsp-diagram-server.d.ts +1 -1
- package/lib/model-source/glsp-diagram-server.d.ts.map +1 -1
- package/lib/model-source/glsp-diagram-server.js +43 -118
- package/lib/model-source/glsp-diagram-server.js.map +1 -1
- package/lib/model-source/glsp-server-status.js +10 -27
- package/lib/model-source/glsp-server-status.js.map +1 -1
- package/lib/utils/argument-utils.d.ts +3 -3
- package/lib/utils/argument-utils.d.ts.map +1 -1
- package/lib/utils/argument-utils.js +27 -92
- package/lib/utils/argument-utils.js.map +1 -1
- package/lib/utils/array-utils.d.ts +1 -1
- package/lib/utils/array-utils.d.ts.map +1 -1
- package/lib/utils/array-utils.js +10 -15
- package/lib/utils/array-utils.js.map +1 -1
- package/lib/utils/html-utils.js +2 -2
- package/lib/utils/html-utils.js.map +1 -1
- package/lib/utils/layout-utils.d.ts +1 -1
- package/lib/utils/layout-utils.d.ts.map +1 -1
- package/lib/utils/layout-utils.js +5 -5
- package/lib/utils/layout-utils.js.map +1 -1
- package/lib/utils/marker.js +11 -53
- package/lib/utils/marker.js.map +1 -1
- package/lib/utils/smodel-util.d.ts +3 -3
- package/lib/utils/smodel-util.d.ts.map +1 -1
- package/lib/utils/smodel-util.js +17 -51
- package/lib/utils/smodel-util.js.map +1 -1
- package/lib/utils/viewpoint-util.d.ts +1 -1
- package/lib/utils/viewpoint-util.d.ts.map +1 -1
- package/lib/utils/viewpoint-util.js +16 -16
- package/lib/utils/viewpoint-util.js.map +1 -1
- package/lib/views/base-view-module.js +9 -9
- package/lib/views/base-view-module.js.map +1 -1
- package/lib/views/compartments.d.ts +6 -0
- package/lib/views/compartments.d.ts.map +1 -0
- package/lib/views/compartments.js +43 -0
- package/lib/views/compartments.js.map +1 -0
- package/lib/views/default-types.js +1 -1
- package/lib/views/default-types.js.map +1 -1
- package/lib/views/glsp-edge-view.d.ts +1 -2
- package/lib/views/glsp-edge-view.d.ts.map +1 -1
- package/lib/views/glsp-edge-view.js +32 -62
- package/lib/views/glsp-edge-view.js.map +1 -1
- package/lib/views/index.d.ts +1 -0
- package/lib/views/index.d.ts.map +1 -1
- package/lib/views/index.js +1 -0
- package/lib/views/index.js.map +1 -1
- package/lib/views/issue-marker-view.d.ts +1 -1
- package/lib/views/issue-marker-view.d.ts.map +1 -1
- package/lib/views/issue-marker-view.js +19 -42
- package/lib/views/issue-marker-view.js.map +1 -1
- package/lib/views/rounded-corner-view.d.ts +2 -3
- package/lib/views/rounded-corner-view.d.ts.map +1 -1
- package/lib/views/rounded-corner-view.js +40 -70
- package/lib/views/rounded-corner-view.js.map +1 -1
- package/lib/views/rounded-corner.d.ts.map +1 -1
- package/lib/views/rounded-corner.js +44 -65
- package/lib/views/rounded-corner.js.map +1 -1
- package/package.json +6 -16
- package/src/base/action-dispatcher.ts +1 -2
- package/src/base/actions/context-actions.ts +6 -6
- package/src/base/actions/edit-mode-action.ts +3 -4
- package/src/base/actions/edit-validation-actions.ts +26 -14
- package/src/base/actions/focus-change-action.ts +1 -1
- package/src/base/args.ts +4 -2
- package/src/base/auto-complete/auto-complete-widget.ts +34 -21
- package/src/base/auto-complete/validation-decorator.ts +5 -5
- package/src/base/command-stack.ts +1 -3
- package/src/base/container-modules.ts +113 -0
- package/src/base/di.config.ts +31 -16
- package/src/base/drag-aware-mouse-listener.ts +1 -3
- package/src/base/editor-context.ts +2 -4
- package/src/base/focus-tracker.ts +0 -2
- package/src/base/model/update-model-command.ts +6 -8
- package/src/base/operations/operation.ts +57 -31
- package/src/base/types.ts +3 -2
- package/src/features/change-bounds/model.ts +16 -5
- package/src/features/change-bounds/movement-restrictor.ts +15 -7
- package/src/features/command-palette/server-command-palette-provider.ts +8 -5
- package/src/features/context-menu/di.config.ts +11 -9
- package/src/features/context-menu/selection-service-aware-context-menu-mouse-listener.ts +4 -3
- package/src/features/context-menu/server-context-menu-provider.ts +7 -3
- package/src/features/copy-paste/copy-paste-actions.ts +11 -8
- package/src/features/copy-paste/copy-paste-context-menu.ts +57 -17
- package/src/features/copy-paste/copy-paste-handler.ts +15 -6
- package/src/features/decoration/decoration-placer.ts +2 -13
- package/src/features/edit-label/edit-label-validator.ts +11 -12
- package/src/features/hints/model.ts +2 -2
- package/src/features/hints/request-type-hints-action.ts +10 -5
- package/src/features/hints/type-hints.ts +26 -30
- package/src/features/hover/hover.ts +1 -2
- package/src/features/layout/di.config.ts +30 -5
- package/src/features/layout/freeform-layout.ts +132 -0
- package/src/features/layout/layout-commands.spec.ts +79 -56
- package/src/features/layout/layout-commands.ts +42 -31
- package/src/features/layout/vbox-layout.ts +241 -0
- package/src/features/model-source-watcher/model-source-changed-action-handler.ts +3 -3
- package/src/features/model-source-watcher/model-source-changed-action.ts +2 -2
- package/src/features/mouse-tool/mouse-tool.ts +31 -22
- package/src/features/navigation/navigation-action-handler.ts +32 -22
- package/src/features/navigation/navigation-target-resolver.spec.ts +1 -3
- package/src/features/navigation/navigation-target-resolver.ts +14 -12
- package/src/features/rank/model.ts +2 -2
- package/src/features/reconnect/model.ts +2 -3
- package/src/features/save/di.config.ts +1 -2
- package/src/features/save/save.ts +2 -2
- package/src/features/select/select-feedback-action.ts +4 -6
- package/src/features/select/selection-service.spec.ts +9 -4
- package/src/features/select/selection-service.ts +13 -5
- package/src/features/tool-feedback/change-bounds-tool-feedback.ts +26 -17
- package/src/features/tool-feedback/creation-tool-feedback.ts +16 -7
- package/src/features/tool-feedback/css-feedback.ts +7 -4
- package/src/features/tool-feedback/di.config.ts +2 -5
- package/src/features/tool-feedback/edge-edit-tool-feedback.ts +18 -15
- package/src/features/tool-feedback/feedback-action-dispatcher.ts +6 -8
- package/src/features/tool-feedback/marquee-tool-feedback.ts +3 -2
- package/src/features/tool-feedback/model.ts +1 -2
- package/src/features/tool-feedback/view.tsx +16 -10
- package/src/features/tool-palette/di.config.ts +1 -1
- package/src/features/tool-palette/palette-item.ts +3 -3
- package/src/features/tool-palette/tool-palette.ts +12 -14
- package/src/features/tools/change-bounds-tool.ts +54 -25
- package/src/features/tools/delete-tool.ts +8 -3
- package/src/features/tools/edge-creation-tool.ts +5 -8
- package/src/features/tools/edge-edit-tool.ts +9 -18
- package/src/features/tools/marquee-mouse-tool.ts +57 -37
- package/src/features/tools/marquee-tool.ts +0 -1
- package/src/features/tools/node-creation-tool.ts +4 -9
- package/src/features/tools/view.tsx +17 -12
- package/src/features/undo-redo/model.ts +3 -3
- package/src/features/validation/marker-navigator.spec.ts +15 -9
- package/src/features/validation/marker-navigator.ts +23 -8
- package/src/features/validation/validate.ts +9 -13
- package/src/features/viewport/glsp-scroll-mouse-listener.ts +1 -10
- package/src/index.ts +26 -8
- package/src/model-source/glsp-diagram-server.ts +2 -14
- package/src/utils/argument-utils.ts +13 -9
- package/src/utils/array-utils.ts +4 -2
- package/src/utils/layout-utils.ts +11 -5
- package/src/utils/smodel-util.ts +14 -10
- package/src/utils/viewpoint-util.ts +3 -2
- package/src/views/compartments.tsx +37 -0
- package/src/views/glsp-edge-view.tsx +20 -13
- package/src/views/index.ts +1 -0
- package/src/views/issue-marker-view.tsx +11 -12
- package/src/views/rounded-corner-view.tsx +38 -25
- package/src/views/rounded-corner.ts +3 -4
- package/lib/base/actions/protocol-actions.d.ts +0 -41
- package/lib/base/actions/protocol-actions.d.ts.map +0 -1
- package/lib/base/actions/protocol-actions.js +0 -151
- package/lib/base/actions/protocol-actions.js.map +0 -1
- package/src/base/actions/protocol-actions.ts +0 -82
|
@@ -1,17 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
extendStatics(d, b);
|
|
11
|
-
function __() { this.constructor = d; }
|
|
12
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
-
};
|
|
14
|
-
})();
|
|
15
2
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
16
3
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
17
4
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -24,30 +11,10 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
24
11
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
25
12
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
26
13
|
};
|
|
27
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
28
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
29
|
-
if (!m) return o;
|
|
30
|
-
var i = m.call(o), r, ar = [], e;
|
|
31
|
-
try {
|
|
32
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
33
|
-
}
|
|
34
|
-
catch (error) { e = { error: error }; }
|
|
35
|
-
finally {
|
|
36
|
-
try {
|
|
37
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
38
|
-
}
|
|
39
|
-
finally { if (e) throw e.error; }
|
|
40
|
-
}
|
|
41
|
-
return ar;
|
|
42
|
-
};
|
|
43
|
-
var __spread = (this && this.__spread) || function () {
|
|
44
|
-
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
|
|
45
|
-
return ar;
|
|
46
|
-
};
|
|
47
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
15
|
exports.AlignElementsCommand = exports.ResizeElementsCommand = exports.AlignElementsAction = exports.Select = exports.Alignment = exports.ResizeElementsAction = exports.Reduce = exports.ResizeDimension = void 0;
|
|
49
16
|
/********************************************************************************
|
|
50
|
-
* Copyright (c) 2019 EclipseSource and others.
|
|
17
|
+
* Copyright (c) 2019-2021 EclipseSource and others.
|
|
51
18
|
*
|
|
52
19
|
* This program and the accompanying materials are made available under the
|
|
53
20
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -61,88 +28,65 @@ exports.AlignElementsCommand = exports.ResizeElementsCommand = exports.AlignElem
|
|
|
61
28
|
*
|
|
62
29
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
63
30
|
********************************************************************************/
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
31
|
+
const inversify_1 = require("inversify");
|
|
32
|
+
const sprotty_1 = require("sprotty");
|
|
33
|
+
const operation_1 = require("../../base/operations/operation");
|
|
34
|
+
const types_1 = require("../../base/types");
|
|
35
|
+
const layout_utils_1 = require("../../utils/layout-utils");
|
|
36
|
+
const model_1 = require("../change-bounds/model");
|
|
37
|
+
const selection_service_1 = require("../select/selection-service");
|
|
38
|
+
// eslint-disable-next-line no-shadow
|
|
71
39
|
var ResizeDimension;
|
|
72
40
|
(function (ResizeDimension) {
|
|
73
41
|
ResizeDimension[ResizeDimension["Width"] = 0] = "Width";
|
|
74
42
|
ResizeDimension[ResizeDimension["Height"] = 1] = "Height";
|
|
75
|
-
// eslint-disable-next-line @typescript-eslint/camelcase
|
|
76
43
|
ResizeDimension[ResizeDimension["Width_And_Height"] = 2] = "Width_And_Height";
|
|
77
44
|
})(ResizeDimension = exports.ResizeDimension || (exports.ResizeDimension = {}));
|
|
78
45
|
var Reduce;
|
|
79
46
|
(function (Reduce) {
|
|
80
|
-
function min() {
|
|
81
|
-
|
|
82
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
83
|
-
values[_i] = arguments[_i];
|
|
84
|
-
}
|
|
85
|
-
return Math.min.apply(Math, __spread(values));
|
|
47
|
+
function min(...values) {
|
|
48
|
+
return Math.min(...values);
|
|
86
49
|
}
|
|
87
50
|
Reduce.min = min;
|
|
88
|
-
function max() {
|
|
89
|
-
|
|
90
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
91
|
-
values[_i] = arguments[_i];
|
|
92
|
-
}
|
|
93
|
-
return Math.max.apply(Math, __spread(values));
|
|
51
|
+
function max(...values) {
|
|
52
|
+
return Math.max(...values);
|
|
94
53
|
}
|
|
95
54
|
Reduce.max = max;
|
|
96
|
-
function avg() {
|
|
97
|
-
|
|
98
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
99
|
-
values[_i] = arguments[_i];
|
|
100
|
-
}
|
|
101
|
-
return values.reduce(function (a, b) { return a + b; }, 0) / values.length;
|
|
55
|
+
function avg(...values) {
|
|
56
|
+
return values.reduce((a, b) => a + b, 0) / values.length;
|
|
102
57
|
}
|
|
103
58
|
Reduce.avg = avg;
|
|
104
|
-
function first() {
|
|
105
|
-
var values = [];
|
|
106
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
107
|
-
values[_i] = arguments[_i];
|
|
108
|
-
}
|
|
59
|
+
function first(...values) {
|
|
109
60
|
return values[0];
|
|
110
61
|
}
|
|
111
62
|
Reduce.first = first;
|
|
112
|
-
function last() {
|
|
113
|
-
var values = [];
|
|
114
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
115
|
-
values[_i] = arguments[_i];
|
|
116
|
-
}
|
|
63
|
+
function last(...values) {
|
|
117
64
|
return values[values.length - 1];
|
|
118
65
|
}
|
|
119
66
|
Reduce.last = last;
|
|
120
67
|
})(Reduce = exports.Reduce || (exports.Reduce = {}));
|
|
121
|
-
|
|
122
|
-
|
|
68
|
+
class ResizeElementsAction {
|
|
69
|
+
constructor(
|
|
123
70
|
/**
|
|
124
71
|
* IDs of the elements that should be resized. If no IDs are given, the selected elements will be resized.
|
|
125
72
|
*/
|
|
126
|
-
elementIds,
|
|
73
|
+
elementIds = [],
|
|
127
74
|
/**
|
|
128
75
|
* Resize dimension.
|
|
129
76
|
*/
|
|
130
|
-
dimension,
|
|
77
|
+
dimension = ResizeDimension.Width,
|
|
131
78
|
/**
|
|
132
79
|
* Function to reduce the dimension to a target dimension value, see Reduce.* for potential functions.
|
|
133
80
|
*/
|
|
134
|
-
reductionFunction, kind) {
|
|
135
|
-
if (elementIds === void 0) { elementIds = []; }
|
|
136
|
-
if (dimension === void 0) { dimension = ResizeDimension.Width; }
|
|
137
|
-
if (kind === void 0) { kind = ResizeElementsCommand.KIND; }
|
|
81
|
+
reductionFunction, kind = ResizeElementsCommand.KIND) {
|
|
138
82
|
this.elementIds = elementIds;
|
|
139
83
|
this.dimension = dimension;
|
|
140
84
|
this.reductionFunction = reductionFunction;
|
|
141
85
|
this.kind = kind;
|
|
142
86
|
}
|
|
143
|
-
|
|
144
|
-
}());
|
|
87
|
+
}
|
|
145
88
|
exports.ResizeElementsAction = ResizeElementsAction;
|
|
89
|
+
// eslint-disable-next-line no-shadow
|
|
146
90
|
var Alignment;
|
|
147
91
|
(function (Alignment) {
|
|
148
92
|
Alignment[Alignment["Left"] = 0] = "Left";
|
|
@@ -167,90 +111,79 @@ var Select;
|
|
|
167
111
|
}
|
|
168
112
|
Select.last = last;
|
|
169
113
|
})(Select = exports.Select || (exports.Select = {}));
|
|
170
|
-
|
|
171
|
-
|
|
114
|
+
class AlignElementsAction {
|
|
115
|
+
constructor(
|
|
172
116
|
/**
|
|
173
117
|
* IDs of the elements that should be aligned. If no IDs are given, the selected elements will be aligned.
|
|
174
118
|
*/
|
|
175
|
-
elementIds,
|
|
119
|
+
elementIds = [],
|
|
176
120
|
/**
|
|
177
121
|
* Alignment direction.
|
|
178
122
|
*/
|
|
179
|
-
alignment,
|
|
123
|
+
alignment = Alignment.Left,
|
|
180
124
|
/**
|
|
181
125
|
* Function to selected elements that are considered during alignment calculation, see Select.* for potential functions.
|
|
182
126
|
*/
|
|
183
|
-
selectionFunction, kind) {
|
|
184
|
-
if (elementIds === void 0) { elementIds = []; }
|
|
185
|
-
if (alignment === void 0) { alignment = Alignment.Left; }
|
|
186
|
-
if (selectionFunction === void 0) { selectionFunction = Select.all; }
|
|
187
|
-
if (kind === void 0) { kind = AlignElementsCommand.KIND; }
|
|
127
|
+
selectionFunction = Select.all, kind = AlignElementsCommand.KIND) {
|
|
188
128
|
this.elementIds = elementIds;
|
|
189
129
|
this.alignment = alignment;
|
|
190
130
|
this.selectionFunction = selectionFunction;
|
|
191
131
|
this.kind = kind;
|
|
192
132
|
}
|
|
193
|
-
|
|
194
|
-
}());
|
|
133
|
+
}
|
|
195
134
|
exports.AlignElementsAction = AlignElementsAction;
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
var _this = this;
|
|
208
|
-
var model = context.root;
|
|
209
|
-
var elementIDs = this.action.elementIds;
|
|
135
|
+
let LayoutElementsCommand = class LayoutElementsCommand extends sprotty_1.Command {
|
|
136
|
+
constructor(action, actionDispatcher, selectionService, movementRestrictor) {
|
|
137
|
+
super();
|
|
138
|
+
this.action = action;
|
|
139
|
+
this.actionDispatcher = actionDispatcher;
|
|
140
|
+
this.selectionService = selectionService;
|
|
141
|
+
this.movementRestrictor = movementRestrictor;
|
|
142
|
+
}
|
|
143
|
+
getActionElements(context) {
|
|
144
|
+
const model = context.root;
|
|
145
|
+
const elementIDs = this.action.elementIds;
|
|
210
146
|
if (elementIDs.length === 0) {
|
|
211
147
|
// collect the selected elements from the selection service (selection order is kept by service)
|
|
212
|
-
this.selectionService.getSelectedElementIDs().forEach(
|
|
148
|
+
this.selectionService.getSelectedElementIDs().forEach(elementID => elementIDs.push(elementID));
|
|
213
149
|
}
|
|
214
|
-
|
|
215
|
-
elementIDs.forEach(
|
|
216
|
-
|
|
217
|
-
if (element &&
|
|
150
|
+
const boundsAwareElements = [];
|
|
151
|
+
elementIDs.forEach(id => {
|
|
152
|
+
const element = model.index.getById(id);
|
|
153
|
+
if (element && this.isActionElement(element)) {
|
|
218
154
|
boundsAwareElements.push(element);
|
|
219
155
|
}
|
|
220
156
|
});
|
|
221
157
|
return boundsAwareElements;
|
|
222
|
-
}
|
|
223
|
-
|
|
158
|
+
}
|
|
159
|
+
dispatchAction(action) {
|
|
224
160
|
this.actionDispatcher.dispatch(action);
|
|
225
|
-
}
|
|
226
|
-
|
|
161
|
+
}
|
|
162
|
+
dispatchActions(actions) {
|
|
227
163
|
this.actionDispatcher.dispatchAll(actions);
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
return _this;
|
|
248
|
-
}
|
|
249
|
-
ResizeElementsCommand.prototype.isActionElement = function (element) {
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
LayoutElementsCommand = __decorate([
|
|
167
|
+
inversify_1.injectable(),
|
|
168
|
+
__param(0, inversify_1.inject(sprotty_1.TYPES.Action)),
|
|
169
|
+
__param(1, inversify_1.inject(sprotty_1.TYPES.IActionDispatcher)),
|
|
170
|
+
__param(2, inversify_1.inject(types_1.GLSP_TYPES.SelectionService)),
|
|
171
|
+
__param(3, inversify_1.inject(types_1.GLSP_TYPES.IMovementRestrictor)), __param(3, inversify_1.optional()),
|
|
172
|
+
__metadata("design:paramtypes", [Object, Object, selection_service_1.SelectionService, Object])
|
|
173
|
+
], LayoutElementsCommand);
|
|
174
|
+
let ResizeElementsCommand = class ResizeElementsCommand extends LayoutElementsCommand {
|
|
175
|
+
constructor(action, actionDispatcher, selectionService, movementRestrictor) {
|
|
176
|
+
super(action, actionDispatcher, selectionService, movementRestrictor);
|
|
177
|
+
this.action = action;
|
|
178
|
+
this.actionDispatcher = actionDispatcher;
|
|
179
|
+
this.selectionService = selectionService;
|
|
180
|
+
this.movementRestrictor = movementRestrictor;
|
|
181
|
+
}
|
|
182
|
+
isActionElement(element) {
|
|
250
183
|
return model_1.isResizable(element);
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
|
|
184
|
+
}
|
|
185
|
+
execute(context) {
|
|
186
|
+
const elements = this.getActionElements(context);
|
|
254
187
|
if (elements.length > 1) {
|
|
255
188
|
switch (this.action.dimension) {
|
|
256
189
|
case ResizeDimension.Width:
|
|
@@ -265,55 +198,51 @@ var ResizeElementsCommand = /** @class */ (function (_super) {
|
|
|
265
198
|
}
|
|
266
199
|
}
|
|
267
200
|
return context.root;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
this.dispatchResizeActions(elements, function (element, bounds) {
|
|
201
|
+
}
|
|
202
|
+
resizeWidth(elements) {
|
|
203
|
+
const targetWidth = this.action.reductionFunction(...elements.map(element => element.bounds.width));
|
|
204
|
+
this.dispatchResizeActions(elements, (element, bounds) => {
|
|
273
205
|
// resize around center
|
|
274
|
-
|
|
206
|
+
const halfDiffWidth = 0.5 * (targetWidth - element.bounds.width);
|
|
275
207
|
bounds.newPosition.x = element.bounds.x - halfDiffWidth;
|
|
276
208
|
bounds.newSize.width = targetWidth;
|
|
277
209
|
});
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
this.dispatchResizeActions(elements, function (element, bounds) {
|
|
210
|
+
}
|
|
211
|
+
resizeHeight(elements) {
|
|
212
|
+
const targetHeight = this.action.reductionFunction(...elements.map(element => element.bounds.height));
|
|
213
|
+
this.dispatchResizeActions(elements, (element, bounds) => {
|
|
283
214
|
// resize around middle
|
|
284
|
-
|
|
215
|
+
const halfDiffHeight = 0.5 * (targetHeight - element.bounds.height);
|
|
285
216
|
bounds.newPosition.y = element.bounds.y - halfDiffHeight;
|
|
286
217
|
bounds.newSize.height = targetHeight;
|
|
287
218
|
});
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
this.dispatchResizeActions(elements, function (element, bounds) {
|
|
219
|
+
}
|
|
220
|
+
resizeWidthAndHeight(elements) {
|
|
221
|
+
const targetWidth = this.action.reductionFunction(...elements.map(element => element.bounds.width));
|
|
222
|
+
const targetHeight = this.action.reductionFunction(...elements.map(element => element.bounds.height));
|
|
223
|
+
this.dispatchResizeActions(elements, (element, bounds) => {
|
|
294
224
|
// resize around center and middle
|
|
295
|
-
|
|
296
|
-
|
|
225
|
+
const halfDiffWidth = 0.5 * (targetWidth - element.bounds.width);
|
|
226
|
+
const halfDiffHeight = 0.5 * (targetHeight - element.bounds.height);
|
|
297
227
|
bounds.newPosition.x = element.bounds.x - halfDiffWidth;
|
|
298
228
|
bounds.newPosition.y = element.bounds.y - halfDiffHeight;
|
|
299
229
|
bounds.newSize.width = targetWidth;
|
|
300
230
|
bounds.newSize.height = targetHeight;
|
|
301
231
|
});
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
var elementChange = _this.createElementAndBounds(element, change);
|
|
232
|
+
}
|
|
233
|
+
dispatchResizeActions(elements, change) {
|
|
234
|
+
const elementAndBounds = []; // client- and server-side resize
|
|
235
|
+
elements.forEach(element => {
|
|
236
|
+
const elementChange = this.createElementAndBounds(element, change);
|
|
308
237
|
if (elementChange) {
|
|
309
238
|
// simply skip invalid changes
|
|
310
239
|
elementAndBounds.push(elementChange);
|
|
311
240
|
}
|
|
312
241
|
});
|
|
313
242
|
this.dispatchActions([new sprotty_1.SetBoundsAction(elementAndBounds), new operation_1.ChangeBoundsOperation(elementAndBounds)]);
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
|
|
243
|
+
}
|
|
244
|
+
createElementAndBounds(element, change) {
|
|
245
|
+
const bounds = {
|
|
317
246
|
elementId: element.id,
|
|
318
247
|
newPosition: {
|
|
319
248
|
x: element.bounds.x,
|
|
@@ -326,42 +255,39 @@ var ResizeElementsCommand = /** @class */ (function (_super) {
|
|
|
326
255
|
};
|
|
327
256
|
change(element, bounds);
|
|
328
257
|
return layout_utils_1.toValidElementAndBounds(element, bounds, this.movementRestrictor);
|
|
329
|
-
}
|
|
330
|
-
|
|
258
|
+
}
|
|
259
|
+
undo(context) {
|
|
331
260
|
// we dispatch another action which can be undone, so no explicit implementation necessary
|
|
332
261
|
return context.root;
|
|
333
|
-
}
|
|
334
|
-
|
|
262
|
+
}
|
|
263
|
+
redo(context) {
|
|
335
264
|
// we dispatch another action which can be redone, so no explicit implementation necessary
|
|
336
265
|
return context.root;
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
}(LayoutElementsCommand));
|
|
266
|
+
}
|
|
267
|
+
};
|
|
268
|
+
ResizeElementsCommand.KIND = 'layout:resize';
|
|
269
|
+
ResizeElementsCommand = __decorate([
|
|
270
|
+
inversify_1.injectable(),
|
|
271
|
+
__param(0, inversify_1.inject(sprotty_1.TYPES.Action)),
|
|
272
|
+
__param(1, inversify_1.inject(sprotty_1.TYPES.IActionDispatcher)),
|
|
273
|
+
__param(2, inversify_1.inject(types_1.GLSP_TYPES.SelectionService)),
|
|
274
|
+
__param(3, inversify_1.inject(types_1.GLSP_TYPES.IMovementRestrictor)), __param(3, inversify_1.optional()),
|
|
275
|
+
__metadata("design:paramtypes", [ResizeElementsAction, Object, selection_service_1.SelectionService, Object])
|
|
276
|
+
], ResizeElementsCommand);
|
|
349
277
|
exports.ResizeElementsCommand = ResizeElementsCommand;
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
}
|
|
360
|
-
AlignElementsCommand.prototype.isActionElement = function (element) {
|
|
278
|
+
let AlignElementsCommand = class AlignElementsCommand extends LayoutElementsCommand {
|
|
279
|
+
constructor(action, actionDispatcher, selectionService, movementRestrictor) {
|
|
280
|
+
super(action, actionDispatcher, selectionService, movementRestrictor);
|
|
281
|
+
this.action = action;
|
|
282
|
+
this.actionDispatcher = actionDispatcher;
|
|
283
|
+
this.selectionService = selectionService;
|
|
284
|
+
this.movementRestrictor = movementRestrictor;
|
|
285
|
+
}
|
|
286
|
+
isActionElement(element) {
|
|
361
287
|
return model_1.isBoundsAwareMoveable(element);
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
|
|
288
|
+
}
|
|
289
|
+
execute(context) {
|
|
290
|
+
const elements = this.getActionElements(context);
|
|
365
291
|
if (elements.length > 1) {
|
|
366
292
|
switch (this.action.alignment) {
|
|
367
293
|
case Alignment.Left:
|
|
@@ -385,60 +311,59 @@ var AlignElementsCommand = /** @class */ (function (_super) {
|
|
|
385
311
|
}
|
|
386
312
|
}
|
|
387
313
|
return context.root;
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
this.dispatchAlignActions(elements,
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
this.dispatchAlignActions(elements,
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
this.dispatchAlignActions(elements,
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
this.dispatchAlignActions(elements,
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
this.dispatchAlignActions(elements,
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
this.dispatchAlignActions(elements,
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
var move = _this.createElementMove(element, change);
|
|
314
|
+
}
|
|
315
|
+
alignLeft(elements) {
|
|
316
|
+
const calculationElements = this.action.selectionFunction(elements);
|
|
317
|
+
const minX = calculationElements.map(element => element.bounds.x).reduce((a, b) => Math.min(a, b));
|
|
318
|
+
this.dispatchAlignActions(elements, (_, move) => (move.toPosition.x = minX));
|
|
319
|
+
}
|
|
320
|
+
alignCenter(elements) {
|
|
321
|
+
const calculationElements = this.action.selectionFunction(elements);
|
|
322
|
+
const minX = calculationElements.map(element => element.bounds.x).reduce((a, b) => Math.min(a, b));
|
|
323
|
+
const maxX = calculationElements.map(element => element.bounds.x + element.bounds.width).reduce((a, b) => Math.max(a, b));
|
|
324
|
+
const diffX = maxX - minX;
|
|
325
|
+
const centerX = minX + 0.5 * diffX;
|
|
326
|
+
this.dispatchAlignActions(elements, (element, move) => (move.toPosition.x = centerX - 0.5 * element.bounds.width));
|
|
327
|
+
}
|
|
328
|
+
alignRight(elements) {
|
|
329
|
+
const calculationElements = this.action.selectionFunction(elements);
|
|
330
|
+
const maxX = calculationElements.map(element => element.bounds.x + element.bounds.width).reduce((a, b) => Math.max(a, b));
|
|
331
|
+
this.dispatchAlignActions(elements, (element, move) => (move.toPosition.x = maxX - element.bounds.width));
|
|
332
|
+
}
|
|
333
|
+
alignTop(elements) {
|
|
334
|
+
const calculationElements = this.action.selectionFunction(elements);
|
|
335
|
+
const minY = calculationElements.map(element => element.bounds.y).reduce((a, b) => Math.min(a, b));
|
|
336
|
+
this.dispatchAlignActions(elements, (_, move) => (move.toPosition.y = minY));
|
|
337
|
+
}
|
|
338
|
+
alignMiddle(elements) {
|
|
339
|
+
const calculationElements = this.action.selectionFunction(elements);
|
|
340
|
+
const minY = calculationElements.map(element => element.bounds.y).reduce((a, b) => Math.min(a, b));
|
|
341
|
+
const maxY = calculationElements.map(element => element.bounds.y + element.bounds.height).reduce((a, b) => Math.max(a, b));
|
|
342
|
+
const diffY = maxY - minY;
|
|
343
|
+
const middleY = minY + 0.5 * diffY;
|
|
344
|
+
this.dispatchAlignActions(elements, (element, move) => (move.toPosition.y = middleY - 0.5 * element.bounds.height));
|
|
345
|
+
}
|
|
346
|
+
alignBottom(elements) {
|
|
347
|
+
const calculationElements = this.action.selectionFunction(elements);
|
|
348
|
+
const maxY = calculationElements.map(element => element.bounds.y + element.bounds.height).reduce((a, b) => Math.max(a, b));
|
|
349
|
+
this.dispatchAlignActions(elements, (element, move) => (move.toPosition.y = maxY - element.bounds.height));
|
|
350
|
+
}
|
|
351
|
+
dispatchAlignActions(elements, change) {
|
|
352
|
+
const moves = []; // client-side move
|
|
353
|
+
const elementAndBounds = []; // server-side move
|
|
354
|
+
elements.forEach(element => {
|
|
355
|
+
const move = this.createElementMove(element, change);
|
|
431
356
|
if (move) {
|
|
432
357
|
// simply skip invalid changes
|
|
433
358
|
moves.push(move);
|
|
434
|
-
|
|
359
|
+
const elementAndBound = this.createElementAndBounds(element, move);
|
|
435
360
|
elementAndBounds.push(elementAndBound);
|
|
436
361
|
}
|
|
437
362
|
});
|
|
438
363
|
this.dispatchActions([new sprotty_1.MoveAction(moves), new operation_1.ChangeBoundsOperation(elementAndBounds)]);
|
|
439
|
-
}
|
|
440
|
-
|
|
441
|
-
|
|
364
|
+
}
|
|
365
|
+
createElementMove(element, change) {
|
|
366
|
+
const move = {
|
|
442
367
|
elementId: element.id,
|
|
443
368
|
fromPosition: {
|
|
444
369
|
x: element.bounds.x,
|
|
@@ -451,8 +376,8 @@ var AlignElementsCommand = /** @class */ (function (_super) {
|
|
|
451
376
|
};
|
|
452
377
|
change(element, move);
|
|
453
378
|
return layout_utils_1.toValidElementMove(element, move, this.movementRestrictor);
|
|
454
|
-
}
|
|
455
|
-
|
|
379
|
+
}
|
|
380
|
+
createElementAndBounds(element, move) {
|
|
456
381
|
return {
|
|
457
382
|
elementId: element.id,
|
|
458
383
|
newPosition: {
|
|
@@ -464,25 +389,24 @@ var AlignElementsCommand = /** @class */ (function (_super) {
|
|
|
464
389
|
height: element.bounds.height
|
|
465
390
|
}
|
|
466
391
|
};
|
|
467
|
-
}
|
|
468
|
-
|
|
392
|
+
}
|
|
393
|
+
undo(context) {
|
|
469
394
|
// we dispatch another action which can be undone, so no explicit implementation necessary
|
|
470
395
|
return context.root;
|
|
471
|
-
}
|
|
472
|
-
|
|
396
|
+
}
|
|
397
|
+
redo(context) {
|
|
473
398
|
// we dispatch another action which can be redone, so no explicit implementation necessary
|
|
474
399
|
return context.root;
|
|
475
|
-
}
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
}(LayoutElementsCommand));
|
|
400
|
+
}
|
|
401
|
+
};
|
|
402
|
+
AlignElementsCommand.KIND = 'layout:align';
|
|
403
|
+
AlignElementsCommand = __decorate([
|
|
404
|
+
inversify_1.injectable(),
|
|
405
|
+
__param(0, inversify_1.inject(sprotty_1.TYPES.Action)),
|
|
406
|
+
__param(1, inversify_1.inject(sprotty_1.TYPES.IActionDispatcher)),
|
|
407
|
+
__param(2, inversify_1.inject(types_1.GLSP_TYPES.SelectionService)),
|
|
408
|
+
__param(3, inversify_1.inject(types_1.GLSP_TYPES.IMovementRestrictor)), __param(3, inversify_1.optional()),
|
|
409
|
+
__metadata("design:paramtypes", [AlignElementsAction, Object, selection_service_1.SelectionService, Object])
|
|
410
|
+
], AlignElementsCommand);
|
|
487
411
|
exports.AlignElementsCommand = AlignElementsCommand;
|
|
488
412
|
//# sourceMappingURL=layout-commands.js.map
|