@eclipse-glsp/client 0.9.0-next.c5944e10
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/LICENSE +277 -0
- package/README.md +12 -0
- package/css/command-palette.css +58 -0
- package/css/decoration.css +37 -0
- package/css/glsp-sprotty.css +106 -0
- package/css/tool-palette.css +138 -0
- package/lib/base/action-dispatcher.d.ts +25 -0
- package/lib/base/action-dispatcher.d.ts.map +1 -0
- package/lib/base/action-dispatcher.js +110 -0
- package/lib/base/action-dispatcher.js.map +1 -0
- package/lib/base/actions/context-actions.d.ts +36 -0
- package/lib/base/actions/context-actions.d.ts.map +1 -0
- package/lib/base/actions/context-actions.js +45 -0
- package/lib/base/actions/context-actions.js.map +1 -0
- package/lib/base/actions/edit-mode-action.d.ts +13 -0
- package/lib/base/actions/edit-mode-action.d.ts.map +1 -0
- package/lib/base/actions/edit-mode-action.js +52 -0
- package/lib/base/actions/edit-mode-action.js.map +1 -0
- package/lib/base/actions/edit-validation-actions.d.ts +78 -0
- package/lib/base/actions/edit-validation-actions.d.ts.map +1 -0
- package/lib/base/actions/edit-validation-actions.js +77 -0
- package/lib/base/actions/edit-validation-actions.js.map +1 -0
- package/lib/base/actions/focus-change-action.d.ts +24 -0
- package/lib/base/actions/focus-change-action.d.ts.map +1 -0
- package/lib/base/actions/focus-change-action.js +16 -0
- package/lib/base/actions/focus-change-action.js.map +1 -0
- package/lib/base/args.d.ts +24 -0
- package/lib/base/args.d.ts.map +1 -0
- package/lib/base/args.js +8 -0
- package/lib/base/args.js.map +1 -0
- package/lib/base/auto-complete/auto-complete-actions.d.ts +21 -0
- package/lib/base/auto-complete/auto-complete-actions.d.ts.map +1 -0
- package/lib/base/auto-complete/auto-complete-actions.js +8 -0
- package/lib/base/auto-complete/auto-complete-actions.js.map +1 -0
- package/lib/base/auto-complete/auto-complete-widget.d.ts +88 -0
- package/lib/base/auto-complete/auto-complete-widget.d.ts.map +1 -0
- package/lib/base/auto-complete/auto-complete-widget.js +233 -0
- package/lib/base/auto-complete/auto-complete-widget.js.map +1 -0
- package/lib/base/auto-complete/validation-decorator.d.ts +47 -0
- package/lib/base/auto-complete/validation-decorator.d.ts.map +1 -0
- package/lib/base/auto-complete/validation-decorator.js +113 -0
- package/lib/base/auto-complete/validation-decorator.js.map +1 -0
- package/lib/base/command-stack.d.ts +7 -0
- package/lib/base/command-stack.d.ts.map +1 -0
- package/lib/base/command-stack.js +49 -0
- package/lib/base/command-stack.js.map +1 -0
- package/lib/base/di.config.d.ts +28 -0
- package/lib/base/di.config.d.ts.map +1 -0
- package/lib/base/di.config.js +81 -0
- package/lib/base/di.config.js.map +1 -0
- package/lib/base/drag-aware-mouse-listener.d.ts +36 -0
- package/lib/base/drag-aware-mouse-listener.d.ts.map +1 -0
- package/lib/base/drag-aware-mouse-listener.js +66 -0
- package/lib/base/drag-aware-mouse-listener.js.map +1 -0
- package/lib/base/editor-context.d.ts +46 -0
- package/lib/base/editor-context.d.ts.map +1 -0
- package/lib/base/editor-context.js +110 -0
- package/lib/base/editor-context.js.map +1 -0
- package/lib/base/focus-tracker.d.ts +9 -0
- package/lib/base/focus-tracker.d.ts.map +1 -0
- package/lib/base/focus-tracker.js +65 -0
- package/lib/base/focus-tracker.js.map +1 -0
- package/lib/base/model/model-registry.d.ts +5 -0
- package/lib/base/model/model-registry.d.ts.map +1 -0
- package/lib/base/model/model-registry.js +43 -0
- package/lib/base/model/model-registry.js.map +1 -0
- package/lib/base/model/update-model-command.d.ts +26 -0
- package/lib/base/model/update-model-command.d.ts.map +1 -0
- package/lib/base/model/update-model-command.js +132 -0
- package/lib/base/model/update-model-command.js.map +1 -0
- package/lib/base/model-initialization-constraint.d.ts +39 -0
- package/lib/base/model-initialization-constraint.d.ts.map +1 -0
- package/lib/base/model-initialization-constraint.js +106 -0
- package/lib/base/model-initialization-constraint.js.map +1 -0
- package/lib/base/operations/operation.d.ts +135 -0
- package/lib/base/operations/operation.d.ts.map +1 -0
- package/lib/base/operations/operation.js +182 -0
- package/lib/base/operations/operation.js.map +1 -0
- package/lib/base/selection-clearing-mouse-listener.d.ts +17 -0
- package/lib/base/selection-clearing-mouse-listener.d.ts.map +1 -0
- package/lib/base/selection-clearing-mouse-listener.js +55 -0
- package/lib/base/selection-clearing-mouse-listener.js.map +1 -0
- package/lib/base/source-uri-aware.d.ts +20 -0
- package/lib/base/source-uri-aware.d.ts.map +1 -0
- package/lib/base/source-uri-aware.js +26 -0
- package/lib/base/source-uri-aware.js.map +1 -0
- package/lib/base/tool-manager/glsp-tool-manager.d.ts +22 -0
- package/lib/base/tool-manager/glsp-tool-manager.d.ts.map +1 -0
- package/lib/base/tool-manager/glsp-tool-manager.js +110 -0
- package/lib/base/tool-manager/glsp-tool-manager.js.map +1 -0
- package/lib/base/types.d.ts +38 -0
- package/lib/base/types.d.ts.map +1 -0
- package/lib/base/types.js +41 -0
- package/lib/base/types.js.map +1 -0
- package/lib/base/view/view-registry.d.ts +5 -0
- package/lib/base/view/view-registry.d.ts.map +1 -0
- package/lib/base/view/view-registry.js +43 -0
- package/lib/base/view/view-registry.js.map +1 -0
- package/lib/features/change-bounds/model.d.ts +38 -0
- package/lib/features/change-bounds/model.d.ts.map +1 -0
- package/lib/features/change-bounds/model.js +61 -0
- package/lib/features/change-bounds/model.js.map +1 -0
- package/lib/features/change-bounds/movement-restrictor.d.ts +14 -0
- package/lib/features/change-bounds/movement-restrictor.d.ts.map +1 -0
- package/lib/features/change-bounds/movement-restrictor.js +90 -0
- package/lib/features/change-bounds/movement-restrictor.js.map +1 -0
- package/lib/features/change-bounds/snap.d.ts +7 -0
- package/lib/features/change-bounds/snap.d.ts.map +1 -0
- package/lib/features/change-bounds/snap.js +44 -0
- package/lib/features/change-bounds/snap.js.map +1 -0
- package/lib/features/command-palette/command-palette-tool.d.ts +12 -0
- package/lib/features/command-palette/command-palette-tool.d.ts.map +1 -0
- package/lib/features/command-palette/command-palette-tool.js +63 -0
- package/lib/features/command-palette/command-palette-tool.js.map +1 -0
- package/lib/features/command-palette/di.config.d.ts +20 -0
- package/lib/features/command-palette/di.config.d.ts.map +1 -0
- package/lib/features/command-palette/di.config.js +33 -0
- package/lib/features/command-palette/di.config.js.map +1 -0
- package/lib/features/command-palette/server-command-palette-provider.d.ts +15 -0
- package/lib/features/command-palette/server-command-palette-provider.d.ts.map +1 -0
- package/lib/features/command-palette/server-command-palette-provider.js +66 -0
- package/lib/features/command-palette/server-command-palette-provider.js.map +1 -0
- package/lib/features/context-menu/delete-element-context-menu.d.ts +8 -0
- package/lib/features/context-menu/delete-element-context-menu.d.ts.map +1 -0
- package/lib/features/context-menu/delete-element-context-menu.js +55 -0
- package/lib/features/context-menu/delete-element-context-menu.js.map +1 -0
- package/lib/features/context-menu/di.config.d.ts +19 -0
- package/lib/features/context-menu/di.config.d.ts.map +1 -0
- package/lib/features/context-menu/di.config.js +36 -0
- package/lib/features/context-menu/di.config.js.map +1 -0
- package/lib/features/context-menu/selection-service-aware-context-menu-mouse-listener.d.ts +9 -0
- package/lib/features/context-menu/selection-service-aware-context-menu-mouse-listener.d.ts.map +1 -0
- package/lib/features/context-menu/selection-service-aware-context-menu-mouse-listener.js +65 -0
- package/lib/features/context-menu/selection-service-aware-context-menu-mouse-listener.js.map +1 -0
- package/lib/features/context-menu/server-context-menu-provider.d.ts +13 -0
- package/lib/features/context-menu/server-context-menu-provider.d.ts.map +1 -0
- package/lib/features/context-menu/server-context-menu-provider.js +63 -0
- package/lib/features/context-menu/server-context-menu-provider.js.map +1 -0
- package/lib/features/copy-paste/copy-paste-actions.d.ts +50 -0
- package/lib/features/copy-paste/copy-paste-actions.d.ts.map +1 -0
- package/lib/features/copy-paste/copy-paste-actions.js +58 -0
- package/lib/features/copy-paste/copy-paste-actions.js.map +1 -0
- package/lib/features/copy-paste/copy-paste-context-menu.d.ts +32 -0
- package/lib/features/copy-paste/copy-paste-context-menu.d.ts.map +1 -0
- package/lib/features/copy-paste/copy-paste-context-menu.js +151 -0
- package/lib/features/copy-paste/copy-paste-context-menu.js.map +1 -0
- package/lib/features/copy-paste/copy-paste-handler.d.ts +50 -0
- package/lib/features/copy-paste/copy-paste-handler.d.ts.map +1 -0
- package/lib/features/copy-paste/copy-paste-handler.js +149 -0
- package/lib/features/copy-paste/copy-paste-handler.js.map +1 -0
- package/lib/features/copy-paste/di.config.d.ts +24 -0
- package/lib/features/copy-paste/di.config.d.ts.map +1 -0
- package/lib/features/copy-paste/di.config.js +40 -0
- package/lib/features/copy-paste/di.config.js.map +1 -0
- package/lib/features/decoration/decoration-placer.d.ts +6 -0
- package/lib/features/decoration/decoration-placer.d.ts.map +1 -0
- package/lib/features/decoration/decoration-placer.js +47 -0
- package/lib/features/decoration/decoration-placer.js.map +1 -0
- package/lib/features/decoration/di.config.d.ts +20 -0
- package/lib/features/decoration/di.config.d.ts.map +1 -0
- package/lib/features/decoration/di.config.js +27 -0
- package/lib/features/decoration/di.config.js.map +1 -0
- package/lib/features/edit-label/di.config.d.ts +19 -0
- package/lib/features/edit-label/di.config.d.ts.map +1 -0
- package/lib/features/edit-label/di.config.js +30 -0
- package/lib/features/edit-label/di.config.js.map +1 -0
- package/lib/features/edit-label/edit-label-tool.d.ts +13 -0
- package/lib/features/edit-label/edit-label-tool.d.ts.map +1 -0
- package/lib/features/edit-label/edit-label-tool.js +55 -0
- package/lib/features/edit-label/edit-label-tool.js.map +1 -0
- package/lib/features/edit-label/edit-label-validator.d.ts +20 -0
- package/lib/features/edit-label/edit-label-validator.d.ts.map +1 -0
- package/lib/features/edit-label/edit-label-validator.js +111 -0
- package/lib/features/edit-label/edit-label-validator.js.map +1 -0
- package/lib/features/hints/di.config.d.ts +19 -0
- package/lib/features/hints/di.config.d.ts.map +1 -0
- package/lib/features/hints/di.config.js +30 -0
- package/lib/features/hints/di.config.js.map +1 -0
- package/lib/features/hints/model.d.ts +26 -0
- package/lib/features/hints/model.d.ts.map +1 -0
- package/lib/features/hints/model.js +14 -0
- package/lib/features/hints/model.js.map +1 -0
- package/lib/features/hints/request-type-hints-action.d.ts +32 -0
- package/lib/features/hints/request-type-hints-action.d.ts.map +1 -0
- package/lib/features/hints/request-type-hints-action.js +26 -0
- package/lib/features/hints/request-type-hints-action.js.map +1 -0
- package/lib/features/hints/type-hints.d.ts +75 -0
- package/lib/features/hints/type-hints.d.ts.map +1 -0
- package/lib/features/hints/type-hints.js +199 -0
- package/lib/features/hints/type-hints.js.map +1 -0
- package/lib/features/hover/di.config.d.ts +19 -0
- package/lib/features/hover/di.config.d.ts.map +1 -0
- package/lib/features/hover/di.config.js +46 -0
- package/lib/features/hover/di.config.js.map +1 -0
- package/lib/features/hover/hover.d.ts +11 -0
- package/lib/features/hover/hover.d.ts.map +1 -0
- package/lib/features/hover/hover.js +88 -0
- package/lib/features/hover/hover.js.map +1 -0
- package/lib/features/layout/di.config.d.ts +19 -0
- package/lib/features/layout/di.config.d.ts.map +1 -0
- package/lib/features/layout/di.config.js +26 -0
- package/lib/features/layout/di.config.js.map +1 -0
- package/lib/features/layout/layout-commands.d.ts +137 -0
- package/lib/features/layout/layout-commands.d.ts.map +1 -0
- package/lib/features/layout/layout-commands.js +411 -0
- package/lib/features/layout/layout-commands.js.map +1 -0
- package/lib/features/layout/layout-commands.spec.d.ts +18 -0
- package/lib/features/layout/layout-commands.spec.d.ts.map +1 -0
- package/lib/features/layout/layout-commands.spec.js +297 -0
- package/lib/features/layout/layout-commands.spec.js.map +1 -0
- package/lib/features/model-source-watcher/di.config.d.ts +19 -0
- package/lib/features/model-source-watcher/di.config.d.ts.map +1 -0
- package/lib/features/model-source-watcher/di.config.js +26 -0
- package/lib/features/model-source-watcher/di.config.js.map +1 -0
- package/lib/features/model-source-watcher/model-source-changed-action-handler.d.ts +23 -0
- package/lib/features/model-source-watcher/model-source-changed-action-handler.d.ts.map +1 -0
- package/lib/features/model-source-watcher/model-source-changed-action-handler.js +83 -0
- package/lib/features/model-source-watcher/model-source-changed-action-handler.js.map +1 -0
- package/lib/features/model-source-watcher/model-source-changed-action.d.ts +24 -0
- package/lib/features/model-source-watcher/model-source-changed-action.d.ts.map +1 -0
- package/lib/features/model-source-watcher/model-source-changed-action.js +16 -0
- package/lib/features/model-source-watcher/model-source-changed-action.js.map +1 -0
- package/lib/features/mouse-tool/di.config.d.ts +19 -0
- package/lib/features/mouse-tool/di.config.d.ts.map +1 -0
- package/lib/features/mouse-tool/di.config.js +28 -0
- package/lib/features/mouse-tool/di.config.js.map +1 -0
- package/lib/features/mouse-tool/mouse-tool.d.ts +19 -0
- package/lib/features/mouse-tool/mouse-tool.d.ts.map +1 -0
- package/lib/features/mouse-tool/mouse-tool.js +140 -0
- package/lib/features/mouse-tool/mouse-tool.js.map +1 -0
- package/lib/features/navigation/di.config.d.ts +18 -0
- package/lib/features/navigation/di.config.d.ts.map +1 -0
- package/lib/features/navigation/di.config.js +31 -0
- package/lib/features/navigation/di.config.js.map +1 -0
- package/lib/features/navigation/navigation-action-handler.d.ts +117 -0
- package/lib/features/navigation/navigation-action-handler.d.ts.map +1 -0
- package/lib/features/navigation/navigation-action-handler.js +293 -0
- package/lib/features/navigation/navigation-action-handler.js.map +1 -0
- package/lib/features/navigation/navigation-target-resolver.d.ts +55 -0
- package/lib/features/navigation/navigation-target-resolver.d.ts.map +1 -0
- package/lib/features/navigation/navigation-target-resolver.js +157 -0
- package/lib/features/navigation/navigation-target-resolver.js.map +1 -0
- package/lib/features/navigation/navigation-target-resolver.spec.d.ts +18 -0
- package/lib/features/navigation/navigation-target-resolver.spec.d.ts.map +1 -0
- package/lib/features/navigation/navigation-target-resolver.spec.js +54 -0
- package/lib/features/navigation/navigation-target-resolver.spec.js.map +1 -0
- package/lib/features/rank/model.d.ts +22 -0
- package/lib/features/rank/model.d.ts.map +1 -0
- package/lib/features/rank/model.js +28 -0
- package/lib/features/rank/model.js.map +1 -0
- package/lib/features/reconnect/model.d.ts +30 -0
- package/lib/features/reconnect/model.d.ts.map +1 -0
- package/lib/features/reconnect/model.js +66 -0
- package/lib/features/reconnect/model.js.map +1 -0
- package/lib/features/save/di.config.d.ts +23 -0
- package/lib/features/save/di.config.d.ts.map +1 -0
- package/lib/features/save/di.config.js +29 -0
- package/lib/features/save/di.config.js.map +1 -0
- package/lib/features/save/model.d.ts +22 -0
- package/lib/features/save/model.d.ts.map +1 -0
- package/lib/features/save/model.js +9 -0
- package/lib/features/save/model.js.map +1 -0
- package/lib/features/save/save.d.ts +27 -0
- package/lib/features/save/save.d.ts.map +1 -0
- package/lib/features/save/save.js +42 -0
- package/lib/features/save/save.js.map +1 -0
- package/lib/features/select/di.config.d.ts +19 -0
- package/lib/features/select/di.config.d.ts.map +1 -0
- package/lib/features/select/di.config.js +35 -0
- package/lib/features/select/di.config.js.map +1 -0
- package/lib/features/select/select-feedback-action.d.ts +34 -0
- package/lib/features/select/select-feedback-action.d.ts.map +1 -0
- package/lib/features/select/select-feedback-action.js +97 -0
- package/lib/features/select/select-feedback-action.js.map +1 -0
- package/lib/features/select/select-mouse-listener.d.ts +25 -0
- package/lib/features/select/select-mouse-listener.d.ts.map +1 -0
- package/lib/features/select/select-mouse-listener.js +32 -0
- package/lib/features/select/select-mouse-listener.js.map +1 -0
- package/lib/features/select/selection-service.d.ts +52 -0
- package/lib/features/select/selection-service.d.ts.map +1 -0
- package/lib/features/select/selection-service.js +226 -0
- package/lib/features/select/selection-service.js.map +1 -0
- package/lib/features/select/selection-service.spec.d.ts +2 -0
- package/lib/features/select/selection-service.spec.d.ts.map +1 -0
- package/lib/features/select/selection-service.spec.js +360 -0
- package/lib/features/select/selection-service.spec.js.map +1 -0
- package/lib/features/tool-feedback/change-bounds-tool-feedback.d.ts +47 -0
- package/lib/features/tool-feedback/change-bounds-tool-feedback.d.ts.map +1 -0
- package/lib/features/tool-feedback/change-bounds-tool-feedback.js +236 -0
- package/lib/features/tool-feedback/change-bounds-tool-feedback.js.map +1 -0
- package/lib/features/tool-feedback/creation-tool-feedback.d.ts +43 -0
- package/lib/features/tool-feedback/creation-tool-feedback.d.ts.map +1 -0
- package/lib/features/tool-feedback/creation-tool-feedback.js +181 -0
- package/lib/features/tool-feedback/creation-tool-feedback.js.map +1 -0
- package/lib/features/tool-feedback/css-feedback.d.ts +32 -0
- package/lib/features/tool-feedback/css-feedback.d.ts.map +1 -0
- package/lib/features/tool-feedback/css-feedback.js +111 -0
- package/lib/features/tool-feedback/css-feedback.js.map +1 -0
- package/lib/features/tool-feedback/di.config.d.ts +19 -0
- package/lib/features/tool-feedback/di.config.d.ts.map +1 -0
- package/lib/features/tool-feedback/di.config.js +53 -0
- package/lib/features/tool-feedback/di.config.js.map +1 -0
- package/lib/features/tool-feedback/edge-edit-tool-feedback.d.ts +82 -0
- package/lib/features/tool-feedback/edge-edit-tool-feedback.d.ts.map +1 -0
- package/lib/features/tool-feedback/edge-edit-tool-feedback.js +315 -0
- package/lib/features/tool-feedback/edge-edit-tool-feedback.js.map +1 -0
- package/lib/features/tool-feedback/feedback-action-dispatcher.d.ts +50 -0
- package/lib/features/tool-feedback/feedback-action-dispatcher.d.ts.map +1 -0
- package/lib/features/tool-feedback/feedback-action-dispatcher.js +75 -0
- package/lib/features/tool-feedback/feedback-action-dispatcher.js.map +1 -0
- package/lib/features/tool-feedback/marquee-tool-feedback.d.ts +32 -0
- package/lib/features/tool-feedback/marquee-tool-feedback.d.ts.map +1 -0
- package/lib/features/tool-feedback/marquee-tool-feedback.js +111 -0
- package/lib/features/tool-feedback/marquee-tool-feedback.js.map +1 -0
- package/lib/features/tool-feedback/model.d.ts +23 -0
- package/lib/features/tool-feedback/model.d.ts.map +1 -0
- package/lib/features/tool-feedback/model.js +34 -0
- package/lib/features/tool-feedback/model.js.map +1 -0
- package/lib/features/tool-feedback/view.d.ts +16 -0
- package/lib/features/tool-feedback/view.d.ts.map +1 -0
- package/lib/features/tool-feedback/view.js +81 -0
- package/lib/features/tool-feedback/view.js.map +1 -0
- package/lib/features/tool-palette/di.config.d.ts +20 -0
- package/lib/features/tool-palette/di.config.d.ts.map +1 -0
- package/lib/features/tool-palette/di.config.js +29 -0
- package/lib/features/tool-palette/di.config.js.map +1 -0
- package/lib/features/tool-palette/palette-item.d.ts +27 -0
- package/lib/features/tool-palette/palette-item.d.ts.map +1 -0
- package/lib/features/tool-palette/palette-item.js +37 -0
- package/lib/features/tool-palette/palette-item.js.map +1 -0
- package/lib/features/tool-palette/tool-palette.d.ts +56 -0
- package/lib/features/tool-palette/tool-palette.d.ts.map +1 -0
- package/lib/features/tool-palette/tool-palette.js +401 -0
- package/lib/features/tool-palette/tool-palette.js.map +1 -0
- package/lib/features/tools/base-glsp-tool.d.ts +20 -0
- package/lib/features/tools/base-glsp-tool.d.ts.map +1 -0
- package/lib/features/tools/base-glsp-tool.js +70 -0
- package/lib/features/tools/base-glsp-tool.js.map +1 -0
- package/lib/features/tools/change-bounds-tool.d.ts +71 -0
- package/lib/features/tools/change-bounds-tool.d.ts.map +1 -0
- package/lib/features/tools/change-bounds-tool.js +371 -0
- package/lib/features/tools/change-bounds-tool.js.map +1 -0
- package/lib/features/tools/delete-tool.d.ts +36 -0
- package/lib/features/tools/delete-tool.d.ts.map +1 -0
- package/lib/features/tools/delete-tool.js +129 -0
- package/lib/features/tools/delete-tool.js.map +1 -0
- package/lib/features/tools/di.config.d.ts +23 -0
- package/lib/features/tools/di.config.d.ts.map +1 -0
- package/lib/features/tools/di.config.js +55 -0
- package/lib/features/tools/di.config.js.map +1 -0
- package/lib/features/tools/edge-creation-tool.d.ts +37 -0
- package/lib/features/tools/edge-creation-tool.d.ts.map +1 -0
- package/lib/features/tools/edge-creation-tool.js +158 -0
- package/lib/features/tools/edge-creation-tool.js.map +1 -0
- package/lib/features/tools/edge-edit-tool.d.ts +50 -0
- package/lib/features/tools/edge-edit-tool.d.ts.map +1 -0
- package/lib/features/tools/edge-edit-tool.js +281 -0
- package/lib/features/tools/edge-edit-tool.js.map +1 -0
- package/lib/features/tools/marquee-mouse-tool.d.ts +37 -0
- package/lib/features/tools/marquee-mouse-tool.d.ts.map +1 -0
- package/lib/features/tools/marquee-mouse-tool.js +226 -0
- package/lib/features/tools/marquee-mouse-tool.js.map +1 -0
- package/lib/features/tools/marquee-tool.d.ts +14 -0
- package/lib/features/tools/marquee-tool.d.ts.map +1 -0
- package/lib/features/tools/marquee-tool.js +69 -0
- package/lib/features/tools/marquee-tool.js.map +1 -0
- package/lib/features/tools/model.d.ts +22 -0
- package/lib/features/tools/model.d.ts.map +1 -0
- package/lib/features/tools/model.js +24 -0
- package/lib/features/tools/model.js.map +1 -0
- package/lib/features/tools/node-creation-tool.d.ts +26 -0
- package/lib/features/tools/node-creation-tool.d.ts.map +1 -0
- package/lib/features/tools/node-creation-tool.js +117 -0
- package/lib/features/tools/node-creation-tool.js.map +1 -0
- package/lib/features/tools/view.d.ts +7 -0
- package/lib/features/tools/view.d.ts.map +1 -0
- package/lib/features/tools/view.js +40 -0
- package/lib/features/tools/view.js.map +1 -0
- package/lib/features/undo-redo/model.d.ts +27 -0
- package/lib/features/undo-redo/model.d.ts.map +1 -0
- package/lib/features/undo-redo/model.js +18 -0
- package/lib/features/undo-redo/model.js.map +1 -0
- package/lib/features/validation/di.config.d.ts +25 -0
- package/lib/features/validation/di.config.d.ts.map +1 -0
- package/lib/features/validation/di.config.js +44 -0
- package/lib/features/validation/di.config.js.map +1 -0
- package/lib/features/validation/issue-marker.d.ts +43 -0
- package/lib/features/validation/issue-marker.d.ts.map +1 -0
- package/lib/features/validation/issue-marker.js +89 -0
- package/lib/features/validation/issue-marker.js.map +1 -0
- package/lib/features/validation/marker-navigator.d.ts +55 -0
- package/lib/features/validation/marker-navigator.d.ts.map +1 -0
- package/lib/features/validation/marker-navigator.js +247 -0
- package/lib/features/validation/marker-navigator.js.map +1 -0
- package/lib/features/validation/marker-navigator.spec.d.ts +18 -0
- package/lib/features/validation/marker-navigator.spec.d.ts.map +1 -0
- package/lib/features/validation/marker-navigator.spec.js +177 -0
- package/lib/features/validation/marker-navigator.spec.js.map +1 -0
- package/lib/features/validation/validate.d.ts +111 -0
- package/lib/features/validation/validate.d.ts.map +1 -0
- package/lib/features/validation/validate.js +290 -0
- package/lib/features/validation/validate.js.map +1 -0
- package/lib/features/viewport/di.config.d.ts +19 -0
- package/lib/features/viewport/di.config.d.ts.map +1 -0
- package/lib/features/viewport/di.config.js +34 -0
- package/lib/features/viewport/di.config.js.map +1 -0
- package/lib/features/viewport/glsp-scroll-mouse-listener.d.ts +7 -0
- package/lib/features/viewport/glsp-scroll-mouse-listener.d.ts.map +1 -0
- package/lib/features/viewport/glsp-scroll-mouse-listener.js +54 -0
- package/lib/features/viewport/glsp-scroll-mouse-listener.js.map +1 -0
- package/lib/index.d.ts +110 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +144 -0
- package/lib/index.js.map +1 -0
- package/lib/lib/model.d.ts +24 -0
- package/lib/lib/model.d.ts.map +1 -0
- package/lib/lib/model.js +33 -0
- package/lib/lib/model.js.map +1 -0
- package/lib/model-source/glsp-diagram-server.d.ts +38 -0
- package/lib/model-source/glsp-diagram-server.d.ts.map +1 -0
- package/lib/model-source/glsp-diagram-server.js +88 -0
- package/lib/model-source/glsp-diagram-server.js.map +1 -0
- package/lib/model-source/glsp-server-status.d.ts +30 -0
- package/lib/model-source/glsp-server-status.d.ts.map +1 -0
- package/lib/model-source/glsp-server-status.js +44 -0
- package/lib/model-source/glsp-server-status.js.map +1 -0
- package/lib/utils/argument-utils.d.ts +50 -0
- package/lib/utils/argument-utils.d.ts.map +1 -0
- package/lib/utils/argument-utils.js +112 -0
- package/lib/utils/argument-utils.js.map +1 -0
- package/lib/utils/array-utils.d.ts +28 -0
- package/lib/utils/array-utils.d.ts.map +1 -0
- package/lib/utils/array-utils.js +56 -0
- package/lib/utils/array-utils.js.map +1 -0
- package/lib/utils/html-utils.d.ts +17 -0
- package/lib/utils/html-utils.d.ts.map +1 -0
- package/lib/utils/html-utils.js +30 -0
- package/lib/utils/html-utils.js.map +1 -0
- package/lib/utils/layout-utils.d.ts +41 -0
- package/lib/utils/layout-utils.d.ts.map +1 -0
- package/lib/utils/layout-utils.js +61 -0
- package/lib/utils/layout-utils.js.map +1 -0
- package/lib/utils/marker.d.ts +48 -0
- package/lib/utils/marker.d.ts.map +1 -0
- package/lib/utils/marker.js +48 -0
- package/lib/utils/marker.js.map +1 -0
- package/lib/utils/smodel-util.d.ts +41 -0
- package/lib/utils/smodel-util.d.ts.map +1 -0
- package/lib/utils/smodel-util.js +134 -0
- package/lib/utils/smodel-util.js.map +1 -0
- package/lib/utils/viewpoint-util.d.ts +52 -0
- package/lib/utils/viewpoint-util.d.ts.map +1 -0
- package/lib/utils/viewpoint-util.js +89 -0
- package/lib/utils/viewpoint-util.js.map +1 -0
- package/lib/views/base-view-module.d.ts +24 -0
- package/lib/views/base-view-module.d.ts.map +1 -0
- package/lib/views/base-view-module.js +59 -0
- package/lib/views/base-view-module.js.map +1 -0
- package/lib/views/default-types.d.ts +37 -0
- package/lib/views/default-types.d.ts.map +1 -0
- package/lib/views/default-types.js +47 -0
- package/lib/views/default-types.js.map +1 -0
- package/lib/views/glsp-edge-view.d.ts +11 -0
- package/lib/views/glsp-edge-view.d.ts.map +1 -0
- package/lib/views/glsp-edge-view.js +70 -0
- package/lib/views/glsp-edge-view.js.map +1 -0
- package/lib/views/index.d.ts +22 -0
- package/lib/views/index.d.ts.map +1 -0
- package/lib/views/index.js +34 -0
- package/lib/views/index.js.map +1 -0
- package/lib/views/issue-marker-view.d.ts +8 -0
- package/lib/views/issue-marker-view.d.ts.map +1 -0
- package/lib/views/issue-marker-view.js +59 -0
- package/lib/views/issue-marker-view.js.map +1 -0
- package/lib/views/rounded-corner-view.d.ts +13 -0
- package/lib/views/rounded-corner-view.d.ts.map +1 -0
- package/lib/views/rounded-corner-view.js +82 -0
- package/lib/views/rounded-corner-view.js.map +1 -0
- package/lib/views/rounded-corner.d.ts +37 -0
- package/lib/views/rounded-corner.d.ts.map +1 -0
- package/lib/views/rounded-corner.js +62 -0
- package/lib/views/rounded-corner.js.map +1 -0
- package/package.json +68 -0
- package/src/base/action-dispatcher.ts +103 -0
- package/src/base/actions/context-actions.ts +43 -0
- package/src/base/actions/edit-mode-action.ts +33 -0
- package/src/base/actions/edit-validation-actions.ts +103 -0
- package/src/base/actions/focus-change-action.ts +26 -0
- package/src/base/args.ts +26 -0
- package/src/base/auto-complete/auto-complete-actions.ts +24 -0
- package/src/base/auto-complete/auto-complete-widget.ts +314 -0
- package/src/base/auto-complete/validation-decorator.ts +126 -0
- package/src/base/command-stack.ts +36 -0
- package/src/base/di.config.ts +96 -0
- package/src/base/drag-aware-mouse-listener.ts +69 -0
- package/src/base/editor-context.ts +124 -0
- package/src/base/focus-tracker.ts +50 -0
- package/src/base/model/model-registry.ts +31 -0
- package/src/base/model/update-model-command.ts +118 -0
- package/src/base/model-initialization-constraint.ts +94 -0
- package/src/base/operations/operation.ts +178 -0
- package/src/base/selection-clearing-mouse-listener.ts +43 -0
- package/src/base/source-uri-aware.ts +22 -0
- package/src/base/tool-manager/glsp-tool-manager.ts +97 -0
- package/src/base/types.ts +37 -0
- package/src/base/view/view-registry.ts +31 -0
- package/src/features/change-bounds/model.ts +74 -0
- package/src/features/change-bounds/movement-restrictor.ts +89 -0
- package/src/features/change-bounds/snap.ts +35 -0
- package/src/features/command-palette/command-palette-tool.ts +46 -0
- package/src/features/command-palette/di.config.ts +34 -0
- package/src/features/command-palette/server-command-palette-provider.ts +48 -0
- package/src/features/context-menu/delete-element-context-menu.ts +42 -0
- package/src/features/context-menu/di.config.ts +35 -0
- package/src/features/context-menu/selection-service-aware-context-menu-mouse-listener.ts +50 -0
- package/src/features/context-menu/server-context-menu-provider.ts +46 -0
- package/src/features/copy-paste/copy-paste-actions.ts +60 -0
- package/src/features/copy-paste/copy-paste-context-menu.ts +138 -0
- package/src/features/copy-paste/copy-paste-handler.ts +152 -0
- package/src/features/copy-paste/di.config.ts +45 -0
- package/src/features/decoration/decoration-placer.ts +46 -0
- package/src/features/decoration/di.config.ts +28 -0
- package/src/features/edit-label/di.config.ts +30 -0
- package/src/features/edit-label/edit-label-tool.ts +51 -0
- package/src/features/edit-label/edit-label-validator.ts +104 -0
- package/src/features/hints/di.config.ts +30 -0
- package/src/features/hints/model.ts +34 -0
- package/src/features/hints/request-type-hints-action.ts +36 -0
- package/src/features/hints/type-hints.ts +257 -0
- package/src/features/hover/di.config.ts +61 -0
- package/src/features/hover/hover.ts +95 -0
- package/src/features/layout/di.config.ts +26 -0
- package/src/features/layout/layout-commands.spec.ts +366 -0
- package/src/features/layout/layout-commands.ts +415 -0
- package/src/features/model-source-watcher/di.config.ts +26 -0
- package/src/features/model-source-watcher/model-source-changed-action-handler.ts +70 -0
- package/src/features/model-source-watcher/model-source-changed-action.ts +26 -0
- package/src/features/mouse-tool/di.config.ts +28 -0
- package/src/features/mouse-tool/mouse-tool.ts +139 -0
- package/src/features/navigation/di.config.ts +35 -0
- package/src/features/navigation/navigation-action-handler.ts +272 -0
- package/src/features/navigation/navigation-target-resolver.spec.ts +61 -0
- package/src/features/navigation/navigation-target-resolver.ts +146 -0
- package/src/features/rank/model.ts +29 -0
- package/src/features/reconnect/model.ts +76 -0
- package/src/features/save/di.config.ts +30 -0
- package/src/features/save/model.ts +26 -0
- package/src/features/save/save.ts +35 -0
- package/src/features/select/di.config.ts +35 -0
- package/src/features/select/select-feedback-action.ts +87 -0
- package/src/features/select/select-mouse-listener.ts +26 -0
- package/src/features/select/selection-service.spec.ts +372 -0
- package/src/features/select/selection-service.ts +239 -0
- package/src/features/tool-feedback/change-bounds-tool-feedback.ts +244 -0
- package/src/features/tool-feedback/creation-tool-feedback.ts +190 -0
- package/src/features/tool-feedback/css-feedback.ts +98 -0
- package/src/features/tool-feedback/di.config.ts +69 -0
- package/src/features/tool-feedback/edge-edit-tool-feedback.ts +327 -0
- package/src/features/tool-feedback/feedback-action-dispatcher.ts +101 -0
- package/src/features/tool-feedback/marquee-tool-feedback.ts +104 -0
- package/src/features/tool-feedback/model.ts +32 -0
- package/src/features/tool-feedback/view.tsx +70 -0
- package/src/features/tool-palette/di.config.ts +30 -0
- package/src/features/tool-palette/palette-item.ts +40 -0
- package/src/features/tool-palette/tool-palette.ts +416 -0
- package/src/features/tools/base-glsp-tool.ts +53 -0
- package/src/features/tools/change-bounds-tool.ts +445 -0
- package/src/features/tools/delete-tool.ts +120 -0
- package/src/features/tools/di.config.ts +56 -0
- package/src/features/tools/edge-creation-tool.ts +171 -0
- package/src/features/tools/edge-edit-tool.ts +325 -0
- package/src/features/tools/marquee-mouse-tool.ts +244 -0
- package/src/features/tools/marquee-tool.ts +52 -0
- package/src/features/tools/model.ts +22 -0
- package/src/features/tools/node-creation-tool.ts +123 -0
- package/src/features/tools/view.tsx +38 -0
- package/src/features/undo-redo/model.ts +26 -0
- package/src/features/validation/di.config.ts +51 -0
- package/src/features/validation/issue-marker.ts +93 -0
- package/src/features/validation/marker-navigator.spec.ts +207 -0
- package/src/features/validation/marker-navigator.ts +249 -0
- package/src/features/validation/validate.ts +274 -0
- package/src/features/viewport/di.config.ts +47 -0
- package/src/features/viewport/glsp-scroll-mouse-listener.ts +50 -0
- package/src/index.ts +115 -0
- package/src/lib/model.ts +27 -0
- package/src/model-source/glsp-diagram-server.ts +114 -0
- package/src/model-source/glsp-server-status.ts +38 -0
- package/src/utils/argument-utils.ts +127 -0
- package/src/utils/array-utils.ts +55 -0
- package/src/utils/html-utils.ts +25 -0
- package/src/utils/layout-utils.ts +97 -0
- package/src/utils/marker.ts +63 -0
- package/src/utils/smodel-util.ts +149 -0
- package/src/utils/viewpoint-util.ts +99 -0
- package/src/views/base-view-module.ts +98 -0
- package/src/views/default-types.ts +48 -0
- package/src/views/glsp-edge-view.tsx +70 -0
- package/src/views/index.ts +21 -0
- package/src/views/issue-marker-view.tsx +55 -0
- package/src/views/rounded-corner-view.tsx +88 -0
- package/src/views/rounded-corner.ts +88 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2021 EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
*
|
|
8
|
+
* This Source Code may also be made available under the following Secondary
|
|
9
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
* with the GNU Classpath Exception which is available at
|
|
12
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
*
|
|
14
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
+
********************************************************************************/
|
|
16
|
+
export * from './base-view-module';
|
|
17
|
+
export * from './default-types';
|
|
18
|
+
export * from './glsp-edge-view';
|
|
19
|
+
export * from './issue-marker-view';
|
|
20
|
+
export * from './rounded-corner';
|
|
21
|
+
export * from './rounded-corner-view';
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/views/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
/********************************************************************************
|
|
14
|
+
* Copyright (c) 2021 EclipseSource and others.
|
|
15
|
+
*
|
|
16
|
+
* This program and the accompanying materials are made available under the
|
|
17
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
18
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
19
|
+
*
|
|
20
|
+
* This Source Code may also be made available under the following Secondary
|
|
21
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
22
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
23
|
+
* with the GNU Classpath Exception which is available at
|
|
24
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
25
|
+
*
|
|
26
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
27
|
+
********************************************************************************/
|
|
28
|
+
__exportStar(require("./base-view-module"), exports);
|
|
29
|
+
__exportStar(require("./default-types"), exports);
|
|
30
|
+
__exportStar(require("./glsp-edge-view"), exports);
|
|
31
|
+
__exportStar(require("./issue-marker-view"), exports);
|
|
32
|
+
__exportStar(require("./rounded-corner"), exports);
|
|
33
|
+
__exportStar(require("./rounded-corner-view"), exports);
|
|
34
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/views/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,qDAAmC;AACnC,kDAAgC;AAChC,mDAAiC;AACjC,sDAAoC;AACpC,mDAAiC;AACjC,wDAAsC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { VNode } from 'snabbdom';
|
|
2
|
+
import { IssueMarkerView, RenderingContext, SIssueMarker, SIssueSeverity } from 'sprotty';
|
|
3
|
+
export declare class GIssueMarkerView extends IssueMarkerView {
|
|
4
|
+
render(marker: SIssueMarker, _context: RenderingContext): VNode;
|
|
5
|
+
protected get radius(): number;
|
|
6
|
+
protected getGlspIssueMarkerPath(severity: SIssueSeverity): string;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=issue-marker-view.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"issue-marker-view.d.ts","sourceRoot":"","sources":["../../src/views/issue-marker-view.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAY,YAAY,EAAE,cAAc,EAAO,MAAM,SAAS,CAAC;AAKzG,qBACa,gBAAiB,SAAQ,eAAe;IAEjD,MAAM,CAAC,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,gBAAgB,GAAG,KAAK;IAY/D,SAAS,KAAK,MAAM,IAAI,MAAM,CAE7B;IAED,SAAS,CAAC,sBAAsB,CAAC,QAAQ,EAAE,cAAc,GAAG,MAAM;CAYrE"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.GIssueMarkerView = void 0;
|
|
10
|
+
/********************************************************************************
|
|
11
|
+
* Copyright (c) 2020 EclipseSource and others.
|
|
12
|
+
*
|
|
13
|
+
* This program and the accompanying materials are made available under the
|
|
14
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
15
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
16
|
+
*
|
|
17
|
+
* This Source Code may also be made available under the following Secondary
|
|
18
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
19
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
20
|
+
* with the GNU Classpath Exception which is available at
|
|
21
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
22
|
+
*
|
|
23
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
24
|
+
********************************************************************************/
|
|
25
|
+
/* eslint-disable max-len */
|
|
26
|
+
const inversify_1 = require("inversify");
|
|
27
|
+
const sprotty_1 = require("sprotty");
|
|
28
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
29
|
+
const JSX = { createElement: sprotty_1.svg };
|
|
30
|
+
let GIssueMarkerView = class GIssueMarkerView extends sprotty_1.IssueMarkerView {
|
|
31
|
+
render(marker, _context) {
|
|
32
|
+
const maxSeverity = super.getMaxSeverity(marker);
|
|
33
|
+
const group = JSX.createElement("g", { "class-sprotty-issue": true },
|
|
34
|
+
JSX.createElement("g", null,
|
|
35
|
+
JSX.createElement("circle", { "class-sprotty-issue-background": true, r: this.radius, cx: this.radius, cy: this.radius }),
|
|
36
|
+
JSX.createElement("path", { d: this.getGlspIssueMarkerPath(maxSeverity) })));
|
|
37
|
+
sprotty_1.setClass(group, 'sprotty-' + maxSeverity, true);
|
|
38
|
+
return group;
|
|
39
|
+
}
|
|
40
|
+
get radius() {
|
|
41
|
+
return 8; // var(--theia-icon-size)=16px => 16/2=8
|
|
42
|
+
}
|
|
43
|
+
getGlspIssueMarkerPath(severity) {
|
|
44
|
+
switch (severity) {
|
|
45
|
+
// paths used here are svg versions of FontAwesome icons, resized to var(--theia-icon-size) 16px
|
|
46
|
+
case 'error': // 'fa-times-circle'
|
|
47
|
+
return 'M 8,0 C 3.5806452,0 0,3.58065 0,8 c 0,4.41935 3.5806452,8 8,8 4.419355,0 8,-3.58065 8,-8 C 16,3.58065 12.419355,0 8,0 Z m 3.922581,10.1 c 0.151613,0.15161 0.151613,0.39677 0,0.54839 l -1.27742,1.27419 c -0.151613,0.15161 -0.396774,0.15161 -0.548387,0 L 8,9.80645 5.9,11.92258 c -0.1516129,0.15161 -0.3967742,0.15161 -0.5483871,0 L 4.0774194,10.64516 c -0.1516129,-0.15161 -0.1516129,-0.39677 0,-0.54839 L 6.1935484,8 4.0774194,5.9 c -0.1516129,-0.15161 -0.1516129,-0.39677 0,-0.54839 L 5.3548387,4.07419 c 0.1516129,-0.15161 0.3967742,-0.15161 0.5483871,0 L 8,6.19355 10.1,4.07742 c 0.151613,-0.15161 0.396774,-0.15161 0.548387,0 l 1.277419,1.27742 c 0.151613,0.15161 0.151613,0.39677 0,0.54839 L 9.8064516,8 Z';
|
|
48
|
+
case 'warning': // 'fa-exclamation-circle'
|
|
49
|
+
return 'm 16,8 c 0,4.41926 -3.582032,8 -8,8 C 3.5820323,16 0,12.41926 0,8 0,3.58332 3.5820323,0 8,0 c 4.417968,0 8,3.58332 8,8 z M 8,9.6129 c -0.8195161,0 -1.483871,0.66436 -1.483871,1.48387 0,0.81952 0.6643549,1.48388 1.483871,1.48388 0.8195161,0 1.483871,-0.66436 1.483871,-1.48388 C 9.483871,10.27726 8.8195161,9.6129 8,9.6129 Z M 6.5911935,4.27916 6.8304839,8.66626 c 0.011194,0.20529 0.1809355,0.366 0.3865161,0.366 h 1.566 c 0.2055806,0 0.3753226,-0.16071 0.3865161,-0.366 L 9.4088065,4.27916 C 9.4209035,4.05742 9.2443548,3.87097 9.0222903,3.87097 H 6.9776774 c -0.2220645,0 -0.3985806,0.18645 -0.3864839,0.40819 z';
|
|
50
|
+
case 'info': // 'fa-info-circle information'
|
|
51
|
+
return 'M 8.0000004,0 C 3.5820324,0 0,3.58332 0,8 0,12.41926 3.5820324,16 8.0000004,16 12.417968,16 16,12.41926 16,8 16,3.58332 12.417968,0 8.0000004,0 Z m 0,3.54839 c 0.748258,0 1.354839,0.60658 1.354839,1.35484 0,0.74825 -0.606581,1.35483 -1.354839,1.35483 -0.748258,0 -1.354839,-0.60658 -1.354839,-1.35483 0,-0.74826 0.606581,-1.35484 1.354839,-1.35484 z m 1.806452,8.19355 c 0,0.21377 -0.173323,0.38709 -0.387097,0.38709 h -2.83871 c -0.213774,0 -0.387097,-0.17332 -0.387097,-0.38709 v -0.7742 c 0,-0.21377 0.173323,-0.38709 0.387097,-0.38709 h 0.387097 V 8.51613 h -0.387097 c -0.213774,0 -0.387097,-0.17332 -0.387097,-0.3871 V 7.35484 c 0,-0.21378 0.173323,-0.3871 0.387097,-0.3871 h 2.064516 c 0.213774,0 0.387097,0.17332 0.387097,0.3871 v 3.22581 h 0.387097 c 0.213774,0 0.387097,0.17332 0.387097,0.38709 z';
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
GIssueMarkerView = __decorate([
|
|
56
|
+
inversify_1.injectable()
|
|
57
|
+
], GIssueMarkerView);
|
|
58
|
+
exports.GIssueMarkerView = GIssueMarkerView;
|
|
59
|
+
//# sourceMappingURL=issue-marker-view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"issue-marker-view.js","sourceRoot":"","sources":["../../src/views/issue-marker-view.tsx"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,4BAA4B;AAC5B,yCAAuC;AAEvC,qCAAyG;AAEzG,6DAA6D;AAC7D,MAAM,GAAG,GAAG,EAAE,aAAa,EAAE,aAAG,EAAE,CAAC;AAGnC,IAAa,gBAAgB,GAA7B,MAAa,gBAAiB,SAAQ,yBAAe;IAEjD,MAAM,CAAC,MAAoB,EAAE,QAA0B;QACnD,MAAM,WAAW,GAAG,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;QACjD,MAAM,KAAK,GAAG,gDAAwB,IAAI;YACtC;gBACI,gEAAwC,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,MAAM,EAAE,EAAE,EAAE,IAAI,CAAC,MAAM,EAAE,EAAE,EAAE,IAAI,CAAC,MAAM,GAAI;gBAClG,4BAAM,CAAC,EAAE,IAAI,CAAC,sBAAsB,CAAC,WAAW,CAAC,GAAI,CACrD,CACJ,CAAC;QACL,kBAAQ,CAAC,KAAK,EAAE,UAAU,GAAG,WAAW,EAAE,IAAI,CAAC,CAAC;QAChD,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,IAAc,MAAM;QAChB,OAAO,CAAC,CAAC,CAAC,wCAAwC;IACtD,CAAC;IAES,sBAAsB,CAAC,QAAwB;QACrD,QAAQ,QAAQ,EAAE;YACd,gGAAgG;YAChG,KAAK,OAAO,EAAE,oBAAoB;gBAC9B,OAAO,wsBAAwsB,CAAC;YACptB,KAAK,SAAS,EAAE,0BAA0B;gBACtC,OAAO,umBAAumB,CAAC;YACnnB,KAAK,MAAM,EAAE,+BAA+B;gBACxC,OAAO,wyBAAwyB,CAAC;SACvzB;IACL,CAAC;CAEJ,CAAA;AA9BY,gBAAgB;IAD5B,sBAAU,EAAE;GACA,gBAAgB,CA8B5B;AA9BY,4CAAgB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Classes, VNode } from 'snabbdom';
|
|
2
|
+
import { Hoverable, RectangularNodeView, RenderingContext, Selectable, SShapeElement } from 'sprotty';
|
|
3
|
+
import { RoundedCornerWrapper } from './rounded-corner';
|
|
4
|
+
export declare class RoundedCornerNodeView extends RectangularNodeView {
|
|
5
|
+
render(node: Readonly<SShapeElement & Hoverable & Selectable>, context: RenderingContext): VNode | undefined;
|
|
6
|
+
protected renderWithoutRadius(node: Readonly<SShapeElement & Hoverable & Selectable>, context: RenderingContext): VNode | undefined;
|
|
7
|
+
protected getClipPathInsets(): number | undefined;
|
|
8
|
+
protected renderPathNode(wrapper: Readonly<RoundedCornerWrapper>, context: RenderingContext): VNode;
|
|
9
|
+
protected additionalClasses(_node: Readonly<SShapeElement & Hoverable & Selectable>, _context: RenderingContext): Classes;
|
|
10
|
+
protected renderPath(wrapper: Readonly<RoundedCornerWrapper>, _context: RenderingContext, inset: number): string;
|
|
11
|
+
}
|
|
12
|
+
export declare function toClipPathId(node: Readonly<SShapeElement & Hoverable & Selectable>): string;
|
|
13
|
+
//# sourceMappingURL=rounded-corner-view.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rounded-corner-view.d.ts","sourceRoot":"","sources":["../../src/views/rounded-corner-view.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,UAAU,EAAgB,aAAa,EAAO,MAAM,SAAS,CAAC;AAGzH,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAKxD,qBACa,qBAAsB,SAAQ,mBAAmB;IAC1D,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,aAAa,GAAG,SAAS,GAAG,UAAU,CAAC,EAAE,OAAO,EAAE,gBAAgB,GAAG,KAAK,GAAG,SAAS;IAkB5G,SAAS,CAAC,mBAAmB,CAAC,IAAI,EAAE,QAAQ,CAAC,aAAa,GAAG,SAAS,GAAG,UAAU,CAAC,EAAE,OAAO,EAAE,gBAAgB,GAAG,KAAK,GAAG,SAAS;IAInI,SAAS,CAAC,iBAAiB,IAAI,MAAM,GAAG,SAAS;IAIjD,SAAS,CAAC,cAAc,CAAC,OAAO,EAAE,QAAQ,CAAC,oBAAoB,CAAC,EAAE,OAAO,EAAE,gBAAgB,GAAG,KAAK;IASnG,SAAS,CAAC,iBAAiB,CAAC,KAAK,EAAE,QAAQ,CAAC,aAAa,GAAG,SAAS,GAAG,UAAU,CAAC,EAAE,QAAQ,EAAE,gBAAgB,GAAG,OAAO;IAIzH,SAAS,CAAC,UAAU,CAAC,OAAO,EAAE,QAAQ,CAAC,oBAAoB,CAAC,EAAE,QAAQ,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM;CAiBnH;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,QAAQ,CAAC,aAAa,GAAG,SAAS,GAAG,UAAU,CAAC,GAAG,MAAM,CAE3F"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.toClipPathId = exports.RoundedCornerNodeView = void 0;
|
|
10
|
+
/********************************************************************************
|
|
11
|
+
* Copyright (c) 2021 EclipseSource and others.
|
|
12
|
+
*
|
|
13
|
+
* This program and the accompanying materials are made available under the
|
|
14
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
15
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
16
|
+
*
|
|
17
|
+
* This Source Code may also be made available under the following Secondary
|
|
18
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
19
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
20
|
+
* with the GNU Classpath Exception which is available at
|
|
21
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
22
|
+
*
|
|
23
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
24
|
+
********************************************************************************/
|
|
25
|
+
const inversify_1 = require("inversify");
|
|
26
|
+
const sprotty_1 = require("sprotty");
|
|
27
|
+
const argument_utils_1 = require("../utils/argument-utils");
|
|
28
|
+
const rounded_corner_1 = require("./rounded-corner");
|
|
29
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
30
|
+
const JSX = { createElement: sprotty_1.svg };
|
|
31
|
+
let RoundedCornerNodeView = class RoundedCornerNodeView extends sprotty_1.RectangularNodeView {
|
|
32
|
+
render(node, context) {
|
|
33
|
+
const cornerRadius = argument_utils_1.CornerRadius.from(node);
|
|
34
|
+
if (!cornerRadius) {
|
|
35
|
+
return this.renderWithoutRadius(node, context);
|
|
36
|
+
}
|
|
37
|
+
const wrapper = new rounded_corner_1.RoundedCornerWrapper(node, cornerRadius);
|
|
38
|
+
return JSX.createElement("g", { "class-node": true },
|
|
39
|
+
JSX.createElement("defs", null,
|
|
40
|
+
JSX.createElement("clipPath", { id: toClipPathId(node) },
|
|
41
|
+
JSX.createElement("path", { d: this.renderPath(wrapper, context, this.getClipPathInsets() || 0) }))),
|
|
42
|
+
this.renderPathNode(wrapper, context),
|
|
43
|
+
context.renderChildren(node));
|
|
44
|
+
}
|
|
45
|
+
renderWithoutRadius(node, context) {
|
|
46
|
+
return super.render(node, context);
|
|
47
|
+
}
|
|
48
|
+
getClipPathInsets() {
|
|
49
|
+
return 2;
|
|
50
|
+
}
|
|
51
|
+
renderPathNode(wrapper, context) {
|
|
52
|
+
return JSX.createElement("path", Object.assign({ d: this.renderPath(wrapper, context, 0), "class-sprotty-node": wrapper.element instanceof sprotty_1.SNode, "class-sprotty-port": wrapper.element instanceof sprotty_1.SPort, "class-mouseover": wrapper.element.hoverFeedback, "class-selected": wrapper.element.selected }, this.additionalClasses(wrapper.element, context)));
|
|
53
|
+
}
|
|
54
|
+
additionalClasses(_node, _context) {
|
|
55
|
+
return {};
|
|
56
|
+
}
|
|
57
|
+
renderPath(wrapper, _context, inset) {
|
|
58
|
+
// Calcualte length of straight line segments
|
|
59
|
+
const topLineLength = Math.max(0, wrapper.size.width - wrapper.cornerRadius.topLeft - wrapper.cornerRadius.topRight);
|
|
60
|
+
const rightLineLength = Math.max(0, wrapper.size.height - wrapper.cornerRadius.topRight - wrapper.cornerRadius.bottomRight);
|
|
61
|
+
const bottomLineLength = Math.max(0, wrapper.size.width - wrapper.cornerRadius.bottomLeft - wrapper.cornerRadius.bottomRight);
|
|
62
|
+
const path = `M${0 + inset},${0 + wrapper.topLeftCorner.radiusY}` +
|
|
63
|
+
`q${0},${-(wrapper.topLeftCorner.radiusY - inset)} ${wrapper.topLeftCorner.radiusX - inset},${-(wrapper.topLeftCorner.radiusY - inset)}` +
|
|
64
|
+
`h${topLineLength}` +
|
|
65
|
+
`q${wrapper.topRightCorner.radiusX - inset},0 ${wrapper.topRightCorner.radiusX - inset},${wrapper.topRightCorner.radiusY - inset}` +
|
|
66
|
+
`v${rightLineLength}` +
|
|
67
|
+
`q0,${wrapper.bottomRightCorner.radiusY - inset} ${-(wrapper.bottomRightCorner.radiusX - inset)},${wrapper.bottomRightCorner.radiusY - inset}` +
|
|
68
|
+
`h${-bottomLineLength}` +
|
|
69
|
+
`q${-(wrapper.bottomLeftCorner.radiusX - inset)},0 ${-(wrapper.bottomLeftCorner.radiusX - inset)},${-(wrapper.bottomLeftCorner.radiusY - inset)}` +
|
|
70
|
+
'z ';
|
|
71
|
+
return path;
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
RoundedCornerNodeView = __decorate([
|
|
75
|
+
inversify_1.injectable()
|
|
76
|
+
], RoundedCornerNodeView);
|
|
77
|
+
exports.RoundedCornerNodeView = RoundedCornerNodeView;
|
|
78
|
+
function toClipPathId(node) {
|
|
79
|
+
return `${node.id}_clip_path`;
|
|
80
|
+
}
|
|
81
|
+
exports.toClipPathId = toClipPathId;
|
|
82
|
+
//# sourceMappingURL=rounded-corner-view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rounded-corner-view.js","sourceRoot":"","sources":["../../src/views/rounded-corner-view.tsx"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,yCAAuC;AAEvC,qCAAyH;AAEzH,4DAAuD;AACvD,qDAAwD;AAExD,6DAA6D;AAC7D,MAAM,GAAG,GAAG,EAAE,aAAa,EAAE,aAAG,EAAE,CAAC;AAGnC,IAAa,qBAAqB,GAAlC,MAAa,qBAAsB,SAAQ,6BAAmB;IAC1D,MAAM,CAAC,IAAsD,EAAE,OAAyB;QACpF,MAAM,YAAY,GAAG,6BAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC7C,IAAI,CAAC,YAAY,EAAE;YACf,OAAO,IAAI,CAAC,mBAAmB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;SAClD;QAED,MAAM,OAAO,GAAG,IAAI,qCAAoB,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;QAC7D,OAAO,uCAAe,IAAI;YACtB;gBACI,gCAAU,EAAE,EAAE,YAAY,CAAC,IAAI,CAAC;oBAC5B,4BAAM,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,iBAAiB,EAAE,IAAI,CAAC,CAAC,GAAS,CAC3E,CACR;YACN,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC;YACrC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,CAC7B,CAAC;IACT,CAAC;IAES,mBAAmB,CAAC,IAAsD,EAAE,OAAyB;QAC3G,OAAO,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACvC,CAAC;IAES,iBAAiB;QACvB,OAAO,CAAC,CAAC;IACb,CAAC;IAES,cAAc,CAAC,OAAuC,EAAE,OAAyB;QACvF,OAAO,0CAAM,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC,wBAC5B,OAAO,CAAC,OAAO,YAAY,eAAK,wBAChC,OAAO,CAAC,OAAO,YAAY,eAAK,qBACnC,OAAO,CAAC,OAAO,CAAC,aAAa,oBAC9B,OAAO,CAAC,OAAO,CAAC,QAAQ,IACpC,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,EAAI,CAAC;IACjE,CAAC;IAES,iBAAiB,CAAC,KAAuD,EAAE,QAA0B;QAC3G,OAAO,EAAE,CAAC;IACd,CAAC;IAES,UAAU,CAAC,OAAuC,EAAE,QAA0B,EAAE,KAAa;QACnG,6CAA6C;QAC7C,MAAM,aAAa,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,YAAY,CAAC,OAAO,GAAG,OAAO,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;QACrH,MAAM,eAAe,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,QAAQ,GAAG,OAAO,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;QAC5H,MAAM,gBAAgB,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,YAAY,CAAC,UAAU,GAAG,OAAO,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;QAE9H,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,KAAK,IAAI,CAAC,GAAG,OAAO,CAAC,aAAa,CAAC,OAAO,EAAE;YAC7D,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,OAAO,GAAG,KAAK,CAAC,IAAI,OAAO,CAAC,aAAa,CAAC,OAAO,GAAG,KAAK,IAAI,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,OAAO,GAAG,KAAK,CAAC,EAAE;YACxI,IAAI,aAAa,EAAE;YACnB,IAAI,OAAO,CAAC,cAAc,CAAC,OAAO,GAAG,KAAK,MAAM,OAAO,CAAC,cAAc,CAAC,OAAO,GAAG,KAAK,IAAI,OAAO,CAAC,cAAc,CAAC,OAAO,GAAG,KAAK,EAAE;YAClI,IAAI,eAAe,EAAE;YACrB,MAAM,OAAO,CAAC,iBAAiB,CAAC,OAAO,GAAG,KAAK,IAAI,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC,OAAO,GAAG,KAAK,CAAC,IAAI,OAAO,CAAC,iBAAiB,CAAC,OAAO,GAAG,KAAK,EAAE;YAC9I,IAAI,CAAC,gBAAgB,EAAE;YACvB,IAAI,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC,OAAO,GAAG,KAAK,CAAC,EAAE;YACjJ,IAAI,CAAC;QACT,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ,CAAA;AAzDY,qBAAqB;IADjC,sBAAU,EAAE;GACA,qBAAqB,CAyDjC;AAzDY,sDAAqB;AA2DlC,SAAgB,YAAY,CAAC,IAAsD;IAC/E,OAAO,GAAG,IAAI,CAAC,EAAE,YAAY,CAAC;AAClC,CAAC;AAFD,oCAEC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2021 EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
*
|
|
8
|
+
* This Source Code may also be made available under the following Secondary
|
|
9
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
* with the GNU Classpath Exception which is available at
|
|
12
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
*
|
|
14
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
+
********************************************************************************/
|
|
16
|
+
import { Dimension, Hoverable, Selectable, SShapeElement } from 'sprotty/lib';
|
|
17
|
+
import { CornerRadius } from '../utils/argument-utils';
|
|
18
|
+
export interface RoundedCorner {
|
|
19
|
+
radiusX: number;
|
|
20
|
+
radiusY: number;
|
|
21
|
+
}
|
|
22
|
+
export declare class RoundedCornerWrapper {
|
|
23
|
+
readonly element: SShapeElement & Hoverable & Selectable;
|
|
24
|
+
readonly cornerRadius: CornerRadius;
|
|
25
|
+
protected _topLeftCorner: RoundedCorner;
|
|
26
|
+
protected _topRightCorner: RoundedCorner;
|
|
27
|
+
protected _bottomRightCorner: RoundedCorner;
|
|
28
|
+
protected _bottomLeftCorner: RoundedCorner;
|
|
29
|
+
constructor(element: SShapeElement & Hoverable & Selectable, cornerRadius: CornerRadius);
|
|
30
|
+
get size(): Dimension;
|
|
31
|
+
get topLeftCorner(): RoundedCorner;
|
|
32
|
+
get topRightCorner(): RoundedCorner;
|
|
33
|
+
get bottomRightCorner(): RoundedCorner;
|
|
34
|
+
get bottomLeftCorner(): RoundedCorner;
|
|
35
|
+
}
|
|
36
|
+
export declare function scaledRadius(radius: number, maximalLength: number): number;
|
|
37
|
+
//# sourceMappingURL=rounded-corner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rounded-corner.d.ts","sourceRoot":"","sources":["../../src/views/rounded-corner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE9E,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,MAAM,WAAW,aAAa;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACnB;AAED,qBAAa,oBAAoB;aAMD,OAAO,EAAE,aAAa,GAAG,SAAS,GAAG,UAAU;aAAkB,YAAY,EAAE,YAAY;IALvH,SAAS,CAAC,cAAc,EAAE,aAAa,CAAC;IACxC,SAAS,CAAC,eAAe,EAAE,aAAa,CAAC;IACzC,SAAS,CAAC,kBAAkB,EAAE,aAAa,CAAC;IAC5C,SAAS,CAAC,iBAAiB,EAAE,aAAa,CAAC;gBAEf,OAAO,EAAE,aAAa,GAAG,SAAS,GAAG,UAAU,EAAkB,YAAY,EAAE,YAAY;IAGvH,IAAI,IAAI,IAAI,SAAS,CAEpB;IAED,IAAI,aAAa,IAAI,aAAa,CAQjC;IAED,IAAI,cAAc,IAAI,aAAa,CAQlC;IAED,IAAI,iBAAiB,IAAI,aAAa,CAQrC;IAED,IAAI,gBAAgB,IAAI,aAAa,CAQpC;CACJ;AAKD,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,MAAM,CAM1E"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.scaledRadius = exports.RoundedCornerWrapper = void 0;
|
|
4
|
+
class RoundedCornerWrapper {
|
|
5
|
+
constructor(element, cornerRadius) {
|
|
6
|
+
this.element = element;
|
|
7
|
+
this.cornerRadius = cornerRadius;
|
|
8
|
+
}
|
|
9
|
+
get size() {
|
|
10
|
+
return this.element.size;
|
|
11
|
+
}
|
|
12
|
+
get topLeftCorner() {
|
|
13
|
+
if (!this._topLeftCorner) {
|
|
14
|
+
this._topLeftCorner = {
|
|
15
|
+
radiusX: scaledRadius(this.cornerRadius.topLeft, this.element.size.width / 2),
|
|
16
|
+
radiusY: scaledRadius(this.cornerRadius.topLeft, this.element.size.height / 2)
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
return this._topLeftCorner;
|
|
20
|
+
}
|
|
21
|
+
get topRightCorner() {
|
|
22
|
+
if (!this._topRightCorner) {
|
|
23
|
+
this._topRightCorner = {
|
|
24
|
+
radiusX: scaledRadius(this.cornerRadius.topRight, this.element.size.width / 2),
|
|
25
|
+
radiusY: scaledRadius(this.cornerRadius.topRight, this.element.size.height / 2)
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
return this._topRightCorner;
|
|
29
|
+
}
|
|
30
|
+
get bottomRightCorner() {
|
|
31
|
+
if (!this._bottomRightCorner) {
|
|
32
|
+
this._bottomRightCorner = {
|
|
33
|
+
radiusX: scaledRadius(this.cornerRadius.bottomRight, this.element.size.width / 2),
|
|
34
|
+
radiusY: scaledRadius(this.cornerRadius.bottomRight, this.element.size.height / 2)
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
return this._bottomRightCorner;
|
|
38
|
+
}
|
|
39
|
+
get bottomLeftCorner() {
|
|
40
|
+
if (!this._bottomLeftCorner) {
|
|
41
|
+
this._bottomLeftCorner = {
|
|
42
|
+
radiusX: scaledRadius(this.cornerRadius.bottomLeft, this.element.size.width / 2),
|
|
43
|
+
radiusY: scaledRadius(this.cornerRadius.bottomLeft, this.element.size.height / 2)
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
return this._bottomLeftCorner;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.RoundedCornerWrapper = RoundedCornerWrapper;
|
|
50
|
+
/*
|
|
51
|
+
* Scales the radius if necessary. (Percentual downscaling if the radius is bigger then the maximal allowed length)
|
|
52
|
+
*/
|
|
53
|
+
function scaledRadius(radius, maximalLength) {
|
|
54
|
+
if (radius <= maximalLength) {
|
|
55
|
+
return radius;
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
return radius * (maximalLength / radius);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
exports.scaledRadius = scaledRadius;
|
|
62
|
+
//# sourceMappingURL=rounded-corner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rounded-corner.js","sourceRoot":"","sources":["../../src/views/rounded-corner.ts"],"names":[],"mappings":";;;AAwBA,MAAa,oBAAoB;IAM7B,YAA4B,OAA+C,EAAkB,YAA0B;QAA3F,YAAO,GAAP,OAAO,CAAwC;QAAkB,iBAAY,GAAZ,YAAY,CAAc;IACvH,CAAC;IAED,IAAI,IAAI;QACJ,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;IAC7B,CAAC;IAED,IAAI,aAAa;QACb,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE;YACtB,IAAI,CAAC,cAAc,GAAG;gBAClB,OAAO,EAAE,YAAY,CAAC,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;gBAC7E,OAAO,EAAE,YAAY,CAAC,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;aACjF,CAAC;SACL;QACD,OAAO,IAAI,CAAC,cAAc,CAAC;IAC/B,CAAC;IAED,IAAI,cAAc;QACd,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE;YACvB,IAAI,CAAC,eAAe,GAAG;gBACnB,OAAO,EAAE,YAAY,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;gBAC9E,OAAO,EAAE,YAAY,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;aAClF,CAAC;SACL;QACD,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;IAED,IAAI,iBAAiB;QACjB,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE;YAC1B,IAAI,CAAC,kBAAkB,GAAG;gBACtB,OAAO,EAAE,YAAY,CAAC,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;gBACjF,OAAO,EAAE,YAAY,CAAC,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;aACrF,CAAC;SACL;QACD,OAAO,IAAI,CAAC,kBAAkB,CAAC;IACnC,CAAC;IAED,IAAI,gBAAgB;QAChB,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE;YACzB,IAAI,CAAC,iBAAiB,GAAG;gBACrB,OAAO,EAAE,YAAY,CAAC,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;gBAChF,OAAO,EAAE,YAAY,CAAC,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;aACpF,CAAC;SACL;QACD,OAAO,IAAI,CAAC,iBAAiB,CAAC;IAClC,CAAC;CACJ;AApDD,oDAoDC;AAED;;EAEE;AACF,SAAgB,YAAY,CAAC,MAAc,EAAE,aAAqB;IAC9D,IAAI,MAAM,IAAI,aAAa,EAAE;QACzB,OAAO,MAAM,CAAC;KACjB;SAAM;QACH,OAAO,MAAM,GAAG,CAAC,aAAa,GAAG,MAAM,CAAC,CAAC;KAC5C;AACL,CAAC;AAND,oCAMC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@eclipse-glsp/client",
|
|
3
|
+
"version": "0.9.0-next.c5944e10",
|
|
4
|
+
"description": "A sprotty-based client for GLSP",
|
|
5
|
+
"license": "(EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0)",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"eclipse",
|
|
8
|
+
"graphics",
|
|
9
|
+
"diagram",
|
|
10
|
+
"modeling",
|
|
11
|
+
"visualization",
|
|
12
|
+
"glsp",
|
|
13
|
+
"diagram editor"
|
|
14
|
+
],
|
|
15
|
+
"author": {
|
|
16
|
+
"name": "Eclipse GLSP"
|
|
17
|
+
},
|
|
18
|
+
"homepage": "https://www.eclipse.org/glsp/",
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "https://github.com/eclipse-glsp/glsp-client.git"
|
|
22
|
+
},
|
|
23
|
+
"bugs": "https://github.com/eclipse-glsp/glsp/issues",
|
|
24
|
+
"contributors": [
|
|
25
|
+
{
|
|
26
|
+
"name": "Eclipse GLSP Project",
|
|
27
|
+
"email": "glsp-dev@eclipse.org",
|
|
28
|
+
"url": "https://projects.eclipse.org/projects/ecd.glsp"
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
"files": [
|
|
32
|
+
"lib",
|
|
33
|
+
"src",
|
|
34
|
+
"css"
|
|
35
|
+
],
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"@eclipse-glsp/protocol": "0.9.0-next.c5944e10",
|
|
38
|
+
"autocompleter": "5.1.0",
|
|
39
|
+
"sprotty": "next"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@babel/runtime": "^7.11.2",
|
|
43
|
+
"@types/chai": "4.1.3",
|
|
44
|
+
"@types/mocha": "^5.2.7",
|
|
45
|
+
"@types/node": "10.14.18",
|
|
46
|
+
"chai": "^4.2.0",
|
|
47
|
+
"mocha": "^6.2.0",
|
|
48
|
+
"mocha-jenkins-reporter": "0.4.5",
|
|
49
|
+
"reflect-metadata": "^0.1.13",
|
|
50
|
+
"rimraf": "^2.6.1",
|
|
51
|
+
"ts-node": "^8.3.0",
|
|
52
|
+
"typescript": "^3.9.2"
|
|
53
|
+
},
|
|
54
|
+
"scripts": {
|
|
55
|
+
"prepare": "yarn clean && yarn build && yarn lint",
|
|
56
|
+
"clean": "rimraf lib",
|
|
57
|
+
"build": "tsc",
|
|
58
|
+
"lint": "eslint -c ./.eslintrc.js --ext .ts,.tsx ./src",
|
|
59
|
+
"watch": "tsc -w",
|
|
60
|
+
"test": "mocha --opts ../../configs/mocha.opts \"./src/**/*.spec.?(ts|tsx)\"",
|
|
61
|
+
"test:ci": "export JUNIT_REPORT_PATH=./report.xml && yarn test --colors --reporter mocha-jenkins-reporter"
|
|
62
|
+
},
|
|
63
|
+
"publishConfig": {
|
|
64
|
+
"access": "public"
|
|
65
|
+
},
|
|
66
|
+
"main": "lib/index",
|
|
67
|
+
"types": "lib/index"
|
|
68
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2019 EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
*
|
|
8
|
+
* This Source Code may also be made available under the following Secondary
|
|
9
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
* with the GNU Classpath Exception which is available at
|
|
12
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
*
|
|
14
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
+
********************************************************************************/
|
|
16
|
+
import { inject } from 'inversify';
|
|
17
|
+
import { Action, ActionDispatcher, isResponseAction, RequestAction, ResponseAction } from 'sprotty';
|
|
18
|
+
|
|
19
|
+
import { ModelInitializationConstraint } from './model-initialization-constraint';
|
|
20
|
+
|
|
21
|
+
export class GLSPActionDispatcher extends ActionDispatcher {
|
|
22
|
+
|
|
23
|
+
protected readonly timeouts: Map<string, NodeJS.Timeout> = new Map();
|
|
24
|
+
|
|
25
|
+
@inject(ModelInitializationConstraint) protected initiailizationConstraint: ModelInitializationConstraint;
|
|
26
|
+
protected onModelInitialized: Promise<void> = Promise.resolve();
|
|
27
|
+
|
|
28
|
+
initialize(): Promise<void> {
|
|
29
|
+
return super.initialize().then(() => this.startModelInitialization());
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
startModelInitialization(): void {
|
|
33
|
+
this.logger.log(this, 'Starting model initialization mode');
|
|
34
|
+
this.onModelInitialized = this.initiailizationConstraint.onInitialized();
|
|
35
|
+
this.onModelInitialized.then(() => this.logger.log(this, 'Model initialization completed'));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
onceModelInitialized(): Promise<void> {
|
|
39
|
+
return this.onModelInitialized;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
dispatch(action: Action): Promise<void> {
|
|
43
|
+
const result = super.dispatch(action);
|
|
44
|
+
this.initiailizationConstraint.notifyDispatched(action);
|
|
45
|
+
return result;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
protected handleAction(action: Action): Promise<void> {
|
|
49
|
+
if (isResponseAction(action)) {
|
|
50
|
+
// clear timeout
|
|
51
|
+
const timeout = this.timeouts.get(action.responseId);
|
|
52
|
+
if (timeout !== undefined) {
|
|
53
|
+
clearTimeout(timeout);
|
|
54
|
+
this.timeouts.delete(action.responseId);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// we might have reached a timeout, so we simply drop the response
|
|
58
|
+
const deferred = this.requests.get(action.responseId);
|
|
59
|
+
if (deferred === undefined) {
|
|
60
|
+
this.logger.log(this, 'No matching request for response', action);
|
|
61
|
+
return Promise.resolve();
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return super.handleAction(action);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Dispatch a request and waits for a response until the timeout given in `timeoutMs` has
|
|
69
|
+
* been reached. The returned promise is resolved when a response with matching identifier
|
|
70
|
+
* is dispatched or when the timeout has been reached. That response is _not_ passed to the
|
|
71
|
+
* registered action handlers. Instead, it is the responsibility of the caller of this method
|
|
72
|
+
* to handle the response properly. For example, it can be sent to the registered handlers by
|
|
73
|
+
* passing it again to the `dispatch` method.
|
|
74
|
+
* If `rejectOnTimeout` is set to false (default) the returned promise will be resolved with
|
|
75
|
+
* no value, otherwise it will be rejected.
|
|
76
|
+
*/
|
|
77
|
+
requestUntil<Res extends ResponseAction>(action: RequestAction<Res>, timeoutMs = 2000, rejectOnTimeout = false): Promise<Res> {
|
|
78
|
+
if (!action.requestId) {
|
|
79
|
+
return Promise.reject(new Error('Request without requestId'));
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const requestId = action.requestId;
|
|
83
|
+
const timeout = setTimeout(() => {
|
|
84
|
+
const deferred = this.requests.get(requestId);
|
|
85
|
+
if (deferred !== undefined) {
|
|
86
|
+
// cleanup
|
|
87
|
+
clearTimeout(timeout);
|
|
88
|
+
this.requests.delete(requestId);
|
|
89
|
+
|
|
90
|
+
const notification = 'Request ' + requestId + ' (' + action + ') time out after ' + timeoutMs + 'ms.';
|
|
91
|
+
if (rejectOnTimeout) {
|
|
92
|
+
deferred.reject(notification);
|
|
93
|
+
} else {
|
|
94
|
+
this.logger.info(this, notification);
|
|
95
|
+
deferred.resolve();
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}, timeoutMs);
|
|
99
|
+
this.timeouts.set(requestId, timeout);
|
|
100
|
+
|
|
101
|
+
return super.request(action);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2019 EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
*
|
|
8
|
+
* This Source Code may also be made available under the following Secondary
|
|
9
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
* with the GNU Classpath Exception which is available at
|
|
12
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
*
|
|
14
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
+
********************************************************************************/
|
|
16
|
+
import { Action, generateRequestId, LabeledAction, RequestAction, ResponseAction } from 'sprotty';
|
|
17
|
+
|
|
18
|
+
import { Args } from '../args';
|
|
19
|
+
import { EditorContext } from '../editor-context';
|
|
20
|
+
|
|
21
|
+
export class RequestContextActions implements RequestAction<SetContextActions> {
|
|
22
|
+
static readonly KIND = 'requestContextActions';
|
|
23
|
+
constructor(
|
|
24
|
+
public readonly contextId: string,
|
|
25
|
+
public readonly editorContext: EditorContext,
|
|
26
|
+
public readonly requestId: string = generateRequestId(),
|
|
27
|
+
public readonly kind: string = RequestContextActions.KIND) { }
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export class SetContextActions implements ResponseAction {
|
|
31
|
+
static readonly KIND = 'setContextActions';
|
|
32
|
+
constructor(
|
|
33
|
+
public readonly actions: LabeledAction[],
|
|
34
|
+
public readonly responseId: string = '',
|
|
35
|
+
public readonly args?: Args,
|
|
36
|
+
public readonly kind: string = SetContextActions.KIND) {
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function isSetContextActionsAction(action: Action): action is SetContextActions {
|
|
41
|
+
return action !== undefined && (action.kind === SetContextActions.KIND)
|
|
42
|
+
&& (action as SetContextActions).actions !== undefined;
|
|
43
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2020 EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
*
|
|
8
|
+
* This Source Code may also be made available under the following Secondary
|
|
9
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
* with the GNU Classpath Exception which is available at
|
|
12
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
*
|
|
14
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
+
********************************************************************************/
|
|
16
|
+
import { injectable } from 'inversify';
|
|
17
|
+
import { Action } from 'sprotty';
|
|
18
|
+
|
|
19
|
+
@injectable()
|
|
20
|
+
export class SetEditModeAction implements Action {
|
|
21
|
+
static readonly KIND = 'setEditMode';
|
|
22
|
+
constructor(public readonly editMode: string = EditMode.EDITABLE, public readonly kind: string = SetEditModeAction.KIND) { }
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function isSetEditModeAction(action: Action): action is SetEditModeAction {
|
|
26
|
+
return action !== undefined && (action.kind === SetEditModeAction.KIND)
|
|
27
|
+
&& 'editMode' in action && typeof action['editMode'] === 'string';
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export namespace EditMode {
|
|
31
|
+
export const READONLY = 'readonly';
|
|
32
|
+
export const EDITABLE = 'editable';
|
|
33
|
+
}
|