@eclipse-glsp/client 2.5.0 → 2.6.0-next.11
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/css/command-palette.css +2 -0
- package/css/navigation.css +2 -2
- package/css/search.css +12 -3
- package/lib/base/action-dispatcher.d.ts +7 -1
- package/lib/base/action-dispatcher.d.ts.map +1 -1
- package/lib/base/action-dispatcher.js +82 -15
- package/lib/base/action-dispatcher.js.map +1 -1
- package/lib/base/auto-complete/auto-complete-widget.d.ts +2 -2
- package/lib/base/auto-complete/auto-complete-widget.d.ts.map +1 -1
- package/lib/base/auto-complete/auto-complete-widget.js +5 -2
- package/lib/base/auto-complete/auto-complete-widget.js.map +1 -1
- package/lib/base/auto-complete/autocomplete-suggestion-provider.d.ts +56 -0
- package/lib/base/auto-complete/autocomplete-suggestion-provider.d.ts.map +1 -0
- package/lib/base/auto-complete/autocomplete-suggestion-provider.js +56 -0
- package/lib/base/auto-complete/autocomplete-suggestion-provider.js.map +1 -0
- package/lib/base/auto-complete/base-autocomplete-palette.d.ts +4 -9
- package/lib/base/auto-complete/base-autocomplete-palette.d.ts.map +1 -1
- package/lib/base/auto-complete/base-autocomplete-palette.js +2 -2
- package/lib/base/auto-complete/base-autocomplete-palette.js.map +1 -1
- package/lib/base/default.module.d.ts.map +1 -1
- package/lib/base/default.module.js +4 -0
- package/lib/base/default.module.js.map +1 -1
- package/lib/base/messages.json +68 -57
- package/lib/base/tool-manager/tool-manager.d.ts +2 -2
- package/lib/base/tool-manager/tool-manager.d.ts.map +1 -1
- package/lib/base/tool-manager/tool-manager.js +4 -4
- package/lib/base/tool-manager/tool-manager.js.map +1 -1
- package/lib/default-modules.d.ts +1 -1
- package/lib/default-modules.d.ts.map +1 -1
- package/lib/default-modules.js +4 -1
- package/lib/default-modules.js.map +1 -1
- package/lib/features/accessibility/accessibility-module.d.ts.map +1 -1
- package/lib/features/accessibility/accessibility-module.js +2 -4
- package/lib/features/accessibility/accessibility-module.js.map +1 -1
- package/lib/features/accessibility/edge-autocomplete/edge-autocomplete-palette.d.ts +21 -15
- package/lib/features/accessibility/edge-autocomplete/edge-autocomplete-palette.d.ts.map +1 -1
- package/lib/features/accessibility/edge-autocomplete/edge-autocomplete-palette.js +59 -45
- package/lib/features/accessibility/edge-autocomplete/edge-autocomplete-palette.js.map +1 -1
- package/lib/features/accessibility/element-navigation/diagram-navigation-tool.d.ts.map +1 -1
- package/lib/features/accessibility/element-navigation/diagram-navigation-tool.js +2 -3
- package/lib/features/accessibility/element-navigation/diagram-navigation-tool.js.map +1 -1
- package/lib/features/accessibility/{keyboard-pointer/keyboard-pointer-module.d.ts → keyboard/keyboard-module.d.ts} +2 -2
- package/lib/features/accessibility/keyboard/keyboard-module.d.ts.map +1 -0
- package/lib/features/accessibility/{keyboard-pointer/keyboard-pointer-module.js → keyboard/keyboard-module.js} +7 -4
- package/lib/features/accessibility/keyboard/keyboard-module.js.map +1 -0
- package/lib/features/accessibility/keyboard-grid/keyboard-grid-search-palette.d.ts +15 -12
- package/lib/features/accessibility/keyboard-grid/keyboard-grid-search-palette.d.ts.map +1 -1
- package/lib/features/accessibility/keyboard-grid/keyboard-grid-search-palette.js +40 -22
- package/lib/features/accessibility/keyboard-grid/keyboard-grid-search-palette.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.js +2 -2
- package/lib/features/accessibility/keyboard-grid/keyboard-node-grid.js.map +1 -1
- package/lib/features/bounds/glsp-hidden-bounds-updater.d.ts +1 -1
- package/lib/features/bounds/glsp-hidden-bounds-updater.d.ts.map +1 -1
- package/lib/features/bounds/glsp-hidden-bounds-updater.js +4 -1
- package/lib/features/bounds/glsp-hidden-bounds-updater.js.map +1 -1
- package/lib/features/change-bounds/movement-restrictor.d.ts +12 -4
- package/lib/features/change-bounds/movement-restrictor.d.ts.map +1 -1
- package/lib/features/change-bounds/movement-restrictor.js +44 -17
- package/lib/features/change-bounds/movement-restrictor.js.map +1 -1
- package/lib/features/command-palette/command-palette.d.ts +3 -1
- package/lib/features/command-palette/command-palette.d.ts.map +1 -1
- package/lib/features/command-palette/command-palette.js +37 -0
- package/lib/features/command-palette/command-palette.js.map +1 -1
- package/lib/features/context-menu/delete-element-context-menu.d.ts +4 -4
- package/lib/features/context-menu/delete-element-context-menu.d.ts.map +1 -1
- package/lib/features/context-menu/delete-element-context-menu.js +6 -2
- package/lib/features/context-menu/delete-element-context-menu.js.map +1 -1
- package/lib/features/context-menu/server-context-menu-provider.d.ts +4 -4
- package/lib/features/context-menu/server-context-menu-provider.d.ts.map +1 -1
- package/lib/features/context-menu/server-context-menu-provider.js +4 -5
- package/lib/features/context-menu/server-context-menu-provider.js.map +1 -1
- package/lib/features/copy-paste/copy-paste-context-menu.d.ts +22 -5
- package/lib/features/copy-paste/copy-paste-context-menu.d.ts.map +1 -1
- package/lib/features/copy-paste/copy-paste-context-menu.js +16 -11
- package/lib/features/copy-paste/copy-paste-context-menu.js.map +1 -1
- package/lib/features/decoration/decoration-module.d.ts +1 -1
- package/lib/features/decoration/decoration-module.d.ts.map +1 -1
- package/lib/features/decoration/decoration-module.js +2 -1
- package/lib/features/decoration/decoration-module.js.map +1 -1
- package/lib/features/decoration/decoration-placer.d.ts +9 -3
- package/lib/features/decoration/decoration-placer.d.ts.map +1 -1
- package/lib/features/decoration/decoration-placer.js +32 -1
- package/lib/features/decoration/decoration-placer.js.map +1 -1
- package/{src/features/accessibility/edge-autocomplete/edge-autocomplete-context.ts → lib/features/search-palette/search-palette-key-listener.d.ts} +5 -9
- package/lib/features/search-palette/search-palette-key-listener.d.ts.map +1 -0
- package/lib/features/search-palette/search-palette-key-listener.js +45 -0
- package/lib/features/search-palette/search-palette-key-listener.js.map +1 -0
- package/lib/features/{accessibility/search → search-palette}/search-palette-module.d.ts +4 -3
- package/lib/features/search-palette/search-palette-module.d.ts.map +1 -0
- package/lib/features/search-palette/search-palette-module.js +39 -0
- package/lib/features/search-palette/search-palette-module.js.map +1 -0
- package/lib/features/search-palette/search-palette.d.ts +51 -0
- package/lib/features/search-palette/search-palette.d.ts.map +1 -0
- package/lib/features/search-palette/search-palette.js +141 -0
- package/lib/features/search-palette/search-palette.js.map +1 -0
- package/{src/base/auto-complete/autocomplete-suggestion-providers.ts → lib/features/search-palette/suggestions/edge-element-suggestions.d.ts} +11 -22
- package/lib/features/search-palette/suggestions/edge-element-suggestions.d.ts.map +1 -0
- package/lib/features/search-palette/suggestions/edge-element-suggestions.js +72 -0
- package/lib/features/search-palette/suggestions/edge-element-suggestions.js.map +1 -0
- package/lib/features/search-palette/suggestions/named-element-suggestions.d.ts +30 -0
- package/lib/features/search-palette/suggestions/named-element-suggestions.d.ts.map +1 -0
- package/lib/features/search-palette/suggestions/named-element-suggestions.js +83 -0
- package/lib/features/search-palette/suggestions/named-element-suggestions.js.map +1 -0
- package/lib/features/validation/marker-navigator.d.ts +3 -3
- package/lib/features/validation/marker-navigator.d.ts.map +1 -1
- package/lib/features/validation/marker-navigator.js +8 -7
- package/lib/features/validation/marker-navigator.js.map +1 -1
- package/lib/features/viewport/reposition.d.ts.map +1 -1
- package/lib/features/viewport/reposition.js +1 -5
- package/lib/features/viewport/reposition.js.map +1 -1
- package/lib/index.d.ts +7 -6
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +7 -6
- package/lib/index.js.map +1 -1
- package/lib/standalone-modules.d.ts +1 -1
- package/lib/standalone-modules.d.ts.map +1 -1
- package/lib/standalone-modules.js +2 -0
- package/lib/standalone-modules.js.map +1 -1
- package/lib/utils/gmodel-util.d.ts +32 -2
- package/lib/utils/gmodel-util.d.ts.map +1 -1
- package/lib/utils/gmodel-util.js +29 -1
- package/lib/utils/gmodel-util.js.map +1 -1
- package/package.json +4 -4
- package/src/base/action-dispatcher.ts +88 -15
- package/src/base/auto-complete/auto-complete-widget.ts +7 -4
- package/src/base/auto-complete/autocomplete-suggestion-provider.ts +86 -0
- package/src/base/auto-complete/base-autocomplete-palette.ts +6 -6
- package/src/base/default.module.ts +5 -0
- package/src/base/messages.json +68 -57
- package/src/base/tool-manager/tool-manager.ts +4 -4
- package/src/default-modules.ts +4 -1
- package/src/features/accessibility/accessibility-module.ts +1 -3
- package/src/features/accessibility/edge-autocomplete/edge-autocomplete-palette.ts +75 -52
- package/src/features/accessibility/element-navigation/diagram-navigation-tool.ts +2 -4
- package/src/features/accessibility/{keyboard-pointer/keyboard-pointer-module.ts → keyboard/keyboard-module.ts} +12 -5
- package/src/features/accessibility/keyboard-grid/keyboard-grid-search-palette.ts +36 -22
- package/src/features/accessibility/keyboard-grid/keyboard-node-grid.ts +3 -3
- package/src/features/bounds/glsp-hidden-bounds-updater.ts +5 -1
- package/src/features/change-bounds/movement-restrictor.ts +72 -19
- package/src/features/command-palette/command-palette.ts +41 -1
- package/src/features/context-menu/delete-element-context-menu.ts +9 -5
- package/src/features/context-menu/server-context-menu-provider.ts +8 -9
- package/src/features/copy-paste/copy-paste-context-menu.ts +21 -17
- package/src/features/decoration/decoration-module.ts +2 -1
- package/src/features/decoration/decoration-placer.ts +49 -4
- package/src/features/{accessibility/search/search-palette-module.ts → search-palette/search-palette-key-listener.ts} +15 -14
- package/src/features/search-palette/search-palette-module.ts +48 -0
- package/src/features/search-palette/search-palette.ts +164 -0
- package/src/features/search-palette/suggestions/edge-element-suggestions.ts +71 -0
- package/src/features/search-palette/suggestions/named-element-suggestions.ts +88 -0
- package/src/features/validation/marker-navigator.ts +9 -8
- package/src/features/viewport/reposition.ts +1 -7
- package/src/index.ts +7 -6
- package/src/standalone-modules.ts +2 -0
- package/src/utils/gmodel-util.ts +59 -1
- package/lib/base/auto-complete/autocomplete-suggestion-providers.d.ts +0 -35
- package/lib/base/auto-complete/autocomplete-suggestion-providers.d.ts.map +0 -1
- package/lib/base/auto-complete/autocomplete-suggestion-providers.js +0 -18
- package/lib/base/auto-complete/autocomplete-suggestion-providers.js.map +0 -1
- package/lib/features/accessibility/edge-autocomplete/edge-autocomplete-context.d.ts +0 -23
- package/lib/features/accessibility/edge-autocomplete/edge-autocomplete-context.d.ts.map +0 -1
- package/lib/features/accessibility/edge-autocomplete/edge-autocomplete-context.js +0 -18
- package/lib/features/accessibility/edge-autocomplete/edge-autocomplete-context.js.map +0 -1
- package/lib/features/accessibility/keyboard-pointer/keyboard-pointer-module.d.ts.map +0 -1
- package/lib/features/accessibility/keyboard-pointer/keyboard-pointer-module.js.map +0 -1
- package/lib/features/accessibility/search/search-palette-module.d.ts.map +0 -1
- package/lib/features/accessibility/search/search-palette-module.js +0 -32
- package/lib/features/accessibility/search/search-palette-module.js.map +0 -1
- package/lib/features/accessibility/search/search-palette.d.ts +0 -51
- package/lib/features/accessibility/search/search-palette.d.ts.map +0 -1
- package/lib/features/accessibility/search/search-palette.js +0 -186
- package/lib/features/accessibility/search/search-palette.js.map +0 -1
- package/lib/features/accessibility/search/search-tool.d.ts +0 -33
- package/lib/features/accessibility/search/search-tool.d.ts.map +0 -1
- package/lib/features/accessibility/search/search-tool.js +0 -84
- package/lib/features/accessibility/search/search-tool.js.map +0 -1
- package/src/features/accessibility/search/search-palette.ts +0 -218
- package/src/features/accessibility/search/search-tool.ts +0 -74
|
@@ -21,7 +21,8 @@ import {
|
|
|
21
21
|
ValidationStatus,
|
|
22
22
|
codiconCSSClasses,
|
|
23
23
|
matchesKeystroke,
|
|
24
|
-
toArray
|
|
24
|
+
toArray,
|
|
25
|
+
type MaybePromise
|
|
25
26
|
} from '@eclipse-glsp/sprotty';
|
|
26
27
|
import { AutocompleteResult, AutocompleteSettings } from 'autocompleter';
|
|
27
28
|
import { AutoCompleteValue } from './auto-complete-actions';
|
|
@@ -48,7 +49,7 @@ export interface InputValueInitializer {
|
|
|
48
49
|
}
|
|
49
50
|
|
|
50
51
|
export interface SuggestionSubmitHandler {
|
|
51
|
-
executeFromSuggestion(input: LabeledAction | Action | Action[]): void
|
|
52
|
+
executeFromSuggestion(input: LabeledAction | Action | Action[]): MaybePromise<void>;
|
|
52
53
|
}
|
|
53
54
|
|
|
54
55
|
export interface TextSubmitHandler {
|
|
@@ -303,8 +304,9 @@ export class AutoCompleteWidget {
|
|
|
303
304
|
// trigger update of suggestions with an keyup event
|
|
304
305
|
window.setTimeout(() => this.inputElement.dispatchEvent(new Event('input')));
|
|
305
306
|
} else {
|
|
306
|
-
this.executeFromSuggestion(item)
|
|
307
|
-
|
|
307
|
+
Promise.resolve(this.executeFromSuggestion(item)).then(() => {
|
|
308
|
+
this.notifyClose('submission');
|
|
309
|
+
});
|
|
308
310
|
}
|
|
309
311
|
}
|
|
310
312
|
|
|
@@ -362,6 +364,7 @@ export class AutoCompleteWidget {
|
|
|
362
364
|
if (this.autoCompleteResult) {
|
|
363
365
|
this.autoCompleteResult.destroy();
|
|
364
366
|
}
|
|
367
|
+
this.observer?.disconnect();
|
|
365
368
|
}
|
|
366
369
|
}
|
|
367
370
|
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2023-2025 Business Informatics Group (TU Wien) and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
*
|
|
8
|
+
* This Source Code may also be made available under the following Secondary
|
|
9
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
* with the GNU Classpath Exception which is available at
|
|
12
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
*
|
|
14
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
+
********************************************************************************/
|
|
16
|
+
|
|
17
|
+
import {
|
|
18
|
+
GModelRoot,
|
|
19
|
+
InstanceRegistry,
|
|
20
|
+
LazyInjector,
|
|
21
|
+
TYPES,
|
|
22
|
+
type GModelElement,
|
|
23
|
+
type LabeledAction,
|
|
24
|
+
type MaybePromise
|
|
25
|
+
} from '@eclipse-glsp/sprotty';
|
|
26
|
+
import { inject, injectable } from 'inversify';
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Interface for autocomplete suggestions.
|
|
30
|
+
*/
|
|
31
|
+
export interface AutocompleteSuggestion {
|
|
32
|
+
element?: GModelElement;
|
|
33
|
+
action: LabeledAction;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* A provider for autocomplete suggestions.
|
|
38
|
+
*/
|
|
39
|
+
export interface IAutocompleteSuggestionProvider {
|
|
40
|
+
id: string;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Returns whether this provider can handle the given autocomplete context.
|
|
44
|
+
* @param context The context to check.
|
|
45
|
+
*/
|
|
46
|
+
canHandle(context: string): boolean;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Provides suggestions for the given input
|
|
50
|
+
*/
|
|
51
|
+
getSuggestions(root: Readonly<GModelRoot>, text: string, context?: unknown): Promise<AutocompleteSuggestion[]>;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Default contexts for autocomplete suggestions.
|
|
56
|
+
*/
|
|
57
|
+
export namespace AutocompleteSuggestionProviderContext {
|
|
58
|
+
export const CANVAS = 'canvas' as const;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Registry for autocomplete suggestion providers.
|
|
63
|
+
*/
|
|
64
|
+
export interface AutocompleteSuggestionRegistry extends InstanceRegistry<IAutocompleteSuggestionProvider> {
|
|
65
|
+
providersForContext(context: string[]): IAutocompleteSuggestionProvider[];
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
@injectable()
|
|
69
|
+
export class DefaultAutocompleteSuggestionRegistry
|
|
70
|
+
extends InstanceRegistry<IAutocompleteSuggestionProvider>
|
|
71
|
+
implements AutocompleteSuggestionRegistry
|
|
72
|
+
{
|
|
73
|
+
@inject(LazyInjector)
|
|
74
|
+
protected lazyInjector: LazyInjector;
|
|
75
|
+
|
|
76
|
+
preLoadDiagram(): MaybePromise<void> {
|
|
77
|
+
const suggestionProviders = this.lazyInjector.getAll<IAutocompleteSuggestionProvider>(TYPES.IAutocompleteSuggestionProvider);
|
|
78
|
+
suggestionProviders.forEach(provider => {
|
|
79
|
+
this.register(provider.id, provider);
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
providersForContext(searchContext: string[]): IAutocompleteSuggestionProvider[] {
|
|
84
|
+
return Array.from(this.elements.values()).filter(provider => searchContext.some(c => provider.canHandle(c)));
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
|
|
17
|
-
import { Action, GModelRoot, IActionDispatcher, LabeledAction, TYPES } from '@eclipse-glsp/sprotty';
|
|
17
|
+
import { Action, GModelRoot, IActionDispatcher, LabeledAction, TYPES, type MaybePromise } from '@eclipse-glsp/sprotty';
|
|
18
18
|
import { inject } from 'inversify';
|
|
19
19
|
import '../../../css/autocomplete-palette.css';
|
|
20
|
-
import { GLSPAbstractUIExtension } from '../ui-extension/ui-extension';
|
|
21
|
-
import { AutoCompleteWidget, CloseReason, toActionArray } from './auto-complete-widget';
|
|
22
20
|
import { messages } from '../messages';
|
|
21
|
+
import { GLSPAbstractUIExtension } from '../ui-extension/ui-extension';
|
|
22
|
+
import { AutoCompleteWidget, CloseReason, toActionArray, type AutoCompleteSettings } from './auto-complete-widget';
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* A reusable base implementation for `UIExtensions` that want to provide autocomplete functionality
|
|
@@ -27,7 +27,7 @@ import { messages } from '../messages';
|
|
|
27
27
|
*
|
|
28
28
|
*/
|
|
29
29
|
export abstract class BaseAutocompletePalette extends GLSPAbstractUIExtension {
|
|
30
|
-
protected readonly autoSuggestionSettings = {
|
|
30
|
+
protected readonly autoSuggestionSettings: AutoCompleteSettings = {
|
|
31
31
|
noSuggestionsMessage: messages.autocomplete.no_suggestions,
|
|
32
32
|
suggestionsClass: 'command-palette-suggestions',
|
|
33
33
|
debounceWaitMs: 50,
|
|
@@ -87,7 +87,7 @@ export abstract class BaseAutocompletePalette extends GLSPAbstractUIExtension {
|
|
|
87
87
|
this.hide();
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
protected executeSuggestion(input: LabeledAction | Action[] | Action): void {
|
|
91
|
-
this.actionDispatcher.dispatchAll(toActionArray(input));
|
|
90
|
+
protected executeSuggestion(input: LabeledAction | Action[] | Action): MaybePromise<void> {
|
|
91
|
+
return this.actionDispatcher.dispatchAll(toActionArray(input));
|
|
92
92
|
}
|
|
93
93
|
}
|
|
@@ -36,6 +36,7 @@ import '@vscode/codicons/dist/codicon.css';
|
|
|
36
36
|
import '../../css/glsp-sprotty.css';
|
|
37
37
|
import { GLSPActionDispatcher } from './action-dispatcher';
|
|
38
38
|
import { GLSPActionHandlerRegistry } from './action-handler-registry';
|
|
39
|
+
import { DefaultAutocompleteSuggestionRegistry } from './auto-complete/autocomplete-suggestion-provider';
|
|
39
40
|
import { GLSPCommandStack } from './command-stack';
|
|
40
41
|
import { EditorContextService } from './editor-context-service';
|
|
41
42
|
import { ModifyCssFeedbackCommand } from './feedback/css-feedback';
|
|
@@ -148,6 +149,10 @@ export const defaultModule = new FeatureModule(
|
|
|
148
149
|
|
|
149
150
|
// Shortcut manager initialization ------------------------------------
|
|
150
151
|
bindAsService(context, TYPES.IShortcutManager, ShortcutManager);
|
|
152
|
+
|
|
153
|
+
// Autocomplete suggestion provider initialization ------------------------------------
|
|
154
|
+
bind(TYPES.IAutocompleteSuggestionProviderRegistry).to(DefaultAutocompleteSuggestionRegistry).inSingletonScope();
|
|
155
|
+
bind(TYPES.IDiagramStartup).toService(TYPES.IAutocompleteSuggestionProviderRegistry);
|
|
151
156
|
},
|
|
152
157
|
{
|
|
153
158
|
featureId: Symbol('default')
|
package/src/base/messages.json
CHANGED
|
@@ -1,87 +1,98 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
3
|
-
"
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
2
|
+
"autocomplete": {
|
|
3
|
+
"no_suggestions": "No suggestions available"
|
|
4
|
+
},
|
|
5
|
+
"context_menu": {
|
|
6
|
+
"copy": "Copy",
|
|
7
|
+
"cut": "Cut",
|
|
8
|
+
"delete": "Delete",
|
|
9
|
+
"marker": {
|
|
10
|
+
"navigation": "Go to",
|
|
11
|
+
"next": "Next marker",
|
|
12
|
+
"previous": "Previous marker"
|
|
13
|
+
},
|
|
14
|
+
"paste": "Paste"
|
|
15
|
+
},
|
|
16
|
+
"diagram": {
|
|
17
|
+
"label": "Diagram"
|
|
9
18
|
},
|
|
10
19
|
"focus": {
|
|
11
20
|
"focus_not_set": "Focus not set",
|
|
12
|
-
"focus_on": "Currently focused: ",
|
|
13
21
|
"focus_off": "Currently no element is focused.",
|
|
22
|
+
"focus_on": "Currently focused: ",
|
|
14
23
|
"focus_within": "Within",
|
|
15
|
-
"
|
|
16
|
-
"
|
|
24
|
+
"shortcut_focus_graph": "Focus on graph",
|
|
25
|
+
"shortcut_focus_palette": "Focus on tool palette"
|
|
26
|
+
},
|
|
27
|
+
"grid": {
|
|
28
|
+
"shortcut_zoom_in": "Zoom in via grid",
|
|
29
|
+
"zoom_in_grid": "Select a digit from 1-9 to zoom in on the respective box."
|
|
30
|
+
},
|
|
31
|
+
"issue_marker": {
|
|
32
|
+
"severity_error": "ERROR",
|
|
33
|
+
"severity_info": "INFO",
|
|
34
|
+
"severity_warning": "WARNING"
|
|
35
|
+
},
|
|
36
|
+
"move": {
|
|
37
|
+
"shortcut_move": "Move element"
|
|
38
|
+
},
|
|
39
|
+
"navigation": {
|
|
40
|
+
"default_navigation_mode_activated": "Navigation On: Use arrow keys to select preceding (←) or succeding (→) elements. Use the up (↑) and down (↓) arrows to navigate paths. Press 'N' to exit.",
|
|
41
|
+
"default_navigation_mode_deactivated": "Navigation Off: Press 'N' for default navigation, 'ALT+N' for position based navigation.",
|
|
42
|
+
"local_navigation_mode_activated": "Position based Nav On: Navigate nearest elements using arrow keys: (↑) for above, (↓) for below, (←) for previous, (→) for next element. Press 'ALT+N' to exit.",
|
|
43
|
+
"local_navigation_mode_deactivated": "Position based Nav Off: Press 'N' for default navigation, 'ALT+N' for position based navigation.",
|
|
44
|
+
"shortcut_global_mode": "Activate global navigation mode",
|
|
45
|
+
"shortcut_local_mode": "Activate local navigation mode"
|
|
17
46
|
},
|
|
18
47
|
"resize": {
|
|
19
48
|
"resize_mode_activated": "Resize On: Use plus(+) and minus(-) to resize, 'CTRL'+'0' for default size. Press 'ESC' to exit.",
|
|
20
49
|
"resize_mode_deactivated": "Resize Off: Press 'ALT'+'A' for resize mode.",
|
|
21
50
|
"shortcut_activate": "Activate resize mode for selected element",
|
|
22
51
|
"shortcut_deactivate": "Deactivate resize handler",
|
|
23
|
-
"shortcut_increase": "Increase size of element",
|
|
24
52
|
"shortcut_decrease": "Decrease size of element",
|
|
53
|
+
"shortcut_increase": "Increase size of element",
|
|
25
54
|
"shortcut_reset": "Set element size to default"
|
|
26
55
|
},
|
|
27
|
-
"move": {
|
|
28
|
-
"shortcut_move": "Move element"
|
|
29
|
-
},
|
|
30
|
-
"grid": {
|
|
31
|
-
"zoom_in_grid": "Select a digit from 1-9 to zoom in on the respective box.",
|
|
32
|
-
"shortcut_zoom_in": "Zoom in via grid"
|
|
33
|
-
},
|
|
34
56
|
"search": {
|
|
35
|
-
"
|
|
57
|
+
"label": "Search Field",
|
|
36
58
|
"placeholder": "Search for elements...",
|
|
37
|
-
"
|
|
59
|
+
"shortcut_activate": "Activate search for elements"
|
|
60
|
+
},
|
|
61
|
+
"shortcut": {
|
|
62
|
+
"group_focus": "Focus",
|
|
63
|
+
"group_graph": "Graph",
|
|
64
|
+
"group_grid": "Grid",
|
|
65
|
+
"group_move": "Move",
|
|
66
|
+
"group_navigation": "Navigation",
|
|
67
|
+
"group_resize": "Resize",
|
|
68
|
+
"group_search": "Search",
|
|
69
|
+
"group_tool_palette": "Tool Palette",
|
|
70
|
+
"group_viewport": "Viewport",
|
|
71
|
+
"group_zoom": "Zoom",
|
|
72
|
+
"header_command": "Command",
|
|
73
|
+
"header_shortcut": "Keybinding",
|
|
74
|
+
"menu_title": "Shortcut Menu",
|
|
75
|
+
"title": "Keyboard Shortcuts"
|
|
38
76
|
},
|
|
39
77
|
"tool_palette": {
|
|
40
|
-
"
|
|
78
|
+
"debug_mode_button": "Debug Mode",
|
|
41
79
|
"delete_button": "Enable deletion tool",
|
|
80
|
+
"label": "Tool Palette",
|
|
42
81
|
"marquee_button": "Enable marquee tool",
|
|
43
82
|
"marquee_message": "Currently marquee tool is only usable with mouse.",
|
|
44
|
-
"
|
|
83
|
+
"maximize": "Maximize palette",
|
|
84
|
+
"minimize": "Minimize palette",
|
|
85
|
+
"no_items": "No results found.",
|
|
86
|
+
"reset_viewport_button": "Reset Viewport",
|
|
45
87
|
"search_button": "Filter palette entries",
|
|
88
|
+
"search_placeholder": "Search...",
|
|
46
89
|
"selection_button": "Enable selection tool",
|
|
47
|
-
"validate_button": "Validate model",
|
|
48
|
-
"reset_viewport_button": "Reset Viewport",
|
|
49
90
|
"toggle_grid_button": "Toggle Grid",
|
|
50
|
-
"
|
|
51
|
-
"minimize": "Minimize palette",
|
|
52
|
-
"maximize": "Maximize palette",
|
|
53
|
-
"no_items": "No results found."
|
|
91
|
+
"validate_button": "Validate model"
|
|
54
92
|
},
|
|
55
93
|
"viewport": {
|
|
56
94
|
"shortcut_move_viewport": "Move viewport",
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
},
|
|
60
|
-
"shortcut": {
|
|
61
|
-
"title": "Keyboard Shortcuts",
|
|
62
|
-
"header_command": "Command",
|
|
63
|
-
"header_shortcut": "Keybinding",
|
|
64
|
-
"menu_title": "Shortcut Menu",
|
|
65
|
-
"group_move": "Move",
|
|
66
|
-
"group_graph": "Graph",
|
|
67
|
-
"group_resize": "Resize",
|
|
68
|
-
"group_focus": "Focus",
|
|
69
|
-
"group_zoom": "Zoom",
|
|
70
|
-
"group_navigation": "Navigation",
|
|
71
|
-
"group_grid": "Grid",
|
|
72
|
-
"group_search": "Search",
|
|
73
|
-
"group_tool_palette": "Tool Palette",
|
|
74
|
-
"group_viewport": "Viewport"
|
|
75
|
-
},
|
|
76
|
-
"diagram": {
|
|
77
|
-
"label": "Diagram"
|
|
78
|
-
},
|
|
79
|
-
"autocomplete": {
|
|
80
|
-
"no_suggestions": "No suggestions available"
|
|
81
|
-
},
|
|
82
|
-
"issue_marker": {
|
|
83
|
-
"severity_error": "ERROR",
|
|
84
|
-
"severity_warning": "WARNING",
|
|
85
|
-
"severity_info": "INFO"
|
|
95
|
+
"shortcut_zoom_element": "Zoom element",
|
|
96
|
+
"shortcut_zoom_viewport": "Zoom viewport"
|
|
86
97
|
}
|
|
87
98
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2019-
|
|
2
|
+
* Copyright (c) 2019-2025 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
|
|
@@ -133,8 +133,8 @@ export class ToolManager implements IToolManager, IDiagramStartup, IEditModeList
|
|
|
133
133
|
this.actives.splice(0, this.actives.length);
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
enableDefaultTools(): void {
|
|
137
|
-
if (this.defaultToolsEnabled) {
|
|
136
|
+
enableDefaultTools(force = false): void {
|
|
137
|
+
if (this.defaultToolsEnabled && !force) {
|
|
138
138
|
return;
|
|
139
139
|
}
|
|
140
140
|
this.enable(pluck(this.defaultTools, 'id'));
|
|
@@ -171,7 +171,7 @@ export class ToolManager implements IToolManager, IDiagramStartup, IEditModeList
|
|
|
171
171
|
if (newValue === EditMode.READONLY) {
|
|
172
172
|
this.disableEditTools();
|
|
173
173
|
} else if (newValue === EditMode.EDITABLE) {
|
|
174
|
-
this.enableDefaultTools();
|
|
174
|
+
this.enableDefaultTools(true);
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
177
|
}
|
package/src/default-modules.ts
CHANGED
|
@@ -47,6 +47,7 @@ import { labelEditModule } from './features/label-edit/label-edit-module';
|
|
|
47
47
|
import { layoutModule } from './features/layout/layout-module';
|
|
48
48
|
import { navigationModule } from './features/navigation/navigation-module';
|
|
49
49
|
import { routingModule } from './features/routing/routing-module';
|
|
50
|
+
import { searchPaletteDefaultSuggestionsModule, searchPaletteModule } from './features/search-palette/search-palette-module';
|
|
50
51
|
import { selectModule } from './features/select/select-module';
|
|
51
52
|
import { sourceModelWatcherModule } from './features/source-model-watcher/source-model-watcher-module';
|
|
52
53
|
import { statusModule } from './features/status/status-module';
|
|
@@ -101,7 +102,9 @@ export const DEFAULT_MODULES = [
|
|
|
101
102
|
zorderModule,
|
|
102
103
|
svgMetadataModule,
|
|
103
104
|
statusModule,
|
|
104
|
-
resizeModule
|
|
105
|
+
resizeModule,
|
|
106
|
+
searchPaletteModule,
|
|
107
|
+
searchPaletteDefaultSuggestionsModule
|
|
105
108
|
] as const;
|
|
106
109
|
|
|
107
110
|
/**
|
|
@@ -17,9 +17,8 @@
|
|
|
17
17
|
import { FeatureModule } from '@eclipse-glsp/sprotty';
|
|
18
18
|
import { configureElementNavigationTool } from './element-navigation/element-navigation-module';
|
|
19
19
|
import { configureFocusTrackerTool } from './focus-tracker/focus-tracker-module';
|
|
20
|
-
import { configureKeyboardControlTools } from './keyboard-pointer/keyboard-pointer-module';
|
|
21
20
|
import { configureKeyboardToolPaletteTool } from './keyboard-tool-palette/keyboard-tool-palette-module';
|
|
22
|
-
import {
|
|
21
|
+
import { configureKeyboardControlTools } from './keyboard/keyboard-module';
|
|
23
22
|
import { configureToastTool } from './toast/toast-module';
|
|
24
23
|
import { configureViewKeyTools } from './view-key-tools/view-key-tools-module';
|
|
25
24
|
|
|
@@ -30,7 +29,6 @@ export const accessibilityModule = new FeatureModule(
|
|
|
30
29
|
(bind, unbind, isBound, rebind) => {
|
|
31
30
|
const context = { bind, unbind, isBound, rebind };
|
|
32
31
|
configureViewKeyTools(context);
|
|
33
|
-
configureSearchPaletteModule(context);
|
|
34
32
|
configureKeyboardToolPaletteTool(context);
|
|
35
33
|
configureKeyboardControlTools(context);
|
|
36
34
|
configureElementNavigationTool(context);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2023-
|
|
2
|
+
* Copyright (c) 2023-2025 Business Informatics Group (TU Wien) 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,76 +29,89 @@ import {
|
|
|
29
29
|
} from '@eclipse-glsp/sprotty';
|
|
30
30
|
import { injectable } from 'inversify';
|
|
31
31
|
import { CloseReason, toActionArray } from '../../../base/auto-complete/auto-complete-widget';
|
|
32
|
-
import {
|
|
32
|
+
import { IAutocompleteSuggestionProvider, type AutocompleteSuggestion } from '../../../base/auto-complete/autocomplete-suggestion-provider';
|
|
33
33
|
import { EnableDefaultToolsAction } from '../../../base/tool-manager/tool';
|
|
34
34
|
import { GEdge } from '../../../model';
|
|
35
|
-
import { SearchAutocompletePalette } from '
|
|
35
|
+
import { SearchAutocompletePalette, SearchAutocompleteSuggestion } from '../../search-palette/search-palette';
|
|
36
36
|
import { SetEdgeTargetSelectionAction } from './action';
|
|
37
|
-
import { EdgeAutocompleteContext } from './edge-autocomplete-context';
|
|
38
37
|
|
|
39
38
|
export namespace EdgeAutocompletePaletteMetadata {
|
|
40
39
|
export const ID = 'edge-autocomplete-palette';
|
|
41
40
|
}
|
|
42
41
|
|
|
42
|
+
export interface EdgeAutocompleteContext {
|
|
43
|
+
role: 'source' | 'target';
|
|
44
|
+
triggerAction: TriggerEdgeCreationAction;
|
|
45
|
+
sourceId?: string;
|
|
46
|
+
targetId?: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export type EdgeAutocompletePaletteStages = 'initial' | 'source' | 'target' | 'reloading';
|
|
50
|
+
|
|
43
51
|
@injectable()
|
|
44
52
|
export class EdgeAutocompletePalette extends SearchAutocompletePalette implements IActionHandler {
|
|
45
|
-
protected
|
|
46
|
-
|
|
47
|
-
protected readonly targetSuggestionProvider = new PossibleEdgeTargetAutocompleteSuggestionProvider();
|
|
53
|
+
protected edgeAutocompleteContext?: EdgeAutocompleteContext;
|
|
54
|
+
protected stage: EdgeAutocompletePaletteStages = 'initial';
|
|
48
55
|
|
|
49
56
|
override id(): string {
|
|
50
57
|
return EdgeAutocompletePaletteMetadata.ID;
|
|
51
58
|
}
|
|
52
59
|
|
|
60
|
+
override get searchContext(): string[] {
|
|
61
|
+
return [EdgeAutocompletePaletteMetadata.ID];
|
|
62
|
+
}
|
|
63
|
+
|
|
53
64
|
handle(action: Action): Action | void {
|
|
54
65
|
if (TriggerEdgeCreationAction.is(action)) {
|
|
55
|
-
this.
|
|
56
|
-
|
|
66
|
+
this.stage = 'source';
|
|
67
|
+
this.edgeAutocompleteContext = {
|
|
68
|
+
triggerAction: action,
|
|
57
69
|
role: 'source'
|
|
58
70
|
};
|
|
59
|
-
this.targetSuggestionProvider.setContext(action, this.context);
|
|
60
71
|
}
|
|
61
72
|
}
|
|
62
73
|
|
|
63
74
|
protected override onBeforeShow(containerElement: HTMLElement, root: Readonly<GModelRoot>, ...contextElementIds: string[]): void {
|
|
64
75
|
super.onBeforeShow(containerElement, root, ...contextElementIds);
|
|
65
76
|
|
|
66
|
-
this.autocompleteWidget.inputField.placeholder = `Search for ${this.
|
|
77
|
+
this.autocompleteWidget.inputField.placeholder = `Search for ${this.edgeAutocompleteContext?.role} elements`;
|
|
67
78
|
}
|
|
68
79
|
|
|
69
|
-
protected
|
|
70
|
-
|
|
80
|
+
protected async reload(): Promise<void> {
|
|
81
|
+
this.stage = 'reloading';
|
|
82
|
+
this.hide();
|
|
71
83
|
}
|
|
72
84
|
|
|
73
|
-
protected
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
85
|
+
protected override async provideSearchSuggestions(root: Readonly<GModelRoot>, input: string): Promise<SearchAutocompleteSuggestion[]> {
|
|
86
|
+
return (
|
|
87
|
+
await Promise.all(
|
|
88
|
+
this.suggestionRegistry
|
|
89
|
+
.providersForContext(this.searchContext)
|
|
90
|
+
.flatMap(provider => provider.getSuggestions(root, input, this.edgeAutocompleteContext))
|
|
91
|
+
)
|
|
92
|
+
)
|
|
93
|
+
.flat(1)
|
|
94
|
+
.filter(SearchAutocompleteSuggestion.is);
|
|
83
95
|
}
|
|
84
96
|
|
|
85
|
-
protected override executeSuggestion(input: LabeledAction | Action[] | Action): void {
|
|
97
|
+
protected override async executeSuggestion(input: LabeledAction | Action[] | Action): Promise<void> {
|
|
86
98
|
const action = toActionArray(input)[0] as SetEdgeTargetSelectionAction;
|
|
87
99
|
|
|
88
|
-
if (this.
|
|
89
|
-
this.
|
|
90
|
-
this.
|
|
100
|
+
if (this.edgeAutocompleteContext?.role === 'source') {
|
|
101
|
+
this.edgeAutocompleteContext.sourceId = action.elementId;
|
|
102
|
+
this.edgeAutocompleteContext.role = 'target';
|
|
91
103
|
this.reload();
|
|
92
|
-
} else if (this.
|
|
93
|
-
this.
|
|
104
|
+
} else if (this.edgeAutocompleteContext?.role === 'target') {
|
|
105
|
+
this.edgeAutocompleteContext.targetId = action.elementId;
|
|
94
106
|
}
|
|
95
|
-
|
|
96
|
-
|
|
107
|
+
|
|
108
|
+
if (this.edgeAutocompleteContext?.sourceId !== undefined && this.edgeAutocompleteContext?.targetId !== undefined) {
|
|
109
|
+
await this.actionDispatcher.dispatchAll([
|
|
97
110
|
CreateEdgeOperation.create({
|
|
98
|
-
elementTypeId: this.
|
|
99
|
-
sourceElementId: this.
|
|
100
|
-
targetElementId: this.
|
|
101
|
-
args: this.
|
|
111
|
+
elementTypeId: this.edgeAutocompleteContext.triggerAction.elementTypeId,
|
|
112
|
+
sourceElementId: this.edgeAutocompleteContext.sourceId,
|
|
113
|
+
targetElementId: this.edgeAutocompleteContext.targetId,
|
|
114
|
+
args: this.edgeAutocompleteContext.triggerAction.args
|
|
102
115
|
}),
|
|
103
116
|
EnableDefaultToolsAction.create()
|
|
104
117
|
]);
|
|
@@ -107,41 +120,51 @@ export class EdgeAutocompletePalette extends SearchAutocompletePalette implement
|
|
|
107
120
|
}
|
|
108
121
|
|
|
109
122
|
protected override autocompleteHide(reason: CloseReason): void {
|
|
110
|
-
if (
|
|
123
|
+
if (this.stage === 'reloading') {
|
|
124
|
+
// Wait until the auto complete is closed before reloading
|
|
125
|
+
if (reason === 'blur') {
|
|
126
|
+
this.actionDispatcher.dispatch(
|
|
127
|
+
SetUIExtensionVisibilityAction.create({
|
|
128
|
+
extensionId: EdgeAutocompletePaletteMetadata.ID,
|
|
129
|
+
visible: true
|
|
130
|
+
})
|
|
131
|
+
);
|
|
132
|
+
this.stage = 'target';
|
|
133
|
+
}
|
|
134
|
+
} else if (reason !== 'submission') {
|
|
111
135
|
this.hide();
|
|
112
136
|
}
|
|
113
137
|
}
|
|
114
138
|
}
|
|
115
139
|
|
|
116
140
|
@injectable()
|
|
117
|
-
export class
|
|
118
|
-
|
|
119
|
-
protected context?: EdgeAutocompleteContext;
|
|
120
|
-
|
|
121
|
-
setContext(triggerAction: TriggerEdgeCreationAction, edgeAutocompleteContext: EdgeAutocompleteContext): void {
|
|
122
|
-
this.proxyEdge = new GEdge();
|
|
123
|
-
this.proxyEdge.type = triggerAction.elementTypeId;
|
|
124
|
-
this.context = edgeAutocompleteContext;
|
|
125
|
-
}
|
|
141
|
+
export class SetEdgeTargetGridSuggestionProvider implements IAutocompleteSuggestionProvider {
|
|
142
|
+
id = 'glsp.set-edge-target-autocomplete-suggestions';
|
|
126
143
|
|
|
127
|
-
|
|
128
|
-
return
|
|
144
|
+
canHandle(searchContext: string): boolean {
|
|
145
|
+
return searchContext === EdgeAutocompletePaletteMetadata.ID;
|
|
129
146
|
}
|
|
130
147
|
|
|
131
|
-
async
|
|
132
|
-
|
|
133
|
-
if (this.context === undefined) {
|
|
148
|
+
async getSuggestions(root: Readonly<GModelRoot>, text: string, context: EdgeAutocompleteContext): Promise<AutocompleteSuggestion[]> {
|
|
149
|
+
if (context === undefined) {
|
|
134
150
|
return [];
|
|
135
151
|
}
|
|
136
152
|
|
|
137
|
-
const
|
|
153
|
+
const proxyEdge = new GEdge();
|
|
154
|
+
proxyEdge.type = context.triggerAction.elementTypeId;
|
|
155
|
+
|
|
156
|
+
const nodes = toArray(root.index.all().filter(element => this.isAllowedSource(proxyEdge, element, context.role))) as GEdge[];
|
|
138
157
|
return nodes.map(node => ({
|
|
139
158
|
element: node,
|
|
140
159
|
action: {
|
|
141
160
|
label: `[${node.type}] ${name(node) ?? '<no-name>'}`,
|
|
142
|
-
actions: [SetEdgeTargetSelectionAction.create(node.id, context
|
|
161
|
+
actions: [SetEdgeTargetSelectionAction.create(node.id, context.role)],
|
|
143
162
|
icon: codiconCSSString('arrow-both')
|
|
144
163
|
}
|
|
145
164
|
}));
|
|
146
165
|
}
|
|
166
|
+
|
|
167
|
+
protected isAllowedSource(proxyEdge: GEdge, element: GModelElement | undefined, role: 'source' | 'target'): boolean {
|
|
168
|
+
return element !== undefined && proxyEdge !== undefined && isConnectable(element) && element.canConnect(proxyEdge, role);
|
|
169
|
+
}
|
|
147
170
|
}
|
|
@@ -38,7 +38,6 @@ import { GEdge } from '../../../model';
|
|
|
38
38
|
import { SelectableBoundsAware } from '../../../utils/gmodel-util';
|
|
39
39
|
import { BaseTool } from '../../tools/base-tools';
|
|
40
40
|
import { RepositionAction } from '../../viewport/reposition';
|
|
41
|
-
import { SearchAutocompletePaletteTool } from '../search/search-tool';
|
|
42
41
|
import { ShowToastMessageAction } from '../toast/toast-handler';
|
|
43
42
|
import { ElementNavigator } from './element-navigator';
|
|
44
43
|
|
|
@@ -144,7 +143,7 @@ export class ElementNavigatorKeyListener extends KeyListener {
|
|
|
144
143
|
if (this.mode !== NavigationMode.POSITION) {
|
|
145
144
|
this.clean();
|
|
146
145
|
this.tool.dispatchActions([
|
|
147
|
-
EnableToolsAction.create([ElementNavigatorTool.ID,
|
|
146
|
+
EnableToolsAction.create([ElementNavigatorTool.ID, AvailableShortcutsTool.ID]),
|
|
148
147
|
ShowToastMessageAction.create({
|
|
149
148
|
id: Symbol.for(ElementNavigatorKeyListener.name),
|
|
150
149
|
message: messages.navigation.local_navigation_mode_activated
|
|
@@ -180,9 +179,8 @@ export class ElementNavigatorKeyListener extends KeyListener {
|
|
|
180
179
|
if (this.matchesActivateDefaultNavigation(event)) {
|
|
181
180
|
if (this.mode !== NavigationMode.DEFAULT) {
|
|
182
181
|
this.clean();
|
|
183
|
-
|
|
184
182
|
this.tool.dispatchActions([
|
|
185
|
-
EnableToolsAction.create([ElementNavigatorTool.ID,
|
|
183
|
+
EnableToolsAction.create([ElementNavigatorTool.ID, AvailableShortcutsTool.ID]),
|
|
186
184
|
ShowToastMessageAction.create({
|
|
187
185
|
id: Symbol.for(ElementNavigatorKeyListener.name),
|
|
188
186
|
message: messages.navigation.default_navigation_mode_activated
|