@mercurjs/vendor 2.2.0-canary.12 → 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.
- package/dist/{[id]-Q4HX3TQU.js → [id]-ET35KT2M.js} +3 -3
- package/dist/{[id]-A55T2ORL.js → [id]-FALIOGXK.js} +3 -4
- package/dist/{[id]-GC3ZYPK4.js → [id]-GY5R652O.js} +5 -6
- package/dist/{[id]-GBT6VB4S.js → [id]-IGQTT3AM.js} +4 -5
- package/dist/{[id]-SHAJTJNZ.js → [id]-IW2AZE77.js} +5 -6
- package/dist/{[id]-FE5GYYVZ.js → [id]-OTK2NOXT.js} +3 -4
- package/dist/{[id]-WDBUNEJB.js → [id]-PEUI67SP.js} +2 -2
- package/dist/{[id]-T5ECVBPF.js → [id]-RFEYRBLI.js} +4 -5
- package/dist/{[id]-OWENEUQB.js → [id]-US6IULL2.js} +147 -441
- package/dist/{[id]-QOEO3JOV.js → [id]-YZSVSJWU.js} +3 -4
- package/dist/{[id]-QQU5HVFU.js → [id]-ZMLS73X5.js} +4 -5
- package/dist/{[province_id]-6GUA4PV5.js → [province_id]-J3OB2LZ4.js} +5 -6
- package/dist/{add-NTRYWOJF.js → add-XEUXK63F.js} +6 -7
- package/dist/{add-customer-groups-U5RZWW4B.js → add-customer-groups-HZNWWRVG.js} +3 -4
- package/dist/{add-products-Q4MMDQKT.js → add-products-E5GULF6B.js} +4 -5
- package/dist/{add-promotions-DH5CD5AT.js → add-promotions-KW5YZHLS.js} +3 -3
- package/dist/{address-77Y3AOQ3.js → address-6T4H6P7O.js} +3 -4
- package/dist/{breadcrumb-EVZIOB2G.js → breadcrumb-5HYIEPCL.js} +3 -4
- package/dist/{breadcrumb-TNJSGX4T.js → breadcrumb-HL7NKNX4.js} +3 -4
- package/dist/{breadcrumb-THJ2HPRB.js → breadcrumb-L3MFH4I2.js} +9 -8
- package/dist/{breadcrumb-5NP23D6X.js → breadcrumb-LKLWHB63.js} +4 -5
- package/dist/breadcrumb-ZMACILH3.js +28 -0
- package/dist/chunk-4WCPN4OA.js +315 -0
- package/dist/{chunk-23LX6FBE.js → chunk-5YCDZ4AU.js} +1 -1
- package/dist/{chunk-N77NE6O7.js → chunk-A6QH53CS.js} +8 -2
- package/dist/{chunk-TM76WRG2.js → chunk-AQTEEQWX.js} +1 -1
- package/dist/{chunk-K6LOZ4S3.js → chunk-DEJIBIQZ.js} +1 -1
- package/dist/{chunk-4LVP635F.js → chunk-DNEPOMOX.js} +125 -125
- package/dist/{chunk-CBRAKSMA.js → chunk-J7ZU2HZZ.js} +1 -1
- package/dist/{chunk-OZ44ATGE.js → chunk-KJWVLGXG.js} +2 -2
- package/dist/{chunk-LKUW5SV4.js → chunk-LDX23XPT.js} +1 -1
- package/dist/{chunk-55OUOPNF.js → chunk-MVYAN2RR.js} +4 -4
- package/dist/{chunk-TBYCZRZ7.js → chunk-R5QZO3QY.js} +14 -5
- package/dist/{chunk-UORPTGV2.js → chunk-SIEEMXNZ.js} +10 -14
- package/dist/chunk-SJT6A4AV.js +354 -0
- package/dist/{chunk-2UXFGPKI.js → chunk-STWHJLVV.js} +1 -1
- package/dist/{chunk-TYESCFYW.js → chunk-UDOBGAP7.js} +1 -1
- package/dist/{chunk-6K6EQOJF.js → chunk-VAOJVT7R.js} +1 -1
- package/dist/{chunk-VCOQ7WQ2.js → chunk-VMFC2UDJ.js} +1 -1
- package/dist/chunk-XQUF3WIS.js +159 -0
- package/dist/{chunk-7IPCLQ5V.js → chunk-YPTJETJQ.js} +2 -2
- package/dist/{chunk-X4GWB6AT.js → chunk-ZBSFGCWY.js} +2 -2
- package/dist/{chunk-7DBAV3KH.js → chunk-ZPH3WXJ6.js} +1 -1
- package/dist/{collections-URH2TCWJ.js → collections-HO2F62RN.js} +4 -5
- package/dist/{create-FKRYB7ZS.js → create-7EVR4N6N.js} +1 -1
- package/dist/{create-JF2OUZQA.js → create-DB4EYPJ5.js} +3 -4
- package/dist/{create-JGYG5SBM.js → create-EFMCNOR5.js} +6 -7
- package/dist/{create-MS6KKFSV.js → create-FBPPNBLQ.js} +3 -4
- package/dist/{create-ODOFJF5N.js → create-J5OLH7OJ.js} +7 -8
- package/dist/{create-O35JRZEF.js → create-QAEOARJO.js} +4 -5
- package/dist/{create-XEQZ6CLI.js → create-QZBCYHHQ.js} +8 -9
- package/dist/{create-A7B3MLJX.js → create-SLJ2BMH7.js} +5 -6
- package/dist/{create-GGACODDN.js → create-WQ5TM5IZ.js} +1 -1
- package/dist/{edit-2AAEQJEM.js → edit-3O6WVIMM.js} +5 -6
- package/dist/{edit-VVLITC2E.js → edit-G57GESSR.js} +1 -1
- package/dist/edit-PUZ23M7V.js +102 -0
- package/dist/{edit-G2E5SNGU.js → edit-PVJ3S4TW.js} +3 -4
- package/dist/{edit-2R5QCPTB.js → edit-RJE7L3PH.js} +3 -4
- package/dist/{edit-HTLLYECP.js → edit-TIRMXOLT.js} +6 -7
- package/dist/{edit-5CROKEJE.js → edit-W6WKYNOG.js} +5 -6
- package/dist/{edit-OKU6FMHJ.js → edit-WPX2ANVI.js} +3 -4
- package/dist/{edit-3E4ZO7HT.js → edit-YW4RBDPH.js} +6 -7
- package/dist/edit-price-5ICQPJ42.js +196 -0
- package/dist/edit-stock-KS2NFC2Z.js +229 -0
- package/dist/{fulfillment-76IVZ266.js → fulfillment-ZV2R43N2.js} +3 -4
- package/dist/{fulfillment-providers-G2L6LEVO.js → fulfillment-providers-KKCL25KA.js} +4 -5
- package/dist/index.css +6 -3
- package/dist/index.js +138 -102
- package/dist/{offer-inventory-batch-page-BD6PMDLW.js → inventory-5UNDKYDL.js} +12 -12
- package/dist/{invite-2673PU4I.js → invite-KKIJNMER.js} +6 -7
- package/dist/{invite-HRXZ5YBP.js → invite-P7I5BGOJ.js} +3 -4
- package/dist/loader-UZTTBKYF.js +33 -0
- package/dist/loader-WEJZTX5Q.js +34 -0
- package/dist/{login-TWUBU6I6.js → login-A65IAXSI.js} +4 -5
- package/dist/{media-LVQQTWOJ.js → media-EM3K4AWO.js} +6 -7
- package/dist/{metadata-Q74OJWUD.js → metadata-A5XZKPL4.js} +4 -5
- package/dist/{metadata-D6M66NQK.js → metadata-JFLFWXOS.js} +3 -4
- package/dist/{metadata-YVHJPDLD.js → metadata-SFO3J5O5.js} +3 -4
- package/dist/{metadata-NIDIBXJT.js → metadata-USXOQUIX.js} +3 -4
- package/dist/{metadata-REQIFWWH.js → metadata-WJ4CNB6I.js} +3 -4
- package/dist/{offer-create-page-E4FLSDJQ.js → offer-create-page-3PIJXHWZ.js} +169 -173
- package/dist/offer-detail-page-SPHP3XKC.js +580 -0
- package/dist/{offer-detail-page-6SIBQTLP.js → offer-variant-detail-page-KTHKV6WW.js} +144 -215
- package/dist/offers-GWMIEPCM.js +54 -0
- package/dist/{onboarding-MK2RIFD4.js → onboarding-JOGRNDPI.js} +3 -4
- package/dist/{orders-TVQDR4OJ.js → orders-Q2IKEJIM.js} +4 -5
- package/dist/{organization-XO3T2K2X.js → organization-HRYDC66D.js} +3 -4
- package/dist/pages/index.js +25 -27
- package/dist/{payment-details-CFTX3QDL.js → payment-details-YLPIR52N.js} +3 -4
- package/dist/{pricing-ECXV6K7G.js → pricing-ECJH4VXZ.js} +5 -6
- package/dist/{offer-pricing-edit-page-4TINK42V.js → pricing-EPNQ63NT.js} +15 -13
- package/dist/{product-tags-5O7ZG6SA.js → product-tags-WMC7G3C4.js} +5 -6
- package/dist/{product-variant-detail-PUWOMVHQ.js → product-variant-detail-BQL2NGVE.js} +3 -4
- package/dist/{products-6XWNKRLZ.js → products-LGQMESEZ.js} +10 -11
- package/dist/{products-BM3IIH5P.js → products-PQ3FG5KC.js} +4 -5
- package/dist/{professional-details-ED4HNYXY.js → professional-details-AASVGTUO.js} +3 -4
- package/dist/{profile-6TGCNNUU.js → profile-ZNQEDSDM.js} +3 -4
- package/dist/{promotions-ACIFBWUH.js → promotions-MFAFFHF3.js} +4 -4
- package/dist/{register-4AQP5DC3.js → register-3A6G6QNI.js} +5 -6
- package/dist/{reset-password-VSAY3YQX.js → reset-password-FV5762CA.js} +1 -1
- package/dist/{settings-2GCQQTO6.js → settings-OKNGWUKL.js} +12 -13
- package/dist/{shipment-HWQHMX2L.js → shipment-ZF7IRKKS.js} +3 -4
- package/dist/shipping-HWJPX34K.js +113 -0
- package/dist/{shipping-profiles-C5WBXWZ2.js → shipping-profiles-FZCKGCBU.js} +3 -4
- package/dist/{stock-MQA7PRO6.js → stock-FI5WXVWN.js} +4 -5
- package/dist/{store-5ZHZR4JI.js → store-VFRKJYMD.js} +3 -4
- package/dist/{store-closure-H5WHV3LA.js → store-closure-WZIWGESD.js} +3 -4
- package/dist/{store-select-PZS556FB.js → store-select-GKRDFGEY.js} +4 -5
- package/dist/{team-CLKJCZNH.js → team-CXEAYN7O.js} +3 -4
- package/package.json +1 -1
- package/dist/chunk-27KRIXMQ.js +0 -71
- package/dist/chunk-CFRWIQIZ.js +0 -43
- package/dist/chunk-RXV7INUV.js +0 -426
- package/dist/chunk-T6LHVNWO.js +0 -27
- package/dist/loader-VDYPD3RI.js +0 -31
- package/dist/offer-edit-page-3MO566RP.js +0 -151
- package/dist/offers-GVN5LCK6.js +0 -32
- package/dist/{chunk-SPOHNK4X.js → chunk-BPVMJN2D.js} +3 -3
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ProductGeneralSection,
|
|
3
|
+
ProductMediaSection
|
|
4
|
+
} from "./chunk-4WCPN4OA.js";
|
|
1
5
|
import {
|
|
2
6
|
SectionRow
|
|
3
7
|
} from "./chunk-4TLP3TAA.js";
|
|
@@ -32,7 +36,7 @@ import {
|
|
|
32
36
|
} from "./chunk-INNFZYX2.js";
|
|
33
37
|
import {
|
|
34
38
|
useProductTag
|
|
35
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-R5QZO3QY.js";
|
|
36
40
|
import "./chunk-F4OJN2F2.js";
|
|
37
41
|
import "./chunk-LRARA622.js";
|
|
38
42
|
import "./chunk-M6N4ISXL.js";
|
|
@@ -42,10 +46,9 @@ import {
|
|
|
42
46
|
} from "./chunk-VV6IKGCN.js";
|
|
43
47
|
import "./chunk-BXRNZS5K.js";
|
|
44
48
|
import "./chunk-BOZJOOGW.js";
|
|
45
|
-
import "./chunk-
|
|
49
|
+
import "./chunk-IQWK723D.js";
|
|
46
50
|
import "./chunk-4S6XGIC6.js";
|
|
47
51
|
import "./chunk-S23FD6FA.js";
|
|
48
|
-
import "./chunk-IQWK723D.js";
|
|
49
52
|
import {
|
|
50
53
|
useCollection
|
|
51
54
|
} from "./chunk-DDJQRV6E.js";
|
|
@@ -57,7 +60,7 @@ import {
|
|
|
57
60
|
import "./chunk-VZUA5SRD.js";
|
|
58
61
|
import "./chunk-VXMOPVRH.js";
|
|
59
62
|
import "./chunk-NBPMNUKZ.js";
|
|
60
|
-
import "./chunk-
|
|
63
|
+
import "./chunk-SIEEMXNZ.js";
|
|
61
64
|
import "./chunk-Y2MQ5EMD.js";
|
|
62
65
|
import {
|
|
63
66
|
useSalesChannels
|
|
@@ -75,14 +78,12 @@ import {
|
|
|
75
78
|
productAttributesQueryKeys,
|
|
76
79
|
productsQueryKeys,
|
|
77
80
|
useCancelProductEdit,
|
|
78
|
-
useDeleteProduct,
|
|
79
81
|
useDeleteVariantLazy,
|
|
80
82
|
useProduct,
|
|
81
83
|
useProductAttribute,
|
|
82
84
|
useProductChange,
|
|
83
85
|
useProductVariants,
|
|
84
|
-
useRemoveProductAttribute
|
|
85
|
-
useUpdateProduct
|
|
86
|
+
useRemoveProductAttribute
|
|
86
87
|
} from "./chunk-JAUZ73XE.js";
|
|
87
88
|
import "./chunk-A5DJIOHN.js";
|
|
88
89
|
import {
|
|
@@ -573,325 +574,30 @@ var ProductActiveEditSection = ({
|
|
|
573
574
|
);
|
|
574
575
|
};
|
|
575
576
|
|
|
576
|
-
// src/pages/products/[id]/_components/product-
|
|
577
|
-
import { PencilSquare
|
|
578
|
-
import { Container as Container2, Heading as Heading2,
|
|
577
|
+
// src/pages/products/[id]/_components/product-organization-section/product-organization-section.tsx
|
|
578
|
+
import { PencilSquare } from "@medusajs/icons";
|
|
579
|
+
import { Badge, Container as Container2, Heading as Heading2, Tooltip } from "@medusajs/ui";
|
|
579
580
|
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
580
|
-
import { useNavigate } from "react-router-dom";
|
|
581
|
-
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
582
|
-
var productStatusColor = (status) => {
|
|
583
|
-
switch (status) {
|
|
584
|
-
case "draft":
|
|
585
|
-
return "grey";
|
|
586
|
-
case "proposed":
|
|
587
|
-
return "orange";
|
|
588
|
-
case "published":
|
|
589
|
-
return "green";
|
|
590
|
-
case "rejected":
|
|
591
|
-
return "red";
|
|
592
|
-
default:
|
|
593
|
-
return "grey";
|
|
594
|
-
}
|
|
595
|
-
};
|
|
596
|
-
var ProductGeneralSection = ({
|
|
597
|
-
product
|
|
598
|
-
}) => {
|
|
599
|
-
const { t } = useTranslation2();
|
|
600
|
-
const prompt = usePrompt2();
|
|
601
|
-
const navigate = useNavigate();
|
|
602
|
-
const { mutateAsync } = useDeleteProduct(product.id);
|
|
603
|
-
const handleDelete = async () => {
|
|
604
|
-
const res = await prompt({
|
|
605
|
-
title: t("general.areYouSure"),
|
|
606
|
-
description: t("products.deleteWarning", {
|
|
607
|
-
title: product.title
|
|
608
|
-
}),
|
|
609
|
-
confirmText: t("actions.delete"),
|
|
610
|
-
cancelText: t("actions.cancel")
|
|
611
|
-
});
|
|
612
|
-
if (!res) {
|
|
613
|
-
return;
|
|
614
|
-
}
|
|
615
|
-
await mutateAsync(void 0, {
|
|
616
|
-
onSuccess: () => {
|
|
617
|
-
navigate("..");
|
|
618
|
-
}
|
|
619
|
-
});
|
|
620
|
-
};
|
|
621
|
-
return /* @__PURE__ */ jsxs2(Container2, { className: "divide-y p-0", children: [
|
|
622
|
-
/* @__PURE__ */ jsxs2("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
623
|
-
/* @__PURE__ */ jsx2(Heading2, { children: product.title }),
|
|
624
|
-
/* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-x-4", children: [
|
|
625
|
-
/* @__PURE__ */ jsx2(StatusBadge, { color: productStatusColor(product.status), children: t(`products.productStatus.${product.status}`) }),
|
|
626
|
-
/* @__PURE__ */ jsx2(
|
|
627
|
-
ActionMenu,
|
|
628
|
-
{
|
|
629
|
-
groups: [
|
|
630
|
-
{
|
|
631
|
-
actions: [
|
|
632
|
-
{
|
|
633
|
-
label: t("actions.edit"),
|
|
634
|
-
to: "edit",
|
|
635
|
-
icon: /* @__PURE__ */ jsx2(PencilSquare, {})
|
|
636
|
-
}
|
|
637
|
-
]
|
|
638
|
-
},
|
|
639
|
-
{
|
|
640
|
-
actions: [
|
|
641
|
-
{
|
|
642
|
-
label: t("actions.delete"),
|
|
643
|
-
onClick: handleDelete,
|
|
644
|
-
icon: /* @__PURE__ */ jsx2(Trash, {})
|
|
645
|
-
}
|
|
646
|
-
]
|
|
647
|
-
}
|
|
648
|
-
]
|
|
649
|
-
}
|
|
650
|
-
)
|
|
651
|
-
] })
|
|
652
|
-
] }),
|
|
653
|
-
/* @__PURE__ */ jsx2(
|
|
654
|
-
SectionRow,
|
|
655
|
-
{
|
|
656
|
-
title: t("fields.description"),
|
|
657
|
-
value: product.description || "-"
|
|
658
|
-
}
|
|
659
|
-
),
|
|
660
|
-
/* @__PURE__ */ jsx2(
|
|
661
|
-
SectionRow,
|
|
662
|
-
{
|
|
663
|
-
title: t("fields.subtitle"),
|
|
664
|
-
value: product.subtitle || "-"
|
|
665
|
-
}
|
|
666
|
-
),
|
|
667
|
-
/* @__PURE__ */ jsx2(SectionRow, { title: t("fields.handle"), value: `/${product.handle}` }),
|
|
668
|
-
/* @__PURE__ */ jsx2(
|
|
669
|
-
SectionRow,
|
|
670
|
-
{
|
|
671
|
-
title: t("fields.discountable"),
|
|
672
|
-
value: product.discountable ? t("general.true") : t("general.false")
|
|
673
|
-
}
|
|
674
|
-
)
|
|
675
|
-
] });
|
|
676
|
-
};
|
|
677
|
-
|
|
678
|
-
// src/pages/products/[id]/_components/product-media-section/product-media-section.tsx
|
|
679
|
-
import { useState } from "react";
|
|
680
|
-
import { PencilSquare as PencilSquare2, ThumbnailBadge } from "@medusajs/icons";
|
|
681
|
-
import {
|
|
682
|
-
Button as Button2,
|
|
683
|
-
Checkbox,
|
|
684
|
-
clx,
|
|
685
|
-
CommandBar,
|
|
686
|
-
Container as Container3,
|
|
687
|
-
Heading as Heading3,
|
|
688
|
-
Text as Text2,
|
|
689
|
-
Tooltip,
|
|
690
|
-
usePrompt as usePrompt3
|
|
691
|
-
} from "@medusajs/ui";
|
|
692
|
-
import { useTranslation as useTranslation3 } from "react-i18next";
|
|
693
581
|
import { Link } from "react-router-dom";
|
|
694
|
-
import { jsx as
|
|
695
|
-
var ProductMediaSection = ({
|
|
696
|
-
product
|
|
697
|
-
}) => {
|
|
698
|
-
const { t } = useTranslation3();
|
|
699
|
-
const prompt = usePrompt3();
|
|
700
|
-
const [selection, setSelection] = useState({});
|
|
701
|
-
const media = getMedia(product);
|
|
702
|
-
const handleCheckedChange = (id) => {
|
|
703
|
-
setSelection((prev) => {
|
|
704
|
-
if (prev[id]) {
|
|
705
|
-
const { [id]: _, ...rest } = prev;
|
|
706
|
-
return rest;
|
|
707
|
-
} else {
|
|
708
|
-
return { ...prev, [id]: true };
|
|
709
|
-
}
|
|
710
|
-
});
|
|
711
|
-
};
|
|
712
|
-
const { mutateAsync } = useUpdateProduct(product.id);
|
|
713
|
-
const handleDelete = async () => {
|
|
714
|
-
const ids = Object.keys(selection);
|
|
715
|
-
const includingThumbnail = ids.some((id) => media.find((m) => m.id === id)?.isThumbnail);
|
|
716
|
-
const res = await prompt({
|
|
717
|
-
title: t("general.areYouSure"),
|
|
718
|
-
description: includingThumbnail ? t("products.media.deleteWarningWithThumbnail", {
|
|
719
|
-
count: ids.length
|
|
720
|
-
}) : t("products.media.deleteWarning", {
|
|
721
|
-
count: ids.length
|
|
722
|
-
}),
|
|
723
|
-
confirmText: t("actions.delete"),
|
|
724
|
-
cancelText: t("actions.cancel")
|
|
725
|
-
});
|
|
726
|
-
if (!res) {
|
|
727
|
-
return;
|
|
728
|
-
}
|
|
729
|
-
const mediaToKeep = product.images?.filter((i) => !ids.includes(i.id)).map((i) => ({ url: i.url }));
|
|
730
|
-
await mutateAsync(
|
|
731
|
-
{
|
|
732
|
-
images: mediaToKeep,
|
|
733
|
-
thumbnail: includingThumbnail ? "" : void 0
|
|
734
|
-
},
|
|
735
|
-
{
|
|
736
|
-
onSuccess: () => {
|
|
737
|
-
setSelection({});
|
|
738
|
-
}
|
|
739
|
-
}
|
|
740
|
-
);
|
|
741
|
-
};
|
|
742
|
-
return /* @__PURE__ */ jsxs3(Container3, { className: "divide-y p-0", children: [
|
|
743
|
-
/* @__PURE__ */ jsxs3("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
744
|
-
/* @__PURE__ */ jsx3(Heading3, { level: "h2", children: t("products.media.label") }),
|
|
745
|
-
/* @__PURE__ */ jsx3(
|
|
746
|
-
ActionMenu,
|
|
747
|
-
{
|
|
748
|
-
groups: [
|
|
749
|
-
{
|
|
750
|
-
actions: [
|
|
751
|
-
{
|
|
752
|
-
label: t("actions.edit"),
|
|
753
|
-
to: "media?view=edit",
|
|
754
|
-
icon: /* @__PURE__ */ jsx3(PencilSquare2, {})
|
|
755
|
-
}
|
|
756
|
-
]
|
|
757
|
-
}
|
|
758
|
-
]
|
|
759
|
-
}
|
|
760
|
-
)
|
|
761
|
-
] }),
|
|
762
|
-
media.length > 0 ? /* @__PURE__ */ jsx3("div", { className: "grid grid-cols-[repeat(auto-fill,minmax(96px,1fr))] gap-4 px-6 py-4", children: media.map((i, index) => {
|
|
763
|
-
const isSelected = selection[i.id];
|
|
764
|
-
return /* @__PURE__ */ jsxs3(
|
|
765
|
-
"div",
|
|
766
|
-
{
|
|
767
|
-
className: "group relative aspect-square size-full cursor-pointer overflow-hidden rounded-[8px] shadow-elevation-card-rest transition-fg hover:shadow-elevation-card-hover",
|
|
768
|
-
children: [
|
|
769
|
-
/* @__PURE__ */ jsx3(
|
|
770
|
-
"div",
|
|
771
|
-
{
|
|
772
|
-
className: clx(
|
|
773
|
-
"invisible absolute right-2 top-2 opacity-0 transition-fg group-hover:visible group-hover:opacity-100",
|
|
774
|
-
{
|
|
775
|
-
"visible opacity-100": isSelected
|
|
776
|
-
}
|
|
777
|
-
),
|
|
778
|
-
children: /* @__PURE__ */ jsx3(
|
|
779
|
-
Checkbox,
|
|
780
|
-
{
|
|
781
|
-
checked: selection[i.id] || false,
|
|
782
|
-
onCheckedChange: () => handleCheckedChange(i.id)
|
|
783
|
-
}
|
|
784
|
-
)
|
|
785
|
-
}
|
|
786
|
-
),
|
|
787
|
-
i.isThumbnail && /* @__PURE__ */ jsx3("div", { className: "absolute left-2 top-2", children: /* @__PURE__ */ jsx3(Tooltip, { content: t("fields.thumbnail"), children: /* @__PURE__ */ jsx3(ThumbnailBadge, {}) }) }),
|
|
788
|
-
/* @__PURE__ */ jsx3(
|
|
789
|
-
Link,
|
|
790
|
-
{
|
|
791
|
-
to: `media`,
|
|
792
|
-
state: { curr: index },
|
|
793
|
-
children: /* @__PURE__ */ jsx3(
|
|
794
|
-
"img",
|
|
795
|
-
{
|
|
796
|
-
src: i.url,
|
|
797
|
-
alt: product.title,
|
|
798
|
-
className: "size-full object-cover"
|
|
799
|
-
}
|
|
800
|
-
)
|
|
801
|
-
}
|
|
802
|
-
)
|
|
803
|
-
]
|
|
804
|
-
},
|
|
805
|
-
i.id
|
|
806
|
-
);
|
|
807
|
-
}) }) : /* @__PURE__ */ jsxs3("div", { className: "flex flex-col items-center gap-y-4 pb-8 pt-6", children: [
|
|
808
|
-
/* @__PURE__ */ jsxs3("div", { className: "flex flex-col items-center", children: [
|
|
809
|
-
/* @__PURE__ */ jsx3(
|
|
810
|
-
Text2,
|
|
811
|
-
{
|
|
812
|
-
size: "small",
|
|
813
|
-
leading: "compact",
|
|
814
|
-
weight: "plus",
|
|
815
|
-
className: "text-ui-fg-subtle",
|
|
816
|
-
children: t("products.media.emptyState.header")
|
|
817
|
-
}
|
|
818
|
-
),
|
|
819
|
-
/* @__PURE__ */ jsx3(
|
|
820
|
-
Text2,
|
|
821
|
-
{
|
|
822
|
-
size: "small",
|
|
823
|
-
className: "text-ui-fg-muted",
|
|
824
|
-
children: t("products.media.emptyState.description")
|
|
825
|
-
}
|
|
826
|
-
)
|
|
827
|
-
] }),
|
|
828
|
-
/* @__PURE__ */ jsx3(
|
|
829
|
-
Button2,
|
|
830
|
-
{
|
|
831
|
-
size: "small",
|
|
832
|
-
variant: "secondary",
|
|
833
|
-
asChild: true,
|
|
834
|
-
children: /* @__PURE__ */ jsx3(Link, { to: "media?view=edit", children: t("products.media.emptyState.action") })
|
|
835
|
-
}
|
|
836
|
-
)
|
|
837
|
-
] }),
|
|
838
|
-
/* @__PURE__ */ jsx3(CommandBar, { open: !!Object.keys(selection).length, children: /* @__PURE__ */ jsxs3(CommandBar.Bar, { children: [
|
|
839
|
-
/* @__PURE__ */ jsx3(CommandBar.Value, { children: t("general.countSelected", {
|
|
840
|
-
count: Object.keys(selection).length
|
|
841
|
-
}) }),
|
|
842
|
-
/* @__PURE__ */ jsx3(CommandBar.Seperator, {}),
|
|
843
|
-
/* @__PURE__ */ jsx3(
|
|
844
|
-
CommandBar.Command,
|
|
845
|
-
{
|
|
846
|
-
action: handleDelete,
|
|
847
|
-
label: t("actions.delete"),
|
|
848
|
-
shortcut: "d"
|
|
849
|
-
}
|
|
850
|
-
)
|
|
851
|
-
] }) })
|
|
852
|
-
] });
|
|
853
|
-
};
|
|
854
|
-
var getMedia = (product) => {
|
|
855
|
-
const { images = [], thumbnail } = product;
|
|
856
|
-
const media = (images || []).map((image) => ({
|
|
857
|
-
id: image.id,
|
|
858
|
-
url: image.url,
|
|
859
|
-
isThumbnail: image.url === thumbnail
|
|
860
|
-
}));
|
|
861
|
-
if (thumbnail && !media.some((mediaItem) => mediaItem.url === thumbnail)) {
|
|
862
|
-
media.unshift({
|
|
863
|
-
id: "img_thumbnail",
|
|
864
|
-
url: thumbnail,
|
|
865
|
-
isThumbnail: true
|
|
866
|
-
});
|
|
867
|
-
}
|
|
868
|
-
return media;
|
|
869
|
-
};
|
|
870
|
-
|
|
871
|
-
// src/pages/products/[id]/_components/product-organization-section/product-organization-section.tsx
|
|
872
|
-
import { PencilSquare as PencilSquare3 } from "@medusajs/icons";
|
|
873
|
-
import { Badge, Container as Container4, Heading as Heading4, Tooltip as Tooltip2 } from "@medusajs/ui";
|
|
874
|
-
import { useTranslation as useTranslation4 } from "react-i18next";
|
|
875
|
-
import { Link as Link2 } from "react-router-dom";
|
|
876
|
-
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
582
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
877
583
|
var ProductOrganizationSection = ({
|
|
878
584
|
product
|
|
879
585
|
}) => {
|
|
880
|
-
const { t } =
|
|
881
|
-
return /* @__PURE__ */
|
|
882
|
-
|
|
586
|
+
const { t } = useTranslation2();
|
|
587
|
+
return /* @__PURE__ */ jsxs2(
|
|
588
|
+
Container2,
|
|
883
589
|
{
|
|
884
590
|
className: "divide-y p-0",
|
|
885
591
|
"data-testid": "product-organization-section",
|
|
886
592
|
children: [
|
|
887
|
-
/* @__PURE__ */
|
|
593
|
+
/* @__PURE__ */ jsxs2(
|
|
888
594
|
"div",
|
|
889
595
|
{
|
|
890
596
|
className: "flex items-center justify-between px-6 py-4",
|
|
891
597
|
"data-testid": "product-organization-header",
|
|
892
598
|
children: [
|
|
893
|
-
/* @__PURE__ */
|
|
894
|
-
/* @__PURE__ */
|
|
599
|
+
/* @__PURE__ */ jsx2(Heading2, { level: "h2", "data-testid": "product-organization-title", children: t("products.organization.header") }),
|
|
600
|
+
/* @__PURE__ */ jsx2(
|
|
895
601
|
ActionMenu,
|
|
896
602
|
{
|
|
897
603
|
groups: [
|
|
@@ -900,7 +606,7 @@ var ProductOrganizationSection = ({
|
|
|
900
606
|
{
|
|
901
607
|
label: t("actions.edit"),
|
|
902
608
|
to: "organization",
|
|
903
|
-
icon: /* @__PURE__ */
|
|
609
|
+
icon: /* @__PURE__ */ jsx2(PencilSquare, {})
|
|
904
610
|
}
|
|
905
611
|
]
|
|
906
612
|
}
|
|
@@ -911,11 +617,11 @@ var ProductOrganizationSection = ({
|
|
|
911
617
|
]
|
|
912
618
|
}
|
|
913
619
|
),
|
|
914
|
-
/* @__PURE__ */
|
|
620
|
+
/* @__PURE__ */ jsx2(
|
|
915
621
|
SectionRow,
|
|
916
622
|
{
|
|
917
623
|
title: t("fields.category"),
|
|
918
|
-
value: product.categories?.length ? product.categories.map((pcat) => /* @__PURE__ */
|
|
624
|
+
value: product.categories?.length ? product.categories.map((pcat) => /* @__PURE__ */ jsx2(
|
|
919
625
|
OrganizationTag,
|
|
920
626
|
{
|
|
921
627
|
label: pcat.name,
|
|
@@ -926,11 +632,11 @@ var ProductOrganizationSection = ({
|
|
|
926
632
|
"data-testid": "product-categories-row"
|
|
927
633
|
}
|
|
928
634
|
),
|
|
929
|
-
/* @__PURE__ */
|
|
635
|
+
/* @__PURE__ */ jsx2(
|
|
930
636
|
SectionRow,
|
|
931
637
|
{
|
|
932
638
|
title: t("fields.collection"),
|
|
933
|
-
value: product.collection ? /* @__PURE__ */
|
|
639
|
+
value: product.collection ? /* @__PURE__ */ jsx2(
|
|
934
640
|
OrganizationTag,
|
|
935
641
|
{
|
|
936
642
|
label: product.collection.title,
|
|
@@ -940,11 +646,11 @@ var ProductOrganizationSection = ({
|
|
|
940
646
|
"data-testid": "product-collection-row"
|
|
941
647
|
}
|
|
942
648
|
),
|
|
943
|
-
/* @__PURE__ */
|
|
649
|
+
/* @__PURE__ */ jsx2(
|
|
944
650
|
SectionRow,
|
|
945
651
|
{
|
|
946
652
|
title: t("fields.tags"),
|
|
947
|
-
value: product.tags?.length ? product.tags.map((tag) => /* @__PURE__ */
|
|
653
|
+
value: product.tags?.length ? product.tags.map((tag) => /* @__PURE__ */ jsx2(
|
|
948
654
|
OrganizationTag,
|
|
949
655
|
{
|
|
950
656
|
label: tag.value,
|
|
@@ -955,11 +661,11 @@ var ProductOrganizationSection = ({
|
|
|
955
661
|
"data-testid": "product-tags-row"
|
|
956
662
|
}
|
|
957
663
|
),
|
|
958
|
-
/* @__PURE__ */
|
|
664
|
+
/* @__PURE__ */ jsx2(
|
|
959
665
|
SectionRow,
|
|
960
666
|
{
|
|
961
667
|
title: t("fields.type"),
|
|
962
|
-
value: product.type ? /* @__PURE__ */
|
|
668
|
+
value: product.type ? /* @__PURE__ */ jsx2(
|
|
963
669
|
OrganizationTag,
|
|
964
670
|
{
|
|
965
671
|
label: product.type.value,
|
|
@@ -974,8 +680,8 @@ var ProductOrganizationSection = ({
|
|
|
974
680
|
);
|
|
975
681
|
};
|
|
976
682
|
var OrganizationTag = ({ label, to }) => {
|
|
977
|
-
return /* @__PURE__ */
|
|
978
|
-
|
|
683
|
+
return /* @__PURE__ */ jsx2(Tooltip, { content: label, children: /* @__PURE__ */ jsx2(Badge, { size: "2xsmall", className: "block w-fit truncate", asChild: true, children: /* @__PURE__ */ jsx2(
|
|
684
|
+
Link,
|
|
979
685
|
{
|
|
980
686
|
to,
|
|
981
687
|
"data-testid": `organization-tag-${label.toLowerCase().replace(/\s+/g, "-")}`,
|
|
@@ -986,27 +692,27 @@ var OrganizationTag = ({ label, to }) => {
|
|
|
986
692
|
|
|
987
693
|
// src/pages/products/[id]/_components/product-variant-section/product-variant-section.tsx
|
|
988
694
|
import { useCallback, useMemo as useMemo2 } from "react";
|
|
989
|
-
import { PencilSquare as
|
|
695
|
+
import { PencilSquare as PencilSquare2, Trash } from "@medusajs/icons";
|
|
990
696
|
import {
|
|
991
697
|
Badge as Badge2,
|
|
992
|
-
Button as
|
|
993
|
-
Container as
|
|
698
|
+
Button as Button2,
|
|
699
|
+
Container as Container3,
|
|
994
700
|
createDataTableColumnHelper,
|
|
995
|
-
Heading as
|
|
701
|
+
Heading as Heading3,
|
|
996
702
|
toast as toast2,
|
|
997
|
-
Tooltip as
|
|
998
|
-
usePrompt as
|
|
703
|
+
Tooltip as Tooltip2,
|
|
704
|
+
usePrompt as usePrompt2
|
|
999
705
|
} from "@medusajs/ui";
|
|
1000
706
|
import { keepPreviousData } from "@tanstack/react-query";
|
|
1001
|
-
import { useTranslation as
|
|
1002
|
-
import { Link as
|
|
1003
|
-
import { jsx as
|
|
707
|
+
import { useTranslation as useTranslation3 } from "react-i18next";
|
|
708
|
+
import { Link as Link2, useNavigate, useSearchParams } from "react-router-dom";
|
|
709
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1004
710
|
var PAGE_SIZE = 10;
|
|
1005
711
|
var PREFIX = "pv";
|
|
1006
712
|
var ProductVariantSection = ({
|
|
1007
713
|
product
|
|
1008
714
|
}) => {
|
|
1009
|
-
const { t } =
|
|
715
|
+
const { t } = useTranslation3();
|
|
1010
716
|
const { q, order, offset, created_at, updated_at } = useQueryParams(
|
|
1011
717
|
["q", "order", "offset", "created_at", "updated_at"],
|
|
1012
718
|
PREFIX
|
|
@@ -1031,21 +737,21 @@ var ProductVariantSection = ({
|
|
|
1031
737
|
if (isError) {
|
|
1032
738
|
throw error;
|
|
1033
739
|
}
|
|
1034
|
-
return /* @__PURE__ */
|
|
1035
|
-
/* @__PURE__ */
|
|
1036
|
-
/* @__PURE__ */
|
|
1037
|
-
/* @__PURE__ */
|
|
1038
|
-
|
|
740
|
+
return /* @__PURE__ */ jsxs3(Container3, { className: "divide-y p-0", "data-testid": "product-variant-section", children: [
|
|
741
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
742
|
+
/* @__PURE__ */ jsx3(Heading3, { level: "h2", children: t("products.variants.header") }),
|
|
743
|
+
/* @__PURE__ */ jsx3(
|
|
744
|
+
Button2,
|
|
1039
745
|
{
|
|
1040
746
|
size: "small",
|
|
1041
747
|
variant: "secondary",
|
|
1042
748
|
asChild: true,
|
|
1043
749
|
"data-testid": "product-variants-create-button",
|
|
1044
|
-
children: /* @__PURE__ */
|
|
750
|
+
children: /* @__PURE__ */ jsx3(Link2, { to: "variants/create", children: t("actions.create") })
|
|
1045
751
|
}
|
|
1046
752
|
)
|
|
1047
753
|
] }),
|
|
1048
|
-
/* @__PURE__ */
|
|
754
|
+
/* @__PURE__ */ jsx3("div", { "data-testid": "product-variants-table-container", children: /* @__PURE__ */ jsx3(
|
|
1049
755
|
DataTable,
|
|
1050
756
|
{
|
|
1051
757
|
data: variants,
|
|
@@ -1074,10 +780,10 @@ var ProductVariantSection = ({
|
|
|
1074
780
|
};
|
|
1075
781
|
var columnHelper = createDataTableColumnHelper();
|
|
1076
782
|
var useColumns = (product) => {
|
|
1077
|
-
const { t } =
|
|
1078
|
-
const navigate =
|
|
783
|
+
const { t } = useTranslation3();
|
|
784
|
+
const navigate = useNavigate();
|
|
1079
785
|
const { mutateAsync } = useDeleteVariantLazy(product.id);
|
|
1080
|
-
const prompt =
|
|
786
|
+
const prompt = usePrompt2();
|
|
1081
787
|
const [searchParams] = useSearchParams();
|
|
1082
788
|
const tableSearchParams = useMemo2(() => {
|
|
1083
789
|
const filtered = new URLSearchParams();
|
|
@@ -1127,14 +833,14 @@ var useColumns = (product) => {
|
|
|
1127
833
|
(opt) => opt.option?.title === attribute.name
|
|
1128
834
|
);
|
|
1129
835
|
if (!variantOpt?.value) {
|
|
1130
|
-
return /* @__PURE__ */
|
|
836
|
+
return /* @__PURE__ */ jsx3("span", { className: "text-ui-fg-muted", children: "-" });
|
|
1131
837
|
}
|
|
1132
|
-
return /* @__PURE__ */
|
|
838
|
+
return /* @__PURE__ */ jsx3(
|
|
1133
839
|
"div",
|
|
1134
840
|
{
|
|
1135
841
|
className: "flex flex-wrap items-center gap-1",
|
|
1136
842
|
"data-testid": `product-variant-attribute-${attribute.id}-${row.original.id}`,
|
|
1137
|
-
children: /* @__PURE__ */
|
|
843
|
+
children: /* @__PURE__ */ jsx3(Tooltip2, { content: variantOpt.value, children: /* @__PURE__ */ jsx3(
|
|
1138
844
|
Badge2,
|
|
1139
845
|
{
|
|
1140
846
|
size: "2xsmall",
|
|
@@ -1155,7 +861,7 @@ var useColumns = (product) => {
|
|
|
1155
861
|
const variant = _ctx.row.original;
|
|
1156
862
|
const mainActions = [
|
|
1157
863
|
{
|
|
1158
|
-
icon: /* @__PURE__ */
|
|
864
|
+
icon: /* @__PURE__ */ jsx3(PencilSquare2, {}),
|
|
1159
865
|
label: t("actions.edit"),
|
|
1160
866
|
onClick: (row) => {
|
|
1161
867
|
navigate(
|
|
@@ -1171,7 +877,7 @@ var useColumns = (product) => {
|
|
|
1171
877
|
];
|
|
1172
878
|
const secondaryActions = [
|
|
1173
879
|
{
|
|
1174
|
-
icon: /* @__PURE__ */
|
|
880
|
+
icon: /* @__PURE__ */ jsx3(Trash, {}),
|
|
1175
881
|
label: t("actions.delete"),
|
|
1176
882
|
onClick: () => handleDelete(variant.id, variant.title)
|
|
1177
883
|
}
|
|
@@ -1192,7 +898,7 @@ var useColumns = (product) => {
|
|
|
1192
898
|
header: t("fields.sku"),
|
|
1193
899
|
cell: ({ getValue }) => {
|
|
1194
900
|
const value = getValue();
|
|
1195
|
-
return value ? value : /* @__PURE__ */
|
|
901
|
+
return value ? value : /* @__PURE__ */ jsx3("span", { className: "text-ui-fg-muted", children: "-" });
|
|
1196
902
|
}
|
|
1197
903
|
}),
|
|
1198
904
|
...attributeColumns,
|
|
@@ -1214,29 +920,29 @@ var useFilters = () => {
|
|
|
1214
920
|
import {
|
|
1215
921
|
ListBullet,
|
|
1216
922
|
Plus,
|
|
1217
|
-
Trash as
|
|
923
|
+
Trash as Trash2,
|
|
1218
924
|
Swatch,
|
|
1219
925
|
DropCap,
|
|
1220
926
|
InformationCircleSolid,
|
|
1221
|
-
PencilSquare as
|
|
927
|
+
PencilSquare as PencilSquare3
|
|
1222
928
|
} from "@medusajs/icons";
|
|
1223
929
|
import {
|
|
1224
930
|
Badge as Badge3,
|
|
1225
|
-
Container as
|
|
1226
|
-
Heading as
|
|
1227
|
-
Text as
|
|
931
|
+
Container as Container4,
|
|
932
|
+
Heading as Heading4,
|
|
933
|
+
Text as Text2,
|
|
1228
934
|
toast as toast3,
|
|
1229
|
-
Tooltip as
|
|
1230
|
-
usePrompt as
|
|
935
|
+
Tooltip as Tooltip3,
|
|
936
|
+
usePrompt as usePrompt3
|
|
1231
937
|
} from "@medusajs/ui";
|
|
1232
|
-
import { useTranslation as
|
|
1233
|
-
import { jsx as
|
|
938
|
+
import { useTranslation as useTranslation4 } from "react-i18next";
|
|
939
|
+
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1234
940
|
var AttributeActions = ({
|
|
1235
941
|
productId,
|
|
1236
942
|
attribute
|
|
1237
943
|
}) => {
|
|
1238
|
-
const { t } =
|
|
1239
|
-
const prompt =
|
|
944
|
+
const { t } = useTranslation4();
|
|
945
|
+
const prompt = usePrompt3();
|
|
1240
946
|
const { mutateAsync } = useRemoveProductAttribute(productId, attribute.id);
|
|
1241
947
|
const handleDelete = async () => {
|
|
1242
948
|
const res = await prompt({
|
|
@@ -1256,7 +962,7 @@ var AttributeActions = ({
|
|
|
1256
962
|
}
|
|
1257
963
|
});
|
|
1258
964
|
};
|
|
1259
|
-
return /* @__PURE__ */
|
|
965
|
+
return /* @__PURE__ */ jsx4(
|
|
1260
966
|
ActionMenu,
|
|
1261
967
|
{
|
|
1262
968
|
groups: [
|
|
@@ -1265,7 +971,7 @@ var AttributeActions = ({
|
|
|
1265
971
|
{
|
|
1266
972
|
label: t("actions.edit"),
|
|
1267
973
|
to: `attributes/${attribute.id}/edit`,
|
|
1268
|
-
icon: /* @__PURE__ */
|
|
974
|
+
icon: /* @__PURE__ */ jsx4(PencilSquare3, {})
|
|
1269
975
|
}
|
|
1270
976
|
]
|
|
1271
977
|
},
|
|
@@ -1274,7 +980,7 @@ var AttributeActions = ({
|
|
|
1274
980
|
{
|
|
1275
981
|
label: t("actions.delete"),
|
|
1276
982
|
onClick: handleDelete,
|
|
1277
|
-
icon: /* @__PURE__ */
|
|
983
|
+
icon: /* @__PURE__ */ jsx4(Trash2, {}),
|
|
1278
984
|
disabled: attribute.is_required,
|
|
1279
985
|
disabledTooltip: attribute.is_required ? t("products.attributeRequiredDeleteDisabledTooltip") : void 0
|
|
1280
986
|
}
|
|
@@ -1291,37 +997,37 @@ var AttributeGroup = ({
|
|
|
1291
997
|
attributes,
|
|
1292
998
|
productId
|
|
1293
999
|
}) => {
|
|
1294
|
-
const { t } =
|
|
1000
|
+
const { t } = useTranslation4();
|
|
1295
1001
|
if (!attributes.length) {
|
|
1296
1002
|
return null;
|
|
1297
1003
|
}
|
|
1298
|
-
return /* @__PURE__ */
|
|
1299
|
-
/* @__PURE__ */
|
|
1300
|
-
/* @__PURE__ */
|
|
1301
|
-
/* @__PURE__ */
|
|
1302
|
-
/* @__PURE__ */
|
|
1303
|
-
/* @__PURE__ */
|
|
1004
|
+
return /* @__PURE__ */ jsxs4("div", { className: "flex flex-col gap-y-4 px-3 py-4", children: [
|
|
1005
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-x-3 px-3", children: [
|
|
1006
|
+
/* @__PURE__ */ jsx4("div", { className: "text-ui-fg-muted flex h-8 w-8 items-center justify-center rounded-lg border border-ui-border-base bg-ui-bg-component", children: icon }),
|
|
1007
|
+
/* @__PURE__ */ jsxs4("div", { children: [
|
|
1008
|
+
/* @__PURE__ */ jsx4(Text2, { size: "small", weight: "plus", leading: "compact", children: title }),
|
|
1009
|
+
/* @__PURE__ */ jsx4(Text2, { size: "small", leading: "compact", className: "text-ui-fg-subtle", children: description })
|
|
1304
1010
|
] })
|
|
1305
1011
|
] }),
|
|
1306
|
-
/* @__PURE__ */
|
|
1012
|
+
/* @__PURE__ */ jsx4("div", { className: "flex flex-col gap-y-0", children: /* @__PURE__ */ jsx4("div", { className: "overflow-hidden rounded-xl border border-ui-border-base", children: attributes.map((attr, index) => {
|
|
1307
1013
|
const values = attr.values?.map((v) => v.name) ?? [];
|
|
1308
|
-
return /* @__PURE__ */
|
|
1014
|
+
return /* @__PURE__ */ jsx4(
|
|
1309
1015
|
"div",
|
|
1310
1016
|
{
|
|
1311
1017
|
className: index < attributes.length - 1 ? "border-b border-ui-border-base" : "",
|
|
1312
|
-
children: /* @__PURE__ */
|
|
1313
|
-
/* @__PURE__ */
|
|
1314
|
-
/* @__PURE__ */
|
|
1315
|
-
attr.description && /* @__PURE__ */
|
|
1316
|
-
attr.is_required && /* @__PURE__ */
|
|
1317
|
-
|
|
1018
|
+
children: /* @__PURE__ */ jsxs4("div", { className: "grid grid-cols-[1fr_1fr_28px] items-center gap-4 bg-ui-bg-component px-4 py-3", children: [
|
|
1019
|
+
/* @__PURE__ */ jsxs4("div", { className: "text-ui-fg-subtle flex items-center gap-x-2", children: [
|
|
1020
|
+
/* @__PURE__ */ jsx4(Text2, { size: "small", weight: "plus", leading: "compact", children: attr.name }),
|
|
1021
|
+
attr.description && /* @__PURE__ */ jsx4(Tooltip3, { content: attr.description, children: /* @__PURE__ */ jsx4("span", { className: "text-ui-fg-muted flex items-center", children: /* @__PURE__ */ jsx4(InformationCircleSolid, {}) }) }),
|
|
1022
|
+
attr.is_required && /* @__PURE__ */ jsx4(
|
|
1023
|
+
Tooltip3,
|
|
1318
1024
|
{
|
|
1319
1025
|
content: t("products.attributeRequiredByMarketplace"),
|
|
1320
|
-
children: /* @__PURE__ */
|
|
1026
|
+
children: /* @__PURE__ */ jsx4("span", { className: "text-ui-fg-muted flex items-center", children: /* @__PURE__ */ jsx4(InformationCircleSolid, {}) })
|
|
1321
1027
|
}
|
|
1322
1028
|
)
|
|
1323
1029
|
] }),
|
|
1324
|
-
/* @__PURE__ */
|
|
1030
|
+
/* @__PURE__ */ jsx4("div", { className: "flex flex-wrap gap-1", children: ["single_select", "multi_select"].includes(attr.type) ? values.map((val) => /* @__PURE__ */ jsx4(
|
|
1325
1031
|
Badge3,
|
|
1326
1032
|
{
|
|
1327
1033
|
size: "2xsmall",
|
|
@@ -1329,8 +1035,8 @@ var AttributeGroup = ({
|
|
|
1329
1035
|
children: val
|
|
1330
1036
|
},
|
|
1331
1037
|
val
|
|
1332
|
-
)) : /* @__PURE__ */
|
|
1333
|
-
|
|
1038
|
+
)) : /* @__PURE__ */ jsx4(
|
|
1039
|
+
Text2,
|
|
1334
1040
|
{
|
|
1335
1041
|
size: "small",
|
|
1336
1042
|
leading: "compact",
|
|
@@ -1338,7 +1044,7 @@ var AttributeGroup = ({
|
|
|
1338
1044
|
children: values.join(", ") || "-"
|
|
1339
1045
|
}
|
|
1340
1046
|
) }),
|
|
1341
|
-
/* @__PURE__ */
|
|
1047
|
+
/* @__PURE__ */ jsx4(AttributeActions, { productId, attribute: attr })
|
|
1342
1048
|
] })
|
|
1343
1049
|
},
|
|
1344
1050
|
attr.id
|
|
@@ -1349,19 +1055,19 @@ var AttributeGroup = ({
|
|
|
1349
1055
|
var ProductAttributeSection = ({
|
|
1350
1056
|
product
|
|
1351
1057
|
}) => {
|
|
1352
|
-
const { t } =
|
|
1058
|
+
const { t } = useTranslation4();
|
|
1353
1059
|
const allAttributes = product.attributes ?? [];
|
|
1354
1060
|
const variantAttributes = allAttributes.filter((a) => a.is_variant_axis);
|
|
1355
1061
|
const infoAttributes = allAttributes.filter((a) => !a.is_variant_axis);
|
|
1356
1062
|
const isEmpty = !variantAttributes.length && !infoAttributes.length;
|
|
1357
|
-
return /* @__PURE__ */
|
|
1358
|
-
/* @__PURE__ */
|
|
1063
|
+
return /* @__PURE__ */ jsxs4(Container4, { className: "p-0", children: [
|
|
1064
|
+
/* @__PURE__ */ jsxs4(
|
|
1359
1065
|
"div",
|
|
1360
1066
|
{
|
|
1361
1067
|
className: `flex items-center justify-between px-6 py-4${isEmpty ? "" : " border-b border-ui-border-base"}`,
|
|
1362
1068
|
children: [
|
|
1363
|
-
/* @__PURE__ */
|
|
1364
|
-
/* @__PURE__ */
|
|
1069
|
+
/* @__PURE__ */ jsx4(Heading4, { level: "h2", children: t("products.attributes") }),
|
|
1070
|
+
/* @__PURE__ */ jsx4(
|
|
1365
1071
|
ActionMenu,
|
|
1366
1072
|
{
|
|
1367
1073
|
groups: [
|
|
@@ -1370,12 +1076,12 @@ var ProductAttributeSection = ({
|
|
|
1370
1076
|
{
|
|
1371
1077
|
label: t("products.create.attributes.addExisting"),
|
|
1372
1078
|
to: "attributes/add",
|
|
1373
|
-
icon: /* @__PURE__ */
|
|
1079
|
+
icon: /* @__PURE__ */ jsx4(ListBullet, {})
|
|
1374
1080
|
},
|
|
1375
1081
|
{
|
|
1376
1082
|
label: t("products.create.attributes.createNew"),
|
|
1377
1083
|
to: "attributes/create",
|
|
1378
|
-
icon: /* @__PURE__ */
|
|
1084
|
+
icon: /* @__PURE__ */ jsx4(Plus, {})
|
|
1379
1085
|
}
|
|
1380
1086
|
]
|
|
1381
1087
|
}
|
|
@@ -1385,21 +1091,21 @@ var ProductAttributeSection = ({
|
|
|
1385
1091
|
]
|
|
1386
1092
|
}
|
|
1387
1093
|
),
|
|
1388
|
-
variantAttributes.length > 0 && /* @__PURE__ */
|
|
1094
|
+
variantAttributes.length > 0 && /* @__PURE__ */ jsx4(
|
|
1389
1095
|
AttributeGroup,
|
|
1390
1096
|
{
|
|
1391
|
-
icon: /* @__PURE__ */
|
|
1097
|
+
icon: /* @__PURE__ */ jsx4(Swatch, {}),
|
|
1392
1098
|
title: t("products.create.tabs.variants"),
|
|
1393
1099
|
description: t("products.attributeVariantsDescription"),
|
|
1394
1100
|
attributes: variantAttributes,
|
|
1395
1101
|
productId: product.id
|
|
1396
1102
|
}
|
|
1397
1103
|
),
|
|
1398
|
-
variantAttributes.length > 0 && infoAttributes.length > 0 && /* @__PURE__ */
|
|
1399
|
-
infoAttributes.length > 0 && /* @__PURE__ */
|
|
1104
|
+
variantAttributes.length > 0 && infoAttributes.length > 0 && /* @__PURE__ */ jsx4("div", { className: "border-t border-dashed border-ui-border-base" }),
|
|
1105
|
+
infoAttributes.length > 0 && /* @__PURE__ */ jsx4(
|
|
1400
1106
|
AttributeGroup,
|
|
1401
1107
|
{
|
|
1402
|
-
icon: /* @__PURE__ */
|
|
1108
|
+
icon: /* @__PURE__ */ jsx4(DropCap, {}),
|
|
1403
1109
|
title: t("products.attributeProductInformation"),
|
|
1404
1110
|
description: t("products.attributeProductInformationDescription"),
|
|
1405
1111
|
attributes: infoAttributes,
|
|
@@ -1410,19 +1116,19 @@ var ProductAttributeSection = ({
|
|
|
1410
1116
|
};
|
|
1411
1117
|
|
|
1412
1118
|
// src/pages/products/[id]/_components/product-shipping-profile-section/product-shipping-profile-section.tsx
|
|
1413
|
-
import { PencilSquare as
|
|
1414
|
-
import { Container as
|
|
1415
|
-
import { useTranslation as
|
|
1416
|
-
import { jsx as
|
|
1119
|
+
import { PencilSquare as PencilSquare4, ShoppingBag } from "@medusajs/icons";
|
|
1120
|
+
import { Container as Container5, Heading as Heading5 } from "@medusajs/ui";
|
|
1121
|
+
import { useTranslation as useTranslation5 } from "react-i18next";
|
|
1122
|
+
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1417
1123
|
var ProductShippingProfileSection = ({
|
|
1418
1124
|
product
|
|
1419
1125
|
}) => {
|
|
1420
|
-
const { t } =
|
|
1126
|
+
const { t } = useTranslation5();
|
|
1421
1127
|
const shippingProfile = product.shipping_profile;
|
|
1422
|
-
return /* @__PURE__ */
|
|
1423
|
-
/* @__PURE__ */
|
|
1424
|
-
/* @__PURE__ */
|
|
1425
|
-
/* @__PURE__ */
|
|
1128
|
+
return /* @__PURE__ */ jsxs5(Container5, { className: "p-0", children: [
|
|
1129
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
1130
|
+
/* @__PURE__ */ jsx5(Heading5, { level: "h2", children: t("products.shippingProfile.header") }),
|
|
1131
|
+
/* @__PURE__ */ jsx5(
|
|
1426
1132
|
ActionMenu,
|
|
1427
1133
|
{
|
|
1428
1134
|
groups: [
|
|
@@ -1431,7 +1137,7 @@ var ProductShippingProfileSection = ({
|
|
|
1431
1137
|
{
|
|
1432
1138
|
label: t("actions.edit"),
|
|
1433
1139
|
to: "shipping-profile",
|
|
1434
|
-
icon: /* @__PURE__ */
|
|
1140
|
+
icon: /* @__PURE__ */ jsx5(PencilSquare4, {})
|
|
1435
1141
|
}
|
|
1436
1142
|
]
|
|
1437
1143
|
}
|
|
@@ -1439,38 +1145,38 @@ var ProductShippingProfileSection = ({
|
|
|
1439
1145
|
}
|
|
1440
1146
|
)
|
|
1441
1147
|
] }),
|
|
1442
|
-
shippingProfile && /* @__PURE__ */
|
|
1148
|
+
shippingProfile && /* @__PURE__ */ jsx5(
|
|
1443
1149
|
SidebarLink,
|
|
1444
1150
|
{
|
|
1445
1151
|
to: `/settings/locations/shipping-profiles/${shippingProfile.id}`,
|
|
1446
1152
|
labelKey: shippingProfile.name,
|
|
1447
1153
|
descriptionKey: shippingProfile.type,
|
|
1448
|
-
icon: /* @__PURE__ */
|
|
1154
|
+
icon: /* @__PURE__ */ jsx5(ShoppingBag, {})
|
|
1449
1155
|
}
|
|
1450
1156
|
)
|
|
1451
1157
|
] });
|
|
1452
1158
|
};
|
|
1453
1159
|
|
|
1454
1160
|
// src/pages/products/[id]/_components/product-sales-channel-section/product-sales-channel-section.tsx
|
|
1455
|
-
import { Channels, PencilSquare as
|
|
1456
|
-
import { Container as
|
|
1457
|
-
import { Trans, useTranslation as
|
|
1458
|
-
import { jsx as
|
|
1161
|
+
import { Channels, PencilSquare as PencilSquare5 } from "@medusajs/icons";
|
|
1162
|
+
import { Container as Container6, Heading as Heading6, Text as Text3, Tooltip as Tooltip4 } from "@medusajs/ui";
|
|
1163
|
+
import { Trans, useTranslation as useTranslation6 } from "react-i18next";
|
|
1164
|
+
import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1459
1165
|
var ProductSalesChannelSection = ({
|
|
1460
1166
|
product
|
|
1461
1167
|
}) => {
|
|
1462
1168
|
const { count } = useSalesChannels();
|
|
1463
|
-
const { t } =
|
|
1169
|
+
const { t } = useTranslation6();
|
|
1464
1170
|
const availableInSalesChannels = product.sales_channels?.map((sc) => ({
|
|
1465
1171
|
id: sc.id,
|
|
1466
1172
|
name: sc.name
|
|
1467
1173
|
})) ?? [];
|
|
1468
1174
|
const firstChannels = availableInSalesChannels.slice(0, 3);
|
|
1469
1175
|
const restChannels = availableInSalesChannels.slice(3);
|
|
1470
|
-
return /* @__PURE__ */
|
|
1471
|
-
/* @__PURE__ */
|
|
1472
|
-
/* @__PURE__ */
|
|
1473
|
-
/* @__PURE__ */
|
|
1176
|
+
return /* @__PURE__ */ jsxs6(Container6, { className: "flex flex-col gap-y-4 px-6 py-4", children: [
|
|
1177
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex items-center justify-between", children: [
|
|
1178
|
+
/* @__PURE__ */ jsx6(Heading6, { level: "h2", children: t("fields.sales_channels") }),
|
|
1179
|
+
/* @__PURE__ */ jsx6(
|
|
1474
1180
|
ActionMenu,
|
|
1475
1181
|
{
|
|
1476
1182
|
groups: [
|
|
@@ -1479,7 +1185,7 @@ var ProductSalesChannelSection = ({
|
|
|
1479
1185
|
{
|
|
1480
1186
|
label: t("actions.edit"),
|
|
1481
1187
|
to: "sales-channels",
|
|
1482
|
-
icon: /* @__PURE__ */
|
|
1188
|
+
icon: /* @__PURE__ */ jsx6(PencilSquare5, {})
|
|
1483
1189
|
}
|
|
1484
1190
|
]
|
|
1485
1191
|
}
|
|
@@ -1487,16 +1193,16 @@ var ProductSalesChannelSection = ({
|
|
|
1487
1193
|
}
|
|
1488
1194
|
)
|
|
1489
1195
|
] }),
|
|
1490
|
-
/* @__PURE__ */
|
|
1491
|
-
/* @__PURE__ */
|
|
1492
|
-
availableInSalesChannels.length > 0 ? /* @__PURE__ */
|
|
1493
|
-
/* @__PURE__ */
|
|
1494
|
-
restChannels.length > 0 && /* @__PURE__ */
|
|
1495
|
-
|
|
1196
|
+
/* @__PURE__ */ jsxs6("div", { className: "grid grid-cols-[28px_1fr] items-center gap-x-3", children: [
|
|
1197
|
+
/* @__PURE__ */ jsx6("div", { className: "bg-ui-bg-base shadow-borders-base flex size-7 items-center justify-center rounded-md", children: /* @__PURE__ */ jsx6("div", { className: "bg-ui-bg-component flex size-6 items-center justify-center rounded-[4px]", children: /* @__PURE__ */ jsx6(Channels, { className: "text-ui-fg-subtle" }) }) }),
|
|
1198
|
+
availableInSalesChannels.length > 0 ? /* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-x-1", children: [
|
|
1199
|
+
/* @__PURE__ */ jsx6(Text3, { size: "small", leading: "compact", children: firstChannels.map((sc) => sc.name).join(", ") }),
|
|
1200
|
+
restChannels.length > 0 && /* @__PURE__ */ jsx6(
|
|
1201
|
+
Tooltip4,
|
|
1496
1202
|
{
|
|
1497
|
-
content: /* @__PURE__ */
|
|
1498
|
-
children: /* @__PURE__ */
|
|
1499
|
-
|
|
1203
|
+
content: /* @__PURE__ */ jsx6("ul", { children: restChannels.map((sc) => /* @__PURE__ */ jsx6("li", { children: sc.name }, sc.id)) }),
|
|
1204
|
+
children: /* @__PURE__ */ jsx6(
|
|
1205
|
+
Text3,
|
|
1500
1206
|
{
|
|
1501
1207
|
size: "small",
|
|
1502
1208
|
leading: "compact",
|
|
@@ -1506,9 +1212,9 @@ var ProductSalesChannelSection = ({
|
|
|
1506
1212
|
)
|
|
1507
1213
|
}
|
|
1508
1214
|
)
|
|
1509
|
-
] }) : /* @__PURE__ */
|
|
1215
|
+
] }) : /* @__PURE__ */ jsx6(Text3, { size: "small", leading: "compact", className: "text-ui-fg-subtle", children: t("products.noSalesChannels") })
|
|
1510
1216
|
] }),
|
|
1511
|
-
/* @__PURE__ */
|
|
1217
|
+
/* @__PURE__ */ jsx6("div", { children: /* @__PURE__ */ jsx6(Text3, { className: "text-ui-fg-subtle", size: "small", leading: "compact", children: /* @__PURE__ */ jsx6(
|
|
1512
1218
|
Trans,
|
|
1513
1219
|
{
|
|
1514
1220
|
i18nKey: "sales_channels.availableIn",
|
|
@@ -1517,14 +1223,14 @@ var ProductSalesChannelSection = ({
|
|
|
1517
1223
|
y: count ?? 0
|
|
1518
1224
|
},
|
|
1519
1225
|
components: [
|
|
1520
|
-
/* @__PURE__ */
|
|
1226
|
+
/* @__PURE__ */ jsx6(
|
|
1521
1227
|
"span",
|
|
1522
1228
|
{
|
|
1523
1229
|
className: "text-ui-fg-base txt-compact-medium-plus"
|
|
1524
1230
|
},
|
|
1525
1231
|
"x"
|
|
1526
1232
|
),
|
|
1527
|
-
/* @__PURE__ */
|
|
1233
|
+
/* @__PURE__ */ jsx6(
|
|
1528
1234
|
"span",
|
|
1529
1235
|
{
|
|
1530
1236
|
className: "text-ui-fg-base txt-compact-medium-plus"
|
|
@@ -1538,7 +1244,7 @@ var ProductSalesChannelSection = ({
|
|
|
1538
1244
|
};
|
|
1539
1245
|
|
|
1540
1246
|
// src/pages/products/[id]/product-detail-page.tsx
|
|
1541
|
-
import { jsx as
|
|
1247
|
+
import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1542
1248
|
var Root = ({ children }) => {
|
|
1543
1249
|
const initialData = useLoaderData();
|
|
1544
1250
|
const { id } = useParams();
|
|
@@ -1550,21 +1256,21 @@ var Root = ({ children }) => {
|
|
|
1550
1256
|
}
|
|
1551
1257
|
);
|
|
1552
1258
|
if (isLoading || !product) {
|
|
1553
|
-
return /* @__PURE__ */
|
|
1259
|
+
return /* @__PURE__ */ jsx7(TwoColumnPageSkeleton, { mainSections: 4, sidebarSections: 3 });
|
|
1554
1260
|
}
|
|
1555
1261
|
if (isError) {
|
|
1556
1262
|
throw error;
|
|
1557
1263
|
}
|
|
1558
|
-
return Children.count(children) > 0 ? /* @__PURE__ */
|
|
1559
|
-
/* @__PURE__ */
|
|
1560
|
-
/* @__PURE__ */
|
|
1561
|
-
/* @__PURE__ */
|
|
1562
|
-
/* @__PURE__ */
|
|
1563
|
-
/* @__PURE__ */
|
|
1264
|
+
return Children.count(children) > 0 ? /* @__PURE__ */ jsx7(TwoColumnPage, { data: product, "data-testid": "product-detail-page", children }) : /* @__PURE__ */ jsxs7(TwoColumnPage, { data: product, "data-testid": "product-detail-page", children: [
|
|
1265
|
+
/* @__PURE__ */ jsxs7(TwoColumnPage.Main, { "data-testid": "product-detail-main", children: [
|
|
1266
|
+
/* @__PURE__ */ jsx7(ProductActiveEditSection, { product }),
|
|
1267
|
+
/* @__PURE__ */ jsx7(ProductGeneralSection, { product }),
|
|
1268
|
+
/* @__PURE__ */ jsx7(ProductMediaSection, { product }),
|
|
1269
|
+
/* @__PURE__ */ jsx7(ProductVariantSection, { product })
|
|
1564
1270
|
] }),
|
|
1565
|
-
/* @__PURE__ */
|
|
1566
|
-
/* @__PURE__ */
|
|
1567
|
-
/* @__PURE__ */
|
|
1271
|
+
/* @__PURE__ */ jsxs7(TwoColumnPage.Sidebar, { "data-testid": "product-detail-sidebar", children: [
|
|
1272
|
+
/* @__PURE__ */ jsx7(ProductOrganizationSection, { product }),
|
|
1273
|
+
/* @__PURE__ */ jsx7(ProductAttributeSection, { product })
|
|
1568
1274
|
] })
|
|
1569
1275
|
] });
|
|
1570
1276
|
};
|