@eclipse-glsp/client 2.2.0-next.343 → 2.2.0-next.345

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 (238) hide show
  1. package/lib/base/default.module.d.ts.map +1 -1
  2. package/lib/base/default.module.js +2 -0
  3. package/lib/base/default.module.js.map +1 -1
  4. package/lib/features/accessibility/accessibility-module.d.ts +1 -1
  5. package/lib/features/accessibility/accessibility-module.d.ts.map +1 -1
  6. package/lib/features/accessibility/accessibility-module.js +10 -8
  7. package/lib/features/accessibility/accessibility-module.js.map +1 -1
  8. package/lib/features/accessibility/element-navigation/element-navigation-module.d.ts +6 -4
  9. package/lib/features/accessibility/element-navigation/element-navigation-module.d.ts.map +1 -1
  10. package/lib/features/accessibility/element-navigation/element-navigation-module.js +8 -8
  11. package/lib/features/accessibility/element-navigation/element-navigation-module.js.map +1 -1
  12. package/lib/features/accessibility/focus-tracker/focus-tracker-module.d.ts +6 -4
  13. package/lib/features/accessibility/focus-tracker/focus-tracker-module.d.ts.map +1 -1
  14. package/lib/features/accessibility/focus-tracker/focus-tracker-module.js +6 -6
  15. package/lib/features/accessibility/focus-tracker/focus-tracker-module.js.map +1 -1
  16. package/lib/features/accessibility/key-shortcut/{di.config.d.ts → shortcut-help-module.d.ts} +7 -5
  17. package/lib/features/accessibility/key-shortcut/shortcut-help-module.d.ts.map +1 -0
  18. package/lib/features/accessibility/key-shortcut/{di.config.js → shortcut-help-module.js} +6 -6
  19. package/lib/features/accessibility/key-shortcut/shortcut-help-module.js.map +1 -0
  20. package/lib/features/accessibility/keyboard-pointer/keyboard-pointer-module.d.ts +1 -1
  21. package/lib/features/accessibility/keyboard-pointer/keyboard-pointer-module.d.ts.map +1 -1
  22. package/lib/features/accessibility/keyboard-pointer/keyboard-pointer-module.js +7 -7
  23. package/lib/features/accessibility/keyboard-pointer/keyboard-pointer-module.js.map +1 -1
  24. package/lib/features/accessibility/keyboard-tool-palette/keyboard-tool-palette-module.d.ts.map +1 -1
  25. package/lib/features/accessibility/keyboard-tool-palette/keyboard-tool-palette-module.js +1 -1
  26. package/lib/features/accessibility/keyboard-tool-palette/keyboard-tool-palette-module.js.map +1 -1
  27. package/lib/features/accessibility/move-zoom/move-zoom-module.d.ts.map +1 -1
  28. package/lib/features/accessibility/move-zoom/move-zoom-module.js +1 -1
  29. package/lib/features/accessibility/move-zoom/move-zoom-module.js.map +1 -1
  30. package/lib/features/accessibility/resize-key-tool/resize-key-module.d.ts.map +1 -1
  31. package/lib/features/accessibility/resize-key-tool/resize-key-module.js +1 -1
  32. package/lib/features/accessibility/resize-key-tool/resize-key-module.js.map +1 -1
  33. package/lib/features/accessibility/search/search-palette-module.d.ts.map +1 -1
  34. package/lib/features/accessibility/search/search-palette-module.js +1 -1
  35. package/lib/features/accessibility/search/search-palette-module.js.map +1 -1
  36. package/lib/features/accessibility/toast/toast-module.d.ts +6 -4
  37. package/lib/features/accessibility/toast/toast-module.d.ts.map +1 -1
  38. package/lib/features/accessibility/toast/toast-module.js +5 -5
  39. package/lib/features/accessibility/toast/toast-module.js.map +1 -1
  40. package/lib/features/accessibility/view-key-tools/deselect-key-tool.d.ts +2 -2
  41. package/lib/features/accessibility/view-key-tools/deselect-key-tool.d.ts.map +1 -1
  42. package/lib/features/accessibility/view-key-tools/deselect-key-tool.js +3 -3
  43. package/lib/features/accessibility/view-key-tools/deselect-key-tool.js.map +1 -1
  44. package/lib/features/accessibility/view-key-tools/view-key-tools-module.d.ts.map +1 -1
  45. package/lib/features/accessibility/view-key-tools/view-key-tools-module.js +3 -1
  46. package/lib/features/accessibility/view-key-tools/view-key-tools-module.js.map +1 -1
  47. package/lib/features/bounds/bounds-module.d.ts.map +1 -1
  48. package/lib/features/bounds/bounds-module.js +1 -1
  49. package/lib/features/bounds/bounds-module.js.map +1 -1
  50. package/lib/features/change-bounds/model.d.ts +7 -4
  51. package/lib/features/change-bounds/model.d.ts.map +1 -1
  52. package/lib/features/change-bounds/model.js +12 -11
  53. package/lib/features/change-bounds/model.js.map +1 -1
  54. package/lib/features/change-bounds/movement-restrictor.js +2 -2
  55. package/lib/features/command-palette/command-palette-module.d.ts.map +1 -1
  56. package/lib/features/command-palette/command-palette-module.js +1 -1
  57. package/lib/features/command-palette/command-palette-module.js.map +1 -1
  58. package/lib/features/context-menu/context-menu-module.d.ts.map +1 -1
  59. package/lib/features/context-menu/context-menu-module.js +1 -1
  60. package/lib/features/context-menu/context-menu-module.js.map +1 -1
  61. package/lib/features/copy-paste/copy-paste-modules.d.ts.map +1 -1
  62. package/lib/features/copy-paste/copy-paste-modules.js +5 -2
  63. package/lib/features/copy-paste/copy-paste-modules.js.map +1 -1
  64. package/lib/features/debug/debug-module.d.ts.map +1 -1
  65. package/lib/features/debug/debug-module.js +1 -1
  66. package/lib/features/debug/debug-module.js.map +1 -1
  67. package/lib/features/decoration/decoration-module.d.ts.map +1 -1
  68. package/lib/features/decoration/decoration-module.js +1 -1
  69. package/lib/features/decoration/decoration-module.js.map +1 -1
  70. package/lib/features/element-template/element-template-module.d.ts.map +1 -1
  71. package/lib/features/element-template/element-template-module.js +1 -1
  72. package/lib/features/element-template/element-template-module.js.map +1 -1
  73. package/lib/features/export/export-modules.d.ts.map +1 -1
  74. package/lib/features/export/export-modules.js +2 -2
  75. package/lib/features/export/export-modules.js.map +1 -1
  76. package/lib/features/grid/grid-module.d.ts.map +1 -1
  77. package/lib/features/grid/grid-module.js +1 -1
  78. package/lib/features/grid/grid-module.js.map +1 -1
  79. package/lib/features/helper-lines/helper-line-manager-default.js +1 -1
  80. package/lib/features/helper-lines/helper-line-module.d.ts.map +1 -1
  81. package/lib/features/helper-lines/helper-line-module.js +1 -1
  82. package/lib/features/helper-lines/helper-line-module.js.map +1 -1
  83. package/lib/features/hints/type-hints-module.d.ts.map +1 -1
  84. package/lib/features/hints/type-hints-module.js +1 -1
  85. package/lib/features/hints/type-hints-module.js.map +1 -1
  86. package/lib/features/hover/hover-module.d.ts.map +1 -1
  87. package/lib/features/hover/hover-module.js +1 -1
  88. package/lib/features/hover/hover-module.js.map +1 -1
  89. package/lib/features/label-edit/label-edit-module.d.ts.map +1 -1
  90. package/lib/features/label-edit/label-edit-module.js +1 -1
  91. package/lib/features/label-edit/label-edit-module.js.map +1 -1
  92. package/lib/features/label-edit-ui/label-edit-ui-module.d.ts.map +1 -1
  93. package/lib/features/label-edit-ui/label-edit-ui-module.js +1 -1
  94. package/lib/features/label-edit-ui/label-edit-ui-module.js.map +1 -1
  95. package/lib/features/layout/layout-module.d.ts.map +1 -1
  96. package/lib/features/layout/layout-module.js +1 -1
  97. package/lib/features/layout/layout-module.js.map +1 -1
  98. package/lib/features/navigation/navigation-module.d.ts.map +1 -1
  99. package/lib/features/navigation/navigation-module.js +1 -1
  100. package/lib/features/navigation/navigation-module.js.map +1 -1
  101. package/lib/features/routing/routing-module.d.ts.map +1 -1
  102. package/lib/features/routing/routing-module.js +1 -1
  103. package/lib/features/routing/routing-module.js.map +1 -1
  104. package/lib/features/save/save-module.d.ts.map +1 -1
  105. package/lib/features/save/save-module.js +1 -1
  106. package/lib/features/save/save-module.js.map +1 -1
  107. package/lib/features/select/select-module.d.ts.map +1 -1
  108. package/lib/features/select/select-module.js +2 -2
  109. package/lib/features/select/select-module.js.map +1 -1
  110. package/lib/features/select/select-mouse-listener.js +1 -1
  111. package/lib/features/source-model-watcher/source-model-watcher-module.d.ts.map +1 -1
  112. package/lib/features/source-model-watcher/source-model-watcher-module.js +1 -1
  113. package/lib/features/source-model-watcher/source-model-watcher-module.js.map +1 -1
  114. package/lib/features/status/status-module.d.ts.map +1 -1
  115. package/lib/features/status/status-module.js +1 -1
  116. package/lib/features/status/status-module.js.map +1 -1
  117. package/lib/features/svg-metadata/svg-metadata-module.d.ts.map +1 -1
  118. package/lib/features/svg-metadata/svg-metadata-module.js +1 -1
  119. package/lib/features/svg-metadata/svg-metadata-module.js.map +1 -1
  120. package/lib/features/tool-palette/tool-palette-module.d.ts.map +1 -1
  121. package/lib/features/tool-palette/tool-palette-module.js +1 -1
  122. package/lib/features/tool-palette/tool-palette-module.js.map +1 -1
  123. package/lib/features/tools/change-bounds/change-bounds-manager.d.ts.map +1 -1
  124. package/lib/features/tools/change-bounds/change-bounds-manager.js +1 -1
  125. package/lib/features/tools/change-bounds/change-bounds-tool-module.d.ts.map +1 -1
  126. package/lib/features/tools/change-bounds/change-bounds-tool-module.js +2 -2
  127. package/lib/features/tools/change-bounds/change-bounds-tool-module.js.map +1 -1
  128. package/lib/features/tools/change-bounds/change-bounds-tool-move-feedback.js +2 -2
  129. package/lib/features/tools/change-bounds/change-bounds-tool.d.ts +3 -3
  130. package/lib/features/tools/change-bounds/change-bounds-tool.js +1 -1
  131. package/lib/features/tools/change-bounds/change-bounds-tracker.d.ts +6 -6
  132. package/lib/features/tools/change-bounds/change-bounds-tracker.d.ts.map +1 -1
  133. package/lib/features/tools/change-bounds/change-bounds-tracker.js +2 -2
  134. package/lib/features/tools/change-bounds/view.d.ts +8 -5
  135. package/lib/features/tools/change-bounds/view.d.ts.map +1 -1
  136. package/lib/features/tools/change-bounds/view.js +8 -7
  137. package/lib/features/tools/change-bounds/view.js.map +1 -1
  138. package/lib/features/tools/deletion/deletion-tool-module.d.ts.map +1 -1
  139. package/lib/features/tools/deletion/deletion-tool-module.js +1 -1
  140. package/lib/features/tools/deletion/deletion-tool-module.js.map +1 -1
  141. package/lib/features/tools/edge-creation/edege-creation-module.d.ts.map +1 -1
  142. package/lib/features/tools/edge-creation/edege-creation-module.js +1 -1
  143. package/lib/features/tools/edge-creation/edege-creation-module.js.map +1 -1
  144. package/lib/features/tools/edge-edit/edge-edit-module.d.ts.map +1 -1
  145. package/lib/features/tools/edge-edit/edge-edit-module.js +1 -1
  146. package/lib/features/tools/edge-edit/edge-edit-module.js.map +1 -1
  147. package/lib/features/tools/marquee-selection/marquee-selection-module.d.ts.map +1 -1
  148. package/lib/features/tools/marquee-selection/marquee-selection-module.js +1 -1
  149. package/lib/features/tools/marquee-selection/marquee-selection-module.js.map +1 -1
  150. package/lib/features/tools/node-creation/node-creation-module.d.ts.map +1 -1
  151. package/lib/features/tools/node-creation/node-creation-module.js +4 -1
  152. package/lib/features/tools/node-creation/node-creation-module.js.map +1 -1
  153. package/lib/features/tools/tool-focus-loss-module.d.ts +15 -0
  154. package/lib/features/tools/tool-focus-loss-module.d.ts.map +1 -1
  155. package/lib/features/tools/tool-focus-loss-module.js +2 -2
  156. package/lib/features/tools/tool-focus-loss-module.js.map +1 -1
  157. package/lib/features/undo-redo/undo-redo-module.d.ts +3 -3
  158. package/lib/features/undo-redo/undo-redo-module.d.ts.map +1 -1
  159. package/lib/features/undo-redo/undo-redo-module.js +3 -4
  160. package/lib/features/undo-redo/undo-redo-module.js.map +1 -1
  161. package/lib/features/validation/validation-modules.d.ts.map +1 -1
  162. package/lib/features/validation/validation-modules.js +3 -3
  163. package/lib/features/validation/validation-modules.js.map +1 -1
  164. package/lib/features/viewport/viewport-modules.d.ts.map +1 -1
  165. package/lib/features/viewport/viewport-modules.js +2 -2
  166. package/lib/features/viewport/viewport-modules.js.map +1 -1
  167. package/lib/index.d.ts +1 -1
  168. package/lib/index.d.ts.map +1 -1
  169. package/lib/index.js +1 -1
  170. package/lib/index.js.map +1 -1
  171. package/lib/standalone-modules.d.ts +1 -1
  172. package/lib/standalone-modules.d.ts.map +1 -1
  173. package/lib/standalone-modules.js +1 -1
  174. package/lib/standalone-modules.js.map +1 -1
  175. package/lib/views/base-view-module.d.ts.map +1 -1
  176. package/lib/views/base-view-module.js +1 -1
  177. package/lib/views/base-view-module.js.map +1 -1
  178. package/package.json +3 -3
  179. package/src/base/default.module.ts +80 -73
  180. package/src/features/accessibility/accessibility-module.ts +25 -20
  181. package/src/features/accessibility/element-navigation/element-navigation-module.ts +17 -10
  182. package/src/features/accessibility/focus-tracker/focus-tracker-module.ts +14 -7
  183. package/src/features/accessibility/key-shortcut/{di.config.ts → shortcut-help-module.ts} +14 -7
  184. package/src/features/accessibility/keyboard-pointer/keyboard-pointer-module.ts +18 -15
  185. package/src/features/accessibility/keyboard-tool-palette/keyboard-tool-palette-module.ts +7 -4
  186. package/src/features/accessibility/move-zoom/move-zoom-module.ts +7 -4
  187. package/src/features/accessibility/resize-key-tool/resize-key-module.ts +7 -4
  188. package/src/features/accessibility/search/search-palette-module.ts +7 -4
  189. package/src/features/accessibility/toast/toast-module.ts +14 -7
  190. package/src/features/accessibility/view-key-tools/deselect-key-tool.ts +8 -8
  191. package/src/features/accessibility/view-key-tools/view-key-tools-module.ts +10 -5
  192. package/src/features/bounds/bounds-module.ts +20 -17
  193. package/src/features/change-bounds/model.ts +17 -12
  194. package/src/features/change-bounds/movement-restrictor.ts +3 -3
  195. package/src/features/command-palette/command-palette-module.ts +9 -6
  196. package/src/features/context-menu/context-menu-module.ts +16 -13
  197. package/src/features/copy-paste/copy-paste-modules.ts +11 -5
  198. package/src/features/debug/debug-module.ts +10 -7
  199. package/src/features/decoration/decoration-module.ts +6 -3
  200. package/src/features/element-template/element-template-module.ts +8 -5
  201. package/src/features/export/export-modules.ts +10 -7
  202. package/src/features/grid/grid-module.ts +11 -8
  203. package/src/features/helper-lines/helper-line-manager-default.ts +2 -2
  204. package/src/features/helper-lines/helper-line-module.ts +16 -13
  205. package/src/features/hints/type-hints-module.ts +10 -7
  206. package/src/features/hover/hover-module.ts +28 -25
  207. package/src/features/label-edit/label-edit-module.ts +9 -6
  208. package/src/features/label-edit-ui/label-edit-ui-module.ts +9 -6
  209. package/src/features/layout/layout-module.ts +8 -5
  210. package/src/features/navigation/navigation-module.ts +11 -8
  211. package/src/features/routing/routing-module.ts +21 -18
  212. package/src/features/save/save-module.ts +6 -3
  213. package/src/features/select/select-module.ts +11 -8
  214. package/src/features/select/select-mouse-listener.ts +2 -2
  215. package/src/features/source-model-watcher/source-model-watcher-module.ts +6 -3
  216. package/src/features/status/status-module.ts +9 -6
  217. package/src/features/svg-metadata/svg-metadata-module.ts +7 -4
  218. package/src/features/tool-palette/tool-palette-module.ts +10 -7
  219. package/src/features/tools/change-bounds/change-bounds-manager.ts +2 -2
  220. package/src/features/tools/change-bounds/change-bounds-tool-module.ts +13 -10
  221. package/src/features/tools/change-bounds/change-bounds-tool-move-feedback.ts +3 -3
  222. package/src/features/tools/change-bounds/change-bounds-tool.ts +4 -4
  223. package/src/features/tools/change-bounds/change-bounds-tracker.ts +6 -6
  224. package/src/features/tools/change-bounds/view.tsx +11 -6
  225. package/src/features/tools/deletion/deletion-tool-module.ts +8 -5
  226. package/src/features/tools/edge-creation/edege-creation-module.ts +9 -6
  227. package/src/features/tools/edge-edit/edge-edit-module.ts +14 -11
  228. package/src/features/tools/marquee-selection/marquee-selection-module.ts +11 -8
  229. package/src/features/tools/node-creation/node-creation-module.ts +4 -1
  230. package/src/features/tools/tool-focus-loss-module.ts +7 -4
  231. package/src/features/undo-redo/undo-redo-module.ts +8 -6
  232. package/src/features/validation/validation-modules.ts +19 -13
  233. package/src/features/viewport/viewport-modules.ts +20 -17
  234. package/src/index.ts +1 -1
  235. package/src/standalone-modules.ts +12 -9
  236. package/src/views/base-view-module.ts +7 -4
  237. package/lib/features/accessibility/key-shortcut/di.config.d.ts.map +0 -1
  238. package/lib/features/accessibility/key-shortcut/di.config.js.map +0 -1
@@ -32,7 +32,7 @@ import {
32
32
  isMoveable
33
33
  } from '@eclipse-glsp/sprotty';
34
34
  import { BoundsAwareModelElement, MoveableElement, ResizableModelElement, getElements } from '../../../utils/gmodel-util';
35
- import { ResizeHandleLocation, SResizeHandle } from '../../change-bounds/model';
35
+ import { GResizeHandle, ResizeHandleLocation } from '../../change-bounds/model';
36
36
  import { DiagramMovementCalculator } from '../../change-bounds/tracker';
37
37
  import { ChangeBoundsManager } from './change-bounds-manager';
38
38
 
@@ -277,7 +277,7 @@ export class ChangeBoundsTracker {
277
277
  // RESIZE
278
278
  //
279
279
 
280
- resizeElements(handle: SResizeHandle, opts?: Partial<ResizeOptions>): TrackedResize {
280
+ resizeElements(handle: GResizeHandle, opts?: Partial<ResizeOptions>): TrackedResize {
281
281
  const options = this.resolveResizeOptions(opts);
282
282
  const update = this.calculateDiagramMovement();
283
283
  const handleMove = this.calculateHandleMove(new MoveableResizeHandle(handle), update.vector, options);
@@ -315,7 +315,7 @@ export class ChangeBoundsTracker {
315
315
  return this.calculateElementMove(handle, diagramMovement, moveOptions);
316
316
  }
317
317
 
318
- protected getResizableElements(handle: SResizeHandle, options: ResizeOptions): ResizableModelElement[] {
318
+ protected getResizableElements(handle: GResizeHandle, options: ResizeOptions): ResizableModelElement[] {
319
319
  return [handle.parent];
320
320
  }
321
321
 
@@ -447,11 +447,11 @@ export class ChangeBoundsTracker {
447
447
  }
448
448
  }
449
449
 
450
- export class MoveableResizeHandle extends SResizeHandle implements Locateable {
450
+ export class MoveableResizeHandle extends GResizeHandle implements Locateable {
451
451
  constructor(
452
- protected handle: SResizeHandle,
452
+ protected handle: GResizeHandle,
453
453
  override location: ResizeHandleLocation = handle.location,
454
- readonly position = SResizeHandle.getHandlePosition(handle.parent, location)
454
+ readonly position = GResizeHandle.getHandlePosition(handle.parent, location)
455
455
  ) {
456
456
  super(location, handle.type, handle.hoverFeedback);
457
457
  this.id = handle.id;
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2019-2023 EclipseSource and others.
2
+ * Copyright (c) 2019-2024 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,14 +16,14 @@
16
16
  import { IView, Point, RenderingContext, setAttr, svg } from '@eclipse-glsp/sprotty';
17
17
  import { injectable } from 'inversify';
18
18
  import { VNode } from 'snabbdom';
19
- import { SResizeHandle } from '../../change-bounds/model';
19
+ import { GResizeHandle } from '../../change-bounds/model';
20
20
 
21
21
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
22
22
  const JSX = { createElement: svg };
23
23
 
24
24
  @injectable()
25
- export class SResizeHandleView implements IView {
26
- render(handle: SResizeHandle, context: RenderingContext): VNode | undefined {
25
+ export class GResizeHandleView implements IView {
26
+ render(handle: GResizeHandle, context: RenderingContext): VNode | undefined {
27
27
  if (context.targetKind === 'hidden') {
28
28
  return undefined;
29
29
  }
@@ -45,11 +45,16 @@ export class SResizeHandleView implements IView {
45
45
  return <g />;
46
46
  }
47
47
 
48
- protected getPosition(handle: SResizeHandle): Point | undefined {
49
- return Point.subtract(SResizeHandle.getHandlePosition(handle), handle.parent.bounds);
48
+ protected getPosition(handle: GResizeHandle): Point | undefined {
49
+ return Point.subtract(GResizeHandle.getHandlePosition(handle), handle.parent.bounds);
50
50
  }
51
51
 
52
52
  getRadius(): number {
53
53
  return 7;
54
54
  }
55
55
  }
56
+
57
+ export {
58
+ /** @deprecated Use {@link GResizeHandleView} instead */
59
+ GResizeHandleView as SResizeHandleView
60
+ };
@@ -16,8 +16,11 @@
16
16
  import { FeatureModule, TYPES, bindAsService } from '@eclipse-glsp/sprotty';
17
17
  import { DelKeyDeleteTool, MouseDeleteTool } from './delete-tool';
18
18
 
19
- export const deletionToolModule = new FeatureModule((bind, unbind, isBound, rebind) => {
20
- const context = { bind, unbind, isBound, rebind };
21
- bindAsService(context, TYPES.IDefaultTool, DelKeyDeleteTool);
22
- bindAsService(context, TYPES.ITool, MouseDeleteTool);
23
- });
19
+ export const deletionToolModule = new FeatureModule(
20
+ (bind, unbind, isBound, rebind) => {
21
+ const context = { bind, unbind, isBound, rebind };
22
+ bindAsService(context, TYPES.IDefaultTool, DelKeyDeleteTool);
23
+ bindAsService(context, TYPES.ITool, MouseDeleteTool);
24
+ },
25
+ { featureId: Symbol('deletionTool') }
26
+ );
@@ -17,9 +17,12 @@ import { FeatureModule, TYPES, TriggerEdgeCreationAction, bindAsService, configu
17
17
  import { configureDanglingFeedbackEdge } from './dangling-edge-feedback';
18
18
  import { EdgeCreationTool } from './edge-creation-tool';
19
19
 
20
- export const edgeCreationToolModule = new FeatureModule((bind, unbind, isBound, rebind) => {
21
- const context = { bind, unbind, isBound, rebind };
22
- bindAsService(context, TYPES.ITool, EdgeCreationTool);
23
- configureActionHandler(context, TriggerEdgeCreationAction.KIND, EdgeCreationTool);
24
- configureDanglingFeedbackEdge(context);
25
- });
20
+ export const edgeCreationToolModule = new FeatureModule(
21
+ (bind, unbind, isBound, rebind) => {
22
+ const context = { bind, unbind, isBound, rebind };
23
+ bindAsService(context, TYPES.ITool, EdgeCreationTool);
24
+ configureActionHandler(context, TriggerEdgeCreationAction.KIND, EdgeCreationTool);
25
+ configureDanglingFeedbackEdge(context);
26
+ },
27
+ { featureId: Symbol('edgeCreationTool') }
28
+ );
@@ -23,16 +23,19 @@ import {
23
23
  SwitchRoutingModeCommand
24
24
  } from './edge-edit-tool-feedback';
25
25
 
26
- export const edgeEditToolModule = new FeatureModule((bind, unbind, isBound, rebind) => {
27
- const context = { bind, unbind, isBound, rebind };
28
- bindAsService(context, TYPES.IDefaultTool, EdgeEditTool);
26
+ export const edgeEditToolModule = new FeatureModule(
27
+ (bind, unbind, isBound, rebind) => {
28
+ const context = { bind, unbind, isBound, rebind };
29
+ bindAsService(context, TYPES.IDefaultTool, EdgeEditTool);
29
30
 
30
- // reconnect edge tool feedback
31
- configureCommand(context, ShowEdgeReconnectHandlesFeedbackCommand);
32
- configureCommand(context, HideEdgeReconnectHandlesFeedbackCommand);
33
- configureCommand(context, DrawFeedbackEdgeSourceCommand);
34
- configureCommand(context, SwitchRoutingModeCommand);
31
+ // reconnect edge tool feedback
32
+ configureCommand(context, ShowEdgeReconnectHandlesFeedbackCommand);
33
+ configureCommand(context, HideEdgeReconnectHandlesFeedbackCommand);
34
+ configureCommand(context, DrawFeedbackEdgeSourceCommand);
35
+ configureCommand(context, SwitchRoutingModeCommand);
35
36
 
36
- // dangling edge feedback
37
- configureDanglingFeedbackEdge(context);
38
- });
37
+ // dangling edge feedback
38
+ configureDanglingFeedbackEdge(context);
39
+ },
40
+ { featureId: Symbol('edgeEditTool') }
41
+ );
@@ -20,13 +20,16 @@ import { DrawMarqueeCommand, MARQUEE, RemoveMarqueeCommand } from './marquee-too
20
20
  import { MarqueeNode } from './model';
21
21
  import { MarqueeView } from './view';
22
22
 
23
- export const marqueeSelectionToolModule = new FeatureModule((bind, unbind, isBound, rebind) => {
24
- const context = { bind, unbind, isBound, rebind };
25
- bindAsService(context, TYPES.IDefaultTool, MarqueeTool);
26
- bindAsService(context, TYPES.ITool, MarqueeMouseTool);
23
+ export const marqueeSelectionToolModule = new FeatureModule(
24
+ (bind, unbind, isBound, rebind) => {
25
+ const context = { bind, unbind, isBound, rebind };
26
+ bindAsService(context, TYPES.IDefaultTool, MarqueeTool);
27
+ bindAsService(context, TYPES.ITool, MarqueeMouseTool);
27
28
 
28
- configureCommand(context, DrawMarqueeCommand);
29
- configureCommand(context, RemoveMarqueeCommand);
29
+ configureCommand(context, DrawMarqueeCommand);
30
+ configureCommand(context, RemoveMarqueeCommand);
30
31
 
31
- configureModelElement(context, MARQUEE, MarqueeNode, MarqueeView);
32
- });
32
+ configureModelElement(context, MARQUEE, MarqueeNode, MarqueeView);
33
+ },
34
+ { featureId: Symbol('marqueeSelectionTool') }
35
+ );
@@ -35,5 +35,8 @@ export const nodeCreationToolModule = new FeatureModule(
35
35
  configureActionHandler(context, TriggerNodeCreationAction.KIND, NodeCreationTool);
36
36
  configureModelElement(context, InsertIndicator.TYPE, InsertIndicator, InsertIndicatorView);
37
37
  },
38
- { requires: elementTemplateModule }
38
+ {
39
+ featureId: Symbol('nodeCreationTool'),
40
+ requires: elementTemplateModule
41
+ }
39
42
  );
@@ -13,8 +13,8 @@
13
13
  *
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
- import { injectable } from 'inversify';
17
16
  import { Action, FeatureModule, IActionHandler, ICommand, configureActionHandler } from '@eclipse-glsp/sprotty';
17
+ import { injectable } from 'inversify';
18
18
  import { FocusStateChangedAction } from '../../base/focus/focus-state-change-action';
19
19
  import { EnableDefaultToolsAction } from '../../base/tool-manager/tool';
20
20
 
@@ -34,6 +34,9 @@ export class EnableDefaultToolsOnFocusLossHandler implements IActionHandler {
34
34
  /**
35
35
  * Enables the default tools in the tool manager if the diagram looses focus.
36
36
  */
37
- export const toolFocusLossModule = new FeatureModule((bind, _unbind, isBound) => {
38
- configureActionHandler({ bind, isBound }, FocusStateChangedAction.KIND, EnableDefaultToolsOnFocusLossHandler);
39
- });
37
+ export const toolFocusLossModule = new FeatureModule(
38
+ (bind, _unbind, isBound) => {
39
+ configureActionHandler({ bind, isBound }, FocusStateChangedAction.KIND, EnableDefaultToolsOnFocusLossHandler);
40
+ },
41
+ { featureId: Symbol('toolFocusLoss ') }
42
+ );
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2023 EclipseSource and others.
2
+ * Copyright (c) 2023-2024 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 { ContainerModule } from 'inversify';
18
- import { bindAsService, TYPES } from '@eclipse-glsp/sprotty';
17
+ import { bindAsService, FeatureModule, TYPES } from '@eclipse-glsp/sprotty';
19
18
  import { GLSPUndoRedoKeyListener } from './undo-redo-key-listener';
20
19
 
21
20
  /**
@@ -23,6 +22,9 @@ import { GLSPUndoRedoKeyListener } from './undo-redo-key-listener';
23
22
  * When integrated into an application frame (e.g Theia/VS Code) this module is typically omitted and/or replaced
24
23
  * with an application native module.
25
24
  */
26
- export const undoRedoModule = new ContainerModule((bind, unbind, isBound, rebind) => {
27
- bindAsService(bind, TYPES.KeyListener, GLSPUndoRedoKeyListener);
28
- });
25
+ export const undoRedoModule = new FeatureModule(
26
+ (bind, unbind, isBound, rebind) => {
27
+ bindAsService(bind, TYPES.KeyListener, GLSPUndoRedoKeyListener);
28
+ },
29
+ { featureId: Symbol('undoRedo') }
30
+ );
@@ -25,19 +25,25 @@ import {
25
25
  } from './marker-navigator';
26
26
  import { ApplyMarkersCommand, DeleteMarkersCommand, SetMarkersActionHandler, ValidationFeedbackEmitter } from './validate';
27
27
 
28
- export const validationModule = new FeatureModule((bind, _unbind, isBound) => {
29
- const context = { bind, isBound };
30
- configureActionHandler(context, SetMarkersAction.KIND, SetMarkersActionHandler);
31
- configureCommand(context, ApplyMarkersCommand);
32
- configureCommand(context, DeleteMarkersCommand);
33
- bind(ValidationFeedbackEmitter).toSelf().inSingletonScope();
34
- });
28
+ export const validationModule = new FeatureModule(
29
+ (bind, _unbind, isBound) => {
30
+ const context = { bind, isBound };
31
+ configureActionHandler(context, SetMarkersAction.KIND, SetMarkersActionHandler);
32
+ configureCommand(context, ApplyMarkersCommand);
33
+ configureCommand(context, DeleteMarkersCommand);
34
+ bind(ValidationFeedbackEmitter).toSelf().inSingletonScope();
35
+ },
36
+ { featureId: Symbol('validation') }
37
+ );
35
38
 
36
- export const markerNavigatorModule = new FeatureModule((bind, _unbind, isBound) => {
37
- bind(GModelElementComparator).to(LeftToRightTopToBottomComparator).inSingletonScope();
38
- bind(MarkerNavigator).toSelf().inSingletonScope();
39
- configureActionHandler({ bind, isBound }, NavigateToMarkerAction.KIND, NavigateToMarkerActionHandler);
40
- });
39
+ export const markerNavigatorModule = new FeatureModule(
40
+ (bind, _unbind, isBound) => {
41
+ bind(GModelElementComparator).to(LeftToRightTopToBottomComparator).inSingletonScope();
42
+ bind(MarkerNavigator).toSelf().inSingletonScope();
43
+ configureActionHandler({ bind, isBound }, NavigateToMarkerAction.KIND, NavigateToMarkerActionHandler);
44
+ },
45
+ { featureId: Symbol('markerNavigator') }
46
+ );
41
47
 
42
48
  /**
43
49
  * Feature module that is intended for the standalone deployment of GLSP (i.e. plain webapp)
@@ -49,5 +55,5 @@ export const standaloneMarkerNavigatorModule = new FeatureModule(
49
55
  bindAsService(bind, TYPES.IContextMenuProvider, MarkerNavigatorContextMenuItemProvider);
50
56
  bindAsService(bind, TYPES.KeyListener, MarkerNavigatorKeyListener);
51
57
  },
52
- { requires: markerNavigatorModule }
58
+ { featureId: Symbol('standaloneMarkerNavigator'), requires: markerNavigatorModule }
53
59
  );
@@ -33,25 +33,28 @@ import { OriginViewportCommand } from './origin-viewport';
33
33
  import { RepositionCommand } from './reposition';
34
34
  import { RestoreViewportHandler } from './viewport-handler';
35
35
 
36
- export const viewportModule = new FeatureModule((bind, _unbind, isBound) => {
37
- const context = { bind, isBound };
38
- configureCommand(context, CenterCommand);
39
- configureCommand(context, FitToScreenCommand);
40
- configureCommand(context, GetViewportCommand);
41
- configureCommand(context, SetViewportCommand);
42
- configureCommand(context, RepositionCommand);
43
- configureCommand(context, OriginViewportCommand);
36
+ export const viewportModule = new FeatureModule(
37
+ (bind, _unbind, isBound) => {
38
+ const context = { bind, isBound };
39
+ configureCommand(context, CenterCommand);
40
+ configureCommand(context, FitToScreenCommand);
41
+ configureCommand(context, GetViewportCommand);
42
+ configureCommand(context, SetViewportCommand);
43
+ configureCommand(context, RepositionCommand);
44
+ configureCommand(context, OriginViewportCommand);
44
45
 
45
- bindAsService(context, TYPES.MouseListener, ZoomMouseListener);
46
- bindAsService(context, TYPES.MouseListener, GLSPScrollMouseListener);
46
+ bindAsService(context, TYPES.MouseListener, ZoomMouseListener);
47
+ bindAsService(context, TYPES.MouseListener, GLSPScrollMouseListener);
47
48
 
48
- configureActionHandler(context, EnableToolsAction.KIND, GLSPScrollMouseListener);
49
- configureActionHandler(context, EnableDefaultToolsAction.KIND, GLSPScrollMouseListener);
49
+ configureActionHandler(context, EnableToolsAction.KIND, GLSPScrollMouseListener);
50
+ configureActionHandler(context, EnableDefaultToolsAction.KIND, GLSPScrollMouseListener);
50
51
 
51
- bindAsService(context, TYPES.IDiagramStartup, RestoreViewportHandler);
52
- configureActionHandler(context, EnableDefaultToolsAction.KIND, RestoreViewportHandler);
53
- configureActionHandler(context, FocusDomAction.KIND, RestoreViewportHandler);
54
- });
52
+ bindAsService(context, TYPES.IDiagramStartup, RestoreViewportHandler);
53
+ configureActionHandler(context, EnableDefaultToolsAction.KIND, RestoreViewportHandler);
54
+ configureActionHandler(context, FocusDomAction.KIND, RestoreViewportHandler);
55
+ },
56
+ { featureId: Symbol('viewport') }
57
+ );
55
58
 
56
59
  /**
57
60
  * Feature module that is intended for the standalone deployment of GLSP (i.e. plain webapp)
@@ -63,5 +66,5 @@ export const standaloneViewportModule = new FeatureModule(
63
66
  const context = { bind, isBound };
64
67
  bindAsService(context, TYPES.KeyListener, CenterKeyboardListener);
65
68
  },
66
- { requires: viewportModule }
69
+ { featureId: Symbol('standaloneViewport'), requires: viewportModule }
67
70
  );
package/src/index.ts CHANGED
@@ -67,7 +67,7 @@ export * from './features/accessibility/focus-tracker/focus-tracker-tool';
67
67
  export * from './features/accessibility/global-keylistener-tool';
68
68
  export * from './features/accessibility/key-shortcut/accessible-key-shortcut';
69
69
  export * from './features/accessibility/key-shortcut/accessible-key-shortcut-tool';
70
- export * from './features/accessibility/key-shortcut/di.config';
70
+ export * from './features/accessibility/key-shortcut/shortcut-help-module';
71
71
  export * from './features/accessibility/keyboard-grid/action';
72
72
  export * from './features/accessibility/keyboard-grid/constants';
73
73
  export * from './features/accessibility/keyboard-grid/keyboard-grid';
@@ -42,15 +42,18 @@ import { undoRedoModule } from './features/undo-redo/undo-redo-module';
42
42
  import { standaloneMarkerNavigatorModule } from './features/validation/validation-modules';
43
43
  import { standaloneViewportModule } from './features/viewport/viewport-modules';
44
44
 
45
- export const standaloneDefaultModule = new FeatureModule((bind, unbind, isBound, rebind) => {
46
- const context = { bind, unbind, isBound, rebind };
47
- bind(FallbackActionHandler).toSelf().inSingletonScope();
48
- configureActionHandler(context, MessageAction.KIND, FallbackActionHandler);
49
- configureActionHandler(context, StartProgressAction.KIND, FallbackActionHandler);
50
- configureActionHandler(context, UpdateProgressAction.KIND, FallbackActionHandler);
51
- configureActionHandler(context, EndProgressAction.KIND, FallbackActionHandler);
52
- bindAsService(context, TYPES.KeyListener, LayoutKeyListener);
53
- });
45
+ export const standaloneDefaultModule = new FeatureModule(
46
+ (bind, unbind, isBound, rebind) => {
47
+ const context = { bind, unbind, isBound, rebind };
48
+ bind(FallbackActionHandler).toSelf().inSingletonScope();
49
+ configureActionHandler(context, MessageAction.KIND, FallbackActionHandler);
50
+ configureActionHandler(context, StartProgressAction.KIND, FallbackActionHandler);
51
+ configureActionHandler(context, UpdateProgressAction.KIND, FallbackActionHandler);
52
+ configureActionHandler(context, EndProgressAction.KIND, FallbackActionHandler);
53
+ bindAsService(context, TYPES.KeyListener, LayoutKeyListener);
54
+ },
55
+ { featureId: Symbol('standaloneDefault') }
56
+ );
54
57
 
55
58
  /**
56
59
  * A fallback action handler for actions sent by features that are currently not supported by
@@ -53,10 +53,13 @@ import { GGraphView } from './ggraph-view';
53
53
  import { GIssueMarkerView } from './issue-marker-view';
54
54
  import { RoundedCornerNodeView } from './rounded-corner-view';
55
55
 
56
- export const baseViewModule = new FeatureModule((bind, unbind, isBound, rebind) => {
57
- const context = { bind, unbind, isBound, rebind };
58
- configureDefaultModelElements(context);
59
- });
56
+ export const baseViewModule = new FeatureModule(
57
+ (bind, unbind, isBound, rebind) => {
58
+ const context = { bind, unbind, isBound, rebind };
59
+ configureDefaultModelElements(context);
60
+ },
61
+ { featureId: Symbol('baseView') }
62
+ );
60
63
 
61
64
  export function configureDefaultModelElements(context: Pick<BindingContext, 'bind' | 'isBound'>): void {
62
65
  // HTML elements
@@ -1 +0,0 @@
1
- {"version":3,"file":"di.config.d.ts","sourceRoot":"","sources":["../../../../src/features/accessibility/key-shortcut/di.config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAiB,cAAc,EAAiC,MAAM,uBAAuB,CAAC;AACrG,OAAO,kCAAkC,CAAC;AAI1C;;GAEG;AACH,eAAO,MAAM,sBAAsB,iBAGjC,CAAC;AAEH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI,CAIvE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"di.config.js","sourceRoot":"","sources":["../../../../src/features/accessibility/key-shortcut/di.config.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAElF,yCAA4C;AAC5C,mDAAqG;AACrG,4CAA0C;AAC1C,uEAAmG;AACnG,iFAA2E;AAE3E;;GAEG;AACU,QAAA,sBAAsB,GAAG,IAAI,2BAAe,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE;IACxF,MAAM,OAAO,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAClD,yBAAyB,CAAC,OAAO,CAAC,CAAC;AACvC,CAAC,CAAC,CAAC;AAEH,SAAgB,yBAAyB,CAAC,OAAuB;IAC7D,IAAA,uBAAa,EAAC,OAAO,EAAE,eAAK,CAAC,YAAY,EAAE,wDAAyB,CAAC,CAAC;IACtE,IAAA,uBAAa,EAAC,OAAO,EAAE,eAAK,CAAC,YAAY,EAAE,gDAAsB,CAAC,CAAC;IACnE,IAAA,gCAAsB,EAAC,OAAO,EAAE,wDAA8B,CAAC,IAAI,EAAE,gDAAsB,CAAC,CAAC;AACjG,CAAC;AAJD,8DAIC"}