@genfeedai/workflow-ui 0.1.0 → 0.1.2
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.js +13 -13
- package/dist/canvas.mjs +7 -7
- package/dist/{chunk-HPQT36RR.js → chunk-3TMV3K34.js} +18 -27
- package/dist/{chunk-Z7PWFZG5.js → chunk-4MZ62VMF.js} +8 -1
- package/dist/{chunk-VOGL2WCE.mjs → chunk-7P2JWDC7.mjs} +9 -18
- package/dist/{chunk-FT64PCUP.mjs → chunk-AOTUCJMA.mjs} +6 -15
- package/dist/{chunk-LAJ34AH2.mjs → chunk-AUZR6REQ.mjs} +4 -7
- package/dist/{chunk-EC2ZIWOK.js → chunk-AXFOCPPP.js} +36 -45
- package/dist/{chunk-CETJJ73S.js → chunk-BMFRA6GK.js} +28 -37
- package/dist/{chunk-XV5Z5XYR.mjs → chunk-E3YBVMYZ.mjs} +403 -59
- package/dist/{chunk-H6LZKSLY.js → chunk-ECD5J2BA.js} +496 -152
- package/dist/{chunk-ADWNF7V3.js → chunk-EMGXUNBL.js} +3 -3
- package/dist/{chunk-22PDGHNQ.mjs → chunk-HCXI63ME.mjs} +2 -2
- package/dist/{chunk-UQQUWGHW.mjs → chunk-IASLG6IA.mjs} +1 -1
- package/dist/chunk-IHF35QZD.js +1095 -0
- package/dist/{chunk-E544XUBL.js → chunk-KDIWRSYV.js} +8 -11
- package/dist/chunk-RIGVIEYB.mjs +1093 -0
- package/dist/{chunk-SW7QNEZU.js → chunk-SEV2DWKF.js} +30 -30
- package/dist/{chunk-CSUBLSKZ.mjs → chunk-SQK4JDYY.mjs} +27 -36
- package/dist/{chunk-AC6TWLRT.mjs → chunk-ZJWP5KGZ.mjs} +8 -2
- package/dist/hooks.js +15 -15
- package/dist/hooks.mjs +5 -5
- package/dist/index.js +42 -42
- package/dist/index.mjs +9 -9
- package/dist/lib.js +1 -1
- package/dist/lib.mjs +1 -1
- package/dist/nodes.js +38 -38
- package/dist/nodes.mjs +5 -5
- package/dist/panels.js +7 -7
- package/dist/panels.mjs +4 -4
- package/dist/provider.js +1 -1
- package/dist/provider.mjs +1 -1
- package/dist/stores.js +8 -8
- package/dist/stores.mjs +3 -3
- package/dist/toolbar.js +10 -10
- package/dist/toolbar.mjs +4 -4
- package/dist/ui.js +1 -1
- package/dist/ui.mjs +1 -1
- package/dist/workflowStore-7SDJC4UR.mjs +3 -0
- package/dist/workflowStore-LNJQ5RZG.js +12 -0
- package/package.json +1 -1
- package/dist/chunk-BJ3R5R32.mjs +0 -2163
- package/dist/chunk-NSDLGLAQ.js +0 -2166
- package/dist/workflowStore-4EGKJLYK.mjs +0 -3
- package/dist/workflowStore-KM32FDL7.js +0 -12
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var chunkZ7PWFZG5_js = require('./chunk-Z7PWFZG5.js');
|
|
3
|
+
var chunkIHF35QZD_js = require('./chunk-IHF35QZD.js');
|
|
5
4
|
var zustand = require('zustand');
|
|
5
|
+
var types = require('@genfeedai/types');
|
|
6
6
|
|
|
7
7
|
var notificationId = 0;
|
|
8
8
|
var useUIStore = zustand.create((set) => ({
|
|
@@ -86,9 +86,6 @@ var useUIStore = zustand.create((set) => ({
|
|
|
86
86
|
}));
|
|
87
87
|
}
|
|
88
88
|
}));
|
|
89
|
-
|
|
90
|
-
// src/stores/settingsStore.ts
|
|
91
|
-
var import_types = chunkZ7PWFZG5_js.__toESM(chunkNSDLGLAQ_js.require_dist());
|
|
92
89
|
var STORAGE_KEY = "genfeed-settings";
|
|
93
90
|
var MAX_RECENT_MODELS = 8;
|
|
94
91
|
var DEFAULT_SETTINGS = {
|
|
@@ -216,7 +213,7 @@ var useSettingsStore = zustand.create((set, get) => {
|
|
|
216
213
|
},
|
|
217
214
|
setEdgeStyle: (style) => {
|
|
218
215
|
setAndPersist(() => ({ edgeStyle: style }));
|
|
219
|
-
import('./workflowStore-
|
|
216
|
+
import('./workflowStore-LNJQ5RZG.js').then(({ useWorkflowStore: useWorkflowStore2 }) => {
|
|
220
217
|
useWorkflowStore2.getState().setEdgeStyle(style);
|
|
221
218
|
});
|
|
222
219
|
},
|
|
@@ -271,10 +268,10 @@ var useSettingsStore = zustand.create((set, get) => {
|
|
|
271
268
|
const key = state.providers[provider].apiKey;
|
|
272
269
|
if (!key) return {};
|
|
273
270
|
const headerMap = {
|
|
274
|
-
[
|
|
275
|
-
[
|
|
276
|
-
[
|
|
277
|
-
[
|
|
271
|
+
[types.ProviderTypeEnum.REPLICATE]: "X-Replicate-Key",
|
|
272
|
+
[types.ProviderTypeEnum.FAL]: "X-Fal-Key",
|
|
273
|
+
[types.ProviderTypeEnum.HUGGINGFACE]: "X-HF-Key",
|
|
274
|
+
[types.ProviderTypeEnum.GENFEED_AI]: "X-Genfeed-Key"
|
|
278
275
|
};
|
|
279
276
|
return { [headerMap[provider]]: key };
|
|
280
277
|
},
|
|
@@ -287,34 +284,28 @@ var useSettingsStore = zustand.create((set, get) => {
|
|
|
287
284
|
};
|
|
288
285
|
});
|
|
289
286
|
var PROVIDER_INFO = {
|
|
290
|
-
[
|
|
287
|
+
[types.ProviderTypeEnum.REPLICATE]: {
|
|
291
288
|
name: "Replicate",
|
|
292
289
|
description: "Access thousands of open-source AI models",
|
|
293
290
|
docsUrl: "https://replicate.com/docs"
|
|
294
291
|
},
|
|
295
|
-
[
|
|
292
|
+
[types.ProviderTypeEnum.FAL]: {
|
|
296
293
|
name: "fal.ai",
|
|
297
294
|
description: "Fast inference for image and video generation",
|
|
298
295
|
docsUrl: "https://fal.ai/docs"
|
|
299
296
|
},
|
|
300
|
-
[
|
|
297
|
+
[types.ProviderTypeEnum.HUGGINGFACE]: {
|
|
301
298
|
name: "Hugging Face",
|
|
302
299
|
description: "The AI community platform with 500k+ models",
|
|
303
300
|
docsUrl: "https://huggingface.co/docs/api-inference"
|
|
304
301
|
},
|
|
305
|
-
[
|
|
302
|
+
[types.ProviderTypeEnum.GENFEED_AI]: {
|
|
306
303
|
name: "Genfeed AI",
|
|
307
304
|
description: "Built-in models powered by Genfeed",
|
|
308
305
|
docsUrl: "https://genfeed.ai/docs"
|
|
309
306
|
}
|
|
310
307
|
};
|
|
311
308
|
|
|
312
|
-
// src/stores/execution/slices/executionSlice.ts
|
|
313
|
-
var import_types3 = chunkZ7PWFZG5_js.__toESM(chunkNSDLGLAQ_js.require_dist());
|
|
314
|
-
|
|
315
|
-
// src/stores/execution/helpers/sseSubscription.ts
|
|
316
|
-
var import_types2 = chunkZ7PWFZG5_js.__toESM(chunkNSDLGLAQ_js.require_dist());
|
|
317
|
-
|
|
318
309
|
// src/stores/execution/helpers/outputHelpers.ts
|
|
319
310
|
function extractOutputValue(output) {
|
|
320
311
|
if (!output) return null;
|
|
@@ -396,11 +387,11 @@ function getOutputUpdate(nodeId, output, workflowStore) {
|
|
|
396
387
|
// src/stores/execution/helpers/sseSubscription.ts
|
|
397
388
|
var API_BASE_URL = process.env.NEXT_PUBLIC_API_URL || "http://local.genfeed.ai:3001/api";
|
|
398
389
|
var statusMap = {
|
|
399
|
-
pending:
|
|
400
|
-
processing:
|
|
401
|
-
complete:
|
|
402
|
-
succeeded:
|
|
403
|
-
error:
|
|
390
|
+
pending: types.NodeStatusEnum.IDLE,
|
|
391
|
+
processing: types.NodeStatusEnum.PROCESSING,
|
|
392
|
+
complete: types.NodeStatusEnum.COMPLETE,
|
|
393
|
+
succeeded: types.NodeStatusEnum.COMPLETE,
|
|
394
|
+
error: types.NodeStatusEnum.ERROR
|
|
404
395
|
};
|
|
405
396
|
function applyJobUpdates(jobs, workflowStore, debugMode, set, filterNodeId) {
|
|
406
397
|
if (!jobs || jobs.length === 0) return;
|
|
@@ -466,9 +457,9 @@ async function reconcileNodeStatuses(executionId) {
|
|
|
466
457
|
const response = await fetch(`${API_BASE_URL}/executions/${executionId}`);
|
|
467
458
|
if (!response.ok) return;
|
|
468
459
|
const execution = await response.json();
|
|
469
|
-
const workflowStore =
|
|
460
|
+
const workflowStore = chunkIHF35QZD_js.useWorkflowStore.getState();
|
|
470
461
|
for (const nodeResult of execution.nodeResults || []) {
|
|
471
|
-
const nodeStatus = statusMap[nodeResult.status] ??
|
|
462
|
+
const nodeStatus = statusMap[nodeResult.status] ?? types.NodeStatusEnum.IDLE;
|
|
472
463
|
const isSuccess = nodeResult.status === "complete" || nodeResult.status === "succeeded";
|
|
473
464
|
workflowStore.updateNodeData(nodeResult.nodeId, {
|
|
474
465
|
status: nodeStatus,
|
|
@@ -490,10 +481,10 @@ function createExecutionSubscription(executionId, set) {
|
|
|
490
481
|
void (async () => {
|
|
491
482
|
try {
|
|
492
483
|
const data = JSON.parse(event.data);
|
|
493
|
-
const workflowStore =
|
|
484
|
+
const workflowStore = chunkIHF35QZD_js.useWorkflowStore.getState();
|
|
494
485
|
const nodeResults = data.nodeResults || [];
|
|
495
486
|
for (const nodeResult of nodeResults) {
|
|
496
|
-
const nodeStatus = statusMap[nodeResult.status] ??
|
|
487
|
+
const nodeStatus = statusMap[nodeResult.status] ?? types.NodeStatusEnum.IDLE;
|
|
497
488
|
const isSuccess = nodeResult.status === "complete" || nodeResult.status === "succeeded";
|
|
498
489
|
workflowStore.updateNodeData(nodeResult.nodeId, {
|
|
499
490
|
status: nodeStatus,
|
|
@@ -541,10 +532,10 @@ function createNodeExecutionSubscription(executionId, nodeId, set, _get) {
|
|
|
541
532
|
void (async () => {
|
|
542
533
|
try {
|
|
543
534
|
const data = JSON.parse(event.data);
|
|
544
|
-
const workflowStore =
|
|
535
|
+
const workflowStore = chunkIHF35QZD_js.useWorkflowStore.getState();
|
|
545
536
|
const nodeResults = data.nodeResults || [];
|
|
546
537
|
for (const nodeResult of nodeResults) {
|
|
547
|
-
const nodeStatus = statusMap[nodeResult.status] ??
|
|
538
|
+
const nodeStatus = statusMap[nodeResult.status] ?? types.NodeStatusEnum.IDLE;
|
|
548
539
|
const isSuccess = nodeResult.status === "complete" || nodeResult.status === "succeeded";
|
|
549
540
|
workflowStore.updateNodeData(nodeResult.nodeId, {
|
|
550
541
|
status: nodeStatus,
|
|
@@ -610,7 +601,7 @@ var createExecutionSlice = (set, get) => ({
|
|
|
610
601
|
executeWorkflow: async () => {
|
|
611
602
|
const { isRunning, resetExecution } = get();
|
|
612
603
|
if (isRunning) return;
|
|
613
|
-
const workflowStore =
|
|
604
|
+
const workflowStore = chunkIHF35QZD_js.useWorkflowStore.getState();
|
|
614
605
|
const debugMode = useSettingsStore.getState().debugMode;
|
|
615
606
|
const validation = workflowStore.validateWorkflow();
|
|
616
607
|
if (!validation.isValid) {
|
|
@@ -650,7 +641,7 @@ var createExecutionSlice = (set, get) => ({
|
|
|
650
641
|
set({ isRunning: true });
|
|
651
642
|
for (const node of workflowStore.nodes) {
|
|
652
643
|
workflowStore.updateNodeData(node.id, {
|
|
653
|
-
status:
|
|
644
|
+
status: types.NodeStatusEnum.IDLE,
|
|
654
645
|
error: void 0,
|
|
655
646
|
progress: void 0
|
|
656
647
|
});
|
|
@@ -680,14 +671,14 @@ var createExecutionSlice = (set, get) => ({
|
|
|
680
671
|
}
|
|
681
672
|
},
|
|
682
673
|
executeNode: async (nodeId) => {
|
|
683
|
-
const workflowStore =
|
|
674
|
+
const workflowStore = chunkIHF35QZD_js.useWorkflowStore.getState();
|
|
684
675
|
const debugMode = useSettingsStore.getState().debugMode;
|
|
685
676
|
if (workflowStore.isDirty || !workflowStore.workflowId) {
|
|
686
677
|
try {
|
|
687
678
|
await workflowStore.saveWorkflow();
|
|
688
679
|
} catch {
|
|
689
680
|
workflowStore.updateNodeData(nodeId, {
|
|
690
|
-
status:
|
|
681
|
+
status: types.NodeStatusEnum.ERROR,
|
|
691
682
|
error: "Failed to save workflow"
|
|
692
683
|
});
|
|
693
684
|
return;
|
|
@@ -696,7 +687,7 @@ var createExecutionSlice = (set, get) => ({
|
|
|
696
687
|
const workflowId = workflowStore.workflowId;
|
|
697
688
|
if (!workflowId) {
|
|
698
689
|
workflowStore.updateNodeData(nodeId, {
|
|
699
|
-
status:
|
|
690
|
+
status: types.NodeStatusEnum.ERROR,
|
|
700
691
|
error: "Workflow must be saved first"
|
|
701
692
|
});
|
|
702
693
|
return;
|
|
@@ -723,7 +714,7 @@ var createExecutionSlice = (set, get) => ({
|
|
|
723
714
|
});
|
|
724
715
|
} catch (error) {
|
|
725
716
|
workflowStore.updateNodeData(nodeId, {
|
|
726
|
-
status:
|
|
717
|
+
status: types.NodeStatusEnum.ERROR,
|
|
727
718
|
error: error instanceof Error ? error.message : "Node execution failed"
|
|
728
719
|
});
|
|
729
720
|
}
|
|
@@ -731,7 +722,7 @@ var createExecutionSlice = (set, get) => ({
|
|
|
731
722
|
executeSelectedNodes: async () => {
|
|
732
723
|
const { isRunning, resetExecution } = get();
|
|
733
724
|
if (isRunning) return;
|
|
734
|
-
const workflowStore =
|
|
725
|
+
const workflowStore = chunkIHF35QZD_js.useWorkflowStore.getState();
|
|
735
726
|
const debugMode = useSettingsStore.getState().debugMode;
|
|
736
727
|
const { selectedNodeIds } = workflowStore;
|
|
737
728
|
if (selectedNodeIds.length === 0) {
|
|
@@ -777,7 +768,7 @@ var createExecutionSlice = (set, get) => ({
|
|
|
777
768
|
}
|
|
778
769
|
for (const nodeId of selectedNodeIds) {
|
|
779
770
|
workflowStore.updateNodeData(nodeId, {
|
|
780
|
-
status:
|
|
771
|
+
status: types.NodeStatusEnum.IDLE,
|
|
781
772
|
error: void 0,
|
|
782
773
|
progress: void 0
|
|
783
774
|
});
|
|
@@ -810,7 +801,7 @@ var createExecutionSlice = (set, get) => ({
|
|
|
810
801
|
resumeFromFailed: async () => {
|
|
811
802
|
const { isRunning, executionId, lastFailedNodeId } = get();
|
|
812
803
|
if (isRunning || !executionId || !lastFailedNodeId) return;
|
|
813
|
-
const workflowStore =
|
|
804
|
+
const workflowStore = chunkIHF35QZD_js.useWorkflowStore.getState();
|
|
814
805
|
const debugMode = useSettingsStore.getState().debugMode;
|
|
815
806
|
const workflowId = workflowStore.workflowId;
|
|
816
807
|
if (!workflowId) {
|
|
@@ -828,7 +819,7 @@ var createExecutionSlice = (set, get) => ({
|
|
|
828
819
|
useUIStore.getState().setShowDebugPanel(true);
|
|
829
820
|
}
|
|
830
821
|
workflowStore.updateNodeData(lastFailedNodeId, {
|
|
831
|
-
status:
|
|
822
|
+
status: types.NodeStatusEnum.IDLE,
|
|
832
823
|
error: void 0,
|
|
833
824
|
progress: void 0
|
|
834
825
|
});
|
|
@@ -884,8 +875,8 @@ var createExecutionSlice = (set, get) => ({
|
|
|
884
875
|
return { activeNodeExecutions: newMap };
|
|
885
876
|
});
|
|
886
877
|
}
|
|
887
|
-
const workflowStore =
|
|
888
|
-
workflowStore.updateNodeData(nodeId, { status:
|
|
878
|
+
const workflowStore = chunkIHF35QZD_js.useWorkflowStore.getState();
|
|
879
|
+
workflowStore.updateNodeData(nodeId, { status: types.NodeStatusEnum.IDLE, error: void 0 });
|
|
889
880
|
},
|
|
890
881
|
isNodeExecuting: (nodeId) => {
|
|
891
882
|
const { activeNodeExecutions } = get();
|
|
@@ -914,10 +905,10 @@ var createExecutionSlice = (set, get) => ({
|
|
|
914
905
|
debugPayloads: [],
|
|
915
906
|
activeNodeExecutions: /* @__PURE__ */ new Map()
|
|
916
907
|
});
|
|
917
|
-
const workflowStore =
|
|
908
|
+
const workflowStore = chunkIHF35QZD_js.useWorkflowStore.getState();
|
|
918
909
|
for (const node of workflowStore.nodes) {
|
|
919
910
|
workflowStore.updateNodeData(node.id, {
|
|
920
|
-
status:
|
|
911
|
+
status: types.NodeStatusEnum.IDLE,
|
|
921
912
|
error: void 0,
|
|
922
913
|
progress: void 0
|
|
923
914
|
});
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkECD5J2BA_js = require('./chunk-ECD5J2BA.js');
|
|
4
4
|
var chunk3YFFDHC5_js = require('./chunk-3YFFDHC5.js');
|
|
5
|
-
var
|
|
5
|
+
var chunkEMGXUNBL_js = require('./chunk-EMGXUNBL.js');
|
|
6
6
|
var chunk5HJFQVUR_js = require('./chunk-5HJFQVUR.js');
|
|
7
7
|
var chunk6DOEUDD5_js = require('./chunk-6DOEUDD5.js');
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var chunkZ7PWFZG5_js = require('./chunk-Z7PWFZG5.js');
|
|
8
|
+
var chunkAXFOCPPP_js = require('./chunk-AXFOCPPP.js');
|
|
9
|
+
var chunkIHF35QZD_js = require('./chunk-IHF35QZD.js');
|
|
11
10
|
var react$1 = require('@xyflow/react');
|
|
12
11
|
var lucideReact = require('lucide-react');
|
|
13
12
|
var react = require('react');
|
|
14
13
|
require('@xyflow/react/dist/style.css');
|
|
14
|
+
var types = require('@genfeedai/types');
|
|
15
15
|
var clsx = require('clsx');
|
|
16
16
|
var jsxRuntime = require('react/jsx-runtime');
|
|
17
17
|
var Image = require('next/image');
|
|
@@ -20,9 +20,6 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
|
20
20
|
|
|
21
21
|
var Image__default = /*#__PURE__*/_interopDefault(Image);
|
|
22
22
|
|
|
23
|
-
// src/canvas/WorkflowCanvas.tsx
|
|
24
|
-
var import_types3 = chunkZ7PWFZG5_js.__toESM(chunkNSDLGLAQ_js.require_dist());
|
|
25
|
-
|
|
26
23
|
// src/types/groups.ts
|
|
27
24
|
var GROUP_COLORS = {
|
|
28
25
|
purple: {
|
|
@@ -126,7 +123,7 @@ function GroupBackground({ group, bounds }) {
|
|
|
126
123
|
}
|
|
127
124
|
function GroupControls({ group, bounds, nodeMap, zoom }) {
|
|
128
125
|
const { setNodes } = react$1.useReactFlow();
|
|
129
|
-
const { toggleGroupLock, deleteGroup, setGroupColor, setDirty, renameGroup } =
|
|
126
|
+
const { toggleGroupLock, deleteGroup, setGroupColor, setDirty, renameGroup } = chunkIHF35QZD_js.useWorkflowStore();
|
|
130
127
|
const [showColorPicker, setShowColorPicker] = react.useState(false);
|
|
131
128
|
const [isEditing, setIsEditing] = react.useState(false);
|
|
132
129
|
const [editName, setEditName] = react.useState(group.name);
|
|
@@ -356,7 +353,7 @@ function GroupControls({ group, bounds, nodeMap, zoom }) {
|
|
|
356
353
|
] });
|
|
357
354
|
}
|
|
358
355
|
function GroupBackgroundsPortalComponent() {
|
|
359
|
-
const { groups } =
|
|
356
|
+
const { groups } = chunkIHF35QZD_js.useWorkflowStore();
|
|
360
357
|
const nodes = react$1.useNodes();
|
|
361
358
|
const nodeMap = react.useMemo(() => new Map(nodes.map((n) => [n.id, n])), [nodes]);
|
|
362
359
|
const groupBounds = react.useMemo(() => {
|
|
@@ -377,7 +374,7 @@ function GroupBackgroundsPortalComponent() {
|
|
|
377
374
|
}) }) });
|
|
378
375
|
}
|
|
379
376
|
function GroupControlsOverlayComponent() {
|
|
380
|
-
const { groups } =
|
|
377
|
+
const { groups } = chunkIHF35QZD_js.useWorkflowStore();
|
|
381
378
|
const nodes = react$1.useNodes();
|
|
382
379
|
const { zoom } = react$1.useViewport();
|
|
383
380
|
const nodeMap = react.useMemo(() => new Map(nodes.map((n) => [n.id, n])), [nodes]);
|
|
@@ -419,7 +416,7 @@ var GroupOverlay = react.memo(GroupOverlayComponent);
|
|
|
419
416
|
var SNAP_THRESHOLD = 5;
|
|
420
417
|
function HelperLinesComponent({ draggingNodeId }) {
|
|
421
418
|
const [lines, setLines] = react.useState([]);
|
|
422
|
-
const nodes =
|
|
419
|
+
const nodes = chunkIHF35QZD_js.useWorkflowStore((state) => state.nodes);
|
|
423
420
|
const transform = react$1.useStore((state) => state.transform);
|
|
424
421
|
const calculateHelperLines = react.useCallback(
|
|
425
422
|
(draggingId) => {
|
|
@@ -562,12 +559,9 @@ function HelperLinesComponent({ draggingNodeId }) {
|
|
|
562
559
|
);
|
|
563
560
|
}
|
|
564
561
|
var HelperLines = react.memo(HelperLinesComponent);
|
|
565
|
-
|
|
566
|
-
// src/canvas/NodeSearch.tsx
|
|
567
|
-
var import_types = chunkZ7PWFZG5_js.__toESM(chunkNSDLGLAQ_js.require_dist());
|
|
568
562
|
function NodeSearch() {
|
|
569
|
-
const { activeModal, closeModal } =
|
|
570
|
-
const { nodes, setSelectedNodeIds } =
|
|
563
|
+
const { activeModal, closeModal } = chunkAXFOCPPP_js.useUIStore();
|
|
564
|
+
const { nodes, setSelectedNodeIds } = chunkIHF35QZD_js.useWorkflowStore();
|
|
571
565
|
const reactFlow = react$1.useReactFlow();
|
|
572
566
|
const [search, setSearch] = react.useState("");
|
|
573
567
|
const [selectedIndex, setSelectedIndex] = react.useState(0);
|
|
@@ -587,7 +581,7 @@ function NodeSearch() {
|
|
|
587
581
|
const label = (node.data.label || "").toLowerCase();
|
|
588
582
|
const type = (node.type || "").toLowerCase();
|
|
589
583
|
const comment = (node.data.comment || "").toLowerCase();
|
|
590
|
-
const nodeDefLabel =
|
|
584
|
+
const nodeDefLabel = types.NODE_DEFINITIONS[node.type]?.label?.toLowerCase() || "";
|
|
591
585
|
return label.includes(query) || type.includes(query) || comment.includes(query) || nodeDefLabel.includes(query);
|
|
592
586
|
});
|
|
593
587
|
}, [nodes, search]);
|
|
@@ -687,7 +681,7 @@ function NodeSearch() {
|
|
|
687
681
|
)
|
|
688
682
|
] }),
|
|
689
683
|
/* @__PURE__ */ jsxRuntime.jsx("div", { ref: listRef, className: "max-h-[300px] overflow-y-auto space-y-1", children: filteredNodes.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-center text-muted-foreground py-8", children: search ? `No nodes found for "${search}"` : "No nodes in workflow" }) : filteredNodes.map((node, index) => {
|
|
690
|
-
const nodeDef =
|
|
684
|
+
const nodeDef = types.NODE_DEFINITIONS[node.type];
|
|
691
685
|
const comment = node.data.comment;
|
|
692
686
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
693
687
|
"button",
|
|
@@ -764,7 +758,7 @@ var SHORTCUTS = [
|
|
|
764
758
|
];
|
|
765
759
|
var CATEGORIES = ["Navigation", "Selection", "Editing", "Nodes", "Organization", "Help"];
|
|
766
760
|
function ShortcutHelpModal() {
|
|
767
|
-
const { activeModal, closeModal } =
|
|
761
|
+
const { activeModal, closeModal } = chunkAXFOCPPP_js.useUIStore();
|
|
768
762
|
const [searchQuery, setSearchQuery] = react.useState("");
|
|
769
763
|
const backdropRef = react.useRef(null);
|
|
770
764
|
const inputRef = react.useRef(null);
|
|
@@ -868,13 +862,10 @@ function ShortcutHelpModal() {
|
|
|
868
862
|
}
|
|
869
863
|
);
|
|
870
864
|
}
|
|
871
|
-
|
|
872
|
-
// src/nodes/NodeDetailModal.tsx
|
|
873
|
-
var import_types2 = chunkZ7PWFZG5_js.__toESM(chunkNSDLGLAQ_js.require_dist());
|
|
874
865
|
var PROMPT_NODE_TYPES = ["prompt"];
|
|
875
866
|
function NodeDetailModal() {
|
|
876
|
-
const { activeModal, nodeDetailNodeId, nodeDetailStartIndex, closeNodeDetailModal } =
|
|
877
|
-
const { getNodeById } =
|
|
867
|
+
const { activeModal, nodeDetailNodeId, nodeDetailStartIndex, closeNodeDetailModal } = chunkAXFOCPPP_js.useUIStore();
|
|
868
|
+
const { getNodeById } = chunkIHF35QZD_js.useWorkflowStore();
|
|
878
869
|
const { openEditor } = chunk6DOEUDD5_js.usePromptEditorStore();
|
|
879
870
|
const [zoomLevel, setZoomLevel] = react.useState(1);
|
|
880
871
|
const [panOffset, setPanOffset] = react.useState({ x: 0, y: 0 });
|
|
@@ -899,7 +890,7 @@ function NodeDetailModal() {
|
|
|
899
890
|
}, [node]);
|
|
900
891
|
const nodeDef = react.useMemo(() => {
|
|
901
892
|
if (!node) return null;
|
|
902
|
-
return
|
|
893
|
+
return types.NODE_DEFINITIONS[node.type];
|
|
903
894
|
}, [node]);
|
|
904
895
|
const imageUrls = mediaInfo.urls ?? [];
|
|
905
896
|
const hasMultipleImages = imageUrls.length > 1;
|
|
@@ -1129,7 +1120,7 @@ function supportsImageInput(schema) {
|
|
|
1129
1120
|
function getEdgeDataType(edge, nodeMap) {
|
|
1130
1121
|
const sourceNode = nodeMap.get(edge.source);
|
|
1131
1122
|
if (!sourceNode) return null;
|
|
1132
|
-
const nodeDef =
|
|
1123
|
+
const nodeDef = types.NODE_DEFINITIONS[sourceNode.type];
|
|
1133
1124
|
if (!nodeDef) return null;
|
|
1134
1125
|
const sourceHandle = nodeDef.outputs.find((h) => h.id === edge.sourceHandle);
|
|
1135
1126
|
return sourceHandle?.type ?? null;
|
|
@@ -1152,7 +1143,7 @@ function WorkflowCanvas({ nodeTypes: nodeTypesProp } = {}) {
|
|
|
1152
1143
|
unlockAllNodes,
|
|
1153
1144
|
groups,
|
|
1154
1145
|
getConnectedNodeIds
|
|
1155
|
-
} =
|
|
1146
|
+
} = chunkIHF35QZD_js.useWorkflowStore();
|
|
1156
1147
|
const {
|
|
1157
1148
|
selectNode,
|
|
1158
1149
|
setHighlightedNodeIds,
|
|
@@ -1160,21 +1151,21 @@ function WorkflowCanvas({ nodeTypes: nodeTypesProp } = {}) {
|
|
|
1160
1151
|
showPalette,
|
|
1161
1152
|
togglePalette,
|
|
1162
1153
|
openModal
|
|
1163
|
-
} =
|
|
1154
|
+
} = chunkAXFOCPPP_js.useUIStore();
|
|
1164
1155
|
const reactFlow = react$1.useReactFlow();
|
|
1165
|
-
const { edgeStyle, showMinimap } =
|
|
1166
|
-
const isRunning =
|
|
1167
|
-
const currentNodeId =
|
|
1168
|
-
const executingNodeIds =
|
|
1169
|
-
const activeNodeExecutions =
|
|
1170
|
-
const hasActiveNodeExecutions =
|
|
1156
|
+
const { edgeStyle, showMinimap } = chunkAXFOCPPP_js.useSettingsStore();
|
|
1157
|
+
const isRunning = chunkAXFOCPPP_js.useExecutionStore((state) => state.isRunning);
|
|
1158
|
+
const currentNodeId = chunkAXFOCPPP_js.useExecutionStore((state) => state.currentNodeId);
|
|
1159
|
+
const executingNodeIds = chunkAXFOCPPP_js.useExecutionStore((state) => state.executingNodeIds);
|
|
1160
|
+
const activeNodeExecutions = chunkAXFOCPPP_js.useExecutionStore((state) => state.activeNodeExecutions);
|
|
1161
|
+
const hasActiveNodeExecutions = chunkAXFOCPPP_js.useExecutionStore((state) => state.activeNodeExecutions.size > 0);
|
|
1171
1162
|
const [isMinimapVisible, setIsMinimapVisible] = react.useState(false);
|
|
1172
1163
|
const [draggingNodeId, setDraggingNodeId] = react.useState(null);
|
|
1173
1164
|
const hideTimeoutRef = react.useRef(null);
|
|
1174
1165
|
const MINIMAP_HIDE_DELAY = 1500;
|
|
1175
1166
|
const openShortcutHelp = react.useCallback(() => openModal("shortcutHelp"), [openModal]);
|
|
1176
1167
|
const openNodeSearch = react.useCallback(() => openModal("nodeSearch"), [openModal]);
|
|
1177
|
-
|
|
1168
|
+
chunkEMGXUNBL_js.useCanvasKeyboardShortcuts({
|
|
1178
1169
|
selectedNodeIds,
|
|
1179
1170
|
groups,
|
|
1180
1171
|
nodes,
|
|
@@ -1443,7 +1434,7 @@ function WorkflowCanvas({ nodeTypes: nodeTypesProp } = {}) {
|
|
|
1443
1434
|
onNodeDrag: handleNodeDrag,
|
|
1444
1435
|
onNodeDragStop: handleNodeDragStop,
|
|
1445
1436
|
isValidConnection: checkValidConnection,
|
|
1446
|
-
nodeTypes: nodeTypesProp ??
|
|
1437
|
+
nodeTypes: nodeTypesProp ?? chunkECD5J2BA_js.nodeTypes,
|
|
1447
1438
|
fitView: true,
|
|
1448
1439
|
snapToGrid: true,
|
|
1449
1440
|
snapGrid: [16, 16],
|