@datatechsolutions/ui 2.11.41 → 2.11.43

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,5 +1,5 @@
1
1
  "use client";
2
- import { ToggleSwitch, GlassModal, ContextMenu, FormInput, FormSelect, FormTextarea, Button, IconButton } from './chunk-MDD6H63O.mjs';
2
+ import { ToggleSwitch, GlassModal, ContextMenu, FormInput, FormSelect, FormTextarea, Button, IconButton } from './chunk-DNGI4ASL.mjs';
3
3
  import { useTranslations, I18nProvider, createI18nFromMessages } from './chunk-7VJ7CMMT.mjs';
4
4
  import { GraphNodeHeader, GraphNodeMeta, GraphNodeBadge, GraphNodeIconBubble } from './chunk-OZNTQROP.mjs';
5
5
  import { getAgentTier, createDefaultLogicNodeConfig, applyDagreLayout } from './chunk-TLPPVL3W.mjs';
@@ -8,7 +8,7 @@ import { Position, NodeResizer, MarkerType, useReactFlow, getBezierPath, BaseEdg
8
8
  import '@xyflow/react/dist/style.css';
9
9
  import { create } from 'zustand';
10
10
  import { PlusIcon, XMarkIcon } from '@heroicons/react/24/solid';
11
- import { Bars2Icon, CursorArrowRaysIcon, HandRaisedIcon, MagnifyingGlassPlusIcon, MagnifyingGlassMinusIcon, ArrowsPointingInIcon, ArrowUturnLeftIcon, ArrowUturnRightIcon, MapIcon, EllipsisHorizontalIcon, Squares2X2Icon, ArrowsRightLeftIcon, CommandLineIcon, ExclamationTriangleIcon, CpuChipIcon, TrashIcon, WrenchScrewdriverIcon, NewspaperIcon, ChartBarIcon, CloudIcon, ScaleIcon, AdjustmentsHorizontalIcon, CircleStackIcon, PlayIcon, StopIcon, ArrowsPointingOutIcon, CodeBracketIcon, GlobeAltIcon, DocumentTextIcon, ArrowPathIcon, BookOpenIcon, ChatBubbleLeftRightIcon, QuestionMarkCircleIcon, AdjustmentsVerticalIcon, Square3Stack3DIcon, DocumentMagnifyingGlassIcon, ListBulletIcon, PlayCircleIcon, PencilSquareIcon, ServerStackIcon, KeyIcon, RectangleGroupIcon, ChevronDownIcon, ChevronUpIcon, PresentationChartBarIcon, ChartPieIcon, ChartBarSquareIcon, CurrencyDollarIcon, ShieldCheckIcon, ClipboardDocumentCheckIcon, FireIcon, ShoppingBagIcon, UsersIcon, BuildingStorefrontIcon, PencilIcon, DocumentDuplicateIcon, ClipboardDocumentIcon, ClipboardIcon, PlusIcon as PlusIcon$1, XMarkIcon as XMarkIcon$1 } from '@heroicons/react/24/outline';
11
+ import { Bars2Icon, CursorArrowRaysIcon, HandRaisedIcon, MagnifyingGlassPlusIcon, MagnifyingGlassMinusIcon, ArrowsPointingInIcon, ArrowUturnLeftIcon, ArrowUturnRightIcon, MapIcon, EllipsisHorizontalIcon, Squares2X2Icon, ArrowsRightLeftIcon, CommandLineIcon, ExclamationTriangleIcon, CpuChipIcon, TrashIcon, WrenchScrewdriverIcon, NewspaperIcon, ChartBarIcon, CloudIcon, ScaleIcon, AdjustmentsHorizontalIcon, CircleStackIcon, PlayIcon, StopIcon, ArrowsPointingOutIcon, CodeBracketIcon, GlobeAltIcon, DocumentTextIcon, ArrowPathIcon, BookOpenIcon, ChatBubbleLeftRightIcon, QuestionMarkCircleIcon, AdjustmentsVerticalIcon, Square3Stack3DIcon, DocumentMagnifyingGlassIcon, ListBulletIcon, PlayCircleIcon, PencilSquareIcon, ServerStackIcon, KeyIcon, RectangleGroupIcon, ChevronDownIcon, ChevronUpIcon, PresentationChartBarIcon, ChartPieIcon, ChartBarSquareIcon, CurrencyDollarIcon, ShieldCheckIcon, ClipboardDocumentCheckIcon, FireIcon, ShoppingBagIcon, UsersIcon, BuildingStorefrontIcon, PencilIcon, DocumentDuplicateIcon, ClipboardDocumentIcon, ClipboardIcon, PlusIcon as PlusIcon$1, XMarkIcon as XMarkIcon$1, CheckIcon, TableCellsIcon, MagnifyingGlassIcon, VariableIcon, FunnelIcon } from '@heroicons/react/24/outline';
12
12
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
13
13
 
14
14
  var DEFAULT_PASTE_OFFSET = 40;
@@ -2847,7 +2847,18 @@ var DATASOURCE_LOGOS = {
2847
2847
  mysql: "/logos/datasources/mysql.svg",
2848
2848
  clickhouse: "/logos/datasources/clickhouse.svg",
2849
2849
  elasticsearch: "/logos/datasources/elasticsearch.svg",
2850
- duckdb: "/logos/datasources/duckdb.svg"
2850
+ duckdb: "/logos/datasources/duckdb.svg",
2851
+ sqlite: "/logos/datasources/sqlite.svg",
2852
+ mariadb: "/logos/datasources/mariadb.svg",
2853
+ oracle: "/logos/datasources/oracle.svg",
2854
+ mssql: "/logos/datasources/mssql.svg",
2855
+ sqlserver: "/logos/datasources/mssql.svg",
2856
+ cassandra: "/logos/datasources/cassandra.svg",
2857
+ dynamodb: "/logos/datasources/dynamodb.svg",
2858
+ cockroach: "/logos/datasources/cockroachdb.svg",
2859
+ supabase: "/logos/datasources/supabase.svg",
2860
+ firebase: "/logos/datasources/firebase.svg",
2861
+ neo4j: "/logos/datasources/neo4j.svg"
2851
2862
  };
2852
2863
  function getDatasourceLogo(datasourceId, dialect) {
2853
2864
  const search = (dialect ?? datasourceId).toLowerCase();
@@ -2882,7 +2893,7 @@ var DatasourceFlowNode = memo(function DatasourceFlowNode2({ id, data, selected
2882
2893
  const content = /* @__PURE__ */ jsxs(NodeCard, { compact: isCompact, selected, nodeType: "datasource", children: [
2883
2894
  /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between", children: [
2884
2895
  /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
2885
- /* @__PURE__ */ 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: logo ? /* @__PURE__ */ jsx("img", { src: logo, alt: config.dialect ?? "", className: "h-5 w-5" }) : /* @__PURE__ */ jsx(ServerStackIcon, { className: "h-5 w-5 text-white" }) }),
2896
+ logo ? /* @__PURE__ */ jsx("div", { className: "flex h-10 w-10 items-center justify-center rounded-xl", children: /* @__PURE__ */ jsx("img", { src: logo, alt: config.dialect ?? "", className: "h-8 w-8" }) }) : /* @__PURE__ */ 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__ */ jsx(ServerStackIcon, { className: "h-5 w-5 text-white" }) }),
2886
2897
  /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
2887
2898
  /* @__PURE__ */ jsx("h3", { className: "text-sm font-semibold text-gray-900 dark:text-white", children: label }),
2888
2899
  !isCompact && /* @__PURE__ */ jsxs("p", { className: "mt-0.5 line-clamp-1 text-xs text-gray-500 dark:text-gray-400", children: [
@@ -4846,24 +4857,61 @@ function EntityNodeConfigForm({ config, entities = [], onSave, onCancel }) {
4846
4857
  ] })
4847
4858
  ] });
4848
4859
  }
4849
- var COLUMN_TYPE_BADGE_COLORS = {
4850
- string: "bg-gray-100 text-gray-600 dark:bg-gray-500/20 dark:text-gray-300",
4851
- varchar: "bg-gray-100 text-gray-600 dark:bg-gray-500/20 dark:text-gray-300",
4852
- text: "bg-gray-100 text-gray-600 dark:bg-gray-500/20 dark:text-gray-300",
4853
- integer: "bg-blue-100 text-blue-600 dark:bg-blue-500/20 dark:text-blue-300",
4854
- int: "bg-blue-100 text-blue-600 dark:bg-blue-500/20 dark:text-blue-300",
4855
- bigint: "bg-blue-100 text-blue-600 dark:bg-blue-500/20 dark:text-blue-300",
4856
- number: "bg-blue-100 text-blue-600 dark:bg-blue-500/20 dark:text-blue-300",
4857
- decimal: "bg-blue-100 text-blue-600 dark:bg-blue-500/20 dark:text-blue-300",
4858
- float: "bg-blue-100 text-blue-600 dark:bg-blue-500/20 dark:text-blue-300",
4859
- boolean: "bg-green-100 text-green-600 dark:bg-green-500/20 dark:text-green-300",
4860
- date: "bg-amber-100 text-amber-600 dark:bg-amber-500/20 dark:text-amber-300",
4861
- timestamp: "bg-amber-100 text-amber-600 dark:bg-amber-500/20 dark:text-amber-300",
4862
- datetime: "bg-amber-100 text-amber-600 dark:bg-amber-500/20 dark:text-amber-300",
4863
- json: "bg-purple-100 text-purple-600 dark:bg-purple-500/20 dark:text-purple-300",
4864
- jsonb: "bg-purple-100 text-purple-600 dark:bg-purple-500/20 dark:text-purple-300",
4865
- uuid: "bg-teal-100 text-teal-600 dark:bg-teal-500/20 dark:text-teal-300"
4860
+ var DATASOURCE_LOGOS2 = {
4861
+ bigquery: "/logos/datasources/bigquery.svg",
4862
+ postgres: "/logos/datasources/postgres.svg",
4863
+ snowflake: "/logos/datasources/snowflake.svg",
4864
+ mongodb: "/logos/datasources/mongodb.svg",
4865
+ redis: "/logos/datasources/redis.svg",
4866
+ mysql: "/logos/datasources/mysql.svg",
4867
+ clickhouse: "/logos/datasources/clickhouse.svg",
4868
+ elasticsearch: "/logos/datasources/elasticsearch.svg",
4869
+ duckdb: "/logos/datasources/duckdb.svg",
4870
+ sqlite: "/logos/datasources/sqlite.svg",
4871
+ mariadb: "/logos/datasources/mariadb.svg",
4872
+ oracle: "/logos/datasources/oracle.svg",
4873
+ mssql: "/logos/datasources/mssql.svg",
4874
+ sqlserver: "/logos/datasources/mssql.svg",
4875
+ cassandra: "/logos/datasources/cassandra.svg",
4876
+ dynamodb: "/logos/datasources/dynamodb.svg",
4877
+ cockroach: "/logos/datasources/cockroachdb.svg",
4878
+ supabase: "/logos/datasources/supabase.svg",
4879
+ firebase: "/logos/datasources/firebase.svg",
4880
+ neo4j: "/logos/datasources/neo4j.svg"
4866
4881
  };
4882
+ function getDatasourceLogo2(datasourceId, dialect) {
4883
+ const search = (dialect ?? datasourceId).toLowerCase();
4884
+ for (const [key, url] of Object.entries(DATASOURCE_LOGOS2)) {
4885
+ if (search.includes(key)) return url;
4886
+ }
4887
+ return null;
4888
+ }
4889
+ var TYPE_COLORS = {
4890
+ string: "bg-gray-500/10 text-gray-500 dark:text-gray-400",
4891
+ varchar: "bg-gray-500/10 text-gray-500 dark:text-gray-400",
4892
+ text: "bg-gray-500/10 text-gray-500 dark:text-gray-400",
4893
+ integer: "bg-blue-500/10 text-blue-600 dark:text-blue-400",
4894
+ int: "bg-blue-500/10 text-blue-600 dark:text-blue-400",
4895
+ bigint: "bg-blue-500/10 text-blue-600 dark:text-blue-400",
4896
+ number: "bg-blue-500/10 text-blue-600 dark:text-blue-400",
4897
+ decimal: "bg-indigo-500/10 text-indigo-600 dark:text-indigo-400",
4898
+ float: "bg-indigo-500/10 text-indigo-600 dark:text-indigo-400",
4899
+ boolean: "bg-emerald-500/10 text-emerald-600 dark:text-emerald-400",
4900
+ date: "bg-amber-500/10 text-amber-600 dark:text-amber-400",
4901
+ timestamp: "bg-amber-500/10 text-amber-600 dark:text-amber-400",
4902
+ datetime: "bg-amber-500/10 text-amber-600 dark:text-amber-400",
4903
+ json: "bg-violet-500/10 text-violet-600 dark:text-violet-400",
4904
+ jsonb: "bg-violet-500/10 text-violet-600 dark:text-violet-400",
4905
+ uuid: "bg-teal-500/10 text-teal-600 dark:text-teal-400",
4906
+ array: "bg-pink-500/10 text-pink-600 dark:text-pink-400"
4907
+ };
4908
+ function SectionHeader({ icon: Icon, title, badge }) {
4909
+ return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mb-3", children: [
4910
+ /* @__PURE__ */ jsx(Icon, { className: "h-4 w-4 text-gray-400 dark:text-gray-500" }),
4911
+ /* @__PURE__ */ jsx("span", { className: "text-xs font-semibold uppercase tracking-wider text-gray-500 dark:text-gray-400", children: title }),
4912
+ badge !== void 0 && /* @__PURE__ */ jsx("span", { className: "ml-auto rounded-full bg-indigo-500/10 px-2 py-0.5 text-[10px] font-semibold text-indigo-600 dark:text-indigo-400", children: badge })
4913
+ ] });
4914
+ }
4867
4915
  function DatasourceNodeConfigForm({
4868
4916
  nodeId,
4869
4917
  config,
@@ -4882,9 +4930,19 @@ function DatasourceNodeConfigForm({
4882
4930
  const [outputVariable, setOutputVariable] = useState(config.outputVariable);
4883
4931
  const [limit, setLimit] = useState(config.limit);
4884
4932
  const [filterVariables, setFilterVariables] = useState({ ...config.filterVariables });
4933
+ const [tableSearch, setTableSearch] = useState("");
4934
+ const [columnSearch, setColumnSearch] = useState("");
4885
4935
  const allColumnNames = availableColumns.map((column) => column.name);
4886
4936
  const allSelected = selectedColumns.length > 0 && selectedColumns.length === allColumnNames.length;
4887
4937
  const selectedDatasource = datasources.find((datasource) => datasource.id === selectedDatasourceId);
4938
+ const filteredTables = useMemo(
4939
+ () => tableSearch ? availableTables.filter((table) => table.toLowerCase().includes(tableSearch.toLowerCase())) : availableTables,
4940
+ [availableTables, tableSearch]
4941
+ );
4942
+ const filteredColumns = useMemo(
4943
+ () => columnSearch ? availableColumns.filter((column) => column.name.toLowerCase().includes(columnSearch.toLowerCase())) : availableColumns,
4944
+ [availableColumns, columnSearch]
4945
+ );
4888
4946
  const loadTables = useCallback(async (datasourceId) => {
4889
4947
  if (!datasourceId) {
4890
4948
  setAvailableTables([]);
@@ -4902,14 +4960,10 @@ function DatasourceNodeConfigForm({
4902
4960
  setAvailableColumns(columns);
4903
4961
  }, [onLoadSchema]);
4904
4962
  useEffect(() => {
4905
- if (selectedDatasourceId) {
4906
- loadTables(selectedDatasourceId);
4907
- }
4963
+ if (selectedDatasourceId) loadTables(selectedDatasourceId);
4908
4964
  }, [selectedDatasourceId, loadTables]);
4909
4965
  useEffect(() => {
4910
- if (selectedDatasourceId && selectedTable) {
4911
- loadSchema(selectedDatasourceId, selectedTable);
4912
- }
4966
+ if (selectedDatasourceId && selectedTable) loadSchema(selectedDatasourceId, selectedTable);
4913
4967
  }, [selectedDatasourceId, selectedTable, loadSchema]);
4914
4968
  const handleDatasourceChange = (datasourceId) => {
4915
4969
  setSelectedDatasourceId(datasourceId);
@@ -4918,19 +4972,18 @@ function DatasourceNodeConfigForm({
4918
4972
  setAvailableColumns([]);
4919
4973
  setSelectedColumns([]);
4920
4974
  setFilterVariables({});
4975
+ setTableSearch("");
4976
+ setColumnSearch("");
4921
4977
  };
4922
4978
  const handleTableChange = (table) => {
4923
4979
  setSelectedTable(table);
4924
4980
  setAvailableColumns([]);
4925
4981
  setSelectedColumns([]);
4926
4982
  setFilterVariables({});
4983
+ setColumnSearch("");
4927
4984
  };
4928
4985
  const handleToggleSelectAll = () => {
4929
- if (allSelected) {
4930
- setSelectedColumns([]);
4931
- } else {
4932
- setSelectedColumns([...allColumnNames]);
4933
- }
4986
+ setSelectedColumns(allSelected ? [] : [...allColumnNames]);
4934
4987
  };
4935
4988
  const handleToggleColumn = (columnName) => {
4936
4989
  setSelectedColumns(
@@ -4938,7 +4991,7 @@ function DatasourceNodeConfigForm({
4938
4991
  );
4939
4992
  };
4940
4993
  const handleAddFilter = () => {
4941
- setFilterVariables((previous) => ({ ...previous, "": "" }));
4994
+ setFilterVariables((previous) => ({ ...previous, [`field_${Object.keys(previous).length}`]: "" }));
4942
4995
  };
4943
4996
  const handleUpdateFilterVariable = (oldKey, newKey) => {
4944
4997
  setFilterVariables((previous) => {
@@ -4962,9 +5015,7 @@ function DatasourceNodeConfigForm({
4962
5015
  const handleSave = () => {
4963
5016
  const cleanedFilters = {};
4964
5017
  for (const [key, value] of Object.entries(filterVariables)) {
4965
- if (key.trim() && value.trim()) {
4966
- cleanedFilters[key.trim()] = value.trim();
4967
- }
5018
+ if (key.trim() && value.trim()) cleanedFilters[key.trim()] = value.trim();
4968
5019
  }
4969
5020
  onSave({
4970
5021
  ...config,
@@ -4978,130 +5029,171 @@ function DatasourceNodeConfigForm({
4978
5029
  });
4979
5030
  };
4980
5031
  const filterEntries = Object.entries(filterVariables);
4981
- return /* @__PURE__ */ jsxs("div", { className: "space-y-5", children: [
4982
- /* @__PURE__ */ jsxs("div", { children: [
4983
- /* @__PURE__ */ jsx("label", { className: "mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300", children: t("datasourceLabel") }),
4984
- /* @__PURE__ */ jsx("p", { className: "mb-2 text-xs text-gray-500 dark:text-gray-400", children: t("datasourceHelp") }),
4985
- /* @__PURE__ */ jsxs(
4986
- "select",
4987
- {
4988
- value: selectedDatasourceId,
4989
- onChange: (event) => handleDatasourceChange(event.target.value),
4990
- className: "w-full rounded-lg border border-gray-300 bg-white px-3 py-2 text-sm text-gray-900 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",
4991
- children: [
4992
- /* @__PURE__ */ jsx("option", { value: "", children: t("selectDatasource") }),
4993
- datasources.map((datasource) => /* @__PURE__ */ jsxs("option", { value: datasource.id, children: [
4994
- datasource.name,
4995
- " (",
4996
- datasource.dialect,
4997
- ")"
4998
- ] }, datasource.id))
4999
- ]
5000
- }
5001
- ),
5002
- selectedDatasource && /* @__PURE__ */ jsx("div", { className: "mt-2 flex items-center gap-2", children: /* @__PURE__ */ jsx("span", { className: "inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium bg-cyan-100 text-cyan-700 dark:bg-cyan-900/30 dark:text-cyan-300", children: selectedDatasource.dialect }) })
5003
- ] }),
5032
+ return /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
5004
5033
  /* @__PURE__ */ jsxs("div", { children: [
5005
- /* @__PURE__ */ jsx("label", { className: "mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300", children: t("tableLabel") }),
5006
- /* @__PURE__ */ jsx("p", { className: "mb-2 text-xs text-gray-500 dark:text-gray-400", children: t("tableHelp") }),
5007
- /* @__PURE__ */ jsxs(
5008
- "select",
5009
- {
5010
- value: selectedTable,
5011
- onChange: (event) => handleTableChange(event.target.value),
5012
- disabled: !selectedDatasourceId,
5013
- className: "w-full rounded-lg border border-gray-300 bg-white px-3 py-2 text-sm text-gray-900 outline-none focus:border-indigo-400 focus:ring-2 focus:ring-indigo-400/20 disabled:cursor-not-allowed disabled:opacity-50 dark:border-gray-600 dark:bg-gray-800 dark:text-white",
5014
- children: [
5015
- /* @__PURE__ */ jsx("option", { value: "", children: t("selectTable") }),
5016
- availableTables.map((table) => /* @__PURE__ */ jsx("option", { value: table, children: table }, table))
5017
- ]
5018
- }
5019
- )
5034
+ /* @__PURE__ */ jsx(SectionHeader, { icon: CircleStackIcon, title: t("datasourceLabel"), badge: datasources.length }),
5035
+ /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 gap-2", children: datasources.map((datasource) => {
5036
+ const isSelected = datasource.id === selectedDatasourceId;
5037
+ const logo = getDatasourceLogo2(datasource.id, datasource.dialect);
5038
+ return /* @__PURE__ */ jsxs(
5039
+ "button",
5040
+ {
5041
+ type: "button",
5042
+ onClick: () => handleDatasourceChange(datasource.id),
5043
+ className: `flex items-center gap-3 rounded-xl border px-3 py-2.5 text-left transition-all ${isSelected ? "border-cyan-500/50 bg-cyan-500/5 ring-1 ring-cyan-500/20 dark:border-cyan-400/40 dark:bg-cyan-400/5" : "border-gray-200 bg-white hover:border-gray-300 hover:shadow-sm dark:border-white/10 dark:bg-white/[0.03] dark:hover:border-white/20"}`,
5044
+ children: [
5045
+ /* @__PURE__ */ jsx("div", { className: "flex h-9 w-9 shrink-0 items-center justify-center", children: logo ? /* @__PURE__ */ jsx("img", { src: logo, alt: datasource.dialect, className: "h-7 w-7" }) : /* @__PURE__ */ jsx(ServerStackIcon, { className: "h-6 w-6 text-gray-400" }) }),
5046
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
5047
+ /* @__PURE__ */ jsx("p", { className: "truncate text-xs font-semibold text-gray-900 dark:text-white", children: datasource.name }),
5048
+ /* @__PURE__ */ jsx("p", { className: "text-[10px] text-gray-400 dark:text-gray-500", children: datasource.dialect })
5049
+ ] }),
5050
+ isSelected && /* @__PURE__ */ jsx(CheckIcon, { className: "h-4 w-4 shrink-0 text-cyan-500 dark:text-cyan-400" })
5051
+ ]
5052
+ },
5053
+ datasource.id
5054
+ );
5055
+ }) })
5020
5056
  ] }),
5021
- /* @__PURE__ */ jsxs("div", { children: [
5022
- /* @__PURE__ */ jsx("label", { className: "mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300", children: t("outputVariableLabel") }),
5023
- /* @__PURE__ */ jsx("p", { className: "mb-2 text-xs text-gray-500 dark:text-gray-400", children: t("outputVariableHelp") }),
5024
- /* @__PURE__ */ jsx(
5025
- "input",
5026
- {
5027
- type: "text",
5028
- value: outputVariable,
5029
- onChange: (event) => setOutputVariable(event.target.value),
5030
- placeholder: "datasourceResult",
5031
- className: "w-full 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"
5032
- }
5033
- )
5057
+ selectedDatasourceId && /* @__PURE__ */ jsxs("div", { children: [
5058
+ /* @__PURE__ */ jsx(SectionHeader, { icon: TableCellsIcon, title: t("tableLabel"), badge: availableTables.length || void 0 }),
5059
+ /* @__PURE__ */ jsxs("div", { className: "liquid-surface rounded-xl border border-white/30 dark:border-white/10", children: [
5060
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 border-b border-gray-200/50 px-3 py-2 dark:border-white/5", children: [
5061
+ /* @__PURE__ */ jsx(MagnifyingGlassIcon, { className: "h-3.5 w-3.5 text-gray-400" }),
5062
+ /* @__PURE__ */ jsx(
5063
+ "input",
5064
+ {
5065
+ type: "text",
5066
+ value: tableSearch,
5067
+ onChange: (event) => setTableSearch(event.target.value),
5068
+ placeholder: t("selectTable"),
5069
+ className: "flex-1 bg-transparent text-xs text-gray-900 outline-none placeholder:text-gray-400 dark:text-white dark:placeholder:text-gray-500"
5070
+ }
5071
+ )
5072
+ ] }),
5073
+ /* @__PURE__ */ jsxs("div", { className: "max-h-36 overflow-y-auto p-1", children: [
5074
+ filteredTables.length === 0 && /* @__PURE__ */ jsx("p", { className: "px-3 py-3 text-center text-[10px] text-gray-400", children: availableTables.length === 0 ? t("noColumnsAvailable") : "No matches" }),
5075
+ filteredTables.map((table) => {
5076
+ const isSelected = table === selectedTable;
5077
+ return /* @__PURE__ */ jsxs(
5078
+ "button",
5079
+ {
5080
+ type: "button",
5081
+ onClick: () => handleTableChange(table),
5082
+ className: `flex w-full items-center gap-2 rounded-lg px-3 py-1.5 text-left text-xs transition-colors ${isSelected ? "bg-cyan-500/10 font-semibold text-cyan-700 dark:text-cyan-300" : "text-gray-700 hover:bg-gray-100/60 dark:text-gray-300 dark:hover:bg-white/5"}`,
5083
+ children: [
5084
+ /* @__PURE__ */ jsx(TableCellsIcon, { className: "h-3 w-3 shrink-0 text-gray-400" }),
5085
+ /* @__PURE__ */ jsx("span", { className: "truncate", children: table }),
5086
+ isSelected && /* @__PURE__ */ jsx(CheckIcon, { className: "ml-auto h-3 w-3 shrink-0 text-cyan-500" })
5087
+ ]
5088
+ },
5089
+ table
5090
+ );
5091
+ })
5092
+ ] })
5093
+ ] })
5034
5094
  ] }),
5035
- /* @__PURE__ */ jsxs("div", { children: [
5036
- /* @__PURE__ */ jsx("label", { className: "mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300", children: t("limitLabel") }),
5037
- /* @__PURE__ */ jsx("p", { className: "mb-2 text-xs text-gray-500 dark:text-gray-400", children: t("limitHelp") }),
5038
- /* @__PURE__ */ jsx(
5039
- "input",
5040
- {
5041
- type: "number",
5042
- value: limit,
5043
- onChange: (event) => setLimit(Math.max(1, Number.parseInt(event.target.value, 10) || 1)),
5044
- min: 1,
5045
- max: 1e4,
5046
- className: "w-32 rounded-lg border border-gray-300 bg-white px-3 py-2 text-sm text-gray-900 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"
5047
- }
5048
- )
5095
+ selectedTable && /* @__PURE__ */ jsxs("div", { className: "flex items-end gap-3", children: [
5096
+ /* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
5097
+ /* @__PURE__ */ jsx("label", { className: "mb-1 block text-[10px] font-medium text-gray-500 dark:text-gray-400", children: t("outputVariableLabel") }),
5098
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 rounded-lg border border-gray-200 bg-white px-3 py-2 dark:border-white/10 dark:bg-white/[0.03]", children: [
5099
+ /* @__PURE__ */ jsx(VariableIcon, { className: "h-3.5 w-3.5 text-gray-400" }),
5100
+ /* @__PURE__ */ jsx(
5101
+ "input",
5102
+ {
5103
+ type: "text",
5104
+ value: outputVariable,
5105
+ onChange: (event) => setOutputVariable(event.target.value),
5106
+ placeholder: "datasourceResult",
5107
+ className: "flex-1 bg-transparent text-xs text-gray-900 outline-none placeholder:text-gray-400 dark:text-white dark:placeholder:text-gray-500"
5108
+ }
5109
+ )
5110
+ ] })
5111
+ ] }),
5112
+ /* @__PURE__ */ jsxs("div", { className: "w-24", children: [
5113
+ /* @__PURE__ */ jsx("label", { className: "mb-1 block text-[10px] font-medium text-gray-500 dark:text-gray-400", children: t("limitLabel") }),
5114
+ /* @__PURE__ */ jsx(
5115
+ "input",
5116
+ {
5117
+ type: "number",
5118
+ value: limit,
5119
+ onChange: (event) => setLimit(Math.max(1, Number.parseInt(event.target.value, 10) || 1)),
5120
+ min: 1,
5121
+ max: 1e4,
5122
+ className: "w-full rounded-lg border border-gray-200 bg-white px-3 py-2 text-xs text-gray-900 outline-none focus:border-cyan-400 dark:border-white/10 dark:bg-white/[0.03] dark:text-white"
5123
+ }
5124
+ )
5125
+ ] })
5049
5126
  ] }),
5050
- /* @__PURE__ */ jsxs("div", { children: [
5051
- /* @__PURE__ */ jsxs("div", { className: "mb-2 flex items-center justify-between", children: [
5052
- /* @__PURE__ */ jsx("label", { className: "text-sm font-medium text-gray-700 dark:text-gray-300", children: t("columnsLabel") }),
5127
+ selectedTable && /* @__PURE__ */ jsxs("div", { children: [
5128
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-2", children: [
5129
+ /* @__PURE__ */ jsx(
5130
+ SectionHeader,
5131
+ {
5132
+ icon: TableCellsIcon,
5133
+ title: t("columnsLabel"),
5134
+ badge: `${selectedColumns.length}/${availableColumns.length}`
5135
+ }
5136
+ ),
5053
5137
  /* @__PURE__ */ jsx(
5054
5138
  "button",
5055
5139
  {
5056
5140
  type: "button",
5057
5141
  onClick: handleToggleSelectAll,
5058
5142
  disabled: availableColumns.length === 0,
5059
- className: "text-xs font-medium text-indigo-600 hover:text-indigo-700 disabled:cursor-not-allowed disabled:opacity-50 dark:text-indigo-400 dark:hover:text-indigo-300",
5143
+ className: "text-[10px] font-semibold text-cyan-600 hover:text-cyan-700 disabled:opacity-40 dark:text-cyan-400 dark:hover:text-cyan-300",
5060
5144
  children: allSelected ? t("deselectAll") : t("selectAll")
5061
5145
  }
5062
5146
  )
5063
5147
  ] }),
5064
- selectedColumns.length === 0 && availableColumns.length > 0 && /* @__PURE__ */ jsx("p", { className: "mb-2 text-xs text-amber-600 dark:text-amber-400", children: t("noColumnsSelected") }),
5065
- /* @__PURE__ */ jsxs("div", { className: "max-h-48 space-y-1 overflow-y-auto rounded-lg border border-gray-200 p-2 dark:border-gray-700", children: [
5066
- availableColumns.length === 0 && /* @__PURE__ */ jsx("p", { className: "px-2 py-2 text-xs text-gray-500 dark:text-gray-400", children: t("noColumnsAvailable") }),
5067
- availableColumns.map((column) => {
5068
- const isSelected = selectedColumns.includes(column.name);
5069
- const typeBadgeColor = COLUMN_TYPE_BADGE_COLORS[column.type.toLowerCase()] ?? COLUMN_TYPE_BADGE_COLORS.string;
5070
- return /* @__PURE__ */ jsxs(
5071
- "label",
5148
+ /* @__PURE__ */ jsxs("div", { className: "liquid-surface rounded-xl border border-white/30 dark:border-white/10", children: [
5149
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 border-b border-gray-200/50 px-3 py-2 dark:border-white/5", children: [
5150
+ /* @__PURE__ */ jsx(MagnifyingGlassIcon, { className: "h-3.5 w-3.5 text-gray-400" }),
5151
+ /* @__PURE__ */ jsx(
5152
+ "input",
5072
5153
  {
5073
- className: `flex cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 transition-colors ${isSelected ? "bg-indigo-50 dark:bg-indigo-500/10" : "hover:bg-gray-50 dark:hover:bg-gray-800"}`,
5074
- children: [
5075
- /* @__PURE__ */ jsx(
5076
- "input",
5077
- {
5078
- type: "checkbox",
5079
- checked: isSelected,
5080
- onChange: () => handleToggleColumn(column.name),
5081
- className: "h-3.5 w-3.5 rounded border-gray-300 text-indigo-600 focus:ring-indigo-500 dark:border-gray-600"
5082
- }
5083
- ),
5084
- /* @__PURE__ */ jsxs("span", { className: "flex-1 text-xs font-medium text-gray-900 dark:text-white", children: [
5085
- column.name,
5086
- column.nullable && /* @__PURE__ */ jsx("span", { className: "ml-1 text-[9px] text-gray-400 dark:text-gray-500", children: "?" })
5087
- ] }),
5088
- /* @__PURE__ */ jsx("span", { className: `rounded-full px-1.5 py-0.5 text-[9px] font-medium ${typeBadgeColor}`, children: column.type })
5089
- ]
5090
- },
5091
- column.name
5092
- );
5093
- })
5154
+ type: "text",
5155
+ value: columnSearch,
5156
+ onChange: (event) => setColumnSearch(event.target.value),
5157
+ placeholder: "Search columns...",
5158
+ className: "flex-1 bg-transparent text-xs text-gray-900 outline-none placeholder:text-gray-400 dark:text-white dark:placeholder:text-gray-500"
5159
+ }
5160
+ )
5161
+ ] }),
5162
+ /* @__PURE__ */ jsxs("div", { className: "max-h-52 overflow-y-auto p-1", children: [
5163
+ filteredColumns.length === 0 && /* @__PURE__ */ jsx("p", { className: "px-3 py-3 text-center text-[10px] text-gray-400", children: t("noColumnsAvailable") }),
5164
+ filteredColumns.map((column) => {
5165
+ const isSelected = selectedColumns.includes(column.name);
5166
+ const typeColor = TYPE_COLORS[column.type.toLowerCase()] ?? TYPE_COLORS.string;
5167
+ return /* @__PURE__ */ jsxs(
5168
+ "button",
5169
+ {
5170
+ type: "button",
5171
+ onClick: () => handleToggleColumn(column.name),
5172
+ className: `flex w-full items-center gap-2 rounded-lg px-3 py-1.5 text-left transition-colors ${isSelected ? "bg-cyan-500/8 dark:bg-cyan-400/5" : "hover:bg-gray-100/60 dark:hover:bg-white/5"}`,
5173
+ children: [
5174
+ /* @__PURE__ */ jsx("div", { className: `flex h-4 w-4 shrink-0 items-center justify-center rounded border transition-colors ${isSelected ? "border-cyan-500 bg-cyan-500 dark:border-cyan-400 dark:bg-cyan-400" : "border-gray-300 dark:border-gray-600"}`, children: isSelected && /* @__PURE__ */ jsx(CheckIcon, { className: "h-2.5 w-2.5 text-white" }) }),
5175
+ /* @__PURE__ */ jsxs("span", { className: "flex-1 truncate text-xs text-gray-900 dark:text-white", children: [
5176
+ column.name,
5177
+ column.nullable && /* @__PURE__ */ jsx("span", { className: "ml-1 text-[9px] text-gray-400", children: "?" })
5178
+ ] }),
5179
+ /* @__PURE__ */ jsx("span", { className: `shrink-0 rounded-full px-1.5 py-0.5 text-[9px] font-medium ${typeColor}`, children: column.type })
5180
+ ]
5181
+ },
5182
+ column.name
5183
+ );
5184
+ })
5185
+ ] })
5094
5186
  ] })
5095
5187
  ] }),
5096
- /* @__PURE__ */ jsxs("div", { children: [
5097
- /* @__PURE__ */ jsxs("div", { className: "mb-1 flex items-center justify-between", children: [
5098
- /* @__PURE__ */ jsx("label", { className: "text-sm font-medium text-gray-700 dark:text-gray-300", children: t("filtersLabel") }),
5188
+ selectedTable && /* @__PURE__ */ jsxs("div", { children: [
5189
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-2", children: [
5190
+ /* @__PURE__ */ jsx(SectionHeader, { icon: FunnelIcon, title: t("filtersLabel"), badge: filterEntries.length || void 0 }),
5099
5191
  /* @__PURE__ */ jsxs(
5100
5192
  "button",
5101
5193
  {
5102
5194
  type: "button",
5103
5195
  onClick: handleAddFilter,
5104
- className: "flex items-center gap-1 text-xs font-medium text-indigo-600 hover:text-indigo-700 dark:text-indigo-400 dark:hover:text-indigo-300",
5196
+ className: "flex items-center gap-1 text-[10px] font-semibold text-cyan-600 hover:text-cyan-700 dark:text-cyan-400 dark:hover:text-cyan-300",
5105
5197
  children: [
5106
5198
  /* @__PURE__ */ jsx(PlusIcon$1, { className: "h-3 w-3" }),
5107
5199
  t("addFilter")
@@ -5109,21 +5201,20 @@ function DatasourceNodeConfigForm({
5109
5201
  }
5110
5202
  )
5111
5203
  ] }),
5112
- /* @__PURE__ */ jsx("p", { className: "mb-2 text-xs text-gray-500 dark:text-gray-400", children: t("filtersHelp") }),
5113
- filterEntries.length > 0 && /* @__PURE__ */ jsx("div", { className: "space-y-2", children: filterEntries.map(([variableName, columnName], index) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
5204
+ filterEntries.length > 0 && /* @__PURE__ */ jsx("div", { className: "space-y-2", children: filterEntries.map(([variableName, columnName], index) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 rounded-lg border border-gray-200 bg-white px-2 py-1.5 dark:border-white/10 dark:bg-white/[0.03]", children: [
5114
5205
  /* @__PURE__ */ jsxs(
5115
5206
  "select",
5116
5207
  {
5117
5208
  value: columnName,
5118
5209
  onChange: (event) => handleUpdateFilterField(variableName, event.target.value),
5119
- className: "flex-1 rounded-lg border border-gray-300 bg-white px-2 py-1.5 text-xs text-gray-900 outline-none focus:border-indigo-400 focus:ring-1 focus:ring-indigo-400/20 dark:border-gray-600 dark:bg-gray-800 dark:text-white",
5210
+ className: "flex-1 rounded bg-transparent text-xs text-gray-900 outline-none dark:text-white",
5120
5211
  children: [
5121
5212
  /* @__PURE__ */ jsx("option", { value: "", children: t("columnName") }),
5122
5213
  availableColumns.map((column) => /* @__PURE__ */ jsx("option", { value: column.name, children: column.name }, column.name))
5123
5214
  ]
5124
5215
  }
5125
5216
  ),
5126
- /* @__PURE__ */ jsx("span", { className: "text-xs text-gray-400", children: "=" }),
5217
+ /* @__PURE__ */ jsx("span", { className: "text-[10px] font-medium text-gray-400", children: "=" }),
5127
5218
  /* @__PURE__ */ jsx(
5128
5219
  "input",
5129
5220
  {
@@ -5131,7 +5222,7 @@ function DatasourceNodeConfigForm({
5131
5222
  value: variableName,
5132
5223
  onChange: (event) => handleUpdateFilterVariable(variableName, event.target.value),
5133
5224
  placeholder: t("variableReference"),
5134
- className: "flex-1 rounded-lg border border-gray-300 bg-white px-2 py-1.5 text-xs text-gray-900 placeholder-gray-400 outline-none focus:border-indigo-400 focus:ring-1 focus:ring-indigo-400/20 dark:border-gray-600 dark:bg-gray-800 dark:text-white dark:placeholder-gray-500"
5225
+ className: "flex-1 bg-transparent text-xs text-gray-900 outline-none placeholder:text-gray-400 dark:text-white dark:placeholder:text-gray-500"
5135
5226
  }
5136
5227
  ),
5137
5228
  /* @__PURE__ */ jsx(
@@ -5139,29 +5230,20 @@ function DatasourceNodeConfigForm({
5139
5230
  {
5140
5231
  type: "button",
5141
5232
  onClick: () => handleRemoveFilter(variableName),
5142
- className: "rounded-md p-1 text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20",
5143
- children: /* @__PURE__ */ jsx(XMarkIcon$1, { className: "h-3.5 w-3.5" })
5233
+ className: "shrink-0 rounded-md p-1 text-gray-400 transition-colors hover:bg-red-50 hover:text-red-500 dark:hover:bg-red-900/20",
5234
+ children: /* @__PURE__ */ jsx(XMarkIcon$1, { className: "h-3 w-3" })
5144
5235
  }
5145
5236
  )
5146
5237
  ] }, index)) })
5147
5238
  ] }),
5148
- /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2 border-t border-gray-200 pt-4 dark:border-gray-700", children: [
5149
- /* @__PURE__ */ jsx(
5150
- "button",
5151
- {
5152
- type: "button",
5153
- onClick: onCancel,
5154
- 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",
5155
- children: t("cancel")
5156
- }
5157
- ),
5239
+ /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2 border-t border-gray-200/50 pt-4 dark:border-white/5", children: [
5240
+ /* @__PURE__ */ jsx(Button, { outline: true, onClick: onCancel, children: t("cancel") }),
5158
5241
  /* @__PURE__ */ jsx(
5159
- "button",
5242
+ Button,
5160
5243
  {
5161
- type: "button",
5244
+ color: "cyan",
5162
5245
  onClick: handleSave,
5163
5246
  disabled: !selectedDatasourceId || !selectedTable || selectedColumns.length === 0,
5164
- className: "rounded-lg bg-indigo-600 px-4 py-2 text-sm font-medium text-white hover:bg-indigo-700 disabled:cursor-not-allowed disabled:opacity-50 dark:bg-indigo-500 dark:hover:bg-indigo-600",
5165
5247
  children: t("save")
5166
5248
  }
5167
5249
  )
@@ -7642,5 +7724,5 @@ function Workspace({
7642
7724
  }
7643
7725
 
7644
7726
  export { AgentFlowNode, AgentToolFlowNode, AnswerFlowNode, AnthropicIcon, CATEGORY_COLORS, CATEGORY_PILL_COLORS, CodeFlowNode, CrewAIIcon, DocumentExtractorFlowNode, EndFlowNode, EntityFlowNode, FRAMEWORK_META, GoogleADKIcon, GroupFlowNode, HttpRequestFlowNode, ICON_MAP, IfElseFlowNode, IterationFlowNode, IterationStartFlowNode, KnowledgeBaseFlowNode, LOGIC_ICON_MAP, LOGIC_NODE_BADGE_COLORS, LOGIC_NODE_GRADIENTS, LOGIC_NODE_HANDLE_COLORS, LangChainIcon, ListOperatorFlowNode, LogicNodeModal, MINIMAP_NODE_COLORS, ModelProviderFlowNode, NODE_EXECUTION_ACCENT_COLORS, NodeCard, NodeContextMenu, NoteFlowNode, OpenAIIcon, PanelContextMenu, ParameterExtractorFlowNode, QuestionClassifierFlowNode, RuleFlowNode, SelectionContextMenu, StartFlowNode, StrandsIcon, TemplateTransformFlowNode, ToolFlowNode, VariableAggregatorFlowNode, VariableAssignerFlowNode, WorkflowBuilderProvider, WorkflowCanvas, Workspace, getCompatibleModels, getDefaultFrameworkForModel, getEntityBadgeColor, getEntityGradient, getEntityHandleColor, getEntityIcon, getEntityMinimapColor, getFrameworkMeta, getNodeExecutionAccent, getNodeExecutionAccentRgb, isFrameworkCompatibleWithProviders, isModelCompatibleWithFramework, useModalStore, useWorkflowBuilderClient, useWorkflowBuilderClientOptional, useWorkflowStore };
7645
- //# sourceMappingURL=chunk-W7SNLP5J.mjs.map
7646
- //# sourceMappingURL=chunk-W7SNLP5J.mjs.map
7727
+ //# sourceMappingURL=chunk-RCOGWCF2.mjs.map
7728
+ //# sourceMappingURL=chunk-RCOGWCF2.mjs.map