@streamoid/catalogix-chat 0.2.5 → 0.2.6

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.
Files changed (2) hide show
  1. package/dist/index.js +17 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2471,7 +2471,7 @@ function AttributeRow({
2471
2471
  /* @__PURE__ */ jsx21(Check2, { className: "size-3 shrink-0 text-emerald-600 dark:text-emerald-400" }),
2472
2472
  /* @__PURE__ */ jsx21("span", { className: "text-xs font-medium truncate", children: item.feedCol }),
2473
2473
  /* @__PURE__ */ jsx21(ChevronRight2, { className: "size-3 shrink-0 text-muted-foreground" }),
2474
- /* @__PURE__ */ jsx21("span", { className: "text-xs text-muted-foreground truncate flex-1", children: [...item.mappedCols, ...item.customCols].join(", ") }),
2474
+ /* @__PURE__ */ jsx21("span", { className: "text-xs text-muted-foreground truncate", children: [...item.mappedCols, ...item.customCols].join(", ") }),
2475
2475
  /* @__PURE__ */ jsx21(
2476
2476
  "button",
2477
2477
  {
@@ -2486,7 +2486,7 @@ function AttributeRow({
2486
2486
  if (item.isIgnored) {
2487
2487
  return /* @__PURE__ */ jsxs10("div", { className: "flex items-center gap-2 py-1.5 group", children: [
2488
2488
  /* @__PURE__ */ jsx21(X, { className: "size-3 shrink-0 text-destructive" }),
2489
- /* @__PURE__ */ jsx21("span", { className: "text-xs text-muted-foreground line-through truncate flex-1", children: item.feedCol }),
2489
+ /* @__PURE__ */ jsx21("span", { className: "text-xs text-muted-foreground line-through truncate", children: item.feedCol }),
2490
2490
  /* @__PURE__ */ jsx21(
2491
2491
  "button",
2492
2492
  {
@@ -2498,7 +2498,7 @@ function AttributeRow({
2498
2498
  )
2499
2499
  ] });
2500
2500
  }
2501
- return /* @__PURE__ */ jsxs10("div", { className: "py-2 space-y-1.5", children: [
2501
+ return /* @__PURE__ */ jsxs10("div", { className: "py-2 space-y-1.5 border-l-2 border-destructive/60 pl-2", children: [
2502
2502
  /* @__PURE__ */ jsxs10("div", { className: "min-w-0", children: [
2503
2503
  /* @__PURE__ */ jsx21("p", { className: "text-xs font-medium", children: item.feedCol }),
2504
2504
  item.rows.length > 0 && /* @__PURE__ */ jsx21("p", { className: "text-[11px] text-muted-foreground truncate", children: item.rows.slice(0, 3).join(", ") })
@@ -2693,6 +2693,18 @@ function MapAttributesChat({
2693
2693
  ),
2694
2694
  [data, valuesOntologyAttributes]
2695
2695
  );
2696
+ const allValuesComplete = useMemo5(() => {
2697
+ for (const item of data) {
2698
+ if (item.isIgnored || !item.isConfirmed) continue;
2699
+ for (const attr of item.mappedCols) {
2700
+ if (!valuesOntologyAttributes.includes(attr)) continue;
2701
+ const rawVals = uniqueValues[item.feedCol] || [];
2702
+ const mapped = item.mappedValues[attr] || {};
2703
+ if (rawVals.some((v) => mapped[v] == null)) return false;
2704
+ }
2705
+ }
2706
+ return true;
2707
+ }, [data, valuesOntologyAttributes, uniqueValues]);
2696
2708
  const handleMap = useCallback5((index, attribute) => {
2697
2709
  setData((prev) => {
2698
2710
  const next = [...prev];
@@ -2766,7 +2778,7 @@ function MapAttributesChat({
2766
2778
  ] })
2767
2779
  ] });
2768
2780
  }
2769
- return /* @__PURE__ */ jsxs10(Card, { className: "w-full max-h-[45vh] gap-0 flex flex-col shadow-sm", children: [
2781
+ return /* @__PURE__ */ jsxs10(Card, { className: "w-[60%] max-w-2xl max-h-[45vh] gap-0 flex flex-col shadow-sm", children: [
2770
2782
  /* @__PURE__ */ jsxs10("div", { className: "px-4 pt-3 pb-2 flex-shrink-0 space-y-2", children: [
2771
2783
  /* @__PURE__ */ jsxs10("div", { children: [
2772
2784
  /* @__PURE__ */ jsx21("h3", { className: "text-sm font-semibold tracking-tight", children: step === "attributes" ? "Map Attributes" : "Map Values" }),
@@ -2842,7 +2854,7 @@ function MapAttributesChat({
2842
2854
  {
2843
2855
  size: "sm",
2844
2856
  onClick: handleSubmit,
2845
- disabled: progress.done < progress.total,
2857
+ disabled: progress.done < progress.total || hasLovAttributes && !allValuesComplete,
2846
2858
  className: "h-7 text-xs bg-primary text-primary-foreground shadow-none hover:bg-primary/90",
2847
2859
  children: [
2848
2860
  /* @__PURE__ */ jsx21(Send, { className: "mr-1 size-3" }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamoid/catalogix-chat",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "description": "Catalogix chat components for the Streamoid chat host — store creation, product selection, automations",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",