@eclipse-glsp/client 2.2.0-next.328 → 2.2.0-next.330

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 (400) hide show
  1. package/css/change-bounds.css +15 -0
  2. package/css/glsp-sprotty.css +17 -0
  3. package/lib/base/action-dispatcher.js.map +1 -1
  4. package/lib/base/action-handler-registry.js.map +1 -1
  5. package/lib/base/args-feature.js.map +1 -1
  6. package/lib/base/auto-complete/auto-complete-widget.js.map +1 -1
  7. package/lib/base/auto-complete/validation-decorator.js.map +1 -1
  8. package/lib/base/command-stack.js.map +1 -1
  9. package/lib/base/drag-aware-mouse-listener.d.ts +5 -2
  10. package/lib/base/drag-aware-mouse-listener.d.ts.map +1 -1
  11. package/lib/base/drag-aware-mouse-listener.js +11 -0
  12. package/lib/base/drag-aware-mouse-listener.js.map +1 -1
  13. package/lib/base/editor-context-service.js.map +1 -1
  14. package/lib/base/feedback/css-feedback.d.ts +4 -0
  15. package/lib/base/feedback/css-feedback.d.ts.map +1 -1
  16. package/lib/base/feedback/css-feedback.js +4 -0
  17. package/lib/base/feedback/css-feedback.js.map +1 -1
  18. package/lib/base/feedback/feeback-emitter.d.ts +67 -0
  19. package/lib/base/feedback/feeback-emitter.d.ts.map +1 -0
  20. package/lib/base/feedback/feeback-emitter.js +109 -0
  21. package/lib/base/feedback/feeback-emitter.js.map +1 -0
  22. package/lib/base/feedback/feedback-action-dispatcher.d.ts +17 -5
  23. package/lib/base/feedback/feedback-action-dispatcher.d.ts.map +1 -1
  24. package/lib/base/feedback/feedback-action-dispatcher.js +23 -3
  25. package/lib/base/feedback/feedback-action-dispatcher.js.map +1 -1
  26. package/lib/base/feedback/index.d.ts +1 -0
  27. package/lib/base/feedback/index.d.ts.map +1 -1
  28. package/lib/base/feedback/index.js +1 -0
  29. package/lib/base/feedback/index.js.map +1 -1
  30. package/lib/base/focus/focus-tracker.js.map +1 -1
  31. package/lib/base/model/diagram-loader.js.map +1 -1
  32. package/lib/base/model/glsp-model-source.js.map +1 -1
  33. package/lib/base/model/model-initialization-constraint.js.map +1 -1
  34. package/lib/base/model/model-registry.js.map +1 -1
  35. package/lib/base/selection-clearing-mouse-listener.js.map +1 -1
  36. package/lib/base/selection-service.d.ts +3 -2
  37. package/lib/base/selection-service.d.ts.map +1 -1
  38. package/lib/base/selection-service.js.map +1 -1
  39. package/lib/base/tool-manager/index.d.ts +2 -2
  40. package/lib/base/tool-manager/index.d.ts.map +1 -1
  41. package/lib/base/tool-manager/index.js +2 -2
  42. package/lib/base/tool-manager/index.js.map +1 -1
  43. package/lib/base/tool-manager/tool-manager.js.map +1 -1
  44. package/lib/base/view/mouse-tool.js.map +1 -1
  45. package/lib/base/view/view-registry.js.map +1 -1
  46. package/lib/default-modules.d.ts +1 -1
  47. package/lib/default-modules.js +1 -1
  48. package/lib/default-modules.js.map +1 -1
  49. package/lib/features/accessibility/edge-autocomplete/edge-autocomplete-palette.js.map +1 -1
  50. package/lib/features/accessibility/edge-autocomplete/edge-autocomplete-tool.js.map +1 -1
  51. package/lib/features/accessibility/element-navigation/diagram-navigation-tool.js.map +1 -1
  52. package/lib/features/accessibility/element-navigation/left-right-top-bottom-navigator.js.map +1 -1
  53. package/lib/features/accessibility/element-navigation/local-element-navigator.d.ts +3 -3
  54. package/lib/features/accessibility/element-navigation/local-element-navigator.d.ts.map +1 -1
  55. package/lib/features/accessibility/element-navigation/local-element-navigator.js.map +1 -1
  56. package/lib/features/accessibility/element-navigation/position-navigator.js.map +1 -1
  57. package/lib/features/accessibility/focus-tracker/focus-tracker-tool.js.map +1 -1
  58. package/lib/features/accessibility/global-keylistener-tool.js.map +1 -1
  59. package/lib/features/accessibility/key-shortcut/accessible-key-shortcut-tool.js.map +1 -1
  60. package/lib/features/accessibility/key-shortcut/accessible-key-shortcut.js.map +1 -1
  61. package/lib/features/accessibility/key-shortcut/index.d.ts +2 -2
  62. package/lib/features/accessibility/key-shortcut/index.d.ts.map +1 -1
  63. package/lib/features/accessibility/key-shortcut/index.js +2 -2
  64. package/lib/features/accessibility/key-shortcut/index.js.map +1 -1
  65. package/lib/features/accessibility/keyboard-grid/index.d.ts +2 -2
  66. package/lib/features/accessibility/keyboard-grid/index.d.ts.map +1 -1
  67. package/lib/features/accessibility/keyboard-grid/index.js +2 -2
  68. package/lib/features/accessibility/keyboard-grid/index.js.map +1 -1
  69. package/lib/features/accessibility/keyboard-grid/keyboard-grid.js.map +1 -1
  70. package/lib/features/accessibility/keyboard-grid/keyboard-node-grid.js.map +1 -1
  71. package/lib/features/accessibility/keyboard-pointer/index.d.ts +2 -2
  72. package/lib/features/accessibility/keyboard-pointer/index.d.ts.map +1 -1
  73. package/lib/features/accessibility/keyboard-pointer/index.js +2 -2
  74. package/lib/features/accessibility/keyboard-pointer/index.js.map +1 -1
  75. package/lib/features/accessibility/keyboard-pointer/keyboard-pointer-listener.d.ts +1 -1
  76. package/lib/features/accessibility/keyboard-pointer/keyboard-pointer-listener.d.ts.map +1 -1
  77. package/lib/features/accessibility/keyboard-pointer/keyboard-pointer-listener.js +1 -1
  78. package/lib/features/accessibility/keyboard-pointer/keyboard-pointer-listener.js.map +1 -1
  79. package/lib/features/accessibility/keyboard-pointer/keyboard-pointer.js.map +1 -1
  80. package/lib/features/accessibility/keyboard-tool-palette/index.d.ts +2 -2
  81. package/lib/features/accessibility/keyboard-tool-palette/index.d.ts.map +1 -1
  82. package/lib/features/accessibility/keyboard-tool-palette/index.js +2 -2
  83. package/lib/features/accessibility/keyboard-tool-palette/index.js.map +1 -1
  84. package/lib/features/accessibility/keyboard-tool-palette/keyboard-tool-palette.js.map +1 -1
  85. package/lib/features/accessibility/move-zoom/move-handler.d.ts +4 -2
  86. package/lib/features/accessibility/move-zoom/move-handler.d.ts.map +1 -1
  87. package/lib/features/accessibility/move-zoom/move-handler.js +10 -4
  88. package/lib/features/accessibility/move-zoom/move-handler.js.map +1 -1
  89. package/lib/features/accessibility/move-zoom/zoom-handler.js.map +1 -1
  90. package/lib/features/accessibility/resize-key-tool/resize-key-handler.d.ts +4 -2
  91. package/lib/features/accessibility/resize-key-tool/resize-key-handler.d.ts.map +1 -1
  92. package/lib/features/accessibility/resize-key-tool/resize-key-handler.js +11 -3
  93. package/lib/features/accessibility/resize-key-tool/resize-key-handler.js.map +1 -1
  94. package/lib/features/accessibility/resize-key-tool/resize-key-tool.js.map +1 -1
  95. package/lib/features/accessibility/search/index.d.ts +2 -2
  96. package/lib/features/accessibility/search/index.d.ts.map +1 -1
  97. package/lib/features/accessibility/search/index.js +2 -2
  98. package/lib/features/accessibility/search/index.js.map +1 -1
  99. package/lib/features/accessibility/search/search-palette.js.map +1 -1
  100. package/lib/features/accessibility/search/search-tool.js.map +1 -1
  101. package/lib/features/accessibility/toast/toast-tool.js.map +1 -1
  102. package/lib/features/accessibility/view-key-tools/deselect-key-tool.js.map +1 -1
  103. package/lib/features/accessibility/view-key-tools/movement-key-tool.js.map +1 -1
  104. package/lib/features/accessibility/view-key-tools/zoom-key-tool.js.map +1 -1
  105. package/lib/features/bounds/freeform-layout.js.map +1 -1
  106. package/lib/features/bounds/glsp-hidden-bounds-updater.js.map +1 -1
  107. package/lib/features/bounds/hbox-layout.js.map +1 -1
  108. package/lib/features/bounds/layouter.js.map +1 -1
  109. package/lib/features/bounds/local-bounds.js.map +1 -1
  110. package/lib/features/bounds/set-bounds-feedback-command.js.map +1 -1
  111. package/lib/features/bounds/vbox-layout.js.map +1 -1
  112. package/lib/features/change-bounds/model.d.ts +8 -8
  113. package/lib/features/change-bounds/model.d.ts.map +1 -1
  114. package/lib/features/change-bounds/model.js +17 -5
  115. package/lib/features/change-bounds/model.js.map +1 -1
  116. package/lib/features/change-bounds/movement-restrictor.d.ts +3 -2
  117. package/lib/features/change-bounds/movement-restrictor.d.ts.map +1 -1
  118. package/lib/features/change-bounds/movement-restrictor.js.map +1 -1
  119. package/lib/features/change-bounds/point-position-updater.js.map +1 -1
  120. package/lib/features/change-bounds/position-snapper.js.map +1 -1
  121. package/lib/features/command-palette/command-palette-module.d.ts +1 -1
  122. package/lib/features/command-palette/command-palette-module.js +1 -1
  123. package/lib/features/command-palette/command-palette.js.map +1 -1
  124. package/lib/features/command-palette/index.d.ts +1 -1
  125. package/lib/features/command-palette/index.js +1 -1
  126. package/lib/features/command-palette/server-command-palette-provider.js.map +1 -1
  127. package/lib/features/context-menu/context-menu-module.js.map +1 -1
  128. package/lib/features/context-menu/glsp-context-menu-mouse-listener.js.map +1 -1
  129. package/lib/features/context-menu/server-context-menu-provider.js.map +1 -1
  130. package/lib/features/copy-paste/copy-paste-context-menu.js.map +1 -1
  131. package/lib/features/copy-paste/copy-paste-handler.js.map +1 -1
  132. package/lib/features/copy-paste/copy-paste-standalone.js.map +1 -1
  133. package/lib/features/decoration/decoration-placer.js.map +1 -1
  134. package/lib/features/element-template/add-template-element.js.map +1 -1
  135. package/lib/features/element-template/mouse-tracking-element-position-listener.d.ts +15 -5
  136. package/lib/features/element-template/mouse-tracking-element-position-listener.d.ts.map +1 -1
  137. package/lib/features/element-template/mouse-tracking-element-position-listener.js +27 -38
  138. package/lib/features/element-template/mouse-tracking-element-position-listener.js.map +1 -1
  139. package/lib/features/element-template/remove-template-element.js.map +1 -1
  140. package/lib/features/export/glsp-svg-exporter.js.map +1 -1
  141. package/lib/features/helper-lines/helper-line-feedback.js.map +1 -1
  142. package/lib/features/helper-lines/helper-line-manager-default.d.ts +4 -2
  143. package/lib/features/helper-lines/helper-line-manager-default.d.ts.map +1 -1
  144. package/lib/features/helper-lines/helper-line-manager-default.js +8 -12
  145. package/lib/features/helper-lines/helper-line-manager-default.js.map +1 -1
  146. package/lib/features/helper-lines/index.d.ts +2 -2
  147. package/lib/features/helper-lines/index.d.ts.map +1 -1
  148. package/lib/features/helper-lines/index.js +2 -2
  149. package/lib/features/helper-lines/index.js.map +1 -1
  150. package/lib/features/helper-lines/model.js.map +1 -1
  151. package/lib/features/helper-lines/view.js.map +1 -1
  152. package/lib/features/hints/type-hint-provider.d.ts +3 -0
  153. package/lib/features/hints/type-hint-provider.d.ts.map +1 -1
  154. package/lib/features/hints/type-hint-provider.js +10 -1
  155. package/lib/features/hints/type-hint-provider.js.map +1 -1
  156. package/lib/features/hover/hover.js.map +1 -1
  157. package/lib/features/hover/index.d.ts +2 -2
  158. package/lib/features/hover/index.d.ts.map +1 -1
  159. package/lib/features/hover/index.js +2 -2
  160. package/lib/features/hover/index.js.map +1 -1
  161. package/lib/features/index.d.ts +2 -1
  162. package/lib/features/index.d.ts.map +1 -1
  163. package/lib/features/index.js +2 -1
  164. package/lib/features/index.js.map +1 -1
  165. package/lib/features/label-edit/edit-label-validator.js.map +1 -1
  166. package/lib/features/label-edit-ui/label-edit-ui.js.map +1 -1
  167. package/lib/features/layout/layout-elements-action.js.map +1 -1
  168. package/lib/features/navigation/navigation-action-handler.js.map +1 -1
  169. package/lib/features/navigation/navigation-target-resolver.js.map +1 -1
  170. package/lib/features/reconnect/model.js.map +1 -1
  171. package/lib/features/routing/glsp-manhattan-edge-router.js.map +1 -1
  172. package/lib/features/save/save-keylistener.js.map +1 -1
  173. package/lib/features/select/select-mouse-listener.d.ts +4 -3
  174. package/lib/features/select/select-mouse-listener.d.ts.map +1 -1
  175. package/lib/features/select/select-mouse-listener.js.map +1 -1
  176. package/lib/features/source-model-watcher/source-model-changed-action-handler.js.map +1 -1
  177. package/lib/features/status/status-overlay.js.map +1 -1
  178. package/lib/features/svg-metadata/metadata-placer.js.map +1 -1
  179. package/lib/features/tool-palette/index.d.ts +2 -2
  180. package/lib/features/tool-palette/index.d.ts.map +1 -1
  181. package/lib/features/tool-palette/index.js +2 -2
  182. package/lib/features/tool-palette/index.js.map +1 -1
  183. package/lib/features/tool-palette/tool-palette.js.map +1 -1
  184. package/lib/features/tools/base-tools.d.ts +23 -4
  185. package/lib/features/tools/base-tools.d.ts.map +1 -1
  186. package/lib/features/tools/base-tools.js +11 -6
  187. package/lib/features/tools/base-tools.js.map +1 -1
  188. package/lib/features/tools/change-bounds/change-bounds-tool-feedback.d.ts +1 -35
  189. package/lib/features/tools/change-bounds/change-bounds-tool-feedback.d.ts.map +1 -1
  190. package/lib/features/tools/change-bounds/change-bounds-tool-feedback.js +5 -206
  191. package/lib/features/tools/change-bounds/change-bounds-tool-feedback.js.map +1 -1
  192. package/lib/features/tools/change-bounds/change-bounds-tool-module.d.ts +1 -0
  193. package/lib/features/tools/change-bounds/change-bounds-tool-module.d.ts.map +1 -1
  194. package/lib/features/tools/change-bounds/change-bounds-tool-module.js +1 -0
  195. package/lib/features/tools/change-bounds/change-bounds-tool-module.js.map +1 -1
  196. package/lib/features/tools/change-bounds/change-bounds-tool-move-feedback.d.ts +67 -0
  197. package/lib/features/tools/change-bounds/change-bounds-tool-move-feedback.d.ts.map +1 -0
  198. package/lib/features/tools/change-bounds/change-bounds-tool-move-feedback.js +227 -0
  199. package/lib/features/tools/change-bounds/change-bounds-tool-move-feedback.js.map +1 -0
  200. package/lib/features/tools/change-bounds/change-bounds-tool.d.ts +34 -24
  201. package/lib/features/tools/change-bounds/change-bounds-tool.d.ts.map +1 -1
  202. package/lib/features/tools/change-bounds/change-bounds-tool.js +172 -180
  203. package/lib/features/tools/change-bounds/change-bounds-tool.js.map +1 -1
  204. package/lib/features/tools/change-bounds/index.d.ts +3 -2
  205. package/lib/features/tools/change-bounds/index.d.ts.map +1 -1
  206. package/lib/features/tools/change-bounds/index.js +3 -2
  207. package/lib/features/tools/change-bounds/index.js.map +1 -1
  208. package/lib/features/tools/change-bounds/view.d.ts +1 -1
  209. package/lib/features/tools/change-bounds/view.d.ts.map +1 -1
  210. package/lib/features/tools/change-bounds/view.js +3 -0
  211. package/lib/features/tools/change-bounds/view.js.map +1 -1
  212. package/lib/features/tools/deletion/delete-tool.d.ts +16 -1
  213. package/lib/features/tools/deletion/delete-tool.d.ts.map +1 -1
  214. package/lib/features/tools/deletion/delete-tool.js +5 -2
  215. package/lib/features/tools/deletion/delete-tool.js.map +1 -1
  216. package/lib/features/tools/edge-creation/dangling-edge-feedback.d.ts +17 -1
  217. package/lib/features/tools/edge-creation/dangling-edge-feedback.d.ts.map +1 -1
  218. package/lib/features/tools/edge-creation/dangling-edge-feedback.js +3 -1
  219. package/lib/features/tools/edge-creation/dangling-edge-feedback.js.map +1 -1
  220. package/lib/features/tools/edge-creation/edge-creation-tool-feedback.d.ts +4 -2
  221. package/lib/features/tools/edge-creation/edge-creation-tool-feedback.d.ts.map +1 -1
  222. package/lib/features/tools/edge-creation/edge-creation-tool-feedback.js +5 -8
  223. package/lib/features/tools/edge-creation/edge-creation-tool-feedback.js.map +1 -1
  224. package/lib/features/tools/edge-creation/edge-creation-tool.d.ts +20 -2
  225. package/lib/features/tools/edge-creation/edge-creation-tool.d.ts.map +1 -1
  226. package/lib/features/tools/edge-creation/edge-creation-tool.js +23 -18
  227. package/lib/features/tools/edge-creation/edge-creation-tool.js.map +1 -1
  228. package/lib/features/tools/edge-creation/index.d.ts +2 -2
  229. package/lib/features/tools/edge-creation/index.d.ts.map +1 -1
  230. package/lib/features/tools/edge-creation/index.js +2 -2
  231. package/lib/features/tools/edge-creation/index.js.map +1 -1
  232. package/lib/features/tools/edge-edit/edge-edit-tool-feedback.d.ts +3 -1
  233. package/lib/features/tools/edge-edit/edge-edit-tool-feedback.d.ts.map +1 -1
  234. package/lib/features/tools/edge-edit/edge-edit-tool-feedback.js +5 -8
  235. package/lib/features/tools/edge-edit/edge-edit-tool-feedback.js.map +1 -1
  236. package/lib/features/tools/edge-edit/edge-edit-tool.d.ts +4 -4
  237. package/lib/features/tools/edge-edit/edge-edit-tool.d.ts.map +1 -1
  238. package/lib/features/tools/edge-edit/edge-edit-tool.js +27 -44
  239. package/lib/features/tools/edge-edit/edge-edit-tool.js.map +1 -1
  240. package/lib/features/tools/edge-edit/index.d.ts +2 -2
  241. package/lib/features/tools/edge-edit/index.d.ts.map +1 -1
  242. package/lib/features/tools/edge-edit/index.js +2 -2
  243. package/lib/features/tools/edge-edit/index.js.map +1 -1
  244. package/lib/features/tools/marquee-selection/index.d.ts +2 -2
  245. package/lib/features/tools/marquee-selection/index.d.ts.map +1 -1
  246. package/lib/features/tools/marquee-selection/index.js +2 -2
  247. package/lib/features/tools/marquee-selection/index.js.map +1 -1
  248. package/lib/features/tools/marquee-selection/marquee-behavior.js.map +1 -1
  249. package/lib/features/tools/marquee-selection/marquee-mouse-tool.d.ts +3 -2
  250. package/lib/features/tools/marquee-selection/marquee-mouse-tool.d.ts.map +1 -1
  251. package/lib/features/tools/marquee-selection/marquee-mouse-tool.js +4 -2
  252. package/lib/features/tools/marquee-selection/marquee-mouse-tool.js.map +1 -1
  253. package/lib/features/tools/marquee-selection/marquee-tool-feedback.js.map +1 -1
  254. package/lib/features/tools/marquee-selection/marquee-tool.js.map +1 -1
  255. package/lib/features/tools/node-creation/node-creation-tool.d.ts +14 -5
  256. package/lib/features/tools/node-creation/node-creation-tool.d.ts.map +1 -1
  257. package/lib/features/tools/node-creation/node-creation-tool.js +58 -24
  258. package/lib/features/tools/node-creation/node-creation-tool.js.map +1 -1
  259. package/lib/features/tools/tool-focus-loss-module.js.map +1 -1
  260. package/lib/features/undo-redo/undo-redo-key-listener.js.map +1 -1
  261. package/lib/features/validation/issue-marker.js.map +1 -1
  262. package/lib/features/validation/marker-navigator.d.ts +7 -6
  263. package/lib/features/validation/marker-navigator.d.ts.map +1 -1
  264. package/lib/features/validation/marker-navigator.js.map +1 -1
  265. package/lib/features/validation/validate.d.ts +2 -5
  266. package/lib/features/validation/validate.d.ts.map +1 -1
  267. package/lib/features/validation/validate.js +4 -16
  268. package/lib/features/validation/validate.js.map +1 -1
  269. package/lib/features/viewport/glsp-scroll-mouse-listener.js.map +1 -1
  270. package/lib/features/viewport/reposition.js.map +1 -1
  271. package/lib/features/viewport/viewport-handler.js.map +1 -1
  272. package/lib/model.js.map +1 -1
  273. package/lib/standalone-modules.js.map +1 -1
  274. package/lib/utils/argument-utils.js.map +1 -1
  275. package/lib/utils/geometry-util.d.ts +1 -1
  276. package/lib/utils/geometry-util.d.ts.map +1 -1
  277. package/lib/utils/gmodel-util.d.ts +27 -2
  278. package/lib/utils/gmodel-util.d.ts.map +1 -1
  279. package/lib/utils/gmodel-util.js +30 -1
  280. package/lib/utils/gmodel-util.js.map +1 -1
  281. package/lib/utils/html-utils.js.map +1 -1
  282. package/lib/utils/layout-utils.d.ts +8 -7
  283. package/lib/utils/layout-utils.d.ts.map +1 -1
  284. package/lib/utils/layout-utils.js +2 -4
  285. package/lib/utils/layout-utils.js.map +1 -1
  286. package/lib/utils/marker.js.map +1 -1
  287. package/lib/utils/viewpoint-util.d.ts +4 -4
  288. package/lib/utils/viewpoint-util.d.ts.map +1 -1
  289. package/lib/utils/viewpoint-util.js.map +1 -1
  290. package/lib/views/compartments.js.map +1 -1
  291. package/lib/views/gedge-view.js.map +1 -1
  292. package/lib/views/glsp-projection-view.js.map +1 -1
  293. package/lib/views/index.d.ts +2 -2
  294. package/lib/views/index.d.ts.map +1 -1
  295. package/lib/views/index.js +2 -2
  296. package/lib/views/index.js.map +1 -1
  297. package/lib/views/issue-marker-view.js.map +1 -1
  298. package/lib/views/rounded-corner-view.js.map +1 -1
  299. package/lib/views/rounded-corner.d.ts +1 -1
  300. package/lib/views/rounded-corner.d.ts.map +1 -1
  301. package/lib/views/rounded-corner.js.map +1 -1
  302. package/package.json +3 -3
  303. package/src/base/drag-aware-mouse-listener.ts +16 -2
  304. package/src/base/feedback/css-feedback.ts +4 -0
  305. package/src/base/feedback/feeback-emitter.ts +112 -0
  306. package/src/base/feedback/feedback-action-dispatcher.ts +41 -6
  307. package/src/base/feedback/index.ts +1 -0
  308. package/src/base/selection-service.spec.ts +5 -0
  309. package/src/base/selection-service.ts +2 -3
  310. package/src/features/accessibility/element-navigation/local-element-navigator.ts +4 -4
  311. package/src/features/accessibility/move-zoom/move-handler.ts +11 -6
  312. package/src/features/accessibility/resize-key-tool/resize-key-handler.ts +11 -7
  313. package/src/features/change-bounds/model.ts +25 -13
  314. package/src/features/change-bounds/movement-restrictor.ts +6 -22
  315. package/src/features/element-template/mouse-tracking-element-position-listener.ts +55 -45
  316. package/src/features/helper-lines/helper-line-feedback.ts +50 -57
  317. package/src/features/helper-lines/helper-line-manager-default.ts +12 -21
  318. package/src/features/helper-lines/model.ts +6 -25
  319. package/src/features/hints/type-hint-provider.spec.ts +4 -1
  320. package/src/features/hints/type-hint-provider.ts +9 -2
  321. package/src/features/layout/layout-elements-action.ts +10 -7
  322. package/src/features/select/select-mouse-listener.ts +4 -3
  323. package/src/features/tools/base-tools.ts +15 -8
  324. package/src/features/tools/change-bounds/change-bounds-tool-feedback.ts +6 -232
  325. package/src/features/tools/change-bounds/change-bounds-tool-module.ts +1 -0
  326. package/src/features/tools/change-bounds/change-bounds-tool-move-feedback.ts +254 -0
  327. package/src/features/tools/change-bounds/change-bounds-tool.ts +217 -226
  328. package/src/features/tools/change-bounds/index.ts +1 -0
  329. package/src/features/tools/change-bounds/view.tsx +4 -1
  330. package/src/features/tools/deletion/delete-tool.ts +6 -6
  331. package/src/features/tools/edge-creation/dangling-edge-feedback.ts +7 -4
  332. package/src/features/tools/edge-creation/edge-creation-tool-feedback.ts +9 -9
  333. package/src/features/tools/edge-creation/edge-creation-tool.ts +33 -23
  334. package/src/features/tools/edge-edit/edge-edit-tool-feedback.ts +8 -8
  335. package/src/features/tools/edge-edit/edge-edit-tool.ts +42 -49
  336. package/src/features/tools/marquee-selection/marquee-mouse-tool.ts +7 -6
  337. package/src/features/tools/node-creation/node-creation-tool.ts +69 -25
  338. package/src/features/validation/marker-navigator.ts +6 -8
  339. package/src/features/validation/validate.ts +5 -20
  340. package/src/features/viewport/reposition.ts +11 -14
  341. package/src/utils/geometry-util.ts +45 -64
  342. package/src/utils/gmodel-util.ts +45 -2
  343. package/src/utils/layout-utils.ts +9 -20
  344. package/src/utils/viewpoint-util.ts +13 -25
  345. package/lib/base/action-dispatcher.spec.d.ts +0 -2
  346. package/lib/base/action-dispatcher.spec.d.ts.map +0 -1
  347. package/lib/base/action-dispatcher.spec.js +0 -78
  348. package/lib/base/action-dispatcher.spec.js.map +0 -1
  349. package/lib/base/model/model-initialization-constraint.spec.d.ts +0 -2
  350. package/lib/base/model/model-initialization-constraint.spec.d.ts.map +0 -1
  351. package/lib/base/model/model-initialization-constraint.spec.js +0 -97
  352. package/lib/base/model/model-initialization-constraint.spec.js.map +0 -1
  353. package/lib/base/selection-service.spec.d.ts +0 -2
  354. package/lib/base/selection-service.spec.d.ts.map +0 -1
  355. package/lib/base/selection-service.spec.js +0 -287
  356. package/lib/base/selection-service.spec.js.map +0 -1
  357. package/lib/features/bounds/freeform-layout.spec.d.ts +0 -3
  358. package/lib/features/bounds/freeform-layout.spec.d.ts.map +0 -1
  359. package/lib/features/bounds/freeform-layout.spec.js +0 -201
  360. package/lib/features/bounds/freeform-layout.spec.js.map +0 -1
  361. package/lib/features/bounds/hbox-layout.spec.d.ts +0 -3
  362. package/lib/features/bounds/hbox-layout.spec.d.ts.map +0 -1
  363. package/lib/features/bounds/hbox-layout.spec.js +0 -160
  364. package/lib/features/bounds/hbox-layout.spec.js.map +0 -1
  365. package/lib/features/bounds/layouter-test-util.spec.d.ts +0 -32
  366. package/lib/features/bounds/layouter-test-util.spec.d.ts.map +0 -1
  367. package/lib/features/bounds/layouter-test-util.spec.js +0 -96
  368. package/lib/features/bounds/layouter-test-util.spec.js.map +0 -1
  369. package/lib/features/bounds/vbox-layout.spec.d.ts +0 -3
  370. package/lib/features/bounds/vbox-layout.spec.d.ts.map +0 -1
  371. package/lib/features/bounds/vbox-layout.spec.js +0 -160
  372. package/lib/features/bounds/vbox-layout.spec.js.map +0 -1
  373. package/lib/features/change-bounds/snap.spec.d.ts +0 -17
  374. package/lib/features/change-bounds/snap.spec.d.ts.map +0 -1
  375. package/lib/features/change-bounds/snap.spec.js +0 -83
  376. package/lib/features/change-bounds/snap.spec.js.map +0 -1
  377. package/lib/features/hints/type-hint-provider.spec.d.ts +0 -2
  378. package/lib/features/hints/type-hint-provider.spec.d.ts.map +0 -1
  379. package/lib/features/hints/type-hint-provider.spec.js +0 -333
  380. package/lib/features/hints/type-hint-provider.spec.js.map +0 -1
  381. package/lib/features/layout/layout-elements-action.spec.d.ts +0 -3
  382. package/lib/features/layout/layout-elements-action.spec.d.ts.map +0 -1
  383. package/lib/features/layout/layout-elements-action.spec.js +0 -329
  384. package/lib/features/layout/layout-elements-action.spec.js.map +0 -1
  385. package/lib/features/navigation/navigation-target-resolver.spec.d.ts +0 -3
  386. package/lib/features/navigation/navigation-target-resolver.spec.d.ts.map +0 -1
  387. package/lib/features/navigation/navigation-target-resolver.spec.js +0 -53
  388. package/lib/features/navigation/navigation-target-resolver.spec.js.map +0 -1
  389. package/lib/features/tools/marquee-selection/marquee-behavior.spec.d.ts +0 -17
  390. package/lib/features/tools/marquee-selection/marquee-behavior.spec.d.ts.map +0 -1
  391. package/lib/features/tools/marquee-selection/marquee-behavior.spec.js +0 -165
  392. package/lib/features/tools/marquee-selection/marquee-behavior.spec.js.map +0 -1
  393. package/lib/features/validation/marker-navigator.spec.d.ts +0 -3
  394. package/lib/features/validation/marker-navigator.spec.d.ts.map +0 -1
  395. package/lib/features/validation/marker-navigator.spec.js +0 -166
  396. package/lib/features/validation/marker-navigator.spec.js.map +0 -1
  397. package/lib/utils/gmodel-util.spec.d.ts +0 -2
  398. package/lib/utils/gmodel-util.spec.d.ts.map +0 -1
  399. package/lib/utils/gmodel-util.spec.js +0 -186
  400. package/lib/utils/gmodel-util.spec.js.map +0 -1
@@ -16,7 +16,6 @@
16
16
 
17
17
  import {
18
18
  Bounds,
19
- BoundsAware,
20
19
  Dimension,
21
20
  GChildElement,
22
21
  GModelElement,
@@ -29,7 +28,6 @@ import {
29
28
  isViewport,
30
29
  translateBounds
31
30
  } from '@eclipse-glsp/sprotty';
32
- import { bottomRight, topLeft } from './geometry-util';
33
31
  import { BoundsAwareModelElement } from './gmodel-util';
34
32
 
35
33
  /**
@@ -50,33 +48,23 @@ export function getAbsolutePosition(target: GModelElement, mouseEvent: MouseEven
50
48
  }
51
49
 
52
50
  export function getAbsolutePositionByPoint(target: GModelElement, point: Point): Point {
53
- let xPos = point.x;
54
- let yPos = point.y;
55
- const canvasBounds = target.root.canvasBounds;
56
- xPos -= canvasBounds.x;
57
- yPos -= canvasBounds.y;
51
+ let position = Point.subtract(point, target.root.canvasBounds);
58
52
 
59
53
  const viewport: Viewport | undefined = findParentByFeature(target, isViewport);
60
- const zoom = viewport ? viewport.zoom : 1;
61
54
  if (viewport) {
62
- const scroll: Point = { x: viewport.scroll.x, y: viewport.scroll.y };
63
- xPos += scroll.x * zoom;
64
- yPos += scroll.y * zoom;
65
-
66
- xPos /= zoom;
67
- yPos /= zoom;
55
+ const zoom = viewport.zoom;
56
+ const zoomedScroll = Point.multiplyScalar(viewport.scroll, zoom);
57
+ position = Point.add(position, zoomedScroll);
58
+ position = Point.divideScalar(position, zoom);
68
59
  }
69
60
 
70
- return {
71
- x: xPos,
72
- y: yPos
73
- };
61
+ return position;
74
62
  }
75
63
 
76
64
  export function getViewportBounds(target: GModelElement, bounds: Bounds): Bounds {
77
- const start = getAbsolutePositionByPoint(target, topLeft(bounds));
78
- const end = getAbsolutePositionByPoint(target, bottomRight(bounds));
79
- return { ...start, width: end.x - start.x, height: end.y - start.y };
65
+ const topLeft = getAbsolutePositionByPoint(target, Bounds.topLeft(bounds));
66
+ const bottomRight = getAbsolutePositionByPoint(target, Bounds.bottomRight(bounds));
67
+ return Bounds.from(topLeft, bottomRight);
80
68
  }
81
69
 
82
70
  /**
@@ -85,7 +73,7 @@ export function getViewportBounds(target: GModelElement, bounds: Bounds): Bounds
85
73
  *
86
74
  * @param target A bounds-aware element from the diagram
87
75
  */
88
- export function toAbsoluteBounds(element: GModelElement & BoundsAware): Bounds {
76
+ export function toAbsoluteBounds(element: BoundsAwareModelElement): Bounds {
89
77
  const location = isAlignable(element) ? element.alignment : Point.ORIGIN;
90
78
  const x = location.x;
91
79
  const y = location.y;
@@ -100,7 +88,7 @@ export function toAbsoluteBounds(element: GModelElement & BoundsAware): Bounds {
100
88
  *
101
89
  * @param target A bounds-aware element from the diagram
102
90
  */
103
- export function toAbsolutePosition(target: GModelElement & BoundsAware): Point {
91
+ export function toAbsolutePosition(target: BoundsAwareModelElement): Point {
104
92
  return toAbsoluteBounds(target);
105
93
  }
106
94
 
@@ -110,7 +98,7 @@ export function toAbsolutePosition(target: GModelElement & BoundsAware): Point {
110
98
  *
111
99
  * @param target A bounds-aware element from the diagram
112
100
  */
113
- export function toAbsoluteSize(target: GModelElement & BoundsAware): Dimension {
101
+ export function toAbsoluteSize(target: BoundsAwareModelElement): Dimension {
114
102
  return toAbsoluteBounds(target);
115
103
  }
116
104
 
@@ -140,7 +128,7 @@ export function absoluteToParent(element: BoundsAwareModelElement & GChildElemen
140
128
  */
141
129
  export function absoluteToLocal(element: BoundsAwareModelElement, absolutePoint: Point): Point {
142
130
  const absoluteElementBounds = toAbsoluteBounds(element);
143
- return { x: absolutePoint.x - absoluteElementBounds.x, y: absolutePoint.y - absoluteElementBounds.y };
131
+ return Point.subtract(absolutePoint, absoluteElementBounds);
144
132
  }
145
133
 
146
134
  /**
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=action-dispatcher.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"action-dispatcher.spec.d.ts","sourceRoot":"","sources":["../../src/base/action-dispatcher.spec.ts"],"names":[],"mappings":""}
@@ -1,78 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- /********************************************************************************
4
- * Copyright (c) 2023-2024 EclipseSource and others.
5
- *
6
- * This program and the accompanying materials are made available under the
7
- * terms of the Eclipse Public License v. 2.0 which is available at
8
- * http://www.eclipse.org/legal/epl-2.0.
9
- *
10
- * This Source Code may also be made available under the following Secondary
11
- * Licenses when the conditions for such availability set forth in the Eclipse
12
- * Public License v. 2.0 are satisfied: GNU General Public License, version 2
13
- * with the GNU Classpath Exception which is available at
14
- * https://www.gnu.org/software/classpath/license.html.
15
- *
16
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
17
- ********************************************************************************/
18
- const sprotty_1 = require("@eclipse-glsp/sprotty");
19
- const chai_1 = require("chai");
20
- const inversify_1 = require("inversify");
21
- const action_dispatcher_1 = require("./action-dispatcher");
22
- const default_module_1 = require("./default.module");
23
- const container = new inversify_1.Container();
24
- container.load(default_module_1.defaultModule);
25
- container.bind(sprotty_1.TYPES.IDiagramOptions).toConstantValue({
26
- clientId: 'client1',
27
- diagramType: 'diagramType',
28
- glspClientProvider: async () => ({})
29
- });
30
- const registry = container.get(sprotty_1.ActionHandlerRegistry);
31
- const actionDispatcher = container.get(action_dispatcher_1.GLSPActionDispatcher);
32
- let testHandlerDelay = 0;
33
- const testHandler = {
34
- handle: action => {
35
- const request = action;
36
- new Promise(resolve => setTimeout(resolve, testHandlerDelay)).then(() => actionDispatcher.dispatch({
37
- kind: 'response',
38
- responseId: request.requestId
39
- }));
40
- }
41
- };
42
- registry.register('request', testHandler);
43
- // eslint-disable-next-line @typescript-eslint/no-empty-function
44
- registry.register('response', { handle: () => { } });
45
- actionDispatcher.initialize().then(() => {
46
- actionDispatcher['blockUntil'] = undefined;
47
- });
48
- describe('GLSPActionDispatcher', () => {
49
- describe('requestUntil', () => {
50
- it('should resolve successfully if response dispatched within timeout', async () => {
51
- testHandlerDelay = 15;
52
- const requestAction = { kind: 'request', requestId: '' };
53
- const response = await actionDispatcher.requestUntil(requestAction, 150);
54
- (0, chai_1.expect)(response === null || response === void 0 ? void 0 : response.responseId).to.be.equal(requestAction.requestId);
55
- });
56
- it('should resolve to `undefined` if no response dispatched within timeout & `rejectOnTimeout` flag is false', async () => {
57
- testHandlerDelay = 30;
58
- const requestAction = { kind: 'request', requestId: '' };
59
- const response = await actionDispatcher.requestUntil(requestAction, 5);
60
- (0, chai_1.expect)(response).to.be.undefined;
61
- });
62
- it('should be rejected if no response dispatched within timeout & `rejectOnTimeout` flag is true', async () => {
63
- testHandlerDelay = 30;
64
- const requestAction = { kind: 'request', requestId: '' };
65
- const gotRejected = await actionDispatcher.requestUntil(requestAction, 5, true).then(() => false, () => true);
66
- (0, chai_1.expect)(gotRejected, 'Response promise should be rejected').to.be.true;
67
- });
68
- });
69
- describe('request & re-dispatch', () => {
70
- it('should be possible to re-dispatch the response of a `request` call', async () => {
71
- const requestAction = { kind: 'request', requestId: '' };
72
- const response = await actionDispatcher.request(requestAction);
73
- const dispatchSuccessful = await actionDispatcher.dispatch(response).then(() => true, err => false);
74
- (0, chai_1.expect)(dispatchSuccessful, 'Promise of re-dispatch should resolve successfully').to.be.true;
75
- });
76
- });
77
- });
78
- //# sourceMappingURL=action-dispatcher.spec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"action-dispatcher.spec.js","sourceRoot":"","sources":["../../src/base/action-dispatcher.spec.ts"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,mDAAoH;AACpH,+BAA8B;AAC9B,yCAAsC;AAEtC,2DAA2D;AAC3D,qDAAiD;AAGjD,MAAM,SAAS,GAAG,IAAI,qBAAS,EAAE,CAAC;AAClC,SAAS,CAAC,IAAI,CAAC,8BAAa,CAAC,CAAC;AAC9B,SAAS,CAAC,IAAI,CAAC,eAAK,CAAC,eAAe,CAAC,CAAC,eAAe,CAA4B;IAC7E,QAAQ,EAAE,SAAS;IACnB,WAAW,EAAE,aAAa;IAC1B,kBAAkB,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,EAAE,CAAQ;CAC7C,CAAC,CAAC;AACJ,MAAM,QAAQ,GAAG,SAAS,CAAC,GAAG,CAAC,+BAAqB,CAAC,CAAC;AACtD,MAAM,gBAAgB,GAAG,SAAS,CAAC,GAAG,CAAC,wCAAoB,CAAC,CAAC;AAE7D,IAAI,gBAAgB,GAAG,CAAC,CAAC;AACzB,MAAM,WAAW,GAAmB;IAChC,MAAM,EAAE,MAAM,CAAC,EAAE;QACb,MAAM,OAAO,GAAG,MAAuC,CAAC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C,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- import 'reflect-metadata';
2
- //# sourceMappingURL=model-initialization-constraint.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"model-initialization-constraint.spec.d.ts","sourceRoot":"","sources":["../../../src/base/model/model-initialization-constraint.spec.ts"],"names":[],"mappings":"AAiBA,OAAO,kBAAkB,CAAC"}
@@ -1,97 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- /********************************************************************************
4
- * Copyright (c) 2023 EclipseSource and others.
5
- *
6
- * This program and the accompanying materials are made available under the
7
- * terms of the Eclipse Public License v. 2.0 which is available at
8
- * http://www.eclipse.org/legal/epl-2.0.
9
- *
10
- * This Source Code may also be made available under the following Secondary
11
- * Licenses when the conditions for such availability set forth in the Eclipse
12
- * Public License v. 2.0 are satisfied: GNU General Public License, version 2
13
- * with the GNU Classpath Exception which is available at
14
- * https://www.gnu.org/software/classpath/license.html.
15
- *
16
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
17
- ********************************************************************************/
18
- const chai_1 = require("chai");
19
- const inversify_1 = require("inversify");
20
- require("reflect-metadata");
21
- const sinon = require("sinon");
22
- const sprotty_1 = require("@eclipse-glsp/sprotty");
23
- const model_initialization_constraint_1 = require("./model-initialization-constraint");
24
- const sandbox = sinon.createSandbox();
25
- const container = new inversify_1.Container();
26
- let constraint;
27
- // eslint-disable-next-line @typescript-eslint/no-empty-function
28
- const listener = sandbox.spy(() => { });
29
- describe('DefaultModelInitializationConstraint', () => {
30
- beforeEach(() => {
31
- constraint = container.resolve(model_initialization_constraint_1.DefaultModelInitializationConstraint);
32
- sandbox.reset();
33
- });
34
- it('should complete after dispatching non empty SetModelAction and `InitializeCanvasBoundsAction`', () => {
35
- (0, chai_1.expect)(constraint.isCompleted).to.be.false;
36
- constraint.notifyDispatched(sprotty_1.SetModelAction.create({ id: 'model', type: 'graph' }));
37
- (0, chai_1.expect)(constraint.isCompleted).to.be.false;
38
- constraint.notifyDispatched({ kind: sprotty_1.InitializeCanvasBoundsAction.KIND });
39
- (0, chai_1.expect)(constraint.isCompleted).to.be.true;
40
- });
41
- it('should complete after dispatching non empty UpdateModelAction and `InitializeCanvasBoundsAction`', () => {
42
- (0, chai_1.expect)(constraint.isCompleted).to.be.false;
43
- constraint.notifyDispatched(sprotty_1.UpdateModelAction.create({ id: 'model', type: 'graph' }));
44
- (0, chai_1.expect)(constraint.isCompleted).to.be.false;
45
- constraint.notifyDispatched({ kind: sprotty_1.InitializeCanvasBoundsAction.KIND });
46
- (0, chai_1.expect)(constraint.isCompleted).to.be.true;
47
- });
48
- it('should note complete after dispatching empty SetModelAction and `InitializeCanvasBoundsAction` ', () => {
49
- (0, chai_1.expect)(constraint.isCompleted).to.be.false;
50
- constraint.notifyDispatched(sprotty_1.SetModelAction.create(sprotty_1.EMPTY_ROOT));
51
- (0, chai_1.expect)(constraint.isCompleted).to.be.false;
52
- constraint.notifyDispatched({ kind: sprotty_1.InitializeCanvasBoundsAction.KIND });
53
- (0, chai_1.expect)(constraint.isCompleted).to.be.false;
54
- });
55
- it('should note complete after dispatching empty UpdateModelAction and `InitializeCanvasBoundsAction ', () => {
56
- (0, chai_1.expect)(constraint.isCompleted).to.be.false;
57
- constraint.notifyDispatched(sprotty_1.UpdateModelAction.create(sprotty_1.EMPTY_ROOT));
58
- (0, chai_1.expect)(constraint.isCompleted).to.be.false;
59
- constraint.notifyDispatched({ kind: sprotty_1.InitializeCanvasBoundsAction.KIND });
60
- (0, chai_1.expect)(constraint.isCompleted).to.be.false;
61
- });
62
- describe('onInitialized', () => {
63
- it('returned promise should resolve once the constraint is initialized', async () => {
64
- const initializeDeferred = new sprotty_1.Deferred();
65
- const initializePromise = constraint.onInitialized();
66
- initializePromise.then(() => initializeDeferred.resolve());
67
- (0, chai_1.expect)(initializeDeferred.state).to.be.equal('unresolved');
68
- // Directly trigger the completion method simplify test logic
69
- constraint['setCompleted']();
70
- // Short delay of test execution to ensure that the deferred state is updated.
71
- await new Promise(resolve => setTimeout(resolve, 5));
72
- (0, chai_1.expect)(initializeDeferred.state).to.be.equal('resolved');
73
- });
74
- it('registered listener should be invoked once the constraint is initialized', () => {
75
- constraint.onInitialized(listener);
76
- (0, chai_1.expect)(listener.called).to.be.false;
77
- // Directly trigger the completion method simplify test logic
78
- constraint['setCompleted']();
79
- (0, chai_1.expect)(listener.called).to.be.true;
80
- });
81
- it('registered listener should be invoked directly on registration if the constraint is already initialized', () => {
82
- // Directly trigger the completion method simplify test logic
83
- constraint['setCompleted']();
84
- constraint.onInitialized(listener);
85
- (0, chai_1.expect)(listener.called).to.be.true;
86
- });
87
- it('Disposed listener should not be invoked once the constraint is initialized', () => {
88
- const toDispose = constraint.onInitialized(listener);
89
- (0, chai_1.expect)(listener.called).to.be.false;
90
- toDispose.dispose();
91
- // Directly trigger the completion method simplify test logic
92
- constraint['setCompleted']();
93
- (0, chai_1.expect)(listener.called).to.be.false;
94
- });
95
- });
96
- });
97
- //# sourceMappingURL=model-initialization-constraint.spec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"model-initialization-constraint.spec.js","sourceRoot":"","sources":["../../../src/base/model/model-initialization-constraint.spec.ts"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,+BAA8B;AAC9B,yCAAsC;AACtC,4BAA0B;AAC1B,+BAA+B;AAC/B,mDAA8H;AAC9H,uFAAwH;AACxH,MAAM,OAAO,GAAG,KAAK,CAAC,aAAa,EAAE,CAAC;AACtC,MAAM,SAAS,GAAG,IAAI,qBAAS,EAAE,CAAC;AAClC,IAAI,UAAyC,CAAC;AAC9C,gEAAgE;AAChE,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,GAAS,EAAE,GAAE,CAAC,CAAC,CAAC;AAE7C,QAAQ,CAAC,sCAAsC,EAAE,GAAG,EAAE;IAClD,UAAU,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SAAS,GAAG,UAAU,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;YACrD,IAAA,aAAM,EAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC;YACpC,SAAS,CAAC,OAAO,EAAE,CAAC;YACpB,6DAA6D;YAC7D,UAAU,CAAC,cAAc,CAAC,EAAE,CAAC;YAC7B,IAAA,aAAM,EAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC;QACxC,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=selection-service.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"selection-service.spec.d.ts","sourceRoot":"","sources":["../../src/base/selection-service.spec.ts"],"names":[],"mappings":""}
@@ -1,287 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- /********************************************************************************
10
- * Copyright (c) 2020-2024 EclipseSource and others.
11
- *
12
- * This program and the accompanying materials are made available under the
13
- * terms of the Eclipse Public License v. 2.0 which is available at
14
- * http://www.eclipse.org/legal/epl-2.0.
15
- *
16
- * This Source Code may also be made available under the following Secondary
17
- * Licenses when the conditions for such availability set forth in the Eclipse
18
- * Public License v. 2.0 are satisfied: GNU General Public License, version 2
19
- * with the GNU Classpath Exception which is available at
20
- * https://www.gnu.org/software/classpath/license.html.
21
- *
22
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
23
- ********************************************************************************/
24
- const sprotty_1 = require("@eclipse-glsp/sprotty");
25
- const chai_1 = require("chai");
26
- const inversify_1 = require("inversify");
27
- const sinon = require("sinon");
28
- const default_module_1 = require("./default.module");
29
- const selection_service_1 = require("./selection-service");
30
- let MockFeedbackActionDispatcher = class MockFeedbackActionDispatcher {
31
- constructor() {
32
- this.feedbackEmitters = new Map();
33
- }
34
- registerFeedback(feedbackEmitter, actions) {
35
- this.feedbackEmitters.set(feedbackEmitter, actions);
36
- return sprotty_1.Disposable.create(() => this.deregisterFeedback(feedbackEmitter));
37
- }
38
- deregisterFeedback(feedbackEmitter, _actions) {
39
- this.feedbackEmitters.delete(feedbackEmitter);
40
- }
41
- getRegisteredFeedback() {
42
- const result = [];
43
- this.feedbackEmitters.forEach((value, key) => result.push(...value));
44
- return result;
45
- }
46
- getSingleFeedbackAction() {
47
- const actions = this.getRegisteredFeedback();
48
- return actions.length === 1 ? actions[0] : undefined;
49
- }
50
- getFeedbackCommands() {
51
- return [];
52
- }
53
- async applyFeedbackCommands(context) { }
54
- };
55
- MockFeedbackActionDispatcher = __decorate([
56
- (0, inversify_1.injectable)()
57
- ], MockFeedbackActionDispatcher);
58
- class MockSelectionListener {
59
- selectionChanged(root, selectedElements, deselectedElements) {
60
- // no.op
61
- }
62
- }
63
- function createContainer() {
64
- const container = (0, sprotty_1.initializeContainer)(new inversify_1.Container(), default_module_1.defaultModule);
65
- // eslint-disable-next-line deprecation/deprecation
66
- container.rebind(sprotty_1.TYPES.IFeedbackActionDispatcher).to(MockFeedbackActionDispatcher).inSingletonScope();
67
- return container;
68
- }
69
- describe('SelectionService', () => {
70
- // eslint-disable-next-line deprecation/deprecation
71
- let root;
72
- let selectionService;
73
- let feedbackDispatcher;
74
- beforeEach(() => {
75
- const container = createContainer();
76
- // eslint-disable-next-line deprecation/deprecation
77
- root = createRoot('node1', 'node2', 'node3', 'node4', 'node5');
78
- selectionService = container.get(selection_service_1.SelectionService);
79
- feedbackDispatcher = container.get(sprotty_1.TYPES.IFeedbackActionDispatcher);
80
- });
81
- describe('Initial State', () => {
82
- it('On creation nothing should be selected and no feedback should be dispatched.', () => {
83
- assertSelectionAndFeedback([], []);
84
- });
85
- });
86
- describe('Single Selection', () => {
87
- it('Selecting a single element should be tracked correctly and trigger feedback.', () => {
88
- assertSelectionAndFeedback([], []);
89
- selectionService.updateSelection(root, ['node1'], []);
90
- assertSelectionAndFeedback(['node1'], []);
91
- });
92
- it('Selecting the same element twice in one operation should not make a difference.', () => {
93
- assertSelectionAndFeedback([], []);
94
- selectionService.updateSelection(root, ['node1', 'node1'], []);
95
- assertSelectionAndFeedback(['node1'], []);
96
- });
97
- it('Selecting and then deselecting the same element should result in an empty selection.', () => {
98
- assertSelectionAndFeedback([], []);
99
- selectionService.updateSelection(root, ['node1'], []);
100
- selectionService.updateSelection(root, [], ['node1']);
101
- assertSelectionAndFeedback([], ['node1']);
102
- });
103
- it('Selecting and deselecting the same element in the same operation should have no effect.', () => {
104
- assertSelectionAndFeedback([], []);
105
- selectionService.updateSelection(root, ['node1'], ['node1']);
106
- assertSelectionAndFeedback([], []);
107
- });
108
- it('Selecting and deselecting not-existing nodes should have no effect.', () => {
109
- assertSelectionAndFeedback([], []);
110
- selectionService.updateSelection(root, ['not-existing'], []);
111
- assertSelectionAndFeedback([], []);
112
- selectionService.updateSelection(root, [], ['not-existing']);
113
- assertSelectionAndFeedback([], []);
114
- });
115
- });
116
- describe('Multi Selection', () => {
117
- it('Selecting multiple elements should be tracked correctly and trigger feedback.', () => {
118
- assertSelectionAndFeedback([], []);
119
- selectionService.updateSelection(root, ['node1', 'node2'], []);
120
- assertSelectionAndFeedback(['node1', 'node2'], []);
121
- });
122
- it('Selecting multiple elements should have the selection order in the dispatched feedback.', () => {
123
- assertSelectionAndFeedback([], []);
124
- selectionService.updateSelection(root, ['node2', 'node1'], []);
125
- (0, chai_1.expect)(() => assertSelectionAndFeedback(['node1', 'node2'], [])).to.throw(chai_1.AssertionError, 'ordered members');
126
- });
127
- it('Selecting the same elements twice in one operation should not make a difference.', () => {
128
- assertSelectionAndFeedback([], []);
129
- selectionService.updateSelection(root, ['node1', 'node1', 'node2', 'node2'], []);
130
- assertSelectionAndFeedback(['node1', 'node2'], []);
131
- });
132
- it('Selecting and then deselecting the same elements should result in an empty selection.', () => {
133
- assertSelectionAndFeedback([], []);
134
- selectionService.updateSelection(root, ['node1', 'node2'], []);
135
- selectionService.updateSelection(root, [], ['node1', 'node2']);
136
- assertSelectionAndFeedback([], ['node1', 'node2']);
137
- });
138
- it('Selecting and deselecting the same elements in one operation should have no effect.', () => {
139
- assertSelectionAndFeedback([], []);
140
- selectionService.updateSelection(root, ['node1', 'node2'], ['node1', 'node2']);
141
- assertSelectionAndFeedback([], []);
142
- selectionService.updateSelection(root, ['node1', 'node2', 'node3'], ['node1', 'node2']);
143
- assertSelectionAndFeedback(['node3'], []);
144
- });
145
- it('Selecting three elements and deselecting one should result in two selected and one deselected element.', () => {
146
- assertSelectionAndFeedback([], []);
147
- selectionService.updateSelection(root, ['node1', 'node2', 'node3'], []);
148
- assertSelectionAndFeedback(['node1', 'node2', 'node3'], []);
149
- selectionService.updateSelection(root, [], ['node2']);
150
- assertSelectionAndFeedback(['node1', 'node3'], ['node2']);
151
- });
152
- it('A series of selection and deselection operations should be tracked correctly.', () => {
153
- assertSelectionAndFeedback([], []);
154
- selectionService.updateSelection(root, ['node1', 'node2', 'node3'], []);
155
- assertSelectionAndFeedback(['node1', 'node2', 'node3'], []);
156
- selectionService.updateSelection(root, ['node4'], ['node2']);
157
- assertSelectionAndFeedback(['node1', 'node3', 'node4'], ['node2']);
158
- selectionService.updateSelection(root, ['node3', 'node1'], ['node2', 'node4']);
159
- assertSelectionAndFeedback(['node1', 'node3'], ['node4']);
160
- selectionService.updateSelection(root, ['node3'], ['node3']);
161
- assertSelectionAndFeedback(['node1', 'node3'], ['node4']);
162
- });
163
- });
164
- describe('Changing Root', () => {
165
- it('Changing root deselects all selected elements if there are no matching elements.', () => {
166
- assertSelectionAndFeedback([], []);
167
- selectionService.updateSelection(root, ['node1'], []);
168
- assertSelectionAndFeedback(['node1'], []);
169
- const newRoot = createRoot('newNode1', 'newNode2', 'newNode3');
170
- selectionService.modelRootChanged(newRoot);
171
- assertSelectionAndFeedback([], ['node1']);
172
- });
173
- it('Changing root keeps selected elements if there are matching elements.', () => {
174
- assertSelectionAndFeedback([], []);
175
- selectionService.updateSelection(root, ['node1', 'node2'], []);
176
- assertSelectionAndFeedback(['node1', 'node2'], []);
177
- const newRoot = createRoot('node1', 'newNode2', 'newNode3');
178
- selectionService.modelRootChanged(newRoot);
179
- assertSelectionAndFeedback(['node1'], ['node2']);
180
- });
181
- it('Changing root with new selection correctly selects matching elements and deselects not matching elements.', () => {
182
- assertSelectionAndFeedback([], []);
183
- selectionService.updateSelection(root, ['node1', 'node2'], []);
184
- assertSelectionAndFeedback(['node1', 'node2'], []);
185
- const newRoot = createRoot('newNode1', 'newNode2', 'newNode3');
186
- selectionService.updateSelection(newRoot, ['newNode1'], []);
187
- assertSelectionAndFeedback(['newNode1'], ['node1', 'node2']);
188
- });
189
- });
190
- describe('Listeners', () => {
191
- const sandbox = sinon.createSandbox();
192
- const listener = sandbox.createStubInstance(MockSelectionListener);
193
- beforeEach(() => {
194
- selectionService.onSelectionChanged(change => listener.selectionChanged(change.root, change.selectedElements, change.deselectedElements));
195
- });
196
- afterEach(() => {
197
- selectionService.dispose();
198
- sandbox.reset();
199
- });
200
- it('A registered listener should be notified of a single selection change.', () => {
201
- selectionService.updateSelection(root, ['node1', 'node1'], []);
202
- assertListener(listener, root, ['node1'], [], 1);
203
- });
204
- it('A registered listener should be notified of a multi-selection change.', () => {
205
- selectionService.updateSelection(root, ['node1', 'node2', 'node3'], []);
206
- assertListener(listener, root, ['node1', 'node2', 'node3'], [], 1);
207
- });
208
- it('A registered listener should be notified of series of selection changes.', () => {
209
- selectionService.updateSelection(root, ['node1'], []);
210
- assertListener(listener, root, ['node1'], [], 1);
211
- selectionService.updateSelection(root, ['node2'], ['node1']);
212
- assertListener(listener, root, ['node2'], ['node1'], 2);
213
- selectionService.updateSelection(root, ['node3', 'node4'], []);
214
- assertListener(listener, root, ['node2', 'node3', 'node4'], [], 3);
215
- selectionService.updateSelection(root, [], ['node4']);
216
- assertListener(listener, root, ['node2', 'node3'], ['node4'], 4);
217
- });
218
- it('A registered listener should NOT be notified of root changes.', () => {
219
- selectionService.updateSelection(root, [], []);
220
- assertListener(listener, root, [], [], 0);
221
- const newRoot = createRoot('node1', 'newNode2', 'newNode3');
222
- selectionService.updateSelection(newRoot, [], []);
223
- assertListener(listener, newRoot, [], [], 0);
224
- });
225
- it('Selecting the same elements consecutively should not trigger a listener update.', () => {
226
- selectionService.updateSelection(root, ['node1'], []);
227
- assertListener(listener, root, ['node1'], [], 1);
228
- selectionService.updateSelection(root, ['node1'], []);
229
- assertListener(listener, root, ['node1'], [], 1);
230
- });
231
- it('Selecting a not-existing elements should not trigger a listener update.', () => {
232
- selectionService.updateSelection(root, ['node1'], []);
233
- assertListener(listener, root, ['node1'], [], 1);
234
- selectionService.updateSelection(root, ['not-existing'], []);
235
- assertListener(listener, root, ['node1'], [], 1);
236
- });
237
- });
238
- function createRoot(...nodes) {
239
- const model = new sprotty_1.GModelRoot();
240
- model.id = 'selection-service-spec';
241
- model.type = 'graph';
242
- nodes.forEach(id => {
243
- const node = new sprotty_1.GNode();
244
- node.type = 'node:circle';
245
- node.id = id;
246
- model.add(node);
247
- });
248
- return model;
249
- }
250
- function assertSelectionAndFeedback(expectedSelection, expectedDeselection) {
251
- assertSelectionService(expectedSelection);
252
- assertDispatchedFeedback(expectedSelection, expectedDeselection);
253
- }
254
- function assertSelectionService(expectedSelection) {
255
- (0, chai_1.expect)(selectionService.isSingleSelection()).to.equal(expectedSelection.length === 1);
256
- (0, chai_1.expect)(selectionService.isMultiSelection()).to.equal(expectedSelection.length > 1);
257
- (0, chai_1.expect)(selectionService.hasSelectedElements()).to.equal(expectedSelection.length > 0);
258
- (0, chai_1.expect)(selectionService.getSelectedElementIDs()).to.have.lengthOf(expectedSelection.length);
259
- if (expectedSelection.length > 0) {
260
- (0, chai_1.expect)(selectionService.getSelectedElementIDs()).to.have.ordered.members(expectedSelection);
261
- }
262
- }
263
- function assertDispatchedFeedback(expectedSelection, expectedDeselection) {
264
- // a single feedback action reflects aggregated selection/deselection
265
- const hasFeedback = expectedSelection.length > 0 || expectedDeselection.length > 0;
266
- if (hasFeedback) {
267
- (0, chai_1.expect)(feedbackDispatcher.getRegisteredFeedback()).to.have.lengthOf(1);
268
- (0, chai_1.expect)(feedbackDispatcher.getSingleFeedbackAction().selectedElementsIDs).to.have.lengthOf(expectedSelection.length);
269
- (0, chai_1.expect)(feedbackDispatcher.getSingleFeedbackAction().selectedElementsIDs).to.have.ordered.members(expectedSelection);
270
- (0, chai_1.expect)(feedbackDispatcher.getSingleFeedbackAction().deselectedElementsIDs).to.have.lengthOf(expectedDeselection.length);
271
- (0, chai_1.expect)(feedbackDispatcher.getSingleFeedbackAction().deselectedElementsIDs).to.have.ordered.members(expectedDeselection);
272
- }
273
- else {
274
- (0, chai_1.expect)(feedbackDispatcher.getRegisteredFeedback()).to.have.lengthOf(0);
275
- (0, chai_1.expect)(feedbackDispatcher.getSingleFeedbackAction()).to.be.undefined;
276
- }
277
- }
278
- function assertListener(listener, expectedRoot, expectedSelection, expectedDeselection, expectedCalled) {
279
- (0, chai_1.expect)(listener.selectionChanged.callCount).to.be.equal(expectedCalled);
280
- if (expectedCalled > 0) {
281
- (0, chai_1.expect)(listener.selectionChanged.lastCall.args[0]).to.be.deep.equals(expectedRoot);
282
- (0, chai_1.expect)(listener.selectionChanged.lastCall.args[1]).to.be.deep.equals(expectedSelection);
283
- (0, chai_1.expect)(listener.selectionChanged.lastCall.args[2]).to.be.deep.equals(expectedDeselection);
284
- }
285
- }
286
- });
287
- //# sourceMappingURL=selection-service.spec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"selection-service.spec.js","sourceRoot":"","sources":["../../src/base/selection-service.spec.ts"],"names":[],"mappings":";;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,mDAA4I;AAC5I,+BAA8C;AAC9C,yCAAkD;AAClD,+BAA+B;AAC/B,qDAAiD;AAEjD,2DAAiG;AAGjG,IAAM,4BAA4B,GAAlC,MAAM,4BAA4B;IAAlC;QACc,qBAAgB,GAAoC,IAAI,GAAG,EAAE,CAAC;IA2B5E,CAAC;IAzBG,gBAAgB,CAAC,eAAiC,EAAE,OAAiB;QACjE,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;QACpD,OAAO,oBAAU,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,kBAAkB,CAAC,eAAe,CAAC,CAAC,CAAC;IAC7E,CAAC;IAED,kBAAkB,CAAC,eAAiC,EAAE,QAAmB;QACrE,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;IAClD,CAAC;IAED,qBAAqB;QACjB,MAAM,MAAM,GAAa,EAAE,CAAC;QAC5B,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC;QACrE,OAAO,MAAM,CAAC;IAClB,CAAC;IAED,uBAAuB;QACnB,MAAM,OAAO,GAAG,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAC7C,OAAO,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAE,OAAO,CAAC,CAAC,CAA0B,CAAC,CAAC,CAAC,SAAS,CAAC;IACnF,CAAC;IAED,mBAAmB;QACf,OAAO,EAAE,CAAC;IACd,CAAC;IAED,KAAK,CAAC,qBAAqB,CAAC,OAAgC,IAAkB,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E,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,SAAS,CAAC;SACxE;IACL,CAAC;IAED,SAAS,cAAc,CACnB,QAA2D,EAC3D,YAAoC,EACpC,iBAA2B,EAC3B,mBAA6B,EAC7B,cAAsB;QAEtB,IAAA,aAAM,EAAC,QAAQ,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;QACxE,IAAI,cAAc,GAAG,CAAC,EAAE;YACpB,IAAA,aAAM,EAAC,QAAQ,CAAC,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;YACnF,IAAA,aAAM,EAAC,QAAQ,CAAC,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;YACxF,IAAA,aAAM,EAAC,QAAQ,CAAC,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC;SAC7F;IACL,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,3 +0,0 @@
1
- import 'mocha';
2
- import 'reflect-metadata';
3
- //# sourceMappingURL=freeform-layout.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"freeform-layout.spec.d.ts","sourceRoot":"","sources":["../../../src/features/bounds/freeform-layout.spec.ts"],"names":[],"mappings":"AAgBA,OAAO,OAAO,CAAC;AACf,OAAO,kBAAkB,CAAC"}