@eclipse-glsp/client 2.8.0-next.0 → 2.8.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 (246) hide show
  1. package/README.md +1 -1
  2. package/css/grid.css +2 -1
  3. package/lib/base/action-dispatcher.js +1 -4
  4. package/lib/base/action-dispatcher.js.map +1 -1
  5. package/lib/base/auto-complete/auto-complete-widget.js +4 -8
  6. package/lib/base/auto-complete/auto-complete-widget.js.map +1 -1
  7. package/lib/base/auto-complete/base-autocomplete-palette.js +1 -2
  8. package/lib/base/auto-complete/base-autocomplete-palette.js.map +1 -1
  9. package/lib/base/editor-context-service.js +4 -7
  10. package/lib/base/editor-context-service.js.map +1 -1
  11. package/lib/base/feedback/css-feedback.js +1 -1
  12. package/lib/base/feedback/css-feedback.js.map +1 -1
  13. package/lib/base/feedback/feedback-action-dispatcher.js +4 -6
  14. package/lib/base/feedback/feedback-action-dispatcher.js.map +1 -1
  15. package/lib/base/feedback/feedback-command.js +1 -2
  16. package/lib/base/feedback/feedback-command.js.map +1 -1
  17. package/lib/base/feedback/feedback-emitter.js +1 -2
  18. package/lib/base/feedback/feedback-emitter.js.map +1 -1
  19. package/lib/base/feedback/set-model-command.js +1 -2
  20. package/lib/base/feedback/set-model-command.js.map +1 -1
  21. package/lib/base/feedback/update-model-command.js +1 -2
  22. package/lib/base/feedback/update-model-command.js.map +1 -1
  23. package/lib/base/model/diagram-loader.js +4 -6
  24. package/lib/base/model/diagram-loader.js.map +1 -1
  25. package/lib/base/model/glsp-model-source.js +3 -5
  26. package/lib/base/model/glsp-model-source.js.map +1 -1
  27. package/lib/base/model/model-registry.js +1 -2
  28. package/lib/base/model/model-registry.js.map +1 -1
  29. package/lib/base/selection-service.js +3 -3
  30. package/lib/base/selection-service.js.map +1 -1
  31. package/lib/base/shortcuts/available-shortcuts-extension.js +3 -2
  32. package/lib/base/shortcuts/available-shortcuts-extension.js.map +1 -1
  33. package/lib/base/shortcuts/available-shortcuts-tool.js +3 -2
  34. package/lib/base/shortcuts/available-shortcuts-tool.js.map +1 -1
  35. package/lib/base/tool-manager/tool-manager.js +1 -1
  36. package/lib/base/tool-manager/tool-manager.js.map +1 -1
  37. package/lib/base/ui-extension/ui-extension.js +4 -6
  38. package/lib/base/ui-extension/ui-extension.js.map +1 -1
  39. package/lib/features/accessibility/edge-autocomplete/edge-autocomplete-palette.js +12 -17
  40. package/lib/features/accessibility/edge-autocomplete/edge-autocomplete-palette.js.map +1 -1
  41. package/lib/features/accessibility/edge-autocomplete/edge-autocomplete-tool.js +3 -2
  42. package/lib/features/accessibility/edge-autocomplete/edge-autocomplete-tool.js.map +1 -1
  43. package/lib/features/accessibility/element-navigation/diagram-navigation-tool.js +11 -15
  44. package/lib/features/accessibility/element-navigation/diagram-navigation-tool.js.map +1 -1
  45. package/lib/features/accessibility/element-navigation/left-right-top-bottom-navigator.js +2 -3
  46. package/lib/features/accessibility/element-navigation/left-right-top-bottom-navigator.js.map +1 -1
  47. package/lib/features/accessibility/element-navigation/local-element-navigator.js +2 -3
  48. package/lib/features/accessibility/element-navigation/local-element-navigator.js.map +1 -1
  49. package/lib/features/accessibility/focus-tracker/focus-tracker-tool.js +5 -4
  50. package/lib/features/accessibility/focus-tracker/focus-tracker-tool.js.map +1 -1
  51. package/lib/features/accessibility/global-keylistener-tool.js +4 -3
  52. package/lib/features/accessibility/global-keylistener-tool.js.map +1 -1
  53. package/lib/features/accessibility/keyboard-grid/keyboard-grid-search-palette.js +3 -2
  54. package/lib/features/accessibility/keyboard-grid/keyboard-grid-search-palette.js.map +1 -1
  55. package/lib/features/accessibility/keyboard-pointer/keyboard-pointer.d.ts +9 -1
  56. package/lib/features/accessibility/keyboard-pointer/keyboard-pointer.d.ts.map +1 -1
  57. package/lib/features/accessibility/keyboard-pointer/keyboard-pointer.js +12 -4
  58. package/lib/features/accessibility/keyboard-pointer/keyboard-pointer.js.map +1 -1
  59. package/lib/features/accessibility/keyboard-tool-palette/keyboard-tool-palette.js +5 -7
  60. package/lib/features/accessibility/keyboard-tool-palette/keyboard-tool-palette.js.map +1 -1
  61. package/lib/features/accessibility/toast/toast-handler.js +2 -4
  62. package/lib/features/accessibility/toast/toast-handler.js.map +1 -1
  63. package/lib/features/accessibility/toast/toast-tool.js +3 -2
  64. package/lib/features/accessibility/toast/toast-tool.js.map +1 -1
  65. package/lib/features/accessibility/view-key-tools/deselect-key-tool.js +3 -2
  66. package/lib/features/accessibility/view-key-tools/deselect-key-tool.js.map +1 -1
  67. package/lib/features/accessibility/view-key-tools/grid-cell-zoom-key-tool.js +4 -3
  68. package/lib/features/accessibility/view-key-tools/grid-cell-zoom-key-tool.js.map +1 -1
  69. package/lib/features/bounds/freeform-layout.js +1 -1
  70. package/lib/features/bounds/freeform-layout.js.map +1 -1
  71. package/lib/features/bounds/hbox-layout.js +7 -10
  72. package/lib/features/bounds/hbox-layout.js.map +1 -1
  73. package/lib/features/bounds/layout-data.js +2 -4
  74. package/lib/features/bounds/layout-data.js.map +1 -1
  75. package/lib/features/bounds/local-bounds.js +3 -4
  76. package/lib/features/bounds/local-bounds.js.map +1 -1
  77. package/lib/features/bounds/set-bounds-feedback-command.js +2 -3
  78. package/lib/features/bounds/set-bounds-feedback-command.js.map +1 -1
  79. package/lib/features/bounds/vbox-layout.js +7 -10
  80. package/lib/features/bounds/vbox-layout.js.map +1 -1
  81. package/lib/features/change-bounds/model.js +1 -1
  82. package/lib/features/change-bounds/model.js.map +1 -1
  83. package/lib/features/change-bounds/move-element-handler.js +1 -2
  84. package/lib/features/change-bounds/move-element-handler.js.map +1 -1
  85. package/lib/features/change-bounds/movement-restrictor.js +1 -2
  86. package/lib/features/change-bounds/movement-restrictor.js.map +1 -1
  87. package/lib/features/change-bounds/point-position-updater.js +1 -1
  88. package/lib/features/change-bounds/point-position-updater.js.map +1 -1
  89. package/lib/features/change-bounds/resize/resize-default-tool.js +4 -3
  90. package/lib/features/change-bounds/resize/resize-default-tool.js.map +1 -1
  91. package/lib/features/change-bounds/resize/resize-handler.js +1 -2
  92. package/lib/features/change-bounds/resize/resize-handler.js.map +1 -1
  93. package/lib/features/change-bounds/resize/resize-tool.js +4 -3
  94. package/lib/features/change-bounds/resize/resize-tool.js.map +1 -1
  95. package/lib/features/change-bounds/tracker.js +1 -2
  96. package/lib/features/change-bounds/tracker.js.map +1 -1
  97. package/lib/features/command-palette/command-palette-tool.js +3 -2
  98. package/lib/features/command-palette/command-palette-tool.js.map +1 -1
  99. package/lib/features/command-palette/command-palette.d.ts.map +1 -1
  100. package/lib/features/command-palette/command-palette.js +6 -5
  101. package/lib/features/command-palette/command-palette.js.map +1 -1
  102. package/lib/features/context-menu/glsp-context-menu-mouse-listener.js +2 -3
  103. package/lib/features/context-menu/glsp-context-menu-mouse-listener.js.map +1 -1
  104. package/lib/features/copy-paste/copy-paste-handler.d.ts +1 -1
  105. package/lib/features/copy-paste/copy-paste-handler.d.ts.map +1 -1
  106. package/lib/features/copy-paste/copy-paste-handler.js +3 -5
  107. package/lib/features/copy-paste/copy-paste-handler.js.map +1 -1
  108. package/lib/features/copy-paste/copy-paste-standalone.js +6 -9
  109. package/lib/features/copy-paste/copy-paste-standalone.js.map +1 -1
  110. package/lib/features/debug/debug-bounds-decorator.js +9 -12
  111. package/lib/features/debug/debug-bounds-decorator.js.map +1 -1
  112. package/lib/features/debug/debug-model.js +1 -1
  113. package/lib/features/debug/debug-model.js.map +1 -1
  114. package/lib/features/decoration/decoration-placer.js +3 -2
  115. package/lib/features/decoration/decoration-placer.js.map +1 -1
  116. package/lib/features/element-template/add-template-element.js +3 -4
  117. package/lib/features/element-template/add-template-element.js.map +1 -1
  118. package/lib/features/element-template/mouse-tracking-element-position-listener.js +1 -1
  119. package/lib/features/element-template/mouse-tracking-element-position-listener.js.map +1 -1
  120. package/lib/features/element-template/remove-template-element.js +1 -1
  121. package/lib/features/element-template/remove-template-element.js.map +1 -1
  122. package/lib/features/export/default-png-diagram-exporter.js +4 -7
  123. package/lib/features/export/default-png-diagram-exporter.js.map +1 -1
  124. package/lib/features/export/diagram-export-postprocessor.js +1 -2
  125. package/lib/features/export/diagram-export-postprocessor.js.map +1 -1
  126. package/lib/features/export/glsp-svg-exporter.d.ts.map +1 -1
  127. package/lib/features/export/glsp-svg-exporter.js +5 -6
  128. package/lib/features/export/glsp-svg-exporter.js.map +1 -1
  129. package/lib/features/export/request-export-command.js +1 -1
  130. package/lib/features/export/request-export-command.js.map +1 -1
  131. package/lib/features/grid/grid-model.js +1 -1
  132. package/lib/features/grid/grid-model.js.map +1 -1
  133. package/lib/features/helper-lines/helper-line-feedback.js +7 -8
  134. package/lib/features/helper-lines/helper-line-feedback.js.map +1 -1
  135. package/lib/features/helper-lines/model.d.ts +1 -1
  136. package/lib/features/helper-lines/model.d.ts.map +1 -1
  137. package/lib/features/helper-lines/model.js +3 -4
  138. package/lib/features/helper-lines/model.js.map +1 -1
  139. package/lib/features/hints/type-hint-provider.js +3 -5
  140. package/lib/features/hints/type-hint-provider.js.map +1 -1
  141. package/lib/features/label-edit/edit-label-tool.js +3 -2
  142. package/lib/features/label-edit/edit-label-tool.js.map +1 -1
  143. package/lib/features/label-edit-ui/label-edit-ui.js +2 -3
  144. package/lib/features/label-edit-ui/label-edit-ui.js.map +1 -1
  145. package/lib/features/navigation/navigation-target-resolver.js +1 -1
  146. package/lib/features/navigation/navigation-target-resolver.js.map +1 -1
  147. package/lib/features/routing/sticky-manhattan-anchors.js +9 -6
  148. package/lib/features/routing/sticky-manhattan-anchors.js.map +1 -1
  149. package/lib/features/routing/sticky-manhattan-edge-router.js +10 -12
  150. package/lib/features/routing/sticky-manhattan-edge-router.js.map +1 -1
  151. package/lib/features/search-palette/search-palette.js +3 -2
  152. package/lib/features/search-palette/search-palette.js.map +1 -1
  153. package/lib/features/search-palette/suggestions/edge-element-suggestions.js +2 -3
  154. package/lib/features/search-palette/suggestions/edge-element-suggestions.js.map +1 -1
  155. package/lib/features/search-palette/suggestions/named-element-suggestions.js +8 -11
  156. package/lib/features/search-palette/suggestions/named-element-suggestions.js.map +1 -1
  157. package/lib/features/select/select-feedback-command.js +1 -1
  158. package/lib/features/select/select-feedback-command.js.map +1 -1
  159. package/lib/features/select/select-mouse-listener.js +1 -2
  160. package/lib/features/select/select-mouse-listener.js.map +1 -1
  161. package/lib/features/status/status-overlay.js +4 -4
  162. package/lib/features/status/status-overlay.js.map +1 -1
  163. package/lib/features/tool-palette/tool-palette.js +14 -19
  164. package/lib/features/tool-palette/tool-palette.js.map +1 -1
  165. package/lib/features/tools/change-bounds/change-bounds-manager.js +4 -6
  166. package/lib/features/tools/change-bounds/change-bounds-manager.js.map +1 -1
  167. package/lib/features/tools/change-bounds/change-bounds-tool-feedback.js +3 -4
  168. package/lib/features/tools/change-bounds/change-bounds-tool-feedback.js.map +1 -1
  169. package/lib/features/tools/change-bounds/change-bounds-tool-move-feedback.js +4 -8
  170. package/lib/features/tools/change-bounds/change-bounds-tool-move-feedback.js.map +1 -1
  171. package/lib/features/tools/change-bounds/change-bounds-tool.js +6 -6
  172. package/lib/features/tools/change-bounds/change-bounds-tool.js.map +1 -1
  173. package/lib/features/tools/change-bounds/change-bounds-tracker.js +7 -10
  174. package/lib/features/tools/change-bounds/change-bounds-tracker.js.map +1 -1
  175. package/lib/features/tools/deletion/delete-tool.js +6 -4
  176. package/lib/features/tools/deletion/delete-tool.js.map +1 -1
  177. package/lib/features/tools/edge-creation/dangling-edge-feedback.js +4 -4
  178. package/lib/features/tools/edge-creation/dangling-edge-feedback.js.map +1 -1
  179. package/lib/features/tools/edge-creation/edge-creation-tool.js +5 -6
  180. package/lib/features/tools/edge-creation/edge-creation-tool.js.map +1 -1
  181. package/lib/features/tools/edge-creation/view.js +1 -2
  182. package/lib/features/tools/edge-creation/view.js.map +1 -1
  183. package/lib/features/tools/edge-edit/edge-edit-tool-feedback.js +4 -4
  184. package/lib/features/tools/edge-edit/edge-edit-tool-feedback.js.map +1 -1
  185. package/lib/features/tools/edge-edit/edge-edit-tool.js +3 -2
  186. package/lib/features/tools/edge-edit/edge-edit-tool.js.map +1 -1
  187. package/lib/features/tools/marquee-selection/marquee-mouse-tool.js +3 -2
  188. package/lib/features/tools/marquee-selection/marquee-mouse-tool.js.map +1 -1
  189. package/lib/features/tools/marquee-selection/marquee-tool-feedback.js +2 -2
  190. package/lib/features/tools/marquee-selection/marquee-tool-feedback.js.map +1 -1
  191. package/lib/features/tools/marquee-selection/marquee-tool.js +3 -2
  192. package/lib/features/tools/marquee-selection/marquee-tool.js.map +1 -1
  193. package/lib/features/tools/marquee-selection/model.js +1 -1
  194. package/lib/features/tools/marquee-selection/model.js.map +1 -1
  195. package/lib/features/tools/node-creation/container-manager.js +3 -4
  196. package/lib/features/tools/node-creation/container-manager.js.map +1 -1
  197. package/lib/features/tools/node-creation/insert-indicator.d.ts +1 -1
  198. package/lib/features/tools/node-creation/insert-indicator.d.ts.map +1 -1
  199. package/lib/features/tools/node-creation/insert-indicator.js +4 -5
  200. package/lib/features/tools/node-creation/insert-indicator.js.map +1 -1
  201. package/lib/features/tools/node-creation/node-creation-tool.js +5 -6
  202. package/lib/features/tools/node-creation/node-creation-tool.js.map +1 -1
  203. package/lib/features/tools/node-creation/node-creation-views.js +1 -2
  204. package/lib/features/tools/node-creation/node-creation-views.js.map +1 -1
  205. package/lib/features/validation/marker-navigator.js +1 -1
  206. package/lib/features/validation/marker-navigator.js.map +1 -1
  207. package/lib/features/validation/validate.js +4 -6
  208. package/lib/features/validation/validate.js.map +1 -1
  209. package/lib/features/viewport/origin-viewport.js +1 -1
  210. package/lib/features/viewport/origin-viewport.js.map +1 -1
  211. package/lib/features/viewport/reposition.js +2 -3
  212. package/lib/features/viewport/reposition.js.map +1 -1
  213. package/lib/features/viewport/viewport-handler.js +2 -3
  214. package/lib/features/viewport/viewport-handler.js.map +1 -1
  215. package/lib/features/viewport/viewport-tool.js +4 -3
  216. package/lib/features/viewport/viewport-tool.js.map +1 -1
  217. package/lib/features/zorder/bring-to-front-command.js +1 -2
  218. package/lib/features/zorder/bring-to-front-command.js.map +1 -1
  219. package/lib/model.js +2 -2
  220. package/lib/model.js.map +1 -1
  221. package/lib/utils/argument-utils.js +5 -5
  222. package/lib/utils/argument-utils.js.map +1 -1
  223. package/lib/utils/gmodel-util.js +4 -6
  224. package/lib/utils/gmodel-util.js.map +1 -1
  225. package/lib/utils/layout-utils.js +1 -2
  226. package/lib/utils/layout-utils.js.map +1 -1
  227. package/lib/utils/viewpoint-util.d.ts +13 -1
  228. package/lib/utils/viewpoint-util.d.ts.map +1 -1
  229. package/lib/utils/viewpoint-util.js +22 -1
  230. package/lib/utils/viewpoint-util.js.map +1 -1
  231. package/lib/views/glsp-projection-view.d.ts +12 -1
  232. package/lib/views/glsp-projection-view.d.ts.map +1 -1
  233. package/lib/views/glsp-projection-view.js +51 -1
  234. package/lib/views/glsp-projection-view.js.map +1 -1
  235. package/package.json +17 -16
  236. package/src/base/feedback/feedback-command.ts +1 -1
  237. package/src/features/accessibility/README.md +5 -5
  238. package/src/features/accessibility/keyboard-pointer/keyboard-pointer.ts +12 -3
  239. package/src/features/accessibility/keyboard-tool-palette/keyboard-tool-palette.ts +1 -1
  240. package/src/features/command-palette/command-palette.ts +4 -2
  241. package/src/features/copy-paste/copy-paste-handler.ts +3 -3
  242. package/src/features/export/glsp-svg-exporter.ts +2 -2
  243. package/src/features/helper-lines/model.ts +4 -5
  244. package/src/features/tools/node-creation/insert-indicator.ts +3 -4
  245. package/src/utils/viewpoint-util.ts +23 -1
  246. package/src/views/glsp-projection-view.tsx +58 -1
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2023-2024 Business Informatics Group (TU Wien) and others.
2
+ * Copyright (c) 2023-2026 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
@@ -18,6 +18,7 @@ import { inject, injectable } from 'inversify';
18
18
  import { EditorContextService } from '../../../base/editor-context-service';
19
19
  import { CursorCSS } from '../../../base/feedback/css-feedback';
20
20
  import { GLSPAbstractUIExtension } from '../../../base/ui-extension/ui-extension';
21
+ import { pageToCssPosition } from '../../../utils/viewpoint-util';
21
22
  import { ContainerManager } from '../../tools/node-creation/container-manager';
22
23
  import { KeyboardGridCellSelectedAction } from '../keyboard-grid/action';
23
24
  import { SetKeyboardPointerRenderPositionAction } from './actions';
@@ -50,8 +51,12 @@ export class KeyboardPointer extends GLSPAbstractUIExtension implements IActionH
50
51
  return this._triggerAction;
51
52
  }
52
53
 
54
+ /**
55
+ * Whether the pointer is currently shown. Reflects the `hidden` css class toggled by
56
+ * {@link GLSPAbstractUIExtension}, not the inline `visibility` style.
57
+ */
53
58
  get isVisible(): boolean {
54
- return this.containerElement?.style.visibility === 'visible';
59
+ return !!this.containerElement && this.isContainerVisible();
55
60
  }
56
61
 
57
62
  get getPosition(): KeyboardPointerPosition {
@@ -92,9 +97,13 @@ export class KeyboardPointer extends GLSPAbstractUIExtension implements IActionH
92
97
  }
93
98
  }
94
99
 
100
+ /**
101
+ * Positions the pointer on the selected grid cell and colors it to indicate whether node creation
102
+ * is allowed at that location.
103
+ */
95
104
  render(): void {
96
105
  if (this.containerElement !== undefined) {
97
- const { x, y } = this.position.renderPosition;
106
+ const { x, y } = pageToCssPosition(this.containerElement, this.position.renderPosition);
98
107
  this.containerElement.style.left = `${x}px`;
99
108
  this.containerElement.style.top = `${y}px`;
100
109
 
@@ -218,7 +218,7 @@ export class KeyboardToolPalette extends ToolPalette {
218
218
 
219
219
  // Create button for Search
220
220
  this.searchToolButton = this.createSearchButton();
221
- this.headerToolsButtonMapping.set(mappingIndex++, this.searchToolButton);
221
+ this.headerToolsButtonMapping.set(mappingIndex, this.searchToolButton);
222
222
  headerTools.appendChild(this.searchToolButton);
223
223
 
224
224
  return headerTools;
@@ -18,6 +18,7 @@ import { Bounds, CommandPalette, getWindowScroll, GModelElement, GModelRoot } fr
18
18
  import { injectable } from 'inversify';
19
19
  import { CSS_HIDDEN_EXTENSION_CLASS, CSS_UI_EXTENSION_CLASS } from '../../base/ui-extension/ui-extension';
20
20
  import { getElements, isSelectableAndBoundsAware } from '../../utils/gmodel-util';
21
+ import { pageToCssPosition } from '../../utils/viewpoint-util';
21
22
 
22
23
  @injectable()
23
24
  export class GlspCommandPalette extends CommandPalette {
@@ -49,8 +50,9 @@ export class GlspCommandPalette extends CommandPalette {
49
50
  x += bounds.x;
50
51
  y += bounds.y;
51
52
  }
52
- containerElement.style.left = `${x}px`;
53
- containerElement.style.top = `${y}px`;
53
+ const { x: cssX, y: cssY } = pageToCssPosition(containerElement, { x, y });
54
+ containerElement.style.left = `${cssX}px`;
55
+ containerElement.style.top = `${cssY}px`;
54
56
  containerElement.style.width = `${this.defaultWidth}px`;
55
57
  }
56
58
 
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2019-2024 EclipseSource and others.
2
+ * Copyright (c) 2019-2026 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
  ClipboardData,
18
18
  CutOperation,
19
+ generateUuid,
19
20
  IActionDispatcher,
20
21
  PasteOperation,
21
22
  RequestClipboardDataAction,
@@ -24,7 +25,6 @@ import {
24
25
  ViewerOptions
25
26
  } from '@eclipse-glsp/sprotty';
26
27
  import { inject, injectable } from 'inversify';
27
- import { v4 as uuid } from 'uuid';
28
28
  import { EditorContextService } from '../../base/editor-context-service';
29
29
 
30
30
  export interface ICopyPasteHandler {
@@ -107,7 +107,7 @@ export class ServerCopyPasteHandler implements ICopyPasteHandler {
107
107
 
108
108
  handleCopy(event: ClipboardEvent): void {
109
109
  if (event.clipboardData && this.shouldCopy(event)) {
110
- const clipboardId = uuid();
110
+ const clipboardId = generateUuid();
111
111
  event.clipboardData.setData(CLIPBOARD_DATA_FORMAT, toClipboardId(clipboardId));
112
112
  this.actionDispatcher
113
113
  .request<SetClipboardDataAction>(RequestClipboardDataAction.create(this.editorContext.get()))
@@ -18,6 +18,7 @@ import {
18
18
  Action,
19
19
  ExportSvgAction,
20
20
  ExportSvgOptions,
21
+ generateUuid,
21
22
  GModelRoot,
22
23
  RejectAction,
23
24
  RequestAction,
@@ -25,7 +26,6 @@ import {
25
26
  SvgExporter
26
27
  } from '@eclipse-glsp/sprotty';
27
28
  import { injectable } from 'inversify';
28
- import { v4 as uuid } from 'uuid';
29
29
 
30
30
  @injectable()
31
31
  export class GLSPSvgExporter extends SvgExporter {
@@ -82,7 +82,7 @@ export class GLSPSvgExporter extends SvgExporter {
82
82
  // createSvg requires the svg to have a non-empty id, so we generate one if necessary
83
83
  const originalId = svgElement.id;
84
84
  try {
85
- svgElement.id = originalId || uuid();
85
+ svgElement.id = originalId || generateUuid();
86
86
  return super.createSvg(svgElement, root, options, cause);
87
87
  } finally {
88
88
  svgElement.id = originalId;
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2023-2024 EclipseSource and others.
2
+ * Copyright (c) 2023-2026 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
@@ -14,8 +14,7 @@
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
16
 
17
- import { Args, Bounds, Direction, GChildElement, GModelElement, GShapeElement, Point, Vector } from '@eclipse-glsp/sprotty';
18
- import { v4 as uuid } from 'uuid';
17
+ import { Args, Bounds, Direction, GChildElement, GModelElement, GShapeElement, Point, Vector, generateUuid } from '@eclipse-glsp/sprotty';
19
18
  import { ArgsAware } from '../../base/args-feature';
20
19
  import { ResizeHandleLocation } from '../change-bounds/model';
21
20
 
@@ -46,7 +45,7 @@ export class HelperLine extends GChildElement implements ArgsAware {
46
45
  readonly lineType: HelperLineType = HelperLineType.Left
47
46
  ) {
48
47
  super();
49
- this.id = uuid();
48
+ this.id = generateUuid();
50
49
  this.type = HELPER_LINE;
51
50
  }
52
51
 
@@ -86,7 +85,7 @@ export class SelectionBounds extends GShapeElement implements ArgsAware {
86
85
 
87
86
  constructor(bounds?: Bounds) {
88
87
  super();
89
- this.id = uuid();
88
+ this.id = generateUuid();
90
89
  this.type = SELECTION_BOUNDS;
91
90
  if (bounds) {
92
91
  this.bounds = bounds;
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2024 EclipseSource and others.
2
+ * Copyright (c) 2024-2026 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
@@ -14,8 +14,7 @@
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
16
 
17
- import { Args, Dimension, FeatureSet, GNode, boundsFeature, createFeatureSet, moveFeature } from '@eclipse-glsp/sprotty';
18
- import { v4 as uuid } from 'uuid';
17
+ import { Args, Dimension, FeatureSet, GNode, boundsFeature, createFeatureSet, generateUuid, moveFeature } from '@eclipse-glsp/sprotty';
19
18
  import { ArgsAware, argsFeature } from '../../../base/args-feature';
20
19
 
21
20
  export const ARG_LENGTH = 'length';
@@ -25,7 +24,7 @@ export class InsertIndicator extends GNode implements ArgsAware {
25
24
 
26
25
  static TYPE = 'node:insert-indicator';
27
26
 
28
- override id: string = uuid();
27
+ override id: string = generateUuid();
29
28
  override type: string = InsertIndicator.TYPE;
30
29
  override features?: FeatureSet = createFeatureSet(InsertIndicator.DEFAULT_FEATURES);
31
30
  override cssClasses: string[] = ['insert-indicator', 'sprotty-node'];
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2019-2025 EclipseSource and others.
2
+ * Copyright (c) 2019-2026 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
@@ -23,6 +23,7 @@ import {
23
23
  Point,
24
24
  Viewport,
25
25
  findParentByFeature,
26
+ getWindowScroll,
26
27
  isAlignable,
27
28
  isBoundsAware,
28
29
  isViewport,
@@ -61,6 +62,27 @@ export function getAbsolutePositionByPoint(target: GModelElement, point: Point):
61
62
  return position;
62
63
  }
63
64
 
65
+ /**
66
+ * Computes the CSS `left`/`top` (in pixels) for placing {@link element} at the given point in page
67
+ * coordinates, accounting for its positioning context: relative to its `offsetParent` (the diagram
68
+ * container for absolutely positioned overlays) or, when there is none, relative to the viewport for
69
+ * fixed elements. This lets UI extensions be placed on the diagram canvas independently of where the
70
+ * diagram container sits within the page (e.g. below an application header).
71
+ *
72
+ * @param element the DOM-attached element to position
73
+ * @param pagePoint the target location in page coordinates
74
+ * @returns the `left`/`top` offset to assign to {@link element}'s style
75
+ */
76
+ export function pageToCssPosition(element: HTMLElement, pagePoint: Point): Point {
77
+ const scroll = getWindowScroll();
78
+ const offsetParent = element.offsetParent as HTMLElement | null;
79
+ if (offsetParent) {
80
+ const bounds = offsetParent.getBoundingClientRect();
81
+ return { x: pagePoint.x - bounds.left - scroll.x, y: pagePoint.y - bounds.top - scroll.y };
82
+ }
83
+ return { x: pagePoint.x - scroll.x, y: pagePoint.y - scroll.y };
84
+ }
85
+
64
86
  export function getViewportBounds(target: GModelElement, bounds: Bounds): Bounds {
65
87
  const topLeft = getAbsolutePositionByPoint(target, Bounds.topLeft(bounds));
66
88
  const bottomRight = getAbsolutePositionByPoint(target, Bounds.bottomRight(bounds));
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2017-2025 TypeFox and others.
2
+ * Copyright (c) 2017-2026 TypeFox 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
@@ -28,7 +28,9 @@ import {
28
28
  TYPES,
29
29
  ViewProjection,
30
30
  Writable,
31
+ getProjections,
31
32
  html,
33
+ isBoundsAware,
32
34
  setAttr,
33
35
  setClass
34
36
  } from '@eclipse-glsp/sprotty';
@@ -91,6 +93,61 @@ export class GLSPProjectionView extends ProjectedViewportView {
91
93
  return { ...position, ...size };
92
94
  }
93
95
 
96
+ protected override renderProjections(model: Readonly<GViewportRootElement>, context: RenderingContext, args?: IViewArgs): VNode[] {
97
+ if (model.zoom <= 0) {
98
+ return [];
99
+ }
100
+ const modelBounds = this.getModelBounds(model);
101
+ if (!modelBounds) {
102
+ return [];
103
+ }
104
+ const projections = getProjections(model) ?? [];
105
+ return [
106
+ this.renderProjectionBar(projections, model, modelBounds, 'vertical'),
107
+ this.renderProjectionBar(projections, model, modelBounds, 'horizontal')
108
+ ];
109
+ }
110
+
111
+ /**
112
+ * Computes the total bounds that the projection bars map to, i.e. the union of the actual
113
+ * content bounds and the current viewport.
114
+ *
115
+ * This is a reimplementation of sprotty's `getModelBounds`, with two minor fixes
116
+ * - this intentionally derives the content bounds from the
117
+ * root's children instead of using {@link GViewportRootElement.bounds} directly.
118
+ * - We ignore bounds with invalid dimensions (e.g. from routable edges without bend points) to avoid pulling the
119
+ */
120
+ protected getModelBounds(model: Readonly<GViewportRootElement>): Bounds | undefined {
121
+ let minX = Number.POSITIVE_INFINITY;
122
+ let minY = Number.POSITIVE_INFINITY;
123
+ let maxX = Number.NEGATIVE_INFINITY;
124
+ let maxY = Number.NEGATIVE_INFINITY;
125
+
126
+ for (const element of model.children) {
127
+ if (isBoundsAware(element)) {
128
+ const b = element.bounds;
129
+ if (!Dimension.isValid(b)) {
130
+ continue;
131
+ }
132
+ minX = Math.min(minX, b.x);
133
+ minY = Math.min(minY, b.y);
134
+ maxX = Math.max(maxX, b.x + b.width);
135
+ maxY = Math.max(maxY, b.y + b.height);
136
+ }
137
+ }
138
+
139
+ // enlarge the bounds by the current viewport to ensure it always fits into the projection
140
+ minX = Math.min(minX, model.scroll.x);
141
+ minY = Math.min(minY, model.scroll.y);
142
+ maxX = Math.max(maxX, model.scroll.x + model.canvasBounds.width / model.zoom);
143
+ maxY = Math.max(maxY, model.scroll.y + model.canvasBounds.height / model.zoom);
144
+
145
+ if (minX < maxX && minY < maxY) {
146
+ return { x: minX, y: minY, width: maxX - minX, height: maxY - minY };
147
+ }
148
+ return undefined;
149
+ }
150
+
94
151
  protected override renderProjectionBar(
95
152
  projections: ViewProjection[],
96
153
  model: Readonly<GViewportRootElement>,