@medusajs/dashboard 2.12.2-snapshot-20251207121122 → 2.12.2-snapshot-20251207203158
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{add-campaign-promotions-JQKPED4U.mjs → add-campaign-promotions-I7HDYMBX.mjs} +1 -2
- package/dist/{adjust-inventory-4UKAL3IT.mjs → adjust-inventory-SDWITRN3.mjs} +3 -5
- package/dist/{api-key-management-create-6EQCRHTT.mjs → api-key-management-create-FHLY4DD4.mjs} +4 -5
- package/dist/{api-key-management-detail-ILTYVBJ5.mjs → api-key-management-detail-JQBB7UNB.mjs} +11 -11
- package/dist/{api-key-management-edit-6HBLLOLH.mjs → api-key-management-edit-5RQXMVDW.mjs} +5 -7
- package/dist/{api-key-management-list-FTLC3ELT.mjs → api-key-management-list-RGLZMUCB.mjs} +3 -3
- package/dist/{api-key-management-sales-channels-YLYYJAKB.mjs → api-key-management-sales-channels-327HJKDQ.mjs} +6 -7
- package/dist/app.css +3 -0
- package/dist/app.js +4708 -5301
- package/dist/app.mjs +11 -11
- package/dist/{campaign-budget-edit-6DMZGUCI.mjs → campaign-budget-edit-H2KQKD7B.mjs} +2 -4
- package/dist/{campaign-configuration-UNFRB5HR.mjs → campaign-configuration-A452A22M.mjs} +2 -4
- package/dist/{campaign-create-QXG7PD3S.mjs → campaign-create-LHL7FKQK.mjs} +2 -3
- package/dist/{campaign-detail-NIMMITXO.mjs → campaign-detail-DLPAADFC.mjs} +9 -9
- package/dist/{campaign-edit-HN4US7DV.mjs → campaign-edit-LZV56AYF.mjs} +2 -4
- package/dist/{categories-metadata-ZKNXQM37.mjs → categories-metadata-IN4T3BQY.mjs} +11 -12
- package/dist/{category-create-HRJJCBMA.mjs → category-create-U277OGU4.mjs} +3 -4
- package/dist/{category-detail-LVP6O7I6.mjs → category-detail-MJYZEZJX.mjs} +12 -12
- package/dist/{category-edit-2UTQ7QJD.mjs → category-edit-I2LT3SZW.mjs} +4 -6
- package/dist/{category-list-IJ3DLPYQ.mjs → category-list-AH2EGTI7.mjs} +3 -3
- package/dist/{category-organize-OE7VJVVT.mjs → category-organize-PNR7ZHPM.mjs} +3 -4
- package/dist/{category-products-MO5PV7AG.mjs → category-products-UH7BGTSC.mjs} +12 -13
- package/dist/{chunk-AF7A24XI.mjs → chunk-34KFHPN6.mjs} +1 -1
- package/dist/{chunk-4V2V73YZ.mjs → chunk-3HRJ5XSF.mjs} +3 -5
- package/dist/{chunk-WPNZNLRN.mjs → chunk-4GPZRJUJ.mjs} +15 -16
- package/dist/{chunk-MWBKAP7W.mjs → chunk-4VNR7DND.mjs} +2 -2
- package/dist/{chunk-GV4XPCM5.mjs → chunk-6BP5RSIK.mjs} +4 -18
- package/dist/{chunk-D4J3CEWH.mjs → chunk-6VRDTPH2.mjs} +2 -4
- package/dist/{chunk-X527GAL2.mjs → chunk-73EHKWNI.mjs} +2 -2
- package/dist/{chunk-56TDUOXV.mjs → chunk-7AX6R6G6.mjs} +1 -1
- package/dist/{chunk-EMOSYFKR.mjs → chunk-7HL4FXK7.mjs} +204 -206
- package/dist/{chunk-L4NOVTH5.mjs → chunk-7V2JZU2B.mjs} +2 -4
- package/dist/{chunk-CZFLKMYE.mjs → chunk-ACJ3PPQJ.mjs} +1 -1
- package/dist/{chunk-42OOM4DJ.mjs → chunk-AERWK3TJ.mjs} +212 -44
- package/dist/{chunk-ETOJCN3Q.mjs → chunk-AH4DORIW.mjs} +1 -1
- package/dist/{chunk-ZUPF2AWJ.mjs → chunk-CPF5RDPF.mjs} +1 -1
- package/dist/{chunk-REUYEF7L.mjs → chunk-EQBVGH3N.mjs} +1 -1
- package/dist/{chunk-WPXYFJEP.mjs → chunk-EUF6RSI7.mjs} +1 -1
- package/dist/{chunk-QHRVYT5N.mjs → chunk-FIFVOKTK.mjs} +3 -3
- package/dist/{chunk-A6PWH2CK.mjs → chunk-FQDPOKEK.mjs} +1 -1
- package/dist/{chunk-DKIUGYWW.mjs → chunk-GN6OCHP4.mjs} +2 -2
- package/dist/{chunk-ND5YSIPU.mjs → chunk-HMY4BGRC.mjs} +1 -1
- package/dist/{chunk-KWP436SM.mjs → chunk-JJGE3EV6.mjs} +2 -2
- package/dist/{chunk-AENRV3N7.mjs → chunk-LEJUZW3P.mjs} +3 -1
- package/dist/{chunk-G4BWCU5P.mjs → chunk-M32MJOJN.mjs} +3 -6
- package/dist/{chunk-K5QWNI6V.mjs → chunk-N3FCYZV6.mjs} +1 -1
- package/dist/{chunk-KLNRCI3K.mjs → chunk-N4O5FAUC.mjs} +1 -1
- package/dist/{chunk-O4RZ3Y65.mjs → chunk-NHDFPGQ3.mjs} +1 -1
- package/dist/{chunk-LHNU4DYZ.mjs → chunk-PMJJI6GO.mjs} +1 -1
- package/dist/{chunk-PCFUZKDS.mjs → chunk-R65S6ZZV.mjs} +4 -1
- package/dist/{chunk-VX2HE7O5.mjs → chunk-SFSBLI7G.mjs} +2 -2
- package/dist/{chunk-3YPRDSZ6.mjs → chunk-T2ANPJ36.mjs} +1 -1
- package/dist/{chunk-KF7ZWW4K.mjs → chunk-T57MRRCF.mjs} +2 -4
- package/dist/{chunk-KCWP7RF5.mjs → chunk-TBEGSDLQ.mjs} +1 -1
- package/dist/{chunk-AZKMRL4P.mjs → chunk-XBJCK4CT.mjs} +8 -5
- package/dist/{chunk-NKDCBX74.mjs → chunk-XHDXZAOR.mjs} +1 -1
- package/dist/{chunk-M3CKVBZC.mjs → chunk-XIVBRONM.mjs} +1 -1
- package/dist/{collection-add-products-5BHQKPB4.mjs → collection-add-products-F7GTK2YV.mjs} +12 -13
- package/dist/{collection-create-S3UK5EKP.mjs → collection-create-WMTSRDDL.mjs} +3 -4
- package/dist/{collection-detail-IMDGOIF5.mjs → collection-detail-EZ6UCFMP.mjs} +11 -11
- package/dist/{collection-edit-C5X34GX7.mjs → collection-edit-PSVEWWPH.mjs} +4 -6
- package/dist/{collection-list-GROVO4YH.mjs → collection-list-YUECGEOO.mjs} +12 -12
- package/dist/{collection-metadata-TN5UCQVV.mjs → collection-metadata-XYMR7UIM.mjs} +11 -12
- package/dist/{customer-create-XCLZENJS.mjs → customer-create-VL6SIRZ2.mjs} +1 -2
- package/dist/{customer-create-address-4HZUIAM7.mjs → customer-create-address-V5C6M52P.mjs} +1 -2
- package/dist/{customer-detail-RD4ADZ3C.mjs → customer-detail-7B35STSY.mjs} +10 -10
- package/dist/{customer-edit-BW5GVTQI.mjs → customer-edit-WTBPVWOF.mjs} +2 -4
- package/dist/{customer-group-add-customers-HUGHHMU6.mjs → customer-group-add-customers-QU4Q56SS.mjs} +1 -2
- package/dist/{customer-group-create-6YV7W6TI.mjs → customer-group-create-A3CB3Z4K.mjs} +1 -2
- package/dist/{customer-group-detail-M2Y6UFOX.mjs → customer-group-detail-TY4AFNQE.mjs} +9 -9
- package/dist/{customer-group-edit-7NXU34BQ.mjs → customer-group-edit-7KV2PNLE.mjs} +2 -4
- package/dist/{customer-group-list-PYSYUVWJ.mjs → customer-group-list-CELWB4WM.mjs} +11 -11
- package/dist/{customer-group-metadata-WK2BGEGO.mjs → customer-group-metadata-4F2SZF4M.mjs} +2 -3
- package/dist/{customer-metadata-ZUWCUTM7.mjs → customer-metadata-LZ3TAXCV.mjs} +2 -3
- package/dist/{customers-add-customer-group-NVHYIS75.mjs → customers-add-customer-group-524NN3AG.mjs} +10 -11
- package/dist/{edit-inventory-item-7P2MPPGK.mjs → edit-inventory-item-O3SDWW2W.mjs} +3 -5
- package/dist/{edit-inventory-item-attributes-NVYPIDCK.mjs → edit-inventory-item-attributes-3QLOZMGC.mjs} +3 -5
- package/dist/{edit-reservation-4BH62PDP.mjs → edit-reservation-ISSU5XAY.mjs} +4 -6
- package/dist/{edit-rules-I3CZ6JJ6.mjs → edit-rules-K2UXPE62.mjs} +11 -13
- package/dist/en.json +0 -7
- package/dist/{inventory-create-2NJLJGI6.mjs → inventory-create-SYD3QXIB.mjs} +10 -11
- package/dist/{inventory-detail-DMAHDXAH.mjs → inventory-detail-IWCB7FND.mjs} +11 -11
- package/dist/{inventory-list-RQBI7UJX.mjs → inventory-list-BQPHK3FV.mjs} +1 -1
- package/dist/{inventory-metadata-WN5VZIHI.mjs → inventory-metadata-YSDEZ4B7.mjs} +11 -12
- package/dist/{inventory-stock-G4BGY6HK.mjs → inventory-stock-JLJEWPUM.mjs} +10 -11
- package/dist/{location-create-RPLEXUZR.mjs → location-create-GDOHM4T3.mjs} +1 -2
- package/dist/{location-detail-37V7YZVV.mjs → location-detail-LNQUKDLQ.mjs} +9 -9
- package/dist/{location-edit-L4ISEQHX.mjs → location-edit-4SEMGQXA.mjs} +2 -4
- package/dist/{location-fulfillment-providers-ZLKGXNU3.mjs → location-fulfillment-providers-566Z6CCG.mjs} +12 -13
- package/dist/{location-list-Z42ZYHUF.mjs → location-list-OYBI7EGV.mjs} +2 -2
- package/dist/{location-sales-channels-QANELWVW.mjs → location-sales-channels-MXFZNLKR.mjs} +5 -6
- package/dist/{location-service-zone-create-NSMZCD5N.mjs → location-service-zone-create-35TTX636.mjs} +3 -5
- package/dist/{location-service-zone-edit-6OUAFEZD.mjs → location-service-zone-edit-RWZS2XYW.mjs} +2 -4
- package/dist/{location-service-zone-manage-areas-SEC6LKCZ.mjs → location-service-zone-manage-areas-RGMM5Y6C.mjs} +3 -5
- package/dist/{location-service-zone-shipping-option-create-52N7W7C2.mjs → location-service-zone-shipping-option-create-VENETBCK.mjs} +12 -14
- package/dist/{location-service-zone-shipping-option-edit-QS6HTWST.mjs → location-service-zone-shipping-option-edit-TTVV3BSV.mjs} +2 -4
- package/dist/{location-service-zone-shipping-option-pricing-23QLNSBT.mjs → location-service-zone-shipping-option-pricing-NQRIEGTX.mjs} +3 -5
- package/dist/{login-NQCTGOAW.mjs → login-R5C7HZ2A.mjs} +9 -9
- package/dist/{manage-locations-S7MCWAUJ.mjs → manage-locations-XEXCUBR7.mjs} +3 -5
- package/dist/{order-allocate-items-VY6KJFRE.mjs → order-allocate-items-W7HUKJ6F.mjs} +4 -5
- package/dist/{order-create-claim-QF2LTPUX.mjs → order-create-claim-M5NNIQWR.mjs} +13 -15
- package/dist/{order-create-edit-Z7LU7AVG.mjs → order-create-edit-A2TMNFRS.mjs} +12 -14
- package/dist/{order-create-exchange-5XWD2Q2E.mjs → order-create-exchange-CIB7URQD.mjs} +13 -15
- package/dist/{order-create-fulfillment-AQJXDSWH.mjs → order-create-fulfillment-YC4GFUTQ.mjs} +10 -11
- package/dist/{order-create-refund-B3WOHTK4.mjs → order-create-refund-EE7SWYLL.mjs} +11 -13
- package/dist/{order-create-return-XNBOIYPL.mjs → order-create-return-UWF4YKOP.mjs} +6 -8
- package/dist/{order-create-shipment-N2CVYZMG.mjs → order-create-shipment-DNVN7NYA.mjs} +10 -11
- package/dist/{order-detail-S3IQ75KS.mjs → order-detail-FZ7PM4K3.mjs} +13 -13
- package/dist/{order-edit-billing-address-6YKACKAU.mjs → order-edit-billing-address-XH37NDI5.mjs} +11 -13
- package/dist/{order-edit-email-HHOPFQEQ.mjs → order-edit-email-NZE32DBD.mjs} +11 -13
- package/dist/{order-edit-shipping-address-OLSZVXOS.mjs → order-edit-shipping-address-KMLTH4SM.mjs} +11 -13
- package/dist/{order-list-H2B5LA5D.mjs → order-list-NT5PQ2WS.mjs} +7 -7
- package/dist/{order-metadata-PGARNQGC.mjs → order-metadata-VWNNC7RO.mjs} +11 -12
- package/dist/{order-receive-return-F3RVWIUS.mjs → order-receive-return-O5P477EZ.mjs} +12 -14
- package/dist/{order-request-transfer-BSA2D7PD.mjs → order-request-transfer-XOAINCAS.mjs} +11 -13
- package/dist/{price-list-configuration-FXGLWS3K.mjs → price-list-configuration-N2WC2QQP.mjs} +5 -7
- package/dist/{price-list-create-Z7GJDHLB.mjs → price-list-create-NOTXIPOJ.mjs} +16 -17
- package/dist/{price-list-detail-SGYXWAHQ.mjs → price-list-detail-BD2QQKAR.mjs} +12 -12
- package/dist/{price-list-edit-S3DCFSO2.mjs → price-list-edit-UB2Z2726.mjs} +4 -6
- package/dist/{price-list-list-FLINOQCK.mjs → price-list-list-D4UPKCNL.mjs} +3 -3
- package/dist/{price-list-prices-add-SXP3V7NI.mjs → price-list-prices-add-25FOFNBS.mjs} +14 -14
- package/dist/{price-list-prices-edit-L4EETPG2.mjs → price-list-prices-edit-CXXOO22Q.mjs} +5 -5
- package/dist/{product-attributes-J6ZXEBZ2.mjs → product-attributes-W6URSOII.mjs} +15 -19
- package/dist/{product-create-7HZSIZI3.mjs → product-create-IJXK2CPJ.mjs} +15 -17
- package/dist/{product-create-option-JSL4OV4M.mjs → product-create-option-AQRYQJSJ.mjs} +7 -6
- package/dist/{product-create-variant-MNWLL3SD.mjs → product-create-variant-YBJ2ZVUG.mjs} +15 -14
- package/dist/{product-detail-GMNO25SN.mjs → product-detail-3QA6OXHI.mjs} +21 -15
- package/dist/{product-edit-LRBW7OOF.mjs → product-edit-WPVM44C2.mjs} +15 -19
- package/dist/{product-edit-option-OL6OBCK6.mjs → product-edit-option-BL5XHROM.mjs} +7 -6
- package/dist/{product-export-SQG7U5CK.mjs → product-export-H4ZOJWIB.mjs} +14 -16
- package/dist/{product-image-variants-edit-7IN3QHSF.mjs → product-image-variants-edit-3YEXAIKS.mjs} +15 -14
- package/dist/{product-import-6ZZIQ6R5.mjs → product-import-PPULHBTB.mjs} +11 -13
- package/dist/{product-list-E4KRZBEX.mjs → product-list-NPLVU37E.mjs} +14 -14
- package/dist/{product-media-NFLMXXXU.mjs → product-media-L4COURP2.mjs} +6 -4
- package/dist/{product-metadata-TY3LCH2W.mjs → product-metadata-SS7DIDYB.mjs} +15 -13
- package/dist/{product-organization-2SS6DA6S.mjs → product-organization-QG53UJ2J.mjs} +16 -20
- package/dist/{product-prices-DI4WDLZZ.mjs → product-prices-UZB2T6UD.mjs} +6 -4
- package/dist/{product-sales-channels-BOCECT5M.mjs → product-sales-channels-BKKIG6BE.mjs} +9 -7
- package/dist/{product-shipping-profile-MP6QBJHY.mjs → product-shipping-profile-MWE5S5TZ.mjs} +5 -53
- package/dist/{product-stock-UXOYOHMR.mjs → product-stock-3A22RDIR.mjs} +10 -11
- package/dist/{product-tag-create-OURLUGEL.mjs → product-tag-create-XIWCLMRJ.mjs} +10 -11
- package/dist/{product-tag-detail-MENTQYX2.mjs → product-tag-detail-NVV6QQMN.mjs} +13 -13
- package/dist/{product-tag-edit-BGPR3BIP.mjs → product-tag-edit-H7YA4HEV.mjs} +11 -13
- package/dist/{product-tag-list-B5YMQ2KC.mjs → product-tag-list-LGVKUJLL.mjs} +13 -13
- package/dist/{product-tag-metadata-5GOTVYAI.mjs → product-tag-metadata-JBYEI3M4.mjs} +11 -12
- package/dist/{product-type-create-HBDROTGB.mjs → product-type-create-Y752WGBV.mjs} +1 -2
- package/dist/{product-type-detail-WIIXVV2K.mjs → product-type-detail-S6YG37AR.mjs} +11 -11
- package/dist/{product-type-edit-H3JCMVRV.mjs → product-type-edit-SMPJ5ZEF.mjs} +2 -4
- package/dist/{product-type-metadata-XACGB4IA.mjs → product-type-metadata-LRTMJT2P.mjs} +11 -12
- package/dist/{product-variant-detail-EFKGSJ5B.mjs → product-variant-detail-GIHXE5YG.mjs} +9 -9
- package/dist/{product-variant-edit-7OJLUVHS.mjs → product-variant-edit-36MBVNPO.mjs} +13 -14
- package/dist/{product-variant-manage-inventory-items-HVU7YWDU.mjs → product-variant-manage-inventory-items-EYKESIRF.mjs} +2 -3
- package/dist/{product-variant-media-3JWQ27SI.mjs → product-variant-media-A3XHS3IZ.mjs} +2 -3
- package/dist/{product-variant-metadata-POPOT4LV.mjs → product-variant-metadata-LH7YGFW4.mjs} +11 -12
- package/dist/{profile-edit-5EEKOEO5.mjs → profile-edit-NFVR5Y4I.mjs} +2 -4
- package/dist/{promotion-add-campaign-JRTM7WBR.mjs → promotion-add-campaign-MKDYE7MW.mjs} +2 -3
- package/dist/{promotion-create-Q7EYW4L2.mjs → promotion-create-XOB4S6H5.mjs} +12 -13
- package/dist/{promotion-detail-Q5INURX6.mjs → promotion-detail-YR4MNPNS.mjs} +9 -9
- package/dist/{promotion-edit-details-AREFQ6O5.mjs → promotion-edit-details-AKKNOCLM.mjs} +2 -4
- package/dist/{refund-reason-create-MXVWKVZ5.mjs → refund-reason-create-LSAPI6XB.mjs} +10 -11
- package/dist/{refund-reason-edit-7EW5QRCM.mjs → refund-reason-edit-R4RV6BFG.mjs} +11 -13
- package/dist/{refund-reason-list-GHMGAXQY.mjs → refund-reason-list-MPTKOWX7.mjs} +12 -12
- package/dist/{region-add-countries-AFWXMQ6W.mjs → region-add-countries-6GB2QDJK.mjs} +1 -2
- package/dist/{region-create-YC4VZ4AS.mjs → region-create-QLPSK6TX.mjs} +2 -4
- package/dist/{region-edit-5GO25GDF.mjs → region-edit-JCJHA6TY.mjs} +2 -4
- package/dist/{region-metadata-MEJEMQ7Y.mjs → region-metadata-4IMJHPZO.mjs} +11 -12
- package/dist/{reservation-create-P66MJ6LN.mjs → reservation-create-UAUWU3UN.mjs} +3 -4
- package/dist/{reservation-detail-ARGPFIAK.mjs → reservation-detail-HWKSPGBU.mjs} +9 -9
- package/dist/{reservation-list-RGL67CIU.mjs → reservation-list-SOJRN5RI.mjs} +2 -2
- package/dist/{reservation-metadata-I5JUAZNA.mjs → reservation-metadata-IIX7FU74.mjs} +11 -12
- package/dist/{return-reason-create-NXWDC6AC.mjs → return-reason-create-PLQNC4KW.mjs} +1 -2
- package/dist/{return-reason-edit-M6IKNNKB.mjs → return-reason-edit-XJCPMZ6U.mjs} +2 -4
- package/dist/{return-reason-list-SGCFBGSL.mjs → return-reason-list-IFFIDA5O.mjs} +1 -1
- package/dist/{sales-channel-add-products-N6CLM26Y.mjs → sales-channel-add-products-VH7V4XWO.mjs} +12 -13
- package/dist/{sales-channel-create-74PCSWSX.mjs → sales-channel-create-YAORCXP3.mjs} +3 -4
- package/dist/{sales-channel-detail-WFCPUJF5.mjs → sales-channel-detail-VMRKBYCG.mjs} +11 -11
- package/dist/{sales-channel-edit-IUGTN65E.mjs → sales-channel-edit-6UDMBSO3.mjs} +4 -6
- package/dist/{sales-channel-list-TEH3IEG5.mjs → sales-channel-list-U7IVFVYC.mjs} +11 -11
- package/dist/{sales-channel-metadata-YYQAM5OW.mjs → sales-channel-metadata-5EO4EB6E.mjs} +11 -12
- package/dist/{shipping-option-type-create-73EVE35U.mjs → shipping-option-type-create-DJEHSOSG.mjs} +10 -11
- package/dist/{shipping-option-type-detail-WX6ZFA3K.mjs → shipping-option-type-detail-GWULT3WO.mjs} +10 -10
- package/dist/{shipping-option-type-edit-YSRIA7FD.mjs → shipping-option-type-edit-FSXPDBLI.mjs} +11 -13
- package/dist/{shipping-option-type-list-OKHJ5XQ3.mjs → shipping-option-type-list-DAKNQ3N6.mjs} +10 -10
- package/dist/{shipping-profile-create-752TMBBE.mjs → shipping-profile-create-NKFUOBVZ.mjs} +1 -2
- package/dist/{shipping-profile-metadata-GZOMZUZ5.mjs → shipping-profile-metadata-37GNDVFQ.mjs} +11 -12
- package/dist/{store-add-currencies-3VMLZ6KB.mjs → store-add-currencies-QVG2SI26.mjs} +1 -2
- package/dist/{store-detail-FU3AMVC5.mjs → store-detail-TTHDKQYD.mjs} +14 -280
- package/dist/store-edit-3XS6IC2Z.mjs +238 -0
- package/dist/{store-metadata-C32LZ5A5.mjs → store-metadata-KLQUPUQ4.mjs} +11 -12
- package/dist/{tax-region-create-JPIGFA7Q.mjs → tax-region-create-FIGRJOC5.mjs} +10 -11
- package/dist/{tax-region-detail-LM3TUUVX.mjs → tax-region-detail-AXT4TMZB.mjs} +16 -17
- package/dist/{tax-region-edit-J3COT5DI.mjs → tax-region-edit-UOGPNA25.mjs} +11 -13
- package/dist/{tax-region-province-create-5JP3PVID.mjs → tax-region-province-create-T2LKEDTK.mjs} +1 -2
- package/dist/{tax-region-province-detail-OLLH4XDG.mjs → tax-region-province-detail-4YCWNZPW.mjs} +16 -17
- package/dist/{tax-region-tax-override-create-BFIJFC4G.mjs → tax-region-tax-override-create-FHUXLTPK.mjs} +15 -17
- package/dist/{tax-region-tax-override-edit-OALFHSLF.mjs → tax-region-tax-override-edit-GQYS6HCW.mjs} +15 -16
- package/dist/{tax-region-tax-rate-create-O2SDSXCH.mjs → tax-region-tax-rate-create-UEOU5QRU.mjs} +1 -2
- package/dist/{tax-region-tax-rate-edit-W62VEVKT.mjs → tax-region-tax-rate-edit-ILCDNXHV.mjs} +2 -4
- package/dist/{user-detail-N6PT3KRP.mjs → user-detail-KEDJ7N3Q.mjs} +1 -1
- package/dist/{user-edit-LXQCTDGA.mjs → user-edit-25HD3BYT.mjs} +2 -4
- package/dist/{user-invite-2OKB7SCF.mjs → user-invite-CRQTVEYA.mjs} +1 -2
- package/dist/{user-list-YYUOQKQY.mjs → user-list-6KATHOTJ.mjs} +2 -2
- package/dist/{user-metadata-3FJIJONR.mjs → user-metadata-RU3Z3BLD.mjs} +11 -12
- package/dist/{workflow-execution-detail-P72V2O2R.mjs → workflow-execution-detail-R2FDAUMD.mjs} +9 -9
- package/package.json +9 -9
- package/src/components/search/use-search-results.tsx +3 -1
- package/src/components/utilities/error-boundary/error-boundary.tsx +20 -0
- package/src/dashboard-app/routes/get-route.map.tsx +0 -4
- package/src/hooks/api/feature-flags.tsx +5 -9
- package/src/hooks/api/index.ts +0 -1
- package/src/hooks/api/products.tsx +5 -1
- package/src/hooks/table/query/use-product-table-query.tsx +2 -1
- package/src/i18n/translations/$schema.json +0 -28
- package/src/i18n/translations/en.json +0 -7
- package/src/i18n/translations/es.json +0 -7
- package/src/routes/price-lists/price-list-create/components/price-list-create-form/price-list-prices-form.tsx +3 -1
- package/src/routes/price-lists/price-list-prices-add/components/price-list-prices-add-form/price-list-prices-add-prices-form.tsx +3 -1
- package/src/routes/price-lists/price-list-prices-edit/price-list-prices-edit.tsx +3 -1
- package/src/routes/product-variants/product-variant-edit/product-variant-edit.tsx +2 -1
- package/src/routes/products/product-attributes/product-attributes.tsx +3 -2
- package/src/routes/products/product-create-option/product-create-option.tsx +5 -1
- package/src/routes/products/product-create-variant/product-create-variant.tsx +4 -1
- package/src/routes/products/product-detail/breadcrumb.tsx +3 -2
- package/src/routes/products/product-edit/product-edit.tsx +3 -2
- package/src/routes/products/product-edit-option/product-edit-option.tsx +4 -1
- package/src/routes/products/product-image-variants-edit/product-image-variants-edit.tsx +5 -1
- package/src/routes/products/product-media/product-media.tsx +4 -1
- package/src/routes/products/product-metadata/product-metadata.tsx +5 -1
- package/src/routes/products/product-organization/product-organization.tsx +2 -2
- package/src/routes/products/product-prices/product-prices.tsx +4 -1
- package/src/routes/products/product-sales-channels/product-sales-channels.tsx +4 -1
- package/src/routes/products/product-shipping-profile/product-shipping-profile.tsx +3 -2
- package/src/routes/store/store-detail/components/store-general-section/store-general-section.tsx +0 -24
- package/src/routes/store/store-detail/store-detail.tsx +0 -4
- package/src/routes/store/store-edit/components/edit-store-form/edit-store-form.tsx +3 -50
- package/src/routes/tax-regions/common/components/target-item/target-item.tsx +5 -1
- package/src/routes/tax-regions/common/components/tax-override-card/tax-override-card.tsx +10 -10
- package/dist/chunk-77XTTZK7.mjs +0 -13
- package/dist/chunk-XNIVMZHA.mjs +0 -50
- package/dist/chunk-XXBP2Z5M.mjs +0 -182
- package/dist/store-add-locales-LXRWHBME.mjs +0 -264
- package/dist/store-edit-EPAHLLKP.mjs +0 -288
- package/src/hooks/api/locales.tsx +0 -52
- package/src/routes/store/common/hooks/use-locales-table-columns.tsx +0 -29
- package/src/routes/store/common/hooks/use-locales-table-query.tsx +0 -21
- package/src/routes/store/store-add-locales/components/add-locales-form/add-locales-form.tsx +0 -240
- package/src/routes/store/store-add-locales/index.ts +0 -1
- package/src/routes/store/store-add-locales/store-add-locales.tsx +0 -29
- package/src/routes/store/store-detail/components/store-locale-section/index.ts +0 -1
- package/src/routes/store/store-detail/components/store-locale-section/store-locale-section.tsx +0 -290
|
@@ -1,288 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
useComboboxData
|
|
3
|
-
} from "./chunk-3TZOFKX2.mjs";
|
|
4
|
-
import {
|
|
5
|
-
Combobox
|
|
6
|
-
} from "./chunk-OFN7DIZA.mjs";
|
|
7
|
-
import "./chunk-IUCDCPJU.mjs";
|
|
8
|
-
import {
|
|
9
|
-
KeyboundForm
|
|
10
|
-
} from "./chunk-6HTZNHPT.mjs";
|
|
11
|
-
import {
|
|
12
|
-
RouteDrawer
|
|
13
|
-
} from "./chunk-XXBP2Z5M.mjs";
|
|
14
|
-
import {
|
|
15
|
-
useRouteModal
|
|
16
|
-
} from "./chunk-42OOM4DJ.mjs";
|
|
17
|
-
import {
|
|
18
|
-
useFeatureFlag
|
|
19
|
-
} from "./chunk-G4BWCU5P.mjs";
|
|
20
|
-
import {
|
|
21
|
-
useDocumentDirection
|
|
22
|
-
} from "./chunk-S4DMV3ZT.mjs";
|
|
23
|
-
import {
|
|
24
|
-
Form
|
|
25
|
-
} from "./chunk-OBQI23QM.mjs";
|
|
26
|
-
import {
|
|
27
|
-
useStore,
|
|
28
|
-
useUpdateStore
|
|
29
|
-
} from "./chunk-VCSSQVPD.mjs";
|
|
30
|
-
import "./chunk-SQDIZZDW.mjs";
|
|
31
|
-
import "./chunk-FXYH54JP.mjs";
|
|
32
|
-
import "./chunk-774WSTCC.mjs";
|
|
33
|
-
import {
|
|
34
|
-
sdk
|
|
35
|
-
} from "./chunk-NFEK63OE.mjs";
|
|
36
|
-
import "./chunk-QZ7TP4HQ.mjs";
|
|
37
|
-
|
|
38
|
-
// src/routes/store/store-edit/store-edit.tsx
|
|
39
|
-
import { Heading } from "@medusajs/ui";
|
|
40
|
-
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
41
|
-
|
|
42
|
-
// src/routes/store/store-edit/components/edit-store-form/edit-store-form.tsx
|
|
43
|
-
import { zodResolver } from "@hookform/resolvers/zod";
|
|
44
|
-
import { Button, Input, Select, toast } from "@medusajs/ui";
|
|
45
|
-
import { useForm } from "react-hook-form";
|
|
46
|
-
import { useTranslation } from "react-i18next";
|
|
47
|
-
import { z } from "zod";
|
|
48
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
49
|
-
var EditStoreSchema = z.object({
|
|
50
|
-
name: z.string().min(1),
|
|
51
|
-
default_currency_code: z.string().optional(),
|
|
52
|
-
default_locale_code: z.string().optional(),
|
|
53
|
-
default_region_id: z.string().optional(),
|
|
54
|
-
default_sales_channel_id: z.string().optional(),
|
|
55
|
-
default_location_id: z.string().optional()
|
|
56
|
-
});
|
|
57
|
-
var EditStoreForm = ({ store }) => {
|
|
58
|
-
const { t } = useTranslation();
|
|
59
|
-
const isTranslationsEnabled = useFeatureFlag("translation");
|
|
60
|
-
const { handleSuccess } = useRouteModal();
|
|
61
|
-
const direction = useDocumentDirection();
|
|
62
|
-
const form = useForm({
|
|
63
|
-
defaultValues: {
|
|
64
|
-
name: store.name,
|
|
65
|
-
default_region_id: store.default_region_id || void 0,
|
|
66
|
-
default_locale_code: store.supported_locales?.find((l) => l.is_default)?.locale_code || void 0,
|
|
67
|
-
default_currency_code: store.supported_currencies?.find((c) => c.is_default)?.currency_code || void 0,
|
|
68
|
-
default_sales_channel_id: store.default_sales_channel_id || void 0,
|
|
69
|
-
default_location_id: store.default_location_id || void 0
|
|
70
|
-
},
|
|
71
|
-
resolver: zodResolver(EditStoreSchema)
|
|
72
|
-
});
|
|
73
|
-
const { mutateAsync, isPending } = useUpdateStore(store.id);
|
|
74
|
-
const regionsCombobox = useComboboxData({
|
|
75
|
-
queryKey: ["regions", "default_region_id"],
|
|
76
|
-
queryFn: (params) => sdk.admin.region.list({ ...params, fields: "id,name" }),
|
|
77
|
-
defaultValue: store.default_region_id || void 0,
|
|
78
|
-
getOptions: (data) => data.regions.map((r) => ({ label: r.name, value: r.id }))
|
|
79
|
-
});
|
|
80
|
-
const salesChannelsCombobox = useComboboxData({
|
|
81
|
-
queryFn: (params) => sdk.admin.salesChannel.list({ ...params, fields: "id,name" }),
|
|
82
|
-
getOptions: (data) => data.sales_channels.map((sc) => ({ label: sc.name, value: sc.id })),
|
|
83
|
-
queryKey: ["sales_channels", "default_sales_channel_id"],
|
|
84
|
-
defaultValue: store.default_sales_channel_id || void 0
|
|
85
|
-
});
|
|
86
|
-
const locationsCombobox = useComboboxData({
|
|
87
|
-
queryFn: (params) => sdk.admin.stockLocation.list({ ...params, fields: "id,name" }),
|
|
88
|
-
getOptions: (data) => data.stock_locations.map((l) => ({ label: l.name, value: l.id })),
|
|
89
|
-
queryKey: ["stock_locations", "default_location_id"],
|
|
90
|
-
defaultValue: store.default_location_id || void 0
|
|
91
|
-
});
|
|
92
|
-
const handleSubmit = form.handleSubmit(async (values) => {
|
|
93
|
-
const { default_currency_code, default_locale_code, ...rest } = values;
|
|
94
|
-
const normalizedMutation = {
|
|
95
|
-
...rest,
|
|
96
|
-
supported_locales: store.supported_locales?.map((l) => ({
|
|
97
|
-
...l,
|
|
98
|
-
is_default: l.locale_code === default_locale_code
|
|
99
|
-
})),
|
|
100
|
-
supported_currencies: store.supported_currencies?.map((c) => ({
|
|
101
|
-
...c,
|
|
102
|
-
is_default: c.currency_code === default_currency_code
|
|
103
|
-
}))
|
|
104
|
-
};
|
|
105
|
-
await mutateAsync(normalizedMutation, {
|
|
106
|
-
onSuccess: () => {
|
|
107
|
-
toast.success(t("store.toast.update"));
|
|
108
|
-
handleSuccess();
|
|
109
|
-
},
|
|
110
|
-
onError: (error) => {
|
|
111
|
-
toast.error(error.message);
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
});
|
|
115
|
-
return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(
|
|
116
|
-
KeyboundForm,
|
|
117
|
-
{
|
|
118
|
-
onSubmit: handleSubmit,
|
|
119
|
-
className: "flex h-full flex-col overflow-hidden",
|
|
120
|
-
children: [
|
|
121
|
-
/* @__PURE__ */ jsx(RouteDrawer.Body, { className: "overflow-y-auto", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-y-8", children: [
|
|
122
|
-
/* @__PURE__ */ jsx(
|
|
123
|
-
Form.Field,
|
|
124
|
-
{
|
|
125
|
-
control: form.control,
|
|
126
|
-
name: "name",
|
|
127
|
-
render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
128
|
-
/* @__PURE__ */ jsx(Form.Label, { children: t("fields.name") }),
|
|
129
|
-
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(Input, { placeholder: "ACME", ...field }) }),
|
|
130
|
-
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
131
|
-
] })
|
|
132
|
-
}
|
|
133
|
-
),
|
|
134
|
-
/* @__PURE__ */ jsx(
|
|
135
|
-
Form.Field,
|
|
136
|
-
{
|
|
137
|
-
control: form.control,
|
|
138
|
-
name: "default_currency_code",
|
|
139
|
-
render: ({ field: { onChange, ...field } }) => {
|
|
140
|
-
return /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
141
|
-
/* @__PURE__ */ jsx(Form.Label, { children: t("store.defaultCurrency") }),
|
|
142
|
-
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsxs(
|
|
143
|
-
Select,
|
|
144
|
-
{
|
|
145
|
-
dir: direction,
|
|
146
|
-
...field,
|
|
147
|
-
onValueChange: onChange,
|
|
148
|
-
children: [
|
|
149
|
-
/* @__PURE__ */ jsx(Select.Trigger, { ref: field.ref, children: /* @__PURE__ */ jsx(Select.Value, {}) }),
|
|
150
|
-
/* @__PURE__ */ jsx(Select.Content, { children: store.supported_currencies?.map((currency) => /* @__PURE__ */ jsx(
|
|
151
|
-
Select.Item,
|
|
152
|
-
{
|
|
153
|
-
value: currency.currency_code,
|
|
154
|
-
children: currency.currency_code.toUpperCase()
|
|
155
|
-
},
|
|
156
|
-
currency.currency_code
|
|
157
|
-
)) })
|
|
158
|
-
]
|
|
159
|
-
}
|
|
160
|
-
) })
|
|
161
|
-
] });
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
),
|
|
165
|
-
isTranslationsEnabled && /* @__PURE__ */ jsx(
|
|
166
|
-
Form.Field,
|
|
167
|
-
{
|
|
168
|
-
control: form.control,
|
|
169
|
-
name: "default_locale_code",
|
|
170
|
-
render: ({ field: { onChange, ...field } }) => {
|
|
171
|
-
return /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
172
|
-
/* @__PURE__ */ jsx(Form.Label, { children: t("store.defaultLocale") }),
|
|
173
|
-
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsxs(
|
|
174
|
-
Select,
|
|
175
|
-
{
|
|
176
|
-
dir: direction,
|
|
177
|
-
...field,
|
|
178
|
-
onValueChange: onChange,
|
|
179
|
-
children: [
|
|
180
|
-
/* @__PURE__ */ jsx(Select.Trigger, { ref: field.ref, children: /* @__PURE__ */ jsx(Select.Value, {}) }),
|
|
181
|
-
/* @__PURE__ */ jsx(Select.Content, { children: store.supported_locales?.map((locale) => /* @__PURE__ */ jsx(
|
|
182
|
-
Select.Item,
|
|
183
|
-
{
|
|
184
|
-
value: locale.locale_code,
|
|
185
|
-
children: locale.locale_code
|
|
186
|
-
},
|
|
187
|
-
locale.locale_code
|
|
188
|
-
)) })
|
|
189
|
-
]
|
|
190
|
-
}
|
|
191
|
-
) })
|
|
192
|
-
] });
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
),
|
|
196
|
-
/* @__PURE__ */ jsx(
|
|
197
|
-
Form.Field,
|
|
198
|
-
{
|
|
199
|
-
control: form.control,
|
|
200
|
-
name: "default_region_id",
|
|
201
|
-
render: ({ field }) => {
|
|
202
|
-
return /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
203
|
-
/* @__PURE__ */ jsx(Form.Label, { children: t("store.defaultRegion") }),
|
|
204
|
-
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(
|
|
205
|
-
Combobox,
|
|
206
|
-
{
|
|
207
|
-
...field,
|
|
208
|
-
options: regionsCombobox.options,
|
|
209
|
-
searchValue: regionsCombobox.searchValue,
|
|
210
|
-
onSearchValueChange: regionsCombobox.onSearchValueChange,
|
|
211
|
-
disabled: regionsCombobox.disabled
|
|
212
|
-
}
|
|
213
|
-
) })
|
|
214
|
-
] });
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
),
|
|
218
|
-
/* @__PURE__ */ jsx(
|
|
219
|
-
Form.Field,
|
|
220
|
-
{
|
|
221
|
-
control: form.control,
|
|
222
|
-
name: "default_sales_channel_id",
|
|
223
|
-
render: ({ field }) => {
|
|
224
|
-
return /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
225
|
-
/* @__PURE__ */ jsx(Form.Label, { children: t("store.defaultSalesChannel") }),
|
|
226
|
-
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(
|
|
227
|
-
Combobox,
|
|
228
|
-
{
|
|
229
|
-
...field,
|
|
230
|
-
options: salesChannelsCombobox.options,
|
|
231
|
-
searchValue: salesChannelsCombobox.searchValue,
|
|
232
|
-
onSearchValueChange: salesChannelsCombobox.onSearchValueChange,
|
|
233
|
-
disabled: salesChannelsCombobox.disabled
|
|
234
|
-
}
|
|
235
|
-
) })
|
|
236
|
-
] });
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
),
|
|
240
|
-
/* @__PURE__ */ jsx(
|
|
241
|
-
Form.Field,
|
|
242
|
-
{
|
|
243
|
-
control: form.control,
|
|
244
|
-
name: "default_location_id",
|
|
245
|
-
render: ({ field }) => {
|
|
246
|
-
return /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
247
|
-
/* @__PURE__ */ jsx(Form.Label, { children: t("store.defaultLocation") }),
|
|
248
|
-
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(
|
|
249
|
-
Combobox,
|
|
250
|
-
{
|
|
251
|
-
...field,
|
|
252
|
-
options: locationsCombobox.options,
|
|
253
|
-
searchValue: locationsCombobox.searchValue,
|
|
254
|
-
onSearchValueChange: locationsCombobox.onSearchValueChange,
|
|
255
|
-
disabled: locationsCombobox.disabled
|
|
256
|
-
}
|
|
257
|
-
) })
|
|
258
|
-
] });
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
)
|
|
262
|
-
] }) }),
|
|
263
|
-
/* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-end gap-x-2", children: [
|
|
264
|
-
/* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: t("actions.cancel") }) }),
|
|
265
|
-
/* @__PURE__ */ jsx(Button, { size: "small", isLoading: isPending, type: "submit", children: t("actions.save") })
|
|
266
|
-
] }) })
|
|
267
|
-
]
|
|
268
|
-
}
|
|
269
|
-
) });
|
|
270
|
-
};
|
|
271
|
-
|
|
272
|
-
// src/routes/store/store-edit/store-edit.tsx
|
|
273
|
-
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
274
|
-
var StoreEdit = () => {
|
|
275
|
-
const { t } = useTranslation2();
|
|
276
|
-
const { store, isPending: isLoading, isError, error } = useStore();
|
|
277
|
-
if (isError) {
|
|
278
|
-
throw error;
|
|
279
|
-
}
|
|
280
|
-
const ready = !!store && !isLoading;
|
|
281
|
-
return /* @__PURE__ */ jsxs2(RouteDrawer, { children: [
|
|
282
|
-
/* @__PURE__ */ jsx2(RouteDrawer.Header, { children: /* @__PURE__ */ jsx2(Heading, { children: t("store.edit.header") }) }),
|
|
283
|
-
ready && /* @__PURE__ */ jsx2(EditStoreForm, { store })
|
|
284
|
-
] });
|
|
285
|
-
};
|
|
286
|
-
export {
|
|
287
|
-
StoreEdit as Component
|
|
288
|
-
};
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { FetchError } from "@medusajs/js-sdk"
|
|
2
|
-
import { HttpTypes } from "@medusajs/types"
|
|
3
|
-
import { QueryKey, UseQueryOptions, useQuery } from "@tanstack/react-query"
|
|
4
|
-
|
|
5
|
-
import { sdk } from "../../lib/client"
|
|
6
|
-
import { queryKeysFactory } from "../../lib/query-key-factory"
|
|
7
|
-
|
|
8
|
-
const LOCALES_QUERY_KEY = "locales" as const
|
|
9
|
-
const localesQueryKeys = queryKeysFactory(LOCALES_QUERY_KEY)
|
|
10
|
-
|
|
11
|
-
export const useLocales = (
|
|
12
|
-
query?: HttpTypes.AdminLocaleListParams,
|
|
13
|
-
options?: Omit<
|
|
14
|
-
UseQueryOptions<
|
|
15
|
-
HttpTypes.AdminLocaleListResponse,
|
|
16
|
-
FetchError,
|
|
17
|
-
HttpTypes.AdminLocaleListResponse,
|
|
18
|
-
QueryKey
|
|
19
|
-
>,
|
|
20
|
-
"queryFn" | "queryKey"
|
|
21
|
-
>
|
|
22
|
-
) => {
|
|
23
|
-
const { data, ...rest } = useQuery({
|
|
24
|
-
queryFn: () => sdk.admin.locale.list(query),
|
|
25
|
-
queryKey: localesQueryKeys.list(query),
|
|
26
|
-
...options,
|
|
27
|
-
})
|
|
28
|
-
|
|
29
|
-
return { ...data, ...rest }
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export const useLocale = (
|
|
33
|
-
id: string,
|
|
34
|
-
query?: HttpTypes.AdminLocaleParams,
|
|
35
|
-
options?: Omit<
|
|
36
|
-
UseQueryOptions<
|
|
37
|
-
HttpTypes.AdminLocaleResponse,
|
|
38
|
-
FetchError,
|
|
39
|
-
HttpTypes.AdminLocaleResponse,
|
|
40
|
-
QueryKey
|
|
41
|
-
>,
|
|
42
|
-
"queryFn" | "queryKey"
|
|
43
|
-
>
|
|
44
|
-
) => {
|
|
45
|
-
const { data, ...rest } = useQuery({
|
|
46
|
-
queryKey: localesQueryKeys.detail(id),
|
|
47
|
-
queryFn: async () => sdk.admin.locale.retrieve(id, query),
|
|
48
|
-
...options,
|
|
49
|
-
})
|
|
50
|
-
|
|
51
|
-
return { ...data, ...rest }
|
|
52
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { HttpTypes } from "@medusajs/types"
|
|
2
|
-
import { createColumnHelper } from "@tanstack/react-table"
|
|
3
|
-
import { useMemo } from "react"
|
|
4
|
-
import { useTranslation } from "react-i18next"
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
TextCell,
|
|
8
|
-
TextHeader,
|
|
9
|
-
} from "../../../../components/table/table-cells/common/text-cell"
|
|
10
|
-
|
|
11
|
-
const columnHelper = createColumnHelper<HttpTypes.AdminLocale>()
|
|
12
|
-
|
|
13
|
-
export const useLocalesTableColumns = () => {
|
|
14
|
-
const { t } = useTranslation()
|
|
15
|
-
|
|
16
|
-
return useMemo(
|
|
17
|
-
() => [
|
|
18
|
-
columnHelper.accessor("code", {
|
|
19
|
-
header: () => <TextHeader text={t("fields.code")} />,
|
|
20
|
-
cell: ({ getValue }) => <TextCell text={getValue()} />,
|
|
21
|
-
}),
|
|
22
|
-
columnHelper.accessor("name", {
|
|
23
|
-
header: () => <TextHeader text={t("fields.name")} />,
|
|
24
|
-
cell: ({ getValue }) => <TextCell text={getValue()} />,
|
|
25
|
-
}),
|
|
26
|
-
],
|
|
27
|
-
[t]
|
|
28
|
-
)
|
|
29
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { useQueryParams } from "../../../../hooks/use-query-params"
|
|
2
|
-
|
|
3
|
-
export const useLocalesTableQuery = ({
|
|
4
|
-
pageSize = 10,
|
|
5
|
-
prefix,
|
|
6
|
-
}: {
|
|
7
|
-
pageSize?: number
|
|
8
|
-
prefix?: string
|
|
9
|
-
}) => {
|
|
10
|
-
const raw = useQueryParams(["order", "q", "offset"], prefix)
|
|
11
|
-
|
|
12
|
-
const { offset, ...rest } = raw
|
|
13
|
-
|
|
14
|
-
const searchParams = {
|
|
15
|
-
limit: pageSize,
|
|
16
|
-
offset: offset ? parseInt(offset) : 0,
|
|
17
|
-
...rest,
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
return { searchParams, raw }
|
|
21
|
-
}
|
|
@@ -1,240 +0,0 @@
|
|
|
1
|
-
import { HttpTypes } from "@medusajs/types"
|
|
2
|
-
import { z } from "zod"
|
|
3
|
-
import { useLocalesTableQuery } from "../../../common/hooks/use-locales-table-query"
|
|
4
|
-
import { useRouteModal } from "../../../../../components/modals/route-modal-provider"
|
|
5
|
-
import { useTranslation } from "react-i18next"
|
|
6
|
-
import { useLocales, useUpdateStore } from "../../../../../hooks/api"
|
|
7
|
-
import { keepPreviousData } from "@tanstack/react-query"
|
|
8
|
-
import { useForm } from "react-hook-form"
|
|
9
|
-
import { zodResolver } from "@hookform/resolvers/zod"
|
|
10
|
-
import {
|
|
11
|
-
createColumnHelper,
|
|
12
|
-
OnChangeFn,
|
|
13
|
-
RowSelectionState,
|
|
14
|
-
} from "@tanstack/react-table"
|
|
15
|
-
import { useMemo, useState } from "react"
|
|
16
|
-
import { useDataTable } from "../../../../../hooks/use-data-table"
|
|
17
|
-
import { Button, Checkbox, Hint, toast, Tooltip } from "@medusajs/ui"
|
|
18
|
-
import { RouteFocusModal } from "../../../../../components/modals/route-focus-modal"
|
|
19
|
-
import { KeyboundForm } from "../../../../../components/utilities/keybound-form"
|
|
20
|
-
import { _DataTable } from "../../../../../components/table/data-table"
|
|
21
|
-
import { useLocalesTableColumns } from "../../../common/hooks/use-locales-table-columns"
|
|
22
|
-
|
|
23
|
-
type AddLocalesFormProps = {
|
|
24
|
-
store: HttpTypes.AdminStore
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const AddLocalesSchema = z.object({
|
|
28
|
-
locales: z.array(z.string()).min(1),
|
|
29
|
-
})
|
|
30
|
-
|
|
31
|
-
const PAGE_SIZE = 50
|
|
32
|
-
const PREFIX = "al"
|
|
33
|
-
|
|
34
|
-
export const AddLocalesForm = ({ store }: AddLocalesFormProps) => {
|
|
35
|
-
const { t } = useTranslation()
|
|
36
|
-
const { handleSuccess } = useRouteModal()
|
|
37
|
-
|
|
38
|
-
const { raw, searchParams } = useLocalesTableQuery({
|
|
39
|
-
pageSize: PAGE_SIZE,
|
|
40
|
-
prefix: PREFIX,
|
|
41
|
-
})
|
|
42
|
-
|
|
43
|
-
const {
|
|
44
|
-
locales,
|
|
45
|
-
count,
|
|
46
|
-
isPending: isLoading,
|
|
47
|
-
isError,
|
|
48
|
-
error,
|
|
49
|
-
} = useLocales(searchParams, {
|
|
50
|
-
placeholderData: keepPreviousData,
|
|
51
|
-
})
|
|
52
|
-
|
|
53
|
-
const form = useForm<z.infer<typeof AddLocalesSchema>>({
|
|
54
|
-
defaultValues: {
|
|
55
|
-
locales: [],
|
|
56
|
-
},
|
|
57
|
-
resolver: zodResolver(AddLocalesSchema),
|
|
58
|
-
})
|
|
59
|
-
|
|
60
|
-
const [rowSelection, setRowSelection] = useState<RowSelectionState>({})
|
|
61
|
-
|
|
62
|
-
const { setValue } = form
|
|
63
|
-
|
|
64
|
-
const updater: OnChangeFn<RowSelectionState> = (fn) => {
|
|
65
|
-
const updated = typeof fn === "function" ? fn(rowSelection) : fn
|
|
66
|
-
|
|
67
|
-
const ids = Object.keys(updated)
|
|
68
|
-
setValue("locales", ids, {
|
|
69
|
-
shouldDirty: true,
|
|
70
|
-
shouldTouch: true,
|
|
71
|
-
})
|
|
72
|
-
|
|
73
|
-
setRowSelection(updated)
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
const preSelectedRows =
|
|
77
|
-
store.supported_locales?.map((l) => l.locale_code) ?? []
|
|
78
|
-
|
|
79
|
-
const columns = useColumns()
|
|
80
|
-
|
|
81
|
-
const { table } = useDataTable({
|
|
82
|
-
data: locales ?? [],
|
|
83
|
-
columns,
|
|
84
|
-
count: count,
|
|
85
|
-
getRowId: (row) => row.code,
|
|
86
|
-
enableRowSelection: (row) => !preSelectedRows.includes(row.original.code),
|
|
87
|
-
enablePagination: true,
|
|
88
|
-
pageSize: PAGE_SIZE,
|
|
89
|
-
prefix: PREFIX,
|
|
90
|
-
rowSelection: {
|
|
91
|
-
state: rowSelection,
|
|
92
|
-
updater,
|
|
93
|
-
},
|
|
94
|
-
})
|
|
95
|
-
|
|
96
|
-
const { mutateAsync, isPending } = useUpdateStore(store.id)
|
|
97
|
-
|
|
98
|
-
const handleSubmit = form.handleSubmit(async (data) => {
|
|
99
|
-
const locales = Array.from(
|
|
100
|
-
new Set([...data.locales, ...preSelectedRows])
|
|
101
|
-
) as string[]
|
|
102
|
-
|
|
103
|
-
let defaultLocale = store.supported_locales?.find(
|
|
104
|
-
(l) => l.is_default
|
|
105
|
-
)?.locale_code
|
|
106
|
-
|
|
107
|
-
if (!locales.includes(defaultLocale ?? "")) {
|
|
108
|
-
defaultLocale = locales?.[0]
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
await mutateAsync(
|
|
112
|
-
{
|
|
113
|
-
supported_locales: locales.map((l) => ({
|
|
114
|
-
locale_code: l,
|
|
115
|
-
is_default: l === defaultLocale,
|
|
116
|
-
})),
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
onSuccess: () => {
|
|
120
|
-
toast.success(t("store.toast.localesUpdated"))
|
|
121
|
-
handleSuccess()
|
|
122
|
-
},
|
|
123
|
-
onError: (error) => {
|
|
124
|
-
toast.error(error.message)
|
|
125
|
-
},
|
|
126
|
-
}
|
|
127
|
-
)
|
|
128
|
-
})
|
|
129
|
-
|
|
130
|
-
if (isError) {
|
|
131
|
-
throw error
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
return (
|
|
135
|
-
<RouteFocusModal.Form form={form}>
|
|
136
|
-
<KeyboundForm
|
|
137
|
-
onSubmit={handleSubmit}
|
|
138
|
-
className="flex h-full flex-col overflow-hidden"
|
|
139
|
-
>
|
|
140
|
-
<RouteFocusModal.Header>
|
|
141
|
-
<div className="flex flex-1 items-center justify-between">
|
|
142
|
-
<div className="flex items-center">
|
|
143
|
-
{form.formState.errors.locales && (
|
|
144
|
-
<Hint variant="error">
|
|
145
|
-
{form.formState.errors.locales.message}
|
|
146
|
-
</Hint>
|
|
147
|
-
)}
|
|
148
|
-
</div>
|
|
149
|
-
</div>
|
|
150
|
-
</RouteFocusModal.Header>
|
|
151
|
-
<RouteFocusModal.Body className="flex flex-1 flex-col overflow-hidden">
|
|
152
|
-
<_DataTable
|
|
153
|
-
table={table}
|
|
154
|
-
pageSize={PAGE_SIZE}
|
|
155
|
-
count={count}
|
|
156
|
-
columns={columns}
|
|
157
|
-
layout="fill"
|
|
158
|
-
pagination
|
|
159
|
-
search="autofocus"
|
|
160
|
-
prefix={PREFIX}
|
|
161
|
-
orderBy={[
|
|
162
|
-
{ key: "name", label: t("fields.name") },
|
|
163
|
-
{ key: "code", label: t("fields.code") },
|
|
164
|
-
]}
|
|
165
|
-
isLoading={isLoading}
|
|
166
|
-
queryObject={raw}
|
|
167
|
-
/>
|
|
168
|
-
</RouteFocusModal.Body>
|
|
169
|
-
<RouteFocusModal.Footer>
|
|
170
|
-
<div className="flex items-center justify-end gap-x-2">
|
|
171
|
-
<RouteFocusModal.Close asChild>
|
|
172
|
-
<Button size="small" variant="secondary">
|
|
173
|
-
{t("actions.cancel")}
|
|
174
|
-
</Button>
|
|
175
|
-
</RouteFocusModal.Close>
|
|
176
|
-
<Button size="small" type="submit" isLoading={isPending}>
|
|
177
|
-
{t("actions.save")}
|
|
178
|
-
</Button>
|
|
179
|
-
</div>
|
|
180
|
-
</RouteFocusModal.Footer>
|
|
181
|
-
</KeyboundForm>
|
|
182
|
-
</RouteFocusModal.Form>
|
|
183
|
-
)
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
const columnHelper = createColumnHelper<HttpTypes.AdminLocale>()
|
|
187
|
-
|
|
188
|
-
const useColumns = () => {
|
|
189
|
-
const { t } = useTranslation()
|
|
190
|
-
const base = useLocalesTableColumns()
|
|
191
|
-
|
|
192
|
-
return useMemo(
|
|
193
|
-
() => [
|
|
194
|
-
columnHelper.display({
|
|
195
|
-
id: "select",
|
|
196
|
-
header: ({ table }) => {
|
|
197
|
-
return (
|
|
198
|
-
<Checkbox
|
|
199
|
-
checked={
|
|
200
|
-
table.getIsSomePageRowsSelected()
|
|
201
|
-
? "indeterminate"
|
|
202
|
-
: table.getIsAllPageRowsSelected()
|
|
203
|
-
}
|
|
204
|
-
onCheckedChange={(value) =>
|
|
205
|
-
table.toggleAllPageRowsSelected(!!value)
|
|
206
|
-
}
|
|
207
|
-
/>
|
|
208
|
-
)
|
|
209
|
-
},
|
|
210
|
-
cell: ({ row }) => {
|
|
211
|
-
const isPreSelected = !row.getCanSelect()
|
|
212
|
-
const isSelected = row.getIsSelected() || isPreSelected
|
|
213
|
-
|
|
214
|
-
const Component = (
|
|
215
|
-
<Checkbox
|
|
216
|
-
checked={isSelected}
|
|
217
|
-
disabled={isPreSelected}
|
|
218
|
-
onCheckedChange={(value) => row.toggleSelected(!!value)}
|
|
219
|
-
onClick={(e) => {
|
|
220
|
-
e.stopPropagation()
|
|
221
|
-
}}
|
|
222
|
-
/>
|
|
223
|
-
)
|
|
224
|
-
|
|
225
|
-
if (isPreSelected) {
|
|
226
|
-
return (
|
|
227
|
-
<Tooltip content={t("store.localeAlreadyAdded")} side="right">
|
|
228
|
-
{Component}
|
|
229
|
-
</Tooltip>
|
|
230
|
-
)
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
return Component
|
|
234
|
-
},
|
|
235
|
-
}),
|
|
236
|
-
...base,
|
|
237
|
-
],
|
|
238
|
-
[t, base]
|
|
239
|
-
)
|
|
240
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { StoreAddLocales as Component } from "./store-add-locales"
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { RouteFocusModal } from "../../../components/modals/route-focus-modal"
|
|
2
|
-
import { useStore } from "../../../hooks/api"
|
|
3
|
-
import { AddLocalesForm } from "./components/add-locales-form/add-locales-form"
|
|
4
|
-
import { useFeatureFlag } from "../../../providers/feature-flag-provider"
|
|
5
|
-
import { useNavigate } from "react-router-dom"
|
|
6
|
-
|
|
7
|
-
export const StoreAddLocales = () => {
|
|
8
|
-
const isEnabled = useFeatureFlag("translation")
|
|
9
|
-
const navigate = useNavigate()
|
|
10
|
-
|
|
11
|
-
if (!isEnabled) {
|
|
12
|
-
navigate(-1)
|
|
13
|
-
return null
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const { store, isPending, isError, error } = useStore()
|
|
17
|
-
|
|
18
|
-
const ready = !!store && !isPending
|
|
19
|
-
|
|
20
|
-
if (isError) {
|
|
21
|
-
throw error
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
return (
|
|
25
|
-
<RouteFocusModal>
|
|
26
|
-
{ready && <AddLocalesForm store={store} />}
|
|
27
|
-
</RouteFocusModal>
|
|
28
|
-
)
|
|
29
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./store-locale-section"
|