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