@mercurjs/admin 2.2.0 → 2.2.1-canary.0
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-KXVCLUG2.js → add-campaign-promotions-ARQN65B6.js} +9 -8
- package/dist/{adjust-inventory-5ZJJUEMJ.js → adjust-inventory-4ZOZCMSO.js} +10 -10
- package/dist/{api-key-management-create-OXI6OTIU.js → api-key-management-create-KJAP6KDX.js} +3 -3
- package/dist/{api-key-management-detail-ZTFHZK2W.js → api-key-management-detail-RV5Q45EV.js} +12 -12
- package/dist/{api-key-management-edit-QF5SAQE5.js → api-key-management-edit-N75HXUJF.js} +3 -3
- package/dist/{api-key-management-list-44HTIZDU.js → api-key-management-list-NGPTRNEE.js} +6 -6
- package/dist/{api-key-management-sales-channels-7HNHPB4N.js → api-key-management-sales-channels-A5F3D42D.js} +4 -4
- package/dist/{attribute-create-AGLZ6QOX.js → attribute-create-WDI2GMPM.js} +15 -15
- package/dist/{attribute-detail-62HLJFM3.js → attribute-detail-ZNPHAIL7.js} +18 -18
- package/dist/{attribute-edit-ZJS7KNRQ.js → attribute-edit-LBMZVL3O.js} +2 -2
- package/dist/{attribute-edit-possible-value-XK6DK7C3.js → attribute-edit-possible-value-RWG3U7IG.js} +2 -2
- package/dist/{attribute-list-VKAQ6254.js → attribute-list-QXNNF3NN.js} +13 -13
- package/dist/{breadcrumb-OF67XUWE.js → breadcrumb-2NHCSFUI.js} +1 -1
- package/dist/{campaign-budget-edit-TCWGNELH.js → campaign-budget-edit-7NXMWE2S.js} +1 -1
- package/dist/{campaign-configuration-AFGSG3MV.js → campaign-configuration-67I6NQNR.js} +1 -1
- package/dist/{campaign-create-OZV25GTH.js → campaign-create-NCJ4NA2B.js} +2 -2
- package/dist/{campaign-detail-G7DKPI5W.js → campaign-detail-MM5I4RGN.js} +18 -18
- package/dist/{campaign-edit-F6V6FWKS.js → campaign-edit-Z6A5J2G4.js} +1 -1
- package/dist/{campaign-list-QMEX7LES.js → campaign-list-FHPFFEM5.js} +4 -4
- package/dist/{categories-metadata-EKGY5IY2.js → categories-metadata-UN7P2PDA.js} +10 -10
- package/dist/{category-create-K452J7D3.js → category-create-3F6PHBRW.js} +3 -3
- package/dist/{category-detail-HUZ7MHT5.js → category-detail-RSGX5IKI.js} +18 -18
- package/dist/{category-edit-KP2ZSV6X.js → category-edit-YIGHQ442.js} +2 -2
- package/dist/{category-icon-edit-NNA7WVQV.js → category-icon-edit-6ZVXC4ID.js} +2 -2
- package/dist/{category-list-PXL4RTYP.js → category-list-SUER3DE3.js} +6 -6
- package/dist/{category-media-RFMA5Y5K.js → category-media-IEIIXESO.js} +2 -2
- package/dist/{category-organize-NNIYSZJT.js → category-organize-7QJ4MAA4.js} +2 -2
- package/dist/{category-products-RR5RFHYX.js → category-products-NOZYZHP7.js} +16 -16
- package/dist/chunk-2IDWFEKH.js +30 -0
- package/dist/{chunk-GS7VNGVP.js → chunk-2W4YIJYV.js} +1 -1
- package/dist/{chunk-4EM4RG5L.js → chunk-34AHGPLC.js} +1 -1
- package/dist/{chunk-46WFUTZ7.js → chunk-3FOZERFM.js} +4 -4
- package/dist/{chunk-XQ5IRC23.js → chunk-3PWLO7XZ.js} +4 -4
- package/dist/{chunk-TBZRRZP2.js → chunk-3RM44AH4.js} +2 -2
- package/dist/{chunk-GPACCA4B.js → chunk-4DHTLLPG.js} +2 -2
- package/dist/{chunk-XYLQODIX.js → chunk-4DWSG7TM.js} +2 -2
- package/dist/{chunk-6FZTLQKQ.js → chunk-4JNQHJKX.js} +4 -4
- package/dist/{chunk-52KJSIHS.js → chunk-4UQMRTSC.js} +1393 -1359
- package/dist/{chunk-BAW3F2JM.js → chunk-52C7Q74T.js} +2 -2
- package/dist/{chunk-FEEYWP65.js → chunk-5346HYMP.js} +1 -1
- package/dist/{chunk-2TTWEY5U.js → chunk-53KPM2IF.js} +1 -1
- package/dist/{chunk-EU2CV4TC.js → chunk-5P2YBCU4.js} +1 -1
- package/dist/{chunk-ZYW5QC2S.js → chunk-5SJGXU6J.js} +1 -1
- package/dist/{chunk-H6PRFXGU.js → chunk-5WJ6LPXM.js} +1 -1
- package/dist/{chunk-4TW5RTWO.js → chunk-5YT4OYMI.js} +2 -2
- package/dist/{chunk-IEYTK56D.js → chunk-6AUFNHJ4.js} +1 -1
- package/dist/{chunk-Z6KZDJNZ.js → chunk-6C5EXVG7.js} +4 -4
- package/dist/{chunk-N2WNCZLR.js → chunk-6L6HRSV7.js} +2 -2
- package/dist/{chunk-MSUG6ERE.js → chunk-6ZVLQ4IK.js} +3 -3
- package/dist/{chunk-WRAOTX6G.js → chunk-AJJSAJWK.js} +8 -4
- package/dist/{chunk-PQYZXLKV.js → chunk-AYK22LJU.js} +3 -3
- package/dist/{chunk-NHKZJMNX.js → chunk-BEHI3OYC.js} +2 -2
- package/dist/{chunk-XH2SXM7F.js → chunk-BIMJMDKU.js} +1 -1
- package/dist/{chunk-NGKC43E3.js → chunk-BNT2LEY5.js} +4 -4
- package/dist/{chunk-LAS6SXKB.js → chunk-C3SCJHQN.js} +1 -1
- package/dist/{chunk-3WT5O2NN.js → chunk-COH2G4BO.js} +2 -2
- package/dist/{chunk-LEHORJ76.js → chunk-CZN2FPHR.js} +1 -1
- package/dist/{chunk-TDDEAQ3T.js → chunk-EJNYP4ZP.js} +286 -229
- package/dist/{chunk-6QXSN5IG.js → chunk-EKLQ3PFC.js} +1 -1
- package/dist/{chunk-L2HIQAOS.js → chunk-EXZFNGEH.js} +11 -1
- package/dist/{chunk-CRKA4PUH.js → chunk-F5TGLYES.js} +3 -3
- package/dist/{chunk-PZRHF4NZ.js → chunk-FGHHNTWJ.js} +1 -1
- package/dist/{chunk-Y5RHBN7J.js → chunk-FRUJ3RNF.js} +1 -1
- package/dist/{chunk-P73BQ56H.js → chunk-GAHJUTEI.js} +6 -6
- package/dist/{chunk-D24Q3XHG.js → chunk-GBSL5JTZ.js} +1 -1
- package/dist/{chunk-IHO6OGWR.js → chunk-GINON6FD.js} +1 -1
- package/dist/{chunk-5JHHADVY.js → chunk-GUXBEXAN.js} +1 -1
- package/dist/{chunk-6RMCSQBI.js → chunk-GXKT2GQ7.js} +445 -211
- package/dist/{chunk-6XYDJWNG.js → chunk-GXYCGT7P.js} +1 -1
- package/dist/{chunk-4EBW73IY.js → chunk-GYMFTVB4.js} +1 -1
- package/dist/{chunk-U7XBLL2L.js → chunk-H3PH7ZYY.js} +5 -5
- package/dist/{chunk-HC2TEEKQ.js → chunk-HKHDRY5B.js} +4 -1
- package/dist/{chunk-IB7PFZNA.js → chunk-HRDRZOL4.js} +2 -2
- package/dist/{chunk-XIB2KDE7.js → chunk-HRPM4HIB.js} +1 -1
- package/dist/{chunk-QYPNC3U5.js → chunk-IPC6RQQ7.js} +1 -1
- package/dist/{chunk-QSB2PR6Y.js → chunk-IWS4FEAA.js} +3 -3
- package/dist/{chunk-GRFWCCUW.js → chunk-IZYVY2QV.js} +1 -1
- package/dist/{chunk-ICAXGUPY.js → chunk-J37PJ6OX.js} +15 -44
- package/dist/chunk-JU5ALCEN.js +82 -0
- package/dist/{chunk-7CAQDCJ4.js → chunk-JZZLMXG4.js} +1 -1
- package/dist/{chunk-PYNVCRQK.js → chunk-K4LPEHOH.js} +1 -1
- package/dist/{chunk-3C5EMQWG.js → chunk-LKGRPE3Y.js} +4 -4
- package/dist/{chunk-VWT7NSJO.js → chunk-LU7SPDKK.js} +89 -252
- package/dist/{chunk-YCAPN5F6.js → chunk-LUPIJMZB.js} +56 -26
- package/dist/{chunk-S2ZNHDPO.js → chunk-MUAEOX6S.js} +6 -6
- package/dist/{chunk-YBMTMG47.js → chunk-MXLSIF5V.js} +1 -1
- package/dist/{chunk-XVHXE7GQ.js → chunk-MXVWKV4Z.js} +2 -2
- package/dist/{chunk-JXMEDALI.js → chunk-MZNO6GSW.js} +1 -1
- package/dist/{chunk-7LSEDXCB.js → chunk-NGJUDYMP.js} +1 -1
- package/dist/{chunk-QF22CPST.js → chunk-NSCHKQQL.js} +4 -4
- package/dist/{chunk-O4X3FYQ2.js → chunk-NUD4H2VZ.js} +2 -2
- package/dist/{chunk-QD5I3ZC4.js → chunk-OADEOZJ3.js} +6 -6
- package/dist/{chunk-GSWFRYKT.js → chunk-OPIRMBSK.js} +5 -5
- package/dist/{chunk-O3Q2YJNR.js → chunk-OT323T4H.js} +5 -5
- package/dist/{chunk-SZCQUPC6.js → chunk-OY5QD46V.js} +1 -1
- package/dist/{chunk-HI2UJ43B.js → chunk-OZEICR2S.js} +3 -3
- package/dist/{chunk-CC7MG2B7.js → chunk-PBIJMBAE.js} +2 -2
- package/dist/{chunk-EDCGEQ4V.js → chunk-PEPANIBF.js} +1 -1
- package/dist/{chunk-EITNWVKQ.js → chunk-PVNB7ETQ.js} +1 -1
- package/dist/{chunk-ZNEC7NSD.js → chunk-PW64YRH4.js} +9 -9
- package/dist/{chunk-QRN63LUS.js → chunk-QE57IFSR.js} +1 -20
- package/dist/{chunk-R6433WFI.js → chunk-QMEFPNCA.js} +1 -1
- package/dist/{chunk-2O6SLX2J.js → chunk-R55WKWFH.js} +1 -1
- package/dist/{chunk-BVVZLZBO.js → chunk-R7Q23SWH.js} +3 -3
- package/dist/{chunk-4OMNDHD2.js → chunk-RDDZLUKZ.js} +18 -12
- package/dist/{chunk-AQCA7HGL.js → chunk-RKGGKEPI.js} +5 -5
- package/dist/{chunk-42BAC3EV.js → chunk-RLOKMTTN.js} +11 -0
- package/dist/{chunk-6TJPMF7U.js → chunk-RPWO23NX.js} +2 -2
- package/dist/{chunk-FU6XA7IT.js → chunk-SNRPPG3Z.js} +3 -3
- package/dist/{chunk-LZSUKT5X.js → chunk-TF74ITJS.js} +6 -6
- package/dist/{chunk-UCA7UES2.js → chunk-U4BIWWRA.js} +1 -1
- package/dist/{chunk-I6T244NF.js → chunk-U6EIJREE.js} +1 -1
- package/dist/{chunk-XRSHPAED.js → chunk-UNNSF2VP.js} +1 -1
- package/dist/chunk-UST2RGWB.js +37 -0
- package/dist/{chunk-KX6C5FDB.js → chunk-V52NWX56.js} +1 -1
- package/dist/{chunk-7PPT3477.js → chunk-VBEQXZ2Z.js} +19 -10
- package/dist/{chunk-J5CQ6F6U.js → chunk-VKHGNAFW.js} +1 -1
- package/dist/{chunk-LNBYVXJX.js → chunk-VQN77LKF.js} +59 -10
- package/dist/{chunk-NLLX6JO6.js → chunk-WE4RBSHT.js} +3 -3
- package/dist/{chunk-XJAMGFC5.js → chunk-WIFK6L7P.js} +2 -2
- package/dist/{chunk-HPFFEXS6.js → chunk-WJJBIAJI.js} +2 -2
- package/dist/{chunk-5NC3VFXY.js → chunk-WR3WSUIV.js} +1 -1
- package/dist/{chunk-GNBUH5DG.js → chunk-WX5UZZZD.js} +1 -1
- package/dist/{chunk-GTFDJLHW.js → chunk-Y2UMDTV4.js} +22 -17
- package/dist/{chunk-HEXXU3V3.js → chunk-Y3IDGFA4.js} +3 -3
- package/dist/{chunk-CRHUF6Q6.js → chunk-YG65LX2W.js} +2 -2
- package/dist/{chunk-QHVRUP4S.js → chunk-YNPIZEWG.js} +2 -2
- package/dist/{chunk-4XRTTHJZ.js → chunk-YTBPZ5MO.js} +1 -1
- package/dist/{collection-add-products-CJEX5A53.js → collection-add-products-HPEJTRYI.js} +16 -16
- package/dist/{collection-create-TBEK75Y3.js → collection-create-3ZCR6VGP.js} +2 -2
- package/dist/{collection-detail-H2Q6WOUM.js → collection-detail-W6CGGW5S.js} +17 -17
- package/dist/{collection-edit-7RBQZNQ6.js → collection-edit-LIIDFJ6T.js} +2 -2
- package/dist/{collection-icon-edit-JQZXC2S3.js → collection-icon-edit-GMWBV5EA.js} +2 -2
- package/dist/{collection-list-ZMDJT77J.js → collection-list-AFDLBBLJ.js} +18 -18
- package/dist/{collection-media-H3CQH6DM.js → collection-media-FHD3IAES.js} +2 -2
- package/dist/{collection-metadata-7FOQ22FA.js → collection-metadata-PEBMVFM3.js} +10 -10
- package/dist/{commission-rule-detail-ISEXGPY6.js → commission-rule-detail-FSV6PA6Y.js} +4 -4
- package/dist/{commissions-list-OJ44UKGL.js → commissions-list-PRA3DROC.js} +6 -6
- package/dist/{customer-detail-LB5A5RDI.js → customer-detail-Z63YC3CC.js} +14 -14
- package/dist/{customer-group-add-customers-DK32GSHX.js → customer-group-add-customers-ZROAA2ZG.js} +2 -2
- package/dist/{customer-group-detail-TABEQDDU.js → customer-group-detail-K6TMJ66E.js} +13 -13
- package/dist/{customer-group-list-FLSK5QJD.js → customer-group-list-TJFAFJJA.js} +13 -13
- package/dist/{customer-group-metadata-V5S6BIXN.js → customer-group-metadata-2GHR645Q.js} +10 -10
- package/dist/{customer-list-E72FR2HJ.js → customer-list-BK2SAQES.js} +3 -3
- package/dist/{customer-metadata-4LLZ4ZMR.js → customer-metadata-H2BVMMPM.js} +10 -10
- package/dist/{customers-add-customer-group-FCZYSHXJ.js → customers-add-customer-group-YFNPS2EL.js} +12 -12
- package/dist/{edit-inventory-item-46KQFZVA.js → edit-inventory-item-DD5ZG32Y.js} +10 -10
- package/dist/{edit-inventory-item-attributes-ELHT4C2Y.js → edit-inventory-item-attributes-VNLOF6NO.js} +10 -10
- package/dist/{edit-reservation-PCKNMHXC.js → edit-reservation-CA6SMY3V.js} +2 -2
- package/dist/{edit-rules-GDQHJ3YV.js → edit-rules-F42247KN.js} +20 -12
- package/dist/extension-targets.d.ts +2 -2
- package/dist/index.css +14 -5
- package/dist/index.d.ts +4 -5
- package/dist/index.js +215 -215
- package/dist/{inventory-create-POFYTZXF.js → inventory-create-VDO4OWZJ.js} +11 -11
- package/dist/{inventory-detail-BKRLIEBM.js → inventory-detail-CBGHNIHH.js} +13 -13
- package/dist/{inventory-list-FEV27NU6.js → inventory-list-YRGVDHKT.js} +4 -4
- package/dist/{inventory-metadata-63TI6TPT.js → inventory-metadata-SVEEQKIY.js} +10 -10
- package/dist/{inventory-stock-KUNNVL4K.js → inventory-stock-3WSWPSMT.js} +10 -10
- package/dist/{loader-MD6G3UZA.js → loader-5VHWG2HX.js} +1 -1
- package/dist/{location-detail-MHJK22BY.js → location-detail-TIHXQBZW.js} +12 -12
- package/dist/{location-fulfillment-providers-5LMLVCH3.js → location-fulfillment-providers-XULTKWDA.js} +16 -16
- package/dist/{location-list-DRCT7MJW.js → location-list-4RNLWRLN.js} +12 -11
- package/dist/{location-sales-channels-5ONDOTKC.js → location-sales-channels-MMRCF6QT.js} +3 -3
- package/dist/{location-service-zone-create-SSMZUELJ.js → location-service-zone-create-AC2PAK2X.js} +3 -3
- package/dist/{location-service-zone-manage-areas-QP3WONCG.js → location-service-zone-manage-areas-WXBQAEGB.js} +3 -3
- package/dist/{location-service-zone-shipping-option-create-QBGIX2IS.js → location-service-zone-shipping-option-create-CJI2IDS2.js} +10 -10
- package/dist/{login-BJNN5BDP.js → login-7R2QVOMB.js} +10 -10
- package/dist/{manage-locations-X76IQE2V.js → manage-locations-E2ODEJC5.js} +1 -1
- package/dist/{marketplace-add-currencies-DNI3AV3A.js → marketplace-add-currencies-GSR5IFFC.js} +2 -2
- package/dist/{marketplace-detail-73DJFMI7.js → marketplace-detail-CYNEUPOG.js} +13 -13
- package/dist/{marketplace-metadata-PSMQ7E3O.js → marketplace-metadata-75DPIUID.js} +10 -10
- package/dist/{offer-detail-page-XJFDKX4Z.js → offer-detail-page-GHSCR452.js} +16 -23
- package/dist/{offer-variant-detail-page-6QPGQSLY.js → offer-variant-detail-page-JLUJ7FQ4.js} +3 -3
- package/dist/{offers-7IRUIP7L.js → offers-NKMURHLM.js} +15 -15
- package/dist/{order-create-claim-UJKXA37S.js → order-create-claim-LF23TJ2Z.js} +2 -2
- package/dist/{order-create-edit-5U2QNJ5S.js → order-create-edit-ZF6YEUAW.js} +5 -5
- package/dist/{order-create-exchange-R5TOVSJZ.js → order-create-exchange-NM2JT5OF.js} +12 -12
- package/dist/{order-create-refund-MEAXQVIZ.js → order-create-refund-FWRG3VIW.js} +10 -10
- package/dist/{order-create-return-MEUIY4VU.js → order-create-return-YV5HXMY7.js} +2 -2
- package/dist/{order-detail-QE4HBQ5W.js → order-detail-S3ENSWQ3.js} +14 -14
- package/dist/{order-edit-billing-address-7S2QIRSZ.js → order-edit-billing-address-UYZNY77G.js} +11 -11
- package/dist/{order-edit-email-EE26NWGK.js → order-edit-email-GVGQLXNK.js} +10 -10
- package/dist/{order-edit-shipping-address-7G5JUVKW.js → order-edit-shipping-address-RS3PRPVM.js} +10 -10
- package/dist/{order-list-QILNDFBC.js → order-list-JBCU6ZZD.js} +9 -9
- package/dist/{order-metadata-UBUSPFTW.js → order-metadata-2TOR4BJY.js} +10 -10
- package/dist/{order-request-transfer-EO76XRGE.js → order-request-transfer-6JJ2FQPA.js} +10 -10
- package/dist/pages/index.d.ts +320 -41
- package/dist/pages/index.js +98 -96
- package/dist/{payout-list-R6ESKT7V.js → payout-list-N6L7HNA5.js} +3 -3
- package/dist/{price-list-configuration-D6IS7UY5.js → price-list-configuration-BGV74K6U.js} +6 -6
- package/dist/{price-list-create-4TDXQ7UF.js → price-list-create-T4P2TWFS.js} +18 -18
- package/dist/{price-list-detail-TUKXO5WG.js → price-list-detail-JBXWXU7K.js} +18 -18
- package/dist/{price-list-edit-YCR47ZXS.js → price-list-edit-FQVZW4FT.js} +2 -2
- package/dist/{price-list-list-TSK3TWUX.js → price-list-list-KINPGGQQ.js} +6 -6
- package/dist/{price-list-prices-add-VEQQYNEA.js → price-list-prices-add-2R4A2UVP.js} +17 -17
- package/dist/{price-list-prices-edit-ANLZGAY4.js → price-list-prices-edit-PZN63VWV.js} +10 -10
- package/dist/{product-add-existing-attributes-3S3E3TDO.js → product-add-existing-attributes-LQ3S5RBE.js} +16 -16
- package/dist/{product-attributes-SY656CC5.js → product-attributes-JUEMRL5V.js} +1 -1
- package/dist/{product-bulk-edit-XU2MFL4U.js → product-bulk-edit-7GWRXFUC.js} +1 -1
- package/dist/{product-create-KILMAWD7.js → product-create-RUMS2AIE.js} +17 -17
- package/dist/{product-create-attribute-XM47T3D6.js → product-create-attribute-7P4LZP5R.js} +2 -2
- package/dist/{product-create-variant-3XVP5IWI.js → product-create-variant-74KLCMEU.js} +4 -4
- package/dist/{product-detail-B4HVVOY3.js → product-detail-XHT5SGCW.js} +15 -15
- package/dist/{product-edit-ZX33LEQM.js → product-edit-GAYL53YC.js} +1 -1
- package/dist/product-edit-attribute-EBES4PJ3.js +90 -0
- package/dist/{product-list-DNZVZ3NC.js → product-list-JQRCIWTE.js} +17 -17
- package/dist/{product-media-QY4RFTYZ.js → product-media-4LDPBVQ5.js} +4 -4
- package/dist/{product-metadata-TGAAEG4O.js → product-metadata-YZKS2MQV.js} +10 -10
- package/dist/{product-organization-JPPQYC5E.js → product-organization-6TQ4HKB2.js} +4 -4
- package/dist/{product-sales-channels-CVAXZ7C7.js → product-sales-channels-K7VOMWUP.js} +3 -3
- package/dist/{product-shipping-profile-7F5GW6PQ.js → product-shipping-profile-SYGR4IF7.js} +1 -1
- package/dist/{product-tag-create-MZV3LCQT.js → product-tag-create-J6SUTGLF.js} +10 -10
- package/dist/{product-tag-detail-SANSVX5Z.js → product-tag-detail-MCHNANH4.js} +20 -20
- package/dist/{product-tag-edit-3BSAEN4H.js → product-tag-edit-XTCRJPYD.js} +10 -10
- package/dist/{product-tag-list-NFOAK7II.js → product-tag-list-4SEHT2NG.js} +20 -20
- package/dist/{product-tag-metadata-VNH5GXMK.js → product-tag-metadata-UMQPCGKY.js} +10 -10
- package/dist/{product-type-detail-ZIGX5HUJ.js → product-type-detail-SHU5N2RG.js} +17 -17
- package/dist/{product-type-list-D7GAIR2E.js → product-type-list-AVAO26QW.js} +3 -3
- package/dist/{product-type-metadata-6KXQSYK5.js → product-type-metadata-RIRSRMDO.js} +10 -10
- package/dist/{product-variant-detail-LIXWU3V2.js → product-variant-detail-XWREJ4EK.js} +11 -11
- package/dist/{product-variant-edit-GK5A2XMB.js → product-variant-edit-PCD66JBM.js} +12 -12
- package/dist/{product-variant-metadata-4BULTZ3M.js → product-variant-metadata-UJOLOTCQ.js} +10 -10
- package/dist/{promotion-add-campaign-AU43PI2F.js → promotion-add-campaign-KS5SSTMP.js} +8 -3
- package/dist/{promotion-create-5BJ4EVAI.js → promotion-create-XYXVAF67.js} +14 -14
- package/dist/{promotion-detail-S5R5UXJ6.js → promotion-detail-EFW4P6N6.js} +21 -37
- package/dist/{promotion-edit-details-GURXKLSK.js → promotion-edit-details-SH27X7GF.js} +293 -143
- package/dist/{promotion-list-22NDDYPQ.js → promotion-list-MVXEOO5I.js} +10 -9
- package/dist/{refund-reason-create-SUJIXZMY.js → refund-reason-create-XEBLTB3C.js} +10 -10
- package/dist/{refund-reason-edit-B3Q2DGXR.js → refund-reason-edit-J3KQ2FVF.js} +10 -10
- package/dist/{refund-reason-list-JLKMODL4.js → refund-reason-list-I2EACZ64.js} +15 -15
- package/dist/{region-add-countries-LF3AV6GE.js → region-add-countries-GKKZVGKH.js} +2 -2
- package/dist/{region-create-CVQVVWVA.js → region-create-2XEJLBWS.js} +2 -2
- package/dist/{region-detail-JGSC4A2U.js → region-detail-LILWL7FN.js} +3 -3
- package/dist/{region-list-ZZJNZWOP.js → region-list-E6OMK3OU.js} +3 -3
- package/dist/{region-metadata-EFQS2FU6.js → region-metadata-GDKM4ND5.js} +10 -10
- package/dist/{reservation-create-WC7RIX5E.js → reservation-create-77EYD2ZZ.js} +2 -2
- package/dist/{reservation-detail-XYRHURYY.js → reservation-detail-M7ZAEO3G.js} +11 -11
- package/dist/{reservation-list-IKDEV3JB.js → reservation-list-EJMYXNZV.js} +5 -5
- package/dist/{reservation-metadata-44QNS5IN.js → reservation-metadata-E6WP6SHE.js} +10 -10
- package/dist/{reset-password-CCHTZ4YX.js → reset-password-P45OKOT4.js} +1 -1
- package/dist/{return-reason-list-6WUNAHM6.js → return-reason-list-QWQUXSXO.js} +7 -7
- package/dist/{sales-channel-add-products-PYO5W5KK.js → sales-channel-add-products-Q6YXGNQB.js} +16 -16
- package/dist/{sales-channel-create-WSROI4MD.js → sales-channel-create-BYCHXO7N.js} +2 -2
- package/dist/{sales-channel-detail-DBVRTBF7.js → sales-channel-detail-EQMYYPW6.js} +17 -17
- package/dist/{sales-channel-edit-SNXG34Z3.js → sales-channel-edit-KHHDBZQG.js} +2 -2
- package/dist/{sales-channel-list-VWXBOQYJ.js → sales-channel-list-J4624AXE.js} +12 -12
- package/dist/{sales-channel-metadata-2LJBDKYI.js → sales-channel-metadata-QAXDOSPG.js} +10 -10
- package/dist/{shipping-option-type-create-ZRWS4PGU.js → shipping-option-type-create-AULMQGRN.js} +10 -10
- package/dist/{shipping-option-type-detail-KUGZH5YF.js → shipping-option-type-detail-EQDAW4GJ.js} +10 -10
- package/dist/{shipping-option-type-edit-24XNCOIH.js → shipping-option-type-edit-NVXGY32I.js} +10 -10
- package/dist/{shipping-option-type-list-4XTVL3AD.js → shipping-option-type-list-PW44GDWO.js} +13 -13
- package/dist/{shipping-profile-metadata-O3AG4LS4.js → shipping-profile-metadata-OW5IGIW3.js} +10 -10
- package/dist/{shipping-profiles-list-4SBV3D52.js → shipping-profiles-list-HP3GZTW6.js} +3 -3
- package/dist/{store-bulk-edit-J5G2TKVA.js → store-bulk-edit-KOBCPVNM.js} +1 -1
- package/dist/{store-create-VKLIAHQL.js → store-create-YPCF45XH.js} +10 -10
- package/dist/{store-details-DWV3WMKC.js → store-details-KDCMXPK2.js} +18 -18
- package/dist/{store-edit-WIAZLSHU.js → store-edit-BGQJW7GH.js} +3 -3
- package/dist/{store-list-HZCRXW5L.js → store-list-SBY73JTY.js} +18 -18
- package/dist/{store-member-invite-6ZIH6B7U.js → store-member-invite-2WGAJVIX.js} +1 -1
- package/dist/{tax-region-create-2NPI4MUT.js → tax-region-create-7UUVKDZM.js} +11 -11
- package/dist/{tax-region-detail-W4RAVJVN.js → tax-region-detail-B2AIDTXD.js} +14 -14
- package/dist/{tax-region-edit-RZRSLGFZ.js → tax-region-edit-UQAMWLO5.js} +10 -10
- package/dist/{tax-region-list-Y2XSQSCD.js → tax-region-list-MVDXWVIK.js} +3 -3
- package/dist/{tax-region-metadata-OQX67IIE.js → tax-region-metadata-UONPCPC6.js} +10 -10
- package/dist/{tax-region-province-detail-BS7INZML.js → tax-region-province-detail-XFUAN2R7.js} +13 -13
- package/dist/{tax-region-tax-override-create-NRO7QCVL.js → tax-region-tax-override-create-7TQVZLLY.js} +20 -20
- package/dist/{tax-region-tax-override-edit-POJATJRW.js → tax-region-tax-override-edit-ZJ6TFQRV.js} +20 -20
- package/dist/{user-detail-RNP7ADME.js → user-detail-IYB2LYGS.js} +1 -1
- package/dist/{user-invite-TUDDN7KP.js → user-invite-ZGB23H4G.js} +2 -2
- package/dist/{user-list-JT3HWEGY.js → user-list-FZ7CGJ5N.js} +3 -3
- package/dist/{user-metadata-PNIWSBYP.js → user-metadata-OXHKB6LT.js} +10 -10
- package/package.json +15 -15
- package/dist/chunk-S2WEYEQR.js +0 -14
- package/dist/product-edit-attribute-QC22TRX4.js +0 -336
|
@@ -10,10 +10,9 @@ import {
|
|
|
10
10
|
import "./chunk-3QSRE5LS.js";
|
|
11
11
|
import "./chunk-XQBF2FRT.js";
|
|
12
12
|
import "./chunk-J7YEXYZJ.js";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-FRUJ3RNF.js";
|
|
14
14
|
import "./chunk-R7HPBN4C.js";
|
|
15
15
|
import "./chunk-EMZXHZJQ.js";
|
|
16
|
-
import "./chunk-XPTKT2SY.js";
|
|
17
16
|
import "./chunk-42VZYFJ5.js";
|
|
18
17
|
import "./chunk-R45DOGQ6.js";
|
|
19
18
|
import "./chunk-HI2E3YTU.js";
|
|
@@ -27,24 +26,25 @@ import {
|
|
|
27
26
|
} from "./chunk-D6RWXLO6.js";
|
|
28
27
|
import "./chunk-BOHYPLFV.js";
|
|
29
28
|
import "./chunk-55NZ2MMZ.js";
|
|
30
|
-
import "./chunk-
|
|
31
|
-
import "./chunk-
|
|
29
|
+
import "./chunk-HRPM4HIB.js";
|
|
30
|
+
import "./chunk-2W4YIJYV.js";
|
|
32
31
|
import "./chunk-2Z4JZU5E.js";
|
|
33
32
|
import "./chunk-JJKPETJT.js";
|
|
34
|
-
import "./chunk-
|
|
33
|
+
import "./chunk-RLOKMTTN.js";
|
|
35
34
|
import "./chunk-EAYVJOSP.js";
|
|
36
35
|
import "./chunk-IF2MFOIQ.js";
|
|
37
|
-
import "./chunk-
|
|
36
|
+
import "./chunk-U4BIWWRA.js";
|
|
38
37
|
import "./chunk-Y4QL7QLU.js";
|
|
39
38
|
import "./chunk-43C2OEFK.js";
|
|
40
|
-
import "./chunk-6HHMZ2QV.js";
|
|
41
39
|
import "./chunk-HOOIU4KF.js";
|
|
42
|
-
import "./chunk-
|
|
43
|
-
import "./chunk-
|
|
40
|
+
import "./chunk-6HHMZ2QV.js";
|
|
41
|
+
import "./chunk-MXLSIF5V.js";
|
|
42
|
+
import "./chunk-XPTKT2SY.js";
|
|
43
|
+
import "./chunk-C3SCJHQN.js";
|
|
44
44
|
import "./chunk-LAVHRER2.js";
|
|
45
45
|
import "./chunk-Y7QKP6QU.js";
|
|
46
46
|
import "./chunk-INNFZYX2.js";
|
|
47
|
-
import "./chunk-
|
|
47
|
+
import "./chunk-QE57IFSR.js";
|
|
48
48
|
import "./chunk-RHKRREUU.js";
|
|
49
49
|
import "./chunk-ZA2KFUFR.js";
|
|
50
50
|
import "./chunk-JTAECZCT.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mercurjs/admin",
|
|
3
|
-
"version": "2.2.0",
|
|
3
|
+
"version": "2.2.1-canary.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/mercurjs/mercur",
|
|
@@ -34,15 +34,15 @@
|
|
|
34
34
|
"lint": "oxlint --max-warnings 0"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@mercurjs/dashboard-shared": "2.2.0",
|
|
38
|
-
"@mercurjs/client": "2.2.0",
|
|
37
|
+
"@mercurjs/dashboard-shared": "2.2.1-canary.0",
|
|
38
|
+
"@mercurjs/client": "2.2.1-canary.0",
|
|
39
39
|
"@ariakit/react": "^0.4.15",
|
|
40
|
-
"@babel/runtime": "^
|
|
40
|
+
"@babel/runtime": "^8.0.0",
|
|
41
41
|
"@dnd-kit/core": "^6.1.0",
|
|
42
42
|
"@dnd-kit/sortable": "^8.0.0",
|
|
43
43
|
"@dnd-kit/utilities": "^3.2.2",
|
|
44
44
|
"@hookform/error-message": "^2.0.1",
|
|
45
|
-
"@hookform/resolvers": "
|
|
45
|
+
"@hookform/resolvers": "5.4.0",
|
|
46
46
|
"@medusajs/admin-shared": "2.17.2",
|
|
47
47
|
"@medusajs/dashboard": "2.17.2",
|
|
48
48
|
"@medusajs/icons": "2.17.2",
|
|
@@ -50,10 +50,10 @@
|
|
|
50
50
|
"@radix-ui/react-dialog": "1.1.19",
|
|
51
51
|
"@radix-ui/react-dismissable-layer": "1.1.4",
|
|
52
52
|
"@tanstack/react-query": "5.64.2",
|
|
53
|
-
"@tanstack/react-table": "8.
|
|
53
|
+
"@tanstack/react-table": "8.21.3",
|
|
54
54
|
"@tanstack/react-virtual": "^3.8.3",
|
|
55
55
|
"@uiw/react-json-view": "^2.0.0-alpha.17",
|
|
56
|
-
"cmdk": "^
|
|
56
|
+
"cmdk": "^1.1.1",
|
|
57
57
|
"copy-to-clipboard": "^4.0.2",
|
|
58
58
|
"date-fns": "^3.6.0",
|
|
59
59
|
"i18next": "26.3.5",
|
|
@@ -61,16 +61,16 @@
|
|
|
61
61
|
"i18next-http-backend": "2.4.2",
|
|
62
62
|
"lodash.debounce": "^4.0.8",
|
|
63
63
|
"lodash.isequal": "^4.5.0",
|
|
64
|
-
"match-sorter": "^
|
|
64
|
+
"match-sorter": "^8.3.0",
|
|
65
65
|
"motion": "^11.15.0",
|
|
66
66
|
"qs": "^6.12.1",
|
|
67
|
-
"radix-ui": "1.
|
|
67
|
+
"radix-ui": "1.1.2",
|
|
68
68
|
"react-country-flag": "^3.1.0",
|
|
69
|
-
"react-currency-input-field": "^
|
|
70
|
-
"react-helmet-async": "^
|
|
69
|
+
"react-currency-input-field": "^4.0.6",
|
|
70
|
+
"react-helmet-async": "^3.0.0",
|
|
71
71
|
"react-hook-form": "7.49.1",
|
|
72
72
|
"react-i18next": "17.0.8",
|
|
73
|
-
"react-jwt": "^1.
|
|
73
|
+
"react-jwt": "^2.1.1",
|
|
74
74
|
"react-router-dom": "7.18.1",
|
|
75
75
|
"zod": "4.4.3"
|
|
76
76
|
},
|
|
@@ -88,8 +88,8 @@
|
|
|
88
88
|
"tsup": "^8.0.2",
|
|
89
89
|
"typescript": "5.9.3",
|
|
90
90
|
"@medusajs/types": "2.17.2",
|
|
91
|
-
"@mercurjs/core": "2.2.0",
|
|
92
|
-
"@mercurjs/dashboard-sdk": "2.2.0",
|
|
93
|
-
"@mercurjs/types": "2.2.0"
|
|
91
|
+
"@mercurjs/core": "2.2.1-canary.0",
|
|
92
|
+
"@mercurjs/dashboard-sdk": "2.2.1-canary.0",
|
|
93
|
+
"@mercurjs/types": "2.2.1-canary.0"
|
|
94
94
|
}
|
|
95
95
|
}
|
package/dist/chunk-S2WEYEQR.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
// src/hooks/table/filters/use-promotion-table-filters.tsx
|
|
2
|
-
import { useTranslation } from "react-i18next";
|
|
3
|
-
var usePromotionTableFilters = () => {
|
|
4
|
-
const { t } = useTranslation();
|
|
5
|
-
let filters = [
|
|
6
|
-
{ label: t("fields.createdAt"), key: "created_at", type: "date" },
|
|
7
|
-
{ label: t("fields.updatedAt"), key: "updated_at", type: "date" }
|
|
8
|
-
];
|
|
9
|
-
return filters;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export {
|
|
13
|
-
usePromotionTableFilters
|
|
14
|
-
};
|
|
@@ -1,336 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AttributeValueInput
|
|
3
|
-
} from "./chunk-J5CQ6F6U.js";
|
|
4
|
-
import "./chunk-AW77UWCZ.js";
|
|
5
|
-
import {
|
|
6
|
-
ChipInput
|
|
7
|
-
} from "./chunk-KDE4HKH2.js";
|
|
8
|
-
import "./chunk-TKGWSUEI.js";
|
|
9
|
-
import {
|
|
10
|
-
KeyboundForm
|
|
11
|
-
} from "./chunk-SITRHMZZ.js";
|
|
12
|
-
import {
|
|
13
|
-
RouteDrawer,
|
|
14
|
-
useRouteModal
|
|
15
|
-
} from "./chunk-FWJLS7XD.js";
|
|
16
|
-
import {
|
|
17
|
-
Form
|
|
18
|
-
} from "./chunk-3QSRE5LS.js";
|
|
19
|
-
import {
|
|
20
|
-
PRODUCT_DETAIL_QUERY
|
|
21
|
-
} from "./chunk-6BAPAIQM.js";
|
|
22
|
-
import {
|
|
23
|
-
require_dist
|
|
24
|
-
} from "./chunk-52KJSIHS.js";
|
|
25
|
-
import {
|
|
26
|
-
useBatchProductAttributes,
|
|
27
|
-
useProduct
|
|
28
|
-
} from "./chunk-QRN63LUS.js";
|
|
29
|
-
import "./chunk-RHKRREUU.js";
|
|
30
|
-
import "./chunk-ZA2KFUFR.js";
|
|
31
|
-
import "./chunk-JTAECZCT.js";
|
|
32
|
-
import {
|
|
33
|
-
__toESM
|
|
34
|
-
} from "./chunk-NBMM2TZK.js";
|
|
35
|
-
|
|
36
|
-
// src/pages/products/product-edit-attribute/product-edit-attribute.tsx
|
|
37
|
-
import { Heading } from "@medusajs/ui";
|
|
38
|
-
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
39
|
-
import { useParams } from "react-router-dom";
|
|
40
|
-
|
|
41
|
-
// src/pages/products/product-edit-attribute/components/edit-attribute-form/edit-attribute-form.tsx
|
|
42
|
-
var import_types = __toESM(require_dist(), 1);
|
|
43
|
-
import { zodResolver } from "@hookform/resolvers/zod";
|
|
44
|
-
import { Button, InlineTip, Input, Label, toast } from "@medusajs/ui";
|
|
45
|
-
import { useForm } from "react-hook-form";
|
|
46
|
-
import { useTranslation } from "react-i18next";
|
|
47
|
-
import * as zod from "zod";
|
|
48
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
49
|
-
var isVariantAxis = (attribute) => attribute.type === import_types.AttributeType.MULTI_SELECT || !!attribute.is_variant_axis;
|
|
50
|
-
var EditAttributeForm = ({
|
|
51
|
-
productId,
|
|
52
|
-
attribute
|
|
53
|
-
}) => {
|
|
54
|
-
if (attribute.is_scoped) {
|
|
55
|
-
return /* @__PURE__ */ jsx(EditScopedAttributeForm, { productId, attribute });
|
|
56
|
-
}
|
|
57
|
-
return /* @__PURE__ */ jsx(EditCatalogAttributeForm, { productId, attribute });
|
|
58
|
-
};
|
|
59
|
-
var AttributeWarning = () => {
|
|
60
|
-
const { t } = useTranslation();
|
|
61
|
-
return /* @__PURE__ */ jsx(
|
|
62
|
-
InlineTip,
|
|
63
|
-
{
|
|
64
|
-
variant: "warning",
|
|
65
|
-
label: t("products.create.attributes.warning"),
|
|
66
|
-
children: t("products.create.attributes.editWarning")
|
|
67
|
-
}
|
|
68
|
-
);
|
|
69
|
-
};
|
|
70
|
-
var VariantAxisTip = () => {
|
|
71
|
-
const { t } = useTranslation();
|
|
72
|
-
return /* @__PURE__ */ jsx(InlineTip, { label: t("products.create.attributes.tip"), children: t("products.create.attributes.editVariantAxisTip") });
|
|
73
|
-
};
|
|
74
|
-
var EditScopedAttributeForm = ({
|
|
75
|
-
productId,
|
|
76
|
-
attribute
|
|
77
|
-
}) => {
|
|
78
|
-
const { t } = useTranslation();
|
|
79
|
-
const { handleSuccess } = useRouteModal();
|
|
80
|
-
const isAxis = isVariantAxis(attribute);
|
|
81
|
-
const currentValues = attribute.values ?? attribute.all_values ?? [];
|
|
82
|
-
const schema = zod.object({
|
|
83
|
-
title: zod.string().trim().min(1, { message: t("products.create.attributes.errors.titleRequired") }),
|
|
84
|
-
values: zod.union([zod.string(), zod.array(zod.string())]).refine(
|
|
85
|
-
(v) => Array.isArray(v) ? v.length > 0 : v.trim().length > 0,
|
|
86
|
-
{ message: t("products.create.attributes.errors.valuesRequired") }
|
|
87
|
-
)
|
|
88
|
-
});
|
|
89
|
-
const form = useForm({
|
|
90
|
-
defaultValues: {
|
|
91
|
-
title: attribute.name,
|
|
92
|
-
values: isAxis ? currentValues.map((v) => v.name) : currentValues[0]?.name ?? ""
|
|
93
|
-
},
|
|
94
|
-
resolver: zodResolver(schema)
|
|
95
|
-
});
|
|
96
|
-
const { mutateAsync, isPending } = useBatchProductAttributes(productId);
|
|
97
|
-
const handleSubmit = form.handleSubmit(async (data) => {
|
|
98
|
-
const title = data.title.trim() !== attribute.name ? data.title.trim() : void 0;
|
|
99
|
-
let payload;
|
|
100
|
-
if (isAxis) {
|
|
101
|
-
const newNames = (Array.isArray(data.values) ? data.values : []).map((v) => v.trim()).filter(Boolean);
|
|
102
|
-
const byName = new Map(currentValues.map((v) => [v.name, v.id]));
|
|
103
|
-
const add = newNames.filter((name) => !byName.has(name)).map((value) => ({ value }));
|
|
104
|
-
const remove = currentValues.filter((v) => !newNames.includes(v.name)).map((v) => v.id);
|
|
105
|
-
payload = {
|
|
106
|
-
update: [{ id: attribute.id, title, add, remove }]
|
|
107
|
-
};
|
|
108
|
-
} else {
|
|
109
|
-
const value = Array.isArray(data.values) ? data.values[0] ?? "" : data.values;
|
|
110
|
-
payload = {
|
|
111
|
-
update: [{ id: attribute.id, title, value }]
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
await mutateAsync(payload, {
|
|
115
|
-
onSuccess: () => handleSuccess(),
|
|
116
|
-
onError: (error) => toast.error(error.message)
|
|
117
|
-
});
|
|
118
|
-
});
|
|
119
|
-
return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(KeyboundForm, { onSubmit: handleSubmit, className: "flex h-full flex-col", children: [
|
|
120
|
-
/* @__PURE__ */ jsx(RouteDrawer.Body, { children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-y-4", children: [
|
|
121
|
-
/* @__PURE__ */ jsx("div", { className: "bg-ui-bg-component shadow-elevation-card-rest rounded-xl p-1.5", children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-[min-content,1fr] items-start gap-1.5", children: [
|
|
122
|
-
/* @__PURE__ */ jsx("div", { className: "flex items-center px-2 py-1.5", children: /* @__PURE__ */ jsx(
|
|
123
|
-
Label,
|
|
124
|
-
{
|
|
125
|
-
size: "xsmall",
|
|
126
|
-
weight: "plus",
|
|
127
|
-
className: "text-ui-fg-subtle",
|
|
128
|
-
children: t("fields.title")
|
|
129
|
-
}
|
|
130
|
-
) }),
|
|
131
|
-
/* @__PURE__ */ jsx(
|
|
132
|
-
Form.Field,
|
|
133
|
-
{
|
|
134
|
-
control: form.control,
|
|
135
|
-
name: "title",
|
|
136
|
-
render: ({ field, fieldState }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
137
|
-
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(
|
|
138
|
-
Input,
|
|
139
|
-
{
|
|
140
|
-
...field,
|
|
141
|
-
"aria-invalid": fieldState.invalid ? "true" : void 0,
|
|
142
|
-
className: fieldState.invalid ? "bg-ui-bg-field-component shadow-borders-error focus:shadow-borders-error" : "bg-ui-bg-field-component hover:bg-ui-bg-field-component-hover",
|
|
143
|
-
"data-testid": "edit-attribute-title-input"
|
|
144
|
-
}
|
|
145
|
-
) }),
|
|
146
|
-
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
147
|
-
] })
|
|
148
|
-
}
|
|
149
|
-
),
|
|
150
|
-
/* @__PURE__ */ jsx("div", { className: "flex items-center px-2 py-1.5", children: /* @__PURE__ */ jsx(
|
|
151
|
-
Label,
|
|
152
|
-
{
|
|
153
|
-
size: "xsmall",
|
|
154
|
-
weight: "plus",
|
|
155
|
-
className: "text-ui-fg-subtle",
|
|
156
|
-
children: t("fields.values")
|
|
157
|
-
}
|
|
158
|
-
) }),
|
|
159
|
-
/* @__PURE__ */ jsx(
|
|
160
|
-
Form.Field,
|
|
161
|
-
{
|
|
162
|
-
control: form.control,
|
|
163
|
-
name: "values",
|
|
164
|
-
render: ({ field: { onChange, value }, fieldState }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
165
|
-
/* @__PURE__ */ jsx(Form.Control, { children: isAxis ? /* @__PURE__ */ jsx(
|
|
166
|
-
ChipInput,
|
|
167
|
-
{
|
|
168
|
-
variant: "contrast",
|
|
169
|
-
value: Array.isArray(value) ? value : [],
|
|
170
|
-
onChange,
|
|
171
|
-
"aria-invalid": fieldState.invalid ? "true" : void 0,
|
|
172
|
-
className: fieldState.invalid ? "shadow-borders-error focus-within:!shadow-borders-error" : void 0,
|
|
173
|
-
placeholder: t(
|
|
174
|
-
"products.create.attributes.valuePlaceholder"
|
|
175
|
-
)
|
|
176
|
-
}
|
|
177
|
-
) : /* @__PURE__ */ jsx(
|
|
178
|
-
AttributeValueInput,
|
|
179
|
-
{
|
|
180
|
-
type: attribute.type,
|
|
181
|
-
value,
|
|
182
|
-
onChange,
|
|
183
|
-
placeholder: t(
|
|
184
|
-
"products.create.attributes.valuePlaceholder"
|
|
185
|
-
)
|
|
186
|
-
}
|
|
187
|
-
) }),
|
|
188
|
-
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
189
|
-
] })
|
|
190
|
-
}
|
|
191
|
-
)
|
|
192
|
-
] }) }),
|
|
193
|
-
isAxis && /* @__PURE__ */ jsx(VariantAxisTip, {}),
|
|
194
|
-
/* @__PURE__ */ jsx(AttributeWarning, {})
|
|
195
|
-
] }) }),
|
|
196
|
-
/* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-end gap-x-2", children: [
|
|
197
|
-
/* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: t("actions.cancel") }) }),
|
|
198
|
-
/* @__PURE__ */ jsx(
|
|
199
|
-
Button,
|
|
200
|
-
{
|
|
201
|
-
size: "small",
|
|
202
|
-
type: "submit",
|
|
203
|
-
isLoading: isPending,
|
|
204
|
-
"data-testid": "edit-attribute-submit-button",
|
|
205
|
-
children: t("actions.save")
|
|
206
|
-
}
|
|
207
|
-
)
|
|
208
|
-
] }) })
|
|
209
|
-
] }) });
|
|
210
|
-
};
|
|
211
|
-
var EditCatalogAttributeForm = ({
|
|
212
|
-
productId,
|
|
213
|
-
attribute
|
|
214
|
-
}) => {
|
|
215
|
-
const { t } = useTranslation();
|
|
216
|
-
const { handleSuccess } = useRouteModal();
|
|
217
|
-
const isAxis = isVariantAxis(attribute);
|
|
218
|
-
const hasPresetValues = attribute.type === import_types.AttributeType.SINGLE_SELECT || attribute.type === import_types.AttributeType.MULTI_SELECT;
|
|
219
|
-
const labelTooltip = attribute.description || (attribute.is_required ? t("products.attributeRequiredByMarketplace") : void 0);
|
|
220
|
-
const initialValues = (() => {
|
|
221
|
-
const selected = attribute.values ?? [];
|
|
222
|
-
if (attribute.type === import_types.AttributeType.MULTI_SELECT) {
|
|
223
|
-
return selected.map((v) => v.name);
|
|
224
|
-
}
|
|
225
|
-
return selected[0]?.name ?? "";
|
|
226
|
-
})();
|
|
227
|
-
const schema = zod.object({
|
|
228
|
-
values: zod.union([zod.string(), zod.array(zod.string())]).refine(
|
|
229
|
-
(v) => Array.isArray(v) ? v.length > 0 : v.trim().length > 0,
|
|
230
|
-
{ message: t("products.create.attributes.errors.valuesRequired") }
|
|
231
|
-
)
|
|
232
|
-
});
|
|
233
|
-
const form = useForm({
|
|
234
|
-
defaultValues: { values: initialValues },
|
|
235
|
-
resolver: zodResolver(schema)
|
|
236
|
-
});
|
|
237
|
-
const { mutateAsync, isPending } = useBatchProductAttributes(productId);
|
|
238
|
-
const handleSubmit = form.handleSubmit(async (data) => {
|
|
239
|
-
const vals = Array.isArray(data.values) ? data.values : [data.values].filter((s) => s.trim().length > 0);
|
|
240
|
-
let payload;
|
|
241
|
-
if (hasPresetValues) {
|
|
242
|
-
const selectedIds = (attribute.all_values ?? []).filter((v) => vals.includes(v.name)).map((v) => v.id);
|
|
243
|
-
if (attribute.is_variant_axis) {
|
|
244
|
-
const currentIds = (attribute.values ?? []).map((v) => v.id);
|
|
245
|
-
const add = selectedIds.filter((id) => !currentIds.includes(id));
|
|
246
|
-
const remove = currentIds.filter((id) => !selectedIds.includes(id));
|
|
247
|
-
payload = { update: [{ id: attribute.id, add, remove }] };
|
|
248
|
-
} else {
|
|
249
|
-
payload = {
|
|
250
|
-
remove: [attribute.id],
|
|
251
|
-
add: [{ id: attribute.id, value_ids: selectedIds }]
|
|
252
|
-
};
|
|
253
|
-
}
|
|
254
|
-
} else {
|
|
255
|
-
payload = {
|
|
256
|
-
update: [
|
|
257
|
-
{
|
|
258
|
-
id: attribute.id,
|
|
259
|
-
value: attribute.type === import_types.AttributeType.TOGGLE ? vals[0] === "true" : vals[0]
|
|
260
|
-
}
|
|
261
|
-
]
|
|
262
|
-
};
|
|
263
|
-
}
|
|
264
|
-
await mutateAsync(payload, {
|
|
265
|
-
onSuccess: () => handleSuccess(),
|
|
266
|
-
onError: (error) => toast.error(error.message)
|
|
267
|
-
});
|
|
268
|
-
});
|
|
269
|
-
return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(KeyboundForm, { onSubmit: handleSubmit, className: "flex h-full flex-col", children: [
|
|
270
|
-
/* @__PURE__ */ jsx(RouteDrawer.Body, { children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-y-4", children: [
|
|
271
|
-
/* @__PURE__ */ jsx(
|
|
272
|
-
Form.Field,
|
|
273
|
-
{
|
|
274
|
-
control: form.control,
|
|
275
|
-
name: "values",
|
|
276
|
-
render: ({ field: { onChange, value } }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
277
|
-
/* @__PURE__ */ jsx(Form.Label, { tooltip: labelTooltip, children: attribute.name }),
|
|
278
|
-
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(
|
|
279
|
-
AttributeValueInput,
|
|
280
|
-
{
|
|
281
|
-
type: attribute.type,
|
|
282
|
-
value,
|
|
283
|
-
onChange,
|
|
284
|
-
availableValues: attribute.all_values ?? []
|
|
285
|
-
}
|
|
286
|
-
) }),
|
|
287
|
-
/* @__PURE__ */ jsx(Form.ErrorMessage, {}),
|
|
288
|
-
isAxis && /* @__PURE__ */ jsx(VariantAxisTip, {})
|
|
289
|
-
] })
|
|
290
|
-
}
|
|
291
|
-
),
|
|
292
|
-
/* @__PURE__ */ jsx(AttributeWarning, {})
|
|
293
|
-
] }) }),
|
|
294
|
-
/* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-end gap-x-2", children: [
|
|
295
|
-
/* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: t("actions.cancel") }) }),
|
|
296
|
-
/* @__PURE__ */ jsx(
|
|
297
|
-
Button,
|
|
298
|
-
{
|
|
299
|
-
size: "small",
|
|
300
|
-
type: "submit",
|
|
301
|
-
isLoading: isPending,
|
|
302
|
-
"data-testid": "edit-attribute-submit-button",
|
|
303
|
-
children: t("actions.save")
|
|
304
|
-
}
|
|
305
|
-
)
|
|
306
|
-
] }) })
|
|
307
|
-
] }) });
|
|
308
|
-
};
|
|
309
|
-
|
|
310
|
-
// src/pages/products/product-edit-attribute/product-edit-attribute.tsx
|
|
311
|
-
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
312
|
-
var ProductEditAttribute = () => {
|
|
313
|
-
const { id, attribute_id } = useParams();
|
|
314
|
-
const { t } = useTranslation2();
|
|
315
|
-
const { product, isLoading, isError, error } = useProduct(
|
|
316
|
-
id,
|
|
317
|
-
PRODUCT_DETAIL_QUERY
|
|
318
|
-
);
|
|
319
|
-
if (isError) {
|
|
320
|
-
throw error;
|
|
321
|
-
}
|
|
322
|
-
const attribute = product?.attributes?.find(
|
|
323
|
-
(a) => a.id === attribute_id
|
|
324
|
-
);
|
|
325
|
-
const ready = !isLoading && !!product && !!attribute;
|
|
326
|
-
return /* @__PURE__ */ jsxs2(RouteDrawer, { children: [
|
|
327
|
-
/* @__PURE__ */ jsxs2(RouteDrawer.Header, { children: [
|
|
328
|
-
/* @__PURE__ */ jsx2(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx2(Heading, { children: t("products.editAttribute") }) }),
|
|
329
|
-
/* @__PURE__ */ jsx2(RouteDrawer.Description, { className: "sr-only", children: t("products.editAttributeHint") })
|
|
330
|
-
] }),
|
|
331
|
-
ready && /* @__PURE__ */ jsx2(EditAttributeForm, { productId: id, attribute })
|
|
332
|
-
] });
|
|
333
|
-
};
|
|
334
|
-
export {
|
|
335
|
-
ProductEditAttribute as Component
|
|
336
|
-
};
|