@streamoid/catalogix-chat 0.2.25 → 0.2.26
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.js +135 -101
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3086,6 +3086,8 @@ 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,
|
|
@@ -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,110 +3525,141 @@ function EditFeed({
|
|
|
3522
3525
|
skuField,
|
|
3523
3526
|
onSubmit
|
|
3524
3527
|
]);
|
|
3525
|
-
return /* @__PURE__ */ jsxs11(
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
|
|
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: [
|
|
3546
|
-
/* @__PURE__ */ jsx22(Loader26, { className: "h-3 w-3 animate-spin" }),
|
|
3547
|
-
statusMsg
|
|
3548
|
-
] }),
|
|
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: [
|
|
3550
|
-
/* @__PURE__ */ jsx22(AlertTriangle2, { className: "h-3 w-3 shrink-0" }),
|
|
3551
|
-
errorMsg
|
|
3552
|
-
] }),
|
|
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
|
-
})
|
|
3528
|
+
return /* @__PURE__ */ jsxs11(
|
|
3529
|
+
"div",
|
|
3530
|
+
{
|
|
3531
|
+
className: cn(
|
|
3532
|
+
"flex flex-col gap-3",
|
|
3533
|
+
maximized && "fixed inset-0 z-50 bg-background p-4 overflow-auto"
|
|
3534
|
+
),
|
|
3535
|
+
children: [
|
|
3536
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex items-center justify-between px-1", children: [
|
|
3537
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-2", children: [
|
|
3538
|
+
/* @__PURE__ */ jsx22(AlertTriangle2, { className: "h-4 w-4 text-destructive" }),
|
|
3539
|
+
/* @__PURE__ */ jsx22("span", { className: "font-medium text-sm", children: "Feed Validation Issues" }),
|
|
3540
|
+
errorCount > 0 && /* @__PURE__ */ jsxs11(Badge, { variant: "destructive", className: "text-[10px]", children: [
|
|
3541
|
+
errorCount,
|
|
3542
|
+
" error",
|
|
3543
|
+
errorCount !== 1 ? "s" : ""
|
|
3585
3544
|
] }),
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
|
|
3590
|
-
|
|
3545
|
+
dataIssuesRaw.length > 0 && /* @__PURE__ */ jsxs11(Badge, { variant: "outline", className: "text-[10px] border-amber-400 text-amber-600 dark:text-amber-400", children: [
|
|
3546
|
+
dataIssuesRaw.length,
|
|
3547
|
+
" warning",
|
|
3548
|
+
dataIssuesRaw.length !== 1 ? "s" : ""
|
|
3549
|
+
] }),
|
|
3550
|
+
editedCells.size > 0 && /* @__PURE__ */ jsxs11(Badge, { variant: "secondary", className: "text-[10px]", children: [
|
|
3551
|
+
editedCells.size,
|
|
3552
|
+
" edited"
|
|
3553
|
+
] })
|
|
3554
|
+
] }),
|
|
3555
|
+
/* @__PURE__ */ jsx22(
|
|
3556
|
+
Button,
|
|
3557
|
+
{
|
|
3558
|
+
variant: "ghost",
|
|
3559
|
+
size: "sm",
|
|
3560
|
+
className: "h-7 w-7 p-0",
|
|
3561
|
+
onClick: () => setMaximized((v) => !v),
|
|
3562
|
+
title: maximized ? "Minimize" : "Maximize",
|
|
3563
|
+
children: maximized ? /* @__PURE__ */ jsx22(Minimize2, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx22(Maximize2, { className: "h-4 w-4" })
|
|
3564
|
+
}
|
|
3565
|
+
)
|
|
3566
|
+
] }),
|
|
3567
|
+
/* @__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." }),
|
|
3568
|
+
statusMsg && /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-2 px-2 py-1.5 rounded bg-muted text-xs text-muted-foreground", children: [
|
|
3569
|
+
/* @__PURE__ */ jsx22(Loader26, { className: "h-3 w-3 animate-spin" }),
|
|
3570
|
+
statusMsg
|
|
3571
|
+
] }),
|
|
3572
|
+
errorMsg && /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-2 px-2 py-1.5 rounded bg-destructive/10 text-xs text-destructive", children: [
|
|
3573
|
+
/* @__PURE__ */ jsx22(AlertTriangle2, { className: "h-3 w-3 shrink-0" }),
|
|
3574
|
+
errorMsg
|
|
3575
|
+
] }),
|
|
3576
|
+
/* @__PURE__ */ jsx22(
|
|
3577
|
+
"div",
|
|
3591
3578
|
{
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3579
|
+
className: cn(
|
|
3580
|
+
"overflow-auto border rounded-md",
|
|
3581
|
+
maximized ? "flex-1 min-h-0" : "max-h-[400px]"
|
|
3582
|
+
),
|
|
3583
|
+
children: /* @__PURE__ */ jsxs11(Table, { children: [
|
|
3584
|
+
/* @__PURE__ */ jsx22(TableHeader, { className: "sticky top-0 bg-muted/80 backdrop-blur-sm z-10", children: /* @__PURE__ */ jsxs11(TableRow, { children: [
|
|
3585
|
+
/* @__PURE__ */ jsx22(TableHead, { className: "w-8 text-center", children: "#" }),
|
|
3586
|
+
columns.map((col) => /* @__PURE__ */ jsx22(TableHead, { children: col }, col))
|
|
3587
|
+
] }) }),
|
|
3588
|
+
/* @__PURE__ */ jsxs11(TableBody, { children: [
|
|
3589
|
+
rows.map((row, rowIdx) => {
|
|
3590
|
+
const sku = row[skuField] ?? "";
|
|
3591
|
+
const rowErrors = errorMap.get(sku);
|
|
3592
|
+
const missingAttrs = dataIssueMap.get(sku);
|
|
3593
|
+
return /* @__PURE__ */ jsxs11(React8.Fragment, { children: [
|
|
3594
|
+
/* @__PURE__ */ jsxs11(TableRow, { className: cn(rowErrors && "bg-destructive/5"), children: [
|
|
3595
|
+
/* @__PURE__ */ jsx22(TableCell, { className: "text-center text-xs text-muted-foreground", children: rowIdx + 1 }),
|
|
3596
|
+
columns.map((col) => {
|
|
3597
|
+
const cellErr = rowErrors?.get(col);
|
|
3598
|
+
return /* @__PURE__ */ jsx22(TableCell, { className: "p-0.5", children: /* @__PURE__ */ jsx22(
|
|
3599
|
+
EditableCell2,
|
|
3600
|
+
{
|
|
3601
|
+
value: row[col] ?? "",
|
|
3602
|
+
hasError: !!cellErr,
|
|
3603
|
+
errorMessage: cellErr,
|
|
3604
|
+
onChange: (val) => handleCellChange(rowIdx, col, val),
|
|
3605
|
+
readOnly: isLoading,
|
|
3606
|
+
onFetchSuggestions: cellErr ? () => fetchValidValues(
|
|
3607
|
+
sourceMp,
|
|
3608
|
+
marketplaceOv,
|
|
3609
|
+
row["Category"] ?? "",
|
|
3610
|
+
col
|
|
3611
|
+
) : void 0
|
|
3612
|
+
}
|
|
3613
|
+
) }, col);
|
|
3614
|
+
})
|
|
3615
|
+
] }),
|
|
3616
|
+
missingAttrs && /* @__PURE__ */ jsx22("tr", { children: /* @__PURE__ */ jsx22("td", { colSpan: columns.length + 1, children: /* @__PURE__ */ jsx22(MissingAttributesBanner, { text: missingAttrs, defaultOpen: errorCount === 0 }) }) })
|
|
3617
|
+
] }, rowIdx);
|
|
3618
|
+
}),
|
|
3619
|
+
rows.length === 0 && /* @__PURE__ */ jsx22(TableRow, { children: /* @__PURE__ */ jsx22(
|
|
3620
|
+
TableCell,
|
|
3621
|
+
{
|
|
3622
|
+
colSpan: columns.length + 1,
|
|
3623
|
+
className: "text-center text-muted-foreground py-8",
|
|
3624
|
+
children: "No error rows to display."
|
|
3625
|
+
}
|
|
3626
|
+
) })
|
|
3627
|
+
] })
|
|
3628
|
+
] })
|
|
3595
3629
|
}
|
|
3596
|
-
)
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
}
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3630
|
+
),
|
|
3631
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex items-center justify-end gap-2 pt-1", children: [
|
|
3632
|
+
/* @__PURE__ */ jsxs11(
|
|
3633
|
+
Button,
|
|
3634
|
+
{
|
|
3635
|
+
variant: "outline",
|
|
3636
|
+
size: "sm",
|
|
3637
|
+
className: "gap-1.5",
|
|
3638
|
+
onClick: handleCancel,
|
|
3639
|
+
disabled: isLoading,
|
|
3640
|
+
children: [
|
|
3641
|
+
/* @__PURE__ */ jsx22(X2, { className: "h-3.5 w-3.5" }),
|
|
3642
|
+
"Cancel"
|
|
3643
|
+
]
|
|
3644
|
+
}
|
|
3645
|
+
),
|
|
3646
|
+
/* @__PURE__ */ jsxs11(
|
|
3647
|
+
Button,
|
|
3648
|
+
{
|
|
3649
|
+
onClick: handleFixAndRevalidate,
|
|
3650
|
+
size: "sm",
|
|
3651
|
+
className: "gap-1.5",
|
|
3652
|
+
disabled: isLoading,
|
|
3653
|
+
children: [
|
|
3654
|
+
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" }),
|
|
3655
|
+
errorCount > 0 ? "Fix & Re-validate" : editedCells.size > 0 ? "Fix & Re-validate" : "Proceed"
|
|
3656
|
+
]
|
|
3657
|
+
}
|
|
3658
|
+
)
|
|
3659
|
+
] })
|
|
3660
|
+
]
|
|
3661
|
+
}
|
|
3662
|
+
);
|
|
3629
3663
|
}
|
|
3630
3664
|
|
|
3631
3665
|
// src/Automations/ProductAutomation.tsx
|
package/package.json
CHANGED