@mercurjs/vendor 2.2.0-canary.8 → 2.2.0-rc.0
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]-GMJAPZPU.js → [id]-3LNKC5OJ.js} +41 -40
- package/dist/[id]-4HO4S2PX.js +3074 -0
- package/dist/{[id]-QWL6SUOB.js → [id]-4LIIFGET.js} +14 -14
- package/dist/{[id]-5ADOHZ45.js → [id]-5EECCIRP.js} +151 -58
- package/dist/{[id]-K2CT7BXQ.js → [id]-5P5LTATX.js} +3 -3
- package/dist/{[id]-T7USGHIY.js → [id]-AQUUZFRX.js} +11 -11
- package/dist/{[id]-BTGQJ3UD.js → [id]-CUBGVODE.js} +177 -85
- package/dist/{[id]-ZAQYATGN.js → [id]-DCGPICT3.js} +39 -38
- package/dist/{[id]-IWCWVNVI.js → [id]-DT5YJVKG.js} +32 -32
- package/dist/{[id]-L6FD7BRE.js → [id]-IEBZ6V3W.js} +51 -48
- package/dist/{[id]-ZCMSBEVM.js → [id]-N7JEZFXQ.js} +6 -6
- package/dist/[id]-U6FKX5UQ.js +975 -0
- package/dist/{[id]-BPAZLOLW.js → [id]-XB45DY2D.js} +19 -19
- package/dist/[id]-XP5KEMNX.js +602 -0
- package/dist/{[location_id]-NUBXDDJC.js → [location_id]-I4HHUHWY.js} +14 -14
- package/dist/{[province_id]-5KZGMQER.js → [province_id]-OYX4MOCF.js} +31 -31
- package/dist/{add-KMHJ6OC6.js → add-3T4GBFMM.js} +63 -57
- package/dist/{add-Y6GMGLYX.js → add-RPRJWCYU.js} +99 -34
- package/dist/{add-customer-groups-NXSWICFI.js → add-customer-groups-FB5T6PQN.js} +44 -42
- package/dist/{add-products-LXYF57BK.js → add-products-F243SWGD.js} +40 -40
- package/dist/{add-promotions-VTYAEDCN.js → add-promotions-TJDK7HLW.js} +18 -18
- package/dist/{add-to-campaign-DLP7PSQB.js → add-to-campaign-Q6OAJMUJ.js} +6 -6
- package/dist/{address-JFXH3M7D.js → address-XVBSNMFU.js} +24 -24
- package/dist/{adjust-inventory-V2V7NWWH.js → adjust-inventory-IZLRMQXV.js} +4 -4
- package/dist/allocate-items-Q3VALDYT.js +685 -0
- package/dist/{areas-FB63OQAI.js → areas-IYGBRCRH.js} +14 -14
- package/dist/attributes-LGEM2JJW.js +353 -0
- package/dist/breadcrumb-BC6XN2SE.js +13 -0
- package/dist/{breadcrumb-THJ2HPRB.js → breadcrumb-BFNJWOJ4.js} +10 -9
- package/dist/{breadcrumb-S4V7MJUM.js → breadcrumb-BXD3SRM7.js} +3 -3
- package/dist/{breadcrumb-HV67K43U.js → breadcrumb-FEYGZFJU.js} +4 -4
- package/dist/{breadcrumb-EG3ANCVO.js → breadcrumb-H45Z2WNG.js} +3 -3
- package/dist/breadcrumb-ILEAQRW7.js +33 -0
- package/dist/breadcrumb-K4HBKZUE.js +28 -0
- package/dist/{breadcrumb-YBBYFQYG.js → breadcrumb-KZPOPXGG.js} +2 -2
- package/dist/{breadcrumb-F3BN5753.js → breadcrumb-L262VPBO.js} +2 -2
- package/dist/{breadcrumb-3Z7KZG62.js → breadcrumb-LEFHXFLT.js} +3 -3
- package/dist/{breadcrumb-D3UDTWGE.js → breadcrumb-MOA2DBOE.js} +2 -2
- package/dist/breadcrumb-NZYOCEEM.js +47 -0
- package/dist/breadcrumb-VY5DNTTJ.js +46 -0
- package/dist/{breadcrumb-UAUX7XCV.js → breadcrumb-WG6TIF4C.js} +2 -2
- package/dist/{breadcrumb-7R6E6G2X.js → breadcrumb-XEZCMI55.js} +2 -2
- package/dist/{breadcrumb-FES7EKUR.js → breadcrumb-XGXKCDYS.js} +4 -4
- package/dist/{breadcrumb-Y5UW3I4C.js → breadcrumb-YOY6Z36F.js} +2 -2
- package/dist/{campaigns-JAQTSA4Z.js → campaigns-DZKRNCA4.js} +9 -9
- package/dist/{categories-6TVMTN62.js → categories-JZJA2IBQ.js} +13 -11
- package/dist/{chunk-SFQKKIHA.js → chunk-27WLUOI2.js} +1 -1
- package/dist/{chunk-U5XDKYZG.js → chunk-2KA4TGBQ.js} +3 -3
- package/dist/{chunk-6RH3VDF7.js → chunk-2NPD4S55.js} +4 -4
- package/dist/{chunk-M6GKMFTC.js → chunk-3ALBZK4M.js} +1 -1
- package/dist/{chunk-PXYDR7WQ.js → chunk-3BXCPHN6.js} +3 -2
- package/dist/{chunk-X4INVIWL.js → chunk-3C2T27YW.js} +3 -3
- package/dist/{chunk-QXLRABYH.js → chunk-3I6ZAMGN.js} +1 -1
- package/dist/{chunk-THMXGEZU.js → chunk-3SH24DGG.js} +2 -2
- package/dist/chunk-3TST3EWQ.js +438 -0
- package/dist/chunk-42R54Z2X.js +8 -0
- package/dist/{chunk-UDJ2I5A2.js → chunk-4IRQSBA7.js} +5 -6
- package/dist/chunk-5ALC4Z2H.js +23 -0
- package/dist/chunk-5BQO3YQP.js +62 -0
- package/dist/{chunk-QGGMG3OU.js → chunk-5BYYDBLS.js} +7 -7
- package/dist/{chunk-4LVP635F.js → chunk-5FBQOAXU.js} +135 -126
- package/dist/{chunk-2BCAQ4BB.js → chunk-5PAUN3PM.js} +3 -3
- package/dist/{chunk-E2HQPY32.js → chunk-5RMLLTR7.js} +5 -5
- package/dist/{chunk-3EF54XFY.js → chunk-634XVU3D.js} +1 -1
- package/dist/{chunk-LJO34DKJ.js → chunk-6FDPVW7Y.js} +35 -21
- package/dist/{chunk-3X3LUKDM.js → chunk-6Q3J6ZMM.js} +5 -5
- package/dist/chunk-7BFQKYCJ.js +127 -0
- package/dist/chunk-7EXKHL5L.js +30 -0
- package/dist/{chunk-M6N4ISXL.js → chunk-7MARNXFG.js} +1 -1
- package/dist/{chunk-WHSE47DM.js → chunk-AOLE7MBM.js} +1 -1
- package/dist/{chunk-YIZK67RW.js → chunk-BQHVM46E.js} +29 -49
- package/dist/chunk-CRYZK4NU.js +185 -0
- package/dist/{chunk-JYPPXAJG.js → chunk-CUAGC54B.js} +33 -35
- package/dist/{chunk-KIFSQOM2.js → chunk-D76WZZSB.js} +5 -5
- package/dist/{chunk-QLBIBLOY.js → chunk-DQ7LZZJX.js} +5 -5
- package/dist/{chunk-UCYSCKZV.js → chunk-DSTHXHJ5.js} +2114 -1699
- package/dist/{chunk-L7QKFC5N.js → chunk-E6W57UP3.js} +32 -122
- package/dist/{chunk-UFFVRF4V.js → chunk-EAAZV3B7.js} +6 -11
- package/dist/chunk-EDV4MTTT.js +434 -0
- package/dist/chunk-EEBJYXWA.js +15 -0
- package/dist/{chunk-UORPTGV2.js → chunk-EPRYM3FA.js} +11 -15
- package/dist/{chunk-YQYRAD5C.js → chunk-FCZJAYMM.js} +1 -1
- package/dist/{chunk-JMRWREVE.js → chunk-FDKFUIYV.js} +23 -36
- package/dist/chunk-FWPGOIFA.js +22 -0
- package/dist/{chunk-B234IELY.js → chunk-G6YNCIVF.js} +24 -41
- package/dist/{chunk-PVZBDWLK.js → chunk-GRH7C3QN.js} +1 -1
- package/dist/chunk-GSH6ZGI6.js +353 -0
- package/dist/{chunk-IQWK723D.js → chunk-GZ4KTAWS.js} +1 -1
- package/dist/{chunk-MJCL3WID.js → chunk-H6LZ77GX.js} +1 -1
- package/dist/{chunk-WLT7K7K7.js → chunk-HDEOZN2Q.js} +21 -24
- package/dist/{chunk-FDR22JMM.js → chunk-HFRHHT36.js} +8 -63
- package/dist/{chunk-GNDFMMC6.js → chunk-IEVN722X.js} +1 -1
- package/dist/{chunk-DARJTN4I.js → chunk-IMJ62GAP.js} +10 -5
- package/dist/{chunk-SGR4DMCW.js → chunk-INYLPVCG.js} +3 -3
- package/dist/{chunk-5T6UWTRU.js → chunk-IV57G2CB.js} +19 -11
- package/dist/chunk-J6XCRFBW.js +30 -0
- package/dist/{chunk-BLRZB63H.js → chunk-JDNXS37G.js} +61 -62
- package/dist/{chunk-3B34B2M2.js → chunk-JJP6AKMV.js} +1 -1
- package/dist/{chunk-XEU5ZLSB.js → chunk-JK4M3ZKY.js} +5 -5
- package/dist/{chunk-VXMOPVRH.js → chunk-JR7AABT5.js} +2 -2
- package/dist/{chunk-PBD36EZJ.js → chunk-JTHDMXZV.js} +5 -5
- package/dist/{chunk-Q75AC3DZ.js → chunk-JY2XON7H.js} +2 -2
- package/dist/{chunk-6OUPJNYO.js → chunk-KCHYLLVG.js} +2 -2
- package/dist/{chunk-YGRTRAWX.js → chunk-KDE4HKH2.js} +1 -0
- package/dist/{chunk-VPKMBJ5B.js → chunk-KG2NUK4J.js} +6 -6
- package/dist/{chunk-VXWN37PT.js → chunk-KIURBTC4.js} +1 -1
- package/dist/{chunk-7LVNAFEI.js → chunk-KTJLJTFO.js} +547 -882
- package/dist/{chunk-FCJ7MLQK.js → chunk-KZQFIPY2.js} +264 -76
- package/dist/chunk-L57USMYC.js +39 -0
- package/dist/{chunk-4KNL46BT.js → chunk-LWFBBTJ3.js} +5 -5
- package/dist/{chunk-RIN4CBRB.js → chunk-LXZXXOJ3.js} +1 -17
- package/dist/chunk-LYYM7H7H.js +59 -0
- package/dist/{chunk-MWQQVKRU.js → chunk-MAVQ636Y.js} +1 -1
- package/dist/{chunk-VDHW6H5F.js → chunk-MAW6ZT3D.js} +4 -4
- package/dist/{chunk-7CMRFP5Q.js → chunk-MJP5V3JN.js} +3 -3
- package/dist/{chunk-S7EKBD2C.js → chunk-MNHP6YRC.js} +3 -3
- package/dist/{chunk-QZJIDKQR.js → chunk-MT6WOKIW.js} +4 -4
- package/dist/chunk-MUGQQY6P.js +315 -0
- package/dist/{chunk-QT7YFHCA.js → chunk-MVEHWM7K.js} +13 -1
- package/dist/{chunk-VV6IKGCN.js → chunk-NTJ3BMOE.js} +1 -1
- package/dist/{chunk-JXQJQYGD.js → chunk-O7BGGWW6.js} +2 -2
- package/dist/{chunk-LWJF63JW.js → chunk-OYUJYPDF.js} +90 -15
- package/dist/{chunk-4S6XGIC6.js → chunk-PUAWN7SS.js} +1 -1
- package/dist/{chunk-U6PBLMXD.js → chunk-Q6SPIHFR.js} +8 -3
- package/dist/{chunk-F4OJN2F2.js → chunk-QIF4QE7T.js} +1 -1
- package/dist/{chunk-X22KTLZ7.js → chunk-QWJTJSIT.js} +1 -1
- package/dist/{chunk-2USXZSTK.js → chunk-QWW6RHZC.js} +5 -5
- package/dist/{chunk-TODJFRLH.js → chunk-RILHLBKW.js} +3 -3
- package/dist/{chunk-PP754CO7.js → chunk-RPU4UOQK.js} +1 -1
- package/dist/{chunk-AVOZ7TX2.js → chunk-RTMMO6IU.js} +6 -6
- package/dist/chunk-S7NGDLZ3.js +173 -0
- package/dist/{chunk-U2ZFCAPX.js → chunk-SITRHMZZ.js} +11 -8
- package/dist/chunk-SPFLYPY6.js +6 -0
- package/dist/{chunk-EIUYXS7E.js → chunk-TJKZ5QCJ.js} +4 -4
- package/dist/{chunk-WCSQDWMS.js → chunk-TPGIMZLI.js} +1 -1
- package/dist/chunk-UM7ZR3VU.js +14 -0
- package/dist/{chunk-PGW3VYK4.js → chunk-UNE4VD5U.js} +3 -3
- package/dist/chunk-UX5UYDCY.js +33 -0
- package/dist/{chunk-IXAQNTE7.js → chunk-V5K6HISS.js} +2 -2
- package/dist/chunk-VCUUITW6.js +35 -0
- package/dist/{chunk-T5MJWWDX.js → chunk-VD27SL7H.js} +5 -5
- package/dist/{chunk-LRARA622.js → chunk-VE6GRIIN.js} +2 -2
- package/dist/{chunk-SSUUT5LK.js → chunk-W3UHAQCV.js} +5 -4
- package/dist/{chunk-U5G3AVED.js → chunk-WBCWER26.js} +1 -1
- package/dist/{chunk-PXI47JL5.js → chunk-WCXFUBEF.js} +13 -13
- package/dist/{chunk-AVOIZO63.js → chunk-WFE6CT6M.js} +77 -21
- package/dist/{chunk-E2L5EX5A.js → chunk-WFHGJGCW.js} +7 -6
- package/dist/{chunk-LQD232FW.js → chunk-WJ5EU3KW.js} +1 -1
- package/dist/{chunk-6YA3C4NB.js → chunk-XBKWFLJG.js} +4 -13
- package/dist/chunk-XQUF3WIS.js +159 -0
- package/dist/{chunk-SS46VQJA.js → chunk-Y4PM3IDZ.js} +1 -1
- package/dist/chunk-YBF45CX5.js +23 -0
- package/dist/{chunk-JQV7CXEC.js → chunk-YNGA3GRX.js} +17 -2
- package/dist/chunk-ZHFFTT3I.js +17 -0
- package/dist/{chunk-BOZJOOGW.js → chunk-ZLHCZ5F2.js} +1 -1
- package/dist/{chunk-LHKHQAAY.js → chunk-ZLYGEART.js} +1 -1
- package/dist/{chunk-NBPMNUKZ.js → chunk-ZQCCVCHB.js} +1 -1
- package/dist/{chunk-ADGVQVHP.js → chunk-ZTOYVPGA.js} +3 -3
- package/dist/collections-XIHCTMSJ.js +70 -0
- package/dist/{configuration-C4IGBNXH.js → configuration-3GCBMM27.js} +3 -3
- package/dist/{configuration-JI22M76Z.js → configuration-FWZTMYXY.js} +5 -5
- package/dist/{create-OXR7WG5F.js → create-2RGNAVVY.js} +32 -32
- package/dist/{create-5QLYFVEK.js → create-32MXB6FD.js} +24 -24
- package/dist/create-3AMFYYI6.js +245 -0
- package/dist/create-AMNH3WXL.js +75 -0
- package/dist/{create-UPYB65PD.js → create-BV3QDTK2.js} +4 -4
- package/dist/{create-POK6SJSZ.js → create-FHIFVCSG.js} +52 -49
- package/dist/{create-EATFT5AB.js → create-GO7APBBU.js} +31 -31
- package/dist/create-HEZYB7RF.js +1179 -0
- package/dist/{create-R7K3ECN6.js → create-K26SM34L.js} +3 -3
- package/dist/{create-6I43IPLO.js → create-N534JQPH.js} +14 -14
- package/dist/create-NEK6JCKR.js +1798 -0
- package/dist/{create-YBF4YGWG.js → create-NF2LPVXA.js} +3 -3
- package/dist/{create-F7IDSSTP.js → create-PJVLJ7T6.js} +50 -45
- package/dist/{create-CK4X357V.js → create-RPBHXU32.js} +28 -28
- package/dist/{create-SFU3W3ZH.js → create-U64NEOEL.js} +3 -3
- package/dist/create-VL7LDTVE.js +1931 -0
- package/dist/{create-XVHOCZHJ.js → create-X5SOAPD3.js} +3 -3
- package/dist/{create-2XZLOG5Z.js → create-XLYGW5PN.js} +69 -41
- package/dist/{create-GB3ZA4LH.js → create-YKYLCEAK.js} +6 -6
- package/dist/customer-group-add-customers-2C53NFBJ.js +251 -0
- package/dist/customer-group-create-75QQEQZF.js +147 -0
- package/dist/customer-group-detail-AOQYYAOG.js +58 -0
- package/dist/customer-group-edit-N77RCW6I.js +138 -0
- package/dist/customer-groups-GNFV7VMT.js +284 -0
- package/dist/{customers-SOLJ2KQQ.js → customers-HNINO6YL.js} +11 -11
- package/dist/{edit-TZ4EXLKJ.js → edit-3DUCWSLA.js} +62 -46
- package/dist/{edit-ORXS3A2Y.js → edit-3V34KJS2.js} +3 -3
- package/dist/{edit-RJ3EZ5CD.js → edit-4PWAJ7A3.js} +25 -25
- package/dist/{edit-ZQP4MNJU.js → edit-7CLOJ3UZ.js} +50 -47
- package/dist/{edit-ZAHCMF5U.js → edit-7SBPHN6P.js} +3 -3
- package/dist/edit-BSD6667Q.js +367 -0
- package/dist/{edit-Q3UQIOLS.js → edit-I2RJUPWV.js} +4 -4
- package/dist/{edit-UUP3BQV3.js → edit-IJ6DCBUU.js} +5 -5
- package/dist/{edit-ZMERG3L7.js → edit-JB7KVBOL.js} +5 -5
- package/dist/{edit-O4JLGKQR.js → edit-NHQJLCAK.js} +4 -4
- package/dist/edit-O65JD54W.js +103 -0
- package/dist/{edit-4OEBCCXJ.js → edit-SIKOSSHF.js} +24 -24
- package/dist/edit-TD7QFM4Z.js +871 -0
- package/dist/{edit-C4OCKQVU.js → edit-UNN3QTEJ.js} +3 -3
- package/dist/{edit-PFAJZUWI.js → edit-WEUFBORT.js} +33 -34
- package/dist/{edit-KAKVPHZZ.js → edit-WN2Q3TOX.js} +4 -4
- package/dist/{edit-QPPMI7MU.js → edit-ZGAOUZYP.js} +33 -34
- package/dist/{edit-522DG3BY.js → edit-ZOLSAIKF.js} +3 -3
- package/dist/{edit-2LGAEKH6.js → edit-ZORE6RUD.js} +25 -25
- package/dist/{edit-budget-L3CCEWNF.js → edit-budget-D22WMVYR.js} +3 -3
- package/dist/{edit-inventory-item-A7KAPATR.js → edit-inventory-item-QMYWEBZ3.js} +3 -3
- package/dist/{edit-inventory-item-attributes-RNBOJR66.js → edit-inventory-item-attributes-HLG6JR6S.js} +3 -3
- package/dist/edit-price-F7ZWM3FN.js +197 -0
- package/dist/edit-stock-ITAZNHPU.js +230 -0
- package/dist/fulfillment-U2GRQ6DD.js +641 -0
- package/dist/{fulfillment-providers-6WDXCGAI.js → fulfillment-providers-CMU2JB5X.js} +40 -40
- package/dist/index.css +120 -24
- package/dist/index.js +355 -235
- package/dist/{offer-inventory-batch-page-4QNXDUWN.js → inventory-4JKLAZ2Q.js} +20 -20
- package/dist/{inventory-IOVM7GDU.js → inventory-FKEXULLT.js} +10 -10
- package/dist/{invite-HRKSQI4B.js → invite-3R2CEWLN.js} +23 -23
- package/dist/{invite-UBH7PYSH.js → invite-MNAX6EUC.js} +39 -39
- package/dist/loader-HTPUNIOS.js +34 -0
- package/dist/loader-MAAMUP2Z.js +33 -0
- package/dist/{locations-INS6FTMJ.js → locations-2VWSMWHL.js} +3 -3
- package/dist/login-YUWOWICV.js +39 -0
- package/dist/{manage-locations-TIYOCOZU.js → manage-locations-RWGDXXJQ.js} +3 -3
- package/dist/{media-EXWUWWNB.js → media-P6WSFHY4.js} +31 -30
- package/dist/media-YB4G5CMV.js +316 -0
- package/dist/{metadata-JIMHXPKE.js → metadata-5Q6FLVX4.js} +27 -27
- package/dist/{metadata-T6MLCEZ2.js → metadata-6OYHLPLA.js} +25 -25
- package/dist/{metadata-JCNPERR3.js → metadata-ADXGD4Y6.js} +25 -25
- package/dist/{metadata-ITS3VPE3.js → metadata-J447GEBP.js} +27 -27
- package/dist/{metadata-YOQEXEGO.js → metadata-VTQ2CGZX.js} +27 -27
- package/dist/{offer-create-page-6YTTQAXZ.js → offer-create-page-ACPKTNHA.js} +245 -266
- package/dist/offer-detail-page-S4R4N5GL.js +584 -0
- package/dist/offer-variant-detail-page-XUMDXZUD.js +402 -0
- package/dist/offers-OTZJBW43.js +54 -0
- package/dist/{onboarding-GCRT6P6M.js → onboarding-TUGXFOA6.js} +23 -23
- package/dist/orders-PJSJNGZS.js +63 -0
- package/dist/{organization-5AFVFFZQ.js → organization-YIOAVFHN.js} +26 -26
- package/dist/{organize-QXDKGP2X.js → organize-BTA7NJD2.js} +4 -4
- package/dist/{organize-AZYAANZM.js → organize-OWT5QSJR.js} +4 -4
- package/dist/pages/index.d.ts +232 -232
- package/dist/pages/index.js +89 -87
- package/dist/{payment-details-ENUWDVGI.js → payment-details-K2XFATEL.js} +24 -24
- package/dist/{payouts-2QBQSNDR.js → payouts-K5IDTJV3.js} +11 -11
- package/dist/{price-lists-2WBNENE7.js → price-lists-DNPIPDAW.js} +13 -13
- package/dist/{offer-pricing-edit-page-WZNP3TWV.js → pricing-5VUPPNKS.js} +21 -19
- package/dist/{pricing-4Y73YJHP.js → pricing-J5FIDZIY.js} +32 -32
- package/dist/{product-tags-DE32PERU.js → product-tags-SJYIGXEV.js} +47 -44
- package/dist/{product-types-PKUEL7X5.js → product-types-4PTJW5DE.js} +10 -10
- package/dist/product-variant-detail-FO6J3RFA.js +371 -0
- package/dist/{product-variant-edit-ESLPI5ES.js → product-variant-edit-55TAIBZO.js} +45 -27
- package/dist/{products-WLGCX6Z7.js → products-EQMANSO6.js} +41 -40
- package/dist/products-XM57LXJK.js +92 -0
- package/dist/{professional-details-OCVQO2MV.js → professional-details-WWZPTXSX.js} +24 -24
- package/dist/{profile-2HW5NX6K.js → profile-5IADQ727.js} +30 -30
- package/dist/{promotions-FPV6QOEQ.js → promotions-BYW6TZ5B.js} +12 -12
- package/dist/receive-MTXKKPKZ.js +578 -0
- package/dist/refund-3IXGYA7W.js +268 -0
- package/dist/{register-PZOHGO7N.js → register-U5PQZATC.js} +25 -25
- package/dist/{reset-password-Q7BNWHHO.js → reset-password-SKUJJLSV.js} +3 -3
- package/dist/{return-reasons-J2WFZOQH.js → return-reasons-QDPSIJG3.js} +22 -19
- package/dist/{sales-channels-I3PR34U5.js → sales-channels-GBSTCWVP.js} +12 -13
- package/dist/{sales-channels-HPG2ND4W.js → sales-channels-N4NE3FXP.js} +14 -15
- package/dist/{settings-RZNYWACF.js → settings-ZUBBFS67.js} +54 -51
- package/dist/shipment-TKSCPC3M.js +241 -0
- package/dist/shipping-DODEUYOQ.js +125 -0
- package/dist/{shipping-profile-M3GGADFI.js → shipping-profile-O4JMJLN7.js} +5 -9
- package/dist/shipping-profiles-4TJ4IH6U.js +46 -0
- package/dist/{stock-3HVQ6FYP.js → stock-GYK2GHJN.js} +27 -27
- package/dist/{store-LDVMG7CV.js → store-XWOALZ5Q.js} +36 -36
- package/dist/{store-closure-EZ2YPOPL.js → store-closure-46B3XZ2I.js} +24 -24
- package/dist/{store-select-AM4AE7AL.js → store-select-E77E3ZY7.js} +24 -24
- package/dist/{tax-regions-HDLBFZVG.js → tax-regions-S2LFRTMP.js} +9 -9
- package/dist/{team-6NTDISM4.js → team-N2C5JPSU.js} +37 -37
- package/package.json +12 -12
- package/dist/[id]-MOOCGOWO.js +0 -480
- package/dist/[id]-UVQXCYXD.js +0 -1219
- package/dist/[id]-VUX4FUOO.js +0 -1557
- package/dist/allocate-items-OK5PVJGR.js +0 -533
- package/dist/attributes-TRAUBTCO.js +0 -278
- package/dist/breadcrumb-6FV7PWEN.js +0 -33
- package/dist/breadcrumb-EX4C3AZY.js +0 -47
- package/dist/breadcrumb-Q3XSG7B2.js +0 -46
- package/dist/chunk-27KRIXMQ.js +0 -71
- package/dist/chunk-432S4FGR.js +0 -0
- package/dist/chunk-BDZOSMAX.js +0 -23
- package/dist/chunk-CFRWIQIZ.js +0 -43
- package/dist/chunk-G7BL4L3L.js +0 -66
- package/dist/chunk-RXV7INUV.js +0 -426
- package/dist/chunk-T6LHVNWO.js +0 -27
- package/dist/collections-DS63FT2E.js +0 -68
- package/dist/create-HR4I33SE.js +0 -73
- package/dist/create-UFHLPXET.js +0 -215
- package/dist/edit-GQNIINRR.js +0 -192
- package/dist/fulfillment-OIIPL7B7.js +0 -559
- package/dist/loader-VDYPD3RI.js +0 -31
- package/dist/login-HON44E3S.js +0 -39
- package/dist/metadata-5BPOBBU2.js +0 -45
- package/dist/offer-detail-page-OMZN2NTA.js +0 -492
- package/dist/offer-edit-page-3MO566RP.js +0 -151
- package/dist/offers-GVN5LCK6.js +0 -32
- package/dist/orders-CHSS4ASB.js +0 -63
- package/dist/product-variant-detail-MWUBPCOP.js +0 -209
- package/dist/products-XOHAQHUJ.js +0 -91
- package/dist/shipment-KWUXQZWK.js +0 -176
- package/dist/shipping-profiles-L27STQ7K.js +0 -46
package/dist/[id]-VUX4FUOO.js
DELETED
|
@@ -1,1557 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
SectionRow
|
|
3
|
-
} from "./chunk-4TLP3TAA.js";
|
|
4
|
-
import {
|
|
5
|
-
useDataTableDateColumns,
|
|
6
|
-
useDataTableDateFilters
|
|
7
|
-
} from "./chunk-FDR22JMM.js";
|
|
8
|
-
import {
|
|
9
|
-
SidebarLink
|
|
10
|
-
} from "./chunk-4GPAS5GW.js";
|
|
11
|
-
import "./chunk-U2EI2ZLM.js";
|
|
12
|
-
import {
|
|
13
|
-
TwoColumnPage
|
|
14
|
-
} from "./chunk-YV6MK4PZ.js";
|
|
15
|
-
import "./chunk-LRD242C7.js";
|
|
16
|
-
import "./chunk-QHQWEERJ.js";
|
|
17
|
-
import "./chunk-432S4FGR.js";
|
|
18
|
-
import {
|
|
19
|
-
DataTable
|
|
20
|
-
} from "./chunk-5T6UWTRU.js";
|
|
21
|
-
import {
|
|
22
|
-
useQueryParams
|
|
23
|
-
} from "./chunk-THHRRYRS.js";
|
|
24
|
-
import {
|
|
25
|
-
require_dist
|
|
26
|
-
} from "./chunk-UCYSCKZV.js";
|
|
27
|
-
import {
|
|
28
|
-
Thumbnail
|
|
29
|
-
} from "./chunk-WIYFXWRI.js";
|
|
30
|
-
import {
|
|
31
|
-
TwoColumnPageSkeleton
|
|
32
|
-
} from "./chunk-INNFZYX2.js";
|
|
33
|
-
import {
|
|
34
|
-
useProductTag
|
|
35
|
-
} from "./chunk-YIZK67RW.js";
|
|
36
|
-
import "./chunk-F4OJN2F2.js";
|
|
37
|
-
import "./chunk-LRARA622.js";
|
|
38
|
-
import "./chunk-M6N4ISXL.js";
|
|
39
|
-
import "./chunk-S7EKBD2C.js";
|
|
40
|
-
import "./chunk-VXMOPVRH.js";
|
|
41
|
-
import {
|
|
42
|
-
useProductType
|
|
43
|
-
} from "./chunk-VV6IKGCN.js";
|
|
44
|
-
import "./chunk-2BCAQ4BB.js";
|
|
45
|
-
import "./chunk-BOZJOOGW.js";
|
|
46
|
-
import "./chunk-LWJF63JW.js";
|
|
47
|
-
import "./chunk-T6LHVNWO.js";
|
|
48
|
-
import "./chunk-4S6XGIC6.js";
|
|
49
|
-
import "./chunk-QT7YFHCA.js";
|
|
50
|
-
import "./chunk-IQWK723D.js";
|
|
51
|
-
import "./chunk-UORPTGV2.js";
|
|
52
|
-
import {
|
|
53
|
-
useCollection
|
|
54
|
-
} from "./chunk-JXQJQYGD.js";
|
|
55
|
-
import "./chunk-VXWN37PT.js";
|
|
56
|
-
import {
|
|
57
|
-
useProductCategory
|
|
58
|
-
} from "./chunk-THMXGEZU.js";
|
|
59
|
-
import "./chunk-NBPMNUKZ.js";
|
|
60
|
-
import "./chunk-LJO34DKJ.js";
|
|
61
|
-
import {
|
|
62
|
-
useSalesChannels
|
|
63
|
-
} from "./chunk-3B34B2M2.js";
|
|
64
|
-
import {
|
|
65
|
-
ActionMenu
|
|
66
|
-
} from "./chunk-BDGZ4EQO.js";
|
|
67
|
-
import "./chunk-LAVHRER2.js";
|
|
68
|
-
import "./chunk-Y7QKP6QU.js";
|
|
69
|
-
import {
|
|
70
|
-
PRODUCT_DETAIL_QUERY
|
|
71
|
-
} from "./chunk-U6PBLMXD.js";
|
|
72
|
-
import {
|
|
73
|
-
productAttributesQueryKeys,
|
|
74
|
-
productsQueryKeys,
|
|
75
|
-
useCancelProductEdit,
|
|
76
|
-
useDeleteProduct,
|
|
77
|
-
useDeleteVariantLazy,
|
|
78
|
-
useProduct,
|
|
79
|
-
useProductAttribute,
|
|
80
|
-
useProductChange,
|
|
81
|
-
useProductVariants,
|
|
82
|
-
useRemoveProductAttribute,
|
|
83
|
-
useUpdateProduct
|
|
84
|
-
} from "./chunk-B234IELY.js";
|
|
85
|
-
import "./chunk-A5DJIOHN.js";
|
|
86
|
-
import {
|
|
87
|
-
queryClient
|
|
88
|
-
} from "./chunk-RHKRREUU.js";
|
|
89
|
-
import "./chunk-ZA2KFUFR.js";
|
|
90
|
-
import {
|
|
91
|
-
sdk
|
|
92
|
-
} from "./chunk-RIN4CBRB.js";
|
|
93
|
-
import {
|
|
94
|
-
__toESM
|
|
95
|
-
} from "./chunk-NBMM2TZK.js";
|
|
96
|
-
|
|
97
|
-
// src/pages/products/[id]/loader.tsx
|
|
98
|
-
var productDetailQuery = (id) => ({
|
|
99
|
-
queryKey: productsQueryKeys.detail(id, PRODUCT_DETAIL_QUERY),
|
|
100
|
-
queryFn: async () => sdk.vendor.products.$id.query({
|
|
101
|
-
$id: id,
|
|
102
|
-
...PRODUCT_DETAIL_QUERY
|
|
103
|
-
})
|
|
104
|
-
});
|
|
105
|
-
var loader = async ({ params }) => {
|
|
106
|
-
const id = params.id;
|
|
107
|
-
const query = productDetailQuery(id);
|
|
108
|
-
const response = await queryClient.ensureQueryData({
|
|
109
|
-
...query,
|
|
110
|
-
staleTime: 9e4
|
|
111
|
-
});
|
|
112
|
-
return response;
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
// src/pages/products/[id]/product-detail-page.tsx
|
|
116
|
-
import { Children } from "react";
|
|
117
|
-
import { useLoaderData, useParams } from "react-router-dom";
|
|
118
|
-
|
|
119
|
-
// src/pages/products/[id]/_components/product-active-edit-section/product-active-edit-section.tsx
|
|
120
|
-
var import_types = __toESM(require_dist(), 1);
|
|
121
|
-
import { ExclamationCircleSolid } from "@medusajs/icons";
|
|
122
|
-
import { Button, Container, Heading, Text, toast, usePrompt } from "@medusajs/ui";
|
|
123
|
-
import {
|
|
124
|
-
describeProductChangeAction,
|
|
125
|
-
extractReferenceIds,
|
|
126
|
-
formatFieldValue,
|
|
127
|
-
humanizeFieldName,
|
|
128
|
-
isImageList,
|
|
129
|
-
isReferenceField,
|
|
130
|
-
partitionProductChangeActions
|
|
131
|
-
} from "@mercurjs/dashboard-shared";
|
|
132
|
-
import { useQueries } from "@tanstack/react-query";
|
|
133
|
-
import { Fragment, useMemo } from "react";
|
|
134
|
-
import { useTranslation } from "react-i18next";
|
|
135
|
-
import { Fragment as Fragment2, jsx, jsxs } from "react/jsx-runtime";
|
|
136
|
-
var ImageStrip = ({
|
|
137
|
-
images,
|
|
138
|
-
faded
|
|
139
|
-
}) => /* @__PURE__ */ jsx("div", { className: faded ? "flex items-center gap-1.5 opacity-50" : "flex items-center gap-1.5", children: images.map((image, idx) => /* @__PURE__ */ jsx(Thumbnail, { src: image.url, size: "base" }, `${image.url}-${idx}`)) });
|
|
140
|
-
var TypeName = ({ id }) => {
|
|
141
|
-
const { product_type } = useProductType(id);
|
|
142
|
-
return /* @__PURE__ */ jsx(Fragment2, { children: product_type?.value ?? id });
|
|
143
|
-
};
|
|
144
|
-
var CollectionName = ({ id }) => {
|
|
145
|
-
const { collection } = useCollection(id);
|
|
146
|
-
return /* @__PURE__ */ jsx(Fragment2, { children: collection?.title ?? id });
|
|
147
|
-
};
|
|
148
|
-
var CategoryName = ({ id }) => {
|
|
149
|
-
const { product_category } = useProductCategory(id);
|
|
150
|
-
return /* @__PURE__ */ jsx(Fragment2, { children: product_category?.name ?? id });
|
|
151
|
-
};
|
|
152
|
-
var TagName = ({ id }) => {
|
|
153
|
-
const { product_tag } = useProductTag(id);
|
|
154
|
-
return /* @__PURE__ */ jsx(Fragment2, { children: product_tag?.value ?? id });
|
|
155
|
-
};
|
|
156
|
-
var ReferenceName = ({
|
|
157
|
-
field,
|
|
158
|
-
id
|
|
159
|
-
}) => {
|
|
160
|
-
switch (field) {
|
|
161
|
-
case "type_id":
|
|
162
|
-
return /* @__PURE__ */ jsx(TypeName, { id });
|
|
163
|
-
case "collection_id":
|
|
164
|
-
return /* @__PURE__ */ jsx(CollectionName, { id });
|
|
165
|
-
case "categories":
|
|
166
|
-
return /* @__PURE__ */ jsx(CategoryName, { id });
|
|
167
|
-
case "tags":
|
|
168
|
-
return /* @__PURE__ */ jsx(TagName, { id });
|
|
169
|
-
}
|
|
170
|
-
};
|
|
171
|
-
var ReferenceList = ({
|
|
172
|
-
field,
|
|
173
|
-
ids
|
|
174
|
-
}) => {
|
|
175
|
-
if (!ids.length) return /* @__PURE__ */ jsx(Fragment2, { children: "-" });
|
|
176
|
-
return /* @__PURE__ */ jsx(Fragment2, { children: ids.map((id, idx) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
177
|
-
idx > 0 && ", ",
|
|
178
|
-
/* @__PURE__ */ jsx(ReferenceName, { field, id })
|
|
179
|
-
] }, `${field}-${id}`)) });
|
|
180
|
-
};
|
|
181
|
-
var FieldRow = ({ diff }) => {
|
|
182
|
-
const { t } = useTranslation();
|
|
183
|
-
const hasPrevious = diff.previous !== void 0 && diff.previous !== null && diff.previous !== "" && !(Array.isArray(diff.previous) && diff.previous.length === 0);
|
|
184
|
-
const nextIsImages = isImageList(diff.next);
|
|
185
|
-
const previousIsImages = isImageList(diff.previous);
|
|
186
|
-
const renderAsImages = nextIsImages || previousIsImages;
|
|
187
|
-
const renderAsReference = isReferenceField(diff.field);
|
|
188
|
-
return /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-4", children: [
|
|
189
|
-
/* @__PURE__ */ jsx(
|
|
190
|
-
Text,
|
|
191
|
-
{
|
|
192
|
-
size: "small",
|
|
193
|
-
weight: "plus",
|
|
194
|
-
leading: "compact",
|
|
195
|
-
className: "text-ui-fg-subtle w-[160px] shrink-0",
|
|
196
|
-
children: t(`fields.${diff.field}`, {
|
|
197
|
-
defaultValue: humanizeFieldName(diff.field)
|
|
198
|
-
})
|
|
199
|
-
}
|
|
200
|
-
),
|
|
201
|
-
renderAsImages ? /* @__PURE__ */ jsxs("div", { className: "flex flex-1 flex-wrap items-center gap-2", children: [
|
|
202
|
-
hasPrevious && previousIsImages && /* @__PURE__ */ jsx(ImageStrip, { images: diff.previous, faded: true }),
|
|
203
|
-
hasPrevious && /* @__PURE__ */ jsx(
|
|
204
|
-
Text,
|
|
205
|
-
{
|
|
206
|
-
size: "small",
|
|
207
|
-
leading: "compact",
|
|
208
|
-
className: "text-ui-fg-subtle",
|
|
209
|
-
children: "\u2192"
|
|
210
|
-
}
|
|
211
|
-
),
|
|
212
|
-
nextIsImages ? /* @__PURE__ */ jsx(ImageStrip, { images: diff.next }) : /* @__PURE__ */ jsx(
|
|
213
|
-
Text,
|
|
214
|
-
{
|
|
215
|
-
size: "small",
|
|
216
|
-
leading: "compact",
|
|
217
|
-
className: "text-ui-fg-subtle",
|
|
218
|
-
children: formatFieldValue(diff.next, diff.field)
|
|
219
|
-
}
|
|
220
|
-
)
|
|
221
|
-
] }) : renderAsReference ? /* @__PURE__ */ jsxs(
|
|
222
|
-
Text,
|
|
223
|
-
{
|
|
224
|
-
size: "small",
|
|
225
|
-
leading: "compact",
|
|
226
|
-
className: "text-ui-fg-subtle flex-1 whitespace-pre-line text-pretty",
|
|
227
|
-
children: [
|
|
228
|
-
hasPrevious && /* @__PURE__ */ jsx("span", { className: "line-through", children: /* @__PURE__ */ jsx(
|
|
229
|
-
ReferenceList,
|
|
230
|
-
{
|
|
231
|
-
field: diff.field,
|
|
232
|
-
ids: extractReferenceIds(
|
|
233
|
-
diff.field,
|
|
234
|
-
diff.previous
|
|
235
|
-
)
|
|
236
|
-
}
|
|
237
|
-
) }),
|
|
238
|
-
hasPrevious && " \u2192 ",
|
|
239
|
-
/* @__PURE__ */ jsx(
|
|
240
|
-
ReferenceList,
|
|
241
|
-
{
|
|
242
|
-
field: diff.field,
|
|
243
|
-
ids: extractReferenceIds(diff.field, diff.next)
|
|
244
|
-
}
|
|
245
|
-
)
|
|
246
|
-
]
|
|
247
|
-
}
|
|
248
|
-
) : /* @__PURE__ */ jsxs(
|
|
249
|
-
Text,
|
|
250
|
-
{
|
|
251
|
-
size: "small",
|
|
252
|
-
leading: "compact",
|
|
253
|
-
className: "text-ui-fg-subtle flex-1 whitespace-pre-line text-pretty",
|
|
254
|
-
children: [
|
|
255
|
-
hasPrevious && /* @__PURE__ */ jsx("span", { className: "line-through", children: formatFieldValue(diff.previous, diff.field) }),
|
|
256
|
-
hasPrevious && " \u2192 ",
|
|
257
|
-
formatFieldValue(diff.next, diff.field)
|
|
258
|
-
]
|
|
259
|
-
}
|
|
260
|
-
)
|
|
261
|
-
] });
|
|
262
|
-
};
|
|
263
|
-
var AttributeActionLine = ({
|
|
264
|
-
attributeId,
|
|
265
|
-
valueIds
|
|
266
|
-
}) => {
|
|
267
|
-
const { product_attribute } = useProductAttribute(attributeId);
|
|
268
|
-
const name = product_attribute?.name ?? attributeId;
|
|
269
|
-
const values = product_attribute?.values ?? [];
|
|
270
|
-
const selectedNames = valueIds && valueIds.length ? valueIds.map((id) => {
|
|
271
|
-
const match = values.find((v) => v.id === id);
|
|
272
|
-
return match?.name ?? id;
|
|
273
|
-
}) : [];
|
|
274
|
-
return /* @__PURE__ */ jsxs(Text, { size: "small", leading: "compact", className: "text-ui-fg-subtle", children: [
|
|
275
|
-
/* @__PURE__ */ jsx("span", { className: "font-medium text-ui-fg-base", children: name }),
|
|
276
|
-
selectedNames.length > 0 && `: ${selectedNames.join(", ")}`
|
|
277
|
-
] });
|
|
278
|
-
};
|
|
279
|
-
var VariantActionLine = ({
|
|
280
|
-
title,
|
|
281
|
-
images
|
|
282
|
-
}) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
283
|
-
images && images.length > 0 && /* @__PURE__ */ jsx(ImageStrip, { images }),
|
|
284
|
-
/* @__PURE__ */ jsx(Text, { size: "small", leading: "compact", className: "text-ui-fg-subtle", children: /* @__PURE__ */ jsx("span", { className: "font-medium text-ui-fg-base", children: title }) })
|
|
285
|
-
] });
|
|
286
|
-
var ActionLine = ({
|
|
287
|
-
action,
|
|
288
|
-
variantsById
|
|
289
|
-
}) => {
|
|
290
|
-
const { t } = useTranslation();
|
|
291
|
-
const details = action.details ?? {};
|
|
292
|
-
if (action.action === import_types.ProductChangeActionType.ATTRIBUTE_ADD || action.action === import_types.ProductChangeActionType.ATTRIBUTE_REMOVE) {
|
|
293
|
-
if (!details.attribute_id) return null;
|
|
294
|
-
return /* @__PURE__ */ jsx(
|
|
295
|
-
AttributeActionLine,
|
|
296
|
-
{
|
|
297
|
-
attributeId: details.attribute_id,
|
|
298
|
-
valueIds: action.action === import_types.ProductChangeActionType.ATTRIBUTE_ADD ? details.attribute_value_ids : void 0
|
|
299
|
-
}
|
|
300
|
-
);
|
|
301
|
-
}
|
|
302
|
-
const variantFallback = t("fields.variant", { defaultValue: "Variant" });
|
|
303
|
-
if (action.action === import_types.ProductChangeActionType.VARIANT_ADD) {
|
|
304
|
-
const title = details.variant?.title || details.variant?.sku || variantFallback;
|
|
305
|
-
return /* @__PURE__ */ jsx(VariantActionLine, { title });
|
|
306
|
-
}
|
|
307
|
-
if (action.action === import_types.ProductChangeActionType.VARIANT_REMOVE) {
|
|
308
|
-
const variantId = details.variant_id ?? "";
|
|
309
|
-
const found = variantId ? variantsById.get(variantId) : void 0;
|
|
310
|
-
const title = found?.title || found?.sku || variantId || variantFallback;
|
|
311
|
-
const images = isImageList(found?.images) ? found?.images : void 0;
|
|
312
|
-
return /* @__PURE__ */ jsx(VariantActionLine, { title, images });
|
|
313
|
-
}
|
|
314
|
-
const label = describeProductChangeAction(action, {
|
|
315
|
-
variant: variantFallback
|
|
316
|
-
});
|
|
317
|
-
return /* @__PURE__ */ jsx(Text, { size: "small", leading: "compact", className: "text-ui-fg-subtle", children: label });
|
|
318
|
-
};
|
|
319
|
-
var VariantUpdateBlock = ({
|
|
320
|
-
variantId,
|
|
321
|
-
diffs,
|
|
322
|
-
variantsById
|
|
323
|
-
}) => {
|
|
324
|
-
const { t } = useTranslation();
|
|
325
|
-
const found = variantsById.get(variantId);
|
|
326
|
-
const title = found?.title || found?.sku || variantId || t("fields.variant", { defaultValue: "Variant" });
|
|
327
|
-
const images = isImageList(found?.images) ? found?.images : void 0;
|
|
328
|
-
return /* @__PURE__ */ jsxs(
|
|
329
|
-
"div",
|
|
330
|
-
{
|
|
331
|
-
className: "flex flex-col gap-y-3",
|
|
332
|
-
"data-testid": `product-active-edit-variant-${variantId}`,
|
|
333
|
-
children: [
|
|
334
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
335
|
-
images && images.length > 0 && /* @__PURE__ */ jsx(ImageStrip, { images }),
|
|
336
|
-
/* @__PURE__ */ jsxs(Text, { size: "small", leading: "compact", className: "text-ui-fg-subtle", children: [
|
|
337
|
-
/* @__PURE__ */ jsx("span", { className: "font-medium text-ui-fg-base", children: t("products.edits.panel.variantUpdated", {
|
|
338
|
-
defaultValue: "Variant updated"
|
|
339
|
-
}) }),
|
|
340
|
-
": ",
|
|
341
|
-
title
|
|
342
|
-
] })
|
|
343
|
-
] }),
|
|
344
|
-
/* @__PURE__ */ jsx("div", { className: "flex flex-col gap-y-4 pl-1", children: diffs.map((diff, idx) => /* @__PURE__ */ jsx(FieldRow, { diff }, `${variantId}-${diff.field}-${idx}`)) })
|
|
345
|
-
]
|
|
346
|
-
}
|
|
347
|
-
);
|
|
348
|
-
};
|
|
349
|
-
var ProductActiveEditSection = ({
|
|
350
|
-
product
|
|
351
|
-
}) => {
|
|
352
|
-
const { t } = useTranslation();
|
|
353
|
-
const prompt = usePrompt();
|
|
354
|
-
const productId = product.id;
|
|
355
|
-
const variantsById = useMemo(() => {
|
|
356
|
-
const map = /* @__PURE__ */ new Map();
|
|
357
|
-
for (const variant of product.variants ?? []) {
|
|
358
|
-
if (variant?.id) map.set(variant.id, variant);
|
|
359
|
-
}
|
|
360
|
-
return map;
|
|
361
|
-
}, [product.variants]);
|
|
362
|
-
const { product_change, isError } = useProductChange(productId, {
|
|
363
|
-
retry: false
|
|
364
|
-
});
|
|
365
|
-
const { mutateAsync: cancelEdit, isPending: isCanceling } = useCancelProductEdit(productId);
|
|
366
|
-
const { updated, added, removed, deleteRequested } = useMemo(
|
|
367
|
-
() => partitionProductChangeActions(product_change?.actions ?? []),
|
|
368
|
-
[product_change]
|
|
369
|
-
);
|
|
370
|
-
const productUpdated = useMemo(
|
|
371
|
-
() => updated.filter((d) => !d.variant_id),
|
|
372
|
-
[updated]
|
|
373
|
-
);
|
|
374
|
-
const variantsUpdated = useMemo(() => {
|
|
375
|
-
const groups = /* @__PURE__ */ new Map();
|
|
376
|
-
for (const diff of updated) {
|
|
377
|
-
if (!diff.variant_id) continue;
|
|
378
|
-
const bucket = groups.get(diff.variant_id) ?? [];
|
|
379
|
-
bucket.push(diff);
|
|
380
|
-
groups.set(diff.variant_id, bucket);
|
|
381
|
-
}
|
|
382
|
-
return groups;
|
|
383
|
-
}, [updated]);
|
|
384
|
-
const attributeIds = useMemo(() => {
|
|
385
|
-
const ids = /* @__PURE__ */ new Set();
|
|
386
|
-
for (const action of [...added, ...removed]) {
|
|
387
|
-
if (action.action === import_types.ProductChangeActionType.ATTRIBUTE_ADD || action.action === import_types.ProductChangeActionType.ATTRIBUTE_REMOVE) {
|
|
388
|
-
const details = action.details ?? {};
|
|
389
|
-
if (details.attribute_id) ids.add(details.attribute_id);
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
return Array.from(ids);
|
|
393
|
-
}, [added, removed]);
|
|
394
|
-
const attributeQueries = useQueries({
|
|
395
|
-
queries: attributeIds.map((id) => ({
|
|
396
|
-
queryKey: productAttributesQueryKeys.detail(id),
|
|
397
|
-
queryFn: () => sdk.vendor.productAttributes.$id.query({ $id: id })
|
|
398
|
-
}))
|
|
399
|
-
});
|
|
400
|
-
const isLoadingAttributes = attributeQueries.some((q) => q.isPending);
|
|
401
|
-
const onCancel = async () => {
|
|
402
|
-
const confirmed = await prompt({
|
|
403
|
-
title: t("products.edits.panel.cancelTitle"),
|
|
404
|
-
description: t("products.edits.panel.cancelDescription"),
|
|
405
|
-
confirmText: t("actions.confirm"),
|
|
406
|
-
cancelText: t("actions.cancel")
|
|
407
|
-
});
|
|
408
|
-
if (!confirmed) return;
|
|
409
|
-
try {
|
|
410
|
-
await cancelEdit();
|
|
411
|
-
toast.success(t("products.edits.toast.canceledSuccessfully"));
|
|
412
|
-
} catch (e) {
|
|
413
|
-
toast.error(e.message);
|
|
414
|
-
}
|
|
415
|
-
};
|
|
416
|
-
if (isError || !product_change) {
|
|
417
|
-
return null;
|
|
418
|
-
}
|
|
419
|
-
if (product_change.status !== import_types.ProductChangeStatus.PENDING) {
|
|
420
|
-
return null;
|
|
421
|
-
}
|
|
422
|
-
if (isLoadingAttributes) {
|
|
423
|
-
return null;
|
|
424
|
-
}
|
|
425
|
-
const hasContent = productUpdated.length > 0 || variantsUpdated.size > 0 || added.length > 0 || removed.length > 0 || deleteRequested;
|
|
426
|
-
return /* @__PURE__ */ jsxs(
|
|
427
|
-
Container,
|
|
428
|
-
{
|
|
429
|
-
className: "divide-y p-0",
|
|
430
|
-
"data-testid": "product-active-edit-section",
|
|
431
|
-
children: [
|
|
432
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 px-6 py-4", children: [
|
|
433
|
-
/* @__PURE__ */ jsx(ExclamationCircleSolid, { className: "text-ui-fg-interactive" }),
|
|
434
|
-
/* @__PURE__ */ jsx(Heading, { level: "h2", "data-testid": "product-active-edit-heading", children: t("products.edits.panel.title") })
|
|
435
|
-
] }),
|
|
436
|
-
hasContent && /* @__PURE__ */ jsxs(Fragment2, { children: [
|
|
437
|
-
productUpdated.length > 0 && /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-4 px-6 py-4", children: [
|
|
438
|
-
/* @__PURE__ */ jsx(
|
|
439
|
-
Text,
|
|
440
|
-
{
|
|
441
|
-
size: "small",
|
|
442
|
-
weight: "plus",
|
|
443
|
-
leading: "compact",
|
|
444
|
-
className: "text-ui-fg-subtle w-[160px] shrink-0",
|
|
445
|
-
children: t("labels.updated")
|
|
446
|
-
}
|
|
447
|
-
),
|
|
448
|
-
/* @__PURE__ */ jsx("div", { className: "flex flex-1 flex-col gap-y-4", children: productUpdated.map((diff, idx) => /* @__PURE__ */ jsx(FieldRow, { diff }, `${diff.field}-${idx}`)) })
|
|
449
|
-
] }),
|
|
450
|
-
variantsUpdated.size > 0 && /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-4 px-6 py-4", children: [
|
|
451
|
-
/* @__PURE__ */ jsx(
|
|
452
|
-
Text,
|
|
453
|
-
{
|
|
454
|
-
size: "small",
|
|
455
|
-
weight: "plus",
|
|
456
|
-
leading: "compact",
|
|
457
|
-
className: "text-ui-fg-subtle w-[160px] shrink-0",
|
|
458
|
-
children: t("labels.updated")
|
|
459
|
-
}
|
|
460
|
-
),
|
|
461
|
-
/* @__PURE__ */ jsx("div", { className: "flex flex-1 flex-col gap-y-6", children: Array.from(variantsUpdated.entries()).map(
|
|
462
|
-
([variantId, diffs]) => /* @__PURE__ */ jsx(
|
|
463
|
-
VariantUpdateBlock,
|
|
464
|
-
{
|
|
465
|
-
variantId,
|
|
466
|
-
diffs,
|
|
467
|
-
variantsById
|
|
468
|
-
},
|
|
469
|
-
variantId
|
|
470
|
-
)
|
|
471
|
-
) })
|
|
472
|
-
] }),
|
|
473
|
-
added.length > 0 && /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-4 px-6 py-4", children: [
|
|
474
|
-
/* @__PURE__ */ jsx(
|
|
475
|
-
Text,
|
|
476
|
-
{
|
|
477
|
-
size: "small",
|
|
478
|
-
weight: "plus",
|
|
479
|
-
leading: "compact",
|
|
480
|
-
className: "text-ui-fg-subtle w-[160px] shrink-0",
|
|
481
|
-
children: t("labels.added")
|
|
482
|
-
}
|
|
483
|
-
),
|
|
484
|
-
/* @__PURE__ */ jsx("div", { className: "flex flex-1 flex-col gap-y-2", children: added.map((action) => /* @__PURE__ */ jsx(
|
|
485
|
-
ActionLine,
|
|
486
|
-
{
|
|
487
|
-
action,
|
|
488
|
-
variantsById
|
|
489
|
-
},
|
|
490
|
-
action.id
|
|
491
|
-
)) })
|
|
492
|
-
] }),
|
|
493
|
-
removed.length > 0 && /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-4 px-6 py-4", children: [
|
|
494
|
-
/* @__PURE__ */ jsx(
|
|
495
|
-
Text,
|
|
496
|
-
{
|
|
497
|
-
size: "small",
|
|
498
|
-
weight: "plus",
|
|
499
|
-
leading: "compact",
|
|
500
|
-
className: "text-ui-fg-subtle w-[160px] shrink-0",
|
|
501
|
-
children: t("labels.removed")
|
|
502
|
-
}
|
|
503
|
-
),
|
|
504
|
-
/* @__PURE__ */ jsx("div", { className: "flex flex-1 flex-col gap-y-2", children: removed.map((action) => /* @__PURE__ */ jsx(
|
|
505
|
-
ActionLine,
|
|
506
|
-
{
|
|
507
|
-
action,
|
|
508
|
-
variantsById
|
|
509
|
-
},
|
|
510
|
-
action.id
|
|
511
|
-
)) })
|
|
512
|
-
] }),
|
|
513
|
-
deleteRequested && /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-4 px-6 py-4", children: [
|
|
514
|
-
/* @__PURE__ */ jsx(
|
|
515
|
-
Text,
|
|
516
|
-
{
|
|
517
|
-
size: "small",
|
|
518
|
-
weight: "plus",
|
|
519
|
-
leading: "compact",
|
|
520
|
-
className: "text-ui-fg-subtle w-[160px] shrink-0",
|
|
521
|
-
children: t("labels.removed")
|
|
522
|
-
}
|
|
523
|
-
),
|
|
524
|
-
/* @__PURE__ */ jsx(
|
|
525
|
-
Text,
|
|
526
|
-
{
|
|
527
|
-
size: "small",
|
|
528
|
-
leading: "compact",
|
|
529
|
-
className: "text-ui-fg-subtle flex-1",
|
|
530
|
-
children: t("products.edits.panel.deleteRequested")
|
|
531
|
-
}
|
|
532
|
-
)
|
|
533
|
-
] })
|
|
534
|
-
] }),
|
|
535
|
-
/* @__PURE__ */ jsx(
|
|
536
|
-
"div",
|
|
537
|
-
{
|
|
538
|
-
className: "bg-ui-bg-subtle flex items-center justify-end gap-x-2 rounded-b-xl px-6 py-4",
|
|
539
|
-
"data-testid": "product-active-edit-actions",
|
|
540
|
-
children: /* @__PURE__ */ jsx(
|
|
541
|
-
Button,
|
|
542
|
-
{
|
|
543
|
-
size: "small",
|
|
544
|
-
variant: "secondary",
|
|
545
|
-
onClick: onCancel,
|
|
546
|
-
disabled: isCanceling,
|
|
547
|
-
isLoading: isCanceling,
|
|
548
|
-
"data-testid": "product-active-edit-cancel-button",
|
|
549
|
-
children: t("actions.cancel")
|
|
550
|
-
}
|
|
551
|
-
)
|
|
552
|
-
}
|
|
553
|
-
)
|
|
554
|
-
]
|
|
555
|
-
}
|
|
556
|
-
);
|
|
557
|
-
};
|
|
558
|
-
|
|
559
|
-
// src/pages/products/[id]/_components/product-general-section/product-general-section.tsx
|
|
560
|
-
import { PencilSquare, Trash } from "@medusajs/icons";
|
|
561
|
-
import { Container as Container2, Heading as Heading2, StatusBadge, usePrompt as usePrompt2 } from "@medusajs/ui";
|
|
562
|
-
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
563
|
-
import { useNavigate } from "react-router-dom";
|
|
564
|
-
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
565
|
-
var productStatusColor = (status) => {
|
|
566
|
-
switch (status) {
|
|
567
|
-
case "draft":
|
|
568
|
-
return "grey";
|
|
569
|
-
case "proposed":
|
|
570
|
-
return "orange";
|
|
571
|
-
case "published":
|
|
572
|
-
return "green";
|
|
573
|
-
case "rejected":
|
|
574
|
-
return "red";
|
|
575
|
-
default:
|
|
576
|
-
return "grey";
|
|
577
|
-
}
|
|
578
|
-
};
|
|
579
|
-
var ProductGeneralSection = ({
|
|
580
|
-
product
|
|
581
|
-
}) => {
|
|
582
|
-
const { t } = useTranslation2();
|
|
583
|
-
const prompt = usePrompt2();
|
|
584
|
-
const navigate = useNavigate();
|
|
585
|
-
const { mutateAsync } = useDeleteProduct(product.id);
|
|
586
|
-
const handleDelete = async () => {
|
|
587
|
-
const res = await prompt({
|
|
588
|
-
title: t("general.areYouSure"),
|
|
589
|
-
description: t("products.deleteWarning", {
|
|
590
|
-
title: product.title
|
|
591
|
-
}),
|
|
592
|
-
confirmText: t("actions.delete"),
|
|
593
|
-
cancelText: t("actions.cancel")
|
|
594
|
-
});
|
|
595
|
-
if (!res) {
|
|
596
|
-
return;
|
|
597
|
-
}
|
|
598
|
-
await mutateAsync(void 0, {
|
|
599
|
-
onSuccess: () => {
|
|
600
|
-
navigate("..");
|
|
601
|
-
}
|
|
602
|
-
});
|
|
603
|
-
};
|
|
604
|
-
return /* @__PURE__ */ jsxs2(Container2, { className: "divide-y p-0", children: [
|
|
605
|
-
/* @__PURE__ */ jsxs2("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
606
|
-
/* @__PURE__ */ jsx2(Heading2, { children: product.title }),
|
|
607
|
-
/* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-x-4", children: [
|
|
608
|
-
/* @__PURE__ */ jsx2(StatusBadge, { color: productStatusColor(product.status), children: t(`products.productStatus.${product.status}`) }),
|
|
609
|
-
/* @__PURE__ */ jsx2(
|
|
610
|
-
ActionMenu,
|
|
611
|
-
{
|
|
612
|
-
groups: [
|
|
613
|
-
{
|
|
614
|
-
actions: [
|
|
615
|
-
{
|
|
616
|
-
label: t("actions.edit"),
|
|
617
|
-
to: "edit",
|
|
618
|
-
icon: /* @__PURE__ */ jsx2(PencilSquare, {})
|
|
619
|
-
}
|
|
620
|
-
]
|
|
621
|
-
},
|
|
622
|
-
{
|
|
623
|
-
actions: [
|
|
624
|
-
{
|
|
625
|
-
label: t("actions.delete"),
|
|
626
|
-
onClick: handleDelete,
|
|
627
|
-
icon: /* @__PURE__ */ jsx2(Trash, {})
|
|
628
|
-
}
|
|
629
|
-
]
|
|
630
|
-
}
|
|
631
|
-
]
|
|
632
|
-
}
|
|
633
|
-
)
|
|
634
|
-
] })
|
|
635
|
-
] }),
|
|
636
|
-
/* @__PURE__ */ jsx2(
|
|
637
|
-
SectionRow,
|
|
638
|
-
{
|
|
639
|
-
title: t("fields.description"),
|
|
640
|
-
value: product.description || "-"
|
|
641
|
-
}
|
|
642
|
-
),
|
|
643
|
-
/* @__PURE__ */ jsx2(
|
|
644
|
-
SectionRow,
|
|
645
|
-
{
|
|
646
|
-
title: t("fields.subtitle"),
|
|
647
|
-
value: product.subtitle || "-"
|
|
648
|
-
}
|
|
649
|
-
),
|
|
650
|
-
/* @__PURE__ */ jsx2(SectionRow, { title: t("fields.handle"), value: `/${product.handle}` }),
|
|
651
|
-
/* @__PURE__ */ jsx2(
|
|
652
|
-
SectionRow,
|
|
653
|
-
{
|
|
654
|
-
title: t("fields.discountable"),
|
|
655
|
-
value: product.discountable ? t("general.true") : t("general.false")
|
|
656
|
-
}
|
|
657
|
-
)
|
|
658
|
-
] });
|
|
659
|
-
};
|
|
660
|
-
|
|
661
|
-
// src/pages/products/[id]/_components/product-media-section/product-media-section.tsx
|
|
662
|
-
import { useState } from "react";
|
|
663
|
-
import { PencilSquare as PencilSquare2, ThumbnailBadge } from "@medusajs/icons";
|
|
664
|
-
import {
|
|
665
|
-
Button as Button2,
|
|
666
|
-
Checkbox,
|
|
667
|
-
clx,
|
|
668
|
-
CommandBar,
|
|
669
|
-
Container as Container3,
|
|
670
|
-
Heading as Heading3,
|
|
671
|
-
Text as Text2,
|
|
672
|
-
Tooltip,
|
|
673
|
-
usePrompt as usePrompt3
|
|
674
|
-
} from "@medusajs/ui";
|
|
675
|
-
import { useTranslation as useTranslation3 } from "react-i18next";
|
|
676
|
-
import { Link } from "react-router-dom";
|
|
677
|
-
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
678
|
-
var ProductMediaSection = ({
|
|
679
|
-
product
|
|
680
|
-
}) => {
|
|
681
|
-
const { t } = useTranslation3();
|
|
682
|
-
const prompt = usePrompt3();
|
|
683
|
-
const [selection, setSelection] = useState({});
|
|
684
|
-
const media = getMedia(product);
|
|
685
|
-
const handleCheckedChange = (id) => {
|
|
686
|
-
setSelection((prev) => {
|
|
687
|
-
if (prev[id]) {
|
|
688
|
-
const { [id]: _, ...rest } = prev;
|
|
689
|
-
return rest;
|
|
690
|
-
} else {
|
|
691
|
-
return { ...prev, [id]: true };
|
|
692
|
-
}
|
|
693
|
-
});
|
|
694
|
-
};
|
|
695
|
-
const { mutateAsync } = useUpdateProduct(product.id);
|
|
696
|
-
const handleDelete = async () => {
|
|
697
|
-
const ids = Object.keys(selection);
|
|
698
|
-
const includingThumbnail = ids.some((id) => media.find((m) => m.id === id)?.isThumbnail);
|
|
699
|
-
const res = await prompt({
|
|
700
|
-
title: t("general.areYouSure"),
|
|
701
|
-
description: includingThumbnail ? t("products.media.deleteWarningWithThumbnail", {
|
|
702
|
-
count: ids.length
|
|
703
|
-
}) : t("products.media.deleteWarning", {
|
|
704
|
-
count: ids.length
|
|
705
|
-
}),
|
|
706
|
-
confirmText: t("actions.delete"),
|
|
707
|
-
cancelText: t("actions.cancel")
|
|
708
|
-
});
|
|
709
|
-
if (!res) {
|
|
710
|
-
return;
|
|
711
|
-
}
|
|
712
|
-
const mediaToKeep = product.images?.filter((i) => !ids.includes(i.id)).map((i) => ({ url: i.url }));
|
|
713
|
-
await mutateAsync(
|
|
714
|
-
{
|
|
715
|
-
images: mediaToKeep,
|
|
716
|
-
thumbnail: includingThumbnail ? "" : void 0
|
|
717
|
-
},
|
|
718
|
-
{
|
|
719
|
-
onSuccess: () => {
|
|
720
|
-
setSelection({});
|
|
721
|
-
}
|
|
722
|
-
}
|
|
723
|
-
);
|
|
724
|
-
};
|
|
725
|
-
return /* @__PURE__ */ jsxs3(Container3, { className: "divide-y p-0", children: [
|
|
726
|
-
/* @__PURE__ */ jsxs3("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
727
|
-
/* @__PURE__ */ jsx3(Heading3, { level: "h2", children: t("products.media.label") }),
|
|
728
|
-
/* @__PURE__ */ jsx3(
|
|
729
|
-
ActionMenu,
|
|
730
|
-
{
|
|
731
|
-
groups: [
|
|
732
|
-
{
|
|
733
|
-
actions: [
|
|
734
|
-
{
|
|
735
|
-
label: t("actions.edit"),
|
|
736
|
-
to: "media?view=edit",
|
|
737
|
-
icon: /* @__PURE__ */ jsx3(PencilSquare2, {})
|
|
738
|
-
}
|
|
739
|
-
]
|
|
740
|
-
}
|
|
741
|
-
]
|
|
742
|
-
}
|
|
743
|
-
)
|
|
744
|
-
] }),
|
|
745
|
-
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) => {
|
|
746
|
-
const isSelected = selection[i.id];
|
|
747
|
-
return /* @__PURE__ */ jsxs3(
|
|
748
|
-
"div",
|
|
749
|
-
{
|
|
750
|
-
className: "group relative aspect-square size-full cursor-pointer overflow-hidden rounded-[8px] shadow-elevation-card-rest transition-fg hover:shadow-elevation-card-hover",
|
|
751
|
-
children: [
|
|
752
|
-
/* @__PURE__ */ jsx3(
|
|
753
|
-
"div",
|
|
754
|
-
{
|
|
755
|
-
className: clx(
|
|
756
|
-
"invisible absolute right-2 top-2 opacity-0 transition-fg group-hover:visible group-hover:opacity-100",
|
|
757
|
-
{
|
|
758
|
-
"visible opacity-100": isSelected
|
|
759
|
-
}
|
|
760
|
-
),
|
|
761
|
-
children: /* @__PURE__ */ jsx3(
|
|
762
|
-
Checkbox,
|
|
763
|
-
{
|
|
764
|
-
checked: selection[i.id] || false,
|
|
765
|
-
onCheckedChange: () => handleCheckedChange(i.id)
|
|
766
|
-
}
|
|
767
|
-
)
|
|
768
|
-
}
|
|
769
|
-
),
|
|
770
|
-
i.isThumbnail && /* @__PURE__ */ jsx3("div", { className: "absolute left-2 top-2", children: /* @__PURE__ */ jsx3(Tooltip, { content: t("fields.thumbnail"), children: /* @__PURE__ */ jsx3(ThumbnailBadge, {}) }) }),
|
|
771
|
-
/* @__PURE__ */ jsx3(
|
|
772
|
-
Link,
|
|
773
|
-
{
|
|
774
|
-
to: `media`,
|
|
775
|
-
state: { curr: index },
|
|
776
|
-
children: /* @__PURE__ */ jsx3(
|
|
777
|
-
"img",
|
|
778
|
-
{
|
|
779
|
-
src: i.url,
|
|
780
|
-
alt: product.title,
|
|
781
|
-
className: "size-full object-cover"
|
|
782
|
-
}
|
|
783
|
-
)
|
|
784
|
-
}
|
|
785
|
-
)
|
|
786
|
-
]
|
|
787
|
-
},
|
|
788
|
-
i.id
|
|
789
|
-
);
|
|
790
|
-
}) }) : /* @__PURE__ */ jsxs3("div", { className: "flex flex-col items-center gap-y-4 pb-8 pt-6", children: [
|
|
791
|
-
/* @__PURE__ */ jsxs3("div", { className: "flex flex-col items-center", children: [
|
|
792
|
-
/* @__PURE__ */ jsx3(
|
|
793
|
-
Text2,
|
|
794
|
-
{
|
|
795
|
-
size: "small",
|
|
796
|
-
leading: "compact",
|
|
797
|
-
weight: "plus",
|
|
798
|
-
className: "text-ui-fg-subtle",
|
|
799
|
-
children: t("products.media.emptyState.header")
|
|
800
|
-
}
|
|
801
|
-
),
|
|
802
|
-
/* @__PURE__ */ jsx3(
|
|
803
|
-
Text2,
|
|
804
|
-
{
|
|
805
|
-
size: "small",
|
|
806
|
-
className: "text-ui-fg-muted",
|
|
807
|
-
children: t("products.media.emptyState.description")
|
|
808
|
-
}
|
|
809
|
-
)
|
|
810
|
-
] }),
|
|
811
|
-
/* @__PURE__ */ jsx3(
|
|
812
|
-
Button2,
|
|
813
|
-
{
|
|
814
|
-
size: "small",
|
|
815
|
-
variant: "secondary",
|
|
816
|
-
asChild: true,
|
|
817
|
-
children: /* @__PURE__ */ jsx3(Link, { to: "media?view=edit", children: t("products.media.emptyState.action") })
|
|
818
|
-
}
|
|
819
|
-
)
|
|
820
|
-
] }),
|
|
821
|
-
/* @__PURE__ */ jsx3(CommandBar, { open: !!Object.keys(selection).length, children: /* @__PURE__ */ jsxs3(CommandBar.Bar, { children: [
|
|
822
|
-
/* @__PURE__ */ jsx3(CommandBar.Value, { children: t("general.countSelected", {
|
|
823
|
-
count: Object.keys(selection).length
|
|
824
|
-
}) }),
|
|
825
|
-
/* @__PURE__ */ jsx3(CommandBar.Seperator, {}),
|
|
826
|
-
/* @__PURE__ */ jsx3(
|
|
827
|
-
CommandBar.Command,
|
|
828
|
-
{
|
|
829
|
-
action: handleDelete,
|
|
830
|
-
label: t("actions.delete"),
|
|
831
|
-
shortcut: "d"
|
|
832
|
-
}
|
|
833
|
-
)
|
|
834
|
-
] }) })
|
|
835
|
-
] });
|
|
836
|
-
};
|
|
837
|
-
var getMedia = (product) => {
|
|
838
|
-
const { images = [], thumbnail } = product;
|
|
839
|
-
const media = (images || []).map((image) => ({
|
|
840
|
-
id: image.id,
|
|
841
|
-
url: image.url,
|
|
842
|
-
isThumbnail: image.url === thumbnail
|
|
843
|
-
}));
|
|
844
|
-
if (thumbnail && !media.some((mediaItem) => mediaItem.url === thumbnail)) {
|
|
845
|
-
media.unshift({
|
|
846
|
-
id: "img_thumbnail",
|
|
847
|
-
url: thumbnail,
|
|
848
|
-
isThumbnail: true
|
|
849
|
-
});
|
|
850
|
-
}
|
|
851
|
-
return media;
|
|
852
|
-
};
|
|
853
|
-
|
|
854
|
-
// src/pages/products/[id]/_components/product-organization-section/product-organization-section.tsx
|
|
855
|
-
import { PencilSquare as PencilSquare3 } from "@medusajs/icons";
|
|
856
|
-
import { Badge, Container as Container4, Heading as Heading4, Tooltip as Tooltip2 } from "@medusajs/ui";
|
|
857
|
-
import { useTranslation as useTranslation4 } from "react-i18next";
|
|
858
|
-
import { Link as Link2 } from "react-router-dom";
|
|
859
|
-
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
860
|
-
var ProductOrganizationSection = ({
|
|
861
|
-
product
|
|
862
|
-
}) => {
|
|
863
|
-
const { t } = useTranslation4();
|
|
864
|
-
return /* @__PURE__ */ jsxs4(
|
|
865
|
-
Container4,
|
|
866
|
-
{
|
|
867
|
-
className: "divide-y p-0",
|
|
868
|
-
"data-testid": "product-organization-section",
|
|
869
|
-
children: [
|
|
870
|
-
/* @__PURE__ */ jsxs4(
|
|
871
|
-
"div",
|
|
872
|
-
{
|
|
873
|
-
className: "flex items-center justify-between px-6 py-4",
|
|
874
|
-
"data-testid": "product-organization-header",
|
|
875
|
-
children: [
|
|
876
|
-
/* @__PURE__ */ jsx4(Heading4, { level: "h2", "data-testid": "product-organization-title", children: t("products.organization.header") }),
|
|
877
|
-
/* @__PURE__ */ jsx4(
|
|
878
|
-
ActionMenu,
|
|
879
|
-
{
|
|
880
|
-
groups: [
|
|
881
|
-
{
|
|
882
|
-
actions: [
|
|
883
|
-
{
|
|
884
|
-
label: t("actions.edit"),
|
|
885
|
-
to: "organization",
|
|
886
|
-
icon: /* @__PURE__ */ jsx4(PencilSquare3, {})
|
|
887
|
-
}
|
|
888
|
-
]
|
|
889
|
-
}
|
|
890
|
-
],
|
|
891
|
-
"data-testid": "product-organization-action-menu"
|
|
892
|
-
}
|
|
893
|
-
)
|
|
894
|
-
]
|
|
895
|
-
}
|
|
896
|
-
),
|
|
897
|
-
/* @__PURE__ */ jsx4(
|
|
898
|
-
SectionRow,
|
|
899
|
-
{
|
|
900
|
-
title: t("fields.category"),
|
|
901
|
-
value: product.categories?.length ? product.categories.map((pcat) => /* @__PURE__ */ jsx4(
|
|
902
|
-
OrganizationTag,
|
|
903
|
-
{
|
|
904
|
-
label: pcat.name,
|
|
905
|
-
to: `/categories/${pcat.id}`
|
|
906
|
-
},
|
|
907
|
-
pcat.id
|
|
908
|
-
)) : void 0,
|
|
909
|
-
"data-testid": "product-categories-row"
|
|
910
|
-
}
|
|
911
|
-
),
|
|
912
|
-
/* @__PURE__ */ jsx4(
|
|
913
|
-
SectionRow,
|
|
914
|
-
{
|
|
915
|
-
title: t("fields.collection"),
|
|
916
|
-
value: product.collection ? /* @__PURE__ */ jsx4(
|
|
917
|
-
OrganizationTag,
|
|
918
|
-
{
|
|
919
|
-
label: product.collection.title,
|
|
920
|
-
to: `/collections/${product.collection.id}`
|
|
921
|
-
}
|
|
922
|
-
) : void 0,
|
|
923
|
-
"data-testid": "product-collection-row"
|
|
924
|
-
}
|
|
925
|
-
),
|
|
926
|
-
/* @__PURE__ */ jsx4(
|
|
927
|
-
SectionRow,
|
|
928
|
-
{
|
|
929
|
-
title: t("fields.tags"),
|
|
930
|
-
value: product.tags?.length ? product.tags.map((tag) => /* @__PURE__ */ jsx4(
|
|
931
|
-
OrganizationTag,
|
|
932
|
-
{
|
|
933
|
-
label: tag.value,
|
|
934
|
-
to: `/settings/product-tags/${tag.id}`
|
|
935
|
-
},
|
|
936
|
-
tag.id
|
|
937
|
-
)) : void 0,
|
|
938
|
-
"data-testid": "product-tags-row"
|
|
939
|
-
}
|
|
940
|
-
),
|
|
941
|
-
/* @__PURE__ */ jsx4(
|
|
942
|
-
SectionRow,
|
|
943
|
-
{
|
|
944
|
-
title: t("fields.type"),
|
|
945
|
-
value: product.type ? /* @__PURE__ */ jsx4(
|
|
946
|
-
OrganizationTag,
|
|
947
|
-
{
|
|
948
|
-
label: product.type.value,
|
|
949
|
-
to: `/settings/product-types/${product.type_id}`
|
|
950
|
-
}
|
|
951
|
-
) : void 0,
|
|
952
|
-
"data-testid": "product-type-row"
|
|
953
|
-
}
|
|
954
|
-
)
|
|
955
|
-
]
|
|
956
|
-
}
|
|
957
|
-
);
|
|
958
|
-
};
|
|
959
|
-
var OrganizationTag = ({ label, to }) => {
|
|
960
|
-
return /* @__PURE__ */ jsx4(Tooltip2, { content: label, children: /* @__PURE__ */ jsx4(Badge, { size: "2xsmall", className: "block w-fit truncate", asChild: true, children: /* @__PURE__ */ jsx4(
|
|
961
|
-
Link2,
|
|
962
|
-
{
|
|
963
|
-
to,
|
|
964
|
-
"data-testid": `organization-tag-${label.toLowerCase().replace(/\s+/g, "-")}`,
|
|
965
|
-
children: label
|
|
966
|
-
}
|
|
967
|
-
) }) });
|
|
968
|
-
};
|
|
969
|
-
|
|
970
|
-
// src/pages/products/[id]/_components/product-variant-section/product-variant-section.tsx
|
|
971
|
-
import { useCallback, useMemo as useMemo2 } from "react";
|
|
972
|
-
import { PencilSquare as PencilSquare4, Trash as Trash2 } from "@medusajs/icons";
|
|
973
|
-
import {
|
|
974
|
-
Badge as Badge2,
|
|
975
|
-
Button as Button3,
|
|
976
|
-
Container as Container5,
|
|
977
|
-
createDataTableColumnHelper,
|
|
978
|
-
Heading as Heading5,
|
|
979
|
-
toast as toast2,
|
|
980
|
-
Tooltip as Tooltip3,
|
|
981
|
-
usePrompt as usePrompt4
|
|
982
|
-
} from "@medusajs/ui";
|
|
983
|
-
import { keepPreviousData } from "@tanstack/react-query";
|
|
984
|
-
import { useTranslation as useTranslation5 } from "react-i18next";
|
|
985
|
-
import { Link as Link3, useNavigate as useNavigate2, useSearchParams } from "react-router-dom";
|
|
986
|
-
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
987
|
-
var PAGE_SIZE = 10;
|
|
988
|
-
var PREFIX = "pv";
|
|
989
|
-
var ProductVariantSection = ({
|
|
990
|
-
product
|
|
991
|
-
}) => {
|
|
992
|
-
const { t } = useTranslation5();
|
|
993
|
-
const { q, order, offset, created_at, updated_at } = useQueryParams(
|
|
994
|
-
["q", "order", "offset", "created_at", "updated_at"],
|
|
995
|
-
PREFIX
|
|
996
|
-
);
|
|
997
|
-
const columns = useColumns(product);
|
|
998
|
-
const filters = useFilters();
|
|
999
|
-
const { variants, count, isPending, isError, error } = useProductVariants(
|
|
1000
|
-
product.id,
|
|
1001
|
-
{
|
|
1002
|
-
q,
|
|
1003
|
-
order: order ? order : "variant_rank",
|
|
1004
|
-
offset: offset ? parseInt(offset) : void 0,
|
|
1005
|
-
limit: PAGE_SIZE,
|
|
1006
|
-
created_at: created_at ? JSON.parse(created_at) : void 0,
|
|
1007
|
-
updated_at: updated_at ? JSON.parse(updated_at) : void 0,
|
|
1008
|
-
fields: "title,sku,created_at,updated_at,*options,*options.option"
|
|
1009
|
-
},
|
|
1010
|
-
{
|
|
1011
|
-
placeholderData: keepPreviousData
|
|
1012
|
-
}
|
|
1013
|
-
);
|
|
1014
|
-
if (isError) {
|
|
1015
|
-
throw error;
|
|
1016
|
-
}
|
|
1017
|
-
return /* @__PURE__ */ jsxs5(Container5, { className: "divide-y p-0", "data-testid": "product-variant-section", children: [
|
|
1018
|
-
/* @__PURE__ */ jsxs5("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
1019
|
-
/* @__PURE__ */ jsx5(Heading5, { level: "h2", children: t("products.variants.header") }),
|
|
1020
|
-
/* @__PURE__ */ jsx5(
|
|
1021
|
-
Button3,
|
|
1022
|
-
{
|
|
1023
|
-
size: "small",
|
|
1024
|
-
variant: "secondary",
|
|
1025
|
-
asChild: true,
|
|
1026
|
-
"data-testid": "product-variants-create-button",
|
|
1027
|
-
children: /* @__PURE__ */ jsx5(Link3, { to: "variants/create", children: t("actions.create") })
|
|
1028
|
-
}
|
|
1029
|
-
)
|
|
1030
|
-
] }),
|
|
1031
|
-
/* @__PURE__ */ jsx5("div", { "data-testid": "product-variants-table-container", children: /* @__PURE__ */ jsx5(
|
|
1032
|
-
DataTable,
|
|
1033
|
-
{
|
|
1034
|
-
data: variants,
|
|
1035
|
-
columns,
|
|
1036
|
-
filters,
|
|
1037
|
-
rowCount: count,
|
|
1038
|
-
getRowId: (row) => row.id,
|
|
1039
|
-
rowHref: (row) => `/products/${product.id}/variants/${row.id}`,
|
|
1040
|
-
pageSize: PAGE_SIZE,
|
|
1041
|
-
isLoading: isPending,
|
|
1042
|
-
compact: true,
|
|
1043
|
-
emptyState: {
|
|
1044
|
-
empty: {
|
|
1045
|
-
heading: t("products.variants.empty.heading"),
|
|
1046
|
-
description: t("products.variants.empty.description")
|
|
1047
|
-
},
|
|
1048
|
-
filtered: {
|
|
1049
|
-
heading: t("products.variants.filtered.heading"),
|
|
1050
|
-
description: t("products.variants.filtered.description")
|
|
1051
|
-
}
|
|
1052
|
-
},
|
|
1053
|
-
prefix: PREFIX
|
|
1054
|
-
}
|
|
1055
|
-
) })
|
|
1056
|
-
] });
|
|
1057
|
-
};
|
|
1058
|
-
var columnHelper = createDataTableColumnHelper();
|
|
1059
|
-
var useColumns = (product) => {
|
|
1060
|
-
const { t } = useTranslation5();
|
|
1061
|
-
const navigate = useNavigate2();
|
|
1062
|
-
const { mutateAsync } = useDeleteVariantLazy(product.id);
|
|
1063
|
-
const prompt = usePrompt4();
|
|
1064
|
-
const [searchParams] = useSearchParams();
|
|
1065
|
-
const tableSearchParams = useMemo2(() => {
|
|
1066
|
-
const filtered = new URLSearchParams();
|
|
1067
|
-
for (const [key, value] of searchParams.entries()) {
|
|
1068
|
-
if (key.startsWith(`${PREFIX}_`)) {
|
|
1069
|
-
filtered.append(key, value);
|
|
1070
|
-
}
|
|
1071
|
-
}
|
|
1072
|
-
return filtered;
|
|
1073
|
-
}, [searchParams]);
|
|
1074
|
-
const dateColumns = useDataTableDateColumns();
|
|
1075
|
-
const handleDelete = useCallback(
|
|
1076
|
-
async (id, title) => {
|
|
1077
|
-
const res = await prompt({
|
|
1078
|
-
title: t("general.areYouSure"),
|
|
1079
|
-
description: t("products.deleteVariantWarning", {
|
|
1080
|
-
title
|
|
1081
|
-
}),
|
|
1082
|
-
confirmText: t("actions.delete"),
|
|
1083
|
-
cancelText: t("actions.cancel")
|
|
1084
|
-
});
|
|
1085
|
-
if (!res) {
|
|
1086
|
-
return;
|
|
1087
|
-
}
|
|
1088
|
-
await mutateAsync(
|
|
1089
|
-
{ variantId: id },
|
|
1090
|
-
{
|
|
1091
|
-
onError: (error) => {
|
|
1092
|
-
toast2.error(error.message);
|
|
1093
|
-
}
|
|
1094
|
-
}
|
|
1095
|
-
);
|
|
1096
|
-
},
|
|
1097
|
-
[mutateAsync, prompt, t]
|
|
1098
|
-
);
|
|
1099
|
-
const attributeColumns = useMemo2(() => {
|
|
1100
|
-
const variantAttributes = product?.attributes?.filter((attr) => attr.is_variant_axis);
|
|
1101
|
-
if (!variantAttributes?.length) {
|
|
1102
|
-
return [];
|
|
1103
|
-
}
|
|
1104
|
-
return variantAttributes.map((attribute) => {
|
|
1105
|
-
return columnHelper.display({
|
|
1106
|
-
id: `attribute-${attribute.id}`,
|
|
1107
|
-
header: attribute.name,
|
|
1108
|
-
cell: ({ row }) => {
|
|
1109
|
-
const variantOpt = row.original.options?.find(
|
|
1110
|
-
(opt) => opt.option?.title === attribute.name
|
|
1111
|
-
);
|
|
1112
|
-
if (!variantOpt?.value) {
|
|
1113
|
-
return /* @__PURE__ */ jsx5("span", { className: "text-ui-fg-muted", children: "-" });
|
|
1114
|
-
}
|
|
1115
|
-
return /* @__PURE__ */ jsx5(
|
|
1116
|
-
"div",
|
|
1117
|
-
{
|
|
1118
|
-
className: "flex flex-wrap items-center gap-1",
|
|
1119
|
-
"data-testid": `product-variant-attribute-${attribute.id}-${row.original.id}`,
|
|
1120
|
-
children: /* @__PURE__ */ jsx5(Tooltip3, { content: variantOpt.value, children: /* @__PURE__ */ jsx5(
|
|
1121
|
-
Badge2,
|
|
1122
|
-
{
|
|
1123
|
-
size: "2xsmall",
|
|
1124
|
-
title: variantOpt.value,
|
|
1125
|
-
className: "inline-flex min-w-[20px] max-w-[140px] items-center justify-center overflow-hidden truncate",
|
|
1126
|
-
"data-testid": `product-variant-attribute-badge-${attribute.id}-${row.original.id}-${variantOpt.value}`,
|
|
1127
|
-
children: variantOpt.value
|
|
1128
|
-
}
|
|
1129
|
-
) })
|
|
1130
|
-
}
|
|
1131
|
-
);
|
|
1132
|
-
}
|
|
1133
|
-
});
|
|
1134
|
-
});
|
|
1135
|
-
}, [product]);
|
|
1136
|
-
const getActions = useCallback(
|
|
1137
|
-
(_ctx) => {
|
|
1138
|
-
const variant = _ctx.row.original;
|
|
1139
|
-
const mainActions = [
|
|
1140
|
-
{
|
|
1141
|
-
icon: /* @__PURE__ */ jsx5(PencilSquare4, {}),
|
|
1142
|
-
label: t("actions.edit"),
|
|
1143
|
-
onClick: (row) => {
|
|
1144
|
-
navigate(
|
|
1145
|
-
`edit-variant?variant_id=${row.row.original.id}&${tableSearchParams.toString()}`,
|
|
1146
|
-
{
|
|
1147
|
-
state: {
|
|
1148
|
-
restore_params: tableSearchParams.toString()
|
|
1149
|
-
}
|
|
1150
|
-
}
|
|
1151
|
-
);
|
|
1152
|
-
}
|
|
1153
|
-
}
|
|
1154
|
-
];
|
|
1155
|
-
const secondaryActions = [
|
|
1156
|
-
{
|
|
1157
|
-
icon: /* @__PURE__ */ jsx5(Trash2, {}),
|
|
1158
|
-
label: t("actions.delete"),
|
|
1159
|
-
onClick: () => handleDelete(variant.id, variant.title)
|
|
1160
|
-
}
|
|
1161
|
-
];
|
|
1162
|
-
return [mainActions, secondaryActions];
|
|
1163
|
-
},
|
|
1164
|
-
[handleDelete, navigate, t, tableSearchParams]
|
|
1165
|
-
);
|
|
1166
|
-
return useMemo2(() => {
|
|
1167
|
-
return [
|
|
1168
|
-
columnHelper.accessor("title", {
|
|
1169
|
-
header: t("fields.title"),
|
|
1170
|
-
enableSorting: true,
|
|
1171
|
-
sortAscLabel: t("filters.sorting.alphabeticallyAsc"),
|
|
1172
|
-
sortDescLabel: t("filters.sorting.alphabeticallyDesc")
|
|
1173
|
-
}),
|
|
1174
|
-
columnHelper.accessor("sku", {
|
|
1175
|
-
header: t("fields.sku"),
|
|
1176
|
-
cell: ({ getValue }) => {
|
|
1177
|
-
const value = getValue();
|
|
1178
|
-
return value ? value : /* @__PURE__ */ jsx5("span", { className: "text-ui-fg-muted", children: "-" });
|
|
1179
|
-
}
|
|
1180
|
-
}),
|
|
1181
|
-
...attributeColumns,
|
|
1182
|
-
...dateColumns,
|
|
1183
|
-
columnHelper.action({
|
|
1184
|
-
actions: getActions
|
|
1185
|
-
})
|
|
1186
|
-
];
|
|
1187
|
-
}, [t, attributeColumns, dateColumns, getActions]);
|
|
1188
|
-
};
|
|
1189
|
-
var useFilters = () => {
|
|
1190
|
-
const dateFilters = useDataTableDateFilters();
|
|
1191
|
-
return useMemo2(() => {
|
|
1192
|
-
return [...dateFilters];
|
|
1193
|
-
}, [dateFilters]);
|
|
1194
|
-
};
|
|
1195
|
-
|
|
1196
|
-
// src/pages/products/[id]/_components/product-attribute-section/product-attribute-section.tsx
|
|
1197
|
-
import {
|
|
1198
|
-
ListBullet,
|
|
1199
|
-
Plus,
|
|
1200
|
-
Trash as Trash3,
|
|
1201
|
-
Swatch,
|
|
1202
|
-
DropCap,
|
|
1203
|
-
InformationCircleSolid
|
|
1204
|
-
} from "@medusajs/icons";
|
|
1205
|
-
import {
|
|
1206
|
-
Badge as Badge3,
|
|
1207
|
-
Container as Container6,
|
|
1208
|
-
Heading as Heading6,
|
|
1209
|
-
Text as Text3,
|
|
1210
|
-
toast as toast3,
|
|
1211
|
-
Tooltip as Tooltip4,
|
|
1212
|
-
usePrompt as usePrompt5
|
|
1213
|
-
} from "@medusajs/ui";
|
|
1214
|
-
import { useTranslation as useTranslation6 } from "react-i18next";
|
|
1215
|
-
import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1216
|
-
var AttributeActions = ({
|
|
1217
|
-
productId,
|
|
1218
|
-
attribute
|
|
1219
|
-
}) => {
|
|
1220
|
-
const { t } = useTranslation6();
|
|
1221
|
-
const prompt = usePrompt5();
|
|
1222
|
-
const { mutateAsync } = useRemoveProductAttribute(productId, attribute.id);
|
|
1223
|
-
const handleDelete = async () => {
|
|
1224
|
-
const res = await prompt({
|
|
1225
|
-
title: t("general.areYouSure"),
|
|
1226
|
-
description: t("products.deleteAttributeWarning", {
|
|
1227
|
-
title: attribute.name
|
|
1228
|
-
}),
|
|
1229
|
-
confirmText: t("actions.delete"),
|
|
1230
|
-
cancelText: t("actions.cancel")
|
|
1231
|
-
});
|
|
1232
|
-
if (!res) {
|
|
1233
|
-
return;
|
|
1234
|
-
}
|
|
1235
|
-
await mutateAsync(void 0, {
|
|
1236
|
-
onError: (error) => {
|
|
1237
|
-
toast3.error(error.message);
|
|
1238
|
-
}
|
|
1239
|
-
});
|
|
1240
|
-
};
|
|
1241
|
-
return /* @__PURE__ */ jsx6(
|
|
1242
|
-
ActionMenu,
|
|
1243
|
-
{
|
|
1244
|
-
groups: [
|
|
1245
|
-
{
|
|
1246
|
-
actions: [
|
|
1247
|
-
{
|
|
1248
|
-
label: t("actions.delete"),
|
|
1249
|
-
onClick: handleDelete,
|
|
1250
|
-
icon: /* @__PURE__ */ jsx6(Trash3, {})
|
|
1251
|
-
}
|
|
1252
|
-
]
|
|
1253
|
-
}
|
|
1254
|
-
]
|
|
1255
|
-
}
|
|
1256
|
-
);
|
|
1257
|
-
};
|
|
1258
|
-
var AttributeGroup = ({
|
|
1259
|
-
icon,
|
|
1260
|
-
title,
|
|
1261
|
-
description,
|
|
1262
|
-
attributes,
|
|
1263
|
-
productId
|
|
1264
|
-
}) => {
|
|
1265
|
-
const { t } = useTranslation6();
|
|
1266
|
-
if (!attributes.length) {
|
|
1267
|
-
return null;
|
|
1268
|
-
}
|
|
1269
|
-
return /* @__PURE__ */ jsxs6("div", { className: "flex flex-col gap-y-4 px-3 py-4", children: [
|
|
1270
|
-
/* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-x-3 px-3", children: [
|
|
1271
|
-
/* @__PURE__ */ jsx6("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 }),
|
|
1272
|
-
/* @__PURE__ */ jsxs6("div", { children: [
|
|
1273
|
-
/* @__PURE__ */ jsx6(Text3, { size: "small", weight: "plus", leading: "compact", children: title }),
|
|
1274
|
-
/* @__PURE__ */ jsx6(Text3, { size: "small", leading: "compact", className: "text-ui-fg-subtle", children: description })
|
|
1275
|
-
] })
|
|
1276
|
-
] }),
|
|
1277
|
-
/* @__PURE__ */ jsx6("div", { className: "flex flex-col gap-y-0", children: /* @__PURE__ */ jsx6("div", { className: "overflow-hidden rounded-xl border border-ui-border-base", children: attributes.map((attr, index) => {
|
|
1278
|
-
const values = attr.values?.map((v) => v.name) ?? [];
|
|
1279
|
-
return /* @__PURE__ */ jsx6(
|
|
1280
|
-
"div",
|
|
1281
|
-
{
|
|
1282
|
-
className: index < attributes.length - 1 ? "border-b border-ui-border-base" : "",
|
|
1283
|
-
children: /* @__PURE__ */ jsxs6("div", { className: "grid grid-cols-[1fr_1fr_28px] items-center gap-4 bg-ui-bg-component px-4 py-3", children: [
|
|
1284
|
-
/* @__PURE__ */ jsxs6("div", { className: "text-ui-fg-subtle flex items-center gap-x-2", children: [
|
|
1285
|
-
/* @__PURE__ */ jsx6(Text3, { size: "small", weight: "plus", leading: "compact", children: attr.name }),
|
|
1286
|
-
attr.description && /* @__PURE__ */ jsx6(Tooltip4, { content: attr.description, children: /* @__PURE__ */ jsx6("span", { className: "text-ui-fg-muted flex items-center", children: /* @__PURE__ */ jsx6(InformationCircleSolid, {}) }) }),
|
|
1287
|
-
attr.is_required && /* @__PURE__ */ jsx6(
|
|
1288
|
-
Tooltip4,
|
|
1289
|
-
{
|
|
1290
|
-
content: t("products.attributeRequiredByMarketplace"),
|
|
1291
|
-
children: /* @__PURE__ */ jsx6("span", { className: "text-ui-fg-muted flex items-center", children: /* @__PURE__ */ jsx6(InformationCircleSolid, {}) })
|
|
1292
|
-
}
|
|
1293
|
-
)
|
|
1294
|
-
] }),
|
|
1295
|
-
/* @__PURE__ */ jsx6("div", { className: "flex flex-wrap gap-1", children: ["single_select", "multi_select"].includes(attr.type) ? values.map((val) => /* @__PURE__ */ jsx6(
|
|
1296
|
-
Badge3,
|
|
1297
|
-
{
|
|
1298
|
-
size: "2xsmall",
|
|
1299
|
-
className: "flex min-w-[20px] items-center justify-center",
|
|
1300
|
-
children: val
|
|
1301
|
-
},
|
|
1302
|
-
val
|
|
1303
|
-
)) : /* @__PURE__ */ jsx6(
|
|
1304
|
-
Text3,
|
|
1305
|
-
{
|
|
1306
|
-
size: "small",
|
|
1307
|
-
leading: "compact",
|
|
1308
|
-
className: "text-ui-fg-subtle",
|
|
1309
|
-
children: values.join(", ") || "-"
|
|
1310
|
-
}
|
|
1311
|
-
) }),
|
|
1312
|
-
/* @__PURE__ */ jsx6(AttributeActions, { productId, attribute: attr })
|
|
1313
|
-
] })
|
|
1314
|
-
},
|
|
1315
|
-
attr.id
|
|
1316
|
-
);
|
|
1317
|
-
}) }) })
|
|
1318
|
-
] });
|
|
1319
|
-
};
|
|
1320
|
-
var ProductAttributeSection = ({
|
|
1321
|
-
product
|
|
1322
|
-
}) => {
|
|
1323
|
-
const { t } = useTranslation6();
|
|
1324
|
-
const allAttributes = product.attributes ?? [];
|
|
1325
|
-
const variantAttributes = allAttributes.filter((a) => a.is_variant_axis);
|
|
1326
|
-
const infoAttributes = allAttributes.filter((a) => !a.is_variant_axis);
|
|
1327
|
-
const isEmpty = !variantAttributes.length && !infoAttributes.length;
|
|
1328
|
-
return /* @__PURE__ */ jsxs6(Container6, { className: "p-0", children: [
|
|
1329
|
-
/* @__PURE__ */ jsxs6(
|
|
1330
|
-
"div",
|
|
1331
|
-
{
|
|
1332
|
-
className: `flex items-center justify-between px-6 py-4${isEmpty ? "" : " border-b border-ui-border-base"}`,
|
|
1333
|
-
children: [
|
|
1334
|
-
/* @__PURE__ */ jsx6(Heading6, { level: "h2", children: t("products.attributes") }),
|
|
1335
|
-
/* @__PURE__ */ jsx6(
|
|
1336
|
-
ActionMenu,
|
|
1337
|
-
{
|
|
1338
|
-
groups: [
|
|
1339
|
-
{
|
|
1340
|
-
actions: [
|
|
1341
|
-
{
|
|
1342
|
-
label: t("products.create.attributes.addExisting"),
|
|
1343
|
-
to: "attributes/add",
|
|
1344
|
-
icon: /* @__PURE__ */ jsx6(ListBullet, {})
|
|
1345
|
-
},
|
|
1346
|
-
{
|
|
1347
|
-
label: t("products.create.attributes.createNew"),
|
|
1348
|
-
to: "attributes/create",
|
|
1349
|
-
icon: /* @__PURE__ */ jsx6(Plus, {})
|
|
1350
|
-
}
|
|
1351
|
-
]
|
|
1352
|
-
}
|
|
1353
|
-
]
|
|
1354
|
-
}
|
|
1355
|
-
)
|
|
1356
|
-
]
|
|
1357
|
-
}
|
|
1358
|
-
),
|
|
1359
|
-
variantAttributes.length > 0 && /* @__PURE__ */ jsx6(
|
|
1360
|
-
AttributeGroup,
|
|
1361
|
-
{
|
|
1362
|
-
icon: /* @__PURE__ */ jsx6(Swatch, {}),
|
|
1363
|
-
title: t("products.create.tabs.variants"),
|
|
1364
|
-
description: t("products.attributeVariantsDescription"),
|
|
1365
|
-
attributes: variantAttributes,
|
|
1366
|
-
productId: product.id
|
|
1367
|
-
}
|
|
1368
|
-
),
|
|
1369
|
-
variantAttributes.length > 0 && infoAttributes.length > 0 && /* @__PURE__ */ jsx6("div", { className: "border-t border-dashed border-ui-border-base" }),
|
|
1370
|
-
infoAttributes.length > 0 && /* @__PURE__ */ jsx6(
|
|
1371
|
-
AttributeGroup,
|
|
1372
|
-
{
|
|
1373
|
-
icon: /* @__PURE__ */ jsx6(DropCap, {}),
|
|
1374
|
-
title: t("products.attributeProductInformation"),
|
|
1375
|
-
description: t("products.attributeProductInformationDescription"),
|
|
1376
|
-
attributes: infoAttributes,
|
|
1377
|
-
productId: product.id
|
|
1378
|
-
}
|
|
1379
|
-
)
|
|
1380
|
-
] });
|
|
1381
|
-
};
|
|
1382
|
-
|
|
1383
|
-
// src/pages/products/[id]/_components/product-shipping-profile-section/product-shipping-profile-section.tsx
|
|
1384
|
-
import { PencilSquare as PencilSquare5, ShoppingBag } from "@medusajs/icons";
|
|
1385
|
-
import { Container as Container7, Heading as Heading7 } from "@medusajs/ui";
|
|
1386
|
-
import { useTranslation as useTranslation7 } from "react-i18next";
|
|
1387
|
-
import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1388
|
-
var ProductShippingProfileSection = ({
|
|
1389
|
-
product
|
|
1390
|
-
}) => {
|
|
1391
|
-
const { t } = useTranslation7();
|
|
1392
|
-
const shippingProfile = product.shipping_profile;
|
|
1393
|
-
return /* @__PURE__ */ jsxs7(Container7, { className: "p-0", children: [
|
|
1394
|
-
/* @__PURE__ */ jsxs7("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
1395
|
-
/* @__PURE__ */ jsx7(Heading7, { level: "h2", children: t("products.shippingProfile.header") }),
|
|
1396
|
-
/* @__PURE__ */ jsx7(
|
|
1397
|
-
ActionMenu,
|
|
1398
|
-
{
|
|
1399
|
-
groups: [
|
|
1400
|
-
{
|
|
1401
|
-
actions: [
|
|
1402
|
-
{
|
|
1403
|
-
label: t("actions.edit"),
|
|
1404
|
-
to: "shipping-profile",
|
|
1405
|
-
icon: /* @__PURE__ */ jsx7(PencilSquare5, {})
|
|
1406
|
-
}
|
|
1407
|
-
]
|
|
1408
|
-
}
|
|
1409
|
-
]
|
|
1410
|
-
}
|
|
1411
|
-
)
|
|
1412
|
-
] }),
|
|
1413
|
-
shippingProfile && /* @__PURE__ */ jsx7(
|
|
1414
|
-
SidebarLink,
|
|
1415
|
-
{
|
|
1416
|
-
to: `/settings/locations/shipping-profiles/${shippingProfile.id}`,
|
|
1417
|
-
labelKey: shippingProfile.name,
|
|
1418
|
-
descriptionKey: shippingProfile.type,
|
|
1419
|
-
icon: /* @__PURE__ */ jsx7(ShoppingBag, {})
|
|
1420
|
-
}
|
|
1421
|
-
)
|
|
1422
|
-
] });
|
|
1423
|
-
};
|
|
1424
|
-
|
|
1425
|
-
// src/pages/products/[id]/_components/product-sales-channel-section/product-sales-channel-section.tsx
|
|
1426
|
-
import { Channels, PencilSquare as PencilSquare6 } from "@medusajs/icons";
|
|
1427
|
-
import { Container as Container8, Heading as Heading8, Text as Text4, Tooltip as Tooltip5 } from "@medusajs/ui";
|
|
1428
|
-
import { Trans, useTranslation as useTranslation8 } from "react-i18next";
|
|
1429
|
-
import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1430
|
-
var ProductSalesChannelSection = ({
|
|
1431
|
-
product
|
|
1432
|
-
}) => {
|
|
1433
|
-
const { count } = useSalesChannels();
|
|
1434
|
-
const { t } = useTranslation8();
|
|
1435
|
-
const availableInSalesChannels = product.sales_channels?.map((sc) => ({
|
|
1436
|
-
id: sc.id,
|
|
1437
|
-
name: sc.name
|
|
1438
|
-
})) ?? [];
|
|
1439
|
-
const firstChannels = availableInSalesChannels.slice(0, 3);
|
|
1440
|
-
const restChannels = availableInSalesChannels.slice(3);
|
|
1441
|
-
return /* @__PURE__ */ jsxs8(Container8, { className: "flex flex-col gap-y-4 px-6 py-4", children: [
|
|
1442
|
-
/* @__PURE__ */ jsxs8("div", { className: "flex items-center justify-between", children: [
|
|
1443
|
-
/* @__PURE__ */ jsx8(Heading8, { level: "h2", children: t("fields.sales_channels") }),
|
|
1444
|
-
/* @__PURE__ */ jsx8(
|
|
1445
|
-
ActionMenu,
|
|
1446
|
-
{
|
|
1447
|
-
groups: [
|
|
1448
|
-
{
|
|
1449
|
-
actions: [
|
|
1450
|
-
{
|
|
1451
|
-
label: t("actions.edit"),
|
|
1452
|
-
to: "sales-channels",
|
|
1453
|
-
icon: /* @__PURE__ */ jsx8(PencilSquare6, {})
|
|
1454
|
-
}
|
|
1455
|
-
]
|
|
1456
|
-
}
|
|
1457
|
-
]
|
|
1458
|
-
}
|
|
1459
|
-
)
|
|
1460
|
-
] }),
|
|
1461
|
-
/* @__PURE__ */ jsxs8("div", { className: "grid grid-cols-[28px_1fr] items-center gap-x-3", children: [
|
|
1462
|
-
/* @__PURE__ */ jsx8("div", { className: "bg-ui-bg-base shadow-borders-base flex size-7 items-center justify-center rounded-md", children: /* @__PURE__ */ jsx8("div", { className: "bg-ui-bg-component flex size-6 items-center justify-center rounded-[4px]", children: /* @__PURE__ */ jsx8(Channels, { className: "text-ui-fg-subtle" }) }) }),
|
|
1463
|
-
availableInSalesChannels.length > 0 ? /* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-x-1", children: [
|
|
1464
|
-
/* @__PURE__ */ jsx8(Text4, { size: "small", leading: "compact", children: firstChannels.map((sc) => sc.name).join(", ") }),
|
|
1465
|
-
restChannels.length > 0 && /* @__PURE__ */ jsx8(
|
|
1466
|
-
Tooltip5,
|
|
1467
|
-
{
|
|
1468
|
-
content: /* @__PURE__ */ jsx8("ul", { children: restChannels.map((sc) => /* @__PURE__ */ jsx8("li", { children: sc.name }, sc.id)) }),
|
|
1469
|
-
children: /* @__PURE__ */ jsx8(
|
|
1470
|
-
Text4,
|
|
1471
|
-
{
|
|
1472
|
-
size: "small",
|
|
1473
|
-
leading: "compact",
|
|
1474
|
-
className: "text-ui-fg-subtle",
|
|
1475
|
-
children: `+${restChannels.length}`
|
|
1476
|
-
}
|
|
1477
|
-
)
|
|
1478
|
-
}
|
|
1479
|
-
)
|
|
1480
|
-
] }) : /* @__PURE__ */ jsx8(Text4, { size: "small", leading: "compact", className: "text-ui-fg-subtle", children: t("products.noSalesChannels") })
|
|
1481
|
-
] }),
|
|
1482
|
-
/* @__PURE__ */ jsx8("div", { children: /* @__PURE__ */ jsx8(Text4, { className: "text-ui-fg-subtle", size: "small", leading: "compact", children: /* @__PURE__ */ jsx8(
|
|
1483
|
-
Trans,
|
|
1484
|
-
{
|
|
1485
|
-
i18nKey: "sales_channels.availableIn",
|
|
1486
|
-
values: {
|
|
1487
|
-
x: availableInSalesChannels.length,
|
|
1488
|
-
y: count ?? 0
|
|
1489
|
-
},
|
|
1490
|
-
components: [
|
|
1491
|
-
/* @__PURE__ */ jsx8(
|
|
1492
|
-
"span",
|
|
1493
|
-
{
|
|
1494
|
-
className: "text-ui-fg-base txt-compact-medium-plus"
|
|
1495
|
-
},
|
|
1496
|
-
"x"
|
|
1497
|
-
),
|
|
1498
|
-
/* @__PURE__ */ jsx8(
|
|
1499
|
-
"span",
|
|
1500
|
-
{
|
|
1501
|
-
className: "text-ui-fg-base txt-compact-medium-plus"
|
|
1502
|
-
},
|
|
1503
|
-
"y"
|
|
1504
|
-
)
|
|
1505
|
-
]
|
|
1506
|
-
}
|
|
1507
|
-
) }) })
|
|
1508
|
-
] });
|
|
1509
|
-
};
|
|
1510
|
-
|
|
1511
|
-
// src/pages/products/[id]/product-detail-page.tsx
|
|
1512
|
-
import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1513
|
-
var Root = ({ children }) => {
|
|
1514
|
-
const initialData = useLoaderData();
|
|
1515
|
-
const { id } = useParams();
|
|
1516
|
-
const { product, isLoading, isError, error } = useProduct(
|
|
1517
|
-
id,
|
|
1518
|
-
PRODUCT_DETAIL_QUERY,
|
|
1519
|
-
{
|
|
1520
|
-
initialData
|
|
1521
|
-
}
|
|
1522
|
-
);
|
|
1523
|
-
if (isLoading || !product) {
|
|
1524
|
-
return /* @__PURE__ */ jsx9(TwoColumnPageSkeleton, { mainSections: 4, sidebarSections: 3 });
|
|
1525
|
-
}
|
|
1526
|
-
if (isError) {
|
|
1527
|
-
throw error;
|
|
1528
|
-
}
|
|
1529
|
-
return Children.count(children) > 0 ? /* @__PURE__ */ jsx9(TwoColumnPage, { data: product, "data-testid": "product-detail-page", children }) : /* @__PURE__ */ jsxs9(TwoColumnPage, { data: product, "data-testid": "product-detail-page", children: [
|
|
1530
|
-
/* @__PURE__ */ jsxs9(TwoColumnPage.Main, { "data-testid": "product-detail-main", children: [
|
|
1531
|
-
/* @__PURE__ */ jsx9(ProductActiveEditSection, { product }),
|
|
1532
|
-
/* @__PURE__ */ jsx9(ProductGeneralSection, { product }),
|
|
1533
|
-
/* @__PURE__ */ jsx9(ProductMediaSection, { product }),
|
|
1534
|
-
/* @__PURE__ */ jsx9(ProductVariantSection, { product })
|
|
1535
|
-
] }),
|
|
1536
|
-
/* @__PURE__ */ jsxs9(TwoColumnPage.Sidebar, { "data-testid": "product-detail-sidebar", children: [
|
|
1537
|
-
/* @__PURE__ */ jsx9(ProductOrganizationSection, { product }),
|
|
1538
|
-
/* @__PURE__ */ jsx9(ProductAttributeSection, { product })
|
|
1539
|
-
] })
|
|
1540
|
-
] });
|
|
1541
|
-
};
|
|
1542
|
-
var ProductDetailPage = Object.assign(Root, {
|
|
1543
|
-
Main: TwoColumnPage.Main,
|
|
1544
|
-
Sidebar: TwoColumnPage.Sidebar,
|
|
1545
|
-
MainActiveEditSection: ProductActiveEditSection,
|
|
1546
|
-
MainGeneralSection: ProductGeneralSection,
|
|
1547
|
-
MainMediaSection: ProductMediaSection,
|
|
1548
|
-
MainVariantSection: ProductVariantSection,
|
|
1549
|
-
MainAttributeSection: ProductAttributeSection,
|
|
1550
|
-
SidebarShippingProfileSection: ProductShippingProfileSection,
|
|
1551
|
-
SidebarOrganizationSection: ProductOrganizationSection,
|
|
1552
|
-
SidebarSalesChannelSection: ProductSalesChannelSection
|
|
1553
|
-
});
|
|
1554
|
-
export {
|
|
1555
|
-
ProductDetailPage,
|
|
1556
|
-
loader
|
|
1557
|
-
};
|