@mercurjs/vendor 2.2.0-canary.2 → 2.2.0-canary.21
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]-KRLGIVLR.js → [id]-3JICOSAI.js} +133 -41
- package/dist/[id]-CR76L5TG.js +3102 -0
- package/dist/{[id]-7BAKUHUO.js → [id]-DDGHFRSB.js} +5 -5
- package/dist/{[id]-KVWYLDN3.js → [id]-E7DYRMMO.js} +162 -71
- package/dist/{[id]-4OBGG7OH.js → [id]-FIP4UMQ4.js} +197 -105
- package/dist/{[id]-3EC6HYXL.js → [id]-FZRXOJWL.js} +22 -21
- package/dist/{[id]-ZWWMJAKI.js → [id]-PD3ISUL5.js} +7 -7
- package/dist/{[id]-UUUQK22M.js → [id]-Q5AXQ5XO.js} +460 -581
- package/dist/{[id]-KJIQTFGE.js → [id]-VSNA6SV5.js} +15 -15
- package/dist/{[id]-Y2ISCLUD.js → [id]-XUKQKCDN.js} +3 -3
- package/dist/{[id]-K2CT7BXQ.js → [id]-YPCO3DJV.js} +1 -1
- package/dist/{[id]-LUFRJLAU.js → [id]-ZEFQ7FQQ.js} +36 -33
- package/dist/{[id]-COLO4TQJ.js → [id]-ZW7TBWDU.js} +24 -23
- package/dist/{[province_id]-H2QAPKVH.js → [province_id]-CHOO7ERP.js} +14 -14
- package/dist/{add-FIWTANZX.js → add-GYXNRUAE.js} +40 -37
- package/dist/{add-PBZQCIZQ.js → add-IC5R27X3.js} +95 -32
- package/dist/{add-customer-groups-RAHCP67U.js → add-customer-groups-KIGBZT5G.js} +20 -23
- package/dist/{add-products-N3V2MVLD.js → add-products-ALJVIFXU.js} +23 -22
- package/dist/{add-promotions-CSCAJZHV.js → add-promotions-EQ5MMQKG.js} +8 -8
- package/dist/{add-to-campaign-DLP7PSQB.js → add-to-campaign-C6JDNB6F.js} +4 -4
- package/dist/{address-7F5SN7PV.js → address-UKLDTSTP.js} +13 -13
- package/dist/{adjust-inventory-SZF4W7LR.js → adjust-inventory-5XPGE44Y.js} +2 -2
- package/dist/allocate-items-URVRAFPS.js +685 -0
- package/dist/{areas-7Y6BVS5A.js → areas-64VXOFYS.js} +6 -6
- package/dist/{attributes-MBZ76HVZ.js → attributes-YQNW5JBY.js} +2 -2
- package/dist/{breadcrumb-HND5FFWC.js → breadcrumb-26G7BS3Q.js} +3 -3
- package/dist/{breadcrumb-7PURSRTT.js → breadcrumb-2AYN2SV7.js} +12 -12
- package/dist/{breadcrumb-ZCG2RHIU.js → breadcrumb-4KKLMVC3.js} +12 -12
- package/dist/{breadcrumb-WRG4SITG.js → breadcrumb-4XSHX5RV.js} +13 -13
- package/dist/{breadcrumb-QV2IAX7N.js → breadcrumb-E5OF4L2J.js} +2 -2
- package/dist/breadcrumb-JC5FUQYF.js +28 -0
- package/dist/{breadcrumb-YBBYFQYG.js → breadcrumb-LBO2I4OJ.js} +1 -1
- package/dist/breadcrumb-PIDJ23EZ.js +13 -0
- package/dist/{breadcrumb-65SAGUUL.js → breadcrumb-RWYEU5JK.js} +3 -3
- package/dist/{breadcrumb-VWELWDB2.js → breadcrumb-VXKAO6GP.js} +1 -1
- package/dist/{breadcrumb-FLDHJRVY.js → breadcrumb-WMNG4P6C.js} +9 -8
- package/dist/{breadcrumb-EDPMEN2P.js → breadcrumb-XPQETVMM.js} +2 -2
- package/dist/{campaigns-L6ULR6KR.js → campaigns-4I2T6EDZ.js} +5 -5
- package/dist/{categories-FUZQKBXV.js → categories-3P2DRH5V.js} +10 -8
- package/dist/{chunk-EZ3JOAUS.js → chunk-22CIYLKO.js} +1 -1
- package/dist/{chunk-RZLN2Q6G.js → chunk-247L47JD.js} +1 -1
- package/dist/{chunk-SFQKKIHA.js → chunk-27WLUOI2.js} +1 -1
- package/dist/{chunk-M7KSRYRI.js → chunk-2ECD67FO.js} +2 -2
- package/dist/{chunk-36L54SQQ.js → chunk-2H4FGZ4U.js} +1 -1
- package/dist/{chunk-X2FVFUET.js → chunk-2NUZTTBU.js} +27 -8
- package/dist/chunk-2OY4NW7L.js +185 -0
- package/dist/{chunk-K4X324QP.js → chunk-36WXPGD2.js} +6 -5
- package/dist/{chunk-PXYDR7WQ.js → chunk-3BXCPHN6.js} +3 -2
- package/dist/chunk-3EDZQSKG.js +33 -0
- package/dist/{chunk-2DXNJURE.js → chunk-3L2DVCOC.js} +1 -1
- package/dist/chunk-42R54Z2X.js +8 -0
- package/dist/{chunk-CNMY5HVP.js → chunk-4EQIJMQT.js} +3 -3
- package/dist/{chunk-UAF2S447.js → chunk-4OIOYUQE.js} +3 -3
- package/dist/{chunk-UORPTGV2.js → chunk-4R5GESED.js} +10 -14
- package/dist/{chunk-WUPJADSO.js → chunk-4RFPRO2W.js} +2 -2
- package/dist/chunk-4YWKKCTT.js +32 -0
- package/dist/{chunk-XFQJU6FA.js → chunk-5QG6P6EU.js} +1 -1
- package/dist/{chunk-N4MVIBFM.js → chunk-5Y6RDTW2.js} +3 -3
- package/dist/{chunk-DZIXC7OE.js → chunk-6FLSBL4Q.js} +30 -85
- package/dist/{chunk-DVEKYLPV.js → chunk-6QS6IZC6.js} +1 -1
- package/dist/chunk-6ZGQ3SOR.js +127 -0
- package/dist/{chunk-NXNJQZCP.js → chunk-7FIPNQM2.js} +1 -1
- package/dist/{chunk-NSZQERLE.js → chunk-7GGWRJJF.js} +2 -2
- package/dist/{chunk-QS6RWIBL.js → chunk-7RGUD6PI.js} +34 -20
- package/dist/{chunk-5L2DCA4W.js → chunk-7ZPJGL4C.js} +57 -6
- package/dist/{chunk-KD7RYE6R.js → chunk-AG6KIAUD.js} +2 -2
- package/dist/{chunk-UCQKXXLD.js → chunk-AKKIZD2P.js} +32 -34
- package/dist/chunk-CHBURL76.js +438 -0
- package/dist/{chunk-PBD36EZJ.js → chunk-CI4YXVQF.js} +2 -2
- package/dist/{chunk-7LBY5JLV.js → chunk-DAV7WS53.js} +1 -1
- package/dist/{chunk-6BS2AVGJ.js → chunk-DNXMONCL.js} +6 -6
- package/dist/{chunk-TNVYTMBL.js → chunk-E4O5PARZ.js} +4 -4
- package/dist/{chunk-L7QKFC5N.js → chunk-E6W57UP3.js} +32 -122
- package/dist/chunk-EEBJYXWA.js +15 -0
- package/dist/chunk-FP6U6BPH.js +61 -0
- package/dist/{chunk-SGR4DMCW.js → chunk-FRYZRBLA.js} +1 -1
- package/dist/chunk-FWPGOIFA.js +22 -0
- package/dist/chunk-GL7F6NDU.js +30 -0
- package/dist/chunk-H7BVANDX.js +407 -0
- package/dist/{chunk-FDR22JMM.js → chunk-HFRHHT36.js} +8 -63
- package/dist/{chunk-FJUUGFXL.js → chunk-HOUDNM5M.js} +1 -1
- package/dist/{chunk-6Y53VZ3C.js → chunk-HZCSJLGH.js} +11 -11
- package/dist/chunk-I75SROQZ.js +315 -0
- package/dist/{chunk-JQV7CXEC.js → chunk-II3ACSV2.js} +17 -2
- package/dist/{chunk-DARJTN4I.js → chunk-IMJ62GAP.js} +10 -5
- package/dist/{chunk-PPLC4IKI.js → chunk-IV57G2CB.js} +14 -1
- package/dist/{chunk-7SLWXX6L.js → chunk-J434WDD3.js} +5 -6
- package/dist/chunk-J6XCRFBW.js +30 -0
- package/dist/{chunk-KAZ5BYTQ.js → chunk-KCHYLLVG.js} +6 -4
- package/dist/{chunk-YGRTRAWX.js → chunk-KDE4HKH2.js} +1 -0
- package/dist/{chunk-GXIAIITP.js → chunk-KZYRC3WR.js} +36 -39
- package/dist/chunk-L57USMYC.js +39 -0
- package/dist/chunk-LFX6WU4A.js +36 -0
- package/dist/{chunk-EROX26D4.js → chunk-LRMWYKSF.js} +1 -1
- package/dist/{chunk-LWJF63JW.js → chunk-LTQQRVZG.js} +89 -14
- package/dist/chunk-LYYM7H7H.js +59 -0
- package/dist/{chunk-NHFEY3EI.js → chunk-M3YUT5AY.js} +2 -2
- package/dist/{chunk-H6LZ77GX.js → chunk-MJCL3WID.js} +1 -1
- package/dist/{chunk-X4INVIWL.js → chunk-MZRZVLWD.js} +3 -3
- package/dist/{chunk-DDH7ULIQ.js → chunk-N6MGVXXQ.js} +1 -1
- package/dist/{chunk-QXLRABYH.js → chunk-O7VOGTLX.js} +1 -1
- package/dist/{chunk-35G3SZRN.js → chunk-P3SOE76R.js} +1 -1
- package/dist/{chunk-PZ44R4AS.js → chunk-P7Q5ZSZD.js} +1 -1
- package/dist/{chunk-5ATEALH7.js → chunk-PFJFS3F4.js} +1 -5
- package/dist/chunk-POOTMH3K.js +62 -0
- package/dist/{chunk-GGWUWT55.js → chunk-QJI4OET7.js} +23 -36
- package/dist/{chunk-NJMNYS7G.js → chunk-QS35HWC5.js} +1 -1
- package/dist/{chunk-RTBNJQOV.js → chunk-R4JLYNUA.js} +419 -538
- package/dist/{chunk-DIW4GRTI.js → chunk-RT3G3GEK.js} +47 -31
- package/dist/{chunk-QT7YFHCA.js → chunk-S23FD6FA.js} +12 -0
- package/dist/{chunk-U2ZFCAPX.js → chunk-SITRHMZZ.js} +11 -8
- package/dist/chunk-SPFLYPY6.js +6 -0
- package/dist/{chunk-EIUYXS7E.js → chunk-SZBERGA4.js} +1 -1
- package/dist/chunk-T6DSYOY5.js +173 -0
- package/dist/{chunk-4LVP635F.js → chunk-TKSKCYM3.js} +128 -126
- package/dist/{chunk-QNNJN4H6.js → chunk-TSTUAL6N.js} +59 -0
- package/dist/{chunk-LNM2D2I4.js → chunk-TZMNEN7A.js} +7 -6
- package/dist/chunk-UM7ZR3VU.js +14 -0
- package/dist/{chunk-X22KTLZ7.js → chunk-UO6IX5Y7.js} +1 -1
- package/dist/chunk-VCUUITW6.js +35 -0
- package/dist/{chunk-LQD232FW.js → chunk-WJ5EU3KW.js} +1 -1
- package/dist/{chunk-AIF2KTEE.js → chunk-WKRW5OPL.js} +12 -2
- package/dist/{chunk-6YA3C4NB.js → chunk-XBKWFLJG.js} +4 -13
- package/dist/{chunk-WBHFU3MG.js → chunk-XJYQ4SW5.js} +2 -2
- package/dist/chunk-XQUF3WIS.js +159 -0
- package/dist/chunk-YBF45CX5.js +23 -0
- package/dist/{chunk-AVOIZO63.js → chunk-YQZBAP3S.js} +4 -2
- package/dist/chunk-ZHFFTT3I.js +17 -0
- package/dist/{chunk-TODJFRLH.js → chunk-ZHR77OQI.js} +2 -2
- package/dist/chunk-ZUHIKMQL.js +353 -0
- package/dist/{chunk-44RQ5PTN.js → chunk-ZZIJSTXN.js} +225 -90
- package/dist/{collections-YCAAFGSW.js → collections-7M7O23NO.js} +28 -26
- package/dist/{configuration-UOSNP45I.js → configuration-5IDQRYJQ.js} +4 -4
- package/dist/{configuration-C4IGBNXH.js → configuration-TXRAYMI4.js} +1 -1
- package/dist/{create-BJ4OO6LS.js → create-2N73Y6FO.js} +14 -14
- package/dist/{create-R7K3ECN6.js → create-3MUVY3UY.js} +1 -1
- package/dist/{create-SFU3W3ZH.js → create-6DRXGPYA.js} +1 -1
- package/dist/{create-XAD5NMSJ.js → create-6KM5AZCG.js} +20 -20
- package/dist/{create-YDDBH4VQ.js → create-A6CPQMMH.js} +27 -26
- package/dist/create-B4EWCX7X.js +1798 -0
- package/dist/{create-YBF4YGWG.js → create-BHSMHOFN.js} +1 -1
- package/dist/{create-XVHOCZHJ.js → create-BVUZWMET.js} +1 -1
- package/dist/create-CJEZCYN6.js +1179 -0
- package/dist/create-DAVMJNC2.js +1931 -0
- package/dist/{create-35MYQPVM.js → create-E4HTVPP7.js} +17 -17
- package/dist/{create-JDGM5KXE.js → create-G4TF2M7G.js} +88 -42
- package/dist/{create-UQNYMVBM.js → create-LOP7AF5N.js} +6 -6
- package/dist/{create-UPYB65PD.js → create-MKFDE32U.js} +1 -1
- package/dist/{create-B5ZXTK3K.js → create-NR7ULWQS.js} +37 -34
- package/dist/{create-HI5UI2EZ.js → create-SJSLOXOW.js} +31 -26
- package/dist/{create-GB3ZA4LH.js → create-SYI6DVKM.js} +4 -4
- package/dist/{create-ORXYT74H.js → create-ZAGMLDR4.js} +13 -13
- package/dist/create-ZP4LSJYQ.js +216 -0
- package/dist/customer-group-add-customers-GTM556QA.js +251 -0
- package/dist/customer-group-create-OYHAXX2T.js +140 -0
- package/dist/customer-group-detail-KW62TLWA.js +58 -0
- package/dist/customer-group-edit-WH7O4N4L.js +137 -0
- package/dist/customer-groups-UJFZBZ2B.js +276 -0
- package/dist/{customers-ETXVNM3G.js → customers-4WKIFPUU.js} +7 -7
- package/dist/{edit-UGEC27HP.js → edit-3EN2H52W.js} +39 -36
- package/dist/{edit-ZMERG3L7.js → edit-3VNT35DW.js} +1 -1
- package/dist/{edit-ORXS3A2Y.js → edit-6DUTTLEV.js} +1 -1
- package/dist/edit-6K3NSVI7.js +103 -0
- package/dist/{edit-REDDBLTA.js → edit-6Z6RIJRZ.js} +4 -4
- package/dist/{edit-2Q7TRUTL.js → edit-CVSO5CX7.js} +14 -14
- package/dist/{edit-ZAHCMF5U.js → edit-FQDSESVI.js} +1 -1
- package/dist/edit-GZXLWSTL.js +176 -0
- package/dist/edit-LLNKSZR4.js +871 -0
- package/dist/{edit-O4JLGKQR.js → edit-MKVDAUA5.js} +1 -1
- package/dist/{edit-ZCXUG42Q.js → edit-NDUSRTWY.js} +13 -13
- package/dist/{edit-522DG3BY.js → edit-RBREBAQQ.js} +1 -1
- package/dist/{edit-Q3UQIOLS.js → edit-RQHOHZR6.js} +1 -1
- package/dist/{edit-VKT62KHG.js → edit-SAB6F3ZG.js} +36 -15
- package/dist/{edit-C4OCKQVU.js → edit-SM2GHVKW.js} +1 -1
- package/dist/{edit-KAKVPHZZ.js → edit-UVY3TEHD.js} +1 -1
- package/dist/{edit-SGUY2CCK.js → edit-V7WLYLOQ.js} +16 -16
- package/dist/{edit-FKXIQ6ZI.js → edit-XMZSLH4O.js} +16 -16
- package/dist/{edit-L5ZZLMAY.js → edit-YTS77SJS.js} +43 -32
- package/dist/{edit-budget-L3CCEWNF.js → edit-budget-4JMGEPNF.js} +1 -1
- package/dist/{edit-inventory-item-6B7ITDGD.js → edit-inventory-item-G22KFCYY.js} +2 -2
- package/dist/{edit-inventory-item-attributes-Y7MQZLXI.js → edit-inventory-item-attributes-RJSM4MEI.js} +2 -2
- package/dist/edit-price-K6K2FTMF.js +196 -0
- package/dist/edit-stock-6TUSJD5R.js +229 -0
- package/dist/fulfillment-VEF6HG6D.js +641 -0
- package/dist/{fulfillment-providers-DQAU43JZ.js → fulfillment-providers-VKBWFH45.js} +24 -24
- package/dist/index.css +107 -10
- package/dist/index.js +302 -183
- package/dist/{inventory-KAUVPMPZ.js → inventory-OCIGVZ4V.js} +6 -6
- package/dist/{offer-inventory-batch-page-WKCWNDNK.js → inventory-T7BRSFKY.js} +16 -16
- package/dist/{invite-CI2P4GF6.js → invite-J6L3Q7MQ.js} +12 -12
- package/dist/{invite-Q6EYDZVQ.js → invite-VWNUFOFI.js} +21 -21
- package/dist/loader-2EQ4ROTD.js +34 -0
- package/dist/loader-HYUC2XZX.js +33 -0
- package/dist/{login-KY342RMK.js → login-WOZMCEFY.js} +12 -12
- package/dist/{manage-locations-WNHEBS3A.js → manage-locations-R3ASMF5B.js} +1 -1
- package/dist/{media-B6ME2WXY.js → media-KIIJ6WSZ.js} +18 -17
- package/dist/media-RJHUSBXL.js +315 -0
- package/dist/{metadata-WR4RFXO5.js → metadata-45S6CFKY.js} +14 -14
- package/dist/{metadata-2CMH4I6U.js → metadata-FCATUWIZ.js} +14 -14
- package/dist/{metadata-GWI6R4ES.js → metadata-L5GBBXC4.js} +14 -14
- package/dist/{metadata-TLDUF5KV.js → metadata-R4ZRMAO6.js} +14 -14
- package/dist/{metadata-NUXUC2JA.js → metadata-RM5VVAOS.js} +14 -14
- package/dist/{offer-create-page-4Z6L63BU.js → offer-create-page-DV4JCIL2.js} +190 -195
- package/dist/offer-detail-page-TIBYGQBS.js +590 -0
- package/dist/offer-variant-detail-page-ORH56HZI.js +421 -0
- package/dist/offers-VA63KV3C.js +54 -0
- package/dist/{onboarding-43LQQQGQ.js → onboarding-L5RRKT65.js} +12 -12
- package/dist/{orders-ZV4D6L2V.js → orders-KKJD6EWZ.js} +27 -27
- package/dist/{organization-ZTQGRJWS.js → organization-6YPU2RQP.js} +53 -89
- package/dist/{organize-K6QMAMEN.js → organize-LR7FWK2J.js} +3 -3
- package/dist/{organize-HNJUHEEG.js → organize-SUG4SGVR.js} +3 -3
- package/dist/pages/index.d.ts +40 -16
- package/dist/pages/index.js +73 -73
- package/dist/{payment-details-64US5XWD.js → payment-details-UVEIHQA5.js} +13 -13
- package/dist/{payouts-UXJDTXDL.js → payouts-D4A4CILI.js} +8 -8
- package/dist/{price-lists-KBPUVSZI.js → price-lists-WJFXFGEV.js} +10 -10
- package/dist/{pricing-DF6C5XK4.js → pricing-QEVR2Z4K.js} +19 -19
- package/dist/{offer-pricing-edit-page-4TYGGSOE.js → pricing-XJUUCYL5.js} +24 -18
- package/dist/{product-tags-6MZB4W5R.js → product-tags-MW2JMRFY.js} +36 -33
- package/dist/{product-types-UUHBV4IZ.js → product-types-XXU7X42K.js} +6 -6
- package/dist/product-variant-detail-XZWTSH3H.js +369 -0
- package/dist/{product-variant-edit-YYNPHE4L.js → product-variant-edit-A2KO3E7B.js} +41 -44
- package/dist/{products-MZBU5MEV.js → products-TZS2OPK3.js} +37 -37
- package/dist/{products-IWKTGZS6.js → products-XSXEUKIB.js} +23 -22
- package/dist/{professional-details-5T2VS6MM.js → professional-details-ELUEJPOH.js} +13 -13
- package/dist/{profile-6XGHAT7H.js → profile-EDVGIBW6.js} +16 -16
- package/dist/{promotions-O7U4BTK6.js → promotions-JYO23G6N.js} +8 -8
- package/dist/receive-47SMYKIJ.js +578 -0
- package/dist/refund-IU7B77FV.js +268 -0
- package/dist/{register-N6WOSMLA.js → register-SR2SYX4Q.js} +14 -14
- package/dist/{reset-password-EICPAY2N.js → reset-password-N22YRMR3.js} +1 -1
- package/dist/{return-reasons-IX3LIOCU.js → return-reasons-POR5YPTF.js} +18 -15
- package/dist/{sales-channels-JW3QUYR7.js → sales-channels-ETB6QRRY.js} +8 -8
- package/dist/{sales-channels-B6FULRWI.js → sales-channels-YXRRARDL.js} +7 -7
- package/dist/{settings-MV53ZZ53.js → settings-MHBYIZ2I.js} +38 -35
- package/dist/shipment-ZX6PQ32L.js +241 -0
- package/dist/shipping-W4SPR3JO.js +122 -0
- package/dist/{shipping-profile-Y4SNEPZX.js → shipping-profile-L5CFXVEE.js} +4 -8
- package/dist/{shipping-profiles-2NWKCEJK.js → shipping-profiles-QBJUWXVQ.js} +17 -17
- package/dist/{stock-7CSVEJJU.js → stock-FW4DOVFV.js} +14 -14
- package/dist/{store-X23G3JCJ.js → store-NWWBV2UO.js} +75 -144
- package/dist/{store-closure-P5PD2RSV.js → store-closure-O3CBSOJD.js} +19 -14
- package/dist/{store-select-TREPDS3G.js → store-select-C7GI5MKK.js} +13 -13
- package/dist/{tax-regions-YXZW7UVX.js → tax-regions-2JCIB4T7.js} +2 -2
- package/dist/{team-SPP5OY5W.js → team-MY24J5WO.js} +20 -20
- package/package.json +2 -2
- package/dist/[id]-LTNOHLGE.js +0 -1219
- package/dist/allocate-items-SDFS5GYN.js +0 -533
- package/dist/chunk-432S4FGR.js +0 -0
- package/dist/chunk-AIZM66CG.js +0 -66
- package/dist/chunk-BDZOSMAX.js +0 -23
- package/dist/chunk-CFRWIQIZ.js +0 -43
- package/dist/chunk-GKZHBXZK.js +0 -426
- package/dist/chunk-RXZFEFNV.js +0 -73
- package/dist/chunk-T6LHVNWO.js +0 -27
- package/dist/chunk-WLT7K7K7.js +0 -63
- package/dist/create-FCKGCZSM.js +0 -210
- package/dist/edit-GQNIINRR.js +0 -192
- package/dist/fulfillment-75Z4H23W.js +0 -559
- package/dist/loader-FBB5OQRT.js +0 -31
- package/dist/metadata-5BPOBBU2.js +0 -45
- package/dist/offer-detail-page-6MAHNNIO.js +0 -488
- package/dist/offer-edit-page-DYQFU6JU.js +0 -151
- package/dist/offers-ZG6OTDZ2.js +0 -32
- package/dist/product-variant-detail-RVWEYVPC.js +0 -220
- package/dist/shipment-Q33QBMXX.js +0 -176
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ProductTypeListPage
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-6QS6IZC6.js";
|
|
4
4
|
import "./chunk-MWQQVKRU.js";
|
|
5
5
|
import "./chunk-EBZ5VZEO.js";
|
|
6
6
|
import "./chunk-VOHEQ7B5.js";
|
|
7
7
|
import "./chunk-JHIMVLB2.js";
|
|
8
8
|
import "./chunk-2ZFELO2L.js";
|
|
9
|
-
import "./chunk-26OOAKQ6.js";
|
|
10
9
|
import "./chunk-SYNUA6LQ.js";
|
|
11
10
|
import "./chunk-FQERBIVS.js";
|
|
12
11
|
import "./chunk-PHOCVOZ5.js";
|
|
13
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-26OOAKQ6.js";
|
|
13
|
+
import "./chunk-WKRW5OPL.js";
|
|
14
14
|
import "./chunk-YN3FGNJM.js";
|
|
15
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-KCHYLLVG.js";
|
|
16
16
|
import "./chunk-3EF54XFY.js";
|
|
17
17
|
import "./chunk-YV6MK4PZ.js";
|
|
18
|
-
import "./chunk-LRD242C7.js";
|
|
19
|
-
import "./chunk-QHQWEERJ.js";
|
|
20
18
|
import "./chunk-THHRRYRS.js";
|
|
19
|
+
import "./chunk-LRD242C7.js";
|
|
21
20
|
import "./chunk-INNFZYX2.js";
|
|
22
21
|
import "./chunk-VV6IKGCN.js";
|
|
23
22
|
import "./chunk-BDGZ4EQO.js";
|
|
24
23
|
import "./chunk-LAVHRER2.js";
|
|
24
|
+
import "./chunk-QHQWEERJ.js";
|
|
25
25
|
import "./chunk-Y7QKP6QU.js";
|
|
26
26
|
import "./chunk-A5DJIOHN.js";
|
|
27
27
|
import "./chunk-RHKRREUU.js";
|
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
import {
|
|
2
|
+
VARIANT_DETAIL_FIELDS,
|
|
3
|
+
variantLoader
|
|
4
|
+
} from "./chunk-3EDZQSKG.js";
|
|
5
|
+
import {
|
|
6
|
+
SectionRow
|
|
7
|
+
} from "./chunk-4TLP3TAA.js";
|
|
8
|
+
import {
|
|
9
|
+
SingleColumnPage
|
|
10
|
+
} from "./chunk-YV6MK4PZ.js";
|
|
11
|
+
import {
|
|
12
|
+
TwoColumnPageSkeleton
|
|
13
|
+
} from "./chunk-INNFZYX2.js";
|
|
14
|
+
import "./chunk-KZYRC3WR.js";
|
|
15
|
+
import "./chunk-F4OJN2F2.js";
|
|
16
|
+
import "./chunk-LRARA622.js";
|
|
17
|
+
import "./chunk-M6N4ISXL.js";
|
|
18
|
+
import "./chunk-S7EKBD2C.js";
|
|
19
|
+
import "./chunk-VV6IKGCN.js";
|
|
20
|
+
import "./chunk-M3YUT5AY.js";
|
|
21
|
+
import "./chunk-BOZJOOGW.js";
|
|
22
|
+
import "./chunk-IQWK723D.js";
|
|
23
|
+
import "./chunk-4S6XGIC6.js";
|
|
24
|
+
import "./chunk-S23FD6FA.js";
|
|
25
|
+
import "./chunk-7FIPNQM2.js";
|
|
26
|
+
import "./chunk-LTQQRVZG.js";
|
|
27
|
+
import "./chunk-VXWN37PT.js";
|
|
28
|
+
import "./chunk-247L47JD.js";
|
|
29
|
+
import "./chunk-POOTMH3K.js";
|
|
30
|
+
import "./chunk-VXMOPVRH.js";
|
|
31
|
+
import "./chunk-NBPMNUKZ.js";
|
|
32
|
+
import "./chunk-4R5GESED.js";
|
|
33
|
+
import "./chunk-7RGUD6PI.js";
|
|
34
|
+
import "./chunk-3B34B2M2.js";
|
|
35
|
+
import {
|
|
36
|
+
ActionMenu
|
|
37
|
+
} from "./chunk-BDGZ4EQO.js";
|
|
38
|
+
import "./chunk-LAVHRER2.js";
|
|
39
|
+
import "./chunk-Y7QKP6QU.js";
|
|
40
|
+
import {
|
|
41
|
+
useDeleteVariant,
|
|
42
|
+
useProductVariant,
|
|
43
|
+
useUpdateProductVariant
|
|
44
|
+
} from "./chunk-TSTUAL6N.js";
|
|
45
|
+
import "./chunk-A5DJIOHN.js";
|
|
46
|
+
import "./chunk-RHKRREUU.js";
|
|
47
|
+
import "./chunk-ZA2KFUFR.js";
|
|
48
|
+
import "./chunk-RIN4CBRB.js";
|
|
49
|
+
import "./chunk-NBMM2TZK.js";
|
|
50
|
+
|
|
51
|
+
// src/pages/product-variants/product-variant-detail/breadcrumb.tsx
|
|
52
|
+
import { jsx } from "react/jsx-runtime";
|
|
53
|
+
var ProductVariantDetailBreadcrumb = (props) => {
|
|
54
|
+
const { product_id, variant_id } = props.params || {};
|
|
55
|
+
const { variant } = useProductVariant(
|
|
56
|
+
product_id,
|
|
57
|
+
variant_id,
|
|
58
|
+
{},
|
|
59
|
+
{
|
|
60
|
+
initialData: props.data,
|
|
61
|
+
enabled: Boolean(product_id) && Boolean(variant_id)
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
if (!variant) {
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
return /* @__PURE__ */ jsx("span", { children: variant.title });
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
// src/pages/product-variants/product-variant-detail/product-variant-detail.tsx
|
|
71
|
+
import { Children } from "react";
|
|
72
|
+
import { useLoaderData, useParams } from "react-router-dom";
|
|
73
|
+
|
|
74
|
+
// src/pages/product-variants/product-variant-detail/components/variant-general-section/variant-general-section.tsx
|
|
75
|
+
import { Component, PencilSquare, Trash } from "@medusajs/icons";
|
|
76
|
+
import { Badge, Container, Heading, usePrompt } from "@medusajs/ui";
|
|
77
|
+
import { useTranslation } from "react-i18next";
|
|
78
|
+
import { useNavigate } from "react-router-dom";
|
|
79
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
80
|
+
function VariantGeneralSection({
|
|
81
|
+
variant
|
|
82
|
+
}) {
|
|
83
|
+
const { t } = useTranslation();
|
|
84
|
+
const prompt = usePrompt();
|
|
85
|
+
const navigate = useNavigate();
|
|
86
|
+
const hasInventoryKit = (variant.inventory_items?.length ?? 0) > 1;
|
|
87
|
+
const { mutateAsync } = useDeleteVariant(variant.product_id, variant.id);
|
|
88
|
+
const handleDelete = async () => {
|
|
89
|
+
const res = await prompt({
|
|
90
|
+
title: t("general.areYouSure"),
|
|
91
|
+
description: t("products.variant.deleteWarning", {
|
|
92
|
+
title: variant.title
|
|
93
|
+
}),
|
|
94
|
+
confirmText: t("actions.delete"),
|
|
95
|
+
cancelText: t("actions.cancel")
|
|
96
|
+
});
|
|
97
|
+
if (!res) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
await mutateAsync(void 0, {
|
|
101
|
+
onSuccess: () => {
|
|
102
|
+
navigate("..", { replace: true });
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
};
|
|
106
|
+
return /* @__PURE__ */ jsxs(Container, { className: "divide-y p-0", children: [
|
|
107
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
108
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
109
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
110
|
+
/* @__PURE__ */ jsx2(Heading, { children: variant.title }),
|
|
111
|
+
hasInventoryKit && /* @__PURE__ */ jsx2("span", { className: "text-ui-fg-muted font-normal", children: /* @__PURE__ */ jsx2(Component, {}) })
|
|
112
|
+
] }),
|
|
113
|
+
/* @__PURE__ */ jsx2("span", { className: "text-ui-fg-subtle txt-small mt-2", children: t("labels.productVariant") })
|
|
114
|
+
] }),
|
|
115
|
+
/* @__PURE__ */ jsx2("div", { className: "flex items-center gap-x-4", children: /* @__PURE__ */ jsx2(
|
|
116
|
+
ActionMenu,
|
|
117
|
+
{
|
|
118
|
+
groups: [
|
|
119
|
+
{
|
|
120
|
+
actions: [
|
|
121
|
+
{
|
|
122
|
+
label: t("actions.edit"),
|
|
123
|
+
to: "edit",
|
|
124
|
+
icon: /* @__PURE__ */ jsx2(PencilSquare, {})
|
|
125
|
+
}
|
|
126
|
+
]
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
actions: [
|
|
130
|
+
{
|
|
131
|
+
label: t("actions.delete"),
|
|
132
|
+
onClick: handleDelete,
|
|
133
|
+
icon: /* @__PURE__ */ jsx2(Trash, {})
|
|
134
|
+
}
|
|
135
|
+
]
|
|
136
|
+
}
|
|
137
|
+
]
|
|
138
|
+
}
|
|
139
|
+
) })
|
|
140
|
+
] }),
|
|
141
|
+
/* @__PURE__ */ jsx2(SectionRow, { title: t("fields.sku"), value: variant.sku }),
|
|
142
|
+
(variant.options ?? []).map((opt) => {
|
|
143
|
+
const title = opt.option?.title;
|
|
144
|
+
if (!title || !opt.value) return null;
|
|
145
|
+
return /* @__PURE__ */ jsx2(
|
|
146
|
+
SectionRow,
|
|
147
|
+
{
|
|
148
|
+
title,
|
|
149
|
+
value: /* @__PURE__ */ jsx2("div", { className: "flex flex-wrap items-center gap-1", children: /* @__PURE__ */ jsx2(Badge, { size: "2xsmall", children: opt.value }) })
|
|
150
|
+
},
|
|
151
|
+
opt.id
|
|
152
|
+
);
|
|
153
|
+
})
|
|
154
|
+
] });
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// src/pages/product-variants/product-variant-detail/components/variant-media-section/variant-media-section.tsx
|
|
158
|
+
import { useState } from "react";
|
|
159
|
+
import { PencilSquare as PencilSquare2, ThumbnailBadge } from "@medusajs/icons";
|
|
160
|
+
import {
|
|
161
|
+
Button,
|
|
162
|
+
Checkbox,
|
|
163
|
+
clx,
|
|
164
|
+
CommandBar,
|
|
165
|
+
Container as Container2,
|
|
166
|
+
Heading as Heading2,
|
|
167
|
+
Text,
|
|
168
|
+
toast,
|
|
169
|
+
Tooltip,
|
|
170
|
+
usePrompt as usePrompt2
|
|
171
|
+
} from "@medusajs/ui";
|
|
172
|
+
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
173
|
+
import { Link } from "react-router-dom";
|
|
174
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
175
|
+
var getVariantImages = (variant) => (variant.images ?? []).filter(
|
|
176
|
+
(image) => (image.variants ?? []).some((v) => v.id === variant.id)
|
|
177
|
+
);
|
|
178
|
+
var VariantMediaSection = ({
|
|
179
|
+
variant
|
|
180
|
+
}) => {
|
|
181
|
+
const { t } = useTranslation2();
|
|
182
|
+
const prompt = usePrompt2();
|
|
183
|
+
const [selection, setSelection] = useState({});
|
|
184
|
+
const media = getMedia(variant);
|
|
185
|
+
const { mutateAsync } = useUpdateProductVariant(
|
|
186
|
+
variant.product_id,
|
|
187
|
+
variant.id
|
|
188
|
+
);
|
|
189
|
+
const handleCheckedChange = (id) => {
|
|
190
|
+
setSelection((prev) => {
|
|
191
|
+
if (prev[id]) {
|
|
192
|
+
const { [id]: _, ...rest } = prev;
|
|
193
|
+
return rest;
|
|
194
|
+
}
|
|
195
|
+
return { ...prev, [id]: true };
|
|
196
|
+
});
|
|
197
|
+
};
|
|
198
|
+
const handleDelete = async () => {
|
|
199
|
+
const ids = Object.keys(selection);
|
|
200
|
+
const includingThumbnail = ids.some(
|
|
201
|
+
(id) => media.find((m) => m.id === id)?.isThumbnail
|
|
202
|
+
);
|
|
203
|
+
const res = await prompt({
|
|
204
|
+
title: t("general.areYouSure"),
|
|
205
|
+
description: includingThumbnail ? t("products.media.deleteWarningWithThumbnail", { count: ids.length }) : t("products.media.deleteWarning", { count: ids.length }),
|
|
206
|
+
confirmText: t("actions.delete"),
|
|
207
|
+
cancelText: t("actions.cancel")
|
|
208
|
+
});
|
|
209
|
+
if (!res) {
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
const linkedIds = new Set(getVariantImages(variant).map((i) => i.id));
|
|
213
|
+
const remove = ids.filter((id) => linkedIds.has(id));
|
|
214
|
+
await mutateAsync(
|
|
215
|
+
{
|
|
216
|
+
images: { remove },
|
|
217
|
+
thumbnail: includingThumbnail ? "" : void 0
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
onSuccess: () => {
|
|
221
|
+
toast.success(t("products.media.successToast"));
|
|
222
|
+
setSelection({});
|
|
223
|
+
},
|
|
224
|
+
onError: (error) => {
|
|
225
|
+
toast.error(error.message);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
);
|
|
229
|
+
};
|
|
230
|
+
return /* @__PURE__ */ jsxs2(Container2, { className: "divide-y p-0", children: [
|
|
231
|
+
/* @__PURE__ */ jsxs2("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
232
|
+
/* @__PURE__ */ jsx3(Heading2, { level: "h2", children: t("products.media.label") }),
|
|
233
|
+
/* @__PURE__ */ jsx3(
|
|
234
|
+
ActionMenu,
|
|
235
|
+
{
|
|
236
|
+
groups: [
|
|
237
|
+
{
|
|
238
|
+
actions: [
|
|
239
|
+
{
|
|
240
|
+
label: t("actions.edit"),
|
|
241
|
+
to: "media",
|
|
242
|
+
icon: /* @__PURE__ */ jsx3(PencilSquare2, {})
|
|
243
|
+
}
|
|
244
|
+
]
|
|
245
|
+
}
|
|
246
|
+
]
|
|
247
|
+
}
|
|
248
|
+
)
|
|
249
|
+
] }),
|
|
250
|
+
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((image) => {
|
|
251
|
+
const isSelected = selection[image.id];
|
|
252
|
+
return /* @__PURE__ */ jsxs2(
|
|
253
|
+
"div",
|
|
254
|
+
{
|
|
255
|
+
className: "group shadow-elevation-card-rest hover:shadow-elevation-card-hover transition-fg relative aspect-square size-full cursor-pointer overflow-hidden rounded-[8px]",
|
|
256
|
+
children: [
|
|
257
|
+
/* @__PURE__ */ jsx3(
|
|
258
|
+
"div",
|
|
259
|
+
{
|
|
260
|
+
className: clx(
|
|
261
|
+
"transition-fg invisible absolute right-2 top-2 opacity-0 group-hover:visible group-hover:opacity-100",
|
|
262
|
+
{
|
|
263
|
+
"visible opacity-100": isSelected
|
|
264
|
+
}
|
|
265
|
+
),
|
|
266
|
+
children: /* @__PURE__ */ jsx3(
|
|
267
|
+
Checkbox,
|
|
268
|
+
{
|
|
269
|
+
checked: selection[image.id] || false,
|
|
270
|
+
onCheckedChange: () => handleCheckedChange(image.id)
|
|
271
|
+
}
|
|
272
|
+
)
|
|
273
|
+
}
|
|
274
|
+
),
|
|
275
|
+
image.isThumbnail && /* @__PURE__ */ jsx3("div", { className: "absolute left-2 top-2", children: /* @__PURE__ */ jsx3(Tooltip, { content: t("fields.thumbnail"), children: /* @__PURE__ */ jsx3(ThumbnailBadge, {}) }) }),
|
|
276
|
+
/* @__PURE__ */ jsx3(Link, { to: "media", children: /* @__PURE__ */ jsx3(
|
|
277
|
+
"img",
|
|
278
|
+
{
|
|
279
|
+
src: image.url,
|
|
280
|
+
alt: variant.title ?? "",
|
|
281
|
+
className: "size-full object-cover"
|
|
282
|
+
}
|
|
283
|
+
) })
|
|
284
|
+
]
|
|
285
|
+
},
|
|
286
|
+
image.id
|
|
287
|
+
);
|
|
288
|
+
}) }) : /* @__PURE__ */ jsxs2("div", { className: "flex flex-col items-center gap-y-4 pb-8 pt-6", children: [
|
|
289
|
+
/* @__PURE__ */ jsxs2("div", { className: "flex flex-col items-center", children: [
|
|
290
|
+
/* @__PURE__ */ jsx3(
|
|
291
|
+
Text,
|
|
292
|
+
{
|
|
293
|
+
size: "small",
|
|
294
|
+
leading: "compact",
|
|
295
|
+
weight: "plus",
|
|
296
|
+
className: "text-ui-fg-subtle",
|
|
297
|
+
children: t("products.media.emptyState.header")
|
|
298
|
+
}
|
|
299
|
+
),
|
|
300
|
+
/* @__PURE__ */ jsx3(Text, { size: "small", className: "text-ui-fg-muted", children: t("products.media.emptyState.description") })
|
|
301
|
+
] }),
|
|
302
|
+
/* @__PURE__ */ jsx3(Button, { size: "small", variant: "secondary", asChild: true, children: /* @__PURE__ */ jsx3(Link, { to: "media", children: t("products.media.emptyState.action") }) })
|
|
303
|
+
] }),
|
|
304
|
+
/* @__PURE__ */ jsx3(CommandBar, { open: !!Object.keys(selection).length, children: /* @__PURE__ */ jsxs2(CommandBar.Bar, { children: [
|
|
305
|
+
/* @__PURE__ */ jsx3(CommandBar.Value, { children: t("general.countSelected", {
|
|
306
|
+
count: Object.keys(selection).length
|
|
307
|
+
}) }),
|
|
308
|
+
/* @__PURE__ */ jsx3(CommandBar.Seperator, {}),
|
|
309
|
+
/* @__PURE__ */ jsx3(
|
|
310
|
+
CommandBar.Command,
|
|
311
|
+
{
|
|
312
|
+
action: handleDelete,
|
|
313
|
+
label: t("actions.delete"),
|
|
314
|
+
shortcut: "d"
|
|
315
|
+
}
|
|
316
|
+
)
|
|
317
|
+
] }) })
|
|
318
|
+
] });
|
|
319
|
+
};
|
|
320
|
+
var getMedia = (variant) => {
|
|
321
|
+
const { thumbnail } = variant;
|
|
322
|
+
const media = getVariantImages(variant).map((image) => ({
|
|
323
|
+
id: image.id,
|
|
324
|
+
url: image.url,
|
|
325
|
+
isThumbnail: image.url === thumbnail
|
|
326
|
+
}));
|
|
327
|
+
if (thumbnail && !media.some((m) => m.url === thumbnail)) {
|
|
328
|
+
media.unshift({
|
|
329
|
+
id: "img_thumbnail",
|
|
330
|
+
url: thumbnail,
|
|
331
|
+
isThumbnail: true
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
return media;
|
|
335
|
+
};
|
|
336
|
+
|
|
337
|
+
// src/pages/product-variants/product-variant-detail/product-variant-detail.tsx
|
|
338
|
+
import { Fragment, jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
339
|
+
var Root = ({ children }) => {
|
|
340
|
+
const initialData = useLoaderData();
|
|
341
|
+
const { product_id, variant_id } = useParams();
|
|
342
|
+
const { variant, isLoading, isError, error } = useProductVariant(
|
|
343
|
+
product_id,
|
|
344
|
+
variant_id,
|
|
345
|
+
{ fields: VARIANT_DETAIL_FIELDS },
|
|
346
|
+
{
|
|
347
|
+
initialData
|
|
348
|
+
}
|
|
349
|
+
);
|
|
350
|
+
if (isLoading || !variant) {
|
|
351
|
+
return /* @__PURE__ */ jsx4(TwoColumnPageSkeleton, { mainSections: 2, sidebarSections: 0 });
|
|
352
|
+
}
|
|
353
|
+
if (isError) {
|
|
354
|
+
throw error;
|
|
355
|
+
}
|
|
356
|
+
return /* @__PURE__ */ jsx4(SingleColumnPage, { data: variant, hasOutlet: true, children: Children.count(children) > 0 ? children : /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
357
|
+
/* @__PURE__ */ jsx4(VariantGeneralSection, { variant }),
|
|
358
|
+
/* @__PURE__ */ jsx4(VariantMediaSection, { variant })
|
|
359
|
+
] }) });
|
|
360
|
+
};
|
|
361
|
+
var ProductVariantDetail = Object.assign(Root, {
|
|
362
|
+
GeneralSection: VariantGeneralSection,
|
|
363
|
+
MediaSection: VariantMediaSection
|
|
364
|
+
});
|
|
365
|
+
export {
|
|
366
|
+
ProductVariantDetailBreadcrumb as Breadcrumb,
|
|
367
|
+
ProductVariantDetail as Component,
|
|
368
|
+
variantLoader as loader
|
|
369
|
+
};
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from "./chunk-7CAFYKKA.js";
|
|
9
9
|
import {
|
|
10
10
|
AttributeValueInput
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-P3SOE76R.js";
|
|
12
12
|
import "./chunk-JRTZWK77.js";
|
|
13
13
|
import {
|
|
14
14
|
optionalInt
|
|
@@ -18,7 +18,7 @@ import "./chunk-VBRTC2VU.js";
|
|
|
18
18
|
import "./chunk-TKGWSUEI.js";
|
|
19
19
|
import {
|
|
20
20
|
KeyboundForm
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-SITRHMZZ.js";
|
|
22
22
|
import {
|
|
23
23
|
RouteDrawer,
|
|
24
24
|
useRouteModal
|
|
@@ -28,13 +28,13 @@ import {
|
|
|
28
28
|
} from "./chunk-3QSRE5LS.js";
|
|
29
29
|
import {
|
|
30
30
|
require_dist
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-6FLSBL4Q.js";
|
|
32
32
|
import {
|
|
33
33
|
useProduct,
|
|
34
34
|
useProductVariant,
|
|
35
35
|
useUpdateProductVariant,
|
|
36
36
|
variantsQueryKeys
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-TSTUAL6N.js";
|
|
38
38
|
import "./chunk-A5DJIOHN.js";
|
|
39
39
|
import {
|
|
40
40
|
queryClient
|
|
@@ -55,14 +55,15 @@ import { useLoaderData, useParams, useSearchParams } from "react-router-dom";
|
|
|
55
55
|
// src/pages/product-variants/product-variant-edit/components/product-edit-variant-form/product-edit-variant-form.tsx
|
|
56
56
|
var import_types = __toESM(require_dist(), 1);
|
|
57
57
|
import { zodResolver } from "@hookform/resolvers/zod";
|
|
58
|
-
import {
|
|
58
|
+
import { InformationCircleSolid } from "@medusajs/icons";
|
|
59
|
+
import { Button, Divider, Heading, Input, Tooltip, toast } from "@medusajs/ui";
|
|
60
|
+
import i18next from "i18next";
|
|
59
61
|
import { useForm } from "react-hook-form";
|
|
60
62
|
import { useTranslation } from "react-i18next";
|
|
61
63
|
import { z } from "zod";
|
|
62
64
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
63
65
|
var ProductEditVariantSchema = z.object({
|
|
64
|
-
title: z.string().min(1),
|
|
65
|
-
material: z.string().optional(),
|
|
66
|
+
title: z.string().min(1, i18next.t("products.variant.validation.titleRequired")),
|
|
66
67
|
sku: z.string().optional(),
|
|
67
68
|
ean: z.string().optional(),
|
|
68
69
|
upc: z.string().optional(),
|
|
@@ -74,7 +75,7 @@ var ProductEditVariantSchema = z.object({
|
|
|
74
75
|
mid_code: z.string().optional(),
|
|
75
76
|
hs_code: z.string().optional(),
|
|
76
77
|
origin_country: z.string().optional(),
|
|
77
|
-
|
|
78
|
+
options: z.record(z.string().min(1, i18next.t("products.variant.validation.optionRequired"))).optional()
|
|
78
79
|
});
|
|
79
80
|
var ProductEditVariantForm = ({
|
|
80
81
|
variant,
|
|
@@ -83,19 +84,20 @@ var ProductEditVariantForm = ({
|
|
|
83
84
|
const { t } = useTranslation();
|
|
84
85
|
const { handleSuccess } = useRouteModal();
|
|
85
86
|
const variantAttributes = product.attributes?.filter((a) => a.is_variant_axis) ?? [];
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
87
|
+
const defaultOptions = variantAttributes.reduce(
|
|
88
|
+
(acc, attribute) => {
|
|
89
|
+
const key = attribute.handle ?? attribute.id;
|
|
90
|
+
const matched = variant.options?.find(
|
|
91
|
+
(o) => o.option?.title === attribute.name
|
|
92
|
+
);
|
|
93
|
+
acc[key] = matched?.value ?? "";
|
|
94
|
+
return acc;
|
|
95
|
+
},
|
|
96
|
+
{}
|
|
97
|
+
);
|
|
95
98
|
const form = useForm({
|
|
96
99
|
defaultValues: {
|
|
97
100
|
title: variant.title || "",
|
|
98
|
-
material: variant.material || "",
|
|
99
101
|
sku: variant.sku || "",
|
|
100
102
|
ean: variant.ean || "",
|
|
101
103
|
upc: variant.upc || "",
|
|
@@ -107,7 +109,7 @@ var ProductEditVariantForm = ({
|
|
|
107
109
|
mid_code: variant.mid_code || "",
|
|
108
110
|
hs_code: variant.hs_code || "",
|
|
109
111
|
origin_country: variant.origin_country || "",
|
|
110
|
-
|
|
112
|
+
options: defaultOptions
|
|
111
113
|
},
|
|
112
114
|
resolver: zodResolver(ProductEditVariantSchema)
|
|
113
115
|
});
|
|
@@ -122,14 +124,18 @@ var ProductEditVariantForm = ({
|
|
|
122
124
|
height,
|
|
123
125
|
width,
|
|
124
126
|
length,
|
|
125
|
-
|
|
127
|
+
options,
|
|
126
128
|
...optional
|
|
127
129
|
} = data;
|
|
128
130
|
const nullableData = transformNullableFormData(optional);
|
|
129
|
-
const
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
131
|
+
const cleanedOptions = variantAttributes.reduce(
|
|
132
|
+
(acc, attr) => {
|
|
133
|
+
const fieldKey = attr.handle ?? attr.id;
|
|
134
|
+
const v = options?.[fieldKey];
|
|
135
|
+
if (v && attr.name) acc[attr.name] = v;
|
|
136
|
+
return acc;
|
|
137
|
+
},
|
|
138
|
+
{}
|
|
133
139
|
);
|
|
134
140
|
await mutateAsync(
|
|
135
141
|
{
|
|
@@ -138,7 +144,7 @@ var ProductEditVariantForm = ({
|
|
|
138
144
|
width: transformNullableFormNumber(width),
|
|
139
145
|
length: transformNullableFormNumber(length),
|
|
140
146
|
title,
|
|
141
|
-
|
|
147
|
+
options: Object.keys(cleanedOptions).length ? cleanedOptions : void 0,
|
|
142
148
|
...nullableData
|
|
143
149
|
},
|
|
144
150
|
{
|
|
@@ -174,27 +180,13 @@ var ProductEditVariantForm = ({
|
|
|
174
180
|
}
|
|
175
181
|
}
|
|
176
182
|
),
|
|
177
|
-
/* @__PURE__ */ jsx(
|
|
178
|
-
Form.Field,
|
|
179
|
-
{
|
|
180
|
-
control: form.control,
|
|
181
|
-
name: "material",
|
|
182
|
-
render: ({ field }) => {
|
|
183
|
-
return /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
184
|
-
/* @__PURE__ */ jsx(Form.Label, { optional: true, children: t("fields.material") }),
|
|
185
|
-
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
|
|
186
|
-
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
187
|
-
] });
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
),
|
|
191
183
|
variantAttributes.map((attribute) => {
|
|
192
184
|
const fieldKey = attribute.handle ?? attribute.id;
|
|
193
185
|
return /* @__PURE__ */ jsx(
|
|
194
186
|
Form.Field,
|
|
195
187
|
{
|
|
196
188
|
control: form.control,
|
|
197
|
-
name: `
|
|
189
|
+
name: `options.${fieldKey}`,
|
|
198
190
|
render: ({ field: { value, onChange } }) => {
|
|
199
191
|
return /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
200
192
|
/* @__PURE__ */ jsx(Form.Label, { children: attribute.name }),
|
|
@@ -281,7 +273,10 @@ var ProductEditVariantForm = ({
|
|
|
281
273
|
] }) }),
|
|
282
274
|
/* @__PURE__ */ jsx(Divider, {}),
|
|
283
275
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-y-4", children: [
|
|
284
|
-
/* @__PURE__ */
|
|
276
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-x-1", children: [
|
|
277
|
+
/* @__PURE__ */ jsx(Heading, { level: "h2", children: t("products.attributes") }),
|
|
278
|
+
/* @__PURE__ */ jsx(Tooltip, { content: t("products.variant.edit.attributesTooltip"), children: /* @__PURE__ */ jsx(InformationCircleSolid, { className: "text-ui-fg-muted" }) })
|
|
279
|
+
] }),
|
|
285
280
|
/* @__PURE__ */ jsx(
|
|
286
281
|
Form.Field,
|
|
287
282
|
{
|
|
@@ -403,7 +398,7 @@ var ProductVariantEdit = () => {
|
|
|
403
398
|
const { variant, isPending, isError, error } = useProductVariant(
|
|
404
399
|
productId,
|
|
405
400
|
variant_id || searchVariantId,
|
|
406
|
-
|
|
401
|
+
{ fields: "*options,*options.option" },
|
|
407
402
|
{
|
|
408
403
|
initialData
|
|
409
404
|
}
|
|
@@ -436,14 +431,16 @@ var ProductVariantEdit = () => {
|
|
|
436
431
|
};
|
|
437
432
|
|
|
438
433
|
// src/pages/product-variants/product-variant-edit/loader.ts
|
|
434
|
+
var VARIANT_EDIT_FIELDS = "*options,*options.option";
|
|
439
435
|
var queryFn = async (id, variantId) => {
|
|
440
436
|
return await sdk.vendor.products.$id.variants.$variantId.query({
|
|
441
437
|
$id: id,
|
|
442
|
-
$variantId: variantId
|
|
438
|
+
$variantId: variantId,
|
|
439
|
+
fields: VARIANT_EDIT_FIELDS
|
|
443
440
|
});
|
|
444
441
|
};
|
|
445
442
|
var editProductVariantQuery = (id, variantId) => ({
|
|
446
|
-
queryKey: variantsQueryKeys.detail(variantId),
|
|
443
|
+
queryKey: variantsQueryKeys.detail(variantId, { fields: VARIANT_EDIT_FIELDS }),
|
|
447
444
|
queryFn: async () => queryFn(id, variantId)
|
|
448
445
|
});
|
|
449
446
|
var editProductVariantLoader = async ({
|