@medusajs/dashboard 3.0.0-snapshot-20251106143524 → 3.0.0-snapshot-20251106181920
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-UR3UM3MV.mjs → add-campaign-promotions-ZUJD7HBF.mjs} +4 -4
- package/dist/{adjust-inventory-7EWRE2HD.mjs → adjust-inventory-MEJEPP4Y.mjs} +1 -1
- package/dist/{api-key-management-create-SPLD3JMO.mjs → api-key-management-create-4OZWVOSF.mjs} +3 -3
- package/dist/{api-key-management-detail-Z6V22XWR.mjs → api-key-management-detail-K3A3T6ET.mjs} +17 -17
- package/dist/{api-key-management-edit-2VPL7PHB.mjs → api-key-management-edit-FYLVVQOA.mjs} +3 -3
- package/dist/{api-key-management-list-TVLEYYQO.mjs → api-key-management-list-6YG52LWY.mjs} +8 -8
- package/dist/{api-key-management-sales-channels-Y25FWD5A.mjs → api-key-management-sales-channels-S5IFH7LP.mjs} +8 -8
- package/dist/app.css +3 -3
- package/dist/app.js +58386 -60410
- package/dist/app.mjs +12 -12
- package/dist/{campaign-create-GD2D45NX.mjs → campaign-create-NEKUWDGF.mjs} +2 -2
- package/dist/{campaign-detail-YDLSCIRO.mjs → campaign-detail-2H2W4W5B.mjs} +15 -15
- package/dist/{campaign-list-M2462W5W.mjs → campaign-list-3452F4Y6.mjs} +6 -6
- package/dist/{categories-metadata-2HM7G27P.mjs → categories-metadata-ZEYU33GV.mjs} +10 -10
- package/dist/{category-create-BC2VUVKO.mjs → category-create-N7PP3GWU.mjs} +5 -5
- package/dist/{category-detail-IZ3AWOCP.mjs → category-detail-DKY37LPO.mjs} +18 -18
- package/dist/{category-edit-U5Y5KJ2Y.mjs → category-edit-IFDQP7EZ.mjs} +2 -2
- package/dist/{category-list-BJLRBYZC.mjs → category-list-2M4BCRAL.mjs} +9 -9
- package/dist/{category-organize-4NXFDN2I.mjs → category-organize-76I7PO24.mjs} +2 -2
- package/dist/{category-products-55LDLRRQ.mjs → category-products-VVRGW25X.mjs} +17 -17
- package/dist/{chunk-VEYZCWO5.mjs → chunk-227DWSFF.mjs} +16 -16
- package/dist/{chunk-2X25XWOW.mjs → chunk-2D44OO7A.mjs} +1 -1
- package/dist/{chunk-CV65NY6Y.mjs → chunk-2WZUO66T.mjs} +1 -1
- package/dist/{chunk-IKXQEHLS.mjs → chunk-3G33PZVQ.mjs} +1 -1
- package/dist/{chunk-ULQ3V4CC.mjs → chunk-3MPO56OL.mjs} +2 -2
- package/dist/{chunk-SUYYSKCB.mjs → chunk-67ORSRVT.mjs} +16 -23
- package/dist/{chunk-MQALAB34.mjs → chunk-7PWZ5GMG.mjs} +1 -1
- package/dist/{chunk-5IPYLNMF.mjs → chunk-ET6EGRW3.mjs} +692 -3840
- package/dist/{chunk-6IXLTZ2H.mjs → chunk-FA5QNPXE.mjs} +2 -2
- package/dist/{chunk-GU5PJRPM.mjs → chunk-FKIOYL3D.mjs} +1 -1
- package/dist/{chunk-IXZVR3HG.mjs → chunk-GBKLLUUX.mjs} +1 -1
- package/dist/{chunk-ALKTJGWS.mjs → chunk-GI6XX5VU.mjs} +2 -2
- package/dist/{chunk-PVW6M64S.mjs → chunk-GLVCH422.mjs} +1 -1
- package/dist/{chunk-4BGVSXZZ.mjs → chunk-GVPJPLE2.mjs} +15 -48
- package/dist/{chunk-6XWHQ6ON.mjs → chunk-GVVAVAXG.mjs} +1 -1
- package/dist/{chunk-3DO2JGVG.mjs → chunk-HGFZAXHD.mjs} +1 -1
- package/dist/{chunk-3C6WQ7NH.mjs → chunk-IBSMG7AF.mjs} +37 -3
- package/dist/{chunk-GA3UMQMZ.mjs → chunk-IVZ6BMDB.mjs} +1 -1
- package/dist/{chunk-EQKJ5FSL.mjs → chunk-JAXWGF4M.mjs} +1 -1
- package/dist/{chunk-LEKWKUIS.mjs → chunk-JC75WAC7.mjs} +3 -3
- package/dist/{chunk-MBGEZAIM.mjs → chunk-JDA2MYND.mjs} +1 -1
- package/dist/{chunk-LOAL44PP.mjs → chunk-JDEH6Z4M.mjs} +1 -1
- package/dist/{chunk-2O43G3RH.mjs → chunk-LYTIMAIZ.mjs} +1 -1
- package/dist/{chunk-OGAZYXOV.mjs → chunk-NGR5XU3K.mjs} +1 -1
- package/dist/{chunk-3JJBLFYN.mjs → chunk-OI4W5AEL.mjs} +6 -2
- package/dist/{chunk-T57MRRCF.mjs → chunk-ORMX5RJQ.mjs} +1 -1
- package/dist/{chunk-XYHXWLTJ.mjs → chunk-P5RVJWPK.mjs} +1 -1
- package/dist/{chunk-DZWH2RV6.mjs → chunk-PFKKVLZX.mjs} +1 -1
- package/dist/{chunk-YTN73JYH.mjs → chunk-PJ5EUKOB.mjs} +1 -1
- package/dist/{chunk-2GWGNMAA.mjs → chunk-Q33G337Z.mjs} +1 -1
- package/dist/{chunk-YGLRZQ4C.mjs → chunk-QXXHLVRQ.mjs} +1 -1
- package/dist/{chunk-M4Q5Q4I3.mjs → chunk-S34JJVBQ.mjs} +2 -2
- package/dist/{chunk-WTK7SR6S.mjs → chunk-SBFWPL42.mjs} +2 -2
- package/dist/{chunk-ROKB75YP.mjs → chunk-SJ3E4T6B.mjs} +1 -1
- package/dist/{chunk-3BE5PBQZ.mjs → chunk-SMDWWXCD.mjs} +4 -4
- package/dist/{chunk-NDXL7ZT5.mjs → chunk-TNMXAPPT.mjs} +1 -1
- package/dist/{chunk-S5GNHYAG.mjs → chunk-UTVAHVAY.mjs} +6 -6
- package/dist/{chunk-NL376WAO.mjs → chunk-VAIHVNV6.mjs} +1 -1
- package/dist/{chunk-YA5PS6KW.mjs → chunk-W77EPLUD.mjs} +1 -1
- package/dist/{chunk-KXRW6JRE.mjs → chunk-WOFUOGLO.mjs} +123 -33
- package/dist/{chunk-N4N4KGET.mjs → chunk-WWQZD7WM.mjs} +1 -1
- package/dist/{chunk-5IFK2ZTA.mjs → chunk-Y2XQE25L.mjs} +2 -2
- package/dist/{chunk-R2QF6AQX.mjs → chunk-Y6ZQFV7H.mjs} +1 -1
- package/dist/{chunk-WGIRB6HY.mjs → chunk-YSQG2JDM.mjs} +1 -1
- package/dist/chunk-ZHH3W7CN.mjs +171 -0
- package/dist/{collection-add-products-7CFVTCLK.mjs → collection-add-products-QCSFXELK.mjs} +18 -18
- package/dist/{collection-create-CUZFWEOB.mjs → collection-create-45RYGDW7.mjs} +2 -2
- package/dist/{collection-detail-3NMMB3CC.mjs → collection-detail-OLC6DMBZ.mjs} +18 -18
- package/dist/{collection-edit-22I7EEJG.mjs → collection-edit-YBPBHLLZ.mjs} +2 -2
- package/dist/{collection-list-VNKB3725.mjs → collection-list-6UJNE2QB.mjs} +28 -27
- package/dist/{collection-metadata-ZUFYY4OU.mjs → collection-metadata-QG55V5ZM.mjs} +11 -11
- package/dist/{customer-detail-PAYUFGP6.mjs → customer-detail-XOCZDUJL.mjs} +20 -20
- package/dist/{customer-group-add-customers-MW2XH2F6.mjs → customer-group-add-customers-TQAH4IPM.mjs} +9 -9
- package/dist/{customer-group-detail-LJ6YVB2C.mjs → customer-group-detail-EWSDTVTQ.mjs} +19 -19
- package/dist/{customer-group-list-M2OOZLIZ.mjs → customer-group-list-NFXAELFY.mjs} +15 -15
- package/dist/{customer-list-MZ7ZRERV.mjs → customer-list-TXAB4URJ.mjs} +9 -9
- package/dist/{customers-add-customer-group-IAIRRQ2I.mjs → customers-add-customer-group-EYZMFVBS.mjs} +17 -17
- package/dist/{edit-inventory-item-5RPZHCM7.mjs → edit-inventory-item-TFJL5H5X.mjs} +1 -1
- package/dist/{edit-inventory-item-attributes-R73ZTBYG.mjs → edit-inventory-item-attributes-O3K7OB56.mjs} +1 -1
- package/dist/{edit-reservation-WMLAFMYU.mjs → edit-reservation-Z5TFZERY.mjs} +2 -2
- package/dist/{edit-rules-KV43O773.mjs → edit-rules-IE77WUXD.mjs} +10 -10
- package/dist/en.json +51 -4
- package/dist/{inventory-create-NW5WSPBV.mjs → inventory-create-HQ5XLKOJ.mjs} +10 -10
- package/dist/{inventory-detail-ZJ5U5FSA.mjs → inventory-detail-DAINM7WP.mjs} +14 -14
- package/dist/{inventory-list-HHTQRKQW.mjs → inventory-list-5ROSUTXF.mjs} +5 -5
- package/dist/{inventory-metadata-7XR4ON7G.mjs → inventory-metadata-HUL56OD2.mjs} +10 -10
- package/dist/{inventory-stock-VTIDGTOY.mjs → inventory-stock-5VIUWKTQ.mjs} +10 -10
- package/dist/{location-detail-WZM4EXFM.mjs → location-detail-QMLCFID5.mjs} +15 -15
- package/dist/{location-fulfillment-providers-DNIVH7XD.mjs → location-fulfillment-providers-NAFFMP3P.mjs} +19 -18
- package/dist/{location-sales-channels-3JAXXM3Q.mjs → location-sales-channels-D37LXTKQ.mjs} +7 -7
- package/dist/{location-service-zone-create-D2HXXX63.mjs → location-service-zone-create-27MNMKPQ.mjs} +5 -5
- package/dist/{location-service-zone-manage-areas-LVVT6XBE.mjs → location-service-zone-manage-areas-U3EPNWSI.mjs} +5 -5
- package/dist/{location-service-zone-shipping-option-create-F3EQW67U.mjs → location-service-zone-shipping-option-create-VM4TEJHY.mjs} +10 -10
- package/dist/{login-VZALGB6R.mjs → login-MTGOV7KC.mjs} +10 -10
- package/dist/{manage-locations-WMH3RQMR.mjs → manage-locations-OHDFBORX.mjs} +1 -1
- package/dist/{order-allocate-items-MZ7Y4FU4.mjs → order-allocate-items-NU65ZXHE.mjs} +3 -3
- package/dist/{order-create-claim-2FPE6XP2.mjs → order-create-claim-LTE2E75R.mjs} +20 -20
- package/dist/{order-create-edit-PVGKIS6G.mjs → order-create-edit-TPU3CKUU.mjs} +15 -15
- package/dist/{order-create-exchange-G4JY4FSX.mjs → order-create-exchange-FVSBZI7P.mjs} +26 -26
- package/dist/{order-create-fulfillment-VTICR6OE.mjs → order-create-fulfillment-NFGPDCBV.mjs} +13 -13
- package/dist/{order-create-refund-RWDVIXPV.mjs → order-create-refund-DC7C3R4Y.mjs} +15 -15
- package/dist/{order-create-return-VEUCH5BA.mjs → order-create-return-RLXYVZLO.mjs} +8 -8
- package/dist/{order-create-shipment-2KNYEHSU.mjs → order-create-shipment-RDYWCG3A.mjs} +10 -10
- package/dist/{order-detail-2EFNG3UB.mjs → order-detail-VVOZ6E2R.mjs} +33 -33
- package/dist/{order-edit-billing-address-T6BIIRAX.mjs → order-edit-billing-address-LV7453CS.mjs} +10 -10
- package/dist/{order-edit-email-SLUOGWRO.mjs → order-edit-email-4U5C6UKX.mjs} +10 -10
- package/dist/{order-edit-shipping-address-YUES5K5Q.mjs → order-edit-shipping-address-6IQC2CVP.mjs} +10 -10
- package/dist/{order-list-EEC3VSLN.mjs → order-list-INSYF52F.mjs} +13 -13
- package/dist/{order-metadata-HS33MC6S.mjs → order-metadata-EEV4IWOM.mjs} +10 -10
- package/dist/{order-receive-return-E6BGSZVL.mjs → order-receive-return-IWHR3EBF.mjs} +11 -11
- package/dist/{order-request-transfer-7IIDQ37I.mjs → order-request-transfer-65R4A7HS.mjs} +10 -10
- package/dist/{price-list-configuration-WQEQFG6M.mjs → price-list-configuration-L5XYCVP2.mjs} +8 -8
- package/dist/{price-list-create-36BOXETM.mjs → price-list-create-5GIMBRG2.mjs} +21 -21
- package/dist/{price-list-detail-6CJ63F65.mjs → price-list-detail-7AL2EBRL.mjs} +22 -22
- package/dist/{price-list-edit-GXDLVOU4.mjs → price-list-edit-DHG5STG4.mjs} +2 -2
- package/dist/{price-list-list-2HDOJIC6.mjs → price-list-list-QQKZEFSU.mjs} +7 -7
- package/dist/{price-list-prices-add-AVPP57TL.mjs → price-list-prices-add-2OO4QEZB.mjs} +17 -17
- package/dist/{price-list-prices-edit-J7HCNDTO.mjs → price-list-prices-edit-2FB25KWU.mjs} +2 -2
- package/dist/{product-attributes-TWEJQQBK.mjs → product-attributes-CCQ6WAOD.mjs} +13 -13
- package/dist/{product-create-GTUUDEAP.mjs → product-create-AIRCVZAE.mjs} +346 -552
- package/dist/{product-create-variant-ZWY57BX7.mjs → product-create-variant-7BD5KQHQ.mjs} +10 -10
- package/dist/{product-detail-F4MVAHFN.mjs → product-detail-IYMXYAPH.mjs} +28 -55
- package/dist/{product-edit-NEIZ3SID.mjs → product-edit-PDGQHCQ2.mjs} +13 -13
- package/dist/{product-export-5WBXPUYP.mjs → product-export-5EINLQDF.mjs} +26 -25
- package/dist/{product-image-variants-edit-T3STDZJG.mjs → product-image-variants-edit-DDSEBG5H.mjs} +14 -14
- package/dist/{product-import-5VLF2ZN4.mjs → product-import-IQJWHNYN.mjs} +10 -10
- package/dist/{product-list-BX2QNNQK.mjs → product-list-PUQEGU75.mjs} +23 -23
- package/dist/{product-media-Z3NNTB7H.mjs → product-media-Q5XFYZRS.mjs} +2 -2
- package/dist/{product-metadata-LMDEXR3V.mjs → product-metadata-WCKNOZXX.mjs} +10 -10
- package/dist/product-option-create-MWFWB2SU.mjs +336 -0
- package/dist/product-option-detail-UKKEZPG7.mjs +323 -0
- package/dist/product-option-edit-NHAF7B4P.mjs +324 -0
- package/dist/product-option-list-C6ZR2WIX.mjs +266 -0
- package/dist/product-option-metadata-OWSGHNDC.mjs +71 -0
- package/dist/product-options-manage-N73G5IXY.mjs +206 -0
- package/dist/{product-organization-5N2EIUXB.mjs → product-organization-HHME5F2C.mjs} +14 -14
- package/dist/{product-prices-MCZYVPQW.mjs → product-prices-GVEPABHQ.mjs} +1 -1
- package/dist/{product-sales-channels-LRMOPHMH.mjs → product-sales-channels-ZC5ONPG7.mjs} +7 -7
- package/dist/{product-shipping-profile-AHJE77VR.mjs → product-shipping-profile-KXSBDGRD.mjs} +13 -13
- package/dist/{product-stock-O2BH5R45.mjs → product-stock-LXRLD7FA.mjs} +10 -10
- package/dist/{product-tag-create-GOJTE5XA.mjs → product-tag-create-RAJEWM5O.mjs} +10 -10
- package/dist/{product-tag-detail-LDKRRJWH.mjs → product-tag-detail-EOW2GMOL.mjs} +36 -35
- package/dist/{product-tag-edit-IT4GHLSO.mjs → product-tag-edit-ZOO56XMF.mjs} +10 -10
- package/dist/{product-tag-list-3ERYK5WE.mjs → product-tag-list-B2UX2OHB.mjs} +35 -34
- package/dist/{product-tag-metadata-QV2BOGP2.mjs → product-tag-metadata-OZB7SVDN.mjs} +10 -10
- package/dist/{product-type-detail-UJ6QTCGQ.mjs → product-type-detail-4YZUC6ZS.mjs} +17 -17
- package/dist/{product-type-list-73DQPW4H.mjs → product-type-list-J2WDYTZK.mjs} +9 -9
- package/dist/{product-type-metadata-5TDBJGNQ.mjs → product-type-metadata-6QT47ZSR.mjs} +10 -10
- package/dist/{product-variant-detail-JMPD7LEZ.mjs → product-variant-detail-HOOYZSS2.mjs} +14 -14
- package/dist/{product-variant-edit-DW27AYBX.mjs → product-variant-edit-J2MTJA75.mjs} +10 -10
- package/dist/{product-variant-manage-inventory-items-T5OB3YX3.mjs → product-variant-manage-inventory-items-P4QUORRH.mjs} +1 -1
- package/dist/{product-variant-media-PHRCKUDK.mjs → product-variant-media-U5RG7AOW.mjs} +1 -1
- package/dist/{product-variant-metadata-4KJE6B2R.mjs → product-variant-metadata-ZRSZO2D4.mjs} +10 -10
- package/dist/{profile-detail-MEZKVQAB.mjs → profile-detail-UTJBWZSA.mjs} +1 -1
- package/dist/{profile-edit-XAHDV2DG.mjs → profile-edit-OOYMTKX6.mjs} +1 -1
- package/dist/{promotion-create-F27AOTVZ.mjs → promotion-create-2E4EF4SP.mjs} +15 -15
- package/dist/{promotion-detail-L3FNHH6O.mjs → promotion-detail-P2BHIQDG.mjs} +13 -13
- package/dist/{promotion-list-R5JKSO4I.mjs → promotion-list-MN6YJCYA.mjs} +4 -4
- package/dist/{refund-reason-create-5ATQ2IPU.mjs → refund-reason-create-I3BIJFJH.mjs} +10 -10
- package/dist/{refund-reason-edit-F7AMOTG3.mjs → refund-reason-edit-2BEZASQH.mjs} +10 -10
- package/dist/{refund-reason-list-NS4SVHGZ.mjs → refund-reason-list-NIJHHOXJ.mjs} +20 -20
- package/dist/{region-add-countries-G5BOUL2E.mjs → region-add-countries-KGFPZSRE.mjs} +4 -4
- package/dist/{region-create-MLPUWT5W.mjs → region-create-YJJRTAYO.mjs} +4 -4
- package/dist/{region-detail-RICQRZUA.mjs → region-detail-ERE4ZF2I.mjs} +4 -4
- package/dist/{region-list-CJYT43SH.mjs → region-list-KE5HCKOR.mjs} +7 -7
- package/dist/{region-metadata-CRAHVHOC.mjs → region-metadata-RLZSQNGW.mjs} +10 -10
- package/dist/{reservation-create-YZMZ6HSS.mjs → reservation-create-4R2XEEZU.mjs} +2 -2
- package/dist/{reservation-detail-6MCBQZAE.mjs → reservation-detail-7OYGNK4L.mjs} +10 -10
- package/dist/{reservation-list-XP4YX4TR.mjs → reservation-list-VY44QEH6.mjs} +7 -7
- package/dist/{reservation-metadata-IQNJPNAX.mjs → reservation-metadata-VJIAGIMF.mjs} +10 -10
- package/dist/{return-reason-list-7MBVORVO.mjs → return-reason-list-6UKR2BLW.mjs} +12 -12
- package/dist/{sales-channel-add-products-GQQ7Z3PT.mjs → sales-channel-add-products-KAUMNKMD.mjs} +17 -17
- package/dist/{sales-channel-create-7ISLGNGC.mjs → sales-channel-create-I6ME6QBM.mjs} +2 -2
- package/dist/{sales-channel-detail-P2HXFYB4.mjs → sales-channel-detail-5SXDKP6P.mjs} +17 -17
- package/dist/{sales-channel-edit-2PEHGAWF.mjs → sales-channel-edit-O7GM2B6O.mjs} +2 -2
- package/dist/{sales-channel-list-4PJLCQ77.mjs → sales-channel-list-JKZ6TIY7.mjs} +15 -15
- package/dist/{sales-channel-metadata-ZOCPAIGM.mjs → sales-channel-metadata-33P5SKDI.mjs} +10 -10
- package/dist/{shipping-option-type-create-YR2QV2OG.mjs → shipping-option-type-create-KVYNWD2Q.mjs} +10 -10
- package/dist/{shipping-option-type-detail-TYHGCV2X.mjs → shipping-option-type-detail-YX3HMXNI.mjs} +11 -11
- package/dist/{shipping-option-type-edit-6KL3MHVT.mjs → shipping-option-type-edit-ODXQMHYJ.mjs} +10 -10
- package/dist/{shipping-option-type-list-AWJRR7U5.mjs → shipping-option-type-list-XCQNWDDA.mjs} +16 -16
- package/dist/{shipping-profile-metadata-A33XKBQN.mjs → shipping-profile-metadata-K34DAKGY.mjs} +10 -10
- package/dist/{shipping-profiles-list-7SVGIP72.mjs → shipping-profiles-list-KYYSHLSZ.mjs} +4 -4
- package/dist/{store-add-currencies-V3IBSI45.mjs → store-add-currencies-SNSW7A6O.mjs} +4 -4
- package/dist/{store-detail-3WFTRPJW.mjs → store-detail-3Z3BK2BH.mjs} +14 -14
- package/dist/{store-metadata-LMRFCZ3J.mjs → store-metadata-FESGAO7E.mjs} +10 -10
- package/dist/{tax-region-create-5Y6EA7XE.mjs → tax-region-create-EVFVC6HN.mjs} +10 -10
- package/dist/{tax-region-detail-HXVZA2PP.mjs → tax-region-detail-ULHK52CD.mjs} +38 -37
- package/dist/{tax-region-edit-IKEWHRUK.mjs → tax-region-edit-CXEPD2F2.mjs} +10 -10
- package/dist/{tax-region-province-detail-VT3BUKLS.mjs → tax-region-province-detail-VUY4PDGN.mjs} +38 -37
- package/dist/{tax-region-tax-override-create-RZUVOGNR.mjs → tax-region-tax-override-create-WWZZVAG5.mjs} +37 -36
- package/dist/{tax-region-tax-override-edit-OEQOEE6I.mjs → tax-region-tax-override-edit-HVZRD44G.mjs} +36 -35
- package/dist/{user-detail-DFZPKHG2.mjs → user-detail-YTVBPRH5.mjs} +1 -1
- package/dist/{user-invite-QK3ZCSGG.mjs → user-invite-FQNKJKMD.mjs} +4 -4
- package/dist/{user-list-RH43CTBN.mjs → user-list-73SJSKYT.mjs} +6 -6
- package/dist/{user-metadata-BQKW4WAU.mjs → user-metadata-33W3JSHN.mjs} +10 -10
- package/dist/{workflow-execution-detail-D5QUZFTV.mjs → workflow-execution-detail-SHEXD5OL.mjs} +10 -10
- package/dist/{workflow-execution-list-6UTBTVX4.mjs → workflow-execution-list-JOVBPL45.mjs} +4 -4
- package/package.json +9 -9
- package/src/components/layout/main-layout/main-layout.tsx +7 -5
- package/src/components/layout/nav-item/nav-item.tsx +4 -14
- package/src/dashboard-app/dashboard-app.tsx +0 -1
- package/src/dashboard-app/routes/get-route.map.tsx +64 -12
- package/src/dashboard-app/types.ts +0 -1
- package/src/hooks/api/index.ts +1 -0
- package/src/hooks/api/product-options.tsx +151 -0
- package/src/hooks/api/products.tsx +23 -63
- package/src/hooks/table/columns/use-product-option-table-columns.tsx +43 -0
- package/src/hooks/table/filters/index.ts +1 -0
- package/src/hooks/table/filters/use-product-option-table-filters.tsx +33 -0
- package/src/hooks/table/query/use-product-option-table-query.tsx +34 -0
- package/src/i18n/languages.ts +16 -23
- package/src/i18n/translations/$schema.json +176 -5
- package/src/i18n/translations/en.json +51 -4
- package/src/i18n/translations/index.ts +0 -4
- package/src/routes/product-options/common/hooks/use-delete-product-option-action.tsx +41 -0
- package/src/routes/product-options/product-option-create/components/create-product-option-form/create-product-option-details.tsx +71 -0
- package/src/routes/product-options/product-option-create/components/create-product-option-form/create-product-option-form.tsx +192 -0
- package/src/routes/product-options/product-option-create/components/create-product-option-form/create-product-option-organize.tsx +77 -0
- package/src/routes/product-options/product-option-create/components/create-product-option-form/index.ts +1 -0
- package/src/routes/product-options/product-option-create/components/create-product-option-form/schema.ts +15 -0
- package/src/routes/product-options/product-option-create/index.ts +1 -0
- package/src/routes/product-options/product-option-create/product-option-create.tsx +10 -0
- package/src/routes/product-options/product-option-detail/breadcrumb.tsx +14 -0
- package/src/routes/product-options/product-option-detail/components/product-option-general-section/index.ts +1 -0
- package/src/routes/product-options/product-option-detail/components/product-option-general-section/product-option-general-section.tsx +81 -0
- package/src/routes/product-options/product-option-detail/components/product-option-product-section/index.ts +1 -0
- package/src/routes/product-options/product-option-detail/components/product-option-product-section/product-option-product-section.tsx +74 -0
- package/src/routes/product-options/product-option-detail/index.ts +3 -0
- package/src/routes/product-options/product-option-detail/loader.ts +17 -0
- package/src/routes/product-options/product-option-detail/product-option-detail.tsx +50 -0
- package/src/routes/product-options/product-option-edit/components/edit-product-option-form/edit-product-option-details.tsx +94 -0
- package/src/routes/product-options/product-option-edit/components/edit-product-option-form/edit-product-option-form.tsx +116 -0
- package/src/routes/product-options/product-option-edit/components/edit-product-option-form/edit-product-option-organize.tsx +77 -0
- package/src/routes/product-options/product-option-edit/components/edit-product-option-form/index.ts +1 -0
- package/src/routes/product-options/product-option-edit/components/edit-product-option-form/schema.ts +13 -0
- package/src/routes/product-options/product-option-edit/index.ts +1 -0
- package/src/routes/product-options/product-option-edit/product-option-edit.tsx +34 -0
- package/src/routes/product-options/product-option-list/components/product-option-list-table/index.ts +1 -0
- package/src/routes/product-options/product-option-list/components/product-option-list-table/product-option-list-table.tsx +131 -0
- package/src/routes/product-options/product-option-list/index.ts +1 -0
- package/src/routes/product-options/product-option-list/product-option-list.tsx +19 -0
- package/src/routes/product-options/product-option-metadata/index.ts +1 -0
- package/src/routes/product-options/product-option-metadata/product-option-metadata.tsx +27 -0
- package/src/routes/products/product-create/components/product-create-details-form/components/product-create-details-variant-section/product-create-details-variant-section.tsx +214 -198
- package/src/routes/products/product-create/components/product-create-form/product-create-form.tsx +4 -7
- package/src/routes/products/product-create/constants.ts +1 -0
- package/src/routes/products/product-create/utils.ts +6 -1
- package/src/routes/products/product-detail/components/product-option-section/product-option-section.tsx +7 -38
- package/src/routes/products/product-options-manage/components/product-options-manage-form/index.ts +1 -0
- package/src/routes/products/product-options-manage/components/product-options-manage-form/product-options-manage-form.tsx +147 -0
- package/src/routes/products/product-options-manage/index.ts +1 -0
- package/src/routes/products/product-options-manage/product-options-manage.tsx +35 -0
- package/dist/product-create-option-D2636LJL.mjs +0 -145
- package/dist/product-edit-option-DYAFZIT2.mjs +0 -150
- package/src/i18n/translations/ptPT.json +0 -3219
- package/src/routes/products/product-create-option/components/create-product-option-form/create-product-option-form.tsx +0 -122
- package/src/routes/products/product-create-option/components/create-product-option-form/index.ts +0 -1
- package/src/routes/products/product-create-option/index.ts +0 -1
- package/src/routes/products/product-create-option/product-create-option.tsx +0 -26
- package/src/routes/products/product-edit-option/components/edit-product-option-form/edit-product-option-form.tsx +0 -123
- package/src/routes/products/product-edit-option/components/edit-product-option-form/index.ts +0 -1
- package/src/routes/products/product-edit-option/index.ts +0 -1
- package/src/routes/products/product-edit-option/product-edit-option.tsx +0 -32
- package/dist/{chunk-ELPHCFRW.mjs → chunk-MK4E5XQX.mjs} +3 -3
- package/dist/{location-list-W6EHBBE5.mjs → location-list-MVIK73QC.mjs} +1 -1
- package/dist/{location-service-zone-shipping-option-edit-27MYKN7R.mjs → location-service-zone-shipping-option-edit-WN4MTZSB.mjs} +3 -3
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
import "./chunk-S34JJVBQ.mjs";
|
|
2
|
+
import "./chunk-GLVCH422.mjs";
|
|
3
|
+
import "./chunk-QMRGIWOP.mjs";
|
|
4
|
+
import "./chunk-I3VB6NM2.mjs";
|
|
5
|
+
import "./chunk-ZJRFL6ZN.mjs";
|
|
6
|
+
import "./chunk-2WZUO66T.mjs";
|
|
7
|
+
import "./chunk-XWO5BP42.mjs";
|
|
8
|
+
import "./chunk-IVZ6BMDB.mjs";
|
|
9
|
+
import "./chunk-QXXHLVRQ.mjs";
|
|
10
|
+
import "./chunk-IR5DHEKS.mjs";
|
|
11
|
+
import "./chunk-7DXVXBSA.mjs";
|
|
12
|
+
import "./chunk-MSDRGCRR.mjs";
|
|
13
|
+
import {
|
|
14
|
+
useProductTableColumns
|
|
15
|
+
} from "./chunk-BW322BVH.mjs";
|
|
16
|
+
import "./chunk-3I6G3NRU.mjs";
|
|
17
|
+
import "./chunk-SJ3E4T6B.mjs";
|
|
18
|
+
import "./chunk-INE2QCSC.mjs";
|
|
19
|
+
import "./chunk-XLDQPLK4.mjs";
|
|
20
|
+
import "./chunk-IQBAUTU5.mjs";
|
|
21
|
+
import "./chunk-ADOCJB6L.mjs";
|
|
22
|
+
import "./chunk-X6BAAGCL.mjs";
|
|
23
|
+
import "./chunk-P3UUX2T6.mjs";
|
|
24
|
+
import "./chunk-DK4WIVY6.mjs";
|
|
25
|
+
import "./chunk-MFALVTRQ.mjs";
|
|
26
|
+
import "./chunk-RIV7FKGN.mjs";
|
|
27
|
+
import "./chunk-TDK3JDOB.mjs";
|
|
28
|
+
import "./chunk-FHSC5X62.mjs";
|
|
29
|
+
import "./chunk-XR4GEMGR.mjs";
|
|
30
|
+
import "./chunk-MOSRJHJ3.mjs";
|
|
31
|
+
import "./chunk-WRSGHGAT.mjs";
|
|
32
|
+
import "./chunk-OMC5JCQH.mjs";
|
|
33
|
+
import "./chunk-IW4TACOD.mjs";
|
|
34
|
+
import {
|
|
35
|
+
useProductTableQuery
|
|
36
|
+
} from "./chunk-PCFUZKDS.mjs";
|
|
37
|
+
import {
|
|
38
|
+
SingleColumnPage
|
|
39
|
+
} from "./chunk-GIZFNLKK.mjs";
|
|
40
|
+
import {
|
|
41
|
+
DataTable
|
|
42
|
+
} from "./chunk-GRNWRTT3.mjs";
|
|
43
|
+
import "./chunk-C76H5USB.mjs";
|
|
44
|
+
import "./chunk-PFKKVLZX.mjs";
|
|
45
|
+
import "./chunk-MNXC6Q4F.mjs";
|
|
46
|
+
import "./chunk-DG7J63J2.mjs";
|
|
47
|
+
import "./chunk-RM6NY572.mjs";
|
|
48
|
+
import {
|
|
49
|
+
useExtension
|
|
50
|
+
} from "./chunk-C5P5PL3E.mjs";
|
|
51
|
+
import {
|
|
52
|
+
SingleColumnPageSkeleton
|
|
53
|
+
} from "./chunk-LPEUYMRK.mjs";
|
|
54
|
+
import {
|
|
55
|
+
ActionMenu
|
|
56
|
+
} from "./chunk-OZPB6JBL.mjs";
|
|
57
|
+
import "./chunk-OC7BQLYI.mjs";
|
|
58
|
+
import "./chunk-S4DMV3ZT.mjs";
|
|
59
|
+
import "./chunk-67ORSRVT.mjs";
|
|
60
|
+
import {
|
|
61
|
+
productOptionsQueryKeys,
|
|
62
|
+
useDeleteProductOption,
|
|
63
|
+
useProductOption
|
|
64
|
+
} from "./chunk-WOFUOGLO.mjs";
|
|
65
|
+
import "./chunk-KOSCMAIC.mjs";
|
|
66
|
+
import "./chunk-WWQZD7WM.mjs";
|
|
67
|
+
import "./chunk-X6DSNTTX.mjs";
|
|
68
|
+
import "./chunk-I6E6CALJ.mjs";
|
|
69
|
+
import "./chunk-QTCZFYFH.mjs";
|
|
70
|
+
import "./chunk-B4GODIOW.mjs";
|
|
71
|
+
import "./chunk-ENV6YVOM.mjs";
|
|
72
|
+
import "./chunk-PIR2H25N.mjs";
|
|
73
|
+
import "./chunk-C5LYZZZ5.mjs";
|
|
74
|
+
import "./chunk-RLY2SL5E.mjs";
|
|
75
|
+
import "./chunk-2ZKVRTBW.mjs";
|
|
76
|
+
import "./chunk-GBKLLUUX.mjs";
|
|
77
|
+
import "./chunk-P5RVJWPK.mjs";
|
|
78
|
+
import "./chunk-F6PXCY3N.mjs";
|
|
79
|
+
import "./chunk-R2G2B47Y.mjs";
|
|
80
|
+
import "./chunk-GRT22PE5.mjs";
|
|
81
|
+
import "./chunk-32IQRUVY.mjs";
|
|
82
|
+
import "./chunk-SBFWPL42.mjs";
|
|
83
|
+
import "./chunk-GVVAVAXG.mjs";
|
|
84
|
+
import "./chunk-7PWZ5GMG.mjs";
|
|
85
|
+
import "./chunk-NGR5XU3K.mjs";
|
|
86
|
+
import "./chunk-KX4P5L3R.mjs";
|
|
87
|
+
import "./chunk-V2LANK5S.mjs";
|
|
88
|
+
import "./chunk-QZ6PT4QV.mjs";
|
|
89
|
+
import "./chunk-QL4XKIVL.mjs";
|
|
90
|
+
import {
|
|
91
|
+
useProducts
|
|
92
|
+
} from "./chunk-GVPJPLE2.mjs";
|
|
93
|
+
import {
|
|
94
|
+
queryClient
|
|
95
|
+
} from "./chunk-FXYH54JP.mjs";
|
|
96
|
+
import "./chunk-774WSTCC.mjs";
|
|
97
|
+
import {
|
|
98
|
+
sdk
|
|
99
|
+
} from "./chunk-DEQUVHHE.mjs";
|
|
100
|
+
import "./chunk-QZ7TP4HQ.mjs";
|
|
101
|
+
|
|
102
|
+
// src/routes/product-options/product-option-detail/breadcrumb.tsx
|
|
103
|
+
import { jsx } from "react/jsx-runtime";
|
|
104
|
+
var ProductOptionBreadcrumb = (match) => {
|
|
105
|
+
const productOption = match.data.product_option;
|
|
106
|
+
if (!productOption) {
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
109
|
+
return /* @__PURE__ */ jsx("span", { children: productOption.title });
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
// src/routes/product-options/product-option-detail/product-option-detail.tsx
|
|
113
|
+
import { useLoaderData, useParams } from "react-router-dom";
|
|
114
|
+
|
|
115
|
+
// src/routes/product-options/product-option-detail/components/product-option-general-section/product-option-general-section.tsx
|
|
116
|
+
import { PencilSquare, Trash } from "@medusajs/icons";
|
|
117
|
+
import { Badge, Container, Heading } from "@medusajs/ui";
|
|
118
|
+
import { useMemo } from "react";
|
|
119
|
+
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
120
|
+
|
|
121
|
+
// src/routes/product-options/common/hooks/use-delete-product-option-action.tsx
|
|
122
|
+
import { useNavigate } from "react-router-dom";
|
|
123
|
+
import { toast, usePrompt } from "@medusajs/ui";
|
|
124
|
+
import { useTranslation } from "react-i18next";
|
|
125
|
+
var useDeleteProductOptionAction = ({
|
|
126
|
+
id,
|
|
127
|
+
title
|
|
128
|
+
}) => {
|
|
129
|
+
const { t } = useTranslation();
|
|
130
|
+
const prompt = usePrompt();
|
|
131
|
+
const navigate = useNavigate();
|
|
132
|
+
const { mutateAsync } = useDeleteProductOption(id);
|
|
133
|
+
return async () => {
|
|
134
|
+
const result = await prompt({
|
|
135
|
+
title: t("general.areYouSure"),
|
|
136
|
+
description: t("productOptions.delete.confirmation", { title }),
|
|
137
|
+
confirmText: t("actions.delete"),
|
|
138
|
+
cancelText: t("actions.cancel")
|
|
139
|
+
});
|
|
140
|
+
if (!result) {
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
await mutateAsync(void 0, {
|
|
144
|
+
onSuccess: () => {
|
|
145
|
+
navigate("/product-options", {
|
|
146
|
+
replace: true
|
|
147
|
+
});
|
|
148
|
+
toast.success(t("productOptions.delete.successToast", { title }));
|
|
149
|
+
},
|
|
150
|
+
onError: (e) => {
|
|
151
|
+
toast.error(e.message);
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
// src/routes/product-options/product-option-detail/components/product-option-general-section/product-option-general-section.tsx
|
|
158
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
159
|
+
var ProductOptionGeneralSection = ({
|
|
160
|
+
productOption
|
|
161
|
+
}) => {
|
|
162
|
+
const { t } = useTranslation2();
|
|
163
|
+
const handleDelete = useDeleteProductOptionAction(productOption);
|
|
164
|
+
const sortedValues = useMemo(() => {
|
|
165
|
+
if (!productOption.values) {
|
|
166
|
+
return [];
|
|
167
|
+
}
|
|
168
|
+
return [...productOption.values].sort((a, b) => {
|
|
169
|
+
const rankA = a.rank ?? Number.MAX_VALUE;
|
|
170
|
+
const rankB = b.rank ?? Number.MAX_VALUE;
|
|
171
|
+
return rankA - rankB;
|
|
172
|
+
});
|
|
173
|
+
}, [productOption.values]);
|
|
174
|
+
return /* @__PURE__ */ jsxs(Container, { className: "divide-y p-0", children: [
|
|
175
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
176
|
+
/* @__PURE__ */ jsx2(Heading, { children: productOption.title }),
|
|
177
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
178
|
+
/* @__PURE__ */ jsx2(Badge, { size: "xsmall", color: "blue", children: t(
|
|
179
|
+
`general.${productOption.is_exclusive ? "exclusive" : "global"}`
|
|
180
|
+
) }),
|
|
181
|
+
/* @__PURE__ */ jsx2(
|
|
182
|
+
ActionMenu,
|
|
183
|
+
{
|
|
184
|
+
groups: [
|
|
185
|
+
{
|
|
186
|
+
actions: [
|
|
187
|
+
{
|
|
188
|
+
label: t("actions.edit"),
|
|
189
|
+
icon: /* @__PURE__ */ jsx2(PencilSquare, {}),
|
|
190
|
+
to: "edit"
|
|
191
|
+
}
|
|
192
|
+
]
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
actions: [
|
|
196
|
+
{
|
|
197
|
+
label: t("actions.delete"),
|
|
198
|
+
icon: /* @__PURE__ */ jsx2(Trash, {}),
|
|
199
|
+
onClick: handleDelete
|
|
200
|
+
}
|
|
201
|
+
]
|
|
202
|
+
}
|
|
203
|
+
]
|
|
204
|
+
}
|
|
205
|
+
)
|
|
206
|
+
] })
|
|
207
|
+
] }),
|
|
208
|
+
/* @__PURE__ */ jsx2("div", { className: "px-6 py-4", children: /* @__PURE__ */ jsx2(ValuesDisplay, { values: sortedValues }) })
|
|
209
|
+
] });
|
|
210
|
+
};
|
|
211
|
+
var ValuesDisplay = ({ values }) => {
|
|
212
|
+
return /* @__PURE__ */ jsx2("div", { className: "flex flex-wrap items-center gap-2", children: values.map((value) => /* @__PURE__ */ jsx2(Badge, { size: "xsmall", children: value.value }, value.id)) });
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
// src/routes/product-options/product-option-detail/components/product-option-product-section/product-option-product-section.tsx
|
|
216
|
+
import { Container as Container2 } from "@medusajs/ui";
|
|
217
|
+
import { keepPreviousData } from "@tanstack/react-query";
|
|
218
|
+
import { useMemo as useMemo2 } from "react";
|
|
219
|
+
import { useTranslation as useTranslation3 } from "react-i18next";
|
|
220
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
221
|
+
var PAGE_SIZE = 10;
|
|
222
|
+
var ProductOptionProductSection = ({
|
|
223
|
+
productOption
|
|
224
|
+
}) => {
|
|
225
|
+
const { t } = useTranslation3();
|
|
226
|
+
const { searchParams } = useProductTableQuery({ pageSize: PAGE_SIZE });
|
|
227
|
+
const productIds = productOption.products?.map((p) => p.id) || [];
|
|
228
|
+
const { products, count, isLoading, isError, error } = useProducts(
|
|
229
|
+
{
|
|
230
|
+
limit: PAGE_SIZE,
|
|
231
|
+
...searchParams,
|
|
232
|
+
id: productIds.length > 0 ? productIds : void 0
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
placeholderData: keepPreviousData,
|
|
236
|
+
enabled: productIds.length > 0
|
|
237
|
+
}
|
|
238
|
+
);
|
|
239
|
+
const columns = useColumns();
|
|
240
|
+
if (isError) {
|
|
241
|
+
throw error;
|
|
242
|
+
}
|
|
243
|
+
return /* @__PURE__ */ jsx3(Container2, { className: "divide-y p-0", children: /* @__PURE__ */ jsx3(
|
|
244
|
+
DataTable,
|
|
245
|
+
{
|
|
246
|
+
data: products,
|
|
247
|
+
columns,
|
|
248
|
+
rowCount: count,
|
|
249
|
+
pageSize: PAGE_SIZE,
|
|
250
|
+
getRowId: (row) => row.id,
|
|
251
|
+
heading: t("products.domain"),
|
|
252
|
+
emptyState: {
|
|
253
|
+
empty: {
|
|
254
|
+
heading: t("general.noRecordsMessage")
|
|
255
|
+
},
|
|
256
|
+
filtered: {
|
|
257
|
+
heading: t("general.noRecordsMessage"),
|
|
258
|
+
description: t("general.noRecordsMessageFiltered")
|
|
259
|
+
}
|
|
260
|
+
},
|
|
261
|
+
isLoading,
|
|
262
|
+
enableSearch: true,
|
|
263
|
+
rowHref: (row) => `/products/${row.id}`
|
|
264
|
+
}
|
|
265
|
+
) });
|
|
266
|
+
};
|
|
267
|
+
var useColumns = () => {
|
|
268
|
+
const columns = useProductTableColumns();
|
|
269
|
+
return useMemo2(() => [...columns], [columns]);
|
|
270
|
+
};
|
|
271
|
+
|
|
272
|
+
// src/routes/product-options/product-option-detail/product-option-detail.tsx
|
|
273
|
+
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
274
|
+
var ProductOptionDetail = () => {
|
|
275
|
+
const { id } = useParams();
|
|
276
|
+
const initialData = useLoaderData();
|
|
277
|
+
const { getWidgets } = useExtension();
|
|
278
|
+
const { product_option, isLoading, isError, error } = useProductOption(
|
|
279
|
+
id,
|
|
280
|
+
void 0,
|
|
281
|
+
{
|
|
282
|
+
initialData
|
|
283
|
+
}
|
|
284
|
+
);
|
|
285
|
+
if (isLoading || !product_option) {
|
|
286
|
+
return /* @__PURE__ */ jsx4(SingleColumnPageSkeleton, { sections: 2, showJSON: true, showMetadata: true });
|
|
287
|
+
}
|
|
288
|
+
if (isError) {
|
|
289
|
+
throw error;
|
|
290
|
+
}
|
|
291
|
+
return /* @__PURE__ */ jsxs2(
|
|
292
|
+
SingleColumnPage,
|
|
293
|
+
{
|
|
294
|
+
widgets: {
|
|
295
|
+
after: getWidgets("product_option.details.after"),
|
|
296
|
+
before: getWidgets("product_option.details.before")
|
|
297
|
+
},
|
|
298
|
+
showJSON: true,
|
|
299
|
+
showMetadata: true,
|
|
300
|
+
data: product_option,
|
|
301
|
+
children: [
|
|
302
|
+
/* @__PURE__ */ jsx4(ProductOptionGeneralSection, { productOption: product_option }),
|
|
303
|
+
/* @__PURE__ */ jsx4(ProductOptionProductSection, { productOption: product_option })
|
|
304
|
+
]
|
|
305
|
+
}
|
|
306
|
+
);
|
|
307
|
+
};
|
|
308
|
+
|
|
309
|
+
// src/routes/product-options/product-option-detail/loader.ts
|
|
310
|
+
var productOptionDetailQuery = (id) => ({
|
|
311
|
+
queryKey: productOptionsQueryKeys.detail(id),
|
|
312
|
+
queryFn: async () => sdk.admin.productOption.retrieve(id)
|
|
313
|
+
});
|
|
314
|
+
var productOptionLoader = async ({ params }) => {
|
|
315
|
+
const id = params.id;
|
|
316
|
+
const query = productOptionDetailQuery(id);
|
|
317
|
+
return queryClient.ensureQueryData(query);
|
|
318
|
+
};
|
|
319
|
+
export {
|
|
320
|
+
ProductOptionBreadcrumb as Breadcrumb,
|
|
321
|
+
ProductOptionDetail as Component,
|
|
322
|
+
productOptionLoader as loader
|
|
323
|
+
};
|
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ChipInput
|
|
3
|
+
} from "./chunk-XDJ7OMBR.mjs";
|
|
4
|
+
import {
|
|
5
|
+
SortableList
|
|
6
|
+
} from "./chunk-ZHH3W7CN.mjs";
|
|
7
|
+
import "./chunk-IUCDCPJU.mjs";
|
|
8
|
+
import {
|
|
9
|
+
KeyboundForm
|
|
10
|
+
} from "./chunk-6HTZNHPT.mjs";
|
|
11
|
+
import {
|
|
12
|
+
RouteDrawer,
|
|
13
|
+
useRouteModal
|
|
14
|
+
} from "./chunk-AERWK3TJ.mjs";
|
|
15
|
+
import {
|
|
16
|
+
Form
|
|
17
|
+
} from "./chunk-OBQI23QM.mjs";
|
|
18
|
+
import {
|
|
19
|
+
useProductOption,
|
|
20
|
+
useUpdateProductOption
|
|
21
|
+
} from "./chunk-WOFUOGLO.mjs";
|
|
22
|
+
import "./chunk-KOSCMAIC.mjs";
|
|
23
|
+
import "./chunk-WWQZD7WM.mjs";
|
|
24
|
+
import "./chunk-X6DSNTTX.mjs";
|
|
25
|
+
import "./chunk-I6E6CALJ.mjs";
|
|
26
|
+
import "./chunk-QTCZFYFH.mjs";
|
|
27
|
+
import "./chunk-B4GODIOW.mjs";
|
|
28
|
+
import "./chunk-ENV6YVOM.mjs";
|
|
29
|
+
import "./chunk-PIR2H25N.mjs";
|
|
30
|
+
import "./chunk-C5LYZZZ5.mjs";
|
|
31
|
+
import "./chunk-RLY2SL5E.mjs";
|
|
32
|
+
import "./chunk-2ZKVRTBW.mjs";
|
|
33
|
+
import "./chunk-GBKLLUUX.mjs";
|
|
34
|
+
import "./chunk-P5RVJWPK.mjs";
|
|
35
|
+
import "./chunk-F6PXCY3N.mjs";
|
|
36
|
+
import "./chunk-R2G2B47Y.mjs";
|
|
37
|
+
import "./chunk-GRT22PE5.mjs";
|
|
38
|
+
import "./chunk-32IQRUVY.mjs";
|
|
39
|
+
import "./chunk-SBFWPL42.mjs";
|
|
40
|
+
import "./chunk-GVVAVAXG.mjs";
|
|
41
|
+
import "./chunk-7PWZ5GMG.mjs";
|
|
42
|
+
import "./chunk-NGR5XU3K.mjs";
|
|
43
|
+
import "./chunk-KX4P5L3R.mjs";
|
|
44
|
+
import "./chunk-V2LANK5S.mjs";
|
|
45
|
+
import "./chunk-QZ6PT4QV.mjs";
|
|
46
|
+
import "./chunk-QL4XKIVL.mjs";
|
|
47
|
+
import "./chunk-GVPJPLE2.mjs";
|
|
48
|
+
import "./chunk-FXYH54JP.mjs";
|
|
49
|
+
import "./chunk-774WSTCC.mjs";
|
|
50
|
+
import "./chunk-DEQUVHHE.mjs";
|
|
51
|
+
import "./chunk-QZ7TP4HQ.mjs";
|
|
52
|
+
|
|
53
|
+
// src/routes/product-options/product-option-edit/product-option-edit.tsx
|
|
54
|
+
import { Heading } from "@medusajs/ui";
|
|
55
|
+
import { useTranslation as useTranslation3 } from "react-i18next";
|
|
56
|
+
import { useParams } from "react-router-dom";
|
|
57
|
+
|
|
58
|
+
// src/routes/product-options/product-option-edit/components/edit-product-option-form/edit-product-option-form.tsx
|
|
59
|
+
import { zodResolver } from "@hookform/resolvers/zod";
|
|
60
|
+
import { Button, toast } from "@medusajs/ui";
|
|
61
|
+
import { useMemo as useMemo2 } from "react";
|
|
62
|
+
import { useForm } from "react-hook-form";
|
|
63
|
+
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
64
|
+
|
|
65
|
+
// src/routes/product-options/product-option-edit/components/edit-product-option-form/edit-product-option-details.tsx
|
|
66
|
+
import { Input } from "@medusajs/ui";
|
|
67
|
+
import { useEffect } from "react";
|
|
68
|
+
import { useWatch } from "react-hook-form";
|
|
69
|
+
import { useTranslation } from "react-i18next";
|
|
70
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
71
|
+
var EditProductOptionDetails = ({
|
|
72
|
+
form
|
|
73
|
+
}) => {
|
|
74
|
+
const { t } = useTranslation();
|
|
75
|
+
const values = useWatch({
|
|
76
|
+
control: form.control,
|
|
77
|
+
name: "values"
|
|
78
|
+
});
|
|
79
|
+
const valueRanks = useWatch({
|
|
80
|
+
control: form.control,
|
|
81
|
+
name: "value_ranks"
|
|
82
|
+
});
|
|
83
|
+
useEffect(() => {
|
|
84
|
+
if (!values || !valueRanks) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
const validValueSet = new Set(values);
|
|
88
|
+
const currentRanks = { ...valueRanks };
|
|
89
|
+
let hasStaleEntries = false;
|
|
90
|
+
Object.keys(currentRanks).forEach((key) => {
|
|
91
|
+
if (!validValueSet.has(key)) {
|
|
92
|
+
delete currentRanks[key];
|
|
93
|
+
hasStaleEntries = true;
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
if (hasStaleEntries) {
|
|
97
|
+
form.setValue("value_ranks", currentRanks, {
|
|
98
|
+
shouldDirty: true,
|
|
99
|
+
shouldTouch: true
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
}, [values, valueRanks, form]);
|
|
103
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-y-4", children: [
|
|
104
|
+
/* @__PURE__ */ jsx(
|
|
105
|
+
Form.Field,
|
|
106
|
+
{
|
|
107
|
+
control: form.control,
|
|
108
|
+
name: "title",
|
|
109
|
+
render: ({ field }) => {
|
|
110
|
+
return /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
111
|
+
/* @__PURE__ */ jsx(Form.Label, { children: t("productOptions.fields.title.label") }),
|
|
112
|
+
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(
|
|
113
|
+
Input,
|
|
114
|
+
{
|
|
115
|
+
autoComplete: "off",
|
|
116
|
+
...field,
|
|
117
|
+
placeholder: t("productOptions.fields.title.placeholder")
|
|
118
|
+
}
|
|
119
|
+
) }),
|
|
120
|
+
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
121
|
+
] });
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
),
|
|
125
|
+
/* @__PURE__ */ jsx(
|
|
126
|
+
Form.Field,
|
|
127
|
+
{
|
|
128
|
+
control: form.control,
|
|
129
|
+
name: "values",
|
|
130
|
+
render: ({ field }) => {
|
|
131
|
+
return /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
132
|
+
/* @__PURE__ */ jsx(Form.Label, { children: t("productOptions.fields.values.label") }),
|
|
133
|
+
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(
|
|
134
|
+
ChipInput,
|
|
135
|
+
{
|
|
136
|
+
...field,
|
|
137
|
+
placeholder: t("productOptions.fields.values.placeholder")
|
|
138
|
+
}
|
|
139
|
+
) }),
|
|
140
|
+
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
141
|
+
] });
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
)
|
|
145
|
+
] });
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
// src/routes/product-options/product-option-edit/components/edit-product-option-form/edit-product-option-organize.tsx
|
|
149
|
+
import { Text } from "@medusajs/ui";
|
|
150
|
+
import { useMemo } from "react";
|
|
151
|
+
import { useWatch as useWatch2 } from "react-hook-form";
|
|
152
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
153
|
+
var EditProductOptionOrganize = ({
|
|
154
|
+
form
|
|
155
|
+
}) => {
|
|
156
|
+
const values = useWatch2({
|
|
157
|
+
control: form.control,
|
|
158
|
+
name: "values"
|
|
159
|
+
});
|
|
160
|
+
const valueRanks = useWatch2({
|
|
161
|
+
control: form.control,
|
|
162
|
+
name: "value_ranks"
|
|
163
|
+
});
|
|
164
|
+
const items = useMemo(() => {
|
|
165
|
+
if (!values || values.length === 0) {
|
|
166
|
+
return [];
|
|
167
|
+
}
|
|
168
|
+
return values.map((value, index) => ({
|
|
169
|
+
id: value,
|
|
170
|
+
value,
|
|
171
|
+
rank: valueRanks?.[value] ?? index
|
|
172
|
+
})).sort((a, b) => a.rank - b.rank);
|
|
173
|
+
}, [values, valueRanks]);
|
|
174
|
+
const handleChange = (newItems) => {
|
|
175
|
+
const newRanks = {};
|
|
176
|
+
newItems.forEach((item, index) => {
|
|
177
|
+
newRanks[item.value] = index;
|
|
178
|
+
});
|
|
179
|
+
form.setValue("value_ranks", newRanks, {
|
|
180
|
+
shouldDirty: true,
|
|
181
|
+
shouldTouch: true
|
|
182
|
+
});
|
|
183
|
+
};
|
|
184
|
+
if (!values || values.length === 0) {
|
|
185
|
+
return null;
|
|
186
|
+
}
|
|
187
|
+
return /* @__PURE__ */ jsx2(
|
|
188
|
+
SortableList,
|
|
189
|
+
{
|
|
190
|
+
items,
|
|
191
|
+
onChange: handleChange,
|
|
192
|
+
renderItem: (item) => /* @__PURE__ */ jsx2(
|
|
193
|
+
SortableList.Item,
|
|
194
|
+
{
|
|
195
|
+
id: item.id,
|
|
196
|
+
className: "border-ui-border-base border-b last:border-b-0",
|
|
197
|
+
children: /* @__PURE__ */ jsxs2("div", { className: "flex flex-1 items-center gap-x-3 px-4 py-3", children: [
|
|
198
|
+
/* @__PURE__ */ jsx2(SortableList.DragHandle, {}),
|
|
199
|
+
/* @__PURE__ */ jsx2(Text, { size: "small", children: item.value })
|
|
200
|
+
] })
|
|
201
|
+
}
|
|
202
|
+
)
|
|
203
|
+
}
|
|
204
|
+
);
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
// src/routes/product-options/product-option-edit/components/edit-product-option-form/schema.ts
|
|
208
|
+
import { z } from "zod";
|
|
209
|
+
var EditProductOptionDetailsSchema = z.object({
|
|
210
|
+
title: z.string().min(1),
|
|
211
|
+
values: z.array(z.string()).min(1, "At least one value is required")
|
|
212
|
+
});
|
|
213
|
+
var EditProductOptionSchema = z.object({
|
|
214
|
+
value_ranks: z.record(z.string(), z.number()).optional()
|
|
215
|
+
}).merge(EditProductOptionDetailsSchema);
|
|
216
|
+
|
|
217
|
+
// src/routes/product-options/product-option-edit/components/edit-product-option-form/edit-product-option-form.tsx
|
|
218
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
219
|
+
var EditProductOptionForm = ({
|
|
220
|
+
productOption
|
|
221
|
+
}) => {
|
|
222
|
+
const { t } = useTranslation2();
|
|
223
|
+
const { handleSuccess } = useRouteModal();
|
|
224
|
+
const { sortedValues, existingRanks } = useMemo2(() => {
|
|
225
|
+
if (!productOption.values) {
|
|
226
|
+
return { sortedValues: [], existingRanks: {} };
|
|
227
|
+
}
|
|
228
|
+
const ranks = {};
|
|
229
|
+
productOption.values.forEach((v) => {
|
|
230
|
+
if (v.rank !== void 0 && v.rank !== null) {
|
|
231
|
+
ranks[v.value] = v.rank;
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
const sorted = [...productOption.values].sort((a, b) => {
|
|
235
|
+
const rankA = a.rank ?? Number.MAX_VALUE;
|
|
236
|
+
const rankB = b.rank ?? Number.MAX_VALUE;
|
|
237
|
+
return rankA - rankB;
|
|
238
|
+
});
|
|
239
|
+
return {
|
|
240
|
+
sortedValues: sorted.map((v) => v.value),
|
|
241
|
+
existingRanks: ranks
|
|
242
|
+
};
|
|
243
|
+
}, [productOption.values]);
|
|
244
|
+
const form = useForm({
|
|
245
|
+
defaultValues: {
|
|
246
|
+
title: productOption.title,
|
|
247
|
+
values: sortedValues,
|
|
248
|
+
value_ranks: existingRanks
|
|
249
|
+
},
|
|
250
|
+
resolver: zodResolver(EditProductOptionSchema)
|
|
251
|
+
});
|
|
252
|
+
const { mutateAsync, isPending } = useUpdateProductOption(productOption.id);
|
|
253
|
+
const handleSubmit = form.handleSubmit((data) => {
|
|
254
|
+
const { title, values, value_ranks } = data;
|
|
255
|
+
mutateAsync(
|
|
256
|
+
{
|
|
257
|
+
title,
|
|
258
|
+
values,
|
|
259
|
+
ranks: value_ranks
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
onSuccess: ({ product_option }) => {
|
|
263
|
+
toast.success(
|
|
264
|
+
t("productOptions.edit.successToast", {
|
|
265
|
+
title: product_option.title
|
|
266
|
+
})
|
|
267
|
+
);
|
|
268
|
+
handleSuccess();
|
|
269
|
+
},
|
|
270
|
+
onError: (error) => {
|
|
271
|
+
toast.error(error.message);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
);
|
|
275
|
+
});
|
|
276
|
+
return /* @__PURE__ */ jsx3(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs3(
|
|
277
|
+
KeyboundForm,
|
|
278
|
+
{
|
|
279
|
+
onSubmit: handleSubmit,
|
|
280
|
+
className: "flex size-full flex-col overflow-hidden",
|
|
281
|
+
children: [
|
|
282
|
+
/* @__PURE__ */ jsxs3(RouteDrawer.Body, { className: "flex flex-col gap-y-4 overflow-auto p-4", children: [
|
|
283
|
+
/* @__PURE__ */ jsx3(EditProductOptionDetails, { form }),
|
|
284
|
+
/* @__PURE__ */ jsx3(EditProductOptionOrganize, { form })
|
|
285
|
+
] }),
|
|
286
|
+
/* @__PURE__ */ jsx3(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs3("div", { className: "flex items-center justify-end gap-x-2", children: [
|
|
287
|
+
/* @__PURE__ */ jsx3(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx3(Button, { size: "small", variant: "secondary", children: t("actions.cancel") }) }),
|
|
288
|
+
/* @__PURE__ */ jsx3(
|
|
289
|
+
Button,
|
|
290
|
+
{
|
|
291
|
+
size: "small",
|
|
292
|
+
variant: "primary",
|
|
293
|
+
type: "submit",
|
|
294
|
+
isLoading: isPending,
|
|
295
|
+
children: t("actions.save")
|
|
296
|
+
}
|
|
297
|
+
)
|
|
298
|
+
] }) })
|
|
299
|
+
]
|
|
300
|
+
}
|
|
301
|
+
) });
|
|
302
|
+
};
|
|
303
|
+
|
|
304
|
+
// src/routes/product-options/product-option-edit/product-option-edit.tsx
|
|
305
|
+
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
306
|
+
var ProductOptionEdit = () => {
|
|
307
|
+
const { id } = useParams();
|
|
308
|
+
const { t } = useTranslation3();
|
|
309
|
+
const { product_option, isPending, isError, error } = useProductOption(id);
|
|
310
|
+
const ready = !isPending && !!product_option;
|
|
311
|
+
if (isError) {
|
|
312
|
+
throw error;
|
|
313
|
+
}
|
|
314
|
+
return /* @__PURE__ */ jsxs4(RouteDrawer, { children: [
|
|
315
|
+
/* @__PURE__ */ jsxs4(RouteDrawer.Header, { children: [
|
|
316
|
+
/* @__PURE__ */ jsx4(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx4(Heading, { children: t("productOptions.edit.header") }) }),
|
|
317
|
+
/* @__PURE__ */ jsx4(RouteDrawer.Description, { className: "sr-only", children: t("productOptions.edit.description") })
|
|
318
|
+
] }),
|
|
319
|
+
ready && /* @__PURE__ */ jsx4(EditProductOptionForm, { productOption: product_option })
|
|
320
|
+
] });
|
|
321
|
+
};
|
|
322
|
+
export {
|
|
323
|
+
ProductOptionEdit as Component
|
|
324
|
+
};
|