@eclipse-glsp/client 0.9.0-next.c5944e10 → 0.9.0-next.fd1a8bb6

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 (326) hide show
  1. package/lib/base/action-dispatcher.d.ts.map +1 -1
  2. package/lib/base/action-dispatcher.js +1 -1
  3. package/lib/base/action-dispatcher.js.map +1 -1
  4. package/lib/base/actions/context-actions.d.ts +1 -1
  5. package/lib/base/actions/context-actions.d.ts.map +1 -1
  6. package/lib/base/actions/context-actions.js +2 -3
  7. package/lib/base/actions/context-actions.js.map +1 -1
  8. package/lib/base/actions/edit-mode-action.d.ts.map +1 -1
  9. package/lib/base/actions/edit-mode-action.js +2 -3
  10. package/lib/base/actions/edit-mode-action.js.map +1 -1
  11. package/lib/base/actions/edit-validation-actions.d.ts +1 -1
  12. package/lib/base/actions/edit-validation-actions.d.ts.map +1 -1
  13. package/lib/base/actions/edit-validation-actions.js +13 -10
  14. package/lib/base/actions/edit-validation-actions.js.map +1 -1
  15. package/lib/base/actions/focus-change-action.js.map +1 -1
  16. package/lib/base/args.d.ts +1 -1
  17. package/lib/base/args.d.ts.map +1 -1
  18. package/lib/base/args.js.map +1 -1
  19. package/lib/base/auto-complete/auto-complete-widget.d.ts +1 -1
  20. package/lib/base/auto-complete/auto-complete-widget.d.ts.map +1 -1
  21. package/lib/base/auto-complete/auto-complete-widget.js +4 -5
  22. package/lib/base/auto-complete/auto-complete-widget.js.map +1 -1
  23. package/lib/base/auto-complete/validation-decorator.d.ts +1 -1
  24. package/lib/base/auto-complete/validation-decorator.js +1 -1
  25. package/lib/base/auto-complete/validation-decorator.js.map +1 -1
  26. package/lib/base/command-stack.d.ts.map +1 -1
  27. package/lib/base/command-stack.js +1 -1
  28. package/lib/base/command-stack.js.map +1 -1
  29. package/lib/base/di.config.d.ts.map +1 -1
  30. package/lib/base/di.config.js.map +1 -1
  31. package/lib/base/drag-aware-mouse-listener.d.ts +1 -1
  32. package/lib/base/drag-aware-mouse-listener.d.ts.map +1 -1
  33. package/lib/base/drag-aware-mouse-listener.js +1 -1
  34. package/lib/base/drag-aware-mouse-listener.js.map +1 -1
  35. package/lib/base/editor-context.d.ts.map +1 -1
  36. package/lib/base/editor-context.js +1 -1
  37. package/lib/base/editor-context.js.map +1 -1
  38. package/lib/base/focus-tracker.d.ts.map +1 -1
  39. package/lib/base/focus-tracker.js.map +1 -1
  40. package/lib/base/model/update-model-command.d.ts.map +1 -1
  41. package/lib/base/model/update-model-command.js +4 -5
  42. package/lib/base/model/update-model-command.js.map +1 -1
  43. package/lib/base/operations/operation.d.ts +1 -1
  44. package/lib/base/operations/operation.d.ts.map +1 -1
  45. package/lib/base/operations/operation.js +19 -10
  46. package/lib/base/operations/operation.js.map +1 -1
  47. package/lib/features/change-bounds/model.d.ts +1 -1
  48. package/lib/features/change-bounds/model.d.ts.map +1 -1
  49. package/lib/features/change-bounds/model.js +2 -1
  50. package/lib/features/change-bounds/model.js.map +1 -1
  51. package/lib/features/change-bounds/movement-restrictor.d.ts.map +1 -1
  52. package/lib/features/change-bounds/movement-restrictor.js +4 -2
  53. package/lib/features/change-bounds/movement-restrictor.js.map +1 -1
  54. package/lib/features/command-palette/server-command-palette-provider.d.ts.map +1 -1
  55. package/lib/features/command-palette/server-command-palette-provider.js +1 -1
  56. package/lib/features/command-palette/server-command-palette-provider.js.map +1 -1
  57. package/lib/features/context-menu/di.config.d.ts +1 -1
  58. package/lib/features/context-menu/di.config.d.ts.map +1 -1
  59. package/lib/features/context-menu/di.config.js +1 -1
  60. package/lib/features/context-menu/di.config.js.map +1 -1
  61. package/lib/features/context-menu/selection-service-aware-context-menu-mouse-listener.d.ts.map +1 -1
  62. package/lib/features/context-menu/selection-service-aware-context-menu-mouse-listener.js +2 -3
  63. package/lib/features/context-menu/selection-service-aware-context-menu-mouse-listener.js.map +1 -1
  64. package/lib/features/context-menu/server-context-menu-provider.d.ts.map +1 -1
  65. package/lib/features/context-menu/server-context-menu-provider.js +5 -2
  66. package/lib/features/context-menu/server-context-menu-provider.js.map +1 -1
  67. package/lib/features/copy-paste/copy-paste-actions.d.ts +1 -1
  68. package/lib/features/copy-paste/copy-paste-actions.d.ts.map +1 -1
  69. package/lib/features/copy-paste/copy-paste-actions.js +1 -1
  70. package/lib/features/copy-paste/copy-paste-actions.js.map +1 -1
  71. package/lib/features/copy-paste/copy-paste-context-menu.d.ts.map +1 -1
  72. package/lib/features/copy-paste/copy-paste-context-menu.js +17 -8
  73. package/lib/features/copy-paste/copy-paste-context-menu.js.map +1 -1
  74. package/lib/features/copy-paste/copy-paste-handler.d.ts.map +1 -1
  75. package/lib/features/copy-paste/copy-paste-handler.js +4 -4
  76. package/lib/features/copy-paste/copy-paste-handler.js.map +1 -1
  77. package/lib/features/decoration/decoration-placer.d.ts.map +1 -1
  78. package/lib/features/decoration/decoration-placer.js +1 -1
  79. package/lib/features/decoration/decoration-placer.js.map +1 -1
  80. package/lib/features/edit-label/edit-label-validator.d.ts.map +1 -1
  81. package/lib/features/edit-label/edit-label-validator.js +1 -1
  82. package/lib/features/edit-label/edit-label-validator.js.map +1 -1
  83. package/lib/features/hints/model.d.ts +1 -1
  84. package/lib/features/hints/model.d.ts.map +1 -1
  85. package/lib/features/hints/request-type-hints-action.d.ts +1 -1
  86. package/lib/features/hints/request-type-hints-action.d.ts.map +1 -1
  87. package/lib/features/hints/request-type-hints-action.js +4 -2
  88. package/lib/features/hints/request-type-hints-action.js.map +1 -1
  89. package/lib/features/hints/type-hints.d.ts +4 -4
  90. package/lib/features/hints/type-hints.d.ts.map +1 -1
  91. package/lib/features/hints/type-hints.js +6 -11
  92. package/lib/features/hints/type-hints.js.map +1 -1
  93. package/lib/features/hover/hover.d.ts.map +1 -1
  94. package/lib/features/hover/hover.js +1 -1
  95. package/lib/features/hover/hover.js.map +1 -1
  96. package/lib/features/layout/layout-commands.d.ts +2 -2
  97. package/lib/features/layout/layout-commands.d.ts.map +1 -1
  98. package/lib/features/layout/layout-commands.js +9 -8
  99. package/lib/features/layout/layout-commands.js.map +1 -1
  100. package/lib/features/layout/layout-commands.spec.d.ts +1 -1
  101. package/lib/features/layout/layout-commands.spec.js +15 -6
  102. package/lib/features/layout/layout-commands.spec.js.map +1 -1
  103. package/lib/features/model-source-watcher/model-source-changed-action-handler.d.ts.map +1 -1
  104. package/lib/features/model-source-watcher/model-source-changed-action-handler.js +1 -1
  105. package/lib/features/model-source-watcher/model-source-changed-action-handler.js.map +1 -1
  106. package/lib/features/model-source-watcher/model-source-changed-action.d.ts +1 -1
  107. package/lib/features/model-source-watcher/model-source-changed-action.js.map +1 -1
  108. package/lib/features/mouse-tool/mouse-tool.d.ts.map +1 -1
  109. package/lib/features/mouse-tool/mouse-tool.js +1 -1
  110. package/lib/features/mouse-tool/mouse-tool.js.map +1 -1
  111. package/lib/features/navigation/navigation-action-handler.d.ts.map +1 -1
  112. package/lib/features/navigation/navigation-action-handler.js +13 -13
  113. package/lib/features/navigation/navigation-action-handler.js.map +1 -1
  114. package/lib/features/navigation/navigation-target-resolver.d.ts.map +1 -1
  115. package/lib/features/navigation/navigation-target-resolver.js +6 -6
  116. package/lib/features/navigation/navigation-target-resolver.js.map +1 -1
  117. package/lib/features/navigation/navigation-target-resolver.spec.d.ts +1 -1
  118. package/lib/features/navigation/navigation-target-resolver.spec.js +1 -1
  119. package/lib/features/navigation/navigation-target-resolver.spec.js.map +1 -1
  120. package/lib/features/rank/model.d.ts +1 -1
  121. package/lib/features/rank/model.js +2 -2
  122. package/lib/features/rank/model.js.map +1 -1
  123. package/lib/features/reconnect/model.d.ts +1 -1
  124. package/lib/features/reconnect/model.d.ts.map +1 -1
  125. package/lib/features/reconnect/model.js +1 -1
  126. package/lib/features/reconnect/model.js.map +1 -1
  127. package/lib/features/save/di.config.d.ts +1 -1
  128. package/lib/features/save/di.config.d.ts.map +1 -1
  129. package/lib/features/save/di.config.js +1 -1
  130. package/lib/features/save/di.config.js.map +1 -1
  131. package/lib/features/save/save.d.ts +1 -1
  132. package/lib/features/save/save.js +1 -1
  133. package/lib/features/save/save.js.map +1 -1
  134. package/lib/features/select/select-feedback-action.d.ts.map +1 -1
  135. package/lib/features/select/select-feedback-action.js +1 -1
  136. package/lib/features/select/select-feedback-action.js.map +1 -1
  137. package/lib/features/select/selection-service.d.ts.map +1 -1
  138. package/lib/features/select/selection-service.js +11 -6
  139. package/lib/features/select/selection-service.js.map +1 -1
  140. package/lib/features/select/selection-service.spec.js +2 -2
  141. package/lib/features/select/selection-service.spec.js.map +1 -1
  142. package/lib/features/tool-feedback/change-bounds-tool-feedback.d.ts.map +1 -1
  143. package/lib/features/tool-feedback/change-bounds-tool-feedback.js +3 -9
  144. package/lib/features/tool-feedback/change-bounds-tool-feedback.js.map +1 -1
  145. package/lib/features/tool-feedback/creation-tool-feedback.d.ts.map +1 -1
  146. package/lib/features/tool-feedback/creation-tool-feedback.js +1 -2
  147. package/lib/features/tool-feedback/creation-tool-feedback.js.map +1 -1
  148. package/lib/features/tool-feedback/css-feedback.d.ts.map +1 -1
  149. package/lib/features/tool-feedback/css-feedback.js +2 -1
  150. package/lib/features/tool-feedback/css-feedback.js.map +1 -1
  151. package/lib/features/tool-feedback/di.config.d.ts +1 -1
  152. package/lib/features/tool-feedback/di.config.d.ts.map +1 -1
  153. package/lib/features/tool-feedback/di.config.js +1 -1
  154. package/lib/features/tool-feedback/di.config.js.map +1 -1
  155. package/lib/features/tool-feedback/edge-edit-tool-feedback.d.ts.map +1 -1
  156. package/lib/features/tool-feedback/edge-edit-tool-feedback.js +3 -3
  157. package/lib/features/tool-feedback/edge-edit-tool-feedback.js.map +1 -1
  158. package/lib/features/tool-feedback/feedback-action-dispatcher.d.ts +2 -2
  159. package/lib/features/tool-feedback/feedback-action-dispatcher.d.ts.map +1 -1
  160. package/lib/features/tool-feedback/feedback-action-dispatcher.js +2 -2
  161. package/lib/features/tool-feedback/feedback-action-dispatcher.js.map +1 -1
  162. package/lib/features/tool-feedback/marquee-tool-feedback.d.ts.map +1 -1
  163. package/lib/features/tool-feedback/marquee-tool-feedback.js.map +1 -1
  164. package/lib/features/tool-feedback/model.d.ts +1 -1
  165. package/lib/features/tool-feedback/model.js +1 -1
  166. package/lib/features/tool-feedback/view.d.ts +3 -3
  167. package/lib/features/tool-feedback/view.d.ts.map +1 -1
  168. package/lib/features/tool-feedback/view.js +5 -5
  169. package/lib/features/tool-feedback/view.js.map +1 -1
  170. package/lib/features/tool-palette/palette-item.d.ts +1 -1
  171. package/lib/features/tool-palette/palette-item.d.ts.map +1 -1
  172. package/lib/features/tool-palette/palette-item.js +3 -2
  173. package/lib/features/tool-palette/palette-item.js.map +1 -1
  174. package/lib/features/tool-palette/tool-palette.d.ts.map +1 -1
  175. package/lib/features/tool-palette/tool-palette.js +4 -6
  176. package/lib/features/tool-palette/tool-palette.js.map +1 -1
  177. package/lib/features/tools/change-bounds-tool.d.ts.map +1 -1
  178. package/lib/features/tools/change-bounds-tool.js +13 -7
  179. package/lib/features/tools/change-bounds-tool.js.map +1 -1
  180. package/lib/features/tools/delete-tool.d.ts.map +1 -1
  181. package/lib/features/tools/delete-tool.js +6 -3
  182. package/lib/features/tools/delete-tool.js.map +1 -1
  183. package/lib/features/tools/edge-creation-tool.d.ts.map +1 -1
  184. package/lib/features/tools/edge-creation-tool.js +4 -3
  185. package/lib/features/tools/edge-creation-tool.js.map +1 -1
  186. package/lib/features/tools/edge-edit-tool.d.ts.map +1 -1
  187. package/lib/features/tools/edge-edit-tool.js +2 -6
  188. package/lib/features/tools/edge-edit-tool.js.map +1 -1
  189. package/lib/features/tools/marquee-mouse-tool.d.ts.map +1 -1
  190. package/lib/features/tools/marquee-mouse-tool.js +35 -25
  191. package/lib/features/tools/marquee-mouse-tool.js.map +1 -1
  192. package/lib/features/tools/marquee-tool.d.ts.map +1 -1
  193. package/lib/features/tools/marquee-tool.js.map +1 -1
  194. package/lib/features/tools/node-creation-tool.d.ts.map +1 -1
  195. package/lib/features/tools/node-creation-tool.js +3 -3
  196. package/lib/features/tools/node-creation-tool.js.map +1 -1
  197. package/lib/features/tools/view.d.ts.map +1 -1
  198. package/lib/features/tools/view.js +2 -2
  199. package/lib/features/tools/view.js.map +1 -1
  200. package/lib/features/undo-redo/model.d.ts +1 -1
  201. package/lib/features/undo-redo/model.js.map +1 -1
  202. package/lib/features/validation/marker-navigator.d.ts.map +1 -1
  203. package/lib/features/validation/marker-navigator.js +11 -4
  204. package/lib/features/validation/marker-navigator.js.map +1 -1
  205. package/lib/features/validation/marker-navigator.spec.d.ts +1 -1
  206. package/lib/features/validation/marker-navigator.spec.js +13 -7
  207. package/lib/features/validation/marker-navigator.spec.js.map +1 -1
  208. package/lib/features/validation/validate.d.ts +2 -2
  209. package/lib/features/validation/validate.d.ts.map +1 -1
  210. package/lib/features/validation/validate.js +4 -4
  211. package/lib/features/validation/validate.js.map +1 -1
  212. package/lib/features/viewport/glsp-scroll-mouse-listener.d.ts.map +1 -1
  213. package/lib/features/viewport/glsp-scroll-mouse-listener.js.map +1 -1
  214. package/lib/index.d.ts.map +1 -1
  215. package/lib/index.js.map +1 -1
  216. package/lib/utils/argument-utils.d.ts +3 -3
  217. package/lib/utils/argument-utils.d.ts.map +1 -1
  218. package/lib/utils/argument-utils.js +1 -3
  219. package/lib/utils/argument-utils.js.map +1 -1
  220. package/lib/utils/array-utils.d.ts +1 -1
  221. package/lib/utils/array-utils.d.ts.map +1 -1
  222. package/lib/utils/array-utils.js +1 -1
  223. package/lib/utils/array-utils.js.map +1 -1
  224. package/lib/utils/layout-utils.d.ts +1 -1
  225. package/lib/utils/layout-utils.d.ts.map +1 -1
  226. package/lib/utils/layout-utils.js.map +1 -1
  227. package/lib/utils/smodel-util.d.ts +3 -3
  228. package/lib/utils/smodel-util.d.ts.map +1 -1
  229. package/lib/utils/smodel-util.js +5 -6
  230. package/lib/utils/smodel-util.js.map +1 -1
  231. package/lib/utils/viewpoint-util.d.ts +1 -1
  232. package/lib/utils/viewpoint-util.d.ts.map +1 -1
  233. package/lib/utils/viewpoint-util.js +1 -1
  234. package/lib/utils/viewpoint-util.js.map +1 -1
  235. package/lib/views/glsp-edge-view.d.ts.map +1 -1
  236. package/lib/views/glsp-edge-view.js +3 -3
  237. package/lib/views/glsp-edge-view.js.map +1 -1
  238. package/lib/views/issue-marker-view.d.ts.map +1 -1
  239. package/lib/views/issue-marker-view.js +3 -3
  240. package/lib/views/issue-marker-view.js.map +1 -1
  241. package/lib/views/rounded-corner-view.d.ts.map +1 -1
  242. package/lib/views/rounded-corner-view.js +3 -3
  243. package/lib/views/rounded-corner-view.js.map +1 -1
  244. package/lib/views/rounded-corner.d.ts.map +1 -1
  245. package/lib/views/rounded-corner.js +2 -2
  246. package/lib/views/rounded-corner.js.map +1 -1
  247. package/package.json +3 -3
  248. package/src/base/action-dispatcher.ts +1 -2
  249. package/src/base/actions/context-actions.ts +6 -6
  250. package/src/base/actions/edit-mode-action.ts +3 -4
  251. package/src/base/actions/edit-validation-actions.ts +26 -14
  252. package/src/base/actions/focus-change-action.ts +1 -1
  253. package/src/base/args.ts +4 -2
  254. package/src/base/auto-complete/auto-complete-widget.ts +34 -21
  255. package/src/base/auto-complete/validation-decorator.ts +5 -5
  256. package/src/base/command-stack.ts +1 -3
  257. package/src/base/di.config.ts +11 -16
  258. package/src/base/drag-aware-mouse-listener.ts +1 -3
  259. package/src/base/editor-context.ts +2 -4
  260. package/src/base/focus-tracker.ts +0 -2
  261. package/src/base/model/update-model-command.ts +4 -5
  262. package/src/base/operations/operation.ts +54 -27
  263. package/src/features/change-bounds/model.ts +7 -5
  264. package/src/features/change-bounds/movement-restrictor.ts +15 -7
  265. package/src/features/command-palette/server-command-palette-provider.ts +8 -5
  266. package/src/features/context-menu/di.config.ts +11 -8
  267. package/src/features/context-menu/selection-service-aware-context-menu-mouse-listener.ts +4 -3
  268. package/src/features/context-menu/server-context-menu-provider.ts +7 -3
  269. package/src/features/copy-paste/copy-paste-actions.ts +11 -8
  270. package/src/features/copy-paste/copy-paste-context-menu.ts +20 -11
  271. package/src/features/copy-paste/copy-paste-handler.ts +6 -5
  272. package/src/features/decoration/decoration-placer.ts +2 -13
  273. package/src/features/edit-label/edit-label-validator.ts +11 -12
  274. package/src/features/hints/model.ts +2 -2
  275. package/src/features/hints/request-type-hints-action.ts +10 -5
  276. package/src/features/hints/type-hints.ts +26 -30
  277. package/src/features/hover/hover.ts +1 -2
  278. package/src/features/layout/layout-commands.spec.ts +79 -56
  279. package/src/features/layout/layout-commands.ts +42 -31
  280. package/src/features/model-source-watcher/model-source-changed-action-handler.ts +3 -3
  281. package/src/features/model-source-watcher/model-source-changed-action.ts +2 -2
  282. package/src/features/mouse-tool/mouse-tool.ts +15 -8
  283. package/src/features/navigation/navigation-action-handler.ts +32 -22
  284. package/src/features/navigation/navigation-target-resolver.spec.ts +1 -3
  285. package/src/features/navigation/navigation-target-resolver.ts +14 -12
  286. package/src/features/rank/model.ts +2 -2
  287. package/src/features/reconnect/model.ts +2 -3
  288. package/src/features/save/di.config.ts +1 -2
  289. package/src/features/save/save.ts +2 -2
  290. package/src/features/select/select-feedback-action.ts +4 -6
  291. package/src/features/select/selection-service.spec.ts +9 -4
  292. package/src/features/select/selection-service.ts +13 -5
  293. package/src/features/tool-feedback/change-bounds-tool-feedback.ts +5 -12
  294. package/src/features/tool-feedback/creation-tool-feedback.ts +16 -7
  295. package/src/features/tool-feedback/css-feedback.ts +4 -3
  296. package/src/features/tool-feedback/di.config.ts +2 -5
  297. package/src/features/tool-feedback/edge-edit-tool-feedback.ts +17 -14
  298. package/src/features/tool-feedback/feedback-action-dispatcher.ts +6 -8
  299. package/src/features/tool-feedback/marquee-tool-feedback.ts +3 -2
  300. package/src/features/tool-feedback/model.ts +1 -2
  301. package/src/features/tool-feedback/view.tsx +13 -6
  302. package/src/features/tool-palette/palette-item.ts +3 -3
  303. package/src/features/tool-palette/tool-palette.ts +12 -14
  304. package/src/features/tools/change-bounds-tool.ts +29 -17
  305. package/src/features/tools/delete-tool.ts +8 -3
  306. package/src/features/tools/edge-creation-tool.ts +5 -8
  307. package/src/features/tools/edge-edit-tool.ts +7 -16
  308. package/src/features/tools/marquee-mouse-tool.ts +57 -37
  309. package/src/features/tools/marquee-tool.ts +0 -1
  310. package/src/features/tools/node-creation-tool.ts +4 -9
  311. package/src/features/tools/view.tsx +14 -8
  312. package/src/features/undo-redo/model.ts +3 -3
  313. package/src/features/validation/marker-navigator.spec.ts +15 -9
  314. package/src/features/validation/marker-navigator.ts +23 -8
  315. package/src/features/validation/validate.ts +9 -13
  316. package/src/features/viewport/glsp-scroll-mouse-listener.ts +1 -10
  317. package/src/index.ts +21 -4
  318. package/src/utils/argument-utils.ts +13 -9
  319. package/src/utils/array-utils.ts +4 -2
  320. package/src/utils/layout-utils.ts +11 -5
  321. package/src/utils/smodel-util.ts +14 -10
  322. package/src/utils/viewpoint-util.ts +3 -2
  323. package/src/views/glsp-edge-view.tsx +17 -8
  324. package/src/views/issue-marker-view.tsx +8 -8
  325. package/src/views/rounded-corner-view.tsx +35 -20
  326. package/src/views/rounded-corner.ts +3 -4
@@ -65,7 +65,6 @@ export class MarqueeMouseTool extends BaseGLSPTool {
65
65
 
66
66
  @injectable()
67
67
  export class MarqueeMouseListener extends DragAwareMouseListener {
68
-
69
68
  protected startPoint: Point;
70
69
 
71
70
  protected currentPoint: Point;
@@ -84,11 +83,14 @@ export class MarqueeMouseListener extends DragAwareMouseListener {
84
83
  mouseDown(target: SModelElement, event: MouseEvent): Action[] {
85
84
  this.isActive = true;
86
85
  this.startPoint = { x: getAbsolutePosition(target, event).x, y: getAbsolutePosition(target, event).y };
87
- if(event.ctrlKey){
88
- this.previouslySelected = Array.from(target.root.index.all()
89
- .map(e => e as SModelElement & BoundsAware)
90
- .filter(e => isSelected(e))
91
- .map(e => e.id));
86
+ if (event.ctrlKey) {
87
+ this.previouslySelected = Array.from(
88
+ target.root.index
89
+ .all()
90
+ .map(e => e as SModelElement & BoundsAware)
91
+ .filter(e => isSelected(e))
92
+ .map(e => e.id)
93
+ );
92
94
  }
93
95
  return [];
94
96
  }
@@ -96,18 +98,21 @@ export class MarqueeMouseListener extends DragAwareMouseListener {
96
98
  mouseMove(target: SModelElement, event: MouseEvent): Action[] {
97
99
  this.currentPoint = { x: getAbsolutePosition(target, event).x, y: getAbsolutePosition(target, event).y };
98
100
  if (this.isActive) {
99
- const nodeIdsSelected = Array.from(target.root.index.all()
100
- .map(e => e as SModelElement & BoundsAware)
101
- .filter(e => isSelectable(e))
102
- .filter(e => e instanceof SNode)
103
- .filter(e => this.isNodeMarked(e)).map(e => e.id));
101
+ const nodeIdsSelected = Array.from(
102
+ target.root.index
103
+ .all()
104
+ .map(e => e as SModelElement & BoundsAware)
105
+ .filter(e => isSelectable(e))
106
+ .filter(e => e instanceof SNode)
107
+ .filter(e => this.isNodeMarked(e))
108
+ .map(e => e.id)
109
+ );
104
110
  const edgeIdsSelected = this.getMarkedEdges(target.root);
105
111
  const selected = nodeIdsSelected.concat(edgeIdsSelected);
106
112
  return [
107
113
  new SelectAction([], Array.from(target.root.index.all().map(e => e.id))),
108
114
  new SelectAction(selected.concat(this.previouslySelected), []),
109
- new DrawMarqueeAction(this.startPoint,
110
- { x: getAbsolutePosition(target, event).x, y: getAbsolutePosition(target, event).y })
115
+ new DrawMarqueeAction(this.startPoint, { x: getAbsolutePosition(target, event).x, y: getAbsolutePosition(target, event).y })
111
116
  ];
112
117
  }
113
118
  return [];
@@ -123,10 +128,17 @@ export class MarqueeMouseListener extends DragAwareMouseListener {
123
128
 
124
129
  getMarkedEdges(root: SModelElement): string[] {
125
130
  const elements = Array.from(document.querySelectorAll('g'));
126
- const edges = Array.from(root.index.all().filter(e => e instanceof SEdge).
127
- filter(e => isSelectable(e)).map(e => e.id));
128
- return elements.filter(e => edges.includes(this.domHelper.findSModelIdByDOMElement(e)))
129
- .filter(e => this.isEdgeMarked(e)).map(e => this.domHelper.findSModelIdByDOMElement(e));
131
+ const edges = Array.from(
132
+ root.index
133
+ .all()
134
+ .filter(e => e instanceof SEdge)
135
+ .filter(e => isSelectable(e))
136
+ .map(e => e.id)
137
+ );
138
+ return elements
139
+ .filter(e => edges.includes(this.domHelper.findSModelIdByDOMElement(e)))
140
+ .filter(e => this.isEdgeMarked(e))
141
+ .map(e => this.domHelper.findSModelIdByDOMElement(e));
130
142
  }
131
143
 
132
144
  isEdgeMarked(element: SVGElement): boolean {
@@ -170,11 +182,11 @@ export class MarqueeMouseListener extends DragAwareMouseListener {
170
182
  }
171
183
 
172
184
  linesIntersect(p1: Point, p2: Point, p3: Point, p4: Point): boolean {
173
- const tCount = ((p1.x - p3.x) * (p3.y - p4.y)) - ((p1.y - p3.y) * (p3.x - p4.x));
174
- const tDenom = ((p1.x - p2.x) * (p3.y - p4.y)) - ((p1.y - p2.y) * (p3.x - p4.x));
185
+ const tCount = (p1.x - p3.x) * (p3.y - p4.y) - (p1.y - p3.y) * (p3.x - p4.x);
186
+ const tDenom = (p1.x - p2.x) * (p3.y - p4.y) - (p1.y - p2.y) * (p3.x - p4.x);
175
187
  const t = tCount / tDenom;
176
- const uCount = ((p2.x - p1.x) * (p1.y - p3.y)) - ((p2.y - p1.y) * (p1.x - p3.x));
177
- const uDenom = ((p1.x - p2.x) * (p3.y - p4.y)) - ((p1.y - p2.y) * (p3.x - p4.x));
188
+ const uCount = (p2.x - p1.x) * (p1.y - p3.y) - (p2.y - p1.y) * (p1.x - p3.x);
189
+ const uDenom = (p1.x - p2.x) * (p3.y - p4.y) - (p1.y - p2.y) * (p3.x - p4.x);
178
190
  const u = uCount / uDenom;
179
191
  if (t >= 0.0 && t <= 1.0 && u >= 0.0 && u <= 1.0) {
180
192
  return true;
@@ -183,20 +195,26 @@ export class MarqueeMouseListener extends DragAwareMouseListener {
183
195
  }
184
196
 
185
197
  pointInRect(point: Point): boolean {
186
- const boolX = this.startPoint.x <= this.currentPoint.x ?
187
- this.isBetween(point.x, this.startPoint.x, this.currentPoint.x) : this.isBetween(point.x, this.currentPoint.x, this.startPoint.x);
188
- const boolY = this.startPoint.y <= this.currentPoint.y ?
189
- this.isBetween(point.y, this.startPoint.y, this.currentPoint.y) : this.isBetween(point.y, this.currentPoint.y, this.startPoint.y);
198
+ const boolX =
199
+ this.startPoint.x <= this.currentPoint.x
200
+ ? this.isBetween(point.x, this.startPoint.x, this.currentPoint.x)
201
+ : this.isBetween(point.x, this.currentPoint.x, this.startPoint.x);
202
+ const boolY =
203
+ this.startPoint.y <= this.currentPoint.y
204
+ ? this.isBetween(point.y, this.startPoint.y, this.currentPoint.y)
205
+ : this.isBetween(point.y, this.currentPoint.y, this.startPoint.y);
190
206
  return boolX && boolY;
191
207
  }
192
208
 
193
209
  isNodeMarked(element: SModelElement & BoundsAware): boolean {
194
- const horizontallyIn = this.startPoint.x < this.currentPoint.x ?
195
- this.isElementBetweenXAxis(element, this.startPoint.x, this.currentPoint.x) :
196
- this.isElementBetweenXAxis(element, this.currentPoint.x, this.startPoint.x);
197
- const verticallyIn = this.startPoint.y < this.currentPoint.y ?
198
- this.isElementBetweenYAxis(element, this.startPoint.y, this.currentPoint.y) :
199
- this.isElementBetweenYAxis(element, this.currentPoint.y, this.startPoint.y);
210
+ const horizontallyIn =
211
+ this.startPoint.x < this.currentPoint.x
212
+ ? this.isElementBetweenXAxis(element, this.startPoint.x, this.currentPoint.x)
213
+ : this.isElementBetweenXAxis(element, this.currentPoint.x, this.startPoint.x);
214
+ const verticallyIn =
215
+ this.startPoint.y < this.currentPoint.y
216
+ ? this.isElementBetweenYAxis(element, this.startPoint.y, this.currentPoint.y)
217
+ : this.isElementBetweenYAxis(element, this.currentPoint.y, this.startPoint.y);
200
218
  if (horizontallyIn && verticallyIn) {
201
219
  return true;
202
220
  }
@@ -204,8 +222,10 @@ export class MarqueeMouseListener extends DragAwareMouseListener {
204
222
  }
205
223
 
206
224
  isElementBetweenXAxis(element: SModelElement & BoundsAware, marqueeLeft: number, marqueeRight: number): boolean {
207
- if (this.isBetween(marqueeLeft, toAbsoluteBounds(element).x, toAbsoluteBounds(element).x + toAbsoluteBounds(element).width)
208
- || this.isBetween(marqueeRight, toAbsoluteBounds(element).x, toAbsoluteBounds(element).x + toAbsoluteBounds(element).width)) {
225
+ if (
226
+ this.isBetween(marqueeLeft, toAbsoluteBounds(element).x, toAbsoluteBounds(element).x + toAbsoluteBounds(element).width) ||
227
+ this.isBetween(marqueeRight, toAbsoluteBounds(element).x, toAbsoluteBounds(element).x + toAbsoluteBounds(element).width)
228
+ ) {
209
229
  return true;
210
230
  }
211
231
  const leftEdge = this.isBetween(toAbsoluteBounds(element).x, marqueeLeft, marqueeRight);
@@ -214,8 +234,10 @@ export class MarqueeMouseListener extends DragAwareMouseListener {
214
234
  }
215
235
 
216
236
  isElementBetweenYAxis(element: SModelElement & BoundsAware, marqueeTop: number, marqueeBottom: number): boolean {
217
- if (this.isBetween(marqueeTop, toAbsoluteBounds(element).y, toAbsoluteBounds(element).y + toAbsoluteBounds(element).height)
218
- || this.isBetween(marqueeBottom, toAbsoluteBounds(element).y, toAbsoluteBounds(element).y + toAbsoluteBounds(element).height)) {
237
+ if (
238
+ this.isBetween(marqueeTop, toAbsoluteBounds(element).y, toAbsoluteBounds(element).y + toAbsoluteBounds(element).height) ||
239
+ this.isBetween(marqueeBottom, toAbsoluteBounds(element).y, toAbsoluteBounds(element).y + toAbsoluteBounds(element).height)
240
+ ) {
219
241
  return true;
220
242
  }
221
243
  const topEdge = this.isBetween(toAbsoluteBounds(element).y, marqueeTop, marqueeBottom);
@@ -229,12 +251,10 @@ export class MarqueeMouseListener extends DragAwareMouseListener {
229
251
  }
230
252
  return false;
231
253
  }
232
-
233
254
  }
234
255
 
235
256
  @injectable()
236
257
  export class ShiftKeyListener extends KeyListener {
237
-
238
258
  keyUp(element: SModelElement, event: KeyboardEvent): Action[] {
239
259
  if (event.shiftKey) {
240
260
  return [];
@@ -42,7 +42,6 @@ export class MarqueeTool extends BaseGLSPTool {
42
42
 
43
43
  @injectable()
44
44
  export class MarqueeKeyListener extends KeyListener {
45
-
46
45
  keyDown(element: SModelElement, event: KeyboardEvent): Action[] {
47
46
  if (event.shiftKey) {
48
47
  return [new EnableToolsAction([MarqueeMouseTool.ID])];
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2020 EclipseSource and others.
2
+ * Copyright (c) 2020-2021 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
@@ -28,11 +28,7 @@ import {
28
28
  } from 'sprotty';
29
29
 
30
30
  import { DragAwareMouseListener } from '../../base/drag-aware-mouse-listener';
31
- import {
32
- CreateNodeOperation,
33
- isTriggerNodeCreationAction,
34
- TriggerNodeCreationAction
35
- } from '../../base/operations/operation';
31
+ import { CreateNodeOperation, isTriggerNodeCreationAction, TriggerNodeCreationAction } from '../../base/operations/operation';
36
32
  import { getAbsolutePosition } from '../../utils/viewpoint-util';
37
33
  import { Containable, isContainable } from '../hints/model';
38
34
  import { CursorCSS, cursorFeedbackAction } from '../tool-feedback/css-feedback';
@@ -75,7 +71,6 @@ export class NodeCreationTool extends BaseGLSPTool implements IActionHandler {
75
71
 
76
72
  @injectable()
77
73
  export class NodeCreationToolMouseListener extends DragAwareMouseListener {
78
-
79
74
  protected container?: SModelElement & Containable;
80
75
 
81
76
  constructor(protected triggerAction: TriggerNodeCreationAction, protected tool: NodeCreationTool) {
@@ -114,8 +109,8 @@ export class NodeCreationToolMouseListener extends DragAwareMouseListener {
114
109
  if (!this.container || currentContainer !== this.container) {
115
110
  this.container = currentContainer;
116
111
  const feedback = this.creationAllowed(this.elementTypeId)
117
- ? cursorFeedbackAction(CursorCSS.NODE_CREATION) :
118
- cursorFeedbackAction(CursorCSS.OPERATION_NOT_ALLOWED);
112
+ ? cursorFeedbackAction(CursorCSS.NODE_CREATION)
113
+ : cursorFeedbackAction(CursorCSS.OPERATION_NOT_ALLOWED);
119
114
  this.tool.dispatchFeedback([feedback]);
120
115
  }
121
116
  return [];
@@ -25,14 +25,20 @@ const JSX = { createElement: svg };
25
25
  @injectable()
26
26
  export class MarqueeView extends RectangularNodeView {
27
27
  render(node: MarqueeNode, context: RenderingContext): VNode {
28
- const graph = <g>
29
- <rect class-sprotty-node={true} class-marquee={true}
30
- x={((node.startPoint.x - node.endPoint.x) <= 0) ? node.startPoint.x : node.endPoint.x}
31
- y={((node.startPoint.y - node.endPoint.y) <= 0) ? node.startPoint.y : node.endPoint.y}
32
- rx={0} ry={0}
33
- width={Math.abs(node.startPoint.x - node.endPoint.x)}
34
- height={Math.abs(node.startPoint.y - node.endPoint.y)}></rect>
35
- </g>;
28
+ const graph = (
29
+ <g>
30
+ <rect
31
+ class-sprotty-node={true}
32
+ class-marquee={true}
33
+ x={node.startPoint.x - node.endPoint.x <= 0 ? node.startPoint.x : node.endPoint.x}
34
+ y={node.startPoint.y - node.endPoint.y <= 0 ? node.startPoint.y : node.endPoint.y}
35
+ rx={0}
36
+ ry={0}
37
+ width={Math.abs(node.startPoint.x - node.endPoint.x)}
38
+ height={Math.abs(node.startPoint.y - node.endPoint.y)}
39
+ ></rect>
40
+ </g>
41
+ );
36
42
  return graph;
37
43
  }
38
44
  }
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2019 EclipseSource and others.
2
+ * Copyright (c) 2019-2021 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
@@ -17,10 +17,10 @@ import { Operation } from '../../base/operations/operation';
17
17
 
18
18
  export class UndoOperation implements Operation {
19
19
  static readonly KIND = 'glspUndo';
20
- constructor(public readonly kind = UndoOperation.KIND) { }
20
+ constructor(public readonly kind = UndoOperation.KIND) {}
21
21
  }
22
22
 
23
23
  export class RedoOperation implements Operation {
24
24
  static readonly KIND = 'glspRedo';
25
- constructor(public readonly kind = RedoOperation.KIND) { }
25
+ constructor(public readonly kind = RedoOperation.KIND) {}
26
26
  }
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2020 EclipseSource and others.
2
+ * Copyright (c) 2020-2021 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
@@ -45,7 +45,9 @@ describe('MarkerNavigator', () => {
45
45
  const markerNavigator = container.get<MarkerNavigator>(MarkerNavigator);
46
46
 
47
47
  const rootWithoutAnyMarkers = graphFactory.createRoot({
48
- id: 'root', type: 'graph', children: [
48
+ id: 'root',
49
+ type: 'graph',
50
+ children: [
49
51
  {
50
52
  id: '1',
51
53
  type: 'node'
@@ -54,18 +56,24 @@ describe('MarkerNavigator', () => {
54
56
  }) as SModelRoot;
55
57
 
56
58
  const rootWithMarkers = graphFactory.createRoot({
57
- id: 'root', type: 'graph', children: [
59
+ id: 'root',
60
+ type: 'graph',
61
+ children: [
58
62
  {
59
- id: 'bottom-right', type: 'node'
63
+ id: 'bottom-right',
64
+ type: 'node'
60
65
  } as SNodeSchema,
61
66
  {
62
- id: 'top-right', type: 'node'
67
+ id: 'top-right',
68
+ type: 'node'
63
69
  } as SNodeSchema,
64
70
  {
65
- id: 'top-left', type: 'node'
71
+ id: 'top-left',
72
+ type: 'node'
66
73
  } as SNodeSchema,
67
74
  {
68
- id: 'bottom-left', type: 'node'
75
+ id: 'bottom-left',
76
+ type: 'node'
69
77
  } as SNodeSchema
70
78
  ]
71
79
  }) as SModelRoot;
@@ -168,7 +176,6 @@ describe('MarkerNavigator', () => {
168
176
  expect(found4).to.eql(marker2);
169
177
  expect(found5).to.eql(marker1);
170
178
  });
171
-
172
179
  });
173
180
 
174
181
  function clearMarker(elem: SParentElement): void {
@@ -204,4 +211,3 @@ function createMarker(elem: SParentElement): SIssueMarker {
204
211
  elem.add(newMarker);
205
212
  return newMarker;
206
213
  }
207
-
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2020 EclipseSource and others.
2
+ * Copyright (c) 2020-2021 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
@@ -51,7 +51,8 @@ export class NavigateToMarkerAction implements Action {
51
51
  public readonly direction: 'next' | 'previous' = 'next',
52
52
  public readonly selectedElementIds?: string[],
53
53
  public readonly severities: SIssueSeverity[] = MarkerNavigator.ALL_SEVERITIES,
54
- public kind = NavigateToMarkerAction.KIND) { }
54
+ public kind = NavigateToMarkerAction.KIND
55
+ ) {}
55
56
  }
56
57
 
57
58
  export class SModelElementComparator {
@@ -90,7 +91,11 @@ export class MarkerNavigator {
90
91
  @inject(SModelElementComparator)
91
92
  protected markerComparator: SModelElementComparator;
92
93
 
93
- next(root: SModelRoot, current?: SModelElement & BoundsAware, predicate: (marker: SIssueMarker) => boolean = MarkerPredicates.ALL): SIssueMarker | undefined {
94
+ next(
95
+ root: SModelRoot,
96
+ current?: SModelElement & BoundsAware,
97
+ predicate: (marker: SIssueMarker) => boolean = MarkerPredicates.ALL
98
+ ): SIssueMarker | undefined {
94
99
  const markers = this.getMarkers(root, predicate);
95
100
  if (current === undefined) {
96
101
  return markers.length > 0 ? markers[0] : undefined;
@@ -98,7 +103,11 @@ export class MarkerNavigator {
98
103
  return markers[this.getNextIndex(current, markers) % markers.length];
99
104
  }
100
105
 
101
- previous(root: SModelRoot, current?: SModelElement & BoundsAware, predicate: (marker: SIssueMarker) => boolean = MarkerPredicates.ALL): SIssueMarker | undefined {
106
+ previous(
107
+ root: SModelRoot,
108
+ current?: SModelElement & BoundsAware,
109
+ predicate: (marker: SIssueMarker) => boolean = MarkerPredicates.ALL
110
+ ): SIssueMarker | undefined {
102
111
  const markers = this.getMarkers(root, predicate);
103
112
  if (current === undefined) {
104
113
  return markers.length > 0 ? markers[0] : undefined;
@@ -206,7 +215,6 @@ export class NavigateToMarkerCommand extends Command {
206
215
  }
207
216
  return this.centerCommand ? this.centerCommand.redo(context) : context.root;
208
217
  }
209
-
210
218
  }
211
219
 
212
220
  @injectable()
@@ -218,15 +226,22 @@ export class MarkerNavigatorContextMenuItemProvider implements IContextMenuItemP
218
226
  const hasMarkers = collectIssueMarkers(root).length > 0;
219
227
  return Promise.resolve([
220
228
  {
221
- id: 'navigate', label: 'Go to', group: 'navigate', actions: [],
229
+ id: 'navigate',
230
+ label: 'Go to',
231
+ group: 'navigate',
232
+ actions: [],
222
233
  children: [
223
234
  {
224
- id: 'next-marker', label: 'Next marker', group: 'marker',
235
+ id: 'next-marker',
236
+ label: 'Next marker',
237
+ group: 'marker',
225
238
  actions: [new NavigateToMarkerAction('next', selectedElementIds)],
226
239
  isEnabled: () => hasMarkers
227
240
  },
228
241
  {
229
- id: 'previous-marker', label: 'Previous marker', group: 'marker',
242
+ id: 'previous-marker',
243
+ label: 'Previous marker',
244
+ group: 'marker',
230
245
  actions: [new NavigateToMarkerAction('previous', selectedElementIds)],
231
246
  isEnabled: () => hasMarkers
232
247
  }
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2019-2020 EclipseSource and others.
2
+ * Copyright (c) 2019-2021 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
@@ -43,7 +43,6 @@ import { createSIssue, getOrCreateSIssueMarker, getSIssueMarker } from './issue-
43
43
  */
44
44
  @injectable()
45
45
  export class ValidationFeedbackEmitter implements IFeedbackEmitter {
46
-
47
46
  @inject(GLSP_TYPES.IFeedbackActionDispatcher) protected feedbackActionDispatcher: IFeedbackActionDispatcher;
48
47
 
49
48
  @inject(TYPES.IActionDispatcherProvider) protected actionDispatcher: () => Promise<IActionDispatcher>;
@@ -51,7 +50,7 @@ export class ValidationFeedbackEmitter implements IFeedbackEmitter {
51
50
  private registeredAction: MarkersAction;
52
51
 
53
52
  // eslint-disable-next-line @typescript-eslint/no-empty-function
54
- private constructor() { }
53
+ private constructor() {}
55
54
 
56
55
  /**
57
56
  * Register the action that should be emitted for visualizing validation feedback.
@@ -77,11 +76,11 @@ export class ValidationFeedbackEmitter implements IFeedbackEmitter {
77
76
  * Action to set markers for a model
78
77
  */
79
78
  export class SetMarkersAction implements MarkersAction {
80
- constructor(public readonly markers: Marker[], public readonly kind = SetMarkersCommand.KIND) { }
79
+ constructor(public readonly markers: Marker[], public readonly kind = SetMarkersCommand.KIND) {}
81
80
  }
82
81
 
83
82
  export function isSetMarkersAction(action: Action): action is SetMarkersAction {
84
- return SetMarkersCommand.KIND === action.kind && ('markers' in action);
83
+ return SetMarkersCommand.KIND === action.kind && 'markers' in action;
85
84
  }
86
85
 
87
86
  /**
@@ -92,7 +91,6 @@ export function isSetMarkersAction(action: Action): action is SetMarkersAction {
92
91
  */
93
92
  @injectable()
94
93
  export abstract class ExternalMarkerManager {
95
-
96
94
  languageLabel: string;
97
95
 
98
96
  protected actionDispatcher?: IActionDispatcher;
@@ -115,7 +113,6 @@ export abstract class ExternalMarkerManager {
115
113
  */
116
114
  @injectable()
117
115
  export class SetMarkersCommand extends Command {
118
-
119
116
  @inject(ValidationFeedbackEmitter) protected validationFeedbackEmitter: ValidationFeedbackEmitter;
120
117
  @inject(ExternalMarkerManager) @optional() protected externalMarkerManager?: ExternalMarkerManager;
121
118
  @inject(EditorContextService) protected editorContextService: EditorContextService;
@@ -147,11 +144,11 @@ export class SetMarkersCommand extends Command {
147
144
  }
148
145
 
149
146
  /**
150
- * Action to retrieve markers for a model
151
- */
147
+ * Action to retrieve markers for a model
148
+ */
152
149
  export class RequestMarkersAction implements Action {
153
150
  static readonly KIND = 'requestMarkers';
154
- constructor(public readonly elementsIDs: string[] = [], public readonly kind = RequestMarkersAction.KIND) { }
151
+ constructor(public readonly elementsIDs: string[] = [], public readonly kind = RequestMarkersAction.KIND) {}
155
152
  }
156
153
 
157
154
  /**
@@ -166,7 +163,7 @@ export interface MarkersAction extends Action {
166
163
  */
167
164
  @injectable()
168
165
  export class ApplyMarkersAction implements MarkersAction {
169
- constructor(public readonly markers: Marker[], public readonly kind = ApplyMarkersCommand.KIND) { }
166
+ constructor(public readonly markers: Marker[], public readonly kind = ApplyMarkersCommand.KIND) {}
170
167
  }
171
168
 
172
169
  /**
@@ -224,7 +221,7 @@ function removeCSSClassFromIssueParent(modelElement: SParentElement, issueMarker
224
221
  */
225
222
  @injectable()
226
223
  export class DeleteMarkersAction implements MarkersAction {
227
- constructor(public readonly markers: Marker[], public readonly kind = DeleteMarkersCommand.KIND) { }
224
+ constructor(public readonly markers: Marker[], public readonly kind = DeleteMarkersCommand.KIND) {}
228
225
  }
229
226
 
230
227
  /**
@@ -271,4 +268,3 @@ export class DeleteMarkersCommand extends Command {
271
268
  return this.execute(context);
272
269
  }
273
270
  }
274
-
@@ -14,21 +14,12 @@
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
16
  import { injectable } from 'inversify';
17
- import {
18
- Action,
19
- EnableDefaultToolsAction,
20
- EnableToolsAction,
21
- IActionHandler,
22
- ICommand,
23
- ScrollMouseListener,
24
- SModelElement
25
- } from 'sprotty';
17
+ import { Action, EnableDefaultToolsAction, EnableToolsAction, IActionHandler, ICommand, ScrollMouseListener, SModelElement } from 'sprotty';
26
18
 
27
19
  import { MarqueeMouseTool } from '../tools/marquee-mouse-tool';
28
20
 
29
21
  @injectable()
30
22
  export class GLSPScrollMouseListener extends ScrollMouseListener implements IActionHandler {
31
-
32
23
  preventScrolling = false;
33
24
 
34
25
  handle(action: Action): void | Action | ICommand {
package/src/index.ts CHANGED
@@ -108,8 +108,25 @@ export * from './utils/smodel-util';
108
108
  export * from './utils/viewpoint-util';
109
109
  export * from './views';
110
110
  export {
111
- validationModule, saveModule, paletteModule, toolFeedbackModule, defaultGLSPModule, modelHintsModule, glspCommandPaletteModule,
112
- glspContextMenuModule, glspServerCopyPasteModule, copyPasteContextMenuModule, glspSelectModule, glspMouseToolModule, layoutCommandsModule, glspEditLabelModule,
113
- glspHoverModule, toolsModule, navigationModule, markerNavigatorModule, glspDecorationModule, modelSourceWatcherModule, glspViewportModule
111
+ validationModule,
112
+ saveModule,
113
+ paletteModule,
114
+ toolFeedbackModule,
115
+ defaultGLSPModule,
116
+ modelHintsModule,
117
+ glspCommandPaletteModule,
118
+ glspContextMenuModule,
119
+ glspServerCopyPasteModule,
120
+ copyPasteContextMenuModule,
121
+ glspSelectModule,
122
+ glspMouseToolModule,
123
+ layoutCommandsModule,
124
+ glspEditLabelModule,
125
+ glspHoverModule,
126
+ toolsModule,
127
+ navigationModule,
128
+ markerNavigatorModule,
129
+ glspDecorationModule,
130
+ modelSourceWatcherModule,
131
+ glspViewportModule
114
132
  };
115
-
@@ -18,7 +18,7 @@ import { SModelElement } from 'sprotty';
18
18
  import { hasArguments } from '../base/args';
19
19
 
20
20
  export namespace GArgument {
21
- export function asNumber(argValue: (string | number | boolean)): number | undefined {
21
+ export function asNumber(argValue: string | number | boolean): number | undefined {
22
22
  return typeof argValue === 'number' ? argValue : undefined;
23
23
  }
24
24
 
@@ -26,7 +26,7 @@ export namespace GArgument {
26
26
  return argValues.map(asNumber);
27
27
  }
28
28
 
29
- export function asString(argValue: (string | number | boolean)): string | undefined {
29
+ export function asString(argValue: string | number | boolean): string | undefined {
30
30
  return typeof argValue === 'string' ? argValue : undefined;
31
31
  }
32
32
 
@@ -34,7 +34,7 @@ export namespace GArgument {
34
34
  return argValues.map(asString);
35
35
  }
36
36
 
37
- export function asBoolean(argValue: (string | number | boolean)): boolean | undefined {
37
+ export function asBoolean(argValue: string | number | boolean): boolean | undefined {
38
38
  return typeof argValue === 'boolean' ? argValue : undefined;
39
39
  }
40
40
 
@@ -112,16 +112,20 @@ export class CornerRadius {
112
112
  public readonly topLeft: number = 0,
113
113
  public readonly topRight: number = topLeft,
114
114
  public readonly bottomRight: number = topLeft,
115
- public readonly bottomLeft: number = topRight) {
116
- }
115
+ public readonly bottomLeft: number = topRight
116
+ ) {}
117
117
 
118
118
  static from(element: SModelElement | undefined): CornerRadius | undefined {
119
- const radius = GArgument.getNumbers(element, this.KEY_RADIUS_TOP_LEFT, this.KEY_RADIUS_TOP_RIGHT, this.KEY_RADIUS_BOTTOM_RIGHT, this.KEY_RADIUS_BOTTOM_LEFT);
119
+ const radius = GArgument.getNumbers(
120
+ element,
121
+ this.KEY_RADIUS_TOP_LEFT,
122
+ this.KEY_RADIUS_TOP_RIGHT,
123
+ this.KEY_RADIUS_BOTTOM_RIGHT,
124
+ this.KEY_RADIUS_BOTTOM_LEFT
125
+ );
120
126
  if (radius === undefined || radius[0] === undefined) {
121
127
  return undefined;
122
128
  }
123
- return GArgument.hasNValues(radius, 4)
124
- ? new CornerRadius(radius[0], radius[1], radius[2], radius[3])
125
- : new CornerRadius(radius[0]);
129
+ return GArgument.hasNValues(radius, 4) ? new CornerRadius(radius[0], radius[1], radius[2], radius[3]) : new CornerRadius(radius[0]);
126
130
  }
127
131
  }
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2019 EclipseSource and others.
2
+ * Copyright (c) 2019-2021 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
@@ -31,7 +31,9 @@ export function distinctAdd<T>(array: T[], value: T): boolean {
31
31
  return false;
32
32
  }
33
33
 
34
- interface Constructor<T> { new(...args: any[]): T }
34
+ interface Constructor<T> {
35
+ new (...args: any[]): T;
36
+ }
35
37
  type PrimitiveType = 'bigint' | 'boolean' | 'function' | 'number' | 'object' | 'string' | 'symbol' | 'undefined';
36
38
 
37
39
  export function isArrayOfType<T>(object: any, typeGuard: (elem: any) => elem is T, supportEmpty = false): object is T[] {
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2020 EclipseSource and others.
2
+ * Copyright (c) 2020-2021 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
@@ -52,16 +52,22 @@ export function isValidMove(element: SModelElement & BoundsAware, newPosition: P
52
52
  return true;
53
53
  }
54
54
 
55
- export function toValidElementMove(element: SModelElement & BoundsAware, move: WriteableElementMove, movementRestrictor?: IMovementRestrictor): WriteableElementMove | undefined {
55
+ export function toValidElementMove(
56
+ element: SModelElement & BoundsAware,
57
+ move: WriteableElementMove,
58
+ movementRestrictor?: IMovementRestrictor
59
+ ): WriteableElementMove | undefined {
56
60
  if (!isValidMove(element, move.toPosition, movementRestrictor)) {
57
61
  return;
58
62
  }
59
63
  return move;
60
64
  }
61
65
 
62
- export function toValidElementAndBounds(element: SModelElement & BoundsAware, bounds: WriteableElementAndBounds,
63
- movementRestrictor?: IMovementRestrictor): WriteableElementAndBounds | undefined {
64
-
66
+ export function toValidElementAndBounds(
67
+ element: SModelElement & BoundsAware,
68
+ bounds: WriteableElementAndBounds,
69
+ movementRestrictor?: IMovementRestrictor
70
+ ): WriteableElementAndBounds | undefined {
65
71
  if (!isValidMove(element, bounds.newPosition, movementRestrictor)) {
66
72
  return;
67
73
  }