@genfeedai/workflow-ui 0.1.0
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/canvas.d.mts +27 -0
- package/dist/canvas.d.ts +27 -0
- package/dist/canvas.js +45 -0
- package/dist/canvas.mjs +16 -0
- package/dist/chunk-22PDGHNQ.mjs +737 -0
- package/dist/chunk-3SPPKCWR.js +458 -0
- package/dist/chunk-3YFFDHC5.js +300 -0
- package/dist/chunk-5HJFQVUR.js +61 -0
- package/dist/chunk-5LQ4QBR5.js +2 -0
- package/dist/chunk-6DOEUDD5.js +254 -0
- package/dist/chunk-7SKSRSS7.mjs +57 -0
- package/dist/chunk-AC6TWLRT.mjs +27 -0
- package/dist/chunk-ADWNF7V3.js +120 -0
- package/dist/chunk-BJ3R5R32.mjs +2163 -0
- package/dist/chunk-CETJJ73S.js +1555 -0
- package/dist/chunk-CSUBLSKZ.mjs +1002 -0
- package/dist/chunk-CV4M7CNU.mjs +251 -0
- package/dist/chunk-E323WAZG.mjs +272 -0
- package/dist/chunk-E544XUBL.js +378 -0
- package/dist/chunk-EC2ZIWOK.js +1007 -0
- package/dist/chunk-EFXQT23N.mjs +99 -0
- package/dist/chunk-EMUMKW5C.js +107 -0
- package/dist/chunk-FOMOOERN.js +2 -0
- package/dist/chunk-FT33LFII.mjs +21 -0
- package/dist/chunk-FT64PCUP.mjs +533 -0
- package/dist/chunk-H6LZKSLY.js +5678 -0
- package/dist/chunk-HPQT36RR.js +543 -0
- package/dist/chunk-JLWKW3G5.js +2 -0
- package/dist/chunk-L5TF4EHW.mjs +1 -0
- package/dist/chunk-LAJ34AH2.mjs +374 -0
- package/dist/chunk-LDN7IX4Y.mjs +1 -0
- package/dist/chunk-MLJJBBTB.mjs +1 -0
- package/dist/chunk-NSDLGLAQ.js +2166 -0
- package/dist/chunk-RJ262NXS.js +24 -0
- package/dist/chunk-RXNEDWK2.js +141 -0
- package/dist/chunk-SW7QNEZU.js +744 -0
- package/dist/chunk-UQQUWGHW.mjs +118 -0
- package/dist/chunk-VOGL2WCE.mjs +1542 -0
- package/dist/chunk-VRN3UWE5.mjs +138 -0
- package/dist/chunk-XV5Z5XYR.mjs +5640 -0
- package/dist/chunk-Z7PWFZG5.js +30 -0
- package/dist/chunk-ZJD5WMR3.mjs +418 -0
- package/dist/hooks.d.mts +255 -0
- package/dist/hooks.d.ts +255 -0
- package/dist/hooks.js +56 -0
- package/dist/hooks.mjs +11 -0
- package/dist/index.d.mts +29 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.js +180 -0
- package/dist/index.mjs +19 -0
- package/dist/lib.d.mts +164 -0
- package/dist/lib.d.ts +164 -0
- package/dist/lib.js +144 -0
- package/dist/lib.mjs +3 -0
- package/dist/nodes.d.mts +128 -0
- package/dist/nodes.d.ts +128 -0
- package/dist/nodes.js +151 -0
- package/dist/nodes.mjs +14 -0
- package/dist/panels.d.mts +22 -0
- package/dist/panels.d.ts +22 -0
- package/dist/panels.js +21 -0
- package/dist/panels.mjs +4 -0
- package/dist/promptLibraryStore-BZnfmEkc.d.ts +464 -0
- package/dist/promptLibraryStore-zqb59nsu.d.mts +464 -0
- package/dist/provider.d.mts +29 -0
- package/dist/provider.d.ts +29 -0
- package/dist/provider.js +17 -0
- package/dist/provider.mjs +4 -0
- package/dist/stores.d.mts +96 -0
- package/dist/stores.d.ts +96 -0
- package/dist/stores.js +113 -0
- package/dist/stores.mjs +43 -0
- package/dist/toolbar.d.mts +73 -0
- package/dist/toolbar.d.ts +73 -0
- package/dist/toolbar.js +34 -0
- package/dist/toolbar.mjs +5 -0
- package/dist/types-ipAnBzAJ.d.mts +46 -0
- package/dist/types-ipAnBzAJ.d.ts +46 -0
- package/dist/ui.d.mts +67 -0
- package/dist/ui.d.ts +67 -0
- package/dist/ui.js +84 -0
- package/dist/ui.mjs +3 -0
- package/dist/workflowStore-4EGKJLYK.mjs +3 -0
- package/dist/workflowStore-KM32FDL7.js +12 -0
- package/package.json +117 -0
- package/src/styles/workflow-ui.css +186 -0
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
import { useExecutionStore, useUIStore } from './chunk-CSUBLSKZ.mjs';
|
|
2
|
+
import { require_dist } from './chunk-BJ3R5R32.mjs';
|
|
3
|
+
import { __toESM } from './chunk-AC6TWLRT.mjs';
|
|
4
|
+
import { Bug, Trash2, X, ChevronDown, ChevronRight, Copy, PanelLeftClose, Search, GitBranch, ArrowLeftFromLine, ArrowRightToLine, Download, Eye, CheckCircle, Columns2, LayoutGrid, Subtitles, Pencil, Grid3X3, Maximize, Crop, Film, Scissors, Layers, Wand2, Maximize2, Navigation, AudioLines, Mic, Brain, Video, Sparkles, Puzzle, Volume2, FileVideo, FileText, MessageSquare, Image } from 'lucide-react';
|
|
5
|
+
import { forwardRef, memo, useCallback, useState, useMemo } from 'react';
|
|
6
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
7
|
+
|
|
8
|
+
// src/panels/NodePalette.tsx
|
|
9
|
+
var import_types = __toESM(require_dist());
|
|
10
|
+
var ICONS = {
|
|
11
|
+
// Input
|
|
12
|
+
Image,
|
|
13
|
+
MessageSquare,
|
|
14
|
+
FileText,
|
|
15
|
+
FileVideo,
|
|
16
|
+
Volume2,
|
|
17
|
+
Puzzle,
|
|
18
|
+
// AI
|
|
19
|
+
Sparkles,
|
|
20
|
+
Video,
|
|
21
|
+
Brain,
|
|
22
|
+
Mic,
|
|
23
|
+
AudioLines,
|
|
24
|
+
Navigation,
|
|
25
|
+
// Processing
|
|
26
|
+
Maximize2,
|
|
27
|
+
Wand2,
|
|
28
|
+
Layers,
|
|
29
|
+
Scissors,
|
|
30
|
+
Film,
|
|
31
|
+
Crop,
|
|
32
|
+
Maximize,
|
|
33
|
+
Grid3X3,
|
|
34
|
+
Pencil,
|
|
35
|
+
Subtitles,
|
|
36
|
+
LayoutGrid,
|
|
37
|
+
Columns2,
|
|
38
|
+
// Output
|
|
39
|
+
CheckCircle,
|
|
40
|
+
Eye,
|
|
41
|
+
Download,
|
|
42
|
+
// Composition
|
|
43
|
+
ArrowRightToLine,
|
|
44
|
+
ArrowLeftFromLine,
|
|
45
|
+
GitBranch
|
|
46
|
+
};
|
|
47
|
+
var CATEGORY_LABELS = {
|
|
48
|
+
input: "Input",
|
|
49
|
+
ai: "AI Generation",
|
|
50
|
+
processing: "Processing",
|
|
51
|
+
output: "Output",
|
|
52
|
+
composition: "Composition"
|
|
53
|
+
};
|
|
54
|
+
var CATEGORY_COLORS = {
|
|
55
|
+
input: {
|
|
56
|
+
icon: "bg-[var(--category-input)]/20 text-[var(--category-input)]",
|
|
57
|
+
hover: "hover:border-[var(--category-input)]",
|
|
58
|
+
cssVar: "var(--category-input)"
|
|
59
|
+
},
|
|
60
|
+
ai: {
|
|
61
|
+
icon: "bg-[var(--category-ai)]/20 text-[var(--category-ai)]",
|
|
62
|
+
hover: "hover:border-[var(--category-ai)]",
|
|
63
|
+
cssVar: "var(--category-ai)"
|
|
64
|
+
},
|
|
65
|
+
processing: {
|
|
66
|
+
icon: "bg-[var(--category-processing)]/20 text-[var(--category-processing)]",
|
|
67
|
+
hover: "hover:border-[var(--category-processing)]",
|
|
68
|
+
cssVar: "var(--category-processing)"
|
|
69
|
+
},
|
|
70
|
+
output: {
|
|
71
|
+
icon: "bg-[var(--category-output)]/20 text-[var(--category-output)]",
|
|
72
|
+
hover: "hover:border-[var(--category-output)]",
|
|
73
|
+
cssVar: "var(--category-output)"
|
|
74
|
+
},
|
|
75
|
+
composition: {
|
|
76
|
+
icon: "bg-[var(--category-composition)]/20 text-[var(--category-composition)]",
|
|
77
|
+
hover: "hover:border-[var(--category-composition)]",
|
|
78
|
+
cssVar: "var(--category-composition)"
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
function NodeCard({ type, label, description, icon, category }) {
|
|
82
|
+
const Icon = ICONS[icon] ?? Sparkles;
|
|
83
|
+
const handleDragStart = useCallback(
|
|
84
|
+
(event) => {
|
|
85
|
+
event.dataTransfer.setData("nodeType", type);
|
|
86
|
+
event.dataTransfer.effectAllowed = "move";
|
|
87
|
+
},
|
|
88
|
+
[type]
|
|
89
|
+
);
|
|
90
|
+
const colors = CATEGORY_COLORS[category];
|
|
91
|
+
return /* @__PURE__ */ jsx(
|
|
92
|
+
"div",
|
|
93
|
+
{
|
|
94
|
+
draggable: true,
|
|
95
|
+
onDragStart: handleDragStart,
|
|
96
|
+
className: `p-3 bg-[var(--card)] border border-[var(--border)] rounded-lg cursor-grab transition-colors group ${colors.hover}`,
|
|
97
|
+
children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
|
|
98
|
+
/* @__PURE__ */ jsx("div", { className: `p-2 rounded ${colors.icon}`, children: /* @__PURE__ */ jsx(Icon, { className: "w-4 h-4" }) }),
|
|
99
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
100
|
+
/* @__PURE__ */ jsx("div", { className: "font-medium text-sm text-[var(--foreground)] truncate", children: label }),
|
|
101
|
+
/* @__PURE__ */ jsx("div", { className: "text-xs text-[var(--muted-foreground)] mt-0.5 line-clamp-2", children: description })
|
|
102
|
+
] })
|
|
103
|
+
] })
|
|
104
|
+
}
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
function CategorySection({ category, isExpanded, onToggle }) {
|
|
108
|
+
const nodes = (0, import_types.getNodesByCategory)()[category];
|
|
109
|
+
return /* @__PURE__ */ jsxs("div", { className: "border-b border-[var(--border)] last:border-0", children: [
|
|
110
|
+
/* @__PURE__ */ jsxs(
|
|
111
|
+
"button",
|
|
112
|
+
{
|
|
113
|
+
onClick: onToggle,
|
|
114
|
+
className: "w-full flex items-center gap-2 px-4 py-3 text-left hover:bg-[var(--secondary)] transition cursor-pointer",
|
|
115
|
+
children: [
|
|
116
|
+
isExpanded ? /* @__PURE__ */ jsx(ChevronDown, { className: "w-4 h-4 text-[var(--muted-foreground)]" }) : /* @__PURE__ */ jsx(ChevronRight, { className: "w-4 h-4 text-[var(--muted-foreground)]" }),
|
|
117
|
+
/* @__PURE__ */ jsx("span", { className: "font-medium text-sm text-[var(--foreground)]", children: CATEGORY_LABELS[category] }),
|
|
118
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs text-[var(--muted-foreground)] ml-auto", children: nodes.length })
|
|
119
|
+
]
|
|
120
|
+
}
|
|
121
|
+
),
|
|
122
|
+
isExpanded && /* @__PURE__ */ jsx("div", { className: "px-4 pb-4 space-y-2", children: nodes.map((node) => /* @__PURE__ */ jsx(
|
|
123
|
+
NodeCard,
|
|
124
|
+
{
|
|
125
|
+
type: node.type,
|
|
126
|
+
label: node.label,
|
|
127
|
+
description: node.description,
|
|
128
|
+
icon: node.icon,
|
|
129
|
+
category: node.category
|
|
130
|
+
},
|
|
131
|
+
node.type
|
|
132
|
+
)) })
|
|
133
|
+
] });
|
|
134
|
+
}
|
|
135
|
+
function NodePalette() {
|
|
136
|
+
const { togglePalette } = useUIStore();
|
|
137
|
+
const [searchQuery, setSearchQuery] = useState("");
|
|
138
|
+
const [expandedCategories, setExpandedCategories] = useState(
|
|
139
|
+
/* @__PURE__ */ new Set(["input"])
|
|
140
|
+
);
|
|
141
|
+
const nodesByCategory = useMemo(() => (0, import_types.getNodesByCategory)(), []);
|
|
142
|
+
const filteredNodes = useMemo(() => {
|
|
143
|
+
if (!searchQuery.trim()) return null;
|
|
144
|
+
const query = searchQuery.toLowerCase();
|
|
145
|
+
const results = [];
|
|
146
|
+
for (const category of Object.keys(nodesByCategory)) {
|
|
147
|
+
for (const node of nodesByCategory[category]) {
|
|
148
|
+
if (node.label.toLowerCase().includes(query) || node.description.toLowerCase().includes(query)) {
|
|
149
|
+
results.push(node);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
return results;
|
|
154
|
+
}, [searchQuery, nodesByCategory]);
|
|
155
|
+
const toggleCategory = useCallback((category) => {
|
|
156
|
+
setExpandedCategories((prev) => {
|
|
157
|
+
const next = new Set(prev);
|
|
158
|
+
if (next.has(category)) {
|
|
159
|
+
next.delete(category);
|
|
160
|
+
} else {
|
|
161
|
+
next.add(category);
|
|
162
|
+
}
|
|
163
|
+
return next;
|
|
164
|
+
});
|
|
165
|
+
}, []);
|
|
166
|
+
const categories = useMemo(
|
|
167
|
+
() => ["input", "ai", "processing", "output", "composition"].filter(
|
|
168
|
+
(cat) => nodesByCategory[cat].length > 0
|
|
169
|
+
),
|
|
170
|
+
[nodesByCategory]
|
|
171
|
+
);
|
|
172
|
+
return /* @__PURE__ */ jsxs("div", { className: "w-64 min-w-64 h-full bg-[var(--background)] border-r border-[var(--border)] flex flex-col overflow-hidden", children: [
|
|
173
|
+
/* @__PURE__ */ jsxs("div", { className: "px-4 py-3 border-b border-[var(--border)] flex items-start justify-between gap-2", children: [
|
|
174
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
175
|
+
/* @__PURE__ */ jsx("h2", { className: "font-semibold text-sm text-[var(--foreground)]", children: "Nodes" }),
|
|
176
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-[var(--muted-foreground)] mt-1", children: "Drag to canvas" })
|
|
177
|
+
] }),
|
|
178
|
+
/* @__PURE__ */ jsx(
|
|
179
|
+
"button",
|
|
180
|
+
{
|
|
181
|
+
onClick: togglePalette,
|
|
182
|
+
className: "p-1.5 hover:bg-[var(--secondary)] rounded-md transition-colors group",
|
|
183
|
+
title: "Close sidebar (M)",
|
|
184
|
+
children: /* @__PURE__ */ jsx(PanelLeftClose, { className: "w-4 h-4 text-[var(--muted-foreground)] group-hover:text-[var(--foreground)]" })
|
|
185
|
+
}
|
|
186
|
+
)
|
|
187
|
+
] }),
|
|
188
|
+
/* @__PURE__ */ jsx("div", { className: "px-4 py-3 border-b border-[var(--border)]", children: /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
189
|
+
/* @__PURE__ */ jsx(Search, { className: "absolute left-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-[var(--muted-foreground)]" }),
|
|
190
|
+
/* @__PURE__ */ jsx(
|
|
191
|
+
"input",
|
|
192
|
+
{
|
|
193
|
+
type: "text",
|
|
194
|
+
placeholder: "Search nodes...",
|
|
195
|
+
value: searchQuery,
|
|
196
|
+
onChange: (e) => setSearchQuery(e.target.value),
|
|
197
|
+
className: "w-full pl-8 pr-3 py-1.5 text-sm bg-[var(--secondary)] border border-[var(--border)] rounded-md placeholder:text-[var(--muted-foreground)] focus:outline-none focus:ring-1 focus:ring-[var(--ring)]"
|
|
198
|
+
}
|
|
199
|
+
)
|
|
200
|
+
] }) }),
|
|
201
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1 overflow-y-auto", children: filteredNodes ? (
|
|
202
|
+
// Search results
|
|
203
|
+
/* @__PURE__ */ jsx("div", { className: "px-4 py-3 space-y-2", children: filteredNodes.length === 0 ? /* @__PURE__ */ jsx("p", { className: "text-sm text-[var(--muted-foreground)] text-center py-4", children: "No nodes found" }) : filteredNodes.map((node) => /* @__PURE__ */ jsx(
|
|
204
|
+
NodeCard,
|
|
205
|
+
{
|
|
206
|
+
type: node.type,
|
|
207
|
+
label: node.label,
|
|
208
|
+
description: node.description,
|
|
209
|
+
icon: node.icon,
|
|
210
|
+
category: node.category
|
|
211
|
+
},
|
|
212
|
+
node.type
|
|
213
|
+
)) })
|
|
214
|
+
) : (
|
|
215
|
+
// Category view
|
|
216
|
+
categories.map((category) => /* @__PURE__ */ jsx(
|
|
217
|
+
CategorySection,
|
|
218
|
+
{
|
|
219
|
+
category,
|
|
220
|
+
isExpanded: expandedCategories.has(category),
|
|
221
|
+
onToggle: () => toggleCategory(category)
|
|
222
|
+
},
|
|
223
|
+
category
|
|
224
|
+
))
|
|
225
|
+
) })
|
|
226
|
+
] });
|
|
227
|
+
}
|
|
228
|
+
var PanelContainer = forwardRef(
|
|
229
|
+
({ children, className, ...props }, ref) => {
|
|
230
|
+
const stopPropagation = (e) => {
|
|
231
|
+
e.stopPropagation();
|
|
232
|
+
};
|
|
233
|
+
return /* @__PURE__ */ jsx(
|
|
234
|
+
"div",
|
|
235
|
+
{
|
|
236
|
+
ref,
|
|
237
|
+
className,
|
|
238
|
+
onClick: stopPropagation,
|
|
239
|
+
onMouseDown: stopPropagation,
|
|
240
|
+
onPointerDown: stopPropagation,
|
|
241
|
+
onDoubleClick: stopPropagation,
|
|
242
|
+
...props,
|
|
243
|
+
children
|
|
244
|
+
}
|
|
245
|
+
);
|
|
246
|
+
}
|
|
247
|
+
);
|
|
248
|
+
PanelContainer.displayName = "PanelContainer";
|
|
249
|
+
function PayloadCard({ payload }) {
|
|
250
|
+
const [isExpanded, setIsExpanded] = useState(false);
|
|
251
|
+
const [copied, setCopied] = useState(false);
|
|
252
|
+
const handleCopy = useCallback(
|
|
253
|
+
async (e) => {
|
|
254
|
+
e.stopPropagation();
|
|
255
|
+
try {
|
|
256
|
+
await navigator.clipboard.writeText(JSON.stringify(payload.input, null, 2));
|
|
257
|
+
setCopied(true);
|
|
258
|
+
setTimeout(() => setCopied(false), 2e3);
|
|
259
|
+
} catch {
|
|
260
|
+
const textArea = document.createElement("textarea");
|
|
261
|
+
textArea.value = JSON.stringify(payload.input, null, 2);
|
|
262
|
+
textArea.style.position = "fixed";
|
|
263
|
+
textArea.style.left = "-9999px";
|
|
264
|
+
document.body.appendChild(textArea);
|
|
265
|
+
textArea.select();
|
|
266
|
+
try {
|
|
267
|
+
document.execCommand("copy");
|
|
268
|
+
setCopied(true);
|
|
269
|
+
setTimeout(() => setCopied(false), 2e3);
|
|
270
|
+
} catch {
|
|
271
|
+
}
|
|
272
|
+
document.body.removeChild(textArea);
|
|
273
|
+
}
|
|
274
|
+
},
|
|
275
|
+
[payload.input]
|
|
276
|
+
);
|
|
277
|
+
const timestamp = new Date(payload.timestamp).toLocaleTimeString();
|
|
278
|
+
return /* @__PURE__ */ jsxs("div", { className: "border border-[var(--border)] rounded-lg overflow-hidden", children: [
|
|
279
|
+
/* @__PURE__ */ jsxs(
|
|
280
|
+
"button",
|
|
281
|
+
{
|
|
282
|
+
onClick: () => setIsExpanded(!isExpanded),
|
|
283
|
+
className: "w-full flex items-center gap-2 p-3 text-left hover:bg-[var(--muted)]/50 transition",
|
|
284
|
+
children: [
|
|
285
|
+
isExpanded ? /* @__PURE__ */ jsx(ChevronDown, { className: "w-4 h-4 text-[var(--muted-foreground)] shrink-0" }) : /* @__PURE__ */ jsx(ChevronRight, { className: "w-4 h-4 text-[var(--muted-foreground)] shrink-0" }),
|
|
286
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
287
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
288
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs font-medium text-[var(--foreground)] truncate", children: payload.nodeName || payload.nodeId }),
|
|
289
|
+
/* @__PURE__ */ jsx("span", { className: "text-[10px] px-1.5 py-0.5 bg-amber-500/10 text-amber-500 rounded", children: payload.nodeType })
|
|
290
|
+
] }),
|
|
291
|
+
/* @__PURE__ */ jsxs("div", { className: "text-[10px] text-[var(--muted-foreground)] mt-0.5", children: [
|
|
292
|
+
payload.model,
|
|
293
|
+
" \u2022 ",
|
|
294
|
+
timestamp
|
|
295
|
+
] })
|
|
296
|
+
] })
|
|
297
|
+
]
|
|
298
|
+
}
|
|
299
|
+
),
|
|
300
|
+
isExpanded && /* @__PURE__ */ jsxs("div", { className: "border-t border-[var(--border)] p-3 bg-[var(--muted)]/30", children: [
|
|
301
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-2", children: [
|
|
302
|
+
/* @__PURE__ */ jsx("span", { className: "text-[10px] font-medium text-[var(--muted-foreground)] uppercase", children: "Payload" }),
|
|
303
|
+
/* @__PURE__ */ jsxs(
|
|
304
|
+
"button",
|
|
305
|
+
{
|
|
306
|
+
onClick: handleCopy,
|
|
307
|
+
className: "flex items-center gap-1 text-[10px] text-[var(--primary)] hover:underline",
|
|
308
|
+
children: [
|
|
309
|
+
/* @__PURE__ */ jsx(Copy, { className: "w-3 h-3" }),
|
|
310
|
+
copied ? "Copied!" : "Copy"
|
|
311
|
+
]
|
|
312
|
+
}
|
|
313
|
+
)
|
|
314
|
+
] }),
|
|
315
|
+
/* @__PURE__ */ jsx("pre", { className: "text-[11px] font-mono text-[var(--muted-foreground)] bg-[var(--background)] p-2 rounded border border-[var(--border)] overflow-x-auto max-h-64 overflow-y-auto", children: JSON.stringify(payload.input, null, 2) })
|
|
316
|
+
] })
|
|
317
|
+
] });
|
|
318
|
+
}
|
|
319
|
+
function DebugPanelComponent() {
|
|
320
|
+
const debugPayloads = useExecutionStore((s) => s.debugPayloads);
|
|
321
|
+
const clearDebugPayloads = useExecutionStore((s) => s.clearDebugPayloads);
|
|
322
|
+
const setShowDebugPanel = useUIStore((s) => s.setShowDebugPanel);
|
|
323
|
+
const handleClose = useCallback(() => {
|
|
324
|
+
setShowDebugPanel(false);
|
|
325
|
+
}, [setShowDebugPanel]);
|
|
326
|
+
return /* @__PURE__ */ jsxs(PanelContainer, { className: "w-80 h-full border-l border-[var(--border)] bg-[var(--background)] flex flex-col", children: [
|
|
327
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between p-3 border-b border-[var(--border)]", children: [
|
|
328
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
329
|
+
/* @__PURE__ */ jsx(Bug, { className: "w-4 h-4 text-amber-500" }),
|
|
330
|
+
/* @__PURE__ */ jsx("span", { className: "font-medium text-sm", children: "Debug Console" }),
|
|
331
|
+
debugPayloads.length > 0 && /* @__PURE__ */ jsx("span", { className: "text-[10px] px-1.5 py-0.5 bg-amber-500/10 text-amber-500 rounded-full", children: debugPayloads.length })
|
|
332
|
+
] }),
|
|
333
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
334
|
+
debugPayloads.length > 0 && /* @__PURE__ */ jsx(
|
|
335
|
+
"button",
|
|
336
|
+
{
|
|
337
|
+
onClick: clearDebugPayloads,
|
|
338
|
+
className: "p-1.5 hover:bg-[var(--muted)] rounded transition",
|
|
339
|
+
title: "Clear all payloads",
|
|
340
|
+
children: /* @__PURE__ */ jsx(Trash2, { className: "w-4 h-4 text-[var(--muted-foreground)]" })
|
|
341
|
+
}
|
|
342
|
+
),
|
|
343
|
+
/* @__PURE__ */ jsx(
|
|
344
|
+
"button",
|
|
345
|
+
{
|
|
346
|
+
onClick: handleClose,
|
|
347
|
+
className: "p-1.5 hover:bg-[var(--muted)] rounded transition",
|
|
348
|
+
children: /* @__PURE__ */ jsx(X, { className: "w-4 h-4" })
|
|
349
|
+
}
|
|
350
|
+
)
|
|
351
|
+
] })
|
|
352
|
+
] }),
|
|
353
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1 overflow-y-auto p-3 space-y-2", children: debugPayloads.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "text-center py-8 text-[var(--muted-foreground)]", children: [
|
|
354
|
+
/* @__PURE__ */ jsx(Bug, { className: "w-12 h-12 mx-auto mb-3 opacity-50 text-amber-500/50" }),
|
|
355
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium mb-2", children: "No payloads captured" }),
|
|
356
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs", children: "Run a workflow with debug mode enabled to capture API payloads." })
|
|
357
|
+
] }) : debugPayloads.map((payload, index) => /* @__PURE__ */ jsx(
|
|
358
|
+
PayloadCard,
|
|
359
|
+
{
|
|
360
|
+
payload
|
|
361
|
+
},
|
|
362
|
+
`${payload.nodeId}-${payload.timestamp}-${index}`
|
|
363
|
+
)) }),
|
|
364
|
+
debugPayloads.length > 0 && /* @__PURE__ */ jsx("div", { className: "p-3 border-t border-[var(--border)] bg-[var(--muted)]/30", children: /* @__PURE__ */ jsxs("p", { className: "text-[10px] text-[var(--muted-foreground)]", children: [
|
|
365
|
+
debugPayloads.length,
|
|
366
|
+
" payload",
|
|
367
|
+
debugPayloads.length !== 1 ? "s" : "",
|
|
368
|
+
" captured. Click to expand and view details."
|
|
369
|
+
] }) })
|
|
370
|
+
] });
|
|
371
|
+
}
|
|
372
|
+
var DebugPanel = memo(DebugPanelComponent);
|
|
373
|
+
|
|
374
|
+
export { DebugPanel, NodePalette, PanelContainer };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|