@streamoid/catalogix-chat 0.2.8 → 0.2.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -139,12 +139,13 @@ interface MapAttributesChatProps {
139
139
  valuesOntologyAttributes: string[];
140
140
  columns: string[];
141
141
  uniqueValues: Record<string, string[]>;
142
+ lovOptions?: Record<string, string[]>;
142
143
  storeId: string;
143
144
  submitted?: boolean;
144
145
  submittedValues?: Record<string, unknown>;
145
146
  onSubmit: (values: Record<string, unknown>) => void;
146
147
  }
147
- declare function MapAttributesChat({ mappingData: initialData, mpAttributes, valuesOntologyAttributes, uniqueValues, submitted, onSubmit, }: MapAttributesChatProps): react_jsx_runtime.JSX.Element;
148
+ declare function MapAttributesChat({ mappingData: initialData, mpAttributes, valuesOntologyAttributes, uniqueValues, lovOptions, submitted, onSubmit, }: MapAttributesChatProps): react_jsx_runtime.JSX.Element;
148
149
 
149
150
  interface ProductAutomationProps {
150
151
  storeId: string;
package/dist/index.js CHANGED
@@ -2600,6 +2600,7 @@ function ValueMappingPanel({
2600
2600
  data,
2601
2601
  valuesOntologyAttributes,
2602
2602
  uniqueValues,
2603
+ lovOptions,
2603
2604
  onValueChange
2604
2605
  }) {
2605
2606
  const lovItems = useMemo5(() => {
@@ -2658,6 +2659,9 @@ function ValueMappingPanel({
2658
2659
  ] }),
2659
2660
  /* @__PURE__ */ jsx21("div", { className: "space-y-1", children: item.rawValues.map((raw) => {
2660
2661
  const mapped = item.mappedValues[raw];
2662
+ const options = lovOptions[item.attribute] ?? [...new Set(
2663
+ Object.values(item.mappedValues).filter(Boolean)
2664
+ )];
2661
2665
  return /* @__PURE__ */ jsxs10("div", { className: "flex items-center gap-2", children: [
2662
2666
  /* @__PURE__ */ jsx21("span", { className: "text-xs text-muted-foreground truncate min-w-0 flex-1", children: raw }),
2663
2667
  /* @__PURE__ */ jsx21(ArrowRight, { className: "size-3 shrink-0 text-muted-foreground/50" }),
@@ -2679,7 +2683,7 @@ function ValueMappingPanel({
2679
2683
  /* @__PURE__ */ jsxs10(SelectContent, { children: [
2680
2684
  /* @__PURE__ */ jsx21(SelectItem, { value: "__unmapped__", children: /* @__PURE__ */ jsx21("span", { className: "text-muted-foreground", children: "Select..." }) }),
2681
2685
  /* @__PURE__ */ jsx21(SelectItem, { value: "__skip__", children: /* @__PURE__ */ jsx21("span", { className: "italic text-muted-foreground", children: "Skip" }) }),
2682
- item.rawValues.map((v) => /* @__PURE__ */ jsx21(SelectItem, { value: v, children: v }, v))
2686
+ options.map((v) => /* @__PURE__ */ jsx21(SelectItem, { value: v, children: v }, v))
2683
2687
  ] })
2684
2688
  ]
2685
2689
  }
@@ -2693,6 +2697,7 @@ function MapAttributesChat({
2693
2697
  mpAttributes,
2694
2698
  valuesOntologyAttributes,
2695
2699
  uniqueValues,
2700
+ lovOptions = {},
2696
2701
  submitted,
2697
2702
  onSubmit
2698
2703
  }) {
@@ -2892,6 +2897,7 @@ function MapAttributesChat({
2892
2897
  data,
2893
2898
  valuesOntologyAttributes,
2894
2899
  uniqueValues,
2900
+ lovOptions,
2895
2901
  onValueChange: handleValueChange
2896
2902
  }
2897
2903
  ) }),
@@ -4067,6 +4073,7 @@ function CatalogixChat(props) {
4067
4073
  valuesOntologyAttributes: uiProps.valuesOntologyAttributes ?? [],
4068
4074
  columns: uiProps.columns ?? [],
4069
4075
  uniqueValues: uiProps.uniqueValues ?? {},
4076
+ lovOptions: uiProps.lovOptions ?? {},
4070
4077
  storeId,
4071
4078
  submitted: props.submitted,
4072
4079
  submittedValues: props.submittedValues,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamoid/catalogix-chat",
3
- "version": "0.2.8",
3
+ "version": "0.2.10",
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",