@medusajs/dashboard 3.0.0-snapshot-20251216135612 → 3.0.0-snapshot-20260102125810
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-locales-2OZXZCT5.mjs +81 -0
- package/dist/{adjust-inventory-26YXAXQL.mjs → adjust-inventory-47KGDWME.mjs} +2 -2
- package/dist/{api-key-management-create-EMP32G2D.mjs → api-key-management-create-EFPPZPZ7.mjs} +4 -4
- package/dist/{api-key-management-detail-6RCDH73M.mjs → api-key-management-detail-4IFED7SF.mjs} +15 -15
- package/dist/{api-key-management-edit-IBM3ZXHK.mjs → api-key-management-edit-QGVBNLUL.mjs} +4 -4
- package/dist/{api-key-management-list-KC5GOWAU.mjs → api-key-management-list-ROIJIIPQ.mjs} +4 -4
- package/dist/{api-key-management-sales-channels-LUB5G6RC.mjs → api-key-management-sales-channels-7P5L45AT.mjs} +6 -6
- package/dist/app.css +39 -3
- package/dist/app.js +18590 -16625
- package/dist/app.mjs +13 -13
- package/dist/{campaign-create-FJOECKGT.mjs → campaign-create-EZGZ4SBQ.mjs} +3 -3
- package/dist/{campaign-detail-5Q4BYCPX.mjs → campaign-detail-NFKLFPY4.mjs} +12 -12
- package/dist/{categories-metadata-J7M3XWI7.mjs → categories-metadata-G7BACZ26.mjs} +12 -12
- package/dist/{category-create-KHJZSC7G.mjs → category-create-7MV25HYX.mjs} +6 -6
- package/dist/{category-detail-S5IPXMHX.mjs → category-detail-XJQQ7UU4.mjs} +14 -14
- package/dist/{category-edit-CTA2EPDG.mjs → category-edit-LV7EARAB.mjs} +3 -3
- package/dist/{category-list-QBYJ4T3R.mjs → category-list-NIVLV5S3.mjs} +6 -6
- package/dist/{category-organize-SXP33XET.mjs → category-organize-SCRGWKDG.mjs} +3 -3
- package/dist/{category-products-KPW6BA5J.mjs → category-products-FXFSMCR6.mjs} +13 -13
- package/dist/{chunk-OXPE5TAY.mjs → chunk-24C2YVFU.mjs} +1 -1
- package/dist/{chunk-4JQR6QNW.mjs → chunk-333HK6Y6.mjs} +2 -2
- package/dist/{chunk-DODQ3KJT.mjs → chunk-3RRA56WC.mjs} +8 -3
- package/dist/{chunk-5LGRZSEH.mjs → chunk-3YPZ3R4U.mjs} +1 -1
- package/dist/{chunk-2DULKOPN.mjs → chunk-5ISRTMYH.mjs} +1 -1
- package/dist/{chunk-PHLCT2HA.mjs → chunk-5ZPKY5XP.mjs} +1 -1
- package/dist/{chunk-U6G4M5LP.mjs → chunk-6EXKKRZY.mjs} +1 -1
- package/dist/{chunk-GRZSG4EP.mjs → chunk-74WPAWMW.mjs} +127 -226
- package/dist/chunk-7AXHHXCX.mjs +4 -0
- package/dist/{chunk-YKYVCQRS.mjs → chunk-BJ44US4R.mjs} +382 -242
- package/dist/{chunk-BMS2QLJY.mjs → chunk-BMJ5RYIO.mjs} +1 -1
- package/dist/{chunk-Y2YVTIJI.mjs → chunk-CW5PQUJ6.mjs} +1 -1
- package/dist/{chunk-IAV7IKJ6.mjs → chunk-DN5BRKVN.mjs} +1 -1
- package/dist/{chunk-RS7DWLEP.mjs → chunk-DQUXK4WW.mjs} +1 -1
- package/dist/{chunk-2XTBDCGE.mjs → chunk-DWH2OQFK.mjs} +1 -1
- package/dist/{chunk-CCQD65EY.mjs → chunk-FKNW5MLZ.mjs} +360 -288
- package/dist/{chunk-HTCYX4VD.mjs → chunk-G35UUG2P.mjs} +1 -1
- package/dist/{chunk-QKALAT7P.mjs → chunk-GGONMC2N.mjs} +1 -1
- package/dist/{chunk-FYWHE3W5.mjs → chunk-GJN5SXGZ.mjs} +1 -1
- package/dist/{chunk-CVHJAKLQ.mjs → chunk-HDO2UCKF.mjs} +1 -1
- package/dist/{chunk-3C6WQ7NH.mjs → chunk-IWNNQ6HA.mjs} +37 -3
- package/dist/{chunk-OL24RDYM.mjs → chunk-KHJL6MUQ.mjs} +8 -8
- package/dist/{chunk-6P4Q4AAP.mjs → chunk-KPI4WFJU.mjs} +3 -3
- package/dist/{chunk-AHZLMCZF.mjs → chunk-KSDXSKJ7.mjs} +1 -1
- package/dist/{chunk-BZKI5J2M.mjs → chunk-L7A2JIQY.mjs} +3 -3
- package/dist/{chunk-XY7A7GZJ.mjs → chunk-LEAMWI5H.mjs} +1 -1
- package/dist/{chunk-A4XYK3MY.mjs → chunk-LG5B2BVB.mjs} +2 -2
- package/dist/{chunk-23GTCEOV.mjs → chunk-ML7BA2NY.mjs} +1 -1
- package/dist/{chunk-OFN7DIZA.mjs → chunk-OYHFHBNL.mjs} +94 -7
- package/dist/{chunk-OSHH5GAS.mjs → chunk-Q34TRFIW.mjs} +1 -13
- package/dist/{chunk-UJ2TMPV4.mjs → chunk-QBIQEVTU.mjs} +0 -12
- package/dist/{chunk-YYOPBKME.mjs → chunk-QHRAWZGA.mjs} +3 -3
- package/dist/{chunk-A2WBKOXJ.mjs → chunk-SO2DE6MM.mjs} +2 -2
- package/dist/chunk-T6DDBLGY.mjs +13 -0
- package/dist/{chunk-EHU67PIM.mjs → chunk-TOCMU7UV.mjs} +7 -3
- package/dist/{chunk-YIOBBZUB.mjs → chunk-U7KANQ5A.mjs} +2 -2
- package/dist/{chunk-Z6BFNHEO.mjs → chunk-UCYUWNJL.mjs} +109 -62
- package/dist/{chunk-WYATCUOM.mjs → chunk-V2RGYIAG.mjs} +10 -10
- package/dist/{chunk-UWY5ZV66.mjs → chunk-VQ73B7ZZ.mjs} +1 -13
- package/dist/chunk-XD72PXRS.mjs +329 -0
- package/dist/{store-add-locales-VJ4RJ7UI.mjs → chunk-YFXI6CWD.mjs} +2 -67
- package/dist/{chunk-AWRCV3ME.mjs → chunk-YM4XGCHB.mjs} +1 -1
- package/dist/{chunk-ZMG5B4FG.mjs → chunk-ZGV5NOTE.mjs} +1 -1
- package/dist/{collection-add-products-FU2BS3D3.mjs → collection-add-products-YDMBU2JY.mjs} +13 -13
- package/dist/{collection-create-GWKWVT7B.mjs → collection-create-RXHEXU6T.mjs} +3 -3
- package/dist/{collection-detail-VJE7XHLV.mjs → collection-detail-75XPGVOX.mjs} +13 -13
- package/dist/{collection-edit-EZIO2BR5.mjs → collection-edit-CGF47VIN.mjs} +3 -3
- package/dist/{collection-list-IGA6SCNF.mjs → collection-list-75N5NYXQ.mjs} +18 -17
- package/dist/{collection-metadata-QK7MI3D2.mjs → collection-metadata-TGGC6HM2.mjs} +12 -12
- package/dist/{customer-detail-MOV2T3LF.mjs → customer-detail-KDLZ23B3.mjs} +17 -16
- package/dist/{customer-group-detail-6T7OXGQD.mjs → customer-group-detail-ZIAVMOYS.mjs} +12 -12
- package/dist/{customer-group-list-AJEAF5D2.mjs → customer-group-list-BDDC5VVZ.mjs} +15 -15
- package/dist/{customers-add-customer-group-QVTVSQYM.mjs → customers-add-customer-group-B3ASQGP6.mjs} +12 -12
- package/dist/{edit-inventory-item-H7DAZWIT.mjs → edit-inventory-item-OKAXQRJ5.mjs} +2 -2
- package/dist/{edit-inventory-item-attributes-7HTXXPGZ.mjs → edit-inventory-item-attributes-FVWDV6O5.mjs} +2 -2
- package/dist/{edit-reservation-OVTRZHJR.mjs → edit-reservation-3PU6YSNJ.mjs} +3 -3
- package/dist/{edit-rules-SMVRTCUP.mjs → edit-rules-LOJ3P4YB.mjs} +14 -14
- package/dist/en.json +85 -5
- package/dist/{inventory-create-ANYUM4P5.mjs → inventory-create-C2WWS7QR.mjs} +13 -13
- package/dist/{inventory-detail-ZPSEMYI2.mjs → inventory-detail-AKOZ4T3Z.mjs} +12 -12
- package/dist/{inventory-list-RXJPSVZE.mjs → inventory-list-DRFJIU2O.mjs} +2 -2
- package/dist/{inventory-metadata-FNEJ3RAT.mjs → inventory-metadata-N6CJZEWD.mjs} +12 -12
- package/dist/{inventory-stock-FD4ZM4BB.mjs → inventory-stock-IJ2N7LKC.mjs} +14 -14
- package/dist/{location-detail-N3GUZSY7.mjs → location-detail-PL4Y43RS.mjs} +16 -16
- package/dist/{location-fulfillment-providers-7ZUJAGNY.mjs → location-fulfillment-providers-2PLOVSXC.mjs} +17 -16
- package/dist/{location-sales-channels-P3QJTFDT.mjs → location-sales-channels-SZARSLWT.mjs} +5 -5
- package/dist/{location-service-zone-shipping-option-create-ZJ4GIBTJ.mjs → location-service-zone-shipping-option-create-CUNSAP24.mjs} +15 -15
- package/dist/{location-service-zone-shipping-option-edit-4CGPQ3VT.mjs → location-service-zone-shipping-option-edit-OJ462SVM.mjs} +1 -1
- package/dist/{location-service-zone-shipping-option-pricing-CR4BVYG3.mjs → location-service-zone-shipping-option-pricing-5HN2Z5RB.mjs} +2 -2
- package/dist/login-VBUNWZHI.mjs +301 -0
- package/dist/{manage-locations-7HH6R4UP.mjs → manage-locations-JPCSBA5D.mjs} +2 -2
- package/dist/{order-allocate-items-HZGGYJ42.mjs → order-allocate-items-6QHQASQJ.mjs} +4 -4
- package/dist/{order-create-claim-SCDJGM46.mjs → order-create-claim-ECVSH5GC.mjs} +22 -22
- package/dist/{order-create-edit-JIE3HDHP.mjs → order-create-edit-EVIOJIXE.mjs} +14 -13
- package/dist/{order-create-exchange-LQU4YN7F.mjs → order-create-exchange-ZVYYOGI3.mjs} +22 -22
- package/dist/{order-create-fulfillment-OWUVTZXW.mjs → order-create-fulfillment-FDIFEV6X.mjs} +16 -16
- package/dist/{order-create-refund-Q6HQY42R.mjs → order-create-refund-TNPGKR5P.mjs} +17 -17
- package/dist/{order-create-return-52GHGW5Z.mjs → order-create-return-NR6XQLDD.mjs} +9 -9
- package/dist/{order-create-shipment-WAGGEPRW.mjs → order-create-shipment-UP3WGRWB.mjs} +12 -12
- package/dist/{order-detail-PVPGEWGY.mjs → order-detail-F6D5DV74.mjs} +28 -28
- package/dist/{order-edit-billing-address-UM76J4KX.mjs → order-edit-billing-address-D4AJ6Z5Q.mjs} +44 -12
- package/dist/{order-edit-email-CL3KNOCM.mjs → order-edit-email-MXYA5BII.mjs} +12 -12
- package/dist/{order-edit-shipping-address-PIESTGVL.mjs → order-edit-shipping-address-GKW2ZPGR.mjs} +42 -12
- package/dist/{order-export-LE363ZLB.mjs → order-export-KQUI2TK7.mjs} +14 -14
- package/dist/{order-list-GRLQWN4L.mjs → order-list-7A5UKGXR.mjs} +11 -11
- package/dist/{order-metadata-FHBB7MTG.mjs → order-metadata-2IXELA7C.mjs} +12 -12
- package/dist/{order-receive-return-PRVKP6J2.mjs → order-receive-return-XXHOXGDC.mjs} +13 -13
- package/dist/{order-request-transfer-XSAGRUMT.mjs → order-request-transfer-2ENR64VR.mjs} +13 -13
- package/dist/{price-list-configuration-6S3MLNXQ.mjs → price-list-configuration-BZ3ZH5FY.mjs} +3 -3
- package/dist/{price-list-create-MFRUQADC.mjs → price-list-create-GFGNP6OS.mjs} +16 -16
- package/dist/{price-list-detail-Q5VG5VGW.mjs → price-list-detail-SNNOR5N7.mjs} +17 -17
- package/dist/{price-list-edit-53UW35L3.mjs → price-list-edit-YW5BXBF2.mjs} +3 -3
- package/dist/{price-list-list-DG5YEZ44.mjs → price-list-list-OF562HME.mjs} +4 -4
- package/dist/{price-list-prices-add-SDU5YZAT.mjs → price-list-prices-add-F7A2EV7L.mjs} +15 -15
- package/dist/{price-list-prices-edit-5USQR4D4.mjs → price-list-prices-edit-PQ26MOJE.mjs} +5 -5
- package/dist/{product-attributes-EFIRUBRO.mjs → product-attributes-JTPGHUXZ.mjs} +13 -13
- package/dist/{product-create-K6EWZHIT.mjs → product-create-VFLLQWVX.mjs} +485 -561
- package/dist/{product-create-variant-ERKHTEJZ.mjs → product-create-variant-PLZ5Q2R6.mjs} +14 -14
- package/dist/{product-detail-DKPZDEIY.mjs → product-detail-ISHFZV7X.mjs} +45 -66
- package/dist/{product-edit-55YXTIGO.mjs → product-edit-6EDDNIM6.mjs} +13 -13
- package/dist/{product-export-5AD7NELI.mjs → product-export-UMMROQ7T.mjs} +18 -17
- package/dist/{product-image-variants-edit-M6QF2RLE.mjs → product-image-variants-edit-VRG3AJID.mjs} +12 -12
- package/dist/{product-import-V3KQN4TV.mjs → product-import-EPS4KDID.mjs} +12 -12
- package/dist/{product-list-EUWZIFTM.mjs → product-list-37O7VB2L.mjs} +20 -20
- package/dist/{product-media-3VJ7KENL.mjs → product-media-IV5NUSLW.mjs} +3 -3
- package/dist/{product-metadata-GL2MVPDI.mjs → product-metadata-KTVRI7B3.mjs} +12 -12
- package/dist/product-option-create-JUGLFR2K.mjs +336 -0
- package/dist/product-option-detail-VVK3YBCE.mjs +331 -0
- package/dist/product-option-edit-7FQSKI2R.mjs +325 -0
- package/dist/product-option-list-YHGRI7OJ.mjs +268 -0
- package/dist/product-option-metadata-P2DHDGYR.mjs +73 -0
- package/dist/product-options-manage-4SZDF5H5.mjs +325 -0
- package/dist/{product-organization-N3VBRXF4.mjs → product-organization-OEUSIWNQ.mjs} +15 -15
- package/dist/{product-prices-4C36AG4R.mjs → product-prices-GUO3KM2U.mjs} +3 -3
- package/dist/{product-sales-channels-PPXUG4KT.mjs → product-sales-channels-BOZD3AC3.mjs} +5 -5
- package/dist/{product-shipping-profile-ETQFZ7DC.mjs → product-shipping-profile-FNFRDY47.mjs} +3 -3
- package/dist/{product-stock-VEGE6SUZ.mjs → product-stock-2DNYG73L.mjs} +14 -14
- package/dist/{product-tag-create-PQMDDKWH.mjs → product-tag-create-CW7GUCZW.mjs} +12 -12
- package/dist/{product-tag-detail-I3MBZX7U.mjs → product-tag-detail-IB5VIZ3K.mjs} +26 -25
- package/dist/{product-tag-edit-K3BBQLJR.mjs → product-tag-edit-ZSXD3DOC.mjs} +12 -12
- package/dist/{product-tag-list-JUWSOMB7.mjs → product-tag-list-MJO5PURP.mjs} +24 -23
- package/dist/{product-tag-metadata-MJH5LH7E.mjs → product-tag-metadata-DAKCXWZF.mjs} +12 -12
- package/dist/{product-type-create-DRFXTL5O.mjs → product-type-create-NRLNMABQ.mjs} +2 -2
- package/dist/{product-type-detail-RKHT5NBL.mjs → product-type-detail-J2IMAZW6.mjs} +14 -14
- package/dist/{product-type-edit-SRHCZDK7.mjs → product-type-edit-BHTPMMVI.mjs} +2 -2
- package/dist/{product-type-list-QQKAHBJ3.mjs → product-type-list-MQ2PW2IE.mjs} +3 -3
- package/dist/{product-type-metadata-CDJDFFGQ.mjs → product-type-metadata-BCZMUG3K.mjs} +12 -12
- package/dist/{product-variant-detail-XAYG5CKE.mjs → product-variant-detail-4L6DHT3K.mjs} +12 -12
- package/dist/{product-variant-edit-DEZEY2H2.mjs → product-variant-edit-PZU4P65H.mjs} +13 -13
- package/dist/{product-variant-manage-inventory-items-Y2VEOHP7.mjs → product-variant-manage-inventory-items-E3GPBPEZ.mjs} +3 -3
- package/dist/{product-variant-media-2WLVNGI4.mjs → product-variant-media-BSNCO642.mjs} +2 -2
- package/dist/{product-variant-metadata-VTZDNWUT.mjs → product-variant-metadata-FHGGZGPV.mjs} +12 -12
- package/dist/{promotion-add-campaign-DO67QK6M.mjs → promotion-add-campaign-NQSIFI33.mjs} +3 -3
- package/dist/{promotion-create-HWFNUQXG.mjs → promotion-create-GBZWJVAI.mjs} +24 -21
- package/dist/{promotion-detail-QC36KXB3.mjs → promotion-detail-W2OGUESO.mjs} +12 -12
- package/dist/{refund-reason-create-YHCDEHGQ.mjs → refund-reason-create-DLVRT5OU.mjs} +12 -12
- package/dist/{refund-reason-edit-CZ5QZ2SZ.mjs → refund-reason-edit-XCSU7RMH.mjs} +12 -12
- package/dist/{refund-reason-list-OJYYEYJE.mjs → refund-reason-list-G6UNVGPG.mjs} +18 -18
- package/dist/{region-create-NA7Y2LN4.mjs → region-create-2CRTF7HJ.mjs} +1 -1
- package/dist/{region-edit-WAU347DP.mjs → region-edit-IB3PJE7V.mjs} +1 -1
- package/dist/{region-metadata-H6XXUQ4S.mjs → region-metadata-WBEUKOI6.mjs} +12 -12
- package/dist/{reservation-create-ZCIYM6JI.mjs → reservation-create-ERFJUBME.mjs} +4 -4
- package/dist/{reservation-detail-LZAQL4XA.mjs → reservation-detail-Y6UZRZXY.mjs} +12 -12
- package/dist/{reservation-list-B47DXTA7.mjs → reservation-list-LEDZB7KL.mjs} +3 -3
- package/dist/{reservation-metadata-5HZSDDOK.mjs → reservation-metadata-7KH4EXMN.mjs} +12 -12
- package/dist/{return-reason-list-SCBGTOEI.mjs → return-reason-list-UUQAL464.mjs} +6 -6
- package/dist/{sales-channel-add-products-F7YV4MO5.mjs → sales-channel-add-products-GSPG7OTK.mjs} +14 -14
- package/dist/{sales-channel-create-MI7HHZYE.mjs → sales-channel-create-MM237EBQ.mjs} +3 -3
- package/dist/{sales-channel-detail-MXIPZCGA.mjs → sales-channel-detail-65ZFV2OI.mjs} +14 -14
- package/dist/{sales-channel-edit-VSHOIR37.mjs → sales-channel-edit-AC2J4N3M.mjs} +3 -3
- package/dist/{sales-channel-list-RLGL7FM3.mjs → sales-channel-list-LXLW7X3U.mjs} +14 -14
- package/dist/{sales-channel-metadata-M364R4RJ.mjs → sales-channel-metadata-QUAL2RH6.mjs} +13 -13
- package/dist/{shipping-option-type-create-C5WUWON7.mjs → shipping-option-type-create-EU75JC2Q.mjs} +12 -12
- package/dist/{shipping-option-type-detail-PENS2K73.mjs → shipping-option-type-detail-5GYEWATD.mjs} +13 -13
- package/dist/{shipping-option-type-edit-CIU5EHRP.mjs → shipping-option-type-edit-YR4JXT5M.mjs} +12 -12
- package/dist/{shipping-option-type-list-DIOX7VG7.mjs → shipping-option-type-list-BLC4Z5QW.mjs} +13 -13
- package/dist/{shipping-profile-metadata-75G2NNMA.mjs → shipping-profile-metadata-64YRWPDA.mjs} +12 -12
- package/dist/store-add-locales-TSMLNFZP.mjs +81 -0
- package/dist/{store-detail-JSNPOB2F.mjs → store-detail-3SS53LZR.mjs} +13 -13
- package/dist/{store-edit-5ZS562ZO.mjs → store-edit-SMEWFETF.mjs} +1 -1
- package/dist/{store-metadata-CYXTVJUE.mjs → store-metadata-IJGVDDA6.mjs} +12 -12
- package/dist/{tax-region-create-DWGL4EUT.mjs → tax-region-create-XLYIS5XX.mjs} +13 -13
- package/dist/{tax-region-detail-2AE2EFI3.mjs → tax-region-detail-66FKEGFB.mjs} +29 -28
- package/dist/{tax-region-edit-EEVEEU2Q.mjs → tax-region-edit-GBR4EDW7.mjs} +13 -13
- package/dist/{tax-region-province-detail-4ERSEQFF.mjs → tax-region-province-detail-OBA7Q7MQ.mjs} +29 -28
- package/dist/{tax-region-tax-override-create-PHCGEF7V.mjs → tax-region-tax-override-create-34WYD2QZ.mjs} +28 -27
- package/dist/{tax-region-tax-override-edit-SMRPSILC.mjs → tax-region-tax-override-edit-6WJVOGWA.mjs} +27 -26
- package/dist/translation-list-J65VNNAX.mjs +527 -0
- package/dist/{translations-edit-HUNKY7CO.mjs → translations-edit-6P3KC4MO.mjs} +285 -320
- package/dist/{user-detail-BJUXLZZQ.mjs → user-detail-VMOJFHIJ.mjs} +2 -2
- package/dist/{user-metadata-2WPJOEJA.mjs → user-metadata-UOPVFX2L.mjs} +12 -12
- package/dist/{workflow-execution-detail-H2AKEZJX.mjs → workflow-execution-detail-WAQ7IG4T.mjs} +12 -12
- package/package.json +9 -9
- package/src/components/data-grid/components/data-grid-cell-container.tsx +7 -10
- package/src/components/data-grid/components/data-grid-multiline-cell.tsx +103 -0
- package/src/components/data-grid/components/data-grid-readonly-cell.tsx +1 -4
- package/src/components/data-grid/components/data-grid-root.tsx +68 -51
- package/src/components/data-grid/components/data-grid-text-cell.tsx +6 -76
- package/src/components/data-grid/components/index.ts +1 -0
- package/src/components/data-grid/data-grid.tsx +2 -0
- package/src/components/data-grid/hooks/use-data-grid-cell.tsx +12 -0
- package/src/components/data-grid/hooks/use-data-grid-form-handlers.tsx +1 -0
- package/src/components/data-grid/hooks/use-data-grid-keydown-event.tsx +65 -7
- package/src/components/data-grid/types.ts +1 -0
- package/src/components/inputs/combobox/combobox.tsx +185 -95
- package/src/components/layout/main-layout/main-layout.tsx +7 -4
- package/src/components/table/table-cells/order/country-cell/country-cell.tsx +5 -1
- package/src/dashboard-app/routes/get-route.map.tsx +68 -12
- package/src/hooks/api/cloud.tsx +41 -0
- package/src/hooks/api/index.ts +3 -1
- package/src/hooks/api/product-options.tsx +151 -0
- package/src/hooks/api/products.tsx +26 -66
- package/src/hooks/api/translations.tsx +103 -191
- package/src/hooks/table/columns/use-order-table-columns.tsx +5 -3
- package/src/hooks/table/columns/use-product-option-table-columns.tsx +44 -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/translations/$schema.json +304 -12
- package/src/i18n/translations/en.json +85 -5
- package/src/i18n/translations/es.json +21 -1
- package/src/routes/customers/customer-detail/components/customer-order-section/customer-order-section.tsx +1 -1
- package/src/routes/login/components/cloud-auth-login.tsx +114 -0
- package/src/routes/login/login.tsx +9 -1
- package/src/routes/orders/order-create-edit/components/order-edit-create-form/order-edit-item.tsx +1 -0
- package/src/routes/orders/order-edit-billing-address/components/edit-order-billing-address-form/edit-order-billing-address-form.tsx +34 -0
- package/src/routes/orders/order-edit-shipping-address/components/edit-order-shipping-address-form/edit-order-shipping-address-form.tsx +32 -0
- 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 +84 -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 +82 -0
- package/src/routes/product-options/product-option-detail/index.ts +3 -0
- package/src/routes/product-options/product-option-detail/loader.ts +18 -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 +140 -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-general-section/product-create-general-section.tsx +16 -4
- package/src/routes/products/product-create/components/product-create-details-form/components/product-create-details-variant-section/product-create-details-variant-section.tsx +327 -194
- package/src/routes/products/product-create/components/product-create-form/product-create-form.tsx +4 -7
- package/src/routes/products/product-create/constants.ts +2 -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 +33 -51
- 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 +296 -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/src/routes/promotions/promotion-create/components/create-promotion-form/create-promotion-form.tsx +6 -0
- package/src/routes/translations/add-locales/add-locales.tsx +29 -0
- package/src/routes/translations/add-locales/index.tsx +1 -0
- package/src/routes/translations/translation-list/components/active-locales-section/active-locales-section.tsx +42 -17
- package/src/routes/translations/translation-list/components/translation-list-section/translation-list-section.tsx +5 -1
- package/src/routes/translations/translation-list/components/translations-completion-section/translations-completion-section.tsx +253 -41
- package/src/routes/translations/translation-list/translation-list.tsx +8 -2
- package/src/routes/translations/translations-edit/components/translations-edit-form/translations-edit-form.tsx +337 -380
- package/src/routes/translations/translations-edit/translations-edit.tsx +8 -13
- package/dist/chunk-HGRIOEAR.mjs +0 -32
- package/dist/chunk-XDJ7OMBR.mjs +0 -160
- package/dist/login-VNOLI5YG.mjs +0 -201
- package/dist/product-create-option-7AOXAA4S.mjs +0 -151
- package/dist/product-edit-option-LWJT3CYJ.mjs +0 -156
- package/dist/translation-list-S5Z6PG2R.mjs +0 -295
- 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 -30
- 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 -35
- package/dist/{chunk-FBYTX6K7.mjs → chunk-ORWRXJJT.mjs} +4 -4
- package/dist/{location-list-KVBA6J47.mjs → location-list-3WP65J3E.mjs} +1 -1
- package/dist/{user-list-YTZQNYSO.mjs → user-list-3EAKK4XC.mjs} +3 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DataGrid,
|
|
3
3
|
createDataGridHelper
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-FKNW5MLZ.mjs";
|
|
5
5
|
import "./chunk-DK4WIVY6.mjs";
|
|
6
6
|
import "./chunk-IUCDCPJU.mjs";
|
|
7
7
|
import {
|
|
@@ -23,215 +23,173 @@ import {
|
|
|
23
23
|
useBatchTranslations,
|
|
24
24
|
useReferenceTranslations,
|
|
25
25
|
useTranslationSettings
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-74WPAWMW.mjs";
|
|
27
27
|
import "./chunk-I4OBEAOJ.mjs";
|
|
28
28
|
import "./chunk-HI6URQ7H.mjs";
|
|
29
29
|
import "./chunk-6CLQKVAU.mjs";
|
|
30
|
+
import "./chunk-ML7BA2NY.mjs";
|
|
30
31
|
import "./chunk-KI7TOXBR.mjs";
|
|
31
|
-
import "./chunk-
|
|
32
|
-
import "./chunk-23GTCEOV.mjs";
|
|
32
|
+
import "./chunk-QBIQEVTU.mjs";
|
|
33
33
|
import "./chunk-WAXMT4IY.mjs";
|
|
34
34
|
import "./chunk-DYDGGABK.mjs";
|
|
35
|
-
import "./chunk-LGNTHZ5Y.mjs";
|
|
36
35
|
import "./chunk-CN7JXSGW.mjs";
|
|
36
|
+
import "./chunk-LGNTHZ5Y.mjs";
|
|
37
37
|
import "./chunk-5BQQRHQS.mjs";
|
|
38
|
-
import "./chunk-
|
|
38
|
+
import "./chunk-G35UUG2P.mjs";
|
|
39
39
|
import "./chunk-5AFMB7XQ.mjs";
|
|
40
|
-
import "./chunk-
|
|
40
|
+
import "./chunk-VQ73B7ZZ.mjs";
|
|
41
41
|
import "./chunk-A63RZVX6.mjs";
|
|
42
42
|
import "./chunk-HBXV7ENS.mjs";
|
|
43
43
|
import "./chunk-CDORR33H.mjs";
|
|
44
|
-
import "./chunk-
|
|
45
|
-
import "./chunk-
|
|
46
|
-
import "./chunk-
|
|
47
|
-
import "./chunk-2XTBDCGE.mjs";
|
|
44
|
+
import "./chunk-333HK6Y6.mjs";
|
|
45
|
+
import "./chunk-GJN5SXGZ.mjs";
|
|
46
|
+
import "./chunk-Q34TRFIW.mjs";
|
|
48
47
|
import "./chunk-3BF5SC66.mjs";
|
|
48
|
+
import "./chunk-DWH2OQFK.mjs";
|
|
49
49
|
import {
|
|
50
50
|
useStore
|
|
51
51
|
} from "./chunk-VCSSQVPD.mjs";
|
|
52
52
|
import "./chunk-HP2JH45P.mjs";
|
|
53
53
|
import "./chunk-SQDIZZDW.mjs";
|
|
54
|
-
import "./chunk-
|
|
55
|
-
import "./chunk-
|
|
54
|
+
import "./chunk-UCYUWNJL.mjs";
|
|
55
|
+
import "./chunk-7AXHHXCX.mjs";
|
|
56
56
|
import "./chunk-FXYH54JP.mjs";
|
|
57
57
|
import "./chunk-774WSTCC.mjs";
|
|
58
58
|
import "./chunk-NFEK63OE.mjs";
|
|
59
59
|
import "./chunk-QZ7TP4HQ.mjs";
|
|
60
60
|
|
|
61
61
|
// src/routes/translations/translations-edit/translations-edit.tsx
|
|
62
|
+
import { keepPreviousData } from "@tanstack/react-query";
|
|
63
|
+
import { useEffect as useEffect2 } from "react";
|
|
62
64
|
import { useNavigate, useSearchParams } from "react-router-dom";
|
|
63
65
|
|
|
64
66
|
// src/routes/translations/translations-edit/components/translations-edit-form/translations-edit-form.tsx
|
|
65
67
|
import { zodResolver } from "@hookform/resolvers/zod";
|
|
66
|
-
import { Button, Prompt, Select, toast } from "@medusajs/ui";
|
|
68
|
+
import { Button, Prompt, Select, toast, Text } from "@medusajs/ui";
|
|
67
69
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
68
70
|
import { useForm } from "react-hook-form";
|
|
69
71
|
import { useTranslation } from "react-i18next";
|
|
70
72
|
import { z } from "zod";
|
|
71
73
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
72
|
-
var
|
|
74
|
+
var EntityTranslationsSchema = z.object({
|
|
73
75
|
id: z.string().nullish(),
|
|
74
|
-
locale_code: z.string(),
|
|
75
76
|
fields: z.record(z.string().optional())
|
|
76
77
|
});
|
|
77
|
-
var EntityTranslationsSchema = z.object({
|
|
78
|
-
locales: z.record(LocaleTranslationSchema)
|
|
79
|
-
});
|
|
80
78
|
var TranslationsFormSchema = z.object({
|
|
81
79
|
entities: z.record(EntityTranslationsSchema)
|
|
82
80
|
});
|
|
83
81
|
function isEntityRow(row) {
|
|
84
82
|
return row._type === "entity";
|
|
85
83
|
}
|
|
86
|
-
function
|
|
87
|
-
const
|
|
84
|
+
function buildLocaleSnapshot(translations, references, localeCode, translatableFields) {
|
|
85
|
+
const referenceTranslations = /* @__PURE__ */ new Map();
|
|
86
|
+
for (const t of translations) {
|
|
87
|
+
if (t.locale_code === localeCode) {
|
|
88
|
+
referenceTranslations.set(t.reference_id, t);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
const entities = {};
|
|
92
|
+
for (const ref of references) {
|
|
93
|
+
const existing = referenceTranslations.get(ref.id);
|
|
94
|
+
const fields = {};
|
|
95
|
+
for (const fieldName of translatableFields) {
|
|
96
|
+
fields[fieldName] = existing?.translations?.[fieldName] ?? "";
|
|
97
|
+
}
|
|
98
|
+
entities[ref.id] = {
|
|
99
|
+
id: existing?.id ?? null,
|
|
100
|
+
fields
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
return { localeCode, entities };
|
|
104
|
+
}
|
|
105
|
+
function extendSnapshot(snapshot, translations, newReferences, translatableFields) {
|
|
106
|
+
const referenceTranslations = /* @__PURE__ */ new Map();
|
|
88
107
|
for (const t of translations) {
|
|
89
|
-
|
|
108
|
+
if (t.locale_code === snapshot.localeCode) {
|
|
109
|
+
referenceTranslations.set(t.reference_id, t);
|
|
110
|
+
}
|
|
90
111
|
}
|
|
91
|
-
const
|
|
92
|
-
for (const
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
const key = `${reference.id}:${locale.locale_code}`;
|
|
96
|
-
const existing = existingMap.get(key);
|
|
112
|
+
const extendedEntities = { ...snapshot.entities };
|
|
113
|
+
for (const ref of newReferences) {
|
|
114
|
+
if (!extendedEntities[ref.id]) {
|
|
115
|
+
const existing = referenceTranslations.get(ref.id);
|
|
97
116
|
const fields = {};
|
|
98
117
|
for (const fieldName of translatableFields) {
|
|
99
|
-
|
|
100
|
-
fields[fieldName] = fieldValue;
|
|
118
|
+
fields[fieldName] = existing?.translations?.[fieldName] ?? "";
|
|
101
119
|
}
|
|
102
|
-
|
|
120
|
+
extendedEntities[ref.id] = {
|
|
103
121
|
id: existing?.id ?? null,
|
|
104
|
-
locale_code: locale.locale_code,
|
|
105
122
|
fields
|
|
106
123
|
};
|
|
107
124
|
}
|
|
108
|
-
entitiesTranslationState[reference.id] = { locales };
|
|
109
125
|
}
|
|
110
|
-
return {
|
|
111
|
-
entities: entitiesTranslationState
|
|
112
|
-
};
|
|
126
|
+
return { ...snapshot, entities: extendedEntities };
|
|
113
127
|
}
|
|
114
|
-
function
|
|
115
|
-
return
|
|
116
|
-
_type: "entity",
|
|
117
|
-
reference_id: reference.id,
|
|
118
|
-
subRows: translatableFields.map((fieldName) => ({
|
|
119
|
-
_type: "field",
|
|
120
|
-
reference_id: reference.id,
|
|
121
|
-
field_name: fieldName
|
|
122
|
-
}))
|
|
123
|
-
}));
|
|
128
|
+
function snapshotToFormValues(snapshot) {
|
|
129
|
+
return { entities: snapshot.entities };
|
|
124
130
|
}
|
|
125
|
-
function
|
|
131
|
+
function computeChanges(currentState, snapshot, entityType, localeCode) {
|
|
126
132
|
const payload = {
|
|
127
133
|
create: [],
|
|
128
134
|
update: [],
|
|
129
135
|
delete: []
|
|
130
136
|
};
|
|
131
137
|
for (const [entityId, entityData] of Object.entries(currentState.entities)) {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
)) {
|
|
135
|
-
const initial = initialState.entities[entityId]?.locales[localeCode];
|
|
136
|
-
const hasContent = Object.values(localeTranslations.fields).some(
|
|
137
|
-
(v) => v !== void 0 && v.trim() !== ""
|
|
138
|
-
);
|
|
139
|
-
const hadContent = initial && Object.values(initial.fields).some(
|
|
140
|
-
(v) => v !== void 0 && v.trim() !== ""
|
|
141
|
-
);
|
|
142
|
-
if (!localeTranslations.id && hasContent) {
|
|
143
|
-
payload.create.push({
|
|
144
|
-
reference_id: entityId,
|
|
145
|
-
reference: entityType,
|
|
146
|
-
locale_code: localeTranslations.locale_code,
|
|
147
|
-
translations: localeTranslations.fields
|
|
148
|
-
});
|
|
149
|
-
} else if (localeTranslations.id && hasContent) {
|
|
150
|
-
const hasChanged = !initial || JSON.stringify(localeTranslations.fields) !== JSON.stringify(initial.fields);
|
|
151
|
-
if (hasChanged) {
|
|
152
|
-
payload.update.push({
|
|
153
|
-
id: localeTranslations.id,
|
|
154
|
-
translations: localeTranslations.fields
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
} else if (localeTranslations.id && !hasContent && hadContent) {
|
|
158
|
-
payload.delete.push(localeTranslations.id);
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
return payload;
|
|
163
|
-
}
|
|
164
|
-
function hasLocaleChanges(currentState, initialState, localeCode) {
|
|
165
|
-
for (const [entityId, entityData] of Object.entries(currentState.entities)) {
|
|
166
|
-
const currentLocale = entityData.locales[localeCode];
|
|
167
|
-
const initialLocale = initialState.entities[entityId]?.locales[localeCode];
|
|
168
|
-
if (!currentLocale || !initialLocale) {
|
|
138
|
+
const baseline = snapshot.entities[entityId];
|
|
139
|
+
if (!baseline) {
|
|
169
140
|
continue;
|
|
170
141
|
}
|
|
171
|
-
|
|
172
|
-
currentLocale.fields
|
|
173
|
-
)) {
|
|
174
|
-
const initialValue = initialLocale.fields[fieldName] ?? "";
|
|
175
|
-
const currentValue = fieldValue ?? "";
|
|
176
|
-
if (currentValue !== initialValue) {
|
|
177
|
-
return true;
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
return false;
|
|
182
|
-
}
|
|
183
|
-
function transformSingleLocaleToBatchPayload(currentState, initialState, entityType, localeCode) {
|
|
184
|
-
const payload = {
|
|
185
|
-
create: [],
|
|
186
|
-
update: [],
|
|
187
|
-
delete: []
|
|
188
|
-
};
|
|
189
|
-
for (const [entityId, entityData] of Object.entries(currentState.entities)) {
|
|
190
|
-
const localeTranslations = entityData.locales[localeCode];
|
|
191
|
-
if (!localeTranslations) continue;
|
|
192
|
-
const initial = initialState.entities[entityId]?.locales[localeCode];
|
|
193
|
-
const hasContent = Object.values(localeTranslations.fields).some(
|
|
142
|
+
const hasContent = Object.values(entityData.fields).some(
|
|
194
143
|
(v) => v !== void 0 && v.trim() !== ""
|
|
195
144
|
);
|
|
196
|
-
const hadContent =
|
|
145
|
+
const hadContent = Object.values(baseline.fields).some(
|
|
197
146
|
(v) => v !== void 0 && v.trim() !== ""
|
|
198
147
|
);
|
|
199
|
-
|
|
148
|
+
const hasChanged = JSON.stringify(entityData.fields) !== JSON.stringify(baseline.fields);
|
|
149
|
+
if (!entityData.id && hasContent) {
|
|
200
150
|
payload.create.push({
|
|
201
151
|
reference_id: entityId,
|
|
202
152
|
reference: entityType,
|
|
203
|
-
locale_code:
|
|
204
|
-
translations:
|
|
153
|
+
locale_code: localeCode,
|
|
154
|
+
translations: entityData.fields
|
|
205
155
|
});
|
|
206
|
-
} else if (
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
}
|
|
214
|
-
} else if (localeTranslations.id && !hasContent && hadContent) {
|
|
215
|
-
payload.delete.push(localeTranslations.id);
|
|
156
|
+
} else if (entityData.id && hasContent && hasChanged) {
|
|
157
|
+
payload.update.push({
|
|
158
|
+
id: entityData.id,
|
|
159
|
+
translations: entityData.fields
|
|
160
|
+
});
|
|
161
|
+
} else if (entityData.id && !hasContent && hadContent) {
|
|
162
|
+
payload.delete.push(entityData.id);
|
|
216
163
|
}
|
|
217
164
|
}
|
|
218
|
-
|
|
165
|
+
const hasChanges = payload.create.length > 0 || payload.update.length > 0 || payload.delete.length > 0;
|
|
166
|
+
return { hasChanges, payload };
|
|
219
167
|
}
|
|
220
168
|
var columnHelper = createDataGridHelper();
|
|
221
|
-
var FIELD_COLUMN_WIDTH =
|
|
169
|
+
var FIELD_COLUMN_WIDTH = 350;
|
|
170
|
+
function buildTranslationRows(references, translatableFields) {
|
|
171
|
+
return references.map((reference) => ({
|
|
172
|
+
_type: "entity",
|
|
173
|
+
reference_id: reference.id,
|
|
174
|
+
subRows: translatableFields.map((fieldName) => ({
|
|
175
|
+
_type: "field",
|
|
176
|
+
reference_id: reference.id,
|
|
177
|
+
field_name: fieldName
|
|
178
|
+
}))
|
|
179
|
+
}));
|
|
180
|
+
}
|
|
222
181
|
function useTranslationsGridColumns({
|
|
223
182
|
entities,
|
|
224
|
-
translatableFields,
|
|
225
183
|
availableLocales,
|
|
226
184
|
selectedLocale,
|
|
227
185
|
dynamicColumnWidth
|
|
228
186
|
}) {
|
|
229
187
|
const { t } = useTranslation();
|
|
230
|
-
|
|
188
|
+
return useMemo(() => {
|
|
231
189
|
const selectedLocaleData = availableLocales.find(
|
|
232
190
|
(l) => l.locale_code === selectedLocale
|
|
233
191
|
);
|
|
234
|
-
const
|
|
192
|
+
const columns = [
|
|
235
193
|
columnHelper.column({
|
|
236
194
|
id: "field",
|
|
237
195
|
name: "field",
|
|
@@ -242,9 +200,17 @@ function useTranslationsGridColumns({
|
|
|
242
200
|
if (isEntityRow(row)) {
|
|
243
201
|
return /* @__PURE__ */ jsx(DataGrid.ReadonlyCell, { context });
|
|
244
202
|
}
|
|
245
|
-
return /* @__PURE__ */ jsx(DataGrid.ReadonlyCell, { context, color: "normal", children: /* @__PURE__ */ jsx("div", { className: "flex h-full w-full items-center gap-x-2 overflow-hidden", children: /* @__PURE__ */ jsx(
|
|
246
|
-
|
|
247
|
-
|
|
203
|
+
return /* @__PURE__ */ jsx(DataGrid.ReadonlyCell, { context, color: "normal", children: /* @__PURE__ */ jsx("div", { className: "flex h-full w-full items-center gap-x-2 overflow-hidden", children: /* @__PURE__ */ jsx(
|
|
204
|
+
Text,
|
|
205
|
+
{
|
|
206
|
+
className: "text-ui-fg-subtle truncate",
|
|
207
|
+
weight: "plus",
|
|
208
|
+
size: "small",
|
|
209
|
+
children: t(`fields.${row.field_name}`, {
|
|
210
|
+
defaultValue: row.field_name
|
|
211
|
+
})
|
|
212
|
+
}
|
|
213
|
+
) }) });
|
|
248
214
|
},
|
|
249
215
|
disableHiding: true
|
|
250
216
|
}),
|
|
@@ -252,58 +218,48 @@ function useTranslationsGridColumns({
|
|
|
252
218
|
id: "original",
|
|
253
219
|
name: "original",
|
|
254
220
|
size: dynamicColumnWidth,
|
|
255
|
-
header: t("general.original"),
|
|
221
|
+
header: () => /* @__PURE__ */ jsx(Text, { className: "text-ui-fg-base", weight: "plus", size: "small", children: t("general.original") }),
|
|
256
222
|
disableHiding: true,
|
|
257
223
|
cell: (context) => {
|
|
258
224
|
const row = context.row.original;
|
|
259
225
|
if (isEntityRow(row)) {
|
|
260
226
|
return /* @__PURE__ */ jsx(DataGrid.ReadonlyCell, { context });
|
|
261
227
|
}
|
|
262
|
-
const entity = entities.find(
|
|
263
|
-
(entity2) => entity2.id === row.reference_id
|
|
264
|
-
);
|
|
228
|
+
const entity = entities.find((e) => e.id === row.reference_id);
|
|
265
229
|
if (!entity) {
|
|
266
230
|
return null;
|
|
267
231
|
}
|
|
268
|
-
return /* @__PURE__ */ jsx(DataGrid.ReadonlyCell, { context, isMultiLine: true, children: entity[row.field_name] });
|
|
232
|
+
return /* @__PURE__ */ jsx(DataGrid.ReadonlyCell, { color: "normal", context, isMultiLine: true, children: /* @__PURE__ */ jsx(Text, { className: "text-ui-fg-subtle", weight: "plus", size: "small", children: entity[row.field_name] }) });
|
|
269
233
|
}
|
|
270
234
|
})
|
|
271
235
|
];
|
|
272
236
|
if (selectedLocaleData) {
|
|
273
|
-
|
|
237
|
+
columns.push(
|
|
274
238
|
columnHelper.column({
|
|
275
239
|
id: selectedLocaleData.locale_code,
|
|
276
240
|
name: selectedLocaleData.locale.name,
|
|
277
241
|
size: dynamicColumnWidth,
|
|
278
|
-
header: () => selectedLocaleData.locale.name,
|
|
242
|
+
header: () => /* @__PURE__ */ jsx(Text, { className: "text-ui-fg-base", weight: "plus", size: "small", children: selectedLocaleData.locale.name }),
|
|
279
243
|
cell: (context) => {
|
|
280
244
|
const row = context.row.original;
|
|
281
245
|
if (isEntityRow(row)) {
|
|
282
246
|
return /* @__PURE__ */ jsx(DataGrid.ReadonlyCell, { context, isMultiLine: true });
|
|
283
247
|
}
|
|
284
|
-
return /* @__PURE__ */ jsx(DataGrid.
|
|
248
|
+
return /* @__PURE__ */ jsx(DataGrid.MultilineCell, { context });
|
|
285
249
|
},
|
|
286
250
|
field: (context) => {
|
|
287
251
|
const row = context.row.original;
|
|
288
252
|
if (isEntityRow(row)) {
|
|
289
253
|
return null;
|
|
290
254
|
}
|
|
291
|
-
return `entities.${row.reference_id}.
|
|
255
|
+
return `entities.${row.reference_id}.fields.${row.field_name}`;
|
|
292
256
|
},
|
|
293
|
-
type: "text"
|
|
257
|
+
type: "multiline-text"
|
|
294
258
|
})
|
|
295
259
|
);
|
|
296
260
|
}
|
|
297
|
-
return
|
|
298
|
-
}, [
|
|
299
|
-
t,
|
|
300
|
-
translatableFields,
|
|
301
|
-
availableLocales,
|
|
302
|
-
selectedLocale,
|
|
303
|
-
entities,
|
|
304
|
-
dynamicColumnWidth
|
|
305
|
-
]);
|
|
306
|
-
return columns;
|
|
261
|
+
return columns;
|
|
262
|
+
}, [t, availableLocales, selectedLocale, entities, dynamicColumnWidth]);
|
|
307
263
|
}
|
|
308
264
|
var TranslationsEditForm = ({
|
|
309
265
|
translations,
|
|
@@ -324,7 +280,7 @@ var TranslationsEditForm = ({
|
|
|
324
280
|
const calculateColumnWidth = () => {
|
|
325
281
|
if (containerRef.current) {
|
|
326
282
|
const containerWidth = containerRef.current.offsetWidth;
|
|
327
|
-
const availableWidth = containerWidth - FIELD_COLUMN_WIDTH -
|
|
283
|
+
const availableWidth = containerWidth - FIELD_COLUMN_WIDTH - 16;
|
|
328
284
|
const columnWidth = Math.max(300, Math.floor(availableWidth / 2));
|
|
329
285
|
setDynamicColumnWidth(columnWidth);
|
|
330
286
|
}
|
|
@@ -341,57 +297,83 @@ var TranslationsEditForm = ({
|
|
|
341
297
|
);
|
|
342
298
|
const [showUnsavedPrompt, setShowUnsavedPrompt] = useState(false);
|
|
343
299
|
const [pendingLocale, setPendingLocale] = useState(null);
|
|
344
|
-
const
|
|
345
|
-
const
|
|
346
|
-
(
|
|
347
|
-
[referenceCount, translatableFields]
|
|
348
|
-
);
|
|
349
|
-
const initialState = useRef(
|
|
350
|
-
initTranslationsFormState(
|
|
300
|
+
const [isSwitchingLocale, setIsSwitchingLocale] = useState(false);
|
|
301
|
+
const snapshotRef = useRef(
|
|
302
|
+
buildLocaleSnapshot(
|
|
351
303
|
translations,
|
|
352
|
-
|
|
353
|
-
|
|
304
|
+
references,
|
|
305
|
+
selectedLocale,
|
|
354
306
|
translatableFields
|
|
355
307
|
)
|
|
356
308
|
);
|
|
309
|
+
const knownEntityIdsRef = useRef(
|
|
310
|
+
new Set(references.map((r) => r.id))
|
|
311
|
+
);
|
|
312
|
+
const latestPropsRef = useRef({ translations, references });
|
|
313
|
+
useEffect(() => {
|
|
314
|
+
latestPropsRef.current = { translations, references };
|
|
315
|
+
}, [translations, references]);
|
|
357
316
|
const form = useForm({
|
|
358
317
|
resolver: zodResolver(TranslationsFormSchema),
|
|
359
|
-
defaultValues:
|
|
318
|
+
defaultValues: snapshotToFormValues(snapshotRef.current)
|
|
360
319
|
});
|
|
320
|
+
useEffect(() => {
|
|
321
|
+
const currentIds = new Set(references.map((r) => r.id));
|
|
322
|
+
const newReferences = references.filter(
|
|
323
|
+
(r) => !knownEntityIdsRef.current.has(r.id)
|
|
324
|
+
);
|
|
325
|
+
if (newReferences.length === 0) {
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
328
|
+
knownEntityIdsRef.current = currentIds;
|
|
329
|
+
snapshotRef.current = extendSnapshot(
|
|
330
|
+
snapshotRef.current,
|
|
331
|
+
translations,
|
|
332
|
+
newReferences,
|
|
333
|
+
translatableFields
|
|
334
|
+
);
|
|
335
|
+
const currentValues = form.getValues();
|
|
336
|
+
const newFormValues = {
|
|
337
|
+
entities: { ...currentValues.entities }
|
|
338
|
+
};
|
|
339
|
+
for (const ref of newReferences) {
|
|
340
|
+
if (!newFormValues.entities[ref.id]) {
|
|
341
|
+
newFormValues.entities[ref.id] = snapshotRef.current.entities[ref.id];
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
form.reset(newFormValues, {
|
|
345
|
+
keepDirty: true,
|
|
346
|
+
keepDirtyValues: true
|
|
347
|
+
});
|
|
348
|
+
}, [references, translations, translatableFields, form]);
|
|
361
349
|
const rows = useMemo(
|
|
362
|
-
() => buildTranslationRows(
|
|
363
|
-
[
|
|
350
|
+
() => buildTranslationRows(references, translatableFields),
|
|
351
|
+
[references, translatableFields]
|
|
364
352
|
);
|
|
365
|
-
const
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
if (newLocale === selectedLocale) {
|
|
369
|
-
return;
|
|
370
|
-
}
|
|
371
|
-
const currentValues = form.getValues();
|
|
372
|
-
const hasChanges = hasLocaleChanges(
|
|
373
|
-
currentValues,
|
|
374
|
-
initialState.current,
|
|
375
|
-
selectedLocale
|
|
376
|
-
);
|
|
377
|
-
if (hasChanges) {
|
|
378
|
-
setPendingLocale(newLocale);
|
|
379
|
-
setShowUnsavedPrompt(true);
|
|
380
|
-
} else {
|
|
381
|
-
setSelectedLocale(newLocale);
|
|
382
|
-
}
|
|
383
|
-
},
|
|
384
|
-
[selectedLocale, form]
|
|
353
|
+
const totalRowCount = useMemo(
|
|
354
|
+
() => referenceCount * (translatableFields.length + 1),
|
|
355
|
+
[referenceCount, translatableFields]
|
|
385
356
|
);
|
|
357
|
+
const selectedLocaleDisplay = useMemo(
|
|
358
|
+
() => availableLocales.find((l) => l.locale_code === selectedLocale)?.locale.name,
|
|
359
|
+
[availableLocales, selectedLocale]
|
|
360
|
+
);
|
|
361
|
+
const columns = useTranslationsGridColumns({
|
|
362
|
+
entities: references,
|
|
363
|
+
availableLocales,
|
|
364
|
+
selectedLocale,
|
|
365
|
+
dynamicColumnWidth
|
|
366
|
+
});
|
|
367
|
+
const { mutateAsync, isPending, invalidateQueries } = useBatchTranslations(entityType);
|
|
386
368
|
const saveCurrentLocale = useCallback(async () => {
|
|
387
369
|
const currentValues = form.getValues();
|
|
388
|
-
const payload =
|
|
370
|
+
const { hasChanges, payload } = computeChanges(
|
|
389
371
|
currentValues,
|
|
390
|
-
|
|
372
|
+
snapshotRef.current,
|
|
391
373
|
entityType,
|
|
392
374
|
selectedLocale
|
|
393
375
|
);
|
|
394
|
-
if (
|
|
376
|
+
if (!hasChanges) {
|
|
395
377
|
return true;
|
|
396
378
|
}
|
|
397
379
|
try {
|
|
@@ -415,20 +397,32 @@ var TranslationsEditForm = ({
|
|
|
415
397
|
}
|
|
416
398
|
if (payload.delete.length > 0) {
|
|
417
399
|
currentBatch.delete = payload.delete.splice(0, currentBatchAvailable);
|
|
418
|
-
currentBatchAvailable -= currentBatch.delete.length;
|
|
419
400
|
}
|
|
420
|
-
await mutateAsync(currentBatch
|
|
401
|
+
const response = await mutateAsync(currentBatch, {
|
|
402
|
+
onError: (error) => {
|
|
403
|
+
toast.error(error.message);
|
|
404
|
+
}
|
|
405
|
+
});
|
|
406
|
+
if (response.created) {
|
|
407
|
+
for (const created of response.created) {
|
|
408
|
+
form.setValue(`entities.${created.reference_id}.id`, created.id, {
|
|
409
|
+
shouldDirty: false
|
|
410
|
+
});
|
|
411
|
+
if (snapshotRef.current.entities[created.reference_id]) {
|
|
412
|
+
snapshotRef.current.entities[created.reference_id].id = created.id;
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
}
|
|
421
416
|
}
|
|
422
|
-
const
|
|
423
|
-
for (const entityId of Object.keys(
|
|
424
|
-
if (
|
|
425
|
-
|
|
426
|
-
...
|
|
417
|
+
const savedValues = form.getValues();
|
|
418
|
+
for (const entityId of Object.keys(savedValues.entities)) {
|
|
419
|
+
if (snapshotRef.current.entities[entityId]) {
|
|
420
|
+
snapshotRef.current.entities[entityId] = {
|
|
421
|
+
...savedValues.entities[entityId]
|
|
427
422
|
};
|
|
428
423
|
}
|
|
429
424
|
}
|
|
430
|
-
|
|
431
|
-
form.reset(currentValues);
|
|
425
|
+
form.reset(savedValues);
|
|
432
426
|
return true;
|
|
433
427
|
} catch (error) {
|
|
434
428
|
toast.error(
|
|
@@ -437,19 +431,59 @@ var TranslationsEditForm = ({
|
|
|
437
431
|
return false;
|
|
438
432
|
}
|
|
439
433
|
}, [form, entityType, selectedLocale, mutateAsync]);
|
|
434
|
+
const switchToLocale = useCallback(
|
|
435
|
+
async (newLocale) => {
|
|
436
|
+
setIsSwitchingLocale(true);
|
|
437
|
+
try {
|
|
438
|
+
await invalidateQueries();
|
|
439
|
+
await new Promise((resolve) => requestAnimationFrame(resolve));
|
|
440
|
+
const { translations: translations2, references: references2 } = latestPropsRef.current;
|
|
441
|
+
const newSnapshot = buildLocaleSnapshot(
|
|
442
|
+
translations2,
|
|
443
|
+
references2,
|
|
444
|
+
newLocale,
|
|
445
|
+
translatableFields
|
|
446
|
+
);
|
|
447
|
+
snapshotRef.current = newSnapshot;
|
|
448
|
+
knownEntityIdsRef.current = new Set(references2.map((r) => r.id));
|
|
449
|
+
form.reset(snapshotToFormValues(newSnapshot));
|
|
450
|
+
setSelectedLocale(newLocale);
|
|
451
|
+
} finally {
|
|
452
|
+
setIsSwitchingLocale(false);
|
|
453
|
+
}
|
|
454
|
+
},
|
|
455
|
+
[translatableFields, form, invalidateQueries]
|
|
456
|
+
);
|
|
457
|
+
const handleLocaleChange = useCallback(
|
|
458
|
+
(newLocale) => {
|
|
459
|
+
if (newLocale === selectedLocale) {
|
|
460
|
+
return;
|
|
461
|
+
}
|
|
462
|
+
const currentValues = form.getValues();
|
|
463
|
+
const { hasChanges } = computeChanges(
|
|
464
|
+
currentValues,
|
|
465
|
+
snapshotRef.current,
|
|
466
|
+
entityType,
|
|
467
|
+
selectedLocale
|
|
468
|
+
);
|
|
469
|
+
if (hasChanges) {
|
|
470
|
+
setPendingLocale(newLocale);
|
|
471
|
+
setShowUnsavedPrompt(true);
|
|
472
|
+
} else {
|
|
473
|
+
switchToLocale(newLocale);
|
|
474
|
+
}
|
|
475
|
+
},
|
|
476
|
+
[selectedLocale, form, entityType, switchToLocale]
|
|
477
|
+
);
|
|
440
478
|
const handleSaveAndSwitch = useCallback(async () => {
|
|
441
479
|
const success = await saveCurrentLocale();
|
|
442
480
|
if (success && pendingLocale) {
|
|
443
|
-
toast.success(
|
|
444
|
-
|
|
445
|
-
defaultValue: "Changes saved successfully"
|
|
446
|
-
})
|
|
447
|
-
);
|
|
448
|
-
setSelectedLocale(pendingLocale);
|
|
481
|
+
toast.success(t("translations.edit.successToast"));
|
|
482
|
+
await switchToLocale(pendingLocale);
|
|
449
483
|
}
|
|
450
484
|
setShowUnsavedPrompt(false);
|
|
451
485
|
setPendingLocale(null);
|
|
452
|
-
}, [saveCurrentLocale, pendingLocale, t]);
|
|
486
|
+
}, [saveCurrentLocale, pendingLocale, t, switchToLocale]);
|
|
453
487
|
const handleCancelSwitch = useCallback(() => {
|
|
454
488
|
setShowUnsavedPrompt(false);
|
|
455
489
|
setPendingLocale(null);
|
|
@@ -458,11 +492,7 @@ var TranslationsEditForm = ({
|
|
|
458
492
|
async (closeOnSuccess = false) => {
|
|
459
493
|
const success = await saveCurrentLocale();
|
|
460
494
|
if (success) {
|
|
461
|
-
toast.success(
|
|
462
|
-
t("translations.edit.successToast", {
|
|
463
|
-
defaultValue: "Translations updated successfully"
|
|
464
|
-
})
|
|
465
|
-
);
|
|
495
|
+
toast.success(t("translations.edit.successToast"));
|
|
466
496
|
if (closeOnSuccess) {
|
|
467
497
|
handleSuccess();
|
|
468
498
|
}
|
|
@@ -470,96 +500,22 @@ var TranslationsEditForm = ({
|
|
|
470
500
|
},
|
|
471
501
|
[saveCurrentLocale, t, handleSuccess]
|
|
472
502
|
);
|
|
473
|
-
const
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
);
|
|
479
|
-
if (payload.create.length === 0 && payload.update.length === 0 && payload.delete.length === 0) {
|
|
480
|
-
toast.info(
|
|
481
|
-
t("translations.noChanges", { defaultValue: "No changes to save" })
|
|
482
|
-
);
|
|
483
|
-
return;
|
|
484
|
-
}
|
|
485
|
-
const BATCH_SIZE = 150;
|
|
486
|
-
const totalItems = payload.create.length + payload.update.length + payload.delete.length;
|
|
487
|
-
const batchCount = Math.ceil(totalItems / BATCH_SIZE);
|
|
488
|
-
for (let i = 0; i < batchCount; i++) {
|
|
489
|
-
let currentBatchAvailable = BATCH_SIZE;
|
|
490
|
-
const currentBatch = {
|
|
491
|
-
create: [],
|
|
492
|
-
update: [],
|
|
493
|
-
delete: []
|
|
494
|
-
};
|
|
495
|
-
if (payload.create.length > 0) {
|
|
496
|
-
currentBatch.create = payload.create.splice(0, currentBatchAvailable);
|
|
497
|
-
currentBatchAvailable -= currentBatch.create.length;
|
|
498
|
-
}
|
|
499
|
-
if (payload.update.length > 0) {
|
|
500
|
-
currentBatch.update = payload.update.splice(0, currentBatchAvailable);
|
|
501
|
-
currentBatchAvailable -= currentBatch.update.length;
|
|
502
|
-
}
|
|
503
|
-
if (payload.delete.length > 0) {
|
|
504
|
-
currentBatch.delete = payload.delete.splice(0, currentBatchAvailable);
|
|
505
|
-
currentBatchAvailable -= currentBatch.delete.length;
|
|
506
|
-
}
|
|
507
|
-
await mutateAsync(currentBatch, {
|
|
508
|
-
onSuccess: () => {
|
|
509
|
-
if (i === batchCount - 1) {
|
|
510
|
-
toast.success(
|
|
511
|
-
t("translations.edit.successToast", {
|
|
512
|
-
defaultValue: "Translations updated successfully"
|
|
513
|
-
})
|
|
514
|
-
);
|
|
515
|
-
handleSuccess();
|
|
516
|
-
}
|
|
517
|
-
},
|
|
518
|
-
onError: (error) => {
|
|
519
|
-
toast.error(error.message);
|
|
520
|
-
}
|
|
521
|
-
});
|
|
522
|
-
}
|
|
523
|
-
});
|
|
524
|
-
const columns = useTranslationsGridColumns({
|
|
525
|
-
entities,
|
|
526
|
-
translatableFields,
|
|
527
|
-
availableLocales,
|
|
528
|
-
selectedLocale,
|
|
529
|
-
dynamicColumnWidth
|
|
530
|
-
});
|
|
531
|
-
const selectedLocaleDisplay = availableLocales.find(
|
|
532
|
-
(l) => l.locale_code === selectedLocale
|
|
533
|
-
)?.locale.name;
|
|
534
|
-
return /* @__PURE__ */ jsxs(RouteFocusModal.Form, { form, children: [
|
|
503
|
+
const handleClose = useCallback(() => {
|
|
504
|
+
invalidateQueries();
|
|
505
|
+
}, [invalidateQueries]);
|
|
506
|
+
const isLoading = isPending || isSwitchingLocale;
|
|
507
|
+
return /* @__PURE__ */ jsxs(RouteFocusModal.Form, { form, onClose: handleClose, children: [
|
|
535
508
|
/* @__PURE__ */ jsxs(
|
|
536
509
|
KeyboundForm,
|
|
537
510
|
{
|
|
538
|
-
onSubmit:
|
|
511
|
+
onSubmit: () => handleSave(true),
|
|
539
512
|
className: "flex h-full flex-col overflow-hidden",
|
|
540
513
|
children: [
|
|
541
|
-
/* @__PURE__ */ jsx(RouteFocusModal.Header, {
|
|
542
|
-
Select,
|
|
543
|
-
{
|
|
544
|
-
value: selectedLocale,
|
|
545
|
-
onValueChange: handleLocaleChange,
|
|
546
|
-
size: "small",
|
|
547
|
-
children: [
|
|
548
|
-
/* @__PURE__ */ jsx(Select.Trigger, { className: "bg-ui-bg-base w-[200px]", children: /* @__PURE__ */ jsx(Select.Value, { children: selectedLocaleDisplay }) }),
|
|
549
|
-
/* @__PURE__ */ jsx(Select.Content, { children: availableLocales.map((locale) => /* @__PURE__ */ jsx(
|
|
550
|
-
Select.Item,
|
|
551
|
-
{
|
|
552
|
-
value: locale.locale_code,
|
|
553
|
-
children: locale.locale.name
|
|
554
|
-
},
|
|
555
|
-
locale.locale_code
|
|
556
|
-
)) })
|
|
557
|
-
]
|
|
558
|
-
}
|
|
559
|
-
) }) }),
|
|
514
|
+
/* @__PURE__ */ jsx(RouteFocusModal.Header, {}),
|
|
560
515
|
/* @__PURE__ */ jsx(RouteFocusModal.Body, { className: "size-full overflow-hidden", children: /* @__PURE__ */ jsx("div", { ref: containerRef, className: "size-full", children: /* @__PURE__ */ jsx(
|
|
561
516
|
DataGrid,
|
|
562
517
|
{
|
|
518
|
+
showColumnsDropdown: false,
|
|
563
519
|
columns,
|
|
564
520
|
data: rows,
|
|
565
521
|
getSubRows: (row) => {
|
|
@@ -569,47 +525,63 @@ var TranslationsEditForm = ({
|
|
|
569
525
|
},
|
|
570
526
|
state: form,
|
|
571
527
|
onEditingChange: (editing) => setCloseOnEscape(!editing),
|
|
572
|
-
totalRowCount
|
|
528
|
+
totalRowCount,
|
|
573
529
|
onFetchMore: fetchNextPage,
|
|
574
530
|
isFetchingMore: isFetchingNextPage,
|
|
575
|
-
hasNextPage
|
|
531
|
+
hasNextPage,
|
|
532
|
+
headerContent: /* @__PURE__ */ jsxs(
|
|
533
|
+
Select,
|
|
534
|
+
{
|
|
535
|
+
disabled: isLoading,
|
|
536
|
+
value: selectedLocale,
|
|
537
|
+
onValueChange: handleLocaleChange,
|
|
538
|
+
size: "small",
|
|
539
|
+
children: [
|
|
540
|
+
/* @__PURE__ */ jsx(Select.Trigger, { className: "bg-ui-bg-base w-[200px]", children: /* @__PURE__ */ jsx(Select.Value, { children: selectedLocaleDisplay }) }),
|
|
541
|
+
/* @__PURE__ */ jsx(Select.Content, { children: availableLocales.map((locale) => /* @__PURE__ */ jsx(
|
|
542
|
+
Select.Item,
|
|
543
|
+
{
|
|
544
|
+
value: locale.locale_code,
|
|
545
|
+
children: locale.locale.name
|
|
546
|
+
},
|
|
547
|
+
locale.locale_code
|
|
548
|
+
)) })
|
|
549
|
+
]
|
|
550
|
+
}
|
|
551
|
+
)
|
|
576
552
|
}
|
|
577
553
|
) }) }),
|
|
578
554
|
/* @__PURE__ */ jsx(RouteFocusModal.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-end gap-x-2", children: [
|
|
579
|
-
/* @__PURE__ */ jsx(RouteFocusModal.Close, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
580
|
-
/* @__PURE__ */ jsx(
|
|
555
|
+
/* @__PURE__ */ jsx(RouteFocusModal.Close, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
581
556
|
Button,
|
|
582
557
|
{
|
|
583
|
-
size: "small",
|
|
584
558
|
type: "button",
|
|
559
|
+
size: "small",
|
|
585
560
|
variant: "secondary",
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
children: t("actions.saveChanges", { defaultValue: "Save changes" })
|
|
561
|
+
isLoading,
|
|
562
|
+
children: t("actions.cancel")
|
|
589
563
|
}
|
|
590
|
-
),
|
|
564
|
+
) }),
|
|
591
565
|
/* @__PURE__ */ jsx(
|
|
592
566
|
Button,
|
|
593
567
|
{
|
|
594
568
|
size: "small",
|
|
595
569
|
type: "button",
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
570
|
+
variant: "secondary",
|
|
571
|
+
onClick: () => handleSave(false),
|
|
572
|
+
isLoading,
|
|
573
|
+
children: t("actions.saveChanges")
|
|
599
574
|
}
|
|
600
|
-
)
|
|
575
|
+
),
|
|
576
|
+
/* @__PURE__ */ jsx(Button, { size: "small", type: "submit", isLoading, children: t("actions.saveAndClose") })
|
|
601
577
|
] }) })
|
|
602
578
|
]
|
|
603
579
|
}
|
|
604
580
|
),
|
|
605
581
|
/* @__PURE__ */ jsx(Prompt, { open: showUnsavedPrompt, variant: "confirmation", children: /* @__PURE__ */ jsxs(Prompt.Content, { children: [
|
|
606
582
|
/* @__PURE__ */ jsxs(Prompt.Header, { children: [
|
|
607
|
-
/* @__PURE__ */ jsx(Prompt.Title, { children: t("translations.unsavedChanges.title",
|
|
608
|
-
|
|
609
|
-
}) }),
|
|
610
|
-
/* @__PURE__ */ jsx(Prompt.Description, { children: t("translations.unsavedChanges.description", {
|
|
611
|
-
defaultValue: "You have unsaved changes for this locale. Save them before switching?"
|
|
612
|
-
}) })
|
|
583
|
+
/* @__PURE__ */ jsx(Prompt.Title, { children: t("translations.edit.unsavedChanges.title") }),
|
|
584
|
+
/* @__PURE__ */ jsx(Prompt.Description, { children: t("translations.edit.unsavedChanges.description") })
|
|
613
585
|
] }),
|
|
614
586
|
/* @__PURE__ */ jsxs(Prompt.Footer, { children: [
|
|
615
587
|
/* @__PURE__ */ jsx(
|
|
@@ -628,8 +600,8 @@ var TranslationsEditForm = ({
|
|
|
628
600
|
size: "small",
|
|
629
601
|
onClick: handleSaveAndSwitch,
|
|
630
602
|
type: "button",
|
|
631
|
-
isLoading
|
|
632
|
-
children: t("actions.saveChanges"
|
|
603
|
+
isLoading,
|
|
604
|
+
children: t("actions.saveChanges")
|
|
633
605
|
}
|
|
634
606
|
)
|
|
635
607
|
] })
|
|
@@ -638,8 +610,6 @@ var TranslationsEditForm = ({
|
|
|
638
610
|
};
|
|
639
611
|
|
|
640
612
|
// src/routes/translations/translations-edit/translations-edit.tsx
|
|
641
|
-
import { useEffect as useEffect2 } from "react";
|
|
642
|
-
import { keepPreviousData } from "@tanstack/react-query";
|
|
643
613
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
644
614
|
var TranslationsEdit = () => {
|
|
645
615
|
const isTranslationsEnabled = useFeatureFlag("translation");
|
|
@@ -669,15 +639,10 @@ var TranslationsEdit = () => {
|
|
|
669
639
|
isPending,
|
|
670
640
|
isError,
|
|
671
641
|
error
|
|
672
|
-
} = useReferenceTranslations(
|
|
673
|
-
reference,
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
{
|
|
677
|
-
enabled: !!translatable_fields && !!reference,
|
|
678
|
-
placeholderData: keepPreviousData
|
|
679
|
-
}
|
|
680
|
-
);
|
|
642
|
+
} = useReferenceTranslations(reference, referenceIdParam, {
|
|
643
|
+
enabled: !!reference,
|
|
644
|
+
placeholderData: keepPreviousData
|
|
645
|
+
});
|
|
681
646
|
const {
|
|
682
647
|
store,
|
|
683
648
|
isPending: isStorePending,
|