@foblex/flow 12.5.1 → 12.6.0

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 (393) hide show
  1. package/README.md +2 -2
  2. package/domain/get-deep-children-nodes-and-groups/get-deep-children-nodes-and-groups.execution.d.ts +13 -0
  3. package/domain/get-deep-children-nodes-and-groups/get-deep-children-nodes-and-groups.request.d.ts +4 -0
  4. package/domain/get-deep-children-nodes-and-groups/index.d.ts +2 -0
  5. package/domain/get-nodes-rect/get-nodes-rect.execution.d.ts +2 -2
  6. package/domain/get-scaled-node-rects-with-flow-position/get-scaled-node-rects-with-flow-position.execution.d.ts +14 -0
  7. package/domain/get-scaled-node-rects-with-flow-position/get-scaled-node-rects-with-flow-position.request.d.ts +2 -0
  8. package/domain/get-scaled-node-rects-with-flow-position/index.d.ts +2 -0
  9. package/domain/index.d.ts +4 -5
  10. package/domain/is-connection-under-node/is-connection-under-node.execution.d.ts +1 -5
  11. package/domain/providers.d.ts +5 -6
  12. package/domain/select-and-update-node-layer/select-and-update-node-layer.execution.d.ts +1 -3
  13. package/domain/sort-item-layers/index.d.ts +4 -0
  14. package/domain/sort-item-layers/sort-item-layers.execution.d.ts +12 -0
  15. package/domain/sort-item-layers/sort-item-layers.request.d.ts +2 -0
  16. package/domain/sort-item-layers/sort-items-by-parent/index.d.ts +2 -0
  17. package/domain/sort-item-layers/sort-items-by-parent/sort-items-by-parent.execution.d.ts +20 -0
  18. package/domain/sort-item-layers/sort-items-by-parent/sort-items-by-parent.request.d.ts +4 -0
  19. package/domain/sort-item-layers/sort-node-layers-by-groups/index.d.ts +2 -0
  20. package/domain/sort-item-layers/sort-node-layers-by-groups/sort-node-layers.execution.d.ts +21 -0
  21. package/domain/sort-item-layers/sort-node-layers-by-groups/sort-node-layers.request.d.ts +2 -0
  22. package/domain/update-item-and-children-layers/index.d.ts +3 -0
  23. package/domain/update-item-and-children-layers/move-front-elements-before-target-element/index.d.ts +2 -0
  24. package/domain/update-item-and-children-layers/move-front-elements-before-target-element/move-front-elements-before-target-element.execution.d.ts +8 -0
  25. package/domain/update-item-and-children-layers/move-front-elements-before-target-element/move-front-elements-before-target-element.request.d.ts +8 -0
  26. package/domain/update-item-and-children-layers/update-item-and-children-layers.execution.d.ts +25 -0
  27. package/domain/{update-item-layer/update-item-layer.request.d.ts → update-item-and-children-layers/update-item-and-children-layers.request.d.ts} +1 -1
  28. package/esm2022/domain/clear-selection/clear-selection.execution.mjs +2 -4
  29. package/esm2022/domain/create-connection-markers/create-connection-markers.execution.mjs +2 -2
  30. package/esm2022/domain/get-deep-children-nodes-and-groups/get-deep-children-nodes-and-groups.execution.mjs +36 -0
  31. package/esm2022/domain/get-deep-children-nodes-and-groups/get-deep-children-nodes-and-groups.request.mjs +7 -0
  32. package/esm2022/domain/get-deep-children-nodes-and-groups/index.mjs +3 -0
  33. package/esm2022/domain/get-nodes-rect/get-nodes-rect.execution.mjs +1 -1
  34. package/esm2022/domain/get-scaled-node-rects-with-flow-position/get-scaled-node-rects-with-flow-position.execution.mjs +35 -0
  35. package/esm2022/domain/get-scaled-node-rects-with-flow-position/get-scaled-node-rects-with-flow-position.request.mjs +3 -0
  36. package/esm2022/domain/get-scaled-node-rects-with-flow-position/index.mjs +3 -0
  37. package/esm2022/domain/index.mjs +5 -6
  38. package/esm2022/domain/is-connection-under-node/is-connection-under-node.execution.mjs +14 -20
  39. package/esm2022/domain/providers.mjs +12 -11
  40. package/esm2022/domain/redraw-connections/redraw-connections.execution.mjs +1 -1
  41. package/esm2022/domain/select/select.execution.mjs +2 -2
  42. package/esm2022/domain/select-all/select-all.execution.mjs +1 -1
  43. package/esm2022/domain/select-and-update-node-layer/select-and-update-node-layer.execution.mjs +7 -10
  44. package/esm2022/domain/sort-item-layers/index.mjs +5 -0
  45. package/esm2022/domain/sort-item-layers/sort-item-layers.execution.mjs +32 -0
  46. package/esm2022/domain/sort-item-layers/sort-item-layers.request.mjs +3 -0
  47. package/esm2022/domain/sort-item-layers/sort-items-by-parent/index.mjs +3 -0
  48. package/esm2022/domain/sort-item-layers/sort-items-by-parent/sort-items-by-parent.execution.mjs +61 -0
  49. package/esm2022/domain/sort-item-layers/sort-items-by-parent/sort-items-by-parent.request.mjs +8 -0
  50. package/esm2022/domain/sort-item-layers/sort-node-layers-by-groups/index.mjs +3 -0
  51. package/esm2022/domain/sort-item-layers/sort-node-layers-by-groups/sort-node-layers.execution.mjs +62 -0
  52. package/esm2022/domain/sort-item-layers/sort-node-layers-by-groups/sort-node-layers.request.mjs +3 -0
  53. package/esm2022/domain/subscribe-on-transform-changes/subscribe-on-transform-changes.execution.mjs +2 -2
  54. package/esm2022/domain/update-item-and-children-layers/index.mjs +4 -0
  55. package/esm2022/domain/update-item-and-children-layers/move-front-elements-before-target-element/index.mjs +3 -0
  56. package/esm2022/domain/update-item-and-children-layers/move-front-elements-before-target-element/move-front-elements-before-target-element.execution.mjs +30 -0
  57. package/esm2022/domain/update-item-and-children-layers/move-front-elements-before-target-element/move-front-elements-before-target-element.request.mjs +14 -0
  58. package/esm2022/domain/update-item-and-children-layers/update-item-and-children-layers.execution.mjs +99 -0
  59. package/esm2022/domain/update-item-and-children-layers/update-item-and-children-layers.request.mjs +9 -0
  60. package/esm2022/f-canvas/f-canvas-base.mjs +1 -1
  61. package/esm2022/f-canvas/f-canvas.component.mjs +9 -5
  62. package/esm2022/f-connection/common/domain/f-bezier.path-builder.mjs +2 -2
  63. package/esm2022/f-connection/common/domain/f-segment.path-builder.mjs +3 -2
  64. package/esm2022/f-connection/common/domain/f-straight.path-builder.mjs +2 -2
  65. package/esm2022/f-connection/common/f-connection-base.mjs +5 -3
  66. package/esm2022/f-connection/common/f-connection-text/f-connection-text-path.directive.mjs +2 -2
  67. package/esm2022/f-connection/common/f-connection-text/f-connection-text.component.mjs +2 -2
  68. package/esm2022/f-connection/common/f-drag-handle/f-connection-drag-handle.component.mjs +3 -3
  69. package/esm2022/f-connection/common/f-gradient/f-connection-gradient.component.mjs +2 -2
  70. package/esm2022/f-connection/common/f-path/f-connection-path.component.mjs +8 -8
  71. package/esm2022/f-connection/common/f-selection/f-connection-selection.component.mjs +2 -2
  72. package/esm2022/f-connection/common/i-has-connection-from-to.mjs +1 -1
  73. package/esm2022/f-connection/common/mixins/change-connection-selection.mixin.mjs +2 -1
  74. package/esm2022/f-connection/f-connection/f-connection.component.mjs +22 -17
  75. package/esm2022/f-connection/f-connection-builder/i-f-connection-builder-response.mjs +1 -1
  76. package/esm2022/f-connection/f-connection-for-create/f-connection-for-create.component.mjs +19 -12
  77. package/esm2022/f-draggable/canvas/canvas-move-finalize/canvas-move-finalize.execution.mjs +2 -4
  78. package/esm2022/f-draggable/canvas/canvas-move-finalize/canvas-move-finalize.validator.mjs +3 -3
  79. package/esm2022/f-draggable/canvas/canvas-move-preparation/canvas-move-preparation.validator.mjs +6 -1
  80. package/esm2022/f-draggable/canvas/canvas.drag-handler.mjs +1 -3
  81. package/esm2022/f-draggable/connections/create-connection/create-connection-finalize/create-connection-finalize.validator.mjs +3 -3
  82. package/esm2022/f-draggable/connections/create-connection/create-connection.drag-handler.mjs +1 -3
  83. package/esm2022/f-draggable/connections/reassign-connection/reassign-connection-finalize/reassign-connection-finalize.execution.mjs +2 -2
  84. package/esm2022/f-draggable/connections/reassign-connection/reassign-connection-finalize/reassign-connection-finalize.validator.mjs +3 -3
  85. package/esm2022/f-draggable/connections/reassign-connection/reassign-connection-preparation/reassign-connection-preparation.execution.mjs +3 -3
  86. package/esm2022/f-draggable/connections/reassign-connection/reassign-connection.drag-handler.mjs +1 -3
  87. package/esm2022/f-draggable/domain/convert-computed-to-pixels/convert-computed-to-pixels-request.mjs +13 -0
  88. package/esm2022/f-draggable/domain/convert-computed-to-pixels/convert-computed-to-pixels.execution.mjs +49 -0
  89. package/esm2022/f-draggable/domain/convert-computed-to-pixels/index.mjs +3 -0
  90. package/esm2022/f-draggable/domain/get-node-padding/get-node-padding.execution.mjs +38 -0
  91. package/esm2022/f-draggable/domain/get-node-padding/get-node-padding.request.mjs +9 -0
  92. package/esm2022/f-draggable/domain/get-node-padding/index.mjs +3 -0
  93. package/esm2022/f-draggable/domain/get-normalized-node-rect/get-normalized-node-rect.execution.mjs +30 -0
  94. package/esm2022/f-draggable/domain/get-normalized-node-rect/get-normalized-node-rect.request.mjs +7 -0
  95. package/esm2022/f-draggable/domain/get-normalized-node-rect/index.mjs +3 -0
  96. package/esm2022/f-draggable/domain/get-normalized-parent-node-rect/get-normalized-parent-node-rect.execution.mjs +50 -0
  97. package/esm2022/f-draggable/domain/get-normalized-parent-node-rect/get-normalized-parent-node-rect.request.mjs +7 -0
  98. package/esm2022/f-draggable/domain/get-normalized-parent-node-rect/index.mjs +3 -0
  99. package/esm2022/f-draggable/domain/get-parent-nodes/get-parent-nodes.execution.mjs +37 -0
  100. package/esm2022/f-draggable/domain/get-parent-nodes/get-parent-nodes.request.mjs +7 -0
  101. package/esm2022/f-draggable/domain/get-parent-nodes/index.mjs +3 -0
  102. package/esm2022/f-draggable/domain/index.mjs +8 -0
  103. package/esm2022/f-draggable/domain/is-array-has-parent-node/index.mjs +3 -0
  104. package/esm2022/f-draggable/domain/is-array-has-parent-node/is-array-has-parent-node.execution.mjs +35 -0
  105. package/esm2022/f-draggable/domain/is-array-has-parent-node/is-array-has-parent-node.request.mjs +9 -0
  106. package/esm2022/f-draggable/domain/providers.mjs +15 -0
  107. package/esm2022/f-draggable/f-draggable-base.mjs +8 -3
  108. package/esm2022/f-draggable/f-draggable-data-context.mjs +1 -2
  109. package/esm2022/f-draggable/f-draggable.directive.mjs +3 -7
  110. package/esm2022/f-draggable/i-draggable-item.mjs +1 -1
  111. package/esm2022/f-draggable/index.mjs +2 -4
  112. package/esm2022/f-draggable/node/connection-base-drag-handler.mjs +42 -0
  113. package/esm2022/f-draggable/node/connection-source.drag-handler.mjs +14 -26
  114. package/esm2022/f-draggable/node/connection-target.drag-handler.mjs +14 -26
  115. package/esm2022/f-draggable/node/connection.drag-handler.mjs +16 -24
  116. package/esm2022/f-draggable/node/create-move-nodes-drag-model-from-selection/create-move-nodes-drag-model-from-selection.execution.mjs +46 -56
  117. package/esm2022/f-draggable/node/create-move-nodes-drag-model-from-selection/domain/get-node-move-restrictions/get-node-move-restrictions.execution.mjs +45 -0
  118. package/esm2022/f-draggable/node/create-move-nodes-drag-model-from-selection/domain/get-node-move-restrictions/get-node-move-restrictions.request.mjs +9 -0
  119. package/esm2022/f-draggable/node/create-move-nodes-drag-model-from-selection/domain/get-node-move-restrictions/i-node-move-restrictions.mjs +2 -0
  120. package/esm2022/f-draggable/node/create-move-nodes-drag-model-from-selection/domain/get-node-move-restrictions/index.mjs +4 -0
  121. package/esm2022/f-draggable/node/create-move-nodes-drag-model-from-selection/domain/put-input-connection-handlers-to-array/index.mjs +3 -0
  122. package/esm2022/f-draggable/node/create-move-nodes-drag-model-from-selection/domain/put-input-connection-handlers-to-array/put-input-connection-handlers-to-array.execution.mjs +72 -0
  123. package/esm2022/f-draggable/node/create-move-nodes-drag-model-from-selection/domain/put-input-connection-handlers-to-array/put-input-connection-handlers-to-array.request.mjs +11 -0
  124. package/esm2022/f-draggable/node/create-move-nodes-drag-model-from-selection/domain/put-output-connection-handlers-to-array/index.mjs +3 -0
  125. package/esm2022/f-draggable/node/create-move-nodes-drag-model-from-selection/domain/put-output-connection-handlers-to-array/put-output-connection-handlers-to-array.execution.mjs +72 -0
  126. package/esm2022/f-draggable/node/create-move-nodes-drag-model-from-selection/domain/put-output-connection-handlers-to-array/put-output-connection-handlers-to-array.request.mjs +11 -0
  127. package/esm2022/f-draggable/node/create-move-nodes-drag-model-from-selection/i-node-with-distance-restrictions.mjs +2 -0
  128. package/esm2022/f-draggable/node/create-move-nodes-drag-model-from-selection/index.mjs +5 -1
  129. package/esm2022/f-draggable/node/create-move-nodes-drag-model-from-selection/providers.mjs +7 -1
  130. package/esm2022/f-draggable/node/index.mjs +3 -1
  131. package/esm2022/f-draggable/node/node-move-finalize/node-move-finalize.execution.mjs +2 -2
  132. package/esm2022/f-draggable/node/node-move-finalize/node-move-finalize.validator.mjs +3 -3
  133. package/esm2022/f-draggable/node/node-move-preparation/node-move-preparation.execution.mjs +3 -4
  134. package/esm2022/f-draggable/node/node-resize-by-child.drag-handler.mjs +13 -0
  135. package/esm2022/f-draggable/node/node.drag-handler.mjs +21 -7
  136. package/esm2022/f-draggable/node-resize/apply-child-resize-restrictions/apply-child-resize-restrictions.execution.mjs +49 -0
  137. package/esm2022/f-draggable/node-resize/apply-child-resize-restrictions/apply-child-resize-restrictions.request.mjs +9 -0
  138. package/esm2022/f-draggable/node-resize/apply-child-resize-restrictions/index.mjs +3 -0
  139. package/esm2022/f-draggable/node-resize/apply-parent-resize-restrictions/apply-parent-resize-restrictions.execution.mjs +49 -0
  140. package/esm2022/f-draggable/node-resize/apply-parent-resize-restrictions/apply-parent-resize-restrictions.request.mjs +9 -0
  141. package/esm2022/f-draggable/node-resize/apply-parent-resize-restrictions/index.mjs +3 -0
  142. package/esm2022/f-draggable/node-resize/calculate-changed-position/calculate-changed-position.execution.mjs +25 -0
  143. package/esm2022/f-draggable/node-resize/calculate-changed-position/calculate-changed-position.request.mjs +13 -0
  144. package/esm2022/f-draggable/node-resize/calculate-changed-position/index.mjs +3 -0
  145. package/esm2022/f-draggable/node-resize/calculate-changed-size/calculate-changed-size.execution.mjs +34 -0
  146. package/esm2022/f-draggable/node-resize/calculate-changed-size/calculate-changed-size.request.mjs +11 -0
  147. package/esm2022/f-draggable/node-resize/calculate-changed-size/index.mjs +3 -0
  148. package/esm2022/f-draggable/node-resize/get-node-resize-restrictions/get-node-resize-restrictions.execution.mjs +32 -0
  149. package/esm2022/f-draggable/node-resize/get-node-resize-restrictions/get-node-resize-restrictions.request.mjs +9 -0
  150. package/esm2022/f-draggable/node-resize/get-node-resize-restrictions/i-node-resize-restrictions.mjs +2 -0
  151. package/esm2022/f-draggable/node-resize/get-node-resize-restrictions/index.mjs +4 -0
  152. package/esm2022/f-draggable/node-resize/get-normalized-children-nodes-rect/get-normalized-children-nodes-rect.execution.mjs +42 -0
  153. package/esm2022/f-draggable/node-resize/get-normalized-children-nodes-rect/get-normalized-children-nodes-rect.request.mjs +9 -0
  154. package/esm2022/f-draggable/node-resize/get-normalized-children-nodes-rect/index.mjs +3 -0
  155. package/esm2022/f-draggable/node-resize/index.mjs +8 -1
  156. package/esm2022/f-draggable/node-resize/node-resize-finalize/node-resize-finalize.validator.mjs +3 -3
  157. package/esm2022/f-draggable/node-resize/node-resize-preparation/node-resize-preparation.execution.mjs +2 -2
  158. package/esm2022/f-draggable/node-resize/node-resize.drag-handler.mjs +38 -39
  159. package/esm2022/f-draggable/node-resize/providers.mjs +13 -1
  160. package/esm2022/f-draggable/node-resize/resize-direction.mjs +8 -0
  161. package/esm2022/f-draggable/providers.mjs +7 -5
  162. package/esm2022/f-draggable/single-select/single-select.execution.mjs +11 -11
  163. package/esm2022/f-external-item/domain/external-item-finalize/external-item-finalize.execution.mjs +58 -0
  164. package/esm2022/f-external-item/domain/external-item-finalize/external-item-finalize.request.mjs +7 -0
  165. package/esm2022/f-external-item/domain/external-item-finalize/external-item-finalize.validator.mjs +26 -0
  166. package/esm2022/f-external-item/domain/external-item-finalize/index.mjs +5 -0
  167. package/esm2022/f-external-item/domain/external-item-finalize/providers.mjs +7 -0
  168. package/esm2022/f-external-item/domain/external-item-preparation/external-item-preparation.execution.mjs +44 -0
  169. package/esm2022/f-external-item/domain/external-item-preparation/external-item-preparation.request.mjs +7 -0
  170. package/esm2022/f-external-item/domain/external-item-preparation/external-item-preparation.validator.mjs +30 -0
  171. package/esm2022/f-external-item/domain/external-item-preparation/index.mjs +5 -0
  172. package/esm2022/f-external-item/domain/external-item-preparation/providers.mjs +7 -0
  173. package/esm2022/f-external-item/domain/external-item.drag-handler.mjs +36 -0
  174. package/esm2022/f-external-item/domain/f-create-node.event.mjs +9 -0
  175. package/esm2022/f-external-item/domain/index.mjs +6 -0
  176. package/esm2022/f-external-item/domain/providers.mjs +7 -0
  177. package/esm2022/f-external-item/index.mjs +2 -1
  178. package/esm2022/f-flow/f-flow.component.mjs +15 -7
  179. package/esm2022/f-flow.module.mjs +7 -6
  180. package/esm2022/f-line-alignment/domain/line-service.mjs +3 -1
  181. package/esm2022/f-line-alignment/f-line-alignment.component.mjs +2 -2
  182. package/esm2022/f-minimap/domain/f-minimap.drag-handler.mjs +1 -3
  183. package/esm2022/f-minimap/domain/minimap-drag-finalize/minimap-drag-finalize.validator.mjs +2 -2
  184. package/esm2022/f-minimap/f-minimap-canvas.directive.mjs +9 -11
  185. package/esm2022/f-minimap/f-minimap-flow.directive.mjs +3 -2
  186. package/esm2022/f-node/domain/index.mjs +3 -0
  187. package/esm2022/f-node/domain/is-group.mjs +4 -0
  188. package/esm2022/f-node/domain/is-node.mjs +4 -0
  189. package/esm2022/f-node/f-group.directive.mjs +147 -0
  190. package/esm2022/f-node/f-node-base.mjs +2 -1
  191. package/esm2022/f-node/f-node.directive.mjs +12 -4
  192. package/esm2022/f-node/index.mjs +3 -2
  193. package/esm2022/f-node/providers.mjs +3 -2
  194. package/esm2022/f-selection-area/domain/index.mjs +5 -2
  195. package/esm2022/f-selection-area/domain/providers.mjs +7 -0
  196. package/esm2022/f-selection-area/domain/selection-area-finalize/index.mjs +5 -0
  197. package/esm2022/f-selection-area/domain/selection-area-finalize/providers.mjs +7 -0
  198. package/esm2022/f-selection-area/domain/selection-area-finalize/selection-area-finalize.execution.mjs +27 -0
  199. package/esm2022/f-selection-area/domain/selection-area-finalize/selection-area-finalize.request.mjs +7 -0
  200. package/esm2022/f-selection-area/domain/selection-area-finalize/selection-area-finalize.validator.mjs +26 -0
  201. package/esm2022/f-selection-area/domain/selection-area-preparation/index.mjs +5 -0
  202. package/esm2022/f-selection-area/domain/selection-area-preparation/providers.mjs +7 -0
  203. package/esm2022/f-selection-area/domain/selection-area-preparation/selection-area-preparation.execution.mjs +41 -0
  204. package/esm2022/f-selection-area/domain/selection-area-preparation/selection-area-preparation.request.mjs +9 -0
  205. package/esm2022/f-selection-area/domain/selection-area-preparation/selection-area-preparation.validator.mjs +30 -0
  206. package/esm2022/f-selection-area/domain/selection-area.drag-handle.mjs +52 -0
  207. package/esm2022/f-selection-area/f-selection-area-base.mjs +2 -3
  208. package/esm2022/f-selection-area/f-selection-area.component.mjs +20 -13
  209. package/esm2022/f-storage/f-components-store.mjs +14 -4
  210. package/f-canvas/f-canvas-base.d.ts +1 -0
  211. package/f-canvas/f-canvas.component.d.ts +2 -1
  212. package/f-connection/common/f-connection-base.d.ts +2 -1
  213. package/f-connection/common/f-drag-handle/f-connection-drag-handle.component.d.ts +1 -1
  214. package/f-connection/common/i-has-connection-from-to.d.ts +1 -1
  215. package/f-connection/common/mixins/change-connection-selection.mixin.d.ts +1 -0
  216. package/f-connection/f-connection/f-connection.component.d.ts +4 -3
  217. package/f-connection/f-connection-builder/i-f-connection-builder-response.d.ts +1 -0
  218. package/f-connection/f-connection-for-create/f-connection-for-create.component.d.ts +4 -3
  219. package/f-draggable/canvas/canvas-move-preparation/canvas-move-preparation.validator.d.ts +1 -0
  220. package/f-draggable/canvas/canvas.drag-handler.d.ts +0 -2
  221. package/f-draggable/connections/create-connection/create-connection.drag-handler.d.ts +0 -2
  222. package/f-draggable/connections/reassign-connection/reassign-connection.drag-handler.d.ts +0 -2
  223. package/f-draggable/domain/convert-computed-to-pixels/convert-computed-to-pixels-request.d.ts +7 -0
  224. package/f-draggable/domain/convert-computed-to-pixels/convert-computed-to-pixels.execution.d.ts +12 -0
  225. package/f-draggable/domain/convert-computed-to-pixels/index.d.ts +2 -0
  226. package/f-draggable/domain/get-node-padding/get-node-padding.execution.d.ts +12 -0
  227. package/f-draggable/domain/get-node-padding/get-node-padding.request.d.ts +7 -0
  228. package/f-draggable/domain/get-node-padding/index.d.ts +2 -0
  229. package/f-draggable/domain/get-normalized-node-rect/get-normalized-node-rect.execution.d.ts +13 -0
  230. package/f-draggable/domain/get-normalized-node-rect/get-normalized-node-rect.request.d.ts +5 -0
  231. package/f-draggable/domain/get-normalized-node-rect/index.d.ts +2 -0
  232. package/f-draggable/domain/get-normalized-parent-node-rect/get-normalized-parent-node-rect.execution.d.ts +17 -0
  233. package/f-draggable/domain/get-normalized-parent-node-rect/get-normalized-parent-node-rect.request.d.ts +5 -0
  234. package/f-draggable/domain/get-normalized-parent-node-rect/index.d.ts +2 -0
  235. package/f-draggable/domain/get-parent-nodes/get-parent-nodes.execution.d.ts +13 -0
  236. package/f-draggable/domain/get-parent-nodes/get-parent-nodes.request.d.ts +5 -0
  237. package/f-draggable/domain/get-parent-nodes/index.d.ts +2 -0
  238. package/f-draggable/domain/index.d.ts +7 -0
  239. package/f-draggable/domain/is-array-has-parent-node/index.d.ts +2 -0
  240. package/f-draggable/domain/is-array-has-parent-node/is-array-has-parent-node.execution.d.ts +13 -0
  241. package/f-draggable/domain/is-array-has-parent-node/is-array-has-parent-node.request.d.ts +6 -0
  242. package/f-draggable/domain/providers.d.ts +7 -0
  243. package/f-draggable/f-draggable-base.d.ts +2 -1
  244. package/f-draggable/f-draggable-data-context.d.ts +0 -2
  245. package/f-draggable/f-draggable.directive.d.ts +1 -1
  246. package/f-draggable/i-draggable-item.d.ts +0 -2
  247. package/f-draggable/index.d.ts +1 -3
  248. package/f-draggable/node/connection-base-drag-handler.d.ts +23 -0
  249. package/f-draggable/node/connection-source.drag-handler.d.ts +6 -12
  250. package/f-draggable/node/connection-target.drag-handler.d.ts +6 -12
  251. package/f-draggable/node/connection.drag-handler.d.ts +7 -10
  252. package/f-draggable/node/create-move-nodes-drag-model-from-selection/create-move-nodes-drag-model-from-selection.execution.d.ts +4 -6
  253. package/f-draggable/node/create-move-nodes-drag-model-from-selection/domain/get-node-move-restrictions/get-node-move-restrictions.execution.d.ts +13 -0
  254. package/f-draggable/node/create-move-nodes-drag-model-from-selection/domain/get-node-move-restrictions/get-node-move-restrictions.request.d.ts +6 -0
  255. package/f-draggable/node/create-move-nodes-drag-model-from-selection/domain/get-node-move-restrictions/i-node-move-restrictions.d.ts +5 -0
  256. package/f-draggable/node/create-move-nodes-drag-model-from-selection/domain/get-node-move-restrictions/index.d.ts +3 -0
  257. package/f-draggable/node/create-move-nodes-drag-model-from-selection/domain/put-input-connection-handlers-to-array/index.d.ts +2 -0
  258. package/f-draggable/node/create-move-nodes-drag-model-from-selection/domain/put-input-connection-handlers-to-array/put-input-connection-handlers-to-array.execution.d.ts +22 -0
  259. package/f-draggable/node/create-move-nodes-drag-model-from-selection/domain/put-input-connection-handlers-to-array/put-input-connection-handlers-to-array.request.d.ts +8 -0
  260. package/f-draggable/node/create-move-nodes-drag-model-from-selection/domain/put-output-connection-handlers-to-array/index.d.ts +2 -0
  261. package/f-draggable/node/create-move-nodes-drag-model-from-selection/domain/put-output-connection-handlers-to-array/put-output-connection-handlers-to-array.execution.d.ts +22 -0
  262. package/f-draggable/node/create-move-nodes-drag-model-from-selection/domain/put-output-connection-handlers-to-array/put-output-connection-handlers-to-array.request.d.ts +8 -0
  263. package/f-draggable/node/create-move-nodes-drag-model-from-selection/i-node-with-distance-restrictions.d.ts +6 -0
  264. package/f-draggable/node/create-move-nodes-drag-model-from-selection/index.d.ts +4 -0
  265. package/f-draggable/node/create-move-nodes-drag-model-from-selection/providers.d.ts +4 -1
  266. package/f-draggable/node/index.d.ts +2 -0
  267. package/f-draggable/node/node-resize-by-child.drag-handler.d.ts +10 -0
  268. package/f-draggable/node/node.drag-handler.d.ts +6 -3
  269. package/f-draggable/node/providers.d.ts +1 -1
  270. package/f-draggable/node-resize/apply-child-resize-restrictions/apply-child-resize-restrictions.execution.d.ts +13 -0
  271. package/f-draggable/node-resize/apply-child-resize-restrictions/apply-child-resize-restrictions.request.d.ts +6 -0
  272. package/f-draggable/node-resize/apply-child-resize-restrictions/index.d.ts +2 -0
  273. package/f-draggable/node-resize/apply-parent-resize-restrictions/apply-parent-resize-restrictions.execution.d.ts +13 -0
  274. package/f-draggable/node-resize/apply-parent-resize-restrictions/apply-parent-resize-restrictions.request.d.ts +6 -0
  275. package/f-draggable/node-resize/apply-parent-resize-restrictions/index.d.ts +2 -0
  276. package/f-draggable/node-resize/calculate-changed-position/calculate-changed-position.execution.d.ts +10 -0
  277. package/f-draggable/node-resize/calculate-changed-position/calculate-changed-position.request.d.ts +9 -0
  278. package/f-draggable/node-resize/calculate-changed-position/index.d.ts +2 -0
  279. package/f-draggable/node-resize/calculate-changed-size/calculate-changed-size.execution.d.ts +10 -0
  280. package/f-draggable/node-resize/calculate-changed-size/calculate-changed-size.request.d.ts +8 -0
  281. package/f-draggable/node-resize/calculate-changed-size/index.d.ts +2 -0
  282. package/f-draggable/node-resize/get-node-resize-restrictions/get-node-resize-restrictions.execution.d.ts +11 -0
  283. package/f-draggable/node-resize/get-node-resize-restrictions/get-node-resize-restrictions.request.d.ts +7 -0
  284. package/f-draggable/node-resize/get-node-resize-restrictions/i-node-resize-restrictions.d.ts +5 -0
  285. package/f-draggable/node-resize/get-node-resize-restrictions/index.d.ts +3 -0
  286. package/f-draggable/node-resize/get-normalized-children-nodes-rect/get-normalized-children-nodes-rect.execution.d.ts +15 -0
  287. package/f-draggable/node-resize/get-normalized-children-nodes-rect/get-normalized-children-nodes-rect.request.d.ts +7 -0
  288. package/f-draggable/node-resize/get-normalized-children-nodes-rect/index.d.ts +2 -0
  289. package/f-draggable/node-resize/index.d.ts +7 -0
  290. package/f-draggable/node-resize/node-resize.drag-handler.d.ts +11 -10
  291. package/f-draggable/node-resize/providers.d.ts +7 -1
  292. package/f-draggable/node-resize/resize-direction.d.ts +18 -0
  293. package/f-draggable/providers.d.ts +1 -1
  294. package/f-draggable/single-select/single-select.execution.d.ts +2 -3
  295. package/{f-draggable/external-item → f-external-item/domain}/external-item-finalize/external-item-finalize.execution.d.ts +1 -1
  296. package/{f-draggable/external-item → f-external-item/domain}/external-item-finalize/external-item-finalize.validator.d.ts +1 -1
  297. package/{f-draggable/external-item → f-external-item/domain}/external-item-preparation/external-item-preparation.execution.d.ts +1 -1
  298. package/{f-draggable/external-item → f-external-item/domain}/external-item.drag-handler.d.ts +1 -3
  299. package/f-external-item/domain/providers.d.ts +1 -0
  300. package/f-external-item/index.d.ts +1 -0
  301. package/f-flow/f-flow.component.d.ts +2 -1
  302. package/f-flow.module.d.ts +8 -7
  303. package/f-minimap/domain/f-minimap.drag-handler.d.ts +1 -2
  304. package/f-minimap/f-minimap-canvas.directive.d.ts +1 -3
  305. package/f-node/domain/index.d.ts +2 -0
  306. package/f-node/domain/is-group.d.ts +1 -0
  307. package/f-node/f-group.directive.d.ts +40 -0
  308. package/f-node/f-node-base.d.ts +3 -0
  309. package/f-node/f-node.directive.d.ts +6 -4
  310. package/f-node/index.d.ts +2 -1
  311. package/f-node/providers.d.ts +2 -1
  312. package/f-selection-area/domain/index.d.ts +4 -1
  313. package/f-selection-area/domain/providers.d.ts +1 -0
  314. package/{f-draggable/selection-area → f-selection-area/domain}/selection-area-finalize/selection-area-finalize.execution.d.ts +1 -1
  315. package/{f-draggable/selection-area → f-selection-area/domain}/selection-area-finalize/selection-area-finalize.validator.d.ts +1 -1
  316. package/{f-draggable/selection-area → f-selection-area/domain}/selection-area-preparation/selection-area-preparation.execution.d.ts +1 -1
  317. package/f-selection-area/domain/selection-area-preparation/selection-area-preparation.request.d.ts +7 -0
  318. package/{f-draggable/selection-area → f-selection-area/domain}/selection-area-preparation/selection-area-preparation.validator.d.ts +1 -1
  319. package/{f-draggable/selection-area → f-selection-area/domain}/selection-area.drag-handle.d.ts +4 -5
  320. package/f-selection-area/f-selection-area-base.d.ts +2 -5
  321. package/f-selection-area/f-selection-area.component.d.ts +9 -6
  322. package/f-storage/f-components-store.d.ts +6 -2
  323. package/fesm2022/foblex-flow.mjs +2108 -1005
  324. package/fesm2022/foblex-flow.mjs.map +1 -1
  325. package/package.json +3 -3
  326. package/domain/get-connection.handler.d.ts +0 -12
  327. package/domain/get-external-nodes-rect/get-external-nodes-rect.execution.d.ts +0 -14
  328. package/domain/get-external-nodes-rect/get-external-nodes-rect.request.d.ts +0 -2
  329. package/domain/get-external-nodes-rect/index.d.ts +0 -2
  330. package/domain/get-incoming-connections.handler.d.ts +0 -13
  331. package/domain/get-outgoing-connections.handler.d.ts +0 -13
  332. package/domain/update-item-layer/index.d.ts +0 -2
  333. package/domain/update-item-layer/update-item-layer.execution.d.ts +0 -8
  334. package/esm2022/domain/get-connection.handler.mjs +0 -21
  335. package/esm2022/domain/get-external-nodes-rect/get-external-nodes-rect.execution.mjs +0 -35
  336. package/esm2022/domain/get-external-nodes-rect/get-external-nodes-rect.request.mjs +0 -3
  337. package/esm2022/domain/get-external-nodes-rect/index.mjs +0 -3
  338. package/esm2022/domain/get-incoming-connections.handler.mjs +0 -24
  339. package/esm2022/domain/get-outgoing-connections.handler.mjs +0 -24
  340. package/esm2022/domain/update-item-layer/index.mjs +0 -3
  341. package/esm2022/domain/update-item-layer/update-item-layer.execution.mjs +0 -28
  342. package/esm2022/domain/update-item-layer/update-item-layer.request.mjs +0 -9
  343. package/esm2022/f-draggable/e-f-draggable-type.mjs +0 -13
  344. package/esm2022/f-draggable/external-item/external-item-finalize/external-item-finalize.execution.mjs +0 -58
  345. package/esm2022/f-draggable/external-item/external-item-finalize/external-item-finalize.request.mjs +0 -7
  346. package/esm2022/f-draggable/external-item/external-item-finalize/external-item-finalize.validator.mjs +0 -26
  347. package/esm2022/f-draggable/external-item/external-item-finalize/index.mjs +0 -5
  348. package/esm2022/f-draggable/external-item/external-item-finalize/providers.mjs +0 -7
  349. package/esm2022/f-draggable/external-item/external-item-preparation/external-item-preparation.execution.mjs +0 -44
  350. package/esm2022/f-draggable/external-item/external-item-preparation/external-item-preparation.request.mjs +0 -7
  351. package/esm2022/f-draggable/external-item/external-item-preparation/external-item-preparation.validator.mjs +0 -30
  352. package/esm2022/f-draggable/external-item/external-item-preparation/index.mjs +0 -5
  353. package/esm2022/f-draggable/external-item/external-item-preparation/providers.mjs +0 -7
  354. package/esm2022/f-draggable/external-item/external-item.drag-handler.mjs +0 -38
  355. package/esm2022/f-draggable/external-item/f-create-node.event.mjs +0 -9
  356. package/esm2022/f-draggable/external-item/index.mjs +0 -6
  357. package/esm2022/f-draggable/external-item/providers.mjs +0 -7
  358. package/esm2022/f-draggable/selection-area/index.mjs +0 -5
  359. package/esm2022/f-draggable/selection-area/providers.mjs +0 -7
  360. package/esm2022/f-draggable/selection-area/selection-area-finalize/index.mjs +0 -5
  361. package/esm2022/f-draggable/selection-area/selection-area-finalize/providers.mjs +0 -7
  362. package/esm2022/f-draggable/selection-area/selection-area-finalize/selection-area-finalize.execution.mjs +0 -27
  363. package/esm2022/f-draggable/selection-area/selection-area-finalize/selection-area-finalize.request.mjs +0 -7
  364. package/esm2022/f-draggable/selection-area/selection-area-finalize/selection-area-finalize.validator.mjs +0 -26
  365. package/esm2022/f-draggable/selection-area/selection-area-preparation/index.mjs +0 -5
  366. package/esm2022/f-draggable/selection-area/selection-area-preparation/providers.mjs +0 -7
  367. package/esm2022/f-draggable/selection-area/selection-area-preparation/selection-area-preparation.execution.mjs +0 -41
  368. package/esm2022/f-draggable/selection-area/selection-area-preparation/selection-area-preparation.request.mjs +0 -7
  369. package/esm2022/f-draggable/selection-area/selection-area-preparation/selection-area-preparation.validator.mjs +0 -31
  370. package/esm2022/f-draggable/selection-area/selection-area.drag-handle.mjs +0 -57
  371. package/esm2022/f-node/is-node.mjs +0 -4
  372. package/esm2022/f-selection-area/domain/i-selection-area-rect.mjs +0 -2
  373. package/f-draggable/e-f-draggable-type.d.ts +0 -11
  374. package/f-draggable/external-item/providers.d.ts +0 -1
  375. package/f-draggable/selection-area/index.d.ts +0 -4
  376. package/f-draggable/selection-area/providers.d.ts +0 -1
  377. package/f-draggable/selection-area/selection-area-preparation/selection-area-preparation.request.d.ts +0 -5
  378. package/f-selection-area/domain/i-selection-area-rect.d.ts +0 -6
  379. /package/{f-draggable/external-item → f-external-item/domain}/external-item-finalize/external-item-finalize.request.d.ts +0 -0
  380. /package/{f-draggable/external-item → f-external-item/domain}/external-item-finalize/index.d.ts +0 -0
  381. /package/{f-draggable/external-item → f-external-item/domain}/external-item-finalize/providers.d.ts +0 -0
  382. /package/{f-draggable/external-item → f-external-item/domain}/external-item-preparation/external-item-preparation.request.d.ts +0 -0
  383. /package/{f-draggable/external-item → f-external-item/domain}/external-item-preparation/external-item-preparation.validator.d.ts +0 -0
  384. /package/{f-draggable/external-item → f-external-item/domain}/external-item-preparation/index.d.ts +0 -0
  385. /package/{f-draggable/external-item → f-external-item/domain}/external-item-preparation/providers.d.ts +0 -0
  386. /package/{f-draggable/external-item → f-external-item/domain}/f-create-node.event.d.ts +0 -0
  387. /package/{f-draggable/external-item → f-external-item/domain}/index.d.ts +0 -0
  388. /package/f-node/{is-node.d.ts → domain/is-node.d.ts} +0 -0
  389. /package/{f-draggable/selection-area → f-selection-area/domain}/selection-area-finalize/index.d.ts +0 -0
  390. /package/{f-draggable/selection-area → f-selection-area/domain}/selection-area-finalize/providers.d.ts +0 -0
  391. /package/{f-draggable/selection-area → f-selection-area/domain}/selection-area-finalize/selection-area-finalize.request.d.ts +0 -0
  392. /package/{f-draggable/selection-area → f-selection-area/domain}/selection-area-preparation/index.d.ts +0 -0
  393. /package/{f-draggable/selection-area → f-selection-area/domain}/selection-area-preparation/providers.d.ts +0 -0
@@ -1,6 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { InjectionToken, Component, ChangeDetectionStrategy, Input, Directive, Injectable, ContentChild, HostBinding, Inject, ViewChild, Optional, ContentChildren, EventEmitter, Output, NgZone, NgModule } from '@angular/core';
3
- import * as i1 from '@foblex/core';
3
+ import * as i3$1 from '@foblex/core';
4
4
  import { TransformModelExtensions, PointExtensions, SizeExtensions, DomElementExtensions, mixinChangePosition, mixinFitToParent, mixinOneToOneCentering, mixinChangeZoom, Point, RectExtensions, sanitizeElementId, LineExtensions, BooleanExtensions, MouseEventExtensions, EventExtensions, IMouseEvent, ITouchDownEvent, ITouchMoveEvent, ITouchUpEvent, Arc, Line, VectorExtensions } from '@foblex/core';
5
5
  import { Subscription, Subject, startWith, Observable, merge, debounceTime } from 'rxjs';
6
6
  import { __decorate } from 'tslib';
@@ -9,7 +9,7 @@ import { DOCUMENT, CommonModule } from '@angular/common';
9
9
 
10
10
  const F_BACKGROUND_PATTERN = new InjectionToken('F_BACKGROUND_PATTERN');
11
11
 
12
- let uniqueId$a = 0;
12
+ let uniqueId$b = 0;
13
13
  class FRectPatternComponent {
14
14
  elementReference;
15
15
  _subscription$ = new Subscription();
@@ -17,7 +17,7 @@ class FRectPatternComponent {
17
17
  get hostElement() {
18
18
  return this.elementReference.nativeElement;
19
19
  }
20
- id = `f-pattern-${uniqueId$a++}`;
20
+ id = `f-pattern-${uniqueId$b++}`;
21
21
  _vColor = 'rgba(0,0,0,0.1)';
22
22
  set vColor(value) {
23
23
  this._vColor = value;
@@ -126,7 +126,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
126
126
  type: Input
127
127
  }] } });
128
128
 
129
- let uniqueId$9 = 0;
129
+ let uniqueId$a = 0;
130
130
  class FCirclePatternComponent {
131
131
  elementReference;
132
132
  _subscription$ = new Subscription();
@@ -134,7 +134,7 @@ class FCirclePatternComponent {
134
134
  get hostElement() {
135
135
  return this.elementReference.nativeElement;
136
136
  }
137
- id = `f-pattern-${uniqueId$9++}`;
137
+ id = `f-pattern-${uniqueId$a++}`;
138
138
  _color = 'rgba(0,0,0,0.1)';
139
139
  set color(value) {
140
140
  this._color = value;
@@ -234,7 +234,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
234
234
  }] });
235
235
 
236
236
  class FComponentsStore {
237
- changes = new Subject();
237
+ componentsDataChanges = new Subject();
238
+ get componentsData$() {
239
+ return this.componentsDataChanges.asObservable();
240
+ }
241
+ componentsCountChanges = new Subject();
242
+ get componentsCount$() {
243
+ return this.componentsCountChanges.asObservable();
244
+ }
238
245
  get flowHost() {
239
246
  return this.fFlow?.hostElement;
240
247
  }
@@ -257,15 +264,18 @@ class FComponentsStore {
257
264
  }
258
265
  addComponent(collection, component) {
259
266
  collection.push(component);
260
- this.changes.next();
267
+ this.componentsCountChanges.next();
261
268
  }
262
269
  removeComponent(collection, component) {
263
270
  const index = collection.indexOf(component);
264
271
  if (index > -1) {
265
272
  collection.splice(index, 1);
266
- this.changes.next();
273
+ this.componentsCountChanges.next();
267
274
  }
268
275
  }
276
+ componentDataChanged() {
277
+ this.componentsDataChanges.next();
278
+ }
269
279
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: FComponentsStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
270
280
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: FComponentsStore });
271
281
  }
@@ -282,7 +292,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
282
292
  type: Injectable
283
293
  }] });
284
294
 
285
- let uniqueId$8 = 0;
295
+ let uniqueId$9 = 0;
286
296
  class FBackgroundComponent extends FBackgroundBase {
287
297
  elementReference;
288
298
  fComponentsStore;
@@ -303,7 +313,7 @@ class FBackgroundComponent extends FBackgroundBase {
303
313
  const pattern = children.length ? children[0] : undefined;
304
314
  if (pattern) {
305
315
  const defs = DomElementExtensions.createSvgElement('defs');
306
- pattern.id = 'f-background-marker-' + uniqueId$8++;
316
+ pattern.id = 'f-background-marker-' + uniqueId$9++;
307
317
  this.fBackgroundPattern?.hostElement.remove();
308
318
  defs.appendChild(pattern);
309
319
  this.hostElement?.firstChild?.appendChild(defs);
@@ -453,7 +463,6 @@ class FDraggableDataContext {
453
463
  onPointerDownScale = 1;
454
464
  onPointerDownPosition = new Point(0, 0);
455
465
  draggableItems = [];
456
- fSelectionArea;
457
466
  fLineAlignment;
458
467
  reset() {
459
468
  this.draggableItems = [];
@@ -476,9 +485,7 @@ let CanvasMoveFinalizeExecution = class CanvasMoveFinalizeExecution {
476
485
  this.fDraggableDataContext = fDraggableDataContext;
477
486
  }
478
487
  handle(request) {
479
- this.fDraggableDataContext.draggableItems.forEach((x) => {
480
- x.complete?.();
481
- });
488
+ this.fDraggableDataContext.draggableItems.forEach((x) => x.complete?.());
482
489
  }
483
490
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: CanvasMoveFinalizeExecution, deps: [{ token: FDraggableDataContext }], target: i0.ɵɵFactoryTarget.Injectable });
484
491
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: CanvasMoveFinalizeExecution });
@@ -490,18 +497,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
490
497
  type: Injectable
491
498
  }], ctorParameters: () => [{ type: FDraggableDataContext }] });
492
499
 
493
- var EFDraggableType;
494
- (function (EFDraggableType) {
495
- EFDraggableType["NODE"] = "node";
496
- EFDraggableType["NODE_RESIZE"] = "node-resize";
497
- EFDraggableType["REASSIGN_CONNECTION"] = "reassign-connection";
498
- EFDraggableType["CREATE_CONNECTION"] = "create-connection";
499
- EFDraggableType["CONNECTION"] = "connection";
500
- EFDraggableType["MINI_MAP"] = "minimap";
501
- EFDraggableType["CANVAS"] = "canvas";
502
- EFDraggableType["PALETTE_ITEM"] = "palette-item";
503
- EFDraggableType["SELECTION"] = "selection";
504
- })(EFDraggableType || (EFDraggableType = {}));
500
+ class CanvasDragHandler {
501
+ fComponentsStore;
502
+ onPointerDownPosition = PointExtensions.initialize();
503
+ constructor(fComponentsStore) {
504
+ this.fComponentsStore = fComponentsStore;
505
+ }
506
+ initialize() {
507
+ this.onPointerDownPosition = this.fComponentsStore.fCanvas.transform.position;
508
+ }
509
+ move(difference) {
510
+ this.fComponentsStore.fCanvas.setPosition(Point.fromPoint(this.onPointerDownPosition).add(difference));
511
+ this.fComponentsStore.fCanvas.redraw();
512
+ }
513
+ complete() {
514
+ this.fComponentsStore.fCanvas.completeDrag();
515
+ }
516
+ }
505
517
 
506
518
  let CanvasMoveFinalizeValidator = class CanvasMoveFinalizeValidator {
507
519
  fDraggableDataContext;
@@ -509,7 +521,7 @@ let CanvasMoveFinalizeValidator = class CanvasMoveFinalizeValidator {
509
521
  this.fDraggableDataContext = fDraggableDataContext;
510
522
  }
511
523
  handle(request) {
512
- return this.fDraggableDataContext.draggableItems.some((x) => x.type === EFDraggableType.CANVAS);
524
+ return this.fDraggableDataContext.draggableItems.some((x) => x instanceof CanvasDragHandler);
513
525
  }
514
526
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: CanvasMoveFinalizeValidator, deps: [{ token: FDraggableDataContext }], target: i0.ɵɵFactoryTarget.Injectable });
515
527
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: CanvasMoveFinalizeValidator });
@@ -533,25 +545,6 @@ class CanvasMovePreparationRequest {
533
545
  }
534
546
  }
535
547
 
536
- class CanvasDragHandler {
537
- fComponentsStore;
538
- type = EFDraggableType.CANVAS;
539
- onPointerDownPosition = PointExtensions.initialize();
540
- constructor(fComponentsStore) {
541
- this.fComponentsStore = fComponentsStore;
542
- }
543
- initialize() {
544
- this.onPointerDownPosition = this.fComponentsStore.fCanvas.transform.position;
545
- }
546
- move(difference) {
547
- this.fComponentsStore.fCanvas.setPosition(Point.fromPoint(this.onPointerDownPosition).add(difference));
548
- this.fComponentsStore.fCanvas.redraw();
549
- }
550
- complete() {
551
- this.fComponentsStore.fCanvas.completeDrag();
552
- }
553
- }
554
-
555
548
  let CanvasMovePreparationExecution = class CanvasMovePreparationExecution {
556
549
  fComponentsStore;
557
550
  fDraggableDataContext;
@@ -602,11 +595,15 @@ let CanvasMovePreparationValidator = class CanvasMovePreparationValidator {
602
595
  }
603
596
  getNode(targetElement) {
604
597
  let result = this.fComponentsStore.findNode(targetElement);
598
+ // if (result && result.fDraggingDisabled || !this.isNodeHasDragHandle(targetElement)) {
605
599
  if (result && result.fDraggingDisabled) {
606
600
  result = undefined;
607
601
  }
608
602
  return result;
609
603
  }
604
+ isNodeHasDragHandle(targetElement) {
605
+ return isElementWithClass(targetElement, '.f-drag-handle');
606
+ }
610
607
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: CanvasMovePreparationValidator, deps: [{ token: FComponentsStore }, { token: FDraggableDataContext }], target: i0.ɵɵFactoryTarget.Injectable });
611
608
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: CanvasMovePreparationValidator });
612
609
  };
@@ -711,6 +708,14 @@ function isNodeInput(element) {
711
708
  return !!element.closest('[fNodeInput]');
712
709
  }
713
710
 
711
+ function isGroup(element) {
712
+ return !!element.closest('[fGroup]');
713
+ }
714
+
715
+ function isNode(element) {
716
+ return !!element.closest('[fNode]');
717
+ }
718
+
714
719
  const F_DRAG_HANDLE = new InjectionToken('F_DRAG_HANDLE');
715
720
  class FDragHandleDirective {
716
721
  elementReference;
@@ -903,7 +908,7 @@ class FBezierPathBuilder {
903
908
  const targetAnglePoint = FBezierPathBuilder.getAnglePoint(targetSide, target, source, offset);
904
909
  const path = `M ${source.x} ${source.y} C ${sourceAnglePoint.x} ${sourceAnglePoint.y}, ${targetAnglePoint.x} ${targetAnglePoint.y}, ${target.x + 0.0002} ${target.y + 0.0002}`;
905
910
  const connectionCenter = new CalculateConnectionCenterHandler().handle(new CalculateConnectionCenterRequest([source, sourceAnglePoint, targetAnglePoint, target]));
906
- return { path, connectionCenter };
911
+ return { path, connectionCenter, penultimatePoint: targetAnglePoint };
907
912
  }
908
913
  }
909
914
 
@@ -919,7 +924,8 @@ class FSegmentPathBuilder {
919
924
  const { source, sourceSide, target, targetSide } = request;
920
925
  const { points, center } = this.getPathPoints(source, sourceSide, target, targetSide, request.offset);
921
926
  const path = this.buildPath(points, request.radius);
922
- return { path, connectionCenter: center };
927
+ const penultimatePoint = points.length > 1 ? points[points.length - 2] : source;
928
+ return { path, connectionCenter: center, penultimatePoint };
923
929
  }
924
930
  getPathPoints(source, sourceSide, target, targetSide, offset) {
925
931
  const sourceDirection = CONNECTOR_SIDE_POINT[sourceSide];
@@ -1049,7 +1055,7 @@ class FStraightPathBuilder {
1049
1055
  const { source, target } = request;
1050
1056
  const path = `M ${source.x} ${source.y} L ${target.x + 0.0002} ${target.y + 0.0002}`;
1051
1057
  const connectionCenter = new CalculateConnectionCenterHandler().handle(new CalculateConnectionCenterRequest([source, target]));
1052
- return { path, connectionCenter };
1058
+ return { path, connectionCenter, penultimatePoint: source };
1053
1059
  }
1054
1060
  }
1055
1061
 
@@ -1080,7 +1086,7 @@ class FConnectionTextPathDirective {
1080
1086
  elementReference;
1081
1087
  base;
1082
1088
  get linkToConnection() {
1083
- return F_CONNECTION_IDENTIFIERS.linkToConnection(this.base.fConnectionId + this.base.fOutputId + this.base.fInputId);
1089
+ return F_CONNECTION_IDENTIFIERS.linkToConnection(this.base.fId + this.base.fOutputId + this.base.fInputId);
1084
1090
  }
1085
1091
  get hostElement() {
1086
1092
  return this.elementReference.nativeElement;
@@ -1142,7 +1148,7 @@ class FConnectionTextComponent {
1142
1148
  elementReference;
1143
1149
  base;
1144
1150
  get textId() {
1145
- return F_CONNECTION_IDENTIFIERS.textId(this.base.fConnectionId + this.base.fOutputId + this.base.fInputId);
1151
+ return F_CONNECTION_IDENTIFIERS.textId(this.base.fId + this.base.fOutputId + this.base.fInputId);
1146
1152
  }
1147
1153
  get hostElement() {
1148
1154
  return this.elementReference.nativeElement;
@@ -1209,8 +1215,8 @@ class FConnectionDragHandleComponent {
1209
1215
  constructor(elementReference) {
1210
1216
  this.elementReference = elementReference;
1211
1217
  }
1212
- redraw(start, end) {
1213
- const point = this.calculateCircleCenter(start, end, 8);
1218
+ redraw(penultimatePoint, endPoint) {
1219
+ const point = this.calculateCircleCenter(penultimatePoint, endPoint, 8);
1214
1220
  this.hostElement.setAttribute('cx', point.x.toString());
1215
1221
  this.hostElement.setAttribute('cy', point.y.toString());
1216
1222
  }
@@ -1242,7 +1248,7 @@ class FConnectionGradientComponent {
1242
1248
  elementReference;
1243
1249
  base;
1244
1250
  get gradientId() {
1245
- return F_CONNECTION_IDENTIFIERS.gradientId(this.base.fConnectionId + this.base.fOutputId + this.base.fInputId);
1251
+ return F_CONNECTION_IDENTIFIERS.gradientId(this.base.fId + this.base.fOutputId + this.base.fInputId);
1246
1252
  }
1247
1253
  get hostElement() {
1248
1254
  return this.elementReference.nativeElement;
@@ -1317,13 +1323,13 @@ class FConnectionPathComponent {
1317
1323
  elementReference;
1318
1324
  base;
1319
1325
  get fPathId() {
1320
- return this.base.fConnectionId;
1326
+ return this.base.fId;
1321
1327
  }
1322
1328
  get linkToGradient() {
1323
- return F_CONNECTION_IDENTIFIERS.linkToGradient(this.base.fConnectionId + this.base.fOutputId + this.base.fInputId);
1329
+ return F_CONNECTION_IDENTIFIERS.linkToGradient(this.base.fId + this.base.fOutputId + this.base.fInputId);
1324
1330
  }
1325
1331
  get attrConnectionId() {
1326
- return F_CONNECTION_IDENTIFIERS.connectionId(this.base.fConnectionId + this.base.fOutputId + this.base.fInputId);
1332
+ return F_CONNECTION_IDENTIFIERS.connectionId(this.base.fId + this.base.fOutputId + this.base.fInputId);
1327
1333
  }
1328
1334
  get hostElement() {
1329
1335
  return this.elementReference.nativeElement;
@@ -1339,12 +1345,12 @@ class FConnectionPathComponent {
1339
1345
  this.hostElement.setAttribute("d", `${path}`);
1340
1346
  }
1341
1347
  select() {
1342
- this.hostElement.setAttribute('marker-start', `url(#${getMarkerSelectedStartId(this.base.fConnectionId)})`);
1343
- this.hostElement.setAttribute('marker-end', `url(#${getMarkerSelectedEndId(this.base.fConnectionId)})`);
1348
+ this.hostElement.setAttribute('marker-start', `url(#${getMarkerSelectedStartId(this.base.fId)})`);
1349
+ this.hostElement.setAttribute('marker-end', `url(#${getMarkerSelectedEndId(this.base.fId)})`);
1344
1350
  }
1345
1351
  deselect() {
1346
- this.hostElement.setAttribute('marker-start', `url(#${getMarkerStartId(this.base.fConnectionId)})`);
1347
- this.hostElement.setAttribute('marker-end', `url(#${getMarkerEndId(this.base.fConnectionId)})`);
1352
+ this.hostElement.setAttribute('marker-start', `url(#${getMarkerStartId(this.base.fId)})`);
1353
+ this.hostElement.setAttribute('marker-end', `url(#${getMarkerEndId(this.base.fId)})`);
1348
1354
  }
1349
1355
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: FConnectionPathComponent, deps: [{ token: i0.ElementRef }, { token: F_CONNECTION }], target: i0.ɵɵFactoryTarget.Component });
1350
1356
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.0", type: FConnectionPathComponent, selector: "path[f-connection-path]", host: { properties: { "attr.id": "attrConnectionId", "attr.data-f-path-id": "fPathId", "attr.stroke": "linkToGradient" }, classAttribute: "f-component f-connection-path" }, providers: [{ provide: CONNECTION_PATH, useExisting: FConnectionPathComponent }], ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
@@ -1372,7 +1378,7 @@ class FConnectionSelectionComponent {
1372
1378
  elementReference;
1373
1379
  base;
1374
1380
  get connectionForSelectionId() {
1375
- return F_CONNECTION_IDENTIFIERS.connectionForSelectionId(this.base.fConnectionId + this.base.fOutputId + this.base.fInputId);
1381
+ return F_CONNECTION_IDENTIFIERS.connectionForSelectionId(this.base.fId + this.base.fOutputId + this.base.fInputId);
1376
1382
  }
1377
1383
  get hostElement() {
1378
1384
  return this.elementReference.nativeElement;
@@ -1406,6 +1412,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
1406
1412
  const F_SELECTED_CLASS = 'f-selected';
1407
1413
  function mixinChangeConnectionSelection(base) {
1408
1414
  return class extends base {
1415
+ fId = '';
1409
1416
  fSelectionDisabled = false;
1410
1417
  fPath;
1411
1418
  deselect() {
@@ -1484,6 +1491,7 @@ class FConnectionBase extends MIXIN_BASE {
1484
1491
  path = '';
1485
1492
  line = LineExtensions.initialize();
1486
1493
  stateChanges = new Subject();
1494
+ penultimatePoint = PointExtensions.initialize();
1487
1495
  constructor(elementReference, cFactory) {
1488
1496
  super(elementReference.nativeElement);
1489
1497
  this.cFactory = cFactory;
@@ -1500,6 +1508,7 @@ class FConnectionBase extends MIXIN_BASE {
1500
1508
  this.line = LineExtensions.initialize(source, target);
1501
1509
  const pathResult = this.getPathResult(source, sourceSide, target, targetSide);
1502
1510
  this.path = pathResult.path;
1511
+ this.penultimatePoint = pathResult.penultimatePoint || source;
1503
1512
  this.fConnectionCenter?.nativeElement?.setAttribute('style', this.getTransform(pathResult.connectionCenter));
1504
1513
  }
1505
1514
  getPathResult(source, sourceSide, target, targetSide) {
@@ -1517,7 +1526,7 @@ class FConnectionBase extends MIXIN_BASE {
1517
1526
  this.fPath.setPath(this.path);
1518
1527
  this.fSelection.setPath(this.path);
1519
1528
  this.fGradient.redraw(this.line);
1520
- this.fDragHandle.redraw(this.line.point1, this.line.point2);
1529
+ this.fDragHandle.redraw(this.penultimatePoint, this.line.point2);
1521
1530
  this.fTextComponent.redraw(this.line);
1522
1531
  }
1523
1532
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: FConnectionBase, deps: [{ token: i0.ElementRef }, { token: FConnectionFactory }], target: i0.ɵɵFactoryTarget.Directive });
@@ -1552,15 +1561,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
1552
1561
  }]
1553
1562
  }] });
1554
1563
 
1555
- let uniqueId$7 = 0;
1564
+ let uniqueId$8 = 0;
1556
1565
  class FConnectionForCreateComponent extends FConnectionBase {
1557
1566
  fComponentsStore;
1558
- fConnectionId = `f-connection-for-create-${uniqueId$7++}`;
1567
+ fId = `f-connection-for-create-${uniqueId$8++}`;
1559
1568
  fText = '';
1560
1569
  _fStartColor = 'black';
1561
1570
  set fStartColor(value) {
1562
1571
  this._fStartColor = value;
1563
- this.fComponentsStore.changes.next();
1572
+ this.fComponentsStore.componentDataChanged();
1564
1573
  }
1565
1574
  get fStartColor() {
1566
1575
  return this._fStartColor;
@@ -1568,7 +1577,7 @@ class FConnectionForCreateComponent extends FConnectionBase {
1568
1577
  _fEndColor = 'black';
1569
1578
  set fEndColor(value) {
1570
1579
  this._fEndColor = value;
1571
- this.fComponentsStore.changes.next();
1580
+ this.fComponentsStore.componentDataChanged();
1572
1581
  }
1573
1582
  get fEndColor() {
1574
1583
  return this._fEndColor;
@@ -1578,7 +1587,7 @@ class FConnectionForCreateComponent extends FConnectionBase {
1578
1587
  _fRadius = 8;
1579
1588
  set fRadius(value) {
1580
1589
  this._fRadius = value;
1581
- this.fComponentsStore.changes.next();
1590
+ this.fComponentsStore.componentDataChanged();
1582
1591
  }
1583
1592
  get fRadius() {
1584
1593
  return this._fRadius;
@@ -1586,7 +1595,7 @@ class FConnectionForCreateComponent extends FConnectionBase {
1586
1595
  _fOffset = 32;
1587
1596
  set fOffset(value) {
1588
1597
  this._fOffset = value;
1589
- this.fComponentsStore.changes.next();
1598
+ this.fComponentsStore.componentDataChanged();
1590
1599
  }
1591
1600
  get fOffset() {
1592
1601
  return this._fOffset;
@@ -1594,7 +1603,7 @@ class FConnectionForCreateComponent extends FConnectionBase {
1594
1603
  _behavior = EFConnectionBehavior.FIXED;
1595
1604
  set fBehavior(value) {
1596
1605
  this._behavior = castToEnum(value, 'fBehavior', EFConnectionBehavior);
1597
- this.fComponentsStore.changes.next();
1606
+ this.fComponentsStore.componentDataChanged();
1598
1607
  }
1599
1608
  get fBehavior() {
1600
1609
  return this._behavior;
@@ -1602,7 +1611,7 @@ class FConnectionForCreateComponent extends FConnectionBase {
1602
1611
  _type = EFConnectionType.STRAIGHT;
1603
1612
  set fType(value) {
1604
1613
  this._type = castToEnum(value, 'fType', EFConnectionType);
1605
- this.fComponentsStore.changes.next();
1614
+ this.fComponentsStore.componentDataChanged();
1606
1615
  }
1607
1616
  get fType() {
1608
1617
  return this._type;
@@ -1639,14 +1648,17 @@ class FConnectionForCreateComponent extends FConnectionBase {
1639
1648
  this.fComponentsStore.fTempConnection = undefined;
1640
1649
  }
1641
1650
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: FConnectionForCreateComponent, deps: [{ token: i0.ElementRef }, { token: FConnectionFactory }, { token: FComponentsStore }], target: i0.ɵɵFactoryTarget.Component });
1642
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.0", type: FConnectionForCreateComponent, selector: "f-connection-for-create", inputs: { fStartColor: "fStartColor", fEndColor: "fEndColor", fRadius: "fRadius", fOffset: "fOffset", fBehavior: "fBehavior", fType: "fType" }, host: { classAttribute: "f-component f-connection f-connection-for-create" }, providers: [{ provide: F_CONNECTION, useExisting: FConnectionForCreateComponent }], queries: [{ propertyName: "fConnectionCenters", predicate: FConnectionCenterDirective, descendants: true }], viewQueries: [{ propertyName: "fDefs", first: true, predicate: ["defs"], descendants: true, static: true }, { propertyName: "fPath", first: true, predicate: CONNECTION_PATH, descendants: true, static: true }, { propertyName: "fGradient", first: true, predicate: CONNECTION_GRADIENT, descendants: true, static: true }, { propertyName: "fDragHandle", first: true, predicate: FConnectionDragHandleComponent, descendants: true, static: true }, { propertyName: "fSelection", first: true, predicate: FConnectionSelectionComponent, descendants: true, static: true }, { propertyName: "fTextComponent", first: true, predicate: CONNECTION_TEXT, descendants: true, static: true }, { propertyName: "fConnectionCenter", first: true, predicate: ["fConnectionCenter"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<svg xmlns=\"http://www.w3.org/2000/svg\">\n <defs #defs></defs>\n <g class=\"f-connection-group\">\n <linearGradient fConnectionGradient></linearGradient>\n <path fConnectionSelection [attr.d]=\"path\"></path>\n <g>\n <path f-connection-path\n [attr.d]=\"path\">\n </path>\n <circle f-connection-drag-handle r=\"8\"></circle>\n </g>\n <text f-connection-text></text>\n </g>\n <ng-content></ng-content>\n</svg>\n<div #fConnectionCenter class=\"f-connection-center\" *ngIf=\"fConnectionCenters.length\">\n <ng-content select=\"[fConnectionCenter]\"></ng-content>\n</div>\n", styles: [":host{pointer-events:none;position:absolute}:host svg{overflow:visible}:host svg .f-connection-group{pointer-events:all}\n"], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: FConnectionTextComponent, selector: "text[f-connection-text]" }, { kind: "component", type: FConnectionDragHandleComponent, selector: "circle[f-connection-drag-handle]" }, { kind: "component", type: FConnectionGradientComponent, selector: "linearGradient[fConnectionGradient]" }, { kind: "component", type: FConnectionPathComponent, selector: "path[f-connection-path]" }, { kind: "component", type: FConnectionSelectionComponent, selector: "path[fConnectionSelection]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1651
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.0", type: FConnectionForCreateComponent, selector: "f-connection-for-create", inputs: { fId: ["fConnectionId", "fId"], fStartColor: "fStartColor", fEndColor: "fEndColor", fRadius: "fRadius", fOffset: "fOffset", fBehavior: "fBehavior", fType: "fType" }, host: { classAttribute: "f-component f-connection f-connection-for-create" }, providers: [{ provide: F_CONNECTION, useExisting: FConnectionForCreateComponent }], queries: [{ propertyName: "fConnectionCenters", predicate: FConnectionCenterDirective, descendants: true }], viewQueries: [{ propertyName: "fDefs", first: true, predicate: ["defs"], descendants: true, static: true }, { propertyName: "fPath", first: true, predicate: CONNECTION_PATH, descendants: true, static: true }, { propertyName: "fGradient", first: true, predicate: CONNECTION_GRADIENT, descendants: true, static: true }, { propertyName: "fDragHandle", first: true, predicate: FConnectionDragHandleComponent, descendants: true, static: true }, { propertyName: "fSelection", first: true, predicate: FConnectionSelectionComponent, descendants: true, static: true }, { propertyName: "fTextComponent", first: true, predicate: CONNECTION_TEXT, descendants: true, static: true }, { propertyName: "fConnectionCenter", first: true, predicate: ["fConnectionCenter"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<svg xmlns=\"http://www.w3.org/2000/svg\">\n <defs #defs></defs>\n <g class=\"f-connection-group\">\n <linearGradient fConnectionGradient></linearGradient>\n <path fConnectionSelection [attr.d]=\"path\"></path>\n <g>\n <path f-connection-path\n [attr.d]=\"path\">\n </path>\n <circle f-connection-drag-handle r=\"8\"></circle>\n </g>\n <text f-connection-text></text>\n </g>\n <ng-content></ng-content>\n</svg>\n<div #fConnectionCenter class=\"f-connection-center\" *ngIf=\"fConnectionCenters.length\">\n <ng-content select=\"[fConnectionCenter]\"></ng-content>\n</div>\n", styles: [":host{pointer-events:none;position:absolute}:host svg{overflow:visible}:host svg .f-connection-group{pointer-events:all}\n"], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: FConnectionTextComponent, selector: "text[f-connection-text]" }, { kind: "component", type: FConnectionDragHandleComponent, selector: "circle[f-connection-drag-handle]" }, { kind: "component", type: FConnectionGradientComponent, selector: "linearGradient[fConnectionGradient]" }, { kind: "component", type: FConnectionPathComponent, selector: "path[f-connection-path]" }, { kind: "component", type: FConnectionSelectionComponent, selector: "path[fConnectionSelection]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1643
1652
  }
1644
1653
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: FConnectionForCreateComponent, decorators: [{
1645
1654
  type: Component,
1646
1655
  args: [{ selector: "f-connection-for-create", changeDetection: ChangeDetectionStrategy.OnPush, host: {
1647
1656
  class: "f-component f-connection f-connection-for-create"
1648
1657
  }, providers: [{ provide: F_CONNECTION, useExisting: FConnectionForCreateComponent }], template: "<svg xmlns=\"http://www.w3.org/2000/svg\">\n <defs #defs></defs>\n <g class=\"f-connection-group\">\n <linearGradient fConnectionGradient></linearGradient>\n <path fConnectionSelection [attr.d]=\"path\"></path>\n <g>\n <path f-connection-path\n [attr.d]=\"path\">\n </path>\n <circle f-connection-drag-handle r=\"8\"></circle>\n </g>\n <text f-connection-text></text>\n </g>\n <ng-content></ng-content>\n</svg>\n<div #fConnectionCenter class=\"f-connection-center\" *ngIf=\"fConnectionCenters.length\">\n <ng-content select=\"[fConnectionCenter]\"></ng-content>\n</div>\n", styles: [":host{pointer-events:none;position:absolute}:host svg{overflow:visible}:host svg .f-connection-group{pointer-events:all}\n"] }]
1649
- }], ctorParameters: () => [{ type: i0.ElementRef }, { type: FConnectionFactory }, { type: FComponentsStore }], propDecorators: { fStartColor: [{
1658
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: FConnectionFactory }, { type: FComponentsStore }], propDecorators: { fId: [{
1659
+ type: Input,
1660
+ args: ['fConnectionId']
1661
+ }], fStartColor: [{
1650
1662
  type: Input
1651
1663
  }], fEndColor: [{
1652
1664
  type: Input
@@ -1684,14 +1696,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
1684
1696
  args: [FConnectionCenterDirective, { descendants: true }]
1685
1697
  }] } });
1686
1698
 
1687
- let uniqueId$6 = 0;
1699
+ let uniqueId$7 = 0;
1688
1700
  class FConnectionComponent extends FConnectionBase {
1689
1701
  fComponentsStore;
1690
- fConnectionId = `f-connection-${uniqueId$6++}`;
1702
+ fId = `f-connection-${uniqueId$7++}`;
1691
1703
  _fText = '';
1692
1704
  set fText(value) {
1693
1705
  this._fText = value;
1694
- this.fComponentsStore.changes.next();
1706
+ this.fComponentsStore.componentDataChanged();
1695
1707
  }
1696
1708
  get fText() {
1697
1709
  return this._fText;
@@ -1699,7 +1711,7 @@ class FConnectionComponent extends FConnectionBase {
1699
1711
  _fStartColor = 'black';
1700
1712
  set fStartColor(value) {
1701
1713
  this._fStartColor = value;
1702
- this.fComponentsStore.changes.next();
1714
+ this.fComponentsStore.componentDataChanged();
1703
1715
  }
1704
1716
  get fStartColor() {
1705
1717
  return this._fStartColor;
@@ -1707,7 +1719,7 @@ class FConnectionComponent extends FConnectionBase {
1707
1719
  _fEndColor = 'black';
1708
1720
  set fEndColor(value) {
1709
1721
  this._fEndColor = value;
1710
- this.fComponentsStore.changes.next();
1722
+ this.fComponentsStore.componentDataChanged();
1711
1723
  }
1712
1724
  get fEndColor() {
1713
1725
  return this._fEndColor;
@@ -1715,7 +1727,7 @@ class FConnectionComponent extends FConnectionBase {
1715
1727
  _fOutputId;
1716
1728
  set fOutputId(value) {
1717
1729
  this._fOutputId = value;
1718
- this.fComponentsStore.changes.next();
1730
+ this.fComponentsStore.componentDataChanged();
1719
1731
  }
1720
1732
  get fOutputId() {
1721
1733
  return this._fOutputId;
@@ -1723,7 +1735,7 @@ class FConnectionComponent extends FConnectionBase {
1723
1735
  _fInputId;
1724
1736
  set fInputId(value) {
1725
1737
  this._fInputId = value;
1726
- this.fComponentsStore.changes.next();
1738
+ this.fComponentsStore.componentDataChanged();
1727
1739
  }
1728
1740
  get fInputId() {
1729
1741
  return this._fInputId;
@@ -1731,7 +1743,7 @@ class FConnectionComponent extends FConnectionBase {
1731
1743
  _fRadius = 8;
1732
1744
  set fRadius(value) {
1733
1745
  this._fRadius = value;
1734
- this.fComponentsStore.changes.next();
1746
+ this.fComponentsStore.componentDataChanged();
1735
1747
  }
1736
1748
  get fRadius() {
1737
1749
  return this._fRadius;
@@ -1739,7 +1751,7 @@ class FConnectionComponent extends FConnectionBase {
1739
1751
  _fOffset = 32;
1740
1752
  set fOffset(value) {
1741
1753
  this._fOffset = value;
1742
- this.fComponentsStore.changes.next();
1754
+ this.fComponentsStore.componentDataChanged();
1743
1755
  }
1744
1756
  get fOffset() {
1745
1757
  return this._fOffset;
@@ -1747,7 +1759,7 @@ class FConnectionComponent extends FConnectionBase {
1747
1759
  _behavior = EFConnectionBehavior.FIXED;
1748
1760
  set fBehavior(value) {
1749
1761
  this._behavior = castToEnum(value, 'fBehavior', EFConnectionBehavior);
1750
- this.fComponentsStore.changes.next();
1762
+ this.fComponentsStore.componentDataChanged();
1751
1763
  }
1752
1764
  get fBehavior() {
1753
1765
  return this._behavior;
@@ -1755,7 +1767,7 @@ class FConnectionComponent extends FConnectionBase {
1755
1767
  _type = EFConnectionType.STRAIGHT;
1756
1768
  set fType(value) {
1757
1769
  this._type = value; //castToEnum(value, 'fType', EFConnectionType);
1758
- this.fComponentsStore.changes.next();
1770
+ this.fComponentsStore.componentDataChanged();
1759
1771
  }
1760
1772
  get fType() {
1761
1773
  return this._type;
@@ -1789,18 +1801,19 @@ class FConnectionComponent extends FConnectionBase {
1789
1801
  this.fComponentsStore.removeComponent(this.fComponentsStore.fConnections, this);
1790
1802
  }
1791
1803
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: FConnectionComponent, deps: [{ token: i0.ElementRef }, { token: FConnectionFactory }, { token: FComponentsStore }], target: i0.ɵɵFactoryTarget.Component });
1792
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.0", type: FConnectionComponent, selector: "f-connection", inputs: { fConnectionId: "fConnectionId", fText: "fText", fStartColor: "fStartColor", fEndColor: "fEndColor", fOutputId: "fOutputId", fInputId: "fInputId", fRadius: "fRadius", fOffset: "fOffset", fBehavior: "fBehavior", fType: "fType", fDraggingDisabled: ["fReassignDisabled", "fDraggingDisabled"], fSelectionDisabled: "fSelectionDisabled" }, host: { properties: { "attr.id": "fConnectionId", "class.f-connection-selection-disabled": "fSelectionDisabled", "class.f-connection-reassign-disabled": "fDraggingDisabled" }, classAttribute: "f-component f-connection" }, providers: [{ provide: F_CONNECTION, useExisting: FConnectionComponent }], queries: [{ propertyName: "fConnectionCenters", predicate: FConnectionCenterDirective, descendants: true }], viewQueries: [{ propertyName: "fDefs", first: true, predicate: ["defs"], descendants: true, static: true }, { propertyName: "fPath", first: true, predicate: CONNECTION_PATH, descendants: true, static: true }, { propertyName: "fGradient", first: true, predicate: CONNECTION_GRADIENT, descendants: true, static: true }, { propertyName: "fDragHandle", first: true, predicate: FConnectionDragHandleComponent, descendants: true, static: true }, { propertyName: "fSelection", first: true, predicate: FConnectionSelectionComponent, descendants: true, static: true }, { propertyName: "fTextComponent", first: true, predicate: CONNECTION_TEXT, descendants: true, static: true }, { propertyName: "fConnectionCenter", first: true, predicate: ["fConnectionCenter"], descendants: true }], exportAs: ["fComponent"], usesInheritance: true, ngImport: i0, template: "<svg xmlns=\"http://www.w3.org/2000/svg\" style=\"overflow: visible; display: block; vertical-align: middle;\">\n <defs #defs></defs>\n <ng-content></ng-content>\n <g class=\"f-connection-group\">\n <linearGradient fConnectionGradient></linearGradient>\n <path fConnectionSelection [attr.d]=\"path\"></path>\n <g>\n <path f-connection-path [attr.d]=\"path\"></path>\n <circle f-connection-drag-handle r=\"8\"></circle>\n </g>\n <text f-connection-text></text>\n </g>\n</svg>\n<div #fConnectionCenter class=\"f-connection-center\" *ngIf=\"fConnectionCenters.length\">\n <ng-content select=\"[fConnectionCenter]\"></ng-content>\n</div>\n", styles: [":host{pointer-events:none;position:absolute}:host svg{overflow:visible}:host svg .f-connection-group{pointer-events:all}:host .f-connection-center{pointer-events:all}\n"], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: FConnectionTextComponent, selector: "text[f-connection-text]" }, { kind: "component", type: FConnectionDragHandleComponent, selector: "circle[f-connection-drag-handle]" }, { kind: "component", type: FConnectionGradientComponent, selector: "linearGradient[fConnectionGradient]" }, { kind: "component", type: FConnectionPathComponent, selector: "path[f-connection-path]" }, { kind: "component", type: FConnectionSelectionComponent, selector: "path[fConnectionSelection]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1804
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.0", type: FConnectionComponent, selector: "f-connection", inputs: { fId: ["fConnectionId", "fId"], fText: "fText", fStartColor: "fStartColor", fEndColor: "fEndColor", fOutputId: "fOutputId", fInputId: "fInputId", fRadius: "fRadius", fOffset: "fOffset", fBehavior: "fBehavior", fType: "fType", fDraggingDisabled: ["fReassignDisabled", "fDraggingDisabled"], fSelectionDisabled: "fSelectionDisabled" }, host: { properties: { "attr.id": "fId", "class.f-connection-selection-disabled": "fSelectionDisabled", "class.f-connection-reassign-disabled": "fDraggingDisabled" }, classAttribute: "f-component f-connection" }, providers: [{ provide: F_CONNECTION, useExisting: FConnectionComponent }], queries: [{ propertyName: "fConnectionCenters", predicate: FConnectionCenterDirective, descendants: true }], viewQueries: [{ propertyName: "fDefs", first: true, predicate: ["defs"], descendants: true, static: true }, { propertyName: "fPath", first: true, predicate: CONNECTION_PATH, descendants: true, static: true }, { propertyName: "fGradient", first: true, predicate: CONNECTION_GRADIENT, descendants: true, static: true }, { propertyName: "fDragHandle", first: true, predicate: FConnectionDragHandleComponent, descendants: true, static: true }, { propertyName: "fSelection", first: true, predicate: FConnectionSelectionComponent, descendants: true, static: true }, { propertyName: "fTextComponent", first: true, predicate: CONNECTION_TEXT, descendants: true, static: true }, { propertyName: "fConnectionCenter", first: true, predicate: ["fConnectionCenter"], descendants: true }], exportAs: ["fComponent"], usesInheritance: true, ngImport: i0, template: "<svg xmlns=\"http://www.w3.org/2000/svg\" style=\"overflow: visible; display: block; vertical-align: middle;\">\n <defs #defs></defs>\n <ng-content></ng-content>\n <g class=\"f-connection-group\">\n <linearGradient fConnectionGradient></linearGradient>\n <path fConnectionSelection [attr.d]=\"path\"></path>\n <g>\n <path f-connection-path [attr.d]=\"path\"></path>\n <circle f-connection-drag-handle r=\"8\"></circle>\n </g>\n <text f-connection-text></text>\n </g>\n</svg>\n<div #fConnectionCenter class=\"f-connection-center\" *ngIf=\"fConnectionCenters.length\">\n <ng-content select=\"[fConnectionCenter]\"></ng-content>\n</div>\n", styles: [":host{pointer-events:none;position:absolute}:host svg{overflow:visible}:host svg .f-connection-group{pointer-events:all}:host .f-connection-center{pointer-events:all}\n"], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: FConnectionTextComponent, selector: "text[f-connection-text]" }, { kind: "component", type: FConnectionDragHandleComponent, selector: "circle[f-connection-drag-handle]" }, { kind: "component", type: FConnectionGradientComponent, selector: "linearGradient[fConnectionGradient]" }, { kind: "component", type: FConnectionPathComponent, selector: "path[f-connection-path]" }, { kind: "component", type: FConnectionSelectionComponent, selector: "path[fConnectionSelection]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1793
1805
  }
1794
1806
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: FConnectionComponent, decorators: [{
1795
1807
  type: Component,
1796
1808
  args: [{ selector: "f-connection", exportAs: 'fComponent', changeDetection: ChangeDetectionStrategy.OnPush, host: {
1797
- '[attr.id]': 'fConnectionId',
1809
+ '[attr.id]': 'fId',
1798
1810
  class: "f-component f-connection",
1799
1811
  '[class.f-connection-selection-disabled]': 'fSelectionDisabled',
1800
1812
  '[class.f-connection-reassign-disabled]': 'fDraggingDisabled',
1801
1813
  }, providers: [{ provide: F_CONNECTION, useExisting: FConnectionComponent }], template: "<svg xmlns=\"http://www.w3.org/2000/svg\" style=\"overflow: visible; display: block; vertical-align: middle;\">\n <defs #defs></defs>\n <ng-content></ng-content>\n <g class=\"f-connection-group\">\n <linearGradient fConnectionGradient></linearGradient>\n <path fConnectionSelection [attr.d]=\"path\"></path>\n <g>\n <path f-connection-path [attr.d]=\"path\"></path>\n <circle f-connection-drag-handle r=\"8\"></circle>\n </g>\n <text f-connection-text></text>\n </g>\n</svg>\n<div #fConnectionCenter class=\"f-connection-center\" *ngIf=\"fConnectionCenters.length\">\n <ng-content select=\"[fConnectionCenter]\"></ng-content>\n</div>\n", styles: [":host{pointer-events:none;position:absolute}:host svg{overflow:visible}:host svg .f-connection-group{pointer-events:all}:host .f-connection-center{pointer-events:all}\n"] }]
1802
- }], ctorParameters: () => [{ type: i0.ElementRef }, { type: FConnectionFactory }, { type: FComponentsStore }], propDecorators: { fConnectionId: [{
1803
- type: Input
1814
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: FConnectionFactory }, { type: FComponentsStore }], propDecorators: { fId: [{
1815
+ type: Input,
1816
+ args: ['fConnectionId']
1804
1817
  }], fText: [{
1805
1818
  type: Input
1806
1819
  }], fStartColor: [{
@@ -1940,6 +1953,7 @@ class FNodeBase {
1940
1953
  stateChanges = new Subject();
1941
1954
  _position = PointExtensions.initialize();
1942
1955
  _size;
1956
+ fCanBeResizedByChild = true;
1943
1957
  isContains(element) {
1944
1958
  return this.hostElement.contains(element);
1945
1959
  }
@@ -1982,6 +1996,143 @@ class FResizeObserver extends Observable {
1982
1996
  }
1983
1997
  }
1984
1998
 
1999
+ let uniqueId$6 = 0;
2000
+ class FGroupDirective extends FNodeBase {
2001
+ elementReference;
2002
+ renderer;
2003
+ fComponentsStore;
2004
+ fMediator;
2005
+ subscriptions$ = new Subscription();
2006
+ fId = `f-group-${uniqueId$6++}`;
2007
+ fParentId = null;
2008
+ set position(value) {
2009
+ this._position = PointExtensions.castToPoint(value);
2010
+ this.refresh();
2011
+ }
2012
+ get position() {
2013
+ return this._position;
2014
+ }
2015
+ positionChange = new EventEmitter();
2016
+ set size(value) {
2017
+ this._size = value;
2018
+ this.refresh();
2019
+ }
2020
+ get size() {
2021
+ return this._size;
2022
+ }
2023
+ sizeChange = new EventEmitter();
2024
+ fDraggingDisabled = false;
2025
+ fSelectionDisabled = false;
2026
+ fIncludePadding = true;
2027
+ fConnectOnNode = true;
2028
+ get hostElement() {
2029
+ return this.elementReference.nativeElement;
2030
+ }
2031
+ connectors = [];
2032
+ constructor(elementReference, renderer, fComponentsStore, fMediator) {
2033
+ super();
2034
+ this.elementReference = elementReference;
2035
+ this.renderer = renderer;
2036
+ this.fComponentsStore = fComponentsStore;
2037
+ this.fMediator = fMediator;
2038
+ }
2039
+ ngOnInit() {
2040
+ this.setStyle('position', 'absolute');
2041
+ this.setStyle('transform-origin', 'center');
2042
+ this.setStyle('user-select', 'none');
2043
+ this.setStyle('pointer-events', 'all');
2044
+ this.setStyle('left', '0');
2045
+ this.setStyle('top', '0');
2046
+ super.redraw();
2047
+ this.fComponentsStore.addComponent(this.fComponentsStore.fNodes, this);
2048
+ }
2049
+ setStyle(styleName, value) {
2050
+ this.renderer.setStyle(this.hostElement, styleName, value);
2051
+ }
2052
+ redraw() {
2053
+ super.redraw();
2054
+ this.fMediator.send(new EmitTransformChangesRequest());
2055
+ }
2056
+ ngAfterViewInit() {
2057
+ this.subscriptions$.add(this.subscribeOnResizeChanges());
2058
+ }
2059
+ subscribeOnResizeChanges() {
2060
+ return merge(new FResizeObserver(this.hostElement), this.stateChanges).pipe(debounceTime(10), startWith(null)).subscribe(() => {
2061
+ this.connectors.forEach((fConnector) => {
2062
+ fConnector.fConnectableSide = new CalculateConnectorConnectableSideHandler().handle(new CalculateConnectorConnectableSideRequest(fConnector, this.hostElement));
2063
+ });
2064
+ this.fComponentsStore.componentDataChanged();
2065
+ });
2066
+ }
2067
+ addConnector(connector) {
2068
+ this.connectors.push(connector);
2069
+ this.stateChanges.next();
2070
+ }
2071
+ removeConnector(connector) {
2072
+ const index = this.connectors.indexOf(connector);
2073
+ if (index !== -1) {
2074
+ this.connectors.splice(index, 1);
2075
+ }
2076
+ this.stateChanges.next();
2077
+ }
2078
+ refresh() {
2079
+ this.stateChanges.next();
2080
+ }
2081
+ ngOnDestroy() {
2082
+ this.fComponentsStore.removeComponent(this.fComponentsStore.fNodes, this);
2083
+ this.stateChanges.complete();
2084
+ this.subscriptions$.unsubscribe();
2085
+ }
2086
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: FGroupDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: FComponentsStore }, { token: FFlowMediator }], target: i0.ɵɵFactoryTarget.Directive });
2087
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.0", type: FGroupDirective, selector: "[fGroup]", inputs: { fId: ["fGroupId", "fId"], fParentId: ["fGroupParentId", "fParentId"], position: ["fGroupPosition", "position"], size: ["fGroupSize", "size"], fDraggingDisabled: ["fGroupDraggingDisabled", "fDraggingDisabled"], fSelectionDisabled: ["fGroupSelectionDisabled", "fSelectionDisabled"], fIncludePadding: "fIncludePadding", fConnectOnNode: "fConnectOnNode" }, outputs: { positionChange: "fGroupPositionChange", sizeChange: "fGroupSizeChange" }, host: { properties: { "attr.data-f-group-id": "fId", "class.f-group-dragging-disabled": "fDraggingDisabled", "class.f-group-selection-disabled": "fSelectionDisabled" }, classAttribute: "f-group f-component" }, providers: [
2088
+ { provide: F_NODE, useExisting: FGroupDirective }
2089
+ ], exportAs: ["fComponent"], usesInheritance: true, ngImport: i0 });
2090
+ }
2091
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: FGroupDirective, decorators: [{
2092
+ type: Directive,
2093
+ args: [{
2094
+ selector: "[fGroup]",
2095
+ exportAs: "fComponent",
2096
+ host: {
2097
+ '[attr.data-f-group-id]': 'fId',
2098
+ class: "f-group f-component",
2099
+ '[class.f-group-dragging-disabled]': 'fDraggingDisabled',
2100
+ '[class.f-group-selection-disabled]': 'fSelectionDisabled',
2101
+ },
2102
+ providers: [
2103
+ { provide: F_NODE, useExisting: FGroupDirective }
2104
+ ],
2105
+ }]
2106
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: FComponentsStore }, { type: FFlowMediator }], propDecorators: { fId: [{
2107
+ type: Input,
2108
+ args: ['fGroupId']
2109
+ }], fParentId: [{
2110
+ type: Input,
2111
+ args: ['fGroupParentId']
2112
+ }], position: [{
2113
+ type: Input,
2114
+ args: ['fGroupPosition']
2115
+ }], positionChange: [{
2116
+ type: Output,
2117
+ args: ['fGroupPositionChange']
2118
+ }], size: [{
2119
+ type: Input,
2120
+ args: ['fGroupSize']
2121
+ }], sizeChange: [{
2122
+ type: Output,
2123
+ args: ['fGroupSizeChange']
2124
+ }], fDraggingDisabled: [{
2125
+ type: Input,
2126
+ args: ['fGroupDraggingDisabled']
2127
+ }], fSelectionDisabled: [{
2128
+ type: Input,
2129
+ args: ['fGroupSelectionDisabled']
2130
+ }], fIncludePadding: [{
2131
+ type: Input
2132
+ }], fConnectOnNode: [{
2133
+ type: Input
2134
+ }] } });
2135
+
1985
2136
  let uniqueId$5 = 0;
1986
2137
  class FNodeDirective extends FNodeBase {
1987
2138
  elementReference;
@@ -1990,6 +2141,7 @@ class FNodeDirective extends FNodeBase {
1990
2141
  fMediator;
1991
2142
  subscriptions$ = new Subscription();
1992
2143
  fId = `f-node-${uniqueId$5++}`;
2144
+ fParentId = null;
1993
2145
  set position(value) {
1994
2146
  this._position = PointExtensions.castToPoint(value);
1995
2147
  this.refresh();
@@ -2008,6 +2160,8 @@ class FNodeDirective extends FNodeBase {
2008
2160
  sizeChange = new EventEmitter();
2009
2161
  fDraggingDisabled = false;
2010
2162
  fSelectionDisabled = false;
2163
+ fIncludePadding = true;
2164
+ //TODO: Add ability to connect to first connectable input if node is under pointer
2011
2165
  fConnectOnNode = true;
2012
2166
  get hostElement() {
2013
2167
  return this.elementReference.nativeElement;
@@ -2045,7 +2199,7 @@ class FNodeDirective extends FNodeBase {
2045
2199
  this.connectors.forEach((fConnector) => {
2046
2200
  fConnector.fConnectableSide = new CalculateConnectorConnectableSideHandler().handle(new CalculateConnectorConnectableSideRequest(fConnector, this.hostElement));
2047
2201
  });
2048
- this.fComponentsStore.changes.next();
2202
+ this.fComponentsStore.componentDataChanged();
2049
2203
  });
2050
2204
  }
2051
2205
  addConnector(connector) {
@@ -2068,7 +2222,7 @@ class FNodeDirective extends FNodeBase {
2068
2222
  this.subscriptions$.unsubscribe();
2069
2223
  }
2070
2224
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: FNodeDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: FComponentsStore }, { token: FFlowMediator }], target: i0.ɵɵFactoryTarget.Directive });
2071
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.0", type: FNodeDirective, selector: "[fNode]", inputs: { fId: ["fNodeId", "fId"], position: ["fNodePosition", "position"], size: ["fNodeSize", "size"], fDraggingDisabled: ["fNodeDraggingDisabled", "fDraggingDisabled"], fSelectionDisabled: ["fNodeSelectionDisabled", "fSelectionDisabled"], fConnectOnNode: "fConnectOnNode" }, outputs: { positionChange: "fNodePositionChange", sizeChange: "fNodeSizeChange" }, host: { properties: { "attr.data-f-node-id": "fId", "class.f-node-dragging-disabled": "fDraggingDisabled", "class.f-node-selection-disabled": "fSelectionDisabled" }, classAttribute: "f-node f-component" }, providers: [
2225
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.0", type: FNodeDirective, selector: "[fNode]", inputs: { fId: ["fNodeId", "fId"], fParentId: ["fNodeParentId", "fParentId"], position: ["fNodePosition", "position"], size: ["fNodeSize", "size"], fDraggingDisabled: ["fNodeDraggingDisabled", "fDraggingDisabled"], fSelectionDisabled: ["fNodeSelectionDisabled", "fSelectionDisabled"], fIncludePadding: "fIncludePadding", fConnectOnNode: "fConnectOnNode" }, outputs: { positionChange: "fNodePositionChange", sizeChange: "fNodeSizeChange" }, host: { properties: { "attr.data-f-node-id": "fId", "class.f-node-dragging-disabled": "fDraggingDisabled", "class.f-node-selection-disabled": "fSelectionDisabled" }, classAttribute: "f-node f-component" }, providers: [
2072
2226
  { provide: F_NODE, useExisting: FNodeDirective }
2073
2227
  ], exportAs: ["fComponent"], usesInheritance: true, ngImport: i0 });
2074
2228
  }
@@ -2090,6 +2244,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
2090
2244
  }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: FComponentsStore }, { type: FFlowMediator }], propDecorators: { fId: [{
2091
2245
  type: Input,
2092
2246
  args: ['fNodeId']
2247
+ }], fParentId: [{
2248
+ type: Input,
2249
+ args: ['fNodeParentId']
2093
2250
  }], position: [{
2094
2251
  type: Input,
2095
2252
  args: ['fNodePosition']
@@ -2108,19 +2265,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
2108
2265
  }], fSelectionDisabled: [{
2109
2266
  type: Input,
2110
2267
  args: ['fNodeSelectionDisabled']
2268
+ }], fIncludePadding: [{
2269
+ type: Input
2111
2270
  }], fConnectOnNode: [{
2112
2271
  type: Input
2113
2272
  }] } });
2114
2273
 
2115
- function isNode(element) {
2116
- return !!element.closest('[fNode]');
2117
- }
2118
-
2119
2274
  const F_NODE_PROVIDERS = [
2275
+ FGroupDirective,
2120
2276
  FNodeDirective,
2121
2277
  FDragHandleDirective,
2122
2278
  FResizeHandleDirective,
2123
- // FRotateHandleDirective
2124
2279
  ];
2125
2280
 
2126
2281
  let uniqueId$4 = 0;
@@ -2675,13 +2830,44 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
2675
2830
  type: Injectable
2676
2831
  }], ctorParameters: () => [{ type: FComponentsStore }, { type: FDraggableDataContext }, { type: FFlowMediator }] });
2677
2832
 
2833
+ class CreateConnectionDragHandler {
2834
+ fMediator;
2835
+ connection;
2836
+ mouseDownPoint;
2837
+ onPointerDownFromConnectorRect = new RoundedRect();
2838
+ onPointerDownToConnectorRect = new RoundedRect();
2839
+ outputSide = EFConnectableSide.BOTTOM;
2840
+ constructor(fMediator, connection, mouseDownPoint) {
2841
+ this.fMediator = fMediator;
2842
+ this.connection = connection;
2843
+ this.mouseDownPoint = mouseDownPoint;
2844
+ }
2845
+ initialize() {
2846
+ const outputRect = this.fMediator.send(new GetOutputRectInFlowRequest(this.connection.fOutputId));
2847
+ this.outputSide = outputRect.fConnectableSide;
2848
+ this.onPointerDownFromConnectorRect = RoundedRect.fromRoundedRect(outputRect.rect);
2849
+ this.onPointerDownToConnectorRect = RoundedRect.fromRect(RectExtensions.initialize(this.mouseDownPoint.x, this.mouseDownPoint.y, 0, 0));
2850
+ this.connection.show();
2851
+ this.move(new Point(0, 0));
2852
+ }
2853
+ move(difference) {
2854
+ const line = this.fMediator.send(new GetConnectionLineRequest(this.onPointerDownFromConnectorRect, this.onPointerDownToConnectorRect.addPoint(difference), this.connection.fBehavior, this.outputSide, EFConnectableSide.TOP));
2855
+ this.connection.setLine(line.point1, this.outputSide, line.point2, EFConnectableSide.TOP);
2856
+ this.connection.redraw();
2857
+ }
2858
+ complete() {
2859
+ this.connection.redraw();
2860
+ this.connection.hide();
2861
+ }
2862
+ }
2863
+
2678
2864
  let CreateConnectionFinalizeValidator = class CreateConnectionFinalizeValidator {
2679
2865
  fDraggableDataContext;
2680
2866
  constructor(fDraggableDataContext) {
2681
2867
  this.fDraggableDataContext = fDraggableDataContext;
2682
2868
  }
2683
2869
  handle(request) {
2684
- return this.fDraggableDataContext.draggableItems.some((x) => x.type === EFDraggableType.CREATE_CONNECTION);
2870
+ return this.fDraggableDataContext.draggableItems.some((x) => x instanceof CreateConnectionDragHandler);
2685
2871
  }
2686
2872
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: CreateConnectionFinalizeValidator, deps: [{ token: FDraggableDataContext }], target: i0.ɵɵFactoryTarget.Injectable });
2687
2873
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: CreateConnectionFinalizeValidator });
@@ -2709,38 +2895,6 @@ class CreateConnectionDragHandlerRequest {
2709
2895
  }
2710
2896
  }
2711
2897
 
2712
- class CreateConnectionDragHandler {
2713
- fMediator;
2714
- connection;
2715
- mouseDownPoint;
2716
- type = EFDraggableType.CREATE_CONNECTION;
2717
- onPointerDownFromConnectorRect = new RoundedRect();
2718
- onPointerDownToConnectorRect = new RoundedRect();
2719
- outputSide = EFConnectableSide.BOTTOM;
2720
- constructor(fMediator, connection, mouseDownPoint) {
2721
- this.fMediator = fMediator;
2722
- this.connection = connection;
2723
- this.mouseDownPoint = mouseDownPoint;
2724
- }
2725
- initialize() {
2726
- const outputRect = this.fMediator.send(new GetOutputRectInFlowRequest(this.connection.fOutputId));
2727
- this.outputSide = outputRect.fConnectableSide;
2728
- this.onPointerDownFromConnectorRect = RoundedRect.fromRoundedRect(outputRect.rect);
2729
- this.onPointerDownToConnectorRect = RoundedRect.fromRect(RectExtensions.initialize(this.mouseDownPoint.x, this.mouseDownPoint.y, 0, 0));
2730
- this.connection.show();
2731
- this.move(new Point(0, 0));
2732
- }
2733
- move(difference) {
2734
- const line = this.fMediator.send(new GetConnectionLineRequest(this.onPointerDownFromConnectorRect, this.onPointerDownToConnectorRect.addPoint(difference), this.connection.fBehavior, this.outputSide, EFConnectableSide.TOP));
2735
- this.connection.setLine(line.point1, this.outputSide, line.point2, EFConnectableSide.TOP);
2736
- this.connection.redraw();
2737
- }
2738
- complete() {
2739
- this.connection.redraw();
2740
- this.connection.hide();
2741
- }
2742
- }
2743
-
2744
2898
  let CreateConnectionDragHandlerExecution = class CreateConnectionDragHandlerExecution {
2745
2899
  fComponentsStore;
2746
2900
  fDraggableDataContext;
@@ -3031,7 +3185,7 @@ let ReassignConnectionFinalizeExecution = class ReassignConnectionFinalizeExecut
3031
3185
  if (!input || !this.isReassignToDifferentInput(input)) {
3032
3186
  return;
3033
3187
  }
3034
- this.fDraggable.fReassignConnection.emit(new FReassignConnectionEvent(this.dragHandler.connection.fConnectionId, this.dragHandler.connection.fOutputId, this.dragHandler.connection.fInputId, input.id));
3188
+ this.fDraggable.fReassignConnection.emit(new FReassignConnectionEvent(this.dragHandler.connection.fId, this.dragHandler.connection.fOutputId, this.dragHandler.connection.fInputId, input.id));
3035
3189
  }
3036
3190
  getInputUnderPointer(event) {
3037
3191
  return this.fMediator.send(new GetInputUnderPointerRequest(event, this.dragHandler));
@@ -3049,40 +3203,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
3049
3203
  type: Injectable
3050
3204
  }], ctorParameters: () => [{ type: FComponentsStore }, { type: FDraggableDataContext }, { type: FFlowMediator }] });
3051
3205
 
3052
- let ReassignConnectionFinalizeValidator = class ReassignConnectionFinalizeValidator {
3053
- fDraggableDataContext;
3054
- constructor(fDraggableDataContext) {
3055
- this.fDraggableDataContext = fDraggableDataContext;
3056
- }
3057
- handle(request) {
3058
- return this.fDraggableDataContext.draggableItems.some((x) => x.type === EFDraggableType.REASSIGN_CONNECTION);
3059
- }
3060
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: ReassignConnectionFinalizeValidator, deps: [{ token: FDraggableDataContext }], target: i0.ɵɵFactoryTarget.Injectable });
3061
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: ReassignConnectionFinalizeValidator });
3062
- };
3063
- ReassignConnectionFinalizeValidator = __decorate([
3064
- FValidatorRegister(ReassignConnectionFinalizeRequest)
3065
- ], ReassignConnectionFinalizeValidator);
3066
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: ReassignConnectionFinalizeValidator, decorators: [{
3067
- type: Injectable
3068
- }], ctorParameters: () => [{ type: FDraggableDataContext }] });
3069
-
3070
- const REASSIGN_CONNECTION_FINALIZE_PROVIDERS = [
3071
- ReassignConnectionFinalizeExecution,
3072
- ReassignConnectionFinalizeValidator,
3073
- ];
3074
-
3075
- class ReassignConnectionPreparationRequest {
3076
- event;
3077
- constructor(event) {
3078
- this.event = event;
3079
- }
3080
- }
3081
-
3082
3206
  class ReassignConnectionDragHandler {
3083
3207
  fMediator;
3084
3208
  connection;
3085
- type = EFDraggableType.REASSIGN_CONNECTION;
3086
3209
  onPointerDownFromConnectorRect = new RoundedRect();
3087
3210
  onPointerDownToConnectorRect = new RoundedRect();
3088
3211
  outputSide = EFConnectableSide.BOTTOM;
@@ -3112,6 +3235,36 @@ class ReassignConnectionDragHandler {
3112
3235
  }
3113
3236
  }
3114
3237
 
3238
+ let ReassignConnectionFinalizeValidator = class ReassignConnectionFinalizeValidator {
3239
+ fDraggableDataContext;
3240
+ constructor(fDraggableDataContext) {
3241
+ this.fDraggableDataContext = fDraggableDataContext;
3242
+ }
3243
+ handle(request) {
3244
+ return this.fDraggableDataContext.draggableItems.some((x) => x instanceof ReassignConnectionDragHandler);
3245
+ }
3246
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: ReassignConnectionFinalizeValidator, deps: [{ token: FDraggableDataContext }], target: i0.ɵɵFactoryTarget.Injectable });
3247
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: ReassignConnectionFinalizeValidator });
3248
+ };
3249
+ ReassignConnectionFinalizeValidator = __decorate([
3250
+ FValidatorRegister(ReassignConnectionFinalizeRequest)
3251
+ ], ReassignConnectionFinalizeValidator);
3252
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: ReassignConnectionFinalizeValidator, decorators: [{
3253
+ type: Injectable
3254
+ }], ctorParameters: () => [{ type: FDraggableDataContext }] });
3255
+
3256
+ const REASSIGN_CONNECTION_FINALIZE_PROVIDERS = [
3257
+ ReassignConnectionFinalizeExecution,
3258
+ ReassignConnectionFinalizeValidator,
3259
+ ];
3260
+
3261
+ class ReassignConnectionPreparationRequest {
3262
+ event;
3263
+ constructor(event) {
3264
+ this.event = event;
3265
+ }
3266
+ }
3267
+
3115
3268
  let ReassignConnectionPreparationExecution = class ReassignConnectionPreparationExecution {
3116
3269
  fComponentsStore;
3117
3270
  fDraggableDataContext;
@@ -3135,7 +3288,7 @@ let ReassignConnectionPreparationExecution = class ReassignConnectionPreparation
3135
3288
  if (connectionToReassign.fDraggingDisabled) {
3136
3289
  return;
3137
3290
  }
3138
- this.fMediator.send(new UpdateItemLayerRequest(connectionToReassign, this.fComponentsStore.fCanvas.fConnectionsContainer.nativeElement));
3291
+ this.fMediator.send(new UpdateItemAndChildrenLayersRequest(connectionToReassign, this.fComponentsStore.fCanvas.fConnectionsContainer.nativeElement));
3139
3292
  this.fDraggableDataContext.onPointerDownScale = this.transform.scale;
3140
3293
  this.fDraggableDataContext.onPointerDownPosition = Point.fromPoint(request.event.getPosition())
3141
3294
  .elementTransform(this.flowHost).div(this.transform.scale);
@@ -3213,296 +3366,535 @@ const CONNECTIONS_PROVIDERS = [
3213
3366
  ...GET_INPUT_UNDER_POINTER_PROVIDERS,
3214
3367
  ];
3215
3368
 
3216
- class ExternalItemFinalizeRequest {
3217
- event;
3218
- constructor(event) {
3219
- this.event = event;
3369
+ class ConvertComputedToPixelsRequest {
3370
+ value;
3371
+ clientWidth;
3372
+ clientHeight;
3373
+ fontSize;
3374
+ constructor(value, clientWidth, clientHeight, fontSize) {
3375
+ this.value = value;
3376
+ this.clientWidth = clientWidth;
3377
+ this.clientHeight = clientHeight;
3378
+ this.fontSize = fontSize;
3220
3379
  }
3221
3380
  }
3222
3381
 
3223
- class FCreateNodeEvent {
3382
+ let ConvertComputedToPixelsExecution = class ConvertComputedToPixelsExecution {
3383
+ windowService;
3384
+ constructor(windowService) {
3385
+ this.windowService = windowService;
3386
+ }
3387
+ handle(request) {
3388
+ return this.convert(request.value, request.clientWidth, request.clientHeight, request.fontSize);
3389
+ }
3390
+ convert(value, clientWidth, clientHeight, fontSize) {
3391
+ if (value.endsWith('px')) {
3392
+ return parseFloat(value);
3393
+ }
3394
+ else if (value.endsWith('%')) {
3395
+ const percentage = parseFloat(value) / 100;
3396
+ return Math.max(clientWidth, clientHeight) * percentage;
3397
+ }
3398
+ else if (value.endsWith('em')) {
3399
+ return parseFloat(value) * parseFloat(fontSize);
3400
+ }
3401
+ else if (value.endsWith('rem')) {
3402
+ return parseFloat(value) * parseFloat(getComputedStyle(this.windowService.getWindow().document.documentElement).fontSize);
3403
+ }
3404
+ else if (value.endsWith('vh')) {
3405
+ const vh = this.windowService.getWindow().innerHeight / 100;
3406
+ return parseFloat(value) * vh;
3407
+ }
3408
+ else if (value.endsWith('vw')) {
3409
+ const vw = this.windowService.getWindow().innerWidth / 100;
3410
+ return parseFloat(value) * vw;
3411
+ }
3412
+ return parseFloat(value) || 0;
3413
+ }
3414
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: ConvertComputedToPixelsExecution, deps: [{ token: i3$1.WindowService }], target: i0.ɵɵFactoryTarget.Injectable });
3415
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: ConvertComputedToPixelsExecution });
3416
+ };
3417
+ ConvertComputedToPixelsExecution = __decorate([
3418
+ FExecutionRegister(ConvertComputedToPixelsRequest)
3419
+ ], ConvertComputedToPixelsExecution);
3420
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: ConvertComputedToPixelsExecution, decorators: [{
3421
+ type: Injectable
3422
+ }], ctorParameters: () => [{ type: i3$1.WindowService }] });
3423
+
3424
+ class GetNodePaddingRequest {
3425
+ fNode;
3224
3426
  rect;
3225
- data;
3226
- constructor(rect, data) {
3427
+ constructor(fNode, rect) {
3428
+ this.fNode = fNode;
3227
3429
  this.rect = rect;
3228
- this.data = data;
3229
3430
  }
3230
3431
  }
3231
3432
 
3232
- let ExternalItemFinalizeExecution = class ExternalItemFinalizeExecution {
3233
- fComponentsStore;
3234
- fDraggableDataContext;
3433
+ let GetNodePaddingExecution = class GetNodePaddingExecution {
3235
3434
  fMediator;
3236
- get flowHost() {
3237
- return this.fComponentsStore.fFlow.hostElement;
3435
+ constructor(fMediator) {
3436
+ this.fMediator = fMediator;
3238
3437
  }
3239
- get fCreateNode() {
3240
- return this.fComponentsStore.fDraggable.fCreateNode;
3438
+ handle(request) {
3439
+ return request.fNode.fIncludePadding ? this.getPaddingData(request.fNode, request.rect) : [0, 0, 0, 0];
3241
3440
  }
3242
- get dragHandler() {
3243
- return this.fDraggableDataContext.draggableItems[0];
3441
+ getPaddingData(node, rect) {
3442
+ const style = window.getComputedStyle(node.hostElement);
3443
+ return [
3444
+ this.convertToPixels(style.paddingLeft, rect.width, rect.height, style.fontSize),
3445
+ this.convertToPixels(style.paddingTop, rect.width, rect.height, style.fontSize),
3446
+ this.convertToPixels(style.paddingRight, rect.width, rect.height, style.fontSize),
3447
+ this.convertToPixels(style.paddingBottom, rect.width, rect.height, style.fontSize)
3448
+ ];
3244
3449
  }
3245
- constructor(fComponentsStore, fDraggableDataContext, fMediator) {
3450
+ convertToPixels(value, clientWidth, clientHeight, fontSize) {
3451
+ return this.fMediator.send(new ConvertComputedToPixelsRequest(value, clientWidth, clientHeight, fontSize));
3452
+ }
3453
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: GetNodePaddingExecution, deps: [{ token: FFlowMediator }], target: i0.ɵɵFactoryTarget.Injectable });
3454
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: GetNodePaddingExecution });
3455
+ };
3456
+ GetNodePaddingExecution = __decorate([
3457
+ FExecutionRegister(GetNodePaddingRequest)
3458
+ ], GetNodePaddingExecution);
3459
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: GetNodePaddingExecution, decorators: [{
3460
+ type: Injectable
3461
+ }], ctorParameters: () => [{ type: FFlowMediator }] });
3462
+
3463
+ class GetNormalizedNodeRectRequest {
3464
+ fNode;
3465
+ constructor(fNode) {
3466
+ this.fNode = fNode;
3467
+ }
3468
+ }
3469
+
3470
+ let GetNormalizedNodeRectExecution = class GetNormalizedNodeRectExecution {
3471
+ fComponentsStore;
3472
+ constructor(fComponentsStore) {
3246
3473
  this.fComponentsStore = fComponentsStore;
3247
- this.fDraggableDataContext = fDraggableDataContext;
3248
- this.fMediator = fMediator;
3249
3474
  }
3250
3475
  handle(request) {
3251
- this.emitEvent(this.getExternalItemElementsFromPoint(request.event.getPosition()));
3252
- this.dragHandler.complete();
3476
+ return this.normalizeRect(RectExtensions.fromElement(request.fNode.hostElement), request.fNode.position);
3253
3477
  }
3254
- getExternalItemElementsFromPoint(position) {
3255
- return document.elementsFromPoint(position.x, position.y)
3256
- .filter(x => !x.closest('.f-external-item'));
3478
+ normalizeRect(scaledRect, position) {
3479
+ const rect = RectExtensions.div(scaledRect, this.fComponentsStore.fCanvas.transform.scale);
3480
+ return RectExtensions.initialize(position.x, position.y, rect.width, rect.height);
3257
3481
  }
3258
- emitEvent(elements) {
3259
- if (this.isPointerInCanvasRect(elements)) {
3260
- this.fCreateNode.emit(new FCreateNodeEvent(this.getRectInCanvas(), this.dragHandler.externalItem.fData));
3482
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: GetNormalizedNodeRectExecution, deps: [{ token: FComponentsStore }], target: i0.ɵɵFactoryTarget.Injectable });
3483
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: GetNormalizedNodeRectExecution });
3484
+ };
3485
+ GetNormalizedNodeRectExecution = __decorate([
3486
+ FExecutionRegister(GetNormalizedNodeRectRequest)
3487
+ ], GetNormalizedNodeRectExecution);
3488
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: GetNormalizedNodeRectExecution, decorators: [{
3489
+ type: Injectable
3490
+ }], ctorParameters: () => [{ type: FComponentsStore }] });
3491
+
3492
+ class GetNormalizedParentNodeRectRequest {
3493
+ fNode;
3494
+ constructor(fNode) {
3495
+ this.fNode = fNode;
3496
+ }
3497
+ }
3498
+
3499
+ let GetNormalizedParentNodeRectExecution = class GetNormalizedParentNodeRectExecution {
3500
+ fComponentsStore;
3501
+ fMediator;
3502
+ constructor(fComponentsStore, fMediator) {
3503
+ this.fComponentsStore = fComponentsStore;
3504
+ this.fMediator = fMediator;
3505
+ }
3506
+ handle(request) {
3507
+ let result = RectExtensions.initialize(-Infinity, -Infinity, Infinity, Infinity);
3508
+ const parentNode = this.getNode(request.fNode.fParentId);
3509
+ if (parentNode) {
3510
+ result = this.getParentRect(parentNode);
3261
3511
  }
3512
+ return result;
3262
3513
  }
3263
- isPointerInCanvasRect(elements) {
3264
- return elements.length ? this.flowHost.contains(elements[0]) : false;
3514
+ getNode(fId) {
3515
+ return this.fComponentsStore.fNodes.find((x) => x.fId === fId);
3265
3516
  }
3266
- getRectInCanvas() {
3267
- return this.fMediator.send(new GetElementRectInFlowRequest(this.dragHandler.placeholder));
3517
+ getParentRect(node) {
3518
+ const rect = this.getNormalizedNodeRect(node);
3519
+ const padding = this.getNodePadding(node, rect);
3520
+ return RectExtensions.initialize(rect.x + padding[0], rect.y + padding[1], rect.width - padding[0] - padding[2], rect.height - padding[1] - padding[3]);
3268
3521
  }
3269
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: ExternalItemFinalizeExecution, deps: [{ token: FComponentsStore }, { token: FDraggableDataContext }, { token: FFlowMediator }], target: i0.ɵɵFactoryTarget.Injectable });
3270
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: ExternalItemFinalizeExecution });
3522
+ getNormalizedNodeRect(node) {
3523
+ return this.fMediator.send(new GetNormalizedNodeRectRequest(node));
3524
+ }
3525
+ getNodePadding(node, rect) {
3526
+ return this.fMediator.send(new GetNodePaddingRequest(node, rect));
3527
+ }
3528
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: GetNormalizedParentNodeRectExecution, deps: [{ token: FComponentsStore }, { token: FFlowMediator }], target: i0.ɵɵFactoryTarget.Injectable });
3529
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: GetNormalizedParentNodeRectExecution });
3271
3530
  };
3272
- ExternalItemFinalizeExecution = __decorate([
3273
- FExecutionRegister(ExternalItemFinalizeRequest)
3274
- ], ExternalItemFinalizeExecution);
3275
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: ExternalItemFinalizeExecution, decorators: [{
3531
+ GetNormalizedParentNodeRectExecution = __decorate([
3532
+ FExecutionRegister(GetNormalizedParentNodeRectRequest)
3533
+ ], GetNormalizedParentNodeRectExecution);
3534
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: GetNormalizedParentNodeRectExecution, decorators: [{
3276
3535
  type: Injectable
3277
- }], ctorParameters: () => [{ type: FComponentsStore }, { type: FDraggableDataContext }, { type: FFlowMediator }] });
3536
+ }], ctorParameters: () => [{ type: FComponentsStore }, { type: FFlowMediator }] });
3278
3537
 
3279
- let ExternalItemFinalizeValidator = class ExternalItemFinalizeValidator {
3280
- fDraggableDataContext;
3281
- constructor(fDraggableDataContext) {
3282
- this.fDraggableDataContext = fDraggableDataContext;
3538
+ class GetParentNodesRequest {
3539
+ fNode;
3540
+ constructor(fNode) {
3541
+ this.fNode = fNode;
3542
+ }
3543
+ }
3544
+
3545
+ let GetParentNodesExecution = class GetParentNodesExecution {
3546
+ fComponentsStore;
3547
+ constructor(fComponentsStore) {
3548
+ this.fComponentsStore = fComponentsStore;
3283
3549
  }
3284
3550
  handle(request) {
3285
- return this.fDraggableDataContext.draggableItems.some((x) => x.type === EFDraggableType.PALETTE_ITEM);
3551
+ return this.getParentNodes(request.fNode, new Set(), []);
3286
3552
  }
3287
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: ExternalItemFinalizeValidator, deps: [{ token: FDraggableDataContext }], target: i0.ɵɵFactoryTarget.Injectable });
3288
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: ExternalItemFinalizeValidator });
3553
+ getParentNodes(fNode, visited, result) {
3554
+ if (visited.has(fNode.fId)) {
3555
+ throw new Error('Circular reference detected in the node hierarchy. Node id: ' + fNode.fId);
3556
+ }
3557
+ visited.add(fNode.fId);
3558
+ const parent = this.fComponentsStore.fNodes.find((x) => x.fId === fNode.fParentId);
3559
+ if (!parent) {
3560
+ return result;
3561
+ }
3562
+ result.push(parent);
3563
+ return this.getParentNodes(parent, visited, result);
3564
+ }
3565
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: GetParentNodesExecution, deps: [{ token: FComponentsStore }], target: i0.ɵɵFactoryTarget.Injectable });
3566
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: GetParentNodesExecution });
3289
3567
  };
3290
- ExternalItemFinalizeValidator = __decorate([
3291
- FValidatorRegister(ExternalItemFinalizeRequest)
3292
- ], ExternalItemFinalizeValidator);
3293
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: ExternalItemFinalizeValidator, decorators: [{
3568
+ GetParentNodesExecution = __decorate([
3569
+ FExecutionRegister(GetParentNodesRequest)
3570
+ ], GetParentNodesExecution);
3571
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: GetParentNodesExecution, decorators: [{
3294
3572
  type: Injectable
3295
- }], ctorParameters: () => [{ type: FDraggableDataContext }] });
3573
+ }], ctorParameters: () => [{ type: FComponentsStore }] });
3296
3574
 
3297
- const EXTERNAL_ITEM_FINALIZE_PROVIDERS = [
3298
- ExternalItemFinalizeExecution,
3299
- ExternalItemFinalizeValidator,
3575
+ class IsArrayHasParentNodeRequest {
3576
+ fNode;
3577
+ fNodes;
3578
+ constructor(fNode, fNodes) {
3579
+ this.fNode = fNode;
3580
+ this.fNodes = fNodes;
3581
+ }
3582
+ }
3583
+
3584
+ let IsArrayHasParentNodeExecution = class IsArrayHasParentNodeExecution {
3585
+ fMediator;
3586
+ constructor(fMediator) {
3587
+ this.fMediator = fMediator;
3588
+ }
3589
+ handle(request) {
3590
+ return this.isParentNodeInArray(this.getParentNodeIds(request.fNode), request.fNodes);
3591
+ }
3592
+ getParentNodeIds(fNode) {
3593
+ return this.getParentNodes(fNode).map((x) => x.fId);
3594
+ }
3595
+ getParentNodes(fNode) {
3596
+ return this.fMediator.send(new GetParentNodesRequest(fNode));
3597
+ }
3598
+ isParentNodeInArray(parentNodeIds, fNodes) {
3599
+ return fNodes.some((x) => parentNodeIds.includes(x.fId));
3600
+ }
3601
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: IsArrayHasParentNodeExecution, deps: [{ token: FFlowMediator }], target: i0.ɵɵFactoryTarget.Injectable });
3602
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: IsArrayHasParentNodeExecution });
3603
+ };
3604
+ IsArrayHasParentNodeExecution = __decorate([
3605
+ FExecutionRegister(IsArrayHasParentNodeRequest)
3606
+ ], IsArrayHasParentNodeExecution);
3607
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: IsArrayHasParentNodeExecution, decorators: [{
3608
+ type: Injectable
3609
+ }], ctorParameters: () => [{ type: FFlowMediator }] });
3610
+
3611
+ const DRAG_AND_DROP_COMMON_PROVIDERS = [
3612
+ ConvertComputedToPixelsExecution,
3613
+ GetNodePaddingExecution,
3614
+ GetNormalizedNodeRectExecution,
3615
+ GetNormalizedParentNodeRectExecution,
3616
+ GetParentNodesExecution,
3617
+ IsArrayHasParentNodeExecution
3300
3618
  ];
3301
3619
 
3302
- class ExternalItemPreparationRequest {
3303
- event;
3304
- constructor(event) {
3305
- this.event = event;
3620
+ class PutInputConnectionHandlersToArrayRequest {
3621
+ nodeDragHandler;
3622
+ outputIds;
3623
+ result;
3624
+ constructor(nodeDragHandler, outputIds, result) {
3625
+ this.nodeDragHandler = nodeDragHandler;
3626
+ this.outputIds = outputIds;
3627
+ this.result = result;
3306
3628
  }
3307
3629
  }
3308
3630
 
3309
- const F_EXTERNAL_ITEM = new InjectionToken('F_EXTERNAL_ITEM');
3310
- class FExternalItemBase {
3311
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: FExternalItemBase, deps: [], target: i0.ɵɵFactoryTarget.Directive });
3312
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.0", type: FExternalItemBase, ngImport: i0 });
3631
+ class ConnectionBaseDragHandler {
3632
+ fMediator;
3633
+ connection;
3634
+ fromConnectorRect = new RoundedRect();
3635
+ fromConnectorSide = EFConnectableSide.BOTTOM;
3636
+ toConnectorRect = new RoundedRect();
3637
+ toConnectorSide = EFConnectableSide.TOP;
3638
+ constructor(fMediator, connection) {
3639
+ this.fMediator = fMediator;
3640
+ this.connection = connection;
3641
+ }
3642
+ initialize() {
3643
+ const fromConnector = this.fMediator.send(new GetOutputRectInFlowRequest(this.connection.fOutputId));
3644
+ this.fromConnectorRect = RoundedRect.fromRoundedRect(fromConnector.rect);
3645
+ this.fromConnectorSide = fromConnector.fConnectableSide;
3646
+ const toConnector = this.fMediator.send(new GetInputRectInFlowRequest(this.connection.fInputId));
3647
+ this.toConnectorRect = RoundedRect.fromRoundedRect(toConnector.rect);
3648
+ this.toConnectorSide = toConnector.fConnectableSide;
3649
+ }
3650
+ getDifference(difference, restrictions) {
3651
+ return {
3652
+ x: Math.min(Math.max(difference.x, restrictions.min.x), restrictions.max.x),
3653
+ y: Math.min(Math.max(difference.y, restrictions.min.y), restrictions.max.y)
3654
+ };
3655
+ }
3656
+ redrawConnection(line) {
3657
+ this.connection.setLine(line.point1, this.fromConnectorSide, line.point2, this.toConnectorSide);
3658
+ this.connection.redraw();
3659
+ }
3660
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: ConnectionBaseDragHandler, deps: [{ token: FFlowMediator }, { token: FConnectionBase }], target: i0.ɵɵFactoryTarget.Directive });
3661
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.0", type: ConnectionBaseDragHandler, ngImport: i0 });
3313
3662
  }
3314
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: FExternalItemBase, decorators: [{
3663
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: ConnectionBaseDragHandler, decorators: [{
3315
3664
  type: Directive
3316
- }] });
3665
+ }], ctorParameters: () => [{ type: FFlowMediator }, { type: FConnectionBase }] });
3317
3666
 
3318
- function isExternalItem(element) {
3319
- return !!element.closest('[fExternalItem]');
3320
- }
3321
- function getExternalItem(element) {
3322
- return element.closest('[fExternalItem]');
3667
+ class ConnectionDragHandler extends ConnectionBaseDragHandler {
3668
+ sourceRestrictions;
3669
+ targetRestrictions;
3670
+ constructor(fMediator, connection) {
3671
+ super(fMediator, connection);
3672
+ }
3673
+ setOutputRestrictions(min, max) {
3674
+ this.sourceRestrictions = { min, max };
3675
+ }
3676
+ setInputRestrictions(min, max) {
3677
+ this.targetRestrictions = { min, max };
3678
+ }
3679
+ move(difference) {
3680
+ this.redrawConnection(this.getNewLineValue(difference));
3681
+ }
3682
+ getNewLineValue(difference) {
3683
+ return this.fMediator.send(new GetConnectionLineRequest(this.fromConnectorRect.addPoint(this.getDifference({ ...difference }, this.sourceRestrictions)), this.toConnectorRect.addPoint(this.getDifference({ ...difference }, this.targetRestrictions)), this.connection.fBehavior, this.fromConnectorSide, this.toConnectorSide));
3684
+ }
3323
3685
  }
3324
3686
 
3325
- class FExternalItemService {
3326
- items = [];
3327
- registerItem(item) {
3328
- this.items.push(item);
3687
+ class ConnectionTargetDragHandler extends ConnectionBaseDragHandler {
3688
+ minDistance;
3689
+ maxDistance;
3690
+ constructor(fMediator, connection, minDistance, maxDistance) {
3691
+ super(fMediator, connection);
3692
+ this.minDistance = minDistance;
3693
+ this.maxDistance = maxDistance;
3329
3694
  }
3330
- getItem(element) {
3331
- return this.items.find(item => item.hostElement === element);
3695
+ move(difference) {
3696
+ this.redrawConnection(this.getNewLineValue(difference));
3332
3697
  }
3333
- removeItem(item) {
3334
- const index = this.items.indexOf(item);
3335
- if (index !== -1) {
3336
- this.items.splice(index, 1);
3337
- }
3698
+ getNewLineValue(difference) {
3699
+ return this.fMediator.send(new GetConnectionLineRequest(this.fromConnectorRect, this.toConnectorRect.addPoint(this.getDifference({ ...difference }, { min: this.minDistance, max: this.maxDistance })), this.connection.fBehavior, this.fromConnectorSide, this.toConnectorSide));
3338
3700
  }
3339
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: FExternalItemService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3340
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: FExternalItemService, providedIn: 'root' });
3341
3701
  }
3342
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: FExternalItemService, decorators: [{
3343
- type: Injectable,
3344
- args: [{
3345
- providedIn: 'root'
3346
- }]
3347
- }] });
3348
3702
 
3349
- let uniqueId$1 = 0;
3350
- class FExternalItemDirective extends FExternalItemBase {
3351
- elementReference;
3352
- fExternalItemService;
3353
- fExternalItemId = `f-external-item-${uniqueId$1++}`;
3354
- get hostElement() {
3355
- return this.elementReference.nativeElement;
3356
- }
3357
- fData;
3358
- fDisabled = false;
3359
- constructor(elementReference, fExternalItemService) {
3360
- super();
3361
- this.elementReference = elementReference;
3362
- this.fExternalItemService = fExternalItemService;
3703
+ let PutInputConnectionHandlersToArrayExecution = class PutInputConnectionHandlersToArrayExecution {
3704
+ fComponentsStore;
3705
+ fMediator;
3706
+ get fConnections() {
3707
+ return this.fComponentsStore.fConnections;
3363
3708
  }
3364
- ngOnInit() {
3365
- this.fExternalItemService.registerItem(this);
3366
- this.disablePointerEvents(Array.from(this.hostElement.children));
3709
+ constructor(fComponentsStore, fMediator) {
3710
+ this.fComponentsStore = fComponentsStore;
3711
+ this.fMediator = fMediator;
3367
3712
  }
3368
- disablePointerEvents(children) {
3369
- children.forEach((x) => {
3370
- x.style.pointerEvents = 'none';
3371
- this.disablePointerEvents(Array.from(x.children));
3713
+ handle(request) {
3714
+ this.getInputConnections(request.nodeDragHandler.fNode).forEach((connection) => {
3715
+ const index = this.getExistingConnectionHandlerIndex(request.result, connection);
3716
+ if (index !== -1) {
3717
+ this.updateExistingConnectionHandler(request.result, index, request.nodeDragHandler);
3718
+ }
3719
+ else {
3720
+ request.result.push(this.createNewConnectionHandler(request.nodeDragHandler, request.outputIds, connection));
3721
+ }
3372
3722
  });
3373
3723
  }
3374
- ngOnDestroy() {
3375
- this.fExternalItemService.removeItem(this);
3724
+ getInputConnections(node) {
3725
+ const inputIds = new Set(this.getInputsForNode(node).map((x) => x.id));
3726
+ return this.fConnections.filter((x) => inputIds.has(x.fInputId));
3376
3727
  }
3377
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: FExternalItemDirective, deps: [{ token: i0.ElementRef }, { token: FExternalItemService }], target: i0.ɵɵFactoryTarget.Directive });
3378
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.0", type: FExternalItemDirective, selector: "[fExternalItem]", inputs: { fExternalItemId: "fExternalItemId", fData: "fData", fDisabled: "fDisabled" }, host: { properties: { "attr.id": "fExternalItemId", "class.f-external-item-disabled": "fDisabled" }, classAttribute: "f-component f-external-item" }, providers: [
3379
- { provide: F_EXTERNAL_ITEM, useExisting: FExternalItemDirective }
3380
- ], usesInheritance: true, ngImport: i0 });
3381
- }
3382
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: FExternalItemDirective, decorators: [{
3383
- type: Directive,
3384
- args: [{
3385
- selector: "[fExternalItem]",
3386
- host: {
3387
- '[attr.id]': 'fExternalItemId',
3388
- class: "f-component f-external-item",
3389
- '[class.f-external-item-disabled]': 'fDisabled',
3390
- },
3391
- providers: [
3392
- { provide: F_EXTERNAL_ITEM, useExisting: FExternalItemDirective }
3393
- ],
3394
- }]
3395
- }], ctorParameters: () => [{ type: i0.ElementRef }, { type: FExternalItemService }], propDecorators: { fExternalItemId: [{
3396
- type: Input
3397
- }], fData: [{
3398
- type: Input
3399
- }], fDisabled: [{
3400
- type: Input
3401
- }] } });
3402
-
3403
- const F_EXTERNAL_ITEM_PROVIDERS = [
3404
- FExternalItemDirective
3405
- ];
3406
-
3407
- class ExternalItemDragHandler {
3408
- externalItem;
3409
- type = EFDraggableType.PALETTE_ITEM;
3410
- placeholder;
3411
- onPointerDownRect = RectExtensions.initialize();
3412
- difference = PointExtensions.initialize();
3413
- constructor(externalItem) {
3414
- this.externalItem = externalItem;
3728
+ getInputsForNode(node) {
3729
+ return this.fComponentsStore.fInputs.filter((x) => node.isContains(x.hostElement));
3415
3730
  }
3416
- getStyle(position) {
3417
- return `position: absolute; left: 0; top: 0; transform: translate(${position.x}px, ${position.y}px)`;
3731
+ getExistingConnectionHandlerIndex(result, connection) {
3732
+ return result.findIndex((x) => x instanceof ConnectionDragHandler && x.connection.fId === connection.fId);
3418
3733
  }
3419
- initialize() {
3420
- this.onPointerDownRect = this.getExternalItemRect();
3421
- this.placeholder = DomElementExtensions.deepCloneNode(this.externalItem.hostElement);
3422
- this.placeholder.setAttribute('style', this.getStyle(Point.fromPoint(this.onPointerDownRect)));
3423
- document.body.appendChild(this.placeholder);
3734
+ createNewConnectionHandler(nodeDragHandler, outputIds, connection) {
3735
+ let result;
3736
+ if (outputIds.includes(connection.fOutputId)) {
3737
+ result = this.getNewConnectionHandler(connection, nodeDragHandler);
3738
+ }
3739
+ else {
3740
+ result = this.getNewSourceConnectionHandler(connection, nodeDragHandler);
3741
+ }
3742
+ return result;
3424
3743
  }
3425
- getExternalItemRect() {
3426
- const rect = this.externalItem.hostElement.getBoundingClientRect();
3427
- const scrollTop = window.pageYOffset || document.documentElement.scrollTop;
3428
- const scrollLeft = window.pageXOffset || document.documentElement.scrollLeft;
3429
- const offsetTop = rect.top + scrollTop;
3430
- const offsetLeft = rect.left + scrollLeft;
3431
- return RectExtensions.initialize(offsetLeft, offsetTop, rect.width, rect.height);
3744
+ getNewConnectionHandler(connection, nodeDragHandler) {
3745
+ const handler = new ConnectionDragHandler(this.fMediator, connection);
3746
+ handler.setInputRestrictions(nodeDragHandler.minDistance, nodeDragHandler.maxDistance);
3747
+ return handler;
3748
+ }
3749
+ updateExistingConnectionHandler(result, index, nodeDragHandler) {
3750
+ result[index].setInputRestrictions(nodeDragHandler.minDistance, nodeDragHandler.maxDistance);
3751
+ }
3752
+ getNewSourceConnectionHandler(connection, nodeDragHandler) {
3753
+ return new ConnectionTargetDragHandler(this.fMediator, connection, nodeDragHandler.minDistance, nodeDragHandler.maxDistance);
3754
+ }
3755
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: PutInputConnectionHandlersToArrayExecution, deps: [{ token: FComponentsStore }, { token: FFlowMediator }], target: i0.ɵɵFactoryTarget.Injectable });
3756
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: PutInputConnectionHandlersToArrayExecution });
3757
+ };
3758
+ PutInputConnectionHandlersToArrayExecution = __decorate([
3759
+ FExecutionRegister(PutInputConnectionHandlersToArrayRequest)
3760
+ ], PutInputConnectionHandlersToArrayExecution);
3761
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: PutInputConnectionHandlersToArrayExecution, decorators: [{
3762
+ type: Injectable
3763
+ }], ctorParameters: () => [{ type: FComponentsStore }, { type: FFlowMediator }] });
3764
+
3765
+ class PutOutputConnectionHandlersToArrayRequest {
3766
+ nodeDragHandler;
3767
+ inputIds;
3768
+ result;
3769
+ constructor(nodeDragHandler, inputIds, result) {
3770
+ this.nodeDragHandler = nodeDragHandler;
3771
+ this.inputIds = inputIds;
3772
+ this.result = result;
3773
+ }
3774
+ }
3775
+
3776
+ class ConnectionSourceDragHandler extends ConnectionBaseDragHandler {
3777
+ minDistance;
3778
+ maxDistance;
3779
+ constructor(fMediator, connection, minDistance, maxDistance) {
3780
+ super(fMediator, connection);
3781
+ this.minDistance = minDistance;
3782
+ this.maxDistance = maxDistance;
3432
3783
  }
3433
3784
  move(difference) {
3434
- this.difference = difference;
3435
- const position = Point.fromPoint(this.onPointerDownRect).add(this.difference);
3436
- this.placeholder.setAttribute('style', this.getStyle(position));
3785
+ this.redrawConnection(this.getNewLineValue(difference));
3437
3786
  }
3438
- complete() {
3439
- document.body.removeChild(this.placeholder);
3787
+ getNewLineValue(difference) {
3788
+ return this.fMediator.send(new GetConnectionLineRequest(this.fromConnectorRect.addPoint(this.getDifference({ ...difference }, { min: this.minDistance, max: this.maxDistance })), this.toConnectorRect, this.connection.fBehavior, this.fromConnectorSide, this.toConnectorSide));
3440
3789
  }
3441
3790
  }
3442
3791
 
3443
- let ExternalItemPreparationExecution = class ExternalItemPreparationExecution {
3792
+ let PutOutputConnectionHandlersToArrayExecution = class PutOutputConnectionHandlersToArrayExecution {
3444
3793
  fComponentsStore;
3445
- fDraggableDataContext;
3446
- fExternalItemService;
3447
- get flowHost() {
3448
- return this.fComponentsStore.fFlow.hostElement;
3794
+ fMediator;
3795
+ get fConnections() {
3796
+ return this.fComponentsStore.fConnections;
3449
3797
  }
3450
- constructor(fComponentsStore, fDraggableDataContext, fExternalItemService) {
3798
+ constructor(fComponentsStore, fMediator) {
3451
3799
  this.fComponentsStore = fComponentsStore;
3452
- this.fDraggableDataContext = fDraggableDataContext;
3453
- this.fExternalItemService = fExternalItemService;
3800
+ this.fMediator = fMediator;
3454
3801
  }
3455
3802
  handle(request) {
3456
- this.fDraggableDataContext.onPointerDownScale = 1;
3457
- this.fDraggableDataContext.onPointerDownPosition = Point.fromPoint(request.event.getPosition()).elementTransform(this.flowHost);
3458
- this.fDraggableDataContext.draggableItems = [
3459
- new ExternalItemDragHandler(this.getExternalItem(request.event.targetElement))
3460
- ];
3803
+ this.getOutputConnections(request.nodeDragHandler.fNode).forEach((connection) => {
3804
+ const index = this.getExistingConnectionHandlerIndex(request.result, connection);
3805
+ if (index !== -1) {
3806
+ this.updateExistingConnectionHandler(request.result, index, request.nodeDragHandler);
3807
+ }
3808
+ else {
3809
+ request.result.push(this.createNewConnectionHandler(request.nodeDragHandler, request.inputIds, connection));
3810
+ }
3811
+ });
3461
3812
  }
3462
- getExternalItem(targetElement) {
3463
- return this.fExternalItemService.getItem(getExternalItem(targetElement));
3813
+ getOutputConnections(node) {
3814
+ const outputsIds = new Set(this.getOutputsForNode(node).map((x) => x.id));
3815
+ return this.fConnections.filter((x) => outputsIds.has(x.fOutputId));
3464
3816
  }
3465
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: ExternalItemPreparationExecution, deps: [{ token: FComponentsStore }, { token: FDraggableDataContext }, { token: FExternalItemService }], target: i0.ɵɵFactoryTarget.Injectable });
3466
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: ExternalItemPreparationExecution });
3467
- };
3468
- ExternalItemPreparationExecution = __decorate([
3469
- FExecutionRegister(ExternalItemPreparationRequest)
3470
- ], ExternalItemPreparationExecution);
3471
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: ExternalItemPreparationExecution, decorators: [{
3817
+ getOutputsForNode(node) {
3818
+ return this.fComponentsStore.fOutputs.filter((x) => node.isContains(x.hostElement));
3819
+ }
3820
+ getExistingConnectionHandlerIndex(result, connection) {
3821
+ return result.findIndex((x) => x instanceof ConnectionDragHandler && x.connection.fId === connection.fId);
3822
+ }
3823
+ createNewConnectionHandler(nodeDragHandler, inputIds, connection) {
3824
+ let result;
3825
+ if (inputIds.includes(connection.fInputId)) {
3826
+ result = this.getNewConnectionHandler(connection, nodeDragHandler);
3827
+ }
3828
+ else {
3829
+ result = this.getNewSourceConnectionHandler(connection, nodeDragHandler);
3830
+ }
3831
+ return result;
3832
+ }
3833
+ getNewConnectionHandler(connection, nodeDragHandler) {
3834
+ const handler = new ConnectionDragHandler(this.fMediator, connection);
3835
+ handler.setOutputRestrictions(nodeDragHandler.minDistance, nodeDragHandler.maxDistance);
3836
+ return handler;
3837
+ }
3838
+ updateExistingConnectionHandler(result, index, nodeDragHandler) {
3839
+ result[index].setOutputRestrictions(nodeDragHandler.minDistance, nodeDragHandler.maxDistance);
3840
+ }
3841
+ getNewSourceConnectionHandler(connection, nodeDragHandler) {
3842
+ return new ConnectionSourceDragHandler(this.fMediator, connection, nodeDragHandler.minDistance, nodeDragHandler.maxDistance);
3843
+ }
3844
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: PutOutputConnectionHandlersToArrayExecution, deps: [{ token: FComponentsStore }, { token: FFlowMediator }], target: i0.ɵɵFactoryTarget.Injectable });
3845
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: PutOutputConnectionHandlersToArrayExecution });
3846
+ };
3847
+ PutOutputConnectionHandlersToArrayExecution = __decorate([
3848
+ FExecutionRegister(PutOutputConnectionHandlersToArrayRequest)
3849
+ ], PutOutputConnectionHandlersToArrayExecution);
3850
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: PutOutputConnectionHandlersToArrayExecution, decorators: [{
3472
3851
  type: Injectable
3473
- }], ctorParameters: () => [{ type: FComponentsStore }, { type: FDraggableDataContext }, { type: FExternalItemService }] });
3852
+ }], ctorParameters: () => [{ type: FComponentsStore }, { type: FFlowMediator }] });
3474
3853
 
3475
- let ExternalItemPreparationValidator = class ExternalItemPreparationValidator {
3476
- fExternalItemService;
3477
- constructor(fExternalItemService) {
3478
- this.fExternalItemService = fExternalItemService;
3854
+ class GetNodeMoveRestrictionsRequest {
3855
+ fNode;
3856
+ hasParentNodeInSelected;
3857
+ constructor(fNode, hasParentNodeInSelected) {
3858
+ this.fNode = fNode;
3859
+ this.hasParentNodeInSelected = hasParentNodeInSelected;
3860
+ }
3861
+ }
3862
+
3863
+ let GetNodeMoveRestrictionsExecution = class GetNodeMoveRestrictionsExecution {
3864
+ fMediator;
3865
+ constructor(fMediator) {
3866
+ this.fMediator = fMediator;
3479
3867
  }
3480
3868
  handle(request) {
3481
- const externalItem = this.getExternalItem(request.event.targetElement);
3482
- return isExternalItem(request.event.targetElement) && !!externalItem && !externalItem.fDisabled;
3869
+ if (request.fNode.fParentId && !request.hasParentNodeInSelected) {
3870
+ const fParentNodeRect = this.getParentNodeRect(request.fNode);
3871
+ const fCurrentNodeRect = this.getCurrentNodeRect(request.fNode);
3872
+ return {
3873
+ min: PointExtensions.initialize(fParentNodeRect.x - fCurrentNodeRect.x, fParentNodeRect.y - fCurrentNodeRect.y),
3874
+ max: PointExtensions.initialize((fParentNodeRect.x + fParentNodeRect.width) - (fCurrentNodeRect.x + fCurrentNodeRect.width), (fParentNodeRect.y + fParentNodeRect.height) - (fCurrentNodeRect.y + fCurrentNodeRect.height))
3875
+ };
3876
+ }
3877
+ return { ...DEFAULT_RESTRICTIONS };
3483
3878
  }
3484
- getExternalItem(targetElement) {
3485
- return this.fExternalItemService.getItem(getExternalItem(targetElement));
3879
+ getCurrentNodeRect(fNode) {
3880
+ return this.fMediator.send(new GetNormalizedNodeRectRequest(fNode));
3486
3881
  }
3487
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: ExternalItemPreparationValidator, deps: [{ token: FExternalItemService }], target: i0.ɵɵFactoryTarget.Injectable });
3488
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: ExternalItemPreparationValidator });
3882
+ getParentNodeRect(fNode) {
3883
+ return this.fMediator.send(new GetNormalizedParentNodeRectRequest(fNode));
3884
+ }
3885
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: GetNodeMoveRestrictionsExecution, deps: [{ token: FFlowMediator }], target: i0.ɵɵFactoryTarget.Injectable });
3886
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: GetNodeMoveRestrictionsExecution });
3489
3887
  };
3490
- ExternalItemPreparationValidator = __decorate([
3491
- FValidatorRegister(ExternalItemPreparationRequest)
3492
- ], ExternalItemPreparationValidator);
3493
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: ExternalItemPreparationValidator, decorators: [{
3888
+ GetNodeMoveRestrictionsExecution = __decorate([
3889
+ FExecutionRegister(GetNodeMoveRestrictionsRequest)
3890
+ ], GetNodeMoveRestrictionsExecution);
3891
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: GetNodeMoveRestrictionsExecution, decorators: [{
3494
3892
  type: Injectable
3495
- }], ctorParameters: () => [{ type: FExternalItemService }] });
3496
-
3497
- const EXTERNAL_ITEM_PREPARATION_PROVIDERS = [
3498
- ExternalItemPreparationExecution,
3499
- ExternalItemPreparationValidator,
3500
- ];
3501
-
3502
- const EXTERNAL_ITEM_PROVIDERS = [
3503
- ...EXTERNAL_ITEM_FINALIZE_PROVIDERS,
3504
- ...EXTERNAL_ITEM_PREPARATION_PROVIDERS,
3505
- ];
3893
+ }], ctorParameters: () => [{ type: FFlowMediator }] });
3894
+ const DEFAULT_RESTRICTIONS = {
3895
+ min: PointExtensions.initialize(-Infinity, -Infinity),
3896
+ max: PointExtensions.initialize(Infinity, Infinity)
3897
+ };
3506
3898
 
3507
3899
  class CreateMoveNodesDragModelFromSelectionRequest {
3508
3900
  }
@@ -3510,177 +3902,113 @@ class CreateMoveNodesDragModelFromSelectionRequest {
3510
3902
  class NodeDragHandler {
3511
3903
  fDraggableDataContext;
3512
3904
  fNode;
3513
- type = EFDraggableType.NODE;
3905
+ minDistance;
3906
+ maxDistance;
3514
3907
  onPointerDownPosition = PointExtensions.initialize();
3515
- constructor(fDraggableDataContext, fNode) {
3908
+ constructor(fDraggableDataContext, fNode, minDistance, maxDistance) {
3516
3909
  this.fDraggableDataContext = fDraggableDataContext;
3517
3910
  this.fNode = fNode;
3518
- this.onPointerDownPosition = this.fNode.position;
3911
+ this.minDistance = minDistance;
3912
+ this.maxDistance = maxDistance;
3913
+ this.onPointerDownPosition = { ...fNode.position };
3519
3914
  }
3520
3915
  move(difference) {
3521
- const position = Point.fromPoint(this.onPointerDownPosition).add(difference);
3916
+ const restrictedDifference = this.getDifference(difference, { min: this.minDistance, max: this.maxDistance });
3917
+ this.redrawNode(this.getNewPosition(restrictedDifference));
3918
+ this.fDraggableDataContext.fLineAlignment?.handle(restrictedDifference);
3919
+ }
3920
+ getNewPosition(difference) {
3921
+ return Point.fromPoint(this.onPointerDownPosition).add(difference);
3922
+ }
3923
+ getDifference(difference, restrictions) {
3924
+ return {
3925
+ x: Math.min(Math.max(difference.x, restrictions.min.x), restrictions.max.x),
3926
+ y: Math.min(Math.max(difference.y, restrictions.min.y), restrictions.max.y)
3927
+ };
3928
+ }
3929
+ redrawNode(position) {
3522
3930
  this.fNode.updatePosition(position);
3523
3931
  this.fNode.redraw();
3524
- this.fDraggableDataContext.fLineAlignment?.handle(difference);
3525
3932
  }
3526
3933
  complete() {
3527
3934
  this.fNode.positionChange.emit(this.fNode.position);
3528
3935
  }
3529
3936
  }
3530
3937
 
3531
- class ConnectionDragHandler {
3532
- fMediator;
3533
- connection;
3534
- type = EFDraggableType.CONNECTION;
3535
- onPointerDownLine = LineExtensions.initialize();
3536
- fromConnectorSide = EFConnectableSide.BOTTOM;
3537
- toConnectorSide = EFConnectableSide.TOP;
3538
- constructor(fMediator, connection) {
3539
- this.fMediator = fMediator;
3540
- this.connection = connection;
3541
- }
3542
- initialize() {
3543
- const fromConnector = this.fMediator.send(new GetOutputRectInFlowRequest(this.connection.fOutputId));
3544
- this.fromConnectorSide = fromConnector.fConnectableSide;
3545
- const toConnector = this.fMediator.send(new GetInputRectInFlowRequest(this.connection.fInputId));
3546
- this.toConnectorSide = toConnector.fConnectableSide;
3547
- this.onPointerDownLine = this.fMediator.send(new GetConnectionLineRequest(fromConnector.rect, toConnector.rect, this.connection.fBehavior, fromConnector.fConnectableSide, toConnector.fConnectableSide));
3548
- }
3549
- move(difference) {
3550
- const fromPoint = Point.fromPoint(this.onPointerDownLine.point1).add(difference);
3551
- const toPoint = Point.fromPoint(this.onPointerDownLine.point2).add(difference);
3552
- this.connection.setLine(fromPoint, this.fromConnectorSide, toPoint, this.toConnectorSide);
3553
- this.connection.redraw();
3554
- }
3555
- }
3556
-
3557
- class ConnectionSourceDragHandler {
3558
- fMediator;
3559
- connection;
3560
- type = EFDraggableType.CONNECTION;
3561
- fromConnectorRect = new RoundedRect();
3562
- fromConnectorSide = EFConnectableSide.BOTTOM;
3563
- toConnectorRect = new RoundedRect();
3564
- toConnectorSide = EFConnectableSide.TOP;
3565
- constructor(fMediator, connection) {
3566
- this.fMediator = fMediator;
3567
- this.connection = connection;
3568
- }
3569
- initialize() {
3570
- const fromConnector = this.fMediator.send(new GetOutputRectInFlowRequest(this.connection.fOutputId));
3571
- this.fromConnectorRect = RoundedRect.fromRoundedRect(fromConnector.rect);
3572
- this.fromConnectorSide = fromConnector.fConnectableSide;
3573
- const toConnector = this.fMediator.send(new GetInputRectInFlowRequest(this.connection.fInputId));
3574
- this.toConnectorRect = RoundedRect.fromRoundedRect(toConnector.rect);
3575
- this.toConnectorSide = toConnector.fConnectableSide;
3938
+ class NodeResizeByChildDragHandler {
3939
+ fDraggableDataContext;
3940
+ onPointerDownPosition = PointExtensions.initialize();
3941
+ constructor(fDraggableDataContext) {
3942
+ this.fDraggableDataContext = fDraggableDataContext;
3576
3943
  }
3577
3944
  move(difference) {
3578
- const line = this.fMediator.send(new GetConnectionLineRequest(this.fromConnectorRect.addPoint(difference), this.toConnectorRect, this.connection.fBehavior, this.fromConnectorSide, this.toConnectorSide));
3579
- this.connection.setLine(line.point1, this.fromConnectorSide, line.point2, this.toConnectorSide);
3580
- this.connection.redraw();
3581
- }
3582
- }
3583
-
3584
- class ConnectionTargetDragHandler {
3585
- fMediator;
3586
- connection;
3587
- type = EFDraggableType.CONNECTION;
3588
- fromConnectorRect = new RoundedRect();
3589
- fromConnectorSide = EFConnectableSide.BOTTOM;
3590
- toConnectorRect = new RoundedRect();
3591
- toConnectorSide = EFConnectableSide.TOP;
3592
- constructor(fMediator, connection) {
3593
- this.fMediator = fMediator;
3594
- this.connection = connection;
3595
- }
3596
- initialize() {
3597
- const fromConnector = this.fMediator.send(new GetOutputRectInFlowRequest(this.connection.fOutputId));
3598
- this.fromConnectorRect = RoundedRect.fromRoundedRect(fromConnector.rect);
3599
- this.fromConnectorSide = fromConnector.fConnectableSide;
3600
- const toConnector = this.fMediator.send(new GetInputRectInFlowRequest(this.connection.fInputId));
3601
- this.toConnectorRect = RoundedRect.fromRoundedRect(toConnector.rect);
3602
- this.toConnectorSide = toConnector.fConnectableSide;
3603
3945
  }
3604
- move(difference) {
3605
- const line = this.fMediator.send(new GetConnectionLineRequest(this.fromConnectorRect, this.toConnectorRect.addPoint(difference), this.connection.fBehavior, this.fromConnectorSide, this.toConnectorSide));
3606
- this.connection.setLine(line.point1, this.fromConnectorSide, line.point2, this.toConnectorSide);
3607
- this.connection.redraw();
3946
+ complete() {
3608
3947
  }
3609
3948
  }
3610
3949
 
3611
3950
  let CreateMoveNodesDragModelFromSelectionExecution = class CreateMoveNodesDragModelFromSelectionExecution {
3612
3951
  fComponentsStore;
3613
3952
  fDraggableDataContext;
3614
- getOutgoingConnectionsHandler;
3615
- getIncomingConnectionsHandler;
3616
3953
  fMediator;
3617
- constructor(fComponentsStore, fDraggableDataContext, getOutgoingConnectionsHandler, getIncomingConnectionsHandler, fMediator) {
3954
+ constructor(fComponentsStore, fDraggableDataContext, fMediator) {
3618
3955
  this.fComponentsStore = fComponentsStore;
3619
3956
  this.fDraggableDataContext = fDraggableDataContext;
3620
- this.getOutgoingConnectionsHandler = getOutgoingConnectionsHandler;
3621
- this.getIncomingConnectionsHandler = getIncomingConnectionsHandler;
3622
3957
  this.fMediator = fMediator;
3623
3958
  }
3624
3959
  handle(request) {
3625
- const selectedNodes = this.getSelectedNodes();
3626
- return this.getDragHandlersWithConnections(this.getDragHandlersFromNodes(selectedNodes), this.getAllOutputIds(selectedNodes), this.getAllInputIds(selectedNodes));
3960
+ const itemsToDrag = this.getNodesWithRestrictions(this.getSelectedNodes());
3961
+ return this.getDragHandlersWithConnections(this.getDragHandlersFromNodes(itemsToDrag), this.getAllOutputIds(itemsToDrag), this.getAllInputIds(itemsToDrag));
3627
3962
  }
3628
3963
  getSelectedNodes() {
3629
- return this.fDraggableDataContext.selectedItems.map((x) => {
3630
- return this.fComponentsStore.findNode(x.hostElement);
3631
- }).filter((x) => !!x);
3964
+ return this.fDraggableDataContext.selectedItems
3965
+ .map((x) => this.fComponentsStore.findNode(x.hostElement))
3966
+ .filter((x) => !!x);
3967
+ }
3968
+ getNodesWithRestrictions(selectedNodes) {
3969
+ const result = [];
3970
+ selectedNodes.forEach((x) => {
3971
+ const hasParentNodeInSelected = this.fMediator.send(new IsArrayHasParentNodeRequest(x, selectedNodes));
3972
+ const restrictions = this.fMediator.send(new GetNodeMoveRestrictionsRequest(x, hasParentNodeInSelected));
3973
+ const parentNodes = this.fMediator.send(new GetParentNodesRequest(x));
3974
+ result.push({ node: x, parentNodes, ...restrictions }, ...this.getChildrenItemsToDrag(x, restrictions));
3975
+ });
3976
+ return result;
3632
3977
  }
3633
- getAllOutputIds(nodes) {
3634
- return nodes.reduce((result, x) => {
3635
- return result.concat(this.getOutputsForNode(x));
3636
- }, []).map((x) => x.id);
3978
+ getChildrenItemsToDrag(node, restrictions) {
3979
+ return this.getChildrenNodes(node.fId).map((x) => ({ node: x, ...restrictions }));
3980
+ }
3981
+ getChildrenNodes(fId) {
3982
+ return this.fMediator.send(new GetDeepChildrenNodesAndGroupsRequest(fId));
3983
+ }
3984
+ getAllOutputIds(items) {
3985
+ return items.flatMap((x) => this.getOutputsForNode(x.node)).map((x) => x.id);
3637
3986
  }
3638
3987
  getOutputsForNode(node) {
3639
3988
  return this.fComponentsStore.fOutputs.filter((x) => node.isContains(x.hostElement));
3640
3989
  }
3641
- getAllInputIds(nodes) {
3642
- return nodes.reduce((result, x) => {
3643
- return result.concat(this.getInputsForNode(x));
3644
- }, []).map((x) => x.id);
3990
+ getAllInputIds(items) {
3991
+ return items.flatMap((x) => this.getInputsForNode(x.node)).map((x) => x.id);
3645
3992
  }
3646
3993
  getInputsForNode(node) {
3647
3994
  return this.fComponentsStore.fInputs.filter((x) => node.isContains(x.hostElement));
3648
3995
  }
3649
- getDragHandlersFromNodes(nodes) {
3650
- return nodes.map((x) => new NodeDragHandler(this.fDraggableDataContext, x));
3651
- }
3652
- getDragHandlersWithConnections(nodes, outputIds, inputIds) {
3653
- let result = nodes;
3654
- nodes.forEach((nodeHandler) => {
3655
- this.getDragHandlersForOutputConnections(nodeHandler.fNode, inputIds, result);
3656
- this.getDragHandlersForInputConnections(nodeHandler.fNode, outputIds, result);
3996
+ getDragHandlersFromNodes(items) {
3997
+ let result = [];
3998
+ items.forEach((node) => {
3999
+ result.push(new NodeDragHandler(this.fDraggableDataContext, node.node, node.min, node.max), ...(node.parentNodes || []).map((parent) => new NodeResizeByChildDragHandler(this.fDraggableDataContext)));
3657
4000
  });
3658
4001
  return result;
3659
4002
  }
3660
- getDragHandlersForOutputConnections(fNode, inputIds, result) {
3661
- this.getOutgoingConnectionsHandler.handle(this.getOutputsForNode(fNode)).forEach((c) => {
3662
- if (inputIds.includes(c.fInputId)) {
3663
- result.push(new ConnectionDragHandler(this.fMediator, c));
3664
- }
3665
- else {
3666
- result.push(new ConnectionSourceDragHandler(this.fMediator, c));
3667
- }
3668
- });
3669
- }
3670
- getDragHandlersForInputConnections(fNode, outputIds, result) {
3671
- this.getIncomingConnectionsHandler.handle(this.getInputsForNode(fNode)).forEach((c) => {
3672
- if (outputIds.includes(c.fOutputId)) {
3673
- const index = result.findIndex((x) => x.type === EFDraggableType.CONNECTION && x.connection.fConnectionId === c.fConnectionId);
3674
- if (index !== -1) {
3675
- result.push(new ConnectionDragHandler(this.fMediator, c));
3676
- }
3677
- }
3678
- else {
3679
- result.push(new ConnectionTargetDragHandler(this.fMediator, c));
3680
- }
4003
+ getDragHandlersWithConnections(handlers, outputIds, inputIds) {
4004
+ let result = handlers;
4005
+ handlers.filter((x) => x instanceof NodeDragHandler).forEach((dragHandler) => {
4006
+ this.fMediator.send(new PutOutputConnectionHandlersToArrayRequest(dragHandler, inputIds, result));
4007
+ this.fMediator.send(new PutInputConnectionHandlersToArrayRequest(dragHandler, outputIds, result));
3681
4008
  });
4009
+ return result;
3682
4010
  }
3683
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: CreateMoveNodesDragModelFromSelectionExecution, deps: [{ token: FComponentsStore }, { token: FDraggableDataContext }, { token: GetOutgoingConnectionsHandler }, { token: GetIncomingConnectionsHandler }, { token: FFlowMediator }], target: i0.ɵɵFactoryTarget.Injectable });
4011
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: CreateMoveNodesDragModelFromSelectionExecution, deps: [{ token: FComponentsStore }, { token: FDraggableDataContext }, { token: FFlowMediator }], target: i0.ɵɵFactoryTarget.Injectable });
3684
4012
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: CreateMoveNodesDragModelFromSelectionExecution });
3685
4013
  };
3686
4014
  CreateMoveNodesDragModelFromSelectionExecution = __decorate([
@@ -3688,9 +4016,12 @@ CreateMoveNodesDragModelFromSelectionExecution = __decorate([
3688
4016
  ], CreateMoveNodesDragModelFromSelectionExecution);
3689
4017
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: CreateMoveNodesDragModelFromSelectionExecution, decorators: [{
3690
4018
  type: Injectable
3691
- }], ctorParameters: () => [{ type: FComponentsStore }, { type: FDraggableDataContext }, { type: GetOutgoingConnectionsHandler }, { type: GetIncomingConnectionsHandler }, { type: FFlowMediator }] });
4019
+ }], ctorParameters: () => [{ type: FComponentsStore }, { type: FDraggableDataContext }, { type: FFlowMediator }] });
3692
4020
 
3693
4021
  const CREATE_MOVE_NODE_DRAG_MODEL_FROM_SELECTION_PROVIDERS = [
4022
+ GetNodeMoveRestrictionsExecution,
4023
+ PutInputConnectionHandlersToArrayExecution,
4024
+ PutOutputConnectionHandlersToArrayExecution,
3694
4025
  CreateMoveNodesDragModelFromSelectionExecution,
3695
4026
  ];
3696
4027
 
@@ -3738,8 +4069,7 @@ let NodeMovePreparationExecution = class NodeMovePreparationExecution {
3738
4069
  this.fDraggableDataContext.fLineAlignment?.initialize(this.fComponentsStore.fNodes, nodesToDrag);
3739
4070
  }
3740
4071
  filterNodesFromDraggableItems(items) {
3741
- return items.filter((x) => x.type === EFDraggableType.NODE)
3742
- .map(x => x.fNode);
4072
+ return items.filter((x) => x instanceof NodeDragHandler).map(x => x.fNode);
3743
4073
  }
3744
4074
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: NodeMovePreparationExecution, deps: [{ token: FComponentsStore }, { token: FDraggableDataContext }, { token: FFlowMediator }], target: i0.ɵɵFactoryTarget.Injectable });
3745
4075
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: NodeMovePreparationExecution });
@@ -3815,7 +4145,7 @@ let NodeMoveFinalizeExecution = class NodeMoveFinalizeExecution {
3815
4145
  handle(request) {
3816
4146
  const difference = this.getDifferenceWithLineAlignment(this.getDifferenceBetweenPreparationAndFinalize(request.event.getPosition()));
3817
4147
  this.fDraggableDataContext.draggableItems.forEach((x) => {
3818
- x.move(difference);
4148
+ x.move({ ...difference });
3819
4149
  x.complete?.();
3820
4150
  });
3821
4151
  this.fMediator.send(new IsConnectionUnderNodeRequest());
@@ -3833,44 +4163,295 @@ let NodeMoveFinalizeExecution = class NodeMoveFinalizeExecution {
3833
4163
  }
3834
4164
  return difference;
3835
4165
  }
3836
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: NodeMoveFinalizeExecution, deps: [{ token: FComponentsStore }, { token: FDraggableDataContext }, { token: FFlowMediator }], target: i0.ɵɵFactoryTarget.Injectable });
3837
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: NodeMoveFinalizeExecution });
4166
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: NodeMoveFinalizeExecution, deps: [{ token: FComponentsStore }, { token: FDraggableDataContext }, { token: FFlowMediator }], target: i0.ɵɵFactoryTarget.Injectable });
4167
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: NodeMoveFinalizeExecution });
4168
+ };
4169
+ NodeMoveFinalizeExecution = __decorate([
4170
+ FExecutionRegister(NodeMoveFinalizeRequest)
4171
+ ], NodeMoveFinalizeExecution);
4172
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: NodeMoveFinalizeExecution, decorators: [{
4173
+ type: Injectable
4174
+ }], ctorParameters: () => [{ type: FComponentsStore }, { type: FDraggableDataContext }, { type: FFlowMediator }] });
4175
+
4176
+ let NodeMoveFinalizeValidator = class NodeMoveFinalizeValidator {
4177
+ fDraggableDataContext;
4178
+ constructor(fDraggableDataContext) {
4179
+ this.fDraggableDataContext = fDraggableDataContext;
4180
+ }
4181
+ handle(request) {
4182
+ return this.fDraggableDataContext.draggableItems.some((x) => x instanceof NodeDragHandler);
4183
+ }
4184
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: NodeMoveFinalizeValidator, deps: [{ token: FDraggableDataContext }], target: i0.ɵɵFactoryTarget.Injectable });
4185
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: NodeMoveFinalizeValidator });
4186
+ };
4187
+ NodeMoveFinalizeValidator = __decorate([
4188
+ FValidatorRegister(NodeMoveFinalizeRequest)
4189
+ ], NodeMoveFinalizeValidator);
4190
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: NodeMoveFinalizeValidator, decorators: [{
4191
+ type: Injectable
4192
+ }], ctorParameters: () => [{ type: FDraggableDataContext }] });
4193
+
4194
+ const NODE_MOVE_FINALIZE_PROVIDERS = [
4195
+ NodeMoveFinalizeExecution,
4196
+ NodeMoveFinalizeValidator,
4197
+ ];
4198
+
4199
+ const NODE_PROVIDERS = [
4200
+ ...CREATE_MOVE_NODE_DRAG_MODEL_FROM_SELECTION_PROVIDERS,
4201
+ ...NODE_MOVE_FINALIZE_PROVIDERS,
4202
+ ...NODE_MOVE_PREPARATION_PROVIDERS,
4203
+ ];
4204
+
4205
+ class ApplyChildResizeRestrictionsRequest {
4206
+ rect;
4207
+ restrictionsRect;
4208
+ constructor(rect, restrictionsRect) {
4209
+ this.rect = rect;
4210
+ this.restrictionsRect = restrictionsRect;
4211
+ }
4212
+ }
4213
+
4214
+ const OFFSET$1 = 0;
4215
+ let ApplyChildResizeRestrictionsExecution = class ApplyChildResizeRestrictionsExecution {
4216
+ handle(request) {
4217
+ this.applyRestrictions(request.rect, request.restrictionsRect);
4218
+ }
4219
+ applyRestrictions(rect, restrictionsRect) {
4220
+ this.left(rect, restrictionsRect);
4221
+ this.top(rect, restrictionsRect);
4222
+ this.right(rect, restrictionsRect);
4223
+ this.bottom(rect, restrictionsRect);
4224
+ }
4225
+ left(rect, restrictionsRect) {
4226
+ if (rect.x > restrictionsRect.x - OFFSET$1) {
4227
+ rect.width += rect.x - restrictionsRect.x - OFFSET$1;
4228
+ rect.x = restrictionsRect.x - OFFSET$1;
4229
+ }
4230
+ }
4231
+ top(rect, restrictionsRect) {
4232
+ if (rect.y > restrictionsRect.y - OFFSET$1) {
4233
+ rect.height += rect.y - restrictionsRect.y - OFFSET$1;
4234
+ rect.y = restrictionsRect.y - OFFSET$1;
4235
+ }
4236
+ }
4237
+ right(rect, restrictionsRect) {
4238
+ if (rect.x + rect.width <= restrictionsRect.x + restrictionsRect.width + OFFSET$1) {
4239
+ rect.width = restrictionsRect.x + restrictionsRect.width - rect.x + OFFSET$1;
4240
+ }
4241
+ }
4242
+ bottom(rect, restrictionsRect) {
4243
+ if (rect.y + rect.height <= restrictionsRect.y + restrictionsRect.height + OFFSET$1) {
4244
+ rect.height = restrictionsRect.y + restrictionsRect.height - rect.y + OFFSET$1;
4245
+ }
4246
+ }
4247
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: ApplyChildResizeRestrictionsExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4248
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: ApplyChildResizeRestrictionsExecution });
4249
+ };
4250
+ ApplyChildResizeRestrictionsExecution = __decorate([
4251
+ FExecutionRegister(ApplyChildResizeRestrictionsRequest)
4252
+ ], ApplyChildResizeRestrictionsExecution);
4253
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: ApplyChildResizeRestrictionsExecution, decorators: [{
4254
+ type: Injectable
4255
+ }] });
4256
+
4257
+ class ApplyParentResizeRestrictionsRequest {
4258
+ rect;
4259
+ restrictionsRect;
4260
+ constructor(rect, restrictionsRect) {
4261
+ this.rect = rect;
4262
+ this.restrictionsRect = restrictionsRect;
4263
+ }
4264
+ }
4265
+
4266
+ const OFFSET = 0;
4267
+ let ApplyParentResizeRestrictionsExecution = class ApplyParentResizeRestrictionsExecution {
4268
+ handle(request) {
4269
+ this.applyRestrictions(request.rect, request.restrictionsRect);
4270
+ }
4271
+ applyRestrictions(rect, restrictionsRect) {
4272
+ this.left(rect, restrictionsRect);
4273
+ this.top(rect, restrictionsRect);
4274
+ this.right(rect, restrictionsRect);
4275
+ this.bottom(rect, restrictionsRect);
4276
+ }
4277
+ left(rect, restrictionsRect) {
4278
+ if (rect.x <= restrictionsRect.x + OFFSET) {
4279
+ rect.width -= restrictionsRect.x - rect.x + OFFSET;
4280
+ rect.x = restrictionsRect.x + OFFSET;
4281
+ }
4282
+ }
4283
+ top(rect, restrictionsRect) {
4284
+ if (rect.y <= restrictionsRect.y + OFFSET) {
4285
+ rect.height -= restrictionsRect.y - rect.y + OFFSET;
4286
+ rect.y = restrictionsRect.y + OFFSET;
4287
+ }
4288
+ }
4289
+ right(rect, restrictionsRect) {
4290
+ if (rect.x + rect.width > restrictionsRect.x + restrictionsRect.width - OFFSET) {
4291
+ rect.width = restrictionsRect.x + restrictionsRect.width - rect.x - OFFSET;
4292
+ }
4293
+ }
4294
+ bottom(rect, restrictionsRect) {
4295
+ if (rect.y + rect.height > restrictionsRect.y + restrictionsRect.height - OFFSET) {
4296
+ rect.height = restrictionsRect.y + restrictionsRect.height - rect.y - OFFSET;
4297
+ }
4298
+ }
4299
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: ApplyParentResizeRestrictionsExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4300
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: ApplyParentResizeRestrictionsExecution });
4301
+ };
4302
+ ApplyParentResizeRestrictionsExecution = __decorate([
4303
+ FExecutionRegister(ApplyParentResizeRestrictionsRequest)
4304
+ ], ApplyParentResizeRestrictionsExecution);
4305
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: ApplyParentResizeRestrictionsExecution, decorators: [{
4306
+ type: Injectable
4307
+ }] });
4308
+
4309
+ class CalculateChangedPositionRequest {
4310
+ originalRect;
4311
+ changedRect;
4312
+ difference;
4313
+ fResizeHandleType;
4314
+ constructor(originalRect, changedRect, difference, fResizeHandleType) {
4315
+ this.originalRect = originalRect;
4316
+ this.changedRect = changedRect;
4317
+ this.difference = difference;
4318
+ this.fResizeHandleType = fResizeHandleType;
4319
+ }
4320
+ }
4321
+
4322
+ const RESIZE_DIRECTIONS = {
4323
+ [EFResizeHandleType.LEFT_TOP]: { x: -1, y: -1 },
4324
+ [EFResizeHandleType.RIGHT_TOP]: { x: 1, y: -1 },
4325
+ [EFResizeHandleType.RIGHT_BOTTOM]: { x: 1, y: 1 },
4326
+ [EFResizeHandleType.LEFT_BOTTOM]: { x: -1, y: 1 },
4327
+ };
4328
+
4329
+ let CalculateChangedPositionExecution = class CalculateChangedPositionExecution {
4330
+ handle(request) {
4331
+ return this.change(request.originalRect, request.difference, RESIZE_DIRECTIONS[request.fResizeHandleType], request.changedRect);
4332
+ }
4333
+ change(originalRect, difference, direction, changedRect) {
4334
+ return RectExtensions.initialize(originalRect.x + (direction.x === -1 ? difference.x : 0) + changedRect.x, originalRect.y + (direction.y === -1 ? difference.y : 0) + changedRect.y, changedRect.width, changedRect.height);
4335
+ }
4336
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: CalculateChangedPositionExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4337
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: CalculateChangedPositionExecution });
4338
+ };
4339
+ CalculateChangedPositionExecution = __decorate([
4340
+ FExecutionRegister(CalculateChangedPositionRequest)
4341
+ ], CalculateChangedPositionExecution);
4342
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: CalculateChangedPositionExecution, decorators: [{
4343
+ type: Injectable
4344
+ }] });
4345
+
4346
+ class CalculateChangedSizeRequest {
4347
+ originalRect;
4348
+ difference;
4349
+ fResizeHandleType;
4350
+ constructor(originalRect, difference, fResizeHandleType) {
4351
+ this.originalRect = originalRect;
4352
+ this.difference = difference;
4353
+ this.fResizeHandleType = fResizeHandleType;
4354
+ }
4355
+ }
4356
+
4357
+ let CalculateChangedSizeExecution = class CalculateChangedSizeExecution {
4358
+ handle(request) {
4359
+ return this.change(request.originalRect, request.difference, RESIZE_DIRECTIONS[request.fResizeHandleType]);
4360
+ }
4361
+ change(rect, difference, direction) {
4362
+ const result = RectExtensions.initialize(0, 0, rect.width + direction.x * difference.x, rect.height + direction.y * difference.y);
4363
+ if (result.width < 0) {
4364
+ result.x = result.width;
4365
+ result.width = Math.abs(result.width);
4366
+ }
4367
+ if (result.height < 0) {
4368
+ result.y = result.height;
4369
+ result.height = Math.abs(result.height);
4370
+ }
4371
+ return RectExtensions.copy(result);
4372
+ }
4373
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: CalculateChangedSizeExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4374
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: CalculateChangedSizeExecution });
4375
+ };
4376
+ CalculateChangedSizeExecution = __decorate([
4377
+ FExecutionRegister(CalculateChangedSizeRequest)
4378
+ ], CalculateChangedSizeExecution);
4379
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: CalculateChangedSizeExecution, decorators: [{
4380
+ type: Injectable
4381
+ }] });
4382
+
4383
+ class GetNormalizedChildrenNodesRectRequest {
4384
+ fNode;
4385
+ rect;
4386
+ constructor(fNode, rect) {
4387
+ this.fNode = fNode;
4388
+ this.rect = rect;
4389
+ }
4390
+ }
4391
+
4392
+ let GetNormalizedChildrenNodesRectExecution = class GetNormalizedChildrenNodesRectExecution {
4393
+ fMediator;
4394
+ constructor(fMediator) {
4395
+ this.fMediator = fMediator;
4396
+ }
4397
+ handle(request) {
4398
+ const childNodeRect = RectExtensions.union(this.getChildrenNodes(request.fNode.fId).map((x) => this.normalizeRect(x)));
4399
+ return childNodeRect ?
4400
+ this.concatRectWithParentPadding(childNodeRect, this.getNodePadding(request.fNode, request.rect)) : null;
4401
+ }
4402
+ getChildrenNodes(fId) {
4403
+ return this.fMediator.send(new GetDeepChildrenNodesAndGroupsRequest(fId));
4404
+ }
4405
+ normalizeRect(node) {
4406
+ return this.fMediator.send(new GetNormalizedNodeRectRequest(node));
4407
+ }
4408
+ getNodePadding(node, rect) {
4409
+ return this.fMediator.send(new GetNodePaddingRequest(node, rect));
4410
+ }
4411
+ concatRectWithParentPadding(rect, padding) {
4412
+ return RectExtensions.initialize(rect.x - padding[0], rect.y - padding[1], rect.width + padding[0] + padding[2], rect.height + +padding[1] + padding[3]);
4413
+ }
4414
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: GetNormalizedChildrenNodesRectExecution, deps: [{ token: FFlowMediator }], target: i0.ɵɵFactoryTarget.Injectable });
4415
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: GetNormalizedChildrenNodesRectExecution });
3838
4416
  };
3839
- NodeMoveFinalizeExecution = __decorate([
3840
- FExecutionRegister(NodeMoveFinalizeRequest)
3841
- ], NodeMoveFinalizeExecution);
3842
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: NodeMoveFinalizeExecution, decorators: [{
4417
+ GetNormalizedChildrenNodesRectExecution = __decorate([
4418
+ FExecutionRegister(GetNormalizedChildrenNodesRectRequest)
4419
+ ], GetNormalizedChildrenNodesRectExecution);
4420
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: GetNormalizedChildrenNodesRectExecution, decorators: [{
3843
4421
  type: Injectable
3844
- }], ctorParameters: () => [{ type: FComponentsStore }, { type: FDraggableDataContext }, { type: FFlowMediator }] });
4422
+ }], ctorParameters: () => [{ type: FFlowMediator }] });
3845
4423
 
3846
- let NodeMoveFinalizeValidator = class NodeMoveFinalizeValidator {
3847
- fDraggableDataContext;
3848
- constructor(fDraggableDataContext) {
3849
- this.fDraggableDataContext = fDraggableDataContext;
4424
+ class GetNodeResizeRestrictionsRequest {
4425
+ fNode;
4426
+ rect;
4427
+ constructor(fNode, rect) {
4428
+ this.fNode = fNode;
4429
+ this.rect = rect;
4430
+ }
4431
+ }
4432
+
4433
+ let GetNodeResizeRestrictionsExecution = class GetNodeResizeRestrictionsExecution {
4434
+ fMediator;
4435
+ constructor(fMediator) {
4436
+ this.fMediator = fMediator;
3850
4437
  }
3851
4438
  handle(request) {
3852
- return this.fDraggableDataContext.draggableItems.some((x) => x.type === EFDraggableType.NODE);
4439
+ const childRect = this.fMediator.send(new GetNormalizedChildrenNodesRectRequest(request.fNode, request.rect));
4440
+ const parentRect = this.fMediator.send(new GetNormalizedParentNodeRectRequest(request.fNode));
4441
+ return {
4442
+ parentRect,
4443
+ childRect,
4444
+ };
3853
4445
  }
3854
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: NodeMoveFinalizeValidator, deps: [{ token: FDraggableDataContext }], target: i0.ɵɵFactoryTarget.Injectable });
3855
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: NodeMoveFinalizeValidator });
4446
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: GetNodeResizeRestrictionsExecution, deps: [{ token: FFlowMediator }], target: i0.ɵɵFactoryTarget.Injectable });
4447
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: GetNodeResizeRestrictionsExecution });
3856
4448
  };
3857
- NodeMoveFinalizeValidator = __decorate([
3858
- FValidatorRegister(NodeMoveFinalizeRequest)
3859
- ], NodeMoveFinalizeValidator);
3860
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: NodeMoveFinalizeValidator, decorators: [{
4449
+ GetNodeResizeRestrictionsExecution = __decorate([
4450
+ FExecutionRegister(GetNodeResizeRestrictionsRequest)
4451
+ ], GetNodeResizeRestrictionsExecution);
4452
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: GetNodeResizeRestrictionsExecution, decorators: [{
3861
4453
  type: Injectable
3862
- }], ctorParameters: () => [{ type: FDraggableDataContext }] });
3863
-
3864
- const NODE_MOVE_FINALIZE_PROVIDERS = [
3865
- NodeMoveFinalizeExecution,
3866
- NodeMoveFinalizeValidator,
3867
- ];
3868
-
3869
- const NODE_PROVIDERS = [
3870
- ...CREATE_MOVE_NODE_DRAG_MODEL_FROM_SELECTION_PROVIDERS,
3871
- ...NODE_MOVE_FINALIZE_PROVIDERS,
3872
- ...NODE_MOVE_PREPARATION_PROVIDERS,
3873
- ];
4454
+ }], ctorParameters: () => [{ type: FFlowMediator }] });
3874
4455
 
3875
4456
  class NodeResizeFinalizeRequest {
3876
4457
  event;
@@ -3899,13 +4480,59 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
3899
4480
  type: Injectable
3900
4481
  }], ctorParameters: () => [{ type: FDraggableDataContext }] });
3901
4482
 
4483
+ class NodeResizeDragHandler {
4484
+ fMediator;
4485
+ fNode;
4486
+ fResizeHandleType;
4487
+ originalRect;
4488
+ restrictions;
4489
+ childRestrictions = () => { };
4490
+ constructor(fMediator, fNode, fResizeHandleType) {
4491
+ this.fMediator = fMediator;
4492
+ this.fNode = fNode;
4493
+ this.fResizeHandleType = fResizeHandleType;
4494
+ }
4495
+ initialize() {
4496
+ this.originalRect = this.fMediator.send(new GetNormalizedNodeRectRequest(this.fNode));
4497
+ this.restrictions = this.fMediator.send(new GetNodeResizeRestrictionsRequest(this.fNode, this.originalRect));
4498
+ if (this.restrictions.childRect) {
4499
+ this.childRestrictions = (rect, restrictionsRect) => {
4500
+ this.applyChildRestrictions(rect, restrictionsRect);
4501
+ };
4502
+ }
4503
+ }
4504
+ move(difference) {
4505
+ const changedRect = this.changePosition(difference, this.changeSize(difference));
4506
+ this.childRestrictions(changedRect, this.restrictions.childRect);
4507
+ this.applyParentRestrictions(changedRect, this.restrictions.parentRect);
4508
+ this.fNode.updatePosition(changedRect);
4509
+ this.fNode.updateSize(changedRect);
4510
+ this.fNode.redraw();
4511
+ }
4512
+ changeSize(difference) {
4513
+ return this.fMediator.send(new CalculateChangedSizeRequest(this.originalRect, difference, this.fResizeHandleType));
4514
+ }
4515
+ changePosition(difference, changedRect) {
4516
+ return this.fMediator.send(new CalculateChangedPositionRequest(this.originalRect, changedRect, difference, this.fResizeHandleType));
4517
+ }
4518
+ applyChildRestrictions(rect, restrictionsRect) {
4519
+ this.fMediator.send(new ApplyChildResizeRestrictionsRequest(rect, restrictionsRect));
4520
+ }
4521
+ applyParentRestrictions(rect, restrictionsRect) {
4522
+ this.fMediator.send(new ApplyParentResizeRestrictionsRequest(rect, restrictionsRect));
4523
+ }
4524
+ complete() {
4525
+ this.fNode.sizeChange.emit(RectExtensions.initialize(this.fNode.position.x, this.fNode.position.y, this.fNode.size.width, this.fNode.size.height));
4526
+ }
4527
+ }
4528
+
3902
4529
  let NodeResizeFinalizeValidator = class NodeResizeFinalizeValidator {
3903
4530
  fDraggableDataContext;
3904
4531
  constructor(fDraggableDataContext) {
3905
4532
  this.fDraggableDataContext = fDraggableDataContext;
3906
4533
  }
3907
4534
  handle(request) {
3908
- return this.fDraggableDataContext.draggableItems.some((x) => x.type === EFDraggableType.NODE_RESIZE);
4535
+ return this.fDraggableDataContext.draggableItems.some((x) => x instanceof NodeResizeDragHandler);
3909
4536
  }
3910
4537
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: NodeResizeFinalizeValidator, deps: [{ token: FDraggableDataContext }], target: i0.ɵɵFactoryTarget.Injectable });
3911
4538
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: NodeResizeFinalizeValidator });
@@ -3929,57 +4556,6 @@ class NodeResizePreparationRequest {
3929
4556
  }
3930
4557
  }
3931
4558
 
3932
- const RESIZE_DIRECTIONS = {
3933
- [EFResizeHandleType.LEFT_TOP]: { x: -1, y: -1 },
3934
- [EFResizeHandleType.LEFT_BOTTOM]: { x: -1, y: 1 },
3935
- [EFResizeHandleType.RIGHT_TOP]: { x: 1, y: -1 },
3936
- [EFResizeHandleType.RIGHT_BOTTOM]: { x: 1, y: 1 },
3937
- };
3938
- class NodeResizeDragHandler {
3939
- fComponentsStore;
3940
- fNode;
3941
- fResizeHandleType;
3942
- type = EFDraggableType.NODE_RESIZE;
3943
- onPointerDownPosition;
3944
- rect;
3945
- get scale() {
3946
- return this.fComponentsStore.fCanvas.transform.scale;
3947
- }
3948
- constructor(fComponentsStore, fNode, fResizeHandleType) {
3949
- this.fComponentsStore = fComponentsStore;
3950
- this.fNode = fNode;
3951
- this.fResizeHandleType = fResizeHandleType;
3952
- this.onPointerDownPosition = this.fNode.position;
3953
- this.rect = RectExtensions.fromElement(this.fNode.hostElement);
3954
- }
3955
- move(difference) {
3956
- const sizeAndOffset = this.calculateSize(difference, RESIZE_DIRECTIONS[this.fResizeHandleType]);
3957
- const newPosition = this.calculatePosition(difference, RESIZE_DIRECTIONS[this.fResizeHandleType], sizeAndOffset.offsetPosition);
3958
- this.fNode.updatePosition(newPosition);
3959
- this.fNode.updateSize(sizeAndOffset.newSize);
3960
- this.fNode.redraw();
3961
- }
3962
- calculateSize(difference, direction) {
3963
- const newSize = SizeExtensions.initialize(this.rect.width / this.scale + direction.x * difference.x, this.rect.height / this.scale + direction.y * difference.y);
3964
- let offsetPosition = PointExtensions.initialize(0, 0);
3965
- if (newSize.width < 0) {
3966
- offsetPosition.x = newSize.width;
3967
- newSize.width = Math.abs(newSize.width);
3968
- }
3969
- if (newSize.height < 0) {
3970
- offsetPosition.y = newSize.height;
3971
- newSize.height = Math.abs(newSize.height);
3972
- }
3973
- return { newSize, offsetPosition };
3974
- }
3975
- calculatePosition(difference, direction, offsetPosition) {
3976
- return PointExtensions.initialize(this.onPointerDownPosition.x + (direction.x === -1 ? difference.x : 0) + offsetPosition.x, this.onPointerDownPosition.y + (direction.y === -1 ? difference.y : 0) + offsetPosition.y);
3977
- }
3978
- complete() {
3979
- this.fNode.sizeChange.emit(RectExtensions.initialize(this.fNode.position.x, this.fNode.position.y, this.fNode.size.width, this.fNode.size.height));
3980
- }
3981
- }
3982
-
3983
4559
  let NodeResizePreparationExecution = class NodeResizePreparationExecution {
3984
4560
  fComponentsStore;
3985
4561
  fDraggableDataContext;
@@ -3999,7 +4575,7 @@ let NodeResizePreparationExecution = class NodeResizePreparationExecution {
3999
4575
  this.selectAndUpdateNodeLayer(request.event.targetElement);
4000
4576
  const handleType = getValueFromDataAttr(request.event.targetElement, 'fResizeHandleType', '.f-resize-handle');
4001
4577
  const itemsToDrag = [
4002
- new NodeResizeDragHandler(this.fComponentsStore, this.getNode(request.event.targetElement), EFResizeHandleType[handleType])
4578
+ new NodeResizeDragHandler(this.fMediator, this.getNode(request.event.targetElement), EFResizeHandleType[handleType])
4003
4579
  ];
4004
4580
  this.fDraggableDataContext.onPointerDownScale = this.transform.scale;
4005
4581
  this.fDraggableDataContext.onPointerDownPosition = Point.fromPoint(request.event.getPosition())
@@ -4062,186 +4638,16 @@ const NODE_RESIZE_PREPARATION_PROVIDERS = [
4062
4638
  ];
4063
4639
 
4064
4640
  const NODE_RESIZE_PROVIDERS = [
4641
+ ApplyChildResizeRestrictionsExecution,
4642
+ ApplyParentResizeRestrictionsExecution,
4643
+ CalculateChangedPositionExecution,
4644
+ CalculateChangedSizeExecution,
4645
+ GetNormalizedChildrenNodesRectExecution,
4646
+ GetNodeResizeRestrictionsExecution,
4065
4647
  ...NODE_RESIZE_FINALIZE_PROVIDERS,
4066
4648
  ...NODE_RESIZE_PREPARATION_PROVIDERS,
4067
4649
  ];
4068
4650
 
4069
- class SelectionAreaFinalizeRequest {
4070
- event;
4071
- constructor(event) {
4072
- this.event = event;
4073
- }
4074
- }
4075
-
4076
- let SelectionAreaFinalizeExecution = class SelectionAreaFinalizeExecution {
4077
- fDraggableDataContext;
4078
- constructor(fDraggableDataContext) {
4079
- this.fDraggableDataContext = fDraggableDataContext;
4080
- }
4081
- handle(request) {
4082
- this.fDraggableDataContext.draggableItems.forEach((x) => {
4083
- x.complete?.();
4084
- });
4085
- }
4086
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SelectionAreaFinalizeExecution, deps: [{ token: FDraggableDataContext }], target: i0.ɵɵFactoryTarget.Injectable });
4087
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SelectionAreaFinalizeExecution });
4088
- };
4089
- SelectionAreaFinalizeExecution = __decorate([
4090
- FExecutionRegister(SelectionAreaFinalizeRequest)
4091
- ], SelectionAreaFinalizeExecution);
4092
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SelectionAreaFinalizeExecution, decorators: [{
4093
- type: Injectable
4094
- }], ctorParameters: () => [{ type: FDraggableDataContext }] });
4095
-
4096
- let SelectionAreaFinalizeValidator = class SelectionAreaFinalizeValidator {
4097
- fDraggableDataContext;
4098
- constructor(fDraggableDataContext) {
4099
- this.fDraggableDataContext = fDraggableDataContext;
4100
- }
4101
- handle(request) {
4102
- return this.fDraggableDataContext.draggableItems.some((x) => x.type === EFDraggableType.SELECTION);
4103
- }
4104
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SelectionAreaFinalizeValidator, deps: [{ token: FDraggableDataContext }], target: i0.ɵɵFactoryTarget.Injectable });
4105
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SelectionAreaFinalizeValidator });
4106
- };
4107
- SelectionAreaFinalizeValidator = __decorate([
4108
- FValidatorRegister(SelectionAreaFinalizeRequest)
4109
- ], SelectionAreaFinalizeValidator);
4110
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SelectionAreaFinalizeValidator, decorators: [{
4111
- type: Injectable
4112
- }], ctorParameters: () => [{ type: FDraggableDataContext }] });
4113
-
4114
- const SELECTION_AREA_FINALIZE_PROVIDERS = [
4115
- SelectionAreaFinalizeExecution,
4116
- SelectionAreaFinalizeValidator,
4117
- ];
4118
-
4119
- class SelectionAreaPreparationRequest {
4120
- event;
4121
- constructor(event) {
4122
- this.event = event;
4123
- }
4124
- }
4125
-
4126
- class GetCanBeSelectedItemsRequest {
4127
- }
4128
-
4129
- class SelectionAreaDragHandle {
4130
- fComponentsStore;
4131
- fDraggableDataContext;
4132
- fMediator;
4133
- type = EFDraggableType.SELECTION;
4134
- canBeSelected = [];
4135
- selectedByMove = [];
4136
- get canvasPosition() {
4137
- return Point.fromPoint(this.fComponentsStore.fCanvas.transform.position).add(this.fComponentsStore.fCanvas.transform.scaledPosition);
4138
- }
4139
- constructor(fComponentsStore, fDraggableDataContext, fMediator) {
4140
- this.fComponentsStore = fComponentsStore;
4141
- this.fDraggableDataContext = fDraggableDataContext;
4142
- this.fMediator = fMediator;
4143
- }
4144
- initialize() {
4145
- this.canBeSelected = this.fMediator.send(new GetCanBeSelectedItemsRequest());
4146
- this.fDraggableDataContext.fSelectionArea?.show();
4147
- this.fDraggableDataContext.fSelectionArea?.draw({
4148
- left: this.fDraggableDataContext.onPointerDownPosition.x,
4149
- top: this.fDraggableDataContext.onPointerDownPosition.y,
4150
- width: 0,
4151
- height: 0
4152
- });
4153
- }
4154
- move(difference) {
4155
- const currentPoint = Point.fromPoint(difference).add(this.fDraggableDataContext.onPointerDownPosition);
4156
- const x = Math.min(this.fDraggableDataContext.onPointerDownPosition.x, currentPoint.x);
4157
- const y = Math.min(this.fDraggableDataContext.onPointerDownPosition.y, currentPoint.y);
4158
- const width = Math.abs(difference.x);
4159
- const height = Math.abs(difference.y);
4160
- this.fDraggableDataContext.fSelectionArea?.draw({ left: x, top: y, width, height });
4161
- this.selectedByMove = [];
4162
- this.canBeSelected.forEach((item) => {
4163
- item.element.deselect();
4164
- const itemRect = RectExtensions.addPoint(item.rect, this.canvasPosition);
4165
- const isIntersect = RectExtensions.intersectionWithRect(itemRect, RectExtensions.initialize(x, y, width, height));
4166
- if (isIntersect) {
4167
- item.element.select();
4168
- this.selectedByMove.push(item.element);
4169
- }
4170
- });
4171
- this.fMediator.send(new EmitTransformChangesRequest());
4172
- }
4173
- complete() {
4174
- this.fDraggableDataContext.fSelectionArea?.hide();
4175
- this.fDraggableDataContext.selectedItems.push(...this.selectedByMove);
4176
- if (this.selectedByMove.length > 0) {
4177
- this.fDraggableDataContext.isSelectedChanged = true;
4178
- }
4179
- }
4180
- }
4181
-
4182
- let SelectionAreaPreparationExecution = class SelectionAreaPreparationExecution {
4183
- fComponentsStore;
4184
- fDraggableDataContext;
4185
- fMediator;
4186
- get flowHost() {
4187
- return this.fComponentsStore.fFlow.hostElement;
4188
- }
4189
- constructor(fComponentsStore, fDraggableDataContext, fMediator) {
4190
- this.fComponentsStore = fComponentsStore;
4191
- this.fDraggableDataContext = fDraggableDataContext;
4192
- this.fMediator = fMediator;
4193
- }
4194
- handle(request) {
4195
- this.fDraggableDataContext.draggableItems = [
4196
- new SelectionAreaDragHandle(this.fComponentsStore, this.fDraggableDataContext, this.fMediator)
4197
- ];
4198
- this.fDraggableDataContext.onPointerDownScale = 1;
4199
- this.fDraggableDataContext.onPointerDownPosition = Point.fromPoint(request.event.getPosition())
4200
- .elementTransform(this.flowHost);
4201
- }
4202
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SelectionAreaPreparationExecution, deps: [{ token: FComponentsStore }, { token: FDraggableDataContext }, { token: FFlowMediator }], target: i0.ɵɵFactoryTarget.Injectable });
4203
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SelectionAreaPreparationExecution });
4204
- };
4205
- SelectionAreaPreparationExecution = __decorate([
4206
- FExecutionRegister(SelectionAreaPreparationRequest)
4207
- ], SelectionAreaPreparationExecution);
4208
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SelectionAreaPreparationExecution, decorators: [{
4209
- type: Injectable
4210
- }], ctorParameters: () => [{ type: FComponentsStore }, { type: FDraggableDataContext }, { type: FFlowMediator }] });
4211
-
4212
- let SelectionAreaPreparationValidator = class SelectionAreaPreparationValidator {
4213
- fDraggableDataContext;
4214
- constructor(fDraggableDataContext) {
4215
- this.fDraggableDataContext = fDraggableDataContext;
4216
- }
4217
- handle(request) {
4218
- return this.isDragHandlesEmpty()
4219
- && MouseEventExtensions.isShiftPressed(request.event.originalEvent)
4220
- && !!this.fDraggableDataContext.fSelectionArea;
4221
- }
4222
- isDragHandlesEmpty() {
4223
- return !this.fDraggableDataContext.draggableItems.length;
4224
- }
4225
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SelectionAreaPreparationValidator, deps: [{ token: FDraggableDataContext }], target: i0.ɵɵFactoryTarget.Injectable });
4226
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SelectionAreaPreparationValidator });
4227
- };
4228
- SelectionAreaPreparationValidator = __decorate([
4229
- FValidatorRegister(SelectionAreaPreparationRequest)
4230
- ], SelectionAreaPreparationValidator);
4231
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SelectionAreaPreparationValidator, decorators: [{
4232
- type: Injectable
4233
- }], ctorParameters: () => [{ type: FDraggableDataContext }] });
4234
-
4235
- const SELECTION_AREA_PREPARATION_PROVIDERS = [
4236
- SelectionAreaPreparationExecution,
4237
- SelectionAreaPreparationValidator,
4238
- ];
4239
-
4240
- const SELECTION_AREA_PROVIDERS = [
4241
- ...SELECTION_AREA_FINALIZE_PROVIDERS,
4242
- ...SELECTION_AREA_PREPARATION_PROVIDERS
4243
- ];
4244
-
4245
4651
  class SingleSelectRequest {
4246
4652
  event;
4247
4653
  constructor(event) {
@@ -4253,25 +4659,26 @@ let SingleSelectExecution = class SingleSelectExecution {
4253
4659
  platform;
4254
4660
  fComponentsStore;
4255
4661
  fDraggableDataContext;
4256
- getConnectionHandler;
4257
4662
  fMediator;
4258
- constructor(platform, fComponentsStore, fDraggableDataContext, getConnectionHandler, fMediator) {
4663
+ constructor(platform, fComponentsStore, fDraggableDataContext, fMediator) {
4259
4664
  this.platform = platform;
4260
4665
  this.fComponentsStore = fComponentsStore;
4261
4666
  this.fDraggableDataContext = fDraggableDataContext;
4262
- this.getConnectionHandler = getConnectionHandler;
4263
4667
  this.fMediator = fMediator;
4264
4668
  }
4265
4669
  handle(request) {
4266
4670
  const { event } = request;
4267
4671
  const item = this.getSelectableItem(event);
4268
4672
  if (item) {
4269
- this.fMediator.send(new UpdateItemLayerRequest(item, item.hostElement.parentElement));
4673
+ this.fMediator.send(new UpdateItemAndChildrenLayersRequest(item, item.hostElement.parentElement));
4270
4674
  }
4271
4675
  this.isMultiselectEnabled(event) ? this.multiSelect(item) : this.singleSelect(item);
4272
4676
  }
4273
4677
  getSelectableItem(event) {
4274
- return this.fComponentsStore.findNode(event.targetElement) || this.getConnectionHandler.handle(event.targetElement);
4678
+ return this.fComponentsStore.findNode(event.targetElement) || this.getConnectionHandler(event.targetElement);
4679
+ }
4680
+ getConnectionHandler(element) {
4681
+ return this.fComponentsStore.fConnections.find(c => c.isContains(element) || c.fConnectionCenter?.nativeElement?.contains(element));
4275
4682
  }
4276
4683
  isMultiselectEnabled(event) {
4277
4684
  return MouseEventExtensions.isCommandButton(this.platform.getOS(), event.originalEvent) ||
@@ -4313,7 +4720,7 @@ let SingleSelectExecution = class SingleSelectExecution {
4313
4720
  });
4314
4721
  this.fDraggableDataContext.selectedItems = [];
4315
4722
  }
4316
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SingleSelectExecution, deps: [{ token: i1.PlatformService }, { token: FComponentsStore }, { token: FDraggableDataContext }, { token: GetConnectionHandler }, { token: FFlowMediator }], target: i0.ɵɵFactoryTarget.Injectable });
4723
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SingleSelectExecution, deps: [{ token: i3$1.PlatformService }, { token: FComponentsStore }, { token: FDraggableDataContext }, { token: FFlowMediator }], target: i0.ɵɵFactoryTarget.Injectable });
4317
4724
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SingleSelectExecution });
4318
4725
  };
4319
4726
  SingleSelectExecution = __decorate([
@@ -4321,7 +4728,7 @@ SingleSelectExecution = __decorate([
4321
4728
  ], SingleSelectExecution);
4322
4729
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SingleSelectExecution, decorators: [{
4323
4730
  type: Injectable
4324
- }], ctorParameters: () => [{ type: i1.PlatformService }, { type: FComponentsStore }, { type: FDraggableDataContext }, { type: GetConnectionHandler }, { type: FFlowMediator }] });
4731
+ }], ctorParameters: () => [{ type: i3$1.PlatformService }, { type: FComponentsStore }, { type: FDraggableDataContext }, { type: FFlowMediator }] });
4325
4732
 
4326
4733
  let SingleSelectValidator = class SingleSelectValidator {
4327
4734
  fComponentsStore;
@@ -4368,6 +4775,7 @@ class FDraggableBase {
4368
4775
  dragStartTime = 0;
4369
4776
  dragStartPosition = PointExtensions.initialize();
4370
4777
  moveHandler = this.checkDragSequenceToStart;
4778
+ pointerDownElement = null;
4371
4779
  constructor(ngZone) {
4372
4780
  this.ngZone = ngZone;
4373
4781
  }
@@ -4375,6 +4783,7 @@ class FDraggableBase {
4375
4783
  const isSyntheticEvent = this.isSyntheticEvent(event);
4376
4784
  const isFakeEvent = isFakeMousedownFromScreenReader(event);
4377
4785
  const mouseEvent = new IMouseEvent(event);
4786
+ this.pointerDownElement = mouseEvent.targetElement;
4378
4787
  if (isSyntheticEvent || isFakeEvent || this.disabled) {
4379
4788
  return;
4380
4789
  }
@@ -4397,10 +4806,11 @@ class FDraggableBase {
4397
4806
  onTouchDown = (event) => {
4398
4807
  const isFakeEvent = isFakeTouchstartFromScreenReader(event);
4399
4808
  const touchEvent = new ITouchDownEvent(event);
4809
+ this.pointerDownElement = touchEvent.targetElement;
4400
4810
  if (isFakeEvent || this.disabled) {
4401
4811
  return;
4402
4812
  }
4403
- let result = this.onPointerDown(new ITouchDownEvent(event));
4813
+ let result = this.onPointerDown(touchEvent);
4404
4814
  if (result) {
4405
4815
  this.dragStartTime = Date.now();
4406
4816
  this.dragStartPosition = touchEvent.getPosition();
@@ -4427,7 +4837,8 @@ class FDraggableBase {
4427
4837
  };
4428
4838
  checkDragSequenceToStart(event) {
4429
4839
  const pointerPosition = event.getPosition();
4430
- if (!this.isDragStarted) {
4840
+ if (!this.isDragStarted && this.pointerDownElement) {
4841
+ event.setTarget(this.pointerDownElement);
4431
4842
  const distanceX = Math.abs(pointerPosition.x - this.dragStartPosition.x);
4432
4843
  const distanceY = Math.abs(pointerPosition.y - this.dragStartPosition.y);
4433
4844
  const isOverThreshold = distanceX + distanceY >= this.dragStartThreshold;
@@ -4461,6 +4872,7 @@ class FDraggableBase {
4461
4872
  };
4462
4873
  endDragSequence() {
4463
4874
  this.isDragStarted = false;
4875
+ this.pointerDownElement = null;
4464
4876
  this.moveHandler = this.checkDragSequenceToStart;
4465
4877
  this.mouseListeners();
4466
4878
  this.mouseListeners = EventExtensions.emptyListener();
@@ -4468,47 +4880,337 @@ class FDraggableBase {
4468
4880
  this.touchListeners = EventExtensions.emptyListener();
4469
4881
  this.finalizeDragSequence();
4470
4882
  }
4471
- subscribe(document) {
4472
- if (this.document) {
4473
- this.unsubscribe();
4883
+ subscribe(document) {
4884
+ if (this.document) {
4885
+ this.unsubscribe();
4886
+ }
4887
+ this.document = document;
4888
+ this.ngZone?.runOutsideAngular(() => {
4889
+ document.addEventListener('mousedown', this.onMouseDown, EventExtensions.activeListener());
4890
+ document.addEventListener('touchstart', this.onTouchDown, EventExtensions.passiveListener());
4891
+ });
4892
+ this.startListeners = () => {
4893
+ document.removeEventListener('mousedown', this.onMouseDown, EventExtensions.activeListener());
4894
+ document.removeEventListener('touchstart', this.onTouchDown, EventExtensions.passiveListener());
4895
+ };
4896
+ }
4897
+ unsubscribe() {
4898
+ this.startListeners();
4899
+ this.startListeners = EventExtensions.emptyListener();
4900
+ this.touchListeners();
4901
+ this.touchListeners = EventExtensions.emptyListener();
4902
+ this.mouseListeners();
4903
+ this.mouseListeners = EventExtensions.emptyListener();
4904
+ }
4905
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: FDraggableBase, deps: "invalid", target: i0.ɵɵFactoryTarget.Directive });
4906
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.0", type: FDraggableBase, ngImport: i0 });
4907
+ }
4908
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: FDraggableBase, decorators: [{
4909
+ type: Directive
4910
+ }], ctorParameters: () => [{ type: undefined }] });
4911
+ function isTouchEvent(event) {
4912
+ return event.type[0] === 't';
4913
+ }
4914
+ function isFakeMousedownFromScreenReader(event) {
4915
+ return event.buttons === 0 || (event.offsetX === 0 && event.offsetY === 0);
4916
+ }
4917
+ function isFakeTouchstartFromScreenReader(event) {
4918
+ const touch = (event.touches && event.touches[0]) || (event.changedTouches && event.changedTouches[0]);
4919
+ return (!!touch &&
4920
+ touch.identifier === -1 &&
4921
+ (touch.radiusX == null || touch.radiusX === 1) &&
4922
+ (touch.radiusY == null || touch.radiusY === 1));
4923
+ }
4924
+
4925
+ class ExternalItemFinalizeRequest {
4926
+ event;
4927
+ constructor(event) {
4928
+ this.event = event;
4929
+ }
4930
+ }
4931
+
4932
+ class FCreateNodeEvent {
4933
+ rect;
4934
+ data;
4935
+ constructor(rect, data) {
4936
+ this.rect = rect;
4937
+ this.data = data;
4938
+ }
4939
+ }
4940
+
4941
+ let ExternalItemFinalizeExecution = class ExternalItemFinalizeExecution {
4942
+ fComponentsStore;
4943
+ fDraggableDataContext;
4944
+ fMediator;
4945
+ get flowHost() {
4946
+ return this.fComponentsStore.fFlow.hostElement;
4947
+ }
4948
+ get fCreateNode() {
4949
+ return this.fComponentsStore.fDraggable.fCreateNode;
4950
+ }
4951
+ get dragHandler() {
4952
+ return this.fDraggableDataContext.draggableItems[0];
4953
+ }
4954
+ constructor(fComponentsStore, fDraggableDataContext, fMediator) {
4955
+ this.fComponentsStore = fComponentsStore;
4956
+ this.fDraggableDataContext = fDraggableDataContext;
4957
+ this.fMediator = fMediator;
4958
+ }
4959
+ handle(request) {
4960
+ this.emitEvent(this.getExternalItemElementsFromPoint(request.event.getPosition()));
4961
+ this.dragHandler.complete();
4962
+ }
4963
+ getExternalItemElementsFromPoint(position) {
4964
+ return document.elementsFromPoint(position.x, position.y)
4965
+ .filter(x => !x.closest('.f-external-item'));
4966
+ }
4967
+ emitEvent(elements) {
4968
+ if (this.isPointerInCanvasRect(elements)) {
4969
+ this.fCreateNode.emit(new FCreateNodeEvent(this.getRectInCanvas(), this.dragHandler.externalItem.fData));
4970
+ }
4971
+ }
4972
+ isPointerInCanvasRect(elements) {
4973
+ return elements.length ? this.flowHost.contains(elements[0]) : false;
4974
+ }
4975
+ getRectInCanvas() {
4976
+ return this.fMediator.send(new GetElementRectInFlowRequest(this.dragHandler.placeholder));
4977
+ }
4978
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: ExternalItemFinalizeExecution, deps: [{ token: FComponentsStore }, { token: FDraggableDataContext }, { token: FFlowMediator }], target: i0.ɵɵFactoryTarget.Injectable });
4979
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: ExternalItemFinalizeExecution });
4980
+ };
4981
+ ExternalItemFinalizeExecution = __decorate([
4982
+ FExecutionRegister(ExternalItemFinalizeRequest)
4983
+ ], ExternalItemFinalizeExecution);
4984
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: ExternalItemFinalizeExecution, decorators: [{
4985
+ type: Injectable
4986
+ }], ctorParameters: () => [{ type: FComponentsStore }, { type: FDraggableDataContext }, { type: FFlowMediator }] });
4987
+
4988
+ class ExternalItemDragHandler {
4989
+ externalItem;
4990
+ placeholder;
4991
+ onPointerDownRect = RectExtensions.initialize();
4992
+ difference = PointExtensions.initialize();
4993
+ constructor(externalItem) {
4994
+ this.externalItem = externalItem;
4995
+ }
4996
+ getStyle(position) {
4997
+ return `position: absolute; left: 0; top: 0; transform: translate(${position.x}px, ${position.y}px)`;
4998
+ }
4999
+ initialize() {
5000
+ this.onPointerDownRect = this.getExternalItemRect();
5001
+ this.placeholder = DomElementExtensions.deepCloneNode(this.externalItem.hostElement);
5002
+ this.placeholder.setAttribute('style', this.getStyle(Point.fromPoint(this.onPointerDownRect)));
5003
+ document.body.appendChild(this.placeholder);
5004
+ }
5005
+ getExternalItemRect() {
5006
+ const rect = this.externalItem.hostElement.getBoundingClientRect();
5007
+ const scrollTop = window.pageYOffset || document.documentElement.scrollTop;
5008
+ const scrollLeft = window.pageXOffset || document.documentElement.scrollLeft;
5009
+ const offsetTop = rect.top + scrollTop;
5010
+ const offsetLeft = rect.left + scrollLeft;
5011
+ return RectExtensions.initialize(offsetLeft, offsetTop, rect.width, rect.height);
5012
+ }
5013
+ move(difference) {
5014
+ this.difference = difference;
5015
+ const position = Point.fromPoint(this.onPointerDownRect).add(this.difference);
5016
+ this.placeholder.setAttribute('style', this.getStyle(position));
5017
+ }
5018
+ complete() {
5019
+ document.body.removeChild(this.placeholder);
5020
+ }
5021
+ }
5022
+
5023
+ let ExternalItemFinalizeValidator = class ExternalItemFinalizeValidator {
5024
+ fDraggableDataContext;
5025
+ constructor(fDraggableDataContext) {
5026
+ this.fDraggableDataContext = fDraggableDataContext;
5027
+ }
5028
+ handle(request) {
5029
+ return this.fDraggableDataContext.draggableItems.some((x) => x instanceof ExternalItemDragHandler);
5030
+ }
5031
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: ExternalItemFinalizeValidator, deps: [{ token: FDraggableDataContext }], target: i0.ɵɵFactoryTarget.Injectable });
5032
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: ExternalItemFinalizeValidator });
5033
+ };
5034
+ ExternalItemFinalizeValidator = __decorate([
5035
+ FValidatorRegister(ExternalItemFinalizeRequest)
5036
+ ], ExternalItemFinalizeValidator);
5037
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: ExternalItemFinalizeValidator, decorators: [{
5038
+ type: Injectable
5039
+ }], ctorParameters: () => [{ type: FDraggableDataContext }] });
5040
+
5041
+ const EXTERNAL_ITEM_FINALIZE_PROVIDERS = [
5042
+ ExternalItemFinalizeExecution,
5043
+ ExternalItemFinalizeValidator,
5044
+ ];
5045
+
5046
+ class ExternalItemPreparationRequest {
5047
+ event;
5048
+ constructor(event) {
5049
+ this.event = event;
5050
+ }
5051
+ }
5052
+
5053
+ let ExternalItemPreparationExecution = class ExternalItemPreparationExecution {
5054
+ fComponentsStore;
5055
+ fDraggableDataContext;
5056
+ fExternalItemService;
5057
+ get flowHost() {
5058
+ return this.fComponentsStore.fFlow.hostElement;
5059
+ }
5060
+ constructor(fComponentsStore, fDraggableDataContext, fExternalItemService) {
5061
+ this.fComponentsStore = fComponentsStore;
5062
+ this.fDraggableDataContext = fDraggableDataContext;
5063
+ this.fExternalItemService = fExternalItemService;
5064
+ }
5065
+ handle(request) {
5066
+ this.fDraggableDataContext.onPointerDownScale = 1;
5067
+ this.fDraggableDataContext.onPointerDownPosition = Point.fromPoint(request.event.getPosition()).elementTransform(this.flowHost);
5068
+ this.fDraggableDataContext.draggableItems = [
5069
+ new ExternalItemDragHandler(this.getExternalItem(request.event.targetElement))
5070
+ ];
5071
+ }
5072
+ getExternalItem(targetElement) {
5073
+ return this.fExternalItemService.getItem(getExternalItem(targetElement));
5074
+ }
5075
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: ExternalItemPreparationExecution, deps: [{ token: FComponentsStore }, { token: FDraggableDataContext }, { token: FExternalItemService }], target: i0.ɵɵFactoryTarget.Injectable });
5076
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: ExternalItemPreparationExecution });
5077
+ };
5078
+ ExternalItemPreparationExecution = __decorate([
5079
+ FExecutionRegister(ExternalItemPreparationRequest)
5080
+ ], ExternalItemPreparationExecution);
5081
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: ExternalItemPreparationExecution, decorators: [{
5082
+ type: Injectable
5083
+ }], ctorParameters: () => [{ type: FComponentsStore }, { type: FDraggableDataContext }, { type: FExternalItemService }] });
5084
+
5085
+ let ExternalItemPreparationValidator = class ExternalItemPreparationValidator {
5086
+ fExternalItemService;
5087
+ constructor(fExternalItemService) {
5088
+ this.fExternalItemService = fExternalItemService;
5089
+ }
5090
+ handle(request) {
5091
+ const externalItem = this.getExternalItem(request.event.targetElement);
5092
+ return isExternalItem(request.event.targetElement) && !!externalItem && !externalItem.fDisabled;
5093
+ }
5094
+ getExternalItem(targetElement) {
5095
+ return this.fExternalItemService.getItem(getExternalItem(targetElement));
5096
+ }
5097
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: ExternalItemPreparationValidator, deps: [{ token: FExternalItemService }], target: i0.ɵɵFactoryTarget.Injectable });
5098
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: ExternalItemPreparationValidator });
5099
+ };
5100
+ ExternalItemPreparationValidator = __decorate([
5101
+ FValidatorRegister(ExternalItemPreparationRequest)
5102
+ ], ExternalItemPreparationValidator);
5103
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: ExternalItemPreparationValidator, decorators: [{
5104
+ type: Injectable
5105
+ }], ctorParameters: () => [{ type: FExternalItemService }] });
5106
+
5107
+ const EXTERNAL_ITEM_PREPARATION_PROVIDERS = [
5108
+ ExternalItemPreparationExecution,
5109
+ ExternalItemPreparationValidator,
5110
+ ];
5111
+
5112
+ const F_EXTERNAL_ITEM_DRAG_AND_DROP_PROVIDERS = [
5113
+ ...EXTERNAL_ITEM_FINALIZE_PROVIDERS,
5114
+ ...EXTERNAL_ITEM_PREPARATION_PROVIDERS,
5115
+ ];
5116
+
5117
+ const F_EXTERNAL_ITEM = new InjectionToken('F_EXTERNAL_ITEM');
5118
+ class FExternalItemBase {
5119
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: FExternalItemBase, deps: [], target: i0.ɵɵFactoryTarget.Directive });
5120
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.0", type: FExternalItemBase, ngImport: i0 });
5121
+ }
5122
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: FExternalItemBase, decorators: [{
5123
+ type: Directive
5124
+ }] });
5125
+
5126
+ function isExternalItem(element) {
5127
+ return !!element.closest('[fExternalItem]');
5128
+ }
5129
+ function getExternalItem(element) {
5130
+ return element.closest('[fExternalItem]');
5131
+ }
5132
+
5133
+ class FExternalItemService {
5134
+ items = [];
5135
+ registerItem(item) {
5136
+ this.items.push(item);
5137
+ }
5138
+ getItem(element) {
5139
+ return this.items.find(item => item.hostElement === element);
5140
+ }
5141
+ removeItem(item) {
5142
+ const index = this.items.indexOf(item);
5143
+ if (index !== -1) {
5144
+ this.items.splice(index, 1);
4474
5145
  }
4475
- this.document = document;
4476
- this.ngZone?.runOutsideAngular(() => {
4477
- document.addEventListener('mousedown', this.onMouseDown, EventExtensions.activeListener());
4478
- document.addEventListener('touchstart', this.onTouchDown, EventExtensions.passiveListener());
5146
+ }
5147
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: FExternalItemService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
5148
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: FExternalItemService, providedIn: 'root' });
5149
+ }
5150
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: FExternalItemService, decorators: [{
5151
+ type: Injectable,
5152
+ args: [{
5153
+ providedIn: 'root'
5154
+ }]
5155
+ }] });
5156
+
5157
+ let uniqueId$1 = 0;
5158
+ class FExternalItemDirective extends FExternalItemBase {
5159
+ elementReference;
5160
+ fExternalItemService;
5161
+ fExternalItemId = `f-external-item-${uniqueId$1++}`;
5162
+ get hostElement() {
5163
+ return this.elementReference.nativeElement;
5164
+ }
5165
+ fData;
5166
+ fDisabled = false;
5167
+ constructor(elementReference, fExternalItemService) {
5168
+ super();
5169
+ this.elementReference = elementReference;
5170
+ this.fExternalItemService = fExternalItemService;
5171
+ }
5172
+ ngOnInit() {
5173
+ this.fExternalItemService.registerItem(this);
5174
+ this.disablePointerEvents(Array.from(this.hostElement.children));
5175
+ }
5176
+ disablePointerEvents(children) {
5177
+ children.forEach((x) => {
5178
+ x.style.pointerEvents = 'none';
5179
+ this.disablePointerEvents(Array.from(x.children));
4479
5180
  });
4480
- this.startListeners = () => {
4481
- document.removeEventListener('mousedown', this.onMouseDown, EventExtensions.activeListener());
4482
- document.removeEventListener('touchstart', this.onTouchDown, EventExtensions.passiveListener());
4483
- };
4484
5181
  }
4485
- unsubscribe() {
4486
- this.startListeners();
4487
- this.startListeners = EventExtensions.emptyListener();
4488
- this.touchListeners();
4489
- this.touchListeners = EventExtensions.emptyListener();
4490
- this.mouseListeners();
4491
- this.mouseListeners = EventExtensions.emptyListener();
5182
+ ngOnDestroy() {
5183
+ this.fExternalItemService.removeItem(this);
4492
5184
  }
4493
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: FDraggableBase, deps: "invalid", target: i0.ɵɵFactoryTarget.Directive });
4494
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.0", type: FDraggableBase, ngImport: i0 });
4495
- }
4496
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: FDraggableBase, decorators: [{
4497
- type: Directive
4498
- }], ctorParameters: () => [{ type: undefined }] });
4499
- function isTouchEvent(event) {
4500
- return event.type[0] === 't';
4501
- }
4502
- function isFakeMousedownFromScreenReader(event) {
4503
- return event.buttons === 0 || (event.offsetX === 0 && event.offsetY === 0);
4504
- }
4505
- function isFakeTouchstartFromScreenReader(event) {
4506
- const touch = (event.touches && event.touches[0]) || (event.changedTouches && event.changedTouches[0]);
4507
- return (!!touch &&
4508
- touch.identifier === -1 &&
4509
- (touch.radiusX == null || touch.radiusX === 1) &&
4510
- (touch.radiusY == null || touch.radiusY === 1));
5185
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: FExternalItemDirective, deps: [{ token: i0.ElementRef }, { token: FExternalItemService }], target: i0.ɵɵFactoryTarget.Directive });
5186
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.0", type: FExternalItemDirective, selector: "[fExternalItem]", inputs: { fExternalItemId: "fExternalItemId", fData: "fData", fDisabled: "fDisabled" }, host: { properties: { "attr.id": "fExternalItemId", "class.f-external-item-disabled": "fDisabled" }, classAttribute: "f-component f-external-item" }, providers: [
5187
+ { provide: F_EXTERNAL_ITEM, useExisting: FExternalItemDirective }
5188
+ ], usesInheritance: true, ngImport: i0 });
4511
5189
  }
5190
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: FExternalItemDirective, decorators: [{
5191
+ type: Directive,
5192
+ args: [{
5193
+ selector: "[fExternalItem]",
5194
+ host: {
5195
+ '[attr.id]': 'fExternalItemId',
5196
+ class: "f-component f-external-item",
5197
+ '[class.f-external-item-disabled]': 'fDisabled',
5198
+ },
5199
+ providers: [
5200
+ { provide: F_EXTERNAL_ITEM, useExisting: FExternalItemDirective }
5201
+ ],
5202
+ }]
5203
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: FExternalItemService }], propDecorators: { fExternalItemId: [{
5204
+ type: Input
5205
+ }], fData: [{
5206
+ type: Input
5207
+ }], fDisabled: [{
5208
+ type: Input
5209
+ }] } });
5210
+
5211
+ const F_EXTERNAL_ITEM_PROVIDERS = [
5212
+ FExternalItemDirective
5213
+ ];
4512
5214
 
4513
5215
  const F_DRAG_AND_DROP_PLUGIN = new InjectionToken('F_DRAG_AND_DROP_PLUGIN');
4514
5216
 
@@ -4562,7 +5264,6 @@ class FDraggableDirective extends FDraggableBase {
4562
5264
  this.plugins.forEach((p) => {
4563
5265
  p.prepareDragSequence?.(event);
4564
5266
  });
4565
- this.fMediator.send(new SelectionAreaPreparationRequest(event));
4566
5267
  this.fMediator.send(new NodeResizePreparationRequest(event));
4567
5268
  this.fMediator.send(new NodeMovePreparationRequest(event));
4568
5269
  this.fMediator.send(new CanvasMovePreparationRequest(event));
@@ -4601,7 +5302,7 @@ class FDraggableDirective extends FDraggableBase {
4601
5302
  const pointerPositionInCanvas = Point.fromPoint(event.getPosition()).elementTransform(this.hostElement);
4602
5303
  const difference = pointerPositionInCanvas.div(this.fDraggableDataContext.onPointerDownScale).sub(this.fDraggableDataContext.onPointerDownPosition);
4603
5304
  this.fDraggableDataContext.draggableItems.forEach((item) => {
4604
- item.move(difference);
5305
+ item.move({ ...difference });
4605
5306
  });
4606
5307
  }
4607
5308
  onPointerUp(event) {
@@ -4610,7 +5311,6 @@ class FDraggableDirective extends FDraggableBase {
4610
5311
  });
4611
5312
  this.fMediator.send(new ReassignConnectionFinalizeRequest(event));
4612
5313
  this.fMediator.send(new CreateConnectionFinalizeRequest(event));
4613
- this.fMediator.send(new SelectionAreaFinalizeRequest(event));
4614
5314
  this.fMediator.send(new NodeResizeFinalizeRequest(event));
4615
5315
  this.fMediator.send(new NodeMoveFinalizeRequest(event));
4616
5316
  this.fMediator.send(new CanvasMoveFinalizeRequest(event));
@@ -4744,7 +5444,6 @@ class FMinimapDragHandler {
4744
5444
  canvasPosition;
4745
5445
  eventPoint;
4746
5446
  minimap;
4747
- type = EFDraggableType.MINI_MAP;
4748
5447
  lastDifference = null;
4749
5448
  constructor(fComponentsStore, fMediator, flowRect, canvasPosition, eventPoint, minimap) {
4750
5449
  this.fComponentsStore = fComponentsStore;
@@ -4832,82 +5531,256 @@ let MinimapDragPreparationValidator = class MinimapDragPreparationValidator {
4832
5531
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: MinimapDragPreparationValidator, deps: [{ token: FComponentsStore }, { token: FDraggableDataContext }], target: i0.ɵɵFactoryTarget.Injectable });
4833
5532
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: MinimapDragPreparationValidator });
4834
5533
  };
4835
- MinimapDragPreparationValidator = __decorate([
4836
- FValidatorRegister(MinimapDragPreparationRequest)
4837
- ], MinimapDragPreparationValidator);
4838
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: MinimapDragPreparationValidator, decorators: [{
5534
+ MinimapDragPreparationValidator = __decorate([
5535
+ FValidatorRegister(MinimapDragPreparationRequest)
5536
+ ], MinimapDragPreparationValidator);
5537
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: MinimapDragPreparationValidator, decorators: [{
5538
+ type: Injectable
5539
+ }], ctorParameters: () => [{ type: FComponentsStore }, { type: FDraggableDataContext }] });
5540
+
5541
+ const MINIMAP_DRAG_PREPARATION_PROVIDERS = [
5542
+ MinimapDragPreparationExecution,
5543
+ MinimapDragPreparationValidator,
5544
+ ];
5545
+
5546
+ class MinimapDragFinalizeRequest {
5547
+ event;
5548
+ constructor(event) {
5549
+ this.event = event;
5550
+ }
5551
+ }
5552
+
5553
+ let MinimapDragFinalizeExecution = class MinimapDragFinalizeExecution {
5554
+ fDraggableDataContext;
5555
+ constructor(fDraggableDataContext) {
5556
+ this.fDraggableDataContext = fDraggableDataContext;
5557
+ }
5558
+ handle(request) {
5559
+ this.fDraggableDataContext.draggableItems.forEach((x) => {
5560
+ x.complete?.();
5561
+ });
5562
+ }
5563
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: MinimapDragFinalizeExecution, deps: [{ token: FDraggableDataContext }], target: i0.ɵɵFactoryTarget.Injectable });
5564
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: MinimapDragFinalizeExecution });
5565
+ };
5566
+ MinimapDragFinalizeExecution = __decorate([
5567
+ FExecutionRegister(MinimapDragFinalizeRequest)
5568
+ ], MinimapDragFinalizeExecution);
5569
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: MinimapDragFinalizeExecution, decorators: [{
5570
+ type: Injectable
5571
+ }], ctorParameters: () => [{ type: FDraggableDataContext }] });
5572
+
5573
+ let MinimapDragFinalizeValidator = class MinimapDragFinalizeValidator {
5574
+ fDraggableDataContext;
5575
+ constructor(fDraggableDataContext) {
5576
+ this.fDraggableDataContext = fDraggableDataContext;
5577
+ }
5578
+ handle(request) {
5579
+ return this.fDraggableDataContext.draggableItems.some((x) => x instanceof FMinimapDragHandler);
5580
+ }
5581
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: MinimapDragFinalizeValidator, deps: [{ token: FDraggableDataContext }], target: i0.ɵɵFactoryTarget.Injectable });
5582
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: MinimapDragFinalizeValidator });
5583
+ };
5584
+ MinimapDragFinalizeValidator = __decorate([
5585
+ FValidatorRegister(MinimapDragFinalizeRequest)
5586
+ ], MinimapDragFinalizeValidator);
5587
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: MinimapDragFinalizeValidator, decorators: [{
5588
+ type: Injectable
5589
+ }], ctorParameters: () => [{ type: FDraggableDataContext }] });
5590
+
5591
+ const MINIMAP_DRAG_FINALIZE_PROVIDERS = [
5592
+ MinimapDragFinalizeExecution,
5593
+ MinimapDragFinalizeValidator,
5594
+ ];
5595
+
5596
+ const F_MINIMAP_DRAG_AND_DROP_PROVIDERS = [
5597
+ CalculateFlowPointFromMinimapPointExecution,
5598
+ ...MINIMAP_DRAG_FINALIZE_PROVIDERS,
5599
+ ...MINIMAP_DRAG_PREPARATION_PROVIDERS,
5600
+ ];
5601
+
5602
+ class SelectionAreaFinalizeRequest {
5603
+ event;
5604
+ constructor(event) {
5605
+ this.event = event;
5606
+ }
5607
+ }
5608
+
5609
+ let SelectionAreaFinalizeExecution = class SelectionAreaFinalizeExecution {
5610
+ fDraggableDataContext;
5611
+ constructor(fDraggableDataContext) {
5612
+ this.fDraggableDataContext = fDraggableDataContext;
5613
+ }
5614
+ handle(request) {
5615
+ this.fDraggableDataContext.draggableItems.forEach((x) => {
5616
+ x.complete?.();
5617
+ });
5618
+ }
5619
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SelectionAreaFinalizeExecution, deps: [{ token: FDraggableDataContext }], target: i0.ɵɵFactoryTarget.Injectable });
5620
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SelectionAreaFinalizeExecution });
5621
+ };
5622
+ SelectionAreaFinalizeExecution = __decorate([
5623
+ FExecutionRegister(SelectionAreaFinalizeRequest)
5624
+ ], SelectionAreaFinalizeExecution);
5625
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SelectionAreaFinalizeExecution, decorators: [{
5626
+ type: Injectable
5627
+ }], ctorParameters: () => [{ type: FDraggableDataContext }] });
5628
+
5629
+ class GetCanBeSelectedItemsRequest {
5630
+ }
5631
+
5632
+ class SelectionAreaDragHandle {
5633
+ fComponentsStore;
5634
+ fSelectionArea;
5635
+ fDraggableDataContext;
5636
+ fMediator;
5637
+ canBeSelected = [];
5638
+ selectedByMove = [];
5639
+ get canvasPosition() {
5640
+ return Point.fromPoint(this.fComponentsStore.fCanvas.transform.position).add(this.fComponentsStore.fCanvas.transform.scaledPosition);
5641
+ }
5642
+ constructor(fComponentsStore, fSelectionArea, fDraggableDataContext, fMediator) {
5643
+ this.fComponentsStore = fComponentsStore;
5644
+ this.fSelectionArea = fSelectionArea;
5645
+ this.fDraggableDataContext = fDraggableDataContext;
5646
+ this.fMediator = fMediator;
5647
+ }
5648
+ initialize() {
5649
+ this.canBeSelected = this.fMediator.send(new GetCanBeSelectedItemsRequest());
5650
+ this.fSelectionArea.show();
5651
+ this.fSelectionArea.draw(RectExtensions.initialize(this.fDraggableDataContext.onPointerDownPosition.x, this.fDraggableDataContext.onPointerDownPosition.y));
5652
+ }
5653
+ move(difference) {
5654
+ const currentPoint = Point.fromPoint(difference).add(this.fDraggableDataContext.onPointerDownPosition);
5655
+ const x = Math.min(this.fDraggableDataContext.onPointerDownPosition.x, currentPoint.x);
5656
+ const y = Math.min(this.fDraggableDataContext.onPointerDownPosition.y, currentPoint.y);
5657
+ const width = Math.abs(difference.x);
5658
+ const height = Math.abs(difference.y);
5659
+ this.fSelectionArea.draw(RectExtensions.initialize(x, y, width, height));
5660
+ this.selectedByMove = [];
5661
+ this.canBeSelected.forEach((item) => {
5662
+ item.element.deselect();
5663
+ const itemRect = RectExtensions.addPoint(item.rect, this.canvasPosition);
5664
+ const isIntersect = RectExtensions.intersectionWithRect(itemRect, RectExtensions.initialize(x, y, width, height));
5665
+ if (isIntersect) {
5666
+ item.element.select();
5667
+ this.selectedByMove.push(item.element);
5668
+ }
5669
+ });
5670
+ this.fMediator.send(new EmitTransformChangesRequest());
5671
+ }
5672
+ complete() {
5673
+ this.fSelectionArea.hide();
5674
+ this.fDraggableDataContext.selectedItems.push(...this.selectedByMove);
5675
+ if (this.selectedByMove.length > 0) {
5676
+ this.fDraggableDataContext.isSelectedChanged = true;
5677
+ }
5678
+ }
5679
+ }
5680
+
5681
+ let SelectionAreaFinalizeValidator = class SelectionAreaFinalizeValidator {
5682
+ fDraggableDataContext;
5683
+ constructor(fDraggableDataContext) {
5684
+ this.fDraggableDataContext = fDraggableDataContext;
5685
+ }
5686
+ handle(request) {
5687
+ return this.fDraggableDataContext.draggableItems.some((x) => x instanceof SelectionAreaDragHandle);
5688
+ }
5689
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SelectionAreaFinalizeValidator, deps: [{ token: FDraggableDataContext }], target: i0.ɵɵFactoryTarget.Injectable });
5690
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SelectionAreaFinalizeValidator });
5691
+ };
5692
+ SelectionAreaFinalizeValidator = __decorate([
5693
+ FValidatorRegister(SelectionAreaFinalizeRequest)
5694
+ ], SelectionAreaFinalizeValidator);
5695
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SelectionAreaFinalizeValidator, decorators: [{
4839
5696
  type: Injectable
4840
- }], ctorParameters: () => [{ type: FComponentsStore }, { type: FDraggableDataContext }] });
5697
+ }], ctorParameters: () => [{ type: FDraggableDataContext }] });
4841
5698
 
4842
- const MINIMAP_DRAG_PREPARATION_PROVIDERS = [
4843
- MinimapDragPreparationExecution,
4844
- MinimapDragPreparationValidator,
5699
+ const SELECTION_AREA_FINALIZE_PROVIDERS = [
5700
+ SelectionAreaFinalizeExecution,
5701
+ SelectionAreaFinalizeValidator,
4845
5702
  ];
4846
5703
 
4847
- class MinimapDragFinalizeRequest {
5704
+ class SelectionAreaPreparationRequest {
4848
5705
  event;
4849
- constructor(event) {
5706
+ fSelectionArea;
5707
+ constructor(event, fSelectionArea) {
4850
5708
  this.event = event;
5709
+ this.fSelectionArea = fSelectionArea;
4851
5710
  }
4852
5711
  }
4853
5712
 
4854
- let MinimapDragFinalizeExecution = class MinimapDragFinalizeExecution {
5713
+ let SelectionAreaPreparationExecution = class SelectionAreaPreparationExecution {
5714
+ fComponentsStore;
4855
5715
  fDraggableDataContext;
4856
- constructor(fDraggableDataContext) {
5716
+ fMediator;
5717
+ get flowHost() {
5718
+ return this.fComponentsStore.fFlow.hostElement;
5719
+ }
5720
+ constructor(fComponentsStore, fDraggableDataContext, fMediator) {
5721
+ this.fComponentsStore = fComponentsStore;
4857
5722
  this.fDraggableDataContext = fDraggableDataContext;
5723
+ this.fMediator = fMediator;
4858
5724
  }
4859
5725
  handle(request) {
4860
- this.fDraggableDataContext.draggableItems.forEach((x) => {
4861
- x.complete?.();
4862
- });
5726
+ this.fDraggableDataContext.draggableItems = [
5727
+ new SelectionAreaDragHandle(this.fComponentsStore, request.fSelectionArea, this.fDraggableDataContext, this.fMediator)
5728
+ ];
5729
+ this.fDraggableDataContext.onPointerDownScale = 1;
5730
+ this.fDraggableDataContext.onPointerDownPosition = Point.fromPoint(request.event.getPosition())
5731
+ .elementTransform(this.flowHost);
4863
5732
  }
4864
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: MinimapDragFinalizeExecution, deps: [{ token: FDraggableDataContext }], target: i0.ɵɵFactoryTarget.Injectable });
4865
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: MinimapDragFinalizeExecution });
5733
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SelectionAreaPreparationExecution, deps: [{ token: FComponentsStore }, { token: FDraggableDataContext }, { token: FFlowMediator }], target: i0.ɵɵFactoryTarget.Injectable });
5734
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SelectionAreaPreparationExecution });
4866
5735
  };
4867
- MinimapDragFinalizeExecution = __decorate([
4868
- FExecutionRegister(MinimapDragFinalizeRequest)
4869
- ], MinimapDragFinalizeExecution);
4870
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: MinimapDragFinalizeExecution, decorators: [{
5736
+ SelectionAreaPreparationExecution = __decorate([
5737
+ FExecutionRegister(SelectionAreaPreparationRequest)
5738
+ ], SelectionAreaPreparationExecution);
5739
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SelectionAreaPreparationExecution, decorators: [{
4871
5740
  type: Injectable
4872
- }], ctorParameters: () => [{ type: FDraggableDataContext }] });
5741
+ }], ctorParameters: () => [{ type: FComponentsStore }, { type: FDraggableDataContext }, { type: FFlowMediator }] });
4873
5742
 
4874
- let MinimapDragFinalizeValidator = class MinimapDragFinalizeValidator {
5743
+ let SelectionAreaPreparationValidator = class SelectionAreaPreparationValidator {
4875
5744
  fDraggableDataContext;
4876
5745
  constructor(fDraggableDataContext) {
4877
5746
  this.fDraggableDataContext = fDraggableDataContext;
4878
5747
  }
4879
5748
  handle(request) {
4880
- return this.fDraggableDataContext.draggableItems.some((x) => x.constructor.name === FMinimapDragHandler.name);
5749
+ return this.isDragHandlesEmpty()
5750
+ && MouseEventExtensions.isShiftPressed(request.event.originalEvent);
4881
5751
  }
4882
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: MinimapDragFinalizeValidator, deps: [{ token: FDraggableDataContext }], target: i0.ɵɵFactoryTarget.Injectable });
4883
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: MinimapDragFinalizeValidator });
5752
+ isDragHandlesEmpty() {
5753
+ return !this.fDraggableDataContext.draggableItems.length;
5754
+ }
5755
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SelectionAreaPreparationValidator, deps: [{ token: FDraggableDataContext }], target: i0.ɵɵFactoryTarget.Injectable });
5756
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SelectionAreaPreparationValidator });
4884
5757
  };
4885
- MinimapDragFinalizeValidator = __decorate([
4886
- FValidatorRegister(MinimapDragFinalizeRequest)
4887
- ], MinimapDragFinalizeValidator);
4888
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: MinimapDragFinalizeValidator, decorators: [{
5758
+ SelectionAreaPreparationValidator = __decorate([
5759
+ FValidatorRegister(SelectionAreaPreparationRequest)
5760
+ ], SelectionAreaPreparationValidator);
5761
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SelectionAreaPreparationValidator, decorators: [{
4889
5762
  type: Injectable
4890
5763
  }], ctorParameters: () => [{ type: FDraggableDataContext }] });
4891
5764
 
4892
- const MINIMAP_DRAG_FINALIZE_PROVIDERS = [
4893
- MinimapDragFinalizeExecution,
4894
- MinimapDragFinalizeValidator,
5765
+ const SELECTION_AREA_PREPARATION_PROVIDERS = [
5766
+ SelectionAreaPreparationExecution,
5767
+ SelectionAreaPreparationValidator,
4895
5768
  ];
4896
5769
 
4897
- const F_MINIMAP_DRAG_AND_DROP_PROVIDERS = [
4898
- CalculateFlowPointFromMinimapPointExecution,
4899
- ...MINIMAP_DRAG_FINALIZE_PROVIDERS,
4900
- ...MINIMAP_DRAG_PREPARATION_PROVIDERS,
5770
+ const F_SELECTION_AREA_DRAG_AND_DROP_PROVIDERS = [
5771
+ ...SELECTION_AREA_FINALIZE_PROVIDERS,
5772
+ ...SELECTION_AREA_PREPARATION_PROVIDERS
4901
5773
  ];
4902
5774
 
4903
5775
  const F_DRAGGABLE_PROVIDERS = [
4904
5776
  ...CANVAS_PROVIDERS,
4905
5777
  ...CONNECTIONS_PROVIDERS,
5778
+ ...DRAG_AND_DROP_COMMON_PROVIDERS,
4906
5779
  ...SINGLE_SELECT_PROVIDERS,
4907
- ...EXTERNAL_ITEM_PROVIDERS,
5780
+ ...F_EXTERNAL_ITEM_DRAG_AND_DROP_PROVIDERS,
4908
5781
  ...NODE_PROVIDERS,
4909
5782
  ...NODE_RESIZE_PROVIDERS,
4910
- ...SELECTION_AREA_PROVIDERS,
5783
+ ...F_SELECTION_AREA_DRAG_AND_DROP_PROVIDERS,
4911
5784
  ...F_MINIMAP_DRAG_AND_DROP_PROVIDERS
4912
5785
  ];
4913
5786
 
@@ -4917,9 +5790,7 @@ let ClearSelectionExecution = class ClearSelectionExecution {
4917
5790
  this.fDraggableDataContext = fDraggableDataContext;
4918
5791
  }
4919
5792
  handle(request) {
4920
- this.fDraggableDataContext.selectedItems.forEach((x) => {
4921
- x.deselect();
4922
- });
5793
+ this.fDraggableDataContext.selectedItems.forEach((x) => x.deselect());
4923
5794
  this.fDraggableDataContext.selectedItems = [];
4924
5795
  this.fDraggableDataContext.isSelectedChanged = true;
4925
5796
  }
@@ -4945,7 +5816,7 @@ let CreateConnectionMarkersExecution = class CreateConnectionMarkersExecution {
4945
5816
  const element = DomElementExtensions.createSvgElement('defs');
4946
5817
  const fConnection = request.fConnection;
4947
5818
  fConnection.fMarkers.forEach((marker) => {
4948
- const markerElement = this.createMarkerElement(marker, fConnection.fConnectionId);
5819
+ const markerElement = this.createMarkerElement(marker, fConnection.fId);
4949
5820
  const clone = marker.hostElement.cloneNode(true);
4950
5821
  clone.setAttribute('height', `${marker.height}`);
4951
5822
  clone.setAttribute('width', `${marker.width}`);
@@ -5372,6 +6243,42 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
5372
6243
  type: Injectable
5373
6244
  }], ctorParameters: () => [{ type: FComponentsStore }, { type: FDraggableDataContext }, { type: FFlowMediator }] });
5374
6245
 
6246
+ class GetDeepChildrenNodesAndGroupsRequest {
6247
+ fId;
6248
+ constructor(fId) {
6249
+ this.fId = fId;
6250
+ }
6251
+ }
6252
+
6253
+ let GetDeepChildrenNodesAndGroupsExecution = class GetDeepChildrenNodesAndGroupsExecution {
6254
+ fComponentsStore;
6255
+ constructor(fComponentsStore) {
6256
+ this.fComponentsStore = fComponentsStore;
6257
+ }
6258
+ handle(request) {
6259
+ return this.getChildrenNodes(request.fId);
6260
+ }
6261
+ getChildrenNodes(fId, visited = new Set()) {
6262
+ if (visited.has(fId)) {
6263
+ throw new Error('Circular reference detected in the node hierarchy. Node id: ' + fId);
6264
+ }
6265
+ visited.add(fId);
6266
+ const result = this.fComponentsStore.fNodes.filter((x) => x.fParentId === fId);
6267
+ result.forEach((x) => {
6268
+ result.push(...this.getChildrenNodes(x.fId, visited));
6269
+ });
6270
+ return result;
6271
+ }
6272
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: GetDeepChildrenNodesAndGroupsExecution, deps: [{ token: FComponentsStore }], target: i0.ɵɵFactoryTarget.Injectable });
6273
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: GetDeepChildrenNodesAndGroupsExecution });
6274
+ };
6275
+ GetDeepChildrenNodesAndGroupsExecution = __decorate([
6276
+ FExecutionRegister(GetDeepChildrenNodesAndGroupsRequest)
6277
+ ], GetDeepChildrenNodesAndGroupsExecution);
6278
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: GetDeepChildrenNodesAndGroupsExecution, decorators: [{
6279
+ type: Injectable
6280
+ }], ctorParameters: () => [{ type: FComponentsStore }] });
6281
+
5375
6282
  class GetConnectionLineRequest {
5376
6283
  outputRect;
5377
6284
  inputRect;
@@ -5443,10 +6350,10 @@ const positionFixedOutbound = {
5443
6350
  },
5444
6351
  };
5445
6352
 
5446
- class GetExternalNodesRectRequest {
6353
+ class GetScaledNodeRectsWithFlowPositionRequest {
5447
6354
  }
5448
6355
 
5449
- let GetExternalNodesRectExecution = class GetExternalNodesRectExecution {
6356
+ let GetScaledNodeRectsWithFlowPositionExecution = class GetScaledNodeRectsWithFlowPositionExecution {
5450
6357
  fComponentsStore;
5451
6358
  constructor(fComponentsStore) {
5452
6359
  this.fComponentsStore = fComponentsStore;
@@ -5463,13 +6370,13 @@ let GetExternalNodesRectExecution = class GetExternalNodesRectExecution {
5463
6370
  getNodes() {
5464
6371
  return this.fComponentsStore.fNodes;
5465
6372
  }
5466
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: GetExternalNodesRectExecution, deps: [{ token: FComponentsStore }], target: i0.ɵɵFactoryTarget.Injectable });
5467
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: GetExternalNodesRectExecution });
6373
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: GetScaledNodeRectsWithFlowPositionExecution, deps: [{ token: FComponentsStore }], target: i0.ɵɵFactoryTarget.Injectable });
6374
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: GetScaledNodeRectsWithFlowPositionExecution });
5468
6375
  };
5469
- GetExternalNodesRectExecution = __decorate([
5470
- FExecutionRegister(GetExternalNodesRectRequest)
5471
- ], GetExternalNodesRectExecution);
5472
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: GetExternalNodesRectExecution, decorators: [{
6376
+ GetScaledNodeRectsWithFlowPositionExecution = __decorate([
6377
+ FExecutionRegister(GetScaledNodeRectsWithFlowPositionRequest)
6378
+ ], GetScaledNodeRectsWithFlowPositionExecution);
6379
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: GetScaledNodeRectsWithFlowPositionExecution, decorators: [{
5473
6380
  type: Injectable
5474
6381
  }], ctorParameters: () => [{ type: FComponentsStore }] });
5475
6382
 
@@ -5647,66 +6554,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
5647
6554
  type: Injectable
5648
6555
  }], ctorParameters: () => [{ type: FDraggableDataContext }] });
5649
6556
 
5650
- class GetOutgoingConnectionsHandler {
5651
- fComponentsStore;
5652
- get fConnections() {
5653
- return this.fComponentsStore.fConnections;
5654
- }
5655
- constructor(fComponentsStore) {
5656
- this.fComponentsStore = fComponentsStore;
5657
- }
5658
- handle(outputs) {
5659
- const outputsIds = outputs.map((x) => x.id);
5660
- return this.fConnections.filter((x) => {
5661
- return outputsIds.includes(x.fOutputId);
5662
- });
5663
- }
5664
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: GetOutgoingConnectionsHandler, deps: [{ token: FComponentsStore }], target: i0.ɵɵFactoryTarget.Injectable });
5665
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: GetOutgoingConnectionsHandler });
5666
- }
5667
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: GetOutgoingConnectionsHandler, decorators: [{
5668
- type: Injectable
5669
- }], ctorParameters: () => [{ type: FComponentsStore }] });
5670
-
5671
- class GetIncomingConnectionsHandler {
5672
- fComponentsStore;
5673
- get fConnections() {
5674
- return this.fComponentsStore.fConnections;
5675
- }
5676
- constructor(fComponentsStore) {
5677
- this.fComponentsStore = fComponentsStore;
5678
- }
5679
- handle(inputs) {
5680
- const inputsIds = inputs.map((x) => x.id);
5681
- return this.fConnections.filter((x) => {
5682
- return inputsIds.includes(x.fInputId);
5683
- });
5684
- }
5685
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: GetIncomingConnectionsHandler, deps: [{ token: FComponentsStore }], target: i0.ɵɵFactoryTarget.Injectable });
5686
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: GetIncomingConnectionsHandler });
5687
- }
5688
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: GetIncomingConnectionsHandler, decorators: [{
5689
- type: Injectable
5690
- }], ctorParameters: () => [{ type: FComponentsStore }] });
5691
-
5692
6557
  let IsConnectionUnderNodeExecution = class IsConnectionUnderNodeExecution {
5693
6558
  fComponentsStore;
5694
6559
  fDraggableDataContext;
5695
6560
  fMediator;
5696
- getOutgoingConnectionsHandler;
5697
- getIncomingConnectionsHandler;
5698
6561
  get transform() {
5699
6562
  return this.fComponentsStore.fCanvas.transform;
5700
6563
  }
5701
6564
  get flowHost() {
5702
6565
  return this.fComponentsStore.fFlow.hostElement;
5703
6566
  }
5704
- constructor(fComponentsStore, fDraggableDataContext, fMediator, getOutgoingConnectionsHandler, getIncomingConnectionsHandler) {
6567
+ constructor(fComponentsStore, fDraggableDataContext, fMediator) {
5705
6568
  this.fComponentsStore = fComponentsStore;
5706
6569
  this.fDraggableDataContext = fDraggableDataContext;
5707
6570
  this.fMediator = fMediator;
5708
- this.getOutgoingConnectionsHandler = getOutgoingConnectionsHandler;
5709
- this.getIncomingConnectionsHandler = getIncomingConnectionsHandler;
5710
6571
  }
5711
6572
  handle() {
5712
6573
  const isValid = this.isValidRequest();
@@ -5723,19 +6584,19 @@ let IsConnectionUnderNodeExecution = class IsConnectionUnderNodeExecution {
5723
6584
  if (!isCantBeConnectedByInput && outputsOfNode.length && !isCantBeConnectedByOutput && inputsOfNode.length) {
5724
6585
  const output = outputsOfNode[0];
5725
6586
  const input = inputsOfNode[0];
5726
- const outgoingConnections = this.getOutgoingConnectionsHandler.handle([output]);
5727
- const incomingConnections = this.getIncomingConnectionsHandler.handle([input]);
5728
- if (outgoingConnections.length === 0 && incomingConnections.length === 0) {
5729
- const connections = this.findConnectionsUnderNode(fNode);
5730
- if (connections.length) {
5731
- //TODO: need to implement
5732
- }
5733
- }
6587
+ // const outgoingConnections = this.getOutgoingConnectionsHandler.handle([ output ]);
6588
+ // const incomingConnections = this.getIncomingConnectionsHandler.handle([ input ]);
6589
+ // if (outgoingConnections.length === 0 && incomingConnections.length === 0) {
6590
+ // const connections = this.findConnectionsUnderNode(fNode);
6591
+ // if (connections.length) {
6592
+ // //TODO: need to implement
6593
+ // }
6594
+ // }
5734
6595
  }
5735
6596
  }
5736
6597
  isValidRequest() {
5737
6598
  const result = this.fDraggableDataContext.draggableItems.length === 1 &&
5738
- this.fDraggableDataContext.draggableItems[0].type === EFDraggableType.NODE;
6599
+ this.fDraggableDataContext.draggableItems[0] instanceof NodeDragHandler;
5739
6600
  return result;
5740
6601
  }
5741
6602
  getOutputsForNode(node) {
@@ -5751,7 +6612,7 @@ let IsConnectionUnderNodeExecution = class IsConnectionUnderNodeExecution {
5751
6612
  return ([]).length > 0;
5752
6613
  });
5753
6614
  }
5754
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: IsConnectionUnderNodeExecution, deps: [{ token: FComponentsStore }, { token: FDraggableDataContext }, { token: FFlowMediator }, { token: GetOutgoingConnectionsHandler }, { token: GetIncomingConnectionsHandler }], target: i0.ɵɵFactoryTarget.Injectable });
6615
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: IsConnectionUnderNodeExecution, deps: [{ token: FComponentsStore }, { token: FDraggableDataContext }, { token: FFlowMediator }], target: i0.ɵɵFactoryTarget.Injectable });
5755
6616
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: IsConnectionUnderNodeExecution });
5756
6617
  };
5757
6618
  IsConnectionUnderNodeExecution = __decorate([
@@ -5759,7 +6620,7 @@ IsConnectionUnderNodeExecution = __decorate([
5759
6620
  ], IsConnectionUnderNodeExecution);
5760
6621
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: IsConnectionUnderNodeExecution, decorators: [{
5761
6622
  type: Injectable
5762
- }], ctorParameters: () => [{ type: FComponentsStore }, { type: FDraggableDataContext }, { type: FFlowMediator }, { type: GetOutgoingConnectionsHandler }, { type: GetIncomingConnectionsHandler }] });
6623
+ }], ctorParameters: () => [{ type: FComponentsStore }, { type: FDraggableDataContext }, { type: FFlowMediator }] });
5763
6624
 
5764
6625
  class RedrawConnectionsRequest {
5765
6626
  }
@@ -5844,7 +6705,7 @@ let SelectExecution = class SelectExecution {
5844
6705
  }
5845
6706
  });
5846
6707
  request.connections.forEach((key) => {
5847
- const connection = this.fDataContext.fConnections.find((x) => x.fConnectionId === key);
6708
+ const connection = this.fDataContext.fConnections.find((x) => x.fId === key);
5848
6709
  if (connection) {
5849
6710
  connection.select();
5850
6711
  this.fDraggableDataContext.selectedItems.push(connection);
@@ -5904,7 +6765,45 @@ class SelectAndUpdateNodeLayerRequest {
5904
6765
  }
5905
6766
  }
5906
6767
 
5907
- class UpdateItemLayerRequest {
6768
+ class MoveFrontElementsBeforeTargetElementRequest {
6769
+ fItemsContainer;
6770
+ allElements;
6771
+ elementsThatShouldBeInFront;
6772
+ targetIndex;
6773
+ constructor(fItemsContainer, // fGroupsContainer || fNodesContainer || fConnectionsContainer
6774
+ allElements, elementsThatShouldBeInFront, targetIndex) {
6775
+ this.fItemsContainer = fItemsContainer;
6776
+ this.allElements = allElements;
6777
+ this.elementsThatShouldBeInFront = elementsThatShouldBeInFront;
6778
+ this.targetIndex = targetIndex;
6779
+ }
6780
+ }
6781
+
6782
+ let MoveFrontElementsBeforeTargetElementExecution = class MoveFrontElementsBeforeTargetElementExecution {
6783
+ handle(request) {
6784
+ const elementsToMove = [];
6785
+ for (let i = request.targetIndex + 1; i < request.allElements.length; i++) {
6786
+ const element = request.allElements[i];
6787
+ if (!request.elementsThatShouldBeInFront.includes(element)) {
6788
+ elementsToMove.push(element);
6789
+ }
6790
+ }
6791
+ elementsToMove.forEach((x) => {
6792
+ request.fItemsContainer.removeChild(x);
6793
+ request.fItemsContainer.insertBefore(x, request.allElements[request.targetIndex]);
6794
+ });
6795
+ }
6796
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: MoveFrontElementsBeforeTargetElementExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
6797
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: MoveFrontElementsBeforeTargetElementExecution });
6798
+ };
6799
+ MoveFrontElementsBeforeTargetElementExecution = __decorate([
6800
+ FExecutionRegister(MoveFrontElementsBeforeTargetElementRequest)
6801
+ ], MoveFrontElementsBeforeTargetElementExecution);
6802
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: MoveFrontElementsBeforeTargetElementExecution, decorators: [{
6803
+ type: Injectable
6804
+ }] });
6805
+
6806
+ class UpdateItemAndChildrenLayersRequest {
5908
6807
  item;
5909
6808
  itemContainer;
5910
6809
  constructor(item, itemContainer) {
@@ -5913,40 +6812,104 @@ class UpdateItemLayerRequest {
5913
6812
  }
5914
6813
  }
5915
6814
 
5916
- let UpdateItemLayerExecution = class UpdateItemLayerExecution {
6815
+ let UpdateItemAndChildrenLayersExecution = class UpdateItemAndChildrenLayersExecution {
6816
+ fComponentsStore;
6817
+ fMediator;
6818
+ windowService;
6819
+ get fGroupsContainer() {
6820
+ return this.fComponentsStore.fCanvas.fGroupsContainer.nativeElement;
6821
+ }
6822
+ get fNodesContainer() {
6823
+ return this.fComponentsStore.fCanvas.fNodesContainer.nativeElement;
6824
+ }
6825
+ get fConnectionsContainer() {
6826
+ return this.fComponentsStore.fCanvas.fConnectionsContainer.nativeElement;
6827
+ }
6828
+ constructor(fComponentsStore, fMediator, windowService) {
6829
+ this.fComponentsStore = fComponentsStore;
6830
+ this.fMediator = fMediator;
6831
+ this.windowService = windowService;
6832
+ }
5917
6833
  handle(request) {
5918
- const elements = Array.from(request.itemContainer.children);
5919
- const targetIndex = elements.findIndex((x) => x === request.item.hostElement);
5920
- if (targetIndex !== -1 && targetIndex !== elements.length - 1) {
5921
- const afterElements = elements.splice(targetIndex + 1);
5922
- afterElements.forEach((x) => {
5923
- request.itemContainer.removeChild(x);
5924
- request.itemContainer.insertBefore(x, request.item.hostElement);
5925
- });
6834
+ switch (request.itemContainer) {
6835
+ case this.fGroupsContainer:
6836
+ this.handleGroup(request);
6837
+ break;
6838
+ case this.fNodesContainer:
6839
+ this.handleNode(request);
6840
+ break;
6841
+ case this.fConnectionsContainer:
6842
+ this.handleConnection(request);
6843
+ break;
6844
+ default:
6845
+ throw new Error('Unknown container');
6846
+ }
6847
+ }
6848
+ handleGroup(request) {
6849
+ const childrenNodesAndGroups = this.getChildrenNodesAndGroups(request.item.fId);
6850
+ const childrenGroups = this.getChildrenGroups(childrenNodesAndGroups);
6851
+ this.updateLayers(this.fGroupsContainer, request.item.hostElement, childrenGroups);
6852
+ const childrenNodes = this.getChildrenNodes(childrenNodesAndGroups);
6853
+ if (childrenNodes.length) {
6854
+ this.updateLayers(this.fNodesContainer, childrenNodes[0], childrenNodes);
5926
6855
  }
5927
6856
  }
5928
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: UpdateItemLayerExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
5929
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: UpdateItemLayerExecution });
6857
+ handleNode(request) {
6858
+ const childrenNodesAndGroups = this.getChildrenNodesAndGroups(request.item.fId);
6859
+ const childrenNodes = this.getChildrenNodes(childrenNodesAndGroups);
6860
+ this.updateLayers(request.itemContainer, request.item.hostElement, childrenNodes);
6861
+ }
6862
+ handleConnection(request) {
6863
+ this.updateLayers(request.itemContainer, request.item.hostElement, []);
6864
+ }
6865
+ updateLayers(itemContainer, item, elementsThatShouldBeInFront) {
6866
+ const allElements = Array.from(itemContainer.children);
6867
+ const targetIndex = allElements.findIndex((x) => x === item);
6868
+ if (this.isAnythingNeedToBeMoved(allElements, targetIndex, elementsThatShouldBeInFront)) {
6869
+ this.fMediator.send(new MoveFrontElementsBeforeTargetElementRequest(itemContainer, allElements, elementsThatShouldBeInFront, targetIndex));
6870
+ }
6871
+ }
6872
+ isAnythingNeedToBeMoved(allElements, targetIndex, elementsThatShouldBeInFront) {
6873
+ for (let i = targetIndex + 1; i < allElements.length; i++) {
6874
+ if (!elementsThatShouldBeInFront.includes(allElements[i])) {
6875
+ return true;
6876
+ }
6877
+ }
6878
+ return false;
6879
+ }
6880
+ getChildrenGroups(elements) {
6881
+ const allElements = Array.from(this.fGroupsContainer.children);
6882
+ return elements.filter((x) => this.fGroupsContainer.contains(x))
6883
+ .sort((a, b) => allElements.indexOf(a) - allElements.indexOf(b));
6884
+ }
6885
+ getChildrenNodes(elements) {
6886
+ const allElements = Array.from(this.fNodesContainer.children);
6887
+ return elements.filter((x) => this.fNodesContainer.contains(x))
6888
+ .sort((a, b) => allElements.indexOf(a) - allElements.indexOf(b));
6889
+ }
6890
+ getChildrenNodesAndGroups(fId) {
6891
+ return this.fMediator.send(new GetDeepChildrenNodesAndGroupsRequest(fId)).map((x) => x.hostElement);
6892
+ }
6893
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: UpdateItemAndChildrenLayersExecution, deps: [{ token: FComponentsStore }, { token: FFlowMediator }, { token: i3$1.WindowService }], target: i0.ɵɵFactoryTarget.Injectable });
6894
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: UpdateItemAndChildrenLayersExecution });
5930
6895
  };
5931
- UpdateItemLayerExecution = __decorate([
5932
- FExecutionRegister(UpdateItemLayerRequest)
5933
- ], UpdateItemLayerExecution);
5934
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: UpdateItemLayerExecution, decorators: [{
6896
+ UpdateItemAndChildrenLayersExecution = __decorate([
6897
+ FExecutionRegister(UpdateItemAndChildrenLayersRequest)
6898
+ ], UpdateItemAndChildrenLayersExecution);
6899
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: UpdateItemAndChildrenLayersExecution, decorators: [{
5935
6900
  type: Injectable
5936
- }] });
6901
+ }], ctorParameters: () => [{ type: FComponentsStore }, { type: FFlowMediator }, { type: i3$1.WindowService }] });
5937
6902
 
5938
6903
  let SelectAndUpdateNodeLayerExecution = class SelectAndUpdateNodeLayerExecution {
5939
6904
  fDraggableDataContext;
5940
- fComponentsStore;
5941
6905
  fMediator;
5942
- constructor(fDraggableDataContext, fComponentsStore, fMediator) {
6906
+ constructor(fDraggableDataContext, fMediator) {
5943
6907
  this.fDraggableDataContext = fDraggableDataContext;
5944
- this.fComponentsStore = fComponentsStore;
5945
6908
  this.fMediator = fMediator;
5946
6909
  }
5947
6910
  handle(request) {
5948
6911
  this.selectNodeIfNotSelected(request.node);
5949
- this.fMediator.send(new UpdateItemLayerRequest(request.node, this.fComponentsStore.fCanvas.fNodesContainer.nativeElement));
6912
+ this.fMediator.send(new UpdateItemAndChildrenLayersRequest(request.node, request.node.hostElement.parentElement));
5950
6913
  }
5951
6914
  selectNodeIfNotSelected(node) {
5952
6915
  if (!this.fDraggableDataContext.selectedItems.includes(node) && !node.fSelectionDisabled) {
@@ -5955,7 +6918,7 @@ let SelectAndUpdateNodeLayerExecution = class SelectAndUpdateNodeLayerExecution
5955
6918
  this.fDraggableDataContext.isSelectedChanged = true;
5956
6919
  }
5957
6920
  }
5958
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SelectAndUpdateNodeLayerExecution, deps: [{ token: FDraggableDataContext }, { token: FComponentsStore }, { token: FFlowMediator }], target: i0.ɵɵFactoryTarget.Injectable });
6921
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SelectAndUpdateNodeLayerExecution, deps: [{ token: FDraggableDataContext }, { token: FFlowMediator }], target: i0.ɵɵFactoryTarget.Injectable });
5959
6922
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SelectAndUpdateNodeLayerExecution });
5960
6923
  };
5961
6924
  SelectAndUpdateNodeLayerExecution = __decorate([
@@ -5963,7 +6926,146 @@ SelectAndUpdateNodeLayerExecution = __decorate([
5963
6926
  ], SelectAndUpdateNodeLayerExecution);
5964
6927
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SelectAndUpdateNodeLayerExecution, decorators: [{
5965
6928
  type: Injectable
5966
- }], ctorParameters: () => [{ type: FDraggableDataContext }, { type: FComponentsStore }, { type: FFlowMediator }] });
6929
+ }], ctorParameters: () => [{ type: FDraggableDataContext }, { type: FFlowMediator }] });
6930
+
6931
+ class SortNodeLayersRequest {
6932
+ }
6933
+
6934
+ let SortNodeLayersExecution = class SortNodeLayersExecution {
6935
+ fComponentsStore;
6936
+ fMediator;
6937
+ windowService;
6938
+ get fGroupsContainer() {
6939
+ return this.fComponentsStore.fCanvas.fGroupsContainer.nativeElement;
6940
+ }
6941
+ get fNodesContainer() {
6942
+ return this.fComponentsStore.fCanvas.fNodesContainer.nativeElement;
6943
+ }
6944
+ get fNodesContainerElements() {
6945
+ return Array.from(this.fNodesContainer.children);
6946
+ }
6947
+ constructor(fComponentsStore, fMediator, windowService) {
6948
+ this.fComponentsStore = fComponentsStore;
6949
+ this.fMediator = fMediator;
6950
+ this.windowService = windowService;
6951
+ }
6952
+ handle(request) {
6953
+ this.getGroups().forEach((parent) => {
6954
+ this.moveChildrenNodes(this.getSortedChildrenNodes(parent));
6955
+ });
6956
+ }
6957
+ getGroups() {
6958
+ return this.fComponentsStore.fNodes.filter((x) => this.fGroupsContainer.contains(x.hostElement));
6959
+ }
6960
+ getSortedChildrenNodes(parent) {
6961
+ const allElements = this.fNodesContainerElements;
6962
+ return this.getChildrenNodes(parent.fId)
6963
+ .sort((a, b) => allElements.indexOf(a) - allElements.indexOf(b));
6964
+ }
6965
+ getChildrenNodes(fId) {
6966
+ return this.fMediator.send(new GetDeepChildrenNodesAndGroupsRequest(fId))
6967
+ .filter((x) => this.fNodesContainer.contains(x.hostElement)).map((x) => x.hostElement);
6968
+ }
6969
+ moveChildrenNodes(sortedChildrenGroups) {
6970
+ const fragment = this.windowService.getWindow().document.createDocumentFragment();
6971
+ sortedChildrenGroups.forEach((childGroup) => {
6972
+ fragment.appendChild(childGroup); // Append automatically removes the element from its current position
6973
+ });
6974
+ this.fNodesContainer.appendChild(fragment);
6975
+ }
6976
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SortNodeLayersExecution, deps: [{ token: FComponentsStore }, { token: FFlowMediator }, { token: i3$1.WindowService }], target: i0.ɵɵFactoryTarget.Injectable });
6977
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SortNodeLayersExecution });
6978
+ };
6979
+ SortNodeLayersExecution = __decorate([
6980
+ FExecutionRegister(SortNodeLayersRequest)
6981
+ ], SortNodeLayersExecution);
6982
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SortNodeLayersExecution, decorators: [{
6983
+ type: Injectable
6984
+ }], ctorParameters: () => [{ type: FComponentsStore }, { type: FFlowMediator }, { type: i3$1.WindowService }] });
6985
+
6986
+ class SortItemsByParentRequest {
6987
+ fItemsContainer;
6988
+ constructor(fItemsContainer // fGroupsContainer || fNodesContainer
6989
+ ) {
6990
+ this.fItemsContainer = fItemsContainer;
6991
+ }
6992
+ }
6993
+
6994
+ let SortItemsByParentExecution = class SortItemsByParentExecution {
6995
+ fComponentsStore;
6996
+ fMediator;
6997
+ windowService;
6998
+ fItemsContainer;
6999
+ get fItemsFromContainer() {
7000
+ return Array.from(this.fItemsContainer.children);
7001
+ }
7002
+ constructor(fComponentsStore, fMediator, windowService) {
7003
+ this.fComponentsStore = fComponentsStore;
7004
+ this.fMediator = fMediator;
7005
+ this.windowService = windowService;
7006
+ }
7007
+ handle(request) {
7008
+ this.fItemsContainer = request.fItemsContainer;
7009
+ this.getItems().forEach((parent) => {
7010
+ this.moveChildrenItems(this.getSortedChildrenItems(parent), parent);
7011
+ });
7012
+ }
7013
+ getItems() {
7014
+ return this.fComponentsStore.fNodes.filter((x) => this.fItemsContainer.contains(x.hostElement));
7015
+ }
7016
+ getSortedChildrenItems(parent) {
7017
+ const allElements = this.fItemsFromContainer;
7018
+ const parentIndex = allElements.indexOf(parent.hostElement);
7019
+ return this.getChildrenGroups(parent.fId)
7020
+ .filter((child) => allElements.indexOf(child) < parentIndex)
7021
+ .sort((a, b) => allElements.indexOf(a) - allElements.indexOf(b));
7022
+ }
7023
+ getChildrenGroups(fId) {
7024
+ return this.fMediator.send(new GetDeepChildrenNodesAndGroupsRequest(fId))
7025
+ .filter((x) => this.fItemsContainer.contains(x.hostElement)).map((x) => x.hostElement);
7026
+ }
7027
+ moveChildrenItems(sortedChildrenItems, parent) {
7028
+ let nextSibling = parent.hostElement.nextElementSibling;
7029
+ const fragment = this.windowService.getWindow().document.createDocumentFragment();
7030
+ sortedChildrenItems.forEach((child) => {
7031
+ fragment.appendChild(child); // Append automatically removes the element from its current position
7032
+ });
7033
+ this.fItemsContainer.insertBefore(fragment, nextSibling);
7034
+ }
7035
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SortItemsByParentExecution, deps: [{ token: FComponentsStore }, { token: FFlowMediator }, { token: i3$1.WindowService }], target: i0.ɵɵFactoryTarget.Injectable });
7036
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SortItemsByParentExecution });
7037
+ };
7038
+ SortItemsByParentExecution = __decorate([
7039
+ FExecutionRegister(SortItemsByParentRequest)
7040
+ ], SortItemsByParentExecution);
7041
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SortItemsByParentExecution, decorators: [{
7042
+ type: Injectable
7043
+ }], ctorParameters: () => [{ type: FComponentsStore }, { type: FFlowMediator }, { type: i3$1.WindowService }] });
7044
+
7045
+ class SortItemLayersRequest {
7046
+ }
7047
+
7048
+ let SortItemLayersExecution = class SortItemLayersExecution {
7049
+ fMediator;
7050
+ fComponentsStore;
7051
+ constructor(fMediator, fComponentsStore) {
7052
+ this.fMediator = fMediator;
7053
+ this.fComponentsStore = fComponentsStore;
7054
+ }
7055
+ handle(request) {
7056
+ this.fMediator.send(new SortItemsByParentRequest(this.fComponentsStore.fCanvas.fGroupsContainer.nativeElement));
7057
+ this.fMediator.send(new SortNodeLayersRequest());
7058
+ this.fMediator.send(new SortItemsByParentRequest(this.fComponentsStore.fCanvas.fNodesContainer.nativeElement));
7059
+ }
7060
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SortItemLayersExecution, deps: [{ token: FFlowMediator }, { token: FComponentsStore }], target: i0.ɵɵFactoryTarget.Injectable });
7061
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SortItemLayersExecution });
7062
+ };
7063
+ SortItemLayersExecution = __decorate([
7064
+ FExecutionRegister(SortItemLayersRequest)
7065
+ ], SortItemLayersExecution);
7066
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SortItemLayersExecution, decorators: [{
7067
+ type: Injectable
7068
+ }], ctorParameters: () => [{ type: FFlowMediator }, { type: FComponentsStore }] });
5967
7069
 
5968
7070
  class SubscribeOnTransformChangesRequest {
5969
7071
  }
@@ -5976,7 +7078,7 @@ let SubscribeOnTransformChangesExecution = class SubscribeOnTransformChangesExec
5976
7078
  this.fComponentsStore = fComponentsStore;
5977
7079
  }
5978
7080
  handle(request) {
5979
- return merge(this.fTransformStore.changes, this.fComponentsStore.changes);
7081
+ return merge(this.fTransformStore.changes, this.fComponentsStore.componentsData$, this.fComponentsStore.componentsCount$);
5980
7082
  }
5981
7083
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SubscribeOnTransformChangesExecution, deps: [{ token: FTransformStore }, { token: FComponentsStore }], target: i0.ɵɵFactoryTarget.Injectable });
5982
7084
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SubscribeOnTransformChangesExecution });
@@ -6000,24 +7102,6 @@ function getKeyByValue(object, value) {
6000
7102
  return Object.keys(object).find(key => object[key] === value);
6001
7103
  }
6002
7104
 
6003
- class GetConnectionHandler {
6004
- fComponentsStore;
6005
- get fConnections() {
6006
- return this.fComponentsStore.fConnections;
6007
- }
6008
- constructor(fComponentsStore) {
6009
- this.fComponentsStore = fComponentsStore;
6010
- }
6011
- handle(element) {
6012
- return this.fConnections.find(c => c.isContains(element) || c.fConnectionCenter?.nativeElement?.contains(element));
6013
- }
6014
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: GetConnectionHandler, deps: [{ token: FComponentsStore }], target: i0.ɵɵFactoryTarget.Injectable });
6015
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: GetConnectionHandler });
6016
- }
6017
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: GetConnectionHandler, decorators: [{
6018
- type: Injectable
6019
- }], ctorParameters: () => [{ type: FComponentsStore }] });
6020
-
6021
7105
  function getValueFromDataAttr(element, attr, cls) {
6022
7106
  return getClosestTarget(element, cls).dataset[attr];
6023
7107
  }
@@ -6038,9 +7122,10 @@ const COMMON_PROVIDERS = [
6038
7122
  CreateConnectionMarkersExecution,
6039
7123
  EmitTransformChangesExecution,
6040
7124
  GetCanBeSelectedItemsExecution,
7125
+ GetDeepChildrenNodesAndGroupsExecution,
6041
7126
  GetConnectionLineExecution,
6042
7127
  GetElementRectInFlowExecution,
6043
- GetExternalNodesRectExecution,
7128
+ GetScaledNodeRectsWithFlowPositionExecution,
6044
7129
  GetNodesRectExecution,
6045
7130
  GetOutputRectInFlowExecution,
6046
7131
  GetPositionInFlowExecution,
@@ -6050,12 +7135,13 @@ const COMMON_PROVIDERS = [
6050
7135
  SelectExecution,
6051
7136
  SelectAllExecution,
6052
7137
  SelectAndUpdateNodeLayerExecution,
7138
+ SortItemLayersExecution,
7139
+ SortItemsByParentExecution,
7140
+ SortNodeLayersExecution,
6053
7141
  SubscribeOnTransformChangesExecution,
6054
- UpdateItemLayerExecution,
6055
- GetConnectionHandler,
7142
+ UpdateItemAndChildrenLayersExecution,
7143
+ MoveFrontElementsBeforeTargetElementExecution,
6056
7144
  GetInputRectInFlowExecution,
6057
- GetIncomingConnectionsHandler,
6058
- GetOutgoingConnectionsHandler,
6059
7145
  ];
6060
7146
 
6061
7147
  class FCanvasComponent extends FCanvasBase {
@@ -6087,6 +7173,7 @@ class FCanvasComponent extends FCanvasBase {
6087
7173
  get hostElement() {
6088
7174
  return this.elementReference.nativeElement;
6089
7175
  }
7176
+ fGroupsContainer;
6090
7177
  fNodesContainer;
6091
7178
  fConnectionsContainer;
6092
7179
  constructor(elementReference, fMediator, fComponentsStore) {
@@ -6111,7 +7198,7 @@ class FCanvasComponent extends FCanvasBase {
6111
7198
  }, 150);
6112
7199
  }
6113
7200
  fitToScreen(toCenter = PointExtensions.initialize(), animated = true) {
6114
- const fNodesRect = this.fMediator.send(new GetNodesRectRequest());
7201
+ const fNodesRect = this.fMediator.send(new GetNodesRectRequest()) || RectExtensions.initialize();
6115
7202
  if (fNodesRect.width === 0 || fNodesRect.height === 0) {
6116
7203
  return;
6117
7204
  }
@@ -6122,7 +7209,7 @@ class FCanvasComponent extends FCanvasBase {
6122
7209
  this.completeDrag();
6123
7210
  }
6124
7211
  oneToOne() {
6125
- const fNodesRect = this.fMediator.send(new GetNodesRectRequest());
7212
+ const fNodesRect = this.fMediator.send(new GetNodesRectRequest()) || RectExtensions.initialize();
6126
7213
  if (fNodesRect.width === 0 || fNodesRect.height === 0) {
6127
7214
  return;
6128
7215
  }
@@ -6133,19 +7220,22 @@ class FCanvasComponent extends FCanvasBase {
6133
7220
  this.completeDrag();
6134
7221
  }
6135
7222
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: FCanvasComponent, deps: [{ token: i0.ElementRef }, { token: FFlowMediator }, { token: FComponentsStore }], target: i0.ɵɵFactoryTarget.Component });
6136
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.0", type: FCanvasComponent, selector: "f-canvas", inputs: { position: "position", scale: "scale" }, outputs: { fCanvasChange: "fCanvasChange" }, host: { classAttribute: "f-component f-canvas" }, providers: [{ provide: F_CANVAS, useExisting: FCanvasComponent }], viewQueries: [{ propertyName: "fNodesContainer", first: true, predicate: ["fNodesContainer"], descendants: true, static: true }, { propertyName: "fConnectionsContainer", first: true, predicate: ["fConnectionsContainer"], descendants: true, static: true }], exportAs: ["fComponent"], usesInheritance: true, ngImport: i0, template: "<ng-container>\n <div #fConnectionsContainer>\n <ng-content select=\"f-connection\"></ng-content>\n <ng-content select=\"f-connection-for-create\"></ng-content>\n </div>\n <div #fNodesContainer>\n <ng-content select=\"[fGroup]\"></ng-content>\n <ng-content select=\"[fNode]\"></ng-content>\n </div>\n</ng-container>\n", styles: [":host{position:absolute;overflow:visible;width:100%;height:100%;left:0;top:0;transform-origin:0 0;pointer-events:none}:host.f-scaled-animate{transition:transform .09s}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
7223
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.0", type: FCanvasComponent, selector: "f-canvas", inputs: { position: "position", scale: "scale" }, outputs: { fCanvasChange: "fCanvasChange" }, host: { classAttribute: "f-component f-canvas" }, providers: [{ provide: F_CANVAS, useExisting: FCanvasComponent }], viewQueries: [{ propertyName: "fGroupsContainer", first: true, predicate: ["fGroupsContainer"], descendants: true, static: true }, { propertyName: "fNodesContainer", first: true, predicate: ["fNodesContainer"], descendants: true, static: true }, { propertyName: "fConnectionsContainer", first: true, predicate: ["fConnectionsContainer"], descendants: true, static: true }], exportAs: ["fComponent"], usesInheritance: true, ngImport: i0, template: "<ng-container>\n <div #fGroupsContainer>\n <ng-content select=\"[fGroup]\"></ng-content>\n </div>\n <div #fConnectionsContainer>\n <ng-content select=\"f-connection\"></ng-content>\n <ng-content select=\"f-connection-for-create\"></ng-content>\n </div>\n\n <div #fNodesContainer>\n <ng-content select=\"[fNode]\"></ng-content>\n </div>\n</ng-container>\n", styles: [":host{position:absolute;overflow:visible;width:100%;height:100%;left:0;top:0;transform-origin:0 0;pointer-events:none}:host.f-scaled-animate{transition:transform .09s}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
6137
7224
  }
6138
7225
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: FCanvasComponent, decorators: [{
6139
7226
  type: Component,
6140
7227
  args: [{ selector: 'f-canvas', exportAs: 'fComponent', host: {
6141
7228
  'class': 'f-component f-canvas',
6142
- }, providers: [{ provide: F_CANVAS, useExisting: FCanvasComponent }], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container>\n <div #fConnectionsContainer>\n <ng-content select=\"f-connection\"></ng-content>\n <ng-content select=\"f-connection-for-create\"></ng-content>\n </div>\n <div #fNodesContainer>\n <ng-content select=\"[fGroup]\"></ng-content>\n <ng-content select=\"[fNode]\"></ng-content>\n </div>\n</ng-container>\n", styles: [":host{position:absolute;overflow:visible;width:100%;height:100%;left:0;top:0;transform-origin:0 0;pointer-events:none}:host.f-scaled-animate{transition:transform .09s}\n"] }]
7229
+ }, providers: [{ provide: F_CANVAS, useExisting: FCanvasComponent }], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container>\n <div #fGroupsContainer>\n <ng-content select=\"[fGroup]\"></ng-content>\n </div>\n <div #fConnectionsContainer>\n <ng-content select=\"f-connection\"></ng-content>\n <ng-content select=\"f-connection-for-create\"></ng-content>\n </div>\n\n <div #fNodesContainer>\n <ng-content select=\"[fNode]\"></ng-content>\n </div>\n</ng-container>\n", styles: [":host{position:absolute;overflow:visible;width:100%;height:100%;left:0;top:0;transform-origin:0 0;pointer-events:none}:host.f-scaled-animate{transition:transform .09s}\n"] }]
6143
7230
  }], ctorParameters: () => [{ type: i0.ElementRef }, { type: FFlowMediator }, { type: FComponentsStore }], propDecorators: { fCanvasChange: [{
6144
7231
  type: Output
6145
7232
  }], position: [{
6146
7233
  type: Input
6147
7234
  }], scale: [{
6148
7235
  type: Input
7236
+ }], fGroupsContainer: [{
7237
+ type: ViewChild,
7238
+ args: ['fGroupsContainer', { static: true }]
6149
7239
  }], fNodesContainer: [{
6150
7240
  type: ViewChild,
6151
7241
  args: ['fNodesContainer', { static: true }]
@@ -6189,6 +7279,8 @@ class LineService {
6189
7279
  this.hostElement = hostElement;
6190
7280
  this.fHorizontalLine = new LineElement(this.hostElement);
6191
7281
  this.fVerticalLine = new LineElement(this.hostElement);
7282
+ this.fHorizontalLine.hide();
7283
+ this.fVerticalLine.hide();
6192
7284
  }
6193
7285
  drawVerticalLine(x, size, transform) {
6194
7286
  this.fVerticalLine.show();
@@ -6365,7 +7457,7 @@ class FLineAlignmentComponent extends FLineAlignmentBase {
6365
7457
  const draggedNodeRects = currentNodes.map((x) => {
6366
7458
  return this.fMediator.send(new GetElementRectInFlowRequest(x.hostElement));
6367
7459
  });
6368
- this.draggedNodeRect = RectExtensions.union(draggedNodeRects);
7460
+ this.draggedNodeRect = RectExtensions.union(draggedNodeRects) || RectExtensions.initialize();
6369
7461
  const allNodesExcludeCurrents = allNodes.filter((x) => {
6370
7462
  return !currentNodes.includes(x);
6371
7463
  });
@@ -6462,7 +7554,8 @@ class FMinimapFlowDirective {
6462
7554
  return this.ensureMinimumSize(normalizedRect);
6463
7555
  }
6464
7556
  getNodesRect() {
6465
- return RectExtensions.elementTransform(this.fMediator.send(new GetNodesRectRequest()), this.flowHost);
7557
+ const rect = this.fMediator.send(new GetNodesRectRequest()) || RectExtensions.initialize(0, 0, 0, 0);
7558
+ return RectExtensions.elementTransform(rect, this.flowHost);
6466
7559
  }
6467
7560
  getMinimapRect() {
6468
7561
  return RectExtensions.elementTransform(RectExtensions.fromElement(this.hostElement), this.flowHost);
@@ -6504,7 +7597,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
6504
7597
 
6505
7598
  class FMinimapCanvasDirective {
6506
7599
  elementReference;
6507
- fMediator;
6508
7600
  fComponentsStore;
6509
7601
  get hostElement() {
6510
7602
  return this.elementReference.nativeElement;
@@ -6515,9 +7607,8 @@ class FMinimapCanvasDirective {
6515
7607
  get flowScale() {
6516
7608
  return this.fComponentsStore.transform.scale;
6517
7609
  }
6518
- constructor(elementReference, fMediator, fComponentsStore) {
7610
+ constructor(elementReference, fComponentsStore) {
6519
7611
  this.elementReference = elementReference;
6520
- this.fMediator = fMediator;
6521
7612
  this.fComponentsStore = fComponentsStore;
6522
7613
  }
6523
7614
  redraw() {
@@ -6534,7 +7625,7 @@ class FMinimapCanvasDirective {
6534
7625
  }
6535
7626
  configureNodeElement(element, node) {
6536
7627
  this.setElementAttributes(element, this.getNodeRect(node));
6537
- this.applyClassList(element, node);
7628
+ this.applyClassList(element, node, node instanceof FNodeDirective);
6538
7629
  }
6539
7630
  getNodeRect(node) {
6540
7631
  const nodeRectInFlow = RectExtensions.elementTransform(RectExtensions.fromElement(node.hostElement), this.flowHost);
@@ -6546,13 +7637,13 @@ class FMinimapCanvasDirective {
6546
7637
  element.setAttribute('width', rect.width.toString());
6547
7638
  element.setAttribute('height', rect.height.toString());
6548
7639
  }
6549
- applyClassList(element, node) {
6550
- element.classList.add('f-component', 'f-minimap-node');
7640
+ applyClassList(element, node, isNode) {
7641
+ element.classList.add('f-component', isNode ? 'f-minimap-node' : 'f-minimap-group');
6551
7642
  if (node.isSelected()) {
6552
7643
  element.classList.add('f-selected');
6553
7644
  }
6554
7645
  }
6555
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: FMinimapCanvasDirective, deps: [{ token: i0.ElementRef }, { token: FFlowMediator }, { token: FComponentsStore }], target: i0.ɵɵFactoryTarget.Directive });
7646
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: FMinimapCanvasDirective, deps: [{ token: i0.ElementRef }, { token: FComponentsStore }], target: i0.ɵɵFactoryTarget.Directive });
6556
7647
  static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.0", type: FMinimapCanvasDirective, selector: "g[fMinimapCanvas]", ngImport: i0 });
6557
7648
  }
6558
7649
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: FMinimapCanvasDirective, decorators: [{
@@ -6560,7 +7651,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
6560
7651
  args: [{
6561
7652
  selector: 'g[fMinimapCanvas]'
6562
7653
  }]
6563
- }], ctorParameters: () => [{ type: i0.ElementRef }, { type: FFlowMediator }, { type: FComponentsStore }] });
7654
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: FComponentsStore }] });
6564
7655
 
6565
7656
  class FMinimapViewDirective {
6566
7657
  elementReference;
@@ -6664,7 +7755,6 @@ const F_MINIMAP_PROVIDERS = [
6664
7755
  FMinimapFlowDirective,
6665
7756
  ];
6666
7757
 
6667
- const F_SELECTION_AREA = new InjectionToken('F_SELECTION_AREA');
6668
7758
  class FSelectionAreaBase {
6669
7759
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: FSelectionAreaBase, deps: [], target: i0.ɵɵFactoryTarget.Directive });
6670
7760
  static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.0", type: FSelectionAreaBase, ngImport: i0 });
@@ -6675,17 +7765,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
6675
7765
 
6676
7766
  class FSelectionAreaComponent extends FSelectionAreaBase {
6677
7767
  elementReference;
6678
- fDraggableDataContext;
7768
+ fMediator;
6679
7769
  get hostElement() {
6680
7770
  return this.elementReference.nativeElement;
6681
7771
  }
6682
- constructor(elementReference, fDraggableDataContext) {
7772
+ constructor(elementReference, fMediator) {
6683
7773
  super();
6684
7774
  this.elementReference = elementReference;
6685
- this.fDraggableDataContext = fDraggableDataContext;
7775
+ this.fMediator = fMediator;
6686
7776
  }
6687
7777
  ngOnInit() {
6688
- this.fDraggableDataContext.fSelectionArea = this;
6689
7778
  this.hostElement.style.display = 'none';
6690
7779
  }
6691
7780
  hide() {
@@ -6696,14 +7785,20 @@ class FSelectionAreaComponent extends FSelectionAreaBase {
6696
7785
  }
6697
7786
  draw(object) {
6698
7787
  const style = this.hostElement.style;
6699
- style.left = object.left + 'px';
6700
- style.top = object.top + 'px';
7788
+ style.left = object.x + 'px';
7789
+ style.top = object.y + 'px';
6701
7790
  style.width = object.width + 'px';
6702
7791
  style.height = object.height + 'px';
6703
7792
  }
6704
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: FSelectionAreaComponent, deps: [{ token: i0.ElementRef }, { token: FDraggableDataContext }], target: i0.ɵɵFactoryTarget.Component });
7793
+ onPointerDown(event) {
7794
+ this.fMediator.send(new SelectionAreaPreparationRequest(event, this));
7795
+ }
7796
+ onPointerUp(event) {
7797
+ this.fMediator.send(new SelectionAreaFinalizeRequest(event));
7798
+ }
7799
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: FSelectionAreaComponent, deps: [{ token: i0.ElementRef }, { token: FFlowMediator }], target: i0.ɵɵFactoryTarget.Component });
6705
7800
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.0", type: FSelectionAreaComponent, selector: "f-selection-area", host: { classAttribute: "f-selection-area f-component" }, providers: [
6706
- { provide: F_SELECTION_AREA, useExisting: FSelectionAreaComponent }
7801
+ { provide: F_DRAG_AND_DROP_PLUGIN, useExisting: FSelectionAreaComponent },
6707
7802
  ], usesInheritance: true, ngImport: i0, template: ``, isInline: true, styles: [":host{position:absolute}\n"] });
6708
7803
  }
6709
7804
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: FSelectionAreaComponent, decorators: [{
@@ -6711,9 +7806,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
6711
7806
  args: [{ selector: "f-selection-area", template: ``, host: {
6712
7807
  'class': 'f-selection-area f-component'
6713
7808
  }, providers: [
6714
- { provide: F_SELECTION_AREA, useExisting: FSelectionAreaComponent }
7809
+ { provide: F_DRAG_AND_DROP_PLUGIN, useExisting: FSelectionAreaComponent },
6715
7810
  ], styles: [":host{position:absolute}\n"] }]
6716
- }], ctorParameters: () => [{ type: i0.ElementRef }, { type: FDraggableDataContext }] });
7811
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: FFlowMediator }] });
6717
7812
 
6718
7813
  const F_SELECTION_AREA_PROVIDERS = [
6719
7814
  FSelectionAreaComponent
@@ -6746,24 +7841,32 @@ class FFlowComponent extends FFlowBase {
6746
7841
  }
6747
7842
  ngAfterContentInit() {
6748
7843
  this.subscription$.add(this.subscribeOnElementsChanges());
7844
+ this.subscription$.add(this.subscribeOnComponentsCountChanges());
7845
+ }
7846
+ subscribeOnComponentsCountChanges() {
7847
+ return this.fComponentsStore.componentsCount$.pipe(startWith(null), debounceTime(20)).subscribe(() => {
7848
+ this.fMediator.send(new SortItemLayersRequest());
7849
+ });
6749
7850
  }
6750
7851
  subscribeOnElementsChanges() {
6751
- return this.fComponentsStore.changes.pipe(startWith(null), debounceTime(20)).subscribe(() => {
7852
+ return this.fComponentsStore.componentsData$.pipe(startWith(null), debounceTime(20)).subscribe(() => {
6752
7853
  this.fMediator.send(new RedrawConnectionsRequest());
6753
7854
  if (!this.isLoaded) {
6754
7855
  this.isLoaded = true;
6755
- this.fLoaded.emit();
7856
+ setTimeout(() => {
7857
+ this.fLoaded.emit();
7858
+ });
6756
7859
  }
6757
7860
  });
6758
7861
  }
6759
7862
  redraw() {
6760
- this.fComponentsStore.changes.next();
7863
+ this.fComponentsStore.componentDataChanged();
6761
7864
  }
6762
7865
  reset() {
6763
7866
  this.isLoaded = false;
6764
7867
  }
6765
- getNodesRect() {
6766
- return this.fMediator.send(new GetExternalNodesRectRequest());
7868
+ getAllNodesRect() {
7869
+ return this.fMediator.send(new GetScaledNodeRectsWithFlowPositionRequest());
6767
7870
  }
6768
7871
  getSelection() {
6769
7872
  return this.fMediator.send(new GetSelectionRequest());
@@ -6974,7 +8077,7 @@ const F_ZOOM_PROVIDERS = [
6974
8077
 
6975
8078
  class FFlowModule {
6976
8079
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: FFlowModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
6977
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.0", ngImport: i0, type: FFlowModule, declarations: [FBackgroundComponent, FRectPatternComponent, FCirclePatternComponent, FCanvasComponent, FZoomDirective, FConnectionTextComponent, FConnectionTextPathDirective, FConnectionDragHandleComponent, FConnectionGradientComponent, FConnectionPathComponent, FConnectionSelectionComponent, FConnectionComponent, FConnectionCenterDirective, FConnectionForCreateComponent, FMarkerDirective, FNodeInputDirective, FNodeOutletDirective, FNodeOutputDirective, FExternalItemDirective, FFlowComponent, FLineAlignmentComponent, FMinimapComponent, FMinimapCanvasDirective, FMinimapViewDirective, FMinimapFlowDirective, FNodeDirective, FDragHandleDirective, FResizeHandleDirective, FSelectionAreaComponent, FDraggableDirective], imports: [CommonModule], exports: [FBackgroundComponent, FRectPatternComponent, FCirclePatternComponent, FCanvasComponent, FZoomDirective, FConnectionTextComponent, FConnectionTextPathDirective, FConnectionDragHandleComponent, FConnectionGradientComponent, FConnectionPathComponent, FConnectionSelectionComponent, FConnectionComponent, FConnectionCenterDirective, FConnectionForCreateComponent, FMarkerDirective, FNodeInputDirective, FNodeOutletDirective, FNodeOutputDirective, FExternalItemDirective, FFlowComponent, FLineAlignmentComponent, FMinimapComponent, FMinimapCanvasDirective, FMinimapViewDirective, FMinimapFlowDirective, FNodeDirective, FDragHandleDirective, FResizeHandleDirective, FSelectionAreaComponent, FDraggableDirective] });
8080
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.0", ngImport: i0, type: FFlowModule, declarations: [FBackgroundComponent, FRectPatternComponent, FCirclePatternComponent, FCanvasComponent, FZoomDirective, FConnectionTextComponent, FConnectionTextPathDirective, FConnectionDragHandleComponent, FConnectionGradientComponent, FConnectionPathComponent, FConnectionSelectionComponent, FConnectionComponent, FConnectionCenterDirective, FConnectionForCreateComponent, FMarkerDirective, FNodeInputDirective, FNodeOutletDirective, FNodeOutputDirective, FExternalItemDirective, FFlowComponent, FLineAlignmentComponent, FMinimapComponent, FMinimapCanvasDirective, FMinimapViewDirective, FMinimapFlowDirective, FGroupDirective, FNodeDirective, FDragHandleDirective, FResizeHandleDirective, FSelectionAreaComponent, FDraggableDirective], imports: [CommonModule], exports: [FBackgroundComponent, FRectPatternComponent, FCirclePatternComponent, FCanvasComponent, FZoomDirective, FConnectionTextComponent, FConnectionTextPathDirective, FConnectionDragHandleComponent, FConnectionGradientComponent, FConnectionPathComponent, FConnectionSelectionComponent, FConnectionComponent, FConnectionCenterDirective, FConnectionForCreateComponent, FMarkerDirective, FNodeInputDirective, FNodeOutletDirective, FNodeOutputDirective, FExternalItemDirective, FFlowComponent, FLineAlignmentComponent, FMinimapComponent, FMinimapCanvasDirective, FMinimapViewDirective, FMinimapFlowDirective, FGroupDirective, FNodeDirective, FDragHandleDirective, FResizeHandleDirective, FSelectionAreaComponent, FDraggableDirective] });
6978
8081
  static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: FFlowModule, imports: [CommonModule] });
6979
8082
  }
6980
8083
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: FFlowModule, decorators: [{
@@ -7018,5 +8121,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
7018
8121
  * Generated bundle index. Do not edit.
7019
8122
  */
7020
8123
 
7021
- export { CANVAS_MOVE_FINALIZE_PROVIDERS, CANVAS_MOVE_PREPARATION_PROVIDERS, CANVAS_PROVIDERS, COMMON_PROVIDERS, CONNECTIONS_PROVIDERS, CONNECTION_GRADIENT, CONNECTION_PATH, CONNECTION_TEXT, CREATE_CONNECTION_DRAG_HANDLER_PROVIDERS, CREATE_CONNECTION_FINALIZE_PROVIDERS, CREATE_CONNECTION_FROM_OUTLET_PREPARATION_PROVIDERS, CREATE_CONNECTION_FROM_OUTPUT_PREPARATION_PROVIDERS, CREATE_CONNECTION_PREPARATION_PROVIDERS, CREATE_MOVE_NODE_DRAG_MODEL_FROM_SELECTION_PROVIDERS, CalculateCenterBetweenPointsHandler, CalculateCenterBetweenPointsRequest, CalculateConnectionCenterHandler, CalculateConnectionCenterRequest, CalculateConnectorConnectableSideHandler, CalculateConnectorConnectableSideRequest, CalculateFlowPointFromMinimapPointExecution, CalculateFlowPointFromMinimapPointRequest, CanvasDragHandler, CanvasMoveFinalizeExecution, CanvasMoveFinalizeRequest, CanvasMoveFinalizeValidator, CanvasMovePreparationExecution, CanvasMovePreparationRequest, CanvasMovePreparationValidator, ClearSelectionExecution, ClearSelectionRequest, ConnectionDragHandler, ConnectionSourceDragHandler, ConnectionTargetDragHandler, CreateConnectionDragHandler, CreateConnectionDragHandlerExecution, CreateConnectionDragHandlerRequest, CreateConnectionFinalizeExecution, CreateConnectionFinalizeRequest, CreateConnectionFinalizeValidator, CreateConnectionFromOutletPreparationExecution, CreateConnectionFromOutletPreparationRequest, CreateConnectionFromOutputPreparationExecution, CreateConnectionFromOutputPreparationRequest, CreateConnectionFromOutputPreparationValidator, CreateConnectionMarkersExecution, CreateConnectionMarkersRequest, CreateConnectionPreparationExecution, CreateConnectionPreparationRequest, CreateConnectionPreparationValidator, CreateMoveNodesDragModelFromSelectionExecution, CreateMoveNodesDragModelFromSelectionRequest, EFConnectableSide, EFConnectionBehavior, EFConnectionType, EFConnectorShape, EFDraggableType, EFMarkerType, EFResizeHandleType, EXTERNAL_ITEM_FINALIZE_PROVIDERS, EXTERNAL_ITEM_PREPARATION_PROVIDERS, EXTERNAL_ITEM_PROVIDERS, EmitTransformChangesExecution, EmitTransformChangesRequest, ExternalItemDragHandler, ExternalItemFinalizeExecution, ExternalItemFinalizeRequest, ExternalItemFinalizeValidator, ExternalItemPreparationExecution, ExternalItemPreparationRequest, ExternalItemPreparationValidator, FBackgroundBase, FBackgroundComponent, FBezierPathBuilder, FCanvasBase, FCanvasChangeEvent, FCanvasComponent, FCirclePatternComponent, FComponentsStore, FConnectionBase, FConnectionCenterDirective, FConnectionComponent, FConnectionDragHandleComponent, FConnectionFactory, FConnectionForCreateComponent, FConnectionGradientComponent, FConnectionPathComponent, FConnectionSelectionComponent, FConnectionTextComponent, FConnectionTextPathDirective, FConnectorBase, FConnectorShapeExtensions, FCreateConnectionEvent, FCreateNodeEvent, FDragHandleDirective, FDraggableBase, FDraggableDataContext, FDraggableDirective, FExecutionRegister, FExternalItemBase, FExternalItemDirective, FExternalItemService, FFlowBase, FFlowComponent, FFlowMediator, FFlowModule, FLineAlignmentBase, FLineAlignmentComponent, FMarkerBase, FMarkerDirective, FMinimapCanvasDirective, FMinimapComponent, FMinimapData, FMinimapDragHandler, FMinimapFlowDirective, FMinimapViewDirective, FNodeBase, FNodeDirective, FNodeInputBase, FNodeInputDirective, FNodeOutletBase, FNodeOutletDirective, FNodeOutputBase, FNodeOutputDirective, FReassignConnectionEvent, FRectPatternComponent, FResizeHandleDirective, FResizeObserver, FRotateHandleDirective, FSegmentPathBuilder, FSelectionAreaBase, FSelectionAreaComponent, FSelectionChangeEvent, FStraightPathBuilder, FTransformStore, FValidatorRegister, FZoomBase, FZoomDirective, F_BACKGROUND, F_BACKGROUND_PATTERN, F_BACKGROUND_PROVIDERS, F_CANVAS, F_CANVAS_PROVIDERS, F_CONNECTION_BUILDERS, F_CONNECTION_DRAG_HANDLE_CLASS, F_CONNECTION_IDENTIFIERS, F_CONNECTION_PROVIDERS, F_CONNECTORS_PROVIDERS, F_DRAGGABLE, F_DRAGGABLE_PROVIDERS, F_DRAG_AND_DROP_PLUGIN, F_DRAG_HANDLE, F_EXTERNAL_ITEM, F_EXTERNAL_ITEM_PROVIDERS, F_FLOW, F_FLOW_PROVIDERS, F_LINE_ALIGNMENT, F_LINE_ALIGNMENT_PROVIDERS, F_MARKER, F_MINIMAP_DRAG_AND_DROP_PROVIDERS, F_MINIMAP_PROVIDERS, F_NODE, F_NODE_INPUT, F_NODE_OUTLET, F_NODE_OUTPUT, F_NODE_PROVIDERS, F_RESIZE_HANDLE, F_SELECTED_CLASS, F_SELECTION_AREA, F_SELECTION_AREA_PROVIDERS, F_ZOOM, F_ZOOM_PROVIDERS, GET_CAN_BE_CONNECTED_OUTPUT_BY_OUTLET_PROVIDERS, GET_INPUT_UNDER_POINTER_PROVIDERS, GetCanBeConnectedOutputByOutletExecution, GetCanBeConnectedOutputByOutletRequest, GetCanBeConnectedOutputByOutletValidator, GetCanBeSelectedItemsExecution, GetConnectionHandler, GetConnectionLineExecution, GetConnectionLineRequest, GetElementRectInFlowExecution, GetElementRectInFlowRequest, GetExternalNodesRectExecution, GetExternalNodesRectRequest, GetIncomingConnectionsHandler, GetInputRectInFlowExecution, GetInputRectInFlowRequest, GetInputRectInFlowResponse, GetInputUnderPointerExecution, GetInputUnderPointerRequest, GetInputUnderPointerValidator, GetNodesRectExecution, GetNodesRectRequest, GetOutgoingConnectionsHandler, GetOutputRectInFlowExecution, GetOutputRectInFlowRequest, GetOutputRectInFlowResponse, GetPositionInFlowExecution, GetPositionInFlowRequest, GetSelectionExecution, GetSelectionRequest, IntersectionFinder, IsConnectionUnderNodeExecution, LineElement, LineService, MINIMAP_DRAG_FINALIZE_PROVIDERS, MINIMAP_DRAG_PREPARATION_PROVIDERS, MOUSE_EVENT_IGNORE_TIME, MinimapDragFinalizeExecution, MinimapDragFinalizeRequest, MinimapDragFinalizeValidator, MinimapDragPreparationExecution, MinimapDragPreparationRequest, MinimapDragPreparationValidator, NODE_MOVE_FINALIZE_PROVIDERS, NODE_MOVE_PREPARATION_PROVIDERS, NODE_PROVIDERS, NODE_RESIZE_FINALIZE_PROVIDERS, NODE_RESIZE_PREPARATION_PROVIDERS, NODE_RESIZE_PROVIDERS, NearestCoordinateFinder, NodeDragHandler, NodeMoveFinalizeExecution, NodeMoveFinalizeRequest, NodeMoveFinalizeValidator, NodeMovePreparationExecution, NodeMovePreparationRequest, NodeMovePreparationValidator, NodeResizeDragHandler, NodeResizeFinalizeExecution, NodeResizeFinalizeRequest, NodeResizeFinalizeValidator, NodeResizePreparationExecution, NodeResizePreparationRequest, NodeResizePreparationValidator, Pipeline, REASSIGN_CONNECTION_FINALIZE_PROVIDERS, REASSIGN_CONNECTION_PREPARATION_PROVIDERS, ReassignConnectionDragHandler, ReassignConnectionFinalizeExecution, ReassignConnectionFinalizeRequest, ReassignConnectionFinalizeValidator, ReassignConnectionPreparationExecution, ReassignConnectionPreparationRequest, ReassignConnectionPreparationValidator, RedrawConnectionsExecution, RedrawConnectionsRequest, RoundedRect, SELECTION_AREA_FINALIZE_PROVIDERS, SELECTION_AREA_PREPARATION_PROVIDERS, SELECTION_AREA_PROVIDERS, SINGLE_SELECT_PROVIDERS, SelectAllExecution, SelectAllRequest, SelectAndUpdateNodeLayerExecution, SelectAndUpdateNodeLayerRequest, SelectExecution, SelectRequest, SelectionAreaDragHandle, SelectionAreaFinalizeExecution, SelectionAreaFinalizeRequest, SelectionAreaFinalizeValidator, SelectionAreaPreparationExecution, SelectionAreaPreparationRequest, SelectionAreaPreparationValidator, SingleSelectExecution, SingleSelectRequest, SingleSelectValidator, SubscribeOnTransformChangesExecution, SubscribeOnTransformChangesRequest, UpdateItemLayerExecution, UpdateItemLayerRequest, castToEnum, getExternalItem, getMarkerEndId, getMarkerSelectedEndId, getMarkerSelectedStartId, getMarkerStartId, getValueFromDataAttr, isElementWithClass, isExternalItem, isNode, isNodeInput, isNodeOutlet, isNodeOutput, mixinChangeConnectionSelection, mixinChangeConnectionVisibility };
8124
+ export { ApplyChildResizeRestrictionsExecution, ApplyChildResizeRestrictionsRequest, ApplyParentResizeRestrictionsExecution, ApplyParentResizeRestrictionsRequest, CANVAS_MOVE_FINALIZE_PROVIDERS, CANVAS_MOVE_PREPARATION_PROVIDERS, CANVAS_PROVIDERS, COMMON_PROVIDERS, CONNECTIONS_PROVIDERS, CONNECTION_GRADIENT, CONNECTION_PATH, CONNECTION_TEXT, CREATE_CONNECTION_DRAG_HANDLER_PROVIDERS, CREATE_CONNECTION_FINALIZE_PROVIDERS, CREATE_CONNECTION_FROM_OUTLET_PREPARATION_PROVIDERS, CREATE_CONNECTION_FROM_OUTPUT_PREPARATION_PROVIDERS, CREATE_CONNECTION_PREPARATION_PROVIDERS, CREATE_MOVE_NODE_DRAG_MODEL_FROM_SELECTION_PROVIDERS, CalculateCenterBetweenPointsHandler, CalculateCenterBetweenPointsRequest, CalculateChangedPositionExecution, CalculateChangedPositionRequest, CalculateChangedSizeExecution, CalculateChangedSizeRequest, CalculateConnectionCenterHandler, CalculateConnectionCenterRequest, CalculateConnectorConnectableSideHandler, CalculateConnectorConnectableSideRequest, CalculateFlowPointFromMinimapPointExecution, CalculateFlowPointFromMinimapPointRequest, CanvasDragHandler, CanvasMoveFinalizeExecution, CanvasMoveFinalizeRequest, CanvasMoveFinalizeValidator, CanvasMovePreparationExecution, CanvasMovePreparationRequest, CanvasMovePreparationValidator, ClearSelectionExecution, ClearSelectionRequest, ConnectionBaseDragHandler, ConnectionDragHandler, ConnectionSourceDragHandler, ConnectionTargetDragHandler, ConvertComputedToPixelsExecution, ConvertComputedToPixelsRequest, CreateConnectionDragHandler, CreateConnectionDragHandlerExecution, CreateConnectionDragHandlerRequest, CreateConnectionFinalizeExecution, CreateConnectionFinalizeRequest, CreateConnectionFinalizeValidator, CreateConnectionFromOutletPreparationExecution, CreateConnectionFromOutletPreparationRequest, CreateConnectionFromOutputPreparationExecution, CreateConnectionFromOutputPreparationRequest, CreateConnectionFromOutputPreparationValidator, CreateConnectionMarkersExecution, CreateConnectionMarkersRequest, CreateConnectionPreparationExecution, CreateConnectionPreparationRequest, CreateConnectionPreparationValidator, CreateMoveNodesDragModelFromSelectionExecution, CreateMoveNodesDragModelFromSelectionRequest, DRAG_AND_DROP_COMMON_PROVIDERS, EFConnectableSide, EFConnectionBehavior, EFConnectionType, EFConnectorShape, EFMarkerType, EFResizeHandleType, EXTERNAL_ITEM_FINALIZE_PROVIDERS, EXTERNAL_ITEM_PREPARATION_PROVIDERS, EmitTransformChangesExecution, EmitTransformChangesRequest, ExternalItemDragHandler, ExternalItemFinalizeExecution, ExternalItemFinalizeRequest, ExternalItemFinalizeValidator, ExternalItemPreparationExecution, ExternalItemPreparationRequest, ExternalItemPreparationValidator, FBackgroundBase, FBackgroundComponent, FBezierPathBuilder, FCanvasBase, FCanvasChangeEvent, FCanvasComponent, FCirclePatternComponent, FComponentsStore, FConnectionBase, FConnectionCenterDirective, FConnectionComponent, FConnectionDragHandleComponent, FConnectionFactory, FConnectionForCreateComponent, FConnectionGradientComponent, FConnectionPathComponent, FConnectionSelectionComponent, FConnectionTextComponent, FConnectionTextPathDirective, FConnectorBase, FConnectorShapeExtensions, FCreateConnectionEvent, FCreateNodeEvent, FDragHandleDirective, FDraggableBase, FDraggableDataContext, FDraggableDirective, FExecutionRegister, FExternalItemBase, FExternalItemDirective, FExternalItemService, FFlowBase, FFlowComponent, FFlowMediator, FFlowModule, FGroupDirective, FLineAlignmentBase, FLineAlignmentComponent, FMarkerBase, FMarkerDirective, FMinimapCanvasDirective, FMinimapComponent, FMinimapData, FMinimapDragHandler, FMinimapFlowDirective, FMinimapViewDirective, FNodeBase, FNodeDirective, FNodeInputBase, FNodeInputDirective, FNodeOutletBase, FNodeOutletDirective, FNodeOutputBase, FNodeOutputDirective, FReassignConnectionEvent, FRectPatternComponent, FResizeHandleDirective, FResizeObserver, FRotateHandleDirective, FSegmentPathBuilder, FSelectionAreaBase, FSelectionAreaComponent, FSelectionChangeEvent, FStraightPathBuilder, FTransformStore, FValidatorRegister, FZoomBase, FZoomDirective, F_BACKGROUND, F_BACKGROUND_PATTERN, F_BACKGROUND_PROVIDERS, F_CANVAS, F_CANVAS_PROVIDERS, F_CONNECTION_BUILDERS, F_CONNECTION_DRAG_HANDLE_CLASS, F_CONNECTION_IDENTIFIERS, F_CONNECTION_PROVIDERS, F_CONNECTORS_PROVIDERS, F_DRAGGABLE, F_DRAGGABLE_PROVIDERS, F_DRAG_AND_DROP_PLUGIN, F_DRAG_HANDLE, F_EXTERNAL_ITEM, F_EXTERNAL_ITEM_DRAG_AND_DROP_PROVIDERS, F_EXTERNAL_ITEM_PROVIDERS, F_FLOW, F_FLOW_PROVIDERS, F_LINE_ALIGNMENT, F_LINE_ALIGNMENT_PROVIDERS, F_MARKER, F_MINIMAP_DRAG_AND_DROP_PROVIDERS, F_MINIMAP_PROVIDERS, F_NODE, F_NODE_INPUT, F_NODE_OUTLET, F_NODE_OUTPUT, F_NODE_PROVIDERS, F_RESIZE_HANDLE, F_SELECTED_CLASS, F_SELECTION_AREA_DRAG_AND_DROP_PROVIDERS, F_SELECTION_AREA_PROVIDERS, F_ZOOM, F_ZOOM_PROVIDERS, GET_CAN_BE_CONNECTED_OUTPUT_BY_OUTLET_PROVIDERS, GET_INPUT_UNDER_POINTER_PROVIDERS, GetCanBeConnectedOutputByOutletExecution, GetCanBeConnectedOutputByOutletRequest, GetCanBeConnectedOutputByOutletValidator, GetCanBeSelectedItemsExecution, GetConnectionLineExecution, GetConnectionLineRequest, GetDeepChildrenNodesAndGroupsExecution, GetDeepChildrenNodesAndGroupsRequest, GetElementRectInFlowExecution, GetElementRectInFlowRequest, GetInputRectInFlowExecution, GetInputRectInFlowRequest, GetInputRectInFlowResponse, GetInputUnderPointerExecution, GetInputUnderPointerRequest, GetInputUnderPointerValidator, GetNodeMoveRestrictionsExecution, GetNodeMoveRestrictionsRequest, GetNodePaddingExecution, GetNodePaddingRequest, GetNodeResizeRestrictionsExecution, GetNodeResizeRestrictionsRequest, GetNodesRectExecution, GetNodesRectRequest, GetNormalizedChildrenNodesRectExecution, GetNormalizedChildrenNodesRectRequest, GetNormalizedNodeRectExecution, GetNormalizedNodeRectRequest, GetNormalizedParentNodeRectExecution, GetNormalizedParentNodeRectRequest, GetOutputRectInFlowExecution, GetOutputRectInFlowRequest, GetOutputRectInFlowResponse, GetParentNodesExecution, GetParentNodesRequest, GetPositionInFlowExecution, GetPositionInFlowRequest, GetScaledNodeRectsWithFlowPositionExecution, GetScaledNodeRectsWithFlowPositionRequest, GetSelectionExecution, GetSelectionRequest, IntersectionFinder, IsArrayHasParentNodeExecution, IsArrayHasParentNodeRequest, IsConnectionUnderNodeExecution, LineElement, LineService, MINIMAP_DRAG_FINALIZE_PROVIDERS, MINIMAP_DRAG_PREPARATION_PROVIDERS, MOUSE_EVENT_IGNORE_TIME, MinimapDragFinalizeExecution, MinimapDragFinalizeRequest, MinimapDragFinalizeValidator, MinimapDragPreparationExecution, MinimapDragPreparationRequest, MinimapDragPreparationValidator, MoveFrontElementsBeforeTargetElementExecution, MoveFrontElementsBeforeTargetElementRequest, NODE_MOVE_FINALIZE_PROVIDERS, NODE_MOVE_PREPARATION_PROVIDERS, NODE_PROVIDERS, NODE_RESIZE_FINALIZE_PROVIDERS, NODE_RESIZE_PREPARATION_PROVIDERS, NODE_RESIZE_PROVIDERS, NearestCoordinateFinder, NodeDragHandler, NodeMoveFinalizeExecution, NodeMoveFinalizeRequest, NodeMoveFinalizeValidator, NodeMovePreparationExecution, NodeMovePreparationRequest, NodeMovePreparationValidator, NodeResizeByChildDragHandler, NodeResizeDragHandler, NodeResizeFinalizeExecution, NodeResizeFinalizeRequest, NodeResizeFinalizeValidator, NodeResizePreparationExecution, NodeResizePreparationRequest, NodeResizePreparationValidator, Pipeline, PutInputConnectionHandlersToArrayExecution, PutInputConnectionHandlersToArrayRequest, PutOutputConnectionHandlersToArrayExecution, PutOutputConnectionHandlersToArrayRequest, REASSIGN_CONNECTION_FINALIZE_PROVIDERS, REASSIGN_CONNECTION_PREPARATION_PROVIDERS, RESIZE_DIRECTIONS, ReassignConnectionDragHandler, ReassignConnectionFinalizeExecution, ReassignConnectionFinalizeRequest, ReassignConnectionFinalizeValidator, ReassignConnectionPreparationExecution, ReassignConnectionPreparationRequest, ReassignConnectionPreparationValidator, RedrawConnectionsExecution, RedrawConnectionsRequest, RoundedRect, SELECTION_AREA_FINALIZE_PROVIDERS, SELECTION_AREA_PREPARATION_PROVIDERS, SINGLE_SELECT_PROVIDERS, SelectAllExecution, SelectAllRequest, SelectAndUpdateNodeLayerExecution, SelectAndUpdateNodeLayerRequest, SelectExecution, SelectRequest, SelectionAreaDragHandle, SelectionAreaFinalizeExecution, SelectionAreaFinalizeRequest, SelectionAreaFinalizeValidator, SelectionAreaPreparationExecution, SelectionAreaPreparationRequest, SelectionAreaPreparationValidator, SingleSelectExecution, SingleSelectRequest, SingleSelectValidator, SortItemLayersExecution, SortItemLayersRequest, SortItemsByParentExecution, SortItemsByParentRequest, SortNodeLayersExecution, SortNodeLayersRequest, SubscribeOnTransformChangesExecution, SubscribeOnTransformChangesRequest, UpdateItemAndChildrenLayersExecution, UpdateItemAndChildrenLayersRequest, castToEnum, getExternalItem, getMarkerEndId, getMarkerSelectedEndId, getMarkerSelectedStartId, getMarkerStartId, getValueFromDataAttr, isElementWithClass, isExternalItem, isGroup, isNode, isNodeInput, isNodeOutlet, isNodeOutput, mixinChangeConnectionSelection, mixinChangeConnectionVisibility };
7022
8125
  //# sourceMappingURL=foblex-flow.mjs.map