@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,201 @@
|
|
|
1
1
|
import { A as MANUAL_TRIGGER, R as sameBlock, V as triggerBlock, k as CORE_PIECE, l as runsOfPages, z as stepBlock } from "./runtime-queries-LAcyniYz.js";
|
|
2
2
|
import { y as actions } from "./module-eOpxJVIl.js";
|
|
3
3
|
import { r as useWorkflowDocumentsInSelectedDrive } from "./workflow-Cn1UP-eJ.js";
|
|
4
|
-
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-
|
|
5
|
-
import {
|
|
4
|
+
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-CtoMNZ9A.js";
|
|
5
|
+
import { g as StatusToggle, i as DataViewer, l as StepError, o as PropertyForm, p as PublishState, r as describeTrigger } from "./trigger-text-BgpPIXEJ.js";
|
|
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
|
+
import { ManualPayloadError, coerceManualPayload, manualDefault, parseManualInputs } from "@powerhousedao/pieces-framework/workflow";
|
|
8
9
|
import { Fragment, useCallback, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
9
10
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
10
11
|
import { ConnectTooltip, ConnectTooltipProvider, Modal } from "@powerhousedao/design-system/connect";
|
|
11
12
|
import { addFolder as addFolder$1, moveNode, updateNode } from "@powerhousedao/shared/document-drive";
|
|
13
|
+
//#region editors/workflow-editor/ui/manual-inputs.ts
|
|
14
|
+
const PROPERTY_TYPES = {
|
|
15
|
+
text: "SHORT_TEXT",
|
|
16
|
+
text_area: "LONG_TEXT",
|
|
17
|
+
number: "NUMBER",
|
|
18
|
+
toggle: "CHECKBOX",
|
|
19
|
+
date: "DATE_TIME",
|
|
20
|
+
dropdown: "STATIC_DROPDOWN",
|
|
21
|
+
json: "JSON"
|
|
22
|
+
};
|
|
23
|
+
function manualInputProp(input) {
|
|
24
|
+
const defaultValue = manualDefault(input);
|
|
25
|
+
return {
|
|
26
|
+
name: input.name,
|
|
27
|
+
displayName: input.displayName,
|
|
28
|
+
type: PROPERTY_TYPES[input.type],
|
|
29
|
+
required: input.type === "toggle" ? false : input.required,
|
|
30
|
+
...input.description ? { description: input.description } : {},
|
|
31
|
+
...defaultValue !== void 0 ? { defaultValue } : {},
|
|
32
|
+
...input.type === "dropdown" ? { staticOptions: (input.options ?? []).map(({ value, label }) => ({
|
|
33
|
+
value,
|
|
34
|
+
label
|
|
35
|
+
})) } : {}
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function manualRunPayload(inputs, values) {
|
|
39
|
+
try {
|
|
40
|
+
return coerceManualPayload(inputs, values);
|
|
41
|
+
} catch (error) {
|
|
42
|
+
if (!(error instanceof ManualPayloadError)) throw error;
|
|
43
|
+
const label = (name) => inputs.find((input) => input.name === name)?.displayName ?? name;
|
|
44
|
+
throw new Error(error.fields.map((entry) => `${label(entry.field)} ${entry.message}`).join("; "), { cause: error });
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
function manualInputValues(inputs) {
|
|
48
|
+
const values = {};
|
|
49
|
+
for (const input of inputs) {
|
|
50
|
+
const value = manualDefault(input);
|
|
51
|
+
if (value !== void 0) values[input.name] = value;
|
|
52
|
+
else if (input.type === "toggle") values[input.name] = false;
|
|
53
|
+
}
|
|
54
|
+
return values;
|
|
55
|
+
}
|
|
56
|
+
//#endregion
|
|
57
|
+
//#region editors/workflow-studio/components/ui.tsx
|
|
58
|
+
function StatusDot(props) {
|
|
59
|
+
const hollow = props.hollow ?? props.tone === "idle";
|
|
60
|
+
return /* @__PURE__ */ jsx("span", {
|
|
61
|
+
"aria-hidden": true,
|
|
62
|
+
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 ?? ""}`
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
function StatusText(props) {
|
|
66
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
67
|
+
className: `inline-flex items-center gap-1.5 font-medium ${TONE_TEXT[props.tone]} ${props.className ?? ""}`,
|
|
68
|
+
children: [/* @__PURE__ */ jsx(StatusDot, { tone: props.tone }), props.label ?? statusLabel(props.status)]
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
/** A label/value pair for a header's facts line. */
|
|
72
|
+
function Fact(props) {
|
|
73
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
74
|
+
className: "flex min-w-0 flex-col gap-0.5",
|
|
75
|
+
title: props.title,
|
|
76
|
+
children: [/* @__PURE__ */ jsx("dt", {
|
|
77
|
+
className: "text-xs text-muted-foreground",
|
|
78
|
+
children: props.label
|
|
79
|
+
}), /* @__PURE__ */ jsx("dd", {
|
|
80
|
+
className: "truncate text-[13px] tabular-nums text-foreground",
|
|
81
|
+
children: props.children
|
|
82
|
+
})]
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
//#endregion
|
|
86
|
+
//#region editors/workflow-studio/components/RunDialog.tsx
|
|
87
|
+
function RunDialog(props) {
|
|
88
|
+
const fields = useMemo(() => props.inputs.map(manualInputProp), [props.inputs]);
|
|
89
|
+
const [values, setValues] = useState(() => manualInputValues(props.inputs));
|
|
90
|
+
const latest = useRef(values);
|
|
91
|
+
const [raw, setRaw] = useState(null);
|
|
92
|
+
const [error, setError] = useState(null);
|
|
93
|
+
const [firing, setFiring] = useState(false);
|
|
94
|
+
const rawId = useId();
|
|
95
|
+
const payload = () => {
|
|
96
|
+
if (raw === null) return manualRunPayload(props.inputs, latest.current);
|
|
97
|
+
try {
|
|
98
|
+
return JSON.parse(raw === "" ? "{}" : raw);
|
|
99
|
+
} catch {
|
|
100
|
+
throw new Error("The payload is not valid JSON.");
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
return /* @__PURE__ */ jsx(Modal, {
|
|
104
|
+
open: true,
|
|
105
|
+
title: "Run workflow",
|
|
106
|
+
onOpenChange: (open) => {
|
|
107
|
+
if (!open) props.onCancel();
|
|
108
|
+
},
|
|
109
|
+
contentProps: {
|
|
110
|
+
className: "max-h-[85vh] w-[32rem] max-w-[92vw] overflow-y-auto rounded-xl border border-solid border-foreground/10",
|
|
111
|
+
"aria-label": "Run workflow"
|
|
112
|
+
},
|
|
113
|
+
children: /* @__PURE__ */ jsxs("form", {
|
|
114
|
+
className: "flex flex-col gap-4 p-6",
|
|
115
|
+
noValidate: true,
|
|
116
|
+
onSubmit: (event) => {
|
|
117
|
+
event.preventDefault();
|
|
118
|
+
if (firing) return;
|
|
119
|
+
document.activeElement?.blur();
|
|
120
|
+
let body;
|
|
121
|
+
try {
|
|
122
|
+
body = payload();
|
|
123
|
+
} catch (cause) {
|
|
124
|
+
setError(cause instanceof Error ? cause.message : String(cause));
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
setFiring(true);
|
|
128
|
+
setError(null);
|
|
129
|
+
props.onFire(body).then((fireError) => fireError, (cause) => cause instanceof Error ? cause.message : String(cause)).then((fireError) => {
|
|
130
|
+
setFiring(false);
|
|
131
|
+
if (fireError) setError(fireError);
|
|
132
|
+
else props.onCancel();
|
|
133
|
+
});
|
|
134
|
+
},
|
|
135
|
+
children: [
|
|
136
|
+
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h2", {
|
|
137
|
+
className: "text-[15px] font-semibold text-foreground",
|
|
138
|
+
children: "Run workflow"
|
|
139
|
+
}), /* @__PURE__ */ jsxs("p", {
|
|
140
|
+
className: "mt-1 text-[13px] text-muted-foreground",
|
|
141
|
+
children: [
|
|
142
|
+
"The run reads these as ",
|
|
143
|
+
"{{trigger.payload.<key>}}",
|
|
144
|
+
"."
|
|
145
|
+
]
|
|
146
|
+
})] }),
|
|
147
|
+
/* @__PURE__ */ jsx(Switch, {
|
|
148
|
+
label: "Raw JSON",
|
|
149
|
+
checked: raw !== null,
|
|
150
|
+
onChange: (on) => {
|
|
151
|
+
setError(null);
|
|
152
|
+
if (!on) return setRaw(null);
|
|
153
|
+
setRaw(JSON.stringify(latest.current, null, 2));
|
|
154
|
+
}
|
|
155
|
+
}),
|
|
156
|
+
raw === null ? /* @__PURE__ */ jsx(PropertyForm, {
|
|
157
|
+
props: fields,
|
|
158
|
+
value: values,
|
|
159
|
+
onChange: (next) => {
|
|
160
|
+
latest.current = next;
|
|
161
|
+
setValues(next);
|
|
162
|
+
}
|
|
163
|
+
}) : /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("label", {
|
|
164
|
+
htmlFor: rawId,
|
|
165
|
+
className: "mb-1.5 block text-[13px] font-medium text-foreground",
|
|
166
|
+
children: "Payload"
|
|
167
|
+
}), /* @__PURE__ */ jsx("textarea", {
|
|
168
|
+
id: rawId,
|
|
169
|
+
className: `${textAreaClass} min-h-40 font-mono text-xs`,
|
|
170
|
+
value: raw,
|
|
171
|
+
spellCheck: false,
|
|
172
|
+
onChange: (event) => setRaw(event.target.value)
|
|
173
|
+
})] }),
|
|
174
|
+
error ? /* @__PURE__ */ jsx("p", {
|
|
175
|
+
role: "alert",
|
|
176
|
+
className: "rounded-md bg-wf-fail/10 px-3 py-2 text-[13px] text-wf-fail",
|
|
177
|
+
children: error
|
|
178
|
+
}) : null,
|
|
179
|
+
/* @__PURE__ */ jsxs("div", {
|
|
180
|
+
className: "flex justify-end gap-2",
|
|
181
|
+
children: [/* @__PURE__ */ jsx(Button, {
|
|
182
|
+
onClick: props.onCancel,
|
|
183
|
+
children: "Cancel"
|
|
184
|
+
}), /* @__PURE__ */ jsxs(Button, {
|
|
185
|
+
type: "submit",
|
|
186
|
+
variant: "primary",
|
|
187
|
+
disabled: firing,
|
|
188
|
+
children: [/* @__PURE__ */ jsx(Icon, {
|
|
189
|
+
name: "play",
|
|
190
|
+
className: "h-3.5 w-3.5"
|
|
191
|
+
}), firing ? "Running…" : "Run"]
|
|
192
|
+
})]
|
|
193
|
+
})
|
|
194
|
+
]
|
|
195
|
+
})
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
//#endregion
|
|
12
199
|
//#region editors/workflow-studio/components/step-outline.ts
|
|
13
200
|
function stepOutline(args) {
|
|
14
201
|
const inbound = /* @__PURE__ */ new Map();
|
|
@@ -340,35 +527,6 @@ function RunStrip(props) {
|
|
|
340
527
|
}) });
|
|
341
528
|
}
|
|
342
529
|
//#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
530
|
//#region editors/workflow-studio/components/RunsTable.tsx
|
|
373
531
|
const STATUS_FILTERS = ["ALL", ...RUN_STATUSES];
|
|
374
532
|
/** The runs table's query params. */
|
|
@@ -936,7 +1094,9 @@ function RunsTable(props) {
|
|
|
936
1094
|
function RunsView(props) {
|
|
937
1095
|
const [firing, setFiring] = useState(false);
|
|
938
1096
|
const [fireError, setFireError] = useState(null);
|
|
1097
|
+
const [asking, setAsking] = useState(false);
|
|
939
1098
|
const { runs } = props;
|
|
1099
|
+
const inputs = props.fireInputs ?? [];
|
|
940
1100
|
return /* @__PURE__ */ jsxs("div", {
|
|
941
1101
|
className: "w-full",
|
|
942
1102
|
children: [
|
|
@@ -952,6 +1112,11 @@ function RunsView(props) {
|
|
|
952
1112
|
variant: "primary",
|
|
953
1113
|
disabled: firing,
|
|
954
1114
|
onClick: () => {
|
|
1115
|
+
if (inputs.length > 0) {
|
|
1116
|
+
setFireError(null);
|
|
1117
|
+
setAsking(true);
|
|
1118
|
+
return;
|
|
1119
|
+
}
|
|
955
1120
|
setFiring(true);
|
|
956
1121
|
setFireError(null);
|
|
957
1122
|
props.onFire().then((fireResultError) => setFireError(fireResultError)).catch((fireCallError) => setFireError(fireCallError instanceof Error ? fireCallError.message : String(fireCallError))).finally(() => {
|
|
@@ -966,6 +1131,11 @@ function RunsView(props) {
|
|
|
966
1131
|
}) : null
|
|
967
1132
|
]
|
|
968
1133
|
}),
|
|
1134
|
+
asking && props.onFire && inputs.length > 0 ? /* @__PURE__ */ jsx(RunDialog, {
|
|
1135
|
+
inputs,
|
|
1136
|
+
onCancel: () => setAsking(false),
|
|
1137
|
+
onFire: (payload) => props.onFire(payload).finally(() => props.reload())
|
|
1138
|
+
}) : null,
|
|
969
1139
|
fireError ? /* @__PURE__ */ jsx("p", {
|
|
970
1140
|
className: "mb-3 rounded-md bg-wf-fail/10 px-3 py-2 text-[13px] text-wf-fail",
|
|
971
1141
|
children: fireError
|
|
@@ -2646,6 +2816,9 @@ function Studio(props) {
|
|
|
2646
2816
|
const { data: targetDocument } = useDocumentSafe(liveTarget?.id ?? null);
|
|
2647
2817
|
const targetTrigger = targetDocument?.header.documentType === WORKFLOW_TYPE ? targetDocument.state.global.trigger : null;
|
|
2648
2818
|
const manualTrigger = Boolean(targetTrigger && sameBlock(triggerBlock(targetTrigger), MANUAL_TRIGGER));
|
|
2819
|
+
const published = targetDocument?.header.documentType === WORKFLOW_TYPE ? targetDocument.state.global.published : null;
|
|
2820
|
+
const firedTrigger = published ? published.trigger : targetTrigger;
|
|
2821
|
+
const fireInputs = useMemo(() => firedTrigger && sameBlock(triggerBlock(firedTrigger), MANUAL_TRIGGER) ? parseManualInputs(firedTrigger.config) : [], [firedTrigger]);
|
|
2649
2822
|
return /* @__PURE__ */ jsxs("div", {
|
|
2650
2823
|
className: "flex h-full min-h-0 flex-col md:flex-row",
|
|
2651
2824
|
children: [/* @__PURE__ */ jsx(Sidebar, {
|
|
@@ -2697,7 +2870,8 @@ function Studio(props) {
|
|
|
2697
2870
|
hasMore: feed.hasMore,
|
|
2698
2871
|
loadingMore: feed.loadingMore,
|
|
2699
2872
|
onLoadMore: feed.loadMore,
|
|
2700
|
-
onFire: liveTarget && manualTrigger ? () => fireWorkflow(liveTarget.id).then((result) => result.error) : void 0
|
|
2873
|
+
onFire: liveTarget && manualTrigger ? (payload) => fireWorkflow(liveTarget.id, payload).then((result) => result.error) : void 0,
|
|
2874
|
+
fireInputs
|
|
2701
2875
|
})]
|
|
2702
2876
|
})
|
|
2703
2877
|
})]
|
|
@@ -2726,4 +2900,4 @@ function Editor(props) {
|
|
|
2726
2900
|
//#endregion
|
|
2727
2901
|
export { Editor as default };
|
|
2728
2902
|
|
|
2729
|
-
//# sourceMappingURL=editor-
|
|
2903
|
+
//# sourceMappingURL=editor-B1AzXxaF.js.map
|