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

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 (211) 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/lib/views/routing-point-handle-view.d.ts.map +1 -1
  137. package/lib/views/routing-point-handle-view.js +9 -9
  138. package/lib/views/routing-point-handle-view.js.map +1 -1
  139. package/package.json +3 -3
  140. package/src/base/default.module.ts +4 -0
  141. package/src/{features/accessibility/key-shortcut/accessible-key-shortcut.ts → base/shortcuts/available-shortcuts-extension.ts} +13 -46
  142. package/src/{features/accessibility/key-shortcut/accessible-key-shortcut-tool.ts → base/shortcuts/available-shortcuts-tool.ts} +9 -15
  143. package/src/base/shortcuts/shortcuts-manager.ts +64 -0
  144. package/src/{features/accessibility/resize-key-tool/resize-key-module.ts → base/shortcuts/shortcuts-module.ts} +12 -14
  145. package/src/base/ui-extension/ui-extension.ts +8 -1
  146. package/src/default-modules.ts +3 -1
  147. package/src/features/accessibility/accessibility-module.ts +0 -6
  148. package/src/features/accessibility/element-navigation/diagram-navigation-tool.ts +26 -50
  149. package/src/features/accessibility/global-keylistener-tool.ts +11 -28
  150. package/src/features/accessibility/search/search-tool.ts +15 -33
  151. package/src/features/accessibility/view-key-tools/{zoom-key-tool.ts → grid-cell-zoom-key-tool.ts} +27 -82
  152. package/src/features/accessibility/view-key-tools/view-key-tools-module.ts +7 -7
  153. package/src/features/bounds/bounds-module.ts +6 -0
  154. package/src/features/change-bounds/move-element-action.ts +55 -0
  155. package/src/features/{accessibility/move-zoom/move-handler.ts → change-bounds/move-element-handler.ts} +18 -113
  156. package/src/features/change-bounds/move-element-key-listener.ts +74 -0
  157. package/src/features/change-bounds/resize/resize-default-tool.ts +75 -0
  158. package/src/features/{accessibility/resize-key-tool/resize-key-handler.ts → change-bounds/resize/resize-handler.ts} +10 -19
  159. package/src/features/change-bounds/resize/resize-module.ts +48 -0
  160. package/src/features/change-bounds/resize/resize-tool.ts +114 -0
  161. package/src/features/grid/grid-module.ts +2 -1
  162. package/src/features/grid/grid-snapper.ts +2 -2
  163. package/src/features/grid/grid.ts +3 -0
  164. package/src/features/tools/base-tools.ts +12 -6
  165. package/src/features/tools/change-bounds/change-bounds-tool.ts +25 -1
  166. package/src/features/viewport/viewport-handler.ts +121 -1
  167. package/src/features/viewport/viewport-key-listener.ts +121 -0
  168. package/src/features/viewport/viewport-modules.ts +15 -1
  169. package/src/features/viewport/viewport-tool.ts +54 -0
  170. package/src/features/viewport/zoom-viewport-action.ts +54 -0
  171. package/src/index.ts +13 -11
  172. package/src/standalone-modules.ts +4 -0
  173. package/src/utils/viewpoint-util.ts +2 -2
  174. package/src/views/routing-point-handle-view.tsx +1 -2
  175. package/lib/features/accessibility/key-shortcut/accessible-key-shortcut-tool.d.ts.map +0 -1
  176. package/lib/features/accessibility/key-shortcut/accessible-key-shortcut-tool.js.map +0 -1
  177. package/lib/features/accessibility/key-shortcut/accessible-key-shortcut.d.ts.map +0 -1
  178. package/lib/features/accessibility/key-shortcut/accessible-key-shortcut.js.map +0 -1
  179. package/lib/features/accessibility/key-shortcut/shortcut-help-module.d.ts +0 -26
  180. package/lib/features/accessibility/key-shortcut/shortcut-help-module.d.ts.map +0 -1
  181. package/lib/features/accessibility/key-shortcut/shortcut-help-module.js +0 -37
  182. package/lib/features/accessibility/key-shortcut/shortcut-help-module.js.map +0 -1
  183. package/lib/features/accessibility/move-zoom/move-handler.d.ts +0 -97
  184. package/lib/features/accessibility/move-zoom/move-handler.d.ts.map +0 -1
  185. package/lib/features/accessibility/move-zoom/move-handler.js.map +0 -1
  186. package/lib/features/accessibility/move-zoom/move-zoom-module.d.ts.map +0 -1
  187. package/lib/features/accessibility/move-zoom/move-zoom-module.js +0 -40
  188. package/lib/features/accessibility/move-zoom/move-zoom-module.js.map +0 -1
  189. package/lib/features/accessibility/move-zoom/zoom-handler.d.ts +0 -73
  190. package/lib/features/accessibility/move-zoom/zoom-handler.d.ts.map +0 -1
  191. package/lib/features/accessibility/move-zoom/zoom-handler.js +0 -157
  192. package/lib/features/accessibility/move-zoom/zoom-handler.js.map +0 -1
  193. package/lib/features/accessibility/resize-key-tool/resize-key-handler.d.ts.map +0 -1
  194. package/lib/features/accessibility/resize-key-tool/resize-key-handler.js.map +0 -1
  195. package/lib/features/accessibility/resize-key-tool/resize-key-module.d.ts.map +0 -1
  196. package/lib/features/accessibility/resize-key-tool/resize-key-module.js.map +0 -1
  197. package/lib/features/accessibility/resize-key-tool/resize-key-tool.d.ts +0 -47
  198. package/lib/features/accessibility/resize-key-tool/resize-key-tool.d.ts.map +0 -1
  199. package/lib/features/accessibility/resize-key-tool/resize-key-tool.js +0 -154
  200. package/lib/features/accessibility/resize-key-tool/resize-key-tool.js.map +0 -1
  201. package/lib/features/accessibility/view-key-tools/movement-key-tool.d.ts +0 -53
  202. package/lib/features/accessibility/view-key-tools/movement-key-tool.d.ts.map +0 -1
  203. package/lib/features/accessibility/view-key-tools/movement-key-tool.js +0 -156
  204. package/lib/features/accessibility/view-key-tools/movement-key-tool.js.map +0 -1
  205. package/lib/features/accessibility/view-key-tools/zoom-key-tool.d.ts.map +0 -1
  206. package/lib/features/accessibility/view-key-tools/zoom-key-tool.js.map +0 -1
  207. package/src/features/accessibility/key-shortcut/shortcut-help-module.ts +0 -42
  208. package/src/features/accessibility/move-zoom/move-zoom-module.ts +0 -44
  209. package/src/features/accessibility/move-zoom/zoom-handler.ts +0 -182
  210. package/src/features/accessibility/resize-key-tool/resize-key-tool.ts +0 -139
  211. package/src/features/accessibility/view-key-tools/movement-key-tool.ts +0 -135
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ /********************************************************************************
3
+ * Copyright (c) 2025 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.MoveElementKeyListener = void 0;
19
+ const sprotty_1 = require("@eclipse-glsp/sprotty");
20
+ const grid_1 = require("../grid/grid");
21
+ const move_element_action_1 = require("./move-element-action");
22
+ class MoveElementKeyListener extends sprotty_1.KeyListener {
23
+ constructor(selectionService, changeBoundsManager, grid = grid_1.Grid.DEFAULT) {
24
+ super();
25
+ this.selectionService = selectionService;
26
+ this.changeBoundsManager = changeBoundsManager;
27
+ this.grid = grid;
28
+ }
29
+ keyDown(_element, event) {
30
+ const selectedElementIds = this.selectionService
31
+ .getSelectedElements()
32
+ .filter(element => (0, sprotty_1.isMoveable)(element))
33
+ .map(element => element.id);
34
+ const snap = this.changeBoundsManager.usePositionSnap(event);
35
+ const offsetX = snap ? this.grid.x : 1;
36
+ const offsetY = snap ? this.grid.y : 1;
37
+ if (selectedElementIds.length > 0) {
38
+ if (this.matchesMoveUpKeystroke(event)) {
39
+ return [move_element_action_1.MoveElementRelativeAction.create({ elementIds: selectedElementIds, moveX: 0, moveY: -offsetY, snap })];
40
+ }
41
+ else if (this.matchesMoveDownKeystroke(event)) {
42
+ return [move_element_action_1.MoveElementRelativeAction.create({ elementIds: selectedElementIds, moveX: 0, moveY: offsetY, snap })];
43
+ }
44
+ else if (this.matchesMoveRightKeystroke(event)) {
45
+ return [move_element_action_1.MoveElementRelativeAction.create({ elementIds: selectedElementIds, moveX: offsetX, moveY: 0, snap })];
46
+ }
47
+ else if (this.matchesMoveLeftKeystroke(event)) {
48
+ return [move_element_action_1.MoveElementRelativeAction.create({ elementIds: selectedElementIds, moveX: -offsetX, moveY: 0, snap })];
49
+ }
50
+ }
51
+ return [];
52
+ }
53
+ matchesMoveUpKeystroke(event) {
54
+ const unsnap = this.changeBoundsManager.unsnapModifier();
55
+ return (0, sprotty_1.matchesKeystroke)(event, 'ArrowUp') || (!!unsnap && (0, sprotty_1.matchesKeystroke)(event, 'ArrowUp', unsnap));
56
+ }
57
+ matchesMoveDownKeystroke(event) {
58
+ const unsnap = this.changeBoundsManager.unsnapModifier();
59
+ return (0, sprotty_1.matchesKeystroke)(event, 'ArrowDown') || (!!unsnap && (0, sprotty_1.matchesKeystroke)(event, 'ArrowDown', unsnap));
60
+ }
61
+ matchesMoveRightKeystroke(event) {
62
+ const unsnap = this.changeBoundsManager.unsnapModifier();
63
+ return (0, sprotty_1.matchesKeystroke)(event, 'ArrowRight') || (!!unsnap && (0, sprotty_1.matchesKeystroke)(event, 'ArrowRight', unsnap));
64
+ }
65
+ matchesMoveLeftKeystroke(event) {
66
+ const unsnap = this.changeBoundsManager.unsnapModifier();
67
+ return (0, sprotty_1.matchesKeystroke)(event, 'ArrowLeft') || (!!unsnap && (0, sprotty_1.matchesKeystroke)(event, 'ArrowLeft', unsnap));
68
+ }
69
+ }
70
+ exports.MoveElementKeyListener = MoveElementKeyListener;
71
+ //# sourceMappingURL=move-element-key-listener.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"move-element-key-listener.js","sourceRoot":"","sources":["../../../src/features/change-bounds/move-element-key-listener.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAElF,mDAAmH;AAEnH,uCAAoC;AAEpC,+DAAkE;AAElE,MAAa,sBAAuB,SAAQ,qBAAW;IACnD,YACuB,gBAAkC,EAClC,mBAAyC,EACzC,OAAa,WAAI,CAAC,OAAO;QAE5C,KAAK,EAAE,CAAC;QAJW,qBAAgB,GAAhB,gBAAgB,CAAkB;QAClC,wBAAmB,GAAnB,mBAAmB,CAAsB;QACzC,SAAI,GAAJ,IAAI,CAAqB;IAGhD,CAAC;IAEQ,OAAO,CAAC,QAAuB,EAAE,KAAoB;QAC1D,MAAM,kBAAkB,GAAG,IAAI,CAAC,gBAAgB;aAC3C,mBAAmB,EAAE;aACrB,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,IAAA,oBAAU,EAAC,OAAO,CAAC,CAAC;aACtC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAChC,MAAM,IAAI,GAAG,IAAI,CAAC,mBAAmB,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;QAC7D,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACvC,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAEvC,IAAI,kBAAkB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC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,CAAC,CAAC;IAC1G,CAAC;IAES,wBAAwB,CAAC,KAAoB;QACnD,MAAM,MAAM,GAAG,IAAI,CAAC,mBAAmB,CAAC,cAAc,EAAE,CAAC;QACzD,OAAO,IAAA,0BAAgB,EAAC,KAAK,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,IAAI,IAAA,0BAAgB,EAAC,KAAK,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC;IAC9G,CAAC;IAES,yBAAyB,CAAC,KAAoB;QACpD,MAAM,MAAM,GAAG,IAAI,CAAC,mBAAmB,CAAC,cAAc,EAAE,CAAC;QACzD,OAAO,IAAA,0BAAgB,EAAC,KAAK,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,IAAI,IAAA,0BAAgB,EAAC,KAAK,EAAE,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC;IAChH,CAAC;IAES,wBAAwB,CAAC,KAAoB;QACnD,MAAM,MAAM,GAAG,IAAI,CAAC,mBAAmB,CAAC,cAAc,EAAE,CAAC;QACzD,OAAO,IAAA,0BAAgB,EAAC,KAAK,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,IAAI,IAAA,0BAAgB,EAAC,KAAK,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC;IAC9G,CAAC;CACJ;AAnDD,wDAmDC"}
@@ -0,0 +1,34 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2023 Business Informatics Group (TU Wien) and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0.
7
+ *
8
+ * This Source Code may also be made available under the following Secondary
9
+ * Licenses when the conditions for such availability set forth in the Eclipse
10
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ * with the GNU Classpath Exception which is available at
12
+ * https://www.gnu.org/software/classpath/license.html.
13
+ *
14
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
+ ********************************************************************************/
16
+ import { KeyListener, type Action, type GModelElement, type IActionDispatcher } from '@eclipse-glsp/sprotty';
17
+ import { SelectionService } from '../../../base/selection-service';
18
+ import type { ShortcutManager } from '../../../base/shortcuts/shortcuts-manager';
19
+ import { BaseEditTool } from '../../tools/base-tools';
20
+ export declare class DefaultResizeKeyListener extends KeyListener {
21
+ protected readonly actionDispatcher: IActionDispatcher;
22
+ protected readonly selectionService: SelectionService;
23
+ keyDown(element: GModelElement, event: KeyboardEvent): Action[];
24
+ protected matchesActivateResizeModeKeystroke(event: KeyboardEvent): boolean;
25
+ }
26
+ export declare class DefaultResizeKeyTool extends BaseEditTool {
27
+ static ID: string;
28
+ static TOKEN: symbol;
29
+ get id(): string;
30
+ protected readonly shortcutManager: ShortcutManager;
31
+ protected readonly keyListener: DefaultResizeKeyListener;
32
+ enable(): void;
33
+ }
34
+ //# sourceMappingURL=resize-default-tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resize-default-tool.d.ts","sourceRoot":"","sources":["../../../../src/features/change-bounds/resize/resize-default-tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,WAAW,EAA2B,KAAK,MAAM,EAAE,KAAK,aAAa,EAAE,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAEtI,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAC;AAEjF,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAItD,qBACa,wBAAyB,SAAQ,WAAW;IAErD,SAAS,CAAC,QAAQ,CAAC,gBAAgB,EAAE,iBAAiB,CAAC;IAEvD,SAAS,CAAC,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAE7C,OAAO,CAAC,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,GAAG,MAAM,EAAE;IAexE,SAAS,CAAC,kCAAkC,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO;CAG9E;AAED,qBACa,oBAAqB,SAAQ,YAAY;IAClD,MAAM,CAAC,EAAE,SAAkC;IAC3C,MAAM,CAAC,KAAK,SAAyC;IAErD,IAAI,EAAE,IAAI,MAAM,CAEf;IAGD,SAAS,CAAC,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;IAEpD,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,wBAAwB,CAAC;IAEzD,MAAM,IAAI,IAAI;CAQjB"}
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ /********************************************************************************
3
+ * Copyright (c) 2023 Business Informatics Group (TU Wien) and others.
4
+ *
5
+ * This program and the accompanying materials are made available under the
6
+ * terms of the Eclipse Public License v. 2.0 which is available at
7
+ * http://www.eclipse.org/legal/epl-2.0.
8
+ *
9
+ * This Source Code may also be made available under the following Secondary
10
+ * Licenses when the conditions for such availability set forth in the Eclipse
11
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ * with the GNU Classpath Exception which is available at
13
+ * https://www.gnu.org/software/classpath/license.html.
14
+ *
15
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16
+ ********************************************************************************/
17
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
22
+ };
23
+ var __metadata = (this && this.__metadata) || function (k, v) {
24
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
25
+ };
26
+ var DefaultResizeKeyTool_1;
27
+ Object.defineProperty(exports, "__esModule", { value: true });
28
+ exports.DefaultResizeKeyTool = exports.DefaultResizeKeyListener = void 0;
29
+ const sprotty_1 = require("@eclipse-glsp/sprotty");
30
+ const inversify_1 = require("inversify");
31
+ const selection_service_1 = require("../../../base/selection-service");
32
+ const tool_1 = require("../../../base/tool-manager/tool");
33
+ const base_tools_1 = require("../../tools/base-tools");
34
+ const model_1 = require("../model");
35
+ const resize_tool_1 = require("./resize-tool");
36
+ let DefaultResizeKeyListener = class DefaultResizeKeyListener extends sprotty_1.KeyListener {
37
+ keyDown(element, event) {
38
+ const selectedElementsIds = this.selectionService
39
+ .getSelectedElements()
40
+ .filter(model_1.isResizable)
41
+ .map(e => e.id);
42
+ if (selectedElementsIds.length > 0) {
43
+ if (this.matchesActivateResizeModeKeystroke(event)) {
44
+ return [tool_1.EnableToolsAction.create([resize_tool_1.ResizeKeyTool.ID])];
45
+ }
46
+ }
47
+ return [];
48
+ }
49
+ matchesActivateResizeModeKeystroke(event) {
50
+ return (0, sprotty_1.matchesKeystroke)(event, 'KeyA', 'alt');
51
+ }
52
+ };
53
+ exports.DefaultResizeKeyListener = DefaultResizeKeyListener;
54
+ __decorate([
55
+ (0, inversify_1.inject)(sprotty_1.TYPES.IActionDispatcher),
56
+ __metadata("design:type", Object)
57
+ ], DefaultResizeKeyListener.prototype, "actionDispatcher", void 0);
58
+ __decorate([
59
+ (0, inversify_1.inject)(selection_service_1.SelectionService),
60
+ __metadata("design:type", selection_service_1.SelectionService)
61
+ ], DefaultResizeKeyListener.prototype, "selectionService", void 0);
62
+ exports.DefaultResizeKeyListener = DefaultResizeKeyListener = __decorate([
63
+ (0, inversify_1.injectable)()
64
+ ], DefaultResizeKeyListener);
65
+ let DefaultResizeKeyTool = DefaultResizeKeyTool_1 = class DefaultResizeKeyTool extends base_tools_1.BaseEditTool {
66
+ get id() {
67
+ return DefaultResizeKeyTool_1.ID;
68
+ }
69
+ enable() {
70
+ this.toDisposeOnDisable.push(this.keyTool.registerListener(this.keyListener), this.shortcutManager.register(DefaultResizeKeyTool_1.TOKEN, [
71
+ { shortcuts: ['ALT', 'A'], description: 'Activate resize mode for selected element', group: 'Resize', position: 0 }
72
+ ]));
73
+ }
74
+ };
75
+ exports.DefaultResizeKeyTool = DefaultResizeKeyTool;
76
+ DefaultResizeKeyTool.ID = 'glsp.default-resize-key-tool';
77
+ DefaultResizeKeyTool.TOKEN = Symbol.for(DefaultResizeKeyTool_1.name);
78
+ __decorate([
79
+ (0, inversify_1.inject)(sprotty_1.TYPES.IShortcutManager),
80
+ __metadata("design:type", Function)
81
+ ], DefaultResizeKeyTool.prototype, "shortcutManager", void 0);
82
+ __decorate([
83
+ (0, inversify_1.inject)(DefaultResizeKeyListener),
84
+ __metadata("design:type", DefaultResizeKeyListener)
85
+ ], DefaultResizeKeyTool.prototype, "keyListener", void 0);
86
+ exports.DefaultResizeKeyTool = DefaultResizeKeyTool = DefaultResizeKeyTool_1 = __decorate([
87
+ (0, inversify_1.injectable)()
88
+ ], DefaultResizeKeyTool);
89
+ //# sourceMappingURL=resize-default-tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resize-default-tool.js","sourceRoot":"","sources":["../../../../src/features/change-bounds/resize/resize-default-tool.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;;;;;AAElF,mDAAsI;AACtI,yCAA+C;AAC/C,uEAAmE;AAEnE,0DAAoE;AACpE,uDAAsD;AACtD,oCAAuC;AACvC,+CAA8C;AAGvC,IAAM,wBAAwB,GAA9B,MAAM,wBAAyB,SAAQ,qBAAW;IAM5C,OAAO,CAAC,OAAsB,EAAE,KAAoB;QACzD,MAAM,mBAAmB,GAAG,IAAI,CAAC,gBAAgB;aAC5C,mBAAmB,EAAE;aACrB,MAAM,CAAC,mBAAW,CAAC;aACnB,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CA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,CAAC,AAAxC,CAAyC;AAOlC;IADlB,IAAA,kBAAM,EAAC,eAAK,CAAC,gBAAgB,CAAC;;6DACqB;AAEjC;IADlB,IAAA,kBAAM,EAAC,wBAAwB,CAAC;8BACD,wBAAwB;yDAAC;+BAXhD,oBAAoB;IADhC,IAAA,sBAAU,GAAE;GACA,oBAAoB,CAqBhC"}
@@ -39,21 +39,17 @@ export declare namespace ResizeElementAction {
39
39
  function create(elementIds: string[], resizeType: ResizeType): ResizeElementAction;
40
40
  }
41
41
  export declare class ResizeElementHandler implements IActionHandler {
42
- protected readonly snapper?: ISnapper | undefined;
43
42
  protected editorContextService: EditorContextService;
44
43
  protected dispatcher: IActionDispatcher;
45
44
  protected feedbackDispatcher: IFeedbackActionDispatcher;
45
+ protected grid: Grid;
46
+ protected readonly snapper?: ISnapper;
46
47
  protected debouncedChangeBounds?: DebouncedFunc<() => void>;
47
48
  protected resizeFeedback: FeedbackEmitter;
48
- static readonly defaultResizeX = 20;
49
- static readonly defaultResizeY = 20;
50
- protected grid: Grid;
51
- protected isEditMode: boolean;
52
- constructor(snapper?: ISnapper | undefined);
53
49
  protected init(): void;
54
50
  handle(action: Action): void | Action | ICommand;
55
51
  handleResizeElement(action: ResizeElementAction): void;
56
52
  protected computeElementAndBounds(elements: SelectableBoundsAware[], action: ResizeElementAction): ElementAndBounds[];
57
53
  protected isValidBoundChange(element: SelectableBoundsAware, newPosition: Point, newSize: Dimension): boolean;
58
54
  }
59
- //# sourceMappingURL=resize-key-handler.d.ts.map
55
+ //# sourceMappingURL=resize-handler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resize-handler.d.ts","sourceRoot":"","sources":["../../../../src/features/change-bounds/resize/resize-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EACH,MAAM,EAEN,SAAS,EACT,gBAAgB,EAGhB,iBAAiB,EACjB,cAAc,EACd,QAAQ,EACR,QAAQ,EACR,KAAK,EAGR,MAAM,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AAS,CAAC,IAAI,IAAI,IAAI;IAItB,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,QAAQ;IAMhD,mBAAmB,CAAC,MAAM,EAAE,mBAAmB,GAAG,IAAI;IAetD,SAAS,CAAC,uBAAuB,CAAC,QAAQ,EAAE,qBAAqB,EAAE,EAAE,MAAM,EAAE,mBAAmB,GAAG,gBAAgB,EAAE;IA4BrH,SAAS,CAAC,kBAAkB,CAAC,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,GAAG,OAAO;CAGhH"}
@@ -23,10 +23,6 @@ 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 __param = (this && this.__param) || function (paramIndex, decorator) {
27
- return function (target, key) { decorator(target, key, paramIndex); }
28
- };
29
- var ResizeElementHandler_1;
30
26
  Object.defineProperty(exports, "__esModule", { value: true });
31
27
  exports.ResizeElementHandler = exports.ResizeElementAction = exports.ResizeType = void 0;
32
28
  const sprotty_1 = require("@eclipse-glsp/sprotty");
@@ -35,6 +31,7 @@ const lodash_1 = require("lodash");
35
31
  const editor_context_service_1 = require("../../../base/editor-context-service");
36
32
  const gmodel_util_1 = require("../../../utils/gmodel-util");
37
33
  const layout_utils_1 = require("../../../utils/layout-utils");
34
+ const grid_1 = require("../../grid/grid");
38
35
  var ResizeType;
39
36
  (function (ResizeType) {
40
37
  ResizeType[ResizeType["Increase"] = 0] = "Increase";
@@ -53,16 +50,13 @@ var ResizeElementAction;
53
50
  }
54
51
  ResizeElementAction.create = create;
55
52
  })(ResizeElementAction || (exports.ResizeElementAction = ResizeElementAction = {}));
56
- /* The ResizeElementHandler class is an implementation of the IActionHandler interface that handles
57
- resizing of elements. */
58
- let ResizeElementHandler = ResizeElementHandler_1 = class ResizeElementHandler {
59
- constructor(snapper) {
60
- this.snapper = snapper;
61
- this.grid = {
62
- x: ResizeElementHandler_1.defaultResizeX,
63
- y: ResizeElementHandler_1.defaultResizeY
64
- };
65
- this.isEditMode = false;
53
+ /*
54
+ * The ResizeElementHandler class is an implementation of the IActionHandler interface that handles
55
+ * resizing of elements.
56
+ */
57
+ let ResizeElementHandler = class ResizeElementHandler {
58
+ constructor() {
59
+ this.grid = grid_1.Grid.DEFAULT;
66
60
  }
67
61
  init() {
68
62
  this.resizeFeedback = this.feedbackDispatcher.createEmitter();
@@ -115,10 +109,6 @@ let ResizeElementHandler = ResizeElementHandler_1 = class ResizeElementHandler {
115
109
  }
116
110
  };
117
111
  exports.ResizeElementHandler = ResizeElementHandler;
118
- // Default x resize used if grid is not provided
119
- ResizeElementHandler.defaultResizeX = 20;
120
- // Default y resize used if grid is not provided
121
- ResizeElementHandler.defaultResizeY = 20;
122
112
  __decorate([
123
113
  (0, inversify_1.inject)(editor_context_service_1.EditorContextService),
124
114
  __metadata("design:type", editor_context_service_1.EditorContextService)
@@ -136,16 +126,18 @@ __decorate([
136
126
  (0, inversify_1.optional)(),
137
127
  __metadata("design:type", Object)
138
128
  ], ResizeElementHandler.prototype, "grid", void 0);
129
+ __decorate([
130
+ (0, inversify_1.inject)(sprotty_1.TYPES.ISnapper),
131
+ (0, inversify_1.optional)(),
132
+ __metadata("design:type", Object)
133
+ ], ResizeElementHandler.prototype, "snapper", void 0);
139
134
  __decorate([
140
135
  (0, inversify_1.postConstruct)(),
141
136
  __metadata("design:type", Function),
142
137
  __metadata("design:paramtypes", []),
143
138
  __metadata("design:returntype", void 0)
144
139
  ], ResizeElementHandler.prototype, "init", null);
145
- exports.ResizeElementHandler = ResizeElementHandler = ResizeElementHandler_1 = __decorate([
146
- (0, inversify_1.injectable)(),
147
- __param(0, (0, inversify_1.inject)(sprotty_1.TYPES.ISnapper)),
148
- __param(0, (0, inversify_1.optional)()),
149
- __metadata("design:paramtypes", [Object])
140
+ exports.ResizeElementHandler = ResizeElementHandler = __decorate([
141
+ (0, inversify_1.injectable)()
150
142
  ], ResizeElementHandler);
151
- //# sourceMappingURL=resize-key-handler.js.map
143
+ //# sourceMappingURL=resize-handler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resize-handler.js","sourceRoot":"","sources":["../../../../src/features/change-bounds/resize/resize-handler.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;;;;AAElF,mDAc+B;AAC/B,yCAAwE;AACxE,mCAAiD;AACjD,iFAA4E;AAG5E,4DAA2I;AAC3I,8DAA4F;AAC5F,0CAAuC;AAEvC,IAAY,UAIX;AAJD,WAAY,UAAU;IAClB,mDAAQ,CAAA;IACR,mDAAQ,CAAA;IACR,iDAAO,CAAA;AACX,CAAC,EAJW,UAAU,0BAAV,UAAU,QAIrB;AAUD,IAAiB,mBAAmB,CAUnC;AAVD,WAAiB,mBAAmB;IACnB,wBAAI,GAAG,qBAAqB,CAAC;IAE1C,SAAgB,EAAE,CAAC,MAAW;QAC1B,OAAO,gBAAM,CAAC,OAAO,CAAC,MAAM,EAAE,oBAAA,IAAI,CAAC,CAAC;IACxC,CAAC;IAFe,sBAAE,KAEjB,CAAA;IAED,SAAgB,MAAM,CAAC,UAAoB,EAAE,UAAsB;QAC/D,OAAO,EAAE,IAAI,EAAE,oBAAA,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC;IAClD,CAAC;IAFe,0BAAM,SAErB,CAAA;AACL,CAAC,EAVgB,mBAAmB,mCAAnB,mBAAmB,QAUnC;AAED;;;GAGG;AAEI,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAA1B;QASO,SAAI,GAAS,WAAI,CAAC,OAAO,CAAC;IAiExC,CAAC;IAxDa,IAAI;QACV,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,kBAAkB,CAAC,aAAa,EAAE,CAAC;IAClE,CAAC;IAED,MAAM,CAAC,MAAc;QACjB,IAAI,mBAAmB,CAAC,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;AA1EY,oDAAoB;AAEnB;IADT,IAAA,kBAAM,EAAC,6CAAoB,CAAC;8BACG,6CAAoB;kEAAC;AAE3C;IADT,IAAA,kBAAM,EAAC,eAAK,CAAC,iBAAiB,CAAC;;wDACQ;AAE9B;IADT,IAAA,kBAAM,EAAC,eAAK,CAAC,yBAAyB,CAAC;;gEACgB;AAG9C;IAFT,IAAA,kBAAM,EAAC,eAAK,CAAC,IAAI,CAAC;IAClB,IAAA,oBAAQ,GAAE;;kDACyB;AAGjB;IAFlB,IAAA,kBAAM,EAAC,eAAK,CAAC,QAAQ,CAAC;IACtB,IAAA,oBAAQ,GAAE;;qDAC2B;AAM5B;IADT,IAAA,yBAAa,GAAE;;;;gDAGf;+BApBQ,oBAAoB;IADhC,IAAA,sBAAU,GAAE;GACA,oBAAoB,CA0EhC"}
@@ -13,10 +13,15 @@
13
13
  *
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
- import { BindingContext, FeatureModule } from '@eclipse-glsp/sprotty';
16
+ import { FeatureModule } from '@eclipse-glsp/sprotty';
17
17
  /**
18
18
  * Handles resize actions.
19
19
  */
20
- export declare const resizeKeyModule: FeatureModule;
21
- export declare function configureResizeTools(context: BindingContext): void;
22
- //# sourceMappingURL=resize-key-module.d.ts.map
20
+ export declare const resizeModule: FeatureModule;
21
+ /**
22
+ * Feature module that is intended for the standalone deployment of GLSP (i.e. plain webapp)
23
+ * When integrated into an application frame (e.g Theia/VS Code) this module is typically omitted and/or replaced
24
+ * with an application native module.
25
+ */
26
+ export declare const standaloneResizeModule: FeatureModule;
27
+ //# sourceMappingURL=resize-module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resize-module.d.ts","sourceRoot":"","sources":["../../../../src/features/change-bounds/resize/resize-module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,aAAa,EAAgD,MAAM,uBAAuB,CAAC;AAKpG;;GAEG;AACH,eAAO,MAAM,YAAY,eAMxB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,eAUlC,CAAC"}
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ /********************************************************************************
3
+ * Copyright (c) 2023-2024 Business Informatics Group (TU Wien) and others.
4
+ *
5
+ * This program and the accompanying materials are made available under the
6
+ * terms of the Eclipse Public License v. 2.0 which is available at
7
+ * http://www.eclipse.org/legal/epl-2.0.
8
+ *
9
+ * This Source Code may also be made available under the following Secondary
10
+ * Licenses when the conditions for such availability set forth in the Eclipse
11
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ * with the GNU Classpath Exception which is available at
13
+ * https://www.gnu.org/software/classpath/license.html.
14
+ *
15
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16
+ ********************************************************************************/
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.standaloneResizeModule = exports.resizeModule = void 0;
19
+ const sprotty_1 = require("@eclipse-glsp/sprotty");
20
+ const resize_default_tool_1 = require("./resize-default-tool");
21
+ const resize_handler_1 = require("./resize-handler");
22
+ const resize_tool_1 = require("./resize-tool");
23
+ /**
24
+ * Handles resize actions.
25
+ */
26
+ exports.resizeModule = new sprotty_1.FeatureModule((bind, unbind, isBound, rebind) => {
27
+ const context = { bind, unbind, isBound, rebind };
28
+ (0, sprotty_1.configureActionHandler)(context, resize_handler_1.ResizeElementAction.KIND, resize_handler_1.ResizeElementHandler);
29
+ }, { featureId: Symbol('resize') });
30
+ /**
31
+ * Feature module that is intended for the standalone deployment of GLSP (i.e. plain webapp)
32
+ * When integrated into an application frame (e.g Theia/VS Code) this module is typically omitted and/or replaced
33
+ * with an application native module.
34
+ */
35
+ exports.standaloneResizeModule = new sprotty_1.FeatureModule((bind, unbind, isBound, rebind) => {
36
+ const context = { bind, unbind, isBound, rebind };
37
+ (0, sprotty_1.bindAsService)(context, sprotty_1.TYPES.IDefaultTool, resize_default_tool_1.DefaultResizeKeyTool);
38
+ context.bind(resize_default_tool_1.DefaultResizeKeyListener).toSelf();
39
+ (0, sprotty_1.bindAsService)(context, sprotty_1.TYPES.ITool, resize_tool_1.ResizeKeyTool);
40
+ context.bind(resize_tool_1.ResizeKeyListener).toSelf();
41
+ }, { featureId: Symbol('standaloneResize'), requires: exports.resizeModule });
42
+ //# sourceMappingURL=resize-module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resize-module.js","sourceRoot":"","sources":["../../../../src/features/change-bounds/resize/resize-module.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAElF,mDAAoG;AACpG,+DAAuF;AACvF,qDAA6E;AAC7E,+CAAiE;AAEjE;;GAEG;AACU,QAAA,YAAY,GAAG,IAAI,uBAAa,CACzC,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE;IAC9B,MAAM,OAAO,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAClD,IAAA,gCAAsB,EAAC,OAAO,EAAE,oCAAmB,CAAC,IAAI,EAAE,qCAAoB,CAAC,CAAC;AACpF,CAAC,EACD,EAAE,SAAS,EAAE,MAAM,CAAC,QAAQ,CAAC,EAAE,CAClC,CAAC;AAEF;;;;GAIG;AACU,QAAA,sBAAsB,GAAG,IAAI,uBAAa,CACnD,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE;IAC9B,MAAM,OAAO,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAElD,IAAA,uBAAa,EAAC,OAAO,EAAE,eAAK,CAAC,YAAY,EAAE,0CAAoB,CAAC,CAAC;IACjE,OAAO,CAAC,IAAI,CAAC,8CAAwB,CAAC,CAAC,MAAM,EAAE,CAAC;IAChD,IAAA,uBAAa,EAAC,OAAO,EAAE,eAAK,CAAC,KAAK,EAAE,2BAAa,CAAC,CAAC;IACnD,OAAO,CAAC,IAAI,CAAC,+BAAiB,CAAC,CAAC,MAAM,EAAE,CAAC;AAC7C,CAAC,EACD,EAAE,SAAS,EAAE,MAAM,CAAC,kBAAkB,CAAC,EAAE,QAAQ,EAAE,oBAAY,EAAE,CACpE,CAAC"}
@@ -0,0 +1,37 @@
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 { SelectionService } from '../../../base/selection-service';
18
+ import type { ShortcutManager } from '../../../base/shortcuts/shortcuts-manager';
19
+ import { BaseEditTool } from '../../tools/base-tools';
20
+ export declare class ResizeKeyListener extends KeyListener {
21
+ protected readonly selectionService: SelectionService;
22
+ keyDown(element: GModelElement, event: KeyboardEvent): Action[];
23
+ enable(): Action[];
24
+ disable(): Action[];
25
+ protected matchesIncreaseSizeKeystroke(event: KeyboardEvent): boolean;
26
+ protected matchesMinSizeKeystroke(event: KeyboardEvent): boolean;
27
+ protected matchesDecreaseSizeKeystroke(event: KeyboardEvent): boolean;
28
+ }
29
+ export declare class ResizeKeyTool extends BaseEditTool {
30
+ static ID: string;
31
+ static TOKEN: symbol;
32
+ get id(): string;
33
+ protected readonly shortcutManager: ShortcutManager;
34
+ protected readonly keyListener: ResizeKeyListener;
35
+ enable(): void;
36
+ }
37
+ //# sourceMappingURL=resize-tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resize-tool.d.ts","sourceRoot":"","sources":["../../../../src/features/change-bounds/resize/resize-tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,WAAW,EAA2B,KAAK,MAAM,EAAE,KAAK,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAG9G,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAC;AAGjF,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAItD,qBACa,iBAAkB,SAAQ,WAAW;IAE9C,SAAS,CAAC,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAE7C,OAAO,CAAC,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,GAAG,MAAM,EAAE;IAmBxE,MAAM,IAAI,MAAM,EAAE;IASlB,OAAO,IAAI,MAAM,EAAE;IASnB,SAAS,CAAC,4BAA4B,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO;IAKrE,SAAS,CAAC,uBAAuB,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO;IAIhE,SAAS,CAAC,4BAA4B,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO;CAGxE;AAED,qBACa,aAAc,SAAQ,YAAY;IAC3C,MAAM,CAAC,EAAE,SAA0B;IACnC,MAAM,CAAC,KAAK,SAAkC;IAE9C,IAAI,EAAE,IAAI,MAAM,CAEf;IAGD,SAAS,CAAC,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;IAEpD,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,iBAAiB,CAAC;IAElD,MAAM,IAAI,IAAI;CAgBjB"}
@@ -0,0 +1,123 @@
1
+ "use strict";
2
+ /********************************************************************************
3
+ * Copyright (c) 2025 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
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
22
+ };
23
+ var __metadata = (this && this.__metadata) || function (k, v) {
24
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
25
+ };
26
+ var ResizeKeyTool_1;
27
+ Object.defineProperty(exports, "__esModule", { value: true });
28
+ exports.ResizeKeyTool = exports.ResizeKeyListener = void 0;
29
+ const sprotty_1 = require("@eclipse-glsp/sprotty");
30
+ const inversify_1 = require("inversify");
31
+ const vscode_jsonrpc_1 = require("vscode-jsonrpc");
32
+ const selection_service_1 = require("../../../base/selection-service");
33
+ const messages = require("../../accessibility/toast/messages.json");
34
+ const toast_handler_1 = require("../../accessibility/toast/toast-handler");
35
+ const base_tools_1 = require("../../tools/base-tools");
36
+ const model_1 = require("../model");
37
+ const resize_handler_1 = require("./resize-handler");
38
+ let ResizeKeyListener = class ResizeKeyListener extends sprotty_1.KeyListener {
39
+ keyDown(element, event) {
40
+ const actions = [];
41
+ const selectedElementsIds = this.selectionService
42
+ .getSelectedElements()
43
+ .filter(model_1.isResizable)
44
+ .map(e => e.id);
45
+ if (selectedElementsIds.length > 0) {
46
+ if (this.matchesIncreaseSizeKeystroke(event)) {
47
+ actions.push(resize_handler_1.ResizeElementAction.create(selectedElementsIds, resize_handler_1.ResizeType.Increase));
48
+ }
49
+ else if (this.matchesDecreaseSizeKeystroke(event)) {
50
+ actions.push(resize_handler_1.ResizeElementAction.create(selectedElementsIds, resize_handler_1.ResizeType.Decrease));
51
+ }
52
+ else if (this.matchesMinSizeKeystroke(event)) {
53
+ actions.push(resize_handler_1.ResizeElementAction.create(selectedElementsIds, resize_handler_1.ResizeType.MinSize));
54
+ }
55
+ }
56
+ return actions;
57
+ }
58
+ enable() {
59
+ return [
60
+ toast_handler_1.ShowToastMessageAction.create({
61
+ id: ResizeKeyTool.TOKEN,
62
+ message: messages.resize.resize_mode_activated
63
+ })
64
+ ];
65
+ }
66
+ disable() {
67
+ return [
68
+ toast_handler_1.ShowToastMessageAction.createWithTimeout({
69
+ id: ResizeKeyTool.TOKEN,
70
+ message: messages.resize.resize_mode_deactivated
71
+ })
72
+ ];
73
+ }
74
+ matchesIncreaseSizeKeystroke(event) {
75
+ /** here event.key is used for '+', as keycode 187 is already declared for 'Equals' in {@link matchesKeystroke}.*/
76
+ return event.key === '+' || (0, sprotty_1.matchesKeystroke)(event, 'NumpadAdd');
77
+ }
78
+ matchesMinSizeKeystroke(event) {
79
+ return (0, sprotty_1.matchesKeystroke)(event, 'Digit0', 'ctrl') || (0, sprotty_1.matchesKeystroke)(event, 'Numpad0', 'ctrl');
80
+ }
81
+ matchesDecreaseSizeKeystroke(event) {
82
+ return (0, sprotty_1.matchesKeystroke)(event, 'Minus') || (0, sprotty_1.matchesKeystroke)(event, 'NumpadSubtract');
83
+ }
84
+ };
85
+ exports.ResizeKeyListener = ResizeKeyListener;
86
+ __decorate([
87
+ (0, inversify_1.inject)(selection_service_1.SelectionService),
88
+ __metadata("design:type", selection_service_1.SelectionService)
89
+ ], ResizeKeyListener.prototype, "selectionService", void 0);
90
+ exports.ResizeKeyListener = ResizeKeyListener = __decorate([
91
+ (0, inversify_1.injectable)()
92
+ ], ResizeKeyListener);
93
+ let ResizeKeyTool = ResizeKeyTool_1 = class ResizeKeyTool extends base_tools_1.BaseEditTool {
94
+ get id() {
95
+ return ResizeKeyTool_1.ID;
96
+ }
97
+ enable() {
98
+ this.dispatchActions(this.keyListener.enable());
99
+ this.toDisposeOnDisable.push(this.keyTool.registerListener(this.keyListener), this.shortcutManager.register(ResizeKeyTool_1.TOKEN, [
100
+ { shortcuts: ['Escape'], description: 'Deactivate resize handler ', group: 'Resize', position: 0 },
101
+ { shortcuts: ['+'], description: 'Increase size of element', group: 'Resize', position: 1 },
102
+ { shortcuts: ['-'], description: 'Increase size of element', group: 'Resize', position: 2 },
103
+ { shortcuts: ['CTRL', '0'], description: 'Set element size to default', group: 'Resize', position: 3 }
104
+ ]), vscode_jsonrpc_1.Disposable.create(() => {
105
+ this.dispatchActions(this.keyListener.disable());
106
+ }));
107
+ }
108
+ };
109
+ exports.ResizeKeyTool = ResizeKeyTool;
110
+ ResizeKeyTool.ID = 'glsp.resize-key-tool';
111
+ ResizeKeyTool.TOKEN = Symbol.for(ResizeKeyTool_1.name);
112
+ __decorate([
113
+ (0, inversify_1.inject)(sprotty_1.TYPES.IShortcutManager),
114
+ __metadata("design:type", Function)
115
+ ], ResizeKeyTool.prototype, "shortcutManager", void 0);
116
+ __decorate([
117
+ (0, inversify_1.inject)(ResizeKeyListener),
118
+ __metadata("design:type", ResizeKeyListener)
119
+ ], ResizeKeyTool.prototype, "keyListener", void 0);
120
+ exports.ResizeKeyTool = ResizeKeyTool = ResizeKeyTool_1 = __decorate([
121
+ (0, inversify_1.injectable)()
122
+ ], ResizeKeyTool);
123
+ //# sourceMappingURL=resize-tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resize-tool.js","sourceRoot":"","sources":["../../../../src/features/change-bounds/resize/resize-tool.ts"],"names":[],"mappings":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EAC/C,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,eAAa,CAAC,KAAK,EAAE;YAC/C,EAAE,SAAS,EAAE,CAAC,QAAQ,CAAC,EAAE,WAAW,EAAE,4BAA4B,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,EAAE;YAClG,EAAE,SAAS,EAAE,CAAC,GAAG,CAAC,EAAE,WAAW,EAAE,0BAA0B,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,EAAE;YAC3F,EAAE,SAAS,EAAE,CAAC,GAAG,CAAC,EAAE,WAAW,EAAE,0BAA0B,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,EAAE;YAC3F,EAAE,SAAS,EAAE,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,WAAW,EAAE,6BAA6B,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,EAAE;SACzG,CAAC,EACF,2BAAU,CAAC,MAAM,CAAC,GAAG,EAAE;YACnB,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC,CAAC;QACrD,CAAC,CAAC,CACL,CAAC;IACN,CAAC;;AA5BQ,sCAAa;AACf,gBAAE,GAAG,sBAAsB,AAAzB,CAA0B;AAC5B,mBAAK,GAAG,MAAM,CAAC,GAAG,CAAC,eAAa,CAAC,IAAI,CAAC,AAAjC,CAAkC;AAO3B;IADlB,IAAA,kBAAM,EAAC,eAAK,CAAC,gBAAgB,CAAC;;sDACqB;AAEjC;IADlB,IAAA,kBAAM,EAAC,iBAAiB,CAAC;8BACM,iBAAiB;kDAAC;wBAXzC,aAAa;IADzB,IAAA,sBAAU,GAAE;GACA,aAAa,CA6BzB"}
@@ -27,6 +27,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
27
27
  exports.GridManager = void 0;
28
28
  const sprotty_1 = require("@eclipse-glsp/sprotty");
29
29
  const inversify_1 = require("inversify");
30
+ const grid_1 = require("./grid");
30
31
  const grid_model_1 = require("./grid-model");
31
32
  /**
32
33
  * The default {@link IGridManager} implementation.
@@ -1 +1 @@
1
- {"version":3,"file":"grid-manager.js","sourceRoot":"","sources":["../../../src/features/grid/grid-manager.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;;;;AAElF,mDAAgF;AAChF,yCAA8D;AAI9D,6CAA8C;AAe9C;;;GAGG;AAEI,IAAM,WAAW,GAAjB,MAAM,WAAW;IAAjB;QACO,iBAAY,GAAY,KAAK,CAAC;IAmC5C,CAAC;IA1BG,IAAI,aAAa;QACb,OAAO,IAAI,CAAC,YAAY,CAAC;IAC7B,CAAC;IAGS,IAAI;QACV,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,kBAAkB,CAAC,aAAa,EAAE,CAAC;IAChE,CAAC;IAED,MAAM,CAAC,MAAsB;QACzB,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACrC,CAAC;IAED,cAAc,CAAC,OAAgB;QAC3B,IAAI,IAAI,CAAC,YAAY,IAAI,CAAC,OAAO,EAAE,CAAC;YAChC,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;YAC1B,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC;QAChC,CAAC;aAAM,IAAI,CAAC,IAAI,CAAC,YAAY,IAAI,OAAO,EAAE,CAAC;YACvC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;YACzB,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,2BAAc,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,2BAAc,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;QAClH,CAAC;IACL,CAAC;IAED,iBAAiB;QACb,IAAI,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAC5C,CAAC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,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;QAClH,CAAC;IACL,CAAC;IAED,iBAAiB;QACb,IAAI,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAC5C,CAAC;CACJ,CAAA;AApCY,kCAAW;AAKV;IADT,IAAA,kBAAM,EAAC,eAAK,CAAC,yBAAyB,CAAC;;uDACgB;AAGxC;IADf,IAAA,kBAAM,EAAC,eAAK,CAAC,IAAI,CAAC;;yCACQ;AAOjB;IADT,IAAA,yBAAa,GAAE;;;;uCAGf;sBAjBQ,WAAW;IADvB,IAAA,sBAAU,GAAE;GACA,WAAW,CAoCvB"}
@@ -1 +1 @@
1
- {"version":3,"file":"grid-module.d.ts","sourceRoot":"","sources":["../../../src/features/grid/grid-module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,aAAa,EAAkE,MAAM,uBAAuB,CAAC;AACtH,OAAO,uBAAuB,CAAC;AAK/B,eAAO,MAAM,UAAU,eActB,CAAC"}
1
+ {"version":3,"file":"grid-module.d.ts","sourceRoot":"","sources":["../../../src/features/grid/grid-module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,aAAa,EAAkE,MAAM,uBAAuB,CAAC;AACtH,OAAO,uBAAuB,CAAC;AAM/B,eAAO,MAAM,UAAU,eActB,CAAC"}
@@ -18,12 +18,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.gridModule = void 0;
19
19
  const sprotty_1 = require("@eclipse-glsp/sprotty");
20
20
  require("../../../css/grid.css");
21
+ const grid_1 = require("./grid");
21
22
  const grid_manager_1 = require("./grid-manager");
22
23
  const grid_model_1 = require("./grid-model");
23
24
  const grid_snapper_1 = require("./grid-snapper");
24
25
  exports.gridModule = new sprotty_1.FeatureModule((bind, unbind, isBound, rebind) => {
25
26
  const context = { bind, unbind, isBound, rebind };
26
- bind(sprotty_1.TYPES.Grid).toConstantValue({ x: 10, y: 10 });
27
+ bind(sprotty_1.TYPES.Grid).toConstantValue(grid_1.Grid.DEFAULT);
27
28
  (0, sprotty_1.configureCommand)(context, grid_model_1.ShowGridCommand);
28
29
  (0, sprotty_1.bindAsService)(context, sprotty_1.TYPES.IGridManager, grid_manager_1.GridManager);
29
30
  (0, sprotty_1.configureActionHandler)(context, grid_model_1.ShowGridAction.KIND, grid_manager_1.GridManager);