@powerhousedao/workflow 6.2.3-dev.83 → 6.2.3-dev.84
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/dist/browser/{BlockSelector-DHVzUGjW.js → BlockSelector-CtoMNZ9A.js} +4 -3
- package/dist/browser/BlockSelector-CtoMNZ9A.js.map +1 -0
- package/dist/browser/{connection-form-D2qAEHsl.js → connection-form-_H-tP2Vk.js} +2 -2
- package/dist/browser/{connection-form-D2qAEHsl.js.map → connection-form-_H-tP2Vk.js.map} +1 -1
- package/dist/browser/{data-tree-BOuPR-2J.js → data-tree-CjWQllC7.js} +2 -2
- package/dist/browser/{data-tree-BOuPR-2J.js.map → data-tree-CjWQllC7.js.map} +1 -1
- package/dist/browser/{editor-BD-5ClkW.js → editor-B1AzXxaF.js} +207 -33
- package/dist/browser/editor-B1AzXxaF.js.map +1 -0
- package/dist/browser/{editor--59WtNaj.js → editor-B9069RYZ.js} +9 -2535
- package/dist/browser/editor-B9069RYZ.js.map +1 -0
- package/dist/browser/{editor-0XPrGeLT.js → editor-DgdTF2up.js} +3 -3
- package/dist/browser/{editor-0XPrGeLT.js.map → editor-DgdTF2up.js.map} +1 -1
- package/dist/browser/editors/connection-editor/module.js +1 -1
- package/dist/browser/editors/workflow-editor/module.js +1 -1
- package/dist/browser/editors/workflow-studio/module.js +1 -1
- package/dist/browser/trigger-text-BgpPIXEJ.js +3040 -0
- package/dist/browser/trigger-text-BgpPIXEJ.js.map +1 -0
- package/dist/node/{BlockSelector-D2UAnFpN.mjs → BlockSelector-CbdgYJfp.mjs} +5 -4
- package/dist/node/BlockSelector-CbdgYJfp.mjs.map +1 -0
- package/dist/node/{connection-form-Btmejfyn.mjs → connection-form-DPbyrUIm.mjs} +3 -3
- package/dist/node/{connection-form-Btmejfyn.mjs.map → connection-form-DPbyrUIm.mjs.map} +1 -1
- package/dist/node/{data-tree-rZiK2Ev-.mjs → data-tree-CXa2kEuD.mjs} +2 -2
- package/dist/node/{data-tree-rZiK2Ev-.mjs.map → data-tree-CXa2kEuD.mjs.map} +1 -1
- package/dist/node/{editor-U6trS0QO.mjs → editor-BGz1Ljdk.mjs} +9 -2534
- package/dist/node/editor-BGz1Ljdk.mjs.map +1 -0
- package/dist/node/{editor-C_eWGGi8.mjs → editor-D3MlbYBN.mjs} +207 -34
- package/dist/node/editor-D3MlbYBN.mjs.map +1 -0
- package/dist/node/{editor-ChJMxbeM.mjs → editor-DzxyNgYk.mjs} +4 -4
- package/dist/node/{editor-ChJMxbeM.mjs.map → editor-DzxyNgYk.mjs.map} +1 -1
- package/dist/node/editors/connection-editor/module.mjs +1 -1
- package/dist/node/editors/runtime/index.mjs +1 -1
- package/dist/node/editors/workflow-editor/module.mjs +1 -1
- package/dist/node/editors/workflow-studio/module.mjs +1 -1
- package/dist/node/index.mjs +1 -1
- package/dist/node/pieces/ai/descriptor.json +1 -1
- package/dist/node/pieces/ai/package.json +1 -1
- package/dist/node/pieces/reactor/descriptor.json +1 -1
- package/dist/node/pieces/reactor/package.json +1 -1
- package/dist/node/{runtime-queries-CmrHBPRw.mjs → runtime-queries-CatdoDey.mjs} +155 -4
- package/dist/node/runtime-queries-CatdoDey.mjs.map +1 -0
- package/dist/node/trigger-text-yNCaB6pd.mjs +3040 -0
- package/dist/node/trigger-text-yNCaB6pd.mjs.map +1 -0
- package/dist/powerhouse.manifest.json +2 -2
- package/dist/style.css +1 -1
- package/dist/types/editors/shared/controls.d.ts.map +1 -1
- package/dist/types/editors/workflow-editor/ui/manual-inputs.d.ts +7 -0
- package/dist/types/editors/workflow-editor/ui/manual-inputs.d.ts.map +1 -0
- package/dist/types/editors/workflow-editor/ui/manual-inputs.test.d.ts +2 -0
- package/dist/types/editors/workflow-editor/ui/manual-inputs.test.d.ts.map +1 -0
- package/dist/types/editors/workflow-studio/components/RunDialog.d.ts +7 -0
- package/dist/types/editors/workflow-studio/components/RunDialog.d.ts.map +1 -0
- package/dist/types/editors/workflow-studio/components/RunsView.d.ts +3 -1
- package/dist/types/editors/workflow-studio/components/RunsView.d.ts.map +1 -1
- package/dist/types/editors/workflow-studio/components/WorkflowStudio.d.ts.map +1 -1
- package/dist/types/editors/workflow-studio/components/run-dialog.test.d.ts +2 -0
- package/dist/types/editors/workflow-studio/components/run-dialog.test.d.ts.map +1 -0
- package/dist/types/test/graphql-server.d.ts +9 -0
- package/dist/types/test/graphql-server.d.ts.map +1 -0
- package/dist/types/test/ui/manual-inputs.spec.d.ts +2 -0
- package/dist/types/test/ui/manual-inputs.spec.d.ts.map +1 -0
- package/package.json +9 -9
- package/dist/browser/BlockSelector-DHVzUGjW.js.map +0 -1
- package/dist/browser/editor--59WtNaj.js.map +0 -1
- package/dist/browser/editor-BD-5ClkW.js.map +0 -1
- package/dist/browser/trigger-text-Co-dn9x-.js +0 -513
- package/dist/browser/trigger-text-Co-dn9x-.js.map +0 -1
- package/dist/node/BlockSelector-D2UAnFpN.mjs.map +0 -1
- package/dist/node/editor-C_eWGGi8.mjs.map +0 -1
- package/dist/node/editor-U6trS0QO.mjs.map +0 -1
- package/dist/node/runtime-queries-CmrHBPRw.mjs.map +0 -1
- package/dist/node/trigger-text-CAiRCG2X.mjs +0 -512
- package/dist/node/trigger-text-CAiRCG2X.mjs.map +0 -1
|
@@ -1,14 +1,200 @@
|
|
|
1
|
-
import { X as CORE_PIECE, Z as MANUAL_TRIGGER, at as sameBlock, ct as triggerBlock, l as runsOfPages, ot as stepBlock } from "./runtime-queries-
|
|
2
|
-
import { A as runStats, Bt as Icon, C as canRerun, Ct as ITEM_PARAM, D as formatMs, E as formatDuration, Et as Button, F as toneOf, Ht as DocumentErrorBoundary, I as workflowHealth, M as runTimeline, Mt as Select, N as runTone, O as formatTrigger, P as statusLabel, S as TONE_TEXT, T as formatAbsolute, Tt as useSearchParamDraft, Ut as DocumentLoadError, Wt as errorMessage, _ as CONNECTION_TONE, _t as useRunPagesQuery, b as STEP_TONE, f as blockMeta, g as usePieceLogos, j as runStatusLabel, k as formatWhen, pt as WorkflowRuntimeProvider, t as BlockLogo, v as RUN_STATUSES, vt as useRunQuery, w as durationMs, wt as useSearchParam, x as TONE_DOT, xt as useRuntimeActions, y as RUN_TONE, zt as textInputClass } from "./BlockSelector-
|
|
1
|
+
import { St as parseManualInputs, X as CORE_PIECE, Z as MANUAL_TRIGGER, at as sameBlock, ct as triggerBlock, ft as ManualPayloadError, ht as coerceManualPayload, l as runsOfPages, ot as stepBlock, xt as manualDefault } from "./runtime-queries-CatdoDey.mjs";
|
|
2
|
+
import { A as runStats, Bt as Icon, C as canRerun, Ct as ITEM_PARAM, D as formatMs, E as formatDuration, Et as Button, F as toneOf, Ht as DocumentErrorBoundary, I as workflowHealth, M as runTimeline, Mt as Select, N as runTone, Nt as Switch, O as formatTrigger, P as statusLabel, Rt as textAreaClass, S as TONE_TEXT, T as formatAbsolute, Tt as useSearchParamDraft, Ut as DocumentLoadError, Wt as errorMessage, _ as CONNECTION_TONE, _t as useRunPagesQuery, b as STEP_TONE, f as blockMeta, g as usePieceLogos, j as runStatusLabel, k as formatWhen, pt as WorkflowRuntimeProvider, t as BlockLogo, v as RUN_STATUSES, vt as useRunQuery, w as durationMs, wt as useSearchParam, x as TONE_DOT, xt as useRuntimeActions, y as RUN_TONE, zt as textInputClass } from "./BlockSelector-CbdgYJfp.mjs";
|
|
3
3
|
import { y as actions } from "./module-D9Zx5Zow.mjs";
|
|
4
4
|
import { r as useWorkflowDocumentsInSelectedDrive } from "./workflow-DqF9VsBQ.mjs";
|
|
5
|
-
import {
|
|
5
|
+
import { g as StatusToggle, i as DataViewer, l as StepError, o as PropertyForm, p as PublishState, r as describeTrigger } from "./trigger-text-yNCaB6pd.mjs";
|
|
6
6
|
import { addDocument, addFolder, deleteNode, getPHStore, showDeleteNodeModal, useDispatch, useDocumentSafe, useFileNodesInSelectedDrive, useNodesInSelectedDrive, usePHToast, useSearchParams, useSelectedDrive, useSelectedNode, useSetPHAppConfig, useSetSearchParams, useSetSelectedNode } from "@powerhousedao/reactor-browser";
|
|
7
7
|
import { generateId } from "document-model";
|
|
8
8
|
import { Fragment, useCallback, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
9
9
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
10
10
|
import { addFolder as addFolder$1, moveNode, updateNode } from "@powerhousedao/shared/document-drive";
|
|
11
11
|
import { ConnectTooltip, ConnectTooltipProvider, Modal } from "@powerhousedao/design-system/connect";
|
|
12
|
+
//#region editors/workflow-editor/ui/manual-inputs.ts
|
|
13
|
+
const PROPERTY_TYPES = {
|
|
14
|
+
text: "SHORT_TEXT",
|
|
15
|
+
text_area: "LONG_TEXT",
|
|
16
|
+
number: "NUMBER",
|
|
17
|
+
toggle: "CHECKBOX",
|
|
18
|
+
date: "DATE_TIME",
|
|
19
|
+
dropdown: "STATIC_DROPDOWN",
|
|
20
|
+
json: "JSON"
|
|
21
|
+
};
|
|
22
|
+
function manualInputProp(input) {
|
|
23
|
+
const defaultValue = manualDefault(input);
|
|
24
|
+
return {
|
|
25
|
+
name: input.name,
|
|
26
|
+
displayName: input.displayName,
|
|
27
|
+
type: PROPERTY_TYPES[input.type],
|
|
28
|
+
required: input.type === "toggle" ? false : input.required,
|
|
29
|
+
...input.description ? { description: input.description } : {},
|
|
30
|
+
...defaultValue !== void 0 ? { defaultValue } : {},
|
|
31
|
+
...input.type === "dropdown" ? { staticOptions: (input.options ?? []).map(({ value, label }) => ({
|
|
32
|
+
value,
|
|
33
|
+
label
|
|
34
|
+
})) } : {}
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function manualRunPayload(inputs, values) {
|
|
38
|
+
try {
|
|
39
|
+
return coerceManualPayload(inputs, values);
|
|
40
|
+
} catch (error) {
|
|
41
|
+
if (!(error instanceof ManualPayloadError)) throw error;
|
|
42
|
+
const label = (name) => inputs.find((input) => input.name === name)?.displayName ?? name;
|
|
43
|
+
throw new Error(error.fields.map((entry) => `${label(entry.field)} ${entry.message}`).join("; "), { cause: error });
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function manualInputValues(inputs) {
|
|
47
|
+
const values = {};
|
|
48
|
+
for (const input of inputs) {
|
|
49
|
+
const value = manualDefault(input);
|
|
50
|
+
if (value !== void 0) values[input.name] = value;
|
|
51
|
+
else if (input.type === "toggle") values[input.name] = false;
|
|
52
|
+
}
|
|
53
|
+
return values;
|
|
54
|
+
}
|
|
55
|
+
//#endregion
|
|
56
|
+
//#region editors/workflow-studio/components/ui.tsx
|
|
57
|
+
function StatusDot(props) {
|
|
58
|
+
const hollow = props.hollow ?? props.tone === "idle";
|
|
59
|
+
return /* @__PURE__ */ jsx("span", {
|
|
60
|
+
"aria-hidden": true,
|
|
61
|
+
className: `inline-block h-2 w-2 shrink-0 rounded-full ${hollow ? "border border-solid border-muted-foreground/60" : TONE_DOT[props.tone]} ${props.className ?? ""}`
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
function StatusText(props) {
|
|
65
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
66
|
+
className: `inline-flex items-center gap-1.5 font-medium ${TONE_TEXT[props.tone]} ${props.className ?? ""}`,
|
|
67
|
+
children: [/* @__PURE__ */ jsx(StatusDot, { tone: props.tone }), props.label ?? statusLabel(props.status)]
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
/** A label/value pair for a header's facts line. */
|
|
71
|
+
function Fact(props) {
|
|
72
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
73
|
+
className: "flex min-w-0 flex-col gap-0.5",
|
|
74
|
+
title: props.title,
|
|
75
|
+
children: [/* @__PURE__ */ jsx("dt", {
|
|
76
|
+
className: "text-xs text-muted-foreground",
|
|
77
|
+
children: props.label
|
|
78
|
+
}), /* @__PURE__ */ jsx("dd", {
|
|
79
|
+
className: "truncate text-[13px] tabular-nums text-foreground",
|
|
80
|
+
children: props.children
|
|
81
|
+
})]
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
//#endregion
|
|
85
|
+
//#region editors/workflow-studio/components/RunDialog.tsx
|
|
86
|
+
function RunDialog(props) {
|
|
87
|
+
const fields = useMemo(() => props.inputs.map(manualInputProp), [props.inputs]);
|
|
88
|
+
const [values, setValues] = useState(() => manualInputValues(props.inputs));
|
|
89
|
+
const latest = useRef(values);
|
|
90
|
+
const [raw, setRaw] = useState(null);
|
|
91
|
+
const [error, setError] = useState(null);
|
|
92
|
+
const [firing, setFiring] = useState(false);
|
|
93
|
+
const rawId = useId();
|
|
94
|
+
const payload = () => {
|
|
95
|
+
if (raw === null) return manualRunPayload(props.inputs, latest.current);
|
|
96
|
+
try {
|
|
97
|
+
return JSON.parse(raw === "" ? "{}" : raw);
|
|
98
|
+
} catch {
|
|
99
|
+
throw new Error("The payload is not valid JSON.");
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
return /* @__PURE__ */ jsx(Modal, {
|
|
103
|
+
open: true,
|
|
104
|
+
title: "Run workflow",
|
|
105
|
+
onOpenChange: (open) => {
|
|
106
|
+
if (!open) props.onCancel();
|
|
107
|
+
},
|
|
108
|
+
contentProps: {
|
|
109
|
+
className: "max-h-[85vh] w-[32rem] max-w-[92vw] overflow-y-auto rounded-xl border border-solid border-foreground/10",
|
|
110
|
+
"aria-label": "Run workflow"
|
|
111
|
+
},
|
|
112
|
+
children: /* @__PURE__ */ jsxs("form", {
|
|
113
|
+
className: "flex flex-col gap-4 p-6",
|
|
114
|
+
noValidate: true,
|
|
115
|
+
onSubmit: (event) => {
|
|
116
|
+
event.preventDefault();
|
|
117
|
+
if (firing) return;
|
|
118
|
+
document.activeElement?.blur();
|
|
119
|
+
let body;
|
|
120
|
+
try {
|
|
121
|
+
body = payload();
|
|
122
|
+
} catch (cause) {
|
|
123
|
+
setError(cause instanceof Error ? cause.message : String(cause));
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
setFiring(true);
|
|
127
|
+
setError(null);
|
|
128
|
+
props.onFire(body).then((fireError) => fireError, (cause) => cause instanceof Error ? cause.message : String(cause)).then((fireError) => {
|
|
129
|
+
setFiring(false);
|
|
130
|
+
if (fireError) setError(fireError);
|
|
131
|
+
else props.onCancel();
|
|
132
|
+
});
|
|
133
|
+
},
|
|
134
|
+
children: [
|
|
135
|
+
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h2", {
|
|
136
|
+
className: "text-[15px] font-semibold text-foreground",
|
|
137
|
+
children: "Run workflow"
|
|
138
|
+
}), /* @__PURE__ */ jsxs("p", {
|
|
139
|
+
className: "mt-1 text-[13px] text-muted-foreground",
|
|
140
|
+
children: [
|
|
141
|
+
"The run reads these as ",
|
|
142
|
+
"{{trigger.payload.<key>}}",
|
|
143
|
+
"."
|
|
144
|
+
]
|
|
145
|
+
})] }),
|
|
146
|
+
/* @__PURE__ */ jsx(Switch, {
|
|
147
|
+
label: "Raw JSON",
|
|
148
|
+
checked: raw !== null,
|
|
149
|
+
onChange: (on) => {
|
|
150
|
+
setError(null);
|
|
151
|
+
if (!on) return setRaw(null);
|
|
152
|
+
setRaw(JSON.stringify(latest.current, null, 2));
|
|
153
|
+
}
|
|
154
|
+
}),
|
|
155
|
+
raw === null ? /* @__PURE__ */ jsx(PropertyForm, {
|
|
156
|
+
props: fields,
|
|
157
|
+
value: values,
|
|
158
|
+
onChange: (next) => {
|
|
159
|
+
latest.current = next;
|
|
160
|
+
setValues(next);
|
|
161
|
+
}
|
|
162
|
+
}) : /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("label", {
|
|
163
|
+
htmlFor: rawId,
|
|
164
|
+
className: "mb-1.5 block text-[13px] font-medium text-foreground",
|
|
165
|
+
children: "Payload"
|
|
166
|
+
}), /* @__PURE__ */ jsx("textarea", {
|
|
167
|
+
id: rawId,
|
|
168
|
+
className: `${textAreaClass} min-h-40 font-mono text-xs`,
|
|
169
|
+
value: raw,
|
|
170
|
+
spellCheck: false,
|
|
171
|
+
onChange: (event) => setRaw(event.target.value)
|
|
172
|
+
})] }),
|
|
173
|
+
error ? /* @__PURE__ */ jsx("p", {
|
|
174
|
+
role: "alert",
|
|
175
|
+
className: "rounded-md bg-wf-fail/10 px-3 py-2 text-[13px] text-wf-fail",
|
|
176
|
+
children: error
|
|
177
|
+
}) : null,
|
|
178
|
+
/* @__PURE__ */ jsxs("div", {
|
|
179
|
+
className: "flex justify-end gap-2",
|
|
180
|
+
children: [/* @__PURE__ */ jsx(Button, {
|
|
181
|
+
onClick: props.onCancel,
|
|
182
|
+
children: "Cancel"
|
|
183
|
+
}), /* @__PURE__ */ jsxs(Button, {
|
|
184
|
+
type: "submit",
|
|
185
|
+
variant: "primary",
|
|
186
|
+
disabled: firing,
|
|
187
|
+
children: [/* @__PURE__ */ jsx(Icon, {
|
|
188
|
+
name: "play",
|
|
189
|
+
className: "h-3.5 w-3.5"
|
|
190
|
+
}), firing ? "Running…" : "Run"]
|
|
191
|
+
})]
|
|
192
|
+
})
|
|
193
|
+
]
|
|
194
|
+
})
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
//#endregion
|
|
12
198
|
//#region editors/workflow-studio/components/step-outline.ts
|
|
13
199
|
function stepOutline(args) {
|
|
14
200
|
const inbound = /* @__PURE__ */ new Map();
|
|
@@ -340,35 +526,6 @@ function RunStrip(props) {
|
|
|
340
526
|
}) });
|
|
341
527
|
}
|
|
342
528
|
//#endregion
|
|
343
|
-
//#region editors/workflow-studio/components/ui.tsx
|
|
344
|
-
function StatusDot(props) {
|
|
345
|
-
const hollow = props.hollow ?? props.tone === "idle";
|
|
346
|
-
return /* @__PURE__ */ jsx("span", {
|
|
347
|
-
"aria-hidden": true,
|
|
348
|
-
className: `inline-block h-2 w-2 shrink-0 rounded-full ${hollow ? "border border-solid border-muted-foreground/60" : TONE_DOT[props.tone]} ${props.className ?? ""}`
|
|
349
|
-
});
|
|
350
|
-
}
|
|
351
|
-
function StatusText(props) {
|
|
352
|
-
return /* @__PURE__ */ jsxs("span", {
|
|
353
|
-
className: `inline-flex items-center gap-1.5 font-medium ${TONE_TEXT[props.tone]} ${props.className ?? ""}`,
|
|
354
|
-
children: [/* @__PURE__ */ jsx(StatusDot, { tone: props.tone }), props.label ?? statusLabel(props.status)]
|
|
355
|
-
});
|
|
356
|
-
}
|
|
357
|
-
/** A label/value pair for a header's facts line. */
|
|
358
|
-
function Fact(props) {
|
|
359
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
360
|
-
className: "flex min-w-0 flex-col gap-0.5",
|
|
361
|
-
title: props.title,
|
|
362
|
-
children: [/* @__PURE__ */ jsx("dt", {
|
|
363
|
-
className: "text-xs text-muted-foreground",
|
|
364
|
-
children: props.label
|
|
365
|
-
}), /* @__PURE__ */ jsx("dd", {
|
|
366
|
-
className: "truncate text-[13px] tabular-nums text-foreground",
|
|
367
|
-
children: props.children
|
|
368
|
-
})]
|
|
369
|
-
});
|
|
370
|
-
}
|
|
371
|
-
//#endregion
|
|
372
529
|
//#region editors/workflow-studio/components/RunsTable.tsx
|
|
373
530
|
const STATUS_FILTERS = ["ALL", ...RUN_STATUSES];
|
|
374
531
|
/** The runs table's query params. */
|
|
@@ -936,7 +1093,9 @@ function RunsTable(props) {
|
|
|
936
1093
|
function RunsView(props) {
|
|
937
1094
|
const [firing, setFiring] = useState(false);
|
|
938
1095
|
const [fireError, setFireError] = useState(null);
|
|
1096
|
+
const [asking, setAsking] = useState(false);
|
|
939
1097
|
const { runs } = props;
|
|
1098
|
+
const inputs = props.fireInputs ?? [];
|
|
940
1099
|
return /* @__PURE__ */ jsxs("div", {
|
|
941
1100
|
className: "w-full",
|
|
942
1101
|
children: [
|
|
@@ -952,6 +1111,11 @@ function RunsView(props) {
|
|
|
952
1111
|
variant: "primary",
|
|
953
1112
|
disabled: firing,
|
|
954
1113
|
onClick: () => {
|
|
1114
|
+
if (inputs.length > 0) {
|
|
1115
|
+
setFireError(null);
|
|
1116
|
+
setAsking(true);
|
|
1117
|
+
return;
|
|
1118
|
+
}
|
|
955
1119
|
setFiring(true);
|
|
956
1120
|
setFireError(null);
|
|
957
1121
|
props.onFire().then((fireResultError) => setFireError(fireResultError)).catch((fireCallError) => setFireError(fireCallError instanceof Error ? fireCallError.message : String(fireCallError))).finally(() => {
|
|
@@ -966,6 +1130,11 @@ function RunsView(props) {
|
|
|
966
1130
|
}) : null
|
|
967
1131
|
]
|
|
968
1132
|
}),
|
|
1133
|
+
asking && props.onFire && inputs.length > 0 ? /* @__PURE__ */ jsx(RunDialog, {
|
|
1134
|
+
inputs,
|
|
1135
|
+
onCancel: () => setAsking(false),
|
|
1136
|
+
onFire: (payload) => props.onFire(payload).finally(() => props.reload())
|
|
1137
|
+
}) : null,
|
|
969
1138
|
fireError ? /* @__PURE__ */ jsx("p", {
|
|
970
1139
|
className: "mb-3 rounded-md bg-wf-fail/10 px-3 py-2 text-[13px] text-wf-fail",
|
|
971
1140
|
children: fireError
|
|
@@ -2646,6 +2815,9 @@ function Studio(props) {
|
|
|
2646
2815
|
const { data: targetDocument } = useDocumentSafe(liveTarget?.id ?? null);
|
|
2647
2816
|
const targetTrigger = targetDocument?.header.documentType === WORKFLOW_TYPE ? targetDocument.state.global.trigger : null;
|
|
2648
2817
|
const manualTrigger = Boolean(targetTrigger && sameBlock(triggerBlock(targetTrigger), MANUAL_TRIGGER));
|
|
2818
|
+
const published = targetDocument?.header.documentType === WORKFLOW_TYPE ? targetDocument.state.global.published : null;
|
|
2819
|
+
const firedTrigger = published ? published.trigger : targetTrigger;
|
|
2820
|
+
const fireInputs = useMemo(() => firedTrigger && sameBlock(triggerBlock(firedTrigger), MANUAL_TRIGGER) ? parseManualInputs(firedTrigger.config) : [], [firedTrigger]);
|
|
2649
2821
|
return /* @__PURE__ */ jsxs("div", {
|
|
2650
2822
|
className: "flex h-full min-h-0 flex-col md:flex-row",
|
|
2651
2823
|
children: [/* @__PURE__ */ jsx(Sidebar, {
|
|
@@ -2697,7 +2869,8 @@ function Studio(props) {
|
|
|
2697
2869
|
hasMore: feed.hasMore,
|
|
2698
2870
|
loadingMore: feed.loadingMore,
|
|
2699
2871
|
onLoadMore: feed.loadMore,
|
|
2700
|
-
onFire: liveTarget && manualTrigger ? () => fireWorkflow(liveTarget.id).then((result) => result.error) : void 0
|
|
2872
|
+
onFire: liveTarget && manualTrigger ? (payload) => fireWorkflow(liveTarget.id, payload).then((result) => result.error) : void 0,
|
|
2873
|
+
fireInputs
|
|
2701
2874
|
})]
|
|
2702
2875
|
})
|
|
2703
2876
|
})]
|
|
@@ -2726,4 +2899,4 @@ function Editor(props) {
|
|
|
2726
2899
|
//#endregion
|
|
2727
2900
|
export { Editor as default };
|
|
2728
2901
|
|
|
2729
|
-
//# sourceMappingURL=editor-
|
|
2902
|
+
//# sourceMappingURL=editor-D3MlbYBN.mjs.map
|