@foblex/flow 17.6.0 → 17.7.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.
- package/domain/f-background/add-background-to-store/add-background-to-store.execution.d.ts +4 -1
- package/domain/f-background/add-pattern-to-background/add-pattern-to-background.execution.d.ts +4 -1
- package/domain/f-background/providers.d.ts +4 -0
- package/domain/f-background/remove-background-from-store/remove-background-from-store.execution.d.ts +4 -1
- package/domain/f-background/set-background-transform/set-background-transform.execution.d.ts +4 -1
- package/domain/f-canvas/add-canvas-to-store/add-canvas-to-store.execution.d.ts +4 -1
- package/domain/f-canvas/center-group-or-node/center-group-or-node.execution.d.ts +4 -1
- package/domain/f-canvas/fit-to-flow/fit-to-flow.execution.d.ts +4 -1
- package/domain/f-canvas/get-canvas/get-canvas.execution.d.ts +4 -1
- package/domain/f-canvas/input-canvas-position/input-canvas-position.execution.d.ts +4 -1
- package/domain/f-canvas/input-canvas-scale/input-canvas-scale.execution.d.ts +5 -1
- package/domain/f-canvas/providers.d.ts +3 -0
- package/domain/f-canvas/redraw-canvas-with-animation/redraw-canvas-with-animation.execution.d.ts +6 -1
- package/domain/f-canvas/remove-canvas-from-store/remove-canvas-from-store.execution.d.ts +4 -1
- package/domain/f-canvas/reset-scale/reset-scale.execution.d.ts +4 -1
- package/domain/f-canvas/reset-scale-and-center/reset-scale-and-center.execution.d.ts +4 -1
- package/domain/f-canvas/update-scale/update-scale.execution.d.ts +5 -1
- package/domain/f-connection/add-connection-for-create-to-store/add-connection-for-create-to-store.execution.d.ts +4 -1
- package/domain/f-connection/add-connection-marker-to-store/add-connection-marker-to-store.execution.d.ts +4 -1
- package/domain/f-connection/add-connection-to-store/add-connection-to-store.execution.d.ts +4 -1
- package/domain/f-connection/add-snap-connection-to-store/add-snap-connection-to-store.execution.d.ts +4 -1
- package/domain/f-connection/calculate-connection-line-by-behavior/calculate-connection-line-by-behavior.execution.d.ts +3 -0
- package/domain/f-connection/calculate-connection-line-by-behavior/fixed-center-behavior.d.ts +5 -0
- package/domain/f-connection/calculate-connection-line-by-behavior/fixed-outbound-behavior.d.ts +5 -0
- package/domain/f-connection/calculate-connection-line-by-behavior/floating-behavior.d.ts +5 -0
- package/domain/f-connection/create-connection-markers/create-connection-markers.execution.d.ts +4 -1
- package/domain/f-connection/providers.d.ts +3 -0
- package/domain/f-connection/redraw-connections/redraw-connections.execution.d.ts +6 -1
- package/domain/f-connection/remove-connection-for-create-from-store/remove-connection-for-create-from-store.execution.d.ts +4 -1
- package/domain/f-connection/remove-connection-from-store/remove-connection-from-store.execution.d.ts +4 -1
- package/domain/f-connection/remove-connection-marker-from-store/remove-connection-marker-from-store.execution.d.ts +4 -1
- package/domain/f-connection/remove-snap-connection-from-store/remove-snap-connection-from-store.execution.d.ts +4 -1
- package/domain/f-connectors/add-input-to-store/add-input-to-store.execution.d.ts +4 -1
- package/domain/f-connectors/add-outlet-to-store/add-outlet-to-store.execution.d.ts +3 -0
- package/domain/f-connectors/add-output-to-store/add-output-to-store.execution.d.ts +3 -0
- package/domain/f-connectors/find-closest-connector/find-closest-connector.execution.d.ts +5 -0
- package/domain/f-connectors/find-connectable-connector-using-priority-and-position/find-connectable-connector-using-priority-and-position.execution.d.ts +5 -0
- package/domain/f-connectors/get-all-can-be-connected-inputs-and-rects/get-all-can-be-connected-inputs-and-rects.execution.d.ts +4 -1
- package/domain/f-connectors/get-all-can-be-connected-source-connectors-and-rects/get-all-can-be-connected-source-connectors-and-rects.execution.d.ts +6 -1
- package/domain/f-connectors/get-connector-and-rect/get-connector-and-rect.execution.d.ts +4 -1
- package/domain/f-connectors/i-closest-connector.d.ts +3 -0
- package/domain/f-connectors/mark-connectable-connectors/mark-connectable-connectors.execution.d.ts +3 -0
- package/domain/f-connectors/remove-input-from-store/remove-input-from-store.execution.d.ts +4 -1
- package/domain/f-connectors/remove-outlet-from-store/remove-outlet-from-store.execution.d.ts +4 -1
- package/domain/f-connectors/remove-output-from-store/remove-output-from-store.execution.d.ts +4 -1
- package/domain/f-connectors/unmark-connectable-connectors/unmark-connectable-connectors.execution.d.ts +3 -0
- package/domain/f-draggable/add-dnd-to-store/add-dnd-to-store.execution.d.ts +4 -1
- package/domain/f-draggable/emit-selection-change-event/emit-selection-change-event.execution.d.ts +7 -3
- package/domain/f-draggable/end-drag-sequence/end-drag-sequence.execution.d.ts +4 -1
- package/domain/f-draggable/initialize-drag-sequence/initialize-drag-sequence.execution.d.ts +3 -0
- package/domain/f-draggable/is-drag-started/is-drag-started.execution.d.ts +4 -1
- package/domain/f-draggable/on-pointer-move/on-pointer-move.execution.d.ts +6 -1
- package/domain/f-draggable/prepare-drag-sequence/prepare-drag-sequence.execution.d.ts +4 -1
- package/domain/f-draggable/providers.d.ts +4 -1
- package/domain/f-draggable/remove-dnd-from-store/remove-dnd-from-store.execution.d.ts +4 -1
- package/domain/f-draggable/start-drag-sequence/start-drag-sequence.execution.d.ts +5 -2
- package/domain/f-flow/add-flow-to-store/add-flow-to-store.execution.d.ts +4 -1
- package/domain/f-flow/get-flow/get-flow.execution.d.ts +4 -1
- package/domain/f-flow/get-flow-host-element/get-flow-host-element.execution.d.ts +4 -1
- package/domain/f-flow/get-flow-state/get-flow-state-connections/get-flow-state-connections.execution.d.ts +4 -1
- package/domain/f-flow/get-flow-state/get-flow-state-nodes/get-flow-state-nodes.execution.d.ts +4 -3
- package/domain/f-flow/get-flow-state/get-flow-state.execution.d.ts +5 -2
- package/domain/f-flow/get-flow-state/providers.d.ts +3 -0
- package/domain/f-flow/providers.d.ts +5 -0
- package/domain/f-flow/remove-flow-from-store/remove-flow-from-store.execution.d.ts +4 -1
- package/domain/f-line-alignment/add-line-alignment-to-store/add-line-alignment-to-store.execution.d.ts +4 -1
- package/domain/f-line-alignment/providers.d.ts +5 -0
- package/domain/f-line-alignment/remove-line-alignment-from-store/remove-line-alignment-from-store.execution.d.ts +4 -1
- package/domain/f-node/add-node-to-store/add-node-to-store.execution.d.ts +4 -1
- package/domain/f-node/calculate-input-connections/calculate-input-connections.execution.d.ts +4 -1
- package/domain/f-node/calculate-nodes-bounding-box/calculate-nodes-bounding-box.execution.d.ts +5 -1
- package/domain/f-node/calculate-nodes-bounding-box-normalized-position/calculate-nodes-bounding-box-normalized-position.execution.d.ts +6 -1
- package/domain/f-node/calculate-output-connections/calculate-output-connections.execution.d.ts +4 -1
- package/domain/f-node/get-node-padding/get-node-padding.execution.d.ts +4 -0
- package/domain/f-node/get-nodes/get-nodes.execution.d.ts +4 -1
- package/domain/f-node/get-parent-nodes/get-parent-nodes.execution.d.ts +4 -1
- package/domain/f-node/providers.d.ts +3 -0
- package/domain/f-node/remove-node-from-store/remove-node-from-store.execution.d.ts +4 -1
- package/domain/f-node/update-node-when-state-or-size-changed/update-node-when-state-or-size-changed.execution.d.ts +28 -1
- package/domain/f-selection/clear-selection/clear-selection.execution.d.ts +3 -0
- package/domain/f-selection/get-can-be-selected-items/get-can-be-selected-items.execution.d.ts +14 -2
- package/domain/f-selection/get-current-selection/get-current-selection.execution.d.ts +3 -0
- package/domain/f-selection/providers.d.ts +3 -0
- package/domain/f-selection/select/select.execution.d.ts +4 -1
- package/domain/f-selection/select-all/select-all.execution.d.ts +5 -1
- package/domain/f-selection/select-and-update-node-layer/select-and-update-node-layer.execution.d.ts +7 -5
- package/domain/f-zoom/add-zoom-to-store/add-zoom-to-store.execution.d.ts +4 -1
- package/domain/f-zoom/providers.d.ts +5 -0
- package/domain/f-zoom/remove-zoom-from-store/remove-zoom-from-store.execution.d.ts +4 -1
- package/domain/f-zoom/reset-zoom/reset-zoom.execution.d.ts +4 -1
- package/domain/f-zoom/set-zoom/set-zoom.execution.d.ts +6 -2
- package/domain/get-deep-children-nodes-and-groups/get-deep-children-nodes-and-groups.execution.d.ts +5 -1
- package/domain/get-element-rounded-rect/get-element-rounded-rect.execution.d.ts +5 -1
- package/domain/get-normalized-connector-rect/get-normalized-connector-rect.execution.d.ts +7 -2
- package/domain/get-normalized-element-rect/get-normalized-element-rect.execution.d.ts +7 -2
- package/domain/get-normalized-point/get-normalized-point.execution.d.ts +6 -1
- package/domain/providers.d.ts +7 -1
- package/domain/sort-item-layers/sort-item-layers.execution.d.ts +9 -2
- package/domain/sort-item-layers/sort-items-by-parent/sort-items-by-parent.execution.d.ts +8 -3
- package/domain/sort-item-layers/sort-node-layers-by-groups/sort-node-layers.execution.d.ts +8 -3
- package/domain/update-item-and-children-layers/move-front-elements-before-target-element/move-front-elements-before-target-element.execution.d.ts +4 -0
- package/domain/update-item-and-children-layers/update-item-and-children-layers.execution.d.ts +6 -2
- package/drag-toolkit/drag-and-drop-base.d.ts +60 -0
- package/esm2022/domain/f-background/add-background-to-store/add-background-to-store.execution.mjs +6 -3
- package/esm2022/domain/f-background/add-pattern-to-background/add-pattern-to-background.execution.mjs +7 -4
- package/esm2022/domain/f-background/providers.mjs +5 -1
- package/esm2022/domain/f-background/remove-background-from-store/remove-background-from-store.execution.mjs +6 -3
- package/esm2022/domain/f-background/set-background-transform/set-background-transform.execution.mjs +6 -3
- package/esm2022/domain/f-canvas/add-canvas-to-store/add-canvas-to-store.execution.mjs +6 -3
- package/esm2022/domain/f-canvas/center-group-or-node/center-group-or-node.execution.mjs +8 -5
- package/esm2022/domain/f-canvas/fit-to-flow/fit-to-flow.execution.mjs +7 -4
- package/esm2022/domain/f-canvas/get-canvas/get-canvas.execution.mjs +6 -3
- package/esm2022/domain/f-canvas/input-canvas-position/input-canvas-position.execution.mjs +6 -3
- package/esm2022/domain/f-canvas/input-canvas-scale/input-canvas-scale.execution.mjs +7 -3
- package/esm2022/domain/f-canvas/providers.mjs +4 -1
- package/esm2022/domain/f-canvas/redraw-canvas-with-animation/redraw-canvas-with-animation.execution.mjs +13 -8
- package/esm2022/domain/f-canvas/remove-canvas-from-store/remove-canvas-from-store.execution.mjs +6 -3
- package/esm2022/domain/f-canvas/reset-scale/reset-scale.execution.mjs +6 -3
- package/esm2022/domain/f-canvas/reset-scale-and-center/reset-scale-and-center.execution.mjs +7 -4
- package/esm2022/domain/f-canvas/update-scale/update-scale.execution.mjs +7 -3
- package/esm2022/domain/f-connection/add-connection-for-create-to-store/add-connection-for-create-to-store.execution.mjs +6 -3
- package/esm2022/domain/f-connection/add-connection-marker-to-store/add-connection-marker-to-store.execution.mjs +6 -3
- package/esm2022/domain/f-connection/add-connection-to-store/add-connection-to-store.execution.mjs +7 -4
- package/esm2022/domain/f-connection/add-snap-connection-to-store/add-snap-connection-to-store.execution.mjs +6 -3
- package/esm2022/domain/f-connection/calculate-connection-line-by-behavior/calculate-connection-line-by-behavior.execution.mjs +4 -1
- package/esm2022/domain/f-connection/calculate-connection-line-by-behavior/fixed-center-behavior.mjs +6 -1
- package/esm2022/domain/f-connection/calculate-connection-line-by-behavior/fixed-outbound-behavior.mjs +6 -1
- package/esm2022/domain/f-connection/calculate-connection-line-by-behavior/floating-behavior.mjs +6 -1
- package/esm2022/domain/f-connection/create-connection-markers/create-connection-markers.execution.mjs +6 -3
- package/esm2022/domain/f-connection/providers.mjs +4 -1
- package/esm2022/domain/f-connection/redraw-connections/redraw-connections.execution.mjs +16 -11
- package/esm2022/domain/f-connection/remove-connection-for-create-from-store/remove-connection-for-create-from-store.execution.mjs +6 -3
- package/esm2022/domain/f-connection/remove-connection-from-store/remove-connection-from-store.execution.mjs +8 -5
- package/esm2022/domain/f-connection/remove-connection-marker-from-store/remove-connection-marker-from-store.execution.mjs +6 -3
- package/esm2022/domain/f-connection/remove-snap-connection-from-store/remove-snap-connection-from-store.execution.mjs +6 -3
- package/esm2022/domain/f-connectors/add-input-to-store/add-input-to-store.execution.mjs +6 -3
- package/esm2022/domain/f-connectors/add-outlet-to-store/add-outlet-to-store.execution.mjs +4 -1
- package/esm2022/domain/f-connectors/add-output-to-store/add-output-to-store.execution.mjs +4 -1
- package/esm2022/domain/f-connectors/find-closest-connector/find-closest-connector.execution.mjs +6 -1
- package/esm2022/domain/f-connectors/find-connectable-connector-using-priority-and-position/find-connectable-connector-using-priority-and-position.execution.mjs +6 -1
- package/esm2022/domain/f-connectors/get-all-can-be-connected-inputs-and-rects/get-all-can-be-connected-inputs-and-rects.execution.mjs +6 -3
- package/esm2022/domain/f-connectors/get-all-can-be-connected-source-connectors-and-rects/get-all-can-be-connected-source-connectors-and-rects.execution.mjs +8 -3
- package/esm2022/domain/f-connectors/get-connector-and-rect/get-connector-and-rect.execution.mjs +6 -3
- package/esm2022/domain/f-connectors/i-closest-connector.mjs +1 -1
- package/esm2022/domain/f-connectors/mark-connectable-connectors/mark-connectable-connectors.execution.mjs +4 -1
- package/esm2022/domain/f-connectors/providers.mjs +4 -1
- package/esm2022/domain/f-connectors/remove-input-from-store/remove-input-from-store.execution.mjs +6 -3
- package/esm2022/domain/f-connectors/remove-outlet-from-store/remove-outlet-from-store.execution.mjs +6 -3
- package/esm2022/domain/f-connectors/remove-output-from-store/remove-output-from-store.execution.mjs +6 -3
- package/esm2022/domain/f-connectors/unmark-connectable-connectors/unmark-connectable-connectors.execution.mjs +4 -1
- package/esm2022/domain/f-draggable/add-dnd-to-store/add-dnd-to-store.execution.mjs +6 -3
- package/esm2022/domain/f-draggable/emit-selection-change-event/emit-selection-change-event.execution.mjs +10 -6
- package/esm2022/domain/f-draggable/end-drag-sequence/end-drag-sequence.execution.mjs +7 -4
- package/esm2022/domain/f-draggable/initialize-drag-sequence/initialize-drag-sequence.execution.mjs +4 -1
- package/esm2022/domain/f-draggable/is-drag-started/is-drag-started.execution.mjs +6 -3
- package/esm2022/domain/f-draggable/on-pointer-move/on-pointer-move.execution.mjs +8 -3
- package/esm2022/domain/f-draggable/prepare-drag-sequence/prepare-drag-sequence.execution.mjs +6 -3
- package/esm2022/domain/f-draggable/providers.mjs +4 -1
- package/esm2022/domain/f-draggable/remove-dnd-from-store/remove-dnd-from-store.execution.mjs +6 -3
- package/esm2022/domain/f-draggable/start-drag-sequence/start-drag-sequence.execution.mjs +9 -6
- package/esm2022/domain/f-flow/add-flow-to-store/add-flow-to-store.execution.mjs +6 -3
- package/esm2022/domain/f-flow/get-flow/get-flow.execution.mjs +6 -3
- package/esm2022/domain/f-flow/get-flow-host-element/get-flow-host-element.execution.mjs +6 -3
- package/esm2022/domain/f-flow/get-flow-state/get-flow-state-connections/get-flow-state-connections.execution.mjs +6 -3
- package/esm2022/domain/f-flow/get-flow-state/get-flow-state-nodes/get-flow-state-nodes.execution.mjs +12 -12
- package/esm2022/domain/f-flow/get-flow-state/get-flow-state.execution.mjs +11 -8
- package/esm2022/domain/f-flow/get-flow-state/providers.mjs +4 -1
- package/esm2022/domain/f-flow/providers.mjs +6 -1
- package/esm2022/domain/f-flow/remove-flow-from-store/remove-flow-from-store.execution.mjs +6 -3
- package/esm2022/domain/f-line-alignment/add-line-alignment-to-store/add-line-alignment-to-store.execution.mjs +6 -3
- package/esm2022/domain/f-line-alignment/providers.mjs +6 -1
- package/esm2022/domain/f-line-alignment/remove-line-alignment-from-store/remove-line-alignment-from-store.execution.mjs +6 -3
- package/esm2022/domain/f-node/add-node-to-store/add-node-to-store.execution.mjs +6 -3
- package/esm2022/domain/f-node/calculate-input-connections/calculate-input-connections.execution.mjs +7 -4
- package/esm2022/domain/f-node/calculate-nodes-bounding-box/calculate-nodes-bounding-box.execution.mjs +7 -3
- package/esm2022/domain/f-node/calculate-nodes-bounding-box-normalized-position/calculate-nodes-bounding-box-normalized-position.execution.mjs +8 -3
- package/esm2022/domain/f-node/calculate-output-connections/calculate-output-connections.execution.mjs +7 -4
- package/esm2022/domain/f-node/get-node-padding/get-node-padding.execution.mjs +5 -1
- package/esm2022/domain/f-node/get-nodes/get-nodes.execution.mjs +6 -3
- package/esm2022/domain/f-node/get-parent-nodes/get-parent-nodes.execution.mjs +6 -3
- package/esm2022/domain/f-node/providers.mjs +4 -1
- package/esm2022/domain/f-node/remove-node-from-store/remove-node-from-store.execution.mjs +6 -3
- package/esm2022/domain/f-node/update-node-when-state-or-size-changed/update-node-when-state-or-size-changed.execution.mjs +30 -3
- package/esm2022/domain/f-selection/clear-selection/clear-selection.execution.mjs +4 -1
- package/esm2022/domain/f-selection/get-can-be-selected-items/get-can-be-selected-items.execution.mjs +20 -8
- package/esm2022/domain/f-selection/get-current-selection/get-current-selection.execution.mjs +4 -1
- package/esm2022/domain/f-selection/providers.mjs +4 -1
- package/esm2022/domain/f-selection/select/select.execution.mjs +7 -4
- package/esm2022/domain/f-selection/select-all/select-all.execution.mjs +8 -4
- package/esm2022/domain/f-selection/select-and-update-node-layer/select-and-update-node-layer.execution.mjs +17 -17
- package/esm2022/domain/f-zoom/add-zoom-to-store/add-zoom-to-store.execution.mjs +6 -3
- package/esm2022/domain/f-zoom/providers.mjs +6 -1
- package/esm2022/domain/f-zoom/remove-zoom-from-store/remove-zoom-from-store.execution.mjs +6 -3
- package/esm2022/domain/f-zoom/reset-zoom/reset-zoom.execution.mjs +6 -3
- package/esm2022/domain/f-zoom/set-zoom/set-zoom.execution.mjs +11 -7
- package/esm2022/domain/get-deep-children-nodes-and-groups/get-deep-children-nodes-and-groups.execution.mjs +7 -3
- package/esm2022/domain/get-element-rounded-rect/get-element-rounded-rect.execution.mjs +8 -4
- package/esm2022/domain/get-normalized-connector-rect/get-normalized-connector-rect.execution.mjs +11 -6
- package/esm2022/domain/get-normalized-element-rect/get-normalized-element-rect.execution.mjs +10 -5
- package/esm2022/domain/get-normalized-point/get-normalized-point.execution.mjs +9 -4
- package/esm2022/domain/providers.mjs +7 -1
- package/esm2022/domain/sort-item-layers/sort-item-layers.execution.mjs +15 -8
- package/esm2022/domain/sort-item-layers/sort-items-by-parent/sort-items-by-parent.execution.mjs +12 -7
- package/esm2022/domain/sort-item-layers/sort-node-layers-by-groups/sort-node-layers.execution.mjs +13 -8
- package/esm2022/domain/update-item-and-children-layers/move-front-elements-before-target-element/move-front-elements-before-target-element.execution.mjs +5 -1
- package/esm2022/domain/update-item-and-children-layers/update-item-and-children-layers.execution.mjs +10 -6
- package/esm2022/drag-toolkit/drag-and-drop-base.mjs +55 -1
- package/esm2022/f-canvas/f-canvas.component.mjs +67 -20
- package/esm2022/f-zoom/f-zoom.directive.mjs +8 -2
- package/f-canvas/f-canvas.component.d.ts +51 -3
- package/f-connection/providers.d.ts +1 -1
- package/f-draggable/f-connection/providers.d.ts +1 -1
- package/f-draggable/f-node-move/create-move-nodes-drag-model-from-selection/providers.d.ts +1 -1
- package/f-draggable/f-node-move/providers.d.ts +1 -1
- package/f-draggable/providers.d.ts +1 -1
- package/f-external-item/domain/providers.d.ts +1 -1
- package/f-minimap/providers.d.ts +1 -1
- package/f-node/providers.d.ts +2 -2
- package/f-storage/providers.d.ts +1 -1
- package/f-zoom/f-zoom.directive.d.ts +1 -0
- package/fesm2022/foblex-flow.mjs +756 -259
- package/fesm2022/foblex-flow.mjs.map +1 -1
- package/package.json +1 -1
package/fesm2022/foblex-flow.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { InjectionToken, inject, Injectable, effect, Directive, input, computed, signal, DestroyRef, EventEmitter, booleanAttribute, Input, Output, ElementRef, Inject, Component, ChangeDetectionStrategy, ViewChild, Optional, viewChild, contentChildren, numberAttribute, Injector, ViewContainerRef, TemplateRef, NgZone, ContentChildren, contentChild, output, Renderer2, NgModule } from '@angular/core';
|
|
3
3
|
import { RectExtensions, RoundedRect, TransformModelExtensions, PointExtensions, SizeExtensions, Point, LineExtensions, GetIntersections, findClosestAlignment, setRectToElement, adjustRectToMinSize, setRectToViewBox } from '@foblex/2d';
|
|
4
4
|
import { __decorate } from 'tslib';
|
|
5
|
-
import * as
|
|
5
|
+
import * as i1$1 from '@foblex/mediator';
|
|
6
6
|
import { FExecutionRegister, FMediator } from '@foblex/mediator';
|
|
7
7
|
import * as i1 from '@foblex/platform';
|
|
8
8
|
import { BrowserService, PlatformService, EOperationSystem } from '@foblex/platform';
|
|
@@ -19,8 +19,12 @@ class GetElementRoundedRectRequest {
|
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
/**
|
|
23
|
+
* Execution that retrieves the rectangle of an element with its border-radius.
|
|
24
|
+
* It calculates the rectangle based on the element's dimensions and its computed style.
|
|
25
|
+
*/
|
|
22
26
|
let GetElementRoundedRectExecution = class GetElementRoundedRectExecution {
|
|
23
|
-
|
|
27
|
+
_browser = inject(BrowserService);
|
|
24
28
|
handle(request) {
|
|
25
29
|
return this._getRoundedRect(RectExtensions.fromElement(request.element), request.element, this._getComputedStyle(request.element));
|
|
26
30
|
}
|
|
@@ -28,10 +32,10 @@ let GetElementRoundedRectExecution = class GetElementRoundedRectExecution {
|
|
|
28
32
|
return new RoundedRect(rect.x, rect.y, rect.width, rect.height, this._toPixels(styles.borderTopLeftRadius, element, styles.fontSize), this._toPixels(styles.borderTopRightRadius, element, styles.fontSize), this._toPixels(styles.borderBottomRightRadius, element, styles.fontSize), this._toPixels(styles.borderBottomLeftRadius, element, styles.fontSize));
|
|
29
33
|
}
|
|
30
34
|
_getComputedStyle(element) {
|
|
31
|
-
return this.
|
|
35
|
+
return this._browser.window.getComputedStyle(element);
|
|
32
36
|
}
|
|
33
37
|
_toPixels(value, element, fontSize) {
|
|
34
|
-
return this.
|
|
38
|
+
return this._browser.toPixels(value, element.clientWidth, element.clientHeight, fontSize) || 0;
|
|
35
39
|
}
|
|
36
40
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetElementRoundedRectExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
37
41
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetElementRoundedRectExecution });
|
|
@@ -299,10 +303,13 @@ const F_STORAGE_PROVIDERS = [
|
|
|
299
303
|
FComponentsStore,
|
|
300
304
|
];
|
|
301
305
|
|
|
306
|
+
/**
|
|
307
|
+
* Execution that adds a background to the FComponentsStore.
|
|
308
|
+
*/
|
|
302
309
|
let AddBackgroundToStoreExecution = class AddBackgroundToStoreExecution {
|
|
303
|
-
|
|
310
|
+
_store = inject(FComponentsStore);
|
|
304
311
|
handle(request) {
|
|
305
|
-
this.
|
|
312
|
+
this._store.fBackground = request.fBackground;
|
|
306
313
|
}
|
|
307
314
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AddBackgroundToStoreExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
308
315
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AddBackgroundToStoreExecution });
|
|
@@ -323,11 +330,14 @@ class AddPatternToBackgroundRequest {
|
|
|
323
330
|
}
|
|
324
331
|
|
|
325
332
|
let uniqueId$c = 0;
|
|
333
|
+
/**
|
|
334
|
+
* Execution that adds a pattern to the background in the FComponentsStore.
|
|
335
|
+
*/
|
|
326
336
|
let AddPatternToBackgroundExecution = class AddPatternToBackgroundExecution {
|
|
327
|
-
|
|
337
|
+
_store = inject(FComponentsStore);
|
|
328
338
|
_fBrowser = inject(BrowserService);
|
|
329
339
|
get _fBackground() {
|
|
330
|
-
return this.
|
|
340
|
+
return this._store.fBackground;
|
|
331
341
|
}
|
|
332
342
|
handle(request) {
|
|
333
343
|
const children = request.fPattern?.hostElement.getElementsByTagName('pattern') || [];
|
|
@@ -343,7 +353,7 @@ let AddPatternToBackgroundExecution = class AddPatternToBackgroundExecution {
|
|
|
343
353
|
rect.setAttribute('width', '100%');
|
|
344
354
|
rect.setAttribute('height', '100%');
|
|
345
355
|
this._fBackground.hostElement.firstChild?.appendChild(rect);
|
|
346
|
-
const transform = this.
|
|
356
|
+
const transform = this._store.fCanvas?.transform || TransformModelExtensions.default();
|
|
347
357
|
request.fPattern?.setTransform(transform);
|
|
348
358
|
}
|
|
349
359
|
}
|
|
@@ -365,10 +375,13 @@ class RemoveBackgroundFromStoreRequest {
|
|
|
365
375
|
}
|
|
366
376
|
}
|
|
367
377
|
|
|
378
|
+
/**
|
|
379
|
+
* Execution that removes the background from the FComponentsStore.
|
|
380
|
+
*/
|
|
368
381
|
let RemoveBackgroundFromStoreExecution = class RemoveBackgroundFromStoreExecution {
|
|
369
|
-
|
|
382
|
+
_store = inject(FComponentsStore);
|
|
370
383
|
handle(request) {
|
|
371
|
-
this.
|
|
384
|
+
this._store.fBackground = undefined;
|
|
372
385
|
}
|
|
373
386
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoveBackgroundFromStoreExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
374
387
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoveBackgroundFromStoreExecution });
|
|
@@ -388,10 +401,13 @@ class SetBackgroundTransformRequest {
|
|
|
388
401
|
}
|
|
389
402
|
}
|
|
390
403
|
|
|
404
|
+
/**
|
|
405
|
+
* Execution that sets the transform for the background when canvas is transformed.
|
|
406
|
+
*/
|
|
391
407
|
let SetBackgroundTransformExecution = class SetBackgroundTransformExecution {
|
|
392
|
-
|
|
408
|
+
_store = inject(FComponentsStore);
|
|
393
409
|
handle(request) {
|
|
394
|
-
this.
|
|
410
|
+
this._store.fBackground?.setTransform(request.fTransform);
|
|
395
411
|
}
|
|
396
412
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SetBackgroundTransformExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
397
413
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SetBackgroundTransformExecution });
|
|
@@ -403,6 +419,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
403
419
|
type: Injectable
|
|
404
420
|
}] });
|
|
405
421
|
|
|
422
|
+
/**
|
|
423
|
+
* This file exports all the background-related features for the F-Flow domain.
|
|
424
|
+
* It includes executions for adding, removing, and setting the background in the FComponentsStore.
|
|
425
|
+
*/
|
|
406
426
|
const F_BACKGROUND_FEATURES = [
|
|
407
427
|
AddBackgroundToStoreExecution,
|
|
408
428
|
AddPatternToBackgroundExecution,
|
|
@@ -418,10 +438,13 @@ class AddCanvasToStoreRequest {
|
|
|
418
438
|
}
|
|
419
439
|
}
|
|
420
440
|
|
|
441
|
+
/**
|
|
442
|
+
* Execution that adds a canvas to the FComponentsStore.
|
|
443
|
+
*/
|
|
421
444
|
let AddCanvasToStoreExecution = class AddCanvasToStoreExecution {
|
|
422
|
-
|
|
445
|
+
_store = inject(FComponentsStore);
|
|
423
446
|
handle(request) {
|
|
424
|
-
this.
|
|
447
|
+
this._store.fCanvas = request.fCanvas;
|
|
425
448
|
}
|
|
426
449
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AddCanvasToStoreExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
427
450
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AddCanvasToStoreExecution });
|
|
@@ -443,11 +466,14 @@ class CenterGroupOrNodeRequest {
|
|
|
443
466
|
}
|
|
444
467
|
}
|
|
445
468
|
|
|
469
|
+
/**
|
|
470
|
+
* Execution that centers a group or a node inside the flow.
|
|
471
|
+
*/
|
|
446
472
|
let CenterGroupOrNodeExecution = class CenterGroupOrNodeExecution {
|
|
447
|
-
|
|
473
|
+
_store = inject(FComponentsStore);
|
|
448
474
|
_fMediator = inject(FMediator);
|
|
449
475
|
get transform() {
|
|
450
|
-
return this.
|
|
476
|
+
return this._store.fCanvas.transform;
|
|
451
477
|
}
|
|
452
478
|
handle(request) {
|
|
453
479
|
const fNode = this.getNode(request.id);
|
|
@@ -462,13 +488,13 @@ let CenterGroupOrNodeExecution = class CenterGroupOrNodeExecution {
|
|
|
462
488
|
this.transform.position = PointExtensions.initialize((fFlowRect.width - fNodeRect.width) / 2 - position.x * this.transform.scale, (fFlowRect.height - fNodeRect.height) / 2 - position.y * this.transform.scale);
|
|
463
489
|
}
|
|
464
490
|
getNode(id) {
|
|
465
|
-
return this.
|
|
491
|
+
return this._store.fNodes.find((x) => x.fId() === id);
|
|
466
492
|
}
|
|
467
493
|
getNodeRect(fNode) {
|
|
468
494
|
return RectExtensions.fromElement(fNode.hostElement);
|
|
469
495
|
}
|
|
470
496
|
getFlowRect() {
|
|
471
|
-
return RectExtensions.fromElement(this.
|
|
497
|
+
return RectExtensions.fromElement(this._store.fFlow.hostElement);
|
|
472
498
|
}
|
|
473
499
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CenterGroupOrNodeExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
474
500
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CenterGroupOrNodeExecution });
|
|
@@ -490,10 +516,13 @@ class FitToFlowRequest {
|
|
|
490
516
|
}
|
|
491
517
|
}
|
|
492
518
|
|
|
519
|
+
/**
|
|
520
|
+
* Fits all nodes and groups to the flow by scaling and positioning them
|
|
521
|
+
*/
|
|
493
522
|
let FitToFlowExecution = class FitToFlowExecution {
|
|
494
|
-
|
|
523
|
+
_store = inject(FComponentsStore);
|
|
495
524
|
get transform() {
|
|
496
|
-
return this.
|
|
525
|
+
return this._store.fCanvas.transform;
|
|
497
526
|
}
|
|
498
527
|
_fMediator = inject(FMediator);
|
|
499
528
|
handle(request) {
|
|
@@ -501,7 +530,7 @@ let FitToFlowExecution = class FitToFlowExecution {
|
|
|
501
530
|
if (fNodesRect.width === 0 || fNodesRect.height === 0) {
|
|
502
531
|
return;
|
|
503
532
|
}
|
|
504
|
-
this.fitToParent(fNodesRect, RectExtensions.fromElement(this.
|
|
533
|
+
this.fitToParent(fNodesRect, RectExtensions.fromElement(this._store.fFlow.hostElement), this._store.fNodes.map((x) => x.position), request.toCenter);
|
|
505
534
|
this._fMediator.execute(new RedrawCanvasWithAnimationRequest(request.animated));
|
|
506
535
|
}
|
|
507
536
|
fitToParent(rect, parentRect, points, toCenter) {
|
|
@@ -536,10 +565,13 @@ class GetCanvasRequest {
|
|
|
536
565
|
static fToken = Symbol('GetCanvasRequest');
|
|
537
566
|
}
|
|
538
567
|
|
|
568
|
+
/**
|
|
569
|
+
* Execution that retrieves the canvas from the FComponentsStore.
|
|
570
|
+
*/
|
|
539
571
|
let GetCanvasExecution = class GetCanvasExecution {
|
|
540
|
-
|
|
572
|
+
_store = inject(FComponentsStore);
|
|
541
573
|
handle(request) {
|
|
542
|
-
const result = this.
|
|
574
|
+
const result = this._store.fCanvas;
|
|
543
575
|
if (!result) {
|
|
544
576
|
throw new Error(`Canvas not found in store`);
|
|
545
577
|
}
|
|
@@ -565,8 +597,11 @@ class InputCanvasPositionRequest {
|
|
|
565
597
|
}
|
|
566
598
|
}
|
|
567
599
|
|
|
600
|
+
/**
|
|
601
|
+
* It updates the canvas position and redraws the canvas when the user set a new position using the input.
|
|
602
|
+
*/
|
|
568
603
|
let InputCanvasPositionExecution = class InputCanvasPositionExecution {
|
|
569
|
-
|
|
604
|
+
_store = inject(FComponentsStore);
|
|
570
605
|
handle(request) {
|
|
571
606
|
if (!request.position) {
|
|
572
607
|
return;
|
|
@@ -575,7 +610,7 @@ let InputCanvasPositionExecution = class InputCanvasPositionExecution {
|
|
|
575
610
|
if (!PointExtensions.isEqual(position, request.position)) {
|
|
576
611
|
request.transform.position = request.position;
|
|
577
612
|
request.transform.scaledPosition = PointExtensions.initialize();
|
|
578
|
-
this.
|
|
613
|
+
this._store.fCanvas?.redraw();
|
|
579
614
|
}
|
|
580
615
|
return void 0;
|
|
581
616
|
}
|
|
@@ -599,14 +634,18 @@ class InputCanvasScaleRequest {
|
|
|
599
634
|
}
|
|
600
635
|
}
|
|
601
636
|
|
|
637
|
+
/**
|
|
638
|
+
* Execution that handles the scaling of the input canvas.
|
|
639
|
+
* It updates the scale of the canvas transform and redraws the canvas when the user sets a new scale using the input.
|
|
640
|
+
*/
|
|
602
641
|
let InputCanvasScaleExecution = class InputCanvasScaleExecution {
|
|
603
|
-
|
|
642
|
+
_store = inject(FComponentsStore);
|
|
604
643
|
handle(request) {
|
|
605
644
|
if (!request.scale && request.scale !== 0) {
|
|
606
645
|
return;
|
|
607
646
|
}
|
|
608
647
|
request.transform.scale = request.scale;
|
|
609
|
-
this.
|
|
648
|
+
this._store.fCanvas?.redraw();
|
|
610
649
|
}
|
|
611
650
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: InputCanvasScaleExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
612
651
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: InputCanvasScaleExecution });
|
|
@@ -636,22 +675,27 @@ function transitionEnd(element, callback) {
|
|
|
636
675
|
element.addEventListener('transitionend', onTransitionEnd);
|
|
637
676
|
}
|
|
638
677
|
|
|
678
|
+
/**
|
|
679
|
+
* Execution that redraws the canvas with or without animation based on the request.
|
|
680
|
+
* If animated, it will redraw with animation and wait for the transition end to notify data change.
|
|
681
|
+
* If not animated, it will redraw immediately and notify data change.
|
|
682
|
+
*/
|
|
639
683
|
let RedrawCanvasWithAnimationExecution = class RedrawCanvasWithAnimationExecution {
|
|
640
|
-
|
|
684
|
+
_store = inject(FComponentsStore);
|
|
641
685
|
get _fCanvasElement() {
|
|
642
|
-
return this.
|
|
686
|
+
return this._store.fCanvas.hostElement;
|
|
643
687
|
}
|
|
644
688
|
handle(request) {
|
|
645
689
|
request.animated ? this._redrawWithAnimation() : this._redraw();
|
|
646
|
-
this.
|
|
690
|
+
this._store.fCanvas.emitCanvasChangeEvent();
|
|
647
691
|
}
|
|
648
692
|
_redrawWithAnimation() {
|
|
649
|
-
this.
|
|
650
|
-
transitionEnd(this._fCanvasElement, () => this.
|
|
693
|
+
this._store.fCanvas.redrawWithAnimation();
|
|
694
|
+
transitionEnd(this._fCanvasElement, () => this._store.dataChanged());
|
|
651
695
|
}
|
|
652
696
|
_redraw() {
|
|
653
|
-
this.
|
|
654
|
-
this.
|
|
697
|
+
this._store.fCanvas.redraw();
|
|
698
|
+
this._store.dataChanged();
|
|
655
699
|
}
|
|
656
700
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RedrawCanvasWithAnimationExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
657
701
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RedrawCanvasWithAnimationExecution });
|
|
@@ -667,10 +711,13 @@ class RemoveCanvasFromStoreRequest {
|
|
|
667
711
|
static fToken = Symbol('RemoveCanvasFromStoreRequest');
|
|
668
712
|
}
|
|
669
713
|
|
|
714
|
+
/**
|
|
715
|
+
* Execution that removes the canvas from the FComponentsStore.
|
|
716
|
+
*/
|
|
670
717
|
let RemoveCanvasFromStoreExecution = class RemoveCanvasFromStoreExecution {
|
|
671
|
-
|
|
718
|
+
_store = inject(FComponentsStore);
|
|
672
719
|
handle(request) {
|
|
673
|
-
this.
|
|
720
|
+
this._store.fCanvas = undefined;
|
|
674
721
|
}
|
|
675
722
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoveCanvasFromStoreExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
676
723
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoveCanvasFromStoreExecution });
|
|
@@ -686,10 +733,13 @@ class ResetScaleRequest {
|
|
|
686
733
|
static fToken = Symbol('ResetScaleRequest');
|
|
687
734
|
}
|
|
688
735
|
|
|
736
|
+
/**
|
|
737
|
+
* Execution that resets the scale of the canvas in the FComponentsStore.
|
|
738
|
+
*/
|
|
689
739
|
let ResetScaleExecution = class ResetScaleExecution {
|
|
690
|
-
|
|
740
|
+
_store = inject(FComponentsStore);
|
|
691
741
|
get transform() {
|
|
692
|
-
return this.
|
|
742
|
+
return this._store.fCanvas.transform;
|
|
693
743
|
}
|
|
694
744
|
handle(request) {
|
|
695
745
|
this.transform.scale = 1;
|
|
@@ -713,18 +763,21 @@ class ResetScaleAndCenterRequest {
|
|
|
713
763
|
}
|
|
714
764
|
}
|
|
715
765
|
|
|
766
|
+
/**
|
|
767
|
+
* Execution that resets the scale of the canvas and centers the nodes and groups inside the flow.
|
|
768
|
+
*/
|
|
716
769
|
let ResetScaleAndCenterExecution = class ResetScaleAndCenterExecution {
|
|
717
770
|
_fMediator = inject(FMediator);
|
|
718
|
-
|
|
771
|
+
_store = inject(FComponentsStore);
|
|
719
772
|
get _transform() {
|
|
720
|
-
return this.
|
|
773
|
+
return this._store.fCanvas.transform;
|
|
721
774
|
}
|
|
722
775
|
handle(request) {
|
|
723
776
|
const fNodesRect = this._fMediator.execute(new CalculateNodesBoundingBoxRequest()) || RectExtensions.initialize();
|
|
724
777
|
if (fNodesRect.width === 0 || fNodesRect.height === 0) {
|
|
725
778
|
return;
|
|
726
779
|
}
|
|
727
|
-
this._oneToOneCentering(fNodesRect, RectExtensions.fromElement(this.
|
|
780
|
+
this._oneToOneCentering(fNodesRect, RectExtensions.fromElement(this._store.fFlow.hostElement), this._store.fNodes.map((x) => x.position));
|
|
728
781
|
this._fMediator.execute(new RedrawCanvasWithAnimationRequest(request.animated));
|
|
729
782
|
}
|
|
730
783
|
_oneToOneCentering(rect, parentRect, points) {
|
|
@@ -760,10 +813,14 @@ class UpdateScaleRequest {
|
|
|
760
813
|
}
|
|
761
814
|
}
|
|
762
815
|
|
|
816
|
+
/**
|
|
817
|
+
* Execution that updates the scale of the canvas in the FComponentsStore.
|
|
818
|
+
* Occurs when the fZoom directive or User call the setScale method.
|
|
819
|
+
*/
|
|
763
820
|
let UpdateScaleExecution = class UpdateScaleExecution {
|
|
764
|
-
|
|
821
|
+
_store = inject(FComponentsStore);
|
|
765
822
|
get transform() {
|
|
766
|
-
return this.
|
|
823
|
+
return this._store.fCanvas.transform;
|
|
767
824
|
}
|
|
768
825
|
handle(request) {
|
|
769
826
|
if (request.scale !== this.transform.scale) {
|
|
@@ -784,6 +841,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
784
841
|
type: Injectable
|
|
785
842
|
}] });
|
|
786
843
|
|
|
844
|
+
/**
|
|
845
|
+
* This file exports all the canvas-related executions that can be used in the FCanvas feature.
|
|
846
|
+
*/
|
|
787
847
|
const F_CANVAS_FEATURES = [
|
|
788
848
|
AddCanvasToStoreExecution,
|
|
789
849
|
CenterGroupOrNodeExecution,
|
|
@@ -806,10 +866,13 @@ class AddConnectionForCreateToStoreRequest {
|
|
|
806
866
|
}
|
|
807
867
|
}
|
|
808
868
|
|
|
869
|
+
/**
|
|
870
|
+
* Execution that adds a connection for creation to the FComponentsStore.
|
|
871
|
+
*/
|
|
809
872
|
let AddConnectionForCreateToStoreExecution = class AddConnectionForCreateToStoreExecution {
|
|
810
|
-
|
|
873
|
+
_store = inject(FComponentsStore);
|
|
811
874
|
handle(request) {
|
|
812
|
-
this.
|
|
875
|
+
this._store.fTempConnection = request.fConnection;
|
|
813
876
|
}
|
|
814
877
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AddConnectionForCreateToStoreExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
815
878
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AddConnectionForCreateToStoreExecution });
|
|
@@ -829,10 +892,13 @@ class AddConnectionMarkerToStoreRequest {
|
|
|
829
892
|
}
|
|
830
893
|
}
|
|
831
894
|
|
|
895
|
+
/**
|
|
896
|
+
* Execution that adds a connection marker to the FComponentsStore.
|
|
897
|
+
*/
|
|
832
898
|
let AddConnectionMarkerToStoreExecution = class AddConnectionMarkerToStoreExecution {
|
|
833
|
-
|
|
899
|
+
_store = inject(FComponentsStore);
|
|
834
900
|
handle(request) {
|
|
835
|
-
this.
|
|
901
|
+
this._store.addComponent(this._store.fMarkers, request.fComponent);
|
|
836
902
|
}
|
|
837
903
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AddConnectionMarkerToStoreExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
838
904
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AddConnectionMarkerToStoreExecution });
|
|
@@ -852,11 +918,14 @@ class AddConnectionToStoreRequest {
|
|
|
852
918
|
}
|
|
853
919
|
}
|
|
854
920
|
|
|
921
|
+
/**
|
|
922
|
+
* Execution that adds a connection to the FComponentsStore.
|
|
923
|
+
*/
|
|
855
924
|
let AddConnectionToStoreExecution = class AddConnectionToStoreExecution {
|
|
856
|
-
|
|
925
|
+
_store = inject(FComponentsStore);
|
|
857
926
|
handle(request) {
|
|
858
|
-
this.
|
|
859
|
-
this.
|
|
927
|
+
this._store.fConnections.push(request.fConnection);
|
|
928
|
+
this._store.dataChanged();
|
|
860
929
|
}
|
|
861
930
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AddConnectionToStoreExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
862
931
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AddConnectionToStoreExecution });
|
|
@@ -876,10 +945,13 @@ class AddSnapConnectionToStoreRequest {
|
|
|
876
945
|
}
|
|
877
946
|
}
|
|
878
947
|
|
|
948
|
+
/**
|
|
949
|
+
* Execution that adds a snap connection to the FComponentsStore.
|
|
950
|
+
*/
|
|
879
951
|
let AddSnapConnectionToStoreExecution = class AddSnapConnectionToStoreExecution {
|
|
880
|
-
|
|
952
|
+
_store = inject(FComponentsStore);
|
|
881
953
|
handle(request) {
|
|
882
|
-
this.
|
|
954
|
+
this._store.fSnapConnection = request.fConnection;
|
|
883
955
|
}
|
|
884
956
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AddSnapConnectionToStoreExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
885
957
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AddSnapConnectionToStoreExecution });
|
|
@@ -899,9 +971,12 @@ class CreateConnectionMarkersRequest {
|
|
|
899
971
|
}
|
|
900
972
|
}
|
|
901
973
|
|
|
974
|
+
/**
|
|
975
|
+
* Execution that creates connection markers for a given connection.
|
|
976
|
+
*/
|
|
902
977
|
let CreateConnectionMarkersExecution = class CreateConnectionMarkersExecution {
|
|
903
978
|
_browser = inject(BrowserService);
|
|
904
|
-
|
|
979
|
+
_store = inject(FComponentsStore);
|
|
905
980
|
handle(request) {
|
|
906
981
|
const element = createSVGElement$1('defs', this._browser);
|
|
907
982
|
const fConnection = request.fConnection;
|
|
@@ -922,7 +997,7 @@ let CreateConnectionMarkersExecution = class CreateConnectionMarkersExecution {
|
|
|
922
997
|
this.makeSafariCompatible(fConnection);
|
|
923
998
|
}
|
|
924
999
|
getMarkers(fConnection) {
|
|
925
|
-
return this.
|
|
1000
|
+
return this._store.fMarkers.filter((x) => fConnection.hostElement.contains(x.hostElement));
|
|
926
1001
|
}
|
|
927
1002
|
// Safari does not support markers on path elements if markers are defined after the path element
|
|
928
1003
|
makeSafariCompatible(fConnection) {
|
|
@@ -2777,6 +2852,11 @@ const F_CONNECTION_PROVIDERS = [
|
|
|
2777
2852
|
FSnapConnectionComponent
|
|
2778
2853
|
];
|
|
2779
2854
|
|
|
2855
|
+
/**
|
|
2856
|
+
* Floating behavior calculates the connection line
|
|
2857
|
+
* It constructs a line between the intersections of the connectors rectangles and line from the centers of the connector rectangles
|
|
2858
|
+
* @param payload
|
|
2859
|
+
*/
|
|
2780
2860
|
function floatingBehavior(payload) {
|
|
2781
2861
|
return _getIntersectionsLine(_fromRoundedRectIntersections(payload), _toRoundedRectIntersections(payload), payload);
|
|
2782
2862
|
}
|
|
@@ -2793,6 +2873,11 @@ function _getIntersectionsLine(from, to, payload) {
|
|
|
2793
2873
|
};
|
|
2794
2874
|
}
|
|
2795
2875
|
|
|
2876
|
+
/**
|
|
2877
|
+
* Fixed center behavior calculates the connection line
|
|
2878
|
+
* It constructs a line between the gravity centers of the connector rectangles
|
|
2879
|
+
* @param payload
|
|
2880
|
+
*/
|
|
2796
2881
|
function fixedCenterBehavior(payload) {
|
|
2797
2882
|
return {
|
|
2798
2883
|
point1: payload.outputRect.gravityCenter,
|
|
@@ -2800,6 +2885,11 @@ function fixedCenterBehavior(payload) {
|
|
|
2800
2885
|
};
|
|
2801
2886
|
}
|
|
2802
2887
|
|
|
2888
|
+
/**
|
|
2889
|
+
* Fixed outbound behavior calculates the connection line
|
|
2890
|
+
* It constructs a line between the specified sides of the output and input rectangles
|
|
2891
|
+
* @param payload
|
|
2892
|
+
*/
|
|
2803
2893
|
function fixedOutboundBehavior(payload) {
|
|
2804
2894
|
return {
|
|
2805
2895
|
point1: _getPosition(payload.outputRect, payload.outputSide === EFConnectableSide.AUTO ? EFConnectableSide.BOTTOM : payload.outputSide),
|
|
@@ -2821,6 +2911,9 @@ function _getPosition(rect, side) {
|
|
|
2821
2911
|
}
|
|
2822
2912
|
}
|
|
2823
2913
|
|
|
2914
|
+
/**
|
|
2915
|
+
* Execution that calculates the connection line based on the behavior.
|
|
2916
|
+
*/
|
|
2824
2917
|
let CalculateConnectionLineByBehaviorExecution = class CalculateConnectionLineByBehaviorExecution {
|
|
2825
2918
|
_handlers = {
|
|
2826
2919
|
[EFConnectionBehavior.FLOATING.toString()]: floatingBehavior,
|
|
@@ -2860,10 +2953,15 @@ class GetNormalizedPointRequest {
|
|
|
2860
2953
|
}
|
|
2861
2954
|
}
|
|
2862
2955
|
|
|
2956
|
+
/**
|
|
2957
|
+
* Execution that retrieves the normalized point of a position.
|
|
2958
|
+
* It calculates the point based on the position's transformation
|
|
2959
|
+
* and the canvas transformation.
|
|
2960
|
+
*/
|
|
2863
2961
|
let GetNormalizedPointExecution = class GetNormalizedPointExecution {
|
|
2864
|
-
|
|
2962
|
+
_store = inject(FComponentsStore);
|
|
2865
2963
|
get _transform() {
|
|
2866
|
-
return this.
|
|
2964
|
+
return this._store.fCanvas.transform;
|
|
2867
2965
|
}
|
|
2868
2966
|
// BrowserWindow
|
|
2869
2967
|
// +------------------------------------------+
|
|
@@ -2885,7 +2983,7 @@ let GetNormalizedPointExecution = class GetNormalizedPointExecution {
|
|
|
2885
2983
|
// Transform from the browser window to the canvas coordinates:
|
|
2886
2984
|
handle(request) {
|
|
2887
2985
|
return Point.fromPoint(request.position)
|
|
2888
|
-
.elementTransform(this.
|
|
2986
|
+
.elementTransform(this._store.flowHost)
|
|
2889
2987
|
.sub(this._transform.scaledPosition)
|
|
2890
2988
|
.sub(this._transform.position)
|
|
2891
2989
|
.div(this._transform.scale);
|
|
@@ -2900,11 +2998,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
2900
2998
|
type: Injectable
|
|
2901
2999
|
}] });
|
|
2902
3000
|
|
|
3001
|
+
/**
|
|
3002
|
+
* Execution that retrieves the normalized rectangle of a connector.
|
|
3003
|
+
* It calculates the rectangle based on the element's position and size,
|
|
3004
|
+
* adjusting for the canvas transformation and element offsets.
|
|
3005
|
+
*/
|
|
2903
3006
|
let GetNormalizedConnectorRectExecution = class GetNormalizedConnectorRectExecution {
|
|
2904
|
-
|
|
2905
|
-
|
|
3007
|
+
_store = inject(FComponentsStore);
|
|
3008
|
+
_mediator = inject(FMediator);
|
|
2906
3009
|
get _transform() {
|
|
2907
|
-
return this.
|
|
3010
|
+
return this._store.fCanvas.transform;
|
|
2908
3011
|
}
|
|
2909
3012
|
handle(request) {
|
|
2910
3013
|
const systemRect = this._getElementRoundedRect(request);
|
|
@@ -2915,10 +3018,10 @@ let GetNormalizedConnectorRectExecution = class GetNormalizedConnectorRectExecut
|
|
|
2915
3018
|
return RoundedRect.fromCenter(unscaledRect, offsetSize.width, offsetSize.height);
|
|
2916
3019
|
}
|
|
2917
3020
|
_getElementRoundedRect(request) {
|
|
2918
|
-
return this.
|
|
3021
|
+
return this._mediator.execute(new GetElementRoundedRectRequest(request.element));
|
|
2919
3022
|
}
|
|
2920
3023
|
_normalizePosition(rect) {
|
|
2921
|
-
return this.
|
|
3024
|
+
return this._mediator.execute(new GetNormalizedPointRequest(rect));
|
|
2922
3025
|
}
|
|
2923
3026
|
_unscaleSize(rect) {
|
|
2924
3027
|
return SizeExtensions.initialize(rect.width / this._transform.scale, rect.height / this._transform.scale);
|
|
@@ -2939,38 +3042,43 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
2939
3042
|
type: Injectable
|
|
2940
3043
|
}] });
|
|
2941
3044
|
|
|
3045
|
+
/**
|
|
3046
|
+
* Execution that redraws connections in the FComponentsStore.
|
|
3047
|
+
* It resets connectors, sets markers for temporary and snap connections,
|
|
3048
|
+
* and sets up connections based on the stored outputs and inputs.
|
|
3049
|
+
*/
|
|
2942
3050
|
let RedrawConnectionsExecution = class RedrawConnectionsExecution {
|
|
2943
3051
|
_fMediator = inject(FMediator);
|
|
2944
|
-
|
|
3052
|
+
_store = inject(FComponentsStore);
|
|
2945
3053
|
handle(request) {
|
|
2946
3054
|
this._resetConnectors();
|
|
2947
|
-
if (this.
|
|
2948
|
-
this._setMarkers(this.
|
|
3055
|
+
if (this._store.fTempConnection) {
|
|
3056
|
+
this._setMarkers(this._store.fTempConnection);
|
|
2949
3057
|
}
|
|
2950
|
-
if (this.
|
|
2951
|
-
this._setMarkers(this.
|
|
3058
|
+
if (this._store.fSnapConnection) {
|
|
3059
|
+
this._setMarkers(this._store.fSnapConnection);
|
|
2952
3060
|
}
|
|
2953
|
-
this.
|
|
3061
|
+
this._store.fConnections.forEach((x) => {
|
|
2954
3062
|
this._setupConnection(this._getOutput(x.fOutputId), this._getInput(x.fInputId), x);
|
|
2955
3063
|
});
|
|
2956
3064
|
}
|
|
2957
3065
|
_getOutput(id) {
|
|
2958
|
-
const result = this.
|
|
3066
|
+
const result = this._store.fOutputs.find((x) => x.fId === id);
|
|
2959
3067
|
if (!result) {
|
|
2960
3068
|
throw new Error(`Output with id ${id} not found`);
|
|
2961
3069
|
}
|
|
2962
3070
|
return result;
|
|
2963
3071
|
}
|
|
2964
3072
|
_getInput(id) {
|
|
2965
|
-
const result = this.
|
|
3073
|
+
const result = this._store.fInputs.find((x) => x.fId === id);
|
|
2966
3074
|
if (!result) {
|
|
2967
3075
|
throw new Error(`Input with id ${id} not found`);
|
|
2968
3076
|
}
|
|
2969
3077
|
return result;
|
|
2970
3078
|
}
|
|
2971
3079
|
_resetConnectors() {
|
|
2972
|
-
this.
|
|
2973
|
-
this.
|
|
3080
|
+
this._store.fOutputs.forEach((x) => x.resetConnected());
|
|
3081
|
+
this._store.fInputs.forEach((x) => x.resetConnected());
|
|
2974
3082
|
}
|
|
2975
3083
|
_setupConnection(fOutput, fInput, fConnection) {
|
|
2976
3084
|
fOutput.setConnected(fInput);
|
|
@@ -3001,10 +3109,13 @@ class RemoveConnectionForCreateFromStoreRequest {
|
|
|
3001
3109
|
static fToken = Symbol('RemoveConnectionForCreateFromStoreRequest');
|
|
3002
3110
|
}
|
|
3003
3111
|
|
|
3112
|
+
/**
|
|
3113
|
+
* Execution that removes a connection for creation from the FComponentsStore.
|
|
3114
|
+
*/
|
|
3004
3115
|
let RemoveConnectionForCreateFromStoreExecution = class RemoveConnectionForCreateFromStoreExecution {
|
|
3005
|
-
|
|
3116
|
+
_store = inject(FComponentsStore);
|
|
3006
3117
|
handle(request) {
|
|
3007
|
-
this.
|
|
3118
|
+
this._store.fTempConnection = undefined;
|
|
3008
3119
|
}
|
|
3009
3120
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoveConnectionForCreateFromStoreExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3010
3121
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoveConnectionForCreateFromStoreExecution });
|
|
@@ -3024,14 +3135,17 @@ class RemoveConnectionFromStoreRequest {
|
|
|
3024
3135
|
}
|
|
3025
3136
|
}
|
|
3026
3137
|
|
|
3138
|
+
/**
|
|
3139
|
+
* Execution that removes a connection from the FComponentsStore.
|
|
3140
|
+
*/
|
|
3027
3141
|
let RemoveConnectionFromStoreExecution = class RemoveConnectionFromStoreExecution {
|
|
3028
|
-
|
|
3142
|
+
_store = inject(FComponentsStore);
|
|
3029
3143
|
handle(request) {
|
|
3030
|
-
this.
|
|
3031
|
-
this.
|
|
3144
|
+
this._store.fConnections.splice(this._getIndexOfConnection(request.fConnection), 1);
|
|
3145
|
+
this._store.dataChanged();
|
|
3032
3146
|
}
|
|
3033
3147
|
_getIndexOfConnection(fConnection) {
|
|
3034
|
-
const result = this.
|
|
3148
|
+
const result = this._store.fConnections.indexOf(fConnection);
|
|
3035
3149
|
if (result === -1) {
|
|
3036
3150
|
throw new Error(`Connection not found in store`);
|
|
3037
3151
|
}
|
|
@@ -3055,10 +3169,13 @@ class RemoveConnectionMarkerFromStoreRequest {
|
|
|
3055
3169
|
}
|
|
3056
3170
|
}
|
|
3057
3171
|
|
|
3172
|
+
/**
|
|
3173
|
+
* Execution that removes a connection marker from the FComponentsStore.
|
|
3174
|
+
*/
|
|
3058
3175
|
let RemoveConnectionMarkerFromStoreExecution = class RemoveConnectionMarkerFromStoreExecution {
|
|
3059
|
-
|
|
3176
|
+
_store = inject(FComponentsStore);
|
|
3060
3177
|
handle(request) {
|
|
3061
|
-
this.
|
|
3178
|
+
this._store.removeComponent(this._store.fMarkers, request.fComponent);
|
|
3062
3179
|
}
|
|
3063
3180
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoveConnectionMarkerFromStoreExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3064
3181
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoveConnectionMarkerFromStoreExecution });
|
|
@@ -3074,10 +3191,13 @@ class RemoveSnapConnectionFromStoreRequest {
|
|
|
3074
3191
|
static fToken = Symbol('RemoveSnapConnectionFromStoreRequest');
|
|
3075
3192
|
}
|
|
3076
3193
|
|
|
3194
|
+
/**
|
|
3195
|
+
* Execution that removes the snap connection from the FComponentsStore.
|
|
3196
|
+
*/
|
|
3077
3197
|
let RemoveSnapConnectionFromStoreExecution = class RemoveSnapConnectionFromStoreExecution {
|
|
3078
|
-
|
|
3198
|
+
_store = inject(FComponentsStore);
|
|
3079
3199
|
handle(request) {
|
|
3080
|
-
this.
|
|
3200
|
+
this._store.fSnapConnection = undefined;
|
|
3081
3201
|
}
|
|
3082
3202
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoveSnapConnectionFromStoreExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3083
3203
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoveSnapConnectionFromStoreExecution });
|
|
@@ -3089,6 +3209,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
3089
3209
|
type: Injectable
|
|
3090
3210
|
}] });
|
|
3091
3211
|
|
|
3212
|
+
/**
|
|
3213
|
+
* This file exports all the connection-related features for the F-Flow domain.
|
|
3214
|
+
*/
|
|
3092
3215
|
const F_CONNECTION_FEATURES = [
|
|
3093
3216
|
AddConnectionForCreateToStoreExecution,
|
|
3094
3217
|
AddConnectionMarkerToStoreExecution,
|
|
@@ -3111,10 +3234,13 @@ class AddInputToStoreRequest {
|
|
|
3111
3234
|
}
|
|
3112
3235
|
}
|
|
3113
3236
|
|
|
3237
|
+
/**
|
|
3238
|
+
* Execution that adds an InputConnector to the FComponentsStore.
|
|
3239
|
+
*/
|
|
3114
3240
|
let AddInputToStoreExecution = class AddInputToStoreExecution {
|
|
3115
|
-
|
|
3241
|
+
_store = inject(FComponentsStore);
|
|
3116
3242
|
handle(request) {
|
|
3117
|
-
this.
|
|
3243
|
+
this._store.addComponent(this._store.fInputs, request.fComponent);
|
|
3118
3244
|
}
|
|
3119
3245
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AddInputToStoreExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3120
3246
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AddInputToStoreExecution });
|
|
@@ -3134,6 +3260,9 @@ class AddOutletToStoreRequest {
|
|
|
3134
3260
|
}
|
|
3135
3261
|
}
|
|
3136
3262
|
|
|
3263
|
+
/**
|
|
3264
|
+
* Execution that adds an OutletConnector to the FComponentsStore.
|
|
3265
|
+
*/
|
|
3137
3266
|
let AddOutletToStoreExecution = class AddOutletToStoreExecution {
|
|
3138
3267
|
_fComponentsStore = inject(FComponentsStore);
|
|
3139
3268
|
handle(request) {
|
|
@@ -3157,6 +3286,9 @@ class AddOutputToStoreRequest {
|
|
|
3157
3286
|
}
|
|
3158
3287
|
}
|
|
3159
3288
|
|
|
3289
|
+
/**
|
|
3290
|
+
* Execution that adds an OutputConnector to the FComponentsStore.
|
|
3291
|
+
*/
|
|
3160
3292
|
let AddOutputToStoreExecution = class AddOutputToStoreExecution {
|
|
3161
3293
|
_fComponentsStore = inject(FComponentsStore);
|
|
3162
3294
|
handle(request) {
|
|
@@ -3182,6 +3314,11 @@ class FindClosestConnectorRequest {
|
|
|
3182
3314
|
}
|
|
3183
3315
|
}
|
|
3184
3316
|
|
|
3317
|
+
/**
|
|
3318
|
+
* Execution that finds the closest connector to a given point.
|
|
3319
|
+
* It calculates the distance from the point to each connector's rectangle
|
|
3320
|
+
* and returns the closest one along with its distance.
|
|
3321
|
+
*/
|
|
3185
3322
|
let FindClosestConnectorExecution = class FindClosestConnectorExecution {
|
|
3186
3323
|
handle(payload) {
|
|
3187
3324
|
let result;
|
|
@@ -3228,6 +3365,11 @@ class FindConnectableConnectorUsingPriorityAndPositionRequest {
|
|
|
3228
3365
|
}
|
|
3229
3366
|
}
|
|
3230
3367
|
|
|
3368
|
+
/**
|
|
3369
|
+
* Execution that finds a connectable connector at a given position with priority.
|
|
3370
|
+
* It checks for connectors at the position, the closest connector if snap connection is enabled,
|
|
3371
|
+
* and the first connectable connector of the node at that position.
|
|
3372
|
+
*/
|
|
3231
3373
|
let FindConnectableConnectorUsingPriorityAndPositionExecution = class FindConnectableConnectorUsingPriorityAndPositionExecution {
|
|
3232
3374
|
_mediator = inject(FMediator);
|
|
3233
3375
|
_store = inject(FComponentsStore);
|
|
@@ -3327,8 +3469,11 @@ class GetConnectorAndRectRequest {
|
|
|
3327
3469
|
}
|
|
3328
3470
|
}
|
|
3329
3471
|
|
|
3472
|
+
/**
|
|
3473
|
+
* Execution that retrieves a connector and its rectangle.
|
|
3474
|
+
*/
|
|
3330
3475
|
let GetConnectorAndRectExecution = class GetConnectorAndRectExecution {
|
|
3331
|
-
|
|
3476
|
+
_mediator = inject(FMediator);
|
|
3332
3477
|
handle(request) {
|
|
3333
3478
|
return {
|
|
3334
3479
|
fConnector: request.fConnector,
|
|
@@ -3336,7 +3481,7 @@ let GetConnectorAndRectExecution = class GetConnectorAndRectExecution {
|
|
|
3336
3481
|
};
|
|
3337
3482
|
}
|
|
3338
3483
|
_getConnectorRect(fConnector) {
|
|
3339
|
-
return this.
|
|
3484
|
+
return this._mediator.execute(new GetNormalizedConnectorRectRequest(fConnector.hostElement));
|
|
3340
3485
|
}
|
|
3341
3486
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetConnectorAndRectExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3342
3487
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetConnectorAndRectExecution });
|
|
@@ -3348,15 +3493,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
3348
3493
|
type: Injectable
|
|
3349
3494
|
}] });
|
|
3350
3495
|
|
|
3496
|
+
/**
|
|
3497
|
+
* Execution that retrieves all input connectors that can be connected to a given output or outlet connector,
|
|
3498
|
+
*/
|
|
3351
3499
|
let GetAllCanBeConnectedInputsAndRectsExecution = class GetAllCanBeConnectedInputsAndRectsExecution {
|
|
3352
|
-
|
|
3500
|
+
_mediator = inject(FMediator);
|
|
3353
3501
|
_fComponentsStore = inject(FComponentsStore);
|
|
3354
3502
|
get _fInputs() {
|
|
3355
3503
|
return this._fComponentsStore.fInputs;
|
|
3356
3504
|
}
|
|
3357
3505
|
handle(payload) {
|
|
3358
3506
|
return this._getCanBeConnectedInputs(payload.fOutputOrOutlet).map((x) => {
|
|
3359
|
-
return this.
|
|
3507
|
+
return this._mediator.execute(new GetConnectorAndRectRequest(x));
|
|
3360
3508
|
});
|
|
3361
3509
|
}
|
|
3362
3510
|
_getCanBeConnectedInputs(fOutputOrOutlet) {
|
|
@@ -3393,15 +3541,20 @@ class GetAllCanBeConnectedSourceConnectorsAndRectsRequest {
|
|
|
3393
3541
|
}
|
|
3394
3542
|
}
|
|
3395
3543
|
|
|
3544
|
+
/**
|
|
3545
|
+
* Execution that retrieves all source connectors that can be connected to a given target connector,
|
|
3546
|
+
* along with their rectangles.
|
|
3547
|
+
* Source - Output or Outlet connectors.
|
|
3548
|
+
*/
|
|
3396
3549
|
let GetAllCanBeConnectedSourceConnectorsAndRectsExecution = class GetAllCanBeConnectedSourceConnectorsAndRectsExecution {
|
|
3397
|
-
|
|
3550
|
+
_mediator = inject(FMediator);
|
|
3398
3551
|
_fComponentsStore = inject(FComponentsStore);
|
|
3399
3552
|
get _fSourceConnectors() {
|
|
3400
3553
|
return this._fComponentsStore.fOutputs;
|
|
3401
3554
|
}
|
|
3402
3555
|
handle(payload) {
|
|
3403
3556
|
return this._getCanBeConnectedSourceConnectors(payload.fTargetConnector).map((x) => {
|
|
3404
|
-
return this.
|
|
3557
|
+
return this._mediator.execute(new GetConnectorAndRectRequest(x));
|
|
3405
3558
|
});
|
|
3406
3559
|
}
|
|
3407
3560
|
_getCanBeConnectedSourceConnectors(fTargetConnector) {
|
|
@@ -3431,6 +3584,9 @@ class MarkConnectableConnectorsRequest {
|
|
|
3431
3584
|
}
|
|
3432
3585
|
}
|
|
3433
3586
|
|
|
3587
|
+
/**
|
|
3588
|
+
* Execution that marks connectors as connectable.
|
|
3589
|
+
*/
|
|
3434
3590
|
let MarkConnectableConnectorsExecution = class MarkConnectableConnectorsExecution {
|
|
3435
3591
|
_store = inject(FComponentsStore);
|
|
3436
3592
|
handle(payload) {
|
|
@@ -3458,10 +3614,13 @@ class RemoveInputFromStoreRequest {
|
|
|
3458
3614
|
}
|
|
3459
3615
|
}
|
|
3460
3616
|
|
|
3617
|
+
/**
|
|
3618
|
+
* Execution that removes an inputConnector from the FComponentsStore.
|
|
3619
|
+
*/
|
|
3461
3620
|
let RemoveInputFromStoreExecution = class RemoveInputFromStoreExecution {
|
|
3462
|
-
|
|
3621
|
+
_store = inject(FComponentsStore);
|
|
3463
3622
|
handle(request) {
|
|
3464
|
-
this.
|
|
3623
|
+
this._store.removeComponent(this._store.fInputs, request.fComponent);
|
|
3465
3624
|
}
|
|
3466
3625
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoveInputFromStoreExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3467
3626
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoveInputFromStoreExecution });
|
|
@@ -3481,10 +3640,13 @@ class RemoveOutletFromStoreRequest {
|
|
|
3481
3640
|
}
|
|
3482
3641
|
}
|
|
3483
3642
|
|
|
3643
|
+
/**
|
|
3644
|
+
* Execution that removes an outlet connector from the FComponentsStore.
|
|
3645
|
+
*/
|
|
3484
3646
|
let RemoveOutletFromStoreExecution = class RemoveOutletFromStoreExecution {
|
|
3485
|
-
|
|
3647
|
+
_store = inject(FComponentsStore);
|
|
3486
3648
|
handle(request) {
|
|
3487
|
-
this.
|
|
3649
|
+
this._store.removeComponent(this._store.fOutlets, request.fComponent);
|
|
3488
3650
|
}
|
|
3489
3651
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoveOutletFromStoreExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3490
3652
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoveOutletFromStoreExecution });
|
|
@@ -3504,10 +3666,13 @@ class RemoveOutputFromStoreRequest {
|
|
|
3504
3666
|
}
|
|
3505
3667
|
}
|
|
3506
3668
|
|
|
3669
|
+
/**
|
|
3670
|
+
* Execution that removes an outlet connector from the FComponentsStore.
|
|
3671
|
+
*/
|
|
3507
3672
|
let RemoveOutputFromStoreExecution = class RemoveOutputFromStoreExecution {
|
|
3508
|
-
|
|
3673
|
+
_store = inject(FComponentsStore);
|
|
3509
3674
|
handle(request) {
|
|
3510
|
-
this.
|
|
3675
|
+
this._store.removeComponent(this._store.fOutputs, request.fComponent);
|
|
3511
3676
|
}
|
|
3512
3677
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoveOutputFromStoreExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3513
3678
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoveOutputFromStoreExecution });
|
|
@@ -3527,6 +3692,9 @@ class UnmarkConnectableConnectorsRequest {
|
|
|
3527
3692
|
}
|
|
3528
3693
|
}
|
|
3529
3694
|
|
|
3695
|
+
/**
|
|
3696
|
+
* Execution that unmarks connectors as connectable.
|
|
3697
|
+
*/
|
|
3530
3698
|
let UnmarkConnectableConnectorsExecution = class UnmarkConnectableConnectorsExecution {
|
|
3531
3699
|
_store = inject(FComponentsStore);
|
|
3532
3700
|
handle(payload) {
|
|
@@ -3546,6 +3714,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
3546
3714
|
type: Injectable
|
|
3547
3715
|
}] });
|
|
3548
3716
|
|
|
3717
|
+
/*
|
|
3718
|
+
* This file exports all the connector-related executions that can be used in the FFlow domain.
|
|
3719
|
+
*/
|
|
3549
3720
|
const F_CONNECTORS_FEATURES = [
|
|
3550
3721
|
AddInputToStoreExecution,
|
|
3551
3722
|
AddOutletToStoreExecution,
|
|
@@ -3570,10 +3741,13 @@ class AddDndToStoreRequest {
|
|
|
3570
3741
|
}
|
|
3571
3742
|
}
|
|
3572
3743
|
|
|
3744
|
+
/**
|
|
3745
|
+
* Execution that adds a drag and drop directive to the FComponentsStore.
|
|
3746
|
+
*/
|
|
3573
3747
|
let AddDndToStoreExecution = class AddDndToStoreExecution {
|
|
3574
|
-
|
|
3748
|
+
_store = inject(FComponentsStore);
|
|
3575
3749
|
handle(request) {
|
|
3576
|
-
this.
|
|
3750
|
+
this._store.fDraggable = request.fComponent;
|
|
3577
3751
|
}
|
|
3578
3752
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AddDndToStoreExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3579
3753
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AddDndToStoreExecution });
|
|
@@ -6656,7 +6830,7 @@ let GetNormalizedChildrenNodesRectExecution = class GetNormalizedChildrenNodesRe
|
|
|
6656
6830
|
concatRectWithParentPadding(rect, padding) {
|
|
6657
6831
|
return RectExtensions.initialize(rect.x - padding[0], rect.y - padding[1], rect.width + padding[0] + padding[2], rect.height + +padding[1] + padding[3]);
|
|
6658
6832
|
}
|
|
6659
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetNormalizedChildrenNodesRectExecution, deps: [{ token:
|
|
6833
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetNormalizedChildrenNodesRectExecution, deps: [{ token: i1$1.FMediator }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6660
6834
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetNormalizedChildrenNodesRectExecution });
|
|
6661
6835
|
};
|
|
6662
6836
|
GetNormalizedChildrenNodesRectExecution = __decorate([
|
|
@@ -6664,7 +6838,7 @@ GetNormalizedChildrenNodesRectExecution = __decorate([
|
|
|
6664
6838
|
], GetNormalizedChildrenNodesRectExecution);
|
|
6665
6839
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetNormalizedChildrenNodesRectExecution, decorators: [{
|
|
6666
6840
|
type: Injectable
|
|
6667
|
-
}], ctorParameters: () => [{ type:
|
|
6841
|
+
}], ctorParameters: () => [{ type: i1$1.FMediator }] });
|
|
6668
6842
|
|
|
6669
6843
|
class GetNodeResizeRestrictionsRequest {
|
|
6670
6844
|
fNode;
|
|
@@ -7368,6 +7542,11 @@ class EventExtensions {
|
|
|
7368
7542
|
}
|
|
7369
7543
|
|
|
7370
7544
|
const MOUSE_EVENT_IGNORE_TIME = 800;
|
|
7545
|
+
/**
|
|
7546
|
+
* Base class for implementing drag and drop functionality.
|
|
7547
|
+
* It handles mouse and touch events, manages the drag start sequence,
|
|
7548
|
+
* and provides abstract methods for derived classes to implement specific behaviors.
|
|
7549
|
+
*/
|
|
7371
7550
|
class DragAndDropBase {
|
|
7372
7551
|
ngZone;
|
|
7373
7552
|
document;
|
|
@@ -7389,6 +7568,12 @@ class DragAndDropBase {
|
|
|
7389
7568
|
constructor(ngZone) {
|
|
7390
7569
|
this.ngZone = ngZone;
|
|
7391
7570
|
}
|
|
7571
|
+
/**
|
|
7572
|
+
* Handles the mouse down event to initiate the drag sequence.
|
|
7573
|
+
* It checks if the event is synthetic or fake, and if the drag is already started.
|
|
7574
|
+
* If not, it sets up the drag start sequence by adding necessary event listeners.
|
|
7575
|
+
* @param event - The mouse event that triggered the drag.
|
|
7576
|
+
*/
|
|
7392
7577
|
onMouseDown = (event) => {
|
|
7393
7578
|
const isSyntheticEvent = this.isSyntheticEvent(event);
|
|
7394
7579
|
const isFakeEvent = isFakeMousedownFromScreenReader(event);
|
|
@@ -7417,6 +7602,12 @@ class DragAndDropBase {
|
|
|
7417
7602
|
};
|
|
7418
7603
|
}
|
|
7419
7604
|
};
|
|
7605
|
+
/**
|
|
7606
|
+
* Handles the touch down event to initiate the drag sequence.
|
|
7607
|
+
* It checks if the event is synthetic or fake, and if the drag is already started.
|
|
7608
|
+
* If not, it sets up the drag start sequence by adding necessary event listeners.
|
|
7609
|
+
* @param event - The touch event that triggered the drag.
|
|
7610
|
+
*/
|
|
7420
7611
|
onTouchDown = (event) => {
|
|
7421
7612
|
const isFakeEvent = isFakeTouchstartFromScreenReader(event);
|
|
7422
7613
|
const touchEvent = new ITouchDownEvent(event);
|
|
@@ -7444,15 +7635,39 @@ class DragAndDropBase {
|
|
|
7444
7635
|
};
|
|
7445
7636
|
}
|
|
7446
7637
|
};
|
|
7638
|
+
/**
|
|
7639
|
+
* Handles the select start event.
|
|
7640
|
+
* This method is called when the user starts selecting text or elements.
|
|
7641
|
+
* It prevents the default behavior and calls the onSelect method to handle the selection.
|
|
7642
|
+
* @param event - The event that triggered the select start.
|
|
7643
|
+
*/
|
|
7447
7644
|
onSelectStart = (event) => {
|
|
7448
7645
|
this.onSelect(event);
|
|
7449
7646
|
};
|
|
7647
|
+
/**
|
|
7648
|
+
* Handles the mouse move event during the drag sequence.
|
|
7649
|
+
* It checks if the drag sequence should start and calls the move handler accordingly.
|
|
7650
|
+
* @param event - The mouse event that triggered the move.
|
|
7651
|
+
*/
|
|
7450
7652
|
onMouseMove = (event) => {
|
|
7451
7653
|
this.moveHandler(new IMouseEvent(event));
|
|
7452
7654
|
};
|
|
7655
|
+
/**
|
|
7656
|
+
* Handles the touch move event during the drag sequence.
|
|
7657
|
+
* It checks if the drag sequence should start and calls the move handler accordingly.
|
|
7658
|
+
* @param event - The touch event that triggered the move.
|
|
7659
|
+
*/
|
|
7453
7660
|
onTouchMove = (event) => {
|
|
7454
7661
|
this.moveHandler(new ITouchMoveEvent(event));
|
|
7455
7662
|
};
|
|
7663
|
+
/**
|
|
7664
|
+
* Checks if the drag sequence should start based on the pointer position.
|
|
7665
|
+
* It compares the current pointer position with the initial drag start position
|
|
7666
|
+
* and checks if the distance exceeds the drag start threshold.
|
|
7667
|
+
* If the threshold is exceeded and the delay has passed,
|
|
7668
|
+
* it prepares the drag sequence and sets the move handler to onPointerMove.
|
|
7669
|
+
* @param event - The pointer event that triggered the check.
|
|
7670
|
+
*/
|
|
7456
7671
|
checkDragSequenceToStart(event) {
|
|
7457
7672
|
const pointerPosition = event.getPosition();
|
|
7458
7673
|
if (!this.isDragStarted && this.pointerDownElement) {
|
|
@@ -7476,12 +7691,25 @@ class DragAndDropBase {
|
|
|
7476
7691
|
}
|
|
7477
7692
|
}
|
|
7478
7693
|
}
|
|
7694
|
+
/**
|
|
7695
|
+
* Handles the pointer up event at the end of the drag sequence.
|
|
7696
|
+
* It checks if the drag has started and calls the onPointerUp method.
|
|
7697
|
+
* It also ends the drag sequence by resetting the state and removing event listeners.
|
|
7698
|
+
* This method is called when the user releases the mouse button or lifts their finger from the touch screen.
|
|
7699
|
+
* @param event - The pointer event that triggered the up action.
|
|
7700
|
+
*/
|
|
7479
7701
|
onPointerUpEvent = (event) => {
|
|
7480
7702
|
if (this.isDragStarted) {
|
|
7481
7703
|
this.onPointerUp(new IPointerUpEvent(event));
|
|
7482
7704
|
}
|
|
7483
7705
|
this.endDragSequence();
|
|
7484
7706
|
};
|
|
7707
|
+
/**
|
|
7708
|
+
* Ends the drag sequence by resetting the state and removing event listeners.
|
|
7709
|
+
* It sets the isDragStarted flag to false, clears the pointerDownElement,
|
|
7710
|
+
* and resets the moveHandler to checkDragSequenceToStart.
|
|
7711
|
+
* It also removes all mouse and touch event listeners that were added during the drag sequence.
|
|
7712
|
+
*/
|
|
7485
7713
|
endDragSequence() {
|
|
7486
7714
|
this.isDragStarted = false;
|
|
7487
7715
|
this.pointerDownElement = null;
|
|
@@ -7923,7 +8151,7 @@ let MinimapDragPreparationExecution = class MinimapDragPreparationExecution {
|
|
|
7923
8151
|
getFlowRect() {
|
|
7924
8152
|
return RectExtensions.fromElement(this.flowHost);
|
|
7925
8153
|
}
|
|
7926
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MinimapDragPreparationExecution, deps: [{ token: FComponentsStore }, { token:
|
|
8154
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MinimapDragPreparationExecution, deps: [{ token: FComponentsStore }, { token: i1$1.FMediator }, { token: FDraggableDataContext }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
7927
8155
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MinimapDragPreparationExecution });
|
|
7928
8156
|
};
|
|
7929
8157
|
MinimapDragPreparationExecution = __decorate([
|
|
@@ -7931,7 +8159,7 @@ MinimapDragPreparationExecution = __decorate([
|
|
|
7931
8159
|
], MinimapDragPreparationExecution);
|
|
7932
8160
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MinimapDragPreparationExecution, decorators: [{
|
|
7933
8161
|
type: Injectable
|
|
7934
|
-
}], ctorParameters: () => [{ type: FComponentsStore }, { type:
|
|
8162
|
+
}], ctorParameters: () => [{ type: FComponentsStore }, { type: i1$1.FMediator }, { type: FDraggableDataContext }] });
|
|
7935
8163
|
|
|
7936
8164
|
const MINIMAP_DRAG_PREPARATION_PROVIDERS = [
|
|
7937
8165
|
MinimapDragPreparationExecution,
|
|
@@ -8367,6 +8595,9 @@ class ClearSelectionRequest {
|
|
|
8367
8595
|
static fToken = Symbol('ClearSelectionRequest');
|
|
8368
8596
|
}
|
|
8369
8597
|
|
|
8598
|
+
/**
|
|
8599
|
+
* Execution that clears the selection of items in the FDraggableDataContext.
|
|
8600
|
+
*/
|
|
8370
8601
|
let ClearSelectionExecution = class ClearSelectionExecution {
|
|
8371
8602
|
_fDraggableDataContext = inject(FDraggableDataContext);
|
|
8372
8603
|
handle(request) {
|
|
@@ -8396,11 +8627,16 @@ class GetNormalizedElementRectRequest {
|
|
|
8396
8627
|
}
|
|
8397
8628
|
}
|
|
8398
8629
|
|
|
8630
|
+
/**
|
|
8631
|
+
* Execution that retrieves the normalized rectangle of an element.
|
|
8632
|
+
* It calculates the rectangle based on the element's position and size,
|
|
8633
|
+
* adjusting for the canvas transformation and element offsets.
|
|
8634
|
+
*/
|
|
8399
8635
|
let GetNormalizedElementRectExecution = class GetNormalizedElementRectExecution {
|
|
8400
|
-
|
|
8401
|
-
|
|
8636
|
+
_store = inject(FComponentsStore);
|
|
8637
|
+
_mediator = inject(FMediator);
|
|
8402
8638
|
get _transform() {
|
|
8403
|
-
return this.
|
|
8639
|
+
return this._store.fCanvas.transform;
|
|
8404
8640
|
}
|
|
8405
8641
|
handle(request) {
|
|
8406
8642
|
const systemRect = this._getElementRoundedRect(request);
|
|
@@ -8426,7 +8662,7 @@ let GetNormalizedElementRectExecution = class GetNormalizedElementRectExecution
|
|
|
8426
8662
|
return RoundedRect.fromRect(RectExtensions.fromElement(request.element));
|
|
8427
8663
|
}
|
|
8428
8664
|
_normalizePosition(rect) {
|
|
8429
|
-
return this.
|
|
8665
|
+
return this._mediator.execute(new GetNormalizedPointRequest(rect));
|
|
8430
8666
|
}
|
|
8431
8667
|
_unscaleSize(rect) {
|
|
8432
8668
|
return SizeExtensions.initialize(rect.width / this._transform.scale, rect.height / this._transform.scale);
|
|
@@ -8447,37 +8683,49 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
8447
8683
|
type: Injectable
|
|
8448
8684
|
}] });
|
|
8449
8685
|
|
|
8686
|
+
/**
|
|
8687
|
+
* Execution that retrieves elements that can be selected in the Flow, along with their bounding rectangles.
|
|
8688
|
+
* It filters out elements that are already selected in the FDraggableDataContext.
|
|
8689
|
+
*/
|
|
8450
8690
|
let GetCanBeSelectedItemsExecution = class GetCanBeSelectedItemsExecution {
|
|
8451
|
-
|
|
8452
|
-
|
|
8691
|
+
_mediator = inject(FMediator);
|
|
8692
|
+
_store = inject(FComponentsStore);
|
|
8453
8693
|
_fDraggableDataContext = inject(FDraggableDataContext);
|
|
8454
8694
|
get fNodes() {
|
|
8455
|
-
return this.
|
|
8695
|
+
return this._store.fNodes;
|
|
8456
8696
|
}
|
|
8457
8697
|
get fConnections() {
|
|
8458
|
-
return this.
|
|
8698
|
+
return this._store.fConnections;
|
|
8459
8699
|
}
|
|
8460
8700
|
get transform() {
|
|
8461
|
-
return this.
|
|
8701
|
+
return this._store.fCanvas.transform;
|
|
8462
8702
|
}
|
|
8463
8703
|
handle() {
|
|
8464
8704
|
return [...this.getNodesWithRects(), ...this.getConnectionsWithRects()].filter((x) => {
|
|
8465
8705
|
return !this._fDraggableDataContext.selectedItems.includes(x.element);
|
|
8466
8706
|
});
|
|
8467
8707
|
}
|
|
8708
|
+
/**
|
|
8709
|
+
* Retrieves nodes with their bounding rectangles that can be selected.
|
|
8710
|
+
* @private
|
|
8711
|
+
*/
|
|
8468
8712
|
getNodesWithRects() {
|
|
8469
8713
|
return this.fNodes.filter((x) => !x.fSelectionDisabled).map((x) => {
|
|
8470
8714
|
return {
|
|
8471
8715
|
element: x,
|
|
8472
|
-
fRect: RectExtensions.mult(this.
|
|
8716
|
+
fRect: RectExtensions.mult(this._mediator.execute(new GetNormalizedElementRectRequest(x.hostElement)), this.transform.scale)
|
|
8473
8717
|
};
|
|
8474
8718
|
});
|
|
8475
8719
|
}
|
|
8720
|
+
/**
|
|
8721
|
+
* Retrieves connections with their bounding rectangles that can be selected.
|
|
8722
|
+
* @private
|
|
8723
|
+
*/
|
|
8476
8724
|
getConnectionsWithRects() {
|
|
8477
8725
|
return this.fConnections.filter((x) => !x.fSelectionDisabled).map((x) => {
|
|
8478
8726
|
return {
|
|
8479
8727
|
element: x,
|
|
8480
|
-
fRect: RectExtensions.mult(this.
|
|
8728
|
+
fRect: RectExtensions.mult(this._mediator.execute(new GetNormalizedElementRectRequest(x.boundingElement)), this.transform.scale)
|
|
8481
8729
|
};
|
|
8482
8730
|
});
|
|
8483
8731
|
}
|
|
@@ -8495,6 +8743,9 @@ class GetCurrentSelectionRequest {
|
|
|
8495
8743
|
static fToken = Symbol('GetCurrentSelectionRequest');
|
|
8496
8744
|
}
|
|
8497
8745
|
|
|
8746
|
+
/**
|
|
8747
|
+
* Execution that retrieves the current selection of items in the FDraggableDataContext.
|
|
8748
|
+
*/
|
|
8498
8749
|
let GetCurrentSelectionExecution = class GetCurrentSelectionExecution {
|
|
8499
8750
|
_fDraggableDataContext = inject(FDraggableDataContext);
|
|
8500
8751
|
handle() {
|
|
@@ -8541,23 +8792,26 @@ class SelectRequest {
|
|
|
8541
8792
|
}
|
|
8542
8793
|
}
|
|
8543
8794
|
|
|
8795
|
+
/**
|
|
8796
|
+
* Execution that handles the selection of nodes and connections in the FFlow.
|
|
8797
|
+
*/
|
|
8544
8798
|
let SelectExecution = class SelectExecution {
|
|
8545
8799
|
_fDraggableDataContext = inject(FDraggableDataContext);
|
|
8546
|
-
|
|
8800
|
+
_store = inject(FComponentsStore);
|
|
8547
8801
|
handle(request) {
|
|
8548
8802
|
this._fDraggableDataContext.selectedItems.forEach((x) => {
|
|
8549
8803
|
x.unmarkAsSelected();
|
|
8550
8804
|
});
|
|
8551
8805
|
this._fDraggableDataContext.selectedItems = [];
|
|
8552
8806
|
request.nodes.forEach((key) => {
|
|
8553
|
-
const node = this.
|
|
8807
|
+
const node = this._store.fNodes.find((x) => x.fId() === key);
|
|
8554
8808
|
if (node) {
|
|
8555
8809
|
node.markAsSelected();
|
|
8556
8810
|
this._fDraggableDataContext.selectedItems.push(node);
|
|
8557
8811
|
}
|
|
8558
8812
|
});
|
|
8559
8813
|
request.connections.forEach((key) => {
|
|
8560
|
-
const connection = this.
|
|
8814
|
+
const connection = this._store.fConnections.find((x) => x.fId() === key);
|
|
8561
8815
|
if (connection) {
|
|
8562
8816
|
connection.markAsSelected();
|
|
8563
8817
|
this._fDraggableDataContext.selectedItems.push(connection);
|
|
@@ -8579,19 +8833,23 @@ class SelectAllRequest {
|
|
|
8579
8833
|
static fToken = Symbol('SelectAllRequest');
|
|
8580
8834
|
}
|
|
8581
8835
|
|
|
8836
|
+
/**
|
|
8837
|
+
* Execution that selects all components in the FComponentsStore.
|
|
8838
|
+
* It marks all nodes and connections as selected and updates the selected items in the FDraggableDataContext.
|
|
8839
|
+
*/
|
|
8582
8840
|
let SelectAllExecution = class SelectAllExecution {
|
|
8583
8841
|
_fDraggableDataContext = inject(FDraggableDataContext);
|
|
8584
|
-
|
|
8842
|
+
_store = inject(FComponentsStore);
|
|
8585
8843
|
handle(request) {
|
|
8586
8844
|
this._fDraggableDataContext.selectedItems.forEach((x) => {
|
|
8587
8845
|
x.unmarkAsSelected();
|
|
8588
8846
|
});
|
|
8589
8847
|
this._fDraggableDataContext.selectedItems = [];
|
|
8590
|
-
this.
|
|
8848
|
+
this._store.fNodes.forEach((x) => {
|
|
8591
8849
|
x.markAsSelected();
|
|
8592
8850
|
this._fDraggableDataContext.selectedItems.push(x);
|
|
8593
8851
|
});
|
|
8594
|
-
this.
|
|
8852
|
+
this._store.fConnections.forEach((x) => {
|
|
8595
8853
|
x.markAsSelected();
|
|
8596
8854
|
this._fDraggableDataContext.selectedItems.push(x);
|
|
8597
8855
|
});
|
|
@@ -8630,6 +8888,10 @@ class MoveFrontElementsBeforeTargetElementRequest {
|
|
|
8630
8888
|
}
|
|
8631
8889
|
}
|
|
8632
8890
|
|
|
8891
|
+
/**
|
|
8892
|
+
* Execution that moves elements in the FItemsContainer before a target element.
|
|
8893
|
+
* It removes elements that should not be in front and inserts them before the target element.
|
|
8894
|
+
*/
|
|
8633
8895
|
let MoveFrontElementsBeforeTargetElementExecution = class MoveFrontElementsBeforeTargetElementExecution {
|
|
8634
8896
|
handle(request) {
|
|
8635
8897
|
const elementsToMove = [];
|
|
@@ -8672,8 +8934,12 @@ class GetDeepChildrenNodesAndGroupsRequest {
|
|
|
8672
8934
|
}
|
|
8673
8935
|
}
|
|
8674
8936
|
|
|
8937
|
+
/**
|
|
8938
|
+
* Execution that retrieves all deep children nodes and groups from the FComponentsStore.
|
|
8939
|
+
* It traverses the node hierarchy to find all descendants of a given node.
|
|
8940
|
+
*/
|
|
8675
8941
|
let GetDeepChildrenNodesAndGroupsExecution = class GetDeepChildrenNodesAndGroupsExecution {
|
|
8676
|
-
|
|
8942
|
+
_store = inject(FComponentsStore);
|
|
8677
8943
|
handle(request) {
|
|
8678
8944
|
return this._getChildrenNodes(request.fId);
|
|
8679
8945
|
}
|
|
@@ -8682,7 +8948,7 @@ let GetDeepChildrenNodesAndGroupsExecution = class GetDeepChildrenNodesAndGroups
|
|
|
8682
8948
|
throw new Error('Circular reference detected in the node hierarchy. Node id: ' + fId);
|
|
8683
8949
|
}
|
|
8684
8950
|
visited.add(fId);
|
|
8685
|
-
const directChildren = this.
|
|
8951
|
+
const directChildren = this._store.fNodes.filter((x) => x.fParentId === fId);
|
|
8686
8952
|
return directChildren.reduce((result, x) => {
|
|
8687
8953
|
return result.concat(this._getChildrenNodes(x.fId(), visited));
|
|
8688
8954
|
}, directChildren);
|
|
@@ -8697,11 +8963,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
8697
8963
|
type: Injectable
|
|
8698
8964
|
}] });
|
|
8699
8965
|
|
|
8966
|
+
/**
|
|
8967
|
+
* Execution that updates the layers of an item and its children in the FCanvas.
|
|
8968
|
+
* It handles different item containers (groups, nodes, connections) and updates their layers accordingly.
|
|
8969
|
+
*/
|
|
8700
8970
|
let UpdateItemAndChildrenLayersExecution = class UpdateItemAndChildrenLayersExecution {
|
|
8701
|
-
|
|
8702
|
-
|
|
8971
|
+
_store = inject(FComponentsStore);
|
|
8972
|
+
_mediator = inject(FMediator);
|
|
8703
8973
|
get _fCanvas() {
|
|
8704
|
-
return this.
|
|
8974
|
+
return this._store.fCanvas;
|
|
8705
8975
|
}
|
|
8706
8976
|
get _fGroupsContainer() {
|
|
8707
8977
|
return this._fCanvas.fGroupsContainer().nativeElement;
|
|
@@ -8748,7 +9018,7 @@ let UpdateItemAndChildrenLayersExecution = class UpdateItemAndChildrenLayersExec
|
|
|
8748
9018
|
const allElements = Array.from(itemContainer.children);
|
|
8749
9019
|
const targetIndex = allElements.findIndex((x) => x === item);
|
|
8750
9020
|
if (this._isAnythingNeedToBeMoved(allElements, targetIndex, elementsThatShouldBeInFront)) {
|
|
8751
|
-
this.
|
|
9021
|
+
this._mediator.execute(new MoveFrontElementsBeforeTargetElementRequest(itemContainer, allElements, elementsThatShouldBeInFront, targetIndex));
|
|
8752
9022
|
}
|
|
8753
9023
|
}
|
|
8754
9024
|
_isAnythingNeedToBeMoved(allElements, targetIndex, elementsThatShouldBeInFront) {
|
|
@@ -8770,7 +9040,7 @@ let UpdateItemAndChildrenLayersExecution = class UpdateItemAndChildrenLayersExec
|
|
|
8770
9040
|
.sort((a, b) => allElements.indexOf(a) - allElements.indexOf(b));
|
|
8771
9041
|
}
|
|
8772
9042
|
_getChildrenNodesAndGroups(fId) {
|
|
8773
|
-
return this.
|
|
9043
|
+
return this._mediator.execute(new GetDeepChildrenNodesAndGroupsRequest(fId)).map((x) => x.hostElement);
|
|
8774
9044
|
}
|
|
8775
9045
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: UpdateItemAndChildrenLayersExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
8776
9046
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: UpdateItemAndChildrenLayersExecution });
|
|
@@ -8782,25 +9052,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
8782
9052
|
type: Injectable
|
|
8783
9053
|
}] });
|
|
8784
9054
|
|
|
9055
|
+
/**
|
|
9056
|
+
* Execution that selects a node and updates its layer along with its children.
|
|
9057
|
+
* It checks if the node is already selected, and if not, it marks it as selected
|
|
9058
|
+
* and updates the layers of the node and its children.
|
|
9059
|
+
*/
|
|
8785
9060
|
let SelectAndUpdateNodeLayerExecution = class SelectAndUpdateNodeLayerExecution {
|
|
8786
|
-
|
|
8787
|
-
|
|
8788
|
-
constructor(fDraggableDataContext, fMediator) {
|
|
8789
|
-
this.fDraggableDataContext = fDraggableDataContext;
|
|
8790
|
-
this.fMediator = fMediator;
|
|
8791
|
-
}
|
|
9061
|
+
_fDraggableDataContext = inject(FDraggableDataContext);
|
|
9062
|
+
_mediator = inject(FMediator);
|
|
8792
9063
|
handle(request) {
|
|
8793
9064
|
this.selectNodeIfNotSelected(request.fNode);
|
|
8794
|
-
this.
|
|
9065
|
+
this._mediator.execute(new UpdateItemAndChildrenLayersRequest(request.fNode, request.fNode.hostElement.parentElement));
|
|
8795
9066
|
}
|
|
8796
9067
|
selectNodeIfNotSelected(fNode) {
|
|
8797
|
-
if (!this.
|
|
8798
|
-
this.
|
|
9068
|
+
if (!this._fDraggableDataContext.selectedItems.includes(fNode) && !fNode.fSelectionDisabled) {
|
|
9069
|
+
this._fDraggableDataContext.selectedItems.push(fNode);
|
|
8799
9070
|
fNode.markAsSelected();
|
|
8800
|
-
this.
|
|
9071
|
+
this._fDraggableDataContext.isSelectedChanged = true;
|
|
8801
9072
|
}
|
|
8802
9073
|
}
|
|
8803
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SelectAndUpdateNodeLayerExecution, deps: [
|
|
9074
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SelectAndUpdateNodeLayerExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
8804
9075
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SelectAndUpdateNodeLayerExecution });
|
|
8805
9076
|
};
|
|
8806
9077
|
SelectAndUpdateNodeLayerExecution = __decorate([
|
|
@@ -8808,8 +9079,11 @@ SelectAndUpdateNodeLayerExecution = __decorate([
|
|
|
8808
9079
|
], SelectAndUpdateNodeLayerExecution);
|
|
8809
9080
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SelectAndUpdateNodeLayerExecution, decorators: [{
|
|
8810
9081
|
type: Injectable
|
|
8811
|
-
}]
|
|
9082
|
+
}] });
|
|
8812
9083
|
|
|
9084
|
+
/**
|
|
9085
|
+
* This module provides a collection of executions related to selection features in the FFlow domain.
|
|
9086
|
+
*/
|
|
8813
9087
|
const F_SELECTION_FEATURES = [
|
|
8814
9088
|
ClearSelectionExecution,
|
|
8815
9089
|
GetCanBeSelectedItemsExecution,
|
|
@@ -8819,11 +9093,15 @@ const F_SELECTION_FEATURES = [
|
|
|
8819
9093
|
SelectAndUpdateNodeLayerExecution
|
|
8820
9094
|
];
|
|
8821
9095
|
|
|
9096
|
+
/**
|
|
9097
|
+
* Execution that emits a selection change event when the selection changes.
|
|
9098
|
+
* It retrieves the current selection and emits it through the FSelectionChangeEvent.
|
|
9099
|
+
*/
|
|
8822
9100
|
let EmitSelectionChangeEventExecution = class EmitSelectionChangeEventExecution {
|
|
8823
|
-
|
|
8824
|
-
|
|
9101
|
+
_mediator = inject(FMediator);
|
|
9102
|
+
_store = inject(FComponentsStore);
|
|
8825
9103
|
get _fSelectionChange() {
|
|
8826
|
-
return this.
|
|
9104
|
+
return this._store.fDraggable.fSelectionChange;
|
|
8827
9105
|
}
|
|
8828
9106
|
_fDraggableDataContext = inject(FDraggableDataContext);
|
|
8829
9107
|
handle(request) {
|
|
@@ -8832,10 +9110,10 @@ let EmitSelectionChangeEventExecution = class EmitSelectionChangeEventExecution
|
|
|
8832
9110
|
}
|
|
8833
9111
|
this._emitSelectionChange(this._getSelection());
|
|
8834
9112
|
this._fDraggableDataContext.isSelectedChanged = false;
|
|
8835
|
-
this.
|
|
9113
|
+
this._mediator.execute(new NotifyTransformChangedRequest());
|
|
8836
9114
|
}
|
|
8837
9115
|
_getSelection() {
|
|
8838
|
-
return this.
|
|
9116
|
+
return this._mediator.execute(new GetCurrentSelectionRequest());
|
|
8839
9117
|
}
|
|
8840
9118
|
_emitSelectionChange(selection) {
|
|
8841
9119
|
this._fSelectionChange.emit(new FSelectionChangeEvent(selection.fNodeIds, selection.fGroupIds, selection.fConnectionIds));
|
|
@@ -8854,10 +9132,13 @@ class EndDragSequenceRequest {
|
|
|
8854
9132
|
static fToken = Symbol('EndDragSequenceRequest');
|
|
8855
9133
|
}
|
|
8856
9134
|
|
|
9135
|
+
/**
|
|
9136
|
+
* Execution that handles the end of a drag sequence.
|
|
9137
|
+
*/
|
|
8857
9138
|
let EndDragSequenceExecution = class EndDragSequenceExecution {
|
|
8858
|
-
|
|
9139
|
+
_store = inject(FComponentsStore);
|
|
8859
9140
|
get _hostElement() {
|
|
8860
|
-
return this.
|
|
9141
|
+
return this._store.fDraggable.hostElement;
|
|
8861
9142
|
}
|
|
8862
9143
|
_fDraggableDataContext = inject(FDraggableDataContext);
|
|
8863
9144
|
handle(request) {
|
|
@@ -8866,7 +9147,7 @@ let EndDragSequenceExecution = class EndDragSequenceExecution {
|
|
|
8866
9147
|
this._emitDragEnded();
|
|
8867
9148
|
}
|
|
8868
9149
|
_emitDragEnded() {
|
|
8869
|
-
this.
|
|
9150
|
+
this._store.fDraggable?.fDragEnded?.emit();
|
|
8870
9151
|
}
|
|
8871
9152
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: EndDragSequenceExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
8872
9153
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: EndDragSequenceExecution });
|
|
@@ -8886,10 +9167,15 @@ class OnPointerMoveRequest {
|
|
|
8886
9167
|
}
|
|
8887
9168
|
}
|
|
8888
9169
|
|
|
9170
|
+
/**
|
|
9171
|
+
* Execution that handles pointer move events during a drag operation.
|
|
9172
|
+
* It calculates the difference between the current pointer position and the position
|
|
9173
|
+
* when the drag started, and updates the draggable items accordingly.
|
|
9174
|
+
*/
|
|
8889
9175
|
let OnPointerMoveExecution = class OnPointerMoveExecution {
|
|
8890
|
-
|
|
9176
|
+
_store = inject(FComponentsStore);
|
|
8891
9177
|
get _hostElement() {
|
|
8892
|
-
return this.
|
|
9178
|
+
return this._store.fDraggable.hostElement;
|
|
8893
9179
|
}
|
|
8894
9180
|
_fDraggableDataContext = inject(FDraggableDataContext);
|
|
8895
9181
|
handle(request) {
|
|
@@ -8922,6 +9208,9 @@ class InitializeDragSequenceRequest {
|
|
|
8922
9208
|
static fToken = Symbol('InitializeDragSequenceRequest');
|
|
8923
9209
|
}
|
|
8924
9210
|
|
|
9211
|
+
/**
|
|
9212
|
+
* Execution that initializes the drag sequence by resetting the FDraggableDataContext.
|
|
9213
|
+
*/
|
|
8925
9214
|
let InitializeDragSequenceExecution = class InitializeDragSequenceExecution {
|
|
8926
9215
|
_fDraggableDataContext = inject(FDraggableDataContext);
|
|
8927
9216
|
handle(request) {
|
|
@@ -8941,10 +9230,13 @@ class IsDragStartedRequest {
|
|
|
8941
9230
|
static fToken = Symbol('IsDragStartedRequest');
|
|
8942
9231
|
}
|
|
8943
9232
|
|
|
9233
|
+
/**
|
|
9234
|
+
* Execution that checks if a drag operation has started.
|
|
9235
|
+
*/
|
|
8944
9236
|
let IsDragStartedExecution = class IsDragStartedExecution {
|
|
8945
|
-
|
|
9237
|
+
_store = inject(FComponentsStore);
|
|
8946
9238
|
handle(request) {
|
|
8947
|
-
return !!this.
|
|
9239
|
+
return !!this._store.fDraggable?.isDragStarted;
|
|
8948
9240
|
}
|
|
8949
9241
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: IsDragStartedExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
8950
9242
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: IsDragStartedExecution });
|
|
@@ -8964,22 +9256,25 @@ class StartDragSequenceRequest {
|
|
|
8964
9256
|
static fToken = Symbol('StartDragSequenceRequest');
|
|
8965
9257
|
}
|
|
8966
9258
|
|
|
9259
|
+
/**
|
|
9260
|
+
* Execution that starts the drag sequence by adding a dragging class to the host element
|
|
9261
|
+
*/
|
|
8967
9262
|
let StartDragSequenceExecution = class StartDragSequenceExecution {
|
|
8968
|
-
|
|
8969
|
-
|
|
9263
|
+
_mediator = inject(FMediator);
|
|
9264
|
+
_store = inject(FComponentsStore);
|
|
8970
9265
|
_fDraggableDataContext = inject(FDraggableDataContext);
|
|
8971
9266
|
get _hostElement() {
|
|
8972
|
-
return this.
|
|
9267
|
+
return this._store.fDraggable.hostElement;
|
|
8973
9268
|
}
|
|
8974
9269
|
handle(request) {
|
|
8975
9270
|
if (this._fDraggableDataContext.draggableItems.length > 0) {
|
|
8976
9271
|
this._hostElement.classList.add(F_CSS_CLASS.DRAG_AND_DROP.DRAGGING);
|
|
8977
|
-
this.
|
|
9272
|
+
this._mediator.execute(new EmitSelectionChangeEventRequest());
|
|
8978
9273
|
this._emitDragStarted();
|
|
8979
9274
|
}
|
|
8980
9275
|
}
|
|
8981
9276
|
_emitDragStarted() {
|
|
8982
|
-
this.
|
|
9277
|
+
this._store.fDraggable?.fDragStarted?.emit({
|
|
8983
9278
|
fEventType: this._fDraggableDataContext.draggableItems[0].fEventType,
|
|
8984
9279
|
fData: { ...this._fDraggableDataContext.draggableItems[0].fData }
|
|
8985
9280
|
});
|
|
@@ -8994,12 +9289,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
8994
9289
|
type: Injectable
|
|
8995
9290
|
}] });
|
|
8996
9291
|
|
|
9292
|
+
/**
|
|
9293
|
+
* Execution that prepares the drag sequence by invoking the prepareDragSequence method on each draggable item.
|
|
9294
|
+
*/
|
|
8997
9295
|
let PrepareDragSequenceExecution = class PrepareDragSequenceExecution {
|
|
8998
|
-
|
|
9296
|
+
_mediator = inject(FMediator);
|
|
8999
9297
|
_fDraggableDataContext = inject(FDraggableDataContext);
|
|
9000
9298
|
handle(request) {
|
|
9001
9299
|
this._callPrepareDragSequence();
|
|
9002
|
-
this.
|
|
9300
|
+
this._mediator.execute(new StartDragSequenceRequest());
|
|
9003
9301
|
}
|
|
9004
9302
|
_callPrepareDragSequence() {
|
|
9005
9303
|
this._fDraggableDataContext.draggableItems.forEach((item) => {
|
|
@@ -9020,10 +9318,13 @@ class RemoveDndFromStoreRequest {
|
|
|
9020
9318
|
static fToken = Symbol('RemoveDndFromStoreRequest');
|
|
9021
9319
|
}
|
|
9022
9320
|
|
|
9321
|
+
/**
|
|
9322
|
+
* Execution that removes the drag and drop directive from the FComponentsStore.
|
|
9323
|
+
*/
|
|
9023
9324
|
let RemoveDndFromStoreExecution = class RemoveDndFromStoreExecution {
|
|
9024
|
-
|
|
9325
|
+
_store = inject(FComponentsStore);
|
|
9025
9326
|
handle(request) {
|
|
9026
|
-
this.
|
|
9327
|
+
this._store.fDraggable = undefined;
|
|
9027
9328
|
}
|
|
9028
9329
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoveDndFromStoreExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
9029
9330
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoveDndFromStoreExecution });
|
|
@@ -9035,6 +9336,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
9035
9336
|
type: Injectable
|
|
9036
9337
|
}] });
|
|
9037
9338
|
|
|
9339
|
+
/**
|
|
9340
|
+
* Collection of all FDraggable feature executions.
|
|
9341
|
+
*/
|
|
9038
9342
|
const F_DRAGGABLE_FEATURES = [
|
|
9039
9343
|
AddDndToStoreExecution,
|
|
9040
9344
|
EmitSelectionChangeEventExecution,
|
|
@@ -9055,10 +9359,13 @@ class AddFlowToStoreRequest {
|
|
|
9055
9359
|
}
|
|
9056
9360
|
}
|
|
9057
9361
|
|
|
9362
|
+
/**
|
|
9363
|
+
* Execution that adds a Flow to the FComponentsStore.
|
|
9364
|
+
*/
|
|
9058
9365
|
let AddFlowToStoreExecution = class AddFlowToStoreExecution {
|
|
9059
|
-
|
|
9366
|
+
_store = inject(FComponentsStore);
|
|
9060
9367
|
handle(request) {
|
|
9061
|
-
this.
|
|
9368
|
+
this._store.fFlow = request.fComponent;
|
|
9062
9369
|
}
|
|
9063
9370
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AddFlowToStoreExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
9064
9371
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AddFlowToStoreExecution });
|
|
@@ -9074,10 +9381,13 @@ class GetFlowRequest {
|
|
|
9074
9381
|
static fToken = Symbol('GetFlowRequest');
|
|
9075
9382
|
}
|
|
9076
9383
|
|
|
9384
|
+
/**
|
|
9385
|
+
* Execution that retrieves the current Flow from the FComponentsStore.
|
|
9386
|
+
*/
|
|
9077
9387
|
let GetFlowExecution = class GetFlowExecution {
|
|
9078
|
-
|
|
9388
|
+
_store = inject(FComponentsStore);
|
|
9079
9389
|
handle(request) {
|
|
9080
|
-
const result = this.
|
|
9390
|
+
const result = this._store.fFlow;
|
|
9081
9391
|
if (!result) {
|
|
9082
9392
|
throw new Error(`Flow not found in store`);
|
|
9083
9393
|
}
|
|
@@ -9097,10 +9407,13 @@ class GetFlowHostElementRequest {
|
|
|
9097
9407
|
static fToken = Symbol('GetFlowHostElementRequest');
|
|
9098
9408
|
}
|
|
9099
9409
|
|
|
9410
|
+
/**
|
|
9411
|
+
* Execution that retrieves the Flow host element from the FComponentsStore.
|
|
9412
|
+
*/
|
|
9100
9413
|
let GetFlowHostElementExecution = class GetFlowHostElementExecution {
|
|
9101
|
-
|
|
9414
|
+
_store = inject(FComponentsStore);
|
|
9102
9415
|
handle() {
|
|
9103
|
-
return this.
|
|
9416
|
+
return this._store.flowHost;
|
|
9104
9417
|
}
|
|
9105
9418
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetFlowHostElementExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
9106
9419
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetFlowHostElementExecution });
|
|
@@ -9116,10 +9429,13 @@ class GetFlowStateConnectionsRequest {
|
|
|
9116
9429
|
static fToken = Symbol('GetFlowStateConnectionsRequest');
|
|
9117
9430
|
}
|
|
9118
9431
|
|
|
9432
|
+
/**
|
|
9433
|
+
* Execution that retrieves the current Flow state connections from the FComponentsStore.
|
|
9434
|
+
*/
|
|
9119
9435
|
let GetFlowStateConnectionsExecution = class GetFlowStateConnectionsExecution {
|
|
9120
|
-
|
|
9436
|
+
_store = inject(FComponentsStore);
|
|
9121
9437
|
handle(request) {
|
|
9122
|
-
return this.
|
|
9438
|
+
return this._store.fConnections.map(this._mapToConnectionState);
|
|
9123
9439
|
}
|
|
9124
9440
|
_mapToConnectionState(x) {
|
|
9125
9441
|
return {
|
|
@@ -9149,13 +9465,13 @@ class GetFlowStateNodesRequest {
|
|
|
9149
9465
|
}
|
|
9150
9466
|
}
|
|
9151
9467
|
|
|
9468
|
+
/**
|
|
9469
|
+
* Execution that retrieves the state of Flow nodes, including their position, size, inputs, outputs, and selection status.
|
|
9470
|
+
*/
|
|
9152
9471
|
let GetFlowStateNodesExecution = class GetFlowStateNodesExecution {
|
|
9153
|
-
|
|
9154
|
-
constructor(fComponentsStore) {
|
|
9155
|
-
this.fComponentsStore = fComponentsStore;
|
|
9156
|
-
}
|
|
9472
|
+
_store = inject(FComponentsStore);
|
|
9157
9473
|
handle(request) {
|
|
9158
|
-
return this.
|
|
9474
|
+
return this._store.fNodes.filter((x) => x instanceof request.type).map((x) => {
|
|
9159
9475
|
return {
|
|
9160
9476
|
id: x.fId(),
|
|
9161
9477
|
parent: x.fParentId,
|
|
@@ -9168,7 +9484,7 @@ let GetFlowStateNodesExecution = class GetFlowStateNodesExecution {
|
|
|
9168
9484
|
});
|
|
9169
9485
|
}
|
|
9170
9486
|
_getOutputs(hostElement) {
|
|
9171
|
-
return this.
|
|
9487
|
+
return this._store.fOutputs.filter((x) => hostElement.contains(x.hostElement)).map((x) => {
|
|
9172
9488
|
return {
|
|
9173
9489
|
id: x.fId,
|
|
9174
9490
|
fConnectableSide: x.fConnectableSide
|
|
@@ -9176,14 +9492,14 @@ let GetFlowStateNodesExecution = class GetFlowStateNodesExecution {
|
|
|
9176
9492
|
});
|
|
9177
9493
|
}
|
|
9178
9494
|
_getInputs(hostElement) {
|
|
9179
|
-
return this.
|
|
9495
|
+
return this._store.fInputs.filter((x) => hostElement.contains(x.hostElement)).map((x) => {
|
|
9180
9496
|
return {
|
|
9181
9497
|
id: x.fId,
|
|
9182
9498
|
fConnectableSide: x.fConnectableSide
|
|
9183
9499
|
};
|
|
9184
9500
|
});
|
|
9185
9501
|
}
|
|
9186
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetFlowStateNodesExecution, deps: [
|
|
9502
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetFlowStateNodesExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
9187
9503
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetFlowStateNodesExecution });
|
|
9188
9504
|
};
|
|
9189
9505
|
GetFlowStateNodesExecution = __decorate([
|
|
@@ -9191,22 +9507,25 @@ GetFlowStateNodesExecution = __decorate([
|
|
|
9191
9507
|
], GetFlowStateNodesExecution);
|
|
9192
9508
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetFlowStateNodesExecution, decorators: [{
|
|
9193
9509
|
type: Injectable
|
|
9194
|
-
}]
|
|
9510
|
+
}] });
|
|
9195
9511
|
|
|
9196
9512
|
class GetFlowStateRequest {
|
|
9197
9513
|
static fToken = Symbol('GetFlowStateRequest');
|
|
9198
9514
|
}
|
|
9199
9515
|
|
|
9516
|
+
/**
|
|
9517
|
+
* Execution that retrieves the current state of the Flow, including its position, scale, nodes, groups, and connections.
|
|
9518
|
+
*/
|
|
9200
9519
|
let GetFlowStateExecution = class GetFlowStateExecution {
|
|
9201
|
-
|
|
9202
|
-
|
|
9520
|
+
_mediator = inject(FMediator);
|
|
9521
|
+
_store = inject(FComponentsStore);
|
|
9203
9522
|
handle(payload) {
|
|
9204
9523
|
return {
|
|
9205
|
-
position: this._getCanvasPosition(this.
|
|
9206
|
-
scale: this.
|
|
9207
|
-
nodes: this.
|
|
9208
|
-
groups: this.
|
|
9209
|
-
connections: this.
|
|
9524
|
+
position: this._getCanvasPosition(this._store.fCanvas.transform),
|
|
9525
|
+
scale: this._store.fCanvas.transform.scale,
|
|
9526
|
+
nodes: this._mediator.execute(new GetFlowStateNodesRequest(FNodeDirective)),
|
|
9527
|
+
groups: this._mediator.execute(new GetFlowStateNodesRequest(FGroupDirective)),
|
|
9528
|
+
connections: this._mediator.execute(new GetFlowStateConnectionsRequest())
|
|
9210
9529
|
};
|
|
9211
9530
|
}
|
|
9212
9531
|
_getCanvasPosition(transform) {
|
|
@@ -9222,6 +9541,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
9222
9541
|
type: Injectable
|
|
9223
9542
|
}] });
|
|
9224
9543
|
|
|
9544
|
+
/**
|
|
9545
|
+
* Providers for retrieving the current Flow state, including nodes, groups, and connections.
|
|
9546
|
+
*/
|
|
9225
9547
|
const GET_FLOW_STATE_PROVIDERS = [
|
|
9226
9548
|
GetFlowStateExecution,
|
|
9227
9549
|
GetFlowStateNodesExecution,
|
|
@@ -9232,10 +9554,13 @@ class RemoveFlowFromStoreRequest {
|
|
|
9232
9554
|
static fToken = Symbol('RemoveFlowFromStoreRequest');
|
|
9233
9555
|
}
|
|
9234
9556
|
|
|
9557
|
+
/**
|
|
9558
|
+
* Execution that removes a Flow from the FComponentsStore.
|
|
9559
|
+
*/
|
|
9235
9560
|
let RemoveFlowFromStoreExecution = class RemoveFlowFromStoreExecution {
|
|
9236
|
-
|
|
9561
|
+
_store = inject(FComponentsStore);
|
|
9237
9562
|
handle(request) {
|
|
9238
|
-
this.
|
|
9563
|
+
this._store.fFlow = undefined;
|
|
9239
9564
|
}
|
|
9240
9565
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoveFlowFromStoreExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
9241
9566
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoveFlowFromStoreExecution });
|
|
@@ -9247,6 +9572,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
9247
9572
|
type: Injectable
|
|
9248
9573
|
}] });
|
|
9249
9574
|
|
|
9575
|
+
/**
|
|
9576
|
+
* Providers for managing the Flow in the FComponentsStore.
|
|
9577
|
+
* This includes adding, retrieving, and removing the Flow,
|
|
9578
|
+
* as well as getting the Flow host element and its state.
|
|
9579
|
+
*/
|
|
9250
9580
|
const F_FLOW_FEATURES = [
|
|
9251
9581
|
AddFlowToStoreExecution,
|
|
9252
9582
|
GetFlowExecution,
|
|
@@ -9263,10 +9593,13 @@ class AddLineAlignmentToStoreRequest {
|
|
|
9263
9593
|
}
|
|
9264
9594
|
}
|
|
9265
9595
|
|
|
9596
|
+
/**
|
|
9597
|
+
* Execution that adds a line alignment to the FComponentsStore.
|
|
9598
|
+
*/
|
|
9266
9599
|
let AddLineAlignmentToStoreExecution = class AddLineAlignmentToStoreExecution {
|
|
9267
|
-
|
|
9600
|
+
_store = inject(FComponentsStore);
|
|
9268
9601
|
handle(request) {
|
|
9269
|
-
this.
|
|
9602
|
+
this._store.fLineAlignment = request.fComponent;
|
|
9270
9603
|
}
|
|
9271
9604
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AddLineAlignmentToStoreExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
9272
9605
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AddLineAlignmentToStoreExecution });
|
|
@@ -9282,10 +9615,13 @@ class RemoveLineAlignmentFromStoreRequest {
|
|
|
9282
9615
|
static fToken = Symbol('RemoveLineAlignmentFromStoreRequest');
|
|
9283
9616
|
}
|
|
9284
9617
|
|
|
9618
|
+
/**
|
|
9619
|
+
* Execution that removes a line alignment from the FComponentsStore.
|
|
9620
|
+
*/
|
|
9285
9621
|
let RemoveLineAlignmentFromStoreExecution = class RemoveLineAlignmentFromStoreExecution {
|
|
9286
|
-
|
|
9622
|
+
_store = inject(FComponentsStore);
|
|
9287
9623
|
handle(request) {
|
|
9288
|
-
this.
|
|
9624
|
+
this._store.fLineAlignment = undefined;
|
|
9289
9625
|
}
|
|
9290
9626
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoveLineAlignmentFromStoreExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
9291
9627
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoveLineAlignmentFromStoreExecution });
|
|
@@ -9297,6 +9633,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
9297
9633
|
type: Injectable
|
|
9298
9634
|
}] });
|
|
9299
9635
|
|
|
9636
|
+
/**
|
|
9637
|
+
* Collection of all FLineAlignment feature executions.
|
|
9638
|
+
* These executions handle the addition and removal of line alignments
|
|
9639
|
+
* in the FComponentsStore.
|
|
9640
|
+
*/
|
|
9300
9641
|
const F_LINE_ALIGNMENT_FEATURES = [
|
|
9301
9642
|
AddLineAlignmentToStoreExecution,
|
|
9302
9643
|
RemoveLineAlignmentFromStoreExecution
|
|
@@ -9310,10 +9651,13 @@ class AddNodeToStoreRequest {
|
|
|
9310
9651
|
}
|
|
9311
9652
|
}
|
|
9312
9653
|
|
|
9654
|
+
/**
|
|
9655
|
+
* Execution that adds a Node to the FComponentsStore.
|
|
9656
|
+
*/
|
|
9313
9657
|
let AddNodeToStoreExecution = class AddNodeToStoreExecution {
|
|
9314
|
-
|
|
9658
|
+
_store = inject(FComponentsStore);
|
|
9315
9659
|
handle(request) {
|
|
9316
|
-
this.
|
|
9660
|
+
this._store.addComponent(this._store.fNodes, request.fComponent);
|
|
9317
9661
|
}
|
|
9318
9662
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AddNodeToStoreExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
9319
9663
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AddNodeToStoreExecution });
|
|
@@ -9333,18 +9677,21 @@ class CalculateInputConnectionsRequest {
|
|
|
9333
9677
|
}
|
|
9334
9678
|
}
|
|
9335
9679
|
|
|
9680
|
+
/**
|
|
9681
|
+
* Execution that calculates input connections for a given FNode.
|
|
9682
|
+
*/
|
|
9336
9683
|
let CalculateInputConnectionsExecution = class CalculateInputConnectionsExecution {
|
|
9337
|
-
|
|
9684
|
+
_store = inject(FComponentsStore);
|
|
9338
9685
|
handle(request) {
|
|
9339
9686
|
return this._calculateConnections(new Set(this._calculateConnectors(request.fNode)));
|
|
9340
9687
|
}
|
|
9341
9688
|
_calculateConnectors(fNode) {
|
|
9342
|
-
return this.
|
|
9689
|
+
return this._store.fInputs
|
|
9343
9690
|
.filter((x) => fNode.isContains(x.hostElement))
|
|
9344
9691
|
.map((x) => x.fId);
|
|
9345
9692
|
}
|
|
9346
9693
|
_calculateConnections(ids) {
|
|
9347
|
-
return this.
|
|
9694
|
+
return this._store.fConnections
|
|
9348
9695
|
.filter((x) => ids.has(x.fInputId));
|
|
9349
9696
|
}
|
|
9350
9697
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CalculateInputConnectionsExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -9361,13 +9708,17 @@ class CalculateNodesBoundingBoxRequest {
|
|
|
9361
9708
|
static fToken = Symbol('CalculateNodesBoundingBoxRequest');
|
|
9362
9709
|
}
|
|
9363
9710
|
|
|
9711
|
+
/**
|
|
9712
|
+
* Execution that calculates the bounding box of all nodes in the FComponentsStore.
|
|
9713
|
+
* It retrieves the rectangles of each node's host element and computes their union.
|
|
9714
|
+
*/
|
|
9364
9715
|
let CalculateNodesBoundingBoxExecution = class CalculateNodesBoundingBoxExecution {
|
|
9365
|
-
|
|
9716
|
+
_store = inject(FComponentsStore);
|
|
9366
9717
|
handle(request) {
|
|
9367
9718
|
return RectExtensions.union(this._getNodesRects());
|
|
9368
9719
|
}
|
|
9369
9720
|
_getNodesRects() {
|
|
9370
|
-
return this.
|
|
9721
|
+
return this._store.fNodes.map((x) => {
|
|
9371
9722
|
return this._getElementRect(x.hostElement);
|
|
9372
9723
|
});
|
|
9373
9724
|
}
|
|
@@ -9392,10 +9743,15 @@ class CalculateNodesBoundingBoxNormalizedPositionRequest {
|
|
|
9392
9743
|
}
|
|
9393
9744
|
}
|
|
9394
9745
|
|
|
9746
|
+
/**
|
|
9747
|
+
* Execution that calculates the bounding box of all nodes in the FComponentsStore
|
|
9748
|
+
* and returns their normalized positions.
|
|
9749
|
+
* It retrieves the rectangles of each node's host element and computes their union.
|
|
9750
|
+
*/
|
|
9395
9751
|
let CalculateNodesBoundingBoxNormalizedPositionExecution = class CalculateNodesBoundingBoxNormalizedPositionExecution {
|
|
9396
|
-
|
|
9752
|
+
_store = inject(FComponentsStore);
|
|
9397
9753
|
handle(request) {
|
|
9398
|
-
return RectExtensions.union(this._getNodesRects(request.fNodes || this.
|
|
9754
|
+
return RectExtensions.union(this._getNodesRects(request.fNodes || this._store.fNodes));
|
|
9399
9755
|
}
|
|
9400
9756
|
_getNodesRects(fNodes) {
|
|
9401
9757
|
return fNodes.map((x) => {
|
|
@@ -9423,18 +9779,21 @@ class CalculateOutputConnectionsRequest {
|
|
|
9423
9779
|
}
|
|
9424
9780
|
}
|
|
9425
9781
|
|
|
9782
|
+
/**
|
|
9783
|
+
* Execution that calculates output connections for a given FNode.
|
|
9784
|
+
*/
|
|
9426
9785
|
let CalculateOutputConnectionsExecution = class CalculateOutputConnectionsExecution {
|
|
9427
|
-
|
|
9786
|
+
_store = inject(FComponentsStore);
|
|
9428
9787
|
handle(request) {
|
|
9429
9788
|
return this._calculateConnections(new Set(this._calculateConnectors(request.fNode)));
|
|
9430
9789
|
}
|
|
9431
9790
|
_calculateConnectors(fNode) {
|
|
9432
|
-
return this.
|
|
9791
|
+
return this._store.fOutputs
|
|
9433
9792
|
.filter((x) => fNode.isContains(x.hostElement))
|
|
9434
9793
|
.map((x) => x.fId);
|
|
9435
9794
|
}
|
|
9436
9795
|
_calculateConnections(ids) {
|
|
9437
|
-
return this.
|
|
9796
|
+
return this._store.fConnections
|
|
9438
9797
|
.filter((x) => ids.has(x.fOutputId));
|
|
9439
9798
|
}
|
|
9440
9799
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CalculateOutputConnectionsExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -9457,6 +9816,10 @@ class GetNodePaddingRequest {
|
|
|
9457
9816
|
}
|
|
9458
9817
|
}
|
|
9459
9818
|
|
|
9819
|
+
/**
|
|
9820
|
+
* Execution that retrieves the padding data of a Node.
|
|
9821
|
+
* If the Node does not include padding, it returns [0, 0, 0, 0].
|
|
9822
|
+
*/
|
|
9460
9823
|
let GetNodePaddingExecution = class GetNodePaddingExecution {
|
|
9461
9824
|
_browser = inject(BrowserService);
|
|
9462
9825
|
handle(request) {
|
|
@@ -9485,10 +9848,13 @@ class GetNodesRequest {
|
|
|
9485
9848
|
static fToken = Symbol('GetNodesRequest');
|
|
9486
9849
|
}
|
|
9487
9850
|
|
|
9851
|
+
/**
|
|
9852
|
+
* Execution that retrieves all nodes from the FComponentsStore.
|
|
9853
|
+
*/
|
|
9488
9854
|
let GetNodesExecution = class GetNodesExecution {
|
|
9489
|
-
|
|
9855
|
+
_store = inject(FComponentsStore);
|
|
9490
9856
|
handle(request) {
|
|
9491
|
-
return this.
|
|
9857
|
+
return this._store.fNodes;
|
|
9492
9858
|
}
|
|
9493
9859
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetNodesExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
9494
9860
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetNodesExecution });
|
|
@@ -9508,8 +9874,11 @@ class GetParentNodesRequest {
|
|
|
9508
9874
|
}
|
|
9509
9875
|
}
|
|
9510
9876
|
|
|
9877
|
+
/**
|
|
9878
|
+
* Execution that retrieves all parent nodes of a given node from the FComponentsStore.
|
|
9879
|
+
*/
|
|
9511
9880
|
let GetParentNodesExecution = class GetParentNodesExecution {
|
|
9512
|
-
|
|
9881
|
+
_store = inject(FComponentsStore);
|
|
9513
9882
|
handle(request) {
|
|
9514
9883
|
return this._getParentNodes(request.fNode, new Set(), []);
|
|
9515
9884
|
}
|
|
@@ -9518,7 +9887,7 @@ let GetParentNodesExecution = class GetParentNodesExecution {
|
|
|
9518
9887
|
throw new Error('Circular reference detected in the node hierarchy. Node id: ' + fNode.fId());
|
|
9519
9888
|
}
|
|
9520
9889
|
visited.add(fNode.fId());
|
|
9521
|
-
const parent = this.
|
|
9890
|
+
const parent = this._store.fNodes.find((x) => x.fId() === fNode.fParentId);
|
|
9522
9891
|
if (!parent) {
|
|
9523
9892
|
return result;
|
|
9524
9893
|
}
|
|
@@ -9545,20 +9914,41 @@ class UpdateNodeWhenStateOrSizeChangedRequest {
|
|
|
9545
9914
|
}
|
|
9546
9915
|
}
|
|
9547
9916
|
|
|
9917
|
+
/**
|
|
9918
|
+
* Execution that updates a node's connectors when its state or size changes.
|
|
9919
|
+
*/
|
|
9548
9920
|
let UpdateNodeWhenStateOrSizeChangedExecution = class UpdateNodeWhenStateOrSizeChangedExecution {
|
|
9549
|
-
|
|
9921
|
+
_mediator = inject(FMediator);
|
|
9922
|
+
/**
|
|
9923
|
+
* Handles the request to update the node's connectors based on state or size changes.
|
|
9924
|
+
* It listens for resize events and recalculates the connectable sides of the connectors.
|
|
9925
|
+
* @param request
|
|
9926
|
+
*/
|
|
9550
9927
|
handle(request) {
|
|
9551
9928
|
const { hostElement, connectors, stateChanges } = request.fComponent;
|
|
9552
9929
|
new FChannelHub(new FResizeChannel(hostElement), stateChanges).pipe(notifyOnStart(), debounceTime(10)).listen(request.destroyRef, () => {
|
|
9553
9930
|
this._calculateConnectorsConnectableSide(connectors, hostElement);
|
|
9554
|
-
this.
|
|
9931
|
+
this._mediator.execute(new NotifyDataChangedRequest());
|
|
9555
9932
|
});
|
|
9556
9933
|
}
|
|
9934
|
+
/**
|
|
9935
|
+
* Calculates the connectable side for each connector based on its position relative to the node host.
|
|
9936
|
+
* @param fConnectors
|
|
9937
|
+
* @param fNodeHost
|
|
9938
|
+
* @private
|
|
9939
|
+
*/
|
|
9557
9940
|
_calculateConnectorsConnectableSide(fConnectors, fNodeHost) {
|
|
9558
9941
|
fConnectors.forEach((x) => {
|
|
9559
9942
|
x.fConnectableSide = this._calculateConnectorConnectableSide(x, fNodeHost);
|
|
9560
9943
|
});
|
|
9561
9944
|
}
|
|
9945
|
+
/**
|
|
9946
|
+
* Calculates the connectable side of a connector based on its user-defined side or its position relative to the node host.
|
|
9947
|
+
* @param fConnector
|
|
9948
|
+
* @param fNodeHost
|
|
9949
|
+
* @returns {EFConnectableSide}
|
|
9950
|
+
* @private
|
|
9951
|
+
*/
|
|
9562
9952
|
_calculateConnectorConnectableSide(fConnector, fNodeHost) {
|
|
9563
9953
|
let result;
|
|
9564
9954
|
if (fConnector.userFConnectableSide === EFConnectableSide.AUTO) {
|
|
@@ -9569,6 +9959,12 @@ let UpdateNodeWhenStateOrSizeChangedExecution = class UpdateNodeWhenStateOrSizeC
|
|
|
9569
9959
|
}
|
|
9570
9960
|
return result;
|
|
9571
9961
|
}
|
|
9962
|
+
/**
|
|
9963
|
+
* Determines the side of the connector relative to the node host based on the minimum distance.
|
|
9964
|
+
* @param fConnectorHost
|
|
9965
|
+
* @param fNodeHost
|
|
9966
|
+
* @private
|
|
9967
|
+
*/
|
|
9572
9968
|
_getSideByDelta(fConnectorHost, fNodeHost) {
|
|
9573
9969
|
let result;
|
|
9574
9970
|
const childRect = RectExtensions.fromElement(fConnectorHost);
|
|
@@ -9610,10 +10006,13 @@ class RemoveNodeFromStoreRequest {
|
|
|
9610
10006
|
}
|
|
9611
10007
|
}
|
|
9612
10008
|
|
|
10009
|
+
/**
|
|
10010
|
+
* Execution that removes a node from the FComponentsStore.
|
|
10011
|
+
*/
|
|
9613
10012
|
let RemoveNodeFromStoreExecution = class RemoveNodeFromStoreExecution {
|
|
9614
|
-
|
|
10013
|
+
_store = inject(FComponentsStore);
|
|
9615
10014
|
handle(request) {
|
|
9616
|
-
this.
|
|
10015
|
+
this._store.removeComponent(this._store.fNodes, request.fComponent);
|
|
9617
10016
|
}
|
|
9618
10017
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoveNodeFromStoreExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
9619
10018
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RemoveNodeFromStoreExecution });
|
|
@@ -9625,6 +10024,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
9625
10024
|
type: Injectable
|
|
9626
10025
|
}] });
|
|
9627
10026
|
|
|
10027
|
+
/**
|
|
10028
|
+
* This file exports all the node-related executions that can be used in the F-Flow domain.
|
|
10029
|
+
*/
|
|
9628
10030
|
const F_NODE_FEATURES = [
|
|
9629
10031
|
AddNodeToStoreExecution,
|
|
9630
10032
|
CalculateInputConnectionsExecution,
|
|
@@ -9648,10 +10050,13 @@ class AddZoomToStoreRequest {
|
|
|
9648
10050
|
|
|
9649
10051
|
const F_ZOOM_TAG = 'F_ZOOM';
|
|
9650
10052
|
|
|
10053
|
+
/**
|
|
10054
|
+
* Execution that adds a Zoom to the FComponentsStore.
|
|
10055
|
+
*/
|
|
9651
10056
|
let AddZoomToStoreExecution = class AddZoomToStoreExecution {
|
|
9652
|
-
|
|
10057
|
+
_store = inject(FComponentsStore);
|
|
9653
10058
|
handle(request) {
|
|
9654
|
-
this.
|
|
10059
|
+
this._store.fComponents = {
|
|
9655
10060
|
[F_ZOOM_TAG]: request.fComponent
|
|
9656
10061
|
};
|
|
9657
10062
|
}
|
|
@@ -9669,10 +10074,13 @@ class RemoveZoomFromStoreRequest {
|
|
|
9669
10074
|
static fToken = Symbol('RemoveZoomFromStoreRequest');
|
|
9670
10075
|
}
|
|
9671
10076
|
|
|
10077
|
+
/**
|
|
10078
|
+
* Execution that removes a Zoom from the FComponentsStore.
|
|
10079
|
+
*/
|
|
9672
10080
|
let RemoveZoomFromStoreExecution = class RemoveZoomFromStoreExecution {
|
|
9673
|
-
|
|
10081
|
+
_store = inject(FComponentsStore);
|
|
9674
10082
|
handle(request) {
|
|
9675
|
-
this.
|
|
10083
|
+
this._store.fComponents = {
|
|
9676
10084
|
[F_ZOOM_TAG]: undefined
|
|
9677
10085
|
};
|
|
9678
10086
|
}
|
|
@@ -9690,10 +10098,13 @@ class ResetZoomRequest {
|
|
|
9690
10098
|
static fToken = Symbol('ResetZoomRequest');
|
|
9691
10099
|
}
|
|
9692
10100
|
|
|
10101
|
+
/**
|
|
10102
|
+
* Execution that resets the zoom level of the FCanvas.
|
|
10103
|
+
*/
|
|
9693
10104
|
let ResetZoomExecution = class ResetZoomExecution {
|
|
9694
|
-
|
|
10105
|
+
_store = inject(FComponentsStore);
|
|
9695
10106
|
get _fCanvas() {
|
|
9696
|
-
return this.
|
|
10107
|
+
return this._store.fCanvas;
|
|
9697
10108
|
}
|
|
9698
10109
|
handle(request) {
|
|
9699
10110
|
this._fCanvas.resetScale();
|
|
@@ -9724,20 +10135,24 @@ class SetZoomRequest {
|
|
|
9724
10135
|
}
|
|
9725
10136
|
}
|
|
9726
10137
|
|
|
10138
|
+
/**
|
|
10139
|
+
* Execution that sets the zoom level of the FCanvas based on the provided request.
|
|
10140
|
+
* It adjusts the zoom level by a specified step and direction, ensuring it stays within defined limits.
|
|
10141
|
+
*/
|
|
9727
10142
|
let SetZoomExecution = class SetZoomExecution {
|
|
9728
|
-
|
|
9729
|
-
|
|
10143
|
+
_mediator = inject(FMediator);
|
|
10144
|
+
_store = inject(FComponentsStore);
|
|
9730
10145
|
get _fHost() {
|
|
9731
|
-
return this.
|
|
10146
|
+
return this._store.fFlow?.hostElement;
|
|
9732
10147
|
}
|
|
9733
10148
|
get _fCanvas() {
|
|
9734
|
-
return this.
|
|
10149
|
+
return this._store.fCanvas;
|
|
9735
10150
|
}
|
|
9736
10151
|
get _fZoomComponent() {
|
|
9737
|
-
return this.
|
|
10152
|
+
return this._store.fComponents[F_ZOOM_TAG];
|
|
9738
10153
|
}
|
|
9739
10154
|
get _isDragStarted() {
|
|
9740
|
-
return this.
|
|
10155
|
+
return this._mediator.execute(new IsDragStartedRequest());
|
|
9741
10156
|
}
|
|
9742
10157
|
handle(request) {
|
|
9743
10158
|
if (this._isDragStarted || !this._fZoomComponent) {
|
|
@@ -9764,6 +10179,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
9764
10179
|
type: Injectable
|
|
9765
10180
|
}] });
|
|
9766
10181
|
|
|
10182
|
+
/**
|
|
10183
|
+
* Collection of all FZoom feature executions.
|
|
10184
|
+
* These executions handle the addition, removal, and resetting of zoom levels
|
|
10185
|
+
* in the FComponentsStore.
|
|
10186
|
+
*/
|
|
9767
10187
|
const F_ZOOM_FEATURES = [
|
|
9768
10188
|
AddZoomToStoreExecution,
|
|
9769
10189
|
RemoveZoomFromStoreExecution,
|
|
@@ -9775,12 +10195,17 @@ class SortNodeLayersRequest {
|
|
|
9775
10195
|
static fToken = Symbol('SortNodeLayersRequest');
|
|
9776
10196
|
}
|
|
9777
10197
|
|
|
10198
|
+
/**
|
|
10199
|
+
* Execution that sorts node layers by their parent nodes in the FCanvas.
|
|
10200
|
+
* It retrieves all groups, sorts their children nodes based on their current order,
|
|
10201
|
+
* and moves them to maintain the correct hierarchy.
|
|
10202
|
+
*/
|
|
9778
10203
|
let SortNodeLayersExecution = class SortNodeLayersExecution {
|
|
9779
|
-
|
|
9780
|
-
|
|
9781
|
-
|
|
10204
|
+
_store = inject(FComponentsStore);
|
|
10205
|
+
_mediator = inject(FMediator);
|
|
10206
|
+
_browser = inject(BrowserService);
|
|
9782
10207
|
get _fCanvas() {
|
|
9783
|
-
return this.
|
|
10208
|
+
return this._store.fCanvas;
|
|
9784
10209
|
}
|
|
9785
10210
|
get _fGroupsContainer() {
|
|
9786
10211
|
return this._fCanvas.fGroupsContainer().nativeElement;
|
|
@@ -9797,7 +10222,7 @@ let SortNodeLayersExecution = class SortNodeLayersExecution {
|
|
|
9797
10222
|
});
|
|
9798
10223
|
}
|
|
9799
10224
|
_getGroups() {
|
|
9800
|
-
return this.
|
|
10225
|
+
return this._store.fNodes
|
|
9801
10226
|
.filter((x) => this._fGroupsContainer.contains(x.hostElement));
|
|
9802
10227
|
}
|
|
9803
10228
|
_getSortedChildrenNodes(parent) {
|
|
@@ -9806,11 +10231,11 @@ let SortNodeLayersExecution = class SortNodeLayersExecution {
|
|
|
9806
10231
|
.sort((a, b) => allElements.indexOf(a) - allElements.indexOf(b));
|
|
9807
10232
|
}
|
|
9808
10233
|
_getChildrenNodes(fId) {
|
|
9809
|
-
return this.
|
|
10234
|
+
return this._mediator.execute(new GetDeepChildrenNodesAndGroupsRequest(fId))
|
|
9810
10235
|
.filter((x) => this._fNodesContainer.contains(x.hostElement)).map((x) => x.hostElement);
|
|
9811
10236
|
}
|
|
9812
10237
|
_moveChildrenNodes(sortedChildrenGroups) {
|
|
9813
|
-
const fragment = this.
|
|
10238
|
+
const fragment = this._browser.document.createDocumentFragment();
|
|
9814
10239
|
sortedChildrenGroups.forEach((childGroup) => {
|
|
9815
10240
|
fragment.appendChild(childGroup); // Append automatically removes the element from its current position
|
|
9816
10241
|
});
|
|
@@ -9835,10 +10260,15 @@ class SortItemsByParentRequest {
|
|
|
9835
10260
|
}
|
|
9836
10261
|
}
|
|
9837
10262
|
|
|
10263
|
+
/**
|
|
10264
|
+
* Execution that sorts items by their parent nodes in the FItemsContainer.
|
|
10265
|
+
* It retrieves all items within the container, sorts their children based on their current order,
|
|
10266
|
+
* and moves them to maintain the correct hierarchy.
|
|
10267
|
+
*/
|
|
9838
10268
|
let SortItemsByParentExecution = class SortItemsByParentExecution {
|
|
9839
|
-
|
|
9840
|
-
|
|
9841
|
-
|
|
10269
|
+
_store = inject(FComponentsStore);
|
|
10270
|
+
_mediator = inject(FMediator);
|
|
10271
|
+
_browser = inject(BrowserService);
|
|
9842
10272
|
_fItemsContainer;
|
|
9843
10273
|
get _fItemElements() {
|
|
9844
10274
|
return Array.from(this._fItemsContainer.children);
|
|
@@ -9850,7 +10280,7 @@ let SortItemsByParentExecution = class SortItemsByParentExecution {
|
|
|
9850
10280
|
});
|
|
9851
10281
|
}
|
|
9852
10282
|
_getItemsOfContainer() {
|
|
9853
|
-
return this.
|
|
10283
|
+
return this._store.fNodes
|
|
9854
10284
|
.filter((x) => this._fItemsContainer.contains(x.hostElement));
|
|
9855
10285
|
}
|
|
9856
10286
|
_getSortedChildrenItems(fItem) {
|
|
@@ -9860,12 +10290,12 @@ let SortItemsByParentExecution = class SortItemsByParentExecution {
|
|
|
9860
10290
|
.sort((a, b) => this._fItemElements.indexOf(a) - this._fItemElements.indexOf(b));
|
|
9861
10291
|
}
|
|
9862
10292
|
_getChildrenItems(fId) {
|
|
9863
|
-
return this.
|
|
10293
|
+
return this._mediator.execute(new GetDeepChildrenNodesAndGroupsRequest(fId))
|
|
9864
10294
|
.filter((x) => this._fItemsContainer.contains(x.hostElement)).map((x) => x.hostElement);
|
|
9865
10295
|
}
|
|
9866
10296
|
_moveChildrenItems(sortedChildrenItems, parent) {
|
|
9867
10297
|
let nextSibling = parent.hostElement.nextElementSibling;
|
|
9868
|
-
const fragment = this.
|
|
10298
|
+
const fragment = this._browser.document.createDocumentFragment();
|
|
9869
10299
|
sortedChildrenItems.forEach((child) => {
|
|
9870
10300
|
fragment.appendChild(child); // Append automatically removes the element from its current position
|
|
9871
10301
|
});
|
|
@@ -9885,19 +10315,26 @@ class SortItemLayersRequest {
|
|
|
9885
10315
|
static fToken = Symbol('SortItemLayersRequest');
|
|
9886
10316
|
}
|
|
9887
10317
|
|
|
10318
|
+
/**
|
|
10319
|
+
* Execution that sorts item layers in the FCanvas by their parent nodes.
|
|
10320
|
+
* This execution is registered to handle SortItemLayersRequest and
|
|
10321
|
+
* ensures that items are sorted correctly within their parent nodes.
|
|
10322
|
+
* It first sorts items by their parent nodes in the groups container,
|
|
10323
|
+
* then sorts the node layers, and finally sorts items by their parent nodes in the nodes container.
|
|
10324
|
+
*/
|
|
9888
10325
|
let SortItemLayersExecution = class SortItemLayersExecution {
|
|
9889
|
-
|
|
9890
|
-
|
|
10326
|
+
_store = inject(FComponentsStore);
|
|
10327
|
+
_mediator = inject(FMediator);
|
|
9891
10328
|
get _fCanvas() {
|
|
9892
|
-
return this.
|
|
10329
|
+
return this._store.fCanvas;
|
|
9893
10330
|
}
|
|
9894
10331
|
handle(request) {
|
|
9895
|
-
if (!this.
|
|
10332
|
+
if (!this._store.fCanvas) {
|
|
9896
10333
|
return;
|
|
9897
10334
|
}
|
|
9898
|
-
this.
|
|
9899
|
-
this.
|
|
9900
|
-
this.
|
|
10335
|
+
this._mediator.execute(new SortItemsByParentRequest(this._fCanvas.fGroupsContainer().nativeElement));
|
|
10336
|
+
this._mediator.execute(new SortNodeLayersRequest());
|
|
10337
|
+
this._mediator.execute(new SortItemsByParentRequest(this._fCanvas.fNodesContainer().nativeElement));
|
|
9901
10338
|
}
|
|
9902
10339
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SortItemLayersExecution, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
9903
10340
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SortItemLayersExecution });
|
|
@@ -9952,6 +10389,12 @@ function LogExecutionTime(label) {
|
|
|
9952
10389
|
};
|
|
9953
10390
|
}
|
|
9954
10391
|
|
|
10392
|
+
/**
|
|
10393
|
+
* This module provides a collection of common providers for the FFlow domain.
|
|
10394
|
+
* It includes features related to canvas, connections, background, connectors,
|
|
10395
|
+
* draggable elements, flow, line alignment, nodes, selection, zoom,
|
|
10396
|
+
* and various utility executions.
|
|
10397
|
+
*/
|
|
9955
10398
|
const COMMON_PROVIDERS = [
|
|
9956
10399
|
...F_CANVAS_FEATURES,
|
|
9957
10400
|
...F_CONNECTION_FEATURES,
|
|
@@ -10237,8 +10680,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
10237
10680
|
type: Directive
|
|
10238
10681
|
}] });
|
|
10239
10682
|
|
|
10683
|
+
/**
|
|
10684
|
+
* Component representing a canvas in the F-Flow framework.
|
|
10685
|
+
* It handles the rendering of nodes, connections, and groups,
|
|
10686
|
+
* as well as user interactions such as zooming and panning.
|
|
10687
|
+
* It extends the FCanvasBase class and implements OnInit and OnDestroy lifecycle hooks.
|
|
10688
|
+
* It provides methods to manipulate the canvas, such as centering nodes or groups,
|
|
10689
|
+
* fitting the canvas to the screen, and resetting the scale.
|
|
10690
|
+
* It also emits events when the canvas changes, allowing other components to react to these changes.
|
|
10691
|
+
*/
|
|
10240
10692
|
class FCanvasComponent extends FCanvasBase {
|
|
10241
|
-
|
|
10693
|
+
_mediator = inject(FMediator);
|
|
10242
10694
|
_elementReference = inject(ElementRef);
|
|
10243
10695
|
_injector = inject(Injector);
|
|
10244
10696
|
_flowId;
|
|
@@ -10257,41 +10709,69 @@ class FCanvasComponent extends FCanvasBase {
|
|
|
10257
10709
|
return this._flowId;
|
|
10258
10710
|
}
|
|
10259
10711
|
ngOnInit() {
|
|
10260
|
-
this._flowId = this.
|
|
10261
|
-
this.
|
|
10712
|
+
this._flowId = this._mediator.execute(new GetFlowRequest()).fId();
|
|
10713
|
+
this._mediator.execute(new AddCanvasToStoreRequest(this));
|
|
10262
10714
|
this._positionChange();
|
|
10263
10715
|
this._scaleChange();
|
|
10264
10716
|
super.subscribeOnCanvasChange();
|
|
10265
10717
|
}
|
|
10266
10718
|
_positionChange() {
|
|
10267
10719
|
effect(() => {
|
|
10268
|
-
this.
|
|
10720
|
+
this._mediator.execute(new InputCanvasPositionRequest(this.transform, this.position()));
|
|
10269
10721
|
}, { injector: this._injector });
|
|
10270
10722
|
}
|
|
10271
10723
|
_scaleChange() {
|
|
10272
10724
|
effect(() => {
|
|
10273
|
-
this.
|
|
10725
|
+
this._mediator.execute(new InputCanvasScaleRequest(this.transform, this.scale()));
|
|
10274
10726
|
}, { injector: this._injector });
|
|
10275
10727
|
}
|
|
10728
|
+
/**
|
|
10729
|
+
* Redraws the canvas by applying the current transformation.
|
|
10730
|
+
*/
|
|
10276
10731
|
redraw() {
|
|
10277
|
-
this.
|
|
10732
|
+
this._mediator.execute(new SetBackgroundTransformRequest(this.transform));
|
|
10278
10733
|
this.hostElement.setAttribute("style", `transform: ${TransformModelExtensions.toString(this.transform)}`);
|
|
10279
|
-
this.
|
|
10734
|
+
this._mediator.execute(new NotifyTransformChangedRequest());
|
|
10280
10735
|
}
|
|
10736
|
+
/**
|
|
10737
|
+
* Redraws the canvas with an animation effect.
|
|
10738
|
+
* This method applies a CSS transition to the canvas element,
|
|
10739
|
+
* allowing for a smooth visual update of the canvas's transformation.
|
|
10740
|
+
*/
|
|
10281
10741
|
redrawWithAnimation() {
|
|
10282
|
-
this.
|
|
10742
|
+
this._mediator.execute(new SetBackgroundTransformRequest(this.transform));
|
|
10283
10743
|
this.hostElement.setAttribute("style", `transition: transform ${isMobile() ? 80 : 150}ms ease-in-out; transform: ${TransformModelExtensions.toString(this.transform)}`);
|
|
10284
10744
|
transitionEnd(this.hostElement, () => this.redraw());
|
|
10285
10745
|
}
|
|
10286
|
-
|
|
10287
|
-
|
|
10746
|
+
/**
|
|
10747
|
+
* Centers the specified group or node on the canvas.
|
|
10748
|
+
* @param groupOrNodeId - The ID of the group or node to center.
|
|
10749
|
+
* @param animated - If true, the centering will be animated; otherwise, it will be instantaneous.
|
|
10750
|
+
*/
|
|
10751
|
+
centerGroupOrNode(groupOrNodeId, animated = true) {
|
|
10752
|
+
setTimeout(() => this._mediator.execute(new CenterGroupOrNodeRequest(groupOrNodeId, animated)));
|
|
10288
10753
|
}
|
|
10289
|
-
|
|
10290
|
-
|
|
10754
|
+
/**
|
|
10755
|
+
* Fits the canvas to the screen by adjusting the scale and position.
|
|
10756
|
+
* @param padding - paddings from the bounds of the canvas
|
|
10757
|
+
* @param animated - If true, the fit will be animated; otherwise, it will be instantaneous.
|
|
10758
|
+
*/
|
|
10759
|
+
fitToScreen(padding = PointExtensions.initialize(), animated = true) {
|
|
10760
|
+
setTimeout(() => this._mediator.execute(new FitToFlowRequest(padding, animated)));
|
|
10291
10761
|
}
|
|
10762
|
+
/**
|
|
10763
|
+
* Resets the scale and center all nodes and groups on the canvas.
|
|
10764
|
+
* This method is used to restore the canvas to its default scale and position,
|
|
10765
|
+
* allowing users to quickly return to a standard view of the canvas content.
|
|
10766
|
+
* @param animated - If true, the reset will be animated; otherwise, it will be instantaneous.
|
|
10767
|
+
* This is useful for providing a smooth user experience when resetting the view.
|
|
10768
|
+
*/
|
|
10292
10769
|
resetScaleAndCenter(animated = true) {
|
|
10293
|
-
setTimeout(() => this.
|
|
10770
|
+
setTimeout(() => this._mediator.execute(new ResetScaleAndCenterRequest(animated)));
|
|
10294
10771
|
}
|
|
10772
|
+
/**
|
|
10773
|
+
* Gets the current scale of the canvas.
|
|
10774
|
+
*/
|
|
10295
10775
|
getScale() {
|
|
10296
10776
|
return this.transform.scale || 1;
|
|
10297
10777
|
}
|
|
@@ -10301,8 +10781,15 @@ class FCanvasComponent extends FCanvasBase {
|
|
|
10301
10781
|
setZoom(scale, toPosition = PointExtensions.initialize()) {
|
|
10302
10782
|
this.setScale(scale, toPosition);
|
|
10303
10783
|
}
|
|
10784
|
+
/**
|
|
10785
|
+
* Sets the scale of the canvas to a specified value.
|
|
10786
|
+
* This method is used to zoom in or out of the canvas,
|
|
10787
|
+
* allowing users to adjust the view of the canvas content.
|
|
10788
|
+
* @param scale - The scale factor to set for the canvas.
|
|
10789
|
+
* @param toPosition - The position to which the canvas should be centered after scaling.
|
|
10790
|
+
*/
|
|
10304
10791
|
setScale(scale, toPosition = PointExtensions.initialize()) {
|
|
10305
|
-
this.
|
|
10792
|
+
this._mediator.execute(new UpdateScaleRequest(scale, toPosition));
|
|
10306
10793
|
}
|
|
10307
10794
|
/**
|
|
10308
10795
|
* @deprecated Method "resetZoom" is deprecated. Use "resetScale" instead. This method will be removed in version 18.0.0.`,
|
|
@@ -10310,11 +10797,15 @@ class FCanvasComponent extends FCanvasBase {
|
|
|
10310
10797
|
resetZoom() {
|
|
10311
10798
|
this.resetScale();
|
|
10312
10799
|
}
|
|
10800
|
+
/**
|
|
10801
|
+
* Resets the scale of the canvas to its default value.
|
|
10802
|
+
* This method is used to restore the canvas to its original scale.
|
|
10803
|
+
*/
|
|
10313
10804
|
resetScale() {
|
|
10314
|
-
this.
|
|
10805
|
+
this._mediator.execute(new ResetScaleRequest());
|
|
10315
10806
|
}
|
|
10316
10807
|
ngOnDestroy() {
|
|
10317
|
-
this.
|
|
10808
|
+
this._mediator.execute(new RemoveCanvasFromStoreRequest());
|
|
10318
10809
|
}
|
|
10319
10810
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FCanvasComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
10320
10811
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "18.2.13", type: FCanvasComponent, isStandalone: true, selector: "f-canvas", inputs: { position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, scale: { classPropertyName: "scale", publicName: "scale", isSignal: true, isRequired: false, transformFunction: null }, debounceTime: { classPropertyName: "debounceTime", publicName: "debounceTime", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { fCanvasChange: "fCanvasChange" }, host: { classAttribute: "f-component f-canvas" }, providers: [
|
|
@@ -10650,8 +11141,14 @@ class FZoomDirective extends FZoomBase {
|
|
|
10650
11141
|
if (targetElement?.closest('[fLockedContext]')) {
|
|
10651
11142
|
return;
|
|
10652
11143
|
}
|
|
10653
|
-
|
|
11144
|
+
const step = this._normalizeWheelStep(event.deltaY);
|
|
11145
|
+
this.setZoom(PointExtensions.initialize(event.clientX, event.clientY), step, this._calculateDirection(event.deltaY), false);
|
|
10654
11146
|
};
|
|
11147
|
+
_normalizeWheelStep(deltaY) {
|
|
11148
|
+
const intensity = Math.abs(deltaY) / 100;
|
|
11149
|
+
const normalized = Math.max(0.1, Math.min(intensity, 1));
|
|
11150
|
+
return this.step * normalized;
|
|
11151
|
+
}
|
|
10655
11152
|
_calculateDirection(deltaY) {
|
|
10656
11153
|
return deltaY > 0 ? EFZoomDirection.ZOOM_OUT : EFZoomDirection.ZOOM_IN;
|
|
10657
11154
|
}
|