@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,10 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ProductGeneralSection,
|
|
3
|
+
ProductMediaSection
|
|
4
|
+
} from "./chunk-I75SROQZ.js";
|
|
1
5
|
import {
|
|
2
6
|
SectionRow
|
|
3
7
|
} from "./chunk-4TLP3TAA.js";
|
|
4
8
|
import {
|
|
5
|
-
useDataTableDateColumns
|
|
9
|
+
useDataTableDateColumns
|
|
10
|
+
} from "./chunk-FP6U6BPH.js";
|
|
11
|
+
import {
|
|
6
12
|
useDataTableDateFilters
|
|
7
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-HFRHHT36.js";
|
|
14
|
+
import {
|
|
15
|
+
DataTable
|
|
16
|
+
} from "./chunk-IV57G2CB.js";
|
|
8
17
|
import {
|
|
9
18
|
SidebarLink
|
|
10
19
|
} from "./chunk-4GPAS5GW.js";
|
|
@@ -12,18 +21,13 @@ import "./chunk-U2EI2ZLM.js";
|
|
|
12
21
|
import {
|
|
13
22
|
TwoColumnPage
|
|
14
23
|
} 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-PPLC4IKI.js";
|
|
21
24
|
import {
|
|
22
25
|
useQueryParams
|
|
23
26
|
} from "./chunk-THHRRYRS.js";
|
|
27
|
+
import "./chunk-LRD242C7.js";
|
|
24
28
|
import {
|
|
25
29
|
require_dist
|
|
26
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-6FLSBL4Q.js";
|
|
27
31
|
import {
|
|
28
32
|
Thumbnail
|
|
29
33
|
} from "./chunk-WIYFXWRI.js";
|
|
@@ -32,32 +36,32 @@ import {
|
|
|
32
36
|
} from "./chunk-INNFZYX2.js";
|
|
33
37
|
import {
|
|
34
38
|
useProductTag
|
|
35
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-KZYRC3WR.js";
|
|
36
40
|
import "./chunk-F4OJN2F2.js";
|
|
37
41
|
import "./chunk-LRARA622.js";
|
|
38
42
|
import "./chunk-M6N4ISXL.js";
|
|
39
43
|
import "./chunk-S7EKBD2C.js";
|
|
40
|
-
import "./chunk-VXMOPVRH.js";
|
|
41
44
|
import {
|
|
42
45
|
useProductType
|
|
43
46
|
} from "./chunk-VV6IKGCN.js";
|
|
44
|
-
import "./chunk-
|
|
47
|
+
import "./chunk-M3YUT5AY.js";
|
|
45
48
|
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
49
|
import "./chunk-IQWK723D.js";
|
|
51
|
-
import "./chunk-
|
|
50
|
+
import "./chunk-4S6XGIC6.js";
|
|
51
|
+
import "./chunk-S23FD6FA.js";
|
|
52
52
|
import {
|
|
53
53
|
useCollection
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-7FIPNQM2.js";
|
|
55
|
+
import "./chunk-LTQQRVZG.js";
|
|
55
56
|
import "./chunk-VXWN37PT.js";
|
|
56
57
|
import {
|
|
57
58
|
useProductCategory
|
|
58
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-247L47JD.js";
|
|
60
|
+
import "./chunk-POOTMH3K.js";
|
|
61
|
+
import "./chunk-VXMOPVRH.js";
|
|
59
62
|
import "./chunk-NBPMNUKZ.js";
|
|
60
|
-
import "./chunk-
|
|
63
|
+
import "./chunk-4R5GESED.js";
|
|
64
|
+
import "./chunk-7RGUD6PI.js";
|
|
61
65
|
import {
|
|
62
66
|
useSalesChannels
|
|
63
67
|
} from "./chunk-3B34B2M2.js";
|
|
@@ -65,21 +69,22 @@ import {
|
|
|
65
69
|
ActionMenu
|
|
66
70
|
} from "./chunk-BDGZ4EQO.js";
|
|
67
71
|
import "./chunk-LAVHRER2.js";
|
|
72
|
+
import "./chunk-QHQWEERJ.js";
|
|
68
73
|
import "./chunk-Y7QKP6QU.js";
|
|
69
74
|
import {
|
|
70
75
|
PRODUCT_DETAIL_QUERY
|
|
71
|
-
} from "./chunk-
|
|
76
|
+
} from "./chunk-36WXPGD2.js";
|
|
72
77
|
import {
|
|
78
|
+
productAttributesQueryKeys,
|
|
73
79
|
productsQueryKeys,
|
|
74
80
|
useCancelProductEdit,
|
|
75
|
-
useDeleteProduct,
|
|
76
81
|
useDeleteVariantLazy,
|
|
77
82
|
useProduct,
|
|
83
|
+
useProductAttribute,
|
|
78
84
|
useProductChange,
|
|
79
85
|
useProductVariants,
|
|
80
|
-
useRemoveProductAttribute
|
|
81
|
-
|
|
82
|
-
} from "./chunk-QNNJN4H6.js";
|
|
86
|
+
useRemoveProductAttribute
|
|
87
|
+
} from "./chunk-TSTUAL6N.js";
|
|
83
88
|
import "./chunk-A5DJIOHN.js";
|
|
84
89
|
import {
|
|
85
90
|
queryClient
|
|
@@ -127,7 +132,7 @@ import {
|
|
|
127
132
|
isReferenceField,
|
|
128
133
|
partitionProductChangeActions
|
|
129
134
|
} from "@mercurjs/dashboard-shared";
|
|
130
|
-
import {
|
|
135
|
+
import { useQueries } from "@tanstack/react-query";
|
|
131
136
|
import { Fragment, useMemo } from "react";
|
|
132
137
|
import { useTranslation } from "react-i18next";
|
|
133
138
|
import { Fragment as Fragment2, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -135,14 +140,6 @@ var ImageStrip = ({
|
|
|
135
140
|
images,
|
|
136
141
|
faded
|
|
137
142
|
}) => /* @__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}`)) });
|
|
138
|
-
var BrandName = ({ id }) => {
|
|
139
|
-
const { data } = useQuery({
|
|
140
|
-
queryKey: ["product_brand", id],
|
|
141
|
-
queryFn: () => sdk.vendor.productBrands.$id.query({ $id: id }),
|
|
142
|
-
enabled: !!id
|
|
143
|
-
});
|
|
144
|
-
return /* @__PURE__ */ jsx(Fragment2, { children: data?.product_brand?.name ?? id });
|
|
145
|
-
};
|
|
146
143
|
var TypeName = ({ id }) => {
|
|
147
144
|
const { product_type } = useProductType(id);
|
|
148
145
|
return /* @__PURE__ */ jsx(Fragment2, { children: product_type?.value ?? id });
|
|
@@ -164,8 +161,6 @@ var ReferenceName = ({
|
|
|
164
161
|
id
|
|
165
162
|
}) => {
|
|
166
163
|
switch (field) {
|
|
167
|
-
case "brand_id":
|
|
168
|
-
return /* @__PURE__ */ jsx(BrandName, { id });
|
|
169
164
|
case "type_id":
|
|
170
165
|
return /* @__PURE__ */ jsx(TypeName, { id });
|
|
171
166
|
case "collection_id":
|
|
@@ -268,18 +263,164 @@ var FieldRow = ({ diff }) => {
|
|
|
268
263
|
)
|
|
269
264
|
] });
|
|
270
265
|
};
|
|
271
|
-
var
|
|
266
|
+
var ActionRow = ({
|
|
267
|
+
label,
|
|
268
|
+
children
|
|
269
|
+
}) => /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-4", children: [
|
|
270
|
+
/* @__PURE__ */ jsx(
|
|
271
|
+
Text,
|
|
272
|
+
{
|
|
273
|
+
size: "small",
|
|
274
|
+
weight: "plus",
|
|
275
|
+
leading: "compact",
|
|
276
|
+
className: "text-ui-fg-subtle w-[160px] shrink-0",
|
|
277
|
+
children: label
|
|
278
|
+
}
|
|
279
|
+
),
|
|
280
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-1 flex-col gap-y-1", children })
|
|
281
|
+
] });
|
|
282
|
+
var AttributeActionLine = ({
|
|
283
|
+
attributeId,
|
|
284
|
+
valueIds
|
|
285
|
+
}) => {
|
|
286
|
+
const { product_attribute } = useProductAttribute(attributeId);
|
|
287
|
+
const name = product_attribute?.name ?? attributeId;
|
|
288
|
+
const values = product_attribute?.values ?? [];
|
|
289
|
+
const selectedNames = valueIds && valueIds.length ? valueIds.map((id) => {
|
|
290
|
+
const match = values.find((v) => v.id === id);
|
|
291
|
+
return match?.name ?? id;
|
|
292
|
+
}) : [];
|
|
293
|
+
return /* @__PURE__ */ jsx(ActionRow, { label: name, children: /* @__PURE__ */ jsx(Text, { size: "small", leading: "compact", className: "text-ui-fg-subtle", children: selectedNames.length > 0 ? selectedNames.join(", ") : "-" }) });
|
|
294
|
+
};
|
|
295
|
+
var VariantActionLine = ({
|
|
296
|
+
title,
|
|
297
|
+
sku,
|
|
298
|
+
images
|
|
299
|
+
}) => {
|
|
272
300
|
const { t } = useTranslation();
|
|
301
|
+
const src = images && images.length > 0 ? images[0].url : null;
|
|
302
|
+
return /* @__PURE__ */ jsx(ActionRow, { label: t("fields.variant", { defaultValue: "Variant" }), children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
303
|
+
/* @__PURE__ */ jsx(Thumbnail, { src, size: "base" }),
|
|
304
|
+
/* @__PURE__ */ jsxs(Text, { size: "small", leading: "compact", className: "text-ui-fg-subtle", children: [
|
|
305
|
+
/* @__PURE__ */ jsx("span", { className: "font-medium text-ui-fg-base", children: title }),
|
|
306
|
+
sku ? ` \xB7 ${sku}` : null
|
|
307
|
+
] })
|
|
308
|
+
] }) });
|
|
309
|
+
};
|
|
310
|
+
var ActionLine = ({
|
|
311
|
+
action,
|
|
312
|
+
variantsById
|
|
313
|
+
}) => {
|
|
314
|
+
const { t } = useTranslation();
|
|
315
|
+
const details = action.details ?? {};
|
|
316
|
+
if (action.action === import_types.ProductChangeActionType.ATTRIBUTE_ADD || action.action === import_types.ProductChangeActionType.ATTRIBUTE_REMOVE) {
|
|
317
|
+
if (!details.attribute_id) return null;
|
|
318
|
+
return /* @__PURE__ */ jsx(
|
|
319
|
+
AttributeActionLine,
|
|
320
|
+
{
|
|
321
|
+
attributeId: details.attribute_id,
|
|
322
|
+
valueIds: action.action === import_types.ProductChangeActionType.ATTRIBUTE_ADD ? details.attribute_value_ids : void 0
|
|
323
|
+
}
|
|
324
|
+
);
|
|
325
|
+
}
|
|
326
|
+
const variantFallback = t("fields.variant", { defaultValue: "Variant" });
|
|
327
|
+
if (action.action === import_types.ProductChangeActionType.VARIANT_ADD) {
|
|
328
|
+
const variantTitle = details.variant?.title;
|
|
329
|
+
const sku = details.variant?.sku;
|
|
330
|
+
const title = variantTitle || sku || variantFallback;
|
|
331
|
+
return /* @__PURE__ */ jsx(VariantActionLine, { title, sku: variantTitle ? sku : void 0 });
|
|
332
|
+
}
|
|
333
|
+
if (action.action === import_types.ProductChangeActionType.VARIANT_REMOVE) {
|
|
334
|
+
const variantId = details.variant_id ?? "";
|
|
335
|
+
const found = variantId ? variantsById.get(variantId) : void 0;
|
|
336
|
+
const title = found?.title || found?.sku || variantId || variantFallback;
|
|
337
|
+
const images = isImageList(found?.images) ? found?.images : void 0;
|
|
338
|
+
return /* @__PURE__ */ jsx(
|
|
339
|
+
VariantActionLine,
|
|
340
|
+
{
|
|
341
|
+
title,
|
|
342
|
+
sku: found?.title ? found?.sku : void 0,
|
|
343
|
+
images
|
|
344
|
+
}
|
|
345
|
+
);
|
|
346
|
+
}
|
|
273
347
|
const label = describeProductChangeAction(action, {
|
|
274
|
-
variant:
|
|
348
|
+
variant: variantFallback
|
|
275
349
|
});
|
|
276
350
|
return /* @__PURE__ */ jsx(Text, { size: "small", leading: "compact", className: "text-ui-fg-subtle", children: label });
|
|
277
351
|
};
|
|
352
|
+
var VariantUpdateBlock = ({
|
|
353
|
+
variantId,
|
|
354
|
+
diffs,
|
|
355
|
+
variantsById
|
|
356
|
+
}) => {
|
|
357
|
+
const { t } = useTranslation();
|
|
358
|
+
const found = variantsById.get(variantId);
|
|
359
|
+
const variantFallback = t("fields.variant", { defaultValue: "Variant" });
|
|
360
|
+
const title = found?.title || found?.sku || variantId || variantFallback;
|
|
361
|
+
const sku = found?.sku && title !== found.sku ? found.sku : void 0;
|
|
362
|
+
const images = isImageList(found?.images) ? found?.images : void 0;
|
|
363
|
+
return /* @__PURE__ */ jsxs(Fragment2, { children: [
|
|
364
|
+
/* @__PURE__ */ jsxs(
|
|
365
|
+
"div",
|
|
366
|
+
{
|
|
367
|
+
className: "flex items-start gap-4 px-6 py-4",
|
|
368
|
+
"data-testid": `product-active-edit-variant-${variantId}`,
|
|
369
|
+
children: [
|
|
370
|
+
/* @__PURE__ */ jsx(
|
|
371
|
+
Text,
|
|
372
|
+
{
|
|
373
|
+
size: "small",
|
|
374
|
+
weight: "plus",
|
|
375
|
+
leading: "compact",
|
|
376
|
+
className: "text-ui-fg-subtle w-[160px] shrink-0",
|
|
377
|
+
children: variantFallback
|
|
378
|
+
}
|
|
379
|
+
),
|
|
380
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-1 items-center gap-2", children: [
|
|
381
|
+
images && images.length > 0 && /* @__PURE__ */ jsx(ImageStrip, { images }),
|
|
382
|
+
/* @__PURE__ */ jsx(
|
|
383
|
+
Text,
|
|
384
|
+
{
|
|
385
|
+
size: "small",
|
|
386
|
+
leading: "compact",
|
|
387
|
+
className: "text-ui-fg-base font-medium",
|
|
388
|
+
children: title
|
|
389
|
+
}
|
|
390
|
+
),
|
|
391
|
+
sku && /* @__PURE__ */ jsx(Text, { size: "small", leading: "compact", className: "text-ui-fg-subtle", children: `\xB7 ${sku}` })
|
|
392
|
+
] })
|
|
393
|
+
]
|
|
394
|
+
}
|
|
395
|
+
),
|
|
396
|
+
diffs.length > 0 && /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-4 px-6 py-4", children: [
|
|
397
|
+
/* @__PURE__ */ jsx(
|
|
398
|
+
Text,
|
|
399
|
+
{
|
|
400
|
+
size: "small",
|
|
401
|
+
weight: "plus",
|
|
402
|
+
leading: "compact",
|
|
403
|
+
className: "text-ui-fg-subtle w-[160px] shrink-0",
|
|
404
|
+
children: t("labels.updated")
|
|
405
|
+
}
|
|
406
|
+
),
|
|
407
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-1 flex-col gap-y-4", children: diffs.map((diff, idx) => /* @__PURE__ */ jsx(FieldRow, { diff }, `${variantId}-${diff.field}-${idx}`)) })
|
|
408
|
+
] })
|
|
409
|
+
] });
|
|
410
|
+
};
|
|
278
411
|
var ProductActiveEditSection = ({
|
|
279
|
-
|
|
412
|
+
product
|
|
280
413
|
}) => {
|
|
281
414
|
const { t } = useTranslation();
|
|
282
415
|
const prompt = usePrompt();
|
|
416
|
+
const productId = product.id;
|
|
417
|
+
const variantsById = useMemo(() => {
|
|
418
|
+
const map = /* @__PURE__ */ new Map();
|
|
419
|
+
for (const variant of product.variants ?? []) {
|
|
420
|
+
if (variant?.id) map.set(variant.id, variant);
|
|
421
|
+
}
|
|
422
|
+
return map;
|
|
423
|
+
}, [product.variants]);
|
|
283
424
|
const { product_change, isError } = useProductChange(productId, {
|
|
284
425
|
retry: false
|
|
285
426
|
});
|
|
@@ -288,6 +429,37 @@ var ProductActiveEditSection = ({
|
|
|
288
429
|
() => partitionProductChangeActions(product_change?.actions ?? []),
|
|
289
430
|
[product_change]
|
|
290
431
|
);
|
|
432
|
+
const productUpdated = useMemo(
|
|
433
|
+
() => updated.filter((d) => !d.variant_id),
|
|
434
|
+
[updated]
|
|
435
|
+
);
|
|
436
|
+
const variantsUpdated = useMemo(() => {
|
|
437
|
+
const groups = /* @__PURE__ */ new Map();
|
|
438
|
+
for (const diff of updated) {
|
|
439
|
+
if (!diff.variant_id) continue;
|
|
440
|
+
const bucket = groups.get(diff.variant_id) ?? [];
|
|
441
|
+
bucket.push(diff);
|
|
442
|
+
groups.set(diff.variant_id, bucket);
|
|
443
|
+
}
|
|
444
|
+
return groups;
|
|
445
|
+
}, [updated]);
|
|
446
|
+
const attributeIds = useMemo(() => {
|
|
447
|
+
const ids = /* @__PURE__ */ new Set();
|
|
448
|
+
for (const action of [...added, ...removed]) {
|
|
449
|
+
if (action.action === import_types.ProductChangeActionType.ATTRIBUTE_ADD || action.action === import_types.ProductChangeActionType.ATTRIBUTE_REMOVE) {
|
|
450
|
+
const details = action.details ?? {};
|
|
451
|
+
if (details.attribute_id) ids.add(details.attribute_id);
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
return Array.from(ids);
|
|
455
|
+
}, [added, removed]);
|
|
456
|
+
const attributeQueries = useQueries({
|
|
457
|
+
queries: attributeIds.map((id) => ({
|
|
458
|
+
queryKey: productAttributesQueryKeys.detail(id),
|
|
459
|
+
queryFn: () => sdk.vendor.productAttributes.$id.query({ $id: id })
|
|
460
|
+
}))
|
|
461
|
+
});
|
|
462
|
+
const isLoadingAttributes = attributeQueries.some((q) => q.isPending);
|
|
291
463
|
const onCancel = async () => {
|
|
292
464
|
const confirmed = await prompt({
|
|
293
465
|
title: t("products.edits.panel.cancelTitle"),
|
|
@@ -309,7 +481,10 @@ var ProductActiveEditSection = ({
|
|
|
309
481
|
if (product_change.status !== import_types.ProductChangeStatus.PENDING) {
|
|
310
482
|
return null;
|
|
311
483
|
}
|
|
312
|
-
|
|
484
|
+
if (isLoadingAttributes) {
|
|
485
|
+
return null;
|
|
486
|
+
}
|
|
487
|
+
const hasContent = productUpdated.length > 0 || variantsUpdated.size > 0 || added.length > 0 || removed.length > 0 || deleteRequested;
|
|
313
488
|
return /* @__PURE__ */ jsxs(
|
|
314
489
|
Container,
|
|
315
490
|
{
|
|
@@ -320,9 +495,8 @@ var ProductActiveEditSection = ({
|
|
|
320
495
|
/* @__PURE__ */ jsx(ExclamationCircleSolid, { className: "text-ui-fg-interactive" }),
|
|
321
496
|
/* @__PURE__ */ jsx(Heading, { level: "h2", "data-testid": "product-active-edit-heading", children: t("products.edits.panel.title") })
|
|
322
497
|
] }),
|
|
323
|
-
/* @__PURE__ */ jsx("div", { className: "px-6 py-4", children: /* @__PURE__ */ jsx(Text, { size: "small", leading: "compact", className: "text-ui-fg-subtle", children: t("products.edits.panel.description") }) }),
|
|
324
498
|
hasContent && /* @__PURE__ */ jsxs(Fragment2, { children: [
|
|
325
|
-
|
|
499
|
+
productUpdated.length > 0 && /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-4 px-6 py-4", children: [
|
|
326
500
|
/* @__PURE__ */ jsx(
|
|
327
501
|
Text,
|
|
328
502
|
{
|
|
@@ -333,8 +507,17 @@ var ProductActiveEditSection = ({
|
|
|
333
507
|
children: t("labels.updated")
|
|
334
508
|
}
|
|
335
509
|
),
|
|
336
|
-
/* @__PURE__ */ jsx("div", { className: "flex flex-1 flex-col gap-y-4", children:
|
|
510
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-1 flex-col gap-y-4", children: productUpdated.map((diff, idx) => /* @__PURE__ */ jsx(FieldRow, { diff }, `${diff.field}-${idx}`)) })
|
|
337
511
|
] }),
|
|
512
|
+
variantsUpdated.size > 0 && Array.from(variantsUpdated.entries()).map(([variantId, diffs]) => /* @__PURE__ */ jsx(
|
|
513
|
+
VariantUpdateBlock,
|
|
514
|
+
{
|
|
515
|
+
variantId,
|
|
516
|
+
diffs,
|
|
517
|
+
variantsById
|
|
518
|
+
},
|
|
519
|
+
variantId
|
|
520
|
+
)),
|
|
338
521
|
added.length > 0 && /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-4 px-6 py-4", children: [
|
|
339
522
|
/* @__PURE__ */ jsx(
|
|
340
523
|
Text,
|
|
@@ -346,7 +529,14 @@ var ProductActiveEditSection = ({
|
|
|
346
529
|
children: t("labels.added")
|
|
347
530
|
}
|
|
348
531
|
),
|
|
349
|
-
/* @__PURE__ */ jsx("div", { className: "flex flex-1 flex-col gap-y-2", children: added.map((action) => /* @__PURE__ */ jsx(
|
|
532
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-1 flex-col gap-y-2", children: added.map((action) => /* @__PURE__ */ jsx(
|
|
533
|
+
ActionLine,
|
|
534
|
+
{
|
|
535
|
+
action,
|
|
536
|
+
variantsById
|
|
537
|
+
},
|
|
538
|
+
action.id
|
|
539
|
+
)) })
|
|
350
540
|
] }),
|
|
351
541
|
removed.length > 0 && /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-4 px-6 py-4", children: [
|
|
352
542
|
/* @__PURE__ */ jsx(
|
|
@@ -359,7 +549,14 @@ var ProductActiveEditSection = ({
|
|
|
359
549
|
children: t("labels.removed")
|
|
360
550
|
}
|
|
361
551
|
),
|
|
362
|
-
/* @__PURE__ */ jsx("div", { className: "flex flex-1 flex-col gap-y-2", children: removed.map((action) => /* @__PURE__ */ jsx(
|
|
552
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-1 flex-col gap-y-2", children: removed.map((action) => /* @__PURE__ */ jsx(
|
|
553
|
+
ActionLine,
|
|
554
|
+
{
|
|
555
|
+
action,
|
|
556
|
+
variantsById
|
|
557
|
+
},
|
|
558
|
+
action.id
|
|
559
|
+
)) })
|
|
363
560
|
] }),
|
|
364
561
|
deleteRequested && /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-4 px-6 py-4", children: [
|
|
365
562
|
/* @__PURE__ */ jsx(
|
|
@@ -407,327 +604,30 @@ var ProductActiveEditSection = ({
|
|
|
407
604
|
);
|
|
408
605
|
};
|
|
409
606
|
|
|
410
|
-
// src/pages/products/[id]/_components/product-
|
|
411
|
-
import { PencilSquare
|
|
412
|
-
import { Container as Container2, Heading as Heading2,
|
|
607
|
+
// src/pages/products/[id]/_components/product-organization-section/product-organization-section.tsx
|
|
608
|
+
import { PencilSquare } from "@medusajs/icons";
|
|
609
|
+
import { Badge, Container as Container2, Heading as Heading2, Tooltip } from "@medusajs/ui";
|
|
413
610
|
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
414
|
-
import { useNavigate } from "react-router-dom";
|
|
415
|
-
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
416
|
-
var productStatusColor = (status) => {
|
|
417
|
-
switch (status) {
|
|
418
|
-
case "draft":
|
|
419
|
-
return "grey";
|
|
420
|
-
case "proposed":
|
|
421
|
-
return "orange";
|
|
422
|
-
case "published":
|
|
423
|
-
return "green";
|
|
424
|
-
case "rejected":
|
|
425
|
-
return "red";
|
|
426
|
-
case "requires_action":
|
|
427
|
-
return "blue";
|
|
428
|
-
default:
|
|
429
|
-
return "grey";
|
|
430
|
-
}
|
|
431
|
-
};
|
|
432
|
-
var ProductGeneralSection = ({
|
|
433
|
-
product
|
|
434
|
-
}) => {
|
|
435
|
-
const { t } = useTranslation2();
|
|
436
|
-
const prompt = usePrompt2();
|
|
437
|
-
const navigate = useNavigate();
|
|
438
|
-
const { mutateAsync } = useDeleteProduct(product.id);
|
|
439
|
-
const handleDelete = async () => {
|
|
440
|
-
const res = await prompt({
|
|
441
|
-
title: t("general.areYouSure"),
|
|
442
|
-
description: t("products.deleteWarning", {
|
|
443
|
-
title: product.title
|
|
444
|
-
}),
|
|
445
|
-
confirmText: t("actions.delete"),
|
|
446
|
-
cancelText: t("actions.cancel")
|
|
447
|
-
});
|
|
448
|
-
if (!res) {
|
|
449
|
-
return;
|
|
450
|
-
}
|
|
451
|
-
await mutateAsync(void 0, {
|
|
452
|
-
onSuccess: () => {
|
|
453
|
-
navigate("..");
|
|
454
|
-
}
|
|
455
|
-
});
|
|
456
|
-
};
|
|
457
|
-
return /* @__PURE__ */ jsxs2(Container2, { className: "divide-y p-0", children: [
|
|
458
|
-
/* @__PURE__ */ jsxs2("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
459
|
-
/* @__PURE__ */ jsx2(Heading2, { children: product.title }),
|
|
460
|
-
/* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-x-4", children: [
|
|
461
|
-
/* @__PURE__ */ jsx2(StatusBadge, { color: productStatusColor(product.status), children: t(`products.productStatus.${product.status}`) }),
|
|
462
|
-
/* @__PURE__ */ jsx2(
|
|
463
|
-
ActionMenu,
|
|
464
|
-
{
|
|
465
|
-
groups: [
|
|
466
|
-
{
|
|
467
|
-
actions: [
|
|
468
|
-
{
|
|
469
|
-
label: t("actions.edit"),
|
|
470
|
-
to: "edit",
|
|
471
|
-
icon: /* @__PURE__ */ jsx2(PencilSquare, {})
|
|
472
|
-
}
|
|
473
|
-
]
|
|
474
|
-
},
|
|
475
|
-
{
|
|
476
|
-
actions: [
|
|
477
|
-
{
|
|
478
|
-
label: t("actions.delete"),
|
|
479
|
-
onClick: handleDelete,
|
|
480
|
-
icon: /* @__PURE__ */ jsx2(Trash, {})
|
|
481
|
-
}
|
|
482
|
-
]
|
|
483
|
-
}
|
|
484
|
-
]
|
|
485
|
-
}
|
|
486
|
-
)
|
|
487
|
-
] })
|
|
488
|
-
] }),
|
|
489
|
-
/* @__PURE__ */ jsx2(
|
|
490
|
-
SectionRow,
|
|
491
|
-
{
|
|
492
|
-
title: t("fields.description"),
|
|
493
|
-
value: product.description || "-"
|
|
494
|
-
}
|
|
495
|
-
),
|
|
496
|
-
/* @__PURE__ */ jsx2(
|
|
497
|
-
SectionRow,
|
|
498
|
-
{
|
|
499
|
-
title: t("fields.subtitle"),
|
|
500
|
-
value: product.subtitle || "-"
|
|
501
|
-
}
|
|
502
|
-
),
|
|
503
|
-
/* @__PURE__ */ jsx2(SectionRow, { title: t("fields.handle"), value: `/${product.handle}` }),
|
|
504
|
-
/* @__PURE__ */ jsx2(
|
|
505
|
-
SectionRow,
|
|
506
|
-
{
|
|
507
|
-
title: t("fields.discountable"),
|
|
508
|
-
value: product.discountable ? t("general.true") : t("general.false")
|
|
509
|
-
}
|
|
510
|
-
)
|
|
511
|
-
] });
|
|
512
|
-
};
|
|
513
|
-
|
|
514
|
-
// src/pages/products/[id]/_components/product-media-section/product-media-section.tsx
|
|
515
|
-
import { useState } from "react";
|
|
516
|
-
import { PencilSquare as PencilSquare2, ThumbnailBadge } from "@medusajs/icons";
|
|
517
|
-
import {
|
|
518
|
-
Button as Button2,
|
|
519
|
-
Checkbox,
|
|
520
|
-
clx,
|
|
521
|
-
CommandBar,
|
|
522
|
-
Container as Container3,
|
|
523
|
-
Heading as Heading3,
|
|
524
|
-
Text as Text2,
|
|
525
|
-
Tooltip,
|
|
526
|
-
usePrompt as usePrompt3
|
|
527
|
-
} from "@medusajs/ui";
|
|
528
|
-
import { useTranslation as useTranslation3 } from "react-i18next";
|
|
529
611
|
import { Link } from "react-router-dom";
|
|
530
|
-
import { jsx as
|
|
531
|
-
var ProductMediaSection = ({
|
|
532
|
-
product
|
|
533
|
-
}) => {
|
|
534
|
-
const { t } = useTranslation3();
|
|
535
|
-
const prompt = usePrompt3();
|
|
536
|
-
const [selection, setSelection] = useState({});
|
|
537
|
-
const media = getMedia(product);
|
|
538
|
-
const handleCheckedChange = (id) => {
|
|
539
|
-
setSelection((prev) => {
|
|
540
|
-
if (prev[id]) {
|
|
541
|
-
const { [id]: _, ...rest } = prev;
|
|
542
|
-
return rest;
|
|
543
|
-
} else {
|
|
544
|
-
return { ...prev, [id]: true };
|
|
545
|
-
}
|
|
546
|
-
});
|
|
547
|
-
};
|
|
548
|
-
const { mutateAsync } = useUpdateProduct(product.id);
|
|
549
|
-
const handleDelete = async () => {
|
|
550
|
-
const ids = Object.keys(selection);
|
|
551
|
-
const includingThumbnail = ids.some((id) => media.find((m) => m.id === id)?.isThumbnail);
|
|
552
|
-
const res = await prompt({
|
|
553
|
-
title: t("general.areYouSure"),
|
|
554
|
-
description: includingThumbnail ? t("products.media.deleteWarningWithThumbnail", {
|
|
555
|
-
count: ids.length
|
|
556
|
-
}) : t("products.media.deleteWarning", {
|
|
557
|
-
count: ids.length
|
|
558
|
-
}),
|
|
559
|
-
confirmText: t("actions.delete"),
|
|
560
|
-
cancelText: t("actions.cancel")
|
|
561
|
-
});
|
|
562
|
-
if (!res) {
|
|
563
|
-
return;
|
|
564
|
-
}
|
|
565
|
-
const mediaToKeep = product.images?.filter((i) => !ids.includes(i.id)).map((i) => ({ url: i.url }));
|
|
566
|
-
await mutateAsync(
|
|
567
|
-
{
|
|
568
|
-
images: mediaToKeep,
|
|
569
|
-
thumbnail: includingThumbnail ? "" : void 0
|
|
570
|
-
},
|
|
571
|
-
{
|
|
572
|
-
onSuccess: () => {
|
|
573
|
-
setSelection({});
|
|
574
|
-
}
|
|
575
|
-
}
|
|
576
|
-
);
|
|
577
|
-
};
|
|
578
|
-
return /* @__PURE__ */ jsxs3(Container3, { className: "divide-y p-0", children: [
|
|
579
|
-
/* @__PURE__ */ jsxs3("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
580
|
-
/* @__PURE__ */ jsx3(Heading3, { level: "h2", children: t("products.media.label") }),
|
|
581
|
-
/* @__PURE__ */ jsx3(
|
|
582
|
-
ActionMenu,
|
|
583
|
-
{
|
|
584
|
-
groups: [
|
|
585
|
-
{
|
|
586
|
-
actions: [
|
|
587
|
-
{
|
|
588
|
-
label: t("actions.edit"),
|
|
589
|
-
to: "media?view=edit",
|
|
590
|
-
icon: /* @__PURE__ */ jsx3(PencilSquare2, {})
|
|
591
|
-
}
|
|
592
|
-
]
|
|
593
|
-
}
|
|
594
|
-
]
|
|
595
|
-
}
|
|
596
|
-
)
|
|
597
|
-
] }),
|
|
598
|
-
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) => {
|
|
599
|
-
const isSelected = selection[i.id];
|
|
600
|
-
return /* @__PURE__ */ jsxs3(
|
|
601
|
-
"div",
|
|
602
|
-
{
|
|
603
|
-
className: "group relative aspect-square size-full cursor-pointer overflow-hidden rounded-[8px] shadow-elevation-card-rest transition-fg hover:shadow-elevation-card-hover",
|
|
604
|
-
children: [
|
|
605
|
-
/* @__PURE__ */ jsx3(
|
|
606
|
-
"div",
|
|
607
|
-
{
|
|
608
|
-
className: clx(
|
|
609
|
-
"invisible absolute right-2 top-2 opacity-0 transition-fg group-hover:visible group-hover:opacity-100",
|
|
610
|
-
{
|
|
611
|
-
"visible opacity-100": isSelected
|
|
612
|
-
}
|
|
613
|
-
),
|
|
614
|
-
children: /* @__PURE__ */ jsx3(
|
|
615
|
-
Checkbox,
|
|
616
|
-
{
|
|
617
|
-
checked: selection[i.id] || false,
|
|
618
|
-
onCheckedChange: () => handleCheckedChange(i.id)
|
|
619
|
-
}
|
|
620
|
-
)
|
|
621
|
-
}
|
|
622
|
-
),
|
|
623
|
-
i.isThumbnail && /* @__PURE__ */ jsx3("div", { className: "absolute left-2 top-2", children: /* @__PURE__ */ jsx3(Tooltip, { content: t("fields.thumbnail"), children: /* @__PURE__ */ jsx3(ThumbnailBadge, {}) }) }),
|
|
624
|
-
/* @__PURE__ */ jsx3(
|
|
625
|
-
Link,
|
|
626
|
-
{
|
|
627
|
-
to: `media`,
|
|
628
|
-
state: { curr: index },
|
|
629
|
-
children: /* @__PURE__ */ jsx3(
|
|
630
|
-
"img",
|
|
631
|
-
{
|
|
632
|
-
src: i.url,
|
|
633
|
-
alt: product.title,
|
|
634
|
-
className: "size-full object-cover"
|
|
635
|
-
}
|
|
636
|
-
)
|
|
637
|
-
}
|
|
638
|
-
)
|
|
639
|
-
]
|
|
640
|
-
},
|
|
641
|
-
i.id
|
|
642
|
-
);
|
|
643
|
-
}) }) : /* @__PURE__ */ jsxs3("div", { className: "flex flex-col items-center gap-y-4 pb-8 pt-6", children: [
|
|
644
|
-
/* @__PURE__ */ jsxs3("div", { className: "flex flex-col items-center", children: [
|
|
645
|
-
/* @__PURE__ */ jsx3(
|
|
646
|
-
Text2,
|
|
647
|
-
{
|
|
648
|
-
size: "small",
|
|
649
|
-
leading: "compact",
|
|
650
|
-
weight: "plus",
|
|
651
|
-
className: "text-ui-fg-subtle",
|
|
652
|
-
children: t("products.media.emptyState.header")
|
|
653
|
-
}
|
|
654
|
-
),
|
|
655
|
-
/* @__PURE__ */ jsx3(
|
|
656
|
-
Text2,
|
|
657
|
-
{
|
|
658
|
-
size: "small",
|
|
659
|
-
className: "text-ui-fg-muted",
|
|
660
|
-
children: t("products.media.emptyState.description")
|
|
661
|
-
}
|
|
662
|
-
)
|
|
663
|
-
] }),
|
|
664
|
-
/* @__PURE__ */ jsx3(
|
|
665
|
-
Button2,
|
|
666
|
-
{
|
|
667
|
-
size: "small",
|
|
668
|
-
variant: "secondary",
|
|
669
|
-
asChild: true,
|
|
670
|
-
children: /* @__PURE__ */ jsx3(Link, { to: "media?view=edit", children: t("products.media.emptyState.action") })
|
|
671
|
-
}
|
|
672
|
-
)
|
|
673
|
-
] }),
|
|
674
|
-
/* @__PURE__ */ jsx3(CommandBar, { open: !!Object.keys(selection).length, children: /* @__PURE__ */ jsxs3(CommandBar.Bar, { children: [
|
|
675
|
-
/* @__PURE__ */ jsx3(CommandBar.Value, { children: t("general.countSelected", {
|
|
676
|
-
count: Object.keys(selection).length
|
|
677
|
-
}) }),
|
|
678
|
-
/* @__PURE__ */ jsx3(CommandBar.Seperator, {}),
|
|
679
|
-
/* @__PURE__ */ jsx3(
|
|
680
|
-
CommandBar.Command,
|
|
681
|
-
{
|
|
682
|
-
action: handleDelete,
|
|
683
|
-
label: t("actions.delete"),
|
|
684
|
-
shortcut: "d"
|
|
685
|
-
}
|
|
686
|
-
)
|
|
687
|
-
] }) })
|
|
688
|
-
] });
|
|
689
|
-
};
|
|
690
|
-
var getMedia = (product) => {
|
|
691
|
-
const { images = [], thumbnail } = product;
|
|
692
|
-
const media = (images || []).map((image) => ({
|
|
693
|
-
id: image.id,
|
|
694
|
-
url: image.url,
|
|
695
|
-
isThumbnail: image.url === thumbnail
|
|
696
|
-
}));
|
|
697
|
-
if (thumbnail && !media.some((mediaItem) => mediaItem.url === thumbnail)) {
|
|
698
|
-
media.unshift({
|
|
699
|
-
id: "img_thumbnail",
|
|
700
|
-
url: thumbnail,
|
|
701
|
-
isThumbnail: true
|
|
702
|
-
});
|
|
703
|
-
}
|
|
704
|
-
return media;
|
|
705
|
-
};
|
|
706
|
-
|
|
707
|
-
// src/pages/products/[id]/_components/product-organization-section/product-organization-section.tsx
|
|
708
|
-
import { PencilSquare as PencilSquare3 } from "@medusajs/icons";
|
|
709
|
-
import { Badge, Container as Container4, Heading as Heading4, Tooltip as Tooltip2 } from "@medusajs/ui";
|
|
710
|
-
import { useTranslation as useTranslation4 } from "react-i18next";
|
|
711
|
-
import { Link as Link2 } from "react-router-dom";
|
|
712
|
-
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
612
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
713
613
|
var ProductOrganizationSection = ({
|
|
714
614
|
product
|
|
715
615
|
}) => {
|
|
716
|
-
const { t } =
|
|
717
|
-
return /* @__PURE__ */
|
|
718
|
-
|
|
616
|
+
const { t } = useTranslation2();
|
|
617
|
+
return /* @__PURE__ */ jsxs2(
|
|
618
|
+
Container2,
|
|
719
619
|
{
|
|
720
620
|
className: "divide-y p-0",
|
|
721
621
|
"data-testid": "product-organization-section",
|
|
722
622
|
children: [
|
|
723
|
-
/* @__PURE__ */
|
|
623
|
+
/* @__PURE__ */ jsxs2(
|
|
724
624
|
"div",
|
|
725
625
|
{
|
|
726
626
|
className: "flex items-center justify-between px-6 py-4",
|
|
727
627
|
"data-testid": "product-organization-header",
|
|
728
628
|
children: [
|
|
729
|
-
/* @__PURE__ */
|
|
730
|
-
/* @__PURE__ */
|
|
629
|
+
/* @__PURE__ */ jsx2(Heading2, { level: "h2", "data-testid": "product-organization-title", children: t("products.organization.header") }),
|
|
630
|
+
/* @__PURE__ */ jsx2(
|
|
731
631
|
ActionMenu,
|
|
732
632
|
{
|
|
733
633
|
groups: [
|
|
@@ -736,7 +636,7 @@ var ProductOrganizationSection = ({
|
|
|
736
636
|
{
|
|
737
637
|
label: t("actions.edit"),
|
|
738
638
|
to: "organization",
|
|
739
|
-
icon: /* @__PURE__ */
|
|
639
|
+
icon: /* @__PURE__ */ jsx2(PencilSquare, {})
|
|
740
640
|
}
|
|
741
641
|
]
|
|
742
642
|
}
|
|
@@ -747,76 +647,62 @@ var ProductOrganizationSection = ({
|
|
|
747
647
|
]
|
|
748
648
|
}
|
|
749
649
|
),
|
|
750
|
-
/* @__PURE__ */
|
|
650
|
+
/* @__PURE__ */ jsx2(
|
|
751
651
|
SectionRow,
|
|
752
652
|
{
|
|
753
|
-
title: t("fields.
|
|
754
|
-
value: product.
|
|
653
|
+
title: t("fields.category"),
|
|
654
|
+
value: product.categories?.length ? product.categories.map((pcat) => /* @__PURE__ */ jsx2(
|
|
755
655
|
OrganizationTag,
|
|
756
656
|
{
|
|
757
|
-
label:
|
|
758
|
-
to: `/
|
|
657
|
+
label: pcat.name,
|
|
658
|
+
to: `/categories/${pcat.id}`
|
|
759
659
|
},
|
|
760
|
-
|
|
660
|
+
pcat.id
|
|
761
661
|
)) : void 0,
|
|
762
|
-
"data-testid": "product-
|
|
662
|
+
"data-testid": "product-categories-row"
|
|
763
663
|
}
|
|
764
664
|
),
|
|
765
|
-
/* @__PURE__ */
|
|
665
|
+
/* @__PURE__ */ jsx2(
|
|
766
666
|
SectionRow,
|
|
767
667
|
{
|
|
768
|
-
title: t("fields.
|
|
769
|
-
value: product.
|
|
668
|
+
title: t("fields.collection"),
|
|
669
|
+
value: product.collection ? /* @__PURE__ */ jsx2(
|
|
770
670
|
OrganizationTag,
|
|
771
671
|
{
|
|
772
|
-
label: product.
|
|
773
|
-
to: `/
|
|
672
|
+
label: product.collection.title,
|
|
673
|
+
to: `/collections/${product.collection.id}`
|
|
774
674
|
}
|
|
775
675
|
) : void 0,
|
|
776
|
-
"data-testid": "product-
|
|
676
|
+
"data-testid": "product-collection-row"
|
|
777
677
|
}
|
|
778
678
|
),
|
|
779
|
-
/* @__PURE__ */
|
|
679
|
+
/* @__PURE__ */ jsx2(
|
|
780
680
|
SectionRow,
|
|
781
681
|
{
|
|
782
|
-
title: t("fields.
|
|
783
|
-
value: product.
|
|
682
|
+
title: t("fields.tags"),
|
|
683
|
+
value: product.tags?.length ? product.tags.map((tag) => /* @__PURE__ */ jsx2(
|
|
784
684
|
OrganizationTag,
|
|
785
685
|
{
|
|
786
|
-
label:
|
|
787
|
-
to: `/settings/product-
|
|
788
|
-
}
|
|
789
|
-
|
|
790
|
-
|
|
686
|
+
label: tag.value,
|
|
687
|
+
to: `/settings/product-tags/${tag.id}`
|
|
688
|
+
},
|
|
689
|
+
tag.id
|
|
690
|
+
)) : void 0,
|
|
691
|
+
"data-testid": "product-tags-row"
|
|
791
692
|
}
|
|
792
693
|
),
|
|
793
|
-
/* @__PURE__ */
|
|
694
|
+
/* @__PURE__ */ jsx2(
|
|
794
695
|
SectionRow,
|
|
795
696
|
{
|
|
796
|
-
title: t("fields.
|
|
797
|
-
value: product.
|
|
697
|
+
title: t("fields.type"),
|
|
698
|
+
value: product.type ? /* @__PURE__ */ jsx2(
|
|
798
699
|
OrganizationTag,
|
|
799
700
|
{
|
|
800
|
-
label: product.
|
|
801
|
-
to: `/
|
|
701
|
+
label: product.type.value,
|
|
702
|
+
to: `/settings/product-types/${product.type_id}`
|
|
802
703
|
}
|
|
803
704
|
) : void 0,
|
|
804
|
-
"data-testid": "product-
|
|
805
|
-
}
|
|
806
|
-
),
|
|
807
|
-
/* @__PURE__ */ jsx4(
|
|
808
|
-
SectionRow,
|
|
809
|
-
{
|
|
810
|
-
title: t("fields.categories"),
|
|
811
|
-
value: product.categories?.length ? product.categories.map((pcat) => /* @__PURE__ */ jsx4(
|
|
812
|
-
OrganizationTag,
|
|
813
|
-
{
|
|
814
|
-
label: pcat.name,
|
|
815
|
-
to: `/categories/${pcat.id}`
|
|
816
|
-
},
|
|
817
|
-
pcat.id
|
|
818
|
-
)) : void 0,
|
|
819
|
-
"data-testid": "product-categories-row"
|
|
705
|
+
"data-testid": "product-type-row"
|
|
820
706
|
}
|
|
821
707
|
)
|
|
822
708
|
]
|
|
@@ -824,8 +710,8 @@ var ProductOrganizationSection = ({
|
|
|
824
710
|
);
|
|
825
711
|
};
|
|
826
712
|
var OrganizationTag = ({ label, to }) => {
|
|
827
|
-
return /* @__PURE__ */
|
|
828
|
-
|
|
713
|
+
return /* @__PURE__ */ jsx2(Tooltip, { content: label, children: /* @__PURE__ */ jsx2(Badge, { size: "2xsmall", className: "block w-fit truncate", asChild: true, children: /* @__PURE__ */ jsx2(
|
|
714
|
+
Link,
|
|
829
715
|
{
|
|
830
716
|
to,
|
|
831
717
|
"data-testid": `organization-tag-${label.toLowerCase().replace(/\s+/g, "-")}`,
|
|
@@ -836,25 +722,27 @@ var OrganizationTag = ({ label, to }) => {
|
|
|
836
722
|
|
|
837
723
|
// src/pages/products/[id]/_components/product-variant-section/product-variant-section.tsx
|
|
838
724
|
import { useCallback, useMemo as useMemo2 } from "react";
|
|
839
|
-
import { PencilSquare as
|
|
725
|
+
import { PencilSquare as PencilSquare2, Trash } from "@medusajs/icons";
|
|
840
726
|
import {
|
|
841
727
|
Badge as Badge2,
|
|
842
|
-
|
|
728
|
+
Button as Button2,
|
|
729
|
+
Container as Container3,
|
|
843
730
|
createDataTableColumnHelper,
|
|
731
|
+
Heading as Heading3,
|
|
844
732
|
toast as toast2,
|
|
845
|
-
Tooltip as
|
|
846
|
-
usePrompt as
|
|
733
|
+
Tooltip as Tooltip2,
|
|
734
|
+
usePrompt as usePrompt2
|
|
847
735
|
} from "@medusajs/ui";
|
|
848
736
|
import { keepPreviousData } from "@tanstack/react-query";
|
|
849
|
-
import { useTranslation as
|
|
850
|
-
import {
|
|
851
|
-
import { jsx as
|
|
737
|
+
import { useTranslation as useTranslation3 } from "react-i18next";
|
|
738
|
+
import { Link as Link2, useNavigate, useSearchParams } from "react-router-dom";
|
|
739
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
852
740
|
var PAGE_SIZE = 10;
|
|
853
741
|
var PREFIX = "pv";
|
|
854
742
|
var ProductVariantSection = ({
|
|
855
743
|
product
|
|
856
744
|
}) => {
|
|
857
|
-
const { t } =
|
|
745
|
+
const { t } = useTranslation3();
|
|
858
746
|
const { q, order, offset, created_at, updated_at } = useQueryParams(
|
|
859
747
|
["q", "order", "offset", "created_at", "updated_at"],
|
|
860
748
|
PREFIX
|
|
@@ -870,7 +758,7 @@ var ProductVariantSection = ({
|
|
|
870
758
|
limit: PAGE_SIZE,
|
|
871
759
|
created_at: created_at ? JSON.parse(created_at) : void 0,
|
|
872
760
|
updated_at: updated_at ? JSON.parse(updated_at) : void 0,
|
|
873
|
-
fields: "title,created_at,updated_at,*
|
|
761
|
+
fields: "title,sku,created_at,updated_at,*options,*options.option"
|
|
874
762
|
},
|
|
875
763
|
{
|
|
876
764
|
placeholderData: keepPreviousData
|
|
@@ -879,42 +767,52 @@ var ProductVariantSection = ({
|
|
|
879
767
|
if (isError) {
|
|
880
768
|
throw error;
|
|
881
769
|
}
|
|
882
|
-
return /* @__PURE__ */
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
heading: t("products.variants.header"),
|
|
894
|
-
emptyState: {
|
|
895
|
-
empty: {
|
|
896
|
-
heading: t("products.variants.empty.heading"),
|
|
897
|
-
description: t("products.variants.empty.description")
|
|
898
|
-
},
|
|
899
|
-
filtered: {
|
|
900
|
-
heading: t("products.variants.filtered.heading"),
|
|
901
|
-
description: t("products.variants.filtered.description")
|
|
770
|
+
return /* @__PURE__ */ jsxs3(Container3, { className: "p-0", "data-testid": "product-variant-section", children: [
|
|
771
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
772
|
+
/* @__PURE__ */ jsx3(Heading3, { level: "h2", children: t("products.variants.header") }),
|
|
773
|
+
/* @__PURE__ */ jsx3(
|
|
774
|
+
Button2,
|
|
775
|
+
{
|
|
776
|
+
size: "small",
|
|
777
|
+
variant: "secondary",
|
|
778
|
+
asChild: true,
|
|
779
|
+
"data-testid": "product-variants-create-button",
|
|
780
|
+
children: /* @__PURE__ */ jsx3(Link2, { to: "variants/create", children: t("actions.create") })
|
|
902
781
|
}
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
782
|
+
)
|
|
783
|
+
] }),
|
|
784
|
+
/* @__PURE__ */ jsx3("div", { "data-testid": "product-variants-table-container", children: /* @__PURE__ */ jsx3(
|
|
785
|
+
DataTable,
|
|
786
|
+
{
|
|
787
|
+
data: variants,
|
|
788
|
+
columns,
|
|
789
|
+
filters,
|
|
790
|
+
rowCount: count,
|
|
791
|
+
getRowId: (row) => row.id,
|
|
792
|
+
rowHref: (row) => `/products/${product.id}/variants/${row.id}`,
|
|
793
|
+
pageSize: PAGE_SIZE,
|
|
794
|
+
isLoading: isPending,
|
|
795
|
+
emptyState: {
|
|
796
|
+
empty: {
|
|
797
|
+
heading: t("products.variants.empty.heading"),
|
|
798
|
+
description: t("products.variants.empty.description")
|
|
799
|
+
},
|
|
800
|
+
filtered: {
|
|
801
|
+
heading: t("products.variants.filtered.heading"),
|
|
802
|
+
description: t("products.variants.filtered.description")
|
|
803
|
+
}
|
|
804
|
+
},
|
|
805
|
+
prefix: PREFIX
|
|
806
|
+
}
|
|
807
|
+
) })
|
|
808
|
+
] });
|
|
911
809
|
};
|
|
912
810
|
var columnHelper = createDataTableColumnHelper();
|
|
913
811
|
var useColumns = (product) => {
|
|
914
|
-
const { t } =
|
|
915
|
-
const navigate =
|
|
812
|
+
const { t } = useTranslation3();
|
|
813
|
+
const navigate = useNavigate();
|
|
916
814
|
const { mutateAsync } = useDeleteVariantLazy(product.id);
|
|
917
|
-
const prompt =
|
|
815
|
+
const prompt = usePrompt2();
|
|
918
816
|
const [searchParams] = useSearchParams();
|
|
919
817
|
const tableSearchParams = useMemo2(() => {
|
|
920
818
|
const filtered = new URLSearchParams();
|
|
@@ -950,44 +848,8 @@ var useColumns = (product) => {
|
|
|
950
848
|
},
|
|
951
849
|
[mutateAsync, prompt, t]
|
|
952
850
|
);
|
|
953
|
-
const optionColumns = useMemo2(() => {
|
|
954
|
-
if (!product?.options) {
|
|
955
|
-
return [];
|
|
956
|
-
}
|
|
957
|
-
return product.options.map((option) => {
|
|
958
|
-
return columnHelper.display({
|
|
959
|
-
id: option.id,
|
|
960
|
-
header: option.title,
|
|
961
|
-
cell: ({ row }) => {
|
|
962
|
-
const variantOpt = row.original.options?.find(
|
|
963
|
-
(opt) => opt.option_id === option.id
|
|
964
|
-
);
|
|
965
|
-
if (!variantOpt) {
|
|
966
|
-
return /* @__PURE__ */ jsx5("span", { className: "text-ui-fg-muted", children: "-" });
|
|
967
|
-
}
|
|
968
|
-
return /* @__PURE__ */ jsx5(
|
|
969
|
-
"div",
|
|
970
|
-
{
|
|
971
|
-
className: "flex items-center",
|
|
972
|
-
"data-testid": `product-variant-option-${option.id}-${row.original.id}`,
|
|
973
|
-
children: /* @__PURE__ */ jsx5(Tooltip3, { content: variantOpt.value, children: /* @__PURE__ */ jsx5(
|
|
974
|
-
Badge2,
|
|
975
|
-
{
|
|
976
|
-
size: "2xsmall",
|
|
977
|
-
title: variantOpt.value,
|
|
978
|
-
className: "inline-flex min-w-[20px] max-w-[140px] items-center justify-center overflow-hidden truncate",
|
|
979
|
-
"data-testid": `product-variant-option-badge-${option.id}-${row.original.id}-${variantOpt.value}`,
|
|
980
|
-
children: variantOpt.value
|
|
981
|
-
}
|
|
982
|
-
) })
|
|
983
|
-
}
|
|
984
|
-
);
|
|
985
|
-
}
|
|
986
|
-
});
|
|
987
|
-
});
|
|
988
|
-
}, [product]);
|
|
989
851
|
const attributeColumns = useMemo2(() => {
|
|
990
|
-
const variantAttributes = product?.
|
|
852
|
+
const variantAttributes = product?.attributes?.filter((attr) => attr.is_variant_axis);
|
|
991
853
|
if (!variantAttributes?.length) {
|
|
992
854
|
return [];
|
|
993
855
|
}
|
|
@@ -996,28 +858,27 @@ var useColumns = (product) => {
|
|
|
996
858
|
id: `attribute-${attribute.id}`,
|
|
997
859
|
header: attribute.name,
|
|
998
860
|
cell: ({ row }) => {
|
|
999
|
-
const
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
)
|
|
1003
|
-
|
|
1004
|
-
return /* @__PURE__ */ jsx5("span", { className: "text-ui-fg-muted", children: "-" });
|
|
861
|
+
const variantOpt = row.original.options?.find(
|
|
862
|
+
(opt) => opt.option?.title === attribute.name
|
|
863
|
+
);
|
|
864
|
+
if (!variantOpt?.value) {
|
|
865
|
+
return /* @__PURE__ */ jsx3("span", { className: "text-ui-fg-muted", children: "-" });
|
|
1005
866
|
}
|
|
1006
|
-
return /* @__PURE__ */
|
|
867
|
+
return /* @__PURE__ */ jsx3(
|
|
1007
868
|
"div",
|
|
1008
869
|
{
|
|
1009
870
|
className: "flex flex-wrap items-center gap-1",
|
|
1010
871
|
"data-testid": `product-variant-attribute-${attribute.id}-${row.original.id}`,
|
|
1011
|
-
children:
|
|
872
|
+
children: /* @__PURE__ */ jsx3(Tooltip2, { content: variantOpt.value, children: /* @__PURE__ */ jsx3(
|
|
1012
873
|
Badge2,
|
|
1013
874
|
{
|
|
1014
875
|
size: "2xsmall",
|
|
1015
|
-
title: value
|
|
876
|
+
title: variantOpt.value,
|
|
1016
877
|
className: "inline-flex min-w-[20px] max-w-[140px] items-center justify-center overflow-hidden truncate",
|
|
1017
|
-
"data-testid": `product-variant-attribute-badge-${attribute.id}-${row.original.id}-${value
|
|
1018
|
-
children: value
|
|
878
|
+
"data-testid": `product-variant-attribute-badge-${attribute.id}-${row.original.id}-${variantOpt.value}`,
|
|
879
|
+
children: variantOpt.value
|
|
1019
880
|
}
|
|
1020
|
-
) }
|
|
881
|
+
) })
|
|
1021
882
|
}
|
|
1022
883
|
);
|
|
1023
884
|
}
|
|
@@ -1029,7 +890,7 @@ var useColumns = (product) => {
|
|
|
1029
890
|
const variant = _ctx.row.original;
|
|
1030
891
|
const mainActions = [
|
|
1031
892
|
{
|
|
1032
|
-
icon: /* @__PURE__ */
|
|
893
|
+
icon: /* @__PURE__ */ jsx3(PencilSquare2, {}),
|
|
1033
894
|
label: t("actions.edit"),
|
|
1034
895
|
onClick: (row) => {
|
|
1035
896
|
navigate(
|
|
@@ -1045,7 +906,7 @@ var useColumns = (product) => {
|
|
|
1045
906
|
];
|
|
1046
907
|
const secondaryActions = [
|
|
1047
908
|
{
|
|
1048
|
-
icon: /* @__PURE__ */
|
|
909
|
+
icon: /* @__PURE__ */ jsx3(Trash, {}),
|
|
1049
910
|
label: t("actions.delete"),
|
|
1050
911
|
onClick: () => handleDelete(variant.id, variant.title)
|
|
1051
912
|
}
|
|
@@ -1062,14 +923,20 @@ var useColumns = (product) => {
|
|
|
1062
923
|
sortAscLabel: t("filters.sorting.alphabeticallyAsc"),
|
|
1063
924
|
sortDescLabel: t("filters.sorting.alphabeticallyDesc")
|
|
1064
925
|
}),
|
|
1065
|
-
|
|
926
|
+
columnHelper.accessor("sku", {
|
|
927
|
+
header: t("fields.sku"),
|
|
928
|
+
cell: ({ getValue }) => {
|
|
929
|
+
const value = getValue();
|
|
930
|
+
return value ? value : /* @__PURE__ */ jsx3("span", { className: "text-ui-fg-muted", children: "-" });
|
|
931
|
+
}
|
|
932
|
+
}),
|
|
1066
933
|
...attributeColumns,
|
|
1067
934
|
...dateColumns,
|
|
1068
935
|
columnHelper.action({
|
|
1069
936
|
actions: getActions
|
|
1070
937
|
})
|
|
1071
938
|
];
|
|
1072
|
-
}, [t,
|
|
939
|
+
}, [t, attributeColumns, dateColumns, getActions]);
|
|
1073
940
|
};
|
|
1074
941
|
var useFilters = () => {
|
|
1075
942
|
const dateFilters = useDataTableDateFilters();
|
|
@@ -1082,28 +949,29 @@ var useFilters = () => {
|
|
|
1082
949
|
import {
|
|
1083
950
|
ListBullet,
|
|
1084
951
|
Plus,
|
|
1085
|
-
Trash as
|
|
952
|
+
Trash as Trash2,
|
|
1086
953
|
Swatch,
|
|
1087
954
|
DropCap,
|
|
1088
|
-
InformationCircleSolid
|
|
955
|
+
InformationCircleSolid,
|
|
956
|
+
PencilSquare as PencilSquare3
|
|
1089
957
|
} from "@medusajs/icons";
|
|
1090
958
|
import {
|
|
1091
959
|
Badge as Badge3,
|
|
1092
|
-
Container as
|
|
1093
|
-
Heading as
|
|
1094
|
-
Text as
|
|
960
|
+
Container as Container4,
|
|
961
|
+
Heading as Heading4,
|
|
962
|
+
Text as Text2,
|
|
1095
963
|
toast as toast3,
|
|
1096
|
-
Tooltip as
|
|
1097
|
-
usePrompt as
|
|
964
|
+
Tooltip as Tooltip3,
|
|
965
|
+
usePrompt as usePrompt3
|
|
1098
966
|
} from "@medusajs/ui";
|
|
1099
|
-
import { useTranslation as
|
|
1100
|
-
import { jsx as
|
|
967
|
+
import { useTranslation as useTranslation4 } from "react-i18next";
|
|
968
|
+
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1101
969
|
var AttributeActions = ({
|
|
1102
970
|
productId,
|
|
1103
971
|
attribute
|
|
1104
972
|
}) => {
|
|
1105
|
-
const { t } =
|
|
1106
|
-
const prompt =
|
|
973
|
+
const { t } = useTranslation4();
|
|
974
|
+
const prompt = usePrompt3();
|
|
1107
975
|
const { mutateAsync } = useRemoveProductAttribute(productId, attribute.id);
|
|
1108
976
|
const handleDelete = async () => {
|
|
1109
977
|
const res = await prompt({
|
|
@@ -1123,16 +991,27 @@ var AttributeActions = ({
|
|
|
1123
991
|
}
|
|
1124
992
|
});
|
|
1125
993
|
};
|
|
1126
|
-
return /* @__PURE__ */
|
|
994
|
+
return /* @__PURE__ */ jsx4(
|
|
1127
995
|
ActionMenu,
|
|
1128
996
|
{
|
|
1129
997
|
groups: [
|
|
998
|
+
{
|
|
999
|
+
actions: [
|
|
1000
|
+
{
|
|
1001
|
+
label: t("actions.edit"),
|
|
1002
|
+
to: `attributes/${attribute.id}/edit`,
|
|
1003
|
+
icon: /* @__PURE__ */ jsx4(PencilSquare3, {})
|
|
1004
|
+
}
|
|
1005
|
+
]
|
|
1006
|
+
},
|
|
1130
1007
|
{
|
|
1131
1008
|
actions: [
|
|
1132
1009
|
{
|
|
1133
1010
|
label: t("actions.delete"),
|
|
1134
1011
|
onClick: handleDelete,
|
|
1135
|
-
icon: /* @__PURE__ */
|
|
1012
|
+
icon: /* @__PURE__ */ jsx4(Trash2, {}),
|
|
1013
|
+
disabled: attribute.is_required,
|
|
1014
|
+
disabledTooltip: attribute.is_required ? t("products.attributeRequiredDeleteDisabledTooltip") : void 0
|
|
1136
1015
|
}
|
|
1137
1016
|
]
|
|
1138
1017
|
}
|
|
@@ -1147,37 +1026,37 @@ var AttributeGroup = ({
|
|
|
1147
1026
|
attributes,
|
|
1148
1027
|
productId
|
|
1149
1028
|
}) => {
|
|
1150
|
-
const { t } =
|
|
1029
|
+
const { t } = useTranslation4();
|
|
1151
1030
|
if (!attributes.length) {
|
|
1152
1031
|
return null;
|
|
1153
1032
|
}
|
|
1154
|
-
return /* @__PURE__ */
|
|
1155
|
-
/* @__PURE__ */
|
|
1156
|
-
/* @__PURE__ */
|
|
1157
|
-
/* @__PURE__ */
|
|
1158
|
-
/* @__PURE__ */
|
|
1159
|
-
/* @__PURE__ */
|
|
1033
|
+
return /* @__PURE__ */ jsxs4("div", { className: "flex flex-col gap-y-4 px-3 py-4", children: [
|
|
1034
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-x-3 px-3", children: [
|
|
1035
|
+
/* @__PURE__ */ jsx4("div", { className: "text-ui-fg-muted flex h-8 w-8 items-center justify-center rounded-lg border border-ui-border-base bg-ui-bg-component", children: icon }),
|
|
1036
|
+
/* @__PURE__ */ jsxs4("div", { children: [
|
|
1037
|
+
/* @__PURE__ */ jsx4(Text2, { size: "small", weight: "plus", leading: "compact", children: title }),
|
|
1038
|
+
/* @__PURE__ */ jsx4(Text2, { size: "small", leading: "compact", className: "text-ui-fg-subtle", children: description })
|
|
1160
1039
|
] })
|
|
1161
1040
|
] }),
|
|
1162
|
-
/* @__PURE__ */
|
|
1041
|
+
/* @__PURE__ */ jsx4("div", { className: "flex flex-col gap-y-0", children: /* @__PURE__ */ jsx4("div", { className: "overflow-hidden rounded-xl border border-ui-border-base", children: attributes.map((attr, index) => {
|
|
1163
1042
|
const values = attr.values?.map((v) => v.name) ?? [];
|
|
1164
|
-
return /* @__PURE__ */
|
|
1043
|
+
return /* @__PURE__ */ jsx4(
|
|
1165
1044
|
"div",
|
|
1166
1045
|
{
|
|
1167
1046
|
className: index < attributes.length - 1 ? "border-b border-ui-border-base" : "",
|
|
1168
|
-
children: /* @__PURE__ */
|
|
1169
|
-
/* @__PURE__ */
|
|
1170
|
-
/* @__PURE__ */
|
|
1171
|
-
attr.description && /* @__PURE__ */
|
|
1172
|
-
attr.is_required && /* @__PURE__ */
|
|
1173
|
-
|
|
1047
|
+
children: /* @__PURE__ */ jsxs4("div", { className: "grid grid-cols-[1fr_1fr_28px] items-center gap-4 bg-ui-bg-component px-4 py-3", children: [
|
|
1048
|
+
/* @__PURE__ */ jsxs4("div", { className: "text-ui-fg-subtle flex items-center gap-x-2", children: [
|
|
1049
|
+
/* @__PURE__ */ jsx4(Text2, { size: "small", weight: "plus", leading: "compact", children: attr.name }),
|
|
1050
|
+
attr.description && /* @__PURE__ */ jsx4(Tooltip3, { content: attr.description, children: /* @__PURE__ */ jsx4("span", { className: "text-ui-fg-muted flex items-center", children: /* @__PURE__ */ jsx4(InformationCircleSolid, {}) }) }),
|
|
1051
|
+
attr.is_required && /* @__PURE__ */ jsx4(
|
|
1052
|
+
Tooltip3,
|
|
1174
1053
|
{
|
|
1175
1054
|
content: t("products.attributeRequiredByMarketplace"),
|
|
1176
|
-
children: /* @__PURE__ */
|
|
1055
|
+
children: /* @__PURE__ */ jsx4("span", { className: "text-ui-fg-muted flex items-center", children: /* @__PURE__ */ jsx4(InformationCircleSolid, {}) })
|
|
1177
1056
|
}
|
|
1178
1057
|
)
|
|
1179
1058
|
] }),
|
|
1180
|
-
/* @__PURE__ */
|
|
1059
|
+
/* @__PURE__ */ jsx4("div", { className: "flex flex-wrap gap-1", children: ["single_select", "multi_select"].includes(attr.type) ? values.map((val) => /* @__PURE__ */ jsx4(
|
|
1181
1060
|
Badge3,
|
|
1182
1061
|
{
|
|
1183
1062
|
size: "2xsmall",
|
|
@@ -1185,8 +1064,8 @@ var AttributeGroup = ({
|
|
|
1185
1064
|
children: val
|
|
1186
1065
|
},
|
|
1187
1066
|
val
|
|
1188
|
-
)) : /* @__PURE__ */
|
|
1189
|
-
|
|
1067
|
+
)) : /* @__PURE__ */ jsx4(
|
|
1068
|
+
Text2,
|
|
1190
1069
|
{
|
|
1191
1070
|
size: "small",
|
|
1192
1071
|
leading: "compact",
|
|
@@ -1194,7 +1073,7 @@ var AttributeGroup = ({
|
|
|
1194
1073
|
children: values.join(", ") || "-"
|
|
1195
1074
|
}
|
|
1196
1075
|
) }),
|
|
1197
|
-
/* @__PURE__ */
|
|
1076
|
+
/* @__PURE__ */ jsx4(AttributeActions, { productId, attribute: attr })
|
|
1198
1077
|
] })
|
|
1199
1078
|
},
|
|
1200
1079
|
attr.id
|
|
@@ -1205,19 +1084,19 @@ var AttributeGroup = ({
|
|
|
1205
1084
|
var ProductAttributeSection = ({
|
|
1206
1085
|
product
|
|
1207
1086
|
}) => {
|
|
1208
|
-
const { t } =
|
|
1087
|
+
const { t } = useTranslation4();
|
|
1209
1088
|
const allAttributes = product.attributes ?? [];
|
|
1210
1089
|
const variantAttributes = allAttributes.filter((a) => a.is_variant_axis);
|
|
1211
1090
|
const infoAttributes = allAttributes.filter((a) => !a.is_variant_axis);
|
|
1212
1091
|
const isEmpty = !variantAttributes.length && !infoAttributes.length;
|
|
1213
|
-
return /* @__PURE__ */
|
|
1214
|
-
/* @__PURE__ */
|
|
1092
|
+
return /* @__PURE__ */ jsxs4(Container4, { className: "p-0", children: [
|
|
1093
|
+
/* @__PURE__ */ jsxs4(
|
|
1215
1094
|
"div",
|
|
1216
1095
|
{
|
|
1217
1096
|
className: `flex items-center justify-between px-6 py-4${isEmpty ? "" : " border-b border-ui-border-base"}`,
|
|
1218
1097
|
children: [
|
|
1219
|
-
/* @__PURE__ */
|
|
1220
|
-
/* @__PURE__ */
|
|
1098
|
+
/* @__PURE__ */ jsx4(Heading4, { level: "h2", children: t("products.attributes") }),
|
|
1099
|
+
/* @__PURE__ */ jsx4(
|
|
1221
1100
|
ActionMenu,
|
|
1222
1101
|
{
|
|
1223
1102
|
groups: [
|
|
@@ -1226,12 +1105,12 @@ var ProductAttributeSection = ({
|
|
|
1226
1105
|
{
|
|
1227
1106
|
label: t("products.create.attributes.addExisting"),
|
|
1228
1107
|
to: "attributes/add",
|
|
1229
|
-
icon: /* @__PURE__ */
|
|
1108
|
+
icon: /* @__PURE__ */ jsx4(ListBullet, {})
|
|
1230
1109
|
},
|
|
1231
1110
|
{
|
|
1232
1111
|
label: t("products.create.attributes.createNew"),
|
|
1233
1112
|
to: "attributes/create",
|
|
1234
|
-
icon: /* @__PURE__ */
|
|
1113
|
+
icon: /* @__PURE__ */ jsx4(Plus, {})
|
|
1235
1114
|
}
|
|
1236
1115
|
]
|
|
1237
1116
|
}
|
|
@@ -1241,21 +1120,21 @@ var ProductAttributeSection = ({
|
|
|
1241
1120
|
]
|
|
1242
1121
|
}
|
|
1243
1122
|
),
|
|
1244
|
-
variantAttributes.length > 0 && /* @__PURE__ */
|
|
1123
|
+
variantAttributes.length > 0 && /* @__PURE__ */ jsx4(
|
|
1245
1124
|
AttributeGroup,
|
|
1246
1125
|
{
|
|
1247
|
-
icon: /* @__PURE__ */
|
|
1126
|
+
icon: /* @__PURE__ */ jsx4(Swatch, {}),
|
|
1248
1127
|
title: t("products.create.tabs.variants"),
|
|
1249
1128
|
description: t("products.attributeVariantsDescription"),
|
|
1250
1129
|
attributes: variantAttributes,
|
|
1251
1130
|
productId: product.id
|
|
1252
1131
|
}
|
|
1253
1132
|
),
|
|
1254
|
-
variantAttributes.length > 0 && infoAttributes.length > 0 && /* @__PURE__ */
|
|
1255
|
-
infoAttributes.length > 0 && /* @__PURE__ */
|
|
1133
|
+
variantAttributes.length > 0 && infoAttributes.length > 0 && /* @__PURE__ */ jsx4("div", { className: "border-t border-dashed border-ui-border-base" }),
|
|
1134
|
+
infoAttributes.length > 0 && /* @__PURE__ */ jsx4(
|
|
1256
1135
|
AttributeGroup,
|
|
1257
1136
|
{
|
|
1258
|
-
icon: /* @__PURE__ */
|
|
1137
|
+
icon: /* @__PURE__ */ jsx4(DropCap, {}),
|
|
1259
1138
|
title: t("products.attributeProductInformation"),
|
|
1260
1139
|
description: t("products.attributeProductInformationDescription"),
|
|
1261
1140
|
attributes: infoAttributes,
|
|
@@ -1266,19 +1145,19 @@ var ProductAttributeSection = ({
|
|
|
1266
1145
|
};
|
|
1267
1146
|
|
|
1268
1147
|
// src/pages/products/[id]/_components/product-shipping-profile-section/product-shipping-profile-section.tsx
|
|
1269
|
-
import { PencilSquare as
|
|
1270
|
-
import { Container as
|
|
1271
|
-
import { useTranslation as
|
|
1272
|
-
import { jsx as
|
|
1148
|
+
import { PencilSquare as PencilSquare4, ShoppingBag } from "@medusajs/icons";
|
|
1149
|
+
import { Container as Container5, Heading as Heading5 } from "@medusajs/ui";
|
|
1150
|
+
import { useTranslation as useTranslation5 } from "react-i18next";
|
|
1151
|
+
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1273
1152
|
var ProductShippingProfileSection = ({
|
|
1274
1153
|
product
|
|
1275
1154
|
}) => {
|
|
1276
|
-
const { t } =
|
|
1155
|
+
const { t } = useTranslation5();
|
|
1277
1156
|
const shippingProfile = product.shipping_profile;
|
|
1278
|
-
return /* @__PURE__ */
|
|
1279
|
-
/* @__PURE__ */
|
|
1280
|
-
/* @__PURE__ */
|
|
1281
|
-
/* @__PURE__ */
|
|
1157
|
+
return /* @__PURE__ */ jsxs5(Container5, { className: "p-0", children: [
|
|
1158
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
1159
|
+
/* @__PURE__ */ jsx5(Heading5, { level: "h2", children: t("products.shippingProfile.header") }),
|
|
1160
|
+
/* @__PURE__ */ jsx5(
|
|
1282
1161
|
ActionMenu,
|
|
1283
1162
|
{
|
|
1284
1163
|
groups: [
|
|
@@ -1287,7 +1166,7 @@ var ProductShippingProfileSection = ({
|
|
|
1287
1166
|
{
|
|
1288
1167
|
label: t("actions.edit"),
|
|
1289
1168
|
to: "shipping-profile",
|
|
1290
|
-
icon: /* @__PURE__ */
|
|
1169
|
+
icon: /* @__PURE__ */ jsx5(PencilSquare4, {})
|
|
1291
1170
|
}
|
|
1292
1171
|
]
|
|
1293
1172
|
}
|
|
@@ -1295,38 +1174,38 @@ var ProductShippingProfileSection = ({
|
|
|
1295
1174
|
}
|
|
1296
1175
|
)
|
|
1297
1176
|
] }),
|
|
1298
|
-
shippingProfile && /* @__PURE__ */
|
|
1177
|
+
shippingProfile && /* @__PURE__ */ jsx5(
|
|
1299
1178
|
SidebarLink,
|
|
1300
1179
|
{
|
|
1301
1180
|
to: `/settings/locations/shipping-profiles/${shippingProfile.id}`,
|
|
1302
1181
|
labelKey: shippingProfile.name,
|
|
1303
1182
|
descriptionKey: shippingProfile.type,
|
|
1304
|
-
icon: /* @__PURE__ */
|
|
1183
|
+
icon: /* @__PURE__ */ jsx5(ShoppingBag, {})
|
|
1305
1184
|
}
|
|
1306
1185
|
)
|
|
1307
1186
|
] });
|
|
1308
1187
|
};
|
|
1309
1188
|
|
|
1310
1189
|
// src/pages/products/[id]/_components/product-sales-channel-section/product-sales-channel-section.tsx
|
|
1311
|
-
import { Channels, PencilSquare as
|
|
1312
|
-
import { Container as
|
|
1313
|
-
import { Trans, useTranslation as
|
|
1314
|
-
import { jsx as
|
|
1190
|
+
import { Channels, PencilSquare as PencilSquare5 } from "@medusajs/icons";
|
|
1191
|
+
import { Container as Container6, Heading as Heading6, Text as Text3, Tooltip as Tooltip4 } from "@medusajs/ui";
|
|
1192
|
+
import { Trans, useTranslation as useTranslation6 } from "react-i18next";
|
|
1193
|
+
import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1315
1194
|
var ProductSalesChannelSection = ({
|
|
1316
1195
|
product
|
|
1317
1196
|
}) => {
|
|
1318
1197
|
const { count } = useSalesChannels();
|
|
1319
|
-
const { t } =
|
|
1198
|
+
const { t } = useTranslation6();
|
|
1320
1199
|
const availableInSalesChannels = product.sales_channels?.map((sc) => ({
|
|
1321
1200
|
id: sc.id,
|
|
1322
1201
|
name: sc.name
|
|
1323
1202
|
})) ?? [];
|
|
1324
1203
|
const firstChannels = availableInSalesChannels.slice(0, 3);
|
|
1325
1204
|
const restChannels = availableInSalesChannels.slice(3);
|
|
1326
|
-
return /* @__PURE__ */
|
|
1327
|
-
/* @__PURE__ */
|
|
1328
|
-
/* @__PURE__ */
|
|
1329
|
-
/* @__PURE__ */
|
|
1205
|
+
return /* @__PURE__ */ jsxs6(Container6, { className: "flex flex-col gap-y-4 px-6 py-4", children: [
|
|
1206
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex items-center justify-between", children: [
|
|
1207
|
+
/* @__PURE__ */ jsx6(Heading6, { level: "h2", children: t("fields.sales_channels") }),
|
|
1208
|
+
/* @__PURE__ */ jsx6(
|
|
1330
1209
|
ActionMenu,
|
|
1331
1210
|
{
|
|
1332
1211
|
groups: [
|
|
@@ -1335,7 +1214,7 @@ var ProductSalesChannelSection = ({
|
|
|
1335
1214
|
{
|
|
1336
1215
|
label: t("actions.edit"),
|
|
1337
1216
|
to: "sales-channels",
|
|
1338
|
-
icon: /* @__PURE__ */
|
|
1217
|
+
icon: /* @__PURE__ */ jsx6(PencilSquare5, {})
|
|
1339
1218
|
}
|
|
1340
1219
|
]
|
|
1341
1220
|
}
|
|
@@ -1343,16 +1222,16 @@ var ProductSalesChannelSection = ({
|
|
|
1343
1222
|
}
|
|
1344
1223
|
)
|
|
1345
1224
|
] }),
|
|
1346
|
-
/* @__PURE__ */
|
|
1347
|
-
/* @__PURE__ */
|
|
1348
|
-
availableInSalesChannels.length > 0 ? /* @__PURE__ */
|
|
1349
|
-
/* @__PURE__ */
|
|
1350
|
-
restChannels.length > 0 && /* @__PURE__ */
|
|
1351
|
-
|
|
1225
|
+
/* @__PURE__ */ jsxs6("div", { className: "grid grid-cols-[28px_1fr] items-center gap-x-3", children: [
|
|
1226
|
+
/* @__PURE__ */ jsx6("div", { className: "bg-ui-bg-base shadow-borders-base flex size-7 items-center justify-center rounded-md", children: /* @__PURE__ */ jsx6("div", { className: "bg-ui-bg-component flex size-6 items-center justify-center rounded-[4px]", children: /* @__PURE__ */ jsx6(Channels, { className: "text-ui-fg-subtle" }) }) }),
|
|
1227
|
+
availableInSalesChannels.length > 0 ? /* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-x-1", children: [
|
|
1228
|
+
/* @__PURE__ */ jsx6(Text3, { size: "small", leading: "compact", children: firstChannels.map((sc) => sc.name).join(", ") }),
|
|
1229
|
+
restChannels.length > 0 && /* @__PURE__ */ jsx6(
|
|
1230
|
+
Tooltip4,
|
|
1352
1231
|
{
|
|
1353
|
-
content: /* @__PURE__ */
|
|
1354
|
-
children: /* @__PURE__ */
|
|
1355
|
-
|
|
1232
|
+
content: /* @__PURE__ */ jsx6("ul", { children: restChannels.map((sc) => /* @__PURE__ */ jsx6("li", { children: sc.name }, sc.id)) }),
|
|
1233
|
+
children: /* @__PURE__ */ jsx6(
|
|
1234
|
+
Text3,
|
|
1356
1235
|
{
|
|
1357
1236
|
size: "small",
|
|
1358
1237
|
leading: "compact",
|
|
@@ -1362,9 +1241,9 @@ var ProductSalesChannelSection = ({
|
|
|
1362
1241
|
)
|
|
1363
1242
|
}
|
|
1364
1243
|
)
|
|
1365
|
-
] }) : /* @__PURE__ */
|
|
1244
|
+
] }) : /* @__PURE__ */ jsx6(Text3, { size: "small", leading: "compact", className: "text-ui-fg-subtle", children: t("products.noSalesChannels") })
|
|
1366
1245
|
] }),
|
|
1367
|
-
/* @__PURE__ */
|
|
1246
|
+
/* @__PURE__ */ jsx6("div", { children: /* @__PURE__ */ jsx6(Text3, { className: "text-ui-fg-subtle", size: "small", leading: "compact", children: /* @__PURE__ */ jsx6(
|
|
1368
1247
|
Trans,
|
|
1369
1248
|
{
|
|
1370
1249
|
i18nKey: "sales_channels.availableIn",
|
|
@@ -1373,14 +1252,14 @@ var ProductSalesChannelSection = ({
|
|
|
1373
1252
|
y: count ?? 0
|
|
1374
1253
|
},
|
|
1375
1254
|
components: [
|
|
1376
|
-
/* @__PURE__ */
|
|
1255
|
+
/* @__PURE__ */ jsx6(
|
|
1377
1256
|
"span",
|
|
1378
1257
|
{
|
|
1379
1258
|
className: "text-ui-fg-base txt-compact-medium-plus"
|
|
1380
1259
|
},
|
|
1381
1260
|
"x"
|
|
1382
1261
|
),
|
|
1383
|
-
/* @__PURE__ */
|
|
1262
|
+
/* @__PURE__ */ jsx6(
|
|
1384
1263
|
"span",
|
|
1385
1264
|
{
|
|
1386
1265
|
className: "text-ui-fg-base txt-compact-medium-plus"
|
|
@@ -1394,7 +1273,7 @@ var ProductSalesChannelSection = ({
|
|
|
1394
1273
|
};
|
|
1395
1274
|
|
|
1396
1275
|
// src/pages/products/[id]/product-detail-page.tsx
|
|
1397
|
-
import { jsx as
|
|
1276
|
+
import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1398
1277
|
var Root = ({ children }) => {
|
|
1399
1278
|
const initialData = useLoaderData();
|
|
1400
1279
|
const { id } = useParams();
|
|
@@ -1406,21 +1285,21 @@ var Root = ({ children }) => {
|
|
|
1406
1285
|
}
|
|
1407
1286
|
);
|
|
1408
1287
|
if (isLoading || !product) {
|
|
1409
|
-
return /* @__PURE__ */
|
|
1288
|
+
return /* @__PURE__ */ jsx7(TwoColumnPageSkeleton, { mainSections: 4, sidebarSections: 3 });
|
|
1410
1289
|
}
|
|
1411
1290
|
if (isError) {
|
|
1412
1291
|
throw error;
|
|
1413
1292
|
}
|
|
1414
|
-
return Children.count(children) > 0 ? /* @__PURE__ */
|
|
1415
|
-
/* @__PURE__ */
|
|
1416
|
-
/* @__PURE__ */
|
|
1417
|
-
/* @__PURE__ */
|
|
1418
|
-
/* @__PURE__ */
|
|
1419
|
-
/* @__PURE__ */
|
|
1293
|
+
return Children.count(children) > 0 ? /* @__PURE__ */ jsx7(TwoColumnPage, { data: product, "data-testid": "product-detail-page", children }) : /* @__PURE__ */ jsxs7(TwoColumnPage, { data: product, "data-testid": "product-detail-page", children: [
|
|
1294
|
+
/* @__PURE__ */ jsxs7(TwoColumnPage.Main, { "data-testid": "product-detail-main", children: [
|
|
1295
|
+
/* @__PURE__ */ jsx7(ProductActiveEditSection, { product }),
|
|
1296
|
+
/* @__PURE__ */ jsx7(ProductGeneralSection, { product }),
|
|
1297
|
+
/* @__PURE__ */ jsx7(ProductMediaSection, { product }),
|
|
1298
|
+
/* @__PURE__ */ jsx7(ProductVariantSection, { product })
|
|
1420
1299
|
] }),
|
|
1421
|
-
/* @__PURE__ */
|
|
1422
|
-
/* @__PURE__ */
|
|
1423
|
-
/* @__PURE__ */
|
|
1300
|
+
/* @__PURE__ */ jsxs7(TwoColumnPage.Sidebar, { "data-testid": "product-detail-sidebar", children: [
|
|
1301
|
+
/* @__PURE__ */ jsx7(ProductOrganizationSection, { product }),
|
|
1302
|
+
/* @__PURE__ */ jsx7(ProductAttributeSection, { product })
|
|
1424
1303
|
] })
|
|
1425
1304
|
] });
|
|
1426
1305
|
};
|