@octaviaflow/core 3.0.18-beta.10 → 3.0.18-beta.12
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/dist/chunk-5ARKSRED.js +2951 -0
- package/dist/chunk-5ARKSRED.js.map +1 -0
- package/dist/chunk-5OSGSJMM.js +2981 -0
- package/dist/chunk-5OSGSJMM.js.map +1 -0
- package/dist/chunk-5YQQMEF3.js +2981 -0
- package/dist/chunk-5YQQMEF3.js.map +1 -0
- package/dist/chunk-6QCJK7H7.js +2991 -0
- package/dist/chunk-6QCJK7H7.js.map +1 -0
- package/dist/chunk-76TP67ED.js +2984 -0
- package/dist/chunk-76TP67ED.js.map +1 -0
- package/dist/chunk-A6KMO4JV.js +2949 -0
- package/dist/chunk-A6KMO4JV.js.map +1 -0
- package/dist/chunk-B7FTWSTM.js +2938 -0
- package/dist/chunk-B7FTWSTM.js.map +1 -0
- package/dist/chunk-BCO6M26F.js +2940 -0
- package/dist/chunk-BCO6M26F.js.map +1 -0
- package/dist/chunk-ECIHUVU7.js +2986 -0
- package/dist/chunk-ECIHUVU7.js.map +1 -0
- package/dist/chunk-HDOTOZNA.js +2936 -0
- package/dist/chunk-HDOTOZNA.js.map +1 -0
- package/dist/chunk-IUIICQU5.js +2946 -0
- package/dist/chunk-IUIICQU5.js.map +1 -0
- package/dist/chunk-J2UYZI6D.js +2946 -0
- package/dist/chunk-J2UYZI6D.js.map +1 -0
- package/dist/chunk-K2H7JLQW.js +2952 -0
- package/dist/chunk-K2H7JLQW.js.map +1 -0
- package/dist/chunk-KUXYBP66.js +2953 -0
- package/dist/chunk-KUXYBP66.js.map +1 -0
- package/dist/chunk-MMXL343D.js +2974 -0
- package/dist/chunk-MMXL343D.js.map +1 -0
- package/dist/chunk-MXJL3EPE.js +2986 -0
- package/dist/chunk-MXJL3EPE.js.map +1 -0
- package/dist/chunk-NTMEYB7B.js +2949 -0
- package/dist/chunk-NTMEYB7B.js.map +1 -0
- package/dist/chunk-Q6ERDPQR.js +2981 -0
- package/dist/chunk-Q6ERDPQR.js.map +1 -0
- package/dist/chunk-SLVDAZSX.js +2946 -0
- package/dist/chunk-SLVDAZSX.js.map +1 -0
- package/dist/chunk-UQBPYONV.js +2991 -0
- package/dist/chunk-UQBPYONV.js.map +1 -0
- package/dist/chunk-UXMNBS22.js +2955 -0
- package/dist/chunk-UXMNBS22.js.map +1 -0
- package/dist/chunk-ZRAM6FXB.js +2949 -0
- package/dist/chunk-ZRAM6FXB.js.map +1 -0
- package/dist/index.cjs +109 -54
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/workflow/components/FlowCanvas/FlowCanvas.d.ts +8 -0
- package/dist/workflow/components/FlowCanvas/FlowCanvas.d.ts.map +1 -1
- package/dist/workflow/components/Handle/Handle.d.ts.map +1 -1
- package/dist/workflow/components/Handle/handleRegistry.d.ts +9 -0
- package/dist/workflow/components/Handle/handleRegistry.d.ts.map +1 -1
- package/dist/workflow/utils/parenting.d.ts +5 -3
- package/dist/workflow/utils/parenting.d.ts.map +1 -1
- package/dist/workflow.cjs +109 -54
- package/dist/workflow.cjs.map +1 -1
- package/dist/workflow.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -139,6 +139,14 @@ export interface FlowCanvasProps {
|
|
|
139
139
|
* `autoResizeContainers` recomputes a container's frame. Default 32.
|
|
140
140
|
*/
|
|
141
141
|
containerAutoResizePadding?: number;
|
|
142
|
+
/**
|
|
143
|
+
* Floor size for `autoResizeContainers`. A container that fits its
|
|
144
|
+
* children in less than this stops shrinking here — it never collapses
|
|
145
|
+
* below the size a freshly-dropped (empty) container would have.
|
|
146
|
+
* Defaults: 320 × 200.
|
|
147
|
+
*/
|
|
148
|
+
containerMinWidth?: number;
|
|
149
|
+
containerMinHeight?: number;
|
|
142
150
|
height?: number | string;
|
|
143
151
|
width?: number | string;
|
|
144
152
|
className?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlowCanvas.d.ts","sourceRoot":"","sources":["../../../../src/workflow/components/FlowCanvas/FlowCanvas.tsx"],"names":[],"mappings":"AAeA,OAAO,EACL,KAAK,aAAa,EAElB,KAAK,YAAY,EACjB,KAAK,SAAS,EAOf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EACV,eAAe,EACf,UAAU,EACV,kBAAkB,EAClB,UAAU,EACV,UAAU,EAEV,QAAQ,EACR,YAAY,EACZ,YAAY,EACb,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,KAAK,YAAY,EAAuB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"FlowCanvas.d.ts","sourceRoot":"","sources":["../../../../src/workflow/components/FlowCanvas/FlowCanvas.tsx"],"names":[],"mappings":"AAeA,OAAO,EACL,KAAK,aAAa,EAElB,KAAK,YAAY,EACjB,KAAK,SAAS,EAOf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EACV,eAAe,EACf,UAAU,EACV,kBAAkB,EAClB,UAAU,EACV,UAAU,EAEV,QAAQ,EACR,YAAY,EACZ,YAAY,EACb,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,KAAK,YAAY,EAAuB,MAAM,qBAAqB,CAAC;AAgB7E,OAAO,EAAyB,KAAK,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAMrF,OAAO,EAAE,KAAK,eAAe,EAAsB,MAAM,UAAU,CAAC;AASpE,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,UAAU,EAAE,KAAK,IAAI,CAAC;IAChD,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,UAAU,EAAE,KAAK,IAAI,CAAC;IAGhD,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,eAAe,CAAC,EAAE,QAAQ,CAAC;IAC3B,gBAAgB,CAAC,EAAE,CA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AAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAID,wBAAgB,MAAM,CAAC,EACrB,IAAI,EACJ,QAAQ,EACR,EAAsB,EACtB,aAAoB,EACpB,kBAAkB,EAClB,gBAAgB,EAChB,KAAS,EACT,KAAS,EACT,KAAK,EACL,SAAS,EACT,KAAK,GACN,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"Handle.d.ts","sourceRoot":"","sources":["../../../../src/workflow/components/Handle/Handle.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,KAAK,aAAa,EAAwC,MAAM,OAAO,CAAC;AAEjF,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAK/D,MAAM,WAAW,WAAW;IAC1B,0EAA0E;IAC1E,IAAI,EAAE,UAAU,CAAC;IACjB,iDAAiD;IACjD,QAAQ,EAAE,cAAc,CAAC;IACzB,4FAA4F;IAC5F,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,8EAA8E;IAC9E,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,8EAA8E;IAC9E,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,4EAA4E;IAC5E,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,uEAAuE;IACvE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6DAA6D;IAC7D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uEAAuE;IACvE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAID,wBAAgB,MAAM,CAAC,EACrB,IAAI,EACJ,QAAQ,EACR,EAAsB,EACtB,aAAoB,EACpB,kBAAkB,EAClB,gBAAgB,EAChB,KAAS,EACT,KAAS,EACT,KAAK,EACL,SAAS,EACT,KAAK,GACN,EAAE,WAAW,2CAoEb"}
|
|
@@ -8,10 +8,19 @@ export interface HandleDescriptor {
|
|
|
8
8
|
index: number;
|
|
9
9
|
/** Total handles on the same (node, side, type). */
|
|
10
10
|
total: number;
|
|
11
|
+
/** May this handle START a connection? Defaults true. */
|
|
12
|
+
canStart: boolean;
|
|
13
|
+
/** May this handle END a connection? Defaults true. */
|
|
14
|
+
canEnd: boolean;
|
|
11
15
|
}
|
|
12
16
|
export interface HandleRegistry {
|
|
13
17
|
register(d: HandleDescriptor): () => void;
|
|
14
18
|
resolve(nodeId: string, type: HandleType, handleId: string): HandleDescriptor | undefined;
|
|
19
|
+
/** Every currently-registered handle. Used by the connection drag to
|
|
20
|
+
* resolve a drop target geometrically (nearest handle within snap
|
|
21
|
+
* radius) rather than relying on DOM hit-testing, which is fragile
|
|
22
|
+
* against z-index / pointer-events / overlapping subflow frames. */
|
|
23
|
+
all(): HandleDescriptor[];
|
|
15
24
|
/**
|
|
16
25
|
* Subscribe to registry mutations. Fires after every register /
|
|
17
26
|
* unregister so listeners (typically the EdgesLayer) can re-render
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handleRegistry.d.ts","sourceRoot":"","sources":["../../../../src/workflow/components/Handle/handleRegistry.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/D,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,EAAE,cAAc,CAAC;IACrB,8DAA8D;IAC9D,KAAK,EAAE,MAAM,CAAC;IACd,oDAAoD;IACpD,KAAK,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"handleRegistry.d.ts","sourceRoot":"","sources":["../../../../src/workflow/components/Handle/handleRegistry.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/D,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,EAAE,cAAc,CAAC;IACrB,8DAA8D;IAC9D,KAAK,EAAE,MAAM,CAAC;IACd,oDAAoD;IACpD,KAAK,EAAE,MAAM,CAAC;IACd,yDAAyD;IACzD,QAAQ,EAAE,OAAO,CAAC;IAClB,uDAAuD;IACvD,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,CAAC,EAAE,gBAAgB,GAAG,MAAM,IAAI,CAAC;IAC1C,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,GAAG,gBAAgB,GAAG,SAAS,CAAC;IAC1F;;;yEAGqE;IACrE,GAAG,IAAI,gBAAgB,EAAE,CAAC;IAC1B;;;;;;;;OAQG;IACH,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC;CAC7C;AAED,eAAO,MAAM,qBAAqB,yCAA6C,CAAC;AAEhF,wBAAgB,iBAAiB,IAAI,cAAc,CAMlD;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,cAAc,CAmCrD"}
|
|
@@ -20,9 +20,11 @@ export declare function findAncestor(node: WorkflowNode, nodes: WorkflowNode[],
|
|
|
20
20
|
*/
|
|
21
21
|
export declare function clampToParentExtent(node: WorkflowNode, proposed: Position, nodes: WorkflowNode[]): Position;
|
|
22
22
|
/**
|
|
23
|
-
* Hit-test which
|
|
24
|
-
* Used by
|
|
25
|
-
*
|
|
23
|
+
* Hit-test which container node (if any) currently contains the given
|
|
24
|
+
* point. Used by drag-to-reparent and by drop-to-add to scope a new
|
|
25
|
+
* node. Both `group` AND `forEach` are containers — a `forEach` holds
|
|
26
|
+
* its iteration body the same way a `group` holds its members, so the
|
|
27
|
+
* hit-test must accept either.
|
|
26
28
|
*/
|
|
27
29
|
export declare function findContainingGroup(point: Position, nodes: WorkflowNode[], exclude?: string[]): WorkflowNode | undefined;
|
|
28
30
|
//# sourceMappingURL=parenting.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parenting.d.ts","sourceRoot":"","sources":["../../../src/workflow/utils/parenting.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAGxD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,YAAY,EAAE,CA0BnF;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,YAAY,EAClB,KAAK,EAAE,YAAY,EAAE,EACrB,SAAS,EAAE,CAAC,CAAC,EAAE,YAAY,KAAK,OAAO,GACtC,YAAY,GAAG,SAAS,CAY1B;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,YAAY,EAClB,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,YAAY,EAAE,GACpB,QAAQ,CAgBV;AAED
|
|
1
|
+
{"version":3,"file":"parenting.d.ts","sourceRoot":"","sources":["../../../src/workflow/utils/parenting.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAGxD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,YAAY,EAAE,CA0BnF;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,YAAY,EAClB,KAAK,EAAE,YAAY,EAAE,EACrB,SAAS,EAAE,CAAC,CAAC,EAAE,YAAY,KAAK,OAAO,GACtC,YAAY,GAAG,SAAS,CAY1B;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,YAAY,EAClB,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,YAAY,EAAE,GACpB,QAAQ,CAgBV;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,QAAQ,EACf,KAAK,EAAE,YAAY,EAAE,EACrB,OAAO,GAAE,MAAM,EAAO,GACrB,YAAY,GAAG,SAAS,CAqB1B"}
|
package/dist/workflow.cjs
CHANGED
|
@@ -1144,7 +1144,7 @@ function findContainingGroup(point, nodes, exclude = []) {
|
|
|
1144
1144
|
for (let i = nodes.length - 1; i >= 0; i--) {
|
|
1145
1145
|
const n = nodes[i];
|
|
1146
1146
|
if (exclude.includes(n.id)) continue;
|
|
1147
|
-
if (n.type !== "group") continue;
|
|
1147
|
+
if (n.type !== "group" && n.type !== "forEach") continue;
|
|
1148
1148
|
if (n.data && typeof n.data === "object" && n.data.collapsed) {
|
|
1149
1149
|
continue;
|
|
1150
1150
|
}
|
|
@@ -1354,6 +1354,9 @@ function createHandleRegistry() {
|
|
|
1354
1354
|
resolve(nodeId, type, handleId) {
|
|
1355
1355
|
return map.get(key(nodeId, type, handleId));
|
|
1356
1356
|
},
|
|
1357
|
+
all() {
|
|
1358
|
+
return Array.from(map.values());
|
|
1359
|
+
},
|
|
1357
1360
|
subscribe(listener) {
|
|
1358
1361
|
listeners.add(listener);
|
|
1359
1362
|
return () => {
|
|
@@ -1749,10 +1752,12 @@ function Handle({
|
|
|
1749
1752
|
type,
|
|
1750
1753
|
side: position,
|
|
1751
1754
|
index,
|
|
1752
|
-
total
|
|
1755
|
+
total,
|
|
1756
|
+
canStart,
|
|
1757
|
+
canEnd
|
|
1753
1758
|
});
|
|
1754
1759
|
return dispose;
|
|
1755
|
-
}, [registry, node.id, id, type, position, index, total]);
|
|
1760
|
+
}, [registry, node.id, id, type, position, index, total, canStart, canEnd]);
|
|
1756
1761
|
const handlePointerDown = (e) => {
|
|
1757
1762
|
if (!canStart) return;
|
|
1758
1763
|
e.stopPropagation();
|
|
@@ -2477,6 +2482,8 @@ function FlowCanvas(props) {
|
|
|
2477
2482
|
reparentOnDrag = false,
|
|
2478
2483
|
autoResizeContainers = false,
|
|
2479
2484
|
containerAutoResizePadding = 32,
|
|
2485
|
+
containerMinWidth = 320,
|
|
2486
|
+
containerMinHeight = 200,
|
|
2480
2487
|
height = "100%",
|
|
2481
2488
|
width = "100%",
|
|
2482
2489
|
className,
|
|
@@ -2613,7 +2620,9 @@ function FlowCanvas(props) {
|
|
|
2613
2620
|
id: d.id,
|
|
2614
2621
|
startPosition: d.position
|
|
2615
2622
|
}));
|
|
2616
|
-
const
|
|
2623
|
+
const evaluateReparent = altKey || reparentOnDragRef.current;
|
|
2624
|
+
const hasParent = !!node.parentId;
|
|
2625
|
+
const skipClamp = altKey || reparentOnDragRef.current && !hasParent;
|
|
2617
2626
|
dragRef.current = {
|
|
2618
2627
|
pointerId,
|
|
2619
2628
|
nodeId,
|
|
@@ -2621,7 +2630,8 @@ function FlowCanvas(props) {
|
|
|
2621
2630
|
startClientY: clientY,
|
|
2622
2631
|
startPosition: node.position,
|
|
2623
2632
|
descendants: kids,
|
|
2624
|
-
|
|
2633
|
+
skipClamp,
|
|
2634
|
+
evaluateReparent,
|
|
2625
2635
|
rafScheduled: false,
|
|
2626
2636
|
nextDelta: null
|
|
2627
2637
|
};
|
|
@@ -2681,6 +2691,8 @@ function FlowCanvas(props) {
|
|
|
2681
2691
|
const reparentOnDragRef = (0, import_react15.useRef)(reparentOnDrag);
|
|
2682
2692
|
const autoResizeContainersRef = (0, import_react15.useRef)(autoResizeContainers);
|
|
2683
2693
|
const containerAutoResizePaddingRef = (0, import_react15.useRef)(containerAutoResizePadding);
|
|
2694
|
+
const containerMinWidthRef = (0, import_react15.useRef)(containerMinWidth);
|
|
2695
|
+
const containerMinHeightRef = (0, import_react15.useRef)(containerMinHeight);
|
|
2684
2696
|
(0, import_react15.useEffect)(() => {
|
|
2685
2697
|
edgesRef.current = edges;
|
|
2686
2698
|
}, [edges]);
|
|
@@ -2714,6 +2726,12 @@ function FlowCanvas(props) {
|
|
|
2714
2726
|
(0, import_react15.useEffect)(() => {
|
|
2715
2727
|
containerAutoResizePaddingRef.current = containerAutoResizePadding;
|
|
2716
2728
|
}, [containerAutoResizePadding]);
|
|
2729
|
+
(0, import_react15.useEffect)(() => {
|
|
2730
|
+
containerMinWidthRef.current = containerMinWidth;
|
|
2731
|
+
}, [containerMinWidth]);
|
|
2732
|
+
(0, import_react15.useEffect)(() => {
|
|
2733
|
+
containerMinHeightRef.current = containerMinHeight;
|
|
2734
|
+
}, [containerMinHeight]);
|
|
2717
2735
|
const onNodesChangeRef = (0, import_react15.useRef)(onNodesChange);
|
|
2718
2736
|
const onConnectRef = (0, import_react15.useRef)(onConnect);
|
|
2719
2737
|
const onConnectEndRef = (0, import_react15.useRef)(onConnectEnd);
|
|
@@ -2758,7 +2776,7 @@ function FlowCanvas(props) {
|
|
|
2758
2776
|
x: d.startPosition.x + delta.dx,
|
|
2759
2777
|
y: d.startPosition.y + delta.dy
|
|
2760
2778
|
};
|
|
2761
|
-
const clamped = d.
|
|
2779
|
+
const clamped = d.skipClamp ? proposed : clampToParentExtent(dragNode, proposed, nodesRef.current);
|
|
2762
2780
|
const isContainer = dragNode.type === "group" || dragNode.type === "forEach";
|
|
2763
2781
|
const gap = isContainer ? subflowCollisionGapRef.current : nodeCollisionGapRef.current;
|
|
2764
2782
|
const excludeIds = /* @__PURE__ */ new Set([d.nodeId, ...d.descendants.map((kid) => kid.id)]);
|
|
@@ -2810,7 +2828,7 @@ function FlowCanvas(props) {
|
|
|
2810
2828
|
y: Math.round(proposed.y / g) * g
|
|
2811
2829
|
};
|
|
2812
2830
|
}
|
|
2813
|
-
const clamped = drag.
|
|
2831
|
+
const clamped = drag.skipClamp ? proposed : clampToParentExtent(dragNode, proposed, nodesRef.current);
|
|
2814
2832
|
const isContainer = dragNode.type === "group" || dragNode.type === "forEach";
|
|
2815
2833
|
const gap = isContainer ? subflowCollisionGapRef.current : nodeCollisionGapRef.current;
|
|
2816
2834
|
const excludeIds = /* @__PURE__ */ new Set([
|
|
@@ -2833,7 +2851,7 @@ function FlowCanvas(props) {
|
|
|
2833
2851
|
)
|
|
2834
2852
|
);
|
|
2835
2853
|
}
|
|
2836
|
-
if (drag.
|
|
2854
|
+
if (drag.evaluateReparent) {
|
|
2837
2855
|
const targetGroup = findContainingGroup(
|
|
2838
2856
|
{
|
|
2839
2857
|
x: finalPos.x + (dragNode.width ?? 0) / 2,
|
|
@@ -2848,8 +2866,10 @@ function FlowCanvas(props) {
|
|
|
2848
2866
|
...dragNode,
|
|
2849
2867
|
position: finalPos,
|
|
2850
2868
|
parentId: nextParentId,
|
|
2851
|
-
//
|
|
2852
|
-
extent:
|
|
2869
|
+
// Adopting into a container always pins the child with
|
|
2870
|
+
// `extent: 'parent'` so it's clamped from the next drag
|
|
2871
|
+
// on. Detaching clears it.
|
|
2872
|
+
extent: nextParentId ? "parent" : void 0
|
|
2853
2873
|
};
|
|
2854
2874
|
changes.push(change.node.replace(drag.nodeId, updated));
|
|
2855
2875
|
}
|
|
@@ -2860,7 +2880,9 @@ function FlowCanvas(props) {
|
|
|
2860
2880
|
// Projected children: apply the position + reparent
|
|
2861
2881
|
// changes we just built before measuring bboxes.
|
|
2862
2882
|
changes,
|
|
2863
|
-
containerAutoResizePaddingRef.current
|
|
2883
|
+
containerAutoResizePaddingRef.current,
|
|
2884
|
+
containerMinWidthRef.current,
|
|
2885
|
+
containerMinHeightRef.current
|
|
2864
2886
|
);
|
|
2865
2887
|
for (const c2 of containerChanges) changes.push(c2);
|
|
2866
2888
|
}
|
|
@@ -2871,49 +2893,54 @@ function FlowCanvas(props) {
|
|
|
2871
2893
|
}
|
|
2872
2894
|
const c = connRef.current;
|
|
2873
2895
|
if (c && c.pointerId === e.pointerId) {
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2896
|
+
const rect = containerRef.current?.getBoundingClientRect();
|
|
2897
|
+
const flowPos = rect ? screenToFlow({ x: e.clientX - rect.left, y: e.clientY - rect.top }, vp) : { x: 0, y: 0 };
|
|
2898
|
+
const snapRadius = 26 / Math.max(0.1, vp.zoom);
|
|
2899
|
+
let bestDesc = null;
|
|
2900
|
+
let bestDist = snapRadius;
|
|
2901
|
+
for (const desc of handleRegistry.all()) {
|
|
2902
|
+
if (desc.nodeId === c.from.nodeId) continue;
|
|
2903
|
+
if (desc.type === c.from.handleType) continue;
|
|
2904
|
+
if (!desc.canEnd) continue;
|
|
2905
|
+
const targetNode = nodesRef.current.find((n) => n.id === desc.nodeId);
|
|
2906
|
+
if (!targetNode || targetNode.hidden) continue;
|
|
2907
|
+
const centre = handleCentre(targetNode, desc.side, desc.index, desc.total);
|
|
2908
|
+
const dist = Math.hypot(centre.x - flowPos.x, centre.y - flowPos.y);
|
|
2909
|
+
if (dist < bestDist) {
|
|
2910
|
+
bestDist = dist;
|
|
2911
|
+
bestDesc = desc;
|
|
2885
2912
|
}
|
|
2886
2913
|
}
|
|
2887
2914
|
let connection = null;
|
|
2888
2915
|
let connectedTo;
|
|
2889
|
-
if (
|
|
2890
|
-
const
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2916
|
+
if (bestDesc) {
|
|
2917
|
+
const source = c.from.handleType === "source" ? c.from : {
|
|
2918
|
+
nodeId: bestDesc.nodeId,
|
|
2919
|
+
handleId: bestDesc.handleId,
|
|
2920
|
+
handleType: "source"
|
|
2921
|
+
};
|
|
2922
|
+
const target2 = c.from.handleType === "target" ? c.from : {
|
|
2923
|
+
nodeId: bestDesc.nodeId,
|
|
2924
|
+
handleId: bestDesc.handleId,
|
|
2925
|
+
handleType: "target"
|
|
2926
|
+
};
|
|
2927
|
+
connection = {
|
|
2928
|
+
source: source.nodeId,
|
|
2929
|
+
sourceHandle: source.handleId,
|
|
2930
|
+
target: target2.nodeId,
|
|
2931
|
+
targetHandle: target2.handleId
|
|
2932
|
+
};
|
|
2933
|
+
connectedTo = {
|
|
2934
|
+
nodeId: bestDesc.nodeId,
|
|
2935
|
+
handleId: bestDesc.handleId,
|
|
2936
|
+
handleType: bestDesc.type
|
|
2937
|
+
};
|
|
2938
|
+
const validator = isValidConnectionRef.current;
|
|
2939
|
+
if (validator && !validator(connection)) {
|
|
2940
|
+
connection = null;
|
|
2941
|
+
connectedTo = void 0;
|
|
2913
2942
|
}
|
|
2914
2943
|
}
|
|
2915
|
-
const rect = containerRef.current?.getBoundingClientRect();
|
|
2916
|
-
const flowPos = rect ? screenToFlow({ x: e.clientX - rect.left, y: e.clientY - rect.top }, vp) : { x: 0, y: 0 };
|
|
2917
2944
|
const endState = {
|
|
2918
2945
|
cancelled: !connection,
|
|
2919
2946
|
position: { x: e.clientX, y: e.clientY },
|
|
@@ -2946,6 +2973,25 @@ function FlowCanvas(props) {
|
|
|
2946
2973
|
window.removeEventListener("pointercancel", onPointerCancel);
|
|
2947
2974
|
};
|
|
2948
2975
|
}, [store]);
|
|
2976
|
+
(0, import_react15.useEffect)(() => {
|
|
2977
|
+
if (!autoResizeContainers || draggingId) return;
|
|
2978
|
+
const resizeChanges = computeContainerAutoResize(
|
|
2979
|
+
nodes,
|
|
2980
|
+
[],
|
|
2981
|
+
containerAutoResizePadding,
|
|
2982
|
+
containerMinWidth,
|
|
2983
|
+
containerMinHeight
|
|
2984
|
+
);
|
|
2985
|
+
if (resizeChanges.length > 0) onNodesChange?.(resizeChanges);
|
|
2986
|
+
}, [
|
|
2987
|
+
nodes,
|
|
2988
|
+
draggingId,
|
|
2989
|
+
autoResizeContainers,
|
|
2990
|
+
containerAutoResizePadding,
|
|
2991
|
+
containerMinWidth,
|
|
2992
|
+
containerMinHeight,
|
|
2993
|
+
onNodesChange
|
|
2994
|
+
]);
|
|
2949
2995
|
const panRef = (0, import_react15.useRef)(null);
|
|
2950
2996
|
const onCanvasPointerDown = (e) => {
|
|
2951
2997
|
if (e.button !== 0) return;
|
|
@@ -3408,7 +3454,9 @@ function FlowCanvas(props) {
|
|
|
3408
3454
|
function onEdgesChangeRef(id, cb) {
|
|
3409
3455
|
cb?.([change.edge.remove(id)]);
|
|
3410
3456
|
}
|
|
3411
|
-
|
|
3457
|
+
var CONTAINER_DROP_HEADROOM_W = 220;
|
|
3458
|
+
var CONTAINER_DROP_HEADROOM_H = 2 * 128;
|
|
3459
|
+
function computeContainerAutoResize(nodes, pending, padding, minWidth, minHeight) {
|
|
3412
3460
|
const projected = /* @__PURE__ */ new Map();
|
|
3413
3461
|
for (const n of nodes) projected.set(n.id, n);
|
|
3414
3462
|
for (const c of pending) {
|
|
@@ -3429,7 +3477,14 @@ function computeContainerAutoResize(nodes, pending, padding) {
|
|
|
3429
3477
|
for (const n of projected.values()) {
|
|
3430
3478
|
if (n.parentId === parent.id) children.push(n);
|
|
3431
3479
|
}
|
|
3432
|
-
if (children.length === 0)
|
|
3480
|
+
if (children.length === 0) {
|
|
3481
|
+
const curW2 = parent.width ?? 480;
|
|
3482
|
+
const curH2 = parent.height ?? 240;
|
|
3483
|
+
if (curW2 !== minWidth || curH2 !== minHeight) {
|
|
3484
|
+
out.push(change.node.dimensions(parent.id, { width: minWidth, height: minHeight }));
|
|
3485
|
+
}
|
|
3486
|
+
continue;
|
|
3487
|
+
}
|
|
3433
3488
|
let minX = Number.POSITIVE_INFINITY;
|
|
3434
3489
|
let minY = Number.POSITIVE_INFINITY;
|
|
3435
3490
|
let maxX = Number.NEGATIVE_INFINITY;
|
|
@@ -3444,12 +3499,12 @@ function computeContainerAutoResize(nodes, pending, padding) {
|
|
|
3444
3499
|
}
|
|
3445
3500
|
const targetX = minX - padding;
|
|
3446
3501
|
const targetY = minY - padding - HEADER;
|
|
3447
|
-
const targetW = maxX - minX + padding * 2;
|
|
3448
|
-
const targetH = maxY - minY + padding * 2 + HEADER;
|
|
3449
3502
|
const curW = parent.width ?? 480;
|
|
3450
3503
|
const curH = parent.height ?? 240;
|
|
3451
|
-
const
|
|
3452
|
-
const
|
|
3504
|
+
const fitW = maxX - minX + padding * 2 + CONTAINER_DROP_HEADROOM_W;
|
|
3505
|
+
const fitH = maxY - minY + padding * 2 + HEADER + CONTAINER_DROP_HEADROOM_H;
|
|
3506
|
+
const nextW = Math.max(minWidth, fitW);
|
|
3507
|
+
const nextH = Math.max(minHeight, fitH);
|
|
3453
3508
|
const positionDirty = parent.position.x !== targetX || parent.position.y !== targetY;
|
|
3454
3509
|
const sizeDirty = curW !== nextW || curH !== nextH;
|
|
3455
3510
|
if (positionDirty) {
|