@foblex/flow 17.8.4 → 17.8.5

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 (170) hide show
  1. package/domain/f-connectors/calculate-source-connectors-to-connect/calculate-source-connectors-to-connect-request.d.ts +8 -0
  2. package/domain/f-connectors/calculate-source-connectors-to-connect/calculate-source-connectors-to-connect.d.ts +21 -0
  3. package/domain/f-connectors/calculate-source-connectors-to-connect/index.d.ts +2 -0
  4. package/domain/f-connectors/calculate-target-connectors-to-connect/calculate-target-connectors-to-connect-request.d.ts +8 -0
  5. package/domain/f-connectors/calculate-target-connectors-to-connect/calculate-target-connectors-to-connect.d.ts +20 -0
  6. package/domain/f-connectors/calculate-target-connectors-to-connect/index.d.ts +2 -0
  7. package/domain/f-connectors/index.d.ts +2 -2
  8. package/domain/f-connectors/providers.d.ts +3 -3
  9. package/domain/f-event-trigger.d.ts +1 -1
  10. package/domain/f-flow/providers.d.ts +1 -1
  11. package/domain/f-line-alignment/providers.d.ts +1 -1
  12. package/domain/f-node/add-node-to-store/add-node-to-store-request.d.ts +2 -2
  13. package/domain/f-node/calculate-connectors-connectable-sides/calculate-connectable-side-by-connected-positions/calculate-connectable-side-by-connected-positions-request.d.ts +8 -0
  14. package/domain/f-node/{calculate-node-connectors-connectable-sides → calculate-connectors-connectable-sides}/calculate-connectable-side-by-connected-positions/calculate-connectable-side-by-connected-positions.d.ts +2 -28
  15. package/domain/f-node/calculate-connectors-connectable-sides/calculate-connectable-side-by-internal-position/calculate-connectable-side-by-internal-position.d.ts +52 -0
  16. package/domain/f-node/calculate-connectors-connectable-sides/calculate-connectors-connectable-sides-request.d.ts +6 -0
  17. package/domain/f-node/calculate-connectors-connectable-sides/calculate-connectors-connectable-sides.d.ts +22 -0
  18. package/domain/f-node/calculate-connectors-connectable-sides/constants/calculatable-sides.d.ts +6 -0
  19. package/domain/f-node/calculate-connectors-connectable-sides/constants/index.d.ts +1 -0
  20. package/domain/f-node/calculate-connectors-connectable-sides/index.d.ts +7 -0
  21. package/domain/f-node/calculate-connectors-connectable-sides/models/index.d.ts +1 -0
  22. package/domain/f-node/calculate-connectors-connectable-sides/models/t-calculate-mode.d.ts +2 -0
  23. package/domain/f-node/calculate-connectors-connectable-sides/utils/determine-side.d.ts +10 -0
  24. package/domain/f-node/calculate-connectors-connectable-sides/utils/index.d.ts +2 -0
  25. package/domain/f-node/calculate-connectors-connectable-sides/utils/is-calculate-mode.d.ts +7 -0
  26. package/domain/f-node/calculate-input-connections/calculate-input-connections-request.d.ts +2 -2
  27. package/domain/f-node/calculate-input-connections/calculate-input-connections.d.ts +3 -3
  28. package/domain/f-node/calculate-nodes-bounding-box/calculate-nodes-bounding-box.d.ts +2 -3
  29. package/domain/f-node/calculate-output-connections/calculate-output-connections-request.d.ts +2 -2
  30. package/domain/f-node/calculate-output-connections/calculate-output-connections.d.ts +3 -3
  31. package/domain/f-node/index.d.ts +1 -2
  32. package/domain/f-node/providers.d.ts +2 -3
  33. package/domain/f-selection/select-and-update-node-layer/select-and-update-node-layer.execution.d.ts +2 -2
  34. package/domain/f-selection/select-and-update-node-layer/select-and-update-node-layer.request.d.ts +2 -2
  35. package/domain/f-zoom/providers.d.ts +1 -1
  36. package/domain/providers.d.ts +1 -1
  37. package/esm2022/domain/css-cls.mjs +2 -1
  38. package/esm2022/domain/f-connectors/calculate-source-connectors-to-connect/calculate-source-connectors-to-connect-request.mjs +10 -0
  39. package/esm2022/domain/f-connectors/calculate-source-connectors-to-connect/calculate-source-connectors-to-connect.mjs +59 -0
  40. package/esm2022/domain/f-connectors/calculate-source-connectors-to-connect/index.mjs +3 -0
  41. package/esm2022/domain/f-connectors/calculate-target-connectors-to-connect/calculate-target-connectors-to-connect-request.mjs +10 -0
  42. package/esm2022/domain/f-connectors/calculate-target-connectors-to-connect/calculate-target-connectors-to-connect.mjs +64 -0
  43. package/esm2022/domain/f-connectors/calculate-target-connectors-to-connect/index.mjs +3 -0
  44. package/esm2022/domain/f-connectors/index.mjs +3 -3
  45. package/esm2022/domain/f-connectors/providers.mjs +5 -5
  46. package/esm2022/domain/f-event-trigger.mjs +2 -2
  47. package/esm2022/domain/f-node/add-node-to-store/add-node-to-store-request.mjs +4 -4
  48. package/esm2022/domain/f-node/add-node-to-store/add-node-to-store.mjs +2 -2
  49. package/esm2022/domain/f-node/calculate-connectors-connectable-sides/calculate-connectable-side-by-connected-positions/calculate-connectable-side-by-connected-positions-request.mjs +10 -0
  50. package/esm2022/domain/f-node/calculate-connectors-connectable-sides/calculate-connectable-side-by-connected-positions/calculate-connectable-side-by-connected-positions.mjs +59 -0
  51. package/esm2022/domain/f-node/calculate-connectors-connectable-sides/calculate-connectable-side-by-connected-positions/index.mjs +3 -0
  52. package/esm2022/domain/f-node/calculate-connectors-connectable-sides/calculate-connectable-side-by-internal-position/calculate-connectable-side-by-internal-position-request.mjs +8 -0
  53. package/esm2022/domain/f-node/calculate-connectors-connectable-sides/calculate-connectable-side-by-internal-position/calculate-connectable-side-by-internal-position.mjs +132 -0
  54. package/esm2022/domain/f-node/calculate-connectors-connectable-sides/calculate-connectable-side-by-internal-position/index.mjs +3 -0
  55. package/esm2022/domain/f-node/calculate-connectors-connectable-sides/calculate-connectors-connectable-sides-request.mjs +8 -0
  56. package/esm2022/domain/f-node/calculate-connectors-connectable-sides/calculate-connectors-connectable-sides.mjs +73 -0
  57. package/esm2022/domain/f-node/calculate-connectors-connectable-sides/constants/calculatable-sides.mjs +12 -0
  58. package/esm2022/domain/f-node/calculate-connectors-connectable-sides/constants/index.mjs +2 -0
  59. package/esm2022/domain/f-node/calculate-connectors-connectable-sides/index.mjs +8 -0
  60. package/esm2022/domain/f-node/calculate-connectors-connectable-sides/models/index.mjs +2 -0
  61. package/esm2022/domain/f-node/calculate-connectors-connectable-sides/models/t-calculate-mode.mjs +2 -0
  62. package/esm2022/domain/f-node/calculate-connectors-connectable-sides/utils/determine-side.mjs +124 -0
  63. package/esm2022/domain/f-node/calculate-connectors-connectable-sides/utils/index.mjs +3 -0
  64. package/esm2022/domain/f-node/calculate-connectors-connectable-sides/utils/is-calculate-mode.mjs +12 -0
  65. package/esm2022/domain/f-node/calculate-input-connections/calculate-input-connections-request.mjs +4 -4
  66. package/esm2022/domain/f-node/calculate-input-connections/calculate-input-connections.mjs +20 -7
  67. package/esm2022/domain/f-node/calculate-nodes-bounding-box/calculate-nodes-bounding-box.mjs +5 -8
  68. package/esm2022/domain/f-node/calculate-output-connections/calculate-output-connections-request.mjs +4 -4
  69. package/esm2022/domain/f-node/calculate-output-connections/calculate-output-connections.mjs +20 -7
  70. package/esm2022/domain/f-node/get-child-node-ids/get-child-node-ids.request.mjs +1 -1
  71. package/esm2022/domain/f-node/index.mjs +2 -3
  72. package/esm2022/domain/f-node/providers.mjs +3 -5
  73. package/esm2022/domain/f-node/update-node-when-state-or-size-changed/update-node-when-state-or-size-changed.mjs +3 -3
  74. package/esm2022/domain/f-selection/select-and-update-node-layer/select-and-update-node-layer.execution.mjs +5 -5
  75. package/esm2022/domain/f-selection/select-and-update-node-layer/select-and-update-node-layer.request.mjs +4 -4
  76. package/esm2022/domain/get-normalized-connector-rect/get-normalized-connector-rect-request.mjs +1 -1
  77. package/esm2022/domain/get-normalized-connector-rect/get-normalized-connector-rect.execution.mjs +2 -2
  78. package/esm2022/domain/get-normalized-element-rect/get-normalized-element-rect.execution.mjs +2 -14
  79. package/esm2022/domain/get-normalized-point/get-normalized-point.execution.mjs +4 -1
  80. package/esm2022/domain/index.mjs +1 -1
  81. package/esm2022/domain/is-mobile.mjs +5 -3
  82. package/esm2022/f-connectors/f-node-output/f-node-output.directive.mjs +1 -1
  83. package/esm2022/f-draggable/f-connection/f-create-connection/create-preparation/create-connection-preparation-request.mjs +10 -0
  84. package/esm2022/f-draggable/f-connection/f-create-connection/create-preparation/create-connection-preparation.mjs +58 -0
  85. package/esm2022/f-draggable/f-connection/f-create-connection/create-preparation/from-output-preparation/create-connection-from-output-preparation-request.mjs +10 -0
  86. package/esm2022/f-draggable/f-connection/f-create-connection/create-preparation/from-output-preparation/create-connection-from-output-preparation.mjs +47 -0
  87. package/esm2022/f-draggable/f-connection/f-create-connection/create-preparation/from-output-preparation/index.mjs +3 -3
  88. package/esm2022/f-draggable/f-connection/f-create-connection/create-preparation/index.mjs +3 -3
  89. package/esm2022/f-draggable/f-connection/f-create-connection/f-create-connection.drag-handler.mjs +8 -8
  90. package/esm2022/f-draggable/f-connection/f-reassign-connection/f-reassign-source.drag-handler.mjs +3 -3
  91. package/esm2022/f-draggable/f-connection/f-reassign-connection/f-reassign-target.drag-handler.mjs +7 -7
  92. package/esm2022/f-draggable/f-connection/providers.mjs +4 -4
  93. package/esm2022/f-draggable/f-draggable.directive.mjs +3 -3
  94. package/esm2022/f-draggable/f-drop-to-group/drop-to-group-preparation/drop-to-group-preparation-request.mjs +1 -1
  95. package/esm2022/f-draggable/f-drop-to-group/drop-to-group-preparation/drop-to-group-preparation.mjs +11 -13
  96. package/esm2022/f-draggable/f-node-move/move-preparation/f-node-move-preparation.execution.mjs +14 -12
  97. package/esm2022/f-draggable/f-node-move/move-preparation/f-node-move-preparation.request.mjs +1 -1
  98. package/esm2022/f-node/f-group.directive.mjs +3 -3
  99. package/esm2022/f-node/f-node.directive.mjs +3 -3
  100. package/esm2022/f-storage/f-connectors-store.mjs +11 -0
  101. package/esm2022/f-storage/index.mjs +2 -1
  102. package/f-connection/providers.d.ts +1 -1
  103. package/f-connectors/providers.d.ts +1 -1
  104. package/f-draggable/f-connection/f-create-connection/create-preparation/create-connection-preparation-request.d.ts +8 -0
  105. package/f-draggable/f-connection/f-create-connection/create-preparation/create-connection-preparation.d.ts +16 -0
  106. package/f-draggable/f-connection/f-create-connection/create-preparation/from-output-preparation/create-connection-from-output-preparation-request.d.ts +8 -0
  107. package/f-draggable/f-connection/f-create-connection/create-preparation/from-output-preparation/create-connection-from-output-preparation.d.ts +14 -0
  108. package/f-draggable/f-connection/f-create-connection/create-preparation/from-output-preparation/index.d.ts +2 -2
  109. package/f-draggable/f-connection/f-create-connection/create-preparation/index.d.ts +2 -2
  110. package/f-draggable/f-connection/providers.d.ts +2 -2
  111. package/f-draggable/f-drop-to-group/drop-to-group-preparation/drop-to-group-preparation-request.d.ts +2 -2
  112. package/f-draggable/f-drop-to-group/providers.d.ts +1 -1
  113. package/f-draggable/f-node-move/create-drag-model-from-selection/providers.d.ts +1 -1
  114. package/f-draggable/f-node-move/move-preparation/f-node-move-preparation.execution.d.ts +1 -1
  115. package/f-draggable/f-node-move/move-preparation/f-node-move-preparation.request.d.ts +1 -1
  116. package/f-draggable/f-node-move/providers.d.ts +1 -1
  117. package/f-draggable/providers.d.ts +1 -1
  118. package/f-minimap/domain/providers.d.ts +1 -1
  119. package/f-minimap/providers.d.ts +1 -1
  120. package/f-node/providers.d.ts +1 -1
  121. package/f-selection-area/domain/providers.d.ts +1 -1
  122. package/f-storage/f-connectors-store.d.ts +6 -0
  123. package/f-storage/index.d.ts +1 -0
  124. package/f-storage/providers.d.ts +1 -1
  125. package/fesm2022/foblex-flow.mjs +1278 -1161
  126. package/fesm2022/foblex-flow.mjs.map +1 -1
  127. package/package.json +1 -1
  128. package/domain/f-connectors/get-all-can-be-connected-inputs-and-rects/get-all-can-be-connected-inputs-and-rects.execution.d.ts +0 -17
  129. package/domain/f-connectors/get-all-can-be-connected-inputs-and-rects/get-all-can-be-connected-inputs-and-rects.request.d.ts +0 -6
  130. package/domain/f-connectors/get-all-can-be-connected-inputs-and-rects/index.d.ts +0 -2
  131. package/domain/f-connectors/get-all-can-be-connected-source-connectors-and-rects/get-all-can-be-connected-source-connectors-and-rects.execution.d.ts +0 -18
  132. package/domain/f-connectors/get-all-can-be-connected-source-connectors-and-rects/get-all-can-be-connected-source-connectors-and-rects.request.d.ts +0 -6
  133. package/domain/f-connectors/get-all-can-be-connected-source-connectors-and-rects/index.d.ts +0 -2
  134. package/domain/f-node/calculate-node-connectors-connectable-sides/calculate-connectable-side-by-connected-positions/calculate-connectable-side-by-connected-positions-request.d.ts +0 -9
  135. package/domain/f-node/calculate-node-connectors-connectable-sides/calculate-connectable-side-by-internal-position/calculate-connectable-side-by-internal-position.d.ts +0 -20
  136. package/domain/f-node/calculate-node-connectors-connectable-sides/calculate-node-connectors-connectable-sides-request.d.ts +0 -6
  137. package/domain/f-node/calculate-node-connectors-connectable-sides/calculate-node-connectors-connectable-sides.d.ts +0 -28
  138. package/domain/f-node/calculate-node-connectors-connectable-sides/index.d.ts +0 -4
  139. package/domain/f-node/get-nodes/get-nodes-request.d.ts +0 -3
  140. package/domain/f-node/get-nodes/get-nodes.d.ts +0 -13
  141. package/domain/f-node/get-nodes/index.d.ts +0 -2
  142. package/esm2022/domain/f-connectors/get-all-can-be-connected-inputs-and-rects/get-all-can-be-connected-inputs-and-rects.execution.mjs +0 -48
  143. package/esm2022/domain/f-connectors/get-all-can-be-connected-inputs-and-rects/get-all-can-be-connected-inputs-and-rects.request.mjs +0 -8
  144. package/esm2022/domain/f-connectors/get-all-can-be-connected-inputs-and-rects/index.mjs +0 -3
  145. package/esm2022/domain/f-connectors/get-all-can-be-connected-source-connectors-and-rects/get-all-can-be-connected-source-connectors-and-rects.execution.mjs +0 -43
  146. package/esm2022/domain/f-connectors/get-all-can-be-connected-source-connectors-and-rects/get-all-can-be-connected-source-connectors-and-rects.request.mjs +0 -8
  147. package/esm2022/domain/f-connectors/get-all-can-be-connected-source-connectors-and-rects/index.mjs +0 -3
  148. package/esm2022/domain/f-node/calculate-node-connectors-connectable-sides/calculate-connectable-side-by-connected-positions/calculate-connectable-side-by-connected-positions-request.mjs +0 -16
  149. package/esm2022/domain/f-node/calculate-node-connectors-connectable-sides/calculate-connectable-side-by-connected-positions/calculate-connectable-side-by-connected-positions.mjs +0 -181
  150. package/esm2022/domain/f-node/calculate-node-connectors-connectable-sides/calculate-connectable-side-by-connected-positions/index.mjs +0 -3
  151. package/esm2022/domain/f-node/calculate-node-connectors-connectable-sides/calculate-connectable-side-by-internal-position/calculate-connectable-side-by-internal-position-request.mjs +0 -8
  152. package/esm2022/domain/f-node/calculate-node-connectors-connectable-sides/calculate-connectable-side-by-internal-position/calculate-connectable-side-by-internal-position.mjs +0 -55
  153. package/esm2022/domain/f-node/calculate-node-connectors-connectable-sides/calculate-connectable-side-by-internal-position/index.mjs +0 -3
  154. package/esm2022/domain/f-node/calculate-node-connectors-connectable-sides/calculate-node-connectors-connectable-sides-request.mjs +0 -8
  155. package/esm2022/domain/f-node/calculate-node-connectors-connectable-sides/calculate-node-connectors-connectable-sides.mjs +0 -90
  156. package/esm2022/domain/f-node/calculate-node-connectors-connectable-sides/index.mjs +0 -5
  157. package/esm2022/domain/f-node/get-nodes/get-nodes-request.mjs +0 -4
  158. package/esm2022/domain/f-node/get-nodes/get-nodes.mjs +0 -25
  159. package/esm2022/domain/f-node/get-nodes/index.mjs +0 -3
  160. package/esm2022/f-draggable/f-connection/f-create-connection/create-preparation/f-create-connection-preparation.execution.mjs +0 -52
  161. package/esm2022/f-draggable/f-connection/f-create-connection/create-preparation/f-create-connection-preparation.request.mjs +0 -10
  162. package/esm2022/f-draggable/f-connection/f-create-connection/create-preparation/from-output-preparation/f-create-connection-from-output-preparation.execution.mjs +0 -49
  163. package/esm2022/f-draggable/f-connection/f-create-connection/create-preparation/from-output-preparation/f-create-connection-from-output-preparation.request.mjs +0 -10
  164. package/f-draggable/f-connection/f-create-connection/create-preparation/f-create-connection-preparation.execution.d.ts +0 -16
  165. package/f-draggable/f-connection/f-create-connection/create-preparation/f-create-connection-preparation.request.d.ts +0 -8
  166. package/f-draggable/f-connection/f-create-connection/create-preparation/from-output-preparation/f-create-connection-from-output-preparation.execution.d.ts +0 -14
  167. package/f-draggable/f-connection/f-create-connection/create-preparation/from-output-preparation/f-create-connection-from-output-preparation.request.d.ts +0 -8
  168. /package/domain/f-node/{calculate-node-connectors-connectable-sides → calculate-connectors-connectable-sides}/calculate-connectable-side-by-connected-positions/index.d.ts +0 -0
  169. /package/domain/f-node/{calculate-node-connectors-connectable-sides → calculate-connectors-connectable-sides}/calculate-connectable-side-by-internal-position/calculate-connectable-side-by-internal-position-request.d.ts +0 -0
  170. /package/domain/f-node/{calculate-node-connectors-connectable-sides → calculate-connectors-connectable-sides}/calculate-connectable-side-by-internal-position/index.d.ts +0 -0
@@ -278,6 +278,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
278
278
  type: Injectable
279
279
  }] });
280
280
 
281
+ class FConnectorsStore {
282
+ _connectors = {};
283
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FConnectorsStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
284
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FConnectorsStore });
285
+ }
286
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FConnectorsStore, decorators: [{
287
+ type: Injectable
288
+ }] });
289
+
281
290
  const F_STORAGE_PROVIDERS = [
282
291
  NotifyDataChangedExecution,
283
292
  ListenCountChangesExecution,
@@ -1429,7 +1438,7 @@ class FGroupDirective extends FNodeBase {
1429
1438
  this._debounceTimer = setTimeout(() => this._calculateNodeConnectorsConnectableSides(), _DEBOUNCE_TIME$2);
1430
1439
  }
1431
1440
  _calculateNodeConnectorsConnectableSides() {
1432
- this._mediator.execute(new CalculateNodeConnectorsConnectableSidesRequest(this));
1441
+ this._mediator.execute(new CalculateConnectorsConnectableSidesRequest(this));
1433
1442
  }
1434
1443
  ngAfterViewInit() {
1435
1444
  if (!this.browser.isBrowser()) {
@@ -1556,7 +1565,7 @@ class FNodeDirective extends FNodeBase {
1556
1565
  this._debounceTimer = setTimeout(() => this._calculateNodeConnectorsConnectableSides(), _DEBOUNCE_TIME$1);
1557
1566
  }
1558
1567
  _calculateNodeConnectorsConnectableSides() {
1559
- this._mediator.execute(new CalculateNodeConnectorsConnectableSidesRequest(this));
1568
+ this._mediator.execute(new CalculateConnectorsConnectableSidesRequest(this));
1560
1569
  }
1561
1570
  ngAfterViewInit() {
1562
1571
  if (!this.browser.isBrowser()) {
@@ -2222,6 +2231,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
2222
2231
  }, providers: [{ provide: CONNECTION_TEXT, useExisting: FConnectionTextComponent }], template: "<ng-container xmlns:svg=\"http://www.w3.org/2000/svg\">\n <svg:textPath f-connection-text-path>\n {{ text }}\n </svg:textPath>\n</ng-container>\n" }]
2223
2232
  }] });
2224
2233
 
2234
+ /* eslint-disable */
2225
2235
  const F_CSS_CLASS = {
2226
2236
  DRAG_AND_DROP: {
2227
2237
  DRAGGING: 'f-dragging',
@@ -3363,6 +3373,9 @@ let GetNormalizedPointExecution = class GetNormalizedPointExecution {
3363
3373
  // +------------------------------------------+
3364
3374
  // Transform from the browser window to the canvas coordinates:
3365
3375
  handle(request) {
3376
+ if (!this._store.flowHost) {
3377
+ return request.position;
3378
+ }
3366
3379
  return Point.fromPoint(request.position)
3367
3380
  .elementTransform(this._store.flowHost)
3368
3381
  .sub(this._transform.scaledPosition)
@@ -3839,11 +3852,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
3839
3852
  type: Injectable
3840
3853
  }] });
3841
3854
 
3842
- class GetAllCanBeConnectedInputsAndRectsRequest {
3843
- outputOrOutlet;
3844
- static fToken = Symbol('GetAllCanBeConnectedInputsAndRectsRequest');
3845
- constructor(outputOrOutlet) {
3846
- this.outputOrOutlet = outputOrOutlet;
3855
+ class CalculateTargetConnectorsToConnectRequest {
3856
+ sourceConnector;
3857
+ pointerPosition;
3858
+ static fToken = Symbol('CalculateTargetConnectorsToConnectRequest');
3859
+ constructor(sourceConnector, pointerPosition) {
3860
+ this.sourceConnector = sourceConnector;
3861
+ this.pointerPosition = pointerPosition;
3847
3862
  }
3848
3863
  }
3849
3864
 
@@ -3879,245 +3894,341 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
3879
3894
  type: Injectable
3880
3895
  }] });
3881
3896
 
3897
+ class AddNodeToStoreRequest {
3898
+ nodeOrGroup;
3899
+ static fToken = Symbol('AddNodeToStoreRequest');
3900
+ constructor(nodeOrGroup) {
3901
+ this.nodeOrGroup = nodeOrGroup;
3902
+ }
3903
+ }
3904
+
3882
3905
  /**
3883
- * Execution that retrieves all input connectors that can be connected to a given output or outlet connector,
3906
+ * Execution that adds a Node to the FComponentsStore.
3884
3907
  */
3885
- let GetAllCanBeConnectedInputsAndRectsExecution = class GetAllCanBeConnectedInputsAndRectsExecution {
3886
- _mediator = inject(FMediator);
3908
+ let AddNodeToStore = class AddNodeToStore {
3887
3909
  _store = inject(FComponentsStore);
3888
- get _targetConnectors() {
3889
- return this._store.fInputs;
3890
- }
3891
- handle({ outputOrOutlet, }) {
3892
- return this._getCanBeConnectedInputs(outputOrOutlet).map((x) => {
3893
- return this._mediator.execute(new GetConnectorAndRectRequest(x));
3894
- });
3895
- }
3896
- _getCanBeConnectedInputs(outputOrOutlet) {
3897
- let targetConnectors = [];
3898
- if (outputOrOutlet.hasConnectionLimits) {
3899
- targetConnectors = this._targetConnectors.filter((x) => outputOrOutlet.canConnectTo(x));
3900
- }
3901
- else {
3902
- targetConnectors = this._targetConnectors.filter((x) => x.canBeConnected);
3903
- if (!outputOrOutlet.isSelfConnectable) {
3904
- targetConnectors = this._filterSelfConnectable(targetConnectors, outputOrOutlet);
3905
- }
3906
- }
3907
- return targetConnectors;
3908
- }
3909
- _filterSelfConnectable(targetConnectors, outputOrOutlet) {
3910
- return targetConnectors.filter(({ fNodeId }) => outputOrOutlet.fNodeId !== fNodeId);
3910
+ handle(request) {
3911
+ this._store.addComponent(this._store.fNodes, request.nodeOrGroup);
3911
3912
  }
3912
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetAllCanBeConnectedInputsAndRectsExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3913
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetAllCanBeConnectedInputsAndRectsExecution });
3913
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AddNodeToStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3914
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AddNodeToStore });
3914
3915
  };
3915
- GetAllCanBeConnectedInputsAndRectsExecution = __decorate([
3916
- FExecutionRegister(GetAllCanBeConnectedInputsAndRectsRequest)
3917
- ], GetAllCanBeConnectedInputsAndRectsExecution);
3918
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetAllCanBeConnectedInputsAndRectsExecution, decorators: [{
3916
+ AddNodeToStore = __decorate([
3917
+ FExecutionRegister(AddNodeToStoreRequest)
3918
+ ], AddNodeToStore);
3919
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AddNodeToStore, decorators: [{
3919
3920
  type: Injectable
3920
3921
  }] });
3921
3922
 
3922
- class GetAllCanBeConnectedSourceConnectorsAndRectsRequest {
3923
- targetConnector;
3924
- static fToken = Symbol('GetAllCanBeConnectedSourceConnectorsAndRectsRequest');
3925
- constructor(targetConnector) {
3926
- this.targetConnector = targetConnector;
3923
+ class CalculateInputConnectionsRequest {
3924
+ nodeOrGroup;
3925
+ static fToken = Symbol('CalculateInputConnectionsRequest');
3926
+ constructor(nodeOrGroup) {
3927
+ this.nodeOrGroup = nodeOrGroup;
3927
3928
  }
3928
3929
  }
3929
3930
 
3930
3931
  /**
3931
- * Execution that retrieves all source connectors that can be connected to a given target connector,
3932
- * along with their rectangles.
3933
- * Source - Output or Outlet connectors.
3932
+ * Execution that calculates input connections for a given FNode.
3934
3933
  */
3935
- let GetAllCanBeConnectedSourceConnectorsAndRectsExecution = class GetAllCanBeConnectedSourceConnectorsAndRectsExecution {
3936
- _mediator = inject(FMediator);
3934
+ let CalculateInputConnections = class CalculateInputConnections {
3937
3935
  _store = inject(FComponentsStore);
3938
- get _sourceConnectors() {
3939
- return this._store.fOutputs;
3940
- }
3941
- handle({ targetConnector, }) {
3942
- return this._getCanBeConnectedSourceConnectors(targetConnector).map((x) => {
3943
- return this._mediator.execute(new GetConnectorAndRectRequest(x));
3944
- });
3936
+ handle({ nodeOrGroup }) {
3937
+ const ids = this._collectInputIds(nodeOrGroup);
3938
+ return this._collectConnections(ids);
3939
+ }
3940
+ _collectInputIds(nodeOrGroup) {
3941
+ const ids = new Set();
3942
+ for (const connector of this._store.fInputs) {
3943
+ if (nodeOrGroup.isContains(connector.hostElement)) {
3944
+ ids.add(connector.fId());
3945
+ }
3946
+ }
3947
+ return ids;
3945
3948
  }
3946
- _getCanBeConnectedSourceConnectors(targetConnector) {
3947
- return this._sourceConnectors.filter((x) => {
3948
- let result = x.canBeConnected;
3949
- if (result && x.hasConnectionLimits) {
3950
- result = x.canConnectTo(targetConnector);
3949
+ _collectConnections(ids) {
3950
+ const result = [];
3951
+ for (const conn of this._store.fConnections) {
3952
+ if (ids.has(conn.fInputId())) {
3953
+ result.push(conn);
3951
3954
  }
3952
- return result;
3953
- });
3955
+ }
3956
+ return result;
3954
3957
  }
3955
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetAllCanBeConnectedSourceConnectorsAndRectsExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3956
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetAllCanBeConnectedSourceConnectorsAndRectsExecution });
3958
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CalculateInputConnections, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3959
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CalculateInputConnections });
3957
3960
  };
3958
- GetAllCanBeConnectedSourceConnectorsAndRectsExecution = __decorate([
3959
- FExecutionRegister(GetAllCanBeConnectedSourceConnectorsAndRectsRequest)
3960
- ], GetAllCanBeConnectedSourceConnectorsAndRectsExecution);
3961
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetAllCanBeConnectedSourceConnectorsAndRectsExecution, decorators: [{
3961
+ CalculateInputConnections = __decorate([
3962
+ FExecutionRegister(CalculateInputConnectionsRequest)
3963
+ ], CalculateInputConnections);
3964
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CalculateInputConnections, decorators: [{
3962
3965
  type: Injectable
3963
3966
  }] });
3964
3967
 
3965
- class MarkConnectableConnectorsRequest {
3966
- connectors;
3967
- static fToken = Symbol('MarkConnectableConnectorsRequest');
3968
- constructor(connectors) {
3969
- this.connectors = connectors;
3968
+ class CalculateConnectableSideByConnectedPositionsRequest {
3969
+ connector;
3970
+ pointerPosition;
3971
+ static fToken = Symbol('CalculateConnectableSideByConnectedPositionsRequest');
3972
+ constructor(connector, pointerPosition) {
3973
+ this.connector = connector;
3974
+ this.pointerPosition = pointerPosition;
3970
3975
  }
3971
3976
  }
3972
3977
 
3973
3978
  /**
3974
- * Execution that marks connectors as connectable.
3979
+ * Converts allowed sides array to a compact bit mask.
3980
+ * If not provided or empty -> all sides allowed.
3975
3981
  */
3976
- let MarkConnectableConnectors = class MarkConnectableConnectors {
3977
- _store = inject(FComponentsStore);
3978
- handle({ connectors }) {
3979
- this._store.flowHost.classList.add(F_CSS_CLASS.DRAG_AND_DROP.CONNECTIONS_DRAGGING);
3980
- connectors.forEach((x) => this._markConnector(x));
3981
- }
3982
- _markConnector({ hostElement }) {
3983
- hostElement.classList.add(F_CSS_CLASS.CONNECTOR.CONNECTABLE);
3982
+ const SNAP_EPS = 2;
3983
+ var SideMask;
3984
+ (function (SideMask) {
3985
+ SideMask[SideMask["NONE"] = 0] = "NONE";
3986
+ SideMask[SideMask["LEFT"] = 1] = "LEFT";
3987
+ SideMask[SideMask["RIGHT"] = 2] = "RIGHT";
3988
+ SideMask[SideMask["TOP"] = 4] = "TOP";
3989
+ SideMask[SideMask["BOTTOM"] = 8] = "BOTTOM";
3990
+ SideMask[SideMask["ALL"] = 15] = "ALL";
3991
+ })(SideMask || (SideMask = {}));
3992
+ /**
3993
+ * Determines final side using ideal side first; if disallowed, picks best fallback.
3994
+ * Inputs are numbers to avoid object wrappers on hot path.
3995
+ */
3996
+ function determineSide(selfX, selfY, avgX, avgY, allowed) {
3997
+ const allowedMask = _toSideMask(allowed);
3998
+ const dx = avgX - selfX;
3999
+ const dy = avgY - selfY;
4000
+ const ideal = _pickIdealSide(dx, dy);
4001
+ if (_isAllowed(ideal, allowedMask)) {
4002
+ return ideal;
3984
4003
  }
3985
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MarkConnectableConnectors, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3986
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MarkConnectableConnectors });
3987
- };
3988
- MarkConnectableConnectors = __decorate([
3989
- FExecutionRegister(MarkConnectableConnectorsRequest)
3990
- ], MarkConnectableConnectors);
3991
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MarkConnectableConnectors, decorators: [{
3992
- type: Injectable
3993
- }] });
3994
-
3995
- class RemoveInputFromStoreRequest {
3996
- component;
3997
- static fToken = Symbol('RemoveInputFromStoreRequest');
3998
- constructor(component) {
3999
- this.component = component;
4004
+ return _pickFallbackSide(dx, dy, allowedMask, ideal);
4005
+ }
4006
+ /**
4007
+ * Converts allowed sides array to a compact bit mask.
4008
+ * If not provided or empty -> all sides allowed.
4009
+ */
4010
+ function _toSideMask(allowed) {
4011
+ if (!allowed || allowed.length === 0)
4012
+ return SideMask.ALL;
4013
+ let mask = SideMask.NONE;
4014
+ for (let i = 0; i < allowed.length; i++) {
4015
+ switch (allowed[i]) {
4016
+ case EFConnectableSide.LEFT:
4017
+ mask |= SideMask.LEFT;
4018
+ break;
4019
+ case EFConnectableSide.RIGHT:
4020
+ mask |= SideMask.RIGHT;
4021
+ break;
4022
+ case EFConnectableSide.TOP:
4023
+ mask |= SideMask.TOP;
4024
+ break;
4025
+ case EFConnectableSide.BOTTOM:
4026
+ mask |= SideMask.BOTTOM;
4027
+ break;
4028
+ }
4000
4029
  }
4030
+ return mask || SideMask.ALL;
4001
4031
  }
4002
-
4003
4032
  /**
4004
- * Execution that removes an inputConnector from the FComponentsStore.
4033
+ * Picks the "ideal" side based on vector (dx, dy) with hysteresis.
4005
4034
  */
4006
- let RemoveInputFromStore = class RemoveInputFromStore {
4007
- _store = inject(FComponentsStore);
4008
- handle({ component }) {
4009
- this._store.removeComponent(this._store.fInputs, component);
4035
+ function _pickIdealSide(dx, dy) {
4036
+ const ax = dx < 0 ? -dx : dx;
4037
+ const ay = dy < 0 ? -dy : dy;
4038
+ if (ax - ay > SNAP_EPS) {
4039
+ return dx < 0 ? EFConnectableSide.LEFT : EFConnectableSide.RIGHT;
4010
4040
  }
4011
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoveInputFromStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4012
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoveInputFromStore });
4013
- };
4014
- RemoveInputFromStore = __decorate([
4015
- FExecutionRegister(RemoveInputFromStoreRequest)
4016
- ], RemoveInputFromStore);
4017
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoveInputFromStore, decorators: [{
4018
- type: Injectable
4019
- }] });
4020
-
4021
- class RemoveOutletFromStoreRequest {
4022
- fComponent;
4023
- static fToken = Symbol('RemoveOutletFromStoreRequest');
4024
- constructor(fComponent) {
4025
- this.fComponent = fComponent;
4041
+ if (ay - ax > SNAP_EPS) {
4042
+ return dy < 0 ? EFConnectableSide.TOP : EFConnectableSide.BOTTOM;
4026
4043
  }
4044
+ return dy < 0 ? EFConnectableSide.TOP : EFConnectableSide.BOTTOM;
4027
4045
  }
4028
-
4029
4046
  /**
4030
- * Execution that removes an outlet connector from the FComponentsStore.
4047
+ * Quick membership check via bit mask.
4031
4048
  */
4032
- let RemoveOutletFromStoreExecution = class RemoveOutletFromStoreExecution {
4033
- _store = inject(FComponentsStore);
4034
- handle(request) {
4035
- this._store.removeComponent(this._store.fOutlets, request.fComponent);
4049
+ function _isAllowed(side, mask) {
4050
+ switch (side) {
4051
+ case EFConnectableSide.LEFT:
4052
+ return (mask & SideMask.LEFT) !== 0;
4053
+ case EFConnectableSide.RIGHT:
4054
+ return (mask & SideMask.RIGHT) !== 0;
4055
+ case EFConnectableSide.TOP:
4056
+ return (mask & SideMask.TOP) !== 0;
4057
+ case EFConnectableSide.BOTTOM:
4058
+ return (mask & SideMask.BOTTOM) !== 0;
4059
+ default:
4060
+ return true;
4036
4061
  }
4037
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoveOutletFromStoreExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4038
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoveOutletFromStoreExecution });
4039
- };
4040
- RemoveOutletFromStoreExecution = __decorate([
4041
- FExecutionRegister(RemoveOutletFromStoreRequest)
4042
- ], RemoveOutletFromStoreExecution);
4043
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoveOutletFromStoreExecution, decorators: [{
4044
- type: Injectable
4045
- }] });
4046
-
4047
- class RemoveOutputFromStoreRequest {
4048
- fComponent;
4049
- static fToken = Symbol('RemoveOutputFromStoreRequest');
4050
- constructor(fComponent) {
4051
- this.fComponent = fComponent;
4062
+ }
4063
+ /**
4064
+ * Picks the best available side from allowed mask by maximizing directional score.
4065
+ * No intermediate objects, constant-time operations.
4066
+ */
4067
+ function _pickFallbackSide(dx, dy, allowedMask, ideal) {
4068
+ let bestSide = ideal;
4069
+ let bestScore = -Infinity;
4070
+ if (allowedMask & SideMask.RIGHT) {
4071
+ const s = dx;
4072
+ if (s > bestScore) {
4073
+ bestScore = s;
4074
+ bestSide = EFConnectableSide.RIGHT;
4075
+ }
4076
+ }
4077
+ if (allowedMask & SideMask.LEFT) {
4078
+ const s = -dx;
4079
+ if (s > bestScore) {
4080
+ bestScore = s;
4081
+ bestSide = EFConnectableSide.LEFT;
4082
+ }
4083
+ }
4084
+ if (allowedMask & SideMask.BOTTOM) {
4085
+ const s = dy;
4086
+ if (s > bestScore) {
4087
+ bestScore = s;
4088
+ bestSide = EFConnectableSide.BOTTOM;
4089
+ }
4090
+ }
4091
+ if (allowedMask & SideMask.TOP) {
4092
+ const s = -dy;
4093
+ if (s > bestScore) {
4094
+ bestScore = s;
4095
+ bestSide = EFConnectableSide.TOP;
4096
+ }
4052
4097
  }
4098
+ return bestSide;
4053
4099
  }
4054
4100
 
4055
4101
  /**
4056
- * Execution that removes an outlet connector from the FComponentsStore.
4102
+ * Checks if the given side is one of the calculate modes.
4103
+ * @param side The connectable side to check.
4104
+ * @returns True if the side is a calculate mode, false otherwise.
4057
4105
  */
4058
- let RemoveOutputFromStoreExecution = class RemoveOutputFromStoreExecution {
4059
- _store = inject(FComponentsStore);
4060
- handle(request) {
4061
- this._store.removeComponent(this._store.fOutputs, request.fComponent);
4062
- }
4063
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoveOutputFromStoreExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4064
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoveOutputFromStoreExecution });
4106
+ function isCalculateMode(side) {
4107
+ return (side === EFConnectableSide.CALCULATE ||
4108
+ side === EFConnectableSide.CALCULATE_HORIZONTAL ||
4109
+ side === EFConnectableSide.CALCULATE_VERTICAL);
4110
+ }
4111
+
4112
+ const CALCULATABLE_SIDES = {
4113
+ [EFConnectableSide.CALCULATE]: [
4114
+ EFConnectableSide.TOP,
4115
+ EFConnectableSide.BOTTOM,
4116
+ EFConnectableSide.LEFT,
4117
+ EFConnectableSide.RIGHT,
4118
+ ],
4119
+ [EFConnectableSide.CALCULATE_HORIZONTAL]: [EFConnectableSide.LEFT, EFConnectableSide.RIGHT],
4120
+ [EFConnectableSide.CALCULATE_VERTICAL]: [EFConnectableSide.TOP, EFConnectableSide.BOTTOM],
4065
4121
  };
4066
- RemoveOutputFromStoreExecution = __decorate([
4067
- FExecutionRegister(RemoveOutputFromStoreRequest)
4068
- ], RemoveOutputFromStoreExecution);
4069
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoveOutputFromStoreExecution, decorators: [{
4070
- type: Injectable
4071
- }] });
4072
4122
 
4073
- class UnmarkConnectableConnectorsRequest {
4074
- connectors;
4075
- static fToken = Symbol('UnmarkConnectableConnectorsRequest');
4076
- constructor(connectors) {
4077
- this.connectors = connectors;
4123
+ class GetNormalizedElementRectRequest {
4124
+ element;
4125
+ static fToken = Symbol('GetNormalizedElementRectRequest');
4126
+ constructor(element) {
4127
+ this.element = element;
4078
4128
  }
4079
4129
  }
4080
4130
 
4081
4131
  /**
4082
- * Execution that unmarks connectors as connectable.
4132
+ * Execution that retrieves the normalized rectangle of an element.
4133
+ * It calculates the rectangle based on the element's position and size,
4134
+ * adjusting for the canvas transformation and element offsets.
4083
4135
  */
4084
- let UnmarkConnectableConnectors = class UnmarkConnectableConnectors {
4136
+ let GetNormalizedElementRectExecution = class GetNormalizedElementRectExecution {
4085
4137
  _store = inject(FComponentsStore);
4086
- handle({ connectors }) {
4087
- this._store.flowHost.classList.remove(F_CSS_CLASS.DRAG_AND_DROP.CONNECTIONS_DRAGGING);
4088
- connectors.forEach((x) => this._unmarkConnector(x));
4138
+ _mediator = inject(FMediator);
4139
+ get _transform() {
4140
+ return this._store.fCanvas.transform;
4089
4141
  }
4090
- _unmarkConnector({ hostElement }) {
4091
- hostElement.classList.remove(F_CSS_CLASS.CONNECTOR.CONNECTABLE);
4142
+ handle(request) {
4143
+ const systemRect = this._getElementRoundedRect(request);
4144
+ const position = this._normalizePosition(systemRect);
4145
+ const unscaledSize = this._unscaleSize(systemRect);
4146
+ const unscaledRect = this._getUnscaledRect(position, unscaledSize, systemRect);
4147
+ const offsetSize = this._getOffsetSize(request.element, unscaledSize);
4148
+ return RoundedRect.fromCenter(unscaledRect, offsetSize.width, offsetSize.height);
4092
4149
  }
4093
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: UnmarkConnectableConnectors, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4094
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: UnmarkConnectableConnectors });
4095
- };
4096
- UnmarkConnectableConnectors = __decorate([
4097
- FExecutionRegister(UnmarkConnectableConnectorsRequest)
4098
- ], UnmarkConnectableConnectors);
4099
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: UnmarkConnectableConnectors, decorators: [{
4150
+ _getElementRoundedRect(request) {
4151
+ return RoundedRect.fromRect(RectExtensions.fromElement(request.element));
4152
+ }
4153
+ _normalizePosition(rect) {
4154
+ return this._mediator.execute(new GetNormalizedPointRequest(rect));
4155
+ }
4156
+ _unscaleSize(rect) {
4157
+ return SizeExtensions.initialize(rect.width / this._transform.scale, rect.height / this._transform.scale);
4158
+ }
4159
+ _getUnscaledRect(position, size, rect) {
4160
+ return new RoundedRect(position.x, position.y, size.width, size.height, rect.radius1, rect.radius2, rect.radius3, rect.radius4);
4161
+ }
4162
+ _getOffsetSize(element, size) {
4163
+ return SizeExtensions.offsetFromElement(element) || size;
4164
+ }
4165
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetNormalizedElementRectExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4166
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetNormalizedElementRectExecution });
4167
+ };
4168
+ GetNormalizedElementRectExecution = __decorate([
4169
+ FExecutionRegister(GetNormalizedElementRectRequest)
4170
+ ], GetNormalizedElementRectExecution);
4171
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetNormalizedElementRectExecution, decorators: [{
4100
4172
  type: Injectable
4101
4173
  }] });
4102
4174
 
4103
- /*
4104
- * This file exports all the connector-related executions that can be used in the FFlow domain.
4175
+ /**
4176
+ * Execution that calculates the connectable side for a connector
4177
+ * based on positions of connected connectors and allowed sides.
4105
4178
  */
4106
- const F_CONNECTORS_FEATURES = [
4107
- AddInputToStore,
4108
- AddOutletToStore,
4109
- AddOutputToStore,
4110
- CalculateClosestConnector,
4111
- FindConnectableConnectorUsingPriorityAndPositionExecution,
4112
- GetAllCanBeConnectedSourceConnectorsAndRectsExecution,
4113
- GetAllCanBeConnectedInputsAndRectsExecution,
4114
- GetConnectorAndRect,
4115
- MarkConnectableConnectors,
4116
- RemoveInputFromStore,
4117
- RemoveOutletFromStoreExecution,
4118
- RemoveOutputFromStoreExecution,
4119
- UnmarkConnectableConnectors,
4120
- ];
4179
+ let CalculateConnectableSideByConnectedPositions = class CalculateConnectableSideByConnectedPositions {
4180
+ _mediator = inject(FMediator);
4181
+ /**
4182
+ * Entry point (hot path). Avoids intermediate arrays and redundant allocations.
4183
+ *
4184
+ * @param request - Contains the connector and optionally allowed sides.
4185
+ * @returns {EFConnectableSide} - The chosen connectable side.
4186
+ */
4187
+ handle({ connector, pointerPosition, }) {
4188
+ const mode = connector.userFConnectableSide;
4189
+ const selfCenter = this._getConnectorRect(connector.hostElement).gravityCenter;
4190
+ const acc = this._accumulateConnectedCenters(connector.hostElement, connector.toConnector, pointerPosition);
4191
+ const avgX = acc.sumX / acc.count;
4192
+ const avgY = acc.sumY / acc.count;
4193
+ return determineSide(selfCenter.x, selfCenter.y, avgX, avgY, CALCULATABLE_SIDES[mode]);
4194
+ }
4195
+ _accumulateConnectedCenters(selfHost, connected, pointerPosition) {
4196
+ let sumX = pointerPosition?.x || 0;
4197
+ let sumY = pointerPosition?.y || 0;
4198
+ let count = pointerPosition ? 1 : 0;
4199
+ if (connected && connected.length) {
4200
+ for (let i = 0; i < connected.length; i++) {
4201
+ const el = connected[i].hostElement;
4202
+ if (el === selfHost)
4203
+ continue;
4204
+ const c = this._getConnectorRect(el).gravityCenter;
4205
+ sumX += c.x;
4206
+ sumY += c.y;
4207
+ count++;
4208
+ }
4209
+ }
4210
+ return { sumX, sumY, count };
4211
+ }
4212
+ _getConnectorRect(element) {
4213
+ return this._mediator.execute(new GetNormalizedElementRectRequest(element));
4214
+ }
4215
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CalculateConnectableSideByConnectedPositions, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4216
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CalculateConnectableSideByConnectedPositions });
4217
+ };
4218
+ CalculateConnectableSideByConnectedPositions = __decorate([
4219
+ FExecutionRegister(CalculateConnectableSideByConnectedPositionsRequest)
4220
+ ], CalculateConnectableSideByConnectedPositions);
4221
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CalculateConnectableSideByConnectedPositions, decorators: [{
4222
+ type: Injectable
4223
+ }] });
4224
+
4225
+ class CalculateConnectableSideByInternalPositionRequest {
4226
+ connector;
4227
+ static fToken = Symbol('CalculateConnectableSideByInternalPositionRequest');
4228
+ constructor(connector) {
4229
+ this.connector = connector;
4230
+ }
4231
+ }
4121
4232
 
4122
4233
  class AddDndToStoreRequest {
4123
4234
  fComponent;
@@ -4585,14 +4696,14 @@ class FCreateConnectionDragHandler {
4585
4696
  this._store = _injector.get(FComponentsStore);
4586
4697
  this._toConnectorRect = RoundedRect.fromRect(RectExtensions.initialize(_onPointerDownPosition.x, _onPointerDownPosition.y));
4587
4698
  this.fData = {
4588
- fOutputOrOutletId: this._fOutputOrOutlet.fId,
4699
+ fOutputOrOutletId: this._fOutputOrOutlet.fId(),
4589
4700
  };
4590
4701
  }
4591
4702
  prepareDragSequence() {
4703
+ this._fOutputWithRect = this._mediator.execute(new GetConnectorAndRectRequest(this._fOutputOrOutlet));
4592
4704
  this._getAndMarkCanBeConnectedInputs();
4593
4705
  this._initializeSnapConnection();
4594
4706
  this._initializeConnectionForCreate();
4595
- this._fOutputWithRect = this._mediator.execute(new GetConnectorAndRectRequest(this._fOutputOrOutlet));
4596
4707
  this._connection.show();
4597
4708
  this.onPointerMove(PointExtensions.initialize());
4598
4709
  this._result.setData({
@@ -4602,7 +4713,7 @@ class FCreateConnectionDragHandler {
4602
4713
  });
4603
4714
  }
4604
4715
  _getAndMarkCanBeConnectedInputs() {
4605
- this._canBeConnectedInputs = this._mediator.execute(new GetAllCanBeConnectedInputsAndRectsRequest(this._fOutputOrOutlet));
4716
+ this._canBeConnectedInputs = this._mediator.execute(new CalculateTargetConnectorsToConnectRequest(this._fOutputOrOutlet, this._fOutputWithRect.fRect.gravityCenter));
4606
4717
  this._mediator.execute(new MarkConnectableConnectorsRequest(this._canBeConnectedInputs.map((x) => x.fConnector)));
4607
4718
  }
4608
4719
  _initializeSnapConnection() {
@@ -4617,10 +4728,10 @@ class FCreateConnectionDragHandler {
4617
4728
  this._connection.initialize();
4618
4729
  }
4619
4730
  onPointerMove(difference) {
4620
- const fClosestInput = this._findClosestInput(difference);
4621
- this._drawConnectionForCreate(this._toConnectorRect.addPoint(difference), fClosestInput?.fConnector.fConnectableSide || EFConnectableSide.TOP);
4731
+ const closestInput = this._findClosestInput(difference);
4732
+ this._drawConnectionForCreate(this._toConnectorRect.addPoint(difference), closestInput?.fConnector.fConnectableSide || EFConnectableSide.TOP);
4622
4733
  if (this._snapConnection) {
4623
- this._drawSnapConnection(this._getClosestInputForSnapConnection(fClosestInput));
4734
+ this._drawSnapConnection(this._getClosestInputForSnapConnection(closestInput));
4624
4735
  }
4625
4736
  }
4626
4737
  _drawConnectionForCreate(toConnectorRect, fSide) {
@@ -4799,18 +4910,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
4799
4910
  type: Injectable
4800
4911
  }] });
4801
4912
 
4802
- class FCreateConnectionFromOutputPreparationRequest {
4913
+ class CreateConnectionFromOutputPreparationRequest {
4803
4914
  event;
4804
- fNode;
4805
- static fToken = Symbol('FCreateConnectionFromOutputPreparationRequest');
4806
- constructor(event, fNode) {
4915
+ node;
4916
+ static fToken = Symbol('CreateConnectionFromOutputPreparationRequest');
4917
+ constructor(event, node) {
4807
4918
  this.event = event;
4808
- this.fNode = fNode;
4919
+ this.node = node;
4809
4920
  }
4810
4921
  }
4811
4922
 
4812
- let FCreateConnectionFromOutputPreparationExecution = class FCreateConnectionFromOutputPreparationExecution {
4813
- _fMediator = inject(FMediator);
4923
+ let CreateConnectionFromOutputPreparation = class CreateConnectionFromOutputPreparation {
4924
+ _mediator = inject(FMediator);
4814
4925
  _store = inject(FComponentsStore);
4815
4926
  handle(request) {
4816
4927
  if (!this._isValid(request)) {
@@ -4818,70 +4929,74 @@ let FCreateConnectionFromOutputPreparationExecution = class FCreateConnectionFro
4818
4929
  }
4819
4930
  const fOutput = this._getOutput(request.event.targetElement);
4820
4931
  if (fOutput.canBeConnected) {
4821
- this._fMediator.execute(new FCreateConnectionDragHandlerPreparationRequest(request.event.getPosition(), fOutput));
4932
+ this._mediator.execute(new FCreateConnectionDragHandlerPreparationRequest(request.event.getPosition(), fOutput));
4822
4933
  }
4823
4934
  }
4824
4935
  _isValid(request) {
4825
- return this._isNodeOutput(request.event.targetElement, request.fNode);
4936
+ return this._isNodeOutput(request.event.targetElement, request.node);
4826
4937
  }
4827
4938
  _isNodeOutput(element, fNode) {
4828
4939
  return isNodeOutput(element) && !this._getNodeOutlets(fNode).length;
4829
4940
  }
4830
4941
  _getNodeOutlets(node) {
4831
- return this._store.fOutlets
4832
- .filter((x) => node.isContains(x.hostElement));
4942
+ return this._store.fOutlets.filter((x) => node.isContains(x.hostElement));
4833
4943
  }
4834
4944
  _getOutput(element) {
4835
- const result = this._store.fOutputs
4836
- .find((x) => x.hostElement.contains(element));
4945
+ const result = this._store.fOutputs.find((x) => x.hostElement.contains(element));
4837
4946
  if (!result) {
4838
4947
  throw new Error('Output not found');
4839
4948
  }
4840
4949
  return result;
4841
4950
  }
4842
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FCreateConnectionFromOutputPreparationExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4843
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FCreateConnectionFromOutputPreparationExecution });
4951
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CreateConnectionFromOutputPreparation, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4952
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CreateConnectionFromOutputPreparation });
4844
4953
  };
4845
- FCreateConnectionFromOutputPreparationExecution = __decorate([
4846
- FExecutionRegister(FCreateConnectionFromOutputPreparationRequest)
4847
- ], FCreateConnectionFromOutputPreparationExecution);
4848
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FCreateConnectionFromOutputPreparationExecution, decorators: [{
4954
+ CreateConnectionFromOutputPreparation = __decorate([
4955
+ FExecutionRegister(CreateConnectionFromOutputPreparationRequest)
4956
+ ], CreateConnectionFromOutputPreparation);
4957
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CreateConnectionFromOutputPreparation, decorators: [{
4849
4958
  type: Injectable
4850
4959
  }] });
4851
4960
 
4852
- class FCreateConnectionPreparationRequest {
4961
+ class CreateConnectionPreparationRequest {
4853
4962
  event;
4854
4963
  fTrigger;
4855
- static fToken = Symbol('FCreateConnectionPreparationRequest');
4964
+ static fToken = Symbol('CreateConnectionPreparationRequest');
4856
4965
  constructor(event, fTrigger) {
4857
4966
  this.event = event;
4858
4967
  this.fTrigger = fTrigger;
4859
4968
  }
4860
4969
  }
4861
4970
 
4862
- let FCreateConnectionPreparationExecution = class FCreateConnectionPreparationExecution {
4863
- _fMediator = inject(FMediator);
4971
+ // import { IPoint } from '@foblex/2d';
4972
+ // import { BrowserService } from '@foblex/platform';
4973
+ let CreateConnectionPreparation = class CreateConnectionPreparation {
4974
+ _mediator = inject(FMediator);
4864
4975
  _store = inject(FComponentsStore);
4865
4976
  _dragContext = inject(FDraggableDataContext);
4866
- _fNode;
4977
+ // private readonly _browser = inject(BrowserService);
4978
+ _node;
4867
4979
  handle(request) {
4868
4980
  if (!this._isValid(request) || !this._isValidTrigger(request)) {
4869
4981
  return;
4870
4982
  }
4983
+ // const elements = this._elementsFromPoint(request.event.getPosition());
4984
+ //
4985
+ // const outlet = this._findOutlet(elements);
4986
+ // const output = this._findOutput(elements);
4871
4987
  if (isNodeOutlet(request.event.targetElement)) {
4872
- this._fMediator.execute(new FCreateConnectionFromOutletPreparationRequest(request.event, this._fNode));
4988
+ this._mediator.execute(new FCreateConnectionFromOutletPreparationRequest(request.event, this._node));
4873
4989
  }
4874
4990
  else if (isNodeOutput(request.event.targetElement)) {
4875
- this._fMediator.execute(new FCreateConnectionFromOutputPreparationRequest(request.event, this._fNode));
4991
+ this._mediator.execute(new CreateConnectionFromOutputPreparationRequest(request.event, this._node));
4876
4992
  }
4877
4993
  }
4878
4994
  _isValid(request) {
4879
4995
  return !!this._getNode(request.event) && this._isValidConditions();
4880
4996
  }
4881
4997
  _getNode(event) {
4882
- this._fNode = this._store
4883
- .fNodes.find(n => n.isContains(event.targetElement));
4884
- return this._fNode;
4998
+ this._node = this._store.fNodes.find((n) => n.isContains(event.targetElement));
4999
+ return this._node;
4885
5000
  }
4886
5001
  _isValidConditions() {
4887
5002
  return this._dragContext.isEmpty() && !!this._store.fTempConnection;
@@ -4889,13 +5004,13 @@ let FCreateConnectionPreparationExecution = class FCreateConnectionPreparationEx
4889
5004
  _isValidTrigger(request) {
4890
5005
  return isValidEventTrigger(request.event.originalEvent, request.fTrigger);
4891
5006
  }
4892
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FCreateConnectionPreparationExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4893
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FCreateConnectionPreparationExecution });
5007
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CreateConnectionPreparation, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
5008
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CreateConnectionPreparation });
4894
5009
  };
4895
- FCreateConnectionPreparationExecution = __decorate([
4896
- FExecutionRegister(FCreateConnectionPreparationRequest)
4897
- ], FCreateConnectionPreparationExecution);
4898
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FCreateConnectionPreparationExecution, decorators: [{
5010
+ CreateConnectionPreparation = __decorate([
5011
+ FExecutionRegister(CreateConnectionPreparationRequest)
5012
+ ], CreateConnectionPreparation);
5013
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CreateConnectionPreparation, decorators: [{
4899
5014
  type: Injectable
4900
5015
  }] });
4901
5016
 
@@ -4942,7 +5057,7 @@ class FReassignTargetDragHandler {
4942
5057
  return this._connectableConnectors;
4943
5058
  }
4944
5059
  markConnectableConnector() {
4945
- this._connectableConnectors = this._mediator.execute(new GetAllCanBeConnectedInputsAndRectsRequest(this._sourceConnector));
5060
+ this._connectableConnectors = this._mediator.execute(new CalculateTargetConnectorsToConnectRequest(this._sourceConnector, this._sourceConnectorRect.gravityCenter));
4946
5061
  this._mediator.execute(new MarkConnectableConnectorsRequest(this._connectableConnectors.map((x) => x.fConnector)));
4947
5062
  }
4948
5063
  initializeSnapConnection(snapConnection) {
@@ -4972,12 +5087,12 @@ class FReassignTargetDragHandler {
4972
5087
  _calculateNewLine(targetPoint, fSide) {
4973
5088
  return this._mediator.execute(new CalculateConnectionLineByBehaviorRequest(this._sourceConnectorRect, roundedRectFromPoint(targetPoint), this._connection.fBehavior, this._sourceConnector.fConnectableSide, fSide));
4974
5089
  }
4975
- _drawSnapConnection(fClosestConnector) {
5090
+ _drawSnapConnection(closestConnector) {
4976
5091
  const snapConnection = this._snapConnection;
4977
- if (fClosestConnector) {
4978
- const line = this._getLineToClosestTargetConnector(fClosestConnector, snapConnection);
5092
+ if (closestConnector) {
5093
+ const line = this._getLineToClosestTargetConnector(closestConnector, snapConnection);
4979
5094
  snapConnection.show();
4980
- snapConnection.setLine(line, this._sourceConnector.fConnectableSide, fClosestConnector.fConnector.fConnectableSide);
5095
+ snapConnection.setLine(line, this._sourceConnector.fConnectableSide, closestConnector.fConnector.fConnectableSide);
4981
5096
  snapConnection.redraw();
4982
5097
  }
4983
5098
  else {
@@ -5019,7 +5134,7 @@ class FReassignSourceDragHandler {
5019
5134
  return this._connectableConnectors;
5020
5135
  }
5021
5136
  markConnectableConnector() {
5022
- this._connectableConnectors = this._mediator.execute(new GetAllCanBeConnectedSourceConnectorsAndRectsRequest(this._targetConnector));
5137
+ this._connectableConnectors = this._mediator.execute(new CalculateSourceConnectorsToConnectRequest(this._targetConnector, this._targetConnectorAndRect.fRect.gravityCenter));
5023
5138
  const isExistCurrentSourceConnector = this._connectableConnectors.some((x) => x.fConnector.fId() === this._sourceConnector.fId());
5024
5139
  if (!isExistCurrentSourceConnector) {
5025
5140
  this._connectableConnectors.push(this._sourceConnectorAndRect);
@@ -5316,8 +5431,8 @@ const CONNECTIONS_PROVIDERS = [
5316
5431
  FCreateConnectionDragHandlerPreparationExecution,
5317
5432
  FCreateConnectionFromOutletPreparationExecution,
5318
5433
  GetFirstConnectableOutputExecution,
5319
- FCreateConnectionFromOutputPreparationExecution,
5320
- FCreateConnectionPreparationExecution,
5434
+ CreateConnectionFromOutputPreparation,
5435
+ CreateConnectionPreparation,
5321
5436
  FReassignConnectionFinalizeExecution,
5322
5437
  FReassignConnectionPreparationExecution,
5323
5438
  ];
@@ -6382,8 +6497,8 @@ let FNodeMovePreparationExecution = class FNodeMovePreparationExecution {
6382
6497
  _mediator = inject(FMediator);
6383
6498
  _store = inject(FComponentsStore);
6384
6499
  _dragContext = inject(FDraggableDataContext);
6385
- get _transform() {
6386
- return this._store.fCanvas.transform;
6500
+ get _scale() {
6501
+ return this._store.fCanvas?.transform.scale || 1;
6387
6502
  }
6388
6503
  get _fHost() {
6389
6504
  return this._store.fFlow.hostElement;
@@ -6394,25 +6509,25 @@ let FNodeMovePreparationExecution = class FNodeMovePreparationExecution {
6394
6509
  return;
6395
6510
  }
6396
6511
  const summaryDragHandler = this._calculateDraggedItems(this._fNode);
6397
- this._dragContext.onPointerDownScale = this._transform.scale;
6512
+ this._dragContext.onPointerDownScale = this._scale;
6398
6513
  this._dragContext.onPointerDownPosition = Point.fromPoint(event.getPosition())
6399
- .elementTransform(this._fHost).div(this._transform.scale);
6514
+ .elementTransform(this._fHost)
6515
+ .div(this._scale);
6400
6516
  this._dragContext.draggableItems = [summaryDragHandler];
6401
6517
  if (this._store.fLineAlignment) {
6402
6518
  this._mediator.execute(new CreateSnapLinesRequest(summaryDragHandler));
6403
6519
  }
6404
6520
  }
6405
6521
  _isValid(event) {
6406
- return this._dragContext.isEmpty()
6407
- && this._isDragHandleElement(event.targetElement)
6408
- && !!this._getNode(event.targetElement);
6522
+ return (this._dragContext.isEmpty() &&
6523
+ this._isDragHandleElement(event.targetElement) &&
6524
+ !!this._getNode(event.targetElement));
6409
6525
  }
6410
6526
  _isDragHandleElement(element) {
6411
6527
  return isClosestElementHasClass(element, '.f-drag-handle');
6412
6528
  }
6413
6529
  _getNode(element) {
6414
- this._fNode = this._store.fNodes
6415
- .find(x => x.isContains(element) && !x.fDraggingDisabled());
6530
+ this._fNode = this._store.fNodes.find((x) => x.isContains(element) && !x.fDraggingDisabled());
6416
6531
  return this._fNode;
6417
6532
  }
6418
6533
  _isValidTrigger(event, fTrigger) {
@@ -6423,7 +6538,9 @@ let FNodeMovePreparationExecution = class FNodeMovePreparationExecution {
6423
6538
  let result;
6424
6539
  if (!fNode.fSelectionDisabled()) {
6425
6540
  // Need to select node before drag
6426
- this._mediator.execute(new SelectAndUpdateNodeLayerRequest(fNode));
6541
+ setTimeout(() => {
6542
+ this._mediator.execute(new SelectAndUpdateNodeLayerRequest(fNode));
6543
+ });
6427
6544
  result = this._dragModelFromSelection();
6428
6545
  }
6429
6546
  else {
@@ -7270,7 +7387,7 @@ let DropToGroupPreparation = class DropToGroupPreparation {
7270
7387
  // We can drop items only to children of direct parent
7271
7388
  const childIds = this._mediator.execute(new GetChildNodeIdsRequest(_dragTarget.fParentId()));
7272
7389
  if (childIds.length) {
7273
- targetRects = targetRects.filter(t => childIds.includes(t.node.fId()));
7390
+ targetRects = targetRects.filter((t) => childIds.includes(t.node.fId()));
7274
7391
  }
7275
7392
  }
7276
7393
  this._dragContext.draggableItems.push(new FNodeDropToGroupDragHandler(this._injector, targetRects));
@@ -7279,12 +7396,10 @@ let DropToGroupPreparation = class DropToGroupPreparation {
7279
7396
  return this._isNodeDragHandler() || this._isExternalItemDragHandler();
7280
7397
  }
7281
7398
  _isNodeDragHandler() {
7282
- return this._dragContext.draggableItems
7283
- .some((x) => x instanceof MoveSummaryDragHandler);
7399
+ return this._dragContext.draggableItems.some((x) => x instanceof MoveSummaryDragHandler);
7284
7400
  }
7285
7401
  _isExternalItemDragHandler() {
7286
- return this._dragContext.draggableItems
7287
- .some((x) => x instanceof FExternalItemDragHandler);
7402
+ return this._dragContext.draggableItems.some((x) => x instanceof FExternalItemDragHandler);
7288
7403
  }
7289
7404
  _collectGroupingTargetRects() {
7290
7405
  const dragged = this._draggedNodes();
@@ -7296,9 +7411,9 @@ let DropToGroupPreparation = class DropToGroupPreparation {
7296
7411
  });
7297
7412
  }
7298
7413
  _draggedNodes() {
7299
- return this._dragContext.draggableItems
7414
+ return (this._dragContext.draggableItems
7300
7415
  .find((x) => x instanceof MoveSummaryDragHandler)
7301
- ?.allDraggedNodeHandlers.map((x) => x.nodeOrGroup) || [];
7416
+ ?.allDraggedNodeHandlers.map((x) => x.nodeOrGroup) || []);
7302
7417
  }
7303
7418
  /**
7304
7419
  * Returns the list of dragged nodes extended with all of their parent nodes.
@@ -7313,8 +7428,8 @@ let DropToGroupPreparation = class DropToGroupPreparation {
7313
7428
  }, []);
7314
7429
  }
7315
7430
  _eligibleTargets(dragged, draggingGroup) {
7316
- const nonDragged = this._allNodesAndGroups.filter(x => !dragged.includes(x));
7317
- return draggingGroup ? nonDragged.filter(x => x instanceof FGroupDirective) : nonDragged;
7431
+ const nonDragged = this._allNodesAndGroups.filter((x) => !dragged.includes(x));
7432
+ return draggingGroup ? nonDragged.filter((x) => x instanceof FGroupDirective) : nonDragged;
7318
7433
  }
7319
7434
  _toCanvasRect(rect) {
7320
7435
  return RectExtensions.initialize(rect.x * this._canvasTransform.scale + this._canvasPosition.x, rect.y * this._canvasTransform.scale + this._canvasPosition.y, rect.width * this._canvasTransform.scale, rect.height * this._canvasTransform.scale);
@@ -8746,7 +8861,7 @@ class FDraggableDirective extends FDraggableBase {
8746
8861
  this._beforePlugins.forEach((p) => p.onPointerDown?.(event));
8747
8862
  this._mediator.execute(new FSingleSelectRequest(event, this.fMultiSelectTrigger));
8748
8863
  this._mediator.execute(new FReassignConnectionPreparationRequest(event, this.fReassignConnectionTrigger));
8749
- this._mediator.execute(new FCreateConnectionPreparationRequest(event, this.fCreateConnectionTrigger));
8864
+ this._mediator.execute(new CreateConnectionPreparationRequest(event, this.fCreateConnectionTrigger));
8750
8865
  this._afterPlugins.forEach((p) => p.onPointerDown?.(event));
8751
8866
  const isMouseLeftOrTouch = event.isMouseLeftButton();
8752
8867
  if (!isMouseLeftOrTouch) {
@@ -9458,70 +9573,6 @@ class GetCanBeSelectedItemsRequest {
9458
9573
  static fToken = Symbol('GetCanBeSelectedItemsRequest');
9459
9574
  }
9460
9575
 
9461
- class GetNormalizedElementRectRequest {
9462
- element;
9463
- static fToken = Symbol('GetNormalizedElementRectRequest');
9464
- constructor(element) {
9465
- this.element = element;
9466
- }
9467
- }
9468
-
9469
- /**
9470
- * Execution that retrieves the normalized rectangle of an element.
9471
- * It calculates the rectangle based on the element's position and size,
9472
- * adjusting for the canvas transformation and element offsets.
9473
- */
9474
- let GetNormalizedElementRectExecution = class GetNormalizedElementRectExecution {
9475
- _store = inject(FComponentsStore);
9476
- _mediator = inject(FMediator);
9477
- get _transform() {
9478
- return this._store.fCanvas.transform;
9479
- }
9480
- handle(request) {
9481
- const systemRect = this._getElementRoundedRect(request);
9482
- const position = this._normalizePosition(systemRect);
9483
- const unscaledSize = this._unscaleSize(systemRect);
9484
- const unscaledRect = this._getUnscaledRect(position, unscaledSize, systemRect);
9485
- const offsetSize = this._getOffsetSize(request.element, unscaledSize);
9486
- return RoundedRect.fromCenter(unscaledRect, offsetSize.width, offsetSize.height);
9487
- }
9488
- // BrowserWindow
9489
- // +--------------------------------+
9490
- // | |
9491
- // | Element |
9492
- // | (x: 100, y: 50) |
9493
- // | +--------+ |
9494
- // | | | |
9495
- // | | | |
9496
- // | +--------+ |
9497
- // | |
9498
- // +--------------------------------+
9499
- // This data of the element is relative to the browser window, not the canvas, with all transformations applied.
9500
- _getElementRoundedRect(request) {
9501
- return RoundedRect.fromRect(RectExtensions.fromElement(request.element));
9502
- }
9503
- _normalizePosition(rect) {
9504
- return this._mediator.execute(new GetNormalizedPointRequest(rect));
9505
- }
9506
- _unscaleSize(rect) {
9507
- return SizeExtensions.initialize(rect.width / this._transform.scale, rect.height / this._transform.scale);
9508
- }
9509
- _getUnscaledRect(position, size, rect) {
9510
- return new RoundedRect(position.x, position.y, size.width, size.height, rect.radius1, rect.radius2, rect.radius3, rect.radius4);
9511
- }
9512
- _getOffsetSize(element, size) {
9513
- return SizeExtensions.offsetFromElement(element) || size;
9514
- }
9515
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetNormalizedElementRectExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
9516
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetNormalizedElementRectExecution });
9517
- };
9518
- GetNormalizedElementRectExecution = __decorate([
9519
- FExecutionRegister(GetNormalizedElementRectRequest)
9520
- ], GetNormalizedElementRectExecution);
9521
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetNormalizedElementRectExecution, decorators: [{
9522
- type: Injectable
9523
- }] });
9524
-
9525
9576
  /**
9526
9577
  * Execution that retrieves elements that can be selected in the Flow, along with their bounding rectangles.
9527
9578
  * It filters out elements that are already selected in the FDraggableDataContext.
@@ -9705,10 +9756,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
9705
9756
  }] });
9706
9757
 
9707
9758
  class SelectAndUpdateNodeLayerRequest {
9708
- fNode;
9759
+ nodeOrGroup;
9709
9760
  static fToken = Symbol('SelectAndUpdateNodeLayerRequest');
9710
- constructor(fNode) {
9711
- this.fNode = fNode;
9761
+ constructor(nodeOrGroup) {
9762
+ this.nodeOrGroup = nodeOrGroup;
9712
9763
  }
9713
9764
  }
9714
9765
 
@@ -9899,11 +9950,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
9899
9950
  let SelectAndUpdateNodeLayerExecution = class SelectAndUpdateNodeLayerExecution {
9900
9951
  _dragContext = inject(FDraggableDataContext);
9901
9952
  _mediator = inject(FMediator);
9902
- handle(request) {
9903
- this.selectNodeIfNotSelected(request.fNode);
9904
- this._mediator.execute(new UpdateItemAndChildrenLayersRequest(request.fNode, request.fNode.hostElement.parentElement));
9953
+ handle({ nodeOrGroup }) {
9954
+ this._selectNodeIfNotSelected(nodeOrGroup);
9955
+ this._mediator.execute(new UpdateItemAndChildrenLayersRequest(nodeOrGroup, nodeOrGroup.hostElement.parentElement));
9905
9956
  }
9906
- selectNodeIfNotSelected(fNode) {
9957
+ _selectNodeIfNotSelected(fNode) {
9907
9958
  if (!this._dragContext.selectedItems.includes(fNode) && !fNode.fSelectionDisabled()) {
9908
9959
  this._dragContext.selectedItems.push(fNode);
9909
9960
  fNode.markAsSelected();
@@ -10190,1087 +10241,1151 @@ const F_DRAGGABLE_FEATURES = [
10190
10241
  RemoveDndFromStoreExecution,
10191
10242
  ];
10192
10243
 
10193
- class AddFlowToStoreRequest {
10194
- fComponent;
10195
- static fToken = Symbol('AddFlowToStoreRequest');
10196
- constructor(fComponent) {
10197
- this.fComponent = fComponent;
10198
- }
10199
- }
10200
-
10201
10244
  /**
10202
- * Execution that adds a Flow to the FComponentsStore.
10245
+ * Injection token for configuring the side detection tolerance (in pixels).
10246
+ * A new side must beat the previous side by more than this value to switch.
10203
10247
  */
10204
- let AddFlowToStoreExecution = class AddFlowToStoreExecution {
10205
- _store = inject(FComponentsStore);
10206
- handle(request) {
10207
- this._store.fFlow = request.fComponent;
10208
- }
10209
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AddFlowToStoreExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
10210
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AddFlowToStoreExecution });
10211
- };
10212
- AddFlowToStoreExecution = __decorate([
10213
- FExecutionRegister(AddFlowToStoreRequest)
10214
- ], AddFlowToStoreExecution);
10215
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AddFlowToStoreExecution, decorators: [{
10216
- type: Injectable
10217
- }] });
10218
-
10219
- class GetFlowRequest {
10220
- static fToken = Symbol('GetFlowRequest');
10221
- }
10222
-
10248
+ const CONNECTABLE_SIDE_EPSILON = new InjectionToken('CONNECTABLE_SIDE_EPSILON');
10223
10249
  /**
10224
- * Execution that retrieves the current Flow from the FComponentsStore.
10250
+ * Calculates the connectable side of a connector relative to its node host.
10251
+ *
10252
+ * Optimizations & behavior:
10253
+ * - Hysteresis via epsilon to avoid jitter near boundaries.
10254
+ * - Per-connector memoization using WeakMap (no leaks).
10255
+ * - During drag (isDragging === true) the last memorized side is returned immediately
10256
+ * for maximum stability and performance; a safe fallback computes it if missing.
10225
10257
  */
10226
- let GetFlowExecution = class GetFlowExecution {
10227
- _store = inject(FComponentsStore);
10228
- handle(request) {
10229
- const result = this._store.fFlow;
10230
- if (!result) {
10231
- throw new Error(`Flow not found in store`);
10258
+ let CalculateConnectableSideByInternalPosition = class CalculateConnectableSideByInternalPosition {
10259
+ _mediator = inject(FMediator);
10260
+ /**
10261
+ * Stores the last computed side per connector.
10262
+ * WeakMap ensures entries are garbage-collected with the connector objects.
10263
+ */
10264
+ _lastSide = new WeakMap();
10265
+ /** Pixel threshold to prevent side switching unless the new side is sufficiently better. */
10266
+ _epsilon = Math.max(0, inject(CONNECTABLE_SIDE_EPSILON, { optional: true }) ?? 2);
10267
+ /**
10268
+ * Entry point: returns the connectable side for a given connector.
10269
+ * If a drag is in progress, returns the last memorized side for stability.
10270
+ */
10271
+ handle({ connector, }) {
10272
+ // Fast path during drag: use memorized side (guaranteed to be present by caller’s contract).
10273
+ if (this._isDragging()) {
10274
+ const cached = this._lastSide.get(connector);
10275
+ if (cached !== undefined)
10276
+ return cached;
10277
+ // Safe fallback: compute once and cache.
10278
+ const computed = this._getSideByDelta(connector.hostElement, connector.fNodeHost, connector);
10279
+ this._lastSide.set(connector, computed);
10280
+ return computed;
10281
+ }
10282
+ // Normal path: compute with hysteresis, then remember.
10283
+ const side = this._getSideByDelta(connector.hostElement, connector.fNodeHost, connector);
10284
+ this._lastSide.set(connector, side);
10285
+ return side;
10286
+ }
10287
+ /**
10288
+ * Determines the side of the connector relative to the node host by
10289
+ * comparing distances from the connector's gravity center to each host edge.
10290
+ *
10291
+ * Hysteresis rule:
10292
+ * If the previously chosen side is within `epsilon` pixels of the new best side,
10293
+ * keep the previous side to avoid flicker.
10294
+ *
10295
+ * @param connectorHost - The connector element (HTML or SVG).
10296
+ * @param nodeHost - The parent node element (HTML or SVG).
10297
+ * @param connectorKey - The connector object, used as WeakMap key.
10298
+ * @returns The most stable connectable side.
10299
+ */
10300
+ _getSideByDelta(connectorHost, nodeHost, connectorKey) {
10301
+ const childRect = RectExtensions.fromElement(connectorHost);
10302
+ const parentRect = nodeHost.getBoundingClientRect();
10303
+ const cx = childRect.gravityCenter.x;
10304
+ const cy = childRect.gravityCenter.y;
10305
+ const deltaLeft = cx - parentRect.left;
10306
+ const deltaRight = parentRect.right - cx;
10307
+ const deltaTop = cy - parentRect.top;
10308
+ const deltaBottom = parentRect.bottom - cy;
10309
+ // Determine best side (min delta) in one pass
10310
+ let minIdx = 0;
10311
+ let minVal = deltaLeft;
10312
+ // i=1..3 correspond to Right, Top, Bottom respectively
10313
+ const candidates = [deltaLeft, deltaRight, deltaTop, deltaBottom];
10314
+ for (let i = 1; i < 4; i++) {
10315
+ const v = candidates[i];
10316
+ if (v < minVal) {
10317
+ minVal = v;
10318
+ minIdx = i;
10319
+ }
10232
10320
  }
10233
- return result;
10321
+ let candidate = minIdx === 0
10322
+ ? EFConnectableSide.LEFT
10323
+ : minIdx === 1
10324
+ ? EFConnectableSide.RIGHT
10325
+ : minIdx === 2
10326
+ ? EFConnectableSide.TOP
10327
+ : EFConnectableSide.BOTTOM;
10328
+ // Hysteresis: prefer previously chosen side if it's almost as good
10329
+ const prev = this._lastSide.get(connectorKey);
10330
+ if (prev !== undefined && prev !== candidate) {
10331
+ const prevIdx = prev === EFConnectableSide.LEFT
10332
+ ? 0
10333
+ : prev === EFConnectableSide.RIGHT
10334
+ ? 1
10335
+ : prev === EFConnectableSide.TOP
10336
+ ? 2
10337
+ : 3;
10338
+ const prevDelta = prevIdx === 0
10339
+ ? deltaLeft
10340
+ : prevIdx === 1
10341
+ ? deltaRight
10342
+ : prevIdx === 2
10343
+ ? deltaTop
10344
+ : deltaBottom;
10345
+ // How much better the new side is (smaller is better)
10346
+ const advantage = prevDelta - minVal;
10347
+ if (advantage <= this._epsilon) {
10348
+ candidate = prev;
10349
+ }
10350
+ }
10351
+ return candidate;
10234
10352
  }
10235
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetFlowExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
10236
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetFlowExecution });
10353
+ /** Returns true if a drag operation is currently active. */
10354
+ _isDragging() {
10355
+ return this._mediator.execute(new IsDragStartedRequest());
10356
+ }
10357
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CalculateConnectableSideByInternalPosition, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
10358
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CalculateConnectableSideByInternalPosition });
10237
10359
  };
10238
- GetFlowExecution = __decorate([
10239
- FExecutionRegister(GetFlowRequest)
10240
- ], GetFlowExecution);
10241
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetFlowExecution, decorators: [{
10360
+ CalculateConnectableSideByInternalPosition = __decorate([
10361
+ FExecutionRegister(CalculateConnectableSideByInternalPositionRequest)
10362
+ ], CalculateConnectableSideByInternalPosition);
10363
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CalculateConnectableSideByInternalPosition, decorators: [{
10242
10364
  type: Injectable
10243
10365
  }] });
10244
10366
 
10245
- class GetFlowHostElementRequest {
10246
- static fToken = Symbol('GetFlowHostElementRequest');
10367
+ class CalculateConnectorsConnectableSidesRequest {
10368
+ nodeOrGroup;
10369
+ static fToken = Symbol('CalculateConnectorsConnectableSidesRequest');
10370
+ constructor(nodeOrGroup) {
10371
+ this.nodeOrGroup = nodeOrGroup;
10372
+ }
10247
10373
  }
10248
10374
 
10249
10375
  /**
10250
- * Execution that retrieves the Flow host element from the FComponentsStore.
10376
+ * Execution that calculates connectable sides for all connectors of a node.
10251
10377
  */
10252
- let GetFlowHostElementExecution = class GetFlowHostElementExecution {
10253
- _store = inject(FComponentsStore);
10254
- handle() {
10255
- return this._store.flowHost;
10256
- }
10257
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetFlowHostElementExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
10258
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetFlowHostElementExecution });
10378
+ let CalculateConnectorsConnectableSides = class CalculateConnectorsConnectableSides {
10379
+ _mediator = inject(FMediator);
10380
+ /**
10381
+ * Orchestrates side calculation for all connectors of the given node.
10382
+ */
10383
+ handle({ nodeOrGroup }) {
10384
+ const connectors = nodeOrGroup.connectors;
10385
+ const len = connectors.length;
10386
+ for (let i = 0; i < len; i++) {
10387
+ const connection = connectors[i];
10388
+ connection.fConnectableSide = this._resolveSideForConnectorFast(connection);
10389
+ }
10390
+ const toRecalc = new Set();
10391
+ for (let i = 0; i < len; i++) {
10392
+ const source = connectors[i];
10393
+ const outs = source.toConnector;
10394
+ if (outs && outs.length) {
10395
+ for (let j = 0, m = outs.length; j < m; j++) {
10396
+ const target = outs[j];
10397
+ const userSide = target.userFConnectableSide;
10398
+ if (isCalculateMode(userSide)) {
10399
+ toRecalc.add(target);
10400
+ }
10401
+ }
10402
+ }
10403
+ }
10404
+ if (toRecalc.size > 0) {
10405
+ toRecalc.forEach((target) => {
10406
+ target.fConnectableSide = this._calculateByConnectedPositions(target);
10407
+ });
10408
+ }
10409
+ }
10410
+ /**
10411
+ * Resolves the connectable side for a connector quickly.
10412
+ * Avoids intermediate arrays and redundant allocations.
10413
+ */
10414
+ _resolveSideForConnectorFast(connector) {
10415
+ const mode = connector.userFConnectableSide;
10416
+ if (mode === EFConnectableSide.AUTO) {
10417
+ return this._mediator.execute(new CalculateConnectableSideByInternalPositionRequest(connector));
10418
+ }
10419
+ if (isCalculateMode(mode)) {
10420
+ return this._calculateByConnectedPositions(connector);
10421
+ }
10422
+ return mode;
10423
+ }
10424
+ /** Delegates to the connected-positions calculation execution. */
10425
+ _calculateByConnectedPositions(connector) {
10426
+ return this._mediator.execute(new CalculateConnectableSideByConnectedPositionsRequest(connector));
10427
+ }
10428
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CalculateConnectorsConnectableSides, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
10429
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CalculateConnectorsConnectableSides });
10259
10430
  };
10260
- GetFlowHostElementExecution = __decorate([
10261
- FExecutionRegister(GetFlowHostElementRequest)
10262
- ], GetFlowHostElementExecution);
10263
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetFlowHostElementExecution, decorators: [{
10431
+ CalculateConnectorsConnectableSides = __decorate([
10432
+ FExecutionRegister(CalculateConnectorsConnectableSidesRequest)
10433
+ ], CalculateConnectorsConnectableSides);
10434
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CalculateConnectorsConnectableSides, decorators: [{
10264
10435
  type: Injectable
10265
10436
  }] });
10266
10437
 
10267
- class GetFlowStateConnectionsRequest {
10268
- static fToken = Symbol('GetFlowStateConnectionsRequest');
10438
+ class CalculateNodesBoundingBoxRequest {
10439
+ static fToken = Symbol('CalculateNodesBoundingBoxRequest');
10269
10440
  }
10270
10441
 
10271
10442
  /**
10272
- * Execution that retrieves the current Flow state connections from the FComponentsStore.
10443
+ * Execution that calculates the bounding box of all nodes in the FComponentsStore.
10444
+ * It retrieves the rectangles of each node's host element and computes their union.
10273
10445
  */
10274
- let GetFlowStateConnectionsExecution = class GetFlowStateConnectionsExecution {
10446
+ let CalculateNodesBoundingBox = class CalculateNodesBoundingBox {
10275
10447
  _store = inject(FComponentsStore);
10276
10448
  handle(_request) {
10277
- return this._store.fConnections.map(this._mapToConnectionState);
10449
+ return RectExtensions.union(this._nodesRects());
10278
10450
  }
10279
- _mapToConnectionState(x) {
10280
- return {
10281
- id: x.fId(),
10282
- fOutputId: x.fOutputId(),
10283
- fInputId: x.fInputId(),
10284
- fType: x.fType,
10285
- fBehavior: x.fBehavior,
10286
- isSelected: x.isSelected(),
10287
- };
10451
+ _nodesRects() {
10452
+ return this._store.fNodes.map((x) => RectExtensions.fromElement(x.hostElement));
10288
10453
  }
10289
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetFlowStateConnectionsExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
10290
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetFlowStateConnectionsExecution });
10454
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CalculateNodesBoundingBox, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
10455
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CalculateNodesBoundingBox });
10291
10456
  };
10292
- GetFlowStateConnectionsExecution = __decorate([
10293
- FExecutionRegister(GetFlowStateConnectionsRequest)
10294
- ], GetFlowStateConnectionsExecution);
10295
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetFlowStateConnectionsExecution, decorators: [{
10457
+ CalculateNodesBoundingBox = __decorate([
10458
+ FExecutionRegister(CalculateNodesBoundingBoxRequest)
10459
+ ], CalculateNodesBoundingBox);
10460
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CalculateNodesBoundingBox, decorators: [{
10296
10461
  type: Injectable
10297
10462
  }] });
10298
10463
 
10299
- class GetFlowStateNodesRequest {
10300
- type;
10301
- static fToken = Symbol('GetFlowStateNodesRequest');
10302
- constructor(type) {
10303
- this.type = type;
10464
+ class CalculateNodesBoundingBoxNormalizedPositionRequest {
10465
+ fNodes;
10466
+ static fToken = Symbol('CalculateNodesBoundingBoxNormalizedPositionRequest');
10467
+ constructor(fNodes) {
10468
+ this.fNodes = fNodes;
10304
10469
  }
10305
10470
  }
10306
10471
 
10307
10472
  /**
10308
- * Execution that retrieves the state of Flow nodes, including their position, size, inputs, outputs, and selection status.
10473
+ * Execution that calculates the bounding box of all nodes in the FComponentsStore
10474
+ * and returns their normalized positions.
10475
+ * It retrieves the rectangles of each node's host element and computes their union.
10309
10476
  */
10310
- let GetFlowStateNodesExecution = class GetFlowStateNodesExecution {
10477
+ let CalculateNodesBoundingBoxNormalizedPosition = class CalculateNodesBoundingBoxNormalizedPosition {
10311
10478
  _store = inject(FComponentsStore);
10312
10479
  handle(request) {
10313
- return this._store.fNodes
10314
- .filter((x) => x instanceof request.type)
10315
- .map((x) => {
10316
- return {
10317
- id: x.fId(),
10318
- parent: x.fParentId(),
10319
- position: x._position,
10320
- size: x._size,
10321
- rotate: x._rotate,
10322
- fOutputs: this._getOutputs(x.hostElement),
10323
- fInputs: this._getInputs(x.hostElement),
10324
- isSelected: x.isSelected(),
10325
- };
10326
- });
10480
+ return RectExtensions.union(this._getNodesRects(request.fNodes || this._store.fNodes));
10327
10481
  }
10328
- _getOutputs(hostElement) {
10329
- return this._store.fOutputs
10330
- .filter((x) => hostElement.contains(x.hostElement))
10331
- .map((x) => {
10332
- return {
10333
- id: x.fId(),
10334
- fConnectableSide: x.fConnectableSide,
10335
- };
10482
+ _getNodesRects(fNodes) {
10483
+ return fNodes.map((x) => {
10484
+ return this._getElementRect(x, RectExtensions.fromElement(x.hostElement));
10336
10485
  });
10337
10486
  }
10338
- _getInputs(hostElement) {
10339
- return this._store.fInputs
10340
- .filter((x) => hostElement.contains(x.hostElement))
10341
- .map((x) => {
10342
- return {
10343
- id: x.fId(),
10344
- fConnectableSide: x.fConnectableSide,
10345
- };
10346
- });
10487
+ _getElementRect(fNode, rect) {
10488
+ return RectExtensions.initialize(fNode._position.x, fNode._position.y, rect.width, rect.height);
10347
10489
  }
10348
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetFlowStateNodesExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
10349
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetFlowStateNodesExecution });
10490
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CalculateNodesBoundingBoxNormalizedPosition, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
10491
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CalculateNodesBoundingBoxNormalizedPosition });
10350
10492
  };
10351
- GetFlowStateNodesExecution = __decorate([
10352
- FExecutionRegister(GetFlowStateNodesRequest)
10353
- ], GetFlowStateNodesExecution);
10354
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetFlowStateNodesExecution, decorators: [{
10493
+ CalculateNodesBoundingBoxNormalizedPosition = __decorate([
10494
+ FExecutionRegister(CalculateNodesBoundingBoxNormalizedPositionRequest)
10495
+ ], CalculateNodesBoundingBoxNormalizedPosition);
10496
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CalculateNodesBoundingBoxNormalizedPosition, decorators: [{
10355
10497
  type: Injectable
10356
10498
  }] });
10357
10499
 
10358
- class GetFlowStateRequest {
10359
- static fToken = Symbol('GetFlowStateRequest');
10500
+ class CalculateOutputConnectionsRequest {
10501
+ nodeOrGroup;
10502
+ static fToken = Symbol('CalculateOutputConnectionsRequest');
10503
+ constructor(nodeOrGroup) {
10504
+ this.nodeOrGroup = nodeOrGroup;
10505
+ }
10360
10506
  }
10361
10507
 
10362
10508
  /**
10363
- * Execution that retrieves the current state of the Flow, including its position, scale, nodes, groups, and connections.
10509
+ * Execution that calculates output connections for a given FNode.
10364
10510
  */
10365
- let GetFlowStateExecution = class GetFlowStateExecution {
10366
- _mediator = inject(FMediator);
10511
+ let CalculateOutputConnections = class CalculateOutputConnections {
10367
10512
  _store = inject(FComponentsStore);
10368
- handle(payload) {
10369
- return {
10370
- position: this._getCanvasPosition(this._store.fCanvas.transform),
10371
- scale: this._store.fCanvas.transform.scale,
10372
- nodes: this._mediator.execute(new GetFlowStateNodesRequest(FNodeDirective)),
10373
- groups: this._mediator.execute(new GetFlowStateNodesRequest(FGroupDirective)),
10374
- connections: this._mediator.execute(new GetFlowStateConnectionsRequest()),
10375
- };
10513
+ handle({ nodeOrGroup }) {
10514
+ const ids = this._collectOutputIds(nodeOrGroup);
10515
+ return this._collectConnections(ids);
10516
+ }
10517
+ _collectOutputIds(nodeOrGroup) {
10518
+ const ids = new Set();
10519
+ for (const connector of this._store.fOutputs) {
10520
+ if (nodeOrGroup.isContains(connector.hostElement)) {
10521
+ ids.add(connector.fId());
10522
+ }
10523
+ }
10524
+ return ids;
10376
10525
  }
10377
- _getCanvasPosition(transform) {
10378
- return PointExtensions.sum(transform.position, transform.scaledPosition);
10526
+ _collectConnections(ids) {
10527
+ const result = [];
10528
+ for (const conn of this._store.fConnections) {
10529
+ if (ids.has(conn.fOutputId())) {
10530
+ result.push(conn);
10531
+ }
10532
+ }
10533
+ return result;
10379
10534
  }
10380
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetFlowStateExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
10381
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetFlowStateExecution });
10535
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CalculateOutputConnections, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
10536
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CalculateOutputConnections });
10382
10537
  };
10383
- GetFlowStateExecution = __decorate([
10384
- FExecutionRegister(GetFlowStateRequest)
10385
- ], GetFlowStateExecution);
10386
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetFlowStateExecution, decorators: [{
10538
+ CalculateOutputConnections = __decorate([
10539
+ FExecutionRegister(CalculateOutputConnectionsRequest)
10540
+ ], CalculateOutputConnections);
10541
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CalculateOutputConnections, decorators: [{
10387
10542
  type: Injectable
10388
10543
  }] });
10389
10544
 
10390
- /**
10391
- * Providers for retrieving the current Flow state, including nodes, groups, and connections.
10392
- */
10393
- const GET_FLOW_STATE_PROVIDERS = [
10394
- GetFlowStateExecution,
10395
- GetFlowStateNodesExecution,
10396
- GetFlowStateConnectionsExecution,
10397
- ];
10545
+ class FitToChildNodesAndGroupsRequest {
10546
+ nodeOrGroup;
10547
+ static fToken = Symbol('FitToChildNodesAndGroupsRequest');
10548
+ constructor(nodeOrGroup) {
10549
+ this.nodeOrGroup = nodeOrGroup;
10550
+ }
10551
+ }
10398
10552
 
10399
- class RemoveFlowFromStoreRequest {
10400
- static fToken = Symbol('RemoveFlowFromStoreRequest');
10553
+ class GetNodePaddingRequest {
10554
+ fNode;
10555
+ rect;
10556
+ static fToken = Symbol('GetNodePaddingRequest');
10557
+ constructor(fNode, rect) {
10558
+ this.fNode = fNode;
10559
+ this.rect = rect;
10560
+ }
10401
10561
  }
10402
10562
 
10403
10563
  /**
10404
- * Execution that removes a Flow from the FComponentsStore.
10564
+ * Execution that retrieves the padding data of a Node.
10565
+ * If the Node does not include padding, it returns [0, 0, 0, 0].
10405
10566
  */
10406
- let RemoveFlowFromStoreExecution = class RemoveFlowFromStoreExecution {
10407
- _store = inject(FComponentsStore);
10567
+ let GetNodePadding = class GetNodePadding {
10568
+ _browser = inject(BrowserService);
10408
10569
  handle(request) {
10409
- this._store.fFlow = undefined;
10570
+ return request.fNode.fIncludePadding() ? this.getPaddingData(request.fNode, request.rect) : [0, 0, 0, 0];
10410
10571
  }
10411
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoveFlowFromStoreExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
10412
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoveFlowFromStoreExecution });
10572
+ getPaddingData(node, rect) {
10573
+ const style = this._browser.window.getComputedStyle(node.hostElement);
10574
+ return [
10575
+ this._browser.toPixels(style.paddingLeft, rect.width, rect.height, style.fontSize),
10576
+ this._browser.toPixels(style.paddingTop, rect.width, rect.height, style.fontSize),
10577
+ this._browser.toPixels(style.paddingRight, rect.width, rect.height, style.fontSize),
10578
+ this._browser.toPixels(style.paddingBottom, rect.width, rect.height, style.fontSize),
10579
+ ];
10580
+ }
10581
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetNodePadding, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
10582
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetNodePadding });
10413
10583
  };
10414
- RemoveFlowFromStoreExecution = __decorate([
10415
- FExecutionRegister(RemoveFlowFromStoreRequest)
10416
- ], RemoveFlowFromStoreExecution);
10417
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoveFlowFromStoreExecution, decorators: [{
10584
+ GetNodePadding = __decorate([
10585
+ FExecutionRegister(GetNodePaddingRequest)
10586
+ ], GetNodePadding);
10587
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetNodePadding, decorators: [{
10418
10588
  type: Injectable
10419
10589
  }] });
10420
10590
 
10421
- /**
10422
- * Providers for managing the Flow in the FComponentsStore.
10423
- * This includes adding, retrieving, and removing the Flow,
10424
- * as well as getting the Flow host element and its state.
10425
- */
10426
- const F_FLOW_FEATURES = [
10427
- AddFlowToStoreExecution,
10428
- GetFlowExecution,
10429
- GetFlowHostElementExecution,
10430
- ...GET_FLOW_STATE_PROVIDERS,
10431
- RemoveFlowFromStoreExecution,
10432
- ];
10433
-
10434
- class AddLineAlignmentToStoreRequest {
10435
- fComponent;
10436
- static fToken = Symbol('AddLineAlignmentToStoreRequest');
10437
- constructor(fComponent) {
10438
- this.fComponent = fComponent;
10591
+ let FitToChildNodesAndGroups = class FitToChildNodesAndGroups {
10592
+ _mediator = inject(FMediator);
10593
+ _store = inject(FComponentsStore);
10594
+ get _nodes() {
10595
+ return this._store.fNodes;
10439
10596
  }
10440
- }
10441
-
10442
- /**
10443
- * Execution that adds a line alignment to the FComponentsStore.
10444
- */
10445
- let AddLineAlignmentToStoreExecution = class AddLineAlignmentToStoreExecution {
10446
- _store = inject(FComponentsStore);
10447
- handle(request) {
10448
- this._store.fLineAlignment = request.fComponent;
10597
+ handle({ nodeOrGroup }) {
10598
+ if (nodeOrGroup.fAutoSizeToFitChildren()) {
10599
+ const directChildren = this._calculateDirectChildren(nodeOrGroup);
10600
+ if (directChildren.length) {
10601
+ const currentBounding = this._boundingRect(nodeOrGroup);
10602
+ const childrenBounding = this._calculateChildrenBounding(directChildren, this._paddings(nodeOrGroup, currentBounding));
10603
+ nodeOrGroup.updatePosition(childrenBounding);
10604
+ nodeOrGroup.updateSize(childrenBounding);
10605
+ nodeOrGroup.redraw();
10606
+ }
10607
+ }
10608
+ const parent = nodeOrGroup.fParentId();
10609
+ if (!parent) {
10610
+ return;
10611
+ }
10612
+ const parentNode = this._nodes.find(x => x.fId() === parent);
10613
+ if (!parentNode) {
10614
+ return;
10615
+ }
10616
+ this._mediator.execute(new FitToChildNodesAndGroupsRequest(parentNode));
10449
10617
  }
10450
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AddLineAlignmentToStoreExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
10451
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AddLineAlignmentToStoreExecution });
10618
+ _calculateDirectChildren(nodeOrGroup) {
10619
+ return this._nodes.filter(x => x.fParentId() === nodeOrGroup.fId());
10620
+ }
10621
+ _unionRect(nodeOrGroups) {
10622
+ return RectExtensions.union(nodeOrGroups.map((x) => this._boundingRect(x))) || RectExtensions.initialize();
10623
+ }
10624
+ _boundingRect(nodeOrGroup) {
10625
+ return this._mediator.execute(new GetNormalizedElementRectRequest(nodeOrGroup.hostElement));
10626
+ }
10627
+ _paddings(nodeOrGroup, rect) {
10628
+ return this._mediator.execute(new GetNodePaddingRequest(nodeOrGroup, rect));
10629
+ }
10630
+ _calculateChildrenBounding(directChildren, [top, right, bottom, left]) {
10631
+ let childrenBounding = this._unionRect(directChildren);
10632
+ childrenBounding = RectExtensions.initialize(childrenBounding.x - left, childrenBounding.y - top, childrenBounding.width + left + right, childrenBounding.height + top + bottom);
10633
+ return childrenBounding;
10634
+ }
10635
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FitToChildNodesAndGroups, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
10636
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FitToChildNodesAndGroups });
10452
10637
  };
10453
- AddLineAlignmentToStoreExecution = __decorate([
10454
- FExecutionRegister(AddLineAlignmentToStoreRequest)
10455
- ], AddLineAlignmentToStoreExecution);
10456
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AddLineAlignmentToStoreExecution, decorators: [{
10638
+ FitToChildNodesAndGroups = __decorate([
10639
+ FExecutionRegister(FitToChildNodesAndGroupsRequest)
10640
+ ], FitToChildNodesAndGroups);
10641
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FitToChildNodesAndGroups, decorators: [{
10457
10642
  type: Injectable
10458
10643
  }] });
10459
10644
 
10460
- class RemoveLineAlignmentFromStoreRequest {
10461
- static fToken = Symbol('RemoveLineAlignmentFromStoreRequest');
10645
+ class GetChildNodeIdsRequest {
10646
+ id;
10647
+ static fToken = Symbol('GetChildNodeIdsRequest');
10648
+ constructor(id) {
10649
+ this.id = id;
10650
+ }
10462
10651
  }
10463
10652
 
10464
10653
  /**
10465
- * Execution that removes a line alignment from the FComponentsStore.
10654
+ * Execution that retrieves all child nodes of a given node in the Flow.
10466
10655
  */
10467
- let RemoveLineAlignmentFromStoreExecution = class RemoveLineAlignmentFromStoreExecution {
10656
+ let GetChildNodeIds = class GetChildNodeIds {
10468
10657
  _store = inject(FComponentsStore);
10658
+ get _allNodesAndGroups() {
10659
+ return this._store.fNodes;
10660
+ }
10469
10661
  handle(request) {
10470
- this._store.fLineAlignment = undefined;
10662
+ if (!request.id) {
10663
+ return [];
10664
+ }
10665
+ const visited = new Set();
10666
+ const result = [];
10667
+ this._collectDescendants(request.id, result, visited);
10668
+ return result;
10471
10669
  }
10472
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoveLineAlignmentFromStoreExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
10473
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoveLineAlignmentFromStoreExecution });
10670
+ _collectDescendants(nodeId, result, visited) {
10671
+ if (visited.has(nodeId)) {
10672
+ throw new Error(`Circular reference detected in the node hierarchy. Node id: ${nodeId}`);
10673
+ }
10674
+ visited.add(nodeId);
10675
+ const children = this._allNodesAndGroups.filter(n => n.fParentId() === nodeId).map((x) => x.fId());
10676
+ result.push(...children);
10677
+ for (const id of children) {
10678
+ this._collectDescendants(id, result, visited);
10679
+ }
10680
+ }
10681
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetChildNodeIds, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
10682
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetChildNodeIds });
10474
10683
  };
10475
- RemoveLineAlignmentFromStoreExecution = __decorate([
10476
- FExecutionRegister(RemoveLineAlignmentFromStoreRequest)
10477
- ], RemoveLineAlignmentFromStoreExecution);
10478
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoveLineAlignmentFromStoreExecution, decorators: [{
10684
+ GetChildNodeIds = __decorate([
10685
+ FExecutionRegister(GetChildNodeIdsRequest)
10686
+ ], GetChildNodeIds);
10687
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetChildNodeIds, decorators: [{
10479
10688
  type: Injectable
10480
10689
  }] });
10481
10690
 
10482
- /**
10483
- * Collection of all FLineAlignment feature executions.
10484
- * These executions handle the addition and removal of line alignments
10485
- * in the FComponentsStore.
10486
- */
10487
- const F_LINE_ALIGNMENT_FEATURES = [
10488
- AddLineAlignmentToStoreExecution,
10489
- RemoveLineAlignmentFromStoreExecution,
10490
- ];
10491
-
10492
- class AddNodeToStoreRequest {
10493
- fComponent;
10494
- static fToken = Symbol('AddNodeToStoreRequest');
10495
- constructor(fComponent) {
10496
- this.fComponent = fComponent;
10691
+ class GetParentNodesRequest {
10692
+ fNode;
10693
+ static fToken = Symbol('GetParentNodesRequest');
10694
+ constructor(fNode) {
10695
+ this.fNode = fNode;
10497
10696
  }
10498
10697
  }
10499
10698
 
10500
10699
  /**
10501
- * Execution that adds a Node to the FComponentsStore.
10700
+ * Execution that retrieves all parent nodes of a given node from the FComponentsStore.
10502
10701
  */
10503
- let AddNodeToStore = class AddNodeToStore {
10702
+ let GetParentNodes = class GetParentNodes {
10504
10703
  _store = inject(FComponentsStore);
10505
10704
  handle(request) {
10506
- this._store.addComponent(this._store.fNodes, request.fComponent);
10705
+ return this._getParentNodes(request.fNode, new Set(), []);
10507
10706
  }
10508
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AddNodeToStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
10509
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AddNodeToStore });
10707
+ _getParentNodes(fNode, visited, result) {
10708
+ if (visited.has(fNode.fId())) {
10709
+ throw new Error('Circular reference detected in the node hierarchy. Node id: ' + fNode.fId());
10710
+ }
10711
+ visited.add(fNode.fId());
10712
+ const parent = this._store.fNodes.find((x) => x.fId() === fNode.fParentId());
10713
+ if (!parent) {
10714
+ return result;
10715
+ }
10716
+ result.push(parent);
10717
+ return this._getParentNodes(parent, visited, result);
10718
+ }
10719
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetParentNodes, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
10720
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetParentNodes });
10510
10721
  };
10511
- AddNodeToStore = __decorate([
10512
- FExecutionRegister(AddNodeToStoreRequest)
10513
- ], AddNodeToStore);
10514
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AddNodeToStore, decorators: [{
10722
+ GetParentNodes = __decorate([
10723
+ FExecutionRegister(GetParentNodesRequest)
10724
+ ], GetParentNodes);
10725
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetParentNodes, decorators: [{
10515
10726
  type: Injectable
10516
10727
  }] });
10517
10728
 
10518
- class CalculateInputConnectionsRequest {
10519
- fNode;
10520
- static fToken = Symbol('CalculateInputConnectionsRequest');
10521
- constructor(fNode) {
10522
- this.fNode = fNode;
10729
+ class UpdateNodeWhenStateOrSizeChangedRequest {
10730
+ nodeOrGroup;
10731
+ destroyRef;
10732
+ static fToken = Symbol('UpdateNodeWhenStateOrSizeChangedRequest');
10733
+ constructor(nodeOrGroup, destroyRef) {
10734
+ this.nodeOrGroup = nodeOrGroup;
10735
+ this.destroyRef = destroyRef;
10523
10736
  }
10524
10737
  }
10525
10738
 
10526
10739
  /**
10527
- * Execution that calculates input connections for a given FNode.
10740
+ * Execution that updates a node's connectors when its state or size changes.
10528
10741
  */
10529
- let CalculateInputConnections = class CalculateInputConnections {
10530
- _store = inject(FComponentsStore);
10531
- handle(request) {
10532
- return this._calculateConnections(new Set(this._calculateConnectors(request.fNode)));
10533
- }
10534
- _calculateConnectors(fNode) {
10535
- return this._store.fInputs.filter((x) => fNode.isContains(x.hostElement)).map((x) => x.fId());
10742
+ let UpdateNodeWhenStateOrSizeChanged = class UpdateNodeWhenStateOrSizeChanged {
10743
+ _mediator = inject(FMediator);
10744
+ /**
10745
+ * Handles the request to update the node's connectors based on state or size changes.
10746
+ * It listens for resize events and recalculates the connectable sides of the connectors.
10747
+ * @param request
10748
+ */
10749
+ handle({ nodeOrGroup, destroyRef }) {
10750
+ const { hostElement, stateChanges } = nodeOrGroup;
10751
+ new FChannelHub(new FResizeChannel(hostElement), stateChanges)
10752
+ .pipe(notifyOnStart(), debounceTime(10))
10753
+ .listen(destroyRef, () => {
10754
+ this._mediator.execute(new NotifyDataChangedRequest());
10755
+ if (!this._isDragging()) {
10756
+ this._mediator.execute(new CalculateConnectorsConnectableSidesRequest(nodeOrGroup));
10757
+ this._mediator.execute(new FitToChildNodesAndGroupsRequest(nodeOrGroup));
10758
+ }
10759
+ });
10536
10760
  }
10537
- _calculateConnections(ids) {
10538
- return this._store.fConnections.filter((x) => ids.has(x.fInputId()));
10761
+ _isDragging() {
10762
+ return this._mediator.execute(new IsDragStartedRequest());
10539
10763
  }
10540
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CalculateInputConnections, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
10541
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CalculateInputConnections });
10764
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: UpdateNodeWhenStateOrSizeChanged, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
10765
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: UpdateNodeWhenStateOrSizeChanged });
10542
10766
  };
10543
- CalculateInputConnections = __decorate([
10544
- FExecutionRegister(CalculateInputConnectionsRequest)
10545
- ], CalculateInputConnections);
10546
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CalculateInputConnections, decorators: [{
10767
+ UpdateNodeWhenStateOrSizeChanged = __decorate([
10768
+ FExecutionRegister(UpdateNodeWhenStateOrSizeChangedRequest)
10769
+ ], UpdateNodeWhenStateOrSizeChanged);
10770
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: UpdateNodeWhenStateOrSizeChanged, decorators: [{
10547
10771
  type: Injectable
10548
10772
  }] });
10549
10773
 
10550
- const CALCULATE_MODES = [
10551
- EFConnectableSide.CALCULATE,
10552
- EFConnectableSide.CALCULATE_HORIZONTAL,
10553
- EFConnectableSide.CALCULATE_VERTICAL,
10554
- ];
10555
- class CalculateConnectableSideByConnectedPositionsRequest {
10556
- connector;
10557
- mode;
10558
- static fToken = Symbol('CalculateConnectableSideByConnectedPositionsRequest');
10559
- constructor(connector, mode) {
10560
- this.connector = connector;
10561
- this.mode = mode;
10562
- }
10563
- }
10564
-
10565
- class CalculateConnectableSideByInternalPositionRequest {
10566
- connector;
10567
- static fToken = Symbol('CalculateConnectableSideByInternalPositionRequest');
10568
- constructor(connector) {
10569
- this.connector = connector;
10774
+ class RemoveNodeFromStoreRequest {
10775
+ fComponent;
10776
+ static fToken = Symbol('RemoveNodeFromStoreRequest');
10777
+ constructor(fComponent) {
10778
+ this.fComponent = fComponent;
10570
10779
  }
10571
10780
  }
10572
10781
 
10573
10782
  /**
10574
- * Execution that calculates the connectable side for a connector
10575
- * based on the internal position of the connector relative to its node host.
10783
+ * Execution that removes a node from the FComponentsStore.
10576
10784
  */
10577
- let CalculateConnectableSideByInternalPosition = class CalculateConnectableSideByInternalPosition {
10578
- handle({ connector, }) {
10579
- return this._getSideByDelta(connector.hostElement, connector.fNodeHost);
10580
- }
10581
- /**
10582
- * Determines the side of the connector relative to the node host based on the minimum distance.
10583
- * @param connectorHost
10584
- * @param nodeHost
10585
- * @private
10586
- */
10587
- _getSideByDelta(connectorHost, nodeHost) {
10588
- let result;
10589
- const childRect = RectExtensions.fromElement(connectorHost);
10590
- const parentRect = nodeHost.getBoundingClientRect();
10591
- const deltaLeft = childRect.gravityCenter.x - parentRect.left;
10592
- const deltaRight = parentRect.right - childRect.gravityCenter.x;
10593
- const deltaTop = childRect.gravityCenter.y - parentRect.top;
10594
- const deltaBottom = parentRect.bottom - childRect.gravityCenter.y;
10595
- const minDelta = Math.min(deltaLeft, deltaRight, deltaTop, deltaBottom);
10596
- if (minDelta === deltaLeft) {
10597
- result = EFConnectableSide.LEFT;
10598
- }
10599
- else if (minDelta === deltaRight) {
10600
- result = EFConnectableSide.RIGHT;
10601
- }
10602
- else if (minDelta === deltaTop) {
10603
- result = EFConnectableSide.TOP;
10604
- }
10605
- else {
10606
- result = EFConnectableSide.BOTTOM;
10607
- }
10608
- return result;
10785
+ let RemoveNodeFromStore = class RemoveNodeFromStore {
10786
+ _store = inject(FComponentsStore);
10787
+ handle(request) {
10788
+ this._store.removeComponent(this._store.fNodes, request.fComponent);
10609
10789
  }
10610
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CalculateConnectableSideByInternalPosition, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
10611
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CalculateConnectableSideByInternalPosition });
10790
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoveNodeFromStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
10791
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoveNodeFromStore });
10612
10792
  };
10613
- CalculateConnectableSideByInternalPosition = __decorate([
10614
- FExecutionRegister(CalculateConnectableSideByInternalPositionRequest)
10615
- ], CalculateConnectableSideByInternalPosition);
10616
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CalculateConnectableSideByInternalPosition, decorators: [{
10793
+ RemoveNodeFromStore = __decorate([
10794
+ FExecutionRegister(RemoveNodeFromStoreRequest)
10795
+ ], RemoveNodeFromStore);
10796
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoveNodeFromStore, decorators: [{
10617
10797
  type: Injectable
10618
10798
  }] });
10619
10799
 
10620
- const SNAP_EPS = 2;
10621
- const CALCULATE_SIDES = {
10622
- [EFConnectableSide.CALCULATE]: [
10623
- EFConnectableSide.TOP,
10624
- EFConnectableSide.BOTTOM,
10625
- EFConnectableSide.LEFT,
10626
- EFConnectableSide.RIGHT,
10627
- ],
10628
- [EFConnectableSide.CALCULATE_HORIZONTAL]: [EFConnectableSide.LEFT, EFConnectableSide.RIGHT],
10629
- [EFConnectableSide.CALCULATE_VERTICAL]: [EFConnectableSide.TOP, EFConnectableSide.BOTTOM],
10630
- };
10631
10800
  /**
10632
- * Execution that calculates the connectable side for a connector
10633
- * based on positions of connected connectors and allowed sides.
10801
+ * This file exports all the node-related executions that can be used in the F-Flow domain.
10634
10802
  */
10635
- let CalculateConnectableSideByConnectedPositions = class CalculateConnectableSideByConnectedPositions {
10803
+ const F_NODE_FEATURES = [
10804
+ AddNodeToStore,
10805
+ CalculateConnectableSideByConnectedPositions,
10806
+ CalculateConnectableSideByInternalPosition,
10807
+ CalculateInputConnections,
10808
+ CalculateConnectorsConnectableSides,
10809
+ CalculateNodesBoundingBox,
10810
+ CalculateNodesBoundingBoxNormalizedPosition,
10811
+ CalculateOutputConnections,
10812
+ FitToChildNodesAndGroups,
10813
+ GetChildNodeIds,
10814
+ GetNodePadding,
10815
+ GetParentNodes,
10816
+ UpdateNodeWhenStateOrSizeChanged,
10817
+ RemoveNodeFromStore,
10818
+ ];
10819
+
10820
+ /**
10821
+ * Execution that retrieves all input connectors that can be connected to a given output or outlet connector,
10822
+ */
10823
+ let CalculateTargetConnectorsToConnect = class CalculateTargetConnectorsToConnect {
10636
10824
  _mediator = inject(FMediator);
10637
- /**
10638
- * Entry point (hot path). Avoids intermediate arrays and redundant allocations.
10639
- *
10640
- * @param request - Contains the connector and optionally allowed sides.
10641
- * @returns {EFConnectableSide} - The chosen connectable side.
10642
- */
10643
- handle({ connector, mode, }) {
10644
- const selfCenter = RectExtensions.fromElement(connector.hostElement).gravityCenter;
10645
- const acc = this._accumulateConnectedCenters(connector.hostElement, connector.toConnector);
10646
- if (acc.count === 0) {
10647
- return this._mediator.execute(new CalculateConnectableSideByInternalPositionRequest(connector));
10648
- }
10649
- const avgX = acc.sumX / acc.count;
10650
- const avgY = acc.sumY / acc.count;
10651
- const mask = this._toSideMask(CALCULATE_SIDES[mode]);
10652
- return this._determineSide(selfCenter.x, selfCenter.y, avgX, avgY, mask);
10825
+ _store = inject(FComponentsStore);
10826
+ get _targetConnectors() {
10827
+ return this._store.fInputs;
10653
10828
  }
10654
- /**
10655
- * Accumulates sum of gravity centers and count, excluding the current host.
10656
- * Single pass, minimal allocations.
10657
- */
10658
- _accumulateConnectedCenters(selfHost, connected) {
10659
- let sumX = 0;
10660
- let sumY = 0;
10661
- let count = 0;
10662
- if (connected && connected.length) {
10663
- for (let i = 0; i < connected.length; i++) {
10664
- const el = connected[i]?.hostElement;
10665
- if (!el || el === selfHost)
10666
- continue;
10667
- const c = RectExtensions.fromElement(el).gravityCenter;
10668
- sumX += c.x;
10669
- sumY += c.y;
10670
- count++;
10829
+ handle({ sourceConnector, pointerPosition, }) {
10830
+ const result = this._getCanBeConnectedInputs(sourceConnector).map((x) => {
10831
+ return this._mediator.execute(new GetConnectorAndRectRequest(x));
10832
+ });
10833
+ setTimeout(() => {
10834
+ this._calculateConnectableSides(result, pointerPosition);
10835
+ });
10836
+ return result;
10837
+ }
10838
+ _getCanBeConnectedInputs(outputOrOutlet) {
10839
+ let targetConnectors = [];
10840
+ if (outputOrOutlet.hasConnectionLimits) {
10841
+ targetConnectors = this._targetConnectors.filter((x) => outputOrOutlet.canConnectTo(x));
10842
+ }
10843
+ else {
10844
+ targetConnectors = this._targetConnectors.filter((x) => x.canBeConnected);
10845
+ if (!outputOrOutlet.isSelfConnectable) {
10846
+ targetConnectors = this._filterSelfConnectable(targetConnectors, outputOrOutlet);
10671
10847
  }
10672
10848
  }
10673
- return { sumX, sumY, count };
10849
+ return targetConnectors;
10674
10850
  }
10675
- /**
10676
- * Converts allowed sides array to a compact bit mask.
10677
- * If not provided or empty -> all sides allowed.
10678
- */
10679
- _toSideMask(allowed) {
10680
- if (!allowed || allowed.length === 0)
10681
- return 15 /* SideMask.ALL */;
10682
- let mask = 0 /* SideMask.NONE */;
10683
- for (let i = 0; i < allowed.length; i++) {
10684
- switch (allowed[i]) {
10685
- case EFConnectableSide.LEFT:
10686
- mask |= 1 /* SideMask.LEFT */;
10687
- break;
10688
- case EFConnectableSide.RIGHT:
10689
- mask |= 2 /* SideMask.RIGHT */;
10690
- break;
10691
- case EFConnectableSide.TOP:
10692
- mask |= 4 /* SideMask.TOP */;
10693
- break;
10694
- case EFConnectableSide.BOTTOM:
10695
- mask |= 8 /* SideMask.BOTTOM */;
10696
- break;
10851
+ _filterSelfConnectable(targetConnectors, outputOrOutlet) {
10852
+ return targetConnectors.filter(({ fNodeId }) => outputOrOutlet.fNodeId !== fNodeId);
10853
+ }
10854
+ _calculateConnectableSides(connectors, pointerPosition) {
10855
+ connectors.forEach((x) => {
10856
+ if (isCalculateMode(x.fConnector.userFConnectableSide)) {
10857
+ x.fConnector.fConnectableSide = this._calculateByConnectedPositions(x.fConnector, pointerPosition);
10697
10858
  }
10698
- }
10699
- return mask || 15 /* SideMask.ALL */;
10859
+ });
10700
10860
  }
10701
- /**
10702
- * Determines final side using ideal side first; if disallowed, picks best fallback.
10703
- * Inputs are numbers to avoid object wrappers on hot path.
10704
- */
10705
- _determineSide(selfX, selfY, avgX, avgY, allowedMask) {
10706
- const dx = avgX - selfX;
10707
- const dy = avgY - selfY;
10708
- const ideal = this._pickIdealSide(dx, dy);
10709
- if (this._isAllowed(ideal, allowedMask)) {
10710
- return ideal;
10711
- }
10712
- return this._pickFallbackSide(dx, dy, allowedMask, ideal);
10861
+ /** Delegates to the connected-positions calculation execution. */
10862
+ _calculateByConnectedPositions(connector, pointerPosition) {
10863
+ return this._mediator.execute(new CalculateConnectableSideByConnectedPositionsRequest(connector, pointerPosition));
10713
10864
  }
10714
- /**
10715
- * Picks the "ideal" side based on vector (dx, dy) with hysteresis.
10716
- */
10717
- _pickIdealSide(dx, dy) {
10718
- const ax = dx < 0 ? -dx : dx;
10719
- const ay = dy < 0 ? -dy : dy;
10720
- if (ax - ay > SNAP_EPS) {
10721
- return dx < 0 ? EFConnectableSide.LEFT : EFConnectableSide.RIGHT;
10722
- }
10723
- if (ay - ax > SNAP_EPS) {
10724
- return dy < 0 ? EFConnectableSide.TOP : EFConnectableSide.BOTTOM;
10725
- }
10726
- return dy < 0 ? EFConnectableSide.TOP : EFConnectableSide.BOTTOM;
10865
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CalculateTargetConnectorsToConnect, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
10866
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CalculateTargetConnectorsToConnect });
10867
+ };
10868
+ CalculateTargetConnectorsToConnect = __decorate([
10869
+ FExecutionRegister(CalculateTargetConnectorsToConnectRequest)
10870
+ ], CalculateTargetConnectorsToConnect);
10871
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CalculateTargetConnectorsToConnect, decorators: [{
10872
+ type: Injectable
10873
+ }] });
10874
+
10875
+ class CalculateSourceConnectorsToConnectRequest {
10876
+ targetConnector;
10877
+ pointerPosition;
10878
+ static fToken = Symbol('CalculateSourceConnectorsToConnectRequest');
10879
+ constructor(targetConnector, pointerPosition) {
10880
+ this.targetConnector = targetConnector;
10881
+ this.pointerPosition = pointerPosition;
10727
10882
  }
10728
- /**
10729
- * Quick membership check via bit mask.
10730
- */
10731
- _isAllowed(side, mask) {
10732
- switch (side) {
10733
- case EFConnectableSide.LEFT:
10734
- return (mask & 1 /* SideMask.LEFT */) !== 0;
10735
- case EFConnectableSide.RIGHT:
10736
- return (mask & 2 /* SideMask.RIGHT */) !== 0;
10737
- case EFConnectableSide.TOP:
10738
- return (mask & 4 /* SideMask.TOP */) !== 0;
10739
- case EFConnectableSide.BOTTOM:
10740
- return (mask & 8 /* SideMask.BOTTOM */) !== 0;
10741
- default:
10742
- return true;
10743
- }
10883
+ }
10884
+
10885
+ /**
10886
+ * Execution that retrieves all source connectors that can be connected to a given target connector,
10887
+ * along with their rectangles.
10888
+ * Source - Output or Outlet connectors.
10889
+ */
10890
+ let CalculateSourceConnectorsToConnect = class CalculateSourceConnectorsToConnect {
10891
+ _mediator = inject(FMediator);
10892
+ _store = inject(FComponentsStore);
10893
+ get _sourceConnectors() {
10894
+ return this._store.fOutputs;
10744
10895
  }
10745
- /**
10746
- * Picks the best available side from allowed mask by maximizing directional score.
10747
- * No intermediate objects, constant-time operations.
10748
- */
10749
- _pickFallbackSide(dx, dy, allowedMask, ideal) {
10750
- let bestSide = ideal;
10751
- let bestScore = -Infinity;
10752
- if (allowedMask & 2 /* SideMask.RIGHT */) {
10753
- const s = dx;
10754
- if (s > bestScore) {
10755
- bestScore = s;
10756
- bestSide = EFConnectableSide.RIGHT;
10757
- }
10758
- }
10759
- if (allowedMask & 1 /* SideMask.LEFT */) {
10760
- const s = -dx;
10761
- if (s > bestScore) {
10762
- bestScore = s;
10763
- bestSide = EFConnectableSide.LEFT;
10764
- }
10765
- }
10766
- if (allowedMask & 8 /* SideMask.BOTTOM */) {
10767
- const s = dy;
10768
- if (s > bestScore) {
10769
- bestScore = s;
10770
- bestSide = EFConnectableSide.BOTTOM;
10896
+ handle({ targetConnector, pointerPosition, }) {
10897
+ const result = this._getConnectableSources(targetConnector).map((x) => {
10898
+ return this._mediator.execute(new GetConnectorAndRectRequest(x));
10899
+ });
10900
+ setTimeout(() => {
10901
+ this._calculateConnectableSides(result, pointerPosition);
10902
+ });
10903
+ return result;
10904
+ }
10905
+ _getConnectableSources(targetConnector) {
10906
+ return this._sourceConnectors.filter((x) => {
10907
+ let result = x.canBeConnected;
10908
+ if (result && x.hasConnectionLimits) {
10909
+ result = x.canConnectTo(targetConnector);
10771
10910
  }
10772
- }
10773
- if (allowedMask & 4 /* SideMask.TOP */) {
10774
- const s = -dy;
10775
- if (s > bestScore) {
10776
- bestScore = s;
10777
- bestSide = EFConnectableSide.TOP;
10911
+ return result;
10912
+ });
10913
+ }
10914
+ _calculateConnectableSides(connectors, pointerPosition) {
10915
+ connectors.forEach((x) => {
10916
+ if (isCalculateMode(x.fConnector.userFConnectableSide)) {
10917
+ x.fConnector.fConnectableSide = this._calculateByConnectedPositions(x.fConnector, pointerPosition);
10778
10918
  }
10779
- }
10780
- return bestSide;
10919
+ });
10781
10920
  }
10782
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CalculateConnectableSideByConnectedPositions, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
10783
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CalculateConnectableSideByConnectedPositions });
10921
+ /** Delegates to the connected-positions calculation execution. */
10922
+ _calculateByConnectedPositions(connector, pointerPosition) {
10923
+ return this._mediator.execute(new CalculateConnectableSideByConnectedPositionsRequest(connector, pointerPosition));
10924
+ }
10925
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CalculateSourceConnectorsToConnect, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
10926
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CalculateSourceConnectorsToConnect });
10784
10927
  };
10785
- CalculateConnectableSideByConnectedPositions = __decorate([
10786
- FExecutionRegister(CalculateConnectableSideByConnectedPositionsRequest)
10787
- ], CalculateConnectableSideByConnectedPositions);
10788
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CalculateConnectableSideByConnectedPositions, decorators: [{
10928
+ CalculateSourceConnectorsToConnect = __decorate([
10929
+ FExecutionRegister(CalculateSourceConnectorsToConnectRequest)
10930
+ ], CalculateSourceConnectorsToConnect);
10931
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CalculateSourceConnectorsToConnect, decorators: [{
10789
10932
  type: Injectable
10790
10933
  }] });
10791
10934
 
10792
- class CalculateNodeConnectorsConnectableSidesRequest {
10793
- node;
10794
- static fToken = Symbol('CalculateNodeConnectorsConnectableSidesRequest');
10795
- constructor(node) {
10796
- this.node = node;
10935
+ class MarkConnectableConnectorsRequest {
10936
+ connectors;
10937
+ static fToken = Symbol('MarkConnectableConnectorsRequest');
10938
+ constructor(connectors) {
10939
+ this.connectors = connectors;
10797
10940
  }
10798
10941
  }
10799
10942
 
10800
- /** Fast predicate: whether the user side is a calculate mode. */
10801
- function isCalculateMode(side) {
10802
- return (side === EFConnectableSide.CALCULATE ||
10803
- side === EFConnectableSide.CALCULATE_HORIZONTAL ||
10804
- side === EFConnectableSide.CALCULATE_VERTICAL);
10943
+ /**
10944
+ * Execution that marks connectors as connectable.
10945
+ */
10946
+ let MarkConnectableConnectors = class MarkConnectableConnectors {
10947
+ _store = inject(FComponentsStore);
10948
+ handle({ connectors }) {
10949
+ this._store.flowHost.classList.add(F_CSS_CLASS.DRAG_AND_DROP.CONNECTIONS_DRAGGING);
10950
+ connectors.forEach((x) => this._markConnector(x));
10951
+ }
10952
+ _markConnector({ hostElement }) {
10953
+ hostElement.classList.add(F_CSS_CLASS.CONNECTOR.CONNECTABLE);
10954
+ }
10955
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MarkConnectableConnectors, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
10956
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MarkConnectableConnectors });
10957
+ };
10958
+ MarkConnectableConnectors = __decorate([
10959
+ FExecutionRegister(MarkConnectableConnectorsRequest)
10960
+ ], MarkConnectableConnectors);
10961
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MarkConnectableConnectors, decorators: [{
10962
+ type: Injectable
10963
+ }] });
10964
+
10965
+ class RemoveInputFromStoreRequest {
10966
+ component;
10967
+ static fToken = Symbol('RemoveInputFromStoreRequest');
10968
+ constructor(component) {
10969
+ this.component = component;
10970
+ }
10805
10971
  }
10972
+
10806
10973
  /**
10807
- * Execution that calculates connectable sides for all connectors of a node.
10808
- *
10809
- * Performance goals:
10810
- * - Single-pass loops (no `forEach`).
10811
- * - Unique target recomputation (avoid repeated mediator calls for the same target).
10812
- * - Fast checks for "calculate" modes (bit mask instead of `includes`).
10974
+ * Execution that removes an inputConnector from the FComponentsStore.
10813
10975
  */
10814
- let CalculateNodeConnectorsConnectableSides = class CalculateNodeConnectorsConnectableSides {
10815
- _mediator = inject(FMediator);
10816
- /**
10817
- * Orchestrates side calculation for all connectors of the given node.
10818
- * Two-phase approach:
10819
- * 1) Update each connector's own side.
10820
- * 2) Collect unique `toConnector` with calculate modes and recompute once.
10821
- */
10822
- handle({ node }) {
10823
- const mediator = this._mediator;
10824
- const connectors = node.connectors;
10825
- const len = connectors.length;
10826
- for (let i = 0; i < len; i++) {
10827
- const connection = connectors[i];
10828
- connection.fConnectableSide = this._resolveSideForConnectorFast(mediator, connection);
10829
- }
10830
- const toRecalc = new Set();
10831
- for (let i = 0; i < len; i++) {
10832
- const source = connectors[i];
10833
- const outs = source.toConnector;
10834
- if (outs && outs.length) {
10835
- for (let j = 0, m = outs.length; j < m; j++) {
10836
- const target = outs[j];
10837
- const userSide = target.userFConnectableSide;
10838
- if (isCalculateMode(userSide)) {
10839
- toRecalc.add(target);
10840
- }
10841
- }
10842
- }
10843
- }
10844
- if (toRecalc.size > 0) {
10845
- toRecalc.forEach((target) => {
10846
- target.fConnectableSide = mediator.execute(new CalculateConnectableSideByConnectedPositionsRequest(target, userSideToTCalculateMode(target.userFConnectableSide)));
10847
- });
10848
- }
10976
+ let RemoveInputFromStore = class RemoveInputFromStore {
10977
+ _store = inject(FComponentsStore);
10978
+ handle({ component }) {
10979
+ this._store.removeComponent(this._store.fInputs, component);
10849
10980
  }
10850
- /**
10851
- * Fast resolver for a single connector.
10852
- * Uses switch and avoids array operations.
10853
- */
10854
- _resolveSideForConnectorFast(mediator, connector) {
10855
- const preference = connector.userFConnectableSide;
10856
- if (preference !== EFConnectableSide.AUTO && !isCalculateMode(preference)) {
10857
- return preference;
10858
- }
10859
- if (preference === EFConnectableSide.AUTO) {
10860
- return mediator.execute(new CalculateConnectableSideByInternalPositionRequest(connector));
10861
- }
10862
- return mediator.execute(new CalculateConnectableSideByConnectedPositionsRequest(connector, userSideToTCalculateMode(preference)));
10981
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoveInputFromStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
10982
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoveInputFromStore });
10983
+ };
10984
+ RemoveInputFromStore = __decorate([
10985
+ FExecutionRegister(RemoveInputFromStoreRequest)
10986
+ ], RemoveInputFromStore);
10987
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoveInputFromStore, decorators: [{
10988
+ type: Injectable
10989
+ }] });
10990
+
10991
+ class RemoveOutletFromStoreRequest {
10992
+ fComponent;
10993
+ static fToken = Symbol('RemoveOutletFromStoreRequest');
10994
+ constructor(fComponent) {
10995
+ this.fComponent = fComponent;
10996
+ }
10997
+ }
10998
+
10999
+ /**
11000
+ * Execution that removes an outlet connector from the FComponentsStore.
11001
+ */
11002
+ let RemoveOutletFromStoreExecution = class RemoveOutletFromStoreExecution {
11003
+ _store = inject(FComponentsStore);
11004
+ handle(request) {
11005
+ this._store.removeComponent(this._store.fOutlets, request.fComponent);
11006
+ }
11007
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoveOutletFromStoreExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
11008
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoveOutletFromStoreExecution });
11009
+ };
11010
+ RemoveOutletFromStoreExecution = __decorate([
11011
+ FExecutionRegister(RemoveOutletFromStoreRequest)
11012
+ ], RemoveOutletFromStoreExecution);
11013
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoveOutletFromStoreExecution, decorators: [{
11014
+ type: Injectable
11015
+ }] });
11016
+
11017
+ class RemoveOutputFromStoreRequest {
11018
+ fComponent;
11019
+ static fToken = Symbol('RemoveOutputFromStoreRequest');
11020
+ constructor(fComponent) {
11021
+ this.fComponent = fComponent;
11022
+ }
11023
+ }
11024
+
11025
+ /**
11026
+ * Execution that removes an outlet connector from the FComponentsStore.
11027
+ */
11028
+ let RemoveOutputFromStoreExecution = class RemoveOutputFromStoreExecution {
11029
+ _store = inject(FComponentsStore);
11030
+ handle(request) {
11031
+ this._store.removeComponent(this._store.fOutputs, request.fComponent);
10863
11032
  }
10864
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CalculateNodeConnectorsConnectableSides, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
10865
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CalculateNodeConnectorsConnectableSides });
11033
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoveOutputFromStoreExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
11034
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoveOutputFromStoreExecution });
10866
11035
  };
10867
- CalculateNodeConnectorsConnectableSides = __decorate([
10868
- FExecutionRegister(CalculateNodeConnectorsConnectableSidesRequest)
10869
- ], CalculateNodeConnectorsConnectableSides);
10870
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CalculateNodeConnectorsConnectableSides, decorators: [{
11036
+ RemoveOutputFromStoreExecution = __decorate([
11037
+ FExecutionRegister(RemoveOutputFromStoreRequest)
11038
+ ], RemoveOutputFromStoreExecution);
11039
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoveOutputFromStoreExecution, decorators: [{
10871
11040
  type: Injectable
10872
11041
  }] });
10873
- /**
10874
- * Utility: maps EFConnectableSide user value to TCalculateMode safely.
10875
- * If your enums are distinct, implement the exact mapping here.
10876
- */
10877
- function userSideToTCalculateMode(side) {
10878
- return side;
10879
- }
10880
11042
 
10881
- class CalculateNodesBoundingBoxRequest {
10882
- static fToken = Symbol('CalculateNodesBoundingBoxRequest');
11043
+ class UnmarkConnectableConnectorsRequest {
11044
+ connectors;
11045
+ static fToken = Symbol('UnmarkConnectableConnectorsRequest');
11046
+ constructor(connectors) {
11047
+ this.connectors = connectors;
11048
+ }
10883
11049
  }
10884
11050
 
10885
11051
  /**
10886
- * Execution that calculates the bounding box of all nodes in the FComponentsStore.
10887
- * It retrieves the rectangles of each node's host element and computes their union.
11052
+ * Execution that unmarks connectors as connectable.
10888
11053
  */
10889
- let CalculateNodesBoundingBox = class CalculateNodesBoundingBox {
11054
+ let UnmarkConnectableConnectors = class UnmarkConnectableConnectors {
10890
11055
  _store = inject(FComponentsStore);
10891
- handle(request) {
10892
- return RectExtensions.union(this._getNodesRects());
10893
- }
10894
- _getNodesRects() {
10895
- return this._store.fNodes.map((x) => this._getElementRect(x.hostElement));
11056
+ handle({ connectors }) {
11057
+ this._store.flowHost.classList.remove(F_CSS_CLASS.DRAG_AND_DROP.CONNECTIONS_DRAGGING);
11058
+ connectors.forEach((x) => this._unmarkConnector(x));
10896
11059
  }
10897
- _getElementRect(element) {
10898
- return RectExtensions.fromElement(element);
11060
+ _unmarkConnector({ hostElement }) {
11061
+ hostElement.classList.remove(F_CSS_CLASS.CONNECTOR.CONNECTABLE);
10899
11062
  }
10900
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CalculateNodesBoundingBox, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
10901
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CalculateNodesBoundingBox });
11063
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: UnmarkConnectableConnectors, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
11064
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: UnmarkConnectableConnectors });
10902
11065
  };
10903
- CalculateNodesBoundingBox = __decorate([
10904
- FExecutionRegister(CalculateNodesBoundingBoxRequest)
10905
- ], CalculateNodesBoundingBox);
10906
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CalculateNodesBoundingBox, decorators: [{
11066
+ UnmarkConnectableConnectors = __decorate([
11067
+ FExecutionRegister(UnmarkConnectableConnectorsRequest)
11068
+ ], UnmarkConnectableConnectors);
11069
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: UnmarkConnectableConnectors, decorators: [{
10907
11070
  type: Injectable
10908
11071
  }] });
10909
11072
 
10910
- class CalculateNodesBoundingBoxNormalizedPositionRequest {
10911
- fNodes;
10912
- static fToken = Symbol('CalculateNodesBoundingBoxNormalizedPositionRequest');
10913
- constructor(fNodes) {
10914
- this.fNodes = fNodes;
11073
+ /*
11074
+ * This file exports all the connector-related executions that can be used in the FFlow domain.
11075
+ */
11076
+ const F_CONNECTORS_FEATURES = [
11077
+ AddInputToStore,
11078
+ AddOutletToStore,
11079
+ AddOutputToStore,
11080
+ CalculateClosestConnector,
11081
+ FindConnectableConnectorUsingPriorityAndPositionExecution,
11082
+ CalculateSourceConnectorsToConnect,
11083
+ CalculateTargetConnectorsToConnect,
11084
+ GetConnectorAndRect,
11085
+ MarkConnectableConnectors,
11086
+ RemoveInputFromStore,
11087
+ RemoveOutletFromStoreExecution,
11088
+ RemoveOutputFromStoreExecution,
11089
+ UnmarkConnectableConnectors,
11090
+ ];
11091
+
11092
+ class AddFlowToStoreRequest {
11093
+ fComponent;
11094
+ static fToken = Symbol('AddFlowToStoreRequest');
11095
+ constructor(fComponent) {
11096
+ this.fComponent = fComponent;
10915
11097
  }
10916
11098
  }
10917
11099
 
10918
11100
  /**
10919
- * Execution that calculates the bounding box of all nodes in the FComponentsStore
10920
- * and returns their normalized positions.
10921
- * It retrieves the rectangles of each node's host element and computes their union.
11101
+ * Execution that adds a Flow to the FComponentsStore.
10922
11102
  */
10923
- let CalculateNodesBoundingBoxNormalizedPosition = class CalculateNodesBoundingBoxNormalizedPosition {
11103
+ let AddFlowToStoreExecution = class AddFlowToStoreExecution {
10924
11104
  _store = inject(FComponentsStore);
10925
11105
  handle(request) {
10926
- return RectExtensions.union(this._getNodesRects(request.fNodes || this._store.fNodes));
10927
- }
10928
- _getNodesRects(fNodes) {
10929
- return fNodes.map((x) => {
10930
- return this._getElementRect(x, RectExtensions.fromElement(x.hostElement));
10931
- });
10932
- }
10933
- _getElementRect(fNode, rect) {
10934
- return RectExtensions.initialize(fNode._position.x, fNode._position.y, rect.width, rect.height);
11106
+ this._store.fFlow = request.fComponent;
10935
11107
  }
10936
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CalculateNodesBoundingBoxNormalizedPosition, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
10937
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CalculateNodesBoundingBoxNormalizedPosition });
11108
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AddFlowToStoreExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
11109
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AddFlowToStoreExecution });
10938
11110
  };
10939
- CalculateNodesBoundingBoxNormalizedPosition = __decorate([
10940
- FExecutionRegister(CalculateNodesBoundingBoxNormalizedPositionRequest)
10941
- ], CalculateNodesBoundingBoxNormalizedPosition);
10942
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CalculateNodesBoundingBoxNormalizedPosition, decorators: [{
11111
+ AddFlowToStoreExecution = __decorate([
11112
+ FExecutionRegister(AddFlowToStoreRequest)
11113
+ ], AddFlowToStoreExecution);
11114
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AddFlowToStoreExecution, decorators: [{
10943
11115
  type: Injectable
10944
11116
  }] });
10945
11117
 
10946
- class CalculateOutputConnectionsRequest {
10947
- fNode;
10948
- static fToken = Symbol('CalculateOutputConnectionsRequest');
10949
- constructor(fNode) {
10950
- this.fNode = fNode;
10951
- }
11118
+ class GetFlowRequest {
11119
+ static fToken = Symbol('GetFlowRequest');
10952
11120
  }
10953
11121
 
10954
11122
  /**
10955
- * Execution that calculates output connections for a given FNode.
11123
+ * Execution that retrieves the current Flow from the FComponentsStore.
10956
11124
  */
10957
- let CalculateOutputConnections = class CalculateOutputConnections {
11125
+ let GetFlowExecution = class GetFlowExecution {
10958
11126
  _store = inject(FComponentsStore);
10959
11127
  handle(request) {
10960
- return this._calculateConnections(new Set(this._calculateConnectors(request.fNode)));
10961
- }
10962
- _calculateConnectors(fNode) {
10963
- return this._store.fOutputs.filter((x) => fNode.isContains(x.hostElement)).map((x) => x.fId());
10964
- }
10965
- _calculateConnections(ids) {
10966
- return this._store.fConnections.filter((x) => ids.has(x.fOutputId()));
11128
+ const result = this._store.fFlow;
11129
+ if (!result) {
11130
+ throw new Error(`Flow not found in store`);
11131
+ }
11132
+ return result;
10967
11133
  }
10968
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CalculateOutputConnections, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
10969
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CalculateOutputConnections });
11134
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetFlowExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
11135
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetFlowExecution });
10970
11136
  };
10971
- CalculateOutputConnections = __decorate([
10972
- FExecutionRegister(CalculateOutputConnectionsRequest)
10973
- ], CalculateOutputConnections);
10974
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CalculateOutputConnections, decorators: [{
11137
+ GetFlowExecution = __decorate([
11138
+ FExecutionRegister(GetFlowRequest)
11139
+ ], GetFlowExecution);
11140
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetFlowExecution, decorators: [{
10975
11141
  type: Injectable
10976
11142
  }] });
10977
11143
 
10978
- class FitToChildNodesAndGroupsRequest {
10979
- nodeOrGroup;
10980
- static fToken = Symbol('FitToChildNodesAndGroupsRequest');
10981
- constructor(nodeOrGroup) {
10982
- this.nodeOrGroup = nodeOrGroup;
10983
- }
10984
- }
10985
-
10986
- class GetNodePaddingRequest {
10987
- fNode;
10988
- rect;
10989
- static fToken = Symbol('GetNodePaddingRequest');
10990
- constructor(fNode, rect) {
10991
- this.fNode = fNode;
10992
- this.rect = rect;
10993
- }
11144
+ class GetFlowHostElementRequest {
11145
+ static fToken = Symbol('GetFlowHostElementRequest');
10994
11146
  }
10995
11147
 
10996
11148
  /**
10997
- * Execution that retrieves the padding data of a Node.
10998
- * If the Node does not include padding, it returns [0, 0, 0, 0].
11149
+ * Execution that retrieves the Flow host element from the FComponentsStore.
10999
11150
  */
11000
- let GetNodePadding = class GetNodePadding {
11001
- _browser = inject(BrowserService);
11002
- handle(request) {
11003
- return request.fNode.fIncludePadding() ? this.getPaddingData(request.fNode, request.rect) : [0, 0, 0, 0];
11004
- }
11005
- getPaddingData(node, rect) {
11006
- const style = this._browser.window.getComputedStyle(node.hostElement);
11007
- return [
11008
- this._browser.toPixels(style.paddingLeft, rect.width, rect.height, style.fontSize),
11009
- this._browser.toPixels(style.paddingTop, rect.width, rect.height, style.fontSize),
11010
- this._browser.toPixels(style.paddingRight, rect.width, rect.height, style.fontSize),
11011
- this._browser.toPixels(style.paddingBottom, rect.width, rect.height, style.fontSize),
11012
- ];
11151
+ let GetFlowHostElementExecution = class GetFlowHostElementExecution {
11152
+ _store = inject(FComponentsStore);
11153
+ handle() {
11154
+ return this._store.flowHost;
11013
11155
  }
11014
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetNodePadding, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
11015
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetNodePadding });
11156
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetFlowHostElementExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
11157
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetFlowHostElementExecution });
11016
11158
  };
11017
- GetNodePadding = __decorate([
11018
- FExecutionRegister(GetNodePaddingRequest)
11019
- ], GetNodePadding);
11020
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetNodePadding, decorators: [{
11159
+ GetFlowHostElementExecution = __decorate([
11160
+ FExecutionRegister(GetFlowHostElementRequest)
11161
+ ], GetFlowHostElementExecution);
11162
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetFlowHostElementExecution, decorators: [{
11021
11163
  type: Injectable
11022
11164
  }] });
11023
11165
 
11024
- let FitToChildNodesAndGroups = class FitToChildNodesAndGroups {
11025
- _mediator = inject(FMediator);
11166
+ class GetFlowStateConnectionsRequest {
11167
+ static fToken = Symbol('GetFlowStateConnectionsRequest');
11168
+ }
11169
+
11170
+ /**
11171
+ * Execution that retrieves the current Flow state connections from the FComponentsStore.
11172
+ */
11173
+ let GetFlowStateConnectionsExecution = class GetFlowStateConnectionsExecution {
11026
11174
  _store = inject(FComponentsStore);
11027
- get _nodes() {
11028
- return this._store.fNodes;
11029
- }
11030
- handle({ nodeOrGroup }) {
11031
- if (nodeOrGroup.fAutoSizeToFitChildren()) {
11032
- const directChildren = this._calculateDirectChildren(nodeOrGroup);
11033
- if (directChildren.length) {
11034
- const currentBounding = this._boundingRect(nodeOrGroup);
11035
- const childrenBounding = this._calculateChildrenBounding(directChildren, this._paddings(nodeOrGroup, currentBounding));
11036
- nodeOrGroup.updatePosition(childrenBounding);
11037
- nodeOrGroup.updateSize(childrenBounding);
11038
- nodeOrGroup.redraw();
11039
- }
11040
- }
11041
- const parent = nodeOrGroup.fParentId();
11042
- if (!parent) {
11043
- return;
11044
- }
11045
- const parentNode = this._nodes.find(x => x.fId() === parent);
11046
- if (!parentNode) {
11047
- return;
11048
- }
11049
- this._mediator.execute(new FitToChildNodesAndGroupsRequest(parentNode));
11050
- }
11051
- _calculateDirectChildren(nodeOrGroup) {
11052
- return this._nodes.filter(x => x.fParentId() === nodeOrGroup.fId());
11053
- }
11054
- _unionRect(nodeOrGroups) {
11055
- return RectExtensions.union(nodeOrGroups.map((x) => this._boundingRect(x))) || RectExtensions.initialize();
11056
- }
11057
- _boundingRect(nodeOrGroup) {
11058
- return this._mediator.execute(new GetNormalizedElementRectRequest(nodeOrGroup.hostElement));
11059
- }
11060
- _paddings(nodeOrGroup, rect) {
11061
- return this._mediator.execute(new GetNodePaddingRequest(nodeOrGroup, rect));
11175
+ handle(_request) {
11176
+ return this._store.fConnections.map(this._mapToConnectionState);
11062
11177
  }
11063
- _calculateChildrenBounding(directChildren, [top, right, bottom, left]) {
11064
- let childrenBounding = this._unionRect(directChildren);
11065
- childrenBounding = RectExtensions.initialize(childrenBounding.x - left, childrenBounding.y - top, childrenBounding.width + left + right, childrenBounding.height + top + bottom);
11066
- return childrenBounding;
11178
+ _mapToConnectionState(x) {
11179
+ return {
11180
+ id: x.fId(),
11181
+ fOutputId: x.fOutputId(),
11182
+ fInputId: x.fInputId(),
11183
+ fType: x.fType,
11184
+ fBehavior: x.fBehavior,
11185
+ isSelected: x.isSelected(),
11186
+ };
11067
11187
  }
11068
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FitToChildNodesAndGroups, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
11069
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FitToChildNodesAndGroups });
11188
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetFlowStateConnectionsExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
11189
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetFlowStateConnectionsExecution });
11070
11190
  };
11071
- FitToChildNodesAndGroups = __decorate([
11072
- FExecutionRegister(FitToChildNodesAndGroupsRequest)
11073
- ], FitToChildNodesAndGroups);
11074
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FitToChildNodesAndGroups, decorators: [{
11191
+ GetFlowStateConnectionsExecution = __decorate([
11192
+ FExecutionRegister(GetFlowStateConnectionsRequest)
11193
+ ], GetFlowStateConnectionsExecution);
11194
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetFlowStateConnectionsExecution, decorators: [{
11075
11195
  type: Injectable
11076
11196
  }] });
11077
-
11078
- class GetChildNodeIdsRequest {
11079
- id;
11080
- static fToken = Symbol('GetChildNodeIdsRequest');
11081
- constructor(id) {
11082
- this.id = id;
11197
+
11198
+ class GetFlowStateNodesRequest {
11199
+ type;
11200
+ static fToken = Symbol('GetFlowStateNodesRequest');
11201
+ constructor(type) {
11202
+ this.type = type;
11083
11203
  }
11084
11204
  }
11085
11205
 
11086
11206
  /**
11087
- * Execution that retrieves all child nodes of a given node in the Flow.
11207
+ * Execution that retrieves the state of Flow nodes, including their position, size, inputs, outputs, and selection status.
11088
11208
  */
11089
- let GetChildNodeIds = class GetChildNodeIds {
11209
+ let GetFlowStateNodesExecution = class GetFlowStateNodesExecution {
11090
11210
  _store = inject(FComponentsStore);
11091
- get _allNodesAndGroups() {
11092
- return this._store.fNodes;
11093
- }
11094
11211
  handle(request) {
11095
- if (!request.id) {
11096
- return [];
11097
- }
11098
- const visited = new Set();
11099
- const result = [];
11100
- this._collectDescendants(request.id, result, visited);
11101
- return result;
11212
+ return this._store.fNodes
11213
+ .filter((x) => x instanceof request.type)
11214
+ .map((x) => {
11215
+ return {
11216
+ id: x.fId(),
11217
+ parent: x.fParentId(),
11218
+ position: x._position,
11219
+ size: x._size,
11220
+ rotate: x._rotate,
11221
+ fOutputs: this._getOutputs(x.hostElement),
11222
+ fInputs: this._getInputs(x.hostElement),
11223
+ isSelected: x.isSelected(),
11224
+ };
11225
+ });
11102
11226
  }
11103
- _collectDescendants(nodeId, result, visited) {
11104
- if (visited.has(nodeId)) {
11105
- throw new Error(`Circular reference detected in the node hierarchy. Node id: ${nodeId}`);
11106
- }
11107
- visited.add(nodeId);
11108
- const children = this._allNodesAndGroups.filter(n => n.fParentId() === nodeId).map((x) => x.fId());
11109
- result.push(...children);
11110
- for (const id of children) {
11111
- this._collectDescendants(id, result, visited);
11112
- }
11227
+ _getOutputs(hostElement) {
11228
+ return this._store.fOutputs
11229
+ .filter((x) => hostElement.contains(x.hostElement))
11230
+ .map((x) => {
11231
+ return {
11232
+ id: x.fId(),
11233
+ fConnectableSide: x.fConnectableSide,
11234
+ };
11235
+ });
11113
11236
  }
11114
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetChildNodeIds, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
11115
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetChildNodeIds });
11237
+ _getInputs(hostElement) {
11238
+ return this._store.fInputs
11239
+ .filter((x) => hostElement.contains(x.hostElement))
11240
+ .map((x) => {
11241
+ return {
11242
+ id: x.fId(),
11243
+ fConnectableSide: x.fConnectableSide,
11244
+ };
11245
+ });
11246
+ }
11247
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetFlowStateNodesExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
11248
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetFlowStateNodesExecution });
11116
11249
  };
11117
- GetChildNodeIds = __decorate([
11118
- FExecutionRegister(GetChildNodeIdsRequest)
11119
- ], GetChildNodeIds);
11120
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetChildNodeIds, decorators: [{
11250
+ GetFlowStateNodesExecution = __decorate([
11251
+ FExecutionRegister(GetFlowStateNodesRequest)
11252
+ ], GetFlowStateNodesExecution);
11253
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetFlowStateNodesExecution, decorators: [{
11121
11254
  type: Injectable
11122
11255
  }] });
11123
11256
 
11124
- class GetNodesRequest {
11125
- static fToken = Symbol('GetNodesRequest');
11257
+ class GetFlowStateRequest {
11258
+ static fToken = Symbol('GetFlowStateRequest');
11126
11259
  }
11127
11260
 
11128
11261
  /**
11129
- * Execution that retrieves all nodes from the FComponentsStore.
11262
+ * Execution that retrieves the current state of the Flow, including its position, scale, nodes, groups, and connections.
11130
11263
  */
11131
- let GetNodes = class GetNodes {
11264
+ let GetFlowStateExecution = class GetFlowStateExecution {
11265
+ _mediator = inject(FMediator);
11132
11266
  _store = inject(FComponentsStore);
11133
- handle(request) {
11134
- return this._store.fNodes;
11267
+ handle(payload) {
11268
+ return {
11269
+ position: this._getCanvasPosition(this._store.fCanvas.transform),
11270
+ scale: this._store.fCanvas.transform.scale,
11271
+ nodes: this._mediator.execute(new GetFlowStateNodesRequest(FNodeDirective)),
11272
+ groups: this._mediator.execute(new GetFlowStateNodesRequest(FGroupDirective)),
11273
+ connections: this._mediator.execute(new GetFlowStateConnectionsRequest()),
11274
+ };
11275
+ }
11276
+ _getCanvasPosition(transform) {
11277
+ return PointExtensions.sum(transform.position, transform.scaledPosition);
11135
11278
  }
11136
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetNodes, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
11137
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetNodes });
11279
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetFlowStateExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
11280
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetFlowStateExecution });
11138
11281
  };
11139
- GetNodes = __decorate([
11140
- FExecutionRegister(GetNodesRequest)
11141
- ], GetNodes);
11142
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetNodes, decorators: [{
11282
+ GetFlowStateExecution = __decorate([
11283
+ FExecutionRegister(GetFlowStateRequest)
11284
+ ], GetFlowStateExecution);
11285
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetFlowStateExecution, decorators: [{
11143
11286
  type: Injectable
11144
11287
  }] });
11145
11288
 
11146
- class GetParentNodesRequest {
11147
- fNode;
11148
- static fToken = Symbol('GetParentNodesRequest');
11149
- constructor(fNode) {
11150
- this.fNode = fNode;
11151
- }
11289
+ /**
11290
+ * Providers for retrieving the current Flow state, including nodes, groups, and connections.
11291
+ */
11292
+ const GET_FLOW_STATE_PROVIDERS = [
11293
+ GetFlowStateExecution,
11294
+ GetFlowStateNodesExecution,
11295
+ GetFlowStateConnectionsExecution,
11296
+ ];
11297
+
11298
+ class RemoveFlowFromStoreRequest {
11299
+ static fToken = Symbol('RemoveFlowFromStoreRequest');
11152
11300
  }
11153
11301
 
11154
11302
  /**
11155
- * Execution that retrieves all parent nodes of a given node from the FComponentsStore.
11303
+ * Execution that removes a Flow from the FComponentsStore.
11156
11304
  */
11157
- let GetParentNodes = class GetParentNodes {
11305
+ let RemoveFlowFromStoreExecution = class RemoveFlowFromStoreExecution {
11158
11306
  _store = inject(FComponentsStore);
11159
11307
  handle(request) {
11160
- return this._getParentNodes(request.fNode, new Set(), []);
11161
- }
11162
- _getParentNodes(fNode, visited, result) {
11163
- if (visited.has(fNode.fId())) {
11164
- throw new Error('Circular reference detected in the node hierarchy. Node id: ' + fNode.fId());
11165
- }
11166
- visited.add(fNode.fId());
11167
- const parent = this._store.fNodes.find((x) => x.fId() === fNode.fParentId());
11168
- if (!parent) {
11169
- return result;
11170
- }
11171
- result.push(parent);
11172
- return this._getParentNodes(parent, visited, result);
11308
+ this._store.fFlow = undefined;
11173
11309
  }
11174
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetParentNodes, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
11175
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetParentNodes });
11310
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoveFlowFromStoreExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
11311
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoveFlowFromStoreExecution });
11176
11312
  };
11177
- GetParentNodes = __decorate([
11178
- FExecutionRegister(GetParentNodesRequest)
11179
- ], GetParentNodes);
11180
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetParentNodes, decorators: [{
11313
+ RemoveFlowFromStoreExecution = __decorate([
11314
+ FExecutionRegister(RemoveFlowFromStoreRequest)
11315
+ ], RemoveFlowFromStoreExecution);
11316
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoveFlowFromStoreExecution, decorators: [{
11181
11317
  type: Injectable
11182
11318
  }] });
11183
11319
 
11184
- class UpdateNodeWhenStateOrSizeChangedRequest {
11185
- nodeOrGroup;
11186
- destroyRef;
11187
- static fToken = Symbol('UpdateNodeWhenStateOrSizeChangedRequest');
11188
- constructor(nodeOrGroup, destroyRef) {
11189
- this.nodeOrGroup = nodeOrGroup;
11190
- this.destroyRef = destroyRef;
11320
+ /**
11321
+ * Providers for managing the Flow in the FComponentsStore.
11322
+ * This includes adding, retrieving, and removing the Flow,
11323
+ * as well as getting the Flow host element and its state.
11324
+ */
11325
+ const F_FLOW_FEATURES = [
11326
+ AddFlowToStoreExecution,
11327
+ GetFlowExecution,
11328
+ GetFlowHostElementExecution,
11329
+ ...GET_FLOW_STATE_PROVIDERS,
11330
+ RemoveFlowFromStoreExecution,
11331
+ ];
11332
+
11333
+ class AddLineAlignmentToStoreRequest {
11334
+ fComponent;
11335
+ static fToken = Symbol('AddLineAlignmentToStoreRequest');
11336
+ constructor(fComponent) {
11337
+ this.fComponent = fComponent;
11191
11338
  }
11192
11339
  }
11193
11340
 
11194
11341
  /**
11195
- * Execution that updates a node's connectors when its state or size changes.
11342
+ * Execution that adds a line alignment to the FComponentsStore.
11196
11343
  */
11197
- let UpdateNodeWhenStateOrSizeChanged = class UpdateNodeWhenStateOrSizeChanged {
11198
- _mediator = inject(FMediator);
11199
- /**
11200
- * Handles the request to update the node's connectors based on state or size changes.
11201
- * It listens for resize events and recalculates the connectable sides of the connectors.
11202
- * @param request
11203
- */
11204
- handle({ nodeOrGroup, destroyRef }) {
11205
- const { hostElement, stateChanges } = nodeOrGroup;
11206
- new FChannelHub(new FResizeChannel(hostElement), stateChanges)
11207
- .pipe(notifyOnStart(), debounceTime(10))
11208
- .listen(destroyRef, () => {
11209
- this._mediator.execute(new NotifyDataChangedRequest());
11210
- if (!this._isDragging()) {
11211
- this._mediator.execute(new CalculateNodeConnectorsConnectableSidesRequest(nodeOrGroup));
11212
- this._mediator.execute(new FitToChildNodesAndGroupsRequest(nodeOrGroup));
11213
- }
11214
- });
11215
- }
11216
- _isDragging() {
11217
- return this._mediator.execute(new IsDragStartedRequest());
11344
+ let AddLineAlignmentToStoreExecution = class AddLineAlignmentToStoreExecution {
11345
+ _store = inject(FComponentsStore);
11346
+ handle(request) {
11347
+ this._store.fLineAlignment = request.fComponent;
11218
11348
  }
11219
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: UpdateNodeWhenStateOrSizeChanged, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
11220
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: UpdateNodeWhenStateOrSizeChanged });
11349
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AddLineAlignmentToStoreExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
11350
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AddLineAlignmentToStoreExecution });
11221
11351
  };
11222
- UpdateNodeWhenStateOrSizeChanged = __decorate([
11223
- FExecutionRegister(UpdateNodeWhenStateOrSizeChangedRequest)
11224
- ], UpdateNodeWhenStateOrSizeChanged);
11225
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: UpdateNodeWhenStateOrSizeChanged, decorators: [{
11352
+ AddLineAlignmentToStoreExecution = __decorate([
11353
+ FExecutionRegister(AddLineAlignmentToStoreRequest)
11354
+ ], AddLineAlignmentToStoreExecution);
11355
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AddLineAlignmentToStoreExecution, decorators: [{
11226
11356
  type: Injectable
11227
11357
  }] });
11228
11358
 
11229
- class RemoveNodeFromStoreRequest {
11230
- fComponent;
11231
- static fToken = Symbol('RemoveNodeFromStoreRequest');
11232
- constructor(fComponent) {
11233
- this.fComponent = fComponent;
11234
- }
11359
+ class RemoveLineAlignmentFromStoreRequest {
11360
+ static fToken = Symbol('RemoveLineAlignmentFromStoreRequest');
11235
11361
  }
11236
11362
 
11237
11363
  /**
11238
- * Execution that removes a node from the FComponentsStore.
11364
+ * Execution that removes a line alignment from the FComponentsStore.
11239
11365
  */
11240
- let RemoveNodeFromStore = class RemoveNodeFromStore {
11366
+ let RemoveLineAlignmentFromStoreExecution = class RemoveLineAlignmentFromStoreExecution {
11241
11367
  _store = inject(FComponentsStore);
11242
11368
  handle(request) {
11243
- this._store.removeComponent(this._store.fNodes, request.fComponent);
11369
+ this._store.fLineAlignment = undefined;
11244
11370
  }
11245
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoveNodeFromStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
11246
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoveNodeFromStore });
11371
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoveLineAlignmentFromStoreExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
11372
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoveLineAlignmentFromStoreExecution });
11247
11373
  };
11248
- RemoveNodeFromStore = __decorate([
11249
- FExecutionRegister(RemoveNodeFromStoreRequest)
11250
- ], RemoveNodeFromStore);
11251
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoveNodeFromStore, decorators: [{
11374
+ RemoveLineAlignmentFromStoreExecution = __decorate([
11375
+ FExecutionRegister(RemoveLineAlignmentFromStoreRequest)
11376
+ ], RemoveLineAlignmentFromStoreExecution);
11377
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoveLineAlignmentFromStoreExecution, decorators: [{
11252
11378
  type: Injectable
11253
11379
  }] });
11254
11380
 
11255
11381
  /**
11256
- * This file exports all the node-related executions that can be used in the F-Flow domain.
11382
+ * Collection of all FLineAlignment feature executions.
11383
+ * These executions handle the addition and removal of line alignments
11384
+ * in the FComponentsStore.
11257
11385
  */
11258
- const F_NODE_FEATURES = [
11259
- AddNodeToStore,
11260
- CalculateConnectableSideByConnectedPositions,
11261
- CalculateConnectableSideByInternalPosition,
11262
- CalculateInputConnections,
11263
- CalculateNodeConnectorsConnectableSides,
11264
- CalculateNodesBoundingBox,
11265
- CalculateNodesBoundingBoxNormalizedPosition,
11266
- CalculateOutputConnections,
11267
- FitToChildNodesAndGroups,
11268
- GetChildNodeIds,
11269
- GetNodePadding,
11270
- GetNodes,
11271
- GetParentNodes,
11272
- UpdateNodeWhenStateOrSizeChanged,
11273
- RemoveNodeFromStore,
11386
+ const F_LINE_ALIGNMENT_FEATURES = [
11387
+ AddLineAlignmentToStoreExecution,
11388
+ RemoveLineAlignmentFromStoreExecution,
11274
11389
  ];
11275
11390
 
11276
11391
  class AddZoomToStoreRequest {
@@ -11585,13 +11700,15 @@ function createSVGElement(tag, fBrowser) {
11585
11700
  function isValidEventTrigger(event, fTrigger) {
11586
11701
  return fTrigger(event);
11587
11702
  }
11588
- function defaultEventTrigger(event) {
11703
+ function defaultEventTrigger(_event) {
11589
11704
  return true;
11590
11705
  }
11591
11706
 
11592
11707
  function isMobile() {
11593
- // @ts-ignore
11594
- return /android|iPad|iPhone|iPod/i.test(navigator.userAgent || navigator.vendor || window['opera']);
11708
+ return /android|iPad|iPhone|iPod/i.test(
11709
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
11710
+ // @ts-expect-error
11711
+ navigator.userAgent || navigator.vendor || window['opera']);
11595
11712
  }
11596
11713
 
11597
11714
  function Deprecated(newMethodName, removalVersion = '18.0.0') {
@@ -12522,5 +12639,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
12522
12639
  * Generated bundle index. Do not edit.
12523
12640
  */
12524
12641
 
12525
- export { AddBackgroundToStoreExecution, AddBackgroundToStoreRequest, AddCanvasToStoreExecution, AddCanvasToStoreRequest, AddConnectionForCreateToStoreExecution, AddConnectionForCreateToStoreRequest, AddConnectionMarkerToStoreExecution, AddConnectionMarkerToStoreRequest, AddConnectionToStoreExecution, AddConnectionToStoreRequest, AddDndToStoreExecution, AddDndToStoreRequest, AddFlowToStoreExecution, AddFlowToStoreRequest, AddInputToStore, AddInputToStoreRequest, AddLineAlignmentToStoreExecution, AddLineAlignmentToStoreRequest, AddNodeToStore, AddNodeToStoreRequest, AddOutletToStore, AddOutletToStoreRequest, AddOutputToStore, AddOutputToStoreRequest, AddPatternToBackgroundExecution, AddPatternToBackgroundRequest, AddSnapConnectionToStoreExecution, AddSnapConnectionToStoreRequest, AddZoomToStoreExecution, AddZoomToStoreRequest, ApplyChildResizeConstraints, ApplyChildResizeConstraintsRequest, ApplyParentResizeConstraints, ApplyParentResizeConstraintsRequest, BaseConnectionDragHandler, BuildDragHierarchy, BuildDragHierarchyRequest, BuildDragHierarchyResponse, CALCULATE_MODES, CANVAS_PROVIDERS, COMMON_PROVIDERS, CONNECTIONS_PROVIDERS, CONNECTION_GRADIENT, CONNECTION_PATH, CONNECTION_TEXT, CREATE_MOVE_NODE_DRAG_MODEL_FROM_SELECTION_PROVIDERS, CalculateCenterBetweenPointsHandler, CalculateCenterBetweenPointsRequest, CalculateChangedRectFromDifference, CalculateChangedRectFromDifferenceRequest, CalculateClosestConnector, CalculateClosestConnectorRequest, CalculateConnectableSideByConnectedPositions, CalculateConnectableSideByConnectedPositionsRequest, CalculateConnectableSideByInternalPosition, CalculateConnectableSideByInternalPositionRequest, CalculateConnectionCenterHandler, CalculateConnectionCenterRequest, CalculateConnectionLineByBehavior, CalculateConnectionLineByBehaviorRequest, CalculateDirectChildrenUnionRect, CalculateDirectChildrenUnionRectRequest, CalculateDragLimits, CalculateDragLimitsRequest, CalculateFlowPointFromMinimapPointExecution, CalculateFlowPointFromMinimapPointRequest, CalculateInputConnections, CalculateInputConnectionsRequest, CalculateNodeConnectorsConnectableSides, CalculateNodeConnectorsConnectableSidesRequest, CalculateNodesBoundingBox, CalculateNodesBoundingBoxNormalizedPosition, CalculateNodesBoundingBoxNormalizedPositionRequest, CalculateNodesBoundingBoxRequest, CalculateOutputConnections, CalculateOutputConnectionsRequest, CalculateResizeLimits, CalculateResizeLimitsRequest, CenterGroupOrNodeExecution, CenterGroupOrNodeRequest, ClearSelectionExecution, ClearSelectionRequest, ConnectionContentLayoutEngine, CreateConnectionMarkersExecution, CreateConnectionMarkersRequest, CreateDragModelFromSelection, CreateDragModelFromSelectionRequest, CreateInputConnectionHandlerAndSetToNodeHandler, CreateInputConnectionHandlerAndSetToNodeHandlerRequest, CreateOutputConnectionHandlerAndSetToNodeHandler, CreateOutputConnectionHandlerAndSetToNodeHandlerRequest, CreateSnapLines, CreateSnapLinesRequest, CreateSummaryDragHandler, CreateSummaryDragHandlerRequest, DRAG_AND_DROP_COMMON_PROVIDERS, Deprecated, DragAndDropBase, DragConstraintPipeline, DropToGroupFinalize, DropToGroupFinalizeRequest, DropToGroupPreparation, DropToGroupPreparationRequest, EFConnectableSide, EFConnectionBehavior, EFConnectionType, EFMarkerType, EFResizeHandleType, EFZoomDirection, EmitSelectionChangeEventExecution, EmitSelectionChangeEventRequest, EndDragSequenceExecution, EndDragSequenceRequest, EventExtensions, ExternalRectConstraint, FBackgroundBase, FBackgroundComponent, FBezierPathBuilder, FCanvasBase, FCanvasChangeEvent, FCanvasComponent, FCanvasDragHandler, FCanvasMoveFinalizeExecution, FCanvasMoveFinalizeRequest, FCanvasMovePreparationExecution, FCanvasMovePreparationRequest, FChannel, FChannelHub, FCirclePatternComponent, FComponentsStore, FConnectionBase, FConnectionCenterDirective, FConnectionComponent, FConnectionContent, FConnectionDragHandleEndComponent, FConnectionDragHandleStartComponent, FConnectionFactory, FConnectionForCreateComponent, FConnectionGradientComponent, FConnectionPathComponent, FConnectionSelectionComponent, FConnectionTextComponent, FConnectionTextPathDirective, FConnectorBase, FCreateConnectionDragHandler, FCreateConnectionDragHandlerPreparationExecution, FCreateConnectionDragHandlerPreparationRequest, FCreateConnectionEvent, FCreateConnectionFinalizeExecution, FCreateConnectionFinalizeRequest, FCreateConnectionFromOutletPreparationExecution, FCreateConnectionFromOutletPreparationRequest, FCreateConnectionFromOutputPreparationExecution, FCreateConnectionFromOutputPreparationRequest, FCreateConnectionPreparationExecution, FCreateConnectionPreparationRequest, FCreateNodeEvent, FDragBlockerDirective, FDragHandleDirective, FDragHandlerResult, FDragStartedEvent, FDraggableBase, FDraggableDataContext, FDraggableDirective, FDropToGroupEvent, FExternalItemBase, FExternalItemCreatePlaceholderExecution, FExternalItemCreatePlaceholderRequest, FExternalItemCreatePreviewExecution, FExternalItemCreatePreviewRequest, FExternalItemDirective, FExternalItemDragHandler, FExternalItemFinalizeExecution, FExternalItemFinalizeRequest, FExternalItemPlaceholderDirective, FExternalItemPreparationExecution, FExternalItemPreparationRequest, FExternalItemPreviewDirective, FExternalItemService, FFlowBase, FFlowComponent, FFlowModule, FGroupDirective, FLineAlignmentBase, FLineAlignmentComponent, FMarkerBase, FMarkerDirective, FMinimapCanvasDirective, FMinimapComponent, FMinimapData, FMinimapDragHandler, FMinimapFlowDirective, FMinimapViewDirective, FMoveNodesEvent, FNodeBase, FNodeDirective, FNodeDropToGroupDragHandler, FNodeInputBase, FNodeInputDirective, FNodeIntersectedWithConnections, FNodeMoveFinalizeExecution, FNodeMoveFinalizeRequest, FNodeMovePreparationExecution, FNodeMovePreparationRequest, FNodeOutletBase, FNodeOutletDirective, FNodeOutputBase, FNodeOutputDirective, FNodeRotateDragHandler, FNodeRotateFinalizeExecution, FNodeRotateFinalizeRequest, FNodeRotatePreparationExecution, FNodeRotatePreparationRequest, FReassignConnectionDragHandler, FReassignConnectionEvent, FReassignConnectionFinalizeExecution, FReassignConnectionFinalizeRequest, FReassignConnectionPreparationExecution, FReassignConnectionPreparationRequest, FReassignSourceDragHandler, FReassignTargetDragHandler, FRectPatternComponent, FResizeChannel, FResizeHandleDirective, FRotateHandleDirective, FSegmentPathBuilder, FSelectionAreaBase, FSelectionAreaComponent, FSelectionChangeEvent, FSingleSelectExecution, FSingleSelectRequest, FSnapConnectionComponent, FSourceConnectorBase, FStraightPathBuilder, FZoomBase, FZoomDirective, F_AFTER_MAIN_PLUGIN, F_BACKGROUND, F_BACKGROUND_FEATURES, F_BACKGROUND_PATTERN, F_BACKGROUND_PROVIDERS, F_BEFORE_MAIN_PLUGIN, F_CANVAS, F_CANVAS_FEATURES, F_CANVAS_PROVIDERS, F_CONNECTION_BUILDERS, F_CONNECTION_FEATURES, F_CONNECTION_IDENTIFIERS, F_CONNECTION_PROVIDERS, F_CONNECTORS_FEATURES, F_CONNECTORS_PROVIDERS, F_CSS_CLASS, F_DRAGGABLE_FEATURES, F_DRAGGABLE_PROVIDERS, F_EXTERNAL_ITEM, F_EXTERNAL_ITEM_DRAG_AND_DROP_PROVIDERS, F_EXTERNAL_ITEM_PROVIDERS, F_FLOW, F_FLOW_FEATURES, F_FLOW_PROVIDERS, F_LINE_ALIGNMENT, F_LINE_ALIGNMENT_FEATURES, F_LINE_ALIGNMENT_PROVIDERS, F_MARKER, F_MINIMAP_DRAG_AND_DROP_PROVIDERS, F_MINIMAP_PROVIDERS, F_NODE, F_NODE_FEATURES, F_NODE_INPUT, F_NODE_OUTLET, F_NODE_OUTPUT, F_NODE_PROVIDERS, F_SELECTED_CLASS, F_SELECTION_AREA_DRAG_AND_DROP_PROVIDERS, F_SELECTION_AREA_PROVIDERS, F_SELECTION_FEATURES, F_STORAGE_PROVIDERS, F_ZOOM, F_ZOOM_FEATURES, F_ZOOM_PROVIDERS, F_ZOOM_TAG, FindConnectableConnectorUsingPriorityAndPositionExecution, FindConnectableConnectorUsingPriorityAndPositionRequest, FitToChildNodesAndGroups, FitToChildNodesAndGroupsRequest, FitToFlowExecution, FitToFlowRequest, GET_FLOW_STATE_PROVIDERS, GetAllCanBeConnectedInputsAndRectsExecution, GetAllCanBeConnectedInputsAndRectsRequest, GetAllCanBeConnectedSourceConnectorsAndRectsExecution, GetAllCanBeConnectedSourceConnectorsAndRectsRequest, GetCanBeSelectedItemsExecution, GetCanBeSelectedItemsRequest, GetCanvasExecution, GetCanvasRequest, GetChildNodeIds, GetChildNodeIdsRequest, GetConnectorAndRect, GetConnectorAndRectRequest, GetCurrentSelectionExecution, GetCurrentSelectionRequest, GetDeepChildrenNodesAndGroupsExecution, GetDeepChildrenNodesAndGroupsRequest, GetElementRoundedRectExecution, GetElementRoundedRectRequest, GetFirstConnectableOutputExecution, GetFirstConnectableOutputRequest, GetFlowExecution, GetFlowHostElementExecution, GetFlowHostElementRequest, GetFlowRequest, GetFlowStateConnectionsExecution, GetFlowStateConnectionsRequest, GetFlowStateExecution, GetFlowStateNodesExecution, GetFlowStateNodesRequest, GetFlowStateRequest, GetNodeBoundingIncludePaddings, GetNodeBoundingIncludePaddingsRequest, GetNodeBoundingIncludePaddingsResponse, GetNodePadding, GetNodePaddingRequest, GetNodes, GetNodesRequest, GetNormalizedConnectorRectExecution, GetNormalizedConnectorRectRequest, GetNormalizedElementRectExecution, GetNormalizedElementRectRequest, GetNormalizedParentNodeRectExecution, GetNormalizedParentNodeRectRequest, GetNormalizedPointExecution, GetNormalizedPointRequest, GetParentNodes, GetParentNodesRequest, IMouseEvent, IPointerEvent, IPointerUpEvent, ITouchDownEvent, ITouchMoveEvent, InitializeDragSequenceExecution, InitializeDragSequenceRequest, InputCanvasPositionExecution, InputCanvasPositionRequest, InputCanvasScaleExecution, InputCanvasScaleRequest, IsArrayHasParentNodeExecution, IsArrayHasParentNodeRequest, IsConnectionUnderNodeExecution, IsConnectionUnderNodeRequest, IsDragStarted, IsDragStartedRequest, ListenCountChangesExecution, ListenCountChangesRequest, ListenDataChangesExecution, ListenDataChangesRequest, ListenTransformChangesExecution, ListenTransformChangesRequest, LogExecutionTime, MINIMAP_DRAG_FINALIZE_PROVIDERS, MINIMAP_DRAG_PREPARATION_PROVIDERS, MOUSE_EVENT_IGNORE_TIME, MarkConnectableConnectors, MarkConnectableConnectorsRequest, MinimapCalculateSvgScaleAndViewBoxExecution, MinimapCalculateSvgScaleAndViewBoxRequest, MinimapCalculateViewBoxExecution, MinimapCalculateViewBoxRequest, MinimapDragFinalizeExecution, MinimapDragFinalizeRequest, MinimapDragPreparationExecution, MinimapDragPreparationRequest, MinimapDrawNodesExecution, MinimapDrawNodesRequest, MoveDragHandler, MoveFrontElementsBeforeTargetElementExecution, MoveFrontElementsBeforeTargetElementRequest, MoveSummaryDragHandler, NODE_DROP_TO_GROUP_PROVIDERS, NODE_PROVIDERS, NODE_RESIZE_PROVIDERS, NODE_ROTATE_PROVIDERS, NodeResizeDragHandler, NodeResizeFinalize, NodeResizeFinalizeRequest, NodeResizePreparation, NodeResizePreparationRequest, NotifyDataChangedExecution, NotifyDataChangedRequest, NotifyTransformChangedExecution, NotifyTransformChangedRequest, OnPointerMoveExecution, OnPointerMoveRequest, Polyline, PolylineContentAlign, PolylineContentPlace, PolylineSampler, PrepareDragSequenceExecution, PrepareDragSequenceRequest, PreventDefaultIsExternalItemExecution, PreventDefaultIsExternalItemRequest, RESIZE_DIRECTIONS, RectConstraint, RedrawCanvasWithAnimationExecution, RedrawCanvasWithAnimationRequest, RedrawConnectionsExecution, RedrawConnectionsRequest, RemoveBackgroundFromStoreExecution, RemoveBackgroundFromStoreRequest, RemoveCanvasFromStoreExecution, RemoveCanvasFromStoreRequest, RemoveConnectionForCreateFromStoreExecution, RemoveConnectionForCreateFromStoreRequest, RemoveConnectionFromStoreExecution, RemoveConnectionFromStoreRequest, RemoveConnectionMarkerFromStoreExecution, RemoveConnectionMarkerFromStoreRequest, RemoveDndFromStoreExecution, RemoveDndFromStoreRequest, RemoveFlowFromStoreExecution, RemoveFlowFromStoreRequest, RemoveInputFromStore, RemoveInputFromStoreRequest, RemoveLineAlignmentFromStoreExecution, RemoveLineAlignmentFromStoreRequest, RemoveNodeFromStore, RemoveNodeFromStoreRequest, RemoveOutletFromStoreExecution, RemoveOutletFromStoreRequest, RemoveOutputFromStoreExecution, RemoveOutputFromStoreRequest, RemoveSnapConnectionFromStoreExecution, RemoveSnapConnectionFromStoreRequest, RemoveZoomFromStoreExecution, RemoveZoomFromStoreRequest, ResetScaleAndCenterExecution, ResetScaleAndCenterRequest, ResetScaleExecution, ResetScaleRequest, ResetZoomExecution, ResetZoomRequest, SINGLE_SELECT_PROVIDERS, SelectAllExecution, SelectAllRequest, SelectAndUpdateNodeLayerExecution, SelectAndUpdateNodeLayerRequest, SelectExecution, SelectRequest, SelectionAreaDragHandle, SelectionAreaFinalizeExecution, SelectionAreaFinalizeRequest, SelectionAreaPreparationExecution, SelectionAreaPreparationRequest, SetBackgroundTransformExecution, SetBackgroundTransformRequest, SetZoomExecution, SetZoomRequest, SnapLineElement, SnapLineService, SnapLinesDragHandler, SnapToGrid, SortContainersForDropByLayer, SortContainersForDropByLayerRequest, SortItemLayersExecution, SortItemLayersRequest, SortItemsByParentExecution, SortItemsByParentRequest, SortNodeLayersExecution, SortNodeLayersRequest, SourceConnectionDragHandler, SourceTargetConnectionDragHandler, StartDragSequenceExecution, StartDragSequenceRequest, TargetConnectionDragHandler, UnmarkConnectableConnectors, UnmarkConnectableConnectorsRequest, UpdateItemAndChildrenLayersExecution, UpdateItemAndChildrenLayersRequest, UpdateNodeWhenStateOrSizeChanged, UpdateNodeWhenStateOrSizeChangedRequest, UpdateScaleExecution, UpdateScaleRequest, createSVGElement, debounceTime, defaultEventTrigger, expandRectFromBaseline, fixedCenterBehavior, fixedOutboundBehavior, floatingBehavior, getExternalItem, getMarkerEndId, getMarkerSelectedEndId, getMarkerSelectedStartId, getMarkerStartId, infinityMinMax, isClosestConnectorInsideSnapThreshold, isDragBlocker, isDragHandleEnd, isDragHandleStart, isExternalItem, isMobile, isNode, isNodeOutlet, isNodeOutput, isPointerInsideStartOrEndDragHandles, isRotateHandle, isValidEventTrigger, mixinChangeSelection, mixinChangeVisibility, notifyOnStart, roundedRectFromPoint, stringAttribute, transitionEnd };
12642
+ export { AddBackgroundToStoreExecution, AddBackgroundToStoreRequest, AddCanvasToStoreExecution, AddCanvasToStoreRequest, AddConnectionForCreateToStoreExecution, AddConnectionForCreateToStoreRequest, AddConnectionMarkerToStoreExecution, AddConnectionMarkerToStoreRequest, AddConnectionToStoreExecution, AddConnectionToStoreRequest, AddDndToStoreExecution, AddDndToStoreRequest, AddFlowToStoreExecution, AddFlowToStoreRequest, AddInputToStore, AddInputToStoreRequest, AddLineAlignmentToStoreExecution, AddLineAlignmentToStoreRequest, AddNodeToStore, AddNodeToStoreRequest, AddOutletToStore, AddOutletToStoreRequest, AddOutputToStore, AddOutputToStoreRequest, AddPatternToBackgroundExecution, AddPatternToBackgroundRequest, AddSnapConnectionToStoreExecution, AddSnapConnectionToStoreRequest, AddZoomToStoreExecution, AddZoomToStoreRequest, ApplyChildResizeConstraints, ApplyChildResizeConstraintsRequest, ApplyParentResizeConstraints, ApplyParentResizeConstraintsRequest, BaseConnectionDragHandler, BuildDragHierarchy, BuildDragHierarchyRequest, BuildDragHierarchyResponse, CALCULATABLE_SIDES, CANVAS_PROVIDERS, COMMON_PROVIDERS, CONNECTABLE_SIDE_EPSILON, CONNECTIONS_PROVIDERS, CONNECTION_GRADIENT, CONNECTION_PATH, CONNECTION_TEXT, CREATE_MOVE_NODE_DRAG_MODEL_FROM_SELECTION_PROVIDERS, CalculateCenterBetweenPointsHandler, CalculateCenterBetweenPointsRequest, CalculateChangedRectFromDifference, CalculateChangedRectFromDifferenceRequest, CalculateClosestConnector, CalculateClosestConnectorRequest, CalculateConnectableSideByConnectedPositions, CalculateConnectableSideByConnectedPositionsRequest, CalculateConnectableSideByInternalPosition, CalculateConnectableSideByInternalPositionRequest, CalculateConnectionCenterHandler, CalculateConnectionCenterRequest, CalculateConnectionLineByBehavior, CalculateConnectionLineByBehaviorRequest, CalculateConnectorsConnectableSides, CalculateConnectorsConnectableSidesRequest, CalculateDirectChildrenUnionRect, CalculateDirectChildrenUnionRectRequest, CalculateDragLimits, CalculateDragLimitsRequest, CalculateFlowPointFromMinimapPointExecution, CalculateFlowPointFromMinimapPointRequest, CalculateInputConnections, CalculateInputConnectionsRequest, CalculateNodesBoundingBox, CalculateNodesBoundingBoxNormalizedPosition, CalculateNodesBoundingBoxNormalizedPositionRequest, CalculateNodesBoundingBoxRequest, CalculateOutputConnections, CalculateOutputConnectionsRequest, CalculateResizeLimits, CalculateResizeLimitsRequest, CalculateSourceConnectorsToConnect, CalculateSourceConnectorsToConnectRequest, CalculateTargetConnectorsToConnect, CalculateTargetConnectorsToConnectRequest, CenterGroupOrNodeExecution, CenterGroupOrNodeRequest, ClearSelectionExecution, ClearSelectionRequest, ConnectionContentLayoutEngine, CreateConnectionFromOutputPreparation, CreateConnectionFromOutputPreparationRequest, CreateConnectionMarkersExecution, CreateConnectionMarkersRequest, CreateConnectionPreparation, CreateConnectionPreparationRequest, CreateDragModelFromSelection, CreateDragModelFromSelectionRequest, CreateInputConnectionHandlerAndSetToNodeHandler, CreateInputConnectionHandlerAndSetToNodeHandlerRequest, CreateOutputConnectionHandlerAndSetToNodeHandler, CreateOutputConnectionHandlerAndSetToNodeHandlerRequest, CreateSnapLines, CreateSnapLinesRequest, CreateSummaryDragHandler, CreateSummaryDragHandlerRequest, DRAG_AND_DROP_COMMON_PROVIDERS, Deprecated, DragAndDropBase, DragConstraintPipeline, DropToGroupFinalize, DropToGroupFinalizeRequest, DropToGroupPreparation, DropToGroupPreparationRequest, EFConnectableSide, EFConnectionBehavior, EFConnectionType, EFMarkerType, EFResizeHandleType, EFZoomDirection, EmitSelectionChangeEventExecution, EmitSelectionChangeEventRequest, EndDragSequenceExecution, EndDragSequenceRequest, EventExtensions, ExternalRectConstraint, FBackgroundBase, FBackgroundComponent, FBezierPathBuilder, FCanvasBase, FCanvasChangeEvent, FCanvasComponent, FCanvasDragHandler, FCanvasMoveFinalizeExecution, FCanvasMoveFinalizeRequest, FCanvasMovePreparationExecution, FCanvasMovePreparationRequest, FChannel, FChannelHub, FCirclePatternComponent, FComponentsStore, FConnectionBase, FConnectionCenterDirective, FConnectionComponent, FConnectionContent, FConnectionDragHandleEndComponent, FConnectionDragHandleStartComponent, FConnectionFactory, FConnectionForCreateComponent, FConnectionGradientComponent, FConnectionPathComponent, FConnectionSelectionComponent, FConnectionTextComponent, FConnectionTextPathDirective, FConnectorBase, FConnectorsStore, FCreateConnectionDragHandler, FCreateConnectionDragHandlerPreparationExecution, FCreateConnectionDragHandlerPreparationRequest, FCreateConnectionEvent, FCreateConnectionFinalizeExecution, FCreateConnectionFinalizeRequest, FCreateConnectionFromOutletPreparationExecution, FCreateConnectionFromOutletPreparationRequest, FCreateNodeEvent, FDragBlockerDirective, FDragHandleDirective, FDragHandlerResult, FDragStartedEvent, FDraggableBase, FDraggableDataContext, FDraggableDirective, FDropToGroupEvent, FExternalItemBase, FExternalItemCreatePlaceholderExecution, FExternalItemCreatePlaceholderRequest, FExternalItemCreatePreviewExecution, FExternalItemCreatePreviewRequest, FExternalItemDirective, FExternalItemDragHandler, FExternalItemFinalizeExecution, FExternalItemFinalizeRequest, FExternalItemPlaceholderDirective, FExternalItemPreparationExecution, FExternalItemPreparationRequest, FExternalItemPreviewDirective, FExternalItemService, FFlowBase, FFlowComponent, FFlowModule, FGroupDirective, FLineAlignmentBase, FLineAlignmentComponent, FMarkerBase, FMarkerDirective, FMinimapCanvasDirective, FMinimapComponent, FMinimapData, FMinimapDragHandler, FMinimapFlowDirective, FMinimapViewDirective, FMoveNodesEvent, FNodeBase, FNodeDirective, FNodeDropToGroupDragHandler, FNodeInputBase, FNodeInputDirective, FNodeIntersectedWithConnections, FNodeMoveFinalizeExecution, FNodeMoveFinalizeRequest, FNodeMovePreparationExecution, FNodeMovePreparationRequest, FNodeOutletBase, FNodeOutletDirective, FNodeOutputBase, FNodeOutputDirective, FNodeRotateDragHandler, FNodeRotateFinalizeExecution, FNodeRotateFinalizeRequest, FNodeRotatePreparationExecution, FNodeRotatePreparationRequest, FReassignConnectionDragHandler, FReassignConnectionEvent, FReassignConnectionFinalizeExecution, FReassignConnectionFinalizeRequest, FReassignConnectionPreparationExecution, FReassignConnectionPreparationRequest, FReassignSourceDragHandler, FReassignTargetDragHandler, FRectPatternComponent, FResizeChannel, FResizeHandleDirective, FRotateHandleDirective, FSegmentPathBuilder, FSelectionAreaBase, FSelectionAreaComponent, FSelectionChangeEvent, FSingleSelectExecution, FSingleSelectRequest, FSnapConnectionComponent, FSourceConnectorBase, FStraightPathBuilder, FZoomBase, FZoomDirective, F_AFTER_MAIN_PLUGIN, F_BACKGROUND, F_BACKGROUND_FEATURES, F_BACKGROUND_PATTERN, F_BACKGROUND_PROVIDERS, F_BEFORE_MAIN_PLUGIN, F_CANVAS, F_CANVAS_FEATURES, F_CANVAS_PROVIDERS, F_CONNECTION_BUILDERS, F_CONNECTION_FEATURES, F_CONNECTION_IDENTIFIERS, F_CONNECTION_PROVIDERS, F_CONNECTORS_FEATURES, F_CONNECTORS_PROVIDERS, F_CSS_CLASS, F_DRAGGABLE_FEATURES, F_DRAGGABLE_PROVIDERS, F_EXTERNAL_ITEM, F_EXTERNAL_ITEM_DRAG_AND_DROP_PROVIDERS, F_EXTERNAL_ITEM_PROVIDERS, F_FLOW, F_FLOW_FEATURES, F_FLOW_PROVIDERS, F_LINE_ALIGNMENT, F_LINE_ALIGNMENT_FEATURES, F_LINE_ALIGNMENT_PROVIDERS, F_MARKER, F_MINIMAP_DRAG_AND_DROP_PROVIDERS, F_MINIMAP_PROVIDERS, F_NODE, F_NODE_FEATURES, F_NODE_INPUT, F_NODE_OUTLET, F_NODE_OUTPUT, F_NODE_PROVIDERS, F_SELECTED_CLASS, F_SELECTION_AREA_DRAG_AND_DROP_PROVIDERS, F_SELECTION_AREA_PROVIDERS, F_SELECTION_FEATURES, F_STORAGE_PROVIDERS, F_ZOOM, F_ZOOM_FEATURES, F_ZOOM_PROVIDERS, F_ZOOM_TAG, FindConnectableConnectorUsingPriorityAndPositionExecution, FindConnectableConnectorUsingPriorityAndPositionRequest, FitToChildNodesAndGroups, FitToChildNodesAndGroupsRequest, FitToFlowExecution, FitToFlowRequest, GET_FLOW_STATE_PROVIDERS, GetCanBeSelectedItemsExecution, GetCanBeSelectedItemsRequest, GetCanvasExecution, GetCanvasRequest, GetChildNodeIds, GetChildNodeIdsRequest, GetConnectorAndRect, GetConnectorAndRectRequest, GetCurrentSelectionExecution, GetCurrentSelectionRequest, GetDeepChildrenNodesAndGroupsExecution, GetDeepChildrenNodesAndGroupsRequest, GetElementRoundedRectExecution, GetElementRoundedRectRequest, GetFirstConnectableOutputExecution, GetFirstConnectableOutputRequest, GetFlowExecution, GetFlowHostElementExecution, GetFlowHostElementRequest, GetFlowRequest, GetFlowStateConnectionsExecution, GetFlowStateConnectionsRequest, GetFlowStateExecution, GetFlowStateNodesExecution, GetFlowStateNodesRequest, GetFlowStateRequest, GetNodeBoundingIncludePaddings, GetNodeBoundingIncludePaddingsRequest, GetNodeBoundingIncludePaddingsResponse, GetNodePadding, GetNodePaddingRequest, GetNormalizedConnectorRectExecution, GetNormalizedConnectorRectRequest, GetNormalizedElementRectExecution, GetNormalizedElementRectRequest, GetNormalizedParentNodeRectExecution, GetNormalizedParentNodeRectRequest, GetNormalizedPointExecution, GetNormalizedPointRequest, GetParentNodes, GetParentNodesRequest, IMouseEvent, IPointerEvent, IPointerUpEvent, ITouchDownEvent, ITouchMoveEvent, InitializeDragSequenceExecution, InitializeDragSequenceRequest, InputCanvasPositionExecution, InputCanvasPositionRequest, InputCanvasScaleExecution, InputCanvasScaleRequest, IsArrayHasParentNodeExecution, IsArrayHasParentNodeRequest, IsConnectionUnderNodeExecution, IsConnectionUnderNodeRequest, IsDragStarted, IsDragStartedRequest, ListenCountChangesExecution, ListenCountChangesRequest, ListenDataChangesExecution, ListenDataChangesRequest, ListenTransformChangesExecution, ListenTransformChangesRequest, LogExecutionTime, MINIMAP_DRAG_FINALIZE_PROVIDERS, MINIMAP_DRAG_PREPARATION_PROVIDERS, MOUSE_EVENT_IGNORE_TIME, MarkConnectableConnectors, MarkConnectableConnectorsRequest, MinimapCalculateSvgScaleAndViewBoxExecution, MinimapCalculateSvgScaleAndViewBoxRequest, MinimapCalculateViewBoxExecution, MinimapCalculateViewBoxRequest, MinimapDragFinalizeExecution, MinimapDragFinalizeRequest, MinimapDragPreparationExecution, MinimapDragPreparationRequest, MinimapDrawNodesExecution, MinimapDrawNodesRequest, MoveDragHandler, MoveFrontElementsBeforeTargetElementExecution, MoveFrontElementsBeforeTargetElementRequest, MoveSummaryDragHandler, NODE_DROP_TO_GROUP_PROVIDERS, NODE_PROVIDERS, NODE_RESIZE_PROVIDERS, NODE_ROTATE_PROVIDERS, NodeResizeDragHandler, NodeResizeFinalize, NodeResizeFinalizeRequest, NodeResizePreparation, NodeResizePreparationRequest, NotifyDataChangedExecution, NotifyDataChangedRequest, NotifyTransformChangedExecution, NotifyTransformChangedRequest, OnPointerMoveExecution, OnPointerMoveRequest, Polyline, PolylineContentAlign, PolylineContentPlace, PolylineSampler, PrepareDragSequenceExecution, PrepareDragSequenceRequest, PreventDefaultIsExternalItemExecution, PreventDefaultIsExternalItemRequest, RESIZE_DIRECTIONS, RectConstraint, RedrawCanvasWithAnimationExecution, RedrawCanvasWithAnimationRequest, RedrawConnectionsExecution, RedrawConnectionsRequest, RemoveBackgroundFromStoreExecution, RemoveBackgroundFromStoreRequest, RemoveCanvasFromStoreExecution, RemoveCanvasFromStoreRequest, RemoveConnectionForCreateFromStoreExecution, RemoveConnectionForCreateFromStoreRequest, RemoveConnectionFromStoreExecution, RemoveConnectionFromStoreRequest, RemoveConnectionMarkerFromStoreExecution, RemoveConnectionMarkerFromStoreRequest, RemoveDndFromStoreExecution, RemoveDndFromStoreRequest, RemoveFlowFromStoreExecution, RemoveFlowFromStoreRequest, RemoveInputFromStore, RemoveInputFromStoreRequest, RemoveLineAlignmentFromStoreExecution, RemoveLineAlignmentFromStoreRequest, RemoveNodeFromStore, RemoveNodeFromStoreRequest, RemoveOutletFromStoreExecution, RemoveOutletFromStoreRequest, RemoveOutputFromStoreExecution, RemoveOutputFromStoreRequest, RemoveSnapConnectionFromStoreExecution, RemoveSnapConnectionFromStoreRequest, RemoveZoomFromStoreExecution, RemoveZoomFromStoreRequest, ResetScaleAndCenterExecution, ResetScaleAndCenterRequest, ResetScaleExecution, ResetScaleRequest, ResetZoomExecution, ResetZoomRequest, SINGLE_SELECT_PROVIDERS, SelectAllExecution, SelectAllRequest, SelectAndUpdateNodeLayerExecution, SelectAndUpdateNodeLayerRequest, SelectExecution, SelectRequest, SelectionAreaDragHandle, SelectionAreaFinalizeExecution, SelectionAreaFinalizeRequest, SelectionAreaPreparationExecution, SelectionAreaPreparationRequest, SetBackgroundTransformExecution, SetBackgroundTransformRequest, SetZoomExecution, SetZoomRequest, SnapLineElement, SnapLineService, SnapLinesDragHandler, SnapToGrid, SortContainersForDropByLayer, SortContainersForDropByLayerRequest, SortItemLayersExecution, SortItemLayersRequest, SortItemsByParentExecution, SortItemsByParentRequest, SortNodeLayersExecution, SortNodeLayersRequest, SourceConnectionDragHandler, SourceTargetConnectionDragHandler, StartDragSequenceExecution, StartDragSequenceRequest, TargetConnectionDragHandler, UnmarkConnectableConnectors, UnmarkConnectableConnectorsRequest, UpdateItemAndChildrenLayersExecution, UpdateItemAndChildrenLayersRequest, UpdateNodeWhenStateOrSizeChanged, UpdateNodeWhenStateOrSizeChangedRequest, UpdateScaleExecution, UpdateScaleRequest, createSVGElement, debounceTime, defaultEventTrigger, determineSide, expandRectFromBaseline, fixedCenterBehavior, fixedOutboundBehavior, floatingBehavior, getExternalItem, getMarkerEndId, getMarkerSelectedEndId, getMarkerSelectedStartId, getMarkerStartId, infinityMinMax, isCalculateMode, isClosestConnectorInsideSnapThreshold, isDragBlocker, isDragHandleEnd, isDragHandleStart, isExternalItem, isMobile, isNode, isNodeOutlet, isNodeOutput, isPointerInsideStartOrEndDragHandles, isRotateHandle, isValidEventTrigger, mixinChangeSelection, mixinChangeVisibility, notifyOnStart, roundedRectFromPoint, stringAttribute, transitionEnd };
12526
12643
  //# sourceMappingURL=foblex-flow.mjs.map