@w6w/ui 0.1.1 → 0.2.11
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/CHANGELOG.md +27 -0
- package/README.md +7 -5
- package/dist/AppPicker.d.ts +48 -2
- package/dist/CanvasLayer.d.ts +38 -0
- package/dist/{CodeBlock-Dot3Pd7P.js → CodeBlock-BqXDA35P.js} +2 -2
- package/dist/{CodeBlock-Dot3Pd7P.js.map → CodeBlock-BqXDA35P.js.map} +1 -1
- package/dist/{CodeBlock-CZu4TFSi.cjs → CodeBlock-CulfbnZD.cjs} +2 -2
- package/dist/{CodeBlock-CZu4TFSi.cjs.map → CodeBlock-CulfbnZD.cjs.map} +1 -1
- package/dist/ConfirmModal-Ln99S9NT.js +7919 -0
- package/dist/ConfirmModal-Ln99S9NT.js.map +1 -0
- package/dist/ConfirmModal-fjHW5rN-.cjs +14 -0
- package/dist/ConfirmModal-fjHW5rN-.cjs.map +1 -0
- package/dist/ConnectionHeader.d.ts +19 -0
- package/dist/Copyable-DA6eiU7w.cjs +2 -0
- package/dist/Copyable-DA6eiU7w.cjs.map +1 -0
- package/dist/{Copyable-1niV9gUa.js → Copyable-F4NTaG77.js} +91 -15
- package/dist/Copyable-F4NTaG77.js.map +1 -0
- package/dist/EditConnectionModal.d.ts +26 -0
- package/dist/JsonEditor.d.ts +8 -0
- package/dist/Markdown.d.ts +25 -0
- package/dist/ParamsForm.d.ts +7 -1
- package/dist/StepBuilderModal.d.ts +23 -5
- package/dist/WorkflowFlowEditor.d.ts +14 -3
- package/dist/app-pages.d.ts +5 -0
- package/dist/canvas-types.d.ts +36 -0
- package/dist/canvas-utils.d.ts +44 -0
- package/dist/code.cjs +1 -1
- package/dist/code.mjs +2 -2
- package/dist/components/AuthFieldsForm.d.ts +19 -1
- package/dist/components/BudgetMeter.d.ts +15 -0
- package/dist/components/CallableList.d.ts +58 -0
- package/dist/components/Combobox.d.ts +8 -1
- package/dist/components/ConnectionList.d.ts +43 -0
- package/dist/components/CredentialPicker.d.ts +35 -0
- package/dist/components/DataTable.d.ts +27 -0
- package/dist/components/EmptyState.d.ts +9 -0
- package/dist/components/ListItem.d.ts +16 -6
- package/dist/components/ReliabilityChart.d.ts +10 -0
- package/dist/components/ReliabilityList.d.ts +47 -0
- package/dist/components/icons.d.ts +1 -1
- package/dist/connection-app-meta.d.ts +32 -0
- package/dist/dynamic-fields.d.ts +60 -0
- package/dist/editor-theme.d.ts +24 -0
- package/dist/flow-fanout.d.ts +2 -2
- package/dist/flow-types.d.ts +18 -1
- package/dist/flow-utils.d.ts +10 -3
- package/dist/flow.cjs +2 -2
- package/dist/flow.cjs.map +1 -1
- package/dist/flow.d.ts +9 -0
- package/dist/flow.mjs +1519 -1138
- package/dist/flow.mjs.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +30 -2
- package/dist/index.mjs +2053 -1005
- package/dist/index.mjs.map +1 -1
- package/dist/note-markdown.d.ts +22 -0
- package/dist/provider.d.ts +73 -5
- package/dist/reliability-board-layout.d.ts +121 -0
- package/dist/resolve-params.d.ts +5 -0
- package/dist/run-visuals.d.ts +4 -1
- package/dist/step-problems.d.ts +34 -0
- package/dist/types.d.ts +117 -3
- package/dist/use-dynamic-fields.d.ts +23 -0
- package/package.json +5 -3
- package/src/styles/_budget-meter.scss +46 -0
- package/src/styles/_callable-list.scss +69 -0
- package/src/styles/_canvas.scss +318 -0
- package/src/styles/_connections.scss +88 -0
- package/src/styles/_data-table.scss +55 -0
- package/src/styles/_empty-state.scss +21 -0
- package/src/styles/_flow.scss +11 -0
- package/src/styles/_fx.scss +23 -0
- package/src/styles/_layout.scss +10 -0
- package/src/styles/_lists.scss +4 -0
- package/src/styles/_markdown.scss +20 -0
- package/src/styles/_reliability.scss +339 -0
- package/src/styles/_tester.scss +1 -14
- package/src/styles.css +1142 -17
- package/src/styles.scss +8 -0
- package/dist/ConfirmModal-8avl9Nv8.cjs +0 -11
- package/dist/ConfirmModal-8avl9Nv8.cjs.map +0 -1
- package/dist/ConfirmModal-CD-P8mhN.js +0 -6335
- package/dist/ConfirmModal-CD-P8mhN.js.map +0 -1
- package/dist/Copyable-1niV9gUa.js.map +0 -1
- package/dist/Copyable-CYZU1o4X.cjs +0 -2
- package/dist/Copyable-CYZU1o4X.cjs.map +0 -1
package/dist/flow.mjs
CHANGED
|
@@ -1,38 +1,117 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { addEdge as
|
|
4
|
-
import { useMemo as
|
|
5
|
-
import { createPortal as
|
|
6
|
-
import { u as
|
|
7
|
-
import {
|
|
8
|
-
import { I as
|
|
9
|
-
const
|
|
10
|
-
function
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
import { jsx as o, jsxs as m, Fragment as U } from "react/jsx-runtime";
|
|
3
|
+
import { addEdge as _n, ReactFlowProvider as Wn, useNodesState as Bn, useEdgesState as Jn, useReactFlow as zn, ReactFlow as Hn, ConnectionLineType as jn, Background as On, Controls as Un, ControlButton as qn, MiniMap as Kn, Panel as Vt, Position as Ne, NodeToolbar as Xn, useNodeId as Gn, Handle as Yn } from "@xyflow/react";
|
|
4
|
+
import { useMemo as O, useState as S, useRef as Ce, useEffect as z, useCallback as F, useContext as he, createContext as Ye } from "react";
|
|
5
|
+
import { createPortal as Qn } from "react-dom";
|
|
6
|
+
import { u as an, b as Zn, f as es, i as ts, J as it, d as ns, r as cn, a as ss, c as os, v as is, n as we, e as at, g as ct, s as ln, h as Je, j as Qe, w as rs, k as as, l as cs, m as $t, o as We, p as _t, q as ls, t as Wt, x as ds, y as dn, z as Ie, A as us, B as ps, C as Be, D as Bt, E as fs, F as hs, G as ws, W as ms, H as gs, I as Jt, K as bs, L as ys, M as zt, S as vs, N as Ns, O as un, P as pn, Q as fn, R as hn, T as lt, U as Ht, V as jt, X as wn, Y as mn, Z as gn, _ as bn, $ as Ot, a0 as rt, a1 as Cs, a2 as Ss, a3 as xs, a4 as ks, a5 as Es, a6 as Ps, a7 as Ut, a8 as Rs, a9 as Ts, aa as As, ab as Is, ac as Ds, ad as Ls, ae as Ms } from "./ConfirmModal-Ln99S9NT.js";
|
|
7
|
+
import { af as Vo, ag as $o, ah as _o, ai as Wo, aj as Bo, ak as Jo, al as zo, am as Ho, an as jo, ao as Oo } from "./ConfirmModal-Ln99S9NT.js";
|
|
8
|
+
import { I as ve, C as Fs } from "./Copyable-F4NTaG77.js";
|
|
9
|
+
const Vs = 200, $s = 200, _s = 10240;
|
|
10
|
+
function qt(e) {
|
|
11
|
+
const t = {};
|
|
12
|
+
for (const [s, r] of Object.entries(e)) t[s] = Math.round(r);
|
|
13
|
+
return t;
|
|
14
|
+
}
|
|
15
|
+
const Ws = (e) => !!e && Number.isFinite(e.x) && Number.isFinite(e.y), Bs = (e) => !!e && Number.isFinite(e.width) && Number.isFinite(e.height);
|
|
16
|
+
function Kt(e, t, s) {
|
|
17
|
+
return e && e.map((r) => {
|
|
18
|
+
const a = t == null ? void 0 : t[r.id], c = Ws(a == null ? void 0 : a.position) ? a.position : r.position, u = Bs(a == null ? void 0 : a.size) ? a.size : r.size;
|
|
19
|
+
return { ...r, position: qt(c), size: qt(u) };
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
function Js(e, t, s) {
|
|
23
|
+
if (!t) return e;
|
|
24
|
+
const r = { ...e };
|
|
25
|
+
return e.notes && (r.notes = Kt(e.notes, s)), e.sections && (r.sections = Kt(e.sections, s)), r;
|
|
26
|
+
}
|
|
27
|
+
function Xt(e, t) {
|
|
28
|
+
return e.sections ? {
|
|
29
|
+
...e,
|
|
30
|
+
sections: e.sections.map((s) => ({
|
|
31
|
+
...s,
|
|
32
|
+
nodes: s.nodes.filter((r) => r !== t)
|
|
33
|
+
}))
|
|
34
|
+
} : e;
|
|
35
|
+
}
|
|
36
|
+
function zs(e, t, s) {
|
|
37
|
+
return e.sections ? {
|
|
38
|
+
...e,
|
|
39
|
+
sections: e.sections.map((r) => ({
|
|
40
|
+
...r,
|
|
41
|
+
nodes: r.nodes.map((a) => a === t ? s : a)
|
|
42
|
+
}))
|
|
43
|
+
} : e;
|
|
44
|
+
}
|
|
45
|
+
function Gt(e, t, s) {
|
|
46
|
+
if (!e.sections) return e;
|
|
47
|
+
const r = new Set(s);
|
|
48
|
+
return {
|
|
49
|
+
...e,
|
|
50
|
+
sections: e.sections.map((a) => {
|
|
51
|
+
const c = a.nodes.filter((u) => !r.has(u));
|
|
52
|
+
return a.id === t ? { ...a, nodes: [.../* @__PURE__ */ new Set([...c, ...s])] } : { ...a, nodes: c };
|
|
53
|
+
})
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
function Hs(e, t) {
|
|
57
|
+
return (e.sections ?? []).filter((s) => s.nodes.includes(t)).map((s) => s.id);
|
|
58
|
+
}
|
|
59
|
+
function js(e, t) {
|
|
60
|
+
const s = new TextEncoder();
|
|
61
|
+
if (s.encode(e).length <= t) return e;
|
|
62
|
+
let r = "", a = 0;
|
|
63
|
+
for (const c of e) {
|
|
64
|
+
const u = s.encode(c).length;
|
|
65
|
+
if (a + u > t) break;
|
|
66
|
+
r += c, a += u;
|
|
67
|
+
}
|
|
68
|
+
return r;
|
|
69
|
+
}
|
|
70
|
+
function Yt(e) {
|
|
71
|
+
const t = { ...e };
|
|
72
|
+
return e.notes && (t.notes = e.notes.slice(0, Vs).map((s) => ({ ...s, content: js(s.content, _s) }))), e.sections && (t.sections = e.sections.slice(0, $s)), t;
|
|
73
|
+
}
|
|
74
|
+
function Os(e, t, s) {
|
|
75
|
+
const r = {};
|
|
76
|
+
for (const u of [...e.notes ?? [], ...e.sections ?? []])
|
|
77
|
+
r[u.id] = { position: u.position, size: u.size };
|
|
78
|
+
const a = (u, b) => u == null ? void 0 : u.map((N) => {
|
|
79
|
+
const C = b == null ? void 0 : b.find((h) => h.id === N.id);
|
|
80
|
+
return C ? { ...N, position: C.position, size: C.size } : N;
|
|
81
|
+
}), c = s ? e : {
|
|
82
|
+
...e,
|
|
83
|
+
...e.notes ? { notes: a(e.notes, t == null ? void 0 : t.notes) } : {},
|
|
84
|
+
...e.sections ? { sections: a(e.sections, t == null ? void 0 : t.sections) } : {}
|
|
85
|
+
};
|
|
86
|
+
return Js(c, s, r);
|
|
87
|
+
}
|
|
88
|
+
const Qt = 220;
|
|
89
|
+
function Us(e) {
|
|
90
|
+
return e.length <= Qt ? { text: e, clipped: !1, length: e.length } : {
|
|
91
|
+
text: e.slice(0, Qt).trimEnd(),
|
|
13
92
|
clipped: !0,
|
|
14
93
|
length: e.length
|
|
15
94
|
};
|
|
16
95
|
}
|
|
17
|
-
function
|
|
96
|
+
function qs({
|
|
18
97
|
params: e,
|
|
19
|
-
values:
|
|
20
|
-
testStartState:
|
|
98
|
+
values: t,
|
|
99
|
+
testStartState: s,
|
|
21
100
|
view: r = "props"
|
|
22
101
|
}) {
|
|
23
|
-
const { sampleValues:
|
|
24
|
-
() =>
|
|
25
|
-
[
|
|
26
|
-
), u =
|
|
27
|
-
var
|
|
28
|
-
return
|
|
29
|
-
},
|
|
102
|
+
const { sampleValues: a } = an(), c = O(
|
|
103
|
+
() => Zn(a, s),
|
|
104
|
+
[a, s]
|
|
105
|
+
), u = es(e), b = (h) => {
|
|
106
|
+
var k;
|
|
107
|
+
return t[h] !== void 0 ? t[h] : (k = u.find((l) => l.key === h)) == null ? void 0 : k.default;
|
|
108
|
+
}, N = u.filter((h) => h.type !== "section" && ts(h, b));
|
|
30
109
|
if (r === "code") {
|
|
31
|
-
const
|
|
32
|
-
return /* @__PURE__ */
|
|
33
|
-
|
|
110
|
+
const h = Ks(N, t, c);
|
|
111
|
+
return /* @__PURE__ */ o("div", { className: "w6w-resolved-params", children: /* @__PURE__ */ o(
|
|
112
|
+
it,
|
|
34
113
|
{
|
|
35
|
-
value: JSON.stringify(
|
|
114
|
+
value: JSON.stringify(h, null, 2),
|
|
36
115
|
onChange: () => {
|
|
37
116
|
},
|
|
38
117
|
readOnly: !0,
|
|
@@ -42,116 +121,116 @@ function ns({
|
|
|
42
121
|
}
|
|
43
122
|
) });
|
|
44
123
|
}
|
|
45
|
-
const
|
|
46
|
-
return
|
|
124
|
+
const C = N.filter((h) => !ns(b(h.key), h.default));
|
|
125
|
+
return N.length === 0 ? /* @__PURE__ */ o("div", { className: "w6w-resolved-params", children: /* @__PURE__ */ o("p", { className: "w6w-muted w6w-small", children: "This action takes no parameters." }) }) : C.length === 0 ? /* @__PURE__ */ o("div", { className: "w6w-resolved-params", children: /* @__PURE__ */ o("p", { className: "w6w-muted w6w-small", children: "Every configured value matches its default — nothing to show here. Switch to JSON to see the full set." }) }) : (
|
|
47
126
|
// `.w6w-resolved-table` is the ONE grid this whole row list shares — each
|
|
48
127
|
// `.w6w-resolved-row` below is `display: contents` and contributes its
|
|
49
128
|
// two children straight into these column tracks, so every row's key
|
|
50
129
|
// column lines up with every other row's.
|
|
51
|
-
/* @__PURE__ */
|
|
52
|
-
(
|
|
53
|
-
|
|
130
|
+
/* @__PURE__ */ o("div", { className: "w6w-resolved-params w6w-resolved-table", children: C.map(
|
|
131
|
+
(h) => h.type === "vars" ? /* @__PURE__ */ o(Gs, { param: h, value: t[h.key], scope: c }, h.key) : /* @__PURE__ */ o(
|
|
132
|
+
Xs,
|
|
54
133
|
{
|
|
55
|
-
label:
|
|
56
|
-
segments:
|
|
57
|
-
|
|
58
|
-
|
|
134
|
+
label: h.label ?? h.key,
|
|
135
|
+
segments: cn(
|
|
136
|
+
t[h.key] !== void 0 ? t[h.key] : h.default,
|
|
137
|
+
c
|
|
59
138
|
)
|
|
60
139
|
},
|
|
61
|
-
|
|
140
|
+
h.key
|
|
62
141
|
)
|
|
63
142
|
) })
|
|
64
143
|
);
|
|
65
144
|
}
|
|
66
|
-
function
|
|
145
|
+
function Ks(e, t, s) {
|
|
67
146
|
const r = {};
|
|
68
|
-
for (const
|
|
69
|
-
if (
|
|
70
|
-
const
|
|
71
|
-
r[
|
|
147
|
+
for (const a of e)
|
|
148
|
+
if (a.type === "vars") {
|
|
149
|
+
const c = Array.isArray(t[a.key]) ? t[a.key] : Array.isArray(a.default) ? a.default : [];
|
|
150
|
+
r[a.key] = ss(c, s);
|
|
72
151
|
} else
|
|
73
|
-
r[
|
|
74
|
-
|
|
75
|
-
|
|
152
|
+
r[a.key] = os(
|
|
153
|
+
t[a.key] !== void 0 ? t[a.key] : a.default,
|
|
154
|
+
s
|
|
76
155
|
);
|
|
77
156
|
return r;
|
|
78
157
|
}
|
|
79
|
-
function
|
|
80
|
-
return /* @__PURE__ */
|
|
81
|
-
/* @__PURE__ */
|
|
82
|
-
/* @__PURE__ */
|
|
158
|
+
function Xs({ label: e, segments: t }) {
|
|
159
|
+
return /* @__PURE__ */ m("div", { className: "w6w-resolved-row", children: [
|
|
160
|
+
/* @__PURE__ */ o("span", { className: "w6w-resolved-label", children: e }),
|
|
161
|
+
/* @__PURE__ */ o("div", { className: "w6w-resolved-value", children: /* @__PURE__ */ o(yn, { segments: t }) })
|
|
83
162
|
] });
|
|
84
163
|
}
|
|
85
|
-
function
|
|
164
|
+
function Gs({
|
|
86
165
|
param: e,
|
|
87
|
-
value:
|
|
88
|
-
scope:
|
|
166
|
+
value: t,
|
|
167
|
+
scope: s
|
|
89
168
|
}) {
|
|
90
|
-
const r = Array.isArray(
|
|
91
|
-
return /* @__PURE__ */
|
|
92
|
-
/* @__PURE__ */
|
|
93
|
-
r.length === 0 ? /* @__PURE__ */
|
|
169
|
+
const r = Array.isArray(t) ? t : Array.isArray(e.default) ? e.default : [];
|
|
170
|
+
return /* @__PURE__ */ m("div", { className: "w6w-resolved-row", children: [
|
|
171
|
+
/* @__PURE__ */ o("span", { className: "w6w-resolved-label", children: e.label ?? e.key }),
|
|
172
|
+
r.length === 0 ? /* @__PURE__ */ o("p", { className: "w6w-muted w6w-small", children: "None configured." }) : /* @__PURE__ */ o("div", { className: "w6w-stack", children: r.map((a, c) => (
|
|
94
173
|
// biome-ignore lint/suspicious/noArrayIndexKey: rows have no stable id (mirrors ParamsForm's VarsField)
|
|
95
|
-
/* @__PURE__ */
|
|
96
|
-
/* @__PURE__ */
|
|
174
|
+
/* @__PURE__ */ m("div", { className: "w6w-resolved-value", children: [
|
|
175
|
+
/* @__PURE__ */ o("code", { children: a.key || "(no key)" }),
|
|
97
176
|
" → ",
|
|
98
|
-
/* @__PURE__ */
|
|
99
|
-
] },
|
|
177
|
+
/* @__PURE__ */ o(yn, { segments: cn(a.value, s) })
|
|
178
|
+
] }, c)
|
|
100
179
|
)) })
|
|
101
180
|
] });
|
|
102
181
|
}
|
|
103
|
-
function
|
|
104
|
-
return /* @__PURE__ */
|
|
182
|
+
function yn({ segments: e }) {
|
|
183
|
+
return /* @__PURE__ */ o(U, { children: e.map((t, s) => (
|
|
105
184
|
// biome-ignore lint/suspicious/noArrayIndexKey: segments are a positional, immutable render of one value's parts
|
|
106
|
-
/* @__PURE__ */
|
|
185
|
+
/* @__PURE__ */ o(Ys, { segment: t }, s)
|
|
107
186
|
)) });
|
|
108
187
|
}
|
|
109
|
-
function
|
|
188
|
+
function Ys({ segment: e }) {
|
|
110
189
|
switch (e.status) {
|
|
111
190
|
case "resolved":
|
|
112
|
-
return e.ref ? /* @__PURE__ */
|
|
113
|
-
/* @__PURE__ */
|
|
114
|
-
/* @__PURE__ */
|
|
115
|
-
] }) : /* @__PURE__ */
|
|
191
|
+
return e.ref ? /* @__PURE__ */ m(U, { children: [
|
|
192
|
+
/* @__PURE__ */ o(Xe, { kind: "var", refName: e.ref }),
|
|
193
|
+
/* @__PURE__ */ o(Zt, { value: e.value })
|
|
194
|
+
] }) : /* @__PURE__ */ o(Zt, { value: e.value });
|
|
116
195
|
case "unresolved":
|
|
117
|
-
return /* @__PURE__ */
|
|
118
|
-
/* @__PURE__ */
|
|
119
|
-
/* @__PURE__ */
|
|
196
|
+
return /* @__PURE__ */ m(U, { children: [
|
|
197
|
+
/* @__PURE__ */ o(Xe, { kind: "var", refName: e.ref }),
|
|
198
|
+
/* @__PURE__ */ o("span", { className: "w6w-param-unresolved", children: "unresolved" })
|
|
120
199
|
] });
|
|
121
200
|
case "not-evaluated":
|
|
122
|
-
return /* @__PURE__ */
|
|
123
|
-
/* @__PURE__ */
|
|
124
|
-
/* @__PURE__ */
|
|
201
|
+
return /* @__PURE__ */ m(U, { children: [
|
|
202
|
+
/* @__PURE__ */ o(Xe, { kind: "expr" }),
|
|
203
|
+
/* @__PURE__ */ o("span", { className: "w6w-param-unevaluated", children: "not evaluated" })
|
|
125
204
|
] });
|
|
126
205
|
case "masked":
|
|
127
|
-
return /* @__PURE__ */
|
|
206
|
+
return /* @__PURE__ */ o(Xe, { kind: "secret", refName: e.ref });
|
|
128
207
|
}
|
|
129
208
|
}
|
|
130
|
-
function
|
|
131
|
-
const [
|
|
132
|
-
return
|
|
133
|
-
/* @__PURE__ */
|
|
134
|
-
/* @__PURE__ */
|
|
209
|
+
function Zt({ value: e }) {
|
|
210
|
+
const [t, s] = S(!1), r = Zs(e), a = Us(r);
|
|
211
|
+
return a.clipped ? /* @__PURE__ */ m(U, { children: [
|
|
212
|
+
/* @__PURE__ */ o("span", { className: t ? "w6w-resolved-text-full" : void 0, children: t ? r : `${a.text}…` }),
|
|
213
|
+
/* @__PURE__ */ o(
|
|
135
214
|
"button",
|
|
136
215
|
{
|
|
137
216
|
type: "button",
|
|
138
217
|
className: "w6w-resolved-more",
|
|
139
|
-
"aria-expanded":
|
|
140
|
-
onClick: () =>
|
|
141
|
-
children:
|
|
218
|
+
"aria-expanded": t,
|
|
219
|
+
onClick: () => s((c) => !c),
|
|
220
|
+
children: t ? "Show less" : `Show all (${a.length.toLocaleString()} characters)`
|
|
142
221
|
}
|
|
143
222
|
)
|
|
144
|
-
] }) : /* @__PURE__ */
|
|
145
|
-
}
|
|
146
|
-
const
|
|
147
|
-
function
|
|
148
|
-
const
|
|
149
|
-
return /* @__PURE__ */
|
|
150
|
-
/* @__PURE__ */
|
|
151
|
-
/* @__PURE__ */
|
|
223
|
+
] }) : /* @__PURE__ */ o("span", { children: r });
|
|
224
|
+
}
|
|
225
|
+
const Qs = { var: "◆", secret: "🔒", expr: "ƒ" };
|
|
226
|
+
function Xe({ kind: e, refName: t }) {
|
|
227
|
+
const s = e === "expr" ? "expr" : is(t ?? "");
|
|
228
|
+
return /* @__PURE__ */ m("span", { className: `w6w-expr-chip w6w-expr-chip-${e}`, children: [
|
|
229
|
+
/* @__PURE__ */ o("span", { className: "w6w-expr-chip-sigil", children: Qs[e] }),
|
|
230
|
+
/* @__PURE__ */ o("span", { className: "w6w-expr-chip-label", children: s })
|
|
152
231
|
] });
|
|
153
232
|
}
|
|
154
|
-
function
|
|
233
|
+
function Zs(e) {
|
|
155
234
|
if (e === null) return "null";
|
|
156
235
|
if (e === void 0) return "(not set)";
|
|
157
236
|
if (e === "") return '""';
|
|
@@ -163,141 +242,145 @@ function ls(e) {
|
|
|
163
242
|
return String(e);
|
|
164
243
|
}
|
|
165
244
|
}
|
|
166
|
-
function
|
|
167
|
-
var
|
|
168
|
-
return ((
|
|
169
|
-
}
|
|
170
|
-
function
|
|
171
|
-
var
|
|
172
|
-
return ((
|
|
173
|
-
}
|
|
174
|
-
function
|
|
175
|
-
var
|
|
176
|
-
if (!e || !
|
|
177
|
-
const
|
|
178
|
-
if (!
|
|
179
|
-
const
|
|
180
|
-
return
|
|
181
|
-
}
|
|
182
|
-
function
|
|
183
|
-
var
|
|
184
|
-
if (!
|
|
185
|
-
const u = (
|
|
186
|
-
if (!u || !
|
|
187
|
-
const
|
|
188
|
-
let
|
|
189
|
-
if (
|
|
190
|
-
return { next: r, conflict: null, refusal: { refused: "out_cap", cap:
|
|
191
|
-
const
|
|
192
|
-
if (
|
|
193
|
-
const
|
|
194
|
-
|
|
245
|
+
function oe(e) {
|
|
246
|
+
var t;
|
|
247
|
+
return ((t = e.data) == null ? void 0 : t.when) === "error" ? "error" : "success";
|
|
248
|
+
}
|
|
249
|
+
function vn(e, t) {
|
|
250
|
+
var s;
|
|
251
|
+
return ((s = e.find((r) => r.id === t)) == null ? void 0 : s.id) ?? null;
|
|
252
|
+
}
|
|
253
|
+
function Nn(e, t, s, r, a) {
|
|
254
|
+
var C, h;
|
|
255
|
+
if (!e || !t || e === t || r.some((k) => k.source === e && k.target === t)) return !1;
|
|
256
|
+
const c = (C = s.find((k) => k.id === e)) == null ? void 0 : C.data.step, u = (h = s.find((k) => k.id === t)) == null ? void 0 : h.data.step;
|
|
257
|
+
if (!c || !u) return !1;
|
|
258
|
+
const b = we(c, a), N = we(u, a);
|
|
259
|
+
return b.out >= 1 && N.in >= 1;
|
|
260
|
+
}
|
|
261
|
+
function dt(e, t, s, r, a, c) {
|
|
262
|
+
var D, T;
|
|
263
|
+
if (!Nn(e, t, s, r, c) || !e || !t) return null;
|
|
264
|
+
const u = (D = s.find((_) => _.id === e)) == null ? void 0 : D.data.step, b = (T = s.find((_) => _.id === t)) == null ? void 0 : T.data.step;
|
|
265
|
+
if (!u || !b) return null;
|
|
266
|
+
const N = we(u, c), C = we(b, c);
|
|
267
|
+
let h = r;
|
|
268
|
+
if (h.filter((_) => _.source === e && oe(_) === a).length >= N.out)
|
|
269
|
+
return { next: r, conflict: null, refusal: { refused: "out_cap", cap: N.out } };
|
|
270
|
+
const l = h.filter((_) => _.target === t);
|
|
271
|
+
if (l.length >= C.in) {
|
|
272
|
+
const _ = new Set(l.slice(0, l.length - C.in + 1).map((A) => A.id));
|
|
273
|
+
h = h.filter((A) => !_.has(A.id));
|
|
195
274
|
}
|
|
196
|
-
const
|
|
275
|
+
const x = at(e, t, a);
|
|
197
276
|
return {
|
|
198
|
-
next:
|
|
277
|
+
next: _n(
|
|
199
278
|
{
|
|
200
279
|
source: e,
|
|
201
|
-
target:
|
|
202
|
-
id:
|
|
203
|
-
sourceHandle:
|
|
204
|
-
data: { when:
|
|
280
|
+
target: t,
|
|
281
|
+
id: x,
|
|
282
|
+
sourceHandle: ln(a),
|
|
283
|
+
data: { when: a },
|
|
205
284
|
// No run state: this mints a freshly DRAWN edge, never a run-taken
|
|
206
285
|
// one — the live run-aware repaint is a separate effect
|
|
207
286
|
// (WorkflowFlowEditor.tsx, T1.1.1), not this creation path.
|
|
208
|
-
...
|
|
287
|
+
...ct(a, void 0)
|
|
209
288
|
},
|
|
210
|
-
|
|
289
|
+
h
|
|
211
290
|
),
|
|
212
|
-
conflict:
|
|
291
|
+
conflict: vn(h, x),
|
|
213
292
|
refusal: null
|
|
214
293
|
};
|
|
215
294
|
}
|
|
216
|
-
function
|
|
217
|
-
const u =
|
|
295
|
+
function Ge(e, t, s, r, a = "success", c) {
|
|
296
|
+
const u = dt(e, t, s, r, a, c);
|
|
218
297
|
return !u || u.conflict || u.refusal ? null : u.next;
|
|
219
298
|
}
|
|
220
|
-
function
|
|
299
|
+
function eo(e, t, s, r, a = "success", c) {
|
|
221
300
|
var u;
|
|
222
|
-
return ((u =
|
|
301
|
+
return ((u = dt(e, t, s, r, a, c)) == null ? void 0 : u.conflict) ?? null;
|
|
223
302
|
}
|
|
224
|
-
function
|
|
303
|
+
function to(e, t, s, r, a = "success", c) {
|
|
225
304
|
var u;
|
|
226
|
-
return ((u =
|
|
227
|
-
}
|
|
228
|
-
function
|
|
229
|
-
var
|
|
230
|
-
const
|
|
231
|
-
if (
|
|
232
|
-
const u =
|
|
233
|
-
if (!
|
|
234
|
-
const
|
|
235
|
-
if ((
|
|
236
|
-
return { next: e, conflict: null, refusal: { refused: "out_cap", cap:
|
|
237
|
-
const
|
|
305
|
+
return ((u = dt(e, t, s, r, a, c)) == null ? void 0 : u.refusal) ?? null;
|
|
306
|
+
}
|
|
307
|
+
function ut(e, t, s, r, a) {
|
|
308
|
+
var D;
|
|
309
|
+
const c = e.filter((T) => T.id === t);
|
|
310
|
+
if (c.length !== 1) return null;
|
|
311
|
+
const u = c[0], b = (D = r.find((T) => T.id === u.source)) == null ? void 0 : D.data.step;
|
|
312
|
+
if (!b) return null;
|
|
313
|
+
const N = we(b, a).out, C = e.filter((T) => T.id !== t);
|
|
314
|
+
if ((oe(u) === s ? [] : C.filter((T) => T.source === u.source && oe(T) === s)).length >= N)
|
|
315
|
+
return { next: e, conflict: null, refusal: { refused: "out_cap", cap: N } };
|
|
316
|
+
const k = ct(s, void 0), l = {
|
|
238
317
|
...u,
|
|
239
|
-
id:
|
|
240
|
-
data: { ...u.data, when:
|
|
241
|
-
className:
|
|
242
|
-
label:
|
|
243
|
-
sourceHandle:
|
|
244
|
-
},
|
|
318
|
+
id: at(u.source, u.target, s),
|
|
319
|
+
data: { ...u.data, when: s },
|
|
320
|
+
className: k.className,
|
|
321
|
+
label: k.label,
|
|
322
|
+
sourceHandle: ln(s)
|
|
323
|
+
}, x = vn(C, l.id);
|
|
245
324
|
return {
|
|
246
325
|
// `edgeId` is single-owner (guarded above), so this replaces exactly one edge.
|
|
247
|
-
next: e.map((
|
|
248
|
-
conflict:
|
|
326
|
+
next: e.map((T) => T.id === t ? l : T),
|
|
327
|
+
conflict: x,
|
|
249
328
|
refusal: null
|
|
250
329
|
};
|
|
251
330
|
}
|
|
252
|
-
function
|
|
253
|
-
const
|
|
254
|
-
return !
|
|
331
|
+
function no(e, t, s, r, a) {
|
|
332
|
+
const c = ut(e, t, s, r, a);
|
|
333
|
+
return !c || c.conflict || c.refusal ? null : c.next;
|
|
255
334
|
}
|
|
256
|
-
function
|
|
257
|
-
var
|
|
258
|
-
return ((
|
|
335
|
+
function so(e, t, s, r, a) {
|
|
336
|
+
var c;
|
|
337
|
+
return ((c = ut(e, t, s, r, a)) == null ? void 0 : c.conflict) ?? null;
|
|
259
338
|
}
|
|
260
|
-
function
|
|
261
|
-
var
|
|
262
|
-
return ((
|
|
339
|
+
function oo(e, t, s, r, a) {
|
|
340
|
+
var c;
|
|
341
|
+
return ((c = ut(e, t, s, r, a)) == null ? void 0 : c.refusal) ?? null;
|
|
263
342
|
}
|
|
264
|
-
function
|
|
343
|
+
function io(e, t, s) {
|
|
265
344
|
return e.map((r) => {
|
|
266
|
-
const
|
|
267
|
-
return { ...r, source:
|
|
345
|
+
const a = r.source === t ? s : r.source, c = r.target === t ? s : r.target;
|
|
346
|
+
return { ...r, source: a, target: c, id: at(a, c, oe(r)) };
|
|
268
347
|
});
|
|
269
348
|
}
|
|
270
|
-
function
|
|
271
|
-
const
|
|
272
|
-
for (const
|
|
273
|
-
const r = Math.max(
|
|
349
|
+
function ro(e, t) {
|
|
350
|
+
const s = { success: 0, error: 0 };
|
|
351
|
+
for (const a of t) a.source === e && s[oe(a)]++;
|
|
352
|
+
const r = Math.max(s.success, s.error);
|
|
274
353
|
return { enabled: r >= 2, count: r };
|
|
275
354
|
}
|
|
276
|
-
function
|
|
277
|
-
const { fanOut:
|
|
278
|
-
return
|
|
355
|
+
function ao(e, t) {
|
|
356
|
+
const { fanOut: s, ...r } = e;
|
|
357
|
+
return t === "parallel" ? { ...r, fanOut: "parallel" } : r;
|
|
279
358
|
}
|
|
280
|
-
function
|
|
281
|
-
return `Runs these ${e}
|
|
359
|
+
function co(e, t) {
|
|
360
|
+
return `Runs these ${e} nodes in ${t === "parallel" ? "parallel" : "sequence"}`;
|
|
282
361
|
}
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
return e ? ((o = e.steps[n]) == null ? void 0 : o.status) ?? "pending" : "no-run";
|
|
362
|
+
function Cn(e, t) {
|
|
363
|
+
var s;
|
|
364
|
+
return (s = e.nodes ?? e.steps) == null ? void 0 : s[t];
|
|
287
365
|
}
|
|
288
|
-
const
|
|
366
|
+
const lo = /* @__PURE__ */ new Set(["succeeded", "failed", "canceled"]);
|
|
367
|
+
function uo(e, t) {
|
|
368
|
+
var s;
|
|
369
|
+
return e ? ((s = Cn(e, t)) == null ? void 0 : s.status) ?? "pending" : "no-run";
|
|
370
|
+
}
|
|
371
|
+
const en = {
|
|
289
372
|
borderColor: "var(--w6w-border)",
|
|
290
373
|
borderStyle: "solid",
|
|
291
374
|
borderWidth: 1,
|
|
292
375
|
opacity: 1
|
|
293
376
|
};
|
|
294
|
-
function
|
|
295
|
-
const
|
|
377
|
+
function Sn(e, t) {
|
|
378
|
+
const s = t !== void 0 && lo.has(t);
|
|
296
379
|
switch (e) {
|
|
297
380
|
case "no-run":
|
|
298
|
-
return
|
|
381
|
+
return en;
|
|
299
382
|
case "pending":
|
|
300
|
-
return
|
|
383
|
+
return s ? { borderColor: "var(--w6w-muted)", borderStyle: "dashed", borderWidth: 1, opacity: 0.5 } : { borderColor: "var(--w6w-border)", borderStyle: "dashed", borderWidth: 1, opacity: 1 };
|
|
301
384
|
case "running":
|
|
302
385
|
return { borderColor: "var(--w6w-accent)", borderStyle: "solid", borderWidth: 2, opacity: 1 };
|
|
303
386
|
case "succeeded":
|
|
@@ -317,622 +400,854 @@ function Gt(e, n) {
|
|
|
317
400
|
opacity: 0.7
|
|
318
401
|
};
|
|
319
402
|
default:
|
|
320
|
-
return
|
|
403
|
+
return en;
|
|
321
404
|
}
|
|
322
405
|
}
|
|
323
|
-
function
|
|
406
|
+
function po(e, t, s) {
|
|
324
407
|
if (!e) return;
|
|
325
|
-
const r = e
|
|
408
|
+
const r = Cn(e, t);
|
|
326
409
|
if (!r) return;
|
|
327
|
-
const
|
|
328
|
-
if (r.status === "succeeded") return
|
|
329
|
-
if (r.status === "failed") return
|
|
410
|
+
const a = s ?? "success";
|
|
411
|
+
if (r.status === "succeeded") return a === "success" ? "taken" : "skipped";
|
|
412
|
+
if (r.status === "failed") return a === "error" ? "taken" : "skipped";
|
|
330
413
|
if (r.status === "skipped") return "skipped";
|
|
331
414
|
}
|
|
332
|
-
function
|
|
333
|
-
|
|
334
|
-
|
|
415
|
+
function fo(e, t) {
|
|
416
|
+
return e.map((s) => {
|
|
417
|
+
const r = t == null ? void 0 : t[s.id], a = s.data.stepProblem;
|
|
418
|
+
if (r === void 0) {
|
|
419
|
+
if (a === void 0 && !("stepProblem" in s.data)) return s;
|
|
420
|
+
const { stepProblem: c, ...u } = s.data;
|
|
421
|
+
return { ...s, data: u };
|
|
422
|
+
}
|
|
423
|
+
return a && a.code === r.code && a.connection === r.connection ? s : { ...s, data: { ...s.data, stepProblem: { ...r } } };
|
|
424
|
+
});
|
|
425
|
+
}
|
|
426
|
+
function st(e) {
|
|
427
|
+
return `Connection ${e.connection} no longer exists — open the step and choose another on the Setup tab`;
|
|
428
|
+
}
|
|
429
|
+
function tn(e, t) {
|
|
430
|
+
return (t == null ? void 0 : t.code) === "unknown_connection" && e.uses.connection === t.connection;
|
|
431
|
+
}
|
|
432
|
+
function ho(e, t, s) {
|
|
433
|
+
if (!e) return "No connection";
|
|
434
|
+
if (s) return "Couldn't load connections";
|
|
435
|
+
if (t === null) return e;
|
|
436
|
+
const r = t.find((a) => a.id === e);
|
|
437
|
+
return r ? r.displayName ?? e : "Missing connection — choose another";
|
|
438
|
+
}
|
|
439
|
+
function wo(e, t) {
|
|
440
|
+
const [s, r] = S({}), a = Ce(/* @__PURE__ */ new Set()), c = JSON.stringify(
|
|
441
|
+
[...new Set(t.map((u) => u.data.step.uses.app))].filter((u) => u && !Je(u)).sort()
|
|
335
442
|
);
|
|
336
|
-
return
|
|
337
|
-
const u = JSON.parse(
|
|
338
|
-
(
|
|
443
|
+
return z(() => {
|
|
444
|
+
const u = JSON.parse(c).filter(
|
|
445
|
+
(b) => !a.current.has(b)
|
|
339
446
|
);
|
|
340
447
|
if (u.length !== 0) {
|
|
341
|
-
for (const
|
|
448
|
+
for (const b of u) a.current.add(b);
|
|
342
449
|
Promise.all(
|
|
343
|
-
u.map(async (
|
|
450
|
+
u.map(async (b) => {
|
|
344
451
|
try {
|
|
345
|
-
return [
|
|
452
|
+
return [b, await e.getAppActions(b)];
|
|
346
453
|
} catch {
|
|
347
|
-
return
|
|
454
|
+
return a.current.delete(b), null;
|
|
348
455
|
}
|
|
349
456
|
})
|
|
350
|
-
).then((
|
|
351
|
-
const
|
|
352
|
-
|
|
457
|
+
).then((b) => {
|
|
458
|
+
const N = b.filter((C) => C !== null);
|
|
459
|
+
N.length !== 0 && r((C) => ({ ...C, ...Object.fromEntries(N) }));
|
|
353
460
|
});
|
|
354
461
|
}
|
|
355
|
-
}, [e,
|
|
462
|
+
}, [e, c]), s;
|
|
356
463
|
}
|
|
357
|
-
function
|
|
358
|
-
return (
|
|
359
|
-
var r,
|
|
360
|
-
return (
|
|
464
|
+
function mo(e) {
|
|
465
|
+
return (t, s) => {
|
|
466
|
+
var r, a;
|
|
467
|
+
return (a = (r = e[t]) == null ? void 0 : r.find((c) => c.key === s)) == null ? void 0 : a.ports;
|
|
361
468
|
};
|
|
362
469
|
}
|
|
363
|
-
const
|
|
364
|
-
function
|
|
365
|
-
const
|
|
366
|
-
return [
|
|
470
|
+
const go = "Which outcome of the source node this edge carries. An error edge is drawn by dragging from the node's error exit port; use this control to re-lane an edge already drawn. An error edge overrides the node’s “On error” policy.";
|
|
471
|
+
function nn(e, t, s, r) {
|
|
472
|
+
const a = e.find((c) => c.id === t);
|
|
473
|
+
return [s, r, a == null ? void 0 : a.source, a == null ? void 0 : a.target];
|
|
367
474
|
}
|
|
368
|
-
const
|
|
369
|
-
function
|
|
475
|
+
const pt = Ye(void 0), ft = Ye(/* @__PURE__ */ new Map());
|
|
476
|
+
function sn(e) {
|
|
370
477
|
return `Can’t draw that edge: this node allows at most ${e} outgoing edge${e === 1 ? "" : "s"} per lane.`;
|
|
371
478
|
}
|
|
372
|
-
const
|
|
373
|
-
function
|
|
374
|
-
return /* @__PURE__ */
|
|
479
|
+
const ht = Ye(/* @__PURE__ */ new Map()), wt = Ye(null);
|
|
480
|
+
function Lo(e) {
|
|
481
|
+
return /* @__PURE__ */ o(Wn, { children: /* @__PURE__ */ o(bo, { ...e }) });
|
|
482
|
+
}
|
|
483
|
+
function on(e, t) {
|
|
484
|
+
let s = t.length + 1;
|
|
485
|
+
for (; t.includes(`${e}-${s}`); ) s++;
|
|
486
|
+
return `${e}-${s}`;
|
|
375
487
|
}
|
|
376
|
-
function
|
|
488
|
+
function ot(e) {
|
|
489
|
+
var t, s;
|
|
490
|
+
return {
|
|
491
|
+
x: e.position.x,
|
|
492
|
+
y: e.position.y,
|
|
493
|
+
w: ((t = e.measured) == null ? void 0 : t.width) ?? e.width ?? 200,
|
|
494
|
+
h: ((s = e.measured) == null ? void 0 : s.height) ?? e.height ?? 64
|
|
495
|
+
};
|
|
496
|
+
}
|
|
497
|
+
function bo({
|
|
377
498
|
value: e,
|
|
378
|
-
onChange:
|
|
379
|
-
readOnly:
|
|
499
|
+
onChange: t,
|
|
500
|
+
readOnly: s,
|
|
380
501
|
height: r = 480,
|
|
381
|
-
apps:
|
|
382
|
-
exprOptions:
|
|
502
|
+
apps: a,
|
|
503
|
+
exprOptions: c,
|
|
383
504
|
project: u,
|
|
384
|
-
runState:
|
|
505
|
+
runState: b,
|
|
506
|
+
stepProblems: N,
|
|
385
507
|
onTestRun: C,
|
|
386
|
-
fitViewKey:
|
|
508
|
+
fitViewKey: h
|
|
387
509
|
}) {
|
|
388
|
-
var
|
|
389
|
-
const
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
(
|
|
393
|
-
const
|
|
394
|
-
return i.data.stepStatus ===
|
|
510
|
+
var Dt, Lt;
|
|
511
|
+
const k = Qe(), l = O(() => new Map((a ?? []).map((n) => [n.id, n])), [a]), [x, D] = S(null), T = O(() => rs(e), [e.id]), _ = O(() => as(e), [e.id]), A = ((Dt = e.settings) == null ? void 0 : Dt.savePosition) !== !1, [w, L, Se] = Bn(T.nodes), le = wo(k, w), B = O(() => mo(le), [le]), [y, V, xe] = Jn(T.edges);
|
|
512
|
+
z(() => {
|
|
513
|
+
L(
|
|
514
|
+
(n) => n.map((i) => {
|
|
515
|
+
const d = uo(b, i.id);
|
|
516
|
+
return i.data.stepStatus === d && i.data.runStatus === (b == null ? void 0 : b.status) ? i : { ...i, data: { ...i.data, stepStatus: d, runStatus: b == null ? void 0 : b.status } };
|
|
395
517
|
})
|
|
396
|
-
),
|
|
397
|
-
(
|
|
398
|
-
const
|
|
399
|
-
return i.className ===
|
|
518
|
+
), V(
|
|
519
|
+
(n) => n.map((i) => {
|
|
520
|
+
const d = oe(i), p = po(b, i.source, d), f = ct(d, p);
|
|
521
|
+
return i.className === f.className && i.label === f.label ? i : { ...i, className: f.className, label: f.label };
|
|
400
522
|
})
|
|
401
523
|
);
|
|
402
|
-
}, [
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
524
|
+
}, [b, L, V]), z(() => {
|
|
525
|
+
L((n) => fo(n, N));
|
|
526
|
+
}, [N, L]);
|
|
527
|
+
const [K, $] = S(null), ee = O(() => e.canvas ?? {}, [e.id]), [P, te] = S(ee), [ie, ke] = S(!1), [q, de] = S(null), [re, ae] = S(null), [W, me] = S(null), [Ee, Pe] = S(!1), [H, ue] = S(null), [Re, X] = S("props"), [Le, G] = S(null), Me = Ce(!1), ge = Ce(null), [j, ne] = S(null), { screenToFlowPosition: pe, fitView: be } = zn(), ze = cs();
|
|
528
|
+
z(() => {
|
|
529
|
+
L(T.nodes), V(T.edges), $(null), ue(null), te(ee);
|
|
530
|
+
}, [T, ee, L, V]);
|
|
531
|
+
const Fe = F(
|
|
532
|
+
(n, i) => {
|
|
533
|
+
var f, v;
|
|
534
|
+
const { canvas: d, ...p } = n;
|
|
535
|
+
return !((f = i.notes) != null && f.length) && !((v = i.sections) != null && v.length) ? p : { ...p, canvas: Os(i, e.canvas, A) };
|
|
536
|
+
},
|
|
537
|
+
[e.canvas, A]
|
|
538
|
+
), M = F(
|
|
539
|
+
(n, i, d) => {
|
|
540
|
+
t(Fe($t(e, n, i), d ?? P));
|
|
410
541
|
},
|
|
411
|
-
[e,
|
|
412
|
-
),
|
|
413
|
-
(
|
|
414
|
-
[
|
|
415
|
-
),
|
|
416
|
-
(
|
|
417
|
-
if (
|
|
418
|
-
const i =
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
We(
|
|
424
|
-
|
|
542
|
+
[e, t, P, Fe]
|
|
543
|
+
), He = F(
|
|
544
|
+
(n) => Nn(n.source, n.target, w, y, B),
|
|
545
|
+
[w, y, B]
|
|
546
|
+
), je = F(
|
|
547
|
+
(n) => {
|
|
548
|
+
if (s) return;
|
|
549
|
+
const i = Ge(
|
|
550
|
+
n.source,
|
|
551
|
+
n.target,
|
|
552
|
+
w,
|
|
553
|
+
y,
|
|
554
|
+
We(n.sourceHandle),
|
|
555
|
+
B
|
|
425
556
|
);
|
|
426
557
|
if (!i) {
|
|
427
|
-
const
|
|
428
|
-
|
|
429
|
-
|
|
558
|
+
const d = We(n.sourceHandle), p = to(
|
|
559
|
+
n.source,
|
|
560
|
+
n.target,
|
|
561
|
+
w,
|
|
562
|
+
y,
|
|
430
563
|
d,
|
|
431
|
-
|
|
432
|
-
p,
|
|
433
|
-
W
|
|
564
|
+
B
|
|
434
565
|
);
|
|
435
|
-
if (
|
|
436
|
-
const
|
|
437
|
-
|
|
566
|
+
if (p) {
|
|
567
|
+
const v = y.find((E) => E.source === n.source && oe(E) === d);
|
|
568
|
+
v && (V(y.map((E) => ({ ...E, selected: E.id === v.id }))), me(v.id), ce({ edgeId: v.id, message: sn(p.cap) }));
|
|
438
569
|
return;
|
|
439
570
|
}
|
|
440
|
-
const
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
We(
|
|
571
|
+
const f = eo(
|
|
572
|
+
n.source,
|
|
573
|
+
n.target,
|
|
574
|
+
w,
|
|
575
|
+
y,
|
|
576
|
+
We(n.sourceHandle)
|
|
446
577
|
);
|
|
447
|
-
if (!
|
|
448
|
-
|
|
449
|
-
edgeId:
|
|
450
|
-
message:
|
|
578
|
+
if (!f) return;
|
|
579
|
+
V(y.map((v) => ({ ...v, selected: v.id === f }))), me(f), ce({
|
|
580
|
+
edgeId: f,
|
|
581
|
+
message: _t(
|
|
451
582
|
"Can’t draw that edge",
|
|
452
|
-
|
|
453
|
-
|
|
583
|
+
f,
|
|
584
|
+
nn(y, f, n.source, n.target)
|
|
454
585
|
)
|
|
455
586
|
});
|
|
456
587
|
return;
|
|
457
588
|
}
|
|
458
|
-
|
|
589
|
+
ce(null), V(i), M(w, i);
|
|
459
590
|
},
|
|
460
|
-
[
|
|
461
|
-
),
|
|
462
|
-
(
|
|
463
|
-
var
|
|
464
|
-
if (
|
|
465
|
-
const
|
|
466
|
-
if (!
|
|
467
|
-
const
|
|
468
|
-
if (
|
|
469
|
-
const Z =
|
|
470
|
-
if ((
|
|
591
|
+
[y, w, V, M, s, B]
|
|
592
|
+
), J = F(
|
|
593
|
+
(n, i) => {
|
|
594
|
+
var R, I, Q;
|
|
595
|
+
if (s || i.isValid) return;
|
|
596
|
+
const d = i.fromNode;
|
|
597
|
+
if (!d) return;
|
|
598
|
+
const p = ((R = i.fromHandle) == null ? void 0 : R.type) === "target" ? "target" : "source", f = (I = w.find((Z) => Z.id === d.id)) == null ? void 0 : I.data.step;
|
|
599
|
+
if (f) {
|
|
600
|
+
const Z = we(f, B);
|
|
601
|
+
if ((p === "source" ? Z.out : Z.in) < 1) return;
|
|
471
602
|
}
|
|
472
|
-
const
|
|
473
|
-
|
|
474
|
-
nodeId:
|
|
475
|
-
handleType:
|
|
476
|
-
position:
|
|
603
|
+
const v = "changedTouches" in n ? n.changedTouches[0] : n, E = pe({ x: v.clientX, y: v.clientY });
|
|
604
|
+
ne({
|
|
605
|
+
nodeId: d.id,
|
|
606
|
+
handleType: p,
|
|
607
|
+
position: E,
|
|
477
608
|
lane: We((Q = i.fromHandle) == null ? void 0 : Q.id)
|
|
478
|
-
}),
|
|
609
|
+
}), Pe(!0);
|
|
479
610
|
},
|
|
480
|
-
[
|
|
481
|
-
),
|
|
482
|
-
(
|
|
483
|
-
|
|
611
|
+
[s, pe, w, B]
|
|
612
|
+
), Ve = F(
|
|
613
|
+
(n, i, d) => {
|
|
614
|
+
if (s) return;
|
|
615
|
+
const p = w.find((I) => I.id === n);
|
|
616
|
+
if (!p) return;
|
|
617
|
+
const f = ot(p), v = We(d), E = 120, R = i === "target" ? { x: f.x - f.w - E, y: f.y } : v === "error" ? { x: f.x, y: f.y + f.h + E } : { x: f.x + f.w + E, y: f.y };
|
|
618
|
+
ne({ nodeId: n, handleType: i, position: R, lane: v }), Pe(!0);
|
|
484
619
|
},
|
|
485
|
-
[
|
|
486
|
-
),
|
|
487
|
-
(
|
|
488
|
-
|
|
489
|
-
const i = d.filter((m) => m.id !== s), p = b.filter((m) => m.source !== s && m.target !== s);
|
|
490
|
-
I(i), A(p), K === s && G(null), O === s && se(null), D(i, p);
|
|
620
|
+
[s, w]
|
|
621
|
+
), $e = F(
|
|
622
|
+
(n) => {
|
|
623
|
+
s || G(n);
|
|
491
624
|
},
|
|
492
|
-
[
|
|
493
|
-
),
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
}, [
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
625
|
+
[s]
|
|
626
|
+
), Oe = F(
|
|
627
|
+
(n) => {
|
|
628
|
+
if (s) return;
|
|
629
|
+
const i = w.filter((f) => f.id !== n), d = y.filter((f) => f.source !== n && f.target !== n), p = Xt(P, n);
|
|
630
|
+
L(i), V(d), te(p), K === n && $(null), H === n && ue(null), M(i, d, p);
|
|
631
|
+
},
|
|
632
|
+
[w, y, P, L, V, M, s, K, H]
|
|
633
|
+
), g = F(() => {
|
|
634
|
+
if (s) return;
|
|
635
|
+
const n = ls(w, y);
|
|
636
|
+
L(n), Me.current = !0, M(n, y);
|
|
637
|
+
}, [w, y, L, M, s]), Y = F(() => {
|
|
638
|
+
s || g();
|
|
639
|
+
}, [s, g]);
|
|
640
|
+
z(() => {
|
|
641
|
+
Me.current && (Me.current = !1, be({ duration: 300 }));
|
|
642
|
+
}, [w, be]);
|
|
643
|
+
const se = Ce(h);
|
|
644
|
+
z(() => {
|
|
645
|
+
Object.is(se.current, h) || (se.current = h, be({ duration: 300 }));
|
|
646
|
+
}, [h, be]);
|
|
647
|
+
const [fe, ce] = S(null), Ue = O(
|
|
648
|
+
() => y.find((n) => n.id === W) ?? null,
|
|
649
|
+
[y, W]
|
|
650
|
+
), Pn = F(
|
|
651
|
+
(n) => {
|
|
652
|
+
if (s || !W) return;
|
|
653
|
+
const i = y.find((E) => E.id === W);
|
|
654
|
+
if (!i || oe(i) === n) return;
|
|
655
|
+
const d = so(y, W, n, w), p = oo(y, W, n, w, B), f = d || p ? null : no(y, W, n, w, B);
|
|
656
|
+
if (!f) {
|
|
657
|
+
if (p) {
|
|
658
|
+
ce({ edgeId: W, message: sn(p.cap) });
|
|
519
659
|
return;
|
|
520
660
|
}
|
|
521
|
-
|
|
522
|
-
edgeId:
|
|
523
|
-
message:
|
|
661
|
+
ce({
|
|
662
|
+
edgeId: W,
|
|
663
|
+
message: d ? _t(
|
|
524
664
|
"Can’t switch this edge",
|
|
525
|
-
|
|
526
|
-
|
|
665
|
+
d,
|
|
666
|
+
nn(y, d, i.source, i.target)
|
|
527
667
|
) : "This edge can’t be switched right now."
|
|
528
668
|
});
|
|
529
669
|
return;
|
|
530
670
|
}
|
|
531
|
-
|
|
532
|
-
const
|
|
533
|
-
(
|
|
671
|
+
ce(null), V(f);
|
|
672
|
+
const v = f.find(
|
|
673
|
+
(E) => E.source === i.source && E.target === i.target && oe(E) === n
|
|
534
674
|
);
|
|
535
|
-
|
|
675
|
+
me((v == null ? void 0 : v.id) ?? null), M(w, f);
|
|
536
676
|
},
|
|
537
|
-
[
|
|
538
|
-
),
|
|
539
|
-
(
|
|
540
|
-
if (
|
|
541
|
-
const i =
|
|
542
|
-
i.length !==
|
|
677
|
+
[y, w, V, M, s, W, B]
|
|
678
|
+
), Rn = F(
|
|
679
|
+
(n) => {
|
|
680
|
+
if (s) return;
|
|
681
|
+
const i = y.filter((d) => d.id !== n);
|
|
682
|
+
i.length !== y.length && (V(i), W === n && me(null), M(w, i));
|
|
543
683
|
},
|
|
544
|
-
[
|
|
545
|
-
),
|
|
546
|
-
(
|
|
547
|
-
if (
|
|
548
|
-
const i =
|
|
684
|
+
[w, y, V, M, s, W]
|
|
685
|
+
), gt = F(
|
|
686
|
+
(n) => {
|
|
687
|
+
if (s) return;
|
|
688
|
+
const i = w.find((E) => E.id === n);
|
|
549
689
|
if (!i) return;
|
|
550
|
-
const
|
|
551
|
-
|
|
690
|
+
const d = Wt(
|
|
691
|
+
w.map((E) => E.id),
|
|
552
692
|
`${i.data.step.id}_copy`
|
|
553
|
-
),
|
|
554
|
-
id:
|
|
693
|
+
), p = { ...structuredClone(i.data.step), id: d }, f = {
|
|
694
|
+
id: d,
|
|
555
695
|
type: i.type,
|
|
556
696
|
position: { x: i.position.x + 40, y: i.position.y + 60 },
|
|
557
|
-
data: { step:
|
|
558
|
-
},
|
|
559
|
-
|
|
697
|
+
data: { step: p, isInternal: i.data.isInternal }
|
|
698
|
+
}, v = [...w, f];
|
|
699
|
+
L(v), $(d), M(v, y);
|
|
560
700
|
},
|
|
561
|
-
[
|
|
562
|
-
),
|
|
563
|
-
(
|
|
564
|
-
if (
|
|
565
|
-
const i =
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
),
|
|
569
|
-
id:
|
|
570
|
-
uses:
|
|
571
|
-
...
|
|
572
|
-
},
|
|
573
|
-
id:
|
|
701
|
+
[w, y, L, M, s]
|
|
702
|
+
), Tn = F(
|
|
703
|
+
(n) => {
|
|
704
|
+
if (s) return;
|
|
705
|
+
const i = Je(n.uses.app), d = Wt(
|
|
706
|
+
w.map((R) => R.id),
|
|
707
|
+
ds(dn(n.uses.app, n.uses.action))
|
|
708
|
+
), p = {
|
|
709
|
+
id: d,
|
|
710
|
+
uses: n.uses,
|
|
711
|
+
...n.with && Object.keys(n.with).length > 0 ? { with: n.with } : {}
|
|
712
|
+
}, f = {
|
|
713
|
+
id: d,
|
|
574
714
|
type: i ? "control" : "step",
|
|
575
715
|
// Drop point when spawned from a dragged connection; else a light cascade.
|
|
576
|
-
position: (
|
|
577
|
-
data: { step:
|
|
578
|
-
},
|
|
579
|
-
let
|
|
580
|
-
if (
|
|
581
|
-
const [
|
|
582
|
-
|
|
716
|
+
position: (j == null ? void 0 : j.position) ?? { x: 80, y: 80 + w.length * 24 },
|
|
717
|
+
data: { step: p, isInternal: i }
|
|
718
|
+
}, v = [...w, f];
|
|
719
|
+
let E = y;
|
|
720
|
+
if (j) {
|
|
721
|
+
const [R, I] = j.handleType === "target" ? [d, j.nodeId] : [j.nodeId, d];
|
|
722
|
+
E = Ge(R, I, v, y, j.lane, B) ?? y;
|
|
583
723
|
} else {
|
|
584
|
-
const
|
|
585
|
-
if (
|
|
586
|
-
if (!
|
|
587
|
-
const
|
|
588
|
-
|
|
724
|
+
const R = w.find((I) => Ie(I.data.step.uses.app));
|
|
725
|
+
if (Ie(n.uses.app)) {
|
|
726
|
+
if (!R) {
|
|
727
|
+
const I = us(w, y);
|
|
728
|
+
I && (E = Ge(d, I.id, v, y, "success", B) ?? y);
|
|
589
729
|
}
|
|
590
730
|
} else {
|
|
591
|
-
const Q = (
|
|
592
|
-
Q && (
|
|
731
|
+
const Q = (R && !y.some((Z) => Z.source === R.id) ? R : void 0) ?? ps(w, y);
|
|
732
|
+
Q && (E = Ge(Q.id, d, v, y, "success", B) ?? y);
|
|
593
733
|
}
|
|
594
734
|
}
|
|
595
|
-
return
|
|
735
|
+
return L(v), E !== y && V(E), $(d), M(v, E), d;
|
|
596
736
|
},
|
|
597
|
-
[
|
|
598
|
-
),
|
|
599
|
-
(
|
|
600
|
-
const
|
|
601
|
-
if (
|
|
602
|
-
const
|
|
603
|
-
(
|
|
604
|
-
...
|
|
737
|
+
[w, y, L, V, M, s, j, B]
|
|
738
|
+
), bt = F(
|
|
739
|
+
(n, i) => {
|
|
740
|
+
const d = i.id !== n;
|
|
741
|
+
if (d && w.some((f) => f.id === i.id)) return;
|
|
742
|
+
const p = w.map(
|
|
743
|
+
(f) => f.id === n ? {
|
|
744
|
+
...f,
|
|
605
745
|
id: i.id,
|
|
606
|
-
data: { step: i, isInternal:
|
|
607
|
-
} :
|
|
746
|
+
data: { step: i, isInternal: Je(i.uses.app) }
|
|
747
|
+
} : f
|
|
608
748
|
);
|
|
609
|
-
if (
|
|
610
|
-
const v =
|
|
611
|
-
|
|
749
|
+
if (d) {
|
|
750
|
+
const f = io(y, n, i.id), v = zs(P, n, i.id);
|
|
751
|
+
L(p), V(f), te(v), K === n && $(i.id), H === n && ue(i.id), M(p, f, v);
|
|
612
752
|
return;
|
|
613
753
|
}
|
|
614
|
-
|
|
754
|
+
L(p), M(p, y);
|
|
755
|
+
},
|
|
756
|
+
[w, y, P, L, V, K, H, M]
|
|
757
|
+
), ye = F(
|
|
758
|
+
(n) => {
|
|
759
|
+
s || (te(n), M(w, y, n));
|
|
760
|
+
},
|
|
761
|
+
[s, w, y, M]
|
|
762
|
+
), An = F(() => {
|
|
763
|
+
var f;
|
|
764
|
+
if (s) return;
|
|
765
|
+
const n = (f = ge.current) == null ? void 0 : f.getBoundingClientRect(), i = n ? pe({ x: n.left + n.width / 2, y: n.top + n.height / 2 }) : { x: 0, y: 0 }, d = P.notes ?? [], p = {
|
|
766
|
+
id: on(
|
|
767
|
+
"note",
|
|
768
|
+
d.map((v) => v.id)
|
|
769
|
+
),
|
|
770
|
+
color: "#facc15",
|
|
771
|
+
position: { x: Math.round(i.x - 100), y: Math.round(i.y - 60) },
|
|
772
|
+
size: { width: 200, height: 120 },
|
|
773
|
+
content: ""
|
|
774
|
+
};
|
|
775
|
+
ye(Yt({ ...P, notes: [...d, p] }));
|
|
776
|
+
}, [s, P, pe, ye]), In = F(
|
|
777
|
+
(n, i) => {
|
|
778
|
+
if (s) return;
|
|
779
|
+
const d = i ? Math.min(n.x, i.x) : n.x, p = i ? Math.min(n.y, i.y) : n.y, f = i ? Math.abs(i.x - n.x) : 360, v = i ? Math.abs(i.y - n.y) : 240, E = w.filter((_e) => {
|
|
780
|
+
const Ke = ot(_e), Mt = Ke.x + Ke.w / 2, Ft = Ke.y + Ke.h / 2;
|
|
781
|
+
return Mt >= d && Mt <= d + f && Ft >= p && Ft <= p + v;
|
|
782
|
+
}).map((_e) => _e.id), R = P.sections ?? [], I = on(
|
|
783
|
+
"section",
|
|
784
|
+
R.map((_e) => _e.id)
|
|
785
|
+
), Q = {
|
|
786
|
+
id: I,
|
|
787
|
+
title: "Section",
|
|
788
|
+
color: "#6366f1",
|
|
789
|
+
position: { x: Math.round(d), y: Math.round(p) },
|
|
790
|
+
size: { width: Math.round(f), height: Math.round(v) },
|
|
791
|
+
nodes: []
|
|
792
|
+
}, Z = { ...P, sections: [...R, Q] };
|
|
793
|
+
ye(Yt(Gt(Z, I, E)));
|
|
794
|
+
},
|
|
795
|
+
[s, w, P, ye]
|
|
796
|
+
);
|
|
797
|
+
z(() => {
|
|
798
|
+
if (!ie) return;
|
|
799
|
+
const n = (i) => {
|
|
800
|
+
i.key === "Escape" && (ke(!1), de(null));
|
|
801
|
+
};
|
|
802
|
+
return window.addEventListener("keydown", n), () => window.removeEventListener("keydown", n);
|
|
803
|
+
}, [ie]);
|
|
804
|
+
const Dn = F(
|
|
805
|
+
(n, i) => {
|
|
806
|
+
var E;
|
|
807
|
+
if (s) return;
|
|
808
|
+
const d = (E = P.sections) == null ? void 0 : E.find((R) => R.id === n);
|
|
809
|
+
if (!d) return;
|
|
810
|
+
const p = new Set(d.nodes), f = w.map(
|
|
811
|
+
(R) => p.has(R.id) ? { ...R, position: { x: R.position.x + i.dx, y: R.position.y + i.dy } } : R
|
|
812
|
+
), v = {
|
|
813
|
+
...P,
|
|
814
|
+
sections: (P.sections ?? []).map(
|
|
815
|
+
(R) => R.id === n ? { ...R, position: { x: R.position.x + i.dx, y: R.position.y + i.dy } } : R
|
|
816
|
+
)
|
|
817
|
+
};
|
|
818
|
+
L(f), te(v), M(f, y, v);
|
|
615
819
|
},
|
|
616
|
-
[
|
|
617
|
-
),
|
|
618
|
-
(
|
|
820
|
+
[s, P, w, y, L, M]
|
|
821
|
+
), Ln = F(
|
|
822
|
+
(n, i) => {
|
|
823
|
+
if (s) return;
|
|
824
|
+
const d = n === "note" ? { ...P, notes: (P.notes ?? []).filter((p) => p.id !== i) } : { ...P, sections: (P.sections ?? []).filter((p) => p.id !== i) };
|
|
825
|
+
ye(d);
|
|
826
|
+
},
|
|
827
|
+
[s, P, ye]
|
|
828
|
+
), Mn = (n) => {
|
|
829
|
+
let i = P;
|
|
830
|
+
for (const d of n) {
|
|
831
|
+
const p = ot(d), f = p.x + p.w / 2, v = p.y + p.h / 2, E = (i.sections ?? []).find(
|
|
832
|
+
(I) => f >= I.position.x && f <= I.position.x + I.size.width && v >= I.position.y && v <= I.position.y + I.size.height
|
|
833
|
+
), R = Hs(i, d.id);
|
|
834
|
+
E ? (R.length !== 1 || R[0] !== E.id) && (i = Gt(i, E.id, [d.id])) : R.length > 0 && (i = Xt(i, d.id));
|
|
835
|
+
}
|
|
836
|
+
return i;
|
|
837
|
+
}, Ze = F(
|
|
838
|
+
(n, i, d) => {
|
|
619
839
|
(async () => {
|
|
620
|
-
const
|
|
621
|
-
await
|
|
622
|
-
stepTestId: (
|
|
623
|
-
status:
|
|
840
|
+
const p = await k.saveStepTest(e.id, n, i).catch((f) => (console.error("step run fixture save failed", f), null));
|
|
841
|
+
await k.recordStepTestRun(e.id, n, {
|
|
842
|
+
stepTestId: (p == null ? void 0 : p.id) ?? null,
|
|
843
|
+
status: d.status,
|
|
624
844
|
input: i.input,
|
|
625
|
-
output:
|
|
626
|
-
error:
|
|
627
|
-
...
|
|
845
|
+
output: d.output,
|
|
846
|
+
error: d.error,
|
|
847
|
+
...d.meta ? { meta: d.meta } : {}
|
|
628
848
|
});
|
|
629
|
-
})().catch((
|
|
630
|
-
console.error("step run persist failed",
|
|
849
|
+
})().catch((p) => {
|
|
850
|
+
console.error("step run persist failed", p);
|
|
631
851
|
});
|
|
632
852
|
},
|
|
633
|
-
[
|
|
634
|
-
),
|
|
635
|
-
(
|
|
636
|
-
const i =
|
|
637
|
-
!i ||
|
|
853
|
+
[k, e.id]
|
|
854
|
+
), yt = F(
|
|
855
|
+
(n) => {
|
|
856
|
+
const i = w.find((d) => d.id === n);
|
|
857
|
+
!i || Be(i.data.step.uses.app) || D({ stepId: n, status: "collect" });
|
|
638
858
|
},
|
|
639
|
-
[
|
|
640
|
-
),
|
|
641
|
-
async (
|
|
859
|
+
[w]
|
|
860
|
+
), Fn = F(
|
|
861
|
+
async (n, i, d) => {
|
|
642
862
|
C == null || C();
|
|
643
|
-
const
|
|
644
|
-
if (!
|
|
645
|
-
const
|
|
646
|
-
|
|
863
|
+
const p = w.find((I) => I.id === n);
|
|
864
|
+
if (!p) return;
|
|
865
|
+
const f = p.data.step, v = Ie(f.uses.app), E = v ? { input: i } : { ...f.with ?? {}, ...i }, R = v ? { input: i, with: i } : { input: i, with: E };
|
|
866
|
+
D({ stepId: n, status: "running" });
|
|
647
867
|
try {
|
|
648
|
-
const
|
|
649
|
-
...
|
|
868
|
+
const I = await k.invokeAction(f.uses.app, f.uses.action, E, {
|
|
869
|
+
...f.uses.connection ? { connectionId: f.uses.connection } : {},
|
|
650
870
|
// Scope document expressions to the workflow's selected project (T2.1.2).
|
|
651
871
|
project: u,
|
|
652
872
|
// Omitted when nothing upstream has a saved output, so a run with no
|
|
653
873
|
// seed sends exactly the request it sent before.
|
|
654
|
-
...
|
|
655
|
-
}), Q =
|
|
656
|
-
|
|
657
|
-
stepId:
|
|
874
|
+
...d ? { state: d } : {}
|
|
875
|
+
}), Q = I.logs, Z = I.meta;
|
|
876
|
+
D({
|
|
877
|
+
stepId: n,
|
|
658
878
|
status: "done",
|
|
659
|
-
value:
|
|
879
|
+
value: I.value,
|
|
660
880
|
logs: Q,
|
|
661
881
|
...Z ? { meta: Z } : {}
|
|
662
|
-
}),
|
|
882
|
+
}), Ze(n, R, {
|
|
663
883
|
status: "succeeded",
|
|
664
|
-
output:
|
|
884
|
+
output: I.value,
|
|
665
885
|
...Z ? { meta: Z } : {}
|
|
666
886
|
});
|
|
667
|
-
} catch (
|
|
668
|
-
const Q =
|
|
669
|
-
|
|
670
|
-
stepId:
|
|
887
|
+
} catch (I) {
|
|
888
|
+
const Q = I;
|
|
889
|
+
D({
|
|
890
|
+
stepId: n,
|
|
671
891
|
status: "error",
|
|
672
|
-
error: Q.message ?? String(
|
|
892
|
+
error: Q.message ?? String(I),
|
|
673
893
|
errorCode: Q.code
|
|
674
|
-
}),
|
|
894
|
+
}), Ze(n, R, { status: "failed", error: Q.message ?? String(I) });
|
|
675
895
|
}
|
|
676
896
|
},
|
|
677
|
-
[
|
|
678
|
-
),
|
|
897
|
+
[w, k, Ze, u, C]
|
|
898
|
+
), et = O(
|
|
679
899
|
() => ({
|
|
680
|
-
onEdit: (
|
|
681
|
-
|
|
900
|
+
onEdit: (n) => {
|
|
901
|
+
X("props"), ue(n);
|
|
682
902
|
},
|
|
683
|
-
onEditJson: (
|
|
684
|
-
|
|
903
|
+
onEditJson: (n) => {
|
|
904
|
+
X("json"), ue(n);
|
|
685
905
|
},
|
|
686
|
-
onRun:
|
|
687
|
-
onDuplicate:
|
|
688
|
-
onDelete:
|
|
689
|
-
|
|
906
|
+
onRun: yt,
|
|
907
|
+
onDuplicate: gt,
|
|
908
|
+
onDelete: $e,
|
|
909
|
+
onAddFromPort: Ve,
|
|
910
|
+
readOnly: s
|
|
690
911
|
}),
|
|
691
|
-
[
|
|
912
|
+
[yt, gt, $e, Ve, s]
|
|
692
913
|
);
|
|
693
|
-
|
|
694
|
-
const
|
|
695
|
-
if (!
|
|
696
|
-
const i = (
|
|
697
|
-
const
|
|
698
|
-
if (!
|
|
699
|
-
const
|
|
700
|
-
|
|
914
|
+
z(() => {
|
|
915
|
+
const n = ge.current;
|
|
916
|
+
if (!n) return;
|
|
917
|
+
const i = (d) => {
|
|
918
|
+
const p = d.target.closest(".react-flow__node");
|
|
919
|
+
if (!p) return;
|
|
920
|
+
const f = p.getAttribute("data-id");
|
|
921
|
+
f && (d.stopPropagation(), et.onEdit(f));
|
|
701
922
|
};
|
|
702
|
-
return
|
|
703
|
-
}, [
|
|
704
|
-
const
|
|
705
|
-
() =>
|
|
706
|
-
[
|
|
707
|
-
),
|
|
708
|
-
const
|
|
709
|
-
for (const i of
|
|
710
|
-
return
|
|
711
|
-
}, [
|
|
923
|
+
return n.addEventListener("dblclick", i, !0), () => n.removeEventListener("dblclick", i, !0);
|
|
924
|
+
}, [et]);
|
|
925
|
+
const Te = w.find((n) => n.id === H), vt = (Te == null ? void 0 : Te.data.step) ?? null, tt = x ? ((Lt = w.find((n) => n.id === x.stepId)) == null ? void 0 : Lt.data.step) ?? null : null, nt = (x == null ? void 0 : x.status) === "collect" && !!tt, Vn = O(
|
|
926
|
+
() => x ? Bt(x.stepId, w, y).steps : [],
|
|
927
|
+
[x, w, y]
|
|
928
|
+
), Nt = O(() => {
|
|
929
|
+
const n = /* @__PURE__ */ new Map();
|
|
930
|
+
for (const i of w) n.set(i.id, ro(i.id, y).count);
|
|
931
|
+
return n;
|
|
932
|
+
}, [w, y]), $n = O(
|
|
712
933
|
() => ({
|
|
713
|
-
step:
|
|
714
|
-
control:
|
|
934
|
+
step: vo,
|
|
935
|
+
control: No
|
|
715
936
|
}),
|
|
716
937
|
[]
|
|
717
|
-
), [
|
|
938
|
+
), [qe, Ct] = S({}), [St, xt] = S({}), kt = O(
|
|
718
939
|
() => ({
|
|
719
|
-
actionDef: (
|
|
720
|
-
var
|
|
721
|
-
return (
|
|
940
|
+
actionDef: (n, i) => {
|
|
941
|
+
var d;
|
|
942
|
+
return (d = le[n]) == null ? void 0 : d.find((p) => p.key === i);
|
|
722
943
|
},
|
|
723
|
-
testOutputs:
|
|
944
|
+
testOutputs: qe
|
|
724
945
|
}),
|
|
725
|
-
[
|
|
726
|
-
), [
|
|
727
|
-
const
|
|
728
|
-
return { ...
|
|
729
|
-
}, [
|
|
730
|
-
|
|
731
|
-
const
|
|
732
|
-
if (!
|
|
733
|
-
|
|
946
|
+
[le, qe]
|
|
947
|
+
), [Et, Pt] = S(null), Ae = O(() => {
|
|
948
|
+
const n = Bt(H, w, y, kt);
|
|
949
|
+
return { ...n, steps: fs(n.steps, H ?? Et) };
|
|
950
|
+
}, [H, Et, w, y, kt]), Rt = JSON.stringify(Ae.steps.map((n) => n.id));
|
|
951
|
+
z(() => {
|
|
952
|
+
const n = JSON.parse(Rt);
|
|
953
|
+
if (!H || n.length === 0) {
|
|
954
|
+
Ct({}), xt({});
|
|
734
955
|
return;
|
|
735
956
|
}
|
|
736
957
|
let i = !1;
|
|
737
958
|
return Promise.all(
|
|
738
|
-
|
|
959
|
+
n.map(async (d) => {
|
|
739
960
|
try {
|
|
740
|
-
const
|
|
741
|
-
return
|
|
961
|
+
const p = await k.listStepTests(e.id, d), f = p.length ? p[p.length - 1] : null;
|
|
962
|
+
return f ? { id: d, output: f.lastRunOutput, meta: f.lastRunMeta } : null;
|
|
742
963
|
} catch {
|
|
743
964
|
return null;
|
|
744
965
|
}
|
|
745
966
|
})
|
|
746
|
-
).then((
|
|
967
|
+
).then((d) => {
|
|
747
968
|
if (i) return;
|
|
748
|
-
const
|
|
749
|
-
for (const
|
|
750
|
-
|
|
751
|
-
|
|
969
|
+
const p = {}, f = {};
|
|
970
|
+
for (const v of d)
|
|
971
|
+
v != null && v.meta && (f[v.id] = v.meta), !(!v || v.output === void 0 || v.output === null) && (p[v.id] = v.output);
|
|
972
|
+
Ct(p), xt(f);
|
|
752
973
|
}), () => {
|
|
753
974
|
i = !0;
|
|
754
975
|
};
|
|
755
|
-
}, [
|
|
756
|
-
const
|
|
757
|
-
const
|
|
758
|
-
for (const i of
|
|
759
|
-
Object.assign(
|
|
760
|
-
const
|
|
761
|
-
if (
|
|
762
|
-
if (
|
|
763
|
-
for (const [
|
|
764
|
-
|
|
765
|
-
for (const
|
|
766
|
-
if (!
|
|
767
|
-
const
|
|
768
|
-
|
|
976
|
+
}, [k, e.id, H, Rt]);
|
|
977
|
+
const Tt = O(() => {
|
|
978
|
+
const n = {};
|
|
979
|
+
for (const i of Ae.steps) {
|
|
980
|
+
Object.assign(n, hs(i.id, St[i.id]));
|
|
981
|
+
const d = qe[i.id];
|
|
982
|
+
if (d !== void 0) {
|
|
983
|
+
if (n[`steps.${i.id}.output`] = d, typeof d == "object" && d !== null && !Array.isArray(d))
|
|
984
|
+
for (const [p, f] of Object.entries(d))
|
|
985
|
+
n[`steps.${i.id}.output.${p}`] = f;
|
|
986
|
+
for (const p of i.outputs ?? []) {
|
|
987
|
+
if (!p.path || !p.key.includes(".")) continue;
|
|
988
|
+
const f = ws(d, p.key);
|
|
989
|
+
f !== void 0 && (n[`steps.${i.id}.output.${p.key}`] = f);
|
|
769
990
|
}
|
|
770
991
|
}
|
|
771
992
|
}
|
|
772
|
-
return
|
|
773
|
-
}, [
|
|
993
|
+
return n;
|
|
994
|
+
}, [Ae.steps, qe, St]), At = an(), It = O(
|
|
774
995
|
() => ({
|
|
775
|
-
...
|
|
776
|
-
steps:
|
|
777
|
-
hasTrigger:
|
|
996
|
+
...c ?? {},
|
|
997
|
+
steps: Ae.steps,
|
|
998
|
+
hasTrigger: Ae.hasTrigger,
|
|
778
999
|
sampleValues: {
|
|
779
|
-
...
|
|
780
|
-
...(
|
|
781
|
-
...
|
|
1000
|
+
...At.sampleValues ?? {},
|
|
1001
|
+
...(c == null ? void 0 : c.sampleValues) ?? {},
|
|
1002
|
+
...Tt
|
|
782
1003
|
}
|
|
783
1004
|
}),
|
|
784
|
-
[
|
|
1005
|
+
[c, At.sampleValues, Ae, Tt]
|
|
785
1006
|
);
|
|
786
|
-
return /* @__PURE__ */
|
|
1007
|
+
return /* @__PURE__ */ o(wt.Provider, { value: et, children: /* @__PURE__ */ o(pt.Provider, { value: B, children: /* @__PURE__ */ o(ft.Provider, { value: Nt, children: /* @__PURE__ */ o(ht.Provider, { value: l, children: /* @__PURE__ */ o(ms, { project: u, children: /* @__PURE__ */ o(gs, { value: It, children: /* @__PURE__ */ m(
|
|
787
1008
|
"div",
|
|
788
1009
|
{
|
|
789
|
-
ref:
|
|
1010
|
+
ref: ge,
|
|
790
1011
|
className: "w6w-flow",
|
|
791
1012
|
style: { width: "100%", height: r, position: "relative" },
|
|
792
|
-
onKeyDown: (
|
|
793
|
-
if (
|
|
794
|
-
const i =
|
|
795
|
-
i.isContentEditable || i.tagName === "INPUT" || i.tagName === "TEXTAREA" || i.tagName === "SELECT" || i.closest("dialog, .w6w-modal") !== null || (
|
|
1013
|
+
onKeyDown: (n) => {
|
|
1014
|
+
if (n.key !== "Backspace" && n.key !== "Delete" || H || Ee || !K && !W) return;
|
|
1015
|
+
const i = n.target;
|
|
1016
|
+
i.isContentEditable || i.tagName === "INPUT" || i.tagName === "TEXTAREA" || i.tagName === "SELECT" || i.closest("dialog, .w6w-modal") !== null || (n.preventDefault(), K ? $e(K) : W && Rn(W));
|
|
796
1017
|
},
|
|
797
1018
|
children: [
|
|
798
|
-
/* @__PURE__ */
|
|
799
|
-
|
|
1019
|
+
/* @__PURE__ */ m(
|
|
1020
|
+
Hn,
|
|
800
1021
|
{
|
|
801
|
-
nodes:
|
|
802
|
-
edges:
|
|
1022
|
+
nodes: w,
|
|
1023
|
+
edges: y,
|
|
803
1024
|
defaultEdgeOptions: { type: "smoothstep" },
|
|
804
|
-
connectionLineType:
|
|
805
|
-
onNodesChange:
|
|
806
|
-
onEdgesChange:
|
|
807
|
-
onConnect:
|
|
808
|
-
onConnectEnd:
|
|
809
|
-
isValidConnection:
|
|
810
|
-
onNodeDragStop: () => {
|
|
811
|
-
|
|
1025
|
+
connectionLineType: jn.SmoothStep,
|
|
1026
|
+
onNodesChange: Se,
|
|
1027
|
+
onEdgesChange: xe,
|
|
1028
|
+
onConnect: je,
|
|
1029
|
+
onConnectEnd: J,
|
|
1030
|
+
isValidConnection: He,
|
|
1031
|
+
onNodeDragStop: (n, i, d) => {
|
|
1032
|
+
const p = Mn(d), f = p !== P;
|
|
1033
|
+
f && te(p), !(!A && !f) && M(w, y, p);
|
|
812
1034
|
},
|
|
813
|
-
onMoveEnd: (
|
|
814
|
-
if (!
|
|
815
|
-
const
|
|
816
|
-
|
|
1035
|
+
onMoveEnd: (n, i) => {
|
|
1036
|
+
if (!n || s) return;
|
|
1037
|
+
const d = $t(e, w, y), p = ys(d, i);
|
|
1038
|
+
p !== d && t(p);
|
|
817
1039
|
},
|
|
818
|
-
onSelectionChange: ({ nodes:
|
|
819
|
-
var
|
|
820
|
-
|
|
1040
|
+
onSelectionChange: ({ nodes: n, edges: i }) => {
|
|
1041
|
+
var d, p;
|
|
1042
|
+
$(((d = n[0]) == null ? void 0 : d.id) ?? null), me(((p = i[0]) == null ? void 0 : p.id) ?? null);
|
|
821
1043
|
},
|
|
822
|
-
nodeTypes:
|
|
823
|
-
nodesDraggable: !
|
|
824
|
-
nodesConnectable: !
|
|
1044
|
+
nodeTypes: $n,
|
|
1045
|
+
nodesDraggable: !s,
|
|
1046
|
+
nodesConnectable: !s,
|
|
1047
|
+
connectOnClick: !1,
|
|
825
1048
|
elementsSelectable: !0,
|
|
826
|
-
...
|
|
1049
|
+
..._ ? { defaultViewport: _ } : { fitView: !0 },
|
|
827
1050
|
deleteKeyCode: null,
|
|
828
|
-
colorMode:
|
|
1051
|
+
colorMode: ze,
|
|
829
1052
|
proOptions: { hideAttribution: !0 },
|
|
830
1053
|
children: [
|
|
831
|
-
/* @__PURE__ */
|
|
832
|
-
/* @__PURE__ */
|
|
833
|
-
|
|
1054
|
+
/* @__PURE__ */ o(On, { gap: 16 }),
|
|
1055
|
+
/* @__PURE__ */ o(Un, { showInteractive: !1, children: !s && /* @__PURE__ */ o(
|
|
1056
|
+
qn,
|
|
834
1057
|
{
|
|
835
|
-
onClick:
|
|
1058
|
+
onClick: Y,
|
|
836
1059
|
title: "Auto-layout — re-flow the graph into columns",
|
|
837
1060
|
"aria-label": "Auto-layout the graph",
|
|
838
|
-
children: /* @__PURE__ */
|
|
1061
|
+
children: /* @__PURE__ */ o(ve, { name: "layout" })
|
|
839
1062
|
}
|
|
840
1063
|
) }),
|
|
841
|
-
/* @__PURE__ */
|
|
842
|
-
!
|
|
843
|
-
|
|
1064
|
+
/* @__PURE__ */ o(Kn, { pannable: !0, zoomable: !0, style: { background: "var(--w6w-panel-2)" } }),
|
|
1065
|
+
!s && /* @__PURE__ */ m(Vt, { position: "top-left", className: "w6w-flow-tools", children: [
|
|
1066
|
+
/* @__PURE__ */ o(
|
|
1067
|
+
"button",
|
|
1068
|
+
{
|
|
1069
|
+
type: "button",
|
|
1070
|
+
className: "w6w-btn",
|
|
1071
|
+
onClick: () => Pe(!0),
|
|
1072
|
+
children: "+ Node"
|
|
1073
|
+
}
|
|
1074
|
+
),
|
|
1075
|
+
/* @__PURE__ */ o(
|
|
1076
|
+
Jt,
|
|
1077
|
+
{
|
|
1078
|
+
label: "Add note",
|
|
1079
|
+
icon: "sticky-note",
|
|
1080
|
+
className: "w6w-flow-tool",
|
|
1081
|
+
"data-testid": "add-note",
|
|
1082
|
+
onClick: An
|
|
1083
|
+
}
|
|
1084
|
+
),
|
|
1085
|
+
/* @__PURE__ */ o(
|
|
1086
|
+
Jt,
|
|
1087
|
+
{
|
|
1088
|
+
label: "Draw section",
|
|
1089
|
+
title: "Draw section — drag a frame on the canvas (Esc cancels)",
|
|
1090
|
+
icon: "frame",
|
|
1091
|
+
className: `w6w-flow-tool${ie ? " active" : ""}`,
|
|
1092
|
+
"aria-pressed": ie,
|
|
1093
|
+
"data-testid": "draw-section",
|
|
1094
|
+
onClick: () => {
|
|
1095
|
+
ke(!ie), de(null);
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
1098
|
+
)
|
|
1099
|
+
] }),
|
|
1100
|
+
!s && ie && /* @__PURE__ */ o(
|
|
1101
|
+
"div",
|
|
844
1102
|
{
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
1103
|
+
className: "w6w-section-draw nopan nodrag nowheel",
|
|
1104
|
+
"data-testid": "section-draw-surface",
|
|
1105
|
+
onPointerDown: (n) => {
|
|
1106
|
+
if (n.button !== 0) return;
|
|
1107
|
+
n.currentTarget.setPointerCapture(n.pointerId);
|
|
1108
|
+
const { clientX: i, clientY: d } = n;
|
|
1109
|
+
de({ sx: i, sy: d, ex: i, ey: d });
|
|
1110
|
+
},
|
|
1111
|
+
onPointerMove: (n) => {
|
|
1112
|
+
const { clientX: i, clientY: d } = n;
|
|
1113
|
+
de((p) => p && { ...p, ex: i, ey: d });
|
|
1114
|
+
},
|
|
1115
|
+
onPointerUp: () => {
|
|
1116
|
+
const n = q;
|
|
1117
|
+
if (de(null), ke(!1), !n) return;
|
|
1118
|
+
const i = pe({ x: n.sx, y: n.sy }), d = Math.abs(n.ex - n.sx) > 6 || Math.abs(n.ey - n.sy) > 6;
|
|
1119
|
+
In(
|
|
1120
|
+
i,
|
|
1121
|
+
d ? pe({ x: n.ex, y: n.ey }) : null
|
|
1122
|
+
);
|
|
1123
|
+
},
|
|
1124
|
+
children: q && (() => {
|
|
1125
|
+
var p;
|
|
1126
|
+
const n = (p = ge.current) == null ? void 0 : p.getBoundingClientRect(), i = (n == null ? void 0 : n.left) ?? 0, d = (n == null ? void 0 : n.top) ?? 0;
|
|
1127
|
+
return /* @__PURE__ */ o(
|
|
1128
|
+
"div",
|
|
1129
|
+
{
|
|
1130
|
+
className: "w6w-section-draw-rect",
|
|
1131
|
+
style: {
|
|
1132
|
+
left: Math.min(q.sx, q.ex) - i,
|
|
1133
|
+
top: Math.min(q.sy, q.ey) - d,
|
|
1134
|
+
width: Math.abs(q.ex - q.sx),
|
|
1135
|
+
height: Math.abs(q.ey - q.sy)
|
|
1136
|
+
}
|
|
1137
|
+
}
|
|
1138
|
+
);
|
|
1139
|
+
})()
|
|
849
1140
|
}
|
|
850
|
-
)
|
|
851
|
-
!
|
|
852
|
-
/* @__PURE__ */
|
|
853
|
-
["success", "error"].map((
|
|
1141
|
+
),
|
|
1142
|
+
!s && Ue && /* @__PURE__ */ o(Vt, { position: "top-right", children: /* @__PURE__ */ m("div", { className: "w6w-edge-lane", children: [
|
|
1143
|
+
/* @__PURE__ */ o("span", { className: "w6w-muted w6w-small", children: "Run on" }),
|
|
1144
|
+
["success", "error"].map((n) => /* @__PURE__ */ o(
|
|
854
1145
|
"button",
|
|
855
1146
|
{
|
|
856
1147
|
type: "button",
|
|
857
|
-
className: `w6w-btn w6w-btn-sm w6w-btn-ghost${
|
|
858
|
-
"aria-pressed":
|
|
859
|
-
title:
|
|
860
|
-
onClick: () =>
|
|
861
|
-
children:
|
|
1148
|
+
className: `w6w-btn w6w-btn-sm w6w-btn-ghost${oe(Ue) === n ? " active" : ""}`,
|
|
1149
|
+
"aria-pressed": oe(Ue) === n,
|
|
1150
|
+
title: go,
|
|
1151
|
+
onClick: () => Pn(n),
|
|
1152
|
+
children: n === "success" ? "Success" : "Error"
|
|
862
1153
|
},
|
|
863
|
-
|
|
1154
|
+
n
|
|
864
1155
|
)),
|
|
865
|
-
(
|
|
866
|
-
] }) })
|
|
1156
|
+
(fe == null ? void 0 : fe.edgeId) === Ue.id && /* @__PURE__ */ o("span", { className: "w6w-edge-lane-err w6w-small", role: "alert", children: fe.message })
|
|
1157
|
+
] }) }),
|
|
1158
|
+
/* @__PURE__ */ o(
|
|
1159
|
+
bs,
|
|
1160
|
+
{
|
|
1161
|
+
canvas: P,
|
|
1162
|
+
readOnly: s,
|
|
1163
|
+
savePosition: A,
|
|
1164
|
+
onChange: ye,
|
|
1165
|
+
onSectionDrop: Dn,
|
|
1166
|
+
onRequestDelete: (n, i) => !s && ae({ kind: n, id: i })
|
|
1167
|
+
}
|
|
1168
|
+
)
|
|
867
1169
|
]
|
|
868
1170
|
}
|
|
869
1171
|
),
|
|
870
|
-
|
|
871
|
-
|
|
1172
|
+
re && /* @__PURE__ */ o(
|
|
1173
|
+
zt,
|
|
1174
|
+
{
|
|
1175
|
+
title: re.kind === "note" ? "Delete note" : "Delete section",
|
|
1176
|
+
message: re.kind === "note" ? "Delete this note?" : "Delete this section? Its nodes are kept.",
|
|
1177
|
+
confirmLabel: "Delete",
|
|
1178
|
+
onConfirm: () => {
|
|
1179
|
+
Ln(re.kind, re.id), ae(null);
|
|
1180
|
+
},
|
|
1181
|
+
onClose: () => ae(null)
|
|
1182
|
+
}
|
|
1183
|
+
),
|
|
1184
|
+
Ee && /* @__PURE__ */ o(
|
|
1185
|
+
vs,
|
|
872
1186
|
{
|
|
873
1187
|
onClose: () => {
|
|
874
|
-
|
|
1188
|
+
Pe(!1), ne(null), Pt(null);
|
|
875
1189
|
},
|
|
876
|
-
onAdd: (
|
|
877
|
-
const i =
|
|
878
|
-
return i &&
|
|
1190
|
+
onAdd: (n) => {
|
|
1191
|
+
const i = Tn(n);
|
|
1192
|
+
return i && Pt(i), i;
|
|
879
1193
|
},
|
|
880
|
-
onDraftChange: (
|
|
1194
|
+
onDraftChange: (n, i) => bt(n, { id: n, ...i }),
|
|
881
1195
|
workflowId: e.id,
|
|
882
|
-
upstreamSteps:
|
|
1196
|
+
upstreamSteps: Ns(j, w, y)
|
|
883
1197
|
}
|
|
884
1198
|
),
|
|
885
|
-
|
|
1199
|
+
vt && H && // No `key` on purpose: renaming a step updates `editingId`, and a keyed
|
|
886
1200
|
// remount would drop focus mid-keystroke. The modal seeds its own state
|
|
887
1201
|
// once and unmounts (editingId → null) between edits of different nodes.
|
|
888
|
-
/* @__PURE__ */
|
|
889
|
-
|
|
1202
|
+
/* @__PURE__ */ o(
|
|
1203
|
+
Co,
|
|
890
1204
|
{
|
|
891
1205
|
workflowId: e.id,
|
|
892
|
-
step:
|
|
893
|
-
upstreamSteps:
|
|
894
|
-
readOnly:
|
|
895
|
-
fanOutCount:
|
|
896
|
-
initialView:
|
|
897
|
-
|
|
898
|
-
|
|
1206
|
+
step: vt,
|
|
1207
|
+
upstreamSteps: It.steps ?? [],
|
|
1208
|
+
readOnly: s,
|
|
1209
|
+
fanOutCount: Nt.get(H) ?? 0,
|
|
1210
|
+
initialView: Re,
|
|
1211
|
+
stepProblem: Te == null ? void 0 : Te.data.stepProblem,
|
|
1212
|
+
onChange: (n) => bt(H, n),
|
|
1213
|
+
onClose: () => ue(null),
|
|
899
1214
|
onTestRun: C
|
|
900
1215
|
}
|
|
901
1216
|
),
|
|
902
|
-
|
|
903
|
-
|
|
1217
|
+
x && /* @__PURE__ */ m(
|
|
1218
|
+
un,
|
|
904
1219
|
{
|
|
905
|
-
title: `${
|
|
906
|
-
onClose: () =>
|
|
1220
|
+
title: `${nt ? "Run node" : "Test run"}: ${x.stepId}`,
|
|
1221
|
+
onClose: () => D(null),
|
|
907
1222
|
children: [
|
|
908
|
-
|
|
909
|
-
|
|
1223
|
+
nt && tt && /* @__PURE__ */ o(
|
|
1224
|
+
yo,
|
|
910
1225
|
{
|
|
911
1226
|
workflowId: e.id,
|
|
912
|
-
step:
|
|
913
|
-
upstreamSteps:
|
|
914
|
-
onCancel: () =>
|
|
915
|
-
onRun: (
|
|
1227
|
+
step: tt,
|
|
1228
|
+
upstreamSteps: Vn,
|
|
1229
|
+
onCancel: () => D(null),
|
|
1230
|
+
onRun: (n, i) => Fn(x.stepId, n, i)
|
|
916
1231
|
},
|
|
917
|
-
|
|
1232
|
+
x.stepId
|
|
918
1233
|
),
|
|
919
|
-
!
|
|
920
|
-
/* @__PURE__ */
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
1234
|
+
!nt && /* @__PURE__ */ m(U, { children: [
|
|
1235
|
+
/* @__PURE__ */ m("div", { className: "w6w-modal-body", children: [
|
|
1236
|
+
x.status === "running" && /* @__PURE__ */ o("p", { className: "w6w-muted w6w-small", children: "Running…" }),
|
|
1237
|
+
x.status === "error" && /* @__PURE__ */ m("div", { className: "w6w-result w6w-error", children: [
|
|
1238
|
+
x.errorCode && /* @__PURE__ */ o(
|
|
924
1239
|
"div",
|
|
925
1240
|
{
|
|
926
1241
|
className: "w6w-small",
|
|
927
1242
|
style: { opacity: 0.75, marginBottom: 4 },
|
|
928
|
-
children: /* @__PURE__ */
|
|
1243
|
+
children: /* @__PURE__ */ o("code", { children: x.errorCode })
|
|
929
1244
|
}
|
|
930
1245
|
),
|
|
931
|
-
|
|
1246
|
+
x.error || "The node failed with no error message."
|
|
932
1247
|
] }),
|
|
933
|
-
|
|
934
|
-
/* @__PURE__ */
|
|
935
|
-
/* @__PURE__ */
|
|
1248
|
+
x.status === "done" && /* @__PURE__ */ m("div", { children: [
|
|
1249
|
+
/* @__PURE__ */ o("div", { className: "w6w-muted w6w-small", style: { marginBottom: 6 }, children: "Result" }),
|
|
1250
|
+
/* @__PURE__ */ o(
|
|
936
1251
|
"pre",
|
|
937
1252
|
{
|
|
938
1253
|
className: "w6w-result",
|
|
@@ -942,11 +1257,11 @@ function ks({
|
|
|
942
1257
|
overflow: "auto",
|
|
943
1258
|
margin: 0
|
|
944
1259
|
},
|
|
945
|
-
children: JSON.stringify(
|
|
1260
|
+
children: JSON.stringify(x.value, null, 2)
|
|
946
1261
|
}
|
|
947
1262
|
),
|
|
948
|
-
|
|
949
|
-
/* @__PURE__ */
|
|
1263
|
+
x.meta && /* @__PURE__ */ m(U, { children: [
|
|
1264
|
+
/* @__PURE__ */ o(
|
|
950
1265
|
"div",
|
|
951
1266
|
{
|
|
952
1267
|
className: "w6w-muted w6w-small",
|
|
@@ -954,7 +1269,7 @@ function ks({
|
|
|
954
1269
|
children: "Metadata"
|
|
955
1270
|
}
|
|
956
1271
|
),
|
|
957
|
-
/* @__PURE__ */
|
|
1272
|
+
/* @__PURE__ */ o(
|
|
958
1273
|
"pre",
|
|
959
1274
|
{
|
|
960
1275
|
className: "w6w-result",
|
|
@@ -964,13 +1279,13 @@ function ks({
|
|
|
964
1279
|
overflow: "auto",
|
|
965
1280
|
margin: 0
|
|
966
1281
|
},
|
|
967
|
-
children: JSON.stringify(
|
|
1282
|
+
children: JSON.stringify(x.meta, null, 2)
|
|
968
1283
|
}
|
|
969
1284
|
)
|
|
970
1285
|
] })
|
|
971
1286
|
] }),
|
|
972
|
-
|
|
973
|
-
/* @__PURE__ */
|
|
1287
|
+
x.logs && x.logs.length > 0 && /* @__PURE__ */ m("div", { children: [
|
|
1288
|
+
/* @__PURE__ */ o(
|
|
974
1289
|
"div",
|
|
975
1290
|
{
|
|
976
1291
|
className: "w6w-muted w6w-small",
|
|
@@ -978,7 +1293,7 @@ function ks({
|
|
|
978
1293
|
children: "Console output"
|
|
979
1294
|
}
|
|
980
1295
|
),
|
|
981
|
-
/* @__PURE__ */
|
|
1296
|
+
/* @__PURE__ */ o(
|
|
982
1297
|
"pre",
|
|
983
1298
|
{
|
|
984
1299
|
className: "w6w-result",
|
|
@@ -988,18 +1303,18 @@ function ks({
|
|
|
988
1303
|
overflow: "auto",
|
|
989
1304
|
margin: 0
|
|
990
1305
|
},
|
|
991
|
-
children:
|
|
1306
|
+
children: x.logs.join(`
|
|
992
1307
|
`)
|
|
993
1308
|
}
|
|
994
1309
|
)
|
|
995
1310
|
] })
|
|
996
1311
|
] }),
|
|
997
|
-
/* @__PURE__ */
|
|
1312
|
+
/* @__PURE__ */ o("div", { className: "w6w-modal-actions", children: /* @__PURE__ */ o(
|
|
998
1313
|
"button",
|
|
999
1314
|
{
|
|
1000
1315
|
type: "button",
|
|
1001
1316
|
className: "w6w-btn",
|
|
1002
|
-
onClick: () =>
|
|
1317
|
+
onClick: () => D(null),
|
|
1003
1318
|
children: "Close"
|
|
1004
1319
|
}
|
|
1005
1320
|
) })
|
|
@@ -1007,75 +1322,75 @@ function ks({
|
|
|
1007
1322
|
]
|
|
1008
1323
|
}
|
|
1009
1324
|
),
|
|
1010
|
-
|
|
1011
|
-
|
|
1325
|
+
Le !== null && /* @__PURE__ */ o(
|
|
1326
|
+
zt,
|
|
1012
1327
|
{
|
|
1013
|
-
title: "Delete
|
|
1014
|
-
message: `Delete
|
|
1328
|
+
title: "Delete node",
|
|
1329
|
+
message: `Delete node "${Le}"? Its connections are removed too.`,
|
|
1015
1330
|
confirmLabel: "Delete",
|
|
1016
1331
|
onConfirm: () => {
|
|
1017
|
-
Le
|
|
1332
|
+
Oe(Le), G(null);
|
|
1018
1333
|
},
|
|
1019
|
-
onClose: () =>
|
|
1334
|
+
onClose: () => G(null)
|
|
1020
1335
|
}
|
|
1021
1336
|
)
|
|
1022
1337
|
]
|
|
1023
1338
|
}
|
|
1024
1339
|
) }) }) }) }) }) });
|
|
1025
1340
|
}
|
|
1026
|
-
function
|
|
1341
|
+
function mt(e) {
|
|
1027
1342
|
try {
|
|
1028
|
-
const
|
|
1029
|
-
return
|
|
1343
|
+
const t = JSON.parse(e);
|
|
1344
|
+
return t && typeof t == "object" && !Array.isArray(t) ? t : null;
|
|
1030
1345
|
} catch {
|
|
1031
1346
|
return null;
|
|
1032
1347
|
}
|
|
1033
1348
|
}
|
|
1034
|
-
function
|
|
1349
|
+
function xn({
|
|
1035
1350
|
text: e,
|
|
1036
|
-
onChange:
|
|
1037
|
-
seeds:
|
|
1351
|
+
onChange: t,
|
|
1352
|
+
seeds: s,
|
|
1038
1353
|
readOnly: r
|
|
1039
1354
|
}) {
|
|
1040
|
-
const
|
|
1041
|
-
|
|
1042
|
-
u &&
|
|
1355
|
+
const a = mt(e), c = a ? Object.keys(a).length : 0, u = c > 0, [b, N] = S(u);
|
|
1356
|
+
z(() => {
|
|
1357
|
+
u && N(!0);
|
|
1043
1358
|
}, [u]);
|
|
1044
|
-
const
|
|
1045
|
-
|
|
1359
|
+
const C = (h) => {
|
|
1360
|
+
t(JSON.stringify(h.lastRunOutput ?? h.input ?? {}, null, 2)), N(!0);
|
|
1046
1361
|
};
|
|
1047
|
-
return /* @__PURE__ */
|
|
1048
|
-
/* @__PURE__ */
|
|
1049
|
-
|
|
1362
|
+
return /* @__PURE__ */ m("div", { className: "w6w-field w6w-incoming-state", children: [
|
|
1363
|
+
/* @__PURE__ */ o("span", { children: "Incoming state" }),
|
|
1364
|
+
s.length > 0 && /* @__PURE__ */ o("div", { className: "w6w-seed-picker", children: /* @__PURE__ */ o("div", { className: "w6w-seed-chips", children: s.map((h) => /* @__PURE__ */ m(
|
|
1050
1365
|
"button",
|
|
1051
1366
|
{
|
|
1052
1367
|
type: "button",
|
|
1053
1368
|
className: "w6w-chip w6w-seed-chip",
|
|
1054
|
-
title: `Use ${
|
|
1369
|
+
title: `Use ${h.label}'s saved test as the incoming state`,
|
|
1055
1370
|
disabled: r,
|
|
1056
|
-
onClick: () =>
|
|
1371
|
+
onClick: () => C(h.test),
|
|
1057
1372
|
children: [
|
|
1058
|
-
/* @__PURE__ */
|
|
1059
|
-
|
|
1373
|
+
/* @__PURE__ */ o("code", { children: h.label }),
|
|
1374
|
+
h.test.lastRunStatus ? /* @__PURE__ */ m("span", { className: "w6w-muted w6w-small", children: [
|
|
1060
1375
|
" · ",
|
|
1061
|
-
|
|
1376
|
+
h.test.lastRunStatus
|
|
1062
1377
|
] }) : null
|
|
1063
1378
|
]
|
|
1064
1379
|
},
|
|
1065
|
-
|
|
1380
|
+
h.stepId
|
|
1066
1381
|
)) }) }),
|
|
1067
|
-
/* @__PURE__ */
|
|
1382
|
+
/* @__PURE__ */ m(
|
|
1068
1383
|
"details",
|
|
1069
1384
|
{
|
|
1070
1385
|
className: "w6w-state-override",
|
|
1071
|
-
open:
|
|
1072
|
-
onToggle: (
|
|
1386
|
+
open: b,
|
|
1387
|
+
onToggle: (h) => N(h.currentTarget.open),
|
|
1073
1388
|
children: [
|
|
1074
|
-
/* @__PURE__ */
|
|
1389
|
+
/* @__PURE__ */ m("summary", { children: [
|
|
1075
1390
|
"Override the incoming state",
|
|
1076
|
-
|
|
1391
|
+
c > 0 ? ` · ${c} key${c === 1 ? "" : "s"} set` : ""
|
|
1077
1392
|
] }),
|
|
1078
|
-
/* @__PURE__ */
|
|
1393
|
+
/* @__PURE__ */ o(
|
|
1079
1394
|
"textarea",
|
|
1080
1395
|
{
|
|
1081
1396
|
rows: 3,
|
|
@@ -1083,12 +1398,12 @@ function Yt({
|
|
|
1083
1398
|
readOnly: r,
|
|
1084
1399
|
spellCheck: !1,
|
|
1085
1400
|
"aria-label": "Incoming state override (JSON)",
|
|
1086
|
-
onChange: (
|
|
1401
|
+
onChange: (h) => t(h.target.value)
|
|
1087
1402
|
}
|
|
1088
1403
|
),
|
|
1089
|
-
/* @__PURE__ */
|
|
1404
|
+
/* @__PURE__ */ m("span", { className: "w6w-hint", children: [
|
|
1090
1405
|
"JSON merged into the call (e.g. a script's ",
|
|
1091
|
-
/* @__PURE__ */
|
|
1406
|
+
/* @__PURE__ */ o("code", { children: "input" }),
|
|
1092
1407
|
"). Reach for this to test against a state the flow cannot currently produce — a field no upstream step returns yet, or a case you can't reproduce by running the flow."
|
|
1093
1408
|
] })
|
|
1094
1409
|
]
|
|
@@ -1096,91 +1411,91 @@ function Yt({
|
|
|
1096
1411
|
)
|
|
1097
1412
|
] });
|
|
1098
1413
|
}
|
|
1099
|
-
function
|
|
1414
|
+
function yo({
|
|
1100
1415
|
workflowId: e,
|
|
1101
|
-
step:
|
|
1102
|
-
upstreamSteps:
|
|
1416
|
+
step: t,
|
|
1417
|
+
upstreamSteps: s,
|
|
1103
1418
|
onRun: r,
|
|
1104
|
-
onCancel:
|
|
1419
|
+
onCancel: a
|
|
1105
1420
|
}) {
|
|
1106
|
-
const
|
|
1421
|
+
const c = Qe(), u = Ie(t.uses.app), b = Je(t.uses.app), N = O(
|
|
1107
1422
|
() => {
|
|
1108
|
-
var
|
|
1109
|
-
return u ?
|
|
1423
|
+
var $;
|
|
1424
|
+
return u ? Ut(($ = t.with) == null ? void 0 : $.fields) : [];
|
|
1110
1425
|
},
|
|
1111
|
-
[u,
|
|
1112
|
-
),
|
|
1113
|
-
|
|
1114
|
-
if (
|
|
1115
|
-
if (!
|
|
1116
|
-
|
|
1426
|
+
[u, t.with]
|
|
1427
|
+
), C = O(() => u ? Rs(N) : b ? wn(t.uses.app, t.uses.action) : null, [u, b, N, t.uses.app, t.uses.action]), [h, k] = S(null), l = C ?? h;
|
|
1428
|
+
z(() => {
|
|
1429
|
+
if (C) return;
|
|
1430
|
+
if (!t.uses.app || !t.uses.action) {
|
|
1431
|
+
k([]);
|
|
1117
1432
|
return;
|
|
1118
1433
|
}
|
|
1119
|
-
let
|
|
1120
|
-
return
|
|
1121
|
-
var
|
|
1122
|
-
|
|
1123
|
-
}).catch(() =>
|
|
1124
|
-
|
|
1434
|
+
let $ = !1;
|
|
1435
|
+
return k(null), c.getAppActions(t.uses.app).then((ee) => {
|
|
1436
|
+
var P;
|
|
1437
|
+
$ || k(((P = ee.find((te) => te.key === t.uses.action)) == null ? void 0 : P.params) ?? []);
|
|
1438
|
+
}).catch(() => !$ && k([])), () => {
|
|
1439
|
+
$ = !0;
|
|
1125
1440
|
};
|
|
1126
|
-
}, [
|
|
1127
|
-
const [
|
|
1441
|
+
}, [c, C, t.uses.app, t.uses.action]);
|
|
1442
|
+
const [x, D] = S(
|
|
1128
1443
|
() => {
|
|
1129
|
-
var
|
|
1130
|
-
return u ?
|
|
1444
|
+
var $;
|
|
1445
|
+
return u ? Ts(Ut(($ = t.with) == null ? void 0 : $.fields)) : {};
|
|
1131
1446
|
}
|
|
1132
|
-
), [
|
|
1133
|
-
|
|
1134
|
-
let
|
|
1135
|
-
return
|
|
1136
|
-
if (
|
|
1137
|
-
const
|
|
1138
|
-
u ?
|
|
1447
|
+
), [T, _] = S("{}"), A = mn(e, s, !u), w = gn(A), [L, Se] = S(!1);
|
|
1448
|
+
z(() => {
|
|
1449
|
+
let $ = !1;
|
|
1450
|
+
return c.listStepTests(e, t.id).then((ee) => {
|
|
1451
|
+
if ($) return;
|
|
1452
|
+
const P = ee.length ? ee[ee.length - 1] : null;
|
|
1453
|
+
u ? P != null && P.with && D((te) => ({ ...te, ...P.with })) : P != null && P.input && Object.keys(P.input).length > 0 && _(JSON.stringify(P.input, null, 2)), Se(!0);
|
|
1139
1454
|
}).catch(() => {
|
|
1140
|
-
|
|
1455
|
+
$ || Se(!0);
|
|
1141
1456
|
}), () => {
|
|
1142
|
-
|
|
1457
|
+
$ = !0;
|
|
1143
1458
|
};
|
|
1144
|
-
}, [
|
|
1145
|
-
const [
|
|
1459
|
+
}, [c, e, t.id, u]);
|
|
1460
|
+
const [le, B] = S(!0), y = mt(T), V = u ? le : y !== null, xe = u ? x : { ...t.with ?? {}, ...y ?? {} }, K = !!l && L && V && bn(l, xe);
|
|
1146
1461
|
return (
|
|
1147
1462
|
// `.w6w-stepconfig` frame + body + pinned footer (D-3): this component is a
|
|
1148
1463
|
// direct <Modal> child, so the frame's `height:100%` resolves against the
|
|
1149
1464
|
// dialog and only the form scrolls. The `.w6w-stack` keeps its own spacing.
|
|
1150
|
-
/* @__PURE__ */
|
|
1151
|
-
/* @__PURE__ */
|
|
1152
|
-
/* @__PURE__ */
|
|
1153
|
-
|
|
1465
|
+
/* @__PURE__ */ m("div", { className: "w6w-stepconfig", children: [
|
|
1466
|
+
/* @__PURE__ */ o("div", { className: "w6w-modal-body", children: /* @__PURE__ */ o("div", { className: "w6w-stack", children: l === null || !L ? /* @__PURE__ */ o("p", { className: "w6w-muted w6w-small", children: l === null ? "Loading parameters…" : "Loading saved values…" }) : u ? /* @__PURE__ */ m(U, { children: [
|
|
1467
|
+
/* @__PURE__ */ o(
|
|
1468
|
+
As,
|
|
1154
1469
|
{
|
|
1155
|
-
params:
|
|
1156
|
-
values:
|
|
1157
|
-
onChange:
|
|
1158
|
-
onValidityChange:
|
|
1470
|
+
params: l,
|
|
1471
|
+
values: x,
|
|
1472
|
+
onChange: D,
|
|
1473
|
+
onValidityChange: B
|
|
1159
1474
|
}
|
|
1160
1475
|
),
|
|
1161
|
-
|
|
1476
|
+
l.length === 0 && /* @__PURE__ */ m("span", { className: "w6w-hint", children: [
|
|
1162
1477
|
"This trigger declares no fields — provide a sample payload to run with. It becomes the trigger's output state (",
|
|
1163
|
-
/* @__PURE__ */
|
|
1478
|
+
/* @__PURE__ */ o("code", { children: "input" }),
|
|
1164
1479
|
")."
|
|
1165
1480
|
] })
|
|
1166
|
-
] }) : /* @__PURE__ */
|
|
1167
|
-
/* @__PURE__ */
|
|
1481
|
+
] }) : /* @__PURE__ */ m(U, { children: [
|
|
1482
|
+
/* @__PURE__ */ m("p", { className: "w6w-muted w6w-small", children: [
|
|
1168
1483
|
"Runs ",
|
|
1169
|
-
/* @__PURE__ */
|
|
1170
|
-
" with the configuration saved on this
|
|
1484
|
+
/* @__PURE__ */ o("code", { children: t.uses.action }),
|
|
1485
|
+
" with the configuration saved on this node — only the incoming state changes per run. Edit the node to change how it is configured."
|
|
1171
1486
|
] }),
|
|
1172
|
-
/* @__PURE__ */
|
|
1487
|
+
/* @__PURE__ */ o(xn, { text: T, onChange: _, seeds: A })
|
|
1173
1488
|
] }) }) }),
|
|
1174
|
-
/* @__PURE__ */
|
|
1175
|
-
/* @__PURE__ */
|
|
1176
|
-
!
|
|
1177
|
-
/* @__PURE__ */
|
|
1489
|
+
/* @__PURE__ */ m("div", { className: "w6w-modal-actions", children: [
|
|
1490
|
+
/* @__PURE__ */ o("button", { type: "button", className: "w6w-btn w6w-btn-ghost", onClick: a, children: "Cancel" }),
|
|
1491
|
+
!K && l !== null && L && /* @__PURE__ */ o("span", { className: "w6w-muted w6w-small", children: V ? u ? "Fill the required fields to test." : "This step is missing required configuration — set it on the Configure tab." : u ? "The payload must be a JSON object to run." : "The incoming state must be a JSON object to run." }),
|
|
1492
|
+
/* @__PURE__ */ o(
|
|
1178
1493
|
"button",
|
|
1179
1494
|
{
|
|
1180
1495
|
type: "button",
|
|
1181
1496
|
className: "w6w-btn",
|
|
1182
|
-
disabled: !
|
|
1183
|
-
onClick: () => r(u ?
|
|
1497
|
+
disabled: !K,
|
|
1498
|
+
onClick: () => r(u ? x : y ?? {}, u ? void 0 : w),
|
|
1184
1499
|
children: "▶ Run"
|
|
1185
1500
|
}
|
|
1186
1501
|
)
|
|
@@ -1188,101 +1503,110 @@ function Es({
|
|
|
1188
1503
|
] })
|
|
1189
1504
|
);
|
|
1190
1505
|
}
|
|
1191
|
-
function
|
|
1506
|
+
function De({
|
|
1192
1507
|
type: e,
|
|
1193
|
-
position:
|
|
1194
|
-
multiple:
|
|
1508
|
+
position: t,
|
|
1509
|
+
multiple: s,
|
|
1195
1510
|
id: r,
|
|
1196
|
-
variant:
|
|
1511
|
+
variant: a
|
|
1197
1512
|
}) {
|
|
1198
|
-
|
|
1199
|
-
|
|
1513
|
+
const c = Gn(), u = he(wt), b = !!c && !!u && !u.readOnly;
|
|
1514
|
+
return /* @__PURE__ */ o(
|
|
1515
|
+
Yn,
|
|
1200
1516
|
{
|
|
1201
1517
|
type: e,
|
|
1202
|
-
position:
|
|
1518
|
+
position: t,
|
|
1203
1519
|
id: r,
|
|
1204
|
-
className:
|
|
1205
|
-
style:
|
|
1206
|
-
|
|
1520
|
+
className: a === "error" ? "w6w-handle-error" : s ? "w6w-handle-multi" : void 0,
|
|
1521
|
+
style: s ? { height: 22, borderRadius: 3, width: 8 } : void 0,
|
|
1522
|
+
onClick: b ? () => {
|
|
1523
|
+
b && c && u.onAddFromPort(c, e, r);
|
|
1524
|
+
} : void 0,
|
|
1525
|
+
title: b ? `Drag to empty canvas (or click) to add ${a === "error" ? "a step that handles this step's failure" : e === "target" ? "a step before this one" : "the next step"} · drag to a port to connect` : a === "error" ? "On error — drag to route this step's failure separately" : s ? e === "target" ? "Accepts multiple incoming connections" : "Multiple outgoing connections" : void 0
|
|
1207
1526
|
}
|
|
1208
1527
|
);
|
|
1209
1528
|
}
|
|
1210
|
-
function
|
|
1211
|
-
const
|
|
1212
|
-
return !
|
|
1213
|
-
|
|
1529
|
+
function kn({ id: e, runnable: t }) {
|
|
1530
|
+
const s = he(wt);
|
|
1531
|
+
return !s || s.readOnly ? null : /* @__PURE__ */ m(Xn, { position: Ne.Top, className: "w6w-node-toolbar", children: [
|
|
1532
|
+
t && /* @__PURE__ */ o(
|
|
1214
1533
|
"button",
|
|
1215
1534
|
{
|
|
1216
1535
|
type: "button",
|
|
1217
1536
|
className: "w6w-node-toolbar-btn",
|
|
1218
|
-
title: "Test-run this
|
|
1219
|
-
"aria-label": "Test-run this
|
|
1220
|
-
onClick: () =>
|
|
1221
|
-
children: /* @__PURE__ */
|
|
1537
|
+
title: "Test-run this node",
|
|
1538
|
+
"aria-label": "Test-run this node",
|
|
1539
|
+
onClick: () => s.onRun(e),
|
|
1540
|
+
children: /* @__PURE__ */ o(ve, { name: "run", size: 15 })
|
|
1222
1541
|
}
|
|
1223
1542
|
),
|
|
1224
|
-
/* @__PURE__ */
|
|
1543
|
+
/* @__PURE__ */ o(
|
|
1225
1544
|
"button",
|
|
1226
1545
|
{
|
|
1227
1546
|
type: "button",
|
|
1228
1547
|
className: "w6w-node-toolbar-btn",
|
|
1229
1548
|
title: "Edit",
|
|
1230
|
-
"aria-label": "Edit
|
|
1231
|
-
onClick: () =>
|
|
1232
|
-
children: /* @__PURE__ */
|
|
1549
|
+
"aria-label": "Edit node",
|
|
1550
|
+
onClick: () => s.onEdit(e),
|
|
1551
|
+
children: /* @__PURE__ */ o(ve, { name: "edit", size: 15 })
|
|
1233
1552
|
}
|
|
1234
1553
|
),
|
|
1235
|
-
/* @__PURE__ */
|
|
1554
|
+
/* @__PURE__ */ o(
|
|
1236
1555
|
"button",
|
|
1237
1556
|
{
|
|
1238
1557
|
type: "button",
|
|
1239
1558
|
className: "w6w-node-toolbar-btn",
|
|
1240
1559
|
title: "Duplicate",
|
|
1241
|
-
"aria-label": "Duplicate
|
|
1242
|
-
onClick: () =>
|
|
1243
|
-
children: /* @__PURE__ */
|
|
1560
|
+
"aria-label": "Duplicate node",
|
|
1561
|
+
onClick: () => s.onDuplicate(e),
|
|
1562
|
+
children: /* @__PURE__ */ o(ve, { name: "copy", size: 15 })
|
|
1244
1563
|
}
|
|
1245
1564
|
),
|
|
1246
|
-
/* @__PURE__ */
|
|
1565
|
+
/* @__PURE__ */ o(
|
|
1247
1566
|
"button",
|
|
1248
1567
|
{
|
|
1249
1568
|
type: "button",
|
|
1250
1569
|
className: "w6w-node-toolbar-btn danger",
|
|
1251
1570
|
title: "Delete",
|
|
1252
|
-
"aria-label": "Delete
|
|
1253
|
-
onClick: () =>
|
|
1254
|
-
children: /* @__PURE__ */
|
|
1571
|
+
"aria-label": "Delete node",
|
|
1572
|
+
onClick: () => s.onDelete(e),
|
|
1573
|
+
children: /* @__PURE__ */ o(ve, { name: "trash", size: 15 })
|
|
1255
1574
|
}
|
|
1256
1575
|
)
|
|
1257
1576
|
] });
|
|
1258
1577
|
}
|
|
1259
|
-
function
|
|
1260
|
-
if (
|
|
1261
|
-
const
|
|
1262
|
-
return /* @__PURE__ */
|
|
1263
|
-
/* @__PURE__ */
|
|
1578
|
+
function En({ step: e, count: t }) {
|
|
1579
|
+
if (t < 2) return null;
|
|
1580
|
+
const s = e.fanOut === "parallel", r = co(t, s ? "parallel" : "sequential");
|
|
1581
|
+
return /* @__PURE__ */ m("div", { className: "w6w-fanout-badge", role: "img", "aria-label": r, title: r, children: [
|
|
1582
|
+
/* @__PURE__ */ o("span", { "aria-hidden": "true", children: s ? "⇉" : "→" }),
|
|
1264
1583
|
" ",
|
|
1265
|
-
|
|
1584
|
+
t
|
|
1266
1585
|
] });
|
|
1267
1586
|
}
|
|
1268
|
-
function
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
/* @__PURE__ */
|
|
1587
|
+
function vo({ id: e, data: t, selected: s }) {
|
|
1588
|
+
var h;
|
|
1589
|
+
const r = t.step, c = he(ht).get(r.uses.app), u = (c == null ? void 0 : c.displayName) || r.uses.app || "—", b = we(r, he(pt)), N = Sn(t.stepStatus ?? "no-run", t.runStatus), C = /* @__PURE__ */ o(En, { step: r, count: he(ft).get(e) ?? 0 });
|
|
1590
|
+
return /* @__PURE__ */ m("div", { children: [
|
|
1591
|
+
/* @__PURE__ */ o(kn, { id: e, runnable: !0 }),
|
|
1592
|
+
/* @__PURE__ */ m(
|
|
1273
1593
|
"div",
|
|
1274
1594
|
{
|
|
1275
|
-
"data-run-status":
|
|
1595
|
+
"data-run-status": t.stepStatus ?? "no-run",
|
|
1596
|
+
"data-step-problem": (h = t.stepProblem) == null ? void 0 : h.code,
|
|
1597
|
+
title: t.stepProblem ? st(t.stepProblem) : void 0,
|
|
1276
1598
|
style: {
|
|
1277
1599
|
// `relative` so the Handles center on the CARD, not the whole node
|
|
1278
1600
|
// (which also spans the meta line below) — keeps ports vertically centered.
|
|
1279
1601
|
position: "relative",
|
|
1602
|
+
// Missing-connection ring; the border stays the run-status visual.
|
|
1603
|
+
...t.stepProblem ? { boxShadow: "0 0 0 2px var(--w6w-danger)" } : {},
|
|
1280
1604
|
// Selection always wins the BORDER COLOUR (unchanged from before
|
|
1281
1605
|
// T1.1.1 — the ternary this extends); width/style/opacity keep
|
|
1282
1606
|
// reflecting the run status underneath so a selected running/failed
|
|
1283
1607
|
// step is still distinguishable from a selected idle one.
|
|
1284
|
-
border: `${
|
|
1285
|
-
opacity:
|
|
1608
|
+
border: `${N.borderWidth}px ${N.borderStyle} ${s ? "var(--w6w-accent)" : N.borderColor}`,
|
|
1609
|
+
opacity: s ? 1 : N.opacity,
|
|
1286
1610
|
background: "var(--w6w-panel)",
|
|
1287
1611
|
color: "var(--w6w-text)",
|
|
1288
1612
|
borderRadius: 4,
|
|
@@ -1294,30 +1618,53 @@ function xs({ id: e, data: n, selected: o }) {
|
|
|
1294
1618
|
gap: 10
|
|
1295
1619
|
},
|
|
1296
1620
|
children: [
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1621
|
+
t.stepProblem && /* @__PURE__ */ o(
|
|
1622
|
+
"span",
|
|
1623
|
+
{
|
|
1624
|
+
"data-step-problem-badge": "",
|
|
1625
|
+
role: "img",
|
|
1626
|
+
"aria-label": st(t.stepProblem),
|
|
1627
|
+
title: st(t.stepProblem),
|
|
1628
|
+
style: {
|
|
1629
|
+
position: "absolute",
|
|
1630
|
+
top: -9,
|
|
1631
|
+
right: -9,
|
|
1632
|
+
width: 18,
|
|
1633
|
+
height: 18,
|
|
1634
|
+
borderRadius: "50%",
|
|
1635
|
+
display: "flex",
|
|
1636
|
+
alignItems: "center",
|
|
1637
|
+
justifyContent: "center",
|
|
1638
|
+
background: "var(--w6w-danger)",
|
|
1639
|
+
color: "#fff"
|
|
1640
|
+
},
|
|
1641
|
+
children: /* @__PURE__ */ o(ve, { name: "warning", size: 12 })
|
|
1642
|
+
}
|
|
1643
|
+
),
|
|
1644
|
+
b.in > 0 && /* @__PURE__ */ o(De, { type: "target", position: Ne.Left, multiple: b.in > 1 }),
|
|
1645
|
+
/* @__PURE__ */ o(
|
|
1646
|
+
lt,
|
|
1300
1647
|
{
|
|
1301
|
-
src:
|
|
1302
|
-
srcDark:
|
|
1303
|
-
brandColor:
|
|
1648
|
+
src: c == null ? void 0 : c.iconSvg,
|
|
1649
|
+
srcDark: c == null ? void 0 : c.iconSvgDark,
|
|
1650
|
+
brandColor: c == null ? void 0 : c.brandColor,
|
|
1304
1651
|
name: u,
|
|
1305
1652
|
size: 28
|
|
1306
1653
|
}
|
|
1307
1654
|
),
|
|
1308
|
-
/* @__PURE__ */
|
|
1309
|
-
/* @__PURE__ */
|
|
1310
|
-
/* @__PURE__ */
|
|
1655
|
+
/* @__PURE__ */ m("div", { style: { minWidth: 0 }, children: [
|
|
1656
|
+
/* @__PURE__ */ o("div", { style: { fontWeight: 600 }, children: u }),
|
|
1657
|
+
/* @__PURE__ */ o("div", { className: "w6w-muted w6w-small", style: { marginTop: 2 }, children: /* @__PURE__ */ o("code", { children: r.uses.action || "—" }) })
|
|
1311
1658
|
] }),
|
|
1312
|
-
|
|
1313
|
-
/* @__PURE__ */
|
|
1314
|
-
/* @__PURE__ */
|
|
1315
|
-
|
|
1659
|
+
b.out > 0 && /* @__PURE__ */ m(U, { children: [
|
|
1660
|
+
/* @__PURE__ */ o(De, { type: "source", position: Ne.Right, multiple: b.out > 1 }),
|
|
1661
|
+
/* @__PURE__ */ o(
|
|
1662
|
+
De,
|
|
1316
1663
|
{
|
|
1317
1664
|
type: "source",
|
|
1318
|
-
position:
|
|
1665
|
+
position: Ne.Bottom,
|
|
1319
1666
|
multiple: !1,
|
|
1320
|
-
id:
|
|
1667
|
+
id: hn,
|
|
1321
1668
|
variant: "error"
|
|
1322
1669
|
}
|
|
1323
1670
|
)
|
|
@@ -1325,39 +1672,42 @@ function xs({ id: e, data: n, selected: o }) {
|
|
|
1325
1672
|
]
|
|
1326
1673
|
}
|
|
1327
1674
|
),
|
|
1328
|
-
|
|
1329
|
-
/* @__PURE__ */
|
|
1675
|
+
C,
|
|
1676
|
+
/* @__PURE__ */ m(
|
|
1330
1677
|
"div",
|
|
1331
1678
|
{
|
|
1332
1679
|
className: "w6w-muted",
|
|
1333
1680
|
style: { marginTop: 3, fontSize: 10, opacity: 0.75, paddingLeft: 2 },
|
|
1334
1681
|
children: [
|
|
1335
1682
|
r.id,
|
|
1336
|
-
|
|
1683
|
+
c != null && c.version ? ` - v${c.version}` : ""
|
|
1337
1684
|
]
|
|
1338
1685
|
}
|
|
1339
1686
|
),
|
|
1340
|
-
r.notes && /* @__PURE__ */
|
|
1687
|
+
r.notes && /* @__PURE__ */ o("div", { className: "w6w-muted w6w-node-notes", title: r.notes, children: r.notes })
|
|
1341
1688
|
] });
|
|
1342
1689
|
}
|
|
1343
|
-
function
|
|
1344
|
-
const r =
|
|
1345
|
-
return /* @__PURE__ */
|
|
1346
|
-
/* @__PURE__ */
|
|
1347
|
-
/* @__PURE__ */
|
|
1690
|
+
function No({ id: e, data: t, selected: s }) {
|
|
1691
|
+
const r = t.step, a = dn(r.uses.app, r.uses.action), c = pn(r.uses.app, r.uses.action), u = we(r, he(pt)), b = Ie(r.uses.app), N = Sn(t.stepStatus ?? "no-run", t.runStatus), C = /* @__PURE__ */ o(En, { step: r, count: he(ft).get(e) ?? 0 });
|
|
1692
|
+
return /* @__PURE__ */ m("div", { children: [
|
|
1693
|
+
/* @__PURE__ */ o(kn, { id: e, runnable: !Be(r.uses.app) }),
|
|
1694
|
+
/* @__PURE__ */ m(
|
|
1348
1695
|
"div",
|
|
1349
1696
|
{
|
|
1350
|
-
"
|
|
1697
|
+
className: b ? "w6w-node-trigger" : void 0,
|
|
1698
|
+
"data-node-kind": b ? "trigger" : void 0,
|
|
1699
|
+
"data-run-status": t.stepStatus ?? "no-run",
|
|
1351
1700
|
style: {
|
|
1352
1701
|
// `relative` so the Handles center on the CARD, not the whole node
|
|
1353
1702
|
// (which also spans the meta line below) — keeps ports vertically centered.
|
|
1354
1703
|
position: "relative",
|
|
1355
|
-
border: `${
|
|
1356
|
-
opacity:
|
|
1704
|
+
border: `${N.borderWidth}px ${N.borderStyle} ${s ? "var(--w6w-accent)" : N.borderColor}`,
|
|
1705
|
+
opacity: s ? 1 : N.opacity,
|
|
1357
1706
|
background: "var(--w6w-panel-2)",
|
|
1358
1707
|
color: "var(--w6w-text)",
|
|
1359
|
-
|
|
1360
|
-
|
|
1708
|
+
// A trigger's half-pill radius + padding live in `.w6w-node-trigger`
|
|
1709
|
+
// (styles/_flow.scss): an inline value here would beat the class.
|
|
1710
|
+
...b ? {} : { borderRadius: 4, padding: "6px 14px 6px 8px" },
|
|
1361
1711
|
minWidth: 140,
|
|
1362
1712
|
fontSize: 13,
|
|
1363
1713
|
display: "flex",
|
|
@@ -1365,21 +1715,21 @@ function Rs({ id: e, data: n, selected: o }) {
|
|
|
1365
1715
|
gap: 10
|
|
1366
1716
|
},
|
|
1367
1717
|
children: [
|
|
1368
|
-
u.in > 0 && /* @__PURE__ */
|
|
1369
|
-
|
|
1370
|
-
/* @__PURE__ */
|
|
1371
|
-
/* @__PURE__ */
|
|
1372
|
-
/* @__PURE__ */
|
|
1718
|
+
u.in > 0 && /* @__PURE__ */ o(De, { type: "target", position: Ne.Left, multiple: u.in > 1 }),
|
|
1719
|
+
c && /* @__PURE__ */ o(fn, { icon: c }),
|
|
1720
|
+
/* @__PURE__ */ m("div", { style: { minWidth: 0, textAlign: "left" }, children: [
|
|
1721
|
+
/* @__PURE__ */ o("div", { style: { fontWeight: 600 }, children: a }),
|
|
1722
|
+
/* @__PURE__ */ o("div", { className: "w6w-muted w6w-small", style: { marginTop: 2 }, children: /* @__PURE__ */ o("code", { children: r.uses.action || "—" }) })
|
|
1373
1723
|
] }),
|
|
1374
|
-
u.out > 0 && /* @__PURE__ */
|
|
1375
|
-
/* @__PURE__ */
|
|
1376
|
-
!
|
|
1377
|
-
|
|
1724
|
+
u.out > 0 && /* @__PURE__ */ m(U, { children: [
|
|
1725
|
+
/* @__PURE__ */ o(De, { type: "source", position: Ne.Right, multiple: u.out > 1 }),
|
|
1726
|
+
!b && /* @__PURE__ */ o(
|
|
1727
|
+
De,
|
|
1378
1728
|
{
|
|
1379
1729
|
type: "source",
|
|
1380
|
-
position:
|
|
1730
|
+
position: Ne.Bottom,
|
|
1381
1731
|
multiple: !1,
|
|
1382
|
-
id:
|
|
1732
|
+
id: hn,
|
|
1383
1733
|
variant: "error"
|
|
1384
1734
|
}
|
|
1385
1735
|
)
|
|
@@ -1387,8 +1737,8 @@ function Rs({ id: e, data: n, selected: o }) {
|
|
|
1387
1737
|
]
|
|
1388
1738
|
}
|
|
1389
1739
|
),
|
|
1390
|
-
|
|
1391
|
-
/* @__PURE__ */
|
|
1740
|
+
C,
|
|
1741
|
+
/* @__PURE__ */ o(
|
|
1392
1742
|
"div",
|
|
1393
1743
|
{
|
|
1394
1744
|
className: "w6w-muted",
|
|
@@ -1396,329 +1746,348 @@ function Rs({ id: e, data: n, selected: o }) {
|
|
|
1396
1746
|
children: r.id
|
|
1397
1747
|
}
|
|
1398
1748
|
),
|
|
1399
|
-
r.notes && /* @__PURE__ */
|
|
1749
|
+
r.notes && /* @__PURE__ */ o("div", { className: "w6w-muted w6w-node-notes", title: r.notes, children: r.notes })
|
|
1400
1750
|
] });
|
|
1401
1751
|
}
|
|
1402
|
-
function
|
|
1752
|
+
function Co({
|
|
1403
1753
|
workflowId: e,
|
|
1404
|
-
step:
|
|
1405
|
-
upstreamSteps:
|
|
1754
|
+
step: t,
|
|
1755
|
+
upstreamSteps: s,
|
|
1406
1756
|
onChange: r,
|
|
1407
|
-
onClose:
|
|
1408
|
-
readOnly:
|
|
1757
|
+
onClose: a,
|
|
1758
|
+
readOnly: c,
|
|
1409
1759
|
initialView: u = "props",
|
|
1410
|
-
fanOutCount:
|
|
1411
|
-
onTestRun:
|
|
1760
|
+
fanOutCount: b = 0,
|
|
1761
|
+
onTestRun: N,
|
|
1762
|
+
stepProblem: C
|
|
1412
1763
|
}) {
|
|
1413
|
-
var
|
|
1414
|
-
const
|
|
1415
|
-
"configure"
|
|
1416
|
-
), [
|
|
1764
|
+
var Oe;
|
|
1765
|
+
const h = Qe(), k = he(ht), [l, x] = S(t), D = tn(l, C), [T, _] = S(
|
|
1766
|
+
tn(t, C) ? "setup" : "configure"
|
|
1767
|
+
), [A, w] = S(
|
|
1417
1768
|
u === "json" ? "code" : u === "settings" ? "config" : "props"
|
|
1418
|
-
), [
|
|
1419
|
-
|
|
1769
|
+
), [L, Se] = S("props"), [le, B] = S(() => Ht(t)), [y, V] = S(() => jt(t)), [xe, K] = S("{}"), $ = Ce(null), [ee, P] = S(!1), [te, ie] = S(!1), [ke, q] = S(l.id), [de, re] = S(null), [ae, W] = S(null), [me, Ee] = S(null), [Pe, H] = S(null), [ue, Re] = S(!1), X = Je(l.uses.app);
|
|
1770
|
+
z(() => {
|
|
1420
1771
|
if (X) {
|
|
1421
|
-
|
|
1772
|
+
W(wn(l.uses.app, l.uses.action)), Ee(null);
|
|
1422
1773
|
return;
|
|
1423
1774
|
}
|
|
1424
|
-
if (!
|
|
1425
|
-
|
|
1775
|
+
if (!l.uses.app) {
|
|
1776
|
+
Ee(null), W([]);
|
|
1426
1777
|
return;
|
|
1427
1778
|
}
|
|
1428
|
-
let
|
|
1429
|
-
return
|
|
1430
|
-
var
|
|
1431
|
-
|
|
1432
|
-
|
|
1779
|
+
let g = !1;
|
|
1780
|
+
return W(null), h.getAppActions(l.uses.app).then((Y) => {
|
|
1781
|
+
var se;
|
|
1782
|
+
g || (Ee(Y), W(
|
|
1783
|
+
l.uses.action ? ((se = Y.find((fe) => fe.key === l.uses.action)) == null ? void 0 : se.params) ?? [] : []
|
|
1433
1784
|
));
|
|
1434
|
-
}).catch(() => !
|
|
1435
|
-
|
|
1785
|
+
}).catch(() => !g && W([])), () => {
|
|
1786
|
+
g = !0;
|
|
1436
1787
|
};
|
|
1437
|
-
}, [
|
|
1438
|
-
const
|
|
1439
|
-
X || !
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1788
|
+
}, [h, l.uses.app, l.uses.action, X]);
|
|
1789
|
+
const Le = F(() => {
|
|
1790
|
+
X || !l.uses.app || h.listConnectionsForApp(l.uses.app).then((g) => {
|
|
1791
|
+
H(g), Re(!1);
|
|
1792
|
+
}).catch(() => Re(!0));
|
|
1793
|
+
}, [h, l.uses.app, X]);
|
|
1794
|
+
z(() => {
|
|
1795
|
+
if (X || !l.uses.app) return;
|
|
1796
|
+
let g = !1;
|
|
1797
|
+
return h.listConnectionsForApp(l.uses.app).then((Y) => {
|
|
1798
|
+
g || (H(Y), Re(!1));
|
|
1799
|
+
}).catch(() => !g && Re(!0)), () => {
|
|
1800
|
+
g = !0;
|
|
1446
1801
|
};
|
|
1447
|
-
}, [
|
|
1448
|
-
const
|
|
1449
|
-
(
|
|
1450
|
-
g
|
|
1802
|
+
}, [h, l.uses.app, X]);
|
|
1803
|
+
const G = F(
|
|
1804
|
+
(g) => {
|
|
1805
|
+
x(g), r(g);
|
|
1451
1806
|
},
|
|
1452
1807
|
[r]
|
|
1453
|
-
),
|
|
1454
|
-
|
|
1455
|
-
},
|
|
1456
|
-
const
|
|
1457
|
-
if (
|
|
1458
|
-
|
|
1808
|
+
), Me = (g) => {
|
|
1809
|
+
g === "code" ? B(Ht(l)) : g === "params-code" && V(jt(l)), w(g);
|
|
1810
|
+
}, ge = () => {
|
|
1811
|
+
const g = ke.trim(), Y = g && g !== l.id ? Ms(g) : null;
|
|
1812
|
+
if (Y) {
|
|
1813
|
+
re(Y);
|
|
1459
1814
|
return;
|
|
1460
1815
|
}
|
|
1461
|
-
|
|
1462
|
-
},
|
|
1463
|
-
|
|
1464
|
-
if (!
|
|
1465
|
-
let
|
|
1466
|
-
return
|
|
1467
|
-
if (
|
|
1468
|
-
const
|
|
1469
|
-
if (!(
|
|
1470
|
-
const
|
|
1471
|
-
|
|
1816
|
+
g && g !== l.id && G({ ...l, id: g }), re(null), ie(!1);
|
|
1817
|
+
}, j = !!l.uses.app && !!l.uses.action && !Be(l.uses.app), ne = Ie(l.uses.app), pe = T === "test" && j && !ne, be = mn(e, s, j && !ne), ze = gn(be);
|
|
1818
|
+
z(() => {
|
|
1819
|
+
if (!j || ne) return;
|
|
1820
|
+
let g = !1;
|
|
1821
|
+
return h.listStepTests(e, l.id).then((Y) => {
|
|
1822
|
+
if (g) return;
|
|
1823
|
+
const se = Y.length ? Y[Y.length - 1] : null;
|
|
1824
|
+
if (!(se != null && se.input) || Object.keys(se.input).length === 0) return;
|
|
1825
|
+
const fe = JSON.stringify(se.input, null, 2);
|
|
1826
|
+
K((ce) => ce.trim() === "{}" ? fe : ce);
|
|
1472
1827
|
}).catch(() => {
|
|
1473
1828
|
}), () => {
|
|
1474
|
-
|
|
1829
|
+
g = !0;
|
|
1475
1830
|
};
|
|
1476
|
-
}, [
|
|
1477
|
-
const
|
|
1478
|
-
|
|
1831
|
+
}, [h, e, l.id, j, ne]);
|
|
1832
|
+
const Fe = mt(xe), M = { ...l.with ?? {}, ...Fe ?? {} }, He = Fe ?? {}, je = !!ae && bn(ae, M), J = k.get(l.uses.app), Ve = X ? pn(l.uses.app, l.uses.action) : null, $e = X ? Ve ? /* @__PURE__ */ o(fn, { icon: Ve }) : null : /* @__PURE__ */ o(
|
|
1833
|
+
lt,
|
|
1479
1834
|
{
|
|
1480
|
-
src:
|
|
1481
|
-
srcDark:
|
|
1482
|
-
brandColor:
|
|
1483
|
-
name:
|
|
1835
|
+
src: J == null ? void 0 : J.iconSvg,
|
|
1836
|
+
srcDark: J == null ? void 0 : J.iconSvgDark,
|
|
1837
|
+
brandColor: J == null ? void 0 : J.brandColor,
|
|
1838
|
+
name: J == null ? void 0 : J.displayName
|
|
1484
1839
|
}
|
|
1485
1840
|
);
|
|
1486
|
-
return /* @__PURE__ */
|
|
1487
|
-
|
|
1841
|
+
return /* @__PURE__ */ o(
|
|
1842
|
+
un,
|
|
1488
1843
|
{
|
|
1489
1844
|
ariaLabel: "Edit step",
|
|
1490
|
-
titleIcon:
|
|
1491
|
-
title: /* @__PURE__ */
|
|
1492
|
-
|
|
1845
|
+
titleIcon: $e,
|
|
1846
|
+
title: /* @__PURE__ */ m("span", { className: "w6w-step-rename", children: [
|
|
1847
|
+
te && !c ? /* @__PURE__ */ o(
|
|
1493
1848
|
"input",
|
|
1494
1849
|
{
|
|
1495
1850
|
autoFocus: !0,
|
|
1496
|
-
value:
|
|
1497
|
-
onChange: (
|
|
1498
|
-
|
|
1851
|
+
value: ke,
|
|
1852
|
+
onChange: (g) => {
|
|
1853
|
+
q(g.target.value), re(null);
|
|
1499
1854
|
},
|
|
1500
|
-
onBlur:
|
|
1501
|
-
onKeyDown: (
|
|
1502
|
-
|
|
1855
|
+
onBlur: ge,
|
|
1856
|
+
onKeyDown: (g) => {
|
|
1857
|
+
g.key === "Enter" && ge(), g.key === "Escape" && (q(l.id), re(null), ie(!1));
|
|
1503
1858
|
}
|
|
1504
1859
|
}
|
|
1505
|
-
) : /* @__PURE__ */
|
|
1506
|
-
/* @__PURE__ */
|
|
1507
|
-
!
|
|
1860
|
+
) : /* @__PURE__ */ m(U, { children: [
|
|
1861
|
+
/* @__PURE__ */ o("code", { children: l.id }),
|
|
1862
|
+
!c && /* @__PURE__ */ o(
|
|
1508
1863
|
"button",
|
|
1509
1864
|
{
|
|
1510
1865
|
type: "button",
|
|
1511
1866
|
className: "w6w-icon-btn w6w-btn-sm",
|
|
1512
|
-
title: "Rename
|
|
1513
|
-
"aria-label": "Rename
|
|
1867
|
+
title: "Rename node",
|
|
1868
|
+
"aria-label": "Rename node",
|
|
1514
1869
|
onClick: () => {
|
|
1515
|
-
|
|
1870
|
+
q(l.id), ie(!0);
|
|
1516
1871
|
},
|
|
1517
|
-
children: /* @__PURE__ */
|
|
1872
|
+
children: /* @__PURE__ */ o(ve, { name: "edit", size: 15 })
|
|
1518
1873
|
}
|
|
1519
1874
|
)
|
|
1520
1875
|
] }),
|
|
1521
|
-
|
|
1876
|
+
de && /* @__PURE__ */ o("span", { className: "w6w-hint", role: "alert", style: { color: "var(--w6w-danger)" }, children: de })
|
|
1522
1877
|
] }),
|
|
1523
|
-
onClose:
|
|
1878
|
+
onClose: a,
|
|
1524
1879
|
size: "wide",
|
|
1525
|
-
children: /* @__PURE__ */
|
|
1526
|
-
/* @__PURE__ */
|
|
1527
|
-
/* @__PURE__ */
|
|
1880
|
+
children: /* @__PURE__ */ m("div", { className: "w6w-stepconfig", children: [
|
|
1881
|
+
/* @__PURE__ */ m("div", { className: "w6w-tabsbar", children: [
|
|
1882
|
+
/* @__PURE__ */ o("div", { className: "w6w-subtabs", children: ["setup", "configure", "test"].map((g) => /* @__PURE__ */ o(
|
|
1528
1883
|
"button",
|
|
1529
1884
|
{
|
|
1530
1885
|
type: "button",
|
|
1531
|
-
className: `w6w-subtab${
|
|
1532
|
-
|
|
1533
|
-
|
|
1886
|
+
className: `w6w-subtab${T === g ? " active" : ""}`,
|
|
1887
|
+
disabled: D && g !== "setup",
|
|
1888
|
+
onClick: () => _(g),
|
|
1889
|
+
children: g === "setup" ? "Setup" : g === "configure" ? "Configure" : "Test"
|
|
1534
1890
|
},
|
|
1535
|
-
|
|
1891
|
+
g
|
|
1536
1892
|
)) }),
|
|
1537
|
-
|
|
1538
|
-
|
|
1893
|
+
pe ? /* @__PURE__ */ o(
|
|
1894
|
+
Ot,
|
|
1539
1895
|
{
|
|
1540
|
-
view:
|
|
1896
|
+
view: L,
|
|
1541
1897
|
views: ["props", "code"],
|
|
1542
|
-
onChange: (
|
|
1898
|
+
onChange: (g) => Se(g)
|
|
1543
1899
|
}
|
|
1544
|
-
) : /* @__PURE__ */
|
|
1545
|
-
|
|
1900
|
+
) : /* @__PURE__ */ o(
|
|
1901
|
+
Ot,
|
|
1546
1902
|
{
|
|
1547
|
-
view:
|
|
1548
|
-
onChange:
|
|
1549
|
-
disabled:
|
|
1903
|
+
view: A,
|
|
1904
|
+
onChange: Me,
|
|
1905
|
+
disabled: T !== "configure"
|
|
1550
1906
|
}
|
|
1551
1907
|
)
|
|
1552
1908
|
] }),
|
|
1553
|
-
/* @__PURE__ */
|
|
1554
|
-
|
|
1555
|
-
|
|
1909
|
+
D && C && /* @__PURE__ */ m("div", { role: "alert", className: "w6w-field-error", children: [
|
|
1910
|
+
"Connection ",
|
|
1911
|
+
C.connection,
|
|
1912
|
+
" no longer exists — choose another to continue."
|
|
1913
|
+
] }),
|
|
1914
|
+
/* @__PURE__ */ m("div", { className: "w6w-stepconfig-body", children: [
|
|
1915
|
+
T === "setup" && /* @__PURE__ */ o(
|
|
1916
|
+
Eo,
|
|
1556
1917
|
{
|
|
1557
|
-
step:
|
|
1558
|
-
app:
|
|
1559
|
-
actions:
|
|
1560
|
-
conns:
|
|
1918
|
+
step: l,
|
|
1919
|
+
app: J,
|
|
1920
|
+
actions: me,
|
|
1921
|
+
conns: Pe,
|
|
1922
|
+
connsFailed: ue,
|
|
1561
1923
|
isInternal: X,
|
|
1562
|
-
readOnly:
|
|
1563
|
-
onChangeAction: (
|
|
1564
|
-
onChangeConnection: (
|
|
1565
|
-
onConnectionCreated:
|
|
1566
|
-
onChangeApp: (
|
|
1924
|
+
readOnly: c,
|
|
1925
|
+
onChangeAction: (g) => G({ ...l, uses: { ...l.uses, action: g }, with: {} }),
|
|
1926
|
+
onChangeConnection: (g) => G({ ...l, uses: { ...l.uses, connection: g } }),
|
|
1927
|
+
onConnectionCreated: Le,
|
|
1928
|
+
onChangeApp: (g) => (
|
|
1567
1929
|
// D-1: a genuinely different app clears `uses.action`/`with` and
|
|
1568
1930
|
// drops the connection; reselecting the SAME app is a no-op —
|
|
1569
1931
|
// still committed (so the field always collapses cleanly), but
|
|
1570
1932
|
// with `step` itself, unchanged.
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
...
|
|
1574
|
-
uses: { app:
|
|
1933
|
+
G(
|
|
1934
|
+
g === l.uses.app ? l : {
|
|
1935
|
+
...l,
|
|
1936
|
+
uses: { app: g, action: "", connection: void 0 },
|
|
1575
1937
|
with: {}
|
|
1576
1938
|
}
|
|
1577
1939
|
)
|
|
1578
1940
|
)
|
|
1579
1941
|
}
|
|
1580
1942
|
),
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1943
|
+
T === "configure" && /* @__PURE__ */ m(U, { children: [
|
|
1944
|
+
l.uses.app === rt && h.listSubscriptionsForWorkflow && h.createSubscription && /* @__PURE__ */ o(ko, { workflowId: e, step: l, readOnly: c }),
|
|
1945
|
+
ae === null ? /* @__PURE__ */ o("p", { className: "w6w-muted w6w-small", children: "Loading parameters…" }) : A === "props" ? l.uses.action === "wait" && Be(l.uses.app) ? /* @__PURE__ */ o(
|
|
1946
|
+
Cs,
|
|
1585
1947
|
{
|
|
1586
|
-
values:
|
|
1587
|
-
readOnly:
|
|
1588
|
-
onChange: (
|
|
1948
|
+
values: l.with ?? {},
|
|
1949
|
+
readOnly: c,
|
|
1950
|
+
onChange: (g) => G({ ...l, with: g })
|
|
1589
1951
|
}
|
|
1590
|
-
) : /* @__PURE__ */
|
|
1591
|
-
|
|
1952
|
+
) : /* @__PURE__ */ o(
|
|
1953
|
+
Ss,
|
|
1592
1954
|
{
|
|
1593
|
-
params:
|
|
1594
|
-
values:
|
|
1595
|
-
readOnly:
|
|
1596
|
-
onChange: (
|
|
1955
|
+
params: ae,
|
|
1956
|
+
values: l.with ?? {},
|
|
1957
|
+
readOnly: c,
|
|
1958
|
+
onChange: (g) => G({ ...l, with: g }),
|
|
1959
|
+
dynamic: X || !l.uses.action ? void 0 : {
|
|
1960
|
+
appId: l.uses.app,
|
|
1961
|
+
actionKey: l.uses.action,
|
|
1962
|
+
connectionId: D ? void 0 : l.uses.connection ?? void 0,
|
|
1963
|
+
appName: J == null ? void 0 : J.displayName
|
|
1964
|
+
}
|
|
1597
1965
|
}
|
|
1598
|
-
) :
|
|
1966
|
+
) : A === "code" ? (
|
|
1599
1967
|
// Full step, read-only (D-3) — `stepToJson` is the ONE serializer,
|
|
1600
1968
|
// shared with the two other code-view hosts.
|
|
1601
|
-
/* @__PURE__ */
|
|
1602
|
-
|
|
1969
|
+
/* @__PURE__ */ o(
|
|
1970
|
+
it,
|
|
1603
1971
|
{
|
|
1604
|
-
value:
|
|
1972
|
+
value: le,
|
|
1605
1973
|
onChange: () => {
|
|
1606
1974
|
},
|
|
1607
1975
|
readOnly: !0,
|
|
1608
1976
|
minHeight: "260px",
|
|
1609
1977
|
height: "100%",
|
|
1610
|
-
"aria-label": `
|
|
1978
|
+
"aria-label": `Node ${l.id} JSON`,
|
|
1611
1979
|
copyable: !0
|
|
1612
1980
|
}
|
|
1613
1981
|
)
|
|
1614
|
-
) :
|
|
1615
|
-
|
|
1982
|
+
) : A === "params-code" ? /* @__PURE__ */ o(
|
|
1983
|
+
it,
|
|
1616
1984
|
{
|
|
1617
|
-
value:
|
|
1618
|
-
onChange:
|
|
1619
|
-
readOnly:
|
|
1985
|
+
value: y,
|
|
1986
|
+
onChange: V,
|
|
1987
|
+
readOnly: c,
|
|
1620
1988
|
minHeight: "260px",
|
|
1621
1989
|
height: "100%",
|
|
1622
|
-
"aria-label": `
|
|
1990
|
+
"aria-label": `Node ${l.id} params JSON`,
|
|
1623
1991
|
copyable: !0,
|
|
1624
|
-
onValidChange: (
|
|
1992
|
+
onValidChange: (g) => g && typeof g == "object" && !Array.isArray(g) && G({ ...l, with: g })
|
|
1625
1993
|
}
|
|
1626
|
-
) : /* @__PURE__ */
|
|
1627
|
-
/* @__PURE__ */
|
|
1628
|
-
|
|
1994
|
+
) : /* @__PURE__ */ m("div", { className: "w6w-stack", children: [
|
|
1995
|
+
/* @__PURE__ */ o(
|
|
1996
|
+
xs,
|
|
1629
1997
|
{
|
|
1630
|
-
config: { retry:
|
|
1631
|
-
onChange: (
|
|
1632
|
-
readOnly:
|
|
1633
|
-
failureHandling: !
|
|
1634
|
-
retryControls: !
|
|
1998
|
+
config: { retry: l.retry, onError: l.onError, notes: l.notes },
|
|
1999
|
+
onChange: (g) => G({ ...l, ...g }),
|
|
2000
|
+
readOnly: c,
|
|
2001
|
+
failureHandling: !ne,
|
|
2002
|
+
retryControls: !Be(l.uses.app) && l.uses.app !== ks
|
|
1635
2003
|
}
|
|
1636
2004
|
),
|
|
1637
|
-
|
|
1638
|
-
/* @__PURE__ */
|
|
1639
|
-
|
|
2005
|
+
So,
|
|
2006
|
+
/* @__PURE__ */ o(
|
|
2007
|
+
xo,
|
|
1640
2008
|
{
|
|
1641
|
-
step:
|
|
1642
|
-
count:
|
|
1643
|
-
readOnly:
|
|
1644
|
-
onChange:
|
|
2009
|
+
step: l,
|
|
2010
|
+
count: b,
|
|
2011
|
+
readOnly: c,
|
|
2012
|
+
onChange: G
|
|
1645
2013
|
}
|
|
1646
2014
|
)
|
|
1647
2015
|
] })
|
|
1648
2016
|
] }),
|
|
1649
|
-
|
|
1650
|
-
|
|
2017
|
+
T === "test" && /* @__PURE__ */ o("div", { className: "w6w-stack", children: j ? ne ? /* @__PURE__ */ o(
|
|
2018
|
+
Es,
|
|
1651
2019
|
{
|
|
1652
|
-
app:
|
|
1653
|
-
action:
|
|
1654
|
-
fields: (
|
|
1655
|
-
persist: { workflowId: e, stepId:
|
|
2020
|
+
app: l.uses.app,
|
|
2021
|
+
action: l.uses.action,
|
|
2022
|
+
fields: (Oe = l.with) == null ? void 0 : Oe.fields,
|
|
2023
|
+
persist: { workflowId: e, stepId: l.id, input: He }
|
|
1656
2024
|
}
|
|
1657
|
-
) : /* @__PURE__ */
|
|
1658
|
-
/* @__PURE__ */
|
|
2025
|
+
) : /* @__PURE__ */ m(U, { children: [
|
|
2026
|
+
/* @__PURE__ */ m("p", { className: "w6w-muted w6w-small", children: [
|
|
1659
2027
|
"Tests ",
|
|
1660
|
-
/* @__PURE__ */
|
|
2028
|
+
/* @__PURE__ */ o("code", { children: l.uses.action }),
|
|
1661
2029
|
" with the configuration saved on this step — only the incoming state changes per run."
|
|
1662
2030
|
] }),
|
|
1663
|
-
/* @__PURE__ */
|
|
1664
|
-
|
|
2031
|
+
/* @__PURE__ */ o(
|
|
2032
|
+
xn,
|
|
1665
2033
|
{
|
|
1666
|
-
text:
|
|
1667
|
-
onChange:
|
|
1668
|
-
seeds:
|
|
1669
|
-
readOnly:
|
|
2034
|
+
text: xe,
|
|
2035
|
+
onChange: K,
|
|
2036
|
+
seeds: be,
|
|
2037
|
+
readOnly: c
|
|
1670
2038
|
}
|
|
1671
2039
|
),
|
|
1672
|
-
|
|
1673
|
-
|
|
2040
|
+
ae === null ? /* @__PURE__ */ o("p", { className: "w6w-muted w6w-small", children: "Loading parameters…" }) : /* @__PURE__ */ o(
|
|
2041
|
+
qs,
|
|
1674
2042
|
{
|
|
1675
|
-
params:
|
|
1676
|
-
values:
|
|
1677
|
-
testStartState:
|
|
1678
|
-
view:
|
|
2043
|
+
params: ae,
|
|
2044
|
+
values: M,
|
|
2045
|
+
testStartState: ze,
|
|
2046
|
+
view: L
|
|
1679
2047
|
}
|
|
1680
2048
|
),
|
|
1681
|
-
/* @__PURE__ */
|
|
1682
|
-
|
|
2049
|
+
/* @__PURE__ */ o(
|
|
2050
|
+
Ps,
|
|
1683
2051
|
{
|
|
1684
|
-
ref:
|
|
1685
|
-
app:
|
|
1686
|
-
action:
|
|
1687
|
-
connectionId:
|
|
1688
|
-
values:
|
|
1689
|
-
state:
|
|
1690
|
-
canRun:
|
|
2052
|
+
ref: $,
|
|
2053
|
+
app: l.uses.app,
|
|
2054
|
+
action: l.uses.action,
|
|
2055
|
+
connectionId: l.uses.connection ?? void 0,
|
|
2056
|
+
values: M,
|
|
2057
|
+
state: ze,
|
|
2058
|
+
canRun: je,
|
|
1691
2059
|
hideRunButton: !0,
|
|
1692
|
-
persist: { workflowId: e, stepId:
|
|
1693
|
-
onBusyChange:
|
|
2060
|
+
persist: { workflowId: e, stepId: l.id, input: He },
|
|
2061
|
+
onBusyChange: P
|
|
1694
2062
|
}
|
|
1695
2063
|
)
|
|
1696
|
-
] }) : /* @__PURE__ */
|
|
2064
|
+
] }) : /* @__PURE__ */ o("p", { className: "w6w-muted w6w-small", children: "Flow-control nodes can't be tested on their own." }) })
|
|
1697
2065
|
] }),
|
|
1698
|
-
/* @__PURE__ */
|
|
2066
|
+
/* @__PURE__ */ o("div", { className: "w6w-modal-actions w6w-stepconfig-footer", children: T !== "test" ? /* @__PURE__ */ o(
|
|
1699
2067
|
"button",
|
|
1700
2068
|
{
|
|
1701
2069
|
type: "button",
|
|
1702
2070
|
className: "w6w-btn",
|
|
1703
|
-
|
|
2071
|
+
disabled: D,
|
|
2072
|
+
onClick: () => _(T === "setup" ? "configure" : "test"),
|
|
1704
2073
|
children: "Next →"
|
|
1705
2074
|
}
|
|
1706
|
-
) : /* @__PURE__ */
|
|
1707
|
-
/* @__PURE__ */
|
|
1708
|
-
|
|
2075
|
+
) : /* @__PURE__ */ m(U, { children: [
|
|
2076
|
+
/* @__PURE__ */ o("button", { type: "button", className: "w6w-btn w6w-btn-ghost", onClick: a, children: "Done" }),
|
|
2077
|
+
j && !ne && // Runs the step and persists the outcome (records a run + saves
|
|
1709
2078
|
// the fixture) via the body's <StepTestRun>, so a step test is
|
|
1710
2079
|
// saved and re-runnable. `readOnly` viewers can't write tests.
|
|
1711
|
-
/* @__PURE__ */
|
|
2080
|
+
/* @__PURE__ */ o(
|
|
1712
2081
|
"button",
|
|
1713
2082
|
{
|
|
1714
2083
|
type: "button",
|
|
1715
2084
|
className: "w6w-btn",
|
|
1716
|
-
disabled:
|
|
2085
|
+
disabled: c || !je || ee,
|
|
1717
2086
|
onClick: () => {
|
|
1718
|
-
var
|
|
1719
|
-
|
|
2087
|
+
var g;
|
|
2088
|
+
N == null || N(), (g = $.current) == null || g.run();
|
|
1720
2089
|
},
|
|
1721
|
-
children:
|
|
2090
|
+
children: ee ? "Testing…" : "Test"
|
|
1722
2091
|
}
|
|
1723
2092
|
)
|
|
1724
2093
|
] }) })
|
|
@@ -1726,223 +2095,223 @@ function Ts({
|
|
|
1726
2095
|
}
|
|
1727
2096
|
);
|
|
1728
2097
|
}
|
|
1729
|
-
const
|
|
1730
|
-
function
|
|
2098
|
+
const So = !1;
|
|
2099
|
+
function xo({
|
|
1731
2100
|
step: e,
|
|
1732
|
-
count:
|
|
1733
|
-
readOnly:
|
|
2101
|
+
count: t,
|
|
2102
|
+
readOnly: s,
|
|
1734
2103
|
onChange: r
|
|
1735
2104
|
}) {
|
|
1736
|
-
const
|
|
1737
|
-
return /* @__PURE__ */
|
|
1738
|
-
/* @__PURE__ */
|
|
1739
|
-
/* @__PURE__ */
|
|
2105
|
+
const a = t >= 2, c = e.fanOut === "parallel" ? "parallel" : "sequential";
|
|
2106
|
+
return /* @__PURE__ */ m("label", { className: "w6w-field", children: [
|
|
2107
|
+
/* @__PURE__ */ o("span", { children: "Run next nodes" }),
|
|
2108
|
+
/* @__PURE__ */ m(
|
|
1740
2109
|
"select",
|
|
1741
2110
|
{
|
|
1742
|
-
"aria-label": "Run next
|
|
1743
|
-
value:
|
|
1744
|
-
disabled:
|
|
1745
|
-
onChange: (u) => r(
|
|
2111
|
+
"aria-label": "Run next nodes",
|
|
2112
|
+
value: c,
|
|
2113
|
+
disabled: s || !a,
|
|
2114
|
+
onChange: (u) => r(ao(e, u.target.value)),
|
|
1746
2115
|
children: [
|
|
1747
|
-
/* @__PURE__ */
|
|
1748
|
-
/* @__PURE__ */
|
|
2116
|
+
/* @__PURE__ */ o("option", { value: "sequential", children: "In sequence" }),
|
|
2117
|
+
/* @__PURE__ */ o("option", { value: "parallel", children: "In parallel" })
|
|
1749
2118
|
]
|
|
1750
2119
|
}
|
|
1751
2120
|
),
|
|
1752
|
-
!
|
|
2121
|
+
!a && /* @__PURE__ */ o("span", { className: "w6w-muted w6w-small", children: "Connect two or more steps after this one to choose how they run." })
|
|
1753
2122
|
] });
|
|
1754
2123
|
}
|
|
1755
|
-
function
|
|
2124
|
+
function ko({
|
|
1756
2125
|
workflowId: e,
|
|
1757
|
-
step:
|
|
1758
|
-
readOnly:
|
|
2126
|
+
step: t,
|
|
2127
|
+
readOnly: s
|
|
1759
2128
|
}) {
|
|
1760
|
-
const r =
|
|
1761
|
-
|
|
1762
|
-
const
|
|
1763
|
-
if (!
|
|
1764
|
-
let
|
|
1765
|
-
return
|
|
1766
|
-
|
|
1767
|
-
}).catch((
|
|
1768
|
-
|
|
2129
|
+
const r = Qe(), [a, c] = S(void 0), [u, b] = S(null), [N, C] = S(!1);
|
|
2130
|
+
z(() => {
|
|
2131
|
+
const k = r.listSubscriptionsForWorkflow;
|
|
2132
|
+
if (!k) return;
|
|
2133
|
+
let l = !1;
|
|
2134
|
+
return k(e).then((x) => {
|
|
2135
|
+
l || c(x.find((D) => D.appId === rt) ?? null);
|
|
2136
|
+
}).catch((x) => !l && b(x.message)), () => {
|
|
2137
|
+
l = !0;
|
|
1769
2138
|
};
|
|
1770
2139
|
}, [r, e]);
|
|
1771
|
-
const
|
|
1772
|
-
const
|
|
1773
|
-
|
|
2140
|
+
const h = () => {
|
|
2141
|
+
const k = r.createSubscription;
|
|
2142
|
+
k && (b(null), C(!0), k(rt, t.uses.action, {
|
|
1774
2143
|
workflowId: e,
|
|
1775
2144
|
connectionId: null,
|
|
1776
|
-
params:
|
|
1777
|
-
}).then((
|
|
1778
|
-
|
|
1779
|
-
}).catch((
|
|
1780
|
-
|
|
2145
|
+
params: t.with ?? {}
|
|
2146
|
+
}).then((l) => {
|
|
2147
|
+
C(!1), c(l);
|
|
2148
|
+
}).catch((l) => {
|
|
2149
|
+
C(!1), b(l instanceof Error ? l.message : String(l));
|
|
1781
2150
|
}));
|
|
1782
2151
|
};
|
|
1783
|
-
return /* @__PURE__ */
|
|
1784
|
-
/* @__PURE__ */
|
|
1785
|
-
/* @__PURE__ */
|
|
2152
|
+
return /* @__PURE__ */ m("div", { className: "w6w-stack", children: [
|
|
2153
|
+
/* @__PURE__ */ m("p", { className: "w6w-muted w6w-small", children: [
|
|
2154
|
+
/* @__PURE__ */ o("strong", { children: "Webhook URL" }),
|
|
1786
2155
|
" — the address a third party posts to."
|
|
1787
2156
|
] }),
|
|
1788
|
-
u && /* @__PURE__ */
|
|
1789
|
-
|
|
2157
|
+
u && /* @__PURE__ */ o("div", { className: "w6w-result w6w-error", children: u }),
|
|
2158
|
+
a != null && a.webhookUrl ? /* @__PURE__ */ o(Fs, { value: a.webhookUrl, readOnly: !0, children: /* @__PURE__ */ o("input", { type: "text", readOnly: !0, value: a.webhookUrl, "aria-label": "Webhook URL" }) }) : a === void 0 ? /* @__PURE__ */ o("p", { className: "w6w-muted w6w-small", children: "Loading…" }) : !s && /* @__PURE__ */ o("button", { type: "button", className: "w6w-btn", disabled: N, onClick: h, children: N ? "Creating…" : "Create webhook URL" })
|
|
1790
2159
|
] });
|
|
1791
2160
|
}
|
|
1792
|
-
function
|
|
2161
|
+
function rn({
|
|
1793
2162
|
anchorRef: e,
|
|
1794
|
-
onClose:
|
|
1795
|
-
children:
|
|
2163
|
+
onClose: t,
|
|
2164
|
+
children: s
|
|
1796
2165
|
}) {
|
|
1797
|
-
const r =
|
|
1798
|
-
return
|
|
1799
|
-
const
|
|
1800
|
-
if (!
|
|
1801
|
-
const
|
|
1802
|
-
|
|
1803
|
-
}, [e]),
|
|
1804
|
-
function
|
|
1805
|
-
var
|
|
1806
|
-
const
|
|
1807
|
-
(
|
|
2166
|
+
const r = Ce(null), [a, c] = S(null), [u, b] = S(null);
|
|
2167
|
+
return z(() => {
|
|
2168
|
+
const N = e.current;
|
|
2169
|
+
if (!N) return;
|
|
2170
|
+
const C = N.getBoundingClientRect();
|
|
2171
|
+
c({ top: C.bottom + 6, left: C.left, width: C.width }), b(N.closest("dialog") ?? document.body);
|
|
2172
|
+
}, [e]), z(() => {
|
|
2173
|
+
function N(h) {
|
|
2174
|
+
var l, x;
|
|
2175
|
+
const k = h.target;
|
|
2176
|
+
(l = r.current) != null && l.contains(k) || (x = e.current) != null && x.contains(k) || t();
|
|
1808
2177
|
}
|
|
1809
|
-
function
|
|
1810
|
-
|
|
2178
|
+
function C(h) {
|
|
2179
|
+
h.key === "Escape" && t();
|
|
1811
2180
|
}
|
|
1812
|
-
return document.addEventListener("mousedown",
|
|
1813
|
-
document.removeEventListener("mousedown",
|
|
2181
|
+
return document.addEventListener("mousedown", N), document.addEventListener("keydown", C), () => {
|
|
2182
|
+
document.removeEventListener("mousedown", N), document.removeEventListener("keydown", C);
|
|
1814
2183
|
};
|
|
1815
|
-
}, [
|
|
1816
|
-
/* @__PURE__ */
|
|
2184
|
+
}, [t, e]), !a || !u ? null : Qn(
|
|
2185
|
+
/* @__PURE__ */ o(
|
|
1817
2186
|
"div",
|
|
1818
2187
|
{
|
|
1819
2188
|
ref: r,
|
|
1820
2189
|
className: "w6w-flyout",
|
|
1821
|
-
style: { top:
|
|
1822
|
-
children:
|
|
2190
|
+
style: { top: a.top, left: a.left, width: a.width },
|
|
2191
|
+
children: s
|
|
1823
2192
|
}
|
|
1824
2193
|
),
|
|
1825
2194
|
u
|
|
1826
2195
|
);
|
|
1827
2196
|
}
|
|
1828
|
-
function
|
|
2197
|
+
function Eo({
|
|
1829
2198
|
step: e,
|
|
1830
|
-
app:
|
|
1831
|
-
actions:
|
|
2199
|
+
app: t,
|
|
2200
|
+
actions: s,
|
|
1832
2201
|
conns: r,
|
|
2202
|
+
connsFailed: a,
|
|
1833
2203
|
isInternal: c,
|
|
1834
|
-
readOnly:
|
|
1835
|
-
onChangeAction:
|
|
1836
|
-
onChangeConnection:
|
|
2204
|
+
readOnly: u,
|
|
2205
|
+
onChangeAction: b,
|
|
2206
|
+
onChangeConnection: N,
|
|
1837
2207
|
onChangeApp: C,
|
|
1838
|
-
onConnectionCreated:
|
|
2208
|
+
onConnectionCreated: h
|
|
1839
2209
|
}) {
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
/* @__PURE__ */
|
|
1845
|
-
|
|
1846
|
-
/* @__PURE__ */ w(
|
|
2210
|
+
const [k, l] = S(null), [x, D] = S(!1), T = Ce(null), _ = ho(e.uses.connection, r, a);
|
|
2211
|
+
return /* @__PURE__ */ m("div", { className: "w6w-stack", children: [
|
|
2212
|
+
/* @__PURE__ */ m("div", { className: "w6w-field", children: [
|
|
2213
|
+
/* @__PURE__ */ o("span", { children: "App" }),
|
|
2214
|
+
/* @__PURE__ */ m("div", { className: "w6w-app-conn-row", ref: T, children: [
|
|
2215
|
+
/* @__PURE__ */ m(
|
|
1847
2216
|
"button",
|
|
1848
2217
|
{
|
|
1849
2218
|
type: "button",
|
|
1850
2219
|
className: "w6w-app-conn-btn",
|
|
1851
2220
|
"aria-label": "App",
|
|
1852
|
-
"aria-expanded":
|
|
1853
|
-
disabled:
|
|
1854
|
-
onClick: () =>
|
|
2221
|
+
"aria-expanded": k === "app",
|
|
2222
|
+
disabled: u,
|
|
2223
|
+
onClick: () => l((A) => A === "app" ? null : "app"),
|
|
1855
2224
|
children: [
|
|
1856
|
-
!c &&
|
|
1857
|
-
|
|
2225
|
+
!c && t && /* @__PURE__ */ o(
|
|
2226
|
+
lt,
|
|
1858
2227
|
{
|
|
1859
|
-
src:
|
|
1860
|
-
srcDark:
|
|
1861
|
-
brandColor:
|
|
1862
|
-
name:
|
|
2228
|
+
src: t.iconSvg,
|
|
2229
|
+
srcDark: t.iconSvgDark,
|
|
2230
|
+
brandColor: t.brandColor,
|
|
2231
|
+
name: t.displayName,
|
|
1863
2232
|
size: 20
|
|
1864
2233
|
}
|
|
1865
2234
|
),
|
|
1866
|
-
/* @__PURE__ */
|
|
2235
|
+
/* @__PURE__ */ o("span", { className: "w6w-conn-label-name", children: c ? e.uses.app : (t == null ? void 0 : t.displayName) ?? e.uses.app })
|
|
1867
2236
|
]
|
|
1868
2237
|
}
|
|
1869
2238
|
),
|
|
1870
|
-
!c && /* @__PURE__ */
|
|
2239
|
+
!c && /* @__PURE__ */ o(
|
|
1871
2240
|
"button",
|
|
1872
2241
|
{
|
|
1873
2242
|
type: "button",
|
|
1874
2243
|
className: "w6w-app-conn-btn",
|
|
1875
2244
|
"aria-label": "Connection",
|
|
1876
|
-
"aria-expanded":
|
|
1877
|
-
disabled:
|
|
1878
|
-
onClick: () =>
|
|
1879
|
-
children: /* @__PURE__ */
|
|
2245
|
+
"aria-expanded": k === "conn",
|
|
2246
|
+
disabled: u,
|
|
2247
|
+
onClick: () => l((A) => A === "conn" ? null : "conn"),
|
|
2248
|
+
children: /* @__PURE__ */ o("span", { className: "w6w-conn-label-name", children: _ })
|
|
1880
2249
|
}
|
|
1881
2250
|
)
|
|
1882
2251
|
] }),
|
|
1883
|
-
|
|
1884
|
-
|
|
2252
|
+
k === "app" && /* @__PURE__ */ o(rn, { anchorRef: T, onClose: () => l(null), children: /* @__PURE__ */ o(
|
|
2253
|
+
Is,
|
|
1885
2254
|
{
|
|
1886
|
-
onSelectApp: (
|
|
1887
|
-
const
|
|
1888
|
-
C(
|
|
2255
|
+
onSelectApp: (A) => {
|
|
2256
|
+
const w = A.id === e.uses.app;
|
|
2257
|
+
C(A.id), l(w ? "conn" : null);
|
|
1889
2258
|
}
|
|
1890
2259
|
}
|
|
1891
2260
|
) }),
|
|
1892
|
-
|
|
1893
|
-
/* @__PURE__ */
|
|
2261
|
+
k === "conn" && /* @__PURE__ */ o(rn, { anchorRef: T, onClose: () => l(null), children: /* @__PURE__ */ m("div", { className: "w6w-stack", children: [
|
|
2262
|
+
/* @__PURE__ */ o("div", { className: "w6w-stepbuilder-list", children: (r ?? []).map((A) => /* @__PURE__ */ o(
|
|
1894
2263
|
"button",
|
|
1895
2264
|
{
|
|
1896
2265
|
type: "button",
|
|
1897
2266
|
className: "w6w-stepbuilder-item",
|
|
1898
2267
|
onClick: () => {
|
|
1899
|
-
|
|
2268
|
+
N(A.id), l(null);
|
|
1900
2269
|
},
|
|
1901
|
-
children: /* @__PURE__ */
|
|
1902
|
-
/* @__PURE__ */
|
|
1903
|
-
|
|
2270
|
+
children: /* @__PURE__ */ m("span", { className: "w6w-stepbuilder-item-main", children: [
|
|
2271
|
+
/* @__PURE__ */ o("strong", { children: A.displayName || A.id }),
|
|
2272
|
+
A.state && /* @__PURE__ */ o("span", { className: "w6w-muted w6w-small", children: A.state })
|
|
1904
2273
|
] })
|
|
1905
2274
|
},
|
|
1906
|
-
|
|
2275
|
+
A.id
|
|
1907
2276
|
)) }),
|
|
1908
|
-
/* @__PURE__ */
|
|
2277
|
+
/* @__PURE__ */ o(
|
|
1909
2278
|
"button",
|
|
1910
2279
|
{
|
|
1911
2280
|
type: "button",
|
|
1912
2281
|
className: "w6w-btn",
|
|
1913
|
-
disabled:
|
|
2282
|
+
disabled: u,
|
|
1914
2283
|
onClick: () => {
|
|
1915
|
-
|
|
2284
|
+
D(!0), l(null);
|
|
1916
2285
|
},
|
|
1917
2286
|
children: "+ New connection"
|
|
1918
2287
|
}
|
|
1919
2288
|
)
|
|
1920
2289
|
] }) })
|
|
1921
2290
|
] }),
|
|
1922
|
-
!c &&
|
|
1923
|
-
|
|
2291
|
+
!c && x && /* @__PURE__ */ o(
|
|
2292
|
+
Ds,
|
|
1924
2293
|
{
|
|
1925
2294
|
initialAppId: e.uses.app,
|
|
1926
|
-
onClose: () =>
|
|
1927
|
-
onCreated: ({ connectionId:
|
|
1928
|
-
|
|
2295
|
+
onClose: () => D(!1),
|
|
2296
|
+
onCreated: ({ connectionId: A }) => {
|
|
2297
|
+
D(!1), N(A), h(), l(null);
|
|
1929
2298
|
}
|
|
1930
2299
|
}
|
|
1931
2300
|
),
|
|
1932
|
-
c ? /* @__PURE__ */
|
|
1933
|
-
/* @__PURE__ */
|
|
1934
|
-
/* @__PURE__ */
|
|
2301
|
+
c ? /* @__PURE__ */ m("div", { className: "w6w-field", children: [
|
|
2302
|
+
/* @__PURE__ */ o("span", { children: "Action" }),
|
|
2303
|
+
/* @__PURE__ */ o("div", { className: "w6w-muted w6w-small", children: /* @__PURE__ */ o("code", { children: e.uses.action }) })
|
|
1935
2304
|
] }) : (
|
|
1936
2305
|
// biome-ignore lint/a11y/noLabelWithoutControl: Combobox renders its own <select>/<input> INSIDE this label, so the field text labels the control at runtime; the rule cannot see through the component boundary.
|
|
1937
|
-
/* @__PURE__ */
|
|
1938
|
-
/* @__PURE__ */
|
|
1939
|
-
/* @__PURE__ */
|
|
1940
|
-
|
|
2306
|
+
/* @__PURE__ */ m("label", { className: "w6w-field", children: [
|
|
2307
|
+
/* @__PURE__ */ o("span", { children: "Action" }),
|
|
2308
|
+
/* @__PURE__ */ o(
|
|
2309
|
+
Ls,
|
|
1941
2310
|
{
|
|
1942
2311
|
value: e.uses.action,
|
|
1943
|
-
disabled:
|
|
1944
|
-
onChange:
|
|
1945
|
-
options:
|
|
2312
|
+
disabled: u || s === null,
|
|
2313
|
+
onChange: b,
|
|
2314
|
+
options: s === null ? [{ value: e.uses.action, label: e.uses.action }] : s.map((A) => ({ value: A.key, label: A.title ?? A.key }))
|
|
1946
2315
|
}
|
|
1947
2316
|
)
|
|
1948
2317
|
] })
|
|
@@ -1950,29 +2319,41 @@ function Ds({
|
|
|
1950
2319
|
] });
|
|
1951
2320
|
}
|
|
1952
2321
|
export {
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
2322
|
+
ks as CALL_APP,
|
|
2323
|
+
Vo as CONTROL_APP,
|
|
2324
|
+
bs as CanvasLayer,
|
|
2325
|
+
$o as DATA_APP,
|
|
2326
|
+
gs as ExpressionOptionsProvider,
|
|
2327
|
+
_o as INTERNAL_NODES,
|
|
2328
|
+
Vs as MAX_NOTES,
|
|
2329
|
+
_s as MAX_NOTE_BYTES,
|
|
2330
|
+
$s as MAX_SECTIONS,
|
|
2331
|
+
Wo as Markdown,
|
|
2332
|
+
Bo as SCHEDULER_APP,
|
|
2333
|
+
Jo as SCRIPT_APP,
|
|
2334
|
+
zo as TRIGGER_APP,
|
|
2335
|
+
rt as WEBHOOK_APP,
|
|
2336
|
+
Lo as WorkflowFlowEditor,
|
|
2337
|
+
Ut as asFieldDefs,
|
|
2338
|
+
Gt as assignMembership,
|
|
2339
|
+
Yt as clampCanvas,
|
|
2340
|
+
Ho as coerceDefault,
|
|
2341
|
+
jo as fieldWidget,
|
|
2342
|
+
Rs as fieldsToParams,
|
|
2343
|
+
$t as flowToWorkflow,
|
|
2344
|
+
Oo as internalNodeDefaults,
|
|
2345
|
+
pn as internalNodeIcon,
|
|
2346
|
+
dn as internalNodeLabel,
|
|
2347
|
+
wn as internalNodeParams,
|
|
2348
|
+
Be as isControlApp,
|
|
2349
|
+
Je as isInternalApp,
|
|
2350
|
+
Ie as isTriggerApp,
|
|
2351
|
+
Xt as pruneSectionMembers,
|
|
2352
|
+
zs as renameSectionMember,
|
|
2353
|
+
qt as roundGeometry,
|
|
2354
|
+
Hs as sectionsContaining,
|
|
2355
|
+
Ts as seedValues,
|
|
2356
|
+
Js as withCanvasGeometry,
|
|
2357
|
+
rs as workflowToFlow
|
|
1977
2358
|
};
|
|
1978
2359
|
//# sourceMappingURL=flow.mjs.map
|