@eclipse-glsp/client 0.9.0-next.e4ef6900 → 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);
|
|
@@ -21,41 +8,11 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
21
8
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
22
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
23
10
|
};
|
|
24
|
-
var
|
|
25
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
26
|
-
if (m) return m.call(o);
|
|
27
|
-
if (o && typeof o.length === "number") return {
|
|
28
|
-
next: function () {
|
|
29
|
-
if (o && i >= o.length) o = void 0;
|
|
30
|
-
return { value: o && o[i++], done: !o };
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
34
|
-
};
|
|
35
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
36
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
37
|
-
if (!m) return o;
|
|
38
|
-
var i = m.call(o), r, ar = [], e;
|
|
39
|
-
try {
|
|
40
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
41
|
-
}
|
|
42
|
-
catch (error) { e = { error: error }; }
|
|
43
|
-
finally {
|
|
44
|
-
try {
|
|
45
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
46
|
-
}
|
|
47
|
-
finally { if (e) throw e.error; }
|
|
48
|
-
}
|
|
49
|
-
return ar;
|
|
50
|
-
};
|
|
51
|
-
var __spread = (this && this.__spread) || function () {
|
|
52
|
-
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
|
|
53
|
-
return ar;
|
|
54
|
-
};
|
|
11
|
+
var EnableToolPaletteAction_1, ToolPalette_1;
|
|
55
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
56
13
|
exports.changeCSSClass = exports.createToolGroup = exports.createIcon = exports.compare = exports.ToolPalette = exports.EnableToolPaletteAction = void 0;
|
|
57
14
|
/********************************************************************************
|
|
58
|
-
* Copyright (c) 2019 EclipseSource and others.
|
|
15
|
+
* Copyright (c) 2019-2021 EclipseSource and others.
|
|
59
16
|
*
|
|
60
17
|
* This program and the accompanying materials are made available under the
|
|
61
18
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -69,120 +26,111 @@ exports.changeCSSClass = exports.createToolGroup = exports.createIcon = exports.
|
|
|
69
26
|
*
|
|
70
27
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
71
28
|
********************************************************************************/
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
29
|
+
const inversify_1 = require("inversify");
|
|
30
|
+
const sprotty_1 = require("sprotty");
|
|
31
|
+
const keyboard_1 = require("sprotty/lib/utils/keyboard");
|
|
32
|
+
const action_dispatcher_1 = require("../../base/action-dispatcher");
|
|
33
|
+
const context_actions_1 = require("../../base/actions/context-actions");
|
|
34
|
+
const editor_context_1 = require("../../base/editor-context");
|
|
35
|
+
const delete_tool_1 = require("../tools/delete-tool");
|
|
36
|
+
const marquee_mouse_tool_1 = require("../tools/marquee-mouse-tool");
|
|
37
|
+
const validate_1 = require("../validation/validate");
|
|
38
|
+
const CLICKED_CSS_CLASS = 'clicked';
|
|
39
|
+
const SEARCH_ICON = 'fa-search';
|
|
40
|
+
const PALETTE_ICON = 'fa-palette';
|
|
41
|
+
const CHEVRON_DOWN = 'fa-chevron-down';
|
|
42
|
+
const PALETTE_HEIGHT = '500px';
|
|
43
|
+
let EnableToolPaletteAction = EnableToolPaletteAction_1 = class EnableToolPaletteAction {
|
|
44
|
+
constructor() {
|
|
88
45
|
this.kind = EnableToolPaletteAction_1.KIND;
|
|
89
46
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
], EnableToolPaletteAction);
|
|
96
|
-
return EnableToolPaletteAction;
|
|
97
|
-
}());
|
|
47
|
+
};
|
|
48
|
+
EnableToolPaletteAction.KIND = 'enableToolPalette';
|
|
49
|
+
EnableToolPaletteAction = EnableToolPaletteAction_1 = __decorate([
|
|
50
|
+
inversify_1.injectable()
|
|
51
|
+
], EnableToolPaletteAction);
|
|
98
52
|
exports.EnableToolPaletteAction = EnableToolPaletteAction;
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}
|
|
106
|
-
ToolPalette_1 = ToolPalette;
|
|
107
|
-
ToolPalette.prototype.id = function () {
|
|
53
|
+
let ToolPalette = ToolPalette_1 = class ToolPalette extends sprotty_1.AbstractUIExtension {
|
|
54
|
+
constructor() {
|
|
55
|
+
super(...arguments);
|
|
56
|
+
this.paletteItemsCopy = [];
|
|
57
|
+
}
|
|
58
|
+
id() {
|
|
108
59
|
return ToolPalette_1.ID;
|
|
109
|
-
}
|
|
110
|
-
|
|
60
|
+
}
|
|
61
|
+
containerClass() {
|
|
111
62
|
return ToolPalette_1.ID;
|
|
112
|
-
}
|
|
113
|
-
|
|
63
|
+
}
|
|
64
|
+
postConstruct() {
|
|
114
65
|
this.editorContext.register(this);
|
|
115
|
-
}
|
|
116
|
-
|
|
66
|
+
}
|
|
67
|
+
initialize() {
|
|
117
68
|
if (!this.paletteItems) {
|
|
118
69
|
return false;
|
|
119
70
|
}
|
|
120
|
-
return
|
|
121
|
-
}
|
|
122
|
-
|
|
71
|
+
return super.initialize();
|
|
72
|
+
}
|
|
73
|
+
initializeContents(_containerElement) {
|
|
123
74
|
this.createHeader();
|
|
124
75
|
this.createBody();
|
|
125
76
|
this.lastActivebutton = this.defaultToolsButton;
|
|
126
|
-
}
|
|
127
|
-
|
|
77
|
+
}
|
|
78
|
+
onBeforeShow(_containerElement, root) {
|
|
128
79
|
this.modelRootId = root.id;
|
|
129
80
|
this.containerElement.style.maxHeight = PALETTE_HEIGHT;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
var minPaletteDiv = document.createElement('div');
|
|
81
|
+
}
|
|
82
|
+
addMinimizePaletteButton() {
|
|
83
|
+
const baseDiv = document.getElementById(this.options.baseDiv);
|
|
84
|
+
const minPaletteDiv = document.createElement('div');
|
|
135
85
|
minPaletteDiv.classList.add('minimize-palette-button');
|
|
136
86
|
this.containerElement.classList.add('collapsible-palette');
|
|
137
87
|
if (baseDiv) {
|
|
138
|
-
|
|
139
|
-
|
|
88
|
+
const insertedDiv = baseDiv.insertBefore(minPaletteDiv, baseDiv.firstChild);
|
|
89
|
+
const minimizeIcon = createIcon(['fas', CHEVRON_DOWN]);
|
|
140
90
|
this.updateMinimizePaletteButtonTooltip(minPaletteDiv);
|
|
141
|
-
|
|
142
|
-
if (
|
|
143
|
-
|
|
91
|
+
minimizeIcon.onclick = _event => {
|
|
92
|
+
if (this.isPaletteMaximized()) {
|
|
93
|
+
this.containerElement.style.maxHeight = '0px';
|
|
144
94
|
}
|
|
145
95
|
else {
|
|
146
|
-
|
|
96
|
+
this.containerElement.style.maxHeight = PALETTE_HEIGHT;
|
|
147
97
|
}
|
|
148
|
-
|
|
149
|
-
changeCSSClass(
|
|
150
|
-
changeCSSClass(
|
|
151
|
-
changeCSSClass(
|
|
152
|
-
changeCSSClass(
|
|
98
|
+
this.updateMinimizePaletteButtonTooltip(minPaletteDiv);
|
|
99
|
+
changeCSSClass(minimizeIcon, PALETTE_ICON);
|
|
100
|
+
changeCSSClass(minimizeIcon, 'fa');
|
|
101
|
+
changeCSSClass(minimizeIcon, 'fas');
|
|
102
|
+
changeCSSClass(minimizeIcon, CHEVRON_DOWN);
|
|
153
103
|
};
|
|
154
|
-
insertedDiv.appendChild(
|
|
104
|
+
insertedDiv.appendChild(minimizeIcon);
|
|
155
105
|
}
|
|
156
|
-
}
|
|
157
|
-
|
|
106
|
+
}
|
|
107
|
+
updateMinimizePaletteButtonTooltip(button) {
|
|
158
108
|
if (this.isPaletteMaximized()) {
|
|
159
109
|
button.title = 'Minimize palette';
|
|
160
110
|
}
|
|
161
111
|
else {
|
|
162
112
|
button.title = 'Maximize palette';
|
|
163
113
|
}
|
|
164
|
-
}
|
|
165
|
-
|
|
114
|
+
}
|
|
115
|
+
isPaletteMaximized() {
|
|
166
116
|
return this.containerElement && this.containerElement.style.maxHeight !== '0px';
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
var bodyDiv = document.createElement('div');
|
|
117
|
+
}
|
|
118
|
+
createBody() {
|
|
119
|
+
const bodyDiv = document.createElement('div');
|
|
171
120
|
bodyDiv.classList.add('palette-body');
|
|
172
|
-
|
|
173
|
-
this.paletteItems.sort(compare)
|
|
174
|
-
.forEach(function (item) {
|
|
121
|
+
let tabIndex = 0;
|
|
122
|
+
this.paletteItems.sort(compare).forEach(item => {
|
|
175
123
|
if (item.children) {
|
|
176
|
-
|
|
177
|
-
item.children.sort(compare).forEach(
|
|
178
|
-
bodyDiv.appendChild(
|
|
124
|
+
const group = createToolGroup(item);
|
|
125
|
+
item.children.sort(compare).forEach(child => group.appendChild(this.createToolButton(child, tabIndex++)));
|
|
126
|
+
bodyDiv.appendChild(group);
|
|
179
127
|
}
|
|
180
128
|
else {
|
|
181
|
-
bodyDiv.appendChild(
|
|
129
|
+
bodyDiv.appendChild(this.createToolButton(item, tabIndex++));
|
|
182
130
|
}
|
|
183
131
|
});
|
|
184
132
|
if (this.paletteItems.length === 0) {
|
|
185
|
-
|
|
133
|
+
const noResultsDiv = document.createElement('div');
|
|
186
134
|
noResultsDiv.innerText = 'No results found.';
|
|
187
135
|
noResultsDiv.classList.add('tool-button');
|
|
188
136
|
bodyDiv.appendChild(noResultsDiv);
|
|
@@ -193,66 +141,64 @@ var ToolPalette = /** @class */ (function (_super) {
|
|
|
193
141
|
}
|
|
194
142
|
this.containerElement.appendChild(bodyDiv);
|
|
195
143
|
this.bodyDiv = bodyDiv;
|
|
196
|
-
}
|
|
197
|
-
|
|
144
|
+
}
|
|
145
|
+
createHeader() {
|
|
198
146
|
this.addMinimizePaletteButton();
|
|
199
|
-
|
|
147
|
+
const headerCompartment = document.createElement('div');
|
|
200
148
|
headerCompartment.classList.add('palette-header');
|
|
201
149
|
headerCompartment.append(this.createHeaderTitle());
|
|
202
150
|
headerCompartment.appendChild(this.createHeaderTools());
|
|
203
|
-
headerCompartment.appendChild(this.searchField = this.createHeaderSearchField());
|
|
151
|
+
headerCompartment.appendChild((this.searchField = this.createHeaderSearchField()));
|
|
204
152
|
this.containerElement.appendChild(headerCompartment);
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
|
|
153
|
+
}
|
|
154
|
+
createHeaderTools() {
|
|
155
|
+
const headerTools = document.createElement('div');
|
|
208
156
|
headerTools.classList.add('header-tools');
|
|
209
157
|
this.defaultToolsButton = this.createDefaultToolButton();
|
|
210
158
|
headerTools.appendChild(this.defaultToolsButton);
|
|
211
|
-
|
|
159
|
+
const deleteToolButton = this.createMouseDeleteToolButton();
|
|
212
160
|
headerTools.appendChild(deleteToolButton);
|
|
213
|
-
|
|
161
|
+
const marqueeToolButton = this.createMarqueeToolButton();
|
|
214
162
|
headerTools.appendChild(marqueeToolButton);
|
|
215
|
-
|
|
163
|
+
const validateActionButton = this.createValidateButton();
|
|
216
164
|
headerTools.appendChild(validateActionButton);
|
|
217
165
|
// Create button for Search
|
|
218
|
-
|
|
166
|
+
const searchIcon = this.createSearchButton();
|
|
219
167
|
headerTools.appendChild(searchIcon);
|
|
220
168
|
return headerTools;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
|
|
169
|
+
}
|
|
170
|
+
createDefaultToolButton() {
|
|
171
|
+
const button = createIcon(['fas', 'fa-mouse-pointer', 'fa-xs', 'clicked']);
|
|
224
172
|
button.id = 'btn_default_tools';
|
|
225
173
|
button.title = 'Enable selection tool';
|
|
226
174
|
button.onclick = this.onClickStaticToolButton(this.defaultToolsButton);
|
|
227
175
|
return button;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
|
|
176
|
+
}
|
|
177
|
+
createMouseDeleteToolButton() {
|
|
178
|
+
const deleteToolButton = createIcon(['fas', 'fa-eraser', 'fa-xs']);
|
|
231
179
|
deleteToolButton.title = 'Enable deletion tool';
|
|
232
180
|
deleteToolButton.onclick = this.onClickStaticToolButton(deleteToolButton, delete_tool_1.MouseDeleteTool.ID);
|
|
233
181
|
return deleteToolButton;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
|
|
182
|
+
}
|
|
183
|
+
createMarqueeToolButton() {
|
|
184
|
+
const marqueeToolButton = createIcon(['far', 'fa-object-group', 'fa-xs']);
|
|
237
185
|
marqueeToolButton.title = 'Enable marquee tool';
|
|
238
186
|
marqueeToolButton.onclick = this.onClickStaticToolButton(marqueeToolButton, marquee_mouse_tool_1.MarqueeMouseTool.ID);
|
|
239
187
|
return marqueeToolButton;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
var validateActionButton = createIcon(['fas', 'fa-check-square', 'fa-xs']);
|
|
188
|
+
}
|
|
189
|
+
createValidateButton() {
|
|
190
|
+
const validateActionButton = createIcon(['fas', 'fa-check-square', 'fa-xs']);
|
|
244
191
|
validateActionButton.title = 'Validate model';
|
|
245
|
-
validateActionButton.onclick =
|
|
246
|
-
|
|
247
|
-
|
|
192
|
+
validateActionButton.onclick = _event => {
|
|
193
|
+
const modelIds = [this.modelRootId];
|
|
194
|
+
this.actionDispatcher.dispatch(new validate_1.RequestMarkersAction(modelIds));
|
|
248
195
|
};
|
|
249
196
|
return validateActionButton;
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
var searchField = document.getElementById(_this.containerElement.id + '_search_field');
|
|
197
|
+
}
|
|
198
|
+
createSearchButton() {
|
|
199
|
+
const searchIcon = createIcon(['fas', SEARCH_ICON, 'state-icon', 'fa-xs']);
|
|
200
|
+
searchIcon.onclick = _ev => {
|
|
201
|
+
const searchField = document.getElementById(this.containerElement.id + '_search_field');
|
|
256
202
|
if (searchField) {
|
|
257
203
|
if (searchField.style.display === 'inline') {
|
|
258
204
|
searchField.style.display = 'none';
|
|
@@ -266,58 +212,54 @@ var ToolPalette = /** @class */ (function (_super) {
|
|
|
266
212
|
searchIcon.classList.add('search-icon');
|
|
267
213
|
searchIcon.title = 'Filter palette entries';
|
|
268
214
|
return searchIcon;
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
var searchField = document.createElement('input');
|
|
215
|
+
}
|
|
216
|
+
createHeaderSearchField() {
|
|
217
|
+
const searchField = document.createElement('input');
|
|
273
218
|
searchField.classList.add('search-input');
|
|
274
219
|
searchField.id = this.containerElement.id + '_search_field';
|
|
275
220
|
searchField.type = 'text';
|
|
276
221
|
searchField.placeholder = ' Search...';
|
|
277
222
|
searchField.style.display = 'none';
|
|
278
|
-
searchField.onkeyup =
|
|
279
|
-
searchField.onkeydown =
|
|
223
|
+
searchField.onkeyup = () => this.requestFilterUpdate(this.searchField.value);
|
|
224
|
+
searchField.onkeydown = ev => this.clearOnEscape(ev);
|
|
280
225
|
return searchField;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
|
|
226
|
+
}
|
|
227
|
+
createHeaderTitle() {
|
|
228
|
+
const header = document.createElement('div');
|
|
284
229
|
header.classList.add('header-icon');
|
|
285
230
|
header.appendChild(createIcon(['fa', 'fa-palette']));
|
|
286
231
|
header.insertAdjacentText('beforeend', 'Palette');
|
|
287
232
|
return header;
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
var button = document.createElement('div');
|
|
233
|
+
}
|
|
234
|
+
createToolButton(item, index) {
|
|
235
|
+
const button = document.createElement('div');
|
|
292
236
|
button.tabIndex = index;
|
|
293
237
|
button.classList.add('tool-button');
|
|
294
238
|
button.innerHTML = item.label;
|
|
295
239
|
button.onclick = this.onClickCreateToolButton(button, item);
|
|
296
|
-
button.onkeydown =
|
|
240
|
+
button.onkeydown = ev => this.clearToolOnEscape(ev);
|
|
297
241
|
return button;
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
_this.changeActiveButton(button);
|
|
242
|
+
}
|
|
243
|
+
onClickCreateToolButton(button, item) {
|
|
244
|
+
return (_ev) => {
|
|
245
|
+
if (!this.editorContext.isReadonly) {
|
|
246
|
+
this.actionDispatcher.dispatchAll(item.actions);
|
|
247
|
+
this.changeActiveButton(button);
|
|
305
248
|
button.focus();
|
|
306
249
|
}
|
|
307
250
|
};
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
_this.changeActiveButton(button);
|
|
251
|
+
}
|
|
252
|
+
onClickStaticToolButton(button, toolId) {
|
|
253
|
+
return (_ev) => {
|
|
254
|
+
if (!this.editorContext.isReadonly) {
|
|
255
|
+
const action = toolId ? new sprotty_1.EnableToolsAction([toolId]) : new sprotty_1.EnableDefaultToolsAction();
|
|
256
|
+
this.actionDispatcher.dispatch(action);
|
|
257
|
+
this.changeActiveButton(button);
|
|
316
258
|
button.focus();
|
|
317
259
|
}
|
|
318
260
|
};
|
|
319
|
-
}
|
|
320
|
-
|
|
261
|
+
}
|
|
262
|
+
changeActiveButton(button) {
|
|
321
263
|
if (this.lastActivebutton) {
|
|
322
264
|
this.lastActivebutton.classList.remove(CLICKED_CSS_CLASS);
|
|
323
265
|
}
|
|
@@ -329,17 +271,16 @@ var ToolPalette = /** @class */ (function (_super) {
|
|
|
329
271
|
this.defaultToolsButton.classList.add(CLICKED_CSS_CLASS);
|
|
330
272
|
this.lastActivebutton = this.defaultToolsButton;
|
|
331
273
|
}
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
var _this = this;
|
|
274
|
+
}
|
|
275
|
+
handle(action) {
|
|
335
276
|
if (action.kind === EnableToolPaletteAction.KIND) {
|
|
336
|
-
|
|
277
|
+
const requestAction = new context_actions_1.RequestContextActions(ToolPalette_1.ID, {
|
|
337
278
|
selectedElementIds: []
|
|
338
279
|
});
|
|
339
|
-
this.actionDispatcher.requestUntil(requestAction).then(
|
|
280
|
+
this.actionDispatcher.requestUntil(requestAction).then(response => {
|
|
340
281
|
if (context_actions_1.isSetContextActionsAction(response)) {
|
|
341
|
-
|
|
342
|
-
|
|
282
|
+
this.paletteItems = response.actions.map(e => e);
|
|
283
|
+
this.actionDispatcher.dispatch(new sprotty_1.SetUIExtensionVisibilityAction(ToolPalette_1.ID, !this.editorContext.isReadonly));
|
|
343
284
|
}
|
|
344
285
|
});
|
|
345
286
|
}
|
|
@@ -347,27 +288,26 @@ var ToolPalette = /** @class */ (function (_super) {
|
|
|
347
288
|
this.changeActiveButton();
|
|
348
289
|
this.restoreFocus();
|
|
349
290
|
}
|
|
350
|
-
}
|
|
351
|
-
|
|
291
|
+
}
|
|
292
|
+
editModeChanged(_oldValue, _newValue) {
|
|
352
293
|
this.actionDispatcher.dispatch(new sprotty_1.SetUIExtensionVisibilityAction(ToolPalette_1.ID, !this.editorContext.isReadonly));
|
|
353
|
-
}
|
|
354
|
-
|
|
294
|
+
}
|
|
295
|
+
clearOnEscape(event) {
|
|
355
296
|
if (keyboard_1.matchesKeystroke(event, 'Escape')) {
|
|
356
297
|
this.searchField.value = '';
|
|
357
298
|
this.requestFilterUpdate('');
|
|
358
299
|
}
|
|
359
|
-
}
|
|
360
|
-
|
|
300
|
+
}
|
|
301
|
+
clearToolOnEscape(event) {
|
|
361
302
|
if (keyboard_1.matchesKeystroke(event, 'Escape')) {
|
|
362
303
|
this.actionDispatcher.dispatch(new sprotty_1.EnableDefaultToolsAction());
|
|
363
304
|
}
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
this.paletteItems = action.actions.map(
|
|
305
|
+
}
|
|
306
|
+
handleSetContextActions(action) {
|
|
307
|
+
this.paletteItems = action.actions.map(e => e);
|
|
367
308
|
this.createBody();
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
var e_1, _a;
|
|
309
|
+
}
|
|
310
|
+
requestFilterUpdate(filter) {
|
|
371
311
|
// Initialize the copy if it's empty
|
|
372
312
|
if (this.paletteItemsCopy.length === 0) {
|
|
373
313
|
// Creating deep copy
|
|
@@ -376,65 +316,50 @@ var ToolPalette = /** @class */ (function (_super) {
|
|
|
376
316
|
// Reset the paletteItems before searching
|
|
377
317
|
this.paletteItems = JSON.parse(JSON.stringify(this.paletteItemsCopy));
|
|
378
318
|
// Filter the entries
|
|
379
|
-
|
|
380
|
-
|
|
319
|
+
const filteredPaletteItems = [];
|
|
320
|
+
for (const itemGroup of this.paletteItems) {
|
|
381
321
|
if (itemGroup.children) {
|
|
382
322
|
// Fetch the labels according to the filter
|
|
383
|
-
|
|
323
|
+
const matchingChildren = itemGroup.children.filter(child => child.label.toLowerCase().includes(filter.toLowerCase()));
|
|
384
324
|
// Add the itemgroup containing the correct entries
|
|
385
325
|
if (matchingChildren.length > 0) {
|
|
386
326
|
// Clear existing children
|
|
387
327
|
itemGroup.children.splice(0, itemGroup.children.length);
|
|
388
328
|
// Push the matching children
|
|
389
|
-
matchingChildren.forEach(
|
|
329
|
+
matchingChildren.forEach(child => itemGroup.children.push(child));
|
|
390
330
|
filteredPaletteItems.push(itemGroup);
|
|
391
331
|
}
|
|
392
332
|
}
|
|
393
|
-
};
|
|
394
|
-
try {
|
|
395
|
-
for (var _b = __values(this.paletteItems), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
396
|
-
var itemGroup = _c.value;
|
|
397
|
-
_loop_1(itemGroup);
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
401
|
-
finally {
|
|
402
|
-
try {
|
|
403
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
404
|
-
}
|
|
405
|
-
finally { if (e_1) throw e_1.error; }
|
|
406
333
|
}
|
|
407
334
|
this.paletteItems = filteredPaletteItems;
|
|
408
335
|
this.createBody();
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
return ToolPalette;
|
|
434
|
-
}(sprotty_1.AbstractUIExtension));
|
|
336
|
+
}
|
|
337
|
+
};
|
|
338
|
+
ToolPalette.ID = 'tool-palette';
|
|
339
|
+
__decorate([
|
|
340
|
+
inversify_1.inject(sprotty_1.TYPES.IActionDispatcher),
|
|
341
|
+
__metadata("design:type", action_dispatcher_1.GLSPActionDispatcher)
|
|
342
|
+
], ToolPalette.prototype, "actionDispatcher", void 0);
|
|
343
|
+
__decorate([
|
|
344
|
+
inversify_1.inject(sprotty_1.TYPES.IToolManager),
|
|
345
|
+
__metadata("design:type", Object)
|
|
346
|
+
], ToolPalette.prototype, "toolManager", void 0);
|
|
347
|
+
__decorate([
|
|
348
|
+
inversify_1.inject(editor_context_1.EditorContextService),
|
|
349
|
+
__metadata("design:type", editor_context_1.EditorContextService)
|
|
350
|
+
], ToolPalette.prototype, "editorContext", void 0);
|
|
351
|
+
__decorate([
|
|
352
|
+
inversify_1.postConstruct(),
|
|
353
|
+
__metadata("design:type", Function),
|
|
354
|
+
__metadata("design:paramtypes", []),
|
|
355
|
+
__metadata("design:returntype", void 0)
|
|
356
|
+
], ToolPalette.prototype, "postConstruct", null);
|
|
357
|
+
ToolPalette = ToolPalette_1 = __decorate([
|
|
358
|
+
inversify_1.injectable()
|
|
359
|
+
], ToolPalette);
|
|
435
360
|
exports.ToolPalette = ToolPalette;
|
|
436
361
|
function compare(a, b) {
|
|
437
|
-
|
|
362
|
+
const sortStringBased = a.sortString.localeCompare(b.sortString);
|
|
438
363
|
if (sortStringBased !== 0) {
|
|
439
364
|
return sortStringBased;
|
|
440
365
|
}
|
|
@@ -442,26 +367,25 @@ function compare(a, b) {
|
|
|
442
367
|
}
|
|
443
368
|
exports.compare = compare;
|
|
444
369
|
function createIcon(cssClasses) {
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
(_a = icon.classList).add.apply(_a, __spread(cssClasses));
|
|
370
|
+
const icon = document.createElement('i');
|
|
371
|
+
icon.classList.add(...cssClasses);
|
|
448
372
|
return icon;
|
|
449
373
|
}
|
|
450
374
|
exports.createIcon = createIcon;
|
|
451
375
|
function createToolGroup(item) {
|
|
452
|
-
|
|
376
|
+
const group = document.createElement('div');
|
|
453
377
|
group.classList.add('tool-group');
|
|
454
378
|
group.id = item.id;
|
|
455
|
-
|
|
379
|
+
const header = document.createElement('div');
|
|
456
380
|
header.classList.add('group-header');
|
|
457
381
|
if (item.icon) {
|
|
458
382
|
header.appendChild(createIcon(['fas', item.icon]));
|
|
459
383
|
}
|
|
460
384
|
header.insertAdjacentText('beforeend', item.label);
|
|
461
|
-
header.ondblclick =
|
|
462
|
-
|
|
385
|
+
header.ondblclick = _ev => {
|
|
386
|
+
const css = 'collapsed';
|
|
463
387
|
changeCSSClass(group, css);
|
|
464
|
-
Array.from(group.children).forEach(
|
|
388
|
+
Array.from(group.children).forEach(child => changeCSSClass(child, css));
|
|
465
389
|
window.getSelection().removeAllRanges();
|
|
466
390
|
};
|
|
467
391
|
group.appendChild(header);
|
|
@@ -469,8 +393,7 @@ function createToolGroup(item) {
|
|
|
469
393
|
}
|
|
470
394
|
exports.createToolGroup = createToolGroup;
|
|
471
395
|
function changeCSSClass(element, css) {
|
|
472
|
-
element.classList.contains(css) ? element.classList.remove(css) :
|
|
473
|
-
element.classList.add(css);
|
|
396
|
+
element.classList.contains(css) ? element.classList.remove(css) : element.classList.add(css);
|
|
474
397
|
}
|
|
475
398
|
exports.changeCSSClass = changeCSSClass;
|
|
476
399
|
//# sourceMappingURL=tool-palette.js.map
|