@eclipse-glsp/client 2.6.0-next.1 → 2.6.0-next.12

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 (174) hide show
  1. package/css/command-palette.css +2 -0
  2. package/css/navigation.css +2 -2
  3. package/css/search.css +12 -3
  4. package/lib/base/auto-complete/auto-complete-widget.d.ts +2 -2
  5. package/lib/base/auto-complete/auto-complete-widget.d.ts.map +1 -1
  6. package/lib/base/auto-complete/auto-complete-widget.js +5 -2
  7. package/lib/base/auto-complete/auto-complete-widget.js.map +1 -1
  8. package/lib/base/auto-complete/autocomplete-suggestion-provider.d.ts +56 -0
  9. package/lib/base/auto-complete/autocomplete-suggestion-provider.d.ts.map +1 -0
  10. package/lib/base/auto-complete/autocomplete-suggestion-provider.js +56 -0
  11. package/lib/base/auto-complete/autocomplete-suggestion-provider.js.map +1 -0
  12. package/lib/base/auto-complete/base-autocomplete-palette.d.ts +4 -9
  13. package/lib/base/auto-complete/base-autocomplete-palette.d.ts.map +1 -1
  14. package/lib/base/auto-complete/base-autocomplete-palette.js +2 -2
  15. package/lib/base/auto-complete/base-autocomplete-palette.js.map +1 -1
  16. package/lib/base/default.module.d.ts.map +1 -1
  17. package/lib/base/default.module.js +4 -0
  18. package/lib/base/default.module.js.map +1 -1
  19. package/lib/base/messages.json +68 -57
  20. package/lib/base/tool-manager/tool-manager.d.ts +2 -2
  21. package/lib/base/tool-manager/tool-manager.d.ts.map +1 -1
  22. package/lib/base/tool-manager/tool-manager.js +4 -4
  23. package/lib/base/tool-manager/tool-manager.js.map +1 -1
  24. package/lib/default-modules.d.ts +1 -1
  25. package/lib/default-modules.d.ts.map +1 -1
  26. package/lib/default-modules.js +4 -1
  27. package/lib/default-modules.js.map +1 -1
  28. package/lib/features/accessibility/accessibility-module.d.ts.map +1 -1
  29. package/lib/features/accessibility/accessibility-module.js +2 -4
  30. package/lib/features/accessibility/accessibility-module.js.map +1 -1
  31. package/lib/features/accessibility/edge-autocomplete/edge-autocomplete-palette.d.ts +21 -15
  32. package/lib/features/accessibility/edge-autocomplete/edge-autocomplete-palette.d.ts.map +1 -1
  33. package/lib/features/accessibility/edge-autocomplete/edge-autocomplete-palette.js +59 -45
  34. package/lib/features/accessibility/edge-autocomplete/edge-autocomplete-palette.js.map +1 -1
  35. package/lib/features/accessibility/element-navigation/diagram-navigation-tool.d.ts.map +1 -1
  36. package/lib/features/accessibility/element-navigation/diagram-navigation-tool.js +2 -3
  37. package/lib/features/accessibility/element-navigation/diagram-navigation-tool.js.map +1 -1
  38. package/lib/features/accessibility/{keyboard-pointer/keyboard-pointer-module.d.ts → keyboard/keyboard-module.d.ts} +2 -2
  39. package/lib/features/accessibility/keyboard/keyboard-module.d.ts.map +1 -0
  40. package/lib/features/accessibility/{keyboard-pointer/keyboard-pointer-module.js → keyboard/keyboard-module.js} +7 -4
  41. package/lib/features/accessibility/keyboard/keyboard-module.js.map +1 -0
  42. package/lib/features/accessibility/keyboard-grid/keyboard-grid-search-palette.d.ts +15 -12
  43. package/lib/features/accessibility/keyboard-grid/keyboard-grid-search-palette.d.ts.map +1 -1
  44. package/lib/features/accessibility/keyboard-grid/keyboard-grid-search-palette.js +40 -22
  45. package/lib/features/accessibility/keyboard-grid/keyboard-grid-search-palette.js.map +1 -1
  46. package/lib/features/accessibility/keyboard-grid/keyboard-node-grid.d.ts +1 -1
  47. package/lib/features/accessibility/keyboard-grid/keyboard-node-grid.js +2 -2
  48. package/lib/features/accessibility/keyboard-grid/keyboard-node-grid.js.map +1 -1
  49. package/lib/features/bounds/glsp-hidden-bounds-updater.d.ts +1 -1
  50. package/lib/features/bounds/glsp-hidden-bounds-updater.d.ts.map +1 -1
  51. package/lib/features/bounds/glsp-hidden-bounds-updater.js +4 -1
  52. package/lib/features/bounds/glsp-hidden-bounds-updater.js.map +1 -1
  53. package/lib/features/change-bounds/movement-restrictor.d.ts +12 -4
  54. package/lib/features/change-bounds/movement-restrictor.d.ts.map +1 -1
  55. package/lib/features/change-bounds/movement-restrictor.js +44 -17
  56. package/lib/features/change-bounds/movement-restrictor.js.map +1 -1
  57. package/lib/features/command-palette/command-palette.d.ts +3 -1
  58. package/lib/features/command-palette/command-palette.d.ts.map +1 -1
  59. package/lib/features/command-palette/command-palette.js +37 -0
  60. package/lib/features/command-palette/command-palette.js.map +1 -1
  61. package/lib/features/context-menu/delete-element-context-menu.d.ts +4 -4
  62. package/lib/features/context-menu/delete-element-context-menu.d.ts.map +1 -1
  63. package/lib/features/context-menu/delete-element-context-menu.js +6 -2
  64. package/lib/features/context-menu/delete-element-context-menu.js.map +1 -1
  65. package/lib/features/context-menu/server-context-menu-provider.d.ts +4 -4
  66. package/lib/features/context-menu/server-context-menu-provider.d.ts.map +1 -1
  67. package/lib/features/context-menu/server-context-menu-provider.js +4 -5
  68. package/lib/features/context-menu/server-context-menu-provider.js.map +1 -1
  69. package/lib/features/copy-paste/copy-paste-context-menu.d.ts +22 -5
  70. package/lib/features/copy-paste/copy-paste-context-menu.d.ts.map +1 -1
  71. package/lib/features/copy-paste/copy-paste-context-menu.js +16 -11
  72. package/lib/features/copy-paste/copy-paste-context-menu.js.map +1 -1
  73. package/lib/features/decoration/decoration-module.d.ts +1 -1
  74. package/lib/features/decoration/decoration-module.d.ts.map +1 -1
  75. package/lib/features/decoration/decoration-module.js +2 -1
  76. package/lib/features/decoration/decoration-module.js.map +1 -1
  77. package/lib/features/decoration/decoration-placer.d.ts +9 -3
  78. package/lib/features/decoration/decoration-placer.d.ts.map +1 -1
  79. package/lib/features/decoration/decoration-placer.js +32 -1
  80. package/lib/features/decoration/decoration-placer.js.map +1 -1
  81. package/{src/features/accessibility/edge-autocomplete/edge-autocomplete-context.ts → lib/features/search-palette/search-palette-key-listener.d.ts} +5 -9
  82. package/lib/features/search-palette/search-palette-key-listener.d.ts.map +1 -0
  83. package/lib/features/search-palette/search-palette-key-listener.js +45 -0
  84. package/lib/features/search-palette/search-palette-key-listener.js.map +1 -0
  85. package/lib/features/{accessibility/search → search-palette}/search-palette-module.d.ts +4 -3
  86. package/lib/features/search-palette/search-palette-module.d.ts.map +1 -0
  87. package/lib/features/search-palette/search-palette-module.js +39 -0
  88. package/lib/features/search-palette/search-palette-module.js.map +1 -0
  89. package/lib/features/search-palette/search-palette.d.ts +51 -0
  90. package/lib/features/search-palette/search-palette.d.ts.map +1 -0
  91. package/lib/features/search-palette/search-palette.js +141 -0
  92. package/lib/features/search-palette/search-palette.js.map +1 -0
  93. package/{src/base/auto-complete/autocomplete-suggestion-providers.ts → lib/features/search-palette/suggestions/edge-element-suggestions.d.ts} +11 -22
  94. package/lib/features/search-palette/suggestions/edge-element-suggestions.d.ts.map +1 -0
  95. package/lib/features/search-palette/suggestions/edge-element-suggestions.js +72 -0
  96. package/lib/features/search-palette/suggestions/edge-element-suggestions.js.map +1 -0
  97. package/lib/features/search-palette/suggestions/named-element-suggestions.d.ts +30 -0
  98. package/lib/features/search-palette/suggestions/named-element-suggestions.d.ts.map +1 -0
  99. package/lib/features/search-palette/suggestions/named-element-suggestions.js +83 -0
  100. package/lib/features/search-palette/suggestions/named-element-suggestions.js.map +1 -0
  101. package/lib/features/validation/marker-navigator.d.ts +3 -3
  102. package/lib/features/validation/marker-navigator.d.ts.map +1 -1
  103. package/lib/features/validation/marker-navigator.js +8 -7
  104. package/lib/features/validation/marker-navigator.js.map +1 -1
  105. package/lib/features/viewport/reposition.d.ts.map +1 -1
  106. package/lib/features/viewport/reposition.js +1 -5
  107. package/lib/features/viewport/reposition.js.map +1 -1
  108. package/lib/index.d.ts +7 -6
  109. package/lib/index.d.ts.map +1 -1
  110. package/lib/index.js +7 -6
  111. package/lib/index.js.map +1 -1
  112. package/lib/standalone-modules.d.ts +1 -1
  113. package/lib/standalone-modules.d.ts.map +1 -1
  114. package/lib/standalone-modules.js +2 -0
  115. package/lib/standalone-modules.js.map +1 -1
  116. package/lib/utils/gmodel-util.d.ts +32 -2
  117. package/lib/utils/gmodel-util.d.ts.map +1 -1
  118. package/lib/utils/gmodel-util.js +29 -1
  119. package/lib/utils/gmodel-util.js.map +1 -1
  120. package/package.json +3 -3
  121. package/src/base/auto-complete/auto-complete-widget.ts +7 -4
  122. package/src/base/auto-complete/autocomplete-suggestion-provider.ts +86 -0
  123. package/src/base/auto-complete/base-autocomplete-palette.ts +6 -6
  124. package/src/base/default.module.ts +5 -0
  125. package/src/base/messages.json +68 -57
  126. package/src/base/tool-manager/tool-manager.ts +4 -4
  127. package/src/default-modules.ts +4 -1
  128. package/src/features/accessibility/accessibility-module.ts +1 -3
  129. package/src/features/accessibility/edge-autocomplete/edge-autocomplete-palette.ts +75 -52
  130. package/src/features/accessibility/element-navigation/diagram-navigation-tool.ts +2 -4
  131. package/src/features/accessibility/{keyboard-pointer/keyboard-pointer-module.ts → keyboard/keyboard-module.ts} +12 -5
  132. package/src/features/accessibility/keyboard-grid/keyboard-grid-search-palette.ts +36 -22
  133. package/src/features/accessibility/keyboard-grid/keyboard-node-grid.ts +3 -3
  134. package/src/features/bounds/glsp-hidden-bounds-updater.ts +5 -1
  135. package/src/features/change-bounds/movement-restrictor.ts +72 -19
  136. package/src/features/command-palette/command-palette.ts +41 -1
  137. package/src/features/context-menu/delete-element-context-menu.ts +9 -5
  138. package/src/features/context-menu/server-context-menu-provider.ts +8 -9
  139. package/src/features/copy-paste/copy-paste-context-menu.ts +21 -17
  140. package/src/features/decoration/decoration-module.ts +2 -1
  141. package/src/features/decoration/decoration-placer.ts +49 -4
  142. package/src/features/{accessibility/search/search-palette-module.ts → search-palette/search-palette-key-listener.ts} +15 -14
  143. package/src/features/search-palette/search-palette-module.ts +48 -0
  144. package/src/features/search-palette/search-palette.ts +164 -0
  145. package/src/features/search-palette/suggestions/edge-element-suggestions.ts +71 -0
  146. package/src/features/search-palette/suggestions/named-element-suggestions.ts +88 -0
  147. package/src/features/validation/marker-navigator.ts +9 -8
  148. package/src/features/viewport/reposition.ts +1 -7
  149. package/src/index.ts +7 -6
  150. package/src/standalone-modules.ts +2 -0
  151. package/src/utils/gmodel-util.ts +59 -1
  152. package/lib/base/auto-complete/autocomplete-suggestion-providers.d.ts +0 -35
  153. package/lib/base/auto-complete/autocomplete-suggestion-providers.d.ts.map +0 -1
  154. package/lib/base/auto-complete/autocomplete-suggestion-providers.js +0 -18
  155. package/lib/base/auto-complete/autocomplete-suggestion-providers.js.map +0 -1
  156. package/lib/features/accessibility/edge-autocomplete/edge-autocomplete-context.d.ts +0 -23
  157. package/lib/features/accessibility/edge-autocomplete/edge-autocomplete-context.d.ts.map +0 -1
  158. package/lib/features/accessibility/edge-autocomplete/edge-autocomplete-context.js +0 -18
  159. package/lib/features/accessibility/edge-autocomplete/edge-autocomplete-context.js.map +0 -1
  160. package/lib/features/accessibility/keyboard-pointer/keyboard-pointer-module.d.ts.map +0 -1
  161. package/lib/features/accessibility/keyboard-pointer/keyboard-pointer-module.js.map +0 -1
  162. package/lib/features/accessibility/search/search-palette-module.d.ts.map +0 -1
  163. package/lib/features/accessibility/search/search-palette-module.js +0 -32
  164. package/lib/features/accessibility/search/search-palette-module.js.map +0 -1
  165. package/lib/features/accessibility/search/search-palette.d.ts +0 -51
  166. package/lib/features/accessibility/search/search-palette.d.ts.map +0 -1
  167. package/lib/features/accessibility/search/search-palette.js +0 -186
  168. package/lib/features/accessibility/search/search-palette.js.map +0 -1
  169. package/lib/features/accessibility/search/search-tool.d.ts +0 -33
  170. package/lib/features/accessibility/search/search-tool.d.ts.map +0 -1
  171. package/lib/features/accessibility/search/search-tool.js +0 -84
  172. package/lib/features/accessibility/search/search-tool.js.map +0 -1
  173. package/src/features/accessibility/search/search-palette.ts +0 -218
  174. package/src/features/accessibility/search/search-tool.ts +0 -74
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2020-2024 EclipseSource and others.
2
+ * Copyright (c) 2020-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
@@ -16,6 +16,7 @@
16
16
  import {
17
17
  Action,
18
18
  CenterAction,
19
+ ClientMenuItem,
19
20
  GIssueSeverity,
20
21
  GModelElement,
21
22
  GModelRoot,
@@ -23,7 +24,6 @@ import {
23
24
  IActionHandler,
24
25
  IContextMenuItemProvider,
25
26
  KeyListener,
26
- MenuItem,
27
27
  Point,
28
28
  SelectAction,
29
29
  TYPES,
@@ -35,6 +35,7 @@ import {
35
35
  matchesKeystroke
36
36
  } from '@eclipse-glsp/sprotty';
37
37
  import { inject, injectable } from 'inversify';
38
+ import { messages } from '../../base/messages';
38
39
  import { SelectionService } from '../../base/selection-service';
39
40
  import { BoundsAwareModelElement, SelectableElement, getElements, isSelectableAndBoundsAware } from '../../utils/gmodel-util';
40
41
  import { MarkerPredicates, collectIssueMarkers } from '../../utils/marker';
@@ -206,33 +207,33 @@ export class NavigateToMarkerActionHandler implements IActionHandler {
206
207
  export class MarkerNavigatorContextMenuItemProvider implements IContextMenuItemProvider {
207
208
  @inject(SelectionService) protected selectionService: SelectionService;
208
209
 
209
- getItems(root: Readonly<GModelRoot>, lastMousePosition?: Point): Promise<MenuItem[]> {
210
+ async getItems(root: Readonly<GModelRoot>, lastMousePosition?: Point): Promise<ClientMenuItem[]> {
210
211
  const selectedElementIds = Array.from(this.selectionService.getSelectedElementIDs());
211
212
  const hasMarkers = collectIssueMarkers(root).length > 0;
212
- return Promise.resolve([
213
+ return [
213
214
  {
214
215
  id: 'navigate',
215
- label: 'Go to',
216
+ label: messages.context_menu.marker.navigation,
216
217
  group: 'navigate',
217
218
  actions: [],
218
219
  children: [
219
220
  {
220
221
  id: 'next-marker',
221
- label: 'Next marker',
222
+ label: messages.context_menu.marker.next,
222
223
  group: 'marker',
223
224
  actions: [NavigateToMarkerAction.create({ direction: 'next', selectedElementIds })],
224
225
  isEnabled: () => hasMarkers
225
226
  },
226
227
  {
227
228
  id: 'previous-marker',
228
- label: 'Previous marker',
229
+ label: messages.context_menu.marker.previous,
229
230
  group: 'marker',
230
231
  actions: [NavigateToMarkerAction.create({ direction: 'previous', selectedElementIds })],
231
232
  isEnabled: () => hasMarkers
232
233
  }
233
234
  ]
234
235
  }
235
- ]);
236
+ ];
236
237
  }
237
238
  }
238
239
 
@@ -70,13 +70,7 @@ export class RepositionCommand extends BoundsAwareViewportCommand {
70
70
  if (element instanceof GChildElement && element.parent !== viewport) {
71
71
  return this.boundsInViewport(element.parent, element.parent.localToParent(bounds) as Bounds, viewport);
72
72
  } else if (element instanceof GEdge) {
73
- const edgeBounds = getRouteBounds(calcElementAndRoute(element).newRoutingPoints ?? []);
74
-
75
- if (element instanceof GChildElement && element.parent !== viewport) {
76
- return this.boundsInViewport(element.parent, element.parent.localToParent(edgeBounds), viewport);
77
- }
78
-
79
- return edgeBounds;
73
+ return getRouteBounds(calcElementAndRoute(element).newRoutingPoints ?? []);
80
74
  }
81
75
 
82
76
  return bounds;
package/src/index.ts CHANGED
@@ -18,7 +18,7 @@ export * from './base/action-handler-registry';
18
18
  export * from './base/args-feature';
19
19
  export * from './base/auto-complete/auto-complete-actions';
20
20
  export * from './base/auto-complete/auto-complete-widget';
21
- export * from './base/auto-complete/autocomplete-suggestion-providers';
21
+ export * from './base/auto-complete/autocomplete-suggestion-provider';
22
22
  export * from './base/auto-complete/base-autocomplete-palette';
23
23
  export * from './base/auto-complete/validation-decorator';
24
24
  export * from './base/command-stack';
@@ -58,7 +58,6 @@ export * from './default-modules';
58
58
  export * from './features/accessibility/accessibility-module';
59
59
  export * from './features/accessibility/actions';
60
60
  export * from './features/accessibility/edge-autocomplete/action';
61
- export * from './features/accessibility/edge-autocomplete/edge-autocomplete-context';
62
61
  export * from './features/accessibility/edge-autocomplete/edge-autocomplete-palette';
63
62
  export * from './features/accessibility/edge-autocomplete/edge-autocomplete-tool';
64
63
  export * from './features/accessibility/element-navigation/diagram-navigation-tool';
@@ -79,13 +78,10 @@ export * from './features/accessibility/keyboard-pointer/actions';
79
78
  export * from './features/accessibility/keyboard-pointer/constants';
80
79
  export * from './features/accessibility/keyboard-pointer/keyboard-pointer';
81
80
  export * from './features/accessibility/keyboard-pointer/keyboard-pointer-listener';
82
- export * from './features/accessibility/keyboard-pointer/keyboard-pointer-module';
83
81
  export * from './features/accessibility/keyboard-pointer/keyboard-pointer-position';
84
82
  export * from './features/accessibility/keyboard-tool-palette/keyboard-tool-palette';
85
83
  export * from './features/accessibility/keyboard-tool-palette/keyboard-tool-palette-module';
86
- export * from './features/accessibility/search/search-palette';
87
- export * from './features/accessibility/search/search-palette-module';
88
- export * from './features/accessibility/search/search-tool';
84
+ export * from './features/accessibility/keyboard/keyboard-module';
89
85
  export * from './features/accessibility/toast/toast-handler';
90
86
  export * from './features/accessibility/toast/toast-module';
91
87
  export * from './features/accessibility/toast/toast-tool';
@@ -171,6 +167,11 @@ export * from './features/routing/edge-router';
171
167
  export * from './features/routing/routing-module';
172
168
  export * from './features/save/save-keylistener';
173
169
  export * from './features/save/save-module';
170
+ export * from './features/search-palette/search-palette';
171
+ export * from './features/search-palette/search-palette-key-listener';
172
+ export * from './features/search-palette/search-palette-module';
173
+ export * from './features/search-palette/suggestions/edge-element-suggestions';
174
+ export * from './features/search-palette/suggestions/named-element-suggestions';
174
175
  export * from './features/select/select-feedback-command';
175
176
  export * from './features/select/select-module';
176
177
  export * from './features/select/select-mouse-listener';
@@ -39,6 +39,7 @@ import { standaloneResizeModule } from './features/change-bounds/resize/resize-m
39
39
  import { standaloneCopyPasteModule } from './features/copy-paste/copy-paste-modules';
40
40
  import { standaloneExportModule } from './features/export/export-modules';
41
41
  import { saveModule } from './features/save/save-module';
42
+ import { standaloneSearchPaletteModule } from './features/search-palette/search-palette-module';
42
43
  import { standaloneSelectModule } from './features/select/select-module';
43
44
  import { undoRedoModule } from './features/undo-redo/undo-redo-module';
44
45
  import { standaloneMarkerNavigatorModule } from './features/validation/validation-modules';
@@ -101,6 +102,7 @@ export const STANDALONE_MODULES = [
101
102
  standaloneDefaultModule,
102
103
  standaloneShortcutsModule,
103
104
  standaloneResizeModule,
105
+ standaloneSearchPaletteModule,
104
106
  saveModule,
105
107
  undoRedoModule
106
108
  ] as const;
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2019-2024 EclipseSource and others.
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
@@ -86,6 +86,63 @@ export function getMatchingElements<T>(index: ModelIndexImpl, predicate: ModelFi
86
86
  return Array.from(filter(index, predicate));
87
87
  }
88
88
 
89
+ /**
90
+ * Retrieves an array of all parent elements for the given element that match the given type guard.
91
+ * @param element The {@link GModelElement} for which the parent elements should be retrieved.
92
+ * @param guard The type guard that should be used.
93
+ * @returns An array of all parent elements that match the type guard
94
+ * (correctly casted to also include the additional type of the guard).
95
+ */
96
+ export function getParents<T extends GParentElement>(element: GModelElement, guard: TypeGuard<T>): T[];
97
+ /**
98
+ * Retrieves an array of all parent elements for the given element that match the given {@link ModelFilterPredicate}.
99
+ * @param element The {@link GModelElement} for which the parent elements should be retrieved.
100
+ * @param predicate The filter predicate that should be used.
101
+ * @returns An array of all parent elements that match the filter predicate
102
+ * (correctly casted to also include the additional type of the predicate).
103
+ */
104
+ export function getParents<T>(element: GModelElement, predicate: ModelFilterPredicate<T>): (GParentElement & T)[];
105
+ export function getParents(element: GModelElement, filterPredicate: (parent: GParentElement) => boolean): GParentElement[] {
106
+ const parents: GParentElement[] = [];
107
+ let current: GModelElement | undefined = element;
108
+ while (current instanceof GChildElement) {
109
+ const parent: GParentElement = current.parent;
110
+ if (filterPredicate(parent)) {
111
+ parents.push(parent);
112
+ }
113
+ current = parent;
114
+ }
115
+ return parents;
116
+ }
117
+
118
+ /** * Retrieves an array of all child elements for the given element that match the given type guard.
119
+ * @param element The {@link GModelElement} for which the child elements should be retrieved.
120
+ * @param guard The type guard that should be used.
121
+ * @returns An array of all child elements that match the type guard
122
+ * (correctly casted to also include the additional type of the guard).
123
+ */
124
+ export function getChildren<T extends GChildElement>(element: GModelElement, guard: TypeGuard<T>): T[];
125
+ /** * Retrieves an array of all child elements for the given element that match the given {@link ModelFilterPredicate}.
126
+ * @param element The {@link GModelElement} for which the child elements should be retrieved.
127
+ * @param predicate The filter predicate that should be used.
128
+ * @returns An array of all child elements that match the filter predicate
129
+ * (correctly casted to also include the additional type of the predicate).
130
+ */
131
+ export function getChildren<T>(element: GModelElement, predicate: ModelFilterPredicate<T>): (GChildElement & T)[];
132
+ export function getChildren(element: GModelElement, filterPredicate: (parent: GChildElement) => boolean): GChildElement[] {
133
+ const children: GChildElement[] = [];
134
+ if (element instanceof GParentElement) {
135
+ for (const child of element.children) {
136
+ if (filterPredicate(child)) {
137
+ children.push(child);
138
+ }
139
+ if (child instanceof GParentElement) {
140
+ children.push(...getChildren(child, filterPredicate as any));
141
+ }
142
+ }
143
+ }
144
+ return children;
145
+ }
89
146
  /**
90
147
  * Invokes the given model index to retrieve the corresponding model elements for the given set of ids. Ids that
91
148
  * have no corresponding element in the index will be ignored.
@@ -104,6 +161,7 @@ export function getElements<S extends GModelElement>(index: ModelIndexImpl, elem
104
161
  };
105
162
  return elementsIDs.map(id => index.getById(id)).filter(filterFn);
106
163
  }
164
+
107
165
  /**
108
166
  * Retrieves the amount of currently selected elements in the given {@link ModelIndexImpl}.
109
167
  * @param index The {@link ModelIndexImpl}.
@@ -1,35 +0,0 @@
1
- /********************************************************************************
2
- * Copyright (c) 2023 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
- import { GModelElement, GModelRoot, LabeledAction } from '@eclipse-glsp/sprotty';
17
- /**
18
- * Interface for a provider that provides suggestions that can be used to fill the autocomplete
19
- */
20
- export interface IAutocompleteSuggestionProvider {
21
- /**
22
- * Returns the suggestions based on the provided parameters.
23
- * @param root: The root model
24
- * @param text: The text input provided by the user.
25
- */
26
- retrieveSuggestions(root: Readonly<GModelRoot>, text: string): Promise<AutocompleteSuggestion[]>;
27
- }
28
- /**
29
- * Interface for autocomplete suggestions.
30
- */
31
- export interface AutocompleteSuggestion {
32
- element: GModelElement;
33
- action: LabeledAction;
34
- }
35
- //# sourceMappingURL=autocomplete-suggestion-providers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"autocomplete-suggestion-providers.d.ts","sourceRoot":"","sources":["../../../src/base/auto-complete/autocomplete-suggestion-providers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEjF;;GAEG;AACH,MAAM,WAAW,+BAA+B;IAC5C;;;;OAIG;IACH,mBAAmB,CAAC,IAAI,EAAE,QAAQ,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,sBAAsB,EAAE,CAAC,CAAC;CACpG;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACnC,OAAO,EAAE,aAAa,CAAC;IACvB,MAAM,EAAE,aAAa,CAAC;CACzB"}
@@ -1,18 +0,0 @@
1
- "use strict";
2
- /********************************************************************************
3
- * Copyright (c) 2023 Business Informatics Group (TU Wien) and others.
4
- *
5
- * This program and the accompanying materials are made available under the
6
- * terms of the Eclipse Public License v. 2.0 which is available at
7
- * http://www.eclipse.org/legal/epl-2.0.
8
- *
9
- * This Source Code may also be made available under the following Secondary
10
- * Licenses when the conditions for such availability set forth in the Eclipse
11
- * Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- * with the GNU Classpath Exception which is available at
13
- * https://www.gnu.org/software/classpath/license.html.
14
- *
15
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16
- ********************************************************************************/
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- //# sourceMappingURL=autocomplete-suggestion-providers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"autocomplete-suggestion-providers.js","sourceRoot":"","sources":["../../../src/base/auto-complete/autocomplete-suggestion-providers.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF"}
@@ -1,23 +0,0 @@
1
- /********************************************************************************
2
- * Copyright (c) 2023 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
- import { TriggerEdgeCreationAction } from '@eclipse-glsp/sprotty';
17
- export interface EdgeAutocompleteContext {
18
- role: 'source' | 'target';
19
- trigger: TriggerEdgeCreationAction;
20
- sourceId?: string;
21
- targetId?: string;
22
- }
23
- //# sourceMappingURL=edge-autocomplete-context.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"edge-autocomplete-context.d.ts","sourceRoot":"","sources":["../../../../src/features/accessibility/edge-autocomplete/edge-autocomplete-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAElE,MAAM,WAAW,uBAAuB;IACpC,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC1B,OAAO,EAAE,yBAAyB,CAAC;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB"}
@@ -1,18 +0,0 @@
1
- "use strict";
2
- /********************************************************************************
3
- * Copyright (c) 2023 Business Informatics Group (TU Wien) and others.
4
- *
5
- * This program and the accompanying materials are made available under the
6
- * terms of the Eclipse Public License v. 2.0 which is available at
7
- * http://www.eclipse.org/legal/epl-2.0.
8
- *
9
- * This Source Code may also be made available under the following Secondary
10
- * Licenses when the conditions for such availability set forth in the Eclipse
11
- * Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- * with the GNU Classpath Exception which is available at
13
- * https://www.gnu.org/software/classpath/license.html.
14
- *
15
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16
- ********************************************************************************/
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- //# sourceMappingURL=edge-autocomplete-context.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"edge-autocomplete-context.js","sourceRoot":"","sources":["../../../../src/features/accessibility/edge-autocomplete/edge-autocomplete-context.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"keyboard-pointer-module.d.ts","sourceRoot":"","sources":["../../../../src/features/accessibility/keyboard-pointer/keyboard-pointer-module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EACH,cAAc,EACd,aAAa,EAMhB,MAAM,uBAAuB,CAAC;AAY/B;;GAEG;AACH,eAAO,MAAM,qBAAqB,eAMjC,CAAC;AAEF,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI,CAmB3E"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"keyboard-pointer-module.js","sourceRoot":"","sources":["../../../../src/features/accessibility/keyboard-pointer/keyboard-pointer-module.ts"],"names":[],"mappings":";;;AA8CA,sEAmBC;AAjED;;;;;;;;;;;;;;kFAckF;AAClF,mDAQ+B;AAC/B,wDAA2E;AAC3E,8FAAyF;AACzF,wFAA0F;AAC1F,wEAAmE;AACnE,oDAAmG;AACnG,kEAA8D;AAC9D,gGAAkF;AAClF,4EAAuE;AACvE,uCAAmE;AACnE,yDAAqD;AAErD;;GAEG;AACU,QAAA,qBAAqB,GAAG,IAAI,uBAAa,CAClD,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE;IAC9B,MAAM,OAAO,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAClD,6BAA6B,CAAC,OAAO,CAAC,CAAC;AAC3C,CAAC,EACD,EAAE,SAAS,EAAE,MAAM,CAAC,iBAAiB,CAAC,EAAE,CAC3C,CAAC;AAEF,SAAgB,6BAA6B,CAAC,OAAuB;IACjE,IAAA,uBAAa,EAAC,OAAO,EAAE,eAAK,CAAC,YAAY,EAAE,+CAAqB,CAAC,CAAC;IAClE,IAAA,uBAAa,EAAC,OAAO,EAAE,eAAK,CAAC,YAAY,EAAE,kCAAe,CAAC,CAAC;IAC5D,IAAA,uBAAa,EAAC,OAAO,EAAE,eAAK,CAAC,YAAY,EAAE,4BAAY,CAAC,CAAC;IACzD,IAAA,uBAAa,EAAC,OAAO,EAAE,eAAK,CAAC,YAAY,EAAE,qCAAgB,CAAC,CAAC;IAE7D,IAAA,gCAAsB,EAAC,OAAO,EAAE,mCAAyB,CAAC,IAAI,EAAE,kCAAe,CAAC,CAAC;IACjF,IAAA,gCAAsB,EAAC,OAAO,EAAE,gDAAsC,CAAC,IAAI,EAAE,kCAAe,CAAC,CAAC;IAE9F,IAAA,uBAAa,EAAC,OAAO,EAAE,eAAK,CAAC,YAAY,EAAE,mDAAuB,CAAC,CAAC;IACpE,IAAA,uBAAa,EAAC,OAAO,EAAE,eAAK,CAAC,YAAY,EAAE,oDAA2B,CAAC,CAAC;IAExE,IAAA,gCAAsB,EAAC,OAAO,EAAE,iCAAwB,CAAC,IAAI,EAAE,4BAAY,CAAC,CAAC;IAC7E,IAAA,gCAAsB,EAAC,OAAO,EAAE,uCAA8B,CAAC,IAAI,EAAE,kCAAe,CAAC,CAAC;IAEtF,IAAA,gCAAsB,EAAC,OAAO,EAAE,mCAAyB,CAAC,IAAI,EAAE,mDAAuB,CAAC,CAAC;IACzF,IAAA,gCAAsB,EAAC,OAAO,EAAE,qCAA4B,CAAC,IAAI,EAAE,mDAAuB,CAAC,CAAC;IAE5F,IAAA,uBAAa,EAAC,OAAO,EAAE,eAAK,CAAC,YAAY,EAAE,gDAAiB,CAAC,CAAC;AAClE,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"search-palette-module.d.ts","sourceRoot":"","sources":["../../../../src/features/accessibility/search/search-palette-module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAiB,cAAc,EAAE,aAAa,EAAS,MAAM,uBAAuB,CAAC;AAC5F,OAAO,4BAA4B,CAAC;AAIpC,eAAO,MAAM,mBAAmB,eAM/B,CAAC;AAEF,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC,GAAG,IAAI,CAGxF"}
@@ -1,32 +0,0 @@
1
- "use strict";
2
- /********************************************************************************
3
- * Copyright (c) 2023-2025 Business Informatics Group (TU Wien) and others.
4
- *
5
- * This program and the accompanying materials are made available under the
6
- * terms of the Eclipse Public License v. 2.0 which is available at
7
- * http://www.eclipse.org/legal/epl-2.0.
8
- *
9
- * This Source Code may also be made available under the following Secondary
10
- * Licenses when the conditions for such availability set forth in the Eclipse
11
- * Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- * with the GNU Classpath Exception which is available at
13
- * https://www.gnu.org/software/classpath/license.html.
14
- *
15
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16
- ********************************************************************************/
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.searchPaletteModule = void 0;
19
- exports.configureSearchPaletteModule = configureSearchPaletteModule;
20
- const sprotty_1 = require("@eclipse-glsp/sprotty");
21
- require("../../../../css/search.css");
22
- const search_palette_1 = require("./search-palette");
23
- const search_tool_1 = require("./search-tool");
24
- exports.searchPaletteModule = new sprotty_1.FeatureModule((bind, _unbind, isBound, rebind) => {
25
- const context = { bind, isBound, rebind };
26
- configureSearchPaletteModule(context);
27
- }, { featureId: Symbol('searchPalette') });
28
- function configureSearchPaletteModule(context) {
29
- (0, sprotty_1.bindAsService)(context, sprotty_1.TYPES.IUIExtension, search_palette_1.SearchAutocompletePalette);
30
- (0, sprotty_1.bindAsService)(context, sprotty_1.TYPES.IDefaultTool, search_tool_1.SearchAutocompletePaletteTool);
31
- }
32
- //# sourceMappingURL=search-palette-module.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"search-palette-module.js","sourceRoot":"","sources":["../../../../src/features/accessibility/search/search-palette-module.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAelF,oEAGC;AAhBD,mDAA4F;AAC5F,sCAAoC;AACpC,qDAA6D;AAC7D,+CAA8D;AAEjD,QAAA,mBAAmB,GAAG,IAAI,uBAAa,CAChD,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE;IAC/B,MAAM,OAAO,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAC1C,4BAA4B,CAAC,OAAO,CAAC,CAAC;AAC1C,CAAC,EACD,EAAE,SAAS,EAAE,MAAM,CAAC,eAAe,CAAC,EAAE,CACzC,CAAC;AAEF,SAAgB,4BAA4B,CAAC,OAAqC;IAC9E,IAAA,uBAAa,EAAC,OAAO,EAAE,eAAK,CAAC,YAAY,EAAE,0CAAyB,CAAC,CAAC;IACtE,IAAA,uBAAa,EAAC,OAAO,EAAE,eAAK,CAAC,YAAY,EAAE,2CAA6B,CAAC,CAAC;AAC9E,CAAC"}
@@ -1,51 +0,0 @@
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
- import { Action, GModelElement, GModelRoot, LabeledAction } from '@eclipse-glsp/sprotty';
17
- import { BaseAutocompletePalette } from '../../../base/auto-complete/base-autocomplete-palette';
18
- import { AutocompleteSuggestion, IAutocompleteSuggestionProvider } from '../../../base/auto-complete/autocomplete-suggestion-providers';
19
- import { GEdge } from '../../../model';
20
- export declare class RevealNamedElementAutocompleteSuggestionProvider implements IAutocompleteSuggestionProvider {
21
- retrieveSuggestions(root: Readonly<GModelRoot>, text: string): Promise<AutocompleteSuggestion[]>;
22
- protected getActions(nameable: GModelElement): Action[];
23
- }
24
- export declare class RevealNodesWithoutNameAutocompleteSuggestionProvider implements IAutocompleteSuggestionProvider {
25
- retrieveSuggestions(root: Readonly<GModelRoot>, text: string): Promise<AutocompleteSuggestion[]>;
26
- protected getActions(nameable: GModelElement): Action[];
27
- }
28
- export declare class RevealEdgeElementAutocompleteSuggestionProvider implements IAutocompleteSuggestionProvider {
29
- retrieveSuggestions(root: Readonly<GModelRoot>, text: string): Promise<AutocompleteSuggestion[]>;
30
- protected getActions(edge: GEdge): Action[];
31
- protected getEdgeLabel(root: Readonly<GModelRoot>, edge: GEdge): string;
32
- }
33
- export declare class SearchAutocompletePalette extends BaseAutocompletePalette {
34
- static readonly ID = "search-autocomplete-palette";
35
- protected cachedSuggestions: AutocompleteSuggestion[];
36
- id(): string;
37
- protected initializeContents(containerElement: HTMLElement): void;
38
- protected getSuggestionProviders(root: Readonly<GModelRoot>, input: string): IAutocompleteSuggestionProvider[];
39
- protected retrieveSuggestions(root: Readonly<GModelRoot>, input: string): Promise<LabeledAction[]>;
40
- protected visibleSuggestionsChanged(root: Readonly<GModelRoot>, labeledActions: LabeledAction[]): Promise<void>;
41
- protected selectedSuggestionChanged(root: Readonly<GModelRoot>, labeledAction?: LabeledAction | undefined): Promise<void>;
42
- show(root: Readonly<GModelRoot>, ...contextElementIds: string[]): void;
43
- hide(): void;
44
- protected applyCSS(elements: GModelElement[], cssClass: string): Promise<void>;
45
- protected deleteCSS(elements: GModelElement[], cssClass: string): Promise<void>;
46
- protected deleteAllCSS(root: Readonly<GModelRoot>, cssClass: string): Promise<void>;
47
- protected getSuggestionsFromLabeledActions(labeledActions: LabeledAction[]): AutocompleteSuggestion[];
48
- protected getHiddenSuggestionsFromLabeledActions(labeledActions: LabeledAction[]): AutocompleteSuggestion[];
49
- protected getHiddenElements(root: Readonly<GModelRoot>, suggestions: AutocompleteSuggestion[]): GModelElement[];
50
- }
51
- //# sourceMappingURL=search-palette.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"search-palette.d.ts","sourceRoot":"","sources":["../../../../src/features/accessibility/search/search-palette.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EACH,MAAM,EAEN,aAAa,EACb,UAAU,EAEV,aAAa,EAOhB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,uBAAuB,EAAE,MAAM,uDAAuD,CAAC;AAEhG,OAAO,EAAE,sBAAsB,EAAE,+BAA+B,EAAE,MAAM,+DAA+D,CAAC;AAIxI,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAKvC,qBAAa,gDAAiD,YAAW,+BAA+B;IAC9F,mBAAmB,CAAC,IAAI,EAAE,QAAQ,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,sBAAsB,EAAE,CAAC;IAYtG,SAAS,CAAC,UAAU,CAAC,QAAQ,EAAE,aAAa,GAAG,MAAM,EAAE;CAG1D;AACD,qBAAa,oDAAqD,YAAW,+BAA+B;IAClG,mBAAmB,CAAC,IAAI,EAAE,QAAQ,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,sBAAsB,EAAE,CAAC;IAYtG,SAAS,CAAC,UAAU,CAAC,QAAQ,EAAE,aAAa,GAAG,MAAM,EAAE;CAG1D;AAED,qBAAa,+CAAgD,YAAW,+BAA+B;IAC7F,mBAAmB,CAAC,IAAI,EAAE,QAAQ,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,sBAAsB,EAAE,CAAC;IAYtG,SAAS,CAAC,UAAU,CAAC,IAAI,EAAE,KAAK,GAAG,MAAM,EAAE;IAG3C,SAAS,CAAC,YAAY,CAAC,IAAI,EAAE,QAAQ,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,KAAK,GAAG,MAAM;CAgB1E;AACD,qBACa,yBAA0B,SAAQ,uBAAuB;IAClE,MAAM,CAAC,QAAQ,CAAC,EAAE,iCAAiC;IAEnD,SAAS,CAAC,iBAAiB,EAAE,sBAAsB,EAAE,CAAM;IAE3D,EAAE,IAAI,MAAM;cAIO,kBAAkB,CAAC,gBAAgB,EAAE,WAAW,GAAG,IAAI;IAM1E,SAAS,CAAC,sBAAsB,CAAC,IAAI,EAAE,QAAQ,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,+BAA+B,EAAE;cAO9F,mBAAmB,CAAC,IAAI,EAAE,QAAQ,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;cAS/E,yBAAyB,CAAC,IAAI,EAAE,QAAQ,CAAC,UAAU,CAAC,EAAE,cAAc,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;cAQrG,yBAAyB,CAC9C,IAAI,EAAE,QAAQ,CAAC,UAAU,CAAC,EAC1B,aAAa,CAAC,EAAE,aAAa,GAAG,SAAS,GAC1C,OAAO,CAAC,IAAI,CAAC;IAgBA,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,UAAU,CAAC,EAAE,GAAG,iBAAiB,EAAE,MAAM,EAAE,GAAG,IAAI;IAMtE,IAAI,IAAI,IAAI;IAU5B,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,aAAa,EAAE,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAK9E,SAAS,CAAC,SAAS,CAAC,QAAQ,EAAE,aAAa,EAAE,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAK/E,SAAS,CAAC,YAAY,CAAC,IAAI,EAAE,QAAQ,CAAC,UAAU,CAAC,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKnF,SAAS,CAAC,gCAAgC,CAAC,cAAc,EAAE,aAAa,EAAE,GAAG,sBAAsB,EAAE;IAIrG,SAAS,CAAC,sCAAsC,CAAC,cAAc,EAAE,aAAa,EAAE,GAAG,sBAAsB,EAAE;IAI3G,SAAS,CAAC,iBAAiB,CAAC,IAAI,EAAE,QAAQ,CAAC,UAAU,CAAC,EAAE,WAAW,EAAE,sBAAsB,EAAE,GAAG,aAAa,EAAE;CAQlH"}
@@ -1,186 +0,0 @@
1
- "use strict";
2
- /********************************************************************************
3
- * Copyright (c) 2023-2025 Business Informatics Group (TU Wien) and others.
4
- *
5
- * This program and the accompanying materials are made available under the
6
- * terms of the Eclipse Public License v. 2.0 which is available at
7
- * http://www.eclipse.org/legal/epl-2.0.
8
- *
9
- * This Source Code may also be made available under the following Secondary
10
- * Licenses when the conditions for such availability set forth in the Eclipse
11
- * Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- * with the GNU Classpath Exception which is available at
13
- * https://www.gnu.org/software/classpath/license.html.
14
- *
15
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16
- ********************************************************************************/
17
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21
- return c > 3 && r && Object.defineProperty(target, key, r), r;
22
- };
23
- var SearchAutocompletePalette_1;
24
- Object.defineProperty(exports, "__esModule", { value: true });
25
- exports.SearchAutocompletePalette = exports.RevealEdgeElementAutocompleteSuggestionProvider = exports.RevealNodesWithoutNameAutocompleteSuggestionProvider = exports.RevealNamedElementAutocompleteSuggestionProvider = void 0;
26
- const sprotty_1 = require("@eclipse-glsp/sprotty");
27
- const inversify_1 = require("inversify");
28
- const lodash_1 = require("lodash");
29
- const base_autocomplete_palette_1 = require("../../../base/auto-complete/base-autocomplete-palette");
30
- const css_feedback_1 = require("../../../base/feedback/css-feedback");
31
- const messages_1 = require("../../../base/messages");
32
- const reposition_1 = require("../../../features/viewport/reposition");
33
- const model_1 = require("../../../model");
34
- const CSS_SEARCH_HIDDEN = 'search-hidden';
35
- const CSS_SEARCH_HIGHLIGHTED = 'search-highlighted';
36
- class RevealNamedElementAutocompleteSuggestionProvider {
37
- async retrieveSuggestions(root, text) {
38
- const nameables = (0, sprotty_1.toArray)(root.index.all().filter(element => (0, sprotty_1.isNameable)(element)));
39
- return nameables.map(nameable => {
40
- var _a;
41
- return ({
42
- element: nameable,
43
- action: {
44
- label: `[${nameable.type}] ${(_a = (0, sprotty_1.name)(nameable)) !== null && _a !== void 0 ? _a : '<no-name>'}`,
45
- actions: this.getActions(nameable),
46
- icon: (0, sprotty_1.codiconCSSString)('eye')
47
- }
48
- });
49
- });
50
- }
51
- getActions(nameable) {
52
- return [sprotty_1.SelectAction.create({ selectedElementsIDs: [nameable.id] }), sprotty_1.CenterAction.create([nameable.id], { retainZoom: true })];
53
- }
54
- }
55
- exports.RevealNamedElementAutocompleteSuggestionProvider = RevealNamedElementAutocompleteSuggestionProvider;
56
- class RevealNodesWithoutNameAutocompleteSuggestionProvider {
57
- async retrieveSuggestions(root, text) {
58
- const nodes = (0, sprotty_1.toArray)(root.index.all().filter(element => !(0, sprotty_1.isNameable)(element) && element instanceof sprotty_1.GNode));
59
- return nodes.map(node => ({
60
- element: node,
61
- action: {
62
- label: `[${node.type}]`,
63
- actions: this.getActions(node),
64
- icon: (0, sprotty_1.codiconCSSString)('symbol-namespace')
65
- }
66
- }));
67
- }
68
- getActions(nameable) {
69
- return [sprotty_1.SelectAction.create({ selectedElementsIDs: [nameable.id] }), sprotty_1.CenterAction.create([nameable.id], { retainZoom: true })];
70
- }
71
- }
72
- exports.RevealNodesWithoutNameAutocompleteSuggestionProvider = RevealNodesWithoutNameAutocompleteSuggestionProvider;
73
- class RevealEdgeElementAutocompleteSuggestionProvider {
74
- async retrieveSuggestions(root, text) {
75
- const edges = (0, sprotty_1.toArray)(root.index.all().filter(element => element instanceof model_1.GEdge));
76
- return edges.map(edge => ({
77
- element: edge,
78
- action: {
79
- label: `[${edge.type}] ${this.getEdgeLabel(root, edge)}`,
80
- actions: this.getActions(edge),
81
- icon: (0, sprotty_1.codiconCSSString)('arrow-both')
82
- }
83
- }));
84
- }
85
- getActions(edge) {
86
- return [sprotty_1.SelectAction.create({ selectedElementsIDs: [edge.id] }), sprotty_1.CenterAction.create([edge.sourceId, edge.targetId])];
87
- }
88
- getEdgeLabel(root, edge) {
89
- var _a, _b;
90
- let sourceName = '';
91
- let targetName = '';
92
- const sourceNode = root.index.getById(edge.sourceId);
93
- const targetNode = root.index.getById(edge.targetId);
94
- if (sourceNode !== undefined) {
95
- sourceName = (_a = (0, sprotty_1.name)(sourceNode)) !== null && _a !== void 0 ? _a : sourceNode.type;
96
- }
97
- if (targetNode !== undefined) {
98
- targetName = (_b = (0, sprotty_1.name)(targetNode)) !== null && _b !== void 0 ? _b : targetNode.type;
99
- }
100
- return sourceName + ' -> ' + targetName;
101
- }
102
- }
103
- exports.RevealEdgeElementAutocompleteSuggestionProvider = RevealEdgeElementAutocompleteSuggestionProvider;
104
- let SearchAutocompletePalette = SearchAutocompletePalette_1 = class SearchAutocompletePalette extends base_autocomplete_palette_1.BaseAutocompletePalette {
105
- constructor() {
106
- super(...arguments);
107
- this.cachedSuggestions = [];
108
- }
109
- id() {
110
- return SearchAutocompletePalette_1.ID;
111
- }
112
- initializeContents(containerElement) {
113
- super.initializeContents(containerElement);
114
- this.autocompleteWidget.inputField.placeholder = messages_1.messages.search.placeholder;
115
- containerElement.setAttribute('aria-label', messages_1.messages.search.label);
116
- }
117
- getSuggestionProviders(root, input) {
118
- return [
119
- new RevealNamedElementAutocompleteSuggestionProvider(),
120
- new RevealEdgeElementAutocompleteSuggestionProvider(),
121
- new RevealNodesWithoutNameAutocompleteSuggestionProvider()
122
- ];
123
- }
124
- async retrieveSuggestions(root, input) {
125
- const providers = this.getSuggestionProviders(root, input);
126
- const suggestions = (await Promise.all(providers.map(provider => provider.retrieveSuggestions(root, input)))).flat(1);
127
- this.cachedSuggestions = suggestions;
128
- return suggestions.map(s => s.action);
129
- }
130
- async visibleSuggestionsChanged(root, labeledActions) {
131
- await this.applyCSS(this.getHiddenElements(root, this.getSuggestionsFromLabeledActions(labeledActions)), CSS_SEARCH_HIDDEN);
132
- await this.deleteCSS(this.getSuggestionsFromLabeledActions(labeledActions).map(s => s.element), CSS_SEARCH_HIDDEN);
133
- }
134
- async selectedSuggestionChanged(root, labeledAction) {
135
- await this.deleteAllCSS(root, CSS_SEARCH_HIGHLIGHTED);
136
- if (labeledAction !== undefined) {
137
- const suggestions = this.getSuggestionsFromLabeledActions([labeledAction]);
138
- const actions = [];
139
- suggestions.map(currElem => actions.push(reposition_1.RepositionAction.create([currElem.element.id])));
140
- this.actionDispatcher.dispatchAll(actions);
141
- await this.applyCSS(suggestions.map(s => s.element), CSS_SEARCH_HIGHLIGHTED);
142
- }
143
- }
144
- show(root, ...contextElementIds) {
145
- this.actionDispatcher.dispatch(sprotty_1.SelectAllAction.create(false));
146
- super.show(root, ...contextElementIds);
147
- }
148
- hide() {
149
- if (this.root !== undefined) {
150
- this.deleteAllCSS(this.root, CSS_SEARCH_HIDDEN);
151
- this.deleteAllCSS(this.root, CSS_SEARCH_HIGHLIGHTED);
152
- this.autocompleteWidget.inputField.value = '';
153
- }
154
- super.hide();
155
- }
156
- applyCSS(elements, cssClass) {
157
- const actions = elements.map(element => (0, css_feedback_1.applyCssClasses)(element, cssClass));
158
- return this.actionDispatcher.dispatchAll(actions);
159
- }
160
- deleteCSS(elements, cssClass) {
161
- const actions = elements.map(element => (0, css_feedback_1.deleteCssClasses)(element, cssClass));
162
- return this.actionDispatcher.dispatchAll(actions);
163
- }
164
- deleteAllCSS(root, cssClass) {
165
- const actions = (0, sprotty_1.toArray)(root.index.all().map(element => (0, css_feedback_1.deleteCssClasses)(element, cssClass)));
166
- return this.actionDispatcher.dispatchAll(actions);
167
- }
168
- getSuggestionsFromLabeledActions(labeledActions) {
169
- return this.cachedSuggestions.filter(c => labeledActions.find(s => (0, lodash_1.isEqual)(s, c.action)));
170
- }
171
- getHiddenSuggestionsFromLabeledActions(labeledActions) {
172
- return this.cachedSuggestions.filter(c => !labeledActions.find(s => (0, lodash_1.isEqual)(s, c.action)));
173
- }
174
- getHiddenElements(root, suggestions) {
175
- return (0, sprotty_1.toArray)(root.index
176
- .all()
177
- .filter(element => element instanceof sprotty_1.GNode || element instanceof model_1.GEdge)
178
- .filter(element => suggestions.find(suggestion => suggestion.element.id === element.id) === undefined));
179
- }
180
- };
181
- exports.SearchAutocompletePalette = SearchAutocompletePalette;
182
- SearchAutocompletePalette.ID = 'search-autocomplete-palette';
183
- exports.SearchAutocompletePalette = SearchAutocompletePalette = SearchAutocompletePalette_1 = __decorate([
184
- (0, inversify_1.injectable)()
185
- ], SearchAutocompletePalette);
186
- //# sourceMappingURL=search-palette.js.map