@eclipse-glsp/client 0.10.0-next.6bee8eb.163 → 0.10.0-next.82afe91.177

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 (450) hide show
  1. package/lib/base/action-dispatcher.d.ts +1 -0
  2. package/lib/base/action-dispatcher.d.ts.map +1 -1
  3. package/lib/base/action-dispatcher.js +11 -3
  4. package/lib/base/action-dispatcher.js.map +1 -1
  5. package/lib/base/actions/focus-change-action.d.ts +16 -7
  6. package/lib/base/actions/focus-change-action.d.ts.map +1 -1
  7. package/lib/base/actions/focus-change-action.js +31 -12
  8. package/lib/base/actions/focus-change-action.js.map +1 -1
  9. package/lib/base/actions/sprotty-actions.d.ts +7 -0
  10. package/lib/base/actions/sprotty-actions.d.ts.map +1 -0
  11. package/lib/{features/tool-palette/palette-item.js → base/actions/sprotty-actions.js} +4 -20
  12. package/lib/base/actions/sprotty-actions.js.map +1 -0
  13. package/lib/base/auto-complete/auto-complete-actions.d.ts +5 -3
  14. package/lib/base/auto-complete/auto-complete-actions.d.ts.map +1 -1
  15. package/lib/base/auto-complete/auto-complete-actions.js +24 -5
  16. package/lib/base/auto-complete/auto-complete-actions.js.map +1 -1
  17. package/lib/base/auto-complete/auto-complete-widget.d.ts +9 -2
  18. package/lib/base/auto-complete/auto-complete-widget.d.ts.map +1 -1
  19. package/lib/base/auto-complete/auto-complete-widget.js +11 -4
  20. package/lib/base/auto-complete/auto-complete-widget.js.map +1 -1
  21. package/lib/base/command-stack.d.ts.map +1 -1
  22. package/lib/base/command-stack.js +4 -3
  23. package/lib/base/command-stack.js.map +1 -1
  24. package/lib/base/container-modules.d.ts.map +1 -1
  25. package/lib/base/container-modules.js +2 -1
  26. package/lib/base/container-modules.js.map +1 -1
  27. package/lib/base/di.config.d.ts +1 -1
  28. package/lib/base/di.config.d.ts.map +1 -1
  29. package/lib/base/di.config.js +9 -10
  30. package/lib/base/di.config.js.map +1 -1
  31. package/lib/base/editor-context-service.d.ts +15 -4
  32. package/lib/base/editor-context-service.d.ts.map +1 -1
  33. package/lib/base/editor-context-service.js +27 -16
  34. package/lib/base/editor-context-service.js.map +1 -1
  35. package/lib/base/focus-tracker.d.ts +1 -1
  36. package/lib/base/focus-tracker.d.ts.map +1 -1
  37. package/lib/base/focus-tracker.js +3 -3
  38. package/lib/base/focus-tracker.js.map +1 -1
  39. package/lib/base/model/update-model-command.d.ts +14 -7
  40. package/lib/base/model/update-model-command.d.ts.map +1 -1
  41. package/lib/base/model/update-model-command.js +38 -48
  42. package/lib/base/model/update-model-command.js.map +1 -1
  43. package/lib/base/model-initialization-constraint.d.ts +2 -3
  44. package/lib/base/model-initialization-constraint.d.ts.map +1 -1
  45. package/lib/base/model-initialization-constraint.js +3 -4
  46. package/lib/base/model-initialization-constraint.js.map +1 -1
  47. package/lib/base/source-uri-aware.d.ts +2 -17
  48. package/lib/base/source-uri-aware.d.ts.map +1 -1
  49. package/lib/base/source-uri-aware.js +4 -6
  50. package/lib/base/source-uri-aware.js.map +1 -1
  51. package/lib/base/tool-manager/glsp-tool-manager.d.ts.map +1 -1
  52. package/lib/base/tool-manager/glsp-tool-manager.js +3 -3
  53. package/lib/base/tool-manager/glsp-tool-manager.js.map +1 -1
  54. package/lib/base/tool-manager/tool-actions.d.ts +14 -0
  55. package/lib/base/tool-manager/tool-actions.d.ts.map +1 -0
  56. package/lib/base/tool-manager/tool-actions.js +25 -0
  57. package/lib/base/tool-manager/tool-actions.js.map +1 -0
  58. package/lib/base/types.d.ts +144 -20
  59. package/lib/base/types.d.ts.map +1 -1
  60. package/lib/base/types.js +14 -26
  61. package/lib/base/types.js.map +1 -1
  62. package/lib/features/change-bounds/movement-restrictor.d.ts +37 -7
  63. package/lib/features/change-bounds/movement-restrictor.d.ts.map +1 -1
  64. package/lib/features/change-bounds/movement-restrictor.js +54 -39
  65. package/lib/features/change-bounds/movement-restrictor.js.map +1 -1
  66. package/lib/features/change-bounds/snap.d.ts +60 -4
  67. package/lib/features/change-bounds/snap.d.ts.map +1 -1
  68. package/lib/features/change-bounds/snap.js +96 -9
  69. package/lib/features/change-bounds/snap.js.map +1 -1
  70. package/lib/features/change-bounds/snap.spec.d.ts +17 -0
  71. package/lib/features/change-bounds/snap.spec.d.ts.map +1 -0
  72. package/lib/features/change-bounds/snap.spec.js +82 -0
  73. package/lib/features/change-bounds/snap.spec.js.map +1 -0
  74. package/lib/features/command-palette/di.config.d.ts +2 -2
  75. package/lib/features/command-palette/di.config.d.ts.map +1 -1
  76. package/lib/features/command-palette/di.config.js +6 -6
  77. package/lib/features/command-palette/di.config.js.map +1 -1
  78. package/lib/features/command-palette/server-command-palette-provider.d.ts +1 -1
  79. package/lib/features/command-palette/server-command-palette-provider.d.ts.map +1 -1
  80. package/lib/features/command-palette/server-command-palette-provider.js +11 -8
  81. package/lib/features/command-palette/server-command-palette-provider.js.map +1 -1
  82. package/lib/features/context-menu/delete-element-context-menu.d.ts +17 -1
  83. package/lib/features/context-menu/delete-element-context-menu.d.ts.map +1 -1
  84. package/lib/features/context-menu/delete-element-context-menu.js +3 -3
  85. package/lib/features/context-menu/delete-element-context-menu.js.map +1 -1
  86. package/lib/features/context-menu/di.config.d.ts +1 -1
  87. package/lib/features/context-menu/di.config.d.ts.map +1 -1
  88. package/lib/features/context-menu/di.config.js +8 -7
  89. package/lib/features/context-menu/di.config.js.map +1 -1
  90. package/lib/features/context-menu/selection-service-aware-context-menu-mouse-listener.d.ts +22 -8
  91. package/lib/features/context-menu/selection-service-aware-context-menu-mouse-listener.d.ts.map +1 -1
  92. package/lib/features/context-menu/selection-service-aware-context-menu-mouse-listener.js +11 -33
  93. package/lib/features/context-menu/selection-service-aware-context-menu-mouse-listener.js.map +1 -1
  94. package/lib/features/context-menu/server-context-menu-provider.d.ts +1 -1
  95. package/lib/features/context-menu/server-context-menu-provider.d.ts.map +1 -1
  96. package/lib/features/context-menu/server-context-menu-provider.js +6 -5
  97. package/lib/features/context-menu/server-context-menu-provider.js.map +1 -1
  98. package/lib/features/copy-paste/copy-paste-context-menu.d.ts +12 -15
  99. package/lib/features/copy-paste/copy-paste-context-menu.d.ts.map +1 -1
  100. package/lib/features/copy-paste/copy-paste-context-menu.js +24 -31
  101. package/lib/features/copy-paste/copy-paste-context-menu.js.map +1 -1
  102. package/lib/features/copy-paste/copy-paste-handler.d.ts +1 -1
  103. package/lib/features/copy-paste/copy-paste-handler.d.ts.map +1 -1
  104. package/lib/features/copy-paste/copy-paste-handler.js +6 -7
  105. package/lib/features/copy-paste/copy-paste-handler.js.map +1 -1
  106. package/lib/features/copy-paste/di.config.d.ts +1 -1
  107. package/lib/features/copy-paste/di.config.d.ts.map +1 -1
  108. package/lib/features/copy-paste/di.config.js +5 -7
  109. package/lib/features/copy-paste/di.config.js.map +1 -1
  110. package/lib/features/decoration/decoration-placer.d.ts.map +1 -1
  111. package/lib/features/decoration/decoration-placer.js +17 -1
  112. package/lib/features/decoration/decoration-placer.js.map +1 -1
  113. package/lib/features/decoration/di.config.d.ts +2 -2
  114. package/lib/features/decoration/di.config.d.ts.map +1 -1
  115. package/lib/features/decoration/di.config.js +4 -4
  116. package/lib/features/decoration/di.config.js.map +1 -1
  117. package/lib/features/edit-label/di.config.d.ts +1 -1
  118. package/lib/features/edit-label/di.config.d.ts.map +1 -1
  119. package/lib/features/edit-label/di.config.js +4 -4
  120. package/lib/features/edit-label/di.config.js.map +1 -1
  121. package/lib/features/edit-label/edit-label-tool.d.ts.map +1 -1
  122. package/lib/features/edit-label/edit-label-tool.js +1 -1
  123. package/lib/features/edit-label/edit-label-tool.js.map +1 -1
  124. package/lib/features/edit-label/edit-label-validator.d.ts +4 -6
  125. package/lib/features/edit-label/edit-label-validator.d.ts.map +1 -1
  126. package/lib/features/edit-label/edit-label-validator.js +8 -10
  127. package/lib/features/edit-label/edit-label-validator.js.map +1 -1
  128. package/lib/features/hints/di.config.js +2 -2
  129. package/lib/features/hints/di.config.js.map +1 -1
  130. package/lib/features/hints/type-hints.d.ts +14 -4
  131. package/lib/features/hints/type-hints.d.ts.map +1 -1
  132. package/lib/features/hints/type-hints.js +21 -18
  133. package/lib/features/hints/type-hints.js.map +1 -1
  134. package/lib/features/hover/di.config.d.ts.map +1 -1
  135. package/lib/features/hover/di.config.js +2 -0
  136. package/lib/features/hover/di.config.js.map +1 -1
  137. package/lib/features/hover/hover.d.ts +4 -2
  138. package/lib/features/hover/hover.d.ts.map +1 -1
  139. package/lib/features/hover/hover.js +22 -4
  140. package/lib/features/hover/hover.js.map +1 -1
  141. package/lib/features/layout/di.config.d.ts +3 -3
  142. package/lib/features/layout/di.config.d.ts.map +1 -1
  143. package/lib/features/layout/di.config.js +9 -6
  144. package/lib/features/layout/di.config.js.map +1 -1
  145. package/lib/features/layout/freeform-layout.d.ts +17 -1
  146. package/lib/features/layout/freeform-layout.d.ts.map +1 -1
  147. package/lib/features/layout/freeform-layout.js +2 -2
  148. package/lib/features/layout/freeform-layout.js.map +1 -1
  149. package/lib/features/layout/hbox-layout.d.ts +41 -0
  150. package/lib/features/layout/hbox-layout.d.ts.map +1 -0
  151. package/lib/features/layout/hbox-layout.js +189 -0
  152. package/lib/features/layout/hbox-layout.js.map +1 -0
  153. package/lib/features/layout/layout-elements-action.d.ts +198 -0
  154. package/lib/features/layout/layout-elements-action.d.ts.map +1 -0
  155. package/lib/features/layout/layout-elements-action.js +391 -0
  156. package/lib/features/layout/layout-elements-action.js.map +1 -0
  157. package/lib/features/layout/layout-elements-action.spec.d.ts +3 -0
  158. package/lib/features/layout/layout-elements-action.spec.d.ts.map +1 -0
  159. package/lib/features/layout/{layout-commands.spec.js → layout-elements-action.spec.js} +75 -56
  160. package/lib/features/layout/layout-elements-action.spec.js.map +1 -0
  161. package/lib/features/layout/vbox-layout.d.ts +17 -1
  162. package/lib/features/layout/vbox-layout.d.ts.map +1 -1
  163. package/lib/features/layout/vbox-layout.js +4 -3
  164. package/lib/features/layout/vbox-layout.js.map +1 -1
  165. package/lib/features/model-source-watcher/model-source-changed-action-handler.d.ts +1 -1
  166. package/lib/features/model-source-watcher/model-source-changed-action-handler.d.ts.map +1 -1
  167. package/lib/features/model-source-watcher/model-source-changed-action-handler.js +7 -7
  168. package/lib/features/model-source-watcher/model-source-changed-action-handler.js.map +1 -1
  169. package/lib/features/mouse-tool/di.config.d.ts +1 -1
  170. package/lib/features/mouse-tool/di.config.d.ts.map +1 -1
  171. package/lib/features/mouse-tool/di.config.js +2 -2
  172. package/lib/features/mouse-tool/di.config.js.map +1 -1
  173. package/lib/features/mouse-tool/mouse-tool.d.ts +0 -1
  174. package/lib/features/mouse-tool/mouse-tool.d.ts.map +1 -1
  175. package/lib/features/mouse-tool/mouse-tool.js +3 -5
  176. package/lib/features/mouse-tool/mouse-tool.js.map +1 -1
  177. package/lib/features/navigation/navigation-action-handler.d.ts +31 -16
  178. package/lib/features/navigation/navigation-action-handler.d.ts.map +1 -1
  179. package/lib/features/navigation/navigation-action-handler.js +50 -66
  180. package/lib/features/navigation/navigation-action-handler.js.map +1 -1
  181. package/lib/features/navigation/navigation-target-resolver.d.ts +3 -3
  182. package/lib/features/navigation/navigation-target-resolver.d.ts.map +1 -1
  183. package/lib/features/navigation/navigation-target-resolver.js +7 -8
  184. package/lib/features/navigation/navigation-target-resolver.js.map +1 -1
  185. package/lib/features/navigation/navigation-target-resolver.spec.js +3 -3
  186. package/lib/features/navigation/navigation-target-resolver.spec.js.map +1 -1
  187. package/lib/features/save/di.config.d.ts +1 -1
  188. package/lib/features/save/di.config.d.ts.map +1 -1
  189. package/lib/features/save/di.config.js +3 -3
  190. package/lib/features/save/di.config.js.map +1 -1
  191. package/lib/features/save/save-keylistener.js +1 -1
  192. package/lib/features/save/save-keylistener.js.map +1 -1
  193. package/lib/features/select/di.config.d.ts +1 -1
  194. package/lib/features/select/di.config.d.ts.map +1 -1
  195. package/lib/features/select/di.config.js +4 -5
  196. package/lib/features/select/di.config.js.map +1 -1
  197. package/lib/features/select/select-feedback-action.d.ts +26 -22
  198. package/lib/features/select/select-feedback-action.d.ts.map +1 -1
  199. package/lib/features/select/select-feedback-action.js +18 -45
  200. package/lib/features/select/select-feedback-action.js.map +1 -1
  201. package/lib/features/select/select-mouse-listener.d.ts +4 -2
  202. package/lib/features/select/select-mouse-listener.d.ts.map +1 -1
  203. package/lib/features/select/select-mouse-listener.js +63 -1
  204. package/lib/features/select/select-mouse-listener.js.map +1 -1
  205. package/lib/features/select/selection-service.d.ts +12 -3
  206. package/lib/features/select/selection-service.d.ts.map +1 -1
  207. package/lib/features/select/selection-service.js +47 -58
  208. package/lib/features/select/selection-service.js.map +1 -1
  209. package/lib/features/select/selection-service.spec.js +10 -7
  210. package/lib/features/select/selection-service.spec.js.map +1 -1
  211. package/lib/features/tool-feedback/change-bounds-tool-feedback.d.ts +16 -8
  212. package/lib/features/tool-feedback/change-bounds-tool-feedback.d.ts.map +1 -1
  213. package/lib/features/tool-feedback/change-bounds-tool-feedback.js +51 -21
  214. package/lib/features/tool-feedback/change-bounds-tool-feedback.js.map +1 -1
  215. package/lib/features/tool-feedback/creation-tool-feedback.d.ts +22 -10
  216. package/lib/features/tool-feedback/creation-tool-feedback.d.ts.map +1 -1
  217. package/lib/features/tool-feedback/creation-tool-feedback.js +46 -21
  218. package/lib/features/tool-feedback/creation-tool-feedback.js.map +1 -1
  219. package/lib/features/tool-feedback/css-feedback.d.ts +17 -10
  220. package/lib/features/tool-feedback/css-feedback.d.ts.map +1 -1
  221. package/lib/features/tool-feedback/css-feedback.js +41 -37
  222. package/lib/features/tool-feedback/css-feedback.js.map +1 -1
  223. package/lib/features/tool-feedback/di.config.d.ts +1 -1
  224. package/lib/features/tool-feedback/di.config.d.ts.map +1 -1
  225. package/lib/features/tool-feedback/di.config.js +4 -4
  226. package/lib/features/tool-feedback/di.config.js.map +1 -1
  227. package/lib/features/tool-feedback/edge-edit-tool-feedback.d.ts +44 -21
  228. package/lib/features/tool-feedback/edge-edit-tool-feedback.d.ts.map +1 -1
  229. package/lib/features/tool-feedback/edge-edit-tool-feedback.js +124 -91
  230. package/lib/features/tool-feedback/edge-edit-tool-feedback.js.map +1 -1
  231. package/lib/features/tool-feedback/feedback-action-dispatcher.d.ts.map +1 -1
  232. package/lib/features/tool-feedback/feedback-action-dispatcher.js +3 -3
  233. package/lib/features/tool-feedback/feedback-action-dispatcher.js.map +1 -1
  234. package/lib/features/tool-feedback/marquee-tool-feedback.d.ts +20 -9
  235. package/lib/features/tool-feedback/marquee-tool-feedback.d.ts.map +1 -1
  236. package/lib/features/tool-feedback/marquee-tool-feedback.js +41 -15
  237. package/lib/features/tool-feedback/marquee-tool-feedback.js.map +1 -1
  238. package/lib/features/tool-feedback/view.d.ts +1 -1
  239. package/lib/features/tool-feedback/view.d.ts.map +1 -1
  240. package/lib/features/tool-feedback/view.js +18 -1
  241. package/lib/features/tool-feedback/view.js.map +1 -1
  242. package/lib/features/tool-palette/di.config.d.ts +1 -1
  243. package/lib/features/tool-palette/di.config.d.ts.map +1 -1
  244. package/lib/features/tool-palette/di.config.js +3 -2
  245. package/lib/features/tool-palette/di.config.js.map +1 -1
  246. package/lib/features/tool-palette/tool-palette.d.ts +9 -6
  247. package/lib/features/tool-palette/tool-palette.d.ts.map +1 -1
  248. package/lib/features/tool-palette/tool-palette.js +25 -20
  249. package/lib/features/tool-palette/tool-palette.js.map +1 -1
  250. package/lib/features/tools/base-glsp-tool.d.ts.map +1 -1
  251. package/lib/features/tools/base-glsp-tool.js +3 -3
  252. package/lib/features/tools/base-glsp-tool.js.map +1 -1
  253. package/lib/features/tools/change-bounds-tool.d.ts +6 -8
  254. package/lib/features/tools/change-bounds-tool.d.ts.map +1 -1
  255. package/lib/features/tools/change-bounds-tool.js +22 -45
  256. package/lib/features/tools/change-bounds-tool.js.map +1 -1
  257. package/lib/features/tools/delete-tool.d.ts.map +1 -1
  258. package/lib/features/tools/delete-tool.js +5 -5
  259. package/lib/features/tools/delete-tool.js.map +1 -1
  260. package/lib/features/tools/di.config.d.ts +9 -2
  261. package/lib/features/tools/di.config.d.ts.map +1 -1
  262. package/lib/features/tools/di.config.js +23 -12
  263. package/lib/features/tools/di.config.js.map +1 -1
  264. package/lib/features/tools/edge-creation-tool.d.ts.map +1 -1
  265. package/lib/features/tools/edge-creation-tool.js +16 -9
  266. package/lib/features/tools/edge-creation-tool.js.map +1 -1
  267. package/lib/features/tools/edge-edit-tool.d.ts +2 -1
  268. package/lib/features/tools/edge-edit-tool.d.ts.map +1 -1
  269. package/lib/features/tools/edge-edit-tool.js +20 -15
  270. package/lib/features/tools/edge-edit-tool.js.map +1 -1
  271. package/lib/features/{tool-palette/palette-item.d.ts → tools/enable-default-tools-on-focus-loss.d.ts} +11 -11
  272. package/lib/features/tools/enable-default-tools-on-focus-loss.d.ts.map +1 -0
  273. package/lib/features/tools/enable-default-tools-on-focus-loss.js +29 -0
  274. package/lib/features/tools/enable-default-tools-on-focus-loss.js.map +1 -0
  275. package/lib/features/tools/marquee-behavior.d.ts +1 -1
  276. package/lib/features/tools/marquee-behavior.js +2 -2
  277. package/lib/features/tools/marquee-behavior.js.map +1 -1
  278. package/lib/features/tools/marquee-mouse-tool.d.ts.map +1 -1
  279. package/lib/features/tools/marquee-mouse-tool.js +7 -7
  280. package/lib/features/tools/marquee-mouse-tool.js.map +1 -1
  281. package/lib/features/tools/marquee-tool.js +1 -1
  282. package/lib/features/tools/marquee-tool.js.map +1 -1
  283. package/lib/features/tools/model.d.ts +2 -1
  284. package/lib/features/tools/model.d.ts.map +1 -1
  285. package/lib/features/tools/model.js +0 -15
  286. package/lib/features/tools/model.js.map +1 -1
  287. package/lib/features/tools/node-creation-tool.d.ts.map +1 -1
  288. package/lib/features/tools/node-creation-tool.js +5 -5
  289. package/lib/features/tools/node-creation-tool.js.map +1 -1
  290. package/lib/features/validation/di.config.d.ts +0 -15
  291. package/lib/features/validation/di.config.d.ts.map +1 -1
  292. package/lib/features/validation/di.config.js +9 -7
  293. package/lib/features/validation/di.config.js.map +1 -1
  294. package/lib/features/validation/marker-navigator.d.ts +26 -24
  295. package/lib/features/validation/marker-navigator.d.ts.map +1 -1
  296. package/lib/features/validation/marker-navigator.js +50 -77
  297. package/lib/features/validation/marker-navigator.js.map +1 -1
  298. package/lib/features/validation/marker-navigator.spec.d.ts.map +1 -1
  299. package/lib/features/validation/marker-navigator.spec.js +2 -16
  300. package/lib/features/validation/marker-navigator.spec.js.map +1 -1
  301. package/lib/features/validation/validate.d.ts +16 -29
  302. package/lib/features/validation/validate.d.ts.map +1 -1
  303. package/lib/features/validation/validate.js +48 -76
  304. package/lib/features/validation/validate.js.map +1 -1
  305. package/lib/features/viewport/di.config.d.ts +1 -1
  306. package/lib/features/viewport/di.config.d.ts.map +1 -1
  307. package/lib/features/viewport/di.config.js +1 -1
  308. package/lib/features/viewport/di.config.js.map +1 -1
  309. package/lib/features/viewport/glsp-scroll-mouse-listener.js +2 -2
  310. package/lib/features/viewport/glsp-scroll-mouse-listener.js.map +1 -1
  311. package/lib/index.d.ts +8 -9
  312. package/lib/index.d.ts.map +1 -1
  313. package/lib/index.js +9 -9
  314. package/lib/index.js.map +1 -1
  315. package/lib/lib/model.d.ts +2 -1
  316. package/lib/lib/model.d.ts.map +1 -1
  317. package/lib/lib/model.js +3 -18
  318. package/lib/lib/model.js.map +1 -1
  319. package/lib/model-source/glsp-diagram-server.d.ts +5 -5
  320. package/lib/model-source/glsp-diagram-server.d.ts.map +1 -1
  321. package/lib/model-source/glsp-diagram-server.js +6 -6
  322. package/lib/model-source/glsp-diagram-server.js.map +1 -1
  323. package/lib/sprotty-reexport.d.ts +174 -0
  324. package/lib/sprotty-reexport.d.ts.map +1 -0
  325. package/lib/sprotty-reexport.js +299 -0
  326. package/lib/sprotty-reexport.js.map +1 -0
  327. package/lib/utils/layout-utils.d.ts +6 -22
  328. package/lib/utils/layout-utils.d.ts.map +1 -1
  329. package/lib/utils/layout-utils.js +1 -1
  330. package/lib/utils/layout-utils.js.map +1 -1
  331. package/lib/utils/smodel-util.d.ts +27 -18
  332. package/lib/utils/smodel-util.d.ts.map +1 -1
  333. package/lib/utils/smodel-util.js +30 -11
  334. package/lib/utils/smodel-util.js.map +1 -1
  335. package/lib/utils/viewpoint-util.d.ts +3 -3
  336. package/lib/utils/viewpoint-util.d.ts.map +1 -1
  337. package/lib/utils/viewpoint-util.js +17 -1
  338. package/lib/utils/viewpoint-util.js.map +1 -1
  339. package/lib/views/base-view-module.d.ts.map +1 -1
  340. package/lib/views/base-view-module.js +3 -1
  341. package/lib/views/base-view-module.js.map +1 -1
  342. package/package.json +5 -4
  343. package/src/base/action-dispatcher.ts +13 -4
  344. package/src/base/actions/focus-change-action.ts +25 -8
  345. package/src/base/actions/sprotty-actions.ts +26 -0
  346. package/src/base/auto-complete/auto-complete-actions.ts +7 -5
  347. package/src/base/auto-complete/auto-complete-widget.ts +15 -13
  348. package/src/base/command-stack.ts +4 -3
  349. package/src/base/container-modules.ts +4 -3
  350. package/src/base/di.config.ts +4 -5
  351. package/src/base/editor-context-service.ts +32 -12
  352. package/src/base/focus-tracker.ts +5 -4
  353. package/src/base/model/update-model-command.ts +52 -39
  354. package/src/base/model-initialization-constraint.ts +3 -4
  355. package/src/base/source-uri-aware.ts +5 -4
  356. package/src/base/tool-manager/glsp-tool-manager.ts +4 -4
  357. package/src/base/tool-manager/tool-actions.ts +37 -0
  358. package/src/base/types.ts +31 -24
  359. package/src/features/change-bounds/movement-restrictor.ts +74 -44
  360. package/src/features/change-bounds/snap.spec.ts +89 -0
  361. package/src/features/change-bounds/snap.ts +99 -12
  362. package/src/features/command-palette/di.config.ts +5 -7
  363. package/src/features/command-palette/server-command-palette-provider.ts +9 -8
  364. package/src/features/context-menu/delete-element-context-menu.ts +6 -6
  365. package/src/features/context-menu/di.config.ts +3 -2
  366. package/src/features/context-menu/selection-service-aware-context-menu-mouse-listener.ts +22 -29
  367. package/src/features/context-menu/server-context-menu-provider.ts +7 -6
  368. package/src/features/copy-paste/copy-paste-context-menu.ts +30 -23
  369. package/src/features/copy-paste/copy-paste-handler.ts +6 -6
  370. package/src/features/copy-paste/di.config.ts +7 -15
  371. package/src/features/decoration/decoration-placer.ts +2 -2
  372. package/src/features/decoration/di.config.ts +3 -5
  373. package/src/features/edit-label/di.config.ts +4 -5
  374. package/src/features/edit-label/edit-label-tool.ts +1 -2
  375. package/src/features/edit-label/edit-label-validator.ts +6 -10
  376. package/src/features/hints/di.config.ts +3 -3
  377. package/src/features/hints/type-hints.ts +31 -16
  378. package/src/features/hover/di.config.ts +4 -0
  379. package/src/features/hover/hover.ts +29 -11
  380. package/src/features/layout/di.config.ts +15 -7
  381. package/src/features/layout/freeform-layout.ts +3 -12
  382. package/src/features/layout/hbox-layout.ts +256 -0
  383. package/src/features/layout/{layout-commands.spec.ts → layout-elements-action.spec.ts} +89 -65
  384. package/src/features/layout/layout-elements-action.ts +486 -0
  385. package/src/features/layout/vbox-layout.ts +4 -8
  386. package/src/features/model-source-watcher/model-source-changed-action-handler.ts +7 -12
  387. package/src/features/mouse-tool/di.config.ts +3 -4
  388. package/src/features/mouse-tool/mouse-tool.ts +4 -7
  389. package/src/features/navigation/navigation-action-handler.ts +76 -42
  390. package/src/features/navigation/navigation-target-resolver.spec.ts +3 -3
  391. package/src/features/navigation/navigation-target-resolver.ts +8 -13
  392. package/src/features/save/di.config.ts +2 -3
  393. package/src/features/save/save-keylistener.ts +1 -1
  394. package/src/features/select/di.config.ts +6 -8
  395. package/src/features/select/select-feedback-action.ts +18 -46
  396. package/src/features/select/select-mouse-listener.ts +82 -3
  397. package/src/features/select/selection-service.spec.ts +12 -9
  398. package/src/features/select/selection-service.ts +49 -58
  399. package/src/features/tool-feedback/change-bounds-tool-feedback.ts +43 -14
  400. package/src/features/tool-feedback/creation-tool-feedback.ts +42 -21
  401. package/src/features/tool-feedback/css-feedback.ts +40 -37
  402. package/src/features/tool-feedback/di.config.ts +4 -5
  403. package/src/features/tool-feedback/edge-edit-tool-feedback.ts +130 -78
  404. package/src/features/tool-feedback/feedback-action-dispatcher.ts +2 -1
  405. package/src/features/tool-feedback/marquee-tool-feedback.ts +36 -11
  406. package/src/features/tool-feedback/view.tsx +3 -3
  407. package/src/features/tool-palette/di.config.ts +3 -2
  408. package/src/features/tool-palette/tool-palette.ts +30 -16
  409. package/src/features/tools/base-glsp-tool.ts +4 -4
  410. package/src/features/tools/change-bounds-tool.ts +31 -61
  411. package/src/features/tools/delete-tool.ts +6 -6
  412. package/src/features/tools/di.config.ts +23 -12
  413. package/src/features/tools/edge-creation-tool.ts +18 -9
  414. package/src/features/tools/edge-edit-tool.ts +20 -16
  415. package/src/features/tools/enable-default-tools-on-focus-loss.ts +33 -0
  416. package/src/features/tools/marquee-behavior.ts +2 -2
  417. package/src/features/tools/marquee-mouse-tool.ts +8 -9
  418. package/src/features/tools/marquee-tool.ts +1 -1
  419. package/src/features/tools/model.ts +2 -1
  420. package/src/features/tools/node-creation-tool.ts +5 -5
  421. package/src/features/validation/di.config.ts +13 -11
  422. package/src/features/validation/marker-navigator.spec.ts +4 -2
  423. package/src/features/validation/marker-navigator.ts +65 -82
  424. package/src/features/validation/validate.ts +55 -85
  425. package/src/features/viewport/di.config.ts +1 -2
  426. package/src/features/viewport/glsp-scroll-mouse-listener.ts +3 -3
  427. package/src/index.ts +9 -9
  428. package/src/lib/model.ts +2 -1
  429. package/src/model-source/glsp-diagram-server.ts +9 -11
  430. package/src/sprotty-reexport.ts +283 -0
  431. package/src/utils/layout-utils.ts +9 -29
  432. package/src/utils/smodel-util.ts +36 -20
  433. package/src/utils/viewpoint-util.ts +5 -14
  434. package/src/views/base-view-module.ts +5 -1
  435. package/lib/features/layout/layout-commands.d.ts +0 -153
  436. package/lib/features/layout/layout-commands.d.ts.map +0 -1
  437. package/lib/features/layout/layout-commands.js +0 -415
  438. package/lib/features/layout/layout-commands.js.map +0 -1
  439. package/lib/features/layout/layout-commands.spec.d.ts +0 -3
  440. package/lib/features/layout/layout-commands.spec.d.ts.map +0 -1
  441. package/lib/features/layout/layout-commands.spec.js.map +0 -1
  442. package/lib/features/tool-palette/palette-item.d.ts.map +0 -1
  443. package/lib/features/tool-palette/palette-item.js.map +0 -1
  444. package/lib/protocol-reexport.d.ts +0 -45
  445. package/lib/protocol-reexport.d.ts.map +0 -1
  446. package/lib/protocol-reexport.js +0 -80
  447. package/lib/protocol-reexport.js.map +0 -1
  448. package/src/features/layout/layout-commands.ts +0 -424
  449. package/src/features/tool-palette/palette-item.ts +0 -38
  450. package/src/protocol-reexport.ts +0 -64
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2019-2021 EclipseSource and others.
2
+ * Copyright (c) 2019-2022 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,18 +13,9 @@
13
13
  *
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
- import { Bounds, Point } from '@eclipse-glsp/protocol';
17
- import {
18
- BoundsAware,
19
- Dimension,
20
- findParentByFeature,
21
- isAlignable,
22
- isViewport,
23
- ORIGIN_POINT,
24
- SModelElement,
25
- translateBounds,
26
- Viewport
27
- } from 'sprotty';
16
+
17
+ import { Bounds, Dimension, Point, Viewport } from '@eclipse-glsp/protocol';
18
+ import { BoundsAware, findParentByFeature, isAlignable, isViewport, SModelElement, translateBounds } from 'sprotty';
28
19
 
29
20
  /**
30
21
  * Return the position corresponding to this mouse event (Browser coordinates)
@@ -70,7 +61,7 @@ export function getAbsolutePosition(target: SModelElement, mouseEvent: MouseEven
70
61
  * @param target A bounds-aware element from the diagram
71
62
  */
72
63
  export function toAbsoluteBounds(element: SModelElement & BoundsAware): Bounds {
73
- const location = isAlignable(element) ? element.alignment : ORIGIN_POINT;
64
+ const location = isAlignable(element) ? element.alignment : Point.ORIGIN;
74
65
  const x = location.x;
75
66
  const y = location.y;
76
67
  const width = element.bounds.width;
@@ -26,6 +26,7 @@ import {
26
26
  ForeignObjectView,
27
27
  HtmlRoot,
28
28
  HtmlRootView,
29
+ moveFeature,
29
30
  PreRenderedElement,
30
31
  PreRenderedView,
31
32
  RectangularNode,
@@ -34,6 +35,7 @@ import {
34
35
  SCompartment,
35
36
  SCompartmentView,
36
37
  SEdge,
38
+ selectFeature,
37
39
  SGraphView,
38
40
  ShapedPreRenderedElement,
39
41
  SIssueMarker,
@@ -66,7 +68,9 @@ export function configureDefaultModelElements(context: ContainerContext): void {
66
68
  configureModelElement(context, DefaultTypes.HTML, HtmlRoot, HtmlRootView);
67
69
 
68
70
  // generic elements
69
- configureModelElement(context, DefaultTypes.FOREIGN_OBJECT, ForeignObjectElement, ForeignObjectView);
71
+ configureModelElement(context, DefaultTypes.FOREIGN_OBJECT, ForeignObjectElement, ForeignObjectView, {
72
+ disable: [selectFeature, moveFeature]
73
+ });
70
74
  configureModelElement(context, DefaultTypes.PRE_RENDERED, PreRenderedElement, PreRenderedView);
71
75
  configureModelElement(context, DefaultTypes.SHAPE_PRE_RENDERED, ShapedPreRenderedElement, PreRenderedView);
72
76
 
@@ -1,153 +0,0 @@
1
- /********************************************************************************
2
- * Copyright (c) 2019-2022 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, ElementAndBounds } from '@eclipse-glsp/protocol';
17
- import { Command, CommandExecutionContext, CommandReturn, ElementMove, IActionDispatcher, SModelElement } from 'sprotty';
18
- import { WriteableElementAndBounds, WriteableElementMove } from '../../utils/layout-utils';
19
- import { BoundsAwareModelElement } from '../../utils/smodel-util';
20
- import { IMovementRestrictor } from '../change-bounds/movement-restrictor';
21
- import { SelectionService } from '../select/selection-service';
22
- export declare enum ResizeDimension {
23
- Width = 0,
24
- Height = 1,
25
- Width_And_Height = 2
26
- }
27
- export declare namespace Reduce {
28
- function min(...values: number[]): number;
29
- function max(...values: number[]): number;
30
- function avg(...values: number[]): number;
31
- function first(...values: number[]): number;
32
- function last(...values: number[]): number;
33
- }
34
- export declare class ResizeElementsAction implements Action {
35
- /**
36
- * IDs of the elements that should be resized. If no IDs are given, the selected elements will be resized.
37
- */
38
- readonly elementIds: string[];
39
- /**
40
- * Resize dimension.
41
- */
42
- readonly dimension: ResizeDimension;
43
- /**
44
- * Function to reduce the dimension to a target dimension value, see Reduce.* for potential functions.
45
- */
46
- readonly reductionFunction: (...values: number[]) => number;
47
- readonly kind: string;
48
- constructor(
49
- /**
50
- * IDs of the elements that should be resized. If no IDs are given, the selected elements will be resized.
51
- */
52
- elementIds: string[],
53
- /**
54
- * Resize dimension.
55
- */
56
- dimension: ResizeDimension,
57
- /**
58
- * Function to reduce the dimension to a target dimension value, see Reduce.* for potential functions.
59
- */
60
- reductionFunction: (...values: number[]) => number, kind?: string);
61
- }
62
- export declare enum Alignment {
63
- Left = 0,
64
- Center = 1,
65
- Right = 2,
66
- Top = 3,
67
- Middle = 4,
68
- Bottom = 5
69
- }
70
- export declare namespace Select {
71
- function all(elements: BoundsAwareModelElement[]): BoundsAwareModelElement[];
72
- function first(elements: BoundsAwareModelElement[]): BoundsAwareModelElement[];
73
- function last(elements: BoundsAwareModelElement[]): BoundsAwareModelElement[];
74
- }
75
- export declare class AlignElementsAction implements Action {
76
- /**
77
- * IDs of the elements that should be aligned. If no IDs are given, the selected elements will be aligned.
78
- */
79
- readonly elementIds: string[];
80
- /**
81
- * Alignment direction.
82
- */
83
- readonly alignment: Alignment;
84
- /**
85
- * Function to selected elements that are considered during alignment calculation, see Select.* for potential functions.
86
- */
87
- readonly selectionFunction: (elements: BoundsAwareModelElement[]) => BoundsAwareModelElement[];
88
- readonly kind: string;
89
- constructor(
90
- /**
91
- * IDs of the elements that should be aligned. If no IDs are given, the selected elements will be aligned.
92
- */
93
- elementIds?: string[],
94
- /**
95
- * Alignment direction.
96
- */
97
- alignment?: Alignment,
98
- /**
99
- * Function to selected elements that are considered during alignment calculation, see Select.* for potential functions.
100
- */
101
- selectionFunction?: (elements: BoundsAwareModelElement[]) => BoundsAwareModelElement[], kind?: string);
102
- }
103
- declare abstract class LayoutElementsCommand extends Command {
104
- protected action: ResizeElementsAction | AlignElementsAction;
105
- protected actionDispatcher: IActionDispatcher;
106
- protected selectionService: SelectionService;
107
- readonly movementRestrictor?: IMovementRestrictor | undefined;
108
- constructor(action: ResizeElementsAction | AlignElementsAction, actionDispatcher: IActionDispatcher, selectionService: SelectionService, movementRestrictor?: IMovementRestrictor | undefined);
109
- getActionElements(context: CommandExecutionContext): BoundsAwareModelElement[];
110
- protected abstract isActionElement(element: SModelElement): element is BoundsAwareModelElement;
111
- dispatchAction(action: Action): void;
112
- dispatchActions(actions: Action[]): void;
113
- }
114
- export declare class ResizeElementsCommand extends LayoutElementsCommand {
115
- protected action: ResizeElementsAction;
116
- protected actionDispatcher: IActionDispatcher;
117
- protected selectionService: SelectionService;
118
- readonly movementRestrictor?: IMovementRestrictor | undefined;
119
- static readonly KIND = "layout:resize";
120
- constructor(action: ResizeElementsAction, actionDispatcher: IActionDispatcher, selectionService: SelectionService, movementRestrictor?: IMovementRestrictor | undefined);
121
- protected isActionElement(element: SModelElement): element is BoundsAwareModelElement;
122
- execute(context: CommandExecutionContext): CommandReturn;
123
- resizeWidth(elements: BoundsAwareModelElement[]): void;
124
- resizeHeight(elements: BoundsAwareModelElement[]): void;
125
- resizeWidthAndHeight(elements: BoundsAwareModelElement[]): void;
126
- dispatchResizeActions(elements: BoundsAwareModelElement[], change: (element: BoundsAwareModelElement, bounds: WriteableElementAndBounds) => void): void;
127
- createElementAndBounds(element: BoundsAwareModelElement, change: (_element: BoundsAwareModelElement, _bounds: WriteableElementAndBounds) => void): WriteableElementAndBounds | undefined;
128
- undo(context: CommandExecutionContext): CommandReturn;
129
- redo(context: CommandExecutionContext): CommandReturn;
130
- }
131
- export declare class AlignElementsCommand extends LayoutElementsCommand {
132
- protected action: AlignElementsAction;
133
- protected actionDispatcher: IActionDispatcher;
134
- protected selectionService: SelectionService;
135
- readonly movementRestrictor?: IMovementRestrictor | undefined;
136
- static readonly KIND = "layout:align";
137
- constructor(action: AlignElementsAction, actionDispatcher: IActionDispatcher, selectionService: SelectionService, movementRestrictor?: IMovementRestrictor | undefined);
138
- protected isActionElement(element: SModelElement): element is BoundsAwareModelElement;
139
- execute(context: CommandExecutionContext): CommandReturn;
140
- alignLeft(elements: BoundsAwareModelElement[]): void;
141
- alignCenter(elements: BoundsAwareModelElement[]): void;
142
- alignRight(elements: BoundsAwareModelElement[]): void;
143
- alignTop(elements: BoundsAwareModelElement[]): void;
144
- alignMiddle(elements: BoundsAwareModelElement[]): void;
145
- alignBottom(elements: BoundsAwareModelElement[]): void;
146
- dispatchAlignActions(elements: BoundsAwareModelElement[], change: (element: BoundsAwareModelElement, move: WriteableElementMove) => void): void;
147
- createElementMove(element: BoundsAwareModelElement, change: (_element: BoundsAwareModelElement, _move: WriteableElementMove) => void): WriteableElementMove | undefined;
148
- createElementAndBounds(element: BoundsAwareModelElement, move: ElementMove): ElementAndBounds;
149
- undo(context: CommandExecutionContext): CommandReturn;
150
- redo(context: CommandExecutionContext): CommandReturn;
151
- }
152
- export {};
153
- //# sourceMappingURL=layout-commands.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"layout-commands.d.ts","sourceRoot":"","sources":["../../../src/features/layout/layout-commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,MAAM,EAAyB,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAEzF,OAAO,EACH,OAAO,EACP,uBAAuB,EACvB,aAAa,EACb,WAAW,EACX,iBAAiB,EAGjB,aAAa,EAEhB,MAA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? 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
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- var __param = (this && this.__param) || function (paramIndex, decorator) {
12
- return function (target, key) { decorator(target, key, paramIndex); }
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.AlignElementsCommand = exports.ResizeElementsCommand = exports.AlignElementsAction = exports.Select = exports.Alignment = exports.ResizeElementsAction = exports.Reduce = exports.ResizeDimension = void 0;
16
- /********************************************************************************
17
- * Copyright (c) 2019-2022 EclipseSource and others.
18
- *
19
- * This program and the accompanying materials are made available under the
20
- * terms of the Eclipse Public License v. 2.0 which is available at
21
- * http://www.eclipse.org/legal/epl-2.0.
22
- *
23
- * This Source Code may also be made available under the following Secondary
24
- * Licenses when the conditions for such availability set forth in the Eclipse
25
- * Public License v. 2.0 are satisfied: GNU General Public License, version 2
26
- * with the GNU Classpath Exception which is available at
27
- * https://www.gnu.org/software/classpath/license.html.
28
- *
29
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
30
- ********************************************************************************/
31
- const protocol_1 = require("@eclipse-glsp/protocol");
32
- const inversify_1 = require("inversify");
33
- const sprotty_1 = require("sprotty");
34
- const types_1 = require("../../base/types");
35
- const layout_utils_1 = require("../../utils/layout-utils");
36
- const model_1 = require("../change-bounds/model");
37
- const selection_service_1 = require("../select/selection-service");
38
- // eslint-disable-next-line no-shadow
39
- var ResizeDimension;
40
- (function (ResizeDimension) {
41
- ResizeDimension[ResizeDimension["Width"] = 0] = "Width";
42
- ResizeDimension[ResizeDimension["Height"] = 1] = "Height";
43
- ResizeDimension[ResizeDimension["Width_And_Height"] = 2] = "Width_And_Height";
44
- })(ResizeDimension = exports.ResizeDimension || (exports.ResizeDimension = {}));
45
- var Reduce;
46
- (function (Reduce) {
47
- function min(...values) {
48
- return Math.min(...values);
49
- }
50
- Reduce.min = min;
51
- function max(...values) {
52
- return Math.max(...values);
53
- }
54
- Reduce.max = max;
55
- function avg(...values) {
56
- return values.reduce((a, b) => a + b, 0) / values.length;
57
- }
58
- Reduce.avg = avg;
59
- function first(...values) {
60
- return values[0];
61
- }
62
- Reduce.first = first;
63
- function last(...values) {
64
- return values[values.length - 1];
65
- }
66
- Reduce.last = last;
67
- })(Reduce = exports.Reduce || (exports.Reduce = {}));
68
- class ResizeElementsAction {
69
- constructor(
70
- /**
71
- * IDs of the elements that should be resized. If no IDs are given, the selected elements will be resized.
72
- */
73
- elementIds = [],
74
- /**
75
- * Resize dimension.
76
- */
77
- dimension = ResizeDimension.Width,
78
- /**
79
- * Function to reduce the dimension to a target dimension value, see Reduce.* for potential functions.
80
- */
81
- reductionFunction, kind = ResizeElementsCommand.KIND) {
82
- this.elementIds = elementIds;
83
- this.dimension = dimension;
84
- this.reductionFunction = reductionFunction;
85
- this.kind = kind;
86
- }
87
- }
88
- exports.ResizeElementsAction = ResizeElementsAction;
89
- // eslint-disable-next-line no-shadow
90
- var Alignment;
91
- (function (Alignment) {
92
- Alignment[Alignment["Left"] = 0] = "Left";
93
- Alignment[Alignment["Center"] = 1] = "Center";
94
- Alignment[Alignment["Right"] = 2] = "Right";
95
- Alignment[Alignment["Top"] = 3] = "Top";
96
- Alignment[Alignment["Middle"] = 4] = "Middle";
97
- Alignment[Alignment["Bottom"] = 5] = "Bottom";
98
- })(Alignment = exports.Alignment || (exports.Alignment = {}));
99
- var Select;
100
- (function (Select) {
101
- function all(elements) {
102
- return elements;
103
- }
104
- Select.all = all;
105
- function first(elements) {
106
- return [elements[0]];
107
- }
108
- Select.first = first;
109
- function last(elements) {
110
- return [elements[elements.length - 1]];
111
- }
112
- Select.last = last;
113
- })(Select = exports.Select || (exports.Select = {}));
114
- class AlignElementsAction {
115
- constructor(
116
- /**
117
- * IDs of the elements that should be aligned. If no IDs are given, the selected elements will be aligned.
118
- */
119
- elementIds = [],
120
- /**
121
- * Alignment direction.
122
- */
123
- alignment = Alignment.Left,
124
- /**
125
- * Function to selected elements that are considered during alignment calculation, see Select.* for potential functions.
126
- */
127
- selectionFunction = Select.all, kind = AlignElementsCommand.KIND) {
128
- this.elementIds = elementIds;
129
- this.alignment = alignment;
130
- this.selectionFunction = selectionFunction;
131
- this.kind = kind;
132
- }
133
- }
134
- exports.AlignElementsAction = AlignElementsAction;
135
- let LayoutElementsCommand = class LayoutElementsCommand extends sprotty_1.Command {
136
- constructor(action, actionDispatcher, selectionService, movementRestrictor) {
137
- super();
138
- this.action = action;
139
- this.actionDispatcher = actionDispatcher;
140
- this.selectionService = selectionService;
141
- this.movementRestrictor = movementRestrictor;
142
- }
143
- getActionElements(context) {
144
- const model = context.root;
145
- const elementIDs = this.action.elementIds;
146
- if (elementIDs.length === 0) {
147
- // collect the selected elements from the selection service (selection order is kept by service)
148
- this.selectionService.getSelectedElementIDs().forEach(elementID => elementIDs.push(elementID));
149
- }
150
- const boundsAwareElements = [];
151
- elementIDs.forEach(id => {
152
- const element = model.index.getById(id);
153
- if (element && this.isActionElement(element)) {
154
- boundsAwareElements.push(element);
155
- }
156
- });
157
- return boundsAwareElements;
158
- }
159
- dispatchAction(action) {
160
- this.actionDispatcher.dispatch(action);
161
- }
162
- dispatchActions(actions) {
163
- this.actionDispatcher.dispatchAll(actions);
164
- }
165
- };
166
- LayoutElementsCommand = __decorate([
167
- (0, inversify_1.injectable)(),
168
- __param(0, (0, inversify_1.inject)(sprotty_1.TYPES.Action)),
169
- __param(1, (0, inversify_1.inject)(sprotty_1.TYPES.IActionDispatcher)),
170
- __param(2, (0, inversify_1.inject)(types_1.GLSP_TYPES.SelectionService)),
171
- __param(3, (0, inversify_1.inject)(types_1.GLSP_TYPES.IMovementRestrictor)),
172
- __param(3, (0, inversify_1.optional)()),
173
- __metadata("design:paramtypes", [Object, Object, selection_service_1.SelectionService, Object])
174
- ], LayoutElementsCommand);
175
- let ResizeElementsCommand = class ResizeElementsCommand extends LayoutElementsCommand {
176
- constructor(action, actionDispatcher, selectionService, movementRestrictor) {
177
- super(action, actionDispatcher, selectionService, movementRestrictor);
178
- this.action = action;
179
- this.actionDispatcher = actionDispatcher;
180
- this.selectionService = selectionService;
181
- this.movementRestrictor = movementRestrictor;
182
- }
183
- isActionElement(element) {
184
- return (0, model_1.isResizable)(element);
185
- }
186
- execute(context) {
187
- const elements = this.getActionElements(context);
188
- if (elements.length > 1) {
189
- switch (this.action.dimension) {
190
- case ResizeDimension.Width:
191
- this.resizeWidth(elements);
192
- break;
193
- case ResizeDimension.Height:
194
- this.resizeHeight(elements);
195
- break;
196
- case ResizeDimension.Width_And_Height:
197
- this.resizeWidthAndHeight(elements);
198
- break;
199
- }
200
- }
201
- return context.root;
202
- }
203
- resizeWidth(elements) {
204
- const targetWidth = this.action.reductionFunction(...elements.map(element => element.bounds.width));
205
- this.dispatchResizeActions(elements, (element, bounds) => {
206
- // resize around center
207
- const halfDiffWidth = 0.5 * (targetWidth - element.bounds.width);
208
- bounds.newPosition.x = element.bounds.x - halfDiffWidth;
209
- bounds.newSize.width = targetWidth;
210
- });
211
- }
212
- resizeHeight(elements) {
213
- const targetHeight = this.action.reductionFunction(...elements.map(element => element.bounds.height));
214
- this.dispatchResizeActions(elements, (element, bounds) => {
215
- // resize around middle
216
- const halfDiffHeight = 0.5 * (targetHeight - element.bounds.height);
217
- bounds.newPosition.y = element.bounds.y - halfDiffHeight;
218
- bounds.newSize.height = targetHeight;
219
- });
220
- }
221
- resizeWidthAndHeight(elements) {
222
- const targetWidth = this.action.reductionFunction(...elements.map(element => element.bounds.width));
223
- const targetHeight = this.action.reductionFunction(...elements.map(element => element.bounds.height));
224
- this.dispatchResizeActions(elements, (element, bounds) => {
225
- // resize around center and middle
226
- const halfDiffWidth = 0.5 * (targetWidth - element.bounds.width);
227
- const halfDiffHeight = 0.5 * (targetHeight - element.bounds.height);
228
- bounds.newPosition.x = element.bounds.x - halfDiffWidth;
229
- bounds.newPosition.y = element.bounds.y - halfDiffHeight;
230
- bounds.newSize.width = targetWidth;
231
- bounds.newSize.height = targetHeight;
232
- });
233
- }
234
- dispatchResizeActions(elements, change) {
235
- const elementAndBounds = []; // client- and server-side resize
236
- elements.forEach(element => {
237
- const elementChange = this.createElementAndBounds(element, change);
238
- if (elementChange) {
239
- // simply skip invalid changes
240
- elementAndBounds.push(elementChange);
241
- }
242
- });
243
- this.dispatchActions([new sprotty_1.SetBoundsAction(elementAndBounds), new protocol_1.ChangeBoundsOperation(elementAndBounds)]);
244
- }
245
- createElementAndBounds(element, change) {
246
- const bounds = {
247
- elementId: element.id,
248
- newPosition: {
249
- x: element.bounds.x,
250
- y: element.bounds.y
251
- },
252
- newSize: {
253
- width: element.bounds.width,
254
- height: element.bounds.height
255
- }
256
- };
257
- change(element, bounds);
258
- return (0, layout_utils_1.toValidElementAndBounds)(element, bounds, this.movementRestrictor);
259
- }
260
- undo(context) {
261
- // we dispatch another action which can be undone, so no explicit implementation necessary
262
- return context.root;
263
- }
264
- redo(context) {
265
- // we dispatch another action which can be redone, so no explicit implementation necessary
266
- return context.root;
267
- }
268
- };
269
- ResizeElementsCommand.KIND = 'layout:resize';
270
- ResizeElementsCommand = __decorate([
271
- (0, inversify_1.injectable)(),
272
- __param(0, (0, inversify_1.inject)(sprotty_1.TYPES.Action)),
273
- __param(1, (0, inversify_1.inject)(sprotty_1.TYPES.IActionDispatcher)),
274
- __param(2, (0, inversify_1.inject)(types_1.GLSP_TYPES.SelectionService)),
275
- __param(3, (0, inversify_1.inject)(types_1.GLSP_TYPES.IMovementRestrictor)),
276
- __param(3, (0, inversify_1.optional)()),
277
- __metadata("design:paramtypes", [ResizeElementsAction, Object, selection_service_1.SelectionService, Object])
278
- ], ResizeElementsCommand);
279
- exports.ResizeElementsCommand = ResizeElementsCommand;
280
- let AlignElementsCommand = class AlignElementsCommand extends LayoutElementsCommand {
281
- constructor(action, actionDispatcher, selectionService, movementRestrictor) {
282
- super(action, actionDispatcher, selectionService, movementRestrictor);
283
- this.action = action;
284
- this.actionDispatcher = actionDispatcher;
285
- this.selectionService = selectionService;
286
- this.movementRestrictor = movementRestrictor;
287
- }
288
- isActionElement(element) {
289
- return (0, model_1.isBoundsAwareMoveable)(element);
290
- }
291
- execute(context) {
292
- const elements = this.getActionElements(context);
293
- if (elements.length > 1) {
294
- switch (this.action.alignment) {
295
- case Alignment.Left:
296
- this.alignLeft(elements);
297
- break;
298
- case Alignment.Center:
299
- this.alignCenter(elements);
300
- break;
301
- case Alignment.Right:
302
- this.alignRight(elements);
303
- break;
304
- case Alignment.Top:
305
- this.alignTop(elements);
306
- break;
307
- case Alignment.Middle:
308
- this.alignMiddle(elements);
309
- break;
310
- case Alignment.Bottom:
311
- this.alignBottom(elements);
312
- break;
313
- }
314
- }
315
- return context.root;
316
- }
317
- alignLeft(elements) {
318
- const calculationElements = this.action.selectionFunction(elements);
319
- const minX = calculationElements.map(element => element.bounds.x).reduce((a, b) => Math.min(a, b));
320
- this.dispatchAlignActions(elements, (_, move) => (move.toPosition.x = minX));
321
- }
322
- alignCenter(elements) {
323
- const calculationElements = this.action.selectionFunction(elements);
324
- const minX = calculationElements.map(element => element.bounds.x).reduce((a, b) => Math.min(a, b));
325
- const maxX = calculationElements.map(element => element.bounds.x + element.bounds.width).reduce((a, b) => Math.max(a, b));
326
- const diffX = maxX - minX;
327
- const centerX = minX + 0.5 * diffX;
328
- this.dispatchAlignActions(elements, (element, move) => (move.toPosition.x = centerX - 0.5 * element.bounds.width));
329
- }
330
- alignRight(elements) {
331
- const calculationElements = this.action.selectionFunction(elements);
332
- const maxX = calculationElements.map(element => element.bounds.x + element.bounds.width).reduce((a, b) => Math.max(a, b));
333
- this.dispatchAlignActions(elements, (element, move) => (move.toPosition.x = maxX - element.bounds.width));
334
- }
335
- alignTop(elements) {
336
- const calculationElements = this.action.selectionFunction(elements);
337
- const minY = calculationElements.map(element => element.bounds.y).reduce((a, b) => Math.min(a, b));
338
- this.dispatchAlignActions(elements, (_, move) => (move.toPosition.y = minY));
339
- }
340
- alignMiddle(elements) {
341
- const calculationElements = this.action.selectionFunction(elements);
342
- const minY = calculationElements.map(element => element.bounds.y).reduce((a, b) => Math.min(a, b));
343
- const maxY = calculationElements.map(element => element.bounds.y + element.bounds.height).reduce((a, b) => Math.max(a, b));
344
- const diffY = maxY - minY;
345
- const middleY = minY + 0.5 * diffY;
346
- this.dispatchAlignActions(elements, (element, move) => (move.toPosition.y = middleY - 0.5 * element.bounds.height));
347
- }
348
- alignBottom(elements) {
349
- const calculationElements = this.action.selectionFunction(elements);
350
- const maxY = calculationElements.map(element => element.bounds.y + element.bounds.height).reduce((a, b) => Math.max(a, b));
351
- this.dispatchAlignActions(elements, (element, move) => (move.toPosition.y = maxY - element.bounds.height));
352
- }
353
- dispatchAlignActions(elements, change) {
354
- const moves = []; // client-side move
355
- const elementAndBounds = []; // server-side move
356
- elements.forEach(element => {
357
- const move = this.createElementMove(element, change);
358
- if (move) {
359
- // simply skip invalid changes
360
- moves.push(move);
361
- const elementAndBound = this.createElementAndBounds(element, move);
362
- elementAndBounds.push(elementAndBound);
363
- }
364
- });
365
- this.dispatchActions([new sprotty_1.MoveAction(moves), new protocol_1.ChangeBoundsOperation(elementAndBounds)]);
366
- }
367
- createElementMove(element, change) {
368
- const move = {
369
- elementId: element.id,
370
- fromPosition: {
371
- x: element.bounds.x,
372
- y: element.bounds.y
373
- },
374
- toPosition: {
375
- x: element.bounds.x,
376
- y: element.bounds.y
377
- }
378
- };
379
- change(element, move);
380
- return (0, layout_utils_1.toValidElementMove)(element, move, this.movementRestrictor);
381
- }
382
- createElementAndBounds(element, move) {
383
- return {
384
- elementId: element.id,
385
- newPosition: {
386
- x: move.toPosition.x,
387
- y: move.toPosition.y
388
- },
389
- newSize: {
390
- width: element.bounds.width,
391
- height: element.bounds.height
392
- }
393
- };
394
- }
395
- undo(context) {
396
- // we dispatch another action which can be undone, so no explicit implementation necessary
397
- return context.root;
398
- }
399
- redo(context) {
400
- // we dispatch another action which can be redone, so no explicit implementation necessary
401
- return context.root;
402
- }
403
- };
404
- AlignElementsCommand.KIND = 'layout:align';
405
- AlignElementsCommand = __decorate([
406
- (0, inversify_1.injectable)(),
407
- __param(0, (0, inversify_1.inject)(sprotty_1.TYPES.Action)),
408
- __param(1, (0, inversify_1.inject)(sprotty_1.TYPES.IActionDispatcher)),
409
- __param(2, (0, inversify_1.inject)(types_1.GLSP_TYPES.SelectionService)),
410
- __param(3, (0, inversify_1.inject)(types_1.GLSP_TYPES.IMovementRestrictor)),
411
- __param(3, (0, inversify_1.optional)()),
412
- __metadata("design:paramtypes", [AlignElementsAction, Object, selection_service_1.SelectionService, Object])
413
- ], AlignElementsCommand);
414
- exports.AlignElementsCommand = AlignElementsCommand;
415
- //# sourceMappingURL=layout-commands.js.map