@mercurjs/admin 2.0.0 → 2.0.1
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-CQDZBX3V.js → add-campaign-promotions-TA7QC32P.js} +6 -6
- package/dist/{adjust-inventory-3GPDYI3V.js → adjust-inventory-W4H5F2JA.js} +32 -31
- package/dist/{api-key-management-create-GUNLFGNT.js → api-key-management-create-FPBZMDBI.js} +5 -5
- package/dist/{api-key-management-detail-4IL3BQJW.js → api-key-management-detail-LMKKDTRJ.js} +33 -32
- package/dist/{api-key-management-edit-SIXXFLNP.js → api-key-management-edit-5EM4NJIM.js} +5 -5
- package/dist/{api-key-management-list-XLRD4ASE.js → api-key-management-list-MRKJVQMI.js} +5 -5
- package/dist/{api-key-management-sales-channels-GCUMV6YA.js → api-key-management-sales-channels-AETOWQYM.js} +5 -5
- package/dist/attribute-create-IRJTPQCF.js +996 -0
- package/dist/attribute-create-possible-value-RG4VA2DG.js +437 -0
- package/dist/attribute-detail-7FLCTP3I.js +457 -0
- package/dist/attribute-edit-6YNHG3QV.js +281 -0
- package/dist/attribute-edit-possible-value-IBJA53MJ.js +264 -0
- package/dist/attribute-edit-ranking-BLMESGR5.js +174 -0
- package/dist/attribute-list-C5NS26AD.js +63 -0
- package/dist/{campaign-budget-edit-GAP5KUI3.js → campaign-budget-edit-PL7DTWCM.js} +3 -3
- package/dist/{campaign-configuration-LTHPZGYC.js → campaign-configuration-D6ROERRH.js} +3 -3
- package/dist/{campaign-create-TRNE6L26.js → campaign-create-LABYKFMI.js} +7 -7
- package/dist/{campaign-detail-GYMMDRUV.js → campaign-detail-E37P67AC.js} +35 -34
- package/dist/{campaign-edit-CRQCVEFT.js → campaign-edit-PMJMUUDW.js} +3 -3
- package/dist/{campaign-list-WEKSY62X.js → campaign-list-B42U6XNF.js} +3 -3
- package/dist/{categories-metadata-GESU3DEU.js → categories-metadata-34L5C2TK.js} +33 -32
- package/dist/{category-create-PSAN6SA2.js → category-create-AMHFSXJI.js} +6 -6
- package/dist/{category-detail-67ZTYE5M.js → category-detail-B23F726Q.js} +35 -35
- package/dist/{category-edit-QYKE3GAC.js → category-edit-VZL6ROLF.js} +4 -4
- package/dist/{category-list-ZRDWHPEI.js → category-list-R66T472I.js} +5 -5
- package/dist/{category-organize-D26G234L.js → category-organize-CLCNXQSJ.js} +4 -4
- package/dist/{category-products-XMIZ2KRR.js → category-products-2LKOHEWO.js} +34 -34
- package/dist/{chunk-I5LLMPI2.js → chunk-22XJUSMM.js} +2 -2
- package/dist/{chunk-7OSCNHHQ.js → chunk-25YTS3TI.js} +2 -2
- package/dist/{chunk-P52JGPUG.js → chunk-34VX7KOL.js} +4 -4
- package/dist/{chunk-X6HEEFUW.js → chunk-3FNX54TD.js} +1 -1
- package/dist/{chunk-YAMNPEPW.js → chunk-3MDRW5MA.js} +28 -9
- package/dist/{chunk-5N24A4CX.js → chunk-4ESVWDQK.js} +2 -2
- package/dist/{chunk-HDUVTTOW.js → chunk-4G5FEKRO.js} +1 -1
- package/dist/{chunk-RF7BE47J.js → chunk-4QX7QEWY.js} +9 -9
- package/dist/chunk-4ZTZTIIM.js +69 -0
- package/dist/{chunk-XFKRBJLK.js → chunk-52BRBQMY.js} +2 -2
- package/dist/{chunk-LZO7MWH7.js → chunk-5N6S5K57.js} +2 -2
- package/dist/{chunk-EWFOFSF7.js → chunk-5PUHROK4.js} +1 -1
- package/dist/{chunk-QUNCQMFH.js → chunk-5VBNFLG2.js} +1 -1
- package/dist/{chunk-7ITJ4725.js → chunk-5VMJCLUP.js} +4 -4
- package/dist/{chunk-G4MIA23Y.js → chunk-5WTGRSBC.js} +1 -1
- package/dist/{chunk-64B6RWZI.js → chunk-5XWE6QZ3.js} +3 -3
- package/dist/{chunk-TKSKCH3S.js → chunk-6D5BKKSQ.js} +1 -1
- package/dist/{chunk-OT5X3VOQ.js → chunk-6NVEUQSL.js} +1 -1
- package/dist/{chunk-7JZMCLD3.js → chunk-6OTK5LAS.js} +5 -5
- package/dist/{chunk-ZGEMSYN7.js → chunk-6TFS6ET5.js} +1 -1
- package/dist/{chunk-G2N27VIE.js → chunk-76FXHSMH.js} +2 -2
- package/dist/{chunk-DPH3FG5H.js → chunk-7IPA3CRG.js} +4 -4
- package/dist/{chunk-GYRTURN7.js → chunk-7SJC6BWZ.js} +1 -1
- package/dist/{chunk-BYKTBURG.js → chunk-7STT4ZVP.js} +1 -1
- package/dist/{chunk-6ERRELWD.js → chunk-A2TQNJZP.js} +11 -11
- package/dist/{chunk-QDIPFZLV.js → chunk-AG4ORND4.js} +2 -2
- package/dist/{chunk-BBZ6YISG.js → chunk-AVXOG7CE.js} +4 -4
- package/dist/{chunk-WBNGBRBK.js → chunk-BA2HXHTW.js} +1 -1
- package/dist/{chunk-AJQ6EVLE.js → chunk-BBANQAF4.js} +2 -2
- package/dist/{chunk-YMKZS2HK.js → chunk-BE5QWX5N.js} +25 -6
- package/dist/{chunk-PJTR2MBS.js → chunk-BMC2HG53.js} +2 -2
- package/dist/{chunk-7H2I3TA2.js → chunk-BUI5NC7I.js} +2 -2
- package/dist/chunk-C3WE6EFO.js +33 -0
- package/dist/{chunk-ZJO4DDOP.js → chunk-CA4XLTI7.js} +2 -2
- package/dist/{chunk-J54BZXZX.js → chunk-CBHNHLUZ.js} +2 -2
- package/dist/{chunk-KWW4RDRS.js → chunk-CGVHXNWH.js} +2 -2
- package/dist/{chunk-7SQW55FI.js → chunk-CMX37MSO.js} +6 -6
- package/dist/{chunk-CARSKIPW.js → chunk-DF3OGJAK.js} +1 -1
- package/dist/{chunk-4ZIQGDNH.js → chunk-DKA6GR53.js} +1 -1
- package/dist/{chunk-6HJINLUB.js → chunk-DOZ3NXES.js} +1 -1
- package/dist/{chunk-I6GNV6QA.js → chunk-DTUPDNN3.js} +3 -3
- package/dist/{chunk-R55Q5LAH.js → chunk-DYFB2ZZD.js} +1 -1
- package/dist/{chunk-TK3XKN2P.js → chunk-EG2Y5Z2K.js} +3 -3
- package/dist/{chunk-25DQRKFS.js → chunk-EHQESDH2.js} +1 -1
- package/dist/{chunk-PWMB7ITO.js → chunk-EI6JBJYB.js} +3 -3
- package/dist/{chunk-4JYZU65L.js → chunk-EVGVH6CU.js} +13 -11
- package/dist/{chunk-IUB4C2WJ.js → chunk-F7VTQIU7.js} +7 -7
- package/dist/{chunk-VRGXUUPH.js → chunk-FB4JUZFB.js} +4 -4
- package/dist/{chunk-L74EVHCU.js → chunk-FMGXDDBU.js} +2 -2
- package/dist/{chunk-MO7TNIVQ.js → chunk-FNBKEF54.js} +1 -1
- package/dist/{chunk-OSI3M4M2.js → chunk-G4LGZF5F.js} +5 -5
- package/dist/{chunk-MZCJZRR6.js → chunk-G5WS77NL.js} +4 -4
- package/dist/{chunk-BLHFWBK3.js → chunk-GYKVLGU4.js} +2 -2
- package/dist/{chunk-GCEOEV6P.js → chunk-HAFZQK53.js} +1 -1
- package/dist/{chunk-JJ4XUGHZ.js → chunk-HAZURA7S.js} +2 -2
- package/dist/{chunk-GVXAFQDF.js → chunk-HHEQZTPC.js} +2 -2
- package/dist/{chunk-U5QDMLTR.js → chunk-HS322YUO.js} +3 -3
- package/dist/{chunk-XBFWFGZH.js → chunk-HVLPRHZS.js} +2 -2
- package/dist/{chunk-LGVVX4I6.js → chunk-IAT6UDKU.js} +1 -1
- package/dist/{chunk-PYF5EER5.js → chunk-IJWG755C.js} +1 -1
- package/dist/chunk-J24SOKSP.js +457 -0
- package/dist/{chunk-HGHJRKUC.js → chunk-J555HFHV.js} +2 -2
- package/dist/{chunk-O4LSCHTC.js → chunk-JSBQOQXC.js} +1 -1
- package/dist/{chunk-EEOEIXDA.js → chunk-K4BGK3CO.js} +3 -3
- package/dist/{chunk-XSEF6KRY.js → chunk-KA3VYXNA.js} +1 -1
- package/dist/{chunk-EF47ASFU.js → chunk-KERA6OZN.js} +1 -1
- package/dist/{chunk-7KMDLRLG.js → chunk-KMK4YAS2.js} +1 -1
- package/dist/{chunk-EJY35WBK.js → chunk-LC6TM5OT.js} +2 -2
- package/dist/chunk-LO7XX5M7.js +6 -0
- package/dist/{chunk-O5ZOACVV.js → chunk-LW57KBYK.js} +2 -2
- package/dist/chunk-M3YP3NX4.js +259 -0
- package/dist/{chunk-AZVAL5E5.js → chunk-M4VLYKT5.js} +2 -2
- package/dist/{chunk-VEW7PQ3X.js → chunk-MCEEC3VH.js} +3 -3
- package/dist/{chunk-R325CPYC.js → chunk-MFL2TZ3W.js} +1 -1
- package/dist/{chunk-WW7VLWKJ.js → chunk-MMTCBVUV.js} +4 -4
- package/dist/{chunk-RHYS2TFP.js → chunk-MRFW7VTW.js} +2 -2
- package/dist/{chunk-QUTZUW55.js → chunk-N4JU7GWK.js} +2 -2
- package/dist/{chunk-MMDRMNPE.js → chunk-N7QGYSFB.js} +4 -4
- package/dist/{chunk-S3L6CIN2.js → chunk-NDPTTHBH.js} +2 -2
- package/dist/{chunk-NQ2RDSI3.js → chunk-NJKJAYV2.js} +2 -2
- package/dist/{chunk-TKEAOWBZ.js → chunk-NNI6QKKZ.js} +29 -3
- package/dist/chunk-NRKVFULI.js +886 -0
- package/dist/{chunk-J5SOBS7K.js → chunk-NYWECWZJ.js} +5 -5
- package/dist/{chunk-Q6GUA5VE.js → chunk-O4STPJR2.js} +2 -2
- package/dist/{chunk-YDAJI7WF.js → chunk-O7UECTZO.js} +1 -1
- package/dist/{chunk-VXW3BCN2.js → chunk-OFKUNYQJ.js} +1 -1
- package/dist/{chunk-V6LO4BXB.js → chunk-OV7R2AH5.js} +58 -58
- package/dist/{chunk-CJQRZEZU.js → chunk-OW6XTJ33.js} +3 -3
- package/dist/{chunk-JAJMMPOF.js → chunk-PBMB2LY5.js} +3 -3
- package/dist/{chunk-THYWJQI4.js → chunk-PLDGQ5PO.js} +3 -3
- package/dist/{chunk-SJQ4QAFK.js → chunk-PQGIRNRF.js} +6 -6
- package/dist/{chunk-5HZT54X7.js → chunk-QG3EYUDB.js} +3 -3
- package/dist/{chunk-SDNGZDNK.js → chunk-QIZUNM6F.js} +5 -5
- package/dist/{chunk-3GCRM6UM.js → chunk-QLJKQS6P.js} +6 -6
- package/dist/{chunk-KHXRL3BH.js → chunk-R2KXIBCX.js} +1 -1
- package/dist/{chunk-QVLL4MKH.js → chunk-R74OHYTB.js} +3 -3
- package/dist/{chunk-ZNA2XOGX.js → chunk-RIC6PMBR.js} +7 -7
- package/dist/{chunk-LXZXXOJ3.js → chunk-RIN4CBRB.js} +17 -1
- package/dist/{chunk-2TDFXWGC.js → chunk-RRAIAUBR.js} +8 -8
- package/dist/chunk-RT6L7JXU.js +33 -0
- package/dist/{chunk-7NNA33IY.js → chunk-RVAVU222.js} +9 -9
- package/dist/{chunk-TN4TIT7O.js → chunk-S2Q7PO7I.js} +68 -7
- package/dist/{chunk-WEVK4TBV.js → chunk-SDPR7PGR.js} +1 -1
- package/dist/{chunk-SBH4E5NY.js → chunk-SDQ6V2QY.js} +3 -3
- package/dist/{chunk-5LI2P5VT.js → chunk-SKV7U4GW.js} +5 -5
- package/dist/{chunk-XR2UEF6U.js → chunk-SZVIRQZ2.js} +4 -4
- package/dist/{chunk-RQQ53CQJ.js → chunk-T7MQFDTF.js} +1 -1
- package/dist/{chunk-TKFMOTJK.js → chunk-TBREETGZ.js} +4 -4
- package/dist/{chunk-TP7M43SI.js → chunk-TCA3ZYNO.js} +2 -2
- package/dist/{chunk-PUQSQBZW.js → chunk-TIMWFAPD.js} +1 -1
- package/dist/{chunk-HLL6GLZO.js → chunk-TPPONKYW.js} +3 -3
- package/dist/{chunk-77R2QD4O.js → chunk-UBS6VEGB.js} +3 -92
- package/dist/{chunk-OZMCKYJL.js → chunk-UBTAADSY.js} +4 -4
- package/dist/{chunk-STSW4GDV.js → chunk-UI2KUK3F.js} +2 -2
- package/dist/{chunk-FIVW6L2I.js → chunk-UU2RQMXS.js} +1 -1
- package/dist/{chunk-N3WRPCPT.js → chunk-UYKWOC5A.js} +1 -1
- package/dist/{chunk-JI7HMGMO.js → chunk-VME3CJER.js} +1 -1
- package/dist/{chunk-TOUMBTYI.js → chunk-VXPWOEUS.js} +1 -1
- package/dist/{chunk-VHCDSNXF.js → chunk-W5UPPL3W.js} +2 -2
- package/dist/{chunk-C6OVKRMH.js → chunk-WDASBBB5.js} +1 -1
- package/dist/{chunk-FD7OJEGQ.js → chunk-WHLVH4RN.js} +2 -2
- package/dist/{chunk-6S72GJRI.js → chunk-WSR2ZXAJ.js} +5 -5
- package/dist/{chunk-L7DIEO5B.js → chunk-XDZGOUCR.js} +1 -1
- package/dist/{chunk-QLTN2DIY.js → chunk-XIHVSZ6I.js} +1 -1
- package/dist/{chunk-A2F5MDPU.js → chunk-XKVXLDSJ.js} +1 -1
- package/dist/chunk-XMVTX2EN.js +120 -0
- package/dist/{chunk-R4O667NT.js → chunk-XRDP2SYY.js} +1 -1
- package/dist/chunk-XZQV2OLD.js +93 -0
- package/dist/{chunk-VZEMURY7.js → chunk-YJNCEGX4.js} +2 -2
- package/dist/{chunk-YQYGAFCS.js → chunk-YNIIYGL4.js} +2 -2
- package/dist/{chunk-OJI3SRZ3.js → chunk-YTPCWCA3.js} +1 -1
- package/dist/{chunk-OEDISQ2O.js → chunk-YYTI5JIC.js} +2 -2
- package/dist/{chunk-3CKTAFTR.js → chunk-Z5I2Z6L3.js} +50 -33
- package/dist/{chunk-V7Y7WBGF.js → chunk-ZCLF2O6X.js} +1 -1
- package/dist/{chunk-K6RZE3F7.js → chunk-ZDZYRCVH.js} +1 -1
- package/dist/chunk-ZFEGVWHT.js +324 -0
- package/dist/{chunk-FIYO3KTR.js → chunk-ZJNRM77Y.js} +4 -4
- package/dist/{chunk-JOX3ZSRT.js → chunk-ZLBTDKSI.js} +1 -1
- package/dist/{chunk-NYWESQ6J.js → chunk-ZMDE5HEV.js} +221 -18
- package/dist/{chunk-BPTVQM72.js → chunk-ZZO3INVE.js} +1440 -1305
- package/dist/{collection-add-products-4TTEF6QV.js → collection-add-products-RHIQZ37R.js} +34 -34
- package/dist/{collection-create-SD4GKHFC.js → collection-create-EBAELCA2.js} +4 -4
- package/dist/{collection-detail-64YVMLBU.js → collection-detail-SJ4ZZLWY.js} +34 -34
- package/dist/{collection-edit-Z474HXCJ.js → collection-edit-TGXPOOSX.js} +4 -4
- package/dist/{collection-list-OTSGOEBC.js → collection-list-OFZGXVJA.js} +39 -36
- package/dist/{collection-metadata-FFHA6CQ3.js → collection-metadata-3CDRKSCP.js} +33 -32
- package/dist/{commission-rate-create-7BBUGS2I.js → commission-rate-create-OOVFRTYM.js} +41 -39
- package/dist/{commission-rate-detail-FORKXXJY.js → commission-rate-detail-5XFV6XH2.js} +32 -31
- package/dist/{commission-rate-edit-SAX2DAND.js → commission-rate-edit-6B4P2GOV.js} +41 -39
- package/dist/{commission-rate-list-EESTCCRP.js → commission-rate-list-OLAGFQNJ.js} +3 -3
- package/dist/{customer-create-WA4GYGVD.js → customer-create-DT6MYVMQ.js} +3 -3
- package/dist/{customer-create-address-YBI4KWWH.js → customer-create-address-VIG65ALU.js} +3 -3
- package/dist/{customer-detail-SDE4TDZD.js → customer-detail-Q4K56AZ4.js} +33 -32
- package/dist/{customer-edit-TFR6PVJJ.js → customer-edit-MHNLUNUL.js} +3 -3
- package/dist/{customer-group-add-customers-77BVWLTN.js → customer-group-add-customers-SI5TTT4S.js} +4 -4
- package/dist/{customer-group-create-32UIUO46.js → customer-group-create-W3FV4OEH.js} +3 -3
- package/dist/{customer-group-detail-QRY6BHGI.js → customer-group-detail-NSEFUNCF.js} +33 -32
- package/dist/{customer-group-edit-HFL7LZZZ.js → customer-group-edit-ZANHQ7RS.js} +3 -3
- package/dist/customer-group-list-GCEKCBUE.js +58 -0
- package/dist/{customer-group-metadata-FXI3J6DB.js → customer-group-metadata-LXJK3IMS.js} +33 -32
- package/dist/{customer-list-CXTUBLCK.js → customer-list-CHRZJTNK.js} +4 -4
- package/dist/{customer-metadata-BV4CHHWI.js → customer-metadata-ZZSCYFHY.js} +33 -32
- package/dist/{customers-add-customer-group-SUE2KKJR.js → customers-add-customer-group-TIBDJPYF.js} +32 -31
- package/dist/{edit-inventory-item-DDRUGVSK.js → edit-inventory-item-Y3CIG6L5.js} +32 -31
- package/dist/{edit-inventory-item-attributes-MDL7FSLR.js → edit-inventory-item-attributes-CZNIVWXY.js} +32 -31
- package/dist/{edit-reservation-JWABBNJ6.js → edit-reservation-OQCAZUIS.js} +5 -5
- package/dist/{edit-rules-ECNFIPUC.js → edit-rules-G7GRUQL6.js} +33 -32
- package/dist/index.d.ts +4 -1
- package/dist/index.js +347 -263
- package/dist/inventory-create-MFCGCJFB.js +57 -0
- package/dist/{inventory-detail-OIKNOS5A.js → inventory-detail-6V43ZQDK.js} +32 -31
- package/dist/{inventory-list-XSHWCPO4.js → inventory-list-TAJ4T5JG.js} +4 -4
- package/dist/{inventory-metadata-MHGDNLXT.js → inventory-metadata-PFXMJTSB.js} +33 -32
- package/dist/{inventory-stock-JG5CZWZA.js → inventory-stock-B4FYZAQB.js} +32 -31
- package/dist/{invite-25CGHT4W.js → invite-YRARW3RW.js} +3 -3
- package/dist/{location-create-G3MNWQWB.js → location-create-GXPH4WZI.js} +3 -3
- package/dist/{location-detail-5CGAZMBR.js → location-detail-NOUHQA4M.js} +32 -31
- package/dist/{location-edit-UI6AWCZS.js → location-edit-GNKQAXJG.js} +3 -3
- package/dist/{location-fulfillment-providers-BA2VMZHX.js → location-fulfillment-providers-A27CQMJN.js} +37 -35
- package/dist/location-list-AVCPUKBH.js +54 -0
- package/dist/{location-sales-channels-WXBK4EJO.js → location-sales-channels-U3MVWUAT.js} +5 -5
- package/dist/{location-service-zone-create-647O67PU.js → location-service-zone-create-E4LW45D7.js} +6 -6
- package/dist/{location-service-zone-edit-BUY6HNZM.js → location-service-zone-edit-UIVVQVMW.js} +5 -5
- package/dist/{location-service-zone-manage-areas-X2ZGRHHA.js → location-service-zone-manage-areas-F3SOZGVW.js} +6 -6
- package/dist/location-service-zone-shipping-option-create-DREWJ7SR.js +58 -0
- package/dist/{location-service-zone-shipping-option-edit-IJDU5PTW.js → location-service-zone-shipping-option-edit-3KNW7UBD.js} +4 -4
- package/dist/{location-service-zone-shipping-option-pricing-3T7HLKJC.js → location-service-zone-shipping-option-pricing-35SMJ6XP.js} +8 -8
- package/dist/{login-WU5VB5LW.js → login-QCYKZCZP.js} +31 -30
- package/dist/{manage-locations-IJIPCYAY.js → manage-locations-VIWHIN7B.js} +4 -4
- package/dist/{marketplace-add-currencies-RXLEQ6MZ.js → marketplace-add-currencies-Q4EJAXDN.js} +5 -5
- package/dist/{marketplace-detail-23KSAJVI.js → marketplace-detail-CYMZCRWM.js} +32 -31
- package/dist/{marketplace-edit-XPIEDQYD.js → marketplace-edit-AMRUND2Q.js} +4 -4
- package/dist/{marketplace-metadata-5GEWGH2M.js → marketplace-metadata-LYNL3W6L.js} +33 -32
- package/dist/{order-allocate-items-GYGER65Z.js → order-allocate-items-AZ3FDELU.js} +6 -6
- package/dist/{order-create-claim-RNUFU2MP.js → order-create-claim-HWZI4OEK.js} +35 -34
- package/dist/{order-create-edit-DLH76B2Q.js → order-create-edit-VIIAC2AA.js} +33 -32
- package/dist/{order-create-exchange-FA27FZU7.js → order-create-exchange-KRGBFSCC.js} +35 -34
- package/dist/{order-create-fulfillment-4F5JAUOX.js → order-create-fulfillment-K4LB6U6E.js} +32 -31
- package/dist/{order-create-refund-3LCTQXFD.js → order-create-refund-2OCPOAJS.js} +32 -31
- package/dist/{order-create-return-EO2C5RAA.js → order-create-return-4PREWHB7.js} +9 -9
- package/dist/{order-create-shipment-PIQ43ZSG.js → order-create-shipment-BD3DKSJX.js} +32 -31
- package/dist/{order-detail-2U26JNU2.js → order-detail-GETGE7YJ.js} +37 -36
- package/dist/{order-edit-billing-address-PRXCLUNR.js → order-edit-billing-address-3GN3QU4Y.js} +33 -32
- package/dist/{order-edit-email-GVKVQESG.js → order-edit-email-D6KSNSY4.js} +32 -31
- package/dist/{order-edit-shipping-address-UDNHXO2V.js → order-edit-shipping-address-Z7RP4UBB.js} +32 -31
- package/dist/{order-list-U2HL7VBX.js → order-list-727TI7BS.js} +9 -8
- package/dist/{order-metadata-HPXIR6KI.js → order-metadata-UCAS6KEK.js} +33 -32
- package/dist/{order-receive-return-FMM74XYM.js → order-receive-return-YZGUVELT.js} +33 -32
- package/dist/{order-request-transfer-SI5PSOKA.js → order-request-transfer-DBXAIXEG.js} +32 -31
- package/dist/pages/index.d.ts +65 -20
- package/dist/pages/index.js +168 -159
- package/dist/{payout-detail-L4VYAP53.js → payout-detail-SQKDY2F6.js} +3 -3
- package/dist/{payout-list-4S6MAU4R.js → payout-list-HPMP3CJH.js} +3 -3
- package/dist/{price-list-configuration-F2BZC6QX.js → price-list-configuration-XGX6HV4Q.js} +6 -6
- package/dist/price-list-create-SJBCYSRX.js +76 -0
- package/dist/{price-list-detail-IUJXNM6Y.js → price-list-detail-VA4F6JQJ.js} +35 -35
- package/dist/{price-list-edit-CERYYMC5.js → price-list-edit-OYRI7KZD.js} +5 -5
- package/dist/{price-list-list-RBD2MEZ5.js → price-list-list-27QDRHNY.js} +6 -6
- package/dist/price-list-prices-add-BLORGT25.js +71 -0
- package/dist/{price-list-prices-edit-2NYN6WVJ.js → price-list-prices-edit-7WHKIZHY.js} +33 -32
- package/dist/{product-attributes-EUDG25XA.js → product-attributes-BM54QUBZ.js} +3 -3
- package/dist/product-create-KEJB3U44.js +70 -0
- package/dist/{product-create-option-BG2ZKSFN.js → product-create-option-53CW7HXH.js} +3 -3
- package/dist/product-create-variant-YZODW67L.js +55 -0
- package/dist/{product-detail-F67SLUIA.js → product-detail-Y24FRUWA.js} +33 -32
- package/dist/{product-edit-HFWSBQQI.js → product-edit-AY2UVE3V.js} +3 -3
- package/dist/{product-edit-option-Y46SNVHN.js → product-edit-option-ULBJKDOE.js} +3 -3
- package/dist/{product-export-ABNA6ZTY.js → product-export-4G44DDXA.js} +39 -36
- package/dist/{product-import-SQSXBPK5.js → product-import-TIPIYEJJ.js} +33 -32
- package/dist/{product-list-NWHRQHVJ.js → product-list-BLFQWHIA.js} +34 -34
- package/dist/{product-media-YIQCVDCC.js → product-media-IKMGI2QA.js} +9 -7
- package/dist/{product-metadata-2Z5DIXJH.js → product-metadata-SKNZWKWO.js} +33 -32
- package/dist/{product-organization-L666C2EQ.js → product-organization-KHZQIBDK.js} +5 -5
- package/dist/{product-prices-DPGO4KHT.js → product-prices-XCC26S77.js} +6 -6
- package/dist/{product-sales-channels-6IS6T3EC.js → product-sales-channels-G22VD3VU.js} +4 -4
- package/dist/{product-shipping-profile-LMLRMJ36.js → product-shipping-profile-OPOM33SD.js} +3 -3
- package/dist/{product-stock-AQKD6EQO.js → product-stock-WIPVYJUH.js} +32 -31
- package/dist/{product-tag-create-5CF7JLN5.js → product-tag-create-3QK7MKMI.js} +32 -31
- package/dist/{product-tag-detail-2RJNUUT7.js → product-tag-detail-LSMLNJW6.js} +41 -39
- package/dist/{product-tag-edit-KGT54WP5.js → product-tag-edit-NHRQ55DX.js} +32 -31
- package/dist/{product-tag-list-PJG7ICZE.js → product-tag-list-UHBM6KBT.js} +41 -39
- package/dist/{product-tag-metadata-WU7DVJUM.js → product-tag-metadata-DGH7UF4L.js} +33 -32
- package/dist/{product-type-create-WHYGTCYX.js → product-type-create-X6NFMD2J.js} +3 -3
- package/dist/{product-type-detail-MZ3MAV2B.js → product-type-detail-GNRN4KTB.js} +35 -35
- package/dist/{product-type-edit-A4IE6BSF.js → product-type-edit-K5WDDPEY.js} +3 -3
- package/dist/{product-type-list-ND2IIR6O.js → product-type-list-6CTXFZBZ.js} +4 -4
- package/dist/{product-type-metadata-KX4ETP3Y.js → product-type-metadata-NFMNORIB.js} +33 -32
- package/dist/{product-variant-detail-USZXPSVX.js → product-variant-detail-TGSUSOEB.js} +33 -32
- package/dist/{product-variant-edit-5L2GWAHB.js → product-variant-edit-6OJRQWC6.js} +32 -31
- package/dist/{product-variant-manage-inventory-items-54V2HTA6.js → product-variant-manage-inventory-items-RFKTIM5A.js} +3 -3
- package/dist/{product-variant-metadata-SBYZTEIH.js → product-variant-metadata-4MWJAXYI.js} +33 -32
- package/dist/{profile-detail-OAQD5VJC.js → profile-detail-C5BGWHSQ.js} +3 -3
- package/dist/{profile-edit-DSZCGRY7.js → profile-edit-RXXHWORE.js} +3 -3
- package/dist/{promotion-add-campaign-JC4B53LS.js → promotion-add-campaign-TWE6G4R7.js} +7 -7
- package/dist/promotion-create-CPRWDBDW.js +55 -0
- package/dist/{promotion-detail-XOQTYXTV.js → promotion-detail-KGIX6TA2.js} +34 -33
- package/dist/{promotion-edit-details-KFZ2VVVQ.js → promotion-edit-details-J2JWFT2L.js} +3 -3
- package/dist/{promotion-list-EH7CW4JZ.js → promotion-list-U7PXQLZT.js} +6 -6
- package/dist/{refund-reason-create-EMGCAW5S.js → refund-reason-create-KYM2BCJ2.js} +32 -31
- package/dist/{refund-reason-edit-3D25LGKM.js → refund-reason-edit-JIG7FL7D.js} +32 -31
- package/dist/{refund-reason-list-V7HDVFS2.js → refund-reason-list-IO4INIKF.js} +35 -34
- package/dist/{region-add-countries-ZAQBBXIL.js → region-add-countries-OBJOMTGC.js} +4 -4
- package/dist/{region-create-IMSMEASB.js → region-create-BFA7ATKB.js} +5 -5
- package/dist/{region-detail-RASFBR5O.js → region-detail-TR3IRW6L.js} +4 -4
- package/dist/{region-edit-HGSLB3RU.js → region-edit-75ZVOJ3U.js} +5 -5
- package/dist/{region-list-WEILXVMS.js → region-list-D4VLAQXD.js} +4 -4
- package/dist/{region-metadata-4COKDRZH.js → region-metadata-NJUXGJJZ.js} +33 -32
- package/dist/{reservation-create-CIYW3ZKU.js → reservation-create-3PQ56FKT.js} +5 -5
- package/dist/{reservation-detail-2ARWTBE6.js → reservation-detail-TKILHE26.js} +32 -31
- package/dist/{reservation-list-W6IOXQZK.js → reservation-list-56EFZDRI.js} +5 -5
- package/dist/{reservation-metadata-3ZJ2C5BM.js → reservation-metadata-V7BLDGSJ.js} +33 -32
- package/dist/{reset-password-YQ6HMFFZ.js → reset-password-SXAC55FW.js} +3 -3
- package/dist/{return-reason-create-HHZ3EMCC.js → return-reason-create-2HPI654O.js} +3 -3
- package/dist/{return-reason-edit-5P43JRYC.js → return-reason-edit-NJSTWTP3.js} +3 -3
- package/dist/{return-reason-list-32MCIQMK.js → return-reason-list-RYRELICQ.js} +6 -6
- package/dist/{sales-channel-add-products-U2UTBUKE.js → sales-channel-add-products-27YLUPZP.js} +34 -34
- package/dist/{sales-channel-create-TMRTMLIX.js → sales-channel-create-QJTXOKAM.js} +4 -4
- package/dist/{sales-channel-detail-FRBKGP4X.js → sales-channel-detail-EW2YN7VL.js} +34 -34
- package/dist/{sales-channel-edit-4LE2N6EV.js → sales-channel-edit-CDOQ5WR3.js} +4 -4
- package/dist/sales-channel-list-JOSLAWUO.js +51 -0
- package/dist/{sales-channel-metadata-OKKVLC7G.js → sales-channel-metadata-YABMFKT3.js} +33 -32
- package/dist/{shipping-option-type-create-ZHRADP5E.js → shipping-option-type-create-KXRPACLG.js} +32 -31
- package/dist/{shipping-option-type-detail-ZDEEU3P5.js → shipping-option-type-detail-KHX2BRFP.js} +33 -32
- package/dist/{shipping-option-type-edit-2FCNVHNE.js → shipping-option-type-edit-N3L4TPUK.js} +32 -31
- package/dist/shipping-option-type-list-5A676BZT.js +61 -0
- package/dist/{shipping-profile-create-WLHDFQ4Q.js → shipping-profile-create-T5WADNL2.js} +3 -3
- package/dist/{shipping-profile-detail-AUWRGYYL.js → shipping-profile-detail-3II2GLOC.js} +3 -3
- package/dist/{shipping-profile-metadata-W7CND3IQ.js → shipping-profile-metadata-WDM4Y653.js} +33 -32
- package/dist/{shipping-profiles-list-RZT6HIZV.js → shipping-profiles-list-DY4G7Z3K.js} +3 -3
- package/dist/store-address-edit-7BBZSSIP.js +231 -0
- package/dist/store-closure-edit-CN5JR4F5.js +152 -0
- package/dist/store-create-FUYTHJL5.js +278 -0
- package/dist/store-details-65JQK3M3.js +125 -0
- package/dist/store-edit-IQAVLFU5.js +372 -0
- package/dist/store-list-DWFAFCKV.js +83 -0
- package/dist/store-member-invite-GAWCXSWL.js +338 -0
- package/dist/store-payment-details-edit-Z3GLY4TO.js +218 -0
- package/dist/store-professional-details-edit-7KWQOK46.js +147 -0
- package/dist/{tax-region-create-U5JWJUX4.js → tax-region-create-6VHCIPP7.js} +33 -32
- package/dist/tax-region-detail-AZVNX4QN.js +69 -0
- package/dist/{tax-region-edit-5DOYTPEF.js → tax-region-edit-7A6MZBXC.js} +32 -31
- package/dist/{tax-region-list-MRQ63BL3.js → tax-region-list-52PPICIL.js} +6 -6
- package/dist/{tax-region-metadata-WN3XSWGA.js → tax-region-metadata-UZYHKPTE.js} +33 -32
- package/dist/{tax-region-province-create-3GZUYVBY.js → tax-region-province-create-PU53RZPV.js} +3 -3
- package/dist/{tax-region-province-detail-QTBP47GV.js → tax-region-province-detail-7ERAOT3Y.js} +34 -33
- package/dist/{tax-region-tax-override-create-PRZ3DEZE.js → tax-region-tax-override-create-TIPPPVTR.js} +41 -39
- package/dist/{tax-region-tax-override-edit-YAA6TB6A.js → tax-region-tax-override-edit-HDQ4NS5I.js} +41 -39
- package/dist/{tax-region-tax-rate-create-KHNADBCN.js → tax-region-tax-rate-create-4MTXOD2Z.js} +4 -4
- package/dist/{tax-region-tax-rate-edit-JR5262VW.js → tax-region-tax-rate-edit-VUIEX4DT.js} +4 -4
- package/dist/{user-detail-I66RREWP.js → user-detail-C7ZG3JWC.js} +4 -4
- package/dist/{user-edit-LBJOZ4LG.js → user-edit-LSWGYWV3.js} +3 -3
- package/dist/{user-invite-EUNVBT5W.js → user-invite-XYAU2UIS.js} +3 -3
- package/dist/{user-list-BDJJI33F.js → user-list-YXRP4JU5.js} +3 -3
- package/dist/{user-metadata-4RXAMVDT.js → user-metadata-JGCXU4OO.js} +33 -32
- package/package.json +6 -6
- package/dist/chunk-A26VSQNI.js +0 -530
- package/dist/chunk-G5OVX555.js +0 -26
- package/dist/chunk-HPQG3PEA.js +0 -67
- package/dist/chunk-NHGR2OFE.js +0 -292
- package/dist/customer-group-list-Q3T72VH2.js +0 -57
- package/dist/inventory-create-S6CB4JYN.js +0 -56
- package/dist/location-list-656DEW7L.js +0 -53
- package/dist/location-service-zone-shipping-option-create-IASFWJ2Z.js +0 -57
- package/dist/price-list-create-ZJTDGJSS.js +0 -76
- package/dist/price-list-prices-add-AJJ76VMY.js +0 -71
- package/dist/product-create-XA7UOISW.js +0 -68
- package/dist/product-create-variant-4Z6HSHRE.js +0 -54
- package/dist/promotion-create-A6FMNECA.js +0 -54
- package/dist/sales-channel-list-36UHU63C.js +0 -50
- package/dist/seller-address-edit-VH4X5OIO.js +0 -223
- package/dist/seller-details-P7LPJ2UD.js +0 -104
- package/dist/seller-edit-TU72D5QS.js +0 -331
- package/dist/seller-list-CYNCPXYT.js +0 -80
- package/dist/shipping-option-type-list-OCCZ4DNS.js +0 -60
- package/dist/tax-region-detail-UNGDO64V.js +0 -68
|
@@ -0,0 +1,437 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ATTRIBUTE_DETAIL_FIELDS
|
|
3
|
+
} from "./chunk-LO7XX5M7.js";
|
|
4
|
+
import {
|
|
5
|
+
RouteFocusModal,
|
|
6
|
+
useRouteModal
|
|
7
|
+
} from "./chunk-OV7R2AH5.js";
|
|
8
|
+
import "./chunk-3QSRE5LS.js";
|
|
9
|
+
import {
|
|
10
|
+
attributesQueryKeys,
|
|
11
|
+
useAttribute,
|
|
12
|
+
useCreateAttributePossibleValue
|
|
13
|
+
} from "./chunk-XMVTX2EN.js";
|
|
14
|
+
import {
|
|
15
|
+
queryClient
|
|
16
|
+
} from "./chunk-RHKRREUU.js";
|
|
17
|
+
import "./chunk-ZA2KFUFR.js";
|
|
18
|
+
import {
|
|
19
|
+
sdk
|
|
20
|
+
} from "./chunk-RIN4CBRB.js";
|
|
21
|
+
import "./chunk-NBMM2TZK.js";
|
|
22
|
+
|
|
23
|
+
// src/pages/attributes/attribute-create-possible-value/attribute-create-possible-value.tsx
|
|
24
|
+
import { useState } from "react";
|
|
25
|
+
import {
|
|
26
|
+
DndContext,
|
|
27
|
+
closestCenter,
|
|
28
|
+
KeyboardSensor,
|
|
29
|
+
PointerSensor,
|
|
30
|
+
useSensor,
|
|
31
|
+
useSensors
|
|
32
|
+
} from "@dnd-kit/core";
|
|
33
|
+
import {
|
|
34
|
+
arrayMove,
|
|
35
|
+
SortableContext,
|
|
36
|
+
sortableKeyboardCoordinates,
|
|
37
|
+
useSortable,
|
|
38
|
+
verticalListSortingStrategy
|
|
39
|
+
} from "@dnd-kit/sortable";
|
|
40
|
+
import { CSS } from "@dnd-kit/utilities";
|
|
41
|
+
import { DotsSix, XMark, Tag } from "@medusajs/icons";
|
|
42
|
+
import {
|
|
43
|
+
Button,
|
|
44
|
+
Heading,
|
|
45
|
+
IconButton,
|
|
46
|
+
Input,
|
|
47
|
+
ProgressTabs,
|
|
48
|
+
Text,
|
|
49
|
+
toast
|
|
50
|
+
} from "@medusajs/ui";
|
|
51
|
+
import { useFieldArray, useForm, useFormContext, FormProvider } from "react-hook-form";
|
|
52
|
+
import { useTranslation } from "react-i18next";
|
|
53
|
+
import { useParams } from "react-router-dom";
|
|
54
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
55
|
+
var SortableValueInput = ({
|
|
56
|
+
id,
|
|
57
|
+
index,
|
|
58
|
+
onRemove
|
|
59
|
+
}) => {
|
|
60
|
+
const { t } = useTranslation();
|
|
61
|
+
const { register } = useFormContext();
|
|
62
|
+
const { attributes, listeners, setNodeRef, transform, transition } = useSortable({ id });
|
|
63
|
+
const style = {
|
|
64
|
+
transform: CSS.Transform.toString(transform),
|
|
65
|
+
transition
|
|
66
|
+
};
|
|
67
|
+
return /* @__PURE__ */ jsxs(
|
|
68
|
+
"div",
|
|
69
|
+
{
|
|
70
|
+
ref: setNodeRef,
|
|
71
|
+
style,
|
|
72
|
+
className: "flex items-center gap-2 p-2 bg-ui-bg-component border border-ui-border-base rounded-xl mb-2",
|
|
73
|
+
"data-testid": `create-possible-value-input-item-${index}`,
|
|
74
|
+
children: [
|
|
75
|
+
/* @__PURE__ */ jsx(
|
|
76
|
+
"button",
|
|
77
|
+
{
|
|
78
|
+
type: "button",
|
|
79
|
+
className: "cursor-grab active:cursor-grabbing",
|
|
80
|
+
...attributes,
|
|
81
|
+
...listeners,
|
|
82
|
+
"data-testid": `create-possible-value-drag-handle-${index}`,
|
|
83
|
+
children: /* @__PURE__ */ jsx(DotsSix, { className: "text-ui-fg-subtle" })
|
|
84
|
+
}
|
|
85
|
+
),
|
|
86
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1", children: /* @__PURE__ */ jsx(
|
|
87
|
+
Input,
|
|
88
|
+
{
|
|
89
|
+
className: "flex-1",
|
|
90
|
+
placeholder: t("attributes.createPossibleValues.enterValue"),
|
|
91
|
+
...register(`new_values.${index}.value`),
|
|
92
|
+
"data-testid": `create-possible-value-input-${index}`
|
|
93
|
+
}
|
|
94
|
+
) }),
|
|
95
|
+
/* @__PURE__ */ jsx(
|
|
96
|
+
IconButton,
|
|
97
|
+
{
|
|
98
|
+
variant: "transparent",
|
|
99
|
+
size: "small",
|
|
100
|
+
type: "button",
|
|
101
|
+
onClick: onRemove,
|
|
102
|
+
"data-testid": `create-possible-value-remove-button-${index}`,
|
|
103
|
+
children: /* @__PURE__ */ jsx(XMark, {})
|
|
104
|
+
}
|
|
105
|
+
)
|
|
106
|
+
]
|
|
107
|
+
}
|
|
108
|
+
);
|
|
109
|
+
};
|
|
110
|
+
var SortableRankingItem = ({
|
|
111
|
+
id,
|
|
112
|
+
value,
|
|
113
|
+
index
|
|
114
|
+
}) => {
|
|
115
|
+
const { attributes, listeners, setNodeRef, transform, transition } = useSortable({ id });
|
|
116
|
+
const style = {
|
|
117
|
+
transform: CSS.Transform.toString(transform),
|
|
118
|
+
transition
|
|
119
|
+
};
|
|
120
|
+
return /* @__PURE__ */ jsxs(
|
|
121
|
+
"div",
|
|
122
|
+
{
|
|
123
|
+
ref: setNodeRef,
|
|
124
|
+
style,
|
|
125
|
+
className: "flex items-center gap-3 p-3 bg-ui-bg-component border border-ui-border-base rounded-xl mb-2",
|
|
126
|
+
"data-testid": `ranking-item-${index}`,
|
|
127
|
+
children: [
|
|
128
|
+
/* @__PURE__ */ jsx(
|
|
129
|
+
"button",
|
|
130
|
+
{
|
|
131
|
+
type: "button",
|
|
132
|
+
className: "cursor-grab active:cursor-grabbing",
|
|
133
|
+
...attributes,
|
|
134
|
+
...listeners,
|
|
135
|
+
"data-testid": `ranking-item-drag-handle-${index}`,
|
|
136
|
+
children: /* @__PURE__ */ jsx(DotsSix, { className: "text-ui-fg-subtle" })
|
|
137
|
+
}
|
|
138
|
+
),
|
|
139
|
+
/* @__PURE__ */ jsx(Tag, { className: "text-ui-fg-subtle" }),
|
|
140
|
+
/* @__PURE__ */ jsx(Text, { size: "small", weight: "plus", children: value })
|
|
141
|
+
]
|
|
142
|
+
}
|
|
143
|
+
);
|
|
144
|
+
};
|
|
145
|
+
var AttributeCreatePossibleValueInner = () => {
|
|
146
|
+
const { t } = useTranslation();
|
|
147
|
+
const { id } = useParams();
|
|
148
|
+
const { handleSuccess } = useRouteModal();
|
|
149
|
+
const { attribute, isPending: isAttributeLoading } = useAttribute(id, {
|
|
150
|
+
fields: ATTRIBUTE_DETAIL_FIELDS
|
|
151
|
+
});
|
|
152
|
+
const { mutateAsync: createValue } = useCreateAttributePossibleValue(id);
|
|
153
|
+
const [activeTab, setActiveTab] = useState(
|
|
154
|
+
"values"
|
|
155
|
+
);
|
|
156
|
+
const [tabStatuses, setTabStatuses] = useState({
|
|
157
|
+
valuesStatus: "not-started",
|
|
158
|
+
organizeStatus: "not-started"
|
|
159
|
+
});
|
|
160
|
+
const [rankingItems, setRankingItems] = useState([]);
|
|
161
|
+
const [isSaving, setIsSaving] = useState(false);
|
|
162
|
+
const form = useForm({
|
|
163
|
+
defaultValues: {
|
|
164
|
+
new_values: [{ id: crypto.randomUUID(), value: "" }]
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
const { fields, append, remove } = useFieldArray({
|
|
168
|
+
control: form.control,
|
|
169
|
+
name: "new_values"
|
|
170
|
+
});
|
|
171
|
+
const sensors = useSensors(
|
|
172
|
+
useSensor(PointerSensor),
|
|
173
|
+
useSensor(KeyboardSensor, {
|
|
174
|
+
coordinateGetter: sortableKeyboardCoordinates
|
|
175
|
+
})
|
|
176
|
+
);
|
|
177
|
+
const handleValuesDragEnd = (event) => {
|
|
178
|
+
const { active, over } = event;
|
|
179
|
+
if (over && active.id !== over.id) {
|
|
180
|
+
const oldIndex = fields.findIndex((field) => field.id === active.id);
|
|
181
|
+
const newIndex = fields.findIndex((field) => field.id === over.id);
|
|
182
|
+
const currentValues = form.getValues("new_values");
|
|
183
|
+
const reordered = arrayMove(currentValues, oldIndex, newIndex);
|
|
184
|
+
reordered.forEach((item, idx) => {
|
|
185
|
+
form.setValue(`new_values.${idx}.id`, item.id);
|
|
186
|
+
form.setValue(`new_values.${idx}.value`, item.value);
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
const handleRankingDragEnd = (event) => {
|
|
191
|
+
const { active, over } = event;
|
|
192
|
+
if (over && active.id !== over.id) {
|
|
193
|
+
setRankingItems((items) => {
|
|
194
|
+
const oldIndex = items.findIndex((item) => item.id === active.id);
|
|
195
|
+
const newIndex = items.findIndex((item) => item.id === over.id);
|
|
196
|
+
return arrayMove(items, oldIndex, newIndex);
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
const handleAddValue = () => {
|
|
201
|
+
append({ id: crypto.randomUUID(), value: "" });
|
|
202
|
+
setTabStatuses((prev) => ({
|
|
203
|
+
...prev,
|
|
204
|
+
valuesStatus: "in-progress"
|
|
205
|
+
}));
|
|
206
|
+
};
|
|
207
|
+
const handleContinue = () => {
|
|
208
|
+
const newValues = form.getValues("new_values").filter((v) => v.value.trim() !== "");
|
|
209
|
+
if (newValues.length === 0) {
|
|
210
|
+
toast.warning(t("attributes.createPossibleValues.enterValue"));
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
const existingValues = (attribute?.possible_values ?? []).slice().sort((a, b) => (a.rank ?? 0) - (b.rank ?? 0)).map((pv) => ({
|
|
214
|
+
id: pv.id,
|
|
215
|
+
value: pv.value,
|
|
216
|
+
isNew: false
|
|
217
|
+
}));
|
|
218
|
+
const newRankingItems = newValues.map((nv) => ({
|
|
219
|
+
id: nv.id,
|
|
220
|
+
value: nv.value,
|
|
221
|
+
isNew: true
|
|
222
|
+
}));
|
|
223
|
+
setRankingItems([...existingValues, ...newRankingItems]);
|
|
224
|
+
setTabStatuses({
|
|
225
|
+
valuesStatus: "completed",
|
|
226
|
+
organizeStatus: "in-progress"
|
|
227
|
+
});
|
|
228
|
+
setActiveTab("organize-ranking");
|
|
229
|
+
};
|
|
230
|
+
const handleTabChange = (value) => {
|
|
231
|
+
const newTab = value;
|
|
232
|
+
if (newTab === "organize-ranking" && tabStatuses.valuesStatus !== "completed") {
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
setActiveTab(newTab);
|
|
236
|
+
};
|
|
237
|
+
const handleSave = async () => {
|
|
238
|
+
setIsSaving(true);
|
|
239
|
+
try {
|
|
240
|
+
for (const [index, item] of rankingItems.entries()) {
|
|
241
|
+
if (item.isNew) {
|
|
242
|
+
await createValue({
|
|
243
|
+
value: item.value,
|
|
244
|
+
rank: index + 1,
|
|
245
|
+
metadata: {}
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
for (const [index, item] of rankingItems.entries()) {
|
|
250
|
+
if (!item.isNew) {
|
|
251
|
+
const existingPV = (attribute?.possible_values ?? []).find(
|
|
252
|
+
(pv) => pv.id === item.id
|
|
253
|
+
);
|
|
254
|
+
if (existingPV && existingPV.rank !== index + 1) {
|
|
255
|
+
await sdk.admin.attributes.$id.values.$valueId.mutate({
|
|
256
|
+
$id: id,
|
|
257
|
+
$valueId: item.id,
|
|
258
|
+
rank: index + 1
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
queryClient.invalidateQueries({
|
|
264
|
+
queryKey: attributesQueryKeys.detail(id)
|
|
265
|
+
});
|
|
266
|
+
toast.success(t("attributes.createPossibleValues.successToast"));
|
|
267
|
+
handleSuccess(`/settings/attributes/${id}`);
|
|
268
|
+
} catch (error) {
|
|
269
|
+
toast.error(error.message);
|
|
270
|
+
} finally {
|
|
271
|
+
setIsSaving(false);
|
|
272
|
+
}
|
|
273
|
+
};
|
|
274
|
+
if (isAttributeLoading || !attribute) {
|
|
275
|
+
return null;
|
|
276
|
+
}
|
|
277
|
+
return /* @__PURE__ */ jsx(FormProvider, { ...form, children: /* @__PURE__ */ jsxs(
|
|
278
|
+
ProgressTabs,
|
|
279
|
+
{
|
|
280
|
+
value: activeTab,
|
|
281
|
+
onValueChange: handleTabChange,
|
|
282
|
+
className: "flex size-full flex-col overflow-hidden",
|
|
283
|
+
"data-testid": "attribute-create-possible-value-progress-tabs",
|
|
284
|
+
children: [
|
|
285
|
+
/* @__PURE__ */ jsx(RouteFocusModal.Header, { "data-testid": "attribute-create-possible-value-modal-header", children: /* @__PURE__ */ jsxs(
|
|
286
|
+
ProgressTabs.List,
|
|
287
|
+
{
|
|
288
|
+
className: "justify-start flex w-full items-center",
|
|
289
|
+
"data-testid": "attribute-create-possible-value-tabs-list",
|
|
290
|
+
children: [
|
|
291
|
+
/* @__PURE__ */ jsx(
|
|
292
|
+
ProgressTabs.Trigger,
|
|
293
|
+
{
|
|
294
|
+
value: "values",
|
|
295
|
+
status: tabStatuses.valuesStatus,
|
|
296
|
+
"data-testid": "attribute-create-possible-value-values-tab",
|
|
297
|
+
children: t("attributes.createPossibleValues.tabs.values")
|
|
298
|
+
}
|
|
299
|
+
),
|
|
300
|
+
/* @__PURE__ */ jsx(
|
|
301
|
+
ProgressTabs.Trigger,
|
|
302
|
+
{
|
|
303
|
+
value: "organize-ranking",
|
|
304
|
+
status: tabStatuses.organizeStatus,
|
|
305
|
+
"data-testid": "attribute-create-possible-value-organize-tab",
|
|
306
|
+
children: t("attributes.createPossibleValues.tabs.organizeRanking")
|
|
307
|
+
}
|
|
308
|
+
)
|
|
309
|
+
]
|
|
310
|
+
}
|
|
311
|
+
) }),
|
|
312
|
+
/* @__PURE__ */ jsx(
|
|
313
|
+
RouteFocusModal.Body,
|
|
314
|
+
{
|
|
315
|
+
className: "flex flex-1 justify-center overflow-auto px-6 py-16",
|
|
316
|
+
"data-testid": "attribute-create-possible-value-modal-body",
|
|
317
|
+
children: /* @__PURE__ */ jsxs("div", { className: "flex w-full max-w-[720px] flex-col gap-y-8", children: [
|
|
318
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-y-1", children: [
|
|
319
|
+
/* @__PURE__ */ jsx(RouteFocusModal.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { "data-testid": "attribute-create-possible-value-heading", children: t("attributes.createPossibleValues.header") }) }),
|
|
320
|
+
/* @__PURE__ */ jsx(RouteFocusModal.Description, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
321
|
+
Text,
|
|
322
|
+
{
|
|
323
|
+
size: "small",
|
|
324
|
+
className: "text-ui-fg-subtle",
|
|
325
|
+
"data-testid": "attribute-create-possible-value-subtitle",
|
|
326
|
+
children: t("attributes.createPossibleValues.subtitle", {
|
|
327
|
+
name: attribute.name
|
|
328
|
+
})
|
|
329
|
+
}
|
|
330
|
+
) })
|
|
331
|
+
] }),
|
|
332
|
+
/* @__PURE__ */ jsx(ProgressTabs.Content, { value: "values", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-y-4", children: [
|
|
333
|
+
/* @__PURE__ */ jsx(
|
|
334
|
+
DndContext,
|
|
335
|
+
{
|
|
336
|
+
sensors,
|
|
337
|
+
collisionDetection: closestCenter,
|
|
338
|
+
onDragEnd: handleValuesDragEnd,
|
|
339
|
+
children: /* @__PURE__ */ jsx(
|
|
340
|
+
SortableContext,
|
|
341
|
+
{
|
|
342
|
+
items: fields.map((field) => field.id),
|
|
343
|
+
strategy: verticalListSortingStrategy,
|
|
344
|
+
children: fields.map((field, index) => /* @__PURE__ */ jsx(
|
|
345
|
+
SortableValueInput,
|
|
346
|
+
{
|
|
347
|
+
id: field.id,
|
|
348
|
+
index,
|
|
349
|
+
onRemove: () => remove(index)
|
|
350
|
+
},
|
|
351
|
+
field.id
|
|
352
|
+
))
|
|
353
|
+
}
|
|
354
|
+
)
|
|
355
|
+
}
|
|
356
|
+
),
|
|
357
|
+
/* @__PURE__ */ jsx(
|
|
358
|
+
Button,
|
|
359
|
+
{
|
|
360
|
+
type: "button",
|
|
361
|
+
variant: "secondary",
|
|
362
|
+
size: "small",
|
|
363
|
+
onClick: handleAddValue,
|
|
364
|
+
"data-testid": "attribute-create-possible-value-add-button",
|
|
365
|
+
children: t("attributes.createPossibleValues.addValue")
|
|
366
|
+
}
|
|
367
|
+
)
|
|
368
|
+
] }) }),
|
|
369
|
+
/* @__PURE__ */ jsx(ProgressTabs.Content, { value: "organize-ranking", children: /* @__PURE__ */ jsx(
|
|
370
|
+
DndContext,
|
|
371
|
+
{
|
|
372
|
+
sensors,
|
|
373
|
+
collisionDetection: closestCenter,
|
|
374
|
+
onDragEnd: handleRankingDragEnd,
|
|
375
|
+
children: /* @__PURE__ */ jsx(
|
|
376
|
+
SortableContext,
|
|
377
|
+
{
|
|
378
|
+
items: rankingItems.map((item) => item.id),
|
|
379
|
+
strategy: verticalListSortingStrategy,
|
|
380
|
+
children: rankingItems.map((item, index) => /* @__PURE__ */ jsx(
|
|
381
|
+
SortableRankingItem,
|
|
382
|
+
{
|
|
383
|
+
id: item.id,
|
|
384
|
+
value: item.value,
|
|
385
|
+
index
|
|
386
|
+
},
|
|
387
|
+
item.id
|
|
388
|
+
))
|
|
389
|
+
}
|
|
390
|
+
)
|
|
391
|
+
}
|
|
392
|
+
) })
|
|
393
|
+
] })
|
|
394
|
+
}
|
|
395
|
+
),
|
|
396
|
+
/* @__PURE__ */ jsx(RouteFocusModal.Footer, { "data-testid": "attribute-create-possible-value-modal-footer", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-end gap-2", children: [
|
|
397
|
+
/* @__PURE__ */ jsx(RouteFocusModal.Close, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
398
|
+
Button,
|
|
399
|
+
{
|
|
400
|
+
size: "small",
|
|
401
|
+
variant: "secondary",
|
|
402
|
+
type: "button",
|
|
403
|
+
"data-testid": "attribute-create-possible-value-cancel-button",
|
|
404
|
+
children: t("actions.cancel")
|
|
405
|
+
}
|
|
406
|
+
) }),
|
|
407
|
+
activeTab === "values" ? /* @__PURE__ */ jsx(
|
|
408
|
+
Button,
|
|
409
|
+
{
|
|
410
|
+
size: "small",
|
|
411
|
+
type: "button",
|
|
412
|
+
onClick: handleContinue,
|
|
413
|
+
"data-testid": "attribute-create-possible-value-continue-button",
|
|
414
|
+
children: t("actions.continue")
|
|
415
|
+
}
|
|
416
|
+
) : /* @__PURE__ */ jsx(
|
|
417
|
+
Button,
|
|
418
|
+
{
|
|
419
|
+
size: "small",
|
|
420
|
+
type: "button",
|
|
421
|
+
onClick: handleSave,
|
|
422
|
+
isLoading: isSaving,
|
|
423
|
+
"data-testid": "attribute-create-possible-value-save-button",
|
|
424
|
+
children: t("actions.save")
|
|
425
|
+
}
|
|
426
|
+
)
|
|
427
|
+
] }) })
|
|
428
|
+
]
|
|
429
|
+
}
|
|
430
|
+
) });
|
|
431
|
+
};
|
|
432
|
+
var AttributeCreatePossibleValue = () => {
|
|
433
|
+
return /* @__PURE__ */ jsx(RouteFocusModal, { "data-testid": "attribute-create-possible-value-modal", children: /* @__PURE__ */ jsx(AttributeCreatePossibleValueInner, {}) });
|
|
434
|
+
};
|
|
435
|
+
export {
|
|
436
|
+
AttributeCreatePossibleValue as Component
|
|
437
|
+
};
|