@mercurjs/admin 2.2.0-canary.5 → 2.2.0-canary.51
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/{add-campaign-promotions-FAG3FAOF.js → add-campaign-promotions-RH5L6VMH.js} +15 -15
- package/dist/{adjust-inventory-EAAPNIBZ.js → adjust-inventory-P2M7KZ77.js} +33 -34
- package/dist/{api-key-management-create-MRLR4WFZ.js → api-key-management-create-KDKSGJ4C.js} +5 -5
- package/dist/{api-key-management-detail-PIN6NFQF.js → api-key-management-detail-2RZ6NOYH.js} +37 -39
- package/dist/{api-key-management-edit-EZHFP3RR.js → api-key-management-edit-NOGBLKBT.js} +5 -5
- package/dist/{api-key-management-list-OPANEDHB.js → api-key-management-list-CGHUURWX.js} +11 -11
- package/dist/{api-key-management-sales-channels-PBL3V4IS.js → api-key-management-sales-channels-VJMUPYV3.js} +10 -11
- package/dist/{attribute-create-F55LOXRA.js → attribute-create-KR4DSDH2.js} +96 -83
- package/dist/{attribute-create-possible-value-EXVHC272.js → attribute-create-possible-value-QFXKXZM4.js} +2 -2
- package/dist/{attribute-detail-NRDJUPTJ.js → attribute-detail-6FMX7IDW.js} +66 -54
- package/dist/{attribute-edit-SB6GN67M.js → attribute-edit-WXO5FGR6.js} +7 -7
- package/dist/{attribute-edit-possible-value-5CLQOLVR.js → attribute-edit-possible-value-RO7BY3NC.js} +5 -5
- package/dist/{attribute-edit-ranking-7AAAYEC7.js → attribute-edit-ranking-YGR3KCSC.js} +3 -3
- package/dist/attribute-list-PJXWYS4C.js +61 -0
- package/dist/breadcrumb-GHBR74WM.js +27 -0
- package/dist/breadcrumb-OBHTESQD.js +26 -0
- package/dist/{campaign-budget-edit-WKSYXTBX.js → campaign-budget-edit-QXAXRI6B.js} +3 -3
- package/dist/{campaign-configuration-ZTK46EB5.js → campaign-configuration-A3E6G2VQ.js} +3 -3
- package/dist/{campaign-create-7BELREFT.js → campaign-create-TZH66JVU.js} +7 -7
- package/dist/{campaign-detail-QMLFWZ6K.js → campaign-detail-3PNOOUGP.js} +50 -47
- package/dist/{campaign-edit-ZGLDY4X4.js → campaign-edit-6CIGS4ZU.js} +25 -9
- package/dist/{campaign-list-NQGNOFVZ.js → campaign-list-TNJDWTM5.js} +9 -9
- package/dist/{categories-metadata-5GXBBHEH.js → categories-metadata-AIT33J5U.js} +34 -35
- package/dist/{category-create-QPQQGIEN.js → category-create-NTSIOKLK.js} +10 -7
- package/dist/category-detail-3WUCMDWO.js +113 -0
- package/dist/{category-edit-DJP7TK4X.js → category-edit-4PGWERPJ.js} +31 -13
- package/dist/category-icon-edit-C2VAH5JA.js +117 -0
- package/dist/{category-list-T5SE63HU.js → category-list-D4J4G6HW.js} +14 -11
- package/dist/category-media-E5UUDN3I.js +655 -0
- package/dist/category-organize-T45BC4HL.js +129 -0
- package/dist/{category-products-255EJFTV.js → category-products-TTQGSVUC.js} +49 -49
- package/dist/chunk-2KERYQNF.js +525 -0
- package/dist/{chunk-WQFFCK3R.js → chunk-2V74T2WI.js} +1 -1
- package/dist/{chunk-26UTIAAZ.js → chunk-32URSQ4F.js} +1 -1
- package/dist/{chunk-6XTHMAA2.js → chunk-3F4Z4BNA.js} +34 -16
- package/dist/{chunk-AKC67AN5.js → chunk-3FKB6UTO.js} +83 -63
- package/dist/chunk-3KS7PC2Z.js +1284 -0
- package/dist/{chunk-IWI34SYT.js → chunk-3LDOWS4A.js} +8 -7
- package/dist/chunk-3LGGCLSO.js +185 -0
- package/dist/{chunk-KJSCFEXT.js → chunk-3WCK2FT4.js} +291 -76
- package/dist/{chunk-VKOE5J66.js → chunk-3XOE4NV5.js} +11 -2
- package/dist/{chunk-SA3MMYXT.js → chunk-4DJL3XN7.js} +25 -13
- package/dist/{chunk-GQLVERZW.js → chunk-4QQ6BFWQ.js} +9 -9
- package/dist/{chunk-GP4J42UD.js → chunk-4TNOZ4VH.js} +3 -2
- package/dist/chunk-4TW5RTWO.js +281 -0
- package/dist/{chunk-JQV7CXEC.js → chunk-5BSSIDW6.js} +17 -2
- package/dist/{chunk-FB7DDNCA.js → chunk-5CHUXS7G.js} +4 -4
- package/dist/{chunk-PR7Y27BW.js → chunk-5EOYDQAS.js} +1 -1
- package/dist/{chunk-DRJAKRTI.js → chunk-5NAX6LXB.js} +7 -6
- package/dist/{chunk-3VTAK3S6.js → chunk-5NC3VFXY.js} +4 -4
- package/dist/{chunk-LYZDVZWA.js → chunk-5NSOIZFB.js} +5 -3
- package/dist/{chunk-K43FFKGD.js → chunk-67KYEPSA.js} +1 -1
- package/dist/chunk-6BAPAIQM.js +8 -0
- package/dist/{chunk-3JSAS7QP.js → chunk-6DDS7IRR.js} +24 -7
- package/dist/{chunk-KMZOBR5Q.js → chunk-6R767EBC.js} +19 -16
- package/dist/{chunk-G3GSRFTB.js → chunk-6S5RUSUU.js} +12 -11
- package/dist/{chunk-R5F52U3C.js → chunk-6TMGHMZ2.js} +39 -11
- package/dist/{chunk-TXNRS2JR.js → chunk-7CQD5AQ6.js} +2 -6
- package/dist/chunk-7IGLZARZ.js +101 -0
- package/dist/{chunk-634XVU3D.js → chunk-7PPT3477.js} +10 -3
- package/dist/{chunk-GKGLVDDV.js → chunk-A2F5MDPU.js} +1 -1
- package/dist/{chunk-NUC27ELX.js → chunk-AASCLZ5N.js} +5 -5
- package/dist/{chunk-46A3QXAL.js → chunk-ABS7HMLY.js} +2 -2
- package/dist/{chunk-PRBE5CM3.js → chunk-AFYILTAC.js} +35 -3
- package/dist/chunk-APAT344J.js +144 -0
- package/dist/{chunk-NMFVQDVF.js → chunk-APMBU7ZV.js} +5 -5
- package/dist/{chunk-4XFFF2L5.js → chunk-AW5OKJQZ.js} +12 -11
- package/dist/{chunk-X3PXBMI3.js → chunk-BBD4WOUK.js} +11 -10
- package/dist/{chunk-2MVNFKL6.js → chunk-BHF4TD3T.js} +16 -15
- package/dist/{chunk-FFNSWUDC.js → chunk-BHSY6RCN.js} +42 -14
- package/dist/chunk-BW7BDHZV.js +34 -0
- package/dist/{chunk-LYZT5REU.js → chunk-C4XKPQ6T.js} +14 -1
- package/dist/{chunk-N6SI4IIT.js → chunk-CARSKIPW.js} +1 -1
- package/dist/chunk-CGIVQ7D2.js +115 -0
- package/dist/chunk-CU4UVEHX.js +121 -0
- package/dist/{chunk-ACDG3RAL.js → chunk-CWQKHTH6.js} +92 -131
- package/dist/{chunk-M5AJSIRN.js → chunk-DJD3MWED.js} +1 -1
- package/dist/{chunk-UNOG2S56.js → chunk-DMZDXTS5.js} +168 -103
- package/dist/{chunk-HZQGZQTV.js → chunk-DP6YFZHP.js} +10 -8
- package/dist/{chunk-I5THQVYP.js → chunk-DUVYF37J.js} +1 -1
- package/dist/{chunk-FXWKGNRV.js → chunk-EJY35WBK.js} +2 -2
- package/dist/{chunk-N3334MXP.js → chunk-EKPXN6RL.js} +647 -754
- package/dist/{chunk-46M463BR.js → chunk-EWFOFSF7.js} +1 -1
- package/dist/{chunk-CKUIM5ZD.js → chunk-F57NIOVJ.js} +52 -23
- package/dist/{chunk-533GMKEG.js → chunk-F5NW4XBU.js} +23 -3
- package/dist/{chunk-HR7TFO2X.js → chunk-F6DGTW4E.js} +7 -7
- package/dist/{chunk-5AZCIOS4.js → chunk-F6NPDZHW.js} +2 -2
- package/dist/{chunk-UFGVU7RF.js → chunk-FLFE6HXW.js} +1 -1
- package/dist/{chunk-4LXBQTFN.js → chunk-FREUYHMS.js} +1 -1
- package/dist/{chunk-2ZRWLCYP.js → chunk-FVG5DTS6.js} +3 -3
- package/dist/{chunk-E5WBU7ZR.js → chunk-G2LHEJLS.js} +4 -4
- package/dist/{chunk-OHOWEMHO.js → chunk-G5KNNOXX.js} +32 -26
- package/dist/{chunk-F7O6IXPA.js → chunk-G67PGZDM.js} +72 -30
- package/dist/{chunk-NQEXDLYH.js → chunk-GRFWCCUW.js} +28 -9
- package/dist/{chunk-PVZBDWLK.js → chunk-GRH7C3QN.js} +1 -1
- package/dist/{chunk-MKBCBAS2.js → chunk-GVPKRQWI.js} +79 -28
- package/dist/{chunk-VDKOJ5WD.js → chunk-GYRTURN7.js} +1 -1
- package/dist/{chunk-XJ3WC4G7.js → chunk-H3D6V3KM.js} +4 -3
- package/dist/chunk-HC2TEEKQ.js +283 -0
- package/dist/{chunk-BKNAX6QQ.js → chunk-HC7FWIMY.js} +8 -7
- package/dist/{chunk-YFRC6GEN.js → chunk-HLL6GLZO.js} +3 -3
- package/dist/{chunk-MFI5TG54.js → chunk-HYDXR5K4.js} +56 -16
- package/dist/{chunk-X45JKZYW.js → chunk-I5FOWDOM.js} +11 -8
- package/dist/{chunk-6NDM5WGE.js → chunk-I5HY5Q3K.js} +19 -72
- package/dist/{chunk-WJJXUXSO.js → chunk-IC2PLPRP.js} +1 -1
- package/dist/{chunk-L3E6LES5.js → chunk-IGTR66D2.js} +7 -7
- package/dist/{chunk-WRVGLMRW.js → chunk-IJ2CSCLP.js} +7 -4
- package/dist/chunk-IWBQZK6E.js +166 -0
- package/dist/chunk-IZDTQFCP.js +65 -0
- package/dist/{chunk-AEMDNTW5.js → chunk-J54BZXZX.js} +2 -2
- package/dist/{chunk-Y2M536WR.js → chunk-JHBNG7OD.js} +17 -0
- package/dist/{chunk-LYD3C73Z.js → chunk-JI7HMGMO.js} +1 -1
- package/dist/{chunk-SS7LB52P.js → chunk-JJOITP32.js} +13 -12
- package/dist/{chunk-KT7X72J4.js → chunk-JXSXBSV6.js} +9 -1
- package/dist/{chunk-33BERJSG.js → chunk-K6RZE3F7.js} +1 -1
- package/dist/{chunk-YGRTRAWX.js → chunk-KDE4HKH2.js} +1 -0
- package/dist/{chunk-A7JOHU6Q.js → chunk-KT7CXVLT.js} +7 -6
- package/dist/chunk-KUBTN5TC.js +206 -0
- package/dist/{chunk-Q2ULPJJ6.js → chunk-KXWN75T2.js} +2 -2
- package/dist/{chunk-LAPEZATU.js → chunk-L7DIEO5B.js} +1 -1
- package/dist/{chunk-YYMACYP6.js → chunk-LEQINL55.js} +3 -2
- package/dist/{chunk-CMHI2RPL.js → chunk-LPIPSLR7.js} +21 -0
- package/dist/{chunk-LXMGYWPO.js → chunk-LQQERWMM.js} +13 -12
- package/dist/chunk-LXNWSQOE.js +87 -0
- package/dist/{chunk-ZBWL72TB.js → chunk-LXZXXOJ3.js} +1 -11
- package/dist/{chunk-EFZBEG7O.js → chunk-MEDZM6N7.js} +27 -11
- package/dist/{chunk-ZRFWXNT3.js → chunk-MMKUMSZS.js} +205 -205
- package/dist/{chunk-DAXXLQKB.js → chunk-MO7TNIVQ.js} +1 -1
- package/dist/{chunk-EBQUMS7H.js → chunk-MPRW23TB.js} +50 -20
- package/dist/{chunk-ZN7LWXVC.js → chunk-MTHPNKQ4.js} +5 -5
- package/dist/{chunk-K6L5PHHQ.js → chunk-MUKW4VRI.js} +13 -12
- package/dist/{chunk-UXGLM3B4.js → chunk-NEGOGYEO.js} +4 -4
- package/dist/{chunk-SXGSYSW7.js → chunk-NLJ5F7FS.js} +15 -7
- package/dist/{chunk-YNHS5G26.js → chunk-NQ2RDSI3.js} +2 -2
- package/dist/{chunk-XAIID3PU.js → chunk-O7SDCQD6.js} +25 -16
- package/dist/chunk-ODDJZVYL.js +476 -0
- package/dist/{chunk-Q23KHB6V.js → chunk-OG5AVHPY.js} +111 -29
- package/dist/{chunk-C4JUURO5.js → chunk-OT5X3VOQ.js} +1 -1
- package/dist/{chunk-MVNO35S5.js → chunk-OX6HZPVY.js} +21 -11
- package/dist/{chunk-LD7NVG2X.js → chunk-P2DFLKCN.js} +5 -5
- package/dist/{chunk-5J2HQOKK.js → chunk-P2JA3QTQ.js} +8 -7
- package/dist/{chunk-COP7NFSJ.js → chunk-P3GGL5JL.js} +3 -3
- package/dist/{chunk-CPXK5RSJ.js → chunk-PEUWV5YK.js} +3 -2
- package/dist/{chunk-FNKBJCNF.js → chunk-PHWYJ26A.js} +4 -4
- package/dist/{chunk-2YN2OI3W.js → chunk-PPRIEP4H.js} +36 -10
- package/dist/{chunk-VYMODH6P.js → chunk-PYF5EER5.js} +1 -1
- package/dist/{chunk-7BD24KNM.js → chunk-PYZ7VL5X.js} +3 -3
- package/dist/{chunk-X7H7TIOT.js → chunk-Q4R2O7XF.js} +9 -9
- package/dist/{chunk-6RHAGO5O.js → chunk-Q5DRFJPI.js} +8 -7
- package/dist/{chunk-5TRY5IMZ.js → chunk-Q6GUA5VE.js} +2 -2
- package/dist/{chunk-34OFJ74B.js → chunk-QA7S7WVH.js} +56 -39
- package/dist/{chunk-B66CMFMH.js → chunk-QCIDV3AP.js} +3 -3
- package/dist/{chunk-TNNQPNXY.js → chunk-QE4R2KT3.js} +1 -1
- package/dist/{chunk-FPV32HVT.js → chunk-QEX45BI3.js} +8 -6
- package/dist/chunk-QJCUPZZQ.js +356 -0
- package/dist/chunk-QR3GYYX6.js +0 -0
- package/dist/{chunk-3B6MTW5G.js → chunk-QUHSHIAC.js} +3 -0
- package/dist/{chunk-EB5QHYKL.js → chunk-QVIX6O76.js} +2 -2
- package/dist/{chunk-QFE4AEQJ.js → chunk-R2LW5LGL.js} +402 -108
- package/dist/{chunk-OH4AABUT.js → chunk-R325CPYC.js} +1 -1
- package/dist/{chunk-JPNPTILP.js → chunk-R4O667NT.js} +1 -1
- package/dist/{chunk-UKDC2AQR.js → chunk-RMB7MPIT.js} +1 -1
- package/dist/{chunk-2FGRDEAD.js → chunk-RQQ53CQJ.js} +1 -1
- package/dist/{chunk-VERWLDVW.js → chunk-RT2MBSJQ.js} +9 -8
- package/dist/{chunk-BGQ7H2KL.js → chunk-RYISNVIR.js} +29 -15
- package/dist/{chunk-LEG67A2R.js → chunk-SAU35JEB.js} +2 -11
- package/dist/{chunk-U2ZFCAPX.js → chunk-SITRHMZZ.js} +11 -8
- package/dist/{chunk-EZGIPTIF.js → chunk-SLAWONP2.js} +57 -22
- package/dist/{chunk-KTBL35I2.js → chunk-TIG77LHS.js} +1 -1
- package/dist/{chunk-LO7NJYHZ.js → chunk-TJJ7S3GL.js} +5 -4
- package/dist/{chunk-J4MAIN7L.js → chunk-UK5BVJI7.js} +2 -2
- package/dist/{chunk-D2NBZVQC.js → chunk-UK5CZJ4A.js} +15 -13
- package/dist/{chunk-CVFVEDMV.js → chunk-UVH7PC5B.js} +7 -6
- package/dist/{chunk-P42E3L6Z.js → chunk-VH4W6LKI.js} +4 -3
- package/dist/{chunk-ESPLVOFC.js → chunk-VHCDSNXF.js} +2 -2
- package/dist/{chunk-GPJ6KVY2.js → chunk-VHOCBKSA.js} +7 -6
- package/dist/chunk-VM56ZITS.js +356 -0
- package/dist/chunk-VQ6OPDS3.js +659 -0
- package/dist/{chunk-4KX6CBJ4.js → chunk-VSLHL2AZ.js} +2 -0
- package/dist/{chunk-CKD5563X.js → chunk-VX6OCQLN.js} +7 -6
- package/dist/{chunk-EPHVGD5Z.js → chunk-VXW3BCN2.js} +1 -1
- package/dist/{chunk-F5H5JZQZ.js → chunk-VYSB4CTB.js} +2112 -1706
- package/dist/{chunk-IAWZQKUH.js → chunk-WF2PHYTE.js} +7 -6
- package/dist/{chunk-N3BYBEDV.js → chunk-WF3ZDT5Z.js} +11 -95
- package/dist/{chunk-ZB4SO44T.js → chunk-WX4ABVXL.js} +3 -3
- package/dist/{chunk-KXIA66EJ.js → chunk-X4SSIHH7.js} +39 -16
- package/dist/{chunk-WYA62MUL.js → chunk-X5PMVI7H.js} +3 -3
- package/dist/{chunk-3OUWXGMT.js → chunk-XDMCPTDG.js} +215 -122
- package/dist/chunk-XNUH2AOW.js +382 -0
- package/dist/{chunk-DV7QV3X2.js → chunk-XWP4ZGKN.js} +11 -16
- package/dist/{chunk-DWCBB4QM.js → chunk-XXV6ZSWY.js} +7 -6
- package/dist/{chunk-BFT3CN5L.js → chunk-YLQ63F5E.js} +8 -7
- package/dist/{chunk-SONUZNDT.js → chunk-YNR25MNM.js} +78 -56
- package/dist/{chunk-S4SVK5DE.js → chunk-YVLANFBK.js} +29 -1
- package/dist/{chunk-3L7M4E7W.js → chunk-YXKHBSQJ.js} +14 -188
- package/dist/{chunk-IMR3MZDP.js → chunk-Z6CIQQUZ.js} +3 -2
- package/dist/{chunk-4RT7P5ZQ.js → chunk-ZAANJVLM.js} +2 -2
- package/dist/{chunk-KAZ5BYTQ.js → chunk-ZAOEFQ6K.js} +5 -4
- package/dist/{chunk-FEC24V7X.js → chunk-ZOTBKQLG.js} +2 -2
- package/dist/{collection-add-products-4ZTBHENL.js → collection-add-products-TXJAEXUT.js} +46 -47
- package/dist/{collection-create-GPBN7KO6.js → collection-create-7ZQONUJL.js} +89 -17
- package/dist/collection-detail-FGXNWXAN.js +104 -0
- package/dist/{collection-edit-NVRFKO46.js → collection-edit-ZFAECPWC.js} +35 -12
- package/dist/collection-icon-edit-642AZRHR.js +117 -0
- package/dist/collection-list-ZLBRTQAC.js +85 -0
- package/dist/collection-media-LMJFEFVY.js +655 -0
- package/dist/{collection-metadata-E4C54MTU.js → collection-metadata-AZRN32RU.js} +34 -35
- package/dist/commission-rule-commission-edit-V5JVRNZN.js +195 -0
- package/dist/commission-rule-create-EZ2C6AWK.js +464 -0
- package/dist/commission-rule-detail-FOLHANWL.js +45 -0
- package/dist/commission-rule-edit-NQ5EYCGO.js +352 -0
- package/dist/commissions-list-SGVCP2O4.js +36 -0
- package/dist/{constants-Bahlh59D.d.ts → constants-CBhKGpBZ.d.ts} +12 -5
- package/dist/{customer-create-QHA4KM6N.js → customer-create-SC6LAEVJ.js} +3 -3
- package/dist/{customer-create-address-TYWVWNUE.js → customer-create-address-VZMOF5AE.js} +11 -6
- package/dist/{customer-detail-ONZGPCHW.js → customer-detail-3KIDRBLW.js} +52 -53
- package/dist/{customer-edit-JZ4PQTIN.js → customer-edit-RAWO66UL.js} +27 -9
- package/dist/customer-edit-address-ZEVUPAYN.js +311 -0
- package/dist/{customer-group-add-customers-VJUBEN7M.js → customer-group-add-customers-LKFLDXVO.js} +14 -14
- package/dist/{customer-group-create-NA2UKCF6.js → customer-group-create-3KAC3R3N.js} +3 -3
- package/dist/{customer-group-detail-XTCDJX7O.js → customer-group-detail-KWHS7V6F.js} +53 -51
- package/dist/{customer-group-edit-3O6HAYYN.js → customer-group-edit-E7JX2L4J.js} +43 -22
- package/dist/customer-group-list-3FCJBXFY.js +57 -0
- package/dist/{customer-group-metadata-N7HGHXNC.js → customer-group-metadata-3QRU7FIE.js} +34 -35
- package/dist/{customer-list-MB6WZFMA.js → customer-list-JT6YE2IW.js} +11 -11
- package/dist/{customer-metadata-63OWV4KB.js → customer-metadata-7DMBCQXW.js} +34 -35
- package/dist/{customers-add-customer-group-NUXPXNUC.js → customers-add-customer-group-IAGH6MJJ.js} +47 -47
- package/dist/{edit-inventory-item-YOJTYA7H.js → edit-inventory-item-QPWV4MSP.js} +55 -41
- package/dist/{edit-inventory-item-attributes-JGY633F2.js → edit-inventory-item-attributes-J7WHYKMK.js} +33 -34
- package/dist/{edit-reservation-ACDUXG33.js → edit-reservation-PTUSCC6C.js} +29 -11
- package/dist/{edit-rules-4VAD5Q3L.js → edit-rules-2WZOLTL7.js} +34 -35
- package/dist/extension-targets.d.ts +269 -0
- package/dist/extension-targets.js +1 -0
- package/dist/global-commission-edit-TRSS5JBH.js +203 -0
- package/dist/index.css +5187 -3
- package/dist/index.d.ts +16 -5
- package/dist/index.js +405 -383
- package/dist/inventory-create-RDVKGH2S.js +58 -0
- package/dist/{inventory-detail-B3HU2OVR.js → inventory-detail-LHWQTJ7S.js} +51 -48
- package/dist/{inventory-list-AE44PEW7.js → inventory-list-Q2CCGYI5.js} +10 -10
- package/dist/{inventory-metadata-WCFTI7AH.js → inventory-metadata-CQHLKX4T.js} +34 -35
- package/dist/{inventory-stock-M65W4GRN.js → inventory-stock-3TR47RNA.js} +38 -39
- package/dist/{invite-VQ2HR2OM.js → invite-25CGHT4W.js} +3 -3
- package/dist/loader-TIPLOZF7.js +32 -0
- package/dist/loader-ZYV22XGC.js +40 -0
- package/dist/{location-create-ZMNB7YKR.js → location-create-GKORXOYD.js} +3 -3
- package/dist/{location-detail-2NCZD5MO.js → location-detail-ZRLP4XVJ.js} +36 -37
- package/dist/{location-edit-DMBF3CYZ.js → location-edit-T2CWF6N2.js} +3 -3
- package/dist/{location-fulfillment-providers-3XKOFATD.js → location-fulfillment-providers-CL7PKPTT.js} +48 -49
- package/dist/location-list-HW5F37YZ.js +54 -0
- package/dist/{location-sales-channels-TEUZYDTT.js → location-sales-channels-Z4E5VA7M.js} +10 -11
- package/dist/{location-service-zone-create-ZS3UWJAA.js → location-service-zone-create-WZXZFMA2.js} +12 -12
- package/dist/{location-service-zone-edit-MTGU2O4C.js → location-service-zone-edit-7ZTB45TD.js} +5 -5
- package/dist/{location-service-zone-manage-areas-S7QZTIFT.js → location-service-zone-manage-areas-5SYZKBQK.js} +12 -12
- package/dist/location-service-zone-shipping-option-create-Z3S7EUYH.js +60 -0
- package/dist/{location-service-zone-shipping-option-edit-3PGSNKYT.js → location-service-zone-shipping-option-edit-SLQM4GSH.js} +7 -7
- package/dist/{location-service-zone-shipping-option-pricing-POBJOF3Z.js → location-service-zone-shipping-option-pricing-UZ577SNK.js} +9 -9
- package/dist/{login-DJWU5X5L.js → login-JNIVGP2G.js} +32 -33
- package/dist/{manage-locations-E2XQPKKE.js → manage-locations-NGNUXP3N.js} +3 -3
- package/dist/{marketplace-add-currencies-6ANNBGZM.js → marketplace-add-currencies-ZBLGQQCX.js} +14 -14
- package/dist/marketplace-detail-RZWOCVGF.js +75 -0
- package/dist/{marketplace-edit-6Q3G2OY5.js → marketplace-edit-WG6LMQ2P.js} +5 -5
- package/dist/{marketplace-metadata-7DNBHUDD.js → marketplace-metadata-74YUQ6UC.js} +34 -35
- package/dist/offer-detail-page-XS52BE5U.js +631 -0
- package/dist/offer-variant-detail-page-QQGOMRUY.js +144 -0
- package/dist/offers-UUFYROYV.js +198 -0
- package/dist/{order-create-claim-MPSXY24H.js → order-create-claim-AG3GMAE2.js} +286 -261
- package/dist/{order-create-edit-6JLXERBY.js → order-create-edit-N3TDQQIT.js} +217 -122
- package/dist/{order-create-exchange-O6COEAGJ.js → order-create-exchange-ZCQBC54O.js} +304 -277
- package/dist/{order-create-refund-TCNCSOMX.js → order-create-refund-HXFCDZV5.js} +37 -38
- package/dist/{order-create-return-EVSD6GKE.js → order-create-return-VUHKWVQM.js} +60 -33
- package/dist/{order-detail-BOW62X75.js → order-detail-BU6ZKDVG.js} +53 -51
- package/dist/{order-edit-billing-address-5ZBOWDWQ.js → order-edit-billing-address-S4YOG2EE.js} +35 -36
- package/dist/{order-edit-email-DQJW2SAM.js → order-edit-email-VSAS3M2E.js} +34 -35
- package/dist/{order-edit-shipping-address-RIML4XFQ.js → order-edit-shipping-address-FZMDRJU5.js} +34 -35
- package/dist/{order-list-U5DZYLJK.js → order-list-EFBU3W6N.js} +20 -19
- package/dist/{order-metadata-WGZUETFN.js → order-metadata-FKM3ZDNM.js} +34 -35
- package/dist/{order-request-transfer-QFUMEZPD.js → order-request-transfer-BCE6ED5E.js} +34 -35
- package/dist/pages/index.d.ts +574 -491
- package/dist/pages/index.js +205 -207
- package/dist/{payout-detail-TWO6HN4E.js → payout-detail-LY7SRCKO.js} +3 -3
- package/dist/{payout-list-7WJZFNW5.js → payout-list-WE3H7FKO.js} +9 -9
- package/dist/{price-list-configuration-O3MR5IUA.js → price-list-configuration-4UNGTKCM.js} +15 -14
- package/dist/price-list-create-XGRFJ74B.js +77 -0
- package/dist/price-list-detail-AE6S3CEM.js +108 -0
- package/dist/{price-list-edit-OJAYEUYO.js → price-list-edit-4JPSL2NL.js} +28 -12
- package/dist/{price-list-list-ARICU2NA.js → price-list-list-EM3TNZQG.js} +12 -12
- package/dist/price-list-prices-add-DF6W4N6L.js +72 -0
- package/dist/{price-list-prices-edit-4HBSUC5W.js → price-list-prices-edit-AXJJTMKL.js} +35 -36
- package/dist/{product-add-existing-attributes-IHCIKDIH.js → product-add-existing-attributes-UVVJDOEN.js} +93 -54
- package/dist/{product-attributes-ZURXNZ3J.js → product-attributes-PCZDEFHM.js} +4 -4
- package/dist/{product-bulk-edit-LHCPVFUX.js → product-bulk-edit-FGB4T2KQ.js} +4 -4
- package/dist/product-create-3PZNLIDT.js +77 -0
- package/dist/{product-create-attribute-UBWABT2Q.js → product-create-attribute-6AJPI6IJ.js} +92 -54
- package/dist/{product-create-variant-MVYZPDO7.js → product-create-variant-2OCZA6GW.js} +8 -8
- package/dist/product-detail-IVRD2OHL.js +110 -0
- package/dist/{product-edit-EDW3D2KW.js → product-edit-KMK7CMLI.js} +9 -5
- package/dist/product-edit-attribute-FCEYWZWL.js +336 -0
- package/dist/product-list-IMKQUEIM.js +90 -0
- package/dist/{product-media-J3VTWOU4.js → product-media-B5D2HUQF.js} +14 -17
- package/dist/{product-metadata-T2D4GEIP.js → product-metadata-6EFF4IPX.js} +35 -36
- package/dist/{product-organization-D6UMZAUE.js → product-organization-5FUCDOGD.js} +84 -51
- package/dist/{product-sales-channels-NTT6KMSD.js → product-sales-channels-GUK6FTDA.js} +9 -10
- package/dist/{product-shipping-profile-WM7LORFB.js → product-shipping-profile-UFIRKPTG.js} +4 -4
- package/dist/{product-tag-create-47G425O2.js → product-tag-create-PSY5Q437.js} +33 -34
- package/dist/{product-tag-detail-VNGOBWYE.js → product-tag-detail-L5RXBCPS.js} +59 -58
- package/dist/{product-tag-edit-DN7IVL75.js → product-tag-edit-NVGUS3CY.js} +33 -34
- package/dist/{product-tag-list-ZGRJZT2U.js → product-tag-list-UX2GZALX.js} +59 -58
- package/dist/{product-tag-metadata-YLDBRJMI.js → product-tag-metadata-T4ZYOIXY.js} +34 -35
- package/dist/{product-type-create-RHG4KEAV.js → product-type-create-PPTAW3DW.js} +3 -3
- package/dist/{product-type-detail-MPONGCVO.js → product-type-detail-LJWSJ6V5.js} +45 -46
- package/dist/{product-type-edit-CABB7R7Y.js → product-type-edit-55AH3P7G.js} +3 -3
- package/dist/{product-type-list-TM26QMHR.js → product-type-list-AQ3GEAZX.js} +10 -10
- package/dist/{product-type-metadata-TDAER7JD.js → product-type-metadata-OJJYUALT.js} +34 -35
- package/dist/{product-variant-detail-5BF6JTHV.js → product-variant-detail-FZL5OZFE.js} +33 -34
- package/dist/{product-variant-edit-2RHFG2CZ.js → product-variant-edit-LSSJW4DS.js} +35 -36
- package/dist/{product-variant-metadata-G2LLH7YK.js → product-variant-metadata-D5AUINFJ.js} +34 -35
- package/dist/{profile-detail-ZRL5SERS.js → profile-detail-PFJX3LPX.js} +3 -3
- package/dist/{profile-edit-HQTWYWZ7.js → profile-edit-O6Z3XJ4U.js} +3 -3
- package/dist/{promotion-add-campaign-S3JJSFHT.js → promotion-add-campaign-PYEBYRHK.js} +7 -7
- package/dist/promotion-create-OFLXF3RZ.js +57 -0
- package/dist/promotion-detail-N7JHJGSW.js +96 -0
- package/dist/{promotion-edit-details-TKRC5HES.js → promotion-edit-details-GXA4FDTK.js} +29 -17
- package/dist/{promotion-list-AFBLWKTJ.js → promotion-list-MIL2B752.js} +12 -12
- package/dist/{refund-reason-create-6RPQHIJI.js → refund-reason-create-HTTX2UGC.js} +33 -34
- package/dist/{refund-reason-edit-W2TVZB3N.js → refund-reason-edit-I7XXP4EP.js} +33 -34
- package/dist/{refund-reason-list-TS6JWYS4.js → refund-reason-list-YYCNRERE.js} +50 -49
- package/dist/{region-add-countries-COXN4LP3.js → region-add-countries-WIJCJPOX.js} +13 -13
- package/dist/{region-create-P66Q65XY.js → region-create-B3I3W7QJ.js} +14 -14
- package/dist/{region-detail-P2HHBYFV.js → region-detail-3OFMBGML.js} +10 -10
- package/dist/{region-edit-XFE54SAO.js → region-edit-Z4VYO3TQ.js} +5 -5
- package/dist/{region-list-2XXKCDDX.js → region-list-DD5S5BD2.js} +11 -11
- package/dist/{region-metadata-TNSJDCBM.js → region-metadata-RRUP56B2.js} +34 -35
- package/dist/{reservation-create-2TDZAX5A.js → reservation-create-3RVQVMRF.js} +5 -5
- package/dist/{reservation-detail-KFOVTTFH.js → reservation-detail-QOVPIIMC.js} +42 -39
- package/dist/{reservation-list-K4RPXJTO.js → reservation-list-EJPMH7UX.js} +11 -11
- package/dist/{reservation-metadata-HBFAVVPW.js → reservation-metadata-OAEUUCRG.js} +34 -35
- package/dist/{reset-password-3NYZNQPK.js → reset-password-AZ2RPOG5.js} +3 -3
- package/dist/{return-reason-create-KED7446I.js → return-reason-create-DYJCGEOK.js} +3 -3
- package/dist/{return-reason-edit-57EU3XSE.js → return-reason-edit-A7ATUTCD.js} +3 -3
- package/dist/{return-reason-list-WBLPUYD4.js → return-reason-list-PFDQCDWA.js} +24 -22
- package/dist/{sales-channel-add-products-IHGDKRKH.js → sales-channel-add-products-FXWQ4LZ6.js} +47 -48
- package/dist/{sales-channel-create-MPZCRQBT.js → sales-channel-create-77PRY5T6.js} +4 -4
- package/dist/{sales-channel-detail-QCFO7VUA.js → sales-channel-detail-HVPDMOUJ.js} +44 -45
- package/dist/{sales-channel-edit-GILK4QK3.js → sales-channel-edit-PBN2XYEI.js} +4 -4
- package/dist/sales-channel-list-WBG6DUZJ.js +52 -0
- package/dist/{sales-channel-metadata-OEQVWJRQ.js → sales-channel-metadata-RXT26TCT.js} +34 -35
- package/dist/{shipping-option-type-create-SMXDCF6I.js → shipping-option-type-create-2EVIHSGN.js} +33 -34
- package/dist/{shipping-option-type-detail-MO3YRUVR.js → shipping-option-type-detail-BKFYUX2T.js} +34 -35
- package/dist/{shipping-option-type-edit-KO64TZS6.js → shipping-option-type-edit-LTH6PE7B.js} +33 -34
- package/dist/shipping-option-type-list-7F5R6ACH.js +60 -0
- package/dist/{shipping-profile-create-UJNCCKKK.js → shipping-profile-create-HKYX4FKJ.js} +3 -3
- package/dist/{shipping-profile-detail-YAKZHWZI.js → shipping-profile-detail-FOPCKNOZ.js} +3 -3
- package/dist/{shipping-profile-metadata-FLTMLAZN.js → shipping-profile-metadata-WRFZ55C3.js} +34 -35
- package/dist/{shipping-profiles-list-JF2SQIQ7.js → shipping-profiles-list-KXXYHJIY.js} +9 -9
- package/dist/{store-address-edit-PKIBRFH4.js → store-address-edit-M6A37RFY.js} +4 -4
- package/dist/{store-bulk-edit-LW6ABDJK.js → store-bulk-edit-SYHKAJ6D.js} +5 -5
- package/dist/{store-closure-edit-OK7MTUHY.js → store-closure-edit-VE7D5F7I.js} +3 -3
- package/dist/{store-create-STR6YNFJ.js → store-create-6OQW7F4U.js} +37 -38
- package/dist/store-details-YV4U4GZK.js +104 -0
- package/dist/{store-edit-KRBR5MGV.js → store-edit-33N7EQE2.js} +59 -21
- package/dist/store-list-VTV3TYJN.js +82 -0
- package/dist/{store-member-invite-AKH3KHMF.js → store-member-invite-T5GCT6HV.js} +6 -6
- package/dist/{store-payment-details-edit-HOGHZMZC.js → store-payment-details-edit-JUM745OG.js} +3 -3
- package/dist/{store-professional-details-edit-DPJ4ZFDR.js → store-professional-details-edit-NKBYKBCA.js} +3 -3
- package/dist/{tax-region-create-NEKIT7TT.js → tax-region-create-7FXHJKVB.js} +34 -35
- package/dist/tax-region-detail-6AFMQQP7.js +69 -0
- package/dist/{tax-region-edit-4PJV5F5X.js → tax-region-edit-N64TGNAG.js} +33 -34
- package/dist/{tax-region-list-FIBHEFVD.js → tax-region-list-IBT5YP3U.js} +8 -8
- package/dist/{tax-region-metadata-EYRFMJLL.js → tax-region-metadata-MKXFQ5B7.js} +34 -35
- package/dist/{tax-region-province-create-OVLIZPNP.js → tax-region-province-create-7YT2LNJG.js} +3 -3
- package/dist/{tax-region-province-detail-MTHKW7LW.js → tax-region-province-detail-CBCYMSGF.js} +40 -41
- package/dist/{tax-region-tax-override-create-OGW3MPBD.js → tax-region-tax-override-create-DFOUTYWV.js} +62 -63
- package/dist/{tax-region-tax-override-edit-LTZCYN4Y.js → tax-region-tax-override-edit-PY7XG5KR.js} +62 -63
- package/dist/{tax-region-tax-rate-create-KDN6G52Y.js → tax-region-tax-rate-create-3ZLVL3X3.js} +4 -4
- package/dist/{tax-region-tax-rate-edit-D4BFDDJ7.js → tax-region-tax-rate-edit-XVMPIJOF.js} +4 -4
- package/dist/{user-detail-2OTVNTCL.js → user-detail-4FDNMJ6W.js} +4 -4
- package/dist/{user-edit-MXS2DV37.js → user-edit-T3MZKULQ.js} +3 -3
- package/dist/{user-invite-HLZJ7FST.js → user-invite-LSWNFFLT.js} +12 -12
- package/dist/{user-list-TR7RSGUO.js → user-list-B66HEMCD.js} +8 -8
- package/dist/{user-metadata-GIR3A7WO.js → user-metadata-5UFWFXLX.js} +34 -35
- package/package.json +25 -17
- package/dist/[id]-272FUOXG.js +0 -503
- package/dist/attribute-list-URWKNTSJ.js +0 -62
- package/dist/category-detail-RIKOZMPK.js +0 -108
- package/dist/category-organize-DQQGAAJY.js +0 -112
- package/dist/chunk-2XVH2IJL.js +0 -473
- package/dist/chunk-54RTJBYO.js +0 -153
- package/dist/chunk-6WBQDJIH.js +0 -1733
- package/dist/chunk-7O6WJTBI.js +0 -139
- package/dist/chunk-AKTAFKIU.js +0 -228
- package/dist/chunk-CKNQJPAG.js +0 -135
- package/dist/chunk-DDANJIE7.js +0 -207
- package/dist/chunk-GVEF6UDT.js +0 -8
- package/dist/chunk-J65IXAGI.js +0 -292
- package/dist/chunk-LFKTHNWI.js +0 -83
- package/dist/chunk-MSESXKMA.js +0 -390
- package/dist/chunk-RXM4B6HR.js +0 -8
- package/dist/chunk-SWL7ZCP3.js +0 -11
- package/dist/chunk-TE245WV3.js +0 -371
- package/dist/chunk-UM7ZR3VU.js +0 -14
- package/dist/chunk-V5XHY5LP.js +0 -39
- package/dist/chunk-ZZ3XFIEM.js +0 -84
- package/dist/collection-detail-W7OC2ALM.js +0 -99
- package/dist/collection-list-B7LALPSA.js +0 -83
- package/dist/commission-rate-create-7MEIKAXK.js +0 -783
- package/dist/commission-rate-detail-XBMB3Y7S.js +0 -86
- package/dist/commission-rate-edit-XXUAGK5Q.js +0 -768
- package/dist/commission-rate-list-Y5XLEO67.js +0 -26
- package/dist/customer-group-list-63ER7WQH.js +0 -58
- package/dist/inventory-create-3NJZLSFO.js +0 -59
- package/dist/loader-O4EABIXE.js +0 -26
- package/dist/location-list-VS6V2FXE.js +0 -55
- package/dist/location-service-zone-shipping-option-create-LAM3OHBC.js +0 -61
- package/dist/marketplace-detail-IQLU7R3J.js +0 -76
- package/dist/offers-UJCSO3RD.js +0 -440
- package/dist/order-allocate-items-TMVWJUV3.js +0 -563
- package/dist/order-create-fulfillment-Y4HQ5YRS.js +0 -644
- package/dist/order-create-shipment-EWOJJXEM.js +0 -215
- package/dist/order-receive-return-MDUU4L4X.js +0 -563
- package/dist/price-list-create-J4AJG42T.js +0 -78
- package/dist/price-list-detail-D2ETNZ5N.js +0 -105
- package/dist/price-list-prices-add-FQLQ5DPX.js +0 -73
- package/dist/product-brand-create-B3ZJGHUQ.js +0 -171
- package/dist/product-brand-detail-O7UKYV4H.js +0 -100
- package/dist/product-brand-edit-3TQDHZNN.js +0 -179
- package/dist/product-brand-list-ZBPBSRQN.js +0 -30
- package/dist/product-brand-metadata-N2CJ5K3Z.js +0 -87
- package/dist/product-create-BQXFDMEP.js +0 -72
- package/dist/product-detail-I57XSYLB.js +0 -102
- package/dist/product-list-PR532XII.js +0 -88
- package/dist/promotion-create-G3M4UJX2.js +0 -58
- package/dist/promotion-detail-4EHU6FKF.js +0 -91
- package/dist/sales-channel-list-YNHR5EHL.js +0 -54
- package/dist/shipping-option-type-list-6C26GWDM.js +0 -61
- package/dist/store-details-3U4OEFWC.js +0 -122
- package/dist/store-list-PJ3U254I.js +0 -83
- package/dist/tax-region-detail-LVN5XSN5.js +0 -70
|
@@ -0,0 +1,1284 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ProductMediaSection
|
|
3
|
+
} from "./chunk-KUBTN5TC.js";
|
|
4
|
+
import {
|
|
5
|
+
SectionRow
|
|
6
|
+
} from "./chunk-3XPXUIK3.js";
|
|
7
|
+
import {
|
|
8
|
+
PRODUCT_DETAIL_QUERY
|
|
9
|
+
} from "./chunk-6BAPAIQM.js";
|
|
10
|
+
import {
|
|
11
|
+
TwoColumnPage
|
|
12
|
+
} from "./chunk-E74OUNA3.js";
|
|
13
|
+
import {
|
|
14
|
+
Thumbnail
|
|
15
|
+
} from "./chunk-WIYFXWRI.js";
|
|
16
|
+
import {
|
|
17
|
+
useQueryParams
|
|
18
|
+
} from "./chunk-THHRRYRS.js";
|
|
19
|
+
import {
|
|
20
|
+
require_dist
|
|
21
|
+
} from "./chunk-VYSB4CTB.js";
|
|
22
|
+
import {
|
|
23
|
+
_DataTable,
|
|
24
|
+
useDataTable
|
|
25
|
+
} from "./chunk-GRFWCCUW.js";
|
|
26
|
+
import {
|
|
27
|
+
useSeller
|
|
28
|
+
} from "./chunk-SAU35JEB.js";
|
|
29
|
+
import {
|
|
30
|
+
ActionMenu
|
|
31
|
+
} from "./chunk-BDGZ4EQO.js";
|
|
32
|
+
import {
|
|
33
|
+
TwoColumnPageSkeleton
|
|
34
|
+
} from "./chunk-INNFZYX2.js";
|
|
35
|
+
import {
|
|
36
|
+
useCancelProductChange,
|
|
37
|
+
useConfirmProduct,
|
|
38
|
+
useConfirmProductChange,
|
|
39
|
+
useDeleteProduct,
|
|
40
|
+
useDeleteVariantLazy,
|
|
41
|
+
useProduct,
|
|
42
|
+
useProductChange,
|
|
43
|
+
useProductVariants,
|
|
44
|
+
useRejectProduct,
|
|
45
|
+
useRemoveAttributeFromProduct,
|
|
46
|
+
useRequestProductChanges
|
|
47
|
+
} from "./chunk-MMKUMSZS.js";
|
|
48
|
+
import {
|
|
49
|
+
sdk
|
|
50
|
+
} from "./chunk-LXZXXOJ3.js";
|
|
51
|
+
import {
|
|
52
|
+
__toESM
|
|
53
|
+
} from "./chunk-NBMM2TZK.js";
|
|
54
|
+
|
|
55
|
+
// src/pages/products/product-detail/product-detail.tsx
|
|
56
|
+
import { Children } from "react";
|
|
57
|
+
import { useLoaderData, useParams } from "react-router-dom";
|
|
58
|
+
import { WidgetZone, useLinkQuery } from "@mercurjs/dashboard-shared";
|
|
59
|
+
|
|
60
|
+
// src/pages/products/product-detail/components/product-active-edit-section/product-active-edit-section.tsx
|
|
61
|
+
var import_types = __toESM(require_dist(), 1);
|
|
62
|
+
import { useState as useState2 } from "react";
|
|
63
|
+
import { Button, Text, toast } from "@medusajs/ui";
|
|
64
|
+
import {
|
|
65
|
+
ProductChangePanel
|
|
66
|
+
} from "@mercurjs/dashboard-shared";
|
|
67
|
+
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
68
|
+
|
|
69
|
+
// src/components/common/confirm-prompt/confirm-prompt.tsx
|
|
70
|
+
import { Label, Prompt, Textarea } from "@medusajs/ui";
|
|
71
|
+
import { useEffect, useState } from "react";
|
|
72
|
+
import { useTranslation } from "react-i18next";
|
|
73
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
74
|
+
var ConfirmPrompt = ({
|
|
75
|
+
open,
|
|
76
|
+
onOpenChange,
|
|
77
|
+
variant = "confirmation",
|
|
78
|
+
title,
|
|
79
|
+
description,
|
|
80
|
+
noteLabel,
|
|
81
|
+
noteOptional = false,
|
|
82
|
+
notePlaceholder,
|
|
83
|
+
defaultNote = "",
|
|
84
|
+
cancelLabel,
|
|
85
|
+
confirmLabel,
|
|
86
|
+
isLoading = false,
|
|
87
|
+
onConfirm
|
|
88
|
+
}) => {
|
|
89
|
+
const { t } = useTranslation();
|
|
90
|
+
const [note, setNote] = useState(defaultNote);
|
|
91
|
+
useEffect(() => {
|
|
92
|
+
if (open) {
|
|
93
|
+
setNote(defaultNote);
|
|
94
|
+
}
|
|
95
|
+
}, [open, defaultNote]);
|
|
96
|
+
const showNoteField = typeof noteLabel === "string";
|
|
97
|
+
const handleOpenChange = (next) => {
|
|
98
|
+
if (isLoading) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
onOpenChange(next);
|
|
102
|
+
};
|
|
103
|
+
const handleConfirm = async () => {
|
|
104
|
+
const trimmed = note.trim();
|
|
105
|
+
await onConfirm(showNoteField && trimmed ? trimmed : void 0);
|
|
106
|
+
};
|
|
107
|
+
return /* @__PURE__ */ jsx(Prompt, { open, onOpenChange: handleOpenChange, variant, children: /* @__PURE__ */ jsxs(Prompt.Content, { children: [
|
|
108
|
+
/* @__PURE__ */ jsxs(Prompt.Header, { className: showNoteField ? "pb-6" : void 0, children: [
|
|
109
|
+
/* @__PURE__ */ jsx(Prompt.Title, { children: title }),
|
|
110
|
+
description ? /* @__PURE__ */ jsx(Prompt.Description, { children: description }) : null
|
|
111
|
+
] }),
|
|
112
|
+
showNoteField ? /* @__PURE__ */ jsxs("div", { className: "border-ui-border-base flex flex-col gap-y-2 border-y px-6 py-4", children: [
|
|
113
|
+
/* @__PURE__ */ jsxs(Label, { size: "small", weight: "plus", children: [
|
|
114
|
+
noteLabel,
|
|
115
|
+
noteOptional ? /* @__PURE__ */ jsxs("span", { className: "text-ui-fg-muted ml-1 font-normal", children: [
|
|
116
|
+
"(",
|
|
117
|
+
t("fields.optional"),
|
|
118
|
+
")"
|
|
119
|
+
] }) : null
|
|
120
|
+
] }),
|
|
121
|
+
/* @__PURE__ */ jsx(
|
|
122
|
+
Textarea,
|
|
123
|
+
{
|
|
124
|
+
placeholder: notePlaceholder,
|
|
125
|
+
value: note,
|
|
126
|
+
onChange: (e) => setNote(e.target.value),
|
|
127
|
+
disabled: isLoading
|
|
128
|
+
}
|
|
129
|
+
)
|
|
130
|
+
] }) : null,
|
|
131
|
+
/* @__PURE__ */ jsxs(Prompt.Footer, { children: [
|
|
132
|
+
/* @__PURE__ */ jsx(Prompt.Cancel, { disabled: isLoading, children: cancelLabel ?? t("actions.cancel") }),
|
|
133
|
+
/* @__PURE__ */ jsx(
|
|
134
|
+
Prompt.Action,
|
|
135
|
+
{
|
|
136
|
+
onClick: (e) => {
|
|
137
|
+
e.preventDefault();
|
|
138
|
+
void handleConfirm();
|
|
139
|
+
},
|
|
140
|
+
disabled: isLoading,
|
|
141
|
+
children: confirmLabel ?? t("actions.confirm")
|
|
142
|
+
}
|
|
143
|
+
)
|
|
144
|
+
] })
|
|
145
|
+
] }) });
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
// src/pages/products/product-detail/components/product-active-edit-section/product-active-edit-section.tsx
|
|
149
|
+
import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
150
|
+
var VARIANT_LOOKUP_FIELDS = "id,title,sku,*images";
|
|
151
|
+
var resolversFor = (productId) => ({
|
|
152
|
+
getType: async (id) => {
|
|
153
|
+
const { product_type } = await sdk.admin.productTypes.$id.query({ $id: id });
|
|
154
|
+
return product_type?.value ?? null;
|
|
155
|
+
},
|
|
156
|
+
getCollection: async (id) => {
|
|
157
|
+
const { collection } = await sdk.admin.collections.$id.query({ $id: id });
|
|
158
|
+
return collection?.title ?? null;
|
|
159
|
+
},
|
|
160
|
+
getCategory: async (id) => {
|
|
161
|
+
const { product_category } = await sdk.admin.productCategories.$id.query({
|
|
162
|
+
$id: id
|
|
163
|
+
});
|
|
164
|
+
return product_category?.name ?? null;
|
|
165
|
+
},
|
|
166
|
+
getTag: async (id) => {
|
|
167
|
+
const { product_tag } = await sdk.admin.productTags.$id.query({ $id: id });
|
|
168
|
+
return product_tag?.value ?? null;
|
|
169
|
+
},
|
|
170
|
+
getAttribute: async (id) => {
|
|
171
|
+
const { product_attribute } = await sdk.admin.productAttributes.$id.query({
|
|
172
|
+
$id: id
|
|
173
|
+
});
|
|
174
|
+
if (!product_attribute) return null;
|
|
175
|
+
return {
|
|
176
|
+
name: product_attribute.name ?? id,
|
|
177
|
+
values: (product_attribute.values ?? []).map((v) => ({
|
|
178
|
+
id: v.id,
|
|
179
|
+
name: v.name ?? v.id
|
|
180
|
+
}))
|
|
181
|
+
};
|
|
182
|
+
},
|
|
183
|
+
getVariant: async (variantId) => {
|
|
184
|
+
const { variant } = await sdk.admin.products.$id.variants.$variantId.query({
|
|
185
|
+
$id: productId,
|
|
186
|
+
$variantId: variantId,
|
|
187
|
+
fields: VARIANT_LOOKUP_FIELDS
|
|
188
|
+
});
|
|
189
|
+
return variant ?? null;
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
var ProductActiveEditSection = ({
|
|
193
|
+
product
|
|
194
|
+
}) => {
|
|
195
|
+
const { t } = useTranslation2();
|
|
196
|
+
const [confirmOpen, setConfirmOpen] = useState2(false);
|
|
197
|
+
const [rejectOpen, setRejectOpen] = useState2(false);
|
|
198
|
+
const { product_change, isError } = useProductChange(product.id, {
|
|
199
|
+
retry: false
|
|
200
|
+
});
|
|
201
|
+
const requesterId = product_change?.created_by ?? "";
|
|
202
|
+
const { seller: requesterSeller } = useSeller(requesterId, void 0, {
|
|
203
|
+
enabled: !!requesterId
|
|
204
|
+
});
|
|
205
|
+
const { mutateAsync: confirmChange, isPending: isConfirming } = useConfirmProductChange(product_change?.id ?? "", product.id);
|
|
206
|
+
const { mutateAsync: cancelChange, isPending: isRejecting } = useCancelProductChange(product_change?.id ?? "", product.id);
|
|
207
|
+
if (isError || !product_change) {
|
|
208
|
+
return null;
|
|
209
|
+
}
|
|
210
|
+
if (product_change.status !== import_types.ProductChangeStatus.PENDING) {
|
|
211
|
+
return null;
|
|
212
|
+
}
|
|
213
|
+
const handleConfirm = async (note) => {
|
|
214
|
+
try {
|
|
215
|
+
await confirmChange({ internal_note: note });
|
|
216
|
+
toast.success(t("products.edits.toast.confirmedSuccessfully"));
|
|
217
|
+
setConfirmOpen(false);
|
|
218
|
+
} catch (e) {
|
|
219
|
+
toast.error(e.message);
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
const handleReject = async (note) => {
|
|
223
|
+
try {
|
|
224
|
+
await cancelChange({ internal_note: note });
|
|
225
|
+
toast.success(t("products.edits.toast.rejectedSuccessfully"));
|
|
226
|
+
setRejectOpen(false);
|
|
227
|
+
} catch (e) {
|
|
228
|
+
toast.error(e.message);
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
const panelProduct = {
|
|
232
|
+
id: product.id,
|
|
233
|
+
title: product.title,
|
|
234
|
+
thumbnail: product.thumbnail,
|
|
235
|
+
variants: product.variants,
|
|
236
|
+
attributes: product.attributes
|
|
237
|
+
};
|
|
238
|
+
return /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
239
|
+
/* @__PURE__ */ jsx2(
|
|
240
|
+
ProductChangePanel,
|
|
241
|
+
{
|
|
242
|
+
product: panelProduct,
|
|
243
|
+
actions: product_change.actions ?? [],
|
|
244
|
+
resolvers: resolversFor(product.id),
|
|
245
|
+
headerDescription: /* @__PURE__ */ jsx2(Text, { size: "small", leading: "compact", className: "text-ui-fg-subtle", children: t("products.edits.panel.description", {
|
|
246
|
+
store: requesterSeller?.name ?? t("products.request.fallbackStore")
|
|
247
|
+
}) }),
|
|
248
|
+
footer: /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
249
|
+
/* @__PURE__ */ jsx2(
|
|
250
|
+
Button,
|
|
251
|
+
{
|
|
252
|
+
size: "small",
|
|
253
|
+
variant: "secondary",
|
|
254
|
+
onClick: () => setConfirmOpen(true),
|
|
255
|
+
"data-testid": "product-active-edit-confirm-button",
|
|
256
|
+
children: t("actions.confirm")
|
|
257
|
+
}
|
|
258
|
+
),
|
|
259
|
+
/* @__PURE__ */ jsx2(
|
|
260
|
+
Button,
|
|
261
|
+
{
|
|
262
|
+
size: "small",
|
|
263
|
+
variant: "secondary",
|
|
264
|
+
onClick: () => setRejectOpen(true),
|
|
265
|
+
"data-testid": "product-active-edit-reject-button",
|
|
266
|
+
children: t("products.edits.actions.reject")
|
|
267
|
+
}
|
|
268
|
+
)
|
|
269
|
+
] })
|
|
270
|
+
}
|
|
271
|
+
),
|
|
272
|
+
/* @__PURE__ */ jsx2(
|
|
273
|
+
ConfirmPrompt,
|
|
274
|
+
{
|
|
275
|
+
open: confirmOpen,
|
|
276
|
+
onOpenChange: setConfirmOpen,
|
|
277
|
+
title: t("products.edits.confirmPrompt.title"),
|
|
278
|
+
description: t("products.edits.confirmPrompt.description"),
|
|
279
|
+
noteLabel: t("products.edits.confirmPrompt.noteLabel"),
|
|
280
|
+
noteOptional: true,
|
|
281
|
+
notePlaceholder: t("products.edits.confirmPrompt.notePlaceholder"),
|
|
282
|
+
isLoading: isConfirming,
|
|
283
|
+
onConfirm: handleConfirm
|
|
284
|
+
}
|
|
285
|
+
),
|
|
286
|
+
/* @__PURE__ */ jsx2(
|
|
287
|
+
ConfirmPrompt,
|
|
288
|
+
{
|
|
289
|
+
open: rejectOpen,
|
|
290
|
+
onOpenChange: setRejectOpen,
|
|
291
|
+
title: t("products.edits.rejectPrompt.title"),
|
|
292
|
+
description: t("products.edits.rejectPrompt.description"),
|
|
293
|
+
noteLabel: t("products.edits.rejectPrompt.noteLabel"),
|
|
294
|
+
noteOptional: true,
|
|
295
|
+
notePlaceholder: t("products.edits.rejectPrompt.notePlaceholder"),
|
|
296
|
+
confirmLabel: t("products.edits.rejectPrompt.confirm"),
|
|
297
|
+
isLoading: isRejecting,
|
|
298
|
+
onConfirm: handleReject
|
|
299
|
+
}
|
|
300
|
+
)
|
|
301
|
+
] });
|
|
302
|
+
};
|
|
303
|
+
|
|
304
|
+
// src/pages/products/product-detail/components/product-active-request-section/product-active-request-section.tsx
|
|
305
|
+
var import_types2 = __toESM(require_dist(), 1);
|
|
306
|
+
import { useState as useState3 } from "react";
|
|
307
|
+
import { Button as Button2, Container, Heading, Text as Text2, toast as toast2 } from "@medusajs/ui";
|
|
308
|
+
import { ExclamationCircleSolid } from "@medusajs/icons";
|
|
309
|
+
import { useTranslation as useTranslation3 } from "react-i18next";
|
|
310
|
+
import { DisplayExtensionZone } from "@mercurjs/dashboard-shared";
|
|
311
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
312
|
+
var ProductActiveRequestSection = ({
|
|
313
|
+
product
|
|
314
|
+
}) => {
|
|
315
|
+
const { t } = useTranslation3();
|
|
316
|
+
const [confirmOpen, setConfirmOpen] = useState3(false);
|
|
317
|
+
const [requestUpdateOpen, setRequestUpdateOpen] = useState3(false);
|
|
318
|
+
const [rejectOpen, setRejectOpen] = useState3(false);
|
|
319
|
+
const { mutateAsync: confirmProduct, isPending: isConfirming } = useConfirmProduct(product.id);
|
|
320
|
+
const { mutateAsync: requestProductChanges, isPending: isRequestingUpdate } = useRequestProductChanges(product.id);
|
|
321
|
+
const { mutateAsync: rejectProduct, isPending: isRejecting } = useRejectProduct(product.id);
|
|
322
|
+
if (product.status !== import_types2.ProductStatus.PROPOSED) {
|
|
323
|
+
return null;
|
|
324
|
+
}
|
|
325
|
+
const handleConfirm = async (note) => {
|
|
326
|
+
try {
|
|
327
|
+
await confirmProduct({ internal_note: note });
|
|
328
|
+
toast2.success(t("products.request.toast.publishedSuccessfully"));
|
|
329
|
+
setConfirmOpen(false);
|
|
330
|
+
} catch (e) {
|
|
331
|
+
toast2.error(e.message);
|
|
332
|
+
}
|
|
333
|
+
};
|
|
334
|
+
const handleRequestUpdate = async (note) => {
|
|
335
|
+
try {
|
|
336
|
+
await requestProductChanges({ message: note });
|
|
337
|
+
toast2.success(t("products.request.toast.updateRequestedSuccessfully"));
|
|
338
|
+
setRequestUpdateOpen(false);
|
|
339
|
+
} catch (e) {
|
|
340
|
+
toast2.error(e.message);
|
|
341
|
+
}
|
|
342
|
+
};
|
|
343
|
+
const handleReject = async (note) => {
|
|
344
|
+
try {
|
|
345
|
+
await rejectProduct({ message: note });
|
|
346
|
+
toast2.success(t("products.request.toast.rejectedSuccessfully"));
|
|
347
|
+
setRejectOpen(false);
|
|
348
|
+
} catch (e) {
|
|
349
|
+
toast2.error(e.message);
|
|
350
|
+
}
|
|
351
|
+
};
|
|
352
|
+
return /* @__PURE__ */ jsxs3(
|
|
353
|
+
Container,
|
|
354
|
+
{
|
|
355
|
+
className: "divide-y p-0",
|
|
356
|
+
"data-testid": "product-active-request-section",
|
|
357
|
+
children: [
|
|
358
|
+
/* @__PURE__ */ jsxs3(
|
|
359
|
+
"div",
|
|
360
|
+
{
|
|
361
|
+
className: "flex items-center gap-2 px-6 py-4",
|
|
362
|
+
"data-testid": "product-active-request-header",
|
|
363
|
+
children: [
|
|
364
|
+
/* @__PURE__ */ jsx3(ExclamationCircleSolid, { className: "text-ui-fg-interactive" }),
|
|
365
|
+
/* @__PURE__ */ jsx3(Heading, { level: "h2", "data-testid": "product-active-request-heading", children: t("products.request.panel.title") })
|
|
366
|
+
]
|
|
367
|
+
}
|
|
368
|
+
),
|
|
369
|
+
/* @__PURE__ */ jsx3("div", { className: "px-6 py-4", children: /* @__PURE__ */ jsx3(Text2, { size: "small", leading: "compact", className: "text-ui-fg-subtle", children: t("products.request.panel.description", {
|
|
370
|
+
store: product.sellers?.[0]?.name ?? t("products.request.fallbackStore")
|
|
371
|
+
}) }) }),
|
|
372
|
+
/* @__PURE__ */ jsxs3(
|
|
373
|
+
"div",
|
|
374
|
+
{
|
|
375
|
+
className: "bg-ui-bg-subtle flex items-center justify-end gap-x-2 rounded-b-xl px-6 py-4",
|
|
376
|
+
"data-testid": "product-active-request-actions",
|
|
377
|
+
children: [
|
|
378
|
+
/* @__PURE__ */ jsx3(
|
|
379
|
+
Button2,
|
|
380
|
+
{
|
|
381
|
+
size: "small",
|
|
382
|
+
variant: "secondary",
|
|
383
|
+
onClick: () => setConfirmOpen(true),
|
|
384
|
+
"data-testid": "product-active-request-confirm-button",
|
|
385
|
+
children: t("actions.confirm")
|
|
386
|
+
}
|
|
387
|
+
),
|
|
388
|
+
/* @__PURE__ */ jsx3(
|
|
389
|
+
Button2,
|
|
390
|
+
{
|
|
391
|
+
size: "small",
|
|
392
|
+
variant: "secondary",
|
|
393
|
+
onClick: () => setRequestUpdateOpen(true),
|
|
394
|
+
"data-testid": "product-active-request-request-update-button",
|
|
395
|
+
children: t("products.request.actions.requestUpdate")
|
|
396
|
+
}
|
|
397
|
+
),
|
|
398
|
+
/* @__PURE__ */ jsx3(
|
|
399
|
+
Button2,
|
|
400
|
+
{
|
|
401
|
+
size: "small",
|
|
402
|
+
variant: "secondary",
|
|
403
|
+
onClick: () => setRejectOpen(true),
|
|
404
|
+
"data-testid": "product-active-request-reject-button",
|
|
405
|
+
children: t("products.request.actions.reject")
|
|
406
|
+
}
|
|
407
|
+
)
|
|
408
|
+
]
|
|
409
|
+
}
|
|
410
|
+
),
|
|
411
|
+
/* @__PURE__ */ jsx3(
|
|
412
|
+
ConfirmPrompt,
|
|
413
|
+
{
|
|
414
|
+
open: confirmOpen,
|
|
415
|
+
onOpenChange: setConfirmOpen,
|
|
416
|
+
title: t("products.request.confirmPrompt.title"),
|
|
417
|
+
description: t("products.request.confirmPrompt.description"),
|
|
418
|
+
noteLabel: t("products.request.confirmPrompt.noteLabel"),
|
|
419
|
+
noteOptional: true,
|
|
420
|
+
notePlaceholder: t("products.request.confirmPrompt.notePlaceholder"),
|
|
421
|
+
isLoading: isConfirming,
|
|
422
|
+
onConfirm: handleConfirm
|
|
423
|
+
}
|
|
424
|
+
),
|
|
425
|
+
/* @__PURE__ */ jsx3(
|
|
426
|
+
ConfirmPrompt,
|
|
427
|
+
{
|
|
428
|
+
open: requestUpdateOpen,
|
|
429
|
+
onOpenChange: setRequestUpdateOpen,
|
|
430
|
+
title: t("products.request.requestUpdatePrompt.title"),
|
|
431
|
+
description: t("products.request.requestUpdatePrompt.description"),
|
|
432
|
+
noteLabel: t("products.request.requestUpdatePrompt.noteLabel"),
|
|
433
|
+
noteOptional: true,
|
|
434
|
+
notePlaceholder: t(
|
|
435
|
+
"products.request.requestUpdatePrompt.notePlaceholder"
|
|
436
|
+
),
|
|
437
|
+
confirmLabel: t("products.request.requestUpdatePrompt.send"),
|
|
438
|
+
isLoading: isRequestingUpdate,
|
|
439
|
+
onConfirm: handleRequestUpdate
|
|
440
|
+
}
|
|
441
|
+
),
|
|
442
|
+
/* @__PURE__ */ jsx3(
|
|
443
|
+
ConfirmPrompt,
|
|
444
|
+
{
|
|
445
|
+
open: rejectOpen,
|
|
446
|
+
onOpenChange: setRejectOpen,
|
|
447
|
+
title: t("products.request.rejectPrompt.title"),
|
|
448
|
+
description: t("products.request.rejectPrompt.description"),
|
|
449
|
+
noteLabel: t("products.request.rejectPrompt.noteLabel"),
|
|
450
|
+
noteOptional: true,
|
|
451
|
+
notePlaceholder: t("products.request.rejectPrompt.notePlaceholder"),
|
|
452
|
+
confirmLabel: t("products.request.rejectPrompt.confirm"),
|
|
453
|
+
isLoading: isRejecting,
|
|
454
|
+
onConfirm: handleReject
|
|
455
|
+
}
|
|
456
|
+
),
|
|
457
|
+
/* @__PURE__ */ jsx3(DisplayExtensionZone, { model: "product", zone: "request", data: product })
|
|
458
|
+
]
|
|
459
|
+
}
|
|
460
|
+
);
|
|
461
|
+
};
|
|
462
|
+
|
|
463
|
+
// src/pages/products/product-detail/components/product-attribute-section/product-attribute-section.tsx
|
|
464
|
+
import {
|
|
465
|
+
Plus,
|
|
466
|
+
Trash,
|
|
467
|
+
Swatch,
|
|
468
|
+
DropCap,
|
|
469
|
+
InformationCircleSolid,
|
|
470
|
+
PencilSquare
|
|
471
|
+
} from "@medusajs/icons";
|
|
472
|
+
import {
|
|
473
|
+
Badge,
|
|
474
|
+
Container as Container2,
|
|
475
|
+
Heading as Heading2,
|
|
476
|
+
Text as Text3,
|
|
477
|
+
toast as toast3,
|
|
478
|
+
Tooltip,
|
|
479
|
+
usePrompt
|
|
480
|
+
} from "@medusajs/ui";
|
|
481
|
+
import { useTranslation as useTranslation4 } from "react-i18next";
|
|
482
|
+
import { DisplayExtensionZone as DisplayExtensionZone2 } from "@mercurjs/dashboard-shared";
|
|
483
|
+
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
484
|
+
var AttributeActions = ({
|
|
485
|
+
productId,
|
|
486
|
+
attribute
|
|
487
|
+
}) => {
|
|
488
|
+
const { t } = useTranslation4();
|
|
489
|
+
const prompt = usePrompt();
|
|
490
|
+
const { mutateAsync } = useRemoveAttributeFromProduct(productId, attribute.id);
|
|
491
|
+
const handleDelete = async () => {
|
|
492
|
+
const res = await prompt({
|
|
493
|
+
title: t("general.areYouSure"),
|
|
494
|
+
description: t("products.deleteAttributeWarning", {
|
|
495
|
+
title: attribute.name
|
|
496
|
+
}),
|
|
497
|
+
confirmText: t("actions.delete"),
|
|
498
|
+
cancelText: t("actions.cancel")
|
|
499
|
+
});
|
|
500
|
+
if (!res) {
|
|
501
|
+
return;
|
|
502
|
+
}
|
|
503
|
+
await mutateAsync(void 0, {
|
|
504
|
+
onError: (error) => {
|
|
505
|
+
toast3.error(error.message);
|
|
506
|
+
}
|
|
507
|
+
});
|
|
508
|
+
};
|
|
509
|
+
return /* @__PURE__ */ jsx4(
|
|
510
|
+
ActionMenu,
|
|
511
|
+
{
|
|
512
|
+
groups: [
|
|
513
|
+
{
|
|
514
|
+
actions: [
|
|
515
|
+
{
|
|
516
|
+
label: t("actions.edit"),
|
|
517
|
+
to: `attributes/${attribute.id}/edit`,
|
|
518
|
+
icon: /* @__PURE__ */ jsx4(PencilSquare, {})
|
|
519
|
+
}
|
|
520
|
+
]
|
|
521
|
+
},
|
|
522
|
+
...attribute.is_required ? [] : [
|
|
523
|
+
{
|
|
524
|
+
actions: [
|
|
525
|
+
{
|
|
526
|
+
label: t("actions.delete"),
|
|
527
|
+
onClick: handleDelete,
|
|
528
|
+
icon: /* @__PURE__ */ jsx4(Trash, {})
|
|
529
|
+
}
|
|
530
|
+
]
|
|
531
|
+
}
|
|
532
|
+
]
|
|
533
|
+
]
|
|
534
|
+
}
|
|
535
|
+
);
|
|
536
|
+
};
|
|
537
|
+
var AttributeValue = ({
|
|
538
|
+
attribute
|
|
539
|
+
}) => {
|
|
540
|
+
const { t } = useTranslation4();
|
|
541
|
+
const values = attribute.values?.map((v) => v.name) ?? [];
|
|
542
|
+
if (["single_select", "multi_select"].includes(attribute.type)) {
|
|
543
|
+
return /* @__PURE__ */ jsx4("div", { className: "flex flex-wrap gap-1", children: values.map((val) => /* @__PURE__ */ jsx4(
|
|
544
|
+
Badge,
|
|
545
|
+
{
|
|
546
|
+
size: "2xsmall",
|
|
547
|
+
className: "flex min-w-[20px] items-center justify-center",
|
|
548
|
+
children: val
|
|
549
|
+
},
|
|
550
|
+
val
|
|
551
|
+
)) });
|
|
552
|
+
}
|
|
553
|
+
const textValue = attribute.type === "toggle" ? values.map((val) => val === "true" ? t("general.yes") : t("general.no")).join(", ") || "-" : values.join(", ") || "-";
|
|
554
|
+
return /* @__PURE__ */ jsx4(Tooltip, { content: /* @__PURE__ */ jsx4("span", { className: "break-all", children: textValue }), children: /* @__PURE__ */ jsx4(
|
|
555
|
+
Text3,
|
|
556
|
+
{
|
|
557
|
+
size: "small",
|
|
558
|
+
leading: "compact",
|
|
559
|
+
className: "line-clamp-3 min-w-0 break-words text-ui-fg-subtle",
|
|
560
|
+
children: textValue
|
|
561
|
+
}
|
|
562
|
+
) });
|
|
563
|
+
};
|
|
564
|
+
var AttributeGroup = ({
|
|
565
|
+
icon,
|
|
566
|
+
title,
|
|
567
|
+
description,
|
|
568
|
+
attributes,
|
|
569
|
+
productId
|
|
570
|
+
}) => {
|
|
571
|
+
const { t } = useTranslation4();
|
|
572
|
+
if (!attributes.length) {
|
|
573
|
+
return null;
|
|
574
|
+
}
|
|
575
|
+
return /* @__PURE__ */ jsxs4("div", { className: "flex flex-col gap-y-4 px-3 py-4", children: [
|
|
576
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-x-3 px-3", children: [
|
|
577
|
+
/* @__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 }),
|
|
578
|
+
/* @__PURE__ */ jsxs4("div", { children: [
|
|
579
|
+
/* @__PURE__ */ jsx4(Text3, { size: "small", weight: "plus", leading: "compact", children: title }),
|
|
580
|
+
/* @__PURE__ */ jsx4(Text3, { size: "small", leading: "compact", className: "text-ui-fg-subtle", children: description })
|
|
581
|
+
] })
|
|
582
|
+
] }),
|
|
583
|
+
/* @__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) => {
|
|
584
|
+
return /* @__PURE__ */ jsx4(
|
|
585
|
+
"div",
|
|
586
|
+
{
|
|
587
|
+
className: index < attributes.length - 1 ? "border-b border-ui-border-base" : "",
|
|
588
|
+
children: /* @__PURE__ */ jsxs4("div", { className: "grid grid-cols-[minmax(0,1fr)_minmax(0,1fr)_28px] items-center gap-4 px-4 py-3 bg-ui-bg-component", children: [
|
|
589
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-x-2 text-ui-fg-subtle", children: [
|
|
590
|
+
/* @__PURE__ */ jsx4(Text3, { size: "small", weight: "plus", leading: "compact", children: attr.name }),
|
|
591
|
+
attr.description && /* @__PURE__ */ jsx4(Tooltip, { content: attr.description, children: /* @__PURE__ */ jsx4("span", { className: "text-ui-fg-muted flex items-center", children: /* @__PURE__ */ jsx4(InformationCircleSolid, {}) }) }),
|
|
592
|
+
attr.is_required && /* @__PURE__ */ jsx4(Tooltip, { content: t("products.attributeRequiredByMarketplace"), children: /* @__PURE__ */ jsx4("span", { className: "text-ui-fg-muted flex items-center", children: /* @__PURE__ */ jsx4(InformationCircleSolid, {}) }) })
|
|
593
|
+
] }),
|
|
594
|
+
/* @__PURE__ */ jsx4(AttributeValue, { attribute: attr }),
|
|
595
|
+
/* @__PURE__ */ jsx4(AttributeActions, { productId, attribute: attr })
|
|
596
|
+
] })
|
|
597
|
+
},
|
|
598
|
+
attr.id
|
|
599
|
+
);
|
|
600
|
+
}) }) })
|
|
601
|
+
] });
|
|
602
|
+
};
|
|
603
|
+
var ProductAttributeSection = ({
|
|
604
|
+
product
|
|
605
|
+
}) => {
|
|
606
|
+
const { t } = useTranslation4();
|
|
607
|
+
const allAttributes = product.attributes ?? [];
|
|
608
|
+
const variantAttributes = allAttributes.filter((a) => a.is_variant_axis);
|
|
609
|
+
const infoAttributes = allAttributes.filter((a) => !a.is_variant_axis);
|
|
610
|
+
const isEmpty = !variantAttributes.length && !infoAttributes.length;
|
|
611
|
+
return /* @__PURE__ */ jsxs4(Container2, { className: "p-0", children: [
|
|
612
|
+
/* @__PURE__ */ jsxs4(
|
|
613
|
+
"div",
|
|
614
|
+
{
|
|
615
|
+
className: `flex items-center justify-between px-6 py-4${isEmpty ? "" : " border-b border-ui-border-base"}`,
|
|
616
|
+
children: [
|
|
617
|
+
/* @__PURE__ */ jsx4(Heading2, { level: "h2", children: t("products.attributes") }),
|
|
618
|
+
/* @__PURE__ */ jsx4(
|
|
619
|
+
ActionMenu,
|
|
620
|
+
{
|
|
621
|
+
groups: [
|
|
622
|
+
{
|
|
623
|
+
actions: [
|
|
624
|
+
{
|
|
625
|
+
label: t("products.create.attributes.addExisting"),
|
|
626
|
+
to: "attributes/add",
|
|
627
|
+
icon: /* @__PURE__ */ jsx4(Plus, {})
|
|
628
|
+
},
|
|
629
|
+
{
|
|
630
|
+
label: t("products.create.attributes.createNew"),
|
|
631
|
+
to: "attributes/create",
|
|
632
|
+
icon: /* @__PURE__ */ jsx4(PencilSquare, {})
|
|
633
|
+
}
|
|
634
|
+
]
|
|
635
|
+
}
|
|
636
|
+
]
|
|
637
|
+
}
|
|
638
|
+
)
|
|
639
|
+
]
|
|
640
|
+
}
|
|
641
|
+
),
|
|
642
|
+
variantAttributes.length > 0 && /* @__PURE__ */ jsx4(
|
|
643
|
+
AttributeGroup,
|
|
644
|
+
{
|
|
645
|
+
icon: /* @__PURE__ */ jsx4(Swatch, {}),
|
|
646
|
+
title: t("products.attributeVariations"),
|
|
647
|
+
description: t("products.attributeVariantsDescription"),
|
|
648
|
+
attributes: variantAttributes,
|
|
649
|
+
productId: product.id
|
|
650
|
+
}
|
|
651
|
+
),
|
|
652
|
+
variantAttributes.length > 0 && infoAttributes.length > 0 && /* @__PURE__ */ jsx4("div", { className: "border-t border-dashed border-ui-border-base" }),
|
|
653
|
+
infoAttributes.length > 0 && /* @__PURE__ */ jsx4(
|
|
654
|
+
AttributeGroup,
|
|
655
|
+
{
|
|
656
|
+
icon: /* @__PURE__ */ jsx4(DropCap, {}),
|
|
657
|
+
title: t("products.attributeProductInformation"),
|
|
658
|
+
description: t("products.attributeProductInformationDescription"),
|
|
659
|
+
attributes: infoAttributes,
|
|
660
|
+
productId: product.id
|
|
661
|
+
}
|
|
662
|
+
),
|
|
663
|
+
/* @__PURE__ */ jsx4(DisplayExtensionZone2, { model: "product", zone: "attributes", data: product })
|
|
664
|
+
] });
|
|
665
|
+
};
|
|
666
|
+
|
|
667
|
+
// src/pages/products/product-detail/components/product-general-section/product-general-section.tsx
|
|
668
|
+
import { PencilSquare as PencilSquare2, Trash as Trash2 } from "@medusajs/icons";
|
|
669
|
+
import { Container as Container3, Heading as Heading3, StatusBadge, usePrompt as usePrompt2 } from "@medusajs/ui";
|
|
670
|
+
import { useTranslation as useTranslation5 } from "react-i18next";
|
|
671
|
+
import { useNavigate } from "react-router-dom";
|
|
672
|
+
import { DisplayExtensionZone as DisplayExtensionZone3, DisplayField } from "@mercurjs/dashboard-shared";
|
|
673
|
+
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
674
|
+
var GENERAL_FIELD_IDS = [
|
|
675
|
+
"title",
|
|
676
|
+
"status",
|
|
677
|
+
"description",
|
|
678
|
+
"subtitle",
|
|
679
|
+
"handle",
|
|
680
|
+
"discountable"
|
|
681
|
+
];
|
|
682
|
+
var productStatusColor = (status) => {
|
|
683
|
+
switch (status) {
|
|
684
|
+
case "draft":
|
|
685
|
+
return "grey";
|
|
686
|
+
case "proposed":
|
|
687
|
+
return "orange";
|
|
688
|
+
case "published":
|
|
689
|
+
return "green";
|
|
690
|
+
case "rejected":
|
|
691
|
+
return "red";
|
|
692
|
+
default:
|
|
693
|
+
return "grey";
|
|
694
|
+
}
|
|
695
|
+
};
|
|
696
|
+
var ProductGeneralSection = ({
|
|
697
|
+
product
|
|
698
|
+
}) => {
|
|
699
|
+
const { t } = useTranslation5();
|
|
700
|
+
const prompt = usePrompt2();
|
|
701
|
+
const navigate = useNavigate();
|
|
702
|
+
const { mutateAsync } = useDeleteProduct(product.id);
|
|
703
|
+
const handleDelete = async () => {
|
|
704
|
+
const res = await prompt({
|
|
705
|
+
title: t("general.areYouSure"),
|
|
706
|
+
description: t("products.deleteWarning", {
|
|
707
|
+
title: product.title
|
|
708
|
+
}),
|
|
709
|
+
confirmText: t("actions.delete"),
|
|
710
|
+
cancelText: t("actions.cancel")
|
|
711
|
+
});
|
|
712
|
+
if (!res) {
|
|
713
|
+
return;
|
|
714
|
+
}
|
|
715
|
+
await mutateAsync(void 0, {
|
|
716
|
+
onSuccess: () => {
|
|
717
|
+
navigate("..");
|
|
718
|
+
}
|
|
719
|
+
});
|
|
720
|
+
};
|
|
721
|
+
return /* @__PURE__ */ jsxs5(Container3, { className: "divide-y p-0", "data-testid": "product-general-section", children: [
|
|
722
|
+
/* @__PURE__ */ jsxs5(
|
|
723
|
+
"div",
|
|
724
|
+
{
|
|
725
|
+
className: "flex items-center justify-between px-6 py-4",
|
|
726
|
+
"data-testid": "product-general-header",
|
|
727
|
+
children: [
|
|
728
|
+
/* @__PURE__ */ jsx5(DisplayField, { model: "product", zone: "general", id: "title", data: product, children: /* @__PURE__ */ jsx5(Heading3, { "data-testid": "product-general-title", children: product.title }) }),
|
|
729
|
+
/* @__PURE__ */ jsxs5(
|
|
730
|
+
"div",
|
|
731
|
+
{
|
|
732
|
+
className: "flex items-center gap-x-4",
|
|
733
|
+
"data-testid": "product-general-actions",
|
|
734
|
+
children: [
|
|
735
|
+
/* @__PURE__ */ jsx5(
|
|
736
|
+
DisplayField,
|
|
737
|
+
{
|
|
738
|
+
model: "product",
|
|
739
|
+
zone: "general",
|
|
740
|
+
id: "status",
|
|
741
|
+
data: product,
|
|
742
|
+
children: /* @__PURE__ */ jsx5(
|
|
743
|
+
StatusBadge,
|
|
744
|
+
{
|
|
745
|
+
color: productStatusColor(product.status),
|
|
746
|
+
"data-testid": "product-status-badge",
|
|
747
|
+
children: t(`products.productStatus.${product.status}`)
|
|
748
|
+
}
|
|
749
|
+
)
|
|
750
|
+
}
|
|
751
|
+
),
|
|
752
|
+
/* @__PURE__ */ jsx5(
|
|
753
|
+
ActionMenu,
|
|
754
|
+
{
|
|
755
|
+
groups: [
|
|
756
|
+
{
|
|
757
|
+
actions: [
|
|
758
|
+
{
|
|
759
|
+
label: t("actions.edit"),
|
|
760
|
+
to: "edit",
|
|
761
|
+
icon: /* @__PURE__ */ jsx5(PencilSquare2, {})
|
|
762
|
+
}
|
|
763
|
+
]
|
|
764
|
+
},
|
|
765
|
+
{
|
|
766
|
+
actions: [
|
|
767
|
+
{
|
|
768
|
+
label: t("actions.delete"),
|
|
769
|
+
onClick: handleDelete,
|
|
770
|
+
icon: /* @__PURE__ */ jsx5(Trash2, {})
|
|
771
|
+
}
|
|
772
|
+
]
|
|
773
|
+
}
|
|
774
|
+
],
|
|
775
|
+
"data-testid": "product-general-action-menu"
|
|
776
|
+
}
|
|
777
|
+
)
|
|
778
|
+
]
|
|
779
|
+
}
|
|
780
|
+
)
|
|
781
|
+
]
|
|
782
|
+
}
|
|
783
|
+
),
|
|
784
|
+
/* @__PURE__ */ jsx5(DisplayField, { model: "product", zone: "general", id: "description", data: product, children: /* @__PURE__ */ jsx5(
|
|
785
|
+
SectionRow,
|
|
786
|
+
{
|
|
787
|
+
title: t("fields.description"),
|
|
788
|
+
value: product.description,
|
|
789
|
+
"data-testid": "product-description-row"
|
|
790
|
+
}
|
|
791
|
+
) }),
|
|
792
|
+
/* @__PURE__ */ jsx5(DisplayField, { model: "product", zone: "general", id: "subtitle", data: product, children: /* @__PURE__ */ jsx5(
|
|
793
|
+
SectionRow,
|
|
794
|
+
{
|
|
795
|
+
title: t("fields.subtitle"),
|
|
796
|
+
value: product.subtitle,
|
|
797
|
+
"data-testid": "product-subtitle-row"
|
|
798
|
+
}
|
|
799
|
+
) }),
|
|
800
|
+
/* @__PURE__ */ jsx5(DisplayField, { model: "product", zone: "general", id: "handle", data: product, children: /* @__PURE__ */ jsx5(
|
|
801
|
+
SectionRow,
|
|
802
|
+
{
|
|
803
|
+
title: t("fields.handle"),
|
|
804
|
+
value: `/${product.handle}`,
|
|
805
|
+
"data-testid": "product-handle-row"
|
|
806
|
+
}
|
|
807
|
+
) }),
|
|
808
|
+
/* @__PURE__ */ jsx5(
|
|
809
|
+
DisplayField,
|
|
810
|
+
{
|
|
811
|
+
model: "product",
|
|
812
|
+
zone: "general",
|
|
813
|
+
id: "discountable",
|
|
814
|
+
data: product,
|
|
815
|
+
children: /* @__PURE__ */ jsx5(
|
|
816
|
+
SectionRow,
|
|
817
|
+
{
|
|
818
|
+
title: t("fields.discountable"),
|
|
819
|
+
value: product.discountable ? t("fields.true") : t("fields.false"),
|
|
820
|
+
"data-testid": "product-discountable-row"
|
|
821
|
+
}
|
|
822
|
+
)
|
|
823
|
+
}
|
|
824
|
+
),
|
|
825
|
+
/* @__PURE__ */ jsx5(
|
|
826
|
+
DisplayExtensionZone3,
|
|
827
|
+
{
|
|
828
|
+
model: "product",
|
|
829
|
+
zone: "general",
|
|
830
|
+
data: product,
|
|
831
|
+
builtInFieldIds: GENERAL_FIELD_IDS
|
|
832
|
+
}
|
|
833
|
+
)
|
|
834
|
+
] });
|
|
835
|
+
};
|
|
836
|
+
|
|
837
|
+
// src/pages/products/product-detail/components/product-organization-section/product-organization-section.tsx
|
|
838
|
+
import { PencilSquare as PencilSquare3 } from "@medusajs/icons";
|
|
839
|
+
import { Badge as Badge2, Container as Container4, Heading as Heading4, Tooltip as Tooltip2 } from "@medusajs/ui";
|
|
840
|
+
import { useTranslation as useTranslation6 } from "react-i18next";
|
|
841
|
+
import { Link } from "react-router-dom";
|
|
842
|
+
import { DisplayExtensionZone as DisplayExtensionZone4 } from "@mercurjs/dashboard-shared";
|
|
843
|
+
import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
844
|
+
var ProductOrganizationSection = ({
|
|
845
|
+
product
|
|
846
|
+
}) => {
|
|
847
|
+
const { t } = useTranslation6();
|
|
848
|
+
return /* @__PURE__ */ jsxs6(
|
|
849
|
+
Container4,
|
|
850
|
+
{
|
|
851
|
+
className: "divide-y p-0",
|
|
852
|
+
"data-testid": "product-organization-section",
|
|
853
|
+
children: [
|
|
854
|
+
/* @__PURE__ */ jsxs6(
|
|
855
|
+
"div",
|
|
856
|
+
{
|
|
857
|
+
className: "flex items-center justify-between px-6 py-4",
|
|
858
|
+
"data-testid": "product-organization-header",
|
|
859
|
+
children: [
|
|
860
|
+
/* @__PURE__ */ jsx6(Heading4, { level: "h2", "data-testid": "product-organization-title", children: t("products.organization.header") }),
|
|
861
|
+
/* @__PURE__ */ jsx6(
|
|
862
|
+
ActionMenu,
|
|
863
|
+
{
|
|
864
|
+
groups: [
|
|
865
|
+
{
|
|
866
|
+
actions: [
|
|
867
|
+
{
|
|
868
|
+
label: t("actions.edit"),
|
|
869
|
+
to: "organization",
|
|
870
|
+
icon: /* @__PURE__ */ jsx6(PencilSquare3, {})
|
|
871
|
+
}
|
|
872
|
+
]
|
|
873
|
+
}
|
|
874
|
+
],
|
|
875
|
+
"data-testid": "product-organization-action-menu"
|
|
876
|
+
}
|
|
877
|
+
)
|
|
878
|
+
]
|
|
879
|
+
}
|
|
880
|
+
),
|
|
881
|
+
/* @__PURE__ */ jsx6(
|
|
882
|
+
SectionRow,
|
|
883
|
+
{
|
|
884
|
+
title: t("fields.category"),
|
|
885
|
+
value: product.categories?.length ? product.categories.map((pcat) => /* @__PURE__ */ jsx6(
|
|
886
|
+
OrganizationTag,
|
|
887
|
+
{
|
|
888
|
+
label: pcat.name,
|
|
889
|
+
to: `/categories/${pcat.id}`
|
|
890
|
+
},
|
|
891
|
+
pcat.id
|
|
892
|
+
)) : void 0,
|
|
893
|
+
"data-testid": "product-categories-row"
|
|
894
|
+
}
|
|
895
|
+
),
|
|
896
|
+
/* @__PURE__ */ jsx6(
|
|
897
|
+
SectionRow,
|
|
898
|
+
{
|
|
899
|
+
title: t("fields.collection"),
|
|
900
|
+
value: product.collection ? /* @__PURE__ */ jsx6(
|
|
901
|
+
OrganizationTag,
|
|
902
|
+
{
|
|
903
|
+
label: product.collection.title,
|
|
904
|
+
to: `/collections/${product.collection.id}`
|
|
905
|
+
}
|
|
906
|
+
) : void 0,
|
|
907
|
+
"data-testid": "product-collection-row"
|
|
908
|
+
}
|
|
909
|
+
),
|
|
910
|
+
/* @__PURE__ */ jsx6(
|
|
911
|
+
SectionRow,
|
|
912
|
+
{
|
|
913
|
+
title: t("fields.tags"),
|
|
914
|
+
value: product.tags?.length ? product.tags.map((tag) => /* @__PURE__ */ jsx6(
|
|
915
|
+
OrganizationTag,
|
|
916
|
+
{
|
|
917
|
+
label: tag.value,
|
|
918
|
+
to: `/settings/product-tags/${tag.id}`
|
|
919
|
+
},
|
|
920
|
+
tag.id
|
|
921
|
+
)) : void 0,
|
|
922
|
+
"data-testid": "product-tags-row"
|
|
923
|
+
}
|
|
924
|
+
),
|
|
925
|
+
/* @__PURE__ */ jsx6(
|
|
926
|
+
SectionRow,
|
|
927
|
+
{
|
|
928
|
+
title: t("fields.type"),
|
|
929
|
+
value: product.type ? /* @__PURE__ */ jsx6(
|
|
930
|
+
OrganizationTag,
|
|
931
|
+
{
|
|
932
|
+
label: product.type.value,
|
|
933
|
+
to: `/settings/product-types/${product.type_id}`
|
|
934
|
+
}
|
|
935
|
+
) : void 0,
|
|
936
|
+
"data-testid": "product-type-row"
|
|
937
|
+
}
|
|
938
|
+
),
|
|
939
|
+
/* @__PURE__ */ jsx6(DisplayExtensionZone4, { model: "product", zone: "organize", data: product })
|
|
940
|
+
]
|
|
941
|
+
}
|
|
942
|
+
);
|
|
943
|
+
};
|
|
944
|
+
var OrganizationTag = ({ label, to }) => {
|
|
945
|
+
return /* @__PURE__ */ jsx6(Tooltip2, { content: label, children: /* @__PURE__ */ jsx6(Badge2, { size: "2xsmall", className: "block w-fit truncate", asChild: true, children: /* @__PURE__ */ jsx6(
|
|
946
|
+
Link,
|
|
947
|
+
{
|
|
948
|
+
to,
|
|
949
|
+
"data-testid": `organization-tag-${label.toLowerCase().replace(/\s+/g, "-")}`,
|
|
950
|
+
children: label
|
|
951
|
+
}
|
|
952
|
+
) }) });
|
|
953
|
+
};
|
|
954
|
+
|
|
955
|
+
// src/pages/products/product-detail/components/product-variant-section/product-variant-section.tsx
|
|
956
|
+
import { useCallback, useMemo } from "react";
|
|
957
|
+
import { PencilSquare as PencilSquare4, Trash as Trash3 } from "@medusajs/icons";
|
|
958
|
+
import { DisplayExtensionZone as DisplayExtensionZone5 } from "@mercurjs/dashboard-shared";
|
|
959
|
+
import {
|
|
960
|
+
Badge as Badge3,
|
|
961
|
+
Button as Button3,
|
|
962
|
+
Container as Container5,
|
|
963
|
+
Heading as Heading5,
|
|
964
|
+
toast as toast4,
|
|
965
|
+
Tooltip as Tooltip3,
|
|
966
|
+
usePrompt as usePrompt3
|
|
967
|
+
} from "@medusajs/ui";
|
|
968
|
+
import { keepPreviousData } from "@tanstack/react-query";
|
|
969
|
+
import { createColumnHelper } from "@tanstack/react-table";
|
|
970
|
+
import { useTranslation as useTranslation7 } from "react-i18next";
|
|
971
|
+
import { Link as Link2, useNavigate as useNavigate2, useSearchParams } from "react-router-dom";
|
|
972
|
+
import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
973
|
+
var PAGE_SIZE = 10;
|
|
974
|
+
var PREFIX = "pv";
|
|
975
|
+
var ProductVariantSection = ({
|
|
976
|
+
product
|
|
977
|
+
}) => {
|
|
978
|
+
const { t } = useTranslation7();
|
|
979
|
+
const { q, order, offset, created_at, updated_at } = useQueryParams(
|
|
980
|
+
["q", "order", "offset", "created_at", "updated_at"],
|
|
981
|
+
PREFIX
|
|
982
|
+
);
|
|
983
|
+
const { variants, count, isLoading, isError, error } = useProductVariants(
|
|
984
|
+
product.id,
|
|
985
|
+
{
|
|
986
|
+
q,
|
|
987
|
+
order: order ? order : "variant_rank",
|
|
988
|
+
offset: offset ? parseInt(offset) : void 0,
|
|
989
|
+
limit: PAGE_SIZE,
|
|
990
|
+
created_at: created_at ? JSON.parse(created_at) : void 0,
|
|
991
|
+
updated_at: updated_at ? JSON.parse(updated_at) : void 0,
|
|
992
|
+
fields: "title,sku,created_at,updated_at,*options,*options.option"
|
|
993
|
+
},
|
|
994
|
+
{
|
|
995
|
+
placeholderData: keepPreviousData
|
|
996
|
+
}
|
|
997
|
+
);
|
|
998
|
+
const columns = useColumns(product);
|
|
999
|
+
const filters = useFilters();
|
|
1000
|
+
const orderBy = useOrderBy();
|
|
1001
|
+
const { table } = useDataTable({
|
|
1002
|
+
data: variants ?? [],
|
|
1003
|
+
columns,
|
|
1004
|
+
count,
|
|
1005
|
+
pageSize: PAGE_SIZE,
|
|
1006
|
+
getRowId: (row) => row.id,
|
|
1007
|
+
prefix: PREFIX
|
|
1008
|
+
});
|
|
1009
|
+
if (isError) {
|
|
1010
|
+
throw error;
|
|
1011
|
+
}
|
|
1012
|
+
return /* @__PURE__ */ jsxs7(Container5, { className: "divide-y p-0", "data-testid": "product-variant-section", children: [
|
|
1013
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
1014
|
+
/* @__PURE__ */ jsx7(Heading5, { level: "h2", children: t("products.variants.header") }),
|
|
1015
|
+
/* @__PURE__ */ jsx7(
|
|
1016
|
+
Button3,
|
|
1017
|
+
{
|
|
1018
|
+
size: "small",
|
|
1019
|
+
variant: "secondary",
|
|
1020
|
+
asChild: true,
|
|
1021
|
+
"data-testid": "product-variants-create-button",
|
|
1022
|
+
children: /* @__PURE__ */ jsx7(Link2, { to: "variants/create", children: t("actions.create") })
|
|
1023
|
+
}
|
|
1024
|
+
)
|
|
1025
|
+
] }),
|
|
1026
|
+
/* @__PURE__ */ jsx7(
|
|
1027
|
+
_DataTable,
|
|
1028
|
+
{
|
|
1029
|
+
table,
|
|
1030
|
+
columns,
|
|
1031
|
+
count,
|
|
1032
|
+
pageSize: PAGE_SIZE,
|
|
1033
|
+
filters,
|
|
1034
|
+
search: true,
|
|
1035
|
+
pagination: true,
|
|
1036
|
+
isLoading,
|
|
1037
|
+
orderBy,
|
|
1038
|
+
prefix: PREFIX,
|
|
1039
|
+
queryObject: { q, order, created_at, updated_at },
|
|
1040
|
+
navigateTo: (row) => `variants/${row.original.id}`,
|
|
1041
|
+
noRecords: {
|
|
1042
|
+
title: t("products.variants.empty.heading"),
|
|
1043
|
+
message: t("products.variants.empty.description")
|
|
1044
|
+
}
|
|
1045
|
+
}
|
|
1046
|
+
),
|
|
1047
|
+
/* @__PURE__ */ jsx7(DisplayExtensionZone5, { model: "product", zone: "variants", data: product })
|
|
1048
|
+
] });
|
|
1049
|
+
};
|
|
1050
|
+
var columnHelper = createColumnHelper();
|
|
1051
|
+
var useColumns = (product) => {
|
|
1052
|
+
const { t } = useTranslation7();
|
|
1053
|
+
const navigate = useNavigate2();
|
|
1054
|
+
const { mutateAsync } = useDeleteVariantLazy(product.id);
|
|
1055
|
+
const prompt = usePrompt3();
|
|
1056
|
+
const [searchParams] = useSearchParams();
|
|
1057
|
+
const tableSearchParams = useMemo(() => {
|
|
1058
|
+
const filtered = new URLSearchParams();
|
|
1059
|
+
for (const [key, value] of searchParams.entries()) {
|
|
1060
|
+
if (key.startsWith(`${PREFIX}_`)) {
|
|
1061
|
+
filtered.append(key, value);
|
|
1062
|
+
}
|
|
1063
|
+
}
|
|
1064
|
+
return filtered;
|
|
1065
|
+
}, [searchParams]);
|
|
1066
|
+
const handleDelete = useCallback(
|
|
1067
|
+
async (id, title) => {
|
|
1068
|
+
const res = await prompt({
|
|
1069
|
+
title: t("general.areYouSure"),
|
|
1070
|
+
description: t("products.deleteVariantWarning", {
|
|
1071
|
+
title
|
|
1072
|
+
}),
|
|
1073
|
+
confirmText: t("actions.delete"),
|
|
1074
|
+
cancelText: t("actions.cancel")
|
|
1075
|
+
});
|
|
1076
|
+
if (!res) {
|
|
1077
|
+
return;
|
|
1078
|
+
}
|
|
1079
|
+
await mutateAsync(
|
|
1080
|
+
{ variantId: id },
|
|
1081
|
+
{
|
|
1082
|
+
onError: (error) => {
|
|
1083
|
+
toast4.error(error.message);
|
|
1084
|
+
}
|
|
1085
|
+
}
|
|
1086
|
+
);
|
|
1087
|
+
},
|
|
1088
|
+
[mutateAsync, prompt, t]
|
|
1089
|
+
);
|
|
1090
|
+
const attributeColumns = useMemo(() => {
|
|
1091
|
+
const variantAttributes = product?.attributes?.filter((attr) => attr.is_variant_axis);
|
|
1092
|
+
if (!variantAttributes?.length) {
|
|
1093
|
+
return [];
|
|
1094
|
+
}
|
|
1095
|
+
return variantAttributes.map((attribute) => {
|
|
1096
|
+
return columnHelper.display({
|
|
1097
|
+
id: `attribute-${attribute.id}`,
|
|
1098
|
+
header: attribute.name,
|
|
1099
|
+
cell: ({ row }) => {
|
|
1100
|
+
const variantOpt = row.original.options?.find(
|
|
1101
|
+
(opt) => opt.option?.title === attribute.name
|
|
1102
|
+
);
|
|
1103
|
+
if (!variantOpt?.value) {
|
|
1104
|
+
return /* @__PURE__ */ jsx7("span", { className: "text-ui-fg-muted", children: "-" });
|
|
1105
|
+
}
|
|
1106
|
+
return /* @__PURE__ */ jsx7(
|
|
1107
|
+
"div",
|
|
1108
|
+
{
|
|
1109
|
+
className: "flex flex-wrap items-center gap-1",
|
|
1110
|
+
"data-testid": `product-variant-attribute-${attribute.id}-${row.original.id}`,
|
|
1111
|
+
children: /* @__PURE__ */ jsx7(Tooltip3, { content: variantOpt.value, children: /* @__PURE__ */ jsx7(
|
|
1112
|
+
Badge3,
|
|
1113
|
+
{
|
|
1114
|
+
size: "2xsmall",
|
|
1115
|
+
title: variantOpt.value,
|
|
1116
|
+
className: "inline-flex min-w-[20px] max-w-[140px] items-center justify-center overflow-hidden truncate",
|
|
1117
|
+
"data-testid": `product-variant-attribute-badge-${attribute.id}-${row.original.id}-${variantOpt.value}`,
|
|
1118
|
+
children: variantOpt.value
|
|
1119
|
+
}
|
|
1120
|
+
) })
|
|
1121
|
+
}
|
|
1122
|
+
);
|
|
1123
|
+
}
|
|
1124
|
+
});
|
|
1125
|
+
});
|
|
1126
|
+
}, [product]);
|
|
1127
|
+
return useMemo(
|
|
1128
|
+
() => [
|
|
1129
|
+
columnHelper.accessor("title", {
|
|
1130
|
+
id: "title",
|
|
1131
|
+
header: t("fields.title"),
|
|
1132
|
+
cell: ({ getValue }) => {
|
|
1133
|
+
const value = getValue();
|
|
1134
|
+
return /* @__PURE__ */ jsxs7("div", { className: "flex h-full w-full max-w-[250px] items-center gap-x-3 overflow-hidden", children: [
|
|
1135
|
+
/* @__PURE__ */ jsx7("div", { className: "w-fit flex-shrink-0", children: /* @__PURE__ */ jsx7(Thumbnail, { src: product.thumbnail }) }),
|
|
1136
|
+
value ? /* @__PURE__ */ jsx7("span", { title: value, className: "truncate", children: value }) : /* @__PURE__ */ jsx7("span", { className: "text-ui-fg-muted", children: "-" })
|
|
1137
|
+
] });
|
|
1138
|
+
}
|
|
1139
|
+
}),
|
|
1140
|
+
columnHelper.accessor("sku", {
|
|
1141
|
+
id: "sku",
|
|
1142
|
+
header: t("fields.sku"),
|
|
1143
|
+
cell: ({ getValue }) => {
|
|
1144
|
+
const value = getValue();
|
|
1145
|
+
return value ? value : /* @__PURE__ */ jsx7("span", { className: "text-ui-fg-muted", children: "-" });
|
|
1146
|
+
}
|
|
1147
|
+
}),
|
|
1148
|
+
...attributeColumns,
|
|
1149
|
+
columnHelper.display({
|
|
1150
|
+
id: "actions",
|
|
1151
|
+
cell: ({ row }) => /* @__PURE__ */ jsx7(
|
|
1152
|
+
ActionMenu,
|
|
1153
|
+
{
|
|
1154
|
+
groups: [
|
|
1155
|
+
{
|
|
1156
|
+
actions: [
|
|
1157
|
+
{
|
|
1158
|
+
icon: /* @__PURE__ */ jsx7(PencilSquare4, {}),
|
|
1159
|
+
label: t("actions.edit"),
|
|
1160
|
+
onClick: () => navigate(
|
|
1161
|
+
`edit-variant?variant_id=${row.original.id}&${tableSearchParams.toString()}`,
|
|
1162
|
+
{
|
|
1163
|
+
state: {
|
|
1164
|
+
restore_params: tableSearchParams.toString()
|
|
1165
|
+
}
|
|
1166
|
+
}
|
|
1167
|
+
)
|
|
1168
|
+
}
|
|
1169
|
+
]
|
|
1170
|
+
},
|
|
1171
|
+
{
|
|
1172
|
+
actions: [
|
|
1173
|
+
{
|
|
1174
|
+
icon: /* @__PURE__ */ jsx7(Trash3, {}),
|
|
1175
|
+
label: t("actions.delete"),
|
|
1176
|
+
onClick: () => handleDelete(row.original.id, row.original.title ?? "")
|
|
1177
|
+
}
|
|
1178
|
+
]
|
|
1179
|
+
}
|
|
1180
|
+
]
|
|
1181
|
+
}
|
|
1182
|
+
)
|
|
1183
|
+
})
|
|
1184
|
+
],
|
|
1185
|
+
[t, attributeColumns, navigate, handleDelete, tableSearchParams, product]
|
|
1186
|
+
);
|
|
1187
|
+
};
|
|
1188
|
+
var useFilters = () => {
|
|
1189
|
+
const { t } = useTranslation7();
|
|
1190
|
+
return useMemo(
|
|
1191
|
+
() => [
|
|
1192
|
+
{ key: "created_at", label: t("fields.createdAt"), type: "date" },
|
|
1193
|
+
{ key: "updated_at", label: t("fields.updatedAt"), type: "date" }
|
|
1194
|
+
],
|
|
1195
|
+
[t]
|
|
1196
|
+
);
|
|
1197
|
+
};
|
|
1198
|
+
var useOrderBy = () => {
|
|
1199
|
+
const { t } = useTranslation7();
|
|
1200
|
+
return useMemo(
|
|
1201
|
+
() => [
|
|
1202
|
+
{ key: "title", label: t("fields.title") },
|
|
1203
|
+
{ key: "sku", label: t("fields.sku") }
|
|
1204
|
+
],
|
|
1205
|
+
[t]
|
|
1206
|
+
);
|
|
1207
|
+
};
|
|
1208
|
+
|
|
1209
|
+
// src/pages/products/product-detail/product-detail.tsx
|
|
1210
|
+
import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1211
|
+
var Root = ({ children }) => {
|
|
1212
|
+
const initialData = useLoaderData();
|
|
1213
|
+
const { id } = useParams();
|
|
1214
|
+
const query = useLinkQuery("product", PRODUCT_DETAIL_QUERY.fields);
|
|
1215
|
+
const {
|
|
1216
|
+
product: rawProduct,
|
|
1217
|
+
isLoading,
|
|
1218
|
+
isError,
|
|
1219
|
+
error
|
|
1220
|
+
} = useProduct(id, query, {
|
|
1221
|
+
initialData
|
|
1222
|
+
});
|
|
1223
|
+
const product = rawProduct;
|
|
1224
|
+
if (isLoading || !product) {
|
|
1225
|
+
return /* @__PURE__ */ jsx8(
|
|
1226
|
+
TwoColumnPageSkeleton,
|
|
1227
|
+
{
|
|
1228
|
+
mainSections: 4,
|
|
1229
|
+
sidebarSections: 3,
|
|
1230
|
+
showJSON: true,
|
|
1231
|
+
showMetadata: true
|
|
1232
|
+
}
|
|
1233
|
+
);
|
|
1234
|
+
}
|
|
1235
|
+
if (isError) {
|
|
1236
|
+
throw error;
|
|
1237
|
+
}
|
|
1238
|
+
return Children.count(children) > 0 ? /* @__PURE__ */ jsx8(
|
|
1239
|
+
TwoColumnPage,
|
|
1240
|
+
{
|
|
1241
|
+
data: product,
|
|
1242
|
+
showJSON: true,
|
|
1243
|
+
showMetadata: true,
|
|
1244
|
+
"data-testid": "product-detail-page",
|
|
1245
|
+
children
|
|
1246
|
+
}
|
|
1247
|
+
) : /* @__PURE__ */ jsxs8(
|
|
1248
|
+
TwoColumnPage,
|
|
1249
|
+
{
|
|
1250
|
+
data: product,
|
|
1251
|
+
showJSON: true,
|
|
1252
|
+
showMetadata: true,
|
|
1253
|
+
"data-testid": "product-detail-page",
|
|
1254
|
+
children: [
|
|
1255
|
+
/* @__PURE__ */ jsx8(TwoColumnPage.Main, { "data-testid": "product-detail-main", children: /* @__PURE__ */ jsxs8(WidgetZone, { id: "product.detail.main", data: product, children: [
|
|
1256
|
+
/* @__PURE__ */ jsx8(ProductActiveRequestSection, { product }),
|
|
1257
|
+
/* @__PURE__ */ jsx8(ProductActiveEditSection, { product }),
|
|
1258
|
+
/* @__PURE__ */ jsx8(ProductGeneralSection, { product }),
|
|
1259
|
+
/* @__PURE__ */ jsx8(ProductMediaSection, { product }),
|
|
1260
|
+
/* @__PURE__ */ jsx8(ProductVariantSection, { product })
|
|
1261
|
+
] }) }),
|
|
1262
|
+
/* @__PURE__ */ jsx8(TwoColumnPage.Sidebar, { "data-testid": "product-detail-sidebar", children: /* @__PURE__ */ jsxs8(WidgetZone, { id: "product.detail.side", data: product, children: [
|
|
1263
|
+
/* @__PURE__ */ jsx8(ProductOrganizationSection, { product }),
|
|
1264
|
+
/* @__PURE__ */ jsx8(ProductAttributeSection, { product })
|
|
1265
|
+
] }) })
|
|
1266
|
+
]
|
|
1267
|
+
}
|
|
1268
|
+
);
|
|
1269
|
+
};
|
|
1270
|
+
var ProductDetailPage = Object.assign(Root, {
|
|
1271
|
+
Main: TwoColumnPage.Main,
|
|
1272
|
+
Sidebar: TwoColumnPage.Sidebar,
|
|
1273
|
+
MainActiveRequestSection: ProductActiveRequestSection,
|
|
1274
|
+
MainActiveEditSection: ProductActiveEditSection,
|
|
1275
|
+
MainGeneralSection: ProductGeneralSection,
|
|
1276
|
+
MainMediaSection: ProductMediaSection,
|
|
1277
|
+
MainAttributeSection: ProductAttributeSection,
|
|
1278
|
+
MainVariantSection: ProductVariantSection,
|
|
1279
|
+
SidebarOrganizationSection: ProductOrganizationSection
|
|
1280
|
+
});
|
|
1281
|
+
|
|
1282
|
+
export {
|
|
1283
|
+
ProductDetailPage
|
|
1284
|
+
};
|