@teamflojo/floimg-studio-ui 0.5.3 → 0.5.4
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 +1 -1
- package/dist/index.js +999 -968
- package/dist/index.js.map +1 -1
- package/dist/stores/workflowStore.d.ts +9 -1
- package/dist/styles.css +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsxs as l, jsx as e, Fragment as
|
|
2
|
-
import { memo as re, useRef as X, useCallback as A, useMemo as
|
|
3
|
-
import
|
|
4
|
-
import { create as
|
|
5
|
-
import { useQuery as
|
|
6
|
-
function
|
|
1
|
+
import { jsxs as l, jsx as e, Fragment as se } from "react/jsx-runtime";
|
|
2
|
+
import { memo as re, useRef as X, useCallback as A, useMemo as de, useState as _, useEffect as G, useContext as Be, useLayoutEffect as rt, createContext as Re, useDeferredValue as at, useId as ye } from "react";
|
|
3
|
+
import ot, { Handle as D, Position as j, applyNodeChanges as nt, applyEdgeChanges as it, MarkerType as st, Background as dt, BackgroundVariant as lt, Controls as ct, MiniMap as mt, useReactFlow as De, ReactFlowProvider as pt } from "reactflow";
|
|
4
|
+
import { create as je } from "zustand";
|
|
5
|
+
import { useQuery as he } from "@tanstack/react-query";
|
|
6
|
+
function ut(t, n) {
|
|
7
7
|
let a;
|
|
8
8
|
try {
|
|
9
9
|
a = t();
|
|
@@ -11,21 +11,21 @@ function pt(t, i) {
|
|
|
11
11
|
return;
|
|
12
12
|
}
|
|
13
13
|
return {
|
|
14
|
-
getItem: (
|
|
15
|
-
var
|
|
16
|
-
const c = (s) => s === null ? null : JSON.parse(s, void 0), m = (
|
|
14
|
+
getItem: (i) => {
|
|
15
|
+
var o;
|
|
16
|
+
const c = (s) => s === null ? null : JSON.parse(s, void 0), m = (o = a.getItem(i)) != null ? o : null;
|
|
17
17
|
return m instanceof Promise ? m.then(c) : c(m);
|
|
18
18
|
},
|
|
19
|
-
setItem: (
|
|
20
|
-
removeItem: (
|
|
19
|
+
setItem: (i, o) => a.setItem(i, JSON.stringify(o, void 0)),
|
|
20
|
+
removeItem: (i) => a.removeItem(i)
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
const
|
|
23
|
+
const Ce = (t) => (n) => {
|
|
24
24
|
try {
|
|
25
|
-
const a = t(
|
|
25
|
+
const a = t(n);
|
|
26
26
|
return a instanceof Promise ? a : {
|
|
27
27
|
then(r) {
|
|
28
|
-
return
|
|
28
|
+
return Ce(r)(a);
|
|
29
29
|
},
|
|
30
30
|
catch(r) {
|
|
31
31
|
return this;
|
|
@@ -37,47 +37,47 @@ const ze = (t) => (i) => {
|
|
|
37
37
|
return this;
|
|
38
38
|
},
|
|
39
39
|
catch(r) {
|
|
40
|
-
return
|
|
40
|
+
return Ce(r)(a);
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
|
-
},
|
|
45
|
-
let
|
|
46
|
-
storage:
|
|
44
|
+
}, gt = (t, n) => (a, r, i) => {
|
|
45
|
+
let o = {
|
|
46
|
+
storage: ut(() => localStorage),
|
|
47
47
|
partialize: (x) => x,
|
|
48
48
|
version: 0,
|
|
49
49
|
merge: (x, z) => ({
|
|
50
50
|
...z,
|
|
51
51
|
...x
|
|
52
52
|
}),
|
|
53
|
-
...
|
|
53
|
+
...n
|
|
54
54
|
}, c = !1;
|
|
55
55
|
const m = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set();
|
|
56
|
-
let g =
|
|
56
|
+
let g = o.storage;
|
|
57
57
|
if (!g)
|
|
58
58
|
return t(
|
|
59
59
|
(...x) => {
|
|
60
60
|
console.warn(
|
|
61
|
-
`[zustand persist middleware] Unable to update item '${
|
|
61
|
+
`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`
|
|
62
62
|
), a(...x);
|
|
63
63
|
},
|
|
64
64
|
r,
|
|
65
|
-
|
|
65
|
+
i
|
|
66
66
|
);
|
|
67
67
|
const p = () => {
|
|
68
|
-
const x =
|
|
69
|
-
return g.setItem(
|
|
68
|
+
const x = o.partialize({ ...r() });
|
|
69
|
+
return g.setItem(o.name, {
|
|
70
70
|
state: x,
|
|
71
|
-
version:
|
|
71
|
+
version: o.version
|
|
72
72
|
});
|
|
73
|
-
}, d =
|
|
74
|
-
|
|
73
|
+
}, d = i.setState;
|
|
74
|
+
i.setState = (x, z) => (d(x, z), p());
|
|
75
75
|
const b = t(
|
|
76
76
|
(...x) => (a(...x), p()),
|
|
77
77
|
r,
|
|
78
|
-
|
|
78
|
+
i
|
|
79
79
|
);
|
|
80
|
-
|
|
80
|
+
i.getInitialState = () => b;
|
|
81
81
|
let f;
|
|
82
82
|
const k = () => {
|
|
83
83
|
var x, z;
|
|
@@ -86,12 +86,12 @@ const ze = (t) => (i) => {
|
|
|
86
86
|
var h;
|
|
87
87
|
return u((h = r()) != null ? h : b);
|
|
88
88
|
});
|
|
89
|
-
const C = ((z =
|
|
90
|
-
return
|
|
89
|
+
const C = ((z = o.onRehydrateStorage) == null ? void 0 : z.call(o, (x = r()) != null ? x : b)) || void 0;
|
|
90
|
+
return Ce(g.getItem.bind(g))(o.name).then((u) => {
|
|
91
91
|
if (u)
|
|
92
|
-
if (typeof u.version == "number" && u.version !==
|
|
93
|
-
if (
|
|
94
|
-
const h =
|
|
92
|
+
if (typeof u.version == "number" && u.version !== o.version) {
|
|
93
|
+
if (o.migrate) {
|
|
94
|
+
const h = o.migrate(
|
|
95
95
|
u.state,
|
|
96
96
|
u.version
|
|
97
97
|
);
|
|
@@ -106,7 +106,7 @@ const ze = (t) => (i) => {
|
|
|
106
106
|
}).then((u) => {
|
|
107
107
|
var h;
|
|
108
108
|
const [y, P] = u;
|
|
109
|
-
if (f =
|
|
109
|
+
if (f = o.merge(
|
|
110
110
|
P,
|
|
111
111
|
(h = r()) != null ? h : b
|
|
112
112
|
), a(f, !0), y)
|
|
@@ -117,17 +117,17 @@ const ze = (t) => (i) => {
|
|
|
117
117
|
C == null || C(void 0, u);
|
|
118
118
|
});
|
|
119
119
|
};
|
|
120
|
-
return
|
|
120
|
+
return i.persist = {
|
|
121
121
|
setOptions: (x) => {
|
|
122
|
-
|
|
123
|
-
...
|
|
122
|
+
o = {
|
|
123
|
+
...o,
|
|
124
124
|
...x
|
|
125
125
|
}, x.storage && (g = x.storage);
|
|
126
126
|
},
|
|
127
127
|
clearStorage: () => {
|
|
128
|
-
g == null || g.removeItem(
|
|
128
|
+
g == null || g.removeItem(o.name);
|
|
129
129
|
},
|
|
130
|
-
getOptions: () =>
|
|
130
|
+
getOptions: () => o,
|
|
131
131
|
rehydrate: () => k(),
|
|
132
132
|
hasHydrated: () => c,
|
|
133
133
|
onHydrate: (x) => (m.add(x), () => {
|
|
@@ -136,14 +136,14 @@ const ze = (t) => (i) => {
|
|
|
136
136
|
onFinishHydration: (x) => (s.add(x), () => {
|
|
137
137
|
s.delete(x);
|
|
138
138
|
})
|
|
139
|
-
},
|
|
140
|
-
},
|
|
141
|
-
async function Y(t,
|
|
139
|
+
}, o.skipHydration || k(), f || b;
|
|
140
|
+
}, Oe = gt, H = "/api";
|
|
141
|
+
async function Y(t, n) {
|
|
142
142
|
const a = await fetch(t, {
|
|
143
|
-
...
|
|
143
|
+
...n,
|
|
144
144
|
headers: {
|
|
145
145
|
"Content-Type": "application/json",
|
|
146
|
-
...
|
|
146
|
+
...n == null ? void 0 : n.headers
|
|
147
147
|
}
|
|
148
148
|
});
|
|
149
149
|
if (!a.ok) {
|
|
@@ -152,43 +152,43 @@ async function Y(t, i) {
|
|
|
152
152
|
}
|
|
153
153
|
return a.json();
|
|
154
154
|
}
|
|
155
|
-
async function
|
|
155
|
+
async function ft() {
|
|
156
156
|
return Y(`${H}/nodes/generators`);
|
|
157
157
|
}
|
|
158
|
-
async function
|
|
158
|
+
async function ht() {
|
|
159
159
|
return Y(`${H}/nodes/transforms`);
|
|
160
160
|
}
|
|
161
|
-
async function
|
|
161
|
+
async function bt() {
|
|
162
162
|
return Y(`${H}/nodes/text`);
|
|
163
163
|
}
|
|
164
|
-
async function
|
|
164
|
+
async function xt() {
|
|
165
165
|
return Y(`${H}/nodes/vision`);
|
|
166
166
|
}
|
|
167
|
-
async function
|
|
167
|
+
async function yt(t, n) {
|
|
168
168
|
return Y(`${H}/export/yaml`, {
|
|
169
169
|
method: "POST",
|
|
170
|
-
body: JSON.stringify({ nodes: t, edges:
|
|
170
|
+
body: JSON.stringify({ nodes: t, edges: n })
|
|
171
171
|
});
|
|
172
172
|
}
|
|
173
|
-
async function
|
|
173
|
+
async function wt() {
|
|
174
174
|
return Y(`${H}/images`);
|
|
175
175
|
}
|
|
176
|
-
function
|
|
176
|
+
function ve(t) {
|
|
177
177
|
return `${H}/images/${t}/blob`;
|
|
178
178
|
}
|
|
179
|
-
async function
|
|
179
|
+
async function kt(t) {
|
|
180
180
|
try {
|
|
181
181
|
return await Y(`${H}/images/${t}/workflow`);
|
|
182
182
|
} catch {
|
|
183
183
|
return null;
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
|
-
async function
|
|
187
|
-
const
|
|
188
|
-
|
|
186
|
+
async function vt(t) {
|
|
187
|
+
const n = new FormData();
|
|
188
|
+
n.append("file", t);
|
|
189
189
|
const a = await fetch(`${H}/uploads`, {
|
|
190
190
|
method: "POST",
|
|
191
|
-
body:
|
|
191
|
+
body: n
|
|
192
192
|
});
|
|
193
193
|
if (!a.ok) {
|
|
194
194
|
const r = await a.json().catch(() => ({ error: "Upload failed" }));
|
|
@@ -196,50 +196,50 @@ async function kt(t) {
|
|
|
196
196
|
}
|
|
197
197
|
return a.json();
|
|
198
198
|
}
|
|
199
|
-
async function
|
|
199
|
+
async function Nt() {
|
|
200
200
|
return Y(`${H}/uploads`);
|
|
201
201
|
}
|
|
202
|
-
async function
|
|
203
|
-
const
|
|
202
|
+
async function zt(t) {
|
|
203
|
+
const n = await fetch(`${H}/uploads/${t}`, {
|
|
204
204
|
method: "DELETE"
|
|
205
205
|
});
|
|
206
|
-
if (!
|
|
207
|
-
throw new Error(`Failed to delete upload: ${
|
|
206
|
+
if (!n.ok)
|
|
207
|
+
throw new Error(`Failed to delete upload: ${n.status}`);
|
|
208
208
|
}
|
|
209
|
-
function
|
|
209
|
+
function $e(t) {
|
|
210
210
|
return `${H}/uploads/${t}/blob`;
|
|
211
211
|
}
|
|
212
|
-
async function
|
|
212
|
+
async function Ct(t) {
|
|
213
213
|
return Y(`${H}/import`, {
|
|
214
214
|
method: "POST",
|
|
215
215
|
body: JSON.stringify({ yaml: t })
|
|
216
216
|
});
|
|
217
217
|
}
|
|
218
|
-
async function
|
|
218
|
+
async function St(t) {
|
|
219
219
|
return Y(`${H}/import/validate`, {
|
|
220
220
|
method: "POST",
|
|
221
221
|
body: JSON.stringify({ yaml: t })
|
|
222
222
|
});
|
|
223
223
|
}
|
|
224
|
-
async function
|
|
224
|
+
async function It() {
|
|
225
225
|
return Y(`${H}/generate/status`);
|
|
226
226
|
}
|
|
227
|
-
function
|
|
227
|
+
function Ue(t, n, a) {
|
|
228
228
|
const r = new AbortController();
|
|
229
229
|
return (async () => {
|
|
230
|
-
var
|
|
230
|
+
var i;
|
|
231
231
|
try {
|
|
232
|
-
const
|
|
232
|
+
const o = await fetch(t, {
|
|
233
233
|
method: "POST",
|
|
234
234
|
headers: { "Content-Type": "application/json" },
|
|
235
|
-
body: JSON.stringify(
|
|
235
|
+
body: JSON.stringify(n),
|
|
236
236
|
signal: r.signal
|
|
237
237
|
});
|
|
238
|
-
if (!
|
|
239
|
-
const g = await
|
|
240
|
-
throw new Error(g.error || `HTTP ${
|
|
238
|
+
if (!o.ok) {
|
|
239
|
+
const g = await o.json().catch(() => ({ error: "Unknown error" }));
|
|
240
|
+
throw new Error(g.error || `HTTP ${o.status}`);
|
|
241
241
|
}
|
|
242
|
-
const c = (
|
|
242
|
+
const c = (i = o.body) == null ? void 0 : i.getReader();
|
|
243
243
|
if (!c)
|
|
244
244
|
throw new Error("Response body is not readable");
|
|
245
245
|
const m = new globalThis.TextDecoder();
|
|
@@ -247,7 +247,7 @@ function $e(t, i, a) {
|
|
|
247
247
|
for (; ; ) {
|
|
248
248
|
const { done: g, value: p } = await c.read();
|
|
249
249
|
if (g) {
|
|
250
|
-
s.trim() &&
|
|
250
|
+
s.trim() && At(s, a);
|
|
251
251
|
break;
|
|
252
252
|
}
|
|
253
253
|
s += m.decode(p, { stream: !0 });
|
|
@@ -256,59 +256,59 @@ function $e(t, i, a) {
|
|
|
256
256
|
`);
|
|
257
257
|
s = d.pop() || "";
|
|
258
258
|
for (const b of d)
|
|
259
|
-
b.trim() &&
|
|
259
|
+
b.trim() && Lt(b, a);
|
|
260
260
|
}
|
|
261
261
|
a.onClose();
|
|
262
|
-
} catch (
|
|
263
|
-
if (
|
|
262
|
+
} catch (o) {
|
|
263
|
+
if (o instanceof Error && o.name === "AbortError") {
|
|
264
264
|
a.onClose();
|
|
265
265
|
return;
|
|
266
266
|
}
|
|
267
|
-
a.onError(
|
|
267
|
+
a.onError(o instanceof Error ? o : new Error(String(o)));
|
|
268
268
|
}
|
|
269
269
|
})(), {
|
|
270
270
|
abort: () => r.abort()
|
|
271
271
|
};
|
|
272
272
|
}
|
|
273
|
-
function
|
|
273
|
+
function Lt(t, n) {
|
|
274
274
|
const a = t.split(`
|
|
275
275
|
`);
|
|
276
276
|
let r = "";
|
|
277
|
-
for (const
|
|
278
|
-
|
|
279
|
-
` : "") +
|
|
277
|
+
for (const i of a)
|
|
278
|
+
i.startsWith("data: ") && (r += (r ? `
|
|
279
|
+
` : "") + i.slice(6));
|
|
280
280
|
if (r)
|
|
281
281
|
try {
|
|
282
|
-
const
|
|
283
|
-
|
|
284
|
-
} catch (
|
|
282
|
+
const i = JSON.parse(r);
|
|
283
|
+
n.onMessage(i);
|
|
284
|
+
} catch (i) {
|
|
285
285
|
console.warn("SSE: Failed to parse message data:", {
|
|
286
|
-
error:
|
|
286
|
+
error: i instanceof Error ? i.message : String(i),
|
|
287
287
|
dataPreview: r.slice(0, 200),
|
|
288
288
|
dataLength: r.length
|
|
289
289
|
});
|
|
290
290
|
}
|
|
291
291
|
}
|
|
292
|
-
function
|
|
292
|
+
function At(t, n) {
|
|
293
293
|
const a = t.split(`
|
|
294
294
|
`);
|
|
295
295
|
let r = "";
|
|
296
|
-
for (const
|
|
297
|
-
|
|
298
|
-
` : "") +
|
|
296
|
+
for (const i of a)
|
|
297
|
+
i.startsWith("data: ") && (r += (r ? `
|
|
298
|
+
` : "") + i.slice(6));
|
|
299
299
|
if (r)
|
|
300
300
|
try {
|
|
301
|
-
const
|
|
302
|
-
|
|
303
|
-
} catch (
|
|
301
|
+
const i = JSON.parse(r);
|
|
302
|
+
n.onMessage(i);
|
|
303
|
+
} catch (i) {
|
|
304
304
|
console.warn("SSE: Incomplete data at end of stream:", {
|
|
305
|
-
error:
|
|
305
|
+
error: i instanceof Error ? i.message : String(i),
|
|
306
306
|
dataPreview: r.slice(0, 200),
|
|
307
307
|
dataLength: r.length
|
|
308
308
|
});
|
|
309
309
|
}
|
|
310
310
|
}
|
|
311
|
-
const
|
|
311
|
+
const Wt = [
|
|
312
312
|
// Workflow
|
|
313
313
|
"save",
|
|
314
314
|
"execute",
|
|
@@ -335,7 +335,7 @@ const At = [
|
|
|
335
335
|
// User-assignable (no default)
|
|
336
336
|
"cancelExecution",
|
|
337
337
|
"focusSearch"
|
|
338
|
-
],
|
|
338
|
+
], me = [
|
|
339
339
|
// Workflow shortcuts
|
|
340
340
|
{
|
|
341
341
|
action: "save",
|
|
@@ -512,29 +512,29 @@ const At = [
|
|
|
512
512
|
customizable: !0
|
|
513
513
|
}
|
|
514
514
|
];
|
|
515
|
-
function
|
|
515
|
+
function _t() {
|
|
516
516
|
const t = {};
|
|
517
|
-
for (const
|
|
518
|
-
t[
|
|
517
|
+
for (const n of me)
|
|
518
|
+
t[n.action] = n.defaultBinding;
|
|
519
519
|
return t;
|
|
520
520
|
}
|
|
521
|
-
function
|
|
521
|
+
function Mt() {
|
|
522
522
|
const t = {
|
|
523
523
|
workflow: [],
|
|
524
524
|
editing: [],
|
|
525
525
|
canvas: [],
|
|
526
526
|
ui: []
|
|
527
527
|
};
|
|
528
|
-
for (const
|
|
529
|
-
t[
|
|
528
|
+
for (const n of me)
|
|
529
|
+
t[n.category].push(n);
|
|
530
530
|
return t;
|
|
531
531
|
}
|
|
532
|
-
const
|
|
532
|
+
const qe = {
|
|
533
533
|
workflow: "Workflow",
|
|
534
534
|
editing: "Editing",
|
|
535
535
|
canvas: "Canvas",
|
|
536
536
|
ui: "Interface"
|
|
537
|
-
},
|
|
537
|
+
}, Pt = [
|
|
538
538
|
"mod+w",
|
|
539
539
|
// Close tab
|
|
540
540
|
"mod+t",
|
|
@@ -567,72 +567,72 @@ const Ue = {
|
|
|
567
567
|
// DevTools
|
|
568
568
|
"alt+f4"
|
|
569
569
|
// Close window (Windows)
|
|
570
|
-
],
|
|
570
|
+
], Tt = [
|
|
571
571
|
"delete",
|
|
572
572
|
// Delete selected
|
|
573
573
|
"backspace"
|
|
574
574
|
// Delete selected
|
|
575
575
|
];
|
|
576
|
-
function Tt(t) {
|
|
577
|
-
const i = t.toLowerCase().replace(/\s+/g, "");
|
|
578
|
-
return Mt.includes(i);
|
|
579
|
-
}
|
|
580
576
|
function Et(t) {
|
|
581
|
-
|
|
577
|
+
const n = t.toLowerCase().replace(/\s+/g, "");
|
|
578
|
+
return Pt.includes(n);
|
|
582
579
|
}
|
|
583
|
-
function Bt(t
|
|
584
|
-
|
|
580
|
+
function Bt(t) {
|
|
581
|
+
return t.toLowerCase().replace(/\s+/g, "").split(",").some((r) => Tt.includes(r));
|
|
582
|
+
}
|
|
583
|
+
function Rt(t, n, a) {
|
|
584
|
+
if (Et(t))
|
|
585
585
|
return {
|
|
586
586
|
hasConflict: !0,
|
|
587
587
|
conflictType: "browser",
|
|
588
588
|
message: "This shortcut is reserved by the browser and cannot be used"
|
|
589
589
|
};
|
|
590
|
-
if (
|
|
590
|
+
if (Bt(t))
|
|
591
591
|
return {
|
|
592
592
|
hasConflict: !0,
|
|
593
593
|
conflictType: "reactflow",
|
|
594
594
|
message: "This shortcut is used by the canvas for node deletion"
|
|
595
595
|
};
|
|
596
596
|
const r = t.toLowerCase().replace(/\s+/g, "");
|
|
597
|
-
for (const [
|
|
598
|
-
if (
|
|
599
|
-
const c =
|
|
597
|
+
for (const [i, o] of Object.entries(n)) {
|
|
598
|
+
if (i === a || !o) continue;
|
|
599
|
+
const c = o.toLowerCase().replace(/\s+/g, ""), m = r.split(","), s = c.split(",");
|
|
600
600
|
for (const g of m)
|
|
601
601
|
for (const p of s)
|
|
602
602
|
if (g === p) {
|
|
603
|
-
const d =
|
|
603
|
+
const d = me.find((b) => b.action === i);
|
|
604
604
|
return {
|
|
605
605
|
hasConflict: !0,
|
|
606
606
|
conflictType: "internal",
|
|
607
|
-
message: `This shortcut is already used by "${(d == null ? void 0 : d.name) ||
|
|
608
|
-
conflictingAction:
|
|
607
|
+
message: `This shortcut is already used by "${(d == null ? void 0 : d.name) || i}"`,
|
|
608
|
+
conflictingAction: i
|
|
609
609
|
};
|
|
610
610
|
}
|
|
611
611
|
}
|
|
612
612
|
return { hasConflict: !1 };
|
|
613
613
|
}
|
|
614
|
-
function
|
|
614
|
+
function Dt(t) {
|
|
615
615
|
if (!t || t.trim() === "") return !1;
|
|
616
|
-
const
|
|
616
|
+
const n = t.toLowerCase().split("+"), a = ["mod", "ctrl", "control", "alt", "option", "shift", "meta", "cmd", "command"], r = n.filter((o) => !a.includes(o));
|
|
617
617
|
if (r.length === 0) return !1;
|
|
618
|
-
const
|
|
619
|
-
for (const
|
|
620
|
-
if (!
|
|
618
|
+
const i = /^[a-z0-9]$|^f[1-9]$|^f1[0-2]$|^(enter|return|escape|backspace|delete|space|tab|comma|slash|equal|minus|period|arrowup|arrowdown|arrowleft|arrowright)$/;
|
|
619
|
+
for (const o of r)
|
|
620
|
+
if (!i.test(o)) return !1;
|
|
621
621
|
return !0;
|
|
622
622
|
}
|
|
623
|
-
const
|
|
624
|
-
function
|
|
625
|
-
const
|
|
623
|
+
const _e = "http://localhost:11434", Me = "http://localhost:1234";
|
|
624
|
+
function jt(t) {
|
|
625
|
+
const n = {
|
|
626
626
|
shortcuts: {},
|
|
627
627
|
enabled: !0
|
|
628
628
|
};
|
|
629
629
|
if (!t || typeof t != "object")
|
|
630
|
-
return
|
|
631
|
-
const a = t, r = typeof a.enabled == "boolean" ? a.enabled : !0,
|
|
630
|
+
return n;
|
|
631
|
+
const a = t, r = typeof a.enabled == "boolean" ? a.enabled : !0, i = {};
|
|
632
632
|
if (a.shortcuts && typeof a.shortcuts == "object") {
|
|
633
|
-
const
|
|
634
|
-
for (const [c, m] of Object.entries(
|
|
635
|
-
if (!
|
|
633
|
+
const o = a.shortcuts;
|
|
634
|
+
for (const [c, m] of Object.entries(o)) {
|
|
635
|
+
if (!Wt.includes(c)) {
|
|
636
636
|
console.warn(`[Settings] Removing invalid shortcut action: ${c}`);
|
|
637
637
|
continue;
|
|
638
638
|
}
|
|
@@ -640,28 +640,28 @@ function Dt(t) {
|
|
|
640
640
|
console.warn(`[Settings] Removing invalid binding for ${c}: ${m}`);
|
|
641
641
|
continue;
|
|
642
642
|
}
|
|
643
|
-
if (typeof m == "string" && !
|
|
643
|
+
if (typeof m == "string" && !Dt(m)) {
|
|
644
644
|
console.warn(`[Settings] Removing invalid binding format for ${c}: ${m}`);
|
|
645
645
|
continue;
|
|
646
646
|
}
|
|
647
|
-
m === null ?
|
|
647
|
+
m === null ? i[c] = void 0 : i[c] = m;
|
|
648
648
|
}
|
|
649
649
|
}
|
|
650
650
|
return {
|
|
651
|
-
shortcuts:
|
|
651
|
+
shortcuts: i,
|
|
652
652
|
enabled: r
|
|
653
653
|
};
|
|
654
654
|
}
|
|
655
|
-
const E =
|
|
656
|
-
|
|
657
|
-
(t,
|
|
655
|
+
const E = je()(
|
|
656
|
+
Oe(
|
|
657
|
+
(t, n) => ({
|
|
658
658
|
ai: {
|
|
659
659
|
ollama: {
|
|
660
|
-
baseUrl:
|
|
660
|
+
baseUrl: _e,
|
|
661
661
|
enabled: !1
|
|
662
662
|
},
|
|
663
663
|
lmstudio: {
|
|
664
|
-
baseUrl:
|
|
664
|
+
baseUrl: Me,
|
|
665
665
|
enabled: !1
|
|
666
666
|
}
|
|
667
667
|
},
|
|
@@ -679,26 +679,26 @@ const E = De()(
|
|
|
679
679
|
showNewWorkflowConfirm: !1,
|
|
680
680
|
newWorkflowConfirmCallback: null,
|
|
681
681
|
setAIProvider: (a, r) => {
|
|
682
|
-
t((
|
|
682
|
+
t((i) => ({
|
|
683
683
|
ai: {
|
|
684
|
-
...
|
|
684
|
+
...i.ai,
|
|
685
685
|
[a]: r
|
|
686
686
|
}
|
|
687
687
|
}));
|
|
688
688
|
},
|
|
689
689
|
clearAIProvider: (a) => {
|
|
690
690
|
t((r) => {
|
|
691
|
-
const
|
|
692
|
-
return delete
|
|
691
|
+
const i = { ...r.ai };
|
|
692
|
+
return delete i[a], { ai: i };
|
|
693
693
|
});
|
|
694
694
|
},
|
|
695
695
|
// Keyboard shortcut methods
|
|
696
696
|
updateShortcut: (a, r) => {
|
|
697
|
-
t((
|
|
697
|
+
t((i) => ({
|
|
698
698
|
keyboard: {
|
|
699
|
-
...
|
|
699
|
+
...i.keyboard,
|
|
700
700
|
shortcuts: {
|
|
701
|
-
...
|
|
701
|
+
...i.keyboard.shortcuts,
|
|
702
702
|
[a]: r ?? void 0
|
|
703
703
|
}
|
|
704
704
|
}
|
|
@@ -706,11 +706,11 @@ const E = De()(
|
|
|
706
706
|
},
|
|
707
707
|
resetShortcut: (a) => {
|
|
708
708
|
t((r) => {
|
|
709
|
-
const
|
|
710
|
-
return delete
|
|
709
|
+
const i = { ...r.keyboard.shortcuts };
|
|
710
|
+
return delete i[a], {
|
|
711
711
|
keyboard: {
|
|
712
712
|
...r.keyboard,
|
|
713
|
-
shortcuts:
|
|
713
|
+
shortcuts: i
|
|
714
714
|
}
|
|
715
715
|
};
|
|
716
716
|
});
|
|
@@ -724,12 +724,12 @@ const E = De()(
|
|
|
724
724
|
}));
|
|
725
725
|
},
|
|
726
726
|
isShortcutConflicting: (a, r) => {
|
|
727
|
-
const { keyboard:
|
|
728
|
-
for (const [s, g] of Object.entries(
|
|
729
|
-
const p =
|
|
727
|
+
const { keyboard: i } = n(), o = _t(), c = {};
|
|
728
|
+
for (const [s, g] of Object.entries(o)) {
|
|
729
|
+
const p = i.shortcuts[s];
|
|
730
730
|
p !== void 0 ? c[s] = p : g && (c[s] = g);
|
|
731
731
|
}
|
|
732
|
-
const m =
|
|
732
|
+
const m = Rt(a, c, r);
|
|
733
733
|
return m.hasConflict ? m.message ?? "Conflict detected" : null;
|
|
734
734
|
},
|
|
735
735
|
// Modal controls
|
|
@@ -748,16 +748,16 @@ const E = De()(
|
|
|
748
748
|
a ? t({ showNewWorkflowConfirm: !0, newWorkflowConfirmCallback: r }) : r();
|
|
749
749
|
},
|
|
750
750
|
confirmNewWorkflow: () => {
|
|
751
|
-
const a =
|
|
751
|
+
const a = n().newWorkflowConfirmCallback;
|
|
752
752
|
t({ showNewWorkflowConfirm: !1, newWorkflowConfirmCallback: null }), a == null || a();
|
|
753
753
|
},
|
|
754
754
|
cancelNewWorkflow: () => {
|
|
755
755
|
t({ showNewWorkflowConfirm: !1, newWorkflowConfirmCallback: null });
|
|
756
756
|
},
|
|
757
757
|
getConfiguredProviders: () => {
|
|
758
|
-
var
|
|
759
|
-
const { ai: a } =
|
|
760
|
-
return (
|
|
758
|
+
var i, o, c, m, s, g, p;
|
|
759
|
+
const { ai: a } = n(), r = {};
|
|
760
|
+
return (i = a.openai) != null && i.enabled && a.openai.apiKey && (r.openai = { apiKey: a.openai.apiKey }), (o = a.anthropic) != null && o.enabled && a.anthropic.apiKey && (r.anthropic = { apiKey: a.anthropic.apiKey }), (c = a.gemini) != null && c.enabled && a.gemini.apiKey && (r.gemini = { apiKey: a.gemini.apiKey }), (m = a.grok) != null && m.enabled && a.grok.apiKey && (r.grok = { apiKey: a.grok.apiKey }), (s = a.openrouter) != null && s.enabled && a.openrouter.apiKey && (r.openrouter = { apiKey: a.openrouter.apiKey }), (g = a.ollama) != null && g.enabled && (r.ollama = { baseUrl: a.ollama.baseUrl || _e }), (p = a.lmstudio) != null && p.enabled && (r.lmstudio = { baseUrl: a.lmstudio.baseUrl || Me }), r;
|
|
761
761
|
}
|
|
762
762
|
}),
|
|
763
763
|
{
|
|
@@ -768,47 +768,47 @@ const E = De()(
|
|
|
768
768
|
keyboard: t.keyboard
|
|
769
769
|
}),
|
|
770
770
|
// Validate persisted data on load to prevent malicious/corrupted data
|
|
771
|
-
merge: (t,
|
|
771
|
+
merge: (t, n) => {
|
|
772
772
|
const a = t;
|
|
773
773
|
return {
|
|
774
|
-
...
|
|
775
|
-
ai: (a == null ? void 0 : a.ai) ??
|
|
776
|
-
keyboard:
|
|
774
|
+
...n,
|
|
775
|
+
ai: (a == null ? void 0 : a.ai) ?? n.ai,
|
|
776
|
+
keyboard: jt(a == null ? void 0 : a.keyboard)
|
|
777
777
|
};
|
|
778
778
|
}
|
|
779
779
|
}
|
|
780
780
|
)
|
|
781
781
|
);
|
|
782
|
-
let
|
|
783
|
-
function
|
|
784
|
-
return `node_${++
|
|
782
|
+
let ue = null, Ot = 0;
|
|
783
|
+
function ge() {
|
|
784
|
+
return `node_${++Ot}`;
|
|
785
785
|
}
|
|
786
|
-
function
|
|
787
|
-
const t = Date.now(),
|
|
788
|
-
return `wf_${t}_${
|
|
786
|
+
function Pe() {
|
|
787
|
+
const t = Date.now(), n = Math.random().toString(36).substring(2, 8);
|
|
788
|
+
return `wf_${t}_${n}`;
|
|
789
789
|
}
|
|
790
|
-
const w =
|
|
791
|
-
|
|
792
|
-
(t,
|
|
790
|
+
const w = je()(
|
|
791
|
+
Oe(
|
|
792
|
+
(t, n) => {
|
|
793
793
|
const a = (r) => {
|
|
794
794
|
if (r.type === "generator") {
|
|
795
|
-
const
|
|
795
|
+
const i = r.data, o = n().generators.find((c) => c.name === i.generatorName);
|
|
796
796
|
return {
|
|
797
|
-
...
|
|
798
|
-
isAI:
|
|
799
|
-
acceptsReferenceImages:
|
|
800
|
-
maxReferenceImages:
|
|
797
|
+
...i,
|
|
798
|
+
isAI: i.isAI ?? (o == null ? void 0 : o.isAI),
|
|
799
|
+
acceptsReferenceImages: i.acceptsReferenceImages ?? (o == null ? void 0 : o.acceptsReferenceImages),
|
|
800
|
+
maxReferenceImages: i.maxReferenceImages ?? (o == null ? void 0 : o.maxReferenceImages)
|
|
801
801
|
};
|
|
802
802
|
}
|
|
803
803
|
if (r.type === "transform") {
|
|
804
|
-
const
|
|
805
|
-
(c) => c.name ===
|
|
804
|
+
const i = r.data, o = n().transforms.find(
|
|
805
|
+
(c) => c.name === i.operation && c.providerName === i.providerName
|
|
806
806
|
);
|
|
807
807
|
return {
|
|
808
|
-
...
|
|
809
|
-
isAI:
|
|
810
|
-
acceptsReferenceImages:
|
|
811
|
-
maxReferenceImages:
|
|
808
|
+
...i,
|
|
809
|
+
isAI: i.isAI ?? (o == null ? void 0 : o.isAI),
|
|
810
|
+
acceptsReferenceImages: i.acceptsReferenceImages ?? (o == null ? void 0 : o.acceptsReferenceImages),
|
|
811
|
+
maxReferenceImages: i.maxReferenceImages ?? (o == null ? void 0 : o.maxReferenceImages)
|
|
812
812
|
};
|
|
813
813
|
}
|
|
814
814
|
return r.data;
|
|
@@ -842,16 +842,16 @@ const w = De()(
|
|
|
842
842
|
openOutputInspector: (r) => t({ inspectedNodeId: r }),
|
|
843
843
|
closeOutputInspector: () => t({ inspectedNodeId: null }),
|
|
844
844
|
loadTemplate: (r) => {
|
|
845
|
-
const
|
|
846
|
-
const s =
|
|
847
|
-
return
|
|
845
|
+
const i = /* @__PURE__ */ new Map(), o = r.workflow.nodes.map((m) => {
|
|
846
|
+
const s = ge();
|
|
847
|
+
return i.set(m.id, s), {
|
|
848
848
|
id: s,
|
|
849
849
|
type: m.type,
|
|
850
850
|
position: m.position,
|
|
851
851
|
data: a(m)
|
|
852
852
|
};
|
|
853
853
|
}), c = r.workflow.edges.map((m) => {
|
|
854
|
-
const s =
|
|
854
|
+
const s = i.get(m.source) || m.source, g = i.get(m.target) || m.target;
|
|
855
855
|
return {
|
|
856
856
|
id: `edge_${s}_${g}`,
|
|
857
857
|
source: s,
|
|
@@ -859,7 +859,7 @@ const w = De()(
|
|
|
859
859
|
};
|
|
860
860
|
});
|
|
861
861
|
t({
|
|
862
|
-
nodes:
|
|
862
|
+
nodes: o,
|
|
863
863
|
edges: c,
|
|
864
864
|
selectedNodeId: null,
|
|
865
865
|
currentTemplateId: r.id,
|
|
@@ -892,10 +892,10 @@ const w = De()(
|
|
|
892
892
|
});
|
|
893
893
|
},
|
|
894
894
|
togglePreview: (r) => {
|
|
895
|
-
t((
|
|
895
|
+
t((i) => ({
|
|
896
896
|
previewVisible: {
|
|
897
|
-
...
|
|
898
|
-
[r]:
|
|
897
|
+
...i.previewVisible,
|
|
898
|
+
[r]: i.previewVisible[r] === !1
|
|
899
899
|
// default true, toggle
|
|
900
900
|
}
|
|
901
901
|
}));
|
|
@@ -904,14 +904,14 @@ const w = De()(
|
|
|
904
904
|
setTransforms: (r) => t({ transforms: r }),
|
|
905
905
|
setTextProviders: (r) => t({ textProviders: r }),
|
|
906
906
|
setVisionProviders: (r) => t({ visionProviders: r }),
|
|
907
|
-
addNode: (r,
|
|
907
|
+
addNode: (r, i) => {
|
|
908
908
|
var s, g, p;
|
|
909
|
-
const
|
|
909
|
+
const o = ge();
|
|
910
910
|
let c;
|
|
911
911
|
if (r.type === "generator")
|
|
912
912
|
c = {
|
|
913
913
|
generatorName: r.name,
|
|
914
|
-
params:
|
|
914
|
+
params: xe(r),
|
|
915
915
|
isAI: r.isAI,
|
|
916
916
|
// Track if this is an AI generator (can accept text input)
|
|
917
917
|
acceptsReferenceImages: r.acceptsReferenceImages,
|
|
@@ -924,7 +924,7 @@ const w = De()(
|
|
|
924
924
|
// Track which provider this transform belongs to
|
|
925
925
|
isAI: r.isAI,
|
|
926
926
|
// Track if this is an AI transform (can accept text input)
|
|
927
|
-
params:
|
|
927
|
+
params: xe(r),
|
|
928
928
|
acceptsReferenceImages: r.acceptsReferenceImages,
|
|
929
929
|
maxReferenceImages: r.maxReferenceImages
|
|
930
930
|
};
|
|
@@ -939,14 +939,14 @@ const w = De()(
|
|
|
939
939
|
providerName: r.name,
|
|
940
940
|
providerLabel: r.label,
|
|
941
941
|
// Human-readable label (e.g., "Gemini Vision")
|
|
942
|
-
params:
|
|
942
|
+
params: xe(r)
|
|
943
943
|
};
|
|
944
944
|
else if (r.type === "text")
|
|
945
945
|
c = {
|
|
946
946
|
providerName: r.name,
|
|
947
947
|
providerLabel: r.label,
|
|
948
948
|
// Human-readable label (e.g., "Gemini Text")
|
|
949
|
-
params:
|
|
949
|
+
params: xe(r)
|
|
950
950
|
};
|
|
951
951
|
else {
|
|
952
952
|
const d = ((s = r.params) == null ? void 0 : s.properties) || {}, b = ((g = d.provider) == null ? void 0 : g.default) || "filesystem";
|
|
@@ -956,45 +956,45 @@ const w = De()(
|
|
|
956
956
|
};
|
|
957
957
|
}
|
|
958
958
|
const m = {
|
|
959
|
-
id:
|
|
959
|
+
id: o,
|
|
960
960
|
type: r.type,
|
|
961
|
-
position:
|
|
961
|
+
position: i,
|
|
962
962
|
data: c
|
|
963
963
|
};
|
|
964
964
|
t((d) => ({
|
|
965
965
|
nodes: [...d.nodes, m]
|
|
966
966
|
}));
|
|
967
967
|
},
|
|
968
|
-
updateNodeData: (r,
|
|
969
|
-
t((
|
|
970
|
-
nodes:
|
|
971
|
-
(c) => c.id === r ? { ...c, data: { ...c.data, ...
|
|
968
|
+
updateNodeData: (r, i) => {
|
|
969
|
+
t((o) => ({
|
|
970
|
+
nodes: o.nodes.map(
|
|
971
|
+
(c) => c.id === r ? { ...c, data: { ...c.data, ...i } } : c
|
|
972
972
|
)
|
|
973
973
|
}));
|
|
974
974
|
},
|
|
975
975
|
deleteNode: (r) => {
|
|
976
|
-
t((
|
|
977
|
-
nodes:
|
|
978
|
-
edges:
|
|
979
|
-
selectedNodeId:
|
|
976
|
+
t((i) => ({
|
|
977
|
+
nodes: i.nodes.filter((o) => o.id !== r),
|
|
978
|
+
edges: i.edges.filter((o) => o.source !== r && o.target !== r),
|
|
979
|
+
selectedNodeId: i.selectedNodeId === r ? null : i.selectedNodeId
|
|
980
980
|
}));
|
|
981
981
|
},
|
|
982
982
|
duplicateNode: (r) => {
|
|
983
|
-
const
|
|
984
|
-
if (!
|
|
985
|
-
const c =
|
|
986
|
-
...
|
|
983
|
+
const i = n(), o = i.nodes.find((s) => s.id === r);
|
|
984
|
+
if (!o) return;
|
|
985
|
+
const c = ge(), m = {
|
|
986
|
+
...o,
|
|
987
987
|
id: c,
|
|
988
988
|
position: {
|
|
989
|
-
x:
|
|
990
|
-
y:
|
|
989
|
+
x: o.position.x + 50,
|
|
990
|
+
y: o.position.y + 50
|
|
991
991
|
},
|
|
992
|
-
data: JSON.parse(JSON.stringify(
|
|
992
|
+
data: JSON.parse(JSON.stringify(o.data)),
|
|
993
993
|
// Deep clone
|
|
994
994
|
selected: !1
|
|
995
995
|
};
|
|
996
996
|
t({
|
|
997
|
-
nodes: [...
|
|
997
|
+
nodes: [...i.nodes, m],
|
|
998
998
|
selectedNodeId: c
|
|
999
999
|
// Select the new node
|
|
1000
1000
|
});
|
|
@@ -1002,8 +1002,8 @@ const w = De()(
|
|
|
1002
1002
|
setNodes: (r) => t({ nodes: r }),
|
|
1003
1003
|
addEdge: (r) => {
|
|
1004
1004
|
if (!r.source || !r.target) return;
|
|
1005
|
-
const
|
|
1006
|
-
id:
|
|
1005
|
+
const i = [r.sourceHandle, r.targetHandle].filter(Boolean).join("_"), c = {
|
|
1006
|
+
id: i ? `edge_${r.source}_${r.target}_${i}` : `edge_${r.source}_${r.target}`,
|
|
1007
1007
|
source: r.source,
|
|
1008
1008
|
target: r.target,
|
|
1009
1009
|
sourceHandle: r.sourceHandle ?? void 0,
|
|
@@ -1014,19 +1014,19 @@ const w = De()(
|
|
|
1014
1014
|
}));
|
|
1015
1015
|
},
|
|
1016
1016
|
deleteEdge: (r) => {
|
|
1017
|
-
t((
|
|
1018
|
-
edges:
|
|
1017
|
+
t((i) => ({
|
|
1018
|
+
edges: i.edges.filter((o) => o.id !== r)
|
|
1019
1019
|
}));
|
|
1020
1020
|
},
|
|
1021
1021
|
setEdges: (r) => t({ edges: r }),
|
|
1022
1022
|
setSelectedNode: (r) => t({ selectedNodeId: r }),
|
|
1023
1023
|
execute: async () => {
|
|
1024
|
-
const { nodes: r, edges:
|
|
1024
|
+
const { nodes: r, edges: i } = n(), o = r.map((g) => ({
|
|
1025
1025
|
id: g.id,
|
|
1026
1026
|
type: g.type,
|
|
1027
1027
|
position: g.position,
|
|
1028
1028
|
data: g.data
|
|
1029
|
-
})), c =
|
|
1029
|
+
})), c = i.map((g) => ({
|
|
1030
1030
|
id: g.id,
|
|
1031
1031
|
source: g.source,
|
|
1032
1032
|
target: g.target,
|
|
@@ -1042,15 +1042,21 @@ const w = De()(
|
|
|
1042
1042
|
imageUrls: [],
|
|
1043
1043
|
previews: {},
|
|
1044
1044
|
dataOutputs: {},
|
|
1045
|
-
nodeStatus: s
|
|
1045
|
+
nodeStatus: s,
|
|
1046
|
+
// Clear previous error state
|
|
1047
|
+
error: void 0,
|
|
1048
|
+
errorNodeId: void 0,
|
|
1049
|
+
errorCode: void 0,
|
|
1050
|
+
errorCategory: void 0,
|
|
1051
|
+
retryable: void 0
|
|
1046
1052
|
}
|
|
1047
1053
|
}), new Promise((g, p) => {
|
|
1048
|
-
|
|
1054
|
+
ue = Ue(
|
|
1049
1055
|
"/api/execute/stream",
|
|
1050
|
-
{ nodes:
|
|
1056
|
+
{ nodes: o, edges: c, aiProviders: m },
|
|
1051
1057
|
{
|
|
1052
1058
|
onMessage: (d) => {
|
|
1053
|
-
const b =
|
|
1059
|
+
const b = n();
|
|
1054
1060
|
if (d.type, d.type === "execution.step") {
|
|
1055
1061
|
const f = d.data, k = {
|
|
1056
1062
|
...b.execution.nodeStatus,
|
|
@@ -1093,13 +1099,18 @@ const w = De()(
|
|
|
1093
1099
|
...b.execution,
|
|
1094
1100
|
status: "error",
|
|
1095
1101
|
nodeStatus: f,
|
|
1096
|
-
error: d.data.error
|
|
1102
|
+
error: d.data.error,
|
|
1103
|
+
errorNodeId: d.data.nodeId,
|
|
1104
|
+
// Structured error metadata from backend
|
|
1105
|
+
errorCode: d.data.errorCode,
|
|
1106
|
+
errorCategory: d.data.errorCategory,
|
|
1107
|
+
retryable: d.data.retryable
|
|
1097
1108
|
}
|
|
1098
1109
|
}), p(new Error(d.data.error));
|
|
1099
1110
|
}
|
|
1100
1111
|
},
|
|
1101
1112
|
onError: (d) => {
|
|
1102
|
-
const b =
|
|
1113
|
+
const b = n(), f = {};
|
|
1103
1114
|
for (const k of Object.keys(b.execution.nodeStatus))
|
|
1104
1115
|
f[k] = "error";
|
|
1105
1116
|
t({
|
|
@@ -1112,8 +1123,8 @@ const w = De()(
|
|
|
1112
1123
|
}), p(d);
|
|
1113
1124
|
},
|
|
1114
1125
|
onClose: () => {
|
|
1115
|
-
|
|
1116
|
-
const d =
|
|
1126
|
+
ue = null;
|
|
1127
|
+
const d = n();
|
|
1117
1128
|
d.execution.status === "running" && (t({
|
|
1118
1129
|
execution: {
|
|
1119
1130
|
...d.execution,
|
|
@@ -1127,7 +1138,7 @@ const w = De()(
|
|
|
1127
1138
|
});
|
|
1128
1139
|
},
|
|
1129
1140
|
cancelExecution: () => {
|
|
1130
|
-
|
|
1141
|
+
ue && (ue.abort(), ue = null), t({
|
|
1131
1142
|
execution: {
|
|
1132
1143
|
status: "idle",
|
|
1133
1144
|
imageIds: [],
|
|
@@ -1139,30 +1150,30 @@ const w = De()(
|
|
|
1139
1150
|
});
|
|
1140
1151
|
},
|
|
1141
1152
|
exportToYaml: async () => {
|
|
1142
|
-
const { nodes: r, edges:
|
|
1153
|
+
const { nodes: r, edges: i } = n(), o = r.map((s) => ({
|
|
1143
1154
|
id: s.id,
|
|
1144
1155
|
type: s.type,
|
|
1145
1156
|
position: s.position,
|
|
1146
1157
|
data: s.data
|
|
1147
|
-
})), c =
|
|
1158
|
+
})), c = i.map((s) => ({
|
|
1148
1159
|
id: s.id,
|
|
1149
1160
|
source: s.source,
|
|
1150
1161
|
target: s.target,
|
|
1151
1162
|
sourceHandle: s.sourceHandle ?? void 0,
|
|
1152
1163
|
targetHandle: s.targetHandle ?? void 0
|
|
1153
1164
|
}));
|
|
1154
|
-
return (await
|
|
1165
|
+
return (await yt(o, c)).yaml;
|
|
1155
1166
|
},
|
|
1156
|
-
importFromYaml: (r,
|
|
1167
|
+
importFromYaml: (r, i, o) => {
|
|
1157
1168
|
const c = /* @__PURE__ */ new Map(), m = r.map((g) => {
|
|
1158
|
-
const p =
|
|
1169
|
+
const p = ge();
|
|
1159
1170
|
return c.set(g.id, p), {
|
|
1160
1171
|
id: p,
|
|
1161
1172
|
type: g.type,
|
|
1162
1173
|
position: g.position,
|
|
1163
1174
|
data: a(g)
|
|
1164
1175
|
};
|
|
1165
|
-
}), s =
|
|
1176
|
+
}), s = i.map((g) => {
|
|
1166
1177
|
const p = c.get(g.source) || g.source, d = c.get(g.target) || g.target;
|
|
1167
1178
|
return {
|
|
1168
1179
|
id: `edge_${p}_${d}`,
|
|
@@ -1177,7 +1188,7 @@ const w = De()(
|
|
|
1177
1188
|
currentTemplateId: null,
|
|
1178
1189
|
previewVisible: {},
|
|
1179
1190
|
activeWorkflowId: null,
|
|
1180
|
-
activeWorkflowName:
|
|
1191
|
+
activeWorkflowName: o || "Imported Workflow",
|
|
1181
1192
|
hasUnsavedChanges: !0,
|
|
1182
1193
|
execution: {
|
|
1183
1194
|
status: "idle",
|
|
@@ -1215,16 +1226,16 @@ const w = De()(
|
|
|
1215
1226
|
},
|
|
1216
1227
|
saveWorkflow: (r) => {
|
|
1217
1228
|
const {
|
|
1218
|
-
nodes:
|
|
1219
|
-
edges:
|
|
1229
|
+
nodes: i,
|
|
1230
|
+
edges: o,
|
|
1220
1231
|
activeWorkflowId: c,
|
|
1221
1232
|
activeWorkflowName: m,
|
|
1222
1233
|
savedWorkflows: s,
|
|
1223
1234
|
currentTemplateId: g
|
|
1224
|
-
} =
|
|
1235
|
+
} = n(), p = Date.now();
|
|
1225
1236
|
if (c) {
|
|
1226
1237
|
const d = s.map(
|
|
1227
|
-
(b) => b.id === c ? { ...b, name: r || m, nodes:
|
|
1238
|
+
(b) => b.id === c ? { ...b, name: r || m, nodes: i, edges: o, updatedAt: p } : b
|
|
1228
1239
|
);
|
|
1229
1240
|
return t({
|
|
1230
1241
|
savedWorkflows: d,
|
|
@@ -1232,11 +1243,11 @@ const w = De()(
|
|
|
1232
1243
|
hasUnsavedChanges: !1
|
|
1233
1244
|
}), c;
|
|
1234
1245
|
} else {
|
|
1235
|
-
const d =
|
|
1246
|
+
const d = Pe(), b = {
|
|
1236
1247
|
id: d,
|
|
1237
1248
|
name: r || m,
|
|
1238
|
-
nodes:
|
|
1239
|
-
edges:
|
|
1249
|
+
nodes: i,
|
|
1250
|
+
edges: o,
|
|
1240
1251
|
createdAt: p,
|
|
1241
1252
|
updatedAt: p,
|
|
1242
1253
|
templateId: g || void 0
|
|
@@ -1250,9 +1261,9 @@ const w = De()(
|
|
|
1250
1261
|
}
|
|
1251
1262
|
},
|
|
1252
1263
|
loadWorkflow: (r) => {
|
|
1253
|
-
const { savedWorkflows:
|
|
1254
|
-
if (!
|
|
1255
|
-
const c =
|
|
1264
|
+
const { savedWorkflows: i } = n(), o = i.find((m) => m.id === r);
|
|
1265
|
+
if (!o) return;
|
|
1266
|
+
const c = o.nodes.map((m) => ({
|
|
1256
1267
|
...m,
|
|
1257
1268
|
data: a({
|
|
1258
1269
|
id: m.id,
|
|
@@ -1263,12 +1274,12 @@ const w = De()(
|
|
|
1263
1274
|
}));
|
|
1264
1275
|
t({
|
|
1265
1276
|
nodes: c,
|
|
1266
|
-
edges:
|
|
1277
|
+
edges: o.edges,
|
|
1267
1278
|
selectedNodeId: null,
|
|
1268
|
-
currentTemplateId:
|
|
1279
|
+
currentTemplateId: o.templateId || null,
|
|
1269
1280
|
previewVisible: {},
|
|
1270
1281
|
activeWorkflowId: r,
|
|
1271
|
-
activeWorkflowName:
|
|
1282
|
+
activeWorkflowName: o.name,
|
|
1272
1283
|
hasUnsavedChanges: !1,
|
|
1273
1284
|
execution: {
|
|
1274
1285
|
status: "idle",
|
|
@@ -1281,8 +1292,8 @@ const w = De()(
|
|
|
1281
1292
|
});
|
|
1282
1293
|
},
|
|
1283
1294
|
deleteWorkflow: (r) => {
|
|
1284
|
-
const { savedWorkflows:
|
|
1285
|
-
t(
|
|
1295
|
+
const { savedWorkflows: i, activeWorkflowId: o } = n(), c = i.filter((m) => m.id !== r);
|
|
1296
|
+
t(o === r ? {
|
|
1286
1297
|
savedWorkflows: c,
|
|
1287
1298
|
nodes: [],
|
|
1288
1299
|
edges: [],
|
|
@@ -1302,30 +1313,30 @@ const w = De()(
|
|
|
1302
1313
|
}
|
|
1303
1314
|
} : { savedWorkflows: c });
|
|
1304
1315
|
},
|
|
1305
|
-
renameWorkflow: (r,
|
|
1306
|
-
const { savedWorkflows:
|
|
1307
|
-
(s) => s.id === r ? { ...s, name:
|
|
1316
|
+
renameWorkflow: (r, i) => {
|
|
1317
|
+
const { savedWorkflows: o, activeWorkflowId: c } = n(), m = o.map(
|
|
1318
|
+
(s) => s.id === r ? { ...s, name: i, updatedAt: Date.now() } : s
|
|
1308
1319
|
);
|
|
1309
1320
|
t({
|
|
1310
1321
|
savedWorkflows: m,
|
|
1311
|
-
...c === r ? { activeWorkflowName:
|
|
1322
|
+
...c === r ? { activeWorkflowName: i } : {}
|
|
1312
1323
|
});
|
|
1313
1324
|
},
|
|
1314
1325
|
duplicateWorkflow: (r) => {
|
|
1315
|
-
const { savedWorkflows:
|
|
1316
|
-
if (!
|
|
1317
|
-
const c = Date.now(), m =
|
|
1318
|
-
...
|
|
1326
|
+
const { savedWorkflows: i } = n(), o = i.find((g) => g.id === r);
|
|
1327
|
+
if (!o) return "";
|
|
1328
|
+
const c = Date.now(), m = Pe(), s = {
|
|
1329
|
+
...o,
|
|
1319
1330
|
id: m,
|
|
1320
|
-
name: `${
|
|
1331
|
+
name: `${o.name} (Copy)`,
|
|
1321
1332
|
createdAt: c,
|
|
1322
1333
|
updatedAt: c
|
|
1323
1334
|
};
|
|
1324
|
-
return t({ savedWorkflows: [...
|
|
1335
|
+
return t({ savedWorkflows: [...i, s] }), m;
|
|
1325
1336
|
},
|
|
1326
1337
|
loadGeneratedWorkflow: (r) => {
|
|
1327
1338
|
var z, C;
|
|
1328
|
-
const
|
|
1339
|
+
const i = /* @__PURE__ */ new Map(), o = 300, c = 180, m = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map();
|
|
1329
1340
|
for (const u of r.nodes)
|
|
1330
1341
|
m.set(u.id, []), s.set(u.id, []);
|
|
1331
1342
|
for (const u of r.edges)
|
|
@@ -1353,14 +1364,14 @@ const w = De()(
|
|
|
1353
1364
|
const y = h.length * c, P = 100 + (y > c ? -y / 4 : 0);
|
|
1354
1365
|
h.forEach((B, T) => {
|
|
1355
1366
|
f.set(B, {
|
|
1356
|
-
x: 100 + u *
|
|
1367
|
+
x: 100 + u * o,
|
|
1357
1368
|
y: P + T * c
|
|
1358
1369
|
});
|
|
1359
1370
|
});
|
|
1360
1371
|
}
|
|
1361
1372
|
const k = r.nodes.map((u) => {
|
|
1362
|
-
const h =
|
|
1363
|
-
|
|
1373
|
+
const h = ge();
|
|
1374
|
+
i.set(u.id, h);
|
|
1364
1375
|
const y = u.nodeType.split(":"), P = f.get(u.id) || { x: 100, y: 100 };
|
|
1365
1376
|
if (y[0] === "flow") {
|
|
1366
1377
|
const N = y[1];
|
|
@@ -1387,7 +1398,7 @@ const w = De()(
|
|
|
1387
1398
|
const B = y[0];
|
|
1388
1399
|
let T;
|
|
1389
1400
|
if (B === "generator") {
|
|
1390
|
-
const N = y.slice(1).join(":"), L =
|
|
1401
|
+
const N = y.slice(1).join(":"), L = n().generators.find((S) => S.name === N);
|
|
1391
1402
|
T = {
|
|
1392
1403
|
generatorName: N,
|
|
1393
1404
|
params: u.parameters,
|
|
@@ -1397,7 +1408,7 @@ const w = De()(
|
|
|
1397
1408
|
maxReferenceImages: L == null ? void 0 : L.maxReferenceImages
|
|
1398
1409
|
};
|
|
1399
1410
|
} else if (B === "transform") {
|
|
1400
|
-
const N = y[1], L = y.slice(2).join(":"), S =
|
|
1411
|
+
const N = y[1], L = y.slice(2).join(":"), S = n().transforms.find(
|
|
1401
1412
|
(O) => O.providerName === N && O.name === L
|
|
1402
1413
|
);
|
|
1403
1414
|
T = {
|
|
@@ -1449,7 +1460,7 @@ const w = De()(
|
|
|
1449
1460
|
data: T
|
|
1450
1461
|
};
|
|
1451
1462
|
}), x = r.edges.map((u) => {
|
|
1452
|
-
const h =
|
|
1463
|
+
const h = i.get(u.source) || u.source, y = i.get(u.target) || u.target, P = [u.sourceHandle, u.targetHandle].filter(Boolean).join("_");
|
|
1453
1464
|
return {
|
|
1454
1465
|
id: P ? `edge_${h}_${y}_${P}` : `edge_${h}_${y}`,
|
|
1455
1466
|
source: h,
|
|
@@ -1488,28 +1499,28 @@ const w = De()(
|
|
|
1488
1499
|
}
|
|
1489
1500
|
)
|
|
1490
1501
|
);
|
|
1491
|
-
function
|
|
1502
|
+
function xe(t) {
|
|
1492
1503
|
var a;
|
|
1493
|
-
const
|
|
1504
|
+
const n = {};
|
|
1494
1505
|
if ((a = t.params) != null && a.properties)
|
|
1495
|
-
for (const [r,
|
|
1496
|
-
|
|
1497
|
-
return
|
|
1506
|
+
for (const [r, i] of Object.entries(t.params.properties))
|
|
1507
|
+
i.default !== void 0 && (n[r] = i.default);
|
|
1508
|
+
return n;
|
|
1498
1509
|
}
|
|
1499
1510
|
function ae(t) {
|
|
1500
1511
|
return t === "pending" ? "floimg-node--pending" : t === "running" ? "floimg-node--running" : t === "completed" ? "floimg-node--completed" : t === "error" ? "floimg-node--error" : "";
|
|
1501
1512
|
}
|
|
1502
|
-
function
|
|
1503
|
-
const a = w((
|
|
1513
|
+
function Ie({ nodeId: t, color: n }) {
|
|
1514
|
+
const a = w((i) => i.previewVisible[t] !== !1), r = w((i) => i.togglePreview);
|
|
1504
1515
|
return /* @__PURE__ */ e(
|
|
1505
1516
|
"button",
|
|
1506
1517
|
{
|
|
1507
|
-
onClick: (
|
|
1508
|
-
|
|
1518
|
+
onClick: (i) => {
|
|
1519
|
+
i.stopPropagation(), r(t);
|
|
1509
1520
|
},
|
|
1510
1521
|
className: `ml-auto p-1 rounded hover:bg-gray-200 dark:hover:bg-zinc-600 transition-colors ${a ? "opacity-100" : "opacity-40"}`,
|
|
1511
1522
|
title: a ? "Hide preview" : "Show preview",
|
|
1512
|
-
children: /* @__PURE__ */ e("svg", { className: `w-3.5 h-3.5 ${
|
|
1523
|
+
children: /* @__PURE__ */ e("svg", { className: `w-3.5 h-3.5 ${n}`, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: a ? /* @__PURE__ */ e(
|
|
1513
1524
|
"path",
|
|
1514
1525
|
{
|
|
1515
1526
|
strokeLinecap: "round",
|
|
@@ -1529,12 +1540,23 @@ function Se({ nodeId: t, color: i }) {
|
|
|
1529
1540
|
}
|
|
1530
1541
|
);
|
|
1531
1542
|
}
|
|
1532
|
-
|
|
1533
|
-
|
|
1543
|
+
function oe({ nodeId: t }) {
|
|
1544
|
+
const n = w((o) => o.execution.nodeStatus[t]), a = w((o) => o.execution.errorNodeId), r = w((o) => o.execution.error);
|
|
1545
|
+
return n !== "error" ? null : /* @__PURE__ */ e("div", { className: "floimg-node__error-badge", title: (a === t ? r : "Execution failed") || "Execution failed", children: /* @__PURE__ */ e("svg", { className: "w-3.5 h-3.5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ e(
|
|
1546
|
+
"path",
|
|
1547
|
+
{
|
|
1548
|
+
fillRule: "evenodd",
|
|
1549
|
+
d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z",
|
|
1550
|
+
clipRule: "evenodd"
|
|
1551
|
+
}
|
|
1552
|
+
) }) });
|
|
1553
|
+
}
|
|
1554
|
+
const $t = re(function({
|
|
1555
|
+
id: n,
|
|
1534
1556
|
data: a,
|
|
1535
1557
|
selected: r
|
|
1536
1558
|
}) {
|
|
1537
|
-
const
|
|
1559
|
+
const i = w((p) => p.execution.previews[n]), o = w((p) => p.execution.nodeStatus[n]), c = w((p) => p.previewVisible[n] !== !1), m = ae(o), s = a.isAI, g = a.acceptsReferenceImages;
|
|
1538
1560
|
return /* @__PURE__ */ l(
|
|
1539
1561
|
"div",
|
|
1540
1562
|
{
|
|
@@ -1561,14 +1583,15 @@ const Ot = re(function({
|
|
|
1561
1583
|
title: `Reference images (up to ${a.maxReferenceImages || 14})`
|
|
1562
1584
|
}
|
|
1563
1585
|
),
|
|
1564
|
-
|
|
1586
|
+
i && c && /* @__PURE__ */ e("div", { className: "floimg-node__preview", children: /* @__PURE__ */ e("img", { src: i, alt: "Preview", className: "w-full h-20 object-contain rounded-md" }) }),
|
|
1587
|
+
/* @__PURE__ */ e(oe, { nodeId: n }),
|
|
1565
1588
|
/* @__PURE__ */ l("div", { className: "floimg-node__header", children: [
|
|
1566
1589
|
/* @__PURE__ */ e("div", { className: "floimg-node__icon bg-blue-500/10", children: /* @__PURE__ */ e("div", { className: "w-2 h-2 rounded-full bg-blue-500" }) }),
|
|
1567
1590
|
/* @__PURE__ */ e("span", { className: "floimg-node__title text-blue-600 dark:text-blue-400", children: a.generatorName }),
|
|
1568
1591
|
/* @__PURE__ */ e(
|
|
1569
|
-
|
|
1592
|
+
Ie,
|
|
1570
1593
|
{
|
|
1571
|
-
nodeId:
|
|
1594
|
+
nodeId: n,
|
|
1572
1595
|
color: "text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-300"
|
|
1573
1596
|
}
|
|
1574
1597
|
)
|
|
@@ -1602,12 +1625,12 @@ const Ot = re(function({
|
|
|
1602
1625
|
]
|
|
1603
1626
|
}
|
|
1604
1627
|
);
|
|
1605
|
-
}),
|
|
1606
|
-
id:
|
|
1628
|
+
}), Ut = re(function({
|
|
1629
|
+
id: n,
|
|
1607
1630
|
data: a,
|
|
1608
1631
|
selected: r
|
|
1609
1632
|
}) {
|
|
1610
|
-
const
|
|
1633
|
+
const i = w((d) => d.execution.previews[n]), o = w((d) => d.execution.nodeStatus[n]), c = w((d) => d.previewVisible[n] !== !1), m = ae(o), s = a.isAI, g = a.acceptsReferenceImages;
|
|
1611
1634
|
return /* @__PURE__ */ l(
|
|
1612
1635
|
"div",
|
|
1613
1636
|
{
|
|
@@ -1642,7 +1665,8 @@ const Ot = re(function({
|
|
|
1642
1665
|
title: `Reference images (up to ${a.maxReferenceImages || 13})`
|
|
1643
1666
|
}
|
|
1644
1667
|
),
|
|
1645
|
-
|
|
1668
|
+
i && c && /* @__PURE__ */ e("div", { className: "floimg-node__preview", children: /* @__PURE__ */ e("img", { src: i, alt: "Preview", className: "w-full h-20 object-contain rounded-md" }) }),
|
|
1669
|
+
/* @__PURE__ */ e(oe, { nodeId: n }),
|
|
1646
1670
|
/* @__PURE__ */ l("div", { className: "floimg-node__header", children: [
|
|
1647
1671
|
/* @__PURE__ */ e("div", { className: `floimg-node__icon ${s ? "bg-indigo-500/10" : "bg-teal-500/10"}`, children: s ? /* @__PURE__ */ l("svg", { className: "w-2.5 h-2.5 text-indigo-500", fill: "currentColor", viewBox: "0 0 20 20", children: [
|
|
1648
1672
|
/* @__PURE__ */ e("path", { d: "M13 7H7v6h6V7z" }),
|
|
@@ -1663,9 +1687,9 @@ const Ot = re(function({
|
|
|
1663
1687
|
}
|
|
1664
1688
|
),
|
|
1665
1689
|
/* @__PURE__ */ e(
|
|
1666
|
-
|
|
1690
|
+
Ie,
|
|
1667
1691
|
{
|
|
1668
|
-
nodeId:
|
|
1692
|
+
nodeId: n,
|
|
1669
1693
|
color: "text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-300"
|
|
1670
1694
|
}
|
|
1671
1695
|
)
|
|
@@ -1699,12 +1723,12 @@ const Ot = re(function({
|
|
|
1699
1723
|
]
|
|
1700
1724
|
}
|
|
1701
1725
|
);
|
|
1702
|
-
}),
|
|
1703
|
-
const
|
|
1726
|
+
}), qt = re(function({ id: n, data: a, selected: r }) {
|
|
1727
|
+
const i = w((c) => c.execution.nodeStatus[n]), o = ae(i);
|
|
1704
1728
|
return /* @__PURE__ */ l(
|
|
1705
1729
|
"div",
|
|
1706
1730
|
{
|
|
1707
|
-
className: `floimg-node floimg-node--save relative min-w-[190px] ${r ? "selected" : ""} ${
|
|
1731
|
+
className: `floimg-node floimg-node--save relative min-w-[190px] ${r ? "selected" : ""} ${o}`,
|
|
1708
1732
|
children: [
|
|
1709
1733
|
/* @__PURE__ */ e(
|
|
1710
1734
|
D,
|
|
@@ -1714,6 +1738,7 @@ const Ot = re(function({
|
|
|
1714
1738
|
className: "!w-3 !h-3 !bg-emerald-500 !border-2 !border-white dark:!border-zinc-800"
|
|
1715
1739
|
}
|
|
1716
1740
|
),
|
|
1741
|
+
/* @__PURE__ */ e(oe, { nodeId: n }),
|
|
1717
1742
|
/* @__PURE__ */ l("div", { className: "floimg-node__header", children: [
|
|
1718
1743
|
/* @__PURE__ */ e("div", { className: "floimg-node__icon bg-emerald-500/10", children: /* @__PURE__ */ e(
|
|
1719
1744
|
"svg",
|
|
@@ -1731,12 +1756,12 @@ const Ot = re(function({
|
|
|
1731
1756
|
]
|
|
1732
1757
|
}
|
|
1733
1758
|
);
|
|
1734
|
-
}),
|
|
1735
|
-
const
|
|
1759
|
+
}), Gt = re(function({ id: n, data: a, selected: r }) {
|
|
1760
|
+
const i = w((x) => x.execution.previews[n]), o = w((x) => x.execution.nodeStatus[n]), c = w((x) => x.previewVisible[n] !== !1), m = w((x) => x.updateNodeData), s = X(null), g = ae(o), p = A(
|
|
1736
1761
|
async (x) => {
|
|
1737
1762
|
try {
|
|
1738
|
-
const z = await
|
|
1739
|
-
m(
|
|
1763
|
+
const z = await vt(x);
|
|
1764
|
+
m(n, {
|
|
1740
1765
|
uploadId: z.id,
|
|
1741
1766
|
filename: z.filename,
|
|
1742
1767
|
mime: z.mime
|
|
@@ -1745,7 +1770,7 @@ const Ot = re(function({
|
|
|
1745
1770
|
console.error("Upload failed:", z);
|
|
1746
1771
|
}
|
|
1747
1772
|
},
|
|
1748
|
-
[
|
|
1773
|
+
[n, m]
|
|
1749
1774
|
), d = A(
|
|
1750
1775
|
(x) => {
|
|
1751
1776
|
x.preventDefault(), x.stopPropagation();
|
|
@@ -1762,7 +1787,7 @@ const Ot = re(function({
|
|
|
1762
1787
|
z && p(z);
|
|
1763
1788
|
},
|
|
1764
1789
|
[p]
|
|
1765
|
-
), k =
|
|
1790
|
+
), k = i || (a.uploadId ? $e(a.uploadId) : null);
|
|
1766
1791
|
return /* @__PURE__ */ l(
|
|
1767
1792
|
"div",
|
|
1768
1793
|
{
|
|
@@ -1811,6 +1836,7 @@ const Ot = re(function({
|
|
|
1811
1836
|
onChange: f
|
|
1812
1837
|
}
|
|
1813
1838
|
),
|
|
1839
|
+
/* @__PURE__ */ e(oe, { nodeId: n }),
|
|
1814
1840
|
/* @__PURE__ */ l("div", { className: "floimg-node__header", children: [
|
|
1815
1841
|
/* @__PURE__ */ e("div", { className: "floimg-node__icon bg-amber-500/10", children: /* @__PURE__ */ e(
|
|
1816
1842
|
"svg",
|
|
@@ -1832,9 +1858,9 @@ const Ot = re(function({
|
|
|
1832
1858
|
) }),
|
|
1833
1859
|
/* @__PURE__ */ e("span", { className: "floimg-node__title text-amber-600 dark:text-amber-400", children: "Input" }),
|
|
1834
1860
|
/* @__PURE__ */ e(
|
|
1835
|
-
|
|
1861
|
+
Ie,
|
|
1836
1862
|
{
|
|
1837
|
-
nodeId:
|
|
1863
|
+
nodeId: n,
|
|
1838
1864
|
color: "text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-300"
|
|
1839
1865
|
}
|
|
1840
1866
|
)
|
|
@@ -1851,16 +1877,16 @@ const Ot = re(function({
|
|
|
1851
1877
|
]
|
|
1852
1878
|
}
|
|
1853
1879
|
);
|
|
1854
|
-
}),
|
|
1855
|
-
id:
|
|
1880
|
+
}), Ft = re(function({
|
|
1881
|
+
id: n,
|
|
1856
1882
|
data: a,
|
|
1857
1883
|
selected: r
|
|
1858
1884
|
}) {
|
|
1859
1885
|
var p, d, b;
|
|
1860
|
-
const
|
|
1886
|
+
const i = w((f) => f.execution.nodeStatus[n]), o = w((f) => {
|
|
1861
1887
|
var k;
|
|
1862
|
-
return (k = f.execution.dataOutputs) == null ? void 0 : k[
|
|
1863
|
-
}), c = w((f) => f.openOutputInspector), m = ae(
|
|
1888
|
+
return (k = f.execution.dataOutputs) == null ? void 0 : k[n];
|
|
1889
|
+
}), c = w((f) => f.openOutputInspector), m = ae(i), s = (p = a.outputSchema) != null && p.properties ? Object.entries(a.outputSchema.properties) : [], g = s.length > 0;
|
|
1864
1890
|
return /* @__PURE__ */ l(
|
|
1865
1891
|
"div",
|
|
1866
1892
|
{
|
|
@@ -1886,22 +1912,23 @@ const Ot = re(function({
|
|
|
1886
1912
|
title: "Image input"
|
|
1887
1913
|
}
|
|
1888
1914
|
),
|
|
1889
|
-
|
|
1915
|
+
o && /* @__PURE__ */ l("div", { className: "bg-cyan-50/50 dark:bg-cyan-900/20 border-b border-cyan-100/50 dark:border-cyan-800/30 p-2.5 max-h-20 overflow-auto", children: [
|
|
1890
1916
|
/* @__PURE__ */ l("pre", { className: "text-[11px] text-cyan-700 dark:text-cyan-300 whitespace-pre-wrap font-mono", children: [
|
|
1891
|
-
(d =
|
|
1892
|
-
(((b =
|
|
1917
|
+
(d = o.content) == null ? void 0 : d.slice(0, 150),
|
|
1918
|
+
(((b = o.content) == null ? void 0 : b.length) || 0) > 150 && "..."
|
|
1893
1919
|
] }),
|
|
1894
|
-
|
|
1920
|
+
o.content && o.content.length > 100 && /* @__PURE__ */ e(
|
|
1895
1921
|
"button",
|
|
1896
1922
|
{
|
|
1897
1923
|
onClick: (f) => {
|
|
1898
|
-
f.stopPropagation(), c(
|
|
1924
|
+
f.stopPropagation(), c(n);
|
|
1899
1925
|
},
|
|
1900
1926
|
className: "mt-1.5 text-[10px] text-cyan-500 dark:text-cyan-400 hover:text-cyan-600 dark:hover:text-cyan-300 font-medium",
|
|
1901
1927
|
children: "View Full Output"
|
|
1902
1928
|
}
|
|
1903
1929
|
)
|
|
1904
1930
|
] }),
|
|
1931
|
+
/* @__PURE__ */ e(oe, { nodeId: n }),
|
|
1905
1932
|
/* @__PURE__ */ l("div", { className: "floimg-node__header", children: [
|
|
1906
1933
|
/* @__PURE__ */ e("div", { className: "floimg-node__icon bg-cyan-500/10", children: /* @__PURE__ */ l("svg", { className: "w-2.5 h-2.5 text-cyan-500", fill: "currentColor", viewBox: "0 0 20 20", children: [
|
|
1907
1934
|
/* @__PURE__ */ e("path", { d: "M10 12a2 2 0 100-4 2 2 0 000 4z" }),
|
|
@@ -1936,7 +1963,7 @@ const Ot = re(function({
|
|
|
1936
1963
|
))
|
|
1937
1964
|
] })
|
|
1938
1965
|
] }),
|
|
1939
|
-
g ? /* @__PURE__ */ l(
|
|
1966
|
+
g ? /* @__PURE__ */ l(se, { children: [
|
|
1940
1967
|
/* @__PURE__ */ e(
|
|
1941
1968
|
D,
|
|
1942
1969
|
{
|
|
@@ -1973,12 +2000,12 @@ const Ot = re(function({
|
|
|
1973
2000
|
]
|
|
1974
2001
|
}
|
|
1975
2002
|
);
|
|
1976
|
-
}),
|
|
2003
|
+
}), Vt = re(function({ id: n, data: a, selected: r }) {
|
|
1977
2004
|
var p, d, b;
|
|
1978
|
-
const
|
|
2005
|
+
const i = w((f) => f.execution.nodeStatus[n]), o = w((f) => {
|
|
1979
2006
|
var k;
|
|
1980
|
-
return (k = f.execution.dataOutputs) == null ? void 0 : k[
|
|
1981
|
-
}), c = w((f) => f.openOutputInspector), m = ae(
|
|
2007
|
+
return (k = f.execution.dataOutputs) == null ? void 0 : k[n];
|
|
2008
|
+
}), c = w((f) => f.openOutputInspector), m = ae(i), s = (p = a.outputSchema) != null && p.properties ? Object.entries(a.outputSchema.properties) : [], g = s.length > 0;
|
|
1982
2009
|
return /* @__PURE__ */ l(
|
|
1983
2010
|
"div",
|
|
1984
2011
|
{
|
|
@@ -1992,22 +2019,23 @@ const Ot = re(function({
|
|
|
1992
2019
|
className: "!w-3 !h-3 !bg-pink-500 !border-2 !border-white dark:!border-zinc-800"
|
|
1993
2020
|
}
|
|
1994
2021
|
),
|
|
1995
|
-
|
|
2022
|
+
o && /* @__PURE__ */ l("div", { className: "bg-pink-50/50 dark:bg-pink-900/20 border-b border-pink-100/50 dark:border-pink-800/30 p-2.5 max-h-20 overflow-auto", children: [
|
|
1996
2023
|
/* @__PURE__ */ l("pre", { className: "text-[11px] text-pink-700 dark:text-pink-300 whitespace-pre-wrap font-mono", children: [
|
|
1997
|
-
(d =
|
|
1998
|
-
(((b =
|
|
2024
|
+
(d = o.content) == null ? void 0 : d.slice(0, 150),
|
|
2025
|
+
(((b = o.content) == null ? void 0 : b.length) || 0) > 150 && "..."
|
|
1999
2026
|
] }),
|
|
2000
|
-
|
|
2027
|
+
o.content && o.content.length > 100 && /* @__PURE__ */ e(
|
|
2001
2028
|
"button",
|
|
2002
2029
|
{
|
|
2003
2030
|
onClick: (f) => {
|
|
2004
|
-
f.stopPropagation(), c(
|
|
2031
|
+
f.stopPropagation(), c(n);
|
|
2005
2032
|
},
|
|
2006
2033
|
className: "mt-1.5 text-[10px] text-pink-500 dark:text-pink-400 hover:text-pink-600 dark:hover:text-pink-300 font-medium",
|
|
2007
2034
|
children: "View Full Output"
|
|
2008
2035
|
}
|
|
2009
2036
|
)
|
|
2010
2037
|
] }),
|
|
2038
|
+
/* @__PURE__ */ e(oe, { nodeId: n }),
|
|
2011
2039
|
/* @__PURE__ */ l("div", { className: "floimg-node__header", children: [
|
|
2012
2040
|
/* @__PURE__ */ e("div", { className: "floimg-node__icon bg-pink-500/10", children: /* @__PURE__ */ e("svg", { className: "w-2.5 h-2.5 text-pink-500", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ e(
|
|
2013
2041
|
"path",
|
|
@@ -2039,7 +2067,7 @@ const Ot = re(function({
|
|
|
2039
2067
|
))
|
|
2040
2068
|
] })
|
|
2041
2069
|
] }),
|
|
2042
|
-
g ? /* @__PURE__ */ l(
|
|
2070
|
+
g ? /* @__PURE__ */ l(se, { children: [
|
|
2043
2071
|
/* @__PURE__ */ e(
|
|
2044
2072
|
D,
|
|
2045
2073
|
{
|
|
@@ -2076,16 +2104,16 @@ const Ot = re(function({
|
|
|
2076
2104
|
]
|
|
2077
2105
|
}
|
|
2078
2106
|
);
|
|
2079
|
-
}),
|
|
2080
|
-
id:
|
|
2107
|
+
}), Ht = re(function({
|
|
2108
|
+
id: n,
|
|
2081
2109
|
data: a,
|
|
2082
2110
|
selected: r
|
|
2083
2111
|
}) {
|
|
2084
|
-
const
|
|
2112
|
+
const i = w((m) => m.execution.nodeStatus[n]), o = ae(i), c = a.mode === "count" && a.count || 3;
|
|
2085
2113
|
return /* @__PURE__ */ l(
|
|
2086
2114
|
"div",
|
|
2087
2115
|
{
|
|
2088
|
-
className: `floimg-node floimg-node--iterative relative min-w-[170px] overflow-hidden ${r ? "selected" : ""} ${
|
|
2116
|
+
className: `floimg-node floimg-node--iterative relative min-w-[170px] overflow-hidden ${r ? "selected" : ""} ${o}`,
|
|
2089
2117
|
children: [
|
|
2090
2118
|
/* @__PURE__ */ e(
|
|
2091
2119
|
D,
|
|
@@ -2097,6 +2125,7 @@ const Ot = re(function({
|
|
|
2097
2125
|
style: { top: "50%" }
|
|
2098
2126
|
}
|
|
2099
2127
|
),
|
|
2128
|
+
/* @__PURE__ */ e(oe, { nodeId: n }),
|
|
2100
2129
|
/* @__PURE__ */ l("div", { className: "floimg-node__header", children: [
|
|
2101
2130
|
/* @__PURE__ */ e("div", { className: "floimg-node__icon bg-orange-500/10", children: /* @__PURE__ */ e(
|
|
2102
2131
|
"svg",
|
|
@@ -2147,16 +2176,16 @@ const Ot = re(function({
|
|
|
2147
2176
|
]
|
|
2148
2177
|
}
|
|
2149
2178
|
);
|
|
2150
|
-
}),
|
|
2151
|
-
id:
|
|
2179
|
+
}), Kt = re(function({
|
|
2180
|
+
id: n,
|
|
2152
2181
|
data: a,
|
|
2153
2182
|
selected: r
|
|
2154
2183
|
}) {
|
|
2155
|
-
const
|
|
2184
|
+
const i = w((m) => m.execution.nodeStatus[n]), o = ae(i), c = a.expectedInputs || 3;
|
|
2156
2185
|
return /* @__PURE__ */ l(
|
|
2157
2186
|
"div",
|
|
2158
2187
|
{
|
|
2159
|
-
className: `floimg-node floimg-node--iterative relative min-w-[170px] overflow-hidden ${r ? "selected" : ""} ${
|
|
2188
|
+
className: `floimg-node floimg-node--iterative relative min-w-[170px] overflow-hidden ${r ? "selected" : ""} ${o}`,
|
|
2160
2189
|
children: [
|
|
2161
2190
|
Array.from({ length: c }).map((m, s) => /* @__PURE__ */ e(
|
|
2162
2191
|
D,
|
|
@@ -2172,6 +2201,7 @@ const Ot = re(function({
|
|
|
2172
2201
|
},
|
|
2173
2202
|
s
|
|
2174
2203
|
)),
|
|
2204
|
+
/* @__PURE__ */ e(oe, { nodeId: n }),
|
|
2175
2205
|
/* @__PURE__ */ l("div", { className: "floimg-node__header", children: [
|
|
2176
2206
|
/* @__PURE__ */ e("div", { className: "floimg-node__icon bg-orange-500/10", children: /* @__PURE__ */ e(
|
|
2177
2207
|
"svg",
|
|
@@ -2211,16 +2241,16 @@ const Ot = re(function({
|
|
|
2211
2241
|
]
|
|
2212
2242
|
}
|
|
2213
2243
|
);
|
|
2214
|
-
}),
|
|
2215
|
-
id:
|
|
2244
|
+
}), Jt = re(function({
|
|
2245
|
+
id: n,
|
|
2216
2246
|
data: a,
|
|
2217
2247
|
selected: r
|
|
2218
2248
|
}) {
|
|
2219
|
-
const
|
|
2249
|
+
const i = w((m) => m.execution.nodeStatus[n]), o = ae(i), c = !!a.contextProperty;
|
|
2220
2250
|
return /* @__PURE__ */ l(
|
|
2221
2251
|
"div",
|
|
2222
2252
|
{
|
|
2223
|
-
className: `floimg-node floimg-node--iterative relative min-w-[170px] overflow-hidden ${r ? "selected" : ""} ${
|
|
2253
|
+
className: `floimg-node floimg-node--iterative relative min-w-[170px] overflow-hidden ${r ? "selected" : ""} ${o}`,
|
|
2224
2254
|
children: [
|
|
2225
2255
|
/* @__PURE__ */ e(
|
|
2226
2256
|
D,
|
|
@@ -2244,6 +2274,7 @@ const Ot = re(function({
|
|
|
2244
2274
|
title: "Selection (from vision/text)"
|
|
2245
2275
|
}
|
|
2246
2276
|
),
|
|
2277
|
+
/* @__PURE__ */ e(oe, { nodeId: n }),
|
|
2247
2278
|
/* @__PURE__ */ l("div", { className: "floimg-node__header", children: [
|
|
2248
2279
|
/* @__PURE__ */ e("div", { className: "floimg-node__icon bg-amber-500/10", children: /* @__PURE__ */ e(
|
|
2249
2280
|
"svg",
|
|
@@ -2307,22 +2338,22 @@ const Ot = re(function({
|
|
|
2307
2338
|
]
|
|
2308
2339
|
}
|
|
2309
2340
|
);
|
|
2310
|
-
}),
|
|
2311
|
-
generator:
|
|
2312
|
-
transform:
|
|
2313
|
-
save:
|
|
2314
|
-
input:
|
|
2315
|
-
vision:
|
|
2316
|
-
text:
|
|
2341
|
+
}), Qt = {
|
|
2342
|
+
generator: $t,
|
|
2343
|
+
transform: Ut,
|
|
2344
|
+
save: qt,
|
|
2345
|
+
input: Gt,
|
|
2346
|
+
vision: Ft,
|
|
2347
|
+
text: Vt,
|
|
2317
2348
|
// Iterative workflow nodes
|
|
2318
|
-
fanout:
|
|
2319
|
-
collect:
|
|
2320
|
-
router:
|
|
2321
|
-
},
|
|
2349
|
+
fanout: Ht,
|
|
2350
|
+
collect: Kt,
|
|
2351
|
+
router: Jt
|
|
2352
|
+
}, Yt = {
|
|
2322
2353
|
type: "smoothstep",
|
|
2323
2354
|
animated: !1,
|
|
2324
2355
|
markerEnd: {
|
|
2325
|
-
type:
|
|
2356
|
+
type: st.ArrowClosed,
|
|
2326
2357
|
color: "#71717a",
|
|
2327
2358
|
width: 18,
|
|
2328
2359
|
height: 18
|
|
@@ -2335,8 +2366,8 @@ const Ot = re(function({
|
|
|
2335
2366
|
// Make edges easier to select
|
|
2336
2367
|
interactionWidth: 20
|
|
2337
2368
|
};
|
|
2338
|
-
function
|
|
2339
|
-
const t = w((f) => f.nodes),
|
|
2369
|
+
function Zt() {
|
|
2370
|
+
const t = w((f) => f.nodes), n = w((f) => f.edges), a = w((f) => f.setNodes), r = w((f) => f.setEdges), i = w((f) => f.addEdge), o = w((f) => f.setSelectedNode), c = de(() => Qt, []), m = A(
|
|
2340
2371
|
(f) => {
|
|
2341
2372
|
const { source: k, target: x, targetHandle: z } = f;
|
|
2342
2373
|
if (!k || !x) return !1;
|
|
@@ -2351,50 +2382,50 @@ function Yt() {
|
|
|
2351
2382
|
[t]
|
|
2352
2383
|
), s = A(
|
|
2353
2384
|
(f) => {
|
|
2354
|
-
a(
|
|
2385
|
+
a(nt(f, t));
|
|
2355
2386
|
},
|
|
2356
2387
|
[t, a]
|
|
2357
2388
|
), g = A(
|
|
2358
2389
|
(f) => {
|
|
2359
|
-
r(
|
|
2390
|
+
r(it(f, n));
|
|
2360
2391
|
},
|
|
2361
|
-
[
|
|
2392
|
+
[n, r]
|
|
2362
2393
|
), p = A(
|
|
2363
2394
|
(f) => {
|
|
2364
2395
|
if (!(f.targetHandle === "references")) {
|
|
2365
|
-
const x =
|
|
2396
|
+
const x = n.filter((z) => {
|
|
2366
2397
|
if (z.target !== f.target) return !1;
|
|
2367
2398
|
const C = z.targetHandle || null, u = f.targetHandle || null;
|
|
2368
2399
|
return C === u || (f.targetHandle === "text" || f.targetHandle === "image") && !z.targetHandle || !f.targetHandle && z.targetHandle === "image";
|
|
2369
2400
|
});
|
|
2370
2401
|
if (x.length > 0) {
|
|
2371
2402
|
const z = new Set(x.map((C) => C.id));
|
|
2372
|
-
r(
|
|
2403
|
+
r(n.filter((C) => !z.has(C.id)));
|
|
2373
2404
|
}
|
|
2374
2405
|
}
|
|
2375
|
-
|
|
2406
|
+
i(f);
|
|
2376
2407
|
},
|
|
2377
|
-
[
|
|
2408
|
+
[i, n, r]
|
|
2378
2409
|
), d = A(
|
|
2379
2410
|
(f, k) => {
|
|
2380
|
-
|
|
2411
|
+
o(k.id);
|
|
2381
2412
|
},
|
|
2382
|
-
[
|
|
2413
|
+
[o]
|
|
2383
2414
|
), b = A(() => {
|
|
2384
|
-
|
|
2385
|
-
}, [
|
|
2415
|
+
o(null);
|
|
2416
|
+
}, [o]);
|
|
2386
2417
|
return /* @__PURE__ */ e("div", { className: "h-full w-full", children: /* @__PURE__ */ l(
|
|
2387
|
-
|
|
2418
|
+
ot,
|
|
2388
2419
|
{
|
|
2389
2420
|
nodes: t,
|
|
2390
|
-
edges:
|
|
2421
|
+
edges: n,
|
|
2391
2422
|
onNodesChange: s,
|
|
2392
2423
|
onEdgesChange: g,
|
|
2393
2424
|
onConnect: p,
|
|
2394
2425
|
onNodeClick: d,
|
|
2395
2426
|
onPaneClick: b,
|
|
2396
2427
|
nodeTypes: c,
|
|
2397
|
-
defaultEdgeOptions:
|
|
2428
|
+
defaultEdgeOptions: Yt,
|
|
2398
2429
|
isValidConnection: m,
|
|
2399
2430
|
nodesDraggable: !0,
|
|
2400
2431
|
nodesConnectable: !0,
|
|
@@ -2406,10 +2437,10 @@ function Yt() {
|
|
|
2406
2437
|
snapToGrid: !0,
|
|
2407
2438
|
snapGrid: [15, 15],
|
|
2408
2439
|
children: [
|
|
2409
|
-
/* @__PURE__ */ e(
|
|
2410
|
-
/* @__PURE__ */ e(
|
|
2440
|
+
/* @__PURE__ */ e(dt, { variant: lt.Dots, gap: 20, size: 1.5 }),
|
|
2441
|
+
/* @__PURE__ */ e(ct, { showInteractive: !1 }),
|
|
2411
2442
|
/* @__PURE__ */ e(
|
|
2412
|
-
|
|
2443
|
+
mt,
|
|
2413
2444
|
{
|
|
2414
2445
|
nodeStrokeWidth: 2,
|
|
2415
2446
|
nodeColor: "#71717a",
|
|
@@ -2422,16 +2453,16 @@ function Yt() {
|
|
|
2422
2453
|
}
|
|
2423
2454
|
) });
|
|
2424
2455
|
}
|
|
2425
|
-
function
|
|
2426
|
-
const [
|
|
2456
|
+
function Xt({ onSelect: t }) {
|
|
2457
|
+
const [n, a] = _([]), [r, i] = _(!0), [o, c] = _(null), m = async () => {
|
|
2427
2458
|
try {
|
|
2428
|
-
|
|
2429
|
-
const p = await
|
|
2459
|
+
i(!0);
|
|
2460
|
+
const p = await Nt();
|
|
2430
2461
|
a(p), c(null);
|
|
2431
2462
|
} catch (p) {
|
|
2432
2463
|
c(p instanceof Error ? p.message : "Failed to load uploads");
|
|
2433
2464
|
} finally {
|
|
2434
|
-
|
|
2465
|
+
i(!1);
|
|
2435
2466
|
}
|
|
2436
2467
|
};
|
|
2437
2468
|
G(() => {
|
|
@@ -2440,13 +2471,13 @@ function Zt({ onSelect: t }) {
|
|
|
2440
2471
|
const s = async (p, d) => {
|
|
2441
2472
|
if (d.stopPropagation(), !!confirm("Delete this upload?"))
|
|
2442
2473
|
try {
|
|
2443
|
-
await
|
|
2474
|
+
await zt(p), a((b) => b.filter((f) => f.id !== p));
|
|
2444
2475
|
} catch (b) {
|
|
2445
2476
|
console.error("Failed to delete:", b);
|
|
2446
2477
|
}
|
|
2447
2478
|
}, g = (p) => p < 1024 ? `${p} B` : p < 1024 * 1024 ? `${(p / 1024).toFixed(1)} KB` : `${(p / (1024 * 1024)).toFixed(1)} MB`;
|
|
2448
|
-
return r ? /* @__PURE__ */ e("div", { className: "p-4 text-center text-gray-500 dark:text-zinc-400", children: "Loading uploads..." }) :
|
|
2449
|
-
|
|
2479
|
+
return r ? /* @__PURE__ */ e("div", { className: "p-4 text-center text-gray-500 dark:text-zinc-400", children: "Loading uploads..." }) : o ? /* @__PURE__ */ l("div", { className: "p-4 text-center text-red-500 dark:text-red-400", children: [
|
|
2480
|
+
o,
|
|
2450
2481
|
/* @__PURE__ */ e(
|
|
2451
2482
|
"button",
|
|
2452
2483
|
{
|
|
@@ -2455,7 +2486,7 @@ function Zt({ onSelect: t }) {
|
|
|
2455
2486
|
children: "Retry"
|
|
2456
2487
|
}
|
|
2457
2488
|
)
|
|
2458
|
-
] }) :
|
|
2489
|
+
] }) : n.length === 0 ? /* @__PURE__ */ e("div", { className: "p-4 text-center text-gray-500 dark:text-zinc-400", children: "No uploads yet. Drag an image onto an Input node to upload." }) : /* @__PURE__ */ e("div", { className: "p-2", children: /* @__PURE__ */ e("div", { className: "grid grid-cols-2 gap-2", children: n.map((p) => /* @__PURE__ */ l(
|
|
2459
2490
|
"div",
|
|
2460
2491
|
{
|
|
2461
2492
|
className: "relative group rounded border border-gray-200 dark:border-zinc-700 overflow-hidden cursor-pointer hover:border-amber-400 dark:hover:border-amber-500 transition-colors",
|
|
@@ -2464,7 +2495,7 @@ function Zt({ onSelect: t }) {
|
|
|
2464
2495
|
/* @__PURE__ */ e(
|
|
2465
2496
|
"img",
|
|
2466
2497
|
{
|
|
2467
|
-
src:
|
|
2498
|
+
src: $e(p.id),
|
|
2468
2499
|
alt: p.filename,
|
|
2469
2500
|
className: "w-full h-20 object-cover"
|
|
2470
2501
|
}
|
|
@@ -2486,71 +2517,71 @@ function Zt({ onSelect: t }) {
|
|
|
2486
2517
|
}
|
|
2487
2518
|
function ee({
|
|
2488
2519
|
definition: t,
|
|
2489
|
-
colorVariant:
|
|
2520
|
+
colorVariant: n,
|
|
2490
2521
|
onDragStart: a,
|
|
2491
2522
|
onDoubleClick: r,
|
|
2492
|
-
disabled:
|
|
2493
|
-
onDisabledClick:
|
|
2523
|
+
disabled: i = !1,
|
|
2524
|
+
onDisabledClick: o,
|
|
2494
2525
|
badge: c,
|
|
2495
2526
|
alternateMessage: m
|
|
2496
2527
|
}) {
|
|
2497
2528
|
const s = (b) => {
|
|
2498
|
-
if (
|
|
2529
|
+
if (i) {
|
|
2499
2530
|
b.preventDefault();
|
|
2500
2531
|
return;
|
|
2501
2532
|
}
|
|
2502
2533
|
a(b, t);
|
|
2503
2534
|
}, g = () => {
|
|
2504
|
-
if (
|
|
2505
|
-
|
|
2535
|
+
if (i && o) {
|
|
2536
|
+
o(t);
|
|
2506
2537
|
return;
|
|
2507
2538
|
}
|
|
2508
|
-
|
|
2539
|
+
i || r(t);
|
|
2509
2540
|
}, p = () => {
|
|
2510
|
-
|
|
2541
|
+
i && o && o(t);
|
|
2511
2542
|
}, d = [
|
|
2512
2543
|
"floimg-palette-item",
|
|
2513
|
-
`floimg-palette-item--${
|
|
2514
|
-
|
|
2544
|
+
`floimg-palette-item--${n}`,
|
|
2545
|
+
i && "floimg-palette-item--disabled"
|
|
2515
2546
|
].filter(Boolean).join(" ");
|
|
2516
2547
|
return /* @__PURE__ */ l(
|
|
2517
2548
|
"div",
|
|
2518
2549
|
{
|
|
2519
|
-
draggable: !
|
|
2550
|
+
draggable: !i,
|
|
2520
2551
|
onDragStart: s,
|
|
2521
2552
|
onDoubleClick: g,
|
|
2522
|
-
onClick:
|
|
2553
|
+
onClick: i ? p : void 0,
|
|
2523
2554
|
className: d,
|
|
2524
2555
|
children: [
|
|
2525
2556
|
/* @__PURE__ */ l("div", { className: "floimg-palette-item__header", children: [
|
|
2526
2557
|
/* @__PURE__ */ e("div", { className: "floimg-palette-item__title", children: t.label }),
|
|
2527
2558
|
c
|
|
2528
2559
|
] }),
|
|
2529
|
-
t.description && !
|
|
2530
|
-
|
|
2560
|
+
t.description && !i && /* @__PURE__ */ e("div", { className: "floimg-palette-item__desc", children: t.description }),
|
|
2561
|
+
i && m && /* @__PURE__ */ e("div", { className: "floimg-palette-item__alternate-message", children: m })
|
|
2531
2562
|
]
|
|
2532
2563
|
}
|
|
2533
2564
|
);
|
|
2534
2565
|
}
|
|
2535
|
-
function
|
|
2536
|
-
const t = w((N) => N.setGenerators),
|
|
2566
|
+
function er() {
|
|
2567
|
+
const t = w((N) => N.setGenerators), n = w((N) => N.setTransforms), a = w((N) => N.setTextProviders), r = w((N) => N.setVisionProviders), i = w((N) => N.generators), o = w((N) => N.transforms), c = w((N) => N.textProviders), m = w((N) => N.visionProviders), s = w((N) => N.addNode), [g, p] = _(!1), { data: d } = he({
|
|
2537
2568
|
queryKey: ["generators"],
|
|
2538
|
-
queryFn: gt
|
|
2539
|
-
}), { data: b } = fe({
|
|
2540
|
-
queryKey: ["transforms"],
|
|
2541
2569
|
queryFn: ft
|
|
2542
|
-
}), { data:
|
|
2543
|
-
queryKey: ["
|
|
2570
|
+
}), { data: b } = he({
|
|
2571
|
+
queryKey: ["transforms"],
|
|
2544
2572
|
queryFn: ht
|
|
2545
|
-
}), { data:
|
|
2546
|
-
queryKey: ["
|
|
2573
|
+
}), { data: f } = he({
|
|
2574
|
+
queryKey: ["textProviders"],
|
|
2547
2575
|
queryFn: bt
|
|
2576
|
+
}), { data: k } = he({
|
|
2577
|
+
queryKey: ["visionProviders"],
|
|
2578
|
+
queryFn: xt
|
|
2548
2579
|
});
|
|
2549
2580
|
G(() => {
|
|
2550
2581
|
d && t(d);
|
|
2551
2582
|
}, [d, t]), G(() => {
|
|
2552
|
-
b &&
|
|
2553
|
-
}, [b,
|
|
2583
|
+
b && n(b);
|
|
2584
|
+
}, [b, n]), G(() => {
|
|
2554
2585
|
f && a(f);
|
|
2555
2586
|
}, [f, a]), G(() => {
|
|
2556
2587
|
k && r(k);
|
|
@@ -2688,13 +2719,13 @@ function Xt() {
|
|
|
2688
2719
|
}
|
|
2689
2720
|
}
|
|
2690
2721
|
}
|
|
2691
|
-
}, B =
|
|
2722
|
+
}, B = i.reduce(
|
|
2692
2723
|
(N, L) => {
|
|
2693
2724
|
const S = L.category || "Other";
|
|
2694
2725
|
return N[S] || (N[S] = []), N[S].push(L), N;
|
|
2695
2726
|
},
|
|
2696
2727
|
{}
|
|
2697
|
-
), T =
|
|
2728
|
+
), T = o.reduce(
|
|
2698
2729
|
(N, L) => {
|
|
2699
2730
|
const S = L.category || "Other";
|
|
2700
2731
|
return N[S] || (N[S] = []), N[S].push(L), N;
|
|
@@ -2727,7 +2758,7 @@ function Xt() {
|
|
|
2727
2758
|
onDoubleClick: z
|
|
2728
2759
|
}
|
|
2729
2760
|
),
|
|
2730
|
-
g && /* @__PURE__ */ e("div", { className: "mt-2 border border-amber-200 dark:border-amber-700 rounded bg-white dark:bg-zinc-900 max-h-64 overflow-y-auto", children: /* @__PURE__ */ e(
|
|
2761
|
+
g && /* @__PURE__ */ e("div", { className: "mt-2 border border-amber-200 dark:border-amber-700 rounded bg-white dark:bg-zinc-900 max-h-64 overflow-y-auto", children: /* @__PURE__ */ e(Xt, {}) })
|
|
2731
2762
|
] }),
|
|
2732
2763
|
/* @__PURE__ */ l("div", { className: "floimg-sidebar__section", children: [
|
|
2733
2764
|
/* @__PURE__ */ e("h3", { className: "floimg-sidebar__header !text-blue-600 dark:!text-blue-400", children: "Generators" }),
|
|
@@ -2831,9 +2862,9 @@ function Xt() {
|
|
|
2831
2862
|
] })
|
|
2832
2863
|
] }) });
|
|
2833
2864
|
}
|
|
2834
|
-
function
|
|
2865
|
+
function tr() {
|
|
2835
2866
|
var k, x, z, C;
|
|
2836
|
-
const t = w((u) => u.selectedNodeId),
|
|
2867
|
+
const t = w((u) => u.selectedNodeId), n = w((u) => u.nodes), a = w((u) => u.generators), r = w((u) => u.transforms), i = w((u) => u.textProviders), o = w((u) => u.visionProviders), c = w((u) => u.updateNodeData), m = w((u) => u.deleteNode), s = n.find((u) => u.id === t);
|
|
2837
2868
|
if (!s)
|
|
2838
2869
|
return null;
|
|
2839
2870
|
let g, p = "";
|
|
@@ -2853,10 +2884,10 @@ function er() {
|
|
|
2853
2884
|
}
|
|
2854
2885
|
};
|
|
2855
2886
|
} else if (s.type === "text") {
|
|
2856
|
-
const u = s.data, h =
|
|
2887
|
+
const u = s.data, h = i.find((y) => y.name === u.providerName);
|
|
2857
2888
|
g = (z = h == null ? void 0 : h.params) == null ? void 0 : z.properties, p = (h == null ? void 0 : h.label) || u.providerName;
|
|
2858
2889
|
} else if (s.type === "vision") {
|
|
2859
|
-
const u = s.data, h =
|
|
2890
|
+
const u = s.data, h = o.find((y) => y.name === u.providerName);
|
|
2860
2891
|
g = (C = h == null ? void 0 : h.params) == null ? void 0 : C.properties, p = (h == null ? void 0 : h.label) || u.providerName;
|
|
2861
2892
|
} else s.type === "fanout" ? (p = "Fan-Out", g = {
|
|
2862
2893
|
mode: {
|
|
@@ -2982,7 +3013,7 @@ function er() {
|
|
|
2982
3013
|
/* @__PURE__ */ e("button", { onClick: () => m(s.id), className: "floimg-inspector__delete", children: "Delete" })
|
|
2983
3014
|
] }),
|
|
2984
3015
|
/* @__PURE__ */ e("div", { className: "space-y-4", children: g && Object.entries(g).filter(([u, h]) => f(u)).map(([u, h]) => /* @__PURE__ */ e(
|
|
2985
|
-
|
|
3016
|
+
rr,
|
|
2986
3017
|
{
|
|
2987
3018
|
name: u,
|
|
2988
3019
|
field: h,
|
|
@@ -2992,7 +3023,7 @@ function er() {
|
|
|
2992
3023
|
u
|
|
2993
3024
|
)) }),
|
|
2994
3025
|
(s.type === "text" || s.type === "vision") && /* @__PURE__ */ e(
|
|
2995
|
-
|
|
3026
|
+
ar,
|
|
2996
3027
|
{
|
|
2997
3028
|
nodeId: s.id,
|
|
2998
3029
|
outputSchema: s.data.outputSchema,
|
|
@@ -3001,57 +3032,57 @@ function er() {
|
|
|
3001
3032
|
)
|
|
3002
3033
|
] }) });
|
|
3003
3034
|
}
|
|
3004
|
-
function
|
|
3005
|
-
const
|
|
3006
|
-
return
|
|
3007
|
-
/* @__PURE__ */ e("label", { className: "floimg-field__label", children:
|
|
3035
|
+
function rr({ name: t, field: n, value: a, onChange: r }) {
|
|
3036
|
+
const i = n.title || t;
|
|
3037
|
+
return n.enum ? /* @__PURE__ */ l("div", { className: "floimg-field", children: [
|
|
3038
|
+
/* @__PURE__ */ e("label", { className: "floimg-field__label", children: i }),
|
|
3008
3039
|
/* @__PURE__ */ l(
|
|
3009
3040
|
"select",
|
|
3010
3041
|
{
|
|
3011
3042
|
value: String(a || ""),
|
|
3012
|
-
onChange: (
|
|
3043
|
+
onChange: (o) => r(o.target.value),
|
|
3013
3044
|
className: "floimg-field__input",
|
|
3014
3045
|
children: [
|
|
3015
3046
|
/* @__PURE__ */ e("option", { value: "", children: "Select..." }),
|
|
3016
|
-
|
|
3047
|
+
n.enum.map((o) => /* @__PURE__ */ e("option", { value: o, children: o }, o))
|
|
3017
3048
|
]
|
|
3018
3049
|
}
|
|
3019
3050
|
),
|
|
3020
|
-
|
|
3021
|
-
] }) :
|
|
3022
|
-
/* @__PURE__ */ e("label", { className: "floimg-field__label", children:
|
|
3051
|
+
n.description && /* @__PURE__ */ e("p", { className: "floimg-field__hint", children: n.description })
|
|
3052
|
+
] }) : n.type === "number" ? /* @__PURE__ */ l("div", { className: "floimg-field", children: [
|
|
3053
|
+
/* @__PURE__ */ e("label", { className: "floimg-field__label", children: i }),
|
|
3023
3054
|
/* @__PURE__ */ e(
|
|
3024
3055
|
"input",
|
|
3025
3056
|
{
|
|
3026
3057
|
type: "number",
|
|
3027
3058
|
value: a !== void 0 ? Number(a) : "",
|
|
3028
|
-
onChange: (
|
|
3029
|
-
min:
|
|
3030
|
-
max:
|
|
3059
|
+
onChange: (o) => r(Number(o.target.value)),
|
|
3060
|
+
min: n.minimum,
|
|
3061
|
+
max: n.maximum,
|
|
3031
3062
|
className: "floimg-field__input"
|
|
3032
3063
|
}
|
|
3033
3064
|
),
|
|
3034
|
-
|
|
3035
|
-
] }) :
|
|
3065
|
+
n.description && /* @__PURE__ */ e("p", { className: "floimg-field__hint", children: n.description })
|
|
3066
|
+
] }) : n.type === "boolean" ? /* @__PURE__ */ l("div", { className: "floimg-field flex items-center gap-2", children: [
|
|
3036
3067
|
/* @__PURE__ */ e(
|
|
3037
3068
|
"input",
|
|
3038
3069
|
{
|
|
3039
3070
|
type: "checkbox",
|
|
3040
3071
|
checked: !!a,
|
|
3041
|
-
onChange: (
|
|
3072
|
+
onChange: (o) => r(o.target.checked),
|
|
3042
3073
|
className: "h-4 w-4 text-teal-600 focus:ring-teal-500 border-gray-300 dark:border-zinc-600 rounded bg-white dark:bg-zinc-900"
|
|
3043
3074
|
}
|
|
3044
3075
|
),
|
|
3045
|
-
/* @__PURE__ */ e("label", { className: "floimg-field__label !mb-0", children:
|
|
3076
|
+
/* @__PURE__ */ e("label", { className: "floimg-field__label !mb-0", children: i })
|
|
3046
3077
|
] }) : t.toLowerCase().includes("color") && typeof a == "string" && a.startsWith("#") ? /* @__PURE__ */ l("div", { className: "floimg-field", children: [
|
|
3047
|
-
/* @__PURE__ */ e("label", { className: "floimg-field__label", children:
|
|
3078
|
+
/* @__PURE__ */ e("label", { className: "floimg-field__label", children: i }),
|
|
3048
3079
|
/* @__PURE__ */ l("div", { className: "flex gap-2", children: [
|
|
3049
3080
|
/* @__PURE__ */ e(
|
|
3050
3081
|
"input",
|
|
3051
3082
|
{
|
|
3052
3083
|
type: "color",
|
|
3053
3084
|
value: String(a || "#000000"),
|
|
3054
|
-
onChange: (
|
|
3085
|
+
onChange: (o) => r(o.target.value),
|
|
3055
3086
|
className: "h-10 w-14 p-1 border border-gray-300 dark:border-zinc-600 rounded-lg"
|
|
3056
3087
|
}
|
|
3057
3088
|
),
|
|
@@ -3060,20 +3091,20 @@ function tr({ name: t, field: i, value: a, onChange: r }) {
|
|
|
3060
3091
|
{
|
|
3061
3092
|
type: "text",
|
|
3062
3093
|
value: String(a || ""),
|
|
3063
|
-
onChange: (
|
|
3094
|
+
onChange: (o) => r(o.target.value),
|
|
3064
3095
|
className: "floimg-field__input flex-1"
|
|
3065
3096
|
}
|
|
3066
3097
|
)
|
|
3067
3098
|
] })
|
|
3068
|
-
] }) :
|
|
3069
|
-
/* @__PURE__ */ e("label", { className: "floimg-field__label", children:
|
|
3099
|
+
] }) : n.type === "object" ? /* @__PURE__ */ l("div", { className: "floimg-field", children: [
|
|
3100
|
+
/* @__PURE__ */ e("label", { className: "floimg-field__label", children: i }),
|
|
3070
3101
|
/* @__PURE__ */ e(
|
|
3071
3102
|
"textarea",
|
|
3072
3103
|
{
|
|
3073
3104
|
value: a ? JSON.stringify(a, null, 2) : "{}",
|
|
3074
|
-
onChange: (
|
|
3105
|
+
onChange: (o) => {
|
|
3075
3106
|
try {
|
|
3076
|
-
r(JSON.parse(
|
|
3107
|
+
r(JSON.parse(o.target.value));
|
|
3077
3108
|
} catch {
|
|
3078
3109
|
}
|
|
3079
3110
|
},
|
|
@@ -3081,14 +3112,14 @@ function tr({ name: t, field: i, value: a, onChange: r }) {
|
|
|
3081
3112
|
className: "floimg-field__input font-mono text-xs"
|
|
3082
3113
|
}
|
|
3083
3114
|
),
|
|
3084
|
-
|
|
3115
|
+
n.description && /* @__PURE__ */ e("p", { className: "floimg-field__hint", children: n.description })
|
|
3085
3116
|
] }) : /* @__PURE__ */ l("div", { className: "floimg-field", children: [
|
|
3086
|
-
/* @__PURE__ */ e("label", { className: "floimg-field__label", children:
|
|
3117
|
+
/* @__PURE__ */ e("label", { className: "floimg-field__label", children: i }),
|
|
3087
3118
|
t === "prompt" || t === "code" || t === "text" ? /* @__PURE__ */ e(
|
|
3088
3119
|
"textarea",
|
|
3089
3120
|
{
|
|
3090
3121
|
value: String(a || ""),
|
|
3091
|
-
onChange: (
|
|
3122
|
+
onChange: (o) => r(o.target.value),
|
|
3092
3123
|
rows: 3,
|
|
3093
3124
|
className: "floimg-field__input"
|
|
3094
3125
|
}
|
|
@@ -3097,26 +3128,26 @@ function tr({ name: t, field: i, value: a, onChange: r }) {
|
|
|
3097
3128
|
{
|
|
3098
3129
|
type: "text",
|
|
3099
3130
|
value: String(a || ""),
|
|
3100
|
-
onChange: (
|
|
3131
|
+
onChange: (o) => r(o.target.value),
|
|
3101
3132
|
className: "floimg-field__input"
|
|
3102
3133
|
}
|
|
3103
3134
|
),
|
|
3104
|
-
|
|
3135
|
+
n.description && /* @__PURE__ */ e("p", { className: "floimg-field__hint", children: n.description })
|
|
3105
3136
|
] });
|
|
3106
3137
|
}
|
|
3107
|
-
function
|
|
3108
|
-
const [r,
|
|
3138
|
+
function ar({ nodeId: t, outputSchema: n, updateNodeData: a }) {
|
|
3139
|
+
const [r, i] = _(""), o = (n == null ? void 0 : n.properties) || {}, c = Object.entries(o), m = () => {
|
|
3109
3140
|
if (!r.trim()) return;
|
|
3110
3141
|
const d = {
|
|
3111
3142
|
type: "object",
|
|
3112
3143
|
properties: {
|
|
3113
|
-
...
|
|
3144
|
+
...o,
|
|
3114
3145
|
[r.trim()]: { type: "string" }
|
|
3115
3146
|
}
|
|
3116
3147
|
};
|
|
3117
|
-
a(t, { outputSchema: d }),
|
|
3148
|
+
a(t, { outputSchema: d }), i("");
|
|
3118
3149
|
}, s = (d) => {
|
|
3119
|
-
const b = { ...
|
|
3150
|
+
const b = { ...o };
|
|
3120
3151
|
delete b[d], Object.keys(b).length === 0 ? a(t, { outputSchema: void 0 }) : a(t, {
|
|
3121
3152
|
outputSchema: { type: "object", properties: b }
|
|
3122
3153
|
});
|
|
@@ -3125,8 +3156,8 @@ function rr({ nodeId: t, outputSchema: i, updateNodeData: a }) {
|
|
|
3125
3156
|
outputSchema: {
|
|
3126
3157
|
type: "object",
|
|
3127
3158
|
properties: {
|
|
3128
|
-
...
|
|
3129
|
-
[d]: { ...
|
|
3159
|
+
...o,
|
|
3160
|
+
[d]: { ...o[d], type: b }
|
|
3130
3161
|
}
|
|
3131
3162
|
}
|
|
3132
3163
|
});
|
|
@@ -3135,8 +3166,8 @@ function rr({ nodeId: t, outputSchema: i, updateNodeData: a }) {
|
|
|
3135
3166
|
outputSchema: {
|
|
3136
3167
|
type: "object",
|
|
3137
3168
|
properties: {
|
|
3138
|
-
...
|
|
3139
|
-
[d]: { ...
|
|
3169
|
+
...o,
|
|
3170
|
+
[d]: { ...o[d], description: b || void 0 }
|
|
3140
3171
|
}
|
|
3141
3172
|
}
|
|
3142
3173
|
});
|
|
@@ -3209,7 +3240,7 @@ function rr({ nodeId: t, outputSchema: i, updateNodeData: a }) {
|
|
|
3209
3240
|
{
|
|
3210
3241
|
type: "text",
|
|
3211
3242
|
value: r,
|
|
3212
|
-
onChange: (d) =>
|
|
3243
|
+
onChange: (d) => i(d.target.value),
|
|
3213
3244
|
onKeyDown: (d) => d.key === "Enter" && m(),
|
|
3214
3245
|
placeholder: "Property name...",
|
|
3215
3246
|
className: "flex-1 px-2 py-1.5 text-sm border border-gray-300 dark:border-zinc-600 rounded bg-white dark:bg-zinc-900 text-gray-900 dark:text-zinc-100 placeholder-gray-400 dark:placeholder-zinc-500"
|
|
@@ -3228,7 +3259,7 @@ function rr({ nodeId: t, outputSchema: i, updateNodeData: a }) {
|
|
|
3228
3259
|
c.length > 0 && /* @__PURE__ */ e("p", { className: "mt-3 text-xs text-gray-500 dark:text-zinc-500", children: "Connect from the small pink handles on the right of the node to route individual properties." })
|
|
3229
3260
|
] });
|
|
3230
3261
|
}
|
|
3231
|
-
const
|
|
3262
|
+
const Ge = ["shift", "alt", "meta", "mod", "ctrl", "control"], or = {
|
|
3232
3263
|
esc: "escape",
|
|
3233
3264
|
return: "enter",
|
|
3234
3265
|
left: "arrowleft",
|
|
@@ -3246,38 +3277,38 @@ const qe = ["shift", "alt", "meta", "mod", "ctrl", "control"], ar = {
|
|
|
3246
3277
|
ControlLeft: "ctrl",
|
|
3247
3278
|
ControlRight: "ctrl"
|
|
3248
3279
|
};
|
|
3249
|
-
function
|
|
3250
|
-
return (
|
|
3280
|
+
function ie(t) {
|
|
3281
|
+
return (or[t.trim()] || t.trim()).toLowerCase().replace(/key|digit|numpad/, "");
|
|
3251
3282
|
}
|
|
3252
|
-
function
|
|
3253
|
-
return
|
|
3283
|
+
function Fe(t) {
|
|
3284
|
+
return Ge.includes(t);
|
|
3254
3285
|
}
|
|
3255
|
-
function
|
|
3256
|
-
return t.toLowerCase().split(
|
|
3286
|
+
function Ne(t, n = ",") {
|
|
3287
|
+
return t.toLowerCase().split(n);
|
|
3257
3288
|
}
|
|
3258
|
-
function
|
|
3259
|
-
let
|
|
3260
|
-
t = t.trim(), t.includes(a) ? (c = !0,
|
|
3289
|
+
function ze(t, n = "+", a = ">", r = !1, i) {
|
|
3290
|
+
let o = [], c = !1;
|
|
3291
|
+
t = t.trim(), t.includes(a) ? (c = !0, o = t.toLocaleLowerCase().split(a).map((g) => ie(g))) : o = t.toLocaleLowerCase().split(n).map((g) => ie(g));
|
|
3261
3292
|
const m = {
|
|
3262
|
-
alt:
|
|
3263
|
-
ctrl:
|
|
3264
|
-
shift:
|
|
3265
|
-
meta:
|
|
3266
|
-
mod:
|
|
3293
|
+
alt: o.includes("alt"),
|
|
3294
|
+
ctrl: o.includes("ctrl") || o.includes("control"),
|
|
3295
|
+
shift: o.includes("shift"),
|
|
3296
|
+
meta: o.includes("meta"),
|
|
3297
|
+
mod: o.includes("mod"),
|
|
3267
3298
|
useKey: r
|
|
3268
|
-
}, s =
|
|
3299
|
+
}, s = o.filter((g) => !Ge.includes(g));
|
|
3269
3300
|
return {
|
|
3270
3301
|
...m,
|
|
3271
3302
|
keys: s,
|
|
3272
|
-
description:
|
|
3303
|
+
description: i,
|
|
3273
3304
|
isSequence: c,
|
|
3274
3305
|
hotkey: t
|
|
3275
3306
|
};
|
|
3276
3307
|
}
|
|
3277
3308
|
typeof document < "u" && (document.addEventListener("keydown", (t) => {
|
|
3278
|
-
t.code !== void 0 &&
|
|
3309
|
+
t.code !== void 0 && Ve([ie(t.code)]);
|
|
3279
3310
|
}), document.addEventListener("keyup", (t) => {
|
|
3280
|
-
t.code !== void 0 &&
|
|
3311
|
+
t.code !== void 0 && He([ie(t.code)]);
|
|
3281
3312
|
})), typeof window < "u" && (window.addEventListener("blur", () => {
|
|
3282
3313
|
te.clear();
|
|
3283
3314
|
}), window.addEventListener("contextmenu", () => {
|
|
@@ -3286,27 +3317,27 @@ typeof document < "u" && (document.addEventListener("keydown", (t) => {
|
|
|
3286
3317
|
}, 0);
|
|
3287
3318
|
}));
|
|
3288
3319
|
const te = /* @__PURE__ */ new Set();
|
|
3289
|
-
function
|
|
3320
|
+
function Le(t) {
|
|
3290
3321
|
return Array.isArray(t);
|
|
3291
3322
|
}
|
|
3292
|
-
function
|
|
3293
|
-
return (
|
|
3294
|
-
}
|
|
3295
|
-
function Fe(t) {
|
|
3296
|
-
const i = Array.isArray(t) ? t : [t];
|
|
3297
|
-
te.has("meta") && te.forEach((a) => !Ge(a) && te.delete(a.toLowerCase())), i.forEach((a) => te.add(a.toLowerCase()));
|
|
3323
|
+
function nr(t, n = ",") {
|
|
3324
|
+
return (Le(t) ? t : t.split(n)).every((a) => te.has(a.trim().toLowerCase()));
|
|
3298
3325
|
}
|
|
3299
3326
|
function Ve(t) {
|
|
3300
|
-
const
|
|
3301
|
-
|
|
3327
|
+
const n = Array.isArray(t) ? t : [t];
|
|
3328
|
+
te.has("meta") && te.forEach((a) => !Fe(a) && te.delete(a.toLowerCase())), n.forEach((a) => te.add(a.toLowerCase()));
|
|
3302
3329
|
}
|
|
3303
|
-
function
|
|
3304
|
-
|
|
3330
|
+
function He(t) {
|
|
3331
|
+
const n = Array.isArray(t) ? t : [t];
|
|
3332
|
+
t === "meta" ? te.clear() : n.forEach((a) => te.delete(a.toLowerCase()));
|
|
3305
3333
|
}
|
|
3306
|
-
function ir(t,
|
|
3307
|
-
|
|
3334
|
+
function ir(t, n, a) {
|
|
3335
|
+
(typeof a == "function" && a(t, n) || a === !0) && t.preventDefault();
|
|
3308
3336
|
}
|
|
3309
|
-
|
|
3337
|
+
function sr(t, n, a) {
|
|
3338
|
+
return typeof a == "function" ? a(t, n) : a === !0 || a === void 0;
|
|
3339
|
+
}
|
|
3340
|
+
const dr = [
|
|
3310
3341
|
"input",
|
|
3311
3342
|
"textarea",
|
|
3312
3343
|
"select",
|
|
@@ -3320,24 +3351,24 @@ const sr = [
|
|
|
3320
3351
|
"radio",
|
|
3321
3352
|
"textbox"
|
|
3322
3353
|
];
|
|
3323
|
-
function
|
|
3324
|
-
return
|
|
3354
|
+
function lr(t) {
|
|
3355
|
+
return Ke(t, dr);
|
|
3325
3356
|
}
|
|
3326
|
-
function
|
|
3357
|
+
function Ke(t, n = !1) {
|
|
3327
3358
|
const { target: a, composed: r } = t;
|
|
3328
|
-
let
|
|
3329
|
-
return
|
|
3359
|
+
let i, o;
|
|
3360
|
+
return cr(a) && r ? (i = t.composedPath()[0] && t.composedPath()[0].tagName, o = t.composedPath()[0] && t.composedPath()[0].role) : (i = a && a.tagName, o = a && a.role), Le(n) ? !!(i && n && n.some((c) => c.toLowerCase() === i.toLowerCase() || c === o)) : !!(i && n && n);
|
|
3330
3361
|
}
|
|
3331
|
-
function
|
|
3362
|
+
function cr(t) {
|
|
3332
3363
|
return !!t.tagName && !t.tagName.startsWith("-") && t.tagName.includes("-");
|
|
3333
3364
|
}
|
|
3334
|
-
function
|
|
3335
|
-
return t.length === 0 &&
|
|
3365
|
+
function mr(t, n) {
|
|
3366
|
+
return t.length === 0 && n ? (console.warn(
|
|
3336
3367
|
'A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a <HotkeysProvider>'
|
|
3337
|
-
), !0) :
|
|
3368
|
+
), !0) : n ? t.some((a) => n.includes(a)) || t.includes("*") : !0;
|
|
3338
3369
|
}
|
|
3339
|
-
const
|
|
3340
|
-
const { alt: r, meta:
|
|
3370
|
+
const pr = (t, n, a = !1) => {
|
|
3371
|
+
const { alt: r, meta: i, mod: o, shift: c, ctrl: m, keys: s, useKey: g } = n, { code: p, key: d, ctrlKey: b, metaKey: f, shiftKey: k, altKey: x } = t, z = ie(p);
|
|
3341
3372
|
if (g && (s == null ? void 0 : s.length) === 1 && s.includes(d))
|
|
3342
3373
|
return !0;
|
|
3343
3374
|
if (!(s != null && s.includes(z)) && !["ctrl", "control", "unknown", "meta", "alt", "shift", "os"].includes(z))
|
|
@@ -3345,19 +3376,19 @@ const mr = (t, i, a = !1) => {
|
|
|
3345
3376
|
if (!a) {
|
|
3346
3377
|
if (r !== x && z !== "alt" || c !== k && z !== "shift")
|
|
3347
3378
|
return !1;
|
|
3348
|
-
if (
|
|
3379
|
+
if (o) {
|
|
3349
3380
|
if (!f && !b)
|
|
3350
3381
|
return !1;
|
|
3351
|
-
} else if (
|
|
3382
|
+
} else if (i !== f && z !== "meta" && z !== "os" || m !== b && z !== "ctrl" && z !== "control")
|
|
3352
3383
|
return !1;
|
|
3353
3384
|
}
|
|
3354
|
-
return s && s.length === 1 && s.includes(z) ? !0 : s ?
|
|
3355
|
-
},
|
|
3356
|
-
function
|
|
3357
|
-
return t &&
|
|
3358
|
-
Object.keys(t).reduce((a, r) => a &&
|
|
3385
|
+
return s && s.length === 1 && s.includes(z) ? !0 : s ? nr(s) : !s;
|
|
3386
|
+
}, ur = Re(void 0), gr = () => Be(ur);
|
|
3387
|
+
function Je(t, n) {
|
|
3388
|
+
return t && n && typeof t == "object" && typeof n == "object" ? Object.keys(t).length === Object.keys(n).length && // @ts-expect-error TS7053
|
|
3389
|
+
Object.keys(t).reduce((a, r) => a && Je(t[r], n[r]), !0) : t === n;
|
|
3359
3390
|
}
|
|
3360
|
-
const
|
|
3391
|
+
const fr = Re({
|
|
3361
3392
|
hotkeys: [],
|
|
3362
3393
|
activeScopes: [],
|
|
3363
3394
|
// This array has to be empty instead of containing '*' as default, to check if the provider is set or not
|
|
@@ -3367,33 +3398,33 @@ const gr = Be({
|
|
|
3367
3398
|
},
|
|
3368
3399
|
disableScope: () => {
|
|
3369
3400
|
}
|
|
3370
|
-
}),
|
|
3371
|
-
function
|
|
3372
|
-
const
|
|
3373
|
-
return
|
|
3401
|
+
}), hr = () => Be(fr);
|
|
3402
|
+
function br(t) {
|
|
3403
|
+
const n = X(void 0);
|
|
3404
|
+
return Je(n.current, t) || (n.current = t), n.current;
|
|
3374
3405
|
}
|
|
3375
|
-
const
|
|
3406
|
+
const Te = (t) => {
|
|
3376
3407
|
t.stopPropagation(), t.preventDefault(), t.stopImmediatePropagation();
|
|
3377
|
-
},
|
|
3378
|
-
function
|
|
3379
|
-
const
|
|
3380
|
-
s ? p.current = g : p.current =
|
|
3381
|
-
const d =
|
|
3382
|
-
return
|
|
3383
|
-
if ((d == null ? void 0 : d.enabled) === !1 || !
|
|
3408
|
+
}, xr = typeof window < "u" ? rt : G;
|
|
3409
|
+
function yr(t, n, a, r) {
|
|
3410
|
+
const i = X(null), o = X(!1), c = Array.isArray(a) ? Array.isArray(r) ? void 0 : r : a, m = Le(t) ? t.join(c == null ? void 0 : c.delimiter) : t, s = Array.isArray(a) ? a : Array.isArray(r) ? r : void 0, g = A(n, s ?? []), p = X(g);
|
|
3411
|
+
s ? p.current = g : p.current = n;
|
|
3412
|
+
const d = br(c), { activeScopes: b } = hr(), f = gr();
|
|
3413
|
+
return xr(() => {
|
|
3414
|
+
if ((d == null ? void 0 : d.enabled) === !1 || !mr(b, d == null ? void 0 : d.scopes))
|
|
3384
3415
|
return;
|
|
3385
3416
|
let k = [], x;
|
|
3386
3417
|
const z = (y, P = !1) => {
|
|
3387
3418
|
var B;
|
|
3388
|
-
if (!(
|
|
3389
|
-
if (
|
|
3390
|
-
const T =
|
|
3391
|
-
if ((T instanceof Document || T instanceof ShadowRoot) && T.activeElement !==
|
|
3392
|
-
|
|
3419
|
+
if (!(lr(y) && !Ke(y, d == null ? void 0 : d.enableOnFormTags))) {
|
|
3420
|
+
if (i.current !== null) {
|
|
3421
|
+
const T = i.current.getRootNode();
|
|
3422
|
+
if ((T instanceof Document || T instanceof ShadowRoot) && T.activeElement !== i.current && !i.current.contains(T.activeElement)) {
|
|
3423
|
+
Te(y);
|
|
3393
3424
|
return;
|
|
3394
3425
|
}
|
|
3395
3426
|
}
|
|
3396
|
-
(B = y.target) != null && B.isContentEditable && !(d != null && d.enableOnContentEditable) ||
|
|
3427
|
+
(B = y.target) != null && B.isContentEditable && !(d != null && d.enableOnContentEditable) || Ne(m, d == null ? void 0 : d.delimiter).forEach((T) => {
|
|
3397
3428
|
var L, S, O, $;
|
|
3398
3429
|
if (T.includes((d == null ? void 0 : d.splitKey) ?? "+") && T.includes((d == null ? void 0 : d.sequenceSplitKey) ?? ">")) {
|
|
3399
3430
|
console.warn(
|
|
@@ -3401,7 +3432,7 @@ function xr(t, i, a, r) {
|
|
|
3401
3432
|
);
|
|
3402
3433
|
return;
|
|
3403
3434
|
}
|
|
3404
|
-
const N =
|
|
3435
|
+
const N = ze(
|
|
3405
3436
|
T,
|
|
3406
3437
|
d == null ? void 0 : d.splitKey,
|
|
3407
3438
|
d == null ? void 0 : d.sequenceSplitKey,
|
|
@@ -3412,8 +3443,8 @@ function xr(t, i, a, r) {
|
|
|
3412
3443
|
x = setTimeout(() => {
|
|
3413
3444
|
k = [];
|
|
3414
3445
|
}, (d == null ? void 0 : d.sequenceTimeoutMs) ?? 1e3);
|
|
3415
|
-
const K = N.useKey ? y.key :
|
|
3416
|
-
if (
|
|
3446
|
+
const K = N.useKey ? y.key : ie(y.code);
|
|
3447
|
+
if (Fe(K.toLowerCase()))
|
|
3417
3448
|
return;
|
|
3418
3449
|
k.push(K);
|
|
3419
3450
|
const F = (L = N.keys) == null ? void 0 : L[k.length - 1];
|
|
@@ -3422,25 +3453,25 @@ function xr(t, i, a, r) {
|
|
|
3422
3453
|
return;
|
|
3423
3454
|
}
|
|
3424
3455
|
k.length === ((S = N.keys) == null ? void 0 : S.length) && (p.current(y, N), x && clearTimeout(x), k = []);
|
|
3425
|
-
} else if (
|
|
3426
|
-
if (($ = d == null ? void 0 : d.ignoreEventWhen) != null && $.call(d, y) || P &&
|
|
3456
|
+
} else if (pr(y, N, d == null ? void 0 : d.ignoreModifiers) || (O = N.keys) != null && O.includes("*")) {
|
|
3457
|
+
if (($ = d == null ? void 0 : d.ignoreEventWhen) != null && $.call(d, y) || P && o.current)
|
|
3427
3458
|
return;
|
|
3428
|
-
if (
|
|
3429
|
-
|
|
3459
|
+
if (ir(y, N, d == null ? void 0 : d.preventDefault), !sr(y, N, d == null ? void 0 : d.enabled)) {
|
|
3460
|
+
Te(y);
|
|
3430
3461
|
return;
|
|
3431
3462
|
}
|
|
3432
|
-
p.current(y, N), P || (
|
|
3463
|
+
p.current(y, N), P || (o.current = !0);
|
|
3433
3464
|
}
|
|
3434
3465
|
});
|
|
3435
3466
|
}
|
|
3436
3467
|
}, C = (y) => {
|
|
3437
|
-
y.code !== void 0 && (
|
|
3468
|
+
y.code !== void 0 && (Ve(ie(y.code)), ((d == null ? void 0 : d.keydown) === void 0 && (d == null ? void 0 : d.keyup) !== !0 || d != null && d.keydown) && z(y));
|
|
3438
3469
|
}, u = (y) => {
|
|
3439
|
-
y.code !== void 0 && (
|
|
3440
|
-
}, h =
|
|
3441
|
-
return h.addEventListener("keyup", u, c == null ? void 0 : c.eventListenerOptions), h.addEventListener("keydown", C, c == null ? void 0 : c.eventListenerOptions), f &&
|
|
3470
|
+
y.code !== void 0 && (He(ie(y.code)), o.current = !1, d != null && d.keyup && z(y, !0));
|
|
3471
|
+
}, h = i.current || (c == null ? void 0 : c.document) || document;
|
|
3472
|
+
return h.addEventListener("keyup", u, c == null ? void 0 : c.eventListenerOptions), h.addEventListener("keydown", C, c == null ? void 0 : c.eventListenerOptions), f && Ne(m, d == null ? void 0 : d.delimiter).forEach(
|
|
3442
3473
|
(y) => f.addHotkey(
|
|
3443
|
-
|
|
3474
|
+
ze(
|
|
3444
3475
|
y,
|
|
3445
3476
|
d == null ? void 0 : d.splitKey,
|
|
3446
3477
|
d == null ? void 0 : d.sequenceSplitKey,
|
|
@@ -3449,9 +3480,9 @@ function xr(t, i, a, r) {
|
|
|
3449
3480
|
)
|
|
3450
3481
|
)
|
|
3451
3482
|
), () => {
|
|
3452
|
-
h.removeEventListener("keyup", u, c == null ? void 0 : c.eventListenerOptions), h.removeEventListener("keydown", C, c == null ? void 0 : c.eventListenerOptions), f &&
|
|
3483
|
+
h.removeEventListener("keyup", u, c == null ? void 0 : c.eventListenerOptions), h.removeEventListener("keydown", C, c == null ? void 0 : c.eventListenerOptions), f && Ne(m, d == null ? void 0 : d.delimiter).forEach(
|
|
3453
3484
|
(y) => f.removeHotkey(
|
|
3454
|
-
|
|
3485
|
+
ze(
|
|
3455
3486
|
y,
|
|
3456
3487
|
d == null ? void 0 : d.splitKey,
|
|
3457
3488
|
d == null ? void 0 : d.sequenceSplitKey,
|
|
@@ -3461,49 +3492,49 @@ function xr(t, i, a, r) {
|
|
|
3461
3492
|
)
|
|
3462
3493
|
), k = [], x && clearTimeout(x);
|
|
3463
3494
|
};
|
|
3464
|
-
}, [m, d, b]),
|
|
3495
|
+
}, [m, d, b]), i;
|
|
3465
3496
|
}
|
|
3466
|
-
const
|
|
3497
|
+
const wr = {
|
|
3467
3498
|
enableOnFormTags: !1,
|
|
3468
3499
|
preventDefault: !0
|
|
3469
3500
|
};
|
|
3470
|
-
function
|
|
3501
|
+
function Qe(t) {
|
|
3471
3502
|
var r;
|
|
3472
|
-
const
|
|
3473
|
-
return a ? ((r =
|
|
3503
|
+
const n = E((i) => i.keyboard), a = me.find((i) => i.action === t);
|
|
3504
|
+
return a ? ((r = n == null ? void 0 : n.shortcuts) == null ? void 0 : r[t]) !== void 0 ? n.shortcuts[t] ?? null : a.defaultBinding : null;
|
|
3474
3505
|
}
|
|
3475
|
-
function q(t,
|
|
3476
|
-
const r =
|
|
3506
|
+
function q(t, n, a = {}) {
|
|
3507
|
+
const r = Qe(t), i = E((o) => {
|
|
3477
3508
|
var c;
|
|
3478
|
-
return ((c =
|
|
3509
|
+
return ((c = o.keyboard) == null ? void 0 : c.enabled) ?? !0;
|
|
3479
3510
|
});
|
|
3480
|
-
|
|
3511
|
+
yr(
|
|
3481
3512
|
r || "",
|
|
3482
|
-
|
|
3513
|
+
n,
|
|
3483
3514
|
{
|
|
3484
|
-
...
|
|
3515
|
+
...wr,
|
|
3485
3516
|
...a,
|
|
3486
|
-
enabled:
|
|
3517
|
+
enabled: i && !!r
|
|
3487
3518
|
},
|
|
3488
|
-
[
|
|
3519
|
+
[n, r, i]
|
|
3489
3520
|
);
|
|
3490
3521
|
}
|
|
3491
|
-
function
|
|
3492
|
-
const { onToggleAIChat:
|
|
3522
|
+
function kr(t = {}) {
|
|
3523
|
+
const { onToggleAIChat: n } = t, a = De(), r = w((W) => W.nodes), i = w((W) => W.selectedNodeId), o = w((W) => W.execution), c = w((W) => W.hasUnsavedChanges), m = w((W) => W.saveWorkflow), s = w((W) => W.execute), g = w((W) => W.cancelExecution), p = w((W) => W.duplicateNode), d = w((W) => W.setSelectedNode), b = w((W) => W.toggleLibrary), f = w((W) => W.newWorkflow), k = E((W) => W.openSettings), x = E((W) => W.openShortcutsModal), z = E((W) => W.openCommandPalette), C = E((W) => W.closeCommandPalette), u = E((W) => W.closeShortcutsModal), h = E((W) => W.closeSettings), y = E((W) => W.showCommandPalette), P = E((W) => W.openExport), B = E((W) => W.openImport), T = E((W) => W.requestNewWorkflow), N = A(() => {
|
|
3493
3524
|
r.length !== 0 && m();
|
|
3494
3525
|
}, [r.length, m]), L = A(() => {
|
|
3495
|
-
r.length === 0 ||
|
|
3496
|
-
}, [r.length,
|
|
3526
|
+
r.length === 0 || o.status === "running" || s();
|
|
3527
|
+
}, [r.length, o.status, s]), S = A(() => {
|
|
3497
3528
|
T(c, f);
|
|
3498
3529
|
}, [T, c, f]), O = A(() => {
|
|
3499
3530
|
r.length !== 0 && (P == null || P());
|
|
3500
3531
|
}, [r.length, P]), $ = A(() => {
|
|
3501
3532
|
B == null || B();
|
|
3502
3533
|
}, [B]), K = A(() => {
|
|
3503
|
-
|
|
3504
|
-
}, [
|
|
3505
|
-
|
|
3506
|
-
}, [
|
|
3534
|
+
o.status === "running" && g();
|
|
3535
|
+
}, [o.status, g]), F = A(() => {
|
|
3536
|
+
i && p(i);
|
|
3537
|
+
}, [i, p]), ne = A(() => {
|
|
3507
3538
|
a == null || a.setNodes(
|
|
3508
3539
|
(W) => W.map((I) => ({
|
|
3509
3540
|
...I,
|
|
@@ -3528,20 +3559,20 @@ function wr(t = {}) {
|
|
|
3528
3559
|
}, [y, z, C]), J = A(() => {
|
|
3529
3560
|
x == null || x();
|
|
3530
3561
|
}, [x]), Z = A(() => {
|
|
3531
|
-
|
|
3532
|
-
}, [
|
|
3562
|
+
n == null || n();
|
|
3563
|
+
}, [n]), Q = A(() => {
|
|
3533
3564
|
b();
|
|
3534
|
-
}, [b]),
|
|
3565
|
+
}, [b]), le = A(() => {
|
|
3535
3566
|
k();
|
|
3536
3567
|
}, [k]);
|
|
3537
|
-
return q("save", N), q("execute", L), q("newWorkflow", S), q("exportWorkflow", O), q("importWorkflow", $), q("cancelExecution", K), q("duplicate", F), q("selectAll",
|
|
3568
|
+
return q("save", N), q("execute", L), q("newWorkflow", S), q("exportWorkflow", O), q("importWorkflow", $), q("cancelExecution", K), q("duplicate", F), q("selectAll", ne), q("deselect", M), q("zoomIn", V), q("zoomOut", v), q("zoomFit", R), q("commandPalette", U), q("showShortcuts", J), q("toggleAIChat", Z), q("toggleLibrary", Q), q("settings", le), {
|
|
3538
3569
|
handleSave: N,
|
|
3539
3570
|
handleExecute: L,
|
|
3540
3571
|
handleNewWorkflow: S,
|
|
3541
3572
|
handleExport: O,
|
|
3542
3573
|
handleImport: $,
|
|
3543
3574
|
handleDuplicate: F,
|
|
3544
|
-
handleSelectAll:
|
|
3575
|
+
handleSelectAll: ne,
|
|
3545
3576
|
handleDeselect: M,
|
|
3546
3577
|
handleZoomIn: V,
|
|
3547
3578
|
handleZoomOut: v,
|
|
@@ -3550,25 +3581,25 @@ function wr(t = {}) {
|
|
|
3550
3581
|
handleShowShortcuts: J,
|
|
3551
3582
|
handleToggleAIChat: Z,
|
|
3552
3583
|
handleToggleLibrary: Q,
|
|
3553
|
-
handleSettings:
|
|
3584
|
+
handleSettings: le
|
|
3554
3585
|
};
|
|
3555
3586
|
}
|
|
3556
|
-
function
|
|
3557
|
-
return
|
|
3587
|
+
function vr(t) {
|
|
3588
|
+
return Qe(t);
|
|
3558
3589
|
}
|
|
3559
|
-
function
|
|
3590
|
+
function ke() {
|
|
3560
3591
|
return typeof navigator > "u" ? !1 : navigator.platform.toLowerCase().includes("mac");
|
|
3561
3592
|
}
|
|
3562
|
-
function Qe() {
|
|
3563
|
-
return we() ? "⌘" : "Ctrl";
|
|
3564
|
-
}
|
|
3565
3593
|
function Ye() {
|
|
3566
|
-
return
|
|
3594
|
+
return ke() ? "⌘" : "Ctrl";
|
|
3567
3595
|
}
|
|
3568
3596
|
function Ze() {
|
|
3597
|
+
return ke() ? "⌥" : "Alt";
|
|
3598
|
+
}
|
|
3599
|
+
function Xe() {
|
|
3569
3600
|
return "⇧";
|
|
3570
3601
|
}
|
|
3571
|
-
const
|
|
3602
|
+
const we = {
|
|
3572
3603
|
enter: "⏎",
|
|
3573
3604
|
return: "⏎",
|
|
3574
3605
|
escape: "Esc",
|
|
@@ -3587,65 +3618,65 @@ const ye = {
|
|
|
3587
3618
|
plus: "+",
|
|
3588
3619
|
period: "."
|
|
3589
3620
|
};
|
|
3590
|
-
function
|
|
3621
|
+
function Nr(t) {
|
|
3591
3622
|
if (!t) return "";
|
|
3592
|
-
const
|
|
3593
|
-
for (const r of
|
|
3594
|
-
r === "mod" ? a.push(
|
|
3623
|
+
const n = t.toLowerCase().split("+"), a = [];
|
|
3624
|
+
for (const r of n)
|
|
3625
|
+
r === "mod" ? a.push(Ye()) : r === "ctrl" || r === "control" ? a.push(ke() ? "⌃" : "Ctrl") : r === "alt" || r === "option" ? a.push(Ze()) : r === "shift" ? a.push(Xe()) : r === "meta" || r === "cmd" || r === "command" ? a.push("⌘") : we[r] ? a.push(we[r]) : a.push(r.toUpperCase());
|
|
3595
3626
|
return a.join("");
|
|
3596
3627
|
}
|
|
3597
|
-
function
|
|
3628
|
+
function zr(t) {
|
|
3598
3629
|
if (!t) return [];
|
|
3599
|
-
const
|
|
3600
|
-
for (const r of
|
|
3601
|
-
r === "mod" ? a.push(
|
|
3630
|
+
const n = t.toLowerCase().split("+"), a = [];
|
|
3631
|
+
for (const r of n)
|
|
3632
|
+
r === "mod" ? a.push(Ye()) : r === "ctrl" || r === "control" ? a.push(ke() ? "⌃" : "Ctrl") : r === "alt" || r === "option" ? a.push(Ze()) : r === "shift" ? a.push(Xe()) : r === "meta" || r === "cmd" || r === "command" ? a.push("⌘") : we[r] ? a.push(we[r]) : a.push(r.toUpperCase());
|
|
3602
3633
|
return a;
|
|
3603
3634
|
}
|
|
3604
|
-
function
|
|
3605
|
-
const a = new Map(t.map((m) => [m.id, m])), r = /* @__PURE__ */ new Map(),
|
|
3635
|
+
function Cr(t, n) {
|
|
3636
|
+
const a = new Map(t.map((m) => [m.id, m])), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
|
|
3606
3637
|
for (const m of t)
|
|
3607
|
-
r.set(m.id, 0),
|
|
3608
|
-
for (const m of
|
|
3609
|
-
const s =
|
|
3610
|
-
s.push(m.target),
|
|
3638
|
+
r.set(m.id, 0), i.set(m.id, []);
|
|
3639
|
+
for (const m of n) {
|
|
3640
|
+
const s = i.get(m.source) || [];
|
|
3641
|
+
s.push(m.target), i.set(m.source, s), r.set(m.target, (r.get(m.target) || 0) + 1);
|
|
3611
3642
|
}
|
|
3612
|
-
const
|
|
3643
|
+
const o = [];
|
|
3613
3644
|
for (const [m, s] of r)
|
|
3614
|
-
s === 0 &&
|
|
3645
|
+
s === 0 && o.push(m);
|
|
3615
3646
|
const c = [];
|
|
3616
|
-
for (;
|
|
3617
|
-
const m =
|
|
3647
|
+
for (; o.length > 0; ) {
|
|
3648
|
+
const m = o.shift(), s = a.get(m);
|
|
3618
3649
|
s && c.push(s);
|
|
3619
|
-
const g =
|
|
3650
|
+
const g = i.get(m) || [];
|
|
3620
3651
|
for (const p of g) {
|
|
3621
3652
|
const d = (r.get(p) || 1) - 1;
|
|
3622
|
-
r.set(p, d), d === 0 &&
|
|
3653
|
+
r.set(p, d), d === 0 && o.push(p);
|
|
3623
3654
|
}
|
|
3624
3655
|
}
|
|
3625
3656
|
return c;
|
|
3626
3657
|
}
|
|
3627
|
-
function
|
|
3628
|
-
const
|
|
3629
|
-
return `${
|
|
3658
|
+
function Sr(t) {
|
|
3659
|
+
const n = t.type || "node", a = t.id.replace(/[^a-zA-Z0-9]/g, "_");
|
|
3660
|
+
return `${n}_${a}`;
|
|
3630
3661
|
}
|
|
3631
|
-
function
|
|
3662
|
+
function fe(t) {
|
|
3632
3663
|
return typeof t == "string" ? t.includes(`
|
|
3633
3664
|
`) ? "`" + t.replace(/`/g, "\\`").replace(/\$/g, "\\$") + "`" : JSON.stringify(t) : JSON.stringify(t, null, 2);
|
|
3634
3665
|
}
|
|
3635
|
-
function
|
|
3636
|
-
const r = a.get(t.id),
|
|
3666
|
+
function Ir(t, n, a) {
|
|
3667
|
+
const r = a.get(t.id), i = [], o = n.find((m) => m.target === t.id), c = o ? a.get(o.source) : null;
|
|
3637
3668
|
switch (t.type) {
|
|
3638
3669
|
case "generator": {
|
|
3639
3670
|
const m = t.data;
|
|
3640
|
-
|
|
3641
|
-
const s = m.params || {}, g = Object.entries(s).filter(([, p]) => p !== void 0 && p !== "").map(([p, d]) => ` ${p}: ${
|
|
3671
|
+
i.push(m.generatorName);
|
|
3672
|
+
const s = m.params || {}, g = Object.entries(s).filter(([, p]) => p !== void 0 && p !== "").map(([p, d]) => ` ${p}: ${fe(d)}`).join(`,
|
|
3642
3673
|
`);
|
|
3643
3674
|
return {
|
|
3644
3675
|
code: `// Generate image using ${m.generatorName}
|
|
3645
3676
|
const ${r} = await ${m.generatorName}({
|
|
3646
3677
|
${g}
|
|
3647
3678
|
});`,
|
|
3648
|
-
imports:
|
|
3679
|
+
imports: i
|
|
3649
3680
|
};
|
|
3650
3681
|
}
|
|
3651
3682
|
case "input":
|
|
@@ -3655,7 +3686,7 @@ const ${r} = await flo.loadImage("./input.png");`,
|
|
|
3655
3686
|
imports: []
|
|
3656
3687
|
};
|
|
3657
3688
|
case "transform": {
|
|
3658
|
-
const m = t.data, s = m.params || {}, g = Object.entries(s).filter(([, d]) => d !== void 0 && d !== "").map(([d, b]) => `${d}: ${
|
|
3689
|
+
const m = t.data, s = m.params || {}, g = Object.entries(s).filter(([, d]) => d !== void 0 && d !== "").map(([d, b]) => `${d}: ${fe(b)}`).join(", "), p = c || "image";
|
|
3659
3690
|
return {
|
|
3660
3691
|
code: `// Apply ${m.operation} transform
|
|
3661
3692
|
const ${r} = await flo.transform(${p}, "${m.operation}"${g ? `, { ${g} }` : ""});`,
|
|
@@ -3664,35 +3695,35 @@ const ${r} = await flo.transform(${p}, "${m.operation}"${g ? `, { ${g} }` : ""})
|
|
|
3664
3695
|
}
|
|
3665
3696
|
case "vision": {
|
|
3666
3697
|
const m = t.data;
|
|
3667
|
-
|
|
3668
|
-
const s = m.params || {}, g = c || "image", p = Object.entries(s).filter(([, d]) => d !== void 0 && d !== "").map(([d, b]) => ` ${d}: ${
|
|
3698
|
+
i.push(m.providerName);
|
|
3699
|
+
const s = m.params || {}, g = c || "image", p = Object.entries(s).filter(([, d]) => d !== void 0 && d !== "").map(([d, b]) => ` ${d}: ${fe(b)}`).join(`,
|
|
3669
3700
|
`);
|
|
3670
3701
|
return {
|
|
3671
3702
|
code: `// Analyze image with ${m.providerName}
|
|
3672
3703
|
const ${r} = await ${m.providerName}.analyze(${g}, {
|
|
3673
3704
|
${p}
|
|
3674
3705
|
});`,
|
|
3675
|
-
imports:
|
|
3706
|
+
imports: i
|
|
3676
3707
|
};
|
|
3677
3708
|
}
|
|
3678
3709
|
case "text": {
|
|
3679
3710
|
const m = t.data;
|
|
3680
|
-
|
|
3681
|
-
const s = m.params || {}, g = Object.entries(s).filter(([, p]) => p !== void 0 && p !== "").map(([p, d]) => ` ${p}: ${
|
|
3711
|
+
i.push(m.providerName);
|
|
3712
|
+
const s = m.params || {}, g = Object.entries(s).filter(([, p]) => p !== void 0 && p !== "").map(([p, d]) => ` ${p}: ${fe(d)}`).join(`,
|
|
3682
3713
|
`);
|
|
3683
3714
|
return {
|
|
3684
3715
|
code: `// Generate text with ${m.providerName}
|
|
3685
3716
|
const ${r} = await ${m.providerName}.generate({
|
|
3686
3717
|
${g}
|
|
3687
3718
|
});`,
|
|
3688
|
-
imports:
|
|
3719
|
+
imports: i
|
|
3689
3720
|
};
|
|
3690
3721
|
}
|
|
3691
3722
|
case "save": {
|
|
3692
3723
|
const m = t.data;
|
|
3693
3724
|
return {
|
|
3694
3725
|
code: `// Save result
|
|
3695
|
-
await flo.save(${c || "result"}, ${
|
|
3726
|
+
await flo.save(${c || "result"}, ${fe(m.destination)});`,
|
|
3696
3727
|
imports: []
|
|
3697
3728
|
};
|
|
3698
3729
|
}
|
|
@@ -3703,22 +3734,22 @@ await flo.save(${c || "result"}, ${ge(m.destination)});`,
|
|
|
3703
3734
|
};
|
|
3704
3735
|
}
|
|
3705
3736
|
}
|
|
3706
|
-
function
|
|
3737
|
+
function Lr(t, n) {
|
|
3707
3738
|
if (t.length === 0)
|
|
3708
3739
|
return `// Empty workflow
|
|
3709
3740
|
// Add nodes to your canvas to generate code`;
|
|
3710
|
-
const a =
|
|
3741
|
+
const a = Cr(t, n), r = /* @__PURE__ */ new Map();
|
|
3711
3742
|
for (const g of a)
|
|
3712
|
-
r.set(g.id,
|
|
3713
|
-
const
|
|
3743
|
+
r.set(g.id, Sr(g));
|
|
3744
|
+
const i = /* @__PURE__ */ new Set(), o = [];
|
|
3714
3745
|
for (const g of a) {
|
|
3715
|
-
const { code: p, imports: d } =
|
|
3716
|
-
|
|
3746
|
+
const { code: p, imports: d } = Ir(g, n, r);
|
|
3747
|
+
o.push(p);
|
|
3717
3748
|
for (const b of d)
|
|
3718
|
-
|
|
3749
|
+
i.add(b);
|
|
3719
3750
|
}
|
|
3720
3751
|
const c = [];
|
|
3721
|
-
|
|
3752
|
+
i.size > 0 && c.push(`import { ${Array.from(i).join(", ")} } from "@teamflojo/floimg";`), c.push('import * as flo from "@teamflojo/floimg";');
|
|
3722
3753
|
const m = `/**
|
|
3723
3754
|
* FloImg Workflow
|
|
3724
3755
|
* Generated by FloImg Studio
|
|
@@ -3727,7 +3758,7 @@ function Ir(t, i) {
|
|
|
3727
3758
|
|
|
3728
3759
|
`, s = `
|
|
3729
3760
|
async function runWorkflow() {
|
|
3730
|
-
${
|
|
3761
|
+
${o.map(
|
|
3731
3762
|
(g) => g.split(`
|
|
3732
3763
|
`).map((p) => " " + p).join(`
|
|
3733
3764
|
`)
|
|
@@ -3743,16 +3774,16 @@ runWorkflow().catch(console.error);
|
|
|
3743
3774
|
`) + `
|
|
3744
3775
|
` + s;
|
|
3745
3776
|
}
|
|
3746
|
-
function
|
|
3747
|
-
const [r,
|
|
3777
|
+
function Ar({ isOpen: t, onClose: n, onImport: a }) {
|
|
3778
|
+
const [r, i] = _(""), [o, c] = _(!1), [m, s] = _(null), [g, p] = _(!1), d = A(async () => {
|
|
3748
3779
|
if (!r.trim()) {
|
|
3749
3780
|
s({ message: "Please enter or paste YAML content" });
|
|
3750
3781
|
return;
|
|
3751
3782
|
}
|
|
3752
3783
|
c(!0), s(null);
|
|
3753
3784
|
try {
|
|
3754
|
-
const u = await
|
|
3755
|
-
u.success ? (a(u.nodes, u.edges, u.name),
|
|
3785
|
+
const u = await Ct(r);
|
|
3786
|
+
u.success ? (a(u.nodes, u.edges, u.name), i(""), n()) : s({
|
|
3756
3787
|
message: u.error || "Import failed",
|
|
3757
3788
|
line: u.line,
|
|
3758
3789
|
column: u.column
|
|
@@ -3762,14 +3793,14 @@ function Lr({ isOpen: t, onClose: i, onImport: a }) {
|
|
|
3762
3793
|
} finally {
|
|
3763
3794
|
c(!1);
|
|
3764
3795
|
}
|
|
3765
|
-
}, [r, a,
|
|
3796
|
+
}, [r, a, n]), b = A(async () => {
|
|
3766
3797
|
if (!r.trim()) {
|
|
3767
3798
|
s({ message: "Please enter or paste YAML content" });
|
|
3768
3799
|
return;
|
|
3769
3800
|
}
|
|
3770
3801
|
c(!0), s(null);
|
|
3771
3802
|
try {
|
|
3772
|
-
const u = await
|
|
3803
|
+
const u = await St(r);
|
|
3773
3804
|
u.valid ? (s(null), s({ message: "Valid YAML!" }), setTimeout(() => s(null), 2e3)) : u.errors.length > 0 && s(u.errors[0]);
|
|
3774
3805
|
} catch (u) {
|
|
3775
3806
|
s({ message: u instanceof Error ? u.message : "Validation failed" });
|
|
@@ -3783,7 +3814,7 @@ function Lr({ isOpen: t, onClose: i, onImport: a }) {
|
|
|
3783
3814
|
}
|
|
3784
3815
|
try {
|
|
3785
3816
|
const h = await u.text();
|
|
3786
|
-
|
|
3817
|
+
i(h), s(null);
|
|
3787
3818
|
} catch {
|
|
3788
3819
|
s({ message: "Failed to read file" });
|
|
3789
3820
|
}
|
|
@@ -3812,7 +3843,7 @@ function Lr({ isOpen: t, onClose: i, onImport: a }) {
|
|
|
3812
3843
|
/* @__PURE__ */ e(
|
|
3813
3844
|
"button",
|
|
3814
3845
|
{
|
|
3815
|
-
onClick:
|
|
3846
|
+
onClick: n,
|
|
3816
3847
|
className: "text-gray-500 dark:text-zinc-400 hover:text-gray-700 dark:hover:text-zinc-200",
|
|
3817
3848
|
children: /* @__PURE__ */ e("svg", { className: "h-6 w-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e(
|
|
3818
3849
|
"path",
|
|
@@ -3886,7 +3917,7 @@ function Lr({ isOpen: t, onClose: i, onImport: a }) {
|
|
|
3886
3917
|
{
|
|
3887
3918
|
value: r,
|
|
3888
3919
|
onChange: (u) => {
|
|
3889
|
-
|
|
3920
|
+
i(u.target.value), s(null);
|
|
3890
3921
|
},
|
|
3891
3922
|
placeholder: `name: My Workflow
|
|
3892
3923
|
steps:
|
|
@@ -3933,7 +3964,7 @@ steps:
|
|
|
3933
3964
|
"button",
|
|
3934
3965
|
{
|
|
3935
3966
|
onClick: b,
|
|
3936
|
-
disabled:
|
|
3967
|
+
disabled: o || !r.trim(),
|
|
3937
3968
|
className: "px-4 py-2 text-sm font-medium text-gray-700 dark:text-zinc-200 bg-white dark:bg-zinc-700 border border-gray-300 dark:border-zinc-600 rounded-md hover:bg-gray-50 dark:hover:bg-zinc-600 disabled:opacity-50 disabled:cursor-not-allowed",
|
|
3938
3969
|
children: "Validate"
|
|
3939
3970
|
}
|
|
@@ -3942,10 +3973,10 @@ steps:
|
|
|
3942
3973
|
"button",
|
|
3943
3974
|
{
|
|
3944
3975
|
onClick: d,
|
|
3945
|
-
disabled:
|
|
3976
|
+
disabled: o || !r.trim(),
|
|
3946
3977
|
className: "px-4 py-2 text-sm font-medium text-white bg-teal-600 rounded-md hover:bg-teal-700 disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2",
|
|
3947
3978
|
children: [
|
|
3948
|
-
|
|
3979
|
+
o && /* @__PURE__ */ l("svg", { className: "animate-spin h-4 w-4", viewBox: "0 0 24 24", fill: "none", children: [
|
|
3949
3980
|
/* @__PURE__ */ e(
|
|
3950
3981
|
"circle",
|
|
3951
3982
|
{
|
|
@@ -3974,14 +4005,14 @@ steps:
|
|
|
3974
4005
|
] })
|
|
3975
4006
|
] }) }) : null;
|
|
3976
4007
|
}
|
|
3977
|
-
function
|
|
4008
|
+
function Wr({
|
|
3978
4009
|
brandingSlot: t,
|
|
3979
|
-
beforeActionsSlot:
|
|
4010
|
+
beforeActionsSlot: n,
|
|
3980
4011
|
afterActionsSlot: a,
|
|
3981
4012
|
hideAttribution: r = !1,
|
|
3982
|
-
hideWorkflowLibrary:
|
|
4013
|
+
hideWorkflowLibrary: i = !1
|
|
3983
4014
|
} = {}) {
|
|
3984
|
-
const
|
|
4015
|
+
const o = w((I) => I.execution), c = w((I) => I.execute), m = w((I) => I.cancelExecution), s = w((I) => I.exportToYaml), g = w((I) => I.importFromYaml), p = w((I) => I.nodes), d = w((I) => I.edges), b = E((I) => I.openSettings), f = w((I) => I.activeWorkflowName), k = w((I) => I.hasUnsavedChanges), x = w((I) => I.saveWorkflow), z = w((I) => I.toggleLibrary), C = w((I) => I.setActiveWorkflowName), u = vr("save"), [h, y] = _(!1), [P, B] = _(!1), [T, N] = _("yaml"), [L, S] = _(""), [O, $] = _(""), [K, F] = _(null), [ne, M] = _(!1), [V, v] = _("");
|
|
3985
4016
|
G(() => {
|
|
3986
4017
|
const I = () => {
|
|
3987
4018
|
F("New workflow created"), setTimeout(() => F(null), 2e3);
|
|
@@ -4000,21 +4031,21 @@ function Ar({
|
|
|
4000
4031
|
}, Q = async () => {
|
|
4001
4032
|
const I = await s();
|
|
4002
4033
|
S(I);
|
|
4003
|
-
const
|
|
4004
|
-
$(
|
|
4005
|
-
},
|
|
4034
|
+
const pe = Lr(p, d);
|
|
4035
|
+
$(pe), y(!0);
|
|
4036
|
+
}, le = () => {
|
|
4006
4037
|
const I = T === "yaml" ? L : O;
|
|
4007
4038
|
navigator.clipboard.writeText(I);
|
|
4008
4039
|
}, W = A(
|
|
4009
|
-
(I,
|
|
4010
|
-
g(I,
|
|
4040
|
+
(I, pe, tt) => {
|
|
4041
|
+
g(I, pe, tt), F("Workflow imported!"), setTimeout(() => F(null), 2e3);
|
|
4011
4042
|
},
|
|
4012
4043
|
[g]
|
|
4013
4044
|
);
|
|
4014
|
-
return /* @__PURE__ */ l(
|
|
4045
|
+
return /* @__PURE__ */ l(se, { children: [
|
|
4015
4046
|
/* @__PURE__ */ l("div", { className: "floimg-toolbar h-14 flex items-center justify-between px-4", children: [
|
|
4016
4047
|
/* @__PURE__ */ l("div", { className: "flex items-center gap-4", children: [
|
|
4017
|
-
!
|
|
4048
|
+
!i && /* @__PURE__ */ e("button", { onClick: z, className: "floimg-toolbar__btn", title: "My Workflows", children: /* @__PURE__ */ e("svg", { className: "h-5 w-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e(
|
|
4018
4049
|
"path",
|
|
4019
4050
|
{
|
|
4020
4051
|
strokeLinecap: "round",
|
|
@@ -4038,7 +4069,7 @@ function Ar({
|
|
|
4038
4069
|
)
|
|
4039
4070
|
] }),
|
|
4040
4071
|
/* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
|
|
4041
|
-
|
|
4072
|
+
ne ? /* @__PURE__ */ e(
|
|
4042
4073
|
"input",
|
|
4043
4074
|
{
|
|
4044
4075
|
type: "text",
|
|
@@ -4070,7 +4101,7 @@ function Ar({
|
|
|
4070
4101
|
] })
|
|
4071
4102
|
] }),
|
|
4072
4103
|
/* @__PURE__ */ l("div", { className: "flex items-center gap-3", children: [
|
|
4073
|
-
|
|
4104
|
+
n,
|
|
4074
4105
|
/* @__PURE__ */ e("button", { onClick: b, className: "floimg-toolbar__btn", title: "AI Settings", children: /* @__PURE__ */ l("svg", { className: "h-5 w-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: [
|
|
4075
4106
|
/* @__PURE__ */ e(
|
|
4076
4107
|
"path",
|
|
@@ -4097,7 +4128,7 @@ function Ar({
|
|
|
4097
4128
|
onClick: R,
|
|
4098
4129
|
disabled: p.length === 0,
|
|
4099
4130
|
className: "floimg-toolbar__btn disabled:opacity-50 disabled:cursor-not-allowed",
|
|
4100
|
-
title: `Save Workflow${u ? ` (${
|
|
4131
|
+
title: `Save Workflow${u ? ` (${Nr(u)})` : ""}`,
|
|
4101
4132
|
children: /* @__PURE__ */ e("svg", { className: "h-5 w-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e(
|
|
4102
4133
|
"path",
|
|
4103
4134
|
{
|
|
@@ -4119,7 +4150,7 @@ function Ar({
|
|
|
4119
4150
|
children: "Export"
|
|
4120
4151
|
}
|
|
4121
4152
|
),
|
|
4122
|
-
|
|
4153
|
+
o.status === "running" ? /* @__PURE__ */ l(
|
|
4123
4154
|
"button",
|
|
4124
4155
|
{
|
|
4125
4156
|
onClick: m,
|
|
@@ -4171,25 +4202,25 @@ function Ar({
|
|
|
4171
4202
|
a
|
|
4172
4203
|
] })
|
|
4173
4204
|
] }),
|
|
4174
|
-
|
|
4205
|
+
o.status === "completed" && o.imageIds.length > 0 && /* @__PURE__ */ e("div", { className: "bg-green-50 dark:bg-green-900/30 border-b border-green-200 dark:border-green-800 px-4 py-3", children: /* @__PURE__ */ l("div", { className: "flex items-center gap-4", children: [
|
|
4175
4206
|
/* @__PURE__ */ l("span", { className: "text-green-700 dark:text-green-400 font-medium", children: [
|
|
4176
4207
|
"Generated ",
|
|
4177
|
-
|
|
4208
|
+
o.imageIds.length,
|
|
4178
4209
|
" image",
|
|
4179
|
-
|
|
4210
|
+
o.imageIds.length !== 1 ? "s" : ""
|
|
4180
4211
|
] }),
|
|
4181
|
-
/* @__PURE__ */ e("div", { className: "flex gap-2", children:
|
|
4212
|
+
/* @__PURE__ */ e("div", { className: "flex gap-2", children: o.imageUrls.slice(0, 4).map((I, pe) => /* @__PURE__ */ e("a", { href: I, target: "_blank", rel: "noopener noreferrer", className: "block", children: /* @__PURE__ */ e(
|
|
4182
4213
|
"img",
|
|
4183
4214
|
{
|
|
4184
4215
|
src: I,
|
|
4185
4216
|
alt: "Generated",
|
|
4186
4217
|
className: "h-12 w-12 object-cover rounded border border-green-300 dark:border-green-700"
|
|
4187
4218
|
}
|
|
4188
|
-
) },
|
|
4219
|
+
) }, pe)) })
|
|
4189
4220
|
] }) }),
|
|
4190
|
-
|
|
4221
|
+
o.status === "error" && /* @__PURE__ */ e("div", { className: "bg-red-50 dark:bg-red-900/30 border-b border-red-200 dark:border-red-800 px-4 py-3", children: /* @__PURE__ */ l("span", { className: "text-red-700 dark:text-red-400", children: [
|
|
4191
4222
|
"Error: ",
|
|
4192
|
-
|
|
4223
|
+
o.error
|
|
4193
4224
|
] }) }),
|
|
4194
4225
|
h && /* @__PURE__ */ e("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50", children: /* @__PURE__ */ l("div", { className: "bg-white dark:bg-zinc-800 rounded-lg shadow-xl max-w-2xl w-full mx-4 max-h-[80vh] flex flex-col", children: [
|
|
4195
4226
|
/* @__PURE__ */ l("div", { className: "flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-zinc-700", children: [
|
|
@@ -4238,7 +4269,7 @@ function Ar({
|
|
|
4238
4269
|
/* @__PURE__ */ e(
|
|
4239
4270
|
"button",
|
|
4240
4271
|
{
|
|
4241
|
-
onClick:
|
|
4272
|
+
onClick: le,
|
|
4242
4273
|
className: "px-4 py-2 text-sm font-medium text-gray-700 dark:text-zinc-200 bg-white dark:bg-zinc-700 border border-gray-300 dark:border-zinc-600 rounded-md hover:bg-gray-50 dark:hover:bg-zinc-600",
|
|
4243
4274
|
children: "Copy to Clipboard"
|
|
4244
4275
|
}
|
|
@@ -4255,7 +4286,7 @@ function Ar({
|
|
|
4255
4286
|
] })
|
|
4256
4287
|
] }) }),
|
|
4257
4288
|
/* @__PURE__ */ e(
|
|
4258
|
-
|
|
4289
|
+
Ar,
|
|
4259
4290
|
{
|
|
4260
4291
|
isOpen: P,
|
|
4261
4292
|
onClose: () => B(!1),
|
|
@@ -4264,21 +4295,21 @@ function Ar({
|
|
|
4264
4295
|
)
|
|
4265
4296
|
] });
|
|
4266
4297
|
}
|
|
4267
|
-
function
|
|
4268
|
-
const t = w((s) => s.loadTemplate), [
|
|
4298
|
+
function _r() {
|
|
4299
|
+
const t = w((s) => s.loadTemplate), [n, a] = _(null), {
|
|
4269
4300
|
data: r,
|
|
4270
|
-
isLoading:
|
|
4271
|
-
error:
|
|
4301
|
+
isLoading: i,
|
|
4302
|
+
error: o,
|
|
4272
4303
|
refetch: c
|
|
4273
|
-
} =
|
|
4304
|
+
} = he({
|
|
4274
4305
|
queryKey: ["images"],
|
|
4275
|
-
queryFn:
|
|
4306
|
+
queryFn: wt,
|
|
4276
4307
|
refetchInterval: 5e3
|
|
4277
4308
|
// Auto-refresh every 5 seconds
|
|
4278
4309
|
}), m = async (s) => {
|
|
4279
4310
|
a(s);
|
|
4280
4311
|
try {
|
|
4281
|
-
const g = await
|
|
4312
|
+
const g = await kt(s);
|
|
4282
4313
|
if (g != null && g.workflow) {
|
|
4283
4314
|
const p = {
|
|
4284
4315
|
id: `image-${s}`,
|
|
@@ -4300,9 +4331,9 @@ function Wr() {
|
|
|
4300
4331
|
a(null);
|
|
4301
4332
|
}
|
|
4302
4333
|
};
|
|
4303
|
-
return
|
|
4334
|
+
return i ? /* @__PURE__ */ e("div", { className: "p-8 text-center text-gray-500 dark:text-zinc-400", children: "Loading images..." }) : o ? /* @__PURE__ */ l("div", { className: "p-8 text-center text-red-500 dark:text-red-400", children: [
|
|
4304
4335
|
"Error loading images: ",
|
|
4305
|
-
|
|
4336
|
+
o instanceof Error ? o.message : "Unknown error"
|
|
4306
4337
|
] }) : !r || r.length === 0 ? /* @__PURE__ */ l("div", { className: "p-8 text-center text-gray-500 dark:text-zinc-400", children: [
|
|
4307
4338
|
/* @__PURE__ */ e("div", { className: "text-lg mb-2", children: "No images yet" }),
|
|
4308
4339
|
/* @__PURE__ */ e("div", { className: "text-sm", children: "Create a workflow and click Execute to generate images" })
|
|
@@ -4326,31 +4357,31 @@ function Wr() {
|
|
|
4326
4357
|
)
|
|
4327
4358
|
] }),
|
|
4328
4359
|
/* @__PURE__ */ e("div", { className: "grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4", children: r.map((s) => /* @__PURE__ */ e(
|
|
4329
|
-
|
|
4360
|
+
Mr,
|
|
4330
4361
|
{
|
|
4331
4362
|
image: s,
|
|
4332
4363
|
onLoadWorkflow: () => m(s.id),
|
|
4333
|
-
isLoading:
|
|
4364
|
+
isLoading: n === s.id
|
|
4334
4365
|
},
|
|
4335
4366
|
s.id
|
|
4336
4367
|
)) })
|
|
4337
4368
|
] });
|
|
4338
4369
|
}
|
|
4339
|
-
function
|
|
4340
|
-
const r = (
|
|
4370
|
+
function Mr({ image: t, onLoadWorkflow: n, isLoading: a }) {
|
|
4371
|
+
const r = (o) => new Date(o).toLocaleString(), i = (o) => o < 1024 ? `${o} B` : o < 1048576 ? `${(o / 1024).toFixed(1)} KB` : `${(o / 1048576).toFixed(1)} MB`;
|
|
4341
4372
|
return /* @__PURE__ */ l("div", { className: "bg-white dark:bg-zinc-800 rounded-lg border border-gray-200 dark:border-zinc-700 overflow-hidden shadow-sm hover:shadow-md transition-shadow group", children: [
|
|
4342
4373
|
/* @__PURE__ */ l("div", { className: "relative", children: [
|
|
4343
4374
|
/* @__PURE__ */ e(
|
|
4344
4375
|
"a",
|
|
4345
4376
|
{
|
|
4346
|
-
href:
|
|
4377
|
+
href: ve(t.id),
|
|
4347
4378
|
target: "_blank",
|
|
4348
4379
|
rel: "noopener noreferrer",
|
|
4349
4380
|
className: "block aspect-square bg-gray-100 dark:bg-zinc-900",
|
|
4350
4381
|
children: /* @__PURE__ */ e(
|
|
4351
4382
|
"img",
|
|
4352
4383
|
{
|
|
4353
|
-
src:
|
|
4384
|
+
src: ve(t.id),
|
|
4354
4385
|
alt: t.filename,
|
|
4355
4386
|
className: "w-full h-full object-cover",
|
|
4356
4387
|
loading: "lazy"
|
|
@@ -4362,8 +4393,8 @@ function _r({ image: t, onLoadWorkflow: i, isLoading: a }) {
|
|
|
4362
4393
|
/* @__PURE__ */ e(
|
|
4363
4394
|
"button",
|
|
4364
4395
|
{
|
|
4365
|
-
onClick: (
|
|
4366
|
-
|
|
4396
|
+
onClick: (o) => {
|
|
4397
|
+
o.preventDefault(), n();
|
|
4367
4398
|
},
|
|
4368
4399
|
disabled: a,
|
|
4369
4400
|
className: "px-3 py-1.5 bg-teal-600 text-white text-sm rounded-lg hover:bg-teal-700 disabled:opacity-50",
|
|
@@ -4373,9 +4404,9 @@ function _r({ image: t, onLoadWorkflow: i, isLoading: a }) {
|
|
|
4373
4404
|
/* @__PURE__ */ e(
|
|
4374
4405
|
"a",
|
|
4375
4406
|
{
|
|
4376
|
-
href:
|
|
4407
|
+
href: ve(t.id),
|
|
4377
4408
|
download: t.filename,
|
|
4378
|
-
onClick: (
|
|
4409
|
+
onClick: (o) => o.stopPropagation(),
|
|
4379
4410
|
className: "p-1.5 bg-zinc-700 text-white rounded-lg hover:bg-zinc-600",
|
|
4380
4411
|
title: "Download image",
|
|
4381
4412
|
children: /* @__PURE__ */ e("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e(
|
|
@@ -4396,13 +4427,13 @@ function _r({ image: t, onLoadWorkflow: i, isLoading: a }) {
|
|
|
4396
4427
|
/* @__PURE__ */ l("div", { className: "text-xs text-gray-500 dark:text-zinc-400 mt-1", children: [
|
|
4397
4428
|
t.mime,
|
|
4398
4429
|
" • ",
|
|
4399
|
-
|
|
4430
|
+
i(t.size)
|
|
4400
4431
|
] }),
|
|
4401
4432
|
/* @__PURE__ */ e("div", { className: "text-xs text-gray-400 dark:text-zinc-500 mt-1", children: r(t.createdAt) })
|
|
4402
4433
|
] })
|
|
4403
4434
|
] });
|
|
4404
4435
|
}
|
|
4405
|
-
const
|
|
4436
|
+
const Pr = {
|
|
4406
4437
|
id: "revenue-chart",
|
|
4407
4438
|
name: "Revenue Dashboard",
|
|
4408
4439
|
description: "Quarterly revenue chart with caption and web-optimized export",
|
|
@@ -4527,7 +4558,7 @@ const Mr = {
|
|
|
4527
4558
|
{ id: "e3", source: "transform-caption", target: "transform-webp" }
|
|
4528
4559
|
]
|
|
4529
4560
|
}
|
|
4530
|
-
},
|
|
4561
|
+
}, Tr = {
|
|
4531
4562
|
id: "monthly-users",
|
|
4532
4563
|
name: "User Growth Chart",
|
|
4533
4564
|
description: "Polished user growth chart ready for investor decks and presentations",
|
|
@@ -4642,7 +4673,7 @@ const Mr = {
|
|
|
4642
4673
|
{ id: "e3", source: "transform-corners", target: "transform-png" }
|
|
4643
4674
|
]
|
|
4644
4675
|
}
|
|
4645
|
-
},
|
|
4676
|
+
}, Er = {
|
|
4646
4677
|
id: "framework-usage",
|
|
4647
4678
|
name: "Framework Usage Stats",
|
|
4648
4679
|
description: "Blog-ready comparison chart with optimized sizing and fast web loading",
|
|
@@ -4764,7 +4795,7 @@ const Mr = {
|
|
|
4764
4795
|
{ id: "e3", source: "transform-padding", target: "transform-webp" }
|
|
4765
4796
|
]
|
|
4766
4797
|
}
|
|
4767
|
-
},
|
|
4798
|
+
}, Br = {
|
|
4768
4799
|
id: "traffic-breakdown",
|
|
4769
4800
|
name: "Traffic by Device",
|
|
4770
4801
|
description: "Analytics breakdown optimized for Slack sharing and weekly reports",
|
|
@@ -4888,7 +4919,7 @@ const Mr = {
|
|
|
4888
4919
|
{ id: "e3", source: "transform-caption", target: "transform-png" }
|
|
4889
4920
|
]
|
|
4890
4921
|
}
|
|
4891
|
-
},
|
|
4922
|
+
}, Rr = {
|
|
4892
4923
|
id: "api-flow",
|
|
4893
4924
|
name: "API Request Flow",
|
|
4894
4925
|
description: "Sequence diagram ready for API documentation and README files",
|
|
@@ -5000,7 +5031,7 @@ const Mr = {
|
|
|
5000
5031
|
{ id: "e3", source: "transform-padding", target: "transform-png" }
|
|
5001
5032
|
]
|
|
5002
5033
|
}
|
|
5003
|
-
},
|
|
5034
|
+
}, Dr = {
|
|
5004
5035
|
id: "system-architecture",
|
|
5005
5036
|
name: "System Architecture",
|
|
5006
5037
|
description: "Architecture diagram optimized for Confluence, Notion, and technical documentation",
|
|
@@ -5139,7 +5170,7 @@ const Mr = {
|
|
|
5139
5170
|
{ id: "e3", source: "transform-padding", target: "transform-webp" }
|
|
5140
5171
|
]
|
|
5141
5172
|
}
|
|
5142
|
-
},
|
|
5173
|
+
}, jr = {
|
|
5143
5174
|
id: "git-workflow",
|
|
5144
5175
|
name: "Git Branch Workflow",
|
|
5145
5176
|
description: "Git branching diagram for team onboarding and CONTRIBUTING.md",
|
|
@@ -5264,15 +5295,15 @@ const Mr = {
|
|
|
5264
5295
|
{ id: "e3", source: "transform-caption", target: "transform-png" }
|
|
5265
5296
|
]
|
|
5266
5297
|
}
|
|
5267
|
-
},
|
|
5268
|
-
Mr,
|
|
5298
|
+
}, Or = [
|
|
5269
5299
|
Pr,
|
|
5270
5300
|
Tr,
|
|
5271
5301
|
Er,
|
|
5272
5302
|
Br,
|
|
5273
5303
|
Rr,
|
|
5274
|
-
Dr
|
|
5275
|
-
|
|
5304
|
+
Dr,
|
|
5305
|
+
jr
|
|
5306
|
+
], $r = {
|
|
5276
5307
|
id: "ai-product-shot",
|
|
5277
5308
|
name: "AI Product Photography",
|
|
5278
5309
|
description: "Generate AI product photos with background removal and e-commerce-ready sizing",
|
|
@@ -5367,7 +5398,7 @@ const Mr = {
|
|
|
5367
5398
|
{ id: "e3", source: "transform-resize", target: "transform-caption" }
|
|
5368
5399
|
]
|
|
5369
5400
|
}
|
|
5370
|
-
},
|
|
5401
|
+
}, Ur = {
|
|
5371
5402
|
id: "ai-hero-image",
|
|
5372
5403
|
name: "AI Hero Image",
|
|
5373
5404
|
description: "Generate landing page hero images optimized for web and social sharing",
|
|
@@ -5460,7 +5491,7 @@ const Mr = {
|
|
|
5460
5491
|
{ id: "e3", source: "transform-corners", target: "transform-webp" }
|
|
5461
5492
|
]
|
|
5462
5493
|
}
|
|
5463
|
-
},
|
|
5494
|
+
}, qr = {
|
|
5464
5495
|
id: "ai-mascot",
|
|
5465
5496
|
name: "AI Mascot Generator",
|
|
5466
5497
|
description: "Generate mascot with transparent background and multiple export sizes",
|
|
@@ -5550,7 +5581,7 @@ const Mr = {
|
|
|
5550
5581
|
{ id: "e3", source: "transform-resize", target: "transform-png" }
|
|
5551
5582
|
]
|
|
5552
5583
|
}
|
|
5553
|
-
},
|
|
5584
|
+
}, Gr = {
|
|
5554
5585
|
id: "cloud-ai-logo-brand",
|
|
5555
5586
|
name: "AI Logo to Brand Kit",
|
|
5556
5587
|
description: "Generate a logo with AI, then create production-ready brand assets",
|
|
@@ -5617,7 +5648,7 @@ const Mr = {
|
|
|
5617
5648
|
{ id: "e2", source: "transform-bg", target: "transform-watermark" }
|
|
5618
5649
|
]
|
|
5619
5650
|
}
|
|
5620
|
-
},
|
|
5651
|
+
}, Fr = {
|
|
5621
5652
|
id: "cloud-product-enhance",
|
|
5622
5653
|
name: "Product Photo Enhancement",
|
|
5623
5654
|
description: "Remove background and add professional product labeling",
|
|
@@ -5672,7 +5703,7 @@ const Mr = {
|
|
|
5672
5703
|
{ id: "e2", source: "transform-bg", target: "transform-caption" }
|
|
5673
5704
|
]
|
|
5674
5705
|
}
|
|
5675
|
-
},
|
|
5706
|
+
}, Vr = {
|
|
5676
5707
|
id: "cloud-ai-social",
|
|
5677
5708
|
name: "AI Art to Social Post",
|
|
5678
5709
|
description: "Generate creative AI art, optimize for social media",
|
|
@@ -5749,14 +5780,14 @@ const Mr = {
|
|
|
5749
5780
|
{ id: "e3", source: "transform-caption", target: "transform-webp" }
|
|
5750
5781
|
]
|
|
5751
5782
|
}
|
|
5752
|
-
},
|
|
5753
|
-
Or,
|
|
5783
|
+
}, Hr = [
|
|
5754
5784
|
$r,
|
|
5755
5785
|
Ur,
|
|
5756
5786
|
qr,
|
|
5757
5787
|
Gr,
|
|
5758
|
-
Fr
|
|
5759
|
-
|
|
5788
|
+
Fr,
|
|
5789
|
+
Vr
|
|
5790
|
+
], Kr = {
|
|
5760
5791
|
id: "social-media-kit",
|
|
5761
5792
|
name: "Social Media Kit",
|
|
5762
5793
|
description: "Generate optimized images for all social platforms from one source",
|
|
@@ -5836,7 +5867,7 @@ const socialKit = await floimg.pipeline(heroImage, [
|
|
|
5836
5867
|
{ id: "e3", source: "input-1", target: "transform-instagram" }
|
|
5837
5868
|
]
|
|
5838
5869
|
}
|
|
5839
|
-
},
|
|
5870
|
+
}, Jr = {
|
|
5840
5871
|
id: "avatar-pipeline",
|
|
5841
5872
|
name: "Avatar Processing",
|
|
5842
5873
|
description: "Generate consistent avatar sizes with circular crop and optimization",
|
|
@@ -5925,7 +5956,7 @@ const socialKit = await floimg.pipeline(heroImage, [
|
|
|
5925
5956
|
{ id: "e4", source: "transform-crop", target: "transform-64" }
|
|
5926
5957
|
]
|
|
5927
5958
|
}
|
|
5928
|
-
},
|
|
5959
|
+
}, Qr = {
|
|
5929
5960
|
id: "watermark-branding",
|
|
5930
5961
|
name: "Branded Watermark",
|
|
5931
5962
|
description: "Add your logo watermark to images automatically",
|
|
@@ -6004,7 +6035,7 @@ const socialKit = await floimg.pipeline(heroImage, [
|
|
|
6004
6035
|
{ id: "e2", source: "transform-1", target: "transform-2" }
|
|
6005
6036
|
]
|
|
6006
6037
|
}
|
|
6007
|
-
},
|
|
6038
|
+
}, Yr = {
|
|
6008
6039
|
id: "filter-showcase",
|
|
6009
6040
|
name: "Image Filters",
|
|
6010
6041
|
description: "Apply artistic filters: vintage, dramatic, vibrant, and more",
|
|
@@ -6077,7 +6108,7 @@ const socialKit = await floimg.pipeline(heroImage, [
|
|
|
6077
6108
|
{ id: "e3", source: "input-1", target: "transform-dramatic" }
|
|
6078
6109
|
]
|
|
6079
6110
|
}
|
|
6080
|
-
},
|
|
6111
|
+
}, Zr = {
|
|
6081
6112
|
id: "responsive-images",
|
|
6082
6113
|
name: "Responsive Image Pipeline",
|
|
6083
6114
|
description: "Generate thumbnail, mobile, tablet, desktop, and retina sizes from one source",
|
|
@@ -6181,7 +6212,7 @@ const responsive = await floimg.from(source)
|
|
|
6181
6212
|
{ id: "e5", source: "input-1", target: "transform-retina" }
|
|
6182
6213
|
]
|
|
6183
6214
|
}
|
|
6184
|
-
},
|
|
6215
|
+
}, Xr = {
|
|
6185
6216
|
id: "team-headshots",
|
|
6186
6217
|
name: "Team Headshot Standardizer",
|
|
6187
6218
|
description: "Standardize team photos with consistent sizing and professional styling",
|
|
@@ -6269,7 +6300,7 @@ const responsive = await floimg.from(source)
|
|
|
6269
6300
|
{ id: "e4", source: "transform-grayscale", target: "transform-png" }
|
|
6270
6301
|
]
|
|
6271
6302
|
}
|
|
6272
|
-
},
|
|
6303
|
+
}, ea = {
|
|
6273
6304
|
id: "screenshot-docs",
|
|
6274
6305
|
name: "Screenshot to Docs",
|
|
6275
6306
|
description: "Prepare screenshots for documentation with borders and optimization",
|
|
@@ -6368,7 +6399,7 @@ const responsive = await floimg.from(source)
|
|
|
6368
6399
|
{ id: "e4", source: "transform-corners", target: "transform-png" }
|
|
6369
6400
|
]
|
|
6370
6401
|
}
|
|
6371
|
-
},
|
|
6402
|
+
}, ta = {
|
|
6372
6403
|
id: "blog-og-image",
|
|
6373
6404
|
name: "Blog Post OG Image",
|
|
6374
6405
|
description: "Create social sharing images for blog posts with title overlay",
|
|
@@ -6453,7 +6484,7 @@ const responsive = await floimg.from(source)
|
|
|
6453
6484
|
{ id: "e3", source: "transform-caption", target: "transform-webp" }
|
|
6454
6485
|
]
|
|
6455
6486
|
}
|
|
6456
|
-
},
|
|
6487
|
+
}, ra = {
|
|
6457
6488
|
id: "email-banner",
|
|
6458
6489
|
name: "Email Banner",
|
|
6459
6490
|
description: "Create email header banners with consistent dimensions for newsletters",
|
|
@@ -6537,7 +6568,7 @@ const responsive = await floimg.from(source)
|
|
|
6537
6568
|
{ id: "e3", source: "transform-caption", target: "transform-png" }
|
|
6538
6569
|
]
|
|
6539
6570
|
}
|
|
6540
|
-
},
|
|
6571
|
+
}, aa = {
|
|
6541
6572
|
id: "app-icons",
|
|
6542
6573
|
name: "App Icon Generator",
|
|
6543
6574
|
description: "Generate iOS and Android app icon sizes from one source image",
|
|
@@ -6643,8 +6674,7 @@ const responsive = await floimg.from(source)
|
|
|
6643
6674
|
{ id: "e5", source: "transform-bg", target: "transform-store-512" }
|
|
6644
6675
|
]
|
|
6645
6676
|
}
|
|
6646
|
-
},
|
|
6647
|
-
Hr,
|
|
6677
|
+
}, oa = [
|
|
6648
6678
|
Kr,
|
|
6649
6679
|
Jr,
|
|
6650
6680
|
Qr,
|
|
@@ -6653,8 +6683,9 @@ const responsive = await floimg.from(source)
|
|
|
6653
6683
|
Xr,
|
|
6654
6684
|
ea,
|
|
6655
6685
|
ta,
|
|
6656
|
-
ra
|
|
6657
|
-
|
|
6686
|
+
ra,
|
|
6687
|
+
aa
|
|
6688
|
+
], na = {
|
|
6658
6689
|
id: "branded-qr",
|
|
6659
6690
|
name: "Branded QR Code",
|
|
6660
6691
|
description: "QR code with custom colors, rounded corners, and optimized for print or digital",
|
|
@@ -6742,7 +6773,7 @@ const responsive = await floimg.from(source)
|
|
|
6742
6773
|
{ id: "e3", source: "transform-corners", target: "transform-convert" }
|
|
6743
6774
|
]
|
|
6744
6775
|
}
|
|
6745
|
-
},
|
|
6776
|
+
}, ia = {
|
|
6746
6777
|
id: "dark-qr",
|
|
6747
6778
|
name: "Dark Mode QR",
|
|
6748
6779
|
description: "QR code optimized for dark backgrounds with subtle border and web-optimized export",
|
|
@@ -6838,7 +6869,7 @@ const responsive = await floimg.from(source)
|
|
|
6838
6869
|
{ id: "e3", source: "transform-border", target: "transform-webp" }
|
|
6839
6870
|
]
|
|
6840
6871
|
}
|
|
6841
|
-
},
|
|
6872
|
+
}, sa = {
|
|
6842
6873
|
id: "wifi-qr",
|
|
6843
6874
|
name: "WiFi QR Code",
|
|
6844
6875
|
description: "Scannable WiFi QR code with network name label and professional styling",
|
|
@@ -6935,7 +6966,7 @@ const responsive = await floimg.from(source)
|
|
|
6935
6966
|
{ id: "e3", source: "transform-caption", target: "transform-corners" }
|
|
6936
6967
|
]
|
|
6937
6968
|
}
|
|
6938
|
-
},
|
|
6969
|
+
}, da = {
|
|
6939
6970
|
id: "thumbnail-generator",
|
|
6940
6971
|
name: "Thumbnail Generator",
|
|
6941
6972
|
description: "Create multiple thumbnail sizes with automatic optimization",
|
|
@@ -7006,7 +7037,7 @@ const responsive = await floimg.from(source)
|
|
|
7006
7037
|
{ id: "e3", source: "input-1", target: "transform-200" }
|
|
7007
7038
|
]
|
|
7008
7039
|
}
|
|
7009
|
-
},
|
|
7040
|
+
}, la = {
|
|
7010
7041
|
id: "diagram-webp",
|
|
7011
7042
|
name: "Diagram to WebP",
|
|
7012
7043
|
description: "Mermaid diagram converted to optimized WebP format",
|
|
@@ -7057,46 +7088,46 @@ const responsive = await floimg.from(source)
|
|
|
7057
7088
|
],
|
|
7058
7089
|
edges: [{ id: "e1", source: "gen-1", target: "transform-1" }]
|
|
7059
7090
|
}
|
|
7060
|
-
},
|
|
7061
|
-
oa,
|
|
7091
|
+
}, ca = [
|
|
7062
7092
|
na,
|
|
7063
7093
|
ia,
|
|
7064
7094
|
sa,
|
|
7065
|
-
da
|
|
7066
|
-
|
|
7067
|
-
|
|
7068
|
-
...
|
|
7069
|
-
...
|
|
7070
|
-
...
|
|
7071
|
-
|
|
7072
|
-
|
|
7073
|
-
|
|
7074
|
-
|
|
7095
|
+
da,
|
|
7096
|
+
la
|
|
7097
|
+
], Ae = [
|
|
7098
|
+
...Or,
|
|
7099
|
+
...Hr,
|
|
7100
|
+
...oa,
|
|
7101
|
+
...ca
|
|
7102
|
+
], be = Ae.filter((t) => !t.requiresCloud);
|
|
7103
|
+
Ae.filter((t) => t.requiresCloud);
|
|
7104
|
+
function ma(t) {
|
|
7105
|
+
return Ae.find((n) => n.id === t);
|
|
7075
7106
|
}
|
|
7076
|
-
function
|
|
7077
|
-
return
|
|
7107
|
+
function Oa(t) {
|
|
7108
|
+
return be.find((n) => n.id === t);
|
|
7078
7109
|
}
|
|
7079
|
-
function
|
|
7080
|
-
const t = new Set(
|
|
7110
|
+
function pa() {
|
|
7111
|
+
const t = new Set(be.map((n) => n.category));
|
|
7081
7112
|
return Array.from(t);
|
|
7082
7113
|
}
|
|
7083
|
-
function Oa(t) {
|
|
7084
|
-
return he.filter((i) => i.category === t);
|
|
7085
|
-
}
|
|
7086
7114
|
function $a(t) {
|
|
7087
|
-
|
|
7088
|
-
|
|
7115
|
+
return be.filter((n) => n.category === t);
|
|
7116
|
+
}
|
|
7117
|
+
function Ua(t) {
|
|
7118
|
+
const n = t.toLowerCase();
|
|
7119
|
+
return be.filter((a) => {
|
|
7089
7120
|
var r;
|
|
7090
|
-
return a.name.toLowerCase().includes(
|
|
7121
|
+
return a.name.toLowerCase().includes(n) || a.description.toLowerCase().includes(n) || a.category.toLowerCase().includes(n) || a.generator.toLowerCase().includes(n) || ((r = a.tags) == null ? void 0 : r.some((i) => i.toLowerCase().includes(n)));
|
|
7091
7122
|
});
|
|
7092
7123
|
}
|
|
7093
|
-
function
|
|
7094
|
-
return
|
|
7124
|
+
function Ee(t) {
|
|
7125
|
+
return ma(t);
|
|
7095
7126
|
}
|
|
7096
|
-
function
|
|
7097
|
-
const [
|
|
7098
|
-
let m =
|
|
7099
|
-
if (
|
|
7127
|
+
function ua({ onSelect: t }) {
|
|
7128
|
+
const [n, a] = _(null), [r, i] = _(""), o = de(() => pa(), []), c = de(() => {
|
|
7129
|
+
let m = be;
|
|
7130
|
+
if (n && (m = m.filter((s) => s.category === n)), r) {
|
|
7100
7131
|
const s = r.toLowerCase();
|
|
7101
7132
|
m = m.filter(
|
|
7102
7133
|
(g) => {
|
|
@@ -7106,7 +7137,7 @@ function pa({ onSelect: t }) {
|
|
|
7106
7137
|
);
|
|
7107
7138
|
}
|
|
7108
7139
|
return m;
|
|
7109
|
-
}, [
|
|
7140
|
+
}, [n, r]);
|
|
7110
7141
|
return /* @__PURE__ */ l("div", { className: "p-6", children: [
|
|
7111
7142
|
/* @__PURE__ */ l("div", { className: "mb-6", children: [
|
|
7112
7143
|
/* @__PURE__ */ e("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white mb-2", children: "Templates" }),
|
|
@@ -7119,7 +7150,7 @@ function pa({ onSelect: t }) {
|
|
|
7119
7150
|
type: "text",
|
|
7120
7151
|
placeholder: "Search templates...",
|
|
7121
7152
|
value: r,
|
|
7122
|
-
onChange: (m) =>
|
|
7153
|
+
onChange: (m) => i(m.target.value),
|
|
7123
7154
|
className: "px-4 py-2 border border-gray-300 dark:border-zinc-600 rounded-lg bg-white dark:bg-zinc-800 text-gray-900 dark:text-white focus:ring-2 focus:ring-teal-500 focus:border-transparent w-64"
|
|
7124
7155
|
}
|
|
7125
7156
|
),
|
|
@@ -7128,15 +7159,15 @@ function pa({ onSelect: t }) {
|
|
|
7128
7159
|
"button",
|
|
7129
7160
|
{
|
|
7130
7161
|
onClick: () => a(null),
|
|
7131
|
-
className: `px-3 py-1.5 rounded-full text-sm font-medium transition-colors ${
|
|
7162
|
+
className: `px-3 py-1.5 rounded-full text-sm font-medium transition-colors ${n === null ? "bg-teal-600 text-white" : "bg-gray-200 dark:bg-zinc-700 text-gray-700 dark:text-zinc-300 hover:bg-gray-300 dark:hover:bg-zinc-600"}`,
|
|
7132
7163
|
children: "All"
|
|
7133
7164
|
}
|
|
7134
7165
|
),
|
|
7135
|
-
|
|
7166
|
+
o.map((m) => /* @__PURE__ */ e(
|
|
7136
7167
|
"button",
|
|
7137
7168
|
{
|
|
7138
7169
|
onClick: () => a(m),
|
|
7139
|
-
className: `px-3 py-1.5 rounded-full text-sm font-medium transition-colors ${
|
|
7170
|
+
className: `px-3 py-1.5 rounded-full text-sm font-medium transition-colors ${n === m ? "bg-teal-600 text-white" : "bg-gray-200 dark:bg-zinc-700 text-gray-700 dark:text-zinc-300 hover:bg-gray-300 dark:hover:bg-zinc-600"}`,
|
|
7140
7171
|
children: m
|
|
7141
7172
|
},
|
|
7142
7173
|
m
|
|
@@ -7144,7 +7175,7 @@ function pa({ onSelect: t }) {
|
|
|
7144
7175
|
] })
|
|
7145
7176
|
] }),
|
|
7146
7177
|
c.length === 0 ? /* @__PURE__ */ e("div", { className: "text-center py-12 text-gray-500 dark:text-zinc-400", children: "No templates found matching your criteria." }) : /* @__PURE__ */ e("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6", children: c.map((m) => /* @__PURE__ */ e(
|
|
7147
|
-
|
|
7178
|
+
ga,
|
|
7148
7179
|
{
|
|
7149
7180
|
template: m,
|
|
7150
7181
|
onSelect: () => t(m.id)
|
|
@@ -7153,8 +7184,8 @@ function pa({ onSelect: t }) {
|
|
|
7153
7184
|
)) })
|
|
7154
7185
|
] });
|
|
7155
7186
|
}
|
|
7156
|
-
function
|
|
7157
|
-
const a = t.workflow.nodes.length, r = t.workflow.edges.length,
|
|
7187
|
+
function ga({ template: t, onSelect: n }) {
|
|
7188
|
+
const a = t.workflow.nodes.length, r = t.workflow.edges.length, i = {
|
|
7158
7189
|
quickchart: "bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-300",
|
|
7159
7190
|
mermaid: "bg-pink-100 text-pink-800 dark:bg-pink-900/30 dark:text-pink-300",
|
|
7160
7191
|
qr: "bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-300",
|
|
@@ -7195,7 +7226,7 @@ function ua({ template: t, onSelect: i }) {
|
|
|
7195
7226
|
/* @__PURE__ */ e(
|
|
7196
7227
|
"span",
|
|
7197
7228
|
{
|
|
7198
|
-
className: `px-2 py-0.5 rounded text-xs font-medium ${
|
|
7229
|
+
className: `px-2 py-0.5 rounded text-xs font-medium ${i[t.generator] || "bg-gray-100 text-gray-800 dark:bg-zinc-700 dark:text-zinc-300"}`,
|
|
7199
7230
|
children: t.generator
|
|
7200
7231
|
}
|
|
7201
7232
|
)
|
|
@@ -7231,18 +7262,18 @@ function ua({ template: t, onSelect: i }) {
|
|
|
7231
7262
|
r !== 1 ? "s" : ""
|
|
7232
7263
|
] })
|
|
7233
7264
|
] }),
|
|
7234
|
-
t.tags && t.tags.length > 0 && /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1 mb-4", children: t.tags.slice(0, 4).map((
|
|
7265
|
+
t.tags && t.tags.length > 0 && /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1 mb-4", children: t.tags.slice(0, 4).map((o) => /* @__PURE__ */ e(
|
|
7235
7266
|
"span",
|
|
7236
7267
|
{
|
|
7237
7268
|
className: "px-2 py-0.5 bg-gray-100 dark:bg-zinc-700 text-gray-600 dark:text-zinc-400 rounded text-xs",
|
|
7238
|
-
children:
|
|
7269
|
+
children: o
|
|
7239
7270
|
},
|
|
7240
|
-
|
|
7271
|
+
o
|
|
7241
7272
|
)) }),
|
|
7242
7273
|
/* @__PURE__ */ e(
|
|
7243
7274
|
"button",
|
|
7244
7275
|
{
|
|
7245
|
-
onClick:
|
|
7276
|
+
onClick: n,
|
|
7246
7277
|
className: "w-full py-2 px-4 bg-teal-600 hover:bg-teal-700 text-white rounded-lg font-medium transition-colors",
|
|
7247
7278
|
children: "Use Template"
|
|
7248
7279
|
}
|
|
@@ -7250,16 +7281,16 @@ function ua({ template: t, onSelect: i }) {
|
|
|
7250
7281
|
] })
|
|
7251
7282
|
] });
|
|
7252
7283
|
}
|
|
7253
|
-
function
|
|
7284
|
+
function fa({
|
|
7254
7285
|
workflow: t,
|
|
7255
|
-
isActive:
|
|
7286
|
+
isActive: n,
|
|
7256
7287
|
onLoad: a,
|
|
7257
7288
|
onDelete: r,
|
|
7258
|
-
onRename:
|
|
7259
|
-
onDuplicate:
|
|
7289
|
+
onRename: i,
|
|
7290
|
+
onDuplicate: o
|
|
7260
7291
|
}) {
|
|
7261
7292
|
const [c, m] = _(!1), [s, g] = _(t.name), [p, d] = _(!1), b = () => {
|
|
7262
|
-
s.trim() && s !== t.name &&
|
|
7293
|
+
s.trim() && s !== t.name && i(s.trim()), m(!1);
|
|
7263
7294
|
}, f = (k) => {
|
|
7264
7295
|
const x = new Date(k), C = (/* @__PURE__ */ new Date()).getTime() - x.getTime(), u = Math.floor(C / 6e4), h = Math.floor(C / 36e5), y = Math.floor(C / 864e5);
|
|
7265
7296
|
return u < 1 ? "Just now" : u < 60 ? `${u}m ago` : h < 24 ? `${h}h ago` : y < 7 ? `${y}d ago` : x.toLocaleDateString();
|
|
@@ -7267,7 +7298,7 @@ function ga({
|
|
|
7267
7298
|
return /* @__PURE__ */ l(
|
|
7268
7299
|
"div",
|
|
7269
7300
|
{
|
|
7270
|
-
className: `group relative p-3 rounded-lg border transition-colors ${
|
|
7301
|
+
className: `group relative p-3 rounded-lg border transition-colors ${n ? "bg-teal-50 dark:bg-teal-900/20 border-teal-200 dark:border-teal-800" : "bg-white dark:bg-zinc-800 border-zinc-200 dark:border-zinc-700 hover:border-zinc-300 dark:hover:border-zinc-600"}`,
|
|
7271
7302
|
children: [
|
|
7272
7303
|
/* @__PURE__ */ l("div", { className: "flex items-start justify-between gap-2", children: [
|
|
7273
7304
|
/* @__PURE__ */ l("button", { onClick: a, className: "flex-1 text-left min-w-0", children: [
|
|
@@ -7303,7 +7334,7 @@ function ga({
|
|
|
7303
7334
|
children: /* @__PURE__ */ e("svg", { className: "w-4 h-4", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ e("path", { d: "M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z" }) })
|
|
7304
7335
|
}
|
|
7305
7336
|
),
|
|
7306
|
-
p && /* @__PURE__ */ l(
|
|
7337
|
+
p && /* @__PURE__ */ l(se, { children: [
|
|
7307
7338
|
/* @__PURE__ */ e("div", { className: "fixed inset-0 z-10", onClick: () => d(!1) }),
|
|
7308
7339
|
/* @__PURE__ */ l("div", { className: "absolute right-0 top-full mt-1 w-36 bg-white dark:bg-zinc-800 rounded-lg shadow-lg border border-zinc-200 dark:border-zinc-700 py-1 z-20", children: [
|
|
7309
7340
|
/* @__PURE__ */ e(
|
|
@@ -7320,7 +7351,7 @@ function ga({
|
|
|
7320
7351
|
"button",
|
|
7321
7352
|
{
|
|
7322
7353
|
onClick: (k) => {
|
|
7323
|
-
k.stopPropagation(),
|
|
7354
|
+
k.stopPropagation(), o(), d(!1);
|
|
7324
7355
|
},
|
|
7325
7356
|
className: "w-full px-3 py-1.5 text-left text-sm text-zinc-700 dark:text-zinc-300 hover:bg-zinc-100 dark:hover:bg-zinc-700",
|
|
7326
7357
|
children: "Duplicate"
|
|
@@ -7340,24 +7371,24 @@ function ga({
|
|
|
7340
7371
|
] })
|
|
7341
7372
|
] })
|
|
7342
7373
|
] }),
|
|
7343
|
-
|
|
7374
|
+
n && /* @__PURE__ */ e("span", { className: "absolute top-2 right-2 w-2 h-2 bg-teal-500 rounded-full" })
|
|
7344
7375
|
]
|
|
7345
7376
|
}
|
|
7346
7377
|
);
|
|
7347
7378
|
}
|
|
7348
|
-
function
|
|
7349
|
-
const t = w((p) => p.showLibrary),
|
|
7379
|
+
function ha() {
|
|
7380
|
+
const t = w((p) => p.showLibrary), n = w((p) => p.toggleLibrary), a = w((p) => p.savedWorkflows), r = w((p) => p.activeWorkflowId), i = w((p) => p.loadWorkflow), o = w((p) => p.deleteWorkflow), c = w((p) => p.renameWorkflow), m = w((p) => p.duplicateWorkflow), s = w((p) => p.newWorkflow);
|
|
7350
7381
|
if (!t) return null;
|
|
7351
7382
|
const g = [...a].sort((p, d) => d.updatedAt - p.updatedAt);
|
|
7352
|
-
return /* @__PURE__ */ l(
|
|
7353
|
-
/* @__PURE__ */ e("div", { className: "fixed inset-0 bg-black/20 dark:bg-black/40 z-40", onClick:
|
|
7383
|
+
return /* @__PURE__ */ l(se, { children: [
|
|
7384
|
+
/* @__PURE__ */ e("div", { className: "fixed inset-0 bg-black/20 dark:bg-black/40 z-40", onClick: n }),
|
|
7354
7385
|
/* @__PURE__ */ l("div", { className: "fixed left-0 top-0 bottom-0 w-80 bg-zinc-50 dark:bg-zinc-900 border-r border-zinc-200 dark:border-zinc-700 z-50 flex flex-col shadow-xl", children: [
|
|
7355
7386
|
/* @__PURE__ */ l("div", { className: "flex items-center justify-between px-4 py-3 border-b border-zinc-200 dark:border-zinc-700", children: [
|
|
7356
7387
|
/* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-zinc-900 dark:text-zinc-100", children: "My Workflows" }),
|
|
7357
7388
|
/* @__PURE__ */ e(
|
|
7358
7389
|
"button",
|
|
7359
7390
|
{
|
|
7360
|
-
onClick:
|
|
7391
|
+
onClick: n,
|
|
7361
7392
|
className: "p-1 text-zinc-500 hover:text-zinc-700 dark:hover:text-zinc-300 rounded",
|
|
7362
7393
|
children: /* @__PURE__ */ e("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e(
|
|
7363
7394
|
"path",
|
|
@@ -7375,7 +7406,7 @@ function fa() {
|
|
|
7375
7406
|
"button",
|
|
7376
7407
|
{
|
|
7377
7408
|
onClick: () => {
|
|
7378
|
-
s(),
|
|
7409
|
+
s(), n(), window.dispatchEvent(new window.CustomEvent("new-workflow-created"));
|
|
7379
7410
|
},
|
|
7380
7411
|
className: "w-full flex items-center justify-center gap-2 px-4 py-2 text-sm font-medium text-white bg-teal-600 rounded-lg hover:bg-teal-700 transition-colors",
|
|
7381
7412
|
children: [
|
|
@@ -7414,14 +7445,14 @@ function fa() {
|
|
|
7414
7445
|
/* @__PURE__ */ e("p", { className: "text-sm text-zinc-500 dark:text-zinc-400", children: "No saved workflows yet" }),
|
|
7415
7446
|
/* @__PURE__ */ e("p", { className: "text-xs text-zinc-400 dark:text-zinc-500 mt-1", children: "Build a workflow and save it to see it here" })
|
|
7416
7447
|
] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: g.map((p) => /* @__PURE__ */ e(
|
|
7417
|
-
|
|
7448
|
+
fa,
|
|
7418
7449
|
{
|
|
7419
7450
|
workflow: p,
|
|
7420
7451
|
isActive: p.id === r,
|
|
7421
7452
|
onLoad: () => {
|
|
7422
|
-
|
|
7453
|
+
i(p.id), n();
|
|
7423
7454
|
},
|
|
7424
|
-
onDelete: () =>
|
|
7455
|
+
onDelete: () => o(p.id),
|
|
7425
7456
|
onRename: (d) => c(p.id, d),
|
|
7426
7457
|
onDuplicate: () => m(p.id)
|
|
7427
7458
|
},
|
|
@@ -7436,7 +7467,7 @@ function fa() {
|
|
|
7436
7467
|
] })
|
|
7437
7468
|
] });
|
|
7438
7469
|
}
|
|
7439
|
-
const
|
|
7470
|
+
const ba = [
|
|
7440
7471
|
{
|
|
7441
7472
|
id: "openai",
|
|
7442
7473
|
name: "OpenAI",
|
|
@@ -7472,7 +7503,7 @@ const ha = [
|
|
|
7472
7503
|
placeholder: "sk-or-...",
|
|
7473
7504
|
docsUrl: "https://openrouter.ai/keys"
|
|
7474
7505
|
}
|
|
7475
|
-
],
|
|
7506
|
+
], xa = [
|
|
7476
7507
|
{
|
|
7477
7508
|
id: "ollama",
|
|
7478
7509
|
name: "Ollama",
|
|
@@ -7488,16 +7519,16 @@ const ha = [
|
|
|
7488
7519
|
docsUrl: "https://lmstudio.ai"
|
|
7489
7520
|
}
|
|
7490
7521
|
];
|
|
7491
|
-
function
|
|
7492
|
-
const
|
|
7522
|
+
function ya({ provider: t }) {
|
|
7523
|
+
const n = E((b) => b.ai), a = E((b) => b.setAIProvider), r = n[t.id], i = (r == null ? void 0 : r.enabled) ?? !1, o = (r == null ? void 0 : r.apiKey) ?? "", [c, m] = _(o), [s, g] = _(!1), p = () => {
|
|
7493
7524
|
a(t.id, {
|
|
7494
7525
|
apiKey: c,
|
|
7495
|
-
enabled: !
|
|
7526
|
+
enabled: !i
|
|
7496
7527
|
});
|
|
7497
7528
|
}, d = (b) => {
|
|
7498
7529
|
m(b), a(t.id, {
|
|
7499
7530
|
apiKey: b,
|
|
7500
|
-
enabled:
|
|
7531
|
+
enabled: i
|
|
7501
7532
|
});
|
|
7502
7533
|
};
|
|
7503
7534
|
return /* @__PURE__ */ l("div", { className: "flex items-start gap-4 p-4 border border-gray-200 dark:border-zinc-700 rounded-lg", children: [
|
|
@@ -7558,27 +7589,27 @@ function xa({ provider: t }) {
|
|
|
7558
7589
|
"button",
|
|
7559
7590
|
{
|
|
7560
7591
|
onClick: p,
|
|
7561
|
-
className: `relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${
|
|
7592
|
+
className: `relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${i ? "bg-teal-600" : "bg-gray-300 dark:bg-zinc-600"}`,
|
|
7562
7593
|
children: /* @__PURE__ */ e(
|
|
7563
7594
|
"span",
|
|
7564
7595
|
{
|
|
7565
|
-
className: `inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${
|
|
7596
|
+
className: `inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${i ? "translate-x-6" : "translate-x-1"}`
|
|
7566
7597
|
}
|
|
7567
7598
|
)
|
|
7568
7599
|
}
|
|
7569
7600
|
) })
|
|
7570
7601
|
] });
|
|
7571
7602
|
}
|
|
7572
|
-
function
|
|
7573
|
-
const
|
|
7603
|
+
function wa({ provider: t }) {
|
|
7604
|
+
const n = E((p) => p.ai), a = E((p) => p.setAIProvider), r = n[t.id], i = (r == null ? void 0 : r.enabled) ?? !1, o = (r == null ? void 0 : r.baseUrl) ?? t.defaultUrl, [c, m] = _(o), s = () => {
|
|
7574
7605
|
a(t.id, {
|
|
7575
7606
|
baseUrl: c,
|
|
7576
|
-
enabled: !
|
|
7607
|
+
enabled: !i
|
|
7577
7608
|
});
|
|
7578
7609
|
}, g = (p) => {
|
|
7579
7610
|
m(p), a(t.id, {
|
|
7580
7611
|
baseUrl: p,
|
|
7581
|
-
enabled:
|
|
7612
|
+
enabled: i
|
|
7582
7613
|
});
|
|
7583
7614
|
};
|
|
7584
7615
|
return /* @__PURE__ */ l("div", { className: "flex items-start gap-4 p-4 border border-gray-200 dark:border-zinc-700 rounded-lg", children: [
|
|
@@ -7613,19 +7644,19 @@ function ya({ provider: t }) {
|
|
|
7613
7644
|
"button",
|
|
7614
7645
|
{
|
|
7615
7646
|
onClick: s,
|
|
7616
|
-
className: `relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${
|
|
7647
|
+
className: `relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${i ? "bg-teal-600" : "bg-gray-300 dark:bg-zinc-600"}`,
|
|
7617
7648
|
children: /* @__PURE__ */ e(
|
|
7618
7649
|
"span",
|
|
7619
7650
|
{
|
|
7620
|
-
className: `inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${
|
|
7651
|
+
className: `inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${i ? "translate-x-6" : "translate-x-1"}`
|
|
7621
7652
|
}
|
|
7622
7653
|
)
|
|
7623
7654
|
}
|
|
7624
7655
|
) })
|
|
7625
7656
|
] });
|
|
7626
7657
|
}
|
|
7627
|
-
function
|
|
7628
|
-
const t = E((a) => a.showSettings),
|
|
7658
|
+
function ka() {
|
|
7659
|
+
const t = E((a) => a.showSettings), n = E((a) => a.closeSettings);
|
|
7629
7660
|
return t ? /* @__PURE__ */ e("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50", children: /* @__PURE__ */ l("div", { className: "bg-white dark:bg-zinc-800 rounded-lg shadow-xl max-w-xl w-full mx-4 max-h-[85vh] flex flex-col", children: [
|
|
7630
7661
|
/* @__PURE__ */ l("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-200 dark:border-zinc-700", children: [
|
|
7631
7662
|
/* @__PURE__ */ l("div", { children: [
|
|
@@ -7635,7 +7666,7 @@ function wa() {
|
|
|
7635
7666
|
/* @__PURE__ */ e(
|
|
7636
7667
|
"button",
|
|
7637
7668
|
{
|
|
7638
|
-
onClick:
|
|
7669
|
+
onClick: n,
|
|
7639
7670
|
className: "text-gray-500 dark:text-zinc-400 hover:text-gray-700 dark:hover:text-zinc-200",
|
|
7640
7671
|
children: /* @__PURE__ */ e("svg", { className: "h-6 w-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e(
|
|
7641
7672
|
"path",
|
|
@@ -7652,11 +7683,11 @@ function wa() {
|
|
|
7652
7683
|
/* @__PURE__ */ l("div", { className: "flex-1 overflow-y-auto p-6 space-y-6", children: [
|
|
7653
7684
|
/* @__PURE__ */ l("section", { children: [
|
|
7654
7685
|
/* @__PURE__ */ e("h3", { className: "text-sm font-medium text-gray-700 dark:text-zinc-300 mb-3", children: "Cloud Providers" }),
|
|
7655
|
-
/* @__PURE__ */ e("div", { className: "space-y-3", children:
|
|
7686
|
+
/* @__PURE__ */ e("div", { className: "space-y-3", children: ba.map((a) => /* @__PURE__ */ e(ya, { provider: a }, a.id)) })
|
|
7656
7687
|
] }),
|
|
7657
7688
|
/* @__PURE__ */ l("section", { children: [
|
|
7658
7689
|
/* @__PURE__ */ e("h3", { className: "text-sm font-medium text-gray-700 dark:text-zinc-300 mb-3", children: "Local Providers" }),
|
|
7659
|
-
/* @__PURE__ */ e("div", { className: "space-y-3", children:
|
|
7690
|
+
/* @__PURE__ */ e("div", { className: "space-y-3", children: xa.map((a) => /* @__PURE__ */ e(wa, { provider: a }, a.id)) })
|
|
7660
7691
|
] }),
|
|
7661
7692
|
/* @__PURE__ */ e("div", { className: "bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-lg p-4", children: /* @__PURE__ */ l("div", { className: "flex items-start gap-3", children: [
|
|
7662
7693
|
/* @__PURE__ */ e(
|
|
@@ -7686,18 +7717,18 @@ function wa() {
|
|
|
7686
7717
|
/* @__PURE__ */ e("div", { className: "flex justify-end px-6 py-4 border-t border-gray-200 dark:border-zinc-700", children: /* @__PURE__ */ e(
|
|
7687
7718
|
"button",
|
|
7688
7719
|
{
|
|
7689
|
-
onClick:
|
|
7720
|
+
onClick: n,
|
|
7690
7721
|
className: "px-4 py-2 text-sm font-medium text-white bg-teal-600 rounded-md hover:bg-teal-700",
|
|
7691
7722
|
children: "Done"
|
|
7692
7723
|
}
|
|
7693
7724
|
) })
|
|
7694
7725
|
] }) }) : null;
|
|
7695
7726
|
}
|
|
7696
|
-
let
|
|
7697
|
-
function
|
|
7698
|
-
const [r,
|
|
7727
|
+
let ce = null;
|
|
7728
|
+
function va({ isOpen: t, onClose: n, onApplyWorkflow: a }) {
|
|
7729
|
+
const [r, i] = _([]), [o, c] = _(""), [m, s] = _(!1), [g, p] = _(null), [d, b] = _(""), [f, k] = _(null), [x, z] = _(null), [C, u] = _(""), [h, y] = _(), [P, B] = _(!1), [T, N] = _(), L = X(null), S = X(null);
|
|
7699
7730
|
G(() => {
|
|
7700
|
-
t && x === null &&
|
|
7731
|
+
t && x === null && It().then((M) => {
|
|
7701
7732
|
z(M.available), u(M.message), y(M.reason), B(M.isCloudDeployment ?? !1), N(M.supportUrl);
|
|
7702
7733
|
}).catch(() => {
|
|
7703
7734
|
z(!1), u("Failed to check AI availability"), y("service_unavailable");
|
|
@@ -7709,15 +7740,15 @@ function ka({ isOpen: t, onClose: i, onApplyWorkflow: a }) {
|
|
|
7709
7740
|
(M = L.current) == null || M.scrollIntoView({ behavior: "smooth" });
|
|
7710
7741
|
}, [r]);
|
|
7711
7742
|
const O = A(() => {
|
|
7712
|
-
if (!
|
|
7743
|
+
if (!o.trim() || m) return;
|
|
7713
7744
|
const M = {
|
|
7714
7745
|
role: "user",
|
|
7715
|
-
content:
|
|
7746
|
+
content: o.trim(),
|
|
7716
7747
|
timestamp: Date.now()
|
|
7717
7748
|
};
|
|
7718
|
-
|
|
7749
|
+
i((v) => [...v, M]), c(""), s(!0), k(null), p(null), b("");
|
|
7719
7750
|
let V;
|
|
7720
|
-
|
|
7751
|
+
ce = Ue(
|
|
7721
7752
|
"/api/generate/workflow/stream",
|
|
7722
7753
|
{ prompt: M.content, history: r },
|
|
7723
7754
|
{
|
|
@@ -7725,28 +7756,28 @@ function ka({ isOpen: t, onClose: i, onApplyWorkflow: a }) {
|
|
|
7725
7756
|
v.type, v.type === "generation.progress" && (p(v.data.phase), b(v.data.message)), v.type === "generation.completed" && (V = v.data), v.type === "generation.error" && k(v.data.error);
|
|
7726
7757
|
},
|
|
7727
7758
|
onError: (v) => {
|
|
7728
|
-
|
|
7759
|
+
ce = null, k(v.message || "Failed to generate workflow"), s(!1), p(null);
|
|
7729
7760
|
},
|
|
7730
7761
|
onClose: () => {
|
|
7731
|
-
|
|
7762
|
+
ce = null;
|
|
7732
7763
|
const v = {
|
|
7733
7764
|
role: "assistant",
|
|
7734
7765
|
content: V ? "I've created a workflow based on your description. Click 'Apply to Canvas' to use it." : "I couldn't generate a workflow. Please try a different description.",
|
|
7735
7766
|
workflow: V,
|
|
7736
7767
|
timestamp: Date.now()
|
|
7737
7768
|
};
|
|
7738
|
-
|
|
7769
|
+
i((R) => [...R, v]), s(!1), p(null), b("");
|
|
7739
7770
|
}
|
|
7740
7771
|
}
|
|
7741
7772
|
);
|
|
7742
|
-
}, [
|
|
7743
|
-
|
|
7773
|
+
}, [o, m, r]), $ = A(() => {
|
|
7774
|
+
ce && (ce.abort(), ce = null), s(!1), p(null), b("");
|
|
7744
7775
|
}, []), K = (M) => {
|
|
7745
7776
|
M.key === "Enter" && !M.shiftKey && (M.preventDefault(), O());
|
|
7746
7777
|
}, F = (M) => {
|
|
7747
|
-
a(M),
|
|
7748
|
-
},
|
|
7749
|
-
|
|
7778
|
+
a(M), n();
|
|
7779
|
+
}, ne = () => {
|
|
7780
|
+
i([]), k(null);
|
|
7750
7781
|
};
|
|
7751
7782
|
return t ? /* @__PURE__ */ e("div", { className: "fixed inset-0 bg-black/50 flex items-center justify-center z-50", children: /* @__PURE__ */ l("div", { className: "bg-white dark:bg-zinc-800 rounded-lg shadow-xl w-full max-w-2xl mx-4 h-[80vh] flex flex-col", children: [
|
|
7752
7783
|
/* @__PURE__ */ l("div", { className: "flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-zinc-700", children: [
|
|
@@ -7778,7 +7809,7 @@ function ka({ isOpen: t, onClose: i, onApplyWorkflow: a }) {
|
|
|
7778
7809
|
r.length > 0 && /* @__PURE__ */ e(
|
|
7779
7810
|
"button",
|
|
7780
7811
|
{
|
|
7781
|
-
onClick:
|
|
7812
|
+
onClick: ne,
|
|
7782
7813
|
className: "p-2 text-gray-500 dark:text-zinc-400 hover:text-gray-700 dark:hover:text-zinc-200 hover:bg-gray-100 dark:hover:bg-zinc-700 rounded",
|
|
7783
7814
|
title: "New Chat",
|
|
7784
7815
|
children: /* @__PURE__ */ e("svg", { className: "h-5 w-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e(
|
|
@@ -7795,7 +7826,7 @@ function ka({ isOpen: t, onClose: i, onApplyWorkflow: a }) {
|
|
|
7795
7826
|
/* @__PURE__ */ e(
|
|
7796
7827
|
"button",
|
|
7797
7828
|
{
|
|
7798
|
-
onClick:
|
|
7829
|
+
onClick: n,
|
|
7799
7830
|
className: "p-2 text-gray-500 dark:text-zinc-400 hover:text-gray-700 dark:hover:text-zinc-200 hover:bg-gray-100 dark:hover:bg-zinc-700 rounded",
|
|
7800
7831
|
children: /* @__PURE__ */ e("svg", { className: "h-5 w-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e(
|
|
7801
7832
|
"path",
|
|
@@ -8112,7 +8143,7 @@ function ka({ isOpen: t, onClose: i, onApplyWorkflow: a }) {
|
|
|
8112
8143
|
"textarea",
|
|
8113
8144
|
{
|
|
8114
8145
|
ref: S,
|
|
8115
|
-
value:
|
|
8146
|
+
value: o,
|
|
8116
8147
|
onChange: (M) => c(M.target.value),
|
|
8117
8148
|
onKeyDown: K,
|
|
8118
8149
|
placeholder: x === !1 ? "AI generation not available" : "Describe what workflow you want to create...",
|
|
@@ -8125,7 +8156,7 @@ function ka({ isOpen: t, onClose: i, onApplyWorkflow: a }) {
|
|
|
8125
8156
|
"button",
|
|
8126
8157
|
{
|
|
8127
8158
|
onClick: O,
|
|
8128
|
-
disabled: !
|
|
8159
|
+
disabled: !o.trim() || m || x === !1,
|
|
8129
8160
|
className: "self-end px-4 py-2 bg-teal-600 hover:bg-teal-700 disabled:opacity-50 disabled:cursor-not-allowed text-white rounded-lg transition-colors",
|
|
8130
8161
|
children: /* @__PURE__ */ e("svg", { className: "h-5 w-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e(
|
|
8131
8162
|
"path",
|
|
@@ -8143,14 +8174,14 @@ function ka({ isOpen: t, onClose: i, onApplyWorkflow: a }) {
|
|
|
8143
8174
|
] })
|
|
8144
8175
|
] }) }) : null;
|
|
8145
8176
|
}
|
|
8146
|
-
const
|
|
8147
|
-
function
|
|
8148
|
-
const [
|
|
8149
|
-
const p =
|
|
8177
|
+
const Na = 20, za = 500, Ca = 1e5;
|
|
8178
|
+
function Sa({ isOpen: t, onClose: n, nodeLabel: a, output: r }) {
|
|
8179
|
+
const [i, o] = _("formatted"), [c, m] = _(!1), s = A(() => {
|
|
8180
|
+
const p = i === "formatted" && r.parsed ? JSON.stringify(r.parsed, null, 2) : r.content;
|
|
8150
8181
|
navigator.clipboard.writeText(p).then(() => {
|
|
8151
8182
|
m(!0), setTimeout(() => m(!1), 2e3);
|
|
8152
8183
|
});
|
|
8153
|
-
}, [
|
|
8184
|
+
}, [i, r]);
|
|
8154
8185
|
if (!t) return null;
|
|
8155
8186
|
const g = r.dataType === "json" && r.parsed;
|
|
8156
8187
|
return /* @__PURE__ */ e("div", { className: "fixed inset-0 bg-black/50 flex items-center justify-center z-50", children: /* @__PURE__ */ l("div", { className: "bg-white dark:bg-zinc-800 rounded-lg shadow-xl w-full max-w-3xl mx-4 max-h-[85vh] flex flex-col", children: [
|
|
@@ -8187,16 +8218,16 @@ function Ca({ isOpen: t, onClose: i, nodeLabel: a, output: r }) {
|
|
|
8187
8218
|
/* @__PURE__ */ e(
|
|
8188
8219
|
"button",
|
|
8189
8220
|
{
|
|
8190
|
-
onClick: () =>
|
|
8191
|
-
className: `px-3 py-1 text-sm rounded-md transition-colors ${
|
|
8221
|
+
onClick: () => o("formatted"),
|
|
8222
|
+
className: `px-3 py-1 text-sm rounded-md transition-colors ${i === "formatted" ? "bg-white dark:bg-zinc-600 text-gray-900 dark:text-white shadow-sm" : "text-gray-600 dark:text-zinc-400 hover:text-gray-900 dark:hover:text-white"}`,
|
|
8192
8223
|
children: "Formatted"
|
|
8193
8224
|
}
|
|
8194
8225
|
),
|
|
8195
8226
|
/* @__PURE__ */ e(
|
|
8196
8227
|
"button",
|
|
8197
8228
|
{
|
|
8198
|
-
onClick: () =>
|
|
8199
|
-
className: `px-3 py-1 text-sm rounded-md transition-colors ${
|
|
8229
|
+
onClick: () => o("raw"),
|
|
8230
|
+
className: `px-3 py-1 text-sm rounded-md transition-colors ${i === "raw" ? "bg-white dark:bg-zinc-600 text-gray-900 dark:text-white shadow-sm" : "text-gray-600 dark:text-zinc-400 hover:text-gray-900 dark:hover:text-white"}`,
|
|
8200
8231
|
children: "Raw"
|
|
8201
8232
|
}
|
|
8202
8233
|
)
|
|
@@ -8204,7 +8235,7 @@ function Ca({ isOpen: t, onClose: i, nodeLabel: a, output: r }) {
|
|
|
8204
8235
|
/* @__PURE__ */ e(
|
|
8205
8236
|
"button",
|
|
8206
8237
|
{
|
|
8207
|
-
onClick:
|
|
8238
|
+
onClick: n,
|
|
8208
8239
|
className: "p-2 text-gray-500 dark:text-zinc-400 hover:text-gray-700 dark:hover:text-zinc-200 hover:bg-gray-100 dark:hover:bg-zinc-700 rounded",
|
|
8209
8240
|
children: /* @__PURE__ */ e("svg", { className: "h-5 w-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e(
|
|
8210
8241
|
"path",
|
|
@@ -8219,7 +8250,7 @@ function Ca({ isOpen: t, onClose: i, nodeLabel: a, output: r }) {
|
|
|
8219
8250
|
)
|
|
8220
8251
|
] })
|
|
8221
8252
|
] }),
|
|
8222
|
-
r.content.length >
|
|
8253
|
+
r.content.length > Ca && /* @__PURE__ */ l("div", { className: "px-4 py-2 bg-amber-50 dark:bg-amber-900/20 border-b border-amber-200 dark:border-amber-800 flex items-center gap-2", children: [
|
|
8223
8254
|
/* @__PURE__ */ e(
|
|
8224
8255
|
"svg",
|
|
8225
8256
|
{
|
|
@@ -8244,7 +8275,7 @@ function Ca({ isOpen: t, onClose: i, nodeLabel: a, output: r }) {
|
|
|
8244
8275
|
"KB) - rendering may be slow"
|
|
8245
8276
|
] })
|
|
8246
8277
|
] }),
|
|
8247
|
-
/* @__PURE__ */ e("div", { className: "flex-1 overflow-auto p-4", children:
|
|
8278
|
+
/* @__PURE__ */ e("div", { className: "flex-1 overflow-auto p-4", children: i === "formatted" && g ? /* @__PURE__ */ e(Ia, { data: r.parsed }) : /* @__PURE__ */ e("pre", { className: "whitespace-pre-wrap font-mono text-sm text-gray-800 dark:text-zinc-200 bg-gray-50 dark:bg-zinc-900 rounded-lg p-4 overflow-auto", children: r.content }) }),
|
|
8248
8279
|
/* @__PURE__ */ l("div", { className: "flex items-center justify-between px-4 py-3 border-t border-gray-200 dark:border-zinc-700", children: [
|
|
8249
8280
|
/* @__PURE__ */ l("span", { className: "text-xs text-gray-500 dark:text-zinc-400", children: [
|
|
8250
8281
|
r.content.length.toLocaleString(),
|
|
@@ -8255,7 +8286,7 @@ function Ca({ isOpen: t, onClose: i, nodeLabel: a, output: r }) {
|
|
|
8255
8286
|
{
|
|
8256
8287
|
onClick: s,
|
|
8257
8288
|
className: "flex items-center gap-2 px-3 py-1.5 text-sm font-medium text-teal-600 dark:text-teal-400 hover:bg-teal-50 dark:hover:bg-teal-900/30 rounded-lg transition-colors",
|
|
8258
|
-
children: c ? /* @__PURE__ */ l(
|
|
8289
|
+
children: c ? /* @__PURE__ */ l(se, { children: [
|
|
8259
8290
|
/* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e(
|
|
8260
8291
|
"path",
|
|
8261
8292
|
{
|
|
@@ -8266,7 +8297,7 @@ function Ca({ isOpen: t, onClose: i, nodeLabel: a, output: r }) {
|
|
|
8266
8297
|
}
|
|
8267
8298
|
) }),
|
|
8268
8299
|
"Copied!"
|
|
8269
|
-
] }) : /* @__PURE__ */ l(
|
|
8300
|
+
] }) : /* @__PURE__ */ l(se, { children: [
|
|
8270
8301
|
/* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e(
|
|
8271
8302
|
"path",
|
|
8272
8303
|
{
|
|
@@ -8283,13 +8314,13 @@ function Ca({ isOpen: t, onClose: i, nodeLabel: a, output: r }) {
|
|
|
8283
8314
|
] })
|
|
8284
8315
|
] }) });
|
|
8285
8316
|
}
|
|
8286
|
-
function
|
|
8287
|
-
return /* @__PURE__ */ e("div", { className: "font-mono text-sm", children: /* @__PURE__ */ e(
|
|
8317
|
+
function Ia({ data: t }) {
|
|
8318
|
+
return /* @__PURE__ */ e("div", { className: "font-mono text-sm", children: /* @__PURE__ */ e(Se, { value: t, depth: 0, maxDepth: Na }) });
|
|
8288
8319
|
}
|
|
8289
|
-
function
|
|
8290
|
-
const
|
|
8291
|
-
if (
|
|
8292
|
-
return /* @__PURE__ */ l("div", { style: { marginLeft:
|
|
8320
|
+
function Se({ value: t, depth: n, keyName: a, maxDepth: r }) {
|
|
8321
|
+
const i = n * 16;
|
|
8322
|
+
if (n >= r)
|
|
8323
|
+
return /* @__PURE__ */ l("div", { style: { marginLeft: i }, className: "py-0.5", children: [
|
|
8293
8324
|
a && /* @__PURE__ */ l("span", { className: "text-pink-600 dark:text-pink-400", children: [
|
|
8294
8325
|
'"',
|
|
8295
8326
|
a,
|
|
@@ -8299,7 +8330,7 @@ function Ce({ value: t, depth: i, keyName: a, maxDepth: r }) {
|
|
|
8299
8330
|
/* @__PURE__ */ e("span", { className: "text-zinc-500 italic", children: "[max depth reached]" })
|
|
8300
8331
|
] });
|
|
8301
8332
|
if (t === null)
|
|
8302
|
-
return /* @__PURE__ */ l("div", { style: { marginLeft:
|
|
8333
|
+
return /* @__PURE__ */ l("div", { style: { marginLeft: i }, className: "py-0.5", children: [
|
|
8303
8334
|
a && /* @__PURE__ */ l("span", { className: "text-pink-600 dark:text-pink-400", children: [
|
|
8304
8335
|
'"',
|
|
8305
8336
|
a,
|
|
@@ -8309,7 +8340,7 @@ function Ce({ value: t, depth: i, keyName: a, maxDepth: r }) {
|
|
|
8309
8340
|
/* @__PURE__ */ e("span", { className: "text-gray-500 dark:text-zinc-500", children: "null" })
|
|
8310
8341
|
] });
|
|
8311
8342
|
if (typeof t == "boolean")
|
|
8312
|
-
return /* @__PURE__ */ l("div", { style: { marginLeft:
|
|
8343
|
+
return /* @__PURE__ */ l("div", { style: { marginLeft: i }, className: "py-0.5", children: [
|
|
8313
8344
|
a && /* @__PURE__ */ l("span", { className: "text-pink-600 dark:text-pink-400", children: [
|
|
8314
8345
|
'"',
|
|
8315
8346
|
a,
|
|
@@ -8319,7 +8350,7 @@ function Ce({ value: t, depth: i, keyName: a, maxDepth: r }) {
|
|
|
8319
8350
|
/* @__PURE__ */ e("span", { className: "text-blue-600 dark:text-blue-400", children: t.toString() })
|
|
8320
8351
|
] });
|
|
8321
8352
|
if (typeof t == "number")
|
|
8322
|
-
return /* @__PURE__ */ l("div", { style: { marginLeft:
|
|
8353
|
+
return /* @__PURE__ */ l("div", { style: { marginLeft: i }, className: "py-0.5", children: [
|
|
8323
8354
|
a && /* @__PURE__ */ l("span", { className: "text-pink-600 dark:text-pink-400", children: [
|
|
8324
8355
|
'"',
|
|
8325
8356
|
a,
|
|
@@ -8329,8 +8360,8 @@ function Ce({ value: t, depth: i, keyName: a, maxDepth: r }) {
|
|
|
8329
8360
|
/* @__PURE__ */ e("span", { className: "text-green-600 dark:text-green-400", children: t })
|
|
8330
8361
|
] });
|
|
8331
8362
|
if (typeof t == "string") {
|
|
8332
|
-
const
|
|
8333
|
-
return /* @__PURE__ */ l("div", { style: { marginLeft:
|
|
8363
|
+
const o = t.length > 100 ? t.slice(0, 100) + "..." : t;
|
|
8364
|
+
return /* @__PURE__ */ l("div", { style: { marginLeft: i }, className: "py-0.5", children: [
|
|
8334
8365
|
a && /* @__PURE__ */ l("span", { className: "text-pink-600 dark:text-pink-400", children: [
|
|
8335
8366
|
'"',
|
|
8336
8367
|
a,
|
|
@@ -8339,14 +8370,14 @@ function Ce({ value: t, depth: i, keyName: a, maxDepth: r }) {
|
|
|
8339
8370
|
a && /* @__PURE__ */ e("span", { className: "text-gray-600 dark:text-zinc-400", children: ": " }),
|
|
8340
8371
|
/* @__PURE__ */ l("span", { className: "text-amber-600 dark:text-amber-400", children: [
|
|
8341
8372
|
'"',
|
|
8342
|
-
|
|
8373
|
+
o,
|
|
8343
8374
|
'"'
|
|
8344
8375
|
] })
|
|
8345
8376
|
] });
|
|
8346
8377
|
}
|
|
8347
8378
|
if (Array.isArray(t)) {
|
|
8348
|
-
const
|
|
8349
|
-
return /* @__PURE__ */ l("div", { style: { marginLeft:
|
|
8379
|
+
const o = t.slice(0, za), c = t.length - o.length;
|
|
8380
|
+
return /* @__PURE__ */ l("div", { style: { marginLeft: i }, children: [
|
|
8350
8381
|
a && /* @__PURE__ */ l("div", { className: "py-0.5", children: [
|
|
8351
8382
|
/* @__PURE__ */ l("span", { className: "text-pink-600 dark:text-pink-400", children: [
|
|
8352
8383
|
'"',
|
|
@@ -8361,8 +8392,8 @@ function Ce({ value: t, depth: i, keyName: a, maxDepth: r }) {
|
|
|
8361
8392
|
] })
|
|
8362
8393
|
] }),
|
|
8363
8394
|
!a && /* @__PURE__ */ e("span", { className: "text-gray-500 dark:text-zinc-500 py-0.5 block", children: "[" }),
|
|
8364
|
-
|
|
8365
|
-
c > 0 && /* @__PURE__ */ l("div", { style: { marginLeft: (
|
|
8395
|
+
o.map((m, s) => /* @__PURE__ */ e(Se, { value: m, depth: n + 1, maxDepth: r }, s)),
|
|
8396
|
+
c > 0 && /* @__PURE__ */ l("div", { style: { marginLeft: (n + 1) * 16 }, className: "py-0.5 text-zinc-500 italic", children: [
|
|
8366
8397
|
"...and ",
|
|
8367
8398
|
c,
|
|
8368
8399
|
" more items"
|
|
@@ -8371,8 +8402,8 @@ function Ce({ value: t, depth: i, keyName: a, maxDepth: r }) {
|
|
|
8371
8402
|
] });
|
|
8372
8403
|
}
|
|
8373
8404
|
if (typeof t == "object") {
|
|
8374
|
-
const
|
|
8375
|
-
return /* @__PURE__ */ l("div", { style: { marginLeft:
|
|
8405
|
+
const o = Object.entries(t);
|
|
8406
|
+
return /* @__PURE__ */ l("div", { style: { marginLeft: i }, children: [
|
|
8376
8407
|
a && /* @__PURE__ */ l("div", { className: "py-0.5", children: [
|
|
8377
8408
|
/* @__PURE__ */ l("span", { className: "text-pink-600 dark:text-pink-400", children: [
|
|
8378
8409
|
'"',
|
|
@@ -8383,25 +8414,25 @@ function Ce({ value: t, depth: i, keyName: a, maxDepth: r }) {
|
|
|
8383
8414
|
/* @__PURE__ */ e("span", { className: "text-gray-500 dark:text-zinc-500", children: "{" })
|
|
8384
8415
|
] }),
|
|
8385
8416
|
!a && /* @__PURE__ */ e("span", { className: "text-gray-500 dark:text-zinc-500 py-0.5 block", children: "{" }),
|
|
8386
|
-
|
|
8387
|
-
/* @__PURE__ */ e("div", { style: { marginLeft: a ? 0 :
|
|
8417
|
+
o.map(([c, m]) => /* @__PURE__ */ e(Se, { value: m, depth: n + 1, keyName: c, maxDepth: r }, c)),
|
|
8418
|
+
/* @__PURE__ */ e("div", { style: { marginLeft: a ? 0 : i }, className: "py-0.5", children: /* @__PURE__ */ e("span", { className: "text-gray-500 dark:text-zinc-500", children: "}" }) })
|
|
8388
8419
|
] });
|
|
8389
8420
|
}
|
|
8390
8421
|
return null;
|
|
8391
8422
|
}
|
|
8392
|
-
function
|
|
8423
|
+
function et({ binding: t, className: n = "", size: a = "md" }) {
|
|
8393
8424
|
if (!t) return null;
|
|
8394
|
-
const r =
|
|
8425
|
+
const r = zr(t);
|
|
8395
8426
|
if (r.length === 0) return null;
|
|
8396
|
-
const
|
|
8427
|
+
const i = {
|
|
8397
8428
|
sm: "px-1 py-0.5 text-[10px] min-w-[16px]",
|
|
8398
8429
|
md: "px-1.5 py-0.5 text-xs min-w-[20px]"
|
|
8399
8430
|
};
|
|
8400
|
-
return /* @__PURE__ */ e("span", { className: `inline-flex items-center gap-0.5 ${
|
|
8431
|
+
return /* @__PURE__ */ e("span", { className: `inline-flex items-center gap-0.5 ${n}`, children: r.map((o, c) => /* @__PURE__ */ e(
|
|
8401
8432
|
"kbd",
|
|
8402
8433
|
{
|
|
8403
8434
|
className: `
|
|
8404
|
-
${
|
|
8435
|
+
${i[a]}
|
|
8405
8436
|
inline-flex items-center justify-center
|
|
8406
8437
|
font-mono font-medium
|
|
8407
8438
|
bg-zinc-200 dark:bg-zinc-700
|
|
@@ -8410,12 +8441,12 @@ function Xe({ binding: t, className: i = "", size: a = "md" }) {
|
|
|
8410
8441
|
rounded
|
|
8411
8442
|
shadow-sm
|
|
8412
8443
|
`,
|
|
8413
|
-
children:
|
|
8444
|
+
children: o
|
|
8414
8445
|
},
|
|
8415
8446
|
c
|
|
8416
8447
|
)) });
|
|
8417
8448
|
}
|
|
8418
|
-
const
|
|
8449
|
+
const La = [
|
|
8419
8450
|
"a[href]",
|
|
8420
8451
|
"button:not([disabled])",
|
|
8421
8452
|
"input:not([disabled])",
|
|
@@ -8423,14 +8454,14 @@ const Ia = [
|
|
|
8423
8454
|
"textarea:not([disabled])",
|
|
8424
8455
|
'[tabindex]:not([tabindex="-1"])'
|
|
8425
8456
|
].join(", ");
|
|
8426
|
-
function
|
|
8427
|
-
const
|
|
8428
|
-
|
|
8429
|
-
).filter((
|
|
8457
|
+
function We(t) {
|
|
8458
|
+
const n = X(null), a = X(null), r = A(() => n.current ? Array.from(
|
|
8459
|
+
n.current.querySelectorAll(La)
|
|
8460
|
+
).filter((i) => i.offsetParent !== null) : [], []);
|
|
8430
8461
|
return G(() => {
|
|
8431
8462
|
if (!t) return;
|
|
8432
8463
|
a.current = document.activeElement;
|
|
8433
|
-
const
|
|
8464
|
+
const i = (c) => {
|
|
8434
8465
|
if (c.key !== "Tab") return;
|
|
8435
8466
|
const m = r();
|
|
8436
8467
|
if (m.length === 0) return;
|
|
@@ -8444,38 +8475,38 @@ function Ae(t) {
|
|
|
8444
8475
|
return;
|
|
8445
8476
|
}
|
|
8446
8477
|
};
|
|
8447
|
-
document.addEventListener("keydown",
|
|
8448
|
-
const
|
|
8449
|
-
return
|
|
8450
|
-
|
|
8478
|
+
document.addEventListener("keydown", i);
|
|
8479
|
+
const o = r();
|
|
8480
|
+
return o.length > 0 && window.requestAnimationFrame(() => {
|
|
8481
|
+
o[0].focus();
|
|
8451
8482
|
}), () => {
|
|
8452
8483
|
var c;
|
|
8453
|
-
document.removeEventListener("keydown",
|
|
8484
|
+
document.removeEventListener("keydown", i), (c = a.current) != null && c.focus && a.current.focus();
|
|
8454
8485
|
};
|
|
8455
|
-
}, [t, r]),
|
|
8486
|
+
}, [t, r]), n;
|
|
8456
8487
|
}
|
|
8457
|
-
function
|
|
8488
|
+
function Aa(t, n, a, r) {
|
|
8458
8489
|
switch (t.id) {
|
|
8459
8490
|
case "save":
|
|
8460
8491
|
case "exportWorkflow":
|
|
8461
|
-
return
|
|
8492
|
+
return n.length === 0 ? "Add nodes to your workflow first" : null;
|
|
8462
8493
|
case "execute":
|
|
8463
|
-
return
|
|
8494
|
+
return n.length === 0 ? "Add nodes to your workflow first" : r === "running" ? "Workflow is already running" : null;
|
|
8464
8495
|
case "duplicate":
|
|
8465
8496
|
return a ? null : "Select a node first";
|
|
8466
8497
|
default:
|
|
8467
8498
|
return null;
|
|
8468
8499
|
}
|
|
8469
8500
|
}
|
|
8470
|
-
function
|
|
8471
|
-
const
|
|
8501
|
+
function Wa({ onToggleAIChat: t }) {
|
|
8502
|
+
const n = E((v) => v.showCommandPalette), a = E((v) => v.closeCommandPalette), r = E((v) => v.keyboard), [i, o] = _(""), c = at(i), [m, s] = _(0), g = ye(), p = We(n), d = X(null), b = w((v) => v.nodes), f = w((v) => v.selectedNodeId), k = w((v) => v.execution), x = w((v) => v.saveWorkflow), z = w((v) => v.execute), C = w((v) => v.duplicateNode), u = w((v) => v.toggleLibrary), h = w((v) => v.newWorkflow), y = E((v) => v.openSettings), P = E((v) => v.openShortcutsModal), B = E((v) => v.openExport), T = E((v) => v.openImport), N = E((v) => v.requestNewWorkflow), L = w((v) => v.hasUnsavedChanges), S = A(
|
|
8472
8503
|
(v) => {
|
|
8473
8504
|
var U;
|
|
8474
|
-
const R =
|
|
8505
|
+
const R = me.find((J) => J.action === v);
|
|
8475
8506
|
return R ? ((U = r == null ? void 0 : r.shortcuts) == null ? void 0 : U[v]) !== void 0 ? r.shortcuts[v] ?? null : R.defaultBinding : null;
|
|
8476
8507
|
},
|
|
8477
8508
|
[r]
|
|
8478
|
-
), O =
|
|
8509
|
+
), O = de(() => [
|
|
8479
8510
|
// Workflow commands
|
|
8480
8511
|
{
|
|
8481
8512
|
id: "save",
|
|
@@ -8591,7 +8622,7 @@ function Aa({ onToggleAIChat: t }) {
|
|
|
8591
8622
|
S,
|
|
8592
8623
|
a,
|
|
8593
8624
|
N
|
|
8594
|
-
]), $ =
|
|
8625
|
+
]), $ = de(() => {
|
|
8595
8626
|
if (!c.trim()) return O;
|
|
8596
8627
|
const v = c.toLowerCase();
|
|
8597
8628
|
return O.filter((R) => {
|
|
@@ -8599,7 +8630,7 @@ function Aa({ onToggleAIChat: t }) {
|
|
|
8599
8630
|
const U = R.name.toLowerCase().includes(v), J = (Z = R.keywords) == null ? void 0 : Z.some((Q) => Q.toLowerCase().includes(v));
|
|
8600
8631
|
return U || J;
|
|
8601
8632
|
});
|
|
8602
|
-
}, [O, c]), K =
|
|
8633
|
+
}, [O, c]), K = de(() => {
|
|
8603
8634
|
const v = {
|
|
8604
8635
|
workflow: [],
|
|
8605
8636
|
editing: [],
|
|
@@ -8614,8 +8645,8 @@ function Aa({ onToggleAIChat: t }) {
|
|
|
8614
8645
|
G(() => {
|
|
8615
8646
|
s(0);
|
|
8616
8647
|
}, [c]), G(() => {
|
|
8617
|
-
|
|
8618
|
-
}, [
|
|
8648
|
+
n && (o(""), s(0));
|
|
8649
|
+
}, [n]);
|
|
8619
8650
|
const F = A(
|
|
8620
8651
|
(v) => {
|
|
8621
8652
|
if (v.key === "Escape") {
|
|
@@ -8644,8 +8675,8 @@ function Aa({ onToggleAIChat: t }) {
|
|
|
8644
8675
|
const v = d.current.querySelector(`[data-index="${m}"]`);
|
|
8645
8676
|
v && v.scrollIntoView({ block: "nearest" });
|
|
8646
8677
|
}
|
|
8647
|
-
}, [m]), !
|
|
8648
|
-
const
|
|
8678
|
+
}, [m]), !n) return null;
|
|
8679
|
+
const ne = [
|
|
8649
8680
|
"workflow",
|
|
8650
8681
|
"editing",
|
|
8651
8682
|
"ui",
|
|
@@ -8696,8 +8727,8 @@ function Aa({ onToggleAIChat: t }) {
|
|
|
8696
8727
|
{
|
|
8697
8728
|
type: "text",
|
|
8698
8729
|
placeholder: "Type a command or search...",
|
|
8699
|
-
value:
|
|
8700
|
-
onChange: (v) =>
|
|
8730
|
+
value: i,
|
|
8731
|
+
onChange: (v) => o(v.target.value),
|
|
8701
8732
|
onKeyDown: F,
|
|
8702
8733
|
"aria-label": "Search commands",
|
|
8703
8734
|
autoFocus: !0,
|
|
@@ -8706,12 +8737,12 @@ function Aa({ onToggleAIChat: t }) {
|
|
|
8706
8737
|
),
|
|
8707
8738
|
/* @__PURE__ */ e("kbd", { className: "px-1.5 py-0.5 text-xs font-mono bg-zinc-100 dark:bg-zinc-700 text-zinc-500 border border-zinc-200 dark:border-zinc-600 rounded", children: "Esc" })
|
|
8708
8739
|
] }),
|
|
8709
|
-
/* @__PURE__ */ e("div", { ref: d, className: "max-h-80 overflow-y-auto py-2", children: $.length === 0 ? /* @__PURE__ */ e("div", { className: "px-4 py-8 text-center text-zinc-500 dark:text-zinc-400 text-sm", children: "No commands found" }) :
|
|
8740
|
+
/* @__PURE__ */ e("div", { ref: d, className: "max-h-80 overflow-y-auto py-2", children: $.length === 0 ? /* @__PURE__ */ e("div", { className: "px-4 py-8 text-center text-zinc-500 dark:text-zinc-400 text-sm", children: "No commands found" }) : ne.map((v) => {
|
|
8710
8741
|
const R = K[v];
|
|
8711
8742
|
return R.length === 0 ? null : /* @__PURE__ */ l("div", { className: "mb-2", children: [
|
|
8712
|
-
/* @__PURE__ */ e("div", { className: "px-4 py-1 text-xs font-semibold text-zinc-500 dark:text-zinc-400 uppercase tracking-wider", children:
|
|
8743
|
+
/* @__PURE__ */ e("div", { className: "px-4 py-1 text-xs font-semibold text-zinc-500 dark:text-zinc-400 uppercase tracking-wider", children: qe[v] || v }),
|
|
8713
8744
|
R.map((U) => {
|
|
8714
|
-
const J = V(), Z = J === m, Q = !U.enabled || U.enabled(),
|
|
8745
|
+
const J = V(), Z = J === m, Q = !U.enabled || U.enabled(), le = Q ? null : Aa(U, b, f, k.status);
|
|
8715
8746
|
return /* @__PURE__ */ l(
|
|
8716
8747
|
"button",
|
|
8717
8748
|
{
|
|
@@ -8720,7 +8751,7 @@ function Aa({ onToggleAIChat: t }) {
|
|
|
8720
8751
|
Q && (U.action(), a == null || a());
|
|
8721
8752
|
},
|
|
8722
8753
|
disabled: !Q,
|
|
8723
|
-
title:
|
|
8754
|
+
title: le ?? void 0,
|
|
8724
8755
|
className: `
|
|
8725
8756
|
w-full flex items-center justify-between px-4 py-2 text-left
|
|
8726
8757
|
${Z ? "bg-teal-50 dark:bg-teal-900/30" : "hover:bg-zinc-50 dark:hover:bg-zinc-700/50"}
|
|
@@ -8734,7 +8765,7 @@ function Aa({ onToggleAIChat: t }) {
|
|
|
8734
8765
|
children: U.name
|
|
8735
8766
|
}
|
|
8736
8767
|
),
|
|
8737
|
-
U.shortcut && /* @__PURE__ */ e(
|
|
8768
|
+
U.shortcut && /* @__PURE__ */ e(et, { binding: U.shortcut, size: "sm" })
|
|
8738
8769
|
]
|
|
8739
8770
|
},
|
|
8740
8771
|
U.id
|
|
@@ -8763,13 +8794,13 @@ function Aa({ onToggleAIChat: t }) {
|
|
|
8763
8794
|
}
|
|
8764
8795
|
);
|
|
8765
8796
|
}
|
|
8766
|
-
function
|
|
8767
|
-
const t = E((p) => p.showShortcutsModal),
|
|
8797
|
+
function _a() {
|
|
8798
|
+
const t = E((p) => p.showShortcutsModal), n = E((p) => p.closeShortcutsModal), a = E((p) => p.keyboard), [r, i] = _(""), o = ye(), c = We(t), m = (p) => {
|
|
8768
8799
|
var b;
|
|
8769
|
-
const d =
|
|
8800
|
+
const d = me.find((f) => f.action === p);
|
|
8770
8801
|
return d ? ((b = a == null ? void 0 : a.shortcuts) == null ? void 0 : b[p]) !== void 0 ? a.shortcuts[p] ?? null : d.defaultBinding : null;
|
|
8771
|
-
}, s =
|
|
8772
|
-
const p =
|
|
8802
|
+
}, s = de(() => {
|
|
8803
|
+
const p = Mt();
|
|
8773
8804
|
if (r.trim()) {
|
|
8774
8805
|
const d = r.toLowerCase(), b = {
|
|
8775
8806
|
workflow: [],
|
|
@@ -8790,7 +8821,7 @@ function Wa() {
|
|
|
8790
8821
|
{
|
|
8791
8822
|
className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50",
|
|
8792
8823
|
onClick: (p) => {
|
|
8793
|
-
p.target === p.currentTarget &&
|
|
8824
|
+
p.target === p.currentTarget && n();
|
|
8794
8825
|
},
|
|
8795
8826
|
children: /* @__PURE__ */ l(
|
|
8796
8827
|
"div",
|
|
@@ -8798,15 +8829,15 @@ function Wa() {
|
|
|
8798
8829
|
ref: c,
|
|
8799
8830
|
role: "dialog",
|
|
8800
8831
|
"aria-modal": "true",
|
|
8801
|
-
"aria-labelledby":
|
|
8832
|
+
"aria-labelledby": o,
|
|
8802
8833
|
className: "bg-white dark:bg-zinc-800 rounded-xl shadow-2xl max-w-lg w-full mx-4 max-h-[80vh] flex flex-col overflow-hidden",
|
|
8803
8834
|
children: [
|
|
8804
8835
|
/* @__PURE__ */ l("div", { className: "flex items-center justify-between px-4 py-3 border-b border-zinc-200 dark:border-zinc-700", children: [
|
|
8805
|
-
/* @__PURE__ */ e("h2", { id:
|
|
8836
|
+
/* @__PURE__ */ e("h2", { id: o, className: "text-lg font-semibold text-zinc-900 dark:text-zinc-100", children: "Keyboard Shortcuts" }),
|
|
8806
8837
|
/* @__PURE__ */ e(
|
|
8807
8838
|
"button",
|
|
8808
8839
|
{
|
|
8809
|
-
onClick:
|
|
8840
|
+
onClick: n,
|
|
8810
8841
|
"aria-label": "Close keyboard shortcuts",
|
|
8811
8842
|
className: "p-1 text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200 rounded-lg hover:bg-zinc-100 dark:hover:bg-zinc-700",
|
|
8812
8843
|
children: /* @__PURE__ */ e(
|
|
@@ -8837,7 +8868,7 @@ function Wa() {
|
|
|
8837
8868
|
type: "text",
|
|
8838
8869
|
placeholder: "Search shortcuts...",
|
|
8839
8870
|
value: r,
|
|
8840
|
-
onChange: (p) =>
|
|
8871
|
+
onChange: (p) => i(p.target.value),
|
|
8841
8872
|
"aria-label": "Search shortcuts",
|
|
8842
8873
|
autoFocus: !0,
|
|
8843
8874
|
className: "w-full px-3 py-2 text-sm bg-zinc-100 dark:bg-zinc-700 border border-zinc-200 dark:border-zinc-600 rounded-lg focus:outline-none focus:ring-2 focus:ring-teal-500 focus:border-transparent text-zinc-900 dark:text-zinc-100 placeholder-zinc-500"
|
|
@@ -8846,7 +8877,7 @@ function Wa() {
|
|
|
8846
8877
|
/* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto px-4 py-2", children: ["workflow", "editing", "canvas", "ui"].map((p) => {
|
|
8847
8878
|
const d = s[p];
|
|
8848
8879
|
return d.length === 0 ? null : /* @__PURE__ */ l("div", { className: "mb-4", children: [
|
|
8849
|
-
/* @__PURE__ */ e("h3", { className: "text-xs font-semibold text-zinc-500 dark:text-zinc-400 uppercase tracking-wider mb-2", children:
|
|
8880
|
+
/* @__PURE__ */ e("h3", { className: "text-xs font-semibold text-zinc-500 dark:text-zinc-400 uppercase tracking-wider mb-2", children: qe[p] }),
|
|
8850
8881
|
/* @__PURE__ */ e("div", { className: "space-y-1", children: d.map((b) => {
|
|
8851
8882
|
const f = m(b.action);
|
|
8852
8883
|
return /* @__PURE__ */ l(
|
|
@@ -8858,7 +8889,7 @@ function Wa() {
|
|
|
8858
8889
|
/* @__PURE__ */ e("div", { className: "text-sm font-medium text-zinc-800 dark:text-zinc-200", children: b.name }),
|
|
8859
8890
|
/* @__PURE__ */ e("div", { className: "text-xs text-zinc-500 dark:text-zinc-400 truncate", children: b.description })
|
|
8860
8891
|
] }),
|
|
8861
|
-
/* @__PURE__ */ e("div", { className: "ml-4 flex-shrink-0", children: f ? /* @__PURE__ */ e(
|
|
8892
|
+
/* @__PURE__ */ e("div", { className: "ml-4 flex-shrink-0", children: f ? /* @__PURE__ */ e(et, { binding: f, size: "sm" }) : /* @__PURE__ */ e("span", { className: "text-xs text-zinc-400 dark:text-zinc-500", children: "Not set" }) })
|
|
8862
8893
|
]
|
|
8863
8894
|
},
|
|
8864
8895
|
b.action
|
|
@@ -8871,7 +8902,7 @@ function Wa() {
|
|
|
8871
8902
|
/* @__PURE__ */ e(
|
|
8872
8903
|
"button",
|
|
8873
8904
|
{
|
|
8874
|
-
onClick:
|
|
8905
|
+
onClick: n,
|
|
8875
8906
|
className: "px-3 py-1.5 text-sm font-medium text-white bg-teal-600 hover:bg-teal-700 rounded-lg",
|
|
8876
8907
|
children: "Done"
|
|
8877
8908
|
}
|
|
@@ -8883,17 +8914,17 @@ function Wa() {
|
|
|
8883
8914
|
}
|
|
8884
8915
|
) : null;
|
|
8885
8916
|
}
|
|
8886
|
-
function
|
|
8917
|
+
function Ma({
|
|
8887
8918
|
isOpen: t,
|
|
8888
|
-
title:
|
|
8919
|
+
title: n,
|
|
8889
8920
|
message: a,
|
|
8890
8921
|
confirmText: r = "Confirm",
|
|
8891
|
-
cancelText:
|
|
8892
|
-
onConfirm:
|
|
8922
|
+
cancelText: i = "Cancel",
|
|
8923
|
+
onConfirm: o,
|
|
8893
8924
|
onCancel: c,
|
|
8894
8925
|
destructive: m = !1
|
|
8895
8926
|
}) {
|
|
8896
|
-
const s =
|
|
8927
|
+
const s = ye(), g = ye(), p = We(t), d = A(
|
|
8897
8928
|
(b) => {
|
|
8898
8929
|
b.key === "Escape" && c();
|
|
8899
8930
|
},
|
|
@@ -8920,7 +8951,7 @@ function _a({
|
|
|
8920
8951
|
className: "bg-white dark:bg-zinc-800 rounded-xl shadow-2xl max-w-sm w-full mx-4 overflow-hidden",
|
|
8921
8952
|
children: [
|
|
8922
8953
|
/* @__PURE__ */ l("div", { className: "px-6 py-4", children: [
|
|
8923
|
-
/* @__PURE__ */ e("h2", { id: s, className: "text-lg font-semibold text-zinc-900 dark:text-zinc-100", children:
|
|
8954
|
+
/* @__PURE__ */ e("h2", { id: s, className: "text-lg font-semibold text-zinc-900 dark:text-zinc-100", children: n }),
|
|
8924
8955
|
/* @__PURE__ */ e("p", { id: g, className: "mt-2 text-sm text-zinc-600 dark:text-zinc-400", children: a })
|
|
8925
8956
|
] }),
|
|
8926
8957
|
/* @__PURE__ */ l("div", { className: "flex items-center justify-end gap-3 px-6 py-4 border-t border-zinc-200 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-800/50", children: [
|
|
@@ -8930,14 +8961,14 @@ function _a({
|
|
|
8930
8961
|
type: "button",
|
|
8931
8962
|
onClick: c,
|
|
8932
8963
|
className: "px-4 py-2 text-sm font-medium text-zinc-700 dark:text-zinc-300 bg-white dark:bg-zinc-700 border border-zinc-300 dark:border-zinc-600 rounded-lg hover:bg-zinc-50 dark:hover:bg-zinc-600 focus:outline-none focus:ring-2 focus:ring-teal-500 focus:ring-offset-2 dark:focus:ring-offset-zinc-800",
|
|
8933
|
-
children:
|
|
8964
|
+
children: i
|
|
8934
8965
|
}
|
|
8935
8966
|
),
|
|
8936
8967
|
/* @__PURE__ */ e(
|
|
8937
8968
|
"button",
|
|
8938
8969
|
{
|
|
8939
8970
|
type: "button",
|
|
8940
|
-
onClick:
|
|
8971
|
+
onClick: o,
|
|
8941
8972
|
autoFocus: !0,
|
|
8942
8973
|
className: `px-4 py-2 text-sm font-medium rounded-lg focus:outline-none focus:ring-2 focus:ring-offset-2 dark:focus:ring-offset-zinc-800 ${m ? "text-white bg-red-600 hover:bg-red-700 focus:ring-red-500" : "text-white bg-teal-600 hover:bg-teal-700 focus:ring-teal-500"}`,
|
|
8943
8974
|
children: r
|
|
@@ -8950,42 +8981,42 @@ function _a({
|
|
|
8950
8981
|
}
|
|
8951
8982
|
) : null;
|
|
8952
8983
|
}
|
|
8953
|
-
function
|
|
8954
|
-
return
|
|
8984
|
+
function Pa({ onToggleAIChat: t }) {
|
|
8985
|
+
return kr({ onToggleAIChat: t }), null;
|
|
8955
8986
|
}
|
|
8956
|
-
function
|
|
8957
|
-
const { screenToFlowPosition: t } =
|
|
8958
|
-
(
|
|
8959
|
-
|
|
8960
|
-
const
|
|
8961
|
-
if (
|
|
8987
|
+
function Ta() {
|
|
8988
|
+
const { screenToFlowPosition: t } = De(), n = w((i) => i.addNode), a = A(
|
|
8989
|
+
(i) => {
|
|
8990
|
+
i.preventDefault();
|
|
8991
|
+
const o = i.dataTransfer.getData("application/json");
|
|
8992
|
+
if (o)
|
|
8962
8993
|
try {
|
|
8963
|
-
const c = JSON.parse(
|
|
8964
|
-
x:
|
|
8965
|
-
y:
|
|
8994
|
+
const c = JSON.parse(o), m = t({
|
|
8995
|
+
x: i.clientX,
|
|
8996
|
+
y: i.clientY
|
|
8966
8997
|
});
|
|
8967
|
-
|
|
8998
|
+
n(c, m);
|
|
8968
8999
|
} catch (c) {
|
|
8969
9000
|
console.error("Failed to parse dropped node:", c);
|
|
8970
9001
|
}
|
|
8971
9002
|
},
|
|
8972
|
-
[
|
|
8973
|
-
), r = A((
|
|
8974
|
-
|
|
9003
|
+
[n, t]
|
|
9004
|
+
), r = A((i) => {
|
|
9005
|
+
i.preventDefault(), i.dataTransfer.dropEffect = "move";
|
|
8975
9006
|
}, []);
|
|
8976
|
-
return /* @__PURE__ */ e("div", { className: "flex-1", onDrop: a, onDragOver: r, children: /* @__PURE__ */ e(
|
|
9007
|
+
return /* @__PURE__ */ e("div", { className: "flex-1", onDrop: a, onDragOver: r, children: /* @__PURE__ */ e(Zt, {}) });
|
|
8977
9008
|
}
|
|
8978
|
-
function
|
|
8979
|
-
const [t,
|
|
9009
|
+
function qa() {
|
|
9010
|
+
const [t, n] = _("editor"), [a, r] = _(!1), i = w((h) => h.loadTemplate), o = w((h) => h.loadGeneratedWorkflow), c = w((h) => h.inspectedNodeId), m = w((h) => h.execution.dataOutputs), s = w((h) => h.closeOutputInspector), g = w((h) => h.nodes), p = w((h) => h.selectedNodeId), d = c ? g.find((h) => h.id === c) : null, b = c ? m[c] : null;
|
|
8980
9011
|
G(() => {
|
|
8981
9012
|
const y = new URLSearchParams(window.location.search).get("template");
|
|
8982
9013
|
if (y) {
|
|
8983
|
-
const P =
|
|
8984
|
-
P && (
|
|
9014
|
+
const P = Ee(y);
|
|
9015
|
+
P && (i(P), window.history.replaceState({}, "", window.location.pathname));
|
|
8985
9016
|
}
|
|
8986
|
-
}, [
|
|
9017
|
+
}, [i]), G(() => {
|
|
8987
9018
|
const h = () => {
|
|
8988
|
-
|
|
9019
|
+
n("editor");
|
|
8989
9020
|
};
|
|
8990
9021
|
return window.addEventListener("workflow-loaded", h), () => {
|
|
8991
9022
|
window.removeEventListener("workflow-loaded", h);
|
|
@@ -8993,24 +9024,24 @@ function Ua() {
|
|
|
8993
9024
|
}, []);
|
|
8994
9025
|
const f = A(
|
|
8995
9026
|
(h) => {
|
|
8996
|
-
const y =
|
|
8997
|
-
y && (
|
|
9027
|
+
const y = Ee(h);
|
|
9028
|
+
y && (i(y), n("editor"));
|
|
8998
9029
|
},
|
|
8999
|
-
[
|
|
9030
|
+
[i]
|
|
9000
9031
|
), k = A(
|
|
9001
9032
|
(h) => {
|
|
9002
|
-
|
|
9033
|
+
o(h), n("editor");
|
|
9003
9034
|
},
|
|
9004
|
-
[
|
|
9035
|
+
[o]
|
|
9005
9036
|
), x = A(() => {
|
|
9006
9037
|
r((h) => !h);
|
|
9007
9038
|
}, []), z = E((h) => h.showNewWorkflowConfirm), C = E((h) => h.confirmNewWorkflow), u = E((h) => h.cancelNewWorkflow);
|
|
9008
|
-
return /* @__PURE__ */ l(
|
|
9009
|
-
/* @__PURE__ */ e(
|
|
9010
|
-
/* @__PURE__ */ e(
|
|
9011
|
-
/* @__PURE__ */ e(
|
|
9039
|
+
return /* @__PURE__ */ l(pt, { children: [
|
|
9040
|
+
/* @__PURE__ */ e(Pa, { onToggleAIChat: x }),
|
|
9041
|
+
/* @__PURE__ */ e(Wa, { onToggleAIChat: x }),
|
|
9042
|
+
/* @__PURE__ */ e(_a, {}),
|
|
9012
9043
|
/* @__PURE__ */ e(
|
|
9013
|
-
|
|
9044
|
+
Ma,
|
|
9014
9045
|
{
|
|
9015
9046
|
isOpen: z,
|
|
9016
9047
|
title: "Unsaved Changes",
|
|
@@ -9022,9 +9053,9 @@ function Ua() {
|
|
|
9022
9053
|
destructive: !0
|
|
9023
9054
|
}
|
|
9024
9055
|
),
|
|
9025
|
-
/* @__PURE__ */ e(
|
|
9056
|
+
/* @__PURE__ */ e(ka, {}),
|
|
9026
9057
|
/* @__PURE__ */ e(
|
|
9027
|
-
|
|
9058
|
+
va,
|
|
9028
9059
|
{
|
|
9029
9060
|
isOpen: a,
|
|
9030
9061
|
onClose: () => r(!1),
|
|
@@ -9032,7 +9063,7 @@ function Ua() {
|
|
|
9032
9063
|
}
|
|
9033
9064
|
),
|
|
9034
9065
|
d && b && /* @__PURE__ */ e(
|
|
9035
|
-
|
|
9066
|
+
Sa,
|
|
9036
9067
|
{
|
|
9037
9068
|
isOpen: !0,
|
|
9038
9069
|
onClose: s,
|
|
@@ -9041,15 +9072,15 @@ function Ua() {
|
|
|
9041
9072
|
output: b
|
|
9042
9073
|
}
|
|
9043
9074
|
),
|
|
9044
|
-
/* @__PURE__ */ e(
|
|
9075
|
+
/* @__PURE__ */ e(ha, {}),
|
|
9045
9076
|
/* @__PURE__ */ l("div", { className: "floimg-studio h-screen flex flex-col bg-gray-100 dark:bg-zinc-900", children: [
|
|
9046
|
-
/* @__PURE__ */ e(
|
|
9077
|
+
/* @__PURE__ */ e(Wr, {}),
|
|
9047
9078
|
/* @__PURE__ */ e("div", { className: "floimg-tabs", children: /* @__PURE__ */ l("div", { className: "flex items-center justify-between", children: [
|
|
9048
9079
|
/* @__PURE__ */ l("div", { className: "flex", children: [
|
|
9049
9080
|
/* @__PURE__ */ e(
|
|
9050
9081
|
"button",
|
|
9051
9082
|
{
|
|
9052
|
-
onClick: () =>
|
|
9083
|
+
onClick: () => n("editor"),
|
|
9053
9084
|
className: `floimg-tab ${t === "editor" ? "floimg-tab--active" : ""}`,
|
|
9054
9085
|
children: "Editor"
|
|
9055
9086
|
}
|
|
@@ -9057,7 +9088,7 @@ function Ua() {
|
|
|
9057
9088
|
/* @__PURE__ */ e(
|
|
9058
9089
|
"button",
|
|
9059
9090
|
{
|
|
9060
|
-
onClick: () =>
|
|
9091
|
+
onClick: () => n("gallery"),
|
|
9061
9092
|
className: `floimg-tab ${t === "gallery" ? "floimg-tab--active" : ""}`,
|
|
9062
9093
|
children: "Images"
|
|
9063
9094
|
}
|
|
@@ -9065,7 +9096,7 @@ function Ua() {
|
|
|
9065
9096
|
/* @__PURE__ */ e(
|
|
9066
9097
|
"button",
|
|
9067
9098
|
{
|
|
9068
|
-
onClick: () =>
|
|
9099
|
+
onClick: () => n("templates"),
|
|
9069
9100
|
className: `floimg-tab ${t === "templates" ? "floimg-tab--active" : ""}`,
|
|
9070
9101
|
children: "Templates"
|
|
9071
9102
|
}
|
|
@@ -9085,41 +9116,41 @@ function Ua() {
|
|
|
9085
9116
|
] })
|
|
9086
9117
|
] }) }),
|
|
9087
9118
|
/* @__PURE__ */ l("div", { className: "flex-1 flex overflow-hidden", children: [
|
|
9088
|
-
t === "editor" && /* @__PURE__ */ l(
|
|
9089
|
-
/* @__PURE__ */ e(
|
|
9090
|
-
/* @__PURE__ */ e(
|
|
9091
|
-
p && /* @__PURE__ */ e(
|
|
9119
|
+
t === "editor" && /* @__PURE__ */ l(se, { children: [
|
|
9120
|
+
/* @__PURE__ */ e(er, {}),
|
|
9121
|
+
/* @__PURE__ */ e(Ta, {}),
|
|
9122
|
+
p && /* @__PURE__ */ e(tr, {})
|
|
9092
9123
|
] }),
|
|
9093
|
-
t === "gallery" && /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: /* @__PURE__ */ e(
|
|
9094
|
-
t === "templates" && /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: /* @__PURE__ */ e(
|
|
9124
|
+
t === "gallery" && /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: /* @__PURE__ */ e(_r, {}) }),
|
|
9125
|
+
t === "templates" && /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: /* @__PURE__ */ e(ua, { onSelect: f }) })
|
|
9095
9126
|
] })
|
|
9096
9127
|
] })
|
|
9097
9128
|
] });
|
|
9098
9129
|
}
|
|
9099
9130
|
export {
|
|
9100
|
-
|
|
9101
|
-
|
|
9102
|
-
|
|
9103
|
-
|
|
9104
|
-
|
|
9105
|
-
|
|
9106
|
-
|
|
9107
|
-
|
|
9108
|
-
|
|
9131
|
+
va as AIChat,
|
|
9132
|
+
ka as AISettings,
|
|
9133
|
+
qa as App,
|
|
9134
|
+
qe as CATEGORY_NAMES,
|
|
9135
|
+
Wa as CommandPalette,
|
|
9136
|
+
_r as Gallery,
|
|
9137
|
+
_a as KeyboardShortcutsModal,
|
|
9138
|
+
tr as NodeInspector,
|
|
9139
|
+
er as NodePalette,
|
|
9109
9140
|
ee as NodePaletteItem,
|
|
9110
|
-
|
|
9111
|
-
|
|
9112
|
-
|
|
9113
|
-
|
|
9114
|
-
|
|
9115
|
-
|
|
9116
|
-
|
|
9117
|
-
|
|
9118
|
-
|
|
9119
|
-
|
|
9120
|
-
|
|
9121
|
-
|
|
9122
|
-
|
|
9141
|
+
me as SHORTCUT_DEFINITIONS,
|
|
9142
|
+
ua as TemplateGallery,
|
|
9143
|
+
Wr as Toolbar,
|
|
9144
|
+
Xt as UploadGallery,
|
|
9145
|
+
Zt as WorkflowEditor,
|
|
9146
|
+
ha as WorkflowLibrary,
|
|
9147
|
+
pa as getCategories,
|
|
9148
|
+
Oa as getTemplateById,
|
|
9149
|
+
$a as getTemplatesByCategory,
|
|
9150
|
+
Ee as resolveTemplate,
|
|
9151
|
+
Ua as searchTemplates,
|
|
9152
|
+
be as templates,
|
|
9153
|
+
kr as useKeyboardShortcuts,
|
|
9123
9154
|
E as useSettingsStore,
|
|
9124
9155
|
w as useWorkflowStore
|
|
9125
9156
|
};
|