@teamflojo/floimg-studio-ui 0.4.3 → 0.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +369 -375
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -13,8 +13,8 @@ function De(r, d) {
|
|
|
13
13
|
return {
|
|
14
14
|
getItem: (a) => {
|
|
15
15
|
var o;
|
|
16
|
-
const
|
|
17
|
-
return c instanceof Promise ? c.then(
|
|
16
|
+
const m = (s) => s === null ? null : JSON.parse(s, void 0), c = (o = n.getItem(a)) != null ? o : null;
|
|
17
|
+
return c instanceof Promise ? c.then(m) : m(c);
|
|
18
18
|
},
|
|
19
19
|
setItem: (a, o) => n.setItem(a, JSON.stringify(o, void 0)),
|
|
20
20
|
removeItem: (a) => n.removeItem(a)
|
|
@@ -51,10 +51,10 @@ const le = (r) => (d) => {
|
|
|
51
51
|
...y
|
|
52
52
|
}),
|
|
53
53
|
...d
|
|
54
|
-
},
|
|
54
|
+
}, m = !1;
|
|
55
55
|
const c = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set();
|
|
56
|
-
let
|
|
57
|
-
if (!
|
|
56
|
+
let p = o.storage;
|
|
57
|
+
if (!p)
|
|
58
58
|
return r(
|
|
59
59
|
(...y) => {
|
|
60
60
|
console.warn(
|
|
@@ -66,7 +66,7 @@ const le = (r) => (d) => {
|
|
|
66
66
|
);
|
|
67
67
|
const l = () => {
|
|
68
68
|
const y = o.partialize({ ...t() });
|
|
69
|
-
return
|
|
69
|
+
return p.setItem(o.name, {
|
|
70
70
|
state: y,
|
|
71
71
|
version: o.version
|
|
72
72
|
});
|
|
@@ -81,13 +81,13 @@ const le = (r) => (d) => {
|
|
|
81
81
|
let f;
|
|
82
82
|
const h = () => {
|
|
83
83
|
var y, v;
|
|
84
|
-
if (!
|
|
85
|
-
|
|
84
|
+
if (!p) return;
|
|
85
|
+
m = !1, c.forEach((u) => {
|
|
86
86
|
var x;
|
|
87
87
|
return u((x = t()) != null ? x : b);
|
|
88
88
|
});
|
|
89
89
|
const C = ((v = o.onRehydrateStorage) == null ? void 0 : v.call(o, (y = t()) != null ? y : b)) || void 0;
|
|
90
|
-
return le(
|
|
90
|
+
return le(p.getItem.bind(p))(o.name).then((u) => {
|
|
91
91
|
if (u)
|
|
92
92
|
if (typeof u.version == "number" && u.version !== o.version) {
|
|
93
93
|
if (o.migrate) {
|
|
@@ -105,14 +105,14 @@ const le = (r) => (d) => {
|
|
|
105
105
|
return [!1, void 0];
|
|
106
106
|
}).then((u) => {
|
|
107
107
|
var x;
|
|
108
|
-
const [N,
|
|
108
|
+
const [N, k] = u;
|
|
109
109
|
if (f = o.merge(
|
|
110
|
-
|
|
110
|
+
k,
|
|
111
111
|
(x = t()) != null ? x : b
|
|
112
112
|
), n(f, !0), N)
|
|
113
113
|
return l();
|
|
114
114
|
}).then(() => {
|
|
115
|
-
C == null || C(f, void 0), f = t(),
|
|
115
|
+
C == null || C(f, void 0), f = t(), m = !0, s.forEach((u) => u(f));
|
|
116
116
|
}).catch((u) => {
|
|
117
117
|
C == null || C(void 0, u);
|
|
118
118
|
});
|
|
@@ -122,14 +122,14 @@ const le = (r) => (d) => {
|
|
|
122
122
|
o = {
|
|
123
123
|
...o,
|
|
124
124
|
...y
|
|
125
|
-
}, y.storage && (
|
|
125
|
+
}, y.storage && (p = y.storage);
|
|
126
126
|
},
|
|
127
127
|
clearStorage: () => {
|
|
128
|
-
|
|
128
|
+
p == null || p.removeItem(o.name);
|
|
129
129
|
},
|
|
130
130
|
getOptions: () => o,
|
|
131
131
|
rehydrate: () => h(),
|
|
132
|
-
hasHydrated: () =>
|
|
132
|
+
hasHydrated: () => m,
|
|
133
133
|
onHydrate: (y) => (c.add(y), () => {
|
|
134
134
|
c.delete(y);
|
|
135
135
|
}),
|
|
@@ -137,7 +137,7 @@ const le = (r) => (d) => {
|
|
|
137
137
|
s.delete(y);
|
|
138
138
|
})
|
|
139
139
|
}, o.skipHydration || h(), f || b;
|
|
140
|
-
},
|
|
140
|
+
}, ke = $e, R = "/api";
|
|
141
141
|
async function $(r, d) {
|
|
142
142
|
const n = await fetch(r, {
|
|
143
143
|
...d,
|
|
@@ -206,7 +206,7 @@ async function Je(r) {
|
|
|
206
206
|
if (!d.ok)
|
|
207
207
|
throw new Error(`Failed to delete upload: ${d.status}`);
|
|
208
208
|
}
|
|
209
|
-
function
|
|
209
|
+
function we(r) {
|
|
210
210
|
return `${R}/uploads/${r}/blob`;
|
|
211
211
|
}
|
|
212
212
|
async function Qe(r) {
|
|
@@ -236,17 +236,17 @@ function ve(r, d, n) {
|
|
|
236
236
|
signal: t.signal
|
|
237
237
|
});
|
|
238
238
|
if (!o.ok) {
|
|
239
|
-
const
|
|
240
|
-
throw new Error(
|
|
239
|
+
const p = await o.json().catch(() => ({ error: "Unknown error" }));
|
|
240
|
+
throw new Error(p.error || `HTTP ${o.status}`);
|
|
241
241
|
}
|
|
242
|
-
const
|
|
243
|
-
if (!
|
|
242
|
+
const m = (a = o.body) == null ? void 0 : a.getReader();
|
|
243
|
+
if (!m)
|
|
244
244
|
throw new Error("Response body is not readable");
|
|
245
245
|
const c = new globalThis.TextDecoder();
|
|
246
246
|
let s = "";
|
|
247
247
|
for (; ; ) {
|
|
248
|
-
const { done:
|
|
249
|
-
if (
|
|
248
|
+
const { done: p, value: l } = await m.read();
|
|
249
|
+
if (p) {
|
|
250
250
|
s.trim() && et(s, n);
|
|
251
251
|
break;
|
|
252
252
|
}
|
|
@@ -309,7 +309,7 @@ function et(r, d) {
|
|
|
309
309
|
}
|
|
310
310
|
}
|
|
311
311
|
const he = "http://localhost:11434", fe = "http://localhost:1234", G = ye()(
|
|
312
|
-
|
|
312
|
+
ke(
|
|
313
313
|
(r, d) => ({
|
|
314
314
|
ai: {
|
|
315
315
|
ollama: {
|
|
@@ -339,9 +339,9 @@ const he = "http://localhost:11434", fe = "http://localhost:1234", G = ye()(
|
|
|
339
339
|
openSettings: () => r({ showSettings: !0 }),
|
|
340
340
|
closeSettings: () => r({ showSettings: !1 }),
|
|
341
341
|
getConfiguredProviders: () => {
|
|
342
|
-
var a, o,
|
|
342
|
+
var a, o, m, c, s, p, l;
|
|
343
343
|
const { ai: n } = d(), t = {};
|
|
344
|
-
return (a = n.openai) != null && a.enabled && n.openai.apiKey && (t.openai = { apiKey: n.openai.apiKey }), (o = n.anthropic) != null && o.enabled && n.anthropic.apiKey && (t.anthropic = { apiKey: n.anthropic.apiKey }), (
|
|
344
|
+
return (a = n.openai) != null && a.enabled && n.openai.apiKey && (t.openai = { apiKey: n.openai.apiKey }), (o = n.anthropic) != null && o.enabled && n.anthropic.apiKey && (t.anthropic = { apiKey: n.anthropic.apiKey }), (m = n.gemini) != null && m.enabled && n.gemini.apiKey && (t.gemini = { apiKey: n.gemini.apiKey }), (c = n.grok) != null && c.enabled && n.grok.apiKey && (t.grok = { apiKey: n.grok.apiKey }), (s = n.openrouter) != null && s.enabled && n.openrouter.apiKey && (t.openrouter = { apiKey: n.openrouter.apiKey }), (p = n.ollama) != null && p.enabled && (t.ollama = { baseUrl: n.ollama.baseUrl || he }), (l = n.lmstudio) != null && l.enabled && (t.lmstudio = { baseUrl: n.lmstudio.baseUrl || fe }), t;
|
|
345
345
|
}
|
|
346
346
|
}),
|
|
347
347
|
{
|
|
@@ -359,12 +359,12 @@ function be() {
|
|
|
359
359
|
const r = Date.now(), d = Math.random().toString(36).substring(2, 8);
|
|
360
360
|
return `wf_${r}_${d}`;
|
|
361
361
|
}
|
|
362
|
-
const
|
|
363
|
-
|
|
362
|
+
const w = ye()(
|
|
363
|
+
ke(
|
|
364
364
|
(r, d) => {
|
|
365
365
|
const n = (t) => {
|
|
366
366
|
if (t.type === "generator") {
|
|
367
|
-
const a = t.data, o = d().generators.find((
|
|
367
|
+
const a = t.data, o = d().generators.find((m) => m.name === a.generatorName);
|
|
368
368
|
return {
|
|
369
369
|
...a,
|
|
370
370
|
isAI: a.isAI ?? (o == null ? void 0 : o.isAI),
|
|
@@ -374,7 +374,7 @@ const k = ye()(
|
|
|
374
374
|
}
|
|
375
375
|
if (t.type === "transform") {
|
|
376
376
|
const a = t.data, o = d().transforms.find(
|
|
377
|
-
(
|
|
377
|
+
(m) => m.name === a.operation && m.providerName === a.providerName
|
|
378
378
|
);
|
|
379
379
|
return {
|
|
380
380
|
...a,
|
|
@@ -422,17 +422,17 @@ const k = ye()(
|
|
|
422
422
|
position: c.position,
|
|
423
423
|
data: n(c)
|
|
424
424
|
};
|
|
425
|
-
}),
|
|
426
|
-
const s = a.get(c.source) || c.source,
|
|
425
|
+
}), m = t.workflow.edges.map((c) => {
|
|
426
|
+
const s = a.get(c.source) || c.source, p = a.get(c.target) || c.target;
|
|
427
427
|
return {
|
|
428
|
-
id: `edge_${s}_${
|
|
428
|
+
id: `edge_${s}_${p}`,
|
|
429
429
|
source: s,
|
|
430
|
-
target:
|
|
430
|
+
target: p
|
|
431
431
|
};
|
|
432
432
|
});
|
|
433
433
|
r({
|
|
434
434
|
nodes: o,
|
|
435
|
-
edges:
|
|
435
|
+
edges: m,
|
|
436
436
|
selectedNodeId: null,
|
|
437
437
|
currentTemplateId: t.id,
|
|
438
438
|
previewVisible: {},
|
|
@@ -477,11 +477,11 @@ const k = ye()(
|
|
|
477
477
|
setTextProviders: (t) => r({ textProviders: t }),
|
|
478
478
|
setVisionProviders: (t) => r({ visionProviders: t }),
|
|
479
479
|
addNode: (t, a) => {
|
|
480
|
-
var s,
|
|
480
|
+
var s, p, l;
|
|
481
481
|
const o = Q();
|
|
482
|
-
let
|
|
482
|
+
let m;
|
|
483
483
|
if (t.type === "generator")
|
|
484
|
-
|
|
484
|
+
m = {
|
|
485
485
|
generatorName: t.name,
|
|
486
486
|
params: ae(t),
|
|
487
487
|
isAI: t.isAI,
|
|
@@ -490,7 +490,7 @@ const k = ye()(
|
|
|
490
490
|
maxReferenceImages: t.maxReferenceImages
|
|
491
491
|
};
|
|
492
492
|
else if (t.type === "transform")
|
|
493
|
-
|
|
493
|
+
m = {
|
|
494
494
|
operation: t.name,
|
|
495
495
|
providerName: t.providerName,
|
|
496
496
|
// Track which provider this transform belongs to
|
|
@@ -501,28 +501,28 @@ const k = ye()(
|
|
|
501
501
|
maxReferenceImages: t.maxReferenceImages
|
|
502
502
|
};
|
|
503
503
|
else if (t.type === "input")
|
|
504
|
-
|
|
504
|
+
m = {
|
|
505
505
|
uploadId: void 0,
|
|
506
506
|
filename: void 0,
|
|
507
507
|
mime: void 0
|
|
508
508
|
};
|
|
509
509
|
else if (t.type === "vision")
|
|
510
|
-
|
|
510
|
+
m = {
|
|
511
511
|
providerName: t.name,
|
|
512
512
|
providerLabel: t.label,
|
|
513
513
|
// Human-readable label (e.g., "Gemini Vision")
|
|
514
514
|
params: ae(t)
|
|
515
515
|
};
|
|
516
516
|
else if (t.type === "text")
|
|
517
|
-
|
|
517
|
+
m = {
|
|
518
518
|
providerName: t.name,
|
|
519
519
|
providerLabel: t.label,
|
|
520
520
|
// Human-readable label (e.g., "Gemini Text")
|
|
521
521
|
params: ae(t)
|
|
522
522
|
};
|
|
523
523
|
else {
|
|
524
|
-
const g = ((s = t.params) == null ? void 0 : s.properties) || {}, b = ((
|
|
525
|
-
|
|
524
|
+
const g = ((s = t.params) == null ? void 0 : s.properties) || {}, b = ((p = g.provider) == null ? void 0 : p.default) || "filesystem";
|
|
525
|
+
m = {
|
|
526
526
|
destination: ((l = g.destination) == null ? void 0 : l.default) || "./output/image.png",
|
|
527
527
|
provider: b
|
|
528
528
|
};
|
|
@@ -531,7 +531,7 @@ const k = ye()(
|
|
|
531
531
|
id: o,
|
|
532
532
|
type: t.type,
|
|
533
533
|
position: a,
|
|
534
|
-
data:
|
|
534
|
+
data: m
|
|
535
535
|
};
|
|
536
536
|
r((g) => ({
|
|
537
537
|
nodes: [...g.nodes, c]
|
|
@@ -540,7 +540,7 @@ const k = ye()(
|
|
|
540
540
|
updateNodeData: (t, a) => {
|
|
541
541
|
r((o) => ({
|
|
542
542
|
nodes: o.nodes.map(
|
|
543
|
-
(
|
|
543
|
+
(m) => m.id === t ? { ...m, data: { ...m.data, ...a } } : m
|
|
544
544
|
)
|
|
545
545
|
}));
|
|
546
546
|
},
|
|
@@ -554,9 +554,9 @@ const k = ye()(
|
|
|
554
554
|
duplicateNode: (t) => {
|
|
555
555
|
const a = d(), o = a.nodes.find((s) => s.id === t);
|
|
556
556
|
if (!o) return;
|
|
557
|
-
const
|
|
557
|
+
const m = Q(), c = {
|
|
558
558
|
...o,
|
|
559
|
-
id:
|
|
559
|
+
id: m,
|
|
560
560
|
position: {
|
|
561
561
|
x: o.position.x + 50,
|
|
562
562
|
y: o.position.y + 50
|
|
@@ -567,14 +567,14 @@ const k = ye()(
|
|
|
567
567
|
};
|
|
568
568
|
r({
|
|
569
569
|
nodes: [...a.nodes, c],
|
|
570
|
-
selectedNodeId:
|
|
570
|
+
selectedNodeId: m
|
|
571
571
|
// Select the new node
|
|
572
572
|
});
|
|
573
573
|
},
|
|
574
574
|
setNodes: (t) => r({ nodes: t }),
|
|
575
575
|
addEdge: (t) => {
|
|
576
576
|
if (!t.source || !t.target) return;
|
|
577
|
-
const a = [t.sourceHandle, t.targetHandle].filter(Boolean).join("_"),
|
|
577
|
+
const a = [t.sourceHandle, t.targetHandle].filter(Boolean).join("_"), m = {
|
|
578
578
|
id: a ? `edge_${t.source}_${t.target}_${a}` : `edge_${t.source}_${t.target}`,
|
|
579
579
|
source: t.source,
|
|
580
580
|
target: t.target,
|
|
@@ -582,7 +582,7 @@ const k = ye()(
|
|
|
582
582
|
targetHandle: t.targetHandle ?? void 0
|
|
583
583
|
};
|
|
584
584
|
r((c) => ({
|
|
585
|
-
edges: [...c.edges,
|
|
585
|
+
edges: [...c.edges, m]
|
|
586
586
|
}));
|
|
587
587
|
},
|
|
588
588
|
deleteEdge: (t) => {
|
|
@@ -593,20 +593,20 @@ const k = ye()(
|
|
|
593
593
|
setEdges: (t) => r({ edges: t }),
|
|
594
594
|
setSelectedNode: (t) => r({ selectedNodeId: t }),
|
|
595
595
|
execute: async () => {
|
|
596
|
-
const { nodes: t, edges: a } = d(), o = t.map((
|
|
597
|
-
id:
|
|
598
|
-
type:
|
|
599
|
-
position:
|
|
600
|
-
data:
|
|
601
|
-
})),
|
|
602
|
-
id:
|
|
603
|
-
source:
|
|
604
|
-
target:
|
|
605
|
-
sourceHandle:
|
|
606
|
-
targetHandle:
|
|
596
|
+
const { nodes: t, edges: a } = d(), o = t.map((p) => ({
|
|
597
|
+
id: p.id,
|
|
598
|
+
type: p.type,
|
|
599
|
+
position: p.position,
|
|
600
|
+
data: p.data
|
|
601
|
+
})), m = a.map((p) => ({
|
|
602
|
+
id: p.id,
|
|
603
|
+
source: p.source,
|
|
604
|
+
target: p.target,
|
|
605
|
+
sourceHandle: p.sourceHandle ?? void 0,
|
|
606
|
+
targetHandle: p.targetHandle ?? void 0
|
|
607
607
|
})), c = G.getState().getConfiguredProviders(), s = {};
|
|
608
|
-
for (const
|
|
609
|
-
s[
|
|
608
|
+
for (const p of t)
|
|
609
|
+
s[p.id] = "pending";
|
|
610
610
|
return r({
|
|
611
611
|
execution: {
|
|
612
612
|
status: "running",
|
|
@@ -616,10 +616,10 @@ const k = ye()(
|
|
|
616
616
|
dataOutputs: {},
|
|
617
617
|
nodeStatus: s
|
|
618
618
|
}
|
|
619
|
-
}), new Promise((
|
|
619
|
+
}), new Promise((p, l) => {
|
|
620
620
|
J = ve(
|
|
621
621
|
"/api/execute/stream",
|
|
622
|
-
{ nodes: o, edges:
|
|
622
|
+
{ nodes: o, edges: m, aiProviders: c },
|
|
623
623
|
{
|
|
624
624
|
onMessage: (g) => {
|
|
625
625
|
const b = d();
|
|
@@ -656,7 +656,7 @@ const k = ye()(
|
|
|
656
656
|
imageUrls: g.data.imageUrls,
|
|
657
657
|
nodeStatus: f
|
|
658
658
|
}
|
|
659
|
-
}),
|
|
659
|
+
}), p();
|
|
660
660
|
}
|
|
661
661
|
if (g.type === "execution.error") {
|
|
662
662
|
const f = { ...b.execution.nodeStatus };
|
|
@@ -716,26 +716,26 @@ const k = ye()(
|
|
|
716
716
|
type: s.type,
|
|
717
717
|
position: s.position,
|
|
718
718
|
data: s.data
|
|
719
|
-
})),
|
|
719
|
+
})), m = a.map((s) => ({
|
|
720
720
|
id: s.id,
|
|
721
721
|
source: s.source,
|
|
722
722
|
target: s.target,
|
|
723
723
|
sourceHandle: s.sourceHandle ?? void 0,
|
|
724
724
|
targetHandle: s.targetHandle ?? void 0
|
|
725
725
|
}));
|
|
726
|
-
return (await Fe(o,
|
|
726
|
+
return (await Fe(o, m)).yaml;
|
|
727
727
|
},
|
|
728
728
|
importFromYaml: (t, a, o) => {
|
|
729
|
-
const
|
|
729
|
+
const m = /* @__PURE__ */ new Map(), c = t.map((p) => {
|
|
730
730
|
const l = Q();
|
|
731
|
-
return
|
|
731
|
+
return m.set(p.id, l), {
|
|
732
732
|
id: l,
|
|
733
|
-
type:
|
|
734
|
-
position:
|
|
735
|
-
data: n(
|
|
733
|
+
type: p.type,
|
|
734
|
+
position: p.position,
|
|
735
|
+
data: n(p)
|
|
736
736
|
};
|
|
737
|
-
}), s = a.map((
|
|
738
|
-
const l =
|
|
737
|
+
}), s = a.map((p) => {
|
|
738
|
+
const l = m.get(p.source) || p.source, g = m.get(p.target) || p.target;
|
|
739
739
|
return {
|
|
740
740
|
id: `edge_${l}_${g}`,
|
|
741
741
|
source: l,
|
|
@@ -789,20 +789,20 @@ const k = ye()(
|
|
|
789
789
|
const {
|
|
790
790
|
nodes: a,
|
|
791
791
|
edges: o,
|
|
792
|
-
activeWorkflowId:
|
|
792
|
+
activeWorkflowId: m,
|
|
793
793
|
activeWorkflowName: c,
|
|
794
794
|
savedWorkflows: s,
|
|
795
|
-
currentTemplateId:
|
|
795
|
+
currentTemplateId: p
|
|
796
796
|
} = d(), l = Date.now();
|
|
797
|
-
if (
|
|
797
|
+
if (m) {
|
|
798
798
|
const g = s.map(
|
|
799
|
-
(b) => b.id ===
|
|
799
|
+
(b) => b.id === m ? { ...b, name: t || c, nodes: a, edges: o, updatedAt: l } : b
|
|
800
800
|
);
|
|
801
801
|
return r({
|
|
802
802
|
savedWorkflows: g,
|
|
803
803
|
activeWorkflowName: t || c,
|
|
804
804
|
hasUnsavedChanges: !1
|
|
805
|
-
}),
|
|
805
|
+
}), m;
|
|
806
806
|
} else {
|
|
807
807
|
const g = be(), b = {
|
|
808
808
|
id: g,
|
|
@@ -811,7 +811,7 @@ const k = ye()(
|
|
|
811
811
|
edges: o,
|
|
812
812
|
createdAt: l,
|
|
813
813
|
updatedAt: l,
|
|
814
|
-
templateId:
|
|
814
|
+
templateId: p || void 0
|
|
815
815
|
};
|
|
816
816
|
return r({
|
|
817
817
|
savedWorkflows: [...s, b],
|
|
@@ -824,7 +824,7 @@ const k = ye()(
|
|
|
824
824
|
loadWorkflow: (t) => {
|
|
825
825
|
const { savedWorkflows: a } = d(), o = a.find((c) => c.id === t);
|
|
826
826
|
if (!o) return;
|
|
827
|
-
const
|
|
827
|
+
const m = o.nodes.map((c) => ({
|
|
828
828
|
...c,
|
|
829
829
|
data: n({
|
|
830
830
|
id: c.id,
|
|
@@ -834,7 +834,7 @@ const k = ye()(
|
|
|
834
834
|
})
|
|
835
835
|
}));
|
|
836
836
|
r({
|
|
837
|
-
nodes:
|
|
837
|
+
nodes: m,
|
|
838
838
|
edges: o.edges,
|
|
839
839
|
selectedNodeId: null,
|
|
840
840
|
currentTemplateId: o.templateId || null,
|
|
@@ -853,9 +853,9 @@ const k = ye()(
|
|
|
853
853
|
});
|
|
854
854
|
},
|
|
855
855
|
deleteWorkflow: (t) => {
|
|
856
|
-
const { savedWorkflows: a, activeWorkflowId: o } = d(),
|
|
856
|
+
const { savedWorkflows: a, activeWorkflowId: o } = d(), m = a.filter((c) => c.id !== t);
|
|
857
857
|
r(o === t ? {
|
|
858
|
-
savedWorkflows:
|
|
858
|
+
savedWorkflows: m,
|
|
859
859
|
nodes: [],
|
|
860
860
|
edges: [],
|
|
861
861
|
selectedNodeId: null,
|
|
@@ -872,40 +872,40 @@ const k = ye()(
|
|
|
872
872
|
dataOutputs: {},
|
|
873
873
|
nodeStatus: {}
|
|
874
874
|
}
|
|
875
|
-
} : { savedWorkflows:
|
|
875
|
+
} : { savedWorkflows: m });
|
|
876
876
|
},
|
|
877
877
|
renameWorkflow: (t, a) => {
|
|
878
|
-
const { savedWorkflows: o, activeWorkflowId:
|
|
878
|
+
const { savedWorkflows: o, activeWorkflowId: m } = d(), c = o.map(
|
|
879
879
|
(s) => s.id === t ? { ...s, name: a, updatedAt: Date.now() } : s
|
|
880
880
|
);
|
|
881
881
|
r({
|
|
882
882
|
savedWorkflows: c,
|
|
883
|
-
...
|
|
883
|
+
...m === t ? { activeWorkflowName: a } : {}
|
|
884
884
|
});
|
|
885
885
|
},
|
|
886
886
|
duplicateWorkflow: (t) => {
|
|
887
|
-
const { savedWorkflows: a } = d(), o = a.find((
|
|
887
|
+
const { savedWorkflows: a } = d(), o = a.find((p) => p.id === t);
|
|
888
888
|
if (!o) return "";
|
|
889
|
-
const
|
|
889
|
+
const m = Date.now(), c = be(), s = {
|
|
890
890
|
...o,
|
|
891
891
|
id: c,
|
|
892
892
|
name: `${o.name} (Copy)`,
|
|
893
|
-
createdAt:
|
|
894
|
-
updatedAt:
|
|
893
|
+
createdAt: m,
|
|
894
|
+
updatedAt: m
|
|
895
895
|
};
|
|
896
896
|
return r({ savedWorkflows: [...a, s] }), c;
|
|
897
897
|
},
|
|
898
898
|
loadGeneratedWorkflow: (t) => {
|
|
899
|
-
const a = /* @__PURE__ */ new Map(), o = 250,
|
|
899
|
+
const a = /* @__PURE__ */ new Map(), o = 250, m = 150, c = 3, s = t.nodes.map((l, g) => {
|
|
900
900
|
const b = Q();
|
|
901
901
|
a.set(l.id, b);
|
|
902
902
|
const f = l.nodeType.split(":"), h = f[0], y = Math.floor(g / c), C = {
|
|
903
903
|
x: 100 + g % c * o,
|
|
904
|
-
y: 100 + y *
|
|
904
|
+
y: 100 + y * m
|
|
905
905
|
};
|
|
906
906
|
let u;
|
|
907
907
|
if (h === "generator") {
|
|
908
|
-
const x = f.slice(1).join(":"), N = d().generators.find((
|
|
908
|
+
const x = f.slice(1).join(":"), N = d().generators.find((k) => k.name === x);
|
|
909
909
|
u = {
|
|
910
910
|
generatorName: x,
|
|
911
911
|
params: l.parameters,
|
|
@@ -915,16 +915,16 @@ const k = ye()(
|
|
|
915
915
|
maxReferenceImages: N == null ? void 0 : N.maxReferenceImages
|
|
916
916
|
};
|
|
917
917
|
} else if (h === "transform") {
|
|
918
|
-
const x = f[1], N = f.slice(2).join(":"),
|
|
918
|
+
const x = f[1], N = f.slice(2).join(":"), k = d().transforms.find(
|
|
919
919
|
(W) => W.providerName === x && W.name === N
|
|
920
920
|
);
|
|
921
921
|
u = {
|
|
922
922
|
operation: N,
|
|
923
923
|
providerName: x,
|
|
924
924
|
params: l.parameters,
|
|
925
|
-
isAI:
|
|
926
|
-
acceptsReferenceImages:
|
|
927
|
-
maxReferenceImages:
|
|
925
|
+
isAI: k == null ? void 0 : k.isAI,
|
|
926
|
+
acceptsReferenceImages: k == null ? void 0 : k.acceptsReferenceImages,
|
|
927
|
+
maxReferenceImages: k == null ? void 0 : k.maxReferenceImages
|
|
928
928
|
};
|
|
929
929
|
} else if (h === "input")
|
|
930
930
|
u = {
|
|
@@ -938,7 +938,7 @@ const k = ye()(
|
|
|
938
938
|
params: l.parameters
|
|
939
939
|
};
|
|
940
940
|
else if (h === "text") {
|
|
941
|
-
const x = f.slice(1).join(":"), N = l.parameters.jsonSchema,
|
|
941
|
+
const x = f.slice(1).join(":"), N = l.parameters.jsonSchema, k = N != null && N.properties ? {
|
|
942
942
|
type: "object",
|
|
943
943
|
properties: Object.fromEntries(
|
|
944
944
|
Object.entries(N.properties).map(([W, A]) => [
|
|
@@ -953,7 +953,7 @@ const k = ye()(
|
|
|
953
953
|
u = {
|
|
954
954
|
providerName: x,
|
|
955
955
|
params: l.parameters,
|
|
956
|
-
outputSchema:
|
|
956
|
+
outputSchema: k
|
|
957
957
|
};
|
|
958
958
|
} else
|
|
959
959
|
u = {
|
|
@@ -966,7 +966,7 @@ const k = ye()(
|
|
|
966
966
|
position: C,
|
|
967
967
|
data: u
|
|
968
968
|
};
|
|
969
|
-
}),
|
|
969
|
+
}), p = t.edges.map((l) => {
|
|
970
970
|
const g = a.get(l.source) || l.source, b = a.get(l.target) || l.target, f = [l.sourceHandle, l.targetHandle].filter(Boolean).join("_");
|
|
971
971
|
return {
|
|
972
972
|
id: f ? `edge_${g}_${b}_${f}` : `edge_${g}_${b}`,
|
|
@@ -978,7 +978,7 @@ const k = ye()(
|
|
|
978
978
|
});
|
|
979
979
|
r({
|
|
980
980
|
nodes: s,
|
|
981
|
-
edges:
|
|
981
|
+
edges: p,
|
|
982
982
|
selectedNodeId: null,
|
|
983
983
|
currentTemplateId: null,
|
|
984
984
|
previewVisible: {},
|
|
@@ -1017,8 +1017,8 @@ function ae(r) {
|
|
|
1017
1017
|
function _(r) {
|
|
1018
1018
|
return r === "pending" ? "border-gray-400 dark:border-zinc-500" : r === "running" ? "border-yellow-400 animate-pulse" : r === "completed" ? "border-green-500" : r === "error" ? "border-red-500" : "";
|
|
1019
1019
|
}
|
|
1020
|
-
function
|
|
1021
|
-
const n =
|
|
1020
|
+
function me({ nodeId: r, color: d }) {
|
|
1021
|
+
const n = w((a) => a.previewVisible[r] !== !1), t = w((a) => a.togglePreview);
|
|
1022
1022
|
return /* @__PURE__ */ e(
|
|
1023
1023
|
"button",
|
|
1024
1024
|
{
|
|
@@ -1052,13 +1052,13 @@ const rt = H(function({
|
|
|
1052
1052
|
data: n,
|
|
1053
1053
|
selected: t
|
|
1054
1054
|
}) {
|
|
1055
|
-
const a =
|
|
1055
|
+
const a = w((g) => g.execution.previews[d]), o = w((g) => g.execution.nodeStatus[d]), m = w((g) => g.previewVisible[d] !== !1), s = _(o) || (t ? "border-blue-500" : "border-blue-200"), p = n.isAI, l = n.acceptsReferenceImages;
|
|
1056
1056
|
return /* @__PURE__ */ i(
|
|
1057
1057
|
"div",
|
|
1058
1058
|
{
|
|
1059
1059
|
className: `rounded-lg border-2 bg-white dark:bg-zinc-800 shadow-md min-w-[180px] overflow-hidden ${s}`,
|
|
1060
1060
|
children: [
|
|
1061
|
-
|
|
1061
|
+
p && /* @__PURE__ */ e(
|
|
1062
1062
|
M,
|
|
1063
1063
|
{
|
|
1064
1064
|
type: "target",
|
|
@@ -1079,14 +1079,14 @@ const rt = H(function({
|
|
|
1079
1079
|
title: `Reference images (up to ${n.maxReferenceImages || 14})`
|
|
1080
1080
|
}
|
|
1081
1081
|
),
|
|
1082
|
-
a &&
|
|
1082
|
+
a && 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: a, alt: "Preview", className: "w-full h-24 object-contain" }) }),
|
|
1083
1083
|
/* @__PURE__ */ i("div", { className: "px-4 py-3", children: [
|
|
1084
1084
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-2 mb-2", children: [
|
|
1085
1085
|
/* @__PURE__ */ e("div", { className: "w-3 h-3 rounded-full bg-blue-500" }),
|
|
1086
1086
|
/* @__PURE__ */ e("span", { className: "font-semibold text-sm text-blue-700 dark:text-blue-400", children: n.generatorName }),
|
|
1087
|
-
/* @__PURE__ */ e(
|
|
1087
|
+
/* @__PURE__ */ e(me, { nodeId: d, color: "text-blue-500 dark:text-blue-400" })
|
|
1088
1088
|
] }),
|
|
1089
|
-
|
|
1089
|
+
p && /* @__PURE__ */ e("div", { className: "text-[10px] text-pink-500 dark:text-pink-400 mb-1", children: "↑ Connect text node for dynamic prompt" }),
|
|
1090
1090
|
l && /* @__PURE__ */ e("div", { className: "text-[10px] text-violet-500 dark:text-violet-400 mb-1", children: "← Connect reference images" }),
|
|
1091
1091
|
/* @__PURE__ */ e("div", { className: "text-xs text-gray-500 dark:text-zinc-400", children: Object.entries(n.params).filter(([, g]) => typeof g != "object" || g === null).slice(0, 2).map(([g, b]) => /* @__PURE__ */ i("div", { className: "truncate", children: [
|
|
1092
1092
|
g,
|
|
@@ -1103,13 +1103,13 @@ const rt = H(function({
|
|
|
1103
1103
|
data: n,
|
|
1104
1104
|
selected: t
|
|
1105
1105
|
}) {
|
|
1106
|
-
const a =
|
|
1106
|
+
const a = w((g) => g.execution.previews[d]), o = w((g) => g.execution.nodeStatus[d]), m = w((g) => g.previewVisible[d] !== !1), s = _(o) || (t ? "border-teal-500" : "border-teal-200"), p = n.isAI, l = n.acceptsReferenceImages;
|
|
1107
1107
|
return /* @__PURE__ */ i(
|
|
1108
1108
|
"div",
|
|
1109
1109
|
{
|
|
1110
1110
|
className: `rounded-lg border-2 bg-white dark:bg-zinc-800 shadow-md min-w-[180px] overflow-hidden ${s}`,
|
|
1111
1111
|
children: [
|
|
1112
|
-
|
|
1112
|
+
p && /* @__PURE__ */ e(
|
|
1113
1113
|
M,
|
|
1114
1114
|
{
|
|
1115
1115
|
type: "target",
|
|
@@ -1130,10 +1130,10 @@ const rt = H(function({
|
|
|
1130
1130
|
title: `Reference images (up to ${n.maxReferenceImages || 13})`
|
|
1131
1131
|
}
|
|
1132
1132
|
),
|
|
1133
|
-
a &&
|
|
1133
|
+
a && 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: a, alt: "Preview", className: "w-full h-24 object-contain" }) }),
|
|
1134
1134
|
/* @__PURE__ */ i("div", { className: "px-4 py-3", children: [
|
|
1135
1135
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-2 mb-2", children: [
|
|
1136
|
-
|
|
1136
|
+
p ? /* @__PURE__ */ i("svg", { className: "w-3 h-3 text-purple-500", fill: "currentColor", viewBox: "0 0 20 20", children: [
|
|
1137
1137
|
/* @__PURE__ */ e("path", { d: "M13 7H7v6h6V7z" }),
|
|
1138
1138
|
/* @__PURE__ */ e(
|
|
1139
1139
|
"path",
|
|
@@ -1147,19 +1147,19 @@ const rt = H(function({
|
|
|
1147
1147
|
/* @__PURE__ */ e(
|
|
1148
1148
|
"span",
|
|
1149
1149
|
{
|
|
1150
|
-
className: `font-semibold text-sm ${
|
|
1150
|
+
className: `font-semibold text-sm ${p ? "text-purple-700 dark:text-purple-400" : "text-teal-700 dark:text-teal-400"}`,
|
|
1151
1151
|
children: n.operation
|
|
1152
1152
|
}
|
|
1153
1153
|
),
|
|
1154
1154
|
/* @__PURE__ */ e(
|
|
1155
|
-
|
|
1155
|
+
me,
|
|
1156
1156
|
{
|
|
1157
1157
|
nodeId: d,
|
|
1158
|
-
color:
|
|
1158
|
+
color: p ? "text-purple-500 dark:text-purple-400" : "text-teal-500 dark:text-teal-400"
|
|
1159
1159
|
}
|
|
1160
1160
|
)
|
|
1161
1161
|
] }),
|
|
1162
|
-
|
|
1162
|
+
p && /* @__PURE__ */ e("div", { className: "text-[10px] text-pink-500 dark:text-pink-400 mb-1", children: "↑ Connect text node for dynamic prompt" }),
|
|
1163
1163
|
l && /* @__PURE__ */ e("div", { className: "text-[10px] text-violet-500 dark:text-violet-400 mb-1", children: "↓ Connect reference images" }),
|
|
1164
1164
|
/* @__PURE__ */ e("div", { className: "text-xs text-gray-500 dark:text-zinc-400", children: Object.entries(n.params).filter(([, g]) => typeof g != "object" || g === null).slice(0, 2).map(([g, b]) => /* @__PURE__ */ i("div", { className: "truncate", children: [
|
|
1165
1165
|
g,
|
|
@@ -1172,11 +1172,11 @@ const rt = H(function({
|
|
|
1172
1172
|
}
|
|
1173
1173
|
);
|
|
1174
1174
|
}), ot = H(function({ id: d, data: n, selected: t }) {
|
|
1175
|
-
const a =
|
|
1175
|
+
const a = w((c) => c.execution.nodeStatus[d]), m = _(a) || (t ? "border-green-500" : "border-green-200");
|
|
1176
1176
|
return /* @__PURE__ */ i(
|
|
1177
1177
|
"div",
|
|
1178
1178
|
{
|
|
1179
|
-
className: `px-4 py-3 rounded-lg border-2 bg-white dark:bg-zinc-800 shadow-md min-w-[180px] ${
|
|
1179
|
+
className: `px-4 py-3 rounded-lg border-2 bg-white dark:bg-zinc-800 shadow-md min-w-[180px] ${m}`,
|
|
1180
1180
|
children: [
|
|
1181
1181
|
/* @__PURE__ */ e(M, { type: "target", position: T.Left, className: "w-3 h-3 !bg-green-500" }),
|
|
1182
1182
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-2 mb-2", children: [
|
|
@@ -1188,7 +1188,7 @@ const rt = H(function({
|
|
|
1188
1188
|
}
|
|
1189
1189
|
);
|
|
1190
1190
|
}), nt = H(function({ id: d, data: n, selected: t }) {
|
|
1191
|
-
const a =
|
|
1191
|
+
const a = w((v) => v.execution.previews[d]), o = w((v) => v.execution.nodeStatus[d]), m = w((v) => v.previewVisible[d] !== !1), c = w((v) => v.updateNodeData), s = se(null), l = _(o) || (t ? "border-amber-500" : "border-amber-200"), g = L(
|
|
1192
1192
|
async (v) => {
|
|
1193
1193
|
try {
|
|
1194
1194
|
const C = await _e(v);
|
|
@@ -1218,7 +1218,7 @@ const rt = H(function({
|
|
|
1218
1218
|
C && g(C);
|
|
1219
1219
|
},
|
|
1220
1220
|
[g]
|
|
1221
|
-
), y = a || (n.uploadId ?
|
|
1221
|
+
), y = a || (n.uploadId ? we(n.uploadId) : null);
|
|
1222
1222
|
return /* @__PURE__ */ i(
|
|
1223
1223
|
"div",
|
|
1224
1224
|
{
|
|
@@ -1226,7 +1226,7 @@ const rt = H(function({
|
|
|
1226
1226
|
onDrop: b,
|
|
1227
1227
|
onDragOver: f,
|
|
1228
1228
|
children: [
|
|
1229
|
-
y &&
|
|
1229
|
+
y && 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: y, alt: "Uploaded", className: "w-full h-24 object-contain" }) }) : y ? null : /* @__PURE__ */ e(
|
|
1230
1230
|
"div",
|
|
1231
1231
|
{
|
|
1232
1232
|
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",
|
|
@@ -1254,7 +1254,7 @@ const rt = H(function({
|
|
|
1254
1254
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-2 mb-2", children: [
|
|
1255
1255
|
/* @__PURE__ */ e("div", { className: "w-3 h-3 rounded-full bg-amber-500" }),
|
|
1256
1256
|
/* @__PURE__ */ e("span", { className: "font-semibold text-sm text-amber-700 dark:text-amber-400", children: "Input" }),
|
|
1257
|
-
/* @__PURE__ */ e(
|
|
1257
|
+
/* @__PURE__ */ e(me, { nodeId: d, color: "text-amber-500 dark:text-amber-400" })
|
|
1258
1258
|
] }),
|
|
1259
1259
|
/* @__PURE__ */ e("div", { className: "text-xs text-gray-500 dark:text-zinc-400 truncate", children: n.filename || "No image selected" })
|
|
1260
1260
|
] }),
|
|
@@ -1268,10 +1268,10 @@ const rt = H(function({
|
|
|
1268
1268
|
selected: t
|
|
1269
1269
|
}) {
|
|
1270
1270
|
var g, b, f;
|
|
1271
|
-
const a =
|
|
1271
|
+
const a = w((h) => h.execution.nodeStatus[d]), o = w((h) => {
|
|
1272
1272
|
var y;
|
|
1273
1273
|
return (y = h.execution.dataOutputs) == null ? void 0 : y[d];
|
|
1274
|
-
}),
|
|
1274
|
+
}), m = w((h) => h.openOutputInspector), s = _(a) || (t ? "border-cyan-500" : "border-cyan-200"), p = (g = n.outputSchema) != null && g.properties ? Object.entries(n.outputSchema.properties) : [], l = p.length > 0;
|
|
1275
1275
|
return /* @__PURE__ */ i(
|
|
1276
1276
|
"div",
|
|
1277
1277
|
{
|
|
@@ -1287,7 +1287,7 @@ const rt = H(function({
|
|
|
1287
1287
|
"button",
|
|
1288
1288
|
{
|
|
1289
1289
|
onClick: (h) => {
|
|
1290
|
-
h.stopPropagation(),
|
|
1290
|
+
h.stopPropagation(), m(d);
|
|
1291
1291
|
},
|
|
1292
1292
|
className: "mt-1 text-xs text-cyan-600 dark:text-cyan-400 hover:text-cyan-800 dark:hover:text-cyan-300 hover:underline",
|
|
1293
1293
|
children: "View Full Output"
|
|
@@ -1315,7 +1315,7 @@ const rt = H(function({
|
|
|
1315
1315
|
] }) : null }),
|
|
1316
1316
|
l && /* @__PURE__ */ i("div", { className: "mt-2 pt-2 border-t border-cyan-200 dark:border-cyan-800", children: [
|
|
1317
1317
|
/* @__PURE__ */ e("div", { className: "text-[10px] text-cyan-500 dark:text-cyan-400 font-medium mb-1", children: "Outputs:" }),
|
|
1318
|
-
|
|
1318
|
+
p.map(([h]) => /* @__PURE__ */ i(
|
|
1319
1319
|
"div",
|
|
1320
1320
|
{
|
|
1321
1321
|
className: "text-[10px] text-gray-500 dark:text-zinc-400 flex items-center gap-1",
|
|
@@ -1340,7 +1340,7 @@ const rt = H(function({
|
|
|
1340
1340
|
title: "Full JSON output"
|
|
1341
1341
|
}
|
|
1342
1342
|
),
|
|
1343
|
-
|
|
1343
|
+
p.map(([h, y], v) => /* @__PURE__ */ e(
|
|
1344
1344
|
M,
|
|
1345
1345
|
{
|
|
1346
1346
|
type: "source",
|
|
@@ -1360,10 +1360,10 @@ const rt = H(function({
|
|
|
1360
1360
|
);
|
|
1361
1361
|
}), st = H(function({ id: d, data: n, selected: t }) {
|
|
1362
1362
|
var g, b, f;
|
|
1363
|
-
const a =
|
|
1363
|
+
const a = w((h) => h.execution.nodeStatus[d]), o = w((h) => {
|
|
1364
1364
|
var y;
|
|
1365
1365
|
return (y = h.execution.dataOutputs) == null ? void 0 : y[d];
|
|
1366
|
-
}),
|
|
1366
|
+
}), m = w((h) => h.openOutputInspector), s = _(a) || (t ? "border-pink-500" : "border-pink-200"), p = (g = n.outputSchema) != null && g.properties ? Object.entries(n.outputSchema.properties) : [], l = p.length > 0;
|
|
1367
1367
|
return /* @__PURE__ */ i(
|
|
1368
1368
|
"div",
|
|
1369
1369
|
{
|
|
@@ -1379,7 +1379,7 @@ const rt = H(function({
|
|
|
1379
1379
|
"button",
|
|
1380
1380
|
{
|
|
1381
1381
|
onClick: (h) => {
|
|
1382
|
-
h.stopPropagation(),
|
|
1382
|
+
h.stopPropagation(), m(d);
|
|
1383
1383
|
},
|
|
1384
1384
|
className: "mt-1 text-xs text-pink-600 dark:text-pink-400 hover:text-pink-800 dark:hover:text-pink-300 hover:underline",
|
|
1385
1385
|
children: "View Full Output"
|
|
@@ -1404,7 +1404,7 @@ const rt = H(function({
|
|
|
1404
1404
|
] }) : null }),
|
|
1405
1405
|
l && /* @__PURE__ */ i("div", { className: "mt-2 pt-2 border-t border-pink-200 dark:border-pink-800", children: [
|
|
1406
1406
|
/* @__PURE__ */ e("div", { className: "text-[10px] text-pink-500 dark:text-pink-400 font-medium mb-1", children: "Outputs:" }),
|
|
1407
|
-
|
|
1407
|
+
p.map(([h]) => /* @__PURE__ */ i(
|
|
1408
1408
|
"div",
|
|
1409
1409
|
{
|
|
1410
1410
|
className: "text-[10px] text-gray-500 dark:text-zinc-400 flex items-center gap-1",
|
|
@@ -1429,7 +1429,7 @@ const rt = H(function({
|
|
|
1429
1429
|
title: "Full JSON output"
|
|
1430
1430
|
}
|
|
1431
1431
|
),
|
|
1432
|
-
|
|
1432
|
+
p.map(([h, y], v) => /* @__PURE__ */ e(
|
|
1433
1433
|
M,
|
|
1434
1434
|
{
|
|
1435
1435
|
type: "source",
|
|
@@ -1471,7 +1471,7 @@ const rt = H(function({
|
|
|
1471
1471
|
interactionWidth: 20
|
|
1472
1472
|
};
|
|
1473
1473
|
function ct() {
|
|
1474
|
-
const r =
|
|
1474
|
+
const r = w((f) => f.nodes), d = w((f) => f.edges), n = w((f) => f.setNodes), t = w((f) => f.setEdges), a = w((f) => f.addEdge), o = w((f) => f.setSelectedNode), m = de(() => dt, []), c = L(
|
|
1475
1475
|
(f) => {
|
|
1476
1476
|
const { source: h, target: y, targetHandle: v } = f;
|
|
1477
1477
|
if (!h || !y) return !1;
|
|
@@ -1489,7 +1489,7 @@ function ct() {
|
|
|
1489
1489
|
n(We(f, r));
|
|
1490
1490
|
},
|
|
1491
1491
|
[r, n]
|
|
1492
|
-
),
|
|
1492
|
+
), p = L(
|
|
1493
1493
|
(f) => {
|
|
1494
1494
|
t(Pe(f, d));
|
|
1495
1495
|
},
|
|
@@ -1524,11 +1524,11 @@ function ct() {
|
|
|
1524
1524
|
nodes: r,
|
|
1525
1525
|
edges: d,
|
|
1526
1526
|
onNodesChange: s,
|
|
1527
|
-
onEdgesChange:
|
|
1527
|
+
onEdgesChange: p,
|
|
1528
1528
|
onConnect: l,
|
|
1529
1529
|
onNodeClick: g,
|
|
1530
1530
|
onPaneClick: b,
|
|
1531
|
-
nodeTypes:
|
|
1531
|
+
nodeTypes: m,
|
|
1532
1532
|
defaultEdgeOptions: lt,
|
|
1533
1533
|
isValidConnection: c,
|
|
1534
1534
|
nodesDraggable: !0,
|
|
@@ -1548,14 +1548,14 @@ function ct() {
|
|
|
1548
1548
|
}
|
|
1549
1549
|
) });
|
|
1550
1550
|
}
|
|
1551
|
-
function
|
|
1552
|
-
const [d, n] = I([]), [t, a] = I(!0), [o,
|
|
1551
|
+
function mt({ onSelect: r }) {
|
|
1552
|
+
const [d, n] = I([]), [t, a] = I(!0), [o, m] = I(null), c = async () => {
|
|
1553
1553
|
try {
|
|
1554
1554
|
a(!0);
|
|
1555
1555
|
const l = await Ke();
|
|
1556
|
-
n(l),
|
|
1556
|
+
n(l), m(null);
|
|
1557
1557
|
} catch (l) {
|
|
1558
|
-
|
|
1558
|
+
m(l instanceof Error ? l.message : "Failed to load uploads");
|
|
1559
1559
|
} finally {
|
|
1560
1560
|
a(!1);
|
|
1561
1561
|
}
|
|
@@ -1570,7 +1570,7 @@ function pt({ onSelect: r }) {
|
|
|
1570
1570
|
} catch (b) {
|
|
1571
1571
|
console.error("Failed to delete:", b);
|
|
1572
1572
|
}
|
|
1573
|
-
},
|
|
1573
|
+
}, p = (l) => l < 1024 ? `${l} B` : l < 1024 * 1024 ? `${(l / 1024).toFixed(1)} KB` : `${(l / (1024 * 1024)).toFixed(1)} MB`;
|
|
1574
1574
|
return t ? /* @__PURE__ */ e("div", { className: "p-4 text-center text-gray-500 dark:text-zinc-400", children: "Loading uploads..." }) : o ? /* @__PURE__ */ i("div", { className: "p-4 text-center text-red-500 dark:text-red-400", children: [
|
|
1575
1575
|
o,
|
|
1576
1576
|
/* @__PURE__ */ e(
|
|
@@ -1590,7 +1590,7 @@ function pt({ onSelect: r }) {
|
|
|
1590
1590
|
/* @__PURE__ */ e(
|
|
1591
1591
|
"img",
|
|
1592
1592
|
{
|
|
1593
|
-
src:
|
|
1593
|
+
src: we(l.id),
|
|
1594
1594
|
alt: l.filename,
|
|
1595
1595
|
className: "w-full h-20 object-cover"
|
|
1596
1596
|
}
|
|
@@ -1604,14 +1604,14 @@ function pt({ onSelect: r }) {
|
|
|
1604
1604
|
}
|
|
1605
1605
|
) }),
|
|
1606
1606
|
/* @__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 }),
|
|
1607
|
-
/* @__PURE__ */ e("div", { className: "px-1 pb-1 text-xs text-gray-400 dark:text-zinc-500 bg-white dark:bg-zinc-800", children:
|
|
1607
|
+
/* @__PURE__ */ e("div", { className: "px-1 pb-1 text-xs text-gray-400 dark:text-zinc-500 bg-white dark:bg-zinc-800", children: p(l.size) })
|
|
1608
1608
|
]
|
|
1609
1609
|
},
|
|
1610
1610
|
l.id
|
|
1611
1611
|
)) }) });
|
|
1612
1612
|
}
|
|
1613
|
-
function
|
|
1614
|
-
const r =
|
|
1613
|
+
function pt() {
|
|
1614
|
+
const r = w((k) => k.setGenerators), d = w((k) => k.setTransforms), n = w((k) => k.setTextProviders), t = w((k) => k.setVisionProviders), a = w((k) => k.generators), o = w((k) => k.transforms), m = w((k) => k.textProviders), c = w((k) => k.visionProviders), s = w((k) => k.addNode), [p, l] = I(!1), { data: g } = X({
|
|
1615
1615
|
queryKey: ["generators"],
|
|
1616
1616
|
queryFn: Ee
|
|
1617
1617
|
}), { data: b } = X({
|
|
@@ -1633,10 +1633,10 @@ function mt() {
|
|
|
1633
1633
|
}, [f, n]), B(() => {
|
|
1634
1634
|
h && t(h);
|
|
1635
1635
|
}, [h, t]);
|
|
1636
|
-
const y = (
|
|
1637
|
-
|
|
1638
|
-
}, v = (
|
|
1639
|
-
s(
|
|
1636
|
+
const y = (k, W) => {
|
|
1637
|
+
k.dataTransfer.setData("application/json", JSON.stringify(W)), k.dataTransfer.effectAllowed = "move";
|
|
1638
|
+
}, v = (k) => {
|
|
1639
|
+
s(k, { x: 250, y: 150 + Math.random() * 100 });
|
|
1640
1640
|
}, C = {
|
|
1641
1641
|
id: "input:upload",
|
|
1642
1642
|
type: "input",
|
|
@@ -1670,15 +1670,15 @@ function mt() {
|
|
|
1670
1670
|
}
|
|
1671
1671
|
}
|
|
1672
1672
|
}, x = a.reduce(
|
|
1673
|
-
(
|
|
1673
|
+
(k, W) => {
|
|
1674
1674
|
const A = W.category || "Other";
|
|
1675
|
-
return
|
|
1675
|
+
return k[A] || (k[A] = []), k[A].push(W), k;
|
|
1676
1676
|
},
|
|
1677
1677
|
{}
|
|
1678
1678
|
), N = o.reduce(
|
|
1679
|
-
(
|
|
1679
|
+
(k, W) => {
|
|
1680
1680
|
const A = W.category || "Other";
|
|
1681
|
-
return
|
|
1681
|
+
return k[A] || (k[A] = []), k[A].push(W), k;
|
|
1682
1682
|
},
|
|
1683
1683
|
{}
|
|
1684
1684
|
);
|
|
@@ -1690,10 +1690,10 @@ function mt() {
|
|
|
1690
1690
|
/* @__PURE__ */ i(
|
|
1691
1691
|
"button",
|
|
1692
1692
|
{
|
|
1693
|
-
onClick: () => l(!
|
|
1693
|
+
onClick: () => l(!p),
|
|
1694
1694
|
className: "text-xs text-amber-600 dark:text-amber-400 hover:text-amber-700 dark:hover:text-amber-300",
|
|
1695
1695
|
children: [
|
|
1696
|
-
|
|
1696
|
+
p ? "Hide" : "Browse",
|
|
1697
1697
|
" Uploads"
|
|
1698
1698
|
]
|
|
1699
1699
|
}
|
|
@@ -1703,7 +1703,7 @@ function mt() {
|
|
|
1703
1703
|
"div",
|
|
1704
1704
|
{
|
|
1705
1705
|
draggable: !0,
|
|
1706
|
-
onDragStart: (
|
|
1706
|
+
onDragStart: (k) => y(k, C),
|
|
1707
1707
|
onDoubleClick: () => v(C),
|
|
1708
1708
|
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",
|
|
1709
1709
|
children: [
|
|
@@ -1712,12 +1712,12 @@ function mt() {
|
|
|
1712
1712
|
]
|
|
1713
1713
|
}
|
|
1714
1714
|
),
|
|
1715
|
-
|
|
1715
|
+
p && /* @__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(mt, {}) })
|
|
1716
1716
|
] }),
|
|
1717
1717
|
/* @__PURE__ */ i("div", { className: "mb-6", children: [
|
|
1718
1718
|
/* @__PURE__ */ e("h3", { className: "text-sm font-medium text-blue-600 dark:text-blue-400 uppercase tracking-wide mb-2", children: "Generators" }),
|
|
1719
|
-
Object.entries(x).map(([
|
|
1720
|
-
/* @__PURE__ */ e("div", { className: "text-xs text-gray-500 dark:text-zinc-400 mb-1", children:
|
|
1719
|
+
Object.entries(x).map(([k, W]) => /* @__PURE__ */ i("div", { className: "mb-3", children: [
|
|
1720
|
+
/* @__PURE__ */ e("div", { className: "text-xs text-gray-500 dark:text-zinc-400 mb-1", children: k }),
|
|
1721
1721
|
W.map((A) => /* @__PURE__ */ i(
|
|
1722
1722
|
"div",
|
|
1723
1723
|
{
|
|
@@ -1732,12 +1732,12 @@ function mt() {
|
|
|
1732
1732
|
},
|
|
1733
1733
|
A.id
|
|
1734
1734
|
))
|
|
1735
|
-
] },
|
|
1735
|
+
] }, k))
|
|
1736
1736
|
] }),
|
|
1737
1737
|
/* @__PURE__ */ i("div", { className: "mb-6", children: [
|
|
1738
1738
|
/* @__PURE__ */ e("h3", { className: "text-sm font-medium text-teal-600 dark:text-teal-400 uppercase tracking-wide mb-2", children: "Transforms" }),
|
|
1739
|
-
Object.entries(N).map(([
|
|
1740
|
-
/* @__PURE__ */ e("div", { className: "text-xs text-gray-500 dark:text-zinc-400 mb-1", children:
|
|
1739
|
+
Object.entries(N).map(([k, W]) => /* @__PURE__ */ i("div", { className: "mb-3", children: [
|
|
1740
|
+
/* @__PURE__ */ e("div", { className: "text-xs text-gray-500 dark:text-zinc-400 mb-1", children: k }),
|
|
1741
1741
|
W.map((A) => /* @__PURE__ */ i(
|
|
1742
1742
|
"div",
|
|
1743
1743
|
{
|
|
@@ -1752,40 +1752,40 @@ function mt() {
|
|
|
1752
1752
|
},
|
|
1753
1753
|
A.id
|
|
1754
1754
|
))
|
|
1755
|
-
] },
|
|
1755
|
+
] }, k))
|
|
1756
1756
|
] }),
|
|
1757
|
-
|
|
1757
|
+
m.length > 0 && /* @__PURE__ */ i("div", { className: "mb-6", children: [
|
|
1758
1758
|
/* @__PURE__ */ e("h3", { className: "text-sm font-medium text-pink-600 dark:text-pink-400 uppercase tracking-wide mb-2", children: "AI Text" }),
|
|
1759
|
-
|
|
1759
|
+
m.map((k) => /* @__PURE__ */ i(
|
|
1760
1760
|
"div",
|
|
1761
1761
|
{
|
|
1762
1762
|
draggable: !0,
|
|
1763
|
-
onDragStart: (W) => y(W,
|
|
1764
|
-
onDoubleClick: () => v(
|
|
1763
|
+
onDragStart: (W) => y(W, k),
|
|
1764
|
+
onDoubleClick: () => v(k),
|
|
1765
1765
|
className: "px-3 py-2 bg-pink-50 dark:bg-pink-900/30 border border-pink-200 dark:border-pink-700 rounded mb-1 cursor-grab active:cursor-grabbing hover:bg-pink-100 dark:hover:bg-pink-900/50 transition-colors",
|
|
1766
1766
|
children: [
|
|
1767
|
-
/* @__PURE__ */ e("div", { className: "text-sm font-medium text-pink-700 dark:text-pink-300", children:
|
|
1768
|
-
|
|
1767
|
+
/* @__PURE__ */ e("div", { className: "text-sm font-medium text-pink-700 dark:text-pink-300", children: k.label }),
|
|
1768
|
+
k.description && /* @__PURE__ */ e("div", { className: "text-xs text-gray-500 dark:text-zinc-400 truncate", children: k.description })
|
|
1769
1769
|
]
|
|
1770
1770
|
},
|
|
1771
|
-
|
|
1771
|
+
k.id
|
|
1772
1772
|
))
|
|
1773
1773
|
] }),
|
|
1774
1774
|
c.length > 0 && /* @__PURE__ */ i("div", { className: "mb-6", children: [
|
|
1775
1775
|
/* @__PURE__ */ e("h3", { className: "text-sm font-medium text-cyan-600 dark:text-cyan-400 uppercase tracking-wide mb-2", children: "AI Vision" }),
|
|
1776
|
-
c.map((
|
|
1776
|
+
c.map((k) => /* @__PURE__ */ i(
|
|
1777
1777
|
"div",
|
|
1778
1778
|
{
|
|
1779
1779
|
draggable: !0,
|
|
1780
|
-
onDragStart: (W) => y(W,
|
|
1781
|
-
onDoubleClick: () => v(
|
|
1780
|
+
onDragStart: (W) => y(W, k),
|
|
1781
|
+
onDoubleClick: () => v(k),
|
|
1782
1782
|
className: "px-3 py-2 bg-cyan-50 dark:bg-cyan-900/30 border border-cyan-200 dark:border-cyan-700 rounded mb-1 cursor-grab active:cursor-grabbing hover:bg-cyan-100 dark:hover:bg-cyan-900/50 transition-colors",
|
|
1783
1783
|
children: [
|
|
1784
|
-
/* @__PURE__ */ e("div", { className: "text-sm font-medium text-cyan-700 dark:text-cyan-300", children:
|
|
1785
|
-
|
|
1784
|
+
/* @__PURE__ */ e("div", { className: "text-sm font-medium text-cyan-700 dark:text-cyan-300", children: k.label }),
|
|
1785
|
+
k.description && /* @__PURE__ */ e("div", { className: "text-xs text-gray-500 dark:text-zinc-400 truncate", children: k.description })
|
|
1786
1786
|
]
|
|
1787
1787
|
},
|
|
1788
|
-
|
|
1788
|
+
k.id
|
|
1789
1789
|
))
|
|
1790
1790
|
] }),
|
|
1791
1791
|
/* @__PURE__ */ i("div", { className: "mb-6", children: [
|
|
@@ -1794,7 +1794,7 @@ function mt() {
|
|
|
1794
1794
|
"div",
|
|
1795
1795
|
{
|
|
1796
1796
|
draggable: !0,
|
|
1797
|
-
onDragStart: (
|
|
1797
|
+
onDragStart: (k) => y(k, u),
|
|
1798
1798
|
onDoubleClick: () => v(u),
|
|
1799
1799
|
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",
|
|
1800
1800
|
children: [
|
|
@@ -1808,19 +1808,19 @@ function mt() {
|
|
|
1808
1808
|
}
|
|
1809
1809
|
function gt() {
|
|
1810
1810
|
var h, y, v, C;
|
|
1811
|
-
const r =
|
|
1811
|
+
const r = w((u) => u.selectedNodeId), d = w((u) => u.nodes), n = w((u) => u.generators), t = w((u) => u.transforms), a = w((u) => u.textProviders), o = w((u) => u.visionProviders), m = w((u) => u.updateNodeData), c = w((u) => u.deleteNode), s = d.find((u) => u.id === r);
|
|
1812
1812
|
if (!s)
|
|
1813
1813
|
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" }) });
|
|
1814
|
-
let
|
|
1814
|
+
let p, l = "";
|
|
1815
1815
|
if (s.type === "generator") {
|
|
1816
1816
|
const u = s.data, x = n.find((N) => N.name === u.generatorName);
|
|
1817
|
-
|
|
1817
|
+
p = (h = x == null ? void 0 : x.params) == null ? void 0 : h.properties, l = (x == null ? void 0 : x.label) || u.generatorName;
|
|
1818
1818
|
} else if (s.type === "transform") {
|
|
1819
1819
|
const u = s.data, x = t.find((N) => N.name === u.operation);
|
|
1820
|
-
|
|
1820
|
+
p = (y = x == null ? void 0 : x.params) == null ? void 0 : y.properties, l = (x == null ? void 0 : x.label) || u.operation;
|
|
1821
1821
|
} else if (s.type === "save") {
|
|
1822
1822
|
const x = s.data.provider === "floimg-cloud";
|
|
1823
|
-
l = x ? "Save to FloImg Cloud" : "Save",
|
|
1823
|
+
l = x ? "Save to FloImg Cloud" : "Save", p = {
|
|
1824
1824
|
destination: {
|
|
1825
1825
|
type: "string",
|
|
1826
1826
|
title: x ? "Filename" : "Destination",
|
|
@@ -1829,32 +1829,32 @@ function gt() {
|
|
|
1829
1829
|
};
|
|
1830
1830
|
} else if (s.type === "text") {
|
|
1831
1831
|
const u = s.data, x = a.find((N) => N.name === u.providerName);
|
|
1832
|
-
|
|
1832
|
+
p = (v = x == null ? void 0 : x.params) == null ? void 0 : v.properties, l = (x == null ? void 0 : x.label) || u.providerName;
|
|
1833
1833
|
} else if (s.type === "vision") {
|
|
1834
1834
|
const u = s.data, x = o.find((N) => N.name === u.providerName);
|
|
1835
|
-
|
|
1835
|
+
p = (C = x == null ? void 0 : x.params) == null ? void 0 : C.properties, l = (x == null ? void 0 : x.label) || u.providerName;
|
|
1836
1836
|
}
|
|
1837
1837
|
const g = (u, x) => {
|
|
1838
1838
|
if (s.type === "generator") {
|
|
1839
1839
|
const N = s.data;
|
|
1840
|
-
|
|
1840
|
+
m(s.id, {
|
|
1841
1841
|
params: { ...N.params, [u]: x }
|
|
1842
1842
|
});
|
|
1843
1843
|
} else if (s.type === "transform") {
|
|
1844
1844
|
const N = s.data;
|
|
1845
|
-
|
|
1845
|
+
m(s.id, {
|
|
1846
1846
|
params: { ...N.params, [u]: x }
|
|
1847
1847
|
});
|
|
1848
1848
|
} else if (s.type === "save")
|
|
1849
|
-
|
|
1849
|
+
m(s.id, { [u]: x });
|
|
1850
1850
|
else if (s.type === "text") {
|
|
1851
1851
|
const N = s.data;
|
|
1852
|
-
|
|
1852
|
+
m(s.id, {
|
|
1853
1853
|
params: { ...N.params, [u]: x }
|
|
1854
1854
|
});
|
|
1855
1855
|
} else if (s.type === "vision") {
|
|
1856
1856
|
const N = s.data;
|
|
1857
|
-
|
|
1857
|
+
m(s.id, {
|
|
1858
1858
|
params: { ...N.params, [u]: x }
|
|
1859
1859
|
});
|
|
1860
1860
|
}
|
|
@@ -1871,15 +1871,15 @@ function gt() {
|
|
|
1871
1871
|
return s.data.params[u];
|
|
1872
1872
|
}, f = (u, x) => {
|
|
1873
1873
|
if (s.type === "generator" && s.data.generatorName === "shapes") {
|
|
1874
|
-
const N = b("shapeType") || "rectangle",
|
|
1874
|
+
const N = b("shapeType") || "rectangle", k = b("fillType") || "solid";
|
|
1875
1875
|
if (u === "sides") return N === "polygon";
|
|
1876
1876
|
if (u === "points" || u === "innerRadius") return N === "star";
|
|
1877
1877
|
if (u === "cornerRadius") return N === "rectangle";
|
|
1878
|
-
if (u === "fillColor") return
|
|
1878
|
+
if (u === "fillColor") return k === "solid";
|
|
1879
1879
|
if (u === "gradientType" || u === "gradientColor1" || u === "gradientColor2" || u === "gradientAngle")
|
|
1880
|
-
return
|
|
1880
|
+
return k === "gradient";
|
|
1881
1881
|
if (u === "patternType" || u === "patternColor" || u === "patternBackground" || u === "patternScale")
|
|
1882
|
-
return
|
|
1882
|
+
return k === "pattern";
|
|
1883
1883
|
}
|
|
1884
1884
|
return !0;
|
|
1885
1885
|
};
|
|
@@ -1895,7 +1895,7 @@ function gt() {
|
|
|
1895
1895
|
}
|
|
1896
1896
|
)
|
|
1897
1897
|
] }),
|
|
1898
|
-
/* @__PURE__ */ e("div", { className: "space-y-4", children:
|
|
1898
|
+
/* @__PURE__ */ e("div", { className: "space-y-4", children: p && Object.entries(p).filter(([u, x]) => f(u)).map(([u, x]) => /* @__PURE__ */ e(
|
|
1899
1899
|
ut,
|
|
1900
1900
|
{
|
|
1901
1901
|
name: u,
|
|
@@ -1910,7 +1910,7 @@ function gt() {
|
|
|
1910
1910
|
{
|
|
1911
1911
|
nodeId: s.id,
|
|
1912
1912
|
outputSchema: s.data.outputSchema,
|
|
1913
|
-
updateNodeData:
|
|
1913
|
+
updateNodeData: m
|
|
1914
1914
|
}
|
|
1915
1915
|
)
|
|
1916
1916
|
] }) });
|
|
@@ -1923,11 +1923,11 @@ function ut({ name: r, field: d, value: n, onChange: t }) {
|
|
|
1923
1923
|
"select",
|
|
1924
1924
|
{
|
|
1925
1925
|
value: String(n || ""),
|
|
1926
|
-
onChange: (
|
|
1926
|
+
onChange: (m) => t(m.target.value),
|
|
1927
1927
|
className: o,
|
|
1928
1928
|
children: [
|
|
1929
1929
|
/* @__PURE__ */ e("option", { value: "", children: "Select..." }),
|
|
1930
|
-
d.enum.map((
|
|
1930
|
+
d.enum.map((m) => /* @__PURE__ */ e("option", { value: m, children: m }, m))
|
|
1931
1931
|
]
|
|
1932
1932
|
}
|
|
1933
1933
|
),
|
|
@@ -1939,7 +1939,7 @@ function ut({ name: r, field: d, value: n, onChange: t }) {
|
|
|
1939
1939
|
{
|
|
1940
1940
|
type: "number",
|
|
1941
1941
|
value: n !== void 0 ? Number(n) : "",
|
|
1942
|
-
onChange: (
|
|
1942
|
+
onChange: (m) => t(Number(m.target.value)),
|
|
1943
1943
|
min: d.minimum,
|
|
1944
1944
|
max: d.maximum,
|
|
1945
1945
|
className: o
|
|
@@ -1952,7 +1952,7 @@ function ut({ name: r, field: d, value: n, onChange: t }) {
|
|
|
1952
1952
|
{
|
|
1953
1953
|
type: "checkbox",
|
|
1954
1954
|
checked: !!n,
|
|
1955
|
-
onChange: (
|
|
1955
|
+
onChange: (m) => t(m.target.checked),
|
|
1956
1956
|
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"
|
|
1957
1957
|
}
|
|
1958
1958
|
),
|
|
@@ -1965,7 +1965,7 @@ function ut({ name: r, field: d, value: n, onChange: t }) {
|
|
|
1965
1965
|
{
|
|
1966
1966
|
type: "color",
|
|
1967
1967
|
value: String(n || "#000000"),
|
|
1968
|
-
onChange: (
|
|
1968
|
+
onChange: (m) => t(m.target.value),
|
|
1969
1969
|
className: "h-10 w-14 p-1 border border-gray-300 dark:border-zinc-600 rounded"
|
|
1970
1970
|
}
|
|
1971
1971
|
),
|
|
@@ -1974,7 +1974,7 @@ function ut({ name: r, field: d, value: n, onChange: t }) {
|
|
|
1974
1974
|
{
|
|
1975
1975
|
type: "text",
|
|
1976
1976
|
value: String(n || ""),
|
|
1977
|
-
onChange: (
|
|
1977
|
+
onChange: (m) => t(m.target.value),
|
|
1978
1978
|
className: o + " flex-1"
|
|
1979
1979
|
}
|
|
1980
1980
|
)
|
|
@@ -1985,9 +1985,9 @@ function ut({ name: r, field: d, value: n, onChange: t }) {
|
|
|
1985
1985
|
"textarea",
|
|
1986
1986
|
{
|
|
1987
1987
|
value: n ? JSON.stringify(n, null, 2) : "{}",
|
|
1988
|
-
onChange: (
|
|
1988
|
+
onChange: (m) => {
|
|
1989
1989
|
try {
|
|
1990
|
-
t(JSON.parse(
|
|
1990
|
+
t(JSON.parse(m.target.value));
|
|
1991
1991
|
} catch {
|
|
1992
1992
|
}
|
|
1993
1993
|
},
|
|
@@ -2002,7 +2002,7 @@ function ut({ name: r, field: d, value: n, onChange: t }) {
|
|
|
2002
2002
|
"textarea",
|
|
2003
2003
|
{
|
|
2004
2004
|
value: String(n || ""),
|
|
2005
|
-
onChange: (
|
|
2005
|
+
onChange: (m) => t(m.target.value),
|
|
2006
2006
|
rows: 3,
|
|
2007
2007
|
className: o
|
|
2008
2008
|
}
|
|
@@ -2011,7 +2011,7 @@ function ut({ name: r, field: d, value: n, onChange: t }) {
|
|
|
2011
2011
|
{
|
|
2012
2012
|
type: "text",
|
|
2013
2013
|
value: String(n || ""),
|
|
2014
|
-
onChange: (
|
|
2014
|
+
onChange: (m) => t(m.target.value),
|
|
2015
2015
|
className: o
|
|
2016
2016
|
}
|
|
2017
2017
|
),
|
|
@@ -2019,7 +2019,7 @@ function ut({ name: r, field: d, value: n, onChange: t }) {
|
|
|
2019
2019
|
] });
|
|
2020
2020
|
}
|
|
2021
2021
|
function ht({ nodeId: r, outputSchema: d, updateNodeData: n }) {
|
|
2022
|
-
const [t, a] = I(""), o = (d == null ? void 0 : d.properties) || {},
|
|
2022
|
+
const [t, a] = I(""), o = (d == null ? void 0 : d.properties) || {}, m = Object.entries(o), c = () => {
|
|
2023
2023
|
if (!t.trim()) return;
|
|
2024
2024
|
const g = {
|
|
2025
2025
|
type: "object",
|
|
@@ -2034,7 +2034,7 @@ function ht({ nodeId: r, outputSchema: d, updateNodeData: n }) {
|
|
|
2034
2034
|
delete b[g], Object.keys(b).length === 0 ? n(r, { outputSchema: void 0 }) : n(r, {
|
|
2035
2035
|
outputSchema: { type: "object", properties: b }
|
|
2036
2036
|
});
|
|
2037
|
-
},
|
|
2037
|
+
}, p = (g, b) => {
|
|
2038
2038
|
n(r, {
|
|
2039
2039
|
outputSchema: {
|
|
2040
2040
|
type: "object",
|
|
@@ -2058,10 +2058,10 @@ function ht({ nodeId: r, outputSchema: d, updateNodeData: n }) {
|
|
|
2058
2058
|
return /* @__PURE__ */ i("div", { className: "mt-6 pt-4 border-t border-gray-200 dark:border-zinc-700", children: [
|
|
2059
2059
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-3", children: [
|
|
2060
2060
|
/* @__PURE__ */ e("h3", { className: "text-sm font-medium text-gray-700 dark:text-zinc-300", children: "Output Schema" }),
|
|
2061
|
-
/* @__PURE__ */ e("span", { className: "text-xs text-gray-500 dark:text-zinc-500", children:
|
|
2061
|
+
/* @__PURE__ */ e("span", { className: "text-xs text-gray-500 dark:text-zinc-500", children: m.length > 0 ? `${m.length} output${m.length > 1 ? "s" : ""}` : "No outputs defined" })
|
|
2062
2062
|
] }),
|
|
2063
2063
|
/* @__PURE__ */ e("p", { className: "text-xs text-gray-500 dark:text-zinc-400 mb-3", children: "Define output properties to enable connecting individual JSON fields to other nodes." }),
|
|
2064
|
-
|
|
2064
|
+
m.length > 0 && /* @__PURE__ */ e("div", { className: "space-y-2 mb-3", children: m.map(([g, b]) => /* @__PURE__ */ i(
|
|
2065
2065
|
"div",
|
|
2066
2066
|
{
|
|
2067
2067
|
className: "flex items-center gap-2 p-2 bg-pink-50 dark:bg-pink-900/20 rounded border border-pink-200 dark:border-pink-800",
|
|
@@ -2073,7 +2073,7 @@ function ht({ nodeId: r, outputSchema: d, updateNodeData: n }) {
|
|
|
2073
2073
|
"select",
|
|
2074
2074
|
{
|
|
2075
2075
|
value: b.type,
|
|
2076
|
-
onChange: (f) =>
|
|
2076
|
+
onChange: (f) => p(g, f.target.value),
|
|
2077
2077
|
className: "text-xs px-1.5 py-0.5 rounded border border-pink-300 dark:border-pink-700 bg-white dark:bg-zinc-800 text-gray-700 dark:text-zinc-300",
|
|
2078
2078
|
children: [
|
|
2079
2079
|
/* @__PURE__ */ e("option", { value: "string", children: "string" }),
|
|
@@ -2139,7 +2139,7 @@ function ht({ nodeId: r, outputSchema: d, updateNodeData: n }) {
|
|
|
2139
2139
|
}
|
|
2140
2140
|
)
|
|
2141
2141
|
] }),
|
|
2142
|
-
|
|
2142
|
+
m.length > 0 && /* @__PURE__ */ e("p", { className: "mt-3 text-xs text-gray-500 dark:text-zinc-500", children: "Connect from the small pink handles on the right of the node to route individual properties." })
|
|
2143
2143
|
] });
|
|
2144
2144
|
}
|
|
2145
2145
|
function ft(r, d) {
|
|
@@ -2153,17 +2153,17 @@ function ft(r, d) {
|
|
|
2153
2153
|
const o = [];
|
|
2154
2154
|
for (const [c, s] of t)
|
|
2155
2155
|
s === 0 && o.push(c);
|
|
2156
|
-
const
|
|
2156
|
+
const m = [];
|
|
2157
2157
|
for (; o.length > 0; ) {
|
|
2158
2158
|
const c = o.shift(), s = n.get(c);
|
|
2159
|
-
s &&
|
|
2160
|
-
const
|
|
2161
|
-
for (const l of
|
|
2159
|
+
s && m.push(s);
|
|
2160
|
+
const p = a.get(c) || [];
|
|
2161
|
+
for (const l of p) {
|
|
2162
2162
|
const g = (t.get(l) || 1) - 1;
|
|
2163
2163
|
t.set(l, g), g === 0 && o.push(l);
|
|
2164
2164
|
}
|
|
2165
2165
|
}
|
|
2166
|
-
return
|
|
2166
|
+
return m;
|
|
2167
2167
|
}
|
|
2168
2168
|
function bt(r) {
|
|
2169
2169
|
const d = r.type || "node", n = r.id.replace(/[^a-zA-Z0-9]/g, "_");
|
|
@@ -2174,17 +2174,17 @@ function Y(r) {
|
|
|
2174
2174
|
`) ? "`" + r.replace(/`/g, "\\`").replace(/\$/g, "\\$") + "`" : JSON.stringify(r) : JSON.stringify(r, null, 2);
|
|
2175
2175
|
}
|
|
2176
2176
|
function xt(r, d, n) {
|
|
2177
|
-
const t = n.get(r.id), a = [], o = d.find((c) => c.target === r.id),
|
|
2177
|
+
const t = n.get(r.id), a = [], o = d.find((c) => c.target === r.id), m = o ? n.get(o.source) : null;
|
|
2178
2178
|
switch (r.type) {
|
|
2179
2179
|
case "generator": {
|
|
2180
2180
|
const c = r.data;
|
|
2181
2181
|
a.push(c.generatorName);
|
|
2182
|
-
const s = c.params || {},
|
|
2182
|
+
const s = c.params || {}, p = Object.entries(s).filter(([, l]) => l !== void 0 && l !== "").map(([l, g]) => ` ${l}: ${Y(g)}`).join(`,
|
|
2183
2183
|
`);
|
|
2184
2184
|
return {
|
|
2185
2185
|
code: `// Generate image using ${c.generatorName}
|
|
2186
2186
|
const ${t} = await ${c.generatorName}({
|
|
2187
|
-
${
|
|
2187
|
+
${p}
|
|
2188
2188
|
});`,
|
|
2189
2189
|
imports: a
|
|
2190
2190
|
};
|
|
@@ -2196,21 +2196,21 @@ const ${t} = await flo.loadImage("./input.png");`,
|
|
|
2196
2196
|
imports: []
|
|
2197
2197
|
};
|
|
2198
2198
|
case "transform": {
|
|
2199
|
-
const c = r.data, s = c.params || {},
|
|
2199
|
+
const c = r.data, s = c.params || {}, p = Object.entries(s).filter(([, g]) => g !== void 0 && g !== "").map(([g, b]) => `${g}: ${Y(b)}`).join(", "), l = m || "image";
|
|
2200
2200
|
return {
|
|
2201
2201
|
code: `// Apply ${c.operation} transform
|
|
2202
|
-
const ${t} = await flo.transform(${l}, "${c.operation}"${
|
|
2202
|
+
const ${t} = await flo.transform(${l}, "${c.operation}"${p ? `, { ${p} }` : ""});`,
|
|
2203
2203
|
imports: []
|
|
2204
2204
|
};
|
|
2205
2205
|
}
|
|
2206
2206
|
case "vision": {
|
|
2207
2207
|
const c = r.data;
|
|
2208
2208
|
a.push(c.providerName);
|
|
2209
|
-
const s = c.params || {},
|
|
2209
|
+
const s = c.params || {}, p = m || "image", l = Object.entries(s).filter(([, g]) => g !== void 0 && g !== "").map(([g, b]) => ` ${g}: ${Y(b)}`).join(`,
|
|
2210
2210
|
`);
|
|
2211
2211
|
return {
|
|
2212
2212
|
code: `// Analyze image with ${c.providerName}
|
|
2213
|
-
const ${t} = await ${c.providerName}.analyze(${
|
|
2213
|
+
const ${t} = await ${c.providerName}.analyze(${p}, {
|
|
2214
2214
|
${l}
|
|
2215
2215
|
});`,
|
|
2216
2216
|
imports: a
|
|
@@ -2219,12 +2219,12 @@ ${l}
|
|
|
2219
2219
|
case "text": {
|
|
2220
2220
|
const c = r.data;
|
|
2221
2221
|
a.push(c.providerName);
|
|
2222
|
-
const s = c.params || {},
|
|
2222
|
+
const s = c.params || {}, p = Object.entries(s).filter(([, l]) => l !== void 0 && l !== "").map(([l, g]) => ` ${l}: ${Y(g)}`).join(`,
|
|
2223
2223
|
`);
|
|
2224
2224
|
return {
|
|
2225
2225
|
code: `// Generate text with ${c.providerName}
|
|
2226
2226
|
const ${t} = await ${c.providerName}.generate({
|
|
2227
|
-
${
|
|
2227
|
+
${p}
|
|
2228
2228
|
});`,
|
|
2229
2229
|
imports: a
|
|
2230
2230
|
};
|
|
@@ -2233,7 +2233,7 @@ ${m}
|
|
|
2233
2233
|
const c = r.data;
|
|
2234
2234
|
return {
|
|
2235
2235
|
code: `// Save result
|
|
2236
|
-
await flo.save(${
|
|
2236
|
+
await flo.save(${m || "result"}, ${Y(c.destination)});`,
|
|
2237
2237
|
imports: []
|
|
2238
2238
|
};
|
|
2239
2239
|
}
|
|
@@ -2249,17 +2249,17 @@ function yt(r, d) {
|
|
|
2249
2249
|
return `// Empty workflow
|
|
2250
2250
|
// Add nodes to your canvas to generate code`;
|
|
2251
2251
|
const n = ft(r, d), t = /* @__PURE__ */ new Map();
|
|
2252
|
-
for (const
|
|
2253
|
-
t.set(
|
|
2252
|
+
for (const p of n)
|
|
2253
|
+
t.set(p.id, bt(p));
|
|
2254
2254
|
const a = /* @__PURE__ */ new Set(), o = [];
|
|
2255
|
-
for (const
|
|
2256
|
-
const { code: l, imports: g } = xt(
|
|
2255
|
+
for (const p of n) {
|
|
2256
|
+
const { code: l, imports: g } = xt(p, d, t);
|
|
2257
2257
|
o.push(l);
|
|
2258
2258
|
for (const b of g)
|
|
2259
2259
|
a.add(b);
|
|
2260
2260
|
}
|
|
2261
|
-
const
|
|
2262
|
-
a.size > 0 &&
|
|
2261
|
+
const m = [];
|
|
2262
|
+
a.size > 0 && m.push(`import { ${Array.from(a).join(", ")} } from "@teamflojo/floimg";`), m.push('import * as flo from "@teamflojo/floimg";');
|
|
2263
2263
|
const c = `/**
|
|
2264
2264
|
* FloImg Workflow
|
|
2265
2265
|
* Generated by FloImg Studio
|
|
@@ -2269,7 +2269,7 @@ function yt(r, d) {
|
|
|
2269
2269
|
`, s = `
|
|
2270
2270
|
async function runWorkflow() {
|
|
2271
2271
|
${o.map(
|
|
2272
|
-
(
|
|
2272
|
+
(p) => p.split(`
|
|
2273
2273
|
`).map((l) => " " + l).join(`
|
|
2274
2274
|
`)
|
|
2275
2275
|
).join(`
|
|
@@ -2280,17 +2280,17 @@ ${o.map(
|
|
|
2280
2280
|
// Run the workflow
|
|
2281
2281
|
runWorkflow().catch(console.error);
|
|
2282
2282
|
`;
|
|
2283
|
-
return c +
|
|
2283
|
+
return c + m.join(`
|
|
2284
2284
|
`) + `
|
|
2285
2285
|
` + s;
|
|
2286
2286
|
}
|
|
2287
|
-
function
|
|
2288
|
-
const [t, a] = I(""), [o,
|
|
2287
|
+
function kt({ isOpen: r, onClose: d, onImport: n }) {
|
|
2288
|
+
const [t, a] = I(""), [o, m] = I(!1), [c, s] = I(null), [p, l] = I(!1), g = L(async () => {
|
|
2289
2289
|
if (!t.trim()) {
|
|
2290
2290
|
s({ message: "Please enter or paste YAML content" });
|
|
2291
2291
|
return;
|
|
2292
2292
|
}
|
|
2293
|
-
|
|
2293
|
+
m(!0), s(null);
|
|
2294
2294
|
try {
|
|
2295
2295
|
const u = await Qe(t);
|
|
2296
2296
|
u.success ? (n(u.nodes, u.edges, u.name), a(""), d()) : s({
|
|
@@ -2301,21 +2301,21 @@ function wt({ isOpen: r, onClose: d, onImport: n }) {
|
|
|
2301
2301
|
} catch (u) {
|
|
2302
2302
|
s({ message: u instanceof Error ? u.message : "Import failed" });
|
|
2303
2303
|
} finally {
|
|
2304
|
-
|
|
2304
|
+
m(!1);
|
|
2305
2305
|
}
|
|
2306
2306
|
}, [t, n, d]), b = L(async () => {
|
|
2307
2307
|
if (!t.trim()) {
|
|
2308
2308
|
s({ message: "Please enter or paste YAML content" });
|
|
2309
2309
|
return;
|
|
2310
2310
|
}
|
|
2311
|
-
|
|
2311
|
+
m(!0), s(null);
|
|
2312
2312
|
try {
|
|
2313
2313
|
const u = await Ye(t);
|
|
2314
2314
|
u.valid ? (s(null), s({ message: "Valid YAML!" }), setTimeout(() => s(null), 2e3)) : u.errors.length > 0 && s(u.errors[0]);
|
|
2315
2315
|
} catch (u) {
|
|
2316
2316
|
s({ message: u instanceof Error ? u.message : "Validation failed" });
|
|
2317
2317
|
} finally {
|
|
2318
|
-
|
|
2318
|
+
m(!1);
|
|
2319
2319
|
}
|
|
2320
2320
|
}, [t]), f = L(async (u) => {
|
|
2321
2321
|
if (!u.name.endsWith(".yaml") && !u.name.endsWith(".yml")) {
|
|
@@ -2375,7 +2375,7 @@ function wt({ isOpen: r, onClose: d, onImport: n }) {
|
|
|
2375
2375
|
onDragOver: h,
|
|
2376
2376
|
onDragLeave: y,
|
|
2377
2377
|
onDrop: v,
|
|
2378
|
-
className: `border-2 border-dashed rounded-lg p-4 mb-4 text-center transition-colors ${
|
|
2378
|
+
className: `border-2 border-dashed rounded-lg p-4 mb-4 text-center transition-colors ${p ? "border-teal-500 bg-teal-50 dark:bg-teal-900/20" : "border-gray-300 dark:border-zinc-600"}`,
|
|
2379
2379
|
children: [
|
|
2380
2380
|
/* @__PURE__ */ e(
|
|
2381
2381
|
"input",
|
|
@@ -2515,14 +2515,14 @@ steps:
|
|
|
2515
2515
|
] })
|
|
2516
2516
|
] }) }) : null;
|
|
2517
2517
|
}
|
|
2518
|
-
function
|
|
2518
|
+
function wt({
|
|
2519
2519
|
brandingSlot: r,
|
|
2520
2520
|
beforeActionsSlot: d,
|
|
2521
2521
|
afterActionsSlot: n,
|
|
2522
2522
|
hideAttribution: t = !1,
|
|
2523
2523
|
hideWorkflowLibrary: a = !1
|
|
2524
2524
|
} = {}) {
|
|
2525
|
-
const o =
|
|
2525
|
+
const o = w((z) => z.execution), m = w((z) => z.execute), c = w((z) => z.cancelExecution), s = w((z) => z.exportToYaml), p = w((z) => z.importFromYaml), l = w((z) => z.nodes), g = w((z) => z.edges), b = G((z) => z.openSettings), f = w((z) => z.activeWorkflowName), h = w((z) => z.hasUnsavedChanges), y = w((z) => z.saveWorkflow), v = w((z) => z.toggleLibrary), C = w((z) => z.setActiveWorkflowName), u = w((z) => z.selectedNodeId), x = w((z) => z.duplicateNode), [N, k] = I(!1), [W, A] = I(!1), [U, K] = I("yaml"), [F, ee] = I(""), [te, oe] = I(""), [re, E] = I(null), [S, D] = I(!1), [P, q] = I("");
|
|
2526
2526
|
B(() => {
|
|
2527
2527
|
const z = () => {
|
|
2528
2528
|
E("New workflow created"), setTimeout(() => E(null), 2e3);
|
|
@@ -2546,20 +2546,20 @@ function kt({
|
|
|
2546
2546
|
return document.addEventListener("keydown", z), () => document.removeEventListener("keydown", z);
|
|
2547
2547
|
}, [ne, ue]);
|
|
2548
2548
|
const ze = async () => {
|
|
2549
|
-
await
|
|
2549
|
+
await m();
|
|
2550
2550
|
}, Ce = async () => {
|
|
2551
2551
|
const z = await s();
|
|
2552
2552
|
ee(z);
|
|
2553
2553
|
const j = yt(l, g);
|
|
2554
|
-
oe(j),
|
|
2554
|
+
oe(j), k(!0);
|
|
2555
2555
|
}, Ie = () => {
|
|
2556
2556
|
const z = U === "yaml" ? F : te;
|
|
2557
2557
|
navigator.clipboard.writeText(z);
|
|
2558
2558
|
}, Se = L(
|
|
2559
2559
|
(z, j, Ae) => {
|
|
2560
|
-
|
|
2560
|
+
p(z, j, Ae), E("Workflow imported!"), setTimeout(() => E(null), 2e3);
|
|
2561
2561
|
},
|
|
2562
|
-
[
|
|
2562
|
+
[p]
|
|
2563
2563
|
);
|
|
2564
2564
|
return /* @__PURE__ */ i(O, { children: [
|
|
2565
2565
|
/* @__PURE__ */ i("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: [
|
|
@@ -2790,7 +2790,7 @@ function kt({
|
|
|
2790
2790
|
/* @__PURE__ */ e(
|
|
2791
2791
|
"button",
|
|
2792
2792
|
{
|
|
2793
|
-
onClick: () =>
|
|
2793
|
+
onClick: () => k(!1),
|
|
2794
2794
|
className: "text-gray-500 dark:text-zinc-400 hover:text-gray-700 dark:hover:text-zinc-200",
|
|
2795
2795
|
children: /* @__PURE__ */ e("svg", { className: "h-6 w-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e(
|
|
2796
2796
|
"path",
|
|
@@ -2819,7 +2819,7 @@ function kt({
|
|
|
2819
2819
|
/* @__PURE__ */ e(
|
|
2820
2820
|
"button",
|
|
2821
2821
|
{
|
|
2822
|
-
onClick: () =>
|
|
2822
|
+
onClick: () => k(!1),
|
|
2823
2823
|
className: "px-4 py-2 text-sm font-medium text-white bg-teal-600 rounded-md hover:bg-teal-700",
|
|
2824
2824
|
children: "Close"
|
|
2825
2825
|
}
|
|
@@ -2828,7 +2828,7 @@ function kt({
|
|
|
2828
2828
|
] })
|
|
2829
2829
|
] }) }),
|
|
2830
2830
|
/* @__PURE__ */ e(
|
|
2831
|
-
|
|
2831
|
+
kt,
|
|
2832
2832
|
{
|
|
2833
2833
|
isOpen: W,
|
|
2834
2834
|
onClose: () => A(!1),
|
|
@@ -2838,11 +2838,11 @@ function kt({
|
|
|
2838
2838
|
] });
|
|
2839
2839
|
}
|
|
2840
2840
|
function vt() {
|
|
2841
|
-
const r =
|
|
2841
|
+
const r = w((s) => s.loadTemplate), [d, n] = I(null), {
|
|
2842
2842
|
data: t,
|
|
2843
2843
|
isLoading: a,
|
|
2844
2844
|
error: o,
|
|
2845
|
-
refetch:
|
|
2845
|
+
refetch: m
|
|
2846
2846
|
} = X({
|
|
2847
2847
|
queryKey: ["images"],
|
|
2848
2848
|
queryFn: Ve,
|
|
@@ -2851,8 +2851,8 @@ function vt() {
|
|
|
2851
2851
|
}), c = async (s) => {
|
|
2852
2852
|
n(s);
|
|
2853
2853
|
try {
|
|
2854
|
-
const
|
|
2855
|
-
if (
|
|
2854
|
+
const p = await He(s);
|
|
2855
|
+
if (p != null && p.workflow) {
|
|
2856
2856
|
const l = {
|
|
2857
2857
|
id: `image-${s}`,
|
|
2858
2858
|
name: `Workflow from ${s}`,
|
|
@@ -2860,15 +2860,15 @@ function vt() {
|
|
|
2860
2860
|
category: "Utilities",
|
|
2861
2861
|
generator: "unknown",
|
|
2862
2862
|
workflow: {
|
|
2863
|
-
nodes:
|
|
2864
|
-
edges:
|
|
2863
|
+
nodes: p.workflow.nodes,
|
|
2864
|
+
edges: p.workflow.edges
|
|
2865
2865
|
}
|
|
2866
2866
|
};
|
|
2867
2867
|
r(l), window.dispatchEvent(new CustomEvent("workflow-loaded"));
|
|
2868
2868
|
} else
|
|
2869
2869
|
alert("No workflow metadata available for this image");
|
|
2870
|
-
} catch (
|
|
2871
|
-
console.error("Failed to load workflow:",
|
|
2870
|
+
} catch (p) {
|
|
2871
|
+
console.error("Failed to load workflow:", p), alert("Failed to load workflow");
|
|
2872
2872
|
} finally {
|
|
2873
2873
|
n(null);
|
|
2874
2874
|
}
|
|
@@ -2892,7 +2892,7 @@ function vt() {
|
|
|
2892
2892
|
/* @__PURE__ */ e(
|
|
2893
2893
|
"button",
|
|
2894
2894
|
{
|
|
2895
|
-
onClick: () =>
|
|
2895
|
+
onClick: () => m(),
|
|
2896
2896
|
className: "text-sm text-teal-600 dark:text-teal-400 hover:text-teal-700 dark:hover:text-violet-300",
|
|
2897
2897
|
children: "Refresh"
|
|
2898
2898
|
}
|
|
@@ -2988,7 +2988,7 @@ const zt = {
|
|
|
2988
2988
|
},
|
|
2989
2989
|
icon: "chart",
|
|
2990
2990
|
preview: {
|
|
2991
|
-
imageUrl: "/
|
|
2991
|
+
imageUrl: "https://floimg.com/images/templates/revenue-chart.png"
|
|
2992
2992
|
},
|
|
2993
2993
|
codeExample: `const chart = await floimg
|
|
2994
2994
|
.generate('quickchart', {
|
|
@@ -3113,7 +3113,7 @@ const zt = {
|
|
|
3113
3113
|
},
|
|
3114
3114
|
icon: "chart",
|
|
3115
3115
|
preview: {
|
|
3116
|
-
imageUrl: "/
|
|
3116
|
+
imageUrl: "https://floimg.com/images/templates/monthly-users.png"
|
|
3117
3117
|
},
|
|
3118
3118
|
codeExample: `const chart = await floimg
|
|
3119
3119
|
.generate('quickchart', {
|
|
@@ -3228,7 +3228,7 @@ const zt = {
|
|
|
3228
3228
|
},
|
|
3229
3229
|
icon: "chart",
|
|
3230
3230
|
preview: {
|
|
3231
|
-
imageUrl: "/
|
|
3231
|
+
imageUrl: "https://floimg.com/images/templates/framework-usage.png"
|
|
3232
3232
|
},
|
|
3233
3233
|
codeExample: `const chart = await floimg
|
|
3234
3234
|
.generate('quickchart', {
|
|
@@ -3350,7 +3350,7 @@ const zt = {
|
|
|
3350
3350
|
},
|
|
3351
3351
|
icon: "chart",
|
|
3352
3352
|
preview: {
|
|
3353
|
-
imageUrl: "/
|
|
3353
|
+
imageUrl: "https://floimg.com/images/templates/traffic-breakdown.png"
|
|
3354
3354
|
},
|
|
3355
3355
|
codeExample: `const chart = await floimg
|
|
3356
3356
|
.generate('quickchart', {
|
|
@@ -3474,7 +3474,7 @@ const zt = {
|
|
|
3474
3474
|
},
|
|
3475
3475
|
icon: "diagram",
|
|
3476
3476
|
preview: {
|
|
3477
|
-
imageUrl: "/
|
|
3477
|
+
imageUrl: "https://floimg.com/images/templates/api-flow.png"
|
|
3478
3478
|
},
|
|
3479
3479
|
codeExample: `const diagram = await floimg
|
|
3480
3480
|
.generate('mermaid', {
|
|
@@ -3594,7 +3594,7 @@ const zt = {
|
|
|
3594
3594
|
},
|
|
3595
3595
|
icon: "diagram",
|
|
3596
3596
|
preview: {
|
|
3597
|
-
imageUrl: "/
|
|
3597
|
+
imageUrl: "https://floimg.com/images/templates/system-architecture.png"
|
|
3598
3598
|
},
|
|
3599
3599
|
codeExample: `const diagram = await floimg
|
|
3600
3600
|
.generate('mermaid', {
|
|
@@ -3733,7 +3733,7 @@ const zt = {
|
|
|
3733
3733
|
},
|
|
3734
3734
|
icon: "diagram",
|
|
3735
3735
|
preview: {
|
|
3736
|
-
imageUrl: "/
|
|
3736
|
+
imageUrl: "https://floimg.com/images/templates/git-workflow.png"
|
|
3737
3737
|
},
|
|
3738
3738
|
codeExample: `const diagram = await floimg
|
|
3739
3739
|
.generate('mermaid', {
|
|
@@ -3862,7 +3862,7 @@ const zt = {
|
|
|
3862
3862
|
icon: "sparkles",
|
|
3863
3863
|
valueProp: "E-commerce-ready product photos in seconds",
|
|
3864
3864
|
preview: {
|
|
3865
|
-
imageUrl: "/
|
|
3865
|
+
imageUrl: "https://floimg.com/images/templates/ai-product-shot.png"
|
|
3866
3866
|
},
|
|
3867
3867
|
codeExample: `const product = await floimg
|
|
3868
3868
|
.generate('openai', {
|
|
@@ -3957,7 +3957,7 @@ const zt = {
|
|
|
3957
3957
|
icon: "sparkles",
|
|
3958
3958
|
valueProp: "Landing page hero images in seconds",
|
|
3959
3959
|
preview: {
|
|
3960
|
-
imageUrl: "/
|
|
3960
|
+
imageUrl: "https://floimg.com/images/templates/ai-hero-image.png"
|
|
3961
3961
|
},
|
|
3962
3962
|
codeExample: `const hero = await floimg
|
|
3963
3963
|
.generate('openai', {
|
|
@@ -4050,7 +4050,7 @@ const zt = {
|
|
|
4050
4050
|
icon: "sparkles",
|
|
4051
4051
|
valueProp: "Brand-ready mascot assets in seconds",
|
|
4052
4052
|
preview: {
|
|
4053
|
-
imageUrl: "/
|
|
4053
|
+
imageUrl: "https://floimg.com/images/templates/ai-mascot.png"
|
|
4054
4054
|
},
|
|
4055
4055
|
codeExample: `const mascot = await floimg
|
|
4056
4056
|
.generate('openai', {
|
|
@@ -4342,7 +4342,7 @@ const zt = {
|
|
|
4342
4342
|
},
|
|
4343
4343
|
icon: "share",
|
|
4344
4344
|
preview: {
|
|
4345
|
-
imageUrl: "/
|
|
4345
|
+
imageUrl: "https://floimg.com/images/templates/social-media-kit.png"
|
|
4346
4346
|
},
|
|
4347
4347
|
codeExample: `// One source -> all platforms
|
|
4348
4348
|
const socialKit = await floimg.pipeline(heroImage, [
|
|
@@ -4422,7 +4422,7 @@ const socialKit = await floimg.pipeline(heroImage, [
|
|
|
4422
4422
|
},
|
|
4423
4423
|
icon: "image",
|
|
4424
4424
|
preview: {
|
|
4425
|
-
imageUrl: "/
|
|
4425
|
+
imageUrl: "https://floimg.com/images/templates/avatar-pipeline.png"
|
|
4426
4426
|
},
|
|
4427
4427
|
codeExample: `const avatars = await floimg.pipeline(photo, [
|
|
4428
4428
|
{ op: 'crop', params: { shape: 'circle' } },
|
|
@@ -4511,7 +4511,7 @@ const socialKit = await floimg.pipeline(heroImage, [
|
|
|
4511
4511
|
},
|
|
4512
4512
|
icon: "image",
|
|
4513
4513
|
preview: {
|
|
4514
|
-
imageUrl: "/
|
|
4514
|
+
imageUrl: "https://floimg.com/images/templates/watermark-branding.png"
|
|
4515
4515
|
},
|
|
4516
4516
|
seo: {
|
|
4517
4517
|
title: "Branded Watermark Template",
|
|
@@ -4590,7 +4590,7 @@ const socialKit = await floimg.pipeline(heroImage, [
|
|
|
4590
4590
|
},
|
|
4591
4591
|
icon: "image",
|
|
4592
4592
|
preview: {
|
|
4593
|
-
imageUrl: "/
|
|
4593
|
+
imageUrl: "https://floimg.com/images/templates/filter-showcase.png"
|
|
4594
4594
|
},
|
|
4595
4595
|
seo: {
|
|
4596
4596
|
title: "Image Filter Effects",
|
|
@@ -4663,7 +4663,7 @@ const socialKit = await floimg.pipeline(heroImage, [
|
|
|
4663
4663
|
},
|
|
4664
4664
|
icon: "image",
|
|
4665
4665
|
preview: {
|
|
4666
|
-
imageUrl: "/
|
|
4666
|
+
imageUrl: "https://floimg.com/images/templates/responsive-images.png"
|
|
4667
4667
|
},
|
|
4668
4668
|
codeExample: `// One source → all responsive sizes
|
|
4669
4669
|
const responsive = await floimg.from(source)
|
|
@@ -4767,7 +4767,7 @@ const responsive = await floimg.from(source)
|
|
|
4767
4767
|
},
|
|
4768
4768
|
icon: "image",
|
|
4769
4769
|
preview: {
|
|
4770
|
-
imageUrl: "/
|
|
4770
|
+
imageUrl: "https://floimg.com/images/templates/team-headshots.png"
|
|
4771
4771
|
},
|
|
4772
4772
|
codeExample: `const headshot = await floimg.from(photo)
|
|
4773
4773
|
.transform('extract', { width: 400, height: 400, gravity: 'face' })
|
|
@@ -4855,7 +4855,7 @@ const responsive = await floimg.from(source)
|
|
|
4855
4855
|
},
|
|
4856
4856
|
icon: "image",
|
|
4857
4857
|
preview: {
|
|
4858
|
-
imageUrl: "/
|
|
4858
|
+
imageUrl: "https://floimg.com/images/templates/screenshot-docs.png"
|
|
4859
4859
|
},
|
|
4860
4860
|
codeExample: `const docImage = await floimg
|
|
4861
4861
|
.generate('screenshot', { url: 'https://example.com', width: 1280 })
|
|
@@ -4954,7 +4954,7 @@ const responsive = await floimg.from(source)
|
|
|
4954
4954
|
},
|
|
4955
4955
|
icon: "share",
|
|
4956
4956
|
preview: {
|
|
4957
|
-
imageUrl: "/
|
|
4957
|
+
imageUrl: "https://floimg.com/images/templates/blog-og-image.png"
|
|
4958
4958
|
},
|
|
4959
4959
|
codeExample: `const ogImage = await floimg.from(heroImage)
|
|
4960
4960
|
.transform('resize', { width: 1200, height: 630, fit: 'cover' })
|
|
@@ -5039,7 +5039,7 @@ const responsive = await floimg.from(source)
|
|
|
5039
5039
|
},
|
|
5040
5040
|
icon: "share",
|
|
5041
5041
|
preview: {
|
|
5042
|
-
imageUrl: "/
|
|
5042
|
+
imageUrl: "https://floimg.com/images/templates/email-banner.png"
|
|
5043
5043
|
},
|
|
5044
5044
|
codeExample: `const banner = await floimg.from(image)
|
|
5045
5045
|
.transform('resize', { width: 600, height: 200, fit: 'cover' })
|
|
@@ -5125,7 +5125,7 @@ const responsive = await floimg.from(source)
|
|
|
5125
5125
|
},
|
|
5126
5126
|
icon: "image",
|
|
5127
5127
|
preview: {
|
|
5128
|
-
imageUrl: "/
|
|
5128
|
+
imageUrl: "https://floimg.com/images/templates/app-icons.png"
|
|
5129
5129
|
},
|
|
5130
5130
|
codeExample: `const icons = await floimg.from(logo)
|
|
5131
5131
|
.transform('removeBackground')
|
|
@@ -5240,13 +5240,12 @@ const responsive = await floimg.from(source)
|
|
|
5240
5240
|
},
|
|
5241
5241
|
icon: "qr",
|
|
5242
5242
|
preview: {
|
|
5243
|
-
imageUrl: "/
|
|
5243
|
+
imageUrl: "https://floimg.com/images/templates/branded-qr.png"
|
|
5244
5244
|
},
|
|
5245
5245
|
codeExample: `const qr = await floimg
|
|
5246
5246
|
.generate('qr', {
|
|
5247
|
-
|
|
5248
|
-
dark: '#0d9488',
|
|
5249
|
-
light: '#ffffff'
|
|
5247
|
+
text: 'https://floimg.com',
|
|
5248
|
+
color: { dark: '#0d9488', light: '#ffffff' }
|
|
5250
5249
|
})
|
|
5251
5250
|
.transform('resize', { width: 300, height: 300 })
|
|
5252
5251
|
.transform('roundCorners', { radius: 16 })
|
|
@@ -5266,11 +5265,10 @@ const responsive = await floimg.from(source)
|
|
|
5266
5265
|
data: {
|
|
5267
5266
|
generatorName: "qr",
|
|
5268
5267
|
params: {
|
|
5269
|
-
|
|
5270
|
-
|
|
5268
|
+
text: "https://floimg.com",
|
|
5269
|
+
width: 400,
|
|
5271
5270
|
margin: 2,
|
|
5272
|
-
dark: "#0d9488",
|
|
5273
|
-
light: "#ffffff",
|
|
5271
|
+
color: { dark: "#0d9488", light: "#ffffff" },
|
|
5274
5272
|
errorCorrectionLevel: "M"
|
|
5275
5273
|
}
|
|
5276
5274
|
}
|
|
@@ -5330,13 +5328,12 @@ const responsive = await floimg.from(source)
|
|
|
5330
5328
|
},
|
|
5331
5329
|
icon: "qr",
|
|
5332
5330
|
preview: {
|
|
5333
|
-
imageUrl: "/
|
|
5331
|
+
imageUrl: "https://floimg.com/images/templates/dark-qr.png"
|
|
5334
5332
|
},
|
|
5335
5333
|
codeExample: `const qr = await floimg
|
|
5336
5334
|
.generate('qr', {
|
|
5337
|
-
|
|
5338
|
-
dark: '#ffffff',
|
|
5339
|
-
light: '#18181b'
|
|
5335
|
+
text: 'https://floimg.com',
|
|
5336
|
+
color: { dark: '#ffffff', light: '#18181b' }
|
|
5340
5337
|
})
|
|
5341
5338
|
.transform('resize', { width: 300, height: 300 })
|
|
5342
5339
|
.transform('extend', {
|
|
@@ -5359,11 +5356,10 @@ const responsive = await floimg.from(source)
|
|
|
5359
5356
|
data: {
|
|
5360
5357
|
generatorName: "qr",
|
|
5361
5358
|
params: {
|
|
5362
|
-
|
|
5363
|
-
|
|
5359
|
+
text: "https://floimg.com",
|
|
5360
|
+
width: 400,
|
|
5364
5361
|
margin: 2,
|
|
5365
|
-
dark: "#ffffff",
|
|
5366
|
-
light: "#18181b",
|
|
5362
|
+
color: { dark: "#ffffff", light: "#18181b" },
|
|
5367
5363
|
errorCorrectionLevel: "M"
|
|
5368
5364
|
}
|
|
5369
5365
|
}
|
|
@@ -5428,13 +5424,12 @@ const responsive = await floimg.from(source)
|
|
|
5428
5424
|
},
|
|
5429
5425
|
icon: "qr",
|
|
5430
5426
|
preview: {
|
|
5431
|
-
imageUrl: "/
|
|
5427
|
+
imageUrl: "https://floimg.com/images/templates/wifi-qr.png"
|
|
5432
5428
|
},
|
|
5433
5429
|
codeExample: `const qr = await floimg
|
|
5434
5430
|
.generate('qr', {
|
|
5435
|
-
|
|
5436
|
-
dark: '#059669',
|
|
5437
|
-
light: '#ffffff'
|
|
5431
|
+
text: 'WIFI:T:WPA;S:GuestNetwork;P:welcome123;;',
|
|
5432
|
+
color: { dark: '#059669', light: '#ffffff' }
|
|
5438
5433
|
})
|
|
5439
5434
|
.transform('resize', { width: 300, height: 300 })
|
|
5440
5435
|
.transform('addCaption', {
|
|
@@ -5459,11 +5454,10 @@ const responsive = await floimg.from(source)
|
|
|
5459
5454
|
data: {
|
|
5460
5455
|
generatorName: "qr",
|
|
5461
5456
|
params: {
|
|
5462
|
-
|
|
5463
|
-
|
|
5457
|
+
text: "WIFI:T:WPA;S:GuestNetwork;P:welcome123;;",
|
|
5458
|
+
width: 400,
|
|
5464
5459
|
margin: 2,
|
|
5465
|
-
dark: "#059669",
|
|
5466
|
-
light: "#ffffff",
|
|
5460
|
+
color: { dark: "#059669", light: "#ffffff" },
|
|
5467
5461
|
errorCorrectionLevel: "H"
|
|
5468
5462
|
}
|
|
5469
5463
|
}
|
|
@@ -5527,7 +5521,7 @@ const responsive = await floimg.from(source)
|
|
|
5527
5521
|
},
|
|
5528
5522
|
icon: "image",
|
|
5529
5523
|
preview: {
|
|
5530
|
-
imageUrl: "/
|
|
5524
|
+
imageUrl: "https://floimg.com/images/templates/thumbnail-generator.png"
|
|
5531
5525
|
},
|
|
5532
5526
|
seo: {
|
|
5533
5527
|
title: "Thumbnail Generator",
|
|
@@ -5642,15 +5636,15 @@ const responsive = await floimg.from(source)
|
|
|
5642
5636
|
Xt,
|
|
5643
5637
|
Zt,
|
|
5644
5638
|
er
|
|
5645
|
-
],
|
|
5639
|
+
], pe = [
|
|
5646
5640
|
...Pt,
|
|
5647
5641
|
...Dt,
|
|
5648
5642
|
...Jt,
|
|
5649
5643
|
...tr
|
|
5650
|
-
], Z =
|
|
5651
|
-
|
|
5644
|
+
], Z = pe.filter((r) => !r.requiresCloud);
|
|
5645
|
+
pe.filter((r) => r.requiresCloud);
|
|
5652
5646
|
function rr(r) {
|
|
5653
|
-
return
|
|
5647
|
+
return pe.find((d) => d.id === r);
|
|
5654
5648
|
}
|
|
5655
5649
|
function Cr(r) {
|
|
5656
5650
|
return Z.find((d) => d.id === r);
|
|
@@ -5673,14 +5667,14 @@ function xe(r) {
|
|
|
5673
5667
|
return rr(r);
|
|
5674
5668
|
}
|
|
5675
5669
|
function or({ onSelect: r }) {
|
|
5676
|
-
const [d, n] = I(null), [t, a] = I(""), o = de(() => ar(), []),
|
|
5670
|
+
const [d, n] = I(null), [t, a] = I(""), o = de(() => ar(), []), m = de(() => {
|
|
5677
5671
|
let c = Z;
|
|
5678
5672
|
if (d && (c = c.filter((s) => s.category === d)), t) {
|
|
5679
5673
|
const s = t.toLowerCase();
|
|
5680
5674
|
c = c.filter(
|
|
5681
|
-
(
|
|
5675
|
+
(p) => {
|
|
5682
5676
|
var l;
|
|
5683
|
-
return
|
|
5677
|
+
return p.name.toLowerCase().includes(s) || p.description.toLowerCase().includes(s) || p.generator.toLowerCase().includes(s) || ((l = p.tags) == null ? void 0 : l.some((g) => g.toLowerCase().includes(s)));
|
|
5684
5678
|
}
|
|
5685
5679
|
);
|
|
5686
5680
|
}
|
|
@@ -5722,7 +5716,7 @@ function or({ onSelect: r }) {
|
|
|
5722
5716
|
))
|
|
5723
5717
|
] })
|
|
5724
5718
|
] }),
|
|
5725
|
-
|
|
5719
|
+
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((c) => /* @__PURE__ */ e(
|
|
5726
5720
|
nr,
|
|
5727
5721
|
{
|
|
5728
5722
|
template: c,
|
|
@@ -5837,7 +5831,7 @@ function ir({
|
|
|
5837
5831
|
onRename: a,
|
|
5838
5832
|
onDuplicate: o
|
|
5839
5833
|
}) {
|
|
5840
|
-
const [
|
|
5834
|
+
const [m, c] = I(!1), [s, p] = I(r.name), [l, g] = I(!1), b = () => {
|
|
5841
5835
|
s.trim() && s !== r.name && a(s.trim()), c(!1);
|
|
5842
5836
|
}, f = (h) => {
|
|
5843
5837
|
const y = new Date(h), C = (/* @__PURE__ */ new Date()).getTime() - y.getTime(), u = Math.floor(C / 6e4), x = Math.floor(C / 36e5), N = Math.floor(C / 864e5);
|
|
@@ -5850,15 +5844,15 @@ function ir({
|
|
|
5850
5844
|
children: [
|
|
5851
5845
|
/* @__PURE__ */ i("div", { className: "flex items-start justify-between gap-2", children: [
|
|
5852
5846
|
/* @__PURE__ */ i("button", { onClick: n, className: "flex-1 text-left min-w-0", children: [
|
|
5853
|
-
|
|
5847
|
+
m ? /* @__PURE__ */ e(
|
|
5854
5848
|
"input",
|
|
5855
5849
|
{
|
|
5856
5850
|
type: "text",
|
|
5857
5851
|
value: s,
|
|
5858
|
-
onChange: (h) =>
|
|
5852
|
+
onChange: (h) => p(h.target.value),
|
|
5859
5853
|
onBlur: b,
|
|
5860
5854
|
onKeyDown: (h) => {
|
|
5861
|
-
h.key === "Enter" && b(), h.key === "Escape" && (
|
|
5855
|
+
h.key === "Enter" && b(), h.key === "Escape" && (p(r.name), c(!1));
|
|
5862
5856
|
},
|
|
5863
5857
|
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",
|
|
5864
5858
|
autoFocus: !0,
|
|
@@ -5925,9 +5919,9 @@ function ir({
|
|
|
5925
5919
|
);
|
|
5926
5920
|
}
|
|
5927
5921
|
function sr() {
|
|
5928
|
-
const r =
|
|
5922
|
+
const r = w((l) => l.showLibrary), d = w((l) => l.toggleLibrary), n = w((l) => l.savedWorkflows), t = w((l) => l.activeWorkflowId), a = w((l) => l.loadWorkflow), o = w((l) => l.deleteWorkflow), m = w((l) => l.renameWorkflow), c = w((l) => l.duplicateWorkflow), s = w((l) => l.newWorkflow);
|
|
5929
5923
|
if (!r) return null;
|
|
5930
|
-
const
|
|
5924
|
+
const p = [...n].sort((l, g) => g.updatedAt - l.updatedAt);
|
|
5931
5925
|
return /* @__PURE__ */ i(O, { children: [
|
|
5932
5926
|
/* @__PURE__ */ e("div", { className: "fixed inset-0 bg-black/20 dark:bg-black/40 z-40", onClick: d }),
|
|
5933
5927
|
/* @__PURE__ */ i("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: [
|
|
@@ -5971,7 +5965,7 @@ function sr() {
|
|
|
5971
5965
|
]
|
|
5972
5966
|
}
|
|
5973
5967
|
) }),
|
|
5974
|
-
/* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto p-4", children:
|
|
5968
|
+
/* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto p-4", children: p.length === 0 ? /* @__PURE__ */ i("div", { className: "text-center py-8", children: [
|
|
5975
5969
|
/* @__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(
|
|
5976
5970
|
"svg",
|
|
5977
5971
|
{
|
|
@@ -5992,7 +5986,7 @@ function sr() {
|
|
|
5992
5986
|
) }),
|
|
5993
5987
|
/* @__PURE__ */ e("p", { className: "text-sm text-zinc-500 dark:text-zinc-400", children: "No saved workflows yet" }),
|
|
5994
5988
|
/* @__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" })
|
|
5995
|
-
] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children:
|
|
5989
|
+
] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: p.map((l) => /* @__PURE__ */ e(
|
|
5996
5990
|
ir,
|
|
5997
5991
|
{
|
|
5998
5992
|
workflow: l,
|
|
@@ -6001,7 +5995,7 @@ function sr() {
|
|
|
6001
5995
|
a(l.id), d();
|
|
6002
5996
|
},
|
|
6003
5997
|
onDelete: () => o(l.id),
|
|
6004
|
-
onRename: (g) =>
|
|
5998
|
+
onRename: (g) => m(l.id, g),
|
|
6005
5999
|
onDuplicate: () => c(l.id)
|
|
6006
6000
|
},
|
|
6007
6001
|
l.id
|
|
@@ -6068,9 +6062,9 @@ const dr = [
|
|
|
6068
6062
|
}
|
|
6069
6063
|
];
|
|
6070
6064
|
function cr({ provider: r }) {
|
|
6071
|
-
const d = G((b) => b.ai), n = G((b) => b.setAIProvider), t = d[r.id], a = (t == null ? void 0 : t.enabled) ?? !1, o = (t == null ? void 0 : t.apiKey) ?? "", [
|
|
6065
|
+
const d = G((b) => b.ai), n = G((b) => b.setAIProvider), t = d[r.id], a = (t == null ? void 0 : t.enabled) ?? !1, o = (t == null ? void 0 : t.apiKey) ?? "", [m, c] = I(o), [s, p] = I(!1), l = () => {
|
|
6072
6066
|
n(r.id, {
|
|
6073
|
-
apiKey:
|
|
6067
|
+
apiKey: m,
|
|
6074
6068
|
enabled: !a
|
|
6075
6069
|
});
|
|
6076
6070
|
}, g = (b) => {
|
|
@@ -6100,7 +6094,7 @@ function cr({ provider: r }) {
|
|
|
6100
6094
|
"input",
|
|
6101
6095
|
{
|
|
6102
6096
|
type: s ? "text" : "password",
|
|
6103
|
-
value:
|
|
6097
|
+
value: m,
|
|
6104
6098
|
onChange: (b) => g(b.target.value),
|
|
6105
6099
|
placeholder: r.placeholder,
|
|
6106
6100
|
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"
|
|
@@ -6110,7 +6104,7 @@ function cr({ provider: r }) {
|
|
|
6110
6104
|
"button",
|
|
6111
6105
|
{
|
|
6112
6106
|
type: "button",
|
|
6113
|
-
onClick: () =>
|
|
6107
|
+
onClick: () => p(!s),
|
|
6114
6108
|
className: "absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600 dark:hover:text-zinc-300",
|
|
6115
6109
|
children: /* @__PURE__ */ e("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: s ? /* @__PURE__ */ e(
|
|
6116
6110
|
"path",
|
|
@@ -6148,13 +6142,13 @@ function cr({ provider: r }) {
|
|
|
6148
6142
|
) })
|
|
6149
6143
|
] });
|
|
6150
6144
|
}
|
|
6151
|
-
function
|
|
6152
|
-
const d = G((l) => l.ai), n = G((l) => l.setAIProvider), t = d[r.id], a = (t == null ? void 0 : t.enabled) ?? !1, o = (t == null ? void 0 : t.baseUrl) ?? r.defaultUrl, [
|
|
6145
|
+
function mr({ provider: r }) {
|
|
6146
|
+
const d = G((l) => l.ai), n = G((l) => l.setAIProvider), t = d[r.id], a = (t == null ? void 0 : t.enabled) ?? !1, o = (t == null ? void 0 : t.baseUrl) ?? r.defaultUrl, [m, c] = I(o), s = () => {
|
|
6153
6147
|
n(r.id, {
|
|
6154
|
-
baseUrl:
|
|
6148
|
+
baseUrl: m,
|
|
6155
6149
|
enabled: !a
|
|
6156
6150
|
});
|
|
6157
|
-
},
|
|
6151
|
+
}, p = (l) => {
|
|
6158
6152
|
c(l), n(r.id, {
|
|
6159
6153
|
baseUrl: l,
|
|
6160
6154
|
enabled: a
|
|
@@ -6181,8 +6175,8 @@ function pr({ provider: r }) {
|
|
|
6181
6175
|
"input",
|
|
6182
6176
|
{
|
|
6183
6177
|
type: "text",
|
|
6184
|
-
value:
|
|
6185
|
-
onChange: (l) =>
|
|
6178
|
+
value: m,
|
|
6179
|
+
onChange: (l) => p(l.target.value),
|
|
6186
6180
|
placeholder: r.defaultUrl,
|
|
6187
6181
|
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"
|
|
6188
6182
|
}
|
|
@@ -6203,7 +6197,7 @@ function pr({ provider: r }) {
|
|
|
6203
6197
|
) })
|
|
6204
6198
|
] });
|
|
6205
6199
|
}
|
|
6206
|
-
function
|
|
6200
|
+
function pr() {
|
|
6207
6201
|
const r = G((n) => n.showSettings), d = G((n) => n.closeSettings);
|
|
6208
6202
|
return r ? /* @__PURE__ */ e("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50", children: /* @__PURE__ */ i("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: [
|
|
6209
6203
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-200 dark:border-zinc-700", children: [
|
|
@@ -6235,7 +6229,7 @@ function mr() {
|
|
|
6235
6229
|
] }),
|
|
6236
6230
|
/* @__PURE__ */ i("section", { children: [
|
|
6237
6231
|
/* @__PURE__ */ e("h3", { className: "text-sm font-medium text-gray-700 dark:text-zinc-300 mb-3", children: "Local Providers" }),
|
|
6238
|
-
/* @__PURE__ */ e("div", { className: "space-y-3", children: lr.map((n) => /* @__PURE__ */ e(
|
|
6232
|
+
/* @__PURE__ */ e("div", { className: "space-y-3", children: lr.map((n) => /* @__PURE__ */ e(mr, { provider: n }, n.id)) })
|
|
6239
6233
|
] }),
|
|
6240
6234
|
/* @__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__ */ i("div", { className: "flex items-start gap-3", children: [
|
|
6241
6235
|
/* @__PURE__ */ e(
|
|
@@ -6274,7 +6268,7 @@ function mr() {
|
|
|
6274
6268
|
}
|
|
6275
6269
|
let V = null;
|
|
6276
6270
|
function gr({ isOpen: r, onClose: d, onApplyWorkflow: n }) {
|
|
6277
|
-
const [t, a] = I([]), [o,
|
|
6271
|
+
const [t, a] = I([]), [o, m] = I(""), [c, s] = I(!1), [p, l] = I(null), [g, b] = I(""), [f, h] = I(null), [y, v] = I(null), [C, u] = I(""), [x, N] = I(), [k, W] = I(!1), [A, U] = I(), K = se(null), F = se(null);
|
|
6278
6272
|
B(() => {
|
|
6279
6273
|
r && y === null && Xe().then((S) => {
|
|
6280
6274
|
v(S.available), u(S.message), N(S.reason), W(S.isCloudDeployment ?? !1), U(S.supportUrl);
|
|
@@ -6294,7 +6288,7 @@ function gr({ isOpen: r, onClose: d, onApplyWorkflow: n }) {
|
|
|
6294
6288
|
content: o.trim(),
|
|
6295
6289
|
timestamp: Date.now()
|
|
6296
6290
|
};
|
|
6297
|
-
a((P) => [...P, S]),
|
|
6291
|
+
a((P) => [...P, S]), m(""), s(!0), h(null), l(null), b("");
|
|
6298
6292
|
let D;
|
|
6299
6293
|
V = ve(
|
|
6300
6294
|
"/api/generate/workflow/stream",
|
|
@@ -6446,7 +6440,7 @@ function gr({ isOpen: r, onClose: d, onApplyWorkflow: n }) {
|
|
|
6446
6440
|
children: "Contact Support"
|
|
6447
6441
|
}
|
|
6448
6442
|
),
|
|
6449
|
-
x === "not_configured" && !
|
|
6443
|
+
x === "not_configured" && !k && /* @__PURE__ */ e(
|
|
6450
6444
|
"a",
|
|
6451
6445
|
{
|
|
6452
6446
|
href: "https://floimg.com/docs/studio/ai-workflows",
|
|
@@ -6489,7 +6483,7 @@ function gr({ isOpen: r, onClose: d, onApplyWorkflow: n }) {
|
|
|
6489
6483
|
].map((S, D) => /* @__PURE__ */ i(
|
|
6490
6484
|
"button",
|
|
6491
6485
|
{
|
|
6492
|
-
onClick: () =>
|
|
6486
|
+
onClick: () => m(S),
|
|
6493
6487
|
className: "block w-full text-left text-sm px-4 py-2 bg-gray-100 dark:bg-zinc-700 hover:bg-gray-200 dark:hover:bg-zinc-600 rounded-lg text-gray-700 dark:text-zinc-300 transition-colors",
|
|
6494
6488
|
children: [
|
|
6495
6489
|
'"',
|
|
@@ -6554,7 +6548,7 @@ function gr({ isOpen: r, onClose: d, onApplyWorkflow: n }) {
|
|
|
6554
6548
|
c && /* @__PURE__ */ e("div", { className: "flex justify-start", children: /* @__PURE__ */ i("div", { className: "bg-gray-100 dark:bg-zinc-700 rounded-lg px-4 py-3", children: [
|
|
6555
6549
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-3", children: [
|
|
6556
6550
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
|
|
6557
|
-
|
|
6551
|
+
p === "analyzing" && /* @__PURE__ */ e(
|
|
6558
6552
|
"svg",
|
|
6559
6553
|
{
|
|
6560
6554
|
className: "h-4 w-4 text-teal-500 animate-pulse",
|
|
@@ -6572,7 +6566,7 @@ function gr({ isOpen: r, onClose: d, onApplyWorkflow: n }) {
|
|
|
6572
6566
|
)
|
|
6573
6567
|
}
|
|
6574
6568
|
),
|
|
6575
|
-
|
|
6569
|
+
p === "selecting_nodes" && /* @__PURE__ */ e(
|
|
6576
6570
|
"svg",
|
|
6577
6571
|
{
|
|
6578
6572
|
className: "h-4 w-4 text-teal-500 animate-pulse",
|
|
@@ -6590,7 +6584,7 @@ function gr({ isOpen: r, onClose: d, onApplyWorkflow: n }) {
|
|
|
6590
6584
|
)
|
|
6591
6585
|
}
|
|
6592
6586
|
),
|
|
6593
|
-
|
|
6587
|
+
p === "generating" && /* @__PURE__ */ e(
|
|
6594
6588
|
"svg",
|
|
6595
6589
|
{
|
|
6596
6590
|
className: "h-4 w-4 text-teal-500 animate-spin",
|
|
@@ -6608,7 +6602,7 @@ function gr({ isOpen: r, onClose: d, onApplyWorkflow: n }) {
|
|
|
6608
6602
|
)
|
|
6609
6603
|
}
|
|
6610
6604
|
),
|
|
6611
|
-
|
|
6605
|
+
p === "validating" && /* @__PURE__ */ e(
|
|
6612
6606
|
"svg",
|
|
6613
6607
|
{
|
|
6614
6608
|
className: "h-4 w-4 text-teal-500 animate-pulse",
|
|
@@ -6626,7 +6620,7 @@ function gr({ isOpen: r, onClose: d, onApplyWorkflow: n }) {
|
|
|
6626
6620
|
)
|
|
6627
6621
|
}
|
|
6628
6622
|
),
|
|
6629
|
-
!
|
|
6623
|
+
!p && /* @__PURE__ */ i("div", { className: "flex space-x-1", children: [
|
|
6630
6624
|
/* @__PURE__ */ e("div", { className: "w-2 h-2 bg-teal-400 rounded-full animate-bounce" }),
|
|
6631
6625
|
/* @__PURE__ */ e(
|
|
6632
6626
|
"div",
|
|
@@ -6655,29 +6649,29 @@ function gr({ isOpen: r, onClose: d, onApplyWorkflow: n }) {
|
|
|
6655
6649
|
}
|
|
6656
6650
|
)
|
|
6657
6651
|
] }),
|
|
6658
|
-
|
|
6652
|
+
p && /* @__PURE__ */ i("div", { className: "flex items-center gap-1 mt-2", children: [
|
|
6659
6653
|
/* @__PURE__ */ e(
|
|
6660
6654
|
"div",
|
|
6661
6655
|
{
|
|
6662
|
-
className: `h-1 w-8 rounded-full ${
|
|
6656
|
+
className: `h-1 w-8 rounded-full ${p === "analyzing" || p === "selecting_nodes" || p === "generating" || p === "validating" ? "bg-teal-500" : "bg-gray-300 dark:bg-zinc-600"}`
|
|
6663
6657
|
}
|
|
6664
6658
|
),
|
|
6665
6659
|
/* @__PURE__ */ e(
|
|
6666
6660
|
"div",
|
|
6667
6661
|
{
|
|
6668
|
-
className: `h-1 w-8 rounded-full ${
|
|
6662
|
+
className: `h-1 w-8 rounded-full ${p === "selecting_nodes" || p === "generating" || p === "validating" ? "bg-teal-500" : "bg-gray-300 dark:bg-zinc-600"}`
|
|
6669
6663
|
}
|
|
6670
6664
|
),
|
|
6671
6665
|
/* @__PURE__ */ e(
|
|
6672
6666
|
"div",
|
|
6673
6667
|
{
|
|
6674
|
-
className: `h-1 w-8 rounded-full ${
|
|
6668
|
+
className: `h-1 w-8 rounded-full ${p === "generating" || p === "validating" ? "bg-teal-500" : "bg-gray-300 dark:bg-zinc-600"}`
|
|
6675
6669
|
}
|
|
6676
6670
|
),
|
|
6677
6671
|
/* @__PURE__ */ e(
|
|
6678
6672
|
"div",
|
|
6679
6673
|
{
|
|
6680
|
-
className: `h-1 w-8 rounded-full ${
|
|
6674
|
+
className: `h-1 w-8 rounded-full ${p === "validating" ? "bg-teal-500" : "bg-gray-300 dark:bg-zinc-600"}`
|
|
6681
6675
|
}
|
|
6682
6676
|
)
|
|
6683
6677
|
] })
|
|
@@ -6692,7 +6686,7 @@ function gr({ isOpen: r, onClose: d, onApplyWorkflow: n }) {
|
|
|
6692
6686
|
{
|
|
6693
6687
|
ref: F,
|
|
6694
6688
|
value: o,
|
|
6695
|
-
onChange: (S) =>
|
|
6689
|
+
onChange: (S) => m(S.target.value),
|
|
6696
6690
|
onKeyDown: oe,
|
|
6697
6691
|
placeholder: y === !1 ? "AI generation not available" : "Describe what workflow you want to create...",
|
|
6698
6692
|
disabled: c || y === !1,
|
|
@@ -6724,14 +6718,14 @@ function gr({ isOpen: r, onClose: d, onApplyWorkflow: n }) {
|
|
|
6724
6718
|
}
|
|
6725
6719
|
const ur = 20, hr = 500, fr = 1e5;
|
|
6726
6720
|
function br({ isOpen: r, onClose: d, nodeLabel: n, output: t }) {
|
|
6727
|
-
const [a, o] = I("formatted"), [
|
|
6721
|
+
const [a, o] = I("formatted"), [m, c] = I(!1), s = L(() => {
|
|
6728
6722
|
const l = a === "formatted" && t.parsed ? JSON.stringify(t.parsed, null, 2) : t.content;
|
|
6729
6723
|
navigator.clipboard.writeText(l).then(() => {
|
|
6730
6724
|
c(!0), setTimeout(() => c(!1), 2e3);
|
|
6731
6725
|
});
|
|
6732
6726
|
}, [a, t]);
|
|
6733
6727
|
if (!r) return null;
|
|
6734
|
-
const
|
|
6728
|
+
const p = t.dataType === "json" && t.parsed;
|
|
6735
6729
|
return /* @__PURE__ */ e("div", { className: "fixed inset-0 bg-black/50 flex items-center justify-center z-50", children: /* @__PURE__ */ i("div", { className: "bg-white dark:bg-zinc-800 rounded-lg shadow-xl w-full max-w-3xl mx-4 max-h-[85vh] flex flex-col", children: [
|
|
6736
6730
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-zinc-700", children: [
|
|
6737
6731
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-3", children: [
|
|
@@ -6762,7 +6756,7 @@ function br({ isOpen: r, onClose: d, nodeLabel: n, output: t }) {
|
|
|
6762
6756
|
] })
|
|
6763
6757
|
] }),
|
|
6764
6758
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
|
|
6765
|
-
|
|
6759
|
+
p && /* @__PURE__ */ i("div", { className: "flex bg-gray-100 dark:bg-zinc-700 rounded-lg p-0.5", children: [
|
|
6766
6760
|
/* @__PURE__ */ e(
|
|
6767
6761
|
"button",
|
|
6768
6762
|
{
|
|
@@ -6823,7 +6817,7 @@ function br({ isOpen: r, onClose: d, nodeLabel: n, output: t }) {
|
|
|
6823
6817
|
"KB) - rendering may be slow"
|
|
6824
6818
|
] })
|
|
6825
6819
|
] }),
|
|
6826
|
-
/* @__PURE__ */ e("div", { className: "flex-1 overflow-auto p-4", children: a === "formatted" &&
|
|
6820
|
+
/* @__PURE__ */ e("div", { className: "flex-1 overflow-auto p-4", children: a === "formatted" && p ? /* @__PURE__ */ e(xr, { data: t.parsed }) : /* @__PURE__ */ e("pre", { className: "whitespace-pre-wrap font-mono text-sm text-gray-800 dark:text-zinc-200 bg-gray-50 dark:bg-zinc-900 rounded-lg p-4 overflow-auto", children: t.content }) }),
|
|
6827
6821
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between px-4 py-3 border-t border-gray-200 dark:border-zinc-700", children: [
|
|
6828
6822
|
/* @__PURE__ */ i("span", { className: "text-xs text-gray-500 dark:text-zinc-400", children: [
|
|
6829
6823
|
t.content.length.toLocaleString(),
|
|
@@ -6834,7 +6828,7 @@ function br({ isOpen: r, onClose: d, nodeLabel: n, output: t }) {
|
|
|
6834
6828
|
{
|
|
6835
6829
|
onClick: s,
|
|
6836
6830
|
className: "flex items-center gap-2 px-3 py-1.5 text-sm font-medium text-teal-600 dark:text-teal-400 hover:bg-teal-50 dark:hover:bg-teal-900/30 rounded-lg transition-colors",
|
|
6837
|
-
children:
|
|
6831
|
+
children: m ? /* @__PURE__ */ i(O, { children: [
|
|
6838
6832
|
/* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e(
|
|
6839
6833
|
"path",
|
|
6840
6834
|
{
|
|
@@ -6924,7 +6918,7 @@ function ce({ value: r, depth: d, keyName: n, maxDepth: t }) {
|
|
|
6924
6918
|
] });
|
|
6925
6919
|
}
|
|
6926
6920
|
if (Array.isArray(r)) {
|
|
6927
|
-
const o = r.slice(0, hr),
|
|
6921
|
+
const o = r.slice(0, hr), m = r.length - o.length;
|
|
6928
6922
|
return /* @__PURE__ */ i("div", { style: { marginLeft: a }, children: [
|
|
6929
6923
|
n && /* @__PURE__ */ i("div", { className: "py-0.5", children: [
|
|
6930
6924
|
/* @__PURE__ */ i("span", { className: "text-pink-600 dark:text-pink-400", children: [
|
|
@@ -6941,9 +6935,9 @@ function ce({ value: r, depth: d, keyName: n, maxDepth: t }) {
|
|
|
6941
6935
|
] }),
|
|
6942
6936
|
!n && /* @__PURE__ */ e("span", { className: "text-gray-500 dark:text-zinc-500 py-0.5 block", children: "[" }),
|
|
6943
6937
|
o.map((c, s) => /* @__PURE__ */ e(ce, { value: c, depth: d + 1, maxDepth: t }, s)),
|
|
6944
|
-
|
|
6938
|
+
m > 0 && /* @__PURE__ */ i("div", { style: { marginLeft: (d + 1) * 16 }, className: "py-0.5 text-zinc-500 italic", children: [
|
|
6945
6939
|
"...and ",
|
|
6946
|
-
|
|
6940
|
+
m,
|
|
6947
6941
|
" more items"
|
|
6948
6942
|
] }),
|
|
6949
6943
|
!n && /* @__PURE__ */ e("span", { className: "text-gray-500 dark:text-zinc-500 py-0.5 block", children: "]" })
|
|
@@ -6962,26 +6956,26 @@ function ce({ value: r, depth: d, keyName: n, maxDepth: t }) {
|
|
|
6962
6956
|
/* @__PURE__ */ e("span", { className: "text-gray-500 dark:text-zinc-500", children: "{" })
|
|
6963
6957
|
] }),
|
|
6964
6958
|
!n && /* @__PURE__ */ e("span", { className: "text-gray-500 dark:text-zinc-500 py-0.5 block", children: "{" }),
|
|
6965
|
-
o.map(([
|
|
6959
|
+
o.map(([m, c]) => /* @__PURE__ */ e(ce, { value: c, depth: d + 1, keyName: m, maxDepth: t }, m)),
|
|
6966
6960
|
/* @__PURE__ */ e("div", { style: { marginLeft: n ? 0 : a }, className: "py-0.5", children: /* @__PURE__ */ e("span", { className: "text-gray-500 dark:text-zinc-500", children: "}" }) })
|
|
6967
6961
|
] });
|
|
6968
6962
|
}
|
|
6969
6963
|
return null;
|
|
6970
6964
|
}
|
|
6971
6965
|
function yr() {
|
|
6972
|
-
const { screenToFlowPosition: r } = Ue(), d =
|
|
6966
|
+
const { screenToFlowPosition: r } = Ue(), d = w((a) => a.addNode), n = L(
|
|
6973
6967
|
(a) => {
|
|
6974
6968
|
a.preventDefault();
|
|
6975
6969
|
const o = a.dataTransfer.getData("application/json");
|
|
6976
6970
|
if (o)
|
|
6977
6971
|
try {
|
|
6978
|
-
const
|
|
6972
|
+
const m = JSON.parse(o), c = r({
|
|
6979
6973
|
x: a.clientX,
|
|
6980
6974
|
y: a.clientY
|
|
6981
6975
|
});
|
|
6982
|
-
d(
|
|
6983
|
-
} catch (
|
|
6984
|
-
console.error("Failed to parse dropped node:",
|
|
6976
|
+
d(m, c);
|
|
6977
|
+
} catch (m) {
|
|
6978
|
+
console.error("Failed to parse dropped node:", m);
|
|
6985
6979
|
}
|
|
6986
6980
|
},
|
|
6987
6981
|
[d, r]
|
|
@@ -6991,7 +6985,7 @@ function yr() {
|
|
|
6991
6985
|
return /* @__PURE__ */ e("div", { className: "flex-1", onDrop: n, onDragOver: t, children: /* @__PURE__ */ e(ct, {}) });
|
|
6992
6986
|
}
|
|
6993
6987
|
function Ar() {
|
|
6994
|
-
const [r, d] = I("editor"), [n, t] = I(!1), a =
|
|
6988
|
+
const [r, d] = I("editor"), [n, t] = I(!1), a = w((h) => h.loadTemplate), o = w((h) => h.loadGeneratedWorkflow), m = w((h) => h.inspectedNodeId), c = w((h) => h.execution.dataOutputs), s = w((h) => h.closeOutputInspector), p = w((h) => h.nodes), l = m ? p.find((h) => h.id === m) : null, g = m ? c[m] : null;
|
|
6995
6989
|
B(() => {
|
|
6996
6990
|
const y = new URLSearchParams(window.location.search).get("template");
|
|
6997
6991
|
if (y) {
|
|
@@ -7019,7 +7013,7 @@ function Ar() {
|
|
|
7019
7013
|
[o]
|
|
7020
7014
|
);
|
|
7021
7015
|
return /* @__PURE__ */ i(Be, { children: [
|
|
7022
|
-
/* @__PURE__ */ e(
|
|
7016
|
+
/* @__PURE__ */ e(pr, {}),
|
|
7023
7017
|
/* @__PURE__ */ e(
|
|
7024
7018
|
gr,
|
|
7025
7019
|
{
|
|
@@ -7033,14 +7027,14 @@ function Ar() {
|
|
|
7033
7027
|
{
|
|
7034
7028
|
isOpen: !0,
|
|
7035
7029
|
onClose: s,
|
|
7036
|
-
nodeId:
|
|
7030
|
+
nodeId: m,
|
|
7037
7031
|
nodeLabel: l.data.providerLabel || l.type || "Node",
|
|
7038
7032
|
output: g
|
|
7039
7033
|
}
|
|
7040
7034
|
),
|
|
7041
7035
|
/* @__PURE__ */ e(sr, {}),
|
|
7042
7036
|
/* @__PURE__ */ i("div", { className: "h-screen flex flex-col bg-gray-100 dark:bg-zinc-900", children: [
|
|
7043
|
-
/* @__PURE__ */ e(
|
|
7037
|
+
/* @__PURE__ */ e(wt, {}),
|
|
7044
7038
|
/* @__PURE__ */ e("div", { className: "bg-white dark:bg-zinc-800 border-b border-gray-200 dark:border-zinc-700", children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
|
|
7045
7039
|
/* @__PURE__ */ i("div", { className: "flex", children: [
|
|
7046
7040
|
/* @__PURE__ */ e(
|
|
@@ -7090,7 +7084,7 @@ function Ar() {
|
|
|
7090
7084
|
] }) }),
|
|
7091
7085
|
/* @__PURE__ */ i("div", { className: "flex-1 flex overflow-hidden", children: [
|
|
7092
7086
|
r === "editor" && /* @__PURE__ */ i(O, { children: [
|
|
7093
|
-
/* @__PURE__ */ e(
|
|
7087
|
+
/* @__PURE__ */ e(pt, {}),
|
|
7094
7088
|
/* @__PURE__ */ e(yr, {}),
|
|
7095
7089
|
/* @__PURE__ */ e(gt, {})
|
|
7096
7090
|
] }),
|
|
@@ -7102,14 +7096,14 @@ function Ar() {
|
|
|
7102
7096
|
}
|
|
7103
7097
|
export {
|
|
7104
7098
|
gr as AIChat,
|
|
7105
|
-
|
|
7099
|
+
pr as AISettings,
|
|
7106
7100
|
Ar as App,
|
|
7107
7101
|
vt as Gallery,
|
|
7108
7102
|
gt as NodeInspector,
|
|
7109
|
-
|
|
7103
|
+
pt as NodePalette,
|
|
7110
7104
|
or as TemplateGallery,
|
|
7111
|
-
|
|
7112
|
-
|
|
7105
|
+
wt as Toolbar,
|
|
7106
|
+
mt as UploadGallery,
|
|
7113
7107
|
ct as WorkflowEditor,
|
|
7114
7108
|
sr as WorkflowLibrary,
|
|
7115
7109
|
ar as getCategories,
|
|
@@ -7118,6 +7112,6 @@ export {
|
|
|
7118
7112
|
xe as resolveTemplate,
|
|
7119
7113
|
Sr as searchTemplates,
|
|
7120
7114
|
Z as templates,
|
|
7121
|
-
|
|
7115
|
+
w as useWorkflowStore
|
|
7122
7116
|
};
|
|
7123
7117
|
//# sourceMappingURL=index.js.map
|