@genfeedai/workflow-ui 0.1.3 → 0.1.5

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.
Files changed (84) hide show
  1. package/dist/canvas.d.mts +16 -2
  2. package/dist/canvas.mjs +10 -8
  3. package/dist/chunk-6PSJTBNV.mjs +638 -0
  4. package/dist/chunk-7H3WJJYS.mjs +52 -0
  5. package/dist/{chunk-HCXI63ME.mjs → chunk-AUQGOJOQ.mjs} +27 -4
  6. package/dist/{chunk-AOTUCJMA.mjs → chunk-GWBGK3KL.mjs} +2 -2
  7. package/dist/chunk-JTPADIUO.mjs +130 -0
  8. package/dist/{chunk-SQK4JDYY.mjs → chunk-LT3ZJJL6.mjs} +9 -2
  9. package/dist/{chunk-7P2JWDC7.mjs → chunk-O5II6BOJ.mjs} +1198 -254
  10. package/dist/{chunk-AUZR6REQ.mjs → chunk-OQREHJXK.mjs} +1 -1
  11. package/dist/chunk-OY7BRSGG.mjs +60 -0
  12. package/dist/{chunk-E3YBVMYZ.mjs → chunk-PANZDSP6.mjs} +274 -305
  13. package/dist/chunk-PCIWWD37.mjs +90 -0
  14. package/dist/{chunk-RIGVIEYB.mjs → chunk-R727OFBR.mjs} +11 -1
  15. package/dist/chunk-ZD2BADZO.mjs +1294 -0
  16. package/dist/contextMenuStore-DMg0hJQ1.d.mts +22 -0
  17. package/dist/hooks.d.mts +53 -244
  18. package/dist/hooks.mjs +6 -6
  19. package/dist/index.d.mts +11 -7
  20. package/dist/index.mjs +13 -11
  21. package/dist/lib.d.mts +250 -4
  22. package/dist/lib.mjs +562 -2
  23. package/dist/nodes.d.mts +3 -1
  24. package/dist/nodes.mjs +6 -6
  25. package/dist/panels.mjs +3 -4
  26. package/dist/{promptLibraryStore-zqb59nsu.d.mts → promptLibraryStore-Bgw5LzvD.d.mts} +33 -5
  27. package/dist/provider.d.mts +2 -2
  28. package/dist/provider.mjs +0 -1
  29. package/dist/stores.d.mts +4 -3
  30. package/dist/stores.mjs +3 -40
  31. package/dist/toolbar.d.mts +3 -1
  32. package/dist/toolbar.mjs +5 -4
  33. package/dist/{types-ipAnBzAJ.d.mts → types-CF6DPx0P.d.mts} +8 -3
  34. package/dist/ui.d.mts +1 -1
  35. package/dist/ui.mjs +0 -1
  36. package/dist/{hooks.d.ts → useCommentNavigation-NzJjkaj2.d.mts} +15 -2
  37. package/dist/workflowStore-UAAKOOIK.mjs +2 -0
  38. package/package.json +31 -25
  39. package/dist/canvas.d.ts +0 -27
  40. package/dist/canvas.js +0 -45
  41. package/dist/chunk-3SPPKCWR.js +0 -458
  42. package/dist/chunk-3TMV3K34.js +0 -534
  43. package/dist/chunk-3YFFDHC5.js +0 -300
  44. package/dist/chunk-4MZ62VMF.js +0 -37
  45. package/dist/chunk-5HJFQVUR.js +0 -61
  46. package/dist/chunk-5LQ4QBR5.js +0 -2
  47. package/dist/chunk-6DOEUDD5.js +0 -254
  48. package/dist/chunk-AXFOCPPP.js +0 -998
  49. package/dist/chunk-BMFRA6GK.js +0 -1546
  50. package/dist/chunk-E323WAZG.mjs +0 -272
  51. package/dist/chunk-ECD5J2BA.js +0 -6022
  52. package/dist/chunk-EMGXUNBL.js +0 -120
  53. package/dist/chunk-EMUMKW5C.js +0 -107
  54. package/dist/chunk-FOMOOERN.js +0 -2
  55. package/dist/chunk-IASLG6IA.mjs +0 -118
  56. package/dist/chunk-IHF35QZD.js +0 -1095
  57. package/dist/chunk-JLWKW3G5.js +0 -2
  58. package/dist/chunk-KDIWRSYV.js +0 -375
  59. package/dist/chunk-L5TF4EHW.mjs +0 -1
  60. package/dist/chunk-RJ262NXS.js +0 -24
  61. package/dist/chunk-RXNEDWK2.js +0 -141
  62. package/dist/chunk-SEV2DWKF.js +0 -744
  63. package/dist/chunk-ZJWP5KGZ.mjs +0 -33
  64. package/dist/hooks.js +0 -56
  65. package/dist/index.d.ts +0 -29
  66. package/dist/index.js +0 -180
  67. package/dist/lib.d.ts +0 -164
  68. package/dist/lib.js +0 -144
  69. package/dist/nodes.d.ts +0 -128
  70. package/dist/nodes.js +0 -151
  71. package/dist/panels.d.ts +0 -22
  72. package/dist/panels.js +0 -21
  73. package/dist/promptLibraryStore-BZnfmEkc.d.ts +0 -464
  74. package/dist/provider.d.ts +0 -29
  75. package/dist/provider.js +0 -17
  76. package/dist/stores.d.ts +0 -96
  77. package/dist/stores.js +0 -113
  78. package/dist/toolbar.d.ts +0 -73
  79. package/dist/toolbar.js +0 -34
  80. package/dist/types-ipAnBzAJ.d.ts +0 -46
  81. package/dist/ui.d.ts +0 -67
  82. package/dist/ui.js +0 -84
  83. package/dist/workflowStore-7SDJC4UR.mjs +0 -3
  84. package/dist/workflowStore-LNJQ5RZG.js +0 -12
@@ -1,2 +0,0 @@
1
- 'use strict';
2
-
@@ -1,375 +0,0 @@
1
- 'use strict';
2
-
3
- var chunkAXFOCPPP_js = require('./chunk-AXFOCPPP.js');
4
- var types = require('@genfeedai/types');
5
- var lucideReact = require('lucide-react');
6
- var react = require('react');
7
- var jsxRuntime = require('react/jsx-runtime');
8
-
9
- var ICONS = {
10
- // Input
11
- Image: lucideReact.Image,
12
- MessageSquare: lucideReact.MessageSquare,
13
- FileText: lucideReact.FileText,
14
- FileVideo: lucideReact.FileVideo,
15
- Volume2: lucideReact.Volume2,
16
- Puzzle: lucideReact.Puzzle,
17
- // AI
18
- Sparkles: lucideReact.Sparkles,
19
- Video: lucideReact.Video,
20
- Brain: lucideReact.Brain,
21
- Mic: lucideReact.Mic,
22
- AudioLines: lucideReact.AudioLines,
23
- Navigation: lucideReact.Navigation,
24
- // Processing
25
- Maximize2: lucideReact.Maximize2,
26
- Wand2: lucideReact.Wand2,
27
- Layers: lucideReact.Layers,
28
- Scissors: lucideReact.Scissors,
29
- Film: lucideReact.Film,
30
- Crop: lucideReact.Crop,
31
- Maximize: lucideReact.Maximize,
32
- Grid3X3: lucideReact.Grid3X3,
33
- Pencil: lucideReact.Pencil,
34
- Subtitles: lucideReact.Subtitles,
35
- LayoutGrid: lucideReact.LayoutGrid,
36
- Columns2: lucideReact.Columns2,
37
- // Output
38
- CheckCircle: lucideReact.CheckCircle,
39
- Eye: lucideReact.Eye,
40
- Download: lucideReact.Download,
41
- // Composition
42
- ArrowRightToLine: lucideReact.ArrowRightToLine,
43
- ArrowLeftFromLine: lucideReact.ArrowLeftFromLine,
44
- GitBranch: lucideReact.GitBranch
45
- };
46
- var CATEGORY_LABELS = {
47
- input: "Input",
48
- ai: "AI Generation",
49
- processing: "Processing",
50
- output: "Output",
51
- composition: "Composition"
52
- };
53
- var CATEGORY_COLORS = {
54
- input: {
55
- icon: "bg-[var(--category-input)]/20 text-[var(--category-input)]",
56
- hover: "hover:border-[var(--category-input)]",
57
- cssVar: "var(--category-input)"
58
- },
59
- ai: {
60
- icon: "bg-[var(--category-ai)]/20 text-[var(--category-ai)]",
61
- hover: "hover:border-[var(--category-ai)]",
62
- cssVar: "var(--category-ai)"
63
- },
64
- processing: {
65
- icon: "bg-[var(--category-processing)]/20 text-[var(--category-processing)]",
66
- hover: "hover:border-[var(--category-processing)]",
67
- cssVar: "var(--category-processing)"
68
- },
69
- output: {
70
- icon: "bg-[var(--category-output)]/20 text-[var(--category-output)]",
71
- hover: "hover:border-[var(--category-output)]",
72
- cssVar: "var(--category-output)"
73
- },
74
- composition: {
75
- icon: "bg-[var(--category-composition)]/20 text-[var(--category-composition)]",
76
- hover: "hover:border-[var(--category-composition)]",
77
- cssVar: "var(--category-composition)"
78
- }
79
- };
80
- function NodeCard({ type, label, description, icon, category }) {
81
- const Icon = ICONS[icon] ?? lucideReact.Sparkles;
82
- const handleDragStart = react.useCallback(
83
- (event) => {
84
- event.dataTransfer.setData("nodeType", type);
85
- event.dataTransfer.effectAllowed = "move";
86
- },
87
- [type]
88
- );
89
- const colors = CATEGORY_COLORS[category];
90
- return /* @__PURE__ */ jsxRuntime.jsx(
91
- "div",
92
- {
93
- draggable: true,
94
- onDragStart: handleDragStart,
95
- className: `p-3 bg-[var(--card)] border border-[var(--border)] rounded-lg cursor-grab transition-colors group ${colors.hover}`,
96
- children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-3", children: [
97
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: `p-2 rounded ${colors.icon}`, children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: "w-4 h-4" }) }),
98
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 min-w-0", children: [
99
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-medium text-sm text-[var(--foreground)] truncate", children: label }),
100
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs text-[var(--muted-foreground)] mt-0.5 line-clamp-2", children: description })
101
- ] })
102
- ] })
103
- }
104
- );
105
- }
106
- function CategorySection({ category, isExpanded, onToggle }) {
107
- const nodes = types.getNodesByCategory()[category];
108
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-b border-[var(--border)] last:border-0", children: [
109
- /* @__PURE__ */ jsxRuntime.jsxs(
110
- "button",
111
- {
112
- onClick: onToggle,
113
- className: "w-full flex items-center gap-2 px-4 py-3 text-left hover:bg-[var(--secondary)] transition cursor-pointer",
114
- children: [
115
- isExpanded ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "w-4 h-4 text-[var(--muted-foreground)]" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "w-4 h-4 text-[var(--muted-foreground)]" }),
116
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-sm text-[var(--foreground)]", children: CATEGORY_LABELS[category] }),
117
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-[var(--muted-foreground)] ml-auto", children: nodes.length })
118
- ]
119
- }
120
- ),
121
- isExpanded && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-4 pb-4 space-y-2", children: nodes.map((node) => /* @__PURE__ */ jsxRuntime.jsx(
122
- NodeCard,
123
- {
124
- type: node.type,
125
- label: node.label,
126
- description: node.description,
127
- icon: node.icon,
128
- category: node.category
129
- },
130
- node.type
131
- )) })
132
- ] });
133
- }
134
- function NodePalette() {
135
- const { togglePalette } = chunkAXFOCPPP_js.useUIStore();
136
- const [searchQuery, setSearchQuery] = react.useState("");
137
- const [expandedCategories, setExpandedCategories] = react.useState(
138
- /* @__PURE__ */ new Set(["input"])
139
- );
140
- const nodesByCategory = react.useMemo(() => types.getNodesByCategory(), []);
141
- const filteredNodes = react.useMemo(() => {
142
- if (!searchQuery.trim()) return null;
143
- const query = searchQuery.toLowerCase();
144
- const results = [];
145
- for (const category of Object.keys(nodesByCategory)) {
146
- for (const node of nodesByCategory[category]) {
147
- if (node.label.toLowerCase().includes(query) || node.description.toLowerCase().includes(query)) {
148
- results.push(node);
149
- }
150
- }
151
- }
152
- return results;
153
- }, [searchQuery, nodesByCategory]);
154
- const toggleCategory = react.useCallback((category) => {
155
- setExpandedCategories((prev) => {
156
- const next = new Set(prev);
157
- if (next.has(category)) {
158
- next.delete(category);
159
- } else {
160
- next.add(category);
161
- }
162
- return next;
163
- });
164
- }, []);
165
- const categories = react.useMemo(
166
- () => ["input", "ai", "processing", "output", "composition"].filter(
167
- (cat) => nodesByCategory[cat].length > 0
168
- ),
169
- [nodesByCategory]
170
- );
171
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-64 min-w-64 h-full bg-[var(--background)] border-r border-[var(--border)] flex flex-col overflow-hidden", children: [
172
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-4 py-3 border-b border-[var(--border)] flex items-start justify-between gap-2", children: [
173
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
174
- /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "font-semibold text-sm text-[var(--foreground)]", children: "Nodes" }),
175
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-[var(--muted-foreground)] mt-1", children: "Drag to canvas" })
176
- ] }),
177
- /* @__PURE__ */ jsxRuntime.jsx(
178
- "button",
179
- {
180
- onClick: togglePalette,
181
- className: "p-1.5 hover:bg-[var(--secondary)] rounded-md transition-colors group",
182
- title: "Close sidebar (M)",
183
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PanelLeftClose, { className: "w-4 h-4 text-[var(--muted-foreground)] group-hover:text-[var(--foreground)]" })
184
- }
185
- )
186
- ] }),
187
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-4 py-3 border-b border-[var(--border)]", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
188
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Search, { className: "absolute left-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-[var(--muted-foreground)]" }),
189
- /* @__PURE__ */ jsxRuntime.jsx(
190
- "input",
191
- {
192
- type: "text",
193
- placeholder: "Search nodes...",
194
- value: searchQuery,
195
- onChange: (e) => setSearchQuery(e.target.value),
196
- 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)]"
197
- }
198
- )
199
- ] }) }),
200
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 overflow-y-auto", children: filteredNodes ? (
201
- // Search results
202
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-4 py-3 space-y-2", children: filteredNodes.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-[var(--muted-foreground)] text-center py-4", children: "No nodes found" }) : filteredNodes.map((node) => /* @__PURE__ */ jsxRuntime.jsx(
203
- NodeCard,
204
- {
205
- type: node.type,
206
- label: node.label,
207
- description: node.description,
208
- icon: node.icon,
209
- category: node.category
210
- },
211
- node.type
212
- )) })
213
- ) : (
214
- // Category view
215
- categories.map((category) => /* @__PURE__ */ jsxRuntime.jsx(
216
- CategorySection,
217
- {
218
- category,
219
- isExpanded: expandedCategories.has(category),
220
- onToggle: () => toggleCategory(category)
221
- },
222
- category
223
- ))
224
- ) })
225
- ] });
226
- }
227
- var PanelContainer = react.forwardRef(
228
- ({ children, className, ...props }, ref) => {
229
- const stopPropagation = (e) => {
230
- e.stopPropagation();
231
- };
232
- return /* @__PURE__ */ jsxRuntime.jsx(
233
- "div",
234
- {
235
- ref,
236
- className,
237
- onClick: stopPropagation,
238
- onMouseDown: stopPropagation,
239
- onPointerDown: stopPropagation,
240
- onDoubleClick: stopPropagation,
241
- ...props,
242
- children
243
- }
244
- );
245
- }
246
- );
247
- PanelContainer.displayName = "PanelContainer";
248
- function PayloadCard({ payload }) {
249
- const [isExpanded, setIsExpanded] = react.useState(false);
250
- const [copied, setCopied] = react.useState(false);
251
- const handleCopy = react.useCallback(
252
- async (e) => {
253
- e.stopPropagation();
254
- try {
255
- await navigator.clipboard.writeText(JSON.stringify(payload.input, null, 2));
256
- setCopied(true);
257
- setTimeout(() => setCopied(false), 2e3);
258
- } catch {
259
- const textArea = document.createElement("textarea");
260
- textArea.value = JSON.stringify(payload.input, null, 2);
261
- textArea.style.position = "fixed";
262
- textArea.style.left = "-9999px";
263
- document.body.appendChild(textArea);
264
- textArea.select();
265
- try {
266
- document.execCommand("copy");
267
- setCopied(true);
268
- setTimeout(() => setCopied(false), 2e3);
269
- } catch {
270
- }
271
- document.body.removeChild(textArea);
272
- }
273
- },
274
- [payload.input]
275
- );
276
- const timestamp = new Date(payload.timestamp).toLocaleTimeString();
277
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border border-[var(--border)] rounded-lg overflow-hidden", children: [
278
- /* @__PURE__ */ jsxRuntime.jsxs(
279
- "button",
280
- {
281
- onClick: () => setIsExpanded(!isExpanded),
282
- className: "w-full flex items-center gap-2 p-3 text-left hover:bg-[var(--muted)]/50 transition",
283
- children: [
284
- isExpanded ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "w-4 h-4 text-[var(--muted-foreground)] shrink-0" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "w-4 h-4 text-[var(--muted-foreground)] shrink-0" }),
285
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 min-w-0", children: [
286
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
287
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-medium text-[var(--foreground)] truncate", children: payload.nodeName || payload.nodeId }),
288
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] px-1.5 py-0.5 bg-amber-500/10 text-amber-500 rounded", children: payload.nodeType })
289
- ] }),
290
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-[10px] text-[var(--muted-foreground)] mt-0.5", children: [
291
- payload.model,
292
- " \u2022 ",
293
- timestamp
294
- ] })
295
- ] })
296
- ]
297
- }
298
- ),
299
- isExpanded && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-t border-[var(--border)] p-3 bg-[var(--muted)]/30", children: [
300
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between mb-2", children: [
301
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] font-medium text-[var(--muted-foreground)] uppercase", children: "Payload" }),
302
- /* @__PURE__ */ jsxRuntime.jsxs(
303
- "button",
304
- {
305
- onClick: handleCopy,
306
- className: "flex items-center gap-1 text-[10px] text-[var(--primary)] hover:underline",
307
- children: [
308
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Copy, { className: "w-3 h-3" }),
309
- copied ? "Copied!" : "Copy"
310
- ]
311
- }
312
- )
313
- ] }),
314
- /* @__PURE__ */ jsxRuntime.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) })
315
- ] })
316
- ] });
317
- }
318
- function DebugPanelComponent() {
319
- const debugPayloads = chunkAXFOCPPP_js.useExecutionStore((s) => s.debugPayloads);
320
- const clearDebugPayloads = chunkAXFOCPPP_js.useExecutionStore((s) => s.clearDebugPayloads);
321
- const setShowDebugPanel = chunkAXFOCPPP_js.useUIStore((s) => s.setShowDebugPanel);
322
- const handleClose = react.useCallback(() => {
323
- setShowDebugPanel(false);
324
- }, [setShowDebugPanel]);
325
- return /* @__PURE__ */ jsxRuntime.jsxs(PanelContainer, { className: "w-80 h-full border-l border-[var(--border)] bg-[var(--background)] flex flex-col", children: [
326
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between p-3 border-b border-[var(--border)]", children: [
327
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
328
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Bug, { className: "w-4 h-4 text-amber-500" }),
329
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-sm", children: "Debug Console" }),
330
- debugPayloads.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] px-1.5 py-0.5 bg-amber-500/10 text-amber-500 rounded-full", children: debugPayloads.length })
331
- ] }),
332
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1", children: [
333
- debugPayloads.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
334
- "button",
335
- {
336
- onClick: clearDebugPayloads,
337
- className: "p-1.5 hover:bg-[var(--muted)] rounded transition",
338
- title: "Clear all payloads",
339
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2, { className: "w-4 h-4 text-[var(--muted-foreground)]" })
340
- }
341
- ),
342
- /* @__PURE__ */ jsxRuntime.jsx(
343
- "button",
344
- {
345
- onClick: handleClose,
346
- className: "p-1.5 hover:bg-[var(--muted)] rounded transition",
347
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "w-4 h-4" })
348
- }
349
- )
350
- ] })
351
- ] }),
352
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 overflow-y-auto p-3 space-y-2", children: debugPayloads.length === 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center py-8 text-[var(--muted-foreground)]", children: [
353
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Bug, { className: "w-12 h-12 mx-auto mb-3 opacity-50 text-amber-500/50" }),
354
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium mb-2", children: "No payloads captured" }),
355
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs", children: "Run a workflow with debug mode enabled to capture API payloads." })
356
- ] }) : debugPayloads.map((payload, index) => /* @__PURE__ */ jsxRuntime.jsx(
357
- PayloadCard,
358
- {
359
- payload
360
- },
361
- `${payload.nodeId}-${payload.timestamp}-${index}`
362
- )) }),
363
- debugPayloads.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-3 border-t border-[var(--border)] bg-[var(--muted)]/30", children: /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-[10px] text-[var(--muted-foreground)]", children: [
364
- debugPayloads.length,
365
- " payload",
366
- debugPayloads.length !== 1 ? "s" : "",
367
- " captured. Click to expand and view details."
368
- ] }) })
369
- ] });
370
- }
371
- var DebugPanel = react.memo(DebugPanelComponent);
372
-
373
- exports.DebugPanel = DebugPanel;
374
- exports.NodePalette = NodePalette;
375
- exports.PanelContainer = PanelContainer;
@@ -1 +0,0 @@
1
-
@@ -1,24 +0,0 @@
1
- 'use strict';
2
-
3
- var chunkRXNEDWK2_js = require('./chunk-RXNEDWK2.js');
4
- var react = require('react');
5
- var jsxRuntime = require('react/jsx-runtime');
6
-
7
- var WorkflowUIContext = react.createContext({});
8
- function WorkflowUIProvider({
9
- config,
10
- children
11
- }) {
12
- react.useEffect(() => {
13
- if (config.promptLibrary) {
14
- chunkRXNEDWK2_js.configurePromptLibrary(config.promptLibrary);
15
- }
16
- }, [config.promptLibrary]);
17
- return /* @__PURE__ */ jsxRuntime.jsx(WorkflowUIContext.Provider, { value: config, children });
18
- }
19
- function useWorkflowUIConfig() {
20
- return react.useContext(WorkflowUIContext);
21
- }
22
-
23
- exports.WorkflowUIProvider = WorkflowUIProvider;
24
- exports.useWorkflowUIConfig = useWorkflowUIConfig;
@@ -1,141 +0,0 @@
1
- 'use strict';
2
-
3
- var zustand = require('zustand');
4
-
5
- var _promptApi = null;
6
- function configurePromptLibrary(api) {
7
- _promptApi = api;
8
- }
9
- var usePromptLibraryStore = zustand.create((set, get) => ({
10
- // Initial state
11
- items: [],
12
- featuredItems: [],
13
- selectedItem: null,
14
- isLoading: false,
15
- error: null,
16
- searchQuery: "",
17
- categoryFilter: null,
18
- isPickerOpen: false,
19
- isCreateModalOpen: false,
20
- editingItem: null,
21
- // UI Actions
22
- setSearchQuery: (query) => set({ searchQuery: query }),
23
- setCategoryFilter: (category) => set({ categoryFilter: category }),
24
- setSelectedItem: (item) => set({ selectedItem: item }),
25
- openPicker: () => set({ isPickerOpen: true }),
26
- closePicker: () => set({ isPickerOpen: false }),
27
- openCreateModal: (editItem) => set({
28
- isCreateModalOpen: true,
29
- editingItem: editItem ?? null
30
- }),
31
- closeCreateModal: () => set({
32
- isCreateModalOpen: false,
33
- editingItem: null
34
- }),
35
- // API Actions — all no-op if _promptApi is not configured
36
- loadItems: async (query, signal) => {
37
- if (!_promptApi) return;
38
- set({ isLoading: true, error: null });
39
- try {
40
- const { searchQuery, categoryFilter } = get();
41
- const finalQuery = {
42
- ...query,
43
- search: query?.search ?? (searchQuery || void 0),
44
- category: query?.category ?? categoryFilter ?? void 0
45
- };
46
- const items = await _promptApi.getAll(finalQuery, signal);
47
- set({ items, isLoading: false });
48
- } catch (error) {
49
- if (error.name !== "AbortError") {
50
- set({ error: error.message, isLoading: false });
51
- }
52
- }
53
- },
54
- loadFeatured: async (signal) => {
55
- if (!_promptApi) return;
56
- try {
57
- const featuredItems = await _promptApi.getFeatured(10, signal);
58
- set({ featuredItems });
59
- } catch (error) {
60
- if (error.name !== "AbortError") ;
61
- }
62
- },
63
- createItem: async (data, signal) => {
64
- if (!_promptApi) throw new Error("Prompt library not configured");
65
- set({ isLoading: true, error: null });
66
- try {
67
- const item = await _promptApi.create(data, signal);
68
- set((state) => ({
69
- items: [item, ...state.items],
70
- isLoading: false,
71
- isCreateModalOpen: false,
72
- editingItem: null
73
- }));
74
- return item;
75
- } catch (error) {
76
- set({ error: error.message, isLoading: false });
77
- throw error;
78
- }
79
- },
80
- updateItem: async (id, data, signal) => {
81
- if (!_promptApi) throw new Error("Prompt library not configured");
82
- set({ isLoading: true, error: null });
83
- try {
84
- const item = await _promptApi.update(id, data, signal);
85
- set((state) => ({
86
- items: state.items.map((i) => i._id === id ? item : i),
87
- selectedItem: state.selectedItem?._id === id ? item : state.selectedItem,
88
- isLoading: false,
89
- isCreateModalOpen: false,
90
- editingItem: null
91
- }));
92
- return item;
93
- } catch (error) {
94
- set({ error: error.message, isLoading: false });
95
- throw error;
96
- }
97
- },
98
- deleteItem: async (id, signal) => {
99
- if (!_promptApi) throw new Error("Prompt library not configured");
100
- try {
101
- await _promptApi.delete(id, signal);
102
- set((state) => ({
103
- items: state.items.filter((i) => i._id !== id),
104
- selectedItem: state.selectedItem?._id === id ? null : state.selectedItem
105
- }));
106
- } catch (error) {
107
- set({ error: error.message });
108
- throw error;
109
- }
110
- },
111
- duplicateItem: async (id, signal) => {
112
- if (!_promptApi) throw new Error("Prompt library not configured");
113
- try {
114
- const item = await _promptApi.duplicate(id, signal);
115
- set((state) => ({
116
- items: [item, ...state.items]
117
- }));
118
- return item;
119
- } catch (error) {
120
- set({ error: error.message });
121
- throw error;
122
- }
123
- },
124
- recordItemUsage: async (id, signal) => {
125
- if (!_promptApi) throw new Error("Prompt library not configured");
126
- try {
127
- const item = await _promptApi.use(id, signal);
128
- set((state) => ({
129
- items: state.items.map((i) => i._id === id ? item : i),
130
- isPickerOpen: false
131
- }));
132
- return item;
133
- } catch (error) {
134
- set({ error: error.message });
135
- throw error;
136
- }
137
- }
138
- }));
139
-
140
- exports.configurePromptLibrary = configurePromptLibrary;
141
- exports.usePromptLibraryStore = usePromptLibraryStore;