@squeed/flow-sdk 2.0.45 → 2.0.46
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/index.cjs +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +484 -477
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ var V0 = (e, r, t) => r in e ? W0(e, r, { enumerable: !0, configurable: !0, writ
|
|
|
3
3
|
var Kt = (e, r, t) => V0(e, typeof r != "symbol" ? r + "" : r, t);
|
|
4
4
|
import { useSyncExternalStore as Ym, useState as ae, useRef as fe, useEffect as We, createContext as Io, useContext as Gt, useMemo as rt, useCallback as gt, useId as kr, forwardRef as No, cloneElement as G0, useLayoutEffect as kt, Children as U0, isValidElement as H0, memo as tn, Fragment as K0, createElement as Du } from "react";
|
|
5
5
|
import { jsx as y, jsxs as D, Fragment as He } from "react/jsx-runtime";
|
|
6
|
-
import { chakra as $r, IconButton as qd, Tooltip as dn, Portal as J0, Text as $t, Icon as Je, HStack as or, Box as
|
|
6
|
+
import { chakra as $r, IconButton as qd, Tooltip as dn, Portal as J0, Text as $t, Icon as Je, HStack as or, Box as ke, Tabs as go, Input as Qm, Button as Z0, Flex as Pt, Textarea as X0 } from "@chakra-ui/react";
|
|
7
7
|
import { createPortal as bn, flushSync as Y0 } from "react-dom";
|
|
8
8
|
import { PiDotsSix as Q0, PiXLight as ew, PiCaretUp as eb, PiCheck as _o, PiArrowsInLineVertical as tb, PiArrowsIn as rb, PiSelection as tw, PiSquareFill as nb, PiLineSegments as Zd, PiGridFour as Xd, PiDotsNine as rw, PiArrowsOutCardinal as ob, PiBezierCurve as ib, PiArrowsOut as ab, PiArrowsHorizontal as sb, PiLink as nw, PiCaretDown as Eo, PiTrash as rn, PiPlus as en, PiX as cb, PiListNumbers as ow, PiBracketsCurly as Yd, PiMagnifyingGlass as iw, PiArrowUp as lb, PiArrowDown as db, PiArrowLeft as ub, PiArrowCounterClockwise as fb, PiFile as aw, PiUploadSimple as Qd, PiShapes as hb, PiCaretLeft as eu, PiCaretRight as tu, PiArrowRight as pb, PiLineSegment as gb, PiFastForward as sw, PiTextT as cw, PiStack as lw, PiFileSvg as dw, PiTextAlignLeft as Wu, PiCards as uw, PiSquare as fw, PiBoundingBox as hw, PiSpinnerGap as pw, PiArrowsOutLineVertical as gw, PiCopy as yw, PiCopySimple as mw, PiEraser as bw, PiLineVerticalThin as Bt, PiDownloadSimpleFill as vw, PiWarningCircle as ww, PiGear as xw, PiGraph as yb, PiTable as Cw, PiTreeStructure as Sw, PiPushPinFill as _w, PiPushPin as Ew, PiMinus as kw, PiPencilSimpleLine as Aw, PiMagnifyingGlassPlus as Pw, PiSelectionPlus as Rw, PiHandGrabbing as Mw, PiBracketsSquare as Iw, PiAlignCenterHorizontal as Nw, PiCircleFill as ru, PiArrowsVertical as Ow, PiPlusBold as Ld, PiCode as mb, PiMinusBold as Vu, PiStop as Tw, PiPaperPlaneRight as $w } from "react-icons/pi";
|
|
9
9
|
import { keyframes as bb } from "@emotion/react";
|
|
@@ -1650,11 +1650,11 @@ function F1({
|
|
|
1650
1650
|
children: o
|
|
1651
1651
|
}) {
|
|
1652
1652
|
const i = rt(() => {
|
|
1653
|
-
var
|
|
1653
|
+
var be, Ae, Oe;
|
|
1654
1654
|
const z = /* @__PURE__ */ new Map();
|
|
1655
|
-
for (const Ne of t) (
|
|
1655
|
+
for (const Ne of t) (be = Ne.data) != null && be.id && z.set(Ne.data.id, Ne);
|
|
1656
1656
|
const $ = /* @__PURE__ */ new Map();
|
|
1657
|
-
for (const Ne of n) (
|
|
1657
|
+
for (const Ne of n) (Ae = Ne.data) != null && Ae.id && $.set(Ne.data.id, Ne);
|
|
1658
1658
|
const re = /* @__PURE__ */ new Set();
|
|
1659
1659
|
for (const Ne of t) (Oe = Ne.data) != null && Oe.parent && re.add(Ne.data.parent);
|
|
1660
1660
|
return { nodeById: z, edgeById: $, parentIds: re };
|
|
@@ -1663,10 +1663,10 @@ function F1({
|
|
|
1663
1663
|
), [W, I] = ae({}), J = gt(
|
|
1664
1664
|
(z, $) => {
|
|
1665
1665
|
I((re) => {
|
|
1666
|
-
const
|
|
1667
|
-
for (const
|
|
1668
|
-
$ === void 0 ? delete
|
|
1669
|
-
return
|
|
1666
|
+
const be = { ...re };
|
|
1667
|
+
for (const Ae of z)
|
|
1668
|
+
$ === void 0 ? delete be[Ae] : be[Ae] = $;
|
|
1669
|
+
return be;
|
|
1670
1670
|
});
|
|
1671
1671
|
},
|
|
1672
1672
|
[]
|
|
@@ -1680,18 +1680,18 @@ function F1({
|
|
|
1680
1680
|
}
|
|
1681
1681
|
), Q = !!ie.length && ie.every(
|
|
1682
1682
|
(z) => {
|
|
1683
|
-
var $, re,
|
|
1684
|
-
return i.parentIds.has(z.data.id) || ($ = z.data.config) != null && $.parentContainer ? !!((re = z.data.config) != null && re.collapsed) : F[z.data.id] === "icon-label" || ((
|
|
1683
|
+
var $, re, be;
|
|
1684
|
+
return i.parentIds.has(z.data.id) || ($ = z.data.config) != null && $.parentContainer ? !!((re = z.data.config) != null && re.collapsed) : F[z.data.id] === "icon-label" || ((be = z.data.config) == null ? void 0 : be.labelBelow) && F[z.data.id] !== "properties";
|
|
1685
1685
|
}
|
|
1686
1686
|
), [ce, te] = ae("normal"), [se, ve] = ae(), he = e.edgeRadius ?? se, U = he !== void 0 && Number.isFinite(he) ? Math.min(500, Math.max(0, he)) : void 0, [ee, ue] = ae(), xe = e.spacing ?? ce, ne = typeof xe == "number" ? Number.isFinite(xe) ? Math.min(2, Math.max(0.5, xe)) : 1 : xe === "compact" ? 0.5 : xe === "spacious" ? 2 : 1, Ce = e.backgroundVariant ?? ee ?? (e.backgroundPattern === "none" && e.backgroundColor === "transparent" ? "transparent" : e.backgroundPattern ?? "dot"), [qe, Ke] = ae(), Ue = Object.prototype.hasOwnProperty.call(
|
|
1687
1687
|
e,
|
|
1688
1688
|
"workflowContract"
|
|
1689
|
-
) ? e.workflowContract : qe, [at, ye] = ae("blue.500"), [Me,
|
|
1690
|
-
|
|
1689
|
+
) ? e.workflowContract : qe, [at, ye] = ae("blue.500"), [Me, Fe] = ae(!1), me = fe(r);
|
|
1690
|
+
me.current = r;
|
|
1691
1691
|
const tt = rt(() => {
|
|
1692
|
-
const z = (
|
|
1692
|
+
const z = (be) => (...Ae) => {
|
|
1693
1693
|
var Oe, Ne;
|
|
1694
|
-
return (Ne = (Oe =
|
|
1694
|
+
return (Ne = (Oe = me.current) == null ? void 0 : Oe[be]) == null ? void 0 : Ne.call(Oe, ...Ae);
|
|
1695
1695
|
}, $ = z("onPromptSubmit"), re = z("onFixedNodePositionsChange");
|
|
1696
1696
|
return {
|
|
1697
1697
|
// Node events
|
|
@@ -1719,19 +1719,19 @@ function F1({
|
|
|
1719
1719
|
onNodeDimensionChange: z("onNodeDimensionChange"),
|
|
1720
1720
|
onNodeParentChange: z("onNodeParentChange"),
|
|
1721
1721
|
get onFixedNodePositionsChange() {
|
|
1722
|
-
return
|
|
1722
|
+
return me.current.onFixedNodePositionsChange ? re : void 0;
|
|
1723
1723
|
},
|
|
1724
1724
|
get onPromptSubmit() {
|
|
1725
|
-
return
|
|
1725
|
+
return me.current.onPromptSubmit ? $ : void 0;
|
|
1726
1726
|
},
|
|
1727
1727
|
onNodeCollapse: z("onNodeCollapse"),
|
|
1728
1728
|
onNodeColorChange: z("onNodeColorChange"),
|
|
1729
1729
|
onNodeBorderColorChange: z("onNodeBorderColorChange"),
|
|
1730
1730
|
onNodeBorderStyleChange: z("onNodeBorderStyleChange"),
|
|
1731
1731
|
onNodeBorderWidthChange: z("onNodeBorderWidthChange"),
|
|
1732
|
-
onNodeBorderRadiusChange: (
|
|
1732
|
+
onNodeBorderRadiusChange: (be, Ae) => {
|
|
1733
1733
|
var Oe, Ne, nt;
|
|
1734
|
-
(Oe = M.current) != null && Oe.fill && T((it) => /* @__PURE__ */ new Set([...it,
|
|
1734
|
+
(Oe = M.current) != null && Oe.fill && T((it) => /* @__PURE__ */ new Set([...it, be])), (nt = (Ne = me.current).onNodeBorderRadiusChange) == null || nt.call(Ne, be, Ae);
|
|
1735
1735
|
},
|
|
1736
1736
|
onNodeIconChange: z("onNodeIconChange"),
|
|
1737
1737
|
onNodeOutlineChange: z("onNodeOutlineChange"),
|
|
@@ -1766,7 +1766,7 @@ function F1({
|
|
|
1766
1766
|
onLayoutComplete: z("onLayoutComplete"),
|
|
1767
1767
|
onJsonChange: z("onJsonChange")
|
|
1768
1768
|
};
|
|
1769
|
-
}, []), yt = e.themeColor || at, [Ie, Ye] = ae(""), pt = e.edgeColor ?? Ie,
|
|
1769
|
+
}, []), yt = e.themeColor || at, [Ie, Ye] = ae(""), pt = e.edgeColor ?? Ie, et = e.colorMode || "light", Ct = e.direction || "LR", qt = e.nodeAlignment ?? "center", cn = e.edgeMode === "workflow" ? "nodes" : e.edgeMode ?? H, Wr = e.readOnly ?? !1, st = JSON.stringify(e.parentNodeStyle ?? null), Ge = rt(
|
|
1770
1770
|
() => e.parentNodeStyle,
|
|
1771
1771
|
[st]
|
|
1772
1772
|
), sr = e.isZoomMode !== void 0 ? e.isZoomMode : u, mt = e.isMultiSelectMode !== void 0 ? e.isMultiSelectMode : h, Ut = e.isEdgeHandlesEnabled !== void 0 ? e.isEdgeHandlesEnabled : b, br = e.isDragMode !== void 0 ? e.isDragMode : p, Ve = fe(e);
|
|
@@ -1907,7 +1907,7 @@ function F1({
|
|
|
1907
1907
|
if ($ !== "default" && $ !== "properties" && $ !== "icon-label")
|
|
1908
1908
|
throw new Error("Unknown node view mode.");
|
|
1909
1909
|
V(
|
|
1910
|
-
(
|
|
1910
|
+
(be) => be[z] === $ ? be : { ...be, [z]: $ }
|
|
1911
1911
|
), (re = r.onNodeViewModeChange) == null || re.call(r, z, $);
|
|
1912
1912
|
},
|
|
1913
1913
|
[r.onNodeViewModeChange]
|
|
@@ -1915,14 +1915,14 @@ function F1({
|
|
|
1915
1915
|
() => ({
|
|
1916
1916
|
allNodesIconLabel: Q,
|
|
1917
1917
|
setAllNodesIconLabel: (z) => {
|
|
1918
|
-
var $, re,
|
|
1918
|
+
var $, re, be, Ae, Oe;
|
|
1919
1919
|
if (!z)
|
|
1920
1920
|
for (const [Ne, nt] of Object.entries(F))
|
|
1921
1921
|
nt === "icon-label" && !i.nodeById.has(Ne) && rr(Ne, "default");
|
|
1922
1922
|
for (const Ne of ie)
|
|
1923
|
-
i.parentIds.has(Ne.data.id) || ($ = Ne.data.config) != null && $.parentContainer ? !Wr && !!((re = Ne.data.config) != null && re.collapsed) !== z && ((
|
|
1923
|
+
i.parentIds.has(Ne.data.id) || ($ = Ne.data.config) != null && $.parentContainer ? !Wr && !!((re = Ne.data.config) != null && re.collapsed) !== z && ((be = r.onNodeCollapse) == null || be.call(r, Ne.data.id, z)) : rr(
|
|
1924
1924
|
Ne.data.id,
|
|
1925
|
-
z ? "icon-label" : (
|
|
1925
|
+
z ? "icon-label" : (Ae = Ne.data.config) != null && Ae.labelBelow ? "properties" : "default"
|
|
1926
1926
|
);
|
|
1927
1927
|
(Oe = r.onAllNodesIconLabelChange) == null || Oe.call(r, z);
|
|
1928
1928
|
},
|
|
@@ -1939,13 +1939,13 @@ function F1({
|
|
|
1939
1939
|
themeColor: yt,
|
|
1940
1940
|
setThemeColor: ye,
|
|
1941
1941
|
backgroundSelected: Me,
|
|
1942
|
-
setBackgroundSelected:
|
|
1942
|
+
setBackgroundSelected: Fe,
|
|
1943
1943
|
edgeColor: pt,
|
|
1944
1944
|
setEdgeColor: (z) => {
|
|
1945
1945
|
var $;
|
|
1946
1946
|
Ye(z), ($ = r.onGraphEdgeColorChange) == null || $.call(r, z);
|
|
1947
1947
|
},
|
|
1948
|
-
colorMode:
|
|
1948
|
+
colorMode: et,
|
|
1949
1949
|
direction: Ct,
|
|
1950
1950
|
nodeAlignment: qt,
|
|
1951
1951
|
edgeMode: cn,
|
|
@@ -2001,7 +2001,7 @@ function F1({
|
|
|
2001
2001
|
e.backgroundColor,
|
|
2002
2002
|
Me,
|
|
2003
2003
|
pt,
|
|
2004
|
-
|
|
2004
|
+
et,
|
|
2005
2005
|
Ct,
|
|
2006
2006
|
qt,
|
|
2007
2007
|
cn,
|
|
@@ -3049,7 +3049,7 @@ function hi({
|
|
|
3049
3049
|
children: [
|
|
3050
3050
|
!e && t && a.nodeGridSpacing !== "layout" && /* @__PURE__ */ D(He, { children: [
|
|
3051
3051
|
/* @__PURE__ */ y(
|
|
3052
|
-
|
|
3052
|
+
ke,
|
|
3053
3053
|
{
|
|
3054
3054
|
width: "96px",
|
|
3055
3055
|
flexShrink: 0,
|
|
@@ -5117,21 +5117,21 @@ function ff({
|
|
|
5117
5117
|
throw new Error("Choose one file for this field.");
|
|
5118
5118
|
if (!i.uploadFormFile)
|
|
5119
5119
|
throw new Error("No file upload handler configured.");
|
|
5120
|
-
const at = (Ke = (qe = t.$upload) == null ? void 0 : qe.accept) == null ? void 0 : Ke.split(",").map((
|
|
5121
|
-
for (const
|
|
5122
|
-
if (((Ue = t.$upload) == null ? void 0 : Ue.maxSizeBytes) !== void 0 &&
|
|
5123
|
-
throw new Error(`${
|
|
5120
|
+
const at = (Ke = (qe = t.$upload) == null ? void 0 : qe.accept) == null ? void 0 : Ke.split(",").map((me) => me.trim().toLowerCase()).filter(Boolean);
|
|
5121
|
+
for (const me of ne) {
|
|
5122
|
+
if (((Ue = t.$upload) == null ? void 0 : Ue.maxSizeBytes) !== void 0 && me.size > t.$upload.maxSizeBytes)
|
|
5123
|
+
throw new Error(`${me.name} exceeds the file size limit.`);
|
|
5124
5124
|
if (at != null && at.length && !at.some(
|
|
5125
|
-
(tt) => tt.startsWith(".") ?
|
|
5125
|
+
(tt) => tt.startsWith(".") ? me.name.toLowerCase().endsWith(tt) : tt.endsWith("/*") ? me.type.toLowerCase().startsWith(tt.slice(0, -1)) : me.type.toLowerCase() === tt
|
|
5126
5126
|
))
|
|
5127
|
-
throw new Error(`${
|
|
5127
|
+
throw new Error(`${me.name} is not an accepted file type.`);
|
|
5128
5128
|
}
|
|
5129
5129
|
const ye = await Promise.all(
|
|
5130
|
-
ne.map(async (
|
|
5130
|
+
ne.map(async (me) => {
|
|
5131
5131
|
const tt = await i.uploadFormFile({
|
|
5132
5132
|
...e,
|
|
5133
5133
|
data: Cn(E),
|
|
5134
|
-
file:
|
|
5134
|
+
file: me,
|
|
5135
5135
|
signal: Ce.signal
|
|
5136
5136
|
});
|
|
5137
5137
|
if (typeof tt != "string")
|
|
@@ -5149,8 +5149,8 @@ function ff({
|
|
|
5149
5149
|
);
|
|
5150
5150
|
if (Ce.signal.aborted || v.current !== Ce)
|
|
5151
5151
|
return;
|
|
5152
|
-
const Me = Y ? [...Array.isArray(n) ? n : [], ...ye] : ye[0],
|
|
5153
|
-
if (
|
|
5152
|
+
const Me = Y ? [...Array.isArray(n) ? n : [], ...ye] : ye[0], Fe = gr(r.type, Me, oe);
|
|
5153
|
+
if (Fe) throw new Error(Fe);
|
|
5154
5154
|
Q.current(Me);
|
|
5155
5155
|
} catch (at) {
|
|
5156
5156
|
Ce.signal.aborted || g(
|
|
@@ -6204,7 +6204,7 @@ function Sn({
|
|
|
6204
6204
|
].map((m) => {
|
|
6205
6205
|
const p = r === m;
|
|
6206
6206
|
return /* @__PURE__ */ y(Ze, { label: `${t}: ${m}`, children: /* @__PURE__ */ y(
|
|
6207
|
-
|
|
6207
|
+
ke,
|
|
6208
6208
|
{
|
|
6209
6209
|
as: "button",
|
|
6210
6210
|
"aria-label": `${t} ${m}`,
|
|
@@ -6409,7 +6409,7 @@ function uC({
|
|
|
6409
6409
|
return /* @__PURE__ */ D(He, { children: [
|
|
6410
6410
|
r && /* @__PURE__ */ y(jt, {}),
|
|
6411
6411
|
/* @__PURE__ */ y(
|
|
6412
|
-
|
|
6412
|
+
ke,
|
|
6413
6413
|
{
|
|
6414
6414
|
position: "relative",
|
|
6415
6415
|
w: "36px",
|
|
@@ -7000,7 +7000,7 @@ function lu({
|
|
|
7000
7000
|
}, []);
|
|
7001
7001
|
const m = `var(--chakra-colors-${r.replace(".", "-")})`;
|
|
7002
7002
|
return /* @__PURE__ */ D(
|
|
7003
|
-
|
|
7003
|
+
ke,
|
|
7004
7004
|
{
|
|
7005
7005
|
position: "relative",
|
|
7006
7006
|
bg: s ? r : "transparent",
|
|
@@ -7019,7 +7019,7 @@ function lu({
|
|
|
7019
7019
|
},
|
|
7020
7020
|
children: [
|
|
7021
7021
|
/* @__PURE__ */ y(
|
|
7022
|
-
|
|
7022
|
+
ke,
|
|
7023
7023
|
{
|
|
7024
7024
|
ref: a,
|
|
7025
7025
|
"data-flow-toolbar-scroll": "",
|
|
@@ -7039,7 +7039,7 @@ function lu({
|
|
|
7039
7039
|
}
|
|
7040
7040
|
),
|
|
7041
7041
|
["left", "right"].map((p) => /* @__PURE__ */ y(
|
|
7042
|
-
|
|
7042
|
+
ke,
|
|
7043
7043
|
{
|
|
7044
7044
|
"data-flow-toolbar-fade": p,
|
|
7045
7045
|
"aria-hidden": "true",
|
|
@@ -7059,7 +7059,7 @@ function lu({
|
|
|
7059
7059
|
p
|
|
7060
7060
|
)),
|
|
7061
7061
|
n && /* @__PURE__ */ y(
|
|
7062
|
-
|
|
7062
|
+
ke,
|
|
7063
7063
|
{
|
|
7064
7064
|
position: "absolute",
|
|
7065
7065
|
right: "6px",
|
|
@@ -7076,7 +7076,7 @@ function lu({
|
|
|
7076
7076
|
}
|
|
7077
7077
|
),
|
|
7078
7078
|
o && /* @__PURE__ */ y(
|
|
7079
|
-
|
|
7079
|
+
ke,
|
|
7080
7080
|
{
|
|
7081
7081
|
ref: c,
|
|
7082
7082
|
position: "absolute",
|
|
@@ -7478,11 +7478,11 @@ const bC = [
|
|
|
7478
7478
|
(Ie) => {
|
|
7479
7479
|
const Ye = r.current;
|
|
7480
7480
|
if (!Ye) return;
|
|
7481
|
-
const pt = O.minZoom ?? 0.01,
|
|
7481
|
+
const pt = O.minZoom ?? 0.01, et = O.maxZoom ?? 1.5, Ct = 0.02;
|
|
7482
7482
|
let qt = Ye.zoom();
|
|
7483
7483
|
switch (Ie) {
|
|
7484
7484
|
case "increase":
|
|
7485
|
-
qt = Math.min(
|
|
7485
|
+
qt = Math.min(et, qt + Ct), Ye.zoom(qt), Ye.center(!1);
|
|
7486
7486
|
break;
|
|
7487
7487
|
case "decrease":
|
|
7488
7488
|
qt = Math.max(pt, qt - Ct), Ye.zoom(qt), Ye.center(!1);
|
|
@@ -7505,7 +7505,7 @@ const bC = [
|
|
|
7505
7505
|
}, [qe, p, I]), Ue = gt(() => {
|
|
7506
7506
|
var Ie;
|
|
7507
7507
|
g(null), (Ie = E.onEdgeDeselect) == null || Ie.call(E);
|
|
7508
|
-
}, [g, E]), at = O.selectionToolbar !== !1 && !T, ye = at && !!p && !Ce, Me = at && !ye && h.length > 0 && !ee,
|
|
7508
|
+
}, [g, E]), at = O.selectionToolbar !== !1 && !T, ye = at && !!p && !Ce, Me = at && !ye && h.length > 0 && !ee, Fe = ye || Me, me = M || he || ie || Fe || O.bottomBarCollapsed === !1;
|
|
7509
7509
|
We(() => {
|
|
7510
7510
|
h.length || p ? a(!1) : T || (s && k(!0), O.bottomBarCollapsed === void 0 && te(!s));
|
|
7511
7511
|
}, [
|
|
@@ -7520,7 +7520,7 @@ const bC = [
|
|
|
7520
7520
|
const tt = O.renderBottomBar, yt = W1();
|
|
7521
7521
|
return tt ? /* @__PURE__ */ D(He, { children: [
|
|
7522
7522
|
ue && /* @__PURE__ */ y(
|
|
7523
|
-
|
|
7523
|
+
ke,
|
|
7524
7524
|
{
|
|
7525
7525
|
position: "absolute",
|
|
7526
7526
|
bottom: 5,
|
|
@@ -7535,7 +7535,7 @@ const bC = [
|
|
|
7535
7535
|
}
|
|
7536
7536
|
),
|
|
7537
7537
|
qe && Ke && /* @__PURE__ */ y(
|
|
7538
|
-
|
|
7538
|
+
ke,
|
|
7539
7539
|
{
|
|
7540
7540
|
position: "absolute",
|
|
7541
7541
|
bottom: 5,
|
|
@@ -7550,7 +7550,7 @@ const bC = [
|
|
|
7550
7550
|
}
|
|
7551
7551
|
),
|
|
7552
7552
|
/* @__PURE__ */ y(
|
|
7553
|
-
|
|
7553
|
+
ke,
|
|
7554
7554
|
{
|
|
7555
7555
|
position: "absolute",
|
|
7556
7556
|
bottom: 0,
|
|
@@ -7585,7 +7585,7 @@ const bC = [
|
|
|
7585
7585
|
)
|
|
7586
7586
|
] }) : /* @__PURE__ */ D(wn.Provider, { value: yt, children: [
|
|
7587
7587
|
ue && /* @__PURE__ */ y(
|
|
7588
|
-
|
|
7588
|
+
ke,
|
|
7589
7589
|
{
|
|
7590
7590
|
position: "absolute",
|
|
7591
7591
|
bottom: 5,
|
|
@@ -7600,7 +7600,7 @@ const bC = [
|
|
|
7600
7600
|
}
|
|
7601
7601
|
),
|
|
7602
7602
|
qe && Ke && /* @__PURE__ */ y(
|
|
7603
|
-
|
|
7603
|
+
ke,
|
|
7604
7604
|
{
|
|
7605
7605
|
position: "absolute",
|
|
7606
7606
|
bottom: 5,
|
|
@@ -7615,7 +7615,7 @@ const bC = [
|
|
|
7615
7615
|
}
|
|
7616
7616
|
),
|
|
7617
7617
|
/* @__PURE__ */ y(
|
|
7618
|
-
|
|
7618
|
+
ke,
|
|
7619
7619
|
{
|
|
7620
7620
|
ref: ve,
|
|
7621
7621
|
role: "toolbar",
|
|
@@ -7627,10 +7627,10 @@ const bC = [
|
|
|
7627
7627
|
zIndex: 100,
|
|
7628
7628
|
w: "100%",
|
|
7629
7629
|
transition: "opacity 0.3s ease-in, transform 0.3s ease",
|
|
7630
|
-
transform:
|
|
7631
|
-
pointerEvents:
|
|
7632
|
-
visibility:
|
|
7633
|
-
opacity:
|
|
7630
|
+
transform: me ? "translateY(0)" : "translateY(100%)",
|
|
7631
|
+
pointerEvents: me ? "auto" : "none",
|
|
7632
|
+
visibility: me ? "visible" : "hidden",
|
|
7633
|
+
opacity: me ? 1 : 0,
|
|
7634
7634
|
css: {
|
|
7635
7635
|
"& button > svg:not([popover] *)": {
|
|
7636
7636
|
width: "20px",
|
|
@@ -8102,9 +8102,9 @@ const bC = [
|
|
|
8102
8102
|
)
|
|
8103
8103
|
}
|
|
8104
8104
|
),
|
|
8105
|
-
!
|
|
8105
|
+
!Fe && /* @__PURE__ */ D(ke, { position: "relative", ml: "auto", flexShrink: 0, children: [
|
|
8106
8106
|
/* @__PURE__ */ y(
|
|
8107
|
-
|
|
8107
|
+
ke,
|
|
8108
8108
|
{
|
|
8109
8109
|
"data-flow-direction-control": "",
|
|
8110
8110
|
bg: H,
|
|
@@ -8142,7 +8142,7 @@ const bC = [
|
|
|
8142
8142
|
}
|
|
8143
8143
|
),
|
|
8144
8144
|
ie && /* @__PURE__ */ y(
|
|
8145
|
-
|
|
8145
|
+
ke,
|
|
8146
8146
|
{
|
|
8147
8147
|
position: "absolute",
|
|
8148
8148
|
bottom: "100%",
|
|
@@ -8150,7 +8150,7 @@ const bC = [
|
|
|
8150
8150
|
pb: "24px",
|
|
8151
8151
|
zIndex: 200,
|
|
8152
8152
|
children: /* @__PURE__ */ D(
|
|
8153
|
-
|
|
8153
|
+
ke,
|
|
8154
8154
|
{
|
|
8155
8155
|
bg: H,
|
|
8156
8156
|
borderRadius: "30px",
|
|
@@ -11361,21 +11361,21 @@ function Dv() {
|
|
|
11361
11361
|
return Ue;
|
|
11362
11362
|
if (!w(ue))
|
|
11363
11363
|
return ue;
|
|
11364
|
-
var
|
|
11365
|
-
if (
|
|
11364
|
+
var Fe = p(ue);
|
|
11365
|
+
if (Fe) {
|
|
11366
11366
|
if (Ue = f(ue), !at)
|
|
11367
11367
|
return s(ue, Ue);
|
|
11368
11368
|
} else {
|
|
11369
|
-
var
|
|
11369
|
+
var me = u(ue), tt = me == O || me == T;
|
|
11370
11370
|
if (g(ue))
|
|
11371
11371
|
return i(ue, at);
|
|
11372
|
-
if (
|
|
11372
|
+
if (me == J || me == A || tt && !qe) {
|
|
11373
11373
|
if (Ue = ye || tt ? {} : m(ue), !at)
|
|
11374
11374
|
return ye ? c(ue, o(Ue, ue)) : a(ue, n(Ue, ue));
|
|
11375
11375
|
} else {
|
|
11376
|
-
if (!U[
|
|
11376
|
+
if (!U[me])
|
|
11377
11377
|
return qe ? ue : {};
|
|
11378
|
-
Ue = h(ue,
|
|
11378
|
+
Ue = h(ue, me, at);
|
|
11379
11379
|
}
|
|
11380
11380
|
}
|
|
11381
11381
|
Ke || (Ke = new e());
|
|
@@ -11384,12 +11384,12 @@ function Dv() {
|
|
|
11384
11384
|
return yt;
|
|
11385
11385
|
Ke.set(ue, Ue), x(ue) ? ue.forEach(function(pt) {
|
|
11386
11386
|
Ue.add(ee(pt, xe, ne, pt, ue, Ke));
|
|
11387
|
-
}) : b(ue) && ue.forEach(function(pt,
|
|
11388
|
-
Ue.set(
|
|
11387
|
+
}) : b(ue) && ue.forEach(function(pt, et) {
|
|
11388
|
+
Ue.set(et, ee(pt, xe, ne, et, ue, Ke));
|
|
11389
11389
|
});
|
|
11390
|
-
var Ie = Me ? ye ? d : l : ye ? C : v, Ye =
|
|
11391
|
-
return r(Ye || ue, function(pt,
|
|
11392
|
-
Ye && (
|
|
11390
|
+
var Ie = Me ? ye ? d : l : ye ? C : v, Ye = Fe ? void 0 : Ie(ue);
|
|
11391
|
+
return r(Ye || ue, function(pt, et) {
|
|
11392
|
+
Ye && (et = pt, pt = ue[et]), t(Ue, et, ee(pt, xe, ne, et, ue, Ke));
|
|
11393
11393
|
}), Ue;
|
|
11394
11394
|
}
|
|
11395
11395
|
return ds = ee, ds;
|
|
@@ -16705,7 +16705,7 @@ function Nk(e) {
|
|
|
16705
16705
|
te.current = Q;
|
|
16706
16706
|
const [se, ve] = ae(/* @__PURE__ */ new Map()), he = fe(se), U = () => {
|
|
16707
16707
|
he.current = /* @__PURE__ */ new Map(), ve(he.current);
|
|
16708
|
-
}, ee = fe(new Map(Object.entries(e.fixedNodePositions ?? {}))), ue = fe(new Set(Object.keys(e.fixedNodePositions ?? {}))), xe = fe(null), ne = fe(!1), [Ce, qe] = ae(0), Ke = fe(), Ue = fe(), at = fe(null), ye = fe(), Me = fe(!1),
|
|
16708
|
+
}, ee = fe(new Map(Object.entries(e.fixedNodePositions ?? {}))), ue = fe(new Set(Object.keys(e.fixedNodePositions ?? {}))), xe = fe(null), ne = fe(!1), [Ce, qe] = ae(0), Ke = fe(), Ue = fe(), at = fe(null), ye = fe(), Me = fe(!1), Fe = fe(null), me = fe(null), tt = fe(), yt = fe(l), Ie = s, Ye = fe(Ie), [pt, et] = ae(!0), [Ct, qt] = ae(
|
|
16709
16709
|
!!((qu = e.initialNodeGrid) != null && qu.enabled)
|
|
16710
16710
|
), [cn, Wr] = ae([]), st = fe(
|
|
16711
16711
|
(Lu = e.initialNodeGrid) != null && Lu.enabled ? {
|
|
@@ -16726,37 +16726,37 @@ function Nk(e) {
|
|
|
16726
16726
|
var P;
|
|
16727
16727
|
(P = at.current) == null || P.call(at), at.current = null, ye.current = void 0;
|
|
16728
16728
|
}, z = () => {
|
|
16729
|
-
|
|
16729
|
+
me.current = null, tr.current.length && !ee.current.size && (rr.current = !0), !ne.current && k.current.fitOnInit !== !1 && (Me.current = !0), clearTimeout(Ue.current), Ue.current = setTimeout(() => {
|
|
16730
16730
|
ne.current = te.current.size > 0, qe((P) => P + 1);
|
|
16731
16731
|
}, Mk);
|
|
16732
16732
|
}, $ = (P, L, j, K = z, pe) => {
|
|
16733
16733
|
vr();
|
|
16734
|
-
const
|
|
16734
|
+
const Pe = new Map(te.current), _e = new Map([...J.current, ...he.current]);
|
|
16735
16735
|
at.current = gv(
|
|
16736
16736
|
L,
|
|
16737
|
-
(
|
|
16737
|
+
(Ee) => {
|
|
16738
16738
|
const ot = /* @__PURE__ */ new Map();
|
|
16739
16739
|
if (P.forEach((Le, De) => {
|
|
16740
|
-
const Re =
|
|
16740
|
+
const Re = Pe.get(De);
|
|
16741
16741
|
ot.set(
|
|
16742
16742
|
De,
|
|
16743
16743
|
ee.current.get(De) ?? (Re ? {
|
|
16744
|
-
x: Re.x + (Le.x - Re.x) *
|
|
16745
|
-
y: Re.y + (Le.y - Re.y) *
|
|
16744
|
+
x: Re.x + (Le.x - Re.x) * Ee,
|
|
16745
|
+
y: Re.y + (Le.y - Re.y) * Ee
|
|
16746
16746
|
} : Le)
|
|
16747
16747
|
);
|
|
16748
16748
|
}), te.current = ot, ce(ot), pe) {
|
|
16749
16749
|
const Le = /* @__PURE__ */ new Map();
|
|
16750
16750
|
for (const [De, Re] of pe) {
|
|
16751
|
-
const Z =
|
|
16751
|
+
const Z = _e.get(De) ?? Re;
|
|
16752
16752
|
Le.set(De, {
|
|
16753
|
-
w: Z.w + (Re.w - Z.w) *
|
|
16754
|
-
h: Z.h + (Re.h - Z.h) *
|
|
16753
|
+
w: Z.w + (Re.w - Z.w) * Ee,
|
|
16754
|
+
h: Z.h + (Re.h - Z.h) * Ee
|
|
16755
16755
|
});
|
|
16756
16756
|
}
|
|
16757
16757
|
he.current = Le, ve(Le);
|
|
16758
16758
|
}
|
|
16759
|
-
j == null || j(
|
|
16759
|
+
j == null || j(Ee);
|
|
16760
16760
|
},
|
|
16761
16761
|
K
|
|
16762
16762
|
);
|
|
@@ -16776,13 +16776,13 @@ function Nk(e) {
|
|
|
16776
16776
|
const X = J.current.get(Re.id) || xo;
|
|
16777
16777
|
return { id: Re.id, parent: Re.parent, width: X.w, height: X.h, hasBody: K.has(Re.id) };
|
|
16778
16778
|
});
|
|
16779
|
-
let
|
|
16779
|
+
let Pe;
|
|
16780
16780
|
try {
|
|
16781
16781
|
const Re = P.compactPropertyLayout, Z = P.edgeMode !== "nodes" && P.edgeMode !== "workflow", X = j.edges.map((ge) => ({
|
|
16782
16782
|
...ge,
|
|
16783
16783
|
connectorClearance: Re ? Z && (ge.sourceProperty !== void 0 || ge.targetProperty !== void 0) ? KC : HC : 0
|
|
16784
16784
|
}));
|
|
16785
|
-
|
|
16785
|
+
Pe = mk(pe, X, {
|
|
16786
16786
|
edgeLabelFontSize: P.edgeMode === "nodes" || P.edgeMode === "workflow" ? wv : Po,
|
|
16787
16787
|
rankDir: P.direction,
|
|
16788
16788
|
compact: Re,
|
|
@@ -16797,47 +16797,47 @@ function Nk(e) {
|
|
|
16797
16797
|
console.warn("[flow-sdk] layout failed", Re);
|
|
16798
16798
|
return;
|
|
16799
16799
|
}
|
|
16800
|
-
const
|
|
16800
|
+
const _e = [...ee.current].find(([Re]) => Pe.has(Re)), Ee = _e ? { id: _e[0], position: _e[1] } : me.current ? null : xe.current;
|
|
16801
16801
|
xe.current = null;
|
|
16802
|
-
const ot =
|
|
16803
|
-
if (
|
|
16802
|
+
const ot = Ee && Pe.get(Ee.id);
|
|
16803
|
+
if (Ee && ot) {
|
|
16804
16804
|
const Re = {
|
|
16805
|
-
x:
|
|
16806
|
-
y:
|
|
16805
|
+
x: Ee.position.x - ot.x,
|
|
16806
|
+
y: Ee.position.y - ot.y
|
|
16807
16807
|
};
|
|
16808
|
-
|
|
16809
|
-
[...
|
|
16808
|
+
Pe = new Map(
|
|
16809
|
+
[...Pe].map(([Z, X]) => [
|
|
16810
16810
|
Z,
|
|
16811
16811
|
{ x: X.x + Re.x, y: X.y + Re.y }
|
|
16812
16812
|
])
|
|
16813
16813
|
);
|
|
16814
16814
|
}
|
|
16815
16815
|
for (const [Re, Z] of ee.current)
|
|
16816
|
-
P.nodes.some((X) => X.id === Re) ?
|
|
16817
|
-
if (
|
|
16816
|
+
P.nodes.some((X) => X.id === Re) ? Pe.set(Re, Z) : ee.current.delete(Re);
|
|
16817
|
+
if (me.current) {
|
|
16818
16818
|
const Re = JSON.stringify([
|
|
16819
16819
|
pe,
|
|
16820
|
-
[...
|
|
16820
|
+
[...Pe],
|
|
16821
16821
|
I.size,
|
|
16822
16822
|
P.isPerformanceMode,
|
|
16823
16823
|
P.disableAnimations
|
|
16824
16824
|
]);
|
|
16825
|
-
if (((De = tt.current) == null ? void 0 : De.focus) ===
|
|
16825
|
+
if (((De = tt.current) == null ? void 0 : De.focus) === me.current && tt.current.geometry === Re)
|
|
16826
16826
|
return;
|
|
16827
|
-
tt.current = { focus:
|
|
16827
|
+
tt.current = { focus: me.current, geometry: Re };
|
|
16828
16828
|
} else tt.current = void 0;
|
|
16829
16829
|
const Le = I.coordinate(
|
|
16830
16830
|
() => {
|
|
16831
16831
|
var Re;
|
|
16832
|
-
return (Re =
|
|
16832
|
+
return (Re = me.current) == null ? void 0 : Re.call(me, Pe);
|
|
16833
16833
|
}
|
|
16834
16834
|
);
|
|
16835
16835
|
$(
|
|
16836
|
-
|
|
16836
|
+
Pe,
|
|
16837
16837
|
ne.current && !P.isPerformanceMode && !P.disableAnimations,
|
|
16838
16838
|
Le
|
|
16839
16839
|
);
|
|
16840
|
-
},
|
|
16840
|
+
}, be = gt(() => {
|
|
16841
16841
|
clearTimeout(Ue.current), clearTimeout(Ke.current), Ke.current = setTimeout(
|
|
16842
16842
|
re,
|
|
16843
16843
|
k.current.layoutDebounce
|
|
@@ -16849,12 +16849,12 @@ function Nk(e) {
|
|
|
16849
16849
|
for (const j of ue.current)
|
|
16850
16850
|
Object.prototype.hasOwnProperty.call(P, j) || (L = ee.current.delete(j) || L);
|
|
16851
16851
|
for (const [j, K] of Object.entries(P)) {
|
|
16852
|
-
if (!r.some((
|
|
16852
|
+
if (!r.some((Pe) => Pe.id === j) || !K || ![K.x, K.y].every(Number.isFinite)) continue;
|
|
16853
16853
|
const pe = ee.current.get(j);
|
|
16854
16854
|
((pe == null ? void 0 : pe.x) !== K.x || (pe == null ? void 0 : pe.y) !== K.y) && (ee.current.set(j, { ...K }), L = !0);
|
|
16855
16855
|
}
|
|
16856
|
-
ue.current = new Set(Object.keys(P)), L &&
|
|
16857
|
-
}, [e.fixedNodePositions, r,
|
|
16856
|
+
ue.current = new Set(Object.keys(P)), L && be();
|
|
16857
|
+
}, [e.fixedNodePositions, r, be]), kt(() => {
|
|
16858
16858
|
const P = new Map(
|
|
16859
16859
|
Ve.current.map((L) => [L.id, L])
|
|
16860
16860
|
);
|
|
@@ -16863,7 +16863,7 @@ function Nk(e) {
|
|
|
16863
16863
|
var j;
|
|
16864
16864
|
return ((j = P.get(L.id)) == null ? void 0 : j.collapsed) === !0 && !L.collapsed;
|
|
16865
16865
|
}
|
|
16866
|
-
) && (tr.current = r.filter((L) => !P.has(L.id)).map((L) => L.id)), Ve.current = r, yt.current !== l && te.current.size > 0 && (ne.current = !0, Me.current = !1, clearTimeout(Ue.current)), yt.current = l, Ye.current !== Ie && (Me.current = !
|
|
16866
|
+
) && (tr.current = r.filter((L) => !P.has(L.id)).map((L) => L.id)), Ve.current = r, yt.current !== l && te.current.size > 0 && (ne.current = !0, Me.current = !1, clearTimeout(Ue.current)), yt.current = l, Ye.current !== Ie && (Me.current = !Fe.current), Ye.current = Ie, be();
|
|
16867
16867
|
}, [
|
|
16868
16868
|
r,
|
|
16869
16869
|
t,
|
|
@@ -16874,7 +16874,7 @@ function Nk(e) {
|
|
|
16874
16874
|
o,
|
|
16875
16875
|
a,
|
|
16876
16876
|
c,
|
|
16877
|
-
|
|
16877
|
+
be,
|
|
16878
16878
|
l,
|
|
16879
16879
|
d,
|
|
16880
16880
|
v,
|
|
@@ -16885,33 +16885,33 @@ function Nk(e) {
|
|
|
16885
16885
|
},
|
|
16886
16886
|
[]
|
|
16887
16887
|
);
|
|
16888
|
-
const
|
|
16888
|
+
const Ae = gt(
|
|
16889
16889
|
(P, L) => {
|
|
16890
16890
|
var j, K;
|
|
16891
16891
|
if (!Y.current && typeof ResizeObserver < "u" && (Y.current = new ResizeObserver((pe) => {
|
|
16892
|
-
let
|
|
16893
|
-
for (const
|
|
16894
|
-
const
|
|
16895
|
-
if (!
|
|
16896
|
-
const ot =
|
|
16892
|
+
let Pe = !1;
|
|
16893
|
+
for (const _e of pe) {
|
|
16894
|
+
const Ee = H.current.get(_e.target);
|
|
16895
|
+
if (!Ee || he.current.has(Ee)) continue;
|
|
16896
|
+
const ot = _e.target, Le = ot.offsetWidth, De = ot.offsetHeight;
|
|
16897
16897
|
if (!Le && !De) continue;
|
|
16898
|
-
const Re = J.current.get(
|
|
16898
|
+
const Re = J.current.get(Ee);
|
|
16899
16899
|
if (Re && Re.w === Le && Re.h === De) continue;
|
|
16900
|
-
const Z = te.current.get(
|
|
16901
|
-
Re && Z && ne.current && !xe.current && (xe.current = { id:
|
|
16900
|
+
const Z = te.current.get(Ee);
|
|
16901
|
+
Re && Z && ne.current && !xe.current && (xe.current = { id: Ee, position: { ...Z } }), J.current.set(Ee, { w: Le, h: De }), Pe = !0;
|
|
16902
16902
|
}
|
|
16903
|
-
|
|
16903
|
+
Pe && be();
|
|
16904
16904
|
})), L) {
|
|
16905
16905
|
de.current.set(P, L), H.current.set(L, P), (j = Y.current) == null || j.observe(L);
|
|
16906
|
-
const pe = L.offsetWidth,
|
|
16907
|
-
!he.current.has(P) && (pe ||
|
|
16906
|
+
const pe = L.offsetWidth, Pe = L.offsetHeight;
|
|
16907
|
+
!he.current.has(P) && (pe || Pe) && J.current.set(P, { w: pe, h: Pe });
|
|
16908
16908
|
} else {
|
|
16909
16909
|
const pe = de.current.get(P);
|
|
16910
16910
|
pe && ((K = Y.current) == null || K.unobserve(pe), H.current.delete(pe)), de.current.delete(P), J.current.delete(P), F.current.has(P) && ie(P, []);
|
|
16911
16911
|
}
|
|
16912
|
-
|
|
16912
|
+
be();
|
|
16913
16913
|
},
|
|
16914
|
-
[
|
|
16914
|
+
[be, ie]
|
|
16915
16915
|
);
|
|
16916
16916
|
We(() => () => {
|
|
16917
16917
|
var P;
|
|
@@ -16979,12 +16979,12 @@ function Nk(e) {
|
|
|
16979
16979
|
const bt = (P, L) => {
|
|
16980
16980
|
var pe;
|
|
16981
16981
|
if (!R || L === void 0) return;
|
|
16982
|
-
const j = (pe = ht.get(P)) == null ? void 0 : pe.find((
|
|
16982
|
+
const j = (pe = ht.get(P)) == null ? void 0 : pe.find((Pe) => Pe.property === L), K = Be(P);
|
|
16983
16983
|
return j && !j.anchor && K ? K.y - K.h / 2 + j.top + j.height / 2 : void 0;
|
|
16984
16984
|
}, At = (P, L) => {
|
|
16985
|
-
var pe,
|
|
16985
|
+
var pe, Pe;
|
|
16986
16986
|
if (L === void 0) return;
|
|
16987
|
-
const j = (
|
|
16987
|
+
const j = (Pe = (pe = ht.get(P)) == null ? void 0 : pe.find((_e) => _e.property === L)) == null ? void 0 : Pe.anchor, K = Be(P);
|
|
16988
16988
|
return j && K ? {
|
|
16989
16989
|
x: K.x - K.w / 2 + j.x,
|
|
16990
16990
|
y: K.y - K.h / 2 + j.y,
|
|
@@ -17044,8 +17044,8 @@ function Nk(e) {
|
|
|
17044
17044
|
() => K.classList.remove("flow-sdk-busy"),
|
|
17045
17045
|
150
|
|
17046
17046
|
)), P === null && (P = requestAnimationFrame(() => {
|
|
17047
|
-
var pe,
|
|
17048
|
-
P = null, (
|
|
17047
|
+
var pe, Pe;
|
|
17048
|
+
P = null, (Pe = (pe = k.current).onViewportChange) == null || Pe.call(pe, I.state);
|
|
17049
17049
|
}));
|
|
17050
17050
|
});
|
|
17051
17051
|
return () => {
|
|
@@ -17055,15 +17055,15 @@ function Nk(e) {
|
|
|
17055
17055
|
const P = E.current;
|
|
17056
17056
|
if (!P) return;
|
|
17057
17057
|
const L = () => {
|
|
17058
|
-
var
|
|
17058
|
+
var _e;
|
|
17059
17059
|
if (!P.getClientRects().length) return;
|
|
17060
17060
|
let K = P.clientWidth, pe = P.clientHeight;
|
|
17061
17061
|
pe || (pe = Math.max(
|
|
17062
17062
|
0,
|
|
17063
17063
|
window.innerHeight - P.getBoundingClientRect().top - 100
|
|
17064
17064
|
), pe && (P.style.height = `${pe}px`)), K || (K = window.innerWidth, K && (P.style.width = `${K}px`));
|
|
17065
|
-
const
|
|
17066
|
-
I.size = { w: K, h: pe },
|
|
17065
|
+
const Pe = I.size.w !== K || I.size.h !== pe;
|
|
17066
|
+
I.size = { w: K, h: pe }, Pe && ((_e = st.current) != null && _e.options.fill) && (!ne.current && K > 0 && pe > 0 ? re() : be()), !ne.current && !te.current.size && k.current.fitOnInit !== !1 && (I.set({ x: K / 2, y: pe / 2 }), zt());
|
|
17067
17067
|
};
|
|
17068
17068
|
if (L(), typeof ResizeObserver > "u") return;
|
|
17069
17069
|
const j = new ResizeObserver(L);
|
|
@@ -17122,29 +17122,29 @@ function Nk(e) {
|
|
|
17122
17122
|
viewportSize: { ...I.size }
|
|
17123
17123
|
};
|
|
17124
17124
|
}, j = (Z) => pf(Z, k.current.nodes, k.current.edges), K = (Z, X = !0, ge = () => {
|
|
17125
|
-
}, le,
|
|
17126
|
-
clearTimeout(Ke.current), clearTimeout(Ue.current), we || (
|
|
17127
|
-
const
|
|
17125
|
+
}, le, je, we = !1) => {
|
|
17126
|
+
clearTimeout(Ke.current), clearTimeout(Ue.current), we || (me.current = null), Fe.current = null, Me.current = !1, tr.current = [], rr.current = !1;
|
|
17127
|
+
const Se = X && !k.current.isPerformanceMode && !k.current.disableAnimations, Qe = I.coordinate(() => {
|
|
17128
17128
|
var ct;
|
|
17129
|
-
le ? le(
|
|
17129
|
+
le ? le(Se) : we && ((ct = me.current) == null || ct.call(me, Z));
|
|
17130
17130
|
});
|
|
17131
17131
|
$(
|
|
17132
17132
|
new Map([...Z].map(([ct, ut]) => [ct, { ...ut }])),
|
|
17133
|
-
|
|
17134
|
-
|
|
17133
|
+
Se,
|
|
17134
|
+
Qe,
|
|
17135
17135
|
ge,
|
|
17136
|
-
|
|
17136
|
+
je
|
|
17137
17137
|
);
|
|
17138
|
-
}, pe = (Z, X = 50, ge = k.current.animateViewport, le = 1,
|
|
17139
|
-
const
|
|
17138
|
+
}, pe = (Z, X = 50, ge = k.current.animateViewport, le = 1, je = !1, we) => {
|
|
17139
|
+
const Se = (Qe) => {
|
|
17140
17140
|
const ct = M.current, ut = Z ?? new Set(ct.nodes.map((St) => St.id)), dr = new Set(
|
|
17141
17141
|
ct.nodes.map((St) => St.parent).filter(Boolean)
|
|
17142
17142
|
);
|
|
17143
|
-
if (!
|
|
17143
|
+
if (!Qe && (!Z || [...Z].some((St) => dr.has(St))))
|
|
17144
17144
|
return;
|
|
17145
|
-
const xr =
|
|
17145
|
+
const xr = Qe && Kd(
|
|
17146
17146
|
ct.nodes,
|
|
17147
|
-
|
|
17147
|
+
Qe,
|
|
17148
17148
|
J.current,
|
|
17149
17149
|
(St) => k.current.containerStyle(St).padding,
|
|
17150
17150
|
Oe
|
|
@@ -17152,7 +17152,7 @@ function Nk(e) {
|
|
|
17152
17152
|
[...ut].flatMap((St) => {
|
|
17153
17153
|
const fr = xr == null ? void 0 : xr.get(St);
|
|
17154
17154
|
if (fr) return [[St, fr]];
|
|
17155
|
-
const nr =
|
|
17155
|
+
const nr = Qe == null ? void 0 : Qe.get(St), Ir = J.current.get(St) || xo, Bu = nr ? { ...nr, ...Ir } : Be(St);
|
|
17156
17156
|
return Bu ? [[St, hr(Bu)]] : [];
|
|
17157
17157
|
})
|
|
17158
17158
|
);
|
|
@@ -17175,28 +17175,35 @@ function Nk(e) {
|
|
|
17175
17175
|
le
|
|
17176
17176
|
);
|
|
17177
17177
|
};
|
|
17178
|
-
|
|
17179
|
-
},
|
|
17178
|
+
me.current = je ? Se : null, je || Se(te.current);
|
|
17179
|
+
}, Pe = (Z, X, ge, le) => {
|
|
17180
17180
|
var we;
|
|
17181
17181
|
if (!Be(Z)) return;
|
|
17182
|
-
const
|
|
17183
|
-
if (X === "connections" && Ut.current === 1.25 && ((we = mt.current) == null ? void 0 : we.size) ===
|
|
17182
|
+
const je = X === "connections" ? Ee(Z) : j(Z);
|
|
17183
|
+
if (X === "connections" && Ut.current === 1.25 && ((we = mt.current) == null ? void 0 : we.size) === je.size && [...je].every((Se) => mt.current.has(Se))) {
|
|
17184
17184
|
S({ id: Z, mode: X });
|
|
17185
17185
|
return;
|
|
17186
17186
|
}
|
|
17187
|
-
br.current || (br.current = {
|
|
17187
|
+
if (br.current || (br.current = {
|
|
17188
17188
|
pan: { ...I.pan },
|
|
17189
17189
|
zoom: I.zoom
|
|
17190
|
-
}), mt.current =
|
|
17191
|
-
|
|
17192
|
-
|
|
17193
|
-
|
|
17190
|
+
}), mt.current = je, k.current.compactPropertyLayout) {
|
|
17191
|
+
Me.current = !1, pe(mt.current ?? je, ge, le, 1, !0);
|
|
17192
|
+
const Se = me.current;
|
|
17193
|
+
Se && (me.current = (Qe) => {
|
|
17194
|
+
me.current = null, tt.current = void 0, Se(Qe);
|
|
17195
|
+
});
|
|
17196
|
+
}
|
|
17197
|
+
S({ id: Z, mode: X }), k.current.compactPropertyLayout || pe(je, ge, le);
|
|
17198
|
+
}, _e = (Z) => {
|
|
17199
|
+
Fe.current ? Fe.current = Z : Z();
|
|
17200
|
+
}, Ee = (Z) => wf(Z, k.current.nodes, k.current.edges), ot = ((Z) => {
|
|
17194
17201
|
var X, ge, le;
|
|
17195
17202
|
if (Z === void 0) return I.zoom;
|
|
17196
|
-
Z < I.zoom && ((X = st.current) != null && X.options.fill) && !k.current.readOnly && ((le = (ge = k.current).onNodeGridZoomOut) == null ? void 0 : le.call(ge, st.current.options)) === !0 || (
|
|
17203
|
+
Z < I.zoom && ((X = st.current) != null && X.options.fill) && !k.current.readOnly && ((le = (ge = k.current).onNodeGridZoomOut) == null ? void 0 : le.call(ge, st.current.options)) === !0 || (me.current = null, I.set(void 0, Z));
|
|
17197
17204
|
}), Le = ((Z, X = !1) => {
|
|
17198
17205
|
if (Z === void 0) return I.pan;
|
|
17199
|
-
|
|
17206
|
+
me.current = null, X ? I.transition({ pan: Z, zoom: I.zoom }, !0) : I.set(Z);
|
|
17200
17207
|
}), De = (Z, X) => {
|
|
17201
17208
|
var le;
|
|
17202
17209
|
const ge = (le = E.current) == null ? void 0 : le.getBoundingClientRect();
|
|
@@ -17206,7 +17213,7 @@ function Nk(e) {
|
|
|
17206
17213
|
pe(void 0, Z, X, 1, !0);
|
|
17207
17214
|
return;
|
|
17208
17215
|
}
|
|
17209
|
-
|
|
17216
|
+
me.current = null, _e(() => {
|
|
17210
17217
|
const le = Lt();
|
|
17211
17218
|
le && I.fit(le, Z, X);
|
|
17212
17219
|
});
|
|
@@ -17214,42 +17221,42 @@ function Nk(e) {
|
|
|
17214
17221
|
return {
|
|
17215
17222
|
zoom: ot,
|
|
17216
17223
|
pan: Le,
|
|
17217
|
-
setEdgesVisible:
|
|
17218
|
-
focusNode: (Z, X, ge, le) =>
|
|
17224
|
+
setEdgesVisible: et,
|
|
17225
|
+
focusNode: (Z, X, ge, le) => _e(
|
|
17219
17226
|
() => pe(/* @__PURE__ */ new Set([Z]), X, ge, 0.6, le)
|
|
17220
17227
|
),
|
|
17221
|
-
focusBranch: (Z, X, ge, le,
|
|
17228
|
+
focusBranch: (Z, X, ge, le, je = !1, we = 1) => _e(
|
|
17222
17229
|
() => pe(
|
|
17223
17230
|
j(Z),
|
|
17224
17231
|
X,
|
|
17225
17232
|
ge,
|
|
17226
17233
|
we,
|
|
17227
17234
|
le,
|
|
17228
|
-
|
|
17235
|
+
je ? Z : void 0
|
|
17229
17236
|
)
|
|
17230
17237
|
),
|
|
17231
|
-
focusConnections: (Z, X, ge, le) =>
|
|
17232
|
-
() => pe(
|
|
17238
|
+
focusConnections: (Z, X, ge, le) => _e(
|
|
17239
|
+
() => pe(Ee(Z), X, ge, 1, le)
|
|
17233
17240
|
),
|
|
17234
|
-
isolateConnections: (Z, X, ge) =>
|
|
17235
|
-
isolateBranch: (Z, X, ge) =>
|
|
17241
|
+
isolateConnections: (Z, X, ge) => Pe(Z, "connections", X, ge),
|
|
17242
|
+
isolateBranch: (Z, X, ge) => Pe(Z, "branch", X, ge),
|
|
17236
17243
|
restoreView: (Z = k.current.animateViewport, X, ge = !1) => {
|
|
17237
|
-
|
|
17238
|
-
const le = ge && !st.current && !mt.current,
|
|
17244
|
+
me.current = null;
|
|
17245
|
+
const le = ge && !st.current && !mt.current, je = k.current.compactPropertyLayout && !!mt.current;
|
|
17239
17246
|
mt.current = null, S(null);
|
|
17240
17247
|
const we = X ?? br.current;
|
|
17241
|
-
br.current = null, we && le ? (Me.current = !1,
|
|
17248
|
+
br.current = null, we && le ? (Me.current = !1, Fe.current = null, xe.current = null, me.current = () => I.transition(we, Z), be()) : je ? Fe.current = () => {
|
|
17242
17249
|
we && I.transition(we, Z);
|
|
17243
|
-
} : we &&
|
|
17250
|
+
} : we && _e(() => I.transition(we, Z));
|
|
17244
17251
|
},
|
|
17245
17252
|
zoomAt: (Z, X) => {
|
|
17246
|
-
var ge, le,
|
|
17247
|
-
Z < I.zoom && ((ge = st.current) != null && ge.options.fill) && !k.current.readOnly && ((
|
|
17253
|
+
var ge, le, je;
|
|
17254
|
+
Z < I.zoom && ((ge = st.current) != null && ge.options.fill) && !k.current.readOnly && ((je = (le = k.current).onNodeGridZoomOut) == null ? void 0 : je.call(le, st.current.options)) === !0 || (me.current = null, I.zoomAt(Z, X));
|
|
17248
17255
|
},
|
|
17249
17256
|
fit: Re,
|
|
17250
17257
|
centerAndFit: Re,
|
|
17251
17258
|
center: (Z = k.current.animateViewport) => {
|
|
17252
|
-
|
|
17259
|
+
me.current = null;
|
|
17253
17260
|
const X = Lt();
|
|
17254
17261
|
X && I.center(X, Z);
|
|
17255
17262
|
},
|
|
@@ -17287,46 +17294,46 @@ function Nk(e) {
|
|
|
17287
17294
|
y: I.size.h / 2
|
|
17288
17295
|
})
|
|
17289
17296
|
);
|
|
17290
|
-
const
|
|
17291
|
-
ge.order = ge.order.filter((ut) =>
|
|
17292
|
-
const
|
|
17297
|
+
const Se = new Set(X.nodes.map((ut) => ut.id));
|
|
17298
|
+
ge.order = ge.order.filter((ut) => Se.has(ut));
|
|
17299
|
+
const Qe = new Set(ge.order);
|
|
17293
17300
|
ge.order.push(
|
|
17294
|
-
...X.nodes.filter((ut) => !
|
|
17301
|
+
...X.nodes.filter((ut) => !Qe.has(ut.id)).map((ut) => ut.id)
|
|
17295
17302
|
);
|
|
17296
17303
|
const ct = new Map(ge.order.map((ut, dr) => [ut, dr]));
|
|
17297
17304
|
X.nodes = [...X.nodes].sort(
|
|
17298
17305
|
(ut, dr) => ct.get(ut.id) - ct.get(dr.id)
|
|
17299
17306
|
);
|
|
17300
17307
|
}
|
|
17301
|
-
const le = Nd(X, P(Z)),
|
|
17302
|
-
if (
|
|
17308
|
+
const le = Nd(X, P(Z)), je = le.sizes ? JSON.stringify([[...le.positions], [...le.sizes]]) : void 0;
|
|
17309
|
+
if (je && je === ye.current && Z.animate !== !1 && !me.current)
|
|
17303
17310
|
return le;
|
|
17304
17311
|
Wr(le.dividers ?? []), ge && (ge.ready = !1);
|
|
17305
17312
|
const we = () => {
|
|
17306
|
-
ge && (ge.ready = !0), ge && X.nodes.length && !ne.current && (ne.current = !0, k.current.fitOnInit !== !1 && !Z.fill ? vt.centerAndFit(50, !1) : k.current.fitOnInit === !1 && I.transition(h, !1)), qe((
|
|
17313
|
+
ge && (ge.ready = !0), ge && X.nodes.length && !ne.current && (ne.current = !0, k.current.fitOnInit !== !1 && !Z.fill ? vt.centerAndFit(50, !1) : k.current.fitOnInit === !1 && I.transition(h, !1)), qe((Se) => Se + 1);
|
|
17307
17314
|
};
|
|
17308
|
-
return !le.sizes && he.current.size && U(), X.nodes.some((
|
|
17315
|
+
return !le.sizes && he.current.size && U(), X.nodes.some((Se) => !te.current.has(Se.id)) || le.movedNodeIds.length || le.bounds || me.current ? K(
|
|
17309
17316
|
le.positions,
|
|
17310
17317
|
Z.animate,
|
|
17311
17318
|
we,
|
|
17312
|
-
le.bounds && (!ge || !he.current.size) ? (
|
|
17319
|
+
le.bounds && (!ge || !he.current.size) ? (Se) => I.transition({ zoom: 1, pan: { x: 0, y: 0 } }, Se) : void 0,
|
|
17313
17320
|
le.sizes,
|
|
17314
17321
|
!!ge && !le.bounds
|
|
17315
|
-
) : we(), ye.current =
|
|
17322
|
+
) : we(), ye.current = je, le;
|
|
17316
17323
|
},
|
|
17317
17324
|
setNodeGridMode: (Z, X = {}) => {
|
|
17318
|
-
var ge, le,
|
|
17319
|
-
if (X.order && (!Array.isArray(X.order) || X.order.some((
|
|
17325
|
+
var ge, le, je, we;
|
|
17326
|
+
if (X.order && (!Array.isArray(X.order) || X.order.some((Se) => typeof Se != "string") || new Set(X.order).size !== X.order.length))
|
|
17320
17327
|
throw new Error("Invalid grid node order.");
|
|
17321
17328
|
if (Z) {
|
|
17322
17329
|
Nd(L(), P(X));
|
|
17323
|
-
const
|
|
17324
|
-
|
|
17330
|
+
const Se = !st.current || st.current.options.fill && !X.fill;
|
|
17331
|
+
me.current = null, st.current || (st.current = {
|
|
17325
17332
|
options: X,
|
|
17326
|
-
order: L().nodes.map((
|
|
17333
|
+
order: L().nodes.map((Qe) => Qe.id),
|
|
17327
17334
|
previousPositions: new Map(
|
|
17328
|
-
[...te.current].map(([
|
|
17329
|
-
|
|
17335
|
+
[...te.current].map(([Qe, ct]) => [
|
|
17336
|
+
Qe,
|
|
17330
17337
|
{ ...ct }
|
|
17331
17338
|
])
|
|
17332
17339
|
),
|
|
@@ -17336,26 +17343,26 @@ function Nk(e) {
|
|
|
17336
17343
|
},
|
|
17337
17344
|
previousSize: { ...I.size },
|
|
17338
17345
|
ready: !1
|
|
17339
|
-
}),
|
|
17346
|
+
}), Se && vt.centerAndFit(80, X.animate, !0), X.order && (st.current.order = [...X.order]), st.current.options = { ...X }, qt(!0), vt.arrangeNodesInGrid(X), (le = (ge = k.current).onNodeGridModeChange) == null || le.call(ge, {
|
|
17340
17347
|
...X,
|
|
17341
17348
|
order: [...st.current.order]
|
|
17342
17349
|
});
|
|
17343
17350
|
} else {
|
|
17344
|
-
const
|
|
17345
|
-
if (!
|
|
17346
|
-
if (I.size.w ===
|
|
17347
|
-
(ut) =>
|
|
17348
|
-
) ?
|
|
17349
|
-
|
|
17351
|
+
const Se = st.current;
|
|
17352
|
+
if (!Se) return;
|
|
17353
|
+
if (I.size.w === Se.previousSize.w && I.size.h === Se.previousSize.h && te.current.size === Se.previousPositions.size && [...te.current.keys()].every(
|
|
17354
|
+
(ut) => Se.previousPositions.has(ut)
|
|
17355
|
+
) ? me.current = () => I.transition(
|
|
17356
|
+
Se.previousViewport,
|
|
17350
17357
|
X.animate !== !1 && !k.current.disableAnimations && !k.current.isPerformanceMode
|
|
17351
|
-
) : vt.centerAndFit(80, X.animate, !0), st.current = null, qt(!1), U(), (we = (
|
|
17352
|
-
|
|
17358
|
+
) : vt.centerAndFit(80, X.animate, !0), st.current = null, qt(!1), U(), (we = (je = k.current).onNodeGridModeChange) == null || we.call(je, null), sr(null), !Se.previousPositions.size) {
|
|
17359
|
+
be();
|
|
17353
17360
|
return;
|
|
17354
17361
|
}
|
|
17355
17362
|
const ct = new Map(
|
|
17356
17363
|
[...te.current].map(([ut, dr]) => [
|
|
17357
17364
|
ut,
|
|
17358
|
-
|
|
17365
|
+
Se.previousPositions.get(ut) ?? dr
|
|
17359
17366
|
])
|
|
17360
17367
|
);
|
|
17361
17368
|
K(
|
|
@@ -17373,17 +17380,17 @@ function Nk(e) {
|
|
|
17373
17380
|
const le = st.current;
|
|
17374
17381
|
if (!le || !le.ready || k.current.readOnly || Z === X)
|
|
17375
17382
|
return !1;
|
|
17376
|
-
const
|
|
17377
|
-
if (!we || !
|
|
17378
|
-
const
|
|
17379
|
-
if (
|
|
17383
|
+
const je = L(), we = je.nodes.find((nr) => nr.id === Z), Se = je.nodes.find((nr) => nr.id === X);
|
|
17384
|
+
if (!we || !Se || we.parent !== Se.parent) return !1;
|
|
17385
|
+
const Qe = Nd(je, P(le.options));
|
|
17386
|
+
if (Qe.skippedNodeIds.includes(Z) || Qe.skippedNodeIds.includes(X))
|
|
17380
17387
|
return !1;
|
|
17381
17388
|
const ct = le.order.indexOf(Z), ut = le.order.indexOf(X);
|
|
17382
17389
|
if (ct < 0 || ut < 0) return !1;
|
|
17383
17390
|
[le.order[ct], le.order[ut]] = [
|
|
17384
17391
|
le.order[ut],
|
|
17385
17392
|
le.order[ct]
|
|
17386
|
-
],
|
|
17393
|
+
], me.current = null, le.options = { ...le.options, order: [...le.order] };
|
|
17387
17394
|
const dr = we.parent ?? "canvas", xr = (ur = (Tn = le.options.adjustment) == null ? void 0 : Tn.sections) == null ? void 0 : ur[dr];
|
|
17388
17395
|
return xr != null && xr.members && (le.options = {
|
|
17389
17396
|
...le.options,
|
|
@@ -17407,13 +17414,13 @@ function Nk(e) {
|
|
|
17407
17414
|
}), (fr = (St = k.current).onNodeGridModeChange) == null || fr.call(St, { ...le.options }), !0;
|
|
17408
17415
|
},
|
|
17409
17416
|
setNodePosition: (Z, X, ge) => {
|
|
17410
|
-
var
|
|
17417
|
+
var je, we, Se, Qe;
|
|
17411
17418
|
if (!te.current.has(Z) || X && (!Number.isFinite(X.x) || !Number.isFinite(X.y)))
|
|
17412
17419
|
return !1;
|
|
17413
17420
|
if (vr(), !X)
|
|
17414
|
-
return ee.current.delete(Z), (we = (
|
|
17421
|
+
return ee.current.delete(Z), (we = (je = k.current).onFixedNodePositionsChange) == null || we.call(je, Object.fromEntries(ee.current)), be(), !0;
|
|
17415
17422
|
const le = new Map(te.current);
|
|
17416
|
-
return le.set(Z, { ...X }), (ge == null ? void 0 : ge.persist) === !1 ? ee.current.delete(Z) : ee.current.set(Z, { ...X }), te.current = le, ce(le), (ge == null ? void 0 : ge.persist) !== !1 && ((
|
|
17423
|
+
return le.set(Z, { ...X }), (ge == null ? void 0 : ge.persist) === !1 ? ee.current.delete(Z) : ee.current.set(Z, { ...X }), te.current = le, ce(le), (ge == null ? void 0 : ge.persist) !== !1 && ((Qe = (Se = k.current).onFixedNodePositionsChange) == null || Qe.call(Se, Object.fromEntries(ee.current))), (ge == null ? void 0 : ge.persist) === !1 && be(), !0;
|
|
17417
17424
|
},
|
|
17418
17425
|
getFixedNodePositions: () => Object.fromEntries([...ee.current].map(([Z, X]) => [Z, { ...X }])),
|
|
17419
17426
|
onViewportChange: (Z) => I.onChange(Z)
|
|
@@ -17425,8 +17432,8 @@ function Nk(e) {
|
|
|
17425
17432
|
}, [vt]), We(() => {
|
|
17426
17433
|
var P, L;
|
|
17427
17434
|
if (Ce > 0) {
|
|
17428
|
-
const j =
|
|
17429
|
-
|
|
17435
|
+
const j = Fe.current;
|
|
17436
|
+
Fe.current = null, j == null || j(), (L = (P = k.current).onLayoutComplete) == null || L.call(P, vt);
|
|
17430
17437
|
}
|
|
17431
17438
|
}, [vt, Ce]);
|
|
17432
17439
|
const wt = fe(null), Et = fe(/* @__PURE__ */ new Map()), cr = fe(!1), [lr, Ht] = ae(null), [dt, Rr] = ae(null), Vr = (P) => {
|
|
@@ -17440,8 +17447,8 @@ function Nk(e) {
|
|
|
17440
17447
|
for (let K = j.length - 1; K >= 0; K--) {
|
|
17441
17448
|
const pe = j[K].id;
|
|
17442
17449
|
if (!Cr(pe, k.current.edges, k.current.edgeMode) || mt.current && !mt.current.has(pe) || pe === L || it.current.has(pe)) continue;
|
|
17443
|
-
const
|
|
17444
|
-
if (
|
|
17450
|
+
const Pe = Be(pe);
|
|
17451
|
+
if (Pe && gf(P, hr(Pe))) return pe;
|
|
17445
17452
|
}
|
|
17446
17453
|
for (const [K, pe] of it.current)
|
|
17447
17454
|
if (Cr(K, k.current.edges, k.current.edgeMode) && !(mt.current && !mt.current.has(K)) && K !== L && gf(P, pe))
|
|
@@ -17449,7 +17456,7 @@ function Nk(e) {
|
|
|
17449
17456
|
return null;
|
|
17450
17457
|
}, In = (P, L) => {
|
|
17451
17458
|
const j = k.current.nodes.find(
|
|
17452
|
-
(
|
|
17459
|
+
(Ee) => Ee.id === P
|
|
17453
17460
|
), K = Be(P);
|
|
17454
17461
|
if (!j || !K) return null;
|
|
17455
17462
|
const pe = hr({
|
|
@@ -17457,15 +17464,15 @@ function Nk(e) {
|
|
|
17457
17464
|
x: K.x + L.x,
|
|
17458
17465
|
y: K.y + L.y
|
|
17459
17466
|
});
|
|
17460
|
-
let
|
|
17461
|
-
for (const
|
|
17462
|
-
if (
|
|
17463
|
-
|
|
17467
|
+
let Pe = null, _e = 0;
|
|
17468
|
+
for (const Ee of k.current.nodes) {
|
|
17469
|
+
if (Ee.id === P || Ee.parent !== j.parent || ee.current.has(Ee.id) || it.current.has(Ee.id) || !Cr(
|
|
17470
|
+
Ee.id,
|
|
17464
17471
|
k.current.edges,
|
|
17465
17472
|
k.current.edgeMode
|
|
17466
|
-
) || mt.current && !mt.current.has(
|
|
17473
|
+
) || mt.current && !mt.current.has(Ee.id))
|
|
17467
17474
|
continue;
|
|
17468
|
-
const ot = Be(
|
|
17475
|
+
const ot = Be(Ee.id);
|
|
17469
17476
|
if (!ot) continue;
|
|
17470
17477
|
const Le = hr(ot), De = Math.max(
|
|
17471
17478
|
0,
|
|
@@ -17474,9 +17481,9 @@ function Nk(e) {
|
|
|
17474
17481
|
0,
|
|
17475
17482
|
Math.min(pe.y2, Le.y2) - Math.max(pe.y1, Le.y1)
|
|
17476
17483
|
);
|
|
17477
|
-
De >
|
|
17484
|
+
De > _e && (_e = De, Pe = Ee.id);
|
|
17478
17485
|
}
|
|
17479
|
-
return
|
|
17486
|
+
return Pe;
|
|
17480
17487
|
}, Nn = (P, L) => {
|
|
17481
17488
|
const j = st.current;
|
|
17482
17489
|
if (!(j != null && j.ready) || k.current.readOnly) return;
|
|
@@ -17488,22 +17495,22 @@ function Nk(e) {
|
|
|
17488
17495
|
) && (!mt.current || mt.current.has(De.id))
|
|
17489
17496
|
), pe = K.find((De) => De.id === P);
|
|
17490
17497
|
if (!pe) return;
|
|
17491
|
-
const
|
|
17498
|
+
const Pe = E.current, _e = I.zoom * (Pe && Pe.clientWidth ? Pe.getBoundingClientRect().width / Pe.clientWidth : 1), Ee = 24 / _e;
|
|
17492
17499
|
let ot;
|
|
17493
17500
|
for (const De of K) {
|
|
17494
17501
|
if (De.id === P || De.parent !== pe.parent) continue;
|
|
17495
17502
|
const Re = Be(De.id);
|
|
17496
17503
|
if (!Re) continue;
|
|
17497
|
-
const Z = hr(Re), X = Math.min(Re.w / 4,
|
|
17504
|
+
const Z = hr(Re), X = Math.min(Re.w / 4, Ee), ge = Math.min(Re.h / 4, Ee), le = 3 / _e, je = [];
|
|
17498
17505
|
if (L.y > Z.y1 + ge && L.y < Z.y2 - ge)
|
|
17499
17506
|
for (const we of ["before", "after"]) {
|
|
17500
|
-
const
|
|
17501
|
-
|
|
17507
|
+
const Se = we === "before" ? Z.x1 : Z.x2, Qe = Math.abs(L.x - Se), ct = we === "before" ? L.x < Se : L.x > Se;
|
|
17508
|
+
Qe <= (ct ? Ee : X) && je.push({
|
|
17502
17509
|
side: we,
|
|
17503
|
-
distance:
|
|
17510
|
+
distance: Qe,
|
|
17504
17511
|
marker: {
|
|
17505
|
-
x1:
|
|
17506
|
-
x2:
|
|
17512
|
+
x1: Se - le / 2,
|
|
17513
|
+
x2: Se + le / 2,
|
|
17507
17514
|
y1: Z.y1,
|
|
17508
17515
|
y2: Z.y2
|
|
17509
17516
|
}
|
|
@@ -17511,19 +17518,19 @@ function Nk(e) {
|
|
|
17511
17518
|
}
|
|
17512
17519
|
if (L.x >= Z.x1 && L.x <= Z.x2)
|
|
17513
17520
|
for (const we of ["above", "below"]) {
|
|
17514
|
-
const
|
|
17515
|
-
|
|
17521
|
+
const Se = we === "above" ? Z.y1 : Z.y2, Qe = Math.abs(L.y - Se), ct = we === "above" ? L.y < Se : L.y > Se;
|
|
17522
|
+
Qe <= (ct ? Ee : ge) && je.push({
|
|
17516
17523
|
side: we,
|
|
17517
|
-
distance:
|
|
17524
|
+
distance: Qe,
|
|
17518
17525
|
marker: {
|
|
17519
17526
|
x1: Z.x1,
|
|
17520
17527
|
x2: Z.x2,
|
|
17521
|
-
y1:
|
|
17522
|
-
y2:
|
|
17528
|
+
y1: Se - le / 2,
|
|
17529
|
+
y2: Se + le / 2
|
|
17523
17530
|
}
|
|
17524
17531
|
});
|
|
17525
17532
|
}
|
|
17526
|
-
for (const we of
|
|
17533
|
+
for (const we of je)
|
|
17527
17534
|
(!ot || we.distance < ot.distance) && (ot = { id: De.id, ...we });
|
|
17528
17535
|
}
|
|
17529
17536
|
if (!ot) return;
|
|
@@ -17548,29 +17555,29 @@ function Nk(e) {
|
|
|
17548
17555
|
return null;
|
|
17549
17556
|
const j = k.current.direction === "RL", K = Math.max(16, 6 / I.zoom);
|
|
17550
17557
|
let pe = null;
|
|
17551
|
-
for (const
|
|
17558
|
+
for (const Pe of [...k.current.nodes].reverse()) {
|
|
17552
17559
|
if (!Cr(
|
|
17553
|
-
|
|
17560
|
+
Pe.id,
|
|
17554
17561
|
k.current.edges,
|
|
17555
17562
|
k.current.edgeMode
|
|
17556
|
-
) || mt.current && !mt.current.has(
|
|
17563
|
+
) || mt.current && !mt.current.has(Pe.id))
|
|
17557
17564
|
continue;
|
|
17558
|
-
const
|
|
17559
|
-
if (!
|
|
17560
|
-
const ot =
|
|
17561
|
-
for (const Le of
|
|
17565
|
+
const _e = Be(Pe.id), Ee = F.current.get(Pe.id);
|
|
17566
|
+
if (!_e || !Ee || it.current.has(Pe.id)) continue;
|
|
17567
|
+
const ot = _e.x + (L === "source" !== j ? 1 : -1) * _e.w / 2;
|
|
17568
|
+
for (const Le of Ee) {
|
|
17562
17569
|
if (Le.role && Le.role !== L) continue;
|
|
17563
|
-
const De =
|
|
17564
|
-
P.x - (Le.anchor ?
|
|
17570
|
+
const De = _e.y - _e.h / 2 + Le.top, Re = Math.hypot(
|
|
17571
|
+
P.x - (Le.anchor ? _e.x - _e.w / 2 + Le.anchor.x : ot),
|
|
17565
17572
|
P.y - De - Le.height / 2
|
|
17566
17573
|
);
|
|
17567
|
-
if (!Le.anchor && P.x >=
|
|
17568
|
-
Re <= K && (!pe || Re < pe.distance) && (pe = { nodeId:
|
|
17574
|
+
if (!Le.anchor && P.x >= _e.x - _e.w / 2 && P.x <= _e.x + _e.w / 2 && P.y >= De && P.y <= De + Le.height) return { nodeId: Pe.id, property: Le.property };
|
|
17575
|
+
Re <= K && (!pe || Re < pe.distance) && (pe = { nodeId: Pe.id, property: Le.property, distance: Re });
|
|
17569
17576
|
}
|
|
17570
17577
|
}
|
|
17571
17578
|
return pe;
|
|
17572
17579
|
}, q0 = (P) => {
|
|
17573
|
-
var
|
|
17580
|
+
var Ee, ot;
|
|
17574
17581
|
if (!P.currentTarget.contains(P.target) || (wt.current || (cr.current = !1), P.target.closest(".flow-sdk-canvas") !== P.currentTarget) || P.button !== 0) return;
|
|
17575
17582
|
const L = P.target;
|
|
17576
17583
|
if (L.closest(
|
|
@@ -17604,13 +17611,13 @@ function Nk(e) {
|
|
|
17604
17611
|
}, P.currentTarget.setPointerCapture(P.pointerId));
|
|
17605
17612
|
return;
|
|
17606
17613
|
}
|
|
17607
|
-
const pe = !st.current || !!j.nodeGridConnections,
|
|
17608
|
-
if ((!pe || !
|
|
17614
|
+
const pe = !st.current || !!j.nodeGridConnections, Pe = j.drawHandles && L.closest(".flow-sdk-handle"), _e = j.drawHandles && L.closest(".flow-sdk-property-port");
|
|
17615
|
+
if ((!pe || !Pe && !_e && (!j.drawMode || P.shiftKey)) && (st.current || P.shiftKey && (j.onNodeGridDrop || j.onNodeParentChange))) {
|
|
17609
17616
|
if (st.current && !st.current.ready || L.closest(
|
|
17610
17617
|
"button, input, textarea, select, a, [contenteditable=true], [data-flow-content]"
|
|
17611
17618
|
))
|
|
17612
17619
|
return;
|
|
17613
|
-
const Le = (
|
|
17620
|
+
const Le = (Ee = L.closest("[data-node-id]")) == null ? void 0 : Ee.dataset.nodeId;
|
|
17614
17621
|
if (Le && !ee.current.has(Le)) {
|
|
17615
17622
|
L.setPointerCapture(P.pointerId), wt.current = {
|
|
17616
17623
|
kind: "grid",
|
|
@@ -17624,15 +17631,15 @@ function Nk(e) {
|
|
|
17624
17631
|
}
|
|
17625
17632
|
if (Le) return;
|
|
17626
17633
|
}
|
|
17627
|
-
if (pe && (j.drawMode ||
|
|
17628
|
-
const Le = I.renderedToModel(K), De = j.drawMode ? ln(Le, "source") : null, Re =
|
|
17634
|
+
if (pe && (j.drawMode || Pe || _e)) {
|
|
17635
|
+
const Le = I.renderedToModel(K), De = j.drawMode ? ln(Le, "source") : null, Re = _e || Pe, Z = Re ? (ot = Re.closest("[data-node-id]")) == null ? void 0 : ot.dataset.nodeId : (De == null ? void 0 : De.nodeId) ?? wr(Le), X = _e ? _e.dataset.property : De == null ? void 0 : De.property;
|
|
17629
17636
|
if (Z) {
|
|
17630
17637
|
wt.current = {
|
|
17631
17638
|
kind: "draw",
|
|
17632
17639
|
pointerId: P.pointerId,
|
|
17633
17640
|
source: Z,
|
|
17634
17641
|
sourceProperty: X,
|
|
17635
|
-
reverse: (
|
|
17642
|
+
reverse: (_e == null ? void 0 : _e.dataset.portRole) === "target",
|
|
17636
17643
|
startClient: { x: P.clientX, y: P.clientY }
|
|
17637
17644
|
}, cr.current = !0, Rr({ source: Z, sourceProperty: X, point: Le, target: null }), P.currentTarget.setPointerCapture(P.pointerId);
|
|
17638
17645
|
return;
|
|
@@ -17640,7 +17647,7 @@ function Nk(e) {
|
|
|
17640
17647
|
}
|
|
17641
17648
|
L.closest(
|
|
17642
17649
|
".flow-sdk-node, .flow-sdk-container, .flow-sdk-edge, .flow-sdk-edge-label, .flow-sdk-container-label"
|
|
17643
|
-
) || (
|
|
17650
|
+
) || (me.current = null, j.multiSelect ? wt.current = {
|
|
17644
17651
|
kind: "box",
|
|
17645
17652
|
pointerId: P.pointerId,
|
|
17646
17653
|
start: K,
|
|
@@ -17658,51 +17665,51 @@ function Nk(e) {
|
|
|
17658
17665
|
moved: !1
|
|
17659
17666
|
}, P.currentTarget.setPointerCapture(P.pointerId));
|
|
17660
17667
|
}, L0 = (P) => {
|
|
17661
|
-
var K, pe,
|
|
17668
|
+
var K, pe, Pe;
|
|
17662
17669
|
const L = wt.current;
|
|
17663
17670
|
if (!L) return;
|
|
17664
17671
|
const j = Vr(P);
|
|
17665
17672
|
if (Et.current.has(P.pointerId) && Et.current.set(P.pointerId, j), L.kind === "pinch") {
|
|
17666
|
-
const
|
|
17667
|
-
if (!
|
|
17668
|
-
const
|
|
17673
|
+
const _e = Hm(Et.current);
|
|
17674
|
+
if (!_e) return;
|
|
17675
|
+
const Ee = Math.max(
|
|
17669
17676
|
I.minZoom,
|
|
17670
|
-
Math.min(I.maxZoom, L.zoom *
|
|
17677
|
+
Math.min(I.maxZoom, L.zoom * _e.distance / L.distance)
|
|
17671
17678
|
);
|
|
17672
|
-
if (
|
|
17679
|
+
if (Ee < I.zoom && ((K = st.current) != null && K.options.fill) && ((Pe = (pe = k.current).onNodeGridZoomOut) == null ? void 0 : Pe.call(pe, st.current.options)) === !0)
|
|
17673
17680
|
return;
|
|
17674
17681
|
I.set(
|
|
17675
17682
|
{
|
|
17676
|
-
x:
|
|
17677
|
-
y:
|
|
17683
|
+
x: _e.center.x - L.anchor.x * Ee,
|
|
17684
|
+
y: _e.center.y - L.anchor.y * Ee
|
|
17678
17685
|
},
|
|
17679
|
-
|
|
17686
|
+
Ee
|
|
17680
17687
|
);
|
|
17681
17688
|
return;
|
|
17682
17689
|
}
|
|
17683
17690
|
if (L.pointerId === P.pointerId)
|
|
17684
17691
|
switch (L.kind) {
|
|
17685
17692
|
case "grid": {
|
|
17686
|
-
const
|
|
17687
|
-
if (!L.moved && Math.hypot(
|
|
17688
|
-
L.moved || (vr(),
|
|
17689
|
-
const
|
|
17690
|
-
x:
|
|
17691
|
-
y:
|
|
17693
|
+
const _e = { x: j.x - L.start.x, y: j.y - L.start.y };
|
|
17694
|
+
if (!L.moved && Math.hypot(_e.x, _e.y) <= Td) return;
|
|
17695
|
+
L.moved || (vr(), me.current = null, I.cancelAnimation()), L.moved = !0, cr.current = !0, P.preventDefault();
|
|
17696
|
+
const Ee = {
|
|
17697
|
+
x: _e.x / I.zoom,
|
|
17698
|
+
y: _e.y / I.zoom
|
|
17692
17699
|
}, ot = !P.shiftKey && j.x >= 0 && j.y >= 0 && j.x <= I.size.w && j.y <= I.size.h ? Nn(L.source, I.renderedToModel(j)) : void 0;
|
|
17693
17700
|
sr({
|
|
17694
17701
|
source: L.source,
|
|
17695
|
-
offset:
|
|
17696
|
-
target: P.shiftKey || ot ? null : In(L.source,
|
|
17702
|
+
offset: Ee,
|
|
17703
|
+
target: P.shiftKey || ot ? null : In(L.source, Ee),
|
|
17697
17704
|
shiftKey: P.shiftKey,
|
|
17698
17705
|
insertion: ot
|
|
17699
17706
|
});
|
|
17700
17707
|
break;
|
|
17701
17708
|
}
|
|
17702
17709
|
case "pan": {
|
|
17703
|
-
const
|
|
17704
|
-
if (!L.moved && Math.hypot(
|
|
17705
|
-
L.moved = !0, cr.current = !0, I.set({ x: L.pan0.x +
|
|
17710
|
+
const _e = j.x - L.start.x, Ee = j.y - L.start.y;
|
|
17711
|
+
if (!L.moved && Math.hypot(_e, Ee) <= Td) return;
|
|
17712
|
+
L.moved = !0, cr.current = !0, I.set({ x: L.pan0.x + _e, y: L.pan0.y + Ee });
|
|
17706
17713
|
break;
|
|
17707
17714
|
}
|
|
17708
17715
|
case "tap": {
|
|
@@ -17719,27 +17726,27 @@ function Nk(e) {
|
|
|
17719
17726
|
break;
|
|
17720
17727
|
}
|
|
17721
17728
|
case "draw": {
|
|
17722
|
-
const
|
|
17729
|
+
const _e = I.renderedToModel(j), Ee = ln(_e, L.reverse ? "source" : "target");
|
|
17723
17730
|
Rr(
|
|
17724
|
-
L.reverse &&
|
|
17725
|
-
source:
|
|
17726
|
-
sourceProperty:
|
|
17727
|
-
point:
|
|
17731
|
+
L.reverse && Ee ? {
|
|
17732
|
+
source: Ee.nodeId,
|
|
17733
|
+
sourceProperty: Ee.property,
|
|
17734
|
+
point: _e,
|
|
17728
17735
|
target: L.source,
|
|
17729
17736
|
targetProperty: L.sourceProperty
|
|
17730
17737
|
} : {
|
|
17731
17738
|
source: L.source,
|
|
17732
17739
|
sourceProperty: L.sourceProperty,
|
|
17733
|
-
point:
|
|
17734
|
-
target: (
|
|
17735
|
-
targetProperty:
|
|
17740
|
+
point: _e,
|
|
17741
|
+
target: (Ee == null ? void 0 : Ee.nodeId) ?? wr(_e, L.source),
|
|
17742
|
+
targetProperty: Ee == null ? void 0 : Ee.property
|
|
17736
17743
|
}
|
|
17737
17744
|
);
|
|
17738
17745
|
break;
|
|
17739
17746
|
}
|
|
17740
17747
|
}
|
|
17741
17748
|
}, Ou = (P, L) => {
|
|
17742
|
-
var pe,
|
|
17749
|
+
var pe, Pe, _e, Ee, ot, Le, De, Re, Z, X, ge;
|
|
17743
17750
|
Et.current.delete(P.pointerId);
|
|
17744
17751
|
const j = wt.current;
|
|
17745
17752
|
if (!j) return;
|
|
@@ -17792,28 +17799,28 @@ function Nk(e) {
|
|
|
17792
17799
|
break;
|
|
17793
17800
|
if (P.shiftKey) {
|
|
17794
17801
|
const we = new Map(K.nodes.map((ct) => [ct.id, ct]));
|
|
17795
|
-
let
|
|
17802
|
+
let Se = wr(
|
|
17796
17803
|
I.renderedToModel(le),
|
|
17797
17804
|
j.source
|
|
17798
17805
|
);
|
|
17799
|
-
const
|
|
17800
|
-
for (;
|
|
17801
|
-
|
|
17802
|
-
if (
|
|
17803
|
-
let ct =
|
|
17806
|
+
const Qe = /* @__PURE__ */ new Set();
|
|
17807
|
+
for (; Se && !((Pe = we.get(Se)) != null && Pe.acceptsChildren) && !Qe.has(Se); )
|
|
17808
|
+
Qe.add(Se), Se = ((_e = we.get(Se)) == null ? void 0 : _e.parent) ?? null;
|
|
17809
|
+
if (Se && ((Ee = we.get(Se)) != null && Ee.acceptsChildren)) {
|
|
17810
|
+
let ct = Se;
|
|
17804
17811
|
const ut = /* @__PURE__ */ new Set();
|
|
17805
17812
|
for (; ct && !ut.has(ct); )
|
|
17806
17813
|
ut.add(ct), ct = (ot = we.get(ct)) == null ? void 0 : ot.parent;
|
|
17807
|
-
ut.has(j.source) || (Le = K.onNodeParentChange) == null || Le.call(K, j.source,
|
|
17814
|
+
ut.has(j.source) || (Le = K.onNodeParentChange) == null || Le.call(K, j.source, Se);
|
|
17808
17815
|
}
|
|
17809
17816
|
break;
|
|
17810
17817
|
}
|
|
17811
17818
|
if (!st.current) break;
|
|
17812
|
-
const
|
|
17819
|
+
const je = In(j.source, {
|
|
17813
17820
|
x: (le.x - j.start.x) / I.zoom,
|
|
17814
17821
|
y: (le.y - j.start.y) / I.zoom
|
|
17815
17822
|
});
|
|
17816
|
-
|
|
17823
|
+
je && vt.swapGridNodes(j.source, je, !1);
|
|
17817
17824
|
break;
|
|
17818
17825
|
}
|
|
17819
17826
|
case "pan":
|
|
@@ -17822,33 +17829,33 @@ function Nk(e) {
|
|
|
17822
17829
|
break;
|
|
17823
17830
|
case "box": {
|
|
17824
17831
|
if (Ht(null), L) break;
|
|
17825
|
-
const le = I.renderedToModel(j.start),
|
|
17826
|
-
x1: Math.min(le.x,
|
|
17827
|
-
y1: Math.min(le.y,
|
|
17828
|
-
x2: Math.max(le.x,
|
|
17829
|
-
y2: Math.max(le.y,
|
|
17832
|
+
const le = I.renderedToModel(j.start), je = I.renderedToModel(j.current), we = {
|
|
17833
|
+
x1: Math.min(le.x, je.x),
|
|
17834
|
+
y1: Math.min(le.y, je.y),
|
|
17835
|
+
x2: Math.max(le.x, je.x),
|
|
17836
|
+
y2: Math.max(le.y, je.y)
|
|
17830
17837
|
};
|
|
17831
17838
|
if (we.x2 - we.x1 < 1 && we.y2 - we.y1 < 1) {
|
|
17832
17839
|
(Re = K.onBackgroundTap) == null || Re.call(K);
|
|
17833
17840
|
break;
|
|
17834
17841
|
}
|
|
17835
|
-
const
|
|
17836
|
-
for (const
|
|
17837
|
-
const ct = Be(
|
|
17838
|
-
ct && TC(hr(ct), we) &&
|
|
17842
|
+
const Se = [];
|
|
17843
|
+
for (const Qe of K.nodes) {
|
|
17844
|
+
const ct = Be(Qe.id);
|
|
17845
|
+
ct && TC(hr(ct), we) && Se.push(Qe.id);
|
|
17839
17846
|
}
|
|
17840
|
-
|
|
17847
|
+
Se.length && ((Z = K.onBoxSelect) == null || Z.call(K, Se));
|
|
17841
17848
|
break;
|
|
17842
17849
|
}
|
|
17843
17850
|
case "draw": {
|
|
17844
17851
|
if (Rr(null), L) break;
|
|
17845
|
-
const le = Vr(P),
|
|
17846
|
-
if (
|
|
17852
|
+
const le = Vr(P), je = I.renderedToModel(le), we = ln(je, j.reverse ? "source" : "target"), Se = (we == null ? void 0 : we.nodeId) ?? wr(je);
|
|
17853
|
+
if (Se === j.source && (j.sourceProperty === void 0 || (we == null ? void 0 : we.property) === void 0 || we.property === j.sourceProperty))
|
|
17847
17854
|
break;
|
|
17848
|
-
|
|
17855
|
+
Se ? (X = K.onEdgeDraw) == null || X.call(
|
|
17849
17856
|
K,
|
|
17850
|
-
j.reverse ?
|
|
17851
|
-
j.reverse ? j.source :
|
|
17857
|
+
j.reverse ? Se : j.source,
|
|
17858
|
+
j.reverse ? j.source : Se,
|
|
17852
17859
|
j.sourceProperty !== void 0 || (we == null ? void 0 : we.property) !== void 0 ? {
|
|
17853
17860
|
sourceProperty: j.reverse ? we == null ? void 0 : we.property : j.sourceProperty,
|
|
17854
17861
|
targetProperty: j.reverse ? j.sourceProperty : we == null ? void 0 : we.property
|
|
@@ -17856,7 +17863,7 @@ function Nk(e) {
|
|
|
17856
17863
|
) : Math.max(
|
|
17857
17864
|
Math.abs(P.clientX - j.startClient.x),
|
|
17858
17865
|
Math.abs(P.clientY - j.startClient.y)
|
|
17859
|
-
) > Rk && ((ge = K.onDrawIntoSpace) == null || ge.call(K, j.source,
|
|
17866
|
+
) > Rk && ((ge = K.onDrawIntoSpace) == null || ge.call(K, j.source, je, j.sourceProperty, j.reverse));
|
|
17860
17867
|
break;
|
|
17861
17868
|
}
|
|
17862
17869
|
}
|
|
@@ -17964,7 +17971,7 @@ function Nk(e) {
|
|
|
17964
17971
|
);
|
|
17965
17972
|
}) }),
|
|
17966
17973
|
/* @__PURE__ */ y("g", { className: "flow-sdk-edges", children: pt && On && A.map((P) => {
|
|
17967
|
-
var K, pe,
|
|
17974
|
+
var K, pe, Pe;
|
|
17968
17975
|
if (!li.ready.has(P.id) || _ && (!_.has(P.source) || !_.has(P.target)))
|
|
17969
17976
|
return null;
|
|
17970
17977
|
const L = Mt(P.source, P.sourceProperty), j = Mt(P.target, P.targetProperty);
|
|
@@ -17991,7 +17998,7 @@ function Nk(e) {
|
|
|
17991
17998
|
dir: ci,
|
|
17992
17999
|
turn: ((K = di.get(P.id)) == null ? void 0 : K.turn) ?? P.turn,
|
|
17993
18000
|
labelAtTarget: (pe = di.get(P.id)) == null ? void 0 : pe.labelAtTarget,
|
|
17994
|
-
labelFraction: (
|
|
18001
|
+
labelFraction: (Pe = di.get(P.id)) == null ? void 0 : Pe.labelFraction,
|
|
17995
18002
|
color: P.color,
|
|
17996
18003
|
connectorColor: P.connectorColor,
|
|
17997
18004
|
labelBg: P.labelBg,
|
|
@@ -18062,24 +18069,24 @@ function Nk(e) {
|
|
|
18062
18069
|
}
|
|
18063
18070
|
),
|
|
18064
18071
|
r.map((P) => {
|
|
18065
|
-
var
|
|
18066
|
-
if ((
|
|
18072
|
+
var je, we, Se;
|
|
18073
|
+
if ((je = st.current) != null && je.options.fill && !ne.current)
|
|
18067
18074
|
return null;
|
|
18068
18075
|
const L = Q.get(P.id), j = nt.get(P.id);
|
|
18069
18076
|
if (j && P.label !== void 0) return null;
|
|
18070
|
-
const K = (L == null ? void 0 : L.x) ?? (j ? (j.x1 + j.x2) / 2 : 0), pe = (L == null ? void 0 : L.y) ?? (j ? (j.y1 + j.y2) / 2 : 0),
|
|
18071
|
-
x: ot.x -
|
|
18072
|
-
y: ot.y -
|
|
18077
|
+
const K = (L == null ? void 0 : L.x) ?? (j ? (j.x1 + j.x2) / 2 : 0), pe = (L == null ? void 0 : L.y) ?? (j ? (j.y1 + j.y2) / 2 : 0), Pe = Ge != null && Ge.target ? P.id === Ge.source ? Ge.target : P.id === Ge.target ? Ge.source : void 0 : void 0, _e = Pe ? Q.get(Pe) : void 0, Ee = Ge ? Q.get(Ge.source) : void 0, ot = Ge != null && Ge.target ? Q.get(Ge.target) : void 0, Le = Ee && ot ? {
|
|
18078
|
+
x: ot.x - Ee.x,
|
|
18079
|
+
y: ot.y - Ee.y
|
|
18073
18080
|
} : void 0, De = Le ? Le.x ** 2 + Le.y ** 2 : 0, Re = De && Ge && Le ? Math.max(
|
|
18074
18081
|
0,
|
|
18075
18082
|
Math.min(
|
|
18076
18083
|
1,
|
|
18077
18084
|
(Ge.offset.x * Le.x + Ge.offset.y * Le.y) / De
|
|
18078
18085
|
)
|
|
18079
|
-
) : 0, Z =
|
|
18080
|
-
x: K + (
|
|
18081
|
-
y: pe + (
|
|
18082
|
-
} : (Ge == null ? void 0 : Ge.source) === P.id ? { x: K + Ge.offset.x, y: pe + Ge.offset.y } : void 0, X = se.get(P.id), ge =
|
|
18086
|
+
) : 0, Z = _e ? {
|
|
18087
|
+
x: K + (_e.x - K) * Re,
|
|
18088
|
+
y: pe + (_e.y - pe) * Re
|
|
18089
|
+
} : (Ge == null ? void 0 : Ge.source) === P.id ? { x: K + Ge.offset.x, y: pe + Ge.offset.y } : void 0, X = se.get(P.id), ge = Pe ? se.get(Pe) : void 0, le = X && ge ? {
|
|
18083
18090
|
w: X.w + (ge.w - X.w) * Re,
|
|
18084
18091
|
h: X.h + (ge.h - X.h) * Re
|
|
18085
18092
|
} : X;
|
|
@@ -18100,13 +18107,13 @@ function Nk(e) {
|
|
|
18100
18107
|
} : void 0,
|
|
18101
18108
|
placed: !!L || !!j,
|
|
18102
18109
|
hidden: !Ct && !li.shown.has(P.id) || !Cr(P.id, t, i) || !!_ && !_.has(P.id),
|
|
18103
|
-
onMount:
|
|
18110
|
+
onMount: Ae,
|
|
18104
18111
|
drawHandles: e.drawHandles && !e.readOnly && On,
|
|
18105
18112
|
drawMode: g && On,
|
|
18106
18113
|
connectedPorts: new Set(
|
|
18107
|
-
A.flatMap((
|
|
18108
|
-
...
|
|
18109
|
-
...
|
|
18114
|
+
A.flatMap((Qe) => [
|
|
18115
|
+
...Qe.source === P.id && Qe.sourceProperty !== void 0 ? [`source:${Qe.sourceProperty}`] : [],
|
|
18116
|
+
...Qe.target === P.id && Qe.targetProperty !== void 0 ? [`target:${Qe.targetProperty}`] : []
|
|
18110
18117
|
])
|
|
18111
18118
|
),
|
|
18112
18119
|
hasCollapseControl: P.hasCollapseControl,
|
|
@@ -18116,7 +18123,7 @@ function Nk(e) {
|
|
|
18116
18123
|
animationWidth: P.animationWidth,
|
|
18117
18124
|
animationVariant: P.animationVariant,
|
|
18118
18125
|
width: (we = J.current.get(P.id)) == null ? void 0 : we.w,
|
|
18119
|
-
height: (
|
|
18126
|
+
height: (Se = J.current.get(P.id)) == null ? void 0 : Se.h,
|
|
18120
18127
|
propertyMode: R,
|
|
18121
18128
|
resolvedRows: ht.get(P.id),
|
|
18122
18129
|
reversePorts: n === "RL",
|
|
@@ -18611,7 +18618,7 @@ function zk({ nodeId: e }) {
|
|
|
18611
18618
|
!O || m || (x.current = E, h(O.data.id));
|
|
18612
18619
|
};
|
|
18613
18620
|
return v ? /* @__PURE__ */ D(
|
|
18614
|
-
|
|
18621
|
+
ke,
|
|
18615
18622
|
{
|
|
18616
18623
|
"data-content-gallery": "",
|
|
18617
18624
|
position: "relative",
|
|
@@ -18625,7 +18632,7 @@ function zk({ nodeId: e }) {
|
|
|
18625
18632
|
onPointerDown: (E) => E.stopPropagation(),
|
|
18626
18633
|
children: [
|
|
18627
18634
|
/* @__PURE__ */ y(
|
|
18628
|
-
|
|
18635
|
+
ke,
|
|
18629
18636
|
{
|
|
18630
18637
|
ref: g,
|
|
18631
18638
|
role: "toolbar",
|
|
@@ -18689,7 +18696,7 @@ function zk({ nodeId: e }) {
|
|
|
18689
18696
|
}
|
|
18690
18697
|
) }),
|
|
18691
18698
|
["width", "height"].map((E) => /* @__PURE__ */ D(
|
|
18692
|
-
|
|
18699
|
+
ke,
|
|
18693
18700
|
{
|
|
18694
18701
|
as: "label",
|
|
18695
18702
|
display: "flex",
|
|
@@ -18742,7 +18749,7 @@ function zk({ nodeId: e }) {
|
|
|
18742
18749
|
}
|
|
18743
18750
|
),
|
|
18744
18751
|
/* @__PURE__ */ y(
|
|
18745
|
-
|
|
18752
|
+
ke,
|
|
18746
18753
|
{
|
|
18747
18754
|
flex: 1,
|
|
18748
18755
|
minH: 0,
|
|
@@ -18750,7 +18757,7 @@ function zk({ nodeId: e }) {
|
|
|
18750
18757
|
position: "relative",
|
|
18751
18758
|
"data-content-slide-viewport": "",
|
|
18752
18759
|
children: /* @__PURE__ */ y(
|
|
18753
|
-
|
|
18760
|
+
ke,
|
|
18754
18761
|
{
|
|
18755
18762
|
ref: w,
|
|
18756
18763
|
"data-content-slide": v.data.id,
|
|
@@ -18779,7 +18786,7 @@ function zk({ nodeId: e }) {
|
|
|
18779
18786
|
)
|
|
18780
18787
|
]
|
|
18781
18788
|
}
|
|
18782
|
-
) : /* @__PURE__ */ y(
|
|
18789
|
+
) : /* @__PURE__ */ y(ke, { role: "status", p: 4, children: "No HTML or JSX content available." });
|
|
18783
18790
|
}
|
|
18784
18791
|
const jk = No(function({ fullscreen: r, onClick: t }, n) {
|
|
18785
18792
|
const { colorInactive: o } = ft();
|
|
@@ -18937,7 +18944,7 @@ function Fk({
|
|
|
18937
18944
|
}
|
|
18938
18945
|
),
|
|
18939
18946
|
/* @__PURE__ */ D(
|
|
18940
|
-
|
|
18947
|
+
ke,
|
|
18941
18948
|
{
|
|
18942
18949
|
ref: v,
|
|
18943
18950
|
position: "relative",
|
|
@@ -18975,7 +18982,7 @@ function Fk({
|
|
|
18975
18982
|
},
|
|
18976
18983
|
children: [
|
|
18977
18984
|
i && /* @__PURE__ */ y(
|
|
18978
|
-
|
|
18985
|
+
ke,
|
|
18979
18986
|
{
|
|
18980
18987
|
ref: A,
|
|
18981
18988
|
role: "toolbar",
|
|
@@ -19058,7 +19065,7 @@ function Fk({
|
|
|
19058
19065
|
}
|
|
19059
19066
|
),
|
|
19060
19067
|
M && /* @__PURE__ */ y(
|
|
19061
|
-
|
|
19068
|
+
ke,
|
|
19062
19069
|
{
|
|
19063
19070
|
role: "alert",
|
|
19064
19071
|
position: "absolute",
|
|
@@ -19077,7 +19084,7 @@ function Fk({
|
|
|
19077
19084
|
colorMode: a,
|
|
19078
19085
|
fillHeight: !n || _
|
|
19079
19086
|
}
|
|
19080
|
-
) : w ? /* @__PURE__ */ y(
|
|
19087
|
+
) : w ? /* @__PURE__ */ y(ke, { role: "status", fontSize: "14px", children: "JSX content renderer is not available." }) : null : oe != null && oe.error || q ? /* @__PURE__ */ y("pre", { role: "alert", style: { whiteSpace: "pre-wrap" }, children: (oe == null ? void 0 : oe.error) || "Content preview could not be loaded." }) : oe != null && oe.document ? /* @__PURE__ */ y(
|
|
19081
19088
|
"iframe",
|
|
19082
19089
|
{
|
|
19083
19090
|
ref: x,
|
|
@@ -19162,7 +19169,7 @@ function Iu({
|
|
|
19162
19169
|
W.current = !0, A !== S && (d ? d(G) : (oe = m.onNodeContentChange) == null || oe.call(m, e, G)), R(!1), u == null || u();
|
|
19163
19170
|
};
|
|
19164
19171
|
return (!_ || !w) && n !== "markdown" ? /* @__PURE__ */ y(
|
|
19165
|
-
|
|
19172
|
+
ke,
|
|
19166
19173
|
{
|
|
19167
19174
|
ref: I,
|
|
19168
19175
|
w: "100%",
|
|
@@ -19184,7 +19191,7 @@ function Iu({
|
|
|
19184
19191
|
)
|
|
19185
19192
|
}
|
|
19186
19193
|
) : !_ || !w ? /* @__PURE__ */ y(
|
|
19187
|
-
|
|
19194
|
+
ke,
|
|
19188
19195
|
{
|
|
19189
19196
|
"data-flow-content": "",
|
|
19190
19197
|
color: t,
|
|
@@ -19274,7 +19281,7 @@ function Iu({
|
|
|
19274
19281
|
onKeyDown: (G) => {
|
|
19275
19282
|
w && (x || G.shiftKey) && G.key === "Enter" && G.target === G.currentTarget && (G.preventDefault(), G.stopPropagation(), J(G.currentTarget, G.shiftKey));
|
|
19276
19283
|
},
|
|
19277
|
-
children: c ? /* @__PURE__ */ y(
|
|
19284
|
+
children: c ? /* @__PURE__ */ y(ke, { whiteSpace: "pre-wrap", minH: "100%", children: S || (w ? l : "") }) : /* @__PURE__ */ y(
|
|
19278
19285
|
Lw,
|
|
19279
19286
|
{
|
|
19280
19287
|
options: {
|
|
@@ -19349,7 +19356,7 @@ function Iu({
|
|
|
19349
19356
|
resize: "none"
|
|
19350
19357
|
}
|
|
19351
19358
|
),
|
|
19352
|
-
M && /* @__PURE__ */ y(
|
|
19359
|
+
M && /* @__PURE__ */ y(ke, { role: "alert", fontSize: "14px", color: "red.500", children: M })
|
|
19353
19360
|
]
|
|
19354
19361
|
}
|
|
19355
19362
|
);
|
|
@@ -19389,7 +19396,7 @@ function Zm({
|
|
|
19389
19396
|
].filter((m) => !!m).join(`
|
|
19390
19397
|
`);
|
|
19391
19398
|
return !o && !s || !o && !n ? null : /* @__PURE__ */ D(
|
|
19392
|
-
|
|
19399
|
+
ke,
|
|
19393
19400
|
{
|
|
19394
19401
|
"data-flow-node-subtitles": "",
|
|
19395
19402
|
color: t,
|
|
@@ -19463,22 +19470,22 @@ const Dk = ({
|
|
|
19463
19470
|
'dialog[open], :popover-open, [role="dialog"], [role="menu"], [role="listbox"]'
|
|
19464
19471
|
)
|
|
19465
19472
|
).some(
|
|
19466
|
-
(
|
|
19473
|
+
(et) => et.getClientRects().length && getComputedStyle(et).visibility !== "hidden"
|
|
19467
19474
|
))
|
|
19468
19475
|
return;
|
|
19469
|
-
const
|
|
19476
|
+
const Fe = Array.from(
|
|
19470
19477
|
((tt = _.current) == null ? void 0 : tt.querySelectorAll(
|
|
19471
19478
|
"[data-flow-content-toggle] button, button[data-flow-collapse-control]"
|
|
19472
19479
|
)) ?? []
|
|
19473
19480
|
).find(
|
|
19474
|
-
(
|
|
19481
|
+
(et) => {
|
|
19475
19482
|
var Ct;
|
|
19476
|
-
return ((Ct =
|
|
19483
|
+
return ((Ct = et.closest("[data-node-id]")) == null ? void 0 : Ct.getAttribute("data-node-id")) === T && !et.disabled && et.getClientRects().length && getComputedStyle(et).visibility !== "hidden";
|
|
19477
19484
|
}
|
|
19478
|
-
),
|
|
19479
|
-
(
|
|
19485
|
+
), me = !Fe && (e == null ? void 0 : e.type) === "grid" && ((yt = e.config) == null ? void 0 : yt.documentId) && ((Ie = _.current) == null ? void 0 : Ie.getClientRects().length) && p.onNodeHoverAction && ((Ye = g.nodeOverlayActions) == null ? void 0 : Ye.find(
|
|
19486
|
+
(et) => et.id === "open-document" && (!et.nodeTypes || et.nodeTypes.includes(e.type))
|
|
19480
19487
|
));
|
|
19481
|
-
!
|
|
19488
|
+
!Fe && !me || (Me.preventDefault(), Me.stopPropagation(), Me.repeat || (Fe ? Fe.click() : (pt = p.onNodeHoverAction) == null || pt.call(p, me.id, T, e)));
|
|
19482
19489
|
};
|
|
19483
19490
|
return window.addEventListener("keydown", ye, !0), () => window.removeEventListener("keydown", ye, !0);
|
|
19484
19491
|
}, [
|
|
@@ -19504,10 +19511,10 @@ const Dk = ({
|
|
|
19504
19511
|
}
|
|
19505
19512
|
})(), B = gt(
|
|
19506
19513
|
(ye, Me = !1) => {
|
|
19507
|
-
var
|
|
19508
|
-
if (M || g.readOnly || f != null && f.fill && !ye.shiftKey || ye.detail === 2 && ((
|
|
19514
|
+
var me, tt, yt, Ie, Ye;
|
|
19515
|
+
if (M || g.readOnly || f != null && f.fill && !ye.shiftKey || ye.detail === 2 && ((me = e == null ? void 0 : e.config) != null && me.form) && !o && !Me && !u && !l && !ye.shiftKey && !ye.ctrlKey && !ye.metaKey && !ye.altKey && a.length === 1 && a[0] === T)
|
|
19509
19516
|
return;
|
|
19510
|
-
const
|
|
19517
|
+
const Fe = {
|
|
19511
19518
|
shiftKey: ye.shiftKey,
|
|
19512
19519
|
ctrlKey: ye.ctrlKey,
|
|
19513
19520
|
metaKey: ye.metaKey,
|
|
@@ -19515,10 +19522,10 @@ const Dk = ({
|
|
|
19515
19522
|
...Me ? { viewToggle: !0 } : {}
|
|
19516
19523
|
};
|
|
19517
19524
|
if (l && (d(null), (tt = p.onEdgeDeselect) == null || tt.call(p)), u || ye.shiftKey && (f != null && f.fill)) {
|
|
19518
|
-
const pt = a.includes(T),
|
|
19519
|
-
c(
|
|
19525
|
+
const pt = a.includes(T), et = pt ? a.filter((Ct) => Ct !== T) : [...a, T];
|
|
19526
|
+
c(et), pt ? (yt = p.onNodeDeselect) == null || yt.call(p) : (Ie = p.onNodeSelect) == null || Ie.call(p, T, e, Fe);
|
|
19520
19527
|
} else
|
|
19521
|
-
c([T]), (Ye = p.onNodeSelect) == null || Ye.call(p, T, e,
|
|
19528
|
+
c([T]), (Ye = p.onNodeSelect) == null || Ye.call(p, T, e, Fe);
|
|
19522
19529
|
},
|
|
19523
19530
|
[
|
|
19524
19531
|
T,
|
|
@@ -19589,7 +19596,7 @@ const Dk = ({
|
|
|
19589
19596
|
}
|
|
19590
19597
|
), ve = Array.isArray((ne = e == null ? void 0 : e.config) == null ? void 0 : ne.ports) ? e.config.ports.map((ye) => /* @__PURE__ */ y(Tk, { ...ye }, `${ye.id}:${ye.role}`)) : null;
|
|
19591
19598
|
return n ? /* @__PURE__ */ D(
|
|
19592
|
-
|
|
19599
|
+
ke,
|
|
19593
19600
|
{
|
|
19594
19601
|
ref: _,
|
|
19595
19602
|
...te,
|
|
@@ -19603,7 +19610,7 @@ const Dk = ({
|
|
|
19603
19610
|
se,
|
|
19604
19611
|
!h && (de || J && J.length > 0) && A && !q && /* @__PURE__ */ D(He, { children: [
|
|
19605
19612
|
/* @__PURE__ */ y(
|
|
19606
|
-
|
|
19613
|
+
ke,
|
|
19607
19614
|
{
|
|
19608
19615
|
position: "absolute",
|
|
19609
19616
|
top: -150,
|
|
@@ -19616,7 +19623,7 @@ const Dk = ({
|
|
|
19616
19623
|
}
|
|
19617
19624
|
),
|
|
19618
19625
|
de ? /* @__PURE__ */ y(
|
|
19619
|
-
|
|
19626
|
+
ke,
|
|
19620
19627
|
{
|
|
19621
19628
|
position: "absolute",
|
|
19622
19629
|
zIndex: 1e3,
|
|
@@ -19638,7 +19645,7 @@ const Dk = ({
|
|
|
19638
19645
|
})
|
|
19639
19646
|
}
|
|
19640
19647
|
) : /* @__PURE__ */ y(
|
|
19641
|
-
|
|
19648
|
+
ke,
|
|
19642
19649
|
{
|
|
19643
19650
|
position: "absolute",
|
|
19644
19651
|
zIndex: 1e3,
|
|
@@ -19671,9 +19678,9 @@ const Dk = ({
|
|
|
19671
19678
|
}
|
|
19672
19679
|
} : void 0,
|
|
19673
19680
|
children: [
|
|
19674
|
-
J.map((ye, Me) => /* @__PURE__ */ D(
|
|
19681
|
+
J.map((ye, Me) => /* @__PURE__ */ D(ke, { display: "contents", children: [
|
|
19675
19682
|
Me > 0 && /* @__PURE__ */ y(
|
|
19676
|
-
|
|
19683
|
+
ke,
|
|
19677
19684
|
{
|
|
19678
19685
|
borderColor: C,
|
|
19679
19686
|
height: 5,
|
|
@@ -19690,9 +19697,9 @@ const Dk = ({
|
|
|
19690
19697
|
borderColor: C,
|
|
19691
19698
|
textColor: S,
|
|
19692
19699
|
boxSize: 5,
|
|
19693
|
-
onClick: (
|
|
19694
|
-
var
|
|
19695
|
-
|
|
19700
|
+
onClick: (Fe) => {
|
|
19701
|
+
var me;
|
|
19702
|
+
Fe.stopPropagation(), (me = p.onNodeHoverAction) == null || me.call(
|
|
19696
19703
|
p,
|
|
19697
19704
|
ye.id,
|
|
19698
19705
|
T,
|
|
@@ -19722,7 +19729,7 @@ const Dk = ({
|
|
|
19722
19729
|
}),
|
|
19723
19730
|
/* @__PURE__ */ y(Zm, { data: e }),
|
|
19724
19731
|
W && !((Ce = e == null ? void 0 : e.config) != null && Ce.parentContainer) && ((qe = e == null ? void 0 : e.config) == null ? void 0 : qe.collapsed) !== void 0 && (() => {
|
|
19725
|
-
var
|
|
19732
|
+
var Fe;
|
|
19726
19733
|
const ye = w === "TB" || w === "BT", Me = t || w === "RL";
|
|
19727
19734
|
return /* @__PURE__ */ y(
|
|
19728
19735
|
qd,
|
|
@@ -19741,12 +19748,12 @@ const Dk = ({
|
|
|
19741
19748
|
"data-flow-collapse-control": "",
|
|
19742
19749
|
"aria-label": e.config.collapsed ? "Expand" : "Collapse",
|
|
19743
19750
|
disabled: g.readOnly,
|
|
19744
|
-
onClick: (
|
|
19751
|
+
onClick: (me) => {
|
|
19745
19752
|
var tt;
|
|
19746
|
-
|
|
19753
|
+
me.stopPropagation(), (tt = p.onNodeCollapse) == null || tt.call(p, T, !e.config.collapsed);
|
|
19747
19754
|
},
|
|
19748
19755
|
bgColor: Te(
|
|
19749
|
-
((
|
|
19756
|
+
((Fe = e == null ? void 0 : e.viewProps) == null ? void 0 : Fe.bgColor) || b
|
|
19750
19757
|
),
|
|
19751
19758
|
size: "md",
|
|
19752
19759
|
color: "gray.100",
|
|
@@ -19767,7 +19774,7 @@ const Dk = ({
|
|
|
19767
19774
|
]
|
|
19768
19775
|
}
|
|
19769
19776
|
) : /* @__PURE__ */ D(
|
|
19770
|
-
|
|
19777
|
+
ke,
|
|
19771
19778
|
{
|
|
19772
19779
|
ref: _,
|
|
19773
19780
|
...te,
|
|
@@ -19783,7 +19790,7 @@ const Dk = ({
|
|
|
19783
19790
|
ve,
|
|
19784
19791
|
!h && (de || J && J.length > 0) && A && !q && /* @__PURE__ */ D(He, { children: [
|
|
19785
19792
|
/* @__PURE__ */ y(
|
|
19786
|
-
|
|
19793
|
+
ke,
|
|
19787
19794
|
{
|
|
19788
19795
|
position: "absolute",
|
|
19789
19796
|
top: -150,
|
|
@@ -19796,7 +19803,7 @@ const Dk = ({
|
|
|
19796
19803
|
}
|
|
19797
19804
|
),
|
|
19798
19805
|
de ? /* @__PURE__ */ y(
|
|
19799
|
-
|
|
19806
|
+
ke,
|
|
19800
19807
|
{
|
|
19801
19808
|
position: "absolute",
|
|
19802
19809
|
zIndex: 1e3,
|
|
@@ -19818,7 +19825,7 @@ const Dk = ({
|
|
|
19818
19825
|
})
|
|
19819
19826
|
}
|
|
19820
19827
|
) : /* @__PURE__ */ y(
|
|
19821
|
-
|
|
19828
|
+
ke,
|
|
19822
19829
|
{
|
|
19823
19830
|
position: "absolute",
|
|
19824
19831
|
zIndex: 1e3,
|
|
@@ -19851,9 +19858,9 @@ const Dk = ({
|
|
|
19851
19858
|
}
|
|
19852
19859
|
} : void 0,
|
|
19853
19860
|
children: [
|
|
19854
|
-
J.map((ye, Me) => /* @__PURE__ */ D(
|
|
19861
|
+
J.map((ye, Me) => /* @__PURE__ */ D(ke, { display: "contents", children: [
|
|
19855
19862
|
Me > 0 && /* @__PURE__ */ y(
|
|
19856
|
-
|
|
19863
|
+
ke,
|
|
19857
19864
|
{
|
|
19858
19865
|
borderColor: C,
|
|
19859
19866
|
height: 5,
|
|
@@ -19870,9 +19877,9 @@ const Dk = ({
|
|
|
19870
19877
|
borderColor: C,
|
|
19871
19878
|
textColor: S,
|
|
19872
19879
|
boxSize: 5,
|
|
19873
|
-
onClick: (
|
|
19874
|
-
var
|
|
19875
|
-
|
|
19880
|
+
onClick: (Fe) => {
|
|
19881
|
+
var me;
|
|
19882
|
+
Fe.stopPropagation(), (me = p.onNodeHoverAction) == null || me.call(
|
|
19876
19883
|
p,
|
|
19877
19884
|
ye.id,
|
|
19878
19885
|
T,
|
|
@@ -19889,10 +19896,10 @@ const Dk = ({
|
|
|
19889
19896
|
}
|
|
19890
19897
|
)
|
|
19891
19898
|
] }),
|
|
19892
|
-
/* @__PURE__ */ D(
|
|
19899
|
+
/* @__PURE__ */ D(ke, { position: "relative", display: "flex", h: "100%", w: "100%", children: [
|
|
19893
19900
|
W && !((Ke = e == null ? void 0 : e.config) != null && Ke.parentContainer) && ((Ue = e == null ? void 0 : e.config) == null ? void 0 : Ue.collapsed) !== void 0 && !n && (() => {
|
|
19894
|
-
var
|
|
19895
|
-
const ye = w === "TB" || w === "BT", Me = t || w === "RL",
|
|
19901
|
+
var me, tt, yt;
|
|
19902
|
+
const ye = w === "TB" || w === "BT", Me = t || w === "RL", Fe = (me = e == null ? void 0 : e.config) != null && me.labelBelow && x[T] !== "properties" ? ((((tt = e == null ? void 0 : e.viewProps) == null ? void 0 : tt.fontSize) || 1) * 100 + 100) / 2 : void 0;
|
|
19896
19903
|
return /* @__PURE__ */ y(
|
|
19897
19904
|
qd,
|
|
19898
19905
|
{
|
|
@@ -19902,12 +19909,12 @@ const Dk = ({
|
|
|
19902
19909
|
left: "50%",
|
|
19903
19910
|
transform: "translateX(-50%)"
|
|
19904
19911
|
} : {
|
|
19905
|
-
right: Me ? void 0 :
|
|
19906
|
-
left: Me ?
|
|
19907
|
-
alignSelf:
|
|
19908
|
-
top:
|
|
19909
|
-
transform:
|
|
19910
|
-
zIndex:
|
|
19912
|
+
right: Me ? void 0 : Fe === void 0 ? "-75px" : `calc(50% - ${Fe + 75}px)`,
|
|
19913
|
+
left: Me ? Fe === void 0 ? "-75px" : `calc(50% - ${Fe + 75}px)` : void 0,
|
|
19914
|
+
alignSelf: Fe === void 0 ? "center" : void 0,
|
|
19915
|
+
top: Fe === void 0 ? void 0 : `${Fe}px`,
|
|
19916
|
+
transform: Fe === void 0 ? void 0 : "translateY(-50%)",
|
|
19917
|
+
zIndex: Fe === void 0 ? void 0 : 1
|
|
19911
19918
|
},
|
|
19912
19919
|
"data-flow-collapse-control": "",
|
|
19913
19920
|
"aria-label": e.config.collapsed ? "Expand" : "Collapse",
|
|
@@ -19966,7 +19973,7 @@ const Dk = ({
|
|
|
19966
19973
|
((w = r == null ? void 0 : r.viewProps) == null ? void 0 : w.textColor) || (c || l ? a : f)
|
|
19967
19974
|
), m = ((x = r == null ? void 0 : r.viewProps) == null ? void 0 : x.borderColor) || (l ? !c && ((v = r == null ? void 0 : r.viewProps) == null ? void 0 : v.bgColor) || s : u);
|
|
19968
19975
|
return /* @__PURE__ */ y(
|
|
19969
|
-
|
|
19976
|
+
ke,
|
|
19970
19977
|
{
|
|
19971
19978
|
"data-flow-node-surface": "",
|
|
19972
19979
|
borderRadius: (C = r == null ? void 0 : r.viewProps) == null ? void 0 : C.borderRadius,
|
|
@@ -19988,7 +19995,7 @@ const Dk = ({
|
|
|
19988
19995
|
fontSize: "5xl",
|
|
19989
19996
|
lineHeight: "normal",
|
|
19990
19997
|
children: [
|
|
19991
|
-
((S = r == null ? void 0 : r.config) == null ? void 0 : S.icon) && /* @__PURE__ */ y(
|
|
19998
|
+
((S = r == null ? void 0 : r.config) == null ? void 0 : S.icon) && /* @__PURE__ */ y(ke, { flexShrink: 0, children: /* @__PURE__ */ y(
|
|
19992
19999
|
Er,
|
|
19993
20000
|
{
|
|
19994
20001
|
name: r.config.icon,
|
|
@@ -20168,10 +20175,10 @@ function Mo({
|
|
|
20168
20175
|
...o
|
|
20169
20176
|
}) {
|
|
20170
20177
|
const { colorMode: i, callbacks: s } = Xe();
|
|
20171
|
-
return /* @__PURE__ */ y(ii, { ...o, hoverLeaveDelay: e ? 350 : 0, children: (a) => /* @__PURE__ */ D(
|
|
20178
|
+
return /* @__PURE__ */ y(ii, { ...o, hoverLeaveDelay: e ? 350 : 0, children: (a) => /* @__PURE__ */ D(ke, { position: "relative", children: [
|
|
20172
20179
|
/* @__PURE__ */ y(n, { ...a }),
|
|
20173
20180
|
e && (a.isHovered || a.isActive) && /* @__PURE__ */ y(
|
|
20174
|
-
|
|
20181
|
+
ke,
|
|
20175
20182
|
{
|
|
20176
20183
|
position: "absolute",
|
|
20177
20184
|
top: "-24px",
|
|
@@ -20286,7 +20293,7 @@ function Jk({
|
|
|
20286
20293
|
onEditEnd: f
|
|
20287
20294
|
}
|
|
20288
20295
|
),
|
|
20289
|
-
(a || c) && (r || w) && /* @__PURE__ */ y(
|
|
20296
|
+
(a || c) && (r || w) && /* @__PURE__ */ y(ke, { ml: "auto", pl: 6, flexShrink: 0, "data-flow-content-toggle": "", children: /* @__PURE__ */ y(Ze, { label: x, children: /* @__PURE__ */ y(
|
|
20290
20297
|
$e,
|
|
20291
20298
|
{
|
|
20292
20299
|
"aria-label": x,
|
|
@@ -20320,7 +20327,7 @@ function Zk({
|
|
|
20320
20327
|
const { edgeById: l } = yr(), d = /* @__PURE__ */ new Set();
|
|
20321
20328
|
for (const { data: u } of l.values())
|
|
20322
20329
|
u.source === e.id && u.sourceProperty !== void 0 && d.add(`source:${u.sourceProperty}`), u.target === e.id && u.targetProperty !== void 0 && d.add(`target:${u.targetProperty}`);
|
|
20323
|
-
return /* @__PURE__ */ y(
|
|
20330
|
+
return /* @__PURE__ */ y(ke, { children: Object.entries(e.description || {}).map(([u, f], h) => {
|
|
20324
20331
|
var E, O, T;
|
|
20325
20332
|
const m = r && Object.keys(r).find(
|
|
20326
20333
|
(W) => W.slice(W.indexOf(":") + 1) === u
|
|
@@ -20328,7 +20335,7 @@ function Zk({
|
|
|
20328
20335
|
(W) => W.id === g
|
|
20329
20336
|
), w = m ? "source" : b == null ? void 0 : b.role, x = d.has(`source:${g}`), v = d.has(`target:${g}`), C = i.some((W) => W.id === u), S = f === "" && (C || (w ? d.has(`${w}:${g}`) : x || v)), _ = w ?? (x !== v ? x ? "source" : "target" : void 0), R = (b == null ? void 0 : b.side) ?? (_ ? _ === "source" != (a === "RL") ? "right" : "left" : void 0), A = S && R === "right" ? "right" : "left", N = (b == null ? void 0 : b.label) ?? (p == null ? void 0 : p.label) ?? (C ? u.replace(/^(template|input|output|config|error):/, "") : u), M = Sr(s.wordBeforeDot)[typeof f], k = Sr(s.wordBeforeDot).property;
|
|
20330
20337
|
return /* @__PURE__ */ D(
|
|
20331
|
-
|
|
20338
|
+
ke,
|
|
20332
20339
|
{
|
|
20333
20340
|
"data-flow-property": m && (a === "TB" || a === "BT") ? void 0 : g,
|
|
20334
20341
|
"data-flow-port-role": w,
|
|
@@ -20389,7 +20396,7 @@ function Zk({
|
|
|
20389
20396
|
)
|
|
20390
20397
|
] }),
|
|
20391
20398
|
h !== Object.entries(e.description || {}).length - 1 && /* @__PURE__ */ y(
|
|
20392
|
-
|
|
20399
|
+
ke,
|
|
20393
20400
|
{
|
|
20394
20401
|
borderTopWidth: 1,
|
|
20395
20402
|
my: 0,
|
|
@@ -20496,7 +20503,7 @@ const si = (e) => {
|
|
|
20496
20503
|
onEditStart: I,
|
|
20497
20504
|
onEditEnd: J
|
|
20498
20505
|
}) => {
|
|
20499
|
-
var Q, ce, te, se, ve, he, U, ee, ue, xe, ne, Ce, qe, Ke, Ue, at, ye, Me,
|
|
20506
|
+
var Q, ce, te, se, ve, he, U, ee, ue, xe, ne, Ce, qe, Ke, Ue, at, ye, Me, Fe;
|
|
20500
20507
|
const de = M0(k, t, n), H = k.label ?? k.headerTitle, Y = Object.entries(k.description || {}).length > 0, G = Kk(k.description), oe = (ce = (Q = e.data) == null ? void 0 : Q.config) == null ? void 0 : ce.icon, q = (se = (te = e.data) == null ? void 0 : te.config) == null ? void 0 : se.content, B = p && !i && k.label === "" && (((ve = k.config) == null ? void 0 : ve.contentFormat) === "html" || ((he = k.config) == null ? void 0 : he.contentFormat) === "jsx"), V = p && !i && (((U = k.config) == null ? void 0 : U.contentFormat) === "html" || ((ee = k.config) == null ? void 0 : ee.contentFormat) === "jsx") && ((ue = k.viewProps) == null ? void 0 : ue.width) !== void 0 && k.viewProps.width !== "100%", F = ((xe = k == null ? void 0 : k.viewProps) == null ? void 0 : xe.borderRadius) ?? "53px", ie = ro(
|
|
20501
20508
|
k == null ? void 0 : k.viewProps,
|
|
20502
20509
|
de.hexborderColor,
|
|
@@ -20587,7 +20594,7 @@ const si = (e) => {
|
|
|
20587
20594
|
r,
|
|
20588
20595
|
e.data.id,
|
|
20589
20596
|
e.data
|
|
20590
|
-
)) ?? ((
|
|
20597
|
+
)) ?? ((Fe = e.data.config) != null && Fe.promptTurn ? "Thinking..." : void 0)
|
|
20591
20598
|
}
|
|
20592
20599
|
)
|
|
20593
20600
|
}
|
|
@@ -20682,7 +20689,7 @@ function Yk(e) {
|
|
|
20682
20689
|
e.data.id,
|
|
20683
20690
|
a && !p && g.current,
|
|
20684
20691
|
() => u.setNodeViewMode(e.data.id, "icon-label")
|
|
20685
|
-
), p ? /* @__PURE__ */ y(
|
|
20692
|
+
), p ? /* @__PURE__ */ y(ke, { "data-grid-document": ((x = e.data.config) == null ? void 0 : x.documentId) ?? "", children: /* @__PURE__ */ y(
|
|
20686
20693
|
Mo,
|
|
20687
20694
|
{
|
|
20688
20695
|
...e,
|
|
@@ -20702,7 +20709,7 @@ function Yk(e) {
|
|
|
20702
20709
|
/* @__PURE__ */ y(ii, { ...e, onOpenView: () => d(!0), children: ({ data: _, isActive: R }) => {
|
|
20703
20710
|
var A, N, M, k, E, O, T, W;
|
|
20704
20711
|
return /* @__PURE__ */ y(
|
|
20705
|
-
|
|
20712
|
+
ke,
|
|
20706
20713
|
{
|
|
20707
20714
|
"data-flow-node-surface": "",
|
|
20708
20715
|
"data-grid-document": ((A = _.config) == null ? void 0 : A.documentId) ?? "",
|
|
@@ -20719,7 +20726,7 @@ function Yk(e) {
|
|
|
20719
20726
|
R,
|
|
20720
20727
|
0
|
|
20721
20728
|
),
|
|
20722
|
-
children: m ? /* @__PURE__ */ y(m, { ...e }) : /* @__PURE__ */ y(
|
|
20729
|
+
children: m ? /* @__PURE__ */ y(m, { ...e }) : /* @__PURE__ */ y(ke, { p: 4, children: _.label ?? "Grid" })
|
|
20723
20730
|
}
|
|
20724
20731
|
);
|
|
20725
20732
|
} }),
|
|
@@ -20814,8 +20821,8 @@ function Qk(e) {
|
|
|
20814
20821
|
contentPlainText: !0,
|
|
20815
20822
|
contentPlaceholder: "How can I assist you?",
|
|
20816
20823
|
surfaceOverlay: m ? /* @__PURE__ */ y(R0, { active: !0, label: "Prompt running" }) : void 0,
|
|
20817
|
-
headerOverlay: f !== void 0 ? /* @__PURE__ */ y(
|
|
20818
|
-
|
|
20824
|
+
headerOverlay: f !== void 0 ? /* @__PURE__ */ y(ke, { position: "relative", h: "0", flexShrink: 0, "aria-hidden": "true", "data-prompt-budget": "", children: /* @__PURE__ */ y(ke, { position: "absolute", left: "0", right: "0", top: "-1px", h: "2px", bg: d.highlightColor, children: /* @__PURE__ */ y(
|
|
20825
|
+
ke,
|
|
20819
20826
|
{
|
|
20820
20827
|
className: "flow-sdk-edge-trace",
|
|
20821
20828
|
h: "100%",
|
|
@@ -20841,7 +20848,7 @@ function Qk(e) {
|
|
|
20841
20848
|
}
|
|
20842
20849
|
},
|
|
20843
20850
|
footer: /* @__PURE__ */ D(
|
|
20844
|
-
|
|
20851
|
+
ke,
|
|
20845
20852
|
{
|
|
20846
20853
|
"data-prompt-controls": "",
|
|
20847
20854
|
background: d.highlightColor,
|
|
@@ -20946,7 +20953,7 @@ const O0 = (e) => /* @__PURE__ */ y(N0, { ...e, renderCompact: Wk }), T0 = (e) =
|
|
|
20946
20953
|
}) => {
|
|
20947
20954
|
const { selectedNodeIds: t } = Xe();
|
|
20948
20955
|
return /* @__PURE__ */ y(ii, { ...r, editOnMount: t.includes(r.data.id), children: (n) => /* @__PURE__ */ y(
|
|
20949
|
-
|
|
20956
|
+
ke,
|
|
20950
20957
|
{
|
|
20951
20958
|
bg: e.textColor === "transparent" ? "transparent" : e.labelBg,
|
|
20952
20959
|
p: `${e.fontSize / 5}px`,
|
|
@@ -20985,7 +20992,7 @@ const eA = {
|
|
|
20985
20992
|
}) => {
|
|
20986
20993
|
const { colorMode: n } = Xe(), o = n === "dark", i = o ? "--chakra-colors-gray-700" : "--chakra-colors-gray-500", s = o ? "--chakra-colors-gray-700" : "--chakra-colors-gray-800";
|
|
20987
20994
|
return r === "none" ? /* @__PURE__ */ y(
|
|
20988
|
-
|
|
20995
|
+
ke,
|
|
20989
20996
|
{
|
|
20990
20997
|
"data-flow-background": "none",
|
|
20991
20998
|
width: "100%",
|
|
@@ -20995,7 +21002,7 @@ const eA = {
|
|
|
20995
21002
|
children: e
|
|
20996
21003
|
}
|
|
20997
21004
|
) : /* @__PURE__ */ D(
|
|
20998
|
-
|
|
21005
|
+
ke,
|
|
20999
21006
|
{
|
|
21000
21007
|
"data-flow-background": r,
|
|
21001
21008
|
position: "relative",
|
|
@@ -21005,7 +21012,7 @@ const eA = {
|
|
|
21005
21012
|
bg: t,
|
|
21006
21013
|
children: [
|
|
21007
21014
|
/* @__PURE__ */ y(
|
|
21008
|
-
|
|
21015
|
+
ke,
|
|
21009
21016
|
{
|
|
21010
21017
|
position: "absolute",
|
|
21011
21018
|
top: 0,
|
|
@@ -21024,7 +21031,7 @@ const eA = {
|
|
|
21024
21031
|
}
|
|
21025
21032
|
),
|
|
21026
21033
|
/* @__PURE__ */ y(
|
|
21027
|
-
|
|
21034
|
+
ke,
|
|
21028
21035
|
{
|
|
21029
21036
|
position: "relative",
|
|
21030
21037
|
width: "100%",
|
|
@@ -21140,26 +21147,26 @@ const eA = {
|
|
|
21140
21147
|
return z;
|
|
21141
21148
|
}, [r]), qe = gt(
|
|
21142
21149
|
(z) => {
|
|
21143
|
-
var
|
|
21144
|
-
const $ = (
|
|
21150
|
+
var Ae;
|
|
21151
|
+
const $ = (Ae = ne.get(z)) == null ? void 0 : Ae.data, re = xe($ == null ? void 0 : $.viewProps), be = Te(re.bgColor);
|
|
21145
21152
|
return {
|
|
21146
21153
|
animated: !!($ != null && $.isNodeAnimated) && !G,
|
|
21147
21154
|
animationVariant: $ == null ? void 0 : $.nodeAnimationVariant,
|
|
21148
21155
|
animationColor: Te(re.borderColor || t),
|
|
21149
|
-
bgColor: re.outline ? "transparent" :
|
|
21156
|
+
bgColor: re.outline ? "transparent" : be,
|
|
21150
21157
|
bgOpacity: re.bgOpacity,
|
|
21151
|
-
borderColor: re.borderColor ? Te(re.borderColor) : re.outline && re.bgColor === "transparent" ? Te(t) :
|
|
21158
|
+
borderColor: re.borderColor ? Te(re.borderColor) : re.outline && re.bgColor === "transparent" ? Te(t) : be,
|
|
21152
21159
|
borderWidth: to(
|
|
21153
21160
|
re.borderWidth,
|
|
21154
21161
|
Kr.borderWidth
|
|
21155
21162
|
),
|
|
21156
21163
|
borderStyle: re.borderStyle ?? Kr.borderStyle,
|
|
21157
21164
|
borderRadius: re.borderRadius ?? Kr.borderRadius,
|
|
21158
|
-
textColor: re.textColor ? Te(re.textColor) : re.outline || re.bgColor === "transparent" ? Te(Q) :
|
|
21165
|
+
textColor: re.textColor ? Te(re.textColor) : re.outline || re.bgColor === "transparent" ? Te(Q) : be,
|
|
21159
21166
|
fontSize: re.fontSize ?? Kr.fontSize,
|
|
21160
21167
|
labelPosition: re.labelPosition ?? Kr.labelPosition,
|
|
21161
21168
|
labelMargin: Kr.labelMargin,
|
|
21162
|
-
labelBg: nf(te("dark"),
|
|
21169
|
+
labelBg: nf(te("dark"), be, re.bgOpacity) ?? te("dark"),
|
|
21163
21170
|
padding: re.padding ?? Kr.padding
|
|
21164
21171
|
};
|
|
21165
21172
|
},
|
|
@@ -21172,18 +21179,18 @@ const eA = {
|
|
|
21172
21179
|
te
|
|
21173
21180
|
]
|
|
21174
21181
|
), Ke = rt(() => {
|
|
21175
|
-
var re,
|
|
21182
|
+
var re, be;
|
|
21176
21183
|
const z = /* @__PURE__ */ new Map();
|
|
21177
|
-
for (const
|
|
21178
|
-
const Oe = (re =
|
|
21184
|
+
for (const Ae of r) {
|
|
21185
|
+
const Oe = (re = Ae.data) == null ? void 0 : re.source, Ne = (be = Ae.data) == null ? void 0 : be.target;
|
|
21179
21186
|
if (!Oe || !Ne || Oe === Ne) continue;
|
|
21180
21187
|
const nt = Oe < Ne ? `${Oe}|${Ne}` : `${Ne}|${Oe}`, it = z.get(nt);
|
|
21181
|
-
it ? it.push({ id:
|
|
21188
|
+
it ? it.push({ id: Ae.data.id, source: Oe }) : z.set(nt, [{ id: Ae.data.id, source: Oe }]);
|
|
21182
21189
|
}
|
|
21183
21190
|
const $ = /* @__PURE__ */ new Map();
|
|
21184
|
-
for (const [
|
|
21191
|
+
for (const [Ae, Oe] of z) {
|
|
21185
21192
|
if (Oe.length < 2) continue;
|
|
21186
|
-
const Ne =
|
|
21193
|
+
const Ne = Ae.split("|")[0], nt = Math.min(20, 70 / Oe.length);
|
|
21187
21194
|
Oe.forEach(({ id: it, source: Be }, ht) => {
|
|
21188
21195
|
const bt = 50 + (ht - (Oe.length - 1) / 2) * nt;
|
|
21189
21196
|
$.set(it, (Be === Ne ? bt : 100 - bt) / 100);
|
|
@@ -21198,9 +21205,9 @@ const eA = {
|
|
|
21198
21205
|
}).map(({ data: $ }) => {
|
|
21199
21206
|
var Oe, Ne, nt, it, Be, ht;
|
|
21200
21207
|
let re = z;
|
|
21201
|
-
const
|
|
21202
|
-
if (
|
|
21203
|
-
const bt = xe((ht = (Be = ne.get(
|
|
21208
|
+
const be = (Ne = (Oe = ne.get($.source)) == null ? void 0 : Oe.data) == null ? void 0 : Ne.parent, Ae = (it = (nt = ne.get($.target)) == null ? void 0 : nt.data) == null ? void 0 : it.parent;
|
|
21209
|
+
if (be && be === Ae) {
|
|
21210
|
+
const bt = xe((ht = (Be = ne.get(be)) == null ? void 0 : Be.data) == null ? void 0 : ht.viewProps), At = nf(
|
|
21204
21211
|
z,
|
|
21205
21212
|
Te(bt.bgColor),
|
|
21206
21213
|
bt.bgOpacity
|
|
@@ -21252,8 +21259,8 @@ const eA = {
|
|
|
21252
21259
|
}
|
|
21253
21260
|
for (const $ of r) {
|
|
21254
21261
|
if ($.data.connection) continue;
|
|
21255
|
-
const re = $.data.isInverted ? $.data.target : $.data.source,
|
|
21256
|
-
|
|
21262
|
+
const re = $.data.isInverted ? $.data.target : $.data.source, be = $.data.isInverted ? $.data.source : $.data.target;
|
|
21263
|
+
be.startsWith(`${re}.`) && (z.set(re, $.data), z.set(be, $.data));
|
|
21257
21264
|
}
|
|
21258
21265
|
return z;
|
|
21259
21266
|
}, [r]), Me = rt(() => {
|
|
@@ -21263,7 +21270,7 @@ const eA = {
|
|
|
21263
21270
|
return (re = $.data) == null ? void 0 : re.id;
|
|
21264
21271
|
}).map(($) => {
|
|
21265
21272
|
var it, Be, ht, bt, At, Mt, Lt, zt, vt;
|
|
21266
|
-
const re = at.has($.data.id) && !$.data.parent,
|
|
21273
|
+
const re = at.has($.data.id) && !$.data.parent, be = re && $.data.type !== "prompt" ? $.data.label ?? $.data.headerTitle ?? "Container" : void 0, Ae = $.data.type === "prompt" ? z.prompt : re ? z.parentContainer : z[$.data.type] || z.text, Oe = ((it = b.customViews) == null ? void 0 : it.fillNode) ?? Ae, Ne = ye.get($.data.id), nt = {
|
|
21267
21274
|
...$,
|
|
21268
21275
|
isInverted: ((Be = $.data.config) == null ? void 0 : Be.isInverted) ?? (Ne == null ? void 0 : Ne.isInverted),
|
|
21269
21276
|
isParent: re,
|
|
@@ -21274,7 +21281,7 @@ const eA = {
|
|
|
21274
21281
|
collapsed: (ht = $.data.config) == null ? void 0 : ht.collapsed,
|
|
21275
21282
|
parent: $.data.parent,
|
|
21276
21283
|
acceptsChildren: !!((bt = $.data.config) != null && bt.parentContainer) || at.has($.data.id),
|
|
21277
|
-
label:
|
|
21284
|
+
label: be,
|
|
21278
21285
|
animated: !!$.data.isNodeAnimated,
|
|
21279
21286
|
animationVariant: $.data.nodeAnimationVariant,
|
|
21280
21287
|
hasCollapseControl: ((At = $.data.config) == null ? void 0 : At.collapsed) !== void 0,
|
|
@@ -21286,7 +21293,7 @@ const eA = {
|
|
|
21286
21293
|
8
|
|
21287
21294
|
),
|
|
21288
21295
|
element: /* @__PURE__ */ Du(
|
|
21289
|
-
|
|
21296
|
+
Ae,
|
|
21290
21297
|
{
|
|
21291
21298
|
...nt,
|
|
21292
21299
|
key: `${$.data.id}-${t}`
|
|
@@ -21296,7 +21303,7 @@ const eA = {
|
|
|
21296
21303
|
Oe,
|
|
21297
21304
|
{
|
|
21298
21305
|
...nt,
|
|
21299
|
-
...(vt = b.customViews) != null && vt.fillNode ? { renderNode:
|
|
21306
|
+
...(vt = b.customViews) != null && vt.fillNode ? { renderNode: Ae } : {},
|
|
21300
21307
|
data: {
|
|
21301
21308
|
...$.data,
|
|
21302
21309
|
viewProps: R.has($.data.id) ? $.data.viewProps : { ...$.data.viewProps, borderRadius: 0 }
|
|
@@ -21315,8 +21322,8 @@ const eA = {
|
|
|
21315
21322
|
b.customViews,
|
|
21316
21323
|
qe,
|
|
21317
21324
|
R
|
|
21318
|
-
]),
|
|
21319
|
-
|
|
21325
|
+
]), Fe = rt(() => G ? 300 : e.length > 50 ? 150 : e.length > 20 ? 100 : 50, [e.length, G]), me = fe(b);
|
|
21326
|
+
me.current = b;
|
|
21320
21327
|
const tt = fe(A);
|
|
21321
21328
|
tt.current = A;
|
|
21322
21329
|
const yt = fe(I);
|
|
@@ -21327,35 +21334,35 @@ const eA = {
|
|
|
21327
21334
|
Ye.current = v;
|
|
21328
21335
|
const pt = fe(M);
|
|
21329
21336
|
pt.current = M;
|
|
21330
|
-
const
|
|
21331
|
-
|
|
21337
|
+
const et = fe(ne);
|
|
21338
|
+
et.current = ne;
|
|
21332
21339
|
const Ct = fe(Ce);
|
|
21333
21340
|
Ct.current = Ce;
|
|
21334
21341
|
const qt = fe(/* @__PURE__ */ new Map());
|
|
21335
21342
|
We(() => {
|
|
21336
|
-
var re,
|
|
21343
|
+
var re, be;
|
|
21337
21344
|
const z = new Map(
|
|
21338
21345
|
[...Ce].filter(
|
|
21339
|
-
([,
|
|
21346
|
+
([, Ae]) => ne.has(Ae.data.source) && ne.has(Ae.data.target)
|
|
21340
21347
|
)
|
|
21341
21348
|
), $ = qt.current;
|
|
21342
21349
|
qt.current = z;
|
|
21343
|
-
for (const [
|
|
21344
|
-
z.has(
|
|
21350
|
+
for (const [Ae, Oe] of $)
|
|
21351
|
+
z.has(Ae) || (Ye.current === Ae && (C(null), (re = g.onEdgeDeselect) == null || re.call(g)), (be = g.onEdgeRemove) == null || be.call(g, Ae, Oe.data));
|
|
21345
21352
|
}, [Ce, ne, g, C]), We(() => {
|
|
21346
21353
|
const z = J.current;
|
|
21347
21354
|
if (!de || !z) return;
|
|
21348
|
-
let $ = null, re = null,
|
|
21355
|
+
let $ = null, re = null, be = 0, Ae = 0, Oe = 0, Ne = 0, nt = 0;
|
|
21349
21356
|
const it = (Be) => {
|
|
21350
21357
|
var At;
|
|
21351
|
-
if (
|
|
21358
|
+
if (me.current.readOnly || me.current.minZoom === me.current.maxZoom && me.current.minZoom !== void 0 && ((At = z.parentElement) != null && At.closest(".flow-sdk-canvas")))
|
|
21352
21359
|
return;
|
|
21353
21360
|
const ht = z.ownerDocument.fullscreenElement;
|
|
21354
21361
|
if (ht && ht !== z && z.contains(ht) && Be.target instanceof Node && ht.contains(Be.target))
|
|
21355
21362
|
return;
|
|
21356
21363
|
Be.preventDefault(), Be.stopPropagation(), tt.current || Be.metaKey || Be.ctrlKey ? (Oe += Be.deltaY, Ne = Be.clientX, nt = Be.clientY, re === null && (re = requestAnimationFrame(() => {
|
|
21357
21364
|
re = null;
|
|
21358
|
-
const Mt =
|
|
21365
|
+
const Mt = me.current, Lt = de.zoom(), zt = Oe;
|
|
21359
21366
|
Oe = 0;
|
|
21360
21367
|
let vt = Lt - zt * 0.05 / 100;
|
|
21361
21368
|
vt = Math.max(
|
|
@@ -21367,10 +21374,10 @@ const eA = {
|
|
|
21367
21374
|
x: Ne - wt.left,
|
|
21368
21375
|
y: nt - wt.top
|
|
21369
21376
|
});
|
|
21370
|
-
}))) : (
|
|
21377
|
+
}))) : (be += Be.deltaX, Ae += Be.deltaY, $ === null && ($ = requestAnimationFrame(() => {
|
|
21371
21378
|
$ = null;
|
|
21372
|
-
const Mt = de.pan(), Lt = de.zoom(), zt = 0.35, vt =
|
|
21373
|
-
|
|
21379
|
+
const Mt = de.pan(), Lt = de.zoom(), zt = 0.35, vt = be, wt = Ae;
|
|
21380
|
+
be = 0, Ae = 0, de.pan({
|
|
21374
21381
|
x: Mt.x + -vt * zt / Lt,
|
|
21375
21382
|
y: Mt.y + -wt * zt / Lt
|
|
21376
21383
|
});
|
|
@@ -21382,8 +21389,8 @@ const eA = {
|
|
|
21382
21389
|
}, [de]), We(() => {
|
|
21383
21390
|
if (b.disableKeyboardShortcuts) return;
|
|
21384
21391
|
const z = ($) => {
|
|
21385
|
-
var
|
|
21386
|
-
if (
|
|
21392
|
+
var be, Ae, Oe, Ne, nt, it;
|
|
21393
|
+
if (me.current.readOnly) return;
|
|
21387
21394
|
const re = $.target;
|
|
21388
21395
|
if (!(re.tagName === "INPUT" || re.tagName === "TEXTAREA" || re.isContentEditable)) {
|
|
21389
21396
|
if (["ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown"].includes($.key)) {
|
|
@@ -21412,7 +21419,7 @@ const eA = {
|
|
|
21412
21419
|
)) {
|
|
21413
21420
|
if (Ht.closest(".flow-sdk-canvas") !== bt) continue;
|
|
21414
21421
|
const dt = Ht.getAttribute("data-node-id");
|
|
21415
|
-
if (!dt || dt === Lt || !
|
|
21422
|
+
if (!dt || dt === Lt || !et.current.has(dt))
|
|
21416
21423
|
continue;
|
|
21417
21424
|
const Rr = Ht.getBoundingClientRect(), Vr = getComputedStyle(Ht);
|
|
21418
21425
|
if (!Rr.width || !Rr.height || Vr.visibility === "hidden" || Vr.opacity === "0")
|
|
@@ -21425,10 +21432,10 @@ const eA = {
|
|
|
21425
21432
|
(!Et || ln < Et.distance) && (Et = { id: dt, box: wr, distance: ln });
|
|
21426
21433
|
}
|
|
21427
21434
|
if ($.preventDefault(), $.stopPropagation(), !Et) return;
|
|
21428
|
-
Ye.current && (C(null), (
|
|
21435
|
+
Ye.current && (C(null), (be = g.onEdgeDeselect) == null || be.call(g)), x([Et.id]), (Ae = g.onNodeSelect) == null || Ae.call(
|
|
21429
21436
|
g,
|
|
21430
21437
|
Et.id,
|
|
21431
|
-
|
|
21438
|
+
et.current.get(Et.id).data,
|
|
21432
21439
|
{
|
|
21433
21440
|
shiftKey: !1,
|
|
21434
21441
|
ctrlKey: !1,
|
|
@@ -21462,7 +21469,7 @@ const eA = {
|
|
|
21462
21469
|
const Be = Ie.current.filter((ht) => ht !== "root");
|
|
21463
21470
|
if (Be.length === 0) return;
|
|
21464
21471
|
for (const ht of Be) {
|
|
21465
|
-
const bt = (nt =
|
|
21472
|
+
const bt = (nt = et.current.get(ht)) == null ? void 0 : nt.data;
|
|
21466
21473
|
(it = g.onNodeDelete) == null || it.call(g, ht, bt || {});
|
|
21467
21474
|
}
|
|
21468
21475
|
x([]);
|
|
@@ -21497,28 +21504,28 @@ const eA = {
|
|
|
21497
21504
|
[g]
|
|
21498
21505
|
), st = gt(
|
|
21499
21506
|
(z) => {
|
|
21500
|
-
var re,
|
|
21507
|
+
var re, be, Ae;
|
|
21501
21508
|
const $ = ((re = Ct.current.get(z)) == null ? void 0 : re.data) ?? { id: z };
|
|
21502
21509
|
if (Ye.current === z && pt.current) {
|
|
21503
|
-
C(null), (
|
|
21510
|
+
C(null), (be = g.onEdgeDeselect) == null || be.call(g);
|
|
21504
21511
|
return;
|
|
21505
21512
|
}
|
|
21506
|
-
Ie.current.length && x([]), C(z), (
|
|
21513
|
+
Ie.current.length && x([]), C(z), (Ae = g.onEdgeSelect) == null || Ae.call(g, z, $);
|
|
21507
21514
|
},
|
|
21508
21515
|
[g, C, x]
|
|
21509
21516
|
), Ge = gt(() => {
|
|
21510
|
-
var z, $, re,
|
|
21517
|
+
var z, $, re, be, Ae, Oe;
|
|
21511
21518
|
if ((z = J.current) == null || z.focus({ preventScroll: !0 }), a(
|
|
21512
21519
|
b.bottomBarCollapsed ?? (Ie.current.length > 0 || !!Ye.current || !s)
|
|
21513
|
-
), ($ = g.onBackgroundClick) == null || $.call(g), !
|
|
21520
|
+
), ($ = g.onBackgroundClick) == null || $.call(g), !me.current.readOnly) {
|
|
21514
21521
|
const Ne = /* @__PURE__ */ new Set();
|
|
21515
21522
|
for (const nt of Ie.current) {
|
|
21516
|
-
let it =
|
|
21523
|
+
let it = et.current.get(nt);
|
|
21517
21524
|
for (; it && !Ne.has(it.data.id); )
|
|
21518
|
-
Ne.add(it.data.id), at.has(it.data.id) && ((re = it.data.config) == null ? void 0 : re.collapsed) !== !0 && ((
|
|
21525
|
+
Ne.add(it.data.id), at.has(it.data.id) && ((re = it.data.config) == null ? void 0 : re.collapsed) !== !0 && ((be = g.onNodeCollapse) == null || be.call(g, it.data.id, !0)), it = it.data.parent ? et.current.get(it.data.parent) : void 0;
|
|
21519
21526
|
}
|
|
21520
21527
|
}
|
|
21521
|
-
Ie.current.length && (x([]), (
|
|
21528
|
+
Ie.current.length && (x([]), (Ae = g.onNodeDeselect) == null || Ae.call(g)), Ye.current && (C(null), (Oe = g.onEdgeDeselect) == null || Oe.call(g));
|
|
21522
21529
|
}, [
|
|
21523
21530
|
g,
|
|
21524
21531
|
x,
|
|
@@ -21531,12 +21538,12 @@ const eA = {
|
|
|
21531
21538
|
We(() => {
|
|
21532
21539
|
if (b.disableKeyboardShortcuts) return;
|
|
21533
21540
|
const z = ($) => {
|
|
21534
|
-
const re = J.current,
|
|
21535
|
-
$.key !== "Escape" || $.defaultPrevented || $.repeat || $.isComposing || $.ctrlKey || $.metaKey || $.altKey || $.shiftKey ||
|
|
21541
|
+
const re = J.current, be = re == null ? void 0 : re.querySelector(".flow-sdk-canvas"), Ae = $.target;
|
|
21542
|
+
$.key !== "Escape" || $.defaultPrevented || $.repeat || $.isComposing || $.ctrlKey || $.metaKey || $.altKey || $.shiftKey || me.current.readOnly || !Ie.current.length || !re || !be || !re.getClientRects().length || document.fullscreenElement || be.querySelector(
|
|
21536
21543
|
"[data-grid-dragging], .flow-sdk-ghost, .flow-sdk-box"
|
|
21537
|
-
) ||
|
|
21544
|
+
) || Ae instanceof Element && (Ae.closest(
|
|
21538
21545
|
'input, textarea, select, [contenteditable], [role="textbox"], [role="combobox"], dialog, [role="dialog"], [role="menu"], [role="listbox"], [popover]'
|
|
21539
|
-
) ||
|
|
21546
|
+
) || Ae !== document.body && !re.contains(Ae) || Ae.closest(".flow-sdk-canvas") && Ae.closest(".flow-sdk-canvas") !== be) || Array.from(
|
|
21540
21547
|
document.querySelectorAll(
|
|
21541
21548
|
'dialog[open], :popover-open, [role="dialog"], [role="menu"], [role="listbox"]'
|
|
21542
21549
|
)
|
|
@@ -21548,59 +21555,59 @@ const eA = {
|
|
|
21548
21555
|
}, [b.disableKeyboardShortcuts, Ge]);
|
|
21549
21556
|
const sr = gt(
|
|
21550
21557
|
(z) => {
|
|
21551
|
-
var
|
|
21558
|
+
var be, Ae;
|
|
21552
21559
|
const $ = Ie.current, re = z.filter((Oe) => !$.includes(Oe));
|
|
21553
21560
|
if (re.length) {
|
|
21554
21561
|
x([...$, ...re]);
|
|
21555
21562
|
for (const Oe of re)
|
|
21556
|
-
(
|
|
21563
|
+
(Ae = g.onNodeSelect) == null || Ae.call(
|
|
21557
21564
|
g,
|
|
21558
21565
|
Oe,
|
|
21559
|
-
((
|
|
21566
|
+
((be = et.current.get(Oe)) == null ? void 0 : be.data) ?? { id: Oe }
|
|
21560
21567
|
);
|
|
21561
21568
|
}
|
|
21562
21569
|
},
|
|
21563
21570
|
[g, x]
|
|
21564
21571
|
), mt = gt(
|
|
21565
21572
|
(z, $) => {
|
|
21566
|
-
var re,
|
|
21567
|
-
x([z]), (
|
|
21573
|
+
var re, be;
|
|
21574
|
+
x([z]), (be = g.onNodeSelect) == null || be.call(
|
|
21568
21575
|
g,
|
|
21569
21576
|
z,
|
|
21570
|
-
((re =
|
|
21577
|
+
((re = et.current.get(z)) == null ? void 0 : re.data) ?? { id: z },
|
|
21571
21578
|
$
|
|
21572
21579
|
);
|
|
21573
21580
|
},
|
|
21574
21581
|
[g, x]
|
|
21575
21582
|
), Ut = fe(null), br = gt(
|
|
21576
21583
|
(z, $, re) => {
|
|
21577
|
-
var
|
|
21584
|
+
var be;
|
|
21578
21585
|
Ut.current = {
|
|
21579
21586
|
source: z,
|
|
21580
21587
|
target: $,
|
|
21581
21588
|
edgeIds: new Set(Ct.current.keys())
|
|
21582
21589
|
};
|
|
21583
21590
|
try {
|
|
21584
|
-
(
|
|
21585
|
-
} catch (
|
|
21586
|
-
throw Ut.current = null,
|
|
21591
|
+
(be = g.onEdgeCreate) == null || be.call(g, z, $, re);
|
|
21592
|
+
} catch (Ae) {
|
|
21593
|
+
throw Ut.current = null, Ae;
|
|
21587
21594
|
}
|
|
21588
21595
|
},
|
|
21589
21596
|
[g]
|
|
21590
21597
|
), Ve = gt(
|
|
21591
|
-
(z, $, re,
|
|
21592
|
-
var
|
|
21598
|
+
(z, $, re, be = !1) => {
|
|
21599
|
+
var Ae, Oe;
|
|
21593
21600
|
if (Y.current = {
|
|
21594
21601
|
sourceId: z,
|
|
21595
|
-
nodeIds: new Set(
|
|
21596
|
-
reverse:
|
|
21597
|
-
}, !(u === "properties" && ((
|
|
21602
|
+
nodeIds: new Set(et.current.keys()),
|
|
21603
|
+
reverse: be
|
|
21604
|
+
}, !(u === "properties" && ((Ae = g.onNodeCreateRequest) == null ? void 0 : Ae.call(g, {
|
|
21598
21605
|
sourceNodeId: z,
|
|
21599
21606
|
position: $,
|
|
21600
21607
|
sourceProperty: re,
|
|
21601
|
-
reverse:
|
|
21608
|
+
reverse: be
|
|
21602
21609
|
})) === !0)) {
|
|
21603
|
-
if (re !== void 0 ||
|
|
21610
|
+
if (re !== void 0 || be) {
|
|
21604
21611
|
Y.current = null;
|
|
21605
21612
|
return;
|
|
21606
21613
|
}
|
|
@@ -21620,7 +21627,7 @@ const eA = {
|
|
|
21620
21627
|
pattern: i === "transparent" ? "none" : i,
|
|
21621
21628
|
backgroundColor: ce,
|
|
21622
21629
|
children: /* @__PURE__ */ y(
|
|
21623
|
-
|
|
21630
|
+
ke,
|
|
21624
21631
|
{
|
|
21625
21632
|
ref: J,
|
|
21626
21633
|
tabIndex: 0,
|
|
@@ -21654,7 +21661,7 @@ const eA = {
|
|
|
21654
21661
|
initialNodeGrid: b.nodeGrid,
|
|
21655
21662
|
spacingFactor: B,
|
|
21656
21663
|
compactSpacingScale: n,
|
|
21657
|
-
layoutDebounce:
|
|
21664
|
+
layoutDebounce: Fe,
|
|
21658
21665
|
isPerformanceMode: G,
|
|
21659
21666
|
minZoom: b.minZoom ?? 0.01,
|
|
21660
21667
|
maxZoom: b.maxZoom ?? 1.5,
|
|
@@ -21674,24 +21681,24 @@ const eA = {
|
|
|
21674
21681
|
var Oe;
|
|
21675
21682
|
(Oe = g.onLayoutComplete) == null || Oe.call(g, z);
|
|
21676
21683
|
const $ = Ut.current;
|
|
21677
|
-
$ && (!
|
|
21684
|
+
$ && (!et.current.has($.source) || !et.current.has($.target) ? Ut.current = null : r.some(
|
|
21678
21685
|
({ data: Ne }) => Ne.source === $.source && Ne.target === $.target && !$.edgeIds.has(Ne.id)
|
|
21679
21686
|
) && z.getNodeBox($.source) && z.getNodeBox($.target) && (Ut.current = null, z.focusConnections($.source)));
|
|
21680
21687
|
const re = Y.current;
|
|
21681
21688
|
if (!re) return;
|
|
21682
|
-
if (!
|
|
21689
|
+
if (!et.current.has(re.sourceId)) {
|
|
21683
21690
|
Y.current = null;
|
|
21684
21691
|
return;
|
|
21685
21692
|
}
|
|
21686
|
-
const
|
|
21693
|
+
const Ae = e.filter(
|
|
21687
21694
|
(Ne) => !re.nodeIds.has(Ne.data.id)
|
|
21688
21695
|
).filter(
|
|
21689
21696
|
(Ne) => r.some(
|
|
21690
21697
|
({ data: nt }) => nt.source === re.sourceId && nt.target === Ne.data.id || nt.target === re.sourceId && nt.source === Ne.data.id
|
|
21691
21698
|
)
|
|
21692
21699
|
);
|
|
21693
|
-
!
|
|
21694
|
-
re.reverse ?
|
|
21700
|
+
!Ae.length || Ae.some((Ne) => !z.getNodeBox(Ne.data.id)) || (Y.current = null, z.focusBranch(
|
|
21701
|
+
re.reverse ? Ae[0].data.id : re.sourceId
|
|
21695
21702
|
));
|
|
21696
21703
|
},
|
|
21697
21704
|
onNodeGridModeChange: _,
|
|
@@ -21742,7 +21749,7 @@ function SA({
|
|
|
21742
21749
|
cancelAnimationFrame(u), d !== void 0 && cancelAnimationFrame(d);
|
|
21743
21750
|
};
|
|
21744
21751
|
}, [e, s, t.json]), /* @__PURE__ */ D(
|
|
21745
|
-
|
|
21752
|
+
ke,
|
|
21746
21753
|
{
|
|
21747
21754
|
className: t.className,
|
|
21748
21755
|
style: t.style,
|
|
@@ -21775,7 +21782,7 @@ function SA({
|
|
|
21775
21782
|
}
|
|
21776
21783
|
),
|
|
21777
21784
|
a && r !== null && /* @__PURE__ */ y(
|
|
21778
|
-
|
|
21785
|
+
ke,
|
|
21779
21786
|
{
|
|
21780
21787
|
"data-flow-loader": "",
|
|
21781
21788
|
role: "status",
|
|
@@ -22078,7 +22085,7 @@ function sA({
|
|
|
22078
22085
|
nodes: _,
|
|
22079
22086
|
edges: R,
|
|
22080
22087
|
children: /* @__PURE__ */ D(
|
|
22081
|
-
|
|
22088
|
+
ke,
|
|
22082
22089
|
{
|
|
22083
22090
|
className: a,
|
|
22084
22091
|
"data-flow-diagram": "",
|