@eclipse-glsp/client 1.1.0-next.ee71b2a.218 → 1.1.0-next.f382a8e.231

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 (240) hide show
  1. package/css/decoration.css +1 -1
  2. package/lib/base/auto-complete/auto-complete-widget.d.ts +2 -2
  3. package/lib/base/auto-complete/auto-complete-widget.js +3 -3
  4. package/lib/base/command-stack.d.ts +1 -2
  5. package/lib/base/command-stack.d.ts.map +1 -1
  6. package/lib/base/command-stack.js +5 -14
  7. package/lib/base/command-stack.js.map +1 -1
  8. package/lib/base/container-modules.d.ts +15 -15
  9. package/lib/base/container-modules.d.ts.map +1 -1
  10. package/lib/base/container-modules.js +19 -25
  11. package/lib/base/container-modules.js.map +1 -1
  12. package/lib/base/di.config.d.ts +1 -1
  13. package/lib/base/di.config.d.ts.map +1 -1
  14. package/lib/base/di.config.js +7 -7
  15. package/lib/base/di.config.js.map +1 -1
  16. package/lib/base/editor-context-service.d.ts +3 -3
  17. package/lib/base/editor-context-service.d.ts.map +1 -1
  18. package/lib/base/editor-context-service.js +3 -3
  19. package/lib/base/editor-context-service.js.map +1 -1
  20. package/lib/base/tool-manager/glsp-tool-manager.d.ts +4 -5
  21. package/lib/base/tool-manager/glsp-tool-manager.d.ts.map +1 -1
  22. package/lib/base/tool-manager/glsp-tool-manager.js +15 -8
  23. package/lib/base/tool-manager/glsp-tool-manager.js.map +1 -1
  24. package/lib/features/bounds/di.config.d.ts +0 -16
  25. package/lib/features/bounds/di.config.d.ts.map +1 -1
  26. package/lib/features/bounds/di.config.js +12 -9
  27. package/lib/features/bounds/di.config.js.map +1 -1
  28. package/lib/features/{layout → bounds}/freeform-layout.d.ts +2 -2
  29. package/lib/features/{layout → bounds}/freeform-layout.d.ts.map +1 -1
  30. package/lib/features/{layout → bounds}/freeform-layout.js +2 -2
  31. package/lib/features/{layout → bounds}/freeform-layout.js.map +1 -1
  32. package/lib/features/bounds/freeform-layout.spec.d.ts.map +1 -0
  33. package/lib/features/{layout/tests → bounds}/freeform-layout.spec.js +37 -37
  34. package/lib/features/bounds/freeform-layout.spec.js.map +1 -0
  35. package/lib/features/bounds/glsp-hidden-bounds-updater.d.ts +1 -1
  36. package/lib/features/bounds/glsp-hidden-bounds-updater.d.ts.map +1 -1
  37. package/lib/features/bounds/glsp-hidden-bounds-updater.js +3 -2
  38. package/lib/features/bounds/glsp-hidden-bounds-updater.js.map +1 -1
  39. package/lib/features/{layout → bounds}/hbox-layout.d.ts +1 -1
  40. package/lib/features/{layout → bounds}/hbox-layout.d.ts.map +1 -1
  41. package/lib/features/{layout → bounds}/hbox-layout.js +1 -1
  42. package/lib/features/{layout → bounds}/hbox-layout.js.map +1 -1
  43. package/lib/features/bounds/hbox-layout.spec.d.ts.map +1 -0
  44. package/lib/features/{layout/tests → bounds}/hbox-layout.spec.js +18 -18
  45. package/lib/features/bounds/hbox-layout.spec.js.map +1 -0
  46. package/lib/features/{layout/tests/layouter-test-util.d.ts → bounds/layouter-test-util.spec.d.ts} +2 -3
  47. package/lib/features/bounds/layouter-test-util.spec.d.ts.map +1 -0
  48. package/lib/features/{layout/tests/layouter-test-util.js → bounds/layouter-test-util.spec.js} +6 -6
  49. package/lib/features/bounds/layouter-test-util.spec.js.map +1 -0
  50. package/lib/features/{layout → bounds}/layouter.d.ts +1 -1
  51. package/lib/features/{layout → bounds}/layouter.d.ts.map +1 -1
  52. package/lib/features/{layout → bounds}/layouter.js +1 -1
  53. package/lib/features/{layout → bounds}/layouter.js.map +1 -1
  54. package/lib/features/{layout → bounds}/vbox-layout.d.ts +1 -1
  55. package/lib/features/{layout → bounds}/vbox-layout.d.ts.map +1 -1
  56. package/lib/features/{layout → bounds}/vbox-layout.js +1 -1
  57. package/lib/features/{layout → bounds}/vbox-layout.js.map +1 -1
  58. package/lib/features/bounds/vbox-layout.spec.d.ts.map +1 -0
  59. package/lib/features/{layout/tests → bounds}/vbox-layout.spec.js +18 -18
  60. package/lib/features/bounds/vbox-layout.spec.js.map +1 -0
  61. package/lib/features/command-palette/command-palette-tool.d.ts +1 -1
  62. package/lib/features/command-palette/command-palette-tool.d.ts.map +1 -1
  63. package/lib/features/command-palette/command-palette-tool.js +3 -3
  64. package/lib/features/command-palette/command-palette-tool.js.map +1 -1
  65. package/lib/features/command-palette/di.config.d.ts +0 -15
  66. package/lib/features/command-palette/di.config.d.ts.map +1 -1
  67. package/lib/features/command-palette/di.config.js +6 -7
  68. package/lib/features/command-palette/di.config.js.map +1 -1
  69. package/lib/features/context-menu/di.config.d.ts +0 -15
  70. package/lib/features/context-menu/di.config.d.ts.map +1 -1
  71. package/lib/features/context-menu/di.config.js +4 -3
  72. package/lib/features/context-menu/di.config.js.map +1 -1
  73. package/lib/features/copy-paste/copy-paste-handler.d.ts +2 -2
  74. package/lib/features/copy-paste/copy-paste-handler.d.ts.map +1 -1
  75. package/lib/features/copy-paste/copy-paste-handler.js +5 -5
  76. package/lib/features/copy-paste/copy-paste-handler.js.map +1 -1
  77. package/lib/features/decoration/di.config.d.ts +0 -15
  78. package/lib/features/decoration/di.config.d.ts.map +1 -1
  79. package/lib/features/decoration/di.config.js +4 -4
  80. package/lib/features/decoration/di.config.js.map +1 -1
  81. package/lib/features/edit-label/di.config.d.ts +0 -15
  82. package/lib/features/edit-label/di.config.d.ts.map +1 -1
  83. package/lib/features/edit-label/di.config.js +3 -2
  84. package/lib/features/edit-label/di.config.js.map +1 -1
  85. package/lib/features/export/di.config.d.ts +0 -15
  86. package/lib/features/export/di.config.d.ts.map +1 -1
  87. package/lib/features/export/di.config.js +6 -5
  88. package/lib/features/export/di.config.js.map +1 -1
  89. package/lib/features/export/glsp-svg-exporter.d.ts +1 -1
  90. package/lib/features/export/glsp-svg-exporter.d.ts.map +1 -1
  91. package/lib/features/export/glsp-svg-exporter.js +1 -2
  92. package/lib/features/export/glsp-svg-exporter.js.map +1 -1
  93. package/lib/features/hover/di.config.d.ts +0 -15
  94. package/lib/features/hover/di.config.d.ts.map +1 -1
  95. package/lib/features/hover/di.config.js +7 -7
  96. package/lib/features/hover/di.config.js.map +1 -1
  97. package/lib/features/layout/di.config.d.ts +1 -1
  98. package/lib/features/layout/di.config.d.ts.map +1 -1
  99. package/lib/features/layout/di.config.js +1 -9
  100. package/lib/features/layout/di.config.js.map +1 -1
  101. package/lib/features/navigation/di.config.d.ts +2 -1
  102. package/lib/features/navigation/di.config.d.ts.map +1 -1
  103. package/lib/features/navigation/di.config.js +3 -3
  104. package/lib/features/navigation/di.config.js.map +1 -1
  105. package/lib/features/navigation/navigation-action-handler.d.ts +2 -2
  106. package/lib/features/navigation/navigation-action-handler.js +2 -2
  107. package/lib/features/save/di.config.d.ts +0 -15
  108. package/lib/features/save/di.config.d.ts.map +1 -1
  109. package/lib/features/save/di.config.js +3 -2
  110. package/lib/features/save/di.config.js.map +1 -1
  111. package/lib/features/select/di.config.d.ts +0 -15
  112. package/lib/features/select/di.config.d.ts.map +1 -1
  113. package/lib/features/select/di.config.js +8 -7
  114. package/lib/features/select/di.config.js.map +1 -1
  115. package/lib/features/select/selection-service.spec.js +19 -3
  116. package/lib/features/select/selection-service.spec.js.map +1 -1
  117. package/lib/features/tool-feedback/change-bounds-tool-feedback.d.ts +2 -2
  118. package/lib/features/tool-feedback/change-bounds-tool-feedback.d.ts.map +1 -1
  119. package/lib/features/tool-feedback/change-bounds-tool-feedback.js +3 -3
  120. package/lib/features/tool-feedback/change-bounds-tool-feedback.js.map +1 -1
  121. package/lib/features/tool-feedback/creation-tool-feedback.d.ts +6 -6
  122. package/lib/features/tool-feedback/creation-tool-feedback.d.ts.map +1 -1
  123. package/lib/features/tool-feedback/creation-tool-feedback.js +4 -8
  124. package/lib/features/tool-feedback/creation-tool-feedback.js.map +1 -1
  125. package/lib/features/tool-feedback/di.config.d.ts +0 -15
  126. package/lib/features/tool-feedback/di.config.d.ts.map +1 -1
  127. package/lib/features/tool-feedback/di.config.js +20 -18
  128. package/lib/features/tool-feedback/di.config.js.map +1 -1
  129. package/lib/features/tool-feedback/edge-edit-tool-feedback.d.ts +1 -2
  130. package/lib/features/tool-feedback/edge-edit-tool-feedback.d.ts.map +1 -1
  131. package/lib/features/tool-feedback/edge-edit-tool-feedback.js +1 -7
  132. package/lib/features/tool-feedback/edge-edit-tool-feedback.js.map +1 -1
  133. package/lib/features/tool-palette/di.config.d.ts +0 -15
  134. package/lib/features/tool-palette/di.config.d.ts.map +1 -1
  135. package/lib/features/tool-palette/di.config.js +4 -4
  136. package/lib/features/tool-palette/di.config.js.map +1 -1
  137. package/lib/features/tools/change-bounds-tool.d.ts +1 -1
  138. package/lib/features/tools/change-bounds-tool.d.ts.map +1 -1
  139. package/lib/features/tools/change-bounds-tool.js +6 -6
  140. package/lib/features/tools/change-bounds-tool.js.map +1 -1
  141. package/lib/features/tools/di.config.d.ts +18 -5
  142. package/lib/features/tools/di.config.d.ts.map +1 -1
  143. package/lib/features/tools/di.config.js +14 -15
  144. package/lib/features/tools/di.config.js.map +1 -1
  145. package/lib/features/tools/glsp-manhattan-edge-router.d.ts +2 -2
  146. package/lib/features/tools/glsp-manhattan-edge-router.d.ts.map +1 -1
  147. package/lib/features/tools/glsp-manhattan-edge-router.js +4 -4
  148. package/lib/features/tools/glsp-manhattan-edge-router.js.map +1 -1
  149. package/lib/features/validation/di.config.js +4 -4
  150. package/lib/features/validation/di.config.js.map +1 -1
  151. package/lib/features/viewport/di.config.d.ts +0 -15
  152. package/lib/features/viewport/di.config.d.ts.map +1 -1
  153. package/lib/features/viewport/di.config.js +12 -11
  154. package/lib/features/viewport/di.config.js.map +1 -1
  155. package/lib/index.d.ts +26 -4
  156. package/lib/index.d.ts.map +1 -1
  157. package/lib/index.js +33 -4
  158. package/lib/index.js.map +1 -1
  159. package/lib/sprotty-reexport.d.ts +2 -2
  160. package/lib/sprotty-reexport.d.ts.map +1 -1
  161. package/lib/sprotty-reexport.js +4 -4
  162. package/lib/sprotty-reexport.js.map +1 -1
  163. package/lib/utils/smodel-util.d.ts +1 -1
  164. package/lib/utils/smodel-util.d.ts.map +1 -1
  165. package/lib/utils/smodel-util.js +1 -1
  166. package/lib/utils/smodel-util.js.map +1 -1
  167. package/lib/views/base-view-module.d.ts +18 -6
  168. package/lib/views/base-view-module.d.ts.map +1 -1
  169. package/lib/views/base-view-module.js +1 -1
  170. package/lib/views/base-view-module.js.map +1 -1
  171. package/lib/views/glsp-edge-view.d.ts +2 -2
  172. package/lib/views/glsp-edge-view.d.ts.map +1 -1
  173. package/lib/views/glsp-edge-view.js +2 -2
  174. package/lib/views/glsp-edge-view.js.map +1 -1
  175. package/lib/views/index.d.ts +1 -1
  176. package/lib/views/index.js +1 -1
  177. package/lib/views/rounded-corner-view.js +2 -2
  178. package/lib/views/rounded-corner.d.ts +1 -1
  179. package/lib/views/rounded-corner.js +1 -1
  180. package/package.json +3 -3
  181. package/src/base/auto-complete/auto-complete-widget.ts +3 -3
  182. package/src/base/command-stack.ts +13 -11
  183. package/src/base/container-modules.ts +18 -31
  184. package/src/base/di.config.ts +8 -8
  185. package/src/base/editor-context-service.ts +4 -4
  186. package/src/base/tool-manager/glsp-tool-manager.ts +15 -12
  187. package/src/features/bounds/di.config.ts +21 -11
  188. package/src/features/{layout/tests → bounds}/freeform-layout.spec.ts +2 -2
  189. package/src/features/{layout → bounds}/freeform-layout.ts +2 -2
  190. package/src/features/bounds/glsp-hidden-bounds-updater.ts +4 -7
  191. package/src/features/{layout/tests → bounds}/hbox-layout.spec.ts +2 -2
  192. package/src/features/{layout → bounds}/hbox-layout.ts +1 -1
  193. package/src/features/{layout/tests/layouter-test-util.ts → bounds/layouter-test-util.spec.ts} +5 -5
  194. package/src/features/{layout → bounds}/layouter.ts +1 -1
  195. package/src/features/{layout/tests → bounds}/vbox-layout.spec.ts +2 -2
  196. package/src/features/{layout → bounds}/vbox-layout.ts +1 -1
  197. package/src/features/command-palette/command-palette-tool.ts +3 -3
  198. package/src/features/command-palette/di.config.ts +6 -7
  199. package/src/features/context-menu/di.config.ts +4 -3
  200. package/src/features/copy-paste/copy-paste-handler.ts +5 -5
  201. package/src/features/decoration/di.config.ts +4 -4
  202. package/src/features/edit-label/di.config.ts +3 -2
  203. package/src/features/export/di.config.ts +6 -5
  204. package/src/features/export/glsp-svg-exporter.ts +8 -7
  205. package/src/features/hover/di.config.ts +8 -7
  206. package/src/features/layout/di.config.ts +2 -11
  207. package/src/features/navigation/di.config.ts +4 -2
  208. package/src/features/navigation/navigation-action-handler.ts +2 -2
  209. package/src/features/save/di.config.ts +3 -2
  210. package/src/features/select/di.config.ts +8 -7
  211. package/src/features/select/selection-service.spec.ts +4 -5
  212. package/src/features/tool-feedback/change-bounds-tool-feedback.ts +3 -3
  213. package/src/features/tool-feedback/creation-tool-feedback.ts +20 -14
  214. package/src/features/tool-feedback/di.config.ts +20 -18
  215. package/src/features/tool-feedback/edge-edit-tool-feedback.ts +1 -9
  216. package/src/features/tool-palette/di.config.ts +4 -4
  217. package/src/features/tools/change-bounds-tool.ts +7 -7
  218. package/src/features/tools/di.config.ts +18 -19
  219. package/src/features/tools/glsp-manhattan-edge-router.ts +8 -5
  220. package/src/features/validation/di.config.ts +5 -5
  221. package/src/features/viewport/di.config.ts +13 -11
  222. package/src/index.ts +33 -4
  223. package/src/sprotty-reexport.ts +18 -8
  224. package/src/utils/smodel-util.ts +12 -5
  225. package/src/views/base-view-module.ts +4 -9
  226. package/src/views/glsp-edge-view.tsx +3 -3
  227. package/src/views/index.ts +1 -2
  228. package/src/views/rounded-corner-view.tsx +2 -2
  229. package/src/views/rounded-corner.ts +2 -2
  230. package/lib/features/layout/tests/freeform-layout.spec.d.ts.map +0 -1
  231. package/lib/features/layout/tests/freeform-layout.spec.js.map +0 -1
  232. package/lib/features/layout/tests/hbox-layout.spec.d.ts.map +0 -1
  233. package/lib/features/layout/tests/hbox-layout.spec.js.map +0 -1
  234. package/lib/features/layout/tests/layouter-test-util.d.ts.map +0 -1
  235. package/lib/features/layout/tests/layouter-test-util.js.map +0 -1
  236. package/lib/features/layout/tests/vbox-layout.spec.d.ts.map +0 -1
  237. package/lib/features/layout/tests/vbox-layout.spec.js.map +0 -1
  238. /package/lib/features/{layout/tests → bounds}/freeform-layout.spec.d.ts +0 -0
  239. /package/lib/features/{layout/tests → bounds}/hbox-layout.spec.d.ts +0 -0
  240. /package/lib/features/{layout/tests → bounds}/vbox-layout.spec.d.ts +0 -0
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2022 EclipseSource and others.
2
+ * Copyright (c) 2022-2023 EclipseSource and others.
3
3
  *
4
4
  * This program and the accompanying materials are made available under the
5
5
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -13,27 +13,37 @@
13
13
  *
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
+ import { bindAsService } from '@eclipse-glsp/protocol';
16
17
  import { ContainerModule } from 'inversify';
17
18
  import {
18
- configureCommand, configureLayout, HBoxLayouter, HiddenBoundsUpdater, Layouter,
19
- LayoutRegistry, RequestBoundsCommand, SetBoundsCommand, StackLayouter, VBoxLayouter
19
+ configureCommand,
20
+ configureLayout,
21
+ HBoxLayouter,
22
+ HiddenBoundsUpdater,
23
+ Layouter,
24
+ LayoutRegistry,
25
+ RequestBoundsCommand,
26
+ SetBoundsCommand,
27
+ VBoxLayouter
20
28
  } from 'sprotty';
21
- import '../../../css/command-palette.css';
22
29
  import { TYPES } from '../../base/types';
30
+ import { FreeFormLayouter } from './freeform-layout';
23
31
  import { GLSPHiddenBoundsUpdater } from './glsp-hidden-bounds-updater';
32
+ import { HBoxLayouterExt } from './hbox-layout';
33
+ import { VBoxLayouterExt } from './vbox-layout';
24
34
 
25
35
  const glspBoundsModule = new ContainerModule((bind, _unbind, isBound, _rebind) => {
26
- configureCommand({ bind, isBound }, SetBoundsCommand);
27
- configureCommand({ bind, isBound }, RequestBoundsCommand);
36
+ const context = { bind, isBound };
37
+ configureCommand(context, SetBoundsCommand);
38
+ configureCommand(context, RequestBoundsCommand);
28
39
  bind(HiddenBoundsUpdater).toSelf().inSingletonScope();
29
- bind(GLSPHiddenBoundsUpdater).toSelf().inSingletonScope();
30
- bind(TYPES.HiddenVNodePostprocessor).toService(GLSPHiddenBoundsUpdater);
40
+ bindAsService(context, TYPES.HiddenVNodePostprocessor, GLSPHiddenBoundsUpdater);
31
41
  bind(TYPES.Layouter).to(Layouter).inSingletonScope();
32
42
  bind(TYPES.LayoutRegistry).to(LayoutRegistry).inSingletonScope();
33
43
 
34
- configureLayout({ bind, isBound }, VBoxLayouter.KIND, VBoxLayouter);
35
- configureLayout({ bind, isBound }, HBoxLayouter.KIND, HBoxLayouter);
36
- configureLayout({ bind, isBound }, StackLayouter.KIND, StackLayouter);
44
+ configureLayout(context, VBoxLayouter.KIND, VBoxLayouterExt);
45
+ configureLayout(context, HBoxLayouter.KIND, HBoxLayouterExt);
46
+ configureLayout(context, FreeFormLayouter.KIND, FreeFormLayouter);
37
47
  });
38
48
 
39
49
  export default glspBoundsModule;
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2022 STMicroelectronics and others.
2
+ * Copyright (c) 2022-2023 STMicroelectronics and others.
3
3
  *
4
4
  * This program and the accompanying materials are made available under the
5
5
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -17,7 +17,7 @@ import { expect } from 'chai';
17
17
  import 'mocha';
18
18
  import 'reflect-metadata';
19
19
  import { BoundsData, ConsoleLogger, SModelElement } from 'sprotty';
20
- import { gModel, layout, sComp, setupLayoutRegistry, sLabel, sNode } from './layouter-test-util';
20
+ import { gModel, layout, sComp, setupLayoutRegistry, sLabel, sNode } from './layouter-test-util.spec';
21
21
 
22
22
  describe('FreeFormLayouter', () => {
23
23
  const layoutRegistry = setupLayoutRegistry();
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2021-2022 EclipseSource and others.
2
+ * Copyright (c) 2021-2023 EclipseSource and others.
3
3
  *
4
4
  * This program and the accompanying materials are made available under the
5
5
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -20,7 +20,7 @@ import { AbstractLayout } from 'sprotty/lib/features/bounds/abstract-layout';
20
20
  import { AbstractLayoutOptions } from 'sprotty/lib/features/bounds/layout-options';
21
21
 
22
22
  /**
23
- * Layouts children of a container with explit X/Y positions
23
+ * Layouts children of a container with explicit X/Y positions
24
24
  */
25
25
  @injectable()
26
26
  export class FreeFormLayouter extends AbstractLayout<AbstractLayoutOptions> {
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2022 EclipseSource and others.
2
+ * Copyright (c) 2022-2023 EclipseSource and others.
3
3
  *
4
4
  * This program and the accompanying materials are made available under the
5
5
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -14,10 +14,7 @@
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
16
 
17
- import {
18
- Action, ComputedBoundsAction, Deferred, ElementAndRoutingPoints, RequestAction,
19
- ResponseAction
20
- } from '@eclipse-glsp/protocol';
17
+ import { Action, ComputedBoundsAction, Deferred, ElementAndRoutingPoints, RequestAction, ResponseAction } from '@eclipse-glsp/protocol';
21
18
  import { inject, injectable, optional } from 'inversify';
22
19
  import { VNode } from 'snabbdom';
23
20
  import { EdgeRouterRegistry, HiddenBoundsUpdater, IActionDispatcher, SModelElement, SRoutableElement } from 'sprotty';
@@ -30,7 +27,6 @@ import { calcElementAndRoute, isRoutable } from '../../utils/smodel-util';
30
27
  */
31
28
  @injectable()
32
29
  export class GLSPHiddenBoundsUpdater extends HiddenBoundsUpdater {
33
-
34
30
  @inject(EdgeRouterRegistry) @optional() protected readonly edgeRouterRegistry?: EdgeRouterRegistry;
35
31
 
36
32
  protected element2route: ElementAndRoutingPoints[] = [];
@@ -47,7 +43,8 @@ export class GLSPHiddenBoundsUpdater extends HiddenBoundsUpdater {
47
43
 
48
44
  override postUpdate(cause?: Action): void {
49
45
  const actions = this.captureActions(() => super.postUpdate(cause));
50
- actions.filter(action => ComputedBoundsAction.is(action))
46
+ actions
47
+ .filter(action => ComputedBoundsAction.is(action))
51
48
  .forEach(action => this.actionDispatcher.dispatch(this.enhanceAction(action as ComputedBoundsAction)));
52
49
  this.element2route = [];
53
50
  }
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2022 TypeFox, STMicroelectronics and others.
2
+ * Copyright (c) 2022-2023 TypeFox, STMicroelectronics and others.
3
3
  *
4
4
  * This program and the accompanying materials are made available under the
5
5
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -19,7 +19,7 @@ import { expect } from 'chai';
19
19
  import 'mocha';
20
20
  import 'reflect-metadata';
21
21
  import { BoundsData, ConsoleLogger, SModelElement, SNode } from 'sprotty';
22
- import { layout, setupLayoutRegistry, sLabel, sNode } from './layouter-test-util';
22
+ import { layout, setupLayoutRegistry, sLabel, sNode } from './layouter-test-util.spec';
23
23
 
24
24
  describe('HBoxLayouter', () => {
25
25
  const layoutRegistry = setupLayoutRegistry();
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2021-2022 EclipseSource and others.
2
+ * Copyright (c) 2021-2023 EclipseSource and others.
3
3
  *
4
4
  * This program and the accompanying materials are made available under the
5
5
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -15,8 +15,8 @@
15
15
  ********************************************************************************/
16
16
 
17
17
  import { Dimension, Point } from '@eclipse-glsp/protocol';
18
+ import { Container } from 'inversify';
18
19
  import 'mocha';
19
- import 'reflect-metadata';
20
20
  import {
21
21
  BoundsData,
22
22
  ConsoleLogger,
@@ -30,9 +30,9 @@ import {
30
30
  SParentElement,
31
31
  TYPES
32
32
  } from 'sprotty';
33
- import { createDiagramContainer } from '../../../base/container-modules';
34
- import { GLSPGraph } from '../../../lib/model';
35
- import { StatefulLayouterExt } from '../layouter';
33
+ import { initializeDiagramContainer } from '../../base/container-modules';
34
+ import { GLSPGraph } from '../../lib/model';
35
+ import { StatefulLayouterExt } from './layouter';
36
36
 
37
37
  export function gModel(): GLSPGraph {
38
38
  return new GLSPGraph();
@@ -117,6 +117,6 @@ export function layout(
117
117
  export function setupLayoutRegistry(): LayoutRegistry {
118
118
  // Generic Test setup
119
119
  // create client container that registers all default modules including the layoutModule
120
- const layoutContainer = createDiagramContainer();
120
+ const layoutContainer = initializeDiagramContainer(new Container());
121
121
  return layoutContainer.get<LayoutRegistry>(TYPES.LayoutRegistry);
122
122
  }
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2022 EclipseSource and others.
2
+ * Copyright (c) 2022-2023 EclipseSource and others.
3
3
  *
4
4
  * This program and the accompanying materials are made available under the
5
5
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2022 TypeFox, STMicroelectronics and others.
2
+ * Copyright (c) 2022-2023 TypeFox, STMicroelectronics and others.
3
3
  *
4
4
  * This program and the accompanying materials are made available under the
5
5
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -19,7 +19,7 @@ import { expect } from 'chai';
19
19
  import 'mocha';
20
20
  import 'reflect-metadata';
21
21
  import { BoundsData, ConsoleLogger, SModelElement, SNode } from 'sprotty';
22
- import { layout, setupLayoutRegistry, sLabel, sNode } from './layouter-test-util';
22
+ import { layout, setupLayoutRegistry, sLabel, sNode } from './layouter-test-util.spec';
23
23
 
24
24
  describe('VBoxLayouter', () => {
25
25
  const layoutRegistry = setupLayoutRegistry();
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2021-2022 EclipseSource and others.
2
+ * Copyright (c) 2021-2023 EclipseSource and others.
3
3
  *
4
4
  * This program and the accompanying materials are made available under the
5
5
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2019-2021 EclipseSource and others.
2
+ * Copyright (c) 2019-2023 EclipseSource and others.
3
3
  *
4
4
  * This program and the accompanying materials are made available under the
5
5
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -25,7 +25,7 @@ export class CommandPaletteTool implements Tool {
25
25
 
26
26
  @postConstruct()
27
27
  protected postConstruct(): void {
28
- this.commandPaletteKeyListener = this.createCommandPaleteKeyListener();
28
+ this.commandPaletteKeyListener = this.createCommandPaletteKeyListener();
29
29
  }
30
30
 
31
31
  get id(): string {
@@ -40,7 +40,7 @@ export class CommandPaletteTool implements Tool {
40
40
  this.keyTool.deregister(this.commandPaletteKeyListener);
41
41
  }
42
42
 
43
- protected createCommandPaleteKeyListener(): KeyListener {
43
+ protected createCommandPaletteKeyListener(): KeyListener {
44
44
  return new CommandPaletteKeyListener();
45
45
  }
46
46
  }
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2019-2022 EclipseSource and others.
2
+ * Copyright (c) 2019-2023 EclipseSource and others.
3
3
  *
4
4
  * This program and the accompanying materials are made available under the
5
5
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -13,6 +13,7 @@
13
13
  *
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
+ import { bindAsService } from '@eclipse-glsp/protocol';
16
17
  import { ContainerModule } from 'inversify';
17
18
  import { CommandPalette, CommandPaletteActionProviderRegistry } from 'sprotty';
18
19
  import '../../../css/command-palette.css';
@@ -21,12 +22,10 @@ import { CommandPaletteTool } from './command-palette-tool';
21
22
  import { ServerCommandPaletteActionProvider } from './server-command-palette-provider';
22
23
 
23
24
  const glspCommandPaletteModule = new ContainerModule(bind => {
24
- bind(CommandPalette).toSelf().inSingletonScope();
25
- bind(TYPES.IUIExtension).toService(CommandPalette);
26
- bind(CommandPaletteActionProviderRegistry).toSelf().inSingletonScope();
27
- bind(TYPES.ICommandPaletteActionProviderRegistry).toService(CommandPaletteActionProviderRegistry);
28
- bind(TYPES.ICommandPaletteActionProvider).to(ServerCommandPaletteActionProvider);
29
- bind(TYPES.IDefaultTool).to(CommandPaletteTool);
25
+ bindAsService(bind, TYPES.IUIExtension, CommandPalette);
26
+ bind(TYPES.ICommandPaletteActionProviderRegistry).to(CommandPaletteActionProviderRegistry).inSingletonScope();
27
+ bindAsService(bind, TYPES.ICommandPaletteActionProvider, ServerCommandPaletteActionProvider);
28
+ bindAsService(bind, TYPES.IDefaultTool, CommandPaletteTool);
30
29
  });
31
30
 
32
31
  export default glspCommandPaletteModule;
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2019-2022 EclipseSource and others.
2
+ * Copyright (c) 2019-2023 EclipseSource and others.
3
3
  *
4
4
  * This program and the accompanying materials are made available under the
5
5
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -13,6 +13,7 @@
13
13
  *
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
+ import { bindAsService } from '@eclipse-glsp/protocol';
16
17
  import { ContainerModule } from 'inversify';
17
18
  import { ContextMenuProviderRegistry, IContextMenuService } from 'sprotty';
18
19
  import { TYPES } from '../../base/types';
@@ -30,9 +31,9 @@ const glspContextMenuModule = new ContainerModule(bind => {
30
31
  }
31
32
  })
32
33
  );
33
- bind(TYPES.MouseListener).to(SelectionServiceAwareContextMenuMouseListener);
34
+ bindAsService(bind, TYPES.MouseListener, SelectionServiceAwareContextMenuMouseListener);
34
35
  bind(TYPES.IContextMenuProviderRegistry).to(ContextMenuProviderRegistry);
35
- bind(TYPES.IContextMenuItemProvider).to(ServerContextMenuItemProvider);
36
+ bindAsService(bind, TYPES.IContextMenuItemProvider, ServerContextMenuItemProvider);
36
37
  });
37
38
 
38
39
  export default glspContextMenuModule;
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2019-2022 EclipseSource and others.
2
+ * Copyright (c) 2019-2023 EclipseSource and others.
3
3
  *
4
4
  * This program and the accompanying materials are made available under the
5
5
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -96,7 +96,7 @@ const CLIPBOARD_DATA_FORMAT = 'text/plain';
96
96
  export class ServerCopyPasteHandler implements ICopyPasteHandler {
97
97
  @inject(TYPES.IActionDispatcher) protected actionDispatcher: GLSPActionDispatcher;
98
98
  @inject(TYPES.ViewerOptions) protected viewerOptions: ViewerOptions;
99
- @inject(TYPES.IAsyncClipboardService) protected clipboadService: IAsyncClipboardService;
99
+ @inject(TYPES.IAsyncClipboardService) protected clipboardService: IAsyncClipboardService;
100
100
  @inject(EditorContextService) protected editorContext: EditorContextService;
101
101
 
102
102
  handleCopy(event: ClipboardEvent): void {
@@ -105,13 +105,13 @@ export class ServerCopyPasteHandler implements ICopyPasteHandler {
105
105
  event.clipboardData.setData(CLIPBOARD_DATA_FORMAT, toClipboardId(clipboardId));
106
106
  this.actionDispatcher
107
107
  .request<SetClipboardDataAction>(RequestClipboardDataAction.create(this.editorContext.get()))
108
- .then(action => this.clipboadService.put(action.clipboardData, clipboardId));
108
+ .then(action => this.clipboardService.put(action.clipboardData, clipboardId));
109
109
  event.preventDefault();
110
110
  } else {
111
111
  if (event.clipboardData) {
112
112
  event.clipboardData.clearData();
113
113
  }
114
- this.clipboadService.clear();
114
+ this.clipboardService.clear();
115
115
  }
116
116
  }
117
117
 
@@ -126,7 +126,7 @@ export class ServerCopyPasteHandler implements ICopyPasteHandler {
126
126
  handlePaste(event: ClipboardEvent): void {
127
127
  if (event.clipboardData && this.shouldPaste(event)) {
128
128
  const clipboardId = getClipboardIdFromDataTransfer(event.clipboardData);
129
- const clipboardData = this.clipboadService.get(clipboardId);
129
+ const clipboardData = this.clipboardService.get(clipboardId);
130
130
  if (clipboardData) {
131
131
  this.actionDispatcher.dispatch(PasteOperation.create({ clipboardData, editorContext: this.editorContext.get() }));
132
132
  }
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2020-2022 EclipseSource and others.
2
+ * Copyright (c) 2019-2023 EclipseSource and others.
3
3
  *
4
4
  * This program and the accompanying materials are made available under the
5
5
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -13,14 +13,14 @@
13
13
  *
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
+ import { bindAsService } from '@eclipse-glsp/protocol';
16
17
  import { ContainerModule } from 'inversify';
17
18
  import '../../../css/decoration.css';
18
19
  import { TYPES } from '../../base/types';
19
20
  import { GlspDecorationPlacer } from './decoration-placer';
20
21
 
21
- const glspDecorationModule = new ContainerModule((bind, _unbind, isBound) => {
22
- bind(GlspDecorationPlacer).toSelf().inSingletonScope();
23
- bind(TYPES.IVNodePostprocessor).toService(GlspDecorationPlacer);
22
+ const glspDecorationModule = new ContainerModule(bind => {
23
+ bindAsService(bind, TYPES.IVNodePostprocessor, GlspDecorationPlacer);
24
24
  });
25
25
 
26
26
  export default glspDecorationModule;
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2019-2022 EclipseSource and others.
2
+ * Copyright (c) 2019-2023 EclipseSource and others.
3
3
  *
4
4
  * This program and the accompanying materials are made available under the
5
5
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -13,6 +13,7 @@
13
13
  *
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
+ import { bindAsService } from '@eclipse-glsp/protocol';
16
17
  import { ContainerModule } from 'inversify';
17
18
  import { ApplyLabelEditCommand, configureCommand } from 'sprotty';
18
19
  import { TYPES } from '../../base/types';
@@ -22,7 +23,7 @@ import { BalloonLabelValidationDecorator, ServerEditLabelValidator } from './edi
22
23
  const glspEditLabelModule = new ContainerModule((bind, _unbind, isBound, _rebind) => {
23
24
  bind(TYPES.IEditLabelValidator).to(ServerEditLabelValidator);
24
25
  bind(TYPES.IEditLabelValidationDecorator).to(BalloonLabelValidationDecorator);
25
- bind(TYPES.IDefaultTool).to(DirectLabelEditTool);
26
+ bindAsService(bind, TYPES.IDefaultTool, DirectLabelEditTool);
26
27
  configureCommand({ bind, isBound }, ApplyLabelEditCommand);
27
28
  });
28
29
 
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2023 EclipseSource and others.
2
+ * Copyright (c) 2019-2023 EclipseSource and others.
3
3
  *
4
4
  * This program and the accompanying materials are made available under the
5
5
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -13,15 +13,16 @@
13
13
  *
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
+ import { bindAsService } from '@eclipse-glsp/protocol';
16
17
  import { ContainerModule } from 'inversify';
17
18
  import { configureCommand, ExportSvgCommand, ExportSvgKeyListener, ExportSvgPostprocessor, TYPES } from 'sprotty';
18
19
  import { GLSPSvgExporter } from './glsp-svg-exporter';
19
20
 
20
21
  const glspExportSvgModule = new ContainerModule((bind, _unbind, isBound) => {
21
- bind(ExportSvgKeyListener).toSelf().inSingletonScope();
22
- bind(TYPES.KeyListener).toService(ExportSvgKeyListener);
23
- bind(TYPES.HiddenVNodePostprocessor).to(ExportSvgPostprocessor).inSingletonScope();
24
- configureCommand({ bind, isBound }, ExportSvgCommand);
22
+ const context = { bind, isBound };
23
+ bindAsService(context, TYPES.KeyListener, ExportSvgKeyListener);
24
+ bindAsService(context, TYPES.HiddenVNodePostprocessor, ExportSvgPostprocessor);
25
+ configureCommand(context, ExportSvgCommand);
25
26
  bind(TYPES.SvgExporter).to(GLSPSvgExporter).inSingletonScope();
26
27
  });
27
28
 
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2022 EclipseSource and others.
2
+ * Copyright (c) 2022-2023 EclipseSource and others.
3
3
  *
4
4
  * This program and the accompanying materials are made available under the
5
5
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -18,8 +18,8 @@ import { injectable } from 'inversify';
18
18
  import { ExportSvgAction, SModelRoot, SvgExporter } from 'sprotty';
19
19
  import { v4 as uuid } from 'uuid';
20
20
 
21
- @injectable()
22
- export class GLSPSvgExporter extends SvgExporter {
21
+ @injectable()
22
+ export class GLSPSvgExporter extends SvgExporter {
23
23
  override export(root: SModelRoot, _request?: RequestAction<ExportSvgAction>): void {
24
24
  if (typeof document !== 'undefined') {
25
25
  const svgElement = this.findSvgElement();
@@ -30,9 +30,10 @@ import { v4 as uuid } from 'uuid';
30
30
  svgElement.id = originalId || uuid();
31
31
  // provide generated svg code with respective sizing for proper viewing in browser and remove undesired border
32
32
  const bounds = this.getBounds(root);
33
- const svg = this.createSvg(svgElement, root)
34
- .replace('style="',
35
- `style="width: ${bounds.width}px !important;height: ${bounds.height}px !important;border: none !important;`);
33
+ const svg = this.createSvg(svgElement, root).replace(
34
+ 'style="',
35
+ `style="width: ${bounds.width}px !important;height: ${bounds.height}px !important;border: none !important;`
36
+ );
36
37
  // do not give request/response id here as otherwise the action is treated as an unrequested response
37
38
  this.actionDispatcher.dispatch(ExportSvgAction.create(svg, ''));
38
39
  } finally {
@@ -47,4 +48,4 @@ import { v4 as uuid } from 'uuid';
47
48
  // search for first svg element as hierarchy within Sprotty might change
48
49
  return div && div.querySelector('svg');
49
50
  }
50
- }
51
+ }
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2020-2022 EclipseSource and others.
2
+ * Copyright (c) 2020-2023 EclipseSource and others.
3
3
  *
4
4
  * This program and the accompanying materials are made available under the
5
5
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -13,6 +13,7 @@
13
13
  *
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
+ import { bindAsService } from '@eclipse-glsp/protocol';
16
17
  import { ContainerModule } from 'inversify';
17
18
  import {
18
19
  CenterCommand,
@@ -36,11 +37,12 @@ import { FocusStateChangedAction } from '../../base/actions/focus-change-action'
36
37
  import { GlspHoverMouseListener } from './hover';
37
38
 
38
39
  const glspHoverModule = new ContainerModule((bind, _unbind, isBound) => {
39
- bind(TYPES.PopupVNodePostprocessor).to(PopupPositionUpdater).inSingletonScope();
40
- bind(GlspHoverMouseListener).toSelf().inSingletonScope();
41
- bind(TYPES.MouseListener).toService(GlspHoverMouseListener);
42
- bind(TYPES.PopupMouseListener).to(PopupHoverMouseListener);
43
- bind(TYPES.KeyListener).to(HoverKeyListener);
40
+ const context = { bind, isBound };
41
+ bindAsService(context, TYPES.PopupVNodePostprocessor, PopupPositionUpdater);
42
+ bindAsService(context, TYPES.MouseListener, GlspHoverMouseListener);
43
+ bindAsService(context, TYPES.PopupMouseListener, PopupHoverMouseListener);
44
+ bindAsService(context, TYPES.KeyListener, HoverKeyListener);
45
+
44
46
  bind<HoverState>(TYPES.HoverState).toConstantValue({
45
47
  mouseOverTimer: undefined,
46
48
  mouseOutTimer: undefined,
@@ -49,7 +51,6 @@ const glspHoverModule = new ContainerModule((bind, _unbind, isBound) => {
49
51
  });
50
52
  bind(ClosePopupActionHandler).toSelf().inSingletonScope();
51
53
 
52
- const context = { bind, isBound };
53
54
  configureCommand(context, HoverFeedbackCommand);
54
55
  configureCommand(context, SetPopupModelCommand);
55
56
  configureActionHandler(context, SetPopupModelCommand.KIND, ClosePopupActionHandler);
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2019-2022 EclipseSource and others.
2
+ * Copyright (c) 2019-2023 EclipseSource and others.
3
3
  *
4
4
  * This program and the accompanying materials are made available under the
5
5
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -14,27 +14,18 @@
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
16
  import { ContainerModule } from 'inversify';
17
- import { configureActionHandler, configureLayout, HBoxLayouter, TYPES, VBoxLayouter } from 'sprotty';
18
- import { FreeFormLayouter } from './freeform-layout';
19
- import { HBoxLayouterExt } from './hbox-layout';
17
+ import { configureActionHandler } from 'sprotty';
20
18
  import {
21
19
  AlignElementsAction,
22
20
  AlignElementsActionHandler,
23
21
  ResizeElementsAction,
24
22
  ResizeElementsActionHandler
25
23
  } from './layout-elements-action';
26
- import { LayouterExt } from './layouter';
27
- import { VBoxLayouterExt } from './vbox-layout';
28
24
 
29
25
  const layoutModule = new ContainerModule((bind, _unbind, isBound, rebind) => {
30
26
  const context = { bind, isBound };
31
27
  configureActionHandler(context, ResizeElementsAction.KIND, ResizeElementsActionHandler);
32
28
  configureActionHandler(context, AlignElementsAction.KIND, AlignElementsActionHandler);
33
-
34
- rebind(VBoxLayouter).to(VBoxLayouterExt);
35
- rebind(HBoxLayouter).to(HBoxLayouterExt);
36
- rebind(TYPES.Layouter).to(LayouterExt);
37
- configureLayout({ bind, isBound }, FreeFormLayouter.KIND, FreeFormLayouter);
38
29
  });
39
30
 
40
31
  export default layoutModule;
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2020-2021 EclipseSource and others.
2
+ * Copyright (c) 2020-2023 EclipseSource and others.
3
3
  *
4
4
  * This program and the accompanying materials are made available under the
5
5
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -19,7 +19,7 @@ import { configureActionHandler } from 'sprotty';
19
19
  import { NavigateAction, NavigationActionHandler, ProcessNavigationArgumentsAction } from './navigation-action-handler';
20
20
  import { NavigationTargetResolver } from './navigation-target-resolver';
21
21
 
22
- export const navigationModule = new ContainerModule((bind, _unbind, isBound) => {
22
+ const navigationModule = new ContainerModule((bind, _unbind, isBound) => {
23
23
  bind(NavigationTargetResolver).toSelf().inSingletonScope();
24
24
  bind(NavigationActionHandler).toSelf().inSingletonScope();
25
25
  configureActionHandler({ bind, isBound }, NavigateAction.KIND, NavigationActionHandler);
@@ -27,3 +27,5 @@ export const navigationModule = new ContainerModule((bind, _unbind, isBound) =>
27
27
  configureActionHandler({ bind, isBound }, ProcessNavigationArgumentsAction.KIND, NavigationActionHandler);
28
28
  configureActionHandler({ bind, isBound }, NavigateToExternalTargetAction.KIND, NavigationActionHandler);
29
29
  });
30
+
31
+ export default navigationModule;
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2020-2022 EclipseSource and others.
2
+ * Copyright (c) 2020-2023 EclipseSource and others.
3
3
  *
4
4
  * This program and the accompanying materials are made available under the
5
5
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -123,7 +123,7 @@ export namespace ProcessNavigationArgumentsAction {
123
123
  * *(a)* the navigation target already specifies element IDs, in which case this action handler navigates
124
124
  * to the specified elements directly, by the selecting them and centering them in the viewport.
125
125
  * *(b)* the arguments of the navigation targets don't contain element IDs, but other arguments, the
126
- * navigation target needs to be resolved into actual elment IDs by the `NavigationTargetResolver`.
126
+ * navigation target needs to be resolved into actual element IDs by the `NavigationTargetResolver`.
127
127
  * This can for instance be useful, if the navigation deals with queries or some other more complex
128
128
  * logic that can't be dealt with on the client.
129
129
  * *(c)* the target isn't resolved by the `NavigationTargetResolver`, e.g. because the `uri` doesn't match
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2019-2022 EclipseSource and others.
2
+ * Copyright (c) 2019-2023 EclipseSource and others.
3
3
  *
4
4
  * This program and the accompanying materials are made available under the
5
5
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -13,6 +13,7 @@
13
13
  *
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
+ import { bindAsService } from '@eclipse-glsp/protocol';
16
17
  import { ContainerModule } from 'inversify';
17
18
  import { TYPES } from '../../base/types';
18
19
  import { SaveModelKeyboardListener } from './save-keylistener';
@@ -22,7 +23,7 @@ import { SaveModelKeyboardListener } from './save-keylistener';
22
23
  * but only intended to be used in a standalone deployment of GLSP.
23
24
  */
24
25
  const saveModule = new ContainerModule(bind => {
25
- bind(TYPES.KeyListener).to(SaveModelKeyboardListener);
26
+ bindAsService(bind, TYPES.KeyListener, SaveModelKeyboardListener);
26
27
  });
27
28
 
28
29
  export default saveModule;
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2019-2022 EclipseSource and others.
2
+ * Copyright (c) 2019-2023 EclipseSource and others.
3
3
  *
4
4
  * This program and the accompanying materials are made available under the
5
5
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -13,6 +13,7 @@
13
13
  *
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
+ import { bindAsService } from '@eclipse-glsp/protocol';
16
17
  import { ContainerModule } from 'inversify';
17
18
  import { configureCommand } from 'sprotty';
18
19
  import { TYPES } from '../../base/types';
@@ -21,12 +22,12 @@ import { RankedSelectMouseListener } from './select-mouse-listener';
21
22
  import { SelectAllCommand, SelectCommand, SelectionService } from './selection-service';
22
23
 
23
24
  const glspSelectModule = new ContainerModule((bind, _unbind, isBound) => {
24
- bind(SelectionService).toSelf().inSingletonScope();
25
- bind(TYPES.SelectionService).toService(SelectionService);
26
- configureCommand({ bind, isBound }, SelectCommand);
27
- configureCommand({ bind, isBound }, SelectAllCommand);
28
- configureCommand({ bind, isBound }, SelectFeedbackCommand);
29
- bind(TYPES.MouseListener).to(RankedSelectMouseListener);
25
+ const context = { bind, isBound };
26
+ bindAsService(context, TYPES.SelectionService, SelectionService);
27
+ configureCommand(context, SelectCommand);
28
+ configureCommand(context, SelectAllCommand);
29
+ configureCommand(context, SelectFeedbackCommand);
30
+ bindAsService(context, TYPES.MouseListener, RankedSelectMouseListener);
30
31
  bind(TYPES.SModelRootListener).toService(SelectionService);
31
32
  });
32
33