@eclipse-glsp/client 0.9.0-next.c5944e10 → 0.9.0-next.fd1a8bb6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/base/action-dispatcher.d.ts.map +1 -1
- package/lib/base/action-dispatcher.js +1 -1
- package/lib/base/action-dispatcher.js.map +1 -1
- package/lib/base/actions/context-actions.d.ts +1 -1
- package/lib/base/actions/context-actions.d.ts.map +1 -1
- package/lib/base/actions/context-actions.js +2 -3
- package/lib/base/actions/context-actions.js.map +1 -1
- package/lib/base/actions/edit-mode-action.d.ts.map +1 -1
- package/lib/base/actions/edit-mode-action.js +2 -3
- package/lib/base/actions/edit-mode-action.js.map +1 -1
- package/lib/base/actions/edit-validation-actions.d.ts +1 -1
- package/lib/base/actions/edit-validation-actions.d.ts.map +1 -1
- package/lib/base/actions/edit-validation-actions.js +13 -10
- package/lib/base/actions/edit-validation-actions.js.map +1 -1
- package/lib/base/actions/focus-change-action.js.map +1 -1
- package/lib/base/args.d.ts +1 -1
- package/lib/base/args.d.ts.map +1 -1
- package/lib/base/args.js.map +1 -1
- package/lib/base/auto-complete/auto-complete-widget.d.ts +1 -1
- package/lib/base/auto-complete/auto-complete-widget.d.ts.map +1 -1
- package/lib/base/auto-complete/auto-complete-widget.js +4 -5
- package/lib/base/auto-complete/auto-complete-widget.js.map +1 -1
- package/lib/base/auto-complete/validation-decorator.d.ts +1 -1
- package/lib/base/auto-complete/validation-decorator.js +1 -1
- package/lib/base/auto-complete/validation-decorator.js.map +1 -1
- package/lib/base/command-stack.d.ts.map +1 -1
- package/lib/base/command-stack.js +1 -1
- package/lib/base/command-stack.js.map +1 -1
- package/lib/base/di.config.d.ts.map +1 -1
- package/lib/base/di.config.js.map +1 -1
- package/lib/base/drag-aware-mouse-listener.d.ts +1 -1
- package/lib/base/drag-aware-mouse-listener.d.ts.map +1 -1
- package/lib/base/drag-aware-mouse-listener.js +1 -1
- package/lib/base/drag-aware-mouse-listener.js.map +1 -1
- package/lib/base/editor-context.d.ts.map +1 -1
- package/lib/base/editor-context.js +1 -1
- package/lib/base/editor-context.js.map +1 -1
- package/lib/base/focus-tracker.d.ts.map +1 -1
- package/lib/base/focus-tracker.js.map +1 -1
- package/lib/base/model/update-model-command.d.ts.map +1 -1
- package/lib/base/model/update-model-command.js +4 -5
- package/lib/base/model/update-model-command.js.map +1 -1
- package/lib/base/operations/operation.d.ts +1 -1
- package/lib/base/operations/operation.d.ts.map +1 -1
- package/lib/base/operations/operation.js +19 -10
- package/lib/base/operations/operation.js.map +1 -1
- package/lib/features/change-bounds/model.d.ts +1 -1
- package/lib/features/change-bounds/model.d.ts.map +1 -1
- package/lib/features/change-bounds/model.js +2 -1
- package/lib/features/change-bounds/model.js.map +1 -1
- package/lib/features/change-bounds/movement-restrictor.d.ts.map +1 -1
- package/lib/features/change-bounds/movement-restrictor.js +4 -2
- package/lib/features/change-bounds/movement-restrictor.js.map +1 -1
- package/lib/features/command-palette/server-command-palette-provider.d.ts.map +1 -1
- package/lib/features/command-palette/server-command-palette-provider.js +1 -1
- package/lib/features/command-palette/server-command-palette-provider.js.map +1 -1
- package/lib/features/context-menu/di.config.d.ts +1 -1
- package/lib/features/context-menu/di.config.d.ts.map +1 -1
- package/lib/features/context-menu/di.config.js +1 -1
- package/lib/features/context-menu/di.config.js.map +1 -1
- package/lib/features/context-menu/selection-service-aware-context-menu-mouse-listener.d.ts.map +1 -1
- package/lib/features/context-menu/selection-service-aware-context-menu-mouse-listener.js +2 -3
- package/lib/features/context-menu/selection-service-aware-context-menu-mouse-listener.js.map +1 -1
- package/lib/features/context-menu/server-context-menu-provider.d.ts.map +1 -1
- package/lib/features/context-menu/server-context-menu-provider.js +5 -2
- package/lib/features/context-menu/server-context-menu-provider.js.map +1 -1
- package/lib/features/copy-paste/copy-paste-actions.d.ts +1 -1
- package/lib/features/copy-paste/copy-paste-actions.d.ts.map +1 -1
- package/lib/features/copy-paste/copy-paste-actions.js +1 -1
- package/lib/features/copy-paste/copy-paste-actions.js.map +1 -1
- package/lib/features/copy-paste/copy-paste-context-menu.d.ts.map +1 -1
- package/lib/features/copy-paste/copy-paste-context-menu.js +17 -8
- package/lib/features/copy-paste/copy-paste-context-menu.js.map +1 -1
- package/lib/features/copy-paste/copy-paste-handler.d.ts.map +1 -1
- package/lib/features/copy-paste/copy-paste-handler.js +4 -4
- package/lib/features/copy-paste/copy-paste-handler.js.map +1 -1
- package/lib/features/decoration/decoration-placer.d.ts.map +1 -1
- package/lib/features/decoration/decoration-placer.js +1 -1
- package/lib/features/decoration/decoration-placer.js.map +1 -1
- package/lib/features/edit-label/edit-label-validator.d.ts.map +1 -1
- package/lib/features/edit-label/edit-label-validator.js +1 -1
- package/lib/features/edit-label/edit-label-validator.js.map +1 -1
- package/lib/features/hints/model.d.ts +1 -1
- package/lib/features/hints/model.d.ts.map +1 -1
- package/lib/features/hints/request-type-hints-action.d.ts +1 -1
- package/lib/features/hints/request-type-hints-action.d.ts.map +1 -1
- package/lib/features/hints/request-type-hints-action.js +4 -2
- package/lib/features/hints/request-type-hints-action.js.map +1 -1
- package/lib/features/hints/type-hints.d.ts +4 -4
- package/lib/features/hints/type-hints.d.ts.map +1 -1
- package/lib/features/hints/type-hints.js +6 -11
- package/lib/features/hints/type-hints.js.map +1 -1
- package/lib/features/hover/hover.d.ts.map +1 -1
- package/lib/features/hover/hover.js +1 -1
- package/lib/features/hover/hover.js.map +1 -1
- package/lib/features/layout/layout-commands.d.ts +2 -2
- package/lib/features/layout/layout-commands.d.ts.map +1 -1
- package/lib/features/layout/layout-commands.js +9 -8
- package/lib/features/layout/layout-commands.js.map +1 -1
- package/lib/features/layout/layout-commands.spec.d.ts +1 -1
- package/lib/features/layout/layout-commands.spec.js +15 -6
- package/lib/features/layout/layout-commands.spec.js.map +1 -1
- package/lib/features/model-source-watcher/model-source-changed-action-handler.d.ts.map +1 -1
- package/lib/features/model-source-watcher/model-source-changed-action-handler.js +1 -1
- package/lib/features/model-source-watcher/model-source-changed-action-handler.js.map +1 -1
- package/lib/features/model-source-watcher/model-source-changed-action.d.ts +1 -1
- package/lib/features/model-source-watcher/model-source-changed-action.js.map +1 -1
- package/lib/features/mouse-tool/mouse-tool.d.ts.map +1 -1
- package/lib/features/mouse-tool/mouse-tool.js +1 -1
- package/lib/features/mouse-tool/mouse-tool.js.map +1 -1
- package/lib/features/navigation/navigation-action-handler.d.ts.map +1 -1
- package/lib/features/navigation/navigation-action-handler.js +13 -13
- package/lib/features/navigation/navigation-action-handler.js.map +1 -1
- package/lib/features/navigation/navigation-target-resolver.d.ts.map +1 -1
- package/lib/features/navigation/navigation-target-resolver.js +6 -6
- package/lib/features/navigation/navigation-target-resolver.js.map +1 -1
- package/lib/features/navigation/navigation-target-resolver.spec.d.ts +1 -1
- package/lib/features/navigation/navigation-target-resolver.spec.js +1 -1
- package/lib/features/navigation/navigation-target-resolver.spec.js.map +1 -1
- package/lib/features/rank/model.d.ts +1 -1
- package/lib/features/rank/model.js +2 -2
- package/lib/features/rank/model.js.map +1 -1
- package/lib/features/reconnect/model.d.ts +1 -1
- package/lib/features/reconnect/model.d.ts.map +1 -1
- package/lib/features/reconnect/model.js +1 -1
- package/lib/features/reconnect/model.js.map +1 -1
- package/lib/features/save/di.config.d.ts +1 -1
- package/lib/features/save/di.config.d.ts.map +1 -1
- package/lib/features/save/di.config.js +1 -1
- package/lib/features/save/di.config.js.map +1 -1
- package/lib/features/save/save.d.ts +1 -1
- package/lib/features/save/save.js +1 -1
- package/lib/features/save/save.js.map +1 -1
- package/lib/features/select/select-feedback-action.d.ts.map +1 -1
- package/lib/features/select/select-feedback-action.js +1 -1
- package/lib/features/select/select-feedback-action.js.map +1 -1
- package/lib/features/select/selection-service.d.ts.map +1 -1
- package/lib/features/select/selection-service.js +11 -6
- package/lib/features/select/selection-service.js.map +1 -1
- package/lib/features/select/selection-service.spec.js +2 -2
- package/lib/features/select/selection-service.spec.js.map +1 -1
- package/lib/features/tool-feedback/change-bounds-tool-feedback.d.ts.map +1 -1
- package/lib/features/tool-feedback/change-bounds-tool-feedback.js +3 -9
- package/lib/features/tool-feedback/change-bounds-tool-feedback.js.map +1 -1
- package/lib/features/tool-feedback/creation-tool-feedback.d.ts.map +1 -1
- package/lib/features/tool-feedback/creation-tool-feedback.js +1 -2
- package/lib/features/tool-feedback/creation-tool-feedback.js.map +1 -1
- package/lib/features/tool-feedback/css-feedback.d.ts.map +1 -1
- package/lib/features/tool-feedback/css-feedback.js +2 -1
- package/lib/features/tool-feedback/css-feedback.js.map +1 -1
- package/lib/features/tool-feedback/di.config.d.ts +1 -1
- package/lib/features/tool-feedback/di.config.d.ts.map +1 -1
- package/lib/features/tool-feedback/di.config.js +1 -1
- package/lib/features/tool-feedback/di.config.js.map +1 -1
- package/lib/features/tool-feedback/edge-edit-tool-feedback.d.ts.map +1 -1
- package/lib/features/tool-feedback/edge-edit-tool-feedback.js +3 -3
- package/lib/features/tool-feedback/edge-edit-tool-feedback.js.map +1 -1
- package/lib/features/tool-feedback/feedback-action-dispatcher.d.ts +2 -2
- package/lib/features/tool-feedback/feedback-action-dispatcher.d.ts.map +1 -1
- package/lib/features/tool-feedback/feedback-action-dispatcher.js +2 -2
- package/lib/features/tool-feedback/feedback-action-dispatcher.js.map +1 -1
- package/lib/features/tool-feedback/marquee-tool-feedback.d.ts.map +1 -1
- package/lib/features/tool-feedback/marquee-tool-feedback.js.map +1 -1
- package/lib/features/tool-feedback/model.d.ts +1 -1
- package/lib/features/tool-feedback/model.js +1 -1
- package/lib/features/tool-feedback/view.d.ts +3 -3
- package/lib/features/tool-feedback/view.d.ts.map +1 -1
- package/lib/features/tool-feedback/view.js +5 -5
- package/lib/features/tool-feedback/view.js.map +1 -1
- package/lib/features/tool-palette/palette-item.d.ts +1 -1
- package/lib/features/tool-palette/palette-item.d.ts.map +1 -1
- package/lib/features/tool-palette/palette-item.js +3 -2
- package/lib/features/tool-palette/palette-item.js.map +1 -1
- package/lib/features/tool-palette/tool-palette.d.ts.map +1 -1
- package/lib/features/tool-palette/tool-palette.js +4 -6
- package/lib/features/tool-palette/tool-palette.js.map +1 -1
- package/lib/features/tools/change-bounds-tool.d.ts.map +1 -1
- package/lib/features/tools/change-bounds-tool.js +13 -7
- package/lib/features/tools/change-bounds-tool.js.map +1 -1
- package/lib/features/tools/delete-tool.d.ts.map +1 -1
- package/lib/features/tools/delete-tool.js +6 -3
- package/lib/features/tools/delete-tool.js.map +1 -1
- package/lib/features/tools/edge-creation-tool.d.ts.map +1 -1
- package/lib/features/tools/edge-creation-tool.js +4 -3
- package/lib/features/tools/edge-creation-tool.js.map +1 -1
- package/lib/features/tools/edge-edit-tool.d.ts.map +1 -1
- package/lib/features/tools/edge-edit-tool.js +2 -6
- package/lib/features/tools/edge-edit-tool.js.map +1 -1
- package/lib/features/tools/marquee-mouse-tool.d.ts.map +1 -1
- package/lib/features/tools/marquee-mouse-tool.js +35 -25
- package/lib/features/tools/marquee-mouse-tool.js.map +1 -1
- package/lib/features/tools/marquee-tool.d.ts.map +1 -1
- package/lib/features/tools/marquee-tool.js.map +1 -1
- package/lib/features/tools/node-creation-tool.d.ts.map +1 -1
- package/lib/features/tools/node-creation-tool.js +3 -3
- package/lib/features/tools/node-creation-tool.js.map +1 -1
- package/lib/features/tools/view.d.ts.map +1 -1
- package/lib/features/tools/view.js +2 -2
- package/lib/features/tools/view.js.map +1 -1
- package/lib/features/undo-redo/model.d.ts +1 -1
- package/lib/features/undo-redo/model.js.map +1 -1
- package/lib/features/validation/marker-navigator.d.ts.map +1 -1
- package/lib/features/validation/marker-navigator.js +11 -4
- package/lib/features/validation/marker-navigator.js.map +1 -1
- package/lib/features/validation/marker-navigator.spec.d.ts +1 -1
- package/lib/features/validation/marker-navigator.spec.js +13 -7
- package/lib/features/validation/marker-navigator.spec.js.map +1 -1
- package/lib/features/validation/validate.d.ts +2 -2
- package/lib/features/validation/validate.d.ts.map +1 -1
- package/lib/features/validation/validate.js +4 -4
- package/lib/features/validation/validate.js.map +1 -1
- package/lib/features/viewport/glsp-scroll-mouse-listener.d.ts.map +1 -1
- package/lib/features/viewport/glsp-scroll-mouse-listener.js.map +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/utils/argument-utils.d.ts +3 -3
- package/lib/utils/argument-utils.d.ts.map +1 -1
- package/lib/utils/argument-utils.js +1 -3
- package/lib/utils/argument-utils.js.map +1 -1
- package/lib/utils/array-utils.d.ts +1 -1
- package/lib/utils/array-utils.d.ts.map +1 -1
- package/lib/utils/array-utils.js +1 -1
- package/lib/utils/array-utils.js.map +1 -1
- package/lib/utils/layout-utils.d.ts +1 -1
- package/lib/utils/layout-utils.d.ts.map +1 -1
- package/lib/utils/layout-utils.js.map +1 -1
- package/lib/utils/smodel-util.d.ts +3 -3
- package/lib/utils/smodel-util.d.ts.map +1 -1
- package/lib/utils/smodel-util.js +5 -6
- package/lib/utils/smodel-util.js.map +1 -1
- package/lib/utils/viewpoint-util.d.ts +1 -1
- package/lib/utils/viewpoint-util.d.ts.map +1 -1
- package/lib/utils/viewpoint-util.js +1 -1
- package/lib/utils/viewpoint-util.js.map +1 -1
- package/lib/views/glsp-edge-view.d.ts.map +1 -1
- package/lib/views/glsp-edge-view.js +3 -3
- package/lib/views/glsp-edge-view.js.map +1 -1
- package/lib/views/issue-marker-view.d.ts.map +1 -1
- package/lib/views/issue-marker-view.js +3 -3
- package/lib/views/issue-marker-view.js.map +1 -1
- package/lib/views/rounded-corner-view.d.ts.map +1 -1
- package/lib/views/rounded-corner-view.js +3 -3
- package/lib/views/rounded-corner-view.js.map +1 -1
- package/lib/views/rounded-corner.d.ts.map +1 -1
- package/lib/views/rounded-corner.js +2 -2
- package/lib/views/rounded-corner.js.map +1 -1
- package/package.json +3 -3
- package/src/base/action-dispatcher.ts +1 -2
- package/src/base/actions/context-actions.ts +6 -6
- package/src/base/actions/edit-mode-action.ts +3 -4
- package/src/base/actions/edit-validation-actions.ts +26 -14
- package/src/base/actions/focus-change-action.ts +1 -1
- package/src/base/args.ts +4 -2
- package/src/base/auto-complete/auto-complete-widget.ts +34 -21
- package/src/base/auto-complete/validation-decorator.ts +5 -5
- package/src/base/command-stack.ts +1 -3
- package/src/base/di.config.ts +11 -16
- package/src/base/drag-aware-mouse-listener.ts +1 -3
- package/src/base/editor-context.ts +2 -4
- package/src/base/focus-tracker.ts +0 -2
- package/src/base/model/update-model-command.ts +4 -5
- package/src/base/operations/operation.ts +54 -27
- package/src/features/change-bounds/model.ts +7 -5
- package/src/features/change-bounds/movement-restrictor.ts +15 -7
- package/src/features/command-palette/server-command-palette-provider.ts +8 -5
- package/src/features/context-menu/di.config.ts +11 -8
- package/src/features/context-menu/selection-service-aware-context-menu-mouse-listener.ts +4 -3
- package/src/features/context-menu/server-context-menu-provider.ts +7 -3
- package/src/features/copy-paste/copy-paste-actions.ts +11 -8
- package/src/features/copy-paste/copy-paste-context-menu.ts +20 -11
- package/src/features/copy-paste/copy-paste-handler.ts +6 -5
- package/src/features/decoration/decoration-placer.ts +2 -13
- package/src/features/edit-label/edit-label-validator.ts +11 -12
- package/src/features/hints/model.ts +2 -2
- package/src/features/hints/request-type-hints-action.ts +10 -5
- package/src/features/hints/type-hints.ts +26 -30
- package/src/features/hover/hover.ts +1 -2
- package/src/features/layout/layout-commands.spec.ts +79 -56
- package/src/features/layout/layout-commands.ts +42 -31
- package/src/features/model-source-watcher/model-source-changed-action-handler.ts +3 -3
- package/src/features/model-source-watcher/model-source-changed-action.ts +2 -2
- package/src/features/mouse-tool/mouse-tool.ts +15 -8
- package/src/features/navigation/navigation-action-handler.ts +32 -22
- package/src/features/navigation/navigation-target-resolver.spec.ts +1 -3
- package/src/features/navigation/navigation-target-resolver.ts +14 -12
- package/src/features/rank/model.ts +2 -2
- package/src/features/reconnect/model.ts +2 -3
- package/src/features/save/di.config.ts +1 -2
- package/src/features/save/save.ts +2 -2
- package/src/features/select/select-feedback-action.ts +4 -6
- package/src/features/select/selection-service.spec.ts +9 -4
- package/src/features/select/selection-service.ts +13 -5
- package/src/features/tool-feedback/change-bounds-tool-feedback.ts +5 -12
- package/src/features/tool-feedback/creation-tool-feedback.ts +16 -7
- package/src/features/tool-feedback/css-feedback.ts +4 -3
- package/src/features/tool-feedback/di.config.ts +2 -5
- package/src/features/tool-feedback/edge-edit-tool-feedback.ts +17 -14
- package/src/features/tool-feedback/feedback-action-dispatcher.ts +6 -8
- package/src/features/tool-feedback/marquee-tool-feedback.ts +3 -2
- package/src/features/tool-feedback/model.ts +1 -2
- package/src/features/tool-feedback/view.tsx +13 -6
- package/src/features/tool-palette/palette-item.ts +3 -3
- package/src/features/tool-palette/tool-palette.ts +12 -14
- package/src/features/tools/change-bounds-tool.ts +29 -17
- package/src/features/tools/delete-tool.ts +8 -3
- package/src/features/tools/edge-creation-tool.ts +5 -8
- package/src/features/tools/edge-edit-tool.ts +7 -16
- package/src/features/tools/marquee-mouse-tool.ts +57 -37
- package/src/features/tools/marquee-tool.ts +0 -1
- package/src/features/tools/node-creation-tool.ts +4 -9
- package/src/features/tools/view.tsx +14 -8
- package/src/features/undo-redo/model.ts +3 -3
- package/src/features/validation/marker-navigator.spec.ts +15 -9
- package/src/features/validation/marker-navigator.ts +23 -8
- package/src/features/validation/validate.ts +9 -13
- package/src/features/viewport/glsp-scroll-mouse-listener.ts +1 -10
- package/src/index.ts +21 -4
- package/src/utils/argument-utils.ts +13 -9
- package/src/utils/array-utils.ts +4 -2
- package/src/utils/layout-utils.ts +11 -5
- package/src/utils/smodel-util.ts +14 -10
- package/src/utils/viewpoint-util.ts +3 -2
- package/src/views/glsp-edge-view.tsx +17 -8
- package/src/views/issue-marker-view.tsx +8 -8
- package/src/views/rounded-corner-view.tsx +35 -20
- package/src/views/rounded-corner.ts +3 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2020 EclipseSource and others.
|
|
2
|
+
* Copyright (c) 2020-2021 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
|
|
@@ -72,12 +72,14 @@ export class AutoCompleteWidget {
|
|
|
72
72
|
public suggestionProvider: SuggestionProvider,
|
|
73
73
|
public suggestionSubmitHandler: SuggestionSubmitHandler,
|
|
74
74
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
75
|
-
protected notifyClose: () => void = () => {
|
|
75
|
+
protected notifyClose: () => void = () => {},
|
|
76
76
|
protected logger?: ILogger
|
|
77
|
-
) {
|
|
77
|
+
) {}
|
|
78
78
|
|
|
79
|
-
configureValidation(
|
|
80
|
-
|
|
79
|
+
configureValidation(
|
|
80
|
+
inputValidator: InputValidator,
|
|
81
|
+
validationDecorator: IValidationDecorator = IValidationDecorator.NO_DECORATION
|
|
82
|
+
): void {
|
|
81
83
|
this.inputValidator = inputValidator;
|
|
82
84
|
this.validationDecorator = validationDecorator;
|
|
83
85
|
}
|
|
@@ -154,25 +156,33 @@ export class AutoCompleteWidget {
|
|
|
154
156
|
showOnFocus: this.autoSuggestionSettings.showOnFocus,
|
|
155
157
|
debounceWaitMs: this.autoSuggestionSettings.debounceWaitMs,
|
|
156
158
|
minLength: -1,
|
|
157
|
-
fetch: (text: string, update: (items: LabeledAction[]) => void) =>
|
|
158
|
-
this.updateSuggestions(update, text, root),
|
|
159
|
+
fetch: (text: string, update: (items: LabeledAction[]) => void) => this.updateSuggestions(update, text, root),
|
|
159
160
|
onSelect: (item: LabeledAction) => this.onSelect(item),
|
|
160
|
-
render: (item: LabeledAction, currentValue: string): HTMLDivElement | undefined =>
|
|
161
|
-
this.renderSuggestions(item, currentValue),
|
|
161
|
+
render: (item: LabeledAction, currentValue: string): HTMLDivElement | undefined => this.renderSuggestions(item, currentValue),
|
|
162
162
|
customize: (input: HTMLInputElement, inputRect: ClientRect | DOMRect, container: HTMLDivElement, maxHeight: number) => {
|
|
163
163
|
this.customizeInputElement(input, inputRect, container, maxHeight);
|
|
164
164
|
}
|
|
165
165
|
};
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
-
protected customizeInputElement(
|
|
168
|
+
protected customizeInputElement(
|
|
169
|
+
input: HTMLInputElement,
|
|
170
|
+
inputRect: ClientRect | DOMRect,
|
|
171
|
+
container: HTMLDivElement,
|
|
172
|
+
maxHeight: number
|
|
173
|
+
): void {
|
|
169
174
|
// move container into our UIExtension container as this is already positioned correctly
|
|
170
175
|
if (this.containerElement) {
|
|
171
176
|
this.containerElement.appendChild(container);
|
|
172
177
|
}
|
|
173
178
|
}
|
|
174
179
|
|
|
175
|
-
protected updateSuggestions(
|
|
180
|
+
protected updateSuggestions(
|
|
181
|
+
update: (items: LabeledAction[]) => void,
|
|
182
|
+
text: string,
|
|
183
|
+
root: Readonly<SModelRoot>,
|
|
184
|
+
...contextElementIds: string[]
|
|
185
|
+
): void {
|
|
176
186
|
this.onLoading();
|
|
177
187
|
this.doUpdateSuggestions(text, root)
|
|
178
188
|
.then(actions => {
|
|
@@ -230,11 +240,13 @@ export class AutoCompleteWidget {
|
|
|
230
240
|
}
|
|
231
241
|
|
|
232
242
|
protected filterActions(filterText: string, actions: LabeledAction[]): LabeledAction[] {
|
|
233
|
-
return toArray(
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
243
|
+
return toArray(
|
|
244
|
+
actions.filter(action => {
|
|
245
|
+
const label = action.label.toLowerCase();
|
|
246
|
+
const searchWords = filterText.split(' ');
|
|
247
|
+
return searchWords.every(word => label.indexOf(word.toLowerCase()) !== -1);
|
|
248
|
+
})
|
|
249
|
+
);
|
|
238
250
|
}
|
|
239
251
|
|
|
240
252
|
protected onSelect(item: LabeledAction): void {
|
|
@@ -257,10 +269,10 @@ export class AutoCompleteWidget {
|
|
|
257
269
|
}
|
|
258
270
|
|
|
259
271
|
private isNoOrExactlyOneMatchingContextAction(): boolean | undefined {
|
|
260
|
-
return
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
272
|
+
return (
|
|
273
|
+
!this.isSuggestionAvailable() ||
|
|
274
|
+
(this.contextActions && this.contextActions.length === 1 && this.inputElement.value.endsWith(this.contextActions[0].label))
|
|
275
|
+
);
|
|
264
276
|
}
|
|
265
277
|
|
|
266
278
|
protected isSuggestionAvailable(): boolean | undefined {
|
|
@@ -269,7 +281,8 @@ export class AutoCompleteWidget {
|
|
|
269
281
|
|
|
270
282
|
validateInput(): void {
|
|
271
283
|
if (this.inputValidator) {
|
|
272
|
-
this.inputValidator
|
|
284
|
+
this.inputValidator
|
|
285
|
+
.validate(this.inputElement.value)
|
|
273
286
|
.then(result => this.validationDecorator.decorateValidationResult(result))
|
|
274
287
|
.catch(error => this.handleErrorDuringValidation(error));
|
|
275
288
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2020 EclipseSource and others.
|
|
2
|
+
* Copyright (c) 2020-2021 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
|
|
@@ -25,14 +25,14 @@ export interface IValidationDecorator {
|
|
|
25
25
|
export namespace IValidationDecorator {
|
|
26
26
|
export const NO_DECORATION: IValidationDecorator = {
|
|
27
27
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
28
|
-
decorateValidationResult(_status: ValidationStatus) {
|
|
28
|
+
decorateValidationResult(_status: ValidationStatus) {},
|
|
29
29
|
isValidatedOk(): boolean {
|
|
30
30
|
return false;
|
|
31
31
|
},
|
|
32
32
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
33
|
-
invalidate() {
|
|
33
|
+
invalidate() {},
|
|
34
34
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
35
|
-
dispose() {
|
|
35
|
+
dispose() {}
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
38
|
|
|
@@ -47,7 +47,7 @@ export class ValidationDecorator implements IValidationDecorator {
|
|
|
47
47
|
|
|
48
48
|
protected decorationDiv?: HTMLDivElement;
|
|
49
49
|
|
|
50
|
-
constructor(protected containerElement: HTMLElement) {
|
|
50
|
+
constructor(protected containerElement: HTMLElement) {}
|
|
51
51
|
|
|
52
52
|
decorateValidationResult(status: ValidationStatus): void {
|
|
53
53
|
if (ValidationStatus.isError(status)) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2019 EclipseSource and others.
|
|
2
|
+
* Copyright (c) 2019-2021 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
|
|
@@ -20,7 +20,6 @@ import { RedoOperation, UndoOperation } from '../features/undo-redo/model';
|
|
|
20
20
|
|
|
21
21
|
@injectable()
|
|
22
22
|
export class GLSPCommandStack extends CommandStack {
|
|
23
|
-
|
|
24
23
|
@inject(TYPES.IActionDispatcherProvider) protected actionDispatcher: () => Promise<IActionDispatcher>;
|
|
25
24
|
|
|
26
25
|
undo(): Promise<SModelRoot> {
|
|
@@ -33,4 +32,3 @@ export class GLSPCommandStack extends CommandStack {
|
|
|
33
32
|
return this.thenUpdate();
|
|
34
33
|
}
|
|
35
34
|
}
|
|
36
|
-
|
package/src/base/di.config.ts
CHANGED
|
@@ -17,14 +17,7 @@ import '../../css/glsp-sprotty.css';
|
|
|
17
17
|
|
|
18
18
|
import { InitializeResult } from '@eclipse-glsp/protocol';
|
|
19
19
|
import { Container, ContainerModule } from 'inversify';
|
|
20
|
-
import {
|
|
21
|
-
ActionHandlerRegistry,
|
|
22
|
-
configureActionHandler,
|
|
23
|
-
configureCommand,
|
|
24
|
-
ModelSource,
|
|
25
|
-
SetModelCommand,
|
|
26
|
-
TYPES
|
|
27
|
-
} from 'sprotty';
|
|
20
|
+
import { ActionHandlerRegistry, configureActionHandler, configureCommand, ModelSource, SetModelCommand, TYPES } from 'sprotty';
|
|
28
21
|
|
|
29
22
|
import { GLSPActionDispatcher } from './action-dispatcher';
|
|
30
23
|
import { SetEditModeAction } from './actions/edit-mode-action';
|
|
@@ -43,13 +36,16 @@ import { GLSPViewRegistry } from './view/view-registry';
|
|
|
43
36
|
const defaultGLSPModule = new ContainerModule((bind, _unbind, isBound, rebind) => {
|
|
44
37
|
const context = { bind, _unbind, isBound, rebind };
|
|
45
38
|
bind(EditorContextService).toSelf().inSingletonScope();
|
|
46
|
-
bind(GLSP_TYPES.IEditorContextServiceProvider).toProvider<EditorContextService>(
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
39
|
+
bind(GLSP_TYPES.IEditorContextServiceProvider).toProvider<EditorContextService>(
|
|
40
|
+
ctx => () =>
|
|
41
|
+
new Promise<EditorContextService>((resolve, reject) => {
|
|
42
|
+
if (ctx.container.isBound(EditorContextService)) {
|
|
43
|
+
resolve(ctx.container.get<EditorContextService>(EditorContextService));
|
|
44
|
+
} else {
|
|
45
|
+
reject();
|
|
46
|
+
}
|
|
47
|
+
})
|
|
48
|
+
);
|
|
53
49
|
|
|
54
50
|
configureActionHandler(context, SetEditModeAction.KIND, EditorContextService);
|
|
55
51
|
|
|
@@ -93,4 +89,3 @@ export async function configureServerActions(result: InitializeResult, diagramTy
|
|
|
93
89
|
}
|
|
94
90
|
serverActions.forEach(actionKind => actionHandlerRegistry.register(actionKind, modelSource));
|
|
95
91
|
}
|
|
96
|
-
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2019 EclipseSource and others.
|
|
2
|
+
* Copyright (c) 2019-2021 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
|
|
@@ -24,7 +24,6 @@ import { Action, MouseListener, SModelElement } from 'sprotty';
|
|
|
24
24
|
* of mouse up events.
|
|
25
25
|
*/
|
|
26
26
|
export class DragAwareMouseListener extends MouseListener {
|
|
27
|
-
|
|
28
27
|
private _isMouseDown = false;
|
|
29
28
|
private _isMouseDrag = false;
|
|
30
29
|
|
|
@@ -65,5 +64,4 @@ export class DragAwareMouseListener extends MouseListener {
|
|
|
65
64
|
get isMouseDown(): boolean {
|
|
66
65
|
return this._isMouseDown;
|
|
67
66
|
}
|
|
68
|
-
|
|
69
67
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2020 EclipseSource and others.
|
|
2
|
+
* Copyright (c) 2020-2021 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
|
|
@@ -51,13 +51,12 @@ export interface EditModeListener {
|
|
|
51
51
|
|
|
52
52
|
@injectable()
|
|
53
53
|
export class EditorContextService implements IActionHandler {
|
|
54
|
-
|
|
55
54
|
@inject(GLSP_TYPES.SelectionService) protected selectionService: SelectionService;
|
|
56
55
|
@inject(MousePositionTracker) protected mousePositionTracker: MousePositionTracker;
|
|
57
56
|
@inject(TYPES.ModelSourceProvider) protected modelSource: () => Promise<ModelSource>;
|
|
58
57
|
protected _editMode: string;
|
|
59
58
|
|
|
60
|
-
constructor(@multiInject(GLSP_TYPES.IEditModeListener) @optional() protected editModeListeners: EditModeListener[] = []) {
|
|
59
|
+
constructor(@multiInject(GLSP_TYPES.IEditModeListener) @optional() protected editModeListeners: EditModeListener[] = []) {}
|
|
61
60
|
|
|
62
61
|
register(editModeListener: EditModeListener): void {
|
|
63
62
|
distinctAdd(this.editModeListeners, editModeListener);
|
|
@@ -121,4 +120,3 @@ export class EditorContextService implements IActionHandler {
|
|
|
121
120
|
}
|
|
122
121
|
|
|
123
122
|
export type EditorContextServiceProvider = () => Promise<EditorContextService>;
|
|
124
|
-
|
|
@@ -20,7 +20,6 @@ import { isFocusStateChangedAction } from './actions/focus-change-action';
|
|
|
20
20
|
|
|
21
21
|
@injectable()
|
|
22
22
|
export class FocusTracker implements IActionHandler {
|
|
23
|
-
|
|
24
23
|
protected inActiveCssClass = 'inactive';
|
|
25
24
|
protected _hasFocus = true;
|
|
26
25
|
|
|
@@ -46,5 +45,4 @@ export class FocusTracker implements IActionHandler {
|
|
|
46
45
|
}
|
|
47
46
|
}
|
|
48
47
|
}
|
|
49
|
-
|
|
50
48
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2019 EclipseSource and others.
|
|
2
|
+
* Copyright (c) 2019-2021 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
|
|
@@ -35,7 +35,7 @@ import { FeedbackCommand } from '../../features/tool-feedback/model';
|
|
|
35
35
|
import { GLSP_TYPES } from '../types';
|
|
36
36
|
|
|
37
37
|
/* ActionHandler that transforms a SetModelAction into an (feedback-aware) UpdateModelAction. This can be done because in sprotty
|
|
38
|
-
* UpdateModel behaves the same as SetModel if no model is present yet.*/
|
|
38
|
+
* UpdateModel behaves the same as SetModel if no model is present yet.*/
|
|
39
39
|
@injectable()
|
|
40
40
|
export class SetModelActionHandler implements IActionHandler {
|
|
41
41
|
handle(action: Action): Action | void {
|
|
@@ -46,8 +46,7 @@ export class SetModelActionHandler implements IActionHandler {
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
export function isSetModelAction(action: Action): action is SetModelAction {
|
|
49
|
-
return action !== undefined &&
|
|
50
|
-
&& (action as SetModelAction).newRoot !== undefined;
|
|
49
|
+
return action !== undefined && action.kind === SetModelCommand.KIND && (action as SetModelAction).newRoot !== undefined;
|
|
51
50
|
}
|
|
52
51
|
|
|
53
52
|
export interface SModelRootListener {
|
|
@@ -73,7 +72,7 @@ export class FeedbackAwareUpdateModelCommand extends UpdateModelCommand {
|
|
|
73
72
|
|
|
74
73
|
@postConstruct()
|
|
75
74
|
protected initialize(): void {
|
|
76
|
-
this.actionHandlerRegistryProvider().then(registry => this.actionHandlerRegistry = registry);
|
|
75
|
+
this.actionHandlerRegistryProvider().then(registry => (this.actionHandlerRegistry = registry));
|
|
77
76
|
}
|
|
78
77
|
|
|
79
78
|
protected performUpdate(oldRoot: SModelRoot, newRoot: SModelRoot, context: CommandExecutionContext): CommandReturn {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2020 EclipseSource and others.
|
|
2
|
+
* Copyright (c) 2020-2021 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 { Args } from '../args';
|
|
|
21
21
|
* Operations are actions that denote requests from the client to _modify_ the model. Model modifications are always performed by the server.
|
|
22
22
|
* After a successful modification, the server sends the updated model back to the client using the `UpdateModelAction`.
|
|
23
23
|
*/
|
|
24
|
-
export interface Operation extends Action {
|
|
24
|
+
export interface Operation extends Action {}
|
|
25
25
|
|
|
26
26
|
export interface CreateOperation extends Operation {
|
|
27
27
|
elementTypeId: string;
|
|
@@ -35,11 +35,13 @@ export function isCreateOperation(object?: any): object is CreateOperation {
|
|
|
35
35
|
export class CreateNodeOperation implements CreateOperation {
|
|
36
36
|
static readonly KIND = 'createNode';
|
|
37
37
|
|
|
38
|
-
constructor(
|
|
38
|
+
constructor(
|
|
39
|
+
public readonly elementTypeId: string,
|
|
39
40
|
public location?: Point,
|
|
40
41
|
public containerId?: string,
|
|
41
42
|
public args?: Args,
|
|
42
|
-
public readonly kind: string = CreateNodeOperation.KIND
|
|
43
|
+
public readonly kind: string = CreateNodeOperation.KIND
|
|
44
|
+
) {}
|
|
43
45
|
}
|
|
44
46
|
|
|
45
47
|
export function isCreateNodeOperation(object?: any): object is CreateNodeOperation {
|
|
@@ -49,11 +51,13 @@ export function isCreateNodeOperation(object?: any): object is CreateNodeOperati
|
|
|
49
51
|
export class CreateEdgeOperation implements CreateOperation {
|
|
50
52
|
static readonly KIND = 'createEdge';
|
|
51
53
|
|
|
52
|
-
constructor(
|
|
54
|
+
constructor(
|
|
55
|
+
public readonly elementTypeId: string,
|
|
53
56
|
public sourceElementId: string,
|
|
54
57
|
public targetElementId: string,
|
|
55
58
|
public args?: Args,
|
|
56
|
-
public readonly kind: string = CreateEdgeOperation.KIND
|
|
59
|
+
public readonly kind: string = CreateEdgeOperation.KIND
|
|
60
|
+
) {}
|
|
57
61
|
}
|
|
58
62
|
|
|
59
63
|
export function isCreateConnectionOperation(object?: any): object is CreateEdgeOperation {
|
|
@@ -62,7 +66,7 @@ export function isCreateConnectionOperation(object?: any): object is CreateEdgeO
|
|
|
62
66
|
|
|
63
67
|
export class DeleteElementOperation implements Operation {
|
|
64
68
|
static readonly KIND = 'deleteElement';
|
|
65
|
-
constructor(readonly elementIds: string[], public readonly kind: string = DeleteElementOperation.KIND) {
|
|
69
|
+
constructor(readonly elementIds: string[], public readonly kind: string = DeleteElementOperation.KIND) {}
|
|
66
70
|
}
|
|
67
71
|
|
|
68
72
|
export function isDeleteElementOperation(object?: any): object is DeleteElementOperation {
|
|
@@ -71,7 +75,7 @@ export function isDeleteElementOperation(object?: any): object is DeleteElementO
|
|
|
71
75
|
|
|
72
76
|
export class ChangeBoundsOperation implements Operation {
|
|
73
77
|
static readonly KIND = 'changeBounds';
|
|
74
|
-
constructor(public newBounds: ElementAndBounds[], public readonly kind: string = ChangeBoundsOperation.KIND) {
|
|
78
|
+
constructor(public newBounds: ElementAndBounds[], public readonly kind: string = ChangeBoundsOperation.KIND) {}
|
|
75
79
|
}
|
|
76
80
|
|
|
77
81
|
export function isChangeBoundsOperation(object?: any): object is ChangeBoundsOperation {
|
|
@@ -80,46 +84,65 @@ export function isChangeBoundsOperation(object?: any): object is ChangeBoundsOpe
|
|
|
80
84
|
|
|
81
85
|
export class ChangeContainerOperation implements Operation {
|
|
82
86
|
static readonly KIND = 'changeContainer';
|
|
83
|
-
constructor(
|
|
87
|
+
constructor(
|
|
88
|
+
public readonly elementId: string,
|
|
84
89
|
public readonly targetContainerId: string,
|
|
85
90
|
public readonly location?: Point,
|
|
86
|
-
public readonly kind: string = ChangeContainerOperation.KIND
|
|
91
|
+
public readonly kind: string = ChangeContainerOperation.KIND
|
|
92
|
+
) {}
|
|
87
93
|
}
|
|
88
94
|
|
|
89
95
|
export function isChangeContainerOperation(object?: any): object is ChangeContainerOperation {
|
|
90
|
-
return
|
|
91
|
-
|
|
92
|
-
|
|
96
|
+
return (
|
|
97
|
+
isAction(object) &&
|
|
98
|
+
object.kind === ChangeContainerOperation.KIND &&
|
|
99
|
+
'elementId' in object &&
|
|
100
|
+
typeof object['elementId'] === 'string' &&
|
|
101
|
+
'targetContainerId' in object &&
|
|
102
|
+
typeof object['targetContainerId'] === 'string'
|
|
103
|
+
);
|
|
93
104
|
}
|
|
94
105
|
|
|
95
106
|
export class ReconnectEdgeOperation implements Operation {
|
|
96
107
|
static readonly KIND = 'reconnectEdge';
|
|
97
|
-
constructor(
|
|
108
|
+
constructor(
|
|
109
|
+
public readonly edgeElementId: string,
|
|
98
110
|
public readonly sourceElementId: string,
|
|
99
111
|
public readonly targetElementId: string,
|
|
100
|
-
public readonly kind: string = ReconnectEdgeOperation.KIND
|
|
112
|
+
public readonly kind: string = ReconnectEdgeOperation.KIND
|
|
113
|
+
) {}
|
|
101
114
|
}
|
|
102
115
|
|
|
103
116
|
export function isReconnectEdgeOperation(object?: any): object is ReconnectEdgeOperation {
|
|
104
|
-
return
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
117
|
+
return (
|
|
118
|
+
isAction(object) &&
|
|
119
|
+
object.kind === ReconnectEdgeOperation.KIND &&
|
|
120
|
+
'edgeElementId' in object &&
|
|
121
|
+
typeof object['edgeElementId'] === 'string' &&
|
|
122
|
+
'sourceElementId' in object &&
|
|
123
|
+
typeof object['sourceElementId'] === 'string' &&
|
|
124
|
+
'targetElementId' in object &&
|
|
125
|
+
typeof object['targetElementId'] === 'string'
|
|
126
|
+
);
|
|
108
127
|
}
|
|
109
128
|
|
|
110
129
|
export class ChangeRoutingPointsOperation implements Operation {
|
|
111
130
|
static readonly KIND = 'changeRoutingPoints';
|
|
112
|
-
constructor(public newRoutingPoints: ElementAndRoutingPoints[], public readonly kind: string = ChangeRoutingPointsOperation.KIND) {
|
|
131
|
+
constructor(public newRoutingPoints: ElementAndRoutingPoints[], public readonly kind: string = ChangeRoutingPointsOperation.KIND) {}
|
|
113
132
|
}
|
|
114
133
|
|
|
115
134
|
export function isChangeRoutingsPointsOperation(object?: any): object is ChangeRoutingPointsOperation {
|
|
116
|
-
return
|
|
117
|
-
|
|
135
|
+
return (
|
|
136
|
+
isAction(object) &&
|
|
137
|
+
object.kind === ChangeRoutingPointsOperation.KIND &&
|
|
138
|
+
'newRoutingPoints' in object &&
|
|
139
|
+
typeof object['newRoutingPoints'] === 'string'
|
|
140
|
+
);
|
|
118
141
|
}
|
|
119
142
|
|
|
120
143
|
export class CompoundOperation implements Operation {
|
|
121
144
|
static readonly KIND = 'compound';
|
|
122
|
-
constructor(public operationList: Operation[], public readonly kind: string = CompoundOperation.KIND) {
|
|
145
|
+
constructor(public operationList: Operation[], public readonly kind: string = CompoundOperation.KIND) {}
|
|
123
146
|
}
|
|
124
147
|
|
|
125
148
|
export function isCompoundOperation(object?: any): object is CompoundOperation {
|
|
@@ -142,7 +165,7 @@ export interface ElementAndRoutingPoints {
|
|
|
142
165
|
}
|
|
143
166
|
|
|
144
167
|
export abstract class TriggerElementCreationAction implements Action {
|
|
145
|
-
constructor(public readonly elementTypeId: string, readonly args?: Args, public readonly kind: string = 'unknown') {
|
|
168
|
+
constructor(public readonly elementTypeId: string, readonly args?: Args, public readonly kind: string = 'unknown') {}
|
|
146
169
|
}
|
|
147
170
|
|
|
148
171
|
export class TriggerNodeCreationAction extends TriggerElementCreationAction {
|
|
@@ -156,7 +179,11 @@ export class TriggerNodeCreationAction extends TriggerElementCreationAction {
|
|
|
156
179
|
export class TriggerEdgeCreationAction extends TriggerElementCreationAction {
|
|
157
180
|
static readonly KIND = 'triggerEdgeCreation';
|
|
158
181
|
|
|
159
|
-
constructor(
|
|
182
|
+
constructor(
|
|
183
|
+
public readonly elementTypeId: string,
|
|
184
|
+
readonly args?: Args,
|
|
185
|
+
public readonly kind: string = TriggerEdgeCreationAction.KIND
|
|
186
|
+
) {
|
|
160
187
|
super(elementTypeId, args, kind);
|
|
161
188
|
}
|
|
162
189
|
}
|
|
@@ -173,6 +200,6 @@ export function isTriggerEdgeCreationAction(object?: any): object is TriggerEdge
|
|
|
173
200
|
return isTriggerElementTypeCreationAction(object) && object.kind === TriggerEdgeCreationAction.KIND;
|
|
174
201
|
}
|
|
175
202
|
|
|
176
|
-
export class LayoutOperation extends LayoutAction implements Operation {
|
|
203
|
+
export class LayoutOperation extends LayoutAction implements Operation {}
|
|
177
204
|
|
|
178
|
-
export class ApplyLabelEditOperation extends ApplyLabelEditAction implements Operation {
|
|
205
|
+
export class ApplyLabelEditOperation extends ApplyLabelEditAction implements Operation {}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2019 EclipseSource and others.
|
|
2
|
+
* Copyright (c) 2019-2021 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
|
|
@@ -29,13 +29,13 @@ import {
|
|
|
29
29
|
|
|
30
30
|
export const resizeFeature = Symbol('resizeFeature');
|
|
31
31
|
|
|
32
|
-
export interface Resizable extends BoundsAware, Selectable {
|
|
33
|
-
}
|
|
32
|
+
export interface Resizable extends BoundsAware, Selectable { }
|
|
34
33
|
|
|
35
34
|
export function isResizable(element: SModelElement): element is SParentElement & Resizable {
|
|
36
35
|
return isBoundsAware(element) && isSelectable(element) && element instanceof SParentElement && element.hasFeature(resizeFeature);
|
|
37
36
|
}
|
|
38
37
|
|
|
38
|
+
// eslint-disable-next-line no-shadow
|
|
39
39
|
export enum ResizeHandleLocation {
|
|
40
40
|
TopLeft = 'top-left',
|
|
41
41
|
TopRight = 'top-right',
|
|
@@ -50,9 +50,11 @@ export function isBoundsAwareMoveable(element: SModelElement): element is SModel
|
|
|
50
50
|
export class SResizeHandle extends SChildElement implements Hoverable {
|
|
51
51
|
static readonly TYPE = 'resize-handle';
|
|
52
52
|
|
|
53
|
-
constructor(
|
|
53
|
+
constructor(
|
|
54
|
+
public readonly location?: ResizeHandleLocation,
|
|
54
55
|
public readonly type: string = SResizeHandle.TYPE,
|
|
55
|
-
public readonly hoverFeedback: boolean = false
|
|
56
|
+
public readonly hoverFeedback: boolean = false
|
|
57
|
+
) {
|
|
56
58
|
super();
|
|
57
59
|
}
|
|
58
60
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2019 EclipseSource and others.
|
|
2
|
+
* Copyright (c) 2019-2021 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
|
|
@@ -25,16 +25,21 @@ export interface IMovementRestrictor {
|
|
|
25
25
|
cssClasses?: string[];
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
export function createMovementRestrictionFeedback(
|
|
28
|
+
export function createMovementRestrictionFeedback(
|
|
29
|
+
element: SModelElement,
|
|
30
|
+
movementRestrictor: IMovementRestrictor
|
|
31
|
+
): ModifyCSSFeedbackAction {
|
|
29
32
|
const elements: SModelElement[] = [element];
|
|
30
33
|
if (element instanceof SParentElement) {
|
|
31
34
|
element.children.filter(child => child instanceof SResizeHandle).forEach(e => elements.push(e));
|
|
32
35
|
}
|
|
33
36
|
return new ModifyCSSFeedbackAction(elements, movementRestrictor.cssClasses);
|
|
34
|
-
|
|
35
37
|
}
|
|
36
38
|
|
|
37
|
-
export function removeMovementRestrictionFeedback(
|
|
39
|
+
export function removeMovementRestrictionFeedback(
|
|
40
|
+
element: SModelElement,
|
|
41
|
+
movementRestrictor: IMovementRestrictor
|
|
42
|
+
): ModifyCSSFeedbackAction {
|
|
38
43
|
const elements: SModelElement[] = [element];
|
|
39
44
|
if (element instanceof SParentElement) {
|
|
40
45
|
element.children.filter(child => child instanceof SResizeHandle).forEach(e => elements.push(e));
|
|
@@ -61,8 +66,12 @@ export class NoOverlapMovmentRestrictor implements IMovementRestrictor {
|
|
|
61
66
|
};
|
|
62
67
|
ghostElement.type = 'Ghost';
|
|
63
68
|
ghostElement.id = element.id;
|
|
64
|
-
return !Array.from(
|
|
65
|
-
.
|
|
69
|
+
return !Array.from(
|
|
70
|
+
element.root.index
|
|
71
|
+
.all()
|
|
72
|
+
.filter(e => e.id !== ghostElement.id && e !== ghostElement.root && e instanceof SNode)
|
|
73
|
+
.map(e => e as SModelElement & BoundsAware)
|
|
74
|
+
).some(e => areOverlapping(e, ghostElement));
|
|
66
75
|
}
|
|
67
76
|
}
|
|
68
77
|
|
|
@@ -85,5 +94,4 @@ export function areOverlapping(element1: SModelElement & BoundsAware, element2:
|
|
|
85
94
|
}
|
|
86
95
|
|
|
87
96
|
return true;
|
|
88
|
-
|
|
89
97
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2019 EclipseSource and others.
|
|
2
|
+
* Copyright (c) 2019-2021 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
|
|
@@ -32,10 +32,13 @@ export class ServerCommandPaletteActionProvider implements ICommandPaletteAction
|
|
|
32
32
|
@inject(EditorContextService) protected editorContext: EditorContextService;
|
|
33
33
|
|
|
34
34
|
getActions(_root: Readonly<SModelElement>, text: string, _lastMousePosition?: Point, index?: number): Promise<LabeledAction[]> {
|
|
35
|
-
const requestAction = new RequestContextActions(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
const requestAction = new RequestContextActions(
|
|
36
|
+
ServerCommandPalette.CONTEXT_ID,
|
|
37
|
+
this.editorContext.get({
|
|
38
|
+
[ServerCommandPalette.TEXT]: text,
|
|
39
|
+
[ServerCommandPalette.INDEX]: index ? index : 0
|
|
40
|
+
})
|
|
41
|
+
);
|
|
39
42
|
return this.actionDispatcher.requestUntil(requestAction).then(response => this.getPaletteActionsFromResponse(response));
|
|
40
43
|
}
|
|
41
44
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2019 EclipseSource and others.
|
|
2
|
+
* Copyright (c) 2019-2021 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
|
|
@@ -20,13 +20,16 @@ import { SelectionServiceAwareContextMenuMouseListener } from './selection-servi
|
|
|
20
20
|
import { ServerContextMenuItemProvider } from './server-context-menu-provider';
|
|
21
21
|
|
|
22
22
|
const glspContextMenuModule = new ContainerModule(bind => {
|
|
23
|
-
bind(TYPES.IContextMenuServiceProvider).toProvider<IContextMenuService>(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
bind(TYPES.IContextMenuServiceProvider).toProvider<IContextMenuService>(
|
|
24
|
+
ctx => () =>
|
|
25
|
+
new Promise<IContextMenuService>((resolve, reject) => {
|
|
26
|
+
if (ctx.container.isBound(TYPES.IContextMenuService)) {
|
|
27
|
+
resolve(ctx.container.get<IContextMenuService>(TYPES.IContextMenuService));
|
|
28
|
+
} else {
|
|
29
|
+
reject();
|
|
30
|
+
}
|
|
31
|
+
})
|
|
32
|
+
);
|
|
30
33
|
bind(TYPES.MouseListener).to(SelectionServiceAwareContextMenuMouseListener);
|
|
31
34
|
bind(TYPES.IContextMenuProviderRegistry).to(ContextMenuProviderRegistry);
|
|
32
35
|
bind(TYPES.IContextMenuItemProvider).to(ServerContextMenuItemProvider);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2019 EclipseSource and others.
|
|
2
|
+
* Copyright (c) 2019-2021 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
|
|
@@ -42,8 +42,9 @@ export class SelectionServiceAwareContextMenuMouseListener extends MouseListener
|
|
|
42
42
|
selectableTarget.selected = true;
|
|
43
43
|
this.selectionService.updateSelection(target.root, [selectableTarget.id], []);
|
|
44
44
|
}
|
|
45
|
-
Promise.all([this.contextMenuService(), this.menuProvider.getItems(target.root, mousePosition)])
|
|
46
|
-
|
|
45
|
+
Promise.all([this.contextMenuService(), this.menuProvider.getItems(target.root, mousePosition)]).then(
|
|
46
|
+
([menuService, menuItems]) => menuService.show(menuItems, mousePosition)
|
|
47
|
+
);
|
|
47
48
|
}
|
|
48
49
|
return [];
|
|
49
50
|
}
|