@mercurjs/admin 2.2.0-canary.11 → 2.2.0-canary.12
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.
|
@@ -369,28 +369,57 @@ var VariantUpdateBlock = ({
|
|
|
369
369
|
}) => {
|
|
370
370
|
const { t } = useTranslation2();
|
|
371
371
|
const found = variantsById.get(variantId);
|
|
372
|
-
const
|
|
372
|
+
const variantFallback = t("fields.variant", { defaultValue: "Variant" });
|
|
373
|
+
const title = found?.title || found?.sku || variantId || variantFallback;
|
|
374
|
+
const sku = found?.sku && title !== found.sku ? found.sku : void 0;
|
|
373
375
|
const images = isImageList(found?.images) ? found?.images : void 0;
|
|
374
|
-
return /* @__PURE__ */ jsxs2(
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
376
|
+
return /* @__PURE__ */ jsxs2(Fragment2, { children: [
|
|
377
|
+
/* @__PURE__ */ jsxs2(
|
|
378
|
+
"div",
|
|
379
|
+
{
|
|
380
|
+
className: "flex items-start gap-4 px-6 py-4",
|
|
381
|
+
"data-testid": `product-active-edit-variant-${variantId}`,
|
|
382
|
+
children: [
|
|
383
|
+
/* @__PURE__ */ jsx2(
|
|
384
|
+
Text,
|
|
385
|
+
{
|
|
386
|
+
size: "small",
|
|
387
|
+
weight: "plus",
|
|
388
|
+
leading: "compact",
|
|
389
|
+
className: "text-ui-fg-subtle w-[160px] shrink-0",
|
|
390
|
+
children: variantFallback
|
|
391
|
+
}
|
|
392
|
+
),
|
|
393
|
+
/* @__PURE__ */ jsxs2("div", { className: "flex flex-1 items-center gap-2", children: [
|
|
394
|
+
images && images.length > 0 && /* @__PURE__ */ jsx2(ImageStrip, { images }),
|
|
395
|
+
/* @__PURE__ */ jsx2(
|
|
396
|
+
Text,
|
|
397
|
+
{
|
|
398
|
+
size: "small",
|
|
399
|
+
leading: "compact",
|
|
400
|
+
className: "text-ui-fg-base font-medium",
|
|
401
|
+
children: title
|
|
402
|
+
}
|
|
403
|
+
),
|
|
404
|
+
sku && /* @__PURE__ */ jsx2(Text, { size: "small", leading: "compact", className: "text-ui-fg-subtle", children: `\xB7 ${sku}` })
|
|
388
405
|
] })
|
|
389
|
-
]
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
406
|
+
]
|
|
407
|
+
}
|
|
408
|
+
),
|
|
409
|
+
diffs.length > 0 && /* @__PURE__ */ jsxs2("div", { className: "flex items-start gap-4 px-6 py-4", children: [
|
|
410
|
+
/* @__PURE__ */ jsx2(
|
|
411
|
+
Text,
|
|
412
|
+
{
|
|
413
|
+
size: "small",
|
|
414
|
+
weight: "plus",
|
|
415
|
+
leading: "compact",
|
|
416
|
+
className: "text-ui-fg-subtle w-[160px] shrink-0",
|
|
417
|
+
children: t("labels.updated")
|
|
418
|
+
}
|
|
419
|
+
),
|
|
420
|
+
/* @__PURE__ */ jsx2("div", { className: "flex flex-1 flex-col gap-y-4", children: diffs.map((diff, idx) => /* @__PURE__ */ jsx2(FieldRow, { diff }, `${variantId}-${diff.field}-${idx}`)) })
|
|
421
|
+
] })
|
|
422
|
+
] });
|
|
394
423
|
};
|
|
395
424
|
var ProductActiveEditSection = ({
|
|
396
425
|
product
|
|
@@ -530,29 +559,15 @@ var ProductActiveEditSection = ({
|
|
|
530
559
|
),
|
|
531
560
|
/* @__PURE__ */ jsx2("div", { className: "flex flex-1 flex-col gap-y-4", children: productUpdated.map((diff, idx) => /* @__PURE__ */ jsx2(FieldRow, { diff }, `${diff.field}-${idx}`)) })
|
|
532
561
|
] }),
|
|
533
|
-
variantsUpdated.size > 0 && /* @__PURE__ */
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
}
|
|
543
|
-
),
|
|
544
|
-
/* @__PURE__ */ jsx2("div", { className: "flex flex-1 flex-col gap-y-6", children: Array.from(variantsUpdated.entries()).map(
|
|
545
|
-
([variantId, diffs]) => /* @__PURE__ */ jsx2(
|
|
546
|
-
VariantUpdateBlock,
|
|
547
|
-
{
|
|
548
|
-
variantId,
|
|
549
|
-
diffs,
|
|
550
|
-
variantsById
|
|
551
|
-
},
|
|
552
|
-
variantId
|
|
553
|
-
)
|
|
554
|
-
) })
|
|
555
|
-
] }),
|
|
562
|
+
variantsUpdated.size > 0 && Array.from(variantsUpdated.entries()).map(([variantId, diffs]) => /* @__PURE__ */ jsx2(
|
|
563
|
+
VariantUpdateBlock,
|
|
564
|
+
{
|
|
565
|
+
variantId,
|
|
566
|
+
diffs,
|
|
567
|
+
variantsById
|
|
568
|
+
},
|
|
569
|
+
variantId
|
|
570
|
+
)),
|
|
556
571
|
added.length > 0 && /* @__PURE__ */ jsxs2("div", { className: "flex items-start gap-4 px-6 py-4", children: [
|
|
557
572
|
/* @__PURE__ */ jsx2(
|
|
558
573
|
Text,
|
package/dist/index.js
CHANGED
|
@@ -3487,7 +3487,7 @@ function getRouteMap({
|
|
|
3487
3487
|
path: ":id",
|
|
3488
3488
|
errorElement: /* @__PURE__ */ jsx17(ErrorBoundary, {}),
|
|
3489
3489
|
lazy: async () => {
|
|
3490
|
-
const { Breadcrumb, loader } = await import("./product-detail-
|
|
3490
|
+
const { Breadcrumb, loader } = await import("./product-detail-5IEJPONZ.js");
|
|
3491
3491
|
return {
|
|
3492
3492
|
Component: Outlet4,
|
|
3493
3493
|
loader,
|
|
@@ -3499,7 +3499,7 @@ function getRouteMap({
|
|
|
3499
3499
|
children: [
|
|
3500
3500
|
{
|
|
3501
3501
|
path: "",
|
|
3502
|
-
lazy: () => import("./product-detail-
|
|
3502
|
+
lazy: () => import("./product-detail-5IEJPONZ.js"),
|
|
3503
3503
|
children: [
|
|
3504
3504
|
{
|
|
3505
3505
|
path: "edit",
|
package/dist/pages/index.js
CHANGED
|
@@ -322,7 +322,7 @@ import "../chunk-FWJLS7XD.js";
|
|
|
322
322
|
import "../chunk-3QSRE5LS.js";
|
|
323
323
|
import {
|
|
324
324
|
ProductDetailPage
|
|
325
|
-
} from "../chunk-
|
|
325
|
+
} from "../chunk-H4EHUOWL.js";
|
|
326
326
|
import "../chunk-FI474ADU.js";
|
|
327
327
|
import "../chunk-3XPXUIK3.js";
|
|
328
328
|
import "../chunk-54RTJBYO.js";
|