@eclipse-glsp/client 2.4.0-next.415 → 2.4.0-next.416

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.
Files changed (77) hide show
  1. package/lib/base/auto-complete/base-autocomplete-palette.d.ts.map +1 -1
  2. package/lib/base/auto-complete/base-autocomplete-palette.js +2 -1
  3. package/lib/base/auto-complete/base-autocomplete-palette.js.map +1 -1
  4. package/lib/base/messages.d.ts +54 -0
  5. package/lib/base/messages.d.ts.map +1 -0
  6. package/lib/base/messages.js +77 -0
  7. package/lib/base/messages.js.map +1 -0
  8. package/lib/base/messages.json +82 -0
  9. package/lib/base/shortcuts/available-shortcuts-extension.d.ts.map +1 -1
  10. package/lib/base/shortcuts/available-shortcuts-extension.js +5 -4
  11. package/lib/base/shortcuts/available-shortcuts-extension.js.map +1 -1
  12. package/lib/features/accessibility/element-navigation/diagram-navigation-tool.d.ts.map +1 -1
  13. package/lib/features/accessibility/element-navigation/diagram-navigation-tool.js +21 -11
  14. package/lib/features/accessibility/element-navigation/diagram-navigation-tool.js.map +1 -1
  15. package/lib/features/accessibility/focus-tracker/focus-tracker-tool.d.ts.map +1 -1
  16. package/lib/features/accessibility/focus-tracker/focus-tracker-tool.js +4 -4
  17. package/lib/features/accessibility/focus-tracker/focus-tracker-tool.js.map +1 -1
  18. package/lib/features/accessibility/global-keylistener-tool.d.ts.map +1 -1
  19. package/lib/features/accessibility/global-keylistener-tool.js +15 -4
  20. package/lib/features/accessibility/global-keylistener-tool.js.map +1 -1
  21. package/lib/features/accessibility/keyboard-tool-palette/keyboard-tool-palette.d.ts +0 -1
  22. package/lib/features/accessibility/keyboard-tool-palette/keyboard-tool-palette.d.ts.map +1 -1
  23. package/lib/features/accessibility/keyboard-tool-palette/keyboard-tool-palette.js +12 -39
  24. package/lib/features/accessibility/keyboard-tool-palette/keyboard-tool-palette.js.map +1 -1
  25. package/lib/features/accessibility/search/search-palette.d.ts.map +1 -1
  26. package/lib/features/accessibility/search/search-palette.js +3 -2
  27. package/lib/features/accessibility/search/search-palette.js.map +1 -1
  28. package/lib/features/accessibility/search/search-tool.d.ts.map +1 -1
  29. package/lib/features/accessibility/search/search-tool.js +9 -3
  30. package/lib/features/accessibility/search/search-tool.js.map +1 -1
  31. package/lib/features/accessibility/view-key-tools/grid-cell-zoom-key-tool.d.ts.map +1 -1
  32. package/lib/features/accessibility/view-key-tools/grid-cell-zoom-key-tool.js +10 -5
  33. package/lib/features/accessibility/view-key-tools/grid-cell-zoom-key-tool.js.map +1 -1
  34. package/lib/features/change-bounds/resize/resize-default-tool.d.ts.map +1 -1
  35. package/lib/features/change-bounds/resize/resize-default-tool.js +9 -3
  36. package/lib/features/change-bounds/resize/resize-default-tool.js.map +1 -1
  37. package/lib/features/change-bounds/resize/resize-tool.d.ts.map +1 -1
  38. package/lib/features/change-bounds/resize/resize-tool.js +29 -9
  39. package/lib/features/change-bounds/resize/resize-tool.js.map +1 -1
  40. package/lib/features/tool-palette/tool-palette.d.ts +2 -0
  41. package/lib/features/tool-palette/tool-palette.d.ts.map +1 -1
  42. package/lib/features/tool-palette/tool-palette.js +57 -35
  43. package/lib/features/tool-palette/tool-palette.js.map +1 -1
  44. package/lib/features/tools/change-bounds/change-bounds-tool.d.ts.map +1 -1
  45. package/lib/features/tools/change-bounds/change-bounds-tool.js +9 -3
  46. package/lib/features/tools/change-bounds/change-bounds-tool.js.map +1 -1
  47. package/lib/features/viewport/viewport-tool.d.ts.map +1 -1
  48. package/lib/features/viewport/viewport-tool.js +21 -5
  49. package/lib/features/viewport/viewport-tool.js.map +1 -1
  50. package/lib/index.d.ts +1 -0
  51. package/lib/index.d.ts.map +1 -1
  52. package/lib/index.js +1 -0
  53. package/lib/index.js.map +1 -1
  54. package/lib/views/glsp-projection-view.d.ts.map +1 -1
  55. package/lib/views/glsp-projection-view.js +2 -1
  56. package/lib/views/glsp-projection-view.js.map +1 -1
  57. package/package.json +3 -3
  58. package/src/base/auto-complete/base-autocomplete-palette.ts +2 -1
  59. package/src/base/messages.json +82 -0
  60. package/src/base/messages.ts +96 -0
  61. package/src/base/shortcuts/available-shortcuts-extension.ts +5 -4
  62. package/src/features/accessibility/element-navigation/diagram-navigation-tool.ts +17 -5
  63. package/src/features/accessibility/focus-tracker/focus-tracker-tool.ts +3 -3
  64. package/src/features/accessibility/global-keylistener-tool.ts +17 -4
  65. package/src/features/accessibility/keyboard-tool-palette/keyboard-tool-palette.ts +13 -47
  66. package/src/features/accessibility/search/search-palette.ts +3 -2
  67. package/src/features/accessibility/search/search-tool.ts +11 -3
  68. package/src/features/accessibility/view-key-tools/grid-cell-zoom-key-tool.ts +11 -4
  69. package/src/features/change-bounds/resize/resize-default-tool.ts +11 -3
  70. package/src/features/change-bounds/resize/resize-tool.ts +29 -7
  71. package/src/features/tool-palette/tool-palette.ts +60 -34
  72. package/src/features/tools/change-bounds/change-bounds-tool.ts +11 -3
  73. package/src/features/viewport/viewport-tool.ts +23 -5
  74. package/src/index.ts +1 -0
  75. package/src/views/glsp-projection-view.tsx +2 -1
  76. package/lib/features/accessibility/toast/messages.json +0 -18
  77. package/src/features/accessibility/toast/messages.json +0 -18
@@ -0,0 +1,82 @@
1
+ {
2
+ "navigation": {
3
+ "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.",
4
+ "default_navigation_mode_deactivated": "Navigation Off: Press 'N' for default navigation, 'ALT+N' for position based navigation.",
5
+ "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.",
6
+ "local_navigation_mode_deactivated": "Position based Nav Off: Press 'N' for default navigation, 'ALT+N' for position based navigation.",
7
+ "shortcut_local_mode": "Activate local navigation mode",
8
+ "shortcut_global_mode": "Activate global navigation mode"
9
+ },
10
+ "focus": {
11
+ "focus_not_set": "Focus not set",
12
+ "focus_on": "Currently focused: ",
13
+ "focus_off": "Currently no element is focused.",
14
+ "focus_within": "Within",
15
+ "shortcut_focus_palette": "Focus on tool palette",
16
+ "shortcut_focus_graph": "Focus on graph"
17
+ },
18
+ "resize": {
19
+ "resize_mode_activated": "Resize On: Use plus(+) and minus(-) to resize, 'CTRL'+'0' for default size. Press 'ESC' to exit.",
20
+ "resize_mode_deactivated": "Resize Off: Press 'ALT'+'A' for resize mode.",
21
+ "shortcut_activate": "Activate resize mode for selected element",
22
+ "shortcut_deactivate": "Deactivate resize handler",
23
+ "shortcut_increase": "Increase size of element",
24
+ "shortcut_decrease": "Decrease size of element",
25
+ "shortcut_reset": "Set element size to default"
26
+ },
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
+ "search": {
35
+ "shortcut_activate": "Activate search for elements",
36
+ "placeholder": "Search for elements...",
37
+ "label": "Search Field"
38
+ },
39
+ "tool_palette": {
40
+ "label": "Tool Palette",
41
+ "delete_button": "Enable deletion tool",
42
+ "marquee_button": "Enable marquee tool",
43
+ "marquee_message": "Currently marquee tool is only usable with mouse.",
44
+ "search_placeholder": "Search...",
45
+ "search_button": "Filter palette entries",
46
+ "selection_button": "Enable selection tool",
47
+ "validate_button": "Validate model",
48
+ "reset_viewport_button": "Reset Viewport",
49
+ "toggle_grid_button": "Toggle Grid",
50
+ "debug_mode_button": "Debug Mode",
51
+ "minimize": "Minimize palette",
52
+ "maximize": "Maximize palette",
53
+ "no_items": "No results found."
54
+ },
55
+ "viewport": {
56
+ "shortcut_move_viewport": "Move viewport",
57
+ "shortcut_zoom_viewport": "Zoom viewport",
58
+ "shortcut_zoom_element": "Zoom element"
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
+ }
@@ -0,0 +1,96 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2025 EclipseSource and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0.
7
+ *
8
+ * This Source Code may also be made available under the following Secondary
9
+ * Licenses when the conditions for such availability set forth in the Eclipse
10
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ * with the GNU Classpath Exception which is available at
12
+ * https://www.gnu.org/software/classpath/license.html.
13
+ *
14
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
+ ********************************************************************************/
16
+ import { Disposable, Emitter } from '@eclipse-glsp/sprotty';
17
+ import * as rawMessages from './messages.json';
18
+
19
+ // Helper type to allow dynamic properties inside nested objects with known keys
20
+ type WithDynamicProperties<T> = T & Record<string, any>;
21
+
22
+ type DynamicDeepPartial<T> = WithDynamicProperties<{
23
+ [K in keyof T]?: T[K] extends object ? DynamicDeepPartial<T[K]> : T[K];
24
+ }>;
25
+
26
+ const deepUpdate = (target: any, updates: any): void => {
27
+ for (const key in updates) {
28
+ // Guard against prototype pollution and block __proto__ and constructor
29
+ if (!Object.prototype.hasOwnProperty.call(updates, key) || key === '__proto__' || key === 'constructor') {
30
+ continue;
31
+ }
32
+
33
+ if (updates[key] && typeof updates[key] === 'object' && !Array.isArray(updates[key])) {
34
+ if (!target[key]) {
35
+ target[key] = {};
36
+ }
37
+ deepUpdate(target[key], updates[key]);
38
+ } else {
39
+ target[key] = updates[key];
40
+ }
41
+ }
42
+ };
43
+
44
+ /**
45
+ * Type-safe access to the known messages defined within the framework.
46
+ */
47
+ export type Messages = WithDynamicProperties<{
48
+ [K in keyof typeof rawMessages]: (typeof rawMessages)[K] extends object
49
+ ? WithDynamicProperties<(typeof rawMessages)[K]>
50
+ : (typeof rawMessages)[K];
51
+ }>;
52
+
53
+ /**
54
+ * The messages object containing all known messages.
55
+ */
56
+ export const messages: Messages = rawMessages;
57
+ const messagesUpdatedEmitter = new Emitter<Messages>();
58
+ /**
59
+ * Event that is fired when the messages are updated.
60
+ */
61
+ export const onMessagesUpdated = messagesUpdatedEmitter.event;
62
+
63
+ /**
64
+ * Update the messages with the given set of messages. This may include overwriting existing messages or adding new ones.
65
+ *
66
+ * @param updates The updates to apply to the messages object.
67
+ */
68
+ export const updateMessages = (updates: DynamicDeepPartial<Messages>): void => {
69
+ deepUpdate(messages, updates);
70
+ messagesUpdatedEmitter.fire(messages);
71
+ };
72
+
73
+ /**
74
+ * Executes the given listener with the current messages and re-executes it whenever the messages are updated.
75
+ * If the listener returns a disposable, it will be disposed before the listener is called again.
76
+ *
77
+ * @param listener The listener to re-execute when the messages are updated.
78
+ * @param options Options to control the behavior of the listener execution.
79
+ * @returns A disposable that can be used to clean up the listener.
80
+ */
81
+ export function repeatOnMessagesUpdated(
82
+ listener: (messages?: Messages) => unknown,
83
+ options: { initial: boolean } = { initial: true }
84
+ ): Disposable {
85
+ let cleanup = options.initial ? listener(messages) : {};
86
+
87
+ const updateListener = onMessagesUpdated(() => {
88
+ Disposable.dispose(cleanup);
89
+ cleanup = listener();
90
+ });
91
+
92
+ return Disposable.create(() => {
93
+ Disposable.dispose(cleanup);
94
+ updateListener.dispose();
95
+ });
96
+ }
@@ -18,6 +18,7 @@ import { GModelRoot, matchesKeystroke, TYPES } from '@eclipse-glsp/sprotty';
18
18
  import { inject, injectable } from 'inversify';
19
19
  import { groupBy } from 'lodash';
20
20
  import { GLSPAbstractUIExtension } from '../../base/ui-extension/ui-extension';
21
+ import { messages } from '../messages';
21
22
  import type { IShortcutManager, ShortcutRegistration } from './shortcuts-manager';
22
23
 
23
24
  @injectable()
@@ -71,8 +72,8 @@ export class AvailableShortcutsUIExtension extends GLSPAbstractUIExtension {
71
72
 
72
73
  commandCell.classList.add('column-title');
73
74
 
74
- commandCell.innerText = 'Command';
75
- keybindingCell.innerText = 'Keybinding';
75
+ commandCell.innerText = messages.shortcut.header_command;
76
+ keybindingCell.innerText = messages.shortcut.header_shortcut;
76
77
 
77
78
  headerRow.appendChild(commandCell);
78
79
  headerRow.appendChild(keybindingCell);
@@ -134,7 +135,7 @@ export class AvailableShortcutsUIExtension extends GLSPAbstractUIExtension {
134
135
  // create title
135
136
  const menuTitle = document.createElement('h3');
136
137
  menuTitle.classList.add('menu-header');
137
- menuTitle.innerText = 'Keyboard Shortcuts';
138
+ menuTitle.innerText = messages.shortcut.title;
138
139
  this.container.appendChild(menuTitle);
139
140
 
140
141
  const closeBtn = document.createElement('button');
@@ -158,7 +159,7 @@ export class AvailableShortcutsUIExtension extends GLSPAbstractUIExtension {
158
159
 
159
160
  this.container.appendChild(this.shortcutsContainer);
160
161
  containerElement.appendChild(this.container);
161
- containerElement.ariaLabel = 'Shortcut-Menu';
162
+ containerElement.ariaLabel = messages.shortcut.menu_title;
162
163
 
163
164
  this.refreshUI();
164
165
  }
@@ -30,6 +30,7 @@ import {
30
30
  toArray
31
31
  } from '@eclipse-glsp/sprotty';
32
32
  import { inject, injectable } from 'inversify';
33
+ import { messages, repeatOnMessagesUpdated } from '../../../base/messages';
33
34
  import { AvailableShortcutsTool } from '../../../base/shortcuts/available-shortcuts-tool';
34
35
  import type { IShortcutManager } from '../../../base/shortcuts/shortcuts-manager';
35
36
  import { EnableDefaultToolsAction, EnableToolsAction } from '../../../base/tool-manager/tool';
@@ -38,7 +39,6 @@ import { SelectableBoundsAware } from '../../../utils/gmodel-util';
38
39
  import { BaseTool } from '../../tools/base-tools';
39
40
  import { RepositionAction } from '../../viewport/reposition';
40
41
  import { SearchAutocompletePaletteTool } from '../search/search-tool';
41
- import * as messages from '../toast/messages.json';
42
42
  import { ShowToastMessageAction } from '../toast/toast-handler';
43
43
  import { ElementNavigator } from './element-navigator';
44
44
 
@@ -60,10 +60,22 @@ export class ElementNavigatorTool extends BaseTool {
60
60
  enable(): void {
61
61
  this.toDisposeOnDisable.push(
62
62
  this.keyTool.registerListener(this.elementNavigatorKeyListener),
63
- this.shortcutManager.register(ElementNavigatorTool.TOKEN, [
64
- { shortcuts: ['ALT', 'N'], description: 'Activate local navigation mode', group: 'Navigation', position: 0 },
65
- { shortcuts: ['N'], description: 'Activate global navigation mode', group: 'Navigation', position: 1 }
66
- ])
63
+ repeatOnMessagesUpdated(() =>
64
+ this.shortcutManager.register(ElementNavigatorTool.TOKEN, [
65
+ {
66
+ shortcuts: ['ALT', 'N'],
67
+ description: messages.navigation.shortcut_local_mode,
68
+ group: messages.shortcut.group_navigation,
69
+ position: 0
70
+ },
71
+ {
72
+ shortcuts: ['N'],
73
+ description: messages.navigation.shortcut_global_mode,
74
+ group: messages.shortcut.group_navigation,
75
+ position: 1
76
+ }
77
+ ])
78
+ )
67
79
  );
68
80
  }
69
81
  }
@@ -16,8 +16,8 @@
16
16
 
17
17
  import { IActionDispatcher, TYPES, ViewerOptions } from '@eclipse-glsp/sprotty';
18
18
  import { inject, injectable } from 'inversify';
19
+ import { messages } from '../../../base/messages';
19
20
  import { Tool } from '../../../base/tool-manager/tool';
20
- import * as messages from '../toast/messages.json';
21
21
  import { ShowToastMessageAction } from '../toast/toast-handler';
22
22
 
23
23
  @injectable()
@@ -51,7 +51,7 @@ export class FocusTrackerTool implements Tool {
51
51
  }
52
52
 
53
53
  protected async focusOut(event: FocusEvent): Promise<void> {
54
- await this.showToast('Focus not set');
54
+ await this.showToast(messages.focus.focus_not_set);
55
55
  }
56
56
 
57
57
  protected async focusIn(event: FocusEvent): Promise<void> {
@@ -68,7 +68,7 @@ export class FocusTrackerTool implements Tool {
68
68
  if (parent === undefined && textMessage !== undefined) {
69
69
  message = textMessage;
70
70
  } else if (parent !== undefined && textMessage === undefined) {
71
- message = `Focus is in ${parent.ariaLabel}`;
71
+ message = `${messages.focus.focus_within} ${parent.ariaLabel}`;
72
72
  } else if (parent !== undefined && textMessage !== undefined) {
73
73
  message = `${parent.ariaLabel} -> ${textMessage}`;
74
74
  }
@@ -15,6 +15,7 @@
15
15
  ********************************************************************************/
16
16
  import { Action, matchesKeystroke, SetUIExtensionVisibilityAction, TYPES } from '@eclipse-glsp/sprotty';
17
17
  import { inject, injectable } from 'inversify';
18
+ import { messages, repeatOnMessagesUpdated } from '../../base/messages';
18
19
  import type { IShortcutManager } from '../../base/shortcuts/shortcuts-manager';
19
20
  import { KeyboardGridMetadata, KeyboardNodeGridMetadata } from '../accessibility/keyboard-grid/constants';
20
21
  import { ToolPalette } from '../tool-palette/tool-palette';
@@ -41,10 +42,22 @@ export class GlobalKeyListenerTool extends BaseEditTool {
41
42
  this.alreadyRegistered = true;
42
43
  document.addEventListener('keyup', this.trigger.bind(this));
43
44
 
44
- this.shortcutManager.register(GlobalKeyListenerTool.TOKEN, [
45
- { shortcuts: ['ALT', 'P'], description: 'Focus on tool palette', group: 'Tool-Palette', position: 0 },
46
- { shortcuts: ['ALT', 'G'], description: 'Focus on graph', group: 'Graph', position: 0 }
47
- ]);
45
+ repeatOnMessagesUpdated(() =>
46
+ this.shortcutManager.register(GlobalKeyListenerTool.TOKEN, [
47
+ {
48
+ shortcuts: ['ALT', 'P'],
49
+ description: messages.focus.shortcut_focus_palette,
50
+ group: messages.shortcut.group_tool_palette,
51
+ position: 0
52
+ },
53
+ {
54
+ shortcuts: ['ALT', 'G'],
55
+ description: messages.focus.shortcut_focus_graph,
56
+ group: messages.shortcut.group_graph,
57
+ position: 0
58
+ }
59
+ ])
60
+ );
48
61
  }
49
62
  }
50
63
 
@@ -26,28 +26,18 @@ import {
26
26
  TriggerNodeCreationAction
27
27
  } from '@eclipse-glsp/sprotty';
28
28
  import { injectable } from 'inversify';
29
+ import { messages } from '../../../base/messages';
29
30
  import { EnableDefaultToolsAction, EnableToolsAction } from '../../../base/tool-manager/tool';
30
- import {
31
- changeCodiconClass,
32
- compare,
33
- createIcon,
34
- createToolGroup,
35
- EnableToolPaletteAction,
36
- ToolPalette
37
- } from '../../tool-palette/tool-palette';
31
+ import { compare, createIcon, createToolGroup, EnableToolPaletteAction, ToolPalette } from '../../tool-palette/tool-palette';
38
32
  import { MouseDeleteTool } from '../../tools/deletion/delete-tool';
39
33
  import { MarqueeMouseTool } from '../../tools/marquee-selection/marquee-mouse-tool';
40
34
  import { FocusDomAction } from '../actions';
41
35
  import { EdgeAutocompletePaletteMetadata } from '../edge-autocomplete/edge-autocomplete-palette';
42
36
  import { ElementNavigatorKeyListener } from '../element-navigation/diagram-navigation-tool';
43
37
  import { KeyboardNodeGridMetadata } from '../keyboard-grid/constants';
44
- import * as messages from '../toast/messages.json';
45
38
  import { ShowToastMessageAction } from '../toast/toast-handler';
46
39
 
47
40
  const SEARCH_ICON_ID = 'search';
48
- const PALETTE_ICON_ID = 'tools';
49
- const CHEVRON_DOWN_ICON_ID = 'chevron-right';
50
- const PALETTE_HEIGHT = '500px';
51
41
  const SELECTION_TOOL_KEY: KeyCode[] = ['Digit1', 'Numpad1'];
52
42
  const DELETION_TOOL_KEY: KeyCode[] = ['Digit2', 'Numpad2'];
53
43
  const MARQUEE_TOOL_KEY: KeyCode[] = ['Digit3', 'Numpad3'];
@@ -103,9 +93,10 @@ export class KeyboardToolPalette extends ToolPalette {
103
93
  }
104
94
 
105
95
  protected override initializeContents(_containerElement: HTMLElement): void {
106
- this.containerElement.setAttribute('aria-label', 'Tool Palette');
96
+ this.containerElement.setAttribute('aria-label', messages.tool_palette.label);
107
97
  this.containerElement.tabIndex = 20;
108
98
  this.containerElement.classList.add('accessibility-tool-palette');
99
+ this.addMinimizePaletteButton();
109
100
  this.createHeader();
110
101
  this.createBody();
111
102
  this.lastActiveButton = this.defaultToolsButton;
@@ -147,31 +138,6 @@ export class KeyboardToolPalette extends ToolPalette {
147
138
  }
148
139
  }
149
140
 
150
- protected override addMinimizePaletteButton(): void {
151
- const baseDiv = document.getElementById(this.options.baseDiv);
152
- const minPaletteDiv = document.createElement('div');
153
- minPaletteDiv.classList.add('minimize-palette-button');
154
- this.containerElement.classList.add('collapsible-palette');
155
- if (baseDiv) {
156
- const insertedDiv = baseDiv.insertBefore(minPaletteDiv, baseDiv.firstChild);
157
- const minimizeIcon = createIcon(CHEVRON_DOWN_ICON_ID);
158
- this.updateMinimizePaletteButtonTooltip(minPaletteDiv);
159
- minimizeIcon.onclick = _event => {
160
- if (this.isPaletteMaximized()) {
161
- this.containerElement.style.overflow = 'hidden';
162
- this.containerElement.style.maxHeight = '0px';
163
- } else {
164
- this.containerElement.style.overflow = 'visible';
165
- this.containerElement.style.maxHeight = PALETTE_HEIGHT;
166
- }
167
- this.updateMinimizePaletteButtonTooltip(minPaletteDiv);
168
- changeCodiconClass(minimizeIcon, PALETTE_ICON_ID);
169
- changeCodiconClass(minimizeIcon, CHEVRON_DOWN_ICON_ID);
170
- };
171
- insertedDiv.appendChild(minimizeIcon);
172
- }
173
- }
174
-
175
141
  protected override createBody(): void {
176
142
  const bodyDiv = document.createElement('div');
177
143
  bodyDiv.classList.add('palette-body');
@@ -199,11 +165,11 @@ export class KeyboardToolPalette extends ToolPalette {
199
165
 
200
166
  if (this.paletteItems.length === 0) {
201
167
  const noResultsDiv = document.createElement('div');
202
- noResultsDiv.innerText = 'No results found.';
168
+ noResultsDiv.innerText = messages.tool_palette.no_items;
203
169
  noResultsDiv.classList.add('tool-button');
204
170
  bodyDiv.appendChild(noResultsDiv);
205
171
  }
206
- // Remove existing body to refresh filtered entries
172
+ // Replace existing body to refresh filtered entries
207
173
  if (this.bodyDiv) {
208
174
  this.containerElement.removeChild(this.bodyDiv);
209
175
  }
@@ -261,7 +227,7 @@ export class KeyboardToolPalette extends ToolPalette {
261
227
  protected override createDefaultToolButton(): HTMLElement {
262
228
  const button = createIcon('inspect');
263
229
  button.id = 'btn_default_tools';
264
- button.title = 'Enable selection tool';
230
+ button.title = messages.tool_palette.selection_button;
265
231
  button.onclick = this.onClickStaticToolButton(button);
266
232
  button.appendChild(this.createKeyboardShotcut(SELECTION_TOOL_KEY[0]));
267
233
 
@@ -270,7 +236,7 @@ export class KeyboardToolPalette extends ToolPalette {
270
236
 
271
237
  protected override createMouseDeleteToolButton(): HTMLElement {
272
238
  const deleteToolButton = createIcon('chrome-close');
273
- deleteToolButton.title = 'Enable deletion tool';
239
+ deleteToolButton.title = messages.tool_palette.delete_button;
274
240
  deleteToolButton.onclick = this.onClickStaticToolButton(deleteToolButton, MouseDeleteTool.ID);
275
241
  deleteToolButton.appendChild(this.createKeyboardShotcut(DELETION_TOOL_KEY[0]));
276
242
 
@@ -279,10 +245,10 @@ export class KeyboardToolPalette extends ToolPalette {
279
245
 
280
246
  protected override createMarqueeToolButton(): HTMLElement {
281
247
  const marqueeToolButton = createIcon('screen-full');
282
- marqueeToolButton.title = 'Enable marquee tool';
248
+ marqueeToolButton.title = messages.tool_palette.marquee_button;
283
249
  const toastMessageAction = ShowToastMessageAction.createWithTimeout({
284
250
  id: Symbol.for(ElementNavigatorKeyListener.name),
285
- message: messages.tool_palette.marqueeTool
251
+ message: messages.tool_palette.marquee_message
286
252
  });
287
253
  marqueeToolButton.onclick = this.onClickStaticToolButton(marqueeToolButton, MarqueeMouseTool.ID, toastMessageAction);
288
254
  marqueeToolButton.appendChild(this.createKeyboardShotcut(MARQUEE_TOOL_KEY[0]));
@@ -292,7 +258,7 @@ export class KeyboardToolPalette extends ToolPalette {
292
258
 
293
259
  protected override createValidateButton(): HTMLElement {
294
260
  const validateToolButton = createIcon('pass');
295
- validateToolButton.title = 'Validate model';
261
+ validateToolButton.title = messages.tool_palette.validate_button;
296
262
  validateToolButton.onclick = _event => {
297
263
  const modelIds: string[] = [this.modelRootId];
298
264
  this.actionDispatcher.dispatch(RequestMarkersAction.create(modelIds));
@@ -330,7 +296,7 @@ export class KeyboardToolPalette extends ToolPalette {
330
296
  }
331
297
  };
332
298
  searchIcon.classList.add('search-icon');
333
- searchIcon.title = 'Filter palette entries';
299
+ searchIcon.title = messages.tool_palette.search_button;
334
300
  searchIcon.appendChild(this.createKeyboardShotcut(SEARCH_TOOL_KEY[0]));
335
301
 
336
302
  return searchIcon;
@@ -342,7 +308,7 @@ export class KeyboardToolPalette extends ToolPalette {
342
308
  searchField.tabIndex = 21;
343
309
  searchField.id = this.containerElement.id + '_search_field';
344
310
  searchField.type = 'text';
345
- searchField.placeholder = 'Search...';
311
+ searchField.placeholder = messages.tool_palette.search_placeholder;
346
312
  searchField.style.display = 'none';
347
313
  searchField.onkeyup = ev => {
348
314
  this.requestFilterUpdate(this.searchField.value);
@@ -34,6 +34,7 @@ import { BaseAutocompletePalette } from '../../../base/auto-complete/base-autoco
34
34
 
35
35
  import { AutocompleteSuggestion, IAutocompleteSuggestionProvider } from '../../../base/auto-complete/autocomplete-suggestion-providers';
36
36
  import { applyCssClasses, deleteCssClasses } from '../../../base/feedback/css-feedback';
37
+ import { messages } from '../../../base/messages';
37
38
  import { RepositionAction } from '../../../features/viewport/reposition';
38
39
  import { GEdge } from '../../../model';
39
40
 
@@ -121,8 +122,8 @@ export class SearchAutocompletePalette extends BaseAutocompletePalette {
121
122
  protected override initializeContents(containerElement: HTMLElement): void {
122
123
  super.initializeContents(containerElement);
123
124
 
124
- this.autocompleteWidget.inputField.placeholder = 'Search for elements';
125
- containerElement.setAttribute('aria-label', 'Search Field');
125
+ this.autocompleteWidget.inputField.placeholder = messages.search.placeholder;
126
+ containerElement.setAttribute('aria-label', messages.search.label);
126
127
  }
127
128
  protected getSuggestionProviders(root: Readonly<GModelRoot>, input: string): IAutocompleteSuggestionProvider[] {
128
129
  return [
@@ -16,6 +16,7 @@
16
16
 
17
17
  import { Action, GModelElement, KeyListener, matchesKeystroke, SetUIExtensionVisibilityAction, TYPES } from '@eclipse-glsp/sprotty';
18
18
  import { inject, injectable } from 'inversify';
19
+ import { messages, repeatOnMessagesUpdated } from '../../../base/messages';
19
20
  import type { IShortcutManager } from '../../../base/shortcuts/shortcuts-manager';
20
21
  import { BaseTool } from '../../tools/base-tools';
21
22
  import { SearchAutocompletePalette } from './search-palette';
@@ -36,9 +37,16 @@ export class SearchAutocompletePaletteTool extends BaseTool {
36
37
  enable(): void {
37
38
  this.toDisposeOnDisable.push(
38
39
  this.keyTool.registerListener(this.keyListener),
39
- this.shortcutManager.register(SearchAutocompletePaletteTool.TOKEN, [
40
- { shortcuts: ['CTRL', 'F'], description: 'Activate search for elements', group: 'Search', position: 0 }
41
- ])
40
+ repeatOnMessagesUpdated(() =>
41
+ this.shortcutManager.register(SearchAutocompletePaletteTool.TOKEN, [
42
+ {
43
+ shortcuts: ['CTRL', 'F'],
44
+ description: messages.search.shortcut_activate,
45
+ group: messages.shortcut.group_search,
46
+ position: 0
47
+ }
48
+ ])
49
+ )
42
50
  );
43
51
  }
44
52
  }
@@ -28,6 +28,7 @@ import {
28
28
  matchesKeystroke
29
29
  } from '@eclipse-glsp/sprotty';
30
30
  import { inject, injectable } from 'inversify';
31
+ import { messages, repeatOnMessagesUpdated } from '../../../base/messages';
31
32
  import { SelectionService } from '../../../base/selection-service';
32
33
  import type { IShortcutManager } from '../../../base/shortcuts/shortcuts-manager';
33
34
  import { getAbsolutePositionByPoint } from '../../../utils/viewpoint-util';
@@ -35,7 +36,6 @@ import { BaseTool } from '../../tools/base-tools';
35
36
  import type { ZoomFactors } from '../../viewport/zoom-viewport-action';
36
37
  import { ElementNavigatorKeyListener } from '../element-navigation/diagram-navigation-tool';
37
38
  import { EnableKeyboardGridAction, KeyboardGridCellSelectedAction, KeyboardGridKeyboardEventAction } from '../keyboard-grid/action';
38
- import * as messages from '../toast/messages.json';
39
39
  import { HideToastAction, ShowToastMessageAction } from '../toast/toast-handler';
40
40
 
41
41
  /**
@@ -59,9 +59,16 @@ export class GridCellZoomTool extends BaseTool {
59
59
  enable(): void {
60
60
  this.toDisposeOnDisable.push(
61
61
  this.keyTool.registerListener(this.zoomKeyListener),
62
- this.shortcutManager.register(GridCellZoomTool.TOKEN, [
63
- { shortcuts: ['CTRL', '+'], description: 'Zoom in via Grid', group: 'Zoom', position: 0 }
64
- ])
62
+ repeatOnMessagesUpdated(() =>
63
+ this.shortcutManager.register(GridCellZoomTool.TOKEN, [
64
+ {
65
+ shortcuts: ['CTRL', '+'],
66
+ description: messages.grid.shortcut_zoom_in,
67
+ group: messages.shortcut.group_zoom,
68
+ position: 0
69
+ }
70
+ ])
71
+ )
65
72
  );
66
73
  }
67
74
 
@@ -16,6 +16,7 @@
16
16
 
17
17
  import { KeyListener, matchesKeystroke, TYPES, type Action, type GModelElement, type IActionDispatcher } from '@eclipse-glsp/sprotty';
18
18
  import { inject, injectable } from 'inversify';
19
+ import { messages, repeatOnMessagesUpdated } from '../../../base/messages';
19
20
  import { SelectionService } from '../../../base/selection-service';
20
21
  import type { ShortcutManager } from '../../../base/shortcuts/shortcuts-manager';
21
22
  import { EnableToolsAction } from '../../../base/tool-manager/tool';
@@ -67,9 +68,16 @@ export class DefaultResizeKeyTool extends BaseEditTool {
67
68
  enable(): void {
68
69
  this.toDisposeOnDisable.push(
69
70
  this.keyTool.registerListener(this.keyListener),
70
- this.shortcutManager.register(DefaultResizeKeyTool.TOKEN, [
71
- { shortcuts: ['ALT', 'A'], description: 'Activate resize mode for selected element', group: 'Resize', position: 0 }
72
- ])
71
+ repeatOnMessagesUpdated(() =>
72
+ this.shortcutManager.register(DefaultResizeKeyTool.TOKEN, [
73
+ {
74
+ shortcuts: ['ALT', 'A'],
75
+ description: messages.resize.shortcut_activate,
76
+ group: messages.shortcut.group_resize,
77
+ position: 0
78
+ }
79
+ ])
80
+ )
73
81
  );
74
82
  }
75
83
  }
@@ -17,9 +17,9 @@
17
17
  import { KeyListener, matchesKeystroke, TYPES, type Action, type GModelElement } from '@eclipse-glsp/sprotty';
18
18
  import { inject, injectable } from 'inversify';
19
19
  import { Disposable } from 'vscode-jsonrpc';
20
+ import { messages, repeatOnMessagesUpdated } from '../../../base/messages';
20
21
  import { SelectionService } from '../../../base/selection-service';
21
22
  import type { ShortcutManager } from '../../../base/shortcuts/shortcuts-manager';
22
- import * as messages from '../../accessibility/toast/messages.json';
23
23
  import { ShowToastMessageAction } from '../../accessibility/toast/toast-handler';
24
24
  import { BaseEditTool } from '../../tools/base-tools';
25
25
  import { isResizable } from '../model';
@@ -100,12 +100,34 @@ export class ResizeKeyTool extends BaseEditTool {
100
100
 
101
101
  this.toDisposeOnDisable.push(
102
102
  this.keyTool.registerListener(this.keyListener),
103
- this.shortcutManager.register(ResizeKeyTool.TOKEN, [
104
- { shortcuts: ['Escape'], description: 'Deactivate resize handler ', group: 'Resize', position: 0 },
105
- { shortcuts: ['+'], description: 'Increase size of element', group: 'Resize', position: 1 },
106
- { shortcuts: ['-'], description: 'Increase size of element', group: 'Resize', position: 2 },
107
- { shortcuts: ['CTRL', '0'], description: 'Set element size to default', group: 'Resize', position: 3 }
108
- ]),
103
+ repeatOnMessagesUpdated(() =>
104
+ this.shortcutManager.register(ResizeKeyTool.TOKEN, [
105
+ {
106
+ shortcuts: ['Escape'],
107
+ description: messages.resize.shortcut_deactivate,
108
+ group: messages.shortcut.group_resize,
109
+ position: 0
110
+ },
111
+ {
112
+ shortcuts: ['+'],
113
+ description: messages.resize.shortcut_increase,
114
+ group: messages.shortcut.group_resize,
115
+ position: 1
116
+ },
117
+ {
118
+ shortcuts: ['-'],
119
+ description: messages.resize.shortcut_decrease,
120
+ group: messages.shortcut.group_resize,
121
+ position: 2
122
+ },
123
+ {
124
+ shortcuts: ['CTRL', '0'],
125
+ description: messages.resize.shortcut_reset,
126
+ group: messages.shortcut.group_resize,
127
+ position: 3
128
+ }
129
+ ])
130
+ ),
109
131
  Disposable.create(() => {
110
132
  this.dispatchActions(this.keyListener.disable());
111
133
  })