@w6w/embed 0.2.19 → 0.2.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{WorkflowEditor-CmhXHRxi.js → WorkflowEditor-Cgv3Pvsy.js} +194 -186
- package/dist/{WorkflowEditor-CmhXHRxi.js.map → WorkflowEditor-Cgv3Pvsy.js.map} +1 -1
- package/dist/{apps-ItBvnWX3.js → apps-CYUgEfGf.js} +2 -2
- package/dist/{apps-ItBvnWX3.js.map → apps-CYUgEfGf.js.map} +1 -1
- package/dist/editor/types.d.ts +2 -0
- package/dist/{editor-apps-DkkC7wOQ.js → editor-apps-LZmDWMqf.js} +3 -3
- package/dist/{editor-apps-DkkC7wOQ.js.map → editor-apps-LZmDWMqf.js.map} +1 -1
- package/dist/{editor-tools-BR27RGto.js → editor-tools-j3ThBY_4.js} +3 -3
- package/dist/{editor-tools-BR27RGto.js.map → editor-tools-j3ThBY_4.js.map} +1 -1
- package/dist/editor.mjs +1 -1
- package/dist/editors.mjs +7 -7
- package/dist/index.mjs +1 -1
- package/dist/lists.mjs +3 -3
- package/dist/rail.mjs +1 -1
- package/dist/repos/connections.d.ts +1 -0
- package/dist/repos/workflows.d.ts +1 -1
- package/dist/repos.mjs +3 -3
- package/dist/{spec-export-DGy5ijps.js → spec-export-DGigBUsP.js} +2 -2
- package/dist/{spec-export-DGy5ijps.js.map → spec-export-DGigBUsP.js.map} +1 -1
- package/dist/{workflows-BZN4Hyz1.js → workflows-BK6IM4if.js} +3 -3
- package/dist/{workflows-BZN4Hyz1.js.map → workflows-BK6IM4if.js.map} +1 -1
- package/package.json +3 -3
|
@@ -2,11 +2,11 @@ import { jsxs as g, jsx as a, Fragment as le } from "react/jsx-runtime";
|
|
|
2
2
|
import { useQueryClient as Ot, useQueries as Re } from "@tanstack/react-query";
|
|
3
3
|
import { ApiError as Ce } from "@w6w/sdk";
|
|
4
4
|
import { Modal as fn, IconButton as ce, JsonEditor as pn, useExpressionOptions as hn, ExpressionEditorModal as mn, useW6WApi as It, W6WUIProvider as bn, isTestRequired as Ct, requiredParamsFilled as gn, ExecutionLogPanel as yn, testInputSavesSettled as vn } from "@w6w/ui";
|
|
5
|
-
import { useState as
|
|
6
|
-
import { E as En, $ as Rn, W as Cn, Q as Pn, V as An, q as Tn, X as jn, v as On, B as In, A as Fn, N as Ln, a as Mn, z as Jn, n as Dn, y as Bn, t as Wn, b as $n } from "./workflows-
|
|
7
|
-
import { H as xn, a as Kn } from "./editor-apps-
|
|
5
|
+
import { useState as v, useMemo as w, createElement as J, useId as wn, useCallback as E, useContext as Sn, useRef as S, useEffect as T, Suspense as kn, lazy as Nn } from "react";
|
|
6
|
+
import { E as En, $ as Rn, W as Cn, Q as Pn, V as An, q as Tn, X as jn, v as On, B as In, A as Fn, N as Ln, a as Mn, z as Jn, n as Dn, y as Bn, t as Wn, b as $n } from "./workflows-BK6IM4if.js";
|
|
7
|
+
import { H as xn, a as Kn } from "./editor-apps-LZmDWMqf.js";
|
|
8
8
|
import { M as ue } from "./ConfirmModal-Pv2-A_3U.js";
|
|
9
|
-
import { d as Qn, W as _n, e as qn, R as
|
|
9
|
+
import { d as Qn, W as _n, e as qn, R as Hn, P as Vn, b as zn, c as Gn } from "./editor-tools-j3ThBY_4.js";
|
|
10
10
|
import { u as Yn } from "./client-context-CX61Bgw-.js";
|
|
11
11
|
import { u as Un } from "./use-workflow-draft-l3P5KZzw.js";
|
|
12
12
|
import { r as Xn, h as Zn, e as es, f as ts, a as ns, d as ss, b as os, p as is, i as rs, g as as } from "./setup-incomplete-BHs3Lpfy.js";
|
|
@@ -15,15 +15,15 @@ import { n as At } from "./import-bindings-EUtxZ9Ti.js";
|
|
|
15
15
|
import { p as ds, d as fs } from "./settings-rail--GdRMusb.js";
|
|
16
16
|
import { u as ps, b as hs } from "./project-context-Tvp-La7A.js";
|
|
17
17
|
import { i as ms, d as Tt } from "./connections-CzsCyIxY.js";
|
|
18
|
-
import { h as bs, b as gs, g as ys, d as vs, u as ws, e as Ss } from "./spec-export-
|
|
18
|
+
import { h as bs, b as gs, g as ys, d as vs, u as ws, e as Ss } from "./spec-export-DGigBUsP.js";
|
|
19
19
|
import { l as jt, a as Pe, w as ks } from "./step-tests-B4E4W3ly.js";
|
|
20
20
|
import { i as Ns, f as Es } from "./vault-BSEWhMYC.js";
|
|
21
21
|
import { i as Rs } from "./data-stores-UeQvwVCa.js";
|
|
22
|
-
import { e as Cs } from "./apps-
|
|
22
|
+
import { e as Cs } from "./apps-CYUgEfGf.js";
|
|
23
23
|
import { E as Ps } from "./theme-context-E2ZhlXDX.js";
|
|
24
24
|
import { validateInitialState as As } from "@w6w/expr";
|
|
25
|
-
function Ts({ title:
|
|
26
|
-
const { value: e, placeholder: r, maxLength: i, ariaLabel:
|
|
25
|
+
function Ts({ title: n }) {
|
|
26
|
+
const { value: e, placeholder: r, maxLength: i, ariaLabel: s, onChange: l, onBlur: u } = n;
|
|
27
27
|
return /* @__PURE__ */ a(
|
|
28
28
|
"input",
|
|
29
29
|
{
|
|
@@ -32,18 +32,18 @@ function Ts({ title: s }) {
|
|
|
32
32
|
placeholder: r,
|
|
33
33
|
maxLength: i,
|
|
34
34
|
size: Math.min(Math.max(e.length, r.length), 80),
|
|
35
|
-
"aria-label":
|
|
35
|
+
"aria-label": s,
|
|
36
36
|
onChange: (d) => l(d.target.value),
|
|
37
37
|
onBlur: u
|
|
38
38
|
}
|
|
39
39
|
);
|
|
40
40
|
}
|
|
41
41
|
function js({
|
|
42
|
-
onBack:
|
|
42
|
+
onBack: n,
|
|
43
43
|
backLabel: e,
|
|
44
44
|
title: r,
|
|
45
45
|
titleAdornment: i,
|
|
46
|
-
actions:
|
|
46
|
+
actions: s
|
|
47
47
|
}) {
|
|
48
48
|
return /* @__PURE__ */ g("div", { className: "wf-fullbleed-head", children: [
|
|
49
49
|
e !== null && /* @__PURE__ */ a(
|
|
@@ -52,7 +52,7 @@ function js({
|
|
|
52
52
|
type: "button",
|
|
53
53
|
className: "muted wf-back-btn",
|
|
54
54
|
"data-testid": "wf-editor-back",
|
|
55
|
-
onClick:
|
|
55
|
+
onClick: n,
|
|
56
56
|
children: e
|
|
57
57
|
}
|
|
58
58
|
),
|
|
@@ -63,18 +63,18 @@ function js({
|
|
|
63
63
|
] }),
|
|
64
64
|
/* @__PURE__ */ g("div", { className: "wf-head-actions", style: { marginLeft: "auto" }, children: [
|
|
65
65
|
r.editable && i,
|
|
66
|
-
|
|
66
|
+
s
|
|
67
67
|
] })
|
|
68
68
|
] });
|
|
69
69
|
}
|
|
70
|
-
function Os(
|
|
71
|
-
if (!(
|
|
70
|
+
function Os(n, e, r) {
|
|
71
|
+
if (!(n !== "workflow" || e === void 0))
|
|
72
72
|
return (i) => {
|
|
73
73
|
r(), e(i.id);
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
|
-
function Is(
|
|
77
|
-
const { kind: e, id: r, onClose: i, onOpenRun:
|
|
76
|
+
function Is(n) {
|
|
77
|
+
const { kind: e, id: r, onClose: i, onOpenRun: s } = n, [l, u] = v(En), d = Os(e, s, i);
|
|
78
78
|
return /* @__PURE__ */ a(
|
|
79
79
|
fn,
|
|
80
80
|
{
|
|
@@ -96,29 +96,29 @@ function Is(s) {
|
|
|
96
96
|
}
|
|
97
97
|
);
|
|
98
98
|
}
|
|
99
|
-
function Fs(
|
|
100
|
-
return /* @__PURE__ */ a(ce, { icon: "json", onClick:
|
|
99
|
+
function Fs(n) {
|
|
100
|
+
return /* @__PURE__ */ a(ce, { icon: "json", onClick: n.onClick, label: "Edit raw JSON definition" });
|
|
101
101
|
}
|
|
102
|
-
function Ls(
|
|
103
|
-
return
|
|
102
|
+
function Ls(n) {
|
|
103
|
+
return n.open ? n.mode === "apply" ? /* @__PURE__ */ a(Ms, { ...n }) : /* @__PURE__ */ a(Js, { ...n }) : null;
|
|
104
104
|
}
|
|
105
|
-
function Ft(
|
|
105
|
+
function Ft(n) {
|
|
106
106
|
return /* @__PURE__ */ a("div", { className: "json-toggle-editor", children: /* @__PURE__ */ a(
|
|
107
107
|
pn,
|
|
108
108
|
{
|
|
109
|
-
value:
|
|
110
|
-
onChange:
|
|
109
|
+
value: n.value,
|
|
110
|
+
onChange: n.onChange,
|
|
111
111
|
minHeight: "120px",
|
|
112
|
-
"aria-label":
|
|
112
|
+
"aria-label": n.label
|
|
113
113
|
}
|
|
114
114
|
) });
|
|
115
115
|
}
|
|
116
|
-
function Ms(
|
|
117
|
-
const { onClose: e, title: r, value: i, prepareApply:
|
|
118
|
-
() => (
|
|
119
|
-
[
|
|
116
|
+
function Ms(n) {
|
|
117
|
+
const { onClose: e, title: r, value: i, prepareApply: s, onApply: l, editorLabel: u } = n, [d, y] = v(i), [h, m] = v(i), [j, z] = v([]), [de, I] = v(!1), C = w(
|
|
118
|
+
() => (s == null ? void 0 : s(d)) ?? { ok: !0, text: d, restored: [] },
|
|
119
|
+
[s, d]
|
|
120
120
|
), D = d !== h, G = () => D ? I(!0) : e(), Y = () => {
|
|
121
|
-
!C.ok || !D || (l == null || l(C.text),
|
|
121
|
+
!C.ok || !D || (l == null || l(C.text), y(C.text), m(C.text), z(C.restored), I(!1));
|
|
122
122
|
};
|
|
123
123
|
return /* @__PURE__ */ g(ue, { title: r, onClose: G, wide: !0, className: "modal-json", children: [
|
|
124
124
|
/* @__PURE__ */ g("div", { className: "modal-body", children: [
|
|
@@ -132,7 +132,7 @@ function Ms(s) {
|
|
|
132
132
|
{
|
|
133
133
|
value: d,
|
|
134
134
|
onChange: (U) => {
|
|
135
|
-
|
|
135
|
+
y(U), I(!1);
|
|
136
136
|
},
|
|
137
137
|
label: u
|
|
138
138
|
}
|
|
@@ -185,14 +185,14 @@ function Ms(s) {
|
|
|
185
185
|
] }) })
|
|
186
186
|
] });
|
|
187
187
|
}
|
|
188
|
-
function Js(
|
|
189
|
-
const { onClose: e, title: r, value: i, onChange:
|
|
188
|
+
function Js(n) {
|
|
189
|
+
const { onClose: e, title: r, value: i, onChange: s, guard: l, onSave: u, saving: d, error: y, editorLabel: h } = n, m = (l == null ? void 0 : l(i)) ?? null;
|
|
190
190
|
return /* @__PURE__ */ g(ue, { title: r, onClose: e, wide: !0, className: "modal-json", children: [
|
|
191
191
|
/* @__PURE__ */ g("div", { className: "modal-body", children: [
|
|
192
192
|
/* @__PURE__ */ a("p", { className: "muted small", children: "Save replaces the stored definition." }),
|
|
193
|
-
/* @__PURE__ */ a(Ft, { value: i, onChange: (j) =>
|
|
193
|
+
/* @__PURE__ */ a(Ft, { value: i, onChange: (j) => s == null ? void 0 : s(j), label: h }),
|
|
194
194
|
m && /* @__PURE__ */ a("p", { className: "muted small", "data-testid": "json-toggle-reason", children: m }),
|
|
195
|
-
|
|
195
|
+
y && /* @__PURE__ */ a("div", { className: "error", children: y })
|
|
196
196
|
] }),
|
|
197
197
|
/* @__PURE__ */ g("div", { className: "modal-actions", children: [
|
|
198
198
|
/* @__PURE__ */ a("button", { type: "button", className: "btn ghost", onClick: e, children: "Cancel" }),
|
|
@@ -210,18 +210,18 @@ function Js(s) {
|
|
|
210
210
|
] })
|
|
211
211
|
] });
|
|
212
212
|
}
|
|
213
|
-
function Ds(
|
|
214
|
-
const r = (
|
|
215
|
-
Object.entries(
|
|
216
|
-
) :
|
|
217
|
-
if (
|
|
218
|
-
const { status: l, ...u } =
|
|
213
|
+
function Ds(n, e) {
|
|
214
|
+
const r = (s) => Array.isArray(s) ? s.map(r) : s !== null && typeof s == "object" ? Object.fromEntries(
|
|
215
|
+
Object.entries(s).sort(([l], [u]) => l.localeCompare(u)).map(([l, u]) => [l, r(u)])
|
|
216
|
+
) : s, i = (s) => {
|
|
217
|
+
if (s === null || typeof s != "object" || Array.isArray(s)) return s;
|
|
218
|
+
const { status: l, ...u } = s;
|
|
219
219
|
return { ...u, key: u.key ?? null, tags: u.tags ?? [] };
|
|
220
220
|
};
|
|
221
|
-
return JSON.stringify(r(i(
|
|
221
|
+
return JSON.stringify(r(i(n))) === JSON.stringify(r(i(e)));
|
|
222
222
|
}
|
|
223
|
-
function Bs(
|
|
224
|
-
const { kind: e, problemCount: r, canEnable: i, onEnable:
|
|
223
|
+
function Bs(n) {
|
|
224
|
+
const { kind: e, problemCount: r, canEnable: i, onEnable: s, pending: l } = n, u = r > 0 ? `This ${e} is disabled and ${r} ${r === 1 ? "step uses" : "steps use"} a connection that no longer exists. Choose another connection, save, then Enable.` : "Connections fixed. Enable to run again.";
|
|
225
225
|
return J(
|
|
226
226
|
"div",
|
|
227
227
|
{ role: "alert", className: "error", "data-testid": "binding-disabled-banner" },
|
|
@@ -233,32 +233,32 @@ function Bs(s) {
|
|
|
233
233
|
type: "button",
|
|
234
234
|
"data-testid": "binding-enable",
|
|
235
235
|
disabled: !i || l === !0,
|
|
236
|
-
onClick:
|
|
236
|
+
onClick: s
|
|
237
237
|
},
|
|
238
238
|
"Enable"
|
|
239
239
|
)
|
|
240
240
|
);
|
|
241
241
|
}
|
|
242
242
|
function Ws({
|
|
243
|
-
project:
|
|
243
|
+
project: n,
|
|
244
244
|
onNavigate: e,
|
|
245
245
|
rail: r = !0,
|
|
246
246
|
storageKey: i,
|
|
247
|
-
tools:
|
|
247
|
+
tools: s = qn,
|
|
248
248
|
children: l
|
|
249
249
|
}) {
|
|
250
|
-
const u = Qn(), d = /* @__PURE__ */ a(
|
|
250
|
+
const u = Qn(), d = /* @__PURE__ */ a(Hn, { project: n, onNavigate: e, children: /* @__PURE__ */ g(Vn, { project: n, children: [
|
|
251
251
|
l,
|
|
252
|
-
r && /* @__PURE__ */ a(zn, { tools:
|
|
252
|
+
r && /* @__PURE__ */ a(zn, { tools: s, storageKey: i })
|
|
253
253
|
] }) });
|
|
254
254
|
return r || !u ? /* @__PURE__ */ a(_n, { children: d }) : d;
|
|
255
255
|
}
|
|
256
256
|
function $s({
|
|
257
|
-
message:
|
|
257
|
+
message: n,
|
|
258
258
|
disabled: e = !1,
|
|
259
259
|
children: r
|
|
260
260
|
}) {
|
|
261
|
-
const i = wn(), [
|
|
261
|
+
const i = wn(), [s, l] = v(!1);
|
|
262
262
|
return /* @__PURE__ */ g(
|
|
263
263
|
"fieldset",
|
|
264
264
|
{
|
|
@@ -277,22 +277,22 @@ function $s({
|
|
|
277
277
|
},
|
|
278
278
|
children: [
|
|
279
279
|
r(i),
|
|
280
|
-
|
|
280
|
+
s && /* @__PURE__ */ a("span", { id: i, role: "tooltip", className: "wf-publish-hint", children: n })
|
|
281
281
|
]
|
|
282
282
|
}
|
|
283
283
|
);
|
|
284
284
|
}
|
|
285
|
-
function xs(
|
|
286
|
-
const { problems: e, nodeLabel: r } =
|
|
285
|
+
function xs(n) {
|
|
286
|
+
const { problems: e, nodeLabel: r } = n, i = Object.entries(e).filter(([, l]) => l.length > 0);
|
|
287
287
|
if (i.length === 0) return null;
|
|
288
|
-
const
|
|
288
|
+
const s = i.length;
|
|
289
289
|
return J(
|
|
290
290
|
"div",
|
|
291
291
|
{ role: "status", className: "error", "data-testid": "setup-incomplete-banner" },
|
|
292
292
|
J(
|
|
293
293
|
"span",
|
|
294
294
|
null,
|
|
295
|
-
`Setup incomplete: ${
|
|
295
|
+
`Setup incomplete: ${s} ${s === 1 ? "step needs" : "steps need"} attention. The workflow can still run.`
|
|
296
296
|
),
|
|
297
297
|
J(
|
|
298
298
|
"ul",
|
|
@@ -308,7 +308,7 @@ const Ks = {
|
|
|
308
308
|
not_object: 'Starting state must be a JSON object, like {"region": "us"}. Not saved.',
|
|
309
309
|
too_large: "Starting state is over the 64 KiB limit. Not saved."
|
|
310
310
|
};
|
|
311
|
-
function Qs(
|
|
311
|
+
function Qs(n) {
|
|
312
312
|
const e = hn();
|
|
313
313
|
return /* @__PURE__ */ a(
|
|
314
314
|
mn,
|
|
@@ -319,153 +319,153 @@ function Qs(s) {
|
|
|
319
319
|
fieldLabel: "initialState",
|
|
320
320
|
value: void 0,
|
|
321
321
|
options: e,
|
|
322
|
-
jsonValue:
|
|
322
|
+
jsonValue: n.initialState,
|
|
323
323
|
jsonProblem: (r) => {
|
|
324
324
|
const i = Pt(r);
|
|
325
325
|
if (!i.ok) return Ks[i.reason];
|
|
326
|
-
const
|
|
327
|
-
return
|
|
326
|
+
const s = i.value === void 0 ? void 0 : As(i.value)[0];
|
|
327
|
+
return s ? `${s.message} Not saved.` : null;
|
|
328
328
|
},
|
|
329
329
|
onSaveJson: (r) => {
|
|
330
330
|
const i = Pt(r === void 0 ? "" : JSON.stringify(r));
|
|
331
|
-
i.ok &&
|
|
331
|
+
i.ok && n.onChange(i.value);
|
|
332
332
|
},
|
|
333
|
-
onClose:
|
|
333
|
+
onClose: n.onClose
|
|
334
334
|
}
|
|
335
335
|
);
|
|
336
336
|
}
|
|
337
337
|
const Lt = /^[a-zA-Z0-9][a-zA-Z0-9._-]*$/, _s = "Untitled workflow", qs = ["id", "key", "manifestVersion"];
|
|
338
|
-
function
|
|
338
|
+
function Hs(n) {
|
|
339
339
|
let e = 0;
|
|
340
340
|
const r = () => {
|
|
341
|
-
for (; e <
|
|
342
|
-
\r`.includes(
|
|
341
|
+
for (; e < n.length && `
|
|
342
|
+
\r`.includes(n[e]); ) e++;
|
|
343
343
|
}, i = () => {
|
|
344
344
|
throw e;
|
|
345
|
-
},
|
|
345
|
+
}, s = (h) => {
|
|
346
346
|
for (const m of h)
|
|
347
|
-
|
|
347
|
+
n[e] !== m && i(), e++;
|
|
348
348
|
}, l = () => {
|
|
349
|
-
for (e++;
|
|
350
|
-
const h =
|
|
349
|
+
for (e++; n[e] !== '"'; ) {
|
|
350
|
+
const h = n[e];
|
|
351
351
|
if ((h === void 0 || h < " ") && i(), h === "\\")
|
|
352
|
-
if (e++,
|
|
352
|
+
if (e++, n[e] === "u")
|
|
353
353
|
for (let m = 0; m < 4; m++)
|
|
354
|
-
e++, /[0-9a-fA-F]/.test(
|
|
355
|
-
else '"\\/bfnrt'.includes(
|
|
354
|
+
e++, /[0-9a-fA-F]/.test(n[e] ?? "") || i();
|
|
355
|
+
else '"\\/bfnrt'.includes(n[e] ?? "x") || i();
|
|
356
356
|
e++;
|
|
357
357
|
}
|
|
358
358
|
e++;
|
|
359
359
|
}, u = /-?(0|[1-9]\d*)(\.\d+)?([eE][+-]?\d+)?/y, d = () => {
|
|
360
|
-
u.lastIndex = e, u.test(
|
|
361
|
-
},
|
|
360
|
+
u.lastIndex = e, u.test(n) || i(), e = u.lastIndex;
|
|
361
|
+
}, y = () => {
|
|
362
362
|
r();
|
|
363
|
-
const h =
|
|
363
|
+
const h = n[e];
|
|
364
364
|
if (h === "{" || h === "[") {
|
|
365
365
|
const m = h === "{" ? "}" : "]";
|
|
366
|
-
if (e++, r(),
|
|
366
|
+
if (e++, r(), n[e] === m) {
|
|
367
367
|
e++;
|
|
368
368
|
return;
|
|
369
369
|
}
|
|
370
370
|
for (; ; )
|
|
371
|
-
if (m === "}" && (r(),
|
|
372
|
-
else if (
|
|
371
|
+
if (m === "}" && (r(), n[e] !== '"' && i(), l(), r(), n[e] !== ":" && i(), e++), y(), r(), n[e] === ",") e++;
|
|
372
|
+
else if (n[e] === m) {
|
|
373
373
|
e++;
|
|
374
374
|
return;
|
|
375
375
|
} else i();
|
|
376
376
|
}
|
|
377
|
-
h === '"' ? l() : h === "t" ?
|
|
377
|
+
h === '"' ? l() : h === "t" ? s("true") : h === "f" ? s("false") : h === "n" ? s("null") : d();
|
|
378
378
|
};
|
|
379
379
|
try {
|
|
380
|
-
return
|
|
380
|
+
return y(), r(), e < n.length ? e : null;
|
|
381
381
|
} catch (h) {
|
|
382
|
-
return typeof h == "number" ? Math.min(h,
|
|
382
|
+
return typeof h == "number" ? Math.min(h, n.length) : 0;
|
|
383
383
|
}
|
|
384
384
|
}
|
|
385
|
-
function
|
|
386
|
-
const r = e instanceof Error ? e.message : String(e), i =
|
|
385
|
+
function Vs(n, e) {
|
|
386
|
+
const r = e instanceof Error ? e.message : String(e), i = Hs(n);
|
|
387
387
|
if (i === null) return r;
|
|
388
|
-
const
|
|
389
|
-
`).length, u = i -
|
|
388
|
+
const s = n.slice(0, i), l = s.split(`
|
|
389
|
+
`).length, u = i - s.lastIndexOf(`
|
|
390
390
|
`);
|
|
391
391
|
return `Line ${l}, column ${u}: ${r}`;
|
|
392
392
|
}
|
|
393
|
-
const ae = (
|
|
394
|
-
function zs(
|
|
395
|
-
if (typeof
|
|
396
|
-
const e =
|
|
393
|
+
const ae = (n) => typeof n == "object" && n !== null && !Array.isArray(n);
|
|
394
|
+
function zs(n) {
|
|
395
|
+
if (typeof n.name != "string" || n.name.length === 0) return "`name` is required.";
|
|
396
|
+
const e = n.nodes ?? n.steps;
|
|
397
397
|
if (!Array.isArray(e)) return "`nodes` must be an array.";
|
|
398
398
|
const r = /* @__PURE__ */ new Set();
|
|
399
399
|
for (let i = 0; i < e.length; i++) {
|
|
400
|
-
const
|
|
401
|
-
if (!ae(
|
|
402
|
-
if (typeof
|
|
400
|
+
const s = e[i];
|
|
401
|
+
if (!ae(s)) return `\`nodes[${i}]\` must be an object.`;
|
|
402
|
+
if (typeof s.id != "string" || s.id.length === 0)
|
|
403
403
|
return `\`nodes[${i}].id\` must be a non-empty string.`;
|
|
404
|
-
if (
|
|
405
|
-
if (r.has(
|
|
406
|
-
r.add(
|
|
407
|
-
const l =
|
|
404
|
+
if (s.id.includes(".")) return `Node id "${s.id}" may not contain ".".`;
|
|
405
|
+
if (r.has(s.id)) return `Node id "${s.id}" is used twice.`;
|
|
406
|
+
r.add(s.id);
|
|
407
|
+
const l = s.position;
|
|
408
408
|
if (l !== void 0 && (!ae(l) || !Number.isFinite(l.x) || !Number.isFinite(l.y)))
|
|
409
409
|
return `\`nodes[${i}].position\` must be { "x": number, "y": number }.`;
|
|
410
410
|
}
|
|
411
|
-
if (
|
|
412
|
-
if (!Array.isArray(
|
|
413
|
-
for (let i = 0; i <
|
|
414
|
-
const
|
|
415
|
-
if (!ae(
|
|
411
|
+
if (n.edges !== void 0) {
|
|
412
|
+
if (!Array.isArray(n.edges)) return "`edges` must be an array.";
|
|
413
|
+
for (let i = 0; i < n.edges.length; i++) {
|
|
414
|
+
const s = n.edges[i];
|
|
415
|
+
if (!ae(s)) return `\`edges[${i}]\` must be an object.`;
|
|
416
416
|
for (const l of ["from", "to"])
|
|
417
|
-
if (typeof
|
|
417
|
+
if (typeof s[l] != "string" || !r.has(s[l]))
|
|
418
418
|
return `\`edges[${i}].${l}\` does not name an existing node.`;
|
|
419
419
|
}
|
|
420
420
|
}
|
|
421
421
|
return null;
|
|
422
422
|
}
|
|
423
|
-
function Gs(
|
|
423
|
+
function Gs(n, e) {
|
|
424
424
|
let r;
|
|
425
425
|
try {
|
|
426
|
-
r = JSON.parse(
|
|
426
|
+
r = JSON.parse(n);
|
|
427
427
|
} catch (d) {
|
|
428
|
-
return { ok: !1, error:
|
|
428
|
+
return { ok: !1, error: Vs(n, d) };
|
|
429
429
|
}
|
|
430
430
|
if (!ae(r)) return { ok: !1, error: "The definition must be a JSON object." };
|
|
431
431
|
const i = [];
|
|
432
|
-
let
|
|
432
|
+
let s = r;
|
|
433
433
|
const l = {};
|
|
434
434
|
if (e) {
|
|
435
435
|
for (const d of qs) {
|
|
436
|
-
const
|
|
437
|
-
if (!(
|
|
438
|
-
if (i.push(d),
|
|
439
|
-
h ?
|
|
436
|
+
const y = Object.hasOwn(e, d), h = Object.hasOwn(s, d);
|
|
437
|
+
if (!(y === h && JSON.stringify(e[d]) === JSON.stringify(s[d])))
|
|
438
|
+
if (i.push(d), y)
|
|
439
|
+
h ? s = { ...s, [d]: e[d] } : l[d] = e[d];
|
|
440
440
|
else {
|
|
441
|
-
const { [d]: m, ...j } =
|
|
442
|
-
|
|
441
|
+
const { [d]: m, ...j } = s;
|
|
442
|
+
s = j;
|
|
443
443
|
}
|
|
444
444
|
}
|
|
445
|
-
|
|
445
|
+
s = { ...l, ...s };
|
|
446
446
|
}
|
|
447
|
-
if (typeof
|
|
447
|
+
if (typeof s.id == "string" && !Lt.test(s.id))
|
|
448
448
|
return { ok: !1, error: "Invalid workflow id." };
|
|
449
|
-
const u = zs(
|
|
450
|
-
return u !== null ? { ok: !1, error: u } : { ok: !0, text: i.length > 0 ? JSON.stringify(
|
|
449
|
+
const u = zs(s);
|
|
450
|
+
return u !== null ? { ok: !1, error: u } : { ok: !0, text: i.length > 0 ? JSON.stringify(s, null, 2) : n, restored: i };
|
|
451
451
|
}
|
|
452
|
-
function Ys(
|
|
453
|
-
const
|
|
454
|
-
for (const l of
|
|
452
|
+
function Ys(n, e, r, i) {
|
|
453
|
+
const s = {};
|
|
454
|
+
for (const l of n) {
|
|
455
455
|
const u = { code: l.code, connection: l.connection };
|
|
456
|
-
|
|
456
|
+
s[l.siteId] = [...Object.hasOwn(s, l.siteId) ? s[l.siteId] : [], u];
|
|
457
457
|
}
|
|
458
458
|
for (const l of [e, r, i])
|
|
459
459
|
for (const [u, d] of Object.entries(l ?? {}))
|
|
460
|
-
d.length > 0 && (
|
|
461
|
-
return
|
|
460
|
+
d.length > 0 && (s[u] = [...Object.hasOwn(s, u) ? s[u] : [], ...d]);
|
|
461
|
+
return s;
|
|
462
462
|
}
|
|
463
463
|
const Us = Nn(
|
|
464
|
-
() => import("@w6w/ui/flow").then((
|
|
464
|
+
() => import("@w6w/ui/flow").then((n) => ({ default: n.WorkflowFlowEditor }))
|
|
465
465
|
);
|
|
466
|
-
function Xs(
|
|
466
|
+
function Xs(n) {
|
|
467
467
|
var wt, St, kt, Nt, Et;
|
|
468
|
-
const { workflowId: e, project: r, projectPending: i, initialRunId:
|
|
468
|
+
const { workflowId: e, project: r, projectPending: i, initialRunId: s, onNavigate: l, slots: u } = n, d = Yn(), y = It(), [h, m] = v(null), [j, z] = v(!1), [de, I] = v(0), [C, D] = v(!1), [G, Y] = v(!1), [U, Ae] = v(!1), [X, Te] = v(void 0), je = S(!0), Oe = S(() => null), Mt = E(
|
|
469
469
|
(t) => {
|
|
470
470
|
const o = t;
|
|
471
471
|
return Lt.test(typeof o.id == "string" ? o.id : "") ? At(X, o.key).reason : "Invalid workflow id.";
|
|
@@ -489,23 +489,23 @@ function Xs(s) {
|
|
|
489
489
|
}
|
|
490
490
|
!f.dirty && c && Te(c.key ?? null);
|
|
491
491
|
}, [f.loading, f.loadError, f.dirty, c]);
|
|
492
|
-
const [Dt, fe] =
|
|
492
|
+
const [Dt, fe] = v(!1);
|
|
493
493
|
T(() => {
|
|
494
494
|
f.stale || fe(!1);
|
|
495
495
|
}, [f.stale]);
|
|
496
|
-
const [Bt, Fe] =
|
|
496
|
+
const [Bt, Fe] = v(!1), Le = S(!1);
|
|
497
497
|
T(() => {
|
|
498
498
|
f.saving ? Fe(!1) : Le.current && f.error === null && Fe(!0), Le.current = f.saving;
|
|
499
499
|
}, [f.saving, f.error]);
|
|
500
|
-
const [O, N] =
|
|
500
|
+
const [O, N] = v(null), Me = Rn(), Je = Cn(), De = Pn(), P = An(O), K = (wt = P.data) == null ? void 0 : wt.status, Be = P.isError, Z = Tn(K, Be), Wt = jn(O, K), We = On(
|
|
501
501
|
In(P.data),
|
|
502
502
|
(St = Wt.data) == null ? void 0 : St.writes
|
|
503
|
-
), $e = Fn(P.data, We), pe =
|
|
503
|
+
), $e = Fn(P.data, We), pe = S(!1), [$t, xe] = v(!1);
|
|
504
504
|
T(() => {
|
|
505
505
|
N(null);
|
|
506
506
|
}, [e]), T(() => {
|
|
507
|
-
|
|
508
|
-
}, [e,
|
|
507
|
+
s && N(s);
|
|
508
|
+
}, [e, s]), T(() => {
|
|
509
509
|
P.data && P.data.workflowId !== e && N(null);
|
|
510
510
|
}, [P.data, e]);
|
|
511
511
|
async function Ke(t) {
|
|
@@ -587,14 +587,14 @@ function Xs(s) {
|
|
|
587
587
|
Ae(!1);
|
|
588
588
|
}
|
|
589
589
|
}
|
|
590
|
-
const ee = f.stale ? null : f.error ?? f.loadError, Qe = h ?? (ee === null ? null : ee instanceof Error ? ee.message : String(ee)), qt = c !== null && (Array.isArray(c.nodes) || Array.isArray(c.steps)), _e = (c == null ? void 0 : c.displayName) ?? "", he = Xn(c == null ? void 0 : c.settings), te = ls(c == null ? void 0 : c.initialState),
|
|
590
|
+
const ee = f.stale ? null : f.error ?? f.loadError, Qe = h ?? (ee === null ? null : ee instanceof Error ? ee.message : String(ee)), qt = c !== null && (Array.isArray(c.nodes) || Array.isArray(c.steps)), _e = (c == null ? void 0 : c.displayName) ?? "", he = Xn(c == null ? void 0 : c.settings), te = ls(c == null ? void 0 : c.initialState), Ht = w(() => cs(c == null ? void 0 : c.variables), [c == null ? void 0 : c.variables]), qe = At(X, c == null ? void 0 : c.key), He = c !== null && X !== void 0 && !qe.allowed ? qe.reason : null, R = w(
|
|
591
591
|
() => Zn(c),
|
|
592
592
|
[c]
|
|
593
|
-
), [b,
|
|
593
|
+
), [b, Vt] = v(null);
|
|
594
594
|
T(() => {
|
|
595
595
|
let t = !1;
|
|
596
596
|
return import("@w6w/ui/flow").then((o) => {
|
|
597
|
-
t ||
|
|
597
|
+
t || Vt({
|
|
598
598
|
internalNodes: o.INTERNAL_NODES,
|
|
599
599
|
isInternalApp: o.isInternalApp,
|
|
600
600
|
internalNodeParams: o.internalNodeParams,
|
|
@@ -608,7 +608,7 @@ function Xs(s) {
|
|
|
608
608
|
t = !0;
|
|
609
609
|
};
|
|
610
610
|
}, []);
|
|
611
|
-
const Q =
|
|
611
|
+
const Q = w(() => {
|
|
612
612
|
if (b)
|
|
613
613
|
return es(
|
|
614
614
|
{ steps: R },
|
|
@@ -617,7 +617,7 @@ function Xs(s) {
|
|
|
617
617
|
asFieldDefs: b.asFieldDefs
|
|
618
618
|
}
|
|
619
619
|
);
|
|
620
|
-
}, [b, R]), F =
|
|
620
|
+
}, [b, R]), F = w(() => {
|
|
621
621
|
if (!b) return [];
|
|
622
622
|
const t = /* @__PURE__ */ new Set();
|
|
623
623
|
for (const o of R) {
|
|
@@ -625,12 +625,12 @@ function Xs(s) {
|
|
|
625
625
|
p && k && !b.isInternalApp(p) && t.add(p);
|
|
626
626
|
}
|
|
627
627
|
return [...t];
|
|
628
|
-
}, [b, R]), { byId: ne } = Kn(F), zt =
|
|
628
|
+
}, [b, R]), { byId: ne } = Kn(F), zt = w(() => [...ne.values()], [ne]), Ve = Re({
|
|
629
629
|
queries: F.map((t) => ({
|
|
630
630
|
queryKey: Cs(t),
|
|
631
|
-
queryFn: () =>
|
|
631
|
+
queryFn: () => y.getAppActions(t)
|
|
632
632
|
}))
|
|
633
|
-
}), ze =
|
|
633
|
+
}), ze = w(() => {
|
|
634
634
|
var o, p;
|
|
635
635
|
const t = {};
|
|
636
636
|
if (!b) return t;
|
|
@@ -642,16 +642,16 @@ function Xs(s) {
|
|
|
642
642
|
if (b.isInternalApp(A))
|
|
643
643
|
t[Ne] = b.internalNodeParams(A, x);
|
|
644
644
|
else {
|
|
645
|
-
const Rt = F.indexOf(A), Ee = Rt >= 0 ? (o =
|
|
645
|
+
const Rt = F.indexOf(A), Ee = Rt >= 0 ? (o = Ve[Rt]) == null ? void 0 : o.data : void 0;
|
|
646
646
|
t[Ne] = ((p = Ee == null ? void 0 : Ee.find((dn) => dn.key === x)) == null ? void 0 : p.params) ?? [];
|
|
647
647
|
}
|
|
648
648
|
}
|
|
649
649
|
return t;
|
|
650
|
-
}, [b, R, F,
|
|
650
|
+
}, [b, R, F, Ve]), _ = w(() => {
|
|
651
651
|
const t = {};
|
|
652
652
|
for (const [o, p] of ne) t[o] = p;
|
|
653
653
|
return t;
|
|
654
|
-
}, [ne]), me =
|
|
654
|
+
}, [ne]), me = w(
|
|
655
655
|
() => R.filter((t) => {
|
|
656
656
|
var p;
|
|
657
657
|
const o = (p = t.uses) == null ? void 0 : p.app;
|
|
@@ -664,13 +664,13 @@ function Xs(s) {
|
|
|
664
664
|
queryFn: () => jt(d, e, t.id),
|
|
665
665
|
enabled: !!e
|
|
666
666
|
}))
|
|
667
|
-
}), Ye =
|
|
667
|
+
}), Ye = w(() => {
|
|
668
668
|
const t = {};
|
|
669
669
|
return me.forEach((o, p) => {
|
|
670
670
|
var k, A;
|
|
671
671
|
t[o.id] = !!((A = (k = Ge[p]) == null ? void 0 : k.data) != null && A.some((x) => x.lastRunStatus === "succeeded"));
|
|
672
672
|
}), t;
|
|
673
|
-
}, [me, Ge]), q = bs("workflow", e, !!e), be = gs("workflow"), L = ((kt = q.data) == null ? void 0 : kt.currentPublishedVersion) ?? null,
|
|
673
|
+
}, [me, Ge]), q = bs("workflow", e, !!e), be = gs("workflow"), L = ((kt = q.data) == null ? void 0 : kt.currentPublishedVersion) ?? null, H = ys("workflow", e, L, !!e), Ue = H.data !== void 0 && c !== null && Ds(c, H.data.definition), M = q.data === void 0 ? void 0 : L === null ? "unpublished" : H.data === void 0 || f.loading ? void 0 : Ue ? "published" : "draft", [Gt, Xe] = v(!1), Yt = vs("workflow");
|
|
674
674
|
async function Ze(t) {
|
|
675
675
|
Xe(!0), m(null);
|
|
676
676
|
try {
|
|
@@ -679,7 +679,7 @@ function Xs(s) {
|
|
|
679
679
|
Xe(!1);
|
|
680
680
|
}
|
|
681
681
|
}
|
|
682
|
-
const se = Ot(), et =
|
|
682
|
+
const se = Ot(), et = S(null);
|
|
683
683
|
T(() => {
|
|
684
684
|
var t;
|
|
685
685
|
if (!(!e || !O || et.current === O) && Ln(K, (t = P.data) == null ? void 0 : t.workflowId, e)) {
|
|
@@ -696,16 +696,16 @@ function Xs(s) {
|
|
|
696
696
|
queryKey: Tt(t),
|
|
697
697
|
queryFn: () => ms(d, t)
|
|
698
698
|
}))
|
|
699
|
-
}), nt =
|
|
699
|
+
}), nt = w(() => {
|
|
700
700
|
const t = /* @__PURE__ */ new Map();
|
|
701
701
|
return F.forEach((o, p) => {
|
|
702
702
|
const k = tt[p];
|
|
703
703
|
k && (k.isError ? t.set(o, { state: "error" }) : k.isSuccess && !k.isFetching ? t.set(o, { state: "ready", ids: new Set((k.data ?? []).map((A) => A.id)) }) : t.set(o, { state: "loading" }));
|
|
704
704
|
}), t;
|
|
705
|
-
}, [F, tt]), W =
|
|
705
|
+
}, [F, tt]), W = w(
|
|
706
706
|
() => ts(R, (t) => nt.get(t), c == null ? void 0 : c.connections),
|
|
707
707
|
[R, nt, c == null ? void 0 : c.connections]
|
|
708
|
-
), st = Ns(r ?? void 0, r !== null), ot = Es(), it = ws(), rt = Rs(r ?? void 0), ge =
|
|
708
|
+
), st = Ns(r ?? void 0, r !== null), ot = Es(), it = ws(), rt = Rs(r ?? void 0), ge = w(() => {
|
|
709
709
|
if (!c) return {};
|
|
710
710
|
const t = (o) => ({
|
|
711
711
|
names: (o.data ?? []).map((p) => p.name),
|
|
@@ -720,12 +720,12 @@ function Xs(s) {
|
|
|
720
720
|
stores: t(rt)
|
|
721
721
|
}
|
|
722
722
|
});
|
|
723
|
-
}, [c, st, ot, it, rt]), at =
|
|
723
|
+
}, [c, st, ot, it, rt]), at = w(() => {
|
|
724
724
|
const t = {};
|
|
725
725
|
for (const [o, p] of Object.entries(ge))
|
|
726
726
|
t[o] = [{ code: "setup_incomplete", items: p }];
|
|
727
727
|
return t;
|
|
728
|
-
}, [ge]), Ut =
|
|
728
|
+
}, [ge]), Ut = w(
|
|
729
729
|
() => Ys(
|
|
730
730
|
W,
|
|
731
731
|
b == null ? void 0 : b.findLoopProblems(c),
|
|
@@ -733,21 +733,21 @@ function Xs(s) {
|
|
|
733
733
|
at
|
|
734
734
|
),
|
|
735
735
|
[W, b, c, at]
|
|
736
|
-
), lt =
|
|
736
|
+
), lt = S(/* @__PURE__ */ new Set());
|
|
737
737
|
T(() => {
|
|
738
738
|
for (const t of W) {
|
|
739
739
|
const o = `${t.app}|${t.connection}`;
|
|
740
740
|
lt.current.has(o) || (lt.current.add(o), se.invalidateQueries({ queryKey: Tt(t.app) }));
|
|
741
741
|
}
|
|
742
742
|
}, [W, se]);
|
|
743
|
-
const oe =
|
|
743
|
+
const oe = S({ id: e, had: !1 });
|
|
744
744
|
oe.current.id !== e && (oe.current = { id: e, had: !1 }), W.length > 0 && (oe.current.had = !0);
|
|
745
745
|
const ct = Ss("workflow"), ye = ss({
|
|
746
746
|
enabled: (Et = q.data) == null ? void 0 : Et.enabled,
|
|
747
747
|
problemCount: W.length,
|
|
748
748
|
dirty: f.dirty,
|
|
749
749
|
hadProblems: oe.current.had
|
|
750
|
-
}), ve =
|
|
750
|
+
}), ve = w(
|
|
751
751
|
() => ({
|
|
752
752
|
actionParamsByKey: ze,
|
|
753
753
|
appsById: _,
|
|
@@ -756,19 +756,19 @@ function Xs(s) {
|
|
|
756
756
|
isTestRequired: Ct
|
|
757
757
|
}),
|
|
758
758
|
[ze, _, Ye]
|
|
759
|
-
), Xt =
|
|
759
|
+
), Xt = w(
|
|
760
760
|
() => c !== null && b !== null ? os(c, ve) : [],
|
|
761
761
|
[c, b, ve]
|
|
762
|
-
), [ut, dt] =
|
|
762
|
+
), [ut, dt] = v(!1), we = S(!1), V = is({
|
|
763
763
|
projectMissing: r === null,
|
|
764
764
|
loading: !B,
|
|
765
765
|
saveBlockedReason: f.saveBlockedReason ?? (B && c === null ? "the workflow JSON does not parse." : null),
|
|
766
766
|
catalogLoading: c !== null && b === null,
|
|
767
767
|
problems: Xt,
|
|
768
768
|
publishing: ut || be.isPending
|
|
769
|
-
}) ?? (q.isPending || L !== null &&
|
|
769
|
+
}) ?? (q.isPending || L !== null && H.isPending ? "Checking the published version…" : q.isError || L !== null && H.isError ? "Can't check the published version. Reload to try again." : Ue ? "Already published. Make a change before publishing again." : null);
|
|
770
770
|
async function Se() {
|
|
771
|
-
if (!(!e ||
|
|
771
|
+
if (!(!e || V !== null || we.current)) {
|
|
772
772
|
we.current = !0, dt(!0), m(null);
|
|
773
773
|
try {
|
|
774
774
|
await Ke(() => be.mutateAsync(e));
|
|
@@ -792,11 +792,11 @@ function Xs(s) {
|
|
|
792
792
|
const o = { ...c, ...t };
|
|
793
793
|
m(null), f.commit(JSON.stringify(o, null, 2));
|
|
794
794
|
}
|
|
795
|
-
const re =
|
|
795
|
+
const re = S(c);
|
|
796
796
|
re.current = c;
|
|
797
|
-
const pt =
|
|
797
|
+
const pt = S(f.commit);
|
|
798
798
|
pt.current = f.commit;
|
|
799
|
-
const ht =
|
|
799
|
+
const ht = S(f.saveNow);
|
|
800
800
|
ht.current = f.saveNow, T(() => {
|
|
801
801
|
const t = (o) => {
|
|
802
802
|
o.altKey || !(o.metaKey || o.ctrlKey) || o.key.toLowerCase() !== "s" || (o.preventDefault(), !document.querySelector(".w6w-exprmodal") && B && ht.current());
|
|
@@ -805,7 +805,7 @@ function Xs(s) {
|
|
|
805
805
|
document.removeEventListener("keydown", t);
|
|
806
806
|
};
|
|
807
807
|
}, [B]);
|
|
808
|
-
const en =
|
|
808
|
+
const en = w(
|
|
809
809
|
() => c ? ds(c) : {},
|
|
810
810
|
[c]
|
|
811
811
|
), tn = E((t) => {
|
|
@@ -813,16 +813,16 @@ function Xs(s) {
|
|
|
813
813
|
if (!o) return;
|
|
814
814
|
const p = fs(o, t);
|
|
815
815
|
m(null), pt.current(JSON.stringify(p, null, 2));
|
|
816
|
-
}, []), nn = E(() => Y(!0), []), mt =
|
|
816
|
+
}, []), nn = E(() => Y(!0), []), mt = S(() => {
|
|
817
817
|
});
|
|
818
818
|
mt.current = (t) => {
|
|
819
819
|
N(t), l({ type: "run", id: e, runId: t });
|
|
820
820
|
};
|
|
821
|
-
const bt = E((t) => mt.current(t), []), gt =
|
|
821
|
+
const bt = E((t) => mt.current(t), []), gt = S(Ze);
|
|
822
822
|
gt.current = Ze;
|
|
823
|
-
const sn = E((t) => gt.current(t), []), yt =
|
|
823
|
+
const sn = E((t) => gt.current(t), []), yt = S(Se);
|
|
824
824
|
yt.current = Se;
|
|
825
|
-
const on = E(() => yt.current(), []), ke =
|
|
825
|
+
const on = E(() => yt.current(), []), ke = S({ saveMeta: ft, patchMeta: ie });
|
|
826
826
|
ke.current = { saveMeta: ft, patchMeta: ie };
|
|
827
827
|
const rn = E(
|
|
828
828
|
(t, o) => {
|
|
@@ -834,7 +834,7 @@ function Xs(s) {
|
|
|
834
834
|
[]
|
|
835
835
|
), an = E((t) => {
|
|
836
836
|
ke.current.patchMeta({ variables: us(t) });
|
|
837
|
-
}, []), [$, ln] =
|
|
837
|
+
}, []), [$, ln] = v(null), vt = S($);
|
|
838
838
|
vt.current = $;
|
|
839
839
|
const cn = E(
|
|
840
840
|
(t) => {
|
|
@@ -853,7 +853,7 @@ function Xs(s) {
|
|
|
853
853
|
onRestoreVersion: sn,
|
|
854
854
|
definitionStatus: M,
|
|
855
855
|
onPublish: on,
|
|
856
|
-
publishDisabled:
|
|
856
|
+
publishDisabled: V !== null,
|
|
857
857
|
policy: en,
|
|
858
858
|
onPolicyChange: tn,
|
|
859
859
|
hasStartingState: te !== void 0 && Object.keys(te).length > 0,
|
|
@@ -862,7 +862,7 @@ function Xs(s) {
|
|
|
862
862
|
onOpenRun: bt,
|
|
863
863
|
authoringSettings: { autoSave: he.autoSave, savePosition: he.savePosition },
|
|
864
864
|
onAuthoringSettingChange: rn,
|
|
865
|
-
variables:
|
|
865
|
+
variables: Ht,
|
|
866
866
|
onVariablesChange: an,
|
|
867
867
|
onOpenHistory: un
|
|
868
868
|
}), /* @__PURE__ */ g("div", { className: "wf-fullbleed", style: { height: "100%", minWidth: 0, flex: 1 }, children: [
|
|
@@ -916,8 +916,8 @@ function Xs(s) {
|
|
|
916
916
|
/* @__PURE__ */ a(
|
|
917
917
|
$s,
|
|
918
918
|
{
|
|
919
|
-
disabled:
|
|
920
|
-
message:
|
|
919
|
+
disabled: V !== null,
|
|
920
|
+
message: V ?? (L !== null ? "Republish this draft as a new live version" : "Publish this draft as a new live version"),
|
|
921
921
|
children: (t) => /* @__PURE__ */ a(le, { children: /* @__PURE__ */ a(
|
|
922
922
|
"button",
|
|
923
923
|
{
|
|
@@ -925,7 +925,7 @@ function Xs(s) {
|
|
|
925
925
|
className: "btn ghost wf-publish",
|
|
926
926
|
"data-testid": "wf-publish",
|
|
927
927
|
onClick: () => void Se(),
|
|
928
|
-
disabled:
|
|
928
|
+
disabled: V !== null,
|
|
929
929
|
"aria-describedby": t,
|
|
930
930
|
children: ut || be.isPending ? L !== null ? "Republishing…" : "Publishing…" : L !== null ? M === "draft" ? "Republish" : "Published" : "Publish"
|
|
931
931
|
}
|
|
@@ -998,7 +998,7 @@ function Xs(s) {
|
|
|
998
998
|
Bt && /* @__PURE__ */ a("span", { className: "ok", children: "Saved." })
|
|
999
999
|
] }),
|
|
1000
1000
|
Qe && /* @__PURE__ */ a("div", { className: "error", children: Qe }),
|
|
1001
|
-
|
|
1001
|
+
He && /* @__PURE__ */ a("div", { className: "error", "data-testid": "wf-key-guard", children: He })
|
|
1002
1002
|
] }),
|
|
1003
1003
|
Gt && /* @__PURE__ */ a(ue, { title: "Restoring version…", onClose: () => {
|
|
1004
1004
|
}, children: /* @__PURE__ */ a("div", { className: "modal-body", children: "Replacing the draft…" }) }),
|
|
@@ -1052,18 +1052,26 @@ function Xs(s) {
|
|
|
1052
1052
|
)
|
|
1053
1053
|
] });
|
|
1054
1054
|
}
|
|
1055
|
-
function Zs({
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1055
|
+
function Zs({
|
|
1056
|
+
children: n,
|
|
1057
|
+
callableHref: e
|
|
1058
|
+
}) {
|
|
1059
|
+
const r = It(), i = Ot(), s = Sn(Ps), l = w(() => ({
|
|
1060
|
+
...r,
|
|
1061
|
+
saveStepTest: (...y) => r.saveStepTest(...y).finally(() => {
|
|
1062
|
+
i.invalidateQueries({ queryKey: Pe(y[0], y[1]) });
|
|
1063
|
+
}),
|
|
1064
|
+
recordStepTestRun: (...y) => r.recordStepTestRun(...y).finally(() => {
|
|
1065
|
+
i.invalidateQueries({ queryKey: Pe(y[0], y[1]) });
|
|
1066
|
+
}),
|
|
1067
|
+
callableHref: e ?? r.callableHref
|
|
1068
|
+
}), [r, i, e]);
|
|
1069
|
+
return /* @__PURE__ */ a(bn, { api: l, theme: s, children: n });
|
|
1062
1070
|
}
|
|
1063
1071
|
const eo = () => {
|
|
1064
1072
|
};
|
|
1065
|
-
function Po(
|
|
1066
|
-
const { workflowId: e, initialRunId: r, onNavigate: i = eo, slots:
|
|
1073
|
+
function Po(n) {
|
|
1074
|
+
const { workflowId: e, initialRunId: r, onNavigate: i = eo, slots: s } = n, l = ps(n.project), u = hs().status, d = n.project === void 0 && u === "resolving", y = E(
|
|
1067
1075
|
(h) => {
|
|
1068
1076
|
h.type === "list" ? i({ type: "list" }) : h.kind === "workflow" && i({ type: "workflow", id: h.id });
|
|
1069
1077
|
},
|
|
@@ -1078,10 +1086,10 @@ function Po(s) {
|
|
|
1078
1086
|
Ws,
|
|
1079
1087
|
{
|
|
1080
1088
|
project: l,
|
|
1081
|
-
onNavigate:
|
|
1082
|
-
rail:
|
|
1089
|
+
onNavigate: y,
|
|
1090
|
+
rail: n.rail,
|
|
1083
1091
|
storageKey: l === null ? null : `w6w.rail.embed.${l}`,
|
|
1084
|
-
children: /* @__PURE__ */ a(Zs, { children: /* @__PURE__ */ a(
|
|
1092
|
+
children: /* @__PURE__ */ a(Zs, { callableHref: n.callableHref, children: /* @__PURE__ */ a(
|
|
1085
1093
|
Xs,
|
|
1086
1094
|
{
|
|
1087
1095
|
workflowId: e,
|
|
@@ -1089,7 +1097,7 @@ function Po(s) {
|
|
|
1089
1097
|
projectPending: d,
|
|
1090
1098
|
initialRunId: r,
|
|
1091
1099
|
onNavigate: i,
|
|
1092
|
-
slots:
|
|
1100
|
+
slots: s
|
|
1093
1101
|
}
|
|
1094
1102
|
) })
|
|
1095
1103
|
}
|
|
@@ -1106,4 +1114,4 @@ export {
|
|
|
1106
1114
|
Ws as a,
|
|
1107
1115
|
Fs as b
|
|
1108
1116
|
};
|
|
1109
|
-
//# sourceMappingURL=WorkflowEditor-
|
|
1117
|
+
//# sourceMappingURL=WorkflowEditor-Cgv3Pvsy.js.map
|