@teamflojo/floimg-studio-ui 0.1.5 → 0.1.7
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/LICENSE +21 -0
- package/dist/api/client.d.ts +20 -0
- package/dist/components/ImportModal.d.ts +9 -0
- package/dist/index.js +1363 -1045
- package/dist/index.js.map +1 -1
- package/dist/stores/workflowStore.d.ts +3 -1
- package/package.json +9 -9
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { memo as
|
|
3
|
-
import
|
|
4
|
-
import { create as
|
|
5
|
-
import { useQuery as
|
|
6
|
-
function
|
|
1
|
+
import { jsxs as c, jsx as e, Fragment as j } from "react/jsx-runtime";
|
|
2
|
+
import { memo as P, useRef as xe, useCallback as C, useState as N, useEffect as M, useMemo as ee } from "react";
|
|
3
|
+
import ke, { Handle as W, Position as A, applyNodeChanges as we, applyEdgeChanges as ve, MarkerType as ye, Background as Ne, Controls as ze, MiniMap as Ce, ReactFlowProvider as Se } from "reactflow";
|
|
4
|
+
import { create as se } from "zustand";
|
|
5
|
+
import { useQuery as K } from "@tanstack/react-query";
|
|
6
|
+
function Ie(r, i) {
|
|
7
7
|
let t;
|
|
8
8
|
try {
|
|
9
9
|
t = r();
|
|
@@ -11,238 +11,250 @@ function ye(r, s) {
|
|
|
11
11
|
return;
|
|
12
12
|
}
|
|
13
13
|
return {
|
|
14
|
-
getItem: (
|
|
15
|
-
var
|
|
16
|
-
const
|
|
17
|
-
return
|
|
14
|
+
getItem: (s) => {
|
|
15
|
+
var d;
|
|
16
|
+
const m = (n) => n === null ? null : JSON.parse(n, void 0), o = (d = t.getItem(s)) != null ? d : null;
|
|
17
|
+
return o instanceof Promise ? o.then(m) : m(o);
|
|
18
18
|
},
|
|
19
|
-
setItem: (
|
|
20
|
-
removeItem: (
|
|
19
|
+
setItem: (s, d) => t.setItem(s, JSON.stringify(d, void 0)),
|
|
20
|
+
removeItem: (s) => t.removeItem(s)
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
const _ = (r) => (
|
|
23
|
+
const _ = (r) => (i) => {
|
|
24
24
|
try {
|
|
25
|
-
const t = r(
|
|
25
|
+
const t = r(i);
|
|
26
26
|
return t instanceof Promise ? t : {
|
|
27
|
-
then(
|
|
28
|
-
return _(
|
|
27
|
+
then(a) {
|
|
28
|
+
return _(a)(t);
|
|
29
29
|
},
|
|
30
|
-
catch(
|
|
30
|
+
catch(a) {
|
|
31
31
|
return this;
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
34
|
} catch (t) {
|
|
35
35
|
return {
|
|
36
|
-
then(
|
|
36
|
+
then(a) {
|
|
37
37
|
return this;
|
|
38
38
|
},
|
|
39
|
-
catch(
|
|
40
|
-
return _(
|
|
39
|
+
catch(a) {
|
|
40
|
+
return _(a)(t);
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
|
-
},
|
|
45
|
-
let
|
|
46
|
-
storage:
|
|
44
|
+
}, Le = (r, i) => (t, a, s) => {
|
|
45
|
+
let d = {
|
|
46
|
+
storage: Ie(() => localStorage),
|
|
47
47
|
partialize: (g) => g,
|
|
48
48
|
version: 0,
|
|
49
|
-
merge: (g,
|
|
50
|
-
...
|
|
49
|
+
merge: (g, v) => ({
|
|
50
|
+
...v,
|
|
51
51
|
...g
|
|
52
52
|
}),
|
|
53
|
-
...
|
|
54
|
-
},
|
|
55
|
-
const
|
|
56
|
-
let u =
|
|
53
|
+
...i
|
|
54
|
+
}, m = !1;
|
|
55
|
+
const o = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set();
|
|
56
|
+
let u = d.storage;
|
|
57
57
|
if (!u)
|
|
58
58
|
return r(
|
|
59
59
|
(...g) => {
|
|
60
60
|
console.warn(
|
|
61
|
-
`[zustand persist middleware] Unable to update item '${
|
|
61
|
+
`[zustand persist middleware] Unable to update item '${d.name}', the given storage is currently unavailable.`
|
|
62
62
|
), t(...g);
|
|
63
63
|
},
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
a,
|
|
65
|
+
s
|
|
66
66
|
);
|
|
67
|
-
const
|
|
68
|
-
const g =
|
|
69
|
-
return u.setItem(
|
|
67
|
+
const l = () => {
|
|
68
|
+
const g = d.partialize({ ...a() });
|
|
69
|
+
return u.setItem(d.name, {
|
|
70
70
|
state: g,
|
|
71
|
-
version:
|
|
71
|
+
version: d.version
|
|
72
72
|
});
|
|
73
|
-
}, p =
|
|
74
|
-
|
|
75
|
-
const
|
|
76
|
-
(...g) => (t(...g),
|
|
77
|
-
|
|
78
|
-
|
|
73
|
+
}, p = s.setState;
|
|
74
|
+
s.setState = (g, v) => (p(g, v), l());
|
|
75
|
+
const f = r(
|
|
76
|
+
(...g) => (t(...g), l()),
|
|
77
|
+
a,
|
|
78
|
+
s
|
|
79
79
|
);
|
|
80
|
-
|
|
80
|
+
s.getInitialState = () => f;
|
|
81
81
|
let b;
|
|
82
|
-
const
|
|
83
|
-
var g,
|
|
82
|
+
const k = () => {
|
|
83
|
+
var g, v;
|
|
84
84
|
if (!u) return;
|
|
85
|
-
|
|
85
|
+
m = !1, o.forEach((h) => {
|
|
86
86
|
var z;
|
|
87
|
-
return
|
|
87
|
+
return h((z = a()) != null ? z : f);
|
|
88
88
|
});
|
|
89
|
-
const
|
|
90
|
-
return _(u.getItem.bind(u))(
|
|
91
|
-
if (
|
|
92
|
-
if (typeof
|
|
93
|
-
if (
|
|
94
|
-
const z =
|
|
95
|
-
|
|
96
|
-
|
|
89
|
+
const w = ((v = d.onRehydrateStorage) == null ? void 0 : v.call(d, (g = a()) != null ? g : f)) || void 0;
|
|
90
|
+
return _(u.getItem.bind(u))(d.name).then((h) => {
|
|
91
|
+
if (h)
|
|
92
|
+
if (typeof h.version == "number" && h.version !== d.version) {
|
|
93
|
+
if (d.migrate) {
|
|
94
|
+
const z = d.migrate(
|
|
95
|
+
h.state,
|
|
96
|
+
h.version
|
|
97
97
|
);
|
|
98
|
-
return z instanceof Promise ? z.then((
|
|
98
|
+
return z instanceof Promise ? z.then((S) => [!0, S]) : [!0, z];
|
|
99
99
|
}
|
|
100
100
|
console.error(
|
|
101
101
|
"State loaded from storage couldn't be migrated since no migrate function was provided"
|
|
102
102
|
);
|
|
103
103
|
} else
|
|
104
|
-
return [!1,
|
|
104
|
+
return [!1, h.state];
|
|
105
105
|
return [!1, void 0];
|
|
106
|
-
}).then((
|
|
106
|
+
}).then((h) => {
|
|
107
107
|
var z;
|
|
108
|
-
const [
|
|
109
|
-
if (b =
|
|
110
|
-
|
|
111
|
-
(z =
|
|
112
|
-
), t(b, !0),
|
|
113
|
-
return
|
|
108
|
+
const [S, B] = h;
|
|
109
|
+
if (b = d.merge(
|
|
110
|
+
B,
|
|
111
|
+
(z = a()) != null ? z : f
|
|
112
|
+
), t(b, !0), S)
|
|
113
|
+
return l();
|
|
114
114
|
}).then(() => {
|
|
115
|
-
|
|
116
|
-
}).catch((
|
|
117
|
-
|
|
115
|
+
w == null || w(b, void 0), b = a(), m = !0, n.forEach((h) => h(b));
|
|
116
|
+
}).catch((h) => {
|
|
117
|
+
w == null || w(void 0, h);
|
|
118
118
|
});
|
|
119
119
|
};
|
|
120
|
-
return
|
|
120
|
+
return s.persist = {
|
|
121
121
|
setOptions: (g) => {
|
|
122
|
-
|
|
123
|
-
...
|
|
122
|
+
d = {
|
|
123
|
+
...d,
|
|
124
124
|
...g
|
|
125
125
|
}, g.storage && (u = g.storage);
|
|
126
126
|
},
|
|
127
127
|
clearStorage: () => {
|
|
128
|
-
u == null || u.removeItem(
|
|
128
|
+
u == null || u.removeItem(d.name);
|
|
129
129
|
},
|
|
130
|
-
getOptions: () =>
|
|
131
|
-
rehydrate: () =>
|
|
132
|
-
hasHydrated: () =>
|
|
133
|
-
onHydrate: (g) => (
|
|
134
|
-
|
|
130
|
+
getOptions: () => d,
|
|
131
|
+
rehydrate: () => k(),
|
|
132
|
+
hasHydrated: () => m,
|
|
133
|
+
onHydrate: (g) => (o.add(g), () => {
|
|
134
|
+
o.delete(g);
|
|
135
135
|
}),
|
|
136
|
-
onFinishHydration: (g) => (
|
|
137
|
-
|
|
136
|
+
onFinishHydration: (g) => (n.add(g), () => {
|
|
137
|
+
n.delete(g);
|
|
138
138
|
})
|
|
139
|
-
},
|
|
140
|
-
},
|
|
141
|
-
async function D(r,
|
|
139
|
+
}, d.skipHydration || k(), b || f;
|
|
140
|
+
}, ie = Le, I = "/api";
|
|
141
|
+
async function D(r, i) {
|
|
142
142
|
const t = await fetch(r, {
|
|
143
|
-
...
|
|
143
|
+
...i,
|
|
144
144
|
headers: {
|
|
145
145
|
"Content-Type": "application/json",
|
|
146
|
-
...
|
|
146
|
+
...i == null ? void 0 : i.headers
|
|
147
147
|
}
|
|
148
148
|
});
|
|
149
149
|
if (!t.ok) {
|
|
150
|
-
const
|
|
151
|
-
throw new Error(
|
|
150
|
+
const a = await t.json().catch(() => ({ error: "Unknown error" }));
|
|
151
|
+
throw new Error(a.error || `HTTP ${t.status}`);
|
|
152
152
|
}
|
|
153
153
|
return t.json();
|
|
154
154
|
}
|
|
155
|
-
async function
|
|
156
|
-
return D(`${
|
|
155
|
+
async function We() {
|
|
156
|
+
return D(`${I}/nodes/generators`);
|
|
157
157
|
}
|
|
158
|
-
async function
|
|
159
|
-
return D(`${
|
|
158
|
+
async function Ae() {
|
|
159
|
+
return D(`${I}/nodes/transforms`);
|
|
160
160
|
}
|
|
161
|
-
async function
|
|
162
|
-
return D(`${
|
|
161
|
+
async function De(r, i, t) {
|
|
162
|
+
return D(`${I}/execute/sync`, {
|
|
163
163
|
method: "POST",
|
|
164
|
-
body: JSON.stringify({ nodes: r, edges:
|
|
164
|
+
body: JSON.stringify({ nodes: r, edges: i, aiProviders: t })
|
|
165
165
|
});
|
|
166
166
|
}
|
|
167
|
-
async function
|
|
168
|
-
return D(`${
|
|
167
|
+
async function $e(r, i) {
|
|
168
|
+
return D(`${I}/export/yaml`, {
|
|
169
169
|
method: "POST",
|
|
170
|
-
body: JSON.stringify({ nodes: r, edges:
|
|
170
|
+
body: JSON.stringify({ nodes: r, edges: i })
|
|
171
171
|
});
|
|
172
172
|
}
|
|
173
|
-
async function
|
|
174
|
-
return D(`${
|
|
173
|
+
async function Me() {
|
|
174
|
+
return D(`${I}/images`);
|
|
175
175
|
}
|
|
176
|
-
function
|
|
177
|
-
return `${
|
|
176
|
+
function te(r) {
|
|
177
|
+
return `${I}/images/${r}/blob`;
|
|
178
178
|
}
|
|
179
|
-
async function
|
|
179
|
+
async function Ue(r) {
|
|
180
180
|
try {
|
|
181
|
-
return await D(`${
|
|
181
|
+
return await D(`${I}/images/${r}/workflow`);
|
|
182
182
|
} catch {
|
|
183
183
|
return null;
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
|
-
async function
|
|
187
|
-
const
|
|
188
|
-
|
|
189
|
-
const t = await fetch(`${
|
|
186
|
+
async function je(r) {
|
|
187
|
+
const i = new FormData();
|
|
188
|
+
i.append("file", r);
|
|
189
|
+
const t = await fetch(`${I}/uploads`, {
|
|
190
190
|
method: "POST",
|
|
191
|
-
body:
|
|
191
|
+
body: i
|
|
192
192
|
});
|
|
193
193
|
if (!t.ok) {
|
|
194
|
-
const
|
|
195
|
-
throw new Error(
|
|
194
|
+
const a = await t.json().catch(() => ({ error: "Upload failed" }));
|
|
195
|
+
throw new Error(a.error || `HTTP ${t.status}`);
|
|
196
196
|
}
|
|
197
197
|
return t.json();
|
|
198
198
|
}
|
|
199
|
-
async function
|
|
200
|
-
return D(`${
|
|
199
|
+
async function Pe() {
|
|
200
|
+
return D(`${I}/uploads`);
|
|
201
201
|
}
|
|
202
|
-
async function
|
|
203
|
-
const
|
|
202
|
+
async function Te(r) {
|
|
203
|
+
const i = await fetch(`${I}/uploads/${r}`, {
|
|
204
204
|
method: "DELETE"
|
|
205
205
|
});
|
|
206
|
-
if (!
|
|
207
|
-
throw new Error(`Failed to delete upload: ${
|
|
206
|
+
if (!i.ok)
|
|
207
|
+
throw new Error(`Failed to delete upload: ${i.status}`);
|
|
208
208
|
}
|
|
209
|
-
function
|
|
210
|
-
return `${
|
|
209
|
+
function de(r) {
|
|
210
|
+
return `${I}/uploads/${r}/blob`;
|
|
211
211
|
}
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
212
|
+
async function Ee(r) {
|
|
213
|
+
return D(`${I}/import`, {
|
|
214
|
+
method: "POST",
|
|
215
|
+
body: JSON.stringify({ yaml: r })
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
async function Oe(r) {
|
|
219
|
+
return D(`${I}/import/validate`, {
|
|
220
|
+
method: "POST",
|
|
221
|
+
body: JSON.stringify({ yaml: r })
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
const re = "http://localhost:11434", ae = "http://localhost:1234", $ = se()(
|
|
225
|
+
ie(
|
|
226
|
+
(r, i) => ({
|
|
215
227
|
ai: {
|
|
216
228
|
ollama: {
|
|
217
|
-
baseUrl:
|
|
229
|
+
baseUrl: re,
|
|
218
230
|
enabled: !1
|
|
219
231
|
},
|
|
220
232
|
lmstudio: {
|
|
221
|
-
baseUrl:
|
|
233
|
+
baseUrl: ae,
|
|
222
234
|
enabled: !1
|
|
223
235
|
}
|
|
224
236
|
},
|
|
225
237
|
showSettings: !1,
|
|
226
|
-
setAIProvider: (t,
|
|
227
|
-
r((
|
|
238
|
+
setAIProvider: (t, a) => {
|
|
239
|
+
r((s) => ({
|
|
228
240
|
ai: {
|
|
229
|
-
...
|
|
230
|
-
[t]:
|
|
241
|
+
...s.ai,
|
|
242
|
+
[t]: a
|
|
231
243
|
}
|
|
232
244
|
}));
|
|
233
245
|
},
|
|
234
246
|
clearAIProvider: (t) => {
|
|
235
|
-
r((
|
|
236
|
-
const
|
|
237
|
-
return delete
|
|
247
|
+
r((a) => {
|
|
248
|
+
const s = { ...a.ai };
|
|
249
|
+
return delete s[t], { ai: s };
|
|
238
250
|
});
|
|
239
251
|
},
|
|
240
252
|
openSettings: () => r({ showSettings: !0 }),
|
|
241
253
|
closeSettings: () => r({ showSettings: !1 }),
|
|
242
254
|
getConfiguredProviders: () => {
|
|
243
|
-
var
|
|
244
|
-
const { ai: t } =
|
|
245
|
-
return (
|
|
255
|
+
var s, d, m, o, n, u;
|
|
256
|
+
const { ai: t } = i(), a = {};
|
|
257
|
+
return (s = t.openai) != null && s.enabled && t.openai.apiKey && (a.openai = { apiKey: t.openai.apiKey }), (d = t.anthropic) != null && d.enabled && t.anthropic.apiKey && (a.anthropic = { apiKey: t.anthropic.apiKey }), (m = t.gemini) != null && m.enabled && t.gemini.apiKey && (a.gemini = { apiKey: t.gemini.apiKey }), (o = t.openrouter) != null && o.enabled && t.openrouter.apiKey && (a.openrouter = { apiKey: t.openrouter.apiKey }), (n = t.ollama) != null && n.enabled && (a.ollama = { baseUrl: t.ollama.baseUrl || re }), (u = t.lmstudio) != null && u.enabled && (a.lmstudio = { baseUrl: t.lmstudio.baseUrl || ae }), a;
|
|
246
258
|
}
|
|
247
259
|
}),
|
|
248
260
|
{
|
|
@@ -252,17 +264,17 @@ const Z = "http://localhost:11434", ee = "http://localhost:1234", A = oe()(
|
|
|
252
264
|
}
|
|
253
265
|
)
|
|
254
266
|
);
|
|
255
|
-
let
|
|
256
|
-
function
|
|
257
|
-
return `node_${++
|
|
267
|
+
let Be = 0;
|
|
268
|
+
function q() {
|
|
269
|
+
return `node_${++Be}`;
|
|
258
270
|
}
|
|
259
|
-
function
|
|
260
|
-
const r = Date.now(),
|
|
261
|
-
return `wf_${r}_${
|
|
271
|
+
function oe() {
|
|
272
|
+
const r = Date.now(), i = Math.random().toString(36).substring(2, 8);
|
|
273
|
+
return `wf_${r}_${i}`;
|
|
262
274
|
}
|
|
263
|
-
const
|
|
264
|
-
|
|
265
|
-
(r,
|
|
275
|
+
const x = se()(
|
|
276
|
+
ie(
|
|
277
|
+
(r, i) => ({
|
|
266
278
|
nodes: [],
|
|
267
279
|
edges: [],
|
|
268
280
|
selectedNodeId: null,
|
|
@@ -279,36 +291,38 @@ const f = oe()(
|
|
|
279
291
|
execution: {
|
|
280
292
|
status: "idle",
|
|
281
293
|
imageIds: [],
|
|
294
|
+
imageUrls: [],
|
|
282
295
|
previews: {},
|
|
283
296
|
dataOutputs: {},
|
|
284
297
|
nodeStatus: {}
|
|
285
298
|
},
|
|
286
299
|
loadTemplate: (t) => {
|
|
287
|
-
const
|
|
288
|
-
const
|
|
289
|
-
return
|
|
290
|
-
id:
|
|
291
|
-
type:
|
|
292
|
-
position:
|
|
293
|
-
data:
|
|
300
|
+
const a = /* @__PURE__ */ new Map(), s = t.workflow.nodes.map((m) => {
|
|
301
|
+
const o = q();
|
|
302
|
+
return a.set(m.id, o), {
|
|
303
|
+
id: o,
|
|
304
|
+
type: m.type,
|
|
305
|
+
position: m.position,
|
|
306
|
+
data: m.data
|
|
294
307
|
};
|
|
295
|
-
}),
|
|
296
|
-
const
|
|
308
|
+
}), d = t.workflow.edges.map((m) => {
|
|
309
|
+
const o = a.get(m.source) || m.source, n = a.get(m.target) || m.target;
|
|
297
310
|
return {
|
|
298
|
-
id: `edge_${
|
|
299
|
-
source:
|
|
300
|
-
target:
|
|
311
|
+
id: `edge_${o}_${n}`,
|
|
312
|
+
source: o,
|
|
313
|
+
target: n
|
|
301
314
|
};
|
|
302
315
|
});
|
|
303
316
|
r({
|
|
304
|
-
nodes:
|
|
305
|
-
edges:
|
|
317
|
+
nodes: s,
|
|
318
|
+
edges: d,
|
|
306
319
|
selectedNodeId: null,
|
|
307
320
|
currentTemplateId: t.id,
|
|
308
321
|
previewVisible: {},
|
|
309
322
|
execution: {
|
|
310
323
|
status: "idle",
|
|
311
324
|
imageIds: [],
|
|
325
|
+
imageUrls: [],
|
|
312
326
|
previews: {},
|
|
313
327
|
dataOutputs: {},
|
|
314
328
|
nodeStatus: {}
|
|
@@ -325,6 +339,7 @@ const f = oe()(
|
|
|
325
339
|
execution: {
|
|
326
340
|
status: "idle",
|
|
327
341
|
imageIds: [],
|
|
342
|
+
imageUrls: [],
|
|
328
343
|
previews: {},
|
|
329
344
|
dataOutputs: {},
|
|
330
345
|
nodeStatus: {}
|
|
@@ -332,154 +347,208 @@ const f = oe()(
|
|
|
332
347
|
});
|
|
333
348
|
},
|
|
334
349
|
togglePreview: (t) => {
|
|
335
|
-
r((
|
|
350
|
+
r((a) => ({
|
|
336
351
|
previewVisible: {
|
|
337
|
-
...
|
|
338
|
-
[t]:
|
|
352
|
+
...a.previewVisible,
|
|
353
|
+
[t]: a.previewVisible[t] === !1
|
|
339
354
|
// default true, toggle
|
|
340
355
|
}
|
|
341
356
|
}));
|
|
342
357
|
},
|
|
343
358
|
setGenerators: (t) => r({ generators: t }),
|
|
344
359
|
setTransforms: (t) => r({ transforms: t }),
|
|
345
|
-
addNode: (t,
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
360
|
+
addNode: (t, a) => {
|
|
361
|
+
var o, n, u;
|
|
362
|
+
const s = q();
|
|
363
|
+
let d;
|
|
364
|
+
if (t.type === "generator")
|
|
365
|
+
d = {
|
|
366
|
+
generatorName: t.name,
|
|
367
|
+
params: R(t)
|
|
368
|
+
};
|
|
369
|
+
else if (t.type === "transform")
|
|
370
|
+
d = {
|
|
371
|
+
operation: t.name,
|
|
372
|
+
params: R(t)
|
|
373
|
+
};
|
|
374
|
+
else if (t.type === "input")
|
|
375
|
+
d = {
|
|
376
|
+
uploadId: void 0,
|
|
377
|
+
filename: void 0,
|
|
378
|
+
mime: void 0
|
|
379
|
+
};
|
|
380
|
+
else if (t.type === "vision")
|
|
381
|
+
d = {
|
|
382
|
+
providerName: t.name,
|
|
383
|
+
params: R(t)
|
|
384
|
+
};
|
|
385
|
+
else if (t.type === "text")
|
|
386
|
+
d = {
|
|
387
|
+
providerName: t.name,
|
|
388
|
+
params: R(t)
|
|
389
|
+
};
|
|
390
|
+
else {
|
|
391
|
+
const l = ((o = t.params) == null ? void 0 : o.properties) || {}, p = ((n = l.provider) == null ? void 0 : n.default) || "filesystem";
|
|
392
|
+
d = {
|
|
393
|
+
destination: ((u = l.destination) == null ? void 0 : u.default) || "./output/image.png",
|
|
394
|
+
provider: p
|
|
395
|
+
};
|
|
396
|
+
}
|
|
397
|
+
const m = {
|
|
398
|
+
id: s,
|
|
370
399
|
type: t.type,
|
|
371
|
-
position:
|
|
372
|
-
data:
|
|
400
|
+
position: a,
|
|
401
|
+
data: d
|
|
373
402
|
};
|
|
374
|
-
r((
|
|
375
|
-
nodes: [...
|
|
403
|
+
r((l) => ({
|
|
404
|
+
nodes: [...l.nodes, m]
|
|
376
405
|
}));
|
|
377
406
|
},
|
|
378
|
-
updateNodeData: (t,
|
|
379
|
-
r((
|
|
380
|
-
nodes:
|
|
381
|
-
(
|
|
407
|
+
updateNodeData: (t, a) => {
|
|
408
|
+
r((s) => ({
|
|
409
|
+
nodes: s.nodes.map(
|
|
410
|
+
(d) => d.id === t ? { ...d, data: { ...d.data, ...a } } : d
|
|
382
411
|
)
|
|
383
412
|
}));
|
|
384
413
|
},
|
|
385
414
|
deleteNode: (t) => {
|
|
386
|
-
r((
|
|
387
|
-
nodes:
|
|
388
|
-
edges:
|
|
389
|
-
selectedNodeId:
|
|
415
|
+
r((a) => ({
|
|
416
|
+
nodes: a.nodes.filter((s) => s.id !== t),
|
|
417
|
+
edges: a.edges.filter((s) => s.source !== t && s.target !== t),
|
|
418
|
+
selectedNodeId: a.selectedNodeId === t ? null : a.selectedNodeId
|
|
390
419
|
}));
|
|
391
420
|
},
|
|
392
421
|
setNodes: (t) => r({ nodes: t }),
|
|
393
422
|
addEdge: (t) => {
|
|
394
423
|
if (!t.source || !t.target) return;
|
|
395
|
-
const
|
|
424
|
+
const s = {
|
|
396
425
|
id: `edge_${t.source}_${t.target}`,
|
|
397
426
|
source: t.source,
|
|
398
427
|
target: t.target
|
|
399
428
|
};
|
|
400
|
-
r((
|
|
401
|
-
edges: [...
|
|
429
|
+
r((d) => ({
|
|
430
|
+
edges: [...d.edges, s]
|
|
402
431
|
}));
|
|
403
432
|
},
|
|
404
433
|
deleteEdge: (t) => {
|
|
405
|
-
r((
|
|
406
|
-
edges:
|
|
434
|
+
r((a) => ({
|
|
435
|
+
edges: a.edges.filter((s) => s.id !== t)
|
|
407
436
|
}));
|
|
408
437
|
},
|
|
409
438
|
setEdges: (t) => r({ edges: t }),
|
|
410
439
|
setSelectedNode: (t) => r({ selectedNodeId: t }),
|
|
411
440
|
execute: async () => {
|
|
412
|
-
const { nodes: t, edges:
|
|
413
|
-
id:
|
|
414
|
-
type:
|
|
415
|
-
position:
|
|
416
|
-
data:
|
|
417
|
-
})),
|
|
418
|
-
id:
|
|
419
|
-
source:
|
|
420
|
-
target:
|
|
421
|
-
})),
|
|
422
|
-
for (const
|
|
423
|
-
|
|
441
|
+
const { nodes: t, edges: a } = i(), s = t.map((n) => ({
|
|
442
|
+
id: n.id,
|
|
443
|
+
type: n.type,
|
|
444
|
+
position: n.position,
|
|
445
|
+
data: n.data
|
|
446
|
+
})), d = a.map((n) => ({
|
|
447
|
+
id: n.id,
|
|
448
|
+
source: n.source,
|
|
449
|
+
target: n.target
|
|
450
|
+
})), m = $.getState().getConfiguredProviders(), o = {};
|
|
451
|
+
for (const n of t)
|
|
452
|
+
o[n.id] = "running";
|
|
424
453
|
r({
|
|
425
454
|
execution: {
|
|
426
455
|
status: "running",
|
|
427
456
|
imageIds: [],
|
|
457
|
+
imageUrls: [],
|
|
428
458
|
previews: {},
|
|
429
459
|
dataOutputs: {},
|
|
430
|
-
nodeStatus:
|
|
460
|
+
nodeStatus: o
|
|
431
461
|
}
|
|
432
462
|
});
|
|
433
463
|
try {
|
|
434
|
-
const
|
|
435
|
-
for (const
|
|
436
|
-
u[
|
|
437
|
-
|
|
464
|
+
const n = await De(s, d, m), u = {};
|
|
465
|
+
for (const l of t)
|
|
466
|
+
u[l.id] = n.status === "completed" ? "completed" : "error";
|
|
467
|
+
n.status === "completed" ? r({
|
|
438
468
|
execution: {
|
|
439
469
|
status: "completed",
|
|
440
|
-
imageIds:
|
|
441
|
-
|
|
442
|
-
|
|
470
|
+
imageIds: n.imageIds,
|
|
471
|
+
imageUrls: n.imageUrls || [],
|
|
472
|
+
previews: n.previews || {},
|
|
473
|
+
dataOutputs: n.dataOutputs || {},
|
|
443
474
|
nodeStatus: u
|
|
444
475
|
}
|
|
445
476
|
}) : r({
|
|
446
477
|
execution: {
|
|
447
478
|
status: "error",
|
|
448
479
|
imageIds: [],
|
|
480
|
+
imageUrls: [],
|
|
449
481
|
previews: {},
|
|
450
482
|
dataOutputs: {},
|
|
451
483
|
nodeStatus: u,
|
|
452
|
-
error:
|
|
484
|
+
error: n.error
|
|
453
485
|
}
|
|
454
486
|
});
|
|
455
|
-
} catch (
|
|
487
|
+
} catch (n) {
|
|
456
488
|
const u = {};
|
|
457
|
-
for (const
|
|
458
|
-
u[
|
|
489
|
+
for (const l of t)
|
|
490
|
+
u[l.id] = "error";
|
|
459
491
|
r({
|
|
460
492
|
execution: {
|
|
461
493
|
status: "error",
|
|
462
494
|
imageIds: [],
|
|
495
|
+
imageUrls: [],
|
|
463
496
|
previews: {},
|
|
464
497
|
dataOutputs: {},
|
|
465
498
|
nodeStatus: u,
|
|
466
|
-
error:
|
|
499
|
+
error: n instanceof Error ? n.message : "Unknown error"
|
|
467
500
|
}
|
|
468
501
|
});
|
|
469
502
|
}
|
|
470
503
|
},
|
|
471
504
|
exportToYaml: async () => {
|
|
472
|
-
const { nodes: t, edges:
|
|
473
|
-
id:
|
|
474
|
-
type:
|
|
475
|
-
position:
|
|
476
|
-
data:
|
|
477
|
-
})),
|
|
478
|
-
id:
|
|
479
|
-
source:
|
|
480
|
-
target:
|
|
505
|
+
const { nodes: t, edges: a } = i(), s = t.map((o) => ({
|
|
506
|
+
id: o.id,
|
|
507
|
+
type: o.type,
|
|
508
|
+
position: o.position,
|
|
509
|
+
data: o.data
|
|
510
|
+
})), d = a.map((o) => ({
|
|
511
|
+
id: o.id,
|
|
512
|
+
source: o.source,
|
|
513
|
+
target: o.target
|
|
481
514
|
}));
|
|
482
|
-
return (await
|
|
515
|
+
return (await $e(s, d)).yaml;
|
|
516
|
+
},
|
|
517
|
+
importFromYaml: (t, a, s) => {
|
|
518
|
+
const d = /* @__PURE__ */ new Map(), m = t.map((n) => {
|
|
519
|
+
const u = q();
|
|
520
|
+
return d.set(n.id, u), {
|
|
521
|
+
id: u,
|
|
522
|
+
type: n.type,
|
|
523
|
+
position: n.position,
|
|
524
|
+
data: n.data
|
|
525
|
+
};
|
|
526
|
+
}), o = a.map((n) => {
|
|
527
|
+
const u = d.get(n.source) || n.source, l = d.get(n.target) || n.target;
|
|
528
|
+
return {
|
|
529
|
+
id: `edge_${u}_${l}`,
|
|
530
|
+
source: u,
|
|
531
|
+
target: l
|
|
532
|
+
};
|
|
533
|
+
});
|
|
534
|
+
r({
|
|
535
|
+
nodes: m,
|
|
536
|
+
edges: o,
|
|
537
|
+
selectedNodeId: null,
|
|
538
|
+
currentTemplateId: null,
|
|
539
|
+
previewVisible: {},
|
|
540
|
+
activeWorkflowId: null,
|
|
541
|
+
activeWorkflowName: s || "Imported Workflow",
|
|
542
|
+
hasUnsavedChanges: !0,
|
|
543
|
+
execution: {
|
|
544
|
+
status: "idle",
|
|
545
|
+
imageIds: [],
|
|
546
|
+
imageUrls: [],
|
|
547
|
+
previews: {},
|
|
548
|
+
dataOutputs: {},
|
|
549
|
+
nodeStatus: {}
|
|
550
|
+
}
|
|
551
|
+
});
|
|
483
552
|
},
|
|
484
553
|
// Workflow persistence methods
|
|
485
554
|
markDirty: () => r({ hasUnsavedChanges: !0 }),
|
|
@@ -498,6 +567,7 @@ const f = oe()(
|
|
|
498
567
|
execution: {
|
|
499
568
|
status: "idle",
|
|
500
569
|
imageIds: [],
|
|
570
|
+
imageUrls: [],
|
|
501
571
|
previews: {},
|
|
502
572
|
dataOutputs: {},
|
|
503
573
|
nodeStatus: {}
|
|
@@ -506,54 +576,55 @@ const f = oe()(
|
|
|
506
576
|
},
|
|
507
577
|
saveWorkflow: (t) => {
|
|
508
578
|
const {
|
|
509
|
-
nodes:
|
|
510
|
-
edges:
|
|
511
|
-
activeWorkflowId:
|
|
512
|
-
activeWorkflowName:
|
|
513
|
-
savedWorkflows:
|
|
514
|
-
currentTemplateId:
|
|
515
|
-
} =
|
|
516
|
-
if (
|
|
517
|
-
const
|
|
518
|
-
(p) => p.id ===
|
|
579
|
+
nodes: a,
|
|
580
|
+
edges: s,
|
|
581
|
+
activeWorkflowId: d,
|
|
582
|
+
activeWorkflowName: m,
|
|
583
|
+
savedWorkflows: o,
|
|
584
|
+
currentTemplateId: n
|
|
585
|
+
} = i(), u = Date.now();
|
|
586
|
+
if (d) {
|
|
587
|
+
const l = o.map(
|
|
588
|
+
(p) => p.id === d ? { ...p, name: t || m, nodes: a, edges: s, updatedAt: u } : p
|
|
519
589
|
);
|
|
520
590
|
return r({
|
|
521
|
-
savedWorkflows:
|
|
522
|
-
activeWorkflowName: t ||
|
|
591
|
+
savedWorkflows: l,
|
|
592
|
+
activeWorkflowName: t || m,
|
|
523
593
|
hasUnsavedChanges: !1
|
|
524
|
-
}),
|
|
594
|
+
}), d;
|
|
525
595
|
} else {
|
|
526
|
-
const
|
|
527
|
-
id:
|
|
528
|
-
name: t ||
|
|
529
|
-
nodes:
|
|
530
|
-
edges:
|
|
596
|
+
const l = oe(), p = {
|
|
597
|
+
id: l,
|
|
598
|
+
name: t || m,
|
|
599
|
+
nodes: a,
|
|
600
|
+
edges: s,
|
|
531
601
|
createdAt: u,
|
|
532
602
|
updatedAt: u,
|
|
533
|
-
templateId:
|
|
603
|
+
templateId: n || void 0
|
|
534
604
|
};
|
|
535
605
|
return r({
|
|
536
|
-
savedWorkflows: [...
|
|
537
|
-
activeWorkflowId:
|
|
538
|
-
activeWorkflowName: t ||
|
|
606
|
+
savedWorkflows: [...o, p],
|
|
607
|
+
activeWorkflowId: l,
|
|
608
|
+
activeWorkflowName: t || m,
|
|
539
609
|
hasUnsavedChanges: !1
|
|
540
|
-
}),
|
|
610
|
+
}), l;
|
|
541
611
|
}
|
|
542
612
|
},
|
|
543
613
|
loadWorkflow: (t) => {
|
|
544
|
-
const { savedWorkflows:
|
|
545
|
-
|
|
546
|
-
nodes:
|
|
547
|
-
edges:
|
|
614
|
+
const { savedWorkflows: a } = i(), s = a.find((d) => d.id === t);
|
|
615
|
+
s && r({
|
|
616
|
+
nodes: s.nodes,
|
|
617
|
+
edges: s.edges,
|
|
548
618
|
selectedNodeId: null,
|
|
549
|
-
currentTemplateId:
|
|
619
|
+
currentTemplateId: s.templateId || null,
|
|
550
620
|
previewVisible: {},
|
|
551
621
|
activeWorkflowId: t,
|
|
552
|
-
activeWorkflowName:
|
|
622
|
+
activeWorkflowName: s.name,
|
|
553
623
|
hasUnsavedChanges: !1,
|
|
554
624
|
execution: {
|
|
555
625
|
status: "idle",
|
|
556
626
|
imageIds: [],
|
|
627
|
+
imageUrls: [],
|
|
557
628
|
previews: {},
|
|
558
629
|
dataOutputs: {},
|
|
559
630
|
nodeStatus: {}
|
|
@@ -561,9 +632,9 @@ const f = oe()(
|
|
|
561
632
|
});
|
|
562
633
|
},
|
|
563
634
|
deleteWorkflow: (t) => {
|
|
564
|
-
const { savedWorkflows:
|
|
565
|
-
r(
|
|
566
|
-
savedWorkflows:
|
|
635
|
+
const { savedWorkflows: a, activeWorkflowId: s } = i(), d = a.filter((m) => m.id !== t);
|
|
636
|
+
r(s === t ? {
|
|
637
|
+
savedWorkflows: d,
|
|
567
638
|
nodes: [],
|
|
568
639
|
edges: [],
|
|
569
640
|
selectedNodeId: null,
|
|
@@ -575,32 +646,33 @@ const f = oe()(
|
|
|
575
646
|
execution: {
|
|
576
647
|
status: "idle",
|
|
577
648
|
imageIds: [],
|
|
649
|
+
imageUrls: [],
|
|
578
650
|
previews: {},
|
|
579
651
|
dataOutputs: {},
|
|
580
652
|
nodeStatus: {}
|
|
581
653
|
}
|
|
582
|
-
} : { savedWorkflows:
|
|
654
|
+
} : { savedWorkflows: d });
|
|
583
655
|
},
|
|
584
|
-
renameWorkflow: (t,
|
|
585
|
-
const { savedWorkflows:
|
|
586
|
-
(
|
|
656
|
+
renameWorkflow: (t, a) => {
|
|
657
|
+
const { savedWorkflows: s, activeWorkflowId: d } = i(), m = s.map(
|
|
658
|
+
(o) => o.id === t ? { ...o, name: a, updatedAt: Date.now() } : o
|
|
587
659
|
);
|
|
588
660
|
r({
|
|
589
|
-
savedWorkflows:
|
|
590
|
-
...
|
|
661
|
+
savedWorkflows: m,
|
|
662
|
+
...d === t ? { activeWorkflowName: a } : {}
|
|
591
663
|
});
|
|
592
664
|
},
|
|
593
665
|
duplicateWorkflow: (t) => {
|
|
594
|
-
const { savedWorkflows:
|
|
595
|
-
if (!
|
|
596
|
-
const
|
|
597
|
-
...
|
|
598
|
-
id:
|
|
599
|
-
name: `${
|
|
600
|
-
createdAt:
|
|
601
|
-
updatedAt:
|
|
666
|
+
const { savedWorkflows: a } = i(), s = a.find((n) => n.id === t);
|
|
667
|
+
if (!s) return "";
|
|
668
|
+
const d = Date.now(), m = oe(), o = {
|
|
669
|
+
...s,
|
|
670
|
+
id: m,
|
|
671
|
+
name: `${s.name} (Copy)`,
|
|
672
|
+
createdAt: d,
|
|
673
|
+
updatedAt: d
|
|
602
674
|
};
|
|
603
|
-
return r({ savedWorkflows: [...
|
|
675
|
+
return r({ savedWorkflows: [...a, o] }), m;
|
|
604
676
|
}
|
|
605
677
|
}),
|
|
606
678
|
{
|
|
@@ -614,26 +686,26 @@ const f = oe()(
|
|
|
614
686
|
);
|
|
615
687
|
function R(r) {
|
|
616
688
|
var t;
|
|
617
|
-
const
|
|
689
|
+
const i = {};
|
|
618
690
|
if ((t = r.params) != null && t.properties)
|
|
619
|
-
for (const [
|
|
620
|
-
|
|
621
|
-
return
|
|
691
|
+
for (const [a, s] of Object.entries(r.params.properties))
|
|
692
|
+
s.default !== void 0 && (i[a] = s.default);
|
|
693
|
+
return i;
|
|
622
694
|
}
|
|
623
|
-
function
|
|
695
|
+
function T(r) {
|
|
624
696
|
return r === "running" ? "border-yellow-400 animate-pulse" : r === "completed" ? "border-green-500" : r === "error" ? "border-red-500" : "";
|
|
625
697
|
}
|
|
626
|
-
function H({ nodeId: r, color:
|
|
627
|
-
const t =
|
|
698
|
+
function H({ nodeId: r, color: i }) {
|
|
699
|
+
const t = x((s) => s.previewVisible[r] !== !1), a = x((s) => s.togglePreview);
|
|
628
700
|
return /* @__PURE__ */ e(
|
|
629
701
|
"button",
|
|
630
702
|
{
|
|
631
|
-
onClick: (
|
|
632
|
-
|
|
703
|
+
onClick: (s) => {
|
|
704
|
+
s.stopPropagation(), a(r);
|
|
633
705
|
},
|
|
634
706
|
className: `ml-auto p-1 rounded hover:bg-gray-200 dark:hover:bg-zinc-600 transition-colors ${t ? "opacity-100" : "opacity-40"}`,
|
|
635
707
|
title: t ? "Hide preview" : "Show preview",
|
|
636
|
-
children: /* @__PURE__ */ e("svg", { className: `w-3.5 h-3.5 ${
|
|
708
|
+
children: /* @__PURE__ */ e("svg", { className: `w-3.5 h-3.5 ${i}`, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: t ? /* @__PURE__ */ e(
|
|
637
709
|
"path",
|
|
638
710
|
{
|
|
639
711
|
strokeLinecap: "round",
|
|
@@ -653,72 +725,72 @@ function H({ nodeId: r, color: s }) {
|
|
|
653
725
|
}
|
|
654
726
|
);
|
|
655
727
|
}
|
|
656
|
-
const
|
|
657
|
-
id:
|
|
728
|
+
const Re = P(function({
|
|
729
|
+
id: i,
|
|
658
730
|
data: t,
|
|
659
|
-
selected:
|
|
731
|
+
selected: a
|
|
660
732
|
}) {
|
|
661
|
-
const
|
|
662
|
-
return /* @__PURE__ */
|
|
733
|
+
const s = x((u) => u.execution.previews[i]), d = x((u) => u.execution.nodeStatus[i]), m = x((u) => u.previewVisible[i] !== !1), n = T(d) || (a ? "border-blue-500" : "border-blue-200");
|
|
734
|
+
return /* @__PURE__ */ c(
|
|
663
735
|
"div",
|
|
664
736
|
{
|
|
665
|
-
className: `rounded-lg border-2 bg-white dark:bg-zinc-800 shadow-md min-w-[180px] overflow-hidden ${
|
|
737
|
+
className: `rounded-lg border-2 bg-white dark:bg-zinc-800 shadow-md min-w-[180px] overflow-hidden ${n}`,
|
|
666
738
|
children: [
|
|
667
|
-
|
|
668
|
-
/* @__PURE__ */
|
|
669
|
-
/* @__PURE__ */
|
|
739
|
+
s && m && /* @__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: s, alt: "Preview", className: "w-full h-24 object-contain" }) }),
|
|
740
|
+
/* @__PURE__ */ c("div", { className: "px-4 py-3", children: [
|
|
741
|
+
/* @__PURE__ */ c("div", { className: "flex items-center gap-2 mb-2", children: [
|
|
670
742
|
/* @__PURE__ */ e("div", { className: "w-3 h-3 rounded-full bg-blue-500" }),
|
|
671
743
|
/* @__PURE__ */ e("span", { className: "font-semibold text-sm text-blue-700 dark:text-blue-400", children: t.generatorName }),
|
|
672
|
-
/* @__PURE__ */ e(H, { nodeId:
|
|
744
|
+
/* @__PURE__ */ e(H, { nodeId: i, color: "text-blue-500 dark:text-blue-400" })
|
|
673
745
|
] }),
|
|
674
|
-
/* @__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,
|
|
746
|
+
/* @__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, l]) => /* @__PURE__ */ c("div", { className: "truncate", children: [
|
|
675
747
|
u,
|
|
676
748
|
": ",
|
|
677
|
-
String(
|
|
749
|
+
String(l).slice(0, 20)
|
|
678
750
|
] }, u)) })
|
|
679
751
|
] }),
|
|
680
|
-
/* @__PURE__ */ e(
|
|
752
|
+
/* @__PURE__ */ e(W, { type: "source", position: A.Right, className: "w-3 h-3 !bg-blue-500" })
|
|
681
753
|
]
|
|
682
754
|
}
|
|
683
755
|
);
|
|
684
|
-
}),
|
|
685
|
-
id:
|
|
756
|
+
}), Fe = P(function({
|
|
757
|
+
id: i,
|
|
686
758
|
data: t,
|
|
687
|
-
selected:
|
|
759
|
+
selected: a
|
|
688
760
|
}) {
|
|
689
|
-
const
|
|
690
|
-
return /* @__PURE__ */
|
|
761
|
+
const s = x((u) => u.execution.previews[i]), d = x((u) => u.execution.nodeStatus[i]), m = x((u) => u.previewVisible[i] !== !1), n = T(d) || (a ? "border-teal-500" : "border-teal-200");
|
|
762
|
+
return /* @__PURE__ */ c(
|
|
691
763
|
"div",
|
|
692
764
|
{
|
|
693
|
-
className: `rounded-lg border-2 bg-white dark:bg-zinc-800 shadow-md min-w-[180px] overflow-hidden ${
|
|
765
|
+
className: `rounded-lg border-2 bg-white dark:bg-zinc-800 shadow-md min-w-[180px] overflow-hidden ${n}`,
|
|
694
766
|
children: [
|
|
695
|
-
/* @__PURE__ */ e(
|
|
696
|
-
|
|
697
|
-
/* @__PURE__ */
|
|
698
|
-
/* @__PURE__ */
|
|
767
|
+
/* @__PURE__ */ e(W, { type: "target", position: A.Left, className: "w-3 h-3 !bg-teal-500" }),
|
|
768
|
+
s && m && /* @__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: s, alt: "Preview", className: "w-full h-24 object-contain" }) }),
|
|
769
|
+
/* @__PURE__ */ c("div", { className: "px-4 py-3", children: [
|
|
770
|
+
/* @__PURE__ */ c("div", { className: "flex items-center gap-2 mb-2", children: [
|
|
699
771
|
/* @__PURE__ */ e("div", { className: "w-3 h-3 rounded-full bg-teal-500" }),
|
|
700
772
|
/* @__PURE__ */ e("span", { className: "font-semibold text-sm text-teal-700 dark:text-teal-400", children: t.operation }),
|
|
701
|
-
/* @__PURE__ */ e(H, { nodeId:
|
|
773
|
+
/* @__PURE__ */ e(H, { nodeId: i, color: "text-teal-500 dark:text-teal-400" })
|
|
702
774
|
] }),
|
|
703
|
-
/* @__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,
|
|
775
|
+
/* @__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, l]) => /* @__PURE__ */ c("div", { className: "truncate", children: [
|
|
704
776
|
u,
|
|
705
777
|
": ",
|
|
706
|
-
String(
|
|
778
|
+
String(l).slice(0, 20)
|
|
707
779
|
] }, u)) })
|
|
708
780
|
] }),
|
|
709
|
-
/* @__PURE__ */ e(
|
|
781
|
+
/* @__PURE__ */ e(W, { type: "source", position: A.Right, className: "w-3 h-3 !bg-teal-500" })
|
|
710
782
|
]
|
|
711
783
|
}
|
|
712
784
|
);
|
|
713
|
-
}),
|
|
714
|
-
const
|
|
715
|
-
return /* @__PURE__ */
|
|
785
|
+
}), Ve = P(function({ id: i, data: t, selected: a }) {
|
|
786
|
+
const s = x((o) => o.execution.nodeStatus[i]), m = T(s) || (a ? "border-green-500" : "border-green-200");
|
|
787
|
+
return /* @__PURE__ */ c(
|
|
716
788
|
"div",
|
|
717
789
|
{
|
|
718
|
-
className: `px-4 py-3 rounded-lg border-2 bg-white dark:bg-zinc-800 shadow-md min-w-[180px] ${
|
|
790
|
+
className: `px-4 py-3 rounded-lg border-2 bg-white dark:bg-zinc-800 shadow-md min-w-[180px] ${m}`,
|
|
719
791
|
children: [
|
|
720
|
-
/* @__PURE__ */ e(
|
|
721
|
-
/* @__PURE__ */
|
|
792
|
+
/* @__PURE__ */ e(W, { type: "target", position: A.Left, className: "w-3 h-3 !bg-green-500" }),
|
|
793
|
+
/* @__PURE__ */ c("div", { className: "flex items-center gap-2 mb-2", children: [
|
|
722
794
|
/* @__PURE__ */ e("div", { className: "w-3 h-3 rounded-full bg-green-500" }),
|
|
723
795
|
/* @__PURE__ */ e("span", { className: "font-semibold text-sm text-green-700 dark:text-green-400", children: "Save" })
|
|
724
796
|
] }),
|
|
@@ -726,54 +798,54 @@ const Pe = T(function({
|
|
|
726
798
|
]
|
|
727
799
|
}
|
|
728
800
|
);
|
|
729
|
-
}),
|
|
730
|
-
const
|
|
731
|
-
async (
|
|
801
|
+
}), Ge = P(function({ id: i, data: t, selected: a }) {
|
|
802
|
+
const s = x((v) => v.execution.previews[i]), d = x((v) => v.execution.nodeStatus[i]), m = x((v) => v.previewVisible[i] !== !1), o = x((v) => v.updateNodeData), n = xe(null), l = T(d) || (a ? "border-amber-500" : "border-amber-200"), p = C(
|
|
803
|
+
async (v) => {
|
|
732
804
|
try {
|
|
733
|
-
const
|
|
734
|
-
|
|
735
|
-
uploadId:
|
|
736
|
-
filename:
|
|
737
|
-
mime:
|
|
805
|
+
const w = await je(v);
|
|
806
|
+
o(i, {
|
|
807
|
+
uploadId: w.id,
|
|
808
|
+
filename: w.filename,
|
|
809
|
+
mime: w.mime
|
|
738
810
|
});
|
|
739
|
-
} catch (
|
|
740
|
-
console.error("Upload failed:",
|
|
811
|
+
} catch (w) {
|
|
812
|
+
console.error("Upload failed:", w);
|
|
741
813
|
}
|
|
742
814
|
},
|
|
743
|
-
[
|
|
744
|
-
),
|
|
745
|
-
(
|
|
746
|
-
|
|
747
|
-
const
|
|
748
|
-
|
|
815
|
+
[i, o]
|
|
816
|
+
), f = C(
|
|
817
|
+
(v) => {
|
|
818
|
+
v.preventDefault(), v.stopPropagation();
|
|
819
|
+
const w = v.dataTransfer.files[0];
|
|
820
|
+
w && w.type.startsWith("image/") && p(w);
|
|
749
821
|
},
|
|
750
822
|
[p]
|
|
751
|
-
), b = C((
|
|
752
|
-
|
|
753
|
-
}, []),
|
|
754
|
-
(
|
|
755
|
-
var
|
|
756
|
-
const
|
|
757
|
-
|
|
823
|
+
), b = C((v) => {
|
|
824
|
+
v.preventDefault(), v.stopPropagation();
|
|
825
|
+
}, []), k = C(
|
|
826
|
+
(v) => {
|
|
827
|
+
var h;
|
|
828
|
+
const w = (h = v.target.files) == null ? void 0 : h[0];
|
|
829
|
+
w && p(w);
|
|
758
830
|
},
|
|
759
831
|
[p]
|
|
760
|
-
), g =
|
|
761
|
-
return /* @__PURE__ */
|
|
832
|
+
), g = s || (t.uploadId ? de(t.uploadId) : null);
|
|
833
|
+
return /* @__PURE__ */ c(
|
|
762
834
|
"div",
|
|
763
835
|
{
|
|
764
|
-
className: `rounded-lg border-2 bg-white dark:bg-zinc-800 shadow-md min-w-[180px] overflow-hidden ${
|
|
765
|
-
onDrop:
|
|
836
|
+
className: `rounded-lg border-2 bg-white dark:bg-zinc-800 shadow-md min-w-[180px] overflow-hidden ${l}`,
|
|
837
|
+
onDrop: f,
|
|
766
838
|
onDragOver: b,
|
|
767
839
|
children: [
|
|
768
|
-
g &&
|
|
840
|
+
g && m ? /* @__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: g, alt: "Uploaded", className: "w-full h-24 object-contain" }) }) : g ? null : /* @__PURE__ */ e(
|
|
769
841
|
"div",
|
|
770
842
|
{
|
|
771
843
|
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",
|
|
772
844
|
onClick: () => {
|
|
773
|
-
var
|
|
774
|
-
return (
|
|
845
|
+
var v;
|
|
846
|
+
return (v = n.current) == null ? void 0 : v.click();
|
|
775
847
|
},
|
|
776
|
-
children: /* @__PURE__ */
|
|
848
|
+
children: /* @__PURE__ */ c("div", { className: "text-center text-amber-600 dark:text-amber-400", children: [
|
|
777
849
|
/* @__PURE__ */ e("div", { className: "text-2xl mb-1", children: "+" }),
|
|
778
850
|
/* @__PURE__ */ e("div", { className: "text-xs", children: "Drop image or click" })
|
|
779
851
|
] })
|
|
@@ -782,48 +854,48 @@ const Pe = T(function({
|
|
|
782
854
|
/* @__PURE__ */ e(
|
|
783
855
|
"input",
|
|
784
856
|
{
|
|
785
|
-
ref:
|
|
857
|
+
ref: n,
|
|
786
858
|
type: "file",
|
|
787
859
|
accept: "image/*",
|
|
788
860
|
className: "hidden",
|
|
789
|
-
onChange:
|
|
861
|
+
onChange: k
|
|
790
862
|
}
|
|
791
863
|
),
|
|
792
|
-
/* @__PURE__ */
|
|
793
|
-
/* @__PURE__ */
|
|
864
|
+
/* @__PURE__ */ c("div", { className: "px-4 py-3", children: [
|
|
865
|
+
/* @__PURE__ */ c("div", { className: "flex items-center gap-2 mb-2", children: [
|
|
794
866
|
/* @__PURE__ */ e("div", { className: "w-3 h-3 rounded-full bg-amber-500" }),
|
|
795
867
|
/* @__PURE__ */ e("span", { className: "font-semibold text-sm text-amber-700 dark:text-amber-400", children: "Input" }),
|
|
796
|
-
/* @__PURE__ */ e(H, { nodeId:
|
|
868
|
+
/* @__PURE__ */ e(H, { nodeId: i, color: "text-amber-500 dark:text-amber-400" })
|
|
797
869
|
] }),
|
|
798
870
|
/* @__PURE__ */ e("div", { className: "text-xs text-gray-500 dark:text-zinc-400 truncate", children: t.filename || "No image selected" })
|
|
799
871
|
] }),
|
|
800
|
-
/* @__PURE__ */ e(
|
|
872
|
+
/* @__PURE__ */ e(W, { type: "source", position: A.Right, className: "w-3 h-3 !bg-amber-500" })
|
|
801
873
|
]
|
|
802
874
|
}
|
|
803
875
|
);
|
|
804
|
-
}),
|
|
805
|
-
id:
|
|
876
|
+
}), qe = P(function({
|
|
877
|
+
id: i,
|
|
806
878
|
data: t,
|
|
807
|
-
selected:
|
|
879
|
+
selected: a
|
|
808
880
|
}) {
|
|
809
|
-
var
|
|
810
|
-
const
|
|
881
|
+
var n, u;
|
|
882
|
+
const s = x((l) => l.execution.nodeStatus[i]), d = x((l) => {
|
|
811
883
|
var p;
|
|
812
|
-
return (p =
|
|
813
|
-
}),
|
|
814
|
-
return /* @__PURE__ */
|
|
884
|
+
return (p = l.execution.dataOutputs) == null ? void 0 : p[i];
|
|
885
|
+
}), o = T(s) || (a ? "border-cyan-500" : "border-cyan-200");
|
|
886
|
+
return /* @__PURE__ */ c(
|
|
815
887
|
"div",
|
|
816
888
|
{
|
|
817
|
-
className: `rounded-lg border-2 bg-white dark:bg-zinc-800 shadow-md min-w-[180px] overflow-hidden ${
|
|
889
|
+
className: `rounded-lg border-2 bg-white dark:bg-zinc-800 shadow-md min-w-[180px] overflow-hidden ${o}`,
|
|
818
890
|
children: [
|
|
819
|
-
/* @__PURE__ */ e(
|
|
820
|
-
|
|
821
|
-
(
|
|
822
|
-
(((u =
|
|
891
|
+
/* @__PURE__ */ e(W, { type: "target", position: A.Left, className: "w-3 h-3 !bg-cyan-500" }),
|
|
892
|
+
d && /* @__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__ */ c("pre", { className: "text-xs text-cyan-800 dark:text-cyan-200 whitespace-pre-wrap", children: [
|
|
893
|
+
(n = d.content) == null ? void 0 : n.slice(0, 200),
|
|
894
|
+
(((u = d.content) == null ? void 0 : u.length) || 0) > 200 && "..."
|
|
823
895
|
] }) }),
|
|
824
|
-
/* @__PURE__ */
|
|
825
|
-
/* @__PURE__ */
|
|
826
|
-
/* @__PURE__ */
|
|
896
|
+
/* @__PURE__ */ c("div", { className: "px-4 py-3", children: [
|
|
897
|
+
/* @__PURE__ */ c("div", { className: "flex items-center gap-2 mb-2", children: [
|
|
898
|
+
/* @__PURE__ */ c("svg", { className: "w-3 h-3 text-cyan-500", fill: "currentColor", viewBox: "0 0 20 20", children: [
|
|
827
899
|
/* @__PURE__ */ e("path", { d: "M10 12a2 2 0 100-4 2 2 0 000 4z" }),
|
|
828
900
|
/* @__PURE__ */ e(
|
|
829
901
|
"path",
|
|
@@ -836,33 +908,33 @@ const Pe = T(function({
|
|
|
836
908
|
] }),
|
|
837
909
|
/* @__PURE__ */ e("span", { className: "font-semibold text-sm text-cyan-700 dark:text-cyan-400", children: t.providerName })
|
|
838
910
|
] }),
|
|
839
|
-
/* @__PURE__ */ e("div", { className: "text-xs text-gray-500 dark:text-zinc-400", children: t.params.prompt ? /* @__PURE__ */
|
|
911
|
+
/* @__PURE__ */ e("div", { className: "text-xs text-gray-500 dark:text-zinc-400", children: t.params.prompt ? /* @__PURE__ */ c("div", { className: "truncate", children: [
|
|
840
912
|
String(t.params.prompt).slice(0, 30),
|
|
841
913
|
"..."
|
|
842
914
|
] }) : null })
|
|
843
915
|
] }),
|
|
844
|
-
/* @__PURE__ */ e(
|
|
916
|
+
/* @__PURE__ */ e(W, { type: "source", position: A.Right, className: "w-3 h-3 !bg-cyan-500" })
|
|
845
917
|
]
|
|
846
918
|
}
|
|
847
919
|
);
|
|
848
|
-
}),
|
|
849
|
-
var
|
|
850
|
-
const
|
|
920
|
+
}), Ke = P(function({ id: i, data: t, selected: a }) {
|
|
921
|
+
var n, u;
|
|
922
|
+
const s = x((l) => l.execution.nodeStatus[i]), d = x((l) => {
|
|
851
923
|
var p;
|
|
852
|
-
return (p =
|
|
853
|
-
}),
|
|
854
|
-
return /* @__PURE__ */
|
|
924
|
+
return (p = l.execution.dataOutputs) == null ? void 0 : p[i];
|
|
925
|
+
}), o = T(s) || (a ? "border-pink-500" : "border-pink-200");
|
|
926
|
+
return /* @__PURE__ */ c(
|
|
855
927
|
"div",
|
|
856
928
|
{
|
|
857
|
-
className: `rounded-lg border-2 bg-white dark:bg-zinc-800 shadow-md min-w-[180px] overflow-hidden ${
|
|
929
|
+
className: `rounded-lg border-2 bg-white dark:bg-zinc-800 shadow-md min-w-[180px] overflow-hidden ${o}`,
|
|
858
930
|
children: [
|
|
859
|
-
/* @__PURE__ */ e(
|
|
860
|
-
|
|
861
|
-
(
|
|
862
|
-
(((u =
|
|
931
|
+
/* @__PURE__ */ e(W, { type: "target", position: A.Left, className: "w-3 h-3 !bg-pink-500" }),
|
|
932
|
+
d && /* @__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__ */ c("pre", { className: "text-xs text-pink-800 dark:text-pink-200 whitespace-pre-wrap", children: [
|
|
933
|
+
(n = d.content) == null ? void 0 : n.slice(0, 200),
|
|
934
|
+
(((u = d.content) == null ? void 0 : u.length) || 0) > 200 && "..."
|
|
863
935
|
] }) }),
|
|
864
|
-
/* @__PURE__ */
|
|
865
|
-
/* @__PURE__ */
|
|
936
|
+
/* @__PURE__ */ c("div", { className: "px-4 py-3", children: [
|
|
937
|
+
/* @__PURE__ */ c("div", { className: "flex items-center gap-2 mb-2", children: [
|
|
866
938
|
/* @__PURE__ */ e("svg", { className: "w-3 h-3 text-pink-500", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ e(
|
|
867
939
|
"path",
|
|
868
940
|
{
|
|
@@ -873,27 +945,27 @@ const Pe = T(function({
|
|
|
873
945
|
) }),
|
|
874
946
|
/* @__PURE__ */ e("span", { className: "font-semibold text-sm text-pink-700 dark:text-pink-400", children: t.providerName })
|
|
875
947
|
] }),
|
|
876
|
-
/* @__PURE__ */ e("div", { className: "text-xs text-gray-500 dark:text-zinc-400", children: t.params.prompt ? /* @__PURE__ */
|
|
948
|
+
/* @__PURE__ */ e("div", { className: "text-xs text-gray-500 dark:text-zinc-400", children: t.params.prompt ? /* @__PURE__ */ c("div", { className: "truncate", children: [
|
|
877
949
|
String(t.params.prompt).slice(0, 30),
|
|
878
950
|
"..."
|
|
879
951
|
] }) : null })
|
|
880
952
|
] }),
|
|
881
|
-
/* @__PURE__ */ e(
|
|
953
|
+
/* @__PURE__ */ e(W, { type: "source", position: A.Right, className: "w-3 h-3 !bg-pink-500" })
|
|
882
954
|
]
|
|
883
955
|
}
|
|
884
956
|
);
|
|
885
|
-
}),
|
|
886
|
-
generator:
|
|
887
|
-
transform:
|
|
888
|
-
save:
|
|
889
|
-
input:
|
|
890
|
-
vision:
|
|
891
|
-
text:
|
|
892
|
-
},
|
|
957
|
+
}), _e = {
|
|
958
|
+
generator: Re,
|
|
959
|
+
transform: Fe,
|
|
960
|
+
save: Ve,
|
|
961
|
+
input: Ge,
|
|
962
|
+
vision: qe,
|
|
963
|
+
text: Ke
|
|
964
|
+
}, He = {
|
|
893
965
|
type: "smoothstep",
|
|
894
966
|
animated: !1,
|
|
895
967
|
markerEnd: {
|
|
896
|
-
type:
|
|
968
|
+
type: ye.ArrowClosed,
|
|
897
969
|
color: "#64748b",
|
|
898
970
|
width: 20,
|
|
899
971
|
height: 20
|
|
@@ -903,51 +975,51 @@ const Pe = T(function({
|
|
|
903
975
|
strokeWidth: 2
|
|
904
976
|
}
|
|
905
977
|
};
|
|
906
|
-
function
|
|
907
|
-
const r =
|
|
908
|
-
(
|
|
909
|
-
const { source: b, target:
|
|
910
|
-
if (!b || !
|
|
911
|
-
const g = r.find((
|
|
912
|
-
return !(!g || !
|
|
978
|
+
function Qe() {
|
|
979
|
+
const r = x((f) => f.nodes), i = x((f) => f.edges), t = x((f) => f.setNodes), a = x((f) => f.setEdges), s = x((f) => f.addEdge), d = x((f) => f.setSelectedNode), m = C(
|
|
980
|
+
(f) => {
|
|
981
|
+
const { source: b, target: k } = f;
|
|
982
|
+
if (!b || !k) return !1;
|
|
983
|
+
const g = r.find((h) => h.id === b), v = r.find((h) => h.id === k);
|
|
984
|
+
return !(!g || !v || g.type === "save" || v.type === "generator" || v.type === "input" || i.find((h) => h.target === k) || b === k);
|
|
913
985
|
},
|
|
914
|
-
[r,
|
|
915
|
-
),
|
|
916
|
-
(
|
|
917
|
-
t(
|
|
986
|
+
[r, i]
|
|
987
|
+
), o = C(
|
|
988
|
+
(f) => {
|
|
989
|
+
t(we(f, r));
|
|
918
990
|
},
|
|
919
991
|
[r, t]
|
|
920
|
-
),
|
|
921
|
-
(
|
|
922
|
-
|
|
992
|
+
), n = C(
|
|
993
|
+
(f) => {
|
|
994
|
+
a(ve(f, i));
|
|
923
995
|
},
|
|
924
|
-
[
|
|
996
|
+
[i, a]
|
|
925
997
|
), u = C(
|
|
926
|
-
(
|
|
927
|
-
|
|
998
|
+
(f) => {
|
|
999
|
+
s(f);
|
|
928
1000
|
},
|
|
929
|
-
[
|
|
930
|
-
),
|
|
931
|
-
(
|
|
932
|
-
|
|
1001
|
+
[s]
|
|
1002
|
+
), l = C(
|
|
1003
|
+
(f, b) => {
|
|
1004
|
+
d(b.id);
|
|
933
1005
|
},
|
|
934
|
-
[
|
|
1006
|
+
[d]
|
|
935
1007
|
), p = C(() => {
|
|
936
|
-
|
|
937
|
-
}, [
|
|
938
|
-
return /* @__PURE__ */ e("div", { className: "h-full w-full", children: /* @__PURE__ */
|
|
939
|
-
|
|
1008
|
+
d(null);
|
|
1009
|
+
}, [d]);
|
|
1010
|
+
return /* @__PURE__ */ e("div", { className: "h-full w-full", children: /* @__PURE__ */ c(
|
|
1011
|
+
ke,
|
|
940
1012
|
{
|
|
941
1013
|
nodes: r,
|
|
942
|
-
edges:
|
|
943
|
-
onNodesChange:
|
|
944
|
-
onEdgesChange:
|
|
1014
|
+
edges: i,
|
|
1015
|
+
onNodesChange: o,
|
|
1016
|
+
onEdgesChange: n,
|
|
945
1017
|
onConnect: u,
|
|
946
|
-
onNodeClick:
|
|
1018
|
+
onNodeClick: l,
|
|
947
1019
|
onPaneClick: p,
|
|
948
|
-
nodeTypes:
|
|
949
|
-
defaultEdgeOptions:
|
|
950
|
-
isValidConnection:
|
|
1020
|
+
nodeTypes: _e,
|
|
1021
|
+
defaultEdgeOptions: He,
|
|
1022
|
+
isValidConnection: m,
|
|
951
1023
|
nodesDraggable: !0,
|
|
952
1024
|
nodesConnectable: !0,
|
|
953
1025
|
elementsSelectable: !0,
|
|
@@ -956,92 +1028,92 @@ function Ge() {
|
|
|
956
1028
|
snapToGrid: !0,
|
|
957
1029
|
snapGrid: [15, 15],
|
|
958
1030
|
children: [
|
|
959
|
-
/* @__PURE__ */ e(
|
|
960
|
-
/* @__PURE__ */ e(
|
|
961
|
-
/* @__PURE__ */ e(
|
|
1031
|
+
/* @__PURE__ */ e(Ne, {}),
|
|
1032
|
+
/* @__PURE__ */ e(ze, {}),
|
|
1033
|
+
/* @__PURE__ */ e(Ce, { nodeStrokeWidth: 3, zoomable: !0, pannable: !0 })
|
|
962
1034
|
]
|
|
963
1035
|
}
|
|
964
1036
|
) });
|
|
965
1037
|
}
|
|
966
|
-
function
|
|
967
|
-
const [
|
|
1038
|
+
function Je({ onSelect: r }) {
|
|
1039
|
+
const [i, t] = N([]), [a, s] = N(!0), [d, m] = N(null), o = async () => {
|
|
968
1040
|
try {
|
|
969
|
-
|
|
970
|
-
const
|
|
971
|
-
t(
|
|
972
|
-
} catch (
|
|
973
|
-
l
|
|
1041
|
+
s(!0);
|
|
1042
|
+
const l = await Pe();
|
|
1043
|
+
t(l), m(null);
|
|
1044
|
+
} catch (l) {
|
|
1045
|
+
m(l instanceof Error ? l.message : "Failed to load uploads");
|
|
974
1046
|
} finally {
|
|
975
|
-
|
|
1047
|
+
s(!1);
|
|
976
1048
|
}
|
|
977
1049
|
};
|
|
978
|
-
|
|
979
|
-
|
|
1050
|
+
M(() => {
|
|
1051
|
+
o();
|
|
980
1052
|
}, []);
|
|
981
|
-
const
|
|
1053
|
+
const n = async (l, p) => {
|
|
982
1054
|
if (p.stopPropagation(), !!confirm("Delete this upload?"))
|
|
983
1055
|
try {
|
|
984
|
-
await
|
|
985
|
-
} catch (
|
|
986
|
-
console.error("Failed to delete:",
|
|
1056
|
+
await Te(l), t((f) => f.filter((b) => b.id !== l));
|
|
1057
|
+
} catch (f) {
|
|
1058
|
+
console.error("Failed to delete:", f);
|
|
987
1059
|
}
|
|
988
|
-
}, u = (
|
|
989
|
-
return
|
|
990
|
-
|
|
1060
|
+
}, u = (l) => l < 1024 ? `${l} B` : l < 1024 * 1024 ? `${(l / 1024).toFixed(1)} KB` : `${(l / (1024 * 1024)).toFixed(1)} MB`;
|
|
1061
|
+
return a ? /* @__PURE__ */ e("div", { className: "p-4 text-center text-gray-500 dark:text-zinc-400", children: "Loading uploads..." }) : d ? /* @__PURE__ */ c("div", { className: "p-4 text-center text-red-500 dark:text-red-400", children: [
|
|
1062
|
+
d,
|
|
991
1063
|
/* @__PURE__ */ e(
|
|
992
1064
|
"button",
|
|
993
1065
|
{
|
|
994
|
-
onClick:
|
|
1066
|
+
onClick: o,
|
|
995
1067
|
className: "ml-2 text-teal-500 dark:text-teal-400 hover:underline",
|
|
996
1068
|
children: "Retry"
|
|
997
1069
|
}
|
|
998
1070
|
)
|
|
999
|
-
] }) :
|
|
1071
|
+
] }) : i.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: i.map((l) => /* @__PURE__ */ c(
|
|
1000
1072
|
"div",
|
|
1001
1073
|
{
|
|
1002
1074
|
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",
|
|
1003
|
-
onClick: () => r == null ? void 0 : r(
|
|
1075
|
+
onClick: () => r == null ? void 0 : r(l),
|
|
1004
1076
|
children: [
|
|
1005
1077
|
/* @__PURE__ */ e(
|
|
1006
1078
|
"img",
|
|
1007
1079
|
{
|
|
1008
|
-
src:
|
|
1009
|
-
alt:
|
|
1080
|
+
src: de(l.id),
|
|
1081
|
+
alt: l.filename,
|
|
1010
1082
|
className: "w-full h-20 object-cover"
|
|
1011
1083
|
}
|
|
1012
1084
|
),
|
|
1013
1085
|
/* @__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(
|
|
1014
1086
|
"button",
|
|
1015
1087
|
{
|
|
1016
|
-
onClick: (p) =>
|
|
1088
|
+
onClick: (p) => n(l.id, p),
|
|
1017
1089
|
className: "p-1 bg-red-500 rounded text-white text-xs hover:bg-red-600",
|
|
1018
1090
|
children: "Delete"
|
|
1019
1091
|
}
|
|
1020
1092
|
) }),
|
|
1021
|
-
/* @__PURE__ */ e("div", { className: "p-1 text-xs truncate bg-white dark:bg-zinc-800 text-gray-800 dark:text-zinc-200", children:
|
|
1022
|
-
/* @__PURE__ */ e("div", { className: "px-1 pb-1 text-xs text-gray-400 dark:text-zinc-500 bg-white dark:bg-zinc-800", children: u(
|
|
1093
|
+
/* @__PURE__ */ e("div", { className: "p-1 text-xs truncate bg-white dark:bg-zinc-800 text-gray-800 dark:text-zinc-200", children: l.filename }),
|
|
1094
|
+
/* @__PURE__ */ e("div", { className: "px-1 pb-1 text-xs text-gray-400 dark:text-zinc-500 bg-white dark:bg-zinc-800", children: u(l.size) })
|
|
1023
1095
|
]
|
|
1024
1096
|
},
|
|
1025
|
-
|
|
1097
|
+
l.id
|
|
1026
1098
|
)) }) });
|
|
1027
1099
|
}
|
|
1028
|
-
function
|
|
1029
|
-
const r =
|
|
1100
|
+
function Ye() {
|
|
1101
|
+
const r = x((g) => g.setGenerators), i = x((g) => g.setTransforms), t = x((g) => g.generators), a = x((g) => g.transforms), s = x((g) => g.addNode), [d, m] = N(!1), { data: o } = K({
|
|
1030
1102
|
queryKey: ["generators"],
|
|
1031
|
-
queryFn:
|
|
1032
|
-
}), { data:
|
|
1103
|
+
queryFn: We
|
|
1104
|
+
}), { data: n } = K({
|
|
1033
1105
|
queryKey: ["transforms"],
|
|
1034
|
-
queryFn:
|
|
1106
|
+
queryFn: Ae
|
|
1035
1107
|
});
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
}, [
|
|
1039
|
-
|
|
1040
|
-
}, [
|
|
1041
|
-
const u = (g,
|
|
1042
|
-
g.dataTransfer.setData("application/json", JSON.stringify(
|
|
1043
|
-
},
|
|
1044
|
-
|
|
1108
|
+
M(() => {
|
|
1109
|
+
o && r(o);
|
|
1110
|
+
}, [o, r]), M(() => {
|
|
1111
|
+
n && i(n);
|
|
1112
|
+
}, [n, i]);
|
|
1113
|
+
const u = (g, v) => {
|
|
1114
|
+
g.dataTransfer.setData("application/json", JSON.stringify(v)), g.dataTransfer.effectAllowed = "move";
|
|
1115
|
+
}, l = (g) => {
|
|
1116
|
+
s(g, { x: 250, y: 150 + Math.random() * 100 });
|
|
1045
1117
|
}, p = {
|
|
1046
1118
|
id: "input:upload",
|
|
1047
1119
|
type: "input",
|
|
@@ -1053,7 +1125,7 @@ function Ve() {
|
|
|
1053
1125
|
type: "object",
|
|
1054
1126
|
properties: {}
|
|
1055
1127
|
}
|
|
1056
|
-
},
|
|
1128
|
+
}, f = {
|
|
1057
1129
|
id: "save:filesystem",
|
|
1058
1130
|
type: "save",
|
|
1059
1131
|
name: "save",
|
|
@@ -1067,45 +1139,49 @@ function Ve() {
|
|
|
1067
1139
|
type: "string",
|
|
1068
1140
|
title: "Destination",
|
|
1069
1141
|
default: "./output/image.png"
|
|
1142
|
+
},
|
|
1143
|
+
provider: {
|
|
1144
|
+
type: "string",
|
|
1145
|
+
default: "filesystem"
|
|
1070
1146
|
}
|
|
1071
1147
|
}
|
|
1072
1148
|
}
|
|
1073
1149
|
}, b = t.reduce(
|
|
1074
|
-
(g,
|
|
1075
|
-
const
|
|
1076
|
-
return g[
|
|
1150
|
+
(g, v) => {
|
|
1151
|
+
const w = v.category || "Other";
|
|
1152
|
+
return g[w] || (g[w] = []), g[w].push(v), g;
|
|
1077
1153
|
},
|
|
1078
1154
|
{}
|
|
1079
|
-
),
|
|
1080
|
-
(g,
|
|
1081
|
-
const
|
|
1082
|
-
return g[
|
|
1155
|
+
), k = a.reduce(
|
|
1156
|
+
(g, v) => {
|
|
1157
|
+
const w = v.category || "Other";
|
|
1158
|
+
return g[w] || (g[w] = []), g[w].push(v), g;
|
|
1083
1159
|
},
|
|
1084
1160
|
{}
|
|
1085
1161
|
);
|
|
1086
|
-
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__ */
|
|
1162
|
+
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__ */ c("div", { className: "p-4", children: [
|
|
1087
1163
|
/* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-gray-800 dark:text-white mb-4", children: "Nodes" }),
|
|
1088
|
-
/* @__PURE__ */
|
|
1089
|
-
/* @__PURE__ */
|
|
1164
|
+
/* @__PURE__ */ c("div", { className: "mb-6", children: [
|
|
1165
|
+
/* @__PURE__ */ c("div", { className: "flex items-center justify-between mb-2", children: [
|
|
1090
1166
|
/* @__PURE__ */ e("h3", { className: "text-sm font-medium text-amber-600 dark:text-amber-400 uppercase tracking-wide", children: "Input" }),
|
|
1091
|
-
/* @__PURE__ */
|
|
1167
|
+
/* @__PURE__ */ c(
|
|
1092
1168
|
"button",
|
|
1093
1169
|
{
|
|
1094
|
-
onClick: () =>
|
|
1170
|
+
onClick: () => m(!d),
|
|
1095
1171
|
className: "text-xs text-amber-600 dark:text-amber-400 hover:text-amber-700 dark:hover:text-amber-300",
|
|
1096
1172
|
children: [
|
|
1097
|
-
|
|
1173
|
+
d ? "Hide" : "Browse",
|
|
1098
1174
|
" Uploads"
|
|
1099
1175
|
]
|
|
1100
1176
|
}
|
|
1101
1177
|
)
|
|
1102
1178
|
] }),
|
|
1103
|
-
/* @__PURE__ */
|
|
1179
|
+
/* @__PURE__ */ c(
|
|
1104
1180
|
"div",
|
|
1105
1181
|
{
|
|
1106
1182
|
draggable: !0,
|
|
1107
1183
|
onDragStart: (g) => u(g, p),
|
|
1108
|
-
onDoubleClick: () =>
|
|
1184
|
+
onDoubleClick: () => l(p),
|
|
1109
1185
|
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",
|
|
1110
1186
|
children: [
|
|
1111
1187
|
/* @__PURE__ */ e("div", { className: "text-sm font-medium text-amber-700 dark:text-amber-300", children: "Upload Image" }),
|
|
@@ -1113,56 +1189,56 @@ function Ve() {
|
|
|
1113
1189
|
]
|
|
1114
1190
|
}
|
|
1115
1191
|
),
|
|
1116
|
-
|
|
1192
|
+
d && /* @__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(Je, {}) })
|
|
1117
1193
|
] }),
|
|
1118
|
-
/* @__PURE__ */
|
|
1194
|
+
/* @__PURE__ */ c("div", { className: "mb-6", children: [
|
|
1119
1195
|
/* @__PURE__ */ e("h3", { className: "text-sm font-medium text-blue-600 dark:text-blue-400 uppercase tracking-wide mb-2", children: "Generators" }),
|
|
1120
|
-
Object.entries(b).map(([g,
|
|
1196
|
+
Object.entries(b).map(([g, v]) => /* @__PURE__ */ c("div", { className: "mb-3", children: [
|
|
1121
1197
|
/* @__PURE__ */ e("div", { className: "text-xs text-gray-500 dark:text-zinc-400 mb-1", children: g }),
|
|
1122
|
-
|
|
1198
|
+
v.map((w) => /* @__PURE__ */ c(
|
|
1123
1199
|
"div",
|
|
1124
1200
|
{
|
|
1125
1201
|
draggable: !0,
|
|
1126
|
-
onDragStart: (
|
|
1127
|
-
onDoubleClick: () =>
|
|
1202
|
+
onDragStart: (h) => u(h, w),
|
|
1203
|
+
onDoubleClick: () => l(w),
|
|
1128
1204
|
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",
|
|
1129
1205
|
children: [
|
|
1130
|
-
/* @__PURE__ */ e("div", { className: "text-sm font-medium text-blue-700 dark:text-blue-300", children:
|
|
1131
|
-
|
|
1206
|
+
/* @__PURE__ */ e("div", { className: "text-sm font-medium text-blue-700 dark:text-blue-300", children: w.label }),
|
|
1207
|
+
w.description && /* @__PURE__ */ e("div", { className: "text-xs text-gray-500 dark:text-zinc-400 truncate", children: w.description })
|
|
1132
1208
|
]
|
|
1133
1209
|
},
|
|
1134
|
-
|
|
1210
|
+
w.id
|
|
1135
1211
|
))
|
|
1136
1212
|
] }, g))
|
|
1137
1213
|
] }),
|
|
1138
|
-
/* @__PURE__ */
|
|
1214
|
+
/* @__PURE__ */ c("div", { className: "mb-6", children: [
|
|
1139
1215
|
/* @__PURE__ */ e("h3", { className: "text-sm font-medium text-teal-600 dark:text-teal-400 uppercase tracking-wide mb-2", children: "Transforms" }),
|
|
1140
|
-
Object.entries(
|
|
1216
|
+
Object.entries(k).map(([g, v]) => /* @__PURE__ */ c("div", { className: "mb-3", children: [
|
|
1141
1217
|
/* @__PURE__ */ e("div", { className: "text-xs text-gray-500 dark:text-zinc-400 mb-1", children: g }),
|
|
1142
|
-
|
|
1218
|
+
v.map((w) => /* @__PURE__ */ c(
|
|
1143
1219
|
"div",
|
|
1144
1220
|
{
|
|
1145
1221
|
draggable: !0,
|
|
1146
|
-
onDragStart: (
|
|
1147
|
-
onDoubleClick: () =>
|
|
1222
|
+
onDragStart: (h) => u(h, w),
|
|
1223
|
+
onDoubleClick: () => l(w),
|
|
1148
1224
|
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",
|
|
1149
1225
|
children: [
|
|
1150
|
-
/* @__PURE__ */ e("div", { className: "text-sm font-medium text-teal-700 dark:text-teal-300", children:
|
|
1151
|
-
|
|
1226
|
+
/* @__PURE__ */ e("div", { className: "text-sm font-medium text-teal-700 dark:text-teal-300", children: w.label }),
|
|
1227
|
+
w.description && /* @__PURE__ */ e("div", { className: "text-xs text-gray-500 dark:text-zinc-400 truncate", children: w.description })
|
|
1152
1228
|
]
|
|
1153
1229
|
},
|
|
1154
|
-
|
|
1230
|
+
w.id
|
|
1155
1231
|
))
|
|
1156
1232
|
] }, g))
|
|
1157
1233
|
] }),
|
|
1158
|
-
/* @__PURE__ */
|
|
1234
|
+
/* @__PURE__ */ c("div", { className: "mb-6", children: [
|
|
1159
1235
|
/* @__PURE__ */ e("h3", { className: "text-sm font-medium text-green-600 dark:text-green-400 uppercase tracking-wide mb-2", children: "Output" }),
|
|
1160
|
-
/* @__PURE__ */
|
|
1236
|
+
/* @__PURE__ */ c(
|
|
1161
1237
|
"div",
|
|
1162
1238
|
{
|
|
1163
1239
|
draggable: !0,
|
|
1164
|
-
onDragStart: (g) => u(g,
|
|
1165
|
-
onDoubleClick: () =>
|
|
1240
|
+
onDragStart: (g) => u(g, f),
|
|
1241
|
+
onDoubleClick: () => l(f),
|
|
1166
1242
|
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",
|
|
1167
1243
|
children: [
|
|
1168
1244
|
/* @__PURE__ */ e("div", { className: "text-sm font-medium text-green-700 dark:text-green-300", children: "Save" }),
|
|
@@ -1173,120 +1249,120 @@ function Ve() {
|
|
|
1173
1249
|
] })
|
|
1174
1250
|
] }) });
|
|
1175
1251
|
}
|
|
1176
|
-
function
|
|
1177
|
-
var p,
|
|
1178
|
-
const r =
|
|
1179
|
-
if (!
|
|
1252
|
+
function Xe() {
|
|
1253
|
+
var p, f;
|
|
1254
|
+
const r = x((b) => b.selectedNodeId), i = x((b) => b.nodes), t = x((b) => b.generators), a = x((b) => b.transforms), s = x((b) => b.updateNodeData), d = x((b) => b.deleteNode), m = i.find((b) => b.id === r);
|
|
1255
|
+
if (!m)
|
|
1180
1256
|
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" }) });
|
|
1181
|
-
let
|
|
1182
|
-
if (
|
|
1183
|
-
const b =
|
|
1184
|
-
|
|
1185
|
-
} else if (
|
|
1186
|
-
const b =
|
|
1187
|
-
|
|
1188
|
-
} else
|
|
1257
|
+
let o, n = "";
|
|
1258
|
+
if (m.type === "generator") {
|
|
1259
|
+
const b = m.data, k = t.find((g) => g.name === b.generatorName);
|
|
1260
|
+
o = (p = k == null ? void 0 : k.params) == null ? void 0 : p.properties, n = (k == null ? void 0 : k.label) || b.generatorName;
|
|
1261
|
+
} else if (m.type === "transform") {
|
|
1262
|
+
const b = m.data, k = a.find((g) => g.name === b.operation);
|
|
1263
|
+
o = (f = k == null ? void 0 : k.params) == null ? void 0 : f.properties, n = (k == null ? void 0 : k.label) || b.operation;
|
|
1264
|
+
} else m.type === "save" && (n = "Save", o = {
|
|
1189
1265
|
destination: {
|
|
1190
1266
|
type: "string",
|
|
1191
1267
|
title: "Destination",
|
|
1192
1268
|
description: "File path to save the image"
|
|
1193
1269
|
}
|
|
1194
1270
|
});
|
|
1195
|
-
const u = (b,
|
|
1196
|
-
if (
|
|
1197
|
-
const g =
|
|
1198
|
-
|
|
1199
|
-
params: { ...g.params, [b]:
|
|
1271
|
+
const u = (b, k) => {
|
|
1272
|
+
if (m.type === "generator") {
|
|
1273
|
+
const g = m.data;
|
|
1274
|
+
s(m.id, {
|
|
1275
|
+
params: { ...g.params, [b]: k }
|
|
1200
1276
|
});
|
|
1201
|
-
} else if (
|
|
1202
|
-
const g =
|
|
1203
|
-
|
|
1204
|
-
params: { ...g.params, [b]:
|
|
1277
|
+
} else if (m.type === "transform") {
|
|
1278
|
+
const g = m.data;
|
|
1279
|
+
s(m.id, {
|
|
1280
|
+
params: { ...g.params, [b]: k }
|
|
1205
1281
|
});
|
|
1206
|
-
} else
|
|
1207
|
-
},
|
|
1208
|
-
if (
|
|
1209
|
-
return
|
|
1210
|
-
if (
|
|
1211
|
-
return
|
|
1212
|
-
if (
|
|
1213
|
-
return
|
|
1282
|
+
} else m.type === "save" && s(m.id, { [b]: k });
|
|
1283
|
+
}, l = (b) => {
|
|
1284
|
+
if (m.type === "generator")
|
|
1285
|
+
return m.data.params[b];
|
|
1286
|
+
if (m.type === "transform")
|
|
1287
|
+
return m.data.params[b];
|
|
1288
|
+
if (m.type === "save")
|
|
1289
|
+
return m.data[b];
|
|
1214
1290
|
};
|
|
1215
|
-
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__ */
|
|
1216
|
-
/* @__PURE__ */
|
|
1217
|
-
/* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-gray-800 dark:text-white", children:
|
|
1291
|
+
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__ */ c("div", { className: "p-4", children: [
|
|
1292
|
+
/* @__PURE__ */ c("div", { className: "flex items-center justify-between mb-4", children: [
|
|
1293
|
+
/* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-gray-800 dark:text-white", children: n }),
|
|
1218
1294
|
/* @__PURE__ */ e(
|
|
1219
1295
|
"button",
|
|
1220
1296
|
{
|
|
1221
|
-
onClick: () =>
|
|
1297
|
+
onClick: () => d(m.id),
|
|
1222
1298
|
className: "text-red-500 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300 text-sm",
|
|
1223
1299
|
children: "Delete"
|
|
1224
1300
|
}
|
|
1225
1301
|
)
|
|
1226
1302
|
] }),
|
|
1227
|
-
/* @__PURE__ */ e("div", { className: "space-y-4", children:
|
|
1228
|
-
|
|
1303
|
+
/* @__PURE__ */ e("div", { className: "space-y-4", children: o && Object.entries(o).map(([b, k]) => /* @__PURE__ */ e(
|
|
1304
|
+
Ze,
|
|
1229
1305
|
{
|
|
1230
1306
|
name: b,
|
|
1231
|
-
field:
|
|
1232
|
-
value:
|
|
1307
|
+
field: k,
|
|
1308
|
+
value: l(b),
|
|
1233
1309
|
onChange: (g) => u(b, g)
|
|
1234
1310
|
},
|
|
1235
1311
|
b
|
|
1236
1312
|
)) })
|
|
1237
1313
|
] }) });
|
|
1238
1314
|
}
|
|
1239
|
-
function
|
|
1240
|
-
const
|
|
1241
|
-
return
|
|
1242
|
-
/* @__PURE__ */ e("label", { className: "block text-sm font-medium text-gray-700 dark:text-zinc-300 mb-1", children:
|
|
1243
|
-
/* @__PURE__ */
|
|
1315
|
+
function Ze({ name: r, field: i, value: t, onChange: a }) {
|
|
1316
|
+
const s = i.title || r, d = "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";
|
|
1317
|
+
return i.enum ? /* @__PURE__ */ c("div", { children: [
|
|
1318
|
+
/* @__PURE__ */ e("label", { className: "block text-sm font-medium text-gray-700 dark:text-zinc-300 mb-1", children: s }),
|
|
1319
|
+
/* @__PURE__ */ c(
|
|
1244
1320
|
"select",
|
|
1245
1321
|
{
|
|
1246
1322
|
value: String(t || ""),
|
|
1247
|
-
onChange: (
|
|
1248
|
-
className:
|
|
1323
|
+
onChange: (m) => a(m.target.value),
|
|
1324
|
+
className: d,
|
|
1249
1325
|
children: [
|
|
1250
1326
|
/* @__PURE__ */ e("option", { value: "", children: "Select..." }),
|
|
1251
|
-
|
|
1327
|
+
i.enum.map((m) => /* @__PURE__ */ e("option", { value: m, children: m }, m))
|
|
1252
1328
|
]
|
|
1253
1329
|
}
|
|
1254
1330
|
),
|
|
1255
|
-
|
|
1256
|
-
] }) :
|
|
1257
|
-
/* @__PURE__ */ e("label", { className: "block text-sm font-medium text-gray-700 dark:text-zinc-300 mb-1", children:
|
|
1331
|
+
i.description && /* @__PURE__ */ e("p", { className: "mt-1 text-xs text-gray-500 dark:text-zinc-400", children: i.description })
|
|
1332
|
+
] }) : i.type === "number" ? /* @__PURE__ */ c("div", { children: [
|
|
1333
|
+
/* @__PURE__ */ e("label", { className: "block text-sm font-medium text-gray-700 dark:text-zinc-300 mb-1", children: s }),
|
|
1258
1334
|
/* @__PURE__ */ e(
|
|
1259
1335
|
"input",
|
|
1260
1336
|
{
|
|
1261
1337
|
type: "number",
|
|
1262
1338
|
value: t !== void 0 ? Number(t) : "",
|
|
1263
|
-
onChange: (
|
|
1264
|
-
min:
|
|
1265
|
-
max:
|
|
1266
|
-
className:
|
|
1339
|
+
onChange: (m) => a(Number(m.target.value)),
|
|
1340
|
+
min: i.minimum,
|
|
1341
|
+
max: i.maximum,
|
|
1342
|
+
className: d
|
|
1267
1343
|
}
|
|
1268
1344
|
),
|
|
1269
|
-
|
|
1270
|
-
] }) :
|
|
1345
|
+
i.description && /* @__PURE__ */ e("p", { className: "mt-1 text-xs text-gray-500 dark:text-zinc-400", children: i.description })
|
|
1346
|
+
] }) : i.type === "boolean" ? /* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
|
|
1271
1347
|
/* @__PURE__ */ e(
|
|
1272
1348
|
"input",
|
|
1273
1349
|
{
|
|
1274
1350
|
type: "checkbox",
|
|
1275
1351
|
checked: !!t,
|
|
1276
|
-
onChange: (
|
|
1352
|
+
onChange: (m) => a(m.target.checked),
|
|
1277
1353
|
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"
|
|
1278
1354
|
}
|
|
1279
1355
|
),
|
|
1280
|
-
/* @__PURE__ */ e("label", { className: "text-sm font-medium text-gray-700 dark:text-zinc-300", children:
|
|
1281
|
-
] }) : r.toLowerCase().includes("color") && typeof t == "string" && t.startsWith("#") ? /* @__PURE__ */
|
|
1282
|
-
/* @__PURE__ */ e("label", { className: "block text-sm font-medium text-gray-700 dark:text-zinc-300 mb-1", children:
|
|
1283
|
-
/* @__PURE__ */
|
|
1356
|
+
/* @__PURE__ */ e("label", { className: "text-sm font-medium text-gray-700 dark:text-zinc-300", children: s })
|
|
1357
|
+
] }) : r.toLowerCase().includes("color") && typeof t == "string" && t.startsWith("#") ? /* @__PURE__ */ c("div", { children: [
|
|
1358
|
+
/* @__PURE__ */ e("label", { className: "block text-sm font-medium text-gray-700 dark:text-zinc-300 mb-1", children: s }),
|
|
1359
|
+
/* @__PURE__ */ c("div", { className: "flex gap-2", children: [
|
|
1284
1360
|
/* @__PURE__ */ e(
|
|
1285
1361
|
"input",
|
|
1286
1362
|
{
|
|
1287
1363
|
type: "color",
|
|
1288
1364
|
value: String(t || "#000000"),
|
|
1289
|
-
onChange: (
|
|
1365
|
+
onChange: (m) => a(m.target.value),
|
|
1290
1366
|
className: "h-10 w-14 p-1 border border-gray-300 dark:border-zinc-600 rounded"
|
|
1291
1367
|
}
|
|
1292
1368
|
),
|
|
@@ -1295,142 +1371,142 @@ function qe({ name: r, field: s, value: t, onChange: o }) {
|
|
|
1295
1371
|
{
|
|
1296
1372
|
type: "text",
|
|
1297
1373
|
value: String(t || ""),
|
|
1298
|
-
onChange: (
|
|
1299
|
-
className:
|
|
1374
|
+
onChange: (m) => a(m.target.value),
|
|
1375
|
+
className: d + " flex-1"
|
|
1300
1376
|
}
|
|
1301
1377
|
)
|
|
1302
1378
|
] })
|
|
1303
|
-
] }) :
|
|
1304
|
-
/* @__PURE__ */ e("label", { className: "block text-sm font-medium text-gray-700 dark:text-zinc-300 mb-1", children:
|
|
1379
|
+
] }) : i.type === "object" ? /* @__PURE__ */ c("div", { children: [
|
|
1380
|
+
/* @__PURE__ */ e("label", { className: "block text-sm font-medium text-gray-700 dark:text-zinc-300 mb-1", children: s }),
|
|
1305
1381
|
/* @__PURE__ */ e(
|
|
1306
1382
|
"textarea",
|
|
1307
1383
|
{
|
|
1308
1384
|
value: t ? JSON.stringify(t, null, 2) : "{}",
|
|
1309
|
-
onChange: (
|
|
1385
|
+
onChange: (m) => {
|
|
1310
1386
|
try {
|
|
1311
|
-
|
|
1387
|
+
a(JSON.parse(m.target.value));
|
|
1312
1388
|
} catch {
|
|
1313
1389
|
}
|
|
1314
1390
|
},
|
|
1315
1391
|
rows: 4,
|
|
1316
|
-
className:
|
|
1392
|
+
className: d + " font-mono text-xs"
|
|
1317
1393
|
}
|
|
1318
1394
|
),
|
|
1319
|
-
|
|
1320
|
-
] }) : /* @__PURE__ */
|
|
1321
|
-
/* @__PURE__ */ e("label", { className: "block text-sm font-medium text-gray-700 dark:text-zinc-300 mb-1", children:
|
|
1395
|
+
i.description && /* @__PURE__ */ e("p", { className: "mt-1 text-xs text-gray-500 dark:text-zinc-400", children: i.description })
|
|
1396
|
+
] }) : /* @__PURE__ */ c("div", { children: [
|
|
1397
|
+
/* @__PURE__ */ e("label", { className: "block text-sm font-medium text-gray-700 dark:text-zinc-300 mb-1", children: s }),
|
|
1322
1398
|
r === "prompt" || r === "code" || r === "text" ? /* @__PURE__ */ e(
|
|
1323
1399
|
"textarea",
|
|
1324
1400
|
{
|
|
1325
1401
|
value: String(t || ""),
|
|
1326
|
-
onChange: (
|
|
1402
|
+
onChange: (m) => a(m.target.value),
|
|
1327
1403
|
rows: 3,
|
|
1328
|
-
className:
|
|
1404
|
+
className: d
|
|
1329
1405
|
}
|
|
1330
1406
|
) : /* @__PURE__ */ e(
|
|
1331
1407
|
"input",
|
|
1332
1408
|
{
|
|
1333
1409
|
type: "text",
|
|
1334
1410
|
value: String(t || ""),
|
|
1335
|
-
onChange: (
|
|
1336
|
-
className:
|
|
1411
|
+
onChange: (m) => a(m.target.value),
|
|
1412
|
+
className: d
|
|
1337
1413
|
}
|
|
1338
1414
|
),
|
|
1339
|
-
|
|
1415
|
+
i.description && /* @__PURE__ */ e("p", { className: "mt-1 text-xs text-gray-500 dark:text-zinc-400", children: i.description })
|
|
1340
1416
|
] });
|
|
1341
1417
|
}
|
|
1342
|
-
function
|
|
1343
|
-
const t = new Map(r.map((
|
|
1344
|
-
for (const
|
|
1345
|
-
|
|
1346
|
-
for (const
|
|
1347
|
-
const
|
|
1348
|
-
|
|
1418
|
+
function et(r, i) {
|
|
1419
|
+
const t = new Map(r.map((o) => [o.id, o])), a = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map();
|
|
1420
|
+
for (const o of r)
|
|
1421
|
+
a.set(o.id, 0), s.set(o.id, []);
|
|
1422
|
+
for (const o of i) {
|
|
1423
|
+
const n = s.get(o.source) || [];
|
|
1424
|
+
n.push(o.target), s.set(o.source, n), a.set(o.target, (a.get(o.target) || 0) + 1);
|
|
1349
1425
|
}
|
|
1350
|
-
const
|
|
1351
|
-
for (const [
|
|
1352
|
-
|
|
1353
|
-
const
|
|
1354
|
-
for (;
|
|
1355
|
-
const
|
|
1356
|
-
|
|
1357
|
-
const u =
|
|
1358
|
-
for (const
|
|
1359
|
-
const p = (
|
|
1360
|
-
|
|
1426
|
+
const d = [];
|
|
1427
|
+
for (const [o, n] of a)
|
|
1428
|
+
n === 0 && d.push(o);
|
|
1429
|
+
const m = [];
|
|
1430
|
+
for (; d.length > 0; ) {
|
|
1431
|
+
const o = d.shift(), n = t.get(o);
|
|
1432
|
+
n && m.push(n);
|
|
1433
|
+
const u = s.get(o) || [];
|
|
1434
|
+
for (const l of u) {
|
|
1435
|
+
const p = (a.get(l) || 1) - 1;
|
|
1436
|
+
a.set(l, p), p === 0 && d.push(l);
|
|
1361
1437
|
}
|
|
1362
1438
|
}
|
|
1363
|
-
return
|
|
1439
|
+
return m;
|
|
1364
1440
|
}
|
|
1365
|
-
function
|
|
1366
|
-
const
|
|
1367
|
-
return `${
|
|
1441
|
+
function tt(r) {
|
|
1442
|
+
const i = r.type || "node", t = r.id.replace(/[^a-zA-Z0-9]/g, "_");
|
|
1443
|
+
return `${i}_${t}`;
|
|
1368
1444
|
}
|
|
1369
|
-
function
|
|
1445
|
+
function E(r) {
|
|
1370
1446
|
return typeof r == "string" ? r.includes(`
|
|
1371
1447
|
`) ? "`" + r.replace(/`/g, "\\`").replace(/\$/g, "\\$") + "`" : JSON.stringify(r) : JSON.stringify(r, null, 2);
|
|
1372
1448
|
}
|
|
1373
|
-
function
|
|
1374
|
-
const
|
|
1449
|
+
function rt(r, i, t) {
|
|
1450
|
+
const a = t.get(r.id), s = [], d = i.find((o) => o.target === r.id), m = d ? t.get(d.source) : null;
|
|
1375
1451
|
switch (r.type) {
|
|
1376
1452
|
case "generator": {
|
|
1377
|
-
const
|
|
1378
|
-
|
|
1379
|
-
const
|
|
1453
|
+
const o = r.data;
|
|
1454
|
+
s.push(o.generatorName);
|
|
1455
|
+
const n = o.params || {}, u = Object.entries(n).filter(([, l]) => l !== void 0 && l !== "").map(([l, p]) => ` ${l}: ${E(p)}`).join(`,
|
|
1380
1456
|
`);
|
|
1381
1457
|
return {
|
|
1382
|
-
code: `// Generate image using ${
|
|
1383
|
-
const ${
|
|
1458
|
+
code: `// Generate image using ${o.generatorName}
|
|
1459
|
+
const ${a} = await ${o.generatorName}({
|
|
1384
1460
|
${u}
|
|
1385
1461
|
});`,
|
|
1386
|
-
imports:
|
|
1462
|
+
imports: s
|
|
1387
1463
|
};
|
|
1388
1464
|
}
|
|
1389
1465
|
case "input":
|
|
1390
1466
|
return {
|
|
1391
1467
|
code: `// Load input image
|
|
1392
|
-
const ${
|
|
1468
|
+
const ${a} = await flo.loadImage("./input.png");`,
|
|
1393
1469
|
imports: []
|
|
1394
1470
|
};
|
|
1395
1471
|
case "transform": {
|
|
1396
|
-
const
|
|
1472
|
+
const o = r.data, n = o.params || {}, u = Object.entries(n).filter(([, p]) => p !== void 0 && p !== "").map(([p, f]) => `${p}: ${E(f)}`).join(", "), l = m || "image";
|
|
1397
1473
|
return {
|
|
1398
|
-
code: `// Apply ${
|
|
1399
|
-
const ${
|
|
1474
|
+
code: `// Apply ${o.operation} transform
|
|
1475
|
+
const ${a} = await flo.transform(${l}, "${o.operation}"${u ? `, { ${u} }` : ""});`,
|
|
1400
1476
|
imports: []
|
|
1401
1477
|
};
|
|
1402
1478
|
}
|
|
1403
1479
|
case "vision": {
|
|
1404
|
-
const
|
|
1405
|
-
|
|
1406
|
-
const
|
|
1480
|
+
const o = r.data;
|
|
1481
|
+
s.push(o.providerName);
|
|
1482
|
+
const n = o.params || {}, u = m || "image", l = Object.entries(n).filter(([, p]) => p !== void 0 && p !== "").map(([p, f]) => ` ${p}: ${E(f)}`).join(`,
|
|
1407
1483
|
`);
|
|
1408
1484
|
return {
|
|
1409
|
-
code: `// Analyze image with ${
|
|
1410
|
-
const ${
|
|
1411
|
-
${
|
|
1485
|
+
code: `// Analyze image with ${o.providerName}
|
|
1486
|
+
const ${a} = await ${o.providerName}.analyze(${u}, {
|
|
1487
|
+
${l}
|
|
1412
1488
|
});`,
|
|
1413
|
-
imports:
|
|
1489
|
+
imports: s
|
|
1414
1490
|
};
|
|
1415
1491
|
}
|
|
1416
1492
|
case "text": {
|
|
1417
|
-
const
|
|
1418
|
-
|
|
1419
|
-
const
|
|
1493
|
+
const o = r.data;
|
|
1494
|
+
s.push(o.providerName);
|
|
1495
|
+
const n = o.params || {}, u = Object.entries(n).filter(([, l]) => l !== void 0 && l !== "").map(([l, p]) => ` ${l}: ${E(p)}`).join(`,
|
|
1420
1496
|
`);
|
|
1421
1497
|
return {
|
|
1422
|
-
code: `// Generate text with ${
|
|
1423
|
-
const ${
|
|
1498
|
+
code: `// Generate text with ${o.providerName}
|
|
1499
|
+
const ${a} = await ${o.providerName}.generate({
|
|
1424
1500
|
${u}
|
|
1425
1501
|
});`,
|
|
1426
|
-
imports:
|
|
1502
|
+
imports: s
|
|
1427
1503
|
};
|
|
1428
1504
|
}
|
|
1429
1505
|
case "save": {
|
|
1430
|
-
const
|
|
1506
|
+
const o = r.data;
|
|
1431
1507
|
return {
|
|
1432
1508
|
code: `// Save result
|
|
1433
|
-
await flo.save(${
|
|
1509
|
+
await flo.save(${m || "result"}, ${E(o.destination)});`,
|
|
1434
1510
|
imports: []
|
|
1435
1511
|
};
|
|
1436
1512
|
}
|
|
@@ -1441,33 +1517,33 @@ await flo.save(${l || "result"}, ${U(a.destination)});`,
|
|
|
1441
1517
|
};
|
|
1442
1518
|
}
|
|
1443
1519
|
}
|
|
1444
|
-
function
|
|
1520
|
+
function at(r, i) {
|
|
1445
1521
|
if (r.length === 0)
|
|
1446
1522
|
return `// Empty workflow
|
|
1447
1523
|
// Add nodes to your canvas to generate code`;
|
|
1448
|
-
const t =
|
|
1524
|
+
const t = et(r, i), a = /* @__PURE__ */ new Map();
|
|
1449
1525
|
for (const u of t)
|
|
1450
|
-
|
|
1451
|
-
const
|
|
1526
|
+
a.set(u.id, tt(u));
|
|
1527
|
+
const s = /* @__PURE__ */ new Set(), d = [];
|
|
1452
1528
|
for (const u of t) {
|
|
1453
|
-
const { code:
|
|
1454
|
-
|
|
1455
|
-
for (const
|
|
1456
|
-
|
|
1529
|
+
const { code: l, imports: p } = rt(u, i, a);
|
|
1530
|
+
d.push(l);
|
|
1531
|
+
for (const f of p)
|
|
1532
|
+
s.add(f);
|
|
1457
1533
|
}
|
|
1458
|
-
const
|
|
1459
|
-
|
|
1460
|
-
const
|
|
1534
|
+
const m = [];
|
|
1535
|
+
s.size > 0 && m.push(`import { ${Array.from(s).join(", ")} } from "@teamflojo/floimg";`), m.push('import * as flo from "@teamflojo/floimg";');
|
|
1536
|
+
const o = `/**
|
|
1461
1537
|
* FloImg Workflow
|
|
1462
1538
|
* Generated by FloImg Studio
|
|
1463
1539
|
* https://floimg.com
|
|
1464
1540
|
*/
|
|
1465
1541
|
|
|
1466
|
-
`,
|
|
1542
|
+
`, n = `
|
|
1467
1543
|
async function runWorkflow() {
|
|
1468
|
-
${
|
|
1544
|
+
${d.map(
|
|
1469
1545
|
(u) => u.split(`
|
|
1470
|
-
`).map((
|
|
1546
|
+
`).map((l) => " " + l).join(`
|
|
1471
1547
|
`)
|
|
1472
1548
|
).join(`
|
|
1473
1549
|
|
|
@@ -1477,55 +1553,291 @@ ${i.map(
|
|
|
1477
1553
|
// Run the workflow
|
|
1478
1554
|
runWorkflow().catch(console.error);
|
|
1479
1555
|
`;
|
|
1480
|
-
return
|
|
1556
|
+
return o + m.join(`
|
|
1481
1557
|
`) + `
|
|
1482
|
-
` +
|
|
1558
|
+
` + n;
|
|
1559
|
+
}
|
|
1560
|
+
function ot({ isOpen: r, onClose: i, onImport: t }) {
|
|
1561
|
+
const [a, s] = N(""), [d, m] = N(!1), [o, n] = N(null), [u, l] = N(!1), p = C(async () => {
|
|
1562
|
+
if (!a.trim()) {
|
|
1563
|
+
n({ message: "Please enter or paste YAML content" });
|
|
1564
|
+
return;
|
|
1565
|
+
}
|
|
1566
|
+
m(!0), n(null);
|
|
1567
|
+
try {
|
|
1568
|
+
const h = await Ee(a);
|
|
1569
|
+
h.success ? (t(h.nodes, h.edges, h.name), s(""), i()) : n({
|
|
1570
|
+
message: h.error || "Import failed",
|
|
1571
|
+
line: h.line,
|
|
1572
|
+
column: h.column
|
|
1573
|
+
});
|
|
1574
|
+
} catch (h) {
|
|
1575
|
+
n({ message: h instanceof Error ? h.message : "Import failed" });
|
|
1576
|
+
} finally {
|
|
1577
|
+
m(!1);
|
|
1578
|
+
}
|
|
1579
|
+
}, [a, t, i]), f = C(async () => {
|
|
1580
|
+
if (!a.trim()) {
|
|
1581
|
+
n({ message: "Please enter or paste YAML content" });
|
|
1582
|
+
return;
|
|
1583
|
+
}
|
|
1584
|
+
m(!0), n(null);
|
|
1585
|
+
try {
|
|
1586
|
+
const h = await Oe(a);
|
|
1587
|
+
h.valid ? (n(null), n({ message: "Valid YAML!" }), setTimeout(() => n(null), 2e3)) : h.errors.length > 0 && n(h.errors[0]);
|
|
1588
|
+
} catch (h) {
|
|
1589
|
+
n({ message: h instanceof Error ? h.message : "Validation failed" });
|
|
1590
|
+
} finally {
|
|
1591
|
+
m(!1);
|
|
1592
|
+
}
|
|
1593
|
+
}, [a]), b = C(async (h) => {
|
|
1594
|
+
if (!h.name.endsWith(".yaml") && !h.name.endsWith(".yml")) {
|
|
1595
|
+
n({ message: "Please upload a .yaml or .yml file" });
|
|
1596
|
+
return;
|
|
1597
|
+
}
|
|
1598
|
+
try {
|
|
1599
|
+
const z = await h.text();
|
|
1600
|
+
s(z), n(null);
|
|
1601
|
+
} catch {
|
|
1602
|
+
n({ message: "Failed to read file" });
|
|
1603
|
+
}
|
|
1604
|
+
}, []), k = C((h) => {
|
|
1605
|
+
h.preventDefault(), l(!0);
|
|
1606
|
+
}, []), g = C((h) => {
|
|
1607
|
+
h.preventDefault(), l(!1);
|
|
1608
|
+
}, []), v = C(
|
|
1609
|
+
(h) => {
|
|
1610
|
+
h.preventDefault(), l(!1);
|
|
1611
|
+
const z = h.dataTransfer.files[0];
|
|
1612
|
+
z && b(z);
|
|
1613
|
+
},
|
|
1614
|
+
[b]
|
|
1615
|
+
), w = C(
|
|
1616
|
+
(h) => {
|
|
1617
|
+
var S;
|
|
1618
|
+
const z = (S = h.target.files) == null ? void 0 : S[0];
|
|
1619
|
+
z && b(z);
|
|
1620
|
+
},
|
|
1621
|
+
[b]
|
|
1622
|
+
);
|
|
1623
|
+
return r ? /* @__PURE__ */ e("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50", children: /* @__PURE__ */ c("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: [
|
|
1624
|
+
/* @__PURE__ */ c("div", { className: "flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-zinc-700", children: [
|
|
1625
|
+
/* @__PURE__ */ e("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white", children: "Import Workflow" }),
|
|
1626
|
+
/* @__PURE__ */ e(
|
|
1627
|
+
"button",
|
|
1628
|
+
{
|
|
1629
|
+
onClick: i,
|
|
1630
|
+
className: "text-gray-500 dark:text-zinc-400 hover:text-gray-700 dark:hover:text-zinc-200",
|
|
1631
|
+
children: /* @__PURE__ */ e("svg", { className: "h-6 w-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e(
|
|
1632
|
+
"path",
|
|
1633
|
+
{
|
|
1634
|
+
strokeLinecap: "round",
|
|
1635
|
+
strokeLinejoin: "round",
|
|
1636
|
+
strokeWidth: 2,
|
|
1637
|
+
d: "M6 18L18 6M6 6l12 12"
|
|
1638
|
+
}
|
|
1639
|
+
) })
|
|
1640
|
+
}
|
|
1641
|
+
)
|
|
1642
|
+
] }),
|
|
1643
|
+
/* @__PURE__ */ c("div", { className: "p-4 flex-1 overflow-auto", children: [
|
|
1644
|
+
/* @__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." }),
|
|
1645
|
+
/* @__PURE__ */ c(
|
|
1646
|
+
"div",
|
|
1647
|
+
{
|
|
1648
|
+
onDragOver: k,
|
|
1649
|
+
onDragLeave: g,
|
|
1650
|
+
onDrop: v,
|
|
1651
|
+
className: `border-2 border-dashed rounded-lg p-4 mb-4 text-center transition-colors ${u ? "border-teal-500 bg-teal-50 dark:bg-teal-900/20" : "border-gray-300 dark:border-zinc-600"}`,
|
|
1652
|
+
children: [
|
|
1653
|
+
/* @__PURE__ */ e(
|
|
1654
|
+
"input",
|
|
1655
|
+
{
|
|
1656
|
+
type: "file",
|
|
1657
|
+
accept: ".yaml,.yml",
|
|
1658
|
+
onChange: w,
|
|
1659
|
+
className: "hidden",
|
|
1660
|
+
id: "yaml-file-input"
|
|
1661
|
+
}
|
|
1662
|
+
),
|
|
1663
|
+
/* @__PURE__ */ c(
|
|
1664
|
+
"label",
|
|
1665
|
+
{
|
|
1666
|
+
htmlFor: "yaml-file-input",
|
|
1667
|
+
className: "cursor-pointer text-sm text-gray-600 dark:text-zinc-400",
|
|
1668
|
+
children: [
|
|
1669
|
+
/* @__PURE__ */ e(
|
|
1670
|
+
"svg",
|
|
1671
|
+
{
|
|
1672
|
+
className: "h-8 w-8 mx-auto mb-2 text-gray-400 dark:text-zinc-500",
|
|
1673
|
+
fill: "none",
|
|
1674
|
+
viewBox: "0 0 24 24",
|
|
1675
|
+
stroke: "currentColor",
|
|
1676
|
+
children: /* @__PURE__ */ e(
|
|
1677
|
+
"path",
|
|
1678
|
+
{
|
|
1679
|
+
strokeLinecap: "round",
|
|
1680
|
+
strokeLinejoin: "round",
|
|
1681
|
+
strokeWidth: 2,
|
|
1682
|
+
d: "M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"
|
|
1683
|
+
}
|
|
1684
|
+
)
|
|
1685
|
+
}
|
|
1686
|
+
),
|
|
1687
|
+
/* @__PURE__ */ e("span", { className: "text-teal-600 dark:text-teal-400 hover:underline", children: "Click to upload" }),
|
|
1688
|
+
" ",
|
|
1689
|
+
"or drag and drop",
|
|
1690
|
+
/* @__PURE__ */ e("br", {}),
|
|
1691
|
+
/* @__PURE__ */ e("span", { className: "text-xs", children: ".yaml or .yml files" })
|
|
1692
|
+
]
|
|
1693
|
+
}
|
|
1694
|
+
)
|
|
1695
|
+
]
|
|
1696
|
+
}
|
|
1697
|
+
),
|
|
1698
|
+
/* @__PURE__ */ e(
|
|
1699
|
+
"textarea",
|
|
1700
|
+
{
|
|
1701
|
+
value: a,
|
|
1702
|
+
onChange: (h) => {
|
|
1703
|
+
s(h.target.value), n(null);
|
|
1704
|
+
},
|
|
1705
|
+
placeholder: `name: My Workflow
|
|
1706
|
+
steps:
|
|
1707
|
+
- kind: generate
|
|
1708
|
+
generator: quickchart
|
|
1709
|
+
params:
|
|
1710
|
+
type: bar
|
|
1711
|
+
data:
|
|
1712
|
+
labels: [Q1, Q2, Q3, Q4]
|
|
1713
|
+
datasets:
|
|
1714
|
+
- label: Revenue
|
|
1715
|
+
data: [12, 19, 8, 15]
|
|
1716
|
+
out: v0
|
|
1717
|
+
|
|
1718
|
+
- kind: transform
|
|
1719
|
+
op: resize
|
|
1720
|
+
in: v0
|
|
1721
|
+
params:
|
|
1722
|
+
width: 800
|
|
1723
|
+
out: v1`,
|
|
1724
|
+
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"
|
|
1725
|
+
}
|
|
1726
|
+
),
|
|
1727
|
+
o && /* @__PURE__ */ c(
|
|
1728
|
+
"div",
|
|
1729
|
+
{
|
|
1730
|
+
className: `mt-4 p-3 rounded-lg text-sm ${o.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"}`,
|
|
1731
|
+
children: [
|
|
1732
|
+
/* @__PURE__ */ e("span", { className: "font-medium", children: o.message }),
|
|
1733
|
+
o.line && /* @__PURE__ */ c("span", { className: "ml-2 text-xs", children: [
|
|
1734
|
+
"(line ",
|
|
1735
|
+
o.line,
|
|
1736
|
+
o.column ? `, column ${o.column}` : "",
|
|
1737
|
+
")"
|
|
1738
|
+
] })
|
|
1739
|
+
]
|
|
1740
|
+
}
|
|
1741
|
+
)
|
|
1742
|
+
] }),
|
|
1743
|
+
/* @__PURE__ */ c("div", { className: "flex justify-between items-center px-4 py-3 border-t border-gray-200 dark:border-zinc-700", children: [
|
|
1744
|
+
/* @__PURE__ */ e("span", { className: "text-xs text-gray-500 dark:text-zinc-400", children: "Use with floimg CLI: floimg run workflow.yaml" }),
|
|
1745
|
+
/* @__PURE__ */ c("div", { className: "flex gap-2", children: [
|
|
1746
|
+
/* @__PURE__ */ e(
|
|
1747
|
+
"button",
|
|
1748
|
+
{
|
|
1749
|
+
onClick: f,
|
|
1750
|
+
disabled: d || !a.trim(),
|
|
1751
|
+
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",
|
|
1752
|
+
children: "Validate"
|
|
1753
|
+
}
|
|
1754
|
+
),
|
|
1755
|
+
/* @__PURE__ */ c(
|
|
1756
|
+
"button",
|
|
1757
|
+
{
|
|
1758
|
+
onClick: p,
|
|
1759
|
+
disabled: d || !a.trim(),
|
|
1760
|
+
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",
|
|
1761
|
+
children: [
|
|
1762
|
+
d && /* @__PURE__ */ c("svg", { className: "animate-spin h-4 w-4", viewBox: "0 0 24 24", fill: "none", children: [
|
|
1763
|
+
/* @__PURE__ */ e(
|
|
1764
|
+
"circle",
|
|
1765
|
+
{
|
|
1766
|
+
className: "opacity-25",
|
|
1767
|
+
cx: "12",
|
|
1768
|
+
cy: "12",
|
|
1769
|
+
r: "10",
|
|
1770
|
+
stroke: "currentColor",
|
|
1771
|
+
strokeWidth: "4"
|
|
1772
|
+
}
|
|
1773
|
+
),
|
|
1774
|
+
/* @__PURE__ */ e(
|
|
1775
|
+
"path",
|
|
1776
|
+
{
|
|
1777
|
+
className: "opacity-75",
|
|
1778
|
+
fill: "currentColor",
|
|
1779
|
+
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"
|
|
1780
|
+
}
|
|
1781
|
+
)
|
|
1782
|
+
] }),
|
|
1783
|
+
"Import"
|
|
1784
|
+
]
|
|
1785
|
+
}
|
|
1786
|
+
)
|
|
1787
|
+
] })
|
|
1788
|
+
] })
|
|
1789
|
+
] }) }) : null;
|
|
1483
1790
|
}
|
|
1484
|
-
function
|
|
1791
|
+
function nt({
|
|
1485
1792
|
brandingSlot: r,
|
|
1486
|
-
beforeActionsSlot:
|
|
1793
|
+
beforeActionsSlot: i,
|
|
1487
1794
|
afterActionsSlot: t,
|
|
1488
|
-
hideAttribution:
|
|
1795
|
+
hideAttribution: a = !1
|
|
1489
1796
|
} = {}) {
|
|
1490
|
-
const
|
|
1491
|
-
|
|
1492
|
-
const
|
|
1493
|
-
|
|
1797
|
+
const s = x((y) => y.execution), d = x((y) => y.execute), m = x((y) => y.exportToYaml), o = x((y) => y.importFromYaml), n = x((y) => y.nodes), u = x((y) => y.edges), l = $((y) => y.openSettings), p = x((y) => y.activeWorkflowName), f = x((y) => y.hasUnsavedChanges), b = x((y) => y.saveWorkflow), k = x((y) => y.toggleLibrary), g = x((y) => y.setActiveWorkflowName), [v, w] = N(!1), [h, z] = N(!1), [S, B] = N("yaml"), [Q, le] = N(""), [J, ce] = N(""), [Y, U] = N(null), [me, F] = N(!1), [X, V] = N("");
|
|
1798
|
+
M(() => {
|
|
1799
|
+
const y = () => {
|
|
1800
|
+
U("New workflow created"), setTimeout(() => U(null), 2e3);
|
|
1494
1801
|
};
|
|
1495
|
-
return window.addEventListener("new-workflow-created",
|
|
1802
|
+
return window.addEventListener("new-workflow-created", y), () => window.removeEventListener("new-workflow-created", y);
|
|
1496
1803
|
}, []);
|
|
1497
|
-
const
|
|
1498
|
-
|
|
1499
|
-
}, [
|
|
1500
|
-
V(
|
|
1501
|
-
},
|
|
1502
|
-
const
|
|
1503
|
-
|
|
1804
|
+
const G = C(() => {
|
|
1805
|
+
n.length !== 0 && (b(), U("Saved!"), setTimeout(() => U(null), 2e3));
|
|
1806
|
+
}, [n.length, b]), ue = () => {
|
|
1807
|
+
V(p), F(!0);
|
|
1808
|
+
}, Z = () => {
|
|
1809
|
+
const y = X.trim();
|
|
1810
|
+
y && y !== p && g(y), F(!1);
|
|
1504
1811
|
};
|
|
1505
|
-
|
|
1506
|
-
function
|
|
1507
|
-
(
|
|
1812
|
+
M(() => {
|
|
1813
|
+
function y(L) {
|
|
1814
|
+
(L.metaKey || L.ctrlKey) && L.key === "s" && (L.preventDefault(), G());
|
|
1508
1815
|
}
|
|
1509
|
-
return document.addEventListener("keydown",
|
|
1510
|
-
}, [
|
|
1511
|
-
const
|
|
1512
|
-
await
|
|
1513
|
-
},
|
|
1514
|
-
const
|
|
1515
|
-
|
|
1516
|
-
const
|
|
1517
|
-
|
|
1518
|
-
},
|
|
1519
|
-
const
|
|
1520
|
-
navigator.clipboard.writeText(
|
|
1521
|
-
}
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1816
|
+
return document.addEventListener("keydown", y), () => document.removeEventListener("keydown", y);
|
|
1817
|
+
}, [G]);
|
|
1818
|
+
const ge = async () => {
|
|
1819
|
+
await d();
|
|
1820
|
+
}, pe = async () => {
|
|
1821
|
+
const y = await m();
|
|
1822
|
+
le(y);
|
|
1823
|
+
const L = at(n, u);
|
|
1824
|
+
ce(L), w(!0);
|
|
1825
|
+
}, he = () => {
|
|
1826
|
+
const y = S === "yaml" ? Q : J;
|
|
1827
|
+
navigator.clipboard.writeText(y);
|
|
1828
|
+
}, fe = C(
|
|
1829
|
+
(y, L, be) => {
|
|
1830
|
+
o(y, L, be), U("Workflow imported!"), setTimeout(() => U(null), 2e3);
|
|
1831
|
+
},
|
|
1832
|
+
[o]
|
|
1833
|
+
);
|
|
1834
|
+
return /* @__PURE__ */ c(j, { children: [
|
|
1835
|
+
/* @__PURE__ */ c("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: [
|
|
1836
|
+
/* @__PURE__ */ c("div", { className: "flex items-center gap-4", children: [
|
|
1525
1837
|
/* @__PURE__ */ e(
|
|
1526
1838
|
"button",
|
|
1527
1839
|
{
|
|
1528
|
-
onClick:
|
|
1840
|
+
onClick: k,
|
|
1529
1841
|
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",
|
|
1530
1842
|
title: "My Workflows",
|
|
1531
1843
|
children: /* @__PURE__ */ e("svg", { className: "h-5 w-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e(
|
|
@@ -1539,10 +1851,10 @@ function Ye({
|
|
|
1539
1851
|
) })
|
|
1540
1852
|
}
|
|
1541
1853
|
),
|
|
1542
|
-
/* @__PURE__ */
|
|
1543
|
-
/* @__PURE__ */ e("h1", { className: "text-xl font-bold text-gray-800 dark:text-white", children: "
|
|
1854
|
+
/* @__PURE__ */ c("div", { className: "flex items-baseline gap-2", children: [
|
|
1855
|
+
/* @__PURE__ */ e("h1", { className: "text-xl font-bold text-gray-800 dark:text-white", children: "FloImg Studio" }),
|
|
1544
1856
|
r,
|
|
1545
|
-
!
|
|
1857
|
+
!a && /* @__PURE__ */ e(
|
|
1546
1858
|
"a",
|
|
1547
1859
|
{
|
|
1548
1860
|
href: "https://flojo.io",
|
|
@@ -1553,16 +1865,16 @@ function Ye({
|
|
|
1553
1865
|
}
|
|
1554
1866
|
)
|
|
1555
1867
|
] }),
|
|
1556
|
-
/* @__PURE__ */
|
|
1557
|
-
|
|
1868
|
+
/* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
|
|
1869
|
+
me ? /* @__PURE__ */ e(
|
|
1558
1870
|
"input",
|
|
1559
1871
|
{
|
|
1560
1872
|
type: "text",
|
|
1561
|
-
value:
|
|
1562
|
-
onChange: (
|
|
1563
|
-
onBlur:
|
|
1564
|
-
onKeyDown: (
|
|
1565
|
-
|
|
1873
|
+
value: X,
|
|
1874
|
+
onChange: (y) => V(y.target.value),
|
|
1875
|
+
onBlur: Z,
|
|
1876
|
+
onKeyDown: (y) => {
|
|
1877
|
+
y.key === "Enter" && Z(), y.key === "Escape" && (V(p), F(!1));
|
|
1566
1878
|
},
|
|
1567
1879
|
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",
|
|
1568
1880
|
autoFocus: !0
|
|
@@ -1570,30 +1882,30 @@ function Ye({
|
|
|
1570
1882
|
) : /* @__PURE__ */ e(
|
|
1571
1883
|
"button",
|
|
1572
1884
|
{
|
|
1573
|
-
onClick:
|
|
1885
|
+
onClick: ue,
|
|
1574
1886
|
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",
|
|
1575
1887
|
title: "Click to rename",
|
|
1576
|
-
children:
|
|
1888
|
+
children: p
|
|
1577
1889
|
}
|
|
1578
1890
|
),
|
|
1579
|
-
|
|
1580
|
-
|
|
1891
|
+
f && /* @__PURE__ */ e("span", { className: "text-xs text-amber-600 dark:text-amber-400", children: "(unsaved)" }),
|
|
1892
|
+
Y && /* @__PURE__ */ e("span", { className: "text-xs text-green-600 dark:text-green-400", children: Y })
|
|
1581
1893
|
] }),
|
|
1582
|
-
/* @__PURE__ */
|
|
1583
|
-
|
|
1894
|
+
/* @__PURE__ */ c("span", { className: "text-sm text-gray-500 dark:text-zinc-400", children: [
|
|
1895
|
+
n.length,
|
|
1584
1896
|
" node",
|
|
1585
|
-
|
|
1897
|
+
n.length !== 1 ? "s" : ""
|
|
1586
1898
|
] })
|
|
1587
1899
|
] }),
|
|
1588
|
-
/* @__PURE__ */
|
|
1589
|
-
|
|
1900
|
+
/* @__PURE__ */ c("div", { className: "flex items-center gap-3", children: [
|
|
1901
|
+
i,
|
|
1590
1902
|
/* @__PURE__ */ e(
|
|
1591
1903
|
"button",
|
|
1592
1904
|
{
|
|
1593
|
-
onClick:
|
|
1905
|
+
onClick: l,
|
|
1594
1906
|
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",
|
|
1595
1907
|
title: "AI Settings",
|
|
1596
|
-
children: /* @__PURE__ */
|
|
1908
|
+
children: /* @__PURE__ */ c("svg", { className: "h-5 w-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: [
|
|
1597
1909
|
/* @__PURE__ */ e(
|
|
1598
1910
|
"path",
|
|
1599
1911
|
{
|
|
@@ -1618,8 +1930,8 @@ function Ye({
|
|
|
1618
1930
|
/* @__PURE__ */ e(
|
|
1619
1931
|
"button",
|
|
1620
1932
|
{
|
|
1621
|
-
onClick:
|
|
1622
|
-
disabled:
|
|
1933
|
+
onClick: G,
|
|
1934
|
+
disabled: n.length === 0,
|
|
1623
1935
|
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",
|
|
1624
1936
|
title: "Save Workflow (Cmd+S)",
|
|
1625
1937
|
children: /* @__PURE__ */ e("svg", { className: "h-5 w-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e(
|
|
@@ -1636,8 +1948,16 @@ function Ye({
|
|
|
1636
1948
|
/* @__PURE__ */ e(
|
|
1637
1949
|
"button",
|
|
1638
1950
|
{
|
|
1639
|
-
onClick:
|
|
1640
|
-
|
|
1951
|
+
onClick: () => z(!0),
|
|
1952
|
+
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",
|
|
1953
|
+
children: "Import"
|
|
1954
|
+
}
|
|
1955
|
+
),
|
|
1956
|
+
/* @__PURE__ */ e(
|
|
1957
|
+
"button",
|
|
1958
|
+
{
|
|
1959
|
+
onClick: pe,
|
|
1960
|
+
disabled: n.length === 0,
|
|
1641
1961
|
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",
|
|
1642
1962
|
children: "Export"
|
|
1643
1963
|
}
|
|
@@ -1645,11 +1965,11 @@ function Ye({
|
|
|
1645
1965
|
/* @__PURE__ */ e(
|
|
1646
1966
|
"button",
|
|
1647
1967
|
{
|
|
1648
|
-
onClick:
|
|
1649
|
-
disabled:
|
|
1968
|
+
onClick: ge,
|
|
1969
|
+
disabled: n.length === 0 || s.status === "running",
|
|
1650
1970
|
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",
|
|
1651
|
-
children:
|
|
1652
|
-
/* @__PURE__ */
|
|
1971
|
+
children: s.status === "running" ? /* @__PURE__ */ c(j, { children: [
|
|
1972
|
+
/* @__PURE__ */ c("svg", { className: "animate-spin h-4 w-4", viewBox: "0 0 24 24", fill: "none", children: [
|
|
1653
1973
|
/* @__PURE__ */ e(
|
|
1654
1974
|
"circle",
|
|
1655
1975
|
{
|
|
@@ -1671,8 +1991,8 @@ function Ye({
|
|
|
1671
1991
|
)
|
|
1672
1992
|
] }),
|
|
1673
1993
|
"Running..."
|
|
1674
|
-
] }) : /* @__PURE__ */
|
|
1675
|
-
/* @__PURE__ */
|
|
1994
|
+
] }) : /* @__PURE__ */ c(j, { children: [
|
|
1995
|
+
/* @__PURE__ */ c("svg", { className: "h-4 w-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: [
|
|
1676
1996
|
/* @__PURE__ */ e(
|
|
1677
1997
|
"path",
|
|
1678
1998
|
{
|
|
@@ -1699,54 +2019,44 @@ function Ye({
|
|
|
1699
2019
|
t
|
|
1700
2020
|
] })
|
|
1701
2021
|
] }),
|
|
1702
|
-
|
|
1703
|
-
/* @__PURE__ */
|
|
2022
|
+
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__ */ c("div", { className: "flex items-center gap-4", children: [
|
|
2023
|
+
/* @__PURE__ */ c("span", { className: "text-green-700 dark:text-green-400 font-medium", children: [
|
|
1704
2024
|
"Generated ",
|
|
1705
|
-
|
|
2025
|
+
s.imageIds.length,
|
|
1706
2026
|
" image",
|
|
1707
|
-
|
|
2027
|
+
s.imageIds.length !== 1 ? "s" : ""
|
|
1708
2028
|
] }),
|
|
1709
|
-
/* @__PURE__ */ e("div", { className: "flex gap-2", children:
|
|
1710
|
-
"
|
|
2029
|
+
/* @__PURE__ */ e("div", { className: "flex gap-2", children: s.imageUrls.slice(0, 4).map((y, L) => /* @__PURE__ */ e("a", { href: y, target: "_blank", rel: "noopener noreferrer", className: "block", children: /* @__PURE__ */ e(
|
|
2030
|
+
"img",
|
|
1711
2031
|
{
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
"img",
|
|
1718
|
-
{
|
|
1719
|
-
src: G(v),
|
|
1720
|
-
alt: "Generated",
|
|
1721
|
-
className: "h-12 w-12 object-cover rounded border border-green-300 dark:border-green-700"
|
|
1722
|
-
}
|
|
1723
|
-
)
|
|
1724
|
-
},
|
|
1725
|
-
v
|
|
1726
|
-
)) })
|
|
2032
|
+
src: y,
|
|
2033
|
+
alt: "Generated",
|
|
2034
|
+
className: "h-12 w-12 object-cover rounded border border-green-300 dark:border-green-700"
|
|
2035
|
+
}
|
|
2036
|
+
) }, L)) })
|
|
1727
2037
|
] }) }),
|
|
1728
|
-
|
|
2038
|
+
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__ */ c("span", { className: "text-red-700 dark:text-red-400", children: [
|
|
1729
2039
|
"Error: ",
|
|
1730
|
-
|
|
2040
|
+
s.error
|
|
1731
2041
|
] }) }),
|
|
1732
|
-
|
|
1733
|
-
/* @__PURE__ */
|
|
1734
|
-
/* @__PURE__ */
|
|
2042
|
+
v && /* @__PURE__ */ e("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50", children: /* @__PURE__ */ c("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: [
|
|
2043
|
+
/* @__PURE__ */ c("div", { className: "flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-zinc-700", children: [
|
|
2044
|
+
/* @__PURE__ */ c("div", { className: "flex items-center gap-4", children: [
|
|
1735
2045
|
/* @__PURE__ */ e("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white", children: "Export Workflow" }),
|
|
1736
|
-
/* @__PURE__ */
|
|
2046
|
+
/* @__PURE__ */ c("div", { className: "flex gap-1 bg-gray-100 dark:bg-zinc-700 rounded-lg p-1", children: [
|
|
1737
2047
|
/* @__PURE__ */ e(
|
|
1738
2048
|
"button",
|
|
1739
2049
|
{
|
|
1740
|
-
onClick: () =>
|
|
1741
|
-
className: `px-3 py-1 text-sm font-medium rounded-md transition-colors ${
|
|
2050
|
+
onClick: () => B("yaml"),
|
|
2051
|
+
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"}`,
|
|
1742
2052
|
children: "YAML"
|
|
1743
2053
|
}
|
|
1744
2054
|
),
|
|
1745
2055
|
/* @__PURE__ */ e(
|
|
1746
2056
|
"button",
|
|
1747
2057
|
{
|
|
1748
|
-
onClick: () =>
|
|
1749
|
-
className: `px-3 py-1 text-sm font-medium rounded-md transition-colors ${
|
|
2058
|
+
onClick: () => B("javascript"),
|
|
2059
|
+
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"}`,
|
|
1750
2060
|
children: "JavaScript"
|
|
1751
2061
|
}
|
|
1752
2062
|
)
|
|
@@ -1769,14 +2079,14 @@ function Ye({
|
|
|
1769
2079
|
}
|
|
1770
2080
|
)
|
|
1771
2081
|
] }),
|
|
1772
|
-
/* @__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:
|
|
1773
|
-
/* @__PURE__ */
|
|
1774
|
-
/* @__PURE__ */ e("span", { className: "text-xs text-gray-500 dark:text-zinc-400", children:
|
|
1775
|
-
/* @__PURE__ */
|
|
2082
|
+
/* @__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" ? Q : J }) }),
|
|
2083
|
+
/* @__PURE__ */ c("div", { className: "flex justify-between items-center px-4 py-3 border-t border-gray-200 dark:border-zinc-700", children: [
|
|
2084
|
+
/* @__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" }),
|
|
2085
|
+
/* @__PURE__ */ c("div", { className: "flex gap-2", children: [
|
|
1776
2086
|
/* @__PURE__ */ e(
|
|
1777
2087
|
"button",
|
|
1778
2088
|
{
|
|
1779
|
-
onClick:
|
|
2089
|
+
onClick: he,
|
|
1780
2090
|
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",
|
|
1781
2091
|
children: "Copy to Clipboard"
|
|
1782
2092
|
}
|
|
@@ -1791,28 +2101,36 @@ function Ye({
|
|
|
1791
2101
|
)
|
|
1792
2102
|
] })
|
|
1793
2103
|
] })
|
|
1794
|
-
] }) })
|
|
2104
|
+
] }) }),
|
|
2105
|
+
/* @__PURE__ */ e(
|
|
2106
|
+
ot,
|
|
2107
|
+
{
|
|
2108
|
+
isOpen: h,
|
|
2109
|
+
onClose: () => z(!1),
|
|
2110
|
+
onImport: fe
|
|
2111
|
+
}
|
|
2112
|
+
)
|
|
1795
2113
|
] });
|
|
1796
2114
|
}
|
|
1797
|
-
function
|
|
1798
|
-
const r =
|
|
1799
|
-
data:
|
|
1800
|
-
isLoading:
|
|
1801
|
-
error:
|
|
1802
|
-
refetch:
|
|
1803
|
-
} =
|
|
2115
|
+
function st() {
|
|
2116
|
+
const r = x((n) => n.loadTemplate), [i, t] = N(null), {
|
|
2117
|
+
data: a,
|
|
2118
|
+
isLoading: s,
|
|
2119
|
+
error: d,
|
|
2120
|
+
refetch: m
|
|
2121
|
+
} = K({
|
|
1804
2122
|
queryKey: ["images"],
|
|
1805
|
-
queryFn:
|
|
2123
|
+
queryFn: Me,
|
|
1806
2124
|
refetchInterval: 5e3
|
|
1807
2125
|
// Auto-refresh every 5 seconds
|
|
1808
|
-
}),
|
|
1809
|
-
t(
|
|
2126
|
+
}), o = async (n) => {
|
|
2127
|
+
t(n);
|
|
1810
2128
|
try {
|
|
1811
|
-
const u = await
|
|
2129
|
+
const u = await Ue(n);
|
|
1812
2130
|
if (u != null && u.workflow) {
|
|
1813
|
-
const
|
|
1814
|
-
id: `image-${
|
|
1815
|
-
name: `Workflow from ${
|
|
2131
|
+
const l = {
|
|
2132
|
+
id: `image-${n}`,
|
|
2133
|
+
name: `Workflow from ${n}`,
|
|
1816
2134
|
description: "Loaded from gallery image",
|
|
1817
2135
|
category: "Gallery",
|
|
1818
2136
|
generator: "unknown",
|
|
@@ -1821,7 +2139,7 @@ function Xe() {
|
|
|
1821
2139
|
edges: u.workflow.edges
|
|
1822
2140
|
}
|
|
1823
2141
|
};
|
|
1824
|
-
r(
|
|
2142
|
+
r(l), window.dispatchEvent(new CustomEvent("workflow-loaded"));
|
|
1825
2143
|
} else
|
|
1826
2144
|
alert("No workflow metadata available for this image");
|
|
1827
2145
|
} catch (u) {
|
|
@@ -1830,56 +2148,56 @@ function Xe() {
|
|
|
1830
2148
|
t(null);
|
|
1831
2149
|
}
|
|
1832
2150
|
};
|
|
1833
|
-
return
|
|
2151
|
+
return s ? /* @__PURE__ */ e("div", { className: "p-8 text-center text-gray-500 dark:text-zinc-400", children: "Loading images..." }) : d ? /* @__PURE__ */ c("div", { className: "p-8 text-center text-red-500 dark:text-red-400", children: [
|
|
1834
2152
|
"Error loading images: ",
|
|
1835
|
-
|
|
1836
|
-
] }) : !
|
|
2153
|
+
d instanceof Error ? d.message : "Unknown error"
|
|
2154
|
+
] }) : !a || a.length === 0 ? /* @__PURE__ */ c("div", { className: "p-8 text-center text-gray-500 dark:text-zinc-400", children: [
|
|
1837
2155
|
/* @__PURE__ */ e("div", { className: "text-lg mb-2", children: "No images yet" }),
|
|
1838
2156
|
/* @__PURE__ */ e("div", { className: "text-sm", children: "Create a workflow and click Execute to generate images" })
|
|
1839
|
-
] }) : /* @__PURE__ */
|
|
1840
|
-
/* @__PURE__ */
|
|
1841
|
-
/* @__PURE__ */
|
|
2157
|
+
] }) : /* @__PURE__ */ c("div", { className: "p-4 bg-gray-100 dark:bg-zinc-900 min-h-full", children: [
|
|
2158
|
+
/* @__PURE__ */ c("div", { className: "flex items-center justify-between mb-4", children: [
|
|
2159
|
+
/* @__PURE__ */ c("h2", { className: "text-lg font-semibold text-gray-800 dark:text-white", children: [
|
|
1842
2160
|
"Gallery (",
|
|
1843
|
-
|
|
2161
|
+
a.length,
|
|
1844
2162
|
" image",
|
|
1845
|
-
|
|
2163
|
+
a.length !== 1 ? "s" : "",
|
|
1846
2164
|
")"
|
|
1847
2165
|
] }),
|
|
1848
2166
|
/* @__PURE__ */ e(
|
|
1849
2167
|
"button",
|
|
1850
2168
|
{
|
|
1851
|
-
onClick: () =>
|
|
2169
|
+
onClick: () => m(),
|
|
1852
2170
|
className: "text-sm text-teal-600 dark:text-teal-400 hover:text-teal-700 dark:hover:text-violet-300",
|
|
1853
2171
|
children: "Refresh"
|
|
1854
2172
|
}
|
|
1855
2173
|
)
|
|
1856
2174
|
] }),
|
|
1857
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4", children:
|
|
1858
|
-
|
|
2175
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4", children: a.map((n) => /* @__PURE__ */ e(
|
|
2176
|
+
it,
|
|
1859
2177
|
{
|
|
1860
|
-
image:
|
|
1861
|
-
onLoadWorkflow: () =>
|
|
1862
|
-
isLoading:
|
|
2178
|
+
image: n,
|
|
2179
|
+
onLoadWorkflow: () => o(n.id),
|
|
2180
|
+
isLoading: i === n.id
|
|
1863
2181
|
},
|
|
1864
|
-
|
|
2182
|
+
n.id
|
|
1865
2183
|
)) })
|
|
1866
2184
|
] });
|
|
1867
2185
|
}
|
|
1868
|
-
function
|
|
1869
|
-
const
|
|
1870
|
-
return /* @__PURE__ */
|
|
1871
|
-
/* @__PURE__ */
|
|
2186
|
+
function it({ image: r, onLoadWorkflow: i, isLoading: t }) {
|
|
2187
|
+
const a = (d) => new Date(d).toLocaleString(), s = (d) => d < 1024 ? `${d} B` : d < 1048576 ? `${(d / 1024).toFixed(1)} KB` : `${(d / 1048576).toFixed(1)} MB`;
|
|
2188
|
+
return /* @__PURE__ */ c("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: [
|
|
2189
|
+
/* @__PURE__ */ c("div", { className: "relative", children: [
|
|
1872
2190
|
/* @__PURE__ */ e(
|
|
1873
2191
|
"a",
|
|
1874
2192
|
{
|
|
1875
|
-
href:
|
|
2193
|
+
href: te(r.id),
|
|
1876
2194
|
target: "_blank",
|
|
1877
2195
|
rel: "noopener noreferrer",
|
|
1878
2196
|
className: "block aspect-square bg-gray-100 dark:bg-zinc-900",
|
|
1879
2197
|
children: /* @__PURE__ */ e(
|
|
1880
2198
|
"img",
|
|
1881
2199
|
{
|
|
1882
|
-
src:
|
|
2200
|
+
src: te(r.id),
|
|
1883
2201
|
alt: r.filename,
|
|
1884
2202
|
className: "w-full h-full object-cover",
|
|
1885
2203
|
loading: "lazy"
|
|
@@ -1890,8 +2208,8 @@ function Ze({ image: r, onLoadWorkflow: s, isLoading: t }) {
|
|
|
1890
2208
|
/* @__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(
|
|
1891
2209
|
"button",
|
|
1892
2210
|
{
|
|
1893
|
-
onClick: (
|
|
1894
|
-
|
|
2211
|
+
onClick: (d) => {
|
|
2212
|
+
d.preventDefault(), i();
|
|
1895
2213
|
},
|
|
1896
2214
|
disabled: t,
|
|
1897
2215
|
className: "px-3 py-1.5 bg-teal-600 text-white text-sm rounded-lg hover:bg-teal-700 disabled:opacity-50",
|
|
@@ -1899,18 +2217,18 @@ function Ze({ image: r, onLoadWorkflow: s, isLoading: t }) {
|
|
|
1899
2217
|
}
|
|
1900
2218
|
) })
|
|
1901
2219
|
] }),
|
|
1902
|
-
/* @__PURE__ */
|
|
2220
|
+
/* @__PURE__ */ c("div", { className: "p-3", children: [
|
|
1903
2221
|
/* @__PURE__ */ e("div", { className: "text-sm font-medium text-gray-800 dark:text-white truncate", children: r.filename }),
|
|
1904
|
-
/* @__PURE__ */
|
|
2222
|
+
/* @__PURE__ */ c("div", { className: "text-xs text-gray-500 dark:text-zinc-400 mt-1", children: [
|
|
1905
2223
|
r.mime,
|
|
1906
2224
|
" • ",
|
|
1907
|
-
|
|
2225
|
+
s(r.size)
|
|
1908
2226
|
] }),
|
|
1909
|
-
/* @__PURE__ */ e("div", { className: "text-xs text-gray-400 dark:text-zinc-500 mt-1", children:
|
|
2227
|
+
/* @__PURE__ */ e("div", { className: "text-xs text-gray-400 dark:text-zinc-500 mt-1", children: a(r.createdAt) })
|
|
1910
2228
|
] })
|
|
1911
2229
|
] });
|
|
1912
2230
|
}
|
|
1913
|
-
const
|
|
2231
|
+
const dt = {
|
|
1914
2232
|
id: "sales-dashboard",
|
|
1915
2233
|
name: "Sales Dashboard",
|
|
1916
2234
|
description: "Quarterly revenue bar chart with gradient styling",
|
|
@@ -1960,7 +2278,7 @@ const et = {
|
|
|
1960
2278
|
],
|
|
1961
2279
|
edges: []
|
|
1962
2280
|
}
|
|
1963
|
-
},
|
|
2281
|
+
}, lt = {
|
|
1964
2282
|
id: "user-growth",
|
|
1965
2283
|
name: "User Growth Line Chart",
|
|
1966
2284
|
description: "Monthly user growth with smooth bezier curves",
|
|
@@ -2008,7 +2326,7 @@ const et = {
|
|
|
2008
2326
|
],
|
|
2009
2327
|
edges: []
|
|
2010
2328
|
}
|
|
2011
|
-
},
|
|
2329
|
+
}, ct = {
|
|
2012
2330
|
id: "api-flow",
|
|
2013
2331
|
name: "API Request Flow",
|
|
2014
2332
|
description: "Sequence diagram showing API authentication flow",
|
|
@@ -2050,7 +2368,7 @@ const et = {
|
|
|
2050
2368
|
],
|
|
2051
2369
|
edges: []
|
|
2052
2370
|
}
|
|
2053
|
-
},
|
|
2371
|
+
}, mt = {
|
|
2054
2372
|
id: "system-architecture",
|
|
2055
2373
|
name: "System Architecture",
|
|
2056
2374
|
description: "Microservices architecture diagram",
|
|
@@ -2108,7 +2426,7 @@ const et = {
|
|
|
2108
2426
|
],
|
|
2109
2427
|
edges: []
|
|
2110
2428
|
}
|
|
2111
|
-
},
|
|
2429
|
+
}, ut = {
|
|
2112
2430
|
id: "git-workflow",
|
|
2113
2431
|
name: "Git Branch Workflow",
|
|
2114
2432
|
description: "Git branching strategy with feature and release branches",
|
|
@@ -2151,7 +2469,7 @@ const et = {
|
|
|
2151
2469
|
],
|
|
2152
2470
|
edges: []
|
|
2153
2471
|
}
|
|
2154
|
-
},
|
|
2472
|
+
}, gt = {
|
|
2155
2473
|
id: "website-qr",
|
|
2156
2474
|
name: "Website QR Code",
|
|
2157
2475
|
description: "QR code linking to your website with custom styling",
|
|
@@ -2179,7 +2497,7 @@ const et = {
|
|
|
2179
2497
|
],
|
|
2180
2498
|
edges: []
|
|
2181
2499
|
}
|
|
2182
|
-
},
|
|
2500
|
+
}, pt = {
|
|
2183
2501
|
id: "wifi-qr",
|
|
2184
2502
|
name: "WiFi QR Code",
|
|
2185
2503
|
description: "Scannable QR code for WiFi network access",
|
|
@@ -2207,7 +2525,7 @@ const et = {
|
|
|
2207
2525
|
],
|
|
2208
2526
|
edges: []
|
|
2209
2527
|
}
|
|
2210
|
-
},
|
|
2528
|
+
}, ht = {
|
|
2211
2529
|
id: "chart-watermark",
|
|
2212
2530
|
name: "Chart with Watermark",
|
|
2213
2531
|
description: "Bar chart with company watermark and rounded corners",
|
|
@@ -2273,7 +2591,7 @@ const et = {
|
|
|
2273
2591
|
{ id: "e2", source: "transform-1", target: "transform-2" }
|
|
2274
2592
|
]
|
|
2275
2593
|
}
|
|
2276
|
-
},
|
|
2594
|
+
}, ft = {
|
|
2277
2595
|
id: "diagram-webp",
|
|
2278
2596
|
name: "Diagram to WebP",
|
|
2279
2597
|
description: "Mermaid diagram converted to optimized WebP format",
|
|
@@ -2314,108 +2632,108 @@ const et = {
|
|
|
2314
2632
|
],
|
|
2315
2633
|
edges: [{ id: "e1", source: "gen-1", target: "transform-1" }]
|
|
2316
2634
|
}
|
|
2317
|
-
},
|
|
2635
|
+
}, O = [
|
|
2318
2636
|
// Charts
|
|
2319
|
-
|
|
2320
|
-
|
|
2637
|
+
dt,
|
|
2638
|
+
lt,
|
|
2321
2639
|
// Diagrams
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2640
|
+
ct,
|
|
2641
|
+
mt,
|
|
2642
|
+
ut,
|
|
2325
2643
|
// QR Codes
|
|
2326
|
-
|
|
2327
|
-
|
|
2644
|
+
gt,
|
|
2645
|
+
pt,
|
|
2328
2646
|
// Pipelines
|
|
2329
|
-
|
|
2330
|
-
|
|
2647
|
+
ht,
|
|
2648
|
+
ft
|
|
2331
2649
|
];
|
|
2332
|
-
function
|
|
2333
|
-
const r = new Set(
|
|
2650
|
+
function bt() {
|
|
2651
|
+
const r = new Set(O.map((i) => i.category));
|
|
2334
2652
|
return Array.from(r).sort();
|
|
2335
2653
|
}
|
|
2336
|
-
function
|
|
2337
|
-
return
|
|
2654
|
+
function $t(r) {
|
|
2655
|
+
return O.filter((i) => i.category === r);
|
|
2338
2656
|
}
|
|
2339
|
-
function
|
|
2340
|
-
return
|
|
2657
|
+
function ne(r) {
|
|
2658
|
+
return O.find((i) => i.id === r);
|
|
2341
2659
|
}
|
|
2342
|
-
function
|
|
2343
|
-
const
|
|
2344
|
-
return
|
|
2660
|
+
function Mt(r) {
|
|
2661
|
+
const i = r.toLowerCase();
|
|
2662
|
+
return O.filter(
|
|
2345
2663
|
(t) => {
|
|
2346
|
-
var
|
|
2347
|
-
return t.name.toLowerCase().includes(
|
|
2664
|
+
var a;
|
|
2665
|
+
return t.name.toLowerCase().includes(i) || t.description.toLowerCase().includes(i) || t.category.toLowerCase().includes(i) || t.generator.toLowerCase().includes(i) || ((a = t.tags) == null ? void 0 : a.some((s) => s.toLowerCase().includes(i)));
|
|
2348
2666
|
}
|
|
2349
2667
|
);
|
|
2350
2668
|
}
|
|
2351
|
-
function
|
|
2352
|
-
const [
|
|
2353
|
-
let
|
|
2354
|
-
if (
|
|
2355
|
-
const
|
|
2356
|
-
|
|
2669
|
+
function xt({ onSelect: r }) {
|
|
2670
|
+
const [i, t] = N(null), [a, s] = N(""), d = ee(() => bt(), []), m = ee(() => {
|
|
2671
|
+
let o = O;
|
|
2672
|
+
if (i && (o = o.filter((n) => n.category === i)), a) {
|
|
2673
|
+
const n = a.toLowerCase();
|
|
2674
|
+
o = o.filter(
|
|
2357
2675
|
(u) => {
|
|
2358
|
-
var
|
|
2359
|
-
return u.name.toLowerCase().includes(
|
|
2676
|
+
var l;
|
|
2677
|
+
return u.name.toLowerCase().includes(n) || u.description.toLowerCase().includes(n) || u.generator.toLowerCase().includes(n) || ((l = u.tags) == null ? void 0 : l.some((p) => p.toLowerCase().includes(n)));
|
|
2360
2678
|
}
|
|
2361
2679
|
);
|
|
2362
2680
|
}
|
|
2363
|
-
return
|
|
2364
|
-
}, [
|
|
2365
|
-
return /* @__PURE__ */
|
|
2366
|
-
/* @__PURE__ */
|
|
2681
|
+
return o;
|
|
2682
|
+
}, [i, a]);
|
|
2683
|
+
return /* @__PURE__ */ c("div", { className: "p-6", children: [
|
|
2684
|
+
/* @__PURE__ */ c("div", { className: "mb-6", children: [
|
|
2367
2685
|
/* @__PURE__ */ e("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white mb-2", children: "Templates" }),
|
|
2368
2686
|
/* @__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." })
|
|
2369
2687
|
] }),
|
|
2370
|
-
/* @__PURE__ */
|
|
2688
|
+
/* @__PURE__ */ c("div", { className: "flex flex-wrap gap-4 mb-6", children: [
|
|
2371
2689
|
/* @__PURE__ */ e(
|
|
2372
2690
|
"input",
|
|
2373
2691
|
{
|
|
2374
2692
|
type: "text",
|
|
2375
2693
|
placeholder: "Search templates...",
|
|
2376
|
-
value:
|
|
2377
|
-
onChange: (
|
|
2694
|
+
value: a,
|
|
2695
|
+
onChange: (o) => s(o.target.value),
|
|
2378
2696
|
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"
|
|
2379
2697
|
}
|
|
2380
2698
|
),
|
|
2381
|
-
/* @__PURE__ */
|
|
2699
|
+
/* @__PURE__ */ c("div", { className: "flex gap-2 flex-wrap", children: [
|
|
2382
2700
|
/* @__PURE__ */ e(
|
|
2383
2701
|
"button",
|
|
2384
2702
|
{
|
|
2385
2703
|
onClick: () => t(null),
|
|
2386
|
-
className: `px-3 py-1.5 rounded-full text-sm font-medium transition-colors ${
|
|
2704
|
+
className: `px-3 py-1.5 rounded-full text-sm font-medium transition-colors ${i === null ? "bg-teal-600 text-white" : "bg-gray-200 dark:bg-zinc-700 text-gray-700 dark:text-zinc-300 hover:bg-gray-300 dark:hover:bg-zinc-600"}`,
|
|
2387
2705
|
children: "All"
|
|
2388
2706
|
}
|
|
2389
2707
|
),
|
|
2390
|
-
|
|
2708
|
+
d.map((o) => /* @__PURE__ */ e(
|
|
2391
2709
|
"button",
|
|
2392
2710
|
{
|
|
2393
|
-
onClick: () => t(
|
|
2394
|
-
className: `px-3 py-1.5 rounded-full text-sm font-medium transition-colors ${
|
|
2395
|
-
children:
|
|
2711
|
+
onClick: () => t(o),
|
|
2712
|
+
className: `px-3 py-1.5 rounded-full text-sm font-medium transition-colors ${i === o ? "bg-teal-600 text-white" : "bg-gray-200 dark:bg-zinc-700 text-gray-700 dark:text-zinc-300 hover:bg-gray-300 dark:hover:bg-zinc-600"}`,
|
|
2713
|
+
children: o
|
|
2396
2714
|
},
|
|
2397
|
-
|
|
2715
|
+
o
|
|
2398
2716
|
))
|
|
2399
2717
|
] })
|
|
2400
2718
|
] }),
|
|
2401
|
-
|
|
2402
|
-
|
|
2719
|
+
m.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: m.map((o) => /* @__PURE__ */ e(
|
|
2720
|
+
kt,
|
|
2403
2721
|
{
|
|
2404
|
-
template:
|
|
2405
|
-
onSelect: () => r(
|
|
2722
|
+
template: o,
|
|
2723
|
+
onSelect: () => r(o.id)
|
|
2406
2724
|
},
|
|
2407
|
-
|
|
2725
|
+
o.id
|
|
2408
2726
|
)) })
|
|
2409
2727
|
] });
|
|
2410
2728
|
}
|
|
2411
|
-
function
|
|
2412
|
-
const t = r.workflow.nodes.length,
|
|
2729
|
+
function kt({ template: r, onSelect: i }) {
|
|
2730
|
+
const t = r.workflow.nodes.length, a = r.workflow.edges.length, s = {
|
|
2413
2731
|
quickchart: "bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-300",
|
|
2414
2732
|
mermaid: "bg-pink-100 text-pink-800 dark:bg-pink-900/30 dark:text-pink-300",
|
|
2415
2733
|
qr: "bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-300",
|
|
2416
2734
|
d3: "bg-orange-100 text-orange-800 dark:bg-orange-900/30 dark:text-orange-300"
|
|
2417
2735
|
};
|
|
2418
|
-
return /* @__PURE__ */
|
|
2736
|
+
return /* @__PURE__ */ c("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: [
|
|
2419
2737
|
/* @__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(
|
|
2420
2738
|
"img",
|
|
2421
2739
|
{
|
|
@@ -2423,7 +2741,7 @@ function mt({ template: r, onSelect: s }) {
|
|
|
2423
2741
|
alt: r.name,
|
|
2424
2742
|
className: "max-w-full max-h-full object-contain"
|
|
2425
2743
|
}
|
|
2426
|
-
) : /* @__PURE__ */
|
|
2744
|
+
) : /* @__PURE__ */ c("div", { className: "text-center text-gray-400 dark:text-zinc-500", children: [
|
|
2427
2745
|
/* @__PURE__ */ e(
|
|
2428
2746
|
"svg",
|
|
2429
2747
|
{
|
|
@@ -2444,20 +2762,20 @@ function mt({ template: r, onSelect: s }) {
|
|
|
2444
2762
|
),
|
|
2445
2763
|
/* @__PURE__ */ e("span", { className: "text-sm", children: "No preview" })
|
|
2446
2764
|
] }) }),
|
|
2447
|
-
/* @__PURE__ */
|
|
2448
|
-
/* @__PURE__ */
|
|
2765
|
+
/* @__PURE__ */ c("div", { className: "p-4", children: [
|
|
2766
|
+
/* @__PURE__ */ c("div", { className: "flex items-start justify-between mb-2", children: [
|
|
2449
2767
|
/* @__PURE__ */ e("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white", children: r.name }),
|
|
2450
2768
|
/* @__PURE__ */ e(
|
|
2451
2769
|
"span",
|
|
2452
2770
|
{
|
|
2453
|
-
className: `px-2 py-0.5 rounded text-xs font-medium ${
|
|
2771
|
+
className: `px-2 py-0.5 rounded text-xs font-medium ${s[r.generator] || "bg-gray-100 text-gray-800 dark:bg-zinc-700 dark:text-zinc-300"}`,
|
|
2454
2772
|
children: r.generator
|
|
2455
2773
|
}
|
|
2456
2774
|
)
|
|
2457
2775
|
] }),
|
|
2458
2776
|
/* @__PURE__ */ e("p", { className: "text-sm text-gray-600 dark:text-zinc-400 mb-3", children: r.description }),
|
|
2459
|
-
/* @__PURE__ */
|
|
2460
|
-
/* @__PURE__ */
|
|
2777
|
+
/* @__PURE__ */ c("div", { className: "flex items-center gap-4 text-xs text-gray-500 dark:text-zinc-500 mb-4", children: [
|
|
2778
|
+
/* @__PURE__ */ c("span", { className: "flex items-center gap-1", children: [
|
|
2461
2779
|
/* @__PURE__ */ e("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e(
|
|
2462
2780
|
"path",
|
|
2463
2781
|
{
|
|
@@ -2471,7 +2789,7 @@ function mt({ template: r, onSelect: s }) {
|
|
|
2471
2789
|
" node",
|
|
2472
2790
|
t !== 1 ? "s" : ""
|
|
2473
2791
|
] }),
|
|
2474
|
-
|
|
2792
|
+
a > 0 && /* @__PURE__ */ c("span", { className: "flex items-center gap-1", children: [
|
|
2475
2793
|
/* @__PURE__ */ e("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e(
|
|
2476
2794
|
"path",
|
|
2477
2795
|
{
|
|
@@ -2481,23 +2799,23 @@ function mt({ template: r, onSelect: s }) {
|
|
|
2481
2799
|
d: "M13 7l5 5m0 0l-5 5m5-5H6"
|
|
2482
2800
|
}
|
|
2483
2801
|
) }),
|
|
2484
|
-
|
|
2802
|
+
a,
|
|
2485
2803
|
" edge",
|
|
2486
|
-
|
|
2804
|
+
a !== 1 ? "s" : ""
|
|
2487
2805
|
] })
|
|
2488
2806
|
] }),
|
|
2489
|
-
r.tags && r.tags.length > 0 && /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1 mb-4", children: r.tags.slice(0, 4).map((
|
|
2807
|
+
r.tags && r.tags.length > 0 && /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1 mb-4", children: r.tags.slice(0, 4).map((d) => /* @__PURE__ */ e(
|
|
2490
2808
|
"span",
|
|
2491
2809
|
{
|
|
2492
2810
|
className: "px-2 py-0.5 bg-gray-100 dark:bg-zinc-700 text-gray-600 dark:text-zinc-400 rounded text-xs",
|
|
2493
|
-
children:
|
|
2811
|
+
children: d
|
|
2494
2812
|
},
|
|
2495
|
-
|
|
2813
|
+
d
|
|
2496
2814
|
)) }),
|
|
2497
2815
|
/* @__PURE__ */ e(
|
|
2498
2816
|
"button",
|
|
2499
2817
|
{
|
|
2500
|
-
onClick:
|
|
2818
|
+
onClick: i,
|
|
2501
2819
|
className: "w-full py-2 px-4 bg-teal-600 hover:bg-teal-700 text-white rounded-lg font-medium transition-colors",
|
|
2502
2820
|
children: "Use Template"
|
|
2503
2821
|
}
|
|
@@ -2505,67 +2823,67 @@ function mt({ template: r, onSelect: s }) {
|
|
|
2505
2823
|
] })
|
|
2506
2824
|
] });
|
|
2507
2825
|
}
|
|
2508
|
-
function
|
|
2826
|
+
function wt({
|
|
2509
2827
|
workflow: r,
|
|
2510
|
-
isActive:
|
|
2828
|
+
isActive: i,
|
|
2511
2829
|
onLoad: t,
|
|
2512
|
-
onDelete:
|
|
2513
|
-
onRename:
|
|
2514
|
-
onDuplicate:
|
|
2830
|
+
onDelete: a,
|
|
2831
|
+
onRename: s,
|
|
2832
|
+
onDuplicate: d
|
|
2515
2833
|
}) {
|
|
2516
|
-
const [
|
|
2517
|
-
|
|
2518
|
-
}, b = (
|
|
2519
|
-
const g = new Date(
|
|
2520
|
-
return
|
|
2834
|
+
const [m, o] = N(!1), [n, u] = N(r.name), [l, p] = N(!1), f = () => {
|
|
2835
|
+
n.trim() && n !== r.name && s(n.trim()), o(!1);
|
|
2836
|
+
}, b = (k) => {
|
|
2837
|
+
const g = new Date(k), w = (/* @__PURE__ */ new Date()).getTime() - g.getTime(), h = Math.floor(w / 6e4), z = Math.floor(w / 36e5), S = Math.floor(w / 864e5);
|
|
2838
|
+
return h < 1 ? "Just now" : h < 60 ? `${h}m ago` : z < 24 ? `${z}h ago` : S < 7 ? `${S}d ago` : g.toLocaleDateString();
|
|
2521
2839
|
};
|
|
2522
|
-
return /* @__PURE__ */
|
|
2840
|
+
return /* @__PURE__ */ c(
|
|
2523
2841
|
"div",
|
|
2524
2842
|
{
|
|
2525
|
-
className: `group relative p-3 rounded-lg border transition-colors ${
|
|
2843
|
+
className: `group relative p-3 rounded-lg border transition-colors ${i ? "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"}`,
|
|
2526
2844
|
children: [
|
|
2527
|
-
/* @__PURE__ */
|
|
2528
|
-
/* @__PURE__ */
|
|
2529
|
-
|
|
2845
|
+
/* @__PURE__ */ c("div", { className: "flex items-start justify-between gap-2", children: [
|
|
2846
|
+
/* @__PURE__ */ c("button", { onClick: t, className: "flex-1 text-left min-w-0", children: [
|
|
2847
|
+
m ? /* @__PURE__ */ e(
|
|
2530
2848
|
"input",
|
|
2531
2849
|
{
|
|
2532
2850
|
type: "text",
|
|
2533
|
-
value:
|
|
2534
|
-
onChange: (
|
|
2535
|
-
onBlur:
|
|
2536
|
-
onKeyDown: (
|
|
2537
|
-
|
|
2851
|
+
value: n,
|
|
2852
|
+
onChange: (k) => u(k.target.value),
|
|
2853
|
+
onBlur: f,
|
|
2854
|
+
onKeyDown: (k) => {
|
|
2855
|
+
k.key === "Enter" && f(), k.key === "Escape" && (u(r.name), o(!1));
|
|
2538
2856
|
},
|
|
2539
2857
|
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",
|
|
2540
2858
|
autoFocus: !0,
|
|
2541
|
-
onClick: (
|
|
2859
|
+
onClick: (k) => k.stopPropagation()
|
|
2542
2860
|
}
|
|
2543
2861
|
) : /* @__PURE__ */ e("span", { className: "block text-sm font-medium text-zinc-900 dark:text-zinc-100 truncate", children: r.name }),
|
|
2544
|
-
/* @__PURE__ */
|
|
2862
|
+
/* @__PURE__ */ c("span", { className: "block text-xs text-zinc-500 dark:text-zinc-400 mt-0.5", children: [
|
|
2545
2863
|
r.nodes.length,
|
|
2546
2864
|
" nodes · Updated ",
|
|
2547
2865
|
b(r.updatedAt)
|
|
2548
2866
|
] })
|
|
2549
2867
|
] }),
|
|
2550
|
-
/* @__PURE__ */
|
|
2868
|
+
/* @__PURE__ */ c("div", { className: "relative", children: [
|
|
2551
2869
|
/* @__PURE__ */ e(
|
|
2552
2870
|
"button",
|
|
2553
2871
|
{
|
|
2554
|
-
onClick: (
|
|
2555
|
-
|
|
2872
|
+
onClick: (k) => {
|
|
2873
|
+
k.stopPropagation(), p(!l);
|
|
2556
2874
|
},
|
|
2557
2875
|
className: "p-1 text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-300 rounded opacity-0 group-hover:opacity-100 transition-opacity",
|
|
2558
2876
|
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" }) })
|
|
2559
2877
|
}
|
|
2560
2878
|
),
|
|
2561
|
-
|
|
2879
|
+
l && /* @__PURE__ */ c(j, { children: [
|
|
2562
2880
|
/* @__PURE__ */ e("div", { className: "fixed inset-0 z-10", onClick: () => p(!1) }),
|
|
2563
|
-
/* @__PURE__ */
|
|
2881
|
+
/* @__PURE__ */ c("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: [
|
|
2564
2882
|
/* @__PURE__ */ e(
|
|
2565
2883
|
"button",
|
|
2566
2884
|
{
|
|
2567
|
-
onClick: (
|
|
2568
|
-
|
|
2885
|
+
onClick: (k) => {
|
|
2886
|
+
k.stopPropagation(), o(!0), p(!1);
|
|
2569
2887
|
},
|
|
2570
2888
|
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",
|
|
2571
2889
|
children: "Rename"
|
|
@@ -2574,8 +2892,8 @@ function ut({
|
|
|
2574
2892
|
/* @__PURE__ */ e(
|
|
2575
2893
|
"button",
|
|
2576
2894
|
{
|
|
2577
|
-
onClick: (
|
|
2578
|
-
|
|
2895
|
+
onClick: (k) => {
|
|
2896
|
+
k.stopPropagation(), d(), p(!1);
|
|
2579
2897
|
},
|
|
2580
2898
|
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",
|
|
2581
2899
|
children: "Duplicate"
|
|
@@ -2584,8 +2902,8 @@ function ut({
|
|
|
2584
2902
|
/* @__PURE__ */ e(
|
|
2585
2903
|
"button",
|
|
2586
2904
|
{
|
|
2587
|
-
onClick: (
|
|
2588
|
-
|
|
2905
|
+
onClick: (k) => {
|
|
2906
|
+
k.stopPropagation(), window.confirm("Delete this workflow?") && a(), p(!1);
|
|
2589
2907
|
},
|
|
2590
2908
|
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",
|
|
2591
2909
|
children: "Delete"
|
|
@@ -2595,24 +2913,24 @@ function ut({
|
|
|
2595
2913
|
] })
|
|
2596
2914
|
] })
|
|
2597
2915
|
] }),
|
|
2598
|
-
|
|
2916
|
+
i && /* @__PURE__ */ e("span", { className: "absolute top-2 right-2 w-2 h-2 bg-teal-500 rounded-full" })
|
|
2599
2917
|
]
|
|
2600
2918
|
}
|
|
2601
2919
|
);
|
|
2602
2920
|
}
|
|
2603
|
-
function
|
|
2604
|
-
const r =
|
|
2921
|
+
function vt() {
|
|
2922
|
+
const r = x((l) => l.showLibrary), i = x((l) => l.toggleLibrary), t = x((l) => l.savedWorkflows), a = x((l) => l.activeWorkflowId), s = x((l) => l.loadWorkflow), d = x((l) => l.deleteWorkflow), m = x((l) => l.renameWorkflow), o = x((l) => l.duplicateWorkflow), n = x((l) => l.newWorkflow);
|
|
2605
2923
|
if (!r) return null;
|
|
2606
|
-
const u = [...t].sort((
|
|
2607
|
-
return /* @__PURE__ */
|
|
2608
|
-
/* @__PURE__ */ e("div", { className: "fixed inset-0 bg-black/20 dark:bg-black/40 z-40", onClick:
|
|
2609
|
-
/* @__PURE__ */
|
|
2610
|
-
/* @__PURE__ */
|
|
2924
|
+
const u = [...t].sort((l, p) => p.updatedAt - l.updatedAt);
|
|
2925
|
+
return /* @__PURE__ */ c(j, { children: [
|
|
2926
|
+
/* @__PURE__ */ e("div", { className: "fixed inset-0 bg-black/20 dark:bg-black/40 z-40", onClick: i }),
|
|
2927
|
+
/* @__PURE__ */ c("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: [
|
|
2928
|
+
/* @__PURE__ */ c("div", { className: "flex items-center justify-between px-4 py-3 border-b border-zinc-200 dark:border-zinc-700", children: [
|
|
2611
2929
|
/* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-zinc-900 dark:text-zinc-100", children: "My Workflows" }),
|
|
2612
2930
|
/* @__PURE__ */ e(
|
|
2613
2931
|
"button",
|
|
2614
2932
|
{
|
|
2615
|
-
onClick:
|
|
2933
|
+
onClick: i,
|
|
2616
2934
|
className: "p-1 text-zinc-500 hover:text-zinc-700 dark:hover:text-zinc-300 rounded",
|
|
2617
2935
|
children: /* @__PURE__ */ e("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e(
|
|
2618
2936
|
"path",
|
|
@@ -2626,11 +2944,11 @@ function gt() {
|
|
|
2626
2944
|
}
|
|
2627
2945
|
)
|
|
2628
2946
|
] }),
|
|
2629
|
-
/* @__PURE__ */ e("div", { className: "p-4 border-b border-zinc-200 dark:border-zinc-700", children: /* @__PURE__ */
|
|
2947
|
+
/* @__PURE__ */ e("div", { className: "p-4 border-b border-zinc-200 dark:border-zinc-700", children: /* @__PURE__ */ c(
|
|
2630
2948
|
"button",
|
|
2631
2949
|
{
|
|
2632
2950
|
onClick: () => {
|
|
2633
|
-
|
|
2951
|
+
n(), i(), window.dispatchEvent(new window.CustomEvent("new-workflow-created"));
|
|
2634
2952
|
},
|
|
2635
2953
|
className: "w-full flex items-center justify-center gap-2 px-4 py-2 text-sm font-medium text-white bg-teal-600 rounded-lg hover:bg-teal-700 transition-colors",
|
|
2636
2954
|
children: [
|
|
@@ -2647,7 +2965,7 @@ function gt() {
|
|
|
2647
2965
|
]
|
|
2648
2966
|
}
|
|
2649
2967
|
) }),
|
|
2650
|
-
/* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto p-4", children: u.length === 0 ? /* @__PURE__ */
|
|
2968
|
+
/* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto p-4", children: u.length === 0 ? /* @__PURE__ */ c("div", { className: "text-center py-8", children: [
|
|
2651
2969
|
/* @__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(
|
|
2652
2970
|
"svg",
|
|
2653
2971
|
{
|
|
@@ -2668,21 +2986,21 @@ function gt() {
|
|
|
2668
2986
|
) }),
|
|
2669
2987
|
/* @__PURE__ */ e("p", { className: "text-sm text-zinc-500 dark:text-zinc-400", children: "No saved workflows yet" }),
|
|
2670
2988
|
/* @__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" })
|
|
2671
|
-
] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: u.map((
|
|
2672
|
-
|
|
2989
|
+
] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: u.map((l) => /* @__PURE__ */ e(
|
|
2990
|
+
wt,
|
|
2673
2991
|
{
|
|
2674
|
-
workflow:
|
|
2675
|
-
isActive:
|
|
2992
|
+
workflow: l,
|
|
2993
|
+
isActive: l.id === a,
|
|
2676
2994
|
onLoad: () => {
|
|
2677
|
-
|
|
2995
|
+
s(l.id), i();
|
|
2678
2996
|
},
|
|
2679
|
-
onDelete: () =>
|
|
2680
|
-
onRename: (p) => l
|
|
2681
|
-
onDuplicate: () =>
|
|
2997
|
+
onDelete: () => d(l.id),
|
|
2998
|
+
onRename: (p) => m(l.id, p),
|
|
2999
|
+
onDuplicate: () => o(l.id)
|
|
2682
3000
|
},
|
|
2683
|
-
|
|
3001
|
+
l.id
|
|
2684
3002
|
)) }) }),
|
|
2685
|
-
/* @__PURE__ */
|
|
3003
|
+
/* @__PURE__ */ c("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: [
|
|
2686
3004
|
t.length,
|
|
2687
3005
|
" workflow",
|
|
2688
3006
|
t.length !== 1 ? "s" : "",
|
|
@@ -2691,7 +3009,7 @@ function gt() {
|
|
|
2691
3009
|
] })
|
|
2692
3010
|
] });
|
|
2693
3011
|
}
|
|
2694
|
-
const
|
|
3012
|
+
const yt = [
|
|
2695
3013
|
{
|
|
2696
3014
|
id: "openai",
|
|
2697
3015
|
name: "OpenAI",
|
|
@@ -2720,7 +3038,7 @@ const pt = [
|
|
|
2720
3038
|
placeholder: "sk-or-...",
|
|
2721
3039
|
docsUrl: "https://openrouter.ai/keys"
|
|
2722
3040
|
}
|
|
2723
|
-
],
|
|
3041
|
+
], Nt = [
|
|
2724
3042
|
{
|
|
2725
3043
|
id: "ollama",
|
|
2726
3044
|
name: "Ollama",
|
|
@@ -2736,21 +3054,21 @@ const pt = [
|
|
|
2736
3054
|
docsUrl: "https://lmstudio.ai"
|
|
2737
3055
|
}
|
|
2738
3056
|
];
|
|
2739
|
-
function
|
|
2740
|
-
const
|
|
3057
|
+
function zt({ provider: r }) {
|
|
3058
|
+
const i = $((f) => f.ai), t = $((f) => f.setAIProvider), a = i[r.id], s = (a == null ? void 0 : a.enabled) ?? !1, d = (a == null ? void 0 : a.apiKey) ?? "", [m, o] = N(d), [n, u] = N(!1), l = () => {
|
|
2741
3059
|
t(r.id, {
|
|
2742
|
-
apiKey:
|
|
2743
|
-
enabled: !
|
|
3060
|
+
apiKey: m,
|
|
3061
|
+
enabled: !s
|
|
2744
3062
|
});
|
|
2745
|
-
}, p = (
|
|
2746
|
-
|
|
2747
|
-
apiKey:
|
|
2748
|
-
enabled:
|
|
3063
|
+
}, p = (f) => {
|
|
3064
|
+
o(f), t(r.id, {
|
|
3065
|
+
apiKey: f,
|
|
3066
|
+
enabled: s
|
|
2749
3067
|
});
|
|
2750
3068
|
};
|
|
2751
|
-
return /* @__PURE__ */
|
|
2752
|
-
/* @__PURE__ */
|
|
2753
|
-
/* @__PURE__ */
|
|
3069
|
+
return /* @__PURE__ */ c("div", { className: "flex items-start gap-4 p-4 border border-gray-200 dark:border-zinc-700 rounded-lg", children: [
|
|
3070
|
+
/* @__PURE__ */ c("div", { className: "flex-1 min-w-0", children: [
|
|
3071
|
+
/* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
|
|
2754
3072
|
/* @__PURE__ */ e("span", { className: "font-medium text-gray-900 dark:text-white", children: r.name }),
|
|
2755
3073
|
/* @__PURE__ */ e(
|
|
2756
3074
|
"a",
|
|
@@ -2764,13 +3082,13 @@ function ft({ provider: r }) {
|
|
|
2764
3082
|
)
|
|
2765
3083
|
] }),
|
|
2766
3084
|
/* @__PURE__ */ e("p", { className: "text-sm text-gray-500 dark:text-zinc-400 mt-0.5", children: r.description }),
|
|
2767
|
-
/* @__PURE__ */ e("div", { className: "mt-2 flex items-center gap-2", children: /* @__PURE__ */
|
|
3085
|
+
/* @__PURE__ */ e("div", { className: "mt-2 flex items-center gap-2", children: /* @__PURE__ */ c("div", { className: "relative flex-1", children: [
|
|
2768
3086
|
/* @__PURE__ */ e(
|
|
2769
3087
|
"input",
|
|
2770
3088
|
{
|
|
2771
|
-
type:
|
|
2772
|
-
value:
|
|
2773
|
-
onChange: (
|
|
3089
|
+
type: n ? "text" : "password",
|
|
3090
|
+
value: m,
|
|
3091
|
+
onChange: (f) => p(f.target.value),
|
|
2774
3092
|
placeholder: r.placeholder,
|
|
2775
3093
|
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"
|
|
2776
3094
|
}
|
|
@@ -2779,9 +3097,9 @@ function ft({ provider: r }) {
|
|
|
2779
3097
|
"button",
|
|
2780
3098
|
{
|
|
2781
3099
|
type: "button",
|
|
2782
|
-
onClick: () => u(!
|
|
3100
|
+
onClick: () => u(!n),
|
|
2783
3101
|
className: "absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600 dark:hover:text-zinc-300",
|
|
2784
|
-
children: /* @__PURE__ */ e("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children:
|
|
3102
|
+
children: /* @__PURE__ */ e("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: n ? /* @__PURE__ */ e(
|
|
2785
3103
|
"path",
|
|
2786
3104
|
{
|
|
2787
3105
|
strokeLinecap: "round",
|
|
@@ -2805,33 +3123,33 @@ function ft({ provider: r }) {
|
|
|
2805
3123
|
/* @__PURE__ */ e("div", { className: "flex items-center", children: /* @__PURE__ */ e(
|
|
2806
3124
|
"button",
|
|
2807
3125
|
{
|
|
2808
|
-
onClick:
|
|
2809
|
-
className: `relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${
|
|
3126
|
+
onClick: l,
|
|
3127
|
+
className: `relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${s ? "bg-teal-600" : "bg-gray-300 dark:bg-zinc-600"}`,
|
|
2810
3128
|
children: /* @__PURE__ */ e(
|
|
2811
3129
|
"span",
|
|
2812
3130
|
{
|
|
2813
|
-
className: `inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${
|
|
3131
|
+
className: `inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${s ? "translate-x-6" : "translate-x-1"}`
|
|
2814
3132
|
}
|
|
2815
3133
|
)
|
|
2816
3134
|
}
|
|
2817
3135
|
) })
|
|
2818
3136
|
] });
|
|
2819
3137
|
}
|
|
2820
|
-
function
|
|
2821
|
-
const
|
|
3138
|
+
function Ct({ provider: r }) {
|
|
3139
|
+
const i = $((l) => l.ai), t = $((l) => l.setAIProvider), a = i[r.id], s = (a == null ? void 0 : a.enabled) ?? !1, d = (a == null ? void 0 : a.baseUrl) ?? r.defaultUrl, [m, o] = N(d), n = () => {
|
|
2822
3140
|
t(r.id, {
|
|
2823
|
-
baseUrl:
|
|
2824
|
-
enabled: !
|
|
3141
|
+
baseUrl: m,
|
|
3142
|
+
enabled: !s
|
|
2825
3143
|
});
|
|
2826
|
-
}, u = (
|
|
2827
|
-
|
|
2828
|
-
baseUrl:
|
|
2829
|
-
enabled:
|
|
3144
|
+
}, u = (l) => {
|
|
3145
|
+
o(l), t(r.id, {
|
|
3146
|
+
baseUrl: l,
|
|
3147
|
+
enabled: s
|
|
2830
3148
|
});
|
|
2831
3149
|
};
|
|
2832
|
-
return /* @__PURE__ */
|
|
2833
|
-
/* @__PURE__ */
|
|
2834
|
-
/* @__PURE__ */
|
|
3150
|
+
return /* @__PURE__ */ c("div", { className: "flex items-start gap-4 p-4 border border-gray-200 dark:border-zinc-700 rounded-lg", children: [
|
|
3151
|
+
/* @__PURE__ */ c("div", { className: "flex-1 min-w-0", children: [
|
|
3152
|
+
/* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
|
|
2835
3153
|
/* @__PURE__ */ e("span", { className: "font-medium text-gray-900 dark:text-white", children: r.name }),
|
|
2836
3154
|
/* @__PURE__ */ e(
|
|
2837
3155
|
"a",
|
|
@@ -2850,8 +3168,8 @@ function bt({ provider: r }) {
|
|
|
2850
3168
|
"input",
|
|
2851
3169
|
{
|
|
2852
3170
|
type: "text",
|
|
2853
|
-
value:
|
|
2854
|
-
onChange: (
|
|
3171
|
+
value: m,
|
|
3172
|
+
onChange: (l) => u(l.target.value),
|
|
2855
3173
|
placeholder: r.defaultUrl,
|
|
2856
3174
|
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"
|
|
2857
3175
|
}
|
|
@@ -2860,30 +3178,30 @@ function bt({ provider: r }) {
|
|
|
2860
3178
|
/* @__PURE__ */ e("div", { className: "flex items-center", children: /* @__PURE__ */ e(
|
|
2861
3179
|
"button",
|
|
2862
3180
|
{
|
|
2863
|
-
onClick:
|
|
2864
|
-
className: `relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${
|
|
3181
|
+
onClick: n,
|
|
3182
|
+
className: `relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${s ? "bg-teal-600" : "bg-gray-300 dark:bg-zinc-600"}`,
|
|
2865
3183
|
children: /* @__PURE__ */ e(
|
|
2866
3184
|
"span",
|
|
2867
3185
|
{
|
|
2868
|
-
className: `inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${
|
|
3186
|
+
className: `inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${s ? "translate-x-6" : "translate-x-1"}`
|
|
2869
3187
|
}
|
|
2870
3188
|
)
|
|
2871
3189
|
}
|
|
2872
3190
|
) })
|
|
2873
3191
|
] });
|
|
2874
3192
|
}
|
|
2875
|
-
function
|
|
2876
|
-
const r =
|
|
2877
|
-
return r ? /* @__PURE__ */ e("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50", children: /* @__PURE__ */
|
|
2878
|
-
/* @__PURE__ */
|
|
2879
|
-
/* @__PURE__ */
|
|
3193
|
+
function St() {
|
|
3194
|
+
const r = $((t) => t.showSettings), i = $((t) => t.closeSettings);
|
|
3195
|
+
return r ? /* @__PURE__ */ e("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50", children: /* @__PURE__ */ c("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: [
|
|
3196
|
+
/* @__PURE__ */ c("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-200 dark:border-zinc-700", children: [
|
|
3197
|
+
/* @__PURE__ */ c("div", { children: [
|
|
2880
3198
|
/* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-gray-900 dark:text-white", children: "AI Provider Settings" }),
|
|
2881
3199
|
/* @__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" })
|
|
2882
3200
|
] }),
|
|
2883
3201
|
/* @__PURE__ */ e(
|
|
2884
3202
|
"button",
|
|
2885
3203
|
{
|
|
2886
|
-
onClick:
|
|
3204
|
+
onClick: i,
|
|
2887
3205
|
className: "text-gray-500 dark:text-zinc-400 hover:text-gray-700 dark:hover:text-zinc-200",
|
|
2888
3206
|
children: /* @__PURE__ */ e("svg", { className: "h-6 w-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e(
|
|
2889
3207
|
"path",
|
|
@@ -2897,16 +3215,16 @@ function xt() {
|
|
|
2897
3215
|
}
|
|
2898
3216
|
)
|
|
2899
3217
|
] }),
|
|
2900
|
-
/* @__PURE__ */
|
|
2901
|
-
/* @__PURE__ */
|
|
3218
|
+
/* @__PURE__ */ c("div", { className: "flex-1 overflow-y-auto p-6 space-y-6", children: [
|
|
3219
|
+
/* @__PURE__ */ c("section", { children: [
|
|
2902
3220
|
/* @__PURE__ */ e("h3", { className: "text-sm font-medium text-gray-700 dark:text-zinc-300 mb-3", children: "Cloud Providers" }),
|
|
2903
|
-
/* @__PURE__ */ e("div", { className: "space-y-3", children:
|
|
3221
|
+
/* @__PURE__ */ e("div", { className: "space-y-3", children: yt.map((t) => /* @__PURE__ */ e(zt, { provider: t }, t.id)) })
|
|
2904
3222
|
] }),
|
|
2905
|
-
/* @__PURE__ */
|
|
3223
|
+
/* @__PURE__ */ c("section", { children: [
|
|
2906
3224
|
/* @__PURE__ */ e("h3", { className: "text-sm font-medium text-gray-700 dark:text-zinc-300 mb-3", children: "Local Providers" }),
|
|
2907
|
-
/* @__PURE__ */ e("div", { className: "space-y-3", children:
|
|
3225
|
+
/* @__PURE__ */ e("div", { className: "space-y-3", children: Nt.map((t) => /* @__PURE__ */ e(Ct, { provider: t }, t.id)) })
|
|
2908
3226
|
] }),
|
|
2909
|
-
/* @__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__ */
|
|
3227
|
+
/* @__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__ */ c("div", { className: "flex items-start gap-3", children: [
|
|
2910
3228
|
/* @__PURE__ */ e(
|
|
2911
3229
|
"svg",
|
|
2912
3230
|
{
|
|
@@ -2925,7 +3243,7 @@ function xt() {
|
|
|
2925
3243
|
)
|
|
2926
3244
|
}
|
|
2927
3245
|
),
|
|
2928
|
-
/* @__PURE__ */
|
|
3246
|
+
/* @__PURE__ */ c("div", { children: [
|
|
2929
3247
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium text-blue-900 dark:text-blue-300", children: "Your keys stay local" }),
|
|
2930
3248
|
/* @__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." })
|
|
2931
3249
|
] })
|
|
@@ -2934,67 +3252,67 @@ function xt() {
|
|
|
2934
3252
|
/* @__PURE__ */ e("div", { className: "flex justify-end px-6 py-4 border-t border-gray-200 dark:border-zinc-700", children: /* @__PURE__ */ e(
|
|
2935
3253
|
"button",
|
|
2936
3254
|
{
|
|
2937
|
-
onClick:
|
|
3255
|
+
onClick: i,
|
|
2938
3256
|
className: "px-4 py-2 text-sm font-medium text-white bg-teal-600 rounded-md hover:bg-teal-700",
|
|
2939
3257
|
children: "Done"
|
|
2940
3258
|
}
|
|
2941
3259
|
) })
|
|
2942
3260
|
] }) }) : null;
|
|
2943
3261
|
}
|
|
2944
|
-
function
|
|
2945
|
-
const [r,
|
|
2946
|
-
|
|
2947
|
-
const
|
|
2948
|
-
if (
|
|
2949
|
-
const u =
|
|
2950
|
-
u && (
|
|
3262
|
+
function Ut() {
|
|
3263
|
+
const [r, i] = N("editor"), t = x((o) => o.addNode), a = x((o) => o.loadTemplate);
|
|
3264
|
+
M(() => {
|
|
3265
|
+
const n = new URLSearchParams(window.location.search).get("template");
|
|
3266
|
+
if (n) {
|
|
3267
|
+
const u = ne(n);
|
|
3268
|
+
u && (a(u), window.history.replaceState({}, "", window.location.pathname));
|
|
2951
3269
|
}
|
|
2952
|
-
}, [
|
|
2953
|
-
const
|
|
2954
|
-
|
|
3270
|
+
}, [a]), M(() => {
|
|
3271
|
+
const o = () => {
|
|
3272
|
+
i("editor");
|
|
2955
3273
|
};
|
|
2956
|
-
return window.addEventListener("workflow-loaded",
|
|
2957
|
-
window.removeEventListener("workflow-loaded",
|
|
3274
|
+
return window.addEventListener("workflow-loaded", o), () => {
|
|
3275
|
+
window.removeEventListener("workflow-loaded", o);
|
|
2958
3276
|
};
|
|
2959
3277
|
}, []);
|
|
2960
|
-
const
|
|
2961
|
-
(
|
|
2962
|
-
const
|
|
2963
|
-
|
|
3278
|
+
const s = C(
|
|
3279
|
+
(o) => {
|
|
3280
|
+
const n = ne(o);
|
|
3281
|
+
n && (a(n), i("editor"));
|
|
2964
3282
|
},
|
|
2965
|
-
[
|
|
2966
|
-
),
|
|
2967
|
-
(
|
|
3283
|
+
[a]
|
|
3284
|
+
), d = C(
|
|
3285
|
+
(o) => {
|
|
2968
3286
|
var u;
|
|
2969
|
-
|
|
2970
|
-
const
|
|
2971
|
-
if (
|
|
3287
|
+
o.preventDefault();
|
|
3288
|
+
const n = o.dataTransfer.getData("application/json");
|
|
3289
|
+
if (n)
|
|
2972
3290
|
try {
|
|
2973
|
-
const
|
|
3291
|
+
const l = JSON.parse(n), p = (u = document.querySelector(".react-flow")) == null ? void 0 : u.getBoundingClientRect();
|
|
2974
3292
|
if (!p) return;
|
|
2975
|
-
const
|
|
2976
|
-
x:
|
|
2977
|
-
y:
|
|
3293
|
+
const f = {
|
|
3294
|
+
x: o.clientX - p.left,
|
|
3295
|
+
y: o.clientY - p.top
|
|
2978
3296
|
};
|
|
2979
|
-
t(
|
|
2980
|
-
} catch (
|
|
2981
|
-
console.error("Failed to parse dropped node:",
|
|
3297
|
+
t(l, f);
|
|
3298
|
+
} catch (l) {
|
|
3299
|
+
console.error("Failed to parse dropped node:", l);
|
|
2982
3300
|
}
|
|
2983
3301
|
},
|
|
2984
3302
|
[t]
|
|
2985
|
-
),
|
|
2986
|
-
|
|
3303
|
+
), m = C((o) => {
|
|
3304
|
+
o.preventDefault(), o.dataTransfer.dropEffect = "move";
|
|
2987
3305
|
}, []);
|
|
2988
|
-
return /* @__PURE__ */
|
|
2989
|
-
/* @__PURE__ */ e(
|
|
2990
|
-
/* @__PURE__ */ e(
|
|
2991
|
-
/* @__PURE__ */
|
|
2992
|
-
/* @__PURE__ */ e(
|
|
2993
|
-
/* @__PURE__ */ e("div", { className: "bg-white dark:bg-zinc-800 border-b border-gray-200 dark:border-zinc-700", children: /* @__PURE__ */
|
|
3306
|
+
return /* @__PURE__ */ c(Se, { children: [
|
|
3307
|
+
/* @__PURE__ */ e(St, {}),
|
|
3308
|
+
/* @__PURE__ */ e(vt, {}),
|
|
3309
|
+
/* @__PURE__ */ c("div", { className: "h-screen flex flex-col bg-gray-100 dark:bg-zinc-900", children: [
|
|
3310
|
+
/* @__PURE__ */ e(nt, {}),
|
|
3311
|
+
/* @__PURE__ */ e("div", { className: "bg-white dark:bg-zinc-800 border-b border-gray-200 dark:border-zinc-700", children: /* @__PURE__ */ c("div", { className: "flex", children: [
|
|
2994
3312
|
/* @__PURE__ */ e(
|
|
2995
3313
|
"button",
|
|
2996
3314
|
{
|
|
2997
|
-
onClick: () =>
|
|
3315
|
+
onClick: () => i("editor"),
|
|
2998
3316
|
className: `px-6 py-3 text-sm font-medium border-b-2 transition-colors ${r === "editor" ? "border-teal-500 text-teal-600 dark:text-teal-400" : "border-transparent text-gray-500 dark:text-zinc-400 hover:text-gray-700 dark:hover:text-zinc-200"}`,
|
|
2999
3317
|
children: "Editor"
|
|
3000
3318
|
}
|
|
@@ -3002,7 +3320,7 @@ function St() {
|
|
|
3002
3320
|
/* @__PURE__ */ e(
|
|
3003
3321
|
"button",
|
|
3004
3322
|
{
|
|
3005
|
-
onClick: () =>
|
|
3323
|
+
onClick: () => i("gallery"),
|
|
3006
3324
|
className: `px-6 py-3 text-sm font-medium border-b-2 transition-colors ${r === "gallery" ? "border-teal-500 text-teal-600 dark:text-teal-400" : "border-transparent text-gray-500 dark:text-zinc-400 hover:text-gray-700 dark:hover:text-zinc-200"}`,
|
|
3007
3325
|
children: "Gallery"
|
|
3008
3326
|
}
|
|
@@ -3010,40 +3328,40 @@ function St() {
|
|
|
3010
3328
|
/* @__PURE__ */ e(
|
|
3011
3329
|
"button",
|
|
3012
3330
|
{
|
|
3013
|
-
onClick: () =>
|
|
3331
|
+
onClick: () => i("templates"),
|
|
3014
3332
|
className: `px-6 py-3 text-sm font-medium border-b-2 transition-colors ${r === "templates" ? "border-teal-500 text-teal-600 dark:text-teal-400" : "border-transparent text-gray-500 dark:text-zinc-400 hover:text-gray-700 dark:hover:text-zinc-200"}`,
|
|
3015
3333
|
children: "Templates"
|
|
3016
3334
|
}
|
|
3017
3335
|
)
|
|
3018
3336
|
] }) }),
|
|
3019
|
-
/* @__PURE__ */
|
|
3020
|
-
r === "editor" && /* @__PURE__ */
|
|
3021
|
-
/* @__PURE__ */ e(
|
|
3022
|
-
/* @__PURE__ */ e("div", { className: "flex-1", onDrop:
|
|
3023
|
-
/* @__PURE__ */ e(
|
|
3337
|
+
/* @__PURE__ */ c("div", { className: "flex-1 flex overflow-hidden", children: [
|
|
3338
|
+
r === "editor" && /* @__PURE__ */ c(j, { children: [
|
|
3339
|
+
/* @__PURE__ */ e(Ye, {}),
|
|
3340
|
+
/* @__PURE__ */ e("div", { className: "flex-1", onDrop: d, onDragOver: m, children: /* @__PURE__ */ e(Qe, {}) }),
|
|
3341
|
+
/* @__PURE__ */ e(Xe, {})
|
|
3024
3342
|
] }),
|
|
3025
|
-
r === "gallery" && /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: /* @__PURE__ */ e(
|
|
3026
|
-
r === "templates" && /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: /* @__PURE__ */ e(
|
|
3343
|
+
r === "gallery" && /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: /* @__PURE__ */ e(st, {}) }),
|
|
3344
|
+
r === "templates" && /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: /* @__PURE__ */ e(xt, { onSelect: s }) })
|
|
3027
3345
|
] })
|
|
3028
3346
|
] })
|
|
3029
3347
|
] });
|
|
3030
3348
|
}
|
|
3031
3349
|
export {
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3350
|
+
St as AISettings,
|
|
3351
|
+
Ut as App,
|
|
3352
|
+
st as Gallery,
|
|
3353
|
+
Xe as NodeInspector,
|
|
3354
|
+
Ye as NodePalette,
|
|
3355
|
+
xt as TemplateGallery,
|
|
3356
|
+
nt as Toolbar,
|
|
3357
|
+
Je as UploadGallery,
|
|
3358
|
+
Qe as WorkflowEditor,
|
|
3359
|
+
vt as WorkflowLibrary,
|
|
3360
|
+
bt as getCategories,
|
|
3361
|
+
ne as getTemplateById,
|
|
3362
|
+
$t as getTemplatesByCategory,
|
|
3363
|
+
Mt as searchTemplates,
|
|
3364
|
+
O as templates,
|
|
3365
|
+
x as useWorkflowStore
|
|
3048
3366
|
};
|
|
3049
3367
|
//# sourceMappingURL=index.js.map
|