@eclipse-glsp/client 2.3.0-next.381 → 2.3.0-next.384
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 +2 -2
- package/lib/base/action-dispatcher.d.ts.map +1 -1
- package/lib/base/action-dispatcher.js.map +1 -1
- package/lib/base/auto-complete/base-autocomplete-palette.d.ts +2 -3
- package/lib/base/auto-complete/base-autocomplete-palette.d.ts.map +1 -1
- package/lib/base/auto-complete/base-autocomplete-palette.js +1 -2
- package/lib/base/auto-complete/base-autocomplete-palette.js.map +1 -1
- package/lib/base/editor-context-service.d.ts +2 -3
- package/lib/base/editor-context-service.d.ts.map +1 -1
- package/lib/base/editor-context-service.js +2 -3
- package/lib/base/editor-context-service.js.map +1 -1
- package/lib/base/model/diagram-loader.d.ts +2 -3
- package/lib/base/model/diagram-loader.d.ts.map +1 -1
- package/lib/base/model/diagram-loader.js +2 -3
- package/lib/base/model/diagram-loader.js.map +1 -1
- package/lib/features/accessibility/edge-autocomplete/edge-autocomplete-palette.d.ts +18 -3
- package/lib/features/accessibility/edge-autocomplete/edge-autocomplete-palette.d.ts.map +1 -1
- package/lib/features/accessibility/edge-autocomplete/edge-autocomplete-palette.js +4 -5
- package/lib/features/accessibility/edge-autocomplete/edge-autocomplete-palette.js.map +1 -1
- package/lib/features/accessibility/edge-autocomplete/edge-autocomplete-tool.d.ts +16 -1
- package/lib/features/accessibility/edge-autocomplete/edge-autocomplete-tool.d.ts.map +1 -1
- package/lib/features/accessibility/edge-autocomplete/edge-autocomplete-tool.js +2 -3
- package/lib/features/accessibility/edge-autocomplete/edge-autocomplete-tool.js.map +1 -1
- package/lib/features/accessibility/element-navigation/diagram-navigation-tool.d.ts +2 -3
- package/lib/features/accessibility/element-navigation/diagram-navigation-tool.d.ts.map +1 -1
- package/lib/features/accessibility/element-navigation/diagram-navigation-tool.js +10 -13
- package/lib/features/accessibility/element-navigation/diagram-navigation-tool.js.map +1 -1
- package/lib/features/accessibility/element-navigation/left-right-top-bottom-navigator.d.ts.map +1 -1
- package/lib/features/accessibility/element-navigation/left-right-top-bottom-navigator.js +2 -3
- package/lib/features/accessibility/element-navigation/left-right-top-bottom-navigator.js.map +1 -1
- package/lib/features/accessibility/element-navigation/local-element-navigator.d.ts +2 -3
- package/lib/features/accessibility/element-navigation/local-element-navigator.d.ts.map +1 -1
- package/lib/features/accessibility/element-navigation/local-element-navigator.js +1 -2
- package/lib/features/accessibility/element-navigation/local-element-navigator.js.map +1 -1
- package/lib/features/accessibility/element-navigation/position-navigator.d.ts +2 -3
- package/lib/features/accessibility/element-navigation/position-navigator.d.ts.map +1 -1
- package/lib/features/accessibility/element-navigation/position-navigator.js +3 -5
- package/lib/features/accessibility/element-navigation/position-navigator.js.map +1 -1
- package/lib/features/accessibility/focus-tracker/focus-tracker-tool.d.ts +2 -3
- package/lib/features/accessibility/focus-tracker/focus-tracker-tool.d.ts.map +1 -1
- package/lib/features/accessibility/focus-tracker/focus-tracker-tool.js +2 -3
- package/lib/features/accessibility/focus-tracker/focus-tracker-tool.js.map +1 -1
- package/lib/features/accessibility/global-keylistener-tool.d.ts +17 -3
- package/lib/features/accessibility/global-keylistener-tool.d.ts.map +1 -1
- package/lib/features/accessibility/global-keylistener-tool.js +8 -10
- package/lib/features/accessibility/global-keylistener-tool.js.map +1 -1
- package/lib/features/accessibility/keyboard-grid/keyboard-grid.d.ts +2 -2
- package/lib/features/accessibility/keyboard-grid/keyboard-grid.d.ts.map +1 -1
- package/lib/features/accessibility/keyboard-grid/keyboard-grid.js +3 -4
- package/lib/features/accessibility/keyboard-grid/keyboard-grid.js.map +1 -1
- package/lib/features/accessibility/keyboard-grid/keyboard-node-grid.d.ts +1 -1
- package/lib/features/accessibility/keyboard-grid/keyboard-node-grid.d.ts.map +1 -1
- package/lib/features/accessibility/keyboard-grid/keyboard-node-grid.js +5 -6
- package/lib/features/accessibility/keyboard-grid/keyboard-node-grid.js.map +1 -1
- package/lib/features/accessibility/keyboard-pointer/keyboard-pointer-listener.d.ts.map +1 -1
- package/lib/features/accessibility/keyboard-pointer/keyboard-pointer-listener.js +9 -10
- package/lib/features/accessibility/keyboard-pointer/keyboard-pointer-listener.js.map +1 -1
- package/lib/features/accessibility/keyboard-tool-palette/keyboard-tool-palette.d.ts +1 -2
- package/lib/features/accessibility/keyboard-tool-palette/keyboard-tool-palette.d.ts.map +1 -1
- package/lib/features/accessibility/keyboard-tool-palette/keyboard-tool-palette.js +7 -8
- package/lib/features/accessibility/keyboard-tool-palette/keyboard-tool-palette.js.map +1 -1
- package/lib/features/accessibility/resize-key-tool/resize-key-tool.d.ts +2 -3
- package/lib/features/accessibility/resize-key-tool/resize-key-tool.d.ts.map +1 -1
- package/lib/features/accessibility/resize-key-tool/resize-key-tool.js +7 -9
- package/lib/features/accessibility/resize-key-tool/resize-key-tool.js.map +1 -1
- package/lib/features/accessibility/search/search-palette.d.ts.map +1 -1
- package/lib/features/accessibility/search/search-palette.js +5 -6
- package/lib/features/accessibility/search/search-palette.js.map +1 -1
- package/lib/features/accessibility/search/search-tool.d.ts +2 -3
- package/lib/features/accessibility/search/search-tool.d.ts.map +1 -1
- package/lib/features/accessibility/search/search-tool.js +3 -5
- package/lib/features/accessibility/search/search-tool.js.map +1 -1
- package/lib/features/accessibility/toast/toast-tool.d.ts +2 -3
- package/lib/features/accessibility/toast/toast-tool.d.ts.map +1 -1
- package/lib/features/accessibility/toast/toast-tool.js +1 -2
- package/lib/features/accessibility/toast/toast-tool.js.map +1 -1
- package/lib/features/accessibility/view-key-tools/deselect-key-tool.d.ts.map +1 -1
- package/lib/features/accessibility/view-key-tools/deselect-key-tool.js +2 -4
- package/lib/features/accessibility/view-key-tools/deselect-key-tool.js.map +1 -1
- package/lib/features/accessibility/view-key-tools/movement-key-tool.d.ts +2 -3
- package/lib/features/accessibility/view-key-tools/movement-key-tool.d.ts.map +1 -1
- package/lib/features/accessibility/view-key-tools/movement-key-tool.js +5 -7
- package/lib/features/accessibility/view-key-tools/movement-key-tool.js.map +1 -1
- package/lib/features/accessibility/view-key-tools/zoom-key-tool.d.ts +3 -4
- package/lib/features/accessibility/view-key-tools/zoom-key-tool.d.ts.map +1 -1
- package/lib/features/accessibility/view-key-tools/zoom-key-tool.js +12 -14
- package/lib/features/accessibility/view-key-tools/zoom-key-tool.js.map +1 -1
- package/lib/features/bounds/local-bounds.d.ts +2 -2
- package/lib/features/bounds/local-bounds.d.ts.map +1 -1
- package/lib/features/bounds/local-bounds.js.map +1 -1
- package/lib/features/bounds/set-bounds-feedback-command.d.ts +2 -3
- package/lib/features/bounds/set-bounds-feedback-command.d.ts.map +1 -1
- package/lib/features/bounds/set-bounds-feedback-command.js +1 -2
- package/lib/features/bounds/set-bounds-feedback-command.js.map +1 -1
- package/lib/features/command-palette/server-command-palette-provider.d.ts +17 -3
- package/lib/features/command-palette/server-command-palette-provider.d.ts.map +1 -1
- package/lib/features/command-palette/server-command-palette-provider.js +2 -3
- package/lib/features/command-palette/server-command-palette-provider.js.map +1 -1
- package/lib/features/context-menu/glsp-context-menu-mouse-listener.d.ts +2 -3
- package/lib/features/context-menu/glsp-context-menu-mouse-listener.d.ts.map +1 -1
- package/lib/features/context-menu/glsp-context-menu-mouse-listener.js +2 -3
- package/lib/features/context-menu/glsp-context-menu-mouse-listener.js.map +1 -1
- package/lib/features/context-menu/server-context-menu-provider.d.ts +17 -3
- package/lib/features/context-menu/server-context-menu-provider.d.ts.map +1 -1
- package/lib/features/context-menu/server-context-menu-provider.js +2 -3
- package/lib/features/context-menu/server-context-menu-provider.js.map +1 -1
- package/lib/features/copy-paste/copy-paste-handler.d.ts +17 -3
- package/lib/features/copy-paste/copy-paste-handler.d.ts.map +1 -1
- package/lib/features/copy-paste/copy-paste-handler.js +2 -3
- package/lib/features/copy-paste/copy-paste-handler.js.map +1 -1
- package/lib/features/element-template/add-template-element.d.ts +2 -3
- package/lib/features/element-template/add-template-element.d.ts.map +1 -1
- package/lib/features/element-template/add-template-element.js +1 -2
- package/lib/features/element-template/add-template-element.js.map +1 -1
- package/lib/features/hints/type-hint-provider.d.ts +2 -3
- package/lib/features/hints/type-hint-provider.d.ts.map +1 -1
- package/lib/features/hints/type-hint-provider.js +2 -3
- package/lib/features/hints/type-hint-provider.js.map +1 -1
- package/lib/features/label-edit/edit-label-validator.d.ts +17 -3
- package/lib/features/label-edit/edit-label-validator.d.ts.map +1 -1
- package/lib/features/label-edit/edit-label-validator.js +2 -3
- package/lib/features/label-edit/edit-label-validator.js.map +1 -1
- package/lib/features/status/status-overlay.d.ts +2 -3
- package/lib/features/status/status-overlay.d.ts.map +1 -1
- package/lib/features/status/status-overlay.js +2 -3
- package/lib/features/status/status-overlay.js.map +1 -1
- package/lib/features/tool-palette/tool-palette.d.ts +2 -3
- package/lib/features/tool-palette/tool-palette.d.ts.map +1 -1
- package/lib/features/tool-palette/tool-palette.js +2 -3
- package/lib/features/tool-palette/tool-palette.js.map +1 -1
- package/lib/features/tools/base-tools.d.ts +2 -3
- package/lib/features/tools/base-tools.d.ts.map +1 -1
- package/lib/features/tools/base-tools.js +1 -2
- package/lib/features/tools/base-tools.js.map +1 -1
- package/lib/features/tools/edge-creation/edge-creation-tool.d.ts +3 -4
- package/lib/features/tools/edge-creation/edge-creation-tool.d.ts.map +1 -1
- package/lib/features/tools/edge-creation/edge-creation-tool.js.map +1 -1
- package/lib/features/validation/marker-navigator.d.ts +2 -3
- package/lib/features/validation/marker-navigator.d.ts.map +1 -1
- package/lib/features/validation/marker-navigator.js +1 -2
- package/lib/features/validation/marker-navigator.js.map +1 -1
- package/package.json +3 -3
- package/src/base/action-dispatcher.ts +11 -2
- package/src/base/auto-complete/base-autocomplete-palette.ts +2 -3
- package/src/base/editor-context-service.ts +3 -3
- package/src/base/model/diagram-loader.ts +3 -3
- package/src/features/accessibility/edge-autocomplete/edge-autocomplete-palette.ts +10 -10
- package/src/features/accessibility/edge-autocomplete/edge-autocomplete-tool.ts +1 -2
- package/src/features/accessibility/element-navigation/diagram-navigation-tool.ts +6 -6
- package/src/features/accessibility/element-navigation/left-right-top-bottom-navigator.ts +2 -3
- package/src/features/accessibility/element-navigation/local-element-navigator.ts +2 -3
- package/src/features/accessibility/element-navigation/position-navigator.ts +14 -4
- package/src/features/accessibility/focus-tracker/focus-tracker-tool.ts +2 -3
- package/src/features/accessibility/global-keylistener-tool.ts +5 -7
- package/src/features/accessibility/keyboard-grid/keyboard-grid.ts +4 -3
- package/src/features/accessibility/keyboard-grid/keyboard-node-grid.ts +4 -5
- package/src/features/accessibility/keyboard-pointer/keyboard-pointer-listener.ts +3 -4
- package/src/features/accessibility/keyboard-tool-palette/keyboard-tool-palette.ts +5 -4
- package/src/features/accessibility/resize-key-tool/resize-key-tool.ts +2 -4
- package/src/features/accessibility/search/search-palette.ts +2 -2
- package/src/features/accessibility/search/search-tool.ts +11 -4
- package/src/features/accessibility/toast/toast-tool.ts +2 -3
- package/src/features/accessibility/view-key-tools/deselect-key-tool.ts +12 -3
- package/src/features/accessibility/view-key-tools/movement-key-tool.ts +2 -4
- package/src/features/accessibility/view-key-tools/zoom-key-tool.ts +12 -12
- package/src/features/bounds/local-bounds.ts +2 -2
- package/src/features/bounds/set-bounds-feedback-command.ts +2 -2
- package/src/features/command-palette/server-command-palette-provider.ts +4 -4
- package/src/features/context-menu/glsp-context-menu-mouse-listener.ts +3 -3
- package/src/features/context-menu/server-context-menu-provider.ts +4 -4
- package/src/features/copy-paste/copy-paste-handler.ts +4 -4
- package/src/features/element-template/add-template-element.ts +2 -2
- package/src/features/hints/type-hint-provider.spec.ts +3 -1
- package/src/features/hints/type-hint-provider.ts +3 -3
- package/src/features/label-edit/edit-label-validator.ts +4 -4
- package/src/features/layout/layout-elements-action.spec.ts +12 -0
- package/src/features/status/status-overlay.ts +3 -4
- package/src/features/tool-palette/tool-palette.ts +3 -3
- package/src/features/tools/base-tools.ts +2 -3
- package/src/features/tools/edge-creation/edge-creation-tool.ts +2 -2
- package/src/features/validation/marker-navigator.ts +2 -2
|
@@ -14,32 +14,32 @@
|
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
|
|
17
|
-
import { inject, injectable } from 'inversify';
|
|
18
|
-
import { matchesKeystroke } from 'sprotty/lib/utils/keyboard';
|
|
19
17
|
import {
|
|
20
18
|
Action,
|
|
21
19
|
CenterAction,
|
|
20
|
+
GModelElement,
|
|
21
|
+
GModelRoot,
|
|
22
|
+
IActionDispatcher,
|
|
22
23
|
KeyListener,
|
|
23
24
|
KeyTool,
|
|
24
25
|
Point,
|
|
25
|
-
GModelElement,
|
|
26
|
-
GModelRoot,
|
|
27
26
|
SetViewportAction,
|
|
28
27
|
TYPES,
|
|
29
28
|
Viewport,
|
|
30
|
-
isViewport
|
|
29
|
+
isViewport,
|
|
30
|
+
matchesKeystroke
|
|
31
31
|
} from '@eclipse-glsp/sprotty';
|
|
32
|
-
import {
|
|
32
|
+
import { inject, injectable } from 'inversify';
|
|
33
|
+
import { EditorContextService } from '../../../base/editor-context-service';
|
|
33
34
|
import { SelectionService } from '../../../base/selection-service';
|
|
34
35
|
import { Tool } from '../../../base/tool-manager/tool';
|
|
35
|
-
import { SetAccessibleKeyShortcutAction } from '../key-shortcut/accessible-key-shortcut';
|
|
36
|
-
import { ZoomElementAction, ZoomViewportAction } from '../move-zoom/zoom-handler';
|
|
37
|
-
import { EnableKeyboardGridAction, KeyboardGridCellSelectedAction, KeyboardGridKeyboardEventAction } from '../keyboard-grid/action';
|
|
38
36
|
import { getAbsolutePositionByPoint } from '../../../utils/viewpoint-util';
|
|
39
|
-
import { EditorContextService } from '../../../base/editor-context-service';
|
|
40
|
-
import { HideToastAction, ShowToastMessageAction } from '../toast/toast-handler';
|
|
41
37
|
import { ElementNavigatorKeyListener } from '../element-navigation/diagram-navigation-tool';
|
|
38
|
+
import { SetAccessibleKeyShortcutAction } from '../key-shortcut/accessible-key-shortcut';
|
|
39
|
+
import { EnableKeyboardGridAction, KeyboardGridCellSelectedAction, KeyboardGridKeyboardEventAction } from '../keyboard-grid/action';
|
|
40
|
+
import { ZoomElementAction, ZoomViewportAction } from '../move-zoom/zoom-handler';
|
|
42
41
|
import * as messages from '../toast/messages.json';
|
|
42
|
+
import { HideToastAction, ShowToastMessageAction } from '../toast/toast-handler';
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
45
|
* Zoom viewport and elements when its focused and arrow keys are hit.
|
|
@@ -53,7 +53,7 @@ export class ZoomKeyTool implements Tool {
|
|
|
53
53
|
protected readonly zoomKeyListener = new ZoomKeyListener(this);
|
|
54
54
|
|
|
55
55
|
@inject(KeyTool) protected readonly keytool: KeyTool;
|
|
56
|
-
@inject(TYPES.IActionDispatcher) readonly actionDispatcher:
|
|
56
|
+
@inject(TYPES.IActionDispatcher) readonly actionDispatcher: IActionDispatcher;
|
|
57
57
|
@inject(SelectionService) selectionService: SelectionService;
|
|
58
58
|
@inject(EditorContextService)
|
|
59
59
|
protected editorContextService: EditorContextService;
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
import {
|
|
17
17
|
Action,
|
|
18
|
-
ActionDispatcher,
|
|
19
18
|
Command,
|
|
20
19
|
CommandExecutionContext,
|
|
21
20
|
CommandResult,
|
|
@@ -24,6 +23,7 @@ import {
|
|
|
24
23
|
ComputedBoundsApplicator,
|
|
25
24
|
GModelRoot,
|
|
26
25
|
GModelRootSchema,
|
|
26
|
+
IActionDispatcher,
|
|
27
27
|
RequestBoundsAction,
|
|
28
28
|
TYPES,
|
|
29
29
|
ViewerOptions,
|
|
@@ -53,7 +53,7 @@ export namespace LocalRequestBoundsAction {
|
|
|
53
53
|
|
|
54
54
|
export function fromCommand(
|
|
55
55
|
{ root }: CommandExecutionContext,
|
|
56
|
-
actionDispatcher:
|
|
56
|
+
actionDispatcher: IActionDispatcher,
|
|
57
57
|
cause?: Action,
|
|
58
58
|
elementIDs?: string[]
|
|
59
59
|
): CommandResult {
|
|
@@ -18,13 +18,13 @@ import {
|
|
|
18
18
|
CommandExecutionContext,
|
|
19
19
|
CommandReturn,
|
|
20
20
|
ElementAndBounds,
|
|
21
|
+
IActionDispatcher,
|
|
21
22
|
SetBoundsAction,
|
|
22
23
|
SetBoundsCommand,
|
|
23
24
|
TYPES,
|
|
24
25
|
isLayoutContainer
|
|
25
26
|
} from '@eclipse-glsp/sprotty';
|
|
26
27
|
import { inject, injectable } from 'inversify';
|
|
27
|
-
import { GLSPActionDispatcher } from '../../base/action-dispatcher';
|
|
28
28
|
import { FeedbackCommand } from '../../base/feedback/feedback-command';
|
|
29
29
|
import { Ranked } from '../../base/ranked';
|
|
30
30
|
import { LocalRequestBoundsAction } from './local-bounds';
|
|
@@ -51,7 +51,7 @@ export class SetBoundsFeedbackCommand extends SetBoundsCommand implements Feedba
|
|
|
51
51
|
|
|
52
52
|
readonly rank: number = Ranked.DEFAULT_RANK;
|
|
53
53
|
|
|
54
|
-
@inject(TYPES.IActionDispatcher) protected actionDispatcher:
|
|
54
|
+
@inject(TYPES.IActionDispatcher) protected actionDispatcher: IActionDispatcher;
|
|
55
55
|
|
|
56
56
|
override execute(context: CommandExecutionContext): CommandReturn {
|
|
57
57
|
super.execute(context);
|
|
@@ -13,18 +13,18 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
import { inject, injectable } from 'inversify';
|
|
17
16
|
import {
|
|
18
17
|
Action,
|
|
18
|
+
GModelElement,
|
|
19
|
+
IActionDispatcher,
|
|
19
20
|
ICommandPaletteActionProvider,
|
|
20
21
|
LabeledAction,
|
|
21
22
|
Point,
|
|
22
23
|
RequestContextActions,
|
|
23
|
-
GModelElement,
|
|
24
24
|
SetContextActions,
|
|
25
25
|
TYPES
|
|
26
26
|
} from '@eclipse-glsp/sprotty';
|
|
27
|
-
import {
|
|
27
|
+
import { inject, injectable } from 'inversify';
|
|
28
28
|
import { EditorContextService } from '../../base/editor-context-service';
|
|
29
29
|
|
|
30
30
|
export namespace ServerCommandPalette {
|
|
@@ -35,7 +35,7 @@ export namespace ServerCommandPalette {
|
|
|
35
35
|
|
|
36
36
|
@injectable()
|
|
37
37
|
export class ServerCommandPaletteActionProvider implements ICommandPaletteActionProvider {
|
|
38
|
-
@inject(TYPES.IActionDispatcher) protected actionDispatcher:
|
|
38
|
+
@inject(TYPES.IActionDispatcher) protected actionDispatcher: IActionDispatcher;
|
|
39
39
|
@inject(EditorContextService) protected editorContext: EditorContextService;
|
|
40
40
|
|
|
41
41
|
async getActions(_root: Readonly<GModelElement>, text: string, _lastMousePosition?: Point, index?: number): Promise<LabeledAction[]> {
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
Action,
|
|
18
18
|
ContextMenuProviderRegistry,
|
|
19
19
|
GModelElement,
|
|
20
|
+
IActionDispatcher,
|
|
20
21
|
IContextMenuService,
|
|
21
22
|
IContextMenuServiceProvider,
|
|
22
23
|
MouseListener,
|
|
@@ -26,7 +27,6 @@ import {
|
|
|
26
27
|
isSelectable
|
|
27
28
|
} from '@eclipse-glsp/sprotty';
|
|
28
29
|
import { inject, injectable, optional, postConstruct } from 'inversify';
|
|
29
|
-
import { GLSPActionDispatcher } from '../../base/action-dispatcher';
|
|
30
30
|
import { FocusStateChangedAction } from '../../base/focus/focus-state-change-action';
|
|
31
31
|
|
|
32
32
|
@injectable()
|
|
@@ -39,8 +39,8 @@ export class GLSPContextMenuMouseListener extends MouseListener {
|
|
|
39
39
|
@optional()
|
|
40
40
|
protected menuProvider?: ContextMenuProviderRegistry;
|
|
41
41
|
|
|
42
|
-
@inject(
|
|
43
|
-
protected actionDispatcher:
|
|
42
|
+
@inject(TYPES.IActionDispatcher)
|
|
43
|
+
protected actionDispatcher: IActionDispatcher;
|
|
44
44
|
|
|
45
45
|
protected menuService?: IContextMenuService;
|
|
46
46
|
|
|
@@ -13,19 +13,19 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
import { inject, injectable } from 'inversify';
|
|
17
16
|
import {
|
|
18
17
|
Action,
|
|
18
|
+
GModelElement,
|
|
19
|
+
IActionDispatcher,
|
|
19
20
|
IContextMenuItemProvider,
|
|
20
21
|
LabeledAction,
|
|
21
22
|
Point,
|
|
22
23
|
RequestContextActions,
|
|
23
|
-
GModelElement,
|
|
24
24
|
SetContextActions,
|
|
25
25
|
TYPES,
|
|
26
26
|
isSelected
|
|
27
27
|
} from '@eclipse-glsp/sprotty';
|
|
28
|
-
import {
|
|
28
|
+
import { inject, injectable } from 'inversify';
|
|
29
29
|
import { EditorContextService } from '../../base/editor-context-service';
|
|
30
30
|
|
|
31
31
|
export namespace ServerContextMenu {
|
|
@@ -34,7 +34,7 @@ export namespace ServerContextMenu {
|
|
|
34
34
|
|
|
35
35
|
@injectable()
|
|
36
36
|
export class ServerContextMenuItemProvider implements IContextMenuItemProvider {
|
|
37
|
-
@inject(TYPES.IActionDispatcher) protected actionDispatcher:
|
|
37
|
+
@inject(TYPES.IActionDispatcher) protected actionDispatcher: IActionDispatcher;
|
|
38
38
|
@inject(EditorContextService) protected editorContext: EditorContextService;
|
|
39
39
|
|
|
40
40
|
async getItems(root: Readonly<GModelElement>, _lastMousePosition?: Point): Promise<LabeledAction[]> {
|
|
@@ -13,18 +13,18 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
import { inject, injectable } from 'inversify';
|
|
17
|
-
import { v4 as uuid } from 'uuid';
|
|
18
16
|
import {
|
|
19
17
|
ClipboardData,
|
|
20
18
|
CutOperation,
|
|
19
|
+
IActionDispatcher,
|
|
21
20
|
PasteOperation,
|
|
22
21
|
RequestClipboardDataAction,
|
|
23
22
|
SetClipboardDataAction,
|
|
24
23
|
TYPES,
|
|
25
24
|
ViewerOptions
|
|
26
25
|
} from '@eclipse-glsp/sprotty';
|
|
27
|
-
import {
|
|
26
|
+
import { inject, injectable } from 'inversify';
|
|
27
|
+
import { v4 as uuid } from 'uuid';
|
|
28
28
|
import { EditorContextService } from '../../base/editor-context-service';
|
|
29
29
|
|
|
30
30
|
export interface ICopyPasteHandler {
|
|
@@ -100,7 +100,7 @@ const CLIPBOARD_DATA_FORMAT = 'text/plain';
|
|
|
100
100
|
|
|
101
101
|
@injectable()
|
|
102
102
|
export class ServerCopyPasteHandler implements ICopyPasteHandler {
|
|
103
|
-
@inject(TYPES.IActionDispatcher) protected actionDispatcher:
|
|
103
|
+
@inject(TYPES.IActionDispatcher) protected actionDispatcher: IActionDispatcher;
|
|
104
104
|
@inject(TYPES.ViewerOptions) protected viewerOptions: ViewerOptions;
|
|
105
105
|
@inject(TYPES.IAsyncClipboardService) protected clipboardService: IAsyncClipboardService;
|
|
106
106
|
@inject(EditorContextService) protected editorContext: EditorContextService;
|
|
@@ -21,12 +21,12 @@ import {
|
|
|
21
21
|
ElementTemplate,
|
|
22
22
|
GChildElement,
|
|
23
23
|
GModelElementSchema,
|
|
24
|
+
IActionDispatcher,
|
|
24
25
|
TYPES,
|
|
25
26
|
distinctAdd,
|
|
26
27
|
remove
|
|
27
28
|
} from '@eclipse-glsp/sprotty';
|
|
28
29
|
import { inject, injectable } from 'inversify';
|
|
29
|
-
import { GLSPActionDispatcher } from '../../base/action-dispatcher';
|
|
30
30
|
import { FeedbackCommand } from '../../base/feedback/feedback-command';
|
|
31
31
|
import { isNotUndefined } from '../../utils/gmodel-util';
|
|
32
32
|
import { LocalRequestBoundsAction } from '../bounds/local-bounds';
|
|
@@ -57,7 +57,7 @@ export function getTemplateElementId(template: ElementTemplate): string {
|
|
|
57
57
|
export class AddTemplateElementsFeedbackCommand extends FeedbackCommand {
|
|
58
58
|
static readonly KIND = AddTemplateElementsAction.KIND;
|
|
59
59
|
|
|
60
|
-
@inject(TYPES.IActionDispatcher) protected actionDispatcher:
|
|
60
|
+
@inject(TYPES.IActionDispatcher) protected actionDispatcher: IActionDispatcher;
|
|
61
61
|
|
|
62
62
|
constructor(@inject(TYPES.Action) readonly action: AddTemplateElementsAction) {
|
|
63
63
|
super();
|
|
@@ -37,15 +37,16 @@ import { Container } from 'inversify';
|
|
|
37
37
|
import * as sinon from 'sinon';
|
|
38
38
|
import { GLSPActionDispatcher } from '../../base/action-dispatcher';
|
|
39
39
|
import { FeedbackActionDispatcher } from '../../base/feedback/feedback-action-dispatcher-default';
|
|
40
|
+
import { FeedbackEmitter } from '../../base/feedback/feedback-emitter';
|
|
40
41
|
import { GEdge } from '../../model';
|
|
41
42
|
import { isResizable } from '../change-bounds/model';
|
|
42
43
|
import { isReconnectable } from '../reconnect/model';
|
|
43
44
|
import { Containable, isContainable, isReparentable } from './model';
|
|
44
45
|
import { ApplyTypeHintsAction, ApplyTypeHintsCommand, ITypeHintProvider, TypeHintProvider } from './type-hint-provider';
|
|
45
|
-
import { FeedbackEmitter } from '../../base/feedback/feedback-emitter';
|
|
46
46
|
describe('TypeHintProvider', () => {
|
|
47
47
|
const container = new Container();
|
|
48
48
|
container.bind(GLSPActionDispatcher).toConstantValue(sinon.createStubInstance(GLSPActionDispatcher));
|
|
49
|
+
container.bind(TYPES.IActionDispatcher).toService(GLSPActionDispatcher);
|
|
49
50
|
const stub = sinon.createStubInstance(FeedbackActionDispatcher);
|
|
50
51
|
stub.createEmitter.returns(new FeedbackEmitter(stub));
|
|
51
52
|
container.bind(TYPES.IFeedbackActionDispatcher).toConstantValue(stub);
|
|
@@ -163,6 +164,7 @@ describe('ApplyTypeHintCommand', () => {
|
|
|
163
164
|
getShapeTypeHint: () => undefined
|
|
164
165
|
});
|
|
165
166
|
container.bind(GLSPActionDispatcher).toConstantValue(sandbox.createStubInstance(GLSPActionDispatcher));
|
|
167
|
+
container.bind(TYPES.IActionDispatcher).toService(GLSPActionDispatcher);
|
|
166
168
|
container.bind(TYPES.IFeedbackActionDispatcher).toConstantValue(sandbox.createStubInstance(FeedbackActionDispatcher));
|
|
167
169
|
container.bind(TYPES.ITypeHintProvider).toConstantValue(typeHintProviderMock);
|
|
168
170
|
bindOrRebind(container, TYPES.Action).toConstantValue(ApplyTypeHintsAction.create());
|
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
GModelRoot,
|
|
24
24
|
GRoutableElement,
|
|
25
25
|
GShapeElement,
|
|
26
|
+
IActionDispatcher,
|
|
26
27
|
IActionHandler,
|
|
27
28
|
RequestTypeHintsAction,
|
|
28
29
|
SetTypeHintsAction,
|
|
@@ -37,7 +38,6 @@ import {
|
|
|
37
38
|
} from '@eclipse-glsp/sprotty';
|
|
38
39
|
import { inject, injectable, postConstruct } from 'inversify';
|
|
39
40
|
|
|
40
|
-
import { GLSPActionDispatcher } from '../../base/action-dispatcher';
|
|
41
41
|
import { IFeedbackActionDispatcher } from '../../base/feedback/feedback-action-dispatcher';
|
|
42
42
|
import { FeedbackCommand } from '../../base/feedback/feedback-command';
|
|
43
43
|
import { FeedbackEmitter } from '../../base/feedback/feedback-emitter';
|
|
@@ -202,8 +202,8 @@ export class TypeHintProvider implements IActionHandler, ITypeHintProvider, IDia
|
|
|
202
202
|
@inject(TYPES.IFeedbackActionDispatcher)
|
|
203
203
|
protected feedbackActionDispatcher: IFeedbackActionDispatcher;
|
|
204
204
|
|
|
205
|
-
@inject(
|
|
206
|
-
protected actionDispatcher:
|
|
205
|
+
@inject(TYPES.IActionDispatcher)
|
|
206
|
+
protected actionDispatcher: IActionDispatcher;
|
|
207
207
|
|
|
208
208
|
protected typeHintsFeedback: FeedbackEmitter;
|
|
209
209
|
protected shapeHints: Map<string, ShapeTypeHint> = new Map();
|
|
@@ -13,21 +13,21 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
import { inject, injectable } from 'inversify';
|
|
17
16
|
import {
|
|
18
17
|
Action,
|
|
19
18
|
EditLabelValidationResult,
|
|
20
19
|
EditableLabel,
|
|
20
|
+
GModelElement,
|
|
21
|
+
IActionDispatcher,
|
|
21
22
|
IEditLabelValidationDecorator,
|
|
22
23
|
IEditLabelValidator,
|
|
23
24
|
RequestEditValidationAction,
|
|
24
|
-
GModelElement,
|
|
25
25
|
SetEditValidationResultAction,
|
|
26
26
|
Severity,
|
|
27
27
|
TYPES,
|
|
28
28
|
ValidationStatus
|
|
29
29
|
} from '@eclipse-glsp/sprotty';
|
|
30
|
-
import {
|
|
30
|
+
import { inject, injectable } from 'inversify';
|
|
31
31
|
|
|
32
32
|
export namespace LabelEditValidation {
|
|
33
33
|
export const CONTEXT_ID = 'label-edit';
|
|
@@ -50,7 +50,7 @@ export namespace LabelEditValidation {
|
|
|
50
50
|
|
|
51
51
|
@injectable()
|
|
52
52
|
export class ServerEditLabelValidator implements IEditLabelValidator {
|
|
53
|
-
@inject(TYPES.IActionDispatcher) protected actionDispatcher:
|
|
53
|
+
@inject(TYPES.IActionDispatcher) protected actionDispatcher: IActionDispatcher;
|
|
54
54
|
|
|
55
55
|
async validate(value: string, label: EditableLabel & GModelElement): Promise<EditLabelValidationResult> {
|
|
56
56
|
const action = LabelEditValidation.createValidationRequestAction(value, label.id);
|
|
@@ -57,6 +57,18 @@ import {
|
|
|
57
57
|
|
|
58
58
|
class MockActionDispatcher implements IActionDispatcher {
|
|
59
59
|
constructor(public dispatchedActions: Action[] = []) {}
|
|
60
|
+
requestUntil<Res extends ResponseAction>(
|
|
61
|
+
action: RequestAction<Res>,
|
|
62
|
+
timeoutMs?: number | undefined,
|
|
63
|
+
rejectOnTimeout?: boolean | undefined
|
|
64
|
+
): Promise<Res | undefined> {
|
|
65
|
+
throw new Error('Method not implemented.');
|
|
66
|
+
}
|
|
67
|
+
dispatchOnceModelInitialized(...actions: Action[]): void {}
|
|
68
|
+
onceModelInitialized(): Promise<void> {
|
|
69
|
+
return Promise.resolve();
|
|
70
|
+
}
|
|
71
|
+
dispatchAfterNextUpdate(...actions: Action[]): void {}
|
|
60
72
|
dispatch(action: Action): Promise<void> {
|
|
61
73
|
this.dispatchedActions.push(action);
|
|
62
74
|
return Promise.resolve();
|
|
@@ -13,9 +13,8 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
import { IActionHandler, StatusAction, codiconCSSClasses } from '@eclipse-glsp/sprotty';
|
|
16
|
+
import { IActionDispatcher, IActionHandler, StatusAction, TYPES, codiconCSSClasses } from '@eclipse-glsp/sprotty';
|
|
17
17
|
import { inject, injectable } from 'inversify';
|
|
18
|
-
import { GLSPActionDispatcher } from '../../base/action-dispatcher';
|
|
19
18
|
import { EditorContextService } from '../../base/editor-context-service';
|
|
20
19
|
import { IDiagramStartup } from '../../base/model/diagram-loader';
|
|
21
20
|
import { GLSPAbstractUIExtension } from '../../base/ui-extension/ui-extension';
|
|
@@ -27,8 +26,8 @@ import { GLSPAbstractUIExtension } from '../../base/ui-extension/ui-extension';
|
|
|
27
26
|
export class StatusOverlay extends GLSPAbstractUIExtension implements IActionHandler, IDiagramStartup {
|
|
28
27
|
static readonly ID = 'glsp.server.status.overlay';
|
|
29
28
|
|
|
30
|
-
@inject(
|
|
31
|
-
protected actionDispatcher:
|
|
29
|
+
@inject(TYPES.IActionDispatcher)
|
|
30
|
+
protected actionDispatcher: IActionDispatcher;
|
|
32
31
|
|
|
33
32
|
@inject(EditorContextService)
|
|
34
33
|
protected editorContext: EditorContextService;
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
import {
|
|
17
17
|
Action,
|
|
18
18
|
GModelRoot,
|
|
19
|
+
IActionDispatcher,
|
|
19
20
|
IActionHandler,
|
|
20
21
|
ICommand,
|
|
21
22
|
MarkersReason,
|
|
@@ -32,7 +33,6 @@ import {
|
|
|
32
33
|
matchesKeystroke
|
|
33
34
|
} from '@eclipse-glsp/sprotty';
|
|
34
35
|
import { inject, injectable, optional, postConstruct } from 'inversify';
|
|
35
|
-
import { GLSPActionDispatcher } from '../../base/action-dispatcher';
|
|
36
36
|
import { EditorContextService, IEditModeListener } from '../../base/editor-context-service';
|
|
37
37
|
import { FocusTracker } from '../../base/focus/focus-tracker';
|
|
38
38
|
import { IDiagramStartup } from '../../base/model/diagram-loader';
|
|
@@ -69,8 +69,8 @@ export namespace EnableToolPaletteAction {
|
|
|
69
69
|
export class ToolPalette extends GLSPAbstractUIExtension implements IActionHandler, IEditModeListener, IDiagramStartup {
|
|
70
70
|
static readonly ID = 'tool-palette';
|
|
71
71
|
|
|
72
|
-
@inject(
|
|
73
|
-
protected actionDispatcher:
|
|
72
|
+
@inject(TYPES.IActionDispatcher)
|
|
73
|
+
protected actionDispatcher: IActionDispatcher;
|
|
74
74
|
|
|
75
75
|
@inject(EditorContextService)
|
|
76
76
|
protected editorContext: EditorContextService;
|
|
@@ -13,9 +13,8 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
import { Action, Disposable, DisposableCollection, IActionHandler, TYPES } from '@eclipse-glsp/sprotty';
|
|
16
|
+
import { Action, Disposable, DisposableCollection, IActionDispatcher, IActionHandler, TYPES } from '@eclipse-glsp/sprotty';
|
|
17
17
|
import { inject, injectable } from 'inversify';
|
|
18
|
-
import { GLSPActionDispatcher } from '../../base/action-dispatcher';
|
|
19
18
|
import { EditorContextService } from '../../base/editor-context-service';
|
|
20
19
|
import { IFeedbackActionDispatcher, IFeedbackEmitter, MaybeActions } from '../../base/feedback/feedback-action-dispatcher';
|
|
21
20
|
import { FeedbackEmitter } from '../../base/feedback/feedback-emitter';
|
|
@@ -59,7 +58,7 @@ export interface FeedbackAwareTool extends Tool {
|
|
|
59
58
|
@injectable()
|
|
60
59
|
export abstract class BaseEditTool implements FeedbackAwareTool {
|
|
61
60
|
@inject(TYPES.IFeedbackActionDispatcher) protected feedbackDispatcher: IFeedbackActionDispatcher;
|
|
62
|
-
@inject(TYPES.IActionDispatcher) protected actionDispatcher:
|
|
61
|
+
@inject(TYPES.IActionDispatcher) protected actionDispatcher: IActionDispatcher;
|
|
63
62
|
@inject(GLSPMouseTool) protected mouseTool: GLSPMouseTool;
|
|
64
63
|
@inject(GLSPKeyTool) protected keyTool: GLSPKeyTool;
|
|
65
64
|
@inject(EditorContextService) protected readonly editorContext: EditorContextService;
|
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
Args,
|
|
20
20
|
CreateEdgeOperation,
|
|
21
21
|
GModelElement,
|
|
22
|
+
IActionDispatcher,
|
|
22
23
|
RequestCheckEdgeAction,
|
|
23
24
|
TYPES,
|
|
24
25
|
TriggerEdgeCreationAction,
|
|
@@ -27,7 +28,6 @@ import {
|
|
|
27
28
|
isCtrlOrCmd
|
|
28
29
|
} from '@eclipse-glsp/sprotty';
|
|
29
30
|
import { inject, injectable, optional } from 'inversify';
|
|
30
|
-
import { GLSPActionDispatcher } from '../../../base/action-dispatcher';
|
|
31
31
|
import { DragAwareMouseListener } from '../../../base/drag-aware-mouse-listener';
|
|
32
32
|
import { CursorCSS, cursorFeedbackAction } from '../../../base/feedback/css-feedback';
|
|
33
33
|
import { FeedbackEmitter } from '../../../base/feedback/feedback-emitter';
|
|
@@ -98,7 +98,7 @@ export class EdgeCreationToolMouseListener extends DragAwareMouseListener {
|
|
|
98
98
|
|
|
99
99
|
constructor(
|
|
100
100
|
protected triggerAction: TriggerEdgeCreationAction,
|
|
101
|
-
protected actionDispatcher:
|
|
101
|
+
protected actionDispatcher: IActionDispatcher,
|
|
102
102
|
protected typeHintProvider: ITypeHintProvider,
|
|
103
103
|
protected tool: EdgeCreationTool,
|
|
104
104
|
protected dragSensitivity?: number
|
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
GIssueSeverity,
|
|
20
20
|
GModelElement,
|
|
21
21
|
GModelRoot,
|
|
22
|
+
IActionDispatcher,
|
|
22
23
|
IActionHandler,
|
|
23
24
|
IContextMenuItemProvider,
|
|
24
25
|
KeyListener,
|
|
@@ -34,7 +35,6 @@ import {
|
|
|
34
35
|
matchesKeystroke
|
|
35
36
|
} from '@eclipse-glsp/sprotty';
|
|
36
37
|
import { inject, injectable } from 'inversify';
|
|
37
|
-
import { GLSPActionDispatcher } from '../../base/action-dispatcher';
|
|
38
38
|
import { SelectionService } from '../../base/selection-service';
|
|
39
39
|
import { BoundsAwareModelElement, SelectableElement, getElements, isSelectableAndBoundsAware } from '../../utils/gmodel-util';
|
|
40
40
|
import { MarkerPredicates, collectIssueMarkers } from '../../utils/marker';
|
|
@@ -166,7 +166,7 @@ export class NavigateToMarkerActionHandler implements IActionHandler {
|
|
|
166
166
|
protected selectionService: SelectionService;
|
|
167
167
|
|
|
168
168
|
@inject(TYPES.IActionDispatcher)
|
|
169
|
-
protected actionDispatcher:
|
|
169
|
+
protected actionDispatcher: IActionDispatcher;
|
|
170
170
|
|
|
171
171
|
handle(action: NavigateToMarkerAction): void {
|
|
172
172
|
const selected = this.getSelectedElements(action);
|