@eclipse-glsp/client 1.1.0-next.c8b4f65.194 → 1.1.0-next.d9a27cd.236

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 (344) hide show
  1. package/README.md +1 -1
  2. package/css/decoration.css +1 -1
  3. package/css/glsp-sprotty.css +18 -18
  4. package/lib/base/action-dispatcher.js.map +1 -1
  5. package/lib/base/auto-complete/auto-complete-widget.d.ts +2 -2
  6. package/lib/base/auto-complete/auto-complete-widget.js +3 -3
  7. package/lib/base/command-stack.d.ts +1 -2
  8. package/lib/base/command-stack.d.ts.map +1 -1
  9. package/lib/base/command-stack.js +5 -14
  10. package/lib/base/command-stack.js.map +1 -1
  11. package/lib/base/container-modules.d.ts +32 -2
  12. package/lib/base/container-modules.d.ts.map +1 -1
  13. package/lib/base/container-modules.js +78 -43
  14. package/lib/base/container-modules.js.map +1 -1
  15. package/lib/base/di.config.d.ts +1 -1
  16. package/lib/base/di.config.d.ts.map +1 -1
  17. package/lib/base/di.config.js +7 -7
  18. package/lib/base/di.config.js.map +1 -1
  19. package/lib/base/editor-context-service.d.ts +4 -4
  20. package/lib/base/editor-context-service.d.ts.map +1 -1
  21. package/lib/base/editor-context-service.js +3 -3
  22. package/lib/base/editor-context-service.js.map +1 -1
  23. package/lib/base/focus-tracker.js.map +1 -1
  24. package/lib/base/model/model-registry.js.map +1 -1
  25. package/lib/base/model/update-model-command.js.map +1 -1
  26. package/lib/base/model-initialization-constraint.js.map +1 -1
  27. package/lib/base/selection-clearing-mouse-listener.js +1 -1
  28. package/lib/base/selection-clearing-mouse-listener.js.map +1 -1
  29. package/lib/base/tool-manager/glsp-tool-manager.d.ts +4 -5
  30. package/lib/base/tool-manager/glsp-tool-manager.d.ts.map +1 -1
  31. package/lib/base/tool-manager/glsp-tool-manager.js +15 -8
  32. package/lib/base/tool-manager/glsp-tool-manager.js.map +1 -1
  33. package/lib/base/view/view-registry.js.map +1 -1
  34. package/lib/features/bounds/di.config.d.ts +4 -0
  35. package/lib/features/bounds/di.config.d.ts.map +1 -0
  36. package/lib/features/bounds/di.config.js +39 -0
  37. package/lib/features/bounds/di.config.js.map +1 -0
  38. package/lib/features/{layout → bounds}/freeform-layout.d.ts +2 -2
  39. package/lib/features/{layout → bounds}/freeform-layout.d.ts.map +1 -1
  40. package/lib/features/{layout → bounds}/freeform-layout.js +2 -2
  41. package/lib/features/{layout → bounds}/freeform-layout.js.map +1 -1
  42. package/lib/features/bounds/freeform-layout.spec.d.ts.map +1 -0
  43. package/lib/features/{layout/tests → bounds}/freeform-layout.spec.js +37 -37
  44. package/lib/features/bounds/freeform-layout.spec.js.map +1 -0
  45. package/lib/features/bounds/glsp-hidden-bounds-updater.d.ts +34 -0
  46. package/lib/features/bounds/glsp-hidden-bounds-updater.d.ts.map +1 -0
  47. package/lib/features/bounds/glsp-hidden-bounds-updater.js +99 -0
  48. package/lib/features/bounds/glsp-hidden-bounds-updater.js.map +1 -0
  49. package/lib/features/{layout → bounds}/hbox-layout.d.ts +1 -1
  50. package/lib/features/{layout → bounds}/hbox-layout.d.ts.map +1 -1
  51. package/lib/features/{layout → bounds}/hbox-layout.js +1 -1
  52. package/lib/features/{layout → bounds}/hbox-layout.js.map +1 -1
  53. package/lib/features/bounds/hbox-layout.spec.d.ts.map +1 -0
  54. package/lib/features/{layout/tests → bounds}/hbox-layout.spec.js +18 -18
  55. package/lib/features/bounds/hbox-layout.spec.js.map +1 -0
  56. package/lib/features/{layout/tests/layouter-test-util.d.ts → bounds/layouter-test-util.spec.d.ts} +3 -4
  57. package/lib/features/bounds/layouter-test-util.spec.d.ts.map +1 -0
  58. package/lib/features/{layout/tests/layouter-test-util.js → bounds/layouter-test-util.spec.js} +7 -7
  59. package/lib/features/bounds/layouter-test-util.spec.js.map +1 -0
  60. package/lib/features/{layout → bounds}/layouter.d.ts +1 -1
  61. package/lib/features/{layout → bounds}/layouter.d.ts.map +1 -1
  62. package/lib/features/{layout → bounds}/layouter.js +1 -1
  63. package/lib/features/{layout → bounds}/layouter.js.map +1 -1
  64. package/lib/features/{layout → bounds}/vbox-layout.d.ts +1 -1
  65. package/lib/features/{layout → bounds}/vbox-layout.d.ts.map +1 -1
  66. package/lib/features/{layout → bounds}/vbox-layout.js +1 -1
  67. package/lib/features/{layout → bounds}/vbox-layout.js.map +1 -1
  68. package/lib/features/bounds/vbox-layout.spec.d.ts.map +1 -0
  69. package/lib/features/{layout/tests → bounds}/vbox-layout.spec.js +18 -18
  70. package/lib/features/bounds/vbox-layout.spec.js.map +1 -0
  71. package/lib/features/change-bounds/movement-restrictor.js.map +1 -1
  72. package/lib/features/change-bounds/snap.js.map +1 -1
  73. package/lib/features/command-palette/command-palette-tool.d.ts +1 -1
  74. package/lib/features/command-palette/command-palette-tool.d.ts.map +1 -1
  75. package/lib/features/command-palette/command-palette-tool.js +3 -3
  76. package/lib/features/command-palette/command-palette-tool.js.map +1 -1
  77. package/lib/features/command-palette/di.config.d.ts +0 -15
  78. package/lib/features/command-palette/di.config.d.ts.map +1 -1
  79. package/lib/features/command-palette/di.config.js +6 -7
  80. package/lib/features/command-palette/di.config.js.map +1 -1
  81. package/lib/features/command-palette/server-command-palette-provider.js.map +1 -1
  82. package/lib/features/context-menu/delete-element-context-menu.js.map +1 -1
  83. package/lib/features/context-menu/di.config.d.ts +0 -15
  84. package/lib/features/context-menu/di.config.d.ts.map +1 -1
  85. package/lib/features/context-menu/di.config.js +4 -3
  86. package/lib/features/context-menu/di.config.js.map +1 -1
  87. package/lib/features/context-menu/selection-service-aware-context-menu-mouse-listener.js.map +1 -1
  88. package/lib/features/context-menu/server-context-menu-provider.js.map +1 -1
  89. package/lib/features/copy-paste/copy-paste-context-menu.js.map +1 -1
  90. package/lib/features/copy-paste/copy-paste-handler.d.ts +4 -4
  91. package/lib/features/copy-paste/copy-paste-handler.d.ts.map +1 -1
  92. package/lib/features/copy-paste/copy-paste-handler.js +7 -8
  93. package/lib/features/copy-paste/copy-paste-handler.js.map +1 -1
  94. package/lib/features/decoration/decoration-placer.js.map +1 -1
  95. package/lib/features/decoration/di.config.d.ts +0 -15
  96. package/lib/features/decoration/di.config.d.ts.map +1 -1
  97. package/lib/features/decoration/di.config.js +4 -4
  98. package/lib/features/decoration/di.config.js.map +1 -1
  99. package/lib/features/edit-label/di.config.d.ts +0 -15
  100. package/lib/features/edit-label/di.config.d.ts.map +1 -1
  101. package/lib/features/edit-label/di.config.js +3 -2
  102. package/lib/features/edit-label/di.config.js.map +1 -1
  103. package/lib/features/edit-label/edit-label-tool.js.map +1 -1
  104. package/lib/features/edit-label/edit-label-validator.js.map +1 -1
  105. package/lib/features/export/di.config.d.ts +4 -0
  106. package/lib/features/export/di.config.d.ts.map +1 -0
  107. package/lib/features/export/di.config.js +30 -0
  108. package/lib/features/export/di.config.js.map +1 -0
  109. package/lib/features/export/glsp-svg-exporter.d.ts +1 -1
  110. package/lib/features/export/glsp-svg-exporter.d.ts.map +1 -1
  111. package/lib/features/export/glsp-svg-exporter.js +1 -2
  112. package/lib/features/export/glsp-svg-exporter.js.map +1 -1
  113. package/lib/features/hints/type-hints.js.map +1 -1
  114. package/lib/features/hover/di.config.d.ts +0 -15
  115. package/lib/features/hover/di.config.d.ts.map +1 -1
  116. package/lib/features/hover/di.config.js +7 -7
  117. package/lib/features/hover/di.config.js.map +1 -1
  118. package/lib/features/hover/hover.d.ts.map +1 -1
  119. package/lib/features/hover/hover.js +2 -1
  120. package/lib/features/hover/hover.js.map +1 -1
  121. package/lib/features/layout/di.config.d.ts +1 -1
  122. package/lib/features/layout/di.config.d.ts.map +1 -1
  123. package/lib/features/layout/di.config.js +1 -9
  124. package/lib/features/layout/di.config.js.map +1 -1
  125. package/lib/features/layout/layout-elements-action.d.ts +4 -4
  126. package/lib/features/layout/layout-elements-action.d.ts.map +1 -1
  127. package/lib/features/layout/layout-elements-action.js +2 -2
  128. package/lib/features/layout/layout-elements-action.js.map +1 -1
  129. package/lib/features/mouse-tool/mouse-tool.d.ts +1 -1
  130. package/lib/features/mouse-tool/mouse-tool.d.ts.map +1 -1
  131. package/lib/features/mouse-tool/mouse-tool.js.map +1 -1
  132. package/lib/features/navigation/di.config.d.ts +2 -1
  133. package/lib/features/navigation/di.config.d.ts.map +1 -1
  134. package/lib/features/navigation/di.config.js +3 -3
  135. package/lib/features/navigation/di.config.js.map +1 -1
  136. package/lib/features/navigation/navigation-action-handler.d.ts +2 -2
  137. package/lib/features/navigation/navigation-action-handler.js +2 -2
  138. package/lib/features/navigation/navigation-action-handler.js.map +1 -1
  139. package/lib/features/navigation/navigation-target-resolver.js.map +1 -1
  140. package/lib/features/save/di.config.d.ts +0 -15
  141. package/lib/features/save/di.config.d.ts.map +1 -1
  142. package/lib/features/save/di.config.js +3 -2
  143. package/lib/features/save/di.config.js.map +1 -1
  144. package/lib/features/save/model.d.ts +1 -1
  145. package/lib/features/select/di.config.d.ts +0 -15
  146. package/lib/features/select/di.config.d.ts.map +1 -1
  147. package/lib/features/select/di.config.js +8 -7
  148. package/lib/features/select/di.config.js.map +1 -1
  149. package/lib/features/select/select-feedback-action.js.map +1 -1
  150. package/lib/features/select/select-mouse-listener.d.ts +1 -1
  151. package/lib/features/select/select-mouse-listener.d.ts.map +1 -1
  152. package/lib/features/select/select-mouse-listener.js +2 -1
  153. package/lib/features/select/select-mouse-listener.js.map +1 -1
  154. package/lib/features/select/selection-service.js.map +1 -1
  155. package/lib/features/select/selection-service.spec.js +19 -3
  156. package/lib/features/select/selection-service.spec.js.map +1 -1
  157. package/lib/features/source-model-watcher/di.config.js +1 -1
  158. package/lib/features/source-model-watcher/source-model-changed-action-handler.js.map +1 -1
  159. package/lib/features/svg-metadata/di.config.d.ts +19 -0
  160. package/lib/features/svg-metadata/di.config.d.ts.map +1 -0
  161. package/lib/features/svg-metadata/di.config.js +26 -0
  162. package/lib/features/svg-metadata/di.config.js.map +1 -0
  163. package/lib/features/svg-metadata/metadata-placer.d.ts +24 -0
  164. package/lib/features/svg-metadata/metadata-placer.d.ts.map +1 -0
  165. package/lib/features/svg-metadata/metadata-placer.js +63 -0
  166. package/lib/features/svg-metadata/metadata-placer.js.map +1 -0
  167. package/lib/features/tool-feedback/change-bounds-tool-feedback.d.ts +4 -3
  168. package/lib/features/tool-feedback/change-bounds-tool-feedback.d.ts.map +1 -1
  169. package/lib/features/tool-feedback/change-bounds-tool-feedback.js +5 -4
  170. package/lib/features/tool-feedback/change-bounds-tool-feedback.js.map +1 -1
  171. package/lib/features/tool-feedback/creation-tool-feedback.d.ts +6 -6
  172. package/lib/features/tool-feedback/creation-tool-feedback.d.ts.map +1 -1
  173. package/lib/features/tool-feedback/creation-tool-feedback.js +7 -10
  174. package/lib/features/tool-feedback/creation-tool-feedback.js.map +1 -1
  175. package/lib/features/tool-feedback/css-feedback.js.map +1 -1
  176. package/lib/features/tool-feedback/di.config.d.ts +0 -15
  177. package/lib/features/tool-feedback/di.config.d.ts.map +1 -1
  178. package/lib/features/tool-feedback/di.config.js +20 -18
  179. package/lib/features/tool-feedback/di.config.js.map +1 -1
  180. package/lib/features/tool-feedback/edge-edit-tool-feedback.d.ts +1 -2
  181. package/lib/features/tool-feedback/edge-edit-tool-feedback.d.ts.map +1 -1
  182. package/lib/features/tool-feedback/edge-edit-tool-feedback.js +5 -10
  183. package/lib/features/tool-feedback/edge-edit-tool-feedback.js.map +1 -1
  184. package/lib/features/tool-feedback/feedback-action-dispatcher.js.map +1 -1
  185. package/lib/features/tool-feedback/marquee-tool-feedback.js.map +1 -1
  186. package/lib/features/tool-feedback/view.js.map +1 -1
  187. package/lib/features/tool-palette/di.config.d.ts +0 -15
  188. package/lib/features/tool-palette/di.config.d.ts.map +1 -1
  189. package/lib/features/tool-palette/di.config.js +4 -4
  190. package/lib/features/tool-palette/di.config.js.map +1 -1
  191. package/lib/features/tool-palette/tool-palette.d.ts +1 -1
  192. package/lib/features/tool-palette/tool-palette.d.ts.map +1 -1
  193. package/lib/features/tool-palette/tool-palette.js +2 -2
  194. package/lib/features/tool-palette/tool-palette.js.map +1 -1
  195. package/lib/features/tools/base-glsp-tool.js.map +1 -1
  196. package/lib/features/tools/change-bounds-tool.d.ts +1 -1
  197. package/lib/features/tools/change-bounds-tool.d.ts.map +1 -1
  198. package/lib/features/tools/change-bounds-tool.js +6 -6
  199. package/lib/features/tools/change-bounds-tool.js.map +1 -1
  200. package/lib/features/tools/delete-tool.js.map +1 -1
  201. package/lib/features/tools/di.config.d.ts +18 -5
  202. package/lib/features/tools/di.config.d.ts.map +1 -1
  203. package/lib/features/tools/di.config.js +16 -17
  204. package/lib/features/tools/di.config.js.map +1 -1
  205. package/lib/features/tools/edge-creation-tool.js.map +1 -1
  206. package/lib/features/tools/edge-edit-tool.js.map +1 -1
  207. package/lib/features/tools/enable-default-tools-on-focus-loss.js.map +1 -1
  208. package/lib/features/tools/glsp-manhattan-edge-router.d.ts +20 -0
  209. package/lib/features/tools/glsp-manhattan-edge-router.d.ts.map +1 -0
  210. package/lib/features/tools/glsp-manhattan-edge-router.js +69 -0
  211. package/lib/features/tools/glsp-manhattan-edge-router.js.map +1 -0
  212. package/lib/features/tools/marquee-mouse-tool.js.map +1 -1
  213. package/lib/features/tools/marquee-tool.js.map +1 -1
  214. package/lib/features/tools/node-creation-tool.js.map +1 -1
  215. package/lib/features/tools/view.js.map +1 -1
  216. package/lib/features/validation/di.config.js +4 -4
  217. package/lib/features/validation/di.config.js.map +1 -1
  218. package/lib/features/validation/issue-marker.d.ts +1 -1
  219. package/lib/features/validation/issue-marker.js +1 -1
  220. package/lib/features/validation/marker-navigator.d.ts +1 -1
  221. package/lib/features/validation/marker-navigator.d.ts.map +1 -1
  222. package/lib/features/validation/marker-navigator.js.map +1 -1
  223. package/lib/features/validation/validate.d.ts +6 -6
  224. package/lib/features/validation/validate.d.ts.map +1 -1
  225. package/lib/features/validation/validate.js +18 -17
  226. package/lib/features/validation/validate.js.map +1 -1
  227. package/lib/features/viewport/di.config.d.ts +0 -15
  228. package/lib/features/viewport/di.config.d.ts.map +1 -1
  229. package/lib/features/viewport/di.config.js +12 -11
  230. package/lib/features/viewport/di.config.js.map +1 -1
  231. package/lib/features/viewport/glsp-scroll-mouse-listener.js.map +1 -1
  232. package/lib/index.d.ts +28 -4
  233. package/lib/index.d.ts.map +1 -1
  234. package/lib/index.js +66 -34
  235. package/lib/index.js.map +1 -1
  236. package/lib/lib/model.d.ts +7 -3
  237. package/lib/lib/model.d.ts.map +1 -1
  238. package/lib/lib/model.js +48 -1
  239. package/lib/lib/model.js.map +1 -1
  240. package/lib/model-source/glsp-diagram-server.js.map +1 -1
  241. package/lib/sprotty-reexport.d.ts +7 -7
  242. package/lib/sprotty-reexport.d.ts.map +1 -1
  243. package/lib/sprotty-reexport.js +19 -10
  244. package/lib/sprotty-reexport.js.map +1 -1
  245. package/lib/utils/html-utils.d.ts +1 -1
  246. package/lib/utils/html-utils.js +1 -1
  247. package/lib/utils/smodel-util.d.ts +28 -7
  248. package/lib/utils/smodel-util.d.ts.map +1 -1
  249. package/lib/utils/smodel-util.js +41 -8
  250. package/lib/utils/smodel-util.js.map +1 -1
  251. package/lib/views/base-view-module.d.ts +18 -6
  252. package/lib/views/base-view-module.d.ts.map +1 -1
  253. package/lib/views/base-view-module.js +1 -1
  254. package/lib/views/base-view-module.js.map +1 -1
  255. package/lib/views/compartments.js.map +1 -1
  256. package/lib/views/glsp-edge-view.d.ts +2 -2
  257. package/lib/views/glsp-edge-view.d.ts.map +1 -1
  258. package/lib/views/glsp-edge-view.js +2 -2
  259. package/lib/views/glsp-edge-view.js.map +1 -1
  260. package/lib/views/glsp-projection-view.d.ts +1 -1
  261. package/lib/views/glsp-projection-view.js +1 -1
  262. package/lib/views/glsp-projection-view.js.map +1 -1
  263. package/lib/views/index.d.ts +1 -1
  264. package/lib/views/index.js +1 -1
  265. package/lib/views/issue-marker-view.js.map +1 -1
  266. package/lib/views/rounded-corner-view.js +2 -2
  267. package/lib/views/rounded-corner-view.js.map +1 -1
  268. package/lib/views/rounded-corner.d.ts +1 -1
  269. package/lib/views/rounded-corner.js +1 -1
  270. package/package.json +23 -24
  271. package/src/base/auto-complete/auto-complete-widget.ts +3 -3
  272. package/src/base/command-stack.ts +13 -11
  273. package/src/base/container-modules.ts +44 -11
  274. package/src/base/di.config.ts +8 -8
  275. package/src/base/editor-context-service.ts +4 -4
  276. package/src/base/selection-clearing-mouse-listener.ts +1 -1
  277. package/src/base/tool-manager/glsp-tool-manager.ts +15 -12
  278. package/src/features/bounds/di.config.ts +49 -0
  279. package/src/features/{layout/tests → bounds}/freeform-layout.spec.ts +2 -2
  280. package/src/features/{layout → bounds}/freeform-layout.ts +2 -2
  281. package/src/features/bounds/glsp-hidden-bounds-updater.ts +85 -0
  282. package/src/features/{layout/tests → bounds}/hbox-layout.spec.ts +2 -2
  283. package/src/features/{layout → bounds}/hbox-layout.ts +1 -1
  284. package/src/features/{layout/tests/layouter-test-util.ts → bounds/layouter-test-util.spec.ts} +6 -6
  285. package/src/features/{layout → bounds}/layouter.ts +1 -1
  286. package/src/features/{layout/tests → bounds}/vbox-layout.spec.ts +2 -2
  287. package/src/features/{layout → bounds}/vbox-layout.ts +1 -1
  288. package/src/features/command-palette/command-palette-tool.ts +3 -3
  289. package/src/features/command-palette/di.config.ts +6 -7
  290. package/src/features/context-menu/di.config.ts +4 -3
  291. package/src/features/copy-paste/copy-paste-handler.ts +9 -13
  292. package/src/features/decoration/di.config.ts +4 -4
  293. package/src/features/edit-label/di.config.ts +3 -2
  294. package/src/features/export/di.config.ts +29 -0
  295. package/src/features/export/glsp-svg-exporter.ts +8 -7
  296. package/src/features/hover/di.config.ts +8 -7
  297. package/src/features/hover/hover.ts +2 -1
  298. package/src/features/layout/di.config.ts +2 -11
  299. package/src/features/layout/layout-elements-action.ts +2 -1
  300. package/src/features/navigation/di.config.ts +4 -2
  301. package/src/features/navigation/navigation-action-handler.ts +2 -2
  302. package/src/features/save/di.config.ts +3 -2
  303. package/src/features/save/model.ts +1 -1
  304. package/src/features/select/di.config.ts +8 -7
  305. package/src/features/select/select-mouse-listener.ts +2 -2
  306. package/src/features/select/selection-service.spec.ts +4 -5
  307. package/src/features/source-model-watcher/di.config.ts +1 -1
  308. package/src/features/svg-metadata/di.config.ts +26 -0
  309. package/src/features/svg-metadata/metadata-placer.ts +51 -0
  310. package/src/features/tool-feedback/change-bounds-tool-feedback.ts +4 -4
  311. package/src/features/tool-feedback/creation-tool-feedback.ts +21 -15
  312. package/src/features/tool-feedback/di.config.ts +20 -18
  313. package/src/features/tool-feedback/edge-edit-tool-feedback.ts +2 -10
  314. package/src/features/tool-palette/di.config.ts +4 -4
  315. package/src/features/tool-palette/tool-palette.ts +4 -4
  316. package/src/features/tools/change-bounds-tool.ts +7 -7
  317. package/src/features/tools/di.config.ts +20 -21
  318. package/src/features/tools/glsp-manhattan-edge-router.ts +60 -0
  319. package/src/features/validation/di.config.ts +5 -5
  320. package/src/features/validation/issue-marker.ts +1 -1
  321. package/src/features/validation/validate.ts +16 -19
  322. package/src/features/viewport/di.config.ts +13 -11
  323. package/src/index.ts +37 -5
  324. package/src/lib/model.ts +35 -3
  325. package/src/sprotty-reexport.ts +24 -8
  326. package/src/utils/html-utils.ts +1 -1
  327. package/src/utils/smodel-util.ts +55 -11
  328. package/src/views/base-view-module.ts +4 -9
  329. package/src/views/glsp-edge-view.tsx +3 -3
  330. package/src/views/glsp-projection-view.tsx +1 -1
  331. package/src/views/index.ts +1 -2
  332. package/src/views/rounded-corner-view.tsx +2 -2
  333. package/src/views/rounded-corner.ts +2 -2
  334. package/lib/features/layout/tests/freeform-layout.spec.d.ts.map +0 -1
  335. package/lib/features/layout/tests/freeform-layout.spec.js.map +0 -1
  336. package/lib/features/layout/tests/hbox-layout.spec.d.ts.map +0 -1
  337. package/lib/features/layout/tests/hbox-layout.spec.js.map +0 -1
  338. package/lib/features/layout/tests/layouter-test-util.d.ts.map +0 -1
  339. package/lib/features/layout/tests/layouter-test-util.js.map +0 -1
  340. package/lib/features/layout/tests/vbox-layout.spec.d.ts.map +0 -1
  341. package/lib/features/layout/tests/vbox-layout.spec.js.map +0 -1
  342. /package/lib/features/{layout/tests → bounds}/freeform-layout.spec.d.ts +0 -0
  343. /package/lib/features/{layout/tests → bounds}/hbox-layout.spec.d.ts +0 -0
  344. /package/lib/features/{layout/tests → bounds}/vbox-layout.spec.d.ts +0 -0
@@ -0,0 +1,60 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2022-2023 EclipseSource and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0.
7
+ *
8
+ * This Source Code may also be made available under the following Secondary
9
+ * Licenses when the conditions for such availability set forth in the Eclipse
10
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ * with the GNU Classpath Exception which is available at
12
+ * https://www.gnu.org/software/classpath/license.html.
13
+ *
14
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
+ ********************************************************************************/
16
+
17
+ import { almostEquals } from '@eclipse-glsp/protocol';
18
+ import { ManhattanEdgeRouter, ResolvedHandleMove, SRoutableElement } from 'sprotty';
19
+
20
+ export class GLSPManhattanEdgeRouter extends ManhattanEdgeRouter {
21
+ protected override applyInnerHandleMoves(edge: SRoutableElement, moves: ResolvedHandleMove[]): void {
22
+ const route = this.route(edge);
23
+ const routingPoints = edge.routingPoints;
24
+ const minimalPointDistance = this.getOptions(edge).minimalPointDistance;
25
+ moves.forEach(move => {
26
+ const handle = move.handle;
27
+ const index = handle.pointIndex;
28
+ const correctedX = this.correctX(routingPoints, index, move.toPosition.x, minimalPointDistance);
29
+ const correctedY = this.correctY(routingPoints, index, move.toPosition.y, minimalPointDistance);
30
+ switch (handle.kind) {
31
+ case 'manhattan-50%':
32
+ if (index < 0) {
33
+ if (routingPoints.length === 0) {
34
+ routingPoints.push({ x: correctedX, y: correctedY });
35
+ move.handle.pointIndex = 0;
36
+ } else if (almostEquals(route[0].x, route[1].x)) {
37
+ this.alignX(routingPoints, 0, correctedX);
38
+ } else {
39
+ this.alignY(routingPoints, 0, correctedY);
40
+ }
41
+ } else if (index < routingPoints.length - 1) {
42
+ if (almostEquals(routingPoints[index].x, routingPoints[index + 1].x)) {
43
+ this.alignX(routingPoints, index, correctedX);
44
+ this.alignX(routingPoints, index + 1, correctedX);
45
+ } else {
46
+ this.alignY(routingPoints, index, correctedY);
47
+ this.alignY(routingPoints, index + 1, correctedY);
48
+ }
49
+ } else {
50
+ if (almostEquals(route[route.length - 2].x, route[route.length - 1].x)) {
51
+ this.alignX(routingPoints, routingPoints.length - 1, correctedX);
52
+ } else {
53
+ this.alignY(routingPoints, routingPoints.length - 1, correctedY);
54
+ }
55
+ }
56
+ break;
57
+ }
58
+ });
59
+ }
60
+ }
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2019-2022 EclipseSource and others.
2
+ * Copyright (c) 2019-2023 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,7 +13,7 @@
13
13
  *
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
- import { SetMarkersAction } from '@eclipse-glsp/protocol';
16
+ import { bindAsService, SetMarkersAction } from '@eclipse-glsp/protocol';
17
17
  import { ContainerModule } from 'inversify';
18
18
  import { configureActionHandler, configureCommand } from 'sprotty';
19
19
  import { TYPES } from '../../base/types';
@@ -47,7 +47,7 @@ export const markerNavigatorModule = new ContainerModule((bind, _unbind, isBound
47
47
  * in a standalone deployment of GLSP. If the GLSP diagram is in Theia use the Theia-native
48
48
  * `registerMarkerNavigationCommands()` in `glsp-theia-integration` instead.
49
49
  */
50
- export const markerNavigatorContextMenuModule = new ContainerModule((bind, _unbind, isBound) => {
51
- bind(TYPES.IContextMenuProvider).to(MarkerNavigatorContextMenuItemProvider).inSingletonScope();
52
- bind(TYPES.KeyListener).to(MarkerNavigatorKeyListener).inSingletonScope();
50
+ export const markerNavigatorContextMenuModule = new ContainerModule(bind => {
51
+ bindAsService(bind, TYPES.IContextMenuProvider, MarkerNavigatorContextMenuItemProvider);
52
+ bindAsService(bind, TYPES.KeyListener, MarkerNavigatorKeyListener);
53
53
  });
@@ -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
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2019-2022 EclipseSource and others.
2
+ * Copyright (c) 2019-2023 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
@@ -33,28 +33,25 @@ export class ValidationFeedbackEmitter implements IFeedbackEmitter {
33
33
 
34
34
  @inject(TYPES.IActionDispatcherProvider) protected actionDispatcher: () => Promise<IActionDispatcher>;
35
35
 
36
- private registeredAction: ApplyMarkersAction;
37
-
38
- // eslint-disable-next-line @typescript-eslint/no-empty-function
39
- private constructor() {}
36
+ protected registeredFeedbackByReason: Map<string, ApplyMarkersAction> = new Map();
40
37
 
41
38
  /**
42
39
  * Register the action that should be emitted for visualizing validation feedback.
43
40
  * @param action the action that should be emitted when the model is updated and that will visualize the model validation feedback.
41
+ * @param reason the reason for this validation feedback.
44
42
  */
45
- registerValidationFeedbackAction(action: ApplyMarkersAction): void {
46
- // De-register old action responsible for applying markers and re-applying them when the model is updated
47
- this.feedbackActionDispatcher.deregisterFeedback(this, []);
48
-
49
- // Clear existing markers
50
- if (this.registeredAction !== undefined) {
51
- const deleteMarkersAction = DeleteMarkersAction.create(this.registeredAction.markers);
43
+ registerValidationFeedbackAction(action: ApplyMarkersAction, reason = ''): void {
44
+ // De-register feedback and clear existing markers with the same reason
45
+ const previousFeedbackWithSameReason = this.registeredFeedbackByReason.get(reason);
46
+ if (previousFeedbackWithSameReason) {
47
+ this.feedbackActionDispatcher.deregisterFeedback(this, [previousFeedbackWithSameReason]);
48
+ const deleteMarkersAction = DeleteMarkersAction.create(previousFeedbackWithSameReason.markers);
52
49
  this.actionDispatcher().then(dispatcher => dispatcher.dispatch(deleteMarkersAction));
53
50
  }
54
51
 
55
52
  // Register new action responsible for applying markers and re-applying them when the model is updated
56
- this.feedbackActionDispatcher.registerFeedback(this, [action]);
57
- this.registeredAction = action;
53
+ this.registeredFeedbackByReason.set(reason, action);
54
+ this.feedbackActionDispatcher.registerFeedback(this, [...this.registeredFeedbackByReason.values()]);
58
55
  }
59
56
  }
60
57
 
@@ -80,7 +77,7 @@ export abstract class ExternalMarkerManager {
80
77
  }
81
78
  }
82
79
 
83
- abstract setMarkers(markers: Marker[], sourceUri?: string): void;
80
+ abstract setMarkers(markers: Marker[], reason?: string, sourceUri?: string): void;
84
81
  }
85
82
 
86
83
  @injectable()
@@ -97,14 +94,14 @@ export class SetMarkersActionHandler implements IActionHandler {
97
94
 
98
95
  handle(action: SetMarkersAction): void | Action | ICommand {
99
96
  const markers: Marker[] = action.markers;
100
- this.setMarkers(markers);
97
+ this.setMarkers(markers, action.reason);
101
98
  }
102
99
 
103
- async setMarkers(markers: Marker[]): Promise<void> {
100
+ async setMarkers(markers: Marker[], reason: string | undefined): Promise<void> {
104
101
  const uri = await this.editorContextService.getSourceUri();
105
- this.externalMarkerManager?.setMarkers(markers, uri);
102
+ this.externalMarkerManager?.setMarkers(markers, reason, uri);
106
103
  const applyMarkersAction = ApplyMarkersAction.create(markers);
107
- this.validationFeedbackEmitter.registerValidationFeedbackAction(applyMarkersAction);
104
+ this.validationFeedbackEmitter.registerValidationFeedbackAction(applyMarkersAction, reason);
108
105
  }
109
106
  }
110
107
 
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2021-2022 EclipseSource and others.
2
+ * Copyright (c) 2021-2023 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,6 +13,7 @@
13
13
  *
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
+ import { bindAsService } from '@eclipse-glsp/protocol';
16
17
  import { ContainerModule } from 'inversify';
17
18
  import {
18
19
  CenterCommand,
@@ -30,17 +31,18 @@ import {
30
31
  import { GLSPScrollMouseListener } from './glsp-scroll-mouse-listener';
31
32
 
32
33
  const glspViewportModule = new ContainerModule((bind, _unbind, isBound) => {
33
- configureCommand({ bind, isBound }, CenterCommand);
34
- configureCommand({ bind, isBound }, FitToScreenCommand);
35
- configureCommand({ bind, isBound }, GetViewportCommand);
36
- configureCommand({ bind, isBound }, SetViewportCommand);
37
- bind(TYPES.KeyListener).to(CenterKeyboardListener);
38
- bind(TYPES.MouseListener).to(ZoomMouseListener);
39
- bind(GLSPScrollMouseListener).toSelf().inSingletonScope();
40
- bind(TYPES.MouseListener).toService(GLSPScrollMouseListener);
34
+ const context = { bind, isBound };
35
+ configureCommand(context, CenterCommand);
36
+ configureCommand(context, FitToScreenCommand);
37
+ configureCommand(context, GetViewportCommand);
38
+ configureCommand(context, SetViewportCommand);
41
39
 
42
- configureActionHandler({ bind, isBound }, EnableToolsAction.KIND, GLSPScrollMouseListener);
43
- configureActionHandler({ bind, isBound }, EnableDefaultToolsAction.KIND, GLSPScrollMouseListener);
40
+ bindAsService(context, TYPES.KeyListener, CenterKeyboardListener);
41
+ bindAsService(context, TYPES.MouseListener, ZoomMouseListener);
42
+ bindAsService(context, TYPES.MouseListener, GLSPScrollMouseListener);
43
+
44
+ configureActionHandler(context, EnableToolsAction.KIND, GLSPScrollMouseListener);
45
+ configureActionHandler(context, EnableDefaultToolsAction.KIND, GLSPScrollMouseListener);
44
46
  });
45
47
 
46
48
  export default glspViewportModule;
package/src/index.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2019-2022 EclipseSource and others.
2
+ * Copyright (c) 2019-2023 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
@@ -18,21 +18,23 @@ import glspCommandPaletteModule from './features/command-palette/di.config';
18
18
  import glspContextMenuModule from './features/context-menu/di.config';
19
19
  import { copyPasteContextMenuModule, glspServerCopyPasteModule } from './features/copy-paste/di.config';
20
20
  import glspDecorationModule from './features/decoration/di.config';
21
+ import svgMetadataModule from './features/svg-metadata/di.config';
21
22
  import glspEditLabelModule from './features/edit-label/di.config';
22
23
  import modelHintsModule from './features/hints/di.config';
23
24
  import glspHoverModule from './features/hover/di.config';
24
25
  import layoutModule from './features/layout/di.config';
25
26
  import glspMouseToolModule from './features/mouse-tool/di.config';
26
- import { navigationModule } from './features/navigation/di.config';
27
+ import navigationModule from './features/navigation/di.config';
27
28
  import saveModule from './features/save/di.config';
28
29
  import glspSelectModule from './features/select/di.config';
29
30
  import sourceModelWatcherModule from './features/source-model-watcher/di.config';
30
31
  import toolFeedbackModule from './features/tool-feedback/di.config';
31
32
  import paletteModule from './features/tool-palette/di.config';
32
33
  import { enableDefaultToolsOnFocusLossModule, toolsModule } from './features/tools/di.config';
33
- import { markerNavigatorModule, validationModule } from './features/validation/di.config';
34
+ import { markerNavigatorContextMenuModule, markerNavigatorModule, validationModule } from './features/validation/di.config';
34
35
  import glspViewportModule from './features/viewport/di.config';
35
36
 
37
+ // ------------------ Base ------------------
36
38
  export * from './base/action-dispatcher';
37
39
  export * from './base/actions/focus-change-action';
38
40
  export * from './base/argumentable';
@@ -50,18 +52,32 @@ export * from './base/model/model-registry';
50
52
  export * from './base/model/update-model-command';
51
53
  export * from './base/selection-clearing-mouse-listener';
52
54
  export * from './base/source-uri-aware';
55
+ export * from './base/tool-manager/glsp-tool-manager';
53
56
  export * from './base/tool-manager/tool-actions';
54
57
  export * from './base/types';
55
58
  export * from './base/view/view-registry';
59
+ //
60
+ // ------------------ Features ------------------
61
+ export * from './features/bounds/freeform-layout';
62
+ export * from './features/bounds/glsp-hidden-bounds-updater';
63
+ export * from './features/bounds/hbox-layout';
64
+ export * from './features/bounds/layouter';
65
+ export * from './features/bounds/vbox-layout';
56
66
  export * from './features/change-bounds/model';
57
67
  export * from './features/change-bounds/movement-restrictor';
58
68
  export * from './features/change-bounds/snap';
69
+ export * from './features/command-palette/command-palette-tool';
59
70
  export * from './features/command-palette/server-command-palette-provider';
60
71
  export * from './features/context-menu/delete-element-context-menu';
72
+ export * from './features/context-menu/selection-service-aware-context-menu-mouse-listener';
73
+ export * from './features/context-menu/server-context-menu-provider';
74
+ export * from './features/copy-paste/copy-paste-context-menu';
61
75
  export * from './features/copy-paste/copy-paste-handler';
62
76
  export * from './features/decoration/decoration-placer';
77
+ export * from './features/svg-metadata/metadata-placer';
63
78
  export * from './features/edit-label/edit-label-tool';
64
79
  export * from './features/edit-label/edit-label-validator';
80
+ export * from './features/export/glsp-svg-exporter';
65
81
  export * from './features/hints/model';
66
82
  export * from './features/hints/type-hints';
67
83
  export * from './features/hover/hover';
@@ -73,33 +89,47 @@ export * from './features/rank/model';
73
89
  export * from './features/reconnect/model';
74
90
  export * from './features/save/model';
75
91
  export * from './features/save/save-keylistener';
92
+ export * from './features/select/select-feedback-action';
93
+ export * from './features/select/select-mouse-listener';
94
+ export * from './features/select/selection-service';
76
95
  export * from './features/source-model-watcher/source-model-changed-action-handler';
77
96
  export * from './features/tool-feedback/change-bounds-tool-feedback';
78
97
  export * from './features/tool-feedback/creation-tool-feedback';
79
98
  export * from './features/tool-feedback/css-feedback';
80
99
  export * from './features/tool-feedback/edge-edit-tool-feedback';
81
100
  export * from './features/tool-feedback/feedback-action-dispatcher';
101
+ export * from './features/tool-feedback/marquee-tool-feedback';
82
102
  export * from './features/tool-feedback/model';
103
+ export * from './features/tool-feedback/view';
83
104
  export * from './features/tool-palette/tool-palette';
84
105
  export * from './features/tools/base-glsp-tool';
85
106
  export * from './features/tools/change-bounds-tool';
86
107
  export * from './features/tools/delete-tool';
108
+ export { configureMarqueeTool } from './features/tools/di.config';
87
109
  export * from './features/tools/edge-creation-tool';
88
110
  export * from './features/tools/edge-edit-tool';
111
+ export * from './features/tools/enable-default-tools-on-focus-loss';
112
+ export * from './features/tools/glsp-manhattan-edge-router';
89
113
  export * from './features/tools/marquee-behavior';
114
+ export * from './features/tools/model';
90
115
  export * from './features/tools/node-creation-tool';
91
116
  export * from './features/validation/issue-marker';
92
117
  export * from './features/validation/marker-navigator';
93
118
  export * from './features/validation/validate';
94
119
  export * from './features/viewport/glsp-scroll-mouse-listener';
120
+ //
121
+ // ------------------ Misc ------------------
95
122
  export * from './lib/model';
96
123
  export * from './model-source/glsp-diagram-server';
97
124
  export * from './sprotty-reexport';
98
125
  export * from './utils/argument-utils';
126
+ export * from './utils/html-utils';
127
+ export * from './utils/layout-utils';
99
128
  export * from './utils/marker';
100
129
  export * from './utils/smodel-util';
101
130
  export * from './utils/viewpoint-util';
102
131
  export * from './views';
132
+ // ------------------ DI Modules ------------------
103
133
  export {
104
134
  validationModule,
105
135
  saveModule,
@@ -121,6 +151,8 @@ export {
121
151
  navigationModule,
122
152
  markerNavigatorModule,
123
153
  glspDecorationModule,
124
- sourceModelWatcherModule as modelSourceWatcherModule,
125
- glspViewportModule
154
+ sourceModelWatcherModule,
155
+ markerNavigatorContextMenuModule,
156
+ glspViewportModule,
157
+ svgMetadataModule
126
158
  };
package/src/lib/model.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2019-2022 EclipseSource and others.
2
+ * Copyright (c) 2019-2023 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,8 +13,8 @@
13
13
  *
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
- import { SModelElementSchema } from '@eclipse-glsp/protocol';
17
- import { exportFeature, SGraph, SModelElement, viewportFeature } from 'sprotty';
16
+ import { Bounds, isBounds, Point, SModelElementSchema } from '@eclipse-glsp/protocol';
17
+ import { exportFeature, getRouteBounds, SEdge, SGraph, SModelElement, viewportFeature } from 'sprotty';
18
18
  import { Containable, containerFeature } from '../features/hints/model';
19
19
  import { Saveable, saveFeature } from '../features/save/model';
20
20
 
@@ -25,3 +25,35 @@ export class GLSPGraph extends SGraph implements Saveable, Containable {
25
25
  return true;
26
26
  }
27
27
  }
28
+
29
+ export class GEdge extends SEdge {
30
+ override localToParent(point: Point | Bounds): Bounds {
31
+ const bounds = getRouteBounds(this.routingPoints);
32
+ const result = {
33
+ x: point.x + bounds.x,
34
+ y: point.y + bounds.y,
35
+ width: -1,
36
+ height: -1
37
+ };
38
+ if (isBounds(point)) {
39
+ result.width = point.width;
40
+ result.height = point.height;
41
+ }
42
+ return result;
43
+ }
44
+
45
+ override parentToLocal(point: Point | Bounds): Bounds {
46
+ const bounds = getRouteBounds(this.routingPoints);
47
+ const result = {
48
+ x: point.x - bounds.x,
49
+ y: point.y - bounds.y,
50
+ width: -1,
51
+ height: -1
52
+ };
53
+ if (isBounds(point)) {
54
+ result.width = point.width;
55
+ result.height = point.height;
56
+ }
57
+ return result;
58
+ }
59
+ }
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2022 STMicroelectronics and others.
2
+ * Copyright (c) 2022-2023 STMicroelectronics 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
@@ -22,7 +22,15 @@
22
22
 
23
23
  export * from '@eclipse-glsp/protocol';
24
24
  // sprotty-protocol
25
- export { CollapseExpandAction, CollapseExpandAllAction, ElementAndAlignment, SetBoundsAction } from 'sprotty-protocol/lib/actions';
25
+ export {
26
+ BringToFrontAction,
27
+ CollapseExpandAction,
28
+ CollapseExpandAllAction,
29
+ ElementAndAlignment,
30
+ HoverFeedbackAction,
31
+ MoveAction,
32
+ SetBoundsAction
33
+ } from 'sprotty-protocol/lib/actions';
26
34
  export { Viewport } from 'sprotty-protocol/lib/model';
27
35
  // ------------------ Base ------------------
28
36
  export * from 'sprotty/lib/base/actions/action-dispatcher';
@@ -144,7 +152,6 @@ export * from 'sprotty/lib/features/fade/model';
144
152
  export {
145
153
  AbstractHoverMouseListener,
146
154
  ClosePopupActionHandler,
147
- HoverFeedbackAction,
148
155
  HoverFeedbackCommand,
149
156
  HoverKeyListener,
150
157
  HoverMouseListener,
@@ -154,7 +161,16 @@ export {
154
161
  } from 'sprotty/lib/features/hover/hover';
155
162
  export * from 'sprotty/lib/features/hover/model';
156
163
  export * from 'sprotty/lib/features/move/model';
157
- export * from 'sprotty/lib/features/move/move';
164
+ export {
165
+ ElementMove,
166
+ LocationPostprocessor,
167
+ MorphEdgesAnimation,
168
+ MoveAnimation,
169
+ MoveCommand,
170
+ MoveMouseListener,
171
+ ResolvedElementMove,
172
+ ResolvedHandleMove
173
+ } from 'sprotty/lib/features/move/move';
158
174
  export * from 'sprotty/lib/features/move/snap';
159
175
  export * from 'sprotty/lib/features/nameable/model';
160
176
  export * from 'sprotty/lib/features/open/model';
@@ -176,13 +192,13 @@ export * from 'sprotty/lib/features/select/model';
176
192
  export {
177
193
  GetSelectionAction,
178
194
  GetSelectionCommand,
179
- SelectAllCommand,
180
- SelectCommand,
195
+ SelectAllCommand as SprottySelectAllCommand,
196
+ SelectCommand as SprottySelectCommand,
181
197
  SelectionResult,
182
198
  SelectKeyboardListener,
183
199
  SelectMouseListener
184
200
  } from 'sprotty/lib/features/select/select';
185
- export * from 'sprotty/lib/features/undo-redo/undo-redo';
201
+ export { UndoRedoKeyListener } from 'sprotty/lib/features/undo-redo/undo-redo';
186
202
  export * from 'sprotty/lib/features/update/model-matching';
187
203
  export { UpdateAnimationData, UpdateModelCommand } from 'sprotty/lib/features/update/update-model';
188
204
  export {
@@ -202,7 +218,7 @@ export {
202
218
  } from 'sprotty/lib/features/viewport/viewport';
203
219
  export * from 'sprotty/lib/features/viewport/viewport-root';
204
220
  export * from 'sprotty/lib/features/viewport/zoom';
205
- export * from 'sprotty/lib/features/zorder/zorder';
221
+ export { BringToFrontCommand, ZOrderElement } from 'sprotty/lib/features/zorder/zorder';
206
222
  export { SCompartment, SEdge, SGraph, SGraphIndex, SLabel, SNode, SPort } from 'sprotty/lib/graph/sgraph';
207
223
  // ------------------ Graph ------------------
208
224
  export * from 'sprotty/lib/graph/sgraph-factory';
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2019 EclipseSource and others.
2
+ * Copyright (c) 2019-2020 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
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2019-2022 EclipseSource and others.
2
+ * Copyright (c) 2019-2023 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,7 +13,15 @@
13
13
  *
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
- import { distinctAdd, ElementAndBounds, ElementAndRoutingPoints, remove, SModelElementSchema, TypeGuard } from '@eclipse-glsp/protocol';
16
+ import {
17
+ distinctAdd,
18
+ ElementAndBounds,
19
+ ElementAndRoutingPoints,
20
+ Point,
21
+ remove,
22
+ SModelElementSchema,
23
+ TypeGuard
24
+ } from '@eclipse-glsp/protocol';
17
25
  import {
18
26
  BoundsAware,
19
27
  EdgeRouterRegistry,
@@ -22,6 +30,7 @@ import {
22
30
  isSelectable,
23
31
  isSelected,
24
32
  ModelIndexImpl,
33
+ RoutedPoint,
25
34
  Selectable,
26
35
  SModelElement,
27
36
  SRoutableElement,
@@ -226,21 +235,57 @@ export function toElementAndRoutingPoints(element: SRoutableElement): ElementAnd
226
235
  };
227
236
  }
228
237
 
238
+ /** Pure routing point data kinds. */
239
+ export const ROUTING_POINT_KINDS = ['linear', 'bezier-junction'];
240
+
241
+ /** Pure route data kinds. */
242
+ export const ROUTE_KINDS = [...ROUTING_POINT_KINDS, 'source', 'target'];
243
+
229
244
  /**
230
245
  * Helper function to calculate the {@link ElementAndRoutingPoints} for a given {@link SRoutableElement}.
231
246
  * If client layout is activated, i.e., the edge routing registry is given and has a router for the element, then the routing
232
247
  * points from the calculated route are used, otherwise we use the already specified routing points of the {@link SRoutableElement}.
233
248
  * @param element The element to translate.
234
- * @param edgeRouterRegistry the edge router registry
249
+ * @param routerRegistry the edge router registry.
235
250
  * @returns The corresponding {@link ElementAndRoutingPoints} for the given element.
236
251
  */
237
- export function calcElementAndRoutingPoints(element: SRoutableElement, edgeRouterRegistry?: EdgeRouterRegistry): ElementAndRoutingPoints {
238
- const router = edgeRouterRegistry?.get(element.routerKind);
239
- // filter duplicate points (same x,y coordinates) and only keep actual routing points (no start or target, no volatile points)
240
- const clientRoutingPoints = router?.route(element)
241
- .filter((point, idx, route) => idx === route.findIndex(otherPoint => otherPoint.x === point.x && otherPoint.y === point.y))
242
- .filter(point => point.kind === 'linear' || point.kind === 'bezier-junction');
243
- return { elementId: element.id, newRoutingPoints: clientRoutingPoints || element.routingPoints };
252
+ export function calcElementAndRoutingPoints(element: SRoutableElement, routerRegistry?: EdgeRouterRegistry): ElementAndRoutingPoints {
253
+ const newRoutingPoints = routerRegistry ? calcRoute(element, routerRegistry, ROUTING_POINT_KINDS) : element.routingPoints;
254
+ return { elementId: element.id, newRoutingPoints };
255
+ }
256
+
257
+ /**
258
+ * Helper function to calculate the route for a given {@link SRoutableElement}.
259
+ * If client layout is activated, i.e., the edge routing registry is given and has a router for the element, then the points
260
+ * from the calculated route are used, otherwise we use the already specified routing points of the {@link SRoutableElement}.
261
+ * @param element The element to translate.
262
+ * @param routerRegistry the edge router registry.
263
+ * @returns The corresponding route for the given element.
264
+ */
265
+ export function calcElementAndRoute(element: SRoutableElement, routerRegistry?: EdgeRouterRegistry): ElementAndRoutingPoints {
266
+ let route: Point[] | undefined = routerRegistry ? calcRoute(element, routerRegistry, ROUTE_KINDS) : undefined;
267
+ if (!route) {
268
+ // add source and target to the routing points
269
+ route = [...element.routingPoints];
270
+ route.splice(0, 0, element.source?.position || Point.ORIGIN);
271
+ route.push(element.target?.position || Point.ORIGIN);
272
+ }
273
+ return { elementId: element.id, newRoutingPoints: route };
274
+ }
275
+
276
+ /**
277
+ * Helper function to calculate the route for a given {@link SRoutableElement}.
278
+ * @param element The element to translate.
279
+ * @param routerRegistry the edge router registry.
280
+ * @param pointKinds the routing point kinds that should be considered.
281
+ * @returns The corresponding route for the given element.
282
+ */
283
+ export function calcRoute(element: SRoutableElement, routerRegistry: EdgeRouterRegistry, pointKinds?: string[]): RoutedPoint[] | undefined {
284
+ return routerRegistry
285
+ ?.get(element.routerKind)
286
+ .route(element)
287
+ .filter((point, idx, fullRoute) => idx === fullRoute.findIndex(otherPoint => otherPoint.x === point.x && otherPoint.y === point.y))
288
+ .filter(point => !pointKinds || pointKinds.includes(point.kind));
244
289
  }
245
290
 
246
291
  /**
@@ -265,4 +310,3 @@ export function getElementTypeId(input: SModelElement | SModelElementSchema | st
265
310
  return (input as any)['type'] as string;
266
311
  }
267
312
  }
268
-
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2021 EclipseSource and others.
2
+ * Copyright (c) 2021-2023 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,8 +13,8 @@
13
13
  *
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
- import { DefaultTypes } from '@eclipse-glsp/protocol';
17
- import { ContainerModule, interfaces } from 'inversify';
16
+ import { BindingContext, DefaultTypes } from '@eclipse-glsp/protocol';
17
+ import { ContainerModule } from 'inversify';
18
18
  import {
19
19
  CircularNode,
20
20
  CircularNodeView,
@@ -53,17 +53,12 @@ import { GEdgeView } from './glsp-edge-view';
53
53
  import { GIssueMarkerView } from './issue-marker-view';
54
54
  import { RoundedCornerNodeView } from './rounded-corner-view';
55
55
 
56
- interface ContainerContext {
57
- bind: interfaces.Bind;
58
- isBound: interfaces.IsBound;
59
- }
60
-
61
56
  const baseViewModule = new ContainerModule((bind, unbind, isBound, rebind) => {
62
57
  const context = { bind, unbind, isBound, rebind };
63
58
  configureDefaultModelElements(context);
64
59
  });
65
60
 
66
- export function configureDefaultModelElements(context: ContainerContext): void {
61
+ export function configureDefaultModelElements(context: Pick<BindingContext, 'bind' | 'isBound'>): void {
67
62
  // HTML elements
68
63
  configureModelElement(context, DefaultTypes.HTML, HtmlRoot, HtmlRootView);
69
64
 
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2021-2022 EclipseSource and others.
2
+ * Copyright (c) 2021-2023 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
@@ -32,7 +32,7 @@ export class GEdgeView extends PolylineEdgeView {
32
32
  }
33
33
 
34
34
  return (
35
- <g class-sprotty-edge={true} class-mouseover={edge.hoverFeedback} {...this.addtionalClasses(edge, context)}>
35
+ <g class-sprotty-edge={true} class-mouseover={edge.hoverFeedback} {...this.additionalClasses(edge, context)}>
36
36
  {this.renderLine(edge, route, context)}
37
37
  {this.renderAdditionals(edge, route, context)}
38
38
  {context.renderChildren(edge, { route })}
@@ -40,7 +40,7 @@ export class GEdgeView extends PolylineEdgeView {
40
40
  );
41
41
  }
42
42
 
43
- protected addtionalClasses(_edge: Readonly<SEdge>, _context: RenderingContext): Classes {
43
+ protected additionalClasses(_edge: Readonly<SEdge>, _context: RenderingContext): Classes {
44
44
  return {};
45
45
  }
46
46
 
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2017-2018 TypeFox and others.
2
+ * Copyright (c) 2017-2022 TypeFox 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