@workflow/web 5.3.1 → 5.3.3
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/README.md +11 -34
- package/build/client/assets/app-CmaRLUwS.css +1 -0
- package/build/client/assets/arrow-up-right-AHTyWXU2.js +9 -0
- package/build/client/assets/{entry.client-DDsh88VE.js → entry.client-BqbaswKw.js} +13 -35
- package/build/client/assets/{highlighted-body-JLMTFACH-CWHg5f-6.js → highlighted-body-JLMTFACH-_kzpqYmW.js} +2 -2
- package/build/client/assets/{home-DZqYMSiD.js → home-DjUPTrY5.js} +91 -159
- package/build/client/assets/{index-BS6T0Zjc.js → index-BUQuaV5X.js} +108 -174
- package/build/client/assets/manifest-9126df65.js +1 -0
- package/build/client/assets/{mermaid-WFAXDIZX-BLO7Z8RE.js → mermaid-WFAXDIZX-CNo_0yWo.js} +1499 -4067
- package/build/client/assets/mermaid-WFAXDIZX-F88p7PFX.css +1 -0
- package/build/client/assets/meta-9cjJ0pVb.js +6 -0
- package/build/client/assets/{root-wdKzRZGT.js → root-Bh-E5He-.js} +17 -35
- package/build/client/assets/root-kJB77No4.css +1 -0
- package/build/client/assets/rpc-client-DL_nSX36.js +2481 -0
- package/build/client/assets/{run-detail-DyXpnv9C.js → run-detail-5dPVsaSm.js} +533 -807
- package/build/client/assets/run-usage-BEswHGKU.js +1252 -0
- package/build/client/assets/run-usage-C_wyncgV.js +33 -0
- package/build/client/assets/skeleton-DE14mNQw.js +76 -0
- package/build/client/assets/{url-state-DhOv2zv0.js → url-state-5GKQwo-f.js} +546 -857
- package/build/client/assets/{zstd-browser-decoder-BNeg7hxG.js → zstd-browser-decoder-CbTMLAMd.js} +2 -2
- package/build/server/assets/{app-CNGxG3wL.js → app-C-e60j14.js} +13627 -12777
- package/build/server/assets/{esm-CETb4fkq.js → esm-BzrGWk7J.js} +2 -2
- package/build/server/assets/{highlighted-body-JLMTFACH-Bj8JsfUl.js → highlighted-body-JLMTFACH-B7y0X_Kn.js} +1 -1
- package/build/server/assets/{index-DGn_6xEN.js → index-DRDsjR--.js} +398 -490
- package/build/server/assets/{mermaid-WFAXDIZX-C_v93dNU.js → mermaid-WFAXDIZX-MsPxEM1Y.js} +1 -1
- package/build/server/assets/{token-b1ZjKN2Q.js → token-CKgyaeCJ.js} +5 -5
- package/build/server/assets/{token-5fcfNNDG.js → token-DXh0TnqB.js} +6 -6
- package/build/server/assets/{token-util-BJhEZw83.js → token-util-CCc0uYVy.js} +2 -2
- package/build/server/assets/{token-util-spPPOelu.js → token-util-DOHYMq7D.js} +1 -1
- package/build/server/assets/{wrapper-Cc-ChiPM.js → wrapper-BzLz38Oh.js} +2 -2
- package/build/server/assets/{zstd-browser-decoder-y4X_FyMk.js → zstd-browser-decoder-BSSEC3XP.js} +1 -1
- package/build/server/index.js +1 -1
- package/handler.d.ts +9 -0
- package/handler.js +16 -2
- package/host-guard.js +179 -0
- package/package.json +9 -8
- package/server.d.ts +15 -1
- package/server.js +14 -1
- package/build/client/assets/app-BE8uqS_d.css +0 -1
- package/build/client/assets/arrow-up-right-CNHh1bh2.js +0 -15
- package/build/client/assets/manifest-f2e93220.js +0 -1
- package/build/client/assets/mermaid-WFAXDIZX-D8CjRQta.css +0 -1
- package/build/client/assets/root-BBptRWmF.css +0 -1
|
@@ -1,55 +1,16 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
1
|
var __typeError = (msg) => {
|
|
3
2
|
throw TypeError(msg);
|
|
4
3
|
};
|
|
5
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
-
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
7
4
|
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
8
5
|
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
9
6
|
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
10
7
|
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
11
8
|
var _keys, _a;
|
|
12
|
-
import { c as createLucideIcon,
|
|
13
|
-
import { r as reactExports, j as jsxRuntimeExports,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
const [prefix, moduleSpecifier, ...functionNameParts] = name.split("//");
|
|
19
|
-
if (prefix !== tag || !moduleSpecifier || functionNameParts.length === 0) {
|
|
20
|
-
return null;
|
|
21
|
-
}
|
|
22
|
-
const functionName = functionNameParts.join("//");
|
|
23
|
-
let shortName = functionName.split("/").at(-1) ?? "";
|
|
24
|
-
let moduleShortName = "";
|
|
25
|
-
if (moduleSpecifier.startsWith("./")) {
|
|
26
|
-
moduleShortName = moduleSpecifier.split("/").at(-1) ?? "";
|
|
27
|
-
} else {
|
|
28
|
-
const withoutVersion = moduleSpecifier.split("@").slice(0, -1).join("@") || moduleSpecifier.split("@")[0];
|
|
29
|
-
moduleShortName = (withoutVersion == null ? void 0 : withoutVersion.split("/").at(-1)) ?? "";
|
|
30
|
-
}
|
|
31
|
-
if (["default", "__default"].includes(shortName) && moduleShortName) {
|
|
32
|
-
shortName = moduleShortName;
|
|
33
|
-
}
|
|
34
|
-
return {
|
|
35
|
-
shortName,
|
|
36
|
-
moduleSpecifier,
|
|
37
|
-
functionName
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
function parseWorkflowName(name) {
|
|
41
|
-
return parseName("workflow", name);
|
|
42
|
-
}
|
|
43
|
-
function parseStepName(name) {
|
|
44
|
-
return parseName("step", name);
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* @license lucide-react v0.575.0 - ISC
|
|
48
|
-
*
|
|
49
|
-
* This source code is licensed under the ISC license.
|
|
50
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
51
|
-
*/
|
|
52
|
-
const __iconNode$g = [
|
|
9
|
+
import { c as createLucideIcon, L as ChevronDown, a as cn, a3 as isRunCreationEvent, b1 as startHookId, a0 as isHookLifecycleEventType, O as cva, p as useComposedRefs, y as createContextScope, K as createSlot, q as useLayoutEffect2, v as useId, P as Primitive, A as composeEventHandlers, s as useControllableState, J as useCallbackRef$1, x as createPopperScope, w as Popper, z as PopperAnchor, E as Presence, D as Portal, b2 as dispatchDiscreteCustomEvent, b3 as useFocusScopeBranch, b4 as useFocusScopeBranchRegistry, b5 as FocusScopeBranchProvider, F as FocusScope, G as DismissableLayer, H as PopperContent, C as ChevronRight, n as Check, b6 as VERCEL_403_ERROR_MESSAGE, T as Tooltip, d as TooltipTrigger, a4 as CopyButton, e as TooltipContent, b7 as formatDuration, B as Button, t as toast, b8 as useDismissableLayerSurface } from "./mermaid-WFAXDIZX-CNo_0yWo.js";
|
|
10
|
+
import { r as reactExports, j as jsxRuntimeExports, H as React2, a as requireReact, R as ReactExports, I as getDefaultExportFromCjs, g as reactDomExports, C as useSearchParams, B as useNavigate } from "./index-BUQuaV5X.js";
|
|
11
|
+
import { b as CircleAlert, C as Circle, R as RotateCw } from "./skeleton-DE14mNQw.js";
|
|
12
|
+
import { m as fetchRuns, n as bulkCancelRuns$1, o as reenqueueRun$1, w as wakeUpRun$1, p as resumeHook$1, q as fetchHookToken$1, s as cancelRun$1, t as recreateRun$1 } from "./rpc-client-DL_nSX36.js";
|
|
13
|
+
const __iconNode$d = [
|
|
53
14
|
["path", { d: "M6.87 6.87a8 8 0 1 0 11.26 11.26", key: "3on8tj" }],
|
|
54
15
|
["path", { d: "M19.9 14.25a8 8 0 0 0-9.15-9.15", key: "15ghsc" }],
|
|
55
16
|
["path", { d: "m22 6-3-3", key: "1opdir" }],
|
|
@@ -57,14 +18,8 @@ const __iconNode$g = [
|
|
|
57
18
|
["path", { d: "m2 2 20 20", key: "1ooewy" }],
|
|
58
19
|
["path", { d: "M4 4 2 6", key: "1ycko6" }]
|
|
59
20
|
];
|
|
60
|
-
const AlarmClockOff = createLucideIcon("alarm-clock-off", __iconNode$
|
|
61
|
-
|
|
62
|
-
* @license lucide-react v0.575.0 - ISC
|
|
63
|
-
*
|
|
64
|
-
* This source code is licensed under the ISC license.
|
|
65
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
66
|
-
*/
|
|
67
|
-
const __iconNode$f = [
|
|
21
|
+
const AlarmClockOff = createLucideIcon("alarm-clock-off", __iconNode$d);
|
|
22
|
+
const __iconNode$c = [
|
|
68
23
|
["path", { d: "M12 8V4H8", key: "hb8ula" }],
|
|
69
24
|
["rect", { width: "16", height: "12", x: "4", y: "8", rx: "2", key: "enze0r" }],
|
|
70
25
|
["path", { d: "M2 14h2", key: "vft8re" }],
|
|
@@ -72,34 +27,10 @@ const __iconNode$f = [
|
|
|
72
27
|
["path", { d: "M15 13v2", key: "1xurst" }],
|
|
73
28
|
["path", { d: "M9 13v2", key: "rq6x2g" }]
|
|
74
29
|
];
|
|
75
|
-
const Bot = createLucideIcon("bot", __iconNode$
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
* This source code is licensed under the ISC license.
|
|
80
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
81
|
-
*/
|
|
82
|
-
const __iconNode$e = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]];
|
|
83
|
-
const ChevronUp = createLucideIcon("chevron-up", __iconNode$e);
|
|
84
|
-
/**
|
|
85
|
-
* @license lucide-react v0.575.0 - ISC
|
|
86
|
-
*
|
|
87
|
-
* This source code is licensed under the ISC license.
|
|
88
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
89
|
-
*/
|
|
90
|
-
const __iconNode$d = [
|
|
91
|
-
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
92
|
-
["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
|
|
93
|
-
["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
|
|
94
|
-
];
|
|
95
|
-
const CircleAlert = createLucideIcon("circle-alert", __iconNode$d);
|
|
96
|
-
/**
|
|
97
|
-
* @license lucide-react v0.575.0 - ISC
|
|
98
|
-
*
|
|
99
|
-
* This source code is licensed under the ISC license.
|
|
100
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
101
|
-
*/
|
|
102
|
-
const __iconNode$c = [
|
|
30
|
+
const Bot = createLucideIcon("bot", __iconNode$c);
|
|
31
|
+
const __iconNode$b = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]];
|
|
32
|
+
const ChevronUp = createLucideIcon("chevron-up", __iconNode$b);
|
|
33
|
+
const __iconNode$a = [
|
|
103
34
|
[
|
|
104
35
|
"path",
|
|
105
36
|
{
|
|
@@ -109,56 +40,24 @@ const __iconNode$c = [
|
|
|
109
40
|
],
|
|
110
41
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]
|
|
111
42
|
];
|
|
112
|
-
const CirclePlay = createLucideIcon("circle-play", __iconNode$
|
|
113
|
-
|
|
114
|
-
* @license lucide-react v0.575.0 - ISC
|
|
115
|
-
*
|
|
116
|
-
* This source code is licensed under the ISC license.
|
|
117
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
118
|
-
*/
|
|
119
|
-
const __iconNode$b = [
|
|
43
|
+
const CirclePlay = createLucideIcon("circle-play", __iconNode$a);
|
|
44
|
+
const __iconNode$9 = [
|
|
120
45
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
121
46
|
["rect", { x: "9", y: "9", width: "6", height: "6", rx: "1", key: "1ssd4o" }]
|
|
122
47
|
];
|
|
123
|
-
const CircleStop = createLucideIcon("circle-stop", __iconNode$
|
|
124
|
-
|
|
125
|
-
* @license lucide-react v0.575.0 - ISC
|
|
126
|
-
*
|
|
127
|
-
* This source code is licensed under the ISC license.
|
|
128
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
129
|
-
*/
|
|
130
|
-
const __iconNode$a = [
|
|
48
|
+
const CircleStop = createLucideIcon("circle-stop", __iconNode$9);
|
|
49
|
+
const __iconNode$8 = [
|
|
131
50
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
132
51
|
["path", { d: "m15 9-6 6", key: "1uzhvr" }],
|
|
133
52
|
["path", { d: "m9 9 6 6", key: "z0biqf" }]
|
|
134
53
|
];
|
|
135
|
-
const CircleX = createLucideIcon("circle-x", __iconNode$
|
|
136
|
-
|
|
137
|
-
* @license lucide-react v0.575.0 - ISC
|
|
138
|
-
*
|
|
139
|
-
* This source code is licensed under the ISC license.
|
|
140
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
141
|
-
*/
|
|
142
|
-
const __iconNode$9 = [["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]];
|
|
143
|
-
const Circle = createLucideIcon("circle", __iconNode$9);
|
|
144
|
-
/**
|
|
145
|
-
* @license lucide-react v0.575.0 - ISC
|
|
146
|
-
*
|
|
147
|
-
* This source code is licensed under the ISC license.
|
|
148
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
149
|
-
*/
|
|
150
|
-
const __iconNode$8 = [
|
|
54
|
+
const CircleX = createLucideIcon("circle-x", __iconNode$8);
|
|
55
|
+
const __iconNode$7 = [
|
|
151
56
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
152
57
|
["path", { d: "M12 6v6l4 2", key: "mmk7yg" }]
|
|
153
58
|
];
|
|
154
|
-
const Clock = createLucideIcon("clock", __iconNode$
|
|
155
|
-
|
|
156
|
-
* @license lucide-react v0.575.0 - ISC
|
|
157
|
-
*
|
|
158
|
-
* This source code is licensed under the ISC license.
|
|
159
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
160
|
-
*/
|
|
161
|
-
const __iconNode$7 = [
|
|
59
|
+
const Clock = createLucideIcon("clock", __iconNode$7);
|
|
60
|
+
const __iconNode$6 = [
|
|
162
61
|
[
|
|
163
62
|
"path",
|
|
164
63
|
{
|
|
@@ -167,48 +66,19 @@ const __iconNode$7 = [
|
|
|
167
66
|
}
|
|
168
67
|
]
|
|
169
68
|
];
|
|
170
|
-
const Diamond = createLucideIcon("diamond", __iconNode$
|
|
171
|
-
|
|
172
|
-
* @license lucide-react v0.575.0 - ISC
|
|
173
|
-
*
|
|
174
|
-
* This source code is licensed under the ISC license.
|
|
175
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
176
|
-
*/
|
|
177
|
-
const __iconNode$6 = [
|
|
69
|
+
const Diamond = createLucideIcon("diamond", __iconNode$6);
|
|
70
|
+
const __iconNode$5 = [
|
|
178
71
|
["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
|
|
179
72
|
["circle", { cx: "19", cy: "12", r: "1", key: "1wjl8i" }],
|
|
180
73
|
["circle", { cx: "5", cy: "12", r: "1", key: "1pcz8c" }]
|
|
181
74
|
];
|
|
182
|
-
const Ellipsis = createLucideIcon("ellipsis", __iconNode$
|
|
183
|
-
|
|
184
|
-
* @license lucide-react v0.575.0 - ISC
|
|
185
|
-
*
|
|
186
|
-
* This source code is licensed under the ISC license.
|
|
187
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
188
|
-
*/
|
|
189
|
-
const __iconNode$5 = [
|
|
75
|
+
const Ellipsis = createLucideIcon("ellipsis", __iconNode$5);
|
|
76
|
+
const __iconNode$4 = [
|
|
190
77
|
["path", { d: "M9 17H7A5 5 0 0 1 7 7h2", key: "8i5ue5" }],
|
|
191
78
|
["path", { d: "M15 7h2a5 5 0 1 1 0 10h-2", key: "1b9ql8" }],
|
|
192
79
|
["line", { x1: "8", x2: "16", y1: "12", y2: "12", key: "1jonct" }]
|
|
193
80
|
];
|
|
194
|
-
const Link2 = createLucideIcon("link-2", __iconNode$
|
|
195
|
-
/**
|
|
196
|
-
* @license lucide-react v0.575.0 - ISC
|
|
197
|
-
*
|
|
198
|
-
* This source code is licensed under the ISC license.
|
|
199
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
200
|
-
*/
|
|
201
|
-
const __iconNode$4 = [
|
|
202
|
-
["path", { d: "M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8", key: "1p45f6" }],
|
|
203
|
-
["path", { d: "M21 3v5h-5", key: "1q7to0" }]
|
|
204
|
-
];
|
|
205
|
-
const RotateCw = createLucideIcon("rotate-cw", __iconNode$4);
|
|
206
|
-
/**
|
|
207
|
-
* @license lucide-react v0.575.0 - ISC
|
|
208
|
-
*
|
|
209
|
-
* This source code is licensed under the ISC license.
|
|
210
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
211
|
-
*/
|
|
81
|
+
const Link2 = createLucideIcon("link-2", __iconNode$4);
|
|
212
82
|
const __iconNode$3 = [
|
|
213
83
|
[
|
|
214
84
|
"path",
|
|
@@ -220,12 +90,6 @@ const __iconNode$3 = [
|
|
|
220
90
|
["path", { d: "m21.854 2.147-10.94 10.939", key: "12cjpa" }]
|
|
221
91
|
];
|
|
222
92
|
const Send = createLucideIcon("send", __iconNode$3);
|
|
223
|
-
/**
|
|
224
|
-
* @license lucide-react v0.575.0 - ISC
|
|
225
|
-
*
|
|
226
|
-
* This source code is licensed under the ISC license.
|
|
227
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
228
|
-
*/
|
|
229
93
|
const __iconNode$2 = [
|
|
230
94
|
[
|
|
231
95
|
"path",
|
|
@@ -236,23 +100,11 @@ const __iconNode$2 = [
|
|
|
236
100
|
]
|
|
237
101
|
];
|
|
238
102
|
const Wrench = createLucideIcon("wrench", __iconNode$2);
|
|
239
|
-
/**
|
|
240
|
-
* @license lucide-react v0.575.0 - ISC
|
|
241
|
-
*
|
|
242
|
-
* This source code is licensed under the ISC license.
|
|
243
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
244
|
-
*/
|
|
245
103
|
const __iconNode$1 = [
|
|
246
104
|
["path", { d: "M18 6 6 18", key: "1bl5f8" }],
|
|
247
105
|
["path", { d: "m6 6 12 12", key: "d8bk6v" }]
|
|
248
106
|
];
|
|
249
107
|
const X = createLucideIcon("x", __iconNode$1);
|
|
250
|
-
/**
|
|
251
|
-
* @license lucide-react v0.575.0 - ISC
|
|
252
|
-
*
|
|
253
|
-
* This source code is licensed under the ISC license.
|
|
254
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
255
|
-
*/
|
|
256
108
|
const __iconNode = [
|
|
257
109
|
[
|
|
258
110
|
"path",
|
|
@@ -282,8 +134,7 @@ class ErrorBoundary extends reactExports.Component {
|
|
|
282
134
|
this.setState({ hasError: false, error: null });
|
|
283
135
|
}
|
|
284
136
|
componentDidCatch(error, errorInfo) {
|
|
285
|
-
|
|
286
|
-
(_b = (_a2 = this.props).onCatch) == null ? void 0 : _b.call(_a2, error, () => this.retry());
|
|
137
|
+
this.props.onCatch?.(error, () => this.retry());
|
|
287
138
|
}
|
|
288
139
|
render() {
|
|
289
140
|
if (this.state.hasError) {
|
|
@@ -291,16 +142,16 @@ class ErrorBoundary extends reactExports.Component {
|
|
|
291
142
|
return this.props.fallback;
|
|
292
143
|
}
|
|
293
144
|
const err = this.state.error instanceof Error ? this.state.error : null;
|
|
294
|
-
const errorDetails =
|
|
145
|
+
const errorDetails = err?.stack ? `${err.message}
|
|
295
146
|
|
|
296
|
-
${err.stack}` :
|
|
147
|
+
${err.stack}` : err?.message ?? "Unknown error";
|
|
297
148
|
return jsxRuntimeExports.jsx(ErrorCard, { title: this.props.title || "An error occurred", details: errorDetails });
|
|
298
149
|
}
|
|
299
150
|
return this.props.children;
|
|
300
151
|
}
|
|
301
152
|
}
|
|
302
153
|
function eventTimestamp(event) {
|
|
303
|
-
const value =
|
|
154
|
+
const value = event?.occurredAt ?? event?.createdAt;
|
|
304
155
|
if (!value)
|
|
305
156
|
return void 0;
|
|
306
157
|
const date2 = value instanceof Date ? value : new Date(value);
|
|
@@ -313,27 +164,25 @@ function tokenOf(startHook) {
|
|
|
313
164
|
return typeof token === "string" && token.length > 0 ? token : void 0;
|
|
314
165
|
}
|
|
315
166
|
function findStartHookCreation(events, run) {
|
|
316
|
-
var _a2, _b;
|
|
317
167
|
const creationEvent = events.find(isRunCreationEvent);
|
|
318
|
-
const runId =
|
|
319
|
-
if (!
|
|
168
|
+
const runId = run?.runId ?? creationEvent?.runId ?? events[0]?.runId;
|
|
169
|
+
if (!runId?.startsWith("wrun_") || runId.length <= "wrun_".length) {
|
|
320
170
|
return void 0;
|
|
321
171
|
}
|
|
322
172
|
const hookId = startHookId(runId);
|
|
323
|
-
const token = tokenOf(creationEvent && "eventData" in creationEvent ?
|
|
173
|
+
const token = tokenOf(creationEvent && "eventData" in creationEvent ? creationEvent.eventData?.startHook : void 0) ?? tokenOf(run?.startHook);
|
|
324
174
|
const hookEvents = events.filter((event) => event.correlationId === hookId && isHookLifecycleEventType(event.eventType));
|
|
325
175
|
if (token === void 0 && hookEvents.length === 0)
|
|
326
176
|
return void 0;
|
|
327
177
|
if (hookEvents.some((event) => event.eventType === "hook_created")) {
|
|
328
178
|
return void 0;
|
|
329
179
|
}
|
|
330
|
-
const createdAt = eventTimestamp(creationEvent) ?? (
|
|
180
|
+
const createdAt = eventTimestamp(creationEvent) ?? (run?.createdAt ? new Date(run.createdAt) : void 0) ?? eventTimestamp(hookEvents[0]);
|
|
331
181
|
if (!createdAt)
|
|
332
182
|
return void 0;
|
|
333
183
|
return { hookId, runId, token, createdAt };
|
|
334
184
|
}
|
|
335
185
|
function ResolveHookModal({ isOpen, onClose, onSubmit, isSubmitting = false }) {
|
|
336
|
-
var _a2;
|
|
337
186
|
const [jsonInput, setJsonInput] = reactExports.useState("");
|
|
338
187
|
const [parseError, setParseError] = reactExports.useState(null);
|
|
339
188
|
const textareaRef = reactExports.useRef(null);
|
|
@@ -376,7 +225,7 @@ function ResolveHookModal({ isOpen, onClose, onSubmit, isSubmitting = false }) {
|
|
|
376
225
|
e.preventDefault();
|
|
377
226
|
void submitPayload();
|
|
378
227
|
}, [submitPayload]);
|
|
379
|
-
const isMacPlatform = typeof navigator !== "undefined" && (
|
|
228
|
+
const isMacPlatform = typeof navigator !== "undefined" && (navigator.userAgentData?.platform ?? navigator.userAgent).toLowerCase().includes("mac");
|
|
380
229
|
const handleKeyDown = reactExports.useCallback((e) => {
|
|
381
230
|
if ((e.metaKey || e.ctrlKey) && e.key === "Enter" && !isSubmitting) {
|
|
382
231
|
e.preventDefault();
|
|
@@ -397,7 +246,7 @@ const millisecondsInMinute = 6e4;
|
|
|
397
246
|
const minutesInYear = 525600;
|
|
398
247
|
const minutesInMonth = 43200;
|
|
399
248
|
const minutesInDay = 1440;
|
|
400
|
-
const constructFromSymbol = Symbol.for("constructDateFrom");
|
|
249
|
+
const constructFromSymbol = /* @__PURE__ */ Symbol.for("constructDateFrom");
|
|
401
250
|
function constructFrom(date2, value) {
|
|
402
251
|
if (typeof date2 === "function") return date2(value);
|
|
403
252
|
if (date2 && typeof date2 === "object" && constructFromSymbol in date2)
|
|
@@ -412,22 +261,21 @@ let defaultOptions$1 = {};
|
|
|
412
261
|
function getDefaultOptions() {
|
|
413
262
|
return defaultOptions$1;
|
|
414
263
|
}
|
|
415
|
-
function startOfWeek(date2,
|
|
416
|
-
var _a2, _b, _c, _d;
|
|
264
|
+
function startOfWeek(date2, options2) {
|
|
417
265
|
const defaultOptions2 = getDefaultOptions();
|
|
418
|
-
const weekStartsOn =
|
|
419
|
-
const _date = toDate(date2,
|
|
266
|
+
const weekStartsOn = options2?.weekStartsOn ?? options2?.locale?.options?.weekStartsOn ?? defaultOptions2.weekStartsOn ?? defaultOptions2.locale?.options?.weekStartsOn ?? 0;
|
|
267
|
+
const _date = toDate(date2, options2?.in);
|
|
420
268
|
const day = _date.getDay();
|
|
421
269
|
const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
|
|
422
270
|
_date.setDate(_date.getDate() - diff);
|
|
423
271
|
_date.setHours(0, 0, 0, 0);
|
|
424
272
|
return _date;
|
|
425
273
|
}
|
|
426
|
-
function startOfISOWeek(date2,
|
|
427
|
-
return startOfWeek(date2, { ...
|
|
274
|
+
function startOfISOWeek(date2, options2) {
|
|
275
|
+
return startOfWeek(date2, { ...options2, weekStartsOn: 1 });
|
|
428
276
|
}
|
|
429
|
-
function getISOWeekYear(date2,
|
|
430
|
-
const _date = toDate(date2,
|
|
277
|
+
function getISOWeekYear(date2, options2) {
|
|
278
|
+
const _date = toDate(date2, options2?.in);
|
|
431
279
|
const year = _date.getFullYear();
|
|
432
280
|
const fourthOfJanuaryOfNextYear = constructFrom(_date, 0);
|
|
433
281
|
fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);
|
|
@@ -468,14 +316,14 @@ function normalizeDates(context, ...dates) {
|
|
|
468
316
|
);
|
|
469
317
|
return dates.map(normalize2);
|
|
470
318
|
}
|
|
471
|
-
function startOfDay(date2,
|
|
472
|
-
const _date = toDate(date2,
|
|
319
|
+
function startOfDay(date2, options2) {
|
|
320
|
+
const _date = toDate(date2, options2?.in);
|
|
473
321
|
_date.setHours(0, 0, 0, 0);
|
|
474
322
|
return _date;
|
|
475
323
|
}
|
|
476
|
-
function differenceInCalendarDays(laterDate, earlierDate,
|
|
324
|
+
function differenceInCalendarDays(laterDate, earlierDate, options2) {
|
|
477
325
|
const [laterDate_, earlierDate_] = normalizeDates(
|
|
478
|
-
|
|
326
|
+
options2?.in,
|
|
479
327
|
laterDate,
|
|
480
328
|
earlierDate
|
|
481
329
|
);
|
|
@@ -485,8 +333,8 @@ function differenceInCalendarDays(laterDate, earlierDate, options) {
|
|
|
485
333
|
const earlierTimestamp = +earlierStartOfDay - getTimezoneOffsetInMilliseconds(earlierStartOfDay);
|
|
486
334
|
return Math.round((laterTimestamp - earlierTimestamp) / millisecondsInDay);
|
|
487
335
|
}
|
|
488
|
-
function startOfISOWeekYear(date2,
|
|
489
|
-
const year = getISOWeekYear(date2,
|
|
336
|
+
function startOfISOWeekYear(date2, options2) {
|
|
337
|
+
const year = getISOWeekYear(date2, options2);
|
|
490
338
|
const fourthOfJanuary = constructFrom(date2, 0);
|
|
491
339
|
fourthOfJanuary.setFullYear(year, 0, 4);
|
|
492
340
|
fourthOfJanuary.setHours(0, 0, 0, 0);
|
|
@@ -514,8 +362,8 @@ function getRoundingMethod(method) {
|
|
|
514
362
|
return result === 0 ? 0 : result;
|
|
515
363
|
};
|
|
516
364
|
}
|
|
517
|
-
function startOfYear(date2,
|
|
518
|
-
const date_ = toDate(date2,
|
|
365
|
+
function startOfYear(date2, options2) {
|
|
366
|
+
const date_ = toDate(date2, options2?.in);
|
|
519
367
|
date_.setFullYear(date_.getFullYear(), 0, 1);
|
|
520
368
|
date_.setHours(0, 0, 0, 0);
|
|
521
369
|
return date_;
|
|
@@ -583,7 +431,7 @@ const formatDistanceLocale = {
|
|
|
583
431
|
other: "almost {{count}} years"
|
|
584
432
|
}
|
|
585
433
|
};
|
|
586
|
-
const formatDistance = (token, count2,
|
|
434
|
+
const formatDistance = (token, count2, options2) => {
|
|
587
435
|
let result;
|
|
588
436
|
const tokenValue = formatDistanceLocale[token];
|
|
589
437
|
if (typeof tokenValue === "string") {
|
|
@@ -593,8 +441,8 @@ const formatDistance = (token, count2, options) => {
|
|
|
593
441
|
} else {
|
|
594
442
|
result = tokenValue.other.replace("{{count}}", count2.toString());
|
|
595
443
|
}
|
|
596
|
-
if (
|
|
597
|
-
if (
|
|
444
|
+
if (options2?.addSuffix) {
|
|
445
|
+
if (options2.comparison && options2.comparison > 0) {
|
|
598
446
|
return "in " + result;
|
|
599
447
|
} else {
|
|
600
448
|
return result + " ago";
|
|
@@ -603,8 +451,8 @@ const formatDistance = (token, count2, options) => {
|
|
|
603
451
|
return result;
|
|
604
452
|
};
|
|
605
453
|
function buildFormatLongFn(args) {
|
|
606
|
-
return (
|
|
607
|
-
const width =
|
|
454
|
+
return (options2 = {}) => {
|
|
455
|
+
const width = options2.width ? String(options2.width) : args.defaultWidth;
|
|
608
456
|
const format2 = args.formats[width] || args.formats[args.defaultWidth];
|
|
609
457
|
return format2;
|
|
610
458
|
};
|
|
@@ -651,16 +499,16 @@ const formatRelativeLocale = {
|
|
|
651
499
|
};
|
|
652
500
|
const formatRelative$1 = (token, _date, _baseDate, _options) => formatRelativeLocale[token];
|
|
653
501
|
function buildLocalizeFn(args) {
|
|
654
|
-
return (value,
|
|
655
|
-
const context =
|
|
502
|
+
return (value, options2) => {
|
|
503
|
+
const context = options2?.context ? String(options2.context) : "standalone";
|
|
656
504
|
let valuesArray;
|
|
657
505
|
if (context === "formatting" && args.formattingValues) {
|
|
658
506
|
const defaultWidth2 = args.defaultFormattingWidth || args.defaultWidth;
|
|
659
|
-
const width =
|
|
507
|
+
const width = options2?.width ? String(options2.width) : defaultWidth2;
|
|
660
508
|
valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth2];
|
|
661
509
|
} else {
|
|
662
510
|
const defaultWidth2 = args.defaultWidth;
|
|
663
|
-
const width =
|
|
511
|
+
const width = options2?.width ? String(options2.width) : args.defaultWidth;
|
|
664
512
|
valuesArray = args.values[width] || args.values[defaultWidth2];
|
|
665
513
|
}
|
|
666
514
|
const index2 = args.argumentCallback ? args.argumentCallback(value) : value;
|
|
@@ -828,8 +676,8 @@ const localize = {
|
|
|
828
676
|
})
|
|
829
677
|
};
|
|
830
678
|
function buildMatchFn(args) {
|
|
831
|
-
return (string,
|
|
832
|
-
const width =
|
|
679
|
+
return (string, options2 = {}) => {
|
|
680
|
+
const width = options2.width;
|
|
833
681
|
const matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
|
|
834
682
|
const matchResult = string.match(matchPattern);
|
|
835
683
|
if (!matchResult) {
|
|
@@ -843,9 +691,9 @@ function buildMatchFn(args) {
|
|
|
843
691
|
);
|
|
844
692
|
let value;
|
|
845
693
|
value = args.valueCallback ? args.valueCallback(key) : key;
|
|
846
|
-
value =
|
|
694
|
+
value = options2.valueCallback ? (
|
|
847
695
|
// [TODO] -- I challenge you to fix the type
|
|
848
|
-
|
|
696
|
+
options2.valueCallback(value)
|
|
849
697
|
) : value;
|
|
850
698
|
const rest = string.slice(matchedString.length);
|
|
851
699
|
return { value, rest };
|
|
@@ -868,14 +716,14 @@ function findIndex(array2, predicate) {
|
|
|
868
716
|
return void 0;
|
|
869
717
|
}
|
|
870
718
|
function buildMatchPatternFn(args) {
|
|
871
|
-
return (string,
|
|
719
|
+
return (string, options2 = {}) => {
|
|
872
720
|
const matchResult = string.match(args.matchPattern);
|
|
873
721
|
if (!matchResult) return null;
|
|
874
722
|
const matchedString = matchResult[0];
|
|
875
723
|
const parseResult = string.match(args.parsePattern);
|
|
876
724
|
if (!parseResult) return null;
|
|
877
725
|
let value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
|
|
878
|
-
value =
|
|
726
|
+
value = options2.valueCallback ? options2.valueCallback(value) : value;
|
|
879
727
|
const rest = string.slice(matchedString.length);
|
|
880
728
|
return { value, rest };
|
|
881
729
|
};
|
|
@@ -1009,31 +857,30 @@ const enUS = {
|
|
|
1009
857
|
firstWeekContainsDate: 1
|
|
1010
858
|
}
|
|
1011
859
|
};
|
|
1012
|
-
function getDayOfYear(date2,
|
|
1013
|
-
const _date = toDate(date2,
|
|
860
|
+
function getDayOfYear(date2, options2) {
|
|
861
|
+
const _date = toDate(date2, options2?.in);
|
|
1014
862
|
const diff = differenceInCalendarDays(_date, startOfYear(_date));
|
|
1015
863
|
const dayOfYear = diff + 1;
|
|
1016
864
|
return dayOfYear;
|
|
1017
865
|
}
|
|
1018
|
-
function getISOWeek(date2,
|
|
1019
|
-
const _date = toDate(date2,
|
|
866
|
+
function getISOWeek(date2, options2) {
|
|
867
|
+
const _date = toDate(date2, options2?.in);
|
|
1020
868
|
const diff = +startOfISOWeek(_date) - +startOfISOWeekYear(_date);
|
|
1021
869
|
return Math.round(diff / millisecondsInWeek) + 1;
|
|
1022
870
|
}
|
|
1023
|
-
function getWeekYear(date2,
|
|
1024
|
-
|
|
1025
|
-
const _date = toDate(date2, options == null ? void 0 : options.in);
|
|
871
|
+
function getWeekYear(date2, options2) {
|
|
872
|
+
const _date = toDate(date2, options2?.in);
|
|
1026
873
|
const year = _date.getFullYear();
|
|
1027
874
|
const defaultOptions2 = getDefaultOptions();
|
|
1028
|
-
const firstWeekContainsDate =
|
|
1029
|
-
const firstWeekOfNextYear = constructFrom(
|
|
875
|
+
const firstWeekContainsDate = options2?.firstWeekContainsDate ?? options2?.locale?.options?.firstWeekContainsDate ?? defaultOptions2.firstWeekContainsDate ?? defaultOptions2.locale?.options?.firstWeekContainsDate ?? 1;
|
|
876
|
+
const firstWeekOfNextYear = constructFrom(options2?.in || date2, 0);
|
|
1030
877
|
firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);
|
|
1031
878
|
firstWeekOfNextYear.setHours(0, 0, 0, 0);
|
|
1032
|
-
const startOfNextYear = startOfWeek(firstWeekOfNextYear,
|
|
1033
|
-
const firstWeekOfThisYear = constructFrom(
|
|
879
|
+
const startOfNextYear = startOfWeek(firstWeekOfNextYear, options2);
|
|
880
|
+
const firstWeekOfThisYear = constructFrom(options2?.in || date2, 0);
|
|
1034
881
|
firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);
|
|
1035
882
|
firstWeekOfThisYear.setHours(0, 0, 0, 0);
|
|
1036
|
-
const startOfThisYear = startOfWeek(firstWeekOfThisYear,
|
|
883
|
+
const startOfThisYear = startOfWeek(firstWeekOfThisYear, options2);
|
|
1037
884
|
if (+_date >= +startOfNextYear) {
|
|
1038
885
|
return year + 1;
|
|
1039
886
|
} else if (+_date >= +startOfThisYear) {
|
|
@@ -1042,20 +889,19 @@ function getWeekYear(date2, options) {
|
|
|
1042
889
|
return year - 1;
|
|
1043
890
|
}
|
|
1044
891
|
}
|
|
1045
|
-
function startOfWeekYear(date2,
|
|
1046
|
-
var _a2, _b, _c, _d;
|
|
892
|
+
function startOfWeekYear(date2, options2) {
|
|
1047
893
|
const defaultOptions2 = getDefaultOptions();
|
|
1048
|
-
const firstWeekContainsDate =
|
|
1049
|
-
const year = getWeekYear(date2,
|
|
1050
|
-
const firstWeek = constructFrom(
|
|
894
|
+
const firstWeekContainsDate = options2?.firstWeekContainsDate ?? options2?.locale?.options?.firstWeekContainsDate ?? defaultOptions2.firstWeekContainsDate ?? defaultOptions2.locale?.options?.firstWeekContainsDate ?? 1;
|
|
895
|
+
const year = getWeekYear(date2, options2);
|
|
896
|
+
const firstWeek = constructFrom(options2?.in || date2, 0);
|
|
1051
897
|
firstWeek.setFullYear(year, 0, firstWeekContainsDate);
|
|
1052
898
|
firstWeek.setHours(0, 0, 0, 0);
|
|
1053
|
-
const _date = startOfWeek(firstWeek,
|
|
899
|
+
const _date = startOfWeek(firstWeek, options2);
|
|
1054
900
|
return _date;
|
|
1055
901
|
}
|
|
1056
|
-
function getWeek(date2,
|
|
1057
|
-
const _date = toDate(date2,
|
|
1058
|
-
const diff = +startOfWeek(_date,
|
|
902
|
+
function getWeek(date2, options2) {
|
|
903
|
+
const _date = toDate(date2, options2?.in);
|
|
904
|
+
const diff = +startOfWeek(_date, options2) - +startOfWeekYear(_date, options2);
|
|
1059
905
|
return Math.round(diff / millisecondsInWeek) + 1;
|
|
1060
906
|
}
|
|
1061
907
|
function addLeadingZeros(number, targetLength) {
|
|
@@ -1158,8 +1004,8 @@ const formatters = {
|
|
|
1158
1004
|
return lightFormatters.y(date2, token);
|
|
1159
1005
|
},
|
|
1160
1006
|
// Local week-numbering year
|
|
1161
|
-
Y: function(date2, token, localize2,
|
|
1162
|
-
const signedWeekYear = getWeekYear(date2,
|
|
1007
|
+
Y: function(date2, token, localize2, options2) {
|
|
1008
|
+
const signedWeekYear = getWeekYear(date2, options2);
|
|
1163
1009
|
const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
|
|
1164
1010
|
if (token === "YY") {
|
|
1165
1011
|
const twoDigitYear = weekYear % 100;
|
|
@@ -1316,8 +1162,8 @@ const formatters = {
|
|
|
1316
1162
|
}
|
|
1317
1163
|
},
|
|
1318
1164
|
// Local week of year
|
|
1319
|
-
w: function(date2, token, localize2,
|
|
1320
|
-
const week = getWeek(date2,
|
|
1165
|
+
w: function(date2, token, localize2, options2) {
|
|
1166
|
+
const week = getWeek(date2, options2);
|
|
1321
1167
|
if (token === "wo") {
|
|
1322
1168
|
return localize2.ordinalNumber(week, { unit: "week" });
|
|
1323
1169
|
}
|
|
@@ -1380,9 +1226,9 @@ const formatters = {
|
|
|
1380
1226
|
}
|
|
1381
1227
|
},
|
|
1382
1228
|
// Local day of week
|
|
1383
|
-
e: function(date2, token, localize2,
|
|
1229
|
+
e: function(date2, token, localize2, options2) {
|
|
1384
1230
|
const dayOfWeek = date2.getDay();
|
|
1385
|
-
const localDayOfWeek = (dayOfWeek -
|
|
1231
|
+
const localDayOfWeek = (dayOfWeek - options2.weekStartsOn + 8) % 7 || 7;
|
|
1386
1232
|
switch (token) {
|
|
1387
1233
|
// Numerical value (Nth day of week with current locale or weekStartsOn)
|
|
1388
1234
|
case "e":
|
|
@@ -1420,9 +1266,9 @@ const formatters = {
|
|
|
1420
1266
|
}
|
|
1421
1267
|
},
|
|
1422
1268
|
// Stand-alone local day of week
|
|
1423
|
-
c: function(date2, token, localize2,
|
|
1269
|
+
c: function(date2, token, localize2, options2) {
|
|
1424
1270
|
const dayOfWeek = date2.getDay();
|
|
1425
|
-
const localDayOfWeek = (dayOfWeek -
|
|
1271
|
+
const localDayOfWeek = (dayOfWeek - options2.weekStartsOn + 8) % 7 || 7;
|
|
1426
1272
|
switch (token) {
|
|
1427
1273
|
// Numerical value (same as in `e`)
|
|
1428
1274
|
case "c":
|
|
@@ -1841,13 +1687,12 @@ const longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
|
|
|
1841
1687
|
const escapedStringRegExp = /^'([^]*?)'?$/;
|
|
1842
1688
|
const doubleQuoteRegExp = /''/g;
|
|
1843
1689
|
const unescapedLatinCharacterRegExp = /[a-zA-Z]/;
|
|
1844
|
-
function format(date2, formatStr,
|
|
1845
|
-
var _a2, _b, _c, _d, _e, _f, _g, _h;
|
|
1690
|
+
function format(date2, formatStr, options2) {
|
|
1846
1691
|
const defaultOptions2 = getDefaultOptions();
|
|
1847
|
-
const locale =
|
|
1848
|
-
const firstWeekContainsDate =
|
|
1849
|
-
const weekStartsOn =
|
|
1850
|
-
const originalDate = toDate(date2,
|
|
1692
|
+
const locale = options2?.locale ?? defaultOptions2.locale ?? enUS;
|
|
1693
|
+
const firstWeekContainsDate = options2?.firstWeekContainsDate ?? options2?.locale?.options?.firstWeekContainsDate ?? defaultOptions2.firstWeekContainsDate ?? defaultOptions2.locale?.options?.firstWeekContainsDate ?? 1;
|
|
1694
|
+
const weekStartsOn = options2?.weekStartsOn ?? options2?.locale?.options?.weekStartsOn ?? defaultOptions2.weekStartsOn ?? defaultOptions2.locale?.options?.weekStartsOn ?? 0;
|
|
1695
|
+
const originalDate = toDate(date2, options2?.in);
|
|
1851
1696
|
if (!isValid(originalDate)) {
|
|
1852
1697
|
throw new RangeError("Invalid time value");
|
|
1853
1698
|
}
|
|
@@ -1887,7 +1732,7 @@ function format(date2, formatStr, options) {
|
|
|
1887
1732
|
return parts.map((part) => {
|
|
1888
1733
|
if (!part.isToken) return part.value;
|
|
1889
1734
|
const token = part.value;
|
|
1890
|
-
if (!
|
|
1735
|
+
if (!options2?.useAdditionalWeekYearTokens && isProtectedWeekYearToken(token) || !options2?.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(token)) {
|
|
1891
1736
|
warnOrThrowProtectedError(token, formatStr, String(date2));
|
|
1892
1737
|
}
|
|
1893
1738
|
const formatter = formatters[token[0]];
|
|
@@ -1901,27 +1746,27 @@ function cleanEscapedString(input) {
|
|
|
1901
1746
|
}
|
|
1902
1747
|
return matched[1].replace(doubleQuoteRegExp, "'");
|
|
1903
1748
|
}
|
|
1904
|
-
function formatDistanceStrict(laterDate, earlierDate,
|
|
1749
|
+
function formatDistanceStrict(laterDate, earlierDate, options2) {
|
|
1905
1750
|
const defaultOptions2 = getDefaultOptions();
|
|
1906
|
-
const locale =
|
|
1751
|
+
const locale = options2?.locale ?? defaultOptions2.locale ?? enUS;
|
|
1907
1752
|
const comparison = compareAsc(laterDate, earlierDate);
|
|
1908
1753
|
if (isNaN(comparison)) {
|
|
1909
1754
|
throw new RangeError("Invalid time value");
|
|
1910
1755
|
}
|
|
1911
|
-
const localizeOptions = Object.assign({},
|
|
1912
|
-
addSuffix:
|
|
1756
|
+
const localizeOptions = Object.assign({}, options2, {
|
|
1757
|
+
addSuffix: options2?.addSuffix,
|
|
1913
1758
|
comparison
|
|
1914
1759
|
});
|
|
1915
1760
|
const [laterDate_, earlierDate_] = normalizeDates(
|
|
1916
|
-
|
|
1761
|
+
options2?.in,
|
|
1917
1762
|
...comparison > 0 ? [earlierDate, laterDate] : [laterDate, earlierDate]
|
|
1918
1763
|
);
|
|
1919
|
-
const roundingMethod = getRoundingMethod(
|
|
1764
|
+
const roundingMethod = getRoundingMethod(options2?.roundingMethod ?? "round");
|
|
1920
1765
|
const milliseconds = earlierDate_.getTime() - laterDate_.getTime();
|
|
1921
1766
|
const minutes = milliseconds / millisecondsInMinute;
|
|
1922
1767
|
const timezoneOffset = getTimezoneOffsetInMilliseconds(earlierDate_) - getTimezoneOffsetInMilliseconds(laterDate_);
|
|
1923
1768
|
const dstNormalizedMinutes = (milliseconds - timezoneOffset) / millisecondsInMinute;
|
|
1924
|
-
const defaultUnit =
|
|
1769
|
+
const defaultUnit = options2?.unit;
|
|
1925
1770
|
let unit;
|
|
1926
1771
|
if (!defaultUnit) {
|
|
1927
1772
|
if (minutes < 1) {
|
|
@@ -1960,15 +1805,14 @@ function formatDistanceStrict(laterDate, earlierDate, options) {
|
|
|
1960
1805
|
return locale.formatDistance("xYears", years, localizeOptions);
|
|
1961
1806
|
}
|
|
1962
1807
|
}
|
|
1963
|
-
function formatDistanceToNowStrict(date2,
|
|
1964
|
-
return formatDistanceStrict(date2, constructNow(date2),
|
|
1808
|
+
function formatDistanceToNowStrict(date2, options2) {
|
|
1809
|
+
return formatDistanceStrict(date2, constructNow(date2), options2);
|
|
1965
1810
|
}
|
|
1966
|
-
function formatRelative(date2, baseDate,
|
|
1967
|
-
|
|
1968
|
-
const [date_, baseDate_] = normalizeDates(options == null ? void 0 : options.in, date2, baseDate);
|
|
1811
|
+
function formatRelative(date2, baseDate, options2) {
|
|
1812
|
+
const [date_, baseDate_] = normalizeDates(options2?.in, date2, baseDate);
|
|
1969
1813
|
const defaultOptions2 = getDefaultOptions();
|
|
1970
1814
|
const locale = defaultOptions2.locale ?? enUS;
|
|
1971
|
-
const weekStartsOn = defaultOptions2.weekStartsOn ??
|
|
1815
|
+
const weekStartsOn = defaultOptions2.weekStartsOn ?? defaultOptions2.locale?.options?.weekStartsOn ?? 0;
|
|
1972
1816
|
const diff = differenceInCalendarDays(date_, baseDate_);
|
|
1973
1817
|
if (isNaN(diff)) {
|
|
1974
1818
|
throw new RangeError("Invalid time value");
|
|
@@ -2631,7 +2475,7 @@ function createCollection2(name) {
|
|
|
2631
2475
|
reactExports.useEffect(() => {
|
|
2632
2476
|
const element = ref.current;
|
|
2633
2477
|
const registered = registeredRef.current;
|
|
2634
|
-
if ((
|
|
2478
|
+
if ((registered?.element ?? null) === element && (!element || registered?.itemData === memoizedItemData)) {
|
|
2635
2479
|
return;
|
|
2636
2480
|
}
|
|
2637
2481
|
registeredRef.current = element ? { element, itemData: memoizedItemData } : null;
|
|
@@ -2776,8 +2620,8 @@ function useFocusGuards() {
|
|
|
2776
2620
|
count++;
|
|
2777
2621
|
return () => {
|
|
2778
2622
|
if (count === 1) {
|
|
2779
|
-
guards
|
|
2780
|
-
guards
|
|
2623
|
+
guards?.start.remove();
|
|
2624
|
+
guards?.end.remove();
|
|
2781
2625
|
guards = null;
|
|
2782
2626
|
}
|
|
2783
2627
|
count = Math.max(0, count - 1);
|
|
@@ -3353,12 +3197,12 @@ function innerCreateMedium(defaults, middleware2) {
|
|
|
3353
3197
|
};
|
|
3354
3198
|
return medium;
|
|
3355
3199
|
}
|
|
3356
|
-
function createSidecarMedium(
|
|
3357
|
-
if (
|
|
3358
|
-
|
|
3200
|
+
function createSidecarMedium(options2) {
|
|
3201
|
+
if (options2 === void 0) {
|
|
3202
|
+
options2 = {};
|
|
3359
3203
|
}
|
|
3360
3204
|
var medium = innerCreateMedium(null);
|
|
3361
|
-
medium.options = __assign({ async: true, ssr: false },
|
|
3205
|
+
medium.options = __assign({ async: true, ssr: false }, options2);
|
|
3362
3206
|
return medium;
|
|
3363
3207
|
}
|
|
3364
3208
|
var SideCar$1 = function(_a2) {
|
|
@@ -4039,14 +3883,13 @@ var MenuContentImpl = /* @__PURE__ */ reactExports.forwardRef(
|
|
|
4039
3883
|
shards
|
|
4040
3884
|
} : void 0;
|
|
4041
3885
|
const handleTypeaheadSearch = /* @__PURE__ */ __name$3((key) => {
|
|
4042
|
-
var _a2, _b;
|
|
4043
3886
|
const search = searchRef.current + key;
|
|
4044
3887
|
const items = getItems().filter((item) => !item.disabled);
|
|
4045
3888
|
const currentItem = document.activeElement;
|
|
4046
|
-
const currentMatch =
|
|
3889
|
+
const currentMatch = items.find((item) => item.ref.current === currentItem)?.textValue;
|
|
4047
3890
|
const values = items.map((item) => item.textValue);
|
|
4048
3891
|
const nextMatch = getNextMatch(values, search, currentMatch);
|
|
4049
|
-
const newItem =
|
|
3892
|
+
const newItem = items.find((item) => item.textValue === nextMatch)?.ref.current;
|
|
4050
3893
|
function updateSearch(value) {
|
|
4051
3894
|
searchRef.current = value;
|
|
4052
3895
|
window.clearTimeout(timerRef.current);
|
|
@@ -4063,9 +3906,8 @@ var MenuContentImpl = /* @__PURE__ */ reactExports.forwardRef(
|
|
|
4063
3906
|
}, []);
|
|
4064
3907
|
useFocusGuards();
|
|
4065
3908
|
const isPointerMovingToSubmenu = reactExports.useCallback((event) => {
|
|
4066
|
-
|
|
4067
|
-
|
|
4068
|
-
return isMovingTowards && isPointerInGraceArea(event, (_b = pointerGraceIntentRef.current) == null ? void 0 : _b.area);
|
|
3909
|
+
const isMovingTowards = pointerDirRef.current === pointerGraceIntentRef.current?.side;
|
|
3910
|
+
return isMovingTowards && isPointerInGraceArea(event, pointerGraceIntentRef.current?.area);
|
|
4069
3911
|
}, []);
|
|
4070
3912
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
4071
3913
|
MenuContentProvider,
|
|
@@ -4080,9 +3922,8 @@ var MenuContentImpl = /* @__PURE__ */ reactExports.forwardRef(
|
|
|
4080
3922
|
),
|
|
4081
3923
|
onItemLeave: reactExports.useCallback(
|
|
4082
3924
|
(event) => {
|
|
4083
|
-
var _a2;
|
|
4084
3925
|
if (isPointerMovingToSubmenu(event)) return;
|
|
4085
|
-
|
|
3926
|
+
contentRef.current?.focus();
|
|
4086
3927
|
setCurrentItemId(null);
|
|
4087
3928
|
},
|
|
4088
3929
|
[isPointerMovingToSubmenu]
|
|
@@ -4104,9 +3945,8 @@ var MenuContentImpl = /* @__PURE__ */ reactExports.forwardRef(
|
|
|
4104
3945
|
trapped: trapFocus,
|
|
4105
3946
|
branches: branchNodes,
|
|
4106
3947
|
onMountAutoFocus: composeEventHandlers(onOpenAutoFocus, (event) => {
|
|
4107
|
-
var _a2;
|
|
4108
3948
|
event.preventDefault();
|
|
4109
|
-
|
|
3949
|
+
contentRef.current?.focus({ preventScroll: true });
|
|
4110
3950
|
}),
|
|
4111
3951
|
onUnmountAutoFocus: onCloseAutoFocus,
|
|
4112
3952
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -4214,7 +4054,7 @@ var MenuItem = /* @__PURE__ */ reactExports.forwardRef(
|
|
|
4214
4054
|
const menuItem = ref.current;
|
|
4215
4055
|
if (!disabled && menuItem) {
|
|
4216
4056
|
const itemSelectEvent = new CustomEvent(ITEM_SELECT, { bubbles: true, cancelable: true });
|
|
4217
|
-
menuItem.addEventListener(ITEM_SELECT, (event) => onSelect
|
|
4057
|
+
menuItem.addEventListener(ITEM_SELECT, (event) => onSelect?.(event), { once: true });
|
|
4218
4058
|
dispatchDiscreteCustomEvent(menuItem, itemSelectEvent);
|
|
4219
4059
|
if (itemSelectEvent.defaultPrevented) {
|
|
4220
4060
|
isPointerDownRef.current = false;
|
|
@@ -4231,13 +4071,11 @@ var MenuItem = /* @__PURE__ */ reactExports.forwardRef(
|
|
|
4231
4071
|
disabled,
|
|
4232
4072
|
onClick: composeEventHandlers(props.onClick, handleSelect),
|
|
4233
4073
|
onPointerDown: (event) => {
|
|
4234
|
-
|
|
4235
|
-
(_a2 = props.onPointerDown) == null ? void 0 : _a2.call(props, event);
|
|
4074
|
+
props.onPointerDown?.(event);
|
|
4236
4075
|
isPointerDownRef.current = true;
|
|
4237
4076
|
},
|
|
4238
4077
|
onPointerUp: composeEventHandlers(props.onPointerUp, (event) => {
|
|
4239
|
-
|
|
4240
|
-
if (!isPointerDownRef.current) (_a2 = event.currentTarget) == null ? void 0 : _a2.click();
|
|
4078
|
+
if (!isPointerDownRef.current) event.currentTarget?.click();
|
|
4241
4079
|
}),
|
|
4242
4080
|
onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {
|
|
4243
4081
|
if (disabled || event.target !== event.currentTarget) {
|
|
@@ -4326,7 +4164,7 @@ var MenuCheckboxItem = /* @__PURE__ */ reactExports.forwardRef(
|
|
|
4326
4164
|
"data-state": getCheckedState(checked),
|
|
4327
4165
|
onSelect: composeEventHandlers(
|
|
4328
4166
|
checkboxItemProps.onSelect,
|
|
4329
|
-
() => onCheckedChange
|
|
4167
|
+
() => onCheckedChange?.(isIndeterminate(checked) ? true : !checked),
|
|
4330
4168
|
{ checkForDefaultPrevented: false }
|
|
4331
4169
|
)
|
|
4332
4170
|
}
|
|
@@ -4355,10 +4193,7 @@ var MenuRadioItem = /* @__PURE__ */ reactExports.forwardRef(
|
|
|
4355
4193
|
"data-state": getCheckedState(checked),
|
|
4356
4194
|
onSelect: composeEventHandlers(
|
|
4357
4195
|
radioItemProps.onSelect,
|
|
4358
|
-
() =>
|
|
4359
|
-
var _a2;
|
|
4360
|
-
return (_a2 = context.onValueChange) == null ? void 0 : _a2.call(context, value);
|
|
4361
|
-
},
|
|
4196
|
+
() => context.onValueChange?.(value),
|
|
4362
4197
|
{ checkForDefaultPrevented: false }
|
|
4363
4198
|
)
|
|
4364
4199
|
}
|
|
@@ -4441,8 +4276,7 @@ var MenuSubTrigger = /* @__PURE__ */ reactExports.forwardRef(
|
|
|
4441
4276
|
...props,
|
|
4442
4277
|
ref: composedRefs,
|
|
4443
4278
|
onClick: (event) => {
|
|
4444
|
-
|
|
4445
|
-
(_a2 = props.onClick) == null ? void 0 : _a2.call(props, event);
|
|
4279
|
+
props.onClick?.(event);
|
|
4446
4280
|
if (props.disabled || event.defaultPrevented) return;
|
|
4447
4281
|
event.currentTarget.focus();
|
|
4448
4282
|
if (!context.open) context.onOpenChange(true);
|
|
@@ -4464,11 +4298,10 @@ var MenuSubTrigger = /* @__PURE__ */ reactExports.forwardRef(
|
|
|
4464
4298
|
onPointerLeave: composeEventHandlers(
|
|
4465
4299
|
props.onPointerLeave,
|
|
4466
4300
|
whenMouse((event) => {
|
|
4467
|
-
var _a2, _b;
|
|
4468
4301
|
clearOpenTimer();
|
|
4469
|
-
const contentRect =
|
|
4302
|
+
const contentRect = context.content?.getBoundingClientRect();
|
|
4470
4303
|
if (contentRect) {
|
|
4471
|
-
const side =
|
|
4304
|
+
const side = context.content?.dataset.side;
|
|
4472
4305
|
const rightSide = side === "right";
|
|
4473
4306
|
const bleed = rightSide ? -5 : 5;
|
|
4474
4307
|
const contentNearEdge = contentRect[rightSide ? "left" : "right"];
|
|
@@ -4498,7 +4331,6 @@ var MenuSubTrigger = /* @__PURE__ */ reactExports.forwardRef(
|
|
|
4498
4331
|
})
|
|
4499
4332
|
),
|
|
4500
4333
|
onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {
|
|
4501
|
-
var _a2;
|
|
4502
4334
|
if (props.disabled || event.target !== event.currentTarget) {
|
|
4503
4335
|
return;
|
|
4504
4336
|
}
|
|
@@ -4508,7 +4340,7 @@ var MenuSubTrigger = /* @__PURE__ */ reactExports.forwardRef(
|
|
|
4508
4340
|
}
|
|
4509
4341
|
if (SUB_OPEN_KEYS[rootContext.dir].includes(event.key)) {
|
|
4510
4342
|
context.onOpenChange(true);
|
|
4511
|
-
|
|
4343
|
+
context.content?.focus();
|
|
4512
4344
|
event.preventDefault();
|
|
4513
4345
|
}
|
|
4514
4346
|
})
|
|
@@ -4539,8 +4371,7 @@ var MenuSubContent = /* @__PURE__ */ reactExports.forwardRef(
|
|
|
4539
4371
|
disableOutsideScroll: false,
|
|
4540
4372
|
trapFocus: false,
|
|
4541
4373
|
onOpenAutoFocus: (event) => {
|
|
4542
|
-
|
|
4543
|
-
if (rootContext.isUsingKeyboardRef.current) (_a2 = ref.current) == null ? void 0 : _a2.focus();
|
|
4374
|
+
if (rootContext.isUsingKeyboardRef.current) ref.current?.focus();
|
|
4544
4375
|
event.preventDefault();
|
|
4545
4376
|
},
|
|
4546
4377
|
onCloseAutoFocus: (event) => event.preventDefault(),
|
|
@@ -4552,12 +4383,11 @@ var MenuSubContent = /* @__PURE__ */ reactExports.forwardRef(
|
|
|
4552
4383
|
event.preventDefault();
|
|
4553
4384
|
}),
|
|
4554
4385
|
onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {
|
|
4555
|
-
var _a2;
|
|
4556
4386
|
const isKeyDownInside = event.currentTarget.contains(event.target);
|
|
4557
4387
|
const isCloseKey = SUB_CLOSE_KEYS[rootContext.dir].includes(event.key);
|
|
4558
4388
|
if (isKeyDownInside && isCloseKey) {
|
|
4559
4389
|
context.onOpenChange(false);
|
|
4560
|
-
|
|
4390
|
+
subContext.trigger?.focus();
|
|
4561
4391
|
event.preventDefault();
|
|
4562
4392
|
}
|
|
4563
4393
|
})
|
|
@@ -4730,8 +4560,7 @@ var DropdownMenuContent$1 = /* @__PURE__ */ reactExports.forwardRef(
|
|
|
4730
4560
|
...contentProps,
|
|
4731
4561
|
ref: forwardedRef,
|
|
4732
4562
|
onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {
|
|
4733
|
-
|
|
4734
|
-
if (!hasInteractedOutsideRef.current) (_a2 = context.triggerRef.current) == null ? void 0 : _a2.focus();
|
|
4563
|
+
if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();
|
|
4735
4564
|
hasInteractedOutsideRef.current = false;
|
|
4736
4565
|
event.preventDefault();
|
|
4737
4566
|
}),
|
|
@@ -4934,15 +4763,6 @@ const DropdownMenuSeparator = reactExports.forwardRef(({ className, ...props },
|
|
|
4934
4763
|
DropdownMenuSeparator.displayName = DropdownMenuSeparator$1.displayName;
|
|
4935
4764
|
var shim = { exports: {} };
|
|
4936
4765
|
var useSyncExternalStoreShim_production = {};
|
|
4937
|
-
/**
|
|
4938
|
-
* @license React
|
|
4939
|
-
* use-sync-external-store-shim.production.js
|
|
4940
|
-
*
|
|
4941
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
4942
|
-
*
|
|
4943
|
-
* This source code is licensed under the MIT license found in the
|
|
4944
|
-
* LICENSE file in the root directory of this source tree.
|
|
4945
|
-
*/
|
|
4946
4766
|
var hasRequiredUseSyncExternalStoreShim_production;
|
|
4947
4767
|
function requireUseSyncExternalStoreShim_production() {
|
|
4948
4768
|
if (hasRequiredUseSyncExternalStoreShim_production) return useSyncExternalStoreShim_production;
|
|
@@ -5193,19 +5013,19 @@ let __timestamp = 0;
|
|
|
5193
5013
|
const getTimestamp = () => ++__timestamp;
|
|
5194
5014
|
async function internalMutate(...args) {
|
|
5195
5015
|
const [cache2, _key, _data, _opts] = args;
|
|
5196
|
-
const
|
|
5016
|
+
const options2 = mergeObjects$1({
|
|
5197
5017
|
populateCache: true,
|
|
5198
5018
|
throwOnError: true
|
|
5199
5019
|
}, typeof _opts === "boolean" ? {
|
|
5200
5020
|
revalidate: _opts
|
|
5201
5021
|
} : _opts || {});
|
|
5202
|
-
let populateCache =
|
|
5203
|
-
const rollbackOnErrorOption =
|
|
5204
|
-
let optimisticData =
|
|
5022
|
+
let populateCache = options2.populateCache;
|
|
5023
|
+
const rollbackOnErrorOption = options2.rollbackOnError;
|
|
5024
|
+
let optimisticData = options2.optimisticData;
|
|
5205
5025
|
const rollbackOnError = (error) => {
|
|
5206
5026
|
return typeof rollbackOnErrorOption === "function" ? rollbackOnErrorOption(error) : rollbackOnErrorOption !== false;
|
|
5207
5027
|
};
|
|
5208
|
-
const throwOnError =
|
|
5028
|
+
const throwOnError = options2.throwOnError;
|
|
5209
5029
|
if (isFunction(_key)) {
|
|
5210
5030
|
const keyFilter = _key;
|
|
5211
5031
|
const matchedKeys = [];
|
|
@@ -5228,7 +5048,7 @@ async function internalMutate(...args) {
|
|
|
5228
5048
|
const [EVENT_REVALIDATORS, MUTATION, FETCH, PRELOAD] = SWRGlobalState.get(cache2);
|
|
5229
5049
|
const startRevalidate = () => {
|
|
5230
5050
|
const revalidators = EVENT_REVALIDATORS[key];
|
|
5231
|
-
const revalidate = isFunction(
|
|
5051
|
+
const revalidate = isFunction(options2.revalidate) ? options2.revalidate(get2().data, _k) : options2.revalidate !== false;
|
|
5232
5052
|
if (revalidate) {
|
|
5233
5053
|
delete FETCH[key];
|
|
5234
5054
|
delete PRELOAD[key];
|
|
@@ -5321,9 +5141,9 @@ const revalidateAllKeys = (revalidators, type) => {
|
|
|
5321
5141
|
if (revalidators[key][0]) revalidators[key][0](type);
|
|
5322
5142
|
}
|
|
5323
5143
|
};
|
|
5324
|
-
const initCache = (provider,
|
|
5144
|
+
const initCache = (provider, options2) => {
|
|
5325
5145
|
if (!SWRGlobalState.has(provider)) {
|
|
5326
|
-
const opts = mergeObjects$1(defaultConfigOptions,
|
|
5146
|
+
const opts = mergeObjects$1(defaultConfigOptions, options2);
|
|
5327
5147
|
const EVENT_REVALIDATORS = /* @__PURE__ */ Object.create(null);
|
|
5328
5148
|
const mutate2 = internalMutate.bind(UNDEFINED, provider);
|
|
5329
5149
|
let unmount = noop$1;
|
|
@@ -6212,26 +6032,26 @@ const infinite = (useSWRNext) => (getKey, fn, config) => {
|
|
|
6212
6032
|
const mutate2 = reactExports.useCallback(
|
|
6213
6033
|
// eslint-disable-next-line func-names
|
|
6214
6034
|
function(data, opts) {
|
|
6215
|
-
const
|
|
6035
|
+
const options2 = typeof opts === "boolean" ? {
|
|
6216
6036
|
revalidate: opts
|
|
6217
6037
|
} : opts || {};
|
|
6218
|
-
const shouldRevalidate =
|
|
6038
|
+
const shouldRevalidate = options2.revalidate !== false;
|
|
6219
6039
|
if (!infiniteKey) return EMPTY_PROMISE;
|
|
6220
6040
|
if (shouldRevalidate) {
|
|
6221
6041
|
if (!isUndefined(data)) {
|
|
6222
6042
|
set2({
|
|
6223
6043
|
_i: false,
|
|
6224
|
-
_r:
|
|
6044
|
+
_r: options2.revalidate
|
|
6225
6045
|
});
|
|
6226
6046
|
} else {
|
|
6227
6047
|
set2({
|
|
6228
6048
|
_i: true,
|
|
6229
|
-
_r:
|
|
6049
|
+
_r: options2.revalidate
|
|
6230
6050
|
});
|
|
6231
6051
|
}
|
|
6232
6052
|
}
|
|
6233
6053
|
return arguments.length ? swr.mutate(data, {
|
|
6234
|
-
...
|
|
6054
|
+
...options2,
|
|
6235
6055
|
revalidate: shouldRevalidate
|
|
6236
6056
|
}) : swr.mutate();
|
|
6237
6057
|
},
|
|
@@ -6304,16 +6124,16 @@ const OBSERVABILITY_UPGRADE_REQUIRED_CODE = "observability-upgrade-required";
|
|
|
6304
6124
|
const OBSERVABILITY_UPGRADE_REQUIRED_MESSAGE = "This workflow observability data is outside your current plan window. Upgrade Observability Plus to view up to 30 days of workflow data.";
|
|
6305
6125
|
const OBSERVABILITY_UPGRADE_REQUIRED_TITLE = "Upgrade Observability Plus";
|
|
6306
6126
|
class WorkflowWebAPIError extends Error {
|
|
6307
|
-
|
|
6308
|
-
|
|
6309
|
-
|
|
6310
|
-
|
|
6127
|
+
request;
|
|
6128
|
+
layer;
|
|
6129
|
+
constructor(message2, options2) {
|
|
6130
|
+
super(message2, { cause: options2?.cause });
|
|
6311
6131
|
this.name = "WorkflowWebAPIError";
|
|
6312
|
-
this.request =
|
|
6313
|
-
this.layer =
|
|
6314
|
-
if (
|
|
6132
|
+
this.request = options2?.request;
|
|
6133
|
+
this.layer = options2?.layer;
|
|
6134
|
+
if (options2?.cause instanceof Error) {
|
|
6315
6135
|
this.stack = `${this.stack}
|
|
6316
|
-
Caused by: ${
|
|
6136
|
+
Caused by: ${options2.cause.stack}`;
|
|
6317
6137
|
}
|
|
6318
6138
|
}
|
|
6319
6139
|
}
|
|
@@ -6325,8 +6145,7 @@ function createWorkflowAPIError(serverError) {
|
|
|
6325
6145
|
});
|
|
6326
6146
|
}
|
|
6327
6147
|
function isObservabilityUpgradeRequired(error) {
|
|
6328
|
-
|
|
6329
|
-
return error instanceof WorkflowWebAPIError && ((_a2 = error.request) == null ? void 0 : _a2.status) === 402 && ((_b = error.request) == null ? void 0 : _b.code) === OBSERVABILITY_UPGRADE_REQUIRED_CODE;
|
|
6148
|
+
return error instanceof WorkflowWebAPIError && error.request?.status === 402 && error.request?.code === OBSERVABILITY_UPGRADE_REQUIRED_CODE;
|
|
6330
6149
|
}
|
|
6331
6150
|
function getErrorTitle(error, fallback) {
|
|
6332
6151
|
if (isObservabilityUpgradeRequired(error)) {
|
|
@@ -6335,13 +6154,12 @@ function getErrorTitle(error, fallback) {
|
|
|
6335
6154
|
return fallback;
|
|
6336
6155
|
}
|
|
6337
6156
|
const getErrorMessage = (error) => {
|
|
6338
|
-
var _a2;
|
|
6339
6157
|
if (isObservabilityUpgradeRequired(error)) {
|
|
6340
6158
|
return OBSERVABILITY_UPGRADE_REQUIRED_MESSAGE;
|
|
6341
6159
|
}
|
|
6342
6160
|
if ("layer" in error && error.layer) {
|
|
6343
6161
|
if (error instanceof WorkflowWebAPIError) {
|
|
6344
|
-
if (
|
|
6162
|
+
if (error.request?.status === 403) {
|
|
6345
6163
|
return VERCEL_403_ERROR_MESSAGE;
|
|
6346
6164
|
}
|
|
6347
6165
|
}
|
|
@@ -6380,13 +6198,12 @@ async function unwrapOrThrow(promise) {
|
|
|
6380
6198
|
if (error) throw error;
|
|
6381
6199
|
return result;
|
|
6382
6200
|
}
|
|
6383
|
-
function useInfiniteList(cacheKey, fetchFn, getItemKey,
|
|
6384
|
-
|
|
6385
|
-
const { keepPreviousData = true, revalidateCached = false } = options;
|
|
6201
|
+
function useInfiniteList(cacheKey, fetchFn, getItemKey, options2 = {}) {
|
|
6202
|
+
const { keepPreviousData = true, revalidateCached = false } = options2;
|
|
6386
6203
|
const getKey = reactExports.useCallback(
|
|
6387
6204
|
(_index, prev) => {
|
|
6388
6205
|
if (prev && (!prev.hasMore || !prev.cursor)) return null;
|
|
6389
|
-
return [cacheKey,
|
|
6206
|
+
return [cacheKey, prev?.cursor ?? null];
|
|
6390
6207
|
},
|
|
6391
6208
|
[cacheKey]
|
|
6392
6209
|
);
|
|
@@ -6422,8 +6239,8 @@ function useInfiniteList(cacheKey, fetchFn, getItemKey, options = {}) {
|
|
|
6422
6239
|
}
|
|
6423
6240
|
return result;
|
|
6424
6241
|
}, [pages, getItemKey]);
|
|
6425
|
-
const lastPage = pages
|
|
6426
|
-
const hasMore = Boolean(
|
|
6242
|
+
const lastPage = pages?.[pages.length - 1];
|
|
6243
|
+
const hasMore = Boolean(lastPage?.hasMore && lastPage?.cursor);
|
|
6427
6244
|
const isLoadingMore = size > 0 && Boolean(pages) && pages.length < size;
|
|
6428
6245
|
const loadMore = reactExports.useCallback(() => {
|
|
6429
6246
|
if (isValidating || !hasMore) return;
|
|
@@ -6445,7 +6262,7 @@ function useInfiniteList(cacheKey, fetchFn, getItemKey, options = {}) {
|
|
|
6445
6262
|
hasMore,
|
|
6446
6263
|
loadMore,
|
|
6447
6264
|
reload,
|
|
6448
|
-
pageInfo:
|
|
6265
|
+
pageInfo: pages?.[0]?.pageInfo
|
|
6449
6266
|
};
|
|
6450
6267
|
}
|
|
6451
6268
|
function useWorkflowRunsInfinite(env, params) {
|
|
@@ -6495,8 +6312,8 @@ async function recreateRun(env, runId) {
|
|
|
6495
6312
|
async function reenqueueRun(env, runId) {
|
|
6496
6313
|
await unwrapOrThrow(reenqueueRun$1(env, runId));
|
|
6497
6314
|
}
|
|
6498
|
-
async function wakeUpRun(env, runId,
|
|
6499
|
-
return unwrapOrThrow(wakeUpRun$1(env, runId,
|
|
6315
|
+
async function wakeUpRun(env, runId, options2) {
|
|
6316
|
+
return unwrapOrThrow(wakeUpRun$1(env, runId, options2));
|
|
6500
6317
|
}
|
|
6501
6318
|
async function resumeHook(env, token, payload) {
|
|
6502
6319
|
return unwrapOrThrow(resumeHook$1(env, token, payload));
|
|
@@ -6573,18 +6390,6 @@ function RelativeTime({
|
|
|
6573
6390
|
/* @__PURE__ */ jsxRuntimeExports.jsx(TooltipContent, { children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: absoluteTime }) })
|
|
6574
6391
|
] });
|
|
6575
6392
|
}
|
|
6576
|
-
function Skeleton({
|
|
6577
|
-
className,
|
|
6578
|
-
...props
|
|
6579
|
-
}) {
|
|
6580
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
6581
|
-
"div",
|
|
6582
|
-
{
|
|
6583
|
-
className: cn("animate-pulse rounded-md bg-muted", className),
|
|
6584
|
-
...props
|
|
6585
|
-
}
|
|
6586
|
-
);
|
|
6587
|
-
}
|
|
6588
6393
|
function getStatusColorClass(status) {
|
|
6589
6394
|
switch (status) {
|
|
6590
6395
|
case "running":
|
|
@@ -6609,7 +6414,6 @@ function StatusBadge({
|
|
|
6609
6414
|
className,
|
|
6610
6415
|
durationMs
|
|
6611
6416
|
}) {
|
|
6612
|
-
var _a2;
|
|
6613
6417
|
const content = /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: cn("flex flex-row gap-2", className), children: [
|
|
6614
6418
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "flex items-center gap-1.5", children: [
|
|
6615
6419
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -6629,11 +6433,11 @@ function StatusBadge({
|
|
|
6629
6433
|
")"
|
|
6630
6434
|
] })
|
|
6631
6435
|
] });
|
|
6632
|
-
const errorCode = status === "failed" ? getErrorCode(context
|
|
6436
|
+
const errorCode = status === "failed" ? getErrorCode(context?.error) : void 0;
|
|
6633
6437
|
if (errorCode) {
|
|
6634
6438
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorCodeBadge, { content, errorCode });
|
|
6635
6439
|
}
|
|
6636
|
-
const cancelReason =
|
|
6440
|
+
const cancelReason = context?.cancelReason?.trim();
|
|
6637
6441
|
if (status === "cancelled" && cancelReason) {
|
|
6638
6442
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(Tooltip, { delayDuration: 200, children: [
|
|
6639
6443
|
/* @__PURE__ */ jsxRuntimeExports.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -6684,7 +6488,6 @@ function useRunActions({
|
|
|
6684
6488
|
const eventAnalysis = reactExports.useMemo(() => analyzeEvents(events), [events]);
|
|
6685
6489
|
const hasPendingSleeps = eventAnalysis.hasPendingSleeps;
|
|
6686
6490
|
const handleReplay = reactExports.useCallback(async () => {
|
|
6687
|
-
var _a2, _b;
|
|
6688
6491
|
if (rerunning || replayDisabledReason) return null;
|
|
6689
6492
|
try {
|
|
6690
6493
|
setRerunning(true);
|
|
@@ -6692,8 +6495,8 @@ function useRunActions({
|
|
|
6692
6495
|
toast.success("New run started", {
|
|
6693
6496
|
description: `Run ID: ${newRunId}`
|
|
6694
6497
|
});
|
|
6695
|
-
|
|
6696
|
-
|
|
6498
|
+
callbacks?.onSuccess?.();
|
|
6499
|
+
callbacks?.onNavigateToRun?.(newRunId);
|
|
6697
6500
|
return newRunId;
|
|
6698
6501
|
} catch (err) {
|
|
6699
6502
|
toast.error("Failed to re-run", {
|
|
@@ -6705,7 +6508,6 @@ function useRunActions({
|
|
|
6705
6508
|
}
|
|
6706
6509
|
}, [env, runId, rerunning, replayDisabledReason, callbacks]);
|
|
6707
6510
|
const handleReenqueue = reactExports.useCallback(async () => {
|
|
6708
|
-
var _a2;
|
|
6709
6511
|
if (reenqueuing) return;
|
|
6710
6512
|
try {
|
|
6711
6513
|
setReenqueuing(true);
|
|
@@ -6713,7 +6515,7 @@ function useRunActions({
|
|
|
6713
6515
|
toast.success("Run re-enqueued", {
|
|
6714
6516
|
description: "The workflow orchestration layer has been re-enqueued."
|
|
6715
6517
|
});
|
|
6716
|
-
|
|
6518
|
+
callbacks?.onSuccess?.();
|
|
6717
6519
|
} catch (err) {
|
|
6718
6520
|
toast.error("Failed to re-enqueue", {
|
|
6719
6521
|
description: err instanceof Error ? err.message : "Unknown error"
|
|
@@ -6723,7 +6525,6 @@ function useRunActions({
|
|
|
6723
6525
|
}
|
|
6724
6526
|
}, [env, runId, reenqueuing, callbacks]);
|
|
6725
6527
|
const handleWakeUp = reactExports.useCallback(async () => {
|
|
6726
|
-
var _a2;
|
|
6727
6528
|
if (wakingUp) return;
|
|
6728
6529
|
try {
|
|
6729
6530
|
setWakingUp(true);
|
|
@@ -6737,7 +6538,7 @@ function useRunActions({
|
|
|
6737
6538
|
description: "There were no active sleep calls to cancel."
|
|
6738
6539
|
});
|
|
6739
6540
|
}
|
|
6740
|
-
|
|
6541
|
+
callbacks?.onSuccess?.();
|
|
6741
6542
|
} catch (err) {
|
|
6742
6543
|
toast.error("Failed to cancel sleeps", {
|
|
6743
6544
|
description: err instanceof Error ? err.message : "Unknown error"
|
|
@@ -6747,7 +6548,6 @@ function useRunActions({
|
|
|
6747
6548
|
}
|
|
6748
6549
|
}, [env, runId, wakingUp, callbacks]);
|
|
6749
6550
|
const handleCancel = reactExports.useCallback(async () => {
|
|
6750
|
-
var _a2;
|
|
6751
6551
|
if (cancelling) return;
|
|
6752
6552
|
const isRunActive = runStatus === "pending" || runStatus === "running";
|
|
6753
6553
|
if (!isRunActive) {
|
|
@@ -6760,7 +6560,7 @@ function useRunActions({
|
|
|
6760
6560
|
setCancelling(true);
|
|
6761
6561
|
await cancelRun(env, runId);
|
|
6762
6562
|
toast.success("Run cancelled");
|
|
6763
|
-
|
|
6563
|
+
callbacks?.onSuccess?.();
|
|
6764
6564
|
} catch (err) {
|
|
6765
6565
|
toast.error("Failed to cancel", {
|
|
6766
6566
|
description: err instanceof Error ? err.message : "Unknown error"
|
|
@@ -7181,6 +6981,8 @@ function makeContentId(baseId, value) {
|
|
|
7181
6981
|
return `${baseId}-content-${value}`;
|
|
7182
6982
|
}
|
|
7183
6983
|
__name$1(makeContentId, "makeContentId");
|
|
6984
|
+
const tabsListClassName = "bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg border border-input p-[3px]";
|
|
6985
|
+
const tabsTriggerClassName = "inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow aria-[current=page]:bg-background aria-[current=page]:text-foreground aria-[current=page]:shadow";
|
|
7184
6986
|
function Tabs({
|
|
7185
6987
|
className,
|
|
7186
6988
|
...props
|
|
@@ -7202,10 +7004,7 @@ function TabsList({
|
|
|
7202
7004
|
TabsList$1,
|
|
7203
7005
|
{
|
|
7204
7006
|
"data-slot": "tabs-list",
|
|
7205
|
-
className: cn(
|
|
7206
|
-
"bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg border border-input p-[3px]",
|
|
7207
|
-
className
|
|
7208
|
-
),
|
|
7007
|
+
className: cn(tabsListClassName, className),
|
|
7209
7008
|
...props
|
|
7210
7009
|
}
|
|
7211
7010
|
);
|
|
@@ -7218,10 +7017,7 @@ function TabsTrigger({
|
|
|
7218
7017
|
TabsTrigger$1,
|
|
7219
7018
|
{
|
|
7220
7019
|
"data-slot": "tabs-trigger",
|
|
7221
|
-
className: cn(
|
|
7222
|
-
"inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",
|
|
7223
|
-
className
|
|
7224
|
-
),
|
|
7020
|
+
className: cn(tabsTriggerClassName, className),
|
|
7225
7021
|
...props
|
|
7226
7022
|
}
|
|
7227
7023
|
);
|
|
@@ -7900,24 +7696,24 @@ function onRemove(typename) {
|
|
|
7900
7696
|
else delete this.__on;
|
|
7901
7697
|
};
|
|
7902
7698
|
}
|
|
7903
|
-
function onAdd(typename, value,
|
|
7699
|
+
function onAdd(typename, value, options2) {
|
|
7904
7700
|
return function() {
|
|
7905
7701
|
var on = this.__on, o, listener = contextListener(value);
|
|
7906
7702
|
if (on) for (var j = 0, m = on.length; j < m; ++j) {
|
|
7907
7703
|
if ((o = on[j]).type === typename.type && o.name === typename.name) {
|
|
7908
7704
|
this.removeEventListener(o.type, o.listener, o.options);
|
|
7909
|
-
this.addEventListener(o.type, o.listener = listener, o.options =
|
|
7705
|
+
this.addEventListener(o.type, o.listener = listener, o.options = options2);
|
|
7910
7706
|
o.value = value;
|
|
7911
7707
|
return;
|
|
7912
7708
|
}
|
|
7913
7709
|
}
|
|
7914
|
-
this.addEventListener(typename.type, listener,
|
|
7915
|
-
o = { type: typename.type, name: typename.name, value, listener, options };
|
|
7710
|
+
this.addEventListener(typename.type, listener, options2);
|
|
7711
|
+
o = { type: typename.type, name: typename.name, value, listener, options: options2 };
|
|
7916
7712
|
if (!on) this.__on = [o];
|
|
7917
7713
|
else on.push(o);
|
|
7918
7714
|
};
|
|
7919
7715
|
}
|
|
7920
|
-
function selection_on(typename, value,
|
|
7716
|
+
function selection_on(typename, value, options2) {
|
|
7921
7717
|
var typenames = parseTypenames(typename + ""), i, n = typenames.length, t;
|
|
7922
7718
|
if (arguments.length < 2) {
|
|
7923
7719
|
var on = this.node().__on;
|
|
@@ -7931,7 +7727,7 @@ function selection_on(typename, value, options) {
|
|
|
7931
7727
|
return;
|
|
7932
7728
|
}
|
|
7933
7729
|
on = value ? onAdd : onRemove;
|
|
7934
|
-
for (i = 0; i < n; ++i) this.each(on(typenames[i], value,
|
|
7730
|
+
for (i = 0; i < n; ++i) this.each(on(typenames[i], value, options2));
|
|
7935
7731
|
return this;
|
|
7936
7732
|
}
|
|
7937
7733
|
function dispatchEvent(node, type, params) {
|
|
@@ -10121,12 +9917,12 @@ const getConnectedEdges = (nodes, edges) => {
|
|
|
10121
9917
|
});
|
|
10122
9918
|
return edges.filter((edge) => nodeIds.has(edge.source) || nodeIds.has(edge.target));
|
|
10123
9919
|
};
|
|
10124
|
-
function getFitViewNodes(nodeLookup,
|
|
9920
|
+
function getFitViewNodes(nodeLookup, options2) {
|
|
10125
9921
|
const fitViewNodes = /* @__PURE__ */ new Map();
|
|
10126
|
-
const optionNodeIds =
|
|
9922
|
+
const optionNodeIds = options2?.nodes ? new Set(options2.nodes.map((node) => node.id)) : null;
|
|
10127
9923
|
nodeLookup.forEach((n) => {
|
|
10128
9924
|
let isVisible2;
|
|
10129
|
-
if (
|
|
9925
|
+
if (options2?.includeHiddenNodes) {
|
|
10130
9926
|
const { width, height } = getNodeDimensions(n);
|
|
10131
9927
|
isVisible2 = width > 0 && height > 0;
|
|
10132
9928
|
} else {
|
|
@@ -10138,17 +9934,17 @@ function getFitViewNodes(nodeLookup, options) {
|
|
|
10138
9934
|
});
|
|
10139
9935
|
return fitViewNodes;
|
|
10140
9936
|
}
|
|
10141
|
-
async function fitViewport({ nodes, width, height, panZoom, minZoom, maxZoom },
|
|
9937
|
+
async function fitViewport({ nodes, width, height, panZoom, minZoom, maxZoom }, options2) {
|
|
10142
9938
|
if (nodes.size === 0) {
|
|
10143
9939
|
return true;
|
|
10144
9940
|
}
|
|
10145
|
-
const nodesToFit = getFitViewNodes(nodes,
|
|
9941
|
+
const nodesToFit = getFitViewNodes(nodes, options2);
|
|
10146
9942
|
const bounds = getInternalNodesBounds(nodesToFit);
|
|
10147
|
-
const viewport = getViewportForBounds(bounds, width, height,
|
|
9943
|
+
const viewport = getViewportForBounds(bounds, width, height, options2?.minZoom ?? minZoom, options2?.maxZoom ?? maxZoom, options2?.padding ?? 0.1);
|
|
10148
9944
|
await panZoom.setViewport(viewport, {
|
|
10149
|
-
duration:
|
|
10150
|
-
ease:
|
|
10151
|
-
interpolate:
|
|
9945
|
+
duration: options2?.duration,
|
|
9946
|
+
ease: options2?.ease,
|
|
9947
|
+
interpolate: options2?.interpolate
|
|
10152
9948
|
});
|
|
10153
9949
|
return true;
|
|
10154
9950
|
}
|
|
@@ -10160,7 +9956,7 @@ function calculateNodePosition({ nodeId, nextPosition, nodeLookup, nodeOrigin =
|
|
|
10160
9956
|
let extent = node.extent || nodeExtent;
|
|
10161
9957
|
if (node.extent === "parent" && !node.expandParent) {
|
|
10162
9958
|
if (!parentNode) {
|
|
10163
|
-
onError
|
|
9959
|
+
onError?.("005", errorMessages["error005"]());
|
|
10164
9960
|
} else {
|
|
10165
9961
|
const { width: parentWidth, height: parentHeight } = getNodeDimensions(parentNode);
|
|
10166
9962
|
if (parentWidth && parentHeight) {
|
|
@@ -10178,7 +9974,7 @@ function calculateNodePosition({ nodeId, nextPosition, nodeLookup, nodeOrigin =
|
|
|
10178
9974
|
}
|
|
10179
9975
|
const positionAbsolute = isCoordinateExtent(extent) ? clampPosition(nextPosition, extent, node.measured) : nextPosition;
|
|
10180
9976
|
if (node.measured.width === void 0 || node.measured.height === void 0) {
|
|
10181
|
-
onError
|
|
9977
|
+
onError?.("015", errorMessages["error015"]());
|
|
10182
9978
|
}
|
|
10183
9979
|
return {
|
|
10184
9980
|
position: {
|
|
@@ -10228,8 +10024,8 @@ async function getElementsToRemove({ nodesToRemove = [], edgesToRemove = [], nod
|
|
|
10228
10024
|
}
|
|
10229
10025
|
const clamp = (val, min = 0, max = 1) => Math.min(Math.max(val, min), max);
|
|
10230
10026
|
const clampPosition = (position = { x: 0, y: 0 }, extent, dimensions) => ({
|
|
10231
|
-
x: clamp(position.x, extent[0][0], extent[1][0] - (
|
|
10232
|
-
y: clamp(position.y, extent[0][1], extent[1][1] - (
|
|
10027
|
+
x: clamp(position.x, extent[0][0], extent[1][0] - (dimensions?.width ?? 0)),
|
|
10028
|
+
y: clamp(position.y, extent[0][1], extent[1][1] - (dimensions?.height ?? 0))
|
|
10233
10029
|
});
|
|
10234
10030
|
function clampPositionToParent(childPosition, childDimensions, parent) {
|
|
10235
10031
|
const { width: parentWidth, height: parentHeight } = getNodeDimensions(parent);
|
|
@@ -10271,23 +10067,21 @@ const boxToRect = ({ x, y, x2, y2 }) => ({
|
|
|
10271
10067
|
height: y2 - y
|
|
10272
10068
|
});
|
|
10273
10069
|
const nodeToRect = (node, nodeOrigin = [0, 0]) => {
|
|
10274
|
-
var _a2, _b;
|
|
10275
10070
|
const { x, y } = isInternalNodeBase(node) ? node.internals.positionAbsolute : getNodePositionWithOrigin(node, nodeOrigin);
|
|
10276
10071
|
return {
|
|
10277
10072
|
x,
|
|
10278
10073
|
y,
|
|
10279
|
-
width:
|
|
10280
|
-
height:
|
|
10074
|
+
width: node.measured?.width ?? node.width ?? node.initialWidth ?? 0,
|
|
10075
|
+
height: node.measured?.height ?? node.height ?? node.initialHeight ?? 0
|
|
10281
10076
|
};
|
|
10282
10077
|
};
|
|
10283
10078
|
const nodeToBox = (node, nodeOrigin = [0, 0]) => {
|
|
10284
|
-
var _a2, _b;
|
|
10285
10079
|
const { x, y } = isInternalNodeBase(node) ? node.internals.positionAbsolute : getNodePositionWithOrigin(node, nodeOrigin);
|
|
10286
10080
|
return {
|
|
10287
10081
|
x,
|
|
10288
10082
|
y,
|
|
10289
|
-
x2: x + (
|
|
10290
|
-
y2: y + (
|
|
10083
|
+
x2: x + (node.measured?.width ?? node.width ?? node.initialWidth ?? 0),
|
|
10084
|
+
y2: y + (node.measured?.height ?? node.height ?? node.initialHeight ?? 0)
|
|
10291
10085
|
};
|
|
10292
10086
|
};
|
|
10293
10087
|
const getBoundsOfRects = (rect1, rect2) => boxToRect(getBoundsOfBoxes(rectToBox(rect1), rectToBox(rect2)));
|
|
@@ -10396,23 +10190,18 @@ const getViewportForBounds = (bounds, width, height, minZoom, maxZoom, padding)
|
|
|
10396
10190
|
zoom: clampedZoom
|
|
10397
10191
|
};
|
|
10398
10192
|
};
|
|
10399
|
-
const isMacOs = () =>
|
|
10400
|
-
var _a2;
|
|
10401
|
-
return typeof navigator !== "undefined" && ((_a2 = navigator == null ? void 0 : navigator.userAgent) == null ? void 0 : _a2.indexOf("Mac")) >= 0;
|
|
10402
|
-
};
|
|
10193
|
+
const isMacOs = () => typeof navigator !== "undefined" && navigator?.userAgent?.indexOf("Mac") >= 0;
|
|
10403
10194
|
function isCoordinateExtent(extent) {
|
|
10404
10195
|
return extent !== void 0 && extent !== null && extent !== "parent";
|
|
10405
10196
|
}
|
|
10406
10197
|
function getNodeDimensions(node) {
|
|
10407
|
-
var _a2, _b;
|
|
10408
10198
|
return {
|
|
10409
|
-
width:
|
|
10410
|
-
height:
|
|
10199
|
+
width: node.measured?.width ?? node.width ?? node.initialWidth ?? 0,
|
|
10200
|
+
height: node.measured?.height ?? node.height ?? node.initialHeight ?? 0
|
|
10411
10201
|
};
|
|
10412
10202
|
}
|
|
10413
10203
|
function nodeHasDimensions(node) {
|
|
10414
|
-
|
|
10415
|
-
return (((_a2 = node.measured) == null ? void 0 : _a2.width) ?? node.width ?? node.initialWidth) !== void 0 && (((_b = node.measured) == null ? void 0 : _b.height) ?? node.height ?? node.initialHeight) !== void 0;
|
|
10204
|
+
return (node.measured?.width ?? node.width ?? node.initialWidth) !== void 0 && (node.measured?.height ?? node.height ?? node.initialHeight) !== void 0;
|
|
10416
10205
|
}
|
|
10417
10206
|
function evaluateAbsolutePosition(position, dimensions = { width: 0, height: 0 }, parentId, nodeLookup, nodeOrigin) {
|
|
10418
10207
|
const positionAbsolute = { ...position };
|
|
@@ -10452,7 +10241,7 @@ function getConnectionStatus(isValid2) {
|
|
|
10452
10241
|
}
|
|
10453
10242
|
function getPointerPosition(event, { snapGrid = [0, 0], snapToGrid = false, transform: transform2, containerBounds }) {
|
|
10454
10243
|
const { x, y } = getEventPosition(event);
|
|
10455
|
-
const pointerPos = pointToRendererPoint({ x: x - (
|
|
10244
|
+
const pointerPos = pointToRendererPoint({ x: x - (containerBounds?.left ?? 0), y: y - (containerBounds?.top ?? 0) }, transform2);
|
|
10456
10245
|
const { x: xSnapped, y: ySnapped } = snapToGrid ? snapPosition(pointerPos, snapGrid) : pointerPos;
|
|
10457
10246
|
return {
|
|
10458
10247
|
xSnapped,
|
|
@@ -10464,28 +10253,23 @@ const getDimensions = (node) => ({
|
|
|
10464
10253
|
width: node.offsetWidth,
|
|
10465
10254
|
height: node.offsetHeight
|
|
10466
10255
|
});
|
|
10467
|
-
const getHostForElement = (element) =>
|
|
10468
|
-
var _a2;
|
|
10469
|
-
return ((_a2 = element == null ? void 0 : element.getRootNode) == null ? void 0 : _a2.call(element)) || (window == null ? void 0 : window.document);
|
|
10470
|
-
};
|
|
10256
|
+
const getHostForElement = (element) => element?.getRootNode?.() || window?.document;
|
|
10471
10257
|
const inputTags = ["INPUT", "SELECT", "TEXTAREA"];
|
|
10472
10258
|
function isInputDOMNode(event) {
|
|
10473
|
-
|
|
10474
|
-
|
|
10475
|
-
if ((target == null ? void 0 : target.nodeType) !== 1)
|
|
10259
|
+
const target = event.composedPath?.()?.[0] || event.target;
|
|
10260
|
+
if (target?.nodeType !== 1)
|
|
10476
10261
|
return false;
|
|
10477
10262
|
const isInput = inputTags.includes(target.nodeName) || target.hasAttribute("contenteditable");
|
|
10478
10263
|
return isInput || !!target.closest(".nokey");
|
|
10479
10264
|
}
|
|
10480
10265
|
const isMouseEvent = (event) => "clientX" in event;
|
|
10481
10266
|
const getEventPosition = (event, bounds) => {
|
|
10482
|
-
var _a2, _b;
|
|
10483
10267
|
const isMouse = isMouseEvent(event);
|
|
10484
|
-
const evtX = isMouse ? event.clientX :
|
|
10485
|
-
const evtY = isMouse ? event.clientY :
|
|
10268
|
+
const evtX = isMouse ? event.clientX : event.touches?.[0].clientX;
|
|
10269
|
+
const evtY = isMouse ? event.clientY : event.touches?.[0].clientY;
|
|
10486
10270
|
return {
|
|
10487
|
-
x: evtX - (
|
|
10488
|
-
y: evtY - (
|
|
10271
|
+
x: evtX - (bounds?.left ?? 0),
|
|
10272
|
+
y: evtY - (bounds?.top ?? 0)
|
|
10489
10273
|
};
|
|
10490
10274
|
};
|
|
10491
10275
|
const getHandleBounds = (type, nodeElement, nodeBounds, zoom2, nodeId) => {
|
|
@@ -10601,13 +10385,12 @@ const getEdgeId = ({ source, sourceHandle, target, targetHandle }) => `xy-edge__
|
|
|
10601
10385
|
const connectionExists = (edge, edges) => {
|
|
10602
10386
|
return edges.some((el) => el.source === edge.source && el.target === edge.target && (el.sourceHandle === edge.sourceHandle || !el.sourceHandle && !edge.sourceHandle) && (el.targetHandle === edge.targetHandle || !el.targetHandle && !edge.targetHandle));
|
|
10603
10387
|
};
|
|
10604
|
-
const addEdge$1 = (edgeParams, edges,
|
|
10605
|
-
var _a2;
|
|
10388
|
+
const addEdge$1 = (edgeParams, edges, options2 = {}) => {
|
|
10606
10389
|
if (!edgeParams.source || !edgeParams.target) {
|
|
10607
|
-
|
|
10390
|
+
options2.onError?.("006", errorMessages["error006"]());
|
|
10608
10391
|
return edges;
|
|
10609
10392
|
}
|
|
10610
|
-
const edgeIdGenerator =
|
|
10393
|
+
const edgeIdGenerator = options2.getEdgeId || getEdgeId;
|
|
10611
10394
|
let edge;
|
|
10612
10395
|
if (isEdgeBase(edgeParams)) {
|
|
10613
10396
|
edge = { ...edgeParams };
|
|
@@ -10780,33 +10563,31 @@ function getSmoothStepPath({ sourceX, sourceY, sourcePosition = Position.Bottom,
|
|
|
10780
10563
|
return [path, labelX, labelY, offsetX, offsetY];
|
|
10781
10564
|
}
|
|
10782
10565
|
function isNodeInitialized(node) {
|
|
10783
|
-
|
|
10784
|
-
return node && !!(node.internals.handleBounds || ((_a2 = node.handles) == null ? void 0 : _a2.length)) && !!(node.measured.width || node.width || node.initialWidth);
|
|
10566
|
+
return node && !!(node.internals.handleBounds || node.handles?.length) && !!(node.measured.width || node.width || node.initialWidth);
|
|
10785
10567
|
}
|
|
10786
10568
|
function getEdgePosition(params) {
|
|
10787
|
-
var _a2;
|
|
10788
10569
|
const { sourceNode, targetNode } = params;
|
|
10789
10570
|
if (!isNodeInitialized(sourceNode) || !isNodeInitialized(targetNode)) {
|
|
10790
10571
|
return null;
|
|
10791
10572
|
}
|
|
10792
10573
|
const sourceHandleBounds = sourceNode.internals.handleBounds || toHandleBounds(sourceNode.handles);
|
|
10793
10574
|
const targetHandleBounds = targetNode.internals.handleBounds || toHandleBounds(targetNode.handles);
|
|
10794
|
-
const sourceHandle = getHandle$1(
|
|
10575
|
+
const sourceHandle = getHandle$1(sourceHandleBounds?.source ?? [], params.sourceHandle);
|
|
10795
10576
|
const targetHandle = getHandle$1(
|
|
10796
10577
|
// when connection type is loose we can define all handles as sources and connect source -> source
|
|
10797
|
-
params.connectionMode === ConnectionMode.Strict ?
|
|
10578
|
+
params.connectionMode === ConnectionMode.Strict ? targetHandleBounds?.target ?? [] : (targetHandleBounds?.target ?? []).concat(targetHandleBounds?.source ?? []),
|
|
10798
10579
|
params.targetHandle
|
|
10799
10580
|
);
|
|
10800
10581
|
if (!sourceHandle || !targetHandle) {
|
|
10801
|
-
|
|
10582
|
+
params.onError?.("008", errorMessages["error008"](!sourceHandle ? "source" : "target", {
|
|
10802
10583
|
id: params.id,
|
|
10803
10584
|
sourceHandle: params.sourceHandle,
|
|
10804
10585
|
targetHandle: params.targetHandle
|
|
10805
10586
|
}));
|
|
10806
10587
|
return null;
|
|
10807
10588
|
}
|
|
10808
|
-
const sourcePosition =
|
|
10809
|
-
const targetPosition =
|
|
10589
|
+
const sourcePosition = sourceHandle?.position || Position.Bottom;
|
|
10590
|
+
const targetPosition = targetHandle?.position || Position.Top;
|
|
10810
10591
|
const source = getHandlePosition(sourceNode, sourceHandle, sourcePosition);
|
|
10811
10592
|
const target = getHandlePosition(targetNode, targetHandle, targetPosition);
|
|
10812
10593
|
return {
|
|
@@ -10839,13 +10620,13 @@ function toHandleBounds(handles) {
|
|
|
10839
10620
|
};
|
|
10840
10621
|
}
|
|
10841
10622
|
function getHandlePosition(node, handle, fallbackPosition = Position.Left, center = false) {
|
|
10842
|
-
const x = (
|
|
10843
|
-
const y = (
|
|
10623
|
+
const x = (handle?.x ?? 0) + node.internals.positionAbsolute.x;
|
|
10624
|
+
const y = (handle?.y ?? 0) + node.internals.positionAbsolute.y;
|
|
10844
10625
|
const { width, height } = handle ?? getNodeDimensions(node);
|
|
10845
10626
|
if (center) {
|
|
10846
10627
|
return { x: x + width / 2, y: y + height / 2 };
|
|
10847
10628
|
}
|
|
10848
|
-
const position =
|
|
10629
|
+
const position = handle?.position ?? fallbackPosition;
|
|
10849
10630
|
switch (position) {
|
|
10850
10631
|
case Position.Top:
|
|
10851
10632
|
return { x: x + width / 2, y };
|
|
@@ -10910,8 +10691,8 @@ function mergeObjects(base, incoming) {
|
|
|
10910
10691
|
}
|
|
10911
10692
|
return result;
|
|
10912
10693
|
}
|
|
10913
|
-
function updateAbsolutePositions(nodeLookup, parentLookup,
|
|
10914
|
-
const _options = mergeObjects(defaultOptions,
|
|
10694
|
+
function updateAbsolutePositions(nodeLookup, parentLookup, options2) {
|
|
10695
|
+
const _options = mergeObjects(defaultOptions, options2);
|
|
10915
10696
|
for (const node of nodeLookup.values()) {
|
|
10916
10697
|
if (node.parentId) {
|
|
10917
10698
|
updateChildNode(node, nodeLookup, parentLookup, _options);
|
|
@@ -10925,7 +10706,7 @@ function updateAbsolutePositions(nodeLookup, parentLookup, options) {
|
|
|
10925
10706
|
}
|
|
10926
10707
|
function parseHandles(userNode, internalNode) {
|
|
10927
10708
|
if (!userNode.handles) {
|
|
10928
|
-
return !userNode.measured ? void 0 : internalNode
|
|
10709
|
+
return !userNode.measured ? void 0 : internalNode?.internals.handleBounds;
|
|
10929
10710
|
}
|
|
10930
10711
|
const source = [];
|
|
10931
10712
|
const target = [];
|
|
@@ -10954,19 +10735,18 @@ function parseHandles(userNode, internalNode) {
|
|
|
10954
10735
|
function isManualZIndexMode(zIndexMode) {
|
|
10955
10736
|
return zIndexMode === "manual";
|
|
10956
10737
|
}
|
|
10957
|
-
function adoptUserNodes(nodes, nodeLookup, parentLookup,
|
|
10958
|
-
|
|
10959
|
-
const _options = mergeObjects(adoptUserNodesDefaultOptions, options);
|
|
10738
|
+
function adoptUserNodes(nodes, nodeLookup, parentLookup, options2 = {}) {
|
|
10739
|
+
const _options = mergeObjects(adoptUserNodesDefaultOptions, options2);
|
|
10960
10740
|
const rootParentIndex = { i: 0 };
|
|
10961
10741
|
const tmpLookup = new Map(nodeLookup);
|
|
10962
|
-
const selectedNodeZ =
|
|
10742
|
+
const selectedNodeZ = _options?.elevateNodesOnSelect && !isManualZIndexMode(_options.zIndexMode) ? SELECTED_NODE_Z : 0;
|
|
10963
10743
|
let nodesInitialized = nodes.length > 0;
|
|
10964
10744
|
let hasSelectedNodes = false;
|
|
10965
10745
|
nodeLookup.clear();
|
|
10966
10746
|
parentLookup.clear();
|
|
10967
10747
|
for (const userNode of nodes) {
|
|
10968
10748
|
let internalNode = tmpLookup.get(userNode.id);
|
|
10969
|
-
if (_options.checkEquality && userNode ===
|
|
10749
|
+
if (_options.checkEquality && userNode === internalNode?.internals.userNode) {
|
|
10970
10750
|
nodeLookup.set(userNode.id, internalNode);
|
|
10971
10751
|
} else {
|
|
10972
10752
|
const positionWithOrigin = getNodePositionWithOrigin(userNode, _options.nodeOrigin);
|
|
@@ -10976,8 +10756,8 @@ function adoptUserNodes(nodes, nodeLookup, parentLookup, options = {}) {
|
|
|
10976
10756
|
..._options.defaults,
|
|
10977
10757
|
...userNode,
|
|
10978
10758
|
measured: {
|
|
10979
|
-
width:
|
|
10980
|
-
height:
|
|
10759
|
+
width: userNode.measured?.width,
|
|
10760
|
+
height: userNode.measured?.height
|
|
10981
10761
|
},
|
|
10982
10762
|
internals: {
|
|
10983
10763
|
positionAbsolute: clampedPosition,
|
|
@@ -10993,9 +10773,9 @@ function adoptUserNodes(nodes, nodeLookup, parentLookup, options = {}) {
|
|
|
10993
10773
|
nodesInitialized = false;
|
|
10994
10774
|
}
|
|
10995
10775
|
if (userNode.parentId) {
|
|
10996
|
-
updateChildNode(internalNode, nodeLookup, parentLookup,
|
|
10776
|
+
updateChildNode(internalNode, nodeLookup, parentLookup, options2, rootParentIndex);
|
|
10997
10777
|
}
|
|
10998
|
-
hasSelectedNodes
|
|
10778
|
+
hasSelectedNodes ||= userNode.selected ?? false;
|
|
10999
10779
|
}
|
|
11000
10780
|
return { nodesInitialized, hasSelectedNodes };
|
|
11001
10781
|
}
|
|
@@ -11010,8 +10790,8 @@ function updateParentLookup(node, parentLookup) {
|
|
|
11010
10790
|
parentLookup.set(node.parentId, /* @__PURE__ */ new Map([[node.id, node]]));
|
|
11011
10791
|
}
|
|
11012
10792
|
}
|
|
11013
|
-
function updateChildNode(node, nodeLookup, parentLookup,
|
|
11014
|
-
const { elevateNodesOnSelect, nodeOrigin, nodeExtent, zIndexMode } = mergeObjects(defaultOptions,
|
|
10793
|
+
function updateChildNode(node, nodeLookup, parentLookup, options2, rootParentIndex) {
|
|
10794
|
+
const { elevateNodesOnSelect, nodeOrigin, nodeExtent, zIndexMode } = mergeObjects(defaultOptions, options2);
|
|
11015
10795
|
const parentId = node.parentId;
|
|
11016
10796
|
const parentNode = nodeLookup.get(parentId);
|
|
11017
10797
|
if (!parentNode) {
|
|
@@ -11066,7 +10846,6 @@ function calculateChildXYZ(childNode, parentNode, nodeOrigin, nodeExtent, select
|
|
|
11066
10846
|
};
|
|
11067
10847
|
}
|
|
11068
10848
|
function handleExpandParent(children2, nodeLookup, parentLookup, nodeOrigin = [0, 0]) {
|
|
11069
|
-
var _a2;
|
|
11070
10849
|
const changes = [];
|
|
11071
10850
|
const parentExpansions = /* @__PURE__ */ new Map();
|
|
11072
10851
|
for (const child of children2) {
|
|
@@ -11074,13 +10853,12 @@ function handleExpandParent(children2, nodeLookup, parentLookup, nodeOrigin = [0
|
|
|
11074
10853
|
if (!parent) {
|
|
11075
10854
|
continue;
|
|
11076
10855
|
}
|
|
11077
|
-
const parentRect =
|
|
10856
|
+
const parentRect = parentExpansions.get(child.parentId)?.expandedRect ?? nodeToRect(parent);
|
|
11078
10857
|
const expandedRect = getBoundsOfRects(parentRect, child.rect);
|
|
11079
10858
|
parentExpansions.set(child.parentId, { expandedRect, parent });
|
|
11080
10859
|
}
|
|
11081
10860
|
if (parentExpansions.size > 0) {
|
|
11082
10861
|
parentExpansions.forEach(({ expandedRect, parent }, parentId) => {
|
|
11083
|
-
var _a3;
|
|
11084
10862
|
const positionAbsolute = parent.internals.positionAbsolute;
|
|
11085
10863
|
const dimensions = getNodeDimensions(parent);
|
|
11086
10864
|
const origin = parent.origin ?? nodeOrigin;
|
|
@@ -11099,7 +10877,7 @@ function handleExpandParent(children2, nodeLookup, parentLookup, nodeOrigin = [0
|
|
|
11099
10877
|
y: parent.position.y - yChange + heightChange
|
|
11100
10878
|
}
|
|
11101
10879
|
});
|
|
11102
|
-
|
|
10880
|
+
parentLookup.get(parentId)?.forEach((childNode) => {
|
|
11103
10881
|
if (!children2.some((child) => child.id === childNode.id)) {
|
|
11104
10882
|
changes.push({
|
|
11105
10883
|
id: childNode.id,
|
|
@@ -11128,7 +10906,7 @@ function handleExpandParent(children2, nodeLookup, parentLookup, nodeOrigin = [0
|
|
|
11128
10906
|
return changes;
|
|
11129
10907
|
}
|
|
11130
10908
|
function updateNodeInternals(updates, nodeLookup, parentLookup, domNode, nodeOrigin, nodeExtent, zIndexMode) {
|
|
11131
|
-
const viewportNode = domNode
|
|
10909
|
+
const viewportNode = domNode?.querySelector(".xyflow__viewport");
|
|
11132
10910
|
let updatedInternals = false;
|
|
11133
10911
|
if (!viewportNode) {
|
|
11134
10912
|
return { changes: [], updatedInternals };
|
|
@@ -11262,14 +11040,13 @@ function isParentSelected(node, nodeLookup) {
|
|
|
11262
11040
|
return isParentSelected(parentNode, nodeLookup);
|
|
11263
11041
|
}
|
|
11264
11042
|
function hasSelector(target, selector2, domNode) {
|
|
11265
|
-
var _a2;
|
|
11266
11043
|
let current = target;
|
|
11267
11044
|
do {
|
|
11268
|
-
if (
|
|
11045
|
+
if (current?.matches?.(selector2))
|
|
11269
11046
|
return true;
|
|
11270
11047
|
if (current === domNode)
|
|
11271
11048
|
return false;
|
|
11272
|
-
current = current
|
|
11049
|
+
current = current?.parentElement;
|
|
11273
11050
|
} while (current);
|
|
11274
11051
|
return false;
|
|
11275
11052
|
}
|
|
@@ -11305,10 +11082,9 @@ function getDragItems(nodeLookup, nodesDraggable, mousePos, nodeId, onlyDragNode
|
|
|
11305
11082
|
return dragItems;
|
|
11306
11083
|
}
|
|
11307
11084
|
function getEventHandlerParams({ nodeId, dragItems, nodeLookup, dragging = true }) {
|
|
11308
|
-
var _a2, _b, _c;
|
|
11309
11085
|
const nodesFromDragItems = [];
|
|
11310
11086
|
for (const [id2, dragItem] of dragItems) {
|
|
11311
|
-
const node2 =
|
|
11087
|
+
const node2 = nodeLookup.get(id2)?.internals.userNode;
|
|
11312
11088
|
if (node2) {
|
|
11313
11089
|
nodesFromDragItems.push({
|
|
11314
11090
|
...node2,
|
|
@@ -11320,11 +11096,11 @@ function getEventHandlerParams({ nodeId, dragItems, nodeLookup, dragging = true
|
|
|
11320
11096
|
if (!nodeId) {
|
|
11321
11097
|
return [nodesFromDragItems[0], nodesFromDragItems];
|
|
11322
11098
|
}
|
|
11323
|
-
const node =
|
|
11099
|
+
const node = nodeLookup.get(nodeId)?.internals.userNode;
|
|
11324
11100
|
return [
|
|
11325
11101
|
!node ? nodesFromDragItems[0] : {
|
|
11326
11102
|
...node,
|
|
11327
|
-
position:
|
|
11103
|
+
position: dragItems.get(nodeId)?.position || node.position,
|
|
11328
11104
|
dragging
|
|
11329
11105
|
},
|
|
11330
11106
|
nodesFromDragItems
|
|
@@ -11417,10 +11193,10 @@ function XYDrag({ onNodeMouseDown, getStoreItems, onDragStart, onDrag, onDragSto
|
|
|
11417
11193
|
dragItems,
|
|
11418
11194
|
nodeLookup
|
|
11419
11195
|
});
|
|
11420
|
-
onDrag
|
|
11421
|
-
onNodeDrag
|
|
11196
|
+
onDrag?.(dragEvent, dragItems, currentNode, currentNodes);
|
|
11197
|
+
onNodeDrag?.(dragEvent, currentNode, currentNodes);
|
|
11422
11198
|
if (!nodeId) {
|
|
11423
|
-
onSelectionDrag
|
|
11199
|
+
onSelectionDrag?.(dragEvent, currentNodes);
|
|
11424
11200
|
}
|
|
11425
11201
|
}
|
|
11426
11202
|
}
|
|
@@ -11445,17 +11221,16 @@ function XYDrag({ onNodeMouseDown, getStoreItems, onDragStart, onDrag, onDragSto
|
|
|
11445
11221
|
autoPanId = requestAnimationFrame(autoPan);
|
|
11446
11222
|
}
|
|
11447
11223
|
function startDrag(event) {
|
|
11448
|
-
var _a2, _b;
|
|
11449
11224
|
const { nodeLookup, multiSelectionActive, nodesDraggable, transform: transform2, snapGrid, snapToGrid, selectNodesOnDrag, onNodeDragStart, onSelectionDragStart, unselectNodesAndEdges } = getStoreItems();
|
|
11450
11225
|
dragStarted = true;
|
|
11451
|
-
const isUnselectedNodeDrag = !!nodeId && !multiSelectionActive && !
|
|
11226
|
+
const isUnselectedNodeDrag = !!nodeId && !multiSelectionActive && !nodeLookup.get(nodeId)?.selected;
|
|
11452
11227
|
if ((!selectNodesOnDrag || !isSelectable) && !multiSelectionActive && nodeId) {
|
|
11453
|
-
if (!
|
|
11228
|
+
if (!nodeLookup.get(nodeId)?.selected) {
|
|
11454
11229
|
unselectNodesAndEdges();
|
|
11455
11230
|
}
|
|
11456
11231
|
}
|
|
11457
11232
|
if (isSelectable && selectNodesOnDrag && nodeId) {
|
|
11458
|
-
onNodeMouseDown
|
|
11233
|
+
onNodeMouseDown?.(nodeId);
|
|
11459
11234
|
}
|
|
11460
11235
|
const pointerPos = getPointerPosition(event.sourceEvent, { transform: transform2, snapGrid, snapToGrid, containerBounds });
|
|
11461
11236
|
lastPos = pointerPos;
|
|
@@ -11466,16 +11241,16 @@ function XYDrag({ onNodeMouseDown, getStoreItems, onDragStart, onDrag, onDragSto
|
|
|
11466
11241
|
dragItems,
|
|
11467
11242
|
nodeLookup
|
|
11468
11243
|
});
|
|
11469
|
-
onDragStart
|
|
11470
|
-
onNodeDragStart
|
|
11244
|
+
onDragStart?.(event.sourceEvent, dragItems, currentNode, currentNodes);
|
|
11245
|
+
onNodeDragStart?.(event.sourceEvent, currentNode, currentNodes);
|
|
11471
11246
|
if (!nodeId) {
|
|
11472
|
-
onSelectionDragStart
|
|
11247
|
+
onSelectionDragStart?.(event.sourceEvent, currentNodes);
|
|
11473
11248
|
}
|
|
11474
11249
|
}
|
|
11475
11250
|
}
|
|
11476
11251
|
const d3DragInstance = drag().clickDistance(nodeClickDistance).on("start", (event) => {
|
|
11477
11252
|
const { domNode: domNode2, nodeDragThreshold, transform: transform2, snapGrid, snapToGrid } = getStoreItems();
|
|
11478
|
-
containerBounds =
|
|
11253
|
+
containerBounds = domNode2?.getBoundingClientRect() || null;
|
|
11479
11254
|
abortDrag = false;
|
|
11480
11255
|
nodePositionsChanged = false;
|
|
11481
11256
|
dragEvent = event.sourceEvent;
|
|
@@ -11536,10 +11311,10 @@ function XYDrag({ onNodeMouseDown, getStoreItems, onDragStart, onDrag, onDragSto
|
|
|
11536
11311
|
nodeLookup,
|
|
11537
11312
|
dragging: false
|
|
11538
11313
|
});
|
|
11539
|
-
onDragStop
|
|
11540
|
-
onNodeDragStop
|
|
11314
|
+
onDragStop?.(event.sourceEvent, dragItems, currentNode, currentNodes);
|
|
11315
|
+
onNodeDragStop?.(event.sourceEvent, currentNode, currentNodes);
|
|
11541
11316
|
if (!nodeId) {
|
|
11542
|
-
onSelectionDragStop
|
|
11317
|
+
onSelectionDragStop?.(event.sourceEvent, currentNodes);
|
|
11543
11318
|
}
|
|
11544
11319
|
}
|
|
11545
11320
|
}
|
|
@@ -11551,7 +11326,7 @@ function XYDrag({ onNodeMouseDown, getStoreItems, onDragStart, onDrag, onDragSto
|
|
|
11551
11326
|
d3Selection.call(d3DragInstance);
|
|
11552
11327
|
}
|
|
11553
11328
|
function destroy() {
|
|
11554
|
-
d3Selection
|
|
11329
|
+
d3Selection?.on(".drag", null);
|
|
11555
11330
|
}
|
|
11556
11331
|
return {
|
|
11557
11332
|
update,
|
|
@@ -11575,12 +11350,11 @@ function getNodesWithinDistance(position, nodeLookup, distance2) {
|
|
|
11575
11350
|
}
|
|
11576
11351
|
const ADDITIONAL_DISTANCE = 250;
|
|
11577
11352
|
function getClosestHandle(position, connectionRadius, nodeLookup, fromHandle) {
|
|
11578
|
-
var _a2, _b;
|
|
11579
11353
|
let closestHandles = [];
|
|
11580
11354
|
let minDistance = Infinity;
|
|
11581
11355
|
const closeNodes = getNodesWithinDistance(position, nodeLookup, connectionRadius + ADDITIONAL_DISTANCE);
|
|
11582
11356
|
for (const node of closeNodes) {
|
|
11583
|
-
const allHandles = [...
|
|
11357
|
+
const allHandles = [...node.internals.handleBounds?.source ?? [], ...node.internals.handleBounds?.target ?? []];
|
|
11584
11358
|
for (const handle of allHandles) {
|
|
11585
11359
|
if (fromHandle.nodeId === handle.nodeId && fromHandle.type === handle.type && fromHandle.id === handle.id) {
|
|
11586
11360
|
continue;
|
|
@@ -11608,21 +11382,20 @@ function getClosestHandle(position, connectionRadius, nodeLookup, fromHandle) {
|
|
|
11608
11382
|
return closestHandles[0];
|
|
11609
11383
|
}
|
|
11610
11384
|
function getHandle(nodeId, handleType, handleId, nodeLookup, connectionMode, withAbsolutePosition = false) {
|
|
11611
|
-
var _a2, _b, _c;
|
|
11612
11385
|
const node = nodeLookup.get(nodeId);
|
|
11613
11386
|
if (!node) {
|
|
11614
11387
|
return null;
|
|
11615
11388
|
}
|
|
11616
|
-
const handles = connectionMode === "strict" ?
|
|
11617
|
-
const handle = (handleId ? handles
|
|
11389
|
+
const handles = connectionMode === "strict" ? node.internals.handleBounds?.[handleType] : [...node.internals.handleBounds?.source ?? [], ...node.internals.handleBounds?.target ?? []];
|
|
11390
|
+
const handle = (handleId ? handles?.find((h) => h.id === handleId) : handles?.[0]) ?? null;
|
|
11618
11391
|
return handle && withAbsolutePosition ? { ...handle, ...getHandlePosition(node, handle, handle.position, true) } : handle;
|
|
11619
11392
|
}
|
|
11620
11393
|
function getHandleType(edgeUpdaterType, handleDomNode) {
|
|
11621
11394
|
if (edgeUpdaterType) {
|
|
11622
11395
|
return edgeUpdaterType;
|
|
11623
|
-
} else if (handleDomNode
|
|
11396
|
+
} else if (handleDomNode?.classList.contains("target")) {
|
|
11624
11397
|
return "target";
|
|
11625
|
-
} else if (handleDomNode
|
|
11398
|
+
} else if (handleDomNode?.classList.contains("source")) {
|
|
11626
11399
|
return "source";
|
|
11627
11400
|
}
|
|
11628
11401
|
return null;
|
|
@@ -11643,7 +11416,7 @@ function onPointerDown(event, { connectionMode, connectionRadius, handleId, node
|
|
|
11643
11416
|
let closestHandle;
|
|
11644
11417
|
const { x, y } = getEventPosition(event);
|
|
11645
11418
|
const handleType = getHandleType(edgeUpdaterType, handleDomNode);
|
|
11646
|
-
const containerBounds = domNode
|
|
11419
|
+
const containerBounds = domNode?.getBoundingClientRect();
|
|
11647
11420
|
let connectionStarted = false;
|
|
11648
11421
|
if (!containerBounds || !handleType) {
|
|
11649
11422
|
return;
|
|
@@ -11689,7 +11462,7 @@ function onPointerDown(event, { connectionMode, connectionRadius, handleId, node
|
|
|
11689
11462
|
function startConnection() {
|
|
11690
11463
|
connectionStarted = true;
|
|
11691
11464
|
updateConnection(previousConnection);
|
|
11692
|
-
onConnectStart
|
|
11465
|
+
onConnectStart?.(event, { nodeId, handleId, handleType });
|
|
11693
11466
|
}
|
|
11694
11467
|
if (dragThreshold === 0) {
|
|
11695
11468
|
startConnection();
|
|
@@ -11752,16 +11525,16 @@ function onPointerDown(event, { connectionMode, connectionRadius, handleId, node
|
|
|
11752
11525
|
}
|
|
11753
11526
|
if (connectionStarted) {
|
|
11754
11527
|
if ((closestHandle || resultHandleDomNode) && connection && isValid2) {
|
|
11755
|
-
onConnect
|
|
11528
|
+
onConnect?.(connection);
|
|
11756
11529
|
}
|
|
11757
11530
|
const { inProgress, ...connectionState } = previousConnection;
|
|
11758
11531
|
const finalConnectionState = {
|
|
11759
11532
|
...connectionState,
|
|
11760
11533
|
toPosition: previousConnection.toHandle ? previousConnection.toPosition : null
|
|
11761
11534
|
};
|
|
11762
|
-
onConnectEnd
|
|
11535
|
+
onConnectEnd?.(event2, finalConnectionState);
|
|
11763
11536
|
if (edgeUpdaterType) {
|
|
11764
|
-
onReconnectEnd
|
|
11537
|
+
onReconnectEnd?.(event2, finalConnectionState);
|
|
11765
11538
|
}
|
|
11766
11539
|
}
|
|
11767
11540
|
cancelConnection();
|
|
@@ -11782,10 +11555,10 @@ function onPointerDown(event, { connectionMode, connectionRadius, handleId, node
|
|
|
11782
11555
|
}
|
|
11783
11556
|
function isValidHandle(event, { handle, connectionMode, fromNodeId, fromHandleId, fromType, doc, lib, flowId, isValidConnection = alwaysValid, nodeLookup }) {
|
|
11784
11557
|
const isTarget = fromType === "target";
|
|
11785
|
-
const handleDomNode = handle ? doc.querySelector(`.${lib}-flow__handle[data-id="${flowId}-${handle
|
|
11558
|
+
const handleDomNode = handle ? doc.querySelector(`.${lib}-flow__handle[data-id="${flowId}-${handle?.nodeId}-${handle?.id}-${handle?.type}"]`) : null;
|
|
11786
11559
|
const { x, y } = getEventPosition(event);
|
|
11787
11560
|
const handleBelow = doc.elementFromPoint(x, y);
|
|
11788
|
-
const handleToCheck =
|
|
11561
|
+
const handleToCheck = handleBelow?.classList.contains(`${lib}-flow__handle`) ? handleBelow : handleDomNode;
|
|
11789
11562
|
const result = {
|
|
11790
11563
|
handleDomNode: handleToCheck,
|
|
11791
11564
|
isValid: false,
|
|
@@ -11936,12 +11709,12 @@ function createPanOnScrollHandler({ zoomPanValues, noWheelClassName, d3Selection
|
|
|
11936
11709
|
clearTimeout(zoomPanValues.panScrollTimeout);
|
|
11937
11710
|
if (!zoomPanValues.isPanScrolling) {
|
|
11938
11711
|
zoomPanValues.isPanScrolling = true;
|
|
11939
|
-
onPanZoomStart
|
|
11712
|
+
onPanZoomStart?.(event, nextViewport);
|
|
11940
11713
|
} else {
|
|
11941
|
-
onPanZoom
|
|
11714
|
+
onPanZoom?.(event, nextViewport);
|
|
11942
11715
|
}
|
|
11943
11716
|
zoomPanValues.panScrollTimeout = setTimeout(() => {
|
|
11944
|
-
onPanZoomEnd
|
|
11717
|
+
onPanZoomEnd?.(event, nextViewport);
|
|
11945
11718
|
zoomPanValues.isPanScrolling = false;
|
|
11946
11719
|
}, 150);
|
|
11947
11720
|
};
|
|
@@ -11963,38 +11736,35 @@ function createZoomOnScrollHandler({ noWheelClassName, preventScrolling, d3ZoomH
|
|
|
11963
11736
|
}
|
|
11964
11737
|
function createPanZoomStartHandler({ zoomPanValues, onDraggingChange, onPanZoomStart }) {
|
|
11965
11738
|
return (event) => {
|
|
11966
|
-
|
|
11967
|
-
if ((_a2 = event.sourceEvent) == null ? void 0 : _a2.internal) {
|
|
11739
|
+
if (event.sourceEvent?.internal) {
|
|
11968
11740
|
return;
|
|
11969
11741
|
}
|
|
11970
11742
|
const viewport = transformToViewport(event.transform);
|
|
11971
|
-
zoomPanValues.mouseButton =
|
|
11743
|
+
zoomPanValues.mouseButton = event.sourceEvent?.button || 0;
|
|
11972
11744
|
zoomPanValues.isZoomingOrPanning = true;
|
|
11973
11745
|
zoomPanValues.prevViewport = viewport;
|
|
11974
|
-
if (
|
|
11746
|
+
if (event.sourceEvent?.type === "mousedown") {
|
|
11975
11747
|
onDraggingChange(true);
|
|
11976
11748
|
}
|
|
11977
11749
|
if (onPanZoomStart) {
|
|
11978
|
-
onPanZoomStart
|
|
11750
|
+
onPanZoomStart?.(event.sourceEvent, viewport);
|
|
11979
11751
|
}
|
|
11980
11752
|
};
|
|
11981
11753
|
}
|
|
11982
11754
|
function createPanZoomHandler({ zoomPanValues, panOnDrag, onPaneContextMenu, onTransformChange, onPanZoom }) {
|
|
11983
11755
|
return (event) => {
|
|
11984
|
-
var _a2, _b;
|
|
11985
11756
|
zoomPanValues.usedRightMouseButton = !!(onPaneContextMenu && isRightClickPan(panOnDrag, zoomPanValues.mouseButton ?? 0));
|
|
11986
|
-
if (!
|
|
11757
|
+
if (!event.sourceEvent?.sync) {
|
|
11987
11758
|
onTransformChange([event.transform.x, event.transform.y, event.transform.k]);
|
|
11988
11759
|
}
|
|
11989
|
-
if (onPanZoom && !
|
|
11990
|
-
onPanZoom
|
|
11760
|
+
if (onPanZoom && !event.sourceEvent?.internal) {
|
|
11761
|
+
onPanZoom?.(event.sourceEvent, transformToViewport(event.transform));
|
|
11991
11762
|
}
|
|
11992
11763
|
};
|
|
11993
11764
|
}
|
|
11994
11765
|
function createPanZoomEndHandler({ zoomPanValues, panOnDrag, panOnScroll, onDraggingChange, onPanZoomEnd, onPaneContextMenu }) {
|
|
11995
11766
|
return (event) => {
|
|
11996
|
-
|
|
11997
|
-
if ((_a2 = event.sourceEvent) == null ? void 0 : _a2.internal) {
|
|
11767
|
+
if (event.sourceEvent?.internal) {
|
|
11998
11768
|
return;
|
|
11999
11769
|
}
|
|
12000
11770
|
zoomPanValues.isZoomingOrPanning = false;
|
|
@@ -12009,7 +11779,7 @@ function createPanZoomEndHandler({ zoomPanValues, panOnDrag, panOnScroll, onDrag
|
|
|
12009
11779
|
clearTimeout(zoomPanValues.timerId);
|
|
12010
11780
|
zoomPanValues.timerId = setTimeout(
|
|
12011
11781
|
() => {
|
|
12012
|
-
onPanZoomEnd
|
|
11782
|
+
onPanZoomEnd?.(event.sourceEvent, viewport);
|
|
12013
11783
|
},
|
|
12014
11784
|
// we need a setTimeout for panOnScroll to suppress multiple end events fired during scroll
|
|
12015
11785
|
panOnScroll ? 150 : 0
|
|
@@ -12019,7 +11789,6 @@ function createPanZoomEndHandler({ zoomPanValues, panOnDrag, panOnScroll, onDrag
|
|
|
12019
11789
|
}
|
|
12020
11790
|
function createFilter({ panActivationKeyPressed, zoomActivationKeyPressed, zoomOnScroll, zoomOnPinch, panOnDrag, panOnScroll, zoomOnDoubleClick, userSelectionActive, noWheelClassName, noPanClassName, lib, connectionInProgress }) {
|
|
12021
11791
|
return (event) => {
|
|
12022
|
-
var _a2;
|
|
12023
11792
|
const zoomScroll = zoomActivationKeyPressed || zoomOnScroll;
|
|
12024
11793
|
const pinchZoom = zoomOnPinch && event.ctrlKey;
|
|
12025
11794
|
const isWheelEvent = event.type === "wheel";
|
|
@@ -12044,7 +11813,7 @@ function createFilter({ panActivationKeyPressed, zoomActivationKeyPressed, zoomO
|
|
|
12044
11813
|
if (!zoomOnPinch && event.ctrlKey && isWheelEvent) {
|
|
12045
11814
|
return false;
|
|
12046
11815
|
}
|
|
12047
|
-
if (!zoomOnPinch && event.type === "touchstart" &&
|
|
11816
|
+
if (!zoomOnPinch && event.type === "touchstart" && event.touches?.length > 1) {
|
|
12048
11817
|
event.preventDefault();
|
|
12049
11818
|
return false;
|
|
12050
11819
|
}
|
|
@@ -12078,14 +11847,14 @@ function XYPanZoom({ domNode, minZoom, maxZoom, translateExtent, viewport, onPan
|
|
|
12078
11847
|
];
|
|
12079
11848
|
const extentResizeObserver = typeof ResizeObserver !== "undefined" ? new ResizeObserver((entries) => {
|
|
12080
11849
|
const entry = entries[0];
|
|
12081
|
-
if (entry
|
|
11850
|
+
if (entry?.contentRect) {
|
|
12082
11851
|
cachedExtent = [
|
|
12083
11852
|
[0, 0],
|
|
12084
11853
|
[entry.contentRect.width, entry.contentRect.height]
|
|
12085
11854
|
];
|
|
12086
11855
|
}
|
|
12087
11856
|
}) : null;
|
|
12088
|
-
extentResizeObserver
|
|
11857
|
+
extentResizeObserver?.observe(domNode);
|
|
12089
11858
|
const d3ZoomInstance = zoom().extent(() => cachedExtent).scaleExtent([minZoom, maxZoom]).translateExtent(translateExtent);
|
|
12090
11859
|
const d3Selection = select(domNode).call(d3ZoomInstance);
|
|
12091
11860
|
setViewportConstrained({
|
|
@@ -12099,10 +11868,10 @@ function XYPanZoom({ domNode, minZoom, maxZoom, translateExtent, viewport, onPan
|
|
|
12099
11868
|
const d3ZoomHandler = d3Selection.on("wheel.zoom");
|
|
12100
11869
|
const d3DblClickZoomHandler = d3Selection.on("dblclick.zoom");
|
|
12101
11870
|
d3ZoomInstance.wheelDelta(wheelDelta);
|
|
12102
|
-
async function setTransform(transform2,
|
|
11871
|
+
async function setTransform(transform2, options2) {
|
|
12103
11872
|
if (d3Selection) {
|
|
12104
11873
|
return new Promise((resolve) => {
|
|
12105
|
-
d3ZoomInstance
|
|
11874
|
+
d3ZoomInstance?.interpolate(options2?.interpolate === "linear" ? interpolate$1 : interpolateZoom).transform(getD3Transition(d3Selection, options2?.duration, options2?.ease, () => resolve(true)), transform2);
|
|
12106
11875
|
});
|
|
12107
11876
|
}
|
|
12108
11877
|
return false;
|
|
@@ -12176,19 +11945,19 @@ function XYPanZoom({ domNode, minZoom, maxZoom, translateExtent, viewport, onPan
|
|
|
12176
11945
|
}
|
|
12177
11946
|
function destroy() {
|
|
12178
11947
|
d3ZoomInstance.on("zoom", null);
|
|
12179
|
-
extentResizeObserver
|
|
11948
|
+
extentResizeObserver?.disconnect();
|
|
12180
11949
|
}
|
|
12181
11950
|
async function setViewportConstrained(viewport2, extent, translateExtent2) {
|
|
12182
11951
|
const nextTransform = viewportToTransform(viewport2);
|
|
12183
|
-
const contrainedTransform = d3ZoomInstance
|
|
11952
|
+
const contrainedTransform = d3ZoomInstance?.constrain()(nextTransform, extent, translateExtent2);
|
|
12184
11953
|
if (contrainedTransform) {
|
|
12185
11954
|
await setTransform(contrainedTransform);
|
|
12186
11955
|
}
|
|
12187
11956
|
return contrainedTransform;
|
|
12188
11957
|
}
|
|
12189
|
-
async function setViewport(viewport2,
|
|
11958
|
+
async function setViewport(viewport2, options2) {
|
|
12190
11959
|
const nextTransform = viewportToTransform(viewport2);
|
|
12191
|
-
await setTransform(nextTransform,
|
|
11960
|
+
await setTransform(nextTransform, options2);
|
|
12192
11961
|
return nextTransform;
|
|
12193
11962
|
}
|
|
12194
11963
|
function syncViewport(viewport2) {
|
|
@@ -12196,7 +11965,7 @@ function XYPanZoom({ domNode, minZoom, maxZoom, translateExtent, viewport, onPan
|
|
|
12196
11965
|
const nextTransform = viewportToTransform(viewport2);
|
|
12197
11966
|
const currentTransform = d3Selection.property("__zoom");
|
|
12198
11967
|
if (currentTransform.k !== viewport2.zoom || currentTransform.x !== viewport2.x || currentTransform.y !== viewport2.y) {
|
|
12199
|
-
d3ZoomInstance
|
|
11968
|
+
d3ZoomInstance?.transform(d3Selection, nextTransform, null, { sync: true });
|
|
12200
11969
|
}
|
|
12201
11970
|
}
|
|
12202
11971
|
}
|
|
@@ -12204,31 +11973,31 @@ function XYPanZoom({ domNode, minZoom, maxZoom, translateExtent, viewport, onPan
|
|
|
12204
11973
|
const transform$1 = d3Selection ? transform(d3Selection.node()) : { x: 0, y: 0, k: 1 };
|
|
12205
11974
|
return { x: transform$1.x, y: transform$1.y, zoom: transform$1.k };
|
|
12206
11975
|
}
|
|
12207
|
-
async function scaleTo(zoom2,
|
|
11976
|
+
async function scaleTo(zoom2, options2) {
|
|
12208
11977
|
if (d3Selection) {
|
|
12209
11978
|
return new Promise((resolve) => {
|
|
12210
|
-
d3ZoomInstance
|
|
11979
|
+
d3ZoomInstance?.interpolate(options2?.interpolate === "linear" ? interpolate$1 : interpolateZoom).scaleTo(getD3Transition(d3Selection, options2?.duration, options2?.ease, () => resolve(true)), zoom2);
|
|
12211
11980
|
});
|
|
12212
11981
|
}
|
|
12213
11982
|
return false;
|
|
12214
11983
|
}
|
|
12215
|
-
async function scaleBy(factor,
|
|
11984
|
+
async function scaleBy(factor, options2) {
|
|
12216
11985
|
if (d3Selection) {
|
|
12217
11986
|
return new Promise((resolve) => {
|
|
12218
|
-
d3ZoomInstance
|
|
11987
|
+
d3ZoomInstance?.interpolate(options2?.interpolate === "linear" ? interpolate$1 : interpolateZoom).scaleBy(getD3Transition(d3Selection, options2?.duration, options2?.ease, () => resolve(true)), factor);
|
|
12219
11988
|
});
|
|
12220
11989
|
}
|
|
12221
11990
|
return false;
|
|
12222
11991
|
}
|
|
12223
11992
|
function setScaleExtent(scaleExtent) {
|
|
12224
|
-
d3ZoomInstance
|
|
11993
|
+
d3ZoomInstance?.scaleExtent(scaleExtent);
|
|
12225
11994
|
}
|
|
12226
11995
|
function setTranslateExtent(translateExtent2) {
|
|
12227
|
-
d3ZoomInstance
|
|
11996
|
+
d3ZoomInstance?.translateExtent(translateExtent2);
|
|
12228
11997
|
}
|
|
12229
11998
|
function setClickDistance(distance2) {
|
|
12230
11999
|
const validDistance = !isNumeric(distance2) || distance2 < 0 ? 0 : distance2;
|
|
12231
|
-
d3ZoomInstance
|
|
12000
|
+
d3ZoomInstance?.clickDistance(validDistance);
|
|
12232
12001
|
}
|
|
12233
12002
|
return {
|
|
12234
12003
|
update,
|
|
@@ -12459,7 +12228,7 @@ function XYResizer({ domNode, nodeId, getStoreItems, onChange, onEnd }) {
|
|
|
12459
12228
|
if (!node) {
|
|
12460
12229
|
return;
|
|
12461
12230
|
}
|
|
12462
|
-
containerBounds =
|
|
12231
|
+
containerBounds = paneDomNode?.getBoundingClientRect() ?? null;
|
|
12463
12232
|
const { xSnapped, ySnapped } = getPointerPosition(event.sourceEvent, {
|
|
12464
12233
|
transform: transform2,
|
|
12465
12234
|
snapGrid,
|
|
@@ -12511,7 +12280,7 @@ function XYResizer({ domNode, nodeId, getStoreItems, onChange, onEnd }) {
|
|
|
12511
12280
|
}
|
|
12512
12281
|
}
|
|
12513
12282
|
}
|
|
12514
|
-
onResizeStart
|
|
12283
|
+
onResizeStart?.(event, { ...prevValues });
|
|
12515
12284
|
}).on("drag", (event) => {
|
|
12516
12285
|
const { transform: transform2, snapGrid, snapToGrid, nodeOrigin: storeNodeOrigin } = getStoreItems();
|
|
12517
12286
|
const pointerPosition = getPointerPosition(event.sourceEvent, {
|
|
@@ -12588,7 +12357,7 @@ function XYResizer({ domNode, nodeId, getStoreItems, onChange, onEnd }) {
|
|
|
12588
12357
|
affectsY: params.controlDirection.affectsY
|
|
12589
12358
|
});
|
|
12590
12359
|
const nextValues = { ...prevValues, direction };
|
|
12591
|
-
const callResize = shouldResize
|
|
12360
|
+
const callResize = shouldResize?.(event, nextValues);
|
|
12592
12361
|
if (callResize === false) {
|
|
12593
12362
|
prevValues = lastValid.prevValues;
|
|
12594
12363
|
startValues.x = lastValid.startX;
|
|
@@ -12598,11 +12367,11 @@ function XYResizer({ domNode, nodeId, getStoreItems, onChange, onEnd }) {
|
|
|
12598
12367
|
});
|
|
12599
12368
|
return;
|
|
12600
12369
|
}
|
|
12601
|
-
onResize
|
|
12370
|
+
onResize?.(event, nextValues);
|
|
12602
12371
|
onChange(change, childChanges);
|
|
12603
12372
|
}).on("end", (event) => {
|
|
12604
|
-
onResizeEnd
|
|
12605
|
-
onEnd
|
|
12373
|
+
onResizeEnd?.(event, { ...prevValues });
|
|
12374
|
+
onEnd?.({ ...prevValues });
|
|
12606
12375
|
});
|
|
12607
12376
|
selection2.call(dragHandler);
|
|
12608
12377
|
}
|
|
@@ -12616,15 +12385,6 @@ function XYResizer({ domNode, nodeId, getStoreItems, onChange, onEnd }) {
|
|
|
12616
12385
|
}
|
|
12617
12386
|
var withSelector = { exports: {} };
|
|
12618
12387
|
var withSelector_production = {};
|
|
12619
|
-
/**
|
|
12620
|
-
* @license React
|
|
12621
|
-
* use-sync-external-store-shim/with-selector.production.js
|
|
12622
|
-
*
|
|
12623
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
12624
|
-
*
|
|
12625
|
-
* This source code is licensed under the MIT license found in the
|
|
12626
|
-
* LICENSE file in the root directory of this source tree.
|
|
12627
|
-
*/
|
|
12628
12388
|
var hasRequiredWithSelector_production;
|
|
12629
12389
|
function requireWithSelector_production() {
|
|
12630
12390
|
if (hasRequiredWithSelector_production) return withSelector_production;
|
|
@@ -12844,7 +12604,7 @@ function Attribution({ proOptions, position = "bottom-right" }) {
|
|
|
12844
12604
|
return;
|
|
12845
12605
|
}
|
|
12846
12606
|
}, []);
|
|
12847
|
-
if (proOptions
|
|
12607
|
+
if (proOptions?.hideAttribution) {
|
|
12848
12608
|
return null;
|
|
12849
12609
|
}
|
|
12850
12610
|
return jsxRuntimeExports.jsx(Panel, { position, className: "react-flow__attribution", "data-message": `Please only hide this attribution when you are subscribed to React Flow Pro: ${link}`, children: jsxRuntimeExports.jsx("a", { href: link, target: "_blank", rel: "noopener noreferrer", "aria-label": "React Flow attribution", children: "React Flow" }) });
|
|
@@ -12873,7 +12633,7 @@ function SelectionListenerInner({ onSelectionChange }) {
|
|
|
12873
12633
|
const { selectedNodes, selectedEdges } = useStore(selector$l, areEqual$1);
|
|
12874
12634
|
reactExports.useEffect(() => {
|
|
12875
12635
|
const params = { nodes: selectedNodes, edges: selectedEdges };
|
|
12876
|
-
onSelectionChange
|
|
12636
|
+
onSelectionChange?.(params);
|
|
12877
12637
|
store.getState().onSelectionChangeHandlers.forEach((fn) => fn(params));
|
|
12878
12638
|
}, [selectedNodes, selectedEdges, onSelectionChange]);
|
|
12879
12639
|
return null;
|
|
@@ -13028,7 +12788,6 @@ function getMediaQuery() {
|
|
|
13028
12788
|
return window.matchMedia("(prefers-color-scheme: dark)");
|
|
13029
12789
|
}
|
|
13030
12790
|
function useColorModeClass(colorMode) {
|
|
13031
|
-
var _a2;
|
|
13032
12791
|
const [colorModeClass, setColorModeClass] = reactExports.useState(colorMode === "system" ? null : colorMode);
|
|
13033
12792
|
reactExports.useEffect(() => {
|
|
13034
12793
|
if (colorMode !== "system") {
|
|
@@ -13036,17 +12795,17 @@ function useColorModeClass(colorMode) {
|
|
|
13036
12795
|
return;
|
|
13037
12796
|
}
|
|
13038
12797
|
const mediaQuery = getMediaQuery();
|
|
13039
|
-
const updateColorModeClass = () => setColorModeClass(
|
|
12798
|
+
const updateColorModeClass = () => setColorModeClass(mediaQuery?.matches ? "dark" : "light");
|
|
13040
12799
|
updateColorModeClass();
|
|
13041
|
-
mediaQuery
|
|
12800
|
+
mediaQuery?.addEventListener("change", updateColorModeClass);
|
|
13042
12801
|
return () => {
|
|
13043
|
-
mediaQuery
|
|
12802
|
+
mediaQuery?.removeEventListener("change", updateColorModeClass);
|
|
13044
12803
|
};
|
|
13045
12804
|
}, [colorMode]);
|
|
13046
|
-
return colorModeClass !== null ? colorModeClass :
|
|
12805
|
+
return colorModeClass !== null ? colorModeClass : getMediaQuery()?.matches ? "dark" : "light";
|
|
13047
12806
|
}
|
|
13048
12807
|
const defaultDoc = typeof document !== "undefined" ? document : null;
|
|
13049
|
-
function useKeyPress(keyCode = null,
|
|
12808
|
+
function useKeyPress(keyCode = null, options2 = { target: defaultDoc, actInsideInputWithModifier: true }) {
|
|
13050
12809
|
const [keyPressed, setKeyPressed] = reactExports.useState(false);
|
|
13051
12810
|
const modifierPressed = reactExports.useRef(false);
|
|
13052
12811
|
const pressedKeys = reactExports.useRef(/* @__PURE__ */ new Set([]));
|
|
@@ -13060,11 +12819,10 @@ function useKeyPress(keyCode = null, options = { target: defaultDoc, actInsideIn
|
|
|
13060
12819
|
return [[], []];
|
|
13061
12820
|
}, [keyCode]);
|
|
13062
12821
|
reactExports.useEffect(() => {
|
|
13063
|
-
const target =
|
|
13064
|
-
const actInsideInputWithModifier =
|
|
12822
|
+
const target = options2?.target ?? defaultDoc;
|
|
12823
|
+
const actInsideInputWithModifier = options2?.actInsideInputWithModifier ?? true;
|
|
13065
12824
|
if (keyCode !== null) {
|
|
13066
12825
|
const downHandler = (event) => {
|
|
13067
|
-
var _a2, _b;
|
|
13068
12826
|
modifierPressed.current = event.ctrlKey || event.metaKey || event.shiftKey || event.altKey;
|
|
13069
12827
|
const preventAction = (!modifierPressed.current || modifierPressed.current && !actInsideInputWithModifier) && isInputDOMNode(event);
|
|
13070
12828
|
if (preventAction) {
|
|
@@ -13073,9 +12831,9 @@ function useKeyPress(keyCode = null, options = { target: defaultDoc, actInsideIn
|
|
|
13073
12831
|
const keyOrCode = useKeyOrCode(event.code, keysToWatch);
|
|
13074
12832
|
pressedKeys.current.add(event[keyOrCode]);
|
|
13075
12833
|
if (isMatchingKey(keyCodes, pressedKeys.current, false)) {
|
|
13076
|
-
const target2 =
|
|
13077
|
-
const isInteractiveElement =
|
|
13078
|
-
if (
|
|
12834
|
+
const target2 = event.composedPath?.()?.[0] || event.target;
|
|
12835
|
+
const isInteractiveElement = target2?.nodeName === "BUTTON" || target2?.nodeName === "A";
|
|
12836
|
+
if (options2.preventDefault !== false && (modifierPressed.current || !isInteractiveElement)) {
|
|
13079
12837
|
event.preventDefault();
|
|
13080
12838
|
}
|
|
13081
12839
|
setKeyPressed(true);
|
|
@@ -13098,13 +12856,13 @@ function useKeyPress(keyCode = null, options = { target: defaultDoc, actInsideIn
|
|
|
13098
12856
|
pressedKeys.current.clear();
|
|
13099
12857
|
setKeyPressed(false);
|
|
13100
12858
|
};
|
|
13101
|
-
target
|
|
13102
|
-
target
|
|
12859
|
+
target?.addEventListener("keydown", downHandler);
|
|
12860
|
+
target?.addEventListener("keyup", upHandler);
|
|
13103
12861
|
window.addEventListener("blur", resetHandler);
|
|
13104
12862
|
window.addEventListener("contextmenu", resetHandler);
|
|
13105
12863
|
return () => {
|
|
13106
|
-
target
|
|
13107
|
-
target
|
|
12864
|
+
target?.removeEventListener("keydown", downHandler);
|
|
12865
|
+
target?.removeEventListener("keyup", upHandler);
|
|
13108
12866
|
window.removeEventListener("blur", resetHandler);
|
|
13109
12867
|
window.removeEventListener("contextmenu", resetHandler);
|
|
13110
12868
|
};
|
|
@@ -13122,20 +12880,20 @@ const useViewportHelper = () => {
|
|
|
13122
12880
|
const store = useStoreApi();
|
|
13123
12881
|
return reactExports.useMemo(() => {
|
|
13124
12882
|
return {
|
|
13125
|
-
zoomIn: async (
|
|
12883
|
+
zoomIn: async (options2) => {
|
|
13126
12884
|
const { panZoom } = store.getState();
|
|
13127
|
-
return panZoom ? panZoom.scaleBy(1.2,
|
|
12885
|
+
return panZoom ? panZoom.scaleBy(1.2, options2) : false;
|
|
13128
12886
|
},
|
|
13129
|
-
zoomOut: async (
|
|
12887
|
+
zoomOut: async (options2) => {
|
|
13130
12888
|
const { panZoom } = store.getState();
|
|
13131
|
-
return panZoom ? panZoom.scaleBy(1 / 1.2,
|
|
12889
|
+
return panZoom ? panZoom.scaleBy(1 / 1.2, options2) : false;
|
|
13132
12890
|
},
|
|
13133
|
-
zoomTo: async (zoomLevel,
|
|
12891
|
+
zoomTo: async (zoomLevel, options2) => {
|
|
13134
12892
|
const { panZoom } = store.getState();
|
|
13135
|
-
return panZoom ? panZoom.scaleTo(zoomLevel,
|
|
12893
|
+
return panZoom ? panZoom.scaleTo(zoomLevel, options2) : false;
|
|
13136
12894
|
},
|
|
13137
12895
|
getZoom: () => store.getState().transform[2],
|
|
13138
|
-
setViewport: async (viewport,
|
|
12896
|
+
setViewport: async (viewport, options2) => {
|
|
13139
12897
|
const { transform: [tX, tY, tZoom], panZoom } = store.getState();
|
|
13140
12898
|
if (!panZoom) {
|
|
13141
12899
|
return false;
|
|
@@ -13144,30 +12902,30 @@ const useViewportHelper = () => {
|
|
|
13144
12902
|
x: viewport.x ?? tX,
|
|
13145
12903
|
y: viewport.y ?? tY,
|
|
13146
12904
|
zoom: viewport.zoom ?? tZoom
|
|
13147
|
-
},
|
|
12905
|
+
}, options2);
|
|
13148
12906
|
return true;
|
|
13149
12907
|
},
|
|
13150
12908
|
getViewport: () => {
|
|
13151
12909
|
const [x, y, zoom2] = store.getState().transform;
|
|
13152
12910
|
return { x, y, zoom: zoom2 };
|
|
13153
12911
|
},
|
|
13154
|
-
setCenter: async (x, y,
|
|
13155
|
-
return store.getState().setCenter(x, y,
|
|
12912
|
+
setCenter: async (x, y, options2) => {
|
|
12913
|
+
return store.getState().setCenter(x, y, options2);
|
|
13156
12914
|
},
|
|
13157
|
-
fitBounds: async (bounds,
|
|
12915
|
+
fitBounds: async (bounds, options2) => {
|
|
13158
12916
|
const { width, height, minZoom, maxZoom, panZoom } = store.getState();
|
|
13159
|
-
const viewport = getViewportForBounds(bounds, width, height, minZoom, maxZoom,
|
|
12917
|
+
const viewport = getViewportForBounds(bounds, width, height, minZoom, maxZoom, options2?.padding ?? 0.1);
|
|
13160
12918
|
if (!panZoom) {
|
|
13161
12919
|
return false;
|
|
13162
12920
|
}
|
|
13163
12921
|
await panZoom.setViewport(viewport, {
|
|
13164
|
-
duration:
|
|
13165
|
-
ease:
|
|
13166
|
-
interpolate:
|
|
12922
|
+
duration: options2?.duration,
|
|
12923
|
+
ease: options2?.ease,
|
|
12924
|
+
interpolate: options2?.interpolate
|
|
13167
12925
|
});
|
|
13168
12926
|
return true;
|
|
13169
12927
|
},
|
|
13170
|
-
screenToFlowPosition: (clientPosition,
|
|
12928
|
+
screenToFlowPosition: (clientPosition, options2 = {}) => {
|
|
13171
12929
|
const { transform: transform2, snapGrid, snapToGrid, domNode } = store.getState();
|
|
13172
12930
|
if (!domNode) {
|
|
13173
12931
|
return clientPosition;
|
|
@@ -13177,8 +12935,8 @@ const useViewportHelper = () => {
|
|
|
13177
12935
|
x: clientPosition.x - domX,
|
|
13178
12936
|
y: clientPosition.y - domY
|
|
13179
12937
|
};
|
|
13180
|
-
const _snapGrid =
|
|
13181
|
-
const _snapToGrid =
|
|
12938
|
+
const _snapGrid = options2.snapGrid ?? snapGrid;
|
|
12939
|
+
const _snapToGrid = options2.snapToGrid ?? snapToGrid;
|
|
13182
12940
|
return pointToRendererPoint(correctedPosition, transform2, _snapToGrid, _snapGrid);
|
|
13183
12941
|
},
|
|
13184
12942
|
flowToScreenPosition: (flowPosition) => {
|
|
@@ -13305,12 +13063,11 @@ function getSelectionChanges(items, selectedIds = /* @__PURE__ */ new Set()) {
|
|
|
13305
13063
|
return changes;
|
|
13306
13064
|
}
|
|
13307
13065
|
function getElementsDiffChanges({ items = [], lookup }) {
|
|
13308
|
-
var _a2;
|
|
13309
13066
|
const changes = [];
|
|
13310
13067
|
const itemsLookup = new Map(items.map((item) => [item.id, item]));
|
|
13311
13068
|
for (const [index2, item] of items.entries()) {
|
|
13312
13069
|
const lookupItem = lookup.get(item.id);
|
|
13313
|
-
const storeItem =
|
|
13070
|
+
const storeItem = lookupItem?.internals?.userNode ?? lookupItem;
|
|
13314
13071
|
if (storeItem !== void 0 && storeItem !== item) {
|
|
13315
13072
|
changes.push({ id: item.id, item, type: "replace" });
|
|
13316
13073
|
}
|
|
@@ -13333,10 +13090,10 @@ function elementToRemoveChange(item) {
|
|
|
13333
13090
|
};
|
|
13334
13091
|
}
|
|
13335
13092
|
const defaultOnError = createDevWarn();
|
|
13336
|
-
function addEdge(edgeParams, edges,
|
|
13093
|
+
function addEdge(edgeParams, edges, options2 = {}) {
|
|
13337
13094
|
return addEdge$1(edgeParams, edges, {
|
|
13338
|
-
...
|
|
13339
|
-
onError:
|
|
13095
|
+
...options2,
|
|
13096
|
+
onError: options2.onError ?? defaultOnError
|
|
13340
13097
|
});
|
|
13341
13098
|
}
|
|
13342
13099
|
const isNode = (element) => isNodeBase(element);
|
|
@@ -13390,7 +13147,7 @@ function BatchProvider({ children: children2 }) {
|
|
|
13390
13147
|
setNodes(next);
|
|
13391
13148
|
}
|
|
13392
13149
|
if (changes.length > 0) {
|
|
13393
|
-
onNodesChange
|
|
13150
|
+
onNodesChange?.(changes);
|
|
13394
13151
|
} else if (fitViewQueued) {
|
|
13395
13152
|
window.requestAnimationFrame(() => {
|
|
13396
13153
|
const { fitViewQueued: fitViewQueued2, nodes: nodes2, setNodes: setNodes2 } = store.getState();
|
|
@@ -13442,42 +13199,38 @@ function useReactFlow() {
|
|
|
13442
13199
|
batchContext.edgeQueue.push(payload);
|
|
13443
13200
|
};
|
|
13444
13201
|
const getNodeRect = (node) => {
|
|
13445
|
-
var _a2, _b;
|
|
13446
13202
|
const { nodeLookup, nodeOrigin } = store.getState();
|
|
13447
13203
|
const nodeToUse = isNode(node) ? node : nodeLookup.get(node.id);
|
|
13448
13204
|
const position = nodeToUse.parentId ? evaluateAbsolutePosition(nodeToUse.position, nodeToUse.measured, nodeToUse.parentId, nodeLookup, nodeOrigin) : nodeToUse.position;
|
|
13449
13205
|
const nodeWithPosition = {
|
|
13450
13206
|
...nodeToUse,
|
|
13451
13207
|
position,
|
|
13452
|
-
width:
|
|
13453
|
-
height:
|
|
13208
|
+
width: nodeToUse.measured?.width ?? nodeToUse.width,
|
|
13209
|
+
height: nodeToUse.measured?.height ?? nodeToUse.height
|
|
13454
13210
|
};
|
|
13455
13211
|
return nodeToRect(nodeWithPosition, nodeToUse.parentId ? void 0 : nodeOrigin);
|
|
13456
13212
|
};
|
|
13457
|
-
const updateNode = (id2, nodeUpdate,
|
|
13213
|
+
const updateNode = (id2, nodeUpdate, options2 = { replace: false }) => {
|
|
13458
13214
|
setNodes((prevNodes) => prevNodes.map((node) => {
|
|
13459
13215
|
if (node.id === id2) {
|
|
13460
13216
|
const nextNode = typeof nodeUpdate === "function" ? nodeUpdate(node) : nodeUpdate;
|
|
13461
|
-
return
|
|
13217
|
+
return options2.replace && isNode(nextNode) ? nextNode : { ...node, ...nextNode };
|
|
13462
13218
|
}
|
|
13463
13219
|
return node;
|
|
13464
13220
|
}));
|
|
13465
13221
|
};
|
|
13466
|
-
const updateEdge = (id2, edgeUpdate,
|
|
13222
|
+
const updateEdge = (id2, edgeUpdate, options2 = { replace: false }) => {
|
|
13467
13223
|
setEdges((prevEdges) => prevEdges.map((edge) => {
|
|
13468
13224
|
if (edge.id === id2) {
|
|
13469
13225
|
const nextEdge = typeof edgeUpdate === "function" ? edgeUpdate(edge) : edgeUpdate;
|
|
13470
|
-
return
|
|
13226
|
+
return options2.replace && isEdge(nextEdge) ? nextEdge : { ...edge, ...nextEdge };
|
|
13471
13227
|
}
|
|
13472
13228
|
return edge;
|
|
13473
13229
|
}));
|
|
13474
13230
|
};
|
|
13475
13231
|
return {
|
|
13476
13232
|
getNodes: () => store.getState().nodes.map((n) => ({ ...n })),
|
|
13477
|
-
getNode: (id2) =>
|
|
13478
|
-
var _a2;
|
|
13479
|
-
return (_a2 = getInternalNode(id2)) == null ? void 0 : _a2.internals.userNode;
|
|
13480
|
-
},
|
|
13233
|
+
getNode: (id2) => getInternalNode(id2)?.internals.userNode,
|
|
13481
13234
|
getInternalNode,
|
|
13482
13235
|
getEdges: () => {
|
|
13483
13236
|
const { edges = [] } = store.getState();
|
|
@@ -13520,16 +13273,16 @@ function useReactFlow() {
|
|
|
13520
13273
|
const hasMatchingNodes = matchingNodes.length > 0;
|
|
13521
13274
|
if (hasMatchingEdges) {
|
|
13522
13275
|
const edgeChanges = matchingEdges.map(elementToRemoveChange);
|
|
13523
|
-
onEdgesDelete
|
|
13276
|
+
onEdgesDelete?.(matchingEdges);
|
|
13524
13277
|
triggerEdgeChanges(edgeChanges);
|
|
13525
13278
|
}
|
|
13526
13279
|
if (hasMatchingNodes) {
|
|
13527
13280
|
const nodeChanges = matchingNodes.map(elementToRemoveChange);
|
|
13528
|
-
onNodesDelete
|
|
13281
|
+
onNodesDelete?.(matchingNodes);
|
|
13529
13282
|
triggerNodeChanges(nodeChanges);
|
|
13530
13283
|
}
|
|
13531
13284
|
if (hasMatchingNodes || hasMatchingEdges) {
|
|
13532
|
-
onDelete
|
|
13285
|
+
onDelete?.({ nodes: matchingNodes, edges: matchingEdges });
|
|
13533
13286
|
}
|
|
13534
13287
|
return { deletedNodes: matchingNodes, deletedEdges: matchingEdges };
|
|
13535
13288
|
},
|
|
@@ -13568,34 +13321,28 @@ function useReactFlow() {
|
|
|
13568
13321
|
return partiallyVisible || overlappingArea >= area.width * area.height || overlappingArea >= nodeRect.width * nodeRect.height;
|
|
13569
13322
|
},
|
|
13570
13323
|
updateNode,
|
|
13571
|
-
updateNodeData: (id2, dataUpdate,
|
|
13324
|
+
updateNodeData: (id2, dataUpdate, options2 = { replace: false }) => {
|
|
13572
13325
|
updateNode(id2, (node) => {
|
|
13573
13326
|
const nextData = typeof dataUpdate === "function" ? dataUpdate(node) : dataUpdate;
|
|
13574
|
-
return
|
|
13575
|
-
},
|
|
13327
|
+
return options2.replace ? { ...node, data: nextData } : { ...node, data: { ...node.data, ...nextData } };
|
|
13328
|
+
}, options2);
|
|
13576
13329
|
},
|
|
13577
13330
|
updateEdge,
|
|
13578
|
-
updateEdgeData: (id2, dataUpdate,
|
|
13331
|
+
updateEdgeData: (id2, dataUpdate, options2 = { replace: false }) => {
|
|
13579
13332
|
updateEdge(id2, (edge) => {
|
|
13580
13333
|
const nextData = typeof dataUpdate === "function" ? dataUpdate(edge) : dataUpdate;
|
|
13581
|
-
return
|
|
13582
|
-
},
|
|
13334
|
+
return options2.replace ? { ...edge, data: nextData } : { ...edge, data: { ...edge.data, ...nextData } };
|
|
13335
|
+
}, options2);
|
|
13583
13336
|
},
|
|
13584
13337
|
getNodesBounds: (nodes) => {
|
|
13585
13338
|
const { nodeLookup, nodeOrigin } = store.getState();
|
|
13586
13339
|
return getNodesBounds(nodes, { nodeLookup, nodeOrigin });
|
|
13587
13340
|
},
|
|
13588
|
-
getHandleConnections: ({ type, id: id2, nodeId }) => {
|
|
13589
|
-
|
|
13590
|
-
|
|
13591
|
-
},
|
|
13592
|
-
getNodeConnections: ({ type, handleId, nodeId }) => {
|
|
13593
|
-
var _a2;
|
|
13594
|
-
return Array.from(((_a2 = store.getState().connectionLookup.get(`${nodeId}${type ? handleId ? `-${type}-${handleId}` : `-${type}` : ""}`)) == null ? void 0 : _a2.values()) ?? []);
|
|
13595
|
-
},
|
|
13596
|
-
fitView: async (options) => {
|
|
13341
|
+
getHandleConnections: ({ type, id: id2, nodeId }) => Array.from(store.getState().connectionLookup.get(`${nodeId}-${type}${id2 ? `-${id2}` : ""}`)?.values() ?? []),
|
|
13342
|
+
getNodeConnections: ({ type, handleId, nodeId }) => Array.from(store.getState().connectionLookup.get(`${nodeId}${type ? handleId ? `-${type}-${handleId}` : `-${type}` : ""}`)?.values() ?? []),
|
|
13343
|
+
fitView: async (options2) => {
|
|
13597
13344
|
const fitViewResolver = store.getState().fitViewResolver ?? withResolvers();
|
|
13598
|
-
store.setState({ fitViewQueued: true, fitViewOptions:
|
|
13345
|
+
store.setState({ fitViewQueued: true, fitViewOptions: options2, fitViewResolver });
|
|
13599
13346
|
batchContext.nodeQueue.push((nodes) => [...nodes]);
|
|
13600
13347
|
return fitViewResolver.promise;
|
|
13601
13348
|
}
|
|
@@ -13631,13 +13378,12 @@ function useResizeHandler(domNode) {
|
|
|
13631
13378
|
const store = useStoreApi();
|
|
13632
13379
|
reactExports.useEffect(() => {
|
|
13633
13380
|
const updateDimensions = () => {
|
|
13634
|
-
|
|
13635
|
-
if (!domNode.current || !(((_b = (_a2 = domNode.current).checkVisibility) == null ? void 0 : _b.call(_a2)) ?? true)) {
|
|
13381
|
+
if (!domNode.current || !(domNode.current.checkVisibility?.() ?? true)) {
|
|
13636
13382
|
return false;
|
|
13637
13383
|
}
|
|
13638
13384
|
const size = getDimensions(domNode.current);
|
|
13639
13385
|
if (size.height === 0 || size.width === 0) {
|
|
13640
|
-
|
|
13386
|
+
store.getState().onError?.("004", errorMessages["error004"]());
|
|
13641
13387
|
}
|
|
13642
13388
|
store.setState({ width: size.width || 500, height: size.height || 500 });
|
|
13643
13389
|
};
|
|
@@ -13673,7 +13419,7 @@ function ZoomPane({ onPaneContextMenu, zoomOnScroll = true, zoomOnPinch = true,
|
|
|
13673
13419
|
const panZoom = reactExports.useRef();
|
|
13674
13420
|
useResizeHandler(zoomPane);
|
|
13675
13421
|
const onTransformChange = reactExports.useCallback((transform2) => {
|
|
13676
|
-
onViewportChange
|
|
13422
|
+
onViewportChange?.({ x: transform2[0], y: transform2[1], zoom: transform2[2] });
|
|
13677
13423
|
if (!isControlledViewport) {
|
|
13678
13424
|
store.setState({ transform: transform2 });
|
|
13679
13425
|
}
|
|
@@ -13689,18 +13435,18 @@ function ZoomPane({ onPaneContextMenu, zoomOnScroll = true, zoomOnPinch = true,
|
|
|
13689
13435
|
onDraggingChange: (paneDragging) => store.setState((prevState) => prevState.paneDragging === paneDragging ? prevState : { paneDragging }),
|
|
13690
13436
|
onPanZoomStart: (event, vp) => {
|
|
13691
13437
|
const { onViewportChangeStart, onMoveStart } = store.getState();
|
|
13692
|
-
onMoveStart
|
|
13693
|
-
onViewportChangeStart
|
|
13438
|
+
onMoveStart?.(event, vp);
|
|
13439
|
+
onViewportChangeStart?.(vp);
|
|
13694
13440
|
},
|
|
13695
13441
|
onPanZoom: (event, vp) => {
|
|
13696
13442
|
const { onViewportChange: onViewportChange2, onMove } = store.getState();
|
|
13697
|
-
onMove
|
|
13698
|
-
onViewportChange2
|
|
13443
|
+
onMove?.(event, vp);
|
|
13444
|
+
onViewportChange2?.(vp);
|
|
13699
13445
|
},
|
|
13700
13446
|
onPanZoomEnd: (event, vp) => {
|
|
13701
13447
|
const { onViewportChangeEnd, onMoveEnd } = store.getState();
|
|
13702
|
-
onMoveEnd
|
|
13703
|
-
onViewportChangeEnd
|
|
13448
|
+
onMoveEnd?.(event, vp);
|
|
13449
|
+
onViewportChangeEnd?.(vp);
|
|
13704
13450
|
}
|
|
13705
13451
|
});
|
|
13706
13452
|
const { x, y, zoom: zoom2 } = panZoom.current.getViewport();
|
|
@@ -13710,14 +13456,12 @@ function ZoomPane({ onPaneContextMenu, zoomOnScroll = true, zoomOnPinch = true,
|
|
|
13710
13456
|
domNode: zoomPane.current.closest(".react-flow")
|
|
13711
13457
|
});
|
|
13712
13458
|
return () => {
|
|
13713
|
-
|
|
13714
|
-
(_a2 = panZoom.current) == null ? void 0 : _a2.destroy();
|
|
13459
|
+
panZoom.current?.destroy();
|
|
13715
13460
|
};
|
|
13716
13461
|
}
|
|
13717
13462
|
}, []);
|
|
13718
13463
|
reactExports.useEffect(() => {
|
|
13719
|
-
|
|
13720
|
-
(_a2 = panZoom.current) == null ? void 0 : _a2.update({
|
|
13464
|
+
panZoom.current?.update({
|
|
13721
13465
|
onPaneContextMenu,
|
|
13722
13466
|
zoomOnScroll,
|
|
13723
13467
|
zoomOnPinch,
|
|
@@ -13782,7 +13526,7 @@ const wrapHandler = (handler, containerRef) => {
|
|
|
13782
13526
|
if (event.target !== containerRef.current) {
|
|
13783
13527
|
return;
|
|
13784
13528
|
}
|
|
13785
|
-
handler
|
|
13529
|
+
handler?.(event);
|
|
13786
13530
|
};
|
|
13787
13531
|
};
|
|
13788
13532
|
const selector$g = (s) => ({
|
|
@@ -13816,19 +13560,19 @@ function Pane({ isSelecting, selectionKeyPressed, selectionMode = SelectionMode.
|
|
|
13816
13560
|
const connectionClone = structuredClone(connection);
|
|
13817
13561
|
delete connectionClone.inProgress;
|
|
13818
13562
|
connectionClone.toPosition = connectionClone.toHandle ? connectionClone.toHandle.position : null;
|
|
13819
|
-
onClickConnectEnd
|
|
13563
|
+
onClickConnectEnd?.(event.nativeEvent, connectionClone);
|
|
13820
13564
|
store.setState({ connectionClickStartHandle: null });
|
|
13821
13565
|
}
|
|
13822
|
-
onPaneClick
|
|
13566
|
+
onPaneClick?.(event);
|
|
13823
13567
|
resetSelectedElements();
|
|
13824
13568
|
store.setState({ nodesSelectionActive: false });
|
|
13825
13569
|
};
|
|
13826
13570
|
const onContextMenu = (event) => {
|
|
13827
|
-
if (Array.isArray(panOnDrag) &&
|
|
13571
|
+
if (Array.isArray(panOnDrag) && panOnDrag?.includes(2)) {
|
|
13828
13572
|
event.preventDefault();
|
|
13829
13573
|
return;
|
|
13830
13574
|
}
|
|
13831
|
-
onPaneContextMenu
|
|
13575
|
+
onPaneContextMenu?.(event);
|
|
13832
13576
|
};
|
|
13833
13577
|
const onWheel = onPaneScroll ? (event) => onPaneScroll(event) : void 0;
|
|
13834
13578
|
const onClickCapture = (event) => {
|
|
@@ -13838,12 +13582,11 @@ function Pane({ isSelecting, selectionKeyPressed, selectionMode = SelectionMode.
|
|
|
13838
13582
|
}
|
|
13839
13583
|
};
|
|
13840
13584
|
const onPointerDownCapture = (event) => {
|
|
13841
|
-
var _a2, _b;
|
|
13842
13585
|
if (event.pointerType === "touch" && panOnDrag !== false && !selectionKeyPressed) {
|
|
13843
13586
|
return;
|
|
13844
13587
|
}
|
|
13845
13588
|
const { domNode, transform: transform2 } = store.getState();
|
|
13846
|
-
containerBounds.current = domNode
|
|
13589
|
+
containerBounds.current = domNode?.getBoundingClientRect();
|
|
13847
13590
|
if (!containerBounds.current)
|
|
13848
13591
|
return;
|
|
13849
13592
|
const eventTargetIsContainer = event.target === container.current;
|
|
@@ -13852,7 +13595,7 @@ function Pane({ isSelecting, selectionKeyPressed, selectionMode = SelectionMode.
|
|
|
13852
13595
|
if (isNoKeyEvent || !isSelecting || !isSelectionActive || event.button !== 0 || !event.isPrimary) {
|
|
13853
13596
|
return;
|
|
13854
13597
|
}
|
|
13855
|
-
|
|
13598
|
+
event.target?.setPointerCapture?.(event.pointerId);
|
|
13856
13599
|
selectionInProgress.current = false;
|
|
13857
13600
|
const { x, y } = getEventPosition(event.nativeEvent, containerBounds.current);
|
|
13858
13601
|
const userSelectionStartPosition = pointToRendererPoint({ x, y }, transform2);
|
|
@@ -13891,7 +13634,7 @@ function Pane({ isSelecting, selectionKeyPressed, selectionMode = SelectionMode.
|
|
|
13891
13634
|
const prevSelectedEdgeIds = selectedEdgeIds.current;
|
|
13892
13635
|
selectedNodeIds.current = new Set(getNodesInside(nodeLookup, nextUserSelectRect, transform2, selectionMode === SelectionMode.Partial, true).map((node) => node.id));
|
|
13893
13636
|
selectedEdgeIds.current = /* @__PURE__ */ new Set();
|
|
13894
|
-
const edgesSelectable =
|
|
13637
|
+
const edgesSelectable = defaultEdgeOptions?.selectable ?? true;
|
|
13895
13638
|
for (const nodeId of selectedNodeIds.current) {
|
|
13896
13639
|
const connections = connectionLookup.get(nodeId);
|
|
13897
13640
|
if (!connections)
|
|
@@ -13955,7 +13698,7 @@ function Pane({ isSelecting, selectionKeyPressed, selectionMode = SelectionMode.
|
|
|
13955
13698
|
return;
|
|
13956
13699
|
}
|
|
13957
13700
|
resetSelectedElements();
|
|
13958
|
-
onSelectionStart
|
|
13701
|
+
onSelectionStart?.(event);
|
|
13959
13702
|
}
|
|
13960
13703
|
selectionInProgress.current = true;
|
|
13961
13704
|
if (!autoPanStarted.current) {
|
|
@@ -13965,7 +13708,6 @@ function Pane({ isSelecting, selectionKeyPressed, selectionMode = SelectionMode.
|
|
|
13965
13708
|
commitUserSelectionRect(mouseX, mouseY);
|
|
13966
13709
|
};
|
|
13967
13710
|
const onPointerUp = (event) => {
|
|
13968
|
-
var _a2, _b;
|
|
13969
13711
|
if (!isSelectionEnabled) {
|
|
13970
13712
|
if (event.target === container.current && store.getState().connection.inProgress) {
|
|
13971
13713
|
connectionEndedOnPane.current = true;
|
|
@@ -13975,16 +13717,16 @@ function Pane({ isSelecting, selectionKeyPressed, selectionMode = SelectionMode.
|
|
|
13975
13717
|
if (event.button !== 0) {
|
|
13976
13718
|
return;
|
|
13977
13719
|
}
|
|
13978
|
-
|
|
13720
|
+
event.target?.releasePointerCapture?.(event.pointerId);
|
|
13979
13721
|
if (!userSelectionActive && event.target === container.current && store.getState().userSelectionRect) {
|
|
13980
|
-
onClick
|
|
13722
|
+
onClick?.(event);
|
|
13981
13723
|
}
|
|
13982
13724
|
store.setState({
|
|
13983
13725
|
userSelectionActive: false,
|
|
13984
13726
|
userSelectionRect: null
|
|
13985
13727
|
});
|
|
13986
13728
|
if (selectionInProgress.current) {
|
|
13987
|
-
onSelectionEnd
|
|
13729
|
+
onSelectionEnd?.(event);
|
|
13988
13730
|
store.setState({
|
|
13989
13731
|
nodesSelectionActive: selectedNodeIds.current.size > 0
|
|
13990
13732
|
});
|
|
@@ -13992,8 +13734,7 @@ function Pane({ isSelecting, selectionKeyPressed, selectionMode = SelectionMode.
|
|
|
13992
13734
|
cleanupAutoPan();
|
|
13993
13735
|
};
|
|
13994
13736
|
const onPointerCancel = (event) => {
|
|
13995
|
-
|
|
13996
|
-
(_b = (_a2 = event.target) == null ? void 0 : _a2.releasePointerCapture) == null ? void 0 : _b.call(_a2, event.pointerId);
|
|
13737
|
+
event.target?.releasePointerCapture?.(event.pointerId);
|
|
13997
13738
|
cleanupAutoPan();
|
|
13998
13739
|
};
|
|
13999
13740
|
const draggable = panOnDrag === true || Array.isArray(panOnDrag) && panOnDrag.includes(0);
|
|
@@ -14003,7 +13744,7 @@ function handleNodeClick({ id: id2, store, unselect = false, nodeRef }) {
|
|
|
14003
13744
|
const { addSelectedNodes, unselectNodesAndEdges, multiSelectionActive, nodeLookup, onError } = store.getState();
|
|
14004
13745
|
const node = nodeLookup.get(id2);
|
|
14005
13746
|
if (!node) {
|
|
14006
|
-
onError
|
|
13747
|
+
onError?.("012", errorMessages["error012"](id2));
|
|
14007
13748
|
return;
|
|
14008
13749
|
}
|
|
14009
13750
|
store.setState({ nodesSelectionActive: false });
|
|
@@ -14011,10 +13752,7 @@ function handleNodeClick({ id: id2, store, unselect = false, nodeRef }) {
|
|
|
14011
13752
|
addSelectedNodes([id2]);
|
|
14012
13753
|
} else if (unselect || node.selected && multiSelectionActive) {
|
|
14013
13754
|
unselectNodesAndEdges({ nodes: [node], edges: [] });
|
|
14014
|
-
requestAnimationFrame(() =>
|
|
14015
|
-
var _a2;
|
|
14016
|
-
return (_a2 = nodeRef == null ? void 0 : nodeRef.current) == null ? void 0 : _a2.blur();
|
|
14017
|
-
});
|
|
13755
|
+
requestAnimationFrame(() => nodeRef?.current?.blur());
|
|
14018
13756
|
}
|
|
14019
13757
|
}
|
|
14020
13758
|
function useDrag({ nodeRef, disabled = false, noDragClassName, handleSelector, nodeId, isSelectable, nodeClickDistance }) {
|
|
@@ -14042,8 +13780,7 @@ function useDrag({ nodeRef, disabled = false, noDragClassName, handleSelector, n
|
|
|
14042
13780
|
}
|
|
14043
13781
|
});
|
|
14044
13782
|
return () => {
|
|
14045
|
-
|
|
14046
|
-
(_a2 = xyDrag.current) == null ? void 0 : _a2.destroy();
|
|
13783
|
+
xyDrag.current?.destroy();
|
|
14047
13784
|
xyDrag.current = void 0;
|
|
14048
13785
|
};
|
|
14049
13786
|
}, [disabled, store, nodeRef]);
|
|
@@ -14139,19 +13876,18 @@ const connectingSelector = (nodeId, handleId, type) => (state) => {
|
|
|
14139
13876
|
if (!fromHandle && !clickHandle) {
|
|
14140
13877
|
return idleConnectingState;
|
|
14141
13878
|
}
|
|
14142
|
-
const connectingTo =
|
|
13879
|
+
const connectingTo = toHandle?.nodeId === nodeId && toHandle?.id === handleId && toHandle?.type === type;
|
|
14143
13880
|
return {
|
|
14144
|
-
connectingFrom:
|
|
13881
|
+
connectingFrom: fromHandle?.nodeId === nodeId && fromHandle?.id === handleId && fromHandle?.type === type,
|
|
14145
13882
|
connectingTo,
|
|
14146
|
-
clickConnecting:
|
|
14147
|
-
isPossibleEndHandle: connectionMode === ConnectionMode.Strict ?
|
|
13883
|
+
clickConnecting: clickHandle?.nodeId === nodeId && clickHandle?.id === handleId && clickHandle?.type === type,
|
|
13884
|
+
isPossibleEndHandle: connectionMode === ConnectionMode.Strict ? fromHandle?.type !== type : nodeId !== fromHandle?.nodeId || handleId !== fromHandle?.id,
|
|
14148
13885
|
connectionInProcess: !!fromHandle,
|
|
14149
13886
|
clickConnectionInProcess: !!clickHandle,
|
|
14150
13887
|
valid: connectingTo && isValid2
|
|
14151
13888
|
};
|
|
14152
13889
|
};
|
|
14153
13890
|
function HandleComponent({ type = "source", position = Position.Top, isValidConnection, isConnectable = true, isConnectableStart = true, isConnectableEnd = true, id: id2, onConnect, children: children2, className, onMouseDown, onTouchStart, ...rest }, ref) {
|
|
14154
|
-
var _a2, _b;
|
|
14155
13891
|
const handleId = id2 || null;
|
|
14156
13892
|
const isTarget = type === "target";
|
|
14157
13893
|
const store = useStoreApi();
|
|
@@ -14159,7 +13895,7 @@ function HandleComponent({ type = "source", position = Position.Top, isValidConn
|
|
|
14159
13895
|
const { connectOnClick, noPanClassName, rfId } = useHandleConfig();
|
|
14160
13896
|
const { connectingFrom, connectingTo, clickConnecting, isPossibleEndHandle, connectionInProcess, clickConnectionInProcess, valid } = useStore(connectingSelector(nodeId, handleId, type), shallow$1);
|
|
14161
13897
|
if (!nodeId) {
|
|
14162
|
-
|
|
13898
|
+
store.getState().onError?.("010", errorMessages["error010"]());
|
|
14163
13899
|
}
|
|
14164
13900
|
const onConnectExtended = (params) => {
|
|
14165
13901
|
const { defaultEdgeOptions, onConnect: onConnectAction, hasDefaultEdges } = store.getState();
|
|
@@ -14171,8 +13907,8 @@ function HandleComponent({ type = "source", position = Position.Top, isValidConn
|
|
|
14171
13907
|
const { edges, setEdges, onError } = store.getState();
|
|
14172
13908
|
setEdges(addEdge(edgeParams, edges, { onError }));
|
|
14173
13909
|
}
|
|
14174
|
-
onConnectAction
|
|
14175
|
-
onConnect
|
|
13910
|
+
onConnectAction?.(edgeParams);
|
|
13911
|
+
onConnect?.(edgeParams);
|
|
14176
13912
|
};
|
|
14177
13913
|
const onPointerDown2 = (event) => {
|
|
14178
13914
|
if (!nodeId) {
|
|
@@ -14196,16 +13932,10 @@ function HandleComponent({ type = "source", position = Position.Top, isValidConn
|
|
|
14196
13932
|
panBy: currentStore.panBy,
|
|
14197
13933
|
cancelConnection: currentStore.cancelConnection,
|
|
14198
13934
|
onConnectStart: currentStore.onConnectStart,
|
|
14199
|
-
onConnectEnd: (...args) =>
|
|
14200
|
-
var _a3, _b2;
|
|
14201
|
-
return (_b2 = (_a3 = store.getState()).onConnectEnd) == null ? void 0 : _b2.call(_a3, ...args);
|
|
14202
|
-
},
|
|
13935
|
+
onConnectEnd: (...args) => store.getState().onConnectEnd?.(...args),
|
|
14203
13936
|
updateConnection: currentStore.updateConnection,
|
|
14204
13937
|
onConnect: onConnectExtended,
|
|
14205
|
-
isValidConnection: isValidConnection || ((...args) =>
|
|
14206
|
-
var _a3, _b2;
|
|
14207
|
-
return ((_b2 = (_a3 = store.getState()).isValidConnection) == null ? void 0 : _b2.call(_a3, ...args)) ?? true;
|
|
14208
|
-
}),
|
|
13938
|
+
isValidConnection: isValidConnection || ((...args) => store.getState().isValidConnection?.(...args) ?? true),
|
|
14209
13939
|
getTransform: () => store.getState().transform,
|
|
14210
13940
|
getFromHandle: () => store.getState().connection.fromHandle,
|
|
14211
13941
|
autoPanSpeed: currentStore.autoPanSpeed,
|
|
@@ -14213,9 +13943,9 @@ function HandleComponent({ type = "source", position = Position.Top, isValidConn
|
|
|
14213
13943
|
});
|
|
14214
13944
|
}
|
|
14215
13945
|
if (isMouseTriggered) {
|
|
14216
|
-
onMouseDown
|
|
13946
|
+
onMouseDown?.(event);
|
|
14217
13947
|
} else {
|
|
14218
|
-
onTouchStart
|
|
13948
|
+
onTouchStart?.(event);
|
|
14219
13949
|
}
|
|
14220
13950
|
};
|
|
14221
13951
|
const onClick = (event) => {
|
|
@@ -14224,7 +13954,7 @@ function HandleComponent({ type = "source", position = Position.Top, isValidConn
|
|
|
14224
13954
|
return;
|
|
14225
13955
|
}
|
|
14226
13956
|
if (!connectionClickStartHandle) {
|
|
14227
|
-
onClickConnectStart
|
|
13957
|
+
onClickConnectStart?.(event.nativeEvent, { nodeId, handleId, handleType: type });
|
|
14228
13958
|
store.setState({ connectionClickStartHandle: { nodeId, type, id: handleId } });
|
|
14229
13959
|
return;
|
|
14230
13960
|
}
|
|
@@ -14252,7 +13982,7 @@ function HandleComponent({ type = "source", position = Position.Top, isValidConn
|
|
|
14252
13982
|
const connectionClone = structuredClone(connectionState);
|
|
14253
13983
|
delete connectionClone.inProgress;
|
|
14254
13984
|
connectionClone.toPosition = connectionClone.toHandle ? connectionClone.toHandle.position : null;
|
|
14255
|
-
onClickConnectEnd
|
|
13985
|
+
onClickConnectEnd?.(event, connectionClone);
|
|
14256
13986
|
store.setState({ connectionClickStartHandle: null });
|
|
14257
13987
|
};
|
|
14258
13988
|
return jsxRuntimeExports.jsx("div", { "data-handleid": handleId, "data-nodeid": nodeId, "data-handlepos": position, "data-id": `${rfId}-${nodeId}-${handleId}-${type}`, className: cc([
|
|
@@ -14281,16 +14011,16 @@ function HandleComponent({ type = "source", position = Position.Top, isValidConn
|
|
|
14281
14011
|
}
|
|
14282
14012
|
const Handle = reactExports.memo(fixedForwardRef(HandleComponent));
|
|
14283
14013
|
function InputNode({ data, isConnectable, sourcePosition = Position.Bottom }) {
|
|
14284
|
-
return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [data
|
|
14014
|
+
return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [data?.label, jsxRuntimeExports.jsx(Handle, { type: "source", position: sourcePosition, isConnectable })] });
|
|
14285
14015
|
}
|
|
14286
14016
|
function DefaultNode({ data, isConnectable, targetPosition = Position.Top, sourcePosition = Position.Bottom }) {
|
|
14287
|
-
return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx(Handle, { type: "target", position: targetPosition, isConnectable }), data
|
|
14017
|
+
return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx(Handle, { type: "target", position: targetPosition, isConnectable }), data?.label, jsxRuntimeExports.jsx(Handle, { type: "source", position: sourcePosition, isConnectable })] });
|
|
14288
14018
|
}
|
|
14289
14019
|
function GroupNode() {
|
|
14290
14020
|
return null;
|
|
14291
14021
|
}
|
|
14292
14022
|
function OutputNode({ data, isConnectable, targetPosition = Position.Top }) {
|
|
14293
|
-
return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx(Handle, { type: "target", position: targetPosition, isConnectable }), data
|
|
14023
|
+
return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx(Handle, { type: "target", position: targetPosition, isConnectable }), data?.label] });
|
|
14294
14024
|
}
|
|
14295
14025
|
const arrowKeyDiffs = {
|
|
14296
14026
|
ArrowUp: { x: 0, y: -1 },
|
|
@@ -14305,16 +14035,15 @@ const builtinNodeTypes = {
|
|
|
14305
14035
|
group: GroupNode
|
|
14306
14036
|
};
|
|
14307
14037
|
function getNodeInlineStyleDimensions(node) {
|
|
14308
|
-
var _a2, _b, _c, _d;
|
|
14309
14038
|
if (node.internals.handleBounds === void 0) {
|
|
14310
14039
|
return {
|
|
14311
|
-
width: node.width ?? node.initialWidth ??
|
|
14312
|
-
height: node.height ?? node.initialHeight ??
|
|
14040
|
+
width: node.width ?? node.initialWidth ?? node.style?.width,
|
|
14041
|
+
height: node.height ?? node.initialHeight ?? node.style?.height
|
|
14313
14042
|
};
|
|
14314
14043
|
}
|
|
14315
14044
|
return {
|
|
14316
|
-
width: node.width ??
|
|
14317
|
-
height: node.height ??
|
|
14045
|
+
width: node.width ?? node.style?.width,
|
|
14046
|
+
height: node.height ?? node.style?.height
|
|
14318
14047
|
};
|
|
14319
14048
|
}
|
|
14320
14049
|
const selector$e = (s) => {
|
|
@@ -14334,9 +14063,8 @@ function NodesSelection({ onSelectionContextMenu, noPanClassName, disableKeyboar
|
|
|
14334
14063
|
const moveSelectedNodes = useMoveSelectedNodes();
|
|
14335
14064
|
const nodeRef = reactExports.useRef(null);
|
|
14336
14065
|
reactExports.useEffect(() => {
|
|
14337
|
-
var _a2;
|
|
14338
14066
|
if (!disableKeyboardA11y) {
|
|
14339
|
-
|
|
14067
|
+
nodeRef.current?.focus({
|
|
14340
14068
|
preventScroll: true
|
|
14341
14069
|
});
|
|
14342
14070
|
}
|
|
@@ -14415,7 +14143,7 @@ function useResizeObserver() {
|
|
|
14415
14143
|
});
|
|
14416
14144
|
reactExports.useEffect(() => {
|
|
14417
14145
|
return () => {
|
|
14418
|
-
resizeObserver
|
|
14146
|
+
resizeObserver?.disconnect();
|
|
14419
14147
|
};
|
|
14420
14148
|
}, [resizeObserver]);
|
|
14421
14149
|
return resizeObserver;
|
|
@@ -14431,16 +14159,16 @@ function useNodeObserver({ node, nodeType, hasDimensions, resizeObserver }) {
|
|
|
14431
14159
|
reactExports.useEffect(() => {
|
|
14432
14160
|
if (nodeRef.current && !node.hidden && (!isInitialized || observedNode.current !== nodeRef.current)) {
|
|
14433
14161
|
if (observedNode.current) {
|
|
14434
|
-
resizeObserver
|
|
14162
|
+
resizeObserver?.unobserve(observedNode.current);
|
|
14435
14163
|
}
|
|
14436
|
-
resizeObserver
|
|
14164
|
+
resizeObserver?.observe(nodeRef.current);
|
|
14437
14165
|
observedNode.current = nodeRef.current;
|
|
14438
14166
|
}
|
|
14439
14167
|
}, [isInitialized, node.hidden]);
|
|
14440
14168
|
reactExports.useEffect(() => {
|
|
14441
14169
|
return () => {
|
|
14442
14170
|
if (observedNode.current) {
|
|
14443
|
-
resizeObserver
|
|
14171
|
+
resizeObserver?.unobserve(observedNode.current);
|
|
14444
14172
|
observedNode.current = null;
|
|
14445
14173
|
}
|
|
14446
14174
|
};
|
|
@@ -14471,11 +14199,11 @@ function NodeWrapper({ id: id2, onClick, onMouseEnter, onMouseMove, onMouseLeave
|
|
|
14471
14199
|
};
|
|
14472
14200
|
}, shallow$1);
|
|
14473
14201
|
let nodeType = node.type || "default";
|
|
14474
|
-
let NodeComponent =
|
|
14202
|
+
let NodeComponent = nodeTypes2?.[nodeType] || builtinNodeTypes[nodeType];
|
|
14475
14203
|
if (NodeComponent === void 0) {
|
|
14476
|
-
onError
|
|
14204
|
+
onError?.("003", errorMessages["error003"](nodeType));
|
|
14477
14205
|
nodeType = "default";
|
|
14478
|
-
NodeComponent =
|
|
14206
|
+
NodeComponent = nodeTypes2?.["default"] || builtinNodeTypes.default;
|
|
14479
14207
|
}
|
|
14480
14208
|
const isDraggable = !!(node.draggable || nodesDraggable && typeof node.draggable === "undefined");
|
|
14481
14209
|
const isSelectable = !!(node.selectable || elementsSelectable && typeof node.selectable === "undefined");
|
|
@@ -14547,8 +14275,7 @@ function NodeWrapper({ id: id2, onClick, onMouseEnter, onMouseMove, onMouseLeave
|
|
|
14547
14275
|
}
|
|
14548
14276
|
};
|
|
14549
14277
|
const onFocus = () => {
|
|
14550
|
-
|
|
14551
|
-
if (disableKeyboardA11y || !((_a2 = nodeRef.current) == null ? void 0 : _a2.matches(":focus-visible"))) {
|
|
14278
|
+
if (disableKeyboardA11y || !nodeRef.current?.matches(":focus-visible")) {
|
|
14552
14279
|
return;
|
|
14553
14280
|
}
|
|
14554
14281
|
const { transform: transform2, width, height, autoPanOnNodeFocus, setCenter } = store.getState();
|
|
@@ -14676,10 +14403,9 @@ const MarkerSymbols = {
|
|
|
14676
14403
|
function useMarkerSymbol(type) {
|
|
14677
14404
|
const store = useStoreApi();
|
|
14678
14405
|
const symbol = reactExports.useMemo(() => {
|
|
14679
|
-
var _a2, _b;
|
|
14680
14406
|
const symbolExists = Object.prototype.hasOwnProperty.call(MarkerSymbols, type);
|
|
14681
14407
|
if (!symbolExists) {
|
|
14682
|
-
|
|
14408
|
+
store.getState().onError?.("009", errorMessages["error009"](type));
|
|
14683
14409
|
return null;
|
|
14684
14410
|
}
|
|
14685
14411
|
return MarkerSymbols[type];
|
|
@@ -14700,8 +14426,8 @@ const MarkerDefinitions = ({ defaultColor, rfId }) => {
|
|
|
14700
14426
|
const markers2 = createMarkerIds(edges, {
|
|
14701
14427
|
id: rfId,
|
|
14702
14428
|
defaultColor,
|
|
14703
|
-
defaultMarkerStart: defaultEdgeOptions
|
|
14704
|
-
defaultMarkerEnd: defaultEdgeOptions
|
|
14429
|
+
defaultMarkerStart: defaultEdgeOptions?.markerStart,
|
|
14430
|
+
defaultMarkerEnd: defaultEdgeOptions?.markerEnd
|
|
14705
14431
|
});
|
|
14706
14432
|
return markers2;
|
|
14707
14433
|
}, [edges, defaultEdgeOptions, rfId, defaultColor]);
|
|
@@ -14803,9 +14529,9 @@ function createSmoothStepEdge(params) {
|
|
|
14803
14529
|
targetX,
|
|
14804
14530
|
targetY,
|
|
14805
14531
|
targetPosition,
|
|
14806
|
-
borderRadius: pathOptions
|
|
14807
|
-
offset: pathOptions
|
|
14808
|
-
stepPosition: pathOptions
|
|
14532
|
+
borderRadius: pathOptions?.borderRadius,
|
|
14533
|
+
offset: pathOptions?.offset,
|
|
14534
|
+
stepPosition: pathOptions?.stepPosition
|
|
14809
14535
|
});
|
|
14810
14536
|
const _id = params.isInternal ? void 0 : id2;
|
|
14811
14537
|
return jsxRuntimeExports.jsx(BaseEdge, { id: _id, path, labelX, labelY, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, style: style2, markerEnd, markerStart, interactionWidth });
|
|
@@ -14817,12 +14543,8 @@ SmoothStepEdge.displayName = "SmoothStepEdge";
|
|
|
14817
14543
|
SmoothStepEdgeInternal.displayName = "SmoothStepEdgeInternal";
|
|
14818
14544
|
function createStepEdge(params) {
|
|
14819
14545
|
return reactExports.memo(({ id: id2, ...props }) => {
|
|
14820
|
-
var _a2;
|
|
14821
14546
|
const _id = params.isInternal ? void 0 : id2;
|
|
14822
|
-
return jsxRuntimeExports.jsx(SmoothStepEdge, { ...props, id: _id, pathOptions: reactExports.useMemo(() => {
|
|
14823
|
-
var _a3;
|
|
14824
|
-
return { borderRadius: 0, offset: (_a3 = props.pathOptions) == null ? void 0 : _a3.offset };
|
|
14825
|
-
}, [(_a2 = props.pathOptions) == null ? void 0 : _a2.offset]) });
|
|
14547
|
+
return jsxRuntimeExports.jsx(SmoothStepEdge, { ...props, id: _id, pathOptions: reactExports.useMemo(() => ({ borderRadius: 0, offset: props.pathOptions?.offset }), [props.pathOptions?.offset]) });
|
|
14826
14548
|
});
|
|
14827
14549
|
}
|
|
14828
14550
|
const StepEdge = createStepEdge({ isInternal: false });
|
|
@@ -14849,7 +14571,7 @@ function createBezierEdge(params) {
|
|
|
14849
14571
|
targetX,
|
|
14850
14572
|
targetY,
|
|
14851
14573
|
targetPosition,
|
|
14852
|
-
curvature: pathOptions
|
|
14574
|
+
curvature: pathOptions?.curvature
|
|
14853
14575
|
});
|
|
14854
14576
|
const _id = params.isInternal ? void 0 : id2;
|
|
14855
14577
|
return jsxRuntimeExports.jsx(BaseEdge, { id: _id, path, labelX, labelY, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, style: style2, markerEnd, markerStart, interactionWidth });
|
|
@@ -14903,13 +14625,13 @@ function EdgeUpdateAnchors({ isReconnectable, reconnectRadius, edge, sourceX, so
|
|
|
14903
14625
|
const isTarget = oppositeHandle.type === "target";
|
|
14904
14626
|
const _onReconnectEnd = (evt, connectionState) => {
|
|
14905
14627
|
setReconnecting(false);
|
|
14906
|
-
onReconnectEnd
|
|
14628
|
+
onReconnectEnd?.(evt, edge, oppositeHandle.type, connectionState);
|
|
14907
14629
|
};
|
|
14908
|
-
const onConnectEdge = (connection) => onReconnect
|
|
14630
|
+
const onConnectEdge = (connection) => onReconnect?.(edge, connection);
|
|
14909
14631
|
const _onConnectStart = (_event, params) => {
|
|
14910
14632
|
setReconnecting(true);
|
|
14911
|
-
onReconnectStart
|
|
14912
|
-
onConnectStart
|
|
14633
|
+
onReconnectStart?.(event, edge, oppositeHandle.type);
|
|
14634
|
+
onConnectStart?.(_event, params);
|
|
14913
14635
|
};
|
|
14914
14636
|
XYHandle.onPointerDown(event.nativeEvent, {
|
|
14915
14637
|
autoPanOnConnect,
|
|
@@ -14925,16 +14647,10 @@ function EdgeUpdateAnchors({ isReconnectable, reconnectRadius, edge, sourceX, so
|
|
|
14925
14647
|
flowId,
|
|
14926
14648
|
cancelConnection,
|
|
14927
14649
|
panBy: panBy2,
|
|
14928
|
-
isValidConnection: (...args) =>
|
|
14929
|
-
var _a2, _b;
|
|
14930
|
-
return ((_b = (_a2 = store.getState()).isValidConnection) == null ? void 0 : _b.call(_a2, ...args)) ?? true;
|
|
14931
|
-
},
|
|
14650
|
+
isValidConnection: (...args) => store.getState().isValidConnection?.(...args) ?? true,
|
|
14932
14651
|
onConnect: onConnectEdge,
|
|
14933
14652
|
onConnectStart: _onConnectStart,
|
|
14934
|
-
onConnectEnd: (...args) =>
|
|
14935
|
-
var _a2, _b;
|
|
14936
|
-
return (_b = (_a2 = store.getState()).onConnectEnd) == null ? void 0 : _b.call(_a2, ...args);
|
|
14937
|
-
},
|
|
14653
|
+
onConnectEnd: (...args) => store.getState().onConnectEnd?.(...args),
|
|
14938
14654
|
onReconnectEnd: _onReconnectEnd,
|
|
14939
14655
|
updateConnection,
|
|
14940
14656
|
getTransform: () => store.getState().transform,
|
|
@@ -14954,11 +14670,11 @@ function EdgeWrapper({ id: id2, edgesFocusable, edgesReconnectable, elementsSele
|
|
|
14954
14670
|
const defaultEdgeOptions = useStore((s) => s.defaultEdgeOptions);
|
|
14955
14671
|
edge = defaultEdgeOptions ? { ...defaultEdgeOptions, ...edge } : edge;
|
|
14956
14672
|
let edgeType = edge.type || "default";
|
|
14957
|
-
let EdgeComponent =
|
|
14673
|
+
let EdgeComponent = edgeTypes2?.[edgeType] || builtinEdgeTypes[edgeType];
|
|
14958
14674
|
if (EdgeComponent === void 0) {
|
|
14959
|
-
onError
|
|
14675
|
+
onError?.("011", errorMessages["error011"](edgeType));
|
|
14960
14676
|
edgeType = "default";
|
|
14961
|
-
EdgeComponent =
|
|
14677
|
+
EdgeComponent = edgeTypes2?.["default"] || builtinEdgeTypes.default;
|
|
14962
14678
|
}
|
|
14963
14679
|
const isFocusable = !!(edge.focusable || edgesFocusable && typeof edge.focusable === "undefined");
|
|
14964
14680
|
const isReconnectable = typeof onReconnect !== "undefined" && (edge.reconnectable || edgesReconnectable && typeof edge.reconnectable === "undefined");
|
|
@@ -15001,13 +14717,12 @@ function EdgeWrapper({ id: id2, edgesFocusable, edgesReconnectable, elementsSele
|
|
|
15001
14717
|
return null;
|
|
15002
14718
|
}
|
|
15003
14719
|
const onEdgeClick = (event) => {
|
|
15004
|
-
var _a2;
|
|
15005
14720
|
const { addSelectedEdges, unselectNodesAndEdges, multiSelectionActive } = store.getState();
|
|
15006
14721
|
if (isSelectable) {
|
|
15007
14722
|
store.setState({ nodesSelectionActive: false });
|
|
15008
14723
|
if (edge.selected && multiSelectionActive) {
|
|
15009
14724
|
unselectNodesAndEdges({ nodes: [], edges: [edge] });
|
|
15010
|
-
|
|
14725
|
+
edgeRef.current?.blur();
|
|
15011
14726
|
} else {
|
|
15012
14727
|
addSelectedEdges([id2]);
|
|
15013
14728
|
}
|
|
@@ -15032,12 +14747,11 @@ function EdgeWrapper({ id: id2, edgesFocusable, edgesReconnectable, elementsSele
|
|
|
15032
14747
|
onMouseLeave(event, { ...edge });
|
|
15033
14748
|
} : void 0;
|
|
15034
14749
|
const onKeyDown = (event) => {
|
|
15035
|
-
var _a2;
|
|
15036
14750
|
if (!disableKeyboardA11y && elementSelectionKeys.includes(event.key) && isSelectable) {
|
|
15037
14751
|
const { unselectNodesAndEdges, addSelectedEdges } = store.getState();
|
|
15038
14752
|
const unselect = event.key === "Escape";
|
|
15039
14753
|
if (unselect) {
|
|
15040
|
-
|
|
14754
|
+
edgeRef.current?.blur();
|
|
15041
14755
|
unselectNodesAndEdges({ edges: [edge] });
|
|
15042
14756
|
} else {
|
|
15043
14757
|
addSelectedEdges([id2]);
|
|
@@ -15107,16 +14821,13 @@ function useOnInitHandler(onInit) {
|
|
|
15107
14821
|
}
|
|
15108
14822
|
}, [onInit, rfInstance.viewportInitialized]);
|
|
15109
14823
|
}
|
|
15110
|
-
const selector$8 = (state) =>
|
|
15111
|
-
var _a2;
|
|
15112
|
-
return (_a2 = state.panZoom) == null ? void 0 : _a2.syncViewport;
|
|
15113
|
-
};
|
|
14824
|
+
const selector$8 = (state) => state.panZoom?.syncViewport;
|
|
15114
14825
|
function useViewportSync(viewport) {
|
|
15115
14826
|
const syncViewport = useStore(selector$8);
|
|
15116
14827
|
const store = useStoreApi();
|
|
15117
14828
|
reactExports.useEffect(() => {
|
|
15118
14829
|
if (viewport) {
|
|
15119
|
-
syncViewport
|
|
14830
|
+
syncViewport?.(viewport);
|
|
15120
14831
|
store.setState({ transform: [viewport.x, viewport.y, viewport.zoom] });
|
|
15121
14832
|
}
|
|
15122
14833
|
}, [viewport, syncViewport]);
|
|
@@ -15230,7 +14941,7 @@ const getInitialState = ({ nodes, edges, defaultNodes, defaultEdges, width, heig
|
|
|
15230
14941
|
const bounds = getInternalNodesBounds(nodeLookup, {
|
|
15231
14942
|
filter: (node) => !!((node.width || node.initialWidth) && (node.height || node.initialHeight))
|
|
15232
14943
|
});
|
|
15233
|
-
const { x, y, zoom: zoom2 } = getViewportForBounds(bounds, width, height, minZoom, maxZoom,
|
|
14944
|
+
const { x, y, zoom: zoom2 } = getViewportForBounds(bounds, width, height, minZoom, maxZoom, fitViewOptions?.padding ?? 0.1);
|
|
15234
14945
|
transform2 = [x, y, zoom2];
|
|
15235
14946
|
}
|
|
15236
14947
|
return {
|
|
@@ -15335,7 +15046,7 @@ const createStore = ({ nodes, edges, defaultNodes, defaultEdges, width, height,
|
|
|
15335
15046
|
minZoom: minZoom2,
|
|
15336
15047
|
maxZoom: maxZoom2
|
|
15337
15048
|
}, fitViewOptions2);
|
|
15338
|
-
fitViewResolver
|
|
15049
|
+
fitViewResolver?.resolve(true);
|
|
15339
15050
|
set2({ fitViewResolver: null });
|
|
15340
15051
|
}
|
|
15341
15052
|
return {
|
|
@@ -15412,11 +15123,11 @@ const createStore = ({ nodes, edges, defaultNodes, defaultEdges, width, height,
|
|
|
15412
15123
|
} else {
|
|
15413
15124
|
set2({});
|
|
15414
15125
|
}
|
|
15415
|
-
if (
|
|
15126
|
+
if (changes?.length > 0) {
|
|
15416
15127
|
if (debug) {
|
|
15417
15128
|
console.log("React Flow: trigger node changes", changes);
|
|
15418
15129
|
}
|
|
15419
|
-
triggerNodeChanges
|
|
15130
|
+
triggerNodeChanges?.(changes);
|
|
15420
15131
|
}
|
|
15421
15132
|
},
|
|
15422
15133
|
updateNodePositions: (nodeDragItems, dragging = false) => {
|
|
@@ -15425,7 +15136,7 @@ const createStore = ({ nodes, edges, defaultNodes, defaultEdges, width, height,
|
|
|
15425
15136
|
const { nodeLookup, triggerNodeChanges, connection, updateConnection, onNodesChangeMiddlewareMap } = get2();
|
|
15426
15137
|
for (const [id2, dragItem] of nodeDragItems) {
|
|
15427
15138
|
const node = nodeLookup.get(id2);
|
|
15428
|
-
const expandParent = !!(
|
|
15139
|
+
const expandParent = !!(node?.expandParent && node?.parentId && dragItem?.position);
|
|
15429
15140
|
const change = {
|
|
15430
15141
|
id: id2,
|
|
15431
15142
|
type: "position",
|
|
@@ -15464,7 +15175,7 @@ const createStore = ({ nodes, edges, defaultNodes, defaultEdges, width, height,
|
|
|
15464
15175
|
},
|
|
15465
15176
|
triggerNodeChanges: (changes) => {
|
|
15466
15177
|
const { onNodesChange, setNodes, nodes: nodes2, hasDefaultNodes, debug } = get2();
|
|
15467
|
-
if (changes
|
|
15178
|
+
if (changes?.length) {
|
|
15468
15179
|
if (hasDefaultNodes) {
|
|
15469
15180
|
const updatedNodes = applyNodeChanges(changes, nodes2);
|
|
15470
15181
|
setNodes(updatedNodes);
|
|
@@ -15472,12 +15183,12 @@ const createStore = ({ nodes, edges, defaultNodes, defaultEdges, width, height,
|
|
|
15472
15183
|
if (debug) {
|
|
15473
15184
|
console.log("React Flow: trigger node changes", changes);
|
|
15474
15185
|
}
|
|
15475
|
-
onNodesChange
|
|
15186
|
+
onNodesChange?.(changes);
|
|
15476
15187
|
}
|
|
15477
15188
|
},
|
|
15478
15189
|
triggerEdgeChanges: (changes) => {
|
|
15479
15190
|
const { onEdgesChange, setEdges, edges: edges2, hasDefaultEdges, debug } = get2();
|
|
15480
|
-
if (changes
|
|
15191
|
+
if (changes?.length) {
|
|
15481
15192
|
if (hasDefaultEdges) {
|
|
15482
15193
|
const updatedEdges = applyEdgeChanges(changes, edges2);
|
|
15483
15194
|
setEdges(updatedEdges);
|
|
@@ -15485,7 +15196,7 @@ const createStore = ({ nodes, edges, defaultNodes, defaultEdges, width, height,
|
|
|
15485
15196
|
if (debug) {
|
|
15486
15197
|
console.log("React Flow: trigger edge changes", changes);
|
|
15487
15198
|
}
|
|
15488
|
-
onEdgesChange
|
|
15199
|
+
onEdgesChange?.(changes);
|
|
15489
15200
|
}
|
|
15490
15201
|
},
|
|
15491
15202
|
addSelectedNodes: (selectedNodeIds) => {
|
|
@@ -15531,17 +15242,16 @@ const createStore = ({ nodes, edges, defaultNodes, defaultEdges, width, height,
|
|
|
15531
15242
|
},
|
|
15532
15243
|
setMinZoom: (minZoom2) => {
|
|
15533
15244
|
const { panZoom, maxZoom: maxZoom2 } = get2();
|
|
15534
|
-
panZoom
|
|
15245
|
+
panZoom?.setScaleExtent([minZoom2, maxZoom2]);
|
|
15535
15246
|
set2({ minZoom: minZoom2 });
|
|
15536
15247
|
},
|
|
15537
15248
|
setMaxZoom: (maxZoom2) => {
|
|
15538
15249
|
const { panZoom, minZoom: minZoom2 } = get2();
|
|
15539
|
-
panZoom
|
|
15250
|
+
panZoom?.setScaleExtent([minZoom2, maxZoom2]);
|
|
15540
15251
|
set2({ maxZoom: maxZoom2 });
|
|
15541
15252
|
},
|
|
15542
15253
|
setTranslateExtent: (translateExtent) => {
|
|
15543
|
-
|
|
15544
|
-
(_a2 = get2().panZoom) == null ? void 0 : _a2.setTranslateExtent(translateExtent);
|
|
15254
|
+
get2().panZoom?.setTranslateExtent(translateExtent);
|
|
15545
15255
|
set2({ translateExtent });
|
|
15546
15256
|
},
|
|
15547
15257
|
resetSelectedElements: () => {
|
|
@@ -15572,17 +15282,17 @@ const createStore = ({ nodes, edges, defaultNodes, defaultEdges, width, height,
|
|
|
15572
15282
|
const { transform: transform2, width: width2, height: height2, panZoom, translateExtent } = get2();
|
|
15573
15283
|
return panBy({ delta, panZoom, transform: transform2, translateExtent, width: width2, height: height2 });
|
|
15574
15284
|
},
|
|
15575
|
-
setCenter: async (x, y,
|
|
15285
|
+
setCenter: async (x, y, options2) => {
|
|
15576
15286
|
const { width: width2, height: height2, maxZoom: maxZoom2, panZoom } = get2();
|
|
15577
15287
|
if (!panZoom) {
|
|
15578
15288
|
return false;
|
|
15579
15289
|
}
|
|
15580
|
-
const nextZoom = typeof
|
|
15290
|
+
const nextZoom = typeof options2?.zoom !== "undefined" ? options2.zoom : maxZoom2;
|
|
15581
15291
|
await panZoom.setViewport({
|
|
15582
15292
|
x: width2 / 2 - x * nextZoom,
|
|
15583
15293
|
y: height2 / 2 - y * nextZoom,
|
|
15584
15294
|
zoom: nextZoom
|
|
15585
|
-
}, { duration:
|
|
15295
|
+
}, { duration: options2?.duration, ease: options2?.ease, interpolate: options2?.interpolate });
|
|
15586
15296
|
return true;
|
|
15587
15297
|
},
|
|
15588
15298
|
cancelConnection: () => {
|
|
@@ -15633,15 +15343,12 @@ function ReactFlow({ nodes, edges, defaultNodes, defaultEdges, className, nodeTy
|
|
|
15633
15343
|
const colorModeClassName = useColorModeClass(colorMode);
|
|
15634
15344
|
const wrapperOnScroll = reactExports.useCallback((e) => {
|
|
15635
15345
|
e.currentTarget.scrollTo({ top: 0, left: 0, behavior: "instant" });
|
|
15636
|
-
onScroll
|
|
15346
|
+
onScroll?.(e);
|
|
15637
15347
|
}, [onScroll]);
|
|
15638
15348
|
return jsxRuntimeExports.jsx("div", { "data-testid": "rf__wrapper", ...rest, onScroll: wrapperOnScroll, style: { ...style2, ...wrapperStyle }, ref, className: cc(["react-flow", className, colorModeClassName]), id: id2, role: "application", children: jsxRuntimeExports.jsxs(Wrapper, { nodes, edges, width, height, fitView, fitViewOptions, minZoom, maxZoom, nodeOrigin, nodeExtent, zIndexMode, children: [jsxRuntimeExports.jsx(StoreUpdater, { nodes, edges, defaultNodes, defaultEdges, onConnect, onConnectStart, onConnectEnd, onClickConnectStart, onClickConnectEnd, nodesDraggable, autoPanOnNodeFocus, nodesConnectable, nodesFocusable, edgesFocusable, edgesReconnectable, elementsSelectable, elevateNodesOnSelect, elevateEdgesOnSelect, minZoom, maxZoom, nodeExtent, onNodesChange, onEdgesChange, snapToGrid, snapGrid, connectionMode, translateExtent, connectOnClick, defaultEdgeOptions, fitView, fitViewOptions, onNodesDelete, onEdgesDelete, onDelete, onNodeDragStart, onNodeDrag, onNodeDragStop, onSelectionDrag, onSelectionDragStart, onSelectionDragStop, onMove, onMoveStart, onMoveEnd, noPanClassName, nodeOrigin, rfId, autoPanOnConnect, autoPanOnNodeDrag, autoPanSpeed, onError, connectionRadius, isValidConnection, selectNodesOnDrag, nodeDragThreshold, connectionDragThreshold, onBeforeDelete, debug, ariaLabelConfig, zIndexMode }), jsxRuntimeExports.jsx(GraphView, { onInit, onNodeClick, onEdgeClick, onNodeMouseEnter, onNodeMouseMove, onNodeMouseLeave, onNodeContextMenu, onNodeDoubleClick, nodeTypes: nodeTypes2, edgeTypes: edgeTypes2, connectionLineType, connectionLineStyle, connectionLineComponent, connectionLineContainerStyle, selectionKeyCode, selectionOnDrag, selectionMode, deleteKeyCode, multiSelectionKeyCode, panActivationKeyCode, zoomActivationKeyCode, onlyRenderVisibleElements, defaultViewport: defaultViewport$1, translateExtent, minZoom, maxZoom, preventScrolling, zoomOnScroll, zoomOnPinch, zoomOnDoubleClick, panOnScroll, panOnScrollSpeed, panOnScrollMode, panOnDrag, autoPanOnSelection, onPaneClick, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, onPaneScroll, onPaneContextMenu, paneClickDistance, nodeClickDistance, onSelectionContextMenu, onSelectionStart, onSelectionEnd, onReconnect, onReconnectStart, onReconnectEnd, onEdgeContextMenu, onEdgeDoubleClick, onEdgeMouseEnter, onEdgeMouseMove, onEdgeMouseLeave, reconnectRadius, defaultMarkerColor, noDragClassName, noWheelClassName, noPanClassName, rfId, disableKeyboardA11y, nodeExtent, viewport, onViewportChange, nodesDraggable }), jsxRuntimeExports.jsx(SelectionListener, { onSelectionChange }), children2, jsxRuntimeExports.jsx(Attribution, { proOptions, position: attributionPosition }), jsxRuntimeExports.jsx(A11yDescriptions, { rfId, disableKeyboardA11y })] }) });
|
|
15639
15349
|
}
|
|
15640
15350
|
var index = fixedForwardRef(ReactFlow);
|
|
15641
|
-
const selector$6 = (s) =>
|
|
15642
|
-
var _a2;
|
|
15643
|
-
return (_a2 = s.domNode) == null ? void 0 : _a2.querySelector(".react-flow__edgelabel-renderer");
|
|
15644
|
-
};
|
|
15351
|
+
const selector$6 = (s) => s.domNode?.querySelector(".react-flow__edgelabel-renderer");
|
|
15645
15352
|
function EdgeLabelRenderer({ children: children2 }) {
|
|
15646
15353
|
const edgeLabelRenderer = useStore(selector$6);
|
|
15647
15354
|
if (!edgeLabelRenderer) {
|
|
@@ -15746,15 +15453,15 @@ function ControlsComponent({ style: style2, showZoom = true, showFitView = true,
|
|
|
15746
15453
|
const { zoomIn, zoomOut, fitView } = useReactFlow();
|
|
15747
15454
|
const onZoomInHandler = () => {
|
|
15748
15455
|
zoomIn();
|
|
15749
|
-
onZoomIn
|
|
15456
|
+
onZoomIn?.();
|
|
15750
15457
|
};
|
|
15751
15458
|
const onZoomOutHandler = () => {
|
|
15752
15459
|
zoomOut();
|
|
15753
|
-
onZoomOut
|
|
15460
|
+
onZoomOut?.();
|
|
15754
15461
|
};
|
|
15755
15462
|
const onFitViewHandler = () => {
|
|
15756
15463
|
fitView(fitViewOptions);
|
|
15757
|
-
onFitView
|
|
15464
|
+
onFitView?.();
|
|
15758
15465
|
};
|
|
15759
15466
|
const onToggleInteractivity = () => {
|
|
15760
15467
|
store.setState({
|
|
@@ -15762,7 +15469,7 @@ function ControlsComponent({ style: style2, showZoom = true, showFitView = true,
|
|
|
15762
15469
|
nodesConnectable: !isInteractive,
|
|
15763
15470
|
elementsSelectable: !isInteractive
|
|
15764
15471
|
});
|
|
15765
|
-
onInteractiveChange
|
|
15472
|
+
onInteractiveChange?.(!isInteractive);
|
|
15766
15473
|
};
|
|
15767
15474
|
const orientationClass = orientation === "horizontal" ? "horizontal" : "vertical";
|
|
15768
15475
|
return jsxRuntimeExports.jsxs(Panel, { className: cc(["react-flow__controls", orientationClass, className]), position, style: style2, "data-testid": "rf__controls", "aria-label": ariaLabel ?? ariaLabelConfig["controls.ariaLabel"], children: [showZoom && jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx(ControlButton, { onClick: onZoomInHandler, className: "react-flow__controls-zoomin", title: ariaLabelConfig["controls.zoomIn.ariaLabel"], "aria-label": ariaLabelConfig["controls.zoomIn.ariaLabel"], disabled: maxZoomReached, children: jsxRuntimeExports.jsx(PlusIcon, {}) }), jsxRuntimeExports.jsx(ControlButton, { onClick: onZoomOutHandler, className: "react-flow__controls-zoomout", title: ariaLabelConfig["controls.zoomOut.ariaLabel"], "aria-label": ariaLabelConfig["controls.zoomOut.ariaLabel"], disabled: minZoomReached, children: jsxRuntimeExports.jsx(MinusIcon, {}) })] }), showFitView && jsxRuntimeExports.jsx(ControlButton, { className: "react-flow__controls-fitview", onClick: onFitViewHandler, title: ariaLabelConfig["controls.fitView.ariaLabel"], "aria-label": ariaLabelConfig["controls.fitView.ariaLabel"], children: jsxRuntimeExports.jsx(FitViewIcon, {}) }), showInteractive && jsxRuntimeExports.jsx(ControlButton, { className: "react-flow__controls-interactive", onClick: onToggleInteractivity, title: ariaLabelConfig["controls.interactive.ariaLabel"], "aria-label": ariaLabelConfig["controls.interactive.ariaLabel"], children: isInteractive ? jsxRuntimeExports.jsx(UnlockIcon, {}) : jsxRuntimeExports.jsx(LockIcon, {}) }), children2] });
|
|
@@ -15895,8 +15602,8 @@ function MiniMapComponent({
|
|
|
15895
15602
|
const store = useStoreApi();
|
|
15896
15603
|
const svg = reactExports.useRef(null);
|
|
15897
15604
|
const { boundingRect, panZoom, viewBB, rfId, translateExtent, flowWidth, flowHeight, ariaLabelConfig } = useStore(selector$1, areEqual);
|
|
15898
|
-
const elementWidth =
|
|
15899
|
-
const elementHeight =
|
|
15605
|
+
const elementWidth = style2?.width ?? defaultWidth;
|
|
15606
|
+
const elementHeight = style2?.height ?? defaultHeight;
|
|
15900
15607
|
const scaledWidth = boundingRect.width / elementWidth;
|
|
15901
15608
|
const scaledHeight = boundingRect.height / elementHeight;
|
|
15902
15609
|
const viewScale = Math.max(scaledWidth, scaledHeight);
|
|
@@ -15921,14 +15628,12 @@ function MiniMapComponent({
|
|
|
15921
15628
|
getViewScale: () => viewScaleRef.current
|
|
15922
15629
|
});
|
|
15923
15630
|
return () => {
|
|
15924
|
-
|
|
15925
|
-
(_a2 = minimapInstance.current) == null ? void 0 : _a2.destroy();
|
|
15631
|
+
minimapInstance.current?.destroy();
|
|
15926
15632
|
};
|
|
15927
15633
|
}
|
|
15928
15634
|
}, [panZoom]);
|
|
15929
15635
|
reactExports.useEffect(() => {
|
|
15930
|
-
|
|
15931
|
-
(_a2 = minimapInstance.current) == null ? void 0 : _a2.update({
|
|
15636
|
+
minimapInstance.current?.update({
|
|
15932
15637
|
translateExtent,
|
|
15933
15638
|
width: flowWidth,
|
|
15934
15639
|
height: flowHeight,
|
|
@@ -15939,13 +15644,12 @@ function MiniMapComponent({
|
|
|
15939
15644
|
});
|
|
15940
15645
|
}, [pannable, zoomable, inversePan, zoomStep, translateExtent, flowWidth, flowHeight]);
|
|
15941
15646
|
const onSvgClick = onClick ? (event) => {
|
|
15942
|
-
|
|
15943
|
-
const [x2, y2] = ((_a2 = minimapInstance.current) == null ? void 0 : _a2.pointer(event)) || [0, 0];
|
|
15647
|
+
const [x2, y2] = minimapInstance.current?.pointer(event) || [0, 0];
|
|
15944
15648
|
onClick(event, { x: x2, y: y2 });
|
|
15945
15649
|
} : void 0;
|
|
15946
15650
|
const nodeClickHandler = reactExports.useCallback((event, nodeId) => {
|
|
15947
15651
|
const node = store.getState().nodeLookup.get(nodeId).internals.userNode;
|
|
15948
|
-
onNodeClick
|
|
15652
|
+
onNodeClick?.(event, node);
|
|
15949
15653
|
}, [onNodeClick]);
|
|
15950
15654
|
const onSvgNodeClick = onNodeClick ? nodeClickHandler : void 0;
|
|
15951
15655
|
const _ariaLabel = ariaLabel ?? ariaLabelConfig["minimap.ariaLabel"];
|
|
@@ -16083,8 +15787,7 @@ function ResizeControl({ nodeId, position, variant = ResizeControlVariant.Handle
|
|
|
16083
15787
|
shouldResize
|
|
16084
15788
|
});
|
|
16085
15789
|
return () => {
|
|
16086
|
-
|
|
16087
|
-
(_a2 = resizer.current) == null ? void 0 : _a2.destroy();
|
|
15790
|
+
resizer.current?.destroy();
|
|
16088
15791
|
};
|
|
16089
15792
|
}, [
|
|
16090
15793
|
controlPosition,
|
|
@@ -16115,21 +15818,20 @@ const LAYOUT = {
|
|
|
16115
15818
|
PARALLEL_GROUP_PADDING: 25
|
|
16116
15819
|
};
|
|
16117
15820
|
function LoopNodeComponent({ data, selected: selected2 }) {
|
|
16118
|
-
var _a2, _b, _c, _d;
|
|
16119
15821
|
const nodeData = data;
|
|
16120
15822
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
16121
15823
|
"div",
|
|
16122
15824
|
{
|
|
16123
15825
|
className: `relative ${nodeData.className || ""}`,
|
|
16124
15826
|
style: {
|
|
16125
|
-
borderWidth:
|
|
15827
|
+
borderWidth: nodeData.nodeStyle?.borderWidth ?? 1,
|
|
16126
15828
|
borderRadius: 8,
|
|
16127
15829
|
padding: 12,
|
|
16128
15830
|
width: 220,
|
|
16129
15831
|
borderStyle: "solid",
|
|
16130
|
-
backgroundColor:
|
|
16131
|
-
borderColor:
|
|
16132
|
-
opacity:
|
|
15832
|
+
backgroundColor: nodeData.nodeStyle?.backgroundColor,
|
|
15833
|
+
borderColor: nodeData.nodeStyle?.borderColor ?? "#9ca3af",
|
|
15834
|
+
opacity: nodeData.nodeStyle?.opacity,
|
|
16133
15835
|
boxShadow: selected2 ? "0 0 0 2px rgba(168, 85, 247, 0.5)" : void 0
|
|
16134
15836
|
},
|
|
16135
15837
|
children: [
|
|
@@ -16204,7 +15906,6 @@ function ParallelGroupComponent({ data }) {
|
|
|
16204
15906
|
);
|
|
16205
15907
|
}
|
|
16206
15908
|
function DiamondNodeComponent({ data, selected: selected2 }) {
|
|
16207
|
-
var _a2, _b, _c;
|
|
16208
15909
|
const nodeData = data;
|
|
16209
15910
|
const size = 160;
|
|
16210
15911
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
@@ -16226,9 +15927,9 @@ function DiamondNodeComponent({ data, selected: selected2 }) {
|
|
|
16226
15927
|
borderWidth: 2,
|
|
16227
15928
|
borderStyle: "solid",
|
|
16228
15929
|
borderRadius: 4,
|
|
16229
|
-
backgroundColor:
|
|
16230
|
-
borderColor:
|
|
16231
|
-
opacity:
|
|
15930
|
+
backgroundColor: nodeData.nodeStyle?.backgroundColor,
|
|
15931
|
+
borderColor: nodeData.nodeStyle?.borderColor ?? "#ef4444",
|
|
15932
|
+
opacity: nodeData.nodeStyle?.opacity,
|
|
16232
15933
|
boxShadow: selected2 ? "0 0 0 2px rgba(239, 68, 68, 0.5)" : void 0
|
|
16233
15934
|
}
|
|
16234
15935
|
}
|
|
@@ -16419,7 +16120,6 @@ function getNodeIcon(nodeKind, label) {
|
|
|
16419
16120
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(Zap, { className: "h-3.5 w-3.5 text-green-900" });
|
|
16420
16121
|
}
|
|
16421
16122
|
function calculateEnhancedLayout(workflow, layoutConfig = LAYOUT) {
|
|
16422
|
-
var _a2, _b, _c, _d, _e;
|
|
16423
16123
|
const nodes = workflow.nodes.map((node) => ({ ...node }));
|
|
16424
16124
|
const groupNodes = [];
|
|
16425
16125
|
const additionalEdges = [];
|
|
@@ -16427,7 +16127,7 @@ function calculateEnhancedLayout(workflow, layoutConfig = LAYOUT) {
|
|
|
16427
16127
|
const loopNodes = /* @__PURE__ */ new Map();
|
|
16428
16128
|
const conditionalGroups = /* @__PURE__ */ new Map();
|
|
16429
16129
|
for (const node of nodes) {
|
|
16430
|
-
if (
|
|
16130
|
+
if (node.metadata?.parallelGroupId) {
|
|
16431
16131
|
const group = parallelGroups.get(node.metadata.parallelGroupId) || {
|
|
16432
16132
|
nodes: [],
|
|
16433
16133
|
method: node.metadata.parallelMethod
|
|
@@ -16435,12 +16135,12 @@ function calculateEnhancedLayout(workflow, layoutConfig = LAYOUT) {
|
|
|
16435
16135
|
group.nodes.push(node);
|
|
16436
16136
|
parallelGroups.set(node.metadata.parallelGroupId, group);
|
|
16437
16137
|
}
|
|
16438
|
-
if (
|
|
16138
|
+
if (node.metadata?.loopId) {
|
|
16439
16139
|
const group = loopNodes.get(node.metadata.loopId) || [];
|
|
16440
16140
|
group.push(node);
|
|
16441
16141
|
loopNodes.set(node.metadata.loopId, group);
|
|
16442
16142
|
}
|
|
16443
|
-
if (
|
|
16143
|
+
if (node.metadata?.conditionalId) {
|
|
16444
16144
|
const groups = conditionalGroups.get(node.metadata.conditionalId) || {
|
|
16445
16145
|
thenBranch: [],
|
|
16446
16146
|
elseBranch: []
|
|
@@ -16497,8 +16197,8 @@ function calculateEnhancedLayout(workflow, layoutConfig = LAYOUT) {
|
|
|
16497
16197
|
const elseNodes = branches.elseBranch;
|
|
16498
16198
|
if (thenNodes.length > 0 && elseNodes.length > 0) {
|
|
16499
16199
|
const baseY = Math.min(
|
|
16500
|
-
|
|
16501
|
-
|
|
16200
|
+
thenNodes[0]?.position.y || 0,
|
|
16201
|
+
elseNodes[0]?.position.y || 0
|
|
16502
16202
|
);
|
|
16503
16203
|
thenNodes.forEach((node, idx) => {
|
|
16504
16204
|
node.position = {
|
|
@@ -16516,10 +16216,7 @@ function calculateEnhancedLayout(workflow, layoutConfig = LAYOUT) {
|
|
|
16516
16216
|
}
|
|
16517
16217
|
for (const [, loopNodeList] of loopNodes) {
|
|
16518
16218
|
if (loopNodeList.length > 0) {
|
|
16519
|
-
const isAwaitLoop = loopNodeList.some((n) =>
|
|
16520
|
-
var _a3;
|
|
16521
|
-
return (_a3 = n.metadata) == null ? void 0 : _a3.loopIsAwait;
|
|
16522
|
-
});
|
|
16219
|
+
const isAwaitLoop = loopNodeList.some((n) => n.metadata?.loopIsAwait);
|
|
16523
16220
|
for (const loopNode of loopNodeList) {
|
|
16524
16221
|
additionalEdges.push({
|
|
16525
16222
|
id: `self_loop_${loopNode.id}`,
|
|
@@ -16536,10 +16233,9 @@ function calculateEnhancedLayout(workflow, layoutConfig = LAYOUT) {
|
|
|
16536
16233
|
return { nodes, groupNodes, additionalEdges };
|
|
16537
16234
|
}
|
|
16538
16235
|
function consolidateEdges(edges, nodes) {
|
|
16539
|
-
var _a2;
|
|
16540
16236
|
const nodeToGroup = /* @__PURE__ */ new Map();
|
|
16541
16237
|
for (const node of nodes) {
|
|
16542
|
-
if (
|
|
16238
|
+
if (node.metadata?.parallelGroupId) {
|
|
16543
16239
|
nodeToGroup.set(node.id, node.metadata.parallelGroupId);
|
|
16544
16240
|
}
|
|
16545
16241
|
}
|
|
@@ -16581,7 +16277,6 @@ function consolidateEdges(edges, nodes) {
|
|
|
16581
16277
|
return consolidatedEdges;
|
|
16582
16278
|
}
|
|
16583
16279
|
function convertToReactFlowNodes(workflow) {
|
|
16584
|
-
var _a2;
|
|
16585
16280
|
const { nodes, groupNodes } = calculateEnhancedLayout(workflow);
|
|
16586
16281
|
const nodeToParent = /* @__PURE__ */ new Map();
|
|
16587
16282
|
const groupPositions = /* @__PURE__ */ new Map();
|
|
@@ -16591,7 +16286,7 @@ function convertToReactFlowNodes(workflow) {
|
|
|
16591
16286
|
}
|
|
16592
16287
|
}
|
|
16593
16288
|
for (const node of nodes) {
|
|
16594
|
-
const parallelGroupId =
|
|
16289
|
+
const parallelGroupId = node.metadata?.parallelGroupId ? `group_${node.metadata.parallelGroupId}` : null;
|
|
16595
16290
|
if (parallelGroupId && groupPositions.has(parallelGroupId)) {
|
|
16596
16291
|
nodeToParent.set(node.id, parallelGroupId);
|
|
16597
16292
|
}
|
|
@@ -16616,8 +16311,8 @@ function convertToReactFlowNodes(workflow) {
|
|
|
16616
16311
|
nodes.forEach((node) => {
|
|
16617
16312
|
const styles = getNodeStyle(node.data.nodeKind);
|
|
16618
16313
|
const metadata = node.metadata;
|
|
16619
|
-
const isLoopNode = !!
|
|
16620
|
-
const isAwaitLoop = !!
|
|
16314
|
+
const isLoopNode = !!metadata?.loopId;
|
|
16315
|
+
const isAwaitLoop = !!metadata?.loopIsAwait;
|
|
16621
16316
|
const isConditionalNode = node.data.nodeKind === "conditional";
|
|
16622
16317
|
let nodeType = isConditionalNode ? "diamondNode" : isLoopNode ? "loopNode" : "default";
|
|
16623
16318
|
if (node.type === "workflowStart") {
|
|
@@ -16890,8 +16585,8 @@ function WorkflowGraphViewer({ workflow }) {
|
|
|
16890
16585
|
}
|
|
16891
16586
|
) });
|
|
16892
16587
|
}
|
|
16893
|
-
var
|
|
16894
|
-
var __name = (target, value) =>
|
|
16588
|
+
var __defProp = Object.defineProperty;
|
|
16589
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
16895
16590
|
var DIALOG_NAME = "Dialog";
|
|
16896
16591
|
var [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME);
|
|
16897
16592
|
var [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME);
|
|
@@ -17040,9 +16735,8 @@ var DialogContentModal = /* @__PURE__ */ reactExports.forwardRef(
|
|
|
17040
16735
|
trapFocus: context.open,
|
|
17041
16736
|
disableOutsidePointerEvents: context.open,
|
|
17042
16737
|
onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {
|
|
17043
|
-
var _a2;
|
|
17044
16738
|
event.preventDefault();
|
|
17045
|
-
|
|
16739
|
+
context.triggerRef.current?.focus();
|
|
17046
16740
|
}),
|
|
17047
16741
|
onPointerDownOutside: composeEventHandlers(props.onPointerDownOutside, (event) => {
|
|
17048
16742
|
const originalEvent = event.detail.originalEvent;
|
|
@@ -17072,18 +16766,16 @@ var DialogContentNonModal = /* @__PURE__ */ reactExports.forwardRef(
|
|
|
17072
16766
|
trapFocus: false,
|
|
17073
16767
|
disableOutsidePointerEvents: false,
|
|
17074
16768
|
onCloseAutoFocus: (event) => {
|
|
17075
|
-
|
|
17076
|
-
(_a2 = props.onCloseAutoFocus) == null ? void 0 : _a2.call(props, event);
|
|
16769
|
+
props.onCloseAutoFocus?.(event);
|
|
17077
16770
|
if (!event.defaultPrevented) {
|
|
17078
|
-
if (!hasInteractedOutsideRef.current)
|
|
16771
|
+
if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();
|
|
17079
16772
|
event.preventDefault();
|
|
17080
16773
|
}
|
|
17081
16774
|
hasInteractedOutsideRef.current = false;
|
|
17082
16775
|
hasPointerDownOutsideRef.current = false;
|
|
17083
16776
|
},
|
|
17084
16777
|
onInteractOutside: (event) => {
|
|
17085
|
-
|
|
17086
|
-
(_a2 = props.onInteractOutside) == null ? void 0 : _a2.call(props, event);
|
|
16778
|
+
props.onInteractOutside?.(event);
|
|
17087
16779
|
if (!event.defaultPrevented) {
|
|
17088
16780
|
hasInteractedOutsideRef.current = true;
|
|
17089
16781
|
if (event.detail.originalEvent.type === "pointerdown") {
|
|
@@ -17091,7 +16783,7 @@ var DialogContentNonModal = /* @__PURE__ */ reactExports.forwardRef(
|
|
|
17091
16783
|
}
|
|
17092
16784
|
}
|
|
17093
16785
|
const target = event.target;
|
|
17094
|
-
const targetIsTrigger =
|
|
16786
|
+
const targetIsTrigger = context.triggerRef.current?.contains(target);
|
|
17095
16787
|
if (targetIsTrigger) event.preventDefault();
|
|
17096
16788
|
if (event.detail.originalEvent.type === "focusin" && hasPointerDownOutsideRef.current) {
|
|
17097
16789
|
event.preventDefault();
|
|
@@ -17205,7 +16897,7 @@ function useOptimisticSearchParams() {
|
|
|
17205
16897
|
const [optimisticParams, setOptimisticParams] = reactExports.useOptimistic(searchParams);
|
|
17206
16898
|
const [, startTransition] = reactExports.useTransition();
|
|
17207
16899
|
const updateSearchParams = reactExports.useCallback(
|
|
17208
|
-
(updates,
|
|
16900
|
+
(updates, options2) => {
|
|
17209
16901
|
const next = new URLSearchParams(optimisticParams);
|
|
17210
16902
|
for (const [key, value] of Object.entries(updates)) {
|
|
17211
16903
|
if (value === null) {
|
|
@@ -17219,7 +16911,7 @@ function useOptimisticSearchParams() {
|
|
|
17219
16911
|
setOptimisticParams(next);
|
|
17220
16912
|
await navigate(
|
|
17221
16913
|
{ search: search ? `?${search}` : "" },
|
|
17222
|
-
{ preventScrollReset: true, ...
|
|
16914
|
+
{ preventScrollReset: true, ...options2 }
|
|
17223
16915
|
);
|
|
17224
16916
|
});
|
|
17225
16917
|
},
|
|
@@ -17228,71 +16920,68 @@ function useOptimisticSearchParams() {
|
|
|
17228
16920
|
return [optimisticParams, updateSearchParams];
|
|
17229
16921
|
}
|
|
17230
16922
|
export {
|
|
17231
|
-
|
|
16923
|
+
useInfiniteList as $,
|
|
17232
16924
|
Alert as A,
|
|
17233
|
-
|
|
17234
|
-
|
|
16925
|
+
DialogContent as B,
|
|
16926
|
+
CopyableText as C,
|
|
17235
16927
|
DEFAULT_PAGE_SIZE as D,
|
|
17236
16928
|
Ellipsis as E,
|
|
17237
|
-
|
|
17238
|
-
|
|
17239
|
-
|
|
17240
|
-
|
|
17241
|
-
|
|
17242
|
-
|
|
17243
|
-
|
|
17244
|
-
|
|
17245
|
-
|
|
17246
|
-
|
|
17247
|
-
|
|
17248
|
-
|
|
16929
|
+
DialogClose as F,
|
|
16930
|
+
DialogTitle as G,
|
|
16931
|
+
DialogDescription as H,
|
|
16932
|
+
DialogPortal as I,
|
|
16933
|
+
DialogOverlay as J,
|
|
16934
|
+
unwrapServerActionResult as K,
|
|
16935
|
+
WorkflowGraphViewer as L,
|
|
16936
|
+
useOptimisticSearchParams as M,
|
|
16937
|
+
TabsList as N,
|
|
16938
|
+
TabsTrigger as O,
|
|
16939
|
+
TabsContent as P,
|
|
16940
|
+
ErrorBoundary as Q,
|
|
17249
16941
|
ResolveHookModal as R,
|
|
17250
16942
|
Send as S,
|
|
17251
16943
|
Tabs as T,
|
|
17252
|
-
|
|
17253
|
-
|
|
16944
|
+
findStartHookCreation as U,
|
|
16945
|
+
Wrench as V,
|
|
17254
16946
|
WorkflowWebAPIError as W,
|
|
17255
16947
|
X,
|
|
17256
|
-
|
|
16948
|
+
ErrorCard as Y,
|
|
17257
16949
|
Zap as Z,
|
|
17258
|
-
|
|
17259
|
-
|
|
17260
|
-
|
|
17261
|
-
|
|
17262
|
-
|
|
17263
|
-
|
|
17264
|
-
|
|
17265
|
-
|
|
17266
|
-
|
|
17267
|
-
|
|
17268
|
-
|
|
17269
|
-
|
|
17270
|
-
|
|
17271
|
-
|
|
17272
|
-
|
|
17273
|
-
|
|
17274
|
-
AlertTitle as c,
|
|
17275
|
-
getErrorTitle as d,
|
|
17276
|
-
AlertDescription as e,
|
|
16950
|
+
format as _,
|
|
16951
|
+
RelativeTime as a,
|
|
16952
|
+
createDialogScope as a0,
|
|
16953
|
+
DialogTrigger as a1,
|
|
16954
|
+
LIVE_UPDATE_INTERVAL_MS as a2,
|
|
16955
|
+
LAYOUT as a3,
|
|
16956
|
+
tabsListClassName as a4,
|
|
16957
|
+
tabsTriggerClassName as a5,
|
|
16958
|
+
wakeUpRun as a6,
|
|
16959
|
+
RunActionsButtons as a7,
|
|
16960
|
+
cancelRun as a8,
|
|
16961
|
+
recreateRun as a9,
|
|
16962
|
+
AlertTitle as b,
|
|
16963
|
+
getErrorTitle as c,
|
|
16964
|
+
AlertDescription as d,
|
|
16965
|
+
getErrorMessage as e,
|
|
17277
16966
|
fetchHookToken as f,
|
|
17278
16967
|
getPaginationDisplay as g,
|
|
17279
|
-
|
|
17280
|
-
|
|
17281
|
-
|
|
17282
|
-
|
|
17283
|
-
|
|
17284
|
-
|
|
17285
|
-
|
|
17286
|
-
|
|
17287
|
-
|
|
17288
|
-
|
|
16968
|
+
DropdownMenu as h,
|
|
16969
|
+
DropdownMenuTrigger as i,
|
|
16970
|
+
DropdownMenuContent as j,
|
|
16971
|
+
DropdownMenuItem as k,
|
|
16972
|
+
useDirection as l,
|
|
16973
|
+
createCollection as m,
|
|
16974
|
+
hideOthers as n,
|
|
16975
|
+
useFocusGuards as o,
|
|
16976
|
+
ReactRemoveScroll as p,
|
|
16977
|
+
ChevronUp as q,
|
|
17289
16978
|
resumeHook as r,
|
|
17290
|
-
|
|
17291
|
-
|
|
16979
|
+
useWorkflowRunsInfinite as s,
|
|
16980
|
+
bulkCancelRuns as t,
|
|
17292
16981
|
unwrapOrThrow as u,
|
|
17293
|
-
|
|
17294
|
-
|
|
17295
|
-
|
|
17296
|
-
|
|
17297
|
-
|
|
16982
|
+
reenqueueRun as v,
|
|
16983
|
+
StatusBadge as w,
|
|
16984
|
+
CircleX as x,
|
|
16985
|
+
RunActionsDropdownItems as y,
|
|
16986
|
+
Dialog as z
|
|
17298
16987
|
};
|