@eclipse-glsp/client 2.1.0-next.301 → 2.1.0-next.303

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 (433) hide show
  1. package/css/glsp-sprotty.css +1 -0
  2. package/css/helper-lines.css +33 -0
  3. package/lib/base/auto-complete/index.d.ts +21 -0
  4. package/lib/base/auto-complete/index.d.ts.map +1 -0
  5. package/lib/base/auto-complete/index.js +37 -0
  6. package/lib/base/auto-complete/index.js.map +1 -0
  7. package/lib/base/feedback/index.d.ts +20 -0
  8. package/lib/base/feedback/index.d.ts.map +1 -0
  9. package/lib/base/feedback/index.js +36 -0
  10. package/lib/base/feedback/index.js.map +1 -0
  11. package/lib/base/focus/index.d.ts +18 -0
  12. package/lib/base/focus/index.d.ts.map +1 -0
  13. package/lib/base/focus/index.js +34 -0
  14. package/lib/base/focus/index.js.map +1 -0
  15. package/lib/base/index.d.ts +32 -0
  16. package/lib/base/index.d.ts.map +1 -0
  17. package/lib/base/index.js +48 -0
  18. package/lib/base/index.js.map +1 -0
  19. package/lib/base/model/index.d.ts +20 -0
  20. package/lib/base/model/index.d.ts.map +1 -0
  21. package/lib/base/model/index.js +36 -0
  22. package/lib/base/model/index.js.map +1 -0
  23. package/lib/base/tool-manager/index.d.ts +18 -0
  24. package/lib/base/tool-manager/index.d.ts.map +1 -0
  25. package/lib/base/tool-manager/index.js +34 -0
  26. package/lib/base/tool-manager/index.js.map +1 -0
  27. package/lib/base/view/index.d.ts +19 -0
  28. package/lib/base/view/index.d.ts.map +1 -0
  29. package/lib/base/view/index.js +35 -0
  30. package/lib/base/view/index.js.map +1 -0
  31. package/lib/default-modules.js +4 -4
  32. package/lib/default-modules.js.map +1 -1
  33. package/lib/features/accessibility/edge-autocomplete/index.d.ts +20 -0
  34. package/lib/features/accessibility/edge-autocomplete/index.d.ts.map +1 -0
  35. package/lib/features/accessibility/edge-autocomplete/index.js +36 -0
  36. package/lib/features/accessibility/edge-autocomplete/index.js.map +1 -0
  37. package/lib/features/accessibility/element-navigation/index.d.ts +22 -0
  38. package/lib/features/accessibility/element-navigation/index.d.ts.map +1 -0
  39. package/lib/features/accessibility/element-navigation/index.js +38 -0
  40. package/lib/features/accessibility/element-navigation/index.js.map +1 -0
  41. package/lib/features/accessibility/focus-tracker/index.d.ts +18 -0
  42. package/lib/features/accessibility/focus-tracker/index.d.ts.map +1 -0
  43. package/lib/features/accessibility/focus-tracker/index.js +34 -0
  44. package/lib/features/accessibility/focus-tracker/index.js.map +1 -0
  45. package/lib/features/accessibility/index.d.ts +31 -0
  46. package/lib/features/accessibility/index.d.ts.map +1 -0
  47. package/lib/features/accessibility/index.js +47 -0
  48. package/lib/features/accessibility/index.js.map +1 -0
  49. package/lib/features/accessibility/key-shortcut/index.d.ts +19 -0
  50. package/lib/features/accessibility/key-shortcut/index.d.ts.map +1 -0
  51. package/lib/features/accessibility/key-shortcut/index.js +35 -0
  52. package/lib/features/accessibility/key-shortcut/index.js.map +1 -0
  53. package/lib/features/accessibility/keyboard-grid/index.d.ts +21 -0
  54. package/lib/features/accessibility/keyboard-grid/index.d.ts.map +1 -0
  55. package/lib/features/accessibility/keyboard-grid/index.js +37 -0
  56. package/lib/features/accessibility/keyboard-grid/index.js.map +1 -0
  57. package/lib/features/accessibility/keyboard-pointer/index.d.ts +22 -0
  58. package/lib/features/accessibility/keyboard-pointer/index.d.ts.map +1 -0
  59. package/lib/features/accessibility/keyboard-pointer/index.js +38 -0
  60. package/lib/features/accessibility/keyboard-pointer/index.js.map +1 -0
  61. package/lib/features/accessibility/keyboard-tool-palette/index.d.ts +18 -0
  62. package/lib/features/accessibility/keyboard-tool-palette/index.d.ts.map +1 -0
  63. package/lib/features/accessibility/keyboard-tool-palette/index.js +34 -0
  64. package/lib/features/accessibility/keyboard-tool-palette/index.js.map +1 -0
  65. package/lib/features/accessibility/move-zoom/index.d.ts +19 -0
  66. package/lib/features/accessibility/move-zoom/index.d.ts.map +1 -0
  67. package/lib/features/accessibility/move-zoom/index.js +35 -0
  68. package/lib/features/accessibility/move-zoom/index.js.map +1 -0
  69. package/lib/features/accessibility/resize-key-tool/index.d.ts +19 -0
  70. package/lib/features/accessibility/resize-key-tool/index.d.ts.map +1 -0
  71. package/lib/features/accessibility/resize-key-tool/index.js +35 -0
  72. package/lib/features/accessibility/resize-key-tool/index.js.map +1 -0
  73. package/lib/features/accessibility/search/index.d.ts +19 -0
  74. package/lib/features/accessibility/search/index.d.ts.map +1 -0
  75. package/lib/features/accessibility/search/index.js +35 -0
  76. package/lib/features/accessibility/search/index.js.map +1 -0
  77. package/lib/features/accessibility/toast/index.d.ts +19 -0
  78. package/lib/features/accessibility/toast/index.d.ts.map +1 -0
  79. package/lib/features/accessibility/toast/index.js +35 -0
  80. package/lib/features/accessibility/toast/index.js.map +1 -0
  81. package/lib/features/accessibility/view-key-tools/index.d.ts +20 -0
  82. package/lib/features/accessibility/view-key-tools/index.d.ts.map +1 -0
  83. package/lib/features/accessibility/view-key-tools/index.js +36 -0
  84. package/lib/features/accessibility/view-key-tools/index.js.map +1 -0
  85. package/lib/features/accessibility/view-key-tools/movement-key-tool.d.ts +6 -3
  86. package/lib/features/accessibility/view-key-tools/movement-key-tool.d.ts.map +1 -1
  87. package/lib/features/accessibility/view-key-tools/movement-key-tool.js +12 -17
  88. package/lib/features/accessibility/view-key-tools/movement-key-tool.js.map +1 -1
  89. package/lib/features/bounds/bounds-module.d.ts.map +1 -1
  90. package/lib/features/bounds/bounds-module.js +3 -1
  91. package/lib/features/bounds/bounds-module.js.map +1 -1
  92. package/lib/features/bounds/index.d.ts +24 -0
  93. package/lib/features/bounds/index.d.ts.map +1 -0
  94. package/lib/features/bounds/index.js +40 -0
  95. package/lib/features/bounds/index.js.map +1 -0
  96. package/lib/features/bounds/local-bounds.d.ts +2 -1
  97. package/lib/features/bounds/local-bounds.d.ts.map +1 -1
  98. package/lib/features/bounds/local-bounds.js +7 -0
  99. package/lib/features/bounds/local-bounds.js.map +1 -1
  100. package/lib/features/bounds/set-bounds-feedback-command.d.ts +1 -1
  101. package/lib/features/bounds/set-bounds-feedback-command.d.ts.map +1 -1
  102. package/lib/features/bounds/set-bounds-feedback-command.js +7 -7
  103. package/lib/features/bounds/set-bounds-feedback-command.js.map +1 -1
  104. package/lib/features/change-bounds/index.d.ts +21 -0
  105. package/lib/features/change-bounds/index.d.ts.map +1 -0
  106. package/lib/features/change-bounds/index.js +37 -0
  107. package/lib/features/change-bounds/index.js.map +1 -0
  108. package/lib/features/change-bounds/model.d.ts +4 -0
  109. package/lib/features/change-bounds/model.d.ts.map +1 -1
  110. package/lib/features/change-bounds/model.js +14 -2
  111. package/lib/features/change-bounds/model.js.map +1 -1
  112. package/lib/features/change-bounds/point-position-updater.d.ts +63 -0
  113. package/lib/features/change-bounds/point-position-updater.d.ts.map +1 -0
  114. package/lib/features/change-bounds/point-position-updater.js +87 -0
  115. package/lib/features/change-bounds/point-position-updater.js.map +1 -0
  116. package/lib/features/change-bounds/position-snapper.d.ts +28 -0
  117. package/lib/features/change-bounds/position-snapper.d.ts.map +1 -0
  118. package/lib/features/change-bounds/position-snapper.js +88 -0
  119. package/lib/features/change-bounds/position-snapper.js.map +1 -0
  120. package/lib/features/change-bounds/snap.d.ts +19 -42
  121. package/lib/features/change-bounds/snap.d.ts.map +1 -1
  122. package/lib/features/change-bounds/snap.js +9 -92
  123. package/lib/features/change-bounds/snap.js.map +1 -1
  124. package/lib/features/change-bounds/snap.spec.js +6 -5
  125. package/lib/features/change-bounds/snap.spec.js.map +1 -1
  126. package/lib/features/command-palette/index.d.ts +19 -0
  127. package/lib/features/command-palette/index.d.ts.map +1 -0
  128. package/lib/features/command-palette/index.js +35 -0
  129. package/lib/features/command-palette/index.js.map +1 -0
  130. package/lib/features/context-menu/index.d.ts +20 -0
  131. package/lib/features/context-menu/index.d.ts.map +1 -0
  132. package/lib/features/context-menu/index.js +36 -0
  133. package/lib/features/context-menu/index.js.map +1 -0
  134. package/lib/features/copy-paste/index.d.ts +20 -0
  135. package/lib/features/copy-paste/index.d.ts.map +1 -0
  136. package/lib/features/copy-paste/index.js +36 -0
  137. package/lib/features/copy-paste/index.js.map +1 -0
  138. package/lib/features/decoration/index.d.ts +18 -0
  139. package/lib/features/decoration/index.d.ts.map +1 -0
  140. package/lib/features/decoration/index.js +34 -0
  141. package/lib/features/decoration/index.js.map +1 -0
  142. package/lib/features/element-template/index.d.ts +20 -0
  143. package/lib/features/element-template/index.d.ts.map +1 -0
  144. package/lib/features/element-template/index.js +36 -0
  145. package/lib/features/element-template/index.js.map +1 -0
  146. package/lib/features/element-template/mouse-tracking-element-position-listener.d.ts +6 -3
  147. package/lib/features/element-template/mouse-tracking-element-position-listener.d.ts.map +1 -1
  148. package/lib/features/element-template/mouse-tracking-element-position-listener.js +23 -18
  149. package/lib/features/element-template/mouse-tracking-element-position-listener.js.map +1 -1
  150. package/lib/features/export/index.d.ts +19 -0
  151. package/lib/features/export/index.d.ts.map +1 -0
  152. package/lib/features/export/index.js +35 -0
  153. package/lib/features/export/index.js.map +1 -0
  154. package/lib/features/helper-lines/helper-line-feedback.d.ts +64 -0
  155. package/lib/features/helper-lines/helper-line-feedback.d.ts.map +1 -0
  156. package/lib/features/helper-lines/helper-line-feedback.js +218 -0
  157. package/lib/features/helper-lines/helper-line-feedback.js.map +1 -0
  158. package/lib/features/helper-lines/helper-line-manager-default.d.ts +46 -0
  159. package/lib/features/helper-lines/helper-line-manager-default.d.ts.map +1 -0
  160. package/lib/features/helper-lines/helper-line-manager-default.js +122 -0
  161. package/lib/features/helper-lines/helper-line-manager-default.js.map +1 -0
  162. package/lib/features/helper-lines/helper-line-manager.d.ts +21 -0
  163. package/lib/features/helper-lines/helper-line-manager.d.ts.map +1 -0
  164. package/lib/features/helper-lines/helper-line-manager.js +3 -0
  165. package/lib/features/helper-lines/helper-line-manager.js.map +1 -0
  166. package/lib/features/helper-lines/helper-line-module.d.ts +18 -0
  167. package/lib/features/helper-lines/helper-line-module.d.ts.map +1 -0
  168. package/lib/features/helper-lines/helper-line-module.js +39 -0
  169. package/lib/features/helper-lines/helper-line-module.js.map +1 -0
  170. package/lib/features/helper-lines/index.d.ts +22 -0
  171. package/lib/features/helper-lines/index.d.ts.map +1 -0
  172. package/lib/features/helper-lines/index.js +38 -0
  173. package/lib/features/helper-lines/index.js.map +1 -0
  174. package/lib/features/helper-lines/model.d.ts +62 -0
  175. package/lib/features/helper-lines/model.d.ts.map +1 -0
  176. package/lib/features/helper-lines/model.js +123 -0
  177. package/lib/features/helper-lines/model.js.map +1 -0
  178. package/lib/features/helper-lines/view.d.ts +25 -0
  179. package/lib/features/helper-lines/view.d.ts.map +1 -0
  180. package/lib/features/helper-lines/view.js +52 -0
  181. package/lib/features/helper-lines/view.js.map +1 -0
  182. package/lib/features/hints/index.d.ts +19 -0
  183. package/lib/features/hints/index.d.ts.map +1 -0
  184. package/lib/features/hints/index.js +35 -0
  185. package/lib/features/hints/index.js.map +1 -0
  186. package/lib/features/hover/index.d.ts +18 -0
  187. package/lib/features/hover/index.d.ts.map +1 -0
  188. package/lib/features/hover/index.js +34 -0
  189. package/lib/features/hover/index.js.map +1 -0
  190. package/lib/features/index.d.ts +43 -0
  191. package/lib/features/index.d.ts.map +1 -0
  192. package/lib/features/index.js +59 -0
  193. package/lib/features/index.js.map +1 -0
  194. package/lib/features/label-edit/index.d.ts +19 -0
  195. package/lib/features/label-edit/index.d.ts.map +1 -0
  196. package/lib/features/label-edit/index.js +35 -0
  197. package/lib/features/label-edit/index.js.map +1 -0
  198. package/lib/features/layout/index.d.ts +18 -0
  199. package/lib/features/layout/index.d.ts.map +1 -0
  200. package/lib/features/layout/index.js +34 -0
  201. package/lib/features/layout/index.js.map +1 -0
  202. package/lib/features/navigation/index.d.ts +19 -0
  203. package/lib/features/navigation/index.d.ts.map +1 -0
  204. package/lib/features/navigation/index.js +35 -0
  205. package/lib/features/navigation/index.js.map +1 -0
  206. package/lib/features/reconnect/index.d.ts +17 -0
  207. package/lib/features/reconnect/index.d.ts.map +1 -0
  208. package/lib/features/reconnect/index.js +33 -0
  209. package/lib/features/reconnect/index.js.map +1 -0
  210. package/lib/features/routing/index.d.ts +18 -0
  211. package/lib/features/routing/index.d.ts.map +1 -0
  212. package/lib/features/routing/index.js +34 -0
  213. package/lib/features/routing/index.js.map +1 -0
  214. package/lib/features/save/index.d.ts +18 -0
  215. package/lib/features/save/index.d.ts.map +1 -0
  216. package/lib/features/save/index.js +34 -0
  217. package/lib/features/save/index.js.map +1 -0
  218. package/lib/features/select/index.d.ts +19 -0
  219. package/lib/features/select/index.d.ts.map +1 -0
  220. package/lib/features/select/index.js +35 -0
  221. package/lib/features/select/index.js.map +1 -0
  222. package/lib/features/source-model-watcher/index.d.ts +18 -0
  223. package/lib/features/source-model-watcher/index.d.ts.map +1 -0
  224. package/lib/features/source-model-watcher/index.js +34 -0
  225. package/lib/features/source-model-watcher/index.js.map +1 -0
  226. package/lib/features/source-model-watcher/{source-model-wacher-module.d.ts → source-model-watcher-module.d.ts} +1 -1
  227. package/lib/features/source-model-watcher/source-model-watcher-module.d.ts.map +1 -0
  228. package/lib/features/source-model-watcher/{source-model-wacher-module.js → source-model-watcher-module.js} +1 -1
  229. package/lib/features/source-model-watcher/source-model-watcher-module.js.map +1 -0
  230. package/lib/features/status/index.d.ts +18 -0
  231. package/lib/features/status/index.d.ts.map +1 -0
  232. package/lib/features/status/index.js +34 -0
  233. package/lib/features/status/index.js.map +1 -0
  234. package/lib/features/svg-metadata/index.d.ts +18 -0
  235. package/lib/features/svg-metadata/index.d.ts.map +1 -0
  236. package/lib/features/svg-metadata/index.js +34 -0
  237. package/lib/features/svg-metadata/index.js.map +1 -0
  238. package/lib/features/tool-palette/index.d.ts +18 -0
  239. package/lib/features/tool-palette/index.d.ts.map +1 -0
  240. package/lib/features/tool-palette/index.js +34 -0
  241. package/lib/features/tool-palette/index.js.map +1 -0
  242. package/lib/features/tools/change-bounds/change-bounds-tool-feedback.d.ts +28 -12
  243. package/lib/features/tools/change-bounds/change-bounds-tool-feedback.d.ts.map +1 -1
  244. package/lib/features/tools/change-bounds/change-bounds-tool-feedback.js +91 -51
  245. package/lib/features/tools/change-bounds/change-bounds-tool-feedback.js.map +1 -1
  246. package/lib/features/tools/change-bounds/{change-boounds-tool-module.d.ts → change-bounds-tool-module.d.ts} +1 -1
  247. package/lib/features/tools/change-bounds/change-bounds-tool-module.d.ts.map +1 -0
  248. package/lib/features/tools/change-bounds/{change-boounds-tool-module.js → change-bounds-tool-module.js} +1 -1
  249. package/lib/features/tools/change-bounds/change-bounds-tool-module.js.map +1 -0
  250. package/lib/features/tools/change-bounds/change-bounds-tool.d.ts +4 -4
  251. package/lib/features/tools/change-bounds/change-bounds-tool.d.ts.map +1 -1
  252. package/lib/features/tools/change-bounds/change-bounds-tool.js +11 -13
  253. package/lib/features/tools/change-bounds/change-bounds-tool.js.map +1 -1
  254. package/lib/features/tools/change-bounds/index.d.ts +20 -0
  255. package/lib/features/tools/change-bounds/index.d.ts.map +1 -0
  256. package/lib/features/tools/change-bounds/index.js +36 -0
  257. package/lib/features/tools/change-bounds/index.js.map +1 -0
  258. package/lib/features/tools/deletion/index.d.ts +18 -0
  259. package/lib/features/tools/deletion/index.d.ts.map +1 -0
  260. package/lib/features/tools/deletion/index.js +34 -0
  261. package/lib/features/tools/deletion/index.js.map +1 -0
  262. package/lib/features/tools/edge-creation/index.d.ts +21 -0
  263. package/lib/features/tools/edge-creation/index.d.ts.map +1 -0
  264. package/lib/features/tools/edge-creation/index.js +37 -0
  265. package/lib/features/tools/edge-creation/index.js.map +1 -0
  266. package/lib/features/tools/edge-edit/edge-edit-tool-feedback.d.ts +20 -6
  267. package/lib/features/tools/edge-edit/edge-edit-tool-feedback.d.ts.map +1 -1
  268. package/lib/features/tools/edge-edit/edge-edit-tool-feedback.js +10 -14
  269. package/lib/features/tools/edge-edit/edge-edit-tool-feedback.js.map +1 -1
  270. package/lib/features/tools/edge-edit/edge-edit-tool.d.ts +18 -2
  271. package/lib/features/tools/edge-edit/edge-edit-tool.d.ts.map +1 -1
  272. package/lib/features/tools/edge-edit/edge-edit-tool.js +6 -6
  273. package/lib/features/tools/edge-edit/edge-edit-tool.js.map +1 -1
  274. package/lib/features/tools/edge-edit/index.d.ts +19 -0
  275. package/lib/features/tools/edge-edit/index.d.ts.map +1 -0
  276. package/lib/features/tools/edge-edit/index.js +35 -0
  277. package/lib/features/tools/edge-edit/index.js.map +1 -0
  278. package/lib/features/tools/index.d.ts +24 -0
  279. package/lib/features/tools/index.d.ts.map +1 -0
  280. package/lib/features/tools/index.js +40 -0
  281. package/lib/features/tools/index.js.map +1 -0
  282. package/lib/features/tools/marquee-selection/index.d.ts +23 -0
  283. package/lib/features/tools/marquee-selection/index.d.ts.map +1 -0
  284. package/lib/features/tools/marquee-selection/index.js +39 -0
  285. package/lib/features/tools/marquee-selection/index.js.map +1 -0
  286. package/lib/features/tools/marquee-selection/marquee-tool.d.ts +20 -1
  287. package/lib/features/tools/marquee-selection/marquee-tool.d.ts.map +1 -1
  288. package/lib/features/tools/marquee-selection/marquee-tool.js +19 -7
  289. package/lib/features/tools/marquee-selection/marquee-tool.js.map +1 -1
  290. package/lib/features/tools/node-creation/index.d.ts +18 -0
  291. package/lib/features/tools/node-creation/index.d.ts.map +1 -0
  292. package/lib/features/tools/node-creation/index.js +34 -0
  293. package/lib/features/tools/node-creation/index.js.map +1 -0
  294. package/lib/features/tools/node-creation/node-creation-tool.d.ts +3 -2
  295. package/lib/features/tools/node-creation/node-creation-tool.d.ts.map +1 -1
  296. package/lib/features/tools/node-creation/node-creation-tool.js +11 -15
  297. package/lib/features/tools/node-creation/node-creation-tool.js.map +1 -1
  298. package/lib/features/undo-redo/index.d.ts +18 -0
  299. package/lib/features/undo-redo/index.d.ts.map +1 -0
  300. package/lib/features/undo-redo/index.js +34 -0
  301. package/lib/features/undo-redo/index.js.map +1 -0
  302. package/lib/features/validation/index.d.ts +20 -0
  303. package/lib/features/validation/index.d.ts.map +1 -0
  304. package/lib/features/validation/index.js +36 -0
  305. package/lib/features/validation/index.js.map +1 -0
  306. package/lib/features/viewport/index.d.ts +20 -0
  307. package/lib/features/viewport/index.d.ts.map +1 -0
  308. package/lib/features/viewport/index.js +36 -0
  309. package/lib/features/viewport/index.js.map +1 -0
  310. package/lib/index.d.ts +5 -139
  311. package/lib/index.d.ts.map +1 -1
  312. package/lib/index.js +19 -157
  313. package/lib/index.js.map +1 -1
  314. package/lib/re-exports.d.ts +17 -0
  315. package/lib/re-exports.d.ts.map +1 -0
  316. package/lib/re-exports.js +33 -0
  317. package/lib/re-exports.js.map +1 -0
  318. package/lib/tsconfig.tsbuildinfo +1 -1
  319. package/lib/utils/geometry-util.d.ts +38 -0
  320. package/lib/utils/geometry-util.d.ts.map +1 -0
  321. package/lib/utils/geometry-util.js +103 -0
  322. package/lib/utils/geometry-util.js.map +1 -0
  323. package/lib/utils/gmodel-util.d.ts +3 -1
  324. package/lib/utils/gmodel-util.d.ts.map +1 -1
  325. package/lib/utils/gmodel-util.js +27 -1
  326. package/lib/utils/gmodel-util.js.map +1 -1
  327. package/lib/utils/html-utils.d.ts +1 -15
  328. package/lib/utils/html-utils.d.ts.map +1 -1
  329. package/lib/utils/html-utils.js +6 -1
  330. package/lib/utils/html-utils.js.map +1 -1
  331. package/lib/utils/index.d.ts +23 -0
  332. package/lib/utils/index.d.ts.map +1 -0
  333. package/lib/utils/index.js +39 -0
  334. package/lib/utils/index.js.map +1 -0
  335. package/lib/utils/viewpoint-util.d.ts +1 -0
  336. package/lib/utils/viewpoint-util.d.ts.map +1 -1
  337. package/lib/utils/viewpoint-util.js +8 -1
  338. package/lib/utils/viewpoint-util.js.map +1 -1
  339. package/lib/views/index.d.ts +2 -2
  340. package/lib/views/index.d.ts.map +1 -1
  341. package/lib/views/index.js +2 -2
  342. package/lib/views/index.js.map +1 -1
  343. package/package.json +3 -3
  344. package/src/base/auto-complete/index.ts +20 -0
  345. package/src/base/feedback/index.ts +19 -0
  346. package/src/base/focus/index.ts +17 -0
  347. package/src/base/index.ts +31 -0
  348. package/src/base/model/index.ts +19 -0
  349. package/src/base/tool-manager/index.ts +17 -0
  350. package/src/base/view/index.ts +18 -0
  351. package/src/default-modules.ts +2 -2
  352. package/src/features/accessibility/edge-autocomplete/index.ts +19 -0
  353. package/src/features/accessibility/element-navigation/index.ts +21 -0
  354. package/src/features/accessibility/focus-tracker/index.ts +17 -0
  355. package/src/features/accessibility/index.ts +30 -0
  356. package/src/features/accessibility/key-shortcut/index.ts +18 -0
  357. package/src/features/accessibility/keyboard-grid/index.ts +20 -0
  358. package/src/features/accessibility/keyboard-pointer/index.ts +21 -0
  359. package/src/features/accessibility/keyboard-tool-palette/index.ts +17 -0
  360. package/src/features/accessibility/move-zoom/index.ts +18 -0
  361. package/src/features/accessibility/resize-key-tool/index.ts +18 -0
  362. package/src/features/accessibility/search/index.ts +18 -0
  363. package/src/features/accessibility/toast/index.ts +18 -0
  364. package/src/features/accessibility/view-key-tools/index.ts +19 -0
  365. package/src/features/accessibility/view-key-tools/movement-key-tool.ts +15 -19
  366. package/src/features/bounds/bounds-module.ts +5 -2
  367. package/src/features/bounds/index.ts +23 -0
  368. package/src/features/bounds/local-bounds.ts +7 -1
  369. package/src/features/bounds/set-bounds-feedback-command.ts +1 -1
  370. package/src/features/change-bounds/index.ts +20 -0
  371. package/src/features/change-bounds/model.ts +18 -2
  372. package/src/features/change-bounds/point-position-updater.ts +120 -0
  373. package/src/features/change-bounds/position-snapper.ts +69 -0
  374. package/src/features/change-bounds/snap.spec.ts +3 -2
  375. package/src/features/change-bounds/snap.ts +8 -82
  376. package/src/features/command-palette/index.ts +18 -0
  377. package/src/features/context-menu/index.ts +19 -0
  378. package/src/features/copy-paste/index.ts +19 -0
  379. package/src/features/decoration/index.ts +17 -0
  380. package/src/features/element-template/index.ts +19 -0
  381. package/src/features/element-template/mouse-tracking-element-position-listener.ts +29 -22
  382. package/src/features/export/index.ts +18 -0
  383. package/src/features/helper-lines/helper-line-feedback.ts +269 -0
  384. package/src/features/helper-lines/helper-line-manager-default.ts +114 -0
  385. package/src/features/helper-lines/helper-line-manager.ts +21 -0
  386. package/src/features/helper-lines/helper-line-module.ts +47 -0
  387. package/src/features/helper-lines/index.ts +21 -0
  388. package/src/features/helper-lines/model.ts +140 -0
  389. package/src/features/helper-lines/view.tsx +60 -0
  390. package/src/features/hints/index.ts +18 -0
  391. package/src/features/hover/index.ts +17 -0
  392. package/src/features/index.ts +42 -0
  393. package/src/features/label-edit/index.ts +18 -0
  394. package/src/features/layout/index.ts +17 -0
  395. package/src/features/navigation/index.ts +18 -0
  396. package/src/features/reconnect/index.ts +16 -0
  397. package/src/features/routing/index.ts +17 -0
  398. package/src/features/save/index.ts +17 -0
  399. package/src/features/select/index.ts +18 -0
  400. package/src/features/source-model-watcher/index.ts +17 -0
  401. package/src/features/status/index.ts +17 -0
  402. package/src/features/svg-metadata/index.ts +17 -0
  403. package/src/features/tool-palette/index.ts +17 -0
  404. package/src/features/tools/change-bounds/change-bounds-tool-feedback.ts +99 -69
  405. package/src/features/tools/change-bounds/change-bounds-tool.ts +12 -11
  406. package/src/features/tools/change-bounds/index.ts +19 -0
  407. package/src/features/tools/deletion/index.ts +17 -0
  408. package/src/features/tools/edge-creation/index.ts +20 -0
  409. package/src/features/tools/edge-edit/edge-edit-tool-feedback.ts +20 -21
  410. package/src/features/tools/edge-edit/edge-edit-tool.ts +5 -6
  411. package/src/features/tools/edge-edit/index.ts +18 -0
  412. package/src/features/tools/index.ts +23 -0
  413. package/src/features/tools/marquee-selection/index.ts +22 -0
  414. package/src/features/tools/marquee-selection/marquee-tool.ts +14 -4
  415. package/src/features/tools/node-creation/index.ts +17 -0
  416. package/src/features/tools/node-creation/node-creation-tool.ts +9 -13
  417. package/src/features/undo-redo/index.ts +17 -0
  418. package/src/features/validation/index.ts +19 -0
  419. package/src/features/viewport/index.ts +19 -0
  420. package/src/index.ts +5 -147
  421. package/src/re-exports.ts +16 -0
  422. package/src/utils/geometry-util.ts +101 -0
  423. package/src/utils/gmodel-util.ts +41 -10
  424. package/src/utils/html-utils.ts +6 -0
  425. package/src/utils/index.ts +22 -0
  426. package/src/utils/viewpoint-util.ts +8 -0
  427. package/src/views/index.ts +2 -2
  428. package/lib/features/source-model-watcher/source-model-wacher-module.d.ts.map +0 -1
  429. package/lib/features/source-model-watcher/source-model-wacher-module.js.map +0 -1
  430. package/lib/features/tools/change-bounds/change-boounds-tool-module.d.ts.map +0 -1
  431. package/lib/features/tools/change-bounds/change-boounds-tool-module.js.map +0 -1
  432. /package/src/features/source-model-watcher/{source-model-wacher-module.ts → source-model-watcher-module.ts} +0 -0
  433. /package/src/features/tools/change-bounds/{change-boounds-tool-module.ts → change-bounds-tool-module.ts} +0 -0
@@ -0,0 +1,18 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2023 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
+ export * from './model';
17
+ export * from './type-hint-provider';
18
+ export * from './type-hints-module';
@@ -0,0 +1,17 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2023 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
+ export * from './hover-module';
17
+ export * from './hover';
@@ -0,0 +1,42 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2023 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
+ export * from './accessibility';
17
+ export * from './bounds';
18
+ export * from './change-bounds';
19
+ export * from './command-palette';
20
+ export * from './context-menu';
21
+ export * from './copy-paste';
22
+ export * from './decoration';
23
+ export * from './element-template';
24
+ export * from './export';
25
+ export * from './helper-lines';
26
+ export * from './hints';
27
+ export * from './hover';
28
+ export * from './label-edit';
29
+ export * from './layout';
30
+ export * from './navigation';
31
+ export * from './reconnect';
32
+ export * from './routing';
33
+ export * from './save';
34
+ export * from './select';
35
+ export * from './source-model-watcher';
36
+ export * from './status';
37
+ export * from './svg-metadata';
38
+ export * from './tool-palette';
39
+ export * from './tools';
40
+ export * from './undo-redo';
41
+ export * from './validation';
42
+ export * from './viewport';
@@ -0,0 +1,18 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2023 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
+ export * from './edit-label-tool';
17
+ export * from './edit-label-validator';
18
+ export * from './label-edit-module';
@@ -0,0 +1,17 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2023 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
+ export * from './layout-elements-action';
17
+ export * from './layout-module';
@@ -0,0 +1,18 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2023 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
+ export * from './navigation-action-handler';
17
+ export * from './navigation-module';
18
+ export * from './navigation-target-resolver';
@@ -0,0 +1,16 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2023 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
+ export * from './model';
@@ -0,0 +1,17 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2023 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
+ export * from './glsp-manhattan-edge-router';
17
+ export * from './routing-module';
@@ -0,0 +1,17 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2023 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
+ export * from './save-keylistener';
17
+ export * from './save-module';
@@ -0,0 +1,18 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2023 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
+ export * from './select-feedback-command';
17
+ export * from './select-module';
18
+ export * from './select-mouse-listener';
@@ -0,0 +1,17 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2023 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
+ export * from './source-model-changed-action-handler';
17
+ export * from './source-model-watcher-module';
@@ -0,0 +1,17 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2023 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
+ export * from './status-module';
17
+ export * from './status-overlay';
@@ -0,0 +1,17 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2023 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
+ export * from './metadata-placer';
17
+ export * from './svg-metadata-module';
@@ -0,0 +1,17 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2023 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
+ export * from './tool-palette-module';
17
+ export * from './tool-palette';
@@ -22,24 +22,24 @@ import {
22
22
  GChildElement,
23
23
  GModelElement,
24
24
  GModelRoot,
25
- MouseListener,
26
25
  MoveAction,
27
26
  Point,
28
27
  TYPES,
29
28
  findParentByFeature,
30
29
  hasStringProp,
31
30
  isMoveable,
32
- isSelectable,
33
- isViewport
31
+ isSelectable
34
32
  } from '@eclipse-glsp/sprotty';
35
33
  import { inject, injectable } from 'inversify';
36
- import { VNode } from 'snabbdom';
37
34
 
35
+ import { DebouncedFunc, debounce } from 'lodash';
36
+ import { DragAwareMouseListener } from '../../../base/drag-aware-mouse-listener';
38
37
  import { CursorCSS, cursorFeedbackAction } from '../../../base/feedback/css-feedback';
39
38
  import { FeedbackCommand } from '../../../base/feedback/feedback-command';
40
39
  import { forEachElement } from '../../../utils/gmodel-util';
41
40
  import { SResizeHandle, addResizeHandles, isResizable, removeResizeHandles } from '../../change-bounds/model';
42
41
  import { createMovementRestrictionFeedback, removeMovementRestrictionFeedback } from '../../change-bounds/movement-restrictor';
42
+ import { PointPositionUpdater } from '../../change-bounds/point-position-updater';
43
43
  import { ChangeBoundsTool } from './change-bounds-tool';
44
44
 
45
45
  export interface ShowChangeBoundsToolResizeFeedbackAction extends Action {
@@ -113,6 +113,38 @@ export class HideChangeBoundsToolResizeFeedbackCommand extends FeedbackCommand {
113
113
  }
114
114
  }
115
115
 
116
+ export interface MoveInitializedEventAction extends Action {
117
+ kind: typeof MoveInitializedEventAction.KIND;
118
+ }
119
+
120
+ export namespace MoveInitializedEventAction {
121
+ export const KIND = 'move-initialized-event';
122
+
123
+ export function is(object: any): object is MoveInitializedEventAction {
124
+ return Action.hasKind(object, KIND);
125
+ }
126
+
127
+ export function create(): MoveInitializedEventAction {
128
+ return { kind: KIND };
129
+ }
130
+ }
131
+
132
+ export interface MoveFinishedEventAction extends Action {
133
+ kind: typeof MoveFinishedEventAction.KIND;
134
+ }
135
+
136
+ export namespace MoveFinishedEventAction {
137
+ export const KIND = 'move-finished-event';
138
+
139
+ export function is(object: any): object is MoveFinishedEventAction {
140
+ return Action.hasKind(object, KIND);
141
+ }
142
+
143
+ export function create(): MoveFinishedEventAction {
144
+ return { kind: KIND };
145
+ }
146
+ }
147
+
116
148
  /**
117
149
  * This mouse listener provides visual feedback for moving by sending client-side
118
150
  * `MoveAction`s while elements are selected and dragged. This will also update
@@ -120,45 +152,57 @@ export class HideChangeBoundsToolResizeFeedbackCommand extends FeedbackCommand {
120
152
  * the visual feedback but also the basis for sending the change to the server
121
153
  * (see also `tools/MoveTool`).
122
154
  */
123
- export class FeedbackMoveMouseListener extends MouseListener implements Disposable {
124
- protected hasDragged = false;
155
+ export class FeedbackMoveMouseListener extends DragAwareMouseListener implements Disposable {
125
156
  protected rootElement?: GModelRoot;
126
- protected startDragPosition?: Point;
157
+ protected positionUpdater;
127
158
  protected elementId2startPos = new Map<string, Point>();
159
+ protected pendingMoveInitialized?: DebouncedFunc<() => void>;
128
160
 
129
161
  constructor(protected tool: ChangeBoundsTool) {
130
162
  super();
163
+ this.positionUpdater = new PointPositionUpdater(tool.positionSnapper);
131
164
  }
132
165
 
133
166
  override mouseDown(target: GModelElement, event: MouseEvent): Action[] {
134
167
  if (event.button === 0 && !(target instanceof SResizeHandle)) {
135
168
  const moveable = findParentByFeature(target, isMoveable);
136
- if (moveable !== undefined) {
137
- this.startDragPosition = { x: event.pageX, y: event.pageY };
169
+ if (moveable !== undefined && !(target instanceof SResizeHandle)) {
170
+ this.positionUpdater.updateLastDragPosition(event);
171
+ this.scheduleMoveInitialized();
138
172
  } else {
139
- this.startDragPosition = undefined;
173
+ this.positionUpdater.resetPosition();
140
174
  }
141
- this.hasDragged = false;
175
+ this._isMouseDrag = false;
142
176
  }
143
177
  return [];
144
178
  }
145
179
 
180
+ protected scheduleMoveInitialized(): void {
181
+ this.pendingMoveInitialized?.cancel();
182
+ this.pendingMoveInitialized = debounce(() => {
183
+ this.tool.registerFeedback([MoveInitializedEventAction.create()], this);
184
+ this.pendingMoveInitialized = undefined;
185
+ }, 750);
186
+ this.pendingMoveInitialized();
187
+ }
188
+
146
189
  override mouseMove(target: GModelElement, event: MouseEvent): Action[] {
147
190
  const result: Action[] = [];
148
191
  if (event.buttons === 0) {
149
192
  this.mouseUp(target, event);
150
- } else if (this.startDragPosition) {
193
+ } else if (!this.positionUpdater.isLastDragPositionUndefined()) {
194
+ this.pendingMoveInitialized?.cancel();
151
195
  if (this.elementId2startPos.size === 0) {
152
196
  this.collectStartPositions(target.root);
153
197
  }
154
- this.hasDragged = true;
198
+ this._isMouseDrag = true;
155
199
  const moveAction = this.getElementMoves(target, event, false);
156
200
  if (moveAction) {
157
201
  result.push(moveAction);
158
202
  result.push(cursorFeedbackAction(CursorCSS.MOVE));
203
+ this.tool.registerFeedback(result, this);
159
204
  }
160
205
  }
161
- this.tool.registerFeedback(result, this);
162
206
  return [];
163
207
  }
164
208
 
@@ -186,18 +230,11 @@ export class FeedbackMoveMouseListener extends MouseListener implements Disposab
186
230
  }
187
231
 
188
232
  protected getElementMoves(target: GModelElement, event: MouseEvent, finished: boolean): MoveAction | undefined {
189
- if (!this.startDragPosition) {
233
+ const delta = this.positionUpdater.updatePosition(target, event);
234
+ if (!delta) {
190
235
  return undefined;
191
236
  }
192
-
193
- const viewport = findParentByFeature(target, isViewport);
194
- const zoom = viewport ? viewport.zoom : 1;
195
- const delta = {
196
- x: (event.pageX - this.startDragPosition.x) / zoom,
197
- y: (event.pageY - this.startDragPosition.y) / zoom
198
- };
199
-
200
- const elementMoves: ElementMove[] = this.getElementMovesForDelta(target, delta, !event.altKey, finished);
237
+ const elementMoves: ElementMove[] = this.getElementMovesForDelta(target, delta, finished);
201
238
  if (elementMoves.length > 0) {
202
239
  return MoveAction.create(elementMoves, { animate: false, finished });
203
240
  } else {
@@ -205,35 +242,15 @@ export class FeedbackMoveMouseListener extends MouseListener implements Disposab
205
242
  }
206
243
  }
207
244
 
208
- protected getElementMovesForDelta(
209
- target: GModelElement,
210
- delta: { x: number; y: number },
211
- isSnap: boolean,
212
- finished: boolean
213
- ): ElementMove[] {
245
+ protected getElementMovesForDelta(target: GModelElement, delta: Point, finished: boolean): ElementMove[] {
214
246
  const elementMoves: ElementMove[] = [];
215
247
  this.elementId2startPos.forEach((startPosition, elementId) => {
216
248
  const element = target.root.index.getById(elementId);
217
249
  if (element) {
218
- let toPosition = this.snap(
219
- {
220
- x: startPosition.x + delta.x,
221
- y: startPosition.y + delta.y
222
- },
223
- element,
224
- isSnap
225
- );
226
-
227
250
  if (isMoveable(element)) {
228
- toPosition = this.validateMove(startPosition, toPosition, element, finished);
229
- elementMoves.push({
230
- elementId: element.id,
231
- fromPosition: {
232
- x: element.position.x,
233
- y: element.position.y
234
- },
235
- toPosition
236
- });
251
+ const targetPosition = Point.add(element.position, delta);
252
+ const toPosition = this.validateMove(startPosition, targetPosition, element, finished);
253
+ elementMoves.push({ elementId: element.id, fromPosition: element.position, toPosition });
237
254
  }
238
255
  }
239
256
  });
@@ -247,7 +264,6 @@ export class FeedbackMoveMouseListener extends MouseListener implements Disposab
247
264
  let action;
248
265
  if (!valid) {
249
266
  action = createMovementRestrictionFeedback(element, this.tool.movementRestrictor);
250
-
251
267
  if (isFinished) {
252
268
  newPosition = startPosition;
253
269
  }
@@ -259,24 +275,24 @@ export class FeedbackMoveMouseListener extends MouseListener implements Disposab
259
275
  return newPosition;
260
276
  }
261
277
 
262
- protected snap(position: Point, element: GModelElement, isSnap: boolean): Point {
263
- if (isSnap && this.tool.snapper) {
264
- return this.tool.snapper.snap(position, element);
265
- } else {
266
- return position;
267
- }
268
- }
269
-
270
278
  override mouseEnter(target: GModelElement, event: MouseEvent): Action[] {
271
- if (target instanceof GModelRoot && event.buttons === 0 && !this.startDragPosition) {
279
+ if (target instanceof GModelRoot && event.buttons === 0 && this.positionUpdater.isLastDragPositionUndefined()) {
272
280
  this.mouseUp(target, event);
273
281
  }
274
282
  return [];
275
283
  }
276
284
 
277
- override mouseUp(target: GModelElement, event: MouseEvent): Action[] {
285
+ override nonDraggingMouseUp(element: GModelElement, event: MouseEvent): Action[] {
286
+ this.reset(true);
287
+ return [];
288
+ }
289
+
290
+ override draggingMouseUp(target: GModelElement, event: MouseEvent): Action[] {
278
291
  const result: Action[] = [];
279
- if (this.startDragPosition) {
292
+ if (this.positionUpdater.isLastDragPositionUndefined()) {
293
+ this.reset(true);
294
+ return result;
295
+ } else {
280
296
  const moveAction = this.getElementMoves(target, event, true);
281
297
  if (moveAction) {
282
298
  result.push(moveAction);
@@ -292,22 +308,36 @@ export class FeedbackMoveMouseListener extends MouseListener implements Disposab
292
308
  return result;
293
309
  }
294
310
 
311
+ protected resetMoveFeedback(): ElementMove[] {
312
+ const elementMoves: ElementMove[] = [];
313
+ this.elementId2startPos.forEach((startPosition, elementId) => {
314
+ const element = this.rootElement!.index.getById(elementId);
315
+ if (element) {
316
+ if (isMoveable(element)) {
317
+ elementMoves.push({ elementId: element.id, fromPosition: element.position, toPosition: startPosition });
318
+ }
319
+ }
320
+ });
321
+ return elementMoves;
322
+ }
323
+
295
324
  protected reset(resetFeedback = false): void {
325
+ this.pendingMoveInitialized?.cancel();
296
326
  if (this.rootElement && resetFeedback) {
297
- const elementMoves: ElementMove[] = this.getElementMovesForDelta(this.rootElement, { x: 0, y: 0 }, true, true);
298
- const moveAction = MoveAction.create(elementMoves, { animate: false, finished: true });
299
- this.tool.deregisterFeedback(this, [moveAction]);
327
+ const elementMoves: ElementMove[] = this.resetMoveFeedback();
328
+ if (elementMoves.length > 0) {
329
+ const moveAction = MoveAction.create(elementMoves, { animate: false, finished: true });
330
+ this.tool.deregisterFeedback(this, [moveAction]);
331
+ }
332
+ } else if (resetFeedback) {
333
+ this.tool.deregisterFeedback(this, [MoveFinishedEventAction.create()]);
300
334
  }
301
- this.hasDragged = false;
302
- this.startDragPosition = undefined;
335
+ this.positionUpdater.resetPosition();
336
+ this._isMouseDrag = false;
303
337
  this.rootElement = undefined;
304
338
  this.elementId2startPos.clear();
305
339
  }
306
340
 
307
- override decorate(vnode: VNode, _element: GModelElement): VNode {
308
- return vnode;
309
- }
310
-
311
341
  dispose(): void {
312
342
  this.reset(true);
313
343
  }
@@ -32,7 +32,6 @@ import {
32
32
  GModelElement,
33
33
  GModelRoot,
34
34
  GParentElement,
35
- ISnapper,
36
35
  MouseListener,
37
36
  Operation,
38
37
  Point,
@@ -43,7 +42,7 @@ import {
43
42
  import { DragAwareMouseListener } from '../../../base/drag-aware-mouse-listener';
44
43
  import { CursorCSS, applyCssClasses, cursorFeedbackAction, deleteCssClasses } from '../../../base/feedback/css-feedback';
45
44
  import { ISelectionListener, SelectionService } from '../../../base/selection-service';
46
- import { PointPositionUpdater } from '../../../features/change-bounds/snap';
45
+ import { PointPositionUpdater } from '../../../features/change-bounds/point-position-updater';
47
46
  import {
48
47
  calcElementAndRoutingPoints,
49
48
  forEachElement,
@@ -58,6 +57,8 @@ import {
58
57
  createMovementRestrictionFeedback,
59
58
  removeMovementRestrictionFeedback
60
59
  } from '../../change-bounds/movement-restrictor';
60
+ import { PositionSnapper } from '../../change-bounds/position-snapper';
61
+ import { getDirectionFrom } from '../../helper-lines/model';
61
62
  import { BaseEditTool } from '../base-tools';
62
63
  import {
63
64
  FeedbackMoveMouseListener,
@@ -84,8 +85,8 @@ export class ChangeBoundsTool extends BaseEditTool {
84
85
 
85
86
  @inject(SelectionService) protected selectionService: SelectionService;
86
87
  @inject(EdgeRouterRegistry) @optional() readonly edgeRouterRegistry?: EdgeRouterRegistry;
87
- @inject(TYPES.ISnapper) @optional() readonly snapper?: ISnapper;
88
88
  @inject(TYPES.IMovementRestrictor) @optional() readonly movementRestrictor?: IMovementRestrictor;
89
+ @inject(PositionSnapper) readonly positionSnapper: PositionSnapper;
89
90
 
90
91
  get id(): string {
91
92
  return ChangeBoundsTool.ID;
@@ -135,7 +136,7 @@ export class ChangeBoundsListener extends DragAwareMouseListener implements ISel
135
136
 
136
137
  constructor(protected tool: ChangeBoundsTool) {
137
138
  super();
138
- this.pointPositionUpdater = new PointPositionUpdater(tool.snapper);
139
+ this.pointPositionUpdater = new PointPositionUpdater(tool.positionSnapper);
139
140
  }
140
141
 
141
142
  override mouseDown(target: GModelElement, event: MouseEvent): Action[] {
@@ -168,7 +169,11 @@ export class ChangeBoundsListener extends DragAwareMouseListener implements ISel
168
169
  cursorFeedbackAction(this.activeResizeHandle.isNwSeResize() ? CursorCSS.RESIZE_NWSE : CursorCSS.RESIZE_NESW),
169
170
  applyCssClasses(this.activeResizeHandle, ChangeBoundsListener.CSS_CLASS_ACTIVE)
170
171
  ];
171
- const positionUpdate = this.pointPositionUpdater.updatePosition(target, { x: event.pageX, y: event.pageY }, !event.altKey);
172
+ const positionUpdate = this.pointPositionUpdater.updatePosition(
173
+ target,
174
+ event,
175
+ getDirectionFrom(this.activeResizeHandle.location)
176
+ );
172
177
  if (positionUpdate) {
173
178
  const resizeActions = this.handleResizeOnClient(positionUpdate);
174
179
  actions.push(...resizeActions);
@@ -242,7 +247,7 @@ export class ChangeBoundsListener extends DragAwareMouseListener implements ISel
242
247
  const newRoutingPoints: ElementAndRoutingPoints[] = [];
243
248
  const routerRegistry = this.tool.edgeRouterRegistry;
244
249
  if (routerRegistry) {
245
- // If client routing is enabled -> delegate routingpoints of connected edges to server
250
+ // If client routing is enabled -> delegate routing points of connected edges to server
246
251
  forEachElement(target.index, isNonRoutableSelectedMovableBoundsAware, element => {
247
252
  if (element instanceof GConnectableElement) {
248
253
  element.incomingEdges
@@ -308,7 +313,7 @@ export class ChangeBoundsListener extends DragAwareMouseListener implements ISel
308
313
  }
309
314
 
310
315
  protected initPosition(event: MouseEvent): void {
311
- this.pointPositionUpdater.updateLastDragPosition({ x: event.pageX, y: event.pageY });
316
+ this.pointPositionUpdater.updateLastDragPosition(event);
312
317
  if (this.activeResizeHandle) {
313
318
  const resizeElement = findParentByFeature(this.activeResizeHandle, isResizable);
314
319
  this.initialBounds = {
@@ -459,10 +464,6 @@ export class ChangeBoundsListener extends DragAwareMouseListener implements ISel
459
464
  return result;
460
465
  }
461
466
 
462
- protected snap(position: Point, element: GModelElement, isSnap: boolean): Point {
463
- return isSnap && this.tool.snapper ? this.tool.snapper.snap(position, element) : { x: position.x, y: position.y };
464
- }
465
-
466
467
  protected isValidBoundChange(element: GModelElement & BoundsAware, newPosition: Point, newSize: Dimension): boolean {
467
468
  return this.isValidSize(element, newSize) && this.isValidMove(element, newPosition);
468
469
  }