@teamflojo/floimg-studio-ui 0.2.1 → 0.2.3
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 +117 -0
- package/dist/components/Toolbar.d.ts +3 -1
- package/dist/index.js +895 -894
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { memo as E, useRef as Q, useCallback as L, useState as I, useEffect as D, useMemo as
|
|
3
|
-
import
|
|
4
|
-
import { create as
|
|
1
|
+
import { jsxs as o, jsx as e, Fragment as U } from "react/jsx-runtime";
|
|
2
|
+
import { memo as E, useRef as Q, useCallback as L, useState as I, useEffect as D, useMemo as oe } from "react";
|
|
3
|
+
import Ne, { Handle as A, Position as P, applyNodeChanges as ze, applyEdgeChanges as Ce, MarkerType as Ie, Background as Se, Controls as Le, MiniMap as We, ReactFlowProvider as Ae, useReactFlow as Pe } from "reactflow";
|
|
4
|
+
import { create as me } from "zustand";
|
|
5
5
|
import { useQuery as F } from "@tanstack/react-query";
|
|
6
|
-
function
|
|
6
|
+
function $e(r, l) {
|
|
7
7
|
let t;
|
|
8
8
|
try {
|
|
9
9
|
t = r();
|
|
@@ -11,13 +11,13 @@ function Pe(r, l) {
|
|
|
11
11
|
return;
|
|
12
12
|
}
|
|
13
13
|
return {
|
|
14
|
-
getItem: (
|
|
15
|
-
var
|
|
16
|
-
const
|
|
17
|
-
return d instanceof Promise ? d.then(
|
|
14
|
+
getItem: (i) => {
|
|
15
|
+
var s;
|
|
16
|
+
const p = (a) => a === null ? null : JSON.parse(a, void 0), d = (s = t.getItem(i)) != null ? s : null;
|
|
17
|
+
return d instanceof Promise ? d.then(p) : p(d);
|
|
18
18
|
},
|
|
19
|
-
setItem: (
|
|
20
|
-
removeItem: (
|
|
19
|
+
setItem: (i, s) => t.setItem(i, JSON.stringify(s, void 0)),
|
|
20
|
+
removeItem: (i) => t.removeItem(i)
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
23
|
const Y = (r) => (l) => {
|
|
@@ -41,61 +41,61 @@ const Y = (r) => (l) => {
|
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
|
-
},
|
|
45
|
-
let
|
|
46
|
-
storage:
|
|
44
|
+
}, Me = (r, l) => (t, n, i) => {
|
|
45
|
+
let s = {
|
|
46
|
+
storage: $e(() => localStorage),
|
|
47
47
|
partialize: (v) => v,
|
|
48
48
|
version: 0,
|
|
49
|
-
merge: (v,
|
|
50
|
-
...
|
|
49
|
+
merge: (v, w) => ({
|
|
50
|
+
...w,
|
|
51
51
|
...v
|
|
52
52
|
}),
|
|
53
53
|
...l
|
|
54
|
-
},
|
|
54
|
+
}, p = !1;
|
|
55
55
|
const d = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set();
|
|
56
|
-
let
|
|
57
|
-
if (!
|
|
56
|
+
let m = s.storage;
|
|
57
|
+
if (!m)
|
|
58
58
|
return r(
|
|
59
59
|
(...v) => {
|
|
60
60
|
console.warn(
|
|
61
|
-
`[zustand persist middleware] Unable to update item '${
|
|
61
|
+
`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`
|
|
62
62
|
), t(...v);
|
|
63
63
|
},
|
|
64
64
|
n,
|
|
65
|
-
|
|
65
|
+
i
|
|
66
66
|
);
|
|
67
67
|
const c = () => {
|
|
68
|
-
const v =
|
|
69
|
-
return
|
|
68
|
+
const v = s.partialize({ ...n() });
|
|
69
|
+
return m.setItem(s.name, {
|
|
70
70
|
state: v,
|
|
71
|
-
version:
|
|
71
|
+
version: s.version
|
|
72
72
|
});
|
|
73
|
-
}, u =
|
|
74
|
-
|
|
73
|
+
}, u = i.setState;
|
|
74
|
+
i.setState = (v, w) => (u(v, w), c());
|
|
75
75
|
const h = r(
|
|
76
76
|
(...v) => (t(...v), c()),
|
|
77
77
|
n,
|
|
78
|
-
|
|
78
|
+
i
|
|
79
79
|
);
|
|
80
|
-
|
|
80
|
+
i.getInitialState = () => h;
|
|
81
81
|
let f;
|
|
82
|
-
const
|
|
83
|
-
var v,
|
|
84
|
-
if (!
|
|
85
|
-
|
|
86
|
-
var
|
|
87
|
-
return g((
|
|
82
|
+
const y = () => {
|
|
83
|
+
var v, w;
|
|
84
|
+
if (!m) return;
|
|
85
|
+
p = !1, d.forEach((g) => {
|
|
86
|
+
var z;
|
|
87
|
+
return g((z = n()) != null ? z : h);
|
|
88
88
|
});
|
|
89
|
-
const b = ((
|
|
90
|
-
return Y(
|
|
89
|
+
const b = ((w = s.onRehydrateStorage) == null ? void 0 : w.call(s, (v = n()) != null ? v : h)) || void 0;
|
|
90
|
+
return Y(m.getItem.bind(m))(s.name).then((g) => {
|
|
91
91
|
if (g)
|
|
92
|
-
if (typeof g.version == "number" && g.version !==
|
|
93
|
-
if (
|
|
94
|
-
const
|
|
92
|
+
if (typeof g.version == "number" && g.version !== s.version) {
|
|
93
|
+
if (s.migrate) {
|
|
94
|
+
const z = s.migrate(
|
|
95
95
|
g.state,
|
|
96
96
|
g.version
|
|
97
97
|
);
|
|
98
|
-
return
|
|
98
|
+
return z instanceof Promise ? z.then((W) => [!0, W]) : [!0, z];
|
|
99
99
|
}
|
|
100
100
|
console.error(
|
|
101
101
|
"State loaded from storage couldn't be migrated since no migrate function was provided"
|
|
@@ -104,40 +104,40 @@ const Y = (r) => (l) => {
|
|
|
104
104
|
return [!1, g.state];
|
|
105
105
|
return [!1, void 0];
|
|
106
106
|
}).then((g) => {
|
|
107
|
-
var
|
|
107
|
+
var z;
|
|
108
108
|
const [W, x] = g;
|
|
109
|
-
if (f =
|
|
109
|
+
if (f = s.merge(
|
|
110
110
|
x,
|
|
111
|
-
(
|
|
111
|
+
(z = n()) != null ? z : h
|
|
112
112
|
), t(f, !0), W)
|
|
113
113
|
return c();
|
|
114
114
|
}).then(() => {
|
|
115
|
-
b == null || b(f, void 0), f = n(),
|
|
115
|
+
b == null || b(f, void 0), f = n(), p = !0, a.forEach((g) => g(f));
|
|
116
116
|
}).catch((g) => {
|
|
117
117
|
b == null || b(void 0, g);
|
|
118
118
|
});
|
|
119
119
|
};
|
|
120
|
-
return
|
|
120
|
+
return i.persist = {
|
|
121
121
|
setOptions: (v) => {
|
|
122
|
-
|
|
123
|
-
...
|
|
122
|
+
s = {
|
|
123
|
+
...s,
|
|
124
124
|
...v
|
|
125
|
-
}, v.storage && (
|
|
125
|
+
}, v.storage && (m = v.storage);
|
|
126
126
|
},
|
|
127
127
|
clearStorage: () => {
|
|
128
|
-
|
|
128
|
+
m == null || m.removeItem(s.name);
|
|
129
129
|
},
|
|
130
|
-
getOptions: () =>
|
|
131
|
-
rehydrate: () =>
|
|
132
|
-
hasHydrated: () =>
|
|
130
|
+
getOptions: () => s,
|
|
131
|
+
rehydrate: () => y(),
|
|
132
|
+
hasHydrated: () => p,
|
|
133
133
|
onHydrate: (v) => (d.add(v), () => {
|
|
134
134
|
d.delete(v);
|
|
135
135
|
}),
|
|
136
136
|
onFinishHydration: (v) => (a.add(v), () => {
|
|
137
137
|
a.delete(v);
|
|
138
138
|
})
|
|
139
|
-
},
|
|
140
|
-
},
|
|
139
|
+
}, s.skipHydration || y(), f || h;
|
|
140
|
+
}, pe = Me, $ = "/api";
|
|
141
141
|
async function j(r, l) {
|
|
142
142
|
const t = await fetch(r, {
|
|
143
143
|
...l,
|
|
@@ -152,44 +152,44 @@ async function j(r, l) {
|
|
|
152
152
|
}
|
|
153
153
|
return t.json();
|
|
154
154
|
}
|
|
155
|
-
async function
|
|
155
|
+
async function je() {
|
|
156
156
|
return j(`${$}/nodes/generators`);
|
|
157
157
|
}
|
|
158
|
-
async function
|
|
158
|
+
async function De() {
|
|
159
159
|
return j(`${$}/nodes/transforms`);
|
|
160
160
|
}
|
|
161
|
-
async function
|
|
161
|
+
async function Te() {
|
|
162
162
|
return j(`${$}/nodes/text`);
|
|
163
163
|
}
|
|
164
|
-
async function
|
|
164
|
+
async function Ue() {
|
|
165
165
|
return j(`${$}/nodes/vision`);
|
|
166
166
|
}
|
|
167
|
-
async function
|
|
167
|
+
async function Oe(r, l, t) {
|
|
168
168
|
return j(`${$}/execute/sync`, {
|
|
169
169
|
method: "POST",
|
|
170
170
|
body: JSON.stringify({ nodes: r, edges: l, aiProviders: t })
|
|
171
171
|
});
|
|
172
172
|
}
|
|
173
|
-
async function
|
|
173
|
+
async function Re(r, l) {
|
|
174
174
|
return j(`${$}/export/yaml`, {
|
|
175
175
|
method: "POST",
|
|
176
176
|
body: JSON.stringify({ nodes: r, edges: l })
|
|
177
177
|
});
|
|
178
178
|
}
|
|
179
|
-
async function
|
|
179
|
+
async function Ee() {
|
|
180
180
|
return j(`${$}/images`);
|
|
181
181
|
}
|
|
182
|
-
function
|
|
182
|
+
function se(r) {
|
|
183
183
|
return `${$}/images/${r}/blob`;
|
|
184
184
|
}
|
|
185
|
-
async function
|
|
185
|
+
async function Be(r) {
|
|
186
186
|
try {
|
|
187
187
|
return await j(`${$}/images/${r}/workflow`);
|
|
188
188
|
} catch {
|
|
189
189
|
return null;
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
|
-
async function
|
|
192
|
+
async function Ve(r) {
|
|
193
193
|
const l = new FormData();
|
|
194
194
|
l.append("file", r);
|
|
195
195
|
const t = await fetch(`${$}/uploads`, {
|
|
@@ -202,74 +202,74 @@ async function Be(r) {
|
|
|
202
202
|
}
|
|
203
203
|
return t.json();
|
|
204
204
|
}
|
|
205
|
-
async function
|
|
205
|
+
async function Ge() {
|
|
206
206
|
return j(`${$}/uploads`);
|
|
207
207
|
}
|
|
208
|
-
async function
|
|
208
|
+
async function Fe(r) {
|
|
209
209
|
const l = await fetch(`${$}/uploads/${r}`, {
|
|
210
210
|
method: "DELETE"
|
|
211
211
|
});
|
|
212
212
|
if (!l.ok)
|
|
213
213
|
throw new Error(`Failed to delete upload: ${l.status}`);
|
|
214
214
|
}
|
|
215
|
-
function
|
|
215
|
+
function ue(r) {
|
|
216
216
|
return `${$}/uploads/${r}/blob`;
|
|
217
217
|
}
|
|
218
|
-
async function
|
|
218
|
+
async function He(r) {
|
|
219
219
|
return j(`${$}/import`, {
|
|
220
220
|
method: "POST",
|
|
221
221
|
body: JSON.stringify({ yaml: r })
|
|
222
222
|
});
|
|
223
223
|
}
|
|
224
|
-
async function
|
|
224
|
+
async function _e(r) {
|
|
225
225
|
return j(`${$}/import/validate`, {
|
|
226
226
|
method: "POST",
|
|
227
227
|
body: JSON.stringify({ yaml: r })
|
|
228
228
|
});
|
|
229
229
|
}
|
|
230
|
-
async function
|
|
230
|
+
async function Ke(r) {
|
|
231
231
|
return j(`${$}/generate/workflow`, {
|
|
232
232
|
method: "POST",
|
|
233
233
|
body: JSON.stringify(r)
|
|
234
234
|
});
|
|
235
235
|
}
|
|
236
|
-
async function
|
|
236
|
+
async function qe() {
|
|
237
237
|
return j(`${$}/generate/status`);
|
|
238
238
|
}
|
|
239
|
-
const
|
|
240
|
-
|
|
239
|
+
const ie = "http://localhost:11434", le = "http://localhost:1234", O = me()(
|
|
240
|
+
pe(
|
|
241
241
|
(r, l) => ({
|
|
242
242
|
ai: {
|
|
243
243
|
ollama: {
|
|
244
|
-
baseUrl:
|
|
244
|
+
baseUrl: ie,
|
|
245
245
|
enabled: !1
|
|
246
246
|
},
|
|
247
247
|
lmstudio: {
|
|
248
|
-
baseUrl:
|
|
248
|
+
baseUrl: le,
|
|
249
249
|
enabled: !1
|
|
250
250
|
}
|
|
251
251
|
},
|
|
252
252
|
showSettings: !1,
|
|
253
253
|
setAIProvider: (t, n) => {
|
|
254
|
-
r((
|
|
254
|
+
r((i) => ({
|
|
255
255
|
ai: {
|
|
256
|
-
...
|
|
256
|
+
...i.ai,
|
|
257
257
|
[t]: n
|
|
258
258
|
}
|
|
259
259
|
}));
|
|
260
260
|
},
|
|
261
261
|
clearAIProvider: (t) => {
|
|
262
262
|
r((n) => {
|
|
263
|
-
const
|
|
264
|
-
return delete
|
|
263
|
+
const i = { ...n.ai };
|
|
264
|
+
return delete i[t], { ai: i };
|
|
265
265
|
});
|
|
266
266
|
},
|
|
267
267
|
openSettings: () => r({ showSettings: !0 }),
|
|
268
268
|
closeSettings: () => r({ showSettings: !1 }),
|
|
269
269
|
getConfiguredProviders: () => {
|
|
270
|
-
var
|
|
270
|
+
var i, s, p, d, a, m, c;
|
|
271
271
|
const { ai: t } = l(), n = {};
|
|
272
|
-
return (
|
|
272
|
+
return (i = t.openai) != null && i.enabled && t.openai.apiKey && (n.openai = { apiKey: t.openai.apiKey }), (s = t.anthropic) != null && s.enabled && t.anthropic.apiKey && (n.anthropic = { apiKey: t.anthropic.apiKey }), (p = t.gemini) != null && p.enabled && t.gemini.apiKey && (n.gemini = { apiKey: t.gemini.apiKey }), (d = t.grok) != null && d.enabled && t.grok.apiKey && (n.grok = { apiKey: t.grok.apiKey }), (a = t.openrouter) != null && a.enabled && t.openrouter.apiKey && (n.openrouter = { apiKey: t.openrouter.apiKey }), (m = t.ollama) != null && m.enabled && (n.ollama = { baseUrl: t.ollama.baseUrl || ie }), (c = t.lmstudio) != null && c.enabled && (n.lmstudio = { baseUrl: t.lmstudio.baseUrl || le }), n;
|
|
273
273
|
}
|
|
274
274
|
}),
|
|
275
275
|
{
|
|
@@ -279,16 +279,16 @@ const se = "http://localhost:11434", ie = "http://localhost:1234", O = ce()(
|
|
|
279
279
|
}
|
|
280
280
|
)
|
|
281
281
|
);
|
|
282
|
-
let
|
|
282
|
+
let Je = 0;
|
|
283
283
|
function V() {
|
|
284
|
-
return `node_${++
|
|
284
|
+
return `node_${++Je}`;
|
|
285
285
|
}
|
|
286
|
-
function
|
|
286
|
+
function de() {
|
|
287
287
|
const r = Date.now(), l = Math.random().toString(36).substring(2, 8);
|
|
288
288
|
return `wf_${r}_${l}`;
|
|
289
289
|
}
|
|
290
|
-
const k =
|
|
291
|
-
|
|
290
|
+
const k = me()(
|
|
291
|
+
pe(
|
|
292
292
|
(r, l) => ({
|
|
293
293
|
nodes: [],
|
|
294
294
|
edges: [],
|
|
@@ -314,16 +314,16 @@ const k = ce()(
|
|
|
314
314
|
nodeStatus: {}
|
|
315
315
|
},
|
|
316
316
|
loadTemplate: (t) => {
|
|
317
|
-
const n = /* @__PURE__ */ new Map(),
|
|
317
|
+
const n = /* @__PURE__ */ new Map(), i = t.workflow.nodes.map((p) => {
|
|
318
318
|
const d = V();
|
|
319
|
-
return n.set(
|
|
319
|
+
return n.set(p.id, d), {
|
|
320
320
|
id: d,
|
|
321
|
-
type:
|
|
322
|
-
position:
|
|
323
|
-
data:
|
|
321
|
+
type: p.type,
|
|
322
|
+
position: p.position,
|
|
323
|
+
data: p.data
|
|
324
324
|
};
|
|
325
|
-
}),
|
|
326
|
-
const d = n.get(
|
|
325
|
+
}), s = t.workflow.edges.map((p) => {
|
|
326
|
+
const d = n.get(p.source) || p.source, a = n.get(p.target) || p.target;
|
|
327
327
|
return {
|
|
328
328
|
id: `edge_${d}_${a}`,
|
|
329
329
|
source: d,
|
|
@@ -331,8 +331,8 @@ const k = ce()(
|
|
|
331
331
|
};
|
|
332
332
|
});
|
|
333
333
|
r({
|
|
334
|
-
nodes:
|
|
335
|
-
edges:
|
|
334
|
+
nodes: i,
|
|
335
|
+
edges: s,
|
|
336
336
|
selectedNodeId: null,
|
|
337
337
|
currentTemplateId: t.id,
|
|
338
338
|
previewVisible: {},
|
|
@@ -377,11 +377,11 @@ const k = ce()(
|
|
|
377
377
|
setTextProviders: (t) => r({ textProviders: t }),
|
|
378
378
|
setVisionProviders: (t) => r({ visionProviders: t }),
|
|
379
379
|
addNode: (t, n) => {
|
|
380
|
-
var d, a,
|
|
381
|
-
const
|
|
382
|
-
let
|
|
380
|
+
var d, a, m;
|
|
381
|
+
const i = V();
|
|
382
|
+
let s;
|
|
383
383
|
if (t.type === "generator")
|
|
384
|
-
|
|
384
|
+
s = {
|
|
385
385
|
generatorName: t.name,
|
|
386
386
|
params: _(t),
|
|
387
387
|
isAI: t.isAI,
|
|
@@ -390,7 +390,7 @@ const k = ce()(
|
|
|
390
390
|
maxReferenceImages: t.maxReferenceImages
|
|
391
391
|
};
|
|
392
392
|
else if (t.type === "transform")
|
|
393
|
-
|
|
393
|
+
s = {
|
|
394
394
|
operation: t.name,
|
|
395
395
|
providerName: t.providerName,
|
|
396
396
|
// Track which provider this transform belongs to
|
|
@@ -401,20 +401,20 @@ const k = ce()(
|
|
|
401
401
|
maxReferenceImages: t.maxReferenceImages
|
|
402
402
|
};
|
|
403
403
|
else if (t.type === "input")
|
|
404
|
-
|
|
404
|
+
s = {
|
|
405
405
|
uploadId: void 0,
|
|
406
406
|
filename: void 0,
|
|
407
407
|
mime: void 0
|
|
408
408
|
};
|
|
409
409
|
else if (t.type === "vision")
|
|
410
|
-
|
|
410
|
+
s = {
|
|
411
411
|
providerName: t.name,
|
|
412
412
|
providerLabel: t.label,
|
|
413
413
|
// Human-readable label (e.g., "Gemini Vision")
|
|
414
414
|
params: _(t)
|
|
415
415
|
};
|
|
416
416
|
else if (t.type === "text")
|
|
417
|
-
|
|
417
|
+
s = {
|
|
418
418
|
providerName: t.name,
|
|
419
419
|
providerLabel: t.label,
|
|
420
420
|
// Human-readable label (e.g., "Gemini Text")
|
|
@@ -422,89 +422,89 @@ const k = ce()(
|
|
|
422
422
|
};
|
|
423
423
|
else {
|
|
424
424
|
const c = ((d = t.params) == null ? void 0 : d.properties) || {}, u = ((a = c.provider) == null ? void 0 : a.default) || "filesystem";
|
|
425
|
-
|
|
426
|
-
destination: ((
|
|
425
|
+
s = {
|
|
426
|
+
destination: ((m = c.destination) == null ? void 0 : m.default) || "./output/image.png",
|
|
427
427
|
provider: u
|
|
428
428
|
};
|
|
429
429
|
}
|
|
430
|
-
const
|
|
431
|
-
id:
|
|
430
|
+
const p = {
|
|
431
|
+
id: i,
|
|
432
432
|
type: t.type,
|
|
433
433
|
position: n,
|
|
434
|
-
data:
|
|
434
|
+
data: s
|
|
435
435
|
};
|
|
436
436
|
r((c) => ({
|
|
437
|
-
nodes: [...c.nodes,
|
|
437
|
+
nodes: [...c.nodes, p]
|
|
438
438
|
}));
|
|
439
439
|
},
|
|
440
440
|
updateNodeData: (t, n) => {
|
|
441
|
-
r((
|
|
442
|
-
nodes:
|
|
443
|
-
(
|
|
441
|
+
r((i) => ({
|
|
442
|
+
nodes: i.nodes.map(
|
|
443
|
+
(s) => s.id === t ? { ...s, data: { ...s.data, ...n } } : s
|
|
444
444
|
)
|
|
445
445
|
}));
|
|
446
446
|
},
|
|
447
447
|
deleteNode: (t) => {
|
|
448
448
|
r((n) => ({
|
|
449
|
-
nodes: n.nodes.filter((
|
|
450
|
-
edges: n.edges.filter((
|
|
449
|
+
nodes: n.nodes.filter((i) => i.id !== t),
|
|
450
|
+
edges: n.edges.filter((i) => i.source !== t && i.target !== t),
|
|
451
451
|
selectedNodeId: n.selectedNodeId === t ? null : n.selectedNodeId
|
|
452
452
|
}));
|
|
453
453
|
},
|
|
454
454
|
duplicateNode: (t) => {
|
|
455
|
-
const n = l(),
|
|
456
|
-
if (!
|
|
457
|
-
const
|
|
458
|
-
...
|
|
459
|
-
id:
|
|
455
|
+
const n = l(), i = n.nodes.find((d) => d.id === t);
|
|
456
|
+
if (!i) return;
|
|
457
|
+
const s = V(), p = {
|
|
458
|
+
...i,
|
|
459
|
+
id: s,
|
|
460
460
|
position: {
|
|
461
|
-
x:
|
|
462
|
-
y:
|
|
461
|
+
x: i.position.x + 50,
|
|
462
|
+
y: i.position.y + 50
|
|
463
463
|
},
|
|
464
|
-
data: JSON.parse(JSON.stringify(
|
|
464
|
+
data: JSON.parse(JSON.stringify(i.data)),
|
|
465
465
|
// Deep clone
|
|
466
466
|
selected: !1
|
|
467
467
|
};
|
|
468
468
|
r({
|
|
469
|
-
nodes: [...n.nodes,
|
|
470
|
-
selectedNodeId:
|
|
469
|
+
nodes: [...n.nodes, p],
|
|
470
|
+
selectedNodeId: s
|
|
471
471
|
// Select the new node
|
|
472
472
|
});
|
|
473
473
|
},
|
|
474
474
|
setNodes: (t) => r({ nodes: t }),
|
|
475
475
|
addEdge: (t) => {
|
|
476
476
|
if (!t.source || !t.target) return;
|
|
477
|
-
const n = [t.sourceHandle, t.targetHandle].filter(Boolean).join("_"),
|
|
477
|
+
const n = [t.sourceHandle, t.targetHandle].filter(Boolean).join("_"), s = {
|
|
478
478
|
id: n ? `edge_${t.source}_${t.target}_${n}` : `edge_${t.source}_${t.target}`,
|
|
479
479
|
source: t.source,
|
|
480
480
|
target: t.target,
|
|
481
481
|
sourceHandle: t.sourceHandle ?? void 0,
|
|
482
482
|
targetHandle: t.targetHandle ?? void 0
|
|
483
483
|
};
|
|
484
|
-
r((
|
|
485
|
-
edges: [...
|
|
484
|
+
r((p) => ({
|
|
485
|
+
edges: [...p.edges, s]
|
|
486
486
|
}));
|
|
487
487
|
},
|
|
488
488
|
deleteEdge: (t) => {
|
|
489
489
|
r((n) => ({
|
|
490
|
-
edges: n.edges.filter((
|
|
490
|
+
edges: n.edges.filter((i) => i.id !== t)
|
|
491
491
|
}));
|
|
492
492
|
},
|
|
493
493
|
setEdges: (t) => r({ edges: t }),
|
|
494
494
|
setSelectedNode: (t) => r({ selectedNodeId: t }),
|
|
495
495
|
execute: async () => {
|
|
496
|
-
const { nodes: t, edges: n } = l(),
|
|
496
|
+
const { nodes: t, edges: n } = l(), i = t.map((a) => ({
|
|
497
497
|
id: a.id,
|
|
498
498
|
type: a.type,
|
|
499
499
|
position: a.position,
|
|
500
500
|
data: a.data
|
|
501
|
-
})),
|
|
501
|
+
})), s = n.map((a) => ({
|
|
502
502
|
id: a.id,
|
|
503
503
|
source: a.source,
|
|
504
504
|
target: a.target,
|
|
505
505
|
sourceHandle: a.sourceHandle ?? void 0,
|
|
506
506
|
targetHandle: a.targetHandle ?? void 0
|
|
507
|
-
})),
|
|
507
|
+
})), p = O.getState().getConfiguredProviders(), d = {};
|
|
508
508
|
for (const a of t)
|
|
509
509
|
d[a.id] = "running";
|
|
510
510
|
r({
|
|
@@ -518,9 +518,9 @@ const k = ce()(
|
|
|
518
518
|
}
|
|
519
519
|
});
|
|
520
520
|
try {
|
|
521
|
-
const a = await
|
|
521
|
+
const a = await Oe(i, s, p), m = {};
|
|
522
522
|
for (const c of t)
|
|
523
|
-
|
|
523
|
+
m[c.id] = a.status === "completed" ? "completed" : "error";
|
|
524
524
|
a.status === "completed" ? r({
|
|
525
525
|
execution: {
|
|
526
526
|
status: "completed",
|
|
@@ -528,7 +528,7 @@ const k = ce()(
|
|
|
528
528
|
imageUrls: a.imageUrls || [],
|
|
529
529
|
previews: a.previews || {},
|
|
530
530
|
dataOutputs: a.dataOutputs || {},
|
|
531
|
-
nodeStatus:
|
|
531
|
+
nodeStatus: m
|
|
532
532
|
}
|
|
533
533
|
}) : r({
|
|
534
534
|
execution: {
|
|
@@ -537,14 +537,14 @@ const k = ce()(
|
|
|
537
537
|
imageUrls: [],
|
|
538
538
|
previews: {},
|
|
539
539
|
dataOutputs: {},
|
|
540
|
-
nodeStatus:
|
|
540
|
+
nodeStatus: m,
|
|
541
541
|
error: a.error
|
|
542
542
|
}
|
|
543
543
|
});
|
|
544
544
|
} catch (a) {
|
|
545
|
-
const
|
|
545
|
+
const m = {};
|
|
546
546
|
for (const c of t)
|
|
547
|
-
|
|
547
|
+
m[c.id] = "error";
|
|
548
548
|
r({
|
|
549
549
|
execution: {
|
|
550
550
|
status: "error",
|
|
@@ -552,52 +552,52 @@ const k = ce()(
|
|
|
552
552
|
imageUrls: [],
|
|
553
553
|
previews: {},
|
|
554
554
|
dataOutputs: {},
|
|
555
|
-
nodeStatus:
|
|
555
|
+
nodeStatus: m,
|
|
556
556
|
error: a instanceof Error ? a.message : "Unknown error"
|
|
557
557
|
}
|
|
558
558
|
});
|
|
559
559
|
}
|
|
560
560
|
},
|
|
561
561
|
exportToYaml: async () => {
|
|
562
|
-
const { nodes: t, edges: n } = l(),
|
|
562
|
+
const { nodes: t, edges: n } = l(), i = t.map((d) => ({
|
|
563
563
|
id: d.id,
|
|
564
564
|
type: d.type,
|
|
565
565
|
position: d.position,
|
|
566
566
|
data: d.data
|
|
567
|
-
})),
|
|
567
|
+
})), s = n.map((d) => ({
|
|
568
568
|
id: d.id,
|
|
569
569
|
source: d.source,
|
|
570
570
|
target: d.target,
|
|
571
571
|
sourceHandle: d.sourceHandle ?? void 0,
|
|
572
572
|
targetHandle: d.targetHandle ?? void 0
|
|
573
573
|
}));
|
|
574
|
-
return (await
|
|
574
|
+
return (await Re(i, s)).yaml;
|
|
575
575
|
},
|
|
576
|
-
importFromYaml: (t, n,
|
|
577
|
-
const
|
|
578
|
-
const
|
|
579
|
-
return
|
|
580
|
-
id:
|
|
576
|
+
importFromYaml: (t, n, i) => {
|
|
577
|
+
const s = /* @__PURE__ */ new Map(), p = t.map((a) => {
|
|
578
|
+
const m = V();
|
|
579
|
+
return s.set(a.id, m), {
|
|
580
|
+
id: m,
|
|
581
581
|
type: a.type,
|
|
582
582
|
position: a.position,
|
|
583
583
|
data: a.data
|
|
584
584
|
};
|
|
585
585
|
}), d = n.map((a) => {
|
|
586
|
-
const
|
|
586
|
+
const m = s.get(a.source) || a.source, c = s.get(a.target) || a.target;
|
|
587
587
|
return {
|
|
588
|
-
id: `edge_${
|
|
589
|
-
source:
|
|
588
|
+
id: `edge_${m}_${c}`,
|
|
589
|
+
source: m,
|
|
590
590
|
target: c
|
|
591
591
|
};
|
|
592
592
|
});
|
|
593
593
|
r({
|
|
594
|
-
nodes:
|
|
594
|
+
nodes: p,
|
|
595
595
|
edges: d,
|
|
596
596
|
selectedNodeId: null,
|
|
597
597
|
currentTemplateId: null,
|
|
598
598
|
previewVisible: {},
|
|
599
599
|
activeWorkflowId: null,
|
|
600
|
-
activeWorkflowName:
|
|
600
|
+
activeWorkflowName: i || "Imported Workflow",
|
|
601
601
|
hasUnsavedChanges: !0,
|
|
602
602
|
execution: {
|
|
603
603
|
status: "idle",
|
|
@@ -636,49 +636,49 @@ const k = ce()(
|
|
|
636
636
|
saveWorkflow: (t) => {
|
|
637
637
|
const {
|
|
638
638
|
nodes: n,
|
|
639
|
-
edges:
|
|
640
|
-
activeWorkflowId:
|
|
641
|
-
activeWorkflowName:
|
|
639
|
+
edges: i,
|
|
640
|
+
activeWorkflowId: s,
|
|
641
|
+
activeWorkflowName: p,
|
|
642
642
|
savedWorkflows: d,
|
|
643
643
|
currentTemplateId: a
|
|
644
|
-
} = l(),
|
|
645
|
-
if (
|
|
644
|
+
} = l(), m = Date.now();
|
|
645
|
+
if (s) {
|
|
646
646
|
const c = d.map(
|
|
647
|
-
(u) => u.id ===
|
|
647
|
+
(u) => u.id === s ? { ...u, name: t || p, nodes: n, edges: i, updatedAt: m } : u
|
|
648
648
|
);
|
|
649
649
|
return r({
|
|
650
650
|
savedWorkflows: c,
|
|
651
|
-
activeWorkflowName: t ||
|
|
651
|
+
activeWorkflowName: t || p,
|
|
652
652
|
hasUnsavedChanges: !1
|
|
653
|
-
}),
|
|
653
|
+
}), s;
|
|
654
654
|
} else {
|
|
655
|
-
const c =
|
|
655
|
+
const c = de(), u = {
|
|
656
656
|
id: c,
|
|
657
|
-
name: t ||
|
|
657
|
+
name: t || p,
|
|
658
658
|
nodes: n,
|
|
659
|
-
edges:
|
|
660
|
-
createdAt:
|
|
661
|
-
updatedAt:
|
|
659
|
+
edges: i,
|
|
660
|
+
createdAt: m,
|
|
661
|
+
updatedAt: m,
|
|
662
662
|
templateId: a || void 0
|
|
663
663
|
};
|
|
664
664
|
return r({
|
|
665
665
|
savedWorkflows: [...d, u],
|
|
666
666
|
activeWorkflowId: c,
|
|
667
|
-
activeWorkflowName: t ||
|
|
667
|
+
activeWorkflowName: t || p,
|
|
668
668
|
hasUnsavedChanges: !1
|
|
669
669
|
}), c;
|
|
670
670
|
}
|
|
671
671
|
},
|
|
672
672
|
loadWorkflow: (t) => {
|
|
673
|
-
const { savedWorkflows: n } = l(),
|
|
674
|
-
|
|
675
|
-
nodes:
|
|
676
|
-
edges:
|
|
673
|
+
const { savedWorkflows: n } = l(), i = n.find((s) => s.id === t);
|
|
674
|
+
i && r({
|
|
675
|
+
nodes: i.nodes,
|
|
676
|
+
edges: i.edges,
|
|
677
677
|
selectedNodeId: null,
|
|
678
|
-
currentTemplateId:
|
|
678
|
+
currentTemplateId: i.templateId || null,
|
|
679
679
|
previewVisible: {},
|
|
680
680
|
activeWorkflowId: t,
|
|
681
|
-
activeWorkflowName:
|
|
681
|
+
activeWorkflowName: i.name,
|
|
682
682
|
hasUnsavedChanges: !1,
|
|
683
683
|
execution: {
|
|
684
684
|
status: "idle",
|
|
@@ -691,9 +691,9 @@ const k = ce()(
|
|
|
691
691
|
});
|
|
692
692
|
},
|
|
693
693
|
deleteWorkflow: (t) => {
|
|
694
|
-
const { savedWorkflows: n, activeWorkflowId:
|
|
695
|
-
r(
|
|
696
|
-
savedWorkflows:
|
|
694
|
+
const { savedWorkflows: n, activeWorkflowId: i } = l(), s = n.filter((p) => p.id !== t);
|
|
695
|
+
r(i === t ? {
|
|
696
|
+
savedWorkflows: s,
|
|
697
697
|
nodes: [],
|
|
698
698
|
edges: [],
|
|
699
699
|
selectedNodeId: null,
|
|
@@ -710,42 +710,42 @@ const k = ce()(
|
|
|
710
710
|
dataOutputs: {},
|
|
711
711
|
nodeStatus: {}
|
|
712
712
|
}
|
|
713
|
-
} : { savedWorkflows:
|
|
713
|
+
} : { savedWorkflows: s });
|
|
714
714
|
},
|
|
715
715
|
renameWorkflow: (t, n) => {
|
|
716
|
-
const { savedWorkflows:
|
|
716
|
+
const { savedWorkflows: i, activeWorkflowId: s } = l(), p = i.map(
|
|
717
717
|
(d) => d.id === t ? { ...d, name: n, updatedAt: Date.now() } : d
|
|
718
718
|
);
|
|
719
719
|
r({
|
|
720
|
-
savedWorkflows:
|
|
721
|
-
...
|
|
720
|
+
savedWorkflows: p,
|
|
721
|
+
...s === t ? { activeWorkflowName: n } : {}
|
|
722
722
|
});
|
|
723
723
|
},
|
|
724
724
|
duplicateWorkflow: (t) => {
|
|
725
|
-
const { savedWorkflows: n } = l(),
|
|
726
|
-
if (!
|
|
727
|
-
const
|
|
728
|
-
...
|
|
729
|
-
id:
|
|
730
|
-
name: `${
|
|
731
|
-
createdAt:
|
|
732
|
-
updatedAt:
|
|
725
|
+
const { savedWorkflows: n } = l(), i = n.find((a) => a.id === t);
|
|
726
|
+
if (!i) return "";
|
|
727
|
+
const s = Date.now(), p = de(), d = {
|
|
728
|
+
...i,
|
|
729
|
+
id: p,
|
|
730
|
+
name: `${i.name} (Copy)`,
|
|
731
|
+
createdAt: s,
|
|
732
|
+
updatedAt: s
|
|
733
733
|
};
|
|
734
|
-
return r({ savedWorkflows: [...n, d] }),
|
|
734
|
+
return r({ savedWorkflows: [...n, d] }), p;
|
|
735
735
|
},
|
|
736
736
|
loadGeneratedWorkflow: (t) => {
|
|
737
|
-
const n = /* @__PURE__ */ new Map(),
|
|
737
|
+
const n = /* @__PURE__ */ new Map(), i = 250, s = 150, p = 3, d = t.nodes.map((m, c) => {
|
|
738
738
|
const u = V();
|
|
739
|
-
n.set(
|
|
740
|
-
const h =
|
|
741
|
-
x: 100 + c %
|
|
742
|
-
y: 100 +
|
|
739
|
+
n.set(m.id, u);
|
|
740
|
+
const h = m.nodeType.split(":"), f = h[0], y = Math.floor(c / p), w = {
|
|
741
|
+
x: 100 + c % p * i,
|
|
742
|
+
y: 100 + y * s
|
|
743
743
|
};
|
|
744
744
|
let b;
|
|
745
745
|
if (f === "generator")
|
|
746
746
|
b = {
|
|
747
747
|
generatorName: h.slice(1).join(":"),
|
|
748
|
-
params:
|
|
748
|
+
params: m.parameters,
|
|
749
749
|
isAI: !0
|
|
750
750
|
// Assume AI since we're generating from AI
|
|
751
751
|
};
|
|
@@ -754,7 +754,7 @@ const k = ce()(
|
|
|
754
754
|
b = {
|
|
755
755
|
operation: h.slice(2).join(":"),
|
|
756
756
|
providerName: g,
|
|
757
|
-
params:
|
|
757
|
+
params: m.parameters
|
|
758
758
|
};
|
|
759
759
|
} else if (f === "input")
|
|
760
760
|
b = {
|
|
@@ -765,13 +765,13 @@ const k = ce()(
|
|
|
765
765
|
else if (f === "vision")
|
|
766
766
|
b = {
|
|
767
767
|
providerName: h.slice(1).join(":"),
|
|
768
|
-
params:
|
|
768
|
+
params: m.parameters
|
|
769
769
|
};
|
|
770
770
|
else if (f === "text") {
|
|
771
|
-
const g = h.slice(1).join(":"),
|
|
771
|
+
const g = h.slice(1).join(":"), z = m.parameters.jsonSchema, W = z != null && z.properties ? {
|
|
772
772
|
type: "object",
|
|
773
773
|
properties: Object.fromEntries(
|
|
774
|
-
Object.entries(
|
|
774
|
+
Object.entries(z.properties).map(([x, C]) => [
|
|
775
775
|
x,
|
|
776
776
|
{
|
|
777
777
|
type: C.type || "string",
|
|
@@ -782,28 +782,28 @@ const k = ce()(
|
|
|
782
782
|
} : void 0;
|
|
783
783
|
b = {
|
|
784
784
|
providerName: g,
|
|
785
|
-
params:
|
|
785
|
+
params: m.parameters,
|
|
786
786
|
outputSchema: W
|
|
787
787
|
};
|
|
788
788
|
} else
|
|
789
789
|
b = {
|
|
790
|
-
destination:
|
|
791
|
-
provider:
|
|
790
|
+
destination: m.parameters.destination || "./output/image.png",
|
|
791
|
+
provider: m.parameters.provider || "filesystem"
|
|
792
792
|
};
|
|
793
793
|
return {
|
|
794
794
|
id: u,
|
|
795
795
|
type: f,
|
|
796
|
-
position:
|
|
796
|
+
position: w,
|
|
797
797
|
data: b
|
|
798
798
|
};
|
|
799
|
-
}), a = t.edges.map((
|
|
800
|
-
const c = n.get(
|
|
799
|
+
}), a = t.edges.map((m) => {
|
|
800
|
+
const c = n.get(m.source) || m.source, u = n.get(m.target) || m.target, h = [m.sourceHandle, m.targetHandle].filter(Boolean).join("_");
|
|
801
801
|
return {
|
|
802
802
|
id: h ? `edge_${c}_${u}_${h}` : `edge_${c}_${u}`,
|
|
803
803
|
source: c,
|
|
804
804
|
target: u,
|
|
805
|
-
sourceHandle:
|
|
806
|
-
targetHandle:
|
|
805
|
+
sourceHandle: m.sourceHandle ?? void 0,
|
|
806
|
+
targetHandle: m.targetHandle ?? void 0
|
|
807
807
|
};
|
|
808
808
|
});
|
|
809
809
|
r({
|
|
@@ -839,20 +839,20 @@ function _(r) {
|
|
|
839
839
|
var t;
|
|
840
840
|
const l = {};
|
|
841
841
|
if ((t = r.params) != null && t.properties)
|
|
842
|
-
for (const [n,
|
|
843
|
-
|
|
842
|
+
for (const [n, i] of Object.entries(r.params.properties))
|
|
843
|
+
i.default !== void 0 && (l[n] = i.default);
|
|
844
844
|
return l;
|
|
845
845
|
}
|
|
846
846
|
function B(r) {
|
|
847
847
|
return r === "running" ? "border-yellow-400 animate-pulse" : r === "completed" ? "border-green-500" : r === "error" ? "border-red-500" : "";
|
|
848
848
|
}
|
|
849
849
|
function X({ nodeId: r, color: l }) {
|
|
850
|
-
const t = k((
|
|
850
|
+
const t = k((i) => i.previewVisible[r] !== !1), n = k((i) => i.togglePreview);
|
|
851
851
|
return /* @__PURE__ */ e(
|
|
852
852
|
"button",
|
|
853
853
|
{
|
|
854
|
-
onClick: (
|
|
855
|
-
|
|
854
|
+
onClick: (i) => {
|
|
855
|
+
i.stopPropagation(), n(r);
|
|
856
856
|
},
|
|
857
857
|
className: `ml-auto p-1 rounded hover:bg-gray-200 dark:hover:bg-zinc-600 transition-colors ${t ? "opacity-100" : "opacity-40"}`,
|
|
858
858
|
title: t ? "Hide preview" : "Show preview",
|
|
@@ -876,18 +876,18 @@ function X({ nodeId: r, color: l }) {
|
|
|
876
876
|
}
|
|
877
877
|
);
|
|
878
878
|
}
|
|
879
|
-
const
|
|
879
|
+
const Qe = E(function({
|
|
880
880
|
id: l,
|
|
881
881
|
data: t,
|
|
882
882
|
selected: n
|
|
883
883
|
}) {
|
|
884
|
-
const
|
|
885
|
-
return /* @__PURE__ */
|
|
884
|
+
const i = k((u) => u.execution.previews[l]), s = k((u) => u.execution.nodeStatus[l]), p = k((u) => u.previewVisible[l] !== !1), a = B(s) || (n ? "border-blue-500" : "border-blue-200"), m = t.isAI, c = t.acceptsReferenceImages;
|
|
885
|
+
return /* @__PURE__ */ o(
|
|
886
886
|
"div",
|
|
887
887
|
{
|
|
888
888
|
className: `rounded-lg border-2 bg-white dark:bg-zinc-800 shadow-md min-w-[180px] overflow-hidden ${a}`,
|
|
889
889
|
children: [
|
|
890
|
-
|
|
890
|
+
m && /* @__PURE__ */ e(
|
|
891
891
|
A,
|
|
892
892
|
{
|
|
893
893
|
type: "target",
|
|
@@ -908,16 +908,16 @@ const Je = E(function({
|
|
|
908
908
|
title: `Reference images (up to ${t.maxReferenceImages || 14})`
|
|
909
909
|
}
|
|
910
910
|
),
|
|
911
|
-
|
|
912
|
-
/* @__PURE__ */
|
|
913
|
-
/* @__PURE__ */
|
|
911
|
+
i && p && /* @__PURE__ */ e("div", { className: "bg-gray-100 dark:bg-zinc-900 border-b border-gray-200 dark:border-zinc-700", children: /* @__PURE__ */ e("img", { src: i, alt: "Preview", className: "w-full h-24 object-contain" }) }),
|
|
912
|
+
/* @__PURE__ */ o("div", { className: "px-4 py-3", children: [
|
|
913
|
+
/* @__PURE__ */ o("div", { className: "flex items-center gap-2 mb-2", children: [
|
|
914
914
|
/* @__PURE__ */ e("div", { className: "w-3 h-3 rounded-full bg-blue-500" }),
|
|
915
915
|
/* @__PURE__ */ e("span", { className: "font-semibold text-sm text-blue-700 dark:text-blue-400", children: t.generatorName }),
|
|
916
916
|
/* @__PURE__ */ e(X, { nodeId: l, color: "text-blue-500 dark:text-blue-400" })
|
|
917
917
|
] }),
|
|
918
|
-
|
|
918
|
+
m && /* @__PURE__ */ e("div", { className: "text-[10px] text-pink-500 dark:text-pink-400 mb-1", children: "↑ Connect text node for dynamic prompt" }),
|
|
919
919
|
c && /* @__PURE__ */ e("div", { className: "text-[10px] text-violet-500 dark:text-violet-400 mb-1", children: "← Connect reference images" }),
|
|
920
|
-
/* @__PURE__ */ e("div", { className: "text-xs text-gray-500 dark:text-zinc-400", children: Object.entries(t.params).filter(([, u]) => typeof u != "object" || u === null).slice(0, 2).map(([u, h]) => /* @__PURE__ */
|
|
920
|
+
/* @__PURE__ */ e("div", { className: "text-xs text-gray-500 dark:text-zinc-400", children: Object.entries(t.params).filter(([, u]) => typeof u != "object" || u === null).slice(0, 2).map(([u, h]) => /* @__PURE__ */ o("div", { className: "truncate", children: [
|
|
921
921
|
u,
|
|
922
922
|
": ",
|
|
923
923
|
String(h).slice(0, 20)
|
|
@@ -927,18 +927,18 @@ const Je = E(function({
|
|
|
927
927
|
]
|
|
928
928
|
}
|
|
929
929
|
);
|
|
930
|
-
}),
|
|
930
|
+
}), Ye = E(function({
|
|
931
931
|
id: l,
|
|
932
932
|
data: t,
|
|
933
933
|
selected: n
|
|
934
934
|
}) {
|
|
935
|
-
const
|
|
936
|
-
return /* @__PURE__ */
|
|
935
|
+
const i = k((u) => u.execution.previews[l]), s = k((u) => u.execution.nodeStatus[l]), p = k((u) => u.previewVisible[l] !== !1), a = B(s) || (n ? "border-teal-500" : "border-teal-200"), m = t.isAI, c = t.acceptsReferenceImages;
|
|
936
|
+
return /* @__PURE__ */ o(
|
|
937
937
|
"div",
|
|
938
938
|
{
|
|
939
939
|
className: `rounded-lg border-2 bg-white dark:bg-zinc-800 shadow-md min-w-[180px] overflow-hidden ${a}`,
|
|
940
940
|
children: [
|
|
941
|
-
|
|
941
|
+
m && /* @__PURE__ */ e(
|
|
942
942
|
A,
|
|
943
943
|
{
|
|
944
944
|
type: "target",
|
|
@@ -959,10 +959,10 @@ const Je = E(function({
|
|
|
959
959
|
title: `Reference images (up to ${t.maxReferenceImages || 13})`
|
|
960
960
|
}
|
|
961
961
|
),
|
|
962
|
-
|
|
963
|
-
/* @__PURE__ */
|
|
964
|
-
/* @__PURE__ */
|
|
965
|
-
|
|
962
|
+
i && p && /* @__PURE__ */ e("div", { className: "bg-gray-100 dark:bg-zinc-900 border-b border-gray-200 dark:border-zinc-700", children: /* @__PURE__ */ e("img", { src: i, alt: "Preview", className: "w-full h-24 object-contain" }) }),
|
|
963
|
+
/* @__PURE__ */ o("div", { className: "px-4 py-3", children: [
|
|
964
|
+
/* @__PURE__ */ o("div", { className: "flex items-center gap-2 mb-2", children: [
|
|
965
|
+
m ? /* @__PURE__ */ o("svg", { className: "w-3 h-3 text-purple-500", fill: "currentColor", viewBox: "0 0 20 20", children: [
|
|
966
966
|
/* @__PURE__ */ e("path", { d: "M13 7H7v6h6V7z" }),
|
|
967
967
|
/* @__PURE__ */ e(
|
|
968
968
|
"path",
|
|
@@ -976,7 +976,7 @@ const Je = E(function({
|
|
|
976
976
|
/* @__PURE__ */ e(
|
|
977
977
|
"span",
|
|
978
978
|
{
|
|
979
|
-
className: `font-semibold text-sm ${
|
|
979
|
+
className: `font-semibold text-sm ${m ? "text-purple-700 dark:text-purple-400" : "text-teal-700 dark:text-teal-400"}`,
|
|
980
980
|
children: t.operation
|
|
981
981
|
}
|
|
982
982
|
),
|
|
@@ -984,13 +984,13 @@ const Je = E(function({
|
|
|
984
984
|
X,
|
|
985
985
|
{
|
|
986
986
|
nodeId: l,
|
|
987
|
-
color:
|
|
987
|
+
color: m ? "text-purple-500 dark:text-purple-400" : "text-teal-500 dark:text-teal-400"
|
|
988
988
|
}
|
|
989
989
|
)
|
|
990
990
|
] }),
|
|
991
|
-
|
|
991
|
+
m && /* @__PURE__ */ e("div", { className: "text-[10px] text-pink-500 dark:text-pink-400 mb-1", children: "↑ Connect text node for dynamic prompt" }),
|
|
992
992
|
c && /* @__PURE__ */ e("div", { className: "text-[10px] text-violet-500 dark:text-violet-400 mb-1", children: "↓ Connect reference images" }),
|
|
993
|
-
/* @__PURE__ */ e("div", { className: "text-xs text-gray-500 dark:text-zinc-400", children: Object.entries(t.params).filter(([, u]) => typeof u != "object" || u === null).slice(0, 2).map(([u, h]) => /* @__PURE__ */
|
|
993
|
+
/* @__PURE__ */ e("div", { className: "text-xs text-gray-500 dark:text-zinc-400", children: Object.entries(t.params).filter(([, u]) => typeof u != "object" || u === null).slice(0, 2).map(([u, h]) => /* @__PURE__ */ o("div", { className: "truncate", children: [
|
|
994
994
|
u,
|
|
995
995
|
": ",
|
|
996
996
|
String(h).slice(0, 20)
|
|
@@ -1000,15 +1000,15 @@ const Je = E(function({
|
|
|
1000
1000
|
]
|
|
1001
1001
|
}
|
|
1002
1002
|
);
|
|
1003
|
-
}),
|
|
1004
|
-
const
|
|
1005
|
-
return /* @__PURE__ */
|
|
1003
|
+
}), Xe = E(function({ id: l, data: t, selected: n }) {
|
|
1004
|
+
const i = k((d) => d.execution.nodeStatus[l]), p = B(i) || (n ? "border-green-500" : "border-green-200");
|
|
1005
|
+
return /* @__PURE__ */ o(
|
|
1006
1006
|
"div",
|
|
1007
1007
|
{
|
|
1008
|
-
className: `px-4 py-3 rounded-lg border-2 bg-white dark:bg-zinc-800 shadow-md min-w-[180px] ${
|
|
1008
|
+
className: `px-4 py-3 rounded-lg border-2 bg-white dark:bg-zinc-800 shadow-md min-w-[180px] ${p}`,
|
|
1009
1009
|
children: [
|
|
1010
1010
|
/* @__PURE__ */ e(A, { type: "target", position: P.Left, className: "w-3 h-3 !bg-green-500" }),
|
|
1011
|
-
/* @__PURE__ */
|
|
1011
|
+
/* @__PURE__ */ o("div", { className: "flex items-center gap-2 mb-2", children: [
|
|
1012
1012
|
/* @__PURE__ */ e("div", { className: "w-3 h-3 rounded-full bg-green-500" }),
|
|
1013
1013
|
/* @__PURE__ */ e("span", { className: "font-semibold text-sm text-green-700 dark:text-green-400", children: "Save" })
|
|
1014
1014
|
] }),
|
|
@@ -1016,11 +1016,11 @@ const Je = E(function({
|
|
|
1016
1016
|
]
|
|
1017
1017
|
}
|
|
1018
1018
|
);
|
|
1019
|
-
}),
|
|
1020
|
-
const
|
|
1021
|
-
async (
|
|
1019
|
+
}), Ze = E(function({ id: l, data: t, selected: n }) {
|
|
1020
|
+
const i = k((w) => w.execution.previews[l]), s = k((w) => w.execution.nodeStatus[l]), p = k((w) => w.previewVisible[l] !== !1), d = k((w) => w.updateNodeData), a = Q(null), c = B(s) || (n ? "border-amber-500" : "border-amber-200"), u = L(
|
|
1021
|
+
async (w) => {
|
|
1022
1022
|
try {
|
|
1023
|
-
const b = await
|
|
1023
|
+
const b = await Ve(w);
|
|
1024
1024
|
d(l, {
|
|
1025
1025
|
uploadId: b.id,
|
|
1026
1026
|
filename: b.filename,
|
|
@@ -1032,38 +1032,38 @@ const Je = E(function({
|
|
|
1032
1032
|
},
|
|
1033
1033
|
[l, d]
|
|
1034
1034
|
), h = L(
|
|
1035
|
-
(
|
|
1036
|
-
|
|
1037
|
-
const b =
|
|
1035
|
+
(w) => {
|
|
1036
|
+
w.preventDefault(), w.stopPropagation();
|
|
1037
|
+
const b = w.dataTransfer.files[0];
|
|
1038
1038
|
b && b.type.startsWith("image/") && u(b);
|
|
1039
1039
|
},
|
|
1040
1040
|
[u]
|
|
1041
|
-
), f = L((
|
|
1042
|
-
|
|
1043
|
-
}, []),
|
|
1044
|
-
(
|
|
1041
|
+
), f = L((w) => {
|
|
1042
|
+
w.preventDefault(), w.stopPropagation();
|
|
1043
|
+
}, []), y = L(
|
|
1044
|
+
(w) => {
|
|
1045
1045
|
var g;
|
|
1046
|
-
const b = (g =
|
|
1046
|
+
const b = (g = w.target.files) == null ? void 0 : g[0];
|
|
1047
1047
|
b && u(b);
|
|
1048
1048
|
},
|
|
1049
1049
|
[u]
|
|
1050
|
-
), v =
|
|
1051
|
-
return /* @__PURE__ */
|
|
1050
|
+
), v = i || (t.uploadId ? ue(t.uploadId) : null);
|
|
1051
|
+
return /* @__PURE__ */ o(
|
|
1052
1052
|
"div",
|
|
1053
1053
|
{
|
|
1054
1054
|
className: `rounded-lg border-2 bg-white dark:bg-zinc-800 shadow-md min-w-[180px] overflow-hidden ${c}`,
|
|
1055
1055
|
onDrop: h,
|
|
1056
1056
|
onDragOver: f,
|
|
1057
1057
|
children: [
|
|
1058
|
-
v &&
|
|
1058
|
+
v && p ? /* @__PURE__ */ e("div", { className: "bg-gray-100 dark:bg-zinc-900 border-b border-gray-200 dark:border-zinc-700", children: /* @__PURE__ */ e("img", { src: v, alt: "Uploaded", className: "w-full h-24 object-contain" }) }) : v ? null : /* @__PURE__ */ e(
|
|
1059
1059
|
"div",
|
|
1060
1060
|
{
|
|
1061
1061
|
className: "bg-amber-50 dark:bg-amber-900/30 border-b border-amber-100 dark:border-amber-800 h-24 flex items-center justify-center cursor-pointer hover:bg-amber-100 dark:hover:bg-amber-900/50 transition-colors",
|
|
1062
1062
|
onClick: () => {
|
|
1063
|
-
var
|
|
1064
|
-
return (
|
|
1063
|
+
var w;
|
|
1064
|
+
return (w = a.current) == null ? void 0 : w.click();
|
|
1065
1065
|
},
|
|
1066
|
-
children: /* @__PURE__ */
|
|
1066
|
+
children: /* @__PURE__ */ o("div", { className: "text-center text-amber-600 dark:text-amber-400", children: [
|
|
1067
1067
|
/* @__PURE__ */ e("div", { className: "text-2xl mb-1", children: "+" }),
|
|
1068
1068
|
/* @__PURE__ */ e("div", { className: "text-xs", children: "Drop image or click" })
|
|
1069
1069
|
] })
|
|
@@ -1076,11 +1076,11 @@ const Je = E(function({
|
|
|
1076
1076
|
type: "file",
|
|
1077
1077
|
accept: "image/*",
|
|
1078
1078
|
className: "hidden",
|
|
1079
|
-
onChange:
|
|
1079
|
+
onChange: y
|
|
1080
1080
|
}
|
|
1081
1081
|
),
|
|
1082
|
-
/* @__PURE__ */
|
|
1083
|
-
/* @__PURE__ */
|
|
1082
|
+
/* @__PURE__ */ o("div", { className: "px-4 py-3", children: [
|
|
1083
|
+
/* @__PURE__ */ o("div", { className: "flex items-center gap-2 mb-2", children: [
|
|
1084
1084
|
/* @__PURE__ */ e("div", { className: "w-3 h-3 rounded-full bg-amber-500" }),
|
|
1085
1085
|
/* @__PURE__ */ e("span", { className: "font-semibold text-sm text-amber-700 dark:text-amber-400", children: "Input" }),
|
|
1086
1086
|
/* @__PURE__ */ e(X, { nodeId: l, color: "text-amber-500 dark:text-amber-400" })
|
|
@@ -1091,29 +1091,29 @@ const Je = E(function({
|
|
|
1091
1091
|
]
|
|
1092
1092
|
}
|
|
1093
1093
|
);
|
|
1094
|
-
}),
|
|
1094
|
+
}), et = E(function({
|
|
1095
1095
|
id: l,
|
|
1096
1096
|
data: t,
|
|
1097
1097
|
selected: n
|
|
1098
1098
|
}) {
|
|
1099
1099
|
var c, u, h;
|
|
1100
|
-
const
|
|
1101
|
-
var
|
|
1102
|
-
return (
|
|
1103
|
-
}), d = B(
|
|
1104
|
-
return /* @__PURE__ */
|
|
1100
|
+
const i = k((f) => f.execution.nodeStatus[l]), s = k((f) => {
|
|
1101
|
+
var y;
|
|
1102
|
+
return (y = f.execution.dataOutputs) == null ? void 0 : y[l];
|
|
1103
|
+
}), d = B(i) || (n ? "border-cyan-500" : "border-cyan-200"), a = (c = t.outputSchema) != null && c.properties ? Object.entries(t.outputSchema.properties) : [], m = a.length > 0;
|
|
1104
|
+
return /* @__PURE__ */ o(
|
|
1105
1105
|
"div",
|
|
1106
1106
|
{
|
|
1107
1107
|
className: `rounded-lg border-2 bg-white dark:bg-zinc-800 shadow-md min-w-[180px] overflow-hidden ${d}`,
|
|
1108
1108
|
children: [
|
|
1109
1109
|
/* @__PURE__ */ e(A, { type: "target", position: P.Left, className: "w-3 h-3 !bg-cyan-500" }),
|
|
1110
|
-
|
|
1111
|
-
(u =
|
|
1112
|
-
(((h =
|
|
1110
|
+
s && /* @__PURE__ */ e("div", { className: "bg-cyan-50 dark:bg-cyan-900/30 border-b border-cyan-100 dark:border-cyan-800 p-2 max-h-24 overflow-auto", children: /* @__PURE__ */ o("pre", { className: "text-xs text-cyan-800 dark:text-cyan-200 whitespace-pre-wrap", children: [
|
|
1111
|
+
(u = s.content) == null ? void 0 : u.slice(0, 200),
|
|
1112
|
+
(((h = s.content) == null ? void 0 : h.length) || 0) > 200 && "..."
|
|
1113
1113
|
] }) }),
|
|
1114
|
-
/* @__PURE__ */
|
|
1115
|
-
/* @__PURE__ */
|
|
1116
|
-
/* @__PURE__ */
|
|
1114
|
+
/* @__PURE__ */ o("div", { className: "px-4 py-3", children: [
|
|
1115
|
+
/* @__PURE__ */ o("div", { className: "flex items-center gap-2 mb-2", children: [
|
|
1116
|
+
/* @__PURE__ */ o("svg", { className: "w-3 h-3 text-cyan-500", fill: "currentColor", viewBox: "0 0 20 20", children: [
|
|
1117
1117
|
/* @__PURE__ */ e("path", { d: "M10 12a2 2 0 100-4 2 2 0 000 4z" }),
|
|
1118
1118
|
/* @__PURE__ */ e(
|
|
1119
1119
|
"path",
|
|
@@ -1126,13 +1126,13 @@ const Je = E(function({
|
|
|
1126
1126
|
] }),
|
|
1127
1127
|
/* @__PURE__ */ e("span", { className: "font-semibold text-sm text-cyan-700 dark:text-cyan-400", children: t.providerLabel || t.providerName })
|
|
1128
1128
|
] }),
|
|
1129
|
-
/* @__PURE__ */ e("div", { className: "text-xs text-gray-500 dark:text-zinc-400", children: t.params.prompt ? /* @__PURE__ */
|
|
1129
|
+
/* @__PURE__ */ e("div", { className: "text-xs text-gray-500 dark:text-zinc-400", children: t.params.prompt ? /* @__PURE__ */ o("div", { className: "truncate", children: [
|
|
1130
1130
|
String(t.params.prompt).slice(0, 30),
|
|
1131
1131
|
"..."
|
|
1132
1132
|
] }) : null }),
|
|
1133
|
-
|
|
1133
|
+
m && /* @__PURE__ */ o("div", { className: "mt-2 pt-2 border-t border-cyan-200 dark:border-cyan-800", children: [
|
|
1134
1134
|
/* @__PURE__ */ e("div", { className: "text-[10px] text-cyan-500 dark:text-cyan-400 font-medium mb-1", children: "Outputs:" }),
|
|
1135
|
-
a.map(([f]) => /* @__PURE__ */
|
|
1135
|
+
a.map(([f]) => /* @__PURE__ */ o(
|
|
1136
1136
|
"div",
|
|
1137
1137
|
{
|
|
1138
1138
|
className: "text-[10px] text-gray-500 dark:text-zinc-400 flex items-center gap-1",
|
|
@@ -1145,7 +1145,7 @@ const Je = E(function({
|
|
|
1145
1145
|
))
|
|
1146
1146
|
] })
|
|
1147
1147
|
] }),
|
|
1148
|
-
|
|
1148
|
+
m ? /* @__PURE__ */ o(U, { children: [
|
|
1149
1149
|
/* @__PURE__ */ e(
|
|
1150
1150
|
A,
|
|
1151
1151
|
{
|
|
@@ -1157,7 +1157,7 @@ const Je = E(function({
|
|
|
1157
1157
|
title: "Full JSON output"
|
|
1158
1158
|
}
|
|
1159
1159
|
),
|
|
1160
|
-
a.map(([f,
|
|
1160
|
+
a.map(([f, y], v) => /* @__PURE__ */ e(
|
|
1161
1161
|
A,
|
|
1162
1162
|
{
|
|
1163
1163
|
type: "source",
|
|
@@ -1167,7 +1167,7 @@ const Je = E(function({
|
|
|
1167
1167
|
style: {
|
|
1168
1168
|
top: `${70 + v * 14}%`
|
|
1169
1169
|
},
|
|
1170
|
-
title: `${f}: ${
|
|
1170
|
+
title: `${f}: ${y.description || y.type}`
|
|
1171
1171
|
},
|
|
1172
1172
|
f
|
|
1173
1173
|
))
|
|
@@ -1175,24 +1175,24 @@ const Je = E(function({
|
|
|
1175
1175
|
]
|
|
1176
1176
|
}
|
|
1177
1177
|
);
|
|
1178
|
-
}),
|
|
1178
|
+
}), tt = E(function({ id: l, data: t, selected: n }) {
|
|
1179
1179
|
var c, u, h;
|
|
1180
|
-
const
|
|
1181
|
-
var
|
|
1182
|
-
return (
|
|
1183
|
-
}), d = B(
|
|
1184
|
-
return /* @__PURE__ */
|
|
1180
|
+
const i = k((f) => f.execution.nodeStatus[l]), s = k((f) => {
|
|
1181
|
+
var y;
|
|
1182
|
+
return (y = f.execution.dataOutputs) == null ? void 0 : y[l];
|
|
1183
|
+
}), d = B(i) || (n ? "border-pink-500" : "border-pink-200"), a = (c = t.outputSchema) != null && c.properties ? Object.entries(t.outputSchema.properties) : [], m = a.length > 0;
|
|
1184
|
+
return /* @__PURE__ */ o(
|
|
1185
1185
|
"div",
|
|
1186
1186
|
{
|
|
1187
1187
|
className: `rounded-lg border-2 bg-white dark:bg-zinc-800 shadow-md min-w-[180px] overflow-hidden ${d}`,
|
|
1188
1188
|
children: [
|
|
1189
1189
|
/* @__PURE__ */ e(A, { type: "target", position: P.Left, className: "w-3 h-3 !bg-pink-500" }),
|
|
1190
|
-
|
|
1191
|
-
(u =
|
|
1192
|
-
(((h =
|
|
1190
|
+
s && /* @__PURE__ */ e("div", { className: "bg-pink-50 dark:bg-pink-900/30 border-b border-pink-100 dark:border-pink-800 p-2 max-h-24 overflow-auto", children: /* @__PURE__ */ o("pre", { className: "text-xs text-pink-800 dark:text-pink-200 whitespace-pre-wrap", children: [
|
|
1191
|
+
(u = s.content) == null ? void 0 : u.slice(0, 200),
|
|
1192
|
+
(((h = s.content) == null ? void 0 : h.length) || 0) > 200 && "..."
|
|
1193
1193
|
] }) }),
|
|
1194
|
-
/* @__PURE__ */
|
|
1195
|
-
/* @__PURE__ */
|
|
1194
|
+
/* @__PURE__ */ o("div", { className: "px-4 py-3", children: [
|
|
1195
|
+
/* @__PURE__ */ o("div", { className: "flex items-center gap-2 mb-2", children: [
|
|
1196
1196
|
/* @__PURE__ */ e("svg", { className: "w-3 h-3 text-pink-500", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ e(
|
|
1197
1197
|
"path",
|
|
1198
1198
|
{
|
|
@@ -1203,13 +1203,13 @@ const Je = E(function({
|
|
|
1203
1203
|
) }),
|
|
1204
1204
|
/* @__PURE__ */ e("span", { className: "font-semibold text-sm text-pink-700 dark:text-pink-400", children: t.providerLabel || t.providerName })
|
|
1205
1205
|
] }),
|
|
1206
|
-
/* @__PURE__ */ e("div", { className: "text-xs text-gray-500 dark:text-zinc-400", children: t.params.prompt ? /* @__PURE__ */
|
|
1206
|
+
/* @__PURE__ */ e("div", { className: "text-xs text-gray-500 dark:text-zinc-400", children: t.params.prompt ? /* @__PURE__ */ o("div", { className: "truncate", children: [
|
|
1207
1207
|
String(t.params.prompt).slice(0, 30),
|
|
1208
1208
|
"..."
|
|
1209
1209
|
] }) : null }),
|
|
1210
|
-
|
|
1210
|
+
m && /* @__PURE__ */ o("div", { className: "mt-2 pt-2 border-t border-pink-200 dark:border-pink-800", children: [
|
|
1211
1211
|
/* @__PURE__ */ e("div", { className: "text-[10px] text-pink-500 dark:text-pink-400 font-medium mb-1", children: "Outputs:" }),
|
|
1212
|
-
a.map(([f]) => /* @__PURE__ */
|
|
1212
|
+
a.map(([f]) => /* @__PURE__ */ o(
|
|
1213
1213
|
"div",
|
|
1214
1214
|
{
|
|
1215
1215
|
className: "text-[10px] text-gray-500 dark:text-zinc-400 flex items-center gap-1",
|
|
@@ -1222,7 +1222,7 @@ const Je = E(function({
|
|
|
1222
1222
|
))
|
|
1223
1223
|
] })
|
|
1224
1224
|
] }),
|
|
1225
|
-
|
|
1225
|
+
m ? /* @__PURE__ */ o(U, { children: [
|
|
1226
1226
|
/* @__PURE__ */ e(
|
|
1227
1227
|
A,
|
|
1228
1228
|
{
|
|
@@ -1234,7 +1234,7 @@ const Je = E(function({
|
|
|
1234
1234
|
title: "Full JSON output"
|
|
1235
1235
|
}
|
|
1236
1236
|
),
|
|
1237
|
-
a.map(([f,
|
|
1237
|
+
a.map(([f, y], v) => /* @__PURE__ */ e(
|
|
1238
1238
|
A,
|
|
1239
1239
|
{
|
|
1240
1240
|
type: "source",
|
|
@@ -1244,7 +1244,7 @@ const Je = E(function({
|
|
|
1244
1244
|
style: {
|
|
1245
1245
|
top: `${70 + v * 14}%`
|
|
1246
1246
|
},
|
|
1247
|
-
title: `${f}: ${
|
|
1247
|
+
title: `${f}: ${y.description || y.type}`
|
|
1248
1248
|
},
|
|
1249
1249
|
f
|
|
1250
1250
|
))
|
|
@@ -1252,18 +1252,18 @@ const Je = E(function({
|
|
|
1252
1252
|
]
|
|
1253
1253
|
}
|
|
1254
1254
|
);
|
|
1255
|
-
}),
|
|
1256
|
-
generator:
|
|
1257
|
-
transform:
|
|
1258
|
-
save:
|
|
1259
|
-
input:
|
|
1260
|
-
vision:
|
|
1261
|
-
text:
|
|
1262
|
-
},
|
|
1255
|
+
}), rt = {
|
|
1256
|
+
generator: Qe,
|
|
1257
|
+
transform: Ye,
|
|
1258
|
+
save: Xe,
|
|
1259
|
+
input: Ze,
|
|
1260
|
+
vision: et,
|
|
1261
|
+
text: tt
|
|
1262
|
+
}, at = {
|
|
1263
1263
|
type: "smoothstep",
|
|
1264
1264
|
animated: !1,
|
|
1265
1265
|
markerEnd: {
|
|
1266
|
-
type:
|
|
1266
|
+
type: Ie.ArrowClosed,
|
|
1267
1267
|
color: "#64748b",
|
|
1268
1268
|
width: 20,
|
|
1269
1269
|
height: 20
|
|
@@ -1273,53 +1273,53 @@ const Je = E(function({
|
|
|
1273
1273
|
strokeWidth: 2
|
|
1274
1274
|
}
|
|
1275
1275
|
};
|
|
1276
|
-
function
|
|
1277
|
-
const r = k((h) => h.nodes), l = k((h) => h.edges), t = k((h) => h.setNodes), n = k((h) => h.setEdges),
|
|
1276
|
+
function nt() {
|
|
1277
|
+
const r = k((h) => h.nodes), l = k((h) => h.edges), t = k((h) => h.setNodes), n = k((h) => h.setEdges), i = k((h) => h.addEdge), s = k((h) => h.setSelectedNode), p = L(
|
|
1278
1278
|
(h) => {
|
|
1279
|
-
const { source: f, target:
|
|
1280
|
-
if (!f || !
|
|
1281
|
-
const v = r.find((g) => g.id === f),
|
|
1282
|
-
return !(!v || !
|
|
1283
|
-
(g) => g.target ===
|
|
1284
|
-
) || f ===
|
|
1279
|
+
const { source: f, target: y } = h;
|
|
1280
|
+
if (!f || !y) return !1;
|
|
1281
|
+
const v = r.find((g) => g.id === f), w = r.find((g) => g.id === y);
|
|
1282
|
+
return !(!v || !w || v.type === "save" || w.type === "generator" || w.type === "input" || l.find(
|
|
1283
|
+
(g) => g.target === y && g.targetHandle === h.targetHandle
|
|
1284
|
+
) || f === y);
|
|
1285
1285
|
},
|
|
1286
1286
|
[r, l]
|
|
1287
1287
|
), d = L(
|
|
1288
1288
|
(h) => {
|
|
1289
|
-
t(
|
|
1289
|
+
t(ze(h, r));
|
|
1290
1290
|
},
|
|
1291
1291
|
[r, t]
|
|
1292
1292
|
), a = L(
|
|
1293
1293
|
(h) => {
|
|
1294
|
-
n(
|
|
1294
|
+
n(Ce(h, l));
|
|
1295
1295
|
},
|
|
1296
1296
|
[l, n]
|
|
1297
|
-
),
|
|
1297
|
+
), m = L(
|
|
1298
1298
|
(h) => {
|
|
1299
|
-
|
|
1299
|
+
i(h);
|
|
1300
1300
|
},
|
|
1301
|
-
[
|
|
1301
|
+
[i]
|
|
1302
1302
|
), c = L(
|
|
1303
1303
|
(h, f) => {
|
|
1304
|
-
|
|
1304
|
+
s(f.id);
|
|
1305
1305
|
},
|
|
1306
|
-
[
|
|
1306
|
+
[s]
|
|
1307
1307
|
), u = L(() => {
|
|
1308
|
-
|
|
1309
|
-
}, [
|
|
1310
|
-
return /* @__PURE__ */ e("div", { className: "h-full w-full", children: /* @__PURE__ */
|
|
1311
|
-
|
|
1308
|
+
s(null);
|
|
1309
|
+
}, [s]);
|
|
1310
|
+
return /* @__PURE__ */ e("div", { className: "h-full w-full", children: /* @__PURE__ */ o(
|
|
1311
|
+
Ne,
|
|
1312
1312
|
{
|
|
1313
1313
|
nodes: r,
|
|
1314
1314
|
edges: l,
|
|
1315
1315
|
onNodesChange: d,
|
|
1316
1316
|
onEdgesChange: a,
|
|
1317
|
-
onConnect:
|
|
1317
|
+
onConnect: m,
|
|
1318
1318
|
onNodeClick: c,
|
|
1319
1319
|
onPaneClick: u,
|
|
1320
|
-
nodeTypes:
|
|
1321
|
-
defaultEdgeOptions:
|
|
1322
|
-
isValidConnection:
|
|
1320
|
+
nodeTypes: rt,
|
|
1321
|
+
defaultEdgeOptions: at,
|
|
1322
|
+
isValidConnection: p,
|
|
1323
1323
|
nodesDraggable: !0,
|
|
1324
1324
|
nodesConnectable: !0,
|
|
1325
1325
|
elementsSelectable: !0,
|
|
@@ -1328,23 +1328,23 @@ function at() {
|
|
|
1328
1328
|
snapToGrid: !0,
|
|
1329
1329
|
snapGrid: [15, 15],
|
|
1330
1330
|
children: [
|
|
1331
|
-
/* @__PURE__ */ e(Ie, {}),
|
|
1332
1331
|
/* @__PURE__ */ e(Se, {}),
|
|
1333
|
-
/* @__PURE__ */ e(Le, {
|
|
1332
|
+
/* @__PURE__ */ e(Le, {}),
|
|
1333
|
+
/* @__PURE__ */ e(We, { nodeStrokeWidth: 3, zoomable: !0, pannable: !0 })
|
|
1334
1334
|
]
|
|
1335
1335
|
}
|
|
1336
1336
|
) });
|
|
1337
1337
|
}
|
|
1338
|
-
function
|
|
1339
|
-
const [l, t] = I([]), [n,
|
|
1338
|
+
function ot({ onSelect: r }) {
|
|
1339
|
+
const [l, t] = I([]), [n, i] = I(!0), [s, p] = I(null), d = async () => {
|
|
1340
1340
|
try {
|
|
1341
|
-
|
|
1342
|
-
const c = await
|
|
1343
|
-
t(c),
|
|
1341
|
+
i(!0);
|
|
1342
|
+
const c = await Ge();
|
|
1343
|
+
t(c), p(null);
|
|
1344
1344
|
} catch (c) {
|
|
1345
|
-
|
|
1345
|
+
p(c instanceof Error ? c.message : "Failed to load uploads");
|
|
1346
1346
|
} finally {
|
|
1347
|
-
|
|
1347
|
+
i(!1);
|
|
1348
1348
|
}
|
|
1349
1349
|
};
|
|
1350
1350
|
D(() => {
|
|
@@ -1353,13 +1353,13 @@ function nt({ onSelect: r }) {
|
|
|
1353
1353
|
const a = async (c, u) => {
|
|
1354
1354
|
if (u.stopPropagation(), !!confirm("Delete this upload?"))
|
|
1355
1355
|
try {
|
|
1356
|
-
await
|
|
1356
|
+
await Fe(c), t((h) => h.filter((f) => f.id !== c));
|
|
1357
1357
|
} catch (h) {
|
|
1358
1358
|
console.error("Failed to delete:", h);
|
|
1359
1359
|
}
|
|
1360
|
-
},
|
|
1361
|
-
return n ? /* @__PURE__ */ e("div", { className: "p-4 text-center text-gray-500 dark:text-zinc-400", children: "Loading uploads..." }) :
|
|
1362
|
-
|
|
1360
|
+
}, m = (c) => c < 1024 ? `${c} B` : c < 1024 * 1024 ? `${(c / 1024).toFixed(1)} KB` : `${(c / (1024 * 1024)).toFixed(1)} MB`;
|
|
1361
|
+
return n ? /* @__PURE__ */ e("div", { className: "p-4 text-center text-gray-500 dark:text-zinc-400", children: "Loading uploads..." }) : s ? /* @__PURE__ */ o("div", { className: "p-4 text-center text-red-500 dark:text-red-400", children: [
|
|
1362
|
+
s,
|
|
1363
1363
|
/* @__PURE__ */ e(
|
|
1364
1364
|
"button",
|
|
1365
1365
|
{
|
|
@@ -1368,7 +1368,7 @@ function nt({ onSelect: r }) {
|
|
|
1368
1368
|
children: "Retry"
|
|
1369
1369
|
}
|
|
1370
1370
|
)
|
|
1371
|
-
] }) : l.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: l.map((c) => /* @__PURE__ */
|
|
1371
|
+
] }) : l.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: l.map((c) => /* @__PURE__ */ o(
|
|
1372
1372
|
"div",
|
|
1373
1373
|
{
|
|
1374
1374
|
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",
|
|
@@ -1377,7 +1377,7 @@ function nt({ onSelect: r }) {
|
|
|
1377
1377
|
/* @__PURE__ */ e(
|
|
1378
1378
|
"img",
|
|
1379
1379
|
{
|
|
1380
|
-
src:
|
|
1380
|
+
src: ue(c.id),
|
|
1381
1381
|
alt: c.filename,
|
|
1382
1382
|
className: "w-full h-20 object-cover"
|
|
1383
1383
|
}
|
|
@@ -1391,25 +1391,25 @@ function nt({ onSelect: r }) {
|
|
|
1391
1391
|
}
|
|
1392
1392
|
) }),
|
|
1393
1393
|
/* @__PURE__ */ e("div", { className: "p-1 text-xs truncate bg-white dark:bg-zinc-800 text-gray-800 dark:text-zinc-200", children: c.filename }),
|
|
1394
|
-
/* @__PURE__ */ e("div", { className: "px-1 pb-1 text-xs text-gray-400 dark:text-zinc-500 bg-white dark:bg-zinc-800", children:
|
|
1394
|
+
/* @__PURE__ */ e("div", { className: "px-1 pb-1 text-xs text-gray-400 dark:text-zinc-500 bg-white dark:bg-zinc-800", children: m(c.size) })
|
|
1395
1395
|
]
|
|
1396
1396
|
},
|
|
1397
1397
|
c.id
|
|
1398
1398
|
)) }) });
|
|
1399
1399
|
}
|
|
1400
|
-
function
|
|
1401
|
-
const r = k((x) => x.setGenerators), l = k((x) => x.setTransforms), t = k((x) => x.setTextProviders), n = k((x) => x.setVisionProviders),
|
|
1400
|
+
function st() {
|
|
1401
|
+
const r = k((x) => x.setGenerators), l = k((x) => x.setTransforms), t = k((x) => x.setTextProviders), n = k((x) => x.setVisionProviders), i = k((x) => x.generators), s = k((x) => x.transforms), p = k((x) => x.textProviders), d = k((x) => x.visionProviders), a = k((x) => x.addNode), [m, c] = I(!1), { data: u } = F({
|
|
1402
1402
|
queryKey: ["generators"],
|
|
1403
|
-
queryFn:
|
|
1403
|
+
queryFn: je
|
|
1404
1404
|
}), { data: h } = F({
|
|
1405
1405
|
queryKey: ["transforms"],
|
|
1406
|
-
queryFn:
|
|
1406
|
+
queryFn: De
|
|
1407
1407
|
}), { data: f } = F({
|
|
1408
1408
|
queryKey: ["textProviders"],
|
|
1409
|
-
queryFn: De
|
|
1410
|
-
}), { data: w } = F({
|
|
1411
|
-
queryKey: ["visionProviders"],
|
|
1412
1409
|
queryFn: Te
|
|
1410
|
+
}), { data: y } = F({
|
|
1411
|
+
queryKey: ["visionProviders"],
|
|
1412
|
+
queryFn: Ue
|
|
1413
1413
|
});
|
|
1414
1414
|
D(() => {
|
|
1415
1415
|
u && r(u);
|
|
@@ -1418,11 +1418,11 @@ function ot() {
|
|
|
1418
1418
|
}, [h, l]), D(() => {
|
|
1419
1419
|
f && t(f);
|
|
1420
1420
|
}, [f, t]), D(() => {
|
|
1421
|
-
|
|
1422
|
-
}, [
|
|
1421
|
+
y && n(y);
|
|
1422
|
+
}, [y, n]);
|
|
1423
1423
|
const v = (x, C) => {
|
|
1424
1424
|
x.dataTransfer.setData("application/json", JSON.stringify(C)), x.dataTransfer.effectAllowed = "move";
|
|
1425
|
-
},
|
|
1425
|
+
}, w = (x) => {
|
|
1426
1426
|
a(x, { x: 250, y: 150 + Math.random() * 100 });
|
|
1427
1427
|
}, b = {
|
|
1428
1428
|
id: "input:upload",
|
|
@@ -1456,42 +1456,42 @@ function ot() {
|
|
|
1456
1456
|
}
|
|
1457
1457
|
}
|
|
1458
1458
|
}
|
|
1459
|
-
},
|
|
1459
|
+
}, z = i.reduce(
|
|
1460
1460
|
(x, C) => {
|
|
1461
1461
|
const S = C.category || "Other";
|
|
1462
1462
|
return x[S] || (x[S] = []), x[S].push(C), x;
|
|
1463
1463
|
},
|
|
1464
1464
|
{}
|
|
1465
|
-
), W =
|
|
1465
|
+
), W = s.reduce(
|
|
1466
1466
|
(x, C) => {
|
|
1467
1467
|
const S = C.category || "Other";
|
|
1468
1468
|
return x[S] || (x[S] = []), x[S].push(C), x;
|
|
1469
1469
|
},
|
|
1470
1470
|
{}
|
|
1471
1471
|
);
|
|
1472
|
-
return /* @__PURE__ */ e("div", { className: "w-64 bg-gray-50 dark:bg-zinc-800 border-r border-gray-200 dark:border-zinc-700 overflow-y-auto", children: /* @__PURE__ */
|
|
1472
|
+
return /* @__PURE__ */ e("div", { className: "w-64 bg-gray-50 dark:bg-zinc-800 border-r border-gray-200 dark:border-zinc-700 overflow-y-auto", children: /* @__PURE__ */ o("div", { className: "p-4", children: [
|
|
1473
1473
|
/* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-gray-800 dark:text-white mb-4", children: "Nodes" }),
|
|
1474
|
-
/* @__PURE__ */
|
|
1475
|
-
/* @__PURE__ */
|
|
1474
|
+
/* @__PURE__ */ o("div", { className: "mb-6", children: [
|
|
1475
|
+
/* @__PURE__ */ o("div", { className: "flex items-center justify-between mb-2", children: [
|
|
1476
1476
|
/* @__PURE__ */ e("h3", { className: "text-sm font-medium text-amber-600 dark:text-amber-400 uppercase tracking-wide", children: "Input" }),
|
|
1477
|
-
/* @__PURE__ */
|
|
1477
|
+
/* @__PURE__ */ o(
|
|
1478
1478
|
"button",
|
|
1479
1479
|
{
|
|
1480
|
-
onClick: () => c(!
|
|
1480
|
+
onClick: () => c(!m),
|
|
1481
1481
|
className: "text-xs text-amber-600 dark:text-amber-400 hover:text-amber-700 dark:hover:text-amber-300",
|
|
1482
1482
|
children: [
|
|
1483
|
-
|
|
1483
|
+
m ? "Hide" : "Browse",
|
|
1484
1484
|
" Uploads"
|
|
1485
1485
|
]
|
|
1486
1486
|
}
|
|
1487
1487
|
)
|
|
1488
1488
|
] }),
|
|
1489
|
-
/* @__PURE__ */
|
|
1489
|
+
/* @__PURE__ */ o(
|
|
1490
1490
|
"div",
|
|
1491
1491
|
{
|
|
1492
1492
|
draggable: !0,
|
|
1493
1493
|
onDragStart: (x) => v(x, b),
|
|
1494
|
-
onDoubleClick: () =>
|
|
1494
|
+
onDoubleClick: () => w(b),
|
|
1495
1495
|
className: "px-3 py-2 bg-amber-50 dark:bg-amber-900/30 border border-amber-200 dark:border-amber-700 rounded cursor-grab active:cursor-grabbing hover:bg-amber-100 dark:hover:bg-amber-900/50 transition-colors",
|
|
1496
1496
|
children: [
|
|
1497
1497
|
/* @__PURE__ */ e("div", { className: "text-sm font-medium text-amber-700 dark:text-amber-300", children: "Upload Image" }),
|
|
@@ -1499,18 +1499,18 @@ function ot() {
|
|
|
1499
1499
|
]
|
|
1500
1500
|
}
|
|
1501
1501
|
),
|
|
1502
|
-
|
|
1502
|
+
m && /* @__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(ot, {}) })
|
|
1503
1503
|
] }),
|
|
1504
|
-
/* @__PURE__ */
|
|
1504
|
+
/* @__PURE__ */ o("div", { className: "mb-6", children: [
|
|
1505
1505
|
/* @__PURE__ */ e("h3", { className: "text-sm font-medium text-blue-600 dark:text-blue-400 uppercase tracking-wide mb-2", children: "Generators" }),
|
|
1506
|
-
Object.entries(
|
|
1506
|
+
Object.entries(z).map(([x, C]) => /* @__PURE__ */ o("div", { className: "mb-3", children: [
|
|
1507
1507
|
/* @__PURE__ */ e("div", { className: "text-xs text-gray-500 dark:text-zinc-400 mb-1", children: x }),
|
|
1508
|
-
C.map((S) => /* @__PURE__ */
|
|
1508
|
+
C.map((S) => /* @__PURE__ */ o(
|
|
1509
1509
|
"div",
|
|
1510
1510
|
{
|
|
1511
1511
|
draggable: !0,
|
|
1512
1512
|
onDragStart: (T) => v(T, S),
|
|
1513
|
-
onDoubleClick: () =>
|
|
1513
|
+
onDoubleClick: () => w(S),
|
|
1514
1514
|
className: "px-3 py-2 bg-blue-50 dark:bg-blue-900/30 border border-blue-200 dark:border-blue-700 rounded mb-1 cursor-grab active:cursor-grabbing hover:bg-blue-100 dark:hover:bg-blue-900/50 transition-colors",
|
|
1515
1515
|
children: [
|
|
1516
1516
|
/* @__PURE__ */ e("div", { className: "text-sm font-medium text-blue-700 dark:text-blue-300", children: S.label }),
|
|
@@ -1521,16 +1521,16 @@ function ot() {
|
|
|
1521
1521
|
))
|
|
1522
1522
|
] }, x))
|
|
1523
1523
|
] }),
|
|
1524
|
-
/* @__PURE__ */
|
|
1524
|
+
/* @__PURE__ */ o("div", { className: "mb-6", children: [
|
|
1525
1525
|
/* @__PURE__ */ e("h3", { className: "text-sm font-medium text-teal-600 dark:text-teal-400 uppercase tracking-wide mb-2", children: "Transforms" }),
|
|
1526
|
-
Object.entries(W).map(([x, C]) => /* @__PURE__ */
|
|
1526
|
+
Object.entries(W).map(([x, C]) => /* @__PURE__ */ o("div", { className: "mb-3", children: [
|
|
1527
1527
|
/* @__PURE__ */ e("div", { className: "text-xs text-gray-500 dark:text-zinc-400 mb-1", children: x }),
|
|
1528
|
-
C.map((S) => /* @__PURE__ */
|
|
1528
|
+
C.map((S) => /* @__PURE__ */ o(
|
|
1529
1529
|
"div",
|
|
1530
1530
|
{
|
|
1531
1531
|
draggable: !0,
|
|
1532
1532
|
onDragStart: (T) => v(T, S),
|
|
1533
|
-
onDoubleClick: () =>
|
|
1533
|
+
onDoubleClick: () => w(S),
|
|
1534
1534
|
className: "px-3 py-2 bg-teal-50 dark:bg-teal-900/30 border border-teal-200 dark:border-teal-700 rounded mb-1 cursor-grab active:cursor-grabbing hover:bg-teal-100 dark:hover:bg-teal-900/50 transition-colors",
|
|
1535
1535
|
children: [
|
|
1536
1536
|
/* @__PURE__ */ e("div", { className: "text-sm font-medium text-teal-700 dark:text-teal-300", children: S.label }),
|
|
@@ -1541,14 +1541,14 @@ function ot() {
|
|
|
1541
1541
|
))
|
|
1542
1542
|
] }, x))
|
|
1543
1543
|
] }),
|
|
1544
|
-
|
|
1544
|
+
p.length > 0 && /* @__PURE__ */ o("div", { className: "mb-6", children: [
|
|
1545
1545
|
/* @__PURE__ */ e("h3", { className: "text-sm font-medium text-pink-600 dark:text-pink-400 uppercase tracking-wide mb-2", children: "AI Text" }),
|
|
1546
|
-
|
|
1546
|
+
p.map((x) => /* @__PURE__ */ o(
|
|
1547
1547
|
"div",
|
|
1548
1548
|
{
|
|
1549
1549
|
draggable: !0,
|
|
1550
1550
|
onDragStart: (C) => v(C, x),
|
|
1551
|
-
onDoubleClick: () =>
|
|
1551
|
+
onDoubleClick: () => w(x),
|
|
1552
1552
|
className: "px-3 py-2 bg-pink-50 dark:bg-pink-900/30 border border-pink-200 dark:border-pink-700 rounded mb-1 cursor-grab active:cursor-grabbing hover:bg-pink-100 dark:hover:bg-pink-900/50 transition-colors",
|
|
1553
1553
|
children: [
|
|
1554
1554
|
/* @__PURE__ */ e("div", { className: "text-sm font-medium text-pink-700 dark:text-pink-300", children: x.label }),
|
|
@@ -1558,14 +1558,14 @@ function ot() {
|
|
|
1558
1558
|
x.id
|
|
1559
1559
|
))
|
|
1560
1560
|
] }),
|
|
1561
|
-
d.length > 0 && /* @__PURE__ */
|
|
1561
|
+
d.length > 0 && /* @__PURE__ */ o("div", { className: "mb-6", children: [
|
|
1562
1562
|
/* @__PURE__ */ e("h3", { className: "text-sm font-medium text-cyan-600 dark:text-cyan-400 uppercase tracking-wide mb-2", children: "AI Vision" }),
|
|
1563
|
-
d.map((x) => /* @__PURE__ */
|
|
1563
|
+
d.map((x) => /* @__PURE__ */ o(
|
|
1564
1564
|
"div",
|
|
1565
1565
|
{
|
|
1566
1566
|
draggable: !0,
|
|
1567
1567
|
onDragStart: (C) => v(C, x),
|
|
1568
|
-
onDoubleClick: () =>
|
|
1568
|
+
onDoubleClick: () => w(x),
|
|
1569
1569
|
className: "px-3 py-2 bg-cyan-50 dark:bg-cyan-900/30 border border-cyan-200 dark:border-cyan-700 rounded mb-1 cursor-grab active:cursor-grabbing hover:bg-cyan-100 dark:hover:bg-cyan-900/50 transition-colors",
|
|
1570
1570
|
children: [
|
|
1571
1571
|
/* @__PURE__ */ e("div", { className: "text-sm font-medium text-cyan-700 dark:text-cyan-300", children: x.label }),
|
|
@@ -1575,14 +1575,14 @@ function ot() {
|
|
|
1575
1575
|
x.id
|
|
1576
1576
|
))
|
|
1577
1577
|
] }),
|
|
1578
|
-
/* @__PURE__ */
|
|
1578
|
+
/* @__PURE__ */ o("div", { className: "mb-6", children: [
|
|
1579
1579
|
/* @__PURE__ */ e("h3", { className: "text-sm font-medium text-green-600 dark:text-green-400 uppercase tracking-wide mb-2", children: "Output" }),
|
|
1580
|
-
/* @__PURE__ */
|
|
1580
|
+
/* @__PURE__ */ o(
|
|
1581
1581
|
"div",
|
|
1582
1582
|
{
|
|
1583
1583
|
draggable: !0,
|
|
1584
1584
|
onDragStart: (x) => v(x, g),
|
|
1585
|
-
onDoubleClick: () =>
|
|
1585
|
+
onDoubleClick: () => w(g),
|
|
1586
1586
|
className: "px-3 py-2 bg-green-50 dark:bg-green-900/30 border border-green-200 dark:border-green-700 rounded cursor-grab active:cursor-grabbing hover:bg-green-100 dark:hover:bg-green-900/50 transition-colors",
|
|
1587
1587
|
children: [
|
|
1588
1588
|
/* @__PURE__ */ e("div", { className: "text-sm font-medium text-green-700 dark:text-green-300", children: "Save" }),
|
|
@@ -1593,21 +1593,21 @@ function ot() {
|
|
|
1593
1593
|
] })
|
|
1594
1594
|
] }) });
|
|
1595
1595
|
}
|
|
1596
|
-
function
|
|
1597
|
-
var f,
|
|
1598
|
-
const r = k((b) => b.selectedNodeId), l = k((b) => b.nodes), t = k((b) => b.generators), n = k((b) => b.transforms),
|
|
1596
|
+
function it() {
|
|
1597
|
+
var f, y, v, w;
|
|
1598
|
+
const r = k((b) => b.selectedNodeId), l = k((b) => b.nodes), t = k((b) => b.generators), n = k((b) => b.transforms), i = k((b) => b.textProviders), s = k((b) => b.visionProviders), p = k((b) => b.updateNodeData), d = k((b) => b.deleteNode), a = l.find((b) => b.id === r);
|
|
1599
1599
|
if (!a)
|
|
1600
1600
|
return /* @__PURE__ */ e("div", { className: "w-80 bg-gray-50 dark:bg-zinc-800 border-l border-gray-200 dark:border-zinc-700 p-4", children: /* @__PURE__ */ e("div", { className: "text-gray-500 dark:text-zinc-400 text-sm", children: "Select a node to edit its properties" }) });
|
|
1601
|
-
let
|
|
1601
|
+
let m, c = "";
|
|
1602
1602
|
if (a.type === "generator") {
|
|
1603
|
-
const b = a.data, g = t.find((
|
|
1604
|
-
|
|
1603
|
+
const b = a.data, g = t.find((z) => z.name === b.generatorName);
|
|
1604
|
+
m = (f = g == null ? void 0 : g.params) == null ? void 0 : f.properties, c = (g == null ? void 0 : g.label) || b.generatorName;
|
|
1605
1605
|
} else if (a.type === "transform") {
|
|
1606
|
-
const b = a.data, g = n.find((
|
|
1607
|
-
|
|
1606
|
+
const b = a.data, g = n.find((z) => z.name === b.operation);
|
|
1607
|
+
m = (y = g == null ? void 0 : g.params) == null ? void 0 : y.properties, c = (g == null ? void 0 : g.label) || b.operation;
|
|
1608
1608
|
} else if (a.type === "save") {
|
|
1609
1609
|
const g = a.data.provider === "floimg-cloud";
|
|
1610
|
-
c = g ? "Save to FloImg Cloud" : "Save",
|
|
1610
|
+
c = g ? "Save to FloImg Cloud" : "Save", m = {
|
|
1611
1611
|
destination: {
|
|
1612
1612
|
type: "string",
|
|
1613
1613
|
title: g ? "Filename" : "Destination",
|
|
@@ -1615,34 +1615,34 @@ function st() {
|
|
|
1615
1615
|
}
|
|
1616
1616
|
};
|
|
1617
1617
|
} else if (a.type === "text") {
|
|
1618
|
-
const b = a.data, g =
|
|
1619
|
-
|
|
1618
|
+
const b = a.data, g = i.find((z) => z.name === b.providerName);
|
|
1619
|
+
m = (v = g == null ? void 0 : g.params) == null ? void 0 : v.properties, c = (g == null ? void 0 : g.label) || b.providerName;
|
|
1620
1620
|
} else if (a.type === "vision") {
|
|
1621
|
-
const b = a.data, g =
|
|
1622
|
-
|
|
1621
|
+
const b = a.data, g = s.find((z) => z.name === b.providerName);
|
|
1622
|
+
m = (w = g == null ? void 0 : g.params) == null ? void 0 : w.properties, c = (g == null ? void 0 : g.label) || b.providerName;
|
|
1623
1623
|
}
|
|
1624
1624
|
const u = (b, g) => {
|
|
1625
1625
|
if (a.type === "generator") {
|
|
1626
|
-
const
|
|
1627
|
-
|
|
1628
|
-
params: { ...
|
|
1626
|
+
const z = a.data;
|
|
1627
|
+
p(a.id, {
|
|
1628
|
+
params: { ...z.params, [b]: g }
|
|
1629
1629
|
});
|
|
1630
1630
|
} else if (a.type === "transform") {
|
|
1631
|
-
const
|
|
1632
|
-
|
|
1633
|
-
params: { ...
|
|
1631
|
+
const z = a.data;
|
|
1632
|
+
p(a.id, {
|
|
1633
|
+
params: { ...z.params, [b]: g }
|
|
1634
1634
|
});
|
|
1635
1635
|
} else if (a.type === "save")
|
|
1636
|
-
|
|
1636
|
+
p(a.id, { [b]: g });
|
|
1637
1637
|
else if (a.type === "text") {
|
|
1638
|
-
const
|
|
1639
|
-
|
|
1640
|
-
params: { ...
|
|
1638
|
+
const z = a.data;
|
|
1639
|
+
p(a.id, {
|
|
1640
|
+
params: { ...z.params, [b]: g }
|
|
1641
1641
|
});
|
|
1642
1642
|
} else if (a.type === "vision") {
|
|
1643
|
-
const
|
|
1644
|
-
|
|
1645
|
-
params: { ...
|
|
1643
|
+
const z = a.data;
|
|
1644
|
+
p(a.id, {
|
|
1645
|
+
params: { ...z.params, [b]: g }
|
|
1646
1646
|
});
|
|
1647
1647
|
}
|
|
1648
1648
|
}, h = (b) => {
|
|
@@ -1657,8 +1657,8 @@ function st() {
|
|
|
1657
1657
|
if (a.type === "vision")
|
|
1658
1658
|
return a.data.params[b];
|
|
1659
1659
|
};
|
|
1660
|
-
return /* @__PURE__ */ e("div", { className: "w-80 bg-gray-50 dark:bg-zinc-800 border-l border-gray-200 dark:border-zinc-700 overflow-y-auto", children: /* @__PURE__ */
|
|
1661
|
-
/* @__PURE__ */
|
|
1660
|
+
return /* @__PURE__ */ e("div", { className: "w-80 bg-gray-50 dark:bg-zinc-800 border-l border-gray-200 dark:border-zinc-700 overflow-y-auto", children: /* @__PURE__ */ o("div", { className: "p-4", children: [
|
|
1661
|
+
/* @__PURE__ */ o("div", { className: "flex items-center justify-between mb-4", children: [
|
|
1662
1662
|
/* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-gray-800 dark:text-white", children: c }),
|
|
1663
1663
|
/* @__PURE__ */ e(
|
|
1664
1664
|
"button",
|
|
@@ -1669,77 +1669,77 @@ function st() {
|
|
|
1669
1669
|
}
|
|
1670
1670
|
)
|
|
1671
1671
|
] }),
|
|
1672
|
-
/* @__PURE__ */ e("div", { className: "space-y-4", children:
|
|
1673
|
-
|
|
1672
|
+
/* @__PURE__ */ e("div", { className: "space-y-4", children: m && Object.entries(m).map(([b, g]) => /* @__PURE__ */ e(
|
|
1673
|
+
lt,
|
|
1674
1674
|
{
|
|
1675
1675
|
name: b,
|
|
1676
1676
|
field: g,
|
|
1677
1677
|
value: h(b),
|
|
1678
|
-
onChange: (
|
|
1678
|
+
onChange: (z) => u(b, z)
|
|
1679
1679
|
},
|
|
1680
1680
|
b
|
|
1681
1681
|
)) }),
|
|
1682
1682
|
(a.type === "text" || a.type === "vision") && /* @__PURE__ */ e(
|
|
1683
|
-
|
|
1683
|
+
dt,
|
|
1684
1684
|
{
|
|
1685
1685
|
nodeId: a.id,
|
|
1686
1686
|
outputSchema: a.data.outputSchema,
|
|
1687
|
-
updateNodeData:
|
|
1687
|
+
updateNodeData: p
|
|
1688
1688
|
}
|
|
1689
1689
|
)
|
|
1690
1690
|
] }) });
|
|
1691
1691
|
}
|
|
1692
|
-
function
|
|
1693
|
-
const
|
|
1694
|
-
return l.enum ? /* @__PURE__ */
|
|
1695
|
-
/* @__PURE__ */ e("label", { className: "block text-sm font-medium text-gray-700 dark:text-zinc-300 mb-1", children:
|
|
1696
|
-
/* @__PURE__ */
|
|
1692
|
+
function lt({ name: r, field: l, value: t, onChange: n }) {
|
|
1693
|
+
const i = l.title || r, s = "w-full px-3 py-2 border border-gray-300 dark:border-zinc-600 rounded-md shadow-sm focus:ring-teal-500 focus:border-teal-500 bg-white dark:bg-zinc-900 text-gray-900 dark:text-zinc-100";
|
|
1694
|
+
return l.enum ? /* @__PURE__ */ o("div", { children: [
|
|
1695
|
+
/* @__PURE__ */ e("label", { className: "block text-sm font-medium text-gray-700 dark:text-zinc-300 mb-1", children: i }),
|
|
1696
|
+
/* @__PURE__ */ o(
|
|
1697
1697
|
"select",
|
|
1698
1698
|
{
|
|
1699
1699
|
value: String(t || ""),
|
|
1700
|
-
onChange: (
|
|
1701
|
-
className:
|
|
1700
|
+
onChange: (p) => n(p.target.value),
|
|
1701
|
+
className: s,
|
|
1702
1702
|
children: [
|
|
1703
1703
|
/* @__PURE__ */ e("option", { value: "", children: "Select..." }),
|
|
1704
|
-
l.enum.map((
|
|
1704
|
+
l.enum.map((p) => /* @__PURE__ */ e("option", { value: p, children: p }, p))
|
|
1705
1705
|
]
|
|
1706
1706
|
}
|
|
1707
1707
|
),
|
|
1708
1708
|
l.description && /* @__PURE__ */ e("p", { className: "mt-1 text-xs text-gray-500 dark:text-zinc-400", children: l.description })
|
|
1709
|
-
] }) : l.type === "number" ? /* @__PURE__ */
|
|
1710
|
-
/* @__PURE__ */ e("label", { className: "block text-sm font-medium text-gray-700 dark:text-zinc-300 mb-1", children:
|
|
1709
|
+
] }) : l.type === "number" ? /* @__PURE__ */ o("div", { children: [
|
|
1710
|
+
/* @__PURE__ */ e("label", { className: "block text-sm font-medium text-gray-700 dark:text-zinc-300 mb-1", children: i }),
|
|
1711
1711
|
/* @__PURE__ */ e(
|
|
1712
1712
|
"input",
|
|
1713
1713
|
{
|
|
1714
1714
|
type: "number",
|
|
1715
1715
|
value: t !== void 0 ? Number(t) : "",
|
|
1716
|
-
onChange: (
|
|
1716
|
+
onChange: (p) => n(Number(p.target.value)),
|
|
1717
1717
|
min: l.minimum,
|
|
1718
1718
|
max: l.maximum,
|
|
1719
|
-
className:
|
|
1719
|
+
className: s
|
|
1720
1720
|
}
|
|
1721
1721
|
),
|
|
1722
1722
|
l.description && /* @__PURE__ */ e("p", { className: "mt-1 text-xs text-gray-500 dark:text-zinc-400", children: l.description })
|
|
1723
|
-
] }) : l.type === "boolean" ? /* @__PURE__ */
|
|
1723
|
+
] }) : l.type === "boolean" ? /* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
|
|
1724
1724
|
/* @__PURE__ */ e(
|
|
1725
1725
|
"input",
|
|
1726
1726
|
{
|
|
1727
1727
|
type: "checkbox",
|
|
1728
1728
|
checked: !!t,
|
|
1729
|
-
onChange: (
|
|
1729
|
+
onChange: (p) => n(p.target.checked),
|
|
1730
1730
|
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"
|
|
1731
1731
|
}
|
|
1732
1732
|
),
|
|
1733
|
-
/* @__PURE__ */ e("label", { className: "text-sm font-medium text-gray-700 dark:text-zinc-300", children:
|
|
1734
|
-
] }) : r.toLowerCase().includes("color") && typeof t == "string" && t.startsWith("#") ? /* @__PURE__ */
|
|
1735
|
-
/* @__PURE__ */ e("label", { className: "block text-sm font-medium text-gray-700 dark:text-zinc-300 mb-1", children:
|
|
1736
|
-
/* @__PURE__ */
|
|
1733
|
+
/* @__PURE__ */ e("label", { className: "text-sm font-medium text-gray-700 dark:text-zinc-300", children: i })
|
|
1734
|
+
] }) : r.toLowerCase().includes("color") && typeof t == "string" && t.startsWith("#") ? /* @__PURE__ */ o("div", { children: [
|
|
1735
|
+
/* @__PURE__ */ e("label", { className: "block text-sm font-medium text-gray-700 dark:text-zinc-300 mb-1", children: i }),
|
|
1736
|
+
/* @__PURE__ */ o("div", { className: "flex gap-2", children: [
|
|
1737
1737
|
/* @__PURE__ */ e(
|
|
1738
1738
|
"input",
|
|
1739
1739
|
{
|
|
1740
1740
|
type: "color",
|
|
1741
1741
|
value: String(t || "#000000"),
|
|
1742
|
-
onChange: (
|
|
1742
|
+
onChange: (p) => n(p.target.value),
|
|
1743
1743
|
className: "h-10 w-14 p-1 border border-gray-300 dark:border-zinc-600 rounded"
|
|
1744
1744
|
}
|
|
1745
1745
|
),
|
|
@@ -1748,73 +1748,73 @@ function it({ name: r, field: l, value: t, onChange: n }) {
|
|
|
1748
1748
|
{
|
|
1749
1749
|
type: "text",
|
|
1750
1750
|
value: String(t || ""),
|
|
1751
|
-
onChange: (
|
|
1752
|
-
className:
|
|
1751
|
+
onChange: (p) => n(p.target.value),
|
|
1752
|
+
className: s + " flex-1"
|
|
1753
1753
|
}
|
|
1754
1754
|
)
|
|
1755
1755
|
] })
|
|
1756
|
-
] }) : l.type === "object" ? /* @__PURE__ */
|
|
1757
|
-
/* @__PURE__ */ e("label", { className: "block text-sm font-medium text-gray-700 dark:text-zinc-300 mb-1", children:
|
|
1756
|
+
] }) : l.type === "object" ? /* @__PURE__ */ o("div", { children: [
|
|
1757
|
+
/* @__PURE__ */ e("label", { className: "block text-sm font-medium text-gray-700 dark:text-zinc-300 mb-1", children: i }),
|
|
1758
1758
|
/* @__PURE__ */ e(
|
|
1759
1759
|
"textarea",
|
|
1760
1760
|
{
|
|
1761
1761
|
value: t ? JSON.stringify(t, null, 2) : "{}",
|
|
1762
|
-
onChange: (
|
|
1762
|
+
onChange: (p) => {
|
|
1763
1763
|
try {
|
|
1764
|
-
n(JSON.parse(
|
|
1764
|
+
n(JSON.parse(p.target.value));
|
|
1765
1765
|
} catch {
|
|
1766
1766
|
}
|
|
1767
1767
|
},
|
|
1768
1768
|
rows: 4,
|
|
1769
|
-
className:
|
|
1769
|
+
className: s + " font-mono text-xs"
|
|
1770
1770
|
}
|
|
1771
1771
|
),
|
|
1772
1772
|
l.description && /* @__PURE__ */ e("p", { className: "mt-1 text-xs text-gray-500 dark:text-zinc-400", children: l.description })
|
|
1773
|
-
] }) : /* @__PURE__ */
|
|
1774
|
-
/* @__PURE__ */ e("label", { className: "block text-sm font-medium text-gray-700 dark:text-zinc-300 mb-1", children:
|
|
1773
|
+
] }) : /* @__PURE__ */ o("div", { children: [
|
|
1774
|
+
/* @__PURE__ */ e("label", { className: "block text-sm font-medium text-gray-700 dark:text-zinc-300 mb-1", children: i }),
|
|
1775
1775
|
r === "prompt" || r === "code" || r === "text" ? /* @__PURE__ */ e(
|
|
1776
1776
|
"textarea",
|
|
1777
1777
|
{
|
|
1778
1778
|
value: String(t || ""),
|
|
1779
|
-
onChange: (
|
|
1779
|
+
onChange: (p) => n(p.target.value),
|
|
1780
1780
|
rows: 3,
|
|
1781
|
-
className:
|
|
1781
|
+
className: s
|
|
1782
1782
|
}
|
|
1783
1783
|
) : /* @__PURE__ */ e(
|
|
1784
1784
|
"input",
|
|
1785
1785
|
{
|
|
1786
1786
|
type: "text",
|
|
1787
1787
|
value: String(t || ""),
|
|
1788
|
-
onChange: (
|
|
1789
|
-
className:
|
|
1788
|
+
onChange: (p) => n(p.target.value),
|
|
1789
|
+
className: s
|
|
1790
1790
|
}
|
|
1791
1791
|
),
|
|
1792
1792
|
l.description && /* @__PURE__ */ e("p", { className: "mt-1 text-xs text-gray-500 dark:text-zinc-400", children: l.description })
|
|
1793
1793
|
] });
|
|
1794
1794
|
}
|
|
1795
|
-
function
|
|
1796
|
-
const [n,
|
|
1795
|
+
function dt({ nodeId: r, outputSchema: l, updateNodeData: t }) {
|
|
1796
|
+
const [n, i] = I(""), s = (l == null ? void 0 : l.properties) || {}, p = Object.entries(s), d = () => {
|
|
1797
1797
|
if (!n.trim()) return;
|
|
1798
1798
|
const u = {
|
|
1799
1799
|
type: "object",
|
|
1800
1800
|
properties: {
|
|
1801
|
-
...
|
|
1801
|
+
...s,
|
|
1802
1802
|
[n.trim()]: { type: "string" }
|
|
1803
1803
|
}
|
|
1804
1804
|
};
|
|
1805
|
-
t(r, { outputSchema: u }),
|
|
1805
|
+
t(r, { outputSchema: u }), i("");
|
|
1806
1806
|
}, a = (u) => {
|
|
1807
|
-
const h = { ...
|
|
1807
|
+
const h = { ...s };
|
|
1808
1808
|
delete h[u], Object.keys(h).length === 0 ? t(r, { outputSchema: void 0 }) : t(r, {
|
|
1809
1809
|
outputSchema: { type: "object", properties: h }
|
|
1810
1810
|
});
|
|
1811
|
-
},
|
|
1811
|
+
}, m = (u, h) => {
|
|
1812
1812
|
t(r, {
|
|
1813
1813
|
outputSchema: {
|
|
1814
1814
|
type: "object",
|
|
1815
1815
|
properties: {
|
|
1816
|
-
...
|
|
1817
|
-
[u]: { ...
|
|
1816
|
+
...s,
|
|
1817
|
+
[u]: { ...s[u], type: h }
|
|
1818
1818
|
}
|
|
1819
1819
|
}
|
|
1820
1820
|
});
|
|
@@ -1823,31 +1823,31 @@ function lt({ nodeId: r, outputSchema: l, updateNodeData: t }) {
|
|
|
1823
1823
|
outputSchema: {
|
|
1824
1824
|
type: "object",
|
|
1825
1825
|
properties: {
|
|
1826
|
-
...
|
|
1827
|
-
[u]: { ...
|
|
1826
|
+
...s,
|
|
1827
|
+
[u]: { ...s[u], description: h || void 0 }
|
|
1828
1828
|
}
|
|
1829
1829
|
}
|
|
1830
1830
|
});
|
|
1831
1831
|
};
|
|
1832
|
-
return /* @__PURE__ */
|
|
1833
|
-
/* @__PURE__ */
|
|
1832
|
+
return /* @__PURE__ */ o("div", { className: "mt-6 pt-4 border-t border-gray-200 dark:border-zinc-700", children: [
|
|
1833
|
+
/* @__PURE__ */ o("div", { className: "flex items-center justify-between mb-3", children: [
|
|
1834
1834
|
/* @__PURE__ */ e("h3", { className: "text-sm font-medium text-gray-700 dark:text-zinc-300", children: "Output Schema" }),
|
|
1835
|
-
/* @__PURE__ */ e("span", { className: "text-xs text-gray-500 dark:text-zinc-500", children:
|
|
1835
|
+
/* @__PURE__ */ e("span", { className: "text-xs text-gray-500 dark:text-zinc-500", children: p.length > 0 ? `${p.length} output${p.length > 1 ? "s" : ""}` : "No outputs defined" })
|
|
1836
1836
|
] }),
|
|
1837
1837
|
/* @__PURE__ */ e("p", { className: "text-xs text-gray-500 dark:text-zinc-400 mb-3", children: "Define output properties to enable connecting individual JSON fields to other nodes." }),
|
|
1838
|
-
|
|
1838
|
+
p.length > 0 && /* @__PURE__ */ e("div", { className: "space-y-2 mb-3", children: p.map(([u, h]) => /* @__PURE__ */ o(
|
|
1839
1839
|
"div",
|
|
1840
1840
|
{
|
|
1841
1841
|
className: "flex items-center gap-2 p-2 bg-pink-50 dark:bg-pink-900/20 rounded border border-pink-200 dark:border-pink-800",
|
|
1842
1842
|
children: [
|
|
1843
|
-
/* @__PURE__ */
|
|
1844
|
-
/* @__PURE__ */
|
|
1843
|
+
/* @__PURE__ */ o("div", { className: "flex-1 min-w-0", children: [
|
|
1844
|
+
/* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
|
|
1845
1845
|
/* @__PURE__ */ e("span", { className: "text-sm font-medium text-pink-700 dark:text-pink-300 truncate", children: u }),
|
|
1846
|
-
/* @__PURE__ */
|
|
1846
|
+
/* @__PURE__ */ o(
|
|
1847
1847
|
"select",
|
|
1848
1848
|
{
|
|
1849
1849
|
value: h.type,
|
|
1850
|
-
onChange: (f) =>
|
|
1850
|
+
onChange: (f) => m(u, f.target.value),
|
|
1851
1851
|
className: "text-xs px-1.5 py-0.5 rounded border border-pink-300 dark:border-pink-700 bg-white dark:bg-zinc-800 text-gray-700 dark:text-zinc-300",
|
|
1852
1852
|
children: [
|
|
1853
1853
|
/* @__PURE__ */ e("option", { value: "string", children: "string" }),
|
|
@@ -1891,13 +1891,13 @@ function lt({ nodeId: r, outputSchema: l, updateNodeData: t }) {
|
|
|
1891
1891
|
},
|
|
1892
1892
|
u
|
|
1893
1893
|
)) }),
|
|
1894
|
-
/* @__PURE__ */
|
|
1894
|
+
/* @__PURE__ */ o("div", { className: "flex gap-2", children: [
|
|
1895
1895
|
/* @__PURE__ */ e(
|
|
1896
1896
|
"input",
|
|
1897
1897
|
{
|
|
1898
1898
|
type: "text",
|
|
1899
1899
|
value: n,
|
|
1900
|
-
onChange: (u) =>
|
|
1900
|
+
onChange: (u) => i(u.target.value),
|
|
1901
1901
|
onKeyDown: (u) => u.key === "Enter" && d(),
|
|
1902
1902
|
placeholder: "Property name...",
|
|
1903
1903
|
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"
|
|
@@ -1913,33 +1913,33 @@ function lt({ nodeId: r, outputSchema: l, updateNodeData: t }) {
|
|
|
1913
1913
|
}
|
|
1914
1914
|
)
|
|
1915
1915
|
] }),
|
|
1916
|
-
|
|
1916
|
+
p.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." })
|
|
1917
1917
|
] });
|
|
1918
1918
|
}
|
|
1919
|
-
function
|
|
1920
|
-
const t = new Map(r.map((d) => [d.id, d])), n = /* @__PURE__ */ new Map(),
|
|
1919
|
+
function ct(r, l) {
|
|
1920
|
+
const t = new Map(r.map((d) => [d.id, d])), n = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
|
|
1921
1921
|
for (const d of r)
|
|
1922
|
-
n.set(d.id, 0),
|
|
1922
|
+
n.set(d.id, 0), i.set(d.id, []);
|
|
1923
1923
|
for (const d of l) {
|
|
1924
|
-
const a =
|
|
1925
|
-
a.push(d.target),
|
|
1924
|
+
const a = i.get(d.source) || [];
|
|
1925
|
+
a.push(d.target), i.set(d.source, a), n.set(d.target, (n.get(d.target) || 0) + 1);
|
|
1926
1926
|
}
|
|
1927
|
-
const
|
|
1927
|
+
const s = [];
|
|
1928
1928
|
for (const [d, a] of n)
|
|
1929
|
-
a === 0 &&
|
|
1930
|
-
const
|
|
1931
|
-
for (;
|
|
1932
|
-
const d =
|
|
1933
|
-
a &&
|
|
1934
|
-
const
|
|
1935
|
-
for (const c of
|
|
1929
|
+
a === 0 && s.push(d);
|
|
1930
|
+
const p = [];
|
|
1931
|
+
for (; s.length > 0; ) {
|
|
1932
|
+
const d = s.shift(), a = t.get(d);
|
|
1933
|
+
a && p.push(a);
|
|
1934
|
+
const m = i.get(d) || [];
|
|
1935
|
+
for (const c of m) {
|
|
1936
1936
|
const u = (n.get(c) || 1) - 1;
|
|
1937
|
-
n.set(c, u), u === 0 &&
|
|
1937
|
+
n.set(c, u), u === 0 && s.push(c);
|
|
1938
1938
|
}
|
|
1939
1939
|
}
|
|
1940
|
-
return
|
|
1940
|
+
return p;
|
|
1941
1941
|
}
|
|
1942
|
-
function
|
|
1942
|
+
function mt(r) {
|
|
1943
1943
|
const l = r.type || "node", t = r.id.replace(/[^a-zA-Z0-9]/g, "_");
|
|
1944
1944
|
return `${l}_${t}`;
|
|
1945
1945
|
}
|
|
@@ -1947,20 +1947,20 @@ function G(r) {
|
|
|
1947
1947
|
return typeof r == "string" ? r.includes(`
|
|
1948
1948
|
`) ? "`" + r.replace(/`/g, "\\`").replace(/\$/g, "\\$") + "`" : JSON.stringify(r) : JSON.stringify(r, null, 2);
|
|
1949
1949
|
}
|
|
1950
|
-
function
|
|
1951
|
-
const n = t.get(r.id),
|
|
1950
|
+
function pt(r, l, t) {
|
|
1951
|
+
const n = t.get(r.id), i = [], s = l.find((d) => d.target === r.id), p = s ? t.get(s.source) : null;
|
|
1952
1952
|
switch (r.type) {
|
|
1953
1953
|
case "generator": {
|
|
1954
1954
|
const d = r.data;
|
|
1955
|
-
|
|
1956
|
-
const a = d.params || {},
|
|
1955
|
+
i.push(d.generatorName);
|
|
1956
|
+
const a = d.params || {}, m = Object.entries(a).filter(([, c]) => c !== void 0 && c !== "").map(([c, u]) => ` ${c}: ${G(u)}`).join(`,
|
|
1957
1957
|
`);
|
|
1958
1958
|
return {
|
|
1959
1959
|
code: `// Generate image using ${d.generatorName}
|
|
1960
1960
|
const ${n} = await ${d.generatorName}({
|
|
1961
|
-
${
|
|
1961
|
+
${m}
|
|
1962
1962
|
});`,
|
|
1963
|
-
imports:
|
|
1963
|
+
imports: i
|
|
1964
1964
|
};
|
|
1965
1965
|
}
|
|
1966
1966
|
case "input":
|
|
@@ -1970,44 +1970,44 @@ const ${n} = await flo.loadImage("./input.png");`,
|
|
|
1970
1970
|
imports: []
|
|
1971
1971
|
};
|
|
1972
1972
|
case "transform": {
|
|
1973
|
-
const d = r.data, a = d.params || {},
|
|
1973
|
+
const d = r.data, a = d.params || {}, m = Object.entries(a).filter(([, u]) => u !== void 0 && u !== "").map(([u, h]) => `${u}: ${G(h)}`).join(", "), c = p || "image";
|
|
1974
1974
|
return {
|
|
1975
1975
|
code: `// Apply ${d.operation} transform
|
|
1976
|
-
const ${n} = await flo.transform(${c}, "${d.operation}"${
|
|
1976
|
+
const ${n} = await flo.transform(${c}, "${d.operation}"${m ? `, { ${m} }` : ""});`,
|
|
1977
1977
|
imports: []
|
|
1978
1978
|
};
|
|
1979
1979
|
}
|
|
1980
1980
|
case "vision": {
|
|
1981
1981
|
const d = r.data;
|
|
1982
|
-
|
|
1983
|
-
const a = d.params || {},
|
|
1982
|
+
i.push(d.providerName);
|
|
1983
|
+
const a = d.params || {}, m = p || "image", c = Object.entries(a).filter(([, u]) => u !== void 0 && u !== "").map(([u, h]) => ` ${u}: ${G(h)}`).join(`,
|
|
1984
1984
|
`);
|
|
1985
1985
|
return {
|
|
1986
1986
|
code: `// Analyze image with ${d.providerName}
|
|
1987
|
-
const ${n} = await ${d.providerName}.analyze(${
|
|
1987
|
+
const ${n} = await ${d.providerName}.analyze(${m}, {
|
|
1988
1988
|
${c}
|
|
1989
1989
|
});`,
|
|
1990
|
-
imports:
|
|
1990
|
+
imports: i
|
|
1991
1991
|
};
|
|
1992
1992
|
}
|
|
1993
1993
|
case "text": {
|
|
1994
1994
|
const d = r.data;
|
|
1995
|
-
|
|
1996
|
-
const a = d.params || {},
|
|
1995
|
+
i.push(d.providerName);
|
|
1996
|
+
const a = d.params || {}, m = Object.entries(a).filter(([, c]) => c !== void 0 && c !== "").map(([c, u]) => ` ${c}: ${G(u)}`).join(`,
|
|
1997
1997
|
`);
|
|
1998
1998
|
return {
|
|
1999
1999
|
code: `// Generate text with ${d.providerName}
|
|
2000
2000
|
const ${n} = await ${d.providerName}.generate({
|
|
2001
|
-
${
|
|
2001
|
+
${m}
|
|
2002
2002
|
});`,
|
|
2003
|
-
imports:
|
|
2003
|
+
imports: i
|
|
2004
2004
|
};
|
|
2005
2005
|
}
|
|
2006
2006
|
case "save": {
|
|
2007
2007
|
const d = r.data;
|
|
2008
2008
|
return {
|
|
2009
2009
|
code: `// Save result
|
|
2010
|
-
await flo.save(${
|
|
2010
|
+
await flo.save(${p || "result"}, ${G(d.destination)});`,
|
|
2011
2011
|
imports: []
|
|
2012
2012
|
};
|
|
2013
2013
|
}
|
|
@@ -2018,22 +2018,22 @@ await flo.save(${m || "result"}, ${G(d.destination)});`,
|
|
|
2018
2018
|
};
|
|
2019
2019
|
}
|
|
2020
2020
|
}
|
|
2021
|
-
function
|
|
2021
|
+
function ut(r, l) {
|
|
2022
2022
|
if (r.length === 0)
|
|
2023
2023
|
return `// Empty workflow
|
|
2024
2024
|
// Add nodes to your canvas to generate code`;
|
|
2025
|
-
const t =
|
|
2026
|
-
for (const
|
|
2027
|
-
n.set(
|
|
2028
|
-
const
|
|
2029
|
-
for (const
|
|
2030
|
-
const { code: c, imports: u } =
|
|
2031
|
-
|
|
2025
|
+
const t = ct(r, l), n = /* @__PURE__ */ new Map();
|
|
2026
|
+
for (const m of t)
|
|
2027
|
+
n.set(m.id, mt(m));
|
|
2028
|
+
const i = /* @__PURE__ */ new Set(), s = [];
|
|
2029
|
+
for (const m of t) {
|
|
2030
|
+
const { code: c, imports: u } = pt(m, l, n);
|
|
2031
|
+
s.push(c);
|
|
2032
2032
|
for (const h of u)
|
|
2033
|
-
|
|
2033
|
+
i.add(h);
|
|
2034
2034
|
}
|
|
2035
|
-
const
|
|
2036
|
-
|
|
2035
|
+
const p = [];
|
|
2036
|
+
i.size > 0 && p.push(`import { ${Array.from(i).join(", ")} } from "@teamflojo/floimg";`), p.push('import * as flo from "@teamflojo/floimg";');
|
|
2037
2037
|
const d = `/**
|
|
2038
2038
|
* FloImg Workflow
|
|
2039
2039
|
* Generated by FloImg Studio
|
|
@@ -2042,8 +2042,8 @@ function pt(r, l) {
|
|
|
2042
2042
|
|
|
2043
2043
|
`, a = `
|
|
2044
2044
|
async function runWorkflow() {
|
|
2045
|
-
${
|
|
2046
|
-
(
|
|
2045
|
+
${s.map(
|
|
2046
|
+
(m) => m.split(`
|
|
2047
2047
|
`).map((c) => " " + c).join(`
|
|
2048
2048
|
`)
|
|
2049
2049
|
).join(`
|
|
@@ -2054,20 +2054,20 @@ ${i.map(
|
|
|
2054
2054
|
// Run the workflow
|
|
2055
2055
|
runWorkflow().catch(console.error);
|
|
2056
2056
|
`;
|
|
2057
|
-
return d +
|
|
2057
|
+
return d + p.join(`
|
|
2058
2058
|
`) + `
|
|
2059
2059
|
` + a;
|
|
2060
2060
|
}
|
|
2061
|
-
function
|
|
2062
|
-
const [n,
|
|
2061
|
+
function gt({ isOpen: r, onClose: l, onImport: t }) {
|
|
2062
|
+
const [n, i] = I(""), [s, p] = I(!1), [d, a] = I(null), [m, c] = I(!1), u = L(async () => {
|
|
2063
2063
|
if (!n.trim()) {
|
|
2064
2064
|
a({ message: "Please enter or paste YAML content" });
|
|
2065
2065
|
return;
|
|
2066
2066
|
}
|
|
2067
|
-
|
|
2067
|
+
p(!0), a(null);
|
|
2068
2068
|
try {
|
|
2069
|
-
const g = await
|
|
2070
|
-
g.success ? (t(g.nodes, g.edges, g.name),
|
|
2069
|
+
const g = await He(n);
|
|
2070
|
+
g.success ? (t(g.nodes, g.edges, g.name), i(""), l()) : a({
|
|
2071
2071
|
message: g.error || "Import failed",
|
|
2072
2072
|
line: g.line,
|
|
2073
2073
|
column: g.column
|
|
@@ -2075,21 +2075,21 @@ function ut({ isOpen: r, onClose: l, onImport: t }) {
|
|
|
2075
2075
|
} catch (g) {
|
|
2076
2076
|
a({ message: g instanceof Error ? g.message : "Import failed" });
|
|
2077
2077
|
} finally {
|
|
2078
|
-
|
|
2078
|
+
p(!1);
|
|
2079
2079
|
}
|
|
2080
2080
|
}, [n, t, l]), h = L(async () => {
|
|
2081
2081
|
if (!n.trim()) {
|
|
2082
2082
|
a({ message: "Please enter or paste YAML content" });
|
|
2083
2083
|
return;
|
|
2084
2084
|
}
|
|
2085
|
-
|
|
2085
|
+
p(!0), a(null);
|
|
2086
2086
|
try {
|
|
2087
|
-
const g = await
|
|
2087
|
+
const g = await _e(n);
|
|
2088
2088
|
g.valid ? (a(null), a({ message: "Valid YAML!" }), setTimeout(() => a(null), 2e3)) : g.errors.length > 0 && a(g.errors[0]);
|
|
2089
2089
|
} catch (g) {
|
|
2090
2090
|
a({ message: g instanceof Error ? g.message : "Validation failed" });
|
|
2091
2091
|
} finally {
|
|
2092
|
-
|
|
2092
|
+
p(!1);
|
|
2093
2093
|
}
|
|
2094
2094
|
}, [n]), f = L(async (g) => {
|
|
2095
2095
|
if (!g.name.endsWith(".yaml") && !g.name.endsWith(".yml")) {
|
|
@@ -2097,32 +2097,32 @@ function ut({ isOpen: r, onClose: l, onImport: t }) {
|
|
|
2097
2097
|
return;
|
|
2098
2098
|
}
|
|
2099
2099
|
try {
|
|
2100
|
-
const
|
|
2101
|
-
|
|
2100
|
+
const z = await g.text();
|
|
2101
|
+
i(z), a(null);
|
|
2102
2102
|
} catch {
|
|
2103
2103
|
a({ message: "Failed to read file" });
|
|
2104
2104
|
}
|
|
2105
|
-
}, []),
|
|
2105
|
+
}, []), y = L((g) => {
|
|
2106
2106
|
g.preventDefault(), c(!0);
|
|
2107
2107
|
}, []), v = L((g) => {
|
|
2108
2108
|
g.preventDefault(), c(!1);
|
|
2109
|
-
}, []),
|
|
2109
|
+
}, []), w = L(
|
|
2110
2110
|
(g) => {
|
|
2111
2111
|
g.preventDefault(), c(!1);
|
|
2112
|
-
const
|
|
2113
|
-
|
|
2112
|
+
const z = g.dataTransfer.files[0];
|
|
2113
|
+
z && f(z);
|
|
2114
2114
|
},
|
|
2115
2115
|
[f]
|
|
2116
2116
|
), b = L(
|
|
2117
2117
|
(g) => {
|
|
2118
2118
|
var W;
|
|
2119
|
-
const
|
|
2120
|
-
|
|
2119
|
+
const z = (W = g.target.files) == null ? void 0 : W[0];
|
|
2120
|
+
z && f(z);
|
|
2121
2121
|
},
|
|
2122
2122
|
[f]
|
|
2123
2123
|
);
|
|
2124
|
-
return r ? /* @__PURE__ */ e("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50", children: /* @__PURE__ */
|
|
2125
|
-
/* @__PURE__ */
|
|
2124
|
+
return r ? /* @__PURE__ */ e("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50", children: /* @__PURE__ */ o("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: [
|
|
2125
|
+
/* @__PURE__ */ o("div", { className: "flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-zinc-700", children: [
|
|
2126
2126
|
/* @__PURE__ */ e("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white", children: "Import Workflow" }),
|
|
2127
2127
|
/* @__PURE__ */ e(
|
|
2128
2128
|
"button",
|
|
@@ -2141,15 +2141,15 @@ function ut({ isOpen: r, onClose: l, onImport: t }) {
|
|
|
2141
2141
|
}
|
|
2142
2142
|
)
|
|
2143
2143
|
] }),
|
|
2144
|
-
/* @__PURE__ */
|
|
2144
|
+
/* @__PURE__ */ o("div", { className: "p-4 flex-1 overflow-auto", children: [
|
|
2145
2145
|
/* @__PURE__ */ e("p", { className: "text-sm text-gray-600 dark:text-zinc-400 mb-4", children: "Paste YAML content or drag and drop a .yaml file to import a workflow." }),
|
|
2146
|
-
/* @__PURE__ */
|
|
2146
|
+
/* @__PURE__ */ o(
|
|
2147
2147
|
"div",
|
|
2148
2148
|
{
|
|
2149
|
-
onDragOver:
|
|
2149
|
+
onDragOver: y,
|
|
2150
2150
|
onDragLeave: v,
|
|
2151
|
-
onDrop:
|
|
2152
|
-
className: `border-2 border-dashed rounded-lg p-4 mb-4 text-center transition-colors ${
|
|
2151
|
+
onDrop: w,
|
|
2152
|
+
className: `border-2 border-dashed rounded-lg p-4 mb-4 text-center transition-colors ${m ? "border-teal-500 bg-teal-50 dark:bg-teal-900/20" : "border-gray-300 dark:border-zinc-600"}`,
|
|
2153
2153
|
children: [
|
|
2154
2154
|
/* @__PURE__ */ e(
|
|
2155
2155
|
"input",
|
|
@@ -2161,7 +2161,7 @@ function ut({ isOpen: r, onClose: l, onImport: t }) {
|
|
|
2161
2161
|
id: "yaml-file-input"
|
|
2162
2162
|
}
|
|
2163
2163
|
),
|
|
2164
|
-
/* @__PURE__ */
|
|
2164
|
+
/* @__PURE__ */ o(
|
|
2165
2165
|
"label",
|
|
2166
2166
|
{
|
|
2167
2167
|
htmlFor: "yaml-file-input",
|
|
@@ -2201,7 +2201,7 @@ function ut({ isOpen: r, onClose: l, onImport: t }) {
|
|
|
2201
2201
|
{
|
|
2202
2202
|
value: n,
|
|
2203
2203
|
onChange: (g) => {
|
|
2204
|
-
|
|
2204
|
+
i(g.target.value), a(null);
|
|
2205
2205
|
},
|
|
2206
2206
|
placeholder: `name: My Workflow
|
|
2207
2207
|
steps:
|
|
@@ -2225,13 +2225,13 @@ steps:
|
|
|
2225
2225
|
className: "w-full h-64 p-3 font-mono text-sm bg-gray-100 dark:bg-zinc-900 border border-gray-300 dark:border-zinc-600 rounded-lg focus:outline-none focus:ring-2 focus:ring-teal-500 text-gray-800 dark:text-zinc-200"
|
|
2226
2226
|
}
|
|
2227
2227
|
),
|
|
2228
|
-
d && /* @__PURE__ */
|
|
2228
|
+
d && /* @__PURE__ */ o(
|
|
2229
2229
|
"div",
|
|
2230
2230
|
{
|
|
2231
2231
|
className: `mt-4 p-3 rounded-lg text-sm ${d.message === "Valid YAML!" ? "bg-green-50 dark:bg-green-900/30 text-green-700 dark:text-green-400" : "bg-red-50 dark:bg-red-900/30 text-red-700 dark:text-red-400"}`,
|
|
2232
2232
|
children: [
|
|
2233
2233
|
/* @__PURE__ */ e("span", { className: "font-medium", children: d.message }),
|
|
2234
|
-
d.line && /* @__PURE__ */
|
|
2234
|
+
d.line && /* @__PURE__ */ o("span", { className: "ml-2 text-xs", children: [
|
|
2235
2235
|
"(line ",
|
|
2236
2236
|
d.line,
|
|
2237
2237
|
d.column ? `, column ${d.column}` : "",
|
|
@@ -2241,26 +2241,26 @@ steps:
|
|
|
2241
2241
|
}
|
|
2242
2242
|
)
|
|
2243
2243
|
] }),
|
|
2244
|
-
/* @__PURE__ */
|
|
2244
|
+
/* @__PURE__ */ o("div", { className: "flex justify-between items-center px-4 py-3 border-t border-gray-200 dark:border-zinc-700", children: [
|
|
2245
2245
|
/* @__PURE__ */ e("span", { className: "text-xs text-gray-500 dark:text-zinc-400", children: "Use with floimg CLI: floimg run workflow.yaml" }),
|
|
2246
|
-
/* @__PURE__ */
|
|
2246
|
+
/* @__PURE__ */ o("div", { className: "flex gap-2", children: [
|
|
2247
2247
|
/* @__PURE__ */ e(
|
|
2248
2248
|
"button",
|
|
2249
2249
|
{
|
|
2250
2250
|
onClick: h,
|
|
2251
|
-
disabled:
|
|
2251
|
+
disabled: s || !n.trim(),
|
|
2252
2252
|
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",
|
|
2253
2253
|
children: "Validate"
|
|
2254
2254
|
}
|
|
2255
2255
|
),
|
|
2256
|
-
/* @__PURE__ */
|
|
2256
|
+
/* @__PURE__ */ o(
|
|
2257
2257
|
"button",
|
|
2258
2258
|
{
|
|
2259
2259
|
onClick: u,
|
|
2260
|
-
disabled:
|
|
2260
|
+
disabled: s || !n.trim(),
|
|
2261
2261
|
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",
|
|
2262
2262
|
children: [
|
|
2263
|
-
|
|
2263
|
+
s && /* @__PURE__ */ o("svg", { className: "animate-spin h-4 w-4", viewBox: "0 0 24 24", fill: "none", children: [
|
|
2264
2264
|
/* @__PURE__ */ e(
|
|
2265
2265
|
"circle",
|
|
2266
2266
|
{
|
|
@@ -2289,58 +2289,59 @@ steps:
|
|
|
2289
2289
|
] })
|
|
2290
2290
|
] }) }) : null;
|
|
2291
2291
|
}
|
|
2292
|
-
function
|
|
2292
|
+
function ht({
|
|
2293
2293
|
brandingSlot: r,
|
|
2294
2294
|
beforeActionsSlot: l,
|
|
2295
2295
|
afterActionsSlot: t,
|
|
2296
|
-
hideAttribution: n = !1
|
|
2296
|
+
hideAttribution: n = !1,
|
|
2297
|
+
hideWorkflowLibrary: i = !1
|
|
2297
2298
|
} = {}) {
|
|
2298
|
-
const
|
|
2299
|
+
const s = k((N) => N.execution), p = k((N) => N.execute), d = k((N) => N.exportToYaml), a = k((N) => N.importFromYaml), m = k((N) => N.nodes), c = k((N) => N.edges), u = O((N) => N.openSettings), h = k((N) => N.activeWorkflowName), f = k((N) => N.hasUnsavedChanges), y = k((N) => N.saveWorkflow), v = k((N) => N.toggleLibrary), w = k((N) => N.setActiveWorkflowName), b = k((N) => N.selectedNodeId), g = k((N) => N.duplicateNode), [z, W] = I(!1), [x, C] = I(!1), [S, T] = I("yaml"), [Z, ge] = I(""), [ee, he] = I(""), [te, R] = I(null), [xe, K] = I(!1), [re, q] = I("");
|
|
2299
2300
|
D(() => {
|
|
2300
|
-
const
|
|
2301
|
+
const N = () => {
|
|
2301
2302
|
R("New workflow created"), setTimeout(() => R(null), 2e3);
|
|
2302
2303
|
};
|
|
2303
|
-
return window.addEventListener("new-workflow-created",
|
|
2304
|
+
return window.addEventListener("new-workflow-created", N), () => window.removeEventListener("new-workflow-created", N);
|
|
2304
2305
|
}, []);
|
|
2305
2306
|
const J = L(() => {
|
|
2306
|
-
|
|
2307
|
-
}, [
|
|
2308
|
-
q(
|
|
2309
|
-
},
|
|
2310
|
-
const
|
|
2311
|
-
|
|
2312
|
-
},
|
|
2313
|
-
|
|
2314
|
-
}, [
|
|
2307
|
+
m.length !== 0 && (y(), R("Saved!"), setTimeout(() => R(null), 2e3));
|
|
2308
|
+
}, [m.length, y]), be = () => {
|
|
2309
|
+
q(h), K(!0);
|
|
2310
|
+
}, ae = () => {
|
|
2311
|
+
const N = re.trim();
|
|
2312
|
+
N && N !== h && w(N), K(!1);
|
|
2313
|
+
}, ne = L(() => {
|
|
2314
|
+
b && g(b);
|
|
2315
|
+
}, [b, g]);
|
|
2315
2316
|
D(() => {
|
|
2316
|
-
function
|
|
2317
|
-
(M.metaKey || M.ctrlKey) && M.key === "s" && (M.preventDefault(), J()), (M.metaKey || M.ctrlKey) && M.key === "d" && (M.preventDefault(),
|
|
2317
|
+
function N(M) {
|
|
2318
|
+
(M.metaKey || M.ctrlKey) && M.key === "s" && (M.preventDefault(), J()), (M.metaKey || M.ctrlKey) && M.key === "d" && (M.preventDefault(), ne());
|
|
2318
2319
|
}
|
|
2319
|
-
return document.addEventListener("keydown",
|
|
2320
|
-
}, [J,
|
|
2321
|
-
const
|
|
2322
|
-
await
|
|
2323
|
-
},
|
|
2324
|
-
const
|
|
2325
|
-
|
|
2326
|
-
const M =
|
|
2327
|
-
|
|
2328
|
-
},
|
|
2329
|
-
const
|
|
2330
|
-
navigator.clipboard.writeText(
|
|
2331
|
-
},
|
|
2332
|
-
(
|
|
2333
|
-
|
|
2320
|
+
return document.addEventListener("keydown", N), () => document.removeEventListener("keydown", N);
|
|
2321
|
+
}, [J, ne]);
|
|
2322
|
+
const fe = async () => {
|
|
2323
|
+
await p();
|
|
2324
|
+
}, ke = async () => {
|
|
2325
|
+
const N = await d();
|
|
2326
|
+
ge(N);
|
|
2327
|
+
const M = ut(m, c);
|
|
2328
|
+
he(M), W(!0);
|
|
2329
|
+
}, ve = () => {
|
|
2330
|
+
const N = S === "yaml" ? Z : ee;
|
|
2331
|
+
navigator.clipboard.writeText(N);
|
|
2332
|
+
}, ye = L(
|
|
2333
|
+
(N, M, we) => {
|
|
2334
|
+
a(N, M, we), R("Workflow imported!"), setTimeout(() => R(null), 2e3);
|
|
2334
2335
|
},
|
|
2335
|
-
[
|
|
2336
|
+
[a]
|
|
2336
2337
|
);
|
|
2337
|
-
return /* @__PURE__ */
|
|
2338
|
-
/* @__PURE__ */
|
|
2339
|
-
/* @__PURE__ */
|
|
2340
|
-
/* @__PURE__ */ e(
|
|
2338
|
+
return /* @__PURE__ */ o(U, { children: [
|
|
2339
|
+
/* @__PURE__ */ o("div", { className: "h-14 bg-white dark:bg-zinc-800 border-b border-gray-200 dark:border-zinc-700 flex items-center justify-between px-4", children: [
|
|
2340
|
+
/* @__PURE__ */ o("div", { className: "flex items-center gap-4", children: [
|
|
2341
|
+
!i && /* @__PURE__ */ e(
|
|
2341
2342
|
"button",
|
|
2342
2343
|
{
|
|
2343
|
-
onClick:
|
|
2344
|
+
onClick: v,
|
|
2344
2345
|
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-md",
|
|
2345
2346
|
title: "My Workflows",
|
|
2346
2347
|
children: /* @__PURE__ */ e("svg", { className: "h-5 w-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e(
|
|
@@ -2354,7 +2355,7 @@ function gt({
|
|
|
2354
2355
|
) })
|
|
2355
2356
|
}
|
|
2356
2357
|
),
|
|
2357
|
-
/* @__PURE__ */
|
|
2358
|
+
/* @__PURE__ */ o("div", { className: "flex items-baseline gap-2", children: [
|
|
2358
2359
|
/* @__PURE__ */ e("h1", { className: "text-xl font-bold text-gray-800 dark:text-white", children: "FloImg Studio" }),
|
|
2359
2360
|
r,
|
|
2360
2361
|
!n && /* @__PURE__ */ e(
|
|
@@ -2368,16 +2369,16 @@ function gt({
|
|
|
2368
2369
|
}
|
|
2369
2370
|
)
|
|
2370
2371
|
] }),
|
|
2371
|
-
/* @__PURE__ */
|
|
2372
|
-
|
|
2372
|
+
/* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
|
|
2373
|
+
xe ? /* @__PURE__ */ e(
|
|
2373
2374
|
"input",
|
|
2374
2375
|
{
|
|
2375
2376
|
type: "text",
|
|
2376
|
-
value:
|
|
2377
|
-
onChange: (
|
|
2378
|
-
onBlur:
|
|
2379
|
-
onKeyDown: (
|
|
2380
|
-
|
|
2377
|
+
value: re,
|
|
2378
|
+
onChange: (N) => q(N.target.value),
|
|
2379
|
+
onBlur: ae,
|
|
2380
|
+
onKeyDown: (N) => {
|
|
2381
|
+
N.key === "Enter" && ae(), N.key === "Escape" && (q(h), K(!1));
|
|
2381
2382
|
},
|
|
2382
2383
|
className: "w-48 px-2 py-1 text-sm font-medium bg-white dark:bg-zinc-900 border border-teal-500 rounded focus:outline-none focus:ring-1 focus:ring-teal-500 text-gray-900 dark:text-zinc-100",
|
|
2383
2384
|
autoFocus: !0
|
|
@@ -2385,30 +2386,30 @@ function gt({
|
|
|
2385
2386
|
) : /* @__PURE__ */ e(
|
|
2386
2387
|
"button",
|
|
2387
2388
|
{
|
|
2388
|
-
onClick:
|
|
2389
|
+
onClick: be,
|
|
2389
2390
|
className: "text-sm text-gray-700 dark:text-zinc-300 font-medium hover:text-gray-900 dark:hover:text-zinc-100 rounded px-2 py-1 -mx-2 hover:bg-gray-100 dark:hover:bg-zinc-700 transition-colors",
|
|
2390
2391
|
title: "Click to rename",
|
|
2391
|
-
children:
|
|
2392
|
+
children: h
|
|
2392
2393
|
}
|
|
2393
2394
|
),
|
|
2394
|
-
|
|
2395
|
-
|
|
2395
|
+
f && /* @__PURE__ */ e("span", { className: "text-xs text-amber-600 dark:text-amber-400", children: "(unsaved)" }),
|
|
2396
|
+
te && /* @__PURE__ */ e("span", { className: "text-xs text-green-600 dark:text-green-400", children: te })
|
|
2396
2397
|
] }),
|
|
2397
|
-
/* @__PURE__ */
|
|
2398
|
-
|
|
2398
|
+
/* @__PURE__ */ o("span", { className: "text-sm text-gray-500 dark:text-zinc-400", children: [
|
|
2399
|
+
m.length,
|
|
2399
2400
|
" node",
|
|
2400
|
-
|
|
2401
|
+
m.length !== 1 ? "s" : ""
|
|
2401
2402
|
] })
|
|
2402
2403
|
] }),
|
|
2403
|
-
/* @__PURE__ */
|
|
2404
|
+
/* @__PURE__ */ o("div", { className: "flex items-center gap-3", children: [
|
|
2404
2405
|
l,
|
|
2405
2406
|
/* @__PURE__ */ e(
|
|
2406
2407
|
"button",
|
|
2407
2408
|
{
|
|
2408
|
-
onClick:
|
|
2409
|
+
onClick: u,
|
|
2409
2410
|
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-md",
|
|
2410
2411
|
title: "AI Settings",
|
|
2411
|
-
children: /* @__PURE__ */
|
|
2412
|
+
children: /* @__PURE__ */ o("svg", { className: "h-5 w-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: [
|
|
2412
2413
|
/* @__PURE__ */ e(
|
|
2413
2414
|
"path",
|
|
2414
2415
|
{
|
|
@@ -2434,7 +2435,7 @@ function gt({
|
|
|
2434
2435
|
"button",
|
|
2435
2436
|
{
|
|
2436
2437
|
onClick: J,
|
|
2437
|
-
disabled:
|
|
2438
|
+
disabled: m.length === 0,
|
|
2438
2439
|
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-md disabled:opacity-50 disabled:cursor-not-allowed",
|
|
2439
2440
|
title: "Save Workflow (Cmd+S)",
|
|
2440
2441
|
children: /* @__PURE__ */ e("svg", { className: "h-5 w-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e(
|
|
@@ -2451,7 +2452,7 @@ function gt({
|
|
|
2451
2452
|
/* @__PURE__ */ e(
|
|
2452
2453
|
"button",
|
|
2453
2454
|
{
|
|
2454
|
-
onClick: () =>
|
|
2455
|
+
onClick: () => C(!0),
|
|
2455
2456
|
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",
|
|
2456
2457
|
children: "Import"
|
|
2457
2458
|
}
|
|
@@ -2459,8 +2460,8 @@ function gt({
|
|
|
2459
2460
|
/* @__PURE__ */ e(
|
|
2460
2461
|
"button",
|
|
2461
2462
|
{
|
|
2462
|
-
onClick:
|
|
2463
|
-
disabled:
|
|
2463
|
+
onClick: ke,
|
|
2464
|
+
disabled: m.length === 0,
|
|
2464
2465
|
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",
|
|
2465
2466
|
children: "Export"
|
|
2466
2467
|
}
|
|
@@ -2468,11 +2469,11 @@ function gt({
|
|
|
2468
2469
|
/* @__PURE__ */ e(
|
|
2469
2470
|
"button",
|
|
2470
2471
|
{
|
|
2471
|
-
onClick:
|
|
2472
|
-
disabled:
|
|
2472
|
+
onClick: fe,
|
|
2473
|
+
disabled: m.length === 0 || s.status === "running",
|
|
2473
2474
|
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",
|
|
2474
|
-
children:
|
|
2475
|
-
/* @__PURE__ */
|
|
2475
|
+
children: s.status === "running" ? /* @__PURE__ */ o(U, { children: [
|
|
2476
|
+
/* @__PURE__ */ o("svg", { className: "animate-spin h-4 w-4", viewBox: "0 0 24 24", fill: "none", children: [
|
|
2476
2477
|
/* @__PURE__ */ e(
|
|
2477
2478
|
"circle",
|
|
2478
2479
|
{
|
|
@@ -2494,8 +2495,8 @@ function gt({
|
|
|
2494
2495
|
)
|
|
2495
2496
|
] }),
|
|
2496
2497
|
"Running..."
|
|
2497
|
-
] }) : /* @__PURE__ */
|
|
2498
|
-
/* @__PURE__ */
|
|
2498
|
+
] }) : /* @__PURE__ */ o(U, { children: [
|
|
2499
|
+
/* @__PURE__ */ o("svg", { className: "h-4 w-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: [
|
|
2499
2500
|
/* @__PURE__ */ e(
|
|
2500
2501
|
"path",
|
|
2501
2502
|
{
|
|
@@ -2522,44 +2523,44 @@ function gt({
|
|
|
2522
2523
|
t
|
|
2523
2524
|
] })
|
|
2524
2525
|
] }),
|
|
2525
|
-
|
|
2526
|
-
/* @__PURE__ */
|
|
2526
|
+
s.status === "completed" && s.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__ */ o("div", { className: "flex items-center gap-4", children: [
|
|
2527
|
+
/* @__PURE__ */ o("span", { className: "text-green-700 dark:text-green-400 font-medium", children: [
|
|
2527
2528
|
"Generated ",
|
|
2528
|
-
|
|
2529
|
+
s.imageIds.length,
|
|
2529
2530
|
" image",
|
|
2530
|
-
|
|
2531
|
+
s.imageIds.length !== 1 ? "s" : ""
|
|
2531
2532
|
] }),
|
|
2532
|
-
/* @__PURE__ */ e("div", { className: "flex gap-2", children:
|
|
2533
|
+
/* @__PURE__ */ e("div", { className: "flex gap-2", children: s.imageUrls.slice(0, 4).map((N, M) => /* @__PURE__ */ e("a", { href: N, target: "_blank", rel: "noopener noreferrer", className: "block", children: /* @__PURE__ */ e(
|
|
2533
2534
|
"img",
|
|
2534
2535
|
{
|
|
2535
|
-
src:
|
|
2536
|
+
src: N,
|
|
2536
2537
|
alt: "Generated",
|
|
2537
2538
|
className: "h-12 w-12 object-cover rounded border border-green-300 dark:border-green-700"
|
|
2538
2539
|
}
|
|
2539
2540
|
) }, M)) })
|
|
2540
2541
|
] }) }),
|
|
2541
|
-
|
|
2542
|
+
s.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__ */ o("span", { className: "text-red-700 dark:text-red-400", children: [
|
|
2542
2543
|
"Error: ",
|
|
2543
|
-
|
|
2544
|
+
s.error
|
|
2544
2545
|
] }) }),
|
|
2545
|
-
|
|
2546
|
-
/* @__PURE__ */
|
|
2547
|
-
/* @__PURE__ */
|
|
2546
|
+
z && /* @__PURE__ */ e("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50", children: /* @__PURE__ */ o("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: [
|
|
2547
|
+
/* @__PURE__ */ o("div", { className: "flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-zinc-700", children: [
|
|
2548
|
+
/* @__PURE__ */ o("div", { className: "flex items-center gap-4", children: [
|
|
2548
2549
|
/* @__PURE__ */ e("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white", children: "Export Workflow" }),
|
|
2549
|
-
/* @__PURE__ */
|
|
2550
|
+
/* @__PURE__ */ o("div", { className: "flex gap-1 bg-gray-100 dark:bg-zinc-700 rounded-lg p-1", children: [
|
|
2550
2551
|
/* @__PURE__ */ e(
|
|
2551
2552
|
"button",
|
|
2552
2553
|
{
|
|
2553
|
-
onClick: () =>
|
|
2554
|
-
className: `px-3 py-1 text-sm font-medium rounded-md transition-colors ${
|
|
2554
|
+
onClick: () => T("yaml"),
|
|
2555
|
+
className: `px-3 py-1 text-sm font-medium rounded-md transition-colors ${S === "yaml" ? "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"}`,
|
|
2555
2556
|
children: "YAML"
|
|
2556
2557
|
}
|
|
2557
2558
|
),
|
|
2558
2559
|
/* @__PURE__ */ e(
|
|
2559
2560
|
"button",
|
|
2560
2561
|
{
|
|
2561
|
-
onClick: () =>
|
|
2562
|
-
className: `px-3 py-1 text-sm font-medium rounded-md transition-colors ${
|
|
2562
|
+
onClick: () => T("javascript"),
|
|
2563
|
+
className: `px-3 py-1 text-sm font-medium rounded-md transition-colors ${S === "javascript" ? "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"}`,
|
|
2563
2564
|
children: "JavaScript"
|
|
2564
2565
|
}
|
|
2565
2566
|
)
|
|
@@ -2568,7 +2569,7 @@ function gt({
|
|
|
2568
2569
|
/* @__PURE__ */ e(
|
|
2569
2570
|
"button",
|
|
2570
2571
|
{
|
|
2571
|
-
onClick: () =>
|
|
2572
|
+
onClick: () => W(!1),
|
|
2572
2573
|
className: "text-gray-500 dark:text-zinc-400 hover:text-gray-700 dark:hover:text-zinc-200",
|
|
2573
2574
|
children: /* @__PURE__ */ e("svg", { className: "h-6 w-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e(
|
|
2574
2575
|
"path",
|
|
@@ -2582,14 +2583,14 @@ function gt({
|
|
|
2582
2583
|
}
|
|
2583
2584
|
)
|
|
2584
2585
|
] }),
|
|
2585
|
-
/* @__PURE__ */ e("div", { className: "p-4 overflow-auto flex-1", children: /* @__PURE__ */ e("pre", { className: "bg-gray-100 dark:bg-zinc-900 p-4 rounded text-sm font-mono whitespace-pre-wrap text-gray-800 dark:text-zinc-200", children:
|
|
2586
|
-
/* @__PURE__ */
|
|
2587
|
-
/* @__PURE__ */ e("span", { className: "text-xs text-gray-500 dark:text-zinc-400", children:
|
|
2588
|
-
/* @__PURE__ */
|
|
2586
|
+
/* @__PURE__ */ e("div", { className: "p-4 overflow-auto flex-1", children: /* @__PURE__ */ e("pre", { className: "bg-gray-100 dark:bg-zinc-900 p-4 rounded text-sm font-mono whitespace-pre-wrap text-gray-800 dark:text-zinc-200", children: S === "yaml" ? Z : ee }) }),
|
|
2587
|
+
/* @__PURE__ */ o("div", { className: "flex justify-between items-center px-4 py-3 border-t border-gray-200 dark:border-zinc-700", children: [
|
|
2588
|
+
/* @__PURE__ */ e("span", { className: "text-xs text-gray-500 dark:text-zinc-400", children: S === "yaml" ? "Use with floimg CLI: floimg run workflow.yaml" : "Run with Node.js or Bun" }),
|
|
2589
|
+
/* @__PURE__ */ o("div", { className: "flex gap-2", children: [
|
|
2589
2590
|
/* @__PURE__ */ e(
|
|
2590
2591
|
"button",
|
|
2591
2592
|
{
|
|
2592
|
-
onClick:
|
|
2593
|
+
onClick: ve,
|
|
2593
2594
|
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",
|
|
2594
2595
|
children: "Copy to Clipboard"
|
|
2595
2596
|
}
|
|
@@ -2597,7 +2598,7 @@ function gt({
|
|
|
2597
2598
|
/* @__PURE__ */ e(
|
|
2598
2599
|
"button",
|
|
2599
2600
|
{
|
|
2600
|
-
onClick: () =>
|
|
2601
|
+
onClick: () => W(!1),
|
|
2601
2602
|
className: "px-4 py-2 text-sm font-medium text-white bg-teal-600 rounded-md hover:bg-teal-700",
|
|
2602
2603
|
children: "Close"
|
|
2603
2604
|
}
|
|
@@ -2606,31 +2607,31 @@ function gt({
|
|
|
2606
2607
|
] })
|
|
2607
2608
|
] }) }),
|
|
2608
2609
|
/* @__PURE__ */ e(
|
|
2609
|
-
|
|
2610
|
+
gt,
|
|
2610
2611
|
{
|
|
2611
|
-
isOpen:
|
|
2612
|
-
onClose: () =>
|
|
2613
|
-
onImport:
|
|
2612
|
+
isOpen: x,
|
|
2613
|
+
onClose: () => C(!1),
|
|
2614
|
+
onImport: ye
|
|
2614
2615
|
}
|
|
2615
2616
|
)
|
|
2616
2617
|
] });
|
|
2617
2618
|
}
|
|
2618
|
-
function
|
|
2619
|
+
function xt() {
|
|
2619
2620
|
const r = k((a) => a.loadTemplate), [l, t] = I(null), {
|
|
2620
2621
|
data: n,
|
|
2621
|
-
isLoading:
|
|
2622
|
-
error:
|
|
2623
|
-
refetch:
|
|
2622
|
+
isLoading: i,
|
|
2623
|
+
error: s,
|
|
2624
|
+
refetch: p
|
|
2624
2625
|
} = F({
|
|
2625
2626
|
queryKey: ["images"],
|
|
2626
|
-
queryFn:
|
|
2627
|
+
queryFn: Ee,
|
|
2627
2628
|
refetchInterval: 5e3
|
|
2628
2629
|
// Auto-refresh every 5 seconds
|
|
2629
2630
|
}), d = async (a) => {
|
|
2630
2631
|
t(a);
|
|
2631
2632
|
try {
|
|
2632
|
-
const
|
|
2633
|
-
if (
|
|
2633
|
+
const m = await Be(a);
|
|
2634
|
+
if (m != null && m.workflow) {
|
|
2634
2635
|
const c = {
|
|
2635
2636
|
id: `image-${a}`,
|
|
2636
2637
|
name: `Workflow from ${a}`,
|
|
@@ -2638,29 +2639,29 @@ function ht() {
|
|
|
2638
2639
|
category: "Gallery",
|
|
2639
2640
|
generator: "unknown",
|
|
2640
2641
|
workflow: {
|
|
2641
|
-
nodes:
|
|
2642
|
-
edges:
|
|
2642
|
+
nodes: m.workflow.nodes,
|
|
2643
|
+
edges: m.workflow.edges
|
|
2643
2644
|
}
|
|
2644
2645
|
};
|
|
2645
2646
|
r(c), window.dispatchEvent(new CustomEvent("workflow-loaded"));
|
|
2646
2647
|
} else
|
|
2647
2648
|
alert("No workflow metadata available for this image");
|
|
2648
|
-
} catch (
|
|
2649
|
-
console.error("Failed to load workflow:",
|
|
2649
|
+
} catch (m) {
|
|
2650
|
+
console.error("Failed to load workflow:", m), alert("Failed to load workflow");
|
|
2650
2651
|
} finally {
|
|
2651
2652
|
t(null);
|
|
2652
2653
|
}
|
|
2653
2654
|
};
|
|
2654
|
-
return
|
|
2655
|
+
return i ? /* @__PURE__ */ e("div", { className: "p-8 text-center text-gray-500 dark:text-zinc-400", children: "Loading images..." }) : s ? /* @__PURE__ */ o("div", { className: "p-8 text-center text-red-500 dark:text-red-400", children: [
|
|
2655
2656
|
"Error loading images: ",
|
|
2656
|
-
|
|
2657
|
-
] }) : !n || n.length === 0 ? /* @__PURE__ */
|
|
2657
|
+
s instanceof Error ? s.message : "Unknown error"
|
|
2658
|
+
] }) : !n || n.length === 0 ? /* @__PURE__ */ o("div", { className: "p-8 text-center text-gray-500 dark:text-zinc-400", children: [
|
|
2658
2659
|
/* @__PURE__ */ e("div", { className: "text-lg mb-2", children: "No images yet" }),
|
|
2659
2660
|
/* @__PURE__ */ e("div", { className: "text-sm", children: "Create a workflow and click Execute to generate images" })
|
|
2660
|
-
] }) : /* @__PURE__ */
|
|
2661
|
-
/* @__PURE__ */
|
|
2662
|
-
/* @__PURE__ */
|
|
2663
|
-
/* @__PURE__ */
|
|
2661
|
+
] }) : /* @__PURE__ */ o("div", { className: "p-4 bg-gray-100 dark:bg-zinc-900 min-h-full", children: [
|
|
2662
|
+
/* @__PURE__ */ o("div", { className: "flex items-center justify-between mb-4", children: [
|
|
2663
|
+
/* @__PURE__ */ o("div", { children: [
|
|
2664
|
+
/* @__PURE__ */ o("h2", { className: "text-lg font-semibold text-gray-800 dark:text-white", children: [
|
|
2664
2665
|
"Images (",
|
|
2665
2666
|
n.length,
|
|
2666
2667
|
")"
|
|
@@ -2670,14 +2671,14 @@ function ht() {
|
|
|
2670
2671
|
/* @__PURE__ */ e(
|
|
2671
2672
|
"button",
|
|
2672
2673
|
{
|
|
2673
|
-
onClick: () =>
|
|
2674
|
+
onClick: () => p(),
|
|
2674
2675
|
className: "text-sm text-teal-600 dark:text-teal-400 hover:text-teal-700 dark:hover:text-violet-300",
|
|
2675
2676
|
children: "Refresh"
|
|
2676
2677
|
}
|
|
2677
2678
|
)
|
|
2678
2679
|
] }),
|
|
2679
2680
|
/* @__PURE__ */ e("div", { className: "grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4", children: n.map((a) => /* @__PURE__ */ e(
|
|
2680
|
-
|
|
2681
|
+
bt,
|
|
2681
2682
|
{
|
|
2682
2683
|
image: a,
|
|
2683
2684
|
onLoadWorkflow: () => d(a.id),
|
|
@@ -2687,21 +2688,21 @@ function ht() {
|
|
|
2687
2688
|
)) })
|
|
2688
2689
|
] });
|
|
2689
2690
|
}
|
|
2690
|
-
function
|
|
2691
|
-
const n = (
|
|
2692
|
-
return /* @__PURE__ */
|
|
2693
|
-
/* @__PURE__ */
|
|
2691
|
+
function bt({ image: r, onLoadWorkflow: l, isLoading: t }) {
|
|
2692
|
+
const n = (s) => new Date(s).toLocaleString(), i = (s) => s < 1024 ? `${s} B` : s < 1048576 ? `${(s / 1024).toFixed(1)} KB` : `${(s / 1048576).toFixed(1)} MB`;
|
|
2693
|
+
return /* @__PURE__ */ o("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: [
|
|
2694
|
+
/* @__PURE__ */ o("div", { className: "relative", children: [
|
|
2694
2695
|
/* @__PURE__ */ e(
|
|
2695
2696
|
"a",
|
|
2696
2697
|
{
|
|
2697
|
-
href:
|
|
2698
|
+
href: se(r.id),
|
|
2698
2699
|
target: "_blank",
|
|
2699
2700
|
rel: "noopener noreferrer",
|
|
2700
2701
|
className: "block aspect-square bg-gray-100 dark:bg-zinc-900",
|
|
2701
2702
|
children: /* @__PURE__ */ e(
|
|
2702
2703
|
"img",
|
|
2703
2704
|
{
|
|
2704
|
-
src:
|
|
2705
|
+
src: se(r.id),
|
|
2705
2706
|
alt: r.filename,
|
|
2706
2707
|
className: "w-full h-full object-cover",
|
|
2707
2708
|
loading: "lazy"
|
|
@@ -2712,8 +2713,8 @@ function xt({ image: r, onLoadWorkflow: l, isLoading: t }) {
|
|
|
2712
2713
|
/* @__PURE__ */ e("div", { className: "absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center", children: /* @__PURE__ */ e(
|
|
2713
2714
|
"button",
|
|
2714
2715
|
{
|
|
2715
|
-
onClick: (
|
|
2716
|
-
|
|
2716
|
+
onClick: (s) => {
|
|
2717
|
+
s.preventDefault(), l();
|
|
2717
2718
|
},
|
|
2718
2719
|
disabled: t,
|
|
2719
2720
|
className: "px-3 py-1.5 bg-teal-600 text-white text-sm rounded-lg hover:bg-teal-700 disabled:opacity-50",
|
|
@@ -2721,18 +2722,18 @@ function xt({ image: r, onLoadWorkflow: l, isLoading: t }) {
|
|
|
2721
2722
|
}
|
|
2722
2723
|
) })
|
|
2723
2724
|
] }),
|
|
2724
|
-
/* @__PURE__ */
|
|
2725
|
+
/* @__PURE__ */ o("div", { className: "p-3", children: [
|
|
2725
2726
|
/* @__PURE__ */ e("div", { className: "text-sm font-medium text-gray-800 dark:text-white truncate", children: r.filename }),
|
|
2726
|
-
/* @__PURE__ */
|
|
2727
|
+
/* @__PURE__ */ o("div", { className: "text-xs text-gray-500 dark:text-zinc-400 mt-1", children: [
|
|
2727
2728
|
r.mime,
|
|
2728
2729
|
" • ",
|
|
2729
|
-
|
|
2730
|
+
i(r.size)
|
|
2730
2731
|
] }),
|
|
2731
2732
|
/* @__PURE__ */ e("div", { className: "text-xs text-gray-400 dark:text-zinc-500 mt-1", children: n(r.createdAt) })
|
|
2732
2733
|
] })
|
|
2733
2734
|
] });
|
|
2734
2735
|
}
|
|
2735
|
-
const
|
|
2736
|
+
const ft = {
|
|
2736
2737
|
id: "sales-dashboard",
|
|
2737
2738
|
name: "Sales Dashboard",
|
|
2738
2739
|
description: "Quarterly revenue bar chart with gradient styling",
|
|
@@ -2782,7 +2783,7 @@ const bt = {
|
|
|
2782
2783
|
],
|
|
2783
2784
|
edges: []
|
|
2784
2785
|
}
|
|
2785
|
-
},
|
|
2786
|
+
}, kt = {
|
|
2786
2787
|
id: "user-growth",
|
|
2787
2788
|
name: "User Growth Line Chart",
|
|
2788
2789
|
description: "Monthly user growth with smooth bezier curves",
|
|
@@ -2830,7 +2831,7 @@ const bt = {
|
|
|
2830
2831
|
],
|
|
2831
2832
|
edges: []
|
|
2832
2833
|
}
|
|
2833
|
-
},
|
|
2834
|
+
}, vt = {
|
|
2834
2835
|
id: "api-flow",
|
|
2835
2836
|
name: "API Request Flow",
|
|
2836
2837
|
description: "Sequence diagram showing API authentication flow",
|
|
@@ -2872,7 +2873,7 @@ const bt = {
|
|
|
2872
2873
|
],
|
|
2873
2874
|
edges: []
|
|
2874
2875
|
}
|
|
2875
|
-
},
|
|
2876
|
+
}, yt = {
|
|
2876
2877
|
id: "system-architecture",
|
|
2877
2878
|
name: "System Architecture",
|
|
2878
2879
|
description: "Microservices architecture diagram",
|
|
@@ -2930,7 +2931,7 @@ const bt = {
|
|
|
2930
2931
|
],
|
|
2931
2932
|
edges: []
|
|
2932
2933
|
}
|
|
2933
|
-
},
|
|
2934
|
+
}, wt = {
|
|
2934
2935
|
id: "git-workflow",
|
|
2935
2936
|
name: "Git Branch Workflow",
|
|
2936
2937
|
description: "Git branching strategy with feature and release branches",
|
|
@@ -2973,7 +2974,7 @@ const bt = {
|
|
|
2973
2974
|
],
|
|
2974
2975
|
edges: []
|
|
2975
2976
|
}
|
|
2976
|
-
},
|
|
2977
|
+
}, Nt = {
|
|
2977
2978
|
id: "website-qr",
|
|
2978
2979
|
name: "Website QR Code",
|
|
2979
2980
|
description: "QR code linking to your website with custom styling",
|
|
@@ -3001,7 +3002,7 @@ const bt = {
|
|
|
3001
3002
|
],
|
|
3002
3003
|
edges: []
|
|
3003
3004
|
}
|
|
3004
|
-
},
|
|
3005
|
+
}, zt = {
|
|
3005
3006
|
id: "wifi-qr",
|
|
3006
3007
|
name: "WiFi QR Code",
|
|
3007
3008
|
description: "Scannable QR code for WiFi network access",
|
|
@@ -3029,7 +3030,7 @@ const bt = {
|
|
|
3029
3030
|
],
|
|
3030
3031
|
edges: []
|
|
3031
3032
|
}
|
|
3032
|
-
},
|
|
3033
|
+
}, Ct = {
|
|
3033
3034
|
id: "chart-watermark",
|
|
3034
3035
|
name: "Chart with Watermark",
|
|
3035
3036
|
description: "Bar chart with company watermark and rounded corners",
|
|
@@ -3095,7 +3096,7 @@ const bt = {
|
|
|
3095
3096
|
{ id: "e2", source: "transform-1", target: "transform-2" }
|
|
3096
3097
|
]
|
|
3097
3098
|
}
|
|
3098
|
-
},
|
|
3099
|
+
}, It = {
|
|
3099
3100
|
id: "diagram-webp",
|
|
3100
3101
|
name: "Diagram to WebP",
|
|
3101
3102
|
description: "Mermaid diagram converted to optimized WebP format",
|
|
@@ -3138,69 +3139,69 @@ const bt = {
|
|
|
3138
3139
|
}
|
|
3139
3140
|
}, H = [
|
|
3140
3141
|
// Charts
|
|
3141
|
-
bt,
|
|
3142
3142
|
ft,
|
|
3143
|
-
// Diagrams
|
|
3144
3143
|
kt,
|
|
3144
|
+
// Diagrams
|
|
3145
3145
|
vt,
|
|
3146
3146
|
yt,
|
|
3147
|
-
// QR Codes
|
|
3148
3147
|
wt,
|
|
3148
|
+
// QR Codes
|
|
3149
3149
|
Nt,
|
|
3150
|
-
// Pipelines
|
|
3151
3150
|
zt,
|
|
3152
|
-
|
|
3151
|
+
// Pipelines
|
|
3152
|
+
Ct,
|
|
3153
|
+
It
|
|
3153
3154
|
];
|
|
3154
|
-
function
|
|
3155
|
+
function St() {
|
|
3155
3156
|
const r = new Set(H.map((l) => l.category));
|
|
3156
3157
|
return Array.from(r).sort();
|
|
3157
3158
|
}
|
|
3158
|
-
function
|
|
3159
|
+
function Ft(r) {
|
|
3159
3160
|
return H.filter((l) => l.category === r);
|
|
3160
3161
|
}
|
|
3161
|
-
function
|
|
3162
|
+
function ce(r) {
|
|
3162
3163
|
return H.find((l) => l.id === r);
|
|
3163
3164
|
}
|
|
3164
|
-
function
|
|
3165
|
+
function Ht(r) {
|
|
3165
3166
|
const l = r.toLowerCase();
|
|
3166
3167
|
return H.filter(
|
|
3167
3168
|
(t) => {
|
|
3168
3169
|
var n;
|
|
3169
|
-
return t.name.toLowerCase().includes(l) || t.description.toLowerCase().includes(l) || t.category.toLowerCase().includes(l) || t.generator.toLowerCase().includes(l) || ((n = t.tags) == null ? void 0 : n.some((
|
|
3170
|
+
return t.name.toLowerCase().includes(l) || t.description.toLowerCase().includes(l) || t.category.toLowerCase().includes(l) || t.generator.toLowerCase().includes(l) || ((n = t.tags) == null ? void 0 : n.some((i) => i.toLowerCase().includes(l)));
|
|
3170
3171
|
}
|
|
3171
3172
|
);
|
|
3172
3173
|
}
|
|
3173
|
-
function
|
|
3174
|
-
const [l, t] = I(null), [n,
|
|
3174
|
+
function Lt({ onSelect: r }) {
|
|
3175
|
+
const [l, t] = I(null), [n, i] = I(""), s = oe(() => St(), []), p = oe(() => {
|
|
3175
3176
|
let d = H;
|
|
3176
3177
|
if (l && (d = d.filter((a) => a.category === l)), n) {
|
|
3177
3178
|
const a = n.toLowerCase();
|
|
3178
3179
|
d = d.filter(
|
|
3179
|
-
(
|
|
3180
|
+
(m) => {
|
|
3180
3181
|
var c;
|
|
3181
|
-
return
|
|
3182
|
+
return m.name.toLowerCase().includes(a) || m.description.toLowerCase().includes(a) || m.generator.toLowerCase().includes(a) || ((c = m.tags) == null ? void 0 : c.some((u) => u.toLowerCase().includes(a)));
|
|
3182
3183
|
}
|
|
3183
3184
|
);
|
|
3184
3185
|
}
|
|
3185
3186
|
return d;
|
|
3186
3187
|
}, [l, n]);
|
|
3187
|
-
return /* @__PURE__ */
|
|
3188
|
-
/* @__PURE__ */
|
|
3188
|
+
return /* @__PURE__ */ o("div", { className: "p-6", children: [
|
|
3189
|
+
/* @__PURE__ */ o("div", { className: "mb-6", children: [
|
|
3189
3190
|
/* @__PURE__ */ e("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white mb-2", children: "Templates" }),
|
|
3190
3191
|
/* @__PURE__ */ e("p", { className: "text-gray-600 dark:text-zinc-400", children: "Start with a pre-built workflow. Click any template to load it into the editor." })
|
|
3191
3192
|
] }),
|
|
3192
|
-
/* @__PURE__ */
|
|
3193
|
+
/* @__PURE__ */ o("div", { className: "flex flex-wrap gap-4 mb-6", children: [
|
|
3193
3194
|
/* @__PURE__ */ e(
|
|
3194
3195
|
"input",
|
|
3195
3196
|
{
|
|
3196
3197
|
type: "text",
|
|
3197
3198
|
placeholder: "Search templates...",
|
|
3198
3199
|
value: n,
|
|
3199
|
-
onChange: (d) =>
|
|
3200
|
+
onChange: (d) => i(d.target.value),
|
|
3200
3201
|
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"
|
|
3201
3202
|
}
|
|
3202
3203
|
),
|
|
3203
|
-
/* @__PURE__ */
|
|
3204
|
+
/* @__PURE__ */ o("div", { className: "flex gap-2 flex-wrap", children: [
|
|
3204
3205
|
/* @__PURE__ */ e(
|
|
3205
3206
|
"button",
|
|
3206
3207
|
{
|
|
@@ -3209,7 +3210,7 @@ function St({ onSelect: r }) {
|
|
|
3209
3210
|
children: "All"
|
|
3210
3211
|
}
|
|
3211
3212
|
),
|
|
3212
|
-
|
|
3213
|
+
s.map((d) => /* @__PURE__ */ e(
|
|
3213
3214
|
"button",
|
|
3214
3215
|
{
|
|
3215
3216
|
onClick: () => t(d),
|
|
@@ -3220,8 +3221,8 @@ function St({ onSelect: r }) {
|
|
|
3220
3221
|
))
|
|
3221
3222
|
] })
|
|
3222
3223
|
] }),
|
|
3223
|
-
|
|
3224
|
-
|
|
3224
|
+
p.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: p.map((d) => /* @__PURE__ */ e(
|
|
3225
|
+
Wt,
|
|
3225
3226
|
{
|
|
3226
3227
|
template: d,
|
|
3227
3228
|
onSelect: () => r(d.id)
|
|
@@ -3230,14 +3231,14 @@ function St({ onSelect: r }) {
|
|
|
3230
3231
|
)) })
|
|
3231
3232
|
] });
|
|
3232
3233
|
}
|
|
3233
|
-
function
|
|
3234
|
-
const t = r.workflow.nodes.length, n = r.workflow.edges.length,
|
|
3234
|
+
function Wt({ template: r, onSelect: l }) {
|
|
3235
|
+
const t = r.workflow.nodes.length, n = r.workflow.edges.length, i = {
|
|
3235
3236
|
quickchart: "bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-300",
|
|
3236
3237
|
mermaid: "bg-pink-100 text-pink-800 dark:bg-pink-900/30 dark:text-pink-300",
|
|
3237
3238
|
qr: "bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-300",
|
|
3238
3239
|
d3: "bg-orange-100 text-orange-800 dark:bg-orange-900/30 dark:text-orange-300"
|
|
3239
3240
|
};
|
|
3240
|
-
return /* @__PURE__ */
|
|
3241
|
+
return /* @__PURE__ */ o("div", { className: "bg-white dark:bg-zinc-800 rounded-lg border border-gray-200 dark:border-zinc-700 overflow-hidden hover:shadow-lg transition-shadow", children: [
|
|
3241
3242
|
/* @__PURE__ */ e("div", { className: "aspect-video bg-gray-100 dark:bg-zinc-900 flex items-center justify-center p-4", children: r.preview ? /* @__PURE__ */ e(
|
|
3242
3243
|
"img",
|
|
3243
3244
|
{
|
|
@@ -3245,7 +3246,7 @@ function Lt({ template: r, onSelect: l }) {
|
|
|
3245
3246
|
alt: r.name,
|
|
3246
3247
|
className: "max-w-full max-h-full object-contain"
|
|
3247
3248
|
}
|
|
3248
|
-
) : /* @__PURE__ */
|
|
3249
|
+
) : /* @__PURE__ */ o("div", { className: "text-center text-gray-400 dark:text-zinc-500", children: [
|
|
3249
3250
|
/* @__PURE__ */ e(
|
|
3250
3251
|
"svg",
|
|
3251
3252
|
{
|
|
@@ -3266,20 +3267,20 @@ function Lt({ template: r, onSelect: l }) {
|
|
|
3266
3267
|
),
|
|
3267
3268
|
/* @__PURE__ */ e("span", { className: "text-sm", children: "No preview" })
|
|
3268
3269
|
] }) }),
|
|
3269
|
-
/* @__PURE__ */
|
|
3270
|
-
/* @__PURE__ */
|
|
3270
|
+
/* @__PURE__ */ o("div", { className: "p-4", children: [
|
|
3271
|
+
/* @__PURE__ */ o("div", { className: "flex items-start justify-between mb-2", children: [
|
|
3271
3272
|
/* @__PURE__ */ e("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white", children: r.name }),
|
|
3272
3273
|
/* @__PURE__ */ e(
|
|
3273
3274
|
"span",
|
|
3274
3275
|
{
|
|
3275
|
-
className: `px-2 py-0.5 rounded text-xs font-medium ${
|
|
3276
|
+
className: `px-2 py-0.5 rounded text-xs font-medium ${i[r.generator] || "bg-gray-100 text-gray-800 dark:bg-zinc-700 dark:text-zinc-300"}`,
|
|
3276
3277
|
children: r.generator
|
|
3277
3278
|
}
|
|
3278
3279
|
)
|
|
3279
3280
|
] }),
|
|
3280
3281
|
/* @__PURE__ */ e("p", { className: "text-sm text-gray-600 dark:text-zinc-400 mb-3", children: r.description }),
|
|
3281
|
-
/* @__PURE__ */
|
|
3282
|
-
/* @__PURE__ */
|
|
3282
|
+
/* @__PURE__ */ o("div", { className: "flex items-center gap-4 text-xs text-gray-500 dark:text-zinc-500 mb-4", children: [
|
|
3283
|
+
/* @__PURE__ */ o("span", { className: "flex items-center gap-1", children: [
|
|
3283
3284
|
/* @__PURE__ */ e("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e(
|
|
3284
3285
|
"path",
|
|
3285
3286
|
{
|
|
@@ -3293,7 +3294,7 @@ function Lt({ template: r, onSelect: l }) {
|
|
|
3293
3294
|
" node",
|
|
3294
3295
|
t !== 1 ? "s" : ""
|
|
3295
3296
|
] }),
|
|
3296
|
-
n > 0 && /* @__PURE__ */
|
|
3297
|
+
n > 0 && /* @__PURE__ */ o("span", { className: "flex items-center gap-1", children: [
|
|
3297
3298
|
/* @__PURE__ */ e("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e(
|
|
3298
3299
|
"path",
|
|
3299
3300
|
{
|
|
@@ -3308,13 +3309,13 @@ function Lt({ template: r, onSelect: l }) {
|
|
|
3308
3309
|
n !== 1 ? "s" : ""
|
|
3309
3310
|
] })
|
|
3310
3311
|
] }),
|
|
3311
|
-
r.tags && r.tags.length > 0 && /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1 mb-4", children: r.tags.slice(0, 4).map((
|
|
3312
|
+
r.tags && r.tags.length > 0 && /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1 mb-4", children: r.tags.slice(0, 4).map((s) => /* @__PURE__ */ e(
|
|
3312
3313
|
"span",
|
|
3313
3314
|
{
|
|
3314
3315
|
className: "px-2 py-0.5 bg-gray-100 dark:bg-zinc-700 text-gray-600 dark:text-zinc-400 rounded text-xs",
|
|
3315
|
-
children:
|
|
3316
|
+
children: s
|
|
3316
3317
|
},
|
|
3317
|
-
|
|
3318
|
+
s
|
|
3318
3319
|
)) }),
|
|
3319
3320
|
/* @__PURE__ */ e(
|
|
3320
3321
|
"button",
|
|
@@ -3327,67 +3328,67 @@ function Lt({ template: r, onSelect: l }) {
|
|
|
3327
3328
|
] })
|
|
3328
3329
|
] });
|
|
3329
3330
|
}
|
|
3330
|
-
function
|
|
3331
|
+
function At({
|
|
3331
3332
|
workflow: r,
|
|
3332
3333
|
isActive: l,
|
|
3333
3334
|
onLoad: t,
|
|
3334
3335
|
onDelete: n,
|
|
3335
|
-
onRename:
|
|
3336
|
-
onDuplicate:
|
|
3336
|
+
onRename: i,
|
|
3337
|
+
onDuplicate: s
|
|
3337
3338
|
}) {
|
|
3338
|
-
const [
|
|
3339
|
-
a.trim() && a !== r.name &&
|
|
3340
|
-
}, f = (
|
|
3341
|
-
const v = new Date(
|
|
3342
|
-
return g < 1 ? "Just now" : g < 60 ? `${g}m ago` :
|
|
3339
|
+
const [p, d] = I(!1), [a, m] = I(r.name), [c, u] = I(!1), h = () => {
|
|
3340
|
+
a.trim() && a !== r.name && i(a.trim()), d(!1);
|
|
3341
|
+
}, f = (y) => {
|
|
3342
|
+
const v = new Date(y), b = (/* @__PURE__ */ new Date()).getTime() - v.getTime(), g = Math.floor(b / 6e4), z = Math.floor(b / 36e5), W = Math.floor(b / 864e5);
|
|
3343
|
+
return g < 1 ? "Just now" : g < 60 ? `${g}m ago` : z < 24 ? `${z}h ago` : W < 7 ? `${W}d ago` : v.toLocaleDateString();
|
|
3343
3344
|
};
|
|
3344
|
-
return /* @__PURE__ */
|
|
3345
|
+
return /* @__PURE__ */ o(
|
|
3345
3346
|
"div",
|
|
3346
3347
|
{
|
|
3347
3348
|
className: `group relative p-3 rounded-lg border transition-colors ${l ? "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"}`,
|
|
3348
3349
|
children: [
|
|
3349
|
-
/* @__PURE__ */
|
|
3350
|
-
/* @__PURE__ */
|
|
3351
|
-
|
|
3350
|
+
/* @__PURE__ */ o("div", { className: "flex items-start justify-between gap-2", children: [
|
|
3351
|
+
/* @__PURE__ */ o("button", { onClick: t, className: "flex-1 text-left min-w-0", children: [
|
|
3352
|
+
p ? /* @__PURE__ */ e(
|
|
3352
3353
|
"input",
|
|
3353
3354
|
{
|
|
3354
3355
|
type: "text",
|
|
3355
3356
|
value: a,
|
|
3356
|
-
onChange: (
|
|
3357
|
+
onChange: (y) => m(y.target.value),
|
|
3357
3358
|
onBlur: h,
|
|
3358
|
-
onKeyDown: (
|
|
3359
|
-
|
|
3359
|
+
onKeyDown: (y) => {
|
|
3360
|
+
y.key === "Enter" && h(), y.key === "Escape" && (m(r.name), d(!1));
|
|
3360
3361
|
},
|
|
3361
3362
|
className: "w-full px-1 py-0.5 text-sm font-medium bg-white dark:bg-zinc-900 border border-teal-500 rounded focus:outline-none focus:ring-1 focus:ring-teal-500",
|
|
3362
3363
|
autoFocus: !0,
|
|
3363
|
-
onClick: (
|
|
3364
|
+
onClick: (y) => y.stopPropagation()
|
|
3364
3365
|
}
|
|
3365
3366
|
) : /* @__PURE__ */ e("span", { className: "block text-sm font-medium text-zinc-900 dark:text-zinc-100 truncate", children: r.name }),
|
|
3366
|
-
/* @__PURE__ */
|
|
3367
|
+
/* @__PURE__ */ o("span", { className: "block text-xs text-zinc-500 dark:text-zinc-400 mt-0.5", children: [
|
|
3367
3368
|
r.nodes.length,
|
|
3368
3369
|
" nodes · Updated ",
|
|
3369
3370
|
f(r.updatedAt)
|
|
3370
3371
|
] })
|
|
3371
3372
|
] }),
|
|
3372
|
-
/* @__PURE__ */
|
|
3373
|
+
/* @__PURE__ */ o("div", { className: "relative", children: [
|
|
3373
3374
|
/* @__PURE__ */ e(
|
|
3374
3375
|
"button",
|
|
3375
3376
|
{
|
|
3376
|
-
onClick: (
|
|
3377
|
-
|
|
3377
|
+
onClick: (y) => {
|
|
3378
|
+
y.stopPropagation(), u(!c);
|
|
3378
3379
|
},
|
|
3379
3380
|
className: "p-1 text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-300 rounded opacity-0 group-hover:opacity-100 transition-opacity",
|
|
3380
3381
|
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" }) })
|
|
3381
3382
|
}
|
|
3382
3383
|
),
|
|
3383
|
-
c && /* @__PURE__ */
|
|
3384
|
+
c && /* @__PURE__ */ o(U, { children: [
|
|
3384
3385
|
/* @__PURE__ */ e("div", { className: "fixed inset-0 z-10", onClick: () => u(!1) }),
|
|
3385
|
-
/* @__PURE__ */
|
|
3386
|
+
/* @__PURE__ */ o("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: [
|
|
3386
3387
|
/* @__PURE__ */ e(
|
|
3387
3388
|
"button",
|
|
3388
3389
|
{
|
|
3389
|
-
onClick: (
|
|
3390
|
-
|
|
3390
|
+
onClick: (y) => {
|
|
3391
|
+
y.stopPropagation(), d(!0), u(!1);
|
|
3391
3392
|
},
|
|
3392
3393
|
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",
|
|
3393
3394
|
children: "Rename"
|
|
@@ -3396,8 +3397,8 @@ function Wt({
|
|
|
3396
3397
|
/* @__PURE__ */ e(
|
|
3397
3398
|
"button",
|
|
3398
3399
|
{
|
|
3399
|
-
onClick: (
|
|
3400
|
-
|
|
3400
|
+
onClick: (y) => {
|
|
3401
|
+
y.stopPropagation(), s(), u(!1);
|
|
3401
3402
|
},
|
|
3402
3403
|
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",
|
|
3403
3404
|
children: "Duplicate"
|
|
@@ -3406,8 +3407,8 @@ function Wt({
|
|
|
3406
3407
|
/* @__PURE__ */ e(
|
|
3407
3408
|
"button",
|
|
3408
3409
|
{
|
|
3409
|
-
onClick: (
|
|
3410
|
-
|
|
3410
|
+
onClick: (y) => {
|
|
3411
|
+
y.stopPropagation(), window.confirm("Delete this workflow?") && n(), u(!1);
|
|
3411
3412
|
},
|
|
3412
3413
|
className: "w-full px-3 py-1.5 text-left text-sm text-red-600 dark:text-red-400 hover:bg-zinc-100 dark:hover:bg-zinc-700",
|
|
3413
3414
|
children: "Delete"
|
|
@@ -3422,14 +3423,14 @@ function Wt({
|
|
|
3422
3423
|
}
|
|
3423
3424
|
);
|
|
3424
3425
|
}
|
|
3425
|
-
function
|
|
3426
|
-
const r = k((c) => c.showLibrary), l = k((c) => c.toggleLibrary), t = k((c) => c.savedWorkflows), n = k((c) => c.activeWorkflowId),
|
|
3426
|
+
function Pt() {
|
|
3427
|
+
const r = k((c) => c.showLibrary), l = k((c) => c.toggleLibrary), t = k((c) => c.savedWorkflows), n = k((c) => c.activeWorkflowId), i = k((c) => c.loadWorkflow), s = k((c) => c.deleteWorkflow), p = k((c) => c.renameWorkflow), d = k((c) => c.duplicateWorkflow), a = k((c) => c.newWorkflow);
|
|
3427
3428
|
if (!r) return null;
|
|
3428
|
-
const
|
|
3429
|
-
return /* @__PURE__ */
|
|
3429
|
+
const m = [...t].sort((c, u) => u.updatedAt - c.updatedAt);
|
|
3430
|
+
return /* @__PURE__ */ o(U, { children: [
|
|
3430
3431
|
/* @__PURE__ */ e("div", { className: "fixed inset-0 bg-black/20 dark:bg-black/40 z-40", onClick: l }),
|
|
3431
|
-
/* @__PURE__ */
|
|
3432
|
-
/* @__PURE__ */
|
|
3432
|
+
/* @__PURE__ */ o("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: [
|
|
3433
|
+
/* @__PURE__ */ o("div", { className: "flex items-center justify-between px-4 py-3 border-b border-zinc-200 dark:border-zinc-700", children: [
|
|
3433
3434
|
/* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-zinc-900 dark:text-zinc-100", children: "My Workflows" }),
|
|
3434
3435
|
/* @__PURE__ */ e(
|
|
3435
3436
|
"button",
|
|
@@ -3448,7 +3449,7 @@ function At() {
|
|
|
3448
3449
|
}
|
|
3449
3450
|
)
|
|
3450
3451
|
] }),
|
|
3451
|
-
/* @__PURE__ */ e("div", { className: "p-4 border-b border-zinc-200 dark:border-zinc-700", children: /* @__PURE__ */
|
|
3452
|
+
/* @__PURE__ */ e("div", { className: "p-4 border-b border-zinc-200 dark:border-zinc-700", children: /* @__PURE__ */ o(
|
|
3452
3453
|
"button",
|
|
3453
3454
|
{
|
|
3454
3455
|
onClick: () => {
|
|
@@ -3469,7 +3470,7 @@ function At() {
|
|
|
3469
3470
|
]
|
|
3470
3471
|
}
|
|
3471
3472
|
) }),
|
|
3472
|
-
/* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto p-4", children:
|
|
3473
|
+
/* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto p-4", children: m.length === 0 ? /* @__PURE__ */ o("div", { className: "text-center py-8", children: [
|
|
3473
3474
|
/* @__PURE__ */ e("div", { className: "w-12 h-12 mx-auto mb-3 rounded-full bg-zinc-200 dark:bg-zinc-700 flex items-center justify-center", children: /* @__PURE__ */ e(
|
|
3474
3475
|
"svg",
|
|
3475
3476
|
{
|
|
@@ -3490,21 +3491,21 @@ function At() {
|
|
|
3490
3491
|
) }),
|
|
3491
3492
|
/* @__PURE__ */ e("p", { className: "text-sm text-zinc-500 dark:text-zinc-400", children: "No saved workflows yet" }),
|
|
3492
3493
|
/* @__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" })
|
|
3493
|
-
] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children:
|
|
3494
|
-
|
|
3494
|
+
] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: m.map((c) => /* @__PURE__ */ e(
|
|
3495
|
+
At,
|
|
3495
3496
|
{
|
|
3496
3497
|
workflow: c,
|
|
3497
3498
|
isActive: c.id === n,
|
|
3498
3499
|
onLoad: () => {
|
|
3499
|
-
|
|
3500
|
+
i(c.id), l();
|
|
3500
3501
|
},
|
|
3501
|
-
onDelete: () =>
|
|
3502
|
-
onRename: (u) =>
|
|
3502
|
+
onDelete: () => s(c.id),
|
|
3503
|
+
onRename: (u) => p(c.id, u),
|
|
3503
3504
|
onDuplicate: () => d(c.id)
|
|
3504
3505
|
},
|
|
3505
3506
|
c.id
|
|
3506
3507
|
)) }) }),
|
|
3507
|
-
/* @__PURE__ */
|
|
3508
|
+
/* @__PURE__ */ o("div", { className: "px-4 py-3 border-t border-zinc-200 dark:border-zinc-700 text-xs text-zinc-500 dark:text-zinc-400", children: [
|
|
3508
3509
|
t.length,
|
|
3509
3510
|
" workflow",
|
|
3510
3511
|
t.length !== 1 ? "s" : "",
|
|
@@ -3513,7 +3514,7 @@ function At() {
|
|
|
3513
3514
|
] })
|
|
3514
3515
|
] });
|
|
3515
3516
|
}
|
|
3516
|
-
const
|
|
3517
|
+
const $t = [
|
|
3517
3518
|
{
|
|
3518
3519
|
id: "openai",
|
|
3519
3520
|
name: "OpenAI",
|
|
@@ -3549,7 +3550,7 @@ const Pt = [
|
|
|
3549
3550
|
placeholder: "sk-or-...",
|
|
3550
3551
|
docsUrl: "https://openrouter.ai/keys"
|
|
3551
3552
|
}
|
|
3552
|
-
],
|
|
3553
|
+
], Mt = [
|
|
3553
3554
|
{
|
|
3554
3555
|
id: "ollama",
|
|
3555
3556
|
name: "Ollama",
|
|
@@ -3565,21 +3566,21 @@ const Pt = [
|
|
|
3565
3566
|
docsUrl: "https://lmstudio.ai"
|
|
3566
3567
|
}
|
|
3567
3568
|
];
|
|
3568
|
-
function
|
|
3569
|
-
const l = O((h) => h.ai), t = O((h) => h.setAIProvider), n = l[r.id],
|
|
3569
|
+
function jt({ provider: r }) {
|
|
3570
|
+
const l = O((h) => h.ai), t = O((h) => h.setAIProvider), n = l[r.id], i = (n == null ? void 0 : n.enabled) ?? !1, s = (n == null ? void 0 : n.apiKey) ?? "", [p, d] = I(s), [a, m] = I(!1), c = () => {
|
|
3570
3571
|
t(r.id, {
|
|
3571
|
-
apiKey:
|
|
3572
|
-
enabled: !
|
|
3572
|
+
apiKey: p,
|
|
3573
|
+
enabled: !i
|
|
3573
3574
|
});
|
|
3574
3575
|
}, u = (h) => {
|
|
3575
3576
|
d(h), t(r.id, {
|
|
3576
3577
|
apiKey: h,
|
|
3577
|
-
enabled:
|
|
3578
|
+
enabled: i
|
|
3578
3579
|
});
|
|
3579
3580
|
};
|
|
3580
|
-
return /* @__PURE__ */
|
|
3581
|
-
/* @__PURE__ */
|
|
3582
|
-
/* @__PURE__ */
|
|
3581
|
+
return /* @__PURE__ */ o("div", { className: "flex items-start gap-4 p-4 border border-gray-200 dark:border-zinc-700 rounded-lg", children: [
|
|
3582
|
+
/* @__PURE__ */ o("div", { className: "flex-1 min-w-0", children: [
|
|
3583
|
+
/* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
|
|
3583
3584
|
/* @__PURE__ */ e("span", { className: "font-medium text-gray-900 dark:text-white", children: r.name }),
|
|
3584
3585
|
/* @__PURE__ */ e(
|
|
3585
3586
|
"a",
|
|
@@ -3593,12 +3594,12 @@ function Mt({ provider: r }) {
|
|
|
3593
3594
|
)
|
|
3594
3595
|
] }),
|
|
3595
3596
|
/* @__PURE__ */ e("p", { className: "text-sm text-gray-500 dark:text-zinc-400 mt-0.5", children: r.description }),
|
|
3596
|
-
/* @__PURE__ */ e("div", { className: "mt-2 flex items-center gap-2", children: /* @__PURE__ */
|
|
3597
|
+
/* @__PURE__ */ e("div", { className: "mt-2 flex items-center gap-2", children: /* @__PURE__ */ o("div", { className: "relative flex-1", children: [
|
|
3597
3598
|
/* @__PURE__ */ e(
|
|
3598
3599
|
"input",
|
|
3599
3600
|
{
|
|
3600
3601
|
type: a ? "text" : "password",
|
|
3601
|
-
value:
|
|
3602
|
+
value: p,
|
|
3602
3603
|
onChange: (h) => u(h.target.value),
|
|
3603
3604
|
placeholder: r.placeholder,
|
|
3604
3605
|
className: "w-full px-3 py-1.5 text-sm border border-gray-300 dark:border-zinc-600 rounded bg-white dark:bg-zinc-800 text-gray-900 dark:text-white placeholder-gray-400 dark:placeholder-zinc-500"
|
|
@@ -3608,7 +3609,7 @@ function Mt({ provider: r }) {
|
|
|
3608
3609
|
"button",
|
|
3609
3610
|
{
|
|
3610
3611
|
type: "button",
|
|
3611
|
-
onClick: () =>
|
|
3612
|
+
onClick: () => m(!a),
|
|
3612
3613
|
className: "absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600 dark:hover:text-zinc-300",
|
|
3613
3614
|
children: /* @__PURE__ */ e("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: a ? /* @__PURE__ */ e(
|
|
3614
3615
|
"path",
|
|
@@ -3635,32 +3636,32 @@ function Mt({ provider: r }) {
|
|
|
3635
3636
|
"button",
|
|
3636
3637
|
{
|
|
3637
3638
|
onClick: c,
|
|
3638
|
-
className: `relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${
|
|
3639
|
+
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"}`,
|
|
3639
3640
|
children: /* @__PURE__ */ e(
|
|
3640
3641
|
"span",
|
|
3641
3642
|
{
|
|
3642
|
-
className: `inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${
|
|
3643
|
+
className: `inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${i ? "translate-x-6" : "translate-x-1"}`
|
|
3643
3644
|
}
|
|
3644
3645
|
)
|
|
3645
3646
|
}
|
|
3646
3647
|
) })
|
|
3647
3648
|
] });
|
|
3648
3649
|
}
|
|
3649
|
-
function
|
|
3650
|
-
const l = O((c) => c.ai), t = O((c) => c.setAIProvider), n = l[r.id],
|
|
3650
|
+
function Dt({ provider: r }) {
|
|
3651
|
+
const l = O((c) => c.ai), t = O((c) => c.setAIProvider), n = l[r.id], i = (n == null ? void 0 : n.enabled) ?? !1, s = (n == null ? void 0 : n.baseUrl) ?? r.defaultUrl, [p, d] = I(s), a = () => {
|
|
3651
3652
|
t(r.id, {
|
|
3652
|
-
baseUrl:
|
|
3653
|
-
enabled: !
|
|
3653
|
+
baseUrl: p,
|
|
3654
|
+
enabled: !i
|
|
3654
3655
|
});
|
|
3655
|
-
},
|
|
3656
|
+
}, m = (c) => {
|
|
3656
3657
|
d(c), t(r.id, {
|
|
3657
3658
|
baseUrl: c,
|
|
3658
|
-
enabled:
|
|
3659
|
+
enabled: i
|
|
3659
3660
|
});
|
|
3660
3661
|
};
|
|
3661
|
-
return /* @__PURE__ */
|
|
3662
|
-
/* @__PURE__ */
|
|
3663
|
-
/* @__PURE__ */
|
|
3662
|
+
return /* @__PURE__ */ o("div", { className: "flex items-start gap-4 p-4 border border-gray-200 dark:border-zinc-700 rounded-lg", children: [
|
|
3663
|
+
/* @__PURE__ */ o("div", { className: "flex-1 min-w-0", children: [
|
|
3664
|
+
/* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
|
|
3664
3665
|
/* @__PURE__ */ e("span", { className: "font-medium text-gray-900 dark:text-white", children: r.name }),
|
|
3665
3666
|
/* @__PURE__ */ e(
|
|
3666
3667
|
"a",
|
|
@@ -3679,8 +3680,8 @@ function jt({ provider: r }) {
|
|
|
3679
3680
|
"input",
|
|
3680
3681
|
{
|
|
3681
3682
|
type: "text",
|
|
3682
|
-
value:
|
|
3683
|
-
onChange: (c) =>
|
|
3683
|
+
value: p,
|
|
3684
|
+
onChange: (c) => m(c.target.value),
|
|
3684
3685
|
placeholder: r.defaultUrl,
|
|
3685
3686
|
className: "w-full px-3 py-1.5 text-sm border border-gray-300 dark:border-zinc-600 rounded bg-white dark:bg-zinc-800 text-gray-900 dark:text-white placeholder-gray-400 dark:placeholder-zinc-500"
|
|
3686
3687
|
}
|
|
@@ -3690,22 +3691,22 @@ function jt({ provider: r }) {
|
|
|
3690
3691
|
"button",
|
|
3691
3692
|
{
|
|
3692
3693
|
onClick: a,
|
|
3693
|
-
className: `relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${
|
|
3694
|
+
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"}`,
|
|
3694
3695
|
children: /* @__PURE__ */ e(
|
|
3695
3696
|
"span",
|
|
3696
3697
|
{
|
|
3697
|
-
className: `inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${
|
|
3698
|
+
className: `inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${i ? "translate-x-6" : "translate-x-1"}`
|
|
3698
3699
|
}
|
|
3699
3700
|
)
|
|
3700
3701
|
}
|
|
3701
3702
|
) })
|
|
3702
3703
|
] });
|
|
3703
3704
|
}
|
|
3704
|
-
function
|
|
3705
|
+
function Tt() {
|
|
3705
3706
|
const r = O((t) => t.showSettings), l = O((t) => t.closeSettings);
|
|
3706
|
-
return r ? /* @__PURE__ */ e("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50", children: /* @__PURE__ */
|
|
3707
|
-
/* @__PURE__ */
|
|
3708
|
-
/* @__PURE__ */
|
|
3707
|
+
return r ? /* @__PURE__ */ e("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50", children: /* @__PURE__ */ o("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: [
|
|
3708
|
+
/* @__PURE__ */ o("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-200 dark:border-zinc-700", children: [
|
|
3709
|
+
/* @__PURE__ */ o("div", { children: [
|
|
3709
3710
|
/* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-gray-900 dark:text-white", children: "AI Provider Settings" }),
|
|
3710
3711
|
/* @__PURE__ */ e("p", { className: "text-sm text-gray-500 dark:text-zinc-400 mt-0.5", children: "Configure your AI providers for vision and text generation" })
|
|
3711
3712
|
] }),
|
|
@@ -3726,16 +3727,16 @@ function Dt() {
|
|
|
3726
3727
|
}
|
|
3727
3728
|
)
|
|
3728
3729
|
] }),
|
|
3729
|
-
/* @__PURE__ */
|
|
3730
|
-
/* @__PURE__ */
|
|
3730
|
+
/* @__PURE__ */ o("div", { className: "flex-1 overflow-y-auto p-6 space-y-6", children: [
|
|
3731
|
+
/* @__PURE__ */ o("section", { children: [
|
|
3731
3732
|
/* @__PURE__ */ e("h3", { className: "text-sm font-medium text-gray-700 dark:text-zinc-300 mb-3", children: "Cloud Providers" }),
|
|
3732
|
-
/* @__PURE__ */ e("div", { className: "space-y-3", children:
|
|
3733
|
+
/* @__PURE__ */ e("div", { className: "space-y-3", children: $t.map((t) => /* @__PURE__ */ e(jt, { provider: t }, t.id)) })
|
|
3733
3734
|
] }),
|
|
3734
|
-
/* @__PURE__ */
|
|
3735
|
+
/* @__PURE__ */ o("section", { children: [
|
|
3735
3736
|
/* @__PURE__ */ e("h3", { className: "text-sm font-medium text-gray-700 dark:text-zinc-300 mb-3", children: "Local Providers" }),
|
|
3736
|
-
/* @__PURE__ */ e("div", { className: "space-y-3", children:
|
|
3737
|
+
/* @__PURE__ */ e("div", { className: "space-y-3", children: Mt.map((t) => /* @__PURE__ */ e(Dt, { provider: t }, t.id)) })
|
|
3737
3738
|
] }),
|
|
3738
|
-
/* @__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__ */
|
|
3739
|
+
/* @__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__ */ o("div", { className: "flex items-start gap-3", children: [
|
|
3739
3740
|
/* @__PURE__ */ e(
|
|
3740
3741
|
"svg",
|
|
3741
3742
|
{
|
|
@@ -3754,7 +3755,7 @@ function Dt() {
|
|
|
3754
3755
|
)
|
|
3755
3756
|
}
|
|
3756
3757
|
),
|
|
3757
|
-
/* @__PURE__ */
|
|
3758
|
+
/* @__PURE__ */ o("div", { children: [
|
|
3758
3759
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium text-blue-900 dark:text-blue-300", children: "Your keys stay local" }),
|
|
3759
3760
|
/* @__PURE__ */ e("p", { className: "text-sm text-blue-700 dark:text-blue-400 mt-1", children: "API keys are stored in your browser only and sent directly to providers. They never pass through our servers." })
|
|
3760
3761
|
] })
|
|
@@ -3770,30 +3771,30 @@ function Dt() {
|
|
|
3770
3771
|
) })
|
|
3771
3772
|
] }) }) : null;
|
|
3772
3773
|
}
|
|
3773
|
-
function
|
|
3774
|
-
const [n,
|
|
3774
|
+
function Ut({ isOpen: r, onClose: l, onApplyWorkflow: t }) {
|
|
3775
|
+
const [n, i] = I([]), [s, p] = I(""), [d, a] = I(!1), [m, c] = I(null), [u, h] = I(null), [f, y] = I(""), v = Q(null), w = Q(null);
|
|
3775
3776
|
D(() => {
|
|
3776
|
-
r && u === null &&
|
|
3777
|
-
h(x.available),
|
|
3777
|
+
r && u === null && qe().then((x) => {
|
|
3778
|
+
h(x.available), y(x.message);
|
|
3778
3779
|
}).catch(() => {
|
|
3779
|
-
h(!1),
|
|
3780
|
+
h(!1), y("Failed to check AI availability");
|
|
3780
3781
|
});
|
|
3781
3782
|
}, [r, u]), D(() => {
|
|
3782
|
-
r &&
|
|
3783
|
+
r && w.current && w.current.focus();
|
|
3783
3784
|
}, [r]), D(() => {
|
|
3784
3785
|
var x;
|
|
3785
3786
|
(x = v.current) == null || x.scrollIntoView({ behavior: "smooth" });
|
|
3786
3787
|
}, [n]);
|
|
3787
3788
|
const b = L(async () => {
|
|
3788
|
-
if (!
|
|
3789
|
+
if (!s.trim() || d) return;
|
|
3789
3790
|
const x = {
|
|
3790
3791
|
role: "user",
|
|
3791
|
-
content:
|
|
3792
|
+
content: s.trim(),
|
|
3792
3793
|
timestamp: Date.now()
|
|
3793
3794
|
};
|
|
3794
|
-
|
|
3795
|
+
i((C) => [...C, x]), p(""), a(!0), c(null);
|
|
3795
3796
|
try {
|
|
3796
|
-
const C = await
|
|
3797
|
+
const C = await Ke({
|
|
3797
3798
|
prompt: x.content,
|
|
3798
3799
|
history: n
|
|
3799
3800
|
}), S = {
|
|
@@ -3802,23 +3803,23 @@ function Tt({ isOpen: r, onClose: l, onApplyWorkflow: t }) {
|
|
|
3802
3803
|
workflow: C.workflow,
|
|
3803
3804
|
timestamp: Date.now()
|
|
3804
3805
|
};
|
|
3805
|
-
|
|
3806
|
+
i((T) => [...T, S]), !C.success && C.error && c(C.error);
|
|
3806
3807
|
} catch (C) {
|
|
3807
3808
|
c(C instanceof Error ? C.message : "Failed to generate workflow");
|
|
3808
3809
|
} finally {
|
|
3809
3810
|
a(!1);
|
|
3810
3811
|
}
|
|
3811
|
-
}, [
|
|
3812
|
+
}, [s, d, n]), g = (x) => {
|
|
3812
3813
|
x.key === "Enter" && !x.shiftKey && (x.preventDefault(), b());
|
|
3813
|
-
},
|
|
3814
|
+
}, z = (x) => {
|
|
3814
3815
|
t(x), l();
|
|
3815
3816
|
}, W = () => {
|
|
3816
|
-
|
|
3817
|
+
i([]), c(null);
|
|
3817
3818
|
};
|
|
3818
|
-
return r ? /* @__PURE__ */ e("div", { className: "fixed inset-0 bg-black/50 flex items-center justify-center z-50", children: /* @__PURE__ */
|
|
3819
|
-
/* @__PURE__ */
|
|
3820
|
-
/* @__PURE__ */
|
|
3821
|
-
/* @__PURE__ */
|
|
3819
|
+
return r ? /* @__PURE__ */ e("div", { className: "fixed inset-0 bg-black/50 flex items-center justify-center z-50", children: /* @__PURE__ */ o("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: [
|
|
3820
|
+
/* @__PURE__ */ o("div", { className: "flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-zinc-700", children: [
|
|
3821
|
+
/* @__PURE__ */ o("div", { className: "flex items-center gap-3", children: [
|
|
3822
|
+
/* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
|
|
3822
3823
|
/* @__PURE__ */ e(
|
|
3823
3824
|
"svg",
|
|
3824
3825
|
{
|
|
@@ -3841,7 +3842,7 @@ function Tt({ isOpen: r, onClose: l, onApplyWorkflow: t }) {
|
|
|
3841
3842
|
] }),
|
|
3842
3843
|
/* @__PURE__ */ e("span", { className: "text-xs bg-teal-100 dark:bg-teal-900 text-teal-700 dark:text-teal-300 px-2 py-0.5 rounded", children: "Gemini 3 Pro" })
|
|
3843
3844
|
] }),
|
|
3844
|
-
/* @__PURE__ */
|
|
3845
|
+
/* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
|
|
3845
3846
|
n.length > 0 && /* @__PURE__ */ e(
|
|
3846
3847
|
"button",
|
|
3847
3848
|
{
|
|
@@ -3877,8 +3878,8 @@ function Tt({ isOpen: r, onClose: l, onApplyWorkflow: t }) {
|
|
|
3877
3878
|
)
|
|
3878
3879
|
] })
|
|
3879
3880
|
] }),
|
|
3880
|
-
/* @__PURE__ */
|
|
3881
|
-
u === !1 && /* @__PURE__ */ e("div", { className: "bg-amber-50 dark:bg-amber-900/30 border border-amber-200 dark:border-amber-800 rounded-lg p-4", children: /* @__PURE__ */
|
|
3881
|
+
/* @__PURE__ */ o("div", { className: "flex-1 overflow-auto p-4 space-y-4", children: [
|
|
3882
|
+
u === !1 && /* @__PURE__ */ e("div", { className: "bg-amber-50 dark:bg-amber-900/30 border border-amber-200 dark:border-amber-800 rounded-lg p-4", children: /* @__PURE__ */ o("div", { className: "flex items-start gap-3", children: [
|
|
3882
3883
|
/* @__PURE__ */ e(
|
|
3883
3884
|
"svg",
|
|
3884
3885
|
{
|
|
@@ -3897,13 +3898,13 @@ function Tt({ isOpen: r, onClose: l, onApplyWorkflow: t }) {
|
|
|
3897
3898
|
)
|
|
3898
3899
|
}
|
|
3899
3900
|
),
|
|
3900
|
-
/* @__PURE__ */
|
|
3901
|
+
/* @__PURE__ */ o("div", { children: [
|
|
3901
3902
|
/* @__PURE__ */ e("p", { className: "font-medium text-amber-800 dark:text-amber-200", children: "AI Generation Not Available" }),
|
|
3902
3903
|
/* @__PURE__ */ e("p", { className: "text-sm text-amber-700 dark:text-amber-300 mt-1", children: f }),
|
|
3903
3904
|
/* @__PURE__ */ e("p", { className: "text-xs text-amber-600 dark:text-amber-400 mt-2", children: "Set GEMINI_API_KEY in your environment to enable this feature." })
|
|
3904
3905
|
] })
|
|
3905
3906
|
] }) }),
|
|
3906
|
-
n.length === 0 && u !== !1 && /* @__PURE__ */
|
|
3907
|
+
n.length === 0 && u !== !1 && /* @__PURE__ */ o("div", { className: "text-center py-8", children: [
|
|
3907
3908
|
/* @__PURE__ */ e("div", { className: "inline-flex items-center justify-center w-16 h-16 bg-teal-100 dark:bg-teal-900/50 rounded-full mb-4", children: /* @__PURE__ */ e(
|
|
3908
3909
|
"svg",
|
|
3909
3910
|
{
|
|
@@ -3930,10 +3931,10 @@ function Tt({ isOpen: r, onClose: l, onApplyWorkflow: t }) {
|
|
|
3930
3931
|
"Generate an image with Gemini, then use it as a reference to create a variation with different lighting",
|
|
3931
3932
|
"Create a product mockup: generate a minimalist logo, then composite it onto a t-shirt image",
|
|
3932
3933
|
"Build an AI art pipeline: generate a base image, apply artistic style transfer, then upscale to 4K"
|
|
3933
|
-
].map((x, C) => /* @__PURE__ */
|
|
3934
|
+
].map((x, C) => /* @__PURE__ */ o(
|
|
3934
3935
|
"button",
|
|
3935
3936
|
{
|
|
3936
|
-
onClick: () =>
|
|
3937
|
+
onClick: () => p(x),
|
|
3937
3938
|
className: "block w-full text-left text-sm px-4 py-2 bg-gray-100 dark:bg-zinc-700 hover:bg-gray-200 dark:hover:bg-zinc-600 rounded-lg text-gray-700 dark:text-zinc-300 transition-colors",
|
|
3938
3939
|
children: [
|
|
3939
3940
|
'"',
|
|
@@ -3948,32 +3949,32 @@ function Tt({ isOpen: r, onClose: l, onApplyWorkflow: t }) {
|
|
|
3948
3949
|
"div",
|
|
3949
3950
|
{
|
|
3950
3951
|
className: `flex ${x.role === "user" ? "justify-end" : "justify-start"}`,
|
|
3951
|
-
children: /* @__PURE__ */
|
|
3952
|
+
children: /* @__PURE__ */ o(
|
|
3952
3953
|
"div",
|
|
3953
3954
|
{
|
|
3954
3955
|
className: `max-w-[80%] rounded-lg px-4 py-3 ${x.role === "user" ? "bg-teal-600 text-white" : "bg-gray-100 dark:bg-zinc-700 text-gray-900 dark:text-white"}`,
|
|
3955
3956
|
children: [
|
|
3956
3957
|
/* @__PURE__ */ e("p", { className: "text-sm whitespace-pre-wrap", children: x.content }),
|
|
3957
|
-
x.role === "assistant" && x.workflow && /* @__PURE__ */
|
|
3958
|
-
/* @__PURE__ */
|
|
3958
|
+
x.role === "assistant" && x.workflow && /* @__PURE__ */ o("div", { className: "mt-3 pt-3 border-t border-gray-200 dark:border-zinc-600", children: [
|
|
3959
|
+
/* @__PURE__ */ o("div", { className: "flex items-center justify-between mb-2", children: [
|
|
3959
3960
|
/* @__PURE__ */ e("span", { className: "text-xs font-medium text-gray-500 dark:text-zinc-400", children: "Generated Workflow" }),
|
|
3960
3961
|
/* @__PURE__ */ e(
|
|
3961
3962
|
"button",
|
|
3962
3963
|
{
|
|
3963
|
-
onClick: () =>
|
|
3964
|
+
onClick: () => z(x.workflow),
|
|
3964
3965
|
className: "text-xs px-3 py-1 bg-teal-600 hover:bg-teal-700 text-white rounded transition-colors",
|
|
3965
3966
|
children: "Apply to Canvas"
|
|
3966
3967
|
}
|
|
3967
3968
|
)
|
|
3968
3969
|
] }),
|
|
3969
|
-
/* @__PURE__ */ e("div", { className: "bg-white dark:bg-zinc-800 rounded p-2 text-xs", children: /* @__PURE__ */
|
|
3970
|
-
x.workflow.nodes.map((S, T) => /* @__PURE__ */
|
|
3970
|
+
/* @__PURE__ */ e("div", { className: "bg-white dark:bg-zinc-800 rounded p-2 text-xs", children: /* @__PURE__ */ o("div", { className: "space-y-1", children: [
|
|
3971
|
+
x.workflow.nodes.map((S, T) => /* @__PURE__ */ o(
|
|
3971
3972
|
"div",
|
|
3972
3973
|
{
|
|
3973
3974
|
className: "flex items-center gap-2 text-gray-600 dark:text-zinc-300",
|
|
3974
3975
|
children: [
|
|
3975
3976
|
/* @__PURE__ */ e("span", { className: "font-mono bg-gray-100 dark:bg-zinc-700 px-1.5 py-0.5 rounded", children: S.nodeType.split(":").pop() }),
|
|
3976
|
-
S.label && /* @__PURE__ */
|
|
3977
|
+
S.label && /* @__PURE__ */ o("span", { className: "text-gray-400", children: [
|
|
3977
3978
|
"(",
|
|
3978
3979
|
S.label,
|
|
3979
3980
|
")"
|
|
@@ -3982,7 +3983,7 @@ function Tt({ isOpen: r, onClose: l, onApplyWorkflow: t }) {
|
|
|
3982
3983
|
},
|
|
3983
3984
|
T
|
|
3984
3985
|
)),
|
|
3985
|
-
x.workflow.edges.length > 0 && /* @__PURE__ */
|
|
3986
|
+
x.workflow.edges.length > 0 && /* @__PURE__ */ o("div", { className: "text-gray-400 dark:text-zinc-500 pt-1", children: [
|
|
3986
3987
|
x.workflow.edges.length,
|
|
3987
3988
|
" connection",
|
|
3988
3989
|
x.workflow.edges.length !== 1 ? "s" : ""
|
|
@@ -3995,8 +3996,8 @@ function Tt({ isOpen: r, onClose: l, onApplyWorkflow: t }) {
|
|
|
3995
3996
|
},
|
|
3996
3997
|
C
|
|
3997
3998
|
)),
|
|
3998
|
-
d && /* @__PURE__ */ e("div", { className: "flex justify-start", children: /* @__PURE__ */ e("div", { className: "bg-gray-100 dark:bg-zinc-700 rounded-lg px-4 py-3", children: /* @__PURE__ */
|
|
3999
|
-
/* @__PURE__ */
|
|
3999
|
+
d && /* @__PURE__ */ e("div", { className: "flex justify-start", children: /* @__PURE__ */ e("div", { className: "bg-gray-100 dark:bg-zinc-700 rounded-lg px-4 py-3", children: /* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
|
|
4000
|
+
/* @__PURE__ */ o("div", { className: "flex space-x-1", children: [
|
|
4000
4001
|
/* @__PURE__ */ e("div", { className: "w-2 h-2 bg-gray-400 dark:bg-zinc-500 rounded-full animate-bounce" }),
|
|
4001
4002
|
/* @__PURE__ */ e(
|
|
4002
4003
|
"div",
|
|
@@ -4015,17 +4016,17 @@ function Tt({ isOpen: r, onClose: l, onApplyWorkflow: t }) {
|
|
|
4015
4016
|
] }),
|
|
4016
4017
|
/* @__PURE__ */ e("span", { className: "text-sm text-gray-500 dark:text-zinc-400", children: "Generating workflow..." })
|
|
4017
4018
|
] }) }) }),
|
|
4018
|
-
|
|
4019
|
+
m && /* @__PURE__ */ e("div", { className: "bg-red-50 dark:bg-red-900/30 border border-red-200 dark:border-red-800 rounded-lg p-3", children: /* @__PURE__ */ e("p", { className: "text-sm text-red-700 dark:text-red-300", children: m }) }),
|
|
4019
4020
|
/* @__PURE__ */ e("div", { ref: v })
|
|
4020
4021
|
] }),
|
|
4021
|
-
/* @__PURE__ */
|
|
4022
|
-
/* @__PURE__ */
|
|
4022
|
+
/* @__PURE__ */ o("div", { className: "border-t border-gray-200 dark:border-zinc-700 p-4", children: [
|
|
4023
|
+
/* @__PURE__ */ o("div", { className: "flex gap-2", children: [
|
|
4023
4024
|
/* @__PURE__ */ e(
|
|
4024
4025
|
"textarea",
|
|
4025
4026
|
{
|
|
4026
|
-
ref:
|
|
4027
|
-
value:
|
|
4028
|
-
onChange: (x) =>
|
|
4027
|
+
ref: w,
|
|
4028
|
+
value: s,
|
|
4029
|
+
onChange: (x) => p(x.target.value),
|
|
4029
4030
|
onKeyDown: g,
|
|
4030
4031
|
placeholder: u === !1 ? "AI generation not available" : "Describe what workflow you want to create...",
|
|
4031
4032
|
disabled: d || u === !1,
|
|
@@ -4037,7 +4038,7 @@ function Tt({ isOpen: r, onClose: l, onApplyWorkflow: t }) {
|
|
|
4037
4038
|
"button",
|
|
4038
4039
|
{
|
|
4039
4040
|
onClick: b,
|
|
4040
|
-
disabled: !
|
|
4041
|
+
disabled: !s.trim() || d || u === !1,
|
|
4041
4042
|
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",
|
|
4042
4043
|
children: /* @__PURE__ */ e("svg", { className: "h-5 w-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e(
|
|
4043
4044
|
"path",
|
|
@@ -4055,37 +4056,37 @@ function Tt({ isOpen: r, onClose: l, onApplyWorkflow: t }) {
|
|
|
4055
4056
|
] })
|
|
4056
4057
|
] }) }) : null;
|
|
4057
4058
|
}
|
|
4058
|
-
function
|
|
4059
|
-
const { screenToFlowPosition: r } =
|
|
4060
|
-
(
|
|
4061
|
-
|
|
4062
|
-
const
|
|
4063
|
-
if (
|
|
4059
|
+
function Ot() {
|
|
4060
|
+
const { screenToFlowPosition: r } = Pe(), l = k((i) => i.addNode), t = L(
|
|
4061
|
+
(i) => {
|
|
4062
|
+
i.preventDefault();
|
|
4063
|
+
const s = i.dataTransfer.getData("application/json");
|
|
4064
|
+
if (s)
|
|
4064
4065
|
try {
|
|
4065
|
-
const
|
|
4066
|
-
x:
|
|
4067
|
-
y:
|
|
4066
|
+
const p = JSON.parse(s), d = r({
|
|
4067
|
+
x: i.clientX,
|
|
4068
|
+
y: i.clientY
|
|
4068
4069
|
});
|
|
4069
|
-
l(
|
|
4070
|
-
} catch (
|
|
4071
|
-
console.error("Failed to parse dropped node:",
|
|
4070
|
+
l(p, d);
|
|
4071
|
+
} catch (p) {
|
|
4072
|
+
console.error("Failed to parse dropped node:", p);
|
|
4072
4073
|
}
|
|
4073
4074
|
},
|
|
4074
4075
|
[l, r]
|
|
4075
|
-
), n = L((
|
|
4076
|
-
|
|
4076
|
+
), n = L((i) => {
|
|
4077
|
+
i.preventDefault(), i.dataTransfer.dropEffect = "move";
|
|
4077
4078
|
}, []);
|
|
4078
|
-
return /* @__PURE__ */ e("div", { className: "flex-1", onDrop: t, onDragOver: n, children: /* @__PURE__ */ e(
|
|
4079
|
+
return /* @__PURE__ */ e("div", { className: "flex-1", onDrop: t, onDragOver: n, children: /* @__PURE__ */ e(nt, {}) });
|
|
4079
4080
|
}
|
|
4080
|
-
function
|
|
4081
|
-
const [r, l] = I("editor"), [t, n] = I(!1),
|
|
4081
|
+
function _t() {
|
|
4082
|
+
const [r, l] = I("editor"), [t, n] = I(!1), i = k((a) => a.loadTemplate), s = k((a) => a.loadGeneratedWorkflow);
|
|
4082
4083
|
D(() => {
|
|
4083
|
-
const
|
|
4084
|
-
if (
|
|
4085
|
-
const c =
|
|
4086
|
-
c && (
|
|
4084
|
+
const m = new URLSearchParams(window.location.search).get("template");
|
|
4085
|
+
if (m) {
|
|
4086
|
+
const c = ce(m);
|
|
4087
|
+
c && (i(c), window.history.replaceState({}, "", window.location.pathname));
|
|
4087
4088
|
}
|
|
4088
|
-
}, [
|
|
4089
|
+
}, [i]), D(() => {
|
|
4089
4090
|
const a = () => {
|
|
4090
4091
|
l("editor");
|
|
4091
4092
|
};
|
|
@@ -4093,33 +4094,33 @@ function Ht() {
|
|
|
4093
4094
|
window.removeEventListener("workflow-loaded", a);
|
|
4094
4095
|
};
|
|
4095
4096
|
}, []);
|
|
4096
|
-
const
|
|
4097
|
+
const p = L(
|
|
4097
4098
|
(a) => {
|
|
4098
|
-
const
|
|
4099
|
-
|
|
4099
|
+
const m = ce(a);
|
|
4100
|
+
m && (i(m), l("editor"));
|
|
4100
4101
|
},
|
|
4101
|
-
[
|
|
4102
|
+
[i]
|
|
4102
4103
|
), d = L(
|
|
4103
4104
|
(a) => {
|
|
4104
|
-
|
|
4105
|
+
s(a), l("editor");
|
|
4105
4106
|
},
|
|
4106
|
-
[
|
|
4107
|
+
[s]
|
|
4107
4108
|
);
|
|
4108
|
-
return /* @__PURE__ */
|
|
4109
|
-
/* @__PURE__ */ e(
|
|
4109
|
+
return /* @__PURE__ */ o(Ae, { children: [
|
|
4110
|
+
/* @__PURE__ */ e(Tt, {}),
|
|
4110
4111
|
/* @__PURE__ */ e(
|
|
4111
|
-
|
|
4112
|
+
Ut,
|
|
4112
4113
|
{
|
|
4113
4114
|
isOpen: t,
|
|
4114
4115
|
onClose: () => n(!1),
|
|
4115
4116
|
onApplyWorkflow: d
|
|
4116
4117
|
}
|
|
4117
4118
|
),
|
|
4118
|
-
/* @__PURE__ */ e(
|
|
4119
|
-
/* @__PURE__ */
|
|
4120
|
-
/* @__PURE__ */ e(
|
|
4121
|
-
/* @__PURE__ */ e("div", { className: "bg-white dark:bg-zinc-800 border-b border-gray-200 dark:border-zinc-700", children: /* @__PURE__ */
|
|
4122
|
-
/* @__PURE__ */
|
|
4119
|
+
/* @__PURE__ */ e(Pt, {}),
|
|
4120
|
+
/* @__PURE__ */ o("div", { className: "h-screen flex flex-col bg-gray-100 dark:bg-zinc-900", children: [
|
|
4121
|
+
/* @__PURE__ */ e(ht, {}),
|
|
4122
|
+
/* @__PURE__ */ e("div", { className: "bg-white dark:bg-zinc-800 border-b border-gray-200 dark:border-zinc-700", children: /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
|
|
4123
|
+
/* @__PURE__ */ o("div", { className: "flex", children: [
|
|
4123
4124
|
/* @__PURE__ */ e(
|
|
4124
4125
|
"button",
|
|
4125
4126
|
{
|
|
@@ -4145,7 +4146,7 @@ function Ht() {
|
|
|
4145
4146
|
}
|
|
4146
4147
|
)
|
|
4147
4148
|
] }),
|
|
4148
|
-
/* @__PURE__ */
|
|
4149
|
+
/* @__PURE__ */ o(
|
|
4149
4150
|
"button",
|
|
4150
4151
|
{
|
|
4151
4152
|
onClick: () => n(!0),
|
|
@@ -4165,34 +4166,34 @@ function Ht() {
|
|
|
4165
4166
|
}
|
|
4166
4167
|
)
|
|
4167
4168
|
] }) }),
|
|
4168
|
-
/* @__PURE__ */
|
|
4169
|
-
r === "editor" && /* @__PURE__ */
|
|
4170
|
-
/* @__PURE__ */ e(
|
|
4171
|
-
/* @__PURE__ */ e(
|
|
4172
|
-
/* @__PURE__ */ e(
|
|
4169
|
+
/* @__PURE__ */ o("div", { className: "flex-1 flex overflow-hidden", children: [
|
|
4170
|
+
r === "editor" && /* @__PURE__ */ o(U, { children: [
|
|
4171
|
+
/* @__PURE__ */ e(st, {}),
|
|
4172
|
+
/* @__PURE__ */ e(Ot, {}),
|
|
4173
|
+
/* @__PURE__ */ e(it, {})
|
|
4173
4174
|
] }),
|
|
4174
|
-
r === "gallery" && /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: /* @__PURE__ */ e(
|
|
4175
|
-
r === "templates" && /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: /* @__PURE__ */ e(
|
|
4175
|
+
r === "gallery" && /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: /* @__PURE__ */ e(xt, {}) }),
|
|
4176
|
+
r === "templates" && /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: /* @__PURE__ */ e(Lt, { onSelect: p }) })
|
|
4176
4177
|
] })
|
|
4177
4178
|
] })
|
|
4178
4179
|
] });
|
|
4179
4180
|
}
|
|
4180
4181
|
export {
|
|
4181
|
-
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
|
|
4185
|
-
|
|
4186
|
-
|
|
4187
|
-
|
|
4188
|
-
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
|
|
4192
|
-
|
|
4193
|
-
|
|
4194
|
-
|
|
4195
|
-
|
|
4182
|
+
Ut as AIChat,
|
|
4183
|
+
Tt as AISettings,
|
|
4184
|
+
_t as App,
|
|
4185
|
+
xt as Gallery,
|
|
4186
|
+
it as NodeInspector,
|
|
4187
|
+
st as NodePalette,
|
|
4188
|
+
Lt as TemplateGallery,
|
|
4189
|
+
ht as Toolbar,
|
|
4190
|
+
ot as UploadGallery,
|
|
4191
|
+
nt as WorkflowEditor,
|
|
4192
|
+
Pt as WorkflowLibrary,
|
|
4193
|
+
St as getCategories,
|
|
4194
|
+
ce as getTemplateById,
|
|
4195
|
+
Ft as getTemplatesByCategory,
|
|
4196
|
+
Ht as searchTemplates,
|
|
4196
4197
|
H as templates,
|
|
4197
4198
|
k as useWorkflowStore
|
|
4198
4199
|
};
|