@medusajs/dashboard 3.0.0-preview-20250211091350 → 3.0.0-preview-20250406180144
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-YQ6JJK6I.mjs → add-campaign-promotions-EYK2OY7B.mjs} +19 -18
- package/dist/{adjust-inventory-42AT6TIZ.mjs → adjust-inventory-WYNH75F7.mjs} +10 -9
- package/dist/{api-key-management-create-FCTZ6A46.mjs → api-key-management-create-HWBQGG6O.mjs} +10 -9
- package/dist/{api-key-management-detail-V6UELD25.mjs → api-key-management-detail-2TXLKXOT.mjs} +42 -44
- package/dist/{api-key-management-edit-WTS63YJS.mjs → api-key-management-edit-UX47FHWV.mjs} +11 -10
- package/dist/{api-key-management-list-MKVE46ZE.mjs → api-key-management-list-DGPEFCW2.mjs} +17 -19
- package/dist/{api-key-management-sales-channels-SHHZXVPP.mjs → api-key-management-sales-channels-SYEJXQLU.mjs} +19 -18
- package/dist/app.css +44 -30
- package/dist/app.js +64876 -57524
- package/dist/app.mjs +56 -4597
- package/dist/{campaign-budget-edit-7MSDQ3MH.mjs → campaign-budget-edit-57NSOYJ3.mjs} +9 -8
- package/dist/{campaign-configuration-XITAHVHN.mjs → campaign-configuration-QV3OHWBZ.mjs} +9 -8
- package/dist/{campaign-create-WKVDJFQC.mjs → campaign-create-NYJ4HILG.mjs} +8 -7
- package/dist/{campaign-detail-PGM2SOEA.mjs → campaign-detail-BMKKY4FI.mjs} +43 -45
- package/dist/{campaign-edit-NRN4EBJC.mjs → campaign-edit-3D5WFWCT.mjs} +9 -8
- package/dist/{campaign-list-6TW2SO7C.mjs → campaign-list-OADDBYVB.mjs} +17 -19
- package/dist/{categories-metadata-D3EM5VK2.mjs → categories-metadata-TE7B2OJY.mjs} +35 -35
- package/dist/{category-create-ULKTNF7N.mjs → category-create-NVRG7B6E.mjs} +10 -9
- package/dist/{category-detail-Z6GWCJUW.mjs → category-detail-MTVNR43M.mjs} +44 -46
- package/dist/{category-edit-HTC6237J.mjs → category-edit-JBZQKNL7.mjs} +10 -9
- package/dist/{category-list-6WTV4T7D.mjs → category-list-2XIIEFBU.mjs} +16 -18
- package/dist/{category-organize-OPDZY4YR.mjs → category-organize-HUXXVJAB.mjs} +7 -6
- package/dist/{category-products-ND7PSI4Q.mjs → category-products-F3I4B7TM.mjs} +44 -43
- package/dist/{chunk-NRUKBT5S.mjs → chunk-2MPQMCLO.mjs} +4 -4
- package/dist/{chunk-ZYBB636P.mjs → chunk-2VTICXJR.mjs} +1 -1
- package/dist/{chunk-IPEN5VX6.mjs → chunk-2WQFRVK5.mjs} +3 -3
- package/dist/{chunk-ZMMQPAR2.mjs → chunk-2ZKVRTBW.mjs} +1 -1
- package/dist/{chunk-QDC5CTTV.mjs → chunk-32IQRUVY.mjs} +1 -1
- package/dist/{chunk-YXEAWUSX.mjs → chunk-3KLERXD7.mjs} +15 -1
- package/dist/{chunk-NDQ77BA4.mjs → chunk-3OHH43G6.mjs} +2 -2
- package/dist/{chunk-GT4RPCDE.mjs → chunk-4GJJIXM6.mjs} +2 -2
- package/dist/{chunk-EI45S6ZK.mjs → chunk-4HLCNNIC.mjs} +1 -1
- package/dist/{chunk-5ZZZZK7A.mjs → chunk-6I62UDJA.mjs} +4 -1
- package/dist/{chunk-AODKPQIG.mjs → chunk-6LA2RGO4.mjs} +3 -3
- package/dist/{chunk-77TK23EH.mjs → chunk-7I5DQGWY.mjs} +1 -0
- package/dist/{chunk-YJPZZD5Z.mjs → chunk-7MM5L2ZM.mjs} +1 -1
- package/dist/{chunk-HVUHNRLX.mjs → chunk-A2UMBW3V.mjs} +1 -1
- package/dist/{chunk-QX7ANQDG.mjs → chunk-AL4WDQTN.mjs} +23 -17
- package/dist/{chunk-S4HBRQEC.mjs → chunk-B4GODIOW.mjs} +1 -1
- package/dist/{chunk-5EJJE3NE.mjs → chunk-BC3M3N6P.mjs} +2 -2
- package/dist/{chunk-OCNMY23F.mjs → chunk-C5LYZZZ5.mjs} +1 -1
- package/dist/chunk-C5P5PL3E.mjs +31 -0
- package/dist/chunk-CDQY5XPE.mjs +5241 -0
- package/dist/{chunk-JXBMQ4SZ.mjs → chunk-CF64SRBE.mjs} +6 -6
- package/dist/{chunk-QE3BG56P.mjs → chunk-CLRTJ6DI.mjs} +2 -2
- package/dist/{chunk-CBJWO6K6.mjs → chunk-D7H6ZNK4.mjs} +12 -5
- package/dist/{chunk-LM3FXIYT.mjs → chunk-DDV2HJEV.mjs} +2 -2
- package/dist/chunk-DEQUVHHE.mjs +17 -0
- package/dist/{chunk-EMNHBSFU.mjs → chunk-DFA6WGYO.mjs} +34 -0
- package/dist/{chunk-S5X4EFD4.mjs → chunk-DRAV7IQC.mjs} +6 -6
- package/dist/{chunk-AFDSZWCS.mjs → chunk-DXOEDXLQ.mjs} +5 -5
- package/dist/{chunk-MAWEQJDF.mjs → chunk-EAX5QFXH.mjs} +1 -1
- package/dist/{chunk-WX2SMNCD.mjs → chunk-EMIHDNB7.mjs} +4 -3
- package/dist/{chunk-GVRV2SOJ.mjs → chunk-ENV6YVOM.mjs} +3 -3
- package/dist/{chunk-N6PBCMOV.mjs → chunk-EYMDU2JD.mjs} +9 -9
- package/dist/{chunk-6SDR2EUC.mjs → chunk-F6IJV2I2.mjs} +2 -2
- package/dist/{chunk-S3MWIWV4.mjs → chunk-F6PXCY3N.mjs} +34 -1
- package/dist/{chunk-BOR5HF2M.mjs → chunk-FP5F2XCU.mjs} +2 -2
- package/dist/{chunk-KLXXECPX.mjs → chunk-FVC7M755.mjs} +2 -2
- package/dist/{chunk-MRJ6KQAL.mjs → chunk-FVK4ZYYM.mjs} +2 -2
- package/dist/{chunk-ZVVQK46Y.mjs → chunk-FZANNV6G.mjs} +1 -1
- package/dist/{chunk-SWYL3QGB.mjs → chunk-G2H6MAK7.mjs} +1 -14
- package/dist/{chunk-RAKBTSZ7.mjs → chunk-GIQRSI5I.mjs} +2 -2
- package/dist/{chunk-BF3VCHXD.mjs → chunk-GRT22PE5.mjs} +2 -2
- package/dist/{chunk-IC72XMDJ.mjs → chunk-GXXQ33F7.mjs} +1 -1
- package/dist/{chunk-W6N53UNG.mjs → chunk-GZBFGV7Y.mjs} +14 -1
- package/dist/{chunk-HP4JZCP4.mjs → chunk-HDSWPQLG.mjs} +11 -12
- package/dist/{chunk-QWU4TCQ7.mjs → chunk-HGKRB5AS.mjs} +8 -8
- package/dist/{chunk-ODVOHYAS.mjs → chunk-HGUTDEW5.mjs} +26 -28
- package/dist/{chunk-QFAUOMG6.mjs → chunk-HUGE7T5V.mjs} +3 -3
- package/dist/{chunk-A2MEYV4D.mjs → chunk-ICR3D7SB.mjs} +2 -2
- package/dist/{chunk-DJPQV344.mjs → chunk-IVB3LUGL.mjs} +1 -1
- package/dist/{chunk-TKREK46F.mjs → chunk-IXQKZGD4.mjs} +1 -1
- package/dist/{chunk-3OJ4LCJL.mjs → chunk-KHN4RXLS.mjs} +1 -1
- package/dist/{chunk-TXPNGFWJ.mjs → chunk-KOSCMAIC.mjs} +1 -1
- package/dist/{chunk-VJRTPNEA.mjs → chunk-LDJKJLBJ.mjs} +1 -1
- package/dist/{chunk-CJ3L6MQZ.mjs → chunk-LIWT6YHM.mjs} +1 -1
- package/dist/{chunk-FX3ZJWB6.mjs → chunk-LTC6LGS4.mjs} +1 -1
- package/dist/{chunk-IQ2LC4FN.mjs → chunk-NGEWNLV7.mjs} +41 -54
- package/dist/{chunk-FPVDKY3X.mjs → chunk-NLC6AFB4.mjs} +23 -24
- package/dist/{chunk-WAYDNCEG.mjs → chunk-OBQI23QM.mjs} +1 -16
- package/dist/{chunk-4M3ZY7KA.mjs → chunk-PCFUZKDS.mjs} +3 -1
- package/dist/{chunk-JKKJMCX3.mjs → chunk-PEGJVODH.mjs} +1 -1
- package/dist/{chunk-JGKUKVRC.mjs → chunk-PFTU26LC.mjs} +1 -1
- package/dist/{chunk-O3US4QMC.mjs → chunk-PIR2H25N.mjs} +1 -1
- package/dist/{chunk-UQUJ5W2Q.mjs → chunk-PNU5HPGY.mjs} +2 -2
- package/dist/{chunk-B4FQDBC3.mjs → chunk-PW2G3HGL.mjs} +9 -10
- package/dist/{chunk-HYULYW73.mjs → chunk-QL4XKIVL.mjs} +1 -1
- package/dist/{chunk-SFPKA7H3.mjs → chunk-QTCZFYFH.mjs} +1 -1
- package/dist/{chunk-SY6HAFQV.mjs → chunk-QZ6PT4QV.mjs} +2 -2
- package/dist/{chunk-NAC6TXKN.mjs → chunk-RLY2SL5E.mjs} +1 -1
- package/dist/{chunk-IUIZA5UF.mjs → chunk-RWU2ZKWZ.mjs} +3 -3
- package/dist/{chunk-CLOHNZKZ.mjs → chunk-RZD5DU5K.mjs} +2 -2
- package/dist/{chunk-6FJ2PJHE.mjs → chunk-S22NYSST.mjs} +7 -4
- package/dist/{chunk-6XTDCUWJ.mjs → chunk-SKR2YX52.mjs} +2 -2
- package/dist/{chunk-UGE5SYTC.mjs → chunk-TDDYKNA2.mjs} +4 -4
- package/dist/{chunk-F7H5DLUU.mjs → chunk-TP7N4YBP.mjs} +1 -1
- package/dist/{chunk-5OOAHPXU.mjs → chunk-UAZEQNCO.mjs} +2 -2
- package/dist/{chunk-UT3IS7J3.mjs → chunk-URDECN5D.mjs} +43597 -37277
- package/dist/{chunk-23LLRBGF.mjs → chunk-V2LANK5S.mjs} +2 -2
- package/dist/{chunk-AS54JDUL.mjs → chunk-W7KW2VOI.mjs} +27 -27
- package/dist/{chunk-BKWQ2FHJ.mjs → chunk-WL7NJCWV.mjs} +1 -1
- package/dist/{chunk-JHNHXN7U.mjs → chunk-X2Y4KNQI.mjs} +2 -2
- package/dist/{chunk-YYGNAECV.mjs → chunk-X66KDK4I.mjs} +1 -1
- package/dist/{chunk-NOL65OUL.mjs → chunk-XM6J2DWV.mjs} +1 -1
- package/dist/{chunk-6CNRNROJ.mjs → chunk-YIZSVS2R.mjs} +6 -4
- package/dist/{chunk-JJ3UWAUO.mjs → chunk-YS65UGPC.mjs} +3 -3
- package/dist/{chunk-AYRG2MQL.mjs → chunk-ZCO6EK4W.mjs} +24 -7
- package/dist/{chunk-6TVXQXDC.mjs → chunk-ZIHOMEGZ.mjs} +2 -2
- package/dist/{chunk-WHZIEWSQ.mjs → chunk-ZJ3OFMHB.mjs} +2 -2
- package/dist/{collection-add-products-KGBBZFCE.mjs → collection-add-products-BAX6JOLN.mjs} +44 -43
- package/dist/{collection-create-NLRAIKZP.mjs → collection-create-PXO6DJS3.mjs} +9 -8
- package/dist/{collection-detail-AZZ2NT4L.mjs → collection-detail-YE42DHWS.mjs} +43 -45
- package/dist/{collection-edit-WO54XZLV.mjs → collection-edit-D7OGD4MC.mjs} +10 -9
- package/dist/{collection-list-2AFD2BXW.mjs → collection-list-KTS4LVM2.mjs} +54 -58
- package/dist/collection-metadata-244B7424.mjs +69 -0
- package/dist/{customer-create-AJYD5CIA.mjs → customer-create-TKKVS4LF.mjs} +8 -7
- package/dist/customer-create-address-P4YQFUI5.mjs +291 -0
- package/dist/{customer-detail-MWT2NNQK.mjs → customer-detail-HJPJLMMO.mjs} +246 -129
- package/dist/{customer-edit-566R4FAT.mjs → customer-edit-I4K3LK66.mjs} +12 -11
- package/dist/{customer-group-add-customers-6IANRPQ6.mjs → customer-group-add-customers-U3ENH6JX.mjs} +19 -18
- package/dist/{customer-group-create-XTXMFKFX.mjs → customer-group-create-5EILGGLH.mjs} +8 -7
- package/dist/{customer-group-detail-ULS2F7OQ.mjs → customer-group-detail-JRPGZBVS.mjs} +44 -46
- package/dist/{customer-group-edit-KVEBH5N2.mjs → customer-group-edit-NBVNSBMX.mjs} +9 -8
- package/dist/{customer-group-list-LZSSOYBR.mjs → customer-group-list-643IECH3.mjs} +38 -40
- package/dist/{customer-group-metadata-MTAZJYBH.mjs → customer-group-metadata-IRTI56TA.mjs} +7 -7
- package/dist/{customer-list-JAKCVGFG.mjs → customer-list-544N5LA5.mjs} +18 -20
- package/dist/{customer-metadata-RO5DVFXZ.mjs → customer-metadata-TPIFKFIQ.mjs} +7 -7
- package/dist/{customers-add-customer-group-6TEWBPIE.mjs → customers-add-customer-group-CTBHD33Y.mjs} +43 -42
- package/dist/{edit-inventory-item-N6JQUIYO.mjs → edit-inventory-item-KQUKSOGO.mjs} +6 -5
- package/dist/{edit-inventory-item-attributes-D5SSHDVI.mjs → edit-inventory-item-attributes-I55BRBWC.mjs} +23 -6
- package/dist/{edit-reservation-E6JRXRAL.mjs → edit-reservation-GEJHV6OI.mjs} +13 -12
- package/dist/{edit-rules-6XNJL6AE.mjs → edit-rules-7MMNZKEQ.mjs} +15 -13
- package/dist/index.d.ts +4 -4
- package/dist/{inventory-create-KYURNZS6.mjs → inventory-create-NZ67QMNB.mjs} +38 -36
- package/dist/{inventory-detail-S56TNEU5.mjs → inventory-detail-GO2QWKV7.mjs} +47 -48
- package/dist/{inventory-list-P2ZZH6EN.mjs → inventory-list-X7BACFKE.mjs} +15 -17
- package/dist/{inventory-metadata-IDMV4XVV.mjs → inventory-metadata-AG5IVFBR.mjs} +33 -33
- package/dist/{inventory-stock-4R73ZT3V.mjs → inventory-stock-XZWLARFE.mjs} +34 -33
- package/dist/{invite-W2J3H5L6.mjs → invite-3KXZ7ZZI.mjs} +9 -8
- package/dist/{location-create-3FROOIXF.mjs → location-create-G3CYBYOF.mjs} +9 -8
- package/dist/{location-detail-IEGCZTAI.mjs → location-detail-GHY3DXRP.mjs} +48 -42
- package/dist/{location-edit-AQUHRPQ6.mjs → location-edit-IMBG32Z4.mjs} +10 -9
- package/dist/{location-fulfillment-providers-37FS5TYU.mjs → location-fulfillment-providers-IFPDR2YN.mjs} +44 -43
- package/dist/{location-list-ITU5AOC7.mjs → location-list-5UJ6CSA7.mjs} +13 -15
- package/dist/{location-sales-channels-TSOI2JYI.mjs → location-sales-channels-HERXGXG2.mjs} +18 -17
- package/dist/{location-service-zone-create-2JT4IKFH.mjs → location-service-zone-create-DXKD3F26.mjs} +22 -24
- package/dist/{location-service-zone-edit-LKYVVXDR.mjs → location-service-zone-edit-W3G7XOC7.mjs} +13 -15
- package/dist/{location-service-zone-manage-areas-PT4R2I3K.mjs → location-service-zone-manage-areas-IFT2GCAD.mjs} +21 -20
- package/dist/{location-service-zone-shipping-option-create-KXZIUIZQ.mjs → location-service-zone-shipping-option-create-7KOH5VVW.mjs} +89 -57
- package/dist/{location-service-zone-shipping-option-edit-SC4HD6LU.mjs → location-service-zone-shipping-option-edit-ODUEKZON.mjs} +25 -16
- package/dist/{location-service-zone-shipping-option-pricing-FOET7XJC.mjs → location-service-zone-shipping-option-pricing-SKUSE5YE.mjs} +20 -19
- package/dist/{login-TN5VDDLW.mjs → login-OYY6LIPR.mjs} +37 -37
- package/dist/{manage-locations-PSPBWN5X.mjs → manage-locations-E7YAZVH2.mjs} +7 -6
- package/dist/{order-allocate-items-6HPR2T5L.mjs → order-allocate-items-TMQ5M7TG.mjs} +16 -15
- package/dist/{order-create-claim-FFWV762A.mjs → order-create-claim-AHFF4YNW.mjs} +95 -82
- package/dist/{order-create-edit-LS3ARJDM.mjs → order-create-edit-NLXEFK77.mjs} +52 -51
- package/dist/{order-create-exchange-3OVNNNW3.mjs → order-create-exchange-33STYVYU.mjs} +96 -83
- package/dist/{order-create-fulfillment-K5DFAWHB.mjs → order-create-fulfillment-62OZHL3L.mjs} +53 -51
- package/dist/{order-create-refund-2D46DG3T.mjs → order-create-refund-FXUURAS7.mjs} +60 -64
- package/dist/{order-create-return-PJ3LFXDG.mjs → order-create-return-PONHUZVN.mjs} +41 -37
- package/dist/{order-create-shipment-CCH6V3U6.mjs → order-create-shipment-REC24C7Y.mjs} +35 -34
- package/dist/{order-detail-YYP4INKH.mjs → order-detail-SYXNI7WK.mjs} +72 -85
- package/dist/{order-edit-billing-address-3PYGDUWT.mjs → order-edit-billing-address-XDNORAHG.mjs} +37 -36
- package/dist/{order-edit-email-C5AMYZDN.mjs → order-edit-email-V4DC4GJV.mjs} +36 -35
- package/dist/{order-edit-shipping-address-T6I4D234.mjs → order-edit-shipping-address-NWT5LDKC.mjs} +37 -36
- package/dist/{order-list-IMVPWMTQ.mjs → order-list-X6ETGR3A.mjs} +23 -25
- package/dist/order-metadata-4YNV2NWH.mjs +69 -0
- package/dist/{order-receive-return-2NBMNVBR.mjs → order-receive-return-AXAZNUIB.mjs} +43 -42
- package/dist/{order-request-transfer-U5OYJEI6.mjs → order-request-transfer-OZNQQL3N.mjs} +38 -36
- package/dist/{price-list-configuration-6OHKVV2W.mjs → price-list-configuration-C7QXYPBJ.mjs} +22 -21
- package/dist/{price-list-create-QKTF4G3M.mjs → price-list-create-2VI6JXLQ.mjs} +49 -48
- package/dist/{price-list-detail-G5Y3VVRK.mjs → price-list-detail-2HRWG7KP.mjs} +47 -49
- package/dist/{price-list-edit-OFFEMUHG.mjs → price-list-edit-TMZCXEFR.mjs} +11 -10
- package/dist/{price-list-list-XPNVK6IC.mjs → price-list-list-DDQYCK4O.mjs} +18 -20
- package/dist/{price-list-prices-add-NIFFLI7Y.mjs → price-list-prices-add-IQZO6P4N.mjs} +46 -45
- package/dist/{price-list-prices-edit-KAEE6YLB.mjs → price-list-prices-edit-JUS5FBBN.mjs} +16 -15
- package/dist/{product-attributes-WLWSFTCO.mjs → product-attributes-OT373EPY.mjs} +50 -11
- package/dist/{product-create-P7U26TXX.mjs → product-create-2TKUBQEH.mjs} +77 -72
- package/dist/{product-create-option-ISAGA5KO.mjs → product-create-option-E2GRTBWP.mjs} +6 -5
- package/dist/{product-create-variant-ZQKPGLQQ.mjs → product-create-variant-3B32EC76.mjs} +42 -40
- package/dist/{product-detail-6LXT2IIU.mjs → product-detail-HZBEXKBU.mjs} +105 -66
- package/dist/{product-edit-IDL5IGVQ.mjs → product-edit-V4XTHXKI.mjs} +51 -11
- package/dist/{product-edit-option-6ZGZKU5G.mjs → product-edit-option-RHMF3YKT.mjs} +6 -5
- package/dist/{product-export-JGH4CULP.mjs → product-export-EWO37XJF.mjs} +37 -51
- package/dist/{product-import-YY2EXFLI.mjs → product-import-JCEJKM3F.mjs} +35 -34
- package/dist/{product-list-XOFUYF5S.mjs → product-list-YW3UTPME.mjs} +51 -48
- package/dist/{product-media-RSCMACQU.mjs → product-media-JLPIJRET.mjs} +6 -5
- package/dist/product-metadata-PQQ7XV63.mjs +67 -0
- package/dist/{product-organization-6N7JBWH5.mjs → product-organization-D5AK5F5W.mjs} +53 -14
- package/dist/{product-prices-NPJIYAIK.mjs → product-prices-BBTCM3XR.mjs} +16 -17
- package/dist/{product-sales-channels-MKWZD4NM.mjs → product-sales-channels-7Y3D3C7Q.mjs} +14 -13
- package/dist/{product-shipping-profile-EK6G3NTZ.mjs → product-shipping-profile-3NVF3DW2.mjs} +58 -10
- package/dist/{product-stock-L3FRYPQS.mjs → product-stock-TZS75EG7.mjs} +42 -41
- package/dist/{product-tag-create-CLWQPP7D.mjs → product-tag-create-LE4MZ5BW.mjs} +34 -33
- package/dist/{product-tag-detail-NDZJLI2Q.mjs → product-tag-detail-3EOHF4Z7.mjs} +63 -66
- package/dist/{product-tag-edit-QHHZYHCG.mjs → product-tag-edit-E6WEFNFQ.mjs} +35 -34
- package/dist/{product-tag-list-A73PYQRI.mjs → product-tag-list-RUTJQUCX.mjs} +63 -66
- package/dist/product-type-create-GU5IYXQB.mjs +101 -0
- package/dist/{product-type-detail-AQ5SUXFF.mjs → product-type-detail-3X5ME5WA.mjs} +48 -47
- package/dist/{product-type-edit-5ETUUK7N.mjs → product-type-edit-S53VUBU3.mjs} +9 -8
- package/dist/{product-type-list-TUHBNIIB.mjs → product-type-list-IJI5WEYY.mjs} +22 -21
- package/dist/{product-variant-detail-3XZBP2QJ.mjs → product-variant-detail-UN6GESYO.mjs} +37 -39
- package/dist/{product-variant-edit-7FZ7PQ6U.mjs → product-variant-edit-G6AM27AT.mjs} +36 -34
- package/dist/{product-variant-manage-inventory-items-PRFQHHZD.mjs → product-variant-manage-inventory-items-BKFYUODS.mjs} +9 -7
- package/dist/{product-variant-metadata-PY76KWCU.mjs → product-variant-metadata-2V27ZMDS.mjs} +33 -33
- package/dist/{profile-detail-EYSOSXIU.mjs → profile-detail-YLKHVSGO.mjs} +7 -9
- package/dist/{profile-edit-KZGW3D7V.mjs → profile-edit-EGWJGTXV.mjs} +12 -11
- package/dist/{promotion-add-campaign-YG4T32AU.mjs → promotion-add-campaign-4VNRQF52.mjs} +11 -10
- package/dist/{promotion-create-DUY3VRR7.mjs → promotion-create-PLDWDZMZ.mjs} +17 -15
- package/dist/{promotion-detail-KUVY3KBM.mjs → promotion-detail-BRQXNXUL.mjs} +39 -41
- package/dist/{promotion-edit-details-6BZF724F.mjs → promotion-edit-details-D6M646E6.mjs} +9 -8
- package/dist/{promotion-list-6PKG7DBB.mjs → promotion-list-BSYPXZNW.mjs} +16 -18
- package/dist/{region-add-countries-5VS6OSZW.mjs → region-add-countries-D6N7ISOZ.mjs} +17 -16
- package/dist/{region-create-3UVS7VHZ.mjs → region-create-EOZTZIP5.mjs} +28 -27
- package/dist/{region-detail-SGGN2NPK.mjs → region-detail-HL4UQGTJ.mjs} +13 -15
- package/dist/{region-edit-GPMEIHUM.mjs → region-edit-PXIMLBFB.mjs} +19 -18
- package/dist/{region-list-ETVUX5R3.mjs → region-list-A7Z5XJUW.mjs} +17 -19
- package/dist/{region-metadata-J4QDEISD.mjs → region-metadata-4S6FEUXA.mjs} +35 -35
- package/dist/{reservation-create-O3ALBX5F.mjs → reservation-create-INUIVD55.mjs} +13 -12
- package/dist/{reservation-detail-X46PRDBS.mjs → reservation-detail-I4DM7TQ4.mjs} +32 -34
- package/dist/{reservation-list-HF5TGB2X.mjs → reservation-list-NID2SFUF.mjs} +17 -19
- package/dist/{reservation-metadata-GBTOI33G.mjs → reservation-metadata-5ZABNMJP.mjs} +35 -35
- package/dist/{reset-password-CXIAZ6KT.mjs → reset-password-XTYYQVM4.mjs} +7 -6
- package/dist/{return-reason-create-7DOM36PA.mjs → return-reason-create-YANSYS43.mjs} +8 -7
- package/dist/{return-reason-edit-U2DRNMRP.mjs → return-reason-edit-4FSM4H3M.mjs} +9 -8
- package/dist/{return-reason-list-R2B2M5F3.mjs → return-reason-list-PHUB3SD5.mjs} +37 -40
- package/dist/{sales-channel-add-products-XX6XXL67.mjs → sales-channel-add-products-OJR2UYTQ.mjs} +44 -43
- package/dist/{sales-channel-create-5NVNETJO.mjs → sales-channel-create-HVZPII6E.mjs} +9 -8
- package/dist/{sales-channel-detail-A5LWMTIW.mjs → sales-channel-detail-ZTX3GVHN.mjs} +43 -45
- package/dist/{sales-channel-edit-ZHU2WG4C.mjs → sales-channel-edit-BK7O3ZFI.mjs} +10 -9
- package/dist/{sales-channel-list-WIDZSTDW.mjs → sales-channel-list-HOPPCB5U.mjs} +38 -40
- package/dist/{sales-channel-metadata-EU2OLGZU.mjs → sales-channel-metadata-UH4QYASI.mjs} +35 -35
- package/dist/{shipping-profile-create-A5NGBX2U.mjs → shipping-profile-create-PBDONCGJ.mjs} +8 -7
- package/dist/{shipping-profile-detail-E2ZVCQB5.mjs → shipping-profile-detail-EORJZ7NX.mjs} +6 -8
- package/dist/{shipping-profile-metadata-B3XD5644.mjs → shipping-profile-metadata-UB73OBPJ.mjs} +33 -33
- package/dist/{shipping-profiles-list-QF6YVBB6.mjs → shipping-profiles-list-WRKLRQR7.mjs} +14 -16
- package/dist/{store-add-currencies-SSEOM5WZ.mjs → store-add-currencies-CPWMKSFB.mjs} +19 -18
- package/dist/{store-detail-RK42OQIJ.mjs → store-detail-WLC4RF2Y.mjs} +136 -138
- package/dist/{store-edit-VP2ZK6DB.mjs → store-edit-JNSWFWIG.mjs} +12 -10
- package/dist/store-metadata-GLAZZPP6.mjs +68 -0
- package/dist/{tax-region-create-OLUBBICW.mjs → tax-region-create-EW5USMNY.mjs} +35 -34
- package/dist/{tax-region-detail-MUS2Q44R.mjs → tax-region-detail-MVSV7BWW.mjs} +45 -47
- package/dist/{tax-region-list-OAH2FFY2.mjs → tax-region-list-FNVPRMTQ.mjs} +13 -15
- package/dist/{tax-region-province-create-TAQQLOAS.mjs → tax-region-province-create-LQ5SPSXW.mjs} +10 -9
- package/dist/{tax-region-province-detail-WENPM2PD.mjs → tax-region-province-detail-4G2WUUBB.mjs} +40 -42
- package/dist/{tax-region-tax-override-create-VANMBRAP.mjs → tax-region-tax-override-create-TMMFKM7B.mjs} +67 -67
- package/dist/{tax-region-tax-override-edit-IY5SXK2S.mjs → tax-region-tax-override-edit-R2G2M4PQ.mjs} +72 -72
- package/dist/{tax-region-tax-rate-create-GU7QEL3V.mjs → tax-region-tax-rate-create-7GNLSDJ2.mjs} +12 -11
- package/dist/{tax-region-tax-rate-edit-JZO6CSAX.mjs → tax-region-tax-rate-edit-6U2BQMIE.mjs} +11 -10
- package/dist/{user-detail-I53MPAAS.mjs → user-detail-X2Z2IYNI.mjs} +7 -9
- package/dist/{user-edit-5OL3L6IX.mjs → user-edit-HFSJM4QT.mjs} +9 -8
- package/dist/{user-invite-HKO52FHN.mjs → user-invite-5S2HHL2P.mjs} +23 -22
- package/dist/{user-list-6DWTXQUP.mjs → user-list-LI27NZLQ.mjs} +12 -14
- package/dist/user-metadata-GJ6PIXLU.mjs +70 -0
- package/dist/{workflow-execution-detail-ERZLGDON.mjs → workflow-execution-detail-D26MDYFC.mjs} +32 -34
- package/dist/{workflow-execution-list-VEHTWIZD.mjs → workflow-execution-list-4QDXZ3N5.mjs} +12 -14
- package/package.json +11 -12
- package/src/app.tsx +19 -14
- package/src/components/common/empty-table-content/empty-table-content.tsx +5 -2
- package/src/components/common/infinite-list/infinite-list.tsx +18 -8
- package/src/components/common/listicle/index.ts +1 -0
- package/src/components/common/listicle/listicle.tsx +34 -0
- package/src/components/common/sidebar-link/sidebar-link.tsx +2 -2
- package/src/components/common/switch-box/switch-box.tsx +15 -11
- package/src/components/data-table/data-table.tsx +19 -17
- package/src/components/forms/metadata-form/metadata-form.tsx +19 -8
- package/src/components/inputs/combobox/combobox.tsx +15 -1
- package/src/components/layout/main-layout/main-layout.tsx +3 -3
- package/src/components/layout/nav-item/nav-item.tsx +1 -1
- package/src/components/layout/notifications/notifications.tsx +1 -0
- package/src/components/layout/settings-layout/settings-layout.tsx +2 -3
- package/src/components/modals/hooks/use-state-aware-to.tsx +26 -0
- package/src/components/modals/route-drawer/route-drawer.tsx +7 -4
- package/src/components/modals/route-focus-modal/route-focus-modal.tsx +7 -4
- package/src/components/modals/route-modal-provider/route-provider.tsx +2 -2
- package/src/components/table/table-cells/common/date-cell/date-cell.tsx +10 -12
- package/src/{extensions/dashboard-extension-manager/dashboard-extension-manager.tsx → dashboard-app/dashboard-app.tsx} +168 -58
- package/src/{extensions → dashboard-app}/forms/form-extension-zone/form-extension-zone.tsx +5 -3
- package/src/{extensions → dashboard-app}/index.ts +1 -2
- package/src/dashboard-app/routes/get-route.map.tsx +1742 -0
- package/src/dashboard-app/routes/utils.ts +221 -0
- package/src/{extensions → dashboard-app}/types.ts +15 -0
- package/src/hooks/api/auth.tsx +1 -1
- package/src/hooks/api/customers.tsx +113 -0
- package/src/hooks/api/inventory.tsx +3 -0
- package/src/hooks/api/order-edits.tsx +1 -1
- package/src/hooks/table/query/use-product-table-query.tsx +4 -0
- package/src/hooks/use-combobox-data.tsx +6 -2
- package/src/i18n/languages.ts +15 -1
- package/src/i18n/translations/$schema.json +149 -5
- package/src/i18n/translations/__tests__/validate-translations.spec.ts +1 -0
- package/src/i18n/translations/bg.json +2983 -0
- package/src/i18n/translations/en.json +64 -25
- package/src/i18n/translations/index.ts +8 -0
- package/src/i18n/translations/lt.json +3003 -0
- package/src/i18n/translations/pl.json +359 -74
- package/src/index.ts +2 -0
- package/src/lib/payment.ts +8 -6
- package/src/providers/extension-provider/extension-context.tsx +8 -0
- package/src/providers/extension-provider/extension-provider.tsx +18 -0
- package/src/providers/extension-provider/index.ts +2 -0
- package/src/providers/extension-provider/use-extension.tsx +10 -0
- package/src/providers/providers.tsx +5 -7
- package/src/routes/api-key-management/api-key-management-detail/api-key-management-detail.tsx +2 -2
- package/src/routes/api-key-management/api-key-management-detail/components/api-key-general-section/api-key-general-section.tsx +3 -1
- package/src/routes/api-key-management/api-key-management-list/api-key-management-list.tsx +2 -2
- package/src/routes/campaigns/campaign-detail/campaign-detail.tsx +2 -2
- package/src/routes/campaigns/campaign-list/campaign-list.tsx +2 -2
- package/src/routes/categories/category-detail/category-detail.tsx +2 -2
- package/src/routes/categories/category-list/category-list.tsx +2 -2
- package/src/routes/collections/collection-detail/collection-detail.tsx +2 -2
- package/src/routes/collections/collection-list/collection-list.tsx +2 -2
- package/src/routes/customer-groups/customer-group-detail/customer-group-detail.tsx +2 -2
- package/src/routes/customer-groups/customer-group-list/components/customer-group-list-table/customer-group-list-table.tsx +8 -8
- package/src/routes/customer-groups/customer-group-list/customer-group-list.tsx +2 -2
- package/src/routes/customers/customer-create-address/components/create-customer-address-form/create-customer-address-form.tsx +282 -0
- package/src/routes/customers/customer-create-address/components/create-customer-address-form/index.ts +1 -0
- package/src/routes/customers/customer-create-address/customer-create-address.tsx +10 -0
- package/src/routes/customers/customer-create-address/index.ts +1 -0
- package/src/routes/customers/customer-detail/components/customer-address-section/customer-address-section.tsx +104 -0
- package/src/routes/customers/customer-detail/components/customer-address-section/index.ts +1 -0
- package/src/routes/customers/customer-detail/customer-detail.tsx +21 -11
- package/src/routes/customers/customer-detail/loader.ts +4 -1
- package/src/routes/customers/customer-list/customer-list.tsx +2 -2
- package/src/routes/inventory/inventory-detail/components/adjust-inventory/adjust-inventory-drawer.tsx +1 -1
- package/src/routes/inventory/inventory-detail/components/edit-inventory-item-attributes/components/edit-item-attributes-form.tsx +17 -0
- package/src/routes/inventory/inventory-detail/components/inventory-item-attributes/attributes-section.tsx +1 -0
- package/src/routes/inventory/inventory-detail/inventory-detail.tsx +2 -2
- package/src/routes/inventory/inventory-list/inventory-list.tsx +2 -2
- package/src/routes/locations/location-detail/components/location-general-section/location-general-section.tsx +13 -3
- package/src/routes/locations/location-detail/location-detail.tsx +2 -2
- package/src/routes/locations/location-list/location-list.tsx +10 -12
- package/src/routes/locations/location-service-zone-create/components/create-service-zone-form/create-service-zone-form.tsx +2 -3
- package/src/routes/locations/location-service-zone-edit/components/edit-region-form/edit-service-zone-form.tsx +4 -3
- package/src/routes/locations/location-service-zone-shipping-option-create/components/create-shipping-options-form/create-shipping-option-details-form.tsx +54 -46
- package/src/routes/locations/location-service-zone-shipping-option-create/components/create-shipping-options-form/create-shipping-options-form.tsx +8 -2
- package/src/routes/locations/location-service-zone-shipping-option-create/components/create-shipping-options-form/create-shipping-options-prices-form.tsx +27 -2
- package/src/routes/locations/location-service-zone-shipping-option-create/location-service-zone-shipping-option-create.tsx +14 -3
- package/src/routes/locations/location-service-zone-shipping-option-edit/components/edit-region-form/edit-shipping-option-form.tsx +50 -42
- package/src/routes/locations/location-service-zone-shipping-option-edit/location-service-zone-shipping-option-edit.tsx +15 -1
- package/src/routes/login/login.tsx +2 -2
- package/src/routes/orders/order-create-claim/components/claim-create-form/claim-create-form.tsx +22 -18
- package/src/routes/orders/order-create-claim/components/claim-create-form/claim-outbound-section.tsx +29 -16
- package/src/routes/orders/order-create-exchange/components/exchange-create-form/exchange-inbound-section.tsx +20 -15
- package/src/routes/orders/order-create-exchange/components/exchange-create-form/exchange-outbound-section.tsx +30 -17
- package/src/routes/orders/order-create-fulfillment/components/order-create-fulfillment-form/order-create-fulfillment-form.tsx +25 -18
- package/src/routes/orders/order-create-refund/components/create-refund-form/create-refund-form.tsx +22 -25
- package/src/routes/orders/order-create-return/components/return-create-form/return-create-form.tsx +9 -7
- package/src/routes/orders/order-detail/components/order-fulfillment-section/order-fulfillment-section.tsx +27 -5
- package/src/routes/orders/order-detail/components/order-summary-section/order-summary-section.tsx +21 -28
- package/src/routes/orders/order-detail/constants.ts +1 -0
- package/src/routes/orders/order-detail/order-detail.tsx +2 -2
- package/src/routes/orders/order-list/order-list.tsx +2 -2
- package/src/routes/orders/order-receive-return/components/order-receive-return-form/order-receive-return-form.tsx +2 -2
- package/src/routes/price-lists/price-list-detail/components/price-list-configuration-section/price-list-configuration-section.tsx +1 -1
- package/src/routes/price-lists/price-list-detail/price-list-detail.tsx +2 -2
- package/src/routes/price-lists/price-list-list/price-list-list.tsx +2 -2
- package/src/routes/product-tags/product-tag-detail/product-tag-detail.tsx +2 -2
- package/src/routes/product-tags/product-tag-list/product-tag-list.tsx +2 -2
- package/src/routes/product-types/common/hooks/use-delete-product-type-action.tsx +7 -3
- package/src/routes/product-types/product-type-create/components/create-product-type-form/create-product-type-form.tsx +20 -23
- package/src/routes/product-types/product-type-detail/components/product-type-general-section/product-type-general-section.tsx +4 -1
- package/src/routes/product-types/product-type-detail/product-type-detail.tsx +2 -2
- package/src/routes/product-types/product-type-list/components/product-type-list-table/product-table-row-actions.tsx +4 -1
- package/src/routes/product-types/product-type-list/product-type-list.tsx +2 -2
- package/src/routes/product-variants/product-variant-detail/product-variant-detail.tsx +2 -2
- package/src/routes/product-variants/product-variant-manage-inventory-items/components/manage-variant-inventory-items-form/manage-variant-inventory-items-form.tsx +1 -1
- package/src/routes/products/product-attributes/components/product-attributes-form/product-attributes-form.tsx +3 -3
- package/src/routes/products/product-create/components/product-create-details-form/components/product-create-details-variant-section/product-create-details-variant-section.tsx +2 -2
- package/src/routes/products/product-create/components/product-create-details-form/product-create-details-form.tsx +3 -5
- package/src/routes/products/product-create/components/product-create-form/product-create-form.tsx +10 -14
- package/src/routes/products/product-create/components/product-create-inventory-kit-form/components/product-create-inventory-kit-section/product-create-inventory-kit-section.tsx +1 -1
- package/src/routes/products/product-create/components/product-create-organize-form/components/product-create-organize-section/product-create-details-organize-section.tsx +3 -1
- package/src/routes/products/product-create/components/product-create-organize-form/product-create-organize-form.tsx +3 -5
- package/src/routes/products/product-create/constants.ts +4 -4
- package/src/routes/products/product-create/utils.ts +6 -6
- package/src/routes/products/product-detail/components/product-attribute-section/product-attribute-section.tsx +2 -2
- package/src/routes/products/product-detail/components/product-general-section/product-general-section.tsx +2 -2
- package/src/routes/products/product-detail/components/product-organization-section/product-organization-section.tsx +2 -2
- package/src/routes/products/product-detail/components/product-variant-section/product-variant-section.tsx +53 -16
- package/src/routes/products/product-detail/constants.ts +1 -1
- package/src/routes/products/product-detail/product-detail.tsx +2 -2
- package/src/routes/products/product-edit/components/edit-product-form/edit-product-form.tsx +4 -6
- package/src/routes/products/product-export/product-export.tsx +1 -3
- package/src/routes/products/product-list/components/product-list-table/product-list-table.tsx +1 -0
- package/src/routes/products/product-list/loader.ts +7 -2
- package/src/routes/products/product-list/product-list.tsx +2 -2
- package/src/routes/products/product-organization/components/product-organization-form/product-organization-form.tsx +3 -3
- package/src/routes/products/product-prices/product-prices.tsx +1 -3
- package/src/routes/products/product-shipping-profile/components/product-organization-form/product-shipping-profile-form.tsx +13 -2
- package/src/routes/products/product-stock/components/product-stock-form/product-stock-form.tsx +2 -2
- package/src/routes/profile/profile-detail/profile-detail.tsx +2 -2
- package/src/routes/promotions/common/edit-rules/components/rule-value-form-field/rule-value-form-field.tsx +30 -54
- package/src/routes/promotions/promotion-detail/promotion-detail.tsx +2 -2
- package/src/routes/promotions/promotion-list/promotions-list.tsx +2 -2
- package/src/routes/regions/region-detail/region-detail.tsx +2 -2
- package/src/routes/regions/region-list/region-list.tsx +2 -2
- package/src/routes/reservations/reservation-detail/reservation-detail.tsx +3 -3
- package/src/routes/reservations/reservation-list/reservation-list.tsx +2 -2
- package/src/routes/return-reasons/return-reason-list/return-reason-list.tsx +2 -2
- package/src/routes/sales-channels/sales-channel-detail/sales-channel-detail.tsx +2 -2
- package/src/routes/sales-channels/sales-channel-list/sales-channel-list.tsx +2 -2
- package/src/routes/shipping-profiles/shipping-profile-detail/shipping-profile-detail.tsx +2 -2
- package/src/routes/shipping-profiles/shipping-profiles-list/shipping-profile-list.tsx +2 -2
- package/src/routes/store/store-detail/components/store-currency-section/{store-currencies-section.tsx/store-currency-section.tsx → store-currency-section.tsx} +9 -9
- package/src/routes/store/store-detail/store-detail.tsx +8 -8
- package/src/routes/tax-regions/tax-region-detail/tax-region-detail.tsx +2 -2
- package/src/routes/tax-regions/tax-region-list/tax-region-list.tsx +2 -2
- package/src/routes/tax-regions/tax-region-province-detail/tax-region-detail.tsx +2 -2
- package/src/routes/users/user-detail/user-detail.tsx +2 -2
- package/src/routes/users/user-list/user-list.tsx +2 -2
- package/src/routes/workflow-executions/workflow-execution-detail/workflow-detail.tsx +2 -2
- package/src/routes/workflow-executions/workflow-execution-list/workflow-execution-list.tsx +2 -2
- package/src/vite-env.d.ts +3 -0
- package/dist/chunk-53IEL2PE.mjs +0 -46
- package/dist/chunk-VIJAVLIU.mjs +0 -551
- package/dist/chunk-XWO5BP42.mjs +0 -37
- package/dist/collection-metadata-XSJPOGIP.mjs +0 -69
- package/dist/order-metadata-DRR355QQ.mjs +0 -69
- package/dist/product-metadata-EW6JGOKL.mjs +0 -67
- package/dist/product-type-create-5AWIC2HY.mjs +0 -107
- package/dist/store-metadata-Z2PO4TKS.mjs +0 -68
- package/dist/user-metadata-ISZ5VACI.mjs +0 -70
- package/index.html +0 -13
- package/src/components/common/inline-tip/index.ts +0 -1
- package/src/components/common/inline-tip/inline-tip.tsx +0 -60
- package/src/extensions/dashboard-extension-manager/index.ts +0 -2
- package/src/extensions/dashboard-extension-provider/dashboard-extension-context.tsx +0 -7
- package/src/extensions/dashboard-extension-provider/dashboard-extension-provider.tsx +0 -18
- package/src/extensions/dashboard-extension-provider/index.ts +0 -2
- package/src/extensions/dashboard-extension-provider/use-dashboard-extension.tsx +0 -12
- package/src/extensions/routes/utils.ts +0 -71
- package/src/providers/router-provider/index.ts +0 -1
- package/src/providers/router-provider/route-extensions.tsx +0 -12
- package/src/providers/router-provider/route-map.tsx +0 -1688
- package/src/providers/router-provider/router-provider.tsx +0 -14
- package/src/providers/router-provider/settings-extensions.tsx +0 -12
- package/dist/{chunk-RNCCSLPH.mjs → chunk-LBIOZZPA.mjs} +1 -1
- /package/src/{extensions → dashboard-app}/forms/form-extension-zone/index.ts +0 -0
- /package/src/{extensions → dashboard-app}/forms/form-extension-zone/types.ts +0 -0
- /package/src/{extensions → dashboard-app}/forms/form-extension-zone/utils.ts +0 -0
- /package/src/{extensions → dashboard-app}/forms/hooks.tsx +0 -0
- /package/src/{extensions → dashboard-app}/forms/index.ts +0 -0
- /package/src/{extensions → dashboard-app}/links/utils.ts +0 -0
- /package/src/routes/store/store-detail/components/store-currency-section/{store-currencies-section.tsx/index.ts → index.ts} +0 -0
package/dist/app.mjs
CHANGED
@@ -1,4613 +1,72 @@
|
|
1
1
|
import {
|
2
|
-
|
3
|
-
|
4
|
-
|
2
|
+
DashboardApp
|
3
|
+
} from "./chunk-CDQY5XPE.mjs";
|
4
|
+
import "./chunk-BC3M3N6P.mjs";
|
5
|
+
import "./chunk-ONB3JEHR.mjs";
|
5
6
|
import "./chunk-4GQOUCX6.mjs";
|
6
|
-
import
|
7
|
-
|
8
|
-
} from "./chunk-ZYBB636P.mjs";
|
9
|
-
import {
|
10
|
-
ProgressBar
|
11
|
-
} from "./chunk-D3YQN7HV.mjs";
|
12
|
-
import {
|
13
|
-
Thumbnail
|
14
|
-
} from "./chunk-MNXC6Q4F.mjs";
|
15
|
-
import {
|
16
|
-
I18n
|
17
|
-
} from "./chunk-UT3IS7J3.mjs";
|
18
|
-
import {
|
19
|
-
FilePreview
|
20
|
-
} from "./chunk-XKXNQ2KV.mjs";
|
7
|
+
import "./chunk-2VTICXJR.mjs";
|
8
|
+
import "./chunk-D3YQN7HV.mjs";
|
21
9
|
import "./chunk-VDBOSWVE.mjs";
|
22
|
-
import
|
23
|
-
|
24
|
-
|
10
|
+
import "./chunk-URDECN5D.mjs";
|
11
|
+
import "./chunk-MNXC6Q4F.mjs";
|
12
|
+
import "./chunk-C5P5PL3E.mjs";
|
13
|
+
import "./chunk-LPEUYMRK.mjs";
|
14
|
+
import "./chunk-XKXNQ2KV.mjs";
|
25
15
|
import "./chunk-3NJTXRIY.mjs";
|
26
|
-
import
|
27
|
-
|
28
|
-
|
29
|
-
import
|
30
|
-
|
31
|
-
|
32
|
-
import
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
import
|
39
|
-
|
40
|
-
|
41
|
-
import "./chunk-
|
42
|
-
import
|
43
|
-
|
44
|
-
|
45
|
-
import
|
46
|
-
|
47
|
-
|
48
|
-
import
|
49
|
-
|
50
|
-
|
51
|
-
import "./chunk-
|
52
|
-
import "./chunk-
|
53
|
-
import
|
54
|
-
|
55
|
-
|
56
|
-
import "./chunk-
|
57
|
-
import "./chunk-OCNMY23F.mjs";
|
58
|
-
import {
|
59
|
-
useMe,
|
60
|
-
useUsers
|
61
|
-
} from "./chunk-ZMMQPAR2.mjs";
|
62
|
-
import "./chunk-GT4RPCDE.mjs";
|
63
|
-
import {
|
64
|
-
usePriceLists
|
65
|
-
} from "./chunk-JJ3UWAUO.mjs";
|
66
|
-
import {
|
67
|
-
useCustomerGroups,
|
68
|
-
useCustomers
|
69
|
-
} from "./chunk-S3MWIWV4.mjs";
|
70
|
-
import {
|
71
|
-
useCollections
|
72
|
-
} from "./chunk-NDQ77BA4.mjs";
|
73
|
-
import {
|
74
|
-
useCampaigns,
|
75
|
-
usePromotions
|
76
|
-
} from "./chunk-SWYL3QGB.mjs";
|
77
|
-
import "./chunk-BF3VCHXD.mjs";
|
78
|
-
import {
|
79
|
-
useStockLocations
|
80
|
-
} from "./chunk-QDC5CTTV.mjs";
|
81
|
-
import {
|
82
|
-
useOrders
|
83
|
-
} from "./chunk-IUIZA5UF.mjs";
|
84
|
-
import "./chunk-KLXXECPX.mjs";
|
85
|
-
import {
|
86
|
-
useSalesChannels
|
87
|
-
} from "./chunk-UQUJ5W2Q.mjs";
|
88
|
-
import {
|
89
|
-
useProductCategories
|
90
|
-
} from "./chunk-WHZIEWSQ.mjs";
|
91
|
-
import {
|
92
|
-
useStore
|
93
|
-
} from "./chunk-23LLRBGF.mjs";
|
94
|
-
import {
|
95
|
-
useRegions
|
96
|
-
} from "./chunk-SY6HAFQV.mjs";
|
97
|
-
import "./chunk-HYULYW73.mjs";
|
98
|
-
import {
|
99
|
-
DashboardExtensionManager,
|
100
|
-
DashboardExtensionProvider,
|
101
|
-
ErrorBoundary,
|
102
|
-
createRouteMap,
|
103
|
-
getRouteExtensions,
|
104
|
-
useDashboardExtension
|
105
|
-
} from "./chunk-VIJAVLIU.mjs";
|
106
|
-
import "./chunk-ONB3JEHR.mjs";
|
107
|
-
import "./chunk-53IEL2PE.mjs";
|
108
|
-
import {
|
109
|
-
useInventoryItems,
|
110
|
-
useProducts
|
111
|
-
} from "./chunk-5ZZZZK7A.mjs";
|
112
|
-
import {
|
113
|
-
queryClient
|
114
|
-
} from "./chunk-FXYH54JP.mjs";
|
16
|
+
import "./chunk-OC7BQLYI.mjs";
|
17
|
+
import "./chunk-3KLERXD7.mjs";
|
18
|
+
import "./chunk-OBQI23QM.mjs";
|
19
|
+
import "./chunk-CLRTJ6DI.mjs";
|
20
|
+
import "./chunk-KOSCMAIC.mjs";
|
21
|
+
import "./chunk-UAZEQNCO.mjs";
|
22
|
+
import "./chunk-LDJKJLBJ.mjs";
|
23
|
+
import "./chunk-B4GODIOW.mjs";
|
24
|
+
import "./chunk-F6IJV2I2.mjs";
|
25
|
+
import "./chunk-QTCZFYFH.mjs";
|
26
|
+
import "./chunk-ENV6YVOM.mjs";
|
27
|
+
import "./chunk-PIR2H25N.mjs";
|
28
|
+
import "./chunk-RLY2SL5E.mjs";
|
29
|
+
import "./chunk-C5LYZZZ5.mjs";
|
30
|
+
import "./chunk-2ZKVRTBW.mjs";
|
31
|
+
import "./chunk-4GJJIXM6.mjs";
|
32
|
+
import "./chunk-YS65UGPC.mjs";
|
33
|
+
import "./chunk-F6PXCY3N.mjs";
|
34
|
+
import "./chunk-3OHH43G6.mjs";
|
35
|
+
import "./chunk-G2H6MAK7.mjs";
|
36
|
+
import "./chunk-GRT22PE5.mjs";
|
37
|
+
import "./chunk-32IQRUVY.mjs";
|
38
|
+
import "./chunk-RWU2ZKWZ.mjs";
|
39
|
+
import "./chunk-FVC7M755.mjs";
|
40
|
+
import "./chunk-ZJ3OFMHB.mjs";
|
41
|
+
import "./chunk-PNU5HPGY.mjs";
|
42
|
+
import "./chunk-V2LANK5S.mjs";
|
43
|
+
import "./chunk-QZ6PT4QV.mjs";
|
44
|
+
import "./chunk-QL4XKIVL.mjs";
|
45
|
+
import "./chunk-6I62UDJA.mjs";
|
46
|
+
import "./chunk-FXYH54JP.mjs";
|
115
47
|
import "./chunk-774WSTCC.mjs";
|
116
|
-
import
|
117
|
-
sdk
|
118
|
-
} from "./chunk-WAYDNCEG.mjs";
|
48
|
+
import "./chunk-DEQUVHHE.mjs";
|
119
49
|
import "./chunk-GH77ZQI2.mjs";
|
120
50
|
|
121
|
-
// src/providers/providers.tsx
|
122
|
-
import { Toaster, TooltipProvider } from "@medusajs/ui";
|
123
|
-
import { QueryClientProvider } from "@tanstack/react-query";
|
124
|
-
import { HelmetProvider } from "react-helmet-async";
|
125
|
-
|
126
|
-
// src/providers/i18n-provider/i18n-provider.tsx
|
127
|
-
import { I18nProvider as Provider } from "@medusajs/ui";
|
128
|
-
import { useTranslation } from "react-i18next";
|
129
|
-
import { jsx } from "react/jsx-runtime";
|
130
|
-
var formatLocaleCode = (code) => {
|
131
|
-
return code.replace(/([a-z])([A-Z])/g, "$1-$2");
|
132
|
-
};
|
133
|
-
var I18nProvider = ({ children }) => {
|
134
|
-
const { i18n } = useTranslation();
|
135
|
-
const locale = languages.find((lan) => lan.code === i18n.language)?.code || languages[0].code;
|
136
|
-
return /* @__PURE__ */ jsx(Provider, { locale: formatLocaleCode(locale), children });
|
137
|
-
};
|
138
|
-
|
139
|
-
// src/providers/theme-provider/theme-provider.tsx
|
140
|
-
import { useEffect, useState } from "react";
|
141
|
-
|
142
|
-
// src/providers/theme-provider/theme-context.tsx
|
143
|
-
import { createContext } from "react";
|
144
|
-
var ThemeContext = createContext(null);
|
145
|
-
|
146
|
-
// src/providers/theme-provider/theme-provider.tsx
|
147
|
-
import { jsx as jsx2 } from "react/jsx-runtime";
|
148
|
-
var THEME_KEY = "medusa_admin_theme";
|
149
|
-
function getDefaultValue() {
|
150
|
-
const persisted = localStorage?.getItem(THEME_KEY);
|
151
|
-
if (persisted) {
|
152
|
-
return persisted;
|
153
|
-
}
|
154
|
-
return "system";
|
155
|
-
}
|
156
|
-
function getThemeValue(selected) {
|
157
|
-
if (selected === "system") {
|
158
|
-
if (window !== void 0) {
|
159
|
-
return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
160
|
-
}
|
161
|
-
return "light";
|
162
|
-
}
|
163
|
-
return selected;
|
164
|
-
}
|
165
|
-
var ThemeProvider = ({ children }) => {
|
166
|
-
const [state, setState] = useState(getDefaultValue());
|
167
|
-
const [value, setValue] = useState(getThemeValue(state));
|
168
|
-
const setTheme = (theme) => {
|
169
|
-
localStorage.setItem(THEME_KEY, theme);
|
170
|
-
const themeValue = getThemeValue(theme);
|
171
|
-
setState(theme);
|
172
|
-
setValue(themeValue);
|
173
|
-
};
|
174
|
-
useEffect(() => {
|
175
|
-
const html = document.querySelector("html");
|
176
|
-
if (html) {
|
177
|
-
const css = document.createElement("style");
|
178
|
-
css.appendChild(
|
179
|
-
document.createTextNode(
|
180
|
-
`* {
|
181
|
-
-webkit-transition: none !important;
|
182
|
-
-moz-transition: none !important;
|
183
|
-
-o-transition: none !important;
|
184
|
-
-ms-transition: none !important;
|
185
|
-
transition: none !important;
|
186
|
-
}`
|
187
|
-
)
|
188
|
-
);
|
189
|
-
document.head.appendChild(css);
|
190
|
-
html.classList.remove(value === "light" ? "dark" : "light");
|
191
|
-
html.classList.add(value);
|
192
|
-
html.style.colorScheme = value;
|
193
|
-
window.getComputedStyle(css).opacity;
|
194
|
-
document.head.removeChild(css);
|
195
|
-
}
|
196
|
-
}, [value]);
|
197
|
-
return /* @__PURE__ */ jsx2(ThemeContext.Provider, { value: { theme: state, setTheme }, children });
|
198
|
-
};
|
199
|
-
|
200
|
-
// src/providers/theme-provider/use-theme.tsx
|
201
|
-
import { useContext } from "react";
|
202
|
-
var useTheme = () => {
|
203
|
-
const context = useContext(ThemeContext);
|
204
|
-
if (!context) {
|
205
|
-
throw new Error("useTheme must be used within a ThemeProvider");
|
206
|
-
}
|
207
|
-
return context;
|
208
|
-
};
|
209
|
-
|
210
|
-
// src/providers/providers.tsx
|
211
|
-
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
212
|
-
var Providers = ({ api, children }) => {
|
213
|
-
return /* @__PURE__ */ jsx3(TooltipProvider, { children: /* @__PURE__ */ jsx3(DashboardExtensionProvider, { api, children: /* @__PURE__ */ jsx3(HelmetProvider, { children: /* @__PURE__ */ jsx3(QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsxs(ThemeProvider, { children: [
|
214
|
-
/* @__PURE__ */ jsx3(I18n, {}),
|
215
|
-
/* @__PURE__ */ jsx3(I18nProvider, { children }),
|
216
|
-
/* @__PURE__ */ jsx3(Toaster, {})
|
217
|
-
] }) }) }) }) });
|
218
|
-
};
|
219
|
-
|
220
|
-
// src/providers/router-provider/router-provider.tsx
|
221
|
-
import {
|
222
|
-
RouterProvider as Provider2,
|
223
|
-
createBrowserRouter
|
224
|
-
} from "react-router-dom";
|
225
|
-
|
226
|
-
// src/providers/router-provider/route-map.tsx
|
227
|
-
import { Outlet as Outlet4 } from "react-router-dom";
|
228
|
-
import { t } from "i18next";
|
229
|
-
|
230
|
-
// src/components/authentication/protected-route/protected-route.tsx
|
231
|
-
import { Spinner as Spinner2 } from "@medusajs/icons";
|
232
|
-
import { Navigate, Outlet, useLocation as useLocation3 } from "react-router-dom";
|
233
|
-
|
234
|
-
// src/providers/search-provider/search-provider.tsx
|
235
|
-
import { useEffect as useEffect6, useState as useState6 } from "react";
|
236
|
-
|
237
|
-
// src/components/search/search.tsx
|
238
|
-
import {
|
239
|
-
Badge,
|
240
|
-
Button,
|
241
|
-
clx,
|
242
|
-
DropdownMenu,
|
243
|
-
IconButton,
|
244
|
-
Kbd,
|
245
|
-
Text
|
246
|
-
} from "@medusajs/ui";
|
247
|
-
import { Command } from "cmdk";
|
248
|
-
import { Dialog as RadixDialog } from "radix-ui";
|
249
|
-
import {
|
250
|
-
Children,
|
251
|
-
forwardRef,
|
252
|
-
Fragment,
|
253
|
-
useCallback as useCallback3,
|
254
|
-
useEffect as useEffect4,
|
255
|
-
useImperativeHandle,
|
256
|
-
useMemo as useMemo2,
|
257
|
-
useRef,
|
258
|
-
useState as useState4
|
259
|
-
} from "react";
|
260
|
-
import { useTranslation as useTranslation4 } from "react-i18next";
|
261
|
-
import { useLocation, useNavigate as useNavigate2 } from "react-router-dom";
|
262
|
-
import {
|
263
|
-
ArrowUturnLeft,
|
264
|
-
MagnifyingGlass,
|
265
|
-
Plus,
|
266
|
-
Spinner,
|
267
|
-
TriangleDownMini
|
268
|
-
} from "@medusajs/icons";
|
269
|
-
import { matchSorter } from "match-sorter";
|
270
|
-
|
271
|
-
// src/components/search/constants.ts
|
272
|
-
var SEARCH_AREAS = [
|
273
|
-
"all",
|
274
|
-
"order",
|
275
|
-
"product",
|
276
|
-
"productVariant",
|
277
|
-
"collection",
|
278
|
-
"category",
|
279
|
-
"inventory",
|
280
|
-
"customer",
|
281
|
-
"customerGroup",
|
282
|
-
"promotion",
|
283
|
-
"campaign",
|
284
|
-
"priceList",
|
285
|
-
"user",
|
286
|
-
"region",
|
287
|
-
"taxRegion",
|
288
|
-
"returnReason",
|
289
|
-
"salesChannel",
|
290
|
-
"productType",
|
291
|
-
"productTag",
|
292
|
-
"location",
|
293
|
-
"shippingProfile",
|
294
|
-
"publishableApiKey",
|
295
|
-
"secretApiKey",
|
296
|
-
"command",
|
297
|
-
"navigation"
|
298
|
-
];
|
299
|
-
var DEFAULT_SEARCH_LIMIT = 3;
|
300
|
-
var SEARCH_LIMIT_INCREMENT = 20;
|
301
|
-
|
302
|
-
// src/components/search/use-search-results.tsx
|
303
|
-
import { keepPreviousData } from "@tanstack/react-query";
|
304
|
-
import { useCallback as useCallback2, useEffect as useEffect3, useMemo, useState as useState3 } from "react";
|
305
|
-
import { useTranslation as useTranslation3 } from "react-i18next";
|
306
|
-
|
307
|
-
// src/providers/keybind-provider/hooks.tsx
|
308
|
-
import debounceFn from "lodash/debounce";
|
309
|
-
import { useCallback, useContext as useContext2, useEffect as useEffect2, useState as useState2 } from "react";
|
310
|
-
import { useTranslation as useTranslation2 } from "react-i18next";
|
311
|
-
import { useNavigate } from "react-router-dom";
|
312
|
-
|
313
|
-
// src/providers/keybind-provider/keybind-context.tsx
|
314
|
-
import { createContext as createContext2 } from "react";
|
315
|
-
var KeybindContext = createContext2(null);
|
316
|
-
|
317
|
-
// src/providers/keybind-provider/utils.ts
|
318
|
-
var findFirstPlatformMatch = (keys) => {
|
319
|
-
const match = Object.entries(keys).filter(
|
320
|
-
([, value]) => value.length > 0
|
321
|
-
)[0] ?? [];
|
322
|
-
return match.length ? {
|
323
|
-
platform: match[0],
|
324
|
-
keys: match[1]
|
325
|
-
} : null;
|
326
|
-
};
|
327
|
-
var getShortcutKeys = (shortcut) => {
|
328
|
-
const platform = "Mac";
|
329
|
-
const keys = shortcut.keys[platform];
|
330
|
-
if (!keys) {
|
331
|
-
const defaultPlatform = findFirstPlatformMatch(shortcut.keys);
|
332
|
-
console.warn(
|
333
|
-
`No keys found for platform "${platform}" in "${shortcut.label}" ${defaultPlatform ? `using keys for platform "${defaultPlatform.platform}"` : ""}`
|
334
|
-
);
|
335
|
-
return defaultPlatform ? defaultPlatform.keys : [];
|
336
|
-
}
|
337
|
-
return keys;
|
338
|
-
};
|
339
|
-
var keysMatch = (keys1, keys2) => {
|
340
|
-
return keys1.length === keys2.length && keys1.every(
|
341
|
-
(key, index) => key.toLowerCase() === keys2[index].toLowerCase()
|
342
|
-
);
|
343
|
-
};
|
344
|
-
var findShortcutIndex = (shortcuts, keys) => {
|
345
|
-
if (!keys.length) {
|
346
|
-
return -1;
|
347
|
-
}
|
348
|
-
let index = 0;
|
349
|
-
for (const shortcut of shortcuts) {
|
350
|
-
const shortcutKeys = getShortcutKeys(shortcut);
|
351
|
-
if (keysMatch(shortcutKeys, keys)) {
|
352
|
-
return index;
|
353
|
-
}
|
354
|
-
index++;
|
355
|
-
}
|
356
|
-
return -1;
|
357
|
-
};
|
358
|
-
var findShortcut = (shortcuts, keys) => {
|
359
|
-
const shortcutIndex = findShortcutIndex(shortcuts, keys);
|
360
|
-
return shortcutIndex > -1 ? shortcuts[shortcutIndex] : null;
|
361
|
-
};
|
362
|
-
var getShortcutWithDefaultValues = (shortcut, platform = "Mac") => {
|
363
|
-
const platforms = ["Mac", "Windows", "Linux"];
|
364
|
-
const defaultKeys = Object.values(shortcut.keys)[0] ?? shortcut.keys[platform];
|
365
|
-
const keys = platforms.reduce((acc, curr) => {
|
366
|
-
return {
|
367
|
-
...acc,
|
368
|
-
[curr]: shortcut.keys[curr] ?? defaultKeys
|
369
|
-
};
|
370
|
-
}, {});
|
371
|
-
return {
|
372
|
-
...shortcut,
|
373
|
-
keys,
|
374
|
-
_defaultKeys: shortcut.keys
|
375
|
-
};
|
376
|
-
};
|
377
|
-
|
378
|
-
// src/providers/keybind-provider/hooks.tsx
|
379
|
-
var useShortcuts = ({
|
380
|
-
shortcuts = [],
|
381
|
-
debounce
|
382
|
-
}) => {
|
383
|
-
const [keys, setKeys] = useState2([]);
|
384
|
-
const navigate = useNavigate();
|
385
|
-
const removeKeys = useCallback(
|
386
|
-
debounceFn(() => setKeys([]), debounce),
|
387
|
-
[]
|
388
|
-
);
|
389
|
-
const invokeShortcut = useCallback(
|
390
|
-
debounceFn((shortcut) => {
|
391
|
-
if (shortcut && shortcut.callback) {
|
392
|
-
shortcut.callback();
|
393
|
-
setKeys([]);
|
394
|
-
return;
|
395
|
-
}
|
396
|
-
if (shortcut && shortcut.to) {
|
397
|
-
navigate(shortcut.to);
|
398
|
-
setKeys([]);
|
399
|
-
return;
|
400
|
-
}
|
401
|
-
}, debounce / 2),
|
402
|
-
[]
|
403
|
-
);
|
404
|
-
useEffect2(() => {
|
405
|
-
if (keys.length > 0 && shortcuts.length > 0) {
|
406
|
-
const shortcut = findShortcut(shortcuts, keys);
|
407
|
-
invokeShortcut(shortcut);
|
408
|
-
}
|
409
|
-
return () => invokeShortcut.cancel();
|
410
|
-
}, [keys, shortcuts, invokeShortcut]);
|
411
|
-
useEffect2(() => {
|
412
|
-
const listener = (event) => {
|
413
|
-
const target = event.target;
|
414
|
-
if (target.tagName === "INPUT" || target.tagName === "TEXTAREA" || target.contentEditable === "true") {
|
415
|
-
removeKeys();
|
416
|
-
return;
|
417
|
-
}
|
418
|
-
setKeys((oldKeys) => [...oldKeys, event.key]);
|
419
|
-
removeKeys();
|
420
|
-
};
|
421
|
-
window.addEventListener("keydown", listener);
|
422
|
-
return () => {
|
423
|
-
window.removeEventListener("keydown", listener);
|
424
|
-
};
|
425
|
-
}, [removeKeys]);
|
426
|
-
};
|
427
|
-
var useGlobalShortcuts = () => {
|
428
|
-
const { t: t2 } = useTranslation2();
|
429
|
-
const navigate = useNavigate();
|
430
|
-
const { mutateAsync } = useLogout();
|
431
|
-
const handleLogout = async () => {
|
432
|
-
await mutateAsync(void 0, {
|
433
|
-
onSuccess: () => {
|
434
|
-
queryClient.clear();
|
435
|
-
navigate("/login");
|
436
|
-
}
|
437
|
-
});
|
438
|
-
};
|
439
|
-
const globalShortcuts = [
|
440
|
-
// Pages
|
441
|
-
{
|
442
|
-
keys: {
|
443
|
-
Mac: ["G", "O"]
|
444
|
-
},
|
445
|
-
label: t2("app.keyboardShortcuts.navigation.goToOrders"),
|
446
|
-
type: "pageShortcut",
|
447
|
-
to: "/orders"
|
448
|
-
},
|
449
|
-
{
|
450
|
-
keys: {
|
451
|
-
Mac: ["G", "P"]
|
452
|
-
},
|
453
|
-
label: t2("app.keyboardShortcuts.navigation.goToProducts"),
|
454
|
-
type: "pageShortcut",
|
455
|
-
to: "/products"
|
456
|
-
},
|
457
|
-
{
|
458
|
-
keys: {
|
459
|
-
Mac: ["G", "C"]
|
460
|
-
},
|
461
|
-
label: t2("app.keyboardShortcuts.navigation.goToCollections"),
|
462
|
-
type: "pageShortcut",
|
463
|
-
to: "/collections"
|
464
|
-
},
|
465
|
-
{
|
466
|
-
keys: {
|
467
|
-
Mac: ["G", "A"]
|
468
|
-
},
|
469
|
-
label: t2("app.keyboardShortcuts.navigation.goToCategories"),
|
470
|
-
type: "pageShortcut",
|
471
|
-
to: "/categories"
|
472
|
-
},
|
473
|
-
{
|
474
|
-
keys: {
|
475
|
-
Mac: ["G", "U"]
|
476
|
-
},
|
477
|
-
label: t2("app.keyboardShortcuts.navigation.goToCustomers"),
|
478
|
-
type: "pageShortcut",
|
479
|
-
to: "/customers"
|
480
|
-
},
|
481
|
-
{
|
482
|
-
keys: {
|
483
|
-
Mac: ["G", "G"]
|
484
|
-
},
|
485
|
-
label: t2("app.keyboardShortcuts.navigation.goToCustomerGroups"),
|
486
|
-
type: "pageShortcut",
|
487
|
-
to: "/customer-groups"
|
488
|
-
},
|
489
|
-
{
|
490
|
-
keys: {
|
491
|
-
Mac: ["G", "I"]
|
492
|
-
},
|
493
|
-
label: t2("app.keyboardShortcuts.navigation.goToInventory"),
|
494
|
-
type: "pageShortcut",
|
495
|
-
to: "/inventory"
|
496
|
-
},
|
497
|
-
{
|
498
|
-
keys: {
|
499
|
-
Mac: ["G", "R"]
|
500
|
-
},
|
501
|
-
label: t2("app.keyboardShortcuts.navigation.goToReservations"),
|
502
|
-
type: "pageShortcut",
|
503
|
-
to: "/reservations"
|
504
|
-
},
|
505
|
-
{
|
506
|
-
keys: {
|
507
|
-
Mac: ["G", "L"]
|
508
|
-
},
|
509
|
-
label: t2("app.keyboardShortcuts.navigation.goToPriceLists"),
|
510
|
-
type: "pageShortcut",
|
511
|
-
to: "/price-lists"
|
512
|
-
},
|
513
|
-
{
|
514
|
-
keys: {
|
515
|
-
Mac: ["G", "M"]
|
516
|
-
},
|
517
|
-
label: t2("app.keyboardShortcuts.navigation.goToPromotions"),
|
518
|
-
type: "pageShortcut",
|
519
|
-
to: "/promotions"
|
520
|
-
},
|
521
|
-
{
|
522
|
-
keys: {
|
523
|
-
Mac: ["G", "K"]
|
524
|
-
},
|
525
|
-
label: t2("app.keyboardShortcuts.navigation.goToCampaigns"),
|
526
|
-
type: "pageShortcut",
|
527
|
-
to: "/campaigns"
|
528
|
-
},
|
529
|
-
// Settings
|
530
|
-
{
|
531
|
-
keys: {
|
532
|
-
Mac: ["G", ","]
|
533
|
-
},
|
534
|
-
label: t2("app.keyboardShortcuts.settings.goToSettings"),
|
535
|
-
type: "settingShortcut",
|
536
|
-
to: "/settings"
|
537
|
-
},
|
538
|
-
{
|
539
|
-
keys: {
|
540
|
-
Mac: ["G", ",", "S"]
|
541
|
-
},
|
542
|
-
label: t2("app.keyboardShortcuts.settings.goToStore"),
|
543
|
-
type: "settingShortcut",
|
544
|
-
to: "/settings/store"
|
545
|
-
},
|
546
|
-
{
|
547
|
-
keys: {
|
548
|
-
Mac: ["G", ",", "U"]
|
549
|
-
},
|
550
|
-
label: t2("app.keyboardShortcuts.settings.goToUsers"),
|
551
|
-
type: "settingShortcut",
|
552
|
-
to: "/settings/users"
|
553
|
-
},
|
554
|
-
{
|
555
|
-
keys: {
|
556
|
-
Mac: ["G", ",", "R"]
|
557
|
-
},
|
558
|
-
label: t2("app.keyboardShortcuts.settings.goToRegions"),
|
559
|
-
type: "settingShortcut",
|
560
|
-
to: "/settings/regions"
|
561
|
-
},
|
562
|
-
{
|
563
|
-
keys: {
|
564
|
-
Mac: ["G", ",", "T"]
|
565
|
-
},
|
566
|
-
label: t2("app.keyboardShortcuts.settings.goToTaxRegions"),
|
567
|
-
type: "settingShortcut",
|
568
|
-
to: "/settings/tax-regions"
|
569
|
-
},
|
570
|
-
{
|
571
|
-
keys: {
|
572
|
-
Mac: ["G", ",", "A"]
|
573
|
-
},
|
574
|
-
label: t2("app.keyboardShortcuts.settings.goToSalesChannels"),
|
575
|
-
type: "settingShortcut",
|
576
|
-
to: "/settings/sales-channels"
|
577
|
-
},
|
578
|
-
{
|
579
|
-
keys: {
|
580
|
-
Mac: ["G", ",", "P"]
|
581
|
-
},
|
582
|
-
label: t2("app.keyboardShortcuts.settings.goToProductTypes"),
|
583
|
-
type: "settingShortcut",
|
584
|
-
to: "/settings/product-types"
|
585
|
-
},
|
586
|
-
{
|
587
|
-
keys: {
|
588
|
-
Mac: ["G", ",", "L"]
|
589
|
-
},
|
590
|
-
label: t2("app.keyboardShortcuts.settings.goToLocations"),
|
591
|
-
type: "settingShortcut",
|
592
|
-
to: "/settings/locations"
|
593
|
-
},
|
594
|
-
{
|
595
|
-
keys: {
|
596
|
-
Mac: ["G", ",", "M"]
|
597
|
-
},
|
598
|
-
label: t2("app.keyboardShortcuts.settings.goToReturnReasons"),
|
599
|
-
type: "settingShortcut",
|
600
|
-
to: "/settings/return-reasons"
|
601
|
-
},
|
602
|
-
{
|
603
|
-
keys: {
|
604
|
-
Mac: ["G", ",", "J"]
|
605
|
-
},
|
606
|
-
label: t2("app.keyboardShortcuts.settings.goToPublishableApiKeys"),
|
607
|
-
type: "settingShortcut",
|
608
|
-
to: "/settings/publishable-api-keys"
|
609
|
-
},
|
610
|
-
{
|
611
|
-
keys: {
|
612
|
-
Mac: ["G", ",", "K"]
|
613
|
-
},
|
614
|
-
label: t2("app.keyboardShortcuts.settings.goToSecretApiKeys"),
|
615
|
-
type: "settingShortcut",
|
616
|
-
to: "/settings/secret-api-keys"
|
617
|
-
},
|
618
|
-
{
|
619
|
-
keys: {
|
620
|
-
Mac: ["G", ",", "W"]
|
621
|
-
},
|
622
|
-
label: t2("app.keyboardShortcuts.settings.goToWorkflows"),
|
623
|
-
type: "settingShortcut",
|
624
|
-
to: "/settings/workflows"
|
625
|
-
},
|
626
|
-
{
|
627
|
-
keys: {
|
628
|
-
Mac: ["G", ",", "M"]
|
629
|
-
},
|
630
|
-
label: t2("app.keyboardShortcuts.settings.goToProfile"),
|
631
|
-
type: "settingShortcut",
|
632
|
-
to: "/settings/profile"
|
633
|
-
},
|
634
|
-
// Commands
|
635
|
-
{
|
636
|
-
keys: {
|
637
|
-
Mac: ["B", "Y", "E"]
|
638
|
-
},
|
639
|
-
label: t2("actions.logout"),
|
640
|
-
type: "commandShortcut",
|
641
|
-
callback: () => handleLogout()
|
642
|
-
}
|
643
|
-
];
|
644
|
-
return globalShortcuts;
|
645
|
-
};
|
646
|
-
|
647
|
-
// src/components/search/use-search-results.tsx
|
648
|
-
var useSearchResults = ({
|
649
|
-
q,
|
650
|
-
limit,
|
651
|
-
area = "all"
|
652
|
-
}) => {
|
653
|
-
const staticResults = useStaticSearchResults(area);
|
654
|
-
const { dynamicResults, isFetching } = useDynamicSearchResults(area, limit, q);
|
655
|
-
return {
|
656
|
-
staticResults,
|
657
|
-
dynamicResults,
|
658
|
-
isFetching
|
659
|
-
};
|
660
|
-
};
|
661
|
-
var useStaticSearchResults = (currentArea) => {
|
662
|
-
const globalCommands = useGlobalShortcuts();
|
663
|
-
const results = useMemo(() => {
|
664
|
-
const groups = /* @__PURE__ */ new Map();
|
665
|
-
globalCommands.forEach((command) => {
|
666
|
-
const group = groups.get(command.type) || [];
|
667
|
-
group.push(command);
|
668
|
-
groups.set(command.type, group);
|
669
|
-
});
|
670
|
-
let filteredGroups;
|
671
|
-
switch (currentArea) {
|
672
|
-
case "all":
|
673
|
-
filteredGroups = Array.from(groups);
|
674
|
-
break;
|
675
|
-
case "navigation":
|
676
|
-
filteredGroups = Array.from(groups).filter(
|
677
|
-
([type]) => type === "pageShortcut" || type === "settingShortcut"
|
678
|
-
);
|
679
|
-
break;
|
680
|
-
case "command":
|
681
|
-
filteredGroups = Array.from(groups).filter(
|
682
|
-
([type]) => type === "commandShortcut"
|
683
|
-
);
|
684
|
-
break;
|
685
|
-
default:
|
686
|
-
filteredGroups = [];
|
687
|
-
}
|
688
|
-
return filteredGroups.map(([title, items]) => ({
|
689
|
-
title,
|
690
|
-
items
|
691
|
-
}));
|
692
|
-
}, [globalCommands, currentArea]);
|
693
|
-
return results;
|
694
|
-
};
|
695
|
-
var useDynamicSearchResults = (currentArea, limit, q) => {
|
696
|
-
const { t: t2 } = useTranslation3();
|
697
|
-
const debouncedSearch = useDebouncedSearch(q, 300);
|
698
|
-
const orderResponse = useOrders(
|
699
|
-
{
|
700
|
-
q: debouncedSearch?.replace(/^#/, ""),
|
701
|
-
// Since we display the ID with a # prefix, it's natural for the user to include it in the search. This will however cause no results to be returned, so we remove the # prefix from the search query.
|
702
|
-
limit,
|
703
|
-
fields: "id,display_id,email"
|
704
|
-
},
|
705
|
-
{
|
706
|
-
enabled: isAreaEnabled(currentArea, "order"),
|
707
|
-
placeholderData: keepPreviousData
|
708
|
-
}
|
709
|
-
);
|
710
|
-
const productResponse = useProducts(
|
711
|
-
{
|
712
|
-
q: debouncedSearch,
|
713
|
-
limit,
|
714
|
-
fields: "id,title,thumbnail"
|
715
|
-
},
|
716
|
-
{
|
717
|
-
enabled: isAreaEnabled(currentArea, "product"),
|
718
|
-
placeholderData: keepPreviousData
|
719
|
-
}
|
720
|
-
);
|
721
|
-
const productVariantResponse = useVariants(
|
722
|
-
{
|
723
|
-
q: debouncedSearch,
|
724
|
-
limit,
|
725
|
-
fields: "id,title,sku"
|
726
|
-
},
|
727
|
-
{
|
728
|
-
enabled: isAreaEnabled(currentArea, "productVariant"),
|
729
|
-
placeholderData: keepPreviousData
|
730
|
-
}
|
731
|
-
);
|
732
|
-
const categoryResponse = useProductCategories(
|
733
|
-
{
|
734
|
-
// TODO: Remove the OR condition once the list endpoint does not throw when q equals an empty string
|
735
|
-
q: debouncedSearch || void 0,
|
736
|
-
limit,
|
737
|
-
fields: "id,name"
|
738
|
-
},
|
739
|
-
{
|
740
|
-
enabled: isAreaEnabled(currentArea, "category"),
|
741
|
-
placeholderData: keepPreviousData
|
742
|
-
}
|
743
|
-
);
|
744
|
-
const collectionResponse = useCollections(
|
745
|
-
{
|
746
|
-
q: debouncedSearch,
|
747
|
-
limit,
|
748
|
-
fields: "id,title"
|
749
|
-
},
|
750
|
-
{
|
751
|
-
enabled: isAreaEnabled(currentArea, "collection"),
|
752
|
-
placeholderData: keepPreviousData
|
753
|
-
}
|
754
|
-
);
|
755
|
-
const customerResponse = useCustomers(
|
756
|
-
{
|
757
|
-
q: debouncedSearch,
|
758
|
-
limit,
|
759
|
-
fields: "id,email,first_name,last_name"
|
760
|
-
},
|
761
|
-
{
|
762
|
-
enabled: isAreaEnabled(currentArea, "customer"),
|
763
|
-
placeholderData: keepPreviousData
|
764
|
-
}
|
765
|
-
);
|
766
|
-
const customerGroupResponse = useCustomerGroups(
|
767
|
-
{
|
768
|
-
q: debouncedSearch,
|
769
|
-
limit,
|
770
|
-
fields: "id,name"
|
771
|
-
},
|
772
|
-
{
|
773
|
-
enabled: isAreaEnabled(currentArea, "customerGroup"),
|
774
|
-
placeholderData: keepPreviousData
|
775
|
-
}
|
776
|
-
);
|
777
|
-
const inventoryResponse = useInventoryItems(
|
778
|
-
{
|
779
|
-
q: debouncedSearch,
|
780
|
-
limit,
|
781
|
-
fields: "id,title,sku"
|
782
|
-
},
|
783
|
-
{
|
784
|
-
enabled: isAreaEnabled(currentArea, "inventory"),
|
785
|
-
placeholderData: keepPreviousData
|
786
|
-
}
|
787
|
-
);
|
788
|
-
const promotionResponse = usePromotions(
|
789
|
-
{
|
790
|
-
q: debouncedSearch,
|
791
|
-
limit,
|
792
|
-
fields: "id,code,status"
|
793
|
-
},
|
794
|
-
{
|
795
|
-
enabled: isAreaEnabled(currentArea, "promotion"),
|
796
|
-
placeholderData: keepPreviousData
|
797
|
-
}
|
798
|
-
);
|
799
|
-
const campaignResponse = useCampaigns(
|
800
|
-
{
|
801
|
-
q: debouncedSearch,
|
802
|
-
limit,
|
803
|
-
fields: "id,name"
|
804
|
-
},
|
805
|
-
{
|
806
|
-
enabled: isAreaEnabled(currentArea, "campaign"),
|
807
|
-
placeholderData: keepPreviousData
|
808
|
-
}
|
809
|
-
);
|
810
|
-
const priceListResponse = usePriceLists(
|
811
|
-
{
|
812
|
-
q: debouncedSearch,
|
813
|
-
limit,
|
814
|
-
fields: "id,title"
|
815
|
-
},
|
816
|
-
{
|
817
|
-
enabled: isAreaEnabled(currentArea, "priceList"),
|
818
|
-
placeholderData: keepPreviousData
|
819
|
-
}
|
820
|
-
);
|
821
|
-
const userResponse = useUsers(
|
822
|
-
{
|
823
|
-
q: debouncedSearch,
|
824
|
-
limit,
|
825
|
-
fields: "id,email,first_name,last_name"
|
826
|
-
},
|
827
|
-
{
|
828
|
-
enabled: isAreaEnabled(currentArea, "user"),
|
829
|
-
placeholderData: keepPreviousData
|
830
|
-
}
|
831
|
-
);
|
832
|
-
const regionResponse = useRegions(
|
833
|
-
{
|
834
|
-
q: debouncedSearch,
|
835
|
-
limit,
|
836
|
-
fields: "id,name"
|
837
|
-
},
|
838
|
-
{
|
839
|
-
enabled: isAreaEnabled(currentArea, "region"),
|
840
|
-
placeholderData: keepPreviousData
|
841
|
-
}
|
842
|
-
);
|
843
|
-
const taxRegionResponse = useTaxRegions(
|
844
|
-
{
|
845
|
-
q: debouncedSearch,
|
846
|
-
limit,
|
847
|
-
fields: "id,country_code,province_code"
|
848
|
-
},
|
849
|
-
{
|
850
|
-
enabled: isAreaEnabled(currentArea, "taxRegion"),
|
851
|
-
placeholderData: keepPreviousData
|
852
|
-
}
|
853
|
-
);
|
854
|
-
const returnReasonResponse = useReturnReasons(
|
855
|
-
{
|
856
|
-
q: debouncedSearch,
|
857
|
-
limit,
|
858
|
-
fields: "id,label,value"
|
859
|
-
},
|
860
|
-
{
|
861
|
-
enabled: isAreaEnabled(currentArea, "returnReason"),
|
862
|
-
placeholderData: keepPreviousData
|
863
|
-
}
|
864
|
-
);
|
865
|
-
const salesChannelResponse = useSalesChannels(
|
866
|
-
{
|
867
|
-
q: debouncedSearch,
|
868
|
-
limit,
|
869
|
-
fields: "id,name"
|
870
|
-
},
|
871
|
-
{
|
872
|
-
enabled: isAreaEnabled(currentArea, "salesChannel"),
|
873
|
-
placeholderData: keepPreviousData
|
874
|
-
}
|
875
|
-
);
|
876
|
-
const productTypeResponse = useProductTypes(
|
877
|
-
{
|
878
|
-
q: debouncedSearch,
|
879
|
-
limit,
|
880
|
-
fields: "id,value"
|
881
|
-
},
|
882
|
-
{
|
883
|
-
enabled: isAreaEnabled(currentArea, "productType"),
|
884
|
-
placeholderData: keepPreviousData
|
885
|
-
}
|
886
|
-
);
|
887
|
-
const productTagResponse = useProductTags(
|
888
|
-
{
|
889
|
-
q: debouncedSearch,
|
890
|
-
limit,
|
891
|
-
fields: "id,value"
|
892
|
-
},
|
893
|
-
{
|
894
|
-
enabled: isAreaEnabled(currentArea, "productTag"),
|
895
|
-
placeholderData: keepPreviousData
|
896
|
-
}
|
897
|
-
);
|
898
|
-
const locationResponse = useStockLocations(
|
899
|
-
{
|
900
|
-
q: debouncedSearch,
|
901
|
-
limit,
|
902
|
-
fields: "id,name"
|
903
|
-
},
|
904
|
-
{
|
905
|
-
enabled: isAreaEnabled(currentArea, "location"),
|
906
|
-
placeholderData: keepPreviousData
|
907
|
-
}
|
908
|
-
);
|
909
|
-
const shippingProfileResponse = useShippingProfiles(
|
910
|
-
{
|
911
|
-
q: debouncedSearch,
|
912
|
-
limit,
|
913
|
-
fields: "id,name"
|
914
|
-
},
|
915
|
-
{
|
916
|
-
enabled: isAreaEnabled(currentArea, "shippingProfile"),
|
917
|
-
placeholderData: keepPreviousData
|
918
|
-
}
|
919
|
-
);
|
920
|
-
const publishableApiKeyResponse = useApiKeys(
|
921
|
-
{
|
922
|
-
q: debouncedSearch,
|
923
|
-
limit,
|
924
|
-
fields: "id,title,redacted",
|
925
|
-
type: "publishable"
|
926
|
-
},
|
927
|
-
{
|
928
|
-
enabled: isAreaEnabled(currentArea, "publishableApiKey"),
|
929
|
-
placeholderData: keepPreviousData
|
930
|
-
}
|
931
|
-
);
|
932
|
-
const secretApiKeyResponse = useApiKeys(
|
933
|
-
{
|
934
|
-
q: debouncedSearch,
|
935
|
-
limit,
|
936
|
-
fields: "id,title,redacted",
|
937
|
-
type: "secret"
|
938
|
-
},
|
939
|
-
{
|
940
|
-
enabled: isAreaEnabled(currentArea, "secretApiKey"),
|
941
|
-
placeholderData: keepPreviousData
|
942
|
-
}
|
943
|
-
);
|
944
|
-
const responseMap = useMemo(
|
945
|
-
() => ({
|
946
|
-
order: orderResponse,
|
947
|
-
product: productResponse,
|
948
|
-
productVariant: productVariantResponse,
|
949
|
-
collection: collectionResponse,
|
950
|
-
category: categoryResponse,
|
951
|
-
inventory: inventoryResponse,
|
952
|
-
customer: customerResponse,
|
953
|
-
customerGroup: customerGroupResponse,
|
954
|
-
promotion: promotionResponse,
|
955
|
-
campaign: campaignResponse,
|
956
|
-
priceList: priceListResponse,
|
957
|
-
user: userResponse,
|
958
|
-
region: regionResponse,
|
959
|
-
taxRegion: taxRegionResponse,
|
960
|
-
returnReason: returnReasonResponse,
|
961
|
-
salesChannel: salesChannelResponse,
|
962
|
-
productType: productTypeResponse,
|
963
|
-
productTag: productTagResponse,
|
964
|
-
location: locationResponse,
|
965
|
-
shippingProfile: shippingProfileResponse,
|
966
|
-
publishableApiKey: publishableApiKeyResponse,
|
967
|
-
secretApiKey: secretApiKeyResponse
|
968
|
-
}),
|
969
|
-
[
|
970
|
-
orderResponse,
|
971
|
-
productResponse,
|
972
|
-
productVariantResponse,
|
973
|
-
inventoryResponse,
|
974
|
-
categoryResponse,
|
975
|
-
collectionResponse,
|
976
|
-
customerResponse,
|
977
|
-
customerGroupResponse,
|
978
|
-
promotionResponse,
|
979
|
-
campaignResponse,
|
980
|
-
priceListResponse,
|
981
|
-
userResponse,
|
982
|
-
regionResponse,
|
983
|
-
taxRegionResponse,
|
984
|
-
returnReasonResponse,
|
985
|
-
salesChannelResponse,
|
986
|
-
productTypeResponse,
|
987
|
-
productTagResponse,
|
988
|
-
locationResponse,
|
989
|
-
shippingProfileResponse,
|
990
|
-
publishableApiKeyResponse,
|
991
|
-
secretApiKeyResponse
|
992
|
-
]
|
993
|
-
);
|
994
|
-
const results = useMemo(() => {
|
995
|
-
const groups = Object.entries(responseMap).map(([key, response]) => {
|
996
|
-
const area = key;
|
997
|
-
if (isAreaEnabled(currentArea, area) || currentArea === "all") {
|
998
|
-
return transformDynamicSearchResults(area, limit, t2, response);
|
999
|
-
}
|
1000
|
-
return null;
|
1001
|
-
}).filter(Boolean);
|
1002
|
-
return groups;
|
1003
|
-
}, [responseMap, currentArea, limit, t2]);
|
1004
|
-
const isAreaFetching = useCallback2(
|
1005
|
-
(area) => {
|
1006
|
-
if (area === "all") {
|
1007
|
-
return Object.values(responseMap).some(
|
1008
|
-
(response) => response.isFetching
|
1009
|
-
);
|
1010
|
-
}
|
1011
|
-
return isAreaEnabled(currentArea, area) && responseMap[area]?.isFetching;
|
1012
|
-
},
|
1013
|
-
[currentArea, responseMap]
|
1014
|
-
);
|
1015
|
-
const isFetching = useMemo(() => {
|
1016
|
-
return isAreaFetching(currentArea);
|
1017
|
-
}, [currentArea, isAreaFetching]);
|
1018
|
-
const dynamicResults = q ? results.filter(
|
1019
|
-
(group) => !!group && group.items.length > 0
|
1020
|
-
) : [];
|
1021
|
-
return {
|
1022
|
-
dynamicResults,
|
1023
|
-
isFetching
|
1024
|
-
};
|
1025
|
-
};
|
1026
|
-
var useDebouncedSearch = (value, delay) => {
|
1027
|
-
const [debouncedValue, setDebouncedValue] = useState3(value);
|
1028
|
-
useEffect3(() => {
|
1029
|
-
const handler = setTimeout(() => {
|
1030
|
-
setDebouncedValue(value);
|
1031
|
-
}, delay);
|
1032
|
-
return () => {
|
1033
|
-
clearTimeout(handler);
|
1034
|
-
};
|
1035
|
-
}, [value, delay]);
|
1036
|
-
return debouncedValue;
|
1037
|
-
};
|
1038
|
-
function isAreaEnabled(area, currentArea) {
|
1039
|
-
if (area === "all") {
|
1040
|
-
return true;
|
1041
|
-
}
|
1042
|
-
if (area === currentArea) {
|
1043
|
-
return true;
|
1044
|
-
}
|
1045
|
-
return false;
|
1046
|
-
}
|
1047
|
-
var transformMap = {
|
1048
|
-
order: {
|
1049
|
-
dataKey: "orders",
|
1050
|
-
transform: (order) => ({
|
1051
|
-
id: order.id,
|
1052
|
-
title: `#${order.display_id}`,
|
1053
|
-
subtitle: order.email ?? void 0,
|
1054
|
-
to: `/orders/${order.id}`,
|
1055
|
-
value: `order:${order.id}`
|
1056
|
-
})
|
1057
|
-
},
|
1058
|
-
product: {
|
1059
|
-
dataKey: "products",
|
1060
|
-
transform: (product) => ({
|
1061
|
-
id: product.id,
|
1062
|
-
title: product.title,
|
1063
|
-
to: `/products/${product.id}`,
|
1064
|
-
thumbnail: product.thumbnail ?? void 0,
|
1065
|
-
value: `product:${product.id}`
|
1066
|
-
})
|
1067
|
-
},
|
1068
|
-
productVariant: {
|
1069
|
-
dataKey: "variants",
|
1070
|
-
transform: (variant) => ({
|
1071
|
-
id: variant.id,
|
1072
|
-
title: variant.title,
|
1073
|
-
subtitle: variant.sku ?? void 0,
|
1074
|
-
to: `/products/${variant.product_id}/variants/${variant.id}`,
|
1075
|
-
value: `variant:${variant.id}`
|
1076
|
-
})
|
1077
|
-
},
|
1078
|
-
category: {
|
1079
|
-
dataKey: "product_categories",
|
1080
|
-
transform: (category) => ({
|
1081
|
-
id: category.id,
|
1082
|
-
title: category.name,
|
1083
|
-
to: `/categories/${category.id}`,
|
1084
|
-
value: `category:${category.id}`
|
1085
|
-
})
|
1086
|
-
},
|
1087
|
-
inventory: {
|
1088
|
-
dataKey: "inventory_items",
|
1089
|
-
transform: (inventory) => ({
|
1090
|
-
id: inventory.id,
|
1091
|
-
title: inventory.title ?? "",
|
1092
|
-
subtitle: inventory.sku ?? void 0,
|
1093
|
-
to: `/inventory/${inventory.id}`,
|
1094
|
-
value: `inventory:${inventory.id}`
|
1095
|
-
})
|
1096
|
-
},
|
1097
|
-
customer: {
|
1098
|
-
dataKey: "customers",
|
1099
|
-
transform: (customer) => {
|
1100
|
-
const name = [customer.first_name, customer.last_name].filter(Boolean).join(" ");
|
1101
|
-
return {
|
1102
|
-
id: customer.id,
|
1103
|
-
title: name || customer.email,
|
1104
|
-
subtitle: name ? customer.email : void 0,
|
1105
|
-
to: `/customers/${customer.id}`,
|
1106
|
-
value: `customer:${customer.id}`
|
1107
|
-
};
|
1108
|
-
}
|
1109
|
-
},
|
1110
|
-
customerGroup: {
|
1111
|
-
dataKey: "customer_groups",
|
1112
|
-
transform: (customerGroup) => ({
|
1113
|
-
id: customerGroup.id,
|
1114
|
-
title: customerGroup.name,
|
1115
|
-
to: `/customer-groups/${customerGroup.id}`,
|
1116
|
-
value: `customerGroup:${customerGroup.id}`
|
1117
|
-
})
|
1118
|
-
},
|
1119
|
-
collection: {
|
1120
|
-
dataKey: "collections",
|
1121
|
-
transform: (collection) => ({
|
1122
|
-
id: collection.id,
|
1123
|
-
title: collection.title,
|
1124
|
-
to: `/collections/${collection.id}`,
|
1125
|
-
value: `collection:${collection.id}`
|
1126
|
-
})
|
1127
|
-
},
|
1128
|
-
promotion: {
|
1129
|
-
dataKey: "promotions",
|
1130
|
-
transform: (promotion) => ({
|
1131
|
-
id: promotion.id,
|
1132
|
-
title: promotion.code,
|
1133
|
-
to: `/promotions/${promotion.id}`,
|
1134
|
-
value: `promotion:${promotion.id}`
|
1135
|
-
})
|
1136
|
-
},
|
1137
|
-
campaign: {
|
1138
|
-
dataKey: "campaigns",
|
1139
|
-
transform: (campaign) => ({
|
1140
|
-
id: campaign.id,
|
1141
|
-
title: campaign.name,
|
1142
|
-
to: `/campaigns/${campaign.id}`,
|
1143
|
-
value: `campaign:${campaign.id}`
|
1144
|
-
})
|
1145
|
-
},
|
1146
|
-
priceList: {
|
1147
|
-
dataKey: "price_lists",
|
1148
|
-
transform: (priceList) => ({
|
1149
|
-
id: priceList.id,
|
1150
|
-
title: priceList.title,
|
1151
|
-
to: `/price-lists/${priceList.id}`,
|
1152
|
-
value: `priceList:${priceList.id}`
|
1153
|
-
})
|
1154
|
-
},
|
1155
|
-
user: {
|
1156
|
-
dataKey: "users",
|
1157
|
-
transform: (user) => ({
|
1158
|
-
id: user.id,
|
1159
|
-
title: `${user.first_name} ${user.last_name}`,
|
1160
|
-
subtitle: user.email,
|
1161
|
-
to: `/users/${user.id}`,
|
1162
|
-
value: `user:${user.id}`
|
1163
|
-
})
|
1164
|
-
},
|
1165
|
-
region: {
|
1166
|
-
dataKey: "regions",
|
1167
|
-
transform: (region) => ({
|
1168
|
-
id: region.id,
|
1169
|
-
title: region.name,
|
1170
|
-
to: `/regions/${region.id}`,
|
1171
|
-
value: `region:${region.id}`
|
1172
|
-
})
|
1173
|
-
},
|
1174
|
-
taxRegion: {
|
1175
|
-
dataKey: "tax_regions",
|
1176
|
-
transform: (taxRegion) => ({
|
1177
|
-
id: taxRegion.id,
|
1178
|
-
title: taxRegion.province_code?.toUpperCase() ?? taxRegion.country_code.toUpperCase(),
|
1179
|
-
subtitle: taxRegion.province_code ? taxRegion.country_code : void 0,
|
1180
|
-
to: `/tax-regions/${taxRegion.id}`,
|
1181
|
-
value: `taxRegion:${taxRegion.id}`
|
1182
|
-
})
|
1183
|
-
},
|
1184
|
-
returnReason: {
|
1185
|
-
dataKey: "return_reasons",
|
1186
|
-
transform: (returnReason) => ({
|
1187
|
-
id: returnReason.id,
|
1188
|
-
title: returnReason.label,
|
1189
|
-
subtitle: returnReason.value,
|
1190
|
-
to: `/return-reasons/${returnReason.id}/edit`,
|
1191
|
-
value: `returnReason:${returnReason.id}`
|
1192
|
-
})
|
1193
|
-
},
|
1194
|
-
salesChannel: {
|
1195
|
-
dataKey: "sales_channels",
|
1196
|
-
transform: (salesChannel) => ({
|
1197
|
-
id: salesChannel.id,
|
1198
|
-
title: salesChannel.name,
|
1199
|
-
to: `/sales-channels/${salesChannel.id}`,
|
1200
|
-
value: `salesChannel:${salesChannel.id}`
|
1201
|
-
})
|
1202
|
-
},
|
1203
|
-
productType: {
|
1204
|
-
dataKey: "product_types",
|
1205
|
-
transform: (productType) => ({
|
1206
|
-
id: productType.id,
|
1207
|
-
title: productType.value,
|
1208
|
-
to: `/product-types/${productType.id}`,
|
1209
|
-
value: `productType:${productType.id}`
|
1210
|
-
})
|
1211
|
-
},
|
1212
|
-
productTag: {
|
1213
|
-
dataKey: "product_tags",
|
1214
|
-
transform: (productTag) => ({
|
1215
|
-
id: productTag.id,
|
1216
|
-
title: productTag.value,
|
1217
|
-
to: `/product-tags/${productTag.id}`,
|
1218
|
-
value: `productTag:${productTag.id}`
|
1219
|
-
})
|
1220
|
-
},
|
1221
|
-
location: {
|
1222
|
-
dataKey: "stock_locations",
|
1223
|
-
transform: (location) => ({
|
1224
|
-
id: location.id,
|
1225
|
-
title: location.name,
|
1226
|
-
to: `/locations/${location.id}`,
|
1227
|
-
value: `location:${location.id}`
|
1228
|
-
})
|
1229
|
-
},
|
1230
|
-
shippingProfile: {
|
1231
|
-
dataKey: "shipping_profiles",
|
1232
|
-
transform: (shippingProfile) => ({
|
1233
|
-
id: shippingProfile.id,
|
1234
|
-
title: shippingProfile.name,
|
1235
|
-
to: `/shipping-profiles/${shippingProfile.id}`,
|
1236
|
-
value: `shippingProfile:${shippingProfile.id}`
|
1237
|
-
})
|
1238
|
-
},
|
1239
|
-
publishableApiKey: {
|
1240
|
-
dataKey: "api_keys",
|
1241
|
-
transform: (apiKey) => ({
|
1242
|
-
id: apiKey.id,
|
1243
|
-
title: apiKey.title,
|
1244
|
-
subtitle: apiKey.redacted,
|
1245
|
-
to: `/publishable-api-keys/${apiKey.id}`,
|
1246
|
-
value: `publishableApiKey:${apiKey.id}`
|
1247
|
-
})
|
1248
|
-
},
|
1249
|
-
secretApiKey: {
|
1250
|
-
dataKey: "api_keys",
|
1251
|
-
transform: (apiKey) => ({
|
1252
|
-
id: apiKey.id,
|
1253
|
-
title: apiKey.title,
|
1254
|
-
subtitle: apiKey.redacted,
|
1255
|
-
to: `/secret-api-keys/${apiKey.id}`,
|
1256
|
-
value: `secretApiKey:${apiKey.id}`
|
1257
|
-
})
|
1258
|
-
}
|
1259
|
-
};
|
1260
|
-
function transformDynamicSearchResults(type, limit, t2, response) {
|
1261
|
-
if (!response || !transformMap[type]) {
|
1262
|
-
return void 0;
|
1263
|
-
}
|
1264
|
-
const { dataKey, transform } = transformMap[type];
|
1265
|
-
const data = response[dataKey];
|
1266
|
-
if (!data || !Array.isArray(data)) {
|
1267
|
-
return void 0;
|
1268
|
-
}
|
1269
|
-
return {
|
1270
|
-
title: t2(`app.search.groups.${type}`),
|
1271
|
-
area: type,
|
1272
|
-
hasMore: response.count > limit,
|
1273
|
-
count: response.count,
|
1274
|
-
items: data.map(transform)
|
1275
|
-
};
|
1276
|
-
}
|
1277
|
-
|
1278
|
-
// src/components/search/search.tsx
|
1279
|
-
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
1280
|
-
var Search = () => {
|
1281
|
-
const [area, setArea] = useState4("all");
|
1282
|
-
const [search, setSearch] = useState4("");
|
1283
|
-
const [limit, setLimit] = useState4(DEFAULT_SEARCH_LIMIT);
|
1284
|
-
const { open, onOpenChange } = useSearch();
|
1285
|
-
const location = useLocation();
|
1286
|
-
const { t: t2 } = useTranslation4();
|
1287
|
-
const navigate = useNavigate2();
|
1288
|
-
const inputRef = useRef(null);
|
1289
|
-
const listRef = useRef(null);
|
1290
|
-
const { staticResults, dynamicResults, isFetching } = useSearchResults({
|
1291
|
-
area,
|
1292
|
-
limit,
|
1293
|
-
q: search
|
1294
|
-
});
|
1295
|
-
const handleReset = useCallback3(() => {
|
1296
|
-
setArea("all");
|
1297
|
-
setSearch("");
|
1298
|
-
setLimit(DEFAULT_SEARCH_LIMIT);
|
1299
|
-
}, [setLimit]);
|
1300
|
-
const handleBack = () => {
|
1301
|
-
handleReset();
|
1302
|
-
inputRef.current?.focus();
|
1303
|
-
};
|
1304
|
-
const handleOpenChange = useCallback3(
|
1305
|
-
(open2) => {
|
1306
|
-
if (!open2) {
|
1307
|
-
handleReset();
|
1308
|
-
}
|
1309
|
-
onOpenChange(open2);
|
1310
|
-
},
|
1311
|
-
[onOpenChange, handleReset]
|
1312
|
-
);
|
1313
|
-
useEffect4(() => {
|
1314
|
-
handleOpenChange(false);
|
1315
|
-
}, [location.pathname, handleOpenChange]);
|
1316
|
-
const handleSelect = (item) => {
|
1317
|
-
handleOpenChange(false);
|
1318
|
-
if (item.to) {
|
1319
|
-
navigate(item.to);
|
1320
|
-
return;
|
1321
|
-
}
|
1322
|
-
if (item.callback) {
|
1323
|
-
item.callback();
|
1324
|
-
return;
|
1325
|
-
}
|
1326
|
-
};
|
1327
|
-
const handleShowMore = (area2) => {
|
1328
|
-
if (area2 === "all") {
|
1329
|
-
setLimit(DEFAULT_SEARCH_LIMIT);
|
1330
|
-
} else {
|
1331
|
-
setLimit(SEARCH_LIMIT_INCREMENT);
|
1332
|
-
}
|
1333
|
-
setArea(area2);
|
1334
|
-
inputRef.current?.focus();
|
1335
|
-
};
|
1336
|
-
const handleLoadMore = () => {
|
1337
|
-
setLimit((l) => l + SEARCH_LIMIT_INCREMENT);
|
1338
|
-
};
|
1339
|
-
const filteredStaticResults = useMemo2(() => {
|
1340
|
-
const filteredResults = [];
|
1341
|
-
staticResults.forEach((group) => {
|
1342
|
-
const filteredItems = matchSorter(group.items, search, {
|
1343
|
-
keys: ["label"]
|
1344
|
-
});
|
1345
|
-
if (filteredItems.length === 0) {
|
1346
|
-
return;
|
1347
|
-
}
|
1348
|
-
filteredResults.push({
|
1349
|
-
...group,
|
1350
|
-
items: filteredItems
|
1351
|
-
});
|
1352
|
-
});
|
1353
|
-
return filteredResults;
|
1354
|
-
}, [staticResults, search]);
|
1355
|
-
const handleSearch = (q) => {
|
1356
|
-
setSearch(q);
|
1357
|
-
listRef.current?.scrollTo({ top: 0 });
|
1358
|
-
};
|
1359
|
-
const showLoading = useMemo2(() => {
|
1360
|
-
return isFetching && !dynamicResults.length && !filteredStaticResults.length;
|
1361
|
-
}, [isFetching, dynamicResults, filteredStaticResults]);
|
1362
|
-
return /* @__PURE__ */ jsxs2(CommandDialog, { open, onOpenChange: handleOpenChange, children: [
|
1363
|
-
/* @__PURE__ */ jsx4(
|
1364
|
-
CommandInput,
|
1365
|
-
{
|
1366
|
-
isFetching,
|
1367
|
-
ref: inputRef,
|
1368
|
-
area,
|
1369
|
-
setArea,
|
1370
|
-
value: search,
|
1371
|
-
onValueChange: handleSearch,
|
1372
|
-
onBack: area !== "all" ? handleBack : void 0,
|
1373
|
-
placeholder: t2("app.search.placeholder")
|
1374
|
-
}
|
1375
|
-
),
|
1376
|
-
/* @__PURE__ */ jsxs2(CommandList, { ref: listRef, children: [
|
1377
|
-
showLoading && /* @__PURE__ */ jsx4(CommandLoading, {}),
|
1378
|
-
dynamicResults.map((group) => {
|
1379
|
-
return /* @__PURE__ */ jsxs2(CommandGroup, { heading: group.title, children: [
|
1380
|
-
group.items.map((item) => {
|
1381
|
-
return /* @__PURE__ */ jsx4(
|
1382
|
-
CommandItem,
|
1383
|
-
{
|
1384
|
-
onSelect: () => handleSelect(item),
|
1385
|
-
value: item.value,
|
1386
|
-
className: "flex items-center justify-between",
|
1387
|
-
children: /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-x-3", children: [
|
1388
|
-
item.thumbnail && /* @__PURE__ */ jsx4(
|
1389
|
-
Thumbnail,
|
1390
|
-
{
|
1391
|
-
alt: item.title,
|
1392
|
-
src: item.thumbnail,
|
1393
|
-
size: "small"
|
1394
|
-
}
|
1395
|
-
),
|
1396
|
-
/* @__PURE__ */ jsx4("span", { children: item.title }),
|
1397
|
-
item.subtitle && /* @__PURE__ */ jsx4("span", { className: "text-ui-fg-muted", children: item.subtitle })
|
1398
|
-
] })
|
1399
|
-
},
|
1400
|
-
item.id
|
1401
|
-
);
|
1402
|
-
}),
|
1403
|
-
group.hasMore && area === "all" && /* @__PURE__ */ jsx4(
|
1404
|
-
CommandItem,
|
1405
|
-
{
|
1406
|
-
onSelect: () => handleShowMore(group.area),
|
1407
|
-
hidden: true,
|
1408
|
-
value: `${group.title}:show:more`,
|
1409
|
-
children: /* @__PURE__ */ jsxs2("div", { className: "text-ui-fg-muted flex items-center gap-x-3", children: [
|
1410
|
-
/* @__PURE__ */ jsx4(Plus, {}),
|
1411
|
-
/* @__PURE__ */ jsx4(Text, { size: "small", leading: "compact", weight: "plus", children: t2("app.search.showMore") })
|
1412
|
-
] })
|
1413
|
-
}
|
1414
|
-
),
|
1415
|
-
group.hasMore && area === group.area && /* @__PURE__ */ jsx4(
|
1416
|
-
CommandItem,
|
1417
|
-
{
|
1418
|
-
onSelect: handleLoadMore,
|
1419
|
-
hidden: true,
|
1420
|
-
value: `${group.title}:load:more`,
|
1421
|
-
children: /* @__PURE__ */ jsxs2("div", { className: "text-ui-fg-muted flex items-center gap-x-3", children: [
|
1422
|
-
/* @__PURE__ */ jsx4(Plus, {}),
|
1423
|
-
/* @__PURE__ */ jsx4(Text, { size: "small", leading: "compact", weight: "plus", children: t2("app.search.loadMore", {
|
1424
|
-
count: Math.min(
|
1425
|
-
SEARCH_LIMIT_INCREMENT,
|
1426
|
-
group.count - limit
|
1427
|
-
)
|
1428
|
-
}) })
|
1429
|
-
] })
|
1430
|
-
}
|
1431
|
-
)
|
1432
|
-
] }, group.title);
|
1433
|
-
}),
|
1434
|
-
filteredStaticResults.map((group) => {
|
1435
|
-
return /* @__PURE__ */ jsx4(
|
1436
|
-
CommandGroup,
|
1437
|
-
{
|
1438
|
-
heading: t2(`app.keyboardShortcuts.${group.title}`),
|
1439
|
-
children: group.items.map((item) => {
|
1440
|
-
return /* @__PURE__ */ jsxs2(
|
1441
|
-
CommandItem,
|
1442
|
-
{
|
1443
|
-
onSelect: () => handleSelect(item),
|
1444
|
-
className: "flex items-center justify-between",
|
1445
|
-
children: [
|
1446
|
-
/* @__PURE__ */ jsx4("span", { children: item.label }),
|
1447
|
-
/* @__PURE__ */ jsx4("div", { className: "flex items-center gap-x-1.5", children: item.keys.Mac?.map((key, index) => {
|
1448
|
-
return /* @__PURE__ */ jsxs2(
|
1449
|
-
"div",
|
1450
|
-
{
|
1451
|
-
className: "flex items-center gap-x-1",
|
1452
|
-
children: [
|
1453
|
-
/* @__PURE__ */ jsx4(Kbd, { children: key }),
|
1454
|
-
index < (item.keys.Mac?.length || 0) - 1 && /* @__PURE__ */ jsx4("span", { className: "txt-compact-xsmall text-ui-fg-subtle", children: t2("app.keyboardShortcuts.then") })
|
1455
|
-
]
|
1456
|
-
},
|
1457
|
-
index
|
1458
|
-
);
|
1459
|
-
}) })
|
1460
|
-
]
|
1461
|
-
},
|
1462
|
-
item.label
|
1463
|
-
);
|
1464
|
-
})
|
1465
|
-
},
|
1466
|
-
group.title
|
1467
|
-
);
|
1468
|
-
}),
|
1469
|
-
!showLoading && /* @__PURE__ */ jsx4(CommandEmpty, { q: search })
|
1470
|
-
] })
|
1471
|
-
] });
|
1472
|
-
};
|
1473
|
-
var CommandPalette = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx4(
|
1474
|
-
Command,
|
1475
|
-
{
|
1476
|
-
shouldFilter: false,
|
1477
|
-
ref,
|
1478
|
-
className: clx(
|
1479
|
-
"bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",
|
1480
|
-
className
|
1481
|
-
),
|
1482
|
-
...props
|
1483
|
-
}
|
1484
|
-
));
|
1485
|
-
CommandPalette.displayName = Command.displayName;
|
1486
|
-
var CommandDialog = ({ children, ...props }) => {
|
1487
|
-
const { t: t2 } = useTranslation4();
|
1488
|
-
const preserveHeight = useMemo2(() => {
|
1489
|
-
return props.isLoading && Children.count(children) === 0;
|
1490
|
-
}, [props.isLoading, children]);
|
1491
|
-
return /* @__PURE__ */ jsx4(RadixDialog.Root, { ...props, children: /* @__PURE__ */ jsxs2(RadixDialog.Portal, { children: [
|
1492
|
-
/* @__PURE__ */ jsx4(RadixDialog.Overlay, { className: "bg-ui-bg-overlay fixed inset-0" }),
|
1493
|
-
/* @__PURE__ */ jsxs2(
|
1494
|
-
RadixDialog.Content,
|
1495
|
-
{
|
1496
|
-
className: clx(
|
1497
|
-
"bg-ui-bg-base shadow-elevation-modal fixed left-[50%] top-[50%] flex max-h-[calc(100%-16px)] w-[calc(100%-16px)] min-w-0 max-w-2xl translate-x-[-50%] translate-y-[-50%] flex-col overflow-hidden rounded-xl p-0",
|
1498
|
-
{
|
1499
|
-
"h-[300px]": preserveHeight
|
1500
|
-
// Prevents the dialog from collapsing when loading async results and before the no results message is displayed
|
1501
|
-
}
|
1502
|
-
),
|
1503
|
-
children: [
|
1504
|
-
/* @__PURE__ */ jsx4(RadixDialog.Title, { className: "sr-only", children: t2("app.search.title") }),
|
1505
|
-
/* @__PURE__ */ jsx4(RadixDialog.Description, { className: "sr-only", children: t2("app.search.description") }),
|
1506
|
-
/* @__PURE__ */ jsx4(CommandPalette, { className: "[&_[cmdk-group-heading]]:text-muted-foreground flex h-full flex-col overflow-hidden [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0", children }),
|
1507
|
-
/* @__PURE__ */ jsx4("div", { className: "bg-ui-bg-field text-ui-fg-subtle flex items-center justify-end border-t px-4 py-3", children: /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-x-3", children: [
|
1508
|
-
/* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-x-2", children: [
|
1509
|
-
/* @__PURE__ */ jsx4(Text, { size: "xsmall", leading: "compact", children: t2("app.search.navigation") }),
|
1510
|
-
/* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-x-1", children: [
|
1511
|
-
/* @__PURE__ */ jsx4(Kbd, { className: "bg-ui-bg-field-component", children: "\u2193" }),
|
1512
|
-
/* @__PURE__ */ jsx4(Kbd, { className: "bg-ui-bg-field-component", children: "\u2191" })
|
1513
|
-
] })
|
1514
|
-
] }),
|
1515
|
-
/* @__PURE__ */ jsx4("div", { className: "bg-ui-border-strong h-3 w-px" }),
|
1516
|
-
/* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-x-2", children: [
|
1517
|
-
/* @__PURE__ */ jsx4(Text, { size: "xsmall", leading: "compact", children: t2("app.search.openResult") }),
|
1518
|
-
/* @__PURE__ */ jsx4(Kbd, { className: "bg-ui-bg-field-component", children: "\u21B5" })
|
1519
|
-
] })
|
1520
|
-
] }) })
|
1521
|
-
]
|
1522
|
-
}
|
1523
|
-
)
|
1524
|
-
] }) });
|
1525
|
-
};
|
1526
|
-
var CommandInput = forwardRef(
|
1527
|
-
({
|
1528
|
-
className,
|
1529
|
-
value,
|
1530
|
-
onValueChange,
|
1531
|
-
area,
|
1532
|
-
setArea,
|
1533
|
-
isFetching,
|
1534
|
-
onBack,
|
1535
|
-
...props
|
1536
|
-
}, ref) => {
|
1537
|
-
const { t: t2 } = useTranslation4();
|
1538
|
-
const innerRef = useRef(null);
|
1539
|
-
useImperativeHandle(
|
1540
|
-
ref,
|
1541
|
-
() => innerRef.current
|
1542
|
-
);
|
1543
|
-
return /* @__PURE__ */ jsxs2("div", { className: "flex flex-col border-b", children: [
|
1544
|
-
/* @__PURE__ */ jsx4("div", { className: "px-4 pt-4", children: /* @__PURE__ */ jsxs2(DropdownMenu, { children: [
|
1545
|
-
/* @__PURE__ */ jsx4(DropdownMenu.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs2(
|
1546
|
-
Badge,
|
1547
|
-
{
|
1548
|
-
size: "2xsmall",
|
1549
|
-
className: "hover:bg-ui-bg-base-pressed transition-fg cursor-pointer",
|
1550
|
-
children: [
|
1551
|
-
t2(`app.search.groups.${area}`),
|
1552
|
-
/* @__PURE__ */ jsx4(TriangleDownMini, { className: "text-ui-fg-muted" })
|
1553
|
-
]
|
1554
|
-
}
|
1555
|
-
) }),
|
1556
|
-
/* @__PURE__ */ jsx4(
|
1557
|
-
DropdownMenu.Content,
|
1558
|
-
{
|
1559
|
-
align: "start",
|
1560
|
-
className: "h-full max-h-[360px] overflow-auto",
|
1561
|
-
onCloseAutoFocus: (e) => {
|
1562
|
-
e.preventDefault();
|
1563
|
-
innerRef.current?.focus();
|
1564
|
-
},
|
1565
|
-
children: /* @__PURE__ */ jsx4(
|
1566
|
-
DropdownMenu.RadioGroup,
|
1567
|
-
{
|
1568
|
-
value: area,
|
1569
|
-
onValueChange: (v) => setArea(v),
|
1570
|
-
children: SEARCH_AREAS.map((area2) => /* @__PURE__ */ jsxs2(Fragment, { children: [
|
1571
|
-
area2 === "command" && /* @__PURE__ */ jsx4(DropdownMenu.Separator, {}),
|
1572
|
-
/* @__PURE__ */ jsx4(DropdownMenu.RadioItem, { value: area2, children: t2(`app.search.groups.${area2}`) }),
|
1573
|
-
area2 === "all" && /* @__PURE__ */ jsx4(DropdownMenu.Separator, {})
|
1574
|
-
] }, area2))
|
1575
|
-
}
|
1576
|
-
)
|
1577
|
-
}
|
1578
|
-
)
|
1579
|
-
] }) }),
|
1580
|
-
/* @__PURE__ */ jsxs2("div", { className: "relative flex items-center gap-x-2 px-4 py-3", children: [
|
1581
|
-
onBack && /* @__PURE__ */ jsx4(
|
1582
|
-
IconButton,
|
1583
|
-
{
|
1584
|
-
type: "button",
|
1585
|
-
size: "small",
|
1586
|
-
variant: "transparent",
|
1587
|
-
onClick: onBack,
|
1588
|
-
children: /* @__PURE__ */ jsx4(ArrowUturnLeft, { className: "text-ui-fg-muted" })
|
1589
|
-
}
|
1590
|
-
),
|
1591
|
-
/* @__PURE__ */ jsx4(
|
1592
|
-
Command.Input,
|
1593
|
-
{
|
1594
|
-
ref: innerRef,
|
1595
|
-
value,
|
1596
|
-
onValueChange,
|
1597
|
-
className: clx(
|
1598
|
-
"placeholder:text-ui-fg-muted flex !h-6 w-full rounded-md bg-transparent text-sm outline-none disabled:cursor-not-allowed disabled:opacity-50",
|
1599
|
-
className
|
1600
|
-
),
|
1601
|
-
...props
|
1602
|
-
}
|
1603
|
-
),
|
1604
|
-
/* @__PURE__ */ jsxs2("div", { className: "absolute right-4 top-1/2 flex -translate-y-1/2 items-center justify-end gap-x-2", children: [
|
1605
|
-
isFetching && /* @__PURE__ */ jsx4(Spinner, { className: "text-ui-fg-muted animate-spin" }),
|
1606
|
-
value && /* @__PURE__ */ jsx4(
|
1607
|
-
Button,
|
1608
|
-
{
|
1609
|
-
variant: "transparent",
|
1610
|
-
size: "small",
|
1611
|
-
className: "text-ui-fg-muted hover:text-ui-fg-subtle",
|
1612
|
-
type: "button",
|
1613
|
-
onClick: () => {
|
1614
|
-
onValueChange?.("");
|
1615
|
-
innerRef.current?.focus();
|
1616
|
-
},
|
1617
|
-
children: t2("actions.clear")
|
1618
|
-
}
|
1619
|
-
)
|
1620
|
-
] })
|
1621
|
-
] })
|
1622
|
-
] });
|
1623
|
-
}
|
1624
|
-
);
|
1625
|
-
CommandInput.displayName = Command.Input.displayName;
|
1626
|
-
var CommandList = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx4(
|
1627
|
-
Command.List,
|
1628
|
-
{
|
1629
|
-
ref,
|
1630
|
-
className: clx(
|
1631
|
-
"max-h-[300px] flex-1 overflow-y-auto overflow-x-hidden px-2 pb-4",
|
1632
|
-
className
|
1633
|
-
),
|
1634
|
-
...props
|
1635
|
-
}
|
1636
|
-
));
|
1637
|
-
CommandList.displayName = Command.List.displayName;
|
1638
|
-
var CommandEmpty = forwardRef((props, ref) => {
|
1639
|
-
const { t: t2 } = useTranslation4();
|
1640
|
-
return /* @__PURE__ */ jsx4(Command.Empty, { ref, className: "py-6 text-center text-sm", ...props, children: /* @__PURE__ */ jsxs2("div", { className: "text-ui-fg-subtle flex min-h-[236px] flex-col items-center justify-center gap-y-3", children: [
|
1641
|
-
/* @__PURE__ */ jsx4(MagnifyingGlass, { className: "text-ui-fg-subtle" }),
|
1642
|
-
/* @__PURE__ */ jsxs2("div", { className: "flex flex-col items-center justify-center gap-y-1", children: [
|
1643
|
-
/* @__PURE__ */ jsx4(Text, { size: "small", weight: "plus", leading: "compact", children: props.q ? t2("app.search.noResultsTitle") : t2("app.search.emptySearchTitle") }),
|
1644
|
-
/* @__PURE__ */ jsx4(Text, { size: "small", className: "text-ui-fg-muted", children: props.q ? t2("app.search.noResultsMessage") : t2("app.search.emptySearchMessage") })
|
1645
|
-
] })
|
1646
|
-
] }) });
|
1647
|
-
});
|
1648
|
-
CommandEmpty.displayName = Command.Empty.displayName;
|
1649
|
-
var CommandLoading = forwardRef((props, ref) => {
|
1650
|
-
return /* @__PURE__ */ jsxs2(
|
1651
|
-
Command.Loading,
|
1652
|
-
{
|
1653
|
-
ref,
|
1654
|
-
...props,
|
1655
|
-
className: "bg-ui-bg-base flex flex-col",
|
1656
|
-
children: [
|
1657
|
-
/* @__PURE__ */ jsx4("div", { className: "w-full px-2 pb-1 pt-3", children: /* @__PURE__ */ jsx4(Skeleton, { className: "h-5 w-10" }) }),
|
1658
|
-
Array.from({ length: 7 }).map((_, index) => /* @__PURE__ */ jsx4("div", { className: "w-full p-2", children: /* @__PURE__ */ jsx4(Skeleton, { className: "h-5 w-full" }) }, index))
|
1659
|
-
]
|
1660
|
-
}
|
1661
|
-
);
|
1662
|
-
});
|
1663
|
-
CommandLoading.displayName = Command.Loading.displayName;
|
1664
|
-
var CommandGroup = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx4(
|
1665
|
-
Command.Group,
|
1666
|
-
{
|
1667
|
-
ref,
|
1668
|
-
className: clx(
|
1669
|
-
"text-ui-fg-base [&_[cmdk-group-heading]]:text-ui-fg-muted [&_[cmdk-group-heading]]:txt-compact-xsmall-plus overflow-hidden [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:pb-1 [&_[cmdk-group-heading]]:pt-3 [&_[cmdk-item]]:py-2",
|
1670
|
-
className
|
1671
|
-
),
|
1672
|
-
...props
|
1673
|
-
}
|
1674
|
-
));
|
1675
|
-
CommandGroup.displayName = Command.Group.displayName;
|
1676
|
-
var CommandSeparator = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx4(
|
1677
|
-
Command.Separator,
|
1678
|
-
{
|
1679
|
-
ref,
|
1680
|
-
className: clx("bg-border -mx-1 h-px", className),
|
1681
|
-
...props
|
1682
|
-
}
|
1683
|
-
));
|
1684
|
-
CommandSeparator.displayName = Command.Separator.displayName;
|
1685
|
-
var CommandItem = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx4(
|
1686
|
-
Command.Item,
|
1687
|
-
{
|
1688
|
-
ref,
|
1689
|
-
className: clx(
|
1690
|
-
"aria-selected:bg-ui-bg-base-hover focus-visible:bg-ui-bg-base-hover txt-compact-small [&>svg]:text-ui-fg-subtle relative flex cursor-pointer select-none items-center gap-x-3 rounded-md p-2 outline-none data-[disabled]:pointer-events-none data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50",
|
1691
|
-
className
|
1692
|
-
),
|
1693
|
-
...props
|
1694
|
-
}
|
1695
|
-
));
|
1696
|
-
CommandItem.displayName = Command.Item.displayName;
|
1697
|
-
|
1698
|
-
// src/providers/sidebar-provider/sidebar-provider.tsx
|
1699
|
-
import { useEffect as useEffect5, useState as useState5 } from "react";
|
1700
|
-
import { useLocation as useLocation2 } from "react-router-dom";
|
1701
|
-
|
1702
|
-
// src/providers/sidebar-provider/sidebar-context.tsx
|
1703
|
-
import { createContext as createContext3 } from "react";
|
1704
|
-
var SidebarContext = createContext3(null);
|
1705
|
-
|
1706
|
-
// src/providers/sidebar-provider/sidebar-provider.tsx
|
1707
|
-
import { jsx as jsx5 } from "react/jsx-runtime";
|
1708
|
-
var SidebarProvider = ({ children }) => {
|
1709
|
-
const [desktop, setDesktop] = useState5(true);
|
1710
|
-
const [mobile, setMobile] = useState5(false);
|
1711
|
-
const { pathname } = useLocation2();
|
1712
|
-
const toggle = (view) => {
|
1713
|
-
if (view === "desktop") {
|
1714
|
-
setDesktop(!desktop);
|
1715
|
-
} else {
|
1716
|
-
setMobile(!mobile);
|
1717
|
-
}
|
1718
|
-
};
|
1719
|
-
useEffect5(() => {
|
1720
|
-
setMobile(false);
|
1721
|
-
}, [pathname]);
|
1722
|
-
return /* @__PURE__ */ jsx5(SidebarContext.Provider, { value: { desktop, mobile, toggle }, children });
|
1723
|
-
};
|
1724
|
-
|
1725
|
-
// src/providers/sidebar-provider/use-sidebar.tsx
|
1726
|
-
import { useContext as useContext3 } from "react";
|
1727
|
-
var useSidebar = () => {
|
1728
|
-
const context = useContext3(SidebarContext);
|
1729
|
-
if (!context) {
|
1730
|
-
throw new Error("useSidebar must be used within a SidebarProvider");
|
1731
|
-
}
|
1732
|
-
return context;
|
1733
|
-
};
|
1734
|
-
|
1735
|
-
// src/providers/search-provider/search-context.tsx
|
1736
|
-
import { createContext as createContext4 } from "react";
|
1737
|
-
var SearchContext = createContext4(null);
|
1738
|
-
|
1739
|
-
// src/providers/search-provider/search-provider.tsx
|
1740
|
-
import { jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
|
1741
|
-
var SearchProvider = ({ children }) => {
|
1742
|
-
const [open, setOpen] = useState6(false);
|
1743
|
-
const { mobile, toggle } = useSidebar();
|
1744
|
-
const toggleSearch = () => {
|
1745
|
-
const update = !open;
|
1746
|
-
if (update && mobile) {
|
1747
|
-
toggle("mobile");
|
1748
|
-
}
|
1749
|
-
setOpen(update);
|
1750
|
-
};
|
1751
|
-
useEffect6(() => {
|
1752
|
-
const onKeyDown = (e) => {
|
1753
|
-
if (e.key === "k" && (e.metaKey || e.ctrlKey)) {
|
1754
|
-
setOpen((prev) => !prev);
|
1755
|
-
}
|
1756
|
-
};
|
1757
|
-
document.addEventListener("keydown", onKeyDown);
|
1758
|
-
return () => {
|
1759
|
-
document.removeEventListener("keydown", onKeyDown);
|
1760
|
-
};
|
1761
|
-
}, []);
|
1762
|
-
return /* @__PURE__ */ jsxs3(
|
1763
|
-
SearchContext.Provider,
|
1764
|
-
{
|
1765
|
-
value: {
|
1766
|
-
open,
|
1767
|
-
onOpenChange: setOpen,
|
1768
|
-
toggleSearch
|
1769
|
-
},
|
1770
|
-
children: [
|
1771
|
-
children,
|
1772
|
-
/* @__PURE__ */ jsx6(Search, {})
|
1773
|
-
]
|
1774
|
-
}
|
1775
|
-
);
|
1776
|
-
};
|
1777
|
-
|
1778
|
-
// src/providers/search-provider/use-search.tsx
|
1779
|
-
import { useContext as useContext4 } from "react";
|
1780
|
-
var useSearch = () => {
|
1781
|
-
const context = useContext4(SearchContext);
|
1782
|
-
if (!context) {
|
1783
|
-
throw new Error("useSearch must be used within a SearchProvider");
|
1784
|
-
}
|
1785
|
-
return context;
|
1786
|
-
};
|
1787
|
-
|
1788
|
-
// src/components/authentication/protected-route/protected-route.tsx
|
1789
|
-
import { jsx as jsx7 } from "react/jsx-runtime";
|
1790
|
-
var ProtectedRoute = () => {
|
1791
|
-
const { user, isLoading } = useMe();
|
1792
|
-
const location = useLocation3();
|
1793
|
-
if (isLoading) {
|
1794
|
-
return /* @__PURE__ */ jsx7("div", { className: "flex min-h-screen items-center justify-center", children: /* @__PURE__ */ jsx7(Spinner2, { className: "text-ui-fg-interactive animate-spin" }) });
|
1795
|
-
}
|
1796
|
-
if (!user) {
|
1797
|
-
return /* @__PURE__ */ jsx7(Navigate, { to: "/login", state: { from: location }, replace: true });
|
1798
|
-
}
|
1799
|
-
return /* @__PURE__ */ jsx7(SidebarProvider, { children: /* @__PURE__ */ jsx7(SearchProvider, { children: /* @__PURE__ */ jsx7(Outlet, {}) }) });
|
1800
|
-
};
|
1801
|
-
|
1802
|
-
// src/components/layout/main-layout/main-layout.tsx
|
1803
|
-
import {
|
1804
|
-
BuildingStorefront,
|
1805
|
-
Buildings,
|
1806
|
-
ChevronDownMini,
|
1807
|
-
CogSixTooth,
|
1808
|
-
CurrencyDollar,
|
1809
|
-
EllipsisHorizontal as EllipsisHorizontal2,
|
1810
|
-
MagnifyingGlass as MagnifyingGlass2,
|
1811
|
-
MinusMini,
|
1812
|
-
OpenRectArrowOut as OpenRectArrowOut2,
|
1813
|
-
ReceiptPercent,
|
1814
|
-
ShoppingCart,
|
1815
|
-
SquaresPlus,
|
1816
|
-
Tag,
|
1817
|
-
Users
|
1818
|
-
} from "@medusajs/icons";
|
1819
|
-
import { Avatar as Avatar2, Divider, DropdownMenu as DropdownMenu3, Text as Text5, clx as clx6 } from "@medusajs/ui";
|
1820
|
-
import { Collapsible as RadixCollapsible2 } from "radix-ui";
|
1821
|
-
import { useTranslation as useTranslation9 } from "react-i18next";
|
1822
|
-
|
1823
|
-
// src/components/layout/nav-item/nav-item.tsx
|
1824
|
-
import { Kbd as Kbd2, Text as Text2, clx as clx2 } from "@medusajs/ui";
|
1825
|
-
import { Collapsible as RadixCollapsible } from "radix-ui";
|
1826
|
-
import {
|
1827
|
-
useCallback as useCallback4,
|
1828
|
-
useEffect as useEffect7,
|
1829
|
-
useState as useState7
|
1830
|
-
} from "react";
|
1831
|
-
import { useTranslation as useTranslation5 } from "react-i18next";
|
1832
|
-
import { NavLink, useLocation as useLocation4 } from "react-router-dom";
|
1833
|
-
import { jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
|
1834
|
-
var BASE_NAV_LINK_CLASSES = "text-ui-fg-subtle transition-fg hover:bg-ui-bg-subtle-hover flex items-center gap-x-2 rounded-md py-0.5 pl-0.5 pr-2 outline-none [&>svg]:text-ui-fg-subtle focus-visible:shadow-borders-focus";
|
1835
|
-
var ACTIVE_NAV_LINK_CLASSES = "bg-ui-bg-base shadow-elevation-card-rest text-ui-fg-base hover:bg-ui-bg-base";
|
1836
|
-
var NESTED_NAV_LINK_CLASSES = "pl-[34px] pr-2 py-1 w-full text-ui-fg-muted";
|
1837
|
-
var SETTING_NAV_LINK_CLASSES = "pl-2 py-1";
|
1838
|
-
var getIsOpen = (to, items, pathname) => {
|
1839
|
-
return [to, ...items?.map((i) => i.to) ?? []].some(
|
1840
|
-
(p) => pathname.startsWith(p)
|
1841
|
-
);
|
1842
|
-
};
|
1843
|
-
var NavItemTooltip = ({
|
1844
|
-
to,
|
1845
|
-
children
|
1846
|
-
}) => {
|
1847
|
-
const { t: t2 } = useTranslation5();
|
1848
|
-
const globalShortcuts = useGlobalShortcuts();
|
1849
|
-
const shortcut = globalShortcuts.find((s) => s.to === to);
|
1850
|
-
return /* @__PURE__ */ jsx8(
|
1851
|
-
ConditionalTooltip,
|
1852
|
-
{
|
1853
|
-
showTooltip: !!shortcut,
|
1854
|
-
maxWidth: 9999,
|
1855
|
-
content: /* @__PURE__ */ jsxs4("div", { className: "txt-compact-xsmall flex h-5 items-center justify-between gap-x-2 whitespace-nowrap", children: [
|
1856
|
-
/* @__PURE__ */ jsx8("span", { children: shortcut?.label }),
|
1857
|
-
/* @__PURE__ */ jsx8("div", { className: "flex items-center gap-x-1", children: shortcut?.keys.Mac?.map((key, index) => /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-x-1", children: [
|
1858
|
-
/* @__PURE__ */ jsx8(Kbd2, { children: key }, key),
|
1859
|
-
index < (shortcut.keys.Mac?.length || 0) - 1 && /* @__PURE__ */ jsx8("span", { className: "text-ui-fg-muted txt-compact-xsmall", children: t2("app.keyboardShortcuts.then") })
|
1860
|
-
] }, index)) })
|
1861
|
-
] }),
|
1862
|
-
side: "right",
|
1863
|
-
delayDuration: 1500,
|
1864
|
-
children: /* @__PURE__ */ jsx8("div", { className: "w-full", children })
|
1865
|
-
}
|
1866
|
-
);
|
1867
|
-
};
|
1868
|
-
var NavItem = ({
|
1869
|
-
icon,
|
1870
|
-
label,
|
1871
|
-
to,
|
1872
|
-
items,
|
1873
|
-
type = "core",
|
1874
|
-
from
|
1875
|
-
}) => {
|
1876
|
-
const { pathname } = useLocation4();
|
1877
|
-
const [open, setOpen] = useState7(getIsOpen(to, items, pathname));
|
1878
|
-
useEffect7(() => {
|
1879
|
-
setOpen(getIsOpen(to, items, pathname));
|
1880
|
-
}, [pathname, to, items]);
|
1881
|
-
const navLinkClassNames = useCallback4(
|
1882
|
-
({
|
1883
|
-
to: to2,
|
1884
|
-
isActive,
|
1885
|
-
isNested = false,
|
1886
|
-
isSetting: isSetting2 = false
|
1887
|
-
}) => {
|
1888
|
-
if (["core", "setting"].includes(type)) {
|
1889
|
-
isActive = pathname.startsWith(to2);
|
1890
|
-
}
|
1891
|
-
return clx2(BASE_NAV_LINK_CLASSES, {
|
1892
|
-
[NESTED_NAV_LINK_CLASSES]: isNested,
|
1893
|
-
[ACTIVE_NAV_LINK_CLASSES]: isActive,
|
1894
|
-
[SETTING_NAV_LINK_CLASSES]: isSetting2
|
1895
|
-
});
|
1896
|
-
},
|
1897
|
-
[type, pathname]
|
1898
|
-
);
|
1899
|
-
const isSetting = type === "setting";
|
1900
|
-
return /* @__PURE__ */ jsxs4("div", { className: "px-3", children: [
|
1901
|
-
/* @__PURE__ */ jsx8(NavItemTooltip, { to, children: /* @__PURE__ */ jsxs4(
|
1902
|
-
NavLink,
|
1903
|
-
{
|
1904
|
-
to,
|
1905
|
-
end: true,
|
1906
|
-
state: from ? {
|
1907
|
-
from
|
1908
|
-
} : void 0,
|
1909
|
-
className: ({ isActive }) => {
|
1910
|
-
return clx2(navLinkClassNames({ isActive, isSetting, to }), {
|
1911
|
-
"max-lg:hidden": !!items?.length
|
1912
|
-
});
|
1913
|
-
},
|
1914
|
-
children: [
|
1915
|
-
type !== "setting" && /* @__PURE__ */ jsx8("div", { className: "flex size-6 items-center justify-center", children: /* @__PURE__ */ jsx8(Icon, { icon, type }) }),
|
1916
|
-
/* @__PURE__ */ jsx8(Text2, { size: "small", weight: "plus", leading: "compact", children: label })
|
1917
|
-
]
|
1918
|
-
}
|
1919
|
-
) }),
|
1920
|
-
items && items.length > 0 && /* @__PURE__ */ jsxs4(RadixCollapsible.Root, { open, onOpenChange: setOpen, children: [
|
1921
|
-
/* @__PURE__ */ jsxs4(
|
1922
|
-
RadixCollapsible.Trigger,
|
1923
|
-
{
|
1924
|
-
className: clx2(
|
1925
|
-
"text-ui-fg-subtle hover:text-ui-fg-base transition-fg hover:bg-ui-bg-subtle-hover flex w-full items-center gap-x-2 rounded-md py-0.5 pl-0.5 pr-2 outline-none lg:hidden",
|
1926
|
-
{ "pl-2": isSetting }
|
1927
|
-
),
|
1928
|
-
children: [
|
1929
|
-
/* @__PURE__ */ jsx8("div", { className: "flex size-6 items-center justify-center", children: /* @__PURE__ */ jsx8(Icon, { icon, type }) }),
|
1930
|
-
/* @__PURE__ */ jsx8(Text2, { size: "small", weight: "plus", leading: "compact", children: label })
|
1931
|
-
]
|
1932
|
-
}
|
1933
|
-
),
|
1934
|
-
/* @__PURE__ */ jsx8(RadixCollapsible.Content, { children: /* @__PURE__ */ jsx8("div", { className: "flex flex-col gap-y-0.5 pb-2 pt-0.5", children: /* @__PURE__ */ jsxs4("ul", { className: "flex flex-col gap-y-0.5", children: [
|
1935
|
-
/* @__PURE__ */ jsx8("li", { className: "flex w-full items-center gap-x-1 lg:hidden", children: /* @__PURE__ */ jsx8(NavItemTooltip, { to, children: /* @__PURE__ */ jsx8(
|
1936
|
-
NavLink,
|
1937
|
-
{
|
1938
|
-
to,
|
1939
|
-
end: true,
|
1940
|
-
className: ({ isActive }) => {
|
1941
|
-
return clx2(
|
1942
|
-
navLinkClassNames({
|
1943
|
-
to,
|
1944
|
-
isActive,
|
1945
|
-
isSetting,
|
1946
|
-
isNested: true
|
1947
|
-
})
|
1948
|
-
);
|
1949
|
-
},
|
1950
|
-
children: /* @__PURE__ */ jsx8(Text2, { size: "small", weight: "plus", leading: "compact", children: label })
|
1951
|
-
}
|
1952
|
-
) }) }),
|
1953
|
-
items.map((item) => {
|
1954
|
-
return /* @__PURE__ */ jsx8("li", { className: "flex h-7 items-center", children: /* @__PURE__ */ jsx8(NavItemTooltip, { to: item.to, children: /* @__PURE__ */ jsx8(
|
1955
|
-
NavLink,
|
1956
|
-
{
|
1957
|
-
to: item.to,
|
1958
|
-
end: true,
|
1959
|
-
className: ({ isActive }) => {
|
1960
|
-
return clx2(
|
1961
|
-
navLinkClassNames({
|
1962
|
-
to: item.to,
|
1963
|
-
isActive,
|
1964
|
-
isSetting,
|
1965
|
-
isNested: true
|
1966
|
-
})
|
1967
|
-
);
|
1968
|
-
},
|
1969
|
-
children: /* @__PURE__ */ jsx8(Text2, { size: "small", weight: "plus", leading: "compact", children: item.label })
|
1970
|
-
}
|
1971
|
-
) }) }, item.to);
|
1972
|
-
})
|
1973
|
-
] }) }) })
|
1974
|
-
] })
|
1975
|
-
] });
|
1976
|
-
};
|
1977
|
-
var Icon = ({ icon, type }) => {
|
1978
|
-
if (!icon) {
|
1979
|
-
return null;
|
1980
|
-
}
|
1981
|
-
return type === "extension" ? /* @__PURE__ */ jsx8("div", { className: "shadow-borders-base bg-ui-bg-base flex h-5 w-5 items-center justify-center rounded-[4px]", children: /* @__PURE__ */ jsx8("div", { className: "h-[15px] w-[15px] overflow-hidden rounded-sm", children: icon }) }) : icon;
|
1982
|
-
};
|
1983
|
-
|
1984
|
-
// src/components/layout/shell/shell.tsx
|
1985
|
-
import { SidebarLeft, TriangleRightMini, XMark } from "@medusajs/icons";
|
1986
|
-
import { IconButton as IconButton3, clx as clx4 } from "@medusajs/ui";
|
1987
|
-
import { AnimatePresence } from "motion/react";
|
1988
|
-
import { Dialog as RadixDialog2 } from "radix-ui";
|
1989
|
-
import { useEffect as useEffect10, useState as useState10 } from "react";
|
1990
|
-
import { useTranslation as useTranslation7 } from "react-i18next";
|
1991
|
-
import {
|
1992
|
-
Link,
|
1993
|
-
Outlet as Outlet2,
|
1994
|
-
useMatches,
|
1995
|
-
useNavigation
|
1996
|
-
} from "react-router-dom";
|
1997
|
-
|
1998
|
-
// src/providers/keybind-provider/keybind-provider.tsx
|
1999
|
-
import { useCallback as useCallback5, useMemo as useMemo3, useState as useState8 } from "react";
|
2000
|
-
import { jsx as jsx9 } from "react/jsx-runtime";
|
2001
|
-
var KeybindProvider = ({
|
2002
|
-
shortcuts,
|
2003
|
-
debounce = 500,
|
2004
|
-
children
|
2005
|
-
}) => {
|
2006
|
-
const [storeShortcuts, setStoreCommands] = useState8(
|
2007
|
-
shortcuts.map((shr) => getShortcutWithDefaultValues(shr))
|
2008
|
-
);
|
2009
|
-
const registerShortcut = useCallback5(
|
2010
|
-
(shortcut) => {
|
2011
|
-
setStoreCommands((prevShortcuts) => {
|
2012
|
-
const idx = findShortcutIndex(shortcuts, getShortcutKeys(shortcut));
|
2013
|
-
const newShortcuts = [...prevShortcuts];
|
2014
|
-
if (idx > -1) {
|
2015
|
-
newShortcuts[idx] = getShortcutWithDefaultValues(shortcut);
|
2016
|
-
return prevShortcuts;
|
2017
|
-
}
|
2018
|
-
return [...prevShortcuts, getShortcutWithDefaultValues(shortcut)];
|
2019
|
-
});
|
2020
|
-
},
|
2021
|
-
[shortcuts]
|
2022
|
-
);
|
2023
|
-
const getKeysByPlatform = useCallback5((command) => {
|
2024
|
-
return findFirstPlatformMatch(command.keys);
|
2025
|
-
}, []);
|
2026
|
-
useShortcuts({ shortcuts: storeShortcuts, debounce });
|
2027
|
-
const commandsContext = useMemo3(
|
2028
|
-
() => ({
|
2029
|
-
shortcuts: storeShortcuts,
|
2030
|
-
registerShortcut,
|
2031
|
-
getKeysByPlatform
|
2032
|
-
}),
|
2033
|
-
[storeShortcuts, registerShortcut, getKeysByPlatform]
|
2034
|
-
);
|
2035
|
-
return /* @__PURE__ */ jsx9(KeybindContext.Provider, { value: commandsContext, children });
|
2036
|
-
};
|
2037
|
-
|
2038
|
-
// src/components/layout/notifications/notifications.tsx
|
2039
|
-
import {
|
2040
|
-
BellAlert,
|
2041
|
-
BellAlertDone,
|
2042
|
-
InformationCircleSolid
|
2043
|
-
} from "@medusajs/icons";
|
2044
|
-
import { clx as clx3, Drawer, Heading, IconButton as IconButton2, Text as Text3 } from "@medusajs/ui";
|
2045
|
-
import { formatDistance } from "date-fns";
|
2046
|
-
import { useEffect as useEffect9, useState as useState9 } from "react";
|
2047
|
-
import { useTranslation as useTranslation6 } from "react-i18next";
|
2048
|
-
|
2049
|
-
// src/components/common/infinite-list/infinite-list.tsx
|
2050
|
-
import { useInfiniteQuery } from "@tanstack/react-query";
|
2051
|
-
import { useEffect as useEffect8, useMemo as useMemo4, useRef as useRef2 } from "react";
|
2052
|
-
import { toast } from "@medusajs/ui";
|
2053
|
-
import { Spinner as Spinner3 } from "@medusajs/icons";
|
2054
|
-
import { jsx as jsx10, jsxs as jsxs5 } from "react/jsx-runtime";
|
2055
|
-
var InfiniteList = ({
|
2056
|
-
queryKey,
|
2057
|
-
queryFn,
|
2058
|
-
queryOptions,
|
2059
|
-
renderItem,
|
2060
|
-
renderEmpty,
|
2061
|
-
responseKey,
|
2062
|
-
pageSize = 20
|
2063
|
-
}) => {
|
2064
|
-
const {
|
2065
|
-
data,
|
2066
|
-
error,
|
2067
|
-
fetchNextPage,
|
2068
|
-
fetchPreviousPage,
|
2069
|
-
hasPreviousPage,
|
2070
|
-
hasNextPage,
|
2071
|
-
isFetching,
|
2072
|
-
isPending
|
2073
|
-
} = useInfiniteQuery({
|
2074
|
-
queryKey,
|
2075
|
-
queryFn: async ({ pageParam = 0 }) => {
|
2076
|
-
return await queryFn({
|
2077
|
-
limit: pageSize,
|
2078
|
-
offset: pageParam
|
2079
|
-
});
|
2080
|
-
},
|
2081
|
-
initialPageParam: 0,
|
2082
|
-
maxPages: 5,
|
2083
|
-
getNextPageParam: (lastPage) => {
|
2084
|
-
const moreItemsExist = lastPage.count > lastPage.offset + lastPage.limit;
|
2085
|
-
return moreItemsExist ? lastPage.offset + lastPage.limit : void 0;
|
2086
|
-
},
|
2087
|
-
getPreviousPageParam: (firstPage) => {
|
2088
|
-
const moreItemsExist = firstPage.offset !== 0;
|
2089
|
-
return moreItemsExist ? Math.max(firstPage.offset - firstPage.limit, 0) : void 0;
|
2090
|
-
},
|
2091
|
-
...queryOptions
|
2092
|
-
});
|
2093
|
-
const items = useMemo4(() => {
|
2094
|
-
return data?.pages.flatMap((p) => p[responseKey]) ?? [];
|
2095
|
-
}, [data, responseKey]);
|
2096
|
-
const parentRef = useRef2(null);
|
2097
|
-
const startObserver = useRef2();
|
2098
|
-
const endObserver = useRef2();
|
2099
|
-
useEffect8(() => {
|
2100
|
-
if (isPending) {
|
2101
|
-
return;
|
2102
|
-
}
|
2103
|
-
if (!isFetching) {
|
2104
|
-
startObserver.current = new IntersectionObserver((entries) => {
|
2105
|
-
if (entries[0].isIntersecting && hasPreviousPage) {
|
2106
|
-
fetchPreviousPage();
|
2107
|
-
}
|
2108
|
-
});
|
2109
|
-
endObserver.current = new IntersectionObserver((entries) => {
|
2110
|
-
if (entries[0].isIntersecting && hasNextPage) {
|
2111
|
-
fetchNextPage();
|
2112
|
-
}
|
2113
|
-
});
|
2114
|
-
startObserver.current?.observe(parentRef.current.firstChild);
|
2115
|
-
endObserver.current?.observe(parentRef.current.lastChild);
|
2116
|
-
}
|
2117
|
-
return () => {
|
2118
|
-
startObserver.current?.disconnect();
|
2119
|
-
endObserver.current?.disconnect();
|
2120
|
-
};
|
2121
|
-
}, [
|
2122
|
-
fetchNextPage,
|
2123
|
-
fetchPreviousPage,
|
2124
|
-
hasNextPage,
|
2125
|
-
hasPreviousPage,
|
2126
|
-
isFetching,
|
2127
|
-
isPending
|
2128
|
-
]);
|
2129
|
-
useEffect8(() => {
|
2130
|
-
if (error) {
|
2131
|
-
toast.error(error.message);
|
2132
|
-
}
|
2133
|
-
}, [error]);
|
2134
|
-
if (isPending) {
|
2135
|
-
return /* @__PURE__ */ jsx10("div", { className: "flex h-full flex-col items-center justify-center", children: /* @__PURE__ */ jsx10(Spinner3, { className: "animate-spin" }) });
|
2136
|
-
}
|
2137
|
-
return /* @__PURE__ */ jsxs5("div", { ref: parentRef, className: "h-full", children: [
|
2138
|
-
items?.length ? items.map((item) => /* @__PURE__ */ jsx10("div", { children: renderItem(item) }, item.id)) : renderEmpty(),
|
2139
|
-
isFetching && /* @__PURE__ */ jsx10("div", { className: "flex flex-col items-center justify-center py-4", children: /* @__PURE__ */ jsx10(Spinner3, { className: "animate-spin" }) })
|
2140
|
-
] });
|
2141
|
-
};
|
2142
|
-
|
2143
|
-
// src/components/layout/notifications/notifications.tsx
|
2144
|
-
import { Fragment as Fragment2, jsx as jsx11, jsxs as jsxs6 } from "react/jsx-runtime";
|
2145
|
-
var LAST_READ_NOTIFICATION_KEY = "notificationsLastReadAt";
|
2146
|
-
var Notifications = () => {
|
2147
|
-
const { t: t2 } = useTranslation6();
|
2148
|
-
const [open, setOpen] = useState9(false);
|
2149
|
-
const [hasUnread, setHasUnread] = useUnreadNotifications();
|
2150
|
-
const [lastReadAt, setLastReadAt] = useState9(
|
2151
|
-
localStorage.getItem(LAST_READ_NOTIFICATION_KEY)
|
2152
|
-
);
|
2153
|
-
useEffect9(() => {
|
2154
|
-
const onKeyDown = (e) => {
|
2155
|
-
if (e.key === "n" && (e.metaKey || e.ctrlKey)) {
|
2156
|
-
setOpen((prev) => !prev);
|
2157
|
-
}
|
2158
|
-
};
|
2159
|
-
document.addEventListener("keydown", onKeyDown);
|
2160
|
-
return () => {
|
2161
|
-
document.removeEventListener("keydown", onKeyDown);
|
2162
|
-
};
|
2163
|
-
}, []);
|
2164
|
-
const handleOnOpen = (shouldOpen) => {
|
2165
|
-
if (shouldOpen) {
|
2166
|
-
setHasUnread(false);
|
2167
|
-
setOpen(true);
|
2168
|
-
localStorage.setItem(LAST_READ_NOTIFICATION_KEY, (/* @__PURE__ */ new Date()).toISOString());
|
2169
|
-
} else {
|
2170
|
-
setOpen(false);
|
2171
|
-
setLastReadAt(localStorage.getItem(LAST_READ_NOTIFICATION_KEY));
|
2172
|
-
}
|
2173
|
-
};
|
2174
|
-
return /* @__PURE__ */ jsxs6(Drawer, { open, onOpenChange: handleOnOpen, children: [
|
2175
|
-
/* @__PURE__ */ jsx11(Drawer.Trigger, { asChild: true, children: /* @__PURE__ */ jsx11(
|
2176
|
-
IconButton2,
|
2177
|
-
{
|
2178
|
-
variant: "transparent",
|
2179
|
-
className: "text-ui-fg-muted hover:text-ui-fg-subtle",
|
2180
|
-
children: hasUnread ? /* @__PURE__ */ jsx11(BellAlertDone, {}) : /* @__PURE__ */ jsx11(BellAlert, {})
|
2181
|
-
}
|
2182
|
-
) }),
|
2183
|
-
/* @__PURE__ */ jsxs6(Drawer.Content, { children: [
|
2184
|
-
/* @__PURE__ */ jsxs6(Drawer.Header, { children: [
|
2185
|
-
/* @__PURE__ */ jsx11(Drawer.Title, { asChild: true, children: /* @__PURE__ */ jsx11(Heading, { children: t2("notifications.domain") }) }),
|
2186
|
-
/* @__PURE__ */ jsx11(Drawer.Description, { className: "sr-only", children: t2("notifications.accessibility.description") })
|
2187
|
-
] }),
|
2188
|
-
/* @__PURE__ */ jsx11(Drawer.Body, { className: "overflow-y-auto px-0", children: /* @__PURE__ */ jsx11(
|
2189
|
-
InfiniteList,
|
2190
|
-
{
|
2191
|
-
responseKey: "notifications",
|
2192
|
-
queryKey: notificationQueryKeys.all,
|
2193
|
-
queryFn: (params) => sdk.admin.notification.list(params),
|
2194
|
-
queryOptions: { enabled: open },
|
2195
|
-
renderEmpty: () => /* @__PURE__ */ jsx11(NotificationsEmptyState, { t: t2 }),
|
2196
|
-
renderItem: (notification) => {
|
2197
|
-
return /* @__PURE__ */ jsx11(
|
2198
|
-
Notification,
|
2199
|
-
{
|
2200
|
-
notification,
|
2201
|
-
unread: Date.parse(notification.created_at) > (lastReadAt ? Date.parse(lastReadAt) : 0)
|
2202
|
-
},
|
2203
|
-
notification.id
|
2204
|
-
);
|
2205
|
-
}
|
2206
|
-
}
|
2207
|
-
) })
|
2208
|
-
] })
|
2209
|
-
] });
|
2210
|
-
};
|
2211
|
-
var Notification = ({
|
2212
|
-
notification,
|
2213
|
-
unread
|
2214
|
-
}) => {
|
2215
|
-
const data = notification.data;
|
2216
|
-
if (!data?.title) {
|
2217
|
-
return null;
|
2218
|
-
}
|
2219
|
-
return /* @__PURE__ */ jsx11(Fragment2, { children: /* @__PURE__ */ jsxs6("div", { className: "relative flex items-start justify-center gap-3 border-b p-6", children: [
|
2220
|
-
/* @__PURE__ */ jsx11("div", { className: "text-ui-fg-muted flex size-5 items-center justify-center", children: /* @__PURE__ */ jsx11(InformationCircleSolid, {}) }),
|
2221
|
-
/* @__PURE__ */ jsxs6("div", { className: "flex w-full flex-col gap-y-3", children: [
|
2222
|
-
/* @__PURE__ */ jsxs6("div", { className: "flex flex-col", children: [
|
2223
|
-
/* @__PURE__ */ jsxs6("div", { className: "flex items-center justify-between", children: [
|
2224
|
-
/* @__PURE__ */ jsx11(Text3, { size: "small", leading: "compact", weight: "plus", children: data.title }),
|
2225
|
-
/* @__PURE__ */ jsxs6("div", { className: "align-center flex items-center justify-center gap-2", children: [
|
2226
|
-
/* @__PURE__ */ jsx11(
|
2227
|
-
Text3,
|
2228
|
-
{
|
2229
|
-
as: "span",
|
2230
|
-
className: clx3("text-ui-fg-subtle", {
|
2231
|
-
"text-ui-fg-base": unread
|
2232
|
-
}),
|
2233
|
-
size: "small",
|
2234
|
-
leading: "compact",
|
2235
|
-
weight: "plus",
|
2236
|
-
children: formatDistance(notification.created_at, /* @__PURE__ */ new Date(), {
|
2237
|
-
addSuffix: true
|
2238
|
-
})
|
2239
|
-
}
|
2240
|
-
),
|
2241
|
-
unread && /* @__PURE__ */ jsx11(
|
2242
|
-
"div",
|
2243
|
-
{
|
2244
|
-
className: "bg-ui-bg-interactive h-2 w-2 rounded",
|
2245
|
-
role: "status"
|
2246
|
-
}
|
2247
|
-
)
|
2248
|
-
] })
|
2249
|
-
] }),
|
2250
|
-
!!data.description && /* @__PURE__ */ jsx11(
|
2251
|
-
Text3,
|
2252
|
-
{
|
2253
|
-
className: "text-ui-fg-subtle whitespace-pre-line",
|
2254
|
-
size: "small",
|
2255
|
-
children: data.description
|
2256
|
-
}
|
2257
|
-
)
|
2258
|
-
] }),
|
2259
|
-
!!data?.file?.url && /* @__PURE__ */ jsx11(
|
2260
|
-
FilePreview,
|
2261
|
-
{
|
2262
|
-
filename: data.file.filename ?? "",
|
2263
|
-
url: data.file.url,
|
2264
|
-
hideThumbnail: true
|
2265
|
-
}
|
2266
|
-
)
|
2267
|
-
] })
|
2268
|
-
] }) });
|
2269
|
-
};
|
2270
|
-
var NotificationsEmptyState = ({ t: t2 }) => {
|
2271
|
-
return /* @__PURE__ */ jsxs6("div", { className: "flex h-full flex-col items-center justify-center", children: [
|
2272
|
-
/* @__PURE__ */ jsx11(BellAlertDone, {}),
|
2273
|
-
/* @__PURE__ */ jsx11(Text3, { size: "small", leading: "compact", weight: "plus", className: "mt-3", children: t2("notifications.emptyState.title") }),
|
2274
|
-
/* @__PURE__ */ jsx11(
|
2275
|
-
Text3,
|
2276
|
-
{
|
2277
|
-
size: "small",
|
2278
|
-
className: "text-ui-fg-muted mt-1 max-w-[294px] text-center",
|
2279
|
-
children: t2("notifications.emptyState.description")
|
2280
|
-
}
|
2281
|
-
)
|
2282
|
-
] });
|
2283
|
-
};
|
2284
|
-
var useUnreadNotifications = () => {
|
2285
|
-
const [hasUnread, setHasUnread] = useState9(false);
|
2286
|
-
const { notifications } = useNotifications(
|
2287
|
-
{ limit: 1, offset: 0, fields: "created_at" },
|
2288
|
-
{ refetchInterval: 6e4 }
|
2289
|
-
);
|
2290
|
-
const lastNotification = notifications?.[0];
|
2291
|
-
useEffect9(() => {
|
2292
|
-
if (!lastNotification) {
|
2293
|
-
return;
|
2294
|
-
}
|
2295
|
-
const lastNotificationAsTimestamp = Date.parse(lastNotification.created_at);
|
2296
|
-
const lastReadDatetime = localStorage.getItem(LAST_READ_NOTIFICATION_KEY);
|
2297
|
-
const lastReadAsTimestamp = lastReadDatetime ? Date.parse(lastReadDatetime) : 0;
|
2298
|
-
if (lastNotificationAsTimestamp > lastReadAsTimestamp) {
|
2299
|
-
setHasUnread(true);
|
2300
|
-
}
|
2301
|
-
}, [lastNotification]);
|
2302
|
-
return [hasUnread, setHasUnread];
|
2303
|
-
};
|
2304
|
-
|
2305
|
-
// src/components/layout/shell/shell.tsx
|
2306
|
-
import { jsx as jsx12, jsxs as jsxs7 } from "react/jsx-runtime";
|
2307
|
-
var Shell = ({ children }) => {
|
2308
|
-
const globalShortcuts = useGlobalShortcuts();
|
2309
|
-
const navigation = useNavigation();
|
2310
|
-
const loading = navigation.state === "loading";
|
2311
|
-
return /* @__PURE__ */ jsx12(KeybindProvider, { shortcuts: globalShortcuts, children: /* @__PURE__ */ jsxs7("div", { className: "relative flex h-screen flex-col items-start overflow-hidden lg:flex-row", children: [
|
2312
|
-
/* @__PURE__ */ jsx12(NavigationBar, { loading }),
|
2313
|
-
/* @__PURE__ */ jsxs7("div", { children: [
|
2314
|
-
/* @__PURE__ */ jsx12(MobileSidebarContainer, { children }),
|
2315
|
-
/* @__PURE__ */ jsx12(DesktopSidebarContainer, { children })
|
2316
|
-
] }),
|
2317
|
-
/* @__PURE__ */ jsxs7("div", { className: "flex h-screen w-full flex-col overflow-auto", children: [
|
2318
|
-
/* @__PURE__ */ jsx12(Topbar, {}),
|
2319
|
-
/* @__PURE__ */ jsx12(
|
2320
|
-
"main",
|
2321
|
-
{
|
2322
|
-
className: clx4(
|
2323
|
-
"flex h-full w-full flex-col items-center overflow-y-auto transition-opacity delay-200 duration-200",
|
2324
|
-
{
|
2325
|
-
"opacity-25": loading
|
2326
|
-
}
|
2327
|
-
),
|
2328
|
-
children: /* @__PURE__ */ jsx12(Gutter, { children: /* @__PURE__ */ jsx12(Outlet2, {}) })
|
2329
|
-
}
|
2330
|
-
)
|
2331
|
-
] })
|
2332
|
-
] }) });
|
2333
|
-
};
|
2334
|
-
var NavigationBar = ({ loading }) => {
|
2335
|
-
const [showBar, setShowBar] = useState10(false);
|
2336
|
-
useEffect10(() => {
|
2337
|
-
let timeout;
|
2338
|
-
if (loading) {
|
2339
|
-
timeout = setTimeout(() => {
|
2340
|
-
setShowBar(true);
|
2341
|
-
}, 200);
|
2342
|
-
} else {
|
2343
|
-
setShowBar(false);
|
2344
|
-
}
|
2345
|
-
return () => {
|
2346
|
-
clearTimeout(timeout);
|
2347
|
-
};
|
2348
|
-
}, [loading]);
|
2349
|
-
return /* @__PURE__ */ jsx12("div", { className: "fixed inset-x-0 top-0 z-50 h-1", children: /* @__PURE__ */ jsx12(AnimatePresence, { children: showBar ? /* @__PURE__ */ jsx12(ProgressBar, {}) : null }) });
|
2350
|
-
};
|
2351
|
-
var Gutter = ({ children }) => {
|
2352
|
-
return /* @__PURE__ */ jsx12("div", { className: "flex w-full max-w-[1600px] flex-col gap-y-2 p-3", children });
|
2353
|
-
};
|
2354
|
-
var Breadcrumbs = () => {
|
2355
|
-
const matches = useMatches();
|
2356
|
-
const crumbs = matches.filter((match) => match.handle?.breadcrumb).map((match) => {
|
2357
|
-
const handle = match.handle;
|
2358
|
-
let label = void 0;
|
2359
|
-
try {
|
2360
|
-
label = handle.breadcrumb?.(match);
|
2361
|
-
} catch (error) {
|
2362
|
-
}
|
2363
|
-
if (!label) {
|
2364
|
-
return null;
|
2365
|
-
}
|
2366
|
-
return {
|
2367
|
-
label,
|
2368
|
-
path: match.pathname
|
2369
|
-
};
|
2370
|
-
}).filter(Boolean);
|
2371
|
-
return /* @__PURE__ */ jsx12(
|
2372
|
-
"ol",
|
2373
|
-
{
|
2374
|
-
className: clx4(
|
2375
|
-
"text-ui-fg-muted txt-compact-small-plus flex select-none items-center"
|
2376
|
-
),
|
2377
|
-
children: crumbs.map((crumb, index) => {
|
2378
|
-
const isLast = index === crumbs.length - 1;
|
2379
|
-
const isSingle = crumbs.length === 1;
|
2380
|
-
return /* @__PURE__ */ jsxs7("li", { className: clx4("flex items-center"), children: [
|
2381
|
-
!isLast ? /* @__PURE__ */ jsx12(
|
2382
|
-
Link,
|
2383
|
-
{
|
2384
|
-
className: "transition-fg hover:text-ui-fg-subtle",
|
2385
|
-
to: crumb.path,
|
2386
|
-
children: crumb.label
|
2387
|
-
}
|
2388
|
-
) : /* @__PURE__ */ jsxs7("div", { children: [
|
2389
|
-
!isSingle && /* @__PURE__ */ jsx12("span", { className: "block lg:hidden", children: "..." }),
|
2390
|
-
/* @__PURE__ */ jsx12(
|
2391
|
-
"span",
|
2392
|
-
{
|
2393
|
-
className: clx4({
|
2394
|
-
"hidden lg:block": !isSingle
|
2395
|
-
}),
|
2396
|
-
children: crumb.label
|
2397
|
-
},
|
2398
|
-
index
|
2399
|
-
)
|
2400
|
-
] }),
|
2401
|
-
!isLast && /* @__PURE__ */ jsx12("span", { className: "mx-2", children: /* @__PURE__ */ jsx12(TriangleRightMini, {}) })
|
2402
|
-
] }, index);
|
2403
|
-
})
|
2404
|
-
}
|
2405
|
-
);
|
2406
|
-
};
|
2407
|
-
var ToggleSidebar = () => {
|
2408
|
-
const { toggle } = useSidebar();
|
2409
|
-
return /* @__PURE__ */ jsxs7("div", { children: [
|
2410
|
-
/* @__PURE__ */ jsx12(
|
2411
|
-
IconButton3,
|
2412
|
-
{
|
2413
|
-
className: "hidden lg:flex",
|
2414
|
-
variant: "transparent",
|
2415
|
-
onClick: () => toggle("desktop"),
|
2416
|
-
size: "small",
|
2417
|
-
children: /* @__PURE__ */ jsx12(SidebarLeft, { className: "text-ui-fg-muted" })
|
2418
|
-
}
|
2419
|
-
),
|
2420
|
-
/* @__PURE__ */ jsx12(
|
2421
|
-
IconButton3,
|
2422
|
-
{
|
2423
|
-
className: "hidden max-lg:flex",
|
2424
|
-
variant: "transparent",
|
2425
|
-
onClick: () => toggle("mobile"),
|
2426
|
-
size: "small",
|
2427
|
-
children: /* @__PURE__ */ jsx12(SidebarLeft, { className: "text-ui-fg-muted" })
|
2428
|
-
}
|
2429
|
-
)
|
2430
|
-
] });
|
2431
|
-
};
|
2432
|
-
var Topbar = () => {
|
2433
|
-
return /* @__PURE__ */ jsxs7("div", { className: "grid w-full grid-cols-2 border-b p-3", children: [
|
2434
|
-
/* @__PURE__ */ jsxs7("div", { className: "flex items-center gap-x-1.5", children: [
|
2435
|
-
/* @__PURE__ */ jsx12(ToggleSidebar, {}),
|
2436
|
-
/* @__PURE__ */ jsx12(Breadcrumbs, {})
|
2437
|
-
] }),
|
2438
|
-
/* @__PURE__ */ jsx12("div", { className: "flex items-center justify-end gap-x-3", children: /* @__PURE__ */ jsx12(Notifications, {}) })
|
2439
|
-
] });
|
2440
|
-
};
|
2441
|
-
var DesktopSidebarContainer = ({ children }) => {
|
2442
|
-
const { desktop } = useSidebar();
|
2443
|
-
return /* @__PURE__ */ jsx12(
|
2444
|
-
"div",
|
2445
|
-
{
|
2446
|
-
className: clx4("hidden h-screen w-[220px] border-r", {
|
2447
|
-
"lg:flex": desktop
|
2448
|
-
}),
|
2449
|
-
children
|
2450
|
-
}
|
2451
|
-
);
|
2452
|
-
};
|
2453
|
-
var MobileSidebarContainer = ({ children }) => {
|
2454
|
-
const { t: t2 } = useTranslation7();
|
2455
|
-
const { mobile, toggle } = useSidebar();
|
2456
|
-
return /* @__PURE__ */ jsx12(RadixDialog2.Root, { open: mobile, onOpenChange: () => toggle("mobile"), children: /* @__PURE__ */ jsxs7(RadixDialog2.Portal, { children: [
|
2457
|
-
/* @__PURE__ */ jsx12(
|
2458
|
-
RadixDialog2.Overlay,
|
2459
|
-
{
|
2460
|
-
className: clx4(
|
2461
|
-
"bg-ui-bg-overlay fixed inset-0",
|
2462
|
-
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"
|
2463
|
-
)
|
2464
|
-
}
|
2465
|
-
),
|
2466
|
-
/* @__PURE__ */ jsxs7(
|
2467
|
-
RadixDialog2.Content,
|
2468
|
-
{
|
2469
|
-
className: clx4(
|
2470
|
-
"bg-ui-bg-subtle shadow-elevation-modal fixed inset-y-2 left-2 flex w-full max-w-[304px] flex-col overflow-hidden rounded-lg border-r",
|
2471
|
-
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:slide-out-to-left-1/2 data-[state=open]:slide-in-from-left-1/2 duration-200"
|
2472
|
-
),
|
2473
|
-
children: [
|
2474
|
-
/* @__PURE__ */ jsxs7("div", { className: "p-3", children: [
|
2475
|
-
/* @__PURE__ */ jsx12(RadixDialog2.Close, { asChild: true, children: /* @__PURE__ */ jsx12(
|
2476
|
-
IconButton3,
|
2477
|
-
{
|
2478
|
-
size: "small",
|
2479
|
-
variant: "transparent",
|
2480
|
-
className: "text-ui-fg-subtle",
|
2481
|
-
children: /* @__PURE__ */ jsx12(XMark, {})
|
2482
|
-
}
|
2483
|
-
) }),
|
2484
|
-
/* @__PURE__ */ jsx12(RadixDialog2.Title, { className: "sr-only", children: t2("app.nav.accessibility.title") }),
|
2485
|
-
/* @__PURE__ */ jsx12(RadixDialog2.Description, { className: "sr-only", children: t2("app.nav.accessibility.description") })
|
2486
|
-
] }),
|
2487
|
-
children
|
2488
|
-
]
|
2489
|
-
}
|
2490
|
-
)
|
2491
|
-
] }) });
|
2492
|
-
};
|
2493
|
-
|
2494
|
-
// src/components/layout/main-layout/main-layout.tsx
|
2495
|
-
import { Link as Link3, useLocation as useLocation6, useNavigate as useNavigate4 } from "react-router-dom";
|
2496
|
-
|
2497
|
-
// src/components/layout/user-menu/user-menu.tsx
|
2498
|
-
import {
|
2499
|
-
BookOpen,
|
2500
|
-
CircleHalfSolid,
|
2501
|
-
EllipsisHorizontal,
|
2502
|
-
Keyboard,
|
2503
|
-
OpenRectArrowOut,
|
2504
|
-
TimelineVertical,
|
2505
|
-
User as UserIcon,
|
2506
|
-
XMark as XMark2
|
2507
|
-
} from "@medusajs/icons";
|
2508
|
-
import {
|
2509
|
-
Avatar,
|
2510
|
-
DropdownMenu as DropdownMenu2,
|
2511
|
-
Heading as Heading2,
|
2512
|
-
IconButton as IconButton4,
|
2513
|
-
Input,
|
2514
|
-
Kbd as Kbd3,
|
2515
|
-
Text as Text4,
|
2516
|
-
clx as clx5
|
2517
|
-
} from "@medusajs/ui";
|
2518
|
-
import { Dialog as RadixDialog3 } from "radix-ui";
|
2519
|
-
import { useTranslation as useTranslation8 } from "react-i18next";
|
2520
|
-
import { useState as useState11 } from "react";
|
2521
|
-
import { Link as Link2, useLocation as useLocation5, useNavigate as useNavigate3 } from "react-router-dom";
|
2522
|
-
import { jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
|
2523
|
-
var UserMenu = () => {
|
2524
|
-
const { t: t2 } = useTranslation8();
|
2525
|
-
const location = useLocation5();
|
2526
|
-
const [openMenu, setOpenMenu] = useState11(false);
|
2527
|
-
const [openModal, setOpenModal] = useState11(false);
|
2528
|
-
const toggleModal = () => {
|
2529
|
-
setOpenMenu(false);
|
2530
|
-
setOpenModal(!openModal);
|
2531
|
-
};
|
2532
|
-
return /* @__PURE__ */ jsxs8("div", { children: [
|
2533
|
-
/* @__PURE__ */ jsxs8(DropdownMenu2, { open: openMenu, onOpenChange: setOpenMenu, children: [
|
2534
|
-
/* @__PURE__ */ jsx13(UserBadge, {}),
|
2535
|
-
/* @__PURE__ */ jsxs8(DropdownMenu2.Content, { className: "min-w-[var(--radix-dropdown-menu-trigger-width)] max-w-[var(--radix-dropdown-menu-trigger-width)]", children: [
|
2536
|
-
/* @__PURE__ */ jsx13(UserItem, {}),
|
2537
|
-
/* @__PURE__ */ jsx13(DropdownMenu2.Separator, {}),
|
2538
|
-
/* @__PURE__ */ jsx13(DropdownMenu2.Item, { asChild: true, children: /* @__PURE__ */ jsxs8(Link2, { to: "/settings/profile", state: { from: location.pathname }, children: [
|
2539
|
-
/* @__PURE__ */ jsx13(UserIcon, { className: "text-ui-fg-subtle mr-2" }),
|
2540
|
-
t2("app.menus.user.profileSettings")
|
2541
|
-
] }) }),
|
2542
|
-
/* @__PURE__ */ jsx13(DropdownMenu2.Separator, {}),
|
2543
|
-
/* @__PURE__ */ jsx13(DropdownMenu2.Item, { asChild: true, children: /* @__PURE__ */ jsxs8(Link2, { to: "https://docs.medusajs.com", target: "_blank", children: [
|
2544
|
-
/* @__PURE__ */ jsx13(BookOpen, { className: "text-ui-fg-subtle mr-2" }),
|
2545
|
-
t2("app.menus.user.documentation")
|
2546
|
-
] }) }),
|
2547
|
-
/* @__PURE__ */ jsx13(DropdownMenu2.Item, { asChild: true, children: /* @__PURE__ */ jsxs8(Link2, { to: "https://medusajs.com/changelog/", target: "_blank", children: [
|
2548
|
-
/* @__PURE__ */ jsx13(TimelineVertical, { className: "text-ui-fg-subtle mr-2" }),
|
2549
|
-
t2("app.menus.user.changelog")
|
2550
|
-
] }) }),
|
2551
|
-
/* @__PURE__ */ jsx13(DropdownMenu2.Separator, {}),
|
2552
|
-
/* @__PURE__ */ jsxs8(DropdownMenu2.Item, { onClick: toggleModal, children: [
|
2553
|
-
/* @__PURE__ */ jsx13(Keyboard, { className: "text-ui-fg-subtle mr-2" }),
|
2554
|
-
t2("app.menus.user.shortcuts")
|
2555
|
-
] }),
|
2556
|
-
/* @__PURE__ */ jsx13(ThemeToggle, {}),
|
2557
|
-
/* @__PURE__ */ jsx13(DropdownMenu2.Separator, {}),
|
2558
|
-
/* @__PURE__ */ jsx13(Logout, {})
|
2559
|
-
] })
|
2560
|
-
] }),
|
2561
|
-
/* @__PURE__ */ jsx13(GlobalKeybindsModal, { open: openModal, onOpenChange: setOpenModal })
|
2562
|
-
] });
|
2563
|
-
};
|
2564
|
-
var UserBadge = () => {
|
2565
|
-
const { user, isPending, isError, error } = useMe();
|
2566
|
-
const name = [user?.first_name, user?.last_name].filter(Boolean).join(" ");
|
2567
|
-
const displayName = name || user?.email;
|
2568
|
-
const fallback = displayName ? displayName[0].toUpperCase() : null;
|
2569
|
-
if (isPending) {
|
2570
|
-
return /* @__PURE__ */ jsxs8("button", { className: "shadow-borders-base flex max-w-[192px] select-none items-center gap-x-2 overflow-hidden text-ellipsis whitespace-nowrap rounded-full py-1 pl-1 pr-2.5", children: [
|
2571
|
-
/* @__PURE__ */ jsx13(Skeleton, { className: "h-5 w-5 rounded-full" }),
|
2572
|
-
/* @__PURE__ */ jsx13(Skeleton, { className: "h-[9px] w-[70px]" })
|
2573
|
-
] });
|
2574
|
-
}
|
2575
|
-
if (isError) {
|
2576
|
-
throw error;
|
2577
|
-
}
|
2578
|
-
return /* @__PURE__ */ jsx13("div", { className: "p-3", children: /* @__PURE__ */ jsxs8(
|
2579
|
-
DropdownMenu2.Trigger,
|
2580
|
-
{
|
2581
|
-
disabled: !user,
|
2582
|
-
className: clx5(
|
2583
|
-
"bg-ui-bg-subtle grid w-full cursor-pointer grid-cols-[24px_1fr_15px] items-center gap-2 rounded-md py-1 pl-0.5 pr-2 outline-none",
|
2584
|
-
"hover:bg-ui-bg-subtle-hover",
|
2585
|
-
"data-[state=open]:bg-ui-bg-subtle-hover",
|
2586
|
-
"focus-visible:shadow-borders-focus"
|
2587
|
-
),
|
2588
|
-
children: [
|
2589
|
-
/* @__PURE__ */ jsx13("div", { className: "flex size-6 items-center justify-center", children: fallback ? /* @__PURE__ */ jsx13(Avatar, { size: "xsmall", fallback }) : /* @__PURE__ */ jsx13(Skeleton, { className: "h-6 w-6 rounded-full" }) }),
|
2590
|
-
/* @__PURE__ */ jsx13("div", { className: "flex items-center overflow-hidden", children: displayName ? /* @__PURE__ */ jsx13(
|
2591
|
-
Text4,
|
2592
|
-
{
|
2593
|
-
size: "xsmall",
|
2594
|
-
weight: "plus",
|
2595
|
-
leading: "compact",
|
2596
|
-
className: "truncate",
|
2597
|
-
children: displayName
|
2598
|
-
}
|
2599
|
-
) : /* @__PURE__ */ jsx13(Skeleton, { className: "h-[9px] w-[70px]" }) }),
|
2600
|
-
/* @__PURE__ */ jsx13(EllipsisHorizontal, { className: "text-ui-fg-muted" })
|
2601
|
-
]
|
2602
|
-
}
|
2603
|
-
) });
|
2604
|
-
};
|
2605
|
-
var ThemeToggle = () => {
|
2606
|
-
const { t: t2 } = useTranslation8();
|
2607
|
-
const { theme, setTheme } = useTheme();
|
2608
|
-
return /* @__PURE__ */ jsxs8(DropdownMenu2.SubMenu, { children: [
|
2609
|
-
/* @__PURE__ */ jsxs8(DropdownMenu2.SubMenuTrigger, { className: "rounded-md", children: [
|
2610
|
-
/* @__PURE__ */ jsx13(CircleHalfSolid, { className: "text-ui-fg-subtle mr-2" }),
|
2611
|
-
t2("app.menus.user.theme.label")
|
2612
|
-
] }),
|
2613
|
-
/* @__PURE__ */ jsx13(DropdownMenu2.SubMenuContent, { children: /* @__PURE__ */ jsxs8(DropdownMenu2.RadioGroup, { value: theme, children: [
|
2614
|
-
/* @__PURE__ */ jsx13(
|
2615
|
-
DropdownMenu2.RadioItem,
|
2616
|
-
{
|
2617
|
-
value: "system",
|
2618
|
-
onClick: (e) => {
|
2619
|
-
e.preventDefault();
|
2620
|
-
setTheme("system");
|
2621
|
-
},
|
2622
|
-
children: t2("app.menus.user.theme.system")
|
2623
|
-
}
|
2624
|
-
),
|
2625
|
-
/* @__PURE__ */ jsx13(
|
2626
|
-
DropdownMenu2.RadioItem,
|
2627
|
-
{
|
2628
|
-
value: "light",
|
2629
|
-
onClick: (e) => {
|
2630
|
-
e.preventDefault();
|
2631
|
-
setTheme("light");
|
2632
|
-
},
|
2633
|
-
children: t2("app.menus.user.theme.light")
|
2634
|
-
}
|
2635
|
-
),
|
2636
|
-
/* @__PURE__ */ jsx13(
|
2637
|
-
DropdownMenu2.RadioItem,
|
2638
|
-
{
|
2639
|
-
value: "dark",
|
2640
|
-
onClick: (e) => {
|
2641
|
-
e.preventDefault();
|
2642
|
-
setTheme("dark");
|
2643
|
-
},
|
2644
|
-
children: t2("app.menus.user.theme.dark")
|
2645
|
-
}
|
2646
|
-
)
|
2647
|
-
] }) })
|
2648
|
-
] });
|
2649
|
-
};
|
2650
|
-
var Logout = () => {
|
2651
|
-
const { t: t2 } = useTranslation8();
|
2652
|
-
const navigate = useNavigate3();
|
2653
|
-
const { mutateAsync: logoutMutation } = useLogout();
|
2654
|
-
const handleLogout = async () => {
|
2655
|
-
await logoutMutation(void 0, {
|
2656
|
-
onSuccess: () => {
|
2657
|
-
queryClient.clear();
|
2658
|
-
navigate("/login");
|
2659
|
-
}
|
2660
|
-
});
|
2661
|
-
};
|
2662
|
-
return /* @__PURE__ */ jsx13(DropdownMenu2.Item, { onClick: handleLogout, children: /* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-x-2", children: [
|
2663
|
-
/* @__PURE__ */ jsx13(OpenRectArrowOut, { className: "text-ui-fg-subtle" }),
|
2664
|
-
/* @__PURE__ */ jsx13("span", { children: t2("app.menus.actions.logout") })
|
2665
|
-
] }) });
|
2666
|
-
};
|
2667
|
-
var GlobalKeybindsModal = (props) => {
|
2668
|
-
const { t: t2 } = useTranslation8();
|
2669
|
-
const globalShortcuts = useGlobalShortcuts();
|
2670
|
-
const [searchValue, onSearchValueChange] = useState11("");
|
2671
|
-
const searchResults = searchValue ? globalShortcuts.filter((shortcut) => {
|
2672
|
-
return shortcut.label.toLowerCase().includes(searchValue?.toLowerCase());
|
2673
|
-
}) : globalShortcuts;
|
2674
|
-
return /* @__PURE__ */ jsx13(RadixDialog3.Root, { ...props, children: /* @__PURE__ */ jsxs8(RadixDialog3.Portal, { children: [
|
2675
|
-
/* @__PURE__ */ jsx13(RadixDialog3.Overlay, { className: "bg-ui-bg-overlay fixed inset-0" }),
|
2676
|
-
/* @__PURE__ */ jsxs8(RadixDialog3.Content, { className: "bg-ui-bg-subtle shadow-elevation-modal fixed left-[50%] top-[50%] flex h-full max-h-[612px] w-full max-w-[560px] translate-x-[-50%] translate-y-[-50%] flex-col divide-y overflow-hidden rounded-lg", children: [
|
2677
|
-
/* @__PURE__ */ jsxs8("div", { className: "flex flex-col gap-y-3 px-6 py-4", children: [
|
2678
|
-
/* @__PURE__ */ jsxs8("div", { className: "flex items-center justify-between", children: [
|
2679
|
-
/* @__PURE__ */ jsxs8("div", { children: [
|
2680
|
-
/* @__PURE__ */ jsx13(RadixDialog3.Title, { asChild: true, children: /* @__PURE__ */ jsx13(Heading2, { children: t2("app.menus.user.shortcuts") }) }),
|
2681
|
-
/* @__PURE__ */ jsx13(RadixDialog3.Description, { className: "sr-only" })
|
2682
|
-
] }),
|
2683
|
-
/* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-x-2", children: [
|
2684
|
-
/* @__PURE__ */ jsx13(Kbd3, { children: "esc" }),
|
2685
|
-
/* @__PURE__ */ jsx13(RadixDialog3.Close, { asChild: true, children: /* @__PURE__ */ jsx13(IconButton4, { variant: "transparent", size: "small", children: /* @__PURE__ */ jsx13(XMark2, {}) }) })
|
2686
|
-
] })
|
2687
|
-
] }),
|
2688
|
-
/* @__PURE__ */ jsx13("div", { children: /* @__PURE__ */ jsx13(
|
2689
|
-
Input,
|
2690
|
-
{
|
2691
|
-
type: "search",
|
2692
|
-
value: searchValue,
|
2693
|
-
onChange: (e) => onSearchValueChange(e.target.value)
|
2694
|
-
}
|
2695
|
-
) })
|
2696
|
-
] }),
|
2697
|
-
/* @__PURE__ */ jsx13("div", { className: "flex flex-col divide-y overflow-y-auto", children: searchResults.map((shortcut, index) => {
|
2698
|
-
return /* @__PURE__ */ jsxs8(
|
2699
|
-
"div",
|
2700
|
-
{
|
2701
|
-
className: "text-ui-fg-subtle flex items-center justify-between px-6 py-3",
|
2702
|
-
children: [
|
2703
|
-
/* @__PURE__ */ jsx13(Text4, { size: "small", children: shortcut.label }),
|
2704
|
-
/* @__PURE__ */ jsx13("div", { className: "flex items-center gap-x-1", children: shortcut.keys.Mac?.map((key, index2) => {
|
2705
|
-
return /* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-x-1", children: [
|
2706
|
-
/* @__PURE__ */ jsx13(Kbd3, { children: key }),
|
2707
|
-
index2 < (shortcut.keys.Mac?.length || 0) - 1 && /* @__PURE__ */ jsx13("span", { className: "txt-compact-xsmall text-ui-fg-subtle", children: t2("app.keyboardShortcuts.then") })
|
2708
|
-
] }, index2);
|
2709
|
-
}) })
|
2710
|
-
]
|
2711
|
-
},
|
2712
|
-
index
|
2713
|
-
);
|
2714
|
-
}) })
|
2715
|
-
] })
|
2716
|
-
] }) });
|
2717
|
-
};
|
2718
|
-
var UserItem = () => {
|
2719
|
-
const { user, isPending, isError, error } = useMe();
|
2720
|
-
const loaded = !isPending && !!user;
|
2721
|
-
if (!loaded) {
|
2722
|
-
return /* @__PURE__ */ jsx13("div", {});
|
2723
|
-
}
|
2724
|
-
const name = [user.first_name, user.last_name].filter(Boolean).join(" ");
|
2725
|
-
const email = user.email;
|
2726
|
-
const fallback = name ? name[0].toUpperCase() : email[0].toUpperCase();
|
2727
|
-
const avatar = user.avatar_url;
|
2728
|
-
if (isError) {
|
2729
|
-
throw error;
|
2730
|
-
}
|
2731
|
-
return /* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-x-3 overflow-hidden px-2 py-1", children: [
|
2732
|
-
/* @__PURE__ */ jsx13(
|
2733
|
-
Avatar,
|
2734
|
-
{
|
2735
|
-
size: "small",
|
2736
|
-
variant: "rounded",
|
2737
|
-
src: avatar || void 0,
|
2738
|
-
fallback
|
2739
|
-
}
|
2740
|
-
),
|
2741
|
-
/* @__PURE__ */ jsxs8("div", { className: "block w-full min-w-0 max-w-[187px] overflow-hidden whitespace-nowrap", children: [
|
2742
|
-
/* @__PURE__ */ jsx13(
|
2743
|
-
Text4,
|
2744
|
-
{
|
2745
|
-
size: "small",
|
2746
|
-
weight: "plus",
|
2747
|
-
leading: "compact",
|
2748
|
-
className: "overflow-hidden text-ellipsis whitespace-nowrap",
|
2749
|
-
children: name || email
|
2750
|
-
}
|
2751
|
-
),
|
2752
|
-
!!name && /* @__PURE__ */ jsx13(
|
2753
|
-
Text4,
|
2754
|
-
{
|
2755
|
-
size: "xsmall",
|
2756
|
-
leading: "compact",
|
2757
|
-
className: "text-ui-fg-subtle overflow-hidden text-ellipsis whitespace-nowrap",
|
2758
|
-
children: email
|
2759
|
-
}
|
2760
|
-
)
|
2761
|
-
] })
|
2762
|
-
] });
|
2763
|
-
};
|
2764
|
-
|
2765
|
-
// src/components/layout/main-layout/main-layout.tsx
|
2766
|
-
import { jsx as jsx14, jsxs as jsxs9 } from "react/jsx-runtime";
|
2767
|
-
var MainLayout = () => {
|
2768
|
-
return /* @__PURE__ */ jsx14(Shell, { children: /* @__PURE__ */ jsx14(MainSidebar, {}) });
|
2769
|
-
};
|
2770
|
-
var MainSidebar = () => {
|
2771
|
-
return /* @__PURE__ */ jsx14("aside", { className: "flex flex-1 flex-col justify-between overflow-y-auto", children: /* @__PURE__ */ jsxs9("div", { className: "flex flex-1 flex-col", children: [
|
2772
|
-
/* @__PURE__ */ jsxs9("div", { className: "bg-ui-bg-subtle sticky top-0", children: [
|
2773
|
-
/* @__PURE__ */ jsx14(Header, {}),
|
2774
|
-
/* @__PURE__ */ jsx14("div", { className: "px-3", children: /* @__PURE__ */ jsx14(Divider, { variant: "dashed" }) })
|
2775
|
-
] }),
|
2776
|
-
/* @__PURE__ */ jsxs9("div", { className: "flex flex-1 flex-col justify-between", children: [
|
2777
|
-
/* @__PURE__ */ jsxs9("div", { className: "flex flex-1 flex-col", children: [
|
2778
|
-
/* @__PURE__ */ jsx14(CoreRouteSection, {}),
|
2779
|
-
/* @__PURE__ */ jsx14(ExtensionRouteSection, {})
|
2780
|
-
] }),
|
2781
|
-
/* @__PURE__ */ jsx14(UtilitySection, {})
|
2782
|
-
] }),
|
2783
|
-
/* @__PURE__ */ jsx14("div", { className: "bg-ui-bg-subtle sticky bottom-0", children: /* @__PURE__ */ jsx14(UserSection, {}) })
|
2784
|
-
] }) });
|
2785
|
-
};
|
2786
|
-
var Logout2 = () => {
|
2787
|
-
const { t: t2 } = useTranslation9();
|
2788
|
-
const navigate = useNavigate4();
|
2789
|
-
const { mutateAsync: logoutMutation } = useLogout();
|
2790
|
-
const handleLogout = async () => {
|
2791
|
-
await logoutMutation(void 0, {
|
2792
|
-
onSuccess: () => {
|
2793
|
-
queryClient.clear();
|
2794
|
-
navigate("/login");
|
2795
|
-
}
|
2796
|
-
});
|
2797
|
-
};
|
2798
|
-
return /* @__PURE__ */ jsx14(DropdownMenu3.Item, { onClick: handleLogout, children: /* @__PURE__ */ jsxs9("div", { className: "flex items-center gap-x-2", children: [
|
2799
|
-
/* @__PURE__ */ jsx14(OpenRectArrowOut2, { className: "text-ui-fg-subtle" }),
|
2800
|
-
/* @__PURE__ */ jsx14("span", { children: t2("app.menus.actions.logout") })
|
2801
|
-
] }) });
|
2802
|
-
};
|
2803
|
-
var Header = () => {
|
2804
|
-
const { t: t2 } = useTranslation9();
|
2805
|
-
const { store, isPending, isError, error } = useStore();
|
2806
|
-
const name = store?.name;
|
2807
|
-
const fallback = store?.name?.slice(0, 1).toUpperCase();
|
2808
|
-
const isLoaded = !isPending && !!store && !!name && !!fallback;
|
2809
|
-
if (isError) {
|
2810
|
-
throw error;
|
2811
|
-
}
|
2812
|
-
return /* @__PURE__ */ jsx14("div", { className: "w-full p-3", children: /* @__PURE__ */ jsxs9(DropdownMenu3, { children: [
|
2813
|
-
/* @__PURE__ */ jsxs9(
|
2814
|
-
DropdownMenu3.Trigger,
|
2815
|
-
{
|
2816
|
-
disabled: !isLoaded,
|
2817
|
-
className: clx6(
|
2818
|
-
"bg-ui-bg-subtle transition-fg grid w-full grid-cols-[24px_1fr_15px] items-center gap-x-3 rounded-md p-0.5 pr-2 outline-none",
|
2819
|
-
"hover:bg-ui-bg-subtle-hover",
|
2820
|
-
"data-[state=open]:bg-ui-bg-subtle-hover",
|
2821
|
-
"focus-visible:shadow-borders-focus"
|
2822
|
-
),
|
2823
|
-
children: [
|
2824
|
-
fallback ? /* @__PURE__ */ jsx14(Avatar2, { variant: "squared", size: "xsmall", fallback }) : /* @__PURE__ */ jsx14(Skeleton, { className: "h-6 w-6 rounded-md" }),
|
2825
|
-
/* @__PURE__ */ jsx14("div", { className: "block overflow-hidden text-left", children: name ? /* @__PURE__ */ jsx14(
|
2826
|
-
Text5,
|
2827
|
-
{
|
2828
|
-
size: "small",
|
2829
|
-
weight: "plus",
|
2830
|
-
leading: "compact",
|
2831
|
-
className: "truncate",
|
2832
|
-
children: store.name
|
2833
|
-
}
|
2834
|
-
) : /* @__PURE__ */ jsx14(Skeleton, { className: "h-[9px] w-[120px]" }) }),
|
2835
|
-
/* @__PURE__ */ jsx14(EllipsisHorizontal2, { className: "text-ui-fg-muted" })
|
2836
|
-
]
|
2837
|
-
}
|
2838
|
-
),
|
2839
|
-
isLoaded && /* @__PURE__ */ jsxs9(DropdownMenu3.Content, { className: "w-[var(--radix-dropdown-menu-trigger-width)] min-w-0", children: [
|
2840
|
-
/* @__PURE__ */ jsxs9("div", { className: "flex items-center gap-x-3 px-2 py-1", children: [
|
2841
|
-
/* @__PURE__ */ jsx14(Avatar2, { variant: "squared", size: "small", fallback }),
|
2842
|
-
/* @__PURE__ */ jsxs9("div", { className: "flex flex-col overflow-hidden", children: [
|
2843
|
-
/* @__PURE__ */ jsx14(
|
2844
|
-
Text5,
|
2845
|
-
{
|
2846
|
-
size: "small",
|
2847
|
-
weight: "plus",
|
2848
|
-
leading: "compact",
|
2849
|
-
className: "truncate",
|
2850
|
-
children: name
|
2851
|
-
}
|
2852
|
-
),
|
2853
|
-
/* @__PURE__ */ jsx14(
|
2854
|
-
Text5,
|
2855
|
-
{
|
2856
|
-
size: "xsmall",
|
2857
|
-
leading: "compact",
|
2858
|
-
className: "text-ui-fg-subtle",
|
2859
|
-
children: t2("app.nav.main.store")
|
2860
|
-
}
|
2861
|
-
)
|
2862
|
-
] })
|
2863
|
-
] }),
|
2864
|
-
/* @__PURE__ */ jsx14(DropdownMenu3.Separator, {}),
|
2865
|
-
/* @__PURE__ */ jsx14(DropdownMenu3.Item, { className: "gap-x-2", asChild: true, children: /* @__PURE__ */ jsxs9(Link3, { to: "/settings/store", children: [
|
2866
|
-
/* @__PURE__ */ jsx14(BuildingStorefront, { className: "text-ui-fg-subtle" }),
|
2867
|
-
t2("app.nav.main.storeSettings")
|
2868
|
-
] }) }),
|
2869
|
-
/* @__PURE__ */ jsx14(DropdownMenu3.Separator, {}),
|
2870
|
-
/* @__PURE__ */ jsx14(Logout2, {})
|
2871
|
-
] })
|
2872
|
-
] }) });
|
2873
|
-
};
|
2874
|
-
var useCoreRoutes = () => {
|
2875
|
-
const { t: t2 } = useTranslation9();
|
2876
|
-
return [
|
2877
|
-
{
|
2878
|
-
icon: /* @__PURE__ */ jsx14(ShoppingCart, {}),
|
2879
|
-
label: t2("orders.domain"),
|
2880
|
-
to: "/orders",
|
2881
|
-
items: [
|
2882
|
-
// TODO: Enable when domin is introduced
|
2883
|
-
// {
|
2884
|
-
// label: t("draftOrders.domain"),
|
2885
|
-
// to: "/draft-orders",
|
2886
|
-
// },
|
2887
|
-
]
|
2888
|
-
},
|
2889
|
-
{
|
2890
|
-
icon: /* @__PURE__ */ jsx14(Tag, {}),
|
2891
|
-
label: t2("products.domain"),
|
2892
|
-
to: "/products",
|
2893
|
-
items: [
|
2894
|
-
{
|
2895
|
-
label: t2("collections.domain"),
|
2896
|
-
to: "/collections"
|
2897
|
-
},
|
2898
|
-
{
|
2899
|
-
label: t2("categories.domain"),
|
2900
|
-
to: "/categories"
|
2901
|
-
}
|
2902
|
-
// TODO: Enable when domin is introduced
|
2903
|
-
// {
|
2904
|
-
// label: t("giftCards.domain"),
|
2905
|
-
// to: "/gift-cards",
|
2906
|
-
// },
|
2907
|
-
]
|
2908
|
-
},
|
2909
|
-
{
|
2910
|
-
icon: /* @__PURE__ */ jsx14(Buildings, {}),
|
2911
|
-
label: t2("inventory.domain"),
|
2912
|
-
to: "/inventory",
|
2913
|
-
items: [
|
2914
|
-
{
|
2915
|
-
label: t2("reservations.domain"),
|
2916
|
-
to: "/reservations"
|
2917
|
-
}
|
2918
|
-
]
|
2919
|
-
},
|
2920
|
-
{
|
2921
|
-
icon: /* @__PURE__ */ jsx14(Users, {}),
|
2922
|
-
label: t2("customers.domain"),
|
2923
|
-
to: "/customers",
|
2924
|
-
items: [
|
2925
|
-
{
|
2926
|
-
label: t2("customerGroups.domain"),
|
2927
|
-
to: "/customer-groups"
|
2928
|
-
}
|
2929
|
-
]
|
2930
|
-
},
|
2931
|
-
{
|
2932
|
-
icon: /* @__PURE__ */ jsx14(ReceiptPercent, {}),
|
2933
|
-
label: t2("promotions.domain"),
|
2934
|
-
to: "/promotions",
|
2935
|
-
items: [
|
2936
|
-
{
|
2937
|
-
label: t2("campaigns.domain"),
|
2938
|
-
to: "/campaigns"
|
2939
|
-
}
|
2940
|
-
]
|
2941
|
-
},
|
2942
|
-
{
|
2943
|
-
icon: /* @__PURE__ */ jsx14(CurrencyDollar, {}),
|
2944
|
-
label: t2("priceLists.domain"),
|
2945
|
-
to: "/price-lists"
|
2946
|
-
}
|
2947
|
-
];
|
2948
|
-
};
|
2949
|
-
var Searchbar = () => {
|
2950
|
-
const { t: t2 } = useTranslation9();
|
2951
|
-
const { toggleSearch } = useSearch();
|
2952
|
-
return /* @__PURE__ */ jsx14("div", { className: "px-3", children: /* @__PURE__ */ jsxs9(
|
2953
|
-
"button",
|
2954
|
-
{
|
2955
|
-
onClick: toggleSearch,
|
2956
|
-
className: clx6(
|
2957
|
-
"bg-ui-bg-subtle text-ui-fg-subtle flex w-full items-center gap-x-2.5 rounded-md px-2 py-1 outline-none",
|
2958
|
-
"hover:bg-ui-bg-subtle-hover",
|
2959
|
-
"focus-visible:shadow-borders-focus"
|
2960
|
-
),
|
2961
|
-
children: [
|
2962
|
-
/* @__PURE__ */ jsx14(MagnifyingGlass2, {}),
|
2963
|
-
/* @__PURE__ */ jsx14("div", { className: "flex-1 text-left", children: /* @__PURE__ */ jsx14(Text5, { size: "small", leading: "compact", weight: "plus", children: t2("app.search.label") }) }),
|
2964
|
-
/* @__PURE__ */ jsx14(Text5, { size: "small", leading: "compact", className: "text-ui-fg-muted", children: "\u2318K" })
|
2965
|
-
]
|
2966
|
-
}
|
2967
|
-
) });
|
2968
|
-
};
|
2969
|
-
var CoreRouteSection = () => {
|
2970
|
-
const coreRoutes = useCoreRoutes();
|
2971
|
-
const { getMenu } = useDashboardExtension();
|
2972
|
-
const menuItems = getMenu("coreExtensions");
|
2973
|
-
menuItems.forEach((item) => {
|
2974
|
-
if (item.nested) {
|
2975
|
-
const route = coreRoutes.find((route2) => route2.to === item.nested);
|
2976
|
-
if (route) {
|
2977
|
-
route.items?.push(item);
|
2978
|
-
}
|
2979
|
-
}
|
2980
|
-
});
|
2981
|
-
return /* @__PURE__ */ jsxs9("nav", { className: "flex flex-col gap-y-1 py-3", children: [
|
2982
|
-
/* @__PURE__ */ jsx14(Searchbar, {}),
|
2983
|
-
coreRoutes.map((route) => {
|
2984
|
-
return /* @__PURE__ */ jsx14(NavItem, { ...route }, route.to);
|
2985
|
-
})
|
2986
|
-
] });
|
2987
|
-
};
|
2988
|
-
var ExtensionRouteSection = () => {
|
2989
|
-
const { t: t2 } = useTranslation9();
|
2990
|
-
const { getMenu } = useDashboardExtension();
|
2991
|
-
const menuItems = getMenu("coreExtensions").filter((item) => !item.nested);
|
2992
|
-
if (!menuItems.length) {
|
2993
|
-
return null;
|
2994
|
-
}
|
2995
|
-
return /* @__PURE__ */ jsxs9("div", { children: [
|
2996
|
-
/* @__PURE__ */ jsx14("div", { className: "px-3", children: /* @__PURE__ */ jsx14(Divider, { variant: "dashed" }) }),
|
2997
|
-
/* @__PURE__ */ jsx14("div", { className: "flex flex-col gap-y-1 py-3", children: /* @__PURE__ */ jsxs9(RadixCollapsible2.Root, { defaultOpen: true, children: [
|
2998
|
-
/* @__PURE__ */ jsx14("div", { className: "px-4", children: /* @__PURE__ */ jsx14(RadixCollapsible2.Trigger, { asChild: true, className: "group/trigger", children: /* @__PURE__ */ jsxs9("button", { className: "text-ui-fg-subtle flex w-full items-center justify-between px-2", children: [
|
2999
|
-
/* @__PURE__ */ jsx14(Text5, { size: "xsmall", weight: "plus", leading: "compact", children: t2("app.nav.common.extensions") }),
|
3000
|
-
/* @__PURE__ */ jsxs9("div", { className: "text-ui-fg-muted", children: [
|
3001
|
-
/* @__PURE__ */ jsx14(ChevronDownMini, { className: "group-data-[state=open]/trigger:hidden" }),
|
3002
|
-
/* @__PURE__ */ jsx14(MinusMini, { className: "group-data-[state=closed]/trigger:hidden" })
|
3003
|
-
] })
|
3004
|
-
] }) }) }),
|
3005
|
-
/* @__PURE__ */ jsx14(RadixCollapsible2.Content, { children: /* @__PURE__ */ jsx14("nav", { className: "flex flex-col gap-y-0.5 py-1 pb-4", children: menuItems.map((item, i) => {
|
3006
|
-
return /* @__PURE__ */ jsx14(
|
3007
|
-
NavItem,
|
3008
|
-
{
|
3009
|
-
to: item.to,
|
3010
|
-
label: item.label,
|
3011
|
-
icon: item.icon ? item.icon : /* @__PURE__ */ jsx14(SquaresPlus, {}),
|
3012
|
-
items: item.items,
|
3013
|
-
type: "extension"
|
3014
|
-
},
|
3015
|
-
i
|
3016
|
-
);
|
3017
|
-
}) }) })
|
3018
|
-
] }) })
|
3019
|
-
] });
|
3020
|
-
};
|
3021
|
-
var UtilitySection = () => {
|
3022
|
-
const location = useLocation6();
|
3023
|
-
const { t: t2 } = useTranslation9();
|
3024
|
-
return /* @__PURE__ */ jsx14("div", { className: "flex flex-col gap-y-0.5 py-3", children: /* @__PURE__ */ jsx14(
|
3025
|
-
NavItem,
|
3026
|
-
{
|
3027
|
-
label: t2("app.nav.settings.header"),
|
3028
|
-
to: "/settings",
|
3029
|
-
from: location.pathname,
|
3030
|
-
icon: /* @__PURE__ */ jsx14(CogSixTooth, {})
|
3031
|
-
}
|
3032
|
-
) });
|
3033
|
-
};
|
3034
|
-
var UserSection = () => {
|
3035
|
-
return /* @__PURE__ */ jsxs9("div", { children: [
|
3036
|
-
/* @__PURE__ */ jsx14("div", { className: "px-3", children: /* @__PURE__ */ jsx14(Divider, { variant: "dashed" }) }),
|
3037
|
-
/* @__PURE__ */ jsx14(UserMenu, {})
|
3038
|
-
] });
|
3039
|
-
};
|
3040
|
-
|
3041
|
-
// src/components/layout/public-layout/public-layout.tsx
|
3042
|
-
import { Outlet as Outlet3 } from "react-router-dom";
|
3043
|
-
import { jsx as jsx15 } from "react/jsx-runtime";
|
3044
|
-
var PublicLayout = () => {
|
3045
|
-
return /* @__PURE__ */ jsx15(Outlet3, {});
|
3046
|
-
};
|
3047
|
-
|
3048
|
-
// src/components/layout/settings-layout/settings-layout.tsx
|
3049
|
-
import { ArrowUturnLeft as ArrowUturnLeft2, MinusMini as MinusMini2 } from "@medusajs/icons";
|
3050
|
-
import { clx as clx7, Divider as Divider2, IconButton as IconButton5, Text as Text6 } from "@medusajs/ui";
|
3051
|
-
import { Collapsible as RadixCollapsible3 } from "radix-ui";
|
3052
|
-
import { Fragment as Fragment3, useEffect as useEffect11, useMemo as useMemo5, useState as useState12 } from "react";
|
3053
|
-
import { useTranslation as useTranslation10 } from "react-i18next";
|
3054
|
-
import { Link as Link4, useLocation as useLocation7 } from "react-router-dom";
|
3055
|
-
import { jsx as jsx16, jsxs as jsxs10 } from "react/jsx-runtime";
|
3056
|
-
var SettingsLayout = () => {
|
3057
|
-
return /* @__PURE__ */ jsx16(Shell, { children: /* @__PURE__ */ jsx16(SettingsSidebar, {}) });
|
3058
|
-
};
|
3059
|
-
var useSettingRoutes = () => {
|
3060
|
-
const { t: t2 } = useTranslation10();
|
3061
|
-
return useMemo5(
|
3062
|
-
() => [
|
3063
|
-
{
|
3064
|
-
label: t2("store.domain"),
|
3065
|
-
to: "/settings/store"
|
3066
|
-
},
|
3067
|
-
{
|
3068
|
-
label: t2("users.domain"),
|
3069
|
-
to: "/settings/users"
|
3070
|
-
},
|
3071
|
-
{
|
3072
|
-
label: t2("regions.domain"),
|
3073
|
-
to: "/settings/regions"
|
3074
|
-
},
|
3075
|
-
{
|
3076
|
-
label: t2("taxRegions.domain"),
|
3077
|
-
to: "/settings/tax-regions"
|
3078
|
-
},
|
3079
|
-
{
|
3080
|
-
label: t2("returnReasons.domain"),
|
3081
|
-
to: "/settings/return-reasons"
|
3082
|
-
},
|
3083
|
-
{
|
3084
|
-
label: t2("salesChannels.domain"),
|
3085
|
-
to: "/settings/sales-channels"
|
3086
|
-
},
|
3087
|
-
{
|
3088
|
-
label: t2("productTypes.domain"),
|
3089
|
-
to: "/settings/product-types"
|
3090
|
-
},
|
3091
|
-
{
|
3092
|
-
label: t2("productTags.domain"),
|
3093
|
-
to: "/settings/product-tags"
|
3094
|
-
},
|
3095
|
-
{
|
3096
|
-
label: t2("stockLocations.domain"),
|
3097
|
-
to: "/settings/locations"
|
3098
|
-
}
|
3099
|
-
],
|
3100
|
-
[t2]
|
3101
|
-
);
|
3102
|
-
};
|
3103
|
-
var useDeveloperRoutes = () => {
|
3104
|
-
const { t: t2 } = useTranslation10();
|
3105
|
-
return useMemo5(
|
3106
|
-
() => [
|
3107
|
-
{
|
3108
|
-
label: t2("apiKeyManagement.domain.publishable"),
|
3109
|
-
to: "/settings/publishable-api-keys"
|
3110
|
-
},
|
3111
|
-
{
|
3112
|
-
label: t2("apiKeyManagement.domain.secret"),
|
3113
|
-
to: "/settings/secret-api-keys"
|
3114
|
-
},
|
3115
|
-
{
|
3116
|
-
label: t2("workflowExecutions.domain"),
|
3117
|
-
to: "/settings/workflows"
|
3118
|
-
}
|
3119
|
-
],
|
3120
|
-
[t2]
|
3121
|
-
);
|
3122
|
-
};
|
3123
|
-
var useMyAccountRoutes = () => {
|
3124
|
-
const { t: t2 } = useTranslation10();
|
3125
|
-
return useMemo5(
|
3126
|
-
() => [
|
3127
|
-
{
|
3128
|
-
label: t2("profile.domain"),
|
3129
|
-
to: "/settings/profile"
|
3130
|
-
}
|
3131
|
-
],
|
3132
|
-
[t2]
|
3133
|
-
);
|
3134
|
-
};
|
3135
|
-
var getSafeFromValue = (from) => {
|
3136
|
-
if (from.startsWith("/settings")) {
|
3137
|
-
return "/orders";
|
3138
|
-
}
|
3139
|
-
return from;
|
3140
|
-
};
|
3141
|
-
var SettingsSidebar = () => {
|
3142
|
-
const { getMenu } = useDashboardExtension();
|
3143
|
-
const routes3 = useSettingRoutes();
|
3144
|
-
const developerRoutes = useDeveloperRoutes();
|
3145
|
-
const myAccountRoutes = useMyAccountRoutes();
|
3146
|
-
const extensionRoutes = getMenu("settingsExtensions");
|
3147
|
-
const { t: t2 } = useTranslation10();
|
3148
|
-
return /* @__PURE__ */ jsxs10("aside", { className: "relative flex flex-1 flex-col justify-between overflow-y-auto", children: [
|
3149
|
-
/* @__PURE__ */ jsxs10("div", { className: "bg-ui-bg-subtle sticky top-0", children: [
|
3150
|
-
/* @__PURE__ */ jsx16(Header2, {}),
|
3151
|
-
/* @__PURE__ */ jsx16("div", { className: "flex items-center justify-center px-3", children: /* @__PURE__ */ jsx16(Divider2, { variant: "dashed" }) })
|
3152
|
-
] }),
|
3153
|
-
/* @__PURE__ */ jsxs10("div", { className: "flex flex-1 flex-col", children: [
|
3154
|
-
/* @__PURE__ */ jsxs10("div", { className: "flex flex-1 flex-col overflow-y-auto", children: [
|
3155
|
-
/* @__PURE__ */ jsx16(
|
3156
|
-
RadixCollapsibleSection,
|
3157
|
-
{
|
3158
|
-
label: t2("app.nav.settings.general"),
|
3159
|
-
items: routes3
|
3160
|
-
}
|
3161
|
-
),
|
3162
|
-
/* @__PURE__ */ jsx16("div", { className: "flex items-center justify-center px-3", children: /* @__PURE__ */ jsx16(Divider2, { variant: "dashed" }) }),
|
3163
|
-
/* @__PURE__ */ jsx16(
|
3164
|
-
RadixCollapsibleSection,
|
3165
|
-
{
|
3166
|
-
label: t2("app.nav.settings.developer"),
|
3167
|
-
items: developerRoutes
|
3168
|
-
}
|
3169
|
-
),
|
3170
|
-
/* @__PURE__ */ jsx16("div", { className: "flex items-center justify-center px-3", children: /* @__PURE__ */ jsx16(Divider2, { variant: "dashed" }) }),
|
3171
|
-
/* @__PURE__ */ jsx16(
|
3172
|
-
RadixCollapsibleSection,
|
3173
|
-
{
|
3174
|
-
label: t2("app.nav.settings.myAccount"),
|
3175
|
-
items: myAccountRoutes
|
3176
|
-
}
|
3177
|
-
),
|
3178
|
-
extensionRoutes.length > 0 && /* @__PURE__ */ jsxs10(Fragment3, { children: [
|
3179
|
-
/* @__PURE__ */ jsx16("div", { className: "flex items-center justify-center px-3", children: /* @__PURE__ */ jsx16(Divider2, { variant: "dashed" }) }),
|
3180
|
-
/* @__PURE__ */ jsx16(
|
3181
|
-
RadixCollapsibleSection,
|
3182
|
-
{
|
3183
|
-
label: t2("app.nav.common.extensions"),
|
3184
|
-
items: extensionRoutes
|
3185
|
-
}
|
3186
|
-
)
|
3187
|
-
] })
|
3188
|
-
] }),
|
3189
|
-
/* @__PURE__ */ jsx16("div", { className: "bg-ui-bg-subtle sticky bottom-0", children: /* @__PURE__ */ jsx16(UserSection2, {}) })
|
3190
|
-
] })
|
3191
|
-
] });
|
3192
|
-
};
|
3193
|
-
var Header2 = () => {
|
3194
|
-
const [from, setFrom] = useState12("/orders");
|
3195
|
-
const { t: t2 } = useTranslation10();
|
3196
|
-
const location = useLocation7();
|
3197
|
-
useEffect11(() => {
|
3198
|
-
if (location.state?.from) {
|
3199
|
-
setFrom(getSafeFromValue(location.state.from));
|
3200
|
-
}
|
3201
|
-
}, [location]);
|
3202
|
-
return /* @__PURE__ */ jsx16("div", { className: "bg-ui-bg-subtle p-3", children: /* @__PURE__ */ jsx16(
|
3203
|
-
Link4,
|
3204
|
-
{
|
3205
|
-
to: from,
|
3206
|
-
replace: true,
|
3207
|
-
className: clx7(
|
3208
|
-
"bg-ui-bg-subtle transition-fg flex items-center rounded-md outline-none",
|
3209
|
-
"hover:bg-ui-bg-subtle-hover",
|
3210
|
-
"focus-visible:shadow-borders-focus"
|
3211
|
-
),
|
3212
|
-
children: /* @__PURE__ */ jsxs10("div", { className: "flex items-center gap-x-2.5 px-2 py-1", children: [
|
3213
|
-
/* @__PURE__ */ jsx16("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ jsx16(ArrowUturnLeft2, { className: "text-ui-fg-subtle" }) }),
|
3214
|
-
/* @__PURE__ */ jsx16(Text6, { leading: "compact", weight: "plus", size: "small", children: t2("app.nav.settings.header") })
|
3215
|
-
] })
|
3216
|
-
}
|
3217
|
-
) });
|
3218
|
-
};
|
3219
|
-
var RadixCollapsibleSection = ({
|
3220
|
-
label,
|
3221
|
-
items
|
3222
|
-
}) => {
|
3223
|
-
return /* @__PURE__ */ jsxs10(RadixCollapsible3.Root, { defaultOpen: true, className: "py-3", children: [
|
3224
|
-
/* @__PURE__ */ jsx16("div", { className: "px-3", children: /* @__PURE__ */ jsxs10("div", { className: "text-ui-fg-muted flex h-7 items-center justify-between px-2", children: [
|
3225
|
-
/* @__PURE__ */ jsx16(Text6, { size: "small", leading: "compact", children: label }),
|
3226
|
-
/* @__PURE__ */ jsx16(RadixCollapsible3.Trigger, { asChild: true, children: /* @__PURE__ */ jsx16(IconButton5, { size: "2xsmall", variant: "transparent", className: "static", children: /* @__PURE__ */ jsx16(MinusMini2, { className: "text-ui-fg-muted" }) }) })
|
3227
|
-
] }) }),
|
3228
|
-
/* @__PURE__ */ jsx16(RadixCollapsible3.Content, { children: /* @__PURE__ */ jsx16("div", { className: "pt-0.5", children: /* @__PURE__ */ jsx16("nav", { className: "flex flex-col gap-y-0.5", children: items.map((setting) => /* @__PURE__ */ jsx16(NavItem, { type: "setting", ...setting }, setting.to)) }) }) })
|
3229
|
-
] });
|
3230
|
-
};
|
3231
|
-
var UserSection2 = () => {
|
3232
|
-
return /* @__PURE__ */ jsxs10("div", { children: [
|
3233
|
-
/* @__PURE__ */ jsx16("div", { className: "px-3", children: /* @__PURE__ */ jsx16(Divider2, { variant: "dashed" }) }),
|
3234
|
-
/* @__PURE__ */ jsx16(UserMenu, {})
|
3235
|
-
] });
|
3236
|
-
};
|
3237
|
-
|
3238
|
-
// src/providers/router-provider/route-extensions.tsx
|
3239
|
-
import routeModule from "virtual:medusa/routes";
|
3240
|
-
var routes = getRouteExtensions(routeModule, "core");
|
3241
|
-
var RouteExtensions = createRouteMap(routes);
|
3242
|
-
|
3243
|
-
// src/providers/router-provider/settings-extensions.tsx
|
3244
|
-
import routeModule2 from "virtual:medusa/routes";
|
3245
|
-
var routes2 = getRouteExtensions(routeModule2, "settings");
|
3246
|
-
var SettingsExtensions = createRouteMap(routes2, "/settings");
|
3247
|
-
|
3248
|
-
// src/providers/router-provider/route-map.tsx
|
3249
|
-
import { jsx as jsx17 } from "react/jsx-runtime";
|
3250
|
-
var RouteMap = [
|
3251
|
-
{
|
3252
|
-
element: /* @__PURE__ */ jsx17(ProtectedRoute, {}),
|
3253
|
-
errorElement: /* @__PURE__ */ jsx17(ErrorBoundary, {}),
|
3254
|
-
children: [
|
3255
|
-
{
|
3256
|
-
element: /* @__PURE__ */ jsx17(MainLayout, {}),
|
3257
|
-
children: [
|
3258
|
-
{
|
3259
|
-
path: "/",
|
3260
|
-
errorElement: /* @__PURE__ */ jsx17(ErrorBoundary, {}),
|
3261
|
-
lazy: () => import("./home-KSB2J7CS.mjs")
|
3262
|
-
},
|
3263
|
-
{
|
3264
|
-
path: "/products",
|
3265
|
-
errorElement: /* @__PURE__ */ jsx17(ErrorBoundary, {}),
|
3266
|
-
handle: {
|
3267
|
-
breadcrumb: () => t("products.domain")
|
3268
|
-
},
|
3269
|
-
children: [
|
3270
|
-
{
|
3271
|
-
path: "",
|
3272
|
-
lazy: () => import("./product-list-XOFUYF5S.mjs"),
|
3273
|
-
children: [
|
3274
|
-
{
|
3275
|
-
path: "create",
|
3276
|
-
lazy: () => import("./product-create-P7U26TXX.mjs")
|
3277
|
-
},
|
3278
|
-
{
|
3279
|
-
path: "import",
|
3280
|
-
lazy: () => import("./product-import-YY2EXFLI.mjs")
|
3281
|
-
},
|
3282
|
-
{
|
3283
|
-
path: "export",
|
3284
|
-
lazy: () => import("./product-export-JGH4CULP.mjs")
|
3285
|
-
}
|
3286
|
-
]
|
3287
|
-
},
|
3288
|
-
{
|
3289
|
-
path: ":id",
|
3290
|
-
errorElement: /* @__PURE__ */ jsx17(ErrorBoundary, {}),
|
3291
|
-
lazy: async () => {
|
3292
|
-
const { Breadcrumb, loader } = await import("./product-detail-6LXT2IIU.mjs");
|
3293
|
-
return {
|
3294
|
-
Component: Outlet4,
|
3295
|
-
loader,
|
3296
|
-
handle: {
|
3297
|
-
breadcrumb: (match) => /* @__PURE__ */ jsx17(Breadcrumb, { ...match })
|
3298
|
-
}
|
3299
|
-
};
|
3300
|
-
},
|
3301
|
-
children: [
|
3302
|
-
{
|
3303
|
-
path: "",
|
3304
|
-
lazy: () => import("./product-detail-6LXT2IIU.mjs"),
|
3305
|
-
children: [
|
3306
|
-
{
|
3307
|
-
path: "edit",
|
3308
|
-
lazy: () => import("./product-edit-IDL5IGVQ.mjs")
|
3309
|
-
},
|
3310
|
-
{
|
3311
|
-
path: "edit-variant",
|
3312
|
-
lazy: () => import("./product-variant-edit-7FZ7PQ6U.mjs")
|
3313
|
-
},
|
3314
|
-
{
|
3315
|
-
path: "sales-channels",
|
3316
|
-
lazy: () => import("./product-sales-channels-MKWZD4NM.mjs")
|
3317
|
-
},
|
3318
|
-
{
|
3319
|
-
path: "attributes",
|
3320
|
-
lazy: () => import("./product-attributes-WLWSFTCO.mjs")
|
3321
|
-
},
|
3322
|
-
{
|
3323
|
-
path: "organization",
|
3324
|
-
lazy: () => import("./product-organization-6N7JBWH5.mjs")
|
3325
|
-
},
|
3326
|
-
{
|
3327
|
-
path: "shipping-profile",
|
3328
|
-
lazy: () => import("./product-shipping-profile-EK6G3NTZ.mjs")
|
3329
|
-
},
|
3330
|
-
{
|
3331
|
-
path: "media",
|
3332
|
-
lazy: () => import("./product-media-RSCMACQU.mjs")
|
3333
|
-
},
|
3334
|
-
{
|
3335
|
-
path: "prices",
|
3336
|
-
lazy: () => import("./product-prices-NPJIYAIK.mjs")
|
3337
|
-
},
|
3338
|
-
{
|
3339
|
-
path: "options/create",
|
3340
|
-
lazy: () => import("./product-create-option-ISAGA5KO.mjs")
|
3341
|
-
},
|
3342
|
-
{
|
3343
|
-
path: "options/:option_id/edit",
|
3344
|
-
lazy: () => import("./product-edit-option-6ZGZKU5G.mjs")
|
3345
|
-
},
|
3346
|
-
{
|
3347
|
-
path: "variants/create",
|
3348
|
-
lazy: () => import("./product-create-variant-ZQKPGLQQ.mjs")
|
3349
|
-
},
|
3350
|
-
{
|
3351
|
-
path: "stock",
|
3352
|
-
lazy: () => import("./product-stock-L3FRYPQS.mjs")
|
3353
|
-
},
|
3354
|
-
{
|
3355
|
-
path: "metadata/edit",
|
3356
|
-
lazy: () => import("./product-metadata-EW6JGOKL.mjs")
|
3357
|
-
}
|
3358
|
-
]
|
3359
|
-
},
|
3360
|
-
{
|
3361
|
-
path: "variants/:variant_id",
|
3362
|
-
lazy: async () => {
|
3363
|
-
const { Component, Breadcrumb, loader } = await import("./product-variant-detail-3XZBP2QJ.mjs");
|
3364
|
-
return {
|
3365
|
-
Component,
|
3366
|
-
loader,
|
3367
|
-
handle: {
|
3368
|
-
breadcrumb: (match) => /* @__PURE__ */ jsx17(Breadcrumb, { ...match })
|
3369
|
-
}
|
3370
|
-
};
|
3371
|
-
},
|
3372
|
-
children: [
|
3373
|
-
{
|
3374
|
-
path: "edit",
|
3375
|
-
lazy: () => import("./product-variant-edit-7FZ7PQ6U.mjs")
|
3376
|
-
},
|
3377
|
-
{
|
3378
|
-
path: "prices",
|
3379
|
-
lazy: () => import("./product-prices-NPJIYAIK.mjs")
|
3380
|
-
},
|
3381
|
-
{
|
3382
|
-
path: "manage-items",
|
3383
|
-
lazy: () => import("./product-variant-manage-inventory-items-PRFQHHZD.mjs")
|
3384
|
-
},
|
3385
|
-
{
|
3386
|
-
path: "metadata/edit",
|
3387
|
-
lazy: () => import("./product-variant-metadata-PY76KWCU.mjs")
|
3388
|
-
}
|
3389
|
-
]
|
3390
|
-
}
|
3391
|
-
]
|
3392
|
-
}
|
3393
|
-
]
|
3394
|
-
},
|
3395
|
-
{
|
3396
|
-
path: "/categories",
|
3397
|
-
errorElement: /* @__PURE__ */ jsx17(ErrorBoundary, {}),
|
3398
|
-
handle: {
|
3399
|
-
breadcrumb: () => t("categories.domain")
|
3400
|
-
},
|
3401
|
-
children: [
|
3402
|
-
{
|
3403
|
-
path: "",
|
3404
|
-
lazy: () => import("./category-list-6WTV4T7D.mjs"),
|
3405
|
-
children: [
|
3406
|
-
{
|
3407
|
-
path: "create",
|
3408
|
-
lazy: () => import("./category-create-ULKTNF7N.mjs")
|
3409
|
-
},
|
3410
|
-
{
|
3411
|
-
path: "organize",
|
3412
|
-
lazy: () => import("./category-organize-OPDZY4YR.mjs")
|
3413
|
-
}
|
3414
|
-
]
|
3415
|
-
},
|
3416
|
-
{
|
3417
|
-
path: ":id",
|
3418
|
-
lazy: async () => {
|
3419
|
-
const { Component, Breadcrumb, loader } = await import("./category-detail-Z6GWCJUW.mjs");
|
3420
|
-
return {
|
3421
|
-
Component,
|
3422
|
-
loader,
|
3423
|
-
handle: {
|
3424
|
-
breadcrumb: (match) => /* @__PURE__ */ jsx17(Breadcrumb, { ...match })
|
3425
|
-
}
|
3426
|
-
};
|
3427
|
-
},
|
3428
|
-
children: [
|
3429
|
-
{
|
3430
|
-
path: "edit",
|
3431
|
-
lazy: () => import("./category-edit-HTC6237J.mjs")
|
3432
|
-
},
|
3433
|
-
{
|
3434
|
-
path: "products",
|
3435
|
-
lazy: () => import("./category-products-ND7PSI4Q.mjs")
|
3436
|
-
},
|
3437
|
-
{
|
3438
|
-
path: "organize",
|
3439
|
-
lazy: () => import("./category-organize-OPDZY4YR.mjs")
|
3440
|
-
},
|
3441
|
-
{
|
3442
|
-
path: "metadata/edit",
|
3443
|
-
lazy: () => import("./categories-metadata-D3EM5VK2.mjs")
|
3444
|
-
}
|
3445
|
-
]
|
3446
|
-
}
|
3447
|
-
]
|
3448
|
-
},
|
3449
|
-
{
|
3450
|
-
path: "/orders",
|
3451
|
-
errorElement: /* @__PURE__ */ jsx17(ErrorBoundary, {}),
|
3452
|
-
handle: {
|
3453
|
-
breadcrumb: () => t("orders.domain")
|
3454
|
-
},
|
3455
|
-
children: [
|
3456
|
-
{
|
3457
|
-
path: "",
|
3458
|
-
lazy: () => import("./order-list-IMVPWMTQ.mjs")
|
3459
|
-
},
|
3460
|
-
{
|
3461
|
-
path: ":id",
|
3462
|
-
lazy: async () => {
|
3463
|
-
const { Component, Breadcrumb, loader } = await import("./order-detail-YYP4INKH.mjs");
|
3464
|
-
return {
|
3465
|
-
Component,
|
3466
|
-
loader,
|
3467
|
-
handle: {
|
3468
|
-
breadcrumb: (match) => /* @__PURE__ */ jsx17(Breadcrumb, { ...match })
|
3469
|
-
}
|
3470
|
-
};
|
3471
|
-
},
|
3472
|
-
children: [
|
3473
|
-
{
|
3474
|
-
path: "fulfillment",
|
3475
|
-
lazy: () => import("./order-create-fulfillment-K5DFAWHB.mjs")
|
3476
|
-
},
|
3477
|
-
{
|
3478
|
-
path: "returns/:return_id/receive",
|
3479
|
-
lazy: () => import("./order-receive-return-2NBMNVBR.mjs")
|
3480
|
-
},
|
3481
|
-
{
|
3482
|
-
path: "allocate-items",
|
3483
|
-
lazy: () => import("./order-allocate-items-6HPR2T5L.mjs")
|
3484
|
-
},
|
3485
|
-
{
|
3486
|
-
path: ":f_id/create-shipment",
|
3487
|
-
lazy: () => import("./order-create-shipment-CCH6V3U6.mjs")
|
3488
|
-
},
|
3489
|
-
{
|
3490
|
-
path: "returns",
|
3491
|
-
lazy: () => import("./order-create-return-PJ3LFXDG.mjs")
|
3492
|
-
},
|
3493
|
-
{
|
3494
|
-
path: "claims",
|
3495
|
-
lazy: () => import("./order-create-claim-FFWV762A.mjs")
|
3496
|
-
},
|
3497
|
-
{
|
3498
|
-
path: "exchanges",
|
3499
|
-
lazy: () => import("./order-create-exchange-3OVNNNW3.mjs")
|
3500
|
-
},
|
3501
|
-
{
|
3502
|
-
path: "edits",
|
3503
|
-
lazy: () => import("./order-create-edit-LS3ARJDM.mjs")
|
3504
|
-
},
|
3505
|
-
{
|
3506
|
-
path: "refund",
|
3507
|
-
lazy: () => import("./order-create-refund-2D46DG3T.mjs")
|
3508
|
-
},
|
3509
|
-
{
|
3510
|
-
path: "transfer",
|
3511
|
-
lazy: () => import("./order-request-transfer-U5OYJEI6.mjs")
|
3512
|
-
},
|
3513
|
-
{
|
3514
|
-
path: "email",
|
3515
|
-
lazy: () => import("./order-edit-email-C5AMYZDN.mjs")
|
3516
|
-
},
|
3517
|
-
{
|
3518
|
-
path: "shipping-address",
|
3519
|
-
lazy: () => import("./order-edit-shipping-address-T6I4D234.mjs")
|
3520
|
-
},
|
3521
|
-
{
|
3522
|
-
path: "billing-address",
|
3523
|
-
lazy: () => import("./order-edit-billing-address-3PYGDUWT.mjs")
|
3524
|
-
},
|
3525
|
-
{
|
3526
|
-
path: "metadata/edit",
|
3527
|
-
lazy: () => import("./order-metadata-DRR355QQ.mjs")
|
3528
|
-
}
|
3529
|
-
]
|
3530
|
-
}
|
3531
|
-
]
|
3532
|
-
},
|
3533
|
-
{
|
3534
|
-
path: "/promotions",
|
3535
|
-
errorElement: /* @__PURE__ */ jsx17(ErrorBoundary, {}),
|
3536
|
-
handle: {
|
3537
|
-
breadcrumb: () => t("promotions.domain")
|
3538
|
-
},
|
3539
|
-
children: [
|
3540
|
-
{
|
3541
|
-
path: "",
|
3542
|
-
lazy: () => import("./promotion-list-6PKG7DBB.mjs")
|
3543
|
-
},
|
3544
|
-
{
|
3545
|
-
path: "create",
|
3546
|
-
lazy: () => import("./promotion-create-DUY3VRR7.mjs")
|
3547
|
-
},
|
3548
|
-
{
|
3549
|
-
path: ":id",
|
3550
|
-
lazy: async () => {
|
3551
|
-
const { Component, Breadcrumb, loader } = await import("./promotion-detail-KUVY3KBM.mjs");
|
3552
|
-
return {
|
3553
|
-
Component,
|
3554
|
-
loader,
|
3555
|
-
handle: {
|
3556
|
-
breadcrumb: (match) => /* @__PURE__ */ jsx17(Breadcrumb, { ...match })
|
3557
|
-
}
|
3558
|
-
};
|
3559
|
-
},
|
3560
|
-
children: [
|
3561
|
-
{
|
3562
|
-
path: "edit",
|
3563
|
-
lazy: () => import("./promotion-edit-details-6BZF724F.mjs")
|
3564
|
-
},
|
3565
|
-
{
|
3566
|
-
path: "add-to-campaign",
|
3567
|
-
lazy: () => import("./promotion-add-campaign-YG4T32AU.mjs")
|
3568
|
-
},
|
3569
|
-
{
|
3570
|
-
path: ":ruleType/edit",
|
3571
|
-
lazy: () => import("./edit-rules-6XNJL6AE.mjs")
|
3572
|
-
}
|
3573
|
-
]
|
3574
|
-
}
|
3575
|
-
]
|
3576
|
-
},
|
3577
|
-
{
|
3578
|
-
path: "/campaigns",
|
3579
|
-
errorElement: /* @__PURE__ */ jsx17(ErrorBoundary, {}),
|
3580
|
-
handle: {
|
3581
|
-
breadcrumb: () => t("campaigns.domain")
|
3582
|
-
},
|
3583
|
-
children: [
|
3584
|
-
{
|
3585
|
-
path: "",
|
3586
|
-
lazy: () => import("./campaign-list-6TW2SO7C.mjs"),
|
3587
|
-
children: []
|
3588
|
-
},
|
3589
|
-
{
|
3590
|
-
path: "create",
|
3591
|
-
lazy: () => import("./campaign-create-WKVDJFQC.mjs")
|
3592
|
-
},
|
3593
|
-
{
|
3594
|
-
path: ":id",
|
3595
|
-
lazy: async () => {
|
3596
|
-
const { Component, Breadcrumb, loader } = await import("./campaign-detail-PGM2SOEA.mjs");
|
3597
|
-
return {
|
3598
|
-
Component,
|
3599
|
-
loader,
|
3600
|
-
handle: {
|
3601
|
-
breadcrumb: (match) => /* @__PURE__ */ jsx17(Breadcrumb, { ...match })
|
3602
|
-
}
|
3603
|
-
};
|
3604
|
-
},
|
3605
|
-
children: [
|
3606
|
-
{
|
3607
|
-
path: "edit",
|
3608
|
-
lazy: () => import("./campaign-edit-NRN4EBJC.mjs")
|
3609
|
-
},
|
3610
|
-
{
|
3611
|
-
path: "configuration",
|
3612
|
-
lazy: () => import("./campaign-configuration-XITAHVHN.mjs")
|
3613
|
-
},
|
3614
|
-
{
|
3615
|
-
path: "edit-budget",
|
3616
|
-
lazy: () => import("./campaign-budget-edit-7MSDQ3MH.mjs")
|
3617
|
-
},
|
3618
|
-
{
|
3619
|
-
path: "add-promotions",
|
3620
|
-
lazy: () => import("./add-campaign-promotions-YQ6JJK6I.mjs")
|
3621
|
-
}
|
3622
|
-
]
|
3623
|
-
}
|
3624
|
-
]
|
3625
|
-
},
|
3626
|
-
{
|
3627
|
-
path: "/collections",
|
3628
|
-
errorElement: /* @__PURE__ */ jsx17(ErrorBoundary, {}),
|
3629
|
-
handle: {
|
3630
|
-
breadcrumb: () => t("collections.domain")
|
3631
|
-
},
|
3632
|
-
children: [
|
3633
|
-
{
|
3634
|
-
path: "",
|
3635
|
-
lazy: () => import("./collection-list-2AFD2BXW.mjs"),
|
3636
|
-
children: [
|
3637
|
-
{
|
3638
|
-
path: "create",
|
3639
|
-
lazy: () => import("./collection-create-NLRAIKZP.mjs")
|
3640
|
-
}
|
3641
|
-
]
|
3642
|
-
},
|
3643
|
-
{
|
3644
|
-
path: ":id",
|
3645
|
-
lazy: async () => {
|
3646
|
-
const { Component, Breadcrumb, loader } = await import("./collection-detail-AZZ2NT4L.mjs");
|
3647
|
-
return {
|
3648
|
-
Component,
|
3649
|
-
loader,
|
3650
|
-
handle: {
|
3651
|
-
breadcrumb: (match) => /* @__PURE__ */ jsx17(Breadcrumb, { ...match })
|
3652
|
-
}
|
3653
|
-
};
|
3654
|
-
},
|
3655
|
-
children: [
|
3656
|
-
{
|
3657
|
-
path: "edit",
|
3658
|
-
lazy: () => import("./collection-edit-WO54XZLV.mjs")
|
3659
|
-
},
|
3660
|
-
{
|
3661
|
-
path: "products",
|
3662
|
-
lazy: () => import("./collection-add-products-KGBBZFCE.mjs")
|
3663
|
-
},
|
3664
|
-
{
|
3665
|
-
path: "metadata/edit",
|
3666
|
-
lazy: () => import("./collection-metadata-XSJPOGIP.mjs")
|
3667
|
-
}
|
3668
|
-
]
|
3669
|
-
}
|
3670
|
-
]
|
3671
|
-
},
|
3672
|
-
{
|
3673
|
-
path: "/price-lists",
|
3674
|
-
errorElement: /* @__PURE__ */ jsx17(ErrorBoundary, {}),
|
3675
|
-
handle: {
|
3676
|
-
breadcrumb: () => t("priceLists.domain")
|
3677
|
-
},
|
3678
|
-
children: [
|
3679
|
-
{
|
3680
|
-
path: "",
|
3681
|
-
lazy: () => import("./price-list-list-XPNVK6IC.mjs"),
|
3682
|
-
children: [
|
3683
|
-
{
|
3684
|
-
path: "create",
|
3685
|
-
lazy: () => import("./price-list-create-QKTF4G3M.mjs")
|
3686
|
-
}
|
3687
|
-
]
|
3688
|
-
},
|
3689
|
-
{
|
3690
|
-
path: ":id",
|
3691
|
-
lazy: async () => {
|
3692
|
-
const { Component, Breadcrumb, loader } = await import("./price-list-detail-G5Y3VVRK.mjs");
|
3693
|
-
return {
|
3694
|
-
Component,
|
3695
|
-
loader,
|
3696
|
-
handle: {
|
3697
|
-
breadcrumb: (match) => /* @__PURE__ */ jsx17(Breadcrumb, { ...match })
|
3698
|
-
}
|
3699
|
-
};
|
3700
|
-
},
|
3701
|
-
children: [
|
3702
|
-
{
|
3703
|
-
path: "edit",
|
3704
|
-
lazy: () => import("./price-list-edit-OFFEMUHG.mjs")
|
3705
|
-
},
|
3706
|
-
{
|
3707
|
-
path: "configuration",
|
3708
|
-
lazy: () => import("./price-list-configuration-6OHKVV2W.mjs")
|
3709
|
-
},
|
3710
|
-
{
|
3711
|
-
path: "products/add",
|
3712
|
-
lazy: () => import("./price-list-prices-add-NIFFLI7Y.mjs")
|
3713
|
-
},
|
3714
|
-
{
|
3715
|
-
path: "products/edit",
|
3716
|
-
lazy: () => import("./price-list-prices-edit-KAEE6YLB.mjs")
|
3717
|
-
}
|
3718
|
-
]
|
3719
|
-
}
|
3720
|
-
]
|
3721
|
-
},
|
3722
|
-
{
|
3723
|
-
path: "/customers",
|
3724
|
-
errorElement: /* @__PURE__ */ jsx17(ErrorBoundary, {}),
|
3725
|
-
handle: {
|
3726
|
-
breadcrumb: () => t("customers.domain")
|
3727
|
-
},
|
3728
|
-
children: [
|
3729
|
-
{
|
3730
|
-
path: "",
|
3731
|
-
lazy: () => import("./customer-list-JAKCVGFG.mjs"),
|
3732
|
-
children: [
|
3733
|
-
{
|
3734
|
-
path: "create",
|
3735
|
-
lazy: () => import("./customer-create-AJYD5CIA.mjs")
|
3736
|
-
}
|
3737
|
-
]
|
3738
|
-
},
|
3739
|
-
{
|
3740
|
-
path: ":id",
|
3741
|
-
lazy: async () => {
|
3742
|
-
const { Component, Breadcrumb, loader } = await import("./customer-detail-MWT2NNQK.mjs");
|
3743
|
-
return {
|
3744
|
-
Component,
|
3745
|
-
loader,
|
3746
|
-
handle: {
|
3747
|
-
breadcrumb: (match) => /* @__PURE__ */ jsx17(Breadcrumb, { ...match })
|
3748
|
-
}
|
3749
|
-
};
|
3750
|
-
},
|
3751
|
-
children: [
|
3752
|
-
{
|
3753
|
-
path: "edit",
|
3754
|
-
lazy: () => import("./customer-edit-566R4FAT.mjs")
|
3755
|
-
},
|
3756
|
-
{
|
3757
|
-
path: "add-customer-groups",
|
3758
|
-
lazy: () => import("./customers-add-customer-group-6TEWBPIE.mjs")
|
3759
|
-
},
|
3760
|
-
{
|
3761
|
-
path: ":order_id/transfer",
|
3762
|
-
lazy: () => import("./order-request-transfer-U5OYJEI6.mjs")
|
3763
|
-
},
|
3764
|
-
{
|
3765
|
-
path: "metadata/edit",
|
3766
|
-
lazy: () => import("./customer-metadata-RO5DVFXZ.mjs")
|
3767
|
-
}
|
3768
|
-
]
|
3769
|
-
}
|
3770
|
-
]
|
3771
|
-
},
|
3772
|
-
{
|
3773
|
-
path: "/customer-groups",
|
3774
|
-
errorElement: /* @__PURE__ */ jsx17(ErrorBoundary, {}),
|
3775
|
-
handle: {
|
3776
|
-
breadcrumb: () => t("customerGroups.domain")
|
3777
|
-
},
|
3778
|
-
children: [
|
3779
|
-
{
|
3780
|
-
path: "",
|
3781
|
-
lazy: () => import("./customer-group-list-LZSSOYBR.mjs"),
|
3782
|
-
children: [
|
3783
|
-
{
|
3784
|
-
path: "create",
|
3785
|
-
lazy: () => import("./customer-group-create-XTXMFKFX.mjs")
|
3786
|
-
}
|
3787
|
-
]
|
3788
|
-
},
|
3789
|
-
{
|
3790
|
-
path: ":id",
|
3791
|
-
lazy: async () => {
|
3792
|
-
const { Component, Breadcrumb, loader } = await import("./customer-group-detail-ULS2F7OQ.mjs");
|
3793
|
-
return {
|
3794
|
-
Component,
|
3795
|
-
loader,
|
3796
|
-
handle: {
|
3797
|
-
breadcrumb: (match) => /* @__PURE__ */ jsx17(Breadcrumb, { ...match })
|
3798
|
-
}
|
3799
|
-
};
|
3800
|
-
},
|
3801
|
-
children: [
|
3802
|
-
{
|
3803
|
-
path: "edit",
|
3804
|
-
lazy: () => import("./customer-group-edit-KVEBH5N2.mjs")
|
3805
|
-
},
|
3806
|
-
{
|
3807
|
-
path: "add-customers",
|
3808
|
-
lazy: () => import("./customer-group-add-customers-6IANRPQ6.mjs")
|
3809
|
-
},
|
3810
|
-
{
|
3811
|
-
path: "metadata/edit",
|
3812
|
-
lazy: () => import("./customer-group-metadata-MTAZJYBH.mjs")
|
3813
|
-
}
|
3814
|
-
]
|
3815
|
-
}
|
3816
|
-
]
|
3817
|
-
},
|
3818
|
-
{
|
3819
|
-
path: "/reservations",
|
3820
|
-
errorElement: /* @__PURE__ */ jsx17(ErrorBoundary, {}),
|
3821
|
-
handle: {
|
3822
|
-
breadcrumb: () => t("reservations.domain")
|
3823
|
-
},
|
3824
|
-
children: [
|
3825
|
-
{
|
3826
|
-
path: "",
|
3827
|
-
lazy: () => import("./reservation-list-HF5TGB2X.mjs"),
|
3828
|
-
children: [
|
3829
|
-
{
|
3830
|
-
path: "create",
|
3831
|
-
lazy: () => import("./reservation-create-O3ALBX5F.mjs")
|
3832
|
-
}
|
3833
|
-
]
|
3834
|
-
},
|
3835
|
-
{
|
3836
|
-
path: ":id",
|
3837
|
-
lazy: async () => {
|
3838
|
-
const { Component, Breadcrumb, loader } = await import("./reservation-detail-X46PRDBS.mjs");
|
3839
|
-
return {
|
3840
|
-
Component,
|
3841
|
-
loader,
|
3842
|
-
handle: {
|
3843
|
-
breadcrumb: (match) => /* @__PURE__ */ jsx17(Breadcrumb, { ...match })
|
3844
|
-
}
|
3845
|
-
};
|
3846
|
-
},
|
3847
|
-
children: [
|
3848
|
-
{
|
3849
|
-
path: "edit",
|
3850
|
-
lazy: () => import("./edit-reservation-E6JRXRAL.mjs")
|
3851
|
-
},
|
3852
|
-
{
|
3853
|
-
path: "metadata/edit",
|
3854
|
-
lazy: () => import("./reservation-metadata-GBTOI33G.mjs")
|
3855
|
-
}
|
3856
|
-
]
|
3857
|
-
}
|
3858
|
-
]
|
3859
|
-
},
|
3860
|
-
{
|
3861
|
-
path: "/inventory",
|
3862
|
-
errorElement: /* @__PURE__ */ jsx17(ErrorBoundary, {}),
|
3863
|
-
handle: {
|
3864
|
-
breadcrumb: () => t("inventory.domain")
|
3865
|
-
},
|
3866
|
-
children: [
|
3867
|
-
{
|
3868
|
-
path: "",
|
3869
|
-
lazy: () => import("./inventory-list-P2ZZH6EN.mjs"),
|
3870
|
-
children: [
|
3871
|
-
{
|
3872
|
-
path: "create",
|
3873
|
-
lazy: () => import("./inventory-create-KYURNZS6.mjs")
|
3874
|
-
},
|
3875
|
-
{
|
3876
|
-
path: "stock",
|
3877
|
-
lazy: () => import("./inventory-stock-4R73ZT3V.mjs")
|
3878
|
-
}
|
3879
|
-
]
|
3880
|
-
},
|
3881
|
-
{
|
3882
|
-
path: ":id",
|
3883
|
-
lazy: async () => {
|
3884
|
-
const { Component, Breadcrumb, loader } = await import("./inventory-detail-S56TNEU5.mjs");
|
3885
|
-
return {
|
3886
|
-
Component,
|
3887
|
-
loader,
|
3888
|
-
handle: {
|
3889
|
-
breadcrumb: (match) => /* @__PURE__ */ jsx17(Breadcrumb, { ...match })
|
3890
|
-
}
|
3891
|
-
};
|
3892
|
-
},
|
3893
|
-
children: [
|
3894
|
-
{
|
3895
|
-
path: "edit",
|
3896
|
-
lazy: () => import("./edit-inventory-item-N6JQUIYO.mjs")
|
3897
|
-
},
|
3898
|
-
{
|
3899
|
-
path: "attributes",
|
3900
|
-
lazy: () => import("./edit-inventory-item-attributes-D5SSHDVI.mjs")
|
3901
|
-
},
|
3902
|
-
{
|
3903
|
-
path: "metadata/edit",
|
3904
|
-
lazy: () => import("./inventory-metadata-IDMV4XVV.mjs")
|
3905
|
-
},
|
3906
|
-
{
|
3907
|
-
path: "locations",
|
3908
|
-
lazy: () => import("./manage-locations-PSPBWN5X.mjs")
|
3909
|
-
},
|
3910
|
-
{
|
3911
|
-
path: "locations/:location_id",
|
3912
|
-
lazy: () => import("./adjust-inventory-42AT6TIZ.mjs")
|
3913
|
-
}
|
3914
|
-
]
|
3915
|
-
}
|
3916
|
-
]
|
3917
|
-
},
|
3918
|
-
...RouteExtensions
|
3919
|
-
]
|
3920
|
-
}
|
3921
|
-
]
|
3922
|
-
},
|
3923
|
-
{
|
3924
|
-
element: /* @__PURE__ */ jsx17(ProtectedRoute, {}),
|
3925
|
-
errorElement: /* @__PURE__ */ jsx17(ErrorBoundary, {}),
|
3926
|
-
children: [
|
3927
|
-
{
|
3928
|
-
path: "/settings",
|
3929
|
-
handle: {
|
3930
|
-
breadcrumb: () => t("app.nav.settings.header")
|
3931
|
-
},
|
3932
|
-
element: /* @__PURE__ */ jsx17(SettingsLayout, {}),
|
3933
|
-
children: [
|
3934
|
-
{
|
3935
|
-
index: true,
|
3936
|
-
errorElement: /* @__PURE__ */ jsx17(ErrorBoundary, {}),
|
3937
|
-
lazy: () => import("./settings-FQUPXMWF.mjs")
|
3938
|
-
},
|
3939
|
-
{
|
3940
|
-
path: "profile",
|
3941
|
-
errorElement: /* @__PURE__ */ jsx17(ErrorBoundary, {}),
|
3942
|
-
lazy: () => import("./profile-detail-EYSOSXIU.mjs"),
|
3943
|
-
handle: {
|
3944
|
-
breadcrumb: () => t("profile.domain")
|
3945
|
-
},
|
3946
|
-
children: [
|
3947
|
-
{
|
3948
|
-
path: "edit",
|
3949
|
-
lazy: () => import("./profile-edit-KZGW3D7V.mjs")
|
3950
|
-
}
|
3951
|
-
]
|
3952
|
-
},
|
3953
|
-
{
|
3954
|
-
path: "regions",
|
3955
|
-
errorElement: /* @__PURE__ */ jsx17(ErrorBoundary, {}),
|
3956
|
-
element: /* @__PURE__ */ jsx17(Outlet4, {}),
|
3957
|
-
handle: {
|
3958
|
-
breadcrumb: () => t("regions.domain")
|
3959
|
-
},
|
3960
|
-
children: [
|
3961
|
-
{
|
3962
|
-
path: "",
|
3963
|
-
lazy: () => import("./region-list-ETVUX5R3.mjs"),
|
3964
|
-
children: [
|
3965
|
-
{
|
3966
|
-
path: "create",
|
3967
|
-
lazy: () => import("./region-create-3UVS7VHZ.mjs")
|
3968
|
-
}
|
3969
|
-
]
|
3970
|
-
},
|
3971
|
-
{
|
3972
|
-
path: ":id",
|
3973
|
-
lazy: async () => {
|
3974
|
-
const { Component, Breadcrumb, loader } = await import("./region-detail-SGGN2NPK.mjs");
|
3975
|
-
return {
|
3976
|
-
Component,
|
3977
|
-
loader,
|
3978
|
-
handle: {
|
3979
|
-
breadcrumb: (match) => /* @__PURE__ */ jsx17(Breadcrumb, { ...match })
|
3980
|
-
}
|
3981
|
-
};
|
3982
|
-
},
|
3983
|
-
children: [
|
3984
|
-
{
|
3985
|
-
path: "edit",
|
3986
|
-
lazy: () => import("./region-edit-GPMEIHUM.mjs")
|
3987
|
-
},
|
3988
|
-
{
|
3989
|
-
path: "countries/add",
|
3990
|
-
lazy: () => import("./region-add-countries-5VS6OSZW.mjs")
|
3991
|
-
},
|
3992
|
-
{
|
3993
|
-
path: "metadata/edit",
|
3994
|
-
lazy: () => import("./region-metadata-J4QDEISD.mjs")
|
3995
|
-
}
|
3996
|
-
]
|
3997
|
-
}
|
3998
|
-
]
|
3999
|
-
},
|
4000
|
-
{
|
4001
|
-
path: "store",
|
4002
|
-
errorElement: /* @__PURE__ */ jsx17(ErrorBoundary, {}),
|
4003
|
-
lazy: () => import("./store-detail-RK42OQIJ.mjs"),
|
4004
|
-
handle: {
|
4005
|
-
breadcrumb: () => t("store.domain")
|
4006
|
-
},
|
4007
|
-
children: [
|
4008
|
-
{
|
4009
|
-
path: "edit",
|
4010
|
-
lazy: () => import("./store-edit-VP2ZK6DB.mjs")
|
4011
|
-
},
|
4012
|
-
{
|
4013
|
-
path: "currencies",
|
4014
|
-
lazy: () => import("./store-add-currencies-SSEOM5WZ.mjs")
|
4015
|
-
},
|
4016
|
-
{
|
4017
|
-
path: "metadata/edit",
|
4018
|
-
lazy: () => import("./store-metadata-Z2PO4TKS.mjs")
|
4019
|
-
}
|
4020
|
-
]
|
4021
|
-
},
|
4022
|
-
{
|
4023
|
-
path: "users",
|
4024
|
-
errorElement: /* @__PURE__ */ jsx17(ErrorBoundary, {}),
|
4025
|
-
element: /* @__PURE__ */ jsx17(Outlet4, {}),
|
4026
|
-
handle: {
|
4027
|
-
breadcrumb: () => t("users.domain")
|
4028
|
-
},
|
4029
|
-
children: [
|
4030
|
-
{
|
4031
|
-
path: "",
|
4032
|
-
lazy: () => import("./user-list-6DWTXQUP.mjs"),
|
4033
|
-
children: [
|
4034
|
-
{
|
4035
|
-
path: "invite",
|
4036
|
-
lazy: () => import("./user-invite-HKO52FHN.mjs")
|
4037
|
-
}
|
4038
|
-
]
|
4039
|
-
},
|
4040
|
-
{
|
4041
|
-
path: ":id",
|
4042
|
-
lazy: async () => {
|
4043
|
-
const { Component, Breadcrumb, loader } = await import("./user-detail-I53MPAAS.mjs");
|
4044
|
-
return {
|
4045
|
-
Component,
|
4046
|
-
loader,
|
4047
|
-
handle: {
|
4048
|
-
breadcrumb: (match) => /* @__PURE__ */ jsx17(Breadcrumb, { ...match })
|
4049
|
-
}
|
4050
|
-
};
|
4051
|
-
},
|
4052
|
-
children: [
|
4053
|
-
{
|
4054
|
-
path: "edit",
|
4055
|
-
lazy: () => import("./user-edit-5OL3L6IX.mjs")
|
4056
|
-
},
|
4057
|
-
{
|
4058
|
-
path: "metadata/edit",
|
4059
|
-
lazy: () => import("./user-metadata-ISZ5VACI.mjs")
|
4060
|
-
}
|
4061
|
-
]
|
4062
|
-
}
|
4063
|
-
]
|
4064
|
-
},
|
4065
|
-
{
|
4066
|
-
path: "sales-channels",
|
4067
|
-
errorElement: /* @__PURE__ */ jsx17(ErrorBoundary, {}),
|
4068
|
-
element: /* @__PURE__ */ jsx17(Outlet4, {}),
|
4069
|
-
handle: {
|
4070
|
-
breadcrumb: () => t("salesChannels.domain")
|
4071
|
-
},
|
4072
|
-
children: [
|
4073
|
-
{
|
4074
|
-
path: "",
|
4075
|
-
lazy: () => import("./sales-channel-list-WIDZSTDW.mjs"),
|
4076
|
-
children: [
|
4077
|
-
{
|
4078
|
-
path: "create",
|
4079
|
-
lazy: () => import("./sales-channel-create-5NVNETJO.mjs")
|
4080
|
-
}
|
4081
|
-
]
|
4082
|
-
},
|
4083
|
-
{
|
4084
|
-
path: ":id",
|
4085
|
-
lazy: async () => {
|
4086
|
-
const { Component, Breadcrumb, loader } = await import("./sales-channel-detail-A5LWMTIW.mjs");
|
4087
|
-
return {
|
4088
|
-
Component,
|
4089
|
-
loader,
|
4090
|
-
handle: {
|
4091
|
-
breadcrumb: (match) => /* @__PURE__ */ jsx17(Breadcrumb, { ...match })
|
4092
|
-
}
|
4093
|
-
};
|
4094
|
-
},
|
4095
|
-
children: [
|
4096
|
-
{
|
4097
|
-
path: "edit",
|
4098
|
-
lazy: () => import("./sales-channel-edit-ZHU2WG4C.mjs")
|
4099
|
-
},
|
4100
|
-
{
|
4101
|
-
path: "add-products",
|
4102
|
-
lazy: () => import("./sales-channel-add-products-XX6XXL67.mjs")
|
4103
|
-
},
|
4104
|
-
{
|
4105
|
-
path: "metadata/edit",
|
4106
|
-
lazy: () => import("./sales-channel-metadata-EU2OLGZU.mjs")
|
4107
|
-
}
|
4108
|
-
]
|
4109
|
-
}
|
4110
|
-
]
|
4111
|
-
},
|
4112
|
-
{
|
4113
|
-
path: "locations",
|
4114
|
-
errorElement: /* @__PURE__ */ jsx17(ErrorBoundary, {}),
|
4115
|
-
element: /* @__PURE__ */ jsx17(Outlet4, {}),
|
4116
|
-
handle: {
|
4117
|
-
breadcrumb: () => t("locations.domain")
|
4118
|
-
},
|
4119
|
-
children: [
|
4120
|
-
{
|
4121
|
-
path: "",
|
4122
|
-
lazy: () => import("./location-list-ITU5AOC7.mjs")
|
4123
|
-
},
|
4124
|
-
{
|
4125
|
-
path: "create",
|
4126
|
-
lazy: () => import("./location-create-3FROOIXF.mjs")
|
4127
|
-
},
|
4128
|
-
{
|
4129
|
-
path: "shipping-profiles",
|
4130
|
-
element: /* @__PURE__ */ jsx17(Outlet4, {}),
|
4131
|
-
handle: {
|
4132
|
-
breadcrumb: () => t("shippingProfile.domain")
|
4133
|
-
},
|
4134
|
-
children: [
|
4135
|
-
{
|
4136
|
-
path: "",
|
4137
|
-
lazy: () => import("./shipping-profiles-list-QF6YVBB6.mjs"),
|
4138
|
-
children: [
|
4139
|
-
{
|
4140
|
-
path: "create",
|
4141
|
-
lazy: () => import("./shipping-profile-create-A5NGBX2U.mjs")
|
4142
|
-
}
|
4143
|
-
]
|
4144
|
-
},
|
4145
|
-
{
|
4146
|
-
path: ":shipping_profile_id",
|
4147
|
-
lazy: async () => {
|
4148
|
-
const { Component, Breadcrumb, loader } = await import("./shipping-profile-detail-E2ZVCQB5.mjs");
|
4149
|
-
return {
|
4150
|
-
Component,
|
4151
|
-
loader,
|
4152
|
-
handle: {
|
4153
|
-
breadcrumb: (match) => /* @__PURE__ */ jsx17(Breadcrumb, { ...match })
|
4154
|
-
}
|
4155
|
-
};
|
4156
|
-
},
|
4157
|
-
children: [
|
4158
|
-
{
|
4159
|
-
path: "metadata/edit",
|
4160
|
-
lazy: () => import("./shipping-profile-metadata-B3XD5644.mjs")
|
4161
|
-
}
|
4162
|
-
]
|
4163
|
-
}
|
4164
|
-
]
|
4165
|
-
},
|
4166
|
-
{
|
4167
|
-
path: ":location_id",
|
4168
|
-
lazy: async () => {
|
4169
|
-
const { Component, Breadcrumb, loader } = await import("./location-detail-IEGCZTAI.mjs");
|
4170
|
-
return {
|
4171
|
-
Component,
|
4172
|
-
loader,
|
4173
|
-
handle: {
|
4174
|
-
breadcrumb: (match) => /* @__PURE__ */ jsx17(Breadcrumb, { ...match })
|
4175
|
-
}
|
4176
|
-
};
|
4177
|
-
},
|
4178
|
-
children: [
|
4179
|
-
{
|
4180
|
-
path: "edit",
|
4181
|
-
lazy: () => import("./location-edit-AQUHRPQ6.mjs")
|
4182
|
-
},
|
4183
|
-
{
|
4184
|
-
path: "sales-channels",
|
4185
|
-
lazy: () => import("./location-sales-channels-TSOI2JYI.mjs")
|
4186
|
-
},
|
4187
|
-
{
|
4188
|
-
path: "fulfillment-providers",
|
4189
|
-
lazy: () => import("./location-fulfillment-providers-37FS5TYU.mjs")
|
4190
|
-
},
|
4191
|
-
{
|
4192
|
-
path: "fulfillment-set/:fset_id",
|
4193
|
-
children: [
|
4194
|
-
{
|
4195
|
-
path: "service-zones/create",
|
4196
|
-
lazy: () => import("./location-service-zone-create-2JT4IKFH.mjs")
|
4197
|
-
},
|
4198
|
-
{
|
4199
|
-
path: "service-zone/:zone_id",
|
4200
|
-
children: [
|
4201
|
-
{
|
4202
|
-
path: "edit",
|
4203
|
-
lazy: () => import("./location-service-zone-edit-LKYVVXDR.mjs")
|
4204
|
-
},
|
4205
|
-
{
|
4206
|
-
path: "areas",
|
4207
|
-
lazy: () => import("./location-service-zone-manage-areas-PT4R2I3K.mjs")
|
4208
|
-
},
|
4209
|
-
{
|
4210
|
-
path: "shipping-option",
|
4211
|
-
children: [
|
4212
|
-
{
|
4213
|
-
path: "create",
|
4214
|
-
lazy: () => import("./location-service-zone-shipping-option-create-KXZIUIZQ.mjs")
|
4215
|
-
},
|
4216
|
-
{
|
4217
|
-
path: ":so_id",
|
4218
|
-
children: [
|
4219
|
-
{
|
4220
|
-
path: "edit",
|
4221
|
-
lazy: () => import("./location-service-zone-shipping-option-edit-SC4HD6LU.mjs")
|
4222
|
-
},
|
4223
|
-
{
|
4224
|
-
path: "pricing",
|
4225
|
-
lazy: () => import("./location-service-zone-shipping-option-pricing-FOET7XJC.mjs")
|
4226
|
-
}
|
4227
|
-
]
|
4228
|
-
}
|
4229
|
-
]
|
4230
|
-
}
|
4231
|
-
]
|
4232
|
-
}
|
4233
|
-
]
|
4234
|
-
}
|
4235
|
-
]
|
4236
|
-
}
|
4237
|
-
]
|
4238
|
-
},
|
4239
|
-
{
|
4240
|
-
path: "product-tags",
|
4241
|
-
errorElement: /* @__PURE__ */ jsx17(ErrorBoundary, {}),
|
4242
|
-
element: /* @__PURE__ */ jsx17(Outlet4, {}),
|
4243
|
-
handle: {
|
4244
|
-
breadcrumb: () => t("productTags.domain")
|
4245
|
-
},
|
4246
|
-
children: [
|
4247
|
-
{
|
4248
|
-
path: "",
|
4249
|
-
lazy: () => import("./product-tag-list-A73PYQRI.mjs"),
|
4250
|
-
children: [
|
4251
|
-
{
|
4252
|
-
path: "create",
|
4253
|
-
lazy: () => import("./product-tag-create-CLWQPP7D.mjs")
|
4254
|
-
}
|
4255
|
-
]
|
4256
|
-
},
|
4257
|
-
{
|
4258
|
-
path: ":id",
|
4259
|
-
lazy: async () => {
|
4260
|
-
const { Component, Breadcrumb, loader } = await import("./product-tag-detail-NDZJLI2Q.mjs");
|
4261
|
-
return {
|
4262
|
-
Component,
|
4263
|
-
loader,
|
4264
|
-
handle: {
|
4265
|
-
breadcrumb: (match) => /* @__PURE__ */ jsx17(Breadcrumb, { ...match })
|
4266
|
-
}
|
4267
|
-
};
|
4268
|
-
},
|
4269
|
-
children: [
|
4270
|
-
{
|
4271
|
-
path: "edit",
|
4272
|
-
lazy: () => import("./product-tag-edit-QHHZYHCG.mjs")
|
4273
|
-
}
|
4274
|
-
]
|
4275
|
-
}
|
4276
|
-
]
|
4277
|
-
},
|
4278
|
-
{
|
4279
|
-
path: "workflows",
|
4280
|
-
errorElement: /* @__PURE__ */ jsx17(ErrorBoundary, {}),
|
4281
|
-
element: /* @__PURE__ */ jsx17(Outlet4, {}),
|
4282
|
-
handle: {
|
4283
|
-
breadcrumb: () => t("workflowExecutions.domain")
|
4284
|
-
},
|
4285
|
-
children: [
|
4286
|
-
{
|
4287
|
-
path: "",
|
4288
|
-
lazy: () => import("./workflow-execution-list-VEHTWIZD.mjs")
|
4289
|
-
},
|
4290
|
-
{
|
4291
|
-
path: ":id",
|
4292
|
-
lazy: async () => {
|
4293
|
-
const { Component, Breadcrumb, loader } = await import("./workflow-execution-detail-ERZLGDON.mjs");
|
4294
|
-
return {
|
4295
|
-
Component,
|
4296
|
-
loader,
|
4297
|
-
handle: {
|
4298
|
-
breadcrumb: (match) => /* @__PURE__ */ jsx17(Breadcrumb, { ...match })
|
4299
|
-
}
|
4300
|
-
};
|
4301
|
-
}
|
4302
|
-
}
|
4303
|
-
]
|
4304
|
-
},
|
4305
|
-
{
|
4306
|
-
path: "product-types",
|
4307
|
-
errorElement: /* @__PURE__ */ jsx17(ErrorBoundary, {}),
|
4308
|
-
element: /* @__PURE__ */ jsx17(Outlet4, {}),
|
4309
|
-
handle: {
|
4310
|
-
breadcrumb: () => t("productTypes.domain")
|
4311
|
-
},
|
4312
|
-
children: [
|
4313
|
-
{
|
4314
|
-
path: "",
|
4315
|
-
lazy: () => import("./product-type-list-TUHBNIIB.mjs"),
|
4316
|
-
children: [
|
4317
|
-
{
|
4318
|
-
path: "create",
|
4319
|
-
lazy: () => import("./product-type-create-5AWIC2HY.mjs")
|
4320
|
-
}
|
4321
|
-
]
|
4322
|
-
},
|
4323
|
-
{
|
4324
|
-
path: ":id",
|
4325
|
-
lazy: async () => {
|
4326
|
-
const { Component, Breadcrumb, loader } = await import("./product-type-detail-AQ5SUXFF.mjs");
|
4327
|
-
return {
|
4328
|
-
Component,
|
4329
|
-
loader,
|
4330
|
-
handle: {
|
4331
|
-
breadcrumb: (match) => /* @__PURE__ */ jsx17(Breadcrumb, { ...match })
|
4332
|
-
}
|
4333
|
-
};
|
4334
|
-
},
|
4335
|
-
children: [
|
4336
|
-
{
|
4337
|
-
path: "edit",
|
4338
|
-
lazy: () => import("./product-type-edit-5ETUUK7N.mjs")
|
4339
|
-
}
|
4340
|
-
]
|
4341
|
-
}
|
4342
|
-
]
|
4343
|
-
},
|
4344
|
-
{
|
4345
|
-
path: "publishable-api-keys",
|
4346
|
-
element: /* @__PURE__ */ jsx17(Outlet4, {}),
|
4347
|
-
handle: {
|
4348
|
-
breadcrumb: () => t("apiKeyManagement.domain.publishable")
|
4349
|
-
},
|
4350
|
-
children: [
|
4351
|
-
{
|
4352
|
-
path: "",
|
4353
|
-
element: /* @__PURE__ */ jsx17(Outlet4, {}),
|
4354
|
-
children: [
|
4355
|
-
{
|
4356
|
-
path: "",
|
4357
|
-
lazy: () => import("./api-key-management-list-MKVE46ZE.mjs"),
|
4358
|
-
children: [
|
4359
|
-
{
|
4360
|
-
path: "create",
|
4361
|
-
lazy: () => import("./api-key-management-create-FCTZ6A46.mjs")
|
4362
|
-
}
|
4363
|
-
]
|
4364
|
-
}
|
4365
|
-
]
|
4366
|
-
},
|
4367
|
-
{
|
4368
|
-
path: ":id",
|
4369
|
-
lazy: async () => {
|
4370
|
-
const { Component, Breadcrumb, loader } = await import("./api-key-management-detail-V6UELD25.mjs");
|
4371
|
-
return {
|
4372
|
-
Component,
|
4373
|
-
loader,
|
4374
|
-
handle: {
|
4375
|
-
breadcrumb: (match) => /* @__PURE__ */ jsx17(Breadcrumb, { ...match })
|
4376
|
-
}
|
4377
|
-
};
|
4378
|
-
},
|
4379
|
-
children: [
|
4380
|
-
{
|
4381
|
-
path: "edit",
|
4382
|
-
lazy: () => import("./api-key-management-edit-WTS63YJS.mjs")
|
4383
|
-
},
|
4384
|
-
{
|
4385
|
-
path: "sales-channels",
|
4386
|
-
lazy: () => import("./api-key-management-sales-channels-SHHZXVPP.mjs")
|
4387
|
-
}
|
4388
|
-
]
|
4389
|
-
}
|
4390
|
-
]
|
4391
|
-
},
|
4392
|
-
{
|
4393
|
-
path: "secret-api-keys",
|
4394
|
-
element: /* @__PURE__ */ jsx17(Outlet4, {}),
|
4395
|
-
handle: {
|
4396
|
-
breadcrumb: () => t("apiKeyManagement.domain.secret")
|
4397
|
-
},
|
4398
|
-
children: [
|
4399
|
-
{
|
4400
|
-
path: "",
|
4401
|
-
element: /* @__PURE__ */ jsx17(Outlet4, {}),
|
4402
|
-
children: [
|
4403
|
-
{
|
4404
|
-
path: "",
|
4405
|
-
lazy: () => import("./api-key-management-list-MKVE46ZE.mjs"),
|
4406
|
-
children: [
|
4407
|
-
{
|
4408
|
-
path: "create",
|
4409
|
-
lazy: () => import("./api-key-management-create-FCTZ6A46.mjs")
|
4410
|
-
}
|
4411
|
-
]
|
4412
|
-
}
|
4413
|
-
]
|
4414
|
-
},
|
4415
|
-
{
|
4416
|
-
path: ":id",
|
4417
|
-
lazy: async () => {
|
4418
|
-
const { Component, Breadcrumb, loader } = await import("./api-key-management-detail-V6UELD25.mjs");
|
4419
|
-
return {
|
4420
|
-
Component,
|
4421
|
-
loader,
|
4422
|
-
handle: {
|
4423
|
-
breadcrumb: (match) => /* @__PURE__ */ jsx17(Breadcrumb, { ...match })
|
4424
|
-
}
|
4425
|
-
};
|
4426
|
-
},
|
4427
|
-
children: [
|
4428
|
-
{
|
4429
|
-
path: "edit",
|
4430
|
-
lazy: () => import("./api-key-management-edit-WTS63YJS.mjs")
|
4431
|
-
}
|
4432
|
-
]
|
4433
|
-
}
|
4434
|
-
]
|
4435
|
-
},
|
4436
|
-
{
|
4437
|
-
path: "tax-regions",
|
4438
|
-
element: /* @__PURE__ */ jsx17(Outlet4, {}),
|
4439
|
-
handle: {
|
4440
|
-
breadcrumb: () => t("taxRegions.domain")
|
4441
|
-
},
|
4442
|
-
children: [
|
4443
|
-
{
|
4444
|
-
path: "",
|
4445
|
-
lazy: () => import("./tax-region-list-OAH2FFY2.mjs"),
|
4446
|
-
children: [
|
4447
|
-
{
|
4448
|
-
path: "create",
|
4449
|
-
lazy: () => import("./tax-region-create-OLUBBICW.mjs")
|
4450
|
-
}
|
4451
|
-
]
|
4452
|
-
},
|
4453
|
-
{
|
4454
|
-
path: ":id",
|
4455
|
-
Component: Outlet4,
|
4456
|
-
loader: taxRegionLoader,
|
4457
|
-
handle: {
|
4458
|
-
breadcrumb: (match) => /* @__PURE__ */ jsx17(TaxRegionDetailBreadcrumb, { ...match })
|
4459
|
-
},
|
4460
|
-
children: [
|
4461
|
-
{
|
4462
|
-
path: "",
|
4463
|
-
lazy: async () => {
|
4464
|
-
const { Component } = await import("./tax-region-detail-MUS2Q44R.mjs");
|
4465
|
-
return {
|
4466
|
-
Component
|
4467
|
-
};
|
4468
|
-
},
|
4469
|
-
children: [
|
4470
|
-
{
|
4471
|
-
path: "provinces/create",
|
4472
|
-
lazy: () => import("./tax-region-province-create-TAQQLOAS.mjs")
|
4473
|
-
},
|
4474
|
-
{
|
4475
|
-
path: "overrides/create",
|
4476
|
-
lazy: () => import("./tax-region-tax-override-create-VANMBRAP.mjs")
|
4477
|
-
},
|
4478
|
-
{
|
4479
|
-
path: "overrides/:tax_rate_id/edit",
|
4480
|
-
lazy: () => import("./tax-region-tax-override-edit-IY5SXK2S.mjs")
|
4481
|
-
},
|
4482
|
-
{
|
4483
|
-
path: "tax-rates/create",
|
4484
|
-
lazy: () => import("./tax-region-tax-rate-create-GU7QEL3V.mjs")
|
4485
|
-
},
|
4486
|
-
{
|
4487
|
-
path: "tax-rates/:tax_rate_id/edit",
|
4488
|
-
lazy: () => import("./tax-region-tax-rate-edit-JZO6CSAX.mjs")
|
4489
|
-
}
|
4490
|
-
]
|
4491
|
-
},
|
4492
|
-
{
|
4493
|
-
path: "provinces/:province_id",
|
4494
|
-
lazy: async () => {
|
4495
|
-
const { Component, Breadcrumb, loader } = await import("./tax-region-province-detail-WENPM2PD.mjs");
|
4496
|
-
return {
|
4497
|
-
Component,
|
4498
|
-
loader,
|
4499
|
-
handle: {
|
4500
|
-
breadcrumb: (match) => /* @__PURE__ */ jsx17(Breadcrumb, { ...match })
|
4501
|
-
}
|
4502
|
-
};
|
4503
|
-
},
|
4504
|
-
children: [
|
4505
|
-
{
|
4506
|
-
path: "tax-rates/create",
|
4507
|
-
lazy: () => import("./tax-region-tax-rate-create-GU7QEL3V.mjs")
|
4508
|
-
},
|
4509
|
-
{
|
4510
|
-
path: "tax-rates/:tax_rate_id/edit",
|
4511
|
-
lazy: () => import("./tax-region-tax-rate-edit-JZO6CSAX.mjs")
|
4512
|
-
},
|
4513
|
-
{
|
4514
|
-
path: "overrides/create",
|
4515
|
-
lazy: () => import("./tax-region-tax-override-create-VANMBRAP.mjs")
|
4516
|
-
},
|
4517
|
-
{
|
4518
|
-
path: "overrides/:tax_rate_id/edit",
|
4519
|
-
lazy: () => import("./tax-region-tax-override-edit-IY5SXK2S.mjs")
|
4520
|
-
}
|
4521
|
-
]
|
4522
|
-
}
|
4523
|
-
]
|
4524
|
-
}
|
4525
|
-
]
|
4526
|
-
},
|
4527
|
-
{
|
4528
|
-
path: "return-reasons",
|
4529
|
-
element: /* @__PURE__ */ jsx17(Outlet4, {}),
|
4530
|
-
handle: {
|
4531
|
-
breadcrumb: () => t("returnReasons.domain")
|
4532
|
-
},
|
4533
|
-
children: [
|
4534
|
-
{
|
4535
|
-
path: "",
|
4536
|
-
lazy: () => import("./return-reason-list-R2B2M5F3.mjs"),
|
4537
|
-
children: [
|
4538
|
-
{
|
4539
|
-
path: "create",
|
4540
|
-
lazy: () => import("./return-reason-create-7DOM36PA.mjs")
|
4541
|
-
},
|
4542
|
-
{
|
4543
|
-
path: ":id",
|
4544
|
-
children: [
|
4545
|
-
{
|
4546
|
-
path: "edit",
|
4547
|
-
lazy: () => import("./return-reason-edit-U2DRNMRP.mjs")
|
4548
|
-
}
|
4549
|
-
]
|
4550
|
-
}
|
4551
|
-
]
|
4552
|
-
}
|
4553
|
-
]
|
4554
|
-
},
|
4555
|
-
...SettingsExtensions
|
4556
|
-
]
|
4557
|
-
}
|
4558
|
-
]
|
4559
|
-
},
|
4560
|
-
{
|
4561
|
-
element: /* @__PURE__ */ jsx17(PublicLayout, {}),
|
4562
|
-
children: [
|
4563
|
-
{
|
4564
|
-
errorElement: /* @__PURE__ */ jsx17(ErrorBoundary, {}),
|
4565
|
-
children: [
|
4566
|
-
{
|
4567
|
-
path: "/login",
|
4568
|
-
lazy: () => import("./login-TN5VDDLW.mjs")
|
4569
|
-
},
|
4570
|
-
{
|
4571
|
-
path: "/reset-password",
|
4572
|
-
lazy: () => import("./reset-password-CXIAZ6KT.mjs")
|
4573
|
-
},
|
4574
|
-
{
|
4575
|
-
path: "/invite",
|
4576
|
-
lazy: () => import("./invite-W2J3H5L6.mjs")
|
4577
|
-
},
|
4578
|
-
{
|
4579
|
-
path: "*",
|
4580
|
-
lazy: () => import("./no-match-YRNHGOT3.mjs")
|
4581
|
-
}
|
4582
|
-
]
|
4583
|
-
}
|
4584
|
-
]
|
4585
|
-
}
|
4586
|
-
];
|
4587
|
-
|
4588
|
-
// src/providers/router-provider/router-provider.tsx
|
4589
|
-
import { jsx as jsx18 } from "react/jsx-runtime";
|
4590
|
-
var router = createBrowserRouter(RouteMap, {
|
4591
|
-
basename: __BASE__ || "/"
|
4592
|
-
});
|
4593
|
-
var RouterProvider = () => {
|
4594
|
-
return /* @__PURE__ */ jsx18(Provider2, { router });
|
4595
|
-
};
|
4596
|
-
|
4597
51
|
// src/app.tsx
|
4598
52
|
import displayModule from "virtual:medusa/displays";
|
4599
53
|
import formModule from "virtual:medusa/forms";
|
4600
54
|
import menuItemModule from "virtual:medusa/menu-items";
|
55
|
+
import routeModule from "virtual:medusa/routes";
|
4601
56
|
import widgetModule from "virtual:medusa/widgets";
|
4602
|
-
import { jsx
|
4603
|
-
|
4604
|
-
|
4605
|
-
|
4606
|
-
|
4607
|
-
|
4608
|
-
|
57
|
+
import { jsx } from "react/jsx-runtime";
|
58
|
+
var localPlugin = {
|
59
|
+
widgetModule,
|
60
|
+
routeModule,
|
61
|
+
displayModule,
|
62
|
+
formModule,
|
63
|
+
menuItemModule
|
64
|
+
};
|
65
|
+
function App({ plugins = [] }) {
|
66
|
+
const app = new DashboardApp({
|
67
|
+
plugins: [localPlugin, ...plugins]
|
4609
68
|
});
|
4610
|
-
return /* @__PURE__ */
|
69
|
+
return /* @__PURE__ */ jsx("div", { children: app.render() });
|
4611
70
|
}
|
4612
71
|
var app_default = App;
|
4613
72
|
export {
|