@eclipse-glsp/client 0.10.0-next.6bee8eb.163 → 0.10.0-next.88e4725.166

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 (408) 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 +2 -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 +4 -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/di.config.d.ts +1 -1
  25. package/lib/base/di.config.d.ts.map +1 -1
  26. package/lib/base/di.config.js +9 -10
  27. package/lib/base/di.config.js.map +1 -1
  28. package/lib/base/editor-context-service.d.ts +1 -1
  29. package/lib/base/editor-context-service.d.ts.map +1 -1
  30. package/lib/base/editor-context-service.js +5 -5
  31. package/lib/base/editor-context-service.js.map +1 -1
  32. package/lib/base/focus-tracker.d.ts +1 -1
  33. package/lib/base/focus-tracker.d.ts.map +1 -1
  34. package/lib/base/focus-tracker.js +3 -3
  35. package/lib/base/focus-tracker.js.map +1 -1
  36. package/lib/base/model/update-model-command.d.ts.map +1 -1
  37. package/lib/base/model/update-model-command.js +9 -9
  38. package/lib/base/model/update-model-command.js.map +1 -1
  39. package/lib/base/model-initialization-constraint.d.ts +2 -3
  40. package/lib/base/model-initialization-constraint.d.ts.map +1 -1
  41. package/lib/base/model-initialization-constraint.js +3 -4
  42. package/lib/base/model-initialization-constraint.js.map +1 -1
  43. package/lib/base/tool-manager/glsp-tool-manager.d.ts.map +1 -1
  44. package/lib/base/tool-manager/glsp-tool-manager.js +3 -3
  45. package/lib/base/tool-manager/glsp-tool-manager.js.map +1 -1
  46. package/lib/base/tool-manager/tool-actions.d.ts +14 -0
  47. package/lib/base/tool-manager/tool-actions.d.ts.map +1 -0
  48. package/lib/base/tool-manager/tool-actions.js +25 -0
  49. package/lib/base/tool-manager/tool-actions.js.map +1 -0
  50. package/lib/base/types.d.ts +144 -20
  51. package/lib/base/types.d.ts.map +1 -1
  52. package/lib/base/types.js +14 -26
  53. package/lib/base/types.js.map +1 -1
  54. package/lib/features/change-bounds/movement-restrictor.d.ts +1 -1
  55. package/lib/features/change-bounds/movement-restrictor.js +2 -2
  56. package/lib/features/change-bounds/movement-restrictor.js.map +1 -1
  57. package/lib/features/change-bounds/snap.d.ts +42 -1
  58. package/lib/features/change-bounds/snap.d.ts.map +1 -1
  59. package/lib/features/change-bounds/snap.js +77 -1
  60. package/lib/features/change-bounds/snap.js.map +1 -1
  61. package/lib/features/change-bounds/snap.spec.d.ts +17 -0
  62. package/lib/features/change-bounds/snap.spec.d.ts.map +1 -0
  63. package/lib/features/change-bounds/snap.spec.js +82 -0
  64. package/lib/features/change-bounds/snap.spec.js.map +1 -0
  65. package/lib/features/command-palette/di.config.d.ts +2 -2
  66. package/lib/features/command-palette/di.config.d.ts.map +1 -1
  67. package/lib/features/command-palette/di.config.js +6 -6
  68. package/lib/features/command-palette/di.config.js.map +1 -1
  69. package/lib/features/command-palette/server-command-palette-provider.d.ts +1 -1
  70. package/lib/features/command-palette/server-command-palette-provider.d.ts.map +1 -1
  71. package/lib/features/command-palette/server-command-palette-provider.js +11 -8
  72. package/lib/features/command-palette/server-command-palette-provider.js.map +1 -1
  73. package/lib/features/context-menu/delete-element-context-menu.d.ts +17 -1
  74. package/lib/features/context-menu/delete-element-context-menu.d.ts.map +1 -1
  75. package/lib/features/context-menu/delete-element-context-menu.js +3 -3
  76. package/lib/features/context-menu/delete-element-context-menu.js.map +1 -1
  77. package/lib/features/context-menu/di.config.d.ts +1 -1
  78. package/lib/features/context-menu/di.config.d.ts.map +1 -1
  79. package/lib/features/context-menu/di.config.js +8 -7
  80. package/lib/features/context-menu/di.config.js.map +1 -1
  81. package/lib/features/context-menu/selection-service-aware-context-menu-mouse-listener.d.ts +17 -1
  82. package/lib/features/context-menu/selection-service-aware-context-menu-mouse-listener.d.ts.map +1 -1
  83. package/lib/features/context-menu/selection-service-aware-context-menu-mouse-listener.js +4 -19
  84. package/lib/features/context-menu/selection-service-aware-context-menu-mouse-listener.js.map +1 -1
  85. package/lib/features/context-menu/server-context-menu-provider.d.ts +1 -1
  86. package/lib/features/context-menu/server-context-menu-provider.d.ts.map +1 -1
  87. package/lib/features/context-menu/server-context-menu-provider.js +6 -5
  88. package/lib/features/context-menu/server-context-menu-provider.js.map +1 -1
  89. package/lib/features/copy-paste/copy-paste-context-menu.d.ts +12 -15
  90. package/lib/features/copy-paste/copy-paste-context-menu.d.ts.map +1 -1
  91. package/lib/features/copy-paste/copy-paste-context-menu.js +24 -31
  92. package/lib/features/copy-paste/copy-paste-context-menu.js.map +1 -1
  93. package/lib/features/copy-paste/copy-paste-handler.d.ts +1 -1
  94. package/lib/features/copy-paste/copy-paste-handler.d.ts.map +1 -1
  95. package/lib/features/copy-paste/copy-paste-handler.js +6 -7
  96. package/lib/features/copy-paste/copy-paste-handler.js.map +1 -1
  97. package/lib/features/copy-paste/di.config.d.ts +1 -1
  98. package/lib/features/copy-paste/di.config.d.ts.map +1 -1
  99. package/lib/features/copy-paste/di.config.js +5 -7
  100. package/lib/features/copy-paste/di.config.js.map +1 -1
  101. package/lib/features/decoration/decoration-placer.d.ts.map +1 -1
  102. package/lib/features/decoration/decoration-placer.js +17 -1
  103. package/lib/features/decoration/decoration-placer.js.map +1 -1
  104. package/lib/features/decoration/di.config.d.ts +2 -2
  105. package/lib/features/decoration/di.config.d.ts.map +1 -1
  106. package/lib/features/decoration/di.config.js +4 -4
  107. package/lib/features/decoration/di.config.js.map +1 -1
  108. package/lib/features/edit-label/di.config.d.ts +1 -1
  109. package/lib/features/edit-label/di.config.d.ts.map +1 -1
  110. package/lib/features/edit-label/di.config.js +4 -4
  111. package/lib/features/edit-label/di.config.js.map +1 -1
  112. package/lib/features/edit-label/edit-label-tool.d.ts.map +1 -1
  113. package/lib/features/edit-label/edit-label-tool.js +1 -1
  114. package/lib/features/edit-label/edit-label-tool.js.map +1 -1
  115. package/lib/features/edit-label/edit-label-validator.d.ts +4 -6
  116. package/lib/features/edit-label/edit-label-validator.d.ts.map +1 -1
  117. package/lib/features/edit-label/edit-label-validator.js +8 -10
  118. package/lib/features/edit-label/edit-label-validator.js.map +1 -1
  119. package/lib/features/hints/di.config.js +2 -2
  120. package/lib/features/hints/di.config.js.map +1 -1
  121. package/lib/features/hints/type-hints.d.ts +14 -4
  122. package/lib/features/hints/type-hints.d.ts.map +1 -1
  123. package/lib/features/hints/type-hints.js +21 -18
  124. package/lib/features/hints/type-hints.js.map +1 -1
  125. package/lib/features/hover/di.config.d.ts.map +1 -1
  126. package/lib/features/hover/di.config.js +2 -0
  127. package/lib/features/hover/di.config.js.map +1 -1
  128. package/lib/features/hover/hover.d.ts +4 -2
  129. package/lib/features/hover/hover.d.ts.map +1 -1
  130. package/lib/features/hover/hover.js +22 -4
  131. package/lib/features/hover/hover.js.map +1 -1
  132. package/lib/features/layout/di.config.d.ts +1 -1
  133. package/lib/features/layout/di.config.js +1 -1
  134. package/lib/features/layout/freeform-layout.d.ts +17 -1
  135. package/lib/features/layout/freeform-layout.d.ts.map +1 -1
  136. package/lib/features/layout/freeform-layout.js +2 -2
  137. package/lib/features/layout/freeform-layout.js.map +1 -1
  138. package/lib/features/layout/layout-commands.d.ts +64 -37
  139. package/lib/features/layout/layout-commands.d.ts.map +1 -1
  140. package/lib/features/layout/layout-commands.js +79 -59
  141. package/lib/features/layout/layout-commands.js.map +1 -1
  142. package/lib/features/layout/layout-commands.spec.d.ts.map +1 -1
  143. package/lib/features/layout/layout-commands.spec.js +29 -17
  144. package/lib/features/layout/layout-commands.spec.js.map +1 -1
  145. package/lib/features/layout/vbox-layout.d.ts +17 -1
  146. package/lib/features/layout/vbox-layout.d.ts.map +1 -1
  147. package/lib/features/layout/vbox-layout.js +4 -3
  148. package/lib/features/layout/vbox-layout.js.map +1 -1
  149. package/lib/features/model-source-watcher/model-source-changed-action-handler.d.ts +1 -1
  150. package/lib/features/model-source-watcher/model-source-changed-action-handler.d.ts.map +1 -1
  151. package/lib/features/model-source-watcher/model-source-changed-action-handler.js +7 -7
  152. package/lib/features/model-source-watcher/model-source-changed-action-handler.js.map +1 -1
  153. package/lib/features/mouse-tool/di.config.d.ts +1 -1
  154. package/lib/features/mouse-tool/di.config.d.ts.map +1 -1
  155. package/lib/features/mouse-tool/di.config.js +2 -2
  156. package/lib/features/mouse-tool/di.config.js.map +1 -1
  157. package/lib/features/mouse-tool/mouse-tool.d.ts.map +1 -1
  158. package/lib/features/mouse-tool/mouse-tool.js +4 -10
  159. package/lib/features/mouse-tool/mouse-tool.js.map +1 -1
  160. package/lib/features/navigation/navigation-action-handler.d.ts +31 -16
  161. package/lib/features/navigation/navigation-action-handler.d.ts.map +1 -1
  162. package/lib/features/navigation/navigation-action-handler.js +50 -66
  163. package/lib/features/navigation/navigation-action-handler.js.map +1 -1
  164. package/lib/features/navigation/navigation-target-resolver.d.ts +3 -3
  165. package/lib/features/navigation/navigation-target-resolver.d.ts.map +1 -1
  166. package/lib/features/navigation/navigation-target-resolver.js +7 -8
  167. package/lib/features/navigation/navigation-target-resolver.js.map +1 -1
  168. package/lib/features/navigation/navigation-target-resolver.spec.js +3 -3
  169. package/lib/features/navigation/navigation-target-resolver.spec.js.map +1 -1
  170. package/lib/features/save/di.config.d.ts +1 -1
  171. package/lib/features/save/di.config.d.ts.map +1 -1
  172. package/lib/features/save/di.config.js +3 -3
  173. package/lib/features/save/di.config.js.map +1 -1
  174. package/lib/features/save/save-keylistener.js +1 -1
  175. package/lib/features/save/save-keylistener.js.map +1 -1
  176. package/lib/features/select/di.config.d.ts +1 -1
  177. package/lib/features/select/di.config.d.ts.map +1 -1
  178. package/lib/features/select/di.config.js +4 -5
  179. package/lib/features/select/di.config.js.map +1 -1
  180. package/lib/features/select/select-feedback-action.d.ts +26 -22
  181. package/lib/features/select/select-feedback-action.d.ts.map +1 -1
  182. package/lib/features/select/select-feedback-action.js +18 -45
  183. package/lib/features/select/select-feedback-action.js.map +1 -1
  184. package/lib/features/select/select-mouse-listener.d.ts +1 -1
  185. package/lib/features/select/select-mouse-listener.d.ts.map +1 -1
  186. package/lib/features/select/select-mouse-listener.js +1 -1
  187. package/lib/features/select/select-mouse-listener.js.map +1 -1
  188. package/lib/features/select/selection-service.d.ts.map +1 -1
  189. package/lib/features/select/selection-service.js +16 -13
  190. package/lib/features/select/selection-service.js.map +1 -1
  191. package/lib/features/select/selection-service.spec.js +9 -6
  192. package/lib/features/select/selection-service.spec.js.map +1 -1
  193. package/lib/features/tool-feedback/change-bounds-tool-feedback.d.ts +16 -8
  194. package/lib/features/tool-feedback/change-bounds-tool-feedback.d.ts.map +1 -1
  195. package/lib/features/tool-feedback/change-bounds-tool-feedback.js +50 -20
  196. package/lib/features/tool-feedback/change-bounds-tool-feedback.js.map +1 -1
  197. package/lib/features/tool-feedback/creation-tool-feedback.d.ts +22 -10
  198. package/lib/features/tool-feedback/creation-tool-feedback.d.ts.map +1 -1
  199. package/lib/features/tool-feedback/creation-tool-feedback.js +46 -21
  200. package/lib/features/tool-feedback/creation-tool-feedback.js.map +1 -1
  201. package/lib/features/tool-feedback/css-feedback.d.ts +17 -10
  202. package/lib/features/tool-feedback/css-feedback.d.ts.map +1 -1
  203. package/lib/features/tool-feedback/css-feedback.js +41 -37
  204. package/lib/features/tool-feedback/css-feedback.js.map +1 -1
  205. package/lib/features/tool-feedback/di.config.d.ts +1 -1
  206. package/lib/features/tool-feedback/di.config.d.ts.map +1 -1
  207. package/lib/features/tool-feedback/di.config.js +4 -4
  208. package/lib/features/tool-feedback/di.config.js.map +1 -1
  209. package/lib/features/tool-feedback/edge-edit-tool-feedback.d.ts +43 -21
  210. package/lib/features/tool-feedback/edge-edit-tool-feedback.d.ts.map +1 -1
  211. package/lib/features/tool-feedback/edge-edit-tool-feedback.js +117 -91
  212. package/lib/features/tool-feedback/edge-edit-tool-feedback.js.map +1 -1
  213. package/lib/features/tool-feedback/feedback-action-dispatcher.d.ts.map +1 -1
  214. package/lib/features/tool-feedback/feedback-action-dispatcher.js +3 -3
  215. package/lib/features/tool-feedback/feedback-action-dispatcher.js.map +1 -1
  216. package/lib/features/tool-feedback/marquee-tool-feedback.d.ts +20 -9
  217. package/lib/features/tool-feedback/marquee-tool-feedback.d.ts.map +1 -1
  218. package/lib/features/tool-feedback/marquee-tool-feedback.js +41 -15
  219. package/lib/features/tool-feedback/marquee-tool-feedback.js.map +1 -1
  220. package/lib/features/tool-feedback/view.d.ts +1 -1
  221. package/lib/features/tool-feedback/view.d.ts.map +1 -1
  222. package/lib/features/tool-feedback/view.js +18 -1
  223. package/lib/features/tool-feedback/view.js.map +1 -1
  224. package/lib/features/tool-palette/di.config.d.ts +1 -1
  225. package/lib/features/tool-palette/di.config.d.ts.map +1 -1
  226. package/lib/features/tool-palette/di.config.js +3 -2
  227. package/lib/features/tool-palette/di.config.js.map +1 -1
  228. package/lib/features/tool-palette/tool-palette.d.ts +9 -6
  229. package/lib/features/tool-palette/tool-palette.d.ts.map +1 -1
  230. package/lib/features/tool-palette/tool-palette.js +25 -20
  231. package/lib/features/tool-palette/tool-palette.js.map +1 -1
  232. package/lib/features/tools/base-glsp-tool.d.ts.map +1 -1
  233. package/lib/features/tools/base-glsp-tool.js +3 -3
  234. package/lib/features/tools/base-glsp-tool.js.map +1 -1
  235. package/lib/features/tools/change-bounds-tool.d.ts +6 -8
  236. package/lib/features/tools/change-bounds-tool.d.ts.map +1 -1
  237. package/lib/features/tools/change-bounds-tool.js +22 -45
  238. package/lib/features/tools/change-bounds-tool.js.map +1 -1
  239. package/lib/features/tools/delete-tool.d.ts.map +1 -1
  240. package/lib/features/tools/delete-tool.js +5 -5
  241. package/lib/features/tools/delete-tool.js.map +1 -1
  242. package/lib/features/tools/di.config.js +9 -9
  243. package/lib/features/tools/di.config.js.map +1 -1
  244. package/lib/features/tools/edge-creation-tool.d.ts.map +1 -1
  245. package/lib/features/tools/edge-creation-tool.js +16 -9
  246. package/lib/features/tools/edge-creation-tool.js.map +1 -1
  247. package/lib/features/tools/edge-edit-tool.d.ts +2 -1
  248. package/lib/features/tools/edge-edit-tool.d.ts.map +1 -1
  249. package/lib/features/tools/edge-edit-tool.js +20 -15
  250. package/lib/features/tools/edge-edit-tool.js.map +1 -1
  251. package/lib/features/tools/marquee-behavior.d.ts +1 -1
  252. package/lib/features/tools/marquee-behavior.js +2 -2
  253. package/lib/features/tools/marquee-behavior.js.map +1 -1
  254. package/lib/features/tools/marquee-mouse-tool.d.ts.map +1 -1
  255. package/lib/features/tools/marquee-mouse-tool.js +7 -7
  256. package/lib/features/tools/marquee-mouse-tool.js.map +1 -1
  257. package/lib/features/tools/marquee-tool.js +1 -1
  258. package/lib/features/tools/marquee-tool.js.map +1 -1
  259. package/lib/features/tools/model.d.ts +2 -1
  260. package/lib/features/tools/model.d.ts.map +1 -1
  261. package/lib/features/tools/model.js +0 -15
  262. package/lib/features/tools/model.js.map +1 -1
  263. package/lib/features/tools/node-creation-tool.d.ts.map +1 -1
  264. package/lib/features/tools/node-creation-tool.js +5 -5
  265. package/lib/features/tools/node-creation-tool.js.map +1 -1
  266. package/lib/features/validation/di.config.d.ts +1 -1
  267. package/lib/features/validation/di.config.d.ts.map +1 -1
  268. package/lib/features/validation/di.config.js +3 -3
  269. package/lib/features/validation/di.config.js.map +1 -1
  270. package/lib/features/validation/marker-navigator.d.ts +15 -7
  271. package/lib/features/validation/marker-navigator.d.ts.map +1 -1
  272. package/lib/features/validation/marker-navigator.js +21 -19
  273. package/lib/features/validation/marker-navigator.js.map +1 -1
  274. package/lib/features/validation/marker-navigator.spec.d.ts.map +1 -1
  275. package/lib/features/validation/marker-navigator.spec.js +2 -16
  276. package/lib/features/validation/marker-navigator.spec.js.map +1 -1
  277. package/lib/features/validation/validate.d.ts +9 -11
  278. package/lib/features/validation/validate.d.ts.map +1 -1
  279. package/lib/features/validation/validate.js +27 -26
  280. package/lib/features/validation/validate.js.map +1 -1
  281. package/lib/features/viewport/di.config.d.ts +1 -1
  282. package/lib/features/viewport/di.config.d.ts.map +1 -1
  283. package/lib/features/viewport/di.config.js +1 -1
  284. package/lib/features/viewport/di.config.js.map +1 -1
  285. package/lib/features/viewport/glsp-scroll-mouse-listener.js +2 -2
  286. package/lib/features/viewport/glsp-scroll-mouse-listener.js.map +1 -1
  287. package/lib/index.d.ts +4 -5
  288. package/lib/index.d.ts.map +1 -1
  289. package/lib/index.js +4 -5
  290. package/lib/index.js.map +1 -1
  291. package/lib/lib/model.d.ts +2 -1
  292. package/lib/lib/model.d.ts.map +1 -1
  293. package/lib/lib/model.js +0 -15
  294. package/lib/lib/model.js.map +1 -1
  295. package/lib/model-source/glsp-diagram-server.d.ts +4 -4
  296. package/lib/model-source/glsp-diagram-server.d.ts.map +1 -1
  297. package/lib/model-source/glsp-diagram-server.js +5 -5
  298. package/lib/model-source/glsp-diagram-server.js.map +1 -1
  299. package/lib/sprotty-reexport.d.ts +174 -0
  300. package/lib/sprotty-reexport.d.ts.map +1 -0
  301. package/lib/sprotty-reexport.js +299 -0
  302. package/lib/sprotty-reexport.js.map +1 -0
  303. package/lib/utils/layout-utils.d.ts +3 -3
  304. package/lib/utils/layout-utils.d.ts.map +1 -1
  305. package/lib/utils/smodel-util.d.ts +27 -18
  306. package/lib/utils/smodel-util.d.ts.map +1 -1
  307. package/lib/utils/smodel-util.js +30 -11
  308. package/lib/utils/smodel-util.js.map +1 -1
  309. package/lib/utils/viewpoint-util.d.ts +3 -3
  310. package/lib/utils/viewpoint-util.d.ts.map +1 -1
  311. package/lib/utils/viewpoint-util.js +17 -1
  312. package/lib/utils/viewpoint-util.js.map +1 -1
  313. package/package.json +5 -4
  314. package/src/base/action-dispatcher.ts +13 -4
  315. package/src/base/actions/focus-change-action.ts +25 -8
  316. package/{lib/features/tool-palette/palette-item.d.ts → src/base/actions/sprotty-actions.ts} +11 -11
  317. package/src/base/auto-complete/auto-complete-actions.ts +7 -5
  318. package/src/base/auto-complete/auto-complete-widget.ts +8 -13
  319. package/src/base/command-stack.ts +4 -3
  320. package/src/base/di.config.ts +4 -5
  321. package/src/base/editor-context-service.ts +7 -7
  322. package/src/base/focus-tracker.ts +5 -4
  323. package/src/base/model/update-model-command.ts +7 -8
  324. package/src/base/model-initialization-constraint.ts +3 -4
  325. package/src/base/tool-manager/glsp-tool-manager.ts +4 -4
  326. package/src/base/tool-manager/tool-actions.ts +37 -0
  327. package/src/base/types.ts +31 -24
  328. package/src/features/change-bounds/movement-restrictor.ts +3 -3
  329. package/src/features/change-bounds/snap.spec.ts +89 -0
  330. package/src/features/change-bounds/snap.ts +86 -2
  331. package/src/features/command-palette/di.config.ts +5 -7
  332. package/src/features/command-palette/server-command-palette-provider.ts +9 -8
  333. package/src/features/context-menu/delete-element-context-menu.ts +6 -6
  334. package/src/features/context-menu/di.config.ts +3 -2
  335. package/src/features/context-menu/selection-service-aware-context-menu-mouse-listener.ts +5 -6
  336. package/src/features/context-menu/server-context-menu-provider.ts +7 -6
  337. package/src/features/copy-paste/copy-paste-context-menu.ts +30 -23
  338. package/src/features/copy-paste/copy-paste-handler.ts +6 -6
  339. package/src/features/copy-paste/di.config.ts +7 -15
  340. package/src/features/decoration/decoration-placer.ts +2 -2
  341. package/src/features/decoration/di.config.ts +3 -5
  342. package/src/features/edit-label/di.config.ts +4 -5
  343. package/src/features/edit-label/edit-label-tool.ts +1 -2
  344. package/src/features/edit-label/edit-label-validator.ts +6 -10
  345. package/src/features/hints/di.config.ts +3 -3
  346. package/src/features/hints/type-hints.ts +31 -16
  347. package/src/features/hover/di.config.ts +4 -0
  348. package/src/features/hover/hover.ts +29 -11
  349. package/src/features/layout/di.config.ts +1 -1
  350. package/src/features/layout/freeform-layout.ts +3 -12
  351. package/src/features/layout/layout-commands.spec.ts +38 -22
  352. package/src/features/layout/layout-commands.ts +129 -55
  353. package/src/features/layout/vbox-layout.ts +4 -8
  354. package/src/features/model-source-watcher/model-source-changed-action-handler.ts +7 -12
  355. package/src/features/mouse-tool/di.config.ts +3 -4
  356. package/src/features/mouse-tool/mouse-tool.ts +4 -9
  357. package/src/features/navigation/navigation-action-handler.ts +76 -42
  358. package/src/features/navigation/navigation-target-resolver.spec.ts +3 -3
  359. package/src/features/navigation/navigation-target-resolver.ts +8 -13
  360. package/src/features/save/di.config.ts +2 -3
  361. package/src/features/save/save-keylistener.ts +1 -1
  362. package/src/features/select/di.config.ts +6 -8
  363. package/src/features/select/select-feedback-action.ts +18 -46
  364. package/src/features/select/select-mouse-listener.ts +1 -2
  365. package/src/features/select/selection-service.spec.ts +11 -8
  366. package/src/features/select/selection-service.ts +14 -10
  367. package/src/features/tool-feedback/change-bounds-tool-feedback.ts +42 -13
  368. package/src/features/tool-feedback/creation-tool-feedback.ts +42 -21
  369. package/src/features/tool-feedback/css-feedback.ts +40 -37
  370. package/src/features/tool-feedback/di.config.ts +4 -5
  371. package/src/features/tool-feedback/edge-edit-tool-feedback.ts +122 -78
  372. package/src/features/tool-feedback/feedback-action-dispatcher.ts +2 -1
  373. package/src/features/tool-feedback/marquee-tool-feedback.ts +36 -11
  374. package/src/features/tool-feedback/view.tsx +3 -3
  375. package/src/features/tool-palette/di.config.ts +3 -2
  376. package/src/features/tool-palette/tool-palette.ts +30 -16
  377. package/src/features/tools/base-glsp-tool.ts +4 -4
  378. package/src/features/tools/change-bounds-tool.ts +31 -61
  379. package/src/features/tools/delete-tool.ts +6 -6
  380. package/src/features/tools/di.config.ts +10 -10
  381. package/src/features/tools/edge-creation-tool.ts +18 -9
  382. package/src/features/tools/edge-edit-tool.ts +20 -16
  383. package/src/features/tools/marquee-behavior.ts +2 -2
  384. package/src/features/tools/marquee-mouse-tool.ts +8 -9
  385. package/src/features/tools/marquee-tool.ts +1 -1
  386. package/src/features/tools/model.ts +2 -1
  387. package/src/features/tools/node-creation-tool.ts +5 -5
  388. package/src/features/validation/di.config.ts +4 -5
  389. package/src/features/validation/marker-navigator.spec.ts +4 -2
  390. package/src/features/validation/marker-navigator.ts +41 -21
  391. package/src/features/validation/validate.ts +27 -20
  392. package/src/features/viewport/di.config.ts +1 -2
  393. package/src/features/viewport/glsp-scroll-mouse-listener.ts +3 -3
  394. package/src/index.ts +4 -5
  395. package/src/lib/model.ts +2 -1
  396. package/src/model-source/glsp-diagram-server.ts +8 -10
  397. package/src/sprotty-reexport.ts +283 -0
  398. package/src/utils/layout-utils.ts +3 -3
  399. package/src/utils/smodel-util.ts +36 -20
  400. package/src/utils/viewpoint-util.ts +5 -14
  401. package/lib/features/tool-palette/palette-item.d.ts.map +0 -1
  402. package/lib/features/tool-palette/palette-item.js.map +0 -1
  403. package/lib/protocol-reexport.d.ts +0 -45
  404. package/lib/protocol-reexport.d.ts.map +0 -1
  405. package/lib/protocol-reexport.js +0 -80
  406. package/lib/protocol-reexport.js.map +0 -1
  407. package/src/features/tool-palette/palette-item.ts +0 -38
  408. package/src/protocol-reexport.ts +0 -64
@@ -0,0 +1,283 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2022 STMicroelectronics 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
+ * Sprotty still keeps the old class based action definitions as deprecated API.
18
+ * This causes name clashes with the GLSP protocol actions when reexport sprotty.
19
+ * The deprecated definitions are planned to be removed with Sprotty 1.0.0.
20
+ * Until then we have to manually reexport the sprotty main index and exclude the clashing types.
21
+ */
22
+
23
+ export * from '@eclipse-glsp/protocol';
24
+ // sprotty-protocol
25
+ export { CollapseExpandAction, CollapseExpandAllAction, ElementAndAlignment, SetBoundsAction } from 'sprotty-protocol/lib/actions';
26
+ export { Viewport } from 'sprotty-protocol/lib/model';
27
+ // ------------------ Base ------------------
28
+ export * from 'sprotty/lib/base/actions/action-dispatcher';
29
+ export * from 'sprotty/lib/base/actions/action-handler';
30
+ export * from 'sprotty/lib/base/actions/diagram-locker';
31
+ export * from 'sprotty/lib/base/animations/animation';
32
+ export * from 'sprotty/lib/base/animations/animation-frame-syncer';
33
+ export * from 'sprotty/lib/base/animations/easing';
34
+ export * from 'sprotty/lib/base/commands/command';
35
+ export * from 'sprotty/lib/base/commands/command-registration';
36
+ export * from 'sprotty/lib/base/commands/command-stack';
37
+ export * from 'sprotty/lib/base/commands/command-stack-options';
38
+ export * from 'sprotty/lib/base/features/initialize-canvas';
39
+ export { SetModelCommand } from 'sprotty/lib/base/features/set-model';
40
+ export {
41
+ createRandomId,
42
+ FeatureSet,
43
+ IModelIndex,
44
+ isParent,
45
+ ModelIndexImpl,
46
+ SChildElement,
47
+ SModelElement,
48
+ SModelRoot,
49
+ SParentElement
50
+ } from 'sprotty/lib/base/model/smodel';
51
+ export * from 'sprotty/lib/base/model/smodel-extension';
52
+ export * from 'sprotty/lib/base/model/smodel-factory';
53
+ export {
54
+ containsSome,
55
+ findParent,
56
+ findParentByFeature,
57
+ registerModelElement,
58
+ translateBounds,
59
+ translatePoint
60
+ } from 'sprotty/lib/base/model/smodel-utils';
61
+ export * from 'sprotty/lib/base/tool-manager/tool';
62
+ export * from 'sprotty/lib/base/tool-manager/tool-manager';
63
+ export * from 'sprotty/lib/base/ui-extensions/ui-extension';
64
+ export * from 'sprotty/lib/base/ui-extensions/ui-extension-registry';
65
+ export * from 'sprotty/lib/base/views/key-tool';
66
+ export * from 'sprotty/lib/base/views/mouse-tool';
67
+ export * from 'sprotty/lib/base/views/thunk-view';
68
+ export * from 'sprotty/lib/base/views/view';
69
+ export * from 'sprotty/lib/base/views/viewer';
70
+ export * from 'sprotty/lib/base/views/viewer-cache';
71
+ export * from 'sprotty/lib/base/views/viewer-options';
72
+ export * from 'sprotty/lib/base/views/vnode-postprocessor';
73
+ export * from 'sprotty/lib/base/views/vnode-utils';
74
+ // ------------------ Features ------------------
75
+ export {
76
+ RequestBoundsCommand,
77
+ ResolvedElementAndAlignment,
78
+ ResolvedElementAndBounds,
79
+ SetBoundsCommand
80
+ } from 'sprotty/lib/features/bounds/bounds-manipulation';
81
+ export * from 'sprotty/lib/features/bounds/hbox-layout';
82
+ export * from 'sprotty/lib/features/bounds/hidden-bounds-updater';
83
+ export * from 'sprotty/lib/features/bounds/layout';
84
+ export {
85
+ Alignable,
86
+ alignFeature,
87
+ BoundsAware,
88
+ boundsFeature,
89
+ findChildrenAtPosition,
90
+ getAbsoluteBounds,
91
+ getAbsoluteClientBounds,
92
+ isAlignable,
93
+ isBoundsAware,
94
+ isLayoutableChild,
95
+ isLayoutContainer,
96
+ isSizeable,
97
+ LayoutableChild,
98
+ layoutableChildFeature,
99
+ LayoutContainer,
100
+ layoutContainerFeature,
101
+ ModelLayoutOptions,
102
+ SShapeElement
103
+ } from 'sprotty/lib/features/bounds/model';
104
+ export * from 'sprotty/lib/features/bounds/stack-layout';
105
+ export * from 'sprotty/lib/features/bounds/vbox-layout';
106
+ export * from 'sprotty/lib/features/bounds/views';
107
+ export * from 'sprotty/lib/features/button/button-handler';
108
+ export * from 'sprotty/lib/features/button/model';
109
+ export * from 'sprotty/lib/features/command-palette/action-providers';
110
+ export * from 'sprotty/lib/features/command-palette/command-palette';
111
+ export { Anchor, IContextMenuService, IContextMenuServiceProvider } from 'sprotty/lib/features/context-menu/context-menu-service';
112
+ export * from 'sprotty/lib/features/context-menu/menu-providers';
113
+ export * from 'sprotty/lib/features/context-menu/mouse-listener';
114
+ export * from 'sprotty/lib/features/decoration/decoration-placer';
115
+ export * from 'sprotty/lib/features/decoration/model';
116
+ export * from 'sprotty/lib/features/decoration/views';
117
+ export * from 'sprotty/lib/features/edge-intersection/intersection-finder';
118
+ export * from 'sprotty/lib/features/edge-intersection/sweepline';
119
+ export * from 'sprotty/lib/features/edge-layout/di.config';
120
+ export * from 'sprotty/lib/features/edge-layout/edge-layout';
121
+ export * from 'sprotty/lib/features/edge-layout/model';
122
+ export * from 'sprotty/lib/features/edit/create';
123
+ export * from 'sprotty/lib/features/edit/create-on-drag';
124
+ export * from 'sprotty/lib/features/edit/delete';
125
+ export * from 'sprotty/lib/features/edit/di.config';
126
+ export * from 'sprotty/lib/features/edit/edit-label';
127
+ export * from 'sprotty/lib/features/edit/edit-label-ui';
128
+ export * from 'sprotty/lib/features/edit/edit-routing';
129
+ export * from 'sprotty/lib/features/edit/model';
130
+ export * from 'sprotty/lib/features/edit/reconnect';
131
+ export * from 'sprotty/lib/features/expand/expand';
132
+ export * from 'sprotty/lib/features/expand/model';
133
+ export * from 'sprotty/lib/features/expand/views';
134
+ export { ExportSvgCommand, ExportSvgKeyListener, ExportSvgPostprocessor, RequestExportSvgAction } from 'sprotty/lib/features/export/export';
135
+ export * from 'sprotty/lib/features/export/model';
136
+ export { SvgExporter } from 'sprotty/lib/features/export/svg-exporter';
137
+ export * from 'sprotty/lib/features/fade/fade';
138
+ export * from 'sprotty/lib/features/fade/model';
139
+ export {
140
+ AbstractHoverMouseListener,
141
+ ClosePopupActionHandler,
142
+ HoverFeedbackAction,
143
+ HoverFeedbackCommand,
144
+ HoverKeyListener,
145
+ HoverMouseListener,
146
+ HoverState,
147
+ PopupHoverMouseListener,
148
+ SetPopupModelCommand
149
+ } from 'sprotty/lib/features/hover/hover';
150
+ export * from 'sprotty/lib/features/hover/model';
151
+ export * from 'sprotty/lib/features/move/model';
152
+ export * from 'sprotty/lib/features/move/move';
153
+ export * from 'sprotty/lib/features/move/snap';
154
+ export * from 'sprotty/lib/features/nameable/model';
155
+ export * from 'sprotty/lib/features/open/model';
156
+ export * from 'sprotty/lib/features/open/open';
157
+ export * from 'sprotty/lib/features/projection/model';
158
+ export * from 'sprotty/lib/features/projection/views';
159
+ export * from 'sprotty/lib/features/routing/abstract-edge-router';
160
+ export * from 'sprotty/lib/features/routing/anchor';
161
+ export * from 'sprotty/lib/features/routing/bezier-anchors';
162
+ export * from 'sprotty/lib/features/routing/bezier-edge-router';
163
+ export * from 'sprotty/lib/features/routing/manhattan-anchors';
164
+ export * from 'sprotty/lib/features/routing/manhattan-edge-router';
165
+ export * from 'sprotty/lib/features/routing/model';
166
+ export * from 'sprotty/lib/features/routing/polyline-anchors';
167
+ export * from 'sprotty/lib/features/routing/polyline-edge-router';
168
+ export * from 'sprotty/lib/features/routing/routing';
169
+ export * from 'sprotty/lib/features/routing/views';
170
+ export * from 'sprotty/lib/features/select/model';
171
+ export {
172
+ GetSelectionAction,
173
+ GetSelectionCommand,
174
+ SelectAllCommand,
175
+ SelectCommand,
176
+ SelectionResult,
177
+ SelectKeyboardListener,
178
+ SelectMouseListener
179
+ } from 'sprotty/lib/features/select/select';
180
+ export * from 'sprotty/lib/features/undo-redo/undo-redo';
181
+ export * from 'sprotty/lib/features/update/model-matching';
182
+ export { UpdateAnimationData, UpdateModelCommand } from 'sprotty/lib/features/update/update-model';
183
+ export {
184
+ BoundsAwareViewportCommand,
185
+ CenterCommand,
186
+ CenterKeyboardListener,
187
+ FitToScreenCommand
188
+ } from 'sprotty/lib/features/viewport/center-fit';
189
+ export * from 'sprotty/lib/features/viewport/model';
190
+ export * from 'sprotty/lib/features/viewport/scroll';
191
+ export {
192
+ GetViewportAction,
193
+ GetViewportCommand,
194
+ SetViewportCommand,
195
+ ViewportAnimation,
196
+ ViewportResult
197
+ } from 'sprotty/lib/features/viewport/viewport';
198
+ export * from 'sprotty/lib/features/viewport/viewport-root';
199
+ export * from 'sprotty/lib/features/viewport/zoom';
200
+ export * from 'sprotty/lib/features/zorder/zorder';
201
+ export { SCompartment, SEdge, SGraph, SGraphIndex, SLabel, SNode, SPort } from 'sprotty/lib/graph/sgraph';
202
+ // ------------------ Graph ------------------
203
+ export * from 'sprotty/lib/graph/sgraph-factory';
204
+ export * from 'sprotty/lib/graph/views';
205
+ export * from 'sprotty/lib/lib/generic-views';
206
+ export * from 'sprotty/lib/lib/html-views';
207
+ export * from 'sprotty/lib/lib/jsx';
208
+ export {
209
+ CircularNode,
210
+ CircularPort,
211
+ DiamondNode,
212
+ ForeignObjectElement,
213
+ HtmlRoot,
214
+ PreRenderedElement,
215
+ RectangularNode,
216
+ RectangularPort,
217
+ ShapedPreRenderedElement
218
+ } from 'sprotty/lib/lib/model';
219
+ // ------------------ Library ------------------
220
+ export * from 'sprotty/lib/lib/modules';
221
+ export * from 'sprotty/lib/lib/svg-views';
222
+ // ------------------ Model Source ------------------
223
+ export * from 'sprotty/lib/model-source/commit-model';
224
+ export { DiagramServerProxy } from 'sprotty/lib/model-source/diagram-server';
225
+ export * from 'sprotty/lib/model-source/local-model-source';
226
+ export * from 'sprotty/lib/model-source/logging';
227
+ export * from 'sprotty/lib/model-source/model-source';
228
+ export * from 'sprotty/lib/model-source/websocket';
229
+ // ------------------ Utilities ------------------
230
+ export * from 'sprotty/lib/utils/browser';
231
+ export * from 'sprotty/lib/utils/codicon';
232
+ export * from 'sprotty/lib/utils/color';
233
+ export { Diamond, Insets, intersection, Line, Orientation, PointToPointLine } from 'sprotty/lib/utils/geometry';
234
+ export * from 'sprotty/lib/utils/inversify';
235
+ export * from 'sprotty/lib/utils/logging';
236
+ export * from 'sprotty/lib/utils/registry';
237
+ export { defaultModule };
238
+ export {
239
+ graphModule,
240
+ boundsModule,
241
+ buttonModule,
242
+ commandPaletteModule,
243
+ contextMenuModule,
244
+ decorationModule,
245
+ edgeIntersectionModule,
246
+ edgeLayoutModule,
247
+ expandModule,
248
+ exportModule,
249
+ fadeModule,
250
+ hoverModule,
251
+ moveModule,
252
+ openModule,
253
+ routingModule,
254
+ selectModule,
255
+ undoRedoModule,
256
+ updateModule,
257
+ viewportModule,
258
+ zorderModule
259
+ };
260
+ export { modelSourceModule };
261
+
262
+ import defaultModule from 'sprotty/lib/base/di.config';
263
+ import boundsModule from 'sprotty/lib/features/bounds/di.config';
264
+ import buttonModule from 'sprotty/lib/features/button/di.config';
265
+ import commandPaletteModule from 'sprotty/lib/features/command-palette/di.config';
266
+ import contextMenuModule from 'sprotty/lib/features/context-menu/di.config';
267
+ import decorationModule from 'sprotty/lib/features/decoration/di.config';
268
+ import edgeIntersectionModule from 'sprotty/lib/features/edge-intersection/di.config';
269
+ import edgeLayoutModule from 'sprotty/lib/features/edge-layout/di.config';
270
+ import expandModule from 'sprotty/lib/features/expand/di.config';
271
+ import exportModule from 'sprotty/lib/features/export/di.config';
272
+ import fadeModule from 'sprotty/lib/features/fade/di.config';
273
+ import hoverModule from 'sprotty/lib/features/hover/di.config';
274
+ import moveModule from 'sprotty/lib/features/move/di.config';
275
+ import openModule from 'sprotty/lib/features/open/di.config';
276
+ import routingModule from 'sprotty/lib/features/routing/di.config';
277
+ import selectModule from 'sprotty/lib/features/select/di.config';
278
+ import undoRedoModule from 'sprotty/lib/features/undo-redo/di.config';
279
+ import updateModule from 'sprotty/lib/features/update/di.config';
280
+ import viewportModule from 'sprotty/lib/features/viewport/di.config';
281
+ import zorderModule from 'sprotty/lib/features/zorder/di.config';
282
+ import graphModule from 'sprotty/lib/graph/di.config';
283
+ import modelSourceModule from 'sprotty/lib/model-source/di.config';
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2020-2021 EclipseSource and others.
2
+ * Copyright (c) 2020-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,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 { Point } from '@eclipse-glsp/protocol';
17
- import { BoundsAware, Dimension, ElementAndBounds, ElementMove, ModelLayoutOptions, SModelElement } from 'sprotty';
16
+ import { Dimension, ElementAndBounds, Point } from '@eclipse-glsp/protocol';
17
+ import { BoundsAware, ElementMove, ModelLayoutOptions, SModelElement } from 'sprotty';
18
18
  import { IMovementRestrictor } from '../features/change-bounds/movement-restrictor';
19
19
 
20
20
  export function minWidth(element: SModelElement & BoundsAware): number {
@@ -13,18 +13,16 @@
13
13
  *
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
- import { distinctAdd, ElementAndRoutingPoints, remove } from '@eclipse-glsp/protocol';
16
+ import { distinctAdd, ElementAndBounds, ElementAndRoutingPoints, remove, SModelElementSchema, TypeGuard } from '@eclipse-glsp/protocol';
17
17
  import {
18
18
  BoundsAware,
19
- ElementAndBounds,
20
19
  isBoundsAware,
21
20
  isMoveable,
22
21
  isSelectable,
23
22
  isSelected,
23
+ ModelIndexImpl,
24
24
  Selectable,
25
25
  SModelElement,
26
- SModelElementSchema,
27
- SModelIndex,
28
26
  SRoutableElement,
29
27
  SRoutingHandle
30
28
  } from 'sprotty';
@@ -32,31 +30,31 @@ import { FluentIterable } from 'sprotty/lib/utils/iterable';
32
30
 
33
31
  /**
34
32
  * Helper type to represent a filter predicate for {@link SModelElement}s. This is used to retrieve
35
- * elements from the {@link SModelIndex} that also conform to a second type `T`. Its mainly used for
33
+ * elements from the {@link ModelIndexImpl} that also conform to a second type `T`. Its mainly used for
36
34
  * retrieving elements that also implement a certain model features (e.g. selectable)
37
35
  */
38
36
  export type ModelFilterPredicate<T> = (modelElement: SModelElement) => modelElement is SModelElement & T;
39
37
 
40
38
  /**
41
- * Retrieves all elements from the given {@link SModelIndex} that match the given {@link ModelFilterPredicate}
42
- * @param index The {@link SModelIndex}.
39
+ * Retrieves all elements from the given {@link ModelIndexImpl} that match the given {@link ModelFilterPredicate}
40
+ * @param index The {@link ModelIndexImpl}.
43
41
  * @param predicate The {@link ModelFilterPredicate} that should be used.
44
42
  * @returns A {@link FluentIterable} of all indexed element that match the predicate
45
43
  * (correctly casted to also include the additional type of the predicate).
46
44
  */
47
- export function filter<T>(index: SModelIndex<SModelElement>, predicate: ModelFilterPredicate<T>): FluentIterable<SModelElement & T> {
45
+ export function filter<T>(index: ModelIndexImpl, predicate: ModelFilterPredicate<T>): FluentIterable<SModelElement & T> {
48
46
  return index.all().filter(predicate) as FluentIterable<SModelElement & T>;
49
47
  }
50
48
 
51
49
  /**
52
- * Retrieves all elements from the given {@link SModelIndex} that match the given {@link ModelFilterPredicate} and executes
50
+ * Retrieves all elements from the given {@link ModelIndexImpl} that match the given {@link ModelFilterPredicate} and executes
53
51
  * the given runnable for each element of the result set.
54
- * @param index The {@link SModelIndex}.
52
+ * @param index The {@link ModelIndexImpl}.
55
53
  * @param predicate The {@link ModelFilterPredicate} that should be used.
56
54
  * @param runnable The runnable that should be executed for each matching element.
57
55
  */
58
56
  export function forEachElement<T>(
59
- index: SModelIndex<SModelElement>,
57
+ index: ModelIndexImpl,
60
58
  predicate: ModelFilterPredicate<T>,
61
59
  runnable: (modelElement: SModelElement & T) => void
62
60
  ): void {
@@ -64,33 +62,51 @@ export function forEachElement<T>(
64
62
  }
65
63
 
66
64
  /**
67
- * Retrieves an array of all elements that match the given {@link ModelFilterPredicate} from the given {@link SModelIndex}.
68
- * @param index The {@link SModelIndex}.
65
+ * Retrieves an array of all elements that match the given {@link ModelFilterPredicate} from the given {@link ModelIndexImpl}.
66
+ * @param index The {@link ModelIndexImpl}.
69
67
  * @param predicate The {@link ModelFilterPredicate} that should be used.
70
68
  * @returns An array of all indexed element that match the predicate
71
69
  * (correctly casted to also include the additional type of the predicate).
72
70
  */
73
- export function getMatchingElements<T>(index: SModelIndex<SModelElement>, predicate: ModelFilterPredicate<T>): (SModelElement & T)[] {
71
+ export function getMatchingElements<T>(index: ModelIndexImpl, predicate: ModelFilterPredicate<T>): (SModelElement & T)[] {
74
72
  return Array.from(filter(index, predicate));
75
73
  }
76
74
 
77
75
  /**
78
- * Retrieves the amount of currently selected elements in the given {@link SModelIndex}.
79
- * @param index The {@link SModelIndex}.
76
+ * Invokes the given model index to retrieve the corresponding model elements for the given set of ids. Ids that
77
+ * have no corresponding element in the index will be ignored.
78
+ * @param index THe model index.
79
+ * @param elementsIDs The element ids.
80
+ * @param guard Optional typeguard. If defined only elements that match the guard will be returned.
81
+ * @returns An array of the model elements that correspond to the given ids and filter predicate.
82
+ */
83
+ export function getElements<S extends SModelElement>(index: ModelIndexImpl, elementsIDs: string[], guard?: TypeGuard<S>): S[] {
84
+ // Internal filter function that filters out undefined model elements and runs an optional typeguard check.
85
+ const filterFn = (element?: SModelElement): element is S => {
86
+ if (element !== undefined) {
87
+ return guard ? guard(element) : true;
88
+ }
89
+ return false;
90
+ };
91
+ return elementsIDs.map(id => index.getById(id)).filter(filterFn);
92
+ }
93
+ /**
94
+ * Retrieves the amount of currently selected elements in the given {@link ModelIndexImpl}.
95
+ * @param index The {@link ModelIndexImpl}.
80
96
  * @returns The amount of selected elements.
81
97
  */
82
- export function getSelectedElementCount(index: SModelIndex<SModelElement>): number {
98
+ export function getSelectedElementCount(index: ModelIndexImpl): number {
83
99
  let selected = 0;
84
100
  forEachElement(index, isSelected, element => selected++);
85
101
  return selected;
86
102
  }
87
103
 
88
104
  /**
89
- * Helper function to check wether an any element is selected in the given {@link SModelIndex}.
90
- * @param index The {@link SModelIndex}.
105
+ * Helper function to check wether an any element is selected in the given {@link ModelIndexImpl}.
106
+ * @param index The {@link ModelIndexImpl}.
91
107
  * @returns `true` if at least one element is selected, `false` otherwise.
92
108
  */
93
- export function hasSelectedElements(index: SModelIndex<SModelElement>): boolean {
109
+ export function hasSelectedElements(index: ModelIndexImpl): boolean {
94
110
  return getSelectedElementCount(index) > 0;
95
111
  }
96
112
 
@@ -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;
@@ -1 +0,0 @@
1
- {"version":3,"file":"palette-item.d.ts","sourceRoot":"","sources":["../../../src/features/tool-palette/palette-item.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAuD,aAAa,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AAE1I,MAAM,WAAW,WAAY,SAAQ,aAAa;IAC9C,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,QAAQ,CAAC,EAAE,WAAW,EAAE,CAAC;CACrC;AAED,wBAAgB,aAAa,CAAC,MAAM,CAAC,EAAE,GAAG,GAAG,MAAM,IAAI,WAAW,CAEjE;AAED,yBAAiB,WAAW,CAAC;IACzB,SAAgB,gBAAgB,CAAC,IAAI,CAAC,EAAE,WAAW,GAAG,4BAA4B,GAAG,SAAS,CAQ7F;CACJ"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"palette-item.js","sourceRoot":"","sources":["../../../src/features/tool-palette/palette-item.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,qDAA0I;AAQ1I,SAAgB,aAAa,CAAC,MAAY;IACtC,OAAO,IAAA,0BAAe,EAAC,MAAM,CAAC,IAAI,IAAI,IAAI,MAAM,IAAI,YAAY,IAAI,MAAM,CAAC;AAC/E,CAAC;AAFD,sCAEC;AAED,IAAiB,WAAW,CAU3B;AAVD,WAAiB,WAAW;IACxB,SAAgB,gBAAgB,CAAC,IAAkB;QAC/C,IAAI,IAAI,EAAE;YACN,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO;iBAC3B,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,IAAA,6CAAkC,EAAC,CAAC,CAAC,CAAC;iBAClD,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,MAAsC,CAAC,CAAC;YAC3D,OAAO,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;SAC9D;QACD,OAAO,SAAS,CAAC;IACrB,CAAC;IARe,4BAAgB,mBAQ/B,CAAA;AACL,CAAC,EAVgB,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAU3B"}
@@ -1,45 +0,0 @@
1
- /********************************************************************************
2
- * Copyright (c) 2021 STMicroelectronics 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
- * Workaround for now to solve ambiguous exports in glsp-client. This module provides all glsp-only components.
18
- * i.e. typings that are not defined in sprotty
19
- */
20
- export { CompoundOperation, isActionKind, isCompoundOperation, isRejectAction, Operation } from '@eclipse-glsp/protocol/lib/action-protocol/base-protocol';
21
- export * from '@eclipse-glsp/protocol/lib/action-protocol/client-notification';
22
- export * from '@eclipse-glsp/protocol/lib/action-protocol/clipboard';
23
- export * from '@eclipse-glsp/protocol/lib/action-protocol/contexts';
24
- export * from '@eclipse-glsp/protocol/lib/action-protocol/edge-modification';
25
- export * from '@eclipse-glsp/protocol/lib/action-protocol/element-creation';
26
- export { isRequestPopupModelAction, isSetPopupModelAction } from '@eclipse-glsp/protocol/lib/action-protocol/element-hover';
27
- export * from '@eclipse-glsp/protocol/lib/action-protocol/element-navigation';
28
- export { isSelectAction, isSelectAllAction } from '@eclipse-glsp/protocol/lib/action-protocol/element-selection';
29
- export * from '@eclipse-glsp/protocol/lib/action-protocol/element-text-editing';
30
- export * from '@eclipse-glsp/protocol/lib/action-protocol/element-type-hints';
31
- export * from '@eclipse-glsp/protocol/lib/action-protocol/element-validation';
32
- export { LayoutOperation } from '@eclipse-glsp/protocol/lib/action-protocol/mode-layout';
33
- export { isModelSourceChangedAction, isRequestModelAction, isSetModelAction, ModelSourceChangedAction } from '@eclipse-glsp/protocol/lib/action-protocol/model-data';
34
- export * from '@eclipse-glsp/protocol/lib/action-protocol/model-edit-mode';
35
- export { DirtyStateChangeReason, isExportSvgAction, isSaveModelAction, isSetDirtyStateAction, SaveModelAction, SetDirtyStateAction } from '@eclipse-glsp/protocol/lib/action-protocol/model-saving';
36
- export * from '@eclipse-glsp/protocol/lib/action-protocol/node-modification';
37
- export * from '@eclipse-glsp/protocol/lib/action-protocol/tool-palette';
38
- export { Args, EditorContext, ElementAndRoutingPoints } from '@eclipse-glsp/protocol/lib/action-protocol/types';
39
- export * from '@eclipse-glsp/protocol/lib/action-protocol/undo-redo';
40
- export * from '@eclipse-glsp/protocol/lib/glsp-client';
41
- export * from '@eclipse-glsp/protocol/lib/jsonrpc/base-jsonrpc-glsp-client';
42
- export * from '@eclipse-glsp/protocol/lib/jsonrpc/glsp-jsonrpc-client';
43
- export * from '@eclipse-glsp/protocol/lib/utils/array-util';
44
- export * from '@eclipse-glsp/protocol/lib/utils/launch-util';
45
- //# sourceMappingURL=protocol-reexport.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"protocol-reexport.d.ts","sourceRoot":"","sources":["../src/protocol-reexport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF;;;GAGG;AAEH,OAAO,EACH,iBAAiB,EACjB,YAAY,EACZ,mBAAmB,EACnB,cAAc,EACd,SAAS,EACZ,MAAM,0DAA0D,CAAC;AAClE,cAAc,gEAAgE,CAAC;AAC/E,cAAc,sDAAsD,CAAC;AACrE,cAAc,qDAAqD,CAAC;AACpE,cAAc,8DAA8D,CAAC;AAC7E,cAAc,6DAA6D,CAAC;AAC5E,OAAO,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,MAAM,0DAA0D,CAAC;AAC5H,cAAc,+DAA+D,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,8DAA8D,CAAC;AACjH,cAAc,iEAAiE,CAAC;AAChF,cAAc,+DAA+D,CAAC;AAC9E,cAAc,+DAA+D,CAAC;AAC9E,OAAO,EAAE,eAAe,EAAE,MAAM,wDAAwD,CAAC;AACzF,OAAO,EACH,0BAA0B,EAC1B,oBAAoB,EACpB,gBAAgB,EAChB,wBAAwB,EAC3B,MAAM,uDAAuD,CAAC;AAC/D,cAAc,4DAA4D,CAAC;AAC3E,OAAO,EACH,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,eAAe,EACf,mBAAmB,EACtB,MAAM,yDAAyD,CAAC;AACjE,cAAc,8DAA8D,CAAC;AAC7E,cAAc,yDAAyD,CAAC;AACxE,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,uBAAuB,EAAE,MAAM,kDAAkD,CAAC;AAChH,cAAc,sDAAsD,CAAC;AACrE,cAAc,wCAAwC,CAAC;AACvD,cAAc,6DAA6D,CAAC;AAC5E,cAAc,wDAAwD,CAAC;AACvE,cAAc,6CAA6C,CAAC;AAC5D,cAAc,8CAA8C,CAAC"}
@@ -1,80 +0,0 @@
1
- "use strict";
2
- /********************************************************************************
3
- * Copyright (c) 2021 STMicroelectronics and others.
4
- *
5
- * This program and the accompanying materials are made available under the
6
- * terms of the Eclipse Public License v. 2.0 which is available at
7
- * http://www.eclipse.org/legal/epl-2.0.
8
- *
9
- * This Source Code may also be made available under the following Secondary
10
- * Licenses when the conditions for such availability set forth in the Eclipse
11
- * Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- * with the GNU Classpath Exception which is available at
13
- * https://www.gnu.org/software/classpath/license.html.
14
- *
15
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16
- ********************************************************************************/
17
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18
- if (k2 === undefined) k2 = k;
19
- var desc = Object.getOwnPropertyDescriptor(m, k);
20
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
21
- desc = { enumerable: true, get: function() { return m[k]; } };
22
- }
23
- Object.defineProperty(o, k2, desc);
24
- }) : (function(o, m, k, k2) {
25
- if (k2 === undefined) k2 = k;
26
- o[k2] = m[k];
27
- }));
28
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
29
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
30
- };
31
- Object.defineProperty(exports, "__esModule", { value: true });
32
- exports.SetDirtyStateAction = exports.SaveModelAction = exports.isSetDirtyStateAction = exports.isSaveModelAction = exports.isExportSvgAction = exports.DirtyStateChangeReason = exports.ModelSourceChangedAction = exports.isSetModelAction = exports.isRequestModelAction = exports.isModelSourceChangedAction = exports.LayoutOperation = exports.isSelectAllAction = exports.isSelectAction = exports.isSetPopupModelAction = exports.isRequestPopupModelAction = exports.isRejectAction = exports.isCompoundOperation = exports.isActionKind = exports.CompoundOperation = void 0;
33
- /**
34
- * Workaround for now to solve ambiguous exports in glsp-client. This module provides all glsp-only components.
35
- * i.e. typings that are not defined in sprotty
36
- */
37
- var base_protocol_1 = require("@eclipse-glsp/protocol/lib/action-protocol/base-protocol");
38
- Object.defineProperty(exports, "CompoundOperation", { enumerable: true, get: function () { return base_protocol_1.CompoundOperation; } });
39
- Object.defineProperty(exports, "isActionKind", { enumerable: true, get: function () { return base_protocol_1.isActionKind; } });
40
- Object.defineProperty(exports, "isCompoundOperation", { enumerable: true, get: function () { return base_protocol_1.isCompoundOperation; } });
41
- Object.defineProperty(exports, "isRejectAction", { enumerable: true, get: function () { return base_protocol_1.isRejectAction; } });
42
- __exportStar(require("@eclipse-glsp/protocol/lib/action-protocol/client-notification"), exports);
43
- __exportStar(require("@eclipse-glsp/protocol/lib/action-protocol/clipboard"), exports);
44
- __exportStar(require("@eclipse-glsp/protocol/lib/action-protocol/contexts"), exports);
45
- __exportStar(require("@eclipse-glsp/protocol/lib/action-protocol/edge-modification"), exports);
46
- __exportStar(require("@eclipse-glsp/protocol/lib/action-protocol/element-creation"), exports);
47
- var element_hover_1 = require("@eclipse-glsp/protocol/lib/action-protocol/element-hover");
48
- Object.defineProperty(exports, "isRequestPopupModelAction", { enumerable: true, get: function () { return element_hover_1.isRequestPopupModelAction; } });
49
- Object.defineProperty(exports, "isSetPopupModelAction", { enumerable: true, get: function () { return element_hover_1.isSetPopupModelAction; } });
50
- __exportStar(require("@eclipse-glsp/protocol/lib/action-protocol/element-navigation"), exports);
51
- var element_selection_1 = require("@eclipse-glsp/protocol/lib/action-protocol/element-selection");
52
- Object.defineProperty(exports, "isSelectAction", { enumerable: true, get: function () { return element_selection_1.isSelectAction; } });
53
- Object.defineProperty(exports, "isSelectAllAction", { enumerable: true, get: function () { return element_selection_1.isSelectAllAction; } });
54
- __exportStar(require("@eclipse-glsp/protocol/lib/action-protocol/element-text-editing"), exports);
55
- __exportStar(require("@eclipse-glsp/protocol/lib/action-protocol/element-type-hints"), exports);
56
- __exportStar(require("@eclipse-glsp/protocol/lib/action-protocol/element-validation"), exports);
57
- var mode_layout_1 = require("@eclipse-glsp/protocol/lib/action-protocol/mode-layout");
58
- Object.defineProperty(exports, "LayoutOperation", { enumerable: true, get: function () { return mode_layout_1.LayoutOperation; } });
59
- var model_data_1 = require("@eclipse-glsp/protocol/lib/action-protocol/model-data");
60
- Object.defineProperty(exports, "isModelSourceChangedAction", { enumerable: true, get: function () { return model_data_1.isModelSourceChangedAction; } });
61
- Object.defineProperty(exports, "isRequestModelAction", { enumerable: true, get: function () { return model_data_1.isRequestModelAction; } });
62
- Object.defineProperty(exports, "isSetModelAction", { enumerable: true, get: function () { return model_data_1.isSetModelAction; } });
63
- Object.defineProperty(exports, "ModelSourceChangedAction", { enumerable: true, get: function () { return model_data_1.ModelSourceChangedAction; } });
64
- __exportStar(require("@eclipse-glsp/protocol/lib/action-protocol/model-edit-mode"), exports);
65
- var model_saving_1 = require("@eclipse-glsp/protocol/lib/action-protocol/model-saving");
66
- Object.defineProperty(exports, "DirtyStateChangeReason", { enumerable: true, get: function () { return model_saving_1.DirtyStateChangeReason; } });
67
- Object.defineProperty(exports, "isExportSvgAction", { enumerable: true, get: function () { return model_saving_1.isExportSvgAction; } });
68
- Object.defineProperty(exports, "isSaveModelAction", { enumerable: true, get: function () { return model_saving_1.isSaveModelAction; } });
69
- Object.defineProperty(exports, "isSetDirtyStateAction", { enumerable: true, get: function () { return model_saving_1.isSetDirtyStateAction; } });
70
- Object.defineProperty(exports, "SaveModelAction", { enumerable: true, get: function () { return model_saving_1.SaveModelAction; } });
71
- Object.defineProperty(exports, "SetDirtyStateAction", { enumerable: true, get: function () { return model_saving_1.SetDirtyStateAction; } });
72
- __exportStar(require("@eclipse-glsp/protocol/lib/action-protocol/node-modification"), exports);
73
- __exportStar(require("@eclipse-glsp/protocol/lib/action-protocol/tool-palette"), exports);
74
- __exportStar(require("@eclipse-glsp/protocol/lib/action-protocol/undo-redo"), exports);
75
- __exportStar(require("@eclipse-glsp/protocol/lib/glsp-client"), exports);
76
- __exportStar(require("@eclipse-glsp/protocol/lib/jsonrpc/base-jsonrpc-glsp-client"), exports);
77
- __exportStar(require("@eclipse-glsp/protocol/lib/jsonrpc/glsp-jsonrpc-client"), exports);
78
- __exportStar(require("@eclipse-glsp/protocol/lib/utils/array-util"), exports);
79
- __exportStar(require("@eclipse-glsp/protocol/lib/utils/launch-util"), exports);
80
- //# sourceMappingURL=protocol-reexport.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"protocol-reexport.js","sourceRoot":"","sources":["../src/protocol-reexport.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;;;;;;;;;AAElF;;;GAGG;AAEH,0FAMkE;AAL9D,kHAAA,iBAAiB,OAAA;AACjB,6GAAA,YAAY,OAAA;AACZ,oHAAA,mBAAmB,OAAA;AACnB,+GAAA,cAAc,OAAA;AAGlB,iGAA+E;AAC/E,uFAAqE;AACrE,sFAAoE;AACpE,+FAA6E;AAC7E,8FAA4E;AAC5E,0FAA4H;AAAnH,0HAAA,yBAAyB,OAAA;AAAE,sHAAA,qBAAqB,OAAA;AACzD,gGAA8E;AAC9E,kGAAiH;AAAxG,mHAAA,cAAc,OAAA;AAAE,sHAAA,iBAAiB,OAAA;AAC1C,kGAAgF;AAChF,gGAA8E;AAC9E,gGAA8E;AAC9E,sFAAyF;AAAhF,8GAAA,eAAe,OAAA;AACxB,oFAK+D;AAJ3D,wHAAA,0BAA0B,OAAA;AAC1B,kHAAA,oBAAoB,OAAA;AACpB,8GAAA,gBAAgB,OAAA;AAChB,sHAAA,wBAAwB,OAAA;AAE5B,6FAA2E;AAC3E,wFAOiE;AAN7D,sHAAA,sBAAsB,OAAA;AACtB,iHAAA,iBAAiB,OAAA;AACjB,iHAAA,iBAAiB,OAAA;AACjB,qHAAA,qBAAqB,OAAA;AACrB,+GAAA,eAAe,OAAA;AACf,mHAAA,mBAAmB,OAAA;AAEvB,+FAA6E;AAC7E,0FAAwE;AAExE,uFAAqE;AACrE,yEAAuD;AACvD,8FAA4E;AAC5E,yFAAuE;AACvE,8EAA4D;AAC5D,+EAA6D"}
@@ -1,38 +0,0 @@
1
- /********************************************************************************
2
- * Copyright (c) 2020-2021 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 { isLabeledAction, isTriggerElementTypeCreationAction, LabeledAction, TriggerElementCreationAction } from '@eclipse-glsp/protocol';
17
-
18
- export interface PaletteItem extends LabeledAction {
19
- readonly id: string;
20
- readonly sortString: string;
21
- readonly children?: PaletteItem[];
22
- }
23
-
24
- export function isPaletteItem(object?: any): object is PaletteItem {
25
- return isLabeledAction(object) && 'id' in object && 'sortString' in object;
26
- }
27
-
28
- export namespace PaletteItem {
29
- export function getTriggerAction(item?: PaletteItem): TriggerElementCreationAction | undefined {
30
- if (item) {
31
- const initiAction = item.actions
32
- .filter(a => isTriggerElementTypeCreationAction(a))
33
- .map(action => action as TriggerElementCreationAction);
34
- return initiAction.length > 0 ? initiAction[0] : undefined;
35
- }
36
- return undefined;
37
- }
38
- }