@streamoid/catalogix-chat 0.2.21 → 0.2.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.
Files changed (2) hide show
  1. package/dist/index.js +25 -12
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -3085,7 +3085,7 @@ import {
3085
3085
  ChevronDown as ChevronDown3,
3086
3086
  ChevronRight as ChevronRight3,
3087
3087
  Pencil as Pencil3,
3088
- Info as Info2,
3088
+ Send as Send2,
3089
3089
  Loader2 as Loader26,
3090
3090
  X as X2,
3091
3091
  RefreshCw
@@ -3165,7 +3165,7 @@ function EditableCell2({
3165
3165
  setEditing(false);
3166
3166
  if (draft !== value) onChange(draft);
3167
3167
  }, [draft, value, onChange]);
3168
- if (readOnly || !hasError) {
3168
+ if (readOnly) {
3169
3169
  return /* @__PURE__ */ jsxs11(
3170
3170
  "div",
3171
3171
  {
@@ -3223,19 +3223,19 @@ function EditableCell2({
3223
3223
  }
3224
3224
  );
3225
3225
  }
3226
- function MissingAttributesBanner({ text }) {
3227
- const [open, setOpen] = useState8(false);
3226
+ function MissingAttributesBanner({ text, defaultOpen = false }) {
3227
+ const [open, setOpen] = useState8(defaultOpen);
3228
3228
  const attrs = text.split(",").map((s) => s.trim().replace(/^'|'$/g, ""));
3229
3229
  const preview = attrs.slice(0, 3);
3230
- return /* @__PURE__ */ jsxs11("div", { className: "text-xs text-muted-foreground px-2 py-1.5 border-t border-dashed bg-muted/30", children: [
3230
+ return /* @__PURE__ */ jsxs11("div", { className: "text-xs px-2 py-1.5 border-t border-dashed border-amber-300/60 bg-amber-50/40 dark:bg-amber-950/20 text-amber-700 dark:text-amber-400", children: [
3231
3231
  /* @__PURE__ */ jsxs11(
3232
3232
  "button",
3233
3233
  {
3234
3234
  type: "button",
3235
- className: "flex items-center gap-1 hover:text-foreground transition-colors",
3235
+ className: "flex items-center gap-1 hover:text-amber-900 dark:hover:text-amber-300 transition-colors",
3236
3236
  onClick: () => setOpen((v) => !v),
3237
3237
  children: [
3238
- /* @__PURE__ */ jsx22(Info2, { className: "h-3 w-3" }),
3238
+ /* @__PURE__ */ jsx22(AlertTriangle2, { className: "h-3 w-3" }),
3239
3239
  /* @__PURE__ */ jsx22("span", { className: "font-medium", children: "Missing attributes:" }),
3240
3240
  !open && /* @__PURE__ */ jsxs11("span", { children: [
3241
3241
  preview.join(", "),
@@ -3344,6 +3344,13 @@ function EditFeed({
3344
3344
  editedRowIndices.add(idx);
3345
3345
  }
3346
3346
  if (editedRowIndices.size === 0) {
3347
+ if (errorCount === 0) {
3348
+ onSubmit(
3349
+ { transformedUrl },
3350
+ "No critical errors. Proceeding with current feed."
3351
+ );
3352
+ return;
3353
+ }
3347
3354
  setErrorMsg("No cells have been edited. Please fix the highlighted values first.");
3348
3355
  setIsLoading(false);
3349
3356
  return;
@@ -3409,6 +3416,7 @@ function EditFeed({
3409
3416
  rowNumbers,
3410
3417
  columns,
3411
3418
  editedCells,
3419
+ errorCount,
3412
3420
  storeId,
3413
3421
  feedFileType,
3414
3422
  mappingKey,
@@ -3420,17 +3428,22 @@ function EditFeed({
3420
3428
  /* @__PURE__ */ jsx22("div", { className: "flex items-center justify-between px-1", children: /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-2", children: [
3421
3429
  /* @__PURE__ */ jsx22(AlertTriangle2, { className: "h-4 w-4 text-destructive" }),
3422
3430
  /* @__PURE__ */ jsx22("span", { className: "font-medium text-sm", children: "Feed Validation Issues" }),
3423
- /* @__PURE__ */ jsxs11(Badge, { variant: "destructive", className: "text-[10px]", children: [
3431
+ errorCount > 0 && /* @__PURE__ */ jsxs11(Badge, { variant: "destructive", className: "text-[10px]", children: [
3424
3432
  errorCount,
3425
3433
  " error",
3426
3434
  errorCount !== 1 ? "s" : ""
3427
3435
  ] }),
3436
+ dataIssuesRaw.length > 0 && /* @__PURE__ */ jsxs11(Badge, { variant: "outline", className: "text-[10px] border-amber-400 text-amber-600 dark:text-amber-400", children: [
3437
+ dataIssuesRaw.length,
3438
+ " warning",
3439
+ dataIssuesRaw.length !== 1 ? "s" : ""
3440
+ ] }),
3428
3441
  editedCells.size > 0 && /* @__PURE__ */ jsxs11(Badge, { variant: "secondary", className: "text-[10px]", children: [
3429
3442
  editedCells.size,
3430
3443
  " edited"
3431
3444
  ] })
3432
3445
  ] }) }),
3433
- /* @__PURE__ */ jsx22("p", { className: "text-xs text-muted-foreground px-1", children: "Click on the highlighted cells to edit their values, then submit to re-validate." }),
3446
+ /* @__PURE__ */ jsx22("p", { className: "text-xs text-muted-foreground px-1", children: errorCount > 0 ? "Click on the highlighted cells to edit their values, then submit to re-validate." : "No critical errors found. Review the warnings below and edit values if needed, or proceed." }),
3434
3447
  statusMsg && /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-2 px-2 py-1.5 rounded bg-muted text-xs text-muted-foreground", children: [
3435
3448
  /* @__PURE__ */ jsx22(Loader26, { className: "h-3 w-3 animate-spin" }),
3436
3449
  statusMsg
@@ -3466,7 +3479,7 @@ function EditFeed({
3466
3479
  ) }, col);
3467
3480
  })
3468
3481
  ] }),
3469
- missingAttrs && /* @__PURE__ */ jsx22("tr", { children: /* @__PURE__ */ jsx22("td", { colSpan: columns.length + 1, children: /* @__PURE__ */ jsx22(MissingAttributesBanner, { text: missingAttrs }) }) })
3482
+ missingAttrs && /* @__PURE__ */ jsx22("tr", { children: /* @__PURE__ */ jsx22("td", { colSpan: columns.length + 1, children: /* @__PURE__ */ jsx22(MissingAttributesBanner, { text: missingAttrs, defaultOpen: errorCount === 0 }) }) })
3470
3483
  ] }, rowIdx);
3471
3484
  }),
3472
3485
  rows.length === 0 && /* @__PURE__ */ jsx22(TableRow, { children: /* @__PURE__ */ jsx22(
@@ -3502,8 +3515,8 @@ function EditFeed({
3502
3515
  className: "gap-1.5",
3503
3516
  disabled: isLoading,
3504
3517
  children: [
3505
- isLoading ? /* @__PURE__ */ jsx22(Loader26, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ jsx22(RefreshCw, { className: "h-3.5 w-3.5" }),
3506
- "Fix & Re-validate"
3518
+ isLoading ? /* @__PURE__ */ jsx22(Loader26, { className: "h-3.5 w-3.5 animate-spin" }) : errorCount > 0 ? /* @__PURE__ */ jsx22(RefreshCw, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ jsx22(Send2, { className: "h-3.5 w-3.5" }),
3519
+ errorCount > 0 ? "Fix & Re-validate" : editedCells.size > 0 ? "Fix & Re-validate" : "Proceed"
3507
3520
  ]
3508
3521
  }
3509
3522
  )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamoid/catalogix-chat",
3
- "version": "0.2.21",
3
+ "version": "0.2.22",
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",