@eclipse-glsp/server 1.1.0-next.3d7585d.42 → 1.1.0-next.44aae0c.44

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 (175) hide show
  1. package/lib/common/command/command-stack.d.ts +45 -14
  2. package/lib/common/command/command-stack.d.ts.map +1 -1
  3. package/lib/common/command/command-stack.js +78 -9
  4. package/lib/common/command/command-stack.js.map +1 -1
  5. package/lib/common/command/command-stack.spec.d.ts +2 -0
  6. package/lib/common/command/command-stack.spec.d.ts.map +1 -0
  7. package/lib/common/command/command-stack.spec.js +207 -0
  8. package/lib/common/command/command-stack.spec.js.map +1 -0
  9. package/lib/common/command/command.d.ts +34 -7
  10. package/lib/common/command/command.d.ts.map +1 -1
  11. package/lib/common/command/command.js +73 -0
  12. package/lib/common/command/command.js.map +1 -1
  13. package/lib/common/command/command.spec.d.ts +2 -0
  14. package/lib/common/command/command.spec.d.ts.map +1 -0
  15. package/lib/common/command/command.spec.js +86 -0
  16. package/lib/common/command/command.spec.js.map +1 -0
  17. package/lib/common/command/recording-command.d.ts +75 -0
  18. package/lib/common/command/recording-command.d.ts.map +1 -0
  19. package/lib/common/command/recording-command.js +99 -0
  20. package/lib/common/command/recording-command.js.map +1 -0
  21. package/lib/common/command/recording-command.spec.d.ts +17 -0
  22. package/lib/common/command/recording-command.spec.d.ts.map +1 -0
  23. package/lib/common/command/recording-command.spec.js +62 -0
  24. package/lib/common/command/recording-command.spec.js.map +1 -0
  25. package/lib/common/command/undo-redo-action-handler.d.ts +28 -0
  26. package/lib/common/command/undo-redo-action-handler.d.ts.map +1 -0
  27. package/lib/common/command/undo-redo-action-handler.js +72 -0
  28. package/lib/common/command/undo-redo-action-handler.js.map +1 -0
  29. package/lib/common/di/diagram-module.d.ts +3 -0
  30. package/lib/common/di/diagram-module.d.ts.map +1 -1
  31. package/lib/common/di/diagram-module.js +12 -0
  32. package/lib/common/di/diagram-module.js.map +1 -1
  33. package/lib/common/features/contextactions/tool-palette-item-provider.d.ts +1 -1
  34. package/lib/common/features/contextactions/tool-palette-item-provider.d.ts.map +1 -1
  35. package/lib/common/features/contextactions/tool-palette-item-provider.js +2 -4
  36. package/lib/common/features/contextactions/tool-palette-item-provider.js.map +1 -1
  37. package/lib/common/{gmodel → features/layout}/computed-bounds-action-handler.d.ts +8 -3
  38. package/lib/common/features/layout/computed-bounds-action-handler.d.ts.map +1 -0
  39. package/lib/common/{gmodel → features/layout}/computed-bounds-action-handler.js +8 -3
  40. package/lib/common/features/layout/computed-bounds-action-handler.js.map +1 -0
  41. package/lib/common/features/layout/layout-operation-handler.d.ts +12 -3
  42. package/lib/common/features/layout/layout-operation-handler.d.ts.map +1 -1
  43. package/lib/common/features/layout/layout-operation-handler.js +26 -10
  44. package/lib/common/features/layout/layout-operation-handler.js.map +1 -1
  45. package/lib/common/features/model/model-state.d.ts +0 -2
  46. package/lib/common/features/model/model-state.d.ts.map +1 -1
  47. package/lib/common/features/model/model-state.js +0 -1
  48. package/lib/common/features/model/model-state.js.map +1 -1
  49. package/lib/common/features/model/model-submission-handler.d.ts +2 -0
  50. package/lib/common/features/model/model-submission-handler.d.ts.map +1 -1
  51. package/lib/common/features/model/model-submission-handler.js +7 -2
  52. package/lib/common/features/model/model-submission-handler.js.map +1 -1
  53. package/lib/common/features/model/save-model-action-handler.d.ts +2 -2
  54. package/lib/common/features/model/save-model-action-handler.d.ts.map +1 -1
  55. package/lib/common/features/model/save-model-action-handler.js +5 -5
  56. package/lib/common/features/model/save-model-action-handler.js.map +1 -1
  57. package/lib/common/gmodel/apply-label-edit-operation-handler.d.ts +4 -5
  58. package/lib/common/gmodel/apply-label-edit-operation-handler.d.ts.map +1 -1
  59. package/lib/common/gmodel/apply-label-edit-operation-handler.js +12 -21
  60. package/lib/common/gmodel/apply-label-edit-operation-handler.js.map +1 -1
  61. package/lib/common/gmodel/change-bounds-operation-handler.d.ts +9 -6
  62. package/lib/common/gmodel/change-bounds-operation-handler.d.ts.map +1 -1
  63. package/lib/common/gmodel/change-bounds-operation-handler.js +14 -14
  64. package/lib/common/gmodel/change-bounds-operation-handler.js.map +1 -1
  65. package/lib/common/gmodel/change-routing-points-operation-handler.d.ts +5 -5
  66. package/lib/common/gmodel/change-routing-points-operation-handler.d.ts.map +1 -1
  67. package/lib/common/gmodel/change-routing-points-operation-handler.js +11 -14
  68. package/lib/common/gmodel/change-routing-points-operation-handler.js.map +1 -1
  69. package/lib/common/{operations → gmodel}/cut-operation-handler.d.ts +5 -4
  70. package/lib/common/gmodel/cut-operation-handler.d.ts.map +1 -0
  71. package/lib/common/{operations → gmodel}/cut-operation-handler.js +13 -11
  72. package/lib/common/gmodel/cut-operation-handler.js.map +1 -0
  73. package/lib/common/gmodel/delete-operation-handler.d.ts +6 -6
  74. package/lib/common/gmodel/delete-operation-handler.d.ts.map +1 -1
  75. package/lib/common/gmodel/delete-operation-handler.js +13 -10
  76. package/lib/common/gmodel/delete-operation-handler.js.map +1 -1
  77. package/lib/common/gmodel/gmodel-create-edge-operation-handler.d.ts +11 -7
  78. package/lib/common/gmodel/gmodel-create-edge-operation-handler.d.ts.map +1 -1
  79. package/lib/common/gmodel/gmodel-create-edge-operation-handler.js +12 -13
  80. package/lib/common/gmodel/gmodel-create-edge-operation-handler.js.map +1 -1
  81. package/lib/common/gmodel/gmodel-create-node-operation-handler.d.ts +32 -5
  82. package/lib/common/gmodel/gmodel-create-node-operation-handler.d.ts.map +1 -1
  83. package/lib/common/gmodel/gmodel-create-node-operation-handler.js +45 -3
  84. package/lib/common/gmodel/gmodel-create-node-operation-handler.js.map +1 -1
  85. package/lib/common/gmodel/gmodel-diagram-module.d.ts +8 -8
  86. package/lib/common/gmodel/gmodel-diagram-module.d.ts.map +1 -1
  87. package/lib/common/gmodel/gmodel-diagram-module.js +15 -21
  88. package/lib/common/gmodel/gmodel-diagram-module.js.map +1 -1
  89. package/lib/common/gmodel/gmodel-operation-handler.d.ts +23 -0
  90. package/lib/common/gmodel/gmodel-operation-handler.d.ts.map +1 -0
  91. package/lib/common/gmodel/gmodel-operation-handler.js +43 -0
  92. package/lib/common/gmodel/gmodel-operation-handler.js.map +1 -0
  93. package/lib/common/gmodel/index.d.ts +2 -1
  94. package/lib/common/gmodel/index.d.ts.map +1 -1
  95. package/lib/common/gmodel/index.js +2 -1
  96. package/lib/common/gmodel/index.js.map +1 -1
  97. package/lib/common/gmodel/paste-operation-handler.d.ts +7 -6
  98. package/lib/common/gmodel/paste-operation-handler.d.ts.map +1 -1
  99. package/lib/common/gmodel/paste-operation-handler.js +20 -15
  100. package/lib/common/gmodel/paste-operation-handler.js.map +1 -1
  101. package/lib/common/gmodel/reconnect-edge-operation-handler.d.ts +5 -5
  102. package/lib/common/gmodel/reconnect-edge-operation-handler.d.ts.map +1 -1
  103. package/lib/common/gmodel/reconnect-edge-operation-handler.js +11 -14
  104. package/lib/common/gmodel/reconnect-edge-operation-handler.js.map +1 -1
  105. package/lib/common/index.d.ts +2 -1
  106. package/lib/common/index.d.ts.map +1 -1
  107. package/lib/common/index.js +2 -1
  108. package/lib/common/index.js.map +1 -1
  109. package/lib/common/operations/compound-operation-handler.d.ts +5 -5
  110. package/lib/common/operations/compound-operation-handler.d.ts.map +1 -1
  111. package/lib/common/operations/compound-operation-handler.js +37 -9
  112. package/lib/common/operations/compound-operation-handler.js.map +1 -1
  113. package/lib/common/operations/create-operation-handler.d.ts +8 -40
  114. package/lib/common/operations/create-operation-handler.d.ts.map +1 -1
  115. package/lib/common/operations/create-operation-handler.js +26 -85
  116. package/lib/common/operations/create-operation-handler.js.map +1 -1
  117. package/lib/common/operations/operation-action-handler.d.ts +10 -1
  118. package/lib/common/operations/operation-action-handler.d.ts.map +1 -1
  119. package/lib/common/operations/operation-action-handler.js +37 -22
  120. package/lib/common/operations/operation-action-handler.js.map +1 -1
  121. package/lib/common/operations/operation-handler-registry.d.ts +11 -2
  122. package/lib/common/operations/operation-handler-registry.d.ts.map +1 -1
  123. package/lib/common/operations/operation-handler-registry.js +31 -2
  124. package/lib/common/operations/operation-handler-registry.js.map +1 -1
  125. package/lib/common/operations/operation-handler.d.ts +28 -11
  126. package/lib/common/operations/operation-handler.d.ts.map +1 -1
  127. package/lib/common/operations/operation-handler.js +50 -1
  128. package/lib/common/operations/operation-handler.js.map +1 -1
  129. package/lib/common/test/mock-util.d.ts +14 -1
  130. package/lib/common/test/mock-util.d.ts.map +1 -1
  131. package/lib/common/test/mock-util.js +42 -37
  132. package/lib/common/test/mock-util.js.map +1 -1
  133. package/package.json +4 -3
  134. package/src/common/command/command-stack.spec.ts +239 -0
  135. package/src/common/command/command-stack.ts +106 -20
  136. package/src/common/command/command.spec.ts +92 -0
  137. package/src/common/command/command.ts +96 -7
  138. package/src/common/command/recording-command.spec.ts +74 -0
  139. package/src/common/command/recording-command.ts +119 -0
  140. package/src/common/command/undo-redo-action-handler.ts +57 -0
  141. package/src/common/di/diagram-module.ts +13 -0
  142. package/src/common/features/contextactions/tool-palette-item-provider.ts +2 -4
  143. package/src/common/{gmodel → features/layout}/computed-bounds-action-handler.ts +9 -4
  144. package/src/common/features/layout/layout-operation-handler.ts +26 -11
  145. package/src/common/features/model/model-state.ts +0 -3
  146. package/src/common/features/model/model-submission-handler.ts +6 -2
  147. package/src/common/features/model/save-model-action-handler.ts +5 -6
  148. package/src/common/gmodel/apply-label-edit-operation-handler.ts +13 -15
  149. package/src/common/gmodel/change-bounds-operation-handler.ts +12 -8
  150. package/src/common/gmodel/change-routing-points-operation-handler.ts +8 -7
  151. package/src/common/{operations → gmodel}/cut-operation-handler.ts +9 -8
  152. package/src/common/gmodel/delete-operation-handler.ts +16 -10
  153. package/src/common/gmodel/gmodel-create-edge-operation-handler.ts +16 -10
  154. package/src/common/gmodel/gmodel-create-node-operation-handler.ts +54 -6
  155. package/src/common/gmodel/gmodel-diagram-module.ts +22 -27
  156. package/src/common/gmodel/gmodel-operation-handler.ts +31 -0
  157. package/src/common/gmodel/index.ts +2 -1
  158. package/src/common/gmodel/paste-operation-handler.ts +19 -11
  159. package/src/common/gmodel/reconnect-edge-operation-handler.ts +8 -7
  160. package/src/common/index.ts +2 -1
  161. package/src/common/operations/compound-operation-handler.ts +14 -12
  162. package/src/common/operations/create-operation-handler.ts +17 -74
  163. package/src/common/operations/operation-action-handler.ts +51 -27
  164. package/src/common/operations/operation-handler-registry.ts +18 -3
  165. package/src/common/operations/operation-handler.ts +38 -13
  166. package/src/common/test/mock-util.ts +42 -36
  167. package/lib/common/gmodel/apply-label-edit-operation-handler.spec.d.ts +0 -2
  168. package/lib/common/gmodel/apply-label-edit-operation-handler.spec.d.ts.map +0 -1
  169. package/lib/common/gmodel/apply-label-edit-operation-handler.spec.js +0 -38
  170. package/lib/common/gmodel/apply-label-edit-operation-handler.spec.js.map +0 -1
  171. package/lib/common/gmodel/computed-bounds-action-handler.d.ts.map +0 -1
  172. package/lib/common/gmodel/computed-bounds-action-handler.js.map +0 -1
  173. package/lib/common/operations/cut-operation-handler.d.ts.map +0 -1
  174. package/lib/common/operations/cut-operation-handler.js.map +0 -1
  175. package/src/common/gmodel/apply-label-edit-operation-handler.spec.ts +0 -40
@@ -43,7 +43,7 @@ export declare abstract class ToolPaletteItemProvider implements ContextActionsP
43
43
  export declare class DefaultToolPaletteItemProvider extends ToolPaletteItemProvider {
44
44
  operationHandlerRegistry: OperationHandlerRegistry;
45
45
  protected counter: number;
46
- getItems(args?: Args): PaletteItem[];
46
+ getItems(_args?: Args): PaletteItem[];
47
47
  createPaletteItem(handlers: CreateOperationHandler[], kind: string): PaletteItem[];
48
48
  create(action: PaletteItem.TriggerElementCreationAction, label: string): PaletteItem;
49
49
  }
@@ -1 +1 @@
1
- {"version":3,"file":"tool-palette-item-provider.d.ts","sourceRoot":"","sources":["../../../../src/common/features/contextactions/tool-palette-item-provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EACH,IAAI,EAGJ,aAAa,EACb,aAAa,EACb,YAAY,EACZ,WAAW,EACd,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAC;AACnF,OAAO,EAAE,wBAAwB,EAAE,MAAM,6CAA6C,CAAC;AACvF,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAEpE;;GAEG;AACH,8BACsB,uBAAwB,YAAW,sBAAsB;IAC3E;;OAEG;IACH,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED;;;;;OAKG;IACG,UAAU,CAAC,aAAa,EAAE,aAAa,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;IAIxE;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG,YAAY,CAAC,WAAW,EAAE,CAAC;CAC9D;AAED,qBACa,8BAA+B,SAAQ,uBAAuB;IACrC,wBAAwB,EAAE,wBAAwB,CAAC;IACrF,SAAS,CAAC,OAAO,EAAE,MAAM,CAAC;IAE1B,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG,WAAW,EAAE;IAapC,iBAAiB,CAAC,QAAQ,EAAE,sBAAsB,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,WAAW,EAAE;IAQlF,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,4BAA4B,EAAE,KAAK,EAAE,MAAM,GAAG,WAAW;CAGvF"}
1
+ {"version":3,"file":"tool-palette-item-provider.d.ts","sourceRoot":"","sources":["../../../../src/common/features/contextactions/tool-palette-item-provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EACH,IAAI,EAGJ,aAAa,EACb,aAAa,EACb,YAAY,EACZ,WAAW,EACd,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAC;AACnF,OAAO,EAAE,wBAAwB,EAAE,MAAM,6CAA6C,CAAC;AACvF,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAEpE;;GAEG;AACH,8BACsB,uBAAwB,YAAW,sBAAsB;IAC3E;;OAEG;IACH,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED;;;;;OAKG;IACG,UAAU,CAAC,aAAa,EAAE,aAAa,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;IAIxE;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG,YAAY,CAAC,WAAW,EAAE,CAAC;CAC9D;AAED,qBACa,8BAA+B,SAAQ,uBAAuB;IACrC,wBAAwB,EAAE,wBAAwB,CAAC;IACrF,SAAS,CAAC,OAAO,EAAE,MAAM,CAAC;IAE1B,QAAQ,CAAC,KAAK,CAAC,EAAE,IAAI,GAAG,WAAW,EAAE;IAWrC,iBAAiB,CAAC,QAAQ,EAAE,sBAAsB,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,WAAW,EAAE;IAQlF,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,4BAA4B,EAAE,KAAK,EAAE,MAAM,GAAG,WAAW;CAGvF"}
@@ -54,10 +54,8 @@ ToolPaletteItemProvider = __decorate([
54
54
  ], ToolPaletteItemProvider);
55
55
  exports.ToolPaletteItemProvider = ToolPaletteItemProvider;
56
56
  let DefaultToolPaletteItemProvider = class DefaultToolPaletteItemProvider extends ToolPaletteItemProvider {
57
- getItems(args) {
58
- const handlers = this.operationHandlerRegistry
59
- .getAll()
60
- .filter(handler => handler instanceof create_operation_handler_1.CreateOperationHandler);
57
+ getItems(_args) {
58
+ const handlers = this.operationHandlerRegistry.getAll().filter(create_operation_handler_1.CreateOperationHandler.is);
61
59
  this.counter = 0;
62
60
  const nodes = this.createPaletteItem(handlers, protocol_1.CreateNodeOperation.KIND);
63
61
  const edges = this.createPaletteItem(handlers, protocol_1.CreateEdgeOperation.KIND);
@@ -1 +1 @@
1
- {"version":3,"file":"tool-palette-item-provider.js","sourceRoot":"","sources":["../../../../src/common/features/contextactions/tool-palette-item-provider.ts"],"names":[],"mapp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,GAAG,EAAE;SAC/G,CAAC;IACN,CAAC;IAED,iBAAiB,CAAC,QAAkC,EAAE,IAAY;QAC9D,OAAO,QAAQ;aACV,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,aAAa,KAAK,IAAI,CAAC;aACjD,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,iBAAiB,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;aAC7F,MAAM,CAAC,CAAC,WAAW,EAAE,KAAK,EAAE,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC;aAC7D,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;IAClE,CAAC;IAED,MAAM,CAAC,MAAgD,EAAE,KAAa;QAClE,OAAO,EAAE,EAAE,EAAE,eAAe,IAAI,CAAC,OAAO,EAAE,EAAE,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC;IACxG,CAAC;CACJ,CAAA;AA3BG;IAAC,IAAA,kBAAM,EAAC,qDAAwB,CAAC;8BAA2B,qDAAwB;gFAAC;AAD5E,8BAA8B;IAD1C,IAAA,sBAAU,GAAE;GACA,8BAA8B,CA4B1C;AA5BY,wEAA8B"}
1
+ {"version":3,"file":"tool-palette-item-provider.js","sourceRoot":"","sources":["../../../../src/common/features/contextactions/tool-palette-item-provider.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,qDAQgC;AAChC,yCAA+C;AAC/C,wFAAmF;AACnF,4FAAuF;AAGvF;;GAEG;AAEI,IAAe,uB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AK,IAAI,CAAC;aACjD,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,iBAAiB,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;aAC7F,MAAM,CAAC,CAAC,WAAW,EAAE,KAAK,EAAE,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC;aAC7D,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;IAClE,CAAC;IAED,MAAM,CAAC,MAAgD,EAAE,KAAa;QAClE,OAAO,EAAE,EAAE,EAAE,eAAe,IAAI,CAAC,OAAO,EAAE,EAAE,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC;IACxG,CAAC;CACJ,CAAA;AAzBG;IAAC,IAAA,kBAAM,EAAC,qDAAwB,CAAC;8BAA2B,qDAAwB;gFAAC;AAD5E,8BAA8B;IAD1C,IAAA,sBAAU,GAAE;GACA,8BAA8B,CA0B1C;AA1BY,wEAA8B"}
@@ -15,9 +15,14 @@
15
15
  ********************************************************************************/
16
16
  import { GModelRoot } from '@eclipse-glsp/graph';
17
17
  import { Action, ComputedBoundsAction, MaybePromise } from '@eclipse-glsp/protocol';
18
- import { ActionHandler } from '../actions/action-handler';
19
- import { ModelState } from '../features/model/model-state';
20
- import { ModelSubmissionHandler } from '../features/model/model-submission-handler';
18
+ import { ActionHandler } from '../../actions/action-handler';
19
+ import { ModelState } from '../model/model-state';
20
+ import { ModelSubmissionHandler } from '../model/model-submission-handler';
21
+ /**
22
+ * Syncs the bounds computed by the client (i.e. the actual bounds after applying CSS styles) back to the `GModel`.
23
+ * In this default implementation the updated bounds are stored transient. This means they are applied to the graphical model but
24
+ * are not persisted to the source model.
25
+ */
21
26
  export declare class ComputedBoundsActionHandler implements ActionHandler {
22
27
  protected submissionHandler: ModelSubmissionHandler;
23
28
  protected modelState: ModelState;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"computed-bounds-action-handler.d.ts","sourceRoot":"","sources":["../../../../src/common/features/layout/computed-bounds-action-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEpF,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE7D,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAE3E;;;;GAIG;AACH,qBACa,2BAA4B,YAAW,aAAa;IAE7D,SAAS,CAAC,iBAAiB,EAAE,sBAAsB,CAAC;IAGpD,SAAS,CAAC,UAAU,EAAE,UAAU,CAAC;IAEjC,WAAW,WAA+B;IAC1C,OAAO,CAAC,MAAM,EAAE,oBAAoB,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC;IAU7D,SAAS,CAAC,WAAW,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,oBAAoB,GAAG,IAAI;IAO3E,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACjC"}
@@ -12,9 +12,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.ComputedBoundsActionHandler = void 0;
13
13
  const protocol_1 = require("@eclipse-glsp/protocol");
14
14
  const inversify_1 = require("inversify");
15
- const model_state_1 = require("../features/model/model-state");
16
- const model_submission_handler_1 = require("../features/model/model-submission-handler");
17
- const layout_util_1 = require("../utils/layout-util");
15
+ const layout_util_1 = require("../../utils/layout-util");
16
+ const model_state_1 = require("../model/model-state");
17
+ const model_submission_handler_1 = require("../model/model-submission-handler");
18
+ /**
19
+ * Syncs the bounds computed by the client (i.e. the actual bounds after applying CSS styles) back to the `GModel`.
20
+ * In this default implementation the updated bounds are stored transient. This means they are applied to the graphical model but
21
+ * are not persisted to the source model.
22
+ */
18
23
  let ComputedBoundsActionHandler = class ComputedBoundsActionHandler {
19
24
  constructor() {
20
25
  this.actionKinds = [protocol_1.ComputedBoundsAction.KIND];
@@ -0,0 +1 @@
1
+ {"version":3,"file":"computed-bounds-action-handler.js","sourceRoot":"","sources":["../../../../src/common/features/layout/computed-bounds-action-handler.ts"],"names":[],"mappings":";;;;;;;;;;;;AAgBA,qDAAoF;AACpF,yCAA+C;AAE/C,yDAAkF;AAClF,sDAAkD;AAClD,gFAA2E;AAE3E;;;;GAIG;AAEI,IAAM,2BAA2B,GAAjC,MAAM,2BAA2B;IAAjC;QAOH,gBAAW,GAAG,CAAC,+BAAoB,CAAC,IAAI,CAAC,CAAC;IAmB9C,CAAC;IAlBG,OAAO,CAAC,MAA4B;QAChC,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;QACnC,IAAI,MAAM,CAAC,QAAQ,KAAK,KAAK,CAAC,QAAQ,EAAE;YACpC,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;YAChC,OAAO,IAAI,CAAC,iBAAiB,CAAC,mBAAmB,EAAE,CAAC;SACvD;QAED,OAAO,EAAE,CAAC;IACd,CAAC;IAES,WAAW,CAAC,IAAgB,EAAE,MAA4B;;QAChE,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC;QACpC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,IAAA,yBAAW,EAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC;QAC5D,CAAC,MAAA,MAAM,CAAC,UAAU,mCAAI,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC,IAAA,4BAAc,EAAC,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC;QACjF,CAAC,MAAA,MAAM,CAAC,MAAM,mCAAI,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,IAAA,wBAAU,EAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;IACrE,CAAC;CAGJ,CAAA;AAzBG;IAAC,IAAA,kBAAM,EAAC,iDAAsB,CAAC;8BACF,iDAAsB;sEAAC;AAEpD;IAAC,IAAA,kBAAM,EAAC,wBAAU,CAAC;;+DACc;AALxB,2BAA2B;IADvC,IAAA,sBAAU,GAAE;GACA,2BAA2B,CA0BvC;AA1BY,kEAA2B"}
@@ -13,16 +13,25 @@
13
13
  *
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
- import { Operation } from '@eclipse-glsp/protocol';
16
+ import { LayoutOperation, MaybePromise, Operation } from '@eclipse-glsp/protocol';
17
+ import { Command } from '../../command/command';
17
18
  import { DiagramConfiguration } from '../../diagram/diagram-configuration';
18
19
  import { OperationHandler } from '../../operations/operation-handler';
19
20
  import { Logger } from '../../utils/logger';
21
+ import { GModelSerializer } from '../model/gmodel-serializer';
20
22
  import { LayoutEngine } from './layout-engine';
21
- export declare class LayoutOperationHandler implements OperationHandler {
23
+ /**
24
+ * The default handler for `{@link LayoutOperation}s. Does invoke the (optional) layout engine
25
+ * if the server is configured for manual layouting. Changes are stored transient in the graphical model and are not
26
+ * persisted in the source model.
27
+ */
28
+ export declare class LayoutOperationHandler extends OperationHandler {
22
29
  protected logger: Logger;
23
30
  protected layoutEngine?: LayoutEngine;
24
31
  protected diagramConfiguration: DiagramConfiguration;
32
+ protected serializer: GModelSerializer;
25
33
  readonly operationType = "layout";
26
- execute(operation: Operation): Promise<void>;
34
+ createCommand(operation: LayoutOperation): MaybePromise<Command | undefined>;
35
+ protected executeOperation(_operation: Operation): Promise<void>;
27
36
  }
28
37
  //# sourceMappingURL=layout-operation-handler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"layout-operation-handler.d.ts","sourceRoot":"","sources":["../../../../src/common/features/layout/layout-operation-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAmB,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEpE,OAAO,EAAE,oBAAoB,EAAoB,MAAM,qCAAqC,CAAC;AAC7F,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,qBACa,sBAAuB,YAAW,gBAAgB;IAE3D,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC;IAIzB,SAAS,CAAC,YAAY,CAAC,EAAE,YAAY,CAAC;IAGtC,SAAS,CAAC,oBAAoB,EAAE,oBAAoB,CAAC;IAErD,QAAQ,CAAC,aAAa,YAAwB;IACxC,OAAO,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;CAWrD"}
1
+ {"version":3,"file":"layout-operation-handler.d.ts","sourceRoot":"","sources":["../../../../src/common/features/layout/layout-operation-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAElF,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEhD,OAAO,EAAE,oBAAoB,EAAoB,MAAM,qCAAqC,CAAC;AAC7F,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C;;;;GAIG;AACH,qBACa,sBAAuB,SAAQ,gBAAgB;IAExD,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC;IAIzB,SAAS,CAAC,YAAY,CAAC,EAAE,YAAY,CAAC;IAGtC,SAAS,CAAC,oBAAoB,EAAE,oBAAoB,CAAC;IAGrD,SAAS,CAAC,UAAU,EAAE,gBAAgB,CAAC;IAEvC,QAAQ,CAAC,aAAa,YAAwB;IAE9C,aAAa,CAAC,SAAS,EAAE,eAAe,GAAG,YAAY,CAAC,OAAO,GAAG,SAAS,CAAC;cAW5D,gBAAgB,CAAC,UAAU,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;CAGzE"}
@@ -27,23 +27,35 @@ exports.LayoutOperationHandler = void 0;
27
27
  ********************************************************************************/
28
28
  const protocol_1 = require("@eclipse-glsp/protocol");
29
29
  const inversify_1 = require("inversify");
30
+ const recording_command_1 = require("../../command/recording-command");
30
31
  const diagram_configuration_1 = require("../../diagram/diagram-configuration");
32
+ const operation_handler_1 = require("../../operations/operation-handler");
31
33
  const logger_1 = require("../../utils/logger");
34
+ const gmodel_serializer_1 = require("../model/gmodel-serializer");
32
35
  const layout_engine_1 = require("./layout-engine");
33
- let LayoutOperationHandler = class LayoutOperationHandler {
36
+ /**
37
+ * The default handler for `{@link LayoutOperation}s. Does invoke the (optional) layout engine
38
+ * if the server is configured for manual layouting. Changes are stored transient in the graphical model and are not
39
+ * persisted in the source model.
40
+ */
41
+ let LayoutOperationHandler = class LayoutOperationHandler extends operation_handler_1.OperationHandler {
34
42
  constructor() {
43
+ super(...arguments);
35
44
  this.operationType = protocol_1.LayoutOperation.KIND;
36
45
  }
37
- async execute(operation) {
38
- if (operation.kind === protocol_1.LayoutOperation.KIND) {
39
- if (this.diagramConfiguration.layoutKind === diagram_configuration_1.ServerLayoutKind.MANUAL) {
40
- if (this.layoutEngine) {
41
- await this.layoutEngine.layout();
42
- return;
43
- }
44
- this.logger.warn('Could not execute layout operation. No `LayoutEngine` is bound!');
45
- }
46
+ createCommand(operation) {
47
+ if (this.diagramConfiguration.layoutKind !== diagram_configuration_1.ServerLayoutKind.MANUAL) {
48
+ return undefined;
46
49
  }
50
+ if (!this.layoutEngine) {
51
+ this.logger.warn('Could not execute layout operation. No `LayoutEngine` is bound!');
52
+ return undefined;
53
+ }
54
+ return new recording_command_1.GModelRecordingCommand(this.modelState, this.serializer, () => this.executeOperation(operation));
55
+ }
56
+ async executeOperation(_operation) {
57
+ var _a;
58
+ await ((_a = this.layoutEngine) === null || _a === void 0 ? void 0 : _a.layout());
47
59
  }
48
60
  };
49
61
  __decorate([
@@ -59,6 +71,10 @@ __decorate([
59
71
  (0, inversify_1.inject)(diagram_configuration_1.DiagramConfiguration),
60
72
  __metadata("design:type", Object)
61
73
  ], LayoutOperationHandler.prototype, "diagramConfiguration", void 0);
74
+ __decorate([
75
+ (0, inversify_1.inject)(gmodel_serializer_1.GModelSerializer),
76
+ __metadata("design:type", Object)
77
+ ], LayoutOperationHandler.prototype, "serializer", void 0);
62
78
  LayoutOperationHandler = __decorate([
63
79
  (0, inversify_1.injectable)()
64
80
  ], LayoutOperationHandler);
@@ -1 +1 @@
1
- {"version":3,"file":"layout-operation-handler.js","sourceRoot":"","sources":["../../../../src/common/features/layout/layout-operation-handler.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,qDAAoE;AACpE,yCAAyD;AACzD,+EAA6F;AAE7F,+CAA4C;AAC5C,mDAA+C;AAGxC,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IAA5B;QAWM,kBAAa,GAAG,0BAAe,CAAC,IAAI,CAAC;IAYlD,CAAC;IAXG,KAAK,CAAC,OAAO,CAAC,SAAoB;QAC9B,IAAI,SAAS,CAAC,IAAI,KAAK,0BAAe,CAAC,IAAI,EAAE;YACzC,IAAI,IAAI,CAAC,oBAAoB,CAAC,UAAU,KAAK,wCAAgB,CAAC,MAAM,EAAE;gBAClE,IAAI,IAAI,CAAC,YAAY,EAAE;oBACnB,MAAM,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC;oBACjC,OAAO;iBACV;gBACD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,iEAAiE,CAAC,CAAC;aACvF;SACJ;IACL,CAAC;CACJ,CAAA;AAtBG;IAAC,IAAA,kBAAM,EAAC,eAAM,CAAC;8BACG,eAAM;sDAAC;AAEzB;IAAC,IAAA,kBAAM,EAAC,4BAAY,CAAC;IACpB,IAAA,oBAAQ,GAAE;;4DAC2B;AAEtC;IAAC,IAAA,kBAAM,EAAC,4CAAoB,CAAC;;oEACwB;AAT5C,sBAAsB;IADlC,IAAA,sBAAU,GAAE;GACA,sBAAsB,CAuBlC;AAvBY,wDAAsB"}
1
+ {"version":3,"file":"layout-operation-handler.js","sourceRoot":"","sources":["../../../../src/common/features/layout/layout-operation-handler.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,qDAAkF;AAClF,yCAAyD;AAEzD,uEAAyE;AACzE,+EAA6F;AAC7F,0EAAsE;AACtE,+CAA4C;AAC5C,kEAA8D;AAC9D,mDAA+C;AAE/C;;;;GAIG;AAEI,IAAM,sBAAsB,GAA5B,MAAM,sBAAuB,SAAQ,oCAAgB;IAArD;;QAcM,kBAAa,GAAG,0BAAe,CAAC,IAAI,CAAC;IAgBlD,CAAC;IAdG,aAAa,CAAC,SAA0B;QACpC,IAAI,IAAI,CAAC,oBAAoB,CAAC,UAAU,KAAK,wCAAgB,CAAC,MAAM,EAAE;YAClE,OAAO,SAAS,CAAC;SACpB;QACD,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE;YACpB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,iEAAiE,CAAC,CAAC;YACpF,OAAO,SAAS,CAAC;SACpB;QACD,OAAO,IAAI,0CAAsB,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,CAAC;IAChH,CAAC;IAES,KAAK,CAAC,gBAAgB,CAAC,UAAqB;;QAClD,MAAM,CAAA,MAAA,IAAI,CAAC,YAAY,0CAAE,MAAM,EAAE,CAAA,CAAC;IACtC,CAAC;CACJ,CAAA;AA7BG;IAAC,IAAA,kBAAM,EAAC,eAAM,CAAC;8BACG,eAAM;sDAAC;AAEzB;IAAC,IAAA,kBAAM,EAAC,4BAAY,CAAC;IACpB,IAAA,oBAAQ,GAAE;;4DAC2B;AAEtC;IAAC,IAAA,kBAAM,EAAC,4CAAoB,CAAC;;oEACwB;AAErD;IAAC,IAAA,kBAAM,EAAC,oCAAgB,CAAC;;0DACc;AAZ9B,sBAAsB;IADlC,IAAA,sBAAU,GAAE;GACA,sBAAsB,CA8BlC;AA9BY,wDAAsB"}
@@ -25,7 +25,6 @@ export interface ModelState {
25
25
  readonly root: GModelRoot;
26
26
  updateRoot(newRoot: GModelRoot): void;
27
27
  editMode: string;
28
- isDirty: boolean;
29
28
  sourceUri?: string;
30
29
  clientId: string;
31
30
  readonly isReadonly: boolean;
@@ -39,7 +38,6 @@ export declare class DefaultModelState implements ModelState {
39
38
  protected properties: Map<string, any>;
40
39
  protected _root: GModelRoot;
41
40
  editMode: string;
42
- isDirty: boolean;
43
41
  set<P>(key: string, property: P): void;
44
42
  setAll(properties: Record<string, unknown>): void;
45
43
  get<P>(key: string, guard?: (object: unknown) => object is P): P | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"model-state.d.ts","sourceRoot":"","sources":["../../../../src/common/features/model/model-state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAIjD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM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ITABLE;
24
- this.isDirty = false;
25
24
  }
26
25
  set(key, property) {
27
26
  this.properties.set(key, property);
@@ -1 +1 @@
1
- {"version":3,"file":"model-state.js","sourceRoot":"","sources":["../../../../src/common/features/model/model-state.ts"],"names":[],"mappings":";;;;;;;;;;;;AAgBA,qDAAkD;AAClD,yCAA+C;AAC/C,sEAAwD;AACxD,iDAA6C;AAC7C,2DAAuD;AAE1C,QAAA,UAAU,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC;AAiBlC,QAAA,cAAc,GAAG,WAAW,CAAC;AAGnC,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAAvB;QAUO,eAAU,GAAG,IAAI,GAAG,EAAe,CAAC;QAI9C,aAAQ,GAAG,mBAAQ,CAAC,QAAQ,CAAC;QAE7B,YAAO,GAAG,KAAK,CAAC;IA0CpB,CAAC;IAxCG,GAAG,CAAI,GAAW,EAAE,QAAW;QAC3B,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IACvC,CAAC;IAED,MAAM,CAAC,UAAmC;QACtC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACtF,CAAC;IAED,GAAG,CAAI,GAAW,EAAE,KAAwC;QACxD,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACxC,IAAI,CAAC,KAAK,EAAE;YACR,OAAO,MAAW,CAAC;SACtB;QACD,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IAC9C,CAAC;IAED,IAAI,SAAS;QACT,OAAO,IAAI,CAAC,GAAG,CAAC,sBAAc,CAAC,CAAC;IACpC,CAAC;IAED,KAAK,C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IAAA,kBAAM,EAAC,8BAAQ,CAAC;;mDACS;AARjB,iBAAiB;IAD7B,IAAA,sBAAU,GAAE;GACA,iBAAiB,CAwD7B;AAxDY,8CAAiB"}
@@ -15,6 +15,7 @@
15
15
  ********************************************************************************/
16
16
  import { GModelRootSchema } from '@eclipse-glsp/graph';
17
17
  import { Action, DirtyStateChangeReason, MaybePromise } from '@eclipse-glsp/protocol';
18
+ import { CommandStack } from '../../command/command-stack';
18
19
  import { DiagramConfiguration } from '../../diagram/diagram-configuration';
19
20
  import { LayoutEngine } from '../layout/layout-engine';
20
21
  import { GModelFactory } from './gmodel-factory';
@@ -26,6 +27,7 @@ export declare class ModelSubmissionHandler {
26
27
  protected modelFactory: GModelFactory;
27
28
  protected modelState: ModelState;
28
29
  protected layoutEngine: LayoutEngine;
30
+ protected commandStack: CommandStack;
29
31
  /**
30
32
  * Returns a list of actions to update the client-side model, based on the specified <code>modelState</code>.
31
33
  *
@@ -1 +1 @@
1
- {"version":3,"file":"model-submission-handler.d.ts","sourceRoot":"","sources":["../../../../src/common/features/model/model-submission-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EACH,MAAM,EACN,sBAAsB,EACtB,YAAY,EAKf,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,oBAAoB,EAAoB,MAAM,qCAAqC,CAAC;AAC7F,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,qBACa,sBAAsB;IAE/B,SAAS,CAAC,oBAAoB,EAAE,oBAAoB,CAAC;IAGrD,SAAS,CAAC,UAAU,EAAE,gBAAgB,CAAC;IAGvC,SAAS,CAAC,YAAY,EAAE,aAAa,CAAC;IAGtC,SAAS,CAAC,UAAU,EAAE,UAAU,CAAC;IAIjC,SAAS,CAAC,YAAY,EAAE,YAAY,CAAC;IAErC;;;;;;;;OAQG;IACH,WAAW,CAAC,MAAM,CAAC,EAAE,sBAAsB,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC;IAWpE;;;;;;;;;;;;;OAaG;IACG,mBAAmB,CAAC,MAAM,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAkB7E,SAAS,CAAC,eAAe,IAAI,gBAAgB;CAGhD"}
1
+ {"version":3,"file":"model-submission-handler.d.ts","sourceRoot":"","sources":["../../../../src/common/features/model/model-submission-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EACH,MAAM,EACN,sBAAsB,EACtB,YAAY,EAKf,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAoB,MAAM,qCAAqC,CAAC;AAC7F,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,qBACa,sBAAsB;IAE/B,SAAS,CAAC,oBAAoB,EAAE,oBAAoB,CAAC;IAGrD,SAAS,CAAC,UAAU,EAAE,gBAAgB,CAAC;IAGvC,SAAS,CAAC,YAAY,EAAE,aAAa,CAAC;IAGtC,SAAS,CAAC,UAAU,EAAE,UAAU,CAAC;IAIjC,SAAS,CAAC,YAAY,EAAE,YAAY,CAAC;IAGrC,SAAS,CAAC,YAAY,EAAE,YAAY,CAAC;IAErC;;;;;;;;OAQG;IACH,WAAW,CAAC,MAAM,CAAC,EAAE,sBAAsB,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC;IAWpE;;;;;;;;;;;;;OAaG;IACG,mBAAmB,CAAC,MAAM,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAkB7E,SAAS,CAAC,eAAe,IAAI,gBAAgB;CAGhD"}
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.ModelSubmissionHandler = void 0;
13
13
  const protocol_1 = require("@eclipse-glsp/protocol");
14
14
  const inversify_1 = require("inversify");
15
+ const command_stack_1 = require("../../command/command-stack");
15
16
  const diagram_configuration_1 = require("../../diagram/diagram-configuration");
16
17
  const layout_engine_1 = require("../layout/layout-engine");
17
18
  const gmodel_factory_1 = require("./gmodel-factory");
@@ -33,7 +34,7 @@ let ModelSubmissionHandler = class ModelSubmissionHandler {
33
34
  this.modelState.root.revision = ((_a = this.modelState.root.revision) !== null && _a !== void 0 ? _a : 0) + 1;
34
35
  const root = this.serializeGModel();
35
36
  if (this.diagramConfiguration.needsClientLayout) {
36
- return [protocol_1.RequestBoundsAction.create(root), protocol_1.SetDirtyStateAction.create(this.modelState.isDirty, { reason })];
37
+ return [protocol_1.RequestBoundsAction.create(root), protocol_1.SetDirtyStateAction.create(this.commandStack.isDirty, { reason })];
37
38
  }
38
39
  return [protocol_1.SetModelAction.create(root)];
39
40
  }
@@ -61,7 +62,7 @@ let ModelSubmissionHandler = class ModelSubmissionHandler {
61
62
  ? protocol_1.SetModelAction.create(root)
62
63
  : protocol_1.UpdateModelAction.create(root, { animate: this.diagramConfiguration.animatedUpdate }));
63
64
  if (!this.diagramConfiguration.needsClientLayout) {
64
- result.push(protocol_1.SetDirtyStateAction.create(this.modelState.isDirty, { reason }));
65
+ result.push(protocol_1.SetDirtyStateAction.create(this.commandStack.isDirty, { reason }));
65
66
  }
66
67
  return result;
67
68
  }
@@ -90,6 +91,10 @@ __decorate([
90
91
  (0, inversify_1.optional)(),
91
92
  __metadata("design:type", Object)
92
93
  ], ModelSubmissionHandler.prototype, "layoutEngine", void 0);
94
+ __decorate([
95
+ (0, inversify_1.inject)(command_stack_1.CommandStack),
96
+ __metadata("design:type", Object)
97
+ ], ModelSubmissionHandler.prototype, "commandStack", void 0);
93
98
  ModelSubmissionHandler = __decorate([
94
99
  (0, inversify_1.injectable)()
95
100
  ], ModelSubmissionHandler);
@@ -1 +1 @@
1
- {"version":3,"file":"model-submission-handler.js","sourceRoot":"","sources":["../../../../src/common/features/model/model-submission-handler.ts"],"names":[],"mappings":";;;;;;;;;;;;AAgBA,qDAQgC;AAChC,yCAAyD;AACzD,+EAA6F;AAC7F,2DAAuD;AACvD,qDAAiD;AACjD,2DAAuD;AACvD,+CAA2C;AAGpC,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IAiB/B;;;;;;;;OAQG;IACH,WAAW,CAAC,MAA+B;;QACvC,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC;QAChC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,GAAG,CAAC,MAAA,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,mCAAI,CAAC,CAAC,GAAG,CAAC,CAAC;QACzE,MAAM,IAAI,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;QAEpC,IAAI,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,EAAE;YAC7C,OAAO,CAAC,8BAAmB,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,8BAAmB,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;SAC9G;QACD,OAAO,CAAC,yBAAc,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IACzC,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,mBAAmB,CAAC,MAA+B;QACrD,MAAM,IAAI,GAAG,IAA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AAc,CAAC,MAAM,CAAC,IAAI,CAAC;YAC7B,CAAC,CAAC,4BAAiB,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,oBAAoB,CAAC,cAAc,EAAE,CAAC,CAC9F,CAAC;QACF,IAAI,CAAC,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,EAAE;YAC9C,MAAM,CAAC,IAAI,CAAC,8BAAmB,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;SAClF;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;IAES,eAAe;QACrB,OAAO,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IAC9D,CAAC;CACJ,CAAA;AA1EG;IAAC,IAAA,kBAAM,EAAC,4CAAoB,CAAC;;oEACwB;AAErD;IAAC,IAAA,kBAAM,EAAC,oCAAgB,CAAC;;0DACc;AAEvC;IAAC,IAAA,kBAAM,EAAC,8BAAa,CAAC;;4DACgB;AAEtC;IAAC,IAAA,kBAAM,EAAC,wBAAU,CAAC;;0DACc;AAEjC;IAAC,IAAA,kBAAM,EAAC,4BAAY,CAAC;IACpB,IAAA,oBAAQ,GAAE;;4DAC0B;AAErC;IAAC,IAAA,kBAAM,EAAC,4BAAY,CAAC;;4DACgB;AAlB5B,sBAAsB;IADlC,IAAA,sBAAU,GAAE;GACA,sBAAsB,CA2ElC;AA3EY,wDAAsB"}
@@ -15,11 +15,11 @@
15
15
  ********************************************************************************/
16
16
  import { Action, SaveModelAction } from '@eclipse-glsp/protocol';
17
17
  import { ActionHandler } from '../../actions/action-handler';
18
- import { ModelState } from './model-state';
18
+ import { CommandStack } from '../../command/command-stack';
19
19
  import { SourceModelStorage } from './source-model-storage';
20
20
  export declare class SaveModelActionHandler implements ActionHandler {
21
21
  actionKinds: string[];
22
- protected modelState: ModelState;
22
+ protected commandStack: CommandStack;
23
23
  protected sourceModelStorage: SourceModelStorage;
24
24
  execute(action: SaveModelAction): Promise<Action[]>;
25
25
  }
@@ -1 +1 @@
1
- {"version":3,"file":"save-model-action-handler.d.ts","sourceRoot":"","sources":["../../../../src/common/features/model/save-model-action-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,MAAM,EAAE,eAAe,EAAuB,MAAM,wBAAwB,CAAC;AAEtF,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D,qBACa,sBAAuB,YAAW,aAAa;IACxD,WAAW,WAA0B;IAGrC,SAAS,CAAC,UAAU,EAAE,UAAU,CAAC;IAGjC,SAAS,CAAC,kBAAkB,EAAE,kBAAkB,CAAC;IAE3C,OAAO,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;CAM5D"}
1
+ {"version":3,"file":"save-model-action-handler.d.ts","sourceRoot":"","sources":["../../../../src/common/features/model/save-model-action-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,MAAM,EAAE,eAAe,EAAuB,MAAM,wBAAwB,CAAC;AAEtF,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D,qBACa,sBAAuB,YAAW,aAAa;IACxD,WAAW,WAA0B;IAGrC,SAAS,CAAC,YAAY,EAAE,YAAY,CAAC;IAGrC,SAAS,CAAC,kBAAkB,EAAE,kBAAkB,CAAC;IAE3C,OAAO,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;CAK5D"}
@@ -27,7 +27,7 @@ exports.SaveModelActionHandler = void 0;
27
27
  ********************************************************************************/
28
28
  const protocol_1 = require("@eclipse-glsp/protocol");
29
29
  const inversify_1 = require("inversify");
30
- const model_state_1 = require("./model-state");
30
+ const command_stack_1 = require("../../command/command-stack");
31
31
  const source_model_storage_1 = require("./source-model-storage");
32
32
  let SaveModelActionHandler = class SaveModelActionHandler {
33
33
  constructor() {
@@ -35,14 +35,14 @@ let SaveModelActionHandler = class SaveModelActionHandler {
35
35
  }
36
36
  async execute(action) {
37
37
  await this.sourceModelStorage.saveSourceModel(action);
38
- this.modelState.isDirty = false; // TODO: call save is done when available
39
- return [protocol_1.SetDirtyStateAction.create(this.modelState.isDirty, { reason: 'save' })];
38
+ this.commandStack.saveIsDone();
39
+ return [protocol_1.SetDirtyStateAction.create(this.commandStack.isDirty, { reason: 'save' })];
40
40
  }
41
41
  };
42
42
  __decorate([
43
- (0, inversify_1.inject)(model_state_1.ModelState),
43
+ (0, inversify_1.inject)(command_stack_1.CommandStack),
44
44
  __metadata("design:type", Object)
45
- ], SaveModelActionHandler.prototype, "modelState", void 0);
45
+ ], SaveModelActionHandler.prototype, "commandStack", void 0);
46
46
  __decorate([
47
47
  (0, inversify_1.inject)(source_model_storage_1.SourceModelStorage),
48
48
  __metadata("design:type", Object)
@@ -1 +1 @@
1
- {"version":3,"file":"save-model-action-handler.js","sourceRoot":"","sources":["../../../../src/common/features/model/save-model-action-handler.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,qDAAsF;AACtF,yCAA+C;AAE/C,+CAA2C;AAC3C,iEAA4D;AAGrD,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IAA5B;QACH,gBAAW,GAAG,CAAC,0BAAe,CAAC,IAAI,CAAC,CAAC;IAczC,CAAC;IANG,KAAK,CAAC,OAAO,CAAC,MAAuB;QACjC,MAAM,IAAI,CAAC,kBAAkB,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;QACtD,IAAI,CAAC,UAAU,CAAC,OAAO,GAAG,KAAK,CAAC,CAAC,yCAAyC;QAE1E,OAAO,CAAC,8BAAmB,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;IACrF,CAAC;CACJ,CAAA;AAZG;IAAC,IAAA,kBAAM,EAAC,wBAAU,CAAC;;0DACc;AAEjC;IAAC,IAAA,kBAAM,EAAC,yCAAkB,CAAC;;kEACsB;AAPxC,sBAAsB;IADlC,IAAA,sBAAU,GAAE;GACA,sBAAsB,CAelC;AAfY,wDAAsB"}
1
+ {"version":3,"file":"save-model-action-handler.js","sourceRoot":"","sources":["../../../../src/common/features/model/save-model-action-handler.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,qDAAsF;AACtF,yCAA+C;AAE/C,+DAA2D;AAC3D,iEAA4D;AAGrD,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IAA5B;QACH,gBAAW,GAAG,CAAC,0BAAe,CAAC,IAAI,CAAC,CAAC;IAazC,CAAC;IALG,KAAK,CAAC,OAAO,CAAC,MAAuB;QACjC,MAAM,IAAI,CAAC,kBAAkB,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;QACtD,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,CAAC;QAC/B,OAAO,CAAC,8BAAmB,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;IACvF,CAAC;CACJ,CAAA;AAXG;IAAC,IAAA,kBAAM,EAAC,4BAAY,CAAC;;4DACgB;AAErC;IAAC,IAAA,kBAAM,EAAC,yCAAkB,CAAC;;kEACsB;AAPxC,sBAAsB;IADlC,IAAA,sBAAU,GAAE;GACA,sBAAsB,CAclC;AAdY,wDAAsB"}
@@ -1,9 +1,8 @@
1
1
  import { ApplyLabelEditOperation, MaybePromise } from '@eclipse-glsp/protocol';
2
- import { ModelState } from '../features/model/model-state';
3
- import { OperationHandler } from '../operations/operation-handler';
4
- export declare class ApplyLabelEditOperationHandler implements OperationHandler {
2
+ import { Command } from '../command/command';
3
+ import { GModelOperationHandler } from './gmodel-operation-handler';
4
+ export declare class GModelApplyLabelEditOperationHandler extends GModelOperationHandler {
5
5
  readonly operationType = "applyLabelEdit";
6
- protected readonly modelState: ModelState;
7
- execute(operation: ApplyLabelEditOperation): MaybePromise<void>;
6
+ createCommand(operation: ApplyLabelEditOperation): MaybePromise<Command | undefined>;
8
7
  }
9
8
  //# sourceMappingURL=apply-label-edit-operation-handler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"apply-label-edit-operation-handler.d.ts","sourceRoot":"","sources":["../../../src/common/gmodel/apply-label-edit-operation-handler.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,uBAAuB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE/E,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAGnE,qBACa,8BAA+B,YAAW,gBAAgB;IACnE,QAAQ,CAAC,aAAa,oBAAgC;IAGtD,SAAS,CAAC,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAE1C,OAAO,CAAC,SAAS,EAAE,uBAAuB,GAAG,YAAY,CAAC,IAAI,CAAC;CAQlE"}
1
+ {"version":3,"file":"apply-label-edit-operation-handler.d.ts","sourceRoot":"","sources":["../../../src/common/gmodel/apply-label-edit-operation-handler.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,uBAAuB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE/E,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAEpE,qBACa,oCAAqC,SAAQ,sBAAsB;IAC5E,QAAQ,CAAC,aAAa,oBAAgC;IAEtD,aAAa,CAAC,SAAS,EAAE,uBAAuB,GAAG,YAAY,CAAC,OAAO,GAAG,SAAS,CAAC;CASvF"}
@@ -5,11 +5,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
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
6
  return c > 3 && r && Object.defineProperty(target, key, r), r;
7
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
8
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.ApplyLabelEditOperationHandler = void 0;
9
+ exports.GModelApplyLabelEditOperationHandler = void 0;
13
10
  /********************************************************************************
14
11
  * Copyright (c) 2022-2023 STMicroelectronics and others.
15
12
  *
@@ -28,28 +25,22 @@ exports.ApplyLabelEditOperationHandler = void 0;
28
25
  const graph_1 = require("@eclipse-glsp/graph");
29
26
  const protocol_1 = require("@eclipse-glsp/protocol");
30
27
  const inversify_1 = require("inversify");
31
- const model_state_1 = require("../features/model/model-state");
32
28
  const glsp_server_error_1 = require("../utils/glsp-server-error");
33
- let ApplyLabelEditOperationHandler = class ApplyLabelEditOperationHandler {
29
+ const gmodel_operation_handler_1 = require("./gmodel-operation-handler");
30
+ let GModelApplyLabelEditOperationHandler = class GModelApplyLabelEditOperationHandler extends gmodel_operation_handler_1.GModelOperationHandler {
34
31
  constructor() {
32
+ super(...arguments);
35
33
  this.operationType = protocol_1.ApplyLabelEditOperation.KIND;
36
34
  }
37
- execute(operation) {
38
- const element = this.modelState.index.findByClass(operation.labelId, graph_1.GLabel);
39
- if (element) {
40
- element.text = operation.text;
41
- }
42
- else {
43
- throw new glsp_server_error_1.GLSPServerError('Element with provided ID cannot be found or is not a GLabel');
44
- }
35
+ createCommand(operation) {
36
+ const label = (0, glsp_server_error_1.getOrThrow)(this.modelState.index.findByClass(operation.labelId, graph_1.GLabel), 'Element with provided ID cannot be found or is not a GLabel');
37
+ return label.text !== operation.text //
38
+ ? this.commandOf(() => (label.text = operation.text))
39
+ : undefined;
45
40
  }
46
41
  };
47
- __decorate([
48
- (0, inversify_1.inject)(model_state_1.ModelState),
49
- __metadata("design:type", Object)
50
- ], ApplyLabelEditOperationHandler.prototype, "modelState", void 0);
51
- ApplyLabelEditOperationHandler = __decorate([
42
+ GModelApplyLabelEditOperationHandler = __decorate([
52
43
  (0, inversify_1.injectable)()
53
- ], ApplyLabelEditOperationHandler);
54
- exports.ApplyLabelEditOperationHandler = ApplyLabelEditOperationHandler;
44
+ ], GModelApplyLabelEditOperationHandler);
45
+ exports.GModelApplyLabelEditOperationHandler = GModelApplyLabelEditOperationHandler;
55
46
  //# sourceMappingURL=apply-label-edit-operation-handler.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"apply-label-edit-operation-handler.js","sourceRoot":"","sources":["../../../src/common/gmodel/apply-label-edit-operation-handler.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,+CAA6C;AAC7C,qDAA+E;AAC/E,yCAA+C;AAC/C,+DAA2D;AAE3D,kEAA6D;AAGtD,IAAM,8BAA8B,GAApC,MAAM,8BAA8B;IAApC;QACM,kBAAa,GAAG,kCAAuB,CAAC,IAAI,CAAC;IAa1D,CAAC;IARG,OAAO,CAAC,SAAkC;QACtC,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,WAAW,CAAC,SAAS,CAAC,OAAO,EAAE,cAAM,CAAC,CAAC;QAC7E,IAAI,OAAO,EAAE;YACT,OAAO,CAAC,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC;SACjC;aAAM;YACH,MAAM,IAAI,mCAAe,CAAC,6DAA6D,CAAC,CAAC;SAC5F;IACL,CAAC;CACJ,CAAA;AAXG;IAAC,IAAA,kBAAM,EAAC,wBAAU,CAAC;;kEACuB;AAJjC,8BAA8B;IAD1C,IAAA,sBAAU,GAAE;GACA,8BAA8B,CAc1C;AAdY,wEAA8B"}
1
+ {"version":3,"file":"apply-label-edit-operation-handler.js","sourceRoot":"","sources":["../../../src/common/gmodel/apply-label-edit-operation-handler.ts"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,+CAA6C;AAC7C,qDAA+E;AAC/E,yCAAuC;AAEvC,kEAAwD;AACxD,yEAAoE;AAG7D,IAAM,oCAAoC,GAA1C,MAAM,oCAAqC,SAAQ,iDAAsB;IAAzE;;QACM,kBAAa,GAAG,kCAAuB,CAAC,IAAI,CAAC;IAW1D,CAAC;IATG,aAAa,CAAC,SAAkC;QAC5C,MAAM,KAAK,GAAG,IAAA,8BAAU,EACpB,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,WAAW,CAAC,SAAS,CAAC,OAAO,EAAE,cAAM,CAAC,EAC5D,6DAA6D,CAChE,CAAC;QACF,OAAO,KAAK,CAAC,IAAI,KAAK,SAAS,CAAC,IAAI,CAAC,EAAE;YACnC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;YACrD,CAAC,CAAC,SAAS,CAAC;IACpB,CAAC;CACJ,CAAA;AAZY,oCAAoC;IADhD,IAAA,sBAAU,GAAE;GACA,oCAAoC,CAYhD;AAZY,oFAAoC"}
@@ -1,10 +1,13 @@
1
1
  import { ChangeBoundsOperation, Dimension, MaybePromise, Point } from '@eclipse-glsp/protocol';
2
- import { ModelState } from '../features/model/model-state';
3
- import { OperationHandler } from '../operations/operation-handler';
4
- export declare class ChangeBoundsOperationHandler implements OperationHandler {
2
+ import { Command } from '../command/command';
3
+ import { GModelOperationHandler } from './gmodel-operation-handler';
4
+ /**
5
+ * Applies {@link ChangeBoundsOperation} directly to the GModel.
6
+ */
7
+ export declare class GModelChangeBoundsOperationHandler extends GModelOperationHandler {
5
8
  operationType: string;
6
- protected modelState: ModelState;
7
- execute(operation: ChangeBoundsOperation): MaybePromise<void>;
8
- changeElementBounds(elementId: string, newSize: Dimension, newPosition: Point | undefined): void;
9
+ createCommand(operation: ChangeBoundsOperation): MaybePromise<Command | undefined>;
10
+ protected executeChangeBounds(operation: ChangeBoundsOperation): void;
11
+ protected changeElementBounds(elementId: string, newSize: Dimension, newPosition: Point | undefined): void;
9
12
  }
10
13
  //# sourceMappingURL=change-bounds-operation-handler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"change-bounds-operation-handler.d.ts","sourceRoot":"","sources":["../../../src/common/gmodel/change-bounds-operation-handler.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAE/F,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAEnE,qBACa,4BAA6B,YAAW,gBAAgB;IACjE,aAAa,SAA8B;IAG3C,SAAS,CAAC,UAAU,EAAE,UAAU,CAAC;IAEjC,OAAO,CAAC,SAAS,EAAE,qBAAqB,GAAG,YAAY,CAAC,IAAI,CAAC;IAM7D,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,GAAG,SAAS,GAAG,IAAI;CAuBnG"}
1
+ {"version":3,"file":"change-bounds-operation-handler.d.ts","sourceRoot":"","sources":["../../../src/common/gmodel/change-bounds-operation-handler.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAE/F,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAEpE;;GAEG;AACH,qBACa,kCAAmC,SAAQ,sBAAsB;IAC1E,aAAa,SAA8B;IAE3C,aAAa,CAAC,SAAS,EAAE,qBAAqB,GAAG,YAAY,CAAC,OAAO,GAAG,SAAS,CAAC;IAIlF,SAAS,CAAC,mBAAmB,CAAC,SAAS,EAAE,qBAAqB,GAAG,IAAI;IAMrE,SAAS,CAAC,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,GAAG,SAAS,GAAG,IAAI;CAuB7G"}
@@ -5,11 +5,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
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
6
  return c > 3 && r && Object.defineProperty(target, key, r), r;
7
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
8
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.ChangeBoundsOperationHandler = void 0;
9
+ exports.GModelChangeBoundsOperationHandler = void 0;
13
10
  /********************************************************************************
14
11
  * Copyright (c) 2022-2023 STMicroelectronics and others.
15
12
  *
@@ -28,12 +25,19 @@ exports.ChangeBoundsOperationHandler = void 0;
28
25
  const graph_1 = require("@eclipse-glsp/graph");
29
26
  const protocol_1 = require("@eclipse-glsp/protocol");
30
27
  const inversify_1 = require("inversify");
31
- const model_state_1 = require("../features/model/model-state");
32
- let ChangeBoundsOperationHandler = class ChangeBoundsOperationHandler {
28
+ const gmodel_operation_handler_1 = require("./gmodel-operation-handler");
29
+ /**
30
+ * Applies {@link ChangeBoundsOperation} directly to the GModel.
31
+ */
32
+ let GModelChangeBoundsOperationHandler = class GModelChangeBoundsOperationHandler extends gmodel_operation_handler_1.GModelOperationHandler {
33
33
  constructor() {
34
+ super(...arguments);
34
35
  this.operationType = protocol_1.ChangeBoundsOperation.KIND;
35
36
  }
36
- execute(operation) {
37
+ createCommand(operation) {
38
+ return this.commandOf(() => this.executeChangeBounds(operation));
39
+ }
40
+ executeChangeBounds(operation) {
37
41
  for (const element of operation.newBounds) {
38
42
  this.changeElementBounds(element.elementId, element.newSize, element.newPosition);
39
43
  }
@@ -60,12 +64,8 @@ let ChangeBoundsOperationHandler = class ChangeBoundsOperationHandler {
60
64
  nodeToUpdate.position = positionToSet;
61
65
  }
62
66
  };
63
- __decorate([
64
- (0, inversify_1.inject)(model_state_1.ModelState),
65
- __metadata("design:type", Object)
66
- ], ChangeBoundsOperationHandler.prototype, "modelState", void 0);
67
- ChangeBoundsOperationHandler = __decorate([
67
+ GModelChangeBoundsOperationHandler = __decorate([
68
68
  (0, inversify_1.injectable)()
69
- ], ChangeBoundsOperationHandler);
70
- exports.ChangeBoundsOperationHandler = ChangeBoundsOperationHandler;
69
+ ], GModelChangeBoundsOperationHandler);
70
+ exports.GModelChangeBoundsOperationHandler = GModelChangeBoundsOperationHandler;
71
71
  //# sourceMappingURL=change-bounds-operation-handler.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"change-bounds-operation-handler.js","sourceRoot":"","sources":["../../../src/common/gmodel/change-bounds-operation-handler.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,+CAAwD;AACxD,qDAA+F;AAC/F,yCAA+C;AAC/C,+DAA2D;AAIpD,IAAM,4BAA4B,GAAlC,MAAM,4BAA4B;IAAlC;QACH,kBAAa,GAAG,gCAAqB,CAAC,IAAI,CAAC;IAkC/C,CAAC;IA7BG,OAAO,CAAC,SAAgC;QACpC,KAAK,MAAM,OAAO,IAAI,SAAS,CAAC,SAAS,EAAE;YACvC,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,WAAW,CAAC,C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AAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC;SACjI;QACD,IAAI,YAAY,CAAC,MAAM,EAAE;YACrB,IAAI,CAAC,YAAY,CAAC,aAAa,EAAE;gBAC7B,YAAY,CAAC,aAAa,GAAG,EAAE,CAAC;aACnC;YACD,YAAY,CAAC,aAAa,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC;YACxD,YAAY,CAAC,aAAa,CAAC,YAAY,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;SAC7D;QAED,YAAY,CAAC,IAAI,GAAG,OAAO,CAAC;QAC5B,YAAY,CAAC,QAAQ,GAAG,aAAa,CAAC;IAC1C,CAAC;CACJ,CAAA;AApCY,kCAAkC;IAD9C,IAAA,sBAAU,GAAE;GACA,kCAAkC,CAoC9C;AApCY,gFAAkC"}
@@ -14,11 +14,11 @@
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
16
  import { ChangeRoutingPointsOperation, MaybePromise } from '@eclipse-glsp/protocol';
17
- import { ModelState } from '../features/model/model-state';
18
- import { OperationHandler } from '../operations/operation-handler';
19
- export declare class ChangeRoutingPointsOperationHandler implements OperationHandler {
17
+ import { Command } from '../command/command';
18
+ import { GModelOperationHandler } from './gmodel-operation-handler';
19
+ export declare class GModelChangeRoutingPointsOperationHandler extends GModelOperationHandler {
20
20
  operationType: string;
21
- protected modelState: ModelState;
22
- execute(operation: ChangeRoutingPointsOperation): MaybePromise<void>;
21
+ createCommand(operation: ChangeRoutingPointsOperation): MaybePromise<Command | undefined>;
22
+ executeChangeRoutingPoints(operation: ChangeRoutingPointsOperation): MaybePromise<void>;
23
23
  }
24
24
  //# sourceMappingURL=change-routing-points-operation-handler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"change-routing-points-operation-handler.d.ts","sourceRoot":"","sources":["../../../src/common/gmodel/change-routing-points-operation-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,4BAA4B,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEpF,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAInE,qBACa,mCAAoC,YAAW,gBAAgB;IACxE,aAAa,SAAqC;IAGlD,SAAS,CAAC,UAAU,EAAE,UAAU,CAAC;IAEjC,OAAO,CAAC,SAAS,EAAE,4BAA4B,GAAG,YAAY,CAAC,IAAI,CAAC;CAQvE"}
1
+ {"version":3,"file":"change-routing-points-operation-handler.d.ts","sourceRoot":"","sources":["../../../src/common/gmodel/change-routing-points-operation-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,4BAA4B,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEpF,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAG7C,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAEpE,qBACa,yCAA0C,SAAQ,sBAAsB;IACjF,aAAa,SAAqC;IAElD,aAAa,CAAC,SAAS,EAAE,4BAA4B,GAAG,YAAY,CAAC,OAAO,GAAG,SAAS,CAAC;IAIzF,0BAA0B,CAAC,SAAS,EAAE,4BAA4B,GAAG,YAAY,CAAC,IAAI,CAAC;CAQ1F"}