@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
|
@@ -0,0 +1,590 @@
|
|
|
1
|
+
import {
|
|
2
|
+
OFFER_PRODUCT_DETAIL_FIELDS
|
|
3
|
+
} from "./chunk-XQUF3WIS.js";
|
|
4
|
+
import "./chunk-FQERBIVS.js";
|
|
5
|
+
import {
|
|
6
|
+
PlaceholderCell
|
|
7
|
+
} from "./chunk-PHOCVOZ5.js";
|
|
8
|
+
import {
|
|
9
|
+
_DataTable,
|
|
10
|
+
useDataTable
|
|
11
|
+
} from "./chunk-WKRW5OPL.js";
|
|
12
|
+
import "./chunk-YN3FGNJM.js";
|
|
13
|
+
import "./chunk-KCHYLLVG.js";
|
|
14
|
+
import "./chunk-3EF54XFY.js";
|
|
15
|
+
import {
|
|
16
|
+
ProductMediaSection,
|
|
17
|
+
productStatusColor
|
|
18
|
+
} from "./chunk-I75SROQZ.js";
|
|
19
|
+
import {
|
|
20
|
+
SectionRow
|
|
21
|
+
} from "./chunk-4TLP3TAA.js";
|
|
22
|
+
import {
|
|
23
|
+
TwoColumnPage
|
|
24
|
+
} from "./chunk-YV6MK4PZ.js";
|
|
25
|
+
import {
|
|
26
|
+
useQueryParams
|
|
27
|
+
} from "./chunk-THHRRYRS.js";
|
|
28
|
+
import "./chunk-LRD242C7.js";
|
|
29
|
+
import {
|
|
30
|
+
Thumbnail
|
|
31
|
+
} from "./chunk-WIYFXWRI.js";
|
|
32
|
+
import {
|
|
33
|
+
TwoColumnPageSkeleton
|
|
34
|
+
} from "./chunk-INNFZYX2.js";
|
|
35
|
+
import {
|
|
36
|
+
useBulkDeleteOffers
|
|
37
|
+
} from "./chunk-4R5GESED.js";
|
|
38
|
+
import {
|
|
39
|
+
ActionMenu
|
|
40
|
+
} from "./chunk-BDGZ4EQO.js";
|
|
41
|
+
import "./chunk-LAVHRER2.js";
|
|
42
|
+
import "./chunk-QHQWEERJ.js";
|
|
43
|
+
import "./chunk-Y7QKP6QU.js";
|
|
44
|
+
import {
|
|
45
|
+
useProduct
|
|
46
|
+
} from "./chunk-TSTUAL6N.js";
|
|
47
|
+
import "./chunk-A5DJIOHN.js";
|
|
48
|
+
import "./chunk-RHKRREUU.js";
|
|
49
|
+
import "./chunk-ZA2KFUFR.js";
|
|
50
|
+
import "./chunk-RIN4CBRB.js";
|
|
51
|
+
import "./chunk-NBMM2TZK.js";
|
|
52
|
+
|
|
53
|
+
// src/pages/offers/[id]/offer-detail-page.tsx
|
|
54
|
+
import { Children } from "react";
|
|
55
|
+
import { useLoaderData, useParams } from "react-router-dom";
|
|
56
|
+
|
|
57
|
+
// src/pages/offers/[id]/_components/offer-detail-general-section.tsx
|
|
58
|
+
import { Trash } from "@medusajs/icons";
|
|
59
|
+
import { Container, Heading, StatusBadge, toast, usePrompt } from "@medusajs/ui";
|
|
60
|
+
import { useTranslation } from "react-i18next";
|
|
61
|
+
import { useNavigate } from "react-router-dom";
|
|
62
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
63
|
+
var OfferDetailGeneralSection = ({
|
|
64
|
+
product
|
|
65
|
+
}) => {
|
|
66
|
+
const { t } = useTranslation();
|
|
67
|
+
const prompt = usePrompt();
|
|
68
|
+
const navigate = useNavigate();
|
|
69
|
+
const { mutateAsync: bulkDelete } = useBulkDeleteOffers();
|
|
70
|
+
const offerIds = (product.variants ?? []).flatMap(
|
|
71
|
+
(v) => (v.offers ?? []).map((o) => o.id)
|
|
72
|
+
);
|
|
73
|
+
const handleDelete = async () => {
|
|
74
|
+
if (!offerIds.length) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
const confirmed = await prompt({
|
|
78
|
+
title: t("general.areYouSure"),
|
|
79
|
+
// The product listing is one offer to the seller, regardless of how
|
|
80
|
+
// many of its variants are offered under the hood.
|
|
81
|
+
description: t("offers.bulkDelete.description", { count: 1 }),
|
|
82
|
+
confirmText: t("actions.delete"),
|
|
83
|
+
cancelText: t("actions.cancel"),
|
|
84
|
+
variant: "danger"
|
|
85
|
+
});
|
|
86
|
+
if (!confirmed) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
const result = await bulkDelete(offerIds);
|
|
90
|
+
if (result.failed.length === 0) {
|
|
91
|
+
toast.success(t("offers.bulkDelete.successToast", { count: 1 }));
|
|
92
|
+
navigate("/offers");
|
|
93
|
+
} else {
|
|
94
|
+
toast.warning(
|
|
95
|
+
t("offers.bulkDelete.partialToast", {
|
|
96
|
+
succeeded: result.succeeded.length,
|
|
97
|
+
total: offerIds.length,
|
|
98
|
+
failed: result.failed.length
|
|
99
|
+
})
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
return /* @__PURE__ */ jsxs(Container, { className: "divide-y p-0", children: [
|
|
104
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
105
|
+
/* @__PURE__ */ jsx(Heading, { children: product.title }),
|
|
106
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-x-4", children: [
|
|
107
|
+
product.status && /* @__PURE__ */ jsx(StatusBadge, { color: productStatusColor(product.status), children: t(`products.productStatus.${product.status}`) }),
|
|
108
|
+
/* @__PURE__ */ jsx(
|
|
109
|
+
ActionMenu,
|
|
110
|
+
{
|
|
111
|
+
groups: [
|
|
112
|
+
{
|
|
113
|
+
actions: [
|
|
114
|
+
{
|
|
115
|
+
label: t("actions.delete"),
|
|
116
|
+
onClick: handleDelete,
|
|
117
|
+
icon: /* @__PURE__ */ jsx(Trash, {}),
|
|
118
|
+
disabled: offerIds.length === 0
|
|
119
|
+
}
|
|
120
|
+
]
|
|
121
|
+
}
|
|
122
|
+
]
|
|
123
|
+
}
|
|
124
|
+
)
|
|
125
|
+
] })
|
|
126
|
+
] }),
|
|
127
|
+
/* @__PURE__ */ jsx(
|
|
128
|
+
SectionRow,
|
|
129
|
+
{
|
|
130
|
+
title: t("fields.description"),
|
|
131
|
+
value: product.description || "-"
|
|
132
|
+
}
|
|
133
|
+
),
|
|
134
|
+
/* @__PURE__ */ jsx(SectionRow, { title: t("fields.subtitle"), value: product.subtitle || "-" }),
|
|
135
|
+
/* @__PURE__ */ jsx(
|
|
136
|
+
SectionRow,
|
|
137
|
+
{
|
|
138
|
+
title: t("fields.handle"),
|
|
139
|
+
value: product.handle ? `/${product.handle}` : "-"
|
|
140
|
+
}
|
|
141
|
+
),
|
|
142
|
+
/* @__PURE__ */ jsx(
|
|
143
|
+
SectionRow,
|
|
144
|
+
{
|
|
145
|
+
title: t("fields.discountable"),
|
|
146
|
+
value: product.discountable ? t("general.true") : t("general.false")
|
|
147
|
+
}
|
|
148
|
+
)
|
|
149
|
+
] });
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
// src/pages/offers/[id]/_components/offer-variants-section.tsx
|
|
153
|
+
import { Buildings, Component, CurrencyDollar, PencilSquare, Trash as Trash2 } from "@medusajs/icons";
|
|
154
|
+
import {
|
|
155
|
+
Badge,
|
|
156
|
+
clx,
|
|
157
|
+
Container as Container2,
|
|
158
|
+
Heading as Heading2,
|
|
159
|
+
toast as toast2,
|
|
160
|
+
Tooltip,
|
|
161
|
+
usePrompt as usePrompt2
|
|
162
|
+
} from "@medusajs/ui";
|
|
163
|
+
import { createColumnHelper } from "@tanstack/react-table";
|
|
164
|
+
import { useCallback, useMemo } from "react";
|
|
165
|
+
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
166
|
+
import { useNavigate as useNavigate2 } from "react-router-dom";
|
|
167
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
168
|
+
var PAGE_SIZE = 10;
|
|
169
|
+
var PREFIX = "ov";
|
|
170
|
+
var skuOf = (row) => row.offer.sku ?? row.variant.sku ?? "";
|
|
171
|
+
var inventoryItemIdOf = (offer) => offer.inventory_item_link?.find((link) => link.inventory_item?.id)?.inventory_item?.id ?? null;
|
|
172
|
+
var inventoryOf = (offer) => {
|
|
173
|
+
const links = offer.inventory_item_link ?? [];
|
|
174
|
+
let available = 0;
|
|
175
|
+
const locations = /* @__PURE__ */ new Set();
|
|
176
|
+
for (const link of links) {
|
|
177
|
+
for (const level of link.inventory_item?.location_levels ?? []) {
|
|
178
|
+
available += level.stocked_quantity ?? 0;
|
|
179
|
+
if (level.location_id) {
|
|
180
|
+
locations.add(level.location_id);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
return {
|
|
185
|
+
hasItems: links.length > 0,
|
|
186
|
+
// More than one backing inventory item ⇒ the offer is an inventory
|
|
187
|
+
// kit; the table marks it with a Component glyph (Figma `40016500:749885`).
|
|
188
|
+
isKit: links.length > 1,
|
|
189
|
+
available,
|
|
190
|
+
locationCount: locations.size
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
var matchesDateFilter = (value, filter) => {
|
|
194
|
+
if (!value) {
|
|
195
|
+
return false;
|
|
196
|
+
}
|
|
197
|
+
const time = new Date(value).getTime();
|
|
198
|
+
if (Number.isNaN(time)) {
|
|
199
|
+
return false;
|
|
200
|
+
}
|
|
201
|
+
if (filter.$gte && time < new Date(filter.$gte).getTime()) {
|
|
202
|
+
return false;
|
|
203
|
+
}
|
|
204
|
+
if (filter.$lte && time > new Date(filter.$lte).getTime()) {
|
|
205
|
+
return false;
|
|
206
|
+
}
|
|
207
|
+
return true;
|
|
208
|
+
};
|
|
209
|
+
var columnHelper = createColumnHelper();
|
|
210
|
+
var useColumns = ({
|
|
211
|
+
optionTitles,
|
|
212
|
+
thumbnail,
|
|
213
|
+
onEdit,
|
|
214
|
+
onDelete
|
|
215
|
+
}) => {
|
|
216
|
+
const { t } = useTranslation2();
|
|
217
|
+
return useMemo(
|
|
218
|
+
() => [
|
|
219
|
+
// Thumbnail lives inside the Title cell (Figma `40016500:747487`), so
|
|
220
|
+
// the "Title" header sits at the left edge rather than over an empty
|
|
221
|
+
// leading column.
|
|
222
|
+
columnHelper.accessor((row) => row.variant.title ?? "", {
|
|
223
|
+
id: "title",
|
|
224
|
+
header: t("fields.title"),
|
|
225
|
+
cell: ({ getValue }) => /* @__PURE__ */ jsxs2("div", { className: "flex h-full w-full max-w-[250px] items-center gap-x-3 overflow-hidden", children: [
|
|
226
|
+
/* @__PURE__ */ jsx2("div", { className: "w-fit flex-shrink-0", children: /* @__PURE__ */ jsx2(Thumbnail, { src: thumbnail ?? null }) }),
|
|
227
|
+
getValue() ? /* @__PURE__ */ jsx2("span", { title: getValue(), className: "truncate", children: getValue() }) : /* @__PURE__ */ jsx2("span", { className: "text-ui-fg-muted", children: "-" })
|
|
228
|
+
] })
|
|
229
|
+
}),
|
|
230
|
+
columnHelper.accessor((row) => skuOf(row), {
|
|
231
|
+
id: "sku",
|
|
232
|
+
header: t("fields.sku"),
|
|
233
|
+
cell: ({ getValue }) => getValue() ? /* @__PURE__ */ jsx2("span", { title: getValue(), className: "truncate", children: getValue() }) : /* @__PURE__ */ jsx2(PlaceholderCell, {})
|
|
234
|
+
}),
|
|
235
|
+
...optionTitles.map(
|
|
236
|
+
(title) => columnHelper.display({
|
|
237
|
+
id: `option-${title}`,
|
|
238
|
+
header: title,
|
|
239
|
+
cell: ({ row }) => {
|
|
240
|
+
const opt = row.original.variant.options?.find(
|
|
241
|
+
(o) => o.option?.title === title
|
|
242
|
+
);
|
|
243
|
+
return opt?.value ? /* @__PURE__ */ jsx2(Badge, { size: "2xsmall", children: opt.value }) : /* @__PURE__ */ jsx2(PlaceholderCell, {});
|
|
244
|
+
}
|
|
245
|
+
})
|
|
246
|
+
),
|
|
247
|
+
columnHelper.display({
|
|
248
|
+
id: "inventory",
|
|
249
|
+
header: t("fields.inventory"),
|
|
250
|
+
cell: ({ row }) => {
|
|
251
|
+
const { hasItems, isKit, available, locationCount } = inventoryOf(
|
|
252
|
+
row.original.offer
|
|
253
|
+
);
|
|
254
|
+
if (!hasItems) {
|
|
255
|
+
return /* @__PURE__ */ jsx2(PlaceholderCell, {});
|
|
256
|
+
}
|
|
257
|
+
const text = t("products.variant.tableItem", {
|
|
258
|
+
availableCount: available,
|
|
259
|
+
locationCount,
|
|
260
|
+
count: locationCount
|
|
261
|
+
});
|
|
262
|
+
return /* @__PURE__ */ jsx2(Tooltip, { content: text, children: /* @__PURE__ */ jsxs2("div", { className: "flex h-full w-full items-center gap-2 overflow-hidden", children: [
|
|
263
|
+
isKit && /* @__PURE__ */ jsx2(Component, { className: "text-ui-fg-subtle" }),
|
|
264
|
+
/* @__PURE__ */ jsx2(
|
|
265
|
+
"span",
|
|
266
|
+
{
|
|
267
|
+
className: clx("truncate", {
|
|
268
|
+
"text-ui-fg-error": available === 0
|
|
269
|
+
}),
|
|
270
|
+
children: text
|
|
271
|
+
}
|
|
272
|
+
)
|
|
273
|
+
] }) });
|
|
274
|
+
}
|
|
275
|
+
}),
|
|
276
|
+
columnHelper.display({
|
|
277
|
+
id: "actions",
|
|
278
|
+
cell: ({ row }) => {
|
|
279
|
+
const inventoryItemId = inventoryItemIdOf(row.original.offer);
|
|
280
|
+
return /* @__PURE__ */ jsx2(
|
|
281
|
+
ActionMenu,
|
|
282
|
+
{
|
|
283
|
+
groups: [
|
|
284
|
+
{
|
|
285
|
+
actions: [
|
|
286
|
+
{
|
|
287
|
+
icon: /* @__PURE__ */ jsx2(PencilSquare, {}),
|
|
288
|
+
label: t("actions.edit"),
|
|
289
|
+
onClick: () => onEdit(row.original.id)
|
|
290
|
+
},
|
|
291
|
+
inventoryItemId ? {
|
|
292
|
+
icon: /* @__PURE__ */ jsx2(Buildings, {}),
|
|
293
|
+
label: t("offers.detail.goToInventoryItem"),
|
|
294
|
+
to: `/inventory/${inventoryItemId}`
|
|
295
|
+
} : {
|
|
296
|
+
icon: /* @__PURE__ */ jsx2(Buildings, {}),
|
|
297
|
+
label: t("offers.detail.goToInventoryItem"),
|
|
298
|
+
onClick: () => {
|
|
299
|
+
},
|
|
300
|
+
disabled: true,
|
|
301
|
+
disabledTooltip: t("offers.detail.noInventoryItems")
|
|
302
|
+
}
|
|
303
|
+
]
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
actions: [
|
|
307
|
+
{
|
|
308
|
+
icon: /* @__PURE__ */ jsx2(Trash2, {}),
|
|
309
|
+
label: t("actions.delete"),
|
|
310
|
+
onClick: () => onDelete(row.original.id, skuOf(row.original))
|
|
311
|
+
}
|
|
312
|
+
]
|
|
313
|
+
}
|
|
314
|
+
]
|
|
315
|
+
}
|
|
316
|
+
);
|
|
317
|
+
}
|
|
318
|
+
})
|
|
319
|
+
],
|
|
320
|
+
[t, optionTitles, thumbnail, onEdit, onDelete]
|
|
321
|
+
);
|
|
322
|
+
};
|
|
323
|
+
var OfferVariantsSection = ({
|
|
324
|
+
variants,
|
|
325
|
+
thumbnail
|
|
326
|
+
}) => {
|
|
327
|
+
const { t } = useTranslation2();
|
|
328
|
+
const navigate = useNavigate2();
|
|
329
|
+
const prompt = usePrompt2();
|
|
330
|
+
const { mutateAsync: bulkDelete } = useBulkDeleteOffers();
|
|
331
|
+
const { q, order, offset, created_at, updated_at } = useQueryParams(
|
|
332
|
+
["q", "order", "offset", "created_at", "updated_at"],
|
|
333
|
+
PREFIX
|
|
334
|
+
);
|
|
335
|
+
const allRows = useMemo(
|
|
336
|
+
() => (variants ?? []).flatMap(
|
|
337
|
+
(variant) => (variant.offers ?? []).map((offer) => ({
|
|
338
|
+
id: offer.id,
|
|
339
|
+
variant,
|
|
340
|
+
offer
|
|
341
|
+
}))
|
|
342
|
+
),
|
|
343
|
+
[variants]
|
|
344
|
+
);
|
|
345
|
+
const optionTitles = useMemo(() => {
|
|
346
|
+
const set = /* @__PURE__ */ new Set();
|
|
347
|
+
for (const variant of variants ?? []) {
|
|
348
|
+
for (const opt of variant.options ?? []) {
|
|
349
|
+
if (opt.option?.title) {
|
|
350
|
+
set.add(opt.option.title);
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
return Array.from(set);
|
|
355
|
+
}, [variants]);
|
|
356
|
+
const filteredRows = useMemo(() => {
|
|
357
|
+
let rows = allRows;
|
|
358
|
+
const search = q?.trim().toLowerCase();
|
|
359
|
+
if (search) {
|
|
360
|
+
rows = rows.filter((row) => {
|
|
361
|
+
const title = (row.variant.title ?? "").toLowerCase();
|
|
362
|
+
return title.includes(search) || skuOf(row).toLowerCase().includes(search);
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
const createdFilter = created_at ? JSON.parse(created_at) : null;
|
|
366
|
+
if (createdFilter) {
|
|
367
|
+
rows = rows.filter(
|
|
368
|
+
(row) => matchesDateFilter(row.offer.created_at, createdFilter)
|
|
369
|
+
);
|
|
370
|
+
}
|
|
371
|
+
const updatedFilter = updated_at ? JSON.parse(updated_at) : null;
|
|
372
|
+
if (updatedFilter) {
|
|
373
|
+
rows = rows.filter(
|
|
374
|
+
(row) => matchesDateFilter(row.offer.updated_at, updatedFilter)
|
|
375
|
+
);
|
|
376
|
+
}
|
|
377
|
+
return rows;
|
|
378
|
+
}, [allRows, q, created_at, updated_at]);
|
|
379
|
+
const sortedRows = useMemo(() => {
|
|
380
|
+
if (!order) {
|
|
381
|
+
return filteredRows;
|
|
382
|
+
}
|
|
383
|
+
const desc = order.startsWith("-");
|
|
384
|
+
const key = desc ? order.slice(1) : order;
|
|
385
|
+
const valueOf = (row) => {
|
|
386
|
+
switch (key) {
|
|
387
|
+
case "title":
|
|
388
|
+
return row.variant.title ?? "";
|
|
389
|
+
case "sku":
|
|
390
|
+
return skuOf(row);
|
|
391
|
+
case "created_at":
|
|
392
|
+
return row.offer.created_at ? new Date(row.offer.created_at).toISOString() : "";
|
|
393
|
+
case "updated_at":
|
|
394
|
+
return row.offer.updated_at ? new Date(row.offer.updated_at).toISOString() : "";
|
|
395
|
+
default:
|
|
396
|
+
return "";
|
|
397
|
+
}
|
|
398
|
+
};
|
|
399
|
+
const sorted = [...filteredRows].sort(
|
|
400
|
+
(a, b) => valueOf(a).localeCompare(valueOf(b))
|
|
401
|
+
);
|
|
402
|
+
return desc ? sorted.reverse() : sorted;
|
|
403
|
+
}, [filteredRows, order]);
|
|
404
|
+
const pageIndex = offset ? Math.floor(parseInt(offset) / PAGE_SIZE) : 0;
|
|
405
|
+
const pageRows = useMemo(
|
|
406
|
+
() => sortedRows.slice(pageIndex * PAGE_SIZE, (pageIndex + 1) * PAGE_SIZE),
|
|
407
|
+
[sortedRows, pageIndex]
|
|
408
|
+
);
|
|
409
|
+
const handleEdit = useCallback(
|
|
410
|
+
(offerId) => navigate(`variants/${offerId}/edit`),
|
|
411
|
+
[navigate]
|
|
412
|
+
);
|
|
413
|
+
const handleDelete = useCallback(
|
|
414
|
+
async (offerId, sku) => {
|
|
415
|
+
const confirmed = await prompt({
|
|
416
|
+
title: t("general.areYouSure"),
|
|
417
|
+
description: t("offers.delete.description", { sku: sku || "-" }),
|
|
418
|
+
confirmText: t("actions.delete"),
|
|
419
|
+
cancelText: t("actions.cancel"),
|
|
420
|
+
variant: "danger"
|
|
421
|
+
});
|
|
422
|
+
if (!confirmed) {
|
|
423
|
+
return;
|
|
424
|
+
}
|
|
425
|
+
const result = await bulkDelete([offerId]);
|
|
426
|
+
if (result.failed.length === 0) {
|
|
427
|
+
toast2.success(t("offers.delete.successToast"));
|
|
428
|
+
} else {
|
|
429
|
+
toast2.error(result.failed[0]?.error.message);
|
|
430
|
+
}
|
|
431
|
+
},
|
|
432
|
+
[prompt, bulkDelete, t]
|
|
433
|
+
);
|
|
434
|
+
const columns = useColumns({
|
|
435
|
+
optionTitles,
|
|
436
|
+
thumbnail,
|
|
437
|
+
onEdit: handleEdit,
|
|
438
|
+
onDelete: handleDelete
|
|
439
|
+
});
|
|
440
|
+
const orderBy = useMemo(
|
|
441
|
+
() => [
|
|
442
|
+
{ key: "title", label: t("fields.title") },
|
|
443
|
+
{ key: "sku", label: t("fields.sku") },
|
|
444
|
+
{ key: "created_at", label: t("fields.createdAt") },
|
|
445
|
+
{ key: "updated_at", label: t("fields.updatedAt") }
|
|
446
|
+
],
|
|
447
|
+
[t]
|
|
448
|
+
);
|
|
449
|
+
const filters = useMemo(
|
|
450
|
+
() => [
|
|
451
|
+
{ key: "created_at", label: t("fields.createdAt"), type: "date" },
|
|
452
|
+
{ key: "updated_at", label: t("fields.updatedAt"), type: "date" }
|
|
453
|
+
],
|
|
454
|
+
[t]
|
|
455
|
+
);
|
|
456
|
+
const { table } = useDataTable({
|
|
457
|
+
data: pageRows,
|
|
458
|
+
columns,
|
|
459
|
+
count: sortedRows.length,
|
|
460
|
+
pageSize: PAGE_SIZE,
|
|
461
|
+
getRowId: (row) => row.id,
|
|
462
|
+
prefix: PREFIX
|
|
463
|
+
});
|
|
464
|
+
return /* @__PURE__ */ jsxs2(Container2, { className: "p-0", "data-testid": "offer-variants-section", children: [
|
|
465
|
+
/* @__PURE__ */ jsxs2("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
466
|
+
/* @__PURE__ */ jsx2(Heading2, { level: "h2", children: t("offers.fields.variants") }),
|
|
467
|
+
/* @__PURE__ */ jsx2("div", { className: "flex items-center gap-x-4", children: /* @__PURE__ */ jsx2(
|
|
468
|
+
ActionMenu,
|
|
469
|
+
{
|
|
470
|
+
groups: [
|
|
471
|
+
{
|
|
472
|
+
actions: [
|
|
473
|
+
{
|
|
474
|
+
label: t("offers.actions.edit_prices"),
|
|
475
|
+
icon: /* @__PURE__ */ jsx2(CurrencyDollar, {}),
|
|
476
|
+
to: "edit-price"
|
|
477
|
+
},
|
|
478
|
+
{
|
|
479
|
+
label: t("offers.actions.edit_stock_levels"),
|
|
480
|
+
icon: /* @__PURE__ */ jsx2(Buildings, {}),
|
|
481
|
+
to: "edit-stock"
|
|
482
|
+
}
|
|
483
|
+
]
|
|
484
|
+
}
|
|
485
|
+
]
|
|
486
|
+
}
|
|
487
|
+
) })
|
|
488
|
+
] }),
|
|
489
|
+
/* @__PURE__ */ jsx2(
|
|
490
|
+
_DataTable,
|
|
491
|
+
{
|
|
492
|
+
table,
|
|
493
|
+
columns,
|
|
494
|
+
count: sortedRows.length,
|
|
495
|
+
pageSize: PAGE_SIZE,
|
|
496
|
+
prefix: PREFIX,
|
|
497
|
+
pagination: true,
|
|
498
|
+
search: true,
|
|
499
|
+
orderBy,
|
|
500
|
+
filters,
|
|
501
|
+
queryObject: { q, order, created_at, updated_at },
|
|
502
|
+
navigateTo: (row) => `variants/${row.original.id}`,
|
|
503
|
+
noRecords: {
|
|
504
|
+
title: t("offers.empty.heading"),
|
|
505
|
+
message: t("offers.empty.description")
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
)
|
|
509
|
+
] });
|
|
510
|
+
};
|
|
511
|
+
|
|
512
|
+
// src/pages/offers/[id]/_components/offer-associated-product-section.tsx
|
|
513
|
+
import { TriangleRightMini } from "@medusajs/icons";
|
|
514
|
+
import { Container as Container3, Heading as Heading3 } from "@medusajs/ui";
|
|
515
|
+
import { useTranslation as useTranslation3 } from "react-i18next";
|
|
516
|
+
import { Link } from "react-router-dom";
|
|
517
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
518
|
+
var OfferAssociatedProductSection = ({
|
|
519
|
+
product
|
|
520
|
+
}) => {
|
|
521
|
+
const { t } = useTranslation3();
|
|
522
|
+
return /* @__PURE__ */ jsxs3(Container3, { className: "p-0", "data-testid": "offer-associated-product-section", children: [
|
|
523
|
+
/* @__PURE__ */ jsx3("div", { className: "flex items-center justify-between px-6 py-4", children: /* @__PURE__ */ jsx3(Heading3, { level: "h2", children: t("offers.detail.associatedProduct") }) }),
|
|
524
|
+
/* @__PURE__ */ jsx3("div", { className: "txt-small flex flex-col gap-2 px-2 pb-2", children: /* @__PURE__ */ jsx3(
|
|
525
|
+
Link,
|
|
526
|
+
{
|
|
527
|
+
to: `/products/${product.id}`,
|
|
528
|
+
className: "outline-none focus-within:shadow-borders-interactive-with-focus rounded-md [&:hover>div]:bg-ui-bg-component-hover",
|
|
529
|
+
"data-testid": "offer-associated-product-link",
|
|
530
|
+
children: /* @__PURE__ */ jsx3("div", { className: "shadow-elevation-card-rest bg-ui-bg-component rounded-md px-4 py-2 transition-colors", children: /* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-3", children: [
|
|
531
|
+
/* @__PURE__ */ jsx3("div", { className: "shadow-elevation-card-rest rounded-md", children: /* @__PURE__ */ jsx3(Thumbnail, { src: product.thumbnail ?? null }) }),
|
|
532
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
|
|
533
|
+
/* @__PURE__ */ jsx3("span", { className: "text-ui-fg-base truncate font-medium", children: product.title }),
|
|
534
|
+
product.handle && /* @__PURE__ */ jsxs3("span", { className: "text-ui-fg-subtle truncate", children: [
|
|
535
|
+
"/",
|
|
536
|
+
product.handle
|
|
537
|
+
] })
|
|
538
|
+
] }),
|
|
539
|
+
/* @__PURE__ */ jsx3("div", { className: "size-7 flex items-center justify-center", children: /* @__PURE__ */ jsx3(TriangleRightMini, { className: "text-ui-fg-muted rtl:rotate-180" }) })
|
|
540
|
+
] }) })
|
|
541
|
+
}
|
|
542
|
+
) })
|
|
543
|
+
] });
|
|
544
|
+
};
|
|
545
|
+
|
|
546
|
+
// src/pages/offers/[id]/offer-detail-page.tsx
|
|
547
|
+
import { Fragment, jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
548
|
+
var Root = ({ children }) => {
|
|
549
|
+
const { id } = useParams();
|
|
550
|
+
const initialData = useLoaderData();
|
|
551
|
+
const { product, isLoading, isError, error } = useProduct(
|
|
552
|
+
id,
|
|
553
|
+
{ fields: OFFER_PRODUCT_DETAIL_FIELDS },
|
|
554
|
+
{ initialData }
|
|
555
|
+
);
|
|
556
|
+
if (isError) {
|
|
557
|
+
throw error;
|
|
558
|
+
}
|
|
559
|
+
if (isLoading || !product) {
|
|
560
|
+
return /* @__PURE__ */ jsx4(TwoColumnPageSkeleton, { mainSections: 3, sidebarSections: 1 });
|
|
561
|
+
}
|
|
562
|
+
const typed = product;
|
|
563
|
+
return /* @__PURE__ */ jsx4(Fragment, { children: Children.count(children) > 0 ? children : /* @__PURE__ */ jsxs4(TwoColumnPage, { data: typed, hasOutlet: true, children: [
|
|
564
|
+
/* @__PURE__ */ jsxs4(TwoColumnPage.Main, { children: [
|
|
565
|
+
/* @__PURE__ */ jsx4(OfferDetailGeneralSection, { product: typed }),
|
|
566
|
+
/* @__PURE__ */ jsx4(ProductMediaSection, { product: typed, readOnly: true }),
|
|
567
|
+
/* @__PURE__ */ jsx4(
|
|
568
|
+
OfferVariantsSection,
|
|
569
|
+
{
|
|
570
|
+
variants: typed.variants,
|
|
571
|
+
thumbnail: typed.thumbnail
|
|
572
|
+
}
|
|
573
|
+
)
|
|
574
|
+
] }),
|
|
575
|
+
/* @__PURE__ */ jsx4(TwoColumnPage.Sidebar, { children: /* @__PURE__ */ jsx4(OfferAssociatedProductSection, { product: typed }) })
|
|
576
|
+
] }) });
|
|
577
|
+
};
|
|
578
|
+
var OfferDetailPage = Object.assign(Root, {
|
|
579
|
+
Main: TwoColumnPage.Main,
|
|
580
|
+
Sidebar: TwoColumnPage.Sidebar,
|
|
581
|
+
General: OfferDetailGeneralSection,
|
|
582
|
+
Media: ProductMediaSection,
|
|
583
|
+
Variants: OfferVariantsSection,
|
|
584
|
+
AssociatedProduct: OfferAssociatedProductSection
|
|
585
|
+
});
|
|
586
|
+
var Component2 = Root;
|
|
587
|
+
export {
|
|
588
|
+
Component2 as Component,
|
|
589
|
+
OfferDetailPage
|
|
590
|
+
};
|