@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,4 +1,20 @@
1
- import { Action, IActionDispatcher, IActionHandler, IContextMenuItemProvider, MenuItem, Point, GModelRoot } from '@eclipse-glsp/sprotty';
1
+ /********************************************************************************
2
+ * Copyright (c) 2020-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 { Action, ClientMenuItem, GModelRoot, IActionDispatcher, IActionHandler, IContextMenuItemProvider, Point } from '@eclipse-glsp/sprotty';
17
+ import { EditorContextService } from '../../base/editor-context-service';
2
18
  /**
3
19
  * An `InvokeCopyPasteAction` is dispatched by the client to initiate a cut, copy or paste operation.
4
20
  */
@@ -17,10 +33,11 @@ export declare class InvokeCopyPasteActionHandler implements IActionHandler {
17
33
  protected notifyUserToUseShortcut(operation: string): void;
18
34
  }
19
35
  export declare class CopyPasteContextMenuItemProvider implements IContextMenuItemProvider {
20
- getItems(root: Readonly<GModelRoot>, _lastMousePosition?: Point): Promise<MenuItem[]>;
21
- protected createPasteMenuItem(): MenuItem;
22
- protected createCutMenuItem(hasSelectedElements: boolean): MenuItem;
23
- protected createCopyMenuItem(hasSelectedElements: boolean): MenuItem;
36
+ protected editorContext: EditorContextService;
37
+ getItems(root: Readonly<GModelRoot>, _lastMousePosition?: Point): Promise<ClientMenuItem[]>;
38
+ protected createPasteMenuItem(): ClientMenuItem;
39
+ protected createCutMenuItem(hasSelectedElements: boolean): ClientMenuItem;
40
+ protected createCopyMenuItem(hasSelectedElements: boolean): ClientMenuItem;
24
41
  }
25
42
  export declare function supportsCopy(): boolean;
26
43
  export declare function supportsCut(): boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"copy-paste-context-menu.d.ts","sourceRoot":"","sources":["../../../src/features/copy-paste/copy-paste-context-menu.ts"],"names":[],"mappings":"AAiBA,OAAO,EACH,MAAM,EACN,iBAA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7E;AAED,wBAAgB,YAAY,IAAI,OAAO,CAEtC;AAED,wBAAgB,WAAW,IAAI,OAAO,CAErC;AAED,wBAAgB,aAAa,IAAI,OAAO,CAGvC;AAED,wBAAgB,QAAQ,IAAI,OAAO,CAElC"}
@@ -15,7 +15,7 @@ exports.supportsCut = supportsCut;
15
15
  exports.supportsPaste = supportsPaste;
16
16
  exports.isNative = isNative;
17
17
  /********************************************************************************
18
- * Copyright (c) 2020-2023 EclipseSource and others.
18
+ * Copyright (c) 2020-2025 EclipseSource and others.
19
19
  *
20
20
  * This program and the accompanying materials are made available under the
21
21
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -30,8 +30,10 @@ exports.isNative = isNative;
30
30
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
31
31
  ********************************************************************************/
32
32
  /* eslint-disable deprecation/deprecation */
33
- const inversify_1 = require("inversify");
34
33
  const sprotty_1 = require("@eclipse-glsp/sprotty");
34
+ const inversify_1 = require("inversify");
35
+ const editor_context_service_1 = require("../../base/editor-context-service");
36
+ const messages_1 = require("../../base/messages");
35
37
  var InvokeCopyPasteAction;
36
38
  (function (InvokeCopyPasteAction) {
37
39
  InvokeCopyPasteAction.KIND = 'invokeCopyPaste';
@@ -89,18 +91,17 @@ exports.InvokeCopyPasteActionHandler = InvokeCopyPasteActionHandler = __decorate
89
91
  (0, inversify_1.injectable)()
90
92
  ], InvokeCopyPasteActionHandler);
91
93
  let CopyPasteContextMenuItemProvider = class CopyPasteContextMenuItemProvider {
92
- getItems(root, _lastMousePosition) {
94
+ async getItems(root, _lastMousePosition) {
95
+ if (this.editorContext.isReadonly) {
96
+ return [];
97
+ }
93
98
  const hasSelectedElements = Array.from(root.index.all().filter(sprotty_1.isSelected)).length > 0;
94
- return Promise.resolve([
95
- this.createCopyMenuItem(hasSelectedElements),
96
- this.createCutMenuItem(hasSelectedElements),
97
- this.createPasteMenuItem()
98
- ]);
99
+ return [this.createCopyMenuItem(hasSelectedElements), this.createCutMenuItem(hasSelectedElements), this.createPasteMenuItem()];
99
100
  }
100
101
  createPasteMenuItem() {
101
102
  return {
102
103
  id: 'paste',
103
- label: 'Paste',
104
+ label: messages_1.messages.context_menu.paste,
104
105
  group: 'copy-paste',
105
106
  actions: [InvokeCopyPasteAction.create('paste')],
106
107
  isEnabled: () => true
@@ -109,7 +110,7 @@ let CopyPasteContextMenuItemProvider = class CopyPasteContextMenuItemProvider {
109
110
  createCutMenuItem(hasSelectedElements) {
110
111
  return {
111
112
  id: 'cut',
112
- label: 'Cut',
113
+ label: messages_1.messages.context_menu.cut,
113
114
  group: 'copy-paste',
114
115
  actions: [InvokeCopyPasteAction.create('cut')],
115
116
  isEnabled: () => hasSelectedElements
@@ -118,7 +119,7 @@ let CopyPasteContextMenuItemProvider = class CopyPasteContextMenuItemProvider {
118
119
  createCopyMenuItem(hasSelectedElements) {
119
120
  return {
120
121
  id: 'copy',
121
- label: 'Copy',
122
+ label: messages_1.messages.context_menu.copy,
122
123
  group: 'copy-paste',
123
124
  actions: [InvokeCopyPasteAction.create('copy')],
124
125
  isEnabled: () => hasSelectedElements
@@ -126,6 +127,10 @@ let CopyPasteContextMenuItemProvider = class CopyPasteContextMenuItemProvider {
126
127
  }
127
128
  };
128
129
  exports.CopyPasteContextMenuItemProvider = CopyPasteContextMenuItemProvider;
130
+ __decorate([
131
+ (0, inversify_1.inject)(editor_context_service_1.EditorContextService),
132
+ __metadata("design:type", editor_context_service_1.EditorContextService)
133
+ ], CopyPasteContextMenuItemProvider.prototype, "editorContext", void 0);
129
134
  exports.CopyPasteContextMenuItemProvider = CopyPasteContextMenuItemProvider = __decorate([
130
135
  (0, inversify_1.injectable)()
131
136
  ], CopyPasteContextMenuItemProvider);
@@ -1 +1 @@
1
- {"version":3,"file":"copy-paste-context-menu.js","sourceRoot":"","sources":["../../../src/features/copy-paste/copy-paste-context-menu.ts"],"names":[],"mappings":";;;;;;;;;;;;AAmIA,oCAEC;AAED,kCAEC;AAED,s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SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;AACvE,CAAC"}
1
+ {"version":3,"file":"copy-paste-context-menu.js","sourceRoot":"","sources":["../../../src/features/copy-paste/copy-paste-context-menu.ts"],"names":[],"mappings":";;;;;;;;;;;;AAuIA,oCAEC;AAED,kCAEC;AAED,sCAGC;AAED,4BAEC;AAtJD;;;;;;;;;;;;;;kFAckF;AAClF,4CAA4C;AAC5C,mDAa+B;AAC/B,yCAA+C;AAC/C,8EAAyE;AACzE,kDAA+C;AAU/C,IAAiB,qBAAqB,CAUrC;AAVD,WAAiB,qBAAqB;IACrB,0BAAI,GAAG,iBAAiB,CAAC;IAEtC,SAAgB,EAAE,CAAC,MAAW;QAC1B,OAAO,gBAAM,CAAC,OAAO,CAAC,MAAM,EAAE,sBAAA,IAAI,CAAC,IAAI,IAAA,uBAAa,EAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAC5E,CAAC;IAFe,wBAAE,KAEjB,CAAA;IAED,SAAgB,MAAM,CAAC,OAAiC;QACpD,OAAO,EAAE,IAAI,EAAE,sBAAA,IAAI,EAAE,OAAO,EAAE,CAAC;IACnC,CAAC;IAFe,4BAAM,SAErB,CAAA;AACL,CAAC,EAVgB,qBAAqB,qCAArB,qBAAqB,QAUrC;AAGM,IAAM,4BAA4B,GAAlC,MAAM,4BAA4B;IAErC,MAAM,CAAC,MAA6B;QAChC,QAAQ,MAAM,CAAC,OAAO,EAAE,CAAC;YACrB,KAAK,MAAM;gBACP,IAAI,YAAY,EAAE,EAAE,CAAC;oBACjB,QAAQ,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;gBACjC,CAAC;qBAAM,CAAC;oBACJ,IAAI,CAAC,uBAAuB,CAAC,MAAM,CAAC,CAAC;gBACzC,CAAC;gBACD,MAAM;YACV,KAAK,OAAO;gBACR,IAAI,aAAa,EAAE,EAAE,CAAC;oBAClB,QAAQ,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;gBAClC,CAAC;q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AE,IAAI,QAAQ,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC;AAC/D,CAAC;AAED,SAAgB,aAAa;IACzB,MAAM,QAAQ,GAAG,SAAS,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACpD,OAAO,QAAQ,EAAE,IAAI,CAAC,CAAC,QAAQ,IAAI,QAAQ,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC,CAAC;AAChF,CAAC;AAED,SAAgB,QAAQ;IACpB,OAAO,OAAQ,MAAc,CAAC,OAAO,KAAK,WAAW,CAAC;AAC1D,CAAC;AAED,SAAS,SAAS;IACd,OAAO,OAAO,SAAS,KAAK,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;AACvE,CAAC"}
@@ -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
@@ -1 +1 @@
1
- {"version":3,"file":"decoration-module.d.ts","sourceRoot":"","sources":["../../../src/features/decoration/decoration-module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,aAAa,EAAwB,MAAM,uBAAuB,CAAC;AAC5E,OAAO,6BAA6B,CAAC;AAGrC,eAAO,MAAM,gBAAgB,eAK5B,CAAC"}
1
+ {"version":3,"file":"decoration-module.d.ts","sourceRoot":"","sources":["../../../src/features/decoration/decoration-module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,aAAa,EAAwB,MAAM,uBAAuB,CAAC;AAC5E,OAAO,6BAA6B,CAAC;AAGrC,eAAO,MAAM,gBAAgB,eAM5B,CAAC"}
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.decorationModule = void 0;
4
4
  /********************************************************************************
5
- * Copyright (c) 2019-2024 EclipseSource and others.
5
+ * Copyright (c) 2019-2025 EclipseSource and others.
6
6
  *
7
7
  * This program and the accompanying materials are made available under the
8
8
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -21,5 +21,6 @@ require("../../../css/decoration.css");
21
21
  const decoration_placer_1 = require("./decoration-placer");
22
22
  exports.decorationModule = new sprotty_1.FeatureModule(bind => {
23
23
  (0, sprotty_1.bindAsService)(bind, sprotty_1.TYPES.IVNodePostprocessor, decoration_placer_1.GlspDecorationPlacer);
24
+ bind(sprotty_1.TYPES.ISvgExportPostprocessor).toService(decoration_placer_1.GlspDecorationPlacer);
24
25
  }, { featureId: Symbol('decoration') });
25
26
  //# sourceMappingURL=decoration-module.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"decoration-module.js","sourceRoot":"","sources":["../../../src/features/decoration/decoration-module.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,mDAA4E;AAC5E,uCAAqC;AACrC,2DAA2D;AAE9C,QAAA,gBAAgB,GAAG,IAAI,uBAAa,CAC7C,IAAI,CAAC,EAAE;IACH,IAAA,uBAAa,EAAC,IAAI,EAAE,eAAK,CAAC,mBAAmB,EAAE,wCAAoB,CAAC,CAAC;AACzE,CAAC,EACD,EAAE,SAAS,EAAE,MAAM,CAAC,YAAY,CAAC,EAAE,CACtC,CAAC"}
1
+ {"version":3,"file":"decoration-module.js","sourceRoot":"","sources":["../../../src/features/decoration/decoration-module.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,mDAA4E;AAC5E,uCAAqC;AACrC,2DAA2D;AAE9C,QAAA,gBAAgB,GAAG,IAAI,uBAAa,CAC7C,IAAI,CAAC,EAAE;IACH,IAAA,uBAAa,EAAC,IAAI,EAAE,eAAK,CAAC,mBAAmB,EAAE,wCAAoB,CAAC,CAAC;IACrE,IAAI,CAAC,eAAK,CAAC,uBAAuB,CAAC,CAAC,SAAS,CAAC,wCAAoB,CAAC,CAAC;AACxE,CAAC,EACD,EAAE,SAAS,EAAE,MAAM,CAAC,YAAY,CAAC,EAAE,CACtC,CAAC"}
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2019-2023 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
@@ -13,9 +13,15 @@
13
13
  *
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
- import { Decoration, DecorationPlacer, GModelElement, Point } from '@eclipse-glsp/sprotty';
17
- export declare class GlspDecorationPlacer extends DecorationPlacer {
16
+ import { Action, DOMHelper, Decoration, DecorationPlacer, GModelElement, ISvgExportPostProcessor, LazyInjector, Point } from '@eclipse-glsp/sprotty';
17
+ import { EditorContextService } from '../../base/editor-context-service';
18
+ export declare class GlspDecorationPlacer extends DecorationPlacer implements ISvgExportPostProcessor {
18
19
  protected static readonly DECORATION_OFFSET: Point;
20
+ protected domHelper: DOMHelper;
21
+ protected lazyInjector: LazyInjector;
22
+ get editorContextService(): EditorContextService;
19
23
  protected getPosition(element: GModelElement & Decoration): Point;
24
+ postUpdate(cause?: Action): void;
25
+ postUpdate(element: SVGSVGElement, cause?: Action): void;
20
26
  }
21
27
  //# sourceMappingURL=decoration-placer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"decoration-placer.d.ts","sourceRoot":"","sources":["../../../src/features/decoration/decoration-placer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAiB,aAAa,EAAoB,KAAK,EAAc,MAAM,uBAAuB,CAAC;AAGxI,qBACa,oBAAqB,SAAQ,gBAAgB;IACtD,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,iBAAiB,EAAE,KAAK,CAAoB;cAEnD,WAAW,CAAC,OAAO,EAAE,aAAa,GAAG,UAAU,GAAG,KAAK;CAY7E"}
1
+ {"version":3,"file":"decoration-placer.d.ts","sourceRoot":"","sources":["../../../src/features/decoration/decoration-placer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EACH,MAAM,EACN,SAAS,EACT,UAAU,EACV,gBAAgB,EAEhB,aAAa,EAEb,uBAAuB,EACvB,YAAY,EACZ,KAAK,EAIR,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAGzE,qBACa,oBAAqB,SAAQ,gBAAiB,YAAW,uBAAuB;IACzF,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,iBAAiB,EAAE,KAAK,CAAoB;IAEtE,SAAS,CAAC,SAAS,EAAE,SAAS,CAAC;IAG/B,SAAS,CAAC,YAAY,EAAE,YAAY,CAAC;IAErC,IAAI,oBAAoB,IAAI,oBAAoB,CAE/C;cAEkB,WAAW,CAAC,OAAO,EAAE,aAAa,GAAG,UAAU,GAAG,KAAK;IAajE,UAAU,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI;IAEhC,UAAU,CAAC,OAAO,EAAE,aAAa,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI;CAiBpE"}
@@ -5,11 +5,14 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
5
  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;
6
6
  return c > 3 && r && Object.defineProperty(target, key, r), r;
7
7
  };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
8
11
  var GlspDecorationPlacer_1;
9
12
  Object.defineProperty(exports, "__esModule", { value: true });
10
13
  exports.GlspDecorationPlacer = void 0;
11
14
  /********************************************************************************
12
- * Copyright (c) 2019-2023 EclipseSource and others.
15
+ * Copyright (c) 2019-2025 EclipseSource and others.
13
16
  *
14
17
  * This program and the accompanying materials are made available under the
15
18
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -25,7 +28,12 @@ exports.GlspDecorationPlacer = void 0;
25
28
  ********************************************************************************/
26
29
  const sprotty_1 = require("@eclipse-glsp/sprotty");
27
30
  const inversify_1 = require("inversify");
31
+ const editor_context_service_1 = require("../../base/editor-context-service");
32
+ const gmodel_util_1 = require("../../utils/gmodel-util");
28
33
  let GlspDecorationPlacer = GlspDecorationPlacer_1 = class GlspDecorationPlacer extends sprotty_1.DecorationPlacer {
34
+ get editorContextService() {
35
+ return this.lazyInjector.get(editor_context_service_1.EditorContextService);
36
+ }
29
37
  getPosition(element) {
30
38
  if (element instanceof sprotty_1.GChildElement && element.parent instanceof sprotty_1.GRoutableElement) {
31
39
  return super.getPosition(element);
@@ -38,9 +46,32 @@ let GlspDecorationPlacer = GlspDecorationPlacer_1 = class GlspDecorationPlacer e
38
46
  }
39
47
  return sprotty_1.Point.ORIGIN;
40
48
  }
49
+ postUpdate(elementOrCause, _cause) {
50
+ // Called as HiddenVNodePostprocessor => no-op
51
+ if (!elementOrCause || sprotty_1.Action.is(elementOrCause)) {
52
+ return;
53
+ }
54
+ // Called as ISvgExportPostProcessor
55
+ // Adjust the position of all decorations in the exported SVG
56
+ const svg = elementOrCause;
57
+ const translate = `translate(-${GlspDecorationPlacer_1.DECORATION_OFFSET.x}px, -${GlspDecorationPlacer_1.DECORATION_OFFSET.y}px)`;
58
+ (0, gmodel_util_1.filter)(this.editorContextService.modelRoot.index, sprotty_1.isDecoration).forEach(decoration => {
59
+ const domId = this.domHelper.createUniqueDOMElementId(decoration);
60
+ const element = svg.querySelector(`#${domId}`);
61
+ element.style.transform = translate;
62
+ });
63
+ }
41
64
  };
42
65
  exports.GlspDecorationPlacer = GlspDecorationPlacer;
43
66
  GlspDecorationPlacer.DECORATION_OFFSET = { x: 12, y: 10 };
67
+ __decorate([
68
+ (0, inversify_1.inject)(sprotty_1.TYPES.DOMHelper),
69
+ __metadata("design:type", sprotty_1.DOMHelper)
70
+ ], GlspDecorationPlacer.prototype, "domHelper", void 0);
71
+ __decorate([
72
+ (0, inversify_1.inject)(sprotty_1.LazyInjector),
73
+ __metadata("design:type", Object)
74
+ ], GlspDecorationPlacer.prototype, "lazyInjector", void 0);
44
75
  exports.GlspDecorationPlacer = GlspDecorationPlacer = GlspDecorationPlacer_1 = __decorate([
45
76
  (0, inversify_1.injectable)()
46
77
  ], GlspDecorationPlacer);
@@ -1 +1 @@
1
- {"version":3,"file":"decoration-placer.js","sourceRoot":"","sources":["../../../src/features/decoration/decoration-placer.ts"],"names":[],"mappings":";;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,mDAAwI;AACxI,yCAAuC;AAGhC,IAAM,oBAAoB,4BAA1B,MAAM,oBAAqB,SAAQ,0BAAgB;IAGnC,WAAW,CAAC,OAAmC;QAC9D,IAAI,OAAO,YAAY,uBAAa,IAAI,OAAO,CAAC,MAAM,YAAY,0BAAgB,EAAE,CAAC;YACjF,OAAO,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QACtC,CAAC;QACD,IAAI,IAAA,oBAAU,EAAC,OAAO,CAAC,EAAE,CAAC;YACtB,OAAO;gBACH,CAAC,EAAE,CAAC,sBAAoB,CAAC,iBAAiB,CAAC,CAAC;gBAC5C,CAAC,EAAE,CAAC,sBAAoB,CAAC,iBAAiB,CAAC,CAAC;aAC/C,CAAC;QACN,CAAC;QACD,OAAO,eAAK,CAAC,MAAM,CAAC;IACxB,CAAC;;AAdQ,oDAAoB;AACH,sCAAiB,GAAU,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,AAA1B,CAA2B;+BAD7D,oBAAoB;IADhC,IAAA,sBAAU,GAAE;GACA,oBAAoB,CAehC"}
1
+ {"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CAAC,EAAE;YACjF,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,wBAAwB,CAAC,UAAU,CAAC,CAAC;YAClE,MAAM,OAAO,GAAG,GAAG,CAAC,aAAa,CAAa,IAAI,KAAK,EAAE,CAAC,CAAC;YAC3D,OAAQ,CAAC,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC;QACzC,CAAC,CAAC,CAAC;IACP,CAAC;;AA3CQ,oDAAoB;AACH,sCAAiB,GAAU,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,AAA1B,CAA2B;AAE5D;IADT,IAAA,kBAAM,EAAC,eAAK,CAAC,SAAS,CAAC;8BACH,mBAAS;uDAAC;AAGrB;IADT,IAAA,kBAAM,EAAC,sBAAY,CAAC;;0DACgB;+BAN5B,oBAAoB;IADhC,IAAA,sBAAU,GAAE;GACA,oBAAoB,CA4ChC"}
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2023 Business Informatics Group (TU Wien) and others.
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
@@ -13,12 +13,8 @@
13
13
  *
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
-
17
- import { TriggerEdgeCreationAction } from '@eclipse-glsp/sprotty';
18
-
19
- export interface EdgeAutocompleteContext {
20
- role: 'source' | 'target';
21
- trigger: TriggerEdgeCreationAction;
22
- sourceId?: string;
23
- targetId?: string;
16
+ import { Action, GModelElement, KeyListener } from '@eclipse-glsp/sprotty';
17
+ export declare class SearchPaletteKeyListener extends KeyListener {
18
+ keyDown(element: GModelElement, event: KeyboardEvent): Action[];
24
19
  }
20
+ //# sourceMappingURL=search-palette-key-listener.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search-palette-key-listener.d.ts","sourceRoot":"","sources":["../../../src/features/search-palette/search-palette-key-listener.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,WAAW,EAAoD,MAAM,uBAAuB,CAAC;AAI7H,qBACa,wBAAyB,SAAQ,WAAW;IAC5C,OAAO,CAAC,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,GAAG,MAAM,EAAE;CAW3E"}
@@ -0,0 +1,45 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
24
+ exports.SearchPaletteKeyListener = void 0;
25
+ const sprotty_1 = require("@eclipse-glsp/sprotty");
26
+ const inversify_1 = require("inversify");
27
+ const search_palette_1 = require("./search-palette");
28
+ let SearchPaletteKeyListener = class SearchPaletteKeyListener extends sprotty_1.KeyListener {
29
+ keyDown(element, event) {
30
+ if ((0, sprotty_1.matchesKeystroke)(event, 'KeyF', 'ctrlCmd')) {
31
+ return [
32
+ sprotty_1.SetUIExtensionVisibilityAction.create({
33
+ extensionId: search_palette_1.SearchAutocompletePalette.ID,
34
+ visible: true
35
+ })
36
+ ];
37
+ }
38
+ return [];
39
+ }
40
+ };
41
+ exports.SearchPaletteKeyListener = SearchPaletteKeyListener;
42
+ exports.SearchPaletteKeyListener = SearchPaletteKeyListener = __decorate([
43
+ (0, inversify_1.injectable)()
44
+ ], SearchPaletteKeyListener);
45
+ //# sourceMappingURL=search-palette-key-listener.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search-palette-key-listener.js","sourceRoot":"","sources":["../../../src/features/search-palette/search-palette-key-listener.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;AAElF,mDAA6H;AAC7H,yCAAuC;AACvC,qDAA6D;AAGtD,IAAM,wBAAwB,GAA9B,MAAM,wBAAyB,SAAQ,qBAAW;IAC5C,OAAO,CAAC,OAAsB,EAAE,KAAoB;QACzD,IAAI,IAAA,0BAAgB,EAAC,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,CAAC;YAC7C,OAAO;gBACH,wCAA8B,CAAC,MAAM,CAAC;oBAClC,WAAW,EAAE,0CAAyB,CAAC,EAAE;oBACzC,OAAO,EAAE,IAAI;iBAChB,CAAC;aACL,CAAC;QACN,CAAC;QACD,OAAO,EAAE,CAAC;IACd,CAAC;CACJ,CAAA;AAZY,4DAAwB;mCAAxB,wBAAwB;IADpC,IAAA,sBAAU,GAAE;GACA,wBAAwB,CAYpC"}
@@ -13,8 +13,9 @@
13
13
  *
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
- import { BindingContext, FeatureModule } from '@eclipse-glsp/sprotty';
17
- import '../../../../css/search.css';
16
+ import { FeatureModule } from '@eclipse-glsp/sprotty';
17
+ import '../../../css/search.css';
18
18
  export declare const searchPaletteModule: FeatureModule;
19
- export declare function configureSearchPaletteModule(context: Pick<BindingContext, 'bind'>): void;
19
+ export declare const searchPaletteDefaultSuggestionsModule: FeatureModule;
20
+ export declare const standaloneSearchPaletteModule: FeatureModule;
20
21
  //# sourceMappingURL=search-palette-module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search-palette-module.d.ts","sourceRoot":"","sources":["../../../src/features/search-palette/search-palette-module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAiB,aAAa,EAAS,MAAM,uBAAuB,CAAC;AAC5E,OAAO,yBAAyB,CAAC;AAMjC,eAAO,MAAM,mBAAmB,eAM/B,CAAC;AAEF,eAAO,MAAM,qCAAqC,eAQjD,CAAC;AAEF,eAAO,MAAM,6BAA6B,eAMzC,CAAC"}
@@ -0,0 +1,39 @@
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.standaloneSearchPaletteModule = exports.searchPaletteDefaultSuggestionsModule = exports.searchPaletteModule = void 0;
19
+ const sprotty_1 = require("@eclipse-glsp/sprotty");
20
+ require("../../../css/search.css");
21
+ const search_palette_1 = require("./search-palette");
22
+ const search_palette_key_listener_1 = require("./search-palette-key-listener");
23
+ const edge_element_suggestions_1 = require("./suggestions/edge-element-suggestions");
24
+ const named_element_suggestions_1 = require("./suggestions/named-element-suggestions");
25
+ exports.searchPaletteModule = new sprotty_1.FeatureModule((bind, _unbind, isBound, rebind) => {
26
+ const context = { bind, isBound, rebind };
27
+ (0, sprotty_1.bindAsService)(context, sprotty_1.TYPES.IUIExtension, search_palette_1.SearchAutocompletePalette);
28
+ }, { featureId: Symbol('searchPalette') });
29
+ exports.searchPaletteDefaultSuggestionsModule = new sprotty_1.FeatureModule((bind, _unbind, isBound, rebind) => {
30
+ const context = { bind, isBound, rebind };
31
+ (0, sprotty_1.bindAsService)(context, sprotty_1.TYPES.IAutocompleteSuggestionProvider, named_element_suggestions_1.RevealNamedElementSuggestionProvider);
32
+ (0, sprotty_1.bindAsService)(context, sprotty_1.TYPES.IAutocompleteSuggestionProvider, named_element_suggestions_1.NodesWithoutNameSuggestionProvider);
33
+ (0, sprotty_1.bindAsService)(context, sprotty_1.TYPES.IAutocompleteSuggestionProvider, edge_element_suggestions_1.RevealEdgeElementSuggestionProvider);
34
+ }, { featureId: Symbol('searchPaletteDefaultSuggestions'), requires: exports.searchPaletteModule });
35
+ exports.standaloneSearchPaletteModule = new sprotty_1.FeatureModule((bind, _unbind, isBound) => {
36
+ const context = { bind, isBound };
37
+ (0, sprotty_1.bindAsService)(context, sprotty_1.TYPES.KeyListener, search_palette_key_listener_1.SearchPaletteKeyListener);
38
+ }, { featureId: Symbol('standaloneSearchPalette'), requires: exports.searchPaletteModule });
39
+ //# sourceMappingURL=search-palette-module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search-palette-module.js","sourceRoot":"","sources":["../../../src/features/search-palette/search-palette-module.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAElF,mDAA4E;AAC5E,mCAAiC;AACjC,qDAA6D;AAC7D,+EAAyE;AACzE,qFAA6F;AAC7F,uFAAmI;AAEtH,QAAA,mB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
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 { GModelElement, GModelRoot, LabeledAction } from '@eclipse-glsp/sprotty';
17
+ import { type AutocompleteSuggestion, type AutocompleteSuggestionRegistry } from '../../base/auto-complete/autocomplete-suggestion-provider';
18
+ import { BaseAutocompletePalette } from '../../base/auto-complete/base-autocomplete-palette';
19
+ export interface SearchAutocompleteSuggestion extends Required<AutocompleteSuggestion> {
20
+ }
21
+ export declare namespace SearchAutocompleteSuggestion {
22
+ function is(suggestion: AutocompleteSuggestion): suggestion is SearchAutocompleteSuggestion;
23
+ }
24
+ export declare class SearchAutocompletePalette extends BaseAutocompletePalette {
25
+ static readonly ID: string;
26
+ protected readonly suggestionRegistry: AutocompleteSuggestionRegistry;
27
+ /**
28
+ * Cache the suggestions so that we don't have to retrieve them again for CSS manipulation.
29
+ */
30
+ protected cachedSuggestions: SearchAutocompleteSuggestion[];
31
+ id(): string;
32
+ /**
33
+ * The search context for the search palette. This is used to filter the suggestions
34
+ */
35
+ get searchContext(): string[];
36
+ protected initializeContents(containerElement: HTMLElement): void;
37
+ protected retrieveSuggestions(root: Readonly<GModelRoot>, input: string): Promise<LabeledAction[]>;
38
+ protected provideSearchSuggestions(root: Readonly<GModelRoot>, input: string): Promise<SearchAutocompleteSuggestion[]>;
39
+ protected visibleSuggestionsChanged(root: Readonly<GModelRoot>, labeledActions: LabeledAction[]): Promise<void>;
40
+ protected selectedSuggestionChanged(root: Readonly<GModelRoot>, labeledAction?: LabeledAction | undefined): Promise<void>;
41
+ protected readonly handleSuggestionChanged: import("lodash").DebouncedFunc<(root: Readonly<GModelRoot>, labeledAction?: LabeledAction | undefined) => Promise<void>>;
42
+ protected doHandleSuggestionChanged(root: Readonly<GModelRoot>, labeledAction?: LabeledAction | undefined): Promise<void>;
43
+ show(root: Readonly<GModelRoot>, ...contextElementIds: string[]): void;
44
+ hide(): void;
45
+ protected applyCSS(elements: GModelElement[], ...add: string[]): Promise<void>;
46
+ protected deleteCSS(elements: GModelElement[], ...remove: string[]): Promise<void>;
47
+ protected deleteAllCSS(root: Readonly<GModelRoot>, ...remove: string[]): Promise<void>;
48
+ protected getSuggestionsFromLabeledActions(labeledActions: LabeledAction[]): SearchAutocompleteSuggestion[];
49
+ protected getHiddenElements(root: Readonly<GModelRoot>, suggestions: SearchAutocompleteSuggestion[]): GModelElement[];
50
+ }
51
+ //# sourceMappingURL=search-palette.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search-palette.d.ts","sourceRoot":"","sources":["../../../src/features/search-palette/search-palette.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,aAAa,EAAE,UAAU,EAAS,aAAa,EAAmC,MAAM,uBAAuB,CAAC;AAGzH,OAAO,EAEH,KAAK,sBAAsB,EAC3B,KAAK,8BAA8B,EACtC,MAAM,2DAA2D,CAAC;AACnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,oDAAoD,CAAC;AAS7F,MAAM,WAAW,4BAA6B,SAAQ,QAAQ,CAAC,sBAAsB,CAAC;CAAG;AAEzF,yBAAiB,4BAA4B,CAAC;IAC1C,SAAgB,EAAE,CAAC,UAAU,EAAE,sBAAsB,GAAG,UAAU,IAAI,4BAA4B,CAEjG;CACJ;AAED,qBACa,yBAA0B,SAAQ,uBAAuB;IAClE,MAAM,CAAC,QAAQ,CAAC,EAA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AE,EAAE,GAAG,GAAG,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAK9E,SAAS,CAAC,SAAS,CAAC,QAAQ,EAAE,aAAa,EAAE,EAAE,GAAG,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAKlF,SAAS,CAAC,YAAY,CAAC,IAAI,EAAE,QAAQ,CAAC,UAAU,CAAC,EAAE,GAAG,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAKtF,SAAS,CAAC,gCAAgC,CAAC,cAAc,EAAE,aAAa,EAAE,GAAG,4BAA4B,EAAE;IAI3G,SAAS,CAAC,iBAAiB,CAAC,IAAI,EAAE,QAAQ,CAAC,UAAU,CAAC,EAAE,WAAW,EAAE,4BAA4B,EAAE,GAAG,aAAa,EAAE;CAQxH"}
@@ -0,0 +1,141 @@
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 __metadata = (this && this.__metadata) || function (k, v) {
24
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
25
+ };
26
+ var SearchAutocompletePalette_1;
27
+ Object.defineProperty(exports, "__esModule", { value: true });
28
+ exports.SearchAutocompletePalette = exports.SearchAutocompleteSuggestion = void 0;
29
+ const sprotty_1 = require("@eclipse-glsp/sprotty");
30
+ const inversify_1 = require("inversify");
31
+ const lodash_1 = require("lodash");
32
+ const autocomplete_suggestion_provider_1 = require("../../base/auto-complete/autocomplete-suggestion-provider");
33
+ const base_autocomplete_palette_1 = require("../../base/auto-complete/base-autocomplete-palette");
34
+ const css_feedback_1 = require("../../base/feedback/css-feedback");
35
+ const messages_1 = require("../../base/messages");
36
+ const model_1 = require("../../model");
37
+ const reposition_1 = require("../viewport/reposition");
38
+ const CSS_SEARCH_HIDDEN = 'search-hidden';
39
+ const CSS_SEARCH_HIGHLIGHTED = 'search-highlighted';
40
+ var SearchAutocompleteSuggestion;
41
+ (function (SearchAutocompleteSuggestion) {
42
+ function is(suggestion) {
43
+ return suggestion.element !== undefined;
44
+ }
45
+ SearchAutocompleteSuggestion.is = is;
46
+ })(SearchAutocompleteSuggestion || (exports.SearchAutocompleteSuggestion = SearchAutocompleteSuggestion = {}));
47
+ let SearchAutocompletePalette = SearchAutocompletePalette_1 = class SearchAutocompletePalette extends base_autocomplete_palette_1.BaseAutocompletePalette {
48
+ constructor() {
49
+ super(...arguments);
50
+ /**
51
+ * Cache the suggestions so that we don't have to retrieve them again for CSS manipulation.
52
+ */
53
+ this.cachedSuggestions = [];
54
+ this.handleSuggestionChanged = (0, lodash_1.debounce)(this.doHandleSuggestionChanged, 300, { trailing: true });
55
+ }
56
+ id() {
57
+ return SearchAutocompletePalette_1.ID;
58
+ }
59
+ /**
60
+ * The search context for the search palette. This is used to filter the suggestions
61
+ */
62
+ get searchContext() {
63
+ return [autocomplete_suggestion_provider_1.AutocompleteSuggestionProviderContext.CANVAS];
64
+ }
65
+ initializeContents(containerElement) {
66
+ super.initializeContents(containerElement);
67
+ this.autocompleteWidget.inputField.placeholder = messages_1.messages.search.placeholder;
68
+ containerElement.setAttribute('aria-label', messages_1.messages.search.label);
69
+ }
70
+ async retrieveSuggestions(root, input) {
71
+ const suggestions = await this.provideSearchSuggestions(root, input);
72
+ this.cachedSuggestions = suggestions;
73
+ return suggestions.map(s => s.action);
74
+ }
75
+ async provideSearchSuggestions(root, input) {
76
+ return (await Promise.all(this.suggestionRegistry.providersForContext(this.searchContext).flatMap(provider => provider.getSuggestions(root, input))))
77
+ .flat(1)
78
+ .filter(SearchAutocompleteSuggestion.is);
79
+ }
80
+ async visibleSuggestionsChanged(root, labeledActions) {
81
+ await this.applyCSS(this.getHiddenElements(root, this.getSuggestionsFromLabeledActions(labeledActions)), CSS_SEARCH_HIDDEN);
82
+ await this.deleteCSS(this.getSuggestionsFromLabeledActions(labeledActions)
83
+ .filter(s => s.element)
84
+ .map(s => s.element), CSS_SEARCH_HIDDEN);
85
+ }
86
+ async selectedSuggestionChanged(root, labeledAction) {
87
+ await this.handleSuggestionChanged(root, labeledAction);
88
+ }
89
+ async doHandleSuggestionChanged(root, labeledAction) {
90
+ await this.deleteAllCSS(root, CSS_SEARCH_HIGHLIGHTED);
91
+ if (labeledAction !== undefined) {
92
+ const suggestions = this.getSuggestionsFromLabeledActions([labeledAction]);
93
+ const actions = [];
94
+ suggestions.map(currElem => actions.push(reposition_1.RepositionAction.create([currElem.element.id])));
95
+ this.actionDispatcher.dispatchAll(actions);
96
+ await this.applyCSS(suggestions.map(s => s.element), CSS_SEARCH_HIGHLIGHTED);
97
+ }
98
+ }
99
+ show(root, ...contextElementIds) {
100
+ this.actionDispatcher.dispatch(sprotty_1.SelectAllAction.create(false));
101
+ super.show(root, ...contextElementIds);
102
+ }
103
+ hide() {
104
+ if (this.root !== undefined) {
105
+ this.deleteAllCSS(this.root, CSS_SEARCH_HIDDEN, CSS_SEARCH_HIGHLIGHTED);
106
+ this.autocompleteWidget.inputField.value = '';
107
+ }
108
+ super.hide();
109
+ }
110
+ applyCSS(elements, ...add) {
111
+ const actions = elements.map(element => (0, css_feedback_1.applyCssClasses)(element, ...add));
112
+ return this.actionDispatcher.dispatchAll(actions);
113
+ }
114
+ deleteCSS(elements, ...remove) {
115
+ const actions = elements.map(element => (0, css_feedback_1.deleteCssClasses)(element, ...remove));
116
+ return this.actionDispatcher.dispatchAll(actions);
117
+ }
118
+ deleteAllCSS(root, ...remove) {
119
+ const actions = (0, sprotty_1.toArray)(root.index.all().map(element => (0, css_feedback_1.deleteCssClasses)(element, ...remove)));
120
+ return this.actionDispatcher.dispatchAll(actions);
121
+ }
122
+ getSuggestionsFromLabeledActions(labeledActions) {
123
+ return this.cachedSuggestions.filter(c => labeledActions.find(s => (0, lodash_1.isEqual)(s, c.action)));
124
+ }
125
+ getHiddenElements(root, suggestions) {
126
+ return (0, sprotty_1.toArray)(root.index
127
+ .all()
128
+ .filter(element => element instanceof sprotty_1.GNode || element instanceof model_1.GEdge)
129
+ .filter(element => suggestions.find(suggestion => suggestion.element.id === element.id) === undefined));
130
+ }
131
+ };
132
+ exports.SearchAutocompletePalette = SearchAutocompletePalette;
133
+ SearchAutocompletePalette.ID = 'glsp.search-autocomplete-palette';
134
+ __decorate([
135
+ (0, inversify_1.inject)(sprotty_1.TYPES.IAutocompleteSuggestionProviderRegistry),
136
+ __metadata("design:type", Object)
137
+ ], SearchAutocompletePalette.prototype, "suggestionRegistry", void 0);
138
+ exports.SearchAutocompletePalette = SearchAutocompletePalette = SearchAutocompletePalette_1 = __decorate([
139
+ (0, inversify_1.injectable)()
140
+ ], SearchAutocompletePalette);
141
+ //# sourceMappingURL=search-palette.js.map