@oomol-lab/open-flow 0.1.0-beta.4 → 0.1.0-beta.6
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/browser/{DesignerIcon-DdfuH2jW.js → DesignerIcon-XKBRy_0Q.js} +640 -640
- package/dist/browser/createResourceDialog-Cf7QpXp6.js +505 -0
- package/dist/browser/{dist-BMqL-qR5.js → dist-BMRLCebL.js} +291 -292
- package/dist/browser/{dist-DWADUsVB.js → dist-By46o5UV.js} +47 -47
- package/dist/browser/{dist-CJpzJrLM.js → dist-Cc0y2Pli.js} +811 -812
- package/dist/browser/{dist-DUzA0Ukh.js → dist-Dg_VXC8f.js} +134 -135
- package/dist/browser/{dist-3Mj8q8Pr.js → dist-DmuE3M0R.js} +53 -54
- package/dist/browser/{dist-BN4ZCyOB.js → dist-DpDLsYtO.js} +14 -15
- package/dist/browser/dist-DxahK_I8.js +2688 -0
- package/dist/browser/{dist-CPuF50D9.js → dist-meg_oHVR.js} +335 -335
- package/dist/browser/{esm-C9jQK70n.js → esm-CTcBY7hh.js} +5 -6
- package/dist/browser/flow-authoring-module.d.ts +2 -2
- package/dist/browser/flow-authoring-node.d.ts +2 -2
- package/dist/browser/flow-authoring.js +475 -209
- package/dist/browser/flow-change.d.ts +98 -8
- package/dist/browser/flow-change.js +319 -96
- package/dist/browser/{flowChanges-Bs-ZcJV8.js → flowChanges-BDqD_Q4G.js} +1628 -1555
- package/dist/browser/{flowRunInputEditorStore-BYa8zFLC.js → flowRunInputEditorStore-DDidwd8h.js} +9 -1
- package/dist/browser/{flowWorkspace-BewofPeU.js → flowWorkspace-CPBHm14t.js} +9803 -9769
- package/dist/browser/{getPseudoElementBounds-qDxSDwzN.js → getPseudoElementBounds-5LArT6Xc.js} +494 -474
- package/dist/browser/icons-CRxvozBE.js +726 -0
- package/dist/browser/{typeScriptSession-CwMPjseS.js → typeScriptSession-_TgJ_7Oq.js} +256 -257
- package/dist/browser/{waitNotificationInputs-DtrPBwA1.js → waitNotificationInputs-lPrLDTOd.js} +2 -2
- package/dist/browser/workbench.css +1 -1
- package/dist/browser/workbench.js +573 -578
- package/dist/browser/{workbenchSelect-CX8KtT7L.js → workbenchSelect-Cf1zlVm9.js} +398 -398
- package/dist/common/control-api-conformance.js +27 -19
- package/dist/common/control-api.d.ts +4 -11
- package/dist/common/control-api.js +6 -18
- package/dist/common/flow-encoding.js +4 -0
- package/dist/common/flow-semantics.js +8 -10
- package/dist/common/runtime-contract.d.ts +1 -1
- package/dist/common/runtime-contract.js +27 -0
- package/dist/common/scheduler.d.ts +1 -1
- package/dist/common/scheduler.js +17 -18
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
- package/dist/browser/createResourceDialog-4YQKl8lG.js +0 -505
- package/dist/browser/dist-BpopSHwP.js +0 -1543
- package/dist/browser/dist-CUSrALSX.js +0 -1620
- package/dist/browser/icons-DRoMXL5h.js +0 -521
|
@@ -0,0 +1,726 @@
|
|
|
1
|
+
import { At as e, Ot as t, Un as n, Wn as r } from "./getPseudoElementBounds-5LArT6Xc.js";
|
|
2
|
+
import { useMemo as i } from "react";
|
|
3
|
+
import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
4
|
+
//#region src/ui/browser/label.tsx
|
|
5
|
+
function c({ className: e, ...t }) {
|
|
6
|
+
return /* @__PURE__ */ o("label", {
|
|
7
|
+
"data-slot": "label",
|
|
8
|
+
className: n("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50", e),
|
|
9
|
+
...t
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region src/ui/browser/field.tsx
|
|
14
|
+
function l({ className: e, ...t }) {
|
|
15
|
+
return /* @__PURE__ */ o("div", {
|
|
16
|
+
"data-slot": "field-group",
|
|
17
|
+
className: n("group/field-group @container/field-group flex w-full flex-col gap-5 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4", e),
|
|
18
|
+
...t
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
var u = r("group/field flex w-full gap-2 data-[invalid=true]:text-destructive", {
|
|
22
|
+
variants: { orientation: {
|
|
23
|
+
vertical: "flex-col *:w-full [&>.sr-only]:w-auto",
|
|
24
|
+
horizontal: "flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
|
|
25
|
+
responsive: "flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"
|
|
26
|
+
} },
|
|
27
|
+
defaultVariants: { orientation: "vertical" }
|
|
28
|
+
});
|
|
29
|
+
function d({ className: e, orientation: t = "vertical", ...r }) {
|
|
30
|
+
return /* @__PURE__ */ o("div", {
|
|
31
|
+
role: "group",
|
|
32
|
+
"data-slot": "field",
|
|
33
|
+
"data-orientation": t,
|
|
34
|
+
className: n(u({ orientation: t }), e),
|
|
35
|
+
...r
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
function f({ className: e, ...t }) {
|
|
39
|
+
return /* @__PURE__ */ o(c, {
|
|
40
|
+
"data-slot": "field-label",
|
|
41
|
+
className: n("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border has-[>[data-slot=field]]:not-has-[:disabled,[data-disabled]]:hover:bg-muted/50 has-[>[data-slot=field]]:has-[:focus-visible]:border-ring has-[>[data-slot=field]]:has-[:focus-visible]:ring-3 has-[>[data-slot=field]]:has-[:focus-visible]:ring-ring/50 *:data-[slot=field]:p-2.5 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10", "has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col", e),
|
|
42
|
+
...t
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
function p({ className: e, ...t }) {
|
|
46
|
+
return /* @__PURE__ */ o("p", {
|
|
47
|
+
"data-slot": "field-description",
|
|
48
|
+
className: n("text-left text-sm leading-normal font-normal text-muted-foreground group-has-data-horizontal/field:text-balance [[data-variant=legend]+&]:-mt-1.5", "last:mt-0 nth-last-2:-mt-1", "[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary", e),
|
|
49
|
+
...t
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
function m({ className: e, children: t, errors: r, ...a }) {
|
|
53
|
+
let s = i(() => {
|
|
54
|
+
if (t) return t;
|
|
55
|
+
if (!r?.length) return null;
|
|
56
|
+
let e = [...new Map(r.map((e) => [e?.message, e])).values()];
|
|
57
|
+
return e?.length == 1 ? e[0]?.message : /* @__PURE__ */ o("ul", {
|
|
58
|
+
className: "ml-4 flex list-disc flex-col gap-1",
|
|
59
|
+
children: e.map((e, t) => e?.message && /* @__PURE__ */ o("li", { children: e.message }, t))
|
|
60
|
+
});
|
|
61
|
+
}, [t, r]);
|
|
62
|
+
return s ? /* @__PURE__ */ o("div", {
|
|
63
|
+
role: "alert",
|
|
64
|
+
"data-slot": "field-error",
|
|
65
|
+
className: n("text-sm font-normal text-destructive", e),
|
|
66
|
+
...a,
|
|
67
|
+
children: s
|
|
68
|
+
}) : null;
|
|
69
|
+
}
|
|
70
|
+
//#endregion
|
|
71
|
+
//#region ../../node_modules/.bun/lucide-react@0.468.0+f4eacebf2041cd4f/node_modules/lucide-react/dist/esm/icons/chevron-down.js
|
|
72
|
+
var h = e("ChevronDown", [["path", {
|
|
73
|
+
d: "m6 9 6 6 6-6",
|
|
74
|
+
key: "qrunsl"
|
|
75
|
+
}]]), g = e("LoaderCircle", [["path", {
|
|
76
|
+
d: "M21 12a9 9 0 1 1-6.219-8.56",
|
|
77
|
+
key: "13zald"
|
|
78
|
+
}]]);
|
|
79
|
+
//#endregion
|
|
80
|
+
//#region src/ui/browser/spinner.tsx
|
|
81
|
+
function _({ className: e, ...t }) {
|
|
82
|
+
return /* @__PURE__ */ o(g, {
|
|
83
|
+
"data-slot": "spinner",
|
|
84
|
+
role: "status",
|
|
85
|
+
"aria-label": "Loading",
|
|
86
|
+
className: n("size-4 animate-spin", e),
|
|
87
|
+
...t
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
function v(e) {
|
|
91
|
+
let t = e.trim();
|
|
92
|
+
if (t.length == 0) return "empty";
|
|
93
|
+
if (t.length > 80) return "tooLong";
|
|
94
|
+
for (let e of t) {
|
|
95
|
+
let t = e.charCodeAt(0);
|
|
96
|
+
if (t <= 31 || t >= 127 && t <= 159) return "controlCharacter";
|
|
97
|
+
}
|
|
98
|
+
if (!/^[\p{L}\p{N}](?:[\p{L}\p{N} _-]*[\p{L}\p{N}])?$/u.test(t)) return "specialCharacter";
|
|
99
|
+
}
|
|
100
|
+
function y(e) {
|
|
101
|
+
return Object.fromEntries(e.flatMap((e) => "handle" in e ? [[e.handle, e]] : []));
|
|
102
|
+
}
|
|
103
|
+
var b = class extends Error {};
|
|
104
|
+
function x() {
|
|
105
|
+
throw new b();
|
|
106
|
+
}
|
|
107
|
+
function S(e, t) {
|
|
108
|
+
if (t.kind == "flow") return e.graph;
|
|
109
|
+
let n = e.subflows[t.id];
|
|
110
|
+
return n ?? x(), n.graph;
|
|
111
|
+
}
|
|
112
|
+
function C(e, t, n) {
|
|
113
|
+
if (t.kind == "flow") return {
|
|
114
|
+
...e,
|
|
115
|
+
graph: n
|
|
116
|
+
};
|
|
117
|
+
let r = e.subflows[t.id];
|
|
118
|
+
return r ?? x(), {
|
|
119
|
+
...e,
|
|
120
|
+
subflows: {
|
|
121
|
+
...e.subflows,
|
|
122
|
+
[t.id]: {
|
|
123
|
+
...r,
|
|
124
|
+
graph: n
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
function w(e, t) {
|
|
130
|
+
if (!("inputs" in e)) return e;
|
|
131
|
+
let n = { ...e.inputs };
|
|
132
|
+
for (let [e, r] of Object.entries(n)) {
|
|
133
|
+
if (r.kind != "sources") continue;
|
|
134
|
+
let i = r.sources.filter((e) => e.kind != "node" || !t.has(e.nodeId));
|
|
135
|
+
i.length == 0 ? delete n[e] : n[e] = {
|
|
136
|
+
kind: "sources",
|
|
137
|
+
sources: i
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
return {
|
|
141
|
+
...e,
|
|
142
|
+
inputs: n
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
function T(e, n) {
|
|
146
|
+
let r = { ...e.document }, i = { ...e.modules };
|
|
147
|
+
for (let e of n) switch (e.kind) {
|
|
148
|
+
case "binding.create":
|
|
149
|
+
r.bindings[e.bindingId] != null && x(), r.bindings = {
|
|
150
|
+
...r.bindings,
|
|
151
|
+
[e.bindingId]: e.binding
|
|
152
|
+
};
|
|
153
|
+
break;
|
|
154
|
+
case "binding.delete": {
|
|
155
|
+
r.bindings[e.bindingId] ?? x();
|
|
156
|
+
let t = { ...r.bindings };
|
|
157
|
+
delete t[e.bindingId], r.bindings = t;
|
|
158
|
+
break;
|
|
159
|
+
}
|
|
160
|
+
case "binding.target.set": {
|
|
161
|
+
let t = r.bindings[e.bindingId];
|
|
162
|
+
(t == null || t.target != e.before) && x(), r.bindings = {
|
|
163
|
+
...r.bindings,
|
|
164
|
+
[e.bindingId]: {
|
|
165
|
+
...t,
|
|
166
|
+
target: e.value
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
break;
|
|
170
|
+
}
|
|
171
|
+
case "graph.edge.connect": {
|
|
172
|
+
let n = S(r, e.target);
|
|
173
|
+
n.nodes[e.edge.source] ?? x();
|
|
174
|
+
let i = n.nodes[e.edge.target];
|
|
175
|
+
(i == null || !("inputs" in i)) && x();
|
|
176
|
+
let a = i.inputs[e.edge.targetHandle];
|
|
177
|
+
t(a, e.before) || x();
|
|
178
|
+
let o = {
|
|
179
|
+
kind: "node",
|
|
180
|
+
nodeId: e.edge.source,
|
|
181
|
+
output: e.edge.sourceHandle
|
|
182
|
+
}, s = a?.kind == "sources" ? a.sources.filter((e) => e.kind != "binding" || r.bindings[e.bindingId]?.kind != "variable") : [];
|
|
183
|
+
s.some((e) => e.kind == "node" && e.nodeId == o.nodeId && e.output == o.output) && x();
|
|
184
|
+
let c = {
|
|
185
|
+
...i,
|
|
186
|
+
inputs: {
|
|
187
|
+
...i.inputs,
|
|
188
|
+
[e.edge.targetHandle]: {
|
|
189
|
+
kind: "sources",
|
|
190
|
+
sources: [...s, o]
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
Object.assign(r, C(r, e.target, { nodes: {
|
|
195
|
+
...n.nodes,
|
|
196
|
+
[e.edge.target]: c
|
|
197
|
+
} }));
|
|
198
|
+
break;
|
|
199
|
+
}
|
|
200
|
+
case "graph.edge.disconnect": {
|
|
201
|
+
let n = S(r, e.target), i = n.nodes[e.edge.target];
|
|
202
|
+
(i == null || !("inputs" in i)) && x();
|
|
203
|
+
let a = i.inputs[e.edge.targetHandle];
|
|
204
|
+
(a?.kind != "sources" || !t(a, e.before)) && x();
|
|
205
|
+
let o = a.sources.filter((t) => t.kind != "node" || t.nodeId != e.edge.source || t.output != e.edge.sourceHandle);
|
|
206
|
+
o.length == a.sources.length && x();
|
|
207
|
+
let s = { ...i.inputs };
|
|
208
|
+
o.length == 0 ? delete s[e.edge.targetHandle] : s[e.edge.targetHandle] = {
|
|
209
|
+
kind: "sources",
|
|
210
|
+
sources: o
|
|
211
|
+
}, Object.assign(r, C(r, e.target, { nodes: {
|
|
212
|
+
...n.nodes,
|
|
213
|
+
[e.edge.target]: {
|
|
214
|
+
...i,
|
|
215
|
+
inputs: s
|
|
216
|
+
}
|
|
217
|
+
} }));
|
|
218
|
+
break;
|
|
219
|
+
}
|
|
220
|
+
case "graph.node.additional-inputs.set": {
|
|
221
|
+
let n = S(r, e.target), i = n.nodes[e.nodeId];
|
|
222
|
+
(i?.kind != "task" || !t(i.additionalInputs, e.before)) && x();
|
|
223
|
+
let { additionalInputs: a, ...o } = i, s = e.value == null ? o : {
|
|
224
|
+
...o,
|
|
225
|
+
additionalInputs: e.value
|
|
226
|
+
};
|
|
227
|
+
Object.assign(r, C(r, e.target, { nodes: {
|
|
228
|
+
...n.nodes,
|
|
229
|
+
[e.nodeId]: s
|
|
230
|
+
} }));
|
|
231
|
+
break;
|
|
232
|
+
}
|
|
233
|
+
case "graph.node.condition.set": {
|
|
234
|
+
let n = S(r, e.target), i = n.nodes[e.nodeId];
|
|
235
|
+
i?.kind != "condition" && x(), (!t(i.cases, e.before.cases) || i.defaultOutput != e.before.defaultOutput || !t(i.input, e.before.input)) && x();
|
|
236
|
+
let { defaultOutput: a, ...o } = i, s = e.value.defaultOutput == null ? {
|
|
237
|
+
...o,
|
|
238
|
+
...e.value
|
|
239
|
+
} : {
|
|
240
|
+
...i,
|
|
241
|
+
...e.value
|
|
242
|
+
};
|
|
243
|
+
Object.assign(r, C(r, e.target, { nodes: {
|
|
244
|
+
...n.nodes,
|
|
245
|
+
[e.nodeId]: s
|
|
246
|
+
} }));
|
|
247
|
+
break;
|
|
248
|
+
}
|
|
249
|
+
case "graph.node.create": {
|
|
250
|
+
let t = S(r, e.target);
|
|
251
|
+
(t.nodes[e.nodeId] != null || e.target.kind == "subflow" && !("inputs" in e.node)) && x(), Object.assign(r, C(r, e.target, { nodes: {
|
|
252
|
+
...t.nodes,
|
|
253
|
+
[e.nodeId]: e.node
|
|
254
|
+
} }));
|
|
255
|
+
break;
|
|
256
|
+
}
|
|
257
|
+
case "graph.node.delete": {
|
|
258
|
+
let t = S(r, e.target);
|
|
259
|
+
t.nodes[e.nodeId] ?? x();
|
|
260
|
+
let n = /* @__PURE__ */ new Set([e.nodeId]), i = Object.fromEntries(Object.entries(t.nodes).flatMap(([e, t]) => n.has(e) ? [] : [[e, w(t, n)]]));
|
|
261
|
+
if (Object.assign(r, C(r, e.target, { nodes: i })), e.target.kind == "subflow") {
|
|
262
|
+
let t = r.subflows[e.target.id], i = t.outputs.map((e) => ({
|
|
263
|
+
...e,
|
|
264
|
+
sources: e.sources.filter((e) => e.kind != "node" || !n.has(e.nodeId))
|
|
265
|
+
}));
|
|
266
|
+
r.subflows = {
|
|
267
|
+
...r.subflows,
|
|
268
|
+
[e.target.id]: {
|
|
269
|
+
...t,
|
|
270
|
+
outputs: i
|
|
271
|
+
}
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
break;
|
|
275
|
+
}
|
|
276
|
+
case "graph.node.field.set": {
|
|
277
|
+
let n = S(r, e.target), i = n.nodes[e.nodeId];
|
|
278
|
+
(i == null || !t(Reflect.get(i, e.field), e.before)) && x(), e.field == "concurrency" && e.value == null && x();
|
|
279
|
+
let a = { ...i };
|
|
280
|
+
e.value == null ? Reflect.deleteProperty(a, e.field) : Object.assign(a, { [e.field]: e.value }), Object.assign(r, C(r, e.target, { nodes: {
|
|
281
|
+
...n.nodes,
|
|
282
|
+
[e.nodeId]: a
|
|
283
|
+
} }));
|
|
284
|
+
break;
|
|
285
|
+
}
|
|
286
|
+
case "graph.node.input.set": {
|
|
287
|
+
let n = S(r, e.target), i = n.nodes[e.nodeId];
|
|
288
|
+
(i == null || !("inputs" in i) || !t(i.inputs[e.handle], e.before)) && x();
|
|
289
|
+
let a = { ...i.inputs };
|
|
290
|
+
e.value == null ? delete a[e.handle] : a[e.handle] = e.value, Object.assign(r, C(r, e.target, { nodes: {
|
|
291
|
+
...n.nodes,
|
|
292
|
+
[e.nodeId]: {
|
|
293
|
+
...i,
|
|
294
|
+
inputs: a
|
|
295
|
+
}
|
|
296
|
+
} }));
|
|
297
|
+
break;
|
|
298
|
+
}
|
|
299
|
+
case "graph.node.task.name.set": {
|
|
300
|
+
let t = S(r, e.target), n = t.nodes[e.nodeId];
|
|
301
|
+
(n?.kind != "task" || n.task == null || n.task.name != e.before) && x();
|
|
302
|
+
let i = {
|
|
303
|
+
...n,
|
|
304
|
+
task: {
|
|
305
|
+
...n.task,
|
|
306
|
+
name: e.value
|
|
307
|
+
}
|
|
308
|
+
};
|
|
309
|
+
Object.assign(r, C(r, e.target, { nodes: {
|
|
310
|
+
...t.nodes,
|
|
311
|
+
[e.nodeId]: i
|
|
312
|
+
} }));
|
|
313
|
+
break;
|
|
314
|
+
}
|
|
315
|
+
case "graph.node.task.ports.set": {
|
|
316
|
+
let n = S(r, e.target), i = n.nodes[e.nodeId];
|
|
317
|
+
(i?.kind != "task" || i.task == null || !t({
|
|
318
|
+
inputs: i.task.inputs,
|
|
319
|
+
outputs: i.task.outputs
|
|
320
|
+
}, e.before)) && x();
|
|
321
|
+
let a = {
|
|
322
|
+
...i,
|
|
323
|
+
task: {
|
|
324
|
+
...i.task,
|
|
325
|
+
...e.value
|
|
326
|
+
}
|
|
327
|
+
};
|
|
328
|
+
Object.assign(r, C(r, e.target, { nodes: {
|
|
329
|
+
...n.nodes,
|
|
330
|
+
[e.nodeId]: a
|
|
331
|
+
} }));
|
|
332
|
+
break;
|
|
333
|
+
}
|
|
334
|
+
case "graph.node.values.set": {
|
|
335
|
+
let n = S(r, e.target), i = n.nodes[e.nodeId];
|
|
336
|
+
(i?.kind != "value" || !t(i.values, e.before)) && x(), Object.assign(r, C(r, e.target, { nodes: {
|
|
337
|
+
...n.nodes,
|
|
338
|
+
[e.nodeId]: {
|
|
339
|
+
...i,
|
|
340
|
+
values: e.value
|
|
341
|
+
}
|
|
342
|
+
} }));
|
|
343
|
+
break;
|
|
344
|
+
}
|
|
345
|
+
case "graph.node.wait.set": {
|
|
346
|
+
let n = r.graph, i = n.nodes[e.nodeId];
|
|
347
|
+
(i?.kind != "wait" || !t({
|
|
348
|
+
actions: i.actions,
|
|
349
|
+
...i.notification == null ? {} : { notification: i.notification },
|
|
350
|
+
prompt: i.prompt
|
|
351
|
+
}, e.before)) && x();
|
|
352
|
+
let { notification: a, ...o } = i, s = e.value.notification == null ? {
|
|
353
|
+
...o,
|
|
354
|
+
...e.value
|
|
355
|
+
} : {
|
|
356
|
+
...i,
|
|
357
|
+
...e.value
|
|
358
|
+
};
|
|
359
|
+
r.graph = { nodes: {
|
|
360
|
+
...n.nodes,
|
|
361
|
+
[e.nodeId]: s
|
|
362
|
+
} };
|
|
363
|
+
break;
|
|
364
|
+
}
|
|
365
|
+
case "graph.node.webhook.set": {
|
|
366
|
+
let n = S(r, e.target), i = n.nodes[e.nodeId];
|
|
367
|
+
(i?.kind != "webhook" || !t(i.inputsDef, e.before.inputsDef) || !t(i.options, e.before.options)) && x();
|
|
368
|
+
let { options: a, ...o } = i, s = e.value.options == null ? {
|
|
369
|
+
...o,
|
|
370
|
+
inputsDef: e.value.inputsDef
|
|
371
|
+
} : {
|
|
372
|
+
...i,
|
|
373
|
+
...e.value
|
|
374
|
+
};
|
|
375
|
+
Object.assign(r, C(r, e.target, { nodes: {
|
|
376
|
+
...n.nodes,
|
|
377
|
+
[e.nodeId]: s
|
|
378
|
+
} }));
|
|
379
|
+
break;
|
|
380
|
+
}
|
|
381
|
+
case "graph.trigger.config.set": {
|
|
382
|
+
let n = r.graph, i = n.nodes[e.nodeId];
|
|
383
|
+
(i == null || i.kind != "integration" && i.kind != "poll" || !t(i.config[e.name], e.before)) && x();
|
|
384
|
+
let a = { ...i.config };
|
|
385
|
+
e.value === void 0 ? delete a[e.name] : a[e.name] = e.value, r.graph = { nodes: {
|
|
386
|
+
...n.nodes,
|
|
387
|
+
[e.nodeId]: {
|
|
388
|
+
...i,
|
|
389
|
+
config: a
|
|
390
|
+
}
|
|
391
|
+
} };
|
|
392
|
+
break;
|
|
393
|
+
}
|
|
394
|
+
case "graph.trigger.schedule.set": {
|
|
395
|
+
let n = r.graph, i = n.nodes[e.nodeId];
|
|
396
|
+
(i == null || i.kind != "cron" && i.kind != "poll") && x();
|
|
397
|
+
let a = i.kind == "cron" ? i.cronTimes : i.pollTimes;
|
|
398
|
+
t(a, e.before) || x();
|
|
399
|
+
let o = i.kind == "cron" ? {
|
|
400
|
+
...i,
|
|
401
|
+
cronTimes: e.value
|
|
402
|
+
} : {
|
|
403
|
+
...i,
|
|
404
|
+
pollTimes: e.value
|
|
405
|
+
};
|
|
406
|
+
r.graph = { nodes: {
|
|
407
|
+
...n.nodes,
|
|
408
|
+
[e.nodeId]: o
|
|
409
|
+
} };
|
|
410
|
+
break;
|
|
411
|
+
}
|
|
412
|
+
case "module.create":
|
|
413
|
+
i[e.moduleId] != null && x(), i[e.moduleId] = e.module;
|
|
414
|
+
break;
|
|
415
|
+
case "module.delete":
|
|
416
|
+
i[e.moduleId] ?? x(), delete i[e.moduleId];
|
|
417
|
+
break;
|
|
418
|
+
case "module.rename": {
|
|
419
|
+
let t = i[e.moduleId];
|
|
420
|
+
(t == null || t.name != e.before) && x(), i[e.moduleId] = {
|
|
421
|
+
...t,
|
|
422
|
+
name: e.name
|
|
423
|
+
};
|
|
424
|
+
break;
|
|
425
|
+
}
|
|
426
|
+
case "module.source.replace": {
|
|
427
|
+
let n = i[e.moduleId];
|
|
428
|
+
(n == null || n.source != e.beforeSource || !t(n.imports, e.beforeImports)) && x(), i[e.moduleId] = {
|
|
429
|
+
...n,
|
|
430
|
+
imports: e.imports,
|
|
431
|
+
source: e.source
|
|
432
|
+
};
|
|
433
|
+
break;
|
|
434
|
+
}
|
|
435
|
+
case "subflow.create":
|
|
436
|
+
r.subflows[e.subflowId] != null && x(), r.subflows = {
|
|
437
|
+
...r.subflows,
|
|
438
|
+
[e.subflowId]: e.subflow
|
|
439
|
+
};
|
|
440
|
+
break;
|
|
441
|
+
case "subflow.definition.set": {
|
|
442
|
+
let n = r.subflows[e.subflowId];
|
|
443
|
+
(n == null || !t({
|
|
444
|
+
inputs: n.inputs,
|
|
445
|
+
name: n.name,
|
|
446
|
+
outputs: n.outputs
|
|
447
|
+
}, e.before)) && x(), r.subflows = {
|
|
448
|
+
...r.subflows,
|
|
449
|
+
[e.subflowId]: {
|
|
450
|
+
...e.definition,
|
|
451
|
+
graph: n.graph
|
|
452
|
+
}
|
|
453
|
+
};
|
|
454
|
+
break;
|
|
455
|
+
}
|
|
456
|
+
case "subflow.delete": {
|
|
457
|
+
r.subflows[e.subflowId] ?? x();
|
|
458
|
+
let t = { ...r.subflows };
|
|
459
|
+
delete t[e.subflowId], r.subflows = t;
|
|
460
|
+
break;
|
|
461
|
+
}
|
|
462
|
+
case "task.create":
|
|
463
|
+
r.tasks[e.taskId] != null && x(), r.tasks = {
|
|
464
|
+
...r.tasks,
|
|
465
|
+
[e.taskId]: e.task
|
|
466
|
+
};
|
|
467
|
+
break;
|
|
468
|
+
case "task.connector.connection.set": {
|
|
469
|
+
let t = r.tasks[e.taskId];
|
|
470
|
+
(t == null || !("executor" in t) || t.executor.kind != "connector" || t.executor.connectionId != e.before) && x();
|
|
471
|
+
let { connectionId: n, ...i } = t.executor, a = e.value == null ? i : {
|
|
472
|
+
...i,
|
|
473
|
+
connectionId: e.value
|
|
474
|
+
};
|
|
475
|
+
r.tasks = {
|
|
476
|
+
...r.tasks,
|
|
477
|
+
[e.taskId]: {
|
|
478
|
+
...t,
|
|
479
|
+
executor: a
|
|
480
|
+
}
|
|
481
|
+
};
|
|
482
|
+
break;
|
|
483
|
+
}
|
|
484
|
+
case "task.delete": {
|
|
485
|
+
r.tasks[e.taskId] ?? x();
|
|
486
|
+
let t = { ...r.tasks };
|
|
487
|
+
delete t[e.taskId], r.tasks = t;
|
|
488
|
+
break;
|
|
489
|
+
}
|
|
490
|
+
case "task.llm.mode.set": {
|
|
491
|
+
let t = r.tasks[e.taskId];
|
|
492
|
+
(t == null || !("executor" in t) || t.executor.kind != "llm" || t.executor.mode != e.before) && x(), r.tasks = {
|
|
493
|
+
...r.tasks,
|
|
494
|
+
[e.taskId]: {
|
|
495
|
+
...t,
|
|
496
|
+
executor: {
|
|
497
|
+
...t.executor,
|
|
498
|
+
mode: e.value
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
};
|
|
502
|
+
break;
|
|
503
|
+
}
|
|
504
|
+
case "task.name.set": {
|
|
505
|
+
let t = r.tasks[e.taskId];
|
|
506
|
+
(t == null || t.name != e.before) && x(), r.tasks = {
|
|
507
|
+
...r.tasks,
|
|
508
|
+
[e.taskId]: {
|
|
509
|
+
...t,
|
|
510
|
+
name: e.value
|
|
511
|
+
}
|
|
512
|
+
};
|
|
513
|
+
break;
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
return {
|
|
517
|
+
document: r,
|
|
518
|
+
modelVersion: e.modelVersion,
|
|
519
|
+
modules: i
|
|
520
|
+
};
|
|
521
|
+
}
|
|
522
|
+
//#endregion
|
|
523
|
+
//#region src/workbench/browser/runtime/icons.tsx
|
|
524
|
+
function E(e) {
|
|
525
|
+
switch (e) {
|
|
526
|
+
case "alert": return /* @__PURE__ */ s(a, { children: [
|
|
527
|
+
/* @__PURE__ */ o("circle", {
|
|
528
|
+
cx: "12",
|
|
529
|
+
cy: "12",
|
|
530
|
+
r: "9"
|
|
531
|
+
}),
|
|
532
|
+
/* @__PURE__ */ o("path", { d: "M12 7v6" }),
|
|
533
|
+
/* @__PURE__ */ o("path", { d: "M12 17h.01" })
|
|
534
|
+
] });
|
|
535
|
+
case "check": return /* @__PURE__ */ o("path", { d: "m5 12 4 4L19 6" });
|
|
536
|
+
case "chevron-down": return /* @__PURE__ */ o("path", { d: "m7 10 5 5 5-5" });
|
|
537
|
+
case "chevron-left": return /* @__PURE__ */ o("path", { d: "m15 18-6-6 6-6" });
|
|
538
|
+
case "chevron-up": return /* @__PURE__ */ o("path", { d: "m7 14 5-5 5 5" });
|
|
539
|
+
case "close": return /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o("path", { d: "m6 6 12 12" }), /* @__PURE__ */ o("path", { d: "M18 6 6 18" })] });
|
|
540
|
+
case "condition": return /* @__PURE__ */ o(a, { children: /* @__PURE__ */ o("path", { d: "M5 5h14l-5.5 6v6l-3 2v-8z" }) });
|
|
541
|
+
case "connection": return /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o("path", { d: "M10 13a5 5 0 0 0 7.1.1l2-2a5 5 0 0 0-7.1-7.1l-1.1 1.1" }), /* @__PURE__ */ o("path", { d: "M14 11a5 5 0 0 0-7.1-.1l-2 2A5 5 0 0 0 12 20l1.1-1.1" })] });
|
|
542
|
+
case "download": return /* @__PURE__ */ s(a, { children: [
|
|
543
|
+
/* @__PURE__ */ o("path", { d: "M12 4v11" }),
|
|
544
|
+
/* @__PURE__ */ o("path", { d: "m7 10 5 5 5-5" }),
|
|
545
|
+
/* @__PURE__ */ o("path", { d: "M5 20h14" })
|
|
546
|
+
] });
|
|
547
|
+
case "fit": return /* @__PURE__ */ s(a, { children: [
|
|
548
|
+
/* @__PURE__ */ o("path", { d: "M8 3H3v5" }),
|
|
549
|
+
/* @__PURE__ */ o("path", { d: "M16 3h5v5" }),
|
|
550
|
+
/* @__PURE__ */ o("path", { d: "M8 21H3v-5" }),
|
|
551
|
+
/* @__PURE__ */ o("path", { d: "M16 21h5v-5" })
|
|
552
|
+
] });
|
|
553
|
+
case "filter": return /* @__PURE__ */ o("path", { d: "M4 6h16l-6 7v5l-4 2v-7z" });
|
|
554
|
+
case "flow": return /* @__PURE__ */ s(a, { children: [
|
|
555
|
+
/* @__PURE__ */ o("circle", {
|
|
556
|
+
cx: "12",
|
|
557
|
+
cy: "5",
|
|
558
|
+
r: "2"
|
|
559
|
+
}),
|
|
560
|
+
/* @__PURE__ */ o("circle", {
|
|
561
|
+
cx: "6",
|
|
562
|
+
cy: "18",
|
|
563
|
+
r: "2"
|
|
564
|
+
}),
|
|
565
|
+
/* @__PURE__ */ o("circle", {
|
|
566
|
+
cx: "18",
|
|
567
|
+
cy: "18",
|
|
568
|
+
r: "2"
|
|
569
|
+
}),
|
|
570
|
+
/* @__PURE__ */ o("path", { d: "M12 7v4M6 16v-3h12v3" })
|
|
571
|
+
] });
|
|
572
|
+
case "hand": return /* @__PURE__ */ o("path", { d: "M8 11V6a1.5 1.5 0 0 1 3 0v4-6a1.5 1.5 0 0 1 3 0v6-4a1.5 1.5 0 0 1 3 0v5-2a1.5 1.5 0 0 1 3 0v4a8 8 0 0 1-16 0v-2a2 2 0 0 1 4 0Z" });
|
|
573
|
+
case "logo": return /* @__PURE__ */ s(a, { children: [
|
|
574
|
+
/* @__PURE__ */ o("circle", {
|
|
575
|
+
cx: "7",
|
|
576
|
+
cy: "5",
|
|
577
|
+
r: "2.5"
|
|
578
|
+
}),
|
|
579
|
+
/* @__PURE__ */ o("circle", {
|
|
580
|
+
cx: "7",
|
|
581
|
+
cy: "19",
|
|
582
|
+
r: "2.5"
|
|
583
|
+
}),
|
|
584
|
+
/* @__PURE__ */ o("circle", {
|
|
585
|
+
cx: "18",
|
|
586
|
+
cy: "12",
|
|
587
|
+
r: "2.5"
|
|
588
|
+
}),
|
|
589
|
+
/* @__PURE__ */ o("path", { d: "M9.2 6.2 15.7 10M9.2 17.8l6.5-3.8M7 7.5v9" })
|
|
590
|
+
] });
|
|
591
|
+
case "llm": return /* @__PURE__ */ s(a, { children: [
|
|
592
|
+
/* @__PURE__ */ o("path", { d: "M7 7h10v10H7z" }),
|
|
593
|
+
/* @__PURE__ */ o("path", { d: "M9 2v3m6-3v3M9 19v3m6-3v3M2 9h3m-3 6h3m14-6h3m-3 6h3" }),
|
|
594
|
+
/* @__PURE__ */ o("circle", {
|
|
595
|
+
cx: "10",
|
|
596
|
+
cy: "11",
|
|
597
|
+
r: ".7",
|
|
598
|
+
fill: "currentColor",
|
|
599
|
+
stroke: "none"
|
|
600
|
+
}),
|
|
601
|
+
/* @__PURE__ */ o("circle", {
|
|
602
|
+
cx: "14",
|
|
603
|
+
cy: "11",
|
|
604
|
+
r: ".7",
|
|
605
|
+
fill: "currentColor",
|
|
606
|
+
stroke: "none"
|
|
607
|
+
}),
|
|
608
|
+
/* @__PURE__ */ o("path", { d: "M10 14h4" })
|
|
609
|
+
] });
|
|
610
|
+
case "more": return /* @__PURE__ */ s(a, { children: [
|
|
611
|
+
/* @__PURE__ */ o("circle", {
|
|
612
|
+
cx: "5",
|
|
613
|
+
cy: "12",
|
|
614
|
+
r: "1",
|
|
615
|
+
fill: "currentColor",
|
|
616
|
+
stroke: "none"
|
|
617
|
+
}),
|
|
618
|
+
/* @__PURE__ */ o("circle", {
|
|
619
|
+
cx: "12",
|
|
620
|
+
cy: "12",
|
|
621
|
+
r: "1",
|
|
622
|
+
fill: "currentColor",
|
|
623
|
+
stroke: "none"
|
|
624
|
+
}),
|
|
625
|
+
/* @__PURE__ */ o("circle", {
|
|
626
|
+
cx: "19",
|
|
627
|
+
cy: "12",
|
|
628
|
+
r: "1",
|
|
629
|
+
fill: "currentColor",
|
|
630
|
+
stroke: "none"
|
|
631
|
+
})
|
|
632
|
+
] });
|
|
633
|
+
case "panel": return /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o("rect", {
|
|
634
|
+
x: "3",
|
|
635
|
+
y: "4",
|
|
636
|
+
width: "18",
|
|
637
|
+
height: "16",
|
|
638
|
+
rx: "2"
|
|
639
|
+
}), /* @__PURE__ */ o("path", { d: "M15 4v16" })] });
|
|
640
|
+
case "play":
|
|
641
|
+
case "run": return /* @__PURE__ */ o("path", { d: "m8 5 11 7-11 7z" });
|
|
642
|
+
case "pointer": return /* @__PURE__ */ o("path", { d: "m5 3 13 9-6 1-3 6z" });
|
|
643
|
+
case "plus": return /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o("path", { d: "M12 5v14" }), /* @__PURE__ */ o("path", { d: "M5 12h14" })] });
|
|
644
|
+
case "project": return /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o("path", { d: "M3 7h6l2 2h10v10H3z" }), /* @__PURE__ */ o("path", { d: "M3 7V5h7l2 2" })] });
|
|
645
|
+
case "publish": return /* @__PURE__ */ s(a, { children: [
|
|
646
|
+
/* @__PURE__ */ o("path", { d: "M12 16V4" }),
|
|
647
|
+
/* @__PURE__ */ o("path", { d: "m7 9 5-5 5 5" }),
|
|
648
|
+
/* @__PURE__ */ o("path", { d: "M5 14v5h14v-5" })
|
|
649
|
+
] });
|
|
650
|
+
case "refresh": return /* @__PURE__ */ s(a, { children: [
|
|
651
|
+
/* @__PURE__ */ o("path", { d: "M20 11a8 8 0 0 0-14.7-4.4L3 9" }),
|
|
652
|
+
/* @__PURE__ */ o("path", { d: "M3 4v5h5" }),
|
|
653
|
+
/* @__PURE__ */ o("path", { d: "M4 13a8 8 0 0 0 14.7 4.4L21 15" }),
|
|
654
|
+
/* @__PURE__ */ o("path", { d: "M21 20v-5h-5" })
|
|
655
|
+
] });
|
|
656
|
+
case "search": return /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o("circle", {
|
|
657
|
+
cx: "11",
|
|
658
|
+
cy: "11",
|
|
659
|
+
r: "7"
|
|
660
|
+
}), /* @__PURE__ */ o("path", { d: "m16 16 4 4" })] });
|
|
661
|
+
case "settings": return /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o("circle", {
|
|
662
|
+
cx: "12",
|
|
663
|
+
cy: "12",
|
|
664
|
+
r: "3"
|
|
665
|
+
}), /* @__PURE__ */ o("path", {
|
|
666
|
+
d: "M19 13.5v-3l-2-.6-.7-1.7 1-1.8-2.1-2.1-1.8 1-1.7-.7L10.5 3h-3l-.6 2-1.7.7-1.8-1-2.1 2.1 1 1.8-.7 1.7-2 .6v3l2 .6.7 1.7-1 1.8 2.1 2.1 1.8-1 1.7.7.6 2h3l.6-2 1.7-.7 1.8 1 2.1-2.1-1-1.8.7-1.7z",
|
|
667
|
+
transform: "translate(2.5) scale(.8)"
|
|
668
|
+
})] });
|
|
669
|
+
case "subflow": return /* @__PURE__ */ s(a, { children: [
|
|
670
|
+
/* @__PURE__ */ o("rect", {
|
|
671
|
+
x: "4",
|
|
672
|
+
y: "4",
|
|
673
|
+
width: "6",
|
|
674
|
+
height: "6",
|
|
675
|
+
rx: "1"
|
|
676
|
+
}),
|
|
677
|
+
/* @__PURE__ */ o("rect", {
|
|
678
|
+
x: "14",
|
|
679
|
+
y: "14",
|
|
680
|
+
width: "6",
|
|
681
|
+
height: "6",
|
|
682
|
+
rx: "1"
|
|
683
|
+
}),
|
|
684
|
+
/* @__PURE__ */ o("path", { d: "M10 7h4a3 3 0 0 1 3 3v4M14 17h-4a3 3 0 0 1-3-3v-4" })
|
|
685
|
+
] });
|
|
686
|
+
case "value": return /* @__PURE__ */ o("path", { d: "m12 3 8 9-8 9-8-9z" });
|
|
687
|
+
case "wait": return /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o("circle", {
|
|
688
|
+
cx: "12",
|
|
689
|
+
cy: "12",
|
|
690
|
+
r: "9"
|
|
691
|
+
}), /* @__PURE__ */ o("path", { d: "M12 7v5l3 2" })] });
|
|
692
|
+
case "task": return /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o("rect", {
|
|
693
|
+
x: "4",
|
|
694
|
+
y: "4",
|
|
695
|
+
width: "16",
|
|
696
|
+
height: "16",
|
|
697
|
+
rx: "3"
|
|
698
|
+
}), /* @__PURE__ */ o("path", { d: "m9 12 2 2 4-5" })] });
|
|
699
|
+
case "trigger": return /* @__PURE__ */ o(a, { children: /* @__PURE__ */ o("path", { d: "M13 2 5 14h6l-1 8 8-12h-6z" }) });
|
|
700
|
+
case "trash": return /* @__PURE__ */ s(a, { children: [
|
|
701
|
+
/* @__PURE__ */ o("path", { d: "M4 7h16" }),
|
|
702
|
+
/* @__PURE__ */ o("path", { d: "M9 7V4h6v3" }),
|
|
703
|
+
/* @__PURE__ */ o("path", { d: "m6 7 1 13h10l1-13" }),
|
|
704
|
+
/* @__PURE__ */ o("path", { d: "M10 11v5M14 11v5" })
|
|
705
|
+
] });
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
function D({ name: e, size: t = 18, ...n }) {
|
|
709
|
+
return /* @__PURE__ */ o("svg", {
|
|
710
|
+
"aria-hidden": "true",
|
|
711
|
+
fill: "none",
|
|
712
|
+
height: t,
|
|
713
|
+
viewBox: "0 0 24 24",
|
|
714
|
+
width: t,
|
|
715
|
+
...n,
|
|
716
|
+
children: /* @__PURE__ */ o("g", {
|
|
717
|
+
stroke: "currentColor",
|
|
718
|
+
strokeLinecap: "round",
|
|
719
|
+
strokeLinejoin: "round",
|
|
720
|
+
strokeWidth: "1.7",
|
|
721
|
+
children: E(e)
|
|
722
|
+
})
|
|
723
|
+
});
|
|
724
|
+
}
|
|
725
|
+
//#endregion
|
|
726
|
+
export { v as a, d as c, l as d, f, y as i, p as l, b as n, _ as o, c as p, T as r, h as s, D as t, m as u };
|