@eclipse-glsp/client 2.4.0-next.409 → 2.4.0-next.413

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 (207) hide show
  1. package/lib/base/default.module.d.ts.map +1 -1
  2. package/lib/base/default.module.js +3 -0
  3. package/lib/base/default.module.js.map +1 -1
  4. package/lib/{features/accessibility/key-shortcut/accessible-key-shortcut.d.ts → base/shortcuts/available-shortcuts-extension.d.ts} +7 -29
  5. package/lib/base/shortcuts/available-shortcuts-extension.d.ts.map +1 -0
  6. package/lib/{features/accessibility/key-shortcut/accessible-key-shortcut.js → base/shortcuts/available-shortcuts-extension.js} +20 -36
  7. package/lib/base/shortcuts/available-shortcuts-extension.js.map +1 -0
  8. package/lib/{features/accessibility/key-shortcut/accessible-key-shortcut-tool.d.ts → base/shortcuts/available-shortcuts-tool.d.ts} +4 -6
  9. package/lib/base/shortcuts/available-shortcuts-tool.d.ts.map +1 -0
  10. package/lib/{features/accessibility/key-shortcut/accessible-key-shortcut-tool.js → base/shortcuts/available-shortcuts-tool.js} +14 -24
  11. package/lib/base/shortcuts/available-shortcuts-tool.js.map +1 -0
  12. package/lib/base/shortcuts/shortcuts-manager.d.ts +39 -0
  13. package/lib/base/shortcuts/shortcuts-manager.d.ts.map +1 -0
  14. package/lib/base/shortcuts/shortcuts-manager.js +55 -0
  15. package/lib/base/shortcuts/shortcuts-manager.js.map +1 -0
  16. package/lib/{features/accessibility/move-zoom/move-zoom-module.d.ts → base/shortcuts/shortcuts-module.d.ts} +7 -5
  17. package/lib/base/shortcuts/shortcuts-module.d.ts.map +1 -0
  18. package/lib/{features/accessibility/resize-key-tool/resize-key-module.js → base/shortcuts/shortcuts-module.js} +12 -14
  19. package/lib/base/shortcuts/shortcuts-module.js.map +1 -0
  20. package/lib/base/ui-extension/ui-extension.d.ts +3 -1
  21. package/lib/base/ui-extension/ui-extension.d.ts.map +1 -1
  22. package/lib/base/ui-extension/ui-extension.js +8 -0
  23. package/lib/base/ui-extension/ui-extension.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 +3 -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 +0 -6
  30. package/lib/features/accessibility/accessibility-module.js.map +1 -1
  31. package/lib/features/accessibility/element-navigation/diagram-navigation-tool.d.ts +8 -10
  32. package/lib/features/accessibility/element-navigation/diagram-navigation-tool.d.ts.map +1 -1
  33. package/lib/features/accessibility/element-navigation/diagram-navigation-tool.js +20 -44
  34. package/lib/features/accessibility/element-navigation/diagram-navigation-tool.js.map +1 -1
  35. package/lib/features/accessibility/global-keylistener-tool.d.ts +6 -8
  36. package/lib/features/accessibility/global-keylistener-tool.d.ts.map +1 -1
  37. package/lib/features/accessibility/global-keylistener-tool.js +10 -25
  38. package/lib/features/accessibility/global-keylistener-tool.js.map +1 -1
  39. package/lib/features/accessibility/search/search-tool.d.ts +7 -10
  40. package/lib/features/accessibility/search/search-tool.d.ts.map +1 -1
  41. package/lib/features/accessibility/search/search-tool.js +9 -20
  42. package/lib/features/accessibility/search/search-tool.js.map +1 -1
  43. package/lib/features/accessibility/view-key-tools/{zoom-key-tool.d.ts → grid-cell-zoom-key-tool.d.ts} +13 -21
  44. package/lib/features/accessibility/view-key-tools/grid-cell-zoom-key-tool.d.ts.map +1 -0
  45. package/lib/features/accessibility/view-key-tools/{zoom-key-tool.js → grid-cell-zoom-key-tool.js} +31 -82
  46. package/lib/features/accessibility/view-key-tools/grid-cell-zoom-key-tool.js.map +1 -0
  47. package/lib/features/accessibility/view-key-tools/view-key-tools-module.d.ts.map +1 -1
  48. package/lib/features/accessibility/view-key-tools/view-key-tools-module.js +7 -7
  49. package/lib/features/accessibility/view-key-tools/view-key-tools-module.js.map +1 -1
  50. package/lib/features/bounds/bounds-module.d.ts.map +1 -1
  51. package/lib/features/bounds/bounds-module.js +4 -0
  52. package/lib/features/bounds/bounds-module.js.map +1 -1
  53. package/lib/features/change-bounds/move-element-action.d.ts +52 -0
  54. package/lib/features/change-bounds/move-element-action.d.ts.map +1 -0
  55. package/lib/features/change-bounds/move-element-action.js +32 -0
  56. package/lib/features/change-bounds/move-element-action.js.map +1 -0
  57. package/lib/features/change-bounds/move-element-handler.d.ts +42 -0
  58. package/lib/features/change-bounds/move-element-handler.d.ts.map +1 -0
  59. package/lib/features/{accessibility/move-zoom/move-handler.js → change-bounds/move-element-handler.js} +12 -72
  60. package/lib/features/change-bounds/move-element-handler.js.map +1 -0
  61. package/lib/features/change-bounds/move-element-key-listener.d.ts +31 -0
  62. package/lib/features/change-bounds/move-element-key-listener.d.ts.map +1 -0
  63. package/lib/features/change-bounds/move-element-key-listener.js +71 -0
  64. package/lib/features/change-bounds/move-element-key-listener.js.map +1 -0
  65. package/lib/features/change-bounds/resize/resize-default-tool.d.ts +34 -0
  66. package/lib/features/change-bounds/resize/resize-default-tool.d.ts.map +1 -0
  67. package/lib/features/change-bounds/resize/resize-default-tool.js +89 -0
  68. package/lib/features/change-bounds/resize/resize-default-tool.js.map +1 -0
  69. package/lib/features/{accessibility/resize-key-tool/resize-key-handler.d.ts → change-bounds/resize/resize-handler.d.ts} +3 -7
  70. package/lib/features/change-bounds/resize/resize-handler.d.ts.map +1 -0
  71. package/lib/features/{accessibility/resize-key-tool/resize-key-handler.js → change-bounds/resize/resize-handler.js} +16 -24
  72. package/lib/features/change-bounds/resize/resize-handler.js.map +1 -0
  73. package/lib/features/{accessibility/resize-key-tool/resize-key-module.d.ts → change-bounds/resize/resize-module.d.ts} +9 -4
  74. package/lib/features/change-bounds/resize/resize-module.d.ts.map +1 -0
  75. package/lib/features/change-bounds/resize/resize-module.js +42 -0
  76. package/lib/features/change-bounds/resize/resize-module.js.map +1 -0
  77. package/lib/features/change-bounds/resize/resize-tool.d.ts +37 -0
  78. package/lib/features/change-bounds/resize/resize-tool.d.ts.map +1 -0
  79. package/lib/features/change-bounds/resize/resize-tool.js +123 -0
  80. package/lib/features/change-bounds/resize/resize-tool.js.map +1 -0
  81. package/lib/features/grid/grid-manager.js +1 -0
  82. package/lib/features/grid/grid-manager.js.map +1 -1
  83. package/lib/features/grid/grid-module.d.ts.map +1 -1
  84. package/lib/features/grid/grid-module.js +2 -1
  85. package/lib/features/grid/grid-module.js.map +1 -1
  86. package/lib/features/grid/grid-snapper.d.ts.map +1 -1
  87. package/lib/features/grid/grid-snapper.js +3 -2
  88. package/lib/features/grid/grid-snapper.js.map +1 -1
  89. package/lib/features/grid/grid.d.ts +3 -0
  90. package/lib/features/grid/grid.d.ts.map +1 -1
  91. package/lib/features/grid/grid.js +5 -0
  92. package/lib/features/grid/grid.js.map +1 -1
  93. package/lib/features/helper-lines/helper-line-manager.js +1 -0
  94. package/lib/features/helper-lines/helper-line-manager.js.map +1 -1
  95. package/lib/features/tools/base-tools.d.ts +8 -3
  96. package/lib/features/tools/base-tools.d.ts.map +1 -1
  97. package/lib/features/tools/base-tools.js +21 -12
  98. package/lib/features/tools/base-tools.js.map +1 -1
  99. package/lib/features/tools/change-bounds/change-bounds-tool.d.ts +8 -2
  100. package/lib/features/tools/change-bounds/change-bounds-tool.d.ts.map +1 -1
  101. package/lib/features/tools/change-bounds/change-bounds-tool.js +23 -0
  102. package/lib/features/tools/change-bounds/change-bounds-tool.js.map +1 -1
  103. package/lib/features/tools/edge-creation/edge-creation-tool.js +1 -0
  104. package/lib/features/tools/edge-creation/edge-creation-tool.js.map +1 -1
  105. package/lib/features/tools/node-creation/node-creation-views.js +1 -0
  106. package/lib/features/tools/node-creation/node-creation-views.js.map +1 -1
  107. package/lib/features/viewport/viewport-handler.d.ts +20 -1
  108. package/lib/features/viewport/viewport-handler.d.ts.map +1 -1
  109. package/lib/features/viewport/viewport-handler.js +100 -1
  110. package/lib/features/viewport/viewport-handler.js.map +1 -1
  111. package/lib/features/viewport/viewport-key-listener.d.ts +36 -0
  112. package/lib/features/viewport/viewport-key-listener.d.ts.map +1 -0
  113. package/lib/features/viewport/viewport-key-listener.js +144 -0
  114. package/lib/features/viewport/viewport-key-listener.js.map +1 -0
  115. package/lib/features/viewport/viewport-modules.d.ts.map +1 -1
  116. package/lib/features/viewport/viewport-modules.js +11 -0
  117. package/lib/features/viewport/viewport-modules.js.map +1 -1
  118. package/lib/features/viewport/viewport-tool.d.ts +32 -0
  119. package/lib/features/viewport/viewport-tool.d.ts.map +1 -0
  120. package/lib/features/viewport/viewport-tool.js +67 -0
  121. package/lib/features/viewport/viewport-tool.js.map +1 -0
  122. package/lib/features/viewport/zoom-viewport-action.d.ts +50 -0
  123. package/lib/features/viewport/zoom-viewport-action.d.ts.map +1 -0
  124. package/lib/features/viewport/zoom-viewport-action.js +36 -0
  125. package/lib/features/viewport/zoom-viewport-action.js.map +1 -0
  126. package/lib/index.d.ts +13 -11
  127. package/lib/index.d.ts.map +1 -1
  128. package/lib/index.js +13 -11
  129. package/lib/index.js.map +1 -1
  130. package/lib/standalone-modules.d.ts +1 -1
  131. package/lib/standalone-modules.d.ts.map +1 -1
  132. package/lib/standalone-modules.js +4 -0
  133. package/lib/standalone-modules.js.map +1 -1
  134. package/lib/utils/viewpoint-util.js +2 -2
  135. package/lib/utils/viewpoint-util.js.map +1 -1
  136. package/package.json +3 -3
  137. package/src/base/default.module.ts +4 -0
  138. package/src/{features/accessibility/key-shortcut/accessible-key-shortcut.ts → base/shortcuts/available-shortcuts-extension.ts} +13 -46
  139. package/src/{features/accessibility/key-shortcut/accessible-key-shortcut-tool.ts → base/shortcuts/available-shortcuts-tool.ts} +9 -15
  140. package/src/base/shortcuts/shortcuts-manager.ts +64 -0
  141. package/src/{features/accessibility/resize-key-tool/resize-key-module.ts → base/shortcuts/shortcuts-module.ts} +12 -14
  142. package/src/base/ui-extension/ui-extension.ts +8 -1
  143. package/src/default-modules.ts +3 -1
  144. package/src/features/accessibility/accessibility-module.ts +0 -6
  145. package/src/features/accessibility/element-navigation/diagram-navigation-tool.ts +26 -50
  146. package/src/features/accessibility/global-keylistener-tool.ts +11 -28
  147. package/src/features/accessibility/search/search-tool.ts +15 -33
  148. package/src/features/accessibility/view-key-tools/{zoom-key-tool.ts → grid-cell-zoom-key-tool.ts} +27 -82
  149. package/src/features/accessibility/view-key-tools/view-key-tools-module.ts +7 -7
  150. package/src/features/bounds/bounds-module.ts +6 -0
  151. package/src/features/change-bounds/move-element-action.ts +55 -0
  152. package/src/features/{accessibility/move-zoom/move-handler.ts → change-bounds/move-element-handler.ts} +18 -113
  153. package/src/features/change-bounds/move-element-key-listener.ts +74 -0
  154. package/src/features/change-bounds/resize/resize-default-tool.ts +75 -0
  155. package/src/features/{accessibility/resize-key-tool/resize-key-handler.ts → change-bounds/resize/resize-handler.ts} +10 -19
  156. package/src/features/change-bounds/resize/resize-module.ts +48 -0
  157. package/src/features/change-bounds/resize/resize-tool.ts +114 -0
  158. package/src/features/grid/grid-module.ts +2 -1
  159. package/src/features/grid/grid-snapper.ts +2 -2
  160. package/src/features/grid/grid.ts +3 -0
  161. package/src/features/tools/base-tools.ts +12 -6
  162. package/src/features/tools/change-bounds/change-bounds-tool.ts +25 -1
  163. package/src/features/viewport/viewport-handler.ts +121 -1
  164. package/src/features/viewport/viewport-key-listener.ts +121 -0
  165. package/src/features/viewport/viewport-modules.ts +15 -1
  166. package/src/features/viewport/viewport-tool.ts +54 -0
  167. package/src/features/viewport/zoom-viewport-action.ts +54 -0
  168. package/src/index.ts +13 -11
  169. package/src/standalone-modules.ts +4 -0
  170. package/src/utils/viewpoint-util.ts +2 -2
  171. package/lib/features/accessibility/key-shortcut/accessible-key-shortcut-tool.d.ts.map +0 -1
  172. package/lib/features/accessibility/key-shortcut/accessible-key-shortcut-tool.js.map +0 -1
  173. package/lib/features/accessibility/key-shortcut/accessible-key-shortcut.d.ts.map +0 -1
  174. package/lib/features/accessibility/key-shortcut/accessible-key-shortcut.js.map +0 -1
  175. package/lib/features/accessibility/key-shortcut/shortcut-help-module.d.ts +0 -26
  176. package/lib/features/accessibility/key-shortcut/shortcut-help-module.d.ts.map +0 -1
  177. package/lib/features/accessibility/key-shortcut/shortcut-help-module.js +0 -37
  178. package/lib/features/accessibility/key-shortcut/shortcut-help-module.js.map +0 -1
  179. package/lib/features/accessibility/move-zoom/move-handler.d.ts +0 -97
  180. package/lib/features/accessibility/move-zoom/move-handler.d.ts.map +0 -1
  181. package/lib/features/accessibility/move-zoom/move-handler.js.map +0 -1
  182. package/lib/features/accessibility/move-zoom/move-zoom-module.d.ts.map +0 -1
  183. package/lib/features/accessibility/move-zoom/move-zoom-module.js +0 -40
  184. package/lib/features/accessibility/move-zoom/move-zoom-module.js.map +0 -1
  185. package/lib/features/accessibility/move-zoom/zoom-handler.d.ts +0 -73
  186. package/lib/features/accessibility/move-zoom/zoom-handler.d.ts.map +0 -1
  187. package/lib/features/accessibility/move-zoom/zoom-handler.js +0 -157
  188. package/lib/features/accessibility/move-zoom/zoom-handler.js.map +0 -1
  189. package/lib/features/accessibility/resize-key-tool/resize-key-handler.d.ts.map +0 -1
  190. package/lib/features/accessibility/resize-key-tool/resize-key-handler.js.map +0 -1
  191. package/lib/features/accessibility/resize-key-tool/resize-key-module.d.ts.map +0 -1
  192. package/lib/features/accessibility/resize-key-tool/resize-key-module.js.map +0 -1
  193. package/lib/features/accessibility/resize-key-tool/resize-key-tool.d.ts +0 -47
  194. package/lib/features/accessibility/resize-key-tool/resize-key-tool.d.ts.map +0 -1
  195. package/lib/features/accessibility/resize-key-tool/resize-key-tool.js +0 -154
  196. package/lib/features/accessibility/resize-key-tool/resize-key-tool.js.map +0 -1
  197. package/lib/features/accessibility/view-key-tools/movement-key-tool.d.ts +0 -53
  198. package/lib/features/accessibility/view-key-tools/movement-key-tool.d.ts.map +0 -1
  199. package/lib/features/accessibility/view-key-tools/movement-key-tool.js +0 -156
  200. package/lib/features/accessibility/view-key-tools/movement-key-tool.js.map +0 -1
  201. package/lib/features/accessibility/view-key-tools/zoom-key-tool.d.ts.map +0 -1
  202. package/lib/features/accessibility/view-key-tools/zoom-key-tool.js.map +0 -1
  203. package/src/features/accessibility/key-shortcut/shortcut-help-module.ts +0 -42
  204. package/src/features/accessibility/move-zoom/move-zoom-module.ts +0 -44
  205. package/src/features/accessibility/move-zoom/zoom-handler.ts +0 -182
  206. package/src/features/accessibility/resize-key-tool/resize-key-tool.ts +0 -139
  207. package/src/features/accessibility/view-key-tools/movement-key-tool.ts +0 -135
@@ -23,47 +23,43 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
23
23
  var __metadata = (this && this.__metadata) || function (k, v) {
24
24
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
25
25
  };
26
- var ZoomKeyTool_1;
26
+ var GridCellZoomTool_1;
27
27
  Object.defineProperty(exports, "__esModule", { value: true });
28
- exports.ZoomKeyListener = exports.ZoomKeyTool = void 0;
28
+ exports.GridZoomKeyListener = exports.GridCellZoomTool = void 0;
29
29
  const sprotty_1 = require("@eclipse-glsp/sprotty");
30
30
  const inversify_1 = require("inversify");
31
- const editor_context_service_1 = require("../../../base/editor-context-service");
32
31
  const selection_service_1 = require("../../../base/selection-service");
33
32
  const viewpoint_util_1 = require("../../../utils/viewpoint-util");
33
+ const base_tools_1 = require("../../tools/base-tools");
34
34
  const diagram_navigation_tool_1 = require("../element-navigation/diagram-navigation-tool");
35
- const accessible_key_shortcut_1 = require("../key-shortcut/accessible-key-shortcut");
36
35
  const action_1 = require("../keyboard-grid/action");
37
- const zoom_handler_1 = require("../move-zoom/zoom-handler");
38
36
  const messages = require("../toast/messages.json");
39
37
  const toast_handler_1 = require("../toast/toast-handler");
40
38
  /**
41
39
  * Zoom viewport and elements when its focused and arrow keys are hit.
42
40
  */
43
- let ZoomKeyTool = ZoomKeyTool_1 = class ZoomKeyTool {
41
+ let GridCellZoomTool = GridCellZoomTool_1 = class GridCellZoomTool extends base_tools_1.BaseTool {
44
42
  constructor() {
45
- this.isEditTool = false;
46
- this.zoomKeyListener = new ZoomKeyListener(this);
43
+ super(...arguments);
44
+ this.zoomKeyListener = new GridZoomKeyListener(this);
47
45
  }
48
46
  get id() {
49
- return ZoomKeyTool_1.ID;
47
+ return GridCellZoomTool_1.ID;
50
48
  }
51
49
  enable() {
52
- this.keytool.register(this.zoomKeyListener);
53
- this.zoomKeyListener.registerShortcutKey();
54
- }
55
- disable() {
56
- this.keytool.deregister(this.zoomKeyListener);
50
+ this.toDisposeOnDisable.push(this.keyTool.registerListener(this.zoomKeyListener), this.shortcutManager.register(GridCellZoomTool_1.TOKEN, [
51
+ { shortcuts: ['CTRL', '+'], description: 'Zoom in via Grid', group: 'Zoom', position: 0 }
52
+ ]));
57
53
  }
58
54
  handle(action) {
59
- if ((0, sprotty_1.isViewport)(this.editorContextService.modelRoot)) {
55
+ if ((0, sprotty_1.isViewport)(this.editorContext.modelRoot)) {
60
56
  let viewportAction = undefined;
61
- if (action_1.KeyboardGridCellSelectedAction.is(action) && action.options.originId === ZoomKeyTool_1.ID) {
62
- viewportAction = this.zoomKeyListener.setNewZoomFactor(this.editorContextService.modelRoot, ZoomKeyListener.defaultZoomInFactor, (0, viewpoint_util_1.getAbsolutePositionByPoint)(this.editorContextService.modelRoot, action.options.centerCellPosition));
57
+ if (action_1.KeyboardGridCellSelectedAction.is(action) && action.options.originId === GridCellZoomTool_1.ID) {
58
+ viewportAction = this.zoomKeyListener.setNewZoomFactor(this.editorContext.modelRoot, this.zoomFactors.in, (0, viewpoint_util_1.getAbsolutePositionByPoint)(this.editorContext.modelRoot, action.options.centerCellPosition));
63
59
  }
64
- else if (action_1.KeyboardGridKeyboardEventAction.is(action) && action.options.originId === ZoomKeyTool_1.ID) {
60
+ else if (action_1.KeyboardGridKeyboardEventAction.is(action) && action.options.originId === GridCellZoomTool_1.ID) {
65
61
  if ((0, sprotty_1.matchesKeystroke)(action.options.event, 'Minus')) {
66
- viewportAction = this.zoomKeyListener.setNewZoomFactor(this.editorContextService.modelRoot, ZoomKeyListener.defaultZoomOutFactor);
62
+ viewportAction = this.zoomKeyListener.setNewZoomFactor(this.editorContext.modelRoot, this.zoomFactors.out);
67
63
  }
68
64
  else if ((0, sprotty_1.matchesKeystroke)(action.options.event, 'Digit0', 'ctrl')) {
69
65
  viewportAction = sprotty_1.CenterAction.create([]);
@@ -78,43 +74,28 @@ let ZoomKeyTool = ZoomKeyTool_1 = class ZoomKeyTool {
78
74
  }
79
75
  }
80
76
  };
81
- exports.ZoomKeyTool = ZoomKeyTool;
82
- ZoomKeyTool.ID = 'glsp.zoom-key-tool';
77
+ exports.GridCellZoomTool = GridCellZoomTool;
78
+ GridCellZoomTool.ID = 'glsp.accessibility-grid-cell-zoom-tool';
79
+ GridCellZoomTool.TOKEN = Symbol.for(GridCellZoomTool_1.name);
83
80
  __decorate([
84
- (0, inversify_1.inject)(sprotty_1.KeyTool),
85
- __metadata("design:type", sprotty_1.KeyTool)
86
- ], ZoomKeyTool.prototype, "keytool", void 0);
81
+ (0, inversify_1.inject)(sprotty_1.TYPES.IShortcutManager),
82
+ __metadata("design:type", Object)
83
+ ], GridCellZoomTool.prototype, "shortcutManager", void 0);
87
84
  __decorate([
88
- (0, inversify_1.inject)(sprotty_1.TYPES.IActionDispatcher),
85
+ (0, inversify_1.inject)(sprotty_1.TYPES.ZoomFactors),
89
86
  __metadata("design:type", Object)
90
- ], ZoomKeyTool.prototype, "actionDispatcher", void 0);
87
+ ], GridCellZoomTool.prototype, "zoomFactors", void 0);
91
88
  __decorate([
92
89
  (0, inversify_1.inject)(selection_service_1.SelectionService),
93
90
  __metadata("design:type", selection_service_1.SelectionService)
94
- ], ZoomKeyTool.prototype, "selectionService", void 0);
95
- __decorate([
96
- (0, inversify_1.inject)(editor_context_service_1.EditorContextService),
97
- __metadata("design:type", editor_context_service_1.EditorContextService)
98
- ], ZoomKeyTool.prototype, "editorContextService", void 0);
99
- exports.ZoomKeyTool = ZoomKeyTool = ZoomKeyTool_1 = __decorate([
91
+ ], GridCellZoomTool.prototype, "selectionService", void 0);
92
+ exports.GridCellZoomTool = GridCellZoomTool = GridCellZoomTool_1 = __decorate([
100
93
  (0, inversify_1.injectable)()
101
- ], ZoomKeyTool);
102
- class ZoomKeyListener extends sprotty_1.KeyListener {
94
+ ], GridCellZoomTool);
95
+ class GridZoomKeyListener extends sprotty_1.KeyListener {
103
96
  constructor(tool) {
104
97
  super();
105
98
  this.tool = tool;
106
- this.token = ZoomKeyListener.name;
107
- }
108
- registerShortcutKey() {
109
- this.tool.actionDispatcher.dispatchOnceModelInitialized(accessible_key_shortcut_1.SetAccessibleKeyShortcutAction.create({
110
- token: this.token,
111
- keys: [
112
- { shortcuts: ['+'], description: 'Zoom in to element or viewport', group: 'Zoom', position: 0 },
113
- { shortcuts: ['-'], description: 'Zoom out to element or viewport', group: 'Zoom', position: 1 },
114
- { shortcuts: ['CTRL', '0'], description: 'Reset zoom to default', group: 'Zoom', position: 2 },
115
- { shortcuts: ['CTRL', '+'], description: 'Zoom in via Grid', group: 'Zoom', position: 3 }
116
- ]
117
- }));
118
99
  }
119
100
  setNewZoomFactor(viewport, zoomFactor, point) {
120
101
  let newViewport;
@@ -134,14 +115,13 @@ class ZoomKeyListener extends sprotty_1.KeyListener {
134
115
  zoom: newZoom
135
116
  };
136
117
  }
137
- return sprotty_1.SetViewportAction.create(viewport.id, newViewport, { animate: true });
118
+ return sprotty_1.SetViewportAction.create(viewport.id, newViewport, { animate: false });
138
119
  }
139
120
  keyDown(element, event) {
140
- const selectedElementIds = this.tool.selectionService.getSelectedElementIDs();
141
121
  if (this.matchesZoomViaGrid(event)) {
142
122
  return [
143
123
  action_1.EnableKeyboardGridAction.create({
144
- originId: ZoomKeyTool.ID,
124
+ originId: GridCellZoomTool.ID,
145
125
  triggerActions: []
146
126
  }),
147
127
  toast_handler_1.ShowToastMessageAction.createWithTimeout({
@@ -150,42 +130,11 @@ class ZoomKeyListener extends sprotty_1.KeyListener {
150
130
  })
151
131
  ];
152
132
  }
153
- else if (this.matchesZoomOutKeystroke(event)) {
154
- if (selectedElementIds.length > 0) {
155
- return [zoom_handler_1.ZoomElementAction.create(selectedElementIds, ZoomKeyListener.defaultZoomOutFactor)];
156
- }
157
- else {
158
- return [zoom_handler_1.ZoomViewportAction.create(ZoomKeyListener.defaultZoomOutFactor)];
159
- }
160
- }
161
- else if (this.matchesZoomInKeystroke(event)) {
162
- if (selectedElementIds.length > 0) {
163
- return [zoom_handler_1.ZoomElementAction.create(selectedElementIds, ZoomKeyListener.defaultZoomInFactor)];
164
- }
165
- else {
166
- return [zoom_handler_1.ZoomViewportAction.create(ZoomKeyListener.defaultZoomInFactor)];
167
- }
168
- }
169
- else if (this.matchesMinZoomLevelKeystroke(event)) {
170
- return [sprotty_1.CenterAction.create(selectedElementIds)];
171
- }
172
133
  return [];
173
134
  }
174
- matchesZoomInKeystroke(event) {
175
- /** here event.key is used for '+', as keycode 187 is already declared for 'Equals' in {@link matchesKeystroke}.*/
176
- return event.key === '+' || (0, sprotty_1.matchesKeystroke)(event, 'NumpadAdd');
177
- }
178
135
  matchesZoomViaGrid(event) {
179
136
  return event.key === '+' && event.ctrlKey;
180
137
  }
181
- matchesMinZoomLevelKeystroke(event) {
182
- return (0, sprotty_1.matchesKeystroke)(event, 'Digit0', 'ctrl') || (0, sprotty_1.matchesKeystroke)(event, 'Numpad0', 'ctrl');
183
- }
184
- matchesZoomOutKeystroke(event) {
185
- return (0, sprotty_1.matchesKeystroke)(event, 'Minus') || (0, sprotty_1.matchesKeystroke)(event, 'NumpadSubtract');
186
- }
187
138
  }
188
- exports.ZoomKeyListener = ZoomKeyListener;
189
- ZoomKeyListener.defaultZoomInFactor = 1.1;
190
- ZoomKeyListener.defaultZoomOutFactor = 0.9;
191
- //# sourceMappingURL=zoom-key-tool.js.map
139
+ exports.GridZoomKeyListener = GridZoomKeyListener;
140
+ //# sourceMappingURL=grid-cell-zoom-key-tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grid-cell-zoom-key-tool.js","sourceRoot":"","sources":["../../../../src/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AE,EAAE,MAAM,CAAC,GAAG,CAAC,qDAA2B,CAAC,IAAI,CAAC;oBAChD,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,YAAY;iBACtC,CAAC;aACL,CAAC;QACN,CAAC;QACD,OAAO,EAAE,CAAC;IACd,CAAC;IAES,kBAAkB,CAAC,KAAoB;QAC7C,OAAO,KAAK,CAAC,GAAG,KAAK,GAAG,IAAI,KAAK,CAAC,OAAO,CAAC;IAC9C,CAAC;CACJ;AA9CD,kDA8CC"}
@@ -1 +1 @@
1
- {"version":3,"file":"view-key-tools-module.d.ts","sourceRoot":"","sources":["../../../../src/features/accessibility/view-key-tools/view-key-tools-module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAiB,cAAc,EAA0B,aAAa,EAAS,MAAM,uBAAuB,CAAC;AAMpH,eAAO,MAAM,kBAAkB,eAQ9B,CAAC;AAEF,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,IAAI,CAAC,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC,GAAG,IAAI,CAM7F"}
1
+ {"version":3,"file":"view-key-tools-module.d.ts","sourceRoot":"","sources":["../../../../src/features/accessibility/view-key-tools/view-key-tools-module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAiB,cAAc,EAA0B,aAAa,EAAS,MAAM,uBAAuB,CAAC;AAMpH,eAAO,MAAM,kBAAkB,eAS9B,CAAC;AAEF,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,IAAI,CAAC,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC,GAAG,IAAI,CAK7F"}
@@ -17,21 +17,21 @@
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.configureViewKeyTools = exports.viewKeyToolsModule = void 0;
19
19
  const sprotty_1 = require("@eclipse-glsp/sprotty");
20
+ const viewport_modules_1 = require("../../viewport/viewport-modules");
20
21
  const action_1 = require("../keyboard-grid/action");
21
22
  const deselect_key_tool_1 = require("./deselect-key-tool");
22
- const movement_key_tool_1 = require("./movement-key-tool");
23
- const zoom_key_tool_1 = require("./zoom-key-tool");
23
+ const grid_cell_zoom_key_tool_1 = require("./grid-cell-zoom-key-tool");
24
24
  exports.viewKeyToolsModule = new sprotty_1.FeatureModule((bind, _unbind, isBound, rebind) => {
25
25
  const context = { bind, isBound, rebind };
26
26
  configureViewKeyTools(context);
27
27
  }, {
28
- featureId: Symbol('viewKeyTools')
28
+ featureId: Symbol('viewKeyTools'),
29
+ requires: viewport_modules_1.viewportModule
29
30
  });
30
31
  function configureViewKeyTools(context) {
31
- (0, sprotty_1.bindAsService)(context, sprotty_1.TYPES.IDefaultTool, movement_key_tool_1.MovementKeyTool);
32
- (0, sprotty_1.bindAsService)(context, sprotty_1.TYPES.IDefaultTool, zoom_key_tool_1.ZoomKeyTool);
33
- (0, sprotty_1.configureActionHandler)(context, action_1.KeyboardGridCellSelectedAction.KIND, zoom_key_tool_1.ZoomKeyTool);
34
- (0, sprotty_1.configureActionHandler)(context, action_1.KeyboardGridKeyboardEventAction.KIND, zoom_key_tool_1.ZoomKeyTool);
32
+ (0, sprotty_1.bindAsService)(context, sprotty_1.TYPES.IDefaultTool, grid_cell_zoom_key_tool_1.GridCellZoomTool);
33
+ (0, sprotty_1.configureActionHandler)(context, action_1.KeyboardGridCellSelectedAction.KIND, grid_cell_zoom_key_tool_1.GridCellZoomTool);
34
+ (0, sprotty_1.configureActionHandler)(context, action_1.KeyboardGridKeyboardEventAction.KIND, grid_cell_zoom_key_tool_1.GridCellZoomTool);
35
35
  (0, sprotty_1.bindAsService)(context, sprotty_1.TYPES.IDefaultTool, deselect_key_tool_1.DeselectKeyTool);
36
36
  }
37
37
  exports.configureViewKeyTools = configureViewKeyTools;
@@ -1 +1 @@
1
- {"version":3,"file":"view-key-tools-module.js","sourceRoot":"","sources":["../../../../src/features/accessibility/view-key-tools/view-key-tools-module.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAElF,mDAAoH;AACpH,oDAA0G;AAC1G,2DAAsD;AACtD,2DAAsD;AACtD,mDAA8C;AAEjC,QAAA,kBAAkB,GAAG,IAAI,uBAAa,CAC/C,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE;IAC/B,MAAM,OAAO,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAC1C,qBAAqB,CAAC,OAAO,CAAC,CAAC;AACnC,CAAC,EACD;IACI,SAAS,EAAE,MAAM,CAAC,cAAc,CAAC;CACpC,CACJ,CAAC;AAEF,SAAgB,qBAAqB,CAAC,OAAiD;IACnF,IAAA,uBAAa,EAAC,OAAO,EAAE,eAAK,CAAC,YAAY,EAAE,mCAAe,CAAC,CAAC;IAC5D,IAAA,uBAAa,EAAC,OAAO,EAAE,eAAK,CAAC,YAAY,EAAE,2BAAW,CAAC,CAAC;IACxD,IAAA,gCAAsB,EAAC,OAAO,EAAE,uCAA8B,CAAC,IAAI,EAAE,2BAAW,CAAC,CAAC;IAClF,IAAA,gCAAsB,EAAC,OAAO,EAAE,wCAA+B,CAAC,IAAI,EAAE,2BAAW,CAAC,CAAC;IACnF,IAAA,uBAAa,EAAC,OAAO,EAAE,eAAK,CAAC,YAAY,EAAE,mCAAe,CAAC,CAAC;AAChE,CAAC;AAND,sDAMC"}
1
+ {"version":3,"file":"view-key-tools-module.js","sourceRoot":"","sources":["../../../../src/features/accessibility/view-key-tools/view-key-tools-module.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAElF,mDAAoH;AACpH,sEAAiE;AACjE,oDAA0G;AAC1G,2DAAsD;AACtD,uEAA6D;AAEhD,QAAA,kBAAkB,GAAG,IAAI,uBAAa,CAC/C,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE;IAC/B,MAAM,OAAO,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAC1C,qBAAqB,CAAC,OAAO,CAAC,CAAC;AACnC,CAAC,EACD;IACI,SAAS,EAAE,MAAM,CAAC,cAAc,CAAC;IACjC,QAAQ,EAAE,iCAAc;CAC3B,CACJ,CAAC;AAEF,SAAgB,qBAAqB,CAAC,OAAiD;IACnF,IAAA,uBAAa,EAAC,OAAO,EAAE,eAAK,CAAC,YAAY,EAAE,0CAAgB,CAAC,CAAC;IAC7D,IAAA,gCAAsB,EAAC,OAAO,EAAE,uCAA8B,CAAC,IAAI,EAAE,0CAAgB,CAAC,CAAC;IACvF,IAAA,gCAAsB,EAAC,OAAO,EAAE,wCAA+B,CAAC,IAAI,EAAE,0CAAgB,CAAC,CAAC;IACxF,IAAA,uBAAa,EAAC,OAAO,EAAE,eAAK,CAAC,YAAY,EAAE,mCAAe,CAAC,CAAC;AAChE,CAAC;AALD,sDAKC"}
@@ -1 +1 @@
1
- {"version":3,"file":"bounds-module.d.ts","sourceRoot":"","sources":["../../../src/features/bounds/bounds-module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EACH,aAAa,EAWhB,MAAM,uBAAuB,CAAC;AAU/B,eAAO,MAAM,YAAY,eAuBxB,CAAC"}
1
+ {"version":3,"file":"bounds-module.d.ts","sourceRoot":"","sources":["../../../src/features/bounds/bounds-module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EACH,aAAa,EAYhB,MAAM,uBAAuB,CAAC;AAY/B,eAAO,MAAM,YAAY,eA0BxB,CAAC"}
@@ -17,6 +17,8 @@ exports.boundsModule = void 0;
17
17
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
18
18
  ********************************************************************************/
19
19
  const sprotty_1 = require("@eclipse-glsp/sprotty");
20
+ const move_element_action_1 = require("../change-bounds/move-element-action");
21
+ const move_element_handler_1 = require("../change-bounds/move-element-handler");
20
22
  const position_snapper_1 = require("../change-bounds/position-snapper");
21
23
  const freeform_layout_1 = require("./freeform-layout");
22
24
  const glsp_hidden_bounds_updater_1 = require("./glsp-hidden-bounds-updater");
@@ -38,6 +40,8 @@ exports.boundsModule = new sprotty_1.FeatureModule((bind, _unbind, isBound, _reb
38
40
  (0, sprotty_1.configureLayout)(context, sprotty_1.VBoxLayouter.KIND, vbox_layout_1.VBoxLayouterExt);
39
41
  (0, sprotty_1.configureLayout)(context, sprotty_1.HBoxLayouter.KIND, hbox_layout_1.HBoxLayouterExt);
40
42
  (0, sprotty_1.configureLayout)(context, freeform_layout_1.FreeFormLayouter.KIND, freeform_layout_1.FreeFormLayouter);
43
+ bind(move_element_handler_1.MoveElementHandler).toSelf().inSingletonScope();
44
+ (0, sprotty_1.configureActionHandler)(context, move_element_action_1.MoveElementRelativeAction.KIND, move_element_handler_1.MoveElementHandler);
41
45
  // backwards compatibility
42
46
  // eslint-disable-next-line deprecation/deprecation
43
47
  bind(position_snapper_1.PositionSnapper).toSelf();
@@ -1 +1 @@
1
- {"version":3,"file":"bounds-module.js","sourceRoot":"","sources":["../../../src/features/bounds/bounds-module.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,mDAY+B;AAC/B,wEAAoE;AACpE,uDAAqD;AACrD,6EAAuE;AACvE,+CAAgD;AAChD,yCAAyC;AACzC,iDAA4D;AAC5D,+EAAyE;AACzE,+CAAgD;AAEnC,QAAA,YAAY,GAAG,IAAI,uBAAa,CACzC,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE;IAChC,MAAM,OAAO,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;IAClC,IAAA,0BAAgB,EAAC,OAAO,EAAE,0BAAgB,CAAC,CAAC;IAC5C,IAAA,0BAAgB,EAAC,OAAO,EAAE,8BAAoB,CAAC,CAAC;IAChD,IAAI,CAAC,6BAAmB,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IACt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 /********************************************************************************
2
+ * Copyright (c) 2024 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 } from '@eclipse-glsp/sprotty';
17
+ /**
18
+ * Action for triggering moving of elements. It is similar to `MoveAction` but is used for moving elements relative
19
+ * to their current position.
20
+ * The corresponding namespace declares the action kind as constant and offers helper functions for type guard checks
21
+ * and creating new `MoveElementRelativeAction`.
22
+ */
23
+ export interface MoveElementRelativeAction extends Action {
24
+ kind: typeof MoveElementRelativeAction.KIND;
25
+ /**
26
+ * Specifies the elements to be moved in/out
27
+ */
28
+ elementIds: string[];
29
+ /**
30
+ * Specifies the amount to be moved in the x-axis
31
+ */
32
+ moveX: number;
33
+ /**
34
+ * Specifies the amount to be moved in the y-axis
35
+ */
36
+ moveY: number;
37
+ /**
38
+ * Specifies whether we should snap to the grid
39
+ */
40
+ snap: boolean;
41
+ }
42
+ export declare namespace MoveElementRelativeAction {
43
+ const KIND = "moveElementRelative";
44
+ function is(object: any): object is MoveElementRelativeAction;
45
+ function create(options: {
46
+ elementIds: string[];
47
+ moveX: number;
48
+ moveY: number;
49
+ snap?: boolean;
50
+ }): MoveElementRelativeAction;
51
+ }
52
+ //# sourceMappingURL=move-element-action.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"move-element-action.d.ts","sourceRoot":"","sources":["../../../src/features/change-bounds/move-element-action.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C;;;;;GAKG;AACH,MAAM,WAAW,yBAA0B,SAAQ,MAAM;IACrD,IAAI,EAAE,OAAO,yBAAyB,CAAC,IAAI,CAAC;IAC5C;;OAEG;IACH,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC;CACjB;AAED,yBAAiB,yBAAyB,CAAC;IAChC,MAAM,IAAI,wBAAwB,CAAC;IAE1C,SAAgB,EAAE,CAAC,MAAM,EAAE,GAAG,GAAG,MAAM,IAAI,yBAAyB,CAEnE;IAED,SAAgB,MAAM,CAAC,OAAO,EAAE;QAAE,UAAU,EAAE,MAAM,EAAE,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,yBAAyB,CAEjI;CACJ"}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ /********************************************************************************
3
+ * Copyright (c) 2024 EclipseSource 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.MoveElementRelativeAction = void 0;
19
+ const sprotty_1 = require("@eclipse-glsp/sprotty");
20
+ var MoveElementRelativeAction;
21
+ (function (MoveElementRelativeAction) {
22
+ MoveElementRelativeAction.KIND = 'moveElementRelative';
23
+ function is(object) {
24
+ return sprotty_1.Action.hasKind(object, MoveElementRelativeAction.KIND);
25
+ }
26
+ MoveElementRelativeAction.is = is;
27
+ function create(options) {
28
+ return { kind: MoveElementRelativeAction.KIND, snap: true, ...options };
29
+ }
30
+ MoveElementRelativeAction.create = create;
31
+ })(MoveElementRelativeAction || (exports.MoveElementRelativeAction = MoveElementRelativeAction = {}));
32
+ //# sourceMappingURL=move-element-action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"move-element-action.js","sourceRoot":"","sources":["../../../src/features/change-bounds/move-element-action.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAElF,mDAA+C;AA4B/C,IAAiB,yBAAyB,CAUzC;AAVD,WAAiB,yBAAyB;IACzB,8BAAI,GAAG,qBAAqB,CAAC;IAE1C,SAAgB,EAAE,CAAC,MAAW;QAC1B,OAAO,gBAAM,CAAC,OAAO,CAAC,MAAM,EAAE,0BAAA,IAAI,CAAC,CAAC;IACxC,CAAC;IAFe,4BAAE,KAEjB,CAAA;IAED,SAAgB,MAAM,CAAC,OAA+E;QAClG,OAAO,EAAE,IAAI,EAAE,0BAAA,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC;IAClD,CAAC;IAFe,gCAAM,SAErB,CAAA;AACL,CAAC,EAVgB,yBAAyB,yCAAzB,yBAAyB,QAUzC"}
@@ -0,0 +1,42 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2023-2024 Business Informatics Group (TU Wien) and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0.
7
+ *
8
+ * This Source Code may also be made available under the following Secondary
9
+ * Licenses when the conditions for such availability set forth in the Eclipse
10
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ * with the GNU Classpath Exception which is available at
12
+ * https://www.gnu.org/software/classpath/license.html.
13
+ *
14
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
+ ********************************************************************************/
16
+ import { Action, ElementAndBounds, ElementMove, IActionDispatcher, IActionHandler, ICommand, ISnapper, Point } from '@eclipse-glsp/sprotty';
17
+ import { DebouncedFunc } from 'lodash';
18
+ import { EditorContextService } from '../../base/editor-context-service';
19
+ import { IFeedbackActionDispatcher } from '../../base/feedback/feedback-action-dispatcher';
20
+ import { FeedbackEmitter } from '../../base/feedback/feedback-emitter';
21
+ import { SelectableBoundsAware } from '../../utils/gmodel-util';
22
+ import { IMovementRestrictor } from '../change-bounds/movement-restrictor';
23
+ import { MoveElementRelativeAction } from './move-element-action';
24
+ /**
25
+ * Action handler for moving elements.
26
+ */
27
+ export declare class MoveElementHandler implements IActionHandler {
28
+ protected editorContextService: EditorContextService;
29
+ protected dispatcher: IActionDispatcher;
30
+ protected feedbackDispatcher: IFeedbackActionDispatcher;
31
+ readonly snapper?: ISnapper;
32
+ readonly movementRestrictor?: IMovementRestrictor;
33
+ protected debouncedChangeBounds?: DebouncedFunc<() => void>;
34
+ protected moveFeedback: FeedbackEmitter;
35
+ protected init(): void;
36
+ handle(action: Action): void | Action | ICommand;
37
+ protected handleMoveElement(action: MoveElementRelativeAction): void;
38
+ protected getTargetBounds(element: SelectableBoundsAware, action: MoveElementRelativeAction): Point;
39
+ protected scheduleChangeBounds(elementAndBounds: ElementAndBounds[]): void;
40
+ protected toElementAndBounds(elementMoves: ElementMove[]): ElementAndBounds[];
41
+ }
42
+ //# sourceMappingURL=move-element-handler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"move-element-handler.d.ts","sourceRoot":"","sources":["../../../src/features/change-bounds/move-element-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EACH,MAAM,EAEN,gBAAgB,EAChB,WAAW,EACX,iBAAiB,EACjB,cAAc,EACd,QA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AAE,GAAG,gBAAgB,EAAE;CAoBhF"}
@@ -24,77 +24,15 @@ var __metadata = (this && this.__metadata) || function (k, v) {
24
24
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
25
25
  };
26
26
  Object.defineProperty(exports, "__esModule", { value: true });
27
- exports.MoveElementHandler = exports.MoveViewportHandler = exports.MoveElementAction = exports.MoveViewportAction = void 0;
27
+ exports.MoveElementHandler = void 0;
28
28
  const sprotty_1 = require("@eclipse-glsp/sprotty");
29
29
  const inversify_1 = require("inversify");
30
30
  const lodash_1 = require("lodash");
31
- const editor_context_service_1 = require("../../../base/editor-context-service");
32
- const gmodel_util_1 = require("../../../utils/gmodel-util");
33
- const layout_utils_1 = require("../../../utils/layout-utils");
34
- const viewpoint_util_1 = require("../../../utils/viewpoint-util");
35
- var MoveViewportAction;
36
- (function (MoveViewportAction) {
37
- MoveViewportAction.KIND = 'moveViewportAction';
38
- function is(object) {
39
- return sprotty_1.Action.hasKind(object, MoveViewportAction.KIND);
40
- }
41
- MoveViewportAction.is = is;
42
- function create(moveX, moveY) {
43
- return { kind: MoveViewportAction.KIND, moveX, moveY };
44
- }
45
- MoveViewportAction.create = create;
46
- })(MoveViewportAction || (exports.MoveViewportAction = MoveViewportAction = {}));
47
- var MoveElementAction;
48
- (function (MoveElementAction) {
49
- MoveElementAction.KIND = 'moveElementAction';
50
- function is(object) {
51
- return sprotty_1.Action.hasKind(object, MoveElementAction.KIND);
52
- }
53
- MoveElementAction.is = is;
54
- function create(elementIds, moveX, moveY, snap = true) {
55
- return { kind: MoveElementAction.KIND, elementIds, moveX, moveY, snap };
56
- }
57
- MoveElementAction.create = create;
58
- })(MoveElementAction || (exports.MoveElementAction = MoveElementAction = {}));
59
- /**
60
- * Action handler for moving of the viewport.
61
- */
62
- let MoveViewportHandler = class MoveViewportHandler {
63
- handle(action) {
64
- if (MoveViewportAction.is(action)) {
65
- this.handleMoveViewport(action);
66
- }
67
- }
68
- handleMoveViewport(action) {
69
- const viewport = (0, sprotty_1.findParentByFeature)(this.editorContextService.modelRoot, sprotty_1.isViewport);
70
- if (!viewport) {
71
- return;
72
- }
73
- this.dispatcher.dispatch(this.moveViewport(viewport, action.moveX, action.moveY));
74
- }
75
- moveViewport(viewport, offsetX, offSetY) {
76
- const newViewport = {
77
- scroll: {
78
- x: viewport.scroll.x + offsetX,
79
- y: viewport.scroll.y + offSetY
80
- },
81
- zoom: viewport.zoom
82
- };
83
- return sprotty_1.SetViewportAction.create(viewport.id, newViewport, { animate: false });
84
- }
85
- };
86
- exports.MoveViewportHandler = MoveViewportHandler;
87
- __decorate([
88
- (0, inversify_1.inject)(editor_context_service_1.EditorContextService),
89
- __metadata("design:type", editor_context_service_1.EditorContextService)
90
- ], MoveViewportHandler.prototype, "editorContextService", void 0);
91
- __decorate([
92
- (0, inversify_1.inject)(sprotty_1.TYPES.IActionDispatcher),
93
- __metadata("design:type", Object)
94
- ], MoveViewportHandler.prototype, "dispatcher", void 0);
95
- exports.MoveViewportHandler = MoveViewportHandler = __decorate([
96
- (0, inversify_1.injectable)()
97
- ], MoveViewportHandler);
31
+ const editor_context_service_1 = require("../../base/editor-context-service");
32
+ const gmodel_util_1 = require("../../utils/gmodel-util");
33
+ const layout_utils_1 = require("../../utils/layout-utils");
34
+ const viewpoint_util_1 = require("../../utils/viewpoint-util");
35
+ const move_element_action_1 = require("./move-element-action");
98
36
  /**
99
37
  * Action handler for moving elements.
100
38
  */
@@ -103,7 +41,7 @@ let MoveElementHandler = class MoveElementHandler {
103
41
  this.moveFeedback = this.feedbackDispatcher.createEmitter();
104
42
  }
105
43
  handle(action) {
106
- if (MoveElementAction.is(action)) {
44
+ if (move_element_action_1.MoveElementRelativeAction.is(action)) {
107
45
  this.handleMoveElement(action);
108
46
  }
109
47
  }
@@ -126,8 +64,10 @@ let MoveElementHandler = class MoveElementHandler {
126
64
  },
127
65
  toPosition: newPosition
128
66
  });
129
- if ((0, viewpoint_util_1.outsideOfViewport)(newPosition, viewport)) {
130
- viewportActions.push(MoveViewportAction.create(action.moveX, action.moveY));
67
+ const topLeftCorner = newPosition;
68
+ const bottomRightCorner = sprotty_1.Point.add(newPosition, { x: element.bounds.width, y: element.bounds.height });
69
+ if ((0, viewpoint_util_1.outsideOfViewport)(topLeftCorner, viewport) || (0, viewpoint_util_1.outsideOfViewport)(bottomRightCorner, viewport)) {
70
+ viewportActions.push(sprotty_1.MoveViewportAction.create({ moveX: action.moveX, moveY: action.moveY }));
131
71
  }
132
72
  }
133
73
  this.dispatcher.dispatchAll(viewportActions);
@@ -209,4 +149,4 @@ __decorate([
209
149
  exports.MoveElementHandler = MoveElementHandler = __decorate([
210
150
  (0, inversify_1.injectable)()
211
151
  ], MoveElementHandler);
212
- //# sourceMappingURL=move-handler.js.map
152
+ //# sourceMappingURL=move-element-handler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"move-element-handler.js","sourceRoot":"","sources":["../../../src/features/change-bounds/move-element-handler.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;;;;AAElF,mDAgB+B;AAC/B,yCAAwE;AACxE,mCAAiD;AACjD,8EAAyE;AAGzE,yDAAyG;AACzG,2DAAuD;AACvD,+DAA+D;AAE/D,+DAAkE;AAElE;;GAEG;AAEI,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAsBjB,IAAI;QACV,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,kBAAkB,CAAC,aAAa,EAAE,CAAC;IAChE,CAAC;IAED,MAAM,CAAC,MAAc;QACjB,IAAI,+CAAyB,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC;YACvC,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;QACnC,CAAC;IACL,CAAC;IAES,iBAAiB,CAAC,MAAiC;QACzD,MAAM,SAAS,GAAG,IAAI,CAAC,oBAAoB,CAAC,SAAS,CAAC;QACtD,MAAM,QAAQ,GAAG,IAAA,6BAAmB,EAAC,SAAS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;AAMxC;IADT,IAAA,yBAAa,GAAE;;;;8CAGf;6BAxBQ,kBAAkB;IAD9B,IAAA,sBAAU,GAAE;GACA,kBAAkB,CA8G9B"}
@@ -0,0 +1,31 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2025 EclipseSource and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0.
7
+ *
8
+ * This Source Code may also be made available under the following Secondary
9
+ * Licenses when the conditions for such availability set forth in the Eclipse
10
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ * with the GNU Classpath Exception which is available at
12
+ * https://www.gnu.org/software/classpath/license.html.
13
+ *
14
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
+ ********************************************************************************/
16
+ import { KeyListener, type Action, type GModelElement } from '@eclipse-glsp/sprotty';
17
+ import type { SelectionService } from '../../base/selection-service';
18
+ import { Grid } from '../grid/grid';
19
+ import type { IChangeBoundsManager } from '../tools/change-bounds/change-bounds-manager';
20
+ export declare class MoveElementKeyListener extends KeyListener {
21
+ protected readonly selectionService: SelectionService;
22
+ protected readonly changeBoundsManager: IChangeBoundsManager;
23
+ protected readonly grid: Grid;
24
+ constructor(selectionService: SelectionService, changeBoundsManager: IChangeBoundsManager, grid?: Grid);
25
+ keyDown(_element: GModelElement, event: KeyboardEvent): Action[];
26
+ protected matchesMoveUpKeystroke(event: KeyboardEvent): boolean;
27
+ protected matchesMoveDownKeystroke(event: KeyboardEvent): boolean;
28
+ protected matchesMoveRightKeystroke(event: KeyboardEvent): boolean;
29
+ protected matchesMoveLeftKeystroke(event: KeyboardEvent): boolean;
30
+ }
31
+ //# sourceMappingURL=move-element-key-listener.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"move-element-key-listener.d.ts","sourceRoot":"","sources":["../../../src/features/change-bounds/move-element-key-listener.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAc,WAAW,EAAoB,KAAK,MAAM,EAAE,KAAK,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACnH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8CAA8C,CAAC;AAGzF,qBAAa,sBAAuB,SAAQ,WAAW;IAE/C,SAAS,CAAC,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB;IACrD,SAAS,CAAC,QAAQ,CAAC,mBAAmB,EAAE,oBAAoB;IAC5D,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI;gBAFV,gBAAgB,EAAE,gBAAgB,EAClC,mBAAmB,EAAE,oBAAoB,EACzC,IAAI,GAAE,IAAmB;IAKvC,OAAO,CAAC,QAAQ,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,GAAG,MAAM,EAAE;IAuBzE,SAAS,CAAC,sBAAsB,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO;IAK/D,SAAS,CAAC,wBAAwB,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO;IAKjE,SAAS,CAAC,yBAAyB,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO;IAKlE,SAAS,CAAC,wBAAwB,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO;CAIpE"}