@streamoid/catalogix-chat 0.2.25 → 0.2.27

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 +103 -74
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -3086,13 +3086,15 @@ import {
3086
3086
  ChevronDown as ChevronDown3,
3087
3087
  ChevronRight as ChevronRight3,
3088
3088
  HelpCircle,
3089
+ Maximize2,
3090
+ Minimize2,
3089
3091
  Pencil as Pencil3,
3090
3092
  Send as Send2,
3091
3093
  Loader2 as Loader26,
3092
3094
  X as X2,
3093
3095
  RefreshCw
3094
3096
  } from "lucide-react";
3095
- import { jsx as jsx22, jsxs as jsxs11 } from "react/jsx-runtime";
3097
+ import { Fragment as Fragment5, jsx as jsx22, jsxs as jsxs11 } from "react/jsx-runtime";
3096
3098
  function buildErrorMap(criticalIssues, columns) {
3097
3099
  const map = /* @__PURE__ */ new Map();
3098
3100
  for (const issue of criticalIssues) {
@@ -3405,6 +3407,7 @@ function EditFeed({
3405
3407
  const [statusMsg, setStatusMsg] = useState8("");
3406
3408
  const [errorMsg, setErrorMsg] = useState8("");
3407
3409
  const [transformedUrl] = useState8(initialTransformedUrl);
3410
+ const [maximized, setMaximized] = useState8(false);
3408
3411
  const errorMap = useMemo6(
3409
3412
  () => buildErrorMap(criticalIssues, columns),
3410
3413
  [criticalIssues, columns]
@@ -3522,81 +3525,103 @@ function EditFeed({
3522
3525
  skuField,
3523
3526
  onSubmit
3524
3527
  ]);
3525
- return /* @__PURE__ */ jsxs11("div", { className: "flex flex-col gap-3", children: [
3526
- /* @__PURE__ */ jsx22("div", { className: "flex items-center justify-between px-1", children: /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-2", children: [
3527
- /* @__PURE__ */ jsx22(AlertTriangle2, { className: "h-4 w-4 text-destructive" }),
3528
- /* @__PURE__ */ jsx22("span", { className: "font-medium text-sm", children: "Feed Validation Issues" }),
3529
- errorCount > 0 && /* @__PURE__ */ jsxs11(Badge, { variant: "destructive", className: "text-[10px]", children: [
3530
- errorCount,
3531
- " error",
3532
- errorCount !== 1 ? "s" : ""
3533
- ] }),
3534
- dataIssuesRaw.length > 0 && /* @__PURE__ */ jsxs11(Badge, { variant: "outline", className: "text-[10px] border-amber-400 text-amber-600 dark:text-amber-400", children: [
3535
- dataIssuesRaw.length,
3536
- " warning",
3537
- dataIssuesRaw.length !== 1 ? "s" : ""
3528
+ const content = /* @__PURE__ */ jsxs11(Fragment5, { children: [
3529
+ /* @__PURE__ */ jsxs11("div", { className: "flex items-center justify-between px-1 shrink-0", children: [
3530
+ /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-2", children: [
3531
+ /* @__PURE__ */ jsx22(AlertTriangle2, { className: "h-4 w-4 text-destructive" }),
3532
+ /* @__PURE__ */ jsx22("span", { className: "font-medium text-sm", children: "Feed Validation Issues" }),
3533
+ errorCount > 0 && /* @__PURE__ */ jsxs11(Badge, { variant: "destructive", className: "text-[10px]", children: [
3534
+ errorCount,
3535
+ " error",
3536
+ errorCount !== 1 ? "s" : ""
3537
+ ] }),
3538
+ dataIssuesRaw.length > 0 && /* @__PURE__ */ jsxs11(Badge, { variant: "outline", className: "text-[10px] border-amber-400 text-amber-600 dark:text-amber-400", children: [
3539
+ dataIssuesRaw.length,
3540
+ " warning",
3541
+ dataIssuesRaw.length !== 1 ? "s" : ""
3542
+ ] }),
3543
+ editedCells.size > 0 && /* @__PURE__ */ jsxs11(Badge, { variant: "secondary", className: "text-[10px]", children: [
3544
+ editedCells.size,
3545
+ " edited"
3546
+ ] })
3538
3547
  ] }),
3539
- editedCells.size > 0 && /* @__PURE__ */ jsxs11(Badge, { variant: "secondary", className: "text-[10px]", children: [
3540
- editedCells.size,
3541
- " edited"
3542
- ] })
3543
- ] }) }),
3544
- /* @__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." }),
3545
- statusMsg && /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-2 px-2 py-1.5 rounded bg-muted text-xs text-muted-foreground", children: [
3548
+ /* @__PURE__ */ jsx22(
3549
+ Button,
3550
+ {
3551
+ variant: "ghost",
3552
+ size: "sm",
3553
+ className: "h-7 w-7 p-0",
3554
+ onClick: () => setMaximized((v) => !v),
3555
+ title: maximized ? "Minimize" : "Maximize",
3556
+ children: maximized ? /* @__PURE__ */ jsx22(Minimize2, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx22(Maximize2, { className: "h-4 w-4" })
3557
+ }
3558
+ )
3559
+ ] }),
3560
+ /* @__PURE__ */ jsx22("p", { className: "text-xs text-muted-foreground px-1 shrink-0", 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." }),
3561
+ statusMsg && /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-2 px-2 py-1.5 rounded bg-muted text-xs text-muted-foreground shrink-0", children: [
3546
3562
  /* @__PURE__ */ jsx22(Loader26, { className: "h-3 w-3 animate-spin" }),
3547
3563
  statusMsg
3548
3564
  ] }),
3549
- errorMsg && /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-2 px-2 py-1.5 rounded bg-destructive/10 text-xs text-destructive", children: [
3565
+ errorMsg && /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-2 px-2 py-1.5 rounded bg-destructive/10 text-xs text-destructive shrink-0", children: [
3550
3566
  /* @__PURE__ */ jsx22(AlertTriangle2, { className: "h-3 w-3 shrink-0" }),
3551
3567
  errorMsg
3552
3568
  ] }),
3553
- /* @__PURE__ */ jsx22("div", { className: "overflow-auto border rounded-md max-h-[400px]", children: /* @__PURE__ */ jsxs11(Table, { children: [
3554
- /* @__PURE__ */ jsx22(TableHeader, { className: "sticky top-0 bg-muted/80 backdrop-blur-sm z-10", children: /* @__PURE__ */ jsxs11(TableRow, { children: [
3555
- /* @__PURE__ */ jsx22(TableHead, { className: "w-8 text-center", children: "#" }),
3556
- columns.map((col) => /* @__PURE__ */ jsx22(TableHead, { children: col }, col))
3557
- ] }) }),
3558
- /* @__PURE__ */ jsxs11(TableBody, { children: [
3559
- rows.map((row, rowIdx) => {
3560
- const sku = row[skuField] ?? "";
3561
- const rowErrors = errorMap.get(sku);
3562
- const missingAttrs = dataIssueMap.get(sku);
3563
- return /* @__PURE__ */ jsxs11(React8.Fragment, { children: [
3564
- /* @__PURE__ */ jsxs11(TableRow, { className: cn(rowErrors && "bg-destructive/5"), children: [
3565
- /* @__PURE__ */ jsx22(TableCell, { className: "text-center text-xs text-muted-foreground", children: rowIdx + 1 }),
3566
- columns.map((col) => {
3567
- const cellErr = rowErrors?.get(col);
3568
- return /* @__PURE__ */ jsx22(TableCell, { className: "p-0.5", children: /* @__PURE__ */ jsx22(
3569
- EditableCell2,
3570
- {
3571
- value: row[col] ?? "",
3572
- hasError: !!cellErr,
3573
- errorMessage: cellErr,
3574
- onChange: (val) => handleCellChange(rowIdx, col, val),
3575
- readOnly: isLoading,
3576
- onFetchSuggestions: cellErr ? () => fetchValidValues(
3577
- sourceMp,
3578
- marketplaceOv,
3579
- row["Category"] ?? "",
3580
- col
3581
- ) : void 0
3582
- }
3583
- ) }, col);
3584
- })
3585
- ] }),
3586
- missingAttrs && /* @__PURE__ */ jsx22("tr", { children: /* @__PURE__ */ jsx22("td", { colSpan: columns.length + 1, children: /* @__PURE__ */ jsx22(MissingAttributesBanner, { text: missingAttrs, defaultOpen: errorCount === 0 }) }) })
3587
- ] }, rowIdx);
3588
- }),
3589
- rows.length === 0 && /* @__PURE__ */ jsx22(TableRow, { children: /* @__PURE__ */ jsx22(
3590
- TableCell,
3591
- {
3592
- colSpan: columns.length + 1,
3593
- className: "text-center text-muted-foreground py-8",
3594
- children: "No error rows to display."
3595
- }
3596
- ) })
3597
- ] })
3598
- ] }) }),
3599
- /* @__PURE__ */ jsxs11("div", { className: "flex items-center justify-end gap-2 pt-1", children: [
3569
+ /* @__PURE__ */ jsx22(
3570
+ "div",
3571
+ {
3572
+ className: cn(
3573
+ "overflow-auto border rounded-md",
3574
+ maximized ? "flex-1 min-h-0" : "max-h-[400px]"
3575
+ ),
3576
+ children: /* @__PURE__ */ jsxs11(Table, { children: [
3577
+ /* @__PURE__ */ jsx22(TableHeader, { className: "sticky top-0 bg-muted/80 backdrop-blur-sm z-10", children: /* @__PURE__ */ jsxs11(TableRow, { children: [
3578
+ /* @__PURE__ */ jsx22(TableHead, { className: "w-8 text-center", children: "#" }),
3579
+ columns.map((col) => /* @__PURE__ */ jsx22(TableHead, { children: col }, col))
3580
+ ] }) }),
3581
+ /* @__PURE__ */ jsxs11(TableBody, { children: [
3582
+ rows.map((row, rowIdx) => {
3583
+ const sku = row[skuField] ?? "";
3584
+ const rowErrors = errorMap.get(sku);
3585
+ const missingAttrs = dataIssueMap.get(sku);
3586
+ return /* @__PURE__ */ jsxs11(React8.Fragment, { children: [
3587
+ /* @__PURE__ */ jsxs11(TableRow, { className: cn(rowErrors && "bg-destructive/5"), children: [
3588
+ /* @__PURE__ */ jsx22(TableCell, { className: "text-center text-xs text-muted-foreground", children: rowIdx + 1 }),
3589
+ columns.map((col) => {
3590
+ const cellErr = rowErrors?.get(col);
3591
+ return /* @__PURE__ */ jsx22(TableCell, { className: "p-0.5", children: /* @__PURE__ */ jsx22(
3592
+ EditableCell2,
3593
+ {
3594
+ value: row[col] ?? "",
3595
+ hasError: !!cellErr,
3596
+ errorMessage: cellErr,
3597
+ onChange: (val) => handleCellChange(rowIdx, col, val),
3598
+ readOnly: isLoading,
3599
+ onFetchSuggestions: cellErr ? () => fetchValidValues(
3600
+ sourceMp,
3601
+ marketplaceOv,
3602
+ row["Category"] ?? "",
3603
+ col
3604
+ ) : void 0
3605
+ }
3606
+ ) }, col);
3607
+ })
3608
+ ] }),
3609
+ missingAttrs && /* @__PURE__ */ jsx22("tr", { children: /* @__PURE__ */ jsx22("td", { colSpan: columns.length + 1, children: /* @__PURE__ */ jsx22(MissingAttributesBanner, { text: missingAttrs, defaultOpen: errorCount === 0 }) }) })
3610
+ ] }, rowIdx);
3611
+ }),
3612
+ rows.length === 0 && /* @__PURE__ */ jsx22(TableRow, { children: /* @__PURE__ */ jsx22(
3613
+ TableCell,
3614
+ {
3615
+ colSpan: columns.length + 1,
3616
+ className: "text-center text-muted-foreground py-8",
3617
+ children: "No error rows to display."
3618
+ }
3619
+ ) })
3620
+ ] })
3621
+ ] })
3622
+ }
3623
+ ),
3624
+ /* @__PURE__ */ jsxs11("div", { className: "flex items-center justify-end gap-2 pt-1 shrink-0", children: [
3600
3625
  /* @__PURE__ */ jsxs11(
3601
3626
  Button,
3602
3627
  {
@@ -3626,6 +3651,10 @@ function EditFeed({
3626
3651
  )
3627
3652
  ] })
3628
3653
  ] });
3654
+ if (maximized) {
3655
+ return /* @__PURE__ */ jsx22("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm", children: /* @__PURE__ */ jsx22("div", { className: "flex flex-col gap-3 bg-background border rounded-lg shadow-xl m-6 p-5 w-[calc(100%-3rem)] h-[calc(100%-3rem)] max-w-full max-h-full", children: content }) });
3656
+ }
3657
+ return /* @__PURE__ */ jsx22("div", { className: "flex flex-col gap-3", children: content });
3629
3658
  }
3630
3659
 
3631
3660
  // src/Automations/ProductAutomation.tsx
@@ -4091,7 +4120,7 @@ function BooleanField({
4091
4120
  }
4092
4121
 
4093
4122
  // src/Automations/ProductAutomation.tsx
4094
- import { Fragment as Fragment5, jsx as jsx24, jsxs as jsxs13 } from "react/jsx-runtime";
4123
+ import { Fragment as Fragment6, jsx as jsx24, jsxs as jsxs13 } from "react/jsx-runtime";
4095
4124
  function ProductAutomation({
4096
4125
  storeId,
4097
4126
  workspaceId,
@@ -4371,10 +4400,10 @@ function ProductAutomation({
4371
4400
  onClick: handleRun,
4372
4401
  disabled: !isRunAllowed() || applying,
4373
4402
  className: "flex-1",
4374
- children: applying ? /* @__PURE__ */ jsxs13(Fragment5, { children: [
4403
+ children: applying ? /* @__PURE__ */ jsxs13(Fragment6, { children: [
4375
4404
  /* @__PURE__ */ jsx24(Loader28, { className: "size-4 animate-spin" }),
4376
4405
  "Applying..."
4377
- ] }) : /* @__PURE__ */ jsxs13(Fragment5, { children: [
4406
+ ] }) : /* @__PURE__ */ jsxs13(Fragment6, { children: [
4378
4407
  /* @__PURE__ */ jsx24(Play, { className: "size-4" }),
4379
4408
  "Run Automation"
4380
4409
  ] })
@@ -4418,7 +4447,7 @@ function formatTimeSaved(totalSeconds) {
4418
4447
  // src/Automations/StoreAutomation.tsx
4419
4448
  import { useState as useState11, useEffect as useEffect8, useCallback as useCallback9, useRef as useRef7 } from "react";
4420
4449
  import { ArrowLeft as ArrowLeft4, Settings } from "lucide-react";
4421
- import { Fragment as Fragment6, jsx as jsx25, jsxs as jsxs14 } from "react/jsx-runtime";
4450
+ import { Fragment as Fragment7, jsx as jsx25, jsxs as jsxs14 } from "react/jsx-runtime";
4422
4451
  function StoreAutomation({
4423
4452
  storeId,
4424
4453
  channelsWithVersion,
@@ -4666,7 +4695,7 @@ function AutomationConfigEditor({
4666
4695
  onConfigChange: handleConfigChange
4667
4696
  }
4668
4697
  ) : /* @__PURE__ */ jsx25("p", { className: "py-4 text-center text-sm text-muted-foreground", children: "Enable this automation to configure it." }) }),
4669
- automation.preview && /* @__PURE__ */ jsxs14(Fragment6, { children: [
4698
+ automation.preview && /* @__PURE__ */ jsxs14(Fragment7, { children: [
4670
4699
  /* @__PURE__ */ jsx25(Separator2, {}),
4671
4700
  /* @__PURE__ */ jsxs14("div", { className: "space-y-2 rounded-lg bg-muted/50 p-3 text-sm", children: [
4672
4701
  automation.preview.info_text.map((text, i) => /* @__PURE__ */ jsx25("p", { className: "text-muted-foreground", children: text }, i)),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamoid/catalogix-chat",
3
- "version": "0.2.25",
3
+ "version": "0.2.27",
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",