@genfeedai/workflow-ui 0.2.5 → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/canvas.mjs +19 -17
- package/dist/canvas.mjs.map +1 -0
- package/dist/{chunk-MGLAKMDP.mjs → chunk-2BHILUF7.mjs} +2 -0
- package/dist/chunk-2BHILUF7.mjs.map +1 -0
- package/dist/{chunk-U4QPE4CY.mjs → chunk-2C2AAXJP.mjs} +2 -0
- package/dist/chunk-2C2AAXJP.mjs.map +1 -0
- package/dist/{chunk-ZSITTZ4S.mjs → chunk-3GWH2ZOH.mjs} +5 -3
- package/dist/chunk-3GWH2ZOH.mjs.map +1 -0
- package/dist/{chunk-XRC3O5GK.mjs → chunk-4JOFNZW6.mjs} +2 -0
- package/dist/chunk-4JOFNZW6.mjs.map +1 -0
- package/dist/{chunk-2FUPL67V.mjs → chunk-55JFUNLR.mjs} +253 -237
- package/dist/chunk-55JFUNLR.mjs.map +1 -0
- package/dist/{chunk-GPYIIWD5.mjs → chunk-7DJHFOIW.mjs} +3 -1
- package/dist/chunk-7DJHFOIW.mjs.map +1 -0
- package/dist/{chunk-QQVHGJ2G.mjs → chunk-AZJFDWBF.mjs} +2 -0
- package/dist/chunk-AZJFDWBF.mjs.map +1 -0
- package/dist/{chunk-C6MQBJFC.mjs → chunk-G3HCTMAZ.mjs} +3 -1
- package/dist/chunk-G3HCTMAZ.mjs.map +1 -0
- package/dist/{chunk-IYFWAJBB.mjs → chunk-HMTYPFOT.mjs} +3 -1
- package/dist/chunk-HMTYPFOT.mjs.map +1 -0
- package/dist/{chunk-7LV4UAUS.mjs → chunk-IKR6GVZ4.mjs} +2 -0
- package/dist/chunk-IKR6GVZ4.mjs.map +1 -0
- package/dist/{chunk-YUIK4AHM.mjs → chunk-JSF4FHBH.mjs} +3 -1
- package/dist/chunk-JSF4FHBH.mjs.map +1 -0
- package/dist/{chunk-OJWVEEMM.mjs → chunk-R5L7WB7F.mjs} +4 -2
- package/dist/chunk-R5L7WB7F.mjs.map +1 -0
- package/dist/{chunk-53XDE62A.mjs → chunk-RY6OZJ7A.mjs} +8 -6
- package/dist/chunk-RY6OZJ7A.mjs.map +1 -0
- package/dist/{chunk-B4EAAKYF.mjs → chunk-SBB2YW3Y.mjs} +2 -0
- package/dist/chunk-SBB2YW3Y.mjs.map +1 -0
- package/dist/{chunk-FWJIAW2E.mjs → chunk-SHU7JPQY.mjs} +7 -5
- package/dist/chunk-SHU7JPQY.mjs.map +1 -0
- package/dist/chunk-SRPSHHHV.mjs +3 -0
- package/dist/chunk-SRPSHHHV.mjs.map +1 -0
- package/dist/{chunk-ESVULCFY.mjs → chunk-TOFB4BTA.mjs} +3 -1
- package/dist/chunk-TOFB4BTA.mjs.map +1 -0
- package/dist/{chunk-ORVDYXDP.mjs → chunk-VKXTPLM7.mjs} +6 -4
- package/dist/chunk-VKXTPLM7.mjs.map +1 -0
- package/dist/{chunk-VVQ4CH77.mjs → chunk-X3XNTD4R.mjs} +5 -2
- package/dist/chunk-X3XNTD4R.mjs.map +1 -0
- package/dist/chunk-YYFM6P4C.mjs +3 -0
- package/dist/chunk-YYFM6P4C.mjs.map +1 -0
- package/dist/hooks.mjs +13 -11
- package/dist/hooks.mjs.map +1 -0
- package/dist/index.mjs +27 -25
- package/dist/index.mjs.map +1 -0
- package/dist/lib.mjs +6 -4
- package/dist/lib.mjs.map +1 -0
- package/dist/nodes.mjs +15 -13
- package/dist/nodes.mjs.map +1 -0
- package/dist/panels.mjs +5 -3
- package/dist/panels.mjs.map +1 -0
- package/dist/provider.mjs +5 -3
- package/dist/provider.mjs.map +1 -0
- package/dist/stores.mjs +8 -6
- package/dist/stores.mjs.map +1 -0
- package/dist/toolbar.mjs +7 -5
- package/dist/toolbar.mjs.map +1 -0
- package/dist/ui.mjs +4 -2
- package/dist/ui.mjs.map +1 -0
- package/dist/workflowStore-XYPHB6DS.mjs +4 -0
- package/dist/workflowStore-XYPHB6DS.mjs.map +1 -0
- package/package.json +24 -24
- package/dist/chunk-LDN7IX4Y.mjs +0 -1
- package/dist/chunk-MLJJBBTB.mjs +0 -1
- package/dist/workflowStore-N2F7WIG3.mjs +0 -2
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { Checkbox, Select, SelectTrigger, SelectValue, SelectContent, SelectItem, Slider, Label, Input, GridPositionSelector, ComparisonSlider } from './chunk-
|
|
2
|
-
import { useNodeExecution, useCanGenerate, useModelSelection, useAutoLoadModelSchema, useAIGenNode, useAIGenNodeHeader, useMediaUpload, usePromptAutocomplete, useRequiredInputs } from './chunk-
|
|
3
|
-
import { Button } from './chunk-
|
|
4
|
-
import { generateHandlesFromSchema, IMAGE_MODEL_MAP, DEFAULT_IMAGE_MODEL, IMAGE_MODEL_ID_MAP, IMAGE_MODELS, LIPSYNC_MODELS, LIPSYNC_SYNC_MODES, LLM_MODEL_MAP, DEFAULT_LLM_MODEL, LLM_MODEL_ID_MAP, LLM_MODELS, VIDEO_MODEL_MAP, DEFAULT_VIDEO_MODEL, VIDEO_MODEL_ID_MAP, VIDEO_MODELS, EASING_PRESETS, CubicBezierEditor, getMediaFromNode } from './chunk-
|
|
5
|
-
import { getImageDimensions, getVideoMetadata } from './chunk-
|
|
6
|
-
import { useWorkflowUIConfig } from './chunk-
|
|
7
|
-
import { usePromptEditorStore, useAnnotationStore } from './chunk-
|
|
8
|
-
import { useUIStore, useExecutionStore } from './chunk-
|
|
9
|
-
import { useWorkflowStore } from './chunk-
|
|
10
|
-
import { usePromptLibraryStore } from './chunk-
|
|
1
|
+
import { Checkbox, Select, SelectTrigger, SelectValue, SelectContent, SelectItem, Slider, Label, Input, GridPositionSelector, ComparisonSlider } from './chunk-G3HCTMAZ.mjs';
|
|
2
|
+
import { useNodeExecution, useCanGenerate, useModelSelection, useAutoLoadModelSchema, useAIGenNode, useAIGenNodeHeader, useMediaUpload, usePromptAutocomplete, useRequiredInputs } from './chunk-SHU7JPQY.mjs';
|
|
3
|
+
import { Button } from './chunk-SBB2YW3Y.mjs';
|
|
4
|
+
import { generateHandlesFromSchema, IMAGE_MODEL_MAP, DEFAULT_IMAGE_MODEL, IMAGE_MODEL_ID_MAP, IMAGE_MODELS, LIPSYNC_MODELS, LIPSYNC_SYNC_MODES, LLM_MODEL_MAP, DEFAULT_LLM_MODEL, LLM_MODEL_ID_MAP, LLM_MODELS, VIDEO_MODEL_MAP, DEFAULT_VIDEO_MODEL, VIDEO_MODEL_ID_MAP, VIDEO_MODELS, EASING_PRESETS, CubicBezierEditor, getMediaFromNode } from './chunk-2C2AAXJP.mjs';
|
|
5
|
+
import { getImageDimensions, getVideoMetadata } from './chunk-X3XNTD4R.mjs';
|
|
6
|
+
import { useWorkflowUIConfig } from './chunk-JSF4FHBH.mjs';
|
|
7
|
+
import { usePromptEditorStore, useAnnotationStore } from './chunk-AZJFDWBF.mjs';
|
|
8
|
+
import { useUIStore, useExecutionStore } from './chunk-R5L7WB7F.mjs';
|
|
9
|
+
import { useWorkflowStore } from './chunk-7DJHFOIW.mjs';
|
|
10
|
+
import { usePromptLibraryStore } from './chunk-4JOFNZW6.mjs';
|
|
11
11
|
import { Wand2, Volume2, Video, Subtitles, Sparkles, Share2, Scissors, RefreshCw, Puzzle, Pencil, Navigation, Mic, MessageSquare, Maximize2, Maximize, LayoutGrid, Layers, Image as Image$1, Grid3X3, GitBranch, Film, FileVideo, FileText, Eye, Download, Crop, Columns2, CheckCircle, Brain, AudioLines, AtSign, ArrowRightToLine, ArrowLeftFromLine, Square, Lock, Unlock, Copy, RotateCcw, Loader2, ChevronDown, ChevronRight, AlertCircle, ImageIcon, Expand, Play, AlertTriangle, CheckCircle2, Upload, Link, X, Music, Save, Clock, Shapes, ChevronLeft, SplitSquareHorizontal, Zap, ZoomOut, ZoomIn } from 'lucide-react';
|
|
12
12
|
import Image4 from 'next/image';
|
|
13
|
-
import { memo,
|
|
13
|
+
import { memo, createContext, useRef, useState, useMemo, Children, useEffect, useCallback, Component, useLayoutEffect, useContext } from 'react';
|
|
14
14
|
import { NODE_DEFINITIONS, NodeStatusEnum } from '@genfeedai/types';
|
|
15
15
|
import { useUpdateNodeInternals, NodeResizer, Handle, Position } from '@xyflow/react';
|
|
16
16
|
import { clsx } from 'clsx';
|
|
17
|
-
import {
|
|
17
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
18
18
|
import { createPortal } from 'react-dom';
|
|
19
19
|
import { useShallow } from 'zustand/react/shallow';
|
|
20
20
|
import { LUMA_ASPECT_RATIOS } from '@genfeedai/core';
|
|
@@ -256,6 +256,14 @@ function BaseNodeComponent({
|
|
|
256
256
|
const outputKey = nodeDef?.outputs?.map((output) => `${output.id}:${output.type}`).join("|") ?? "";
|
|
257
257
|
return `${inputKey}__${outputKey}__${_disabledInputsKey}`;
|
|
258
258
|
}, [sortedInputs, nodeDef?.outputs, _disabledInputsKey]);
|
|
259
|
+
const normalizedHeaderActions = useMemo(
|
|
260
|
+
() => headerActions ? Children.toArray(headerActions) : null,
|
|
261
|
+
[headerActions]
|
|
262
|
+
);
|
|
263
|
+
const normalizedChildren = useMemo(
|
|
264
|
+
() => Children.toArray(children),
|
|
265
|
+
[children]
|
|
266
|
+
);
|
|
259
267
|
useEffect(() => {
|
|
260
268
|
const rafId = requestAnimationFrame(() => {
|
|
261
269
|
updateNodeInternals(id);
|
|
@@ -267,8 +275,8 @@ function BaseNodeComponent({
|
|
|
267
275
|
(state) => state.activeNodeExecutions.has(id)
|
|
268
276
|
);
|
|
269
277
|
const handleRetry = useCallback(
|
|
270
|
-
(
|
|
271
|
-
|
|
278
|
+
(e3) => {
|
|
279
|
+
e3.stopPropagation();
|
|
272
280
|
if (!nodeExecuting) {
|
|
273
281
|
updateNodeData(id, {
|
|
274
282
|
error: void 0,
|
|
@@ -280,8 +288,8 @@ function BaseNodeComponent({
|
|
|
280
288
|
[id, nodeExecuting, executeNode, updateNodeData]
|
|
281
289
|
);
|
|
282
290
|
const handleStopNode = useCallback(
|
|
283
|
-
(
|
|
284
|
-
|
|
291
|
+
(e3) => {
|
|
292
|
+
e3.stopPropagation();
|
|
285
293
|
if (isRunning) {
|
|
286
294
|
stopExecution();
|
|
287
295
|
} else if (nodeExecuting) {
|
|
@@ -300,8 +308,8 @@ function BaseNodeComponent({
|
|
|
300
308
|
]
|
|
301
309
|
);
|
|
302
310
|
const handleCopyError = useCallback(
|
|
303
|
-
async (
|
|
304
|
-
|
|
311
|
+
async (e3) => {
|
|
312
|
+
e3.stopPropagation();
|
|
305
313
|
if (nodeData.error) {
|
|
306
314
|
if (navigator.clipboard) {
|
|
307
315
|
await navigator.clipboard.writeText(nodeData.error);
|
|
@@ -345,8 +353,8 @@ function BaseNodeComponent({
|
|
|
345
353
|
const Icon = ICON_MAP[nodeDef.icon] ?? Sparkles;
|
|
346
354
|
const isSelected = selected || selectedNodeId === id;
|
|
347
355
|
const isLocked = isNodeLocked(id);
|
|
348
|
-
const handleLockToggle = (
|
|
349
|
-
|
|
356
|
+
const handleLockToggle = (e3) => {
|
|
357
|
+
e3.stopPropagation();
|
|
350
358
|
toggleNodeLock(id);
|
|
351
359
|
};
|
|
352
360
|
const categoryCssVars = {
|
|
@@ -471,7 +479,7 @@ function BaseNodeComponent({
|
|
|
471
479
|
children: isLocked ? /* @__PURE__ */ jsx(Lock, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(Unlock, { className: "h-4 w-4" })
|
|
472
480
|
}
|
|
473
481
|
),
|
|
474
|
-
|
|
482
|
+
normalizedHeaderActions
|
|
475
483
|
] }),
|
|
476
484
|
/* @__PURE__ */ jsx("div", { className: "flex-1 flex flex-col p-3 min-h-0", children: /* @__PURE__ */ jsxs(NodeErrorBoundary, { nodeId: id, nodeType: type, children: [
|
|
477
485
|
nodeData.error && /* @__PURE__ */ jsxs("div", { className: "mb-3 rounded-md border border-destructive/30 bg-destructive/10 p-2", children: [
|
|
@@ -504,7 +512,7 @@ function BaseNodeComponent({
|
|
|
504
512
|
}
|
|
505
513
|
)
|
|
506
514
|
] }),
|
|
507
|
-
|
|
515
|
+
normalizedChildren,
|
|
508
516
|
nodeData.status === "processing" && nodeData.progress !== void 0 && /* @__PURE__ */ jsxs("div", { className: "mt-3", children: [
|
|
509
517
|
/* @__PURE__ */ jsx("div", { className: "h-1.5 overflow-hidden rounded-full bg-secondary", children: /* @__PURE__ */ jsx(
|
|
510
518
|
"div",
|
|
@@ -549,8 +557,8 @@ function arePropsEqual(prev, next) {
|
|
|
549
557
|
const prevDisabled = prev.disabledInputs ?? [];
|
|
550
558
|
const nextDisabled = next.disabledInputs ?? [];
|
|
551
559
|
if (prevDisabled.length !== nextDisabled.length) return false;
|
|
552
|
-
for (let
|
|
553
|
-
if (prevDisabled[
|
|
560
|
+
for (let i3 = 0; i3 < prevDisabled.length; i3++) {
|
|
561
|
+
if (prevDisabled[i3] !== nextDisabled[i3]) return false;
|
|
554
562
|
}
|
|
555
563
|
const prevData = prev.data;
|
|
556
564
|
const nextData = next.data;
|
|
@@ -707,7 +715,7 @@ function NegativePromptSelectorComponent({
|
|
|
707
715
|
{
|
|
708
716
|
type: "text",
|
|
709
717
|
value: customText,
|
|
710
|
-
onChange: (
|
|
718
|
+
onChange: (e3) => handleCustomChange(e3.target.value),
|
|
711
719
|
placeholder: "ugly, deformed, ...",
|
|
712
720
|
className: "nodrag nopan w-full h-7 rounded-md border border-input bg-background px-2 text-xs shadow-sm placeholder:text-muted-foreground/50 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
|
|
713
721
|
}
|
|
@@ -788,7 +796,7 @@ function getEnumKey(refPath) {
|
|
|
788
796
|
}
|
|
789
797
|
function formatLabel(key, title) {
|
|
790
798
|
if (title) return title;
|
|
791
|
-
return key.replace(/_/g, " ").replace(/\b\w/g, (
|
|
799
|
+
return key.replace(/_/g, " ").replace(/\b\w/g, (c3) => c3.toUpperCase());
|
|
792
800
|
}
|
|
793
801
|
function EnumSelect({
|
|
794
802
|
propertyKey,
|
|
@@ -844,7 +852,7 @@ function SliderInput({
|
|
|
844
852
|
max,
|
|
845
853
|
step,
|
|
846
854
|
value: currentValue,
|
|
847
|
-
onChange: (
|
|
855
|
+
onChange: (e3) => onChange(Number(e3.target.value)),
|
|
848
856
|
className: "nodrag nopan w-16 h-7 rounded-md border border-input bg-background px-2 text-xs text-center shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
|
|
849
857
|
}
|
|
850
858
|
)
|
|
@@ -897,8 +905,8 @@ function NumberInput({
|
|
|
897
905
|
type: "number",
|
|
898
906
|
value: currentValue ?? "",
|
|
899
907
|
placeholder: property.nullable ? "Random" : void 0,
|
|
900
|
-
onChange: (
|
|
901
|
-
const val =
|
|
908
|
+
onChange: (e3) => {
|
|
909
|
+
const val = e3.target.value;
|
|
902
910
|
onChange(val === "" ? null : Number(val));
|
|
903
911
|
},
|
|
904
912
|
className: "nodrag nopan w-full h-8 rounded-md border border-input bg-background px-2 text-sm shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
|
|
@@ -922,9 +930,9 @@ function SchemaInputsComponent({
|
|
|
922
930
|
);
|
|
923
931
|
const sortedProperties = useMemo(() => {
|
|
924
932
|
if (!schema) return [];
|
|
925
|
-
return Object.entries(schema).filter(([key]) => !CONNECTION_FIELDS.has(key)).sort((
|
|
926
|
-
const orderA =
|
|
927
|
-
const orderB =
|
|
933
|
+
return Object.entries(schema).filter(([key]) => !CONNECTION_FIELDS.has(key)).sort((a4, b2) => {
|
|
934
|
+
const orderA = a4[1]["x-order"] ?? 999;
|
|
935
|
+
const orderB = b2[1]["x-order"] ?? 999;
|
|
928
936
|
return orderA - orderB;
|
|
929
937
|
});
|
|
930
938
|
}, [schema]);
|
|
@@ -942,7 +950,7 @@ function SchemaInputsComponent({
|
|
|
942
950
|
NegativePromptSelector,
|
|
943
951
|
{
|
|
944
952
|
value: value ?? "",
|
|
945
|
-
onChange: (
|
|
953
|
+
onChange: (v2) => handleChange(key, v2)
|
|
946
954
|
},
|
|
947
955
|
key
|
|
948
956
|
);
|
|
@@ -960,13 +968,13 @@ function SchemaInputsComponent({
|
|
|
960
968
|
property,
|
|
961
969
|
value,
|
|
962
970
|
options,
|
|
963
|
-
onChange: (
|
|
971
|
+
onChange: (v2) => {
|
|
964
972
|
if (enumType === "integer") {
|
|
965
|
-
handleChange(key, Number.parseInt(
|
|
973
|
+
handleChange(key, Number.parseInt(v2, 10));
|
|
966
974
|
} else if (enumType === "number") {
|
|
967
|
-
handleChange(key, Number.parseFloat(
|
|
975
|
+
handleChange(key, Number.parseFloat(v2));
|
|
968
976
|
} else {
|
|
969
|
-
handleChange(key,
|
|
977
|
+
handleChange(key, v2);
|
|
970
978
|
}
|
|
971
979
|
}
|
|
972
980
|
},
|
|
@@ -982,7 +990,7 @@ function SchemaInputsComponent({
|
|
|
982
990
|
property,
|
|
983
991
|
value,
|
|
984
992
|
options: property.enum,
|
|
985
|
-
onChange: (
|
|
993
|
+
onChange: (v2) => handleChange(key, v2)
|
|
986
994
|
},
|
|
987
995
|
key
|
|
988
996
|
);
|
|
@@ -994,7 +1002,7 @@ function SchemaInputsComponent({
|
|
|
994
1002
|
propertyKey: key,
|
|
995
1003
|
property,
|
|
996
1004
|
value,
|
|
997
|
-
onChange: (
|
|
1005
|
+
onChange: (v2) => handleChange(key, v2)
|
|
998
1006
|
},
|
|
999
1007
|
key
|
|
1000
1008
|
);
|
|
@@ -1006,7 +1014,7 @@ function SchemaInputsComponent({
|
|
|
1006
1014
|
propertyKey: key,
|
|
1007
1015
|
property,
|
|
1008
1016
|
value,
|
|
1009
|
-
onChange: (
|
|
1017
|
+
onChange: (v2) => handleChange(key, v2)
|
|
1010
1018
|
},
|
|
1011
1019
|
key
|
|
1012
1020
|
);
|
|
@@ -1018,7 +1026,7 @@ function SchemaInputsComponent({
|
|
|
1018
1026
|
propertyKey: key,
|
|
1019
1027
|
property,
|
|
1020
1028
|
value,
|
|
1021
|
-
onChange: (
|
|
1029
|
+
onChange: (v2) => handleChange(key, v2)
|
|
1022
1030
|
},
|
|
1023
1031
|
key
|
|
1024
1032
|
);
|
|
@@ -1059,7 +1067,7 @@ function ImageGenNodeComponent(props) {
|
|
|
1059
1067
|
);
|
|
1060
1068
|
const handleDownloadAll = useCallback(() => {
|
|
1061
1069
|
const images = nodeData.outputImages ?? [];
|
|
1062
|
-
images.forEach((
|
|
1070
|
+
images.forEach((_2, index) => {
|
|
1063
1071
|
setTimeout(() => handleDownload(index), index * 100);
|
|
1064
1072
|
});
|
|
1065
1073
|
}, [nodeData.outputImages, handleDownload]);
|
|
@@ -1091,7 +1099,7 @@ function ImageGenNodeComponent(props) {
|
|
|
1091
1099
|
openNodeDetailModal(id, "preview", selectedPreview ?? 0);
|
|
1092
1100
|
}, [id, openNodeDetailModal, selectedPreview]);
|
|
1093
1101
|
const modelDisplayName = useMemo(
|
|
1094
|
-
() => nodeData.selectedModel?.displayName || IMAGE_MODELS.find((
|
|
1102
|
+
() => nodeData.selectedModel?.displayName || IMAGE_MODELS.find((m2) => m2.value === nodeData.model)?.label || nodeData.model,
|
|
1095
1103
|
[nodeData.selectedModel?.displayName, nodeData.model]
|
|
1096
1104
|
);
|
|
1097
1105
|
const isProcessing = nodeData.status === "processing";
|
|
@@ -1152,17 +1160,17 @@ function ImageGenNodeComponent(props) {
|
|
|
1152
1160
|
}
|
|
1153
1161
|
)
|
|
1154
1162
|
] }),
|
|
1155
|
-
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 gap-1", children: nodeData.outputImages.map((img,
|
|
1163
|
+
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 gap-1", children: nodeData.outputImages.map((img, i3) => /* @__PURE__ */ jsxs(
|
|
1156
1164
|
"div",
|
|
1157
1165
|
{
|
|
1158
1166
|
className: "relative group aspect-square rounded overflow-hidden border border-border cursor-pointer",
|
|
1159
|
-
onClick: () => setSelectedPreview(selectedPreview ===
|
|
1167
|
+
onClick: () => setSelectedPreview(selectedPreview === i3 ? null : i3),
|
|
1160
1168
|
children: [
|
|
1161
1169
|
/* @__PURE__ */ jsx(
|
|
1162
1170
|
Image4,
|
|
1163
1171
|
{
|
|
1164
1172
|
src: img,
|
|
1165
|
-
alt: `Generated ${
|
|
1173
|
+
alt: `Generated ${i3 + 1}`,
|
|
1166
1174
|
fill: true,
|
|
1167
1175
|
sizes: "150px",
|
|
1168
1176
|
className: "object-cover",
|
|
@@ -1175,17 +1183,17 @@ function ImageGenNodeComponent(props) {
|
|
|
1175
1183
|
variant: "ghost",
|
|
1176
1184
|
size: "icon-sm",
|
|
1177
1185
|
className: "h-6 w-6 bg-white/20 hover:bg-white/30",
|
|
1178
|
-
onClick: (
|
|
1179
|
-
|
|
1180
|
-
handleDownload(
|
|
1186
|
+
onClick: (e3) => {
|
|
1187
|
+
e3.stopPropagation();
|
|
1188
|
+
handleDownload(i3);
|
|
1181
1189
|
},
|
|
1182
1190
|
children: /* @__PURE__ */ jsx(Download, { className: "w-3 h-3 text-white" })
|
|
1183
1191
|
}
|
|
1184
1192
|
) }),
|
|
1185
|
-
/* @__PURE__ */ jsx("div", { className: "absolute bottom-0 left-0 right-0 bg-black/50 text-white text-[8px] text-center py-0.5", children:
|
|
1193
|
+
/* @__PURE__ */ jsx("div", { className: "absolute bottom-0 left-0 right-0 bg-black/50 text-white text-[8px] text-center py-0.5", children: i3 + 1 })
|
|
1186
1194
|
]
|
|
1187
1195
|
},
|
|
1188
|
-
|
|
1196
|
+
i3
|
|
1189
1197
|
)) }),
|
|
1190
1198
|
selectedPreview !== null && nodeData.outputImages[selectedPreview] && /* @__PURE__ */ jsxs("div", { className: "relative aspect-[4/3] rounded overflow-hidden", children: [
|
|
1191
1199
|
/* @__PURE__ */ jsx(
|
|
@@ -1287,7 +1295,7 @@ function LipSyncNodeComponent(props) {
|
|
|
1287
1295
|
const handleExpand = useCallback(() => {
|
|
1288
1296
|
openNodeDetailModal(id, "preview");
|
|
1289
1297
|
}, [id, openNodeDetailModal]);
|
|
1290
|
-
const currentModel = LIPSYNC_MODELS.find((
|
|
1298
|
+
const currentModel = LIPSYNC_MODELS.find((m2) => m2.value === nodeData.model);
|
|
1291
1299
|
const isSyncModel = nodeData.model.startsWith("sync/");
|
|
1292
1300
|
const supportsImage = currentModel?.supportsImage ?? false;
|
|
1293
1301
|
const headerActions = useMemo(
|
|
@@ -1429,8 +1437,8 @@ function LLMNodeComponent(props) {
|
|
|
1429
1437
|
selectedModel: nodeData.selectedModel
|
|
1430
1438
|
});
|
|
1431
1439
|
const handleSystemPromptChange = useCallback(
|
|
1432
|
-
(
|
|
1433
|
-
updateNodeData(id, { systemPrompt:
|
|
1440
|
+
(e3) => {
|
|
1441
|
+
updateNodeData(id, { systemPrompt: e3.target.value });
|
|
1434
1442
|
},
|
|
1435
1443
|
[id, updateNodeData]
|
|
1436
1444
|
);
|
|
@@ -1441,9 +1449,9 @@ function LLMNodeComponent(props) {
|
|
|
1441
1449
|
[id, updateNodeData]
|
|
1442
1450
|
);
|
|
1443
1451
|
const handleMaxTokensChange = useCallback(
|
|
1444
|
-
(
|
|
1452
|
+
(e3) => {
|
|
1445
1453
|
updateNodeData(id, {
|
|
1446
|
-
maxTokens: parseInt(
|
|
1454
|
+
maxTokens: parseInt(e3.target.value, 10)
|
|
1447
1455
|
});
|
|
1448
1456
|
},
|
|
1449
1457
|
[id, updateNodeData]
|
|
@@ -1452,7 +1460,7 @@ function LLMNodeComponent(props) {
|
|
|
1452
1460
|
openNodeDetailModal(id, "preview");
|
|
1453
1461
|
}, [id, openNodeDetailModal]);
|
|
1454
1462
|
const modelDisplayName = useMemo(
|
|
1455
|
-
() => nodeData.selectedModel?.displayName || LLM_MODELS.find((
|
|
1463
|
+
() => nodeData.selectedModel?.displayName || LLM_MODELS.find((m2) => m2.value === nodeData.model)?.label || nodeData.model || "Llama 3.1 405B",
|
|
1456
1464
|
[nodeData.selectedModel?.displayName, nodeData.model]
|
|
1457
1465
|
);
|
|
1458
1466
|
const isProcessing = nodeData.status === "processing";
|
|
@@ -1800,7 +1808,7 @@ function MotionControlNodeComponent(props) {
|
|
|
1800
1808
|
onValueChange: handleDurationChange,
|
|
1801
1809
|
children: [
|
|
1802
1810
|
/* @__PURE__ */ jsx(SelectTrigger, { className: "nodrag h-8 w-full", children: /* @__PURE__ */ jsx(SelectValue, {}) }),
|
|
1803
|
-
/* @__PURE__ */ jsx(SelectContent, { children: DURATIONS.map((
|
|
1811
|
+
/* @__PURE__ */ jsx(SelectContent, { children: DURATIONS.map((d3) => /* @__PURE__ */ jsx(SelectItem, { value: String(d3.value), children: d3.label }, d3.value)) })
|
|
1804
1812
|
]
|
|
1805
1813
|
}
|
|
1806
1814
|
)
|
|
@@ -2256,7 +2264,7 @@ function VideoGenNodeComponent(props) {
|
|
|
2256
2264
|
openNodeDetailModal(id, "preview");
|
|
2257
2265
|
}, [id, openNodeDetailModal]);
|
|
2258
2266
|
const modelDisplayName = useMemo(
|
|
2259
|
-
() => nodeData.selectedModel?.displayName || VIDEO_MODELS.find((
|
|
2267
|
+
() => nodeData.selectedModel?.displayName || VIDEO_MODELS.find((m2) => m2.value === nodeData.model)?.label || nodeData.model,
|
|
2260
2268
|
[nodeData.selectedModel?.displayName, nodeData.model]
|
|
2261
2269
|
);
|
|
2262
2270
|
const isProcessing = nodeData.status === "processing";
|
|
@@ -2475,10 +2483,10 @@ function WorkflowInputNodeComponent(props) {
|
|
|
2475
2483
|
const nodeData = data;
|
|
2476
2484
|
const updateNodeData = useWorkflowStore((state) => state.updateNodeData);
|
|
2477
2485
|
const handleNameChange = useCallback(
|
|
2478
|
-
(
|
|
2486
|
+
(e3) => {
|
|
2479
2487
|
updateNodeData(id, {
|
|
2480
|
-
inputName:
|
|
2481
|
-
label: `Input: ${
|
|
2488
|
+
inputName: e3.target.value,
|
|
2489
|
+
label: `Input: ${e3.target.value}`
|
|
2482
2490
|
});
|
|
2483
2491
|
},
|
|
2484
2492
|
[id, updateNodeData]
|
|
@@ -2502,9 +2510,9 @@ function WorkflowInputNodeComponent(props) {
|
|
|
2502
2510
|
[id, updateNodeData]
|
|
2503
2511
|
);
|
|
2504
2512
|
const handleDescriptionChange = useCallback(
|
|
2505
|
-
(
|
|
2513
|
+
(e3) => {
|
|
2506
2514
|
updateNodeData(id, {
|
|
2507
|
-
description:
|
|
2515
|
+
description: e3.target.value
|
|
2508
2516
|
});
|
|
2509
2517
|
},
|
|
2510
2518
|
[id, updateNodeData]
|
|
@@ -2584,10 +2592,10 @@ function WorkflowOutputNodeComponent(props) {
|
|
|
2584
2592
|
const videoRef = useRef(null);
|
|
2585
2593
|
const [isPlaying, setIsPlaying] = useState(false);
|
|
2586
2594
|
const handleNameChange = useCallback(
|
|
2587
|
-
(
|
|
2595
|
+
(e3) => {
|
|
2588
2596
|
updateNodeData(id, {
|
|
2589
|
-
label: `Output: ${
|
|
2590
|
-
outputName:
|
|
2597
|
+
label: `Output: ${e3.target.value}`,
|
|
2598
|
+
outputName: e3.target.value
|
|
2591
2599
|
});
|
|
2592
2600
|
},
|
|
2593
2601
|
[id, updateNodeData]
|
|
@@ -2601,9 +2609,9 @@ function WorkflowOutputNodeComponent(props) {
|
|
|
2601
2609
|
[id, updateNodeData]
|
|
2602
2610
|
);
|
|
2603
2611
|
const handleDescriptionChange = useCallback(
|
|
2604
|
-
(
|
|
2612
|
+
(e3) => {
|
|
2605
2613
|
updateNodeData(id, {
|
|
2606
|
-
description:
|
|
2614
|
+
description: e3.target.value
|
|
2607
2615
|
});
|
|
2608
2616
|
},
|
|
2609
2617
|
[id, updateNodeData]
|
|
@@ -2941,7 +2949,7 @@ function WorkflowRefNodeComponent(props) {
|
|
|
2941
2949
|
] }),
|
|
2942
2950
|
nodeData.cachedInterface.inputs.length > 0 && /* @__PURE__ */ jsxs("div", { className: "text-[10px]", children: [
|
|
2943
2951
|
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Inputs: " }),
|
|
2944
|
-
nodeData.cachedInterface.inputs.map((input,
|
|
2952
|
+
nodeData.cachedInterface.inputs.map((input, i3) => /* @__PURE__ */ jsxs("span", { children: [
|
|
2945
2953
|
/* @__PURE__ */ jsxs("span", { className: "text-foreground", children: [
|
|
2946
2954
|
input.name,
|
|
2947
2955
|
/* @__PURE__ */ jsxs("span", { className: "text-muted-foreground", children: [
|
|
@@ -2950,12 +2958,12 @@ function WorkflowRefNodeComponent(props) {
|
|
|
2950
2958
|
] }),
|
|
2951
2959
|
input.required && /* @__PURE__ */ jsx("span", { className: "text-destructive", children: "*" })
|
|
2952
2960
|
] }),
|
|
2953
|
-
|
|
2961
|
+
i3 < nodeData.cachedInterface.inputs.length - 1 && ", "
|
|
2954
2962
|
] }, input.nodeId))
|
|
2955
2963
|
] }),
|
|
2956
2964
|
nodeData.cachedInterface.outputs.length > 0 && /* @__PURE__ */ jsxs("div", { className: "text-[10px]", children: [
|
|
2957
2965
|
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Outputs: " }),
|
|
2958
|
-
nodeData.cachedInterface.outputs.map((output,
|
|
2966
|
+
nodeData.cachedInterface.outputs.map((output, i3) => /* @__PURE__ */ jsxs("span", { children: [
|
|
2959
2967
|
/* @__PURE__ */ jsxs("span", { className: "text-foreground", children: [
|
|
2960
2968
|
output.name,
|
|
2961
2969
|
/* @__PURE__ */ jsxs("span", { className: "text-muted-foreground", children: [
|
|
@@ -2963,7 +2971,7 @@ function WorkflowRefNodeComponent(props) {
|
|
|
2963
2971
|
output.type
|
|
2964
2972
|
] })
|
|
2965
2973
|
] }),
|
|
2966
|
-
|
|
2974
|
+
i3 < nodeData.cachedInterface.outputs.length - 1 && ", "
|
|
2967
2975
|
] }, output.nodeId))
|
|
2968
2976
|
] })
|
|
2969
2977
|
] }),
|
|
@@ -3004,8 +3012,8 @@ function AudioInputNodeComponent(props) {
|
|
|
3004
3012
|
const [showUrlInput, setShowUrlInput] = useState(false);
|
|
3005
3013
|
const [urlValue, setUrlValue] = useState(nodeData.url || "");
|
|
3006
3014
|
const handleFileSelect = useCallback(
|
|
3007
|
-
(
|
|
3008
|
-
const file =
|
|
3015
|
+
(e3) => {
|
|
3016
|
+
const file = e3.target.files?.[0];
|
|
3009
3017
|
if (!file) return;
|
|
3010
3018
|
const reader = new FileReader();
|
|
3011
3019
|
reader.onload = (event) => {
|
|
@@ -3060,10 +3068,10 @@ function AudioInputNodeComponent(props) {
|
|
|
3060
3068
|
audio.src = urlValue;
|
|
3061
3069
|
}, [id, updateNodeData, urlValue]);
|
|
3062
3070
|
const handleUrlKeyDown = useCallback(
|
|
3063
|
-
(
|
|
3064
|
-
if (
|
|
3071
|
+
(e3) => {
|
|
3072
|
+
if (e3.key === "Enter") {
|
|
3065
3073
|
handleUrlSubmit();
|
|
3066
|
-
} else if (
|
|
3074
|
+
} else if (e3.key === "Escape") {
|
|
3067
3075
|
setShowUrlInput(false);
|
|
3068
3076
|
setUrlValue(nodeData.url || "");
|
|
3069
3077
|
}
|
|
@@ -3131,7 +3139,7 @@ function AudioInputNodeComponent(props) {
|
|
|
3131
3139
|
{
|
|
3132
3140
|
type: "url",
|
|
3133
3141
|
value: urlValue,
|
|
3134
|
-
onChange: (
|
|
3142
|
+
onChange: (e3) => setUrlValue(e3.target.value),
|
|
3135
3143
|
onKeyDown: handleUrlKeyDown,
|
|
3136
3144
|
placeholder: "https://...",
|
|
3137
3145
|
className: "nodrag nopan flex-1 h-7 px-2 text-xs rounded-md border border-border bg-background focus:outline-none focus:ring-1 focus:ring-primary"
|
|
@@ -3279,7 +3287,7 @@ function ImageInputNodeComponent(props) {
|
|
|
3279
3287
|
{
|
|
3280
3288
|
type: "url",
|
|
3281
3289
|
value: urlValue,
|
|
3282
|
-
onChange: (
|
|
3290
|
+
onChange: (e3) => setUrlValue(e3.target.value),
|
|
3283
3291
|
onKeyDown: handleUrlKeyDown,
|
|
3284
3292
|
placeholder: "https://...",
|
|
3285
3293
|
className: "nodrag nopan flex-1 h-7 px-2 text-xs rounded-md border border-border bg-background focus:outline-none focus:ring-1 focus:ring-primary"
|
|
@@ -3357,8 +3365,8 @@ function PromptConstructorNodeComponent(props) {
|
|
|
3357
3365
|
}
|
|
3358
3366
|
}, [nodeData.template, isEditing]);
|
|
3359
3367
|
const availableVariables = useMemo(() => {
|
|
3360
|
-
const connectedPromptNodes = edges.filter((
|
|
3361
|
-
(
|
|
3368
|
+
const connectedPromptNodes = edges.filter((e3) => e3.target === id && e3.targetHandle === "text").map((e3) => nodes.find((n2) => n2.id === e3.source)).filter(
|
|
3369
|
+
(n2) => n2 !== void 0 && n2.type === "prompt"
|
|
3362
3370
|
);
|
|
3363
3371
|
const vars = [];
|
|
3364
3372
|
connectedPromptNodes.forEach((promptNode) => {
|
|
@@ -3394,7 +3402,7 @@ function PromptConstructorNodeComponent(props) {
|
|
|
3394
3402
|
const varPattern = /@(\w+)/g;
|
|
3395
3403
|
const unresolved = [];
|
|
3396
3404
|
const matches = localTemplate.matchAll(varPattern);
|
|
3397
|
-
const availableNames = new Set(availableVariables.map((
|
|
3405
|
+
const availableNames = new Set(availableVariables.map((v2) => v2.name));
|
|
3398
3406
|
for (const match of matches) {
|
|
3399
3407
|
const varName = match[1];
|
|
3400
3408
|
if (!availableNames.has(varName) && !unresolved.includes(varName)) {
|
|
@@ -3405,15 +3413,15 @@ function PromptConstructorNodeComponent(props) {
|
|
|
3405
3413
|
}, [localTemplate, availableVariables]);
|
|
3406
3414
|
const resolvedPreview = useMemo(() => {
|
|
3407
3415
|
let resolved = localTemplate;
|
|
3408
|
-
availableVariables.forEach((
|
|
3409
|
-
resolved = resolved.replace(new RegExp(`@${
|
|
3416
|
+
availableVariables.forEach((v2) => {
|
|
3417
|
+
resolved = resolved.replace(new RegExp(`@${v2.name}`, "g"), v2.value);
|
|
3410
3418
|
});
|
|
3411
3419
|
return resolved;
|
|
3412
3420
|
}, [localTemplate, availableVariables]);
|
|
3413
3421
|
useEffect(() => {
|
|
3414
3422
|
let resolved = nodeData.template;
|
|
3415
|
-
availableVariables.forEach((
|
|
3416
|
-
resolved = resolved.replace(new RegExp(`@${
|
|
3423
|
+
availableVariables.forEach((v2) => {
|
|
3424
|
+
resolved = resolved.replace(new RegExp(`@${v2.name}`, "g"), v2.value);
|
|
3417
3425
|
});
|
|
3418
3426
|
const outputValue = resolved || null;
|
|
3419
3427
|
if (outputValue !== nodeData.outputText) {
|
|
@@ -3445,7 +3453,7 @@ function PromptConstructorNodeComponent(props) {
|
|
|
3445
3453
|
unresolvedVars.length > 0 && /* @__PURE__ */ jsxs("div", { className: "px-2 py-1 bg-amber-900/30 border border-amber-700/50 rounded text-[10px] text-amber-400", children: [
|
|
3446
3454
|
/* @__PURE__ */ jsx("span", { className: "font-semibold", children: "Unresolved:" }),
|
|
3447
3455
|
" ",
|
|
3448
|
-
unresolvedVars.map((
|
|
3456
|
+
unresolvedVars.map((v2) => `@${v2}`).join(", ")
|
|
3449
3457
|
] }),
|
|
3450
3458
|
/* @__PURE__ */ jsxs("div", { className: "relative flex-1 flex flex-col", children: [
|
|
3451
3459
|
/* @__PURE__ */ jsx(
|
|
@@ -3473,8 +3481,8 @@ function PromptConstructorNodeComponent(props) {
|
|
|
3473
3481
|
children: filteredAutocompleteVars.map((variable, index) => /* @__PURE__ */ jsxs(
|
|
3474
3482
|
"button",
|
|
3475
3483
|
{
|
|
3476
|
-
onMouseDown: (
|
|
3477
|
-
|
|
3484
|
+
onMouseDown: (e3) => {
|
|
3485
|
+
e3.preventDefault();
|
|
3478
3486
|
handleAutocompleteSelect(variable.name);
|
|
3479
3487
|
},
|
|
3480
3488
|
className: `w-full px-3 py-2 text-left text-[11px] flex flex-col gap-0.5 transition-colors ${index === selectedAutocompleteIndex ? "bg-accent text-accent-foreground" : "text-muted-foreground hover:bg-accent"}`,
|
|
@@ -3493,7 +3501,7 @@ function PromptConstructorNodeComponent(props) {
|
|
|
3493
3501
|
] }),
|
|
3494
3502
|
availableVariables.length > 0 && /* @__PURE__ */ jsxs("div", { className: "text-[10px] text-muted-foreground px-2", children: [
|
|
3495
3503
|
"Available: ",
|
|
3496
|
-
availableVariables.map((
|
|
3504
|
+
availableVariables.map((v2) => `@${v2.name}`).join(", ")
|
|
3497
3505
|
] })
|
|
3498
3506
|
] }) });
|
|
3499
3507
|
}
|
|
@@ -3506,8 +3514,8 @@ function PromptNodeComponent(props) {
|
|
|
3506
3514
|
const { openCreateModal } = usePromptLibraryStore();
|
|
3507
3515
|
const { openEditor } = usePromptEditorStore();
|
|
3508
3516
|
const handlePromptChange = useCallback(
|
|
3509
|
-
(
|
|
3510
|
-
updateNodeData(id, { prompt:
|
|
3517
|
+
(e3) => {
|
|
3518
|
+
updateNodeData(id, { prompt: e3.target.value });
|
|
3511
3519
|
},
|
|
3512
3520
|
[id, updateNodeData]
|
|
3513
3521
|
);
|
|
@@ -3704,7 +3712,7 @@ function VideoInputNodeComponent(props) {
|
|
|
3704
3712
|
{
|
|
3705
3713
|
type: "url",
|
|
3706
3714
|
value: urlValue,
|
|
3707
|
-
onChange: (
|
|
3715
|
+
onChange: (e3) => setUrlValue(e3.target.value),
|
|
3708
3716
|
onKeyDown: handleUrlKeyDown,
|
|
3709
3717
|
placeholder: "https://...",
|
|
3710
3718
|
className: "nodrag nopan flex-1 h-7 px-2 text-xs rounded-md border border-border bg-background focus:outline-none focus:ring-1 focus:ring-primary"
|
|
@@ -3820,25 +3828,25 @@ function NodeDetailModal() {
|
|
|
3820
3828
|
setCurrentIndex(nodeDetailStartIndex);
|
|
3821
3829
|
}, [nodeDetailNodeId, nodeDetailStartIndex]);
|
|
3822
3830
|
useEffect(() => {
|
|
3823
|
-
const handleKeyDown = (
|
|
3831
|
+
const handleKeyDown = (e3) => {
|
|
3824
3832
|
if (activeModal !== "nodeDetail") return;
|
|
3825
|
-
if (
|
|
3833
|
+
if (e3.key === "Escape") {
|
|
3826
3834
|
closeNodeDetailModal();
|
|
3827
3835
|
}
|
|
3828
|
-
if (
|
|
3836
|
+
if (e3.key === "+" || e3.key === "=") {
|
|
3829
3837
|
setZoomLevel((prev) => Math.min(prev + 0.25, 4));
|
|
3830
3838
|
}
|
|
3831
|
-
if (
|
|
3839
|
+
if (e3.key === "-") {
|
|
3832
3840
|
setZoomLevel((prev) => Math.max(prev - 0.25, 0.25));
|
|
3833
3841
|
}
|
|
3834
|
-
if (
|
|
3842
|
+
if (e3.key === "0") {
|
|
3835
3843
|
setZoomLevel(1);
|
|
3836
3844
|
setPanOffset({ x: 0, y: 0 });
|
|
3837
3845
|
}
|
|
3838
|
-
if (
|
|
3846
|
+
if (e3.key === "ArrowLeft") {
|
|
3839
3847
|
goToPrevious();
|
|
3840
3848
|
}
|
|
3841
|
-
if (
|
|
3849
|
+
if (e3.key === "ArrowRight") {
|
|
3842
3850
|
goToNext();
|
|
3843
3851
|
}
|
|
3844
3852
|
};
|
|
@@ -3846,20 +3854,20 @@ function NodeDetailModal() {
|
|
|
3846
3854
|
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
3847
3855
|
}, [activeModal, closeNodeDetailModal, goToPrevious, goToNext]);
|
|
3848
3856
|
const handleMouseDown = useCallback(
|
|
3849
|
-
(
|
|
3857
|
+
(e3) => {
|
|
3850
3858
|
if (zoomLevel > 1) {
|
|
3851
3859
|
setIsPanning(true);
|
|
3852
|
-
setPanStart({ x:
|
|
3860
|
+
setPanStart({ x: e3.clientX - panOffset.x, y: e3.clientY - panOffset.y });
|
|
3853
3861
|
}
|
|
3854
3862
|
},
|
|
3855
3863
|
[zoomLevel, panOffset]
|
|
3856
3864
|
);
|
|
3857
3865
|
const handleMouseMove = useCallback(
|
|
3858
|
-
(
|
|
3866
|
+
(e3) => {
|
|
3859
3867
|
if (isPanning) {
|
|
3860
3868
|
setPanOffset({
|
|
3861
|
-
x:
|
|
3862
|
-
y:
|
|
3869
|
+
x: e3.clientX - panStart.x,
|
|
3870
|
+
y: e3.clientY - panStart.y
|
|
3863
3871
|
});
|
|
3864
3872
|
}
|
|
3865
3873
|
},
|
|
@@ -4064,8 +4072,8 @@ function DownloadNodeComponent(props) {
|
|
|
4064
4072
|
const activeType = nodeData.inputVideo ? "video" : nodeData.inputImage ? "image" : null;
|
|
4065
4073
|
const fileExtension = activeMedia ? getExtensionFromUrl(activeMedia, activeType || "image") : "png";
|
|
4066
4074
|
const handleFilenameChange = useCallback(
|
|
4067
|
-
(
|
|
4068
|
-
updateNodeData(id, { outputName:
|
|
4075
|
+
(e3) => {
|
|
4076
|
+
updateNodeData(id, { outputName: e3.target.value });
|
|
4069
4077
|
},
|
|
4070
4078
|
[id, updateNodeData]
|
|
4071
4079
|
);
|
|
@@ -4262,7 +4270,7 @@ function AnimationNodeComponent(props) {
|
|
|
4262
4270
|
CubicBezierEditor,
|
|
4263
4271
|
{
|
|
4264
4272
|
value: curve,
|
|
4265
|
-
onChange: (
|
|
4273
|
+
onChange: (v2) => updateNodeData(id, { customCurve: v2 }),
|
|
4266
4274
|
disabled: nodeData.status === "processing"
|
|
4267
4275
|
}
|
|
4268
4276
|
),
|
|
@@ -4445,105 +4453,111 @@ function AnnotationNodeComponent(props) {
|
|
|
4445
4453
|
] }) });
|
|
4446
4454
|
}
|
|
4447
4455
|
var AnnotationNode = memo(AnnotationNodeComponent);
|
|
4448
|
-
|
|
4449
|
-
|
|
4450
|
-
|
|
4451
|
-
}
|
|
4452
|
-
|
|
4453
|
-
var
|
|
4454
|
-
|
|
4455
|
-
return
|
|
4456
|
-
});
|
|
4457
|
-
|
|
4458
|
-
|
|
4459
|
-
var F = ({ className: e = "__rcs-handle-root", disabled: t, buttonStyle: r, linesStyle: o, portrait: i, style: m, ...C }) => {
|
|
4460
|
-
let u = { display: "flex", flexDirection: i ? "row" : "column", placeItems: "center", height: "100%", cursor: t ? "not-allowed" : i ? "ns-resize" : "ew-resize", pointerEvents: "none", color: "#fff", ...m }, E = { flexGrow: 1, height: i ? 2 : "100%", width: i ? "100%" : 2, backgroundColor: "currentColor", pointerEvents: "auto", boxShadow: "0 0 4px rgba(0,0,0,.5)", ...o }, y = { display: "grid", gridAutoFlow: "column", gap: 8, placeContent: "center", flexShrink: 0, width: 56, height: 56, borderRadius: "50%", borderStyle: "solid", borderWidth: 2, pointerEvents: "auto", backdropFilter: "blur(7px)", WebkitBackdropFilter: "blur(7px)", backgroundColor: "rgba(0, 0, 0, 0.125)", boxShadow: "0 0 4px rgba(0,0,0,.35)", transform: i ? "rotate(90deg)" : void 0, ...r };
|
|
4461
|
-
return jsxs("div", { ...C, className: e, style: u, children: [jsx("div", { className: "__rcs-handle-line", style: E }), jsxs("div", { className: "__rcs-handle-button", style: y, children: [jsx(re, {}), jsx(re, { flip: true })] }), jsx("div", { className: "__rcs-handle-line", style: E })] });
|
|
4462
|
-
};
|
|
4463
|
-
var $ = ((i) => (i.ARROW_LEFT = "ArrowLeft", i.ARROW_RIGHT = "ArrowRight", i.ARROW_UP = "ArrowUp", i.ARROW_DOWN = "ArrowDown", i))($ || {});
|
|
4464
|
-
var G = ({ boxSizing: e = "border-box", objectFit: t = "cover", objectPosition: r = "center center", ...o } = {}) => ({ display: "block", width: "100%", height: "100%", maxWidth: "100%", boxSizing: e, objectFit: t, objectPosition: r, ...o });
|
|
4465
|
-
var oe = (e) => {
|
|
4466
|
-
let t = useRef(e);
|
|
4467
|
-
return useEffect(() => {
|
|
4468
|
-
t.current = e;
|
|
4469
|
-
}), t.current;
|
|
4470
|
-
};
|
|
4471
|
-
var U = (e, t, r, o) => {
|
|
4472
|
-
let i = useRef();
|
|
4456
|
+
|
|
4457
|
+
// ../node_modules/.bun/react-compare-slider@4.0.0+bf16f8eded5e12ee/node_modules/react-compare-slider/dist/consts.mjs
|
|
4458
|
+
var e = { all: `all`, itemOne: `itemOne`, itemTwo: `itemTwo` };
|
|
4459
|
+
var t = { rawPosition: `--rcs-raw-position`, currentPosition: `--rcs-current-position`, boundsPadding: `--rcs-bounds-padding`, handleColor: `--rcs-handle-color` };
|
|
4460
|
+
var n = { capture: false, passive: true };
|
|
4461
|
+
var r = { capture: true, passive: false };
|
|
4462
|
+
var i = (function(e3) {
|
|
4463
|
+
return e3.ARROW_LEFT = `ArrowLeft`, e3.ARROW_RIGHT = `ArrowRight`, e3.ARROW_UP = `ArrowUp`, e3.ARROW_DOWN = `ArrowDown`, e3;
|
|
4464
|
+
})({});
|
|
4465
|
+
var a = (n2, r3, i3, a4) => {
|
|
4466
|
+
let o3 = useRef(void 0);
|
|
4473
4467
|
useEffect(() => {
|
|
4474
|
-
|
|
4475
|
-
}, [
|
|
4476
|
-
if (!
|
|
4477
|
-
let
|
|
4478
|
-
return
|
|
4479
|
-
|
|
4468
|
+
o3.current = r3;
|
|
4469
|
+
}, [r3]), useEffect(() => {
|
|
4470
|
+
if (!i3?.addEventListener) return;
|
|
4471
|
+
let e3 = (e4) => o3.current?.(e4);
|
|
4472
|
+
return i3.addEventListener(n2, e3, a4), () => {
|
|
4473
|
+
i3.removeEventListener(n2, e3, a4);
|
|
4480
4474
|
};
|
|
4481
|
-
}, [
|
|
4475
|
+
}, [n2, i3, a4]);
|
|
4482
4476
|
};
|
|
4483
|
-
var
|
|
4484
|
-
var
|
|
4485
|
-
|
|
4486
|
-
|
|
4487
|
-
|
|
4488
|
-
|
|
4489
|
-
r.current && r.current.disconnect();
|
|
4490
|
-
}), [t, o]);
|
|
4477
|
+
var u = createContext(null);
|
|
4478
|
+
var d = ({ children: e3, ...t3 }) => jsx(u.Provider, { value: t3, children: e3 });
|
|
4479
|
+
var f = () => {
|
|
4480
|
+
let e3 = useContext(u);
|
|
4481
|
+
if (!e3) throw Error(`useReactCompareSliderContext must be used within the Provider component`);
|
|
4482
|
+
return e3;
|
|
4491
4483
|
};
|
|
4492
|
-
var
|
|
4493
|
-
|
|
4494
|
-
|
|
4495
|
-
e.preventDefault(), e.currentTarget.focus();
|
|
4484
|
+
var p = ({ flip: e3 }) => {
|
|
4485
|
+
let n2 = { width: `0.85rem`, height: `0.85rem`, clipPath: `polygon(100% 0%, 100% 100%, 30% 50%)`, rotate: e3 ? `180deg` : `0deg`, outline: `0.5rem solid var(${t.handleColor})`, outlineOffset: `-0.5rem` };
|
|
4486
|
+
return jsx(`div`, { "aria-hidden": `true`, className: `__rcs-handle-arrow`, style: n2 });
|
|
4496
4487
|
};
|
|
4497
|
-
var
|
|
4498
|
-
let
|
|
4499
|
-
|
|
4500
|
-
|
|
4501
|
-
|
|
4502
|
-
|
|
4503
|
-
|
|
4504
|
-
|
|
4505
|
-
|
|
4506
|
-
|
|
4507
|
-
},
|
|
4508
|
-
|
|
4509
|
-
|
|
4510
|
-
|
|
4511
|
-
|
|
4512
|
-
|
|
4513
|
-
|
|
4514
|
-
|
|
4515
|
-
|
|
4516
|
-
|
|
4517
|
-
|
|
4518
|
-
|
|
4519
|
-
|
|
4520
|
-
|
|
4521
|
-
|
|
4522
|
-
|
|
4523
|
-
|
|
4524
|
-
fe(E ? f.current : p.current);
|
|
4525
|
-
}, [E]), useEffect(() => {
|
|
4526
|
-
let n = p.current, s = () => {
|
|
4527
|
-
L || T();
|
|
4488
|
+
var m = ({ className: e3 = `__rcs-handle-root`, buttonStyle: n2, linesStyle: r3, style: i3, ...a4 }) => {
|
|
4489
|
+
let { disabled: o3, portrait: s3 } = f(), u3 = { boxSizing: `border-box`, position: `relative`, display: `inline-flex`, flexDirection: s3 ? `row` : `column`, placeItems: `center`, width: s3 ? `100%` : void 0, height: s3 ? void 0 : `100%`, cursor: o3 ? `not-allowed` : s3 ? `ns-resize` : `ew-resize`, pointerEvents: `none`, [t.handleColor]: `rgba(255, 255, 255, 1)`, ...i3 }, d3 = { flexGrow: 1, height: s3 ? 2 : `100%`, width: s3 ? `100%` : 2, outline: `1px solid var(${t.handleColor})`, outlineOffset: -1, pointerEvents: `auto`, boxShadow: `0 0 4px rgba(0,0,0,.5)`, ...r3 }, m2 = { direction: `ltr`, display: `grid`, gridAutoFlow: `column`, gap: `0.5rem`, placeContent: `center`, flexShrink: 0, width: `3.5rem`, height: `3.5rem`, borderRadius: `50%`, border: `2px solid var(${t.handleColor})`, color: `inherit`, pointerEvents: `auto`, backdropFilter: `blur(0.5rem)`, WebkitBackdropFilter: `blur(0.5rem)`, backgroundColor: `rgba(0, 0, 0, 0.125)`, boxShadow: `0 0 4px rgba(0,0,0,.35)`, transform: s3 ? `rotate(90deg)` : void 0, ...n2 };
|
|
4490
|
+
return jsxs(`div`, { "data-rcs": `handle`, ...a4, className: e3, style: u3, children: [jsx(`div`, { className: `__rcs-handle-line`, style: d3 }), jsxs(`div`, { className: `__rcs-handle-button`, style: m2, children: [jsx(p, {}), jsx(p, { flip: true })] }), jsx(`div`, { className: `__rcs-handle-line`, style: d3 })] });
|
|
4491
|
+
};
|
|
4492
|
+
var h = ({ display: e3 = `block`, width: t3 = `100%`, height: n2 = `100%`, maxWidth: r3 = `100%`, boxSizing: i3 = `border-box`, objectFit: a4 = `cover`, objectPosition: o3 = `center center`, ...s3 } = {}) => ({ display: e3, width: t3, height: n2, maxWidth: r3, boxSizing: i3, objectFit: a4, objectPosition: o3, ...s3 });
|
|
4493
|
+
var g = ({ alt: e3, style: t3, ...n2 }) => {
|
|
4494
|
+
let r3 = h(t3);
|
|
4495
|
+
return jsx(`img`, { "data-rcs": `image`, ...n2, alt: e3, style: r3 });
|
|
4496
|
+
};
|
|
4497
|
+
var _ = ({ style: e3, ...r3 }) => {
|
|
4498
|
+
let { disabled: a4, portrait: o3, position: s3, handleRootRef: l3, onHandleRootClick: u3, onHandleRootKeyDown: d3 } = f(), p3 = { WebkitAppearance: `none`, MozAppearance: `none`, WebkitTapHighlightColor: `transparent`, boxSizing: `border-box`, position: `absolute`, display: `flex`, flexDirection: o3 ? `row` : `column`, placeItems: `center`, contain: `layout`, top: o3 ? `-50%` : void 0, left: o3 ? void 0 : `-50%`, width: `100%`, height: `100%`, background: `none`, border: 0, padding: 0, pointerEvents: `none`, appearance: `none`, outline: 0, zIndex: 1, translate: o3 ? `0 var(${t.currentPosition}) 0` : `var(${t.currentPosition}) 0 0`, backfaceVisibility: `hidden`, willChange: `translate`, ...e3 };
|
|
4499
|
+
return a(`keydown`, d3, l3.current, r), a(`click`, u3, l3.current, r), jsx(`div`, { ref: l3, tabIndex: 0, "aria-label": `Click and drag or focus and use arrow keys to change the position of the slider`, "aria-orientation": o3 ? `vertical` : `horizontal`, "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": s3.current, "aria-disabled": a4, "data-rcs": `handle-root`, role: `slider`, style: p3, ...r3 });
|
|
4500
|
+
};
|
|
4501
|
+
var v = ({ itemClip: n2, portrait: r3 }) => n2 === e.itemOne ? r3 ? `inset(0px 0px calc(100% - var(${t.currentPosition})) 0px)` : `inset(0px calc(100% - var(${t.currentPosition})) 0px 0px)` : n2 === e.itemTwo ? r3 ? `inset(var(${t.currentPosition}) 0px 0px 0px)` : `inset(0px 0px 0px var(${t.currentPosition}))` : `none`;
|
|
4502
|
+
var y = ({ item: t3, style: n2, ...r3 }) => {
|
|
4503
|
+
let { clip: i3, portrait: a4 } = f(), o3 = { KhtmlUserSelect: `none`, MozUserSelect: `none`, WebkitUserSelect: `none`, backfaceVisibility: `hidden`, WebkitBackfaceVisibility: `hidden`, gridArea: `1 / 1`, maxWidth: `100%`, overflow: `hidden`, clipPath: v({ itemClip: i3 === e.all || i3 === t3 ? t3 : void 0, portrait: a4 }), boxSizing: `border-box`, transform: `translateZ(0)`, userSelect: `none`, zIndex: t3 === e.itemOne ? 1 : void 0, willChange: `clip-path`, ...n2 };
|
|
4504
|
+
return jsx(`div`, { "data-rcs": `item`, "data-rcs-item": t3, ...r3, style: o3 });
|
|
4505
|
+
};
|
|
4506
|
+
var b = `clamp(var(${t.boundsPadding}), var(${t.rawPosition}) - var(${t.boundsPadding}) + var(${t.boundsPadding}), calc(100% - var(${t.boundsPadding})))`;
|
|
4507
|
+
var x = ({ style: e3, ...a4 }) => {
|
|
4508
|
+
let { browsingContext: o3, boundsPadding: l3, changePositionOnHover: u3, clip: d3, isDragging: p3, portrait: m2, position: h2, onTouchEnd: g2, onPointerDown: _2, onPointerMove: v2, onPointerUp: y2, interactiveTarget: x2, rootRef: S, transition: C, canTransition: w } = f(), T = { position: `relative`, boxSizing: `border-box`, display: `grid`, maxWidth: `100%`, maxHeight: `100%`, overflow: `hidden`, cursor: p3 ? m2 ? `ns-resize` : `ew-resize` : void 0, touchAction: `pan-y`, userSelect: `none`, KhtmlUserSelect: `none`, msUserSelect: `none`, MozUserSelect: `none`, WebkitUserSelect: `none`, transition: w && C ? `${t.rawPosition} ${C}` : `none`, [t.rawPosition]: `${h2.current}%`, [t.boundsPadding]: l3, [t.currentPosition]: b, ...e3 };
|
|
4509
|
+
return a(`touchend`, g2, x2, r), a(`pointerdown`, _2, x2, r), useEffect(() => {
|
|
4510
|
+
let e4 = S.current, t3 = (e5) => {
|
|
4511
|
+
p3 || y2(e5);
|
|
4512
|
+
};
|
|
4513
|
+
return u3 && (e4.addEventListener(`pointermove`, v2, n), e4.addEventListener(`pointerleave`, t3, n)), () => {
|
|
4514
|
+
e4.removeEventListener(`pointermove`, v2), e4.removeEventListener(`pointerleave`, t3);
|
|
4528
4515
|
};
|
|
4529
|
-
|
|
4530
|
-
|
|
4516
|
+
}, [u3, v2, y2, p3, S]), useEffect(() => {
|
|
4517
|
+
if (p3) return o3.addEventListener(`pointermove`, v2, n), o3.addEventListener(`pointerup`, y2, n), () => {
|
|
4518
|
+
o3?.removeEventListener(`pointermove`, v2), o3?.removeEventListener(`pointerup`, y2);
|
|
4531
4519
|
};
|
|
4532
|
-
}, [
|
|
4533
|
-
|
|
4534
|
-
|
|
4535
|
-
|
|
4536
|
-
|
|
4537
|
-
}
|
|
4538
|
-
|
|
4539
|
-
|
|
4540
|
-
});
|
|
4541
|
-
|
|
4542
|
-
var
|
|
4543
|
-
|
|
4544
|
-
|
|
4545
|
-
|
|
4546
|
-
|
|
4520
|
+
}, [v2, y2, p3, o3]), jsx(`div`, { ref: S, style: T, "data-rcs": `root`, "data-rcs-clip": d3, ...a4 });
|
|
4521
|
+
};
|
|
4522
|
+
(() => {
|
|
4523
|
+
try {
|
|
4524
|
+
typeof CSS < `u` && CSS.registerProperty({ name: t.rawPosition, syntax: `<percentage>`, inherits: true, initialValue: `50%` });
|
|
4525
|
+
} catch (e3) {
|
|
4526
|
+
console.debug(`[react-compare-slider] register CSS property:`, e3);
|
|
4527
|
+
}
|
|
4528
|
+
})();
|
|
4529
|
+
var c2 = () => globalThis.matchMedia?.(`(prefers-reduced-motion: no-preference)`)?.matches ? `0.15s ease-out` : `none`;
|
|
4530
|
+
var l2 = () => !!globalThis.matchMedia?.(`(pointer: coarse)`)?.matches;
|
|
4531
|
+
var u2 = ({ boundsPadding: u3 = `0px`, browsingContext: d3 = globalThis, changePositionOnHover: f3 = false, clip: p3 = e.all, defaultPosition: m2 = 50, disabled: h2 = false, keyboardIncrement: g2 = `5%`, onlyHandleDraggable: _2 = l2(), onPositionChange: v2, portrait: y2 = false, transition: b2 = c2() } = {}) => {
|
|
4532
|
+
let x2 = useRef(null), S = useRef(null), C = useRef(m2), [w, T] = useState(false), [E, D] = useState(true), [O, k] = useState(null), A = useCallback((e3) => {
|
|
4533
|
+
let n2 = Math.min(Math.max(e3, 0), 100);
|
|
4534
|
+
x2.current?.style.setProperty(t.rawPosition, `${n2}%`), S.current?.setAttribute(`aria-valuenow`, `${Math.round(n2)}`), C.current = n2, v2?.(n2);
|
|
4535
|
+
}, [v2]), j = useCallback(function({ x: e3, y: t3 }) {
|
|
4536
|
+
let { width: n2, height: r3, top: i3, left: a4 } = x2.current.getBoundingClientRect();
|
|
4537
|
+
n2 === 0 || r3 === 0 || A((y2 ? t3 - i3 - d3.scrollY : e3 - a4 - d3.scrollX) / (y2 ? r3 : n2) * 100);
|
|
4538
|
+
}, [d3, y2, A]), M = useCallback((e3) => {
|
|
4539
|
+
e3.preventDefault(), !(h2 || e3.button !== 0) && (j({ x: e3.pageX, y: e3.pageY }), T(true), D(true));
|
|
4540
|
+
}, [h2, j]), N = useCallback(function(e3) {
|
|
4541
|
+
D(false), j({ x: e3.pageX, y: e3.pageY });
|
|
4542
|
+
}, [j]), P = useCallback((e3) => {
|
|
4543
|
+
T(false), D(true);
|
|
4544
|
+
}, []), F = useCallback((e3) => {
|
|
4545
|
+
T(false), D(true);
|
|
4546
|
+
}, []), I = useCallback((e3) => {
|
|
4547
|
+
e3.preventDefault(), e3.currentTarget?.focus();
|
|
4548
|
+
}, []), L = useCallback((e3) => {
|
|
4549
|
+
if (!Object.values(i).includes(e3.key)) return;
|
|
4550
|
+
e3.preventDefault(), D(true);
|
|
4551
|
+
let t3 = typeof g2 == `string` ? Number.parseFloat(g2) : g2 / x2.current?.getBoundingClientRect().width * 100;
|
|
4552
|
+
A((y2 ? e3.key === i.ARROW_LEFT || e3.key === i.ARROW_DOWN : e3.key === i.ARROW_RIGHT || e3.key === i.ARROW_UP) ? C.current + t3 : C.current - t3);
|
|
4553
|
+
}, [g2, y2, A]);
|
|
4554
|
+
return useLayoutEffect(() => {
|
|
4555
|
+
k(_2 ? S.current : x2.current);
|
|
4556
|
+
}, [_2]), useEffect(() => {
|
|
4557
|
+
A(m2);
|
|
4558
|
+
}, [m2, A]), { boundsPadding: u3, browsingContext: d3, changePositionOnHover: f3, clip: p3, defaultPosition: m2, disabled: h2, keyboardIncrement: g2, onlyHandleDraggable: _2, portrait: y2, transition: b2, onHandleRootKeyDown: L, onPointerDown: M, onPointerMove: N, onPointerUp: P, onTouchEnd: F, onHandleRootClick: I, canTransition: E, isDragging: w, position: C, setPosition: A, setPositionFromBounds: j, rootRef: x2, handleRootRef: S, interactiveTarget: O };
|
|
4559
|
+
};
|
|
4560
|
+
var p2 = ({ boundsPadding: e3, browsingContext: t3, changePositionOnHover: n2, clip: c3, defaultPosition: l3, disabled: p3, handle: m2, itemOne: h2, itemTwo: g2, keyboardIncrement: _2, onPositionChange: v2, onlyHandleDraggable: y2, portrait: b2, transition: x2, ...S }) => jsx(d, { ...u2({ boundsPadding: e3, browsingContext: t3, changePositionOnHover: n2, clip: c3, defaultPosition: l3, disabled: p3, keyboardIncrement: _2, onPositionChange: v2, onlyHandleDraggable: y2, portrait: b2, transition: x2 }), children: jsxs(x, { ...S, children: [jsx(y, { item: `itemOne`, children: h2 }), jsx(y, { item: `itemTwo`, children: g2 }), jsx(_, { children: m2 || jsx(m, {}) })] }) });
|
|
4547
4561
|
function ImageCompareNodeComponent(props) {
|
|
4548
4562
|
const { id, data } = props;
|
|
4549
4563
|
const nodeData = data;
|
|
@@ -4551,13 +4565,13 @@ function ImageCompareNodeComponent(props) {
|
|
|
4551
4565
|
const nodes = useWorkflowStore((state) => state.nodes);
|
|
4552
4566
|
const displayImages = useMemo(() => {
|
|
4553
4567
|
const connectedImages = [];
|
|
4554
|
-
const sortedEdges = edges.filter((edge) => edge.target === id).sort((
|
|
4555
|
-
const aTime =
|
|
4556
|
-
const bTime =
|
|
4568
|
+
const sortedEdges = edges.filter((edge) => edge.target === id).sort((a4, b2) => {
|
|
4569
|
+
const aTime = a4.data?.createdAt || 0;
|
|
4570
|
+
const bTime = b2.data?.createdAt || 0;
|
|
4557
4571
|
return aTime - bTime;
|
|
4558
4572
|
});
|
|
4559
4573
|
sortedEdges.forEach((edge) => {
|
|
4560
|
-
const sourceNode = nodes.find((
|
|
4574
|
+
const sourceNode = nodes.find((n2) => n2.id === edge.source);
|
|
4561
4575
|
if (!sourceNode) return;
|
|
4562
4576
|
const sourceData = sourceNode.data;
|
|
4563
4577
|
let image = null;
|
|
@@ -4578,10 +4592,10 @@ function ImageCompareNodeComponent(props) {
|
|
|
4578
4592
|
const imageB = displayImages[1] || nodeData.imageB || null;
|
|
4579
4593
|
return /* @__PURE__ */ jsx(BaseNode, { ...props, children: imageA && imageB ? /* @__PURE__ */ jsxs("div", { className: "flex-1 relative nodrag nopan nowheel min-h-[200px]", children: [
|
|
4580
4594
|
/* @__PURE__ */ jsx(
|
|
4581
|
-
|
|
4595
|
+
p2,
|
|
4582
4596
|
{
|
|
4583
4597
|
itemOne: /* @__PURE__ */ jsx(
|
|
4584
|
-
|
|
4598
|
+
g,
|
|
4585
4599
|
{
|
|
4586
4600
|
src: imageA,
|
|
4587
4601
|
alt: "Image A",
|
|
@@ -4589,7 +4603,7 @@ function ImageCompareNodeComponent(props) {
|
|
|
4589
4603
|
}
|
|
4590
4604
|
),
|
|
4591
4605
|
itemTwo: /* @__PURE__ */ jsx(
|
|
4592
|
-
|
|
4606
|
+
g,
|
|
4593
4607
|
{
|
|
4594
4608
|
src: imageB,
|
|
4595
4609
|
alt: "Image B",
|
|
@@ -4621,20 +4635,20 @@ function ImageGridSplitNodeComponent(props) {
|
|
|
4621
4635
|
const executeNode = useExecutionStore((state) => state.executeNode);
|
|
4622
4636
|
const [selectedPreview, setSelectedPreview] = useState(null);
|
|
4623
4637
|
const handleRowsChange = useCallback(
|
|
4624
|
-
(
|
|
4638
|
+
(e3) => {
|
|
4625
4639
|
const value = Math.min(
|
|
4626
4640
|
10,
|
|
4627
|
-
Math.max(1, Number.parseInt(
|
|
4641
|
+
Math.max(1, Number.parseInt(e3.target.value, 10) || 1)
|
|
4628
4642
|
);
|
|
4629
4643
|
updateNodeData(id, { gridRows: value });
|
|
4630
4644
|
},
|
|
4631
4645
|
[id, updateNodeData]
|
|
4632
4646
|
);
|
|
4633
4647
|
const handleColsChange = useCallback(
|
|
4634
|
-
(
|
|
4648
|
+
(e3) => {
|
|
4635
4649
|
const value = Math.min(
|
|
4636
4650
|
10,
|
|
4637
|
-
Math.max(1, Number.parseInt(
|
|
4651
|
+
Math.max(1, Number.parseInt(e3.target.value, 10) || 1)
|
|
4638
4652
|
);
|
|
4639
4653
|
updateNodeData(id, { gridCols: value });
|
|
4640
4654
|
},
|
|
@@ -4682,7 +4696,7 @@ function ImageGridSplitNodeComponent(props) {
|
|
|
4682
4696
|
[nodeData.outputImages, nodeData.outputFormat]
|
|
4683
4697
|
);
|
|
4684
4698
|
const handleDownloadAll = useCallback(() => {
|
|
4685
|
-
nodeData.outputImages.forEach((
|
|
4699
|
+
nodeData.outputImages.forEach((_2, index) => {
|
|
4686
4700
|
setTimeout(() => handleDownload(index), index * 100);
|
|
4687
4701
|
});
|
|
4688
4702
|
}, [nodeData.outputImages, handleDownload]);
|
|
@@ -4737,13 +4751,13 @@ function ImageGridSplitNodeComponent(props) {
|
|
|
4737
4751
|
gridTemplateColumns: `repeat(${nodeData.gridCols}, 1fr)`,
|
|
4738
4752
|
gridTemplateRows: `repeat(${nodeData.gridRows}, 1fr)`
|
|
4739
4753
|
},
|
|
4740
|
-
children: Array.from({ length: totalCells }).map((
|
|
4754
|
+
children: Array.from({ length: totalCells }).map((_2, i3) => /* @__PURE__ */ jsx(
|
|
4741
4755
|
"div",
|
|
4742
4756
|
{
|
|
4743
4757
|
className: "bg-[var(--primary)]/20 text-[8px] flex items-center justify-center text-[var(--primary)]",
|
|
4744
|
-
children:
|
|
4758
|
+
children: i3 + 1
|
|
4745
4759
|
},
|
|
4746
|
-
|
|
4760
|
+
i3
|
|
4747
4761
|
))
|
|
4748
4762
|
}
|
|
4749
4763
|
)
|
|
@@ -4775,7 +4789,7 @@ function ImageGridSplitNodeComponent(props) {
|
|
|
4775
4789
|
onValueChange: handleFormatChange,
|
|
4776
4790
|
children: [
|
|
4777
4791
|
/* @__PURE__ */ jsx(SelectTrigger, { className: "nodrag h-8 w-full", children: /* @__PURE__ */ jsx(SelectValue, {}) }),
|
|
4778
|
-
/* @__PURE__ */ jsx(SelectContent, { children: OUTPUT_FORMATS.map((
|
|
4792
|
+
/* @__PURE__ */ jsx(SelectContent, { children: OUTPUT_FORMATS.map((f3) => /* @__PURE__ */ jsx(SelectItem, { value: f3.value, children: f3.label }, f3.value)) })
|
|
4779
4793
|
]
|
|
4780
4794
|
}
|
|
4781
4795
|
)
|
|
@@ -4845,8 +4859,8 @@ function ImageGridSplitNodeComponent(props) {
|
|
|
4845
4859
|
{
|
|
4846
4860
|
variant: "ghost",
|
|
4847
4861
|
size: "icon-sm",
|
|
4848
|
-
onClick: (
|
|
4849
|
-
|
|
4862
|
+
onClick: (e3) => {
|
|
4863
|
+
e3.stopPropagation();
|
|
4850
4864
|
handleDownload(index);
|
|
4851
4865
|
},
|
|
4852
4866
|
className: "h-6 w-6 bg-white/20 hover:bg-white/30",
|
|
@@ -4925,7 +4939,7 @@ function OutputGalleryNodeComponent(props) {
|
|
|
4925
4939
|
const executionImages = [...nodeData.images || []];
|
|
4926
4940
|
const connectedImages = [];
|
|
4927
4941
|
edges.filter((edge) => edge.target === id).forEach((edge) => {
|
|
4928
|
-
const sourceNode = nodes.find((
|
|
4942
|
+
const sourceNode = nodes.find((n2) => n2.id === edge.source);
|
|
4929
4943
|
if (!sourceNode) return;
|
|
4930
4944
|
const sourceData = sourceNode.data;
|
|
4931
4945
|
const images = sourceData.outputImages;
|
|
@@ -4991,7 +5005,7 @@ function OutputGalleryNodeComponent(props) {
|
|
|
4991
5005
|
canvas.height = img.naturalHeight;
|
|
4992
5006
|
const ctx = canvas.getContext("2d");
|
|
4993
5007
|
ctx?.drawImage(img, 0, 0);
|
|
4994
|
-
canvas.toBlob((
|
|
5008
|
+
canvas.toBlob((b2) => resolve(b2 || blob), "image/png");
|
|
4995
5009
|
};
|
|
4996
5010
|
img.onerror = () => resolve(blob);
|
|
4997
5011
|
img.src = image;
|
|
@@ -5004,8 +5018,8 @@ function OutputGalleryNodeComponent(props) {
|
|
|
5004
5018
|
}, [lightboxIndex]);
|
|
5005
5019
|
useEffect(() => {
|
|
5006
5020
|
if (!isLightboxOpen) return;
|
|
5007
|
-
const handleKeyDown = (
|
|
5008
|
-
switch (
|
|
5021
|
+
const handleKeyDown = (e3) => {
|
|
5022
|
+
switch (e3.key) {
|
|
5009
5023
|
case "Escape":
|
|
5010
5024
|
closeLightbox();
|
|
5011
5025
|
break;
|
|
@@ -5043,12 +5057,12 @@ function OutputGalleryNodeComponent(props) {
|
|
|
5043
5057
|
{
|
|
5044
5058
|
className: "fixed inset-0 bg-black/90 z-[100] flex items-center justify-center p-8",
|
|
5045
5059
|
onClick: closeLightbox,
|
|
5046
|
-
onContextMenu: (
|
|
5060
|
+
onContextMenu: (e3) => e3.stopPropagation(),
|
|
5047
5061
|
children: /* @__PURE__ */ jsxs(
|
|
5048
5062
|
"div",
|
|
5049
5063
|
{
|
|
5050
5064
|
className: "relative max-w-full max-h-full",
|
|
5051
|
-
onClick: (
|
|
5065
|
+
onClick: (e3) => e3.stopPropagation(),
|
|
5052
5066
|
children: [
|
|
5053
5067
|
/* @__PURE__ */ jsx(
|
|
5054
5068
|
"img",
|
|
@@ -5161,8 +5175,8 @@ function ReframeNodeComponent(props) {
|
|
|
5161
5175
|
[id, updateNodeData]
|
|
5162
5176
|
);
|
|
5163
5177
|
const handlePromptChange = useCallback(
|
|
5164
|
-
(
|
|
5165
|
-
updateNodeData(id, { prompt:
|
|
5178
|
+
(e3) => {
|
|
5179
|
+
updateNodeData(id, { prompt: e3.target.value });
|
|
5166
5180
|
},
|
|
5167
5181
|
[id, updateNodeData]
|
|
5168
5182
|
);
|
|
@@ -5331,8 +5345,8 @@ function ResizeNodeComponent(props) {
|
|
|
5331
5345
|
[id, updateNodeData]
|
|
5332
5346
|
);
|
|
5333
5347
|
const handlePromptChange = useCallback(
|
|
5334
|
-
(
|
|
5335
|
-
updateNodeData(id, { prompt:
|
|
5348
|
+
(e3) => {
|
|
5349
|
+
updateNodeData(id, { prompt: e3.target.value });
|
|
5336
5350
|
},
|
|
5337
5351
|
[id, updateNodeData]
|
|
5338
5352
|
);
|
|
@@ -5481,8 +5495,8 @@ function SubtitleNodeComponent(props) {
|
|
|
5481
5495
|
[id, updateNodeData]
|
|
5482
5496
|
);
|
|
5483
5497
|
const handleFontColorChange = useCallback(
|
|
5484
|
-
(
|
|
5485
|
-
updateNodeData(id, { fontColor:
|
|
5498
|
+
(e3) => {
|
|
5499
|
+
updateNodeData(id, { fontColor: e3.target.value });
|
|
5486
5500
|
},
|
|
5487
5501
|
[id, updateNodeData]
|
|
5488
5502
|
);
|
|
@@ -6154,7 +6168,7 @@ function VideoStitchNodeComponent(props) {
|
|
|
6154
6168
|
"Input Videos: ",
|
|
6155
6169
|
inputVideos.length
|
|
6156
6170
|
] }),
|
|
6157
|
-
inputVideos.length > 0 && /* @__PURE__ */ jsx("div", { className: "mt-1 flex gap-1 flex-wrap", children: inputVideos.map((
|
|
6171
|
+
inputVideos.length > 0 && /* @__PURE__ */ jsx("div", { className: "mt-1 flex gap-1 flex-wrap", children: inputVideos.map((_2, index) => /* @__PURE__ */ jsx(
|
|
6158
6172
|
"div",
|
|
6159
6173
|
{
|
|
6160
6174
|
className: "w-6 h-6 bg-[var(--primary)]/20 rounded text-xs flex items-center justify-center text-[var(--primary)]",
|
|
@@ -6172,7 +6186,7 @@ function VideoStitchNodeComponent(props) {
|
|
|
6172
6186
|
onValueChange: handleTransitionChange,
|
|
6173
6187
|
children: [
|
|
6174
6188
|
/* @__PURE__ */ jsx(SelectTrigger, { className: "nodrag h-8 w-full", children: /* @__PURE__ */ jsx(SelectValue, {}) }),
|
|
6175
|
-
/* @__PURE__ */ jsx(SelectContent, { children: TRANSITIONS.map((
|
|
6189
|
+
/* @__PURE__ */ jsx(SelectContent, { children: TRANSITIONS.map((t3) => /* @__PURE__ */ jsx(SelectItem, { value: t3.value, children: t3.label }, t3.value)) })
|
|
6176
6190
|
]
|
|
6177
6191
|
}
|
|
6178
6192
|
)
|
|
@@ -6310,15 +6324,15 @@ function VideoTrimNodeComponent(props) {
|
|
|
6310
6324
|
const openNodeDetailModal = useUIStore((state) => state.openNodeDetailModal);
|
|
6311
6325
|
const hasRequiredInputs = !!nodeData.inputVideo;
|
|
6312
6326
|
const handleStartTimeChange = useCallback(
|
|
6313
|
-
(
|
|
6314
|
-
const value = parseTime(
|
|
6327
|
+
(e3) => {
|
|
6328
|
+
const value = parseTime(e3.target.value);
|
|
6315
6329
|
updateNodeData(id, { startTime: value });
|
|
6316
6330
|
},
|
|
6317
6331
|
[id, updateNodeData]
|
|
6318
6332
|
);
|
|
6319
6333
|
const handleEndTimeChange = useCallback(
|
|
6320
|
-
(
|
|
6321
|
-
const value = parseTime(
|
|
6334
|
+
(e3) => {
|
|
6335
|
+
const value = parseTime(e3.target.value);
|
|
6322
6336
|
updateNodeData(id, { endTime: value });
|
|
6323
6337
|
},
|
|
6324
6338
|
[id, updateNodeData]
|
|
@@ -6499,3 +6513,5 @@ var nodeTypes = {
|
|
|
6499
6513
|
};
|
|
6500
6514
|
|
|
6501
6515
|
export { AnimationNode, AnnotationNode, AudioInputNode, BaseNode, DownloadNode, ImageCompareNode, ImageGenNode, ImageGridSplitNode, ImageInputNode, LLMNode, LipSyncNode, MotionControlNode, NodeDetailModal, OutputGalleryNode, OutputNode, PromptConstructorNode, PromptNode, ReframeNode, ResizeNode, SubtitleNode, TextToSpeechNode, TranscribeNode, UpscaleNode, VideoFrameExtractNode, VideoGenNode, VideoInputNode, VideoStitchNode, VideoTrimNode, VoiceChangeNode, WorkflowInputNode, WorkflowOutputNode, WorkflowRefNode, nodeTypes, setWorkflowRefApi };
|
|
6516
|
+
//# sourceMappingURL=chunk-55JFUNLR.mjs.map
|
|
6517
|
+
//# sourceMappingURL=chunk-55JFUNLR.mjs.map
|