@mercurjs/admin 2.2.0-canary.11 → 2.2.0-canary.13

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 title = found?.title || found?.sku || variantId || t("fields.variant", { defaultValue: "Variant" });
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
- "div",
376
- {
377
- className: "flex flex-col gap-y-3",
378
- "data-testid": `product-active-edit-variant-${variantId}`,
379
- children: [
380
- /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-3", children: [
381
- images && images.length > 0 && /* @__PURE__ */ jsx2(ImageStrip, { images }),
382
- /* @__PURE__ */ jsxs2(Text, { size: "small", leading: "compact", className: "text-ui-fg-subtle", children: [
383
- /* @__PURE__ */ jsx2("span", { className: "font-medium text-ui-fg-base", children: t("products.edits.panel.variantUpdated", {
384
- defaultValue: "Variant updated"
385
- }) }),
386
- ": ",
387
- title
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
- /* @__PURE__ */ jsx2("div", { className: "flex flex-col gap-y-4 pl-1", children: diffs.map((diff, idx) => /* @__PURE__ */ jsx2(FieldRow, { diff }, `${variantId}-${diff.field}-${idx}`)) })
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__ */ jsxs2("div", { className: "flex items-start gap-4 px-6 py-4", children: [
534
- /* @__PURE__ */ jsx2(
535
- Text,
536
- {
537
- size: "small",
538
- weight: "plus",
539
- leading: "compact",
540
- className: "text-ui-fg-subtle w-[160px] shrink-0",
541
- children: t("labels.updated")
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-OLFVJZ7T.js");
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-OLFVJZ7T.js"),
3502
+ lazy: () => import("./product-detail-5IEJPONZ.js"),
3503
3503
  children: [
3504
3504
  {
3505
3505
  path: "edit",
@@ -322,7 +322,7 @@ import "../chunk-FWJLS7XD.js";
322
322
  import "../chunk-3QSRE5LS.js";
323
323
  import {
324
324
  ProductDetailPage
325
- } from "../chunk-W6CW4WHC.js";
325
+ } from "../chunk-H4EHUOWL.js";
326
326
  import "../chunk-FI474ADU.js";
327
327
  import "../chunk-3XPXUIK3.js";
328
328
  import "../chunk-54RTJBYO.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ProductDetailPage
3
- } from "./chunk-W6CW4WHC.js";
3
+ } from "./chunk-H4EHUOWL.js";
4
4
  import "./chunk-FI474ADU.js";
5
5
  import "./chunk-3XPXUIK3.js";
6
6
  import "./chunk-54RTJBYO.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mercurjs/admin",
3
- "version": "2.2.0-canary.11",
3
+ "version": "2.2.0-canary.13",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/mercurjs/mercur",