@datatechsolutions/ui 2.11.6 → 2.11.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.
@@ -2890,203 +2890,214 @@ var GroupFlowNode = react.memo(function GroupFlowNode2({ id, data, selected }) {
2890
2890
  /* @__PURE__ */ jsxRuntime.jsx(WorkflowHandle, { type: "source", position: react$1.Position.Right, id: "right-out", colorClass: "!bg-slate-500" })
2891
2891
  ] });
2892
2892
  });
2893
- function StartNodeConfigForm({ config, onSave, onCancel }) {
2894
- const t = chunkYXN2K77G_js.useTranslations("agents.workflow.startNodeConfig");
2895
- const [inputVariables, setInputVariables] = react.useState([...config.inputVariables]);
2893
+ function ConfigFormActions({
2894
+ cancelLabel,
2895
+ saveLabel,
2896
+ onCancel,
2897
+ onSave,
2898
+ saveDisabled = false
2899
+ }) {
2900
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2 border-t border-gray-200 pt-4 dark:border-gray-700", children: [
2901
+ /* @__PURE__ */ jsxRuntime.jsx(chunk4XID6LOC_js.Button, { type: "button", outline: true, onClick: onCancel, children: cancelLabel }),
2902
+ /* @__PURE__ */ jsxRuntime.jsx(chunk4XID6LOC_js.Button, { type: "button", onClick: onSave, disabled: saveDisabled, children: saveLabel })
2903
+ ] });
2904
+ }
2905
+ var COLOR_CLASSES = {
2906
+ green: {
2907
+ badge: "bg-green-100 text-green-700 dark:bg-green-500/20 dark:text-green-300",
2908
+ input: "focus:border-green-400 focus:ring-green-400/20",
2909
+ row: "border-green-200/30 dark:border-green-500/15",
2910
+ add: "text-green-600 hover:text-green-700 dark:text-green-400 dark:hover:text-green-300",
2911
+ dot: "bg-green-500"
2912
+ },
2913
+ blue: {
2914
+ badge: "bg-blue-100 text-blue-700 dark:bg-blue-500/20 dark:text-blue-300",
2915
+ input: "focus:border-blue-400 focus:ring-blue-400/20",
2916
+ row: "border-blue-200/30 dark:border-blue-500/15",
2917
+ add: "text-blue-600 hover:text-blue-700 dark:text-blue-400 dark:hover:text-blue-300",
2918
+ dot: "bg-blue-500"
2919
+ },
2920
+ purple: {
2921
+ badge: "bg-purple-100 text-purple-700 dark:bg-purple-500/20 dark:text-purple-300",
2922
+ input: "focus:border-purple-400 focus:ring-purple-400/20",
2923
+ row: "border-purple-200/30 dark:border-purple-500/15",
2924
+ add: "text-purple-600 hover:text-purple-700 dark:text-purple-400 dark:hover:text-purple-300",
2925
+ dot: "bg-purple-500"
2926
+ },
2927
+ red: {
2928
+ badge: "bg-red-100 text-red-700 dark:bg-red-500/20 dark:text-red-300",
2929
+ input: "focus:border-red-400 focus:ring-red-400/20",
2930
+ row: "border-red-200/30 dark:border-red-500/15",
2931
+ add: "text-red-600 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300",
2932
+ dot: "bg-red-500"
2933
+ },
2934
+ teal: {
2935
+ badge: "bg-teal-100 text-teal-700 dark:bg-teal-500/20 dark:text-teal-300",
2936
+ input: "focus:border-teal-400 focus:ring-teal-400/20",
2937
+ row: "border-teal-200/30 dark:border-teal-500/15",
2938
+ add: "text-teal-600 hover:text-teal-700 dark:text-teal-400 dark:hover:text-teal-300",
2939
+ dot: "bg-teal-500"
2940
+ }
2941
+ };
2942
+ function VariableListEditor({
2943
+ variables,
2944
+ onChange,
2945
+ placeholder = "Variable name",
2946
+ label,
2947
+ addLabel = "Add",
2948
+ color = "green",
2949
+ numbered = false,
2950
+ editable = false,
2951
+ max = 0
2952
+ }) {
2896
2953
  const [newVariable, setNewVariable] = react.useState("");
2897
- const handleAddVariable = () => {
2954
+ const inputRef = react.useRef(null);
2955
+ const colors = COLOR_CLASSES[color];
2956
+ const canAdd = max === 0 || variables.length < max;
2957
+ const handleAdd = react.useCallback(() => {
2898
2958
  const trimmed = newVariable.trim();
2899
- if (trimmed && !inputVariables.includes(trimmed)) {
2900
- setInputVariables([...inputVariables, trimmed]);
2901
- setNewVariable("");
2902
- }
2903
- };
2904
- const handleRemoveVariable = (variable) => {
2905
- setInputVariables(inputVariables.filter((existingVariable) => existingVariable !== variable));
2906
- };
2907
- const handleKeyDown = (event) => {
2959
+ if (!trimmed || variables.includes(trimmed)) return;
2960
+ onChange([...variables, trimmed]);
2961
+ setNewVariable("");
2962
+ inputRef.current?.focus();
2963
+ }, [newVariable, variables, onChange]);
2964
+ const handleRemove = react.useCallback((index) => {
2965
+ onChange(variables.filter((_, i) => i !== index));
2966
+ }, [variables, onChange]);
2967
+ const handleEdit = react.useCallback((index, value) => {
2968
+ const updated = [...variables];
2969
+ updated[index] = value;
2970
+ onChange(updated);
2971
+ }, [variables, onChange]);
2972
+ const handleKeyDown = react.useCallback((event) => {
2908
2973
  if (event.key === "Enter") {
2909
2974
  event.preventDefault();
2910
- handleAddVariable();
2975
+ handleAdd();
2911
2976
  }
2912
- };
2977
+ }, [handleAdd]);
2978
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
2979
+ label && /* @__PURE__ */ jsxRuntime.jsx("label", { className: "mb-2 block text-xs font-medium text-gray-500 dark:text-gray-400", children: label }),
2980
+ variables.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-2 space-y-1", children: variables.map((variable, index) => /* @__PURE__ */ jsxRuntime.jsxs(
2981
+ "div",
2982
+ {
2983
+ className: `group flex items-center gap-2 rounded-lg border px-2.5 py-1.5 transition-colors ${colors.row} hover:bg-white/5`,
2984
+ children: [
2985
+ numbered ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: `inline-flex h-5 min-w-5 items-center justify-center rounded-full text-[10px] font-bold ${colors.badge}`, children: index + 1 }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: `h-1.5 w-1.5 shrink-0 rounded-full ${colors.dot}` }),
2986
+ editable ? /* @__PURE__ */ jsxRuntime.jsx(
2987
+ "input",
2988
+ {
2989
+ type: "text",
2990
+ value: variable,
2991
+ onChange: (event) => handleEdit(index, event.target.value),
2992
+ className: `flex-1 rounded-md border-0 bg-transparent px-1 py-0.5 text-sm font-medium text-gray-900 outline-none ${colors.input} focus:ring-1 dark:text-white`
2993
+ }
2994
+ ) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1 text-sm font-medium text-gray-900 dark:text-white", children: variable }),
2995
+ /* @__PURE__ */ jsxRuntime.jsx(
2996
+ "button",
2997
+ {
2998
+ type: "button",
2999
+ onClick: () => handleRemove(index),
3000
+ className: "shrink-0 rounded p-0.5 text-gray-400 opacity-0 transition-all hover:bg-red-100 hover:text-red-500 group-hover:opacity-100 dark:hover:bg-red-500/10 dark:hover:text-red-400",
3001
+ "aria-label": `Remove ${variable}`,
3002
+ children: /* @__PURE__ */ jsxRuntime.jsx(outline.XMarkIcon, { className: "h-3.5 w-3.5" })
3003
+ }
3004
+ )
3005
+ ]
3006
+ },
3007
+ `${index}-${variable}`
3008
+ )) }),
3009
+ canAdd && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
3010
+ /* @__PURE__ */ jsxRuntime.jsx(
3011
+ "input",
3012
+ {
3013
+ ref: inputRef,
3014
+ type: "text",
3015
+ value: newVariable,
3016
+ onChange: (event) => setNewVariable(event.target.value),
3017
+ onKeyDown: handleKeyDown,
3018
+ placeholder,
3019
+ className: "flex-1 rounded-lg border border-gray-200/50 bg-gray-50/50 px-3 py-1.5 text-sm text-gray-700 outline-none transition-colors placeholder:text-gray-400 focus:border-gray-300 focus:ring-1 focus:ring-gray-300/30 dark:border-white/10 dark:bg-white/5 dark:text-gray-300 dark:placeholder:text-gray-600"
3020
+ }
3021
+ ),
3022
+ /* @__PURE__ */ jsxRuntime.jsxs(
3023
+ "button",
3024
+ {
3025
+ type: "button",
3026
+ onClick: handleAdd,
3027
+ disabled: !newVariable.trim(),
3028
+ className: `flex items-center gap-1 rounded-lg px-3 py-1.5 text-xs font-semibold transition-all disabled:cursor-not-allowed disabled:opacity-40 ${colors.add} hover:bg-white/10`,
3029
+ children: [
3030
+ /* @__PURE__ */ jsxRuntime.jsx(outline.PlusIcon, { className: "h-3.5 w-3.5" }),
3031
+ addLabel
3032
+ ]
3033
+ }
3034
+ )
3035
+ ] }),
3036
+ variables.length === 0 && !canAdd && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-gray-400 dark:text-gray-500", children: "No variables defined" })
3037
+ ] });
3038
+ }
3039
+ function StartNodeConfigForm({ config, onSave, onCancel }) {
3040
+ const t = chunkYXN2K77G_js.useTranslations("agents.workflow.startNodeConfig");
3041
+ const [inputVariables, setInputVariables] = react.useState([...config.inputVariables]);
2913
3042
  const handleSave = () => {
2914
3043
  onSave({ ...config, inputVariables });
2915
3044
  };
2916
3045
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
2917
3046
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
2918
- /* @__PURE__ */ jsxRuntime.jsx("label", { className: "mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300", children: t("inputVariablesLabel") }),
2919
3047
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mb-2 text-xs text-gray-500 dark:text-gray-400", children: t("inputVariablesHelp") }),
2920
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2", children: [
2921
- /* @__PURE__ */ jsxRuntime.jsx(
2922
- chunk4XID6LOC_js.Input,
2923
- {
2924
- value: newVariable,
2925
- onChange: (event) => setNewVariable(event.target.value),
2926
- onKeyDown: handleKeyDown,
2927
- placeholder: t("variablePlaceholder"),
2928
- className: "flex-1"
2929
- }
2930
- ),
2931
- /* @__PURE__ */ jsxRuntime.jsx(
2932
- chunk4XID6LOC_js.Button,
2933
- {
2934
- type: "button",
2935
- onClick: handleAddVariable,
2936
- outline: true,
2937
- size: "sm",
2938
- children: t("addVariable")
2939
- }
2940
- )
2941
- ] }),
2942
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-2 flex flex-wrap gap-2", children: inputVariables.map((variable) => /* @__PURE__ */ jsxRuntime.jsxs(
2943
- "span",
2944
- {
2945
- className: "inline-flex items-center gap-1 rounded-full bg-green-100 px-2.5 py-1 text-xs font-medium text-green-700 dark:bg-green-500/20 dark:text-green-300",
2946
- children: [
2947
- variable,
2948
- /* @__PURE__ */ jsxRuntime.jsx(
2949
- chunk4XID6LOC_js.IconButton,
2950
- {
2951
- icon: /* @__PURE__ */ jsxRuntime.jsx(outline.XMarkIcon, { className: "h-3 w-3" }),
2952
- label: `Remove ${variable}`,
2953
- onClick: () => handleRemoveVariable(variable),
2954
- variant: "ghost",
2955
- size: "sm",
2956
- className: "!p-0"
2957
- }
2958
- )
2959
- ]
2960
- },
2961
- variable
2962
- )) })
2963
- ] }),
2964
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2 border-t border-gray-200 pt-4 dark:border-gray-700", children: [
2965
3048
  /* @__PURE__ */ jsxRuntime.jsx(
2966
- chunk4XID6LOC_js.Button,
3049
+ VariableListEditor,
2967
3050
  {
2968
- type: "button",
2969
- onClick: onCancel,
2970
- outline: true,
2971
- size: "sm",
2972
- children: t("cancel")
2973
- }
2974
- ),
2975
- /* @__PURE__ */ jsxRuntime.jsx(
2976
- chunk4XID6LOC_js.Button,
2977
- {
2978
- type: "button",
2979
- onClick: handleSave,
2980
- color: "ios-glass-blue",
2981
- size: "sm",
2982
- children: t("save")
3051
+ variables: inputVariables,
3052
+ onChange: setInputVariables,
3053
+ label: t("inputVariablesLabel"),
3054
+ placeholder: t("variablePlaceholder"),
3055
+ addLabel: t("addVariable"),
3056
+ color: "green"
2983
3057
  }
2984
3058
  )
2985
- ] })
3059
+ ] }),
3060
+ /* @__PURE__ */ jsxRuntime.jsx(
3061
+ ConfigFormActions,
3062
+ {
3063
+ cancelLabel: t("cancel"),
3064
+ saveLabel: t("save"),
3065
+ onCancel,
3066
+ onSave: handleSave
3067
+ }
3068
+ )
2986
3069
  ] });
2987
3070
  }
2988
3071
  function EndNodeConfigForm({ config, onSave, onCancel }) {
2989
3072
  const t = chunkYXN2K77G_js.useTranslations("agents.workflow.endNodeConfig");
2990
3073
  const [outputVariables, setOutputVariables] = react.useState([...config.outputVariables]);
2991
- const [newVariable, setNewVariable] = react.useState("");
2992
- const handleAddVariable = () => {
2993
- const trimmed = newVariable.trim();
2994
- if (trimmed && !outputVariables.includes(trimmed)) {
2995
- setOutputVariables([...outputVariables, trimmed]);
2996
- setNewVariable("");
2997
- }
2998
- };
2999
- const handleRemoveVariable = (variable) => {
3000
- setOutputVariables(outputVariables.filter((existingVariable) => existingVariable !== variable));
3001
- };
3002
- const handleKeyDown = (event) => {
3003
- if (event.key === "Enter") {
3004
- event.preventDefault();
3005
- handleAddVariable();
3006
- }
3007
- };
3008
3074
  const handleSave = () => {
3009
3075
  onSave({ ...config, outputVariables });
3010
3076
  };
3011
3077
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
3012
3078
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
3013
- /* @__PURE__ */ jsxRuntime.jsx("label", { className: "mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300", children: t("outputVariablesLabel") }),
3014
3079
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mb-2 text-xs text-gray-500 dark:text-gray-400", children: t("outputVariablesHelp") }),
3015
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2", children: [
3016
- /* @__PURE__ */ jsxRuntime.jsx(
3017
- "input",
3018
- {
3019
- type: "text",
3020
- value: newVariable,
3021
- onChange: (event) => setNewVariable(event.target.value),
3022
- onKeyDown: handleKeyDown,
3023
- placeholder: t("variablePlaceholder"),
3024
- className: "w-full flex-1 rounded-lg border border-gray-300 bg-white px-3 py-2 text-sm text-gray-900 placeholder-gray-400 outline-none focus:border-indigo-400 focus:ring-2 focus:ring-indigo-400/20 dark:border-gray-600 dark:bg-gray-800 dark:text-white dark:placeholder-gray-500"
3025
- }
3026
- ),
3027
- /* @__PURE__ */ jsxRuntime.jsx(
3028
- "button",
3029
- {
3030
- type: "button",
3031
- onClick: handleAddVariable,
3032
- className: "text-sm text-indigo-600 hover:text-indigo-700 dark:text-indigo-400",
3033
- children: t("addVariable")
3034
- }
3035
- )
3036
- ] }),
3037
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-2 flex flex-wrap gap-2", children: outputVariables.map((variable) => /* @__PURE__ */ jsxRuntime.jsxs(
3038
- "span",
3039
- {
3040
- className: "inline-flex items-center gap-1 rounded-full bg-red-100 px-2.5 py-1 text-xs font-medium text-red-700 dark:bg-red-500/20 dark:text-red-300",
3041
- children: [
3042
- variable,
3043
- /* @__PURE__ */ jsxRuntime.jsx(
3044
- "button",
3045
- {
3046
- type: "button",
3047
- onClick: () => handleRemoveVariable(variable),
3048
- className: "text-sm text-red-500 hover:text-red-600",
3049
- "aria-label": `Remove ${variable}`,
3050
- children: /* @__PURE__ */ jsxRuntime.jsx(outline.XMarkIcon, { className: "h-3 w-3" })
3051
- }
3052
- )
3053
- ]
3054
- },
3055
- variable
3056
- )) })
3057
- ] }),
3058
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2 pt-4 border-t border-gray-200 dark:border-gray-700", children: [
3059
- /* @__PURE__ */ jsxRuntime.jsx(
3060
- "button",
3061
- {
3062
- type: "button",
3063
- onClick: onCancel,
3064
- className: "rounded-lg border border-gray-300 px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 dark:border-gray-600 dark:text-gray-300 dark:hover:bg-gray-800",
3065
- children: t("cancel")
3066
- }
3067
- ),
3068
3080
  /* @__PURE__ */ jsxRuntime.jsx(
3069
- "button",
3081
+ VariableListEditor,
3070
3082
  {
3071
- type: "button",
3072
- onClick: handleSave,
3073
- className: "rounded-lg bg-indigo-600 px-4 py-2 text-sm font-medium text-white hover:bg-indigo-700 dark:bg-indigo-500 dark:hover:bg-indigo-600",
3074
- children: t("save")
3083
+ variables: outputVariables,
3084
+ onChange: setOutputVariables,
3085
+ label: t("outputVariablesLabel"),
3086
+ placeholder: t("variablePlaceholder"),
3087
+ addLabel: t("addVariable"),
3088
+ color: "red"
3075
3089
  }
3076
3090
  )
3077
- ] })
3078
- ] });
3079
- }
3080
- function ConfigFormActions({
3081
- cancelLabel,
3082
- saveLabel,
3083
- onCancel,
3084
- onSave,
3085
- saveDisabled = false
3086
- }) {
3087
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2 border-t border-gray-200 pt-4 dark:border-gray-700", children: [
3088
- /* @__PURE__ */ jsxRuntime.jsx(chunk4XID6LOC_js.Button, { type: "button", outline: true, onClick: onCancel, children: cancelLabel }),
3089
- /* @__PURE__ */ jsxRuntime.jsx(chunk4XID6LOC_js.Button, { type: "button", onClick: onSave, disabled: saveDisabled, children: saveLabel })
3091
+ ] }),
3092
+ /* @__PURE__ */ jsxRuntime.jsx(
3093
+ ConfigFormActions,
3094
+ {
3095
+ cancelLabel: t("cancel"),
3096
+ saveLabel: t("save"),
3097
+ onCancel,
3098
+ onSave: handleSave
3099
+ }
3100
+ )
3090
3101
  ] });
3091
3102
  }
3092
3103
  var OPERATOR_OPTIONS = [
@@ -3568,23 +3579,6 @@ function AnswerNodeConfigForm({ config, onSave, onCancel }) {
3568
3579
  const t = chunkYXN2K77G_js.useTranslations("agents.workflow.answerNodeConfig");
3569
3580
  const [outputTemplate, setOutputTemplate] = react.useState(config.outputTemplate);
3570
3581
  const [outputVariables, setOutputVariables] = react.useState([...config.outputVariables]);
3571
- const [newVariable, setNewVariable] = react.useState("");
3572
- const handleAddVariable = () => {
3573
- const trimmed = newVariable.trim();
3574
- if (trimmed && !outputVariables.includes(trimmed)) {
3575
- setOutputVariables([...outputVariables, trimmed]);
3576
- setNewVariable("");
3577
- }
3578
- };
3579
- const handleRemoveVariable = (variable) => {
3580
- setOutputVariables(outputVariables.filter((existingVariable) => existingVariable !== variable));
3581
- };
3582
- const handleKeyDown = (event) => {
3583
- if (event.key === "Enter") {
3584
- event.preventDefault();
3585
- handleAddVariable();
3586
- }
3587
- };
3588
3582
  const handleSave = () => {
3589
3583
  onSave({ ...config, outputTemplate, outputVariables });
3590
3584
  };
@@ -3601,50 +3595,17 @@ function AnswerNodeConfigForm({ config, onSave, onCancel }) {
3601
3595
  className: "font-mono text-xs"
3602
3596
  }
3603
3597
  ),
3604
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
3605
- /* @__PURE__ */ jsxRuntime.jsx("label", { className: "mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300", children: t("outputVariablesLabel") }),
3606
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2", children: [
3607
- /* @__PURE__ */ jsxRuntime.jsx(
3608
- chunk4XID6LOC_js.FormInput,
3609
- {
3610
- type: "text",
3611
- value: newVariable,
3612
- onValueChange: setNewVariable,
3613
- onKeyDown: handleKeyDown,
3614
- placeholder: t("variablePlaceholder"),
3615
- className: "flex-1"
3616
- }
3617
- ),
3618
- /* @__PURE__ */ jsxRuntime.jsx(
3619
- chunk4XID6LOC_js.Button,
3620
- {
3621
- type: "button",
3622
- onClick: handleAddVariable,
3623
- children: t("addVariable")
3624
- }
3625
- )
3626
- ] }),
3627
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-2 flex flex-wrap gap-2", children: outputVariables.map((variable) => /* @__PURE__ */ jsxRuntime.jsxs(
3628
- "span",
3629
- {
3630
- className: "inline-flex items-center gap-1 rounded-full bg-blue-100 px-2.5 py-1 text-xs font-medium text-blue-700 dark:bg-blue-500/20 dark:text-blue-300",
3631
- children: [
3632
- variable,
3633
- /* @__PURE__ */ jsxRuntime.jsx(
3634
- chunk4XID6LOC_js.IconButton,
3635
- {
3636
- onClick: () => handleRemoveVariable(variable),
3637
- icon: /* @__PURE__ */ jsxRuntime.jsx(outline.XMarkIcon, { className: "h-3 w-3" }),
3638
- label: `Remove ${variable}`,
3639
- size: "sm",
3640
- color: "ios-red"
3641
- }
3642
- )
3643
- ]
3644
- },
3645
- variable
3646
- )) })
3647
- ] }),
3598
+ /* @__PURE__ */ jsxRuntime.jsx(
3599
+ VariableListEditor,
3600
+ {
3601
+ variables: outputVariables,
3602
+ onChange: setOutputVariables,
3603
+ label: t("outputVariablesLabel"),
3604
+ placeholder: t("variablePlaceholder"),
3605
+ addLabel: t("addVariable"),
3606
+ color: "blue"
3607
+ }
3608
+ ),
3648
3609
  /* @__PURE__ */ jsxRuntime.jsx(
3649
3610
  ConfigFormActions,
3650
3611
  {
@@ -4039,77 +4000,23 @@ function VariableAggregatorNodeConfigForm({ config, onSave, onCancel }) {
4039
4000
  const [inputVariables, setInputVariables] = react.useState([...config.inputVariables]);
4040
4001
  const [outputVariable, setOutputVariable] = react.useState(config.outputVariable);
4041
4002
  const [aggregationMode, setAggregationMode] = react.useState(config.aggregationMode);
4042
- const [newVariable, setNewVariable] = react.useState("");
4043
- const handleAddVariable = () => {
4044
- const trimmed = newVariable.trim();
4045
- if (trimmed && !inputVariables.includes(trimmed)) {
4046
- setInputVariables([...inputVariables, trimmed]);
4047
- setNewVariable("");
4048
- }
4049
- };
4050
- const handleRemoveVariable = (index) => {
4051
- setInputVariables(inputVariables.filter((_, variableIndex) => variableIndex !== index));
4052
- };
4053
- const handleVariableChange = (index, value) => {
4054
- setInputVariables(inputVariables.map((variable, variableIndex) => variableIndex === index ? value : variable));
4055
- };
4056
- const handleKeyDown = (event) => {
4057
- if (event.key === "Enter") {
4058
- event.preventDefault();
4059
- handleAddVariable();
4060
- }
4061
- };
4062
4003
  const handleSave = () => {
4063
4004
  onSave({ ...config, inputVariables, outputVariable, aggregationMode });
4064
4005
  };
4065
4006
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
4066
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
4067
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300", children: t("inputVariablesLabel") }),
4068
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2", children: [
4069
- /* @__PURE__ */ jsxRuntime.jsx(
4070
- chunk4XID6LOC_js.FormInput,
4071
- {
4072
- type: "text",
4073
- value: newVariable,
4074
- onValueChange: setNewVariable,
4075
- onKeyDown: handleKeyDown,
4076
- placeholder: t("variablePlaceholder"),
4077
- className: "flex-1"
4078
- }
4079
- ),
4080
- /* @__PURE__ */ jsxRuntime.jsx(
4081
- chunk4XID6LOC_js.Button,
4082
- {
4083
- type: "button",
4084
- onClick: handleAddVariable,
4085
- children: t("addInputVariable")
4086
- }
4087
- )
4088
- ] }),
4089
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-3 space-y-2", children: inputVariables.map((variable, index) => /* @__PURE__ */ jsxRuntime.jsx(chunk4XID6LOC_js.Card, { className: "border-purple-200/70 dark:border-purple-500/30", children: /* @__PURE__ */ jsxRuntime.jsx(chunk4XID6LOC_js.CardContent, { className: "p-3", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
4090
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-flex min-w-6 items-center justify-center rounded-full bg-purple-100 px-1.5 py-0.5 text-[10px] font-semibold text-purple-700 dark:bg-purple-500/20 dark:text-purple-300", children: index + 1 }),
4091
- /* @__PURE__ */ jsxRuntime.jsx(
4092
- chunk4XID6LOC_js.FormInput,
4093
- {
4094
- type: "text",
4095
- value: variable,
4096
- onValueChange: (value) => handleVariableChange(index, value),
4097
- placeholder: t("variablePlaceholder"),
4098
- className: "flex-1"
4099
- }
4100
- ),
4101
- /* @__PURE__ */ jsxRuntime.jsx(
4102
- chunk4XID6LOC_js.IconButton,
4103
- {
4104
- icon: /* @__PURE__ */ jsxRuntime.jsx(outline.XMarkIcon, { className: "h-3 w-3" }),
4105
- label: `Remove ${variable || index + 1}`,
4106
- onClick: () => handleRemoveVariable(index),
4107
- size: "sm",
4108
- color: "ios-red"
4109
- }
4110
- )
4111
- ] }) }) }, `${index}-${variable}`)) })
4112
- ] }),
4007
+ /* @__PURE__ */ jsxRuntime.jsx(
4008
+ VariableListEditor,
4009
+ {
4010
+ variables: inputVariables,
4011
+ onChange: setInputVariables,
4012
+ label: t("inputVariablesLabel"),
4013
+ placeholder: t("variablePlaceholder"),
4014
+ addLabel: t("addInputVariable"),
4015
+ color: "purple",
4016
+ numbered: true,
4017
+ editable: true
4018
+ }
4019
+ ),
4113
4020
  /* @__PURE__ */ jsxRuntime.jsx(
4114
4021
  chunk4XID6LOC_js.FormInput,
4115
4022
  {
@@ -7199,5 +7106,5 @@ exports.useModalStore = useModalStore;
7199
7106
  exports.useWorkflowBuilderClient = useWorkflowBuilderClient;
7200
7107
  exports.useWorkflowBuilderClientOptional = useWorkflowBuilderClientOptional;
7201
7108
  exports.useWorkflowStore = useWorkflowStore;
7202
- //# sourceMappingURL=chunk-E7GVGD4Z.js.map
7203
- //# sourceMappingURL=chunk-E7GVGD4Z.js.map
7109
+ //# sourceMappingURL=chunk-TKLALDY4.js.map
7110
+ //# sourceMappingURL=chunk-TKLALDY4.js.map