@eclipse-glsp/client 1.1.0-next.4a5a0ee.195 → 1.1.0-next.4e10035.245
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 +1 -1
- package/{lib/features/change-bounds/snap.spec.d.ts → css/autocomplete-palette.css} +8 -3
- package/css/decoration.css +1 -1
- package/css/glsp-sprotty.css +34 -19
- package/lib/base/action-dispatcher.js.map +1 -1
- package/lib/base/auto-complete/auto-complete-widget.d.ts +10 -4
- package/lib/base/auto-complete/auto-complete-widget.d.ts.map +1 -1
- package/lib/base/auto-complete/auto-complete-widget.js +28 -9
- package/lib/base/auto-complete/auto-complete-widget.js.map +1 -1
- package/lib/base/command-stack.d.ts +1 -2
- package/lib/base/command-stack.d.ts.map +1 -1
- package/lib/base/command-stack.js +5 -14
- package/lib/base/command-stack.js.map +1 -1
- package/lib/base/container-modules.d.ts +32 -2
- package/lib/base/container-modules.d.ts.map +1 -1
- package/lib/base/container-modules.js +78 -43
- package/lib/base/container-modules.js.map +1 -1
- package/lib/base/di.config.d.ts +1 -1
- package/lib/base/di.config.d.ts.map +1 -1
- package/lib/base/di.config.js +7 -7
- package/lib/base/di.config.js.map +1 -1
- package/lib/base/editor-context-service.d.ts +4 -4
- package/lib/base/editor-context-service.d.ts.map +1 -1
- package/lib/base/editor-context-service.js +3 -3
- package/lib/base/editor-context-service.js.map +1 -1
- package/lib/base/focus-tracker.js.map +1 -1
- package/lib/base/model/model-registry.js.map +1 -1
- package/lib/base/model/update-model-command.js.map +1 -1
- package/lib/base/model-initialization-constraint.js.map +1 -1
- package/lib/base/selection-clearing-mouse-listener.js +1 -1
- package/lib/base/selection-clearing-mouse-listener.js.map +1 -1
- package/lib/base/tool-manager/glsp-tool-manager.d.ts +4 -5
- package/lib/base/tool-manager/glsp-tool-manager.d.ts.map +1 -1
- package/lib/base/tool-manager/glsp-tool-manager.js +15 -8
- package/lib/base/tool-manager/glsp-tool-manager.js.map +1 -1
- package/lib/base/view/view-registry.js.map +1 -1
- package/lib/features/accessibility/di.config.d.ts +21 -0
- package/lib/features/accessibility/di.config.d.ts.map +1 -0
- package/lib/features/accessibility/di.config.js +28 -0
- package/lib/features/accessibility/di.config.js.map +1 -0
- package/lib/features/accessibility/search/di.config.d.ts +20 -0
- package/lib/features/accessibility/search/di.config.d.ts.map +1 -0
- package/lib/features/accessibility/search/di.config.js +33 -0
- package/lib/features/accessibility/search/di.config.js.map +1 -0
- package/lib/features/accessibility/search/search-palette.d.ts +47 -0
- package/lib/features/accessibility/search/search-palette.d.ts.map +1 -0
- package/lib/features/accessibility/search/search-palette.js +155 -0
- package/lib/features/accessibility/search/search-palette.js.map +1 -0
- package/lib/features/accessibility/search/search-tool.d.ts +30 -0
- package/lib/features/accessibility/search/search-tool.d.ts.map +1 -0
- package/lib/features/accessibility/search/search-tool.js +73 -0
- package/lib/features/accessibility/search/search-tool.js.map +1 -0
- package/lib/features/autocomplete-palette/autocomplete-suggestion-providers.d.ts +35 -0
- package/lib/features/autocomplete-palette/autocomplete-suggestion-providers.d.ts.map +1 -0
- package/lib/features/{tools/marquee-behavior.spec.d.ts → autocomplete-palette/autocomplete-suggestion-providers.js} +4 -3
- package/lib/features/autocomplete-palette/autocomplete-suggestion-providers.js.map +1 -0
- package/lib/features/autocomplete-palette/base-autocomplete-palette.d.ts +41 -0
- package/lib/features/autocomplete-palette/base-autocomplete-palette.d.ts.map +1 -0
- package/lib/features/autocomplete-palette/base-autocomplete-palette.js +82 -0
- package/lib/features/autocomplete-palette/base-autocomplete-palette.js.map +1 -0
- package/lib/features/bounds/di.config.d.ts +4 -0
- package/lib/features/bounds/di.config.d.ts.map +1 -0
- package/lib/features/bounds/di.config.js +39 -0
- package/lib/features/bounds/di.config.js.map +1 -0
- package/lib/features/{layout → bounds}/freeform-layout.d.ts +2 -2
- package/lib/features/{layout → bounds}/freeform-layout.d.ts.map +1 -1
- package/lib/features/{layout → bounds}/freeform-layout.js +2 -2
- package/lib/features/{layout → bounds}/freeform-layout.js.map +1 -1
- package/lib/features/bounds/glsp-hidden-bounds-updater.d.ts +34 -0
- package/lib/features/bounds/glsp-hidden-bounds-updater.d.ts.map +1 -0
- package/lib/features/bounds/glsp-hidden-bounds-updater.js +99 -0
- package/lib/features/bounds/glsp-hidden-bounds-updater.js.map +1 -0
- package/lib/features/{layout → bounds}/hbox-layout.d.ts +1 -1
- package/lib/features/{layout → bounds}/hbox-layout.d.ts.map +1 -1
- package/lib/features/{layout → bounds}/hbox-layout.js +1 -1
- package/lib/features/{layout → bounds}/hbox-layout.js.map +1 -1
- package/lib/features/{layout → bounds}/layouter.d.ts +1 -1
- package/lib/features/{layout → bounds}/layouter.d.ts.map +1 -1
- package/lib/features/{layout → bounds}/layouter.js +1 -1
- package/lib/features/{layout → bounds}/layouter.js.map +1 -1
- package/lib/features/{layout → bounds}/vbox-layout.d.ts +1 -1
- package/lib/features/{layout → bounds}/vbox-layout.d.ts.map +1 -1
- package/lib/features/{layout → bounds}/vbox-layout.js +1 -1
- package/lib/features/{layout → bounds}/vbox-layout.js.map +1 -1
- package/lib/features/change-bounds/movement-restrictor.js.map +1 -1
- package/lib/features/change-bounds/snap.js.map +1 -1
- package/lib/features/command-palette/command-palette-tool.d.ts +1 -1
- package/lib/features/command-palette/command-palette-tool.d.ts.map +1 -1
- package/lib/features/command-palette/command-palette-tool.js +3 -3
- package/lib/features/command-palette/command-palette-tool.js.map +1 -1
- package/lib/features/command-palette/di.config.d.ts +0 -15
- package/lib/features/command-palette/di.config.d.ts.map +1 -1
- package/lib/features/command-palette/di.config.js +6 -7
- package/lib/features/command-palette/di.config.js.map +1 -1
- package/lib/features/command-palette/server-command-palette-provider.js.map +1 -1
- package/lib/features/context-menu/delete-element-context-menu.js.map +1 -1
- package/lib/features/context-menu/di.config.d.ts +0 -15
- package/lib/features/context-menu/di.config.d.ts.map +1 -1
- package/lib/features/context-menu/di.config.js +4 -3
- package/lib/features/context-menu/di.config.js.map +1 -1
- package/lib/features/context-menu/selection-service-aware-context-menu-mouse-listener.js.map +1 -1
- package/lib/features/context-menu/server-context-menu-provider.js.map +1 -1
- package/lib/features/copy-paste/copy-paste-context-menu.js.map +1 -1
- package/lib/features/copy-paste/copy-paste-handler.d.ts +4 -4
- package/lib/features/copy-paste/copy-paste-handler.d.ts.map +1 -1
- package/lib/features/copy-paste/copy-paste-handler.js +7 -8
- package/lib/features/copy-paste/copy-paste-handler.js.map +1 -1
- package/lib/features/decoration/decoration-placer.js.map +1 -1
- package/lib/features/decoration/di.config.d.ts +0 -15
- package/lib/features/decoration/di.config.d.ts.map +1 -1
- package/lib/features/decoration/di.config.js +4 -4
- package/lib/features/decoration/di.config.js.map +1 -1
- package/lib/features/edit-label/di.config.d.ts +0 -15
- package/lib/features/edit-label/di.config.d.ts.map +1 -1
- package/lib/features/edit-label/di.config.js +3 -2
- package/lib/features/edit-label/di.config.js.map +1 -1
- package/lib/features/edit-label/edit-label-tool.js.map +1 -1
- package/lib/features/edit-label/edit-label-validator.js.map +1 -1
- package/lib/features/export/di.config.d.ts +4 -0
- package/lib/features/export/di.config.d.ts.map +1 -0
- package/lib/features/export/di.config.js +30 -0
- package/lib/features/export/di.config.js.map +1 -0
- package/lib/features/export/glsp-svg-exporter.d.ts +1 -1
- package/lib/features/export/glsp-svg-exporter.d.ts.map +1 -1
- package/lib/features/export/glsp-svg-exporter.js +1 -2
- package/lib/features/export/glsp-svg-exporter.js.map +1 -1
- package/lib/features/hints/type-hints.js.map +1 -1
- package/lib/features/hover/di.config.d.ts +0 -15
- package/lib/features/hover/di.config.d.ts.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 +2 -1
- package/lib/features/hover/hover.js.map +1 -1
- package/lib/features/layout/di.config.d.ts +1 -1
- package/lib/features/layout/di.config.d.ts.map +1 -1
- package/lib/features/layout/di.config.js +1 -9
- package/lib/features/layout/di.config.js.map +1 -1
- package/lib/features/layout/layout-elements-action.d.ts +4 -4
- package/lib/features/layout/layout-elements-action.d.ts.map +1 -1
- package/lib/features/layout/layout-elements-action.js +2 -2
- package/lib/features/layout/layout-elements-action.js.map +1 -1
- package/lib/features/mouse-tool/mouse-tool.d.ts +1 -1
- package/lib/features/mouse-tool/mouse-tool.d.ts.map +1 -1
- package/lib/features/mouse-tool/mouse-tool.js.map +1 -1
- package/lib/features/navigation/di.config.d.ts +2 -1
- package/lib/features/navigation/di.config.d.ts.map +1 -1
- package/lib/features/navigation/di.config.js +3 -3
- package/lib/features/navigation/di.config.js.map +1 -1
- package/lib/features/navigation/navigation-action-handler.d.ts +2 -2
- package/lib/features/navigation/navigation-action-handler.js +2 -2
- package/lib/features/navigation/navigation-action-handler.js.map +1 -1
- package/lib/features/navigation/navigation-target-resolver.js.map +1 -1
- package/lib/features/save/di.config.d.ts +0 -15
- package/lib/features/save/di.config.d.ts.map +1 -1
- package/lib/features/save/di.config.js +3 -2
- package/lib/features/save/di.config.js.map +1 -1
- package/lib/features/save/model.d.ts +1 -1
- package/lib/features/select/di.config.d.ts +0 -15
- package/lib/features/select/di.config.d.ts.map +1 -1
- package/lib/features/select/di.config.js +8 -7
- package/lib/features/select/di.config.js.map +1 -1
- package/lib/features/select/select-feedback-action.js.map +1 -1
- package/lib/features/select/select-mouse-listener.d.ts +1 -1
- package/lib/features/select/select-mouse-listener.d.ts.map +1 -1
- package/lib/features/select/select-mouse-listener.js +2 -1
- package/lib/features/select/select-mouse-listener.js.map +1 -1
- package/lib/features/select/selection-service.js.map +1 -1
- package/lib/features/source-model-watcher/di.config.js +1 -1
- package/lib/features/source-model-watcher/source-model-changed-action-handler.js.map +1 -1
- package/lib/features/svg-metadata/di.config.d.ts +19 -0
- package/lib/features/svg-metadata/di.config.d.ts.map +1 -0
- package/lib/features/svg-metadata/di.config.js +26 -0
- package/lib/features/svg-metadata/di.config.js.map +1 -0
- package/lib/features/svg-metadata/metadata-placer.d.ts +24 -0
- package/lib/features/svg-metadata/metadata-placer.d.ts.map +1 -0
- package/lib/features/svg-metadata/metadata-placer.js +63 -0
- package/lib/features/svg-metadata/metadata-placer.js.map +1 -0
- package/lib/features/tool-feedback/change-bounds-tool-feedback.d.ts +4 -3
- package/lib/features/tool-feedback/change-bounds-tool-feedback.d.ts.map +1 -1
- package/lib/features/tool-feedback/change-bounds-tool-feedback.js +5 -4
- package/lib/features/tool-feedback/change-bounds-tool-feedback.js.map +1 -1
- package/lib/features/tool-feedback/creation-tool-feedback.d.ts +7 -7
- package/lib/features/tool-feedback/creation-tool-feedback.d.ts.map +1 -1
- package/lib/features/tool-feedback/creation-tool-feedback.js +8 -11
- package/lib/features/tool-feedback/creation-tool-feedback.js.map +1 -1
- package/lib/features/tool-feedback/css-feedback.js.map +1 -1
- package/lib/features/tool-feedback/di.config.d.ts +0 -15
- package/lib/features/tool-feedback/di.config.d.ts.map +1 -1
- package/lib/features/tool-feedback/di.config.js +20 -18
- package/lib/features/tool-feedback/di.config.js.map +1 -1
- package/lib/features/tool-feedback/edge-edit-tool-feedback.d.ts +2 -3
- package/lib/features/tool-feedback/edge-edit-tool-feedback.d.ts.map +1 -1
- package/lib/features/tool-feedback/edge-edit-tool-feedback.js +6 -11
- package/lib/features/tool-feedback/edge-edit-tool-feedback.js.map +1 -1
- package/lib/features/tool-feedback/feedback-action-dispatcher.js.map +1 -1
- package/lib/features/tool-feedback/marquee-tool-feedback.js.map +1 -1
- package/lib/features/tool-feedback/view.js.map +1 -1
- package/lib/features/tool-palette/di.config.d.ts +0 -15
- package/lib/features/tool-palette/di.config.d.ts.map +1 -1
- package/lib/features/tool-palette/di.config.js +4 -4
- package/lib/features/tool-palette/di.config.js.map +1 -1
- package/lib/features/tool-palette/tool-palette.d.ts +1 -1
- package/lib/features/tool-palette/tool-palette.d.ts.map +1 -1
- package/lib/features/tool-palette/tool-palette.js +2 -2
- package/lib/features/tool-palette/tool-palette.js.map +1 -1
- package/lib/features/tools/base-glsp-tool.js.map +1 -1
- package/lib/features/tools/change-bounds-tool.d.ts +1 -1
- package/lib/features/tools/change-bounds-tool.d.ts.map +1 -1
- package/lib/features/tools/change-bounds-tool.js +6 -6
- package/lib/features/tools/change-bounds-tool.js.map +1 -1
- package/lib/features/tools/delete-tool.js.map +1 -1
- package/lib/features/tools/di.config.d.ts +18 -5
- package/lib/features/tools/di.config.d.ts.map +1 -1
- package/lib/features/tools/di.config.js +16 -17
- package/lib/features/tools/di.config.js.map +1 -1
- package/lib/features/tools/edge-creation-tool.js.map +1 -1
- package/lib/features/tools/edge-edit-tool.js.map +1 -1
- package/lib/features/tools/enable-default-tools-on-focus-loss.js.map +1 -1
- package/lib/features/tools/glsp-manhattan-edge-router.d.ts +20 -0
- package/lib/features/tools/glsp-manhattan-edge-router.d.ts.map +1 -0
- package/lib/features/tools/glsp-manhattan-edge-router.js +69 -0
- package/lib/features/tools/glsp-manhattan-edge-router.js.map +1 -0
- package/lib/features/tools/marquee-mouse-tool.js.map +1 -1
- package/lib/features/tools/marquee-tool.js.map +1 -1
- package/lib/features/tools/node-creation-tool.js.map +1 -1
- package/lib/features/tools/view.js.map +1 -1
- package/lib/features/validation/di.config.js +4 -4
- package/lib/features/validation/di.config.js.map +1 -1
- package/lib/features/validation/issue-marker.d.ts +1 -1
- package/lib/features/validation/issue-marker.js +1 -1
- package/lib/features/validation/marker-navigator.d.ts +1 -1
- package/lib/features/validation/marker-navigator.d.ts.map +1 -1
- package/lib/features/validation/marker-navigator.js.map +1 -1
- package/lib/features/validation/validate.d.ts +6 -6
- package/lib/features/validation/validate.d.ts.map +1 -1
- package/lib/features/validation/validate.js +18 -17
- package/lib/features/validation/validate.js.map +1 -1
- package/lib/features/viewport/di.config.d.ts +0 -15
- package/lib/features/viewport/di.config.d.ts.map +1 -1
- package/lib/features/viewport/di.config.js +12 -11
- package/lib/features/viewport/di.config.js.map +1 -1
- package/lib/features/viewport/glsp-scroll-mouse-listener.js.map +1 -1
- package/lib/index.d.ts +30 -4
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +79 -43
- package/lib/index.js.map +1 -1
- package/lib/lib/model.d.ts +7 -3
- package/lib/lib/model.d.ts.map +1 -1
- package/lib/lib/model.js +48 -1
- package/lib/lib/model.js.map +1 -1
- package/lib/model-source/glsp-diagram-server.js.map +1 -1
- package/lib/sprotty-reexport.d.ts +7 -7
- package/lib/sprotty-reexport.d.ts.map +1 -1
- package/lib/sprotty-reexport.js +19 -10
- package/lib/sprotty-reexport.js.map +1 -1
- package/lib/utils/html-utils.d.ts +1 -1
- package/lib/utils/html-utils.js +1 -1
- package/lib/utils/smodel-util.d.ts +28 -7
- package/lib/utils/smodel-util.d.ts.map +1 -1
- package/lib/utils/smodel-util.js +41 -8
- package/lib/utils/smodel-util.js.map +1 -1
- package/lib/views/base-view-module.d.ts +18 -6
- package/lib/views/base-view-module.d.ts.map +1 -1
- package/lib/views/base-view-module.js +1 -1
- package/lib/views/base-view-module.js.map +1 -1
- package/lib/views/compartments.js.map +1 -1
- package/lib/views/glsp-edge-view.d.ts +2 -2
- package/lib/views/glsp-edge-view.d.ts.map +1 -1
- package/lib/views/glsp-edge-view.js +2 -2
- package/lib/views/glsp-edge-view.js.map +1 -1
- package/lib/views/glsp-projection-view.d.ts +1 -1
- package/lib/views/glsp-projection-view.js +1 -1
- package/lib/views/glsp-projection-view.js.map +1 -1
- package/lib/views/index.d.ts +1 -1
- package/lib/views/index.js +1 -1
- package/lib/views/issue-marker-view.js.map +1 -1
- package/lib/views/rounded-corner-view.js +2 -2
- package/lib/views/rounded-corner-view.js.map +1 -1
- package/lib/views/rounded-corner.d.ts +1 -1
- package/lib/views/rounded-corner.js +1 -1
- package/package.json +25 -24
- package/src/base/auto-complete/auto-complete-widget.ts +34 -10
- package/src/base/command-stack.ts +13 -11
- package/src/base/container-modules.ts +44 -11
- package/src/base/di.config.ts +8 -8
- package/src/base/editor-context-service.ts +4 -4
- package/src/base/selection-clearing-mouse-listener.ts +1 -1
- package/src/base/tool-manager/glsp-tool-manager.ts +15 -12
- package/src/features/accessibility/di.config.ts +26 -0
- package/src/features/accessibility/search/di.config.ts +31 -0
- package/src/features/accessibility/search/search-palette.ts +181 -0
- package/src/features/accessibility/search/search-tool.ts +60 -0
- package/src/features/autocomplete-palette/autocomplete-suggestion-providers.ts +37 -0
- package/src/features/autocomplete-palette/base-autocomplete-palette.ts +88 -0
- package/src/features/bounds/di.config.ts +49 -0
- package/src/features/{layout/tests → bounds}/freeform-layout.spec.ts +2 -2
- package/src/features/{layout → bounds}/freeform-layout.ts +2 -2
- package/src/features/bounds/glsp-hidden-bounds-updater.ts +85 -0
- package/src/features/{layout/tests → bounds}/hbox-layout.spec.ts +2 -2
- package/src/features/{layout → bounds}/hbox-layout.ts +1 -1
- package/src/features/{layout/tests/layouter-test-util.ts → bounds/layouter-test-util.spec.ts} +6 -6
- package/src/features/{layout → bounds}/layouter.ts +1 -1
- package/src/features/{layout/tests → bounds}/vbox-layout.spec.ts +2 -2
- package/src/features/{layout → bounds}/vbox-layout.ts +1 -1
- package/src/features/command-palette/command-palette-tool.ts +3 -3
- package/src/features/command-palette/di.config.ts +6 -7
- package/src/features/context-menu/di.config.ts +4 -3
- package/src/features/copy-paste/copy-paste-handler.ts +9 -13
- package/src/features/decoration/di.config.ts +4 -4
- package/src/features/edit-label/di.config.ts +3 -2
- package/src/features/export/di.config.ts +29 -0
- package/src/features/export/glsp-svg-exporter.ts +8 -7
- package/src/features/hover/di.config.ts +8 -7
- package/src/features/hover/hover.ts +2 -1
- package/src/features/layout/di.config.ts +2 -11
- package/src/features/layout/layout-elements-action.ts +2 -1
- package/src/features/navigation/di.config.ts +4 -2
- package/src/features/navigation/navigation-action-handler.ts +2 -2
- package/src/features/save/di.config.ts +3 -2
- package/src/features/save/model.ts +1 -1
- package/src/features/select/di.config.ts +8 -7
- package/src/features/select/select-mouse-listener.ts +2 -2
- package/src/features/select/selection-service.spec.ts +4 -5
- package/src/features/source-model-watcher/di.config.ts +1 -1
- package/src/features/svg-metadata/di.config.ts +26 -0
- package/src/features/svg-metadata/metadata-placer.ts +51 -0
- package/src/features/tool-feedback/change-bounds-tool-feedback.ts +4 -4
- package/src/features/tool-feedback/creation-tool-feedback.ts +22 -16
- package/src/features/tool-feedback/di.config.ts +20 -18
- package/src/features/tool-feedback/edge-edit-tool-feedback.ts +3 -11
- package/src/features/tool-palette/di.config.ts +4 -4
- package/src/features/tool-palette/tool-palette.ts +4 -4
- package/src/features/tools/change-bounds-tool.ts +7 -7
- package/src/features/tools/di.config.ts +20 -21
- package/src/features/tools/glsp-manhattan-edge-router.ts +60 -0
- package/src/features/validation/di.config.ts +5 -5
- package/src/features/validation/issue-marker.ts +1 -1
- package/src/features/validation/validate.ts +16 -19
- package/src/features/viewport/di.config.ts +13 -11
- package/src/index.ts +41 -5
- package/src/lib/model.ts +35 -3
- package/src/sprotty-reexport.ts +24 -8
- package/src/utils/html-utils.ts +1 -1
- package/src/utils/smodel-util.ts +55 -11
- package/src/views/base-view-module.ts +4 -9
- package/src/views/glsp-edge-view.tsx +3 -3
- package/src/views/glsp-projection-view.tsx +1 -1
- package/src/views/index.ts +1 -2
- package/src/views/rounded-corner-view.tsx +2 -2
- package/src/views/rounded-corner.ts +2 -2
- package/lib/features/change-bounds/snap.spec.d.ts.map +0 -1
- package/lib/features/change-bounds/snap.spec.js +0 -82
- package/lib/features/change-bounds/snap.spec.js.map +0 -1
- package/lib/features/layout/layout-elements-action.spec.d.ts +0 -3
- package/lib/features/layout/layout-elements-action.spec.d.ts.map +0 -1
- package/lib/features/layout/layout-elements-action.spec.js +0 -325
- package/lib/features/layout/layout-elements-action.spec.js.map +0 -1
- package/lib/features/layout/tests/freeform-layout.spec.d.ts +0 -3
- package/lib/features/layout/tests/freeform-layout.spec.d.ts.map +0 -1
- package/lib/features/layout/tests/freeform-layout.spec.js +0 -201
- package/lib/features/layout/tests/freeform-layout.spec.js.map +0 -1
- package/lib/features/layout/tests/hbox-layout.spec.d.ts +0 -3
- package/lib/features/layout/tests/hbox-layout.spec.d.ts.map +0 -1
- package/lib/features/layout/tests/hbox-layout.spec.js +0 -161
- package/lib/features/layout/tests/hbox-layout.spec.js.map +0 -1
- package/lib/features/layout/tests/layouter-test-util.d.ts +0 -34
- package/lib/features/layout/tests/layouter-test-util.d.ts.map +0 -1
- package/lib/features/layout/tests/layouter-test-util.js +0 -96
- package/lib/features/layout/tests/layouter-test-util.js.map +0 -1
- package/lib/features/layout/tests/vbox-layout.spec.d.ts +0 -3
- package/lib/features/layout/tests/vbox-layout.spec.d.ts.map +0 -1
- package/lib/features/layout/tests/vbox-layout.spec.js +0 -161
- package/lib/features/layout/tests/vbox-layout.spec.js.map +0 -1
- package/lib/features/navigation/navigation-target-resolver.spec.d.ts +0 -3
- package/lib/features/navigation/navigation-target-resolver.spec.d.ts.map +0 -1
- package/lib/features/navigation/navigation-target-resolver.spec.js +0 -54
- package/lib/features/navigation/navigation-target-resolver.spec.js.map +0 -1
- package/lib/features/select/selection-service.spec.d.ts +0 -2
- package/lib/features/select/selection-service.spec.d.ts.map +0 -1
- package/lib/features/select/selection-service.spec.js +0 -347
- package/lib/features/select/selection-service.spec.js.map +0 -1
- package/lib/features/tools/marquee-behavior.spec.d.ts.map +0 -1
- package/lib/features/tools/marquee-behavior.spec.js +0 -165
- package/lib/features/tools/marquee-behavior.spec.js.map +0 -1
- package/lib/features/validation/marker-navigator.spec.d.ts +0 -3
- package/lib/features/validation/marker-navigator.spec.d.ts.map +0 -1
- package/lib/features/validation/marker-navigator.spec.js +0 -169
- package/lib/features/validation/marker-navigator.spec.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eclipse-glsp/client",
|
|
3
|
-
"version": "1.1.0-next.
|
|
3
|
+
"version": "1.1.0-next.4e10035.245+4e10035",
|
|
4
4
|
"description": "A sprotty-based client for GLSP",
|
|
5
|
-
"license": "(EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0)",
|
|
6
5
|
"keywords": [
|
|
7
6
|
"eclipse",
|
|
8
7
|
"graphics",
|
|
@@ -12,15 +11,16 @@
|
|
|
12
11
|
"glsp",
|
|
13
12
|
"diagram editor"
|
|
14
13
|
],
|
|
15
|
-
"author": {
|
|
16
|
-
"name": "Eclipse GLSP"
|
|
17
|
-
},
|
|
18
14
|
"homepage": "https://www.eclipse.org/glsp/",
|
|
15
|
+
"bugs": "https://github.com/eclipse-glsp/glsp/issues",
|
|
19
16
|
"repository": {
|
|
20
17
|
"type": "git",
|
|
21
18
|
"url": "https://github.com/eclipse-glsp/glsp-client.git"
|
|
22
19
|
},
|
|
23
|
-
"
|
|
20
|
+
"license": "(EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0)",
|
|
21
|
+
"author": {
|
|
22
|
+
"name": "Eclipse GLSP"
|
|
23
|
+
},
|
|
24
24
|
"contributors": [
|
|
25
25
|
{
|
|
26
26
|
"name": "Eclipse GLSP Project",
|
|
@@ -28,35 +28,36 @@
|
|
|
28
28
|
"url": "https://projects.eclipse.org/projects/ecd.glsp"
|
|
29
29
|
}
|
|
30
30
|
],
|
|
31
|
+
"main": "lib/index",
|
|
32
|
+
"types": "lib/index",
|
|
31
33
|
"files": [
|
|
32
34
|
"lib",
|
|
33
35
|
"src",
|
|
34
36
|
"css"
|
|
35
37
|
],
|
|
38
|
+
"scripts": {
|
|
39
|
+
"build": "tsc -b",
|
|
40
|
+
"clean": "rimraf lib tsconfig.tsbuildinfo coverage .nyc_output",
|
|
41
|
+
"lint": "eslint --ext .ts,.tsx ./src",
|
|
42
|
+
"lint:ci": "yarn lint -o eslint.xml -f checkstyle",
|
|
43
|
+
"prepare": "yarn clean && yarn build",
|
|
44
|
+
"test": "mocha --config ../../.mocharc \"./src/**/*.spec.?(ts|tsx)\"",
|
|
45
|
+
"test:ci": "export JUNIT_REPORT_PATH=./report.xml && yarn test --reporter mocha-jenkins-reporter",
|
|
46
|
+
"test:coverage": "nyc yarn test",
|
|
47
|
+
"watch": "tsc -w"
|
|
48
|
+
},
|
|
36
49
|
"dependencies": {
|
|
37
|
-
"@eclipse-glsp/protocol": "1.1.0-next.
|
|
50
|
+
"@eclipse-glsp/protocol": "1.1.0-next.4e10035.245+4e10035",
|
|
38
51
|
"autocompleter": "5.1.0",
|
|
39
|
-
"
|
|
52
|
+
"lodash": "4.17.21",
|
|
53
|
+
"sprotty": "0.13.0-next.f4445dd.342"
|
|
40
54
|
},
|
|
41
55
|
"devDependencies": {
|
|
42
|
-
"@
|
|
43
|
-
"
|
|
44
|
-
"typescript": "^4.5.5"
|
|
45
|
-
},
|
|
46
|
-
"scripts": {
|
|
47
|
-
"prepare": "yarn clean && yarn build && yarn lint",
|
|
48
|
-
"clean": "rimraf lib tsconfig.tsbuildinfo ",
|
|
49
|
-
"build": "tsc",
|
|
50
|
-
"lint": "eslint --ext .ts,.tsx ./src",
|
|
51
|
-
"lint:fix": "eslint --fix --ext .ts,.tsx ./src",
|
|
52
|
-
"watch": "tsc -w",
|
|
53
|
-
"test": "mocha --config ../../.mocharc.json \"./src/**/*.spec.?(ts|tsx)\"",
|
|
54
|
-
"test:ci": "export JUNIT_REPORT_PATH=./report.xml && yarn test --reporter mocha-jenkins-reporter"
|
|
56
|
+
"@types/lodash": "4.14.191",
|
|
57
|
+
"@vscode/codicons": "^0.0.25"
|
|
55
58
|
},
|
|
56
59
|
"publishConfig": {
|
|
57
60
|
"access": "public"
|
|
58
61
|
},
|
|
59
|
-
"
|
|
60
|
-
"types": "lib/index",
|
|
61
|
-
"gitHead": "4a5a0ee31d30e7a3ff8edf3fd5bc95065c841c1c"
|
|
62
|
+
"gitHead": "4e100359fa5e72415368d0670906e1d03c1d6b05"
|
|
62
63
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2020-
|
|
2
|
+
* Copyright (c) 2020-2023 EclipseSource and others.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made available under the
|
|
5
5
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -28,6 +28,7 @@ export interface AutoCompleteSettings {
|
|
|
28
28
|
readonly showOnFocus?: boolean;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
export type CloseReason = 'submission' | 'blur' | 'escape';
|
|
31
32
|
export interface InputValidator {
|
|
32
33
|
validate(input: string): Promise<ValidationStatus>;
|
|
33
34
|
}
|
|
@@ -48,6 +49,11 @@ export interface TextSubmitHandler {
|
|
|
48
49
|
executeFromTextOnlyInput(input: string): void;
|
|
49
50
|
}
|
|
50
51
|
|
|
52
|
+
export interface AutoCompleteWidgetOptions {
|
|
53
|
+
visibleSuggestionsChanged?: (suggestions: LabeledAction[]) => void;
|
|
54
|
+
selectedSuggestionChanged?: (suggestion?: LabeledAction) => void;
|
|
55
|
+
}
|
|
56
|
+
|
|
51
57
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
52
58
|
const configureAutocomplete: (settings: AutocompleteSettings<LabeledAction>) => AutocompleteResult = require('autocompleter');
|
|
53
59
|
|
|
@@ -78,8 +84,9 @@ export class AutoCompleteWidget {
|
|
|
78
84
|
public suggestionProvider: SuggestionProvider,
|
|
79
85
|
public suggestionSubmitHandler: SuggestionSubmitHandler,
|
|
80
86
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
81
|
-
protected notifyClose: () => void = () => {},
|
|
82
|
-
protected logger?: ILogger
|
|
87
|
+
protected notifyClose: (reason: CloseReason) => void = () => {},
|
|
88
|
+
protected logger?: ILogger,
|
|
89
|
+
protected options?: AutoCompleteWidgetOptions
|
|
83
90
|
) {}
|
|
84
91
|
|
|
85
92
|
configureValidation(
|
|
@@ -109,13 +116,18 @@ export class AutoCompleteWidget {
|
|
|
109
116
|
inputElement.autocomplete = 'false';
|
|
110
117
|
inputElement.style.width = '100%';
|
|
111
118
|
inputElement.addEventListener('keydown', event => this.handleKeyDown(event));
|
|
112
|
-
inputElement.addEventListener('blur', () =>
|
|
119
|
+
inputElement.addEventListener('blur', () => {
|
|
120
|
+
if (this.containerElement.style.visibility !== 'hidden') {
|
|
121
|
+
window.setTimeout(() => this.notifyClose('blur'), 200);
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
|
|
113
125
|
return inputElement;
|
|
114
126
|
}
|
|
115
127
|
|
|
116
128
|
protected handleKeyDown(event: KeyboardEvent): void {
|
|
117
129
|
if (matchesKeystroke(event, 'Escape')) {
|
|
118
|
-
this.notifyClose();
|
|
130
|
+
this.notifyClose('escape');
|
|
119
131
|
return;
|
|
120
132
|
}
|
|
121
133
|
if (matchesKeystroke(event, 'Enter') && !this.isInputElementChanged() && this.isSuggestionAvailable()) {
|
|
@@ -133,7 +145,7 @@ export class AutoCompleteWidget {
|
|
|
133
145
|
}
|
|
134
146
|
if (this.textSubmitHandler) {
|
|
135
147
|
this.executeFromTextOnlyInput();
|
|
136
|
-
this.notifyClose();
|
|
148
|
+
this.notifyClose('submission');
|
|
137
149
|
}
|
|
138
150
|
}
|
|
139
151
|
|
|
@@ -175,6 +187,17 @@ export class AutoCompleteWidget {
|
|
|
175
187
|
// move container into our UIExtension container as this is already positioned correctly
|
|
176
188
|
if (this.containerElement) {
|
|
177
189
|
this.containerElement.appendChild(container);
|
|
190
|
+
|
|
191
|
+
if (this.options && this.options.selectedSuggestionChanged) {
|
|
192
|
+
const selectedElement = container.querySelector('.selected');
|
|
193
|
+
// eslint-disable-next-line no-null/no-null
|
|
194
|
+
if (selectedElement !== null && selectedElement !== undefined) {
|
|
195
|
+
const index = Array.from(container.children).indexOf(selectedElement);
|
|
196
|
+
this.options.selectedSuggestionChanged(this.contextActions?.[index]);
|
|
197
|
+
} else {
|
|
198
|
+
this.options.selectedSuggestionChanged(undefined);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
178
201
|
}
|
|
179
202
|
}
|
|
180
203
|
|
|
@@ -189,6 +212,7 @@ export class AutoCompleteWidget {
|
|
|
189
212
|
.then(actions => {
|
|
190
213
|
this.contextActions = this.filterActions(text, actions);
|
|
191
214
|
update(this.contextActions);
|
|
215
|
+
this.options?.visibleSuggestionsChanged?.(this.contextActions);
|
|
192
216
|
this.onLoaded('success');
|
|
193
217
|
})
|
|
194
218
|
.catch(reason => {
|
|
@@ -223,16 +247,16 @@ export class AutoCompleteWidget {
|
|
|
223
247
|
|
|
224
248
|
protected renderSuggestions(item: LabeledAction, value: string): HTMLDivElement {
|
|
225
249
|
const itemElement = document.createElement('div');
|
|
226
|
-
const wordMatcher = this.
|
|
250
|
+
const wordMatcher = this.escapeForRegExp(value).split(' ').join('|');
|
|
227
251
|
const regex = new RegExp(wordMatcher, 'gi');
|
|
228
252
|
if (item.icon) {
|
|
229
253
|
this.renderIcon(itemElement, item.icon);
|
|
230
254
|
}
|
|
231
|
-
itemElement.innerHTML += item.label.replace(regex, match => '<em>' + match + '</em>');
|
|
255
|
+
itemElement.innerHTML += item.label.replace(regex, match => '<em>' + match + '</em>').replace(/ /g, ' ');
|
|
232
256
|
return itemElement;
|
|
233
257
|
}
|
|
234
258
|
|
|
235
|
-
protected
|
|
259
|
+
protected escapeForRegExp(value: string): string {
|
|
236
260
|
return value.replace(/([.?*+^$[\]\\(){}|-])/g, '\\$1');
|
|
237
261
|
}
|
|
238
262
|
|
|
@@ -257,7 +281,7 @@ export class AutoCompleteWidget {
|
|
|
257
281
|
window.setTimeout(() => this.inputElement.dispatchEvent(new Event('keyup')));
|
|
258
282
|
} else {
|
|
259
283
|
this.executeFromSuggestion(item);
|
|
260
|
-
this.notifyClose();
|
|
284
|
+
this.notifyClose('submission');
|
|
261
285
|
}
|
|
262
286
|
}
|
|
263
287
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2019-
|
|
2
|
+
* Copyright (c) 2019-2023 EclipseSource and others.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made available under the
|
|
5
5
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -13,22 +13,24 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import { CommandStack, IActionDispatcher, SModelRoot } from 'sprotty';
|
|
19
|
-
import { TYPES } from './types';
|
|
16
|
+
import { injectable } from 'inversify';
|
|
17
|
+
import { CommandStack, SModelRoot } from 'sprotty';
|
|
20
18
|
|
|
21
19
|
@injectable()
|
|
22
20
|
export class GLSPCommandStack extends CommandStack {
|
|
23
|
-
@inject(TYPES.IActionDispatcherProvider) protected actionDispatcher: () => Promise<IActionDispatcher>;
|
|
24
|
-
|
|
25
21
|
override undo(): Promise<SModelRoot> {
|
|
26
|
-
this.
|
|
27
|
-
|
|
22
|
+
this.logger.warn(
|
|
23
|
+
this,
|
|
24
|
+
'GLSPCommandStack.undo() was called. This should never happen as the GLSP server is responsible for handling undo requests'
|
|
25
|
+
);
|
|
26
|
+
return this.currentModel;
|
|
28
27
|
}
|
|
29
28
|
|
|
30
29
|
override redo(): Promise<SModelRoot> {
|
|
31
|
-
this.
|
|
32
|
-
|
|
30
|
+
this.logger.warn(
|
|
31
|
+
this,
|
|
32
|
+
'GLSPCommandStack.redo() was called. This should never happen as the GLSP server is responsible for handling redo requests'
|
|
33
|
+
);
|
|
34
|
+
return this.currentModel;
|
|
33
35
|
}
|
|
34
36
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2021 EclipseSource and others.
|
|
2
|
+
* Copyright (c) 2021-2023 EclipseSource and others.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made available under the
|
|
5
5
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -14,15 +14,14 @@
|
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
|
|
17
|
+
import { ContainerConfiguration, initializeContainer } from '@eclipse-glsp/protocol';
|
|
17
18
|
import { Container, ContainerModule } from 'inversify';
|
|
18
19
|
import {
|
|
19
|
-
boundsModule,
|
|
20
20
|
buttonModule,
|
|
21
21
|
defaultModule,
|
|
22
22
|
edgeIntersectionModule,
|
|
23
23
|
edgeLayoutModule,
|
|
24
24
|
expandModule,
|
|
25
|
-
exportModule,
|
|
26
25
|
fadeModule,
|
|
27
26
|
labelEditUiModule,
|
|
28
27
|
modelSourceModule,
|
|
@@ -30,16 +29,19 @@ import {
|
|
|
30
29
|
routingModule,
|
|
31
30
|
zorderModule
|
|
32
31
|
} from 'sprotty';
|
|
32
|
+
import svgMetadataModule from '../features/svg-metadata/di.config';
|
|
33
|
+
import glspBoundsModule from '../features/bounds/di.config';
|
|
33
34
|
import glspCommandPaletteModule from '../features/command-palette/di.config';
|
|
34
35
|
import glspContextMenuModule from '../features/context-menu/di.config';
|
|
35
36
|
import { glspServerCopyPasteModule } from '../features/copy-paste/di.config';
|
|
36
37
|
import glspDecorationModule from '../features/decoration/di.config';
|
|
37
38
|
import glspEditLabelModule from '../features/edit-label/di.config';
|
|
39
|
+
import glspExportModule from '../features/export/di.config';
|
|
38
40
|
import modelHintsModule from '../features/hints/di.config';
|
|
39
41
|
import glspHoverModule from '../features/hover/di.config';
|
|
40
42
|
import layoutModule from '../features/layout/di.config';
|
|
41
43
|
import glspMouseToolModule from '../features/mouse-tool/di.config';
|
|
42
|
-
import
|
|
44
|
+
import navigationModule from '../features/navigation/di.config';
|
|
43
45
|
import glspSelectModule from '../features/select/di.config';
|
|
44
46
|
import sourceModelWatcherModule from '../features/source-model-watcher/di.config';
|
|
45
47
|
import toolFeedbackModule from '../features/tool-feedback/di.config';
|
|
@@ -52,13 +54,13 @@ import defaultGLSPModule from './di.config';
|
|
|
52
54
|
export const DEFAULT_MODULES = [
|
|
53
55
|
defaultModule,
|
|
54
56
|
defaultGLSPModule,
|
|
55
|
-
boundsModule,
|
|
56
57
|
buttonModule,
|
|
57
58
|
edgeIntersectionModule,
|
|
58
59
|
edgeLayoutModule,
|
|
59
60
|
expandModule,
|
|
60
|
-
|
|
61
|
+
glspExportModule,
|
|
61
62
|
fadeModule,
|
|
63
|
+
glspBoundsModule,
|
|
62
64
|
glspCommandPaletteModule,
|
|
63
65
|
glspContextMenuModule,
|
|
64
66
|
glspDecorationModule,
|
|
@@ -82,8 +84,40 @@ export const DEFAULT_MODULES = [
|
|
|
82
84
|
toolsModule,
|
|
83
85
|
enableDefaultToolsOnFocusLossModule,
|
|
84
86
|
validationModule,
|
|
85
|
-
zorderModule
|
|
86
|
-
|
|
87
|
+
zorderModule,
|
|
88
|
+
svgMetadataModule
|
|
89
|
+
] as const;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Initializes a GLSP Diagram container with the GLSP default modules and the specified custom `modules`.
|
|
93
|
+
* Additional modules can be passed as direct arguments or as part of a {@link ModuleConfiguration}.
|
|
94
|
+
* ```typescript
|
|
95
|
+
* const container= createDiagramContainer(myModule1, myModule2)
|
|
96
|
+
* // or
|
|
97
|
+
* const container= createDiagramContainer({ add: [myModule1, myModule2]})
|
|
98
|
+
* ```
|
|
99
|
+
* Default modules can be excluded using {@link ModuleConfiguration}s.
|
|
100
|
+
* This means, you can still customize the default modules in two ways.
|
|
101
|
+
*
|
|
102
|
+
* First, you can exclude default modules and add a module with your custom code.
|
|
103
|
+
*
|
|
104
|
+
* ```typescript
|
|
105
|
+
* const container = createDiagramContainer({ add:myModelSourceWatcherModule, remove: modelSourceWatcherModule} );
|
|
106
|
+
* ```
|
|
107
|
+
*
|
|
108
|
+
* Second, you can unbind or rebind implementations that are originally bound in one of the default modules.
|
|
109
|
+
*
|
|
110
|
+
* ```typescript
|
|
111
|
+
* rebind(NavigationTargetResolver).to(MyNavigationTargetResolver);
|
|
112
|
+
* ```
|
|
113
|
+
*
|
|
114
|
+
* @param containerConfiguration
|
|
115
|
+
* Custom modules to be loaded in addition to the default modules and/or default modules that should be excluded.
|
|
116
|
+
* @returns The initialized container.
|
|
117
|
+
*/
|
|
118
|
+
export function initializeDiagramContainer(container: Container, ...containerConfiguration: ContainerConfiguration): Container {
|
|
119
|
+
return initializeContainer(container, ...DEFAULT_MODULES, ...containerConfiguration);
|
|
120
|
+
}
|
|
87
121
|
|
|
88
122
|
/**
|
|
89
123
|
* Creates a GLSP Client container with the GLSP default modules and the specified custom `modules`.
|
|
@@ -105,9 +139,8 @@ export const DEFAULT_MODULES = [
|
|
|
105
139
|
* ```
|
|
106
140
|
* @param modules Custom modules to be loaded in addition to the default modules.
|
|
107
141
|
* @returns The created container.
|
|
142
|
+
* @deprecated Please use `initializeDiagramContainer` from `@eclipse-glsp/client` instead
|
|
108
143
|
*/
|
|
109
144
|
export function createClientContainer(...modules: ContainerModule[]): Container {
|
|
110
|
-
|
|
111
|
-
container.load(...DEFAULT_MODULES, ...modules);
|
|
112
|
-
return container;
|
|
145
|
+
return initializeDiagramContainer(new Container(), ...modules);
|
|
113
146
|
}
|
package/src/base/di.config.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2019-
|
|
2
|
+
* Copyright (c) 2019-2023 EclipseSource and others.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made available under the
|
|
5
5
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
import { InitializeResult, SetEditModeAction } from '@eclipse-glsp/protocol';
|
|
16
|
+
import { bindAsService, bindOrRebind, InitializeResult, SetEditModeAction } from '@eclipse-glsp/protocol';
|
|
17
17
|
import '@vscode/codicons/dist/codicon.css';
|
|
18
18
|
import { Container, ContainerModule } from 'inversify';
|
|
19
19
|
import { ActionHandlerRegistry, configureActionHandler, configureCommand, ModelSource, SetModelCommand } from 'sprotty';
|
|
@@ -54,19 +54,19 @@ const defaultGLSPModule = new ContainerModule((bind, _unbind, isBound, rebind) =
|
|
|
54
54
|
configureCommand(context, FeedbackAwareUpdateModelCommand);
|
|
55
55
|
configureActionHandler(context, SetModelCommand.KIND, SetModelActionHandler);
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
bindAsService(context, TYPES.MouseListener, SelectionClearingMouseListener);
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
bindOrRebind(context, TYPES.ICommandStack).to(GLSPCommandStack);
|
|
60
60
|
bind(GLSPToolManager).toSelf().inSingletonScope();
|
|
61
|
-
|
|
61
|
+
bindOrRebind(context, TYPES.IToolManager).toService(GLSPToolManager);
|
|
62
62
|
bind(GLSPActionDispatcher).toSelf().inSingletonScope();
|
|
63
|
-
|
|
63
|
+
bindOrRebind(context, TYPES.IActionDispatcher).toService(GLSPActionDispatcher);
|
|
64
64
|
|
|
65
65
|
bind(ModelInitializationConstraint).to(DefaultModelInitializationConstraint).inSingletonScope();
|
|
66
66
|
|
|
67
67
|
// support re-registration of model elements and views
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
bindOrRebind(context, TYPES.SModelRegistry).to(GLSPModelRegistry).inSingletonScope();
|
|
69
|
+
bindOrRebind(context, TYPES.ViewRegistry).to(GLSPViewRegistry).inSingletonScope();
|
|
70
70
|
});
|
|
71
71
|
|
|
72
72
|
export default defaultGLSPModule;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2020-
|
|
2
|
+
* Copyright (c) 2020-2023 EclipseSource and others.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made available under the
|
|
5
5
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -21,7 +21,7 @@ import { isSourceUriAware } from './source-uri-aware';
|
|
|
21
21
|
import { TYPES } from './types';
|
|
22
22
|
|
|
23
23
|
export interface EditModeListener {
|
|
24
|
-
editModeChanged(newValue: string,
|
|
24
|
+
editModeChanged(newValue: string, oldValue: string): void;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
/**
|
|
@@ -81,11 +81,11 @@ export class EditorContextService implements IActionHandler {
|
|
|
81
81
|
if (SetEditModeAction.is(action)) {
|
|
82
82
|
const oldValue = this._editMode;
|
|
83
83
|
this._editMode = action.editMode;
|
|
84
|
-
this.
|
|
84
|
+
this.notifyEditModeListeners(oldValue);
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
protected
|
|
88
|
+
protected notifyEditModeListeners(oldValue: string): void {
|
|
89
89
|
this.editModeListeners.forEach(listener => listener.editModeChanged(oldValue, this.editMode));
|
|
90
90
|
}
|
|
91
91
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2020 EclipseSource and others.
|
|
2
|
+
* Copyright (c) 2020-2022 EclipseSource and others.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made available under the
|
|
5
5
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2020-
|
|
2
|
+
* Copyright (c) 2020-2023 EclipseSource and others.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made available under the
|
|
5
5
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -13,19 +13,14 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
import { distinctAdd, EditMode } from '@eclipse-glsp/protocol';
|
|
16
|
+
import { AnyObject, distinctAdd, EditMode, hasBooleanProp, hasFunctionProp, hasStringProp } from '@eclipse-glsp/protocol';
|
|
17
17
|
import { inject, injectable, multiInject, optional, postConstruct } from 'inversify';
|
|
18
18
|
import { Tool, ToolManager } from 'sprotty';
|
|
19
19
|
import { EditModeListener, EditorContextService, EditorContextServiceProvider } from '../editor-context-service';
|
|
20
20
|
import { TYPES } from '../types';
|
|
21
21
|
|
|
22
|
-
export interface IGLSPToolManager extends ToolManager {
|
|
23
|
-
/* Disables all actives tools and activates only default tool with non-edit function*/
|
|
24
|
-
disableEditTools(): void;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
22
|
@injectable()
|
|
28
|
-
export class GLSPToolManager extends ToolManager implements
|
|
23
|
+
export class GLSPToolManager extends ToolManager implements EditModeListener {
|
|
29
24
|
protected editorContext?: EditorContextService;
|
|
30
25
|
|
|
31
26
|
@multiInject(TYPES.ITool) @optional() override tools: Tool[];
|
|
@@ -59,7 +54,7 @@ export class GLSPToolManager extends ToolManager implements IGLSPToolManager, Ed
|
|
|
59
54
|
this.disableActiveTools();
|
|
60
55
|
let tools = toolIds.map(id => this.tool(id));
|
|
61
56
|
if (this.editorContext && this.editorContext.isReadonly) {
|
|
62
|
-
tools = tools.filter(tool => tool && (!
|
|
57
|
+
tools = tools.filter(tool => tool && (!GLSPTool.is(tool) || tool.isEditTool === false));
|
|
63
58
|
}
|
|
64
59
|
tools.forEach(tool => {
|
|
65
60
|
if (tool !== undefined) {
|
|
@@ -71,7 +66,7 @@ export class GLSPToolManager extends ToolManager implements IGLSPToolManager, Ed
|
|
|
71
66
|
|
|
72
67
|
disableEditTools(): void {
|
|
73
68
|
this.disableActiveTools();
|
|
74
|
-
this.enable(this.defaultTools.filter(tool => !
|
|
69
|
+
this.enable(this.defaultTools.filter(tool => !GLSPTool.is(tool) || tool.isEditTool === false).map(tool => tool.id));
|
|
75
70
|
}
|
|
76
71
|
|
|
77
72
|
editModeChanged(oldValue: string, newValue: string): void {
|
|
@@ -90,6 +85,14 @@ export interface GLSPTool extends Tool {
|
|
|
90
85
|
isEditTool: boolean;
|
|
91
86
|
}
|
|
92
87
|
|
|
93
|
-
export
|
|
94
|
-
|
|
88
|
+
export namespace GLSPTool {
|
|
89
|
+
export function is(object: unknown): object is GLSPTool {
|
|
90
|
+
return (
|
|
91
|
+
AnyObject.is(object) &&
|
|
92
|
+
hasStringProp(object, 'id') &&
|
|
93
|
+
hasFunctionProp(object, 'enable') &&
|
|
94
|
+
hasFunctionProp(object, 'disable') &&
|
|
95
|
+
hasBooleanProp(object, 'isEditTool')
|
|
96
|
+
);
|
|
97
|
+
}
|
|
95
98
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2023 Business Informatics Group (TU Wien) and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
*
|
|
8
|
+
* This Source Code may also be made available under the following Secondary
|
|
9
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
* with the GNU Classpath Exception which is available at
|
|
12
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
*
|
|
14
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
+
********************************************************************************/
|
|
16
|
+
|
|
17
|
+
import { ContainerModule } from 'inversify';
|
|
18
|
+
import { configureSearchPaletteModule } from './search/di.config';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Enables the accessibility tools for a keyboard-only-usage
|
|
22
|
+
*/
|
|
23
|
+
export const glspAccessibilityModule = new ContainerModule((bind, _unbind, isBound, rebind) => {
|
|
24
|
+
const context = { bind, isBound, rebind };
|
|
25
|
+
configureSearchPaletteModule(context);
|
|
26
|
+
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2023 Business Informatics Group (TU Wien) and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
*
|
|
8
|
+
* This Source Code may also be made available under the following Secondary
|
|
9
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
* with the GNU Classpath Exception which is available at
|
|
12
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
*
|
|
14
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
+
********************************************************************************/
|
|
16
|
+
|
|
17
|
+
import { bindAsService, BindingContext } from '@eclipse-glsp/protocol';
|
|
18
|
+
import { ContainerModule } from 'inversify';
|
|
19
|
+
import { TYPES } from '../../../base/types';
|
|
20
|
+
import { SearchAutocompletePalette } from './search-palette';
|
|
21
|
+
import { SearchAutocompletePaletteTool } from './search-tool';
|
|
22
|
+
|
|
23
|
+
export const glspSearchPaletteModule = new ContainerModule((bind, _unbind, isBound, rebind) => {
|
|
24
|
+
const context = { bind, isBound, rebind };
|
|
25
|
+
configureSearchPaletteModule(context);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export function configureSearchPaletteModule(context: Pick<BindingContext, 'bind'>): void {
|
|
29
|
+
bindAsService(context, TYPES.IUIExtension, SearchAutocompletePalette);
|
|
30
|
+
bindAsService(context, TYPES.IDefaultTool, SearchAutocompletePaletteTool);
|
|
31
|
+
}
|