@eclipse-glsp/server 1.1.0-next.3d7585d.42 → 1.1.0-next.42963d6.55

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 (365) hide show
  1. package/lib/browser/di/app-module.d.ts +2 -7
  2. package/lib/browser/di/app-module.d.ts.map +1 -1
  3. package/lib/browser/di/app-module.js +5 -30
  4. package/lib/browser/di/app-module.js.map +1 -1
  5. package/lib/browser/index.d.ts +0 -1
  6. package/lib/browser/index.d.ts.map +1 -1
  7. package/lib/browser/index.js +0 -1
  8. package/lib/browser/index.js.map +1 -1
  9. package/lib/browser/launch/worker-server-launcher.d.ts +11 -8
  10. package/lib/browser/launch/worker-server-launcher.d.ts.map +1 -1
  11. package/lib/browser/launch/worker-server-launcher.js +13 -21
  12. package/lib/browser/launch/worker-server-launcher.js.map +1 -1
  13. package/lib/common/actions/client-action-handler.d.ts +1 -2
  14. package/lib/common/actions/client-action-handler.d.ts.map +1 -1
  15. package/lib/common/actions/client-action-handler.js +17 -2
  16. package/lib/common/actions/client-action-handler.js.map +1 -1
  17. package/lib/common/command/command-stack.d.ts +60 -14
  18. package/lib/common/command/command-stack.d.ts.map +1 -1
  19. package/lib/common/command/command-stack.js +78 -24
  20. package/lib/common/command/command-stack.js.map +1 -1
  21. package/lib/common/command/command.d.ts +34 -7
  22. package/lib/common/command/command.d.ts.map +1 -1
  23. package/lib/common/command/command.js +73 -0
  24. package/lib/common/command/command.js.map +1 -1
  25. package/lib/common/command/recording-command.d.ts +75 -0
  26. package/lib/common/command/recording-command.d.ts.map +1 -0
  27. package/lib/common/command/recording-command.js +99 -0
  28. package/lib/common/command/recording-command.js.map +1 -0
  29. package/lib/common/command/undo-redo-action-handler.d.ts +28 -0
  30. package/lib/common/command/undo-redo-action-handler.d.ts.map +1 -0
  31. package/lib/common/command/undo-redo-action-handler.js +72 -0
  32. package/lib/common/command/undo-redo-action-handler.js.map +1 -0
  33. package/lib/common/di/client-session-module.d.ts +1 -1
  34. package/lib/common/di/client-session-module.d.ts.map +1 -1
  35. package/lib/common/di/client-session-module.js +2 -2
  36. package/lib/common/di/client-session-module.js.map +1 -1
  37. package/lib/common/di/diagram-module.d.ts +3 -0
  38. package/lib/common/di/diagram-module.d.ts.map +1 -1
  39. package/lib/common/di/diagram-module.js +12 -0
  40. package/lib/common/di/diagram-module.js.map +1 -1
  41. package/lib/common/di/glsp-module.d.ts +3 -1
  42. package/lib/common/di/glsp-module.d.ts.map +1 -1
  43. package/lib/common/di/glsp-module.js +0 -15
  44. package/lib/common/di/glsp-module.js.map +1 -1
  45. package/lib/common/di/multi-binding.d.ts +19 -4
  46. package/lib/common/di/multi-binding.d.ts.map +1 -1
  47. package/lib/common/di/multi-binding.js.map +1 -1
  48. package/lib/common/di/server-module.d.ts +1 -6
  49. package/lib/common/di/server-module.d.ts.map +1 -1
  50. package/lib/common/di/server-module.js +21 -17
  51. package/lib/common/di/server-module.js.map +1 -1
  52. package/lib/common/features/contextactions/tool-palette-item-provider.d.ts +1 -1
  53. package/lib/common/features/contextactions/tool-palette-item-provider.d.ts.map +1 -1
  54. package/lib/common/features/contextactions/tool-palette-item-provider.js +2 -4
  55. package/lib/common/features/contextactions/tool-palette-item-provider.js.map +1 -1
  56. package/lib/common/{gmodel → features/layout}/computed-bounds-action-handler.d.ts +8 -3
  57. package/lib/common/features/layout/computed-bounds-action-handler.d.ts.map +1 -0
  58. package/lib/common/{gmodel → features/layout}/computed-bounds-action-handler.js +9 -4
  59. package/lib/common/features/layout/computed-bounds-action-handler.js.map +1 -0
  60. package/lib/common/features/layout/layout-operation-handler.d.ts +12 -3
  61. package/lib/common/features/layout/layout-operation-handler.d.ts.map +1 -1
  62. package/lib/common/features/layout/layout-operation-handler.js +26 -10
  63. package/lib/common/features/layout/layout-operation-handler.js.map +1 -1
  64. package/lib/common/features/model/model-state.d.ts +0 -2
  65. package/lib/common/features/model/model-state.d.ts.map +1 -1
  66. package/lib/common/features/model/model-state.js +0 -1
  67. package/lib/common/features/model/model-state.js.map +1 -1
  68. package/lib/common/features/model/model-submission-handler.d.ts +2 -0
  69. package/lib/common/features/model/model-submission-handler.d.ts.map +1 -1
  70. package/lib/common/features/model/model-submission-handler.js +7 -2
  71. package/lib/common/features/model/model-submission-handler.js.map +1 -1
  72. package/lib/common/features/model/save-model-action-handler.d.ts +2 -2
  73. package/lib/common/features/model/save-model-action-handler.d.ts.map +1 -1
  74. package/lib/common/features/model/save-model-action-handler.js +5 -5
  75. package/lib/common/features/model/save-model-action-handler.js.map +1 -1
  76. package/lib/common/gmodel/apply-label-edit-operation-handler.d.ts +4 -5
  77. package/lib/common/gmodel/apply-label-edit-operation-handler.d.ts.map +1 -1
  78. package/lib/common/gmodel/apply-label-edit-operation-handler.js +12 -21
  79. package/lib/common/gmodel/apply-label-edit-operation-handler.js.map +1 -1
  80. package/lib/common/gmodel/change-bounds-operation-handler.d.ts +9 -6
  81. package/lib/common/gmodel/change-bounds-operation-handler.d.ts.map +1 -1
  82. package/lib/common/gmodel/change-bounds-operation-handler.js +14 -14
  83. package/lib/common/gmodel/change-bounds-operation-handler.js.map +1 -1
  84. package/lib/common/gmodel/change-routing-points-operation-handler.d.ts +5 -5
  85. package/lib/common/gmodel/change-routing-points-operation-handler.d.ts.map +1 -1
  86. package/lib/common/gmodel/change-routing-points-operation-handler.js +11 -14
  87. package/lib/common/gmodel/change-routing-points-operation-handler.js.map +1 -1
  88. package/lib/common/{operations → gmodel}/cut-operation-handler.d.ts +5 -4
  89. package/lib/common/gmodel/cut-operation-handler.d.ts.map +1 -0
  90. package/lib/common/{operations → gmodel}/cut-operation-handler.js +13 -11
  91. package/lib/common/gmodel/cut-operation-handler.js.map +1 -0
  92. package/lib/common/gmodel/delete-operation-handler.d.ts +6 -6
  93. package/lib/common/gmodel/delete-operation-handler.d.ts.map +1 -1
  94. package/lib/common/gmodel/delete-operation-handler.js +13 -10
  95. package/lib/common/gmodel/delete-operation-handler.js.map +1 -1
  96. package/lib/common/gmodel/gmodel-create-edge-operation-handler.d.ts +11 -7
  97. package/lib/common/gmodel/gmodel-create-edge-operation-handler.d.ts.map +1 -1
  98. package/lib/common/gmodel/gmodel-create-edge-operation-handler.js +12 -13
  99. package/lib/common/gmodel/gmodel-create-edge-operation-handler.js.map +1 -1
  100. package/lib/common/gmodel/gmodel-create-node-operation-handler.d.ts +32 -5
  101. package/lib/common/gmodel/gmodel-create-node-operation-handler.d.ts.map +1 -1
  102. package/lib/common/gmodel/gmodel-create-node-operation-handler.js +45 -3
  103. package/lib/common/gmodel/gmodel-create-node-operation-handler.js.map +1 -1
  104. package/lib/common/gmodel/gmodel-diagram-module.d.ts +8 -8
  105. package/lib/common/gmodel/gmodel-diagram-module.d.ts.map +1 -1
  106. package/lib/common/gmodel/gmodel-diagram-module.js +15 -21
  107. package/lib/common/gmodel/gmodel-diagram-module.js.map +1 -1
  108. package/lib/{node/launch/socket-server-launcher.spec.d.ts → common/gmodel/gmodel-operation-handler.d.ts} +9 -3
  109. package/lib/common/gmodel/gmodel-operation-handler.d.ts.map +1 -0
  110. package/lib/common/{protocol/glsp-client-proxy.js → gmodel/gmodel-operation-handler.js} +25 -35
  111. package/lib/common/gmodel/gmodel-operation-handler.js.map +1 -0
  112. package/lib/common/gmodel/index.d.ts +2 -1
  113. package/lib/common/gmodel/index.d.ts.map +1 -1
  114. package/lib/common/gmodel/index.js +2 -1
  115. package/lib/common/gmodel/index.js.map +1 -1
  116. package/lib/common/gmodel/paste-operation-handler.d.ts +7 -6
  117. package/lib/common/gmodel/paste-operation-handler.d.ts.map +1 -1
  118. package/lib/common/gmodel/paste-operation-handler.js +20 -15
  119. package/lib/common/gmodel/paste-operation-handler.js.map +1 -1
  120. package/lib/common/gmodel/reconnect-edge-operation-handler.d.ts +5 -5
  121. package/lib/common/gmodel/reconnect-edge-operation-handler.d.ts.map +1 -1
  122. package/lib/common/gmodel/reconnect-edge-operation-handler.js +11 -14
  123. package/lib/common/gmodel/reconnect-edge-operation-handler.js.map +1 -1
  124. package/lib/common/index.d.ts +5 -3
  125. package/lib/common/index.d.ts.map +1 -1
  126. package/lib/common/index.js +5 -3
  127. package/lib/common/index.js.map +1 -1
  128. package/lib/common/launch/glsp-server-launcher.d.ts +8 -7
  129. package/lib/common/launch/glsp-server-launcher.d.ts.map +1 -1
  130. package/lib/common/launch/glsp-server-launcher.js +27 -4
  131. package/lib/common/launch/glsp-server-launcher.js.map +1 -1
  132. package/lib/common/launch/jsonrpc-server-launcher.d.ts +38 -0
  133. package/lib/common/launch/jsonrpc-server-launcher.d.ts.map +1 -0
  134. package/lib/common/launch/jsonrpc-server-launcher.js +84 -0
  135. package/lib/common/launch/jsonrpc-server-launcher.js.map +1 -0
  136. package/lib/common/operations/compound-operation-handler.d.ts +5 -5
  137. package/lib/common/operations/compound-operation-handler.d.ts.map +1 -1
  138. package/lib/common/operations/compound-operation-handler.js +37 -9
  139. package/lib/common/operations/compound-operation-handler.js.map +1 -1
  140. package/lib/common/operations/create-operation-handler.d.ts +8 -40
  141. package/lib/common/operations/create-operation-handler.d.ts.map +1 -1
  142. package/lib/common/operations/create-operation-handler.js +26 -85
  143. package/lib/common/operations/create-operation-handler.js.map +1 -1
  144. package/lib/common/operations/operation-action-handler.d.ts +10 -1
  145. package/lib/common/operations/operation-action-handler.d.ts.map +1 -1
  146. package/lib/common/operations/operation-action-handler.js +37 -22
  147. package/lib/common/operations/operation-action-handler.js.map +1 -1
  148. package/lib/common/operations/operation-handler-registry.d.ts +11 -2
  149. package/lib/common/operations/operation-handler-registry.d.ts.map +1 -1
  150. package/lib/common/operations/operation-handler-registry.js +31 -2
  151. package/lib/common/operations/operation-handler-registry.js.map +1 -1
  152. package/lib/common/operations/operation-handler.d.ts +28 -11
  153. package/lib/common/operations/operation-handler.d.ts.map +1 -1
  154. package/lib/common/operations/operation-handler.js +50 -1
  155. package/lib/common/operations/operation-handler.js.map +1 -1
  156. package/lib/common/protocol/glsp-server.d.ts +4 -104
  157. package/lib/common/protocol/glsp-server.d.ts.map +1 -1
  158. package/lib/common/protocol/glsp-server.js +13 -20
  159. package/lib/common/protocol/glsp-server.js.map +1 -1
  160. package/lib/common/session/client-session-factory.d.ts +1 -2
  161. package/lib/common/session/client-session-factory.d.ts.map +1 -1
  162. package/lib/common/session/client-session-factory.js +17 -2
  163. package/lib/common/session/client-session-factory.js.map +1 -1
  164. package/lib/common/session/client-session-manager.d.ts +1 -3
  165. package/lib/common/session/client-session-manager.d.ts.map +1 -1
  166. package/lib/common/session/client-session-manager.js.map +1 -1
  167. package/lib/{browser/di → common/utils}/console-logger.d.ts +7 -1
  168. package/lib/common/utils/console-logger.d.ts.map +1 -0
  169. package/lib/{browser/di → common/utils}/console-logger.js +26 -8
  170. package/lib/common/utils/console-logger.js.map +1 -0
  171. package/lib/common/utils/layout-util.d.ts +1 -1
  172. package/lib/common/utils/layout-util.d.ts.map +1 -1
  173. package/lib/common/utils/layout-util.js +3 -3
  174. package/lib/common/utils/layout-util.js.map +1 -1
  175. package/lib/common/utils/logger.d.ts +21 -0
  176. package/lib/common/utils/logger.d.ts.map +1 -1
  177. package/lib/common/utils/logger.js +12 -1
  178. package/lib/common/utils/logger.js.map +1 -1
  179. package/lib/node/di/app-module.d.ts +2 -2
  180. package/lib/node/di/app-module.d.ts.map +1 -1
  181. package/lib/node/di/app-module.js +10 -35
  182. package/lib/node/di/app-module.js.map +1 -1
  183. package/lib/node/index.d.ts +1 -0
  184. package/lib/node/index.d.ts.map +1 -1
  185. package/lib/node/index.js +1 -0
  186. package/lib/node/index.js.map +1 -1
  187. package/lib/node/launch/cli-parser.d.ts +2 -3
  188. package/lib/node/launch/cli-parser.d.ts.map +1 -1
  189. package/lib/node/launch/cli-parser.js.map +1 -1
  190. package/lib/node/launch/socket-cli-parser.js +1 -1
  191. package/lib/node/launch/socket-cli-parser.js.map +1 -1
  192. package/lib/node/launch/socket-server-launcher.d.ts +4 -24
  193. package/lib/node/launch/socket-server-launcher.d.ts.map +1 -1
  194. package/lib/node/launch/socket-server-launcher.js +15 -34
  195. package/lib/node/launch/socket-server-launcher.js.map +1 -1
  196. package/lib/node/launch/websocket-server-launcher.d.ts +53 -0
  197. package/lib/node/launch/websocket-server-launcher.d.ts.map +1 -0
  198. package/lib/node/launch/websocket-server-launcher.js +121 -0
  199. package/lib/node/launch/websocket-server-launcher.js.map +1 -0
  200. package/package.json +8 -5
  201. package/src/browser/di/app-module.ts +4 -32
  202. package/src/browser/index.ts +0 -1
  203. package/src/browser/launch/worker-server-launcher.ts +20 -22
  204. package/src/common/actions/client-action-handler.ts +1 -2
  205. package/src/common/command/command-stack.spec.ts +239 -0
  206. package/src/common/command/command-stack.ts +106 -20
  207. package/src/common/command/command.spec.ts +92 -0
  208. package/src/common/command/command.ts +96 -7
  209. package/src/common/command/recording-command.spec.ts +74 -0
  210. package/src/common/command/recording-command.ts +119 -0
  211. package/src/common/command/undo-redo-action-handler.ts +57 -0
  212. package/src/common/di/client-session-module.ts +1 -1
  213. package/src/common/di/diagram-module.ts +13 -0
  214. package/src/common/di/glsp-module.ts +3 -1
  215. package/src/common/di/multi-binding.ts +4 -5
  216. package/src/common/di/server-module.ts +6 -21
  217. package/src/common/features/contextactions/tool-palette-item-provider.ts +2 -4
  218. package/src/common/{gmodel → features/layout}/computed-bounds-action-handler.ts +10 -5
  219. package/src/common/features/layout/layout-operation-handler.ts +26 -11
  220. package/src/common/features/model/model-state.ts +0 -3
  221. package/src/common/features/model/model-submission-handler.ts +6 -2
  222. package/src/common/features/model/save-model-action-handler.ts +5 -6
  223. package/src/common/gmodel/apply-label-edit-operation-handler.ts +13 -15
  224. package/src/common/gmodel/change-bounds-operation-handler.ts +12 -8
  225. package/src/common/gmodel/change-routing-points-operation-handler.ts +8 -7
  226. package/src/common/{operations → gmodel}/cut-operation-handler.ts +9 -8
  227. package/src/common/gmodel/delete-operation-handler.ts +16 -10
  228. package/src/common/gmodel/gmodel-create-edge-operation-handler.ts +16 -10
  229. package/src/common/gmodel/gmodel-create-node-operation-handler.ts +54 -6
  230. package/src/common/gmodel/gmodel-diagram-module.ts +22 -27
  231. package/src/common/gmodel/gmodel-operation-handler.ts +31 -0
  232. package/src/common/gmodel/index.ts +2 -1
  233. package/src/common/gmodel/paste-operation-handler.ts +19 -11
  234. package/src/common/gmodel/reconnect-edge-operation-handler.ts +8 -7
  235. package/src/common/index.ts +5 -3
  236. package/src/common/launch/glsp-server-launcher.ts +15 -9
  237. package/src/common/launch/jsonrpc-server-launcher.ts +95 -0
  238. package/src/common/operations/compound-operation-handler.ts +14 -12
  239. package/src/common/operations/create-operation-handler.ts +17 -74
  240. package/src/common/operations/operation-action-handler.ts +51 -27
  241. package/src/common/operations/operation-handler-registry.ts +18 -3
  242. package/src/common/operations/operation-handler.ts +38 -13
  243. package/src/common/protocol/glsp-server.spec.ts +7 -4
  244. package/src/common/protocol/glsp-server.ts +17 -132
  245. package/src/common/session/client-session-factory.spec.ts +1 -1
  246. package/src/common/session/client-session-factory.ts +1 -2
  247. package/src/common/session/client-session-manager.ts +1 -3
  248. package/src/common/test/mock-util.ts +47 -41
  249. package/src/{browser/di → common/utils}/console-logger.ts +19 -1
  250. package/src/common/utils/layout-util.ts +1 -1
  251. package/src/common/utils/logger.ts +16 -1
  252. package/src/node/di/app-module.ts +4 -13
  253. package/src/node/index.ts +1 -0
  254. package/src/node/launch/cli-parser.ts +2 -3
  255. package/src/node/launch/socket-cli-parser.ts +1 -1
  256. package/src/node/launch/socket-server-launcher.spec.ts +6 -0
  257. package/src/node/launch/socket-server-launcher.ts +19 -35
  258. package/src/node/launch/websocket-server-launcher.ts +138 -0
  259. package/lib/browser/di/console-logger.d.ts.map +0 -1
  260. package/lib/browser/di/console-logger.js.map +0 -1
  261. package/lib/common/actions/action-dispatcher.spec.d.ts +0 -2
  262. package/lib/common/actions/action-dispatcher.spec.d.ts.map +0 -1
  263. package/lib/common/actions/action-dispatcher.spec.js +0 -264
  264. package/lib/common/actions/action-dispatcher.spec.js.map +0 -1
  265. package/lib/common/actions/action-handler-registry.spec.d.ts +0 -2
  266. package/lib/common/actions/action-handler-registry.spec.d.ts.map +0 -1
  267. package/lib/common/actions/action-handler-registry.spec.js +0 -50
  268. package/lib/common/actions/action-handler-registry.spec.js.map +0 -1
  269. package/lib/common/actions/global-action-provider.spec.d.ts +0 -2
  270. package/lib/common/actions/global-action-provider.spec.d.ts.map +0 -1
  271. package/lib/common/actions/global-action-provider.spec.js +0 -70
  272. package/lib/common/actions/global-action-provider.spec.js.map +0 -1
  273. package/lib/common/di/binding-target.spec.d.ts +0 -2
  274. package/lib/common/di/binding-target.spec.d.ts.map +0 -1
  275. package/lib/common/di/binding-target.spec.js +0 -121
  276. package/lib/common/di/binding-target.spec.js.map +0 -1
  277. package/lib/common/di/multi-bindings.spec.d.ts +0 -2
  278. package/lib/common/di/multi-bindings.spec.d.ts.map +0 -1
  279. package/lib/common/di/multi-bindings.spec.js +0 -137
  280. package/lib/common/di/multi-bindings.spec.js.map +0 -1
  281. package/lib/common/diagram/request-type-hints-action-handler.spec.d.ts +0 -2
  282. package/lib/common/diagram/request-type-hints-action-handler.spec.d.ts.map +0 -1
  283. package/lib/common/diagram/request-type-hints-action-handler.spec.js +0 -57
  284. package/lib/common/diagram/request-type-hints-action-handler.spec.js.map +0 -1
  285. package/lib/common/features/contextactions/context-actions-provider-registry.spec.d.ts +0 -2
  286. package/lib/common/features/contextactions/context-actions-provider-registry.spec.d.ts.map +0 -1
  287. package/lib/common/features/contextactions/context-actions-provider-registry.spec.js +0 -34
  288. package/lib/common/features/contextactions/context-actions-provider-registry.spec.js.map +0 -1
  289. package/lib/common/features/contextactions/request-context-actions-handler.spec.d.ts +0 -2
  290. package/lib/common/features/contextactions/request-context-actions-handler.spec.d.ts.map +0 -1
  291. package/lib/common/features/contextactions/request-context-actions-handler.spec.js +0 -63
  292. package/lib/common/features/contextactions/request-context-actions-handler.spec.js.map +0 -1
  293. package/lib/common/features/contextactions/tool-palette-item-provider.spec.d.ts +0 -2
  294. package/lib/common/features/contextactions/tool-palette-item-provider.spec.d.ts.map +0 -1
  295. package/lib/common/features/contextactions/tool-palette-item-provider.spec.js +0 -48
  296. package/lib/common/features/contextactions/tool-palette-item-provider.spec.js.map +0 -1
  297. package/lib/common/features/directediting/context-edit-validator-registry.spec.d.ts +0 -2
  298. package/lib/common/features/directediting/context-edit-validator-registry.spec.d.ts.map +0 -1
  299. package/lib/common/features/directediting/context-edit-validator-registry.spec.js +0 -44
  300. package/lib/common/features/directediting/context-edit-validator-registry.spec.js.map +0 -1
  301. package/lib/common/features/directediting/request-edit-validation-handler.spec.d.ts +0 -2
  302. package/lib/common/features/directediting/request-edit-validation-handler.spec.d.ts.map +0 -1
  303. package/lib/common/features/directediting/request-edit-validation-handler.spec.js +0 -97
  304. package/lib/common/features/directediting/request-edit-validation-handler.spec.js.map +0 -1
  305. package/lib/common/features/model/gmodel-serializer.spec.d.ts +0 -2
  306. package/lib/common/features/model/gmodel-serializer.spec.d.ts.map +0 -1
  307. package/lib/common/features/model/gmodel-serializer.spec.js +0 -124
  308. package/lib/common/features/model/gmodel-serializer.spec.js.map +0 -1
  309. package/lib/common/gmodel/apply-label-edit-operation-handler.spec.d.ts +0 -2
  310. package/lib/common/gmodel/apply-label-edit-operation-handler.spec.d.ts.map +0 -1
  311. package/lib/common/gmodel/apply-label-edit-operation-handler.spec.js +0 -38
  312. package/lib/common/gmodel/apply-label-edit-operation-handler.spec.js.map +0 -1
  313. package/lib/common/gmodel/computed-bounds-action-handler.d.ts.map +0 -1
  314. package/lib/common/gmodel/computed-bounds-action-handler.js.map +0 -1
  315. package/lib/common/operations/cut-operation-handler.d.ts.map +0 -1
  316. package/lib/common/operations/cut-operation-handler.js.map +0 -1
  317. package/lib/common/operations/operation-handler-registry.spec.d.ts +0 -2
  318. package/lib/common/operations/operation-handler-registry.spec.d.ts.map +0 -1
  319. package/lib/common/operations/operation-handler-registry.spec.js +0 -50
  320. package/lib/common/operations/operation-handler-registry.spec.js.map +0 -1
  321. package/lib/common/protocol/glsp-client-proxy.d.ts +0 -45
  322. package/lib/common/protocol/glsp-client-proxy.d.ts.map +0 -1
  323. package/lib/common/protocol/glsp-client-proxy.js.map +0 -1
  324. package/lib/common/protocol/glsp-server-listener.d.ts +0 -37
  325. package/lib/common/protocol/glsp-server-listener.d.ts.map +0 -1
  326. package/lib/common/protocol/glsp-server-listener.js +0 -5
  327. package/lib/common/protocol/glsp-server-listener.js.map +0 -1
  328. package/lib/common/protocol/glsp-server.spec.d.ts +0 -2
  329. package/lib/common/protocol/glsp-server.spec.d.ts.map +0 -1
  330. package/lib/common/protocol/glsp-server.spec.js +0 -119
  331. package/lib/common/protocol/glsp-server.spec.js.map +0 -1
  332. package/lib/common/session/client-session-factory.spec.d.ts +0 -2
  333. package/lib/common/session/client-session-factory.spec.d.ts.map +0 -1
  334. package/lib/common/session/client-session-factory.spec.js +0 -56
  335. package/lib/common/session/client-session-factory.spec.js.map +0 -1
  336. package/lib/common/session/client-session-manager.spec.d.ts +0 -2
  337. package/lib/common/session/client-session-manager.spec.d.ts.map +0 -1
  338. package/lib/common/session/client-session-manager.spec.js +0 -74
  339. package/lib/common/session/client-session-manager.spec.js.map +0 -1
  340. package/lib/common/test/mock-util.d.ts +0 -110
  341. package/lib/common/test/mock-util.d.ts.map +0 -1
  342. package/lib/common/test/mock-util.js +0 -211
  343. package/lib/common/test/mock-util.js.map +0 -1
  344. package/lib/common/utils/promise-queue.spec.d.ts +0 -2
  345. package/lib/common/utils/promise-queue.spec.d.ts.map +0 -1
  346. package/lib/common/utils/promise-queue.spec.js +0 -117
  347. package/lib/common/utils/promise-queue.spec.js.map +0 -1
  348. package/lib/common/utils/registry.spec.d.ts +0 -2
  349. package/lib/common/utils/registry.spec.d.ts.map +0 -1
  350. package/lib/common/utils/registry.spec.js +0 -199
  351. package/lib/common/utils/registry.spec.js.map +0 -1
  352. package/lib/node/launch/cli-parser.spec.d.ts +0 -2
  353. package/lib/node/launch/cli-parser.spec.d.ts.map +0 -1
  354. package/lib/node/launch/cli-parser.spec.js +0 -56
  355. package/lib/node/launch/cli-parser.spec.js.map +0 -1
  356. package/lib/node/launch/socket-cli-parser.spec.d.ts +0 -2
  357. package/lib/node/launch/socket-cli-parser.spec.d.ts.map +0 -1
  358. package/lib/node/launch/socket-cli-parser.spec.js +0 -66
  359. package/lib/node/launch/socket-cli-parser.spec.js.map +0 -1
  360. package/lib/node/launch/socket-server-launcher.spec.d.ts.map +0 -1
  361. package/lib/node/launch/socket-server-launcher.spec.js +0 -70
  362. package/lib/node/launch/socket-server-launcher.spec.js.map +0 -1
  363. package/src/common/gmodel/apply-label-edit-operation-handler.spec.ts +0 -40
  364. package/src/common/protocol/glsp-client-proxy.ts +0 -65
  365. package/src/common/protocol/glsp-server-listener.ts +0 -39
@@ -38,6 +38,8 @@ __exportStar(require("./actions/client-action-handler"), exports);
38
38
  __exportStar(require("./actions/global-action-provider"), exports);
39
39
  __exportStar(require("./command/command"), exports);
40
40
  __exportStar(require("./command/command-stack"), exports);
41
+ __exportStar(require("./command/recording-command"), exports);
42
+ __exportStar(require("./command/undo-redo-action-handler"), exports);
41
43
  __exportStar(require("./di/binding-target"), exports);
42
44
  __exportStar(require("./di/client-session-module"), exports);
43
45
  __exportStar(require("./di/diagram-module"), exports);
@@ -58,6 +60,7 @@ __exportStar(require("./features/directediting/context-edit-validator"), exports
58
60
  __exportStar(require("./features/directediting/context-edit-validator-registry"), exports);
59
61
  __exportStar(require("./features/directediting/label-edit-validator"), exports);
60
62
  __exportStar(require("./features/directediting/request-edit-validation-handler"), exports);
63
+ __exportStar(require("./features/layout/computed-bounds-action-handler"), exports);
61
64
  __exportStar(require("./features/layout/layout-engine"), exports);
62
65
  __exportStar(require("./features/layout/layout-operation-handler"), exports);
63
66
  __exportStar(require("./features/model/gmodel-factory"), exports);
@@ -83,13 +86,10 @@ __exportStar(require("./gmodel/index"), exports);
83
86
  __exportStar(require("./launch/glsp-server-launcher"), exports);
84
87
  __exportStar(require("./operations/compound-operation-handler"), exports);
85
88
  __exportStar(require("./operations/create-operation-handler"), exports);
86
- __exportStar(require("./operations/cut-operation-handler"), exports);
87
89
  __exportStar(require("./operations/operation-action-handler"), exports);
88
90
  __exportStar(require("./operations/operation-handler"), exports);
89
91
  __exportStar(require("./operations/operation-handler-registry"), exports);
90
- __exportStar(require("./protocol/glsp-client-proxy"), exports);
91
92
  __exportStar(require("./protocol/glsp-server"), exports);
92
- __exportStar(require("./protocol/glsp-server-listener"), exports);
93
93
  __exportStar(require("./session/client-session"), exports);
94
94
  __exportStar(require("./session/client-session-factory"), exports);
95
95
  __exportStar(require("./session/client-session-initializer"), exports);
@@ -97,7 +97,9 @@ __exportStar(require("./session/client-session-listener"), exports);
97
97
  __exportStar(require("./session/client-session-manager"), exports);
98
98
  __exportStar(require("./utils/args-util"), exports);
99
99
  __exportStar(require("./utils/client-options-util"), exports);
100
+ __exportStar(require("./utils/console-logger"), exports);
100
101
  __exportStar(require("./utils/glsp-server-error"), exports);
102
+ __exportStar(require("./utils/layout-util"), exports);
101
103
  __exportStar(require("./utils/logger"), exports);
102
104
  __exportStar(require("./utils/promise-queue"), exports);
103
105
  __exportStar(require("./utils/registry"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;;;;;;;;AAElF,sDAAoC;AACpC,yDAAuC;AACvC,8DAA4C;AAC5C,2DAAyC;AACzC,oEAAkD;AAClD,kEAAgD;AAChD,mEAAiD;AACjD,oDAAkC;AAClC,0DAAwC;AACxC,sDAAoC;AACpC,6DAA2C;AAC3C,sDAAoC;AACpC,mDAAiC;AACjC,qDAAmC;AACnC,qDAAmC;AACnC,2DAAyC;AACzC,kEAAgD;AAChD,8EAA4D;AAC5D,6FAA2E;AAC3E,4FAA0E;AAC1E,qFAAmE;AACnE,8FAA4E;AAC5E,uFAAqE;AACrE,4FAA0E;AAC1E,uFAAqE;AACrE,kFAAgE;AAChE,2FAAyE;AACzE,gFAA8D;AAC9D,2FAAyE;AACzE,kEAAgD;AAChD,6EAA2D;AAC3D,kEAAgD;AAChD,gEAA8C;AAC9C,qEAAmD;AACnD,+DAA6C;AAC7C,4EAA0D;AAC1D,gFAA8D;AAC9D,6EAA2D;AAC3D,wEAAsD;AACtD,4EAA0D;AAC1D,mFAAiE;AACjE,4FAA0E;AAC1E,qFAAmE;AACnE,mFAAiE;AACjE,kGAAgF;AAChF,kGAAgF;AAChF,uEAAqD;AACrD,sFAAoE;AACpE,wEAAsD;AACtD,gFAA8D;AAC9D,iDAA+B;AAC/B,gEAA8C;AAC9C,0EAAwD;AACxD,wEAAsD;AACtD,qEAAmD;AACnD,wEAAsD;AACtD,iEAA+C;AAC/C,0EAAwD;AACxD,+DAA6C;AAC7C,yDAAuC;AACvC,kEAAgD;AAChD,2DAAyC;AACzC,mEAAiD;AACjD,uEAAqD;AACrD,oEAAkD;AAClD,mEAAiD;AACjD,oDAAkC;AAClC,8DAA4C;AAC5C,4DAA0C;AAC1C,iDAA+B;AAC/B,wDAAsC;AACtC,mDAAiC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;;;;;;;;AAElF,sDAAoC;AACpC,yDAAuC;AACvC,8DAA4C;AAC5C,2DAAyC;AACzC,oEAAkD;AAClD,kEAAgD;AAChD,mEAAiD;AACjD,oDAAkC;AAClC,0DAAwC;AACxC,8DAA4C;AAC5C,qEAAmD;AACnD,sDAAoC;AACpC,6DAA2C;AAC3C,sDAAoC;AACpC,mDAAiC;AACjC,qDAAmC;AACnC,qDAAmC;AACnC,2DAAyC;AACzC,kEAAgD;AAChD,8EAA4D;AAC5D,6FAA2E;AAC3E,4FAA0E;AAC1E,qFAAmE;AACnE,8FAA4E;AAC5E,uFAAqE;AACrE,4FAA0E;AAC1E,uFAAqE;AACrE,kFAAgE;AAChE,2FAAyE;AACzE,gFAA8D;AAC9D,2FAAyE;AACzE,mFAAiE;AACjE,kEAAgD;AAChD,6EAA2D;AAC3D,kEAAgD;AAChD,gEAA8C;AAC9C,qEAAmD;AACnD,+DAA6C;AAC7C,4EAA0D;AAC1D,gFAA8D;AAC9D,6EAA2D;AAC3D,wEAAsD;AACtD,4EAA0D;AAC1D,mFAAiE;AACjE,4FAA0E;AAC1E,qFAAmE;AACnE,mFAAiE;AACjE,kGAAgF;AAChF,kGAAgF;AAChF,uEAAqD;AACrD,sFAAoE;AACpE,wEAAsD;AACtD,gFAA8D;AAC9D,iDAA+B;AAC/B,gEAA8C;AAC9C,0EAAwD;AACxD,wEAAsD;AACtD,wEAAsD;AACtD,iEAA+C;AAC/C,0EAAwD;AACxD,yDAAuC;AACvC,2DAAyC;AACzC,mEAAiD;AACjD,uEAAqD;AACrD,oEAAkD;AAClD,mEAAiD;AACjD,oDAAkC;AAClC,8DAA4C;AAC5C,yDAAuC;AACvC,4DAA0C;AAC1C,sDAAoC;AACpC,iDAA+B;AAC/B,wDAAsC;AACtC,mDAAiC"}
@@ -13,22 +13,23 @@
13
13
  *
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
- import { MaybePromise } from '@eclipse-glsp/protocol';
16
+ import { Disposable, DisposableCollection, MaybePromise } from '@eclipse-glsp/protocol';
17
17
  import { Container, ContainerModule } from 'inversify';
18
18
  import { ServerModule } from '../di/server-module';
19
19
  import { Logger } from '../utils/logger';
20
- export declare const START_UP_COMPLETE_MSG = "[GLSP-Server]:Startup completed";
21
- export declare abstract class GLSPServerLauncher<T = undefined> {
20
+ export declare abstract class GLSPServerLauncher<T> implements Disposable {
22
21
  protected logger: Logger;
23
22
  protected _modules: ContainerModule[];
24
23
  protected running: boolean;
24
+ protected toDispose: DisposableCollection;
25
25
  protected parentContainer?: Container;
26
26
  configure(serverModule: ServerModule, ...additionalModules: ContainerModule[]): void;
27
- createContainer(): Container;
28
- start(startParams?: T): MaybePromise<void>;
29
- protected abstract run(startParams?: T): MaybePromise<void>;
27
+ createContainer(...additionalModules: ContainerModule[]): Container;
28
+ start(startParams: T): MaybePromise<void>;
29
+ protected abstract run(startParams: T): MaybePromise<void>;
30
30
  shutdown(): MaybePromise<void>;
31
- protected abstract stop(): MaybePromise<void>;
31
+ protected stop(): MaybePromise<void>;
32
+ dispose(): void;
32
33
  get modules(): ContainerModule[];
33
34
  }
34
35
  //# sourceMappingURL=glsp-server-launcher.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"glsp-server-launcher.d.ts","sourceRoot":"","sources":["../../../src/common/launch/glsp-server-launcher.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,eAAe,EAAgC,MAAM,WAAW,CAAC;AACrF,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,eAAO,MAAM,qBAAqB,oCAAoC,CAAC;AAEvE,8BACsB,kBAAkB,CAAC,CAAC,GAAG,SAAS;IAClC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC;IAEzC,SAAS,CAAC,QAAQ,EAAE,eAAe,EAAE,CAAM;IAC3C,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC;IAEa,SAAS,CAAC,eAAe,CAAC,EAAE,SAAS,CAAC;IAE9E,SAAS,CAAC,YAAY,EAAE,YAAY,EAAE,GAAG,iBAAiB,EAAE,eAAe,EAAE,GAAG,IAAI;IAIpF,eAAe,IAAI,SAAS;IAM5B,KAAK,CAAC,WAAW,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,IAAI,CAAC;IAQ1C,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,IAAI,CAAC;IAE3D,QAAQ,IA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AAO,IAAI,eAAe,EAAE,CAK/B;CACJ"}
@@ -9,21 +9,37 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.GLSPServerLauncher = exports.START_UP_COMPLETE_MSG = void 0;
12
+ exports.GLSPServerLauncher = void 0;
13
+ /********************************************************************************
14
+ * Copyright (c) 2022-2023 STMicroelectronics and others.
15
+ *
16
+ * This program and the accompanying materials are made available under the
17
+ * terms of the Eclipse Public License v. 2.0 which is available at
18
+ * http://www.eclipse.org/legal/epl-2.0.
19
+ *
20
+ * This Source Code may also be made available under the following Secondary
21
+ * Licenses when the conditions for such availability set forth in the Eclipse
22
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
23
+ * with the GNU Classpath Exception which is available at
24
+ * https://www.gnu.org/software/classpath/license.html.
25
+ *
26
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
27
+ ********************************************************************************/
28
+ const protocol_1 = require("@eclipse-glsp/protocol");
13
29
  const inversify_1 = require("inversify");
14
30
  const service_identifiers_1 = require("../di/service-identifiers");
15
31
  const logger_1 = require("../utils/logger");
16
- exports.START_UP_COMPLETE_MSG = '[GLSP-Server]:Startup completed';
17
32
  let GLSPServerLauncher = class GLSPServerLauncher {
18
33
  constructor() {
19
34
  this._modules = [];
35
+ this.toDispose = new protocol_1.DisposableCollection();
20
36
  }
21
37
  configure(serverModule, ...additionalModules) {
22
38
  this._modules.push(serverModule, ...additionalModules);
23
39
  }
24
- createContainer() {
40
+ createContainer(...additionalModules) {
25
41
  const container = this.parentContainer ? this.parentContainer.createChild() : new inversify_1.Container();
26
- container.load(...this._modules);
42
+ container.load(...this._modules, ...additionalModules);
27
43
  return container;
28
44
  }
29
45
  start(startParams) {
@@ -35,12 +51,19 @@ let GLSPServerLauncher = class GLSPServerLauncher {
35
51
  }
36
52
  shutdown() {
37
53
  if (this.running) {
54
+ this.logger.info('Shutdown GLSPServerLauncher');
38
55
  const result = this.stop();
39
56
  this.running = false;
40
57
  return result;
41
58
  }
42
59
  this.logger.warn('Could not stop launcher. Launcher is not running!');
43
60
  }
61
+ stop() {
62
+ this.dispose();
63
+ }
64
+ dispose() {
65
+ this.toDispose.dispose();
66
+ }
44
67
  get modules() {
45
68
  if (!this._modules) {
46
69
  throw new Error('The GLSPServerLauncher has not been configured yet');
@@ -1 +1 @@
1
- {"version":3,"file":"glsp-server-launcher.js","sourceRoot":"","sources":["../../../src/common/launch/glsp-server-launcher.ts"],"names":[],"mappings":";;;;;;;;;;;;AAgBA,yCAAqF;AAErF,mEAA+D;AAC/D,4CAAyC;AAE5B,QAAA,qBAAqB,GAAG,iCAAiC,CAAC;AAGhE,IAAe,kBAAkB,GAAjC,MAAe,kBAAkB;IAAjC;QAGO,aAAQ,GAAsB,EAAE,CAAC;IA0C/C,CAAC;IArCG,SAAS,CAAC,YAA0B,EAAE,GAAG,iBAAoC;QACzE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,EAAE,GAAG,iBAAiB,CAAC,CAAC;IAC3D,CAAC;IAED,eAAe;QACX,MAAM,SAAS,GAAG,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,IAAI,qBAAS,EAAE,CAAC;QAC9F,SAAS,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC;QACjC,OAAO,SAAS,CAAC;IACrB,CAAC;IAED,KAAK,CAAC,WAAe;QACjB,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;YACf,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;YACpB,OAAO,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;SAChC;QACD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,wDAAwD,CAAC,CAAC;IAC/E,C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AP5D,kBAAkB;IADvC,IAAA,sBAAU,GAAE;GACS,kBAAkB,CAqDvC;AArDqB,gDAAkB"}
@@ -0,0 +1,38 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2023 EclipseSource and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0.
7
+ *
8
+ * This Source Code may also be made available under the following Secondary
9
+ * Licenses when the conditions for such availability set forth in the Eclipse
10
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ * with the GNU Classpath Exception which is available at
12
+ * https://www.gnu.org/software/classpath/license.html.
13
+ *
14
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
+ ********************************************************************************/
16
+ import { GLSPClientProxy, GLSPServer } from '@eclipse-glsp/protocol';
17
+ import { Container, ContainerModule } from 'inversify';
18
+ import * as jsonrpc from 'vscode-jsonrpc';
19
+ import { Logger } from '../utils/logger';
20
+ import { GLSPServerLauncher } from './glsp-server-launcher';
21
+ export declare const START_UP_COMPLETE_MSG = "[GLSP-Server]:Startup completed. Accepting requests on port:";
22
+ export interface JsonRpcServerInstance {
23
+ server: GLSPServer;
24
+ clientConnection: jsonrpc.MessageConnection;
25
+ container: Container;
26
+ }
27
+ export declare abstract class JsonRpcGLSPServerLauncher<T> extends GLSPServerLauncher<T> {
28
+ protected logger: Logger;
29
+ protected serverInstances: Map<jsonrpc.MessageConnection, JsonRpcServerInstance>;
30
+ protected startupCompleteMessage: string;
31
+ constructor();
32
+ protected disposeServerInstance(instance: JsonRpcServerInstance): void;
33
+ protected createServerInstance(clientConnection: jsonrpc.MessageConnection): void;
34
+ protected createJsonRpcModule(clientConnection: jsonrpc.MessageConnection): ContainerModule;
35
+ protected configureClientConnection(serverInstance: JsonRpcServerInstance): void;
36
+ protected createClientProxy(serverInstance: JsonRpcServerInstance): GLSPClientProxy;
37
+ }
38
+ //# sourceMappingURL=jsonrpc-server-launcher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsonrpc-server-launcher.d.ts","sourceRoot":"","sources":["../../../src/common/launch/jsonrpc-server-launcher.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAEH,eAAe,EACf,UAAU,EAIb,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,eAAe,EAAsB,MAAM,WAAW,CAAC;AAC3E,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D,eAAO,MAAM,qBAAqB,iEAAiE,CAAC;AAEpG,MAAM,WAAW,qBAAqB;IAClC,MAAM,EAAE,UAAU,CAAC;IACnB,gBAAgB,EAAE,OAAO,CAAC,iBAAiB,CAAC;IAC5C,SAAS,EAAE,SAAS,CAAC;CACxB;AAED,8BACsB,yBAAyB,CAAC,CAAC,CAAE,SAAQ,kBAAkB,CAAC,CAAC,CAAC;IAC5E,UACmB,MAAM,EAAE,MAAM,CAAC;IAElC,SAAS,CAAC,eAAe,wDAA+D;IACxF,SAAS,CAAC,sBAAsB,SAAyB;;IAWzD,SAAS,CAAC,qBAAqB,CAAC,QAAQ,EAAE,qBAAqB,GAAG,IAAI;IAOtE,SAAS,CAAC,oBAAoB,CAAC,gBAAgB,EAAE,OAAO,CAAC,iBAAiB,GAAG,IAAI;IAQjF,SAAS,CAAC,mBAAmB,CAAC,gBAAgB,EAAE,OAAO,CAAC,iBAAiB,GAAG,eAAe;IAU3F,SAAS,CAAC,yBAAyB,CAAC,cAAc,EAAE,qBAAqB,GAAG,IAAI;IAUhF,SAAS,CAAC,iBAAiB,CAAC,cAAc,EAAE,qBAAqB,GAAG,eAAe;CAKtF"}
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ /********************************************************************************
3
+ * Copyright (c) 2023 EclipseSource 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 __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
22
+ };
23
+ var __metadata = (this && this.__metadata) || function (k, v) {
24
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
25
+ };
26
+ Object.defineProperty(exports, "__esModule", { value: true });
27
+ exports.JsonRpcGLSPServerLauncher = exports.START_UP_COMPLETE_MSG = void 0;
28
+ const protocol_1 = require("@eclipse-glsp/protocol");
29
+ const inversify_1 = require("inversify");
30
+ const logger_1 = require("../utils/logger");
31
+ const glsp_server_launcher_1 = require("./glsp-server-launcher");
32
+ exports.START_UP_COMPLETE_MSG = '[GLSP-Server]:Startup completed. Accepting requests on port:';
33
+ let JsonRpcGLSPServerLauncher = class JsonRpcGLSPServerLauncher extends glsp_server_launcher_1.GLSPServerLauncher {
34
+ constructor() {
35
+ super();
36
+ this.serverInstances = new Map();
37
+ this.startupCompleteMessage = exports.START_UP_COMPLETE_MSG;
38
+ this.toDispose.push(protocol_1.Disposable.create(() => {
39
+ this.serverInstances.forEach(instance => this.disposeServerInstance(instance));
40
+ }));
41
+ }
42
+ disposeServerInstance(instance) {
43
+ this.serverInstances.delete(instance.clientConnection);
44
+ instance.server.shutdown();
45
+ instance.container.unbindAll();
46
+ instance.clientConnection.dispose();
47
+ }
48
+ createServerInstance(clientConnection) {
49
+ const container = this.createContainer(this.createJsonRpcModule(clientConnection));
50
+ const server = container.get(protocol_1.GLSPServer);
51
+ const instance = { container, clientConnection, server };
52
+ this.serverInstances.set(clientConnection, instance);
53
+ this.configureClientConnection(instance);
54
+ }
55
+ createJsonRpcModule(clientConnection) {
56
+ return new inversify_1.ContainerModule(bind => {
57
+ bind(protocol_1.GLSPClientProxy).toDynamicValue(ctx => {
58
+ const proxy = ctx.container.resolve(protocol_1.JsonrpcClientProxy);
59
+ proxy.initialize(clientConnection);
60
+ return proxy;
61
+ });
62
+ });
63
+ }
64
+ configureClientConnection(serverInstance) {
65
+ (0, protocol_1.configureClientConnection)(serverInstance.clientConnection, serverInstance.server);
66
+ serverInstance.clientConnection.onNotification(protocol_1.JsonrpcGLSPClient.ShutdownNotification, () => this.disposeServerInstance(serverInstance));
67
+ this.logger.info('Starting GLSP server connection');
68
+ }
69
+ createClientProxy(serverInstance) {
70
+ const proxy = serverInstance.container.resolve(protocol_1.JsonrpcClientProxy);
71
+ proxy.initialize(serverInstance.clientConnection);
72
+ return proxy;
73
+ }
74
+ };
75
+ __decorate([
76
+ (0, inversify_1.inject)(logger_1.Logger),
77
+ __metadata("design:type", logger_1.Logger)
78
+ ], JsonRpcGLSPServerLauncher.prototype, "logger", void 0);
79
+ JsonRpcGLSPServerLauncher = __decorate([
80
+ (0, inversify_1.injectable)(),
81
+ __metadata("design:paramtypes", [])
82
+ ], JsonRpcGLSPServerLauncher);
83
+ exports.JsonRpcGLSPServerLauncher = JsonRpcGLSPServerLauncher;
84
+ //# sourceMappingURL=jsonrpc-server-launcher.js.map
@@ -0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.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
- import { CompoundOperation, MaybePromise, Operation } from '@eclipse-glsp/protocol';
16
+ import { CompoundOperation } from '@eclipse-glsp/protocol';
17
+ import { Command } from '../command/command';
17
18
  import { OperationHandler } from './operation-handler';
18
19
  import { OperationHandlerRegistry } from './operation-handler-registry';
19
- export declare class CompoundOperationHandler implements OperationHandler {
20
- operationType: string;
20
+ export declare class CompoundOperationHandler extends OperationHandler {
21
21
  protected operationHandlerRegistry: OperationHandlerRegistry;
22
- execute(operation: CompoundOperation): void;
23
- executeNestedOperation(operation: Operation): MaybePromise<void>;
22
+ operationType: string;
23
+ createCommand(operation: CompoundOperation): Promise<Command | undefined>;
24
24
  }
25
25
  //# sourceMappingURL=compound-operation-handler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"compound-operation-handler.d.ts","sourceRoot":"","sources":["../../../src/common/operations/compound-operation-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGpF,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAExE,qBACa,wBAAyB,YAAW,gBAAgB;IAC7D,aAAa,SAA0B;IAEL,SAAS,CAAC,wBAAwB,EAAE,wBAAwB,CAAC;IAE/F,OAAO,CAAC,SAAS,EAAE,iBAAiB,GAAG,IAAI;IAI3C,sBAAsB,CAAC,SAAS,EAAE,SAAS,GAAG,YAAY,CAAC,IAAI,CAAC;CAMnE"}
1
+ {"version":3,"file":"compound-operation-handler.d.ts","sourceRoot":"","sources":["../../../src/common/operations/compound-operation-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,OAAO,EAAE,OAAO,EAAmB,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAExE,qBACa,wBAAyB,SAAQ,gBAAgB;IAE1D,SAAS,CAAC,wBAAwB,EAAE,wBAAwB,CAAC;IAE7D,aAAa,SAA0B;IAEjC,aAAa,CAAC,SAAS,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC;CAWlF"}
@@ -8,6 +8,13 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
8
8
  var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
+ var __asyncValues = (this && this.__asyncValues) || function (o) {
12
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
13
+ var m = o[Symbol.asyncIterator], i;
14
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
15
+ function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
16
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
17
+ };
11
18
  Object.defineProperty(exports, "__esModule", { value: true });
12
19
  exports.CompoundOperationHandler = void 0;
13
20
  /********************************************************************************
@@ -27,20 +34,41 @@ exports.CompoundOperationHandler = void 0;
27
34
  ********************************************************************************/
28
35
  const protocol_1 = require("@eclipse-glsp/protocol");
29
36
  const inversify_1 = require("inversify");
30
- const operation_action_handler_1 = require("./operation-action-handler");
37
+ const command_1 = require("../command/command");
38
+ const operation_handler_1 = require("./operation-handler");
31
39
  const operation_handler_registry_1 = require("./operation-handler-registry");
32
- let CompoundOperationHandler = class CompoundOperationHandler {
40
+ let CompoundOperationHandler = class CompoundOperationHandler extends operation_handler_1.OperationHandler {
33
41
  constructor() {
42
+ super(...arguments);
34
43
  this.operationType = protocol_1.CompoundOperation.KIND;
35
44
  }
36
- execute(operation) {
37
- operation.operationList.forEach(nestedOperation => this.executeNestedOperation(nestedOperation));
38
- }
39
- executeNestedOperation(operation) {
40
- const operationHandler = operation_action_handler_1.OperationActionHandler.getOperationHandler(operation, this.operationHandlerRegistry);
41
- if (operationHandler) {
42
- operationHandler.execute(operation);
45
+ async createCommand(operation) {
46
+ var _a, e_1, _b, _c;
47
+ const maybeCommands = operation.operationList.map(op => this.operationHandlerRegistry.getExecutableCommand(op));
48
+ const commands = [];
49
+ try {
50
+ for (var _d = true, maybeCommands_1 = __asyncValues(maybeCommands), maybeCommands_1_1; maybeCommands_1_1 = await maybeCommands_1.next(), _a = maybeCommands_1_1.done, !_a;) {
51
+ _c = maybeCommands_1_1.value;
52
+ _d = false;
53
+ try {
54
+ const command = _c;
55
+ if (command) {
56
+ commands.push(command);
57
+ }
58
+ }
59
+ finally {
60
+ _d = true;
61
+ }
62
+ }
63
+ }
64
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
65
+ finally {
66
+ try {
67
+ if (!_d && !_a && (_b = maybeCommands_1.return)) await _b.call(maybeCommands_1);
68
+ }
69
+ finally { if (e_1) throw e_1.error; }
43
70
  }
71
+ return new command_1.CompoundCommand(commands);
44
72
  }
45
73
  };
46
74
  __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"compound-operation-handler.js","sourceRoot":"","sources":["../../../src/common/operations/compound-operation-handler.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,qDAAoF;AACpF,yCAA+C;AAC/C,yEAAoE;AAEpE,6EAAwE;AAGjE,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IAA9B;QACH,kBAAa,GAAG,4BAAiB,CAAC,IAAI,CAAC;IAc3C,CAAC;IAVG,OAAO,CAAC,SAA4B;QAChC,SAAS,CAAC,aAAa,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,CAAC,IAAI,CAAC,sBAAsB,CAAC,eAAe,CAAC,CAAC,CAAC;IACrG,CAAC;IAED,sBAAsB,CAAC,SAAoB;QACvC,MAAM,gBAAgB,GAAG,iDAAsB,CAAC,mBAAmB,CAAC,SAAS,EAAE,IAAI,CAAC,wBAAwB,CAAC,CAAC;QAC9G,IAAI,gBAAgB,EAAE;YAClB,gBAAgB,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;SACvC;IACL,CAAC;CACJ,CAAA;AAZG;IAAC,IAAA,kBAAM,EAAC,qDAAwB,CAAC;8BAAqC,qDAAwB;0EAAC;AAHtF,wBAAwB;IADpC,IAAA,sBAAU,GAAE;GACA,wBAAwB,CAepC;AAfY,4DAAwB"}
1
+ {"version":3,"file":"compound-operation-handler.js","sourceRoot":"","sources":["../../../src/common/operations/compound-operation-handler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,qDAA2D;AAC3D,yCAA+C;AAC/C,gDAA8D;AAC9D,2DAAuD;AACvD,6EAAwE;AAGjE,IAAM,wBAAwB,GAA9B,MAAM,wBAAyB,SAAQ,oCAAgB;IAAvD;;QAIH,kBAAa,GAAG,4BAAiB,CAAC,IAAI,CAAC;IAa3C,CAAC;IAXG,KAAK,CAAC,aAAa,CAAC,SAA4B;;QAC5C,MAAM,aAAa,GAAG,SAAS,CAAC,aAAa,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,wBAAwB,CAAC,oBAAoB,CAAC,EAAE,CAAC,CAAC,CAAC;QAChH,MAAM,QAAQ,GAAc,EAAE,CAAC;;YAE/B,KAA4B,eAAA,kBAAA,cAAA,aAAa,CAAA,mBAAA;gBAAb,6BAAa;gBAAb,WAAa;;oBAA9B,MAAM,OAAO,KAAA,CAAA;oBACpB,IAAI,OAAO,EAAE;wBACT,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;qBAC1B;;;;;aACJ;;;;;;;;;QACD,OAAO,IAAI,yBAAe,CAAC,QAAQ,CAAC,CAAC;IACzC,CAAC;CACJ,CAAA;AAhBG;IAAC,IAAA,kBAAM,EAAC,qDAAwB,CAAC;8BACG,qDAAwB;0EAAC;AAFpD,wBAAwB;IADpC,IAAA,sBAAU,GAAE;GACA,wBAAwB,CAiBpC;AAjBY,4DAAwB"}
@@ -13,52 +13,20 @@
13
13
  *
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
- import { GModelElement } from '@eclipse-glsp/graph';
17
- import { CreateNodeOperation, CreateOperation, MaybePromise, Operation, Point, TriggerEdgeCreationAction, TriggerNodeCreationAction } from '@eclipse-glsp/protocol';
18
- import { ModelState } from '../features/model/model-state';
16
+ import { CreateEdgeOperation, CreateNodeOperation, TriggerEdgeCreationAction, TriggerNodeCreationAction } from '@eclipse-glsp/protocol';
19
17
  import { OperationHandler } from './operation-handler';
20
18
  /**
21
19
  * A special {@link OperationHandler} that is responsible for the handling of {@link CreateOperation}s. Depending on its
22
20
  * operation type the triggered actions are {@link TriggerNodeCreationAction} or {@link TriggerEdgeCreationAction}s.
23
21
  */
24
- export declare abstract class CreateOperationHandler implements OperationHandler {
25
- abstract operationType: string;
26
- abstract readonly label: string;
27
- abstract elementTypeIds: string[];
28
- abstract execute(operation: Operation): MaybePromise<void>;
29
- /**
30
- * Returns a list of {@link TriggerElementCreationAction}s for registered element types.
31
- *
32
- * @returns A list of {@link TriggerElementCreationAction}s.
33
- */
22
+ export interface CreateOperationHandler extends OperationHandler {
23
+ readonly label: string;
24
+ elementTypeIds: string[];
25
+ operationType: CreateOperationKind;
34
26
  getTriggerActions(): (TriggerEdgeCreationAction | TriggerNodeCreationAction)[];
35
- handles(operation: CreateOperation): boolean;
36
27
  }
37
- /**
38
- * Abstract base implementation for {@link CreateOperationHandler} that
39
- * create an element that is represented with a {@link GNode} in the graphical model.
40
- */
41
- export declare abstract class CreateNodeOperationHandler extends CreateOperationHandler {
42
- protected modelState: ModelState;
43
- get operationType(): string;
44
- /**
45
- * Retrieve the graphical model element that should contain the newly created {@link GNode}.
46
- * If `undefined` is returned the {@link GNode} should be added directly to the diagram root.
47
- * @param operation The currently handled operation.
48
- * @returns The container {@link GModeElement} or `undefined`.
49
- */
50
- getContainer(operation: CreateNodeOperation): GModelElement | undefined;
51
- getLocation(operation: CreateNodeOperation): Point | undefined;
52
- /**
53
- * Retrieves the diagram absolute location and the target container from the given {@link CreateNodeOperation}
54
- * and converts the absolute location to coordinates relative to the given container.
55
- * Relative coordinates can only be retrieved if the given container element is part of
56
- * a hierarchy of {@link GBoundsAware} elements. This means each (recursive) parent element need to
57
- * implement {@link GBoundsAware}. If that is not the case this method returns `undefined`.
58
- * @param absoluteLocation The diagram absolute position.
59
- * @param container The container element.
60
- * @returns The relative position or `undefined`.
61
- */
62
- getRelativeLocation(operation: CreateNodeOperation): Point | undefined;
28
+ export type CreateOperationKind = typeof CreateNodeOperation.KIND | typeof CreateEdgeOperation.KIND;
29
+ export declare namespace CreateOperationHandler {
30
+ function is(object: unknown): object is CreateOperationHandler;
63
31
  }
64
32
  //# sourceMappingURL=create-operation-handler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-operation-handler.d.ts","sourceRoot":"","sources":["../../../src/common/operations/create-operation-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAEH,mBAAmB,EACnB,eAAe,EACf,YAAY,EACZ,SAAS,EACT,KAAK,EACL,yBAAyB,EACzB,yBAAyB,EAC5B,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAE3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD;;;GAGG;AACH,8BACsB,sBAAuB,YAAW,gBAAgB;IACpE,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,cAAc,EAAE,MAAM,EAAE,CAAC;IAElC,QAAQ,CAAC,OAAO,CAAC,SAAS,EAAE,SAAS,GAAG,YAAY,CAAC,IAAI,CAAC;IAE1D;;;;OAIG;IACH,iBAAiB,IAAI,CAAC,yBAAyB,GAAG,yBAAyB,CAAC,EAAE;IAS9E,OAAO,CAAC,SAAS,EAAE,eAAe,GAAG,OAAO;CAG/C;AAED;;;GAGG;AACH,8BACsB,0BAA2B,SAAQ,sBAAsB;IAE3E,SAAS,CAAC,UAAU,EAAE,UAAU,CAAC;IAEjC,IAAI,aAAa,IAAI,MAAM,CAE1B;IAED;;;;;OAKG;IACH,YAAY,CAAC,SAAS,EAAE,mBAAmB,GAAG,aAAa,GAAG,SAAS;IAKvE,WAAW,CAAC,SAAS,EAAE,mBAAmB,GAAG,KAAK,GAAG,SAAS;IAI9D;;;;;;;;;OASG;IACH,mBAAmB,CAAC,SAAS,EAAE,mBAAmB,GAAG,KAAK,GAAG,SAAS;CAKzE"}
1
+ {"version":3,"file":"create-operation-handler.d.ts","sourceRoot":"","sources":["../../../src/common/operations/create-operation-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EACH,mBAAmB,EACnB,mBAAmB,EAInB,yBAAyB,EACzB,yBAAyB,EAC5B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD;;;GAGG;AACH,MAAM,WAAW,sBAAuB,SAAQ,gBAAgB;IAC5D,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,aAAa,EAAE,mBAAmB,CAAC;IACnC,iBAAiB,IAAI,CAAC,yBAAyB,GAAG,yBAAyB,CAAC,EAAE,CAAC;CAClF;AAED,MAAM,MAAM,mBAAmB,GAAG,OAAO,mBAAmB,CAAC,IAAI,GAAG,OAAO,mBAAmB,CAAC,IAAI,CAAC;AAEpG,yBAAiB,sBAAsB,CAAC;IACpC,SAAgB,EAAE,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,sBAAsB,CAOpE;CACJ"}
@@ -1,90 +1,31 @@
1
1
  "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.CreateNodeOperationHandler = exports.CreateOperationHandler = void 0;
3
+ exports.CreateOperationHandler = void 0;
4
+ /********************************************************************************
5
+ * Copyright (c) 2022-2023 STMicroelectronics and others.
6
+ *
7
+ * This program and the accompanying materials are made available under the
8
+ * terms of the Eclipse Public License v. 2.0 which is available at
9
+ * http://www.eclipse.org/legal/epl-2.0.
10
+ *
11
+ * This Source Code may also be made available under the following Secondary
12
+ * Licenses when the conditions for such availability set forth in the Eclipse
13
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
14
+ * with the GNU Classpath Exception which is available at
15
+ * https://www.gnu.org/software/classpath/license.html.
16
+ *
17
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
18
+ ********************************************************************************/
13
19
  const protocol_1 = require("@eclipse-glsp/protocol");
14
- const inversify_1 = require("inversify");
15
- const model_state_1 = require("../features/model/model-state");
16
- const layout_util_1 = require("../utils/layout-util");
17
- /**
18
- * A special {@link OperationHandler} that is responsible for the handling of {@link CreateOperation}s. Depending on its
19
- * operation type the triggered actions are {@link TriggerNodeCreationAction} or {@link TriggerEdgeCreationAction}s.
20
- */
21
- let CreateOperationHandler = class CreateOperationHandler {
22
- /**
23
- * Returns a list of {@link TriggerElementCreationAction}s for registered element types.
24
- *
25
- * @returns A list of {@link TriggerElementCreationAction}s.
26
- */
27
- getTriggerActions() {
28
- if (this.operationType === protocol_1.CreateNodeOperation.KIND) {
29
- return this.elementTypeIds.map(typeId => protocol_1.TriggerNodeCreationAction.create(typeId));
30
- }
31
- else if (this.operationType === protocol_1.CreateEdgeOperation.KIND) {
32
- return this.elementTypeIds.map(typeId => protocol_1.TriggerEdgeCreationAction.create(typeId));
33
- }
34
- return [];
20
+ const operation_handler_1 = require("./operation-handler");
21
+ var CreateOperationHandler;
22
+ (function (CreateOperationHandler) {
23
+ function is(object) {
24
+ return (object instanceof operation_handler_1.OperationHandler &&
25
+ (0, protocol_1.hasStringProp)(object, 'label') &&
26
+ (0, protocol_1.hasArrayProp)(object, 'elementTypeIds') &&
27
+ (0, protocol_1.hasFunctionProp)(object, 'getTriggerActions'));
35
28
  }
36
- handles(operation) {
37
- return this.elementTypeIds.includes(operation.elementTypeId);
38
- }
39
- };
40
- CreateOperationHandler = __decorate([
41
- (0, inversify_1.injectable)()
42
- ], CreateOperationHandler);
43
- exports.CreateOperationHandler = CreateOperationHandler;
44
- /**
45
- * Abstract base implementation for {@link CreateOperationHandler} that
46
- * create an element that is represented with a {@link GNode} in the graphical model.
47
- */
48
- let CreateNodeOperationHandler = class CreateNodeOperationHandler extends CreateOperationHandler {
49
- get operationType() {
50
- return protocol_1.CreateNodeOperation.KIND;
51
- }
52
- /**
53
- * Retrieve the graphical model element that should contain the newly created {@link GNode}.
54
- * If `undefined` is returned the {@link GNode} should be added directly to the diagram root.
55
- * @param operation The currently handled operation.
56
- * @returns The container {@link GModeElement} or `undefined`.
57
- */
58
- getContainer(operation) {
59
- const index = this.modelState.index;
60
- return operation.containerId ? index.get(operation.containerId) : undefined;
61
- }
62
- getLocation(operation) {
63
- return operation.location;
64
- }
65
- /**
66
- * Retrieves the diagram absolute location and the target container from the given {@link CreateNodeOperation}
67
- * and converts the absolute location to coordinates relative to the given container.
68
- * Relative coordinates can only be retrieved if the given container element is part of
69
- * a hierarchy of {@link GBoundsAware} elements. This means each (recursive) parent element need to
70
- * implement {@link GBoundsAware}. If that is not the case this method returns `undefined`.
71
- * @param absoluteLocation The diagram absolute position.
72
- * @param container The container element.
73
- * @returns The relative position or `undefined`.
74
- */
75
- getRelativeLocation(operation) {
76
- var _a, _b;
77
- const container = (_a = this.getContainer(operation)) !== null && _a !== void 0 ? _a : this.modelState.root;
78
- const absoluteLocation = (_b = this.getLocation(operation)) !== null && _b !== void 0 ? _b : protocol_1.Point.ORIGIN;
79
- return (0, layout_util_1.getRelativeLocation)(absoluteLocation, container);
80
- }
81
- };
82
- __decorate([
83
- (0, inversify_1.inject)(model_state_1.ModelState),
84
- __metadata("design:type", Object)
85
- ], CreateNodeOperationHandler.prototype, "modelState", void 0);
86
- CreateNodeOperationHandler = __decorate([
87
- (0, inversify_1.injectable)()
88
- ], CreateNodeOperationHandler);
89
- exports.CreateNodeOperationHandler = CreateNodeOperationHandler;
29
+ CreateOperationHandler.is = is;
30
+ })(CreateOperationHandler = exports.CreateOperationHandler || (exports.CreateOperationHandler = {}));
90
31
  //# sourceMappingURL=create-operation-handler.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-operation-handler.js","sourceRoot":"","sources":["../../../src/common/operations/create-operation-handler.ts"],"names":[],"mappings":";;;;;;;;;;;;AAgBA,qDASgC;AAChC,yCAA+C;AAC/C,+DAA2D;AAC3D,sDAA2D;AAG3D;;;GAGG;AAEI,IAAe,sBAAs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AAC,SAAS,CAAC,mCAAI,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;QACvE,MAAM,gBAAgB,GAAG,MAAA,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,mCAAI,gBAAK,CAAC,MAAM,CAAC;QACrE,OAAO,IAAA,iCAAmB,EAAC,gBAAgB,EAAE,SAAS,CAAC,CAAC;IAC5D,CAAC;CACJ,CAAA;AArCG;IAAC,IAAA,kBAAM,EAAC,wBAAU,CAAC;;8DACc;AAFf,0BAA0B;IAD/C,IAAA,sBAAU,GAAE;GACS,0BAA0B,CAsC/C;AAtCqB,gEAA0B"}
1
+ {"version":3,"file":"create-operation-handler.js","sourceRoot":"","sources":["../../../src/common/operations/create-operation-handler.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,qDAQgC;AAChC,2DAAuD;AAevD,IAAiB,sBAAsB,CAStC;AATD,WAAiB,sBAAsB;IACnC,SAAgB,EAAE,CAAC,MAAe;QAC9B,OAAO,CACH,MAAM,YAAY,oCAAgB;YAClC,IAAA,wBAAa,EAAC,MAAM,EAAE,OAAO,CAAC;YAC9B,IAAA,uBAAY,EAAC,MAAM,EAAE,gBAAgB,CAAC;YACtC,IAAA,0BAAe,EAAC,MAAM,EAAE,mBAAmB,CAAC,CAC/C,CAAC;IACN,CAAC;IAPe,yBAAE,KAOjB,CAAA;AACL,CAAC,EATgB,sBAAsB,GAAtB,8BAAsB,KAAtB,8BAAsB,QAStC"}