@eclipse-glsp/client 2.2.0-next.336 → 2.2.0-next.338

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 (544) hide show
  1. package/css/ghost-element.css +7 -0
  2. package/lib/base/default.module.js +4 -4
  3. package/lib/base/default.module.js.map +1 -1
  4. package/lib/base/drag-aware-mouse-listener.d.ts +5 -2
  5. package/lib/base/drag-aware-mouse-listener.d.ts.map +1 -1
  6. package/lib/base/drag-aware-mouse-listener.js +13 -3
  7. package/lib/base/drag-aware-mouse-listener.js.map +1 -1
  8. package/lib/base/feedback/feedback-action-dispatcher-default.d.ts +34 -0
  9. package/lib/base/feedback/feedback-action-dispatcher-default.d.ts.map +1 -0
  10. package/lib/base/feedback/feedback-action-dispatcher-default.js +120 -0
  11. package/lib/base/feedback/feedback-action-dispatcher-default.js.map +1 -0
  12. package/lib/base/feedback/feedback-action-dispatcher.d.ts +2 -17
  13. package/lib/base/feedback/feedback-action-dispatcher.d.ts.map +1 -1
  14. package/lib/base/feedback/feedback-action-dispatcher.js +1 -100
  15. package/lib/base/feedback/feedback-action-dispatcher.js.map +1 -1
  16. package/lib/base/feedback/{feeback-emitter.d.ts → feedback-emitter.d.ts} +8 -1
  17. package/lib/base/feedback/feedback-emitter.d.ts.map +1 -0
  18. package/lib/base/feedback/{feeback-emitter.js → feedback-emitter.js} +21 -6
  19. package/lib/base/feedback/feedback-emitter.js.map +1 -0
  20. package/lib/base/selection-service.d.ts +1 -1
  21. package/lib/base/selection-service.d.ts.map +1 -1
  22. package/lib/base/tool-manager/tool-manager.d.ts +1 -1
  23. package/lib/base/tool-manager/tool-manager.d.ts.map +1 -1
  24. package/lib/base/ui-extension/ui-extension-registry.d.ts +1 -1
  25. package/lib/base/ui-extension/ui-extension-registry.d.ts.map +1 -1
  26. package/lib/base/view/key-tool.d.ts +1 -1
  27. package/lib/base/view/key-tool.d.ts.map +1 -1
  28. package/lib/base/view/mouse-tool.d.ts +1 -1
  29. package/lib/base/view/mouse-tool.d.ts.map +1 -1
  30. package/lib/features/accessibility/move-zoom/move-handler.d.ts +2 -2
  31. package/lib/features/accessibility/move-zoom/move-handler.d.ts.map +1 -1
  32. package/lib/features/accessibility/move-zoom/move-handler.js +1 -1
  33. package/lib/features/accessibility/move-zoom/move-handler.js.map +1 -1
  34. package/lib/features/accessibility/resize-key-tool/resize-key-handler.d.ts +3 -3
  35. package/lib/features/accessibility/resize-key-tool/resize-key-handler.d.ts.map +1 -1
  36. package/lib/features/accessibility/resize-key-tool/resize-key-handler.js +1 -1
  37. package/lib/features/accessibility/resize-key-tool/resize-key-handler.js.map +1 -1
  38. package/lib/features/accessibility/view-key-tools/movement-key-tool.d.ts +3 -3
  39. package/lib/features/accessibility/view-key-tools/movement-key-tool.d.ts.map +1 -1
  40. package/lib/features/accessibility/view-key-tools/movement-key-tool.js +4 -4
  41. package/lib/features/accessibility/view-key-tools/movement-key-tool.js.map +1 -1
  42. package/lib/features/bounds/set-bounds-feedback-command.d.ts.map +1 -1
  43. package/lib/features/bounds/set-bounds-feedback-command.js +2 -2
  44. package/lib/features/bounds/set-bounds-feedback-command.js.map +1 -1
  45. package/lib/features/change-bounds/model.d.ts +7 -3
  46. package/lib/features/change-bounds/model.d.ts.map +1 -1
  47. package/lib/features/change-bounds/model.js +46 -20
  48. package/lib/features/change-bounds/model.js.map +1 -1
  49. package/lib/features/change-bounds/movement-restrictor.d.ts +3 -2
  50. package/lib/features/change-bounds/movement-restrictor.d.ts.map +1 -1
  51. package/lib/features/change-bounds/movement-restrictor.js +9 -10
  52. package/lib/features/change-bounds/movement-restrictor.js.map +1 -1
  53. package/lib/features/debug/debug-bounds-decorator.d.ts +1 -1
  54. package/lib/features/debug/debug-bounds-decorator.d.ts.map +1 -1
  55. package/lib/features/debug/debug-bounds-decorator.js +6 -6
  56. package/lib/features/debug/debug-bounds-decorator.js.map +1 -1
  57. package/lib/features/debug/debug-manager.d.ts +2 -1
  58. package/lib/features/debug/debug-manager.d.ts.map +1 -1
  59. package/lib/features/debug/debug-manager.js.map +1 -1
  60. package/lib/features/debug/debug-model.d.ts +1 -1
  61. package/lib/features/debug/debug-model.d.ts.map +1 -1
  62. package/lib/features/debug/debug-model.js +5 -5
  63. package/lib/features/debug/debug-model.js.map +1 -1
  64. package/lib/features/debug/debug-module.js +1 -1
  65. package/lib/features/debug/debug-module.js.map +1 -1
  66. package/lib/features/element-template/mouse-tracking-element-position-listener.d.ts +8 -6
  67. package/lib/features/element-template/mouse-tracking-element-position-listener.d.ts.map +1 -1
  68. package/lib/features/element-template/mouse-tracking-element-position-listener.js +14 -15
  69. package/lib/features/element-template/mouse-tracking-element-position-listener.js.map +1 -1
  70. package/lib/features/grid/grid-manager.d.ts +2 -1
  71. package/lib/features/grid/grid-manager.d.ts.map +1 -1
  72. package/lib/features/grid/grid-manager.js.map +1 -1
  73. package/lib/features/grid/grid-model.d.ts +1 -1
  74. package/lib/features/grid/grid-model.d.ts.map +1 -1
  75. package/lib/features/grid/grid-model.js +5 -5
  76. package/lib/features/grid/grid-model.js.map +1 -1
  77. package/lib/features/grid/grid-module.d.ts +1 -1
  78. package/lib/features/grid/grid-module.d.ts.map +1 -1
  79. package/lib/features/grid/grid-module.js +2 -2
  80. package/lib/features/grid/grid-module.js.map +1 -1
  81. package/lib/features/helper-lines/helper-line-feedback.d.ts +2 -2
  82. package/lib/features/helper-lines/helper-line-feedback.js +3 -3
  83. package/lib/features/helper-lines/helper-line-feedback.js.map +1 -1
  84. package/lib/features/helper-lines/helper-line-manager-default.d.ts +16 -4
  85. package/lib/features/helper-lines/helper-line-manager-default.d.ts.map +1 -1
  86. package/lib/features/helper-lines/helper-line-manager-default.js +56 -15
  87. package/lib/features/helper-lines/helper-line-manager-default.js.map +1 -1
  88. package/lib/features/hints/model.d.ts +6 -2
  89. package/lib/features/hints/model.d.ts.map +1 -1
  90. package/lib/features/hints/model.js.map +1 -1
  91. package/lib/features/hints/type-hint-provider.d.ts +1 -1
  92. package/lib/features/hints/type-hint-provider.d.ts.map +1 -1
  93. package/lib/features/hints/type-hint-provider.js.map +1 -1
  94. package/lib/features/select/select-mouse-listener.d.ts +3 -3
  95. package/lib/features/select/select-mouse-listener.d.ts.map +1 -1
  96. package/lib/features/select/select-mouse-listener.js +6 -6
  97. package/lib/features/select/select-mouse-listener.js.map +1 -1
  98. package/lib/features/tool-palette/tool-palette.d.ts +3 -3
  99. package/lib/features/tool-palette/tool-palette.d.ts.map +1 -1
  100. package/lib/features/tool-palette/tool-palette.js +9 -9
  101. package/lib/features/tool-palette/tool-palette.js.map +1 -1
  102. package/lib/features/tools/base-tools.d.ts +2 -2
  103. package/lib/features/tools/base-tools.d.ts.map +1 -1
  104. package/lib/features/tools/base-tools.js +1 -1
  105. package/lib/features/tools/change-bounds/change-bounds-manager.d.ts +15 -7
  106. package/lib/features/tools/change-bounds/change-bounds-manager.d.ts.map +1 -1
  107. package/lib/features/tools/change-bounds/change-bounds-manager.js +51 -17
  108. package/lib/features/tools/change-bounds/change-bounds-manager.js.map +1 -1
  109. package/lib/features/tools/change-bounds/change-bounds-tool-feedback.d.ts.map +1 -1
  110. package/lib/features/tools/change-bounds/change-bounds-tool-feedback.js +3 -3
  111. package/lib/features/tools/change-bounds/change-bounds-tool-feedback.js.map +1 -1
  112. package/lib/features/tools/change-bounds/change-bounds-tool-module.d.ts +1 -1
  113. package/lib/features/tools/change-bounds/change-bounds-tool-module.js +2 -2
  114. package/lib/features/tools/change-bounds/change-bounds-tool-module.js.map +1 -1
  115. package/lib/features/tools/change-bounds/change-bounds-tool-move-feedback.d.ts +5 -5
  116. package/lib/features/tools/change-bounds/change-bounds-tool-move-feedback.d.ts.map +1 -1
  117. package/lib/features/tools/change-bounds/change-bounds-tool-move-feedback.js +9 -12
  118. package/lib/features/tools/change-bounds/change-bounds-tool-move-feedback.js.map +1 -1
  119. package/lib/features/tools/change-bounds/change-bounds-tool.d.ts +4 -3
  120. package/lib/features/tools/change-bounds/change-bounds-tool.d.ts.map +1 -1
  121. package/lib/features/tools/change-bounds/change-bounds-tool.js +13 -32
  122. package/lib/features/tools/change-bounds/change-bounds-tool.js.map +1 -1
  123. package/lib/features/tools/change-bounds/change-bounds-tracker.d.ts +11 -4
  124. package/lib/features/tools/change-bounds/change-bounds-tracker.d.ts.map +1 -1
  125. package/lib/features/tools/change-bounds/change-bounds-tracker.js +46 -28
  126. package/lib/features/tools/change-bounds/change-bounds-tracker.js.map +1 -1
  127. package/lib/features/tools/edge-creation/dangling-edge-feedback.d.ts +1 -1
  128. package/lib/features/tools/edge-creation/dangling-edge-feedback.js +3 -3
  129. package/lib/features/tools/edge-creation/dangling-edge-feedback.js.map +1 -1
  130. package/lib/features/tools/edge-creation/edge-creation-tool-feedback.d.ts +1 -1
  131. package/lib/features/tools/edge-creation/edge-creation-tool-feedback.d.ts.map +1 -1
  132. package/lib/features/tools/edge-creation/edge-creation-tool.d.ts +6 -3
  133. package/lib/features/tools/edge-creation/edge-creation-tool.d.ts.map +1 -1
  134. package/lib/features/tools/edge-creation/edge-creation-tool.js +13 -11
  135. package/lib/features/tools/edge-creation/edge-creation-tool.js.map +1 -1
  136. package/lib/features/tools/edge-edit/edge-edit-tool-feedback.d.ts +4 -3
  137. package/lib/features/tools/edge-edit/edge-edit-tool-feedback.d.ts.map +1 -1
  138. package/lib/features/tools/edge-edit/edge-edit-tool-feedback.js +4 -4
  139. package/lib/features/tools/edge-edit/edge-edit-tool-feedback.js.map +1 -1
  140. package/lib/features/tools/edge-edit/edge-edit-tool.d.ts +3 -3
  141. package/lib/features/tools/edge-edit/edge-edit-tool.d.ts.map +1 -1
  142. package/lib/features/tools/edge-edit/edge-edit-tool.js +4 -4
  143. package/lib/features/tools/edge-edit/edge-edit-tool.js.map +1 -1
  144. package/lib/features/tools/marquee-selection/marquee-mouse-tool.d.ts +2 -2
  145. package/lib/features/tools/marquee-selection/marquee-mouse-tool.d.ts.map +1 -1
  146. package/lib/features/tools/marquee-selection/marquee-mouse-tool.js +3 -3
  147. package/lib/features/tools/marquee-selection/marquee-mouse-tool.js.map +1 -1
  148. package/lib/features/tools/node-creation/container-manager.d.ts +41 -0
  149. package/lib/features/tools/node-creation/container-manager.d.ts.map +1 -0
  150. package/lib/features/tools/node-creation/container-manager.js +73 -0
  151. package/lib/features/tools/node-creation/container-manager.js.map +1 -0
  152. package/lib/{base/ui-extension/index.d.ts → features/tools/node-creation/insert-indicator.d.ts} +15 -3
  153. package/lib/features/tools/node-creation/insert-indicator.d.ts.map +1 -0
  154. package/lib/features/tools/node-creation/insert-indicator.js +40 -0
  155. package/lib/features/tools/node-creation/insert-indicator.js.map +1 -0
  156. package/lib/features/tools/node-creation/node-creation-module.d.ts +1 -1
  157. package/lib/features/tools/node-creation/node-creation-module.d.ts.map +1 -1
  158. package/lib/features/tools/node-creation/node-creation-module.js +6 -1
  159. package/lib/features/tools/node-creation/node-creation-module.js.map +1 -1
  160. package/lib/features/tools/node-creation/node-creation-tool.d.ts +26 -16
  161. package/lib/features/tools/node-creation/node-creation-tool.d.ts.map +1 -1
  162. package/lib/features/tools/node-creation/node-creation-tool.js +82 -78
  163. package/lib/features/tools/node-creation/node-creation-tool.js.map +1 -1
  164. package/lib/features/{debug/index.d.ts → tools/node-creation/node-creation-views.d.ts} +10 -5
  165. package/lib/features/tools/node-creation/node-creation-views.d.ts.map +1 -0
  166. package/lib/features/tools/node-creation/node-creation-views.js +60 -0
  167. package/lib/features/tools/node-creation/node-creation-views.js.map +1 -0
  168. package/lib/features/validation/validate.d.ts +1 -1
  169. package/lib/features/validation/validate.d.ts.map +1 -1
  170. package/lib/features/validation/validate.js.map +1 -1
  171. package/lib/features/viewport/viewport-handler.d.ts +1 -1
  172. package/lib/features/viewport/viewport-handler.d.ts.map +1 -1
  173. package/lib/features/viewport/viewport-handler.js +3 -3
  174. package/lib/features/viewport/viewport-handler.js.map +1 -1
  175. package/lib/index.d.ts +223 -5
  176. package/lib/index.d.ts.map +1 -1
  177. package/lib/index.js +223 -5
  178. package/lib/index.js.map +1 -1
  179. package/lib/utils/gmodel-util.d.ts +2 -0
  180. package/lib/utils/gmodel-util.d.ts.map +1 -1
  181. package/lib/utils/gmodel-util.js.map +1 -1
  182. package/lib/views/ggraph-view.d.ts +1 -1
  183. package/lib/views/ggraph-view.d.ts.map +1 -1
  184. package/lib/views/ggraph-view.js +4 -4
  185. package/lib/views/ggraph-view.js.map +1 -1
  186. package/lib/views/glsp-projection-view.d.ts +2 -2
  187. package/lib/views/glsp-projection-view.d.ts.map +1 -1
  188. package/lib/views/glsp-projection-view.js +5 -5
  189. package/lib/views/glsp-projection-view.js.map +1 -1
  190. package/package.json +4 -4
  191. package/src/base/action-dispatcher.spec.ts +1 -1
  192. package/src/base/default.module.ts +2 -2
  193. package/src/base/drag-aware-mouse-listener.ts +18 -2
  194. package/src/base/feedback/feedback-action-dispatcher-default.ts +119 -0
  195. package/src/base/feedback/feedback-action-dispatcher.ts +2 -106
  196. package/src/base/feedback/feedback-emitter.spec.ts +176 -0
  197. package/src/base/feedback/{feeback-emitter.ts → feedback-emitter.ts} +24 -5
  198. package/src/base/selection-service.spec.ts +1 -1
  199. package/src/base/selection-service.ts +1 -1
  200. package/src/base/tool-manager/tool-manager.ts +1 -1
  201. package/src/base/ui-extension/ui-extension-registry.ts +1 -1
  202. package/src/base/view/key-tool.ts +1 -1
  203. package/src/base/view/mouse-tool.ts +1 -1
  204. package/src/features/accessibility/move-zoom/move-handler.ts +2 -2
  205. package/src/features/accessibility/resize-key-tool/resize-key-handler.ts +3 -3
  206. package/src/features/accessibility/view-key-tools/movement-key-tool.ts +4 -4
  207. package/src/features/bounds/set-bounds-feedback-command.ts +1 -1
  208. package/src/features/change-bounds/model.ts +41 -16
  209. package/src/features/change-bounds/movement-restrictor.ts +13 -13
  210. package/src/features/change-bounds/point-position-updater.spec.ts +1 -1
  211. package/src/features/debug/debug-bounds-decorator.tsx +8 -8
  212. package/src/features/debug/debug-manager.ts +2 -1
  213. package/src/features/debug/debug-model.ts +2 -2
  214. package/src/features/debug/debug-module.ts +1 -1
  215. package/src/features/element-template/mouse-tracking-element-position-listener.ts +17 -24
  216. package/src/features/grid/grid-manager.ts +2 -1
  217. package/src/features/grid/grid-model.ts +2 -2
  218. package/src/features/grid/grid-module.ts +3 -3
  219. package/src/features/helper-lines/helper-line-feedback.ts +1 -1
  220. package/src/features/helper-lines/helper-line-manager-default.ts +68 -12
  221. package/src/features/hints/model.ts +7 -2
  222. package/src/features/hints/type-hint-provider.spec.ts +3 -3
  223. package/src/features/hints/type-hint-provider.ts +1 -1
  224. package/src/features/select/select-mouse-listener.ts +6 -6
  225. package/src/features/tool-palette/tool-palette.ts +6 -7
  226. package/src/features/tools/base-tools.ts +2 -2
  227. package/src/features/tools/change-bounds/change-bounds-manager.ts +75 -17
  228. package/src/features/tools/change-bounds/change-bounds-tool-feedback.ts +5 -2
  229. package/src/features/tools/change-bounds/change-bounds-tool-module.ts +2 -2
  230. package/src/features/tools/change-bounds/change-bounds-tool-move-feedback.ts +13 -11
  231. package/src/features/tools/change-bounds/change-bounds-tool.ts +12 -57
  232. package/src/features/tools/change-bounds/change-bounds-tracker.ts +29 -7
  233. package/src/features/tools/edge-creation/dangling-edge-feedback.ts +2 -2
  234. package/src/features/tools/edge-creation/edge-creation-tool-feedback.ts +1 -1
  235. package/src/features/tools/edge-creation/edge-creation-tool.ts +15 -8
  236. package/src/features/tools/edge-edit/edge-edit-tool-feedback.ts +4 -3
  237. package/src/features/tools/edge-edit/edge-edit-tool.ts +4 -5
  238. package/src/features/tools/marquee-selection/marquee-mouse-tool.ts +2 -2
  239. package/src/features/tools/node-creation/container-manager.ts +76 -0
  240. package/src/features/tools/node-creation/insert-indicator.ts +41 -0
  241. package/src/features/tools/node-creation/node-creation-module.ts +14 -2
  242. package/src/features/tools/node-creation/node-creation-tool.ts +101 -92
  243. package/src/features/tools/node-creation/node-creation-views.tsx +49 -0
  244. package/src/features/validation/validate.ts +1 -1
  245. package/src/features/viewport/viewport-handler.ts +1 -1
  246. package/src/index.ts +223 -5
  247. package/src/utils/gmodel-util.ts +4 -1
  248. package/src/views/ggraph-view.tsx +4 -4
  249. package/src/views/glsp-projection-view.tsx +4 -5
  250. package/lib/base/auto-complete/index.d.ts +0 -21
  251. package/lib/base/auto-complete/index.d.ts.map +0 -1
  252. package/lib/base/auto-complete/index.js +0 -37
  253. package/lib/base/auto-complete/index.js.map +0 -1
  254. package/lib/base/feedback/feeback-emitter.d.ts.map +0 -1
  255. package/lib/base/feedback/feeback-emitter.js.map +0 -1
  256. package/lib/base/feedback/index.d.ts +0 -22
  257. package/lib/base/feedback/index.d.ts.map +0 -1
  258. package/lib/base/feedback/index.js +0 -38
  259. package/lib/base/feedback/index.js.map +0 -1
  260. package/lib/base/focus/index.d.ts +0 -18
  261. package/lib/base/focus/index.d.ts.map +0 -1
  262. package/lib/base/focus/index.js +0 -34
  263. package/lib/base/focus/index.js.map +0 -1
  264. package/lib/base/index.d.ts +0 -34
  265. package/lib/base/index.d.ts.map +0 -1
  266. package/lib/base/index.js +0 -50
  267. package/lib/base/index.js.map +0 -1
  268. package/lib/base/model/index.d.ts +0 -20
  269. package/lib/base/model/index.d.ts.map +0 -1
  270. package/lib/base/model/index.js +0 -36
  271. package/lib/base/model/index.js.map +0 -1
  272. package/lib/base/tool-manager/index.d.ts +0 -18
  273. package/lib/base/tool-manager/index.d.ts.map +0 -1
  274. package/lib/base/tool-manager/index.js +0 -34
  275. package/lib/base/tool-manager/index.js.map +0 -1
  276. package/lib/base/ui-extension/index.d.ts.map +0 -1
  277. package/lib/base/ui-extension/index.js +0 -34
  278. package/lib/base/ui-extension/index.js.map +0 -1
  279. package/lib/base/view/index.d.ts +0 -19
  280. package/lib/base/view/index.d.ts.map +0 -1
  281. package/lib/base/view/index.js +0 -35
  282. package/lib/base/view/index.js.map +0 -1
  283. package/lib/features/accessibility/edge-autocomplete/index.d.ts +0 -20
  284. package/lib/features/accessibility/edge-autocomplete/index.d.ts.map +0 -1
  285. package/lib/features/accessibility/edge-autocomplete/index.js +0 -36
  286. package/lib/features/accessibility/edge-autocomplete/index.js.map +0 -1
  287. package/lib/features/accessibility/element-navigation/index.d.ts +0 -22
  288. package/lib/features/accessibility/element-navigation/index.d.ts.map +0 -1
  289. package/lib/features/accessibility/element-navigation/index.js +0 -38
  290. package/lib/features/accessibility/element-navigation/index.js.map +0 -1
  291. package/lib/features/accessibility/focus-tracker/index.d.ts +0 -18
  292. package/lib/features/accessibility/focus-tracker/index.d.ts.map +0 -1
  293. package/lib/features/accessibility/focus-tracker/index.js +0 -34
  294. package/lib/features/accessibility/focus-tracker/index.js.map +0 -1
  295. package/lib/features/accessibility/index.d.ts +0 -31
  296. package/lib/features/accessibility/index.d.ts.map +0 -1
  297. package/lib/features/accessibility/index.js +0 -47
  298. package/lib/features/accessibility/index.js.map +0 -1
  299. package/lib/features/accessibility/key-shortcut/index.d.ts +0 -19
  300. package/lib/features/accessibility/key-shortcut/index.d.ts.map +0 -1
  301. package/lib/features/accessibility/key-shortcut/index.js +0 -35
  302. package/lib/features/accessibility/key-shortcut/index.js.map +0 -1
  303. package/lib/features/accessibility/keyboard-grid/index.d.ts +0 -21
  304. package/lib/features/accessibility/keyboard-grid/index.d.ts.map +0 -1
  305. package/lib/features/accessibility/keyboard-grid/index.js +0 -37
  306. package/lib/features/accessibility/keyboard-grid/index.js.map +0 -1
  307. package/lib/features/accessibility/keyboard-pointer/index.d.ts +0 -22
  308. package/lib/features/accessibility/keyboard-pointer/index.d.ts.map +0 -1
  309. package/lib/features/accessibility/keyboard-pointer/index.js +0 -38
  310. package/lib/features/accessibility/keyboard-pointer/index.js.map +0 -1
  311. package/lib/features/accessibility/keyboard-tool-palette/index.d.ts +0 -18
  312. package/lib/features/accessibility/keyboard-tool-palette/index.d.ts.map +0 -1
  313. package/lib/features/accessibility/keyboard-tool-palette/index.js +0 -34
  314. package/lib/features/accessibility/keyboard-tool-palette/index.js.map +0 -1
  315. package/lib/features/accessibility/move-zoom/index.d.ts +0 -19
  316. package/lib/features/accessibility/move-zoom/index.d.ts.map +0 -1
  317. package/lib/features/accessibility/move-zoom/index.js +0 -35
  318. package/lib/features/accessibility/move-zoom/index.js.map +0 -1
  319. package/lib/features/accessibility/resize-key-tool/index.d.ts +0 -19
  320. package/lib/features/accessibility/resize-key-tool/index.d.ts.map +0 -1
  321. package/lib/features/accessibility/resize-key-tool/index.js +0 -35
  322. package/lib/features/accessibility/resize-key-tool/index.js.map +0 -1
  323. package/lib/features/accessibility/search/index.d.ts +0 -19
  324. package/lib/features/accessibility/search/index.d.ts.map +0 -1
  325. package/lib/features/accessibility/search/index.js +0 -35
  326. package/lib/features/accessibility/search/index.js.map +0 -1
  327. package/lib/features/accessibility/toast/index.d.ts +0 -19
  328. package/lib/features/accessibility/toast/index.d.ts.map +0 -1
  329. package/lib/features/accessibility/toast/index.js +0 -35
  330. package/lib/features/accessibility/toast/index.js.map +0 -1
  331. package/lib/features/accessibility/view-key-tools/index.d.ts +0 -20
  332. package/lib/features/accessibility/view-key-tools/index.d.ts.map +0 -1
  333. package/lib/features/accessibility/view-key-tools/index.js +0 -36
  334. package/lib/features/accessibility/view-key-tools/index.js.map +0 -1
  335. package/lib/features/bounds/index.d.ts +0 -25
  336. package/lib/features/bounds/index.d.ts.map +0 -1
  337. package/lib/features/bounds/index.js +0 -41
  338. package/lib/features/bounds/index.js.map +0 -1
  339. package/lib/features/change-bounds/index.d.ts +0 -22
  340. package/lib/features/change-bounds/index.d.ts.map +0 -1
  341. package/lib/features/change-bounds/index.js +0 -38
  342. package/lib/features/change-bounds/index.js.map +0 -1
  343. package/lib/features/command-palette/index.d.ts +0 -20
  344. package/lib/features/command-palette/index.d.ts.map +0 -1
  345. package/lib/features/command-palette/index.js +0 -36
  346. package/lib/features/command-palette/index.js.map +0 -1
  347. package/lib/features/context-menu/index.d.ts +0 -20
  348. package/lib/features/context-menu/index.d.ts.map +0 -1
  349. package/lib/features/context-menu/index.js +0 -36
  350. package/lib/features/context-menu/index.js.map +0 -1
  351. package/lib/features/copy-paste/index.d.ts +0 -20
  352. package/lib/features/copy-paste/index.d.ts.map +0 -1
  353. package/lib/features/copy-paste/index.js +0 -36
  354. package/lib/features/copy-paste/index.js.map +0 -1
  355. package/lib/features/debug/index.d.ts.map +0 -1
  356. package/lib/features/debug/index.js +0 -36
  357. package/lib/features/debug/index.js.map +0 -1
  358. package/lib/features/decoration/index.d.ts +0 -18
  359. package/lib/features/decoration/index.d.ts.map +0 -1
  360. package/lib/features/decoration/index.js +0 -34
  361. package/lib/features/decoration/index.js.map +0 -1
  362. package/lib/features/element-template/index.d.ts +0 -20
  363. package/lib/features/element-template/index.d.ts.map +0 -1
  364. package/lib/features/element-template/index.js +0 -36
  365. package/lib/features/element-template/index.js.map +0 -1
  366. package/lib/features/export/index.d.ts +0 -19
  367. package/lib/features/export/index.d.ts.map +0 -1
  368. package/lib/features/export/index.js +0 -35
  369. package/lib/features/export/index.js.map +0 -1
  370. package/lib/features/grid/index.d.ts +0 -21
  371. package/lib/features/grid/index.d.ts.map +0 -1
  372. package/lib/features/grid/index.js +0 -37
  373. package/lib/features/grid/index.js.map +0 -1
  374. package/lib/features/helper-lines/index.d.ts +0 -22
  375. package/lib/features/helper-lines/index.d.ts.map +0 -1
  376. package/lib/features/helper-lines/index.js +0 -38
  377. package/lib/features/helper-lines/index.js.map +0 -1
  378. package/lib/features/hints/index.d.ts +0 -19
  379. package/lib/features/hints/index.d.ts.map +0 -1
  380. package/lib/features/hints/index.js +0 -35
  381. package/lib/features/hints/index.js.map +0 -1
  382. package/lib/features/hover/index.d.ts +0 -18
  383. package/lib/features/hover/index.d.ts.map +0 -1
  384. package/lib/features/hover/index.js +0 -34
  385. package/lib/features/hover/index.js.map +0 -1
  386. package/lib/features/index.d.ts +0 -46
  387. package/lib/features/index.d.ts.map +0 -1
  388. package/lib/features/index.js +0 -62
  389. package/lib/features/index.js.map +0 -1
  390. package/lib/features/label-edit/index.d.ts +0 -19
  391. package/lib/features/label-edit/index.d.ts.map +0 -1
  392. package/lib/features/label-edit/index.js +0 -35
  393. package/lib/features/label-edit/index.js.map +0 -1
  394. package/lib/features/label-edit-ui/index.d.ts +0 -18
  395. package/lib/features/label-edit-ui/index.d.ts.map +0 -1
  396. package/lib/features/label-edit-ui/index.js +0 -34
  397. package/lib/features/label-edit-ui/index.js.map +0 -1
  398. package/lib/features/layout/index.d.ts +0 -18
  399. package/lib/features/layout/index.d.ts.map +0 -1
  400. package/lib/features/layout/index.js +0 -34
  401. package/lib/features/layout/index.js.map +0 -1
  402. package/lib/features/navigation/index.d.ts +0 -19
  403. package/lib/features/navigation/index.d.ts.map +0 -1
  404. package/lib/features/navigation/index.js +0 -35
  405. package/lib/features/navigation/index.js.map +0 -1
  406. package/lib/features/reconnect/index.d.ts +0 -17
  407. package/lib/features/reconnect/index.d.ts.map +0 -1
  408. package/lib/features/reconnect/index.js +0 -33
  409. package/lib/features/reconnect/index.js.map +0 -1
  410. package/lib/features/routing/index.d.ts +0 -18
  411. package/lib/features/routing/index.d.ts.map +0 -1
  412. package/lib/features/routing/index.js +0 -34
  413. package/lib/features/routing/index.js.map +0 -1
  414. package/lib/features/save/index.d.ts +0 -18
  415. package/lib/features/save/index.d.ts.map +0 -1
  416. package/lib/features/save/index.js +0 -34
  417. package/lib/features/save/index.js.map +0 -1
  418. package/lib/features/select/index.d.ts +0 -19
  419. package/lib/features/select/index.d.ts.map +0 -1
  420. package/lib/features/select/index.js +0 -35
  421. package/lib/features/select/index.js.map +0 -1
  422. package/lib/features/source-model-watcher/index.d.ts +0 -18
  423. package/lib/features/source-model-watcher/index.d.ts.map +0 -1
  424. package/lib/features/source-model-watcher/index.js +0 -34
  425. package/lib/features/source-model-watcher/index.js.map +0 -1
  426. package/lib/features/status/index.d.ts +0 -18
  427. package/lib/features/status/index.d.ts.map +0 -1
  428. package/lib/features/status/index.js +0 -34
  429. package/lib/features/status/index.js.map +0 -1
  430. package/lib/features/svg-metadata/index.d.ts +0 -18
  431. package/lib/features/svg-metadata/index.d.ts.map +0 -1
  432. package/lib/features/svg-metadata/index.js +0 -34
  433. package/lib/features/svg-metadata/index.js.map +0 -1
  434. package/lib/features/tool-palette/index.d.ts +0 -18
  435. package/lib/features/tool-palette/index.d.ts.map +0 -1
  436. package/lib/features/tool-palette/index.js +0 -34
  437. package/lib/features/tool-palette/index.js.map +0 -1
  438. package/lib/features/tools/change-bounds/index.d.ts +0 -23
  439. package/lib/features/tools/change-bounds/index.d.ts.map +0 -1
  440. package/lib/features/tools/change-bounds/index.js +0 -39
  441. package/lib/features/tools/change-bounds/index.js.map +0 -1
  442. package/lib/features/tools/deletion/index.d.ts +0 -18
  443. package/lib/features/tools/deletion/index.d.ts.map +0 -1
  444. package/lib/features/tools/deletion/index.js +0 -34
  445. package/lib/features/tools/deletion/index.js.map +0 -1
  446. package/lib/features/tools/edge-creation/index.d.ts +0 -21
  447. package/lib/features/tools/edge-creation/index.d.ts.map +0 -1
  448. package/lib/features/tools/edge-creation/index.js +0 -37
  449. package/lib/features/tools/edge-creation/index.js.map +0 -1
  450. package/lib/features/tools/edge-edit/index.d.ts +0 -19
  451. package/lib/features/tools/edge-edit/index.d.ts.map +0 -1
  452. package/lib/features/tools/edge-edit/index.js +0 -35
  453. package/lib/features/tools/edge-edit/index.js.map +0 -1
  454. package/lib/features/tools/index.d.ts +0 -24
  455. package/lib/features/tools/index.d.ts.map +0 -1
  456. package/lib/features/tools/index.js +0 -40
  457. package/lib/features/tools/index.js.map +0 -1
  458. package/lib/features/tools/marquee-selection/index.d.ts +0 -23
  459. package/lib/features/tools/marquee-selection/index.d.ts.map +0 -1
  460. package/lib/features/tools/marquee-selection/index.js +0 -39
  461. package/lib/features/tools/marquee-selection/index.js.map +0 -1
  462. package/lib/features/tools/node-creation/index.d.ts +0 -18
  463. package/lib/features/tools/node-creation/index.d.ts.map +0 -1
  464. package/lib/features/tools/node-creation/index.js +0 -34
  465. package/lib/features/tools/node-creation/index.js.map +0 -1
  466. package/lib/features/undo-redo/index.d.ts +0 -18
  467. package/lib/features/undo-redo/index.d.ts.map +0 -1
  468. package/lib/features/undo-redo/index.js +0 -34
  469. package/lib/features/undo-redo/index.js.map +0 -1
  470. package/lib/features/validation/index.d.ts +0 -20
  471. package/lib/features/validation/index.d.ts.map +0 -1
  472. package/lib/features/validation/index.js +0 -36
  473. package/lib/features/validation/index.js.map +0 -1
  474. package/lib/features/viewport/index.d.ts +0 -21
  475. package/lib/features/viewport/index.d.ts.map +0 -1
  476. package/lib/features/viewport/index.js +0 -37
  477. package/lib/features/viewport/index.js.map +0 -1
  478. package/lib/utils/index.d.ts +0 -23
  479. package/lib/utils/index.d.ts.map +0 -1
  480. package/lib/utils/index.js +0 -39
  481. package/lib/utils/index.js.map +0 -1
  482. package/lib/views/index.d.ts +0 -24
  483. package/lib/views/index.d.ts.map +0 -1
  484. package/lib/views/index.js +0 -40
  485. package/lib/views/index.js.map +0 -1
  486. package/src/base/auto-complete/index.ts +0 -20
  487. package/src/base/feedback/index.ts +0 -21
  488. package/src/base/focus/index.ts +0 -17
  489. package/src/base/index.ts +0 -33
  490. package/src/base/model/index.ts +0 -19
  491. package/src/base/tool-manager/index.ts +0 -17
  492. package/src/base/ui-extension/index.ts +0 -17
  493. package/src/base/view/index.ts +0 -18
  494. package/src/features/accessibility/edge-autocomplete/index.ts +0 -19
  495. package/src/features/accessibility/element-navigation/index.ts +0 -21
  496. package/src/features/accessibility/focus-tracker/index.ts +0 -17
  497. package/src/features/accessibility/index.ts +0 -30
  498. package/src/features/accessibility/key-shortcut/index.ts +0 -18
  499. package/src/features/accessibility/keyboard-grid/index.ts +0 -20
  500. package/src/features/accessibility/keyboard-pointer/index.ts +0 -21
  501. package/src/features/accessibility/keyboard-tool-palette/index.ts +0 -17
  502. package/src/features/accessibility/move-zoom/index.ts +0 -18
  503. package/src/features/accessibility/resize-key-tool/index.ts +0 -18
  504. package/src/features/accessibility/search/index.ts +0 -18
  505. package/src/features/accessibility/toast/index.ts +0 -18
  506. package/src/features/accessibility/view-key-tools/index.ts +0 -19
  507. package/src/features/bounds/index.ts +0 -24
  508. package/src/features/change-bounds/index.ts +0 -21
  509. package/src/features/command-palette/index.ts +0 -19
  510. package/src/features/context-menu/index.ts +0 -19
  511. package/src/features/copy-paste/index.ts +0 -19
  512. package/src/features/debug/index.ts +0 -19
  513. package/src/features/decoration/index.ts +0 -17
  514. package/src/features/element-template/index.ts +0 -19
  515. package/src/features/export/index.ts +0 -18
  516. package/src/features/grid/index.ts +0 -20
  517. package/src/features/helper-lines/index.ts +0 -21
  518. package/src/features/hints/index.ts +0 -18
  519. package/src/features/hover/index.ts +0 -17
  520. package/src/features/index.ts +0 -45
  521. package/src/features/label-edit/index.ts +0 -18
  522. package/src/features/label-edit-ui/index.ts +0 -17
  523. package/src/features/layout/index.ts +0 -17
  524. package/src/features/navigation/index.ts +0 -18
  525. package/src/features/reconnect/index.ts +0 -16
  526. package/src/features/routing/index.ts +0 -17
  527. package/src/features/save/index.ts +0 -17
  528. package/src/features/select/index.ts +0 -18
  529. package/src/features/source-model-watcher/index.ts +0 -17
  530. package/src/features/status/index.ts +0 -17
  531. package/src/features/svg-metadata/index.ts +0 -17
  532. package/src/features/tool-palette/index.ts +0 -17
  533. package/src/features/tools/change-bounds/index.ts +0 -22
  534. package/src/features/tools/deletion/index.ts +0 -17
  535. package/src/features/tools/edge-creation/index.ts +0 -20
  536. package/src/features/tools/edge-edit/index.ts +0 -18
  537. package/src/features/tools/index.ts +0 -23
  538. package/src/features/tools/marquee-selection/index.ts +0 -22
  539. package/src/features/tools/node-creation/index.ts +0 -17
  540. package/src/features/undo-redo/index.ts +0 -17
  541. package/src/features/validation/index.ts +0 -19
  542. package/src/features/viewport/index.ts +0 -20
  543. package/src/utils/index.ts +0 -22
  544. package/src/views/index.ts +0 -23
@@ -0,0 +1,176 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2024 EclipseSource and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0.
7
+ *
8
+ * This Source Code may also be made available under the following Secondary
9
+ * Licenses when the conditions for such availability set forth in the Eclipse
10
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ * with the GNU Classpath Exception which is available at
12
+ * https://www.gnu.org/software/classpath/license.html.
13
+ *
14
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
+ ********************************************************************************/
16
+ import { Action, Command, CommandExecutionContext, Disposable } from '@eclipse-glsp/sprotty';
17
+ import { expect } from 'chai';
18
+ import { IFeedbackActionDispatcher, IFeedbackEmitter } from './feedback-action-dispatcher';
19
+ import { FeedbackEmitter } from './feedback-emitter';
20
+
21
+ class MockFeedbackActionDispatcher implements IFeedbackActionDispatcher {
22
+ protected feedbackEmitters: Map<IFeedbackEmitter, Action[]> = new Map();
23
+
24
+ registerFeedback(feedbackEmitter: IFeedbackEmitter, actions: Action[]): Disposable {
25
+ this.feedbackEmitters.set(feedbackEmitter, actions);
26
+ return Disposable.create(() => this.deregisterFeedback(feedbackEmitter));
27
+ }
28
+
29
+ deregisterFeedback(feedbackEmitter: IFeedbackEmitter, _actions?: Action[]): void {
30
+ this.feedbackEmitters.delete(feedbackEmitter);
31
+ }
32
+
33
+ getRegisteredFeedback(): Action[] {
34
+ const result: Action[] = [];
35
+ this.feedbackEmitters.forEach((value, key) => result.push(...value));
36
+ return result;
37
+ }
38
+
39
+ getFeedbackCommands(): Command[] {
40
+ return [];
41
+ }
42
+
43
+ createEmitter(): FeedbackEmitter {
44
+ return new FeedbackEmitter(this);
45
+ }
46
+
47
+ async applyFeedbackCommands(context: CommandExecutionContext): Promise<void> {}
48
+ }
49
+
50
+ describe('FeedbackEmitter', () => {
51
+ describe('Initial State', () => {
52
+ it('On creation nothing should be submitted.', () => {
53
+ const feedbackActionDispatcher = new MockFeedbackActionDispatcher();
54
+ const feedback = feedbackActionDispatcher.createEmitter();
55
+ feedback.submit();
56
+ expect(feedbackActionDispatcher['feedbackEmitters']).to.be.empty;
57
+ });
58
+ });
59
+
60
+ describe('Adding Feedback', () => {
61
+ it('Should add an action as part of the emitter feedback.', () => {
62
+ const feedbackActionDispatcher = new MockFeedbackActionDispatcher();
63
+ const feedback = feedbackActionDispatcher.createEmitter();
64
+ const action: Action = { kind: 'action' };
65
+ feedback.add(action);
66
+ expect(feedback['feedbackActions']).to.deep.equal([action]);
67
+ });
68
+
69
+ it('Should add an action and cleanup action as part of the emitter feedback.', () => {
70
+ const feedbackActionDispatcher = new MockFeedbackActionDispatcher();
71
+ const feedback = feedbackActionDispatcher.createEmitter();
72
+ const action: Action = { kind: 'action' };
73
+ const cleanupAction: Action = { kind: 'cleanup' };
74
+ feedback.add(action, cleanupAction);
75
+ expect(feedback['feedbackActions']).to.deep.equal([action]);
76
+ expect(feedback['cleanupActions']).to.deep.equal([cleanupAction]);
77
+ });
78
+ });
79
+
80
+ describe('Merging Feedback', () => {
81
+ it('Should merge the feedback of another emitter into this emitter.', () => {
82
+ const feedbackActionDispatcher = new MockFeedbackActionDispatcher();
83
+ const feedback1 = feedbackActionDispatcher.createEmitter();
84
+ const feedback2 = feedbackActionDispatcher.createEmitter();
85
+ const action1: Action = { kind: 'action1' };
86
+ const action2: Action = { kind: 'action2' };
87
+ feedback1.add(action1);
88
+ feedback2.add(action2);
89
+ feedback1.merge(feedback2);
90
+ expect(feedback1['feedbackActions']).to.deep.equal([action1, action2]);
91
+ });
92
+ });
93
+
94
+ describe('Removing Feedback', () => {
95
+ it('Should remove the action from the emitter feedback.', () => {
96
+ const feedbackActionDispatcher = new MockFeedbackActionDispatcher();
97
+ const feedback = feedbackActionDispatcher.createEmitter();
98
+ const action: Action = { kind: 'action' };
99
+ feedback.add(action);
100
+ feedback.remove(action);
101
+ expect(feedback['feedbackActions']).to.be.empty;
102
+ });
103
+
104
+ it('Should remove the action together with the cleanup action from the emitter feedback.', () => {
105
+ const feedbackActionDispatcher = new MockFeedbackActionDispatcher();
106
+ const feedback = feedbackActionDispatcher.createEmitter();
107
+ const action: Action = { kind: 'action' };
108
+ const cleanupAction: Action = { kind: 'cleanup' };
109
+ feedback.add(action, cleanupAction);
110
+ feedback.remove(action);
111
+ expect(feedback['feedbackActions']).to.be.empty;
112
+ expect(feedback['cleanupActions']).to.be.empty;
113
+ });
114
+ });
115
+
116
+ describe('Clearing Feedback', () => {
117
+ it('Should clear any pending feedback actions and cleanup actions.', () => {
118
+ const feedbackActionDispatcher = new MockFeedbackActionDispatcher();
119
+ const feedback = feedbackActionDispatcher.createEmitter();
120
+ const action: Action = { kind: 'action' };
121
+ const cleanupAction: Action = { kind: 'cleanup' };
122
+ feedback.add(action, cleanupAction);
123
+ feedback.clear();
124
+ expect(feedback['feedbackActions']).to.be.empty;
125
+ expect(feedback['cleanupActions']).to.be.empty;
126
+ });
127
+ });
128
+
129
+ describe('Submitting Feedback', () => {
130
+ it('Should register any pending actions as feedback.', () => {
131
+ const feedbackActionDispatcher = new MockFeedbackActionDispatcher();
132
+ const feedback = feedbackActionDispatcher.createEmitter();
133
+ const action: Action = { kind: 'action' };
134
+ feedback.add(action);
135
+ feedback.submit();
136
+ expect(feedbackActionDispatcher['feedbackEmitters'].size).to.equal(1);
137
+ expect(feedbackActionDispatcher['feedbackEmitters'].get(feedback)).to.deep.equal([action]);
138
+ });
139
+ });
140
+
141
+ describe('Discarding Feedback', () => {
142
+ it('Should remove the registered feedback without calling any cleanup actions.', () => {
143
+ const feedbackActionDispatcher = new MockFeedbackActionDispatcher();
144
+ const feedback = feedbackActionDispatcher.createEmitter();
145
+ const action: Action = { kind: 'action' };
146
+ feedback.add(action);
147
+ feedback.submit();
148
+ feedback.discard();
149
+ expect(feedbackActionDispatcher['feedbackEmitters']).to.be.empty;
150
+ });
151
+ });
152
+
153
+ describe('Reverting Feedback', () => {
154
+ it('Should remove the registered feedback and call the registered cleanup actions.', () => {
155
+ const feedbackActionDispatcher = new MockFeedbackActionDispatcher();
156
+ const feedback = feedbackActionDispatcher.createEmitter();
157
+ const action: Action = { kind: 'action' };
158
+ const cleanupAction: Action = { kind: 'cleanup' };
159
+ feedback.add(action, cleanupAction);
160
+ feedback.submit();
161
+ feedback.revert();
162
+ expect(feedbackActionDispatcher['feedbackEmitters']).to.be.empty;
163
+ });
164
+ });
165
+
166
+ describe('Disposing Feedback', () => {
167
+ it('Should dispose the registered feedback and any pending feedback actions.', () => {
168
+ const feedbackActionDispatcher = new MockFeedbackActionDispatcher();
169
+ const feedback = feedbackActionDispatcher.createEmitter();
170
+ const action: Action = { kind: 'action' };
171
+ feedback.add(action);
172
+ feedback.dispose();
173
+ expect(feedbackActionDispatcher['feedbackEmitters']).to.be.empty;
174
+ });
175
+ });
176
+ });
@@ -17,10 +17,14 @@
17
17
  import { Action, Disposable, arrayOf } from '@eclipse-glsp/sprotty';
18
18
  import { IFeedbackActionDispatcher, IFeedbackEmitter, MaybeActions } from './feedback-action-dispatcher';
19
19
 
20
+ // counter for internal id, mainly useful for debugging
21
+ let idCounter = 0;
22
+
20
23
  /**
21
24
  * A helper object to collect, submit and undo feedback consisting of several actions.
22
25
  */
23
26
  export class FeedbackEmitter implements IFeedbackEmitter, Disposable {
27
+ protected id = idCounter++;
24
28
  protected feedbackActions: (Action | undefined)[] = [];
25
29
  protected cleanupActions: MaybeActions[] = [];
26
30
  protected deregistration?: Disposable;
@@ -46,6 +50,17 @@ export class FeedbackEmitter implements IFeedbackEmitter, Disposable {
46
50
  return this;
47
51
  }
48
52
 
53
+ /**
54
+ * Merges the feedback of another emitter into this emitter.
55
+ *
56
+ * @param feedback feedback to merge
57
+ */
58
+ merge(feedback: FeedbackEmitter): this {
59
+ this.feedbackActions.push(...feedback.feedbackActions);
60
+ this.cleanupActions.push(...feedback.cleanupActions);
61
+ return this;
62
+ }
63
+
49
64
  /**
50
65
  * Removes the action as part of this emitters feedback. If the action cannot be found, this is a no-op.
51
66
  * Please note that this also removed the corresponding cleanup action.
@@ -56,9 +71,9 @@ export class FeedbackEmitter implements IFeedbackEmitter, Disposable {
56
71
  */
57
72
  remove(action: Action): this {
58
73
  const idx = this.feedbackActions.indexOf(action);
59
- if (idx) {
60
- delete this.feedbackActions[idx];
61
- delete this.cleanupActions[idx];
74
+ if (idx >= 0) {
75
+ this.feedbackActions.splice(idx, 1);
76
+ this.cleanupActions.splice(idx, 1);
62
77
  }
63
78
  return this;
64
79
  }
@@ -79,8 +94,12 @@ export class FeedbackEmitter implements IFeedbackEmitter, Disposable {
79
94
  // with 'arrayOf' we skip undefined entries that are created for non-cleanup actions or cleanup-only actions
80
95
  const actions = arrayOf(...this.feedbackActions);
81
96
  const cleanupActions = arrayOf(...this.cleanupActions);
82
- this.deregistration = this.feedbackDispatcher.registerFeedback(this, actions, () => cleanupActions.flatMap(MaybeActions.asArray));
83
- this.clear();
97
+ if (actions.length > 0 || cleanupActions.length > 0) {
98
+ this.deregistration = this.feedbackDispatcher.registerFeedback(this, actions, () =>
99
+ cleanupActions.flatMap(MaybeActions.asArray)
100
+ );
101
+ this.clear();
102
+ }
84
103
  return this;
85
104
  }
86
105
 
@@ -18,8 +18,8 @@ import { AssertionError, expect } from 'chai';
18
18
  import { Container, injectable } from 'inversify';
19
19
  import * as sinon from 'sinon';
20
20
  import { defaultModule } from './default.module';
21
- import { FeedbackEmitter } from './feedback/feeback-emitter';
22
21
  import { IFeedbackActionDispatcher, IFeedbackEmitter } from './feedback/feedback-action-dispatcher';
22
+ import { FeedbackEmitter } from './feedback/feedback-emitter';
23
23
  import { ISelectionListener, SelectFeedbackAction, SelectionService } from './selection-service';
24
24
 
25
25
  @injectable()
@@ -39,7 +39,7 @@ import { inject, injectable, postConstruct, preDestroy } from 'inversify';
39
39
  import { SelectableElement, getElements, getMatchingElements } from '../utils/gmodel-util';
40
40
  import { IGModelRootListener } from './editor-context-service';
41
41
  import { IFeedbackActionDispatcher } from './feedback/feedback-action-dispatcher';
42
- import { IDiagramStartup } from './model';
42
+ import { IDiagramStartup } from './model/diagram-loader';
43
43
 
44
44
  export interface ISelectionListener {
45
45
  selectionChanged(root: Readonly<GModelRoot>, selectedElements: string[], deselectedElements?: string[]): void;
@@ -29,7 +29,7 @@ import {
29
29
  } from '@eclipse-glsp/sprotty';
30
30
  import { inject, injectable } from 'inversify';
31
31
  import { EditorContextService, IEditModeListener } from '../editor-context-service';
32
- import { IDiagramStartup } from '../model';
32
+ import { IDiagramStartup } from '../model/diagram-loader';
33
33
  import { Ranked } from '../ranked';
34
34
  import { EnableDefaultToolsAction, EnableToolsAction, Tool } from './tool';
35
35
  /**
@@ -16,7 +16,7 @@
16
16
 
17
17
  import { IUIExtension, LazyInjector, MaybePromise, TYPES, UIExtensionRegistry } from '@eclipse-glsp/sprotty';
18
18
  import { inject, injectable, optional } from 'inversify';
19
- import { IDiagramStartup } from '../model';
19
+ import { IDiagramStartup } from '../model/diagram-loader';
20
20
 
21
21
  @injectable()
22
22
  export class GLSPUIExtensionRegistry extends UIExtensionRegistry implements IDiagramStartup {
@@ -15,7 +15,7 @@
15
15
  ********************************************************************************/
16
16
  import { Disposable, KeyListener, KeyTool, LazyInjector, MaybePromise, TYPES } from '@eclipse-glsp/sprotty';
17
17
  import { inject, injectable, optional } from 'inversify';
18
- import { IDiagramStartup } from '../model';
18
+ import { IDiagramStartup } from '../model/diagram-loader';
19
19
 
20
20
  @injectable()
21
21
  export class GLSPKeyTool extends KeyTool implements IDiagramStartup {
@@ -25,7 +25,7 @@ import {
25
25
  TYPES
26
26
  } from '@eclipse-glsp/sprotty';
27
27
  import { inject, injectable, optional } from 'inversify';
28
- import { IDiagramStartup } from '../model';
28
+ import { IDiagramStartup } from '../model/diagram-loader';
29
29
  import { Ranked } from '../ranked';
30
30
 
31
31
  /**
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2023 Business Informatics Group (TU Wien) and others.
2
+ * Copyright (c) 2023-2024 Business Informatics Group (TU Wien) and others.
3
3
  *
4
4
  * This program and the accompanying materials are made available under the
5
5
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -35,9 +35,9 @@ import {
35
35
  } from '@eclipse-glsp/sprotty';
36
36
  import { inject, injectable, optional, postConstruct } from 'inversify';
37
37
  import { DebouncedFunc, debounce } from 'lodash';
38
- import { FeedbackEmitter } from '../../../base';
39
38
  import { EditorContextService } from '../../../base/editor-context-service';
40
39
  import { IFeedbackActionDispatcher } from '../../../base/feedback/feedback-action-dispatcher';
40
+ import { FeedbackEmitter } from '../../../base/feedback/feedback-emitter';
41
41
  import { SelectableBoundsAware, getElements, isSelectableAndBoundsAware } from '../../../utils/gmodel-util';
42
42
  import { isValidMove } from '../../../utils/layout-utils';
43
43
  import { outsideOfViewport } from '../../../utils/viewpoint-util';
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2023 Business Informatics Group (TU Wien) and others.
2
+ * Copyright (c) 2023-2024 Business Informatics Group (TU Wien) and others.
3
3
  *
4
4
  * This program and the accompanying materials are made available under the
5
5
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -31,12 +31,12 @@ import {
31
31
  } from '@eclipse-glsp/sprotty';
32
32
  import { inject, injectable, optional, postConstruct } from 'inversify';
33
33
  import { DebouncedFunc, debounce } from 'lodash';
34
- import { FeedbackEmitter } from '../../../base';
35
34
  import { EditorContextService } from '../../../base/editor-context-service';
36
35
  import { IFeedbackActionDispatcher } from '../../../base/feedback/feedback-action-dispatcher';
36
+ import { FeedbackEmitter } from '../../../base/feedback/feedback-emitter';
37
37
  import { Resizable, SelectableBoundsAware, getElements, isSelectableAndBoundsAware, toElementAndBounds } from '../../../utils/gmodel-util';
38
38
  import { isValidMove, isValidSize, minHeight, minWidth } from '../../../utils/layout-utils';
39
- import { Grid } from '../../grid';
39
+ import { Grid } from '../../grid/grid';
40
40
 
41
41
  export enum ResizeType {
42
42
  Increase,
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2023 Business Informatics Group (TU Wien) and others.
2
+ * Copyright (c) 2023-2024 Business Informatics Group (TU Wien) and others.
3
3
  *
4
4
  * This program and the accompanying materials are made available under the
5
5
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -20,8 +20,8 @@ import { matchesKeystroke } from 'sprotty/lib/utils/keyboard';
20
20
  import { GLSPActionDispatcher } from '../../../base/action-dispatcher';
21
21
  import { SelectionService } from '../../../base/selection-service';
22
22
  import { Tool } from '../../../base/tool-manager/tool';
23
- import { Grid } from '../../grid';
24
- import { ChangeBoundsManager } from '../../tools';
23
+ import { Grid } from '../../grid/grid';
24
+ import { ChangeBoundsManager } from '../../tools/change-bounds/change-bounds-manager';
25
25
  import { AccessibleKeyShortcutProvider, SetAccessibleKeyShortcutAction } from '../key-shortcut/accessible-key-shortcut';
26
26
  import { MoveElementAction, MoveViewportAction } from '../move-zoom/move-handler';
27
27
 
@@ -41,7 +41,7 @@ export class MovementKeyTool implements Tool {
41
41
  @inject(TYPES.ISnapper) @optional() readonly snapper?: ISnapper;
42
42
  @inject(TYPES.IActionDispatcher) readonly actionDispatcher: GLSPActionDispatcher;
43
43
  @inject(TYPES.Grid) @optional() protected grid: Grid;
44
- @inject(TYPES.IChangeBoundsManager) readonly changeBoundsManager: ChangeBoundsManager;
44
+ @inject(ChangeBoundsManager) readonly changeBoundsManager: ChangeBoundsManager;
45
45
 
46
46
  get id(): string {
47
47
  return MovementKeyTool.ID;
@@ -24,9 +24,9 @@ import {
24
24
  isLayoutContainer
25
25
  } from '@eclipse-glsp/sprotty';
26
26
  import { inject, injectable } from 'inversify';
27
- import { Ranked } from '../../base';
28
27
  import { GLSPActionDispatcher } from '../../base/action-dispatcher';
29
28
  import { FeedbackCommand } from '../../base/feedback/feedback-command';
29
+ import { Ranked } from '../../base/ranked';
30
30
  import { LocalRequestBoundsAction } from './local-bounds';
31
31
 
32
32
  export interface SetBoundsFeedbackAction extends Omit<SetBoundsAction, 'kind'> {
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2019-2023 EclipseSource and others.
2
+ * Copyright (c) 2019-2024 EclipseSource and others.
3
3
  *
4
4
  * This program and the accompanying materials are made available under the
5
5
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -15,6 +15,7 @@
15
15
  ********************************************************************************/
16
16
  import {
17
17
  Bounds,
18
+ Direction,
18
19
  GChildElement,
19
20
  GModelElement,
20
21
  GParentElement,
@@ -25,8 +26,8 @@ import {
25
26
  isMoveable,
26
27
  isSelectable
27
28
  } from '@eclipse-glsp/sprotty';
28
- import { CursorCSS } from '../../base';
29
- import { BoundsAwareModelElement, MoveableElement, ResizableModelElement } from '../../utils';
29
+ import { CursorCSS } from '../../base/feedback/css-feedback';
30
+ import { BoundsAwareModelElement, MoveableElement, ResizableModelElement } from '../../utils/gmodel-util';
30
31
 
31
32
  export const resizeFeature = Symbol('resizeFeature');
32
33
 
@@ -47,6 +48,20 @@ export enum ResizeHandleLocation {
47
48
  }
48
49
 
49
50
  export namespace ResizeHandleLocation {
51
+ export const CORNERS: ResizeHandleLocation[] = [
52
+ ResizeHandleLocation.TopLeft,
53
+ ResizeHandleLocation.TopRight,
54
+ ResizeHandleLocation.BottomRight,
55
+ ResizeHandleLocation.BottomLeft
56
+ ];
57
+ export const CROSS: ResizeHandleLocation[] = [
58
+ ResizeHandleLocation.Top,
59
+ ResizeHandleLocation.Right,
60
+ ResizeHandleLocation.Bottom,
61
+ ResizeHandleLocation.Left
62
+ ];
63
+ export const ALL = Object.values(ResizeHandleLocation).filter(value => typeof value !== 'function') as ResizeHandleLocation[];
64
+
50
65
  export function opposite(location: ResizeHandleLocation): ResizeHandleLocation {
51
66
  switch (location) {
52
67
  case ResizeHandleLocation.TopLeft:
@@ -67,6 +82,27 @@ export namespace ResizeHandleLocation {
67
82
  return ResizeHandleLocation.Right;
68
83
  }
69
84
  }
85
+
86
+ export function direction(location: ResizeHandleLocation): Direction[] {
87
+ switch (location) {
88
+ case ResizeHandleLocation.TopLeft:
89
+ return [Direction.Up, Direction.Left];
90
+ case ResizeHandleLocation.Top:
91
+ return [Direction.Up];
92
+ case ResizeHandleLocation.TopRight:
93
+ return [Direction.Up, Direction.Right];
94
+ case ResizeHandleLocation.Right:
95
+ return [Direction.Right];
96
+ case ResizeHandleLocation.BottomRight:
97
+ return [Direction.Down, Direction.Right];
98
+ case ResizeHandleLocation.Bottom:
99
+ return [Direction.Down];
100
+ case ResizeHandleLocation.BottomLeft:
101
+ return [Direction.Down, Direction.Left];
102
+ case ResizeHandleLocation.Left:
103
+ return [Direction.Left];
104
+ }
105
+ }
70
106
  }
71
107
 
72
108
  export function isBoundsAwareMoveable(element: GModelElement): element is BoundsAwareModelElement & MoveableElement {
@@ -182,19 +218,8 @@ export class SResizeHandle extends GChildElement implements Hoverable {
182
218
  }
183
219
  }
184
220
 
185
- export function addResizeHandles(
186
- element: ResizableModelElement,
187
- locations: ResizeHandleLocation[] = [
188
- ResizeHandleLocation.TopLeft,
189
- ResizeHandleLocation.Top,
190
- ResizeHandleLocation.BottomLeft,
191
- ResizeHandleLocation.BottomRight
192
- ]
193
- ): void {
194
- for (const location of Object.values(ResizeHandleLocation)) {
195
- if (typeof location === 'function') {
196
- continue;
197
- }
221
+ export function addResizeHandles(element: ResizableModelElement, locations: ResizeHandleLocation[] = ResizeHandleLocation.CORNERS): void {
222
+ for (const location of ResizeHandleLocation.ALL) {
198
223
  const existing = element.children.find(child => child instanceof SResizeHandle && child.location === location);
199
224
  if (locations.includes(location) && !existing) {
200
225
  // add missing handle
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2019-2023 EclipseSource and others.
2
+ * Copyright (c) 2019-2024 EclipseSource and others.
3
3
  *
4
4
  * This program and the accompanying materials are made available under the
5
5
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -13,12 +13,12 @@
13
13
  *
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
- import { Bounds, GModelElement, GNode, GParentElement, Point } from '@eclipse-glsp/sprotty';
16
+ import { Bounds, Dimension, GModelElement, GNode, GParentElement, Point, isBoundsAware, isMoveable } from '@eclipse-glsp/sprotty';
17
17
  import { injectable } from 'inversify';
18
18
  import { ModifyCSSFeedbackAction } from '../../base/feedback/css-feedback';
19
- import { BoundsAwareModelElement } from '../../utils';
19
+ import { BoundsAwareModelElement } from '../../utils/gmodel-util';
20
20
  import { toAbsoluteBounds } from '../../utils/viewpoint-util';
21
- import { SResizeHandle, isBoundsAwareMoveable } from './model';
21
+ import { SResizeHandle } from './model';
22
22
 
23
23
  /**
24
24
  * A `MovementRestrictor` is an optional service that can be used by tools to validate
@@ -48,27 +48,27 @@ export class NoOverlapMovementRestrictor implements IMovementRestrictor {
48
48
  cssClasses = ['movement-not-allowed'];
49
49
 
50
50
  validate(element: GModelElement, newLocation?: Point): boolean {
51
- if (!isBoundsAwareMoveable(element) || !newLocation) {
51
+ if (!isMoveable(element) || !newLocation) {
52
52
  return false;
53
53
  }
54
54
  // Create ghost element at the newLocation
55
+ const dimensions: Dimension = isBoundsAware(element) ? element.bounds : { width: 1, height: 1 };
55
56
  const ghostElement = Object.create(element) as BoundsAwareModelElement;
56
- ghostElement.bounds = {
57
- x: newLocation.x,
58
- y: newLocation.y,
59
- width: element.bounds.width,
60
- height: element.bounds.height
61
- };
57
+ ghostElement.bounds = { ...dimensions, ...newLocation };
62
58
  ghostElement.type = 'Ghost';
63
59
  ghostElement.id = element.id;
64
60
  return !Array.from(
65
61
  element.root.index
66
62
  .all()
67
- .filter(e => e.id !== ghostElement.id && e !== ghostElement.root && e instanceof GNode)
68
- .map(e => e as BoundsAwareModelElement)
63
+ .filter(node => node.id !== ghostElement.id && node !== ghostElement.root && node instanceof GNode)
64
+ .map(node => node as BoundsAwareModelElement)
69
65
  ).some(e => this.areOverlapping(e, ghostElement));
70
66
  }
71
67
 
68
+ protected isBoundsRelevant(element: GModelElement, ghostElement: BoundsAwareModelElement): element is BoundsAwareModelElement {
69
+ return element.id !== ghostElement.id && element !== ghostElement.root && element instanceof GNode && isBoundsAware(element);
70
+ }
71
+
72
72
  protected areOverlapping(element1: BoundsAwareModelElement, element2: BoundsAwareModelElement): boolean {
73
73
  return Bounds.overlap(toAbsoluteBounds(element1), toAbsoluteBounds(element2));
74
74
  }
@@ -18,7 +18,7 @@
18
18
 
19
19
  import { GModelElement } from '@eclipse-glsp/sprotty';
20
20
  import { expect } from 'chai';
21
- import { GridSnapper } from '../grid';
21
+ import { GridSnapper } from './../grid/grid-snapper';
22
22
  import { PointPositionUpdater } from './point-position-updater';
23
23
 
24
24
  describe('PointPositionUpdater', () => {
@@ -15,11 +15,11 @@
15
15
  ********************************************************************************/
16
16
  /* eslint-disable max-len */
17
17
 
18
- import { Bounds, GModelElement, IVNodePostprocessor, Point, TYPES, isDecoration, isSizeable, setClass, svg } from '@eclipse-glsp/sprotty';
18
+ import { Bounds, GModelElement, IVNodePostprocessor, Point, isDecoration, isSizeable, setClass, svg } from '@eclipse-glsp/sprotty';
19
19
  import { inject, injectable, optional } from 'inversify';
20
20
  import { VNode } from 'snabbdom';
21
21
  import { GGraph } from '../../model';
22
- import { BoundsAwareModelElement } from '../../utils';
22
+ import { BoundsAwareModelElement } from '../../utils/gmodel-util';
23
23
  import { DebugManager } from './debug-manager';
24
24
 
25
25
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -29,7 +29,7 @@ export const CSS_DEBUG_BOUNDS = 'debug-bounds';
29
29
 
30
30
  @injectable()
31
31
  export class DebugBoundsDecorator implements IVNodePostprocessor {
32
- @inject(TYPES.IDebugManager) @optional() protected debugManager?: DebugManager;
32
+ @inject(DebugManager) @optional() protected debugManager?: DebugManager;
33
33
 
34
34
  decorate(vnode: VNode, element: GModelElement): VNode {
35
35
  if (!this.debugManager?.isDebugEnabled) {
@@ -87,7 +87,7 @@ export class DebugBoundsDecorator implements IVNodePostprocessor {
87
87
  }
88
88
 
89
89
  protected renderTopLeftCorner(element: BoundsAwareModelElement): VNode {
90
- const position = Bounds.topLeft(element.bounds);
90
+ const position = Bounds.position(element.bounds);
91
91
  const topLeft = Bounds.topLeft(element.bounds);
92
92
  const corner = Point.subtract(topLeft, position);
93
93
  return (
@@ -104,7 +104,7 @@ export class DebugBoundsDecorator implements IVNodePostprocessor {
104
104
  }
105
105
 
106
106
  protected renderTopRightCorner(element: BoundsAwareModelElement): VNode {
107
- const position = Bounds.topLeft(element.bounds);
107
+ const position = Bounds.position(element.bounds);
108
108
  const topRight = Bounds.topRight(element.bounds);
109
109
  const corner = Point.subtract(topRight, position);
110
110
  return (
@@ -121,7 +121,7 @@ export class DebugBoundsDecorator implements IVNodePostprocessor {
121
121
  }
122
122
 
123
123
  protected renderBottomLeftCorner(element: BoundsAwareModelElement): VNode {
124
- const position = Bounds.topLeft(element.bounds);
124
+ const position = Bounds.position(element.bounds);
125
125
  const bottomLeft = Bounds.bottomLeft(element.bounds);
126
126
  const corner = Point.subtract(bottomLeft, position);
127
127
  return (
@@ -138,7 +138,7 @@ export class DebugBoundsDecorator implements IVNodePostprocessor {
138
138
  }
139
139
 
140
140
  protected renderBottomRightCorner(element: BoundsAwareModelElement): VNode {
141
- const position = Bounds.topLeft(element.bounds);
141
+ const position = Bounds.position(element.bounds);
142
142
  const bottomRight = Bounds.bottomRight(element.bounds);
143
143
  const corner = Point.subtract(bottomRight, position);
144
144
  return (
@@ -156,7 +156,7 @@ export class DebugBoundsDecorator implements IVNodePostprocessor {
156
156
 
157
157
  protected renderCenter(element: BoundsAwareModelElement): VNode {
158
158
  const bounds = element.bounds;
159
- const position = Bounds.topLeft(bounds);
159
+ const position = Bounds.position(bounds);
160
160
  const center = Bounds.center(bounds);
161
161
  const corner = Point.subtract(center, position);
162
162
  return (
@@ -16,7 +16,8 @@
16
16
 
17
17
  import { IActionHandler, TYPES } from '@eclipse-glsp/sprotty';
18
18
  import { inject, injectable, postConstruct } from 'inversify';
19
- import { FeedbackEmitter, IFeedbackActionDispatcher } from '../../base';
19
+ import { IFeedbackActionDispatcher } from '../../base/feedback/feedback-action-dispatcher';
20
+ import { FeedbackEmitter } from '../../base/feedback/feedback-emitter';
20
21
  import { EnableDebugModeAction } from './debug-model';
21
22
 
22
23
  @injectable()
@@ -16,8 +16,8 @@
16
16
 
17
17
  import { Action, CommandExecutionContext, CommandReturn, GModelRoot, TYPES, hasBooleanProp } from '@eclipse-glsp/sprotty';
18
18
  import { inject, injectable } from 'inversify';
19
- import { FeedbackCommand } from '../../base';
20
- import { addCssClasses, removeCssClasses } from '../../utils';
19
+ import { FeedbackCommand } from '../../base/feedback/feedback-command';
20
+ import { addCssClasses, removeCssClasses } from '../../utils/gmodel-util';
21
21
 
22
22
  export interface EnableDebugModeAction extends Action {
23
23
  kind: typeof EnableDebugModeAction.KIND;
@@ -25,7 +25,7 @@ export const debugModule = new FeatureModule((bind, unbind, isBound, rebind) =>
25
25
 
26
26
  configureCommand(context, EnableDebugModeCommand);
27
27
 
28
- bindAsService(bind, TYPES.IDebugManager, DebugManager);
28
+ bind(DebugManager).toSelf().inSingletonScope();
29
29
  configureActionHandler(context, EnableDebugModeAction.KIND, DebugManager);
30
30
 
31
31
  bindAsService(context, TYPES.IVNodePostprocessor, DebugBoundsDecorator);