@datatechsolutions/ui 2.11.20 → 2.11.22

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.
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var chunkBSPRG6ZF_js = require('./chunk-BSPRG6ZF.js');
4
+ var chunk5WFBHIM5_js = require('./chunk-5WFBHIM5.js');
5
5
  var chunkP4YYEM4B_js = require('./chunk-P4YYEM4B.js');
6
6
  var chunkPWBWP5FJ_js = require('./chunk-PWBWP5FJ.js');
7
7
  var chunkYXN2K77G_js = require('./chunk-YXN2K77G.js');
@@ -472,6 +472,24 @@ var MINIMAP_NODE_COLORS = {
472
472
  model_provider: "#64748b",
473
473
  group: "#64748b"
474
474
  };
475
+ var NODE_EXECUTION_ACCENT_COLORS = {
476
+ ...MINIMAP_NODE_COLORS
477
+ };
478
+ function hexToRgb(hexColor) {
479
+ const normalizedHex = hexColor.replace("#", "");
480
+ const parsed = Number.parseInt(normalizedHex, 16);
481
+ if (Number.isNaN(parsed) || normalizedHex.length !== 6) {
482
+ return [99, 102, 241];
483
+ }
484
+ return [parsed >> 16 & 255, parsed >> 8 & 255, parsed & 255];
485
+ }
486
+ function getNodeExecutionAccent(nodeType) {
487
+ return NODE_EXECUTION_ACCENT_COLORS[nodeType ?? ""] ?? NODE_EXECUTION_ACCENT_COLORS.agent;
488
+ }
489
+ function getNodeExecutionAccentRgb(nodeType) {
490
+ const [red, green, blue] = hexToRgb(getNodeExecutionAccent(nodeType));
491
+ return `${red}, ${green}, ${blue}`;
492
+ }
475
493
  var LOGIC_NODE_HANDLE_COLORS = {
476
494
  start: "!bg-green-500",
477
495
  end: "!bg-red-500",
@@ -1246,6 +1264,7 @@ function NodeCard({
1246
1264
  return /* @__PURE__ */ jsxRuntime.jsx(
1247
1265
  "div",
1248
1266
  {
1267
+ "data-workflow-node-type": nodeType,
1249
1268
  className: `group relative ${width} rounded-xl border liquid-surface ${compact ? "min-h-[84px] p-3" : "p-4"} transition-all ${getNodeStateClass(selected, nodeType, customBorder)}${className ? ` ${className}` : ""}`,
1250
1269
  style,
1251
1270
  role,
@@ -1386,17 +1405,48 @@ function WorkflowDynamicHandles({
1386
1405
  }
1387
1406
  function NodeRunningIndicatorComponent({ nodeId }) {
1388
1407
  const nodeResult = useWorkflowStore((state) => state.nodeResults[nodeId]);
1408
+ const containerRef = react.useRef(null);
1409
+ const [nodeType, setNodeType] = react.useState("agent");
1410
+ const accentColor = react.useMemo(() => getNodeExecutionAccent(nodeType), [nodeType]);
1411
+ const accentRgb = react.useMemo(() => getNodeExecutionAccentRgb(nodeType), [nodeType]);
1412
+ react.useEffect(() => {
1413
+ const indicatorElement = containerRef.current;
1414
+ if (!indicatorElement) return;
1415
+ const nodeWrapper = indicatorElement.closest(".react-flow__node");
1416
+ if (!nodeWrapper) return;
1417
+ const wrapperClass = Array.from(nodeWrapper.classList).find(
1418
+ (className) => className.startsWith("react-flow__node-") && className !== "react-flow__node"
1419
+ );
1420
+ if (!wrapperClass) return;
1421
+ setNodeType(wrapperClass.replace("react-flow__node-", ""));
1422
+ }, []);
1389
1423
  if (!nodeResult) return null;
1390
1424
  const { status, durationMs } = nodeResult;
1391
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute -right-1 -top-1 z-10 flex items-center gap-1", children: [
1425
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: containerRef, className: "absolute -right-1 -top-1 z-10 flex items-center gap-1", children: [
1392
1426
  status === "pending" && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex h-5 w-5 items-center justify-center rounded-full border border-gray-300 bg-white shadow-sm dark:border-gray-600 dark:bg-gray-800", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "h-2 w-2 rounded-full bg-gray-400 dark:bg-gray-500" }) }),
1393
- status === "running" && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex h-5 w-5 items-center justify-center rounded-full border border-blue-300 bg-white shadow-sm dark:border-blue-600 dark:bg-gray-800", children: /* @__PURE__ */ jsxRuntime.jsxs("svg", { className: "h-3 w-3 animate-spin text-blue-500", viewBox: "0 0 24 24", fill: "none", children: [
1394
- /* @__PURE__ */ jsxRuntime.jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
1395
- /* @__PURE__ */ jsxRuntime.jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })
1396
- ] }) }),
1397
- status === "success" && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex h-5 w-5 items-center justify-center rounded-full border border-green-300 bg-green-50 shadow-sm dark:border-green-600 dark:bg-green-900/30", children: /* @__PURE__ */ jsxRuntime.jsx("svg", { className: "h-3 w-3 text-green-600 dark:text-green-400", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsxRuntime.jsx("path", { fillRule: "evenodd", d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z", clipRule: "evenodd" }) }) }),
1427
+ status === "running" && /* @__PURE__ */ jsxRuntime.jsx(
1428
+ "span",
1429
+ {
1430
+ className: "flex h-5 w-5 items-center justify-center rounded-full border bg-white shadow-sm dark:bg-gray-800",
1431
+ style: {
1432
+ borderColor: `rgba(${accentRgb}, 0.55)`,
1433
+ boxShadow: `0 0 0 1px rgba(${accentRgb}, 0.16), 0 6px 16px rgba(${accentRgb}, 0.18)`
1434
+ },
1435
+ children: /* @__PURE__ */ jsxRuntime.jsxs("svg", { className: "h-3 w-3 animate-spin", style: { color: accentColor }, viewBox: "0 0 24 24", fill: "none", children: [
1436
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
1437
+ /* @__PURE__ */ jsxRuntime.jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })
1438
+ ] })
1439
+ }
1440
+ ),
1441
+ status === "success" && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex h-5 w-5 items-center justify-center rounded-full border border-emerald-300 bg-emerald-50 shadow-sm dark:border-emerald-600 dark:bg-emerald-900/30", children: /* @__PURE__ */ jsxRuntime.jsx("svg", { className: "h-3 w-3 text-emerald-600 dark:text-emerald-400", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsxRuntime.jsx("path", { fillRule: "evenodd", d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z", clipRule: "evenodd" }) }) }),
1398
1442
  status === "error" && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex h-5 w-5 items-center justify-center rounded-full border border-red-300 bg-red-50 shadow-sm dark:border-red-600 dark:bg-red-900/30", children: /* @__PURE__ */ jsxRuntime.jsx("svg", { className: "h-3 w-3 text-red-600 dark:text-red-400", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsxRuntime.jsx("path", { fillRule: "evenodd", d: "M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z", clipRule: "evenodd" }) }) }),
1399
- (status === "success" || status === "error") && durationMs !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rounded-full bg-gray-100 px-1.5 py-0.5 text-[9px] font-medium text-gray-500 shadow-sm dark:bg-gray-800 dark:text-gray-400", children: durationMs < 1e3 ? `${durationMs}ms` : `${(durationMs / 1e3).toFixed(1)}s` })
1443
+ (status === "success" || status === "error") && durationMs !== void 0 && /* @__PURE__ */ jsxRuntime.jsx(
1444
+ "span",
1445
+ {
1446
+ className: `rounded-full px-1.5 py-0.5 text-[9px] font-medium shadow-sm ${status === "success" ? "bg-emerald-50 text-emerald-700 dark:bg-emerald-900/20 dark:text-emerald-300" : "bg-gray-100 text-gray-500 dark:bg-gray-800 dark:text-gray-400"}`,
1447
+ children: durationMs < 1e3 ? `${durationMs}ms` : `${(durationMs / 1e3).toFixed(1)}s`
1448
+ }
1449
+ )
1400
1450
  ] });
1401
1451
  }
1402
1452
  var NodeRunningIndicator = react.memo(NodeRunningIndicatorComponent);
@@ -2721,7 +2771,7 @@ var NoteFlowNode = react.memo(function NoteFlowNode2({ data, selected }) {
2721
2771
  });
2722
2772
  var DatasourceFlowNode = react.memo(function DatasourceFlowNode2({ id, data, selected }) {
2723
2773
  const t = chunkYXN2K77G_js.useTranslations("agents.workflow");
2724
- const { config, label, onEdit, onRemoveFromCanvas } = data;
2774
+ const { config, label, datasource, readOnly = false, onEdit, onRemoveFromCanvas } = data;
2725
2775
  const isCompact = data.displayMode === "compact";
2726
2776
  if (!config || config.type !== "datasource") {
2727
2777
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
@@ -2741,56 +2791,92 @@ var DatasourceFlowNode = react.memo(function DatasourceFlowNode2({ id, data, sel
2741
2791
  }
2742
2792
  const columnCount = config.selectedColumns?.length ?? 0;
2743
2793
  const filterCount = config.filterVariables ? Object.keys(config.filterVariables).length : 0;
2794
+ const visibleColumns = config.selectedColumns.slice(0, 3);
2795
+ const filterEntries = Object.entries(config.filterVariables ?? {});
2796
+ const content = /* @__PURE__ */ jsxRuntime.jsxs(NodeCard, { compact: isCompact, selected, nodeType: "datasource", children: [
2797
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-3", children: [
2798
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-10 w-10 items-center justify-center rounded-xl bg-gradient-to-br from-cyan-500 to-blue-600 shadow-lg", children: /* @__PURE__ */ jsxRuntime.jsx(outline.ServerStackIcon, { className: "h-5 w-5 text-white" }) }),
2799
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1", children: [
2800
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-sm font-semibold text-gray-900 dark:text-white", children: label }),
2801
+ !isCompact && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "mt-0.5 text-xs text-gray-500 dark:text-gray-400", children: [
2802
+ datasource?.name ?? config.datasourceId,
2803
+ " \xB7 ",
2804
+ config.table
2805
+ ] })
2806
+ ] })
2807
+ ] }),
2808
+ /* @__PURE__ */ jsxRuntime.jsxs(NodeCardMeta, { compact: isCompact, children: [
2809
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
2810
+ config.dialect && /* @__PURE__ */ jsxRuntime.jsx(NodeCardBadge, { className: "inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-semibold bg-cyan-100 text-cyan-700 dark:bg-cyan-900/30 dark:text-cyan-300", children: config.dialect }),
2811
+ readOnly && /* @__PURE__ */ jsxRuntime.jsx(NodeCardBadge, { className: "inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-medium bg-slate-100 text-slate-700 dark:bg-slate-500/20 dark:text-slate-300", children: "Sample Data" }),
2812
+ /* @__PURE__ */ jsxRuntime.jsx(NodeCardBadge, { className: "inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-medium bg-cyan-100 text-cyan-700 dark:bg-cyan-900/30 dark:text-cyan-300", children: config.table }),
2813
+ /* @__PURE__ */ jsxRuntime.jsx(NodeCardBadge, { className: "inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-medium bg-blue-50 text-blue-700 dark:bg-blue-900/25 dark:text-blue-300", children: config.outputVariable }),
2814
+ columnCount > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-[10px] text-gray-400 dark:text-gray-500", children: [
2815
+ columnCount,
2816
+ " ",
2817
+ t("datasourceColumns")
2818
+ ] }),
2819
+ config.limit > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-gray-400 dark:text-gray-500", children: t("datasourceLimit", { count: config.limit }) }),
2820
+ filterCount > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-[10px] text-gray-400 dark:text-gray-500", children: [
2821
+ filterCount,
2822
+ " ",
2823
+ t("datasourceFilters")
2824
+ ] })
2825
+ ] }),
2826
+ !isCompact && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-2 flex flex-wrap items-center gap-1.5", children: [
2827
+ visibleColumns.map((column) => /* @__PURE__ */ jsxRuntime.jsx(
2828
+ NodeCardBadge,
2829
+ {
2830
+ className: "inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-medium bg-white/70 text-slate-600 dark:bg-white/5 dark:text-slate-300",
2831
+ children: column
2832
+ },
2833
+ column
2834
+ )),
2835
+ columnCount > visibleColumns.length && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-[10px] text-gray-400 dark:text-gray-500", children: [
2836
+ "+",
2837
+ columnCount - visibleColumns.length,
2838
+ " more"
2839
+ ] })
2840
+ ] }),
2841
+ !isCompact && filterEntries.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-2 flex flex-wrap items-center gap-1.5", children: filterEntries.map(([field, variableName]) => /* @__PURE__ */ jsxRuntime.jsxs(
2842
+ NodeCardBadge,
2843
+ {
2844
+ className: "inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-medium bg-cyan-50 text-cyan-700 dark:bg-cyan-900/20 dark:text-cyan-300",
2845
+ children: [
2846
+ field,
2847
+ " \u2192 ",
2848
+ variableName
2849
+ ]
2850
+ },
2851
+ `${field}:${variableName}`
2852
+ )) }),
2853
+ onRemoveFromCanvas && /* @__PURE__ */ jsxRuntime.jsx(
2854
+ "span",
2855
+ {
2856
+ role: "button",
2857
+ tabIndex: 0,
2858
+ onClick: (event) => {
2859
+ event.stopPropagation();
2860
+ event.preventDefault();
2861
+ onRemoveFromCanvas(id);
2862
+ },
2863
+ className: "nodrag nopan cursor-pointer rounded-lg p-1 opacity-0 transition hover:bg-red-50 group-hover:opacity-100 dark:hover:bg-red-900/20",
2864
+ "aria-label": t("removeFromCanvas"),
2865
+ children: /* @__PURE__ */ jsxRuntime.jsx(outline.TrashIcon, { className: "h-3.5 w-3.5 text-red-600 dark:text-red-400" })
2866
+ }
2867
+ )
2868
+ ] })
2869
+ ] });
2744
2870
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2745
2871
  /* @__PURE__ */ jsxRuntime.jsx(NodeRunningIndicator, { nodeId: id }),
2746
2872
  /* @__PURE__ */ jsxRuntime.jsx(WorkflowHandle, { type: "target", position: react$1.Position.Left, id: "left-in", colorClass: "!bg-cyan-400" }),
2747
- /* @__PURE__ */ jsxRuntime.jsx(
2873
+ readOnly || !onEdit ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full", children: content }) : /* @__PURE__ */ jsxRuntime.jsx(
2748
2874
  "button",
2749
2875
  {
2750
2876
  type: "button",
2751
- onClick: () => onEdit?.(id),
2877
+ onClick: () => onEdit(id),
2752
2878
  className: "w-full text-left",
2753
- children: /* @__PURE__ */ jsxRuntime.jsxs(NodeCard, { compact: isCompact, selected, nodeType: "datasource", children: [
2754
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-3", children: [
2755
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-10 w-10 items-center justify-center rounded-xl bg-gradient-to-br from-cyan-500 to-blue-600 shadow-lg", children: /* @__PURE__ */ jsxRuntime.jsx(outline.ServerStackIcon, { className: "h-5 w-5 text-white" }) }),
2756
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1", children: [
2757
- /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-sm font-semibold text-gray-900 dark:text-white", children: label }),
2758
- !isCompact && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-0.5 text-xs text-gray-500 dark:text-gray-400", children: config.table ?? config.datasourceId })
2759
- ] })
2760
- ] }),
2761
- /* @__PURE__ */ jsxRuntime.jsxs(NodeCardMeta, { compact: isCompact, children: [
2762
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
2763
- config.dialect && /* @__PURE__ */ jsxRuntime.jsx(NodeCardBadge, { className: "inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-semibold bg-cyan-100 text-cyan-700 dark:bg-cyan-900/30 dark:text-cyan-300", children: config.dialect }),
2764
- config.table && /* @__PURE__ */ jsxRuntime.jsx(NodeCardBadge, { className: "inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-medium bg-cyan-100 text-cyan-700 dark:bg-cyan-900/30 dark:text-cyan-300", children: config.table }),
2765
- columnCount > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-[10px] text-gray-400 dark:text-gray-500", children: [
2766
- columnCount,
2767
- " ",
2768
- t("datasourceColumns")
2769
- ] }),
2770
- config.limit > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-gray-400 dark:text-gray-500", children: t("datasourceLimit", { count: config.limit }) }),
2771
- filterCount > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-[10px] text-gray-400 dark:text-gray-500", children: [
2772
- filterCount,
2773
- " ",
2774
- t("datasourceFilters")
2775
- ] })
2776
- ] }),
2777
- onRemoveFromCanvas && /* @__PURE__ */ jsxRuntime.jsx(
2778
- "span",
2779
- {
2780
- role: "button",
2781
- tabIndex: 0,
2782
- onClick: (event) => {
2783
- event.stopPropagation();
2784
- event.preventDefault();
2785
- onRemoveFromCanvas(id);
2786
- },
2787
- className: "nodrag nopan cursor-pointer rounded-lg p-1 opacity-0 transition hover:bg-red-50 group-hover:opacity-100 dark:hover:bg-red-900/20",
2788
- "aria-label": t("removeFromCanvas"),
2789
- children: /* @__PURE__ */ jsxRuntime.jsx(outline.TrashIcon, { className: "h-3.5 w-3.5 text-red-600 dark:text-red-400" })
2790
- }
2791
- )
2792
- ] })
2793
- ] })
2879
+ children: content
2794
2880
  }
2795
2881
  ),
2796
2882
  /* @__PURE__ */ jsxRuntime.jsx(WorkflowHandle, { type: "source", position: react$1.Position.Right, id: "right-out", colorClass: "!bg-cyan-400" })
@@ -3068,8 +3154,8 @@ function ConfigFormActions({
3068
3154
  saveDisabled = false
3069
3155
  }) {
3070
3156
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2 border-t border-gray-200 pt-4 dark:border-gray-700", children: [
3071
- /* @__PURE__ */ jsxRuntime.jsx(chunkBSPRG6ZF_js.Button, { type: "button", outline: true, onClick: onCancel, children: cancelLabel }),
3072
- /* @__PURE__ */ jsxRuntime.jsx(chunkBSPRG6ZF_js.Button, { type: "button", onClick: onSave, disabled: saveDisabled, children: saveLabel })
3157
+ /* @__PURE__ */ jsxRuntime.jsx(chunk5WFBHIM5_js.Button, { type: "button", outline: true, onClick: onCancel, children: cancelLabel }),
3158
+ /* @__PURE__ */ jsxRuntime.jsx(chunk5WFBHIM5_js.Button, { type: "button", onClick: onSave, disabled: saveDisabled, children: saveLabel })
3073
3159
  ] });
3074
3160
  }
3075
3161
  var COLOR_CLASSES = {
@@ -3316,7 +3402,7 @@ function IfElseNodeConfigForm({ config, onSave, onCancel }) {
3316
3402
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-3 flex items-center justify-between", children: [
3317
3403
  /* @__PURE__ */ jsxRuntime.jsx("label", { className: "text-sm font-medium text-gray-700 dark:text-gray-300", children: t("conditionsLabel") }),
3318
3404
  /* @__PURE__ */ jsxRuntime.jsx(
3319
- chunkBSPRG6ZF_js.Button,
3405
+ chunk5WFBHIM5_js.Button,
3320
3406
  {
3321
3407
  type: "button",
3322
3408
  onClick: handleAddCondition,
@@ -3327,7 +3413,7 @@ function IfElseNodeConfigForm({ config, onSave, onCancel }) {
3327
3413
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-3", children: conditions.map((condition, index) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-2 rounded-lg border border-gray-200 bg-gray-50 p-3 dark:border-gray-700 dark:bg-gray-800/50", children: [
3328
3414
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid flex-1 grid-cols-3 gap-2", children: [
3329
3415
  /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(
3330
- chunkBSPRG6ZF_js.FormInput,
3416
+ chunk5WFBHIM5_js.FormInput,
3331
3417
  {
3332
3418
  type: "text",
3333
3419
  label: t("variableLabel"),
@@ -3338,7 +3424,7 @@ function IfElseNodeConfigForm({ config, onSave, onCancel }) {
3338
3424
  }
3339
3425
  ) }),
3340
3426
  /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(
3341
- chunkBSPRG6ZF_js.FormSelect,
3427
+ chunk5WFBHIM5_js.FormSelect,
3342
3428
  {
3343
3429
  label: t("operatorLabel"),
3344
3430
  value: condition.operator,
@@ -3348,7 +3434,7 @@ function IfElseNodeConfigForm({ config, onSave, onCancel }) {
3348
3434
  }
3349
3435
  ) }),
3350
3436
  /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(
3351
- chunkBSPRG6ZF_js.FormInput,
3437
+ chunk5WFBHIM5_js.FormInput,
3352
3438
  {
3353
3439
  type: "text",
3354
3440
  label: t("valueLabel"),
@@ -3360,7 +3446,7 @@ function IfElseNodeConfigForm({ config, onSave, onCancel }) {
3360
3446
  ) })
3361
3447
  ] }),
3362
3448
  conditions.length > 1 && /* @__PURE__ */ jsxRuntime.jsx(
3363
- chunkBSPRG6ZF_js.IconButton,
3449
+ chunk5WFBHIM5_js.IconButton,
3364
3450
  {
3365
3451
  onClick: () => handleRemoveCondition(index),
3366
3452
  icon: /* @__PURE__ */ jsxRuntime.jsx(outline.TrashIcon, { className: "h-4 w-4" }),
@@ -3515,7 +3601,7 @@ function HttpRequestNodeConfigForm({ config, onSave, onCancel }) {
3515
3601
  };
3516
3602
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
3517
3603
  /* @__PURE__ */ jsxRuntime.jsx(
3518
- chunkBSPRG6ZF_js.FormSelect,
3604
+ chunk5WFBHIM5_js.FormSelect,
3519
3605
  {
3520
3606
  label: t("methodLabel"),
3521
3607
  value: method,
@@ -3524,7 +3610,7 @@ function HttpRequestNodeConfigForm({ config, onSave, onCancel }) {
3524
3610
  }
3525
3611
  ),
3526
3612
  /* @__PURE__ */ jsxRuntime.jsx(
3527
- chunkBSPRG6ZF_js.FormInput,
3613
+ chunk5WFBHIM5_js.FormInput,
3528
3614
  {
3529
3615
  type: "text",
3530
3616
  label: t("urlLabel"),
@@ -3537,7 +3623,7 @@ function HttpRequestNodeConfigForm({ config, onSave, onCancel }) {
3537
3623
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-2 flex items-center justify-between", children: [
3538
3624
  /* @__PURE__ */ jsxRuntime.jsx("label", { className: "text-sm font-medium text-gray-700 dark:text-gray-300", children: t("headersLabel") }),
3539
3625
  /* @__PURE__ */ jsxRuntime.jsx(
3540
- chunkBSPRG6ZF_js.Button,
3626
+ chunk5WFBHIM5_js.Button,
3541
3627
  {
3542
3628
  type: "button",
3543
3629
  onClick: handleAddHeader,
@@ -3547,7 +3633,7 @@ function HttpRequestNodeConfigForm({ config, onSave, onCancel }) {
3547
3633
  ] }),
3548
3634
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-2", children: headerEntries.map((entry, index) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
3549
3635
  /* @__PURE__ */ jsxRuntime.jsx(
3550
- chunkBSPRG6ZF_js.FormInput,
3636
+ chunk5WFBHIM5_js.FormInput,
3551
3637
  {
3552
3638
  type: "text",
3553
3639
  value: entry.key,
@@ -3557,7 +3643,7 @@ function HttpRequestNodeConfigForm({ config, onSave, onCancel }) {
3557
3643
  }
3558
3644
  ),
3559
3645
  /* @__PURE__ */ jsxRuntime.jsx(
3560
- chunkBSPRG6ZF_js.FormInput,
3646
+ chunk5WFBHIM5_js.FormInput,
3561
3647
  {
3562
3648
  type: "text",
3563
3649
  value: entry.value,
@@ -3567,7 +3653,7 @@ function HttpRequestNodeConfigForm({ config, onSave, onCancel }) {
3567
3653
  }
3568
3654
  ),
3569
3655
  /* @__PURE__ */ jsxRuntime.jsx(
3570
- chunkBSPRG6ZF_js.IconButton,
3656
+ chunk5WFBHIM5_js.IconButton,
3571
3657
  {
3572
3658
  onClick: () => handleRemoveHeader(index),
3573
3659
  icon: /* @__PURE__ */ jsxRuntime.jsx(outline.TrashIcon, { className: "h-4 w-4" }),
@@ -3579,7 +3665,7 @@ function HttpRequestNodeConfigForm({ config, onSave, onCancel }) {
3579
3665
  ] }, index)) })
3580
3666
  ] }),
3581
3667
  method !== "GET" && /* @__PURE__ */ jsxRuntime.jsx(
3582
- chunkBSPRG6ZF_js.FormTextarea,
3668
+ chunk5WFBHIM5_js.FormTextarea,
3583
3669
  {
3584
3670
  label: t("bodyLabel"),
3585
3671
  value: body,
@@ -3590,7 +3676,7 @@ function HttpRequestNodeConfigForm({ config, onSave, onCancel }) {
3590
3676
  }
3591
3677
  ),
3592
3678
  /* @__PURE__ */ jsxRuntime.jsx(
3593
- chunkBSPRG6ZF_js.FormInput,
3679
+ chunk5WFBHIM5_js.FormInput,
3594
3680
  {
3595
3681
  type: "number",
3596
3682
  label: t("timeoutLabel"),
@@ -3621,7 +3707,7 @@ function TemplateTransformNodeConfigForm({ config, onSave, onCancel }) {
3621
3707
  };
3622
3708
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
3623
3709
  /* @__PURE__ */ jsxRuntime.jsx(
3624
- chunkBSPRG6ZF_js.FormTextarea,
3710
+ chunk5WFBHIM5_js.FormTextarea,
3625
3711
  {
3626
3712
  label: t("templateLabel"),
3627
3713
  value: template,
@@ -3632,7 +3718,7 @@ function TemplateTransformNodeConfigForm({ config, onSave, onCancel }) {
3632
3718
  }
3633
3719
  ),
3634
3720
  /* @__PURE__ */ jsxRuntime.jsx(
3635
- chunkBSPRG6ZF_js.FormInput,
3721
+ chunk5WFBHIM5_js.FormInput,
3636
3722
  {
3637
3723
  type: "text",
3638
3724
  label: t("outputVariableLabel"),
@@ -3661,7 +3747,7 @@ function IterationNodeConfigForm({ config, onSave, onCancel }) {
3661
3747
  };
3662
3748
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
3663
3749
  /* @__PURE__ */ jsxRuntime.jsx(
3664
- chunkBSPRG6ZF_js.FormInput,
3750
+ chunk5WFBHIM5_js.FormInput,
3665
3751
  {
3666
3752
  type: "text",
3667
3753
  label: t("iteratorVariableLabel"),
@@ -3671,7 +3757,7 @@ function IterationNodeConfigForm({ config, onSave, onCancel }) {
3671
3757
  }
3672
3758
  ),
3673
3759
  /* @__PURE__ */ jsxRuntime.jsx(
3674
- chunkBSPRG6ZF_js.FormInput,
3760
+ chunk5WFBHIM5_js.FormInput,
3675
3761
  {
3676
3762
  type: "number",
3677
3763
  label: t("maxIterationsLabel"),
@@ -3702,7 +3788,7 @@ function KnowledgeBaseNodeConfigForm({ config, onSave, onCancel }) {
3702
3788
  };
3703
3789
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
3704
3790
  /* @__PURE__ */ jsxRuntime.jsx(
3705
- chunkBSPRG6ZF_js.FormInput,
3791
+ chunk5WFBHIM5_js.FormInput,
3706
3792
  {
3707
3793
  type: "text",
3708
3794
  label: t("sourceIdLabel"),
@@ -3712,7 +3798,7 @@ function KnowledgeBaseNodeConfigForm({ config, onSave, onCancel }) {
3712
3798
  }
3713
3799
  ),
3714
3800
  /* @__PURE__ */ jsxRuntime.jsx(
3715
- chunkBSPRG6ZF_js.FormInput,
3801
+ chunk5WFBHIM5_js.FormInput,
3716
3802
  {
3717
3803
  type: "number",
3718
3804
  label: t("topKLabel"),
@@ -3723,7 +3809,7 @@ function KnowledgeBaseNodeConfigForm({ config, onSave, onCancel }) {
3723
3809
  }
3724
3810
  ),
3725
3811
  /* @__PURE__ */ jsxRuntime.jsx(
3726
- chunkBSPRG6ZF_js.FormInput,
3812
+ chunk5WFBHIM5_js.FormInput,
3727
3813
  {
3728
3814
  type: "number",
3729
3815
  label: t("similarityThresholdLabel"),
@@ -3754,7 +3840,7 @@ function AnswerNodeConfigForm({ config, onSave, onCancel }) {
3754
3840
  };
3755
3841
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
3756
3842
  /* @__PURE__ */ jsxRuntime.jsx(
3757
- chunkBSPRG6ZF_js.FormTextarea,
3843
+ chunk5WFBHIM5_js.FormTextarea,
3758
3844
  {
3759
3845
  label: t("outputTemplateLabel"),
3760
3846
  hint: t("outputTemplateHelp"),
@@ -4188,7 +4274,7 @@ function VariableAggregatorNodeConfigForm({ config, onSave, onCancel }) {
4188
4274
  }
4189
4275
  ),
4190
4276
  /* @__PURE__ */ jsxRuntime.jsx(
4191
- chunkBSPRG6ZF_js.FormInput,
4277
+ chunk5WFBHIM5_js.FormInput,
4192
4278
  {
4193
4279
  type: "text",
4194
4280
  label: t("outputVariableLabel"),
@@ -4198,7 +4284,7 @@ function VariableAggregatorNodeConfigForm({ config, onSave, onCancel }) {
4198
4284
  }
4199
4285
  ),
4200
4286
  /* @__PURE__ */ jsxRuntime.jsx(
4201
- chunkBSPRG6ZF_js.FormSelect,
4287
+ chunk5WFBHIM5_js.FormSelect,
4202
4288
  {
4203
4289
  label: t("aggregationModeLabel"),
4204
4290
  value: aggregationMode,
@@ -4231,7 +4317,7 @@ function DocumentExtractorNodeConfigForm({ config, onSave, onCancel }) {
4231
4317
  };
4232
4318
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
4233
4319
  /* @__PURE__ */ jsxRuntime.jsx(
4234
- chunkBSPRG6ZF_js.FormSelect,
4320
+ chunk5WFBHIM5_js.FormSelect,
4235
4321
  {
4236
4322
  label: t("extractionModeLabel"),
4237
4323
  value: extractionMode,
@@ -4240,7 +4326,7 @@ function DocumentExtractorNodeConfigForm({ config, onSave, onCancel }) {
4240
4326
  }
4241
4327
  ),
4242
4328
  /* @__PURE__ */ jsxRuntime.jsx(
4243
- chunkBSPRG6ZF_js.FormInput,
4329
+ chunk5WFBHIM5_js.FormInput,
4244
4330
  {
4245
4331
  type: "text",
4246
4332
  label: t("outputVariableLabel"),
@@ -4417,7 +4503,7 @@ function IterationStartNodeConfigForm({ config, onSave, onCancel }) {
4417
4503
  };
4418
4504
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
4419
4505
  /* @__PURE__ */ jsxRuntime.jsx(
4420
- chunkBSPRG6ZF_js.FormInput,
4506
+ chunk5WFBHIM5_js.FormInput,
4421
4507
  {
4422
4508
  type: "text",
4423
4509
  label: t("iteratorVariableLabel"),
@@ -4427,7 +4513,7 @@ function IterationStartNodeConfigForm({ config, onSave, onCancel }) {
4427
4513
  }
4428
4514
  ),
4429
4515
  /* @__PURE__ */ jsxRuntime.jsx(
4430
- chunkBSPRG6ZF_js.FormInput,
4516
+ chunk5WFBHIM5_js.FormInput,
4431
4517
  {
4432
4518
  type: "text",
4433
4519
  label: t("itemVariableLabel"),
@@ -4437,7 +4523,7 @@ function IterationStartNodeConfigForm({ config, onSave, onCancel }) {
4437
4523
  }
4438
4524
  ),
4439
4525
  /* @__PURE__ */ jsxRuntime.jsx(
4440
- chunkBSPRG6ZF_js.FormInput,
4526
+ chunk5WFBHIM5_js.FormInput,
4441
4527
  {
4442
4528
  type: "text",
4443
4529
  label: t("indexVariableLabel"),
@@ -5031,7 +5117,7 @@ function GroupNodeConfigForm({ config, onSave, onCancel }) {
5031
5117
  };
5032
5118
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
5033
5119
  /* @__PURE__ */ jsxRuntime.jsx(
5034
- chunkBSPRG6ZF_js.FormInput,
5120
+ chunk5WFBHIM5_js.FormInput,
5035
5121
  {
5036
5122
  type: "text",
5037
5123
  label: translations("labelField"),
@@ -5041,7 +5127,7 @@ function GroupNodeConfigForm({ config, onSave, onCancel }) {
5041
5127
  }
5042
5128
  ),
5043
5129
  /* @__PURE__ */ jsxRuntime.jsx(
5044
- chunkBSPRG6ZF_js.FormTextarea,
5130
+ chunk5WFBHIM5_js.FormTextarea,
5045
5131
  {
5046
5132
  label: translations("descriptionField"),
5047
5133
  value: description,
@@ -5199,7 +5285,7 @@ function ModelProviderNodeConfigForm({ config, onSave, onCancel }) {
5199
5285
  };
5200
5286
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
5201
5287
  /* @__PURE__ */ jsxRuntime.jsx(
5202
- chunkBSPRG6ZF_js.FormInput,
5288
+ chunk5WFBHIM5_js.FormInput,
5203
5289
  {
5204
5290
  type: "text",
5205
5291
  label: t("nameLabel"),
@@ -5209,7 +5295,7 @@ function ModelProviderNodeConfigForm({ config, onSave, onCancel }) {
5209
5295
  }
5210
5296
  ),
5211
5297
  /* @__PURE__ */ jsxRuntime.jsx(
5212
- chunkBSPRG6ZF_js.FormSelect,
5298
+ chunk5WFBHIM5_js.FormSelect,
5213
5299
  {
5214
5300
  label: t("providerTypeLabel"),
5215
5301
  value: providerType,
@@ -5218,7 +5304,7 @@ function ModelProviderNodeConfigForm({ config, onSave, onCancel }) {
5218
5304
  }
5219
5305
  ),
5220
5306
  showRegion && /* @__PURE__ */ jsxRuntime.jsx(
5221
- chunkBSPRG6ZF_js.FormSelect,
5307
+ chunk5WFBHIM5_js.FormSelect,
5222
5308
  {
5223
5309
  label: t("regionLabel"),
5224
5310
  value: region,
@@ -5227,7 +5313,7 @@ function ModelProviderNodeConfigForm({ config, onSave, onCancel }) {
5227
5313
  }
5228
5314
  ),
5229
5315
  showEndpoint && /* @__PURE__ */ jsxRuntime.jsx(
5230
- chunkBSPRG6ZF_js.FormInput,
5316
+ chunk5WFBHIM5_js.FormInput,
5231
5317
  {
5232
5318
  type: "text",
5233
5319
  label: t("endpointLabel"),
@@ -5237,7 +5323,7 @@ function ModelProviderNodeConfigForm({ config, onSave, onCancel }) {
5237
5323
  }
5238
5324
  ),
5239
5325
  showApiKey && /* @__PURE__ */ jsxRuntime.jsx(
5240
- chunkBSPRG6ZF_js.FormInput,
5326
+ chunk5WFBHIM5_js.FormInput,
5241
5327
  {
5242
5328
  type: "password",
5243
5329
  label: t("apiKeyLabel"),
@@ -5247,7 +5333,7 @@ function ModelProviderNodeConfigForm({ config, onSave, onCancel }) {
5247
5333
  }
5248
5334
  ),
5249
5335
  showCredentialRef && /* @__PURE__ */ jsxRuntime.jsx(
5250
- chunkBSPRG6ZF_js.FormInput,
5336
+ chunk5WFBHIM5_js.FormInput,
5251
5337
  {
5252
5338
  type: "text",
5253
5339
  label: t("credentialRefLabel"),
@@ -5391,7 +5477,7 @@ function LogicNodeModal({ onSave, entities = [], datasources = [], onLoadTables,
5391
5477
  }
5392
5478
  };
5393
5479
  return /* @__PURE__ */ jsxRuntime.jsx(
5394
- chunkBSPRG6ZF_js.GlassModalShell,
5480
+ chunk5WFBHIM5_js.GlassModalShell,
5395
5481
  {
5396
5482
  open,
5397
5483
  onClose: closeModal,
@@ -5451,7 +5537,7 @@ function NodeContextMenu({ position, targetId, onClose, onEdit, onDuplicate, onC
5451
5537
  }
5452
5538
  ];
5453
5539
  return /* @__PURE__ */ jsxRuntime.jsx(
5454
- chunkBSPRG6ZF_js.ContextMenu,
5540
+ chunk5WFBHIM5_js.ContextMenu,
5455
5541
  {
5456
5542
  position,
5457
5543
  onClose,
@@ -5508,7 +5594,7 @@ function PanelContextMenu({ position, onClose, onPaste, onSelectAll, onFitView,
5508
5594
  }
5509
5595
  ];
5510
5596
  return /* @__PURE__ */ jsxRuntime.jsx(
5511
- chunkBSPRG6ZF_js.ContextMenu,
5597
+ chunk5WFBHIM5_js.ContextMenu,
5512
5598
  {
5513
5599
  position,
5514
5600
  onClose,
@@ -5655,7 +5741,7 @@ function SelectionContextMenu({
5655
5741
  }
5656
5742
  ];
5657
5743
  return /* @__PURE__ */ jsxRuntime.jsx(
5658
- chunkBSPRG6ZF_js.ContextMenu,
5744
+ chunk5WFBHIM5_js.ContextMenu,
5659
5745
  {
5660
5746
  position,
5661
5747
  onClose,
@@ -6063,6 +6149,28 @@ function WorkflowCanvasInner({
6063
6149
  }
6064
6150
  };
6065
6151
  }
6152
+ if (savedNode.type === "datasource") {
6153
+ const datasourceConfig = savedNode.data.config;
6154
+ const datasourceEntity = datasourceConfig ? entityMap.get(datasourceConfig.datasourceId) : void 0;
6155
+ const extendedNodeData = savedNode.data;
6156
+ return {
6157
+ id: savedNode.id,
6158
+ type: "datasource",
6159
+ position: savedNode.position,
6160
+ data: {
6161
+ config: datasourceConfig,
6162
+ datasource: datasourceEntity ? {
6163
+ id: datasourceEntity.id,
6164
+ name: datasourceEntity.label,
6165
+ dialect: datasourceConfig?.dialect ?? "unknown"
6166
+ } : void 0,
6167
+ label: savedNode.data.label,
6168
+ readOnly: extendedNodeData.readOnly === true,
6169
+ onEdit: extendedNodeData.readOnly === true ? void 0 : handleEditLogicNode,
6170
+ onRemoveFromCanvas: handleRemoveNodeFromCanvas
6171
+ }
6172
+ };
6173
+ }
6066
6174
  if (savedNode.type === "group") {
6067
6175
  const groupConfig = savedNode.data.config;
6068
6176
  const defaultGroupConfig = {
@@ -7471,6 +7579,7 @@ exports.ListOperatorFlowNode = ListOperatorFlowNode;
7471
7579
  exports.LogicNodeModal = LogicNodeModal;
7472
7580
  exports.MINIMAP_NODE_COLORS = MINIMAP_NODE_COLORS;
7473
7581
  exports.ModelProviderFlowNode = ModelProviderFlowNode;
7582
+ exports.NODE_EXECUTION_ACCENT_COLORS = NODE_EXECUTION_ACCENT_COLORS;
7474
7583
  exports.NodeCard = NodeCard;
7475
7584
  exports.NodeContextMenu = NodeContextMenu;
7476
7585
  exports.NoteFlowNode = NoteFlowNode;
@@ -7497,11 +7606,13 @@ exports.getEntityHandleColor = getEntityHandleColor;
7497
7606
  exports.getEntityIcon = getEntityIcon;
7498
7607
  exports.getEntityMinimapColor = getEntityMinimapColor;
7499
7608
  exports.getFrameworkMeta = getFrameworkMeta;
7609
+ exports.getNodeExecutionAccent = getNodeExecutionAccent;
7610
+ exports.getNodeExecutionAccentRgb = getNodeExecutionAccentRgb;
7500
7611
  exports.isFrameworkCompatibleWithProviders = isFrameworkCompatibleWithProviders;
7501
7612
  exports.isModelCompatibleWithFramework = isModelCompatibleWithFramework;
7502
7613
  exports.useModalStore = useModalStore;
7503
7614
  exports.useWorkflowBuilderClient = useWorkflowBuilderClient;
7504
7615
  exports.useWorkflowBuilderClientOptional = useWorkflowBuilderClientOptional;
7505
7616
  exports.useWorkflowStore = useWorkflowStore;
7506
- //# sourceMappingURL=chunk-GMGTX3TB.js.map
7507
- //# sourceMappingURL=chunk-GMGTX3TB.js.map
7617
+ //# sourceMappingURL=chunk-ITFBJSHZ.js.map
7618
+ //# sourceMappingURL=chunk-ITFBJSHZ.js.map