@medusajs/dashboard 2.12.3-preview-20251217120154 → 2.12.3-snapshot-20251216185234
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-4QLXO46G.mjs → add-campaign-promotions-OYPGISTF.mjs} +2 -2
- package/dist/{adjust-inventory-2MFA656V.mjs → adjust-inventory-26YXAXQL.mjs} +4 -3
- package/dist/{api-key-management-create-ZUVF3SLR.mjs → api-key-management-create-EMP32G2D.mjs} +6 -5
- package/dist/{api-key-management-detail-THD74G7I.mjs → api-key-management-detail-6RCDH73M.mjs} +11 -10
- package/dist/{api-key-management-edit-42HNUSXL.mjs → api-key-management-edit-IBM3ZXHK.mjs} +6 -5
- package/dist/{api-key-management-list-66CFOILY.mjs → api-key-management-list-KC5GOWAU.mjs} +4 -3
- package/dist/{api-key-management-sales-channels-HN3THM5J.mjs → api-key-management-sales-channels-LUB5G6RC.mjs} +6 -5
- package/dist/app.css +53 -0
- package/dist/app.js +13537 -11320
- package/dist/app.mjs +12 -11
- package/dist/{campaign-budget-edit-6DMZGUCI.mjs → campaign-budget-edit-B5MSE26J.mjs} +2 -2
- package/dist/{campaign-configuration-UNFRB5HR.mjs → campaign-configuration-QOE3D2BE.mjs} +2 -2
- package/dist/{campaign-create-QXG7PD3S.mjs → campaign-create-FJOECKGT.mjs} +3 -3
- package/dist/{campaign-detail-WR3XHHV2.mjs → campaign-detail-5Q4BYCPX.mjs} +11 -10
- package/dist/{campaign-edit-HN4US7DV.mjs → campaign-edit-K2POQH7M.mjs} +2 -2
- package/dist/{categories-metadata-BCZ463KN.mjs → categories-metadata-J7M3XWI7.mjs} +14 -13
- package/dist/{category-create-FFIBWXAH.mjs → category-create-KHJZSC7G.mjs} +5 -4
- package/dist/{category-detail-4HXJ5Z7N.mjs → category-detail-S5IPXMHX.mjs} +29 -13
- package/dist/{category-edit-74MZ6TXN.mjs → category-edit-CTA2EPDG.mjs} +5 -4
- package/dist/{category-list-OCJY2UJV.mjs → category-list-QBYJ4T3R.mjs} +20 -4
- package/dist/{category-organize-B6EFBFKB.mjs → category-organize-SXP33XET.mjs} +5 -4
- package/dist/{category-products-2HXLZDHL.mjs → category-products-KPW6BA5J.mjs} +14 -13
- package/dist/{chunk-XIVBRONM.mjs → chunk-23GTCEOV.mjs} +1 -1
- package/dist/{chunk-2NZDHAOE.mjs → chunk-27MGH3HR.mjs} +2 -2
- package/dist/{chunk-N3FCYZV6.mjs → chunk-2XTBDCGE.mjs} +1 -1
- package/dist/{chunk-RU4ZS47V.mjs → chunk-4JQR6QNW.mjs} +2 -2
- package/dist/{chunk-Z6NHG5LQ.mjs → chunk-6P4Q4AAP.mjs} +3 -3
- package/dist/{chunk-F5NZDW7L.mjs → chunk-A2WBKOXJ.mjs} +2 -2
- package/dist/{chunk-F63F3FIT.mjs → chunk-A4XYK3MY.mjs} +2 -2
- package/dist/{chunk-NT6C7CHT.mjs → chunk-AWRCV3ME.mjs} +1 -1
- package/dist/{chunk-5X6SKB2P.mjs → chunk-BMS2QLJY.mjs} +1 -1
- package/dist/{chunk-3YPRDSZ6.mjs → chunk-BZKI5J2M.mjs} +1 -1
- package/dist/{chunk-25UWYEJX.mjs → chunk-CQOOXWPZ.mjs} +1 -1
- package/dist/{chunk-5DUMSVP6.mjs → chunk-CVHJAKLQ.mjs} +3 -3
- package/dist/{chunk-42OOM4DJ.mjs → chunk-D6UW7URG.mjs} +23 -6
- package/dist/{chunk-LHNU4DYZ.mjs → chunk-DBXWB3RF.mjs} +2 -2
- package/dist/{chunk-N4O5FAUC.mjs → chunk-FYWHE3W5.mjs} +1 -1
- package/dist/{chunk-QPKW37WR.mjs → chunk-GRZSG4EP.mjs} +244 -14
- package/dist/chunk-HGRIOEAR.mjs +32 -0
- package/dist/{chunk-Y5UO73CH.mjs → chunk-HTCYX4VD.mjs} +1 -1
- package/dist/{chunk-34KFHPN6.mjs → chunk-IAV7IKJ6.mjs} +1 -1
- package/dist/{chunk-6W3BKVOC.mjs → chunk-KFYQTOGB.mjs} +1 -1
- package/dist/{chunk-EQTBJSBZ.mjs → chunk-KIIT4BNH.mjs} +3 -0
- package/dist/{chunk-W7SLPIO2.mjs → chunk-LZFWCKOF.mjs} +655 -147
- package/dist/{chunk-PNPT4W2F.mjs → chunk-MJDHVDOW.mjs} +1 -1
- package/dist/{chunk-D4J3CEWH.mjs → chunk-N3SAXQVR.mjs} +2 -2
- package/dist/{chunk-Q6MSICBU.mjs → chunk-O333RR6K.mjs} +1 -1
- package/dist/{chunk-F65T2X7G.mjs → chunk-OL24RDYM.mjs} +5 -5
- package/dist/{chunk-7ZYDO3XO.mjs → chunk-OL6MEUKW.mjs} +295 -194
- package/dist/{chunk-7AX6R6G6.mjs → chunk-OSHH5GAS.mjs} +13 -1
- package/dist/{chunk-YAPTGHGP.mjs → chunk-PHLCT2HA.mjs} +1 -1
- package/dist/{chunk-35LSPN2U.mjs → chunk-QKALAT7P.mjs} +1 -1
- package/dist/{chunk-UM4OIJZ3.mjs → chunk-S22SJRPO.mjs} +1 -1
- package/dist/{chunk-4YAPXPLM.mjs → chunk-ST4P6BQN.mjs} +1 -1
- package/dist/{chunk-B3AOQW2B.mjs → chunk-U6G4M5LP.mjs} +1 -1
- package/dist/{chunk-HWKLNKOY.mjs → chunk-U726TGCM.mjs} +1 -1
- package/dist/{chunk-HKIF5HVL.mjs → chunk-UJ2TMPV4.mjs} +12 -0
- package/dist/{chunk-NHDFPGQ3.mjs → chunk-UWY5ZV66.mjs} +13 -1
- package/dist/{chunk-XXBP2Z5M.mjs → chunk-WVA4O7QS.mjs} +1 -1
- package/dist/{chunk-PXJFCRIV.mjs → chunk-WYATCUOM.mjs} +4 -4
- package/dist/{chunk-AH4DORIW.mjs → chunk-XY7A7GZJ.mjs} +1 -1
- package/dist/{chunk-FQDPOKEK.mjs → chunk-Y2YVTIJI.mjs} +1 -1
- package/dist/{chunk-L4NOVTH5.mjs → chunk-YIOBBZUB.mjs} +2 -2
- package/dist/{chunk-MY6I7UJG.mjs → chunk-YYOPBKME.mjs} +3 -3
- package/dist/{chunk-LEJUZW3P.mjs → chunk-Z6BFNHEO.mjs} +12 -0
- package/dist/{chunk-HFT7Q5Y5.mjs → chunk-ZMG5B4FG.mjs} +1 -1
- package/dist/{collection-add-products-JWAQ277T.mjs → collection-add-products-FU2BS3D3.mjs} +14 -13
- package/dist/{collection-create-DCRW344Z.mjs → collection-create-GWKWVT7B.mjs} +5 -4
- package/dist/{collection-detail-F4ON763T.mjs → collection-detail-VJE7XHLV.mjs} +28 -12
- package/dist/{collection-edit-UNFEW6HT.mjs → collection-edit-EZIO2BR5.mjs} +5 -4
- package/dist/{collection-list-4C5HVO6Y.mjs → collection-list-IGA6SCNF.mjs} +29 -13
- package/dist/{collection-metadata-P4A5DXBQ.mjs → collection-metadata-QK7MI3D2.mjs} +14 -13
- package/dist/{customer-create-XCLZENJS.mjs → customer-create-IA56MXE6.mjs} +2 -2
- package/dist/{customer-create-address-4HZUIAM7.mjs → customer-create-address-27M25HTO.mjs} +2 -2
- package/dist/{customer-detail-X3RQJPXP.mjs → customer-detail-MOV2T3LF.mjs} +12 -11
- package/dist/{customer-edit-BW5GVTQI.mjs → customer-edit-XQ5NWIVX.mjs} +2 -2
- package/dist/{customer-group-add-customers-SOXMSWQH.mjs → customer-group-add-customers-XMR2WBXX.mjs} +2 -2
- package/dist/{customer-group-create-6YV7W6TI.mjs → customer-group-create-RY4FVEIW.mjs} +2 -2
- package/dist/{customer-group-detail-NG32WKJT.mjs → customer-group-detail-6T7OXGQD.mjs} +11 -10
- package/dist/{customer-group-edit-7NXU34BQ.mjs → customer-group-edit-MQWARIQZ.mjs} +2 -2
- package/dist/{customer-group-list-EBETHKKO.mjs → customer-group-list-AJEAF5D2.mjs} +11 -10
- package/dist/{customer-group-metadata-WK2BGEGO.mjs → customer-group-metadata-JQJRLLXG.mjs} +3 -3
- package/dist/{customer-metadata-ZUWCUTM7.mjs → customer-metadata-HN2DYD5I.mjs} +3 -3
- package/dist/{customers-add-customer-group-7FYD54MZ.mjs → customers-add-customer-group-QVTVSQYM.mjs} +13 -12
- package/dist/{edit-inventory-item-Y5W6VTHJ.mjs → edit-inventory-item-H7DAZWIT.mjs} +4 -3
- package/dist/{edit-inventory-item-attributes-NAAZDFEJ.mjs → edit-inventory-item-attributes-7HTXXPGZ.mjs} +4 -3
- package/dist/{edit-reservation-2UD4RZJX.mjs → edit-reservation-OVTRZHJR.mjs} +5 -4
- package/dist/{edit-rules-2W3BXEXR.mjs → edit-rules-SMVRTCUP.mjs} +13 -12
- package/dist/en.json +38 -0
- package/dist/{inventory-create-VQEK7C5T.mjs → inventory-create-BK52VALF.mjs} +14 -13
- package/dist/{inventory-detail-HUHQ6ZNE.mjs → inventory-detail-ZPSEMYI2.mjs} +11 -10
- package/dist/{inventory-list-RUSSPKHE.mjs → inventory-list-RXJPSVZE.mjs} +2 -1
- package/dist/{inventory-metadata-X52VGHA7.mjs → inventory-metadata-FNEJ3RAT.mjs} +14 -13
- package/dist/{inventory-stock-EKTOYN2F.mjs → inventory-stock-6WYWLWJ7.mjs} +15 -14
- package/dist/{invite-VKHAAF4Z.mjs → invite-FVE4ZBKB.mjs} +2 -2
- package/dist/{location-create-RPLEXUZR.mjs → location-create-WZ43K3W7.mjs} +2 -2
- package/dist/{location-detail-UVWYE6Q2.mjs → location-detail-N3GUZSY7.mjs} +12 -11
- package/dist/{location-edit-L4ISEQHX.mjs → location-edit-VCS7GVWQ.mjs} +2 -2
- package/dist/{location-fulfillment-providers-HZZUHPVL.mjs → location-fulfillment-providers-7ZUJAGNY.mjs} +15 -14
- package/dist/{location-list-Z42ZYHUF.mjs → location-list-KVBA6J47.mjs} +2 -2
- package/dist/{location-sales-channels-XIMOK66B.mjs → location-sales-channels-P3QJTFDT.mjs} +5 -4
- package/dist/{location-service-zone-create-7ZNVLEE3.mjs → location-service-zone-create-J43WN6G4.mjs} +3 -3
- package/dist/{location-service-zone-edit-6OUAFEZD.mjs → location-service-zone-edit-KHHMSPXD.mjs} +2 -2
- package/dist/{location-service-zone-manage-areas-EOULKRYD.mjs → location-service-zone-manage-areas-6ZPMKMSX.mjs} +3 -3
- package/dist/{location-service-zone-shipping-option-create-M7G4SKNP.mjs → location-service-zone-shipping-option-create-CNRWYZQC.mjs} +15 -14
- package/dist/{location-service-zone-shipping-option-edit-M2HJAASG.mjs → location-service-zone-shipping-option-edit-4CGPQ3VT.mjs} +2 -2
- package/dist/{location-service-zone-shipping-option-pricing-23QLNSBT.mjs → location-service-zone-shipping-option-pricing-OGWI7VPT.mjs} +4 -4
- package/dist/{login-NSCAMAU6.mjs → login-VNOLI5YG.mjs} +13 -12
- package/dist/{manage-locations-JD6FSBOT.mjs → manage-locations-7HH6R4UP.mjs} +4 -3
- package/dist/{order-allocate-items-5T57NZOB.mjs → order-allocate-items-HZGGYJ42.mjs} +6 -5
- package/dist/{order-create-claim-TE56IE7P.mjs → order-create-claim-SCDJGM46.mjs} +15 -14
- package/dist/{order-create-edit-RDFYBVFY.mjs → order-create-edit-2WALBPXS.mjs} +14 -13
- package/dist/{order-create-exchange-B5ZOEQCJ.mjs → order-create-exchange-LQU4YN7F.mjs} +15 -14
- package/dist/{order-create-fulfillment-SRRP6X64.mjs → order-create-fulfillment-OWUVTZXW.mjs} +13 -12
- package/dist/{order-create-refund-PTOM65QK.mjs → order-create-refund-Q6HQY42R.mjs} +13 -12
- package/dist/{order-create-return-3C2QVNYN.mjs → order-create-return-52GHGW5Z.mjs} +7 -6
- package/dist/{order-create-shipment-HNILNFXB.mjs → order-create-shipment-WAGGEPRW.mjs} +13 -12
- package/dist/{order-detail-3OUZOQ7G.mjs → order-detail-PVPGEWGY.mjs} +15 -14
- package/dist/{order-edit-billing-address-3IO7GXIK.mjs → order-edit-billing-address-UM76J4KX.mjs} +13 -12
- package/dist/{order-edit-email-QIAEOUBV.mjs → order-edit-email-CL3KNOCM.mjs} +13 -12
- package/dist/{order-edit-shipping-address-QGGMHGBC.mjs → order-edit-shipping-address-PIESTGVL.mjs} +13 -12
- package/dist/{order-export-JYYFTOWR.mjs → order-export-LE363ZLB.mjs} +14 -13
- package/dist/{order-list-RFR3HNDQ.mjs → order-list-GRLQWN4L.mjs} +6 -5
- package/dist/{order-metadata-ZBDTMBHZ.mjs → order-metadata-FHBB7MTG.mjs} +14 -13
- package/dist/{order-receive-return-V42FTCFY.mjs → order-receive-return-PRVKP6J2.mjs} +14 -13
- package/dist/{order-request-transfer-A6NNIN2O.mjs → order-request-transfer-XSAGRUMT.mjs} +13 -12
- package/dist/{price-list-configuration-RTUEJENE.mjs → price-list-configuration-6S3MLNXQ.mjs} +6 -5
- package/dist/{price-list-create-GRT27KOM.mjs → price-list-create-K5JEZT57.mjs} +17 -16
- package/dist/{price-list-detail-VKIWM7HP.mjs → price-list-detail-Q5VG5VGW.mjs} +13 -12
- package/dist/{price-list-edit-SW7YIR3Z.mjs → price-list-edit-53UW35L3.mjs} +5 -4
- package/dist/{price-list-list-LF2PL4B5.mjs → price-list-list-DG5YEZ44.mjs} +4 -3
- package/dist/{price-list-prices-add-ISLZDQNI.mjs → price-list-prices-add-2MQ226U4.mjs} +16 -15
- package/dist/{price-list-prices-edit-C6SX2TLJ.mjs → price-list-prices-edit-OJZLV7OS.mjs} +7 -6
- package/dist/{product-attributes-REJ5NF2D.mjs → product-attributes-YF4TZOIO.mjs} +14 -13
- package/dist/{product-create-4TFE3JHQ.mjs → product-create-KJML2332.mjs} +16 -15
- package/dist/{product-create-option-GEGQNSMQ.mjs → product-create-option-7AOXAA4S.mjs} +4 -3
- package/dist/{product-create-variant-WI6D5CDG.mjs → product-create-variant-5EBCLM54.mjs} +14 -13
- package/dist/{product-detail-BEIDGPKY.mjs → product-detail-QG72542C.mjs} +59 -17
- package/dist/{product-edit-ZRQUK5OQ.mjs → product-edit-DZZR775Q.mjs} +14 -13
- package/dist/{product-edit-option-HBIOBQTS.mjs → product-edit-option-LWJT3CYJ.mjs} +4 -3
- package/dist/{product-export-GIEFG4MA.mjs → product-export-5AD7NELI.mjs} +15 -14
- package/dist/{product-image-variants-edit-AAMRK4KQ.mjs → product-image-variants-edit-M6QF2RLE.mjs} +13 -12
- package/dist/{product-import-43UXKCL3.mjs → product-import-V3KQN4TV.mjs} +13 -12
- package/dist/{product-list-D4CVUBQQ.mjs → product-list-EUWZIFTM.mjs} +25 -12
- package/dist/{product-media-EGK66SRX.mjs → product-media-3VJ7KENL.mjs} +4 -3
- package/dist/{product-metadata-55CAQTPS.mjs → product-metadata-GL2MVPDI.mjs} +14 -13
- package/dist/{product-organization-7J7MUM6F.mjs → product-organization-O7RHELMQ.mjs} +15 -14
- package/dist/{product-prices-WQDE4XYT.mjs → product-prices-YWV6MSM6.mjs} +5 -4
- package/dist/{product-sales-channels-GIJ7Q57M.mjs → product-sales-channels-PPXUG4KT.mjs} +5 -4
- package/dist/{product-shipping-profile-KIDRTPWA.mjs → product-shipping-profile-ETQFZ7DC.mjs} +4 -3
- package/dist/{product-stock-22S2HGMM.mjs → product-stock-AKEFMK5O.mjs} +15 -14
- package/dist/{product-tag-create-7GPE246H.mjs → product-tag-create-PQMDDKWH.mjs} +13 -12
- package/dist/{product-tag-detail-R6C2TTA4.mjs → product-tag-detail-I3MBZX7U.mjs} +30 -14
- package/dist/{product-tag-edit-WA6FGSIP.mjs → product-tag-edit-K3BBQLJR.mjs} +13 -12
- package/dist/{product-tag-list-U7PLHMLF.mjs → product-tag-list-JUWSOMB7.mjs} +30 -14
- package/dist/{product-tag-metadata-EJ7FEXSE.mjs → product-tag-metadata-MJH5LH7E.mjs} +14 -13
- package/dist/{product-type-create-HBDROTGB.mjs → product-type-create-DRFXTL5O.mjs} +4 -3
- package/dist/{product-type-detail-TYQ7MJFE.mjs → product-type-detail-RKHT5NBL.mjs} +29 -13
- package/dist/{product-type-edit-H3JCMVRV.mjs → product-type-edit-SRHCZDK7.mjs} +4 -3
- package/dist/{product-type-list-KIKWBPD7.mjs → product-type-list-QQKAHBJ3.mjs} +19 -3
- package/dist/{product-type-metadata-Q6W5GL7Z.mjs → product-type-metadata-CDJDFFGQ.mjs} +14 -13
- package/dist/{product-variant-detail-SPJ7MZTK.mjs → product-variant-detail-XAYG5CKE.mjs} +27 -11
- package/dist/{product-variant-edit-BW7QMHC5.mjs → product-variant-edit-DEZEY2H2.mjs} +13 -12
- package/dist/{product-variant-manage-inventory-items-BLHCH6QD.mjs → product-variant-manage-inventory-items-Y2VEOHP7.mjs} +4 -3
- package/dist/{product-variant-media-KLSUISGH.mjs → product-variant-media-2WLVNGI4.mjs} +4 -3
- package/dist/{product-variant-metadata-GDMVC4MZ.mjs → product-variant-metadata-VTZDNWUT.mjs} +14 -13
- package/dist/{profile-edit-YBBXXCCK.mjs → profile-edit-ZNXO6WME.mjs} +2 -2
- package/dist/{promotion-add-campaign-JRTM7WBR.mjs → promotion-add-campaign-DO67QK6M.mjs} +3 -3
- package/dist/{promotion-create-HF6DTKCC.mjs → promotion-create-HWFNUQXG.mjs} +15 -14
- package/dist/{promotion-detail-HTM3F2VO.mjs → promotion-detail-QC36KXB3.mjs} +11 -10
- package/dist/{promotion-edit-details-AREFQ6O5.mjs → promotion-edit-details-6BSOOWQN.mjs} +2 -2
- package/dist/{refund-reason-create-RKIH46D6.mjs → refund-reason-create-YHCDEHGQ.mjs} +13 -12
- package/dist/{refund-reason-edit-V3KC6NMO.mjs → refund-reason-edit-CZ5QZ2SZ.mjs} +13 -12
- package/dist/{refund-reason-list-M5BOHFWU.mjs → refund-reason-list-OJYYEYJE.mjs} +11 -10
- package/dist/{region-add-countries-OF5RUSYU.mjs → region-add-countries-2VAVXMJQ.mjs} +2 -2
- package/dist/{region-create-BGOWVCTR.mjs → region-create-NA7Y2LN4.mjs} +2 -2
- package/dist/{region-edit-5GO25GDF.mjs → region-edit-WAU347DP.mjs} +2 -2
- package/dist/{region-metadata-5NGUNAXZ.mjs → region-metadata-H6XXUQ4S.mjs} +14 -13
- package/dist/{reservation-create-Z2SUMBGT.mjs → reservation-create-ZCIYM6JI.mjs} +5 -4
- package/dist/{reservation-detail-JH77TQHN.mjs → reservation-detail-LZAQL4XA.mjs} +11 -10
- package/dist/{reservation-list-WHBGZSVH.mjs → reservation-list-B47DXTA7.mjs} +3 -2
- package/dist/{reservation-metadata-ERCWXYVL.mjs → reservation-metadata-5HZSDDOK.mjs} +14 -13
- package/dist/{reset-password-5TAYQEUV.mjs → reset-password-Y5WVXV4Q.mjs} +2 -2
- package/dist/{return-reason-create-NXWDC6AC.mjs → return-reason-create-HM54WRJY.mjs} +2 -2
- package/dist/{return-reason-edit-M6IKNNKB.mjs → return-reason-edit-VSIRHVQ6.mjs} +2 -2
- package/dist/{sales-channel-add-products-DTAXWL6H.mjs → sales-channel-add-products-F7YV4MO5.mjs} +14 -13
- package/dist/{sales-channel-create-E7BDTPWD.mjs → sales-channel-create-MI7HHZYE.mjs} +5 -4
- package/dist/{sales-channel-detail-XWHV7J7X.mjs → sales-channel-detail-MXIPZCGA.mjs} +12 -11
- package/dist/{sales-channel-edit-HMPA3Y3L.mjs → sales-channel-edit-VSHOIR37.mjs} +5 -4
- package/dist/{sales-channel-list-7NSEFCXQ.mjs → sales-channel-list-RLGL7FM3.mjs} +11 -10
- package/dist/{sales-channel-metadata-CMZN74K7.mjs → sales-channel-metadata-M364R4RJ.mjs} +14 -13
- package/dist/{shipping-option-type-create-4BN2GBHP.mjs → shipping-option-type-create-C5WUWON7.mjs} +13 -12
- package/dist/{shipping-option-type-detail-YB3TCED2.mjs → shipping-option-type-detail-PENS2K73.mjs} +12 -11
- package/dist/{shipping-option-type-edit-MDO7ALAU.mjs → shipping-option-type-edit-CIU5EHRP.mjs} +13 -12
- package/dist/{shipping-option-type-list-DJAT4RKX.mjs → shipping-option-type-list-DIOX7VG7.mjs} +12 -11
- package/dist/{shipping-profile-create-752TMBBE.mjs → shipping-profile-create-26R64I3Z.mjs} +2 -2
- package/dist/{shipping-profile-metadata-HQI7PCPU.mjs → shipping-profile-metadata-75G2NNMA.mjs} +14 -13
- package/dist/{store-add-currencies-PEWNEWCH.mjs → store-add-currencies-OX2WXFMS.mjs} +2 -2
- package/dist/{store-add-locales-JLRTXG3Q.mjs → store-add-locales-VJ4RJ7UI.mjs} +12 -11
- package/dist/{store-detail-MOLAYNQZ.mjs → store-detail-JSNPOB2F.mjs} +11 -10
- package/dist/{store-edit-FTLPT55E.mjs → store-edit-5ZS562ZO.mjs} +2 -2
- package/dist/{store-metadata-ZJD23O4D.mjs → store-metadata-CYXTVJUE.mjs} +14 -13
- package/dist/{tax-region-create-NCO2OQ3I.mjs → tax-region-create-DWGL4EUT.mjs} +13 -12
- package/dist/{tax-region-detail-RIABXU7D.mjs → tax-region-detail-2AE2EFI3.mjs} +21 -20
- package/dist/{tax-region-edit-YZALLSZY.mjs → tax-region-edit-EEVEEU2Q.mjs} +13 -12
- package/dist/{tax-region-list-BXZBUXRJ.mjs → tax-region-list-P4LDOPZD.mjs} +3 -3
- package/dist/{tax-region-province-create-5JP3PVID.mjs → tax-region-province-create-GKJ7WMRS.mjs} +2 -2
- package/dist/{tax-region-province-detail-UKLRVJS2.mjs → tax-region-province-detail-4ERSEQFF.mjs} +20 -19
- package/dist/{tax-region-tax-override-create-33XGHH7A.mjs → tax-region-tax-override-create-PHCGEF7V.mjs} +16 -15
- package/dist/{tax-region-tax-override-edit-WOKZSPTY.mjs → tax-region-tax-override-edit-SMRPSILC.mjs} +17 -16
- package/dist/{tax-region-tax-rate-create-O2SDSXCH.mjs → tax-region-tax-rate-create-MECFGVPL.mjs} +2 -2
- package/dist/{tax-region-tax-rate-edit-W62VEVKT.mjs → tax-region-tax-rate-edit-7DYSPYOD.mjs} +2 -2
- package/dist/translation-list-UF7FLXOW.mjs +441 -0
- package/dist/translations-edit-USQJNMAY.mjs +707 -0
- package/dist/{user-detail-KEDJ7N3Q.mjs → user-detail-BJUXLZZQ.mjs} +2 -1
- package/dist/{user-edit-LXQCTDGA.mjs → user-edit-ZBB4RMTP.mjs} +2 -2
- package/dist/{user-invite-YH33WUC2.mjs → user-invite-GAGIM5DO.mjs} +2 -2
- package/dist/{user-metadata-4WOICEE7.mjs → user-metadata-2WPJOEJA.mjs} +14 -13
- package/dist/{workflow-execution-detail-OKM6P4SX.mjs → workflow-execution-detail-H2AKEZJX.mjs} +11 -10
- package/package.json +9 -9
- package/src/components/common/icon-avatar/icon-avatar.tsx +4 -0
- package/src/components/data-grid/components/data-grid-cell-container.tsx +13 -4
- package/src/components/data-grid/components/data-grid-multiline-cell.tsx +103 -0
- package/src/components/data-grid/components/data-grid-readonly-cell.tsx +13 -3
- package/src/components/data-grid/components/data-grid-root.tsx +271 -60
- package/src/components/data-grid/components/data-grid-text-cell.tsx +7 -7
- package/src/components/data-grid/components/data-grid-textarea-modal-cell.tsx +233 -0
- package/src/components/data-grid/components/index.ts +2 -0
- package/src/components/data-grid/data-grid.tsx +16 -1
- package/src/components/data-grid/helpers/create-data-grid-column-helper.ts +18 -0
- package/src/components/data-grid/hooks/use-data-grid-cell.tsx +12 -1
- package/src/components/data-grid/hooks/use-data-grid-keydown-event.tsx +43 -3
- package/src/components/data-grid/types.ts +1 -0
- package/src/components/layout/settings-layout/settings-layout.tsx +11 -1
- package/src/components/modals/route-focus-modal/route-focus-modal.tsx +8 -3
- package/src/components/modals/route-modal-form/route-modal-form.tsx +6 -1
- package/src/components/modals/route-modal-provider/route-provider.tsx +16 -4
- package/src/dashboard-app/routes/get-route.map.tsx +19 -0
- package/src/hooks/api/categories.tsx +32 -0
- package/src/hooks/api/collections.tsx +31 -0
- package/src/hooks/api/index.ts +1 -0
- package/src/hooks/api/product-types.tsx +32 -0
- package/src/hooks/api/product-variants.tsx +47 -3
- package/src/hooks/api/products.tsx +29 -0
- package/src/hooks/api/tags.tsx +32 -0
- package/src/hooks/api/translations.tsx +306 -0
- package/src/hooks/use-infinite-list.tsx +92 -0
- package/src/i18n/translations/$schema.json +122 -0
- package/src/i18n/translations/en.json +38 -0
- package/src/i18n/translations/es.json +38 -0
- package/src/routes/categories/category-detail/components/category-general-section/category-general-section.tsx +16 -1
- package/src/routes/categories/category-list/components/category-list-table/category-list-table.tsx +16 -1
- package/src/routes/collections/collection-detail/components/collection-general-section/collection-general-section.tsx +16 -1
- package/src/routes/collections/collection-list/components/collection-list-table/collection-row-actions.tsx +16 -1
- package/src/routes/product-tags/product-tag-detail/components/product-tag-general-section/product-tag-general-section.tsx +16 -1
- package/src/routes/product-tags/product-tag-list/components/product-tag-list-table/product-tag-list-table.tsx +16 -1
- package/src/routes/product-types/product-type-detail/components/product-type-general-section/product-type-general-section.tsx +16 -1
- package/src/routes/product-types/product-type-list/components/product-type-list-table/product-table-row-actions.tsx +16 -1
- package/src/routes/product-variants/product-variant-detail/components/variant-general-section/variant-general-section.tsx +16 -1
- package/src/routes/products/product-detail/components/product-general-section/product-general-section.tsx +16 -1
- package/src/routes/products/product-detail/components/product-variant-section/product-variant-section.tsx +32 -1
- package/src/routes/products/product-list/components/product-list-table/product-list-table.tsx +15 -1
- package/src/routes/translations/translation-list/components/active-locales-section/active-locales-section.tsx +68 -0
- package/src/routes/translations/translation-list/components/translation-list-section/translation-list-section.tsx +44 -0
- package/src/routes/translations/translation-list/components/translations-completion-section/translations-completion-section.tsx +224 -0
- package/src/routes/translations/translation-list/index.tsx +1 -0
- package/src/routes/translations/translation-list/translation-list.tsx +138 -0
- package/src/routes/translations/translations-edit/components/translations-edit-form/index.ts +1 -0
- package/src/routes/translations/translations-edit/components/translations-edit-form/translations-edit-form.tsx +792 -0
- package/src/routes/translations/translations-edit/index.ts +1 -0
- package/src/routes/translations/translations-edit/translations-edit.tsx +90 -0
|
@@ -0,0 +1,707 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DataGrid,
|
|
3
|
+
createDataGridHelper
|
|
4
|
+
} from "./chunk-LZFWCKOF.mjs";
|
|
5
|
+
import "./chunk-DK4WIVY6.mjs";
|
|
6
|
+
import "./chunk-IUCDCPJU.mjs";
|
|
7
|
+
import {
|
|
8
|
+
KeyboundForm
|
|
9
|
+
} from "./chunk-6HTZNHPT.mjs";
|
|
10
|
+
import "./chunk-WVA4O7QS.mjs";
|
|
11
|
+
import {
|
|
12
|
+
RouteFocusModal,
|
|
13
|
+
useRouteModal
|
|
14
|
+
} from "./chunk-D6UW7URG.mjs";
|
|
15
|
+
import {
|
|
16
|
+
useFeatureFlag
|
|
17
|
+
} from "./chunk-G4BWCU5P.mjs";
|
|
18
|
+
import "./chunk-LPEUYMRK.mjs";
|
|
19
|
+
import "./chunk-OC7BQLYI.mjs";
|
|
20
|
+
import "./chunk-S4DMV3ZT.mjs";
|
|
21
|
+
import "./chunk-OBQI23QM.mjs";
|
|
22
|
+
import {
|
|
23
|
+
useBatchTranslations,
|
|
24
|
+
useReferenceTranslations,
|
|
25
|
+
useTranslationSettings
|
|
26
|
+
} from "./chunk-GRZSG4EP.mjs";
|
|
27
|
+
import "./chunk-I4OBEAOJ.mjs";
|
|
28
|
+
import "./chunk-HI6URQ7H.mjs";
|
|
29
|
+
import "./chunk-6CLQKVAU.mjs";
|
|
30
|
+
import "./chunk-KI7TOXBR.mjs";
|
|
31
|
+
import "./chunk-UJ2TMPV4.mjs";
|
|
32
|
+
import "./chunk-23GTCEOV.mjs";
|
|
33
|
+
import "./chunk-WAXMT4IY.mjs";
|
|
34
|
+
import "./chunk-DYDGGABK.mjs";
|
|
35
|
+
import "./chunk-LGNTHZ5Y.mjs";
|
|
36
|
+
import "./chunk-CN7JXSGW.mjs";
|
|
37
|
+
import "./chunk-5BQQRHQS.mjs";
|
|
38
|
+
import "./chunk-HTCYX4VD.mjs";
|
|
39
|
+
import "./chunk-5AFMB7XQ.mjs";
|
|
40
|
+
import "./chunk-UWY5ZV66.mjs";
|
|
41
|
+
import "./chunk-A63RZVX6.mjs";
|
|
42
|
+
import "./chunk-HBXV7ENS.mjs";
|
|
43
|
+
import "./chunk-CDORR33H.mjs";
|
|
44
|
+
import "./chunk-4JQR6QNW.mjs";
|
|
45
|
+
import "./chunk-FYWHE3W5.mjs";
|
|
46
|
+
import "./chunk-OSHH5GAS.mjs";
|
|
47
|
+
import "./chunk-2XTBDCGE.mjs";
|
|
48
|
+
import "./chunk-3BF5SC66.mjs";
|
|
49
|
+
import {
|
|
50
|
+
useStore
|
|
51
|
+
} from "./chunk-VCSSQVPD.mjs";
|
|
52
|
+
import "./chunk-HP2JH45P.mjs";
|
|
53
|
+
import "./chunk-SQDIZZDW.mjs";
|
|
54
|
+
import "./chunk-Z6BFNHEO.mjs";
|
|
55
|
+
import "./chunk-HGRIOEAR.mjs";
|
|
56
|
+
import "./chunk-FXYH54JP.mjs";
|
|
57
|
+
import "./chunk-774WSTCC.mjs";
|
|
58
|
+
import "./chunk-NFEK63OE.mjs";
|
|
59
|
+
import "./chunk-QZ7TP4HQ.mjs";
|
|
60
|
+
|
|
61
|
+
// src/routes/translations/translations-edit/translations-edit.tsx
|
|
62
|
+
import { useNavigate, useSearchParams } from "react-router-dom";
|
|
63
|
+
|
|
64
|
+
// src/routes/translations/translations-edit/components/translations-edit-form/translations-edit-form.tsx
|
|
65
|
+
import { zodResolver } from "@hookform/resolvers/zod";
|
|
66
|
+
import { Button, Prompt, Select, toast, Text } from "@medusajs/ui";
|
|
67
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
68
|
+
import { useForm } from "react-hook-form";
|
|
69
|
+
import { useTranslation } from "react-i18next";
|
|
70
|
+
import { z } from "zod";
|
|
71
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
72
|
+
var LocaleTranslationSchema = z.object({
|
|
73
|
+
id: z.string().nullish(),
|
|
74
|
+
locale_code: z.string(),
|
|
75
|
+
fields: z.record(z.string().optional())
|
|
76
|
+
});
|
|
77
|
+
var EntityTranslationsSchema = z.object({
|
|
78
|
+
locales: z.record(LocaleTranslationSchema)
|
|
79
|
+
});
|
|
80
|
+
var TranslationsFormSchema = z.object({
|
|
81
|
+
entities: z.record(EntityTranslationsSchema)
|
|
82
|
+
});
|
|
83
|
+
function isEntityRow(row) {
|
|
84
|
+
return row._type === "entity";
|
|
85
|
+
}
|
|
86
|
+
function initTranslationsFormState(translations, references, availableLocales, translatableFields) {
|
|
87
|
+
const existingMap = /* @__PURE__ */ new Map();
|
|
88
|
+
for (const t of translations) {
|
|
89
|
+
existingMap.set(`${t.reference_id}:${t.locale_code}`, t);
|
|
90
|
+
}
|
|
91
|
+
const entitiesTranslationState = {};
|
|
92
|
+
for (const reference of references) {
|
|
93
|
+
const locales = {};
|
|
94
|
+
for (const locale of availableLocales) {
|
|
95
|
+
const key = `${reference.id}:${locale.locale_code}`;
|
|
96
|
+
const existing = existingMap.get(key);
|
|
97
|
+
const fields = {};
|
|
98
|
+
for (const fieldName of translatableFields) {
|
|
99
|
+
const fieldValue = existing?.translations?.[fieldName] ?? "";
|
|
100
|
+
fields[fieldName] = fieldValue;
|
|
101
|
+
}
|
|
102
|
+
locales[locale.locale_code] = {
|
|
103
|
+
id: existing?.id ?? null,
|
|
104
|
+
locale_code: locale.locale_code,
|
|
105
|
+
fields
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
entitiesTranslationState[reference.id] = { locales };
|
|
109
|
+
}
|
|
110
|
+
return {
|
|
111
|
+
entities: entitiesTranslationState
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
function buildTranslationRows(references, translatableFields) {
|
|
115
|
+
return references.map((reference) => ({
|
|
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
|
+
}));
|
|
124
|
+
}
|
|
125
|
+
function transformToBatchPayload(currentState, initialState, entityType) {
|
|
126
|
+
const payload = {
|
|
127
|
+
create: [],
|
|
128
|
+
update: [],
|
|
129
|
+
delete: []
|
|
130
|
+
};
|
|
131
|
+
for (const [entityId, entityData] of Object.entries(currentState.entities)) {
|
|
132
|
+
for (const [localeCode, localeTranslations] of Object.entries(
|
|
133
|
+
entityData.locales
|
|
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) {
|
|
169
|
+
continue;
|
|
170
|
+
}
|
|
171
|
+
for (const [fieldName, fieldValue] of Object.entries(
|
|
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(
|
|
194
|
+
(v) => v !== void 0 && v.trim() !== ""
|
|
195
|
+
);
|
|
196
|
+
const hadContent = initial && Object.values(initial.fields).some(
|
|
197
|
+
(v) => v !== void 0 && v.trim() !== ""
|
|
198
|
+
);
|
|
199
|
+
if (!localeTranslations.id && hasContent) {
|
|
200
|
+
payload.create.push({
|
|
201
|
+
reference_id: entityId,
|
|
202
|
+
reference: entityType,
|
|
203
|
+
locale_code: localeTranslations.locale_code,
|
|
204
|
+
translations: localeTranslations.fields
|
|
205
|
+
});
|
|
206
|
+
} else if (localeTranslations.id && hasContent) {
|
|
207
|
+
const hasChanged = !initial || JSON.stringify(localeTranslations.fields) !== JSON.stringify(initial.fields);
|
|
208
|
+
if (hasChanged) {
|
|
209
|
+
payload.update.push({
|
|
210
|
+
id: localeTranslations.id,
|
|
211
|
+
translations: localeTranslations.fields
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
} else if (localeTranslations.id && !hasContent && hadContent) {
|
|
215
|
+
payload.delete.push(localeTranslations.id);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
return payload;
|
|
219
|
+
}
|
|
220
|
+
var columnHelper = createDataGridHelper();
|
|
221
|
+
var FIELD_COLUMN_WIDTH = 150;
|
|
222
|
+
function useTranslationsGridColumns({
|
|
223
|
+
entities,
|
|
224
|
+
translatableFields,
|
|
225
|
+
availableLocales,
|
|
226
|
+
selectedLocale,
|
|
227
|
+
dynamicColumnWidth
|
|
228
|
+
}) {
|
|
229
|
+
const { t } = useTranslation();
|
|
230
|
+
const columns = useMemo(() => {
|
|
231
|
+
const selectedLocaleData = availableLocales.find(
|
|
232
|
+
(l) => l.locale_code === selectedLocale
|
|
233
|
+
);
|
|
234
|
+
const baseColumns = [
|
|
235
|
+
columnHelper.column({
|
|
236
|
+
id: "field",
|
|
237
|
+
name: "field",
|
|
238
|
+
size: FIELD_COLUMN_WIDTH,
|
|
239
|
+
header: void 0,
|
|
240
|
+
cell: (context) => {
|
|
241
|
+
const row = context.row.original;
|
|
242
|
+
if (isEntityRow(row)) {
|
|
243
|
+
return /* @__PURE__ */ jsx(DataGrid.ReadonlyCell, { context });
|
|
244
|
+
}
|
|
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
|
+
Text,
|
|
247
|
+
{
|
|
248
|
+
className: "text-ui-fg-subtle truncate",
|
|
249
|
+
weight: "plus",
|
|
250
|
+
size: "small",
|
|
251
|
+
children: t(`fields.${row.field_name}`, {
|
|
252
|
+
defaultValue: row.field_name
|
|
253
|
+
})
|
|
254
|
+
}
|
|
255
|
+
) }) });
|
|
256
|
+
},
|
|
257
|
+
disableHiding: true
|
|
258
|
+
}),
|
|
259
|
+
columnHelper.column({
|
|
260
|
+
id: "original",
|
|
261
|
+
name: "original",
|
|
262
|
+
size: dynamicColumnWidth,
|
|
263
|
+
header: () => /* @__PURE__ */ jsx(Text, { className: "text-ui-fg-base", weight: "plus", size: "small", children: t("general.original") }),
|
|
264
|
+
disableHiding: true,
|
|
265
|
+
cell: (context) => {
|
|
266
|
+
const row = context.row.original;
|
|
267
|
+
if (isEntityRow(row)) {
|
|
268
|
+
return /* @__PURE__ */ jsx(DataGrid.ReadonlyCell, { context });
|
|
269
|
+
}
|
|
270
|
+
const entity = entities.find(
|
|
271
|
+
(entity2) => entity2.id === row.reference_id
|
|
272
|
+
);
|
|
273
|
+
if (!entity) {
|
|
274
|
+
return null;
|
|
275
|
+
}
|
|
276
|
+
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] }) });
|
|
277
|
+
}
|
|
278
|
+
})
|
|
279
|
+
];
|
|
280
|
+
if (selectedLocaleData) {
|
|
281
|
+
baseColumns.push(
|
|
282
|
+
columnHelper.column({
|
|
283
|
+
id: selectedLocaleData.locale_code,
|
|
284
|
+
name: selectedLocaleData.locale.name,
|
|
285
|
+
size: dynamicColumnWidth,
|
|
286
|
+
header: () => /* @__PURE__ */ jsx(Text, { className: "text-ui-fg-base", weight: "plus", size: "small", children: selectedLocaleData.locale.name }),
|
|
287
|
+
cell: (context) => {
|
|
288
|
+
const row = context.row.original;
|
|
289
|
+
if (isEntityRow(row)) {
|
|
290
|
+
return /* @__PURE__ */ jsx(DataGrid.ReadonlyCell, { context, isMultiLine: true });
|
|
291
|
+
}
|
|
292
|
+
return /* @__PURE__ */ jsx(DataGrid.MultilineCell, { context });
|
|
293
|
+
},
|
|
294
|
+
field: (context) => {
|
|
295
|
+
const row = context.row.original;
|
|
296
|
+
if (isEntityRow(row)) {
|
|
297
|
+
return null;
|
|
298
|
+
}
|
|
299
|
+
return `entities.${row.reference_id}.locales.${selectedLocaleData.locale_code}.fields.${row.field_name}`;
|
|
300
|
+
},
|
|
301
|
+
type: "multiline-text"
|
|
302
|
+
})
|
|
303
|
+
);
|
|
304
|
+
}
|
|
305
|
+
return baseColumns;
|
|
306
|
+
}, [
|
|
307
|
+
t,
|
|
308
|
+
translatableFields,
|
|
309
|
+
availableLocales,
|
|
310
|
+
selectedLocale,
|
|
311
|
+
entities,
|
|
312
|
+
dynamicColumnWidth
|
|
313
|
+
]);
|
|
314
|
+
return columns;
|
|
315
|
+
}
|
|
316
|
+
var TranslationsEditForm = ({
|
|
317
|
+
translations,
|
|
318
|
+
references,
|
|
319
|
+
entityType,
|
|
320
|
+
availableLocales,
|
|
321
|
+
translatableFields,
|
|
322
|
+
fetchNextPage,
|
|
323
|
+
hasNextPage,
|
|
324
|
+
isFetchingNextPage,
|
|
325
|
+
referenceCount
|
|
326
|
+
}) => {
|
|
327
|
+
const { t } = useTranslation();
|
|
328
|
+
const { handleSuccess, setCloseOnEscape } = useRouteModal();
|
|
329
|
+
const containerRef = useRef(null);
|
|
330
|
+
const [dynamicColumnWidth, setDynamicColumnWidth] = useState(400);
|
|
331
|
+
useEffect(() => {
|
|
332
|
+
const calculateColumnWidth = () => {
|
|
333
|
+
if (containerRef.current) {
|
|
334
|
+
const containerWidth = containerRef.current.offsetWidth;
|
|
335
|
+
const availableWidth = containerWidth - FIELD_COLUMN_WIDTH - 16;
|
|
336
|
+
const columnWidth = Math.max(300, Math.floor(availableWidth / 2));
|
|
337
|
+
setDynamicColumnWidth(columnWidth);
|
|
338
|
+
}
|
|
339
|
+
};
|
|
340
|
+
calculateColumnWidth();
|
|
341
|
+
const resizeObserver = new ResizeObserver(calculateColumnWidth);
|
|
342
|
+
if (containerRef.current) {
|
|
343
|
+
resizeObserver.observe(containerRef.current);
|
|
344
|
+
}
|
|
345
|
+
return () => resizeObserver.disconnect();
|
|
346
|
+
}, []);
|
|
347
|
+
const [selectedLocale, setSelectedLocale] = useState(
|
|
348
|
+
availableLocales[0]?.locale_code ?? ""
|
|
349
|
+
);
|
|
350
|
+
const [showUnsavedPrompt, setShowUnsavedPrompt] = useState(false);
|
|
351
|
+
const [pendingLocale, setPendingLocale] = useState(null);
|
|
352
|
+
const entities = useMemo(() => references, [references]);
|
|
353
|
+
const totalCount = useMemo(
|
|
354
|
+
() => referenceCount * (translatableFields.length + 1),
|
|
355
|
+
[referenceCount, translatableFields]
|
|
356
|
+
);
|
|
357
|
+
const initialState = useRef(
|
|
358
|
+
initTranslationsFormState(
|
|
359
|
+
translations,
|
|
360
|
+
entities,
|
|
361
|
+
availableLocales,
|
|
362
|
+
translatableFields
|
|
363
|
+
)
|
|
364
|
+
);
|
|
365
|
+
const form = useForm({
|
|
366
|
+
resolver: zodResolver(TranslationsFormSchema),
|
|
367
|
+
defaultValues: initialState.current
|
|
368
|
+
});
|
|
369
|
+
const rows = useMemo(
|
|
370
|
+
() => buildTranslationRows(entities, translatableFields),
|
|
371
|
+
[entities, translatableFields]
|
|
372
|
+
);
|
|
373
|
+
const { mutateAsync, isPending } = useBatchTranslations(entityType);
|
|
374
|
+
const handleLocaleChange = useCallback(
|
|
375
|
+
(newLocale) => {
|
|
376
|
+
if (newLocale === selectedLocale) {
|
|
377
|
+
return;
|
|
378
|
+
}
|
|
379
|
+
const currentValues = form.getValues();
|
|
380
|
+
const hasChanges = hasLocaleChanges(
|
|
381
|
+
currentValues,
|
|
382
|
+
initialState.current,
|
|
383
|
+
selectedLocale
|
|
384
|
+
);
|
|
385
|
+
if (hasChanges) {
|
|
386
|
+
setPendingLocale(newLocale);
|
|
387
|
+
setShowUnsavedPrompt(true);
|
|
388
|
+
} else {
|
|
389
|
+
setSelectedLocale(newLocale);
|
|
390
|
+
}
|
|
391
|
+
},
|
|
392
|
+
[selectedLocale, form]
|
|
393
|
+
);
|
|
394
|
+
const saveCurrentLocale = useCallback(async () => {
|
|
395
|
+
const currentValues = form.getValues();
|
|
396
|
+
const payload = transformSingleLocaleToBatchPayload(
|
|
397
|
+
currentValues,
|
|
398
|
+
initialState.current,
|
|
399
|
+
entityType,
|
|
400
|
+
selectedLocale
|
|
401
|
+
);
|
|
402
|
+
if (payload.create.length === 0 && payload.update.length === 0 && payload.delete.length === 0) {
|
|
403
|
+
return true;
|
|
404
|
+
}
|
|
405
|
+
try {
|
|
406
|
+
const BATCH_SIZE = 150;
|
|
407
|
+
const totalItems = payload.create.length + payload.update.length + payload.delete.length;
|
|
408
|
+
const batchCount = Math.ceil(totalItems / BATCH_SIZE);
|
|
409
|
+
for (let i = 0; i < batchCount; i++) {
|
|
410
|
+
let currentBatchAvailable = BATCH_SIZE;
|
|
411
|
+
const currentBatch = {
|
|
412
|
+
create: [],
|
|
413
|
+
update: [],
|
|
414
|
+
delete: []
|
|
415
|
+
};
|
|
416
|
+
if (payload.create.length > 0) {
|
|
417
|
+
currentBatch.create = payload.create.splice(0, currentBatchAvailable);
|
|
418
|
+
currentBatchAvailable -= currentBatch.create.length;
|
|
419
|
+
}
|
|
420
|
+
if (payload.update.length > 0) {
|
|
421
|
+
currentBatch.update = payload.update.splice(0, currentBatchAvailable);
|
|
422
|
+
currentBatchAvailable -= currentBatch.update.length;
|
|
423
|
+
}
|
|
424
|
+
if (payload.delete.length > 0) {
|
|
425
|
+
currentBatch.delete = payload.delete.splice(0, currentBatchAvailable);
|
|
426
|
+
currentBatchAvailable -= currentBatch.delete.length;
|
|
427
|
+
}
|
|
428
|
+
await mutateAsync(currentBatch);
|
|
429
|
+
}
|
|
430
|
+
const updatedInitialState = { ...initialState.current };
|
|
431
|
+
for (const entityId of Object.keys(currentValues.entities)) {
|
|
432
|
+
if (updatedInitialState.entities[entityId]?.locales[selectedLocale]) {
|
|
433
|
+
updatedInitialState.entities[entityId].locales[selectedLocale] = {
|
|
434
|
+
...currentValues.entities[entityId].locales[selectedLocale]
|
|
435
|
+
};
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
initialState.current = updatedInitialState;
|
|
439
|
+
form.reset(currentValues);
|
|
440
|
+
return true;
|
|
441
|
+
} catch (error) {
|
|
442
|
+
toast.error(
|
|
443
|
+
error instanceof Error ? error.message : "Failed to save translations"
|
|
444
|
+
);
|
|
445
|
+
return false;
|
|
446
|
+
}
|
|
447
|
+
}, [form, entityType, selectedLocale, mutateAsync]);
|
|
448
|
+
const handleSaveAndSwitch = useCallback(async () => {
|
|
449
|
+
const success = await saveCurrentLocale();
|
|
450
|
+
if (success && pendingLocale) {
|
|
451
|
+
toast.success(
|
|
452
|
+
t("translations.edit.localeChangesSaved", {
|
|
453
|
+
defaultValue: "Changes saved successfully"
|
|
454
|
+
})
|
|
455
|
+
);
|
|
456
|
+
setSelectedLocale(pendingLocale);
|
|
457
|
+
}
|
|
458
|
+
setShowUnsavedPrompt(false);
|
|
459
|
+
setPendingLocale(null);
|
|
460
|
+
}, [saveCurrentLocale, pendingLocale, t]);
|
|
461
|
+
const handleCancelSwitch = useCallback(() => {
|
|
462
|
+
setShowUnsavedPrompt(false);
|
|
463
|
+
setPendingLocale(null);
|
|
464
|
+
}, []);
|
|
465
|
+
const handleSave = useCallback(
|
|
466
|
+
async (closeOnSuccess = false) => {
|
|
467
|
+
const success = await saveCurrentLocale();
|
|
468
|
+
if (success) {
|
|
469
|
+
toast.success(t("translations.edit.successToast"));
|
|
470
|
+
if (closeOnSuccess) {
|
|
471
|
+
handleSuccess();
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
},
|
|
475
|
+
[saveCurrentLocale, t, handleSuccess]
|
|
476
|
+
);
|
|
477
|
+
const handleSubmit = form.handleSubmit(async (values) => {
|
|
478
|
+
const payload = transformToBatchPayload(
|
|
479
|
+
values,
|
|
480
|
+
initialState.current,
|
|
481
|
+
entityType
|
|
482
|
+
);
|
|
483
|
+
if (payload.create.length === 0 && payload.update.length === 0 && payload.delete.length === 0) {
|
|
484
|
+
return;
|
|
485
|
+
}
|
|
486
|
+
const BATCH_SIZE = 150;
|
|
487
|
+
const totalItems = payload.create.length + payload.update.length + payload.delete.length;
|
|
488
|
+
const batchCount = Math.ceil(totalItems / BATCH_SIZE);
|
|
489
|
+
for (let i = 0; i < batchCount; i++) {
|
|
490
|
+
let currentBatchAvailable = BATCH_SIZE;
|
|
491
|
+
const currentBatch = {
|
|
492
|
+
create: [],
|
|
493
|
+
update: [],
|
|
494
|
+
delete: []
|
|
495
|
+
};
|
|
496
|
+
if (payload.create.length > 0) {
|
|
497
|
+
currentBatch.create = payload.create.splice(0, currentBatchAvailable);
|
|
498
|
+
currentBatchAvailable -= currentBatch.create.length;
|
|
499
|
+
}
|
|
500
|
+
if (payload.update.length > 0) {
|
|
501
|
+
currentBatch.update = payload.update.splice(0, currentBatchAvailable);
|
|
502
|
+
currentBatchAvailable -= currentBatch.update.length;
|
|
503
|
+
}
|
|
504
|
+
if (payload.delete.length > 0) {
|
|
505
|
+
currentBatch.delete = payload.delete.splice(0, currentBatchAvailable);
|
|
506
|
+
currentBatchAvailable -= currentBatch.delete.length;
|
|
507
|
+
}
|
|
508
|
+
await mutateAsync(currentBatch, {
|
|
509
|
+
onSuccess: () => {
|
|
510
|
+
if (i === batchCount - 1) {
|
|
511
|
+
toast.success(
|
|
512
|
+
t("translations.edit.successToast", {
|
|
513
|
+
defaultValue: "Translations updated successfully"
|
|
514
|
+
})
|
|
515
|
+
);
|
|
516
|
+
handleSuccess();
|
|
517
|
+
}
|
|
518
|
+
},
|
|
519
|
+
onError: (error) => {
|
|
520
|
+
toast.error(error.message);
|
|
521
|
+
}
|
|
522
|
+
});
|
|
523
|
+
}
|
|
524
|
+
});
|
|
525
|
+
const columns = useTranslationsGridColumns({
|
|
526
|
+
entities,
|
|
527
|
+
translatableFields,
|
|
528
|
+
availableLocales,
|
|
529
|
+
selectedLocale,
|
|
530
|
+
dynamicColumnWidth
|
|
531
|
+
});
|
|
532
|
+
const selectedLocaleDisplay = availableLocales.find(
|
|
533
|
+
(l) => l.locale_code === selectedLocale
|
|
534
|
+
)?.locale.name;
|
|
535
|
+
return /* @__PURE__ */ jsxs(RouteFocusModal.Form, { form, children: [
|
|
536
|
+
/* @__PURE__ */ jsxs(
|
|
537
|
+
KeyboundForm,
|
|
538
|
+
{
|
|
539
|
+
onSubmit: handleSubmit,
|
|
540
|
+
className: "flex h-full flex-col overflow-hidden",
|
|
541
|
+
children: [
|
|
542
|
+
/* @__PURE__ */ jsx(RouteFocusModal.Header, {}),
|
|
543
|
+
/* @__PURE__ */ jsx(RouteFocusModal.Body, { className: "size-full overflow-hidden", children: /* @__PURE__ */ jsx("div", { ref: containerRef, className: "size-full", children: /* @__PURE__ */ jsx(
|
|
544
|
+
DataGrid,
|
|
545
|
+
{
|
|
546
|
+
showColumnsDropdown: false,
|
|
547
|
+
columns,
|
|
548
|
+
data: rows,
|
|
549
|
+
getSubRows: (row) => {
|
|
550
|
+
if (isEntityRow(row)) {
|
|
551
|
+
return row.subRows;
|
|
552
|
+
}
|
|
553
|
+
},
|
|
554
|
+
state: form,
|
|
555
|
+
onEditingChange: (editing) => setCloseOnEscape(!editing),
|
|
556
|
+
totalRowCount: totalCount,
|
|
557
|
+
onFetchMore: fetchNextPage,
|
|
558
|
+
isFetchingMore: isFetchingNextPage,
|
|
559
|
+
hasNextPage,
|
|
560
|
+
headerContent: /* @__PURE__ */ jsxs(
|
|
561
|
+
Select,
|
|
562
|
+
{
|
|
563
|
+
value: selectedLocale,
|
|
564
|
+
onValueChange: handleLocaleChange,
|
|
565
|
+
size: "small",
|
|
566
|
+
children: [
|
|
567
|
+
/* @__PURE__ */ jsx(Select.Trigger, { className: "bg-ui-bg-base w-[200px]", children: /* @__PURE__ */ jsx(Select.Value, { children: selectedLocaleDisplay }) }),
|
|
568
|
+
/* @__PURE__ */ jsx(Select.Content, { children: availableLocales.map((locale) => /* @__PURE__ */ jsx(
|
|
569
|
+
Select.Item,
|
|
570
|
+
{
|
|
571
|
+
value: locale.locale_code,
|
|
572
|
+
children: locale.locale.name
|
|
573
|
+
},
|
|
574
|
+
locale.locale_code
|
|
575
|
+
)) })
|
|
576
|
+
]
|
|
577
|
+
}
|
|
578
|
+
)
|
|
579
|
+
}
|
|
580
|
+
) }) }),
|
|
581
|
+
/* @__PURE__ */ jsx(RouteFocusModal.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-end gap-x-2", children: [
|
|
582
|
+
/* @__PURE__ */ jsx(RouteFocusModal.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: t("actions.cancel") }) }),
|
|
583
|
+
/* @__PURE__ */ jsx(
|
|
584
|
+
Button,
|
|
585
|
+
{
|
|
586
|
+
size: "small",
|
|
587
|
+
type: "button",
|
|
588
|
+
variant: "secondary",
|
|
589
|
+
onClick: () => handleSave(false),
|
|
590
|
+
isLoading: isPending,
|
|
591
|
+
children: t("actions.saveChanges")
|
|
592
|
+
}
|
|
593
|
+
),
|
|
594
|
+
/* @__PURE__ */ jsx(
|
|
595
|
+
Button,
|
|
596
|
+
{
|
|
597
|
+
size: "small",
|
|
598
|
+
type: "button",
|
|
599
|
+
onClick: () => handleSave(true),
|
|
600
|
+
isLoading: isPending,
|
|
601
|
+
children: t("actions.saveAndClose")
|
|
602
|
+
}
|
|
603
|
+
)
|
|
604
|
+
] }) })
|
|
605
|
+
]
|
|
606
|
+
}
|
|
607
|
+
),
|
|
608
|
+
/* @__PURE__ */ jsx(Prompt, { open: showUnsavedPrompt, variant: "confirmation", children: /* @__PURE__ */ jsxs(Prompt.Content, { children: [
|
|
609
|
+
/* @__PURE__ */ jsxs(Prompt.Header, { children: [
|
|
610
|
+
/* @__PURE__ */ jsx(Prompt.Title, { children: t("translations.edit.unsavedChanges.title") }),
|
|
611
|
+
/* @__PURE__ */ jsx(Prompt.Description, { children: t("translations.edit.unsavedChanges.description") })
|
|
612
|
+
] }),
|
|
613
|
+
/* @__PURE__ */ jsxs(Prompt.Footer, { children: [
|
|
614
|
+
/* @__PURE__ */ jsx(
|
|
615
|
+
Button,
|
|
616
|
+
{
|
|
617
|
+
size: "small",
|
|
618
|
+
variant: "secondary",
|
|
619
|
+
onClick: handleCancelSwitch,
|
|
620
|
+
type: "button",
|
|
621
|
+
children: t("actions.close")
|
|
622
|
+
}
|
|
623
|
+
),
|
|
624
|
+
/* @__PURE__ */ jsx(
|
|
625
|
+
Button,
|
|
626
|
+
{
|
|
627
|
+
size: "small",
|
|
628
|
+
onClick: handleSaveAndSwitch,
|
|
629
|
+
type: "button",
|
|
630
|
+
isLoading: isPending,
|
|
631
|
+
children: t("actions.saveChanges")
|
|
632
|
+
}
|
|
633
|
+
)
|
|
634
|
+
] })
|
|
635
|
+
] }) })
|
|
636
|
+
] });
|
|
637
|
+
};
|
|
638
|
+
|
|
639
|
+
// src/routes/translations/translations-edit/translations-edit.tsx
|
|
640
|
+
import { useEffect as useEffect2 } from "react";
|
|
641
|
+
import { keepPreviousData } from "@tanstack/react-query";
|
|
642
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
643
|
+
var TranslationsEdit = () => {
|
|
644
|
+
const isTranslationsEnabled = useFeatureFlag("translation");
|
|
645
|
+
const navigate = useNavigate();
|
|
646
|
+
const [searchParams] = useSearchParams();
|
|
647
|
+
const reference = searchParams.get("reference");
|
|
648
|
+
const referenceIdParam = searchParams.getAll("reference_id");
|
|
649
|
+
useEffect2(() => {
|
|
650
|
+
if (!reference || !isTranslationsEnabled) {
|
|
651
|
+
navigate(-1);
|
|
652
|
+
return;
|
|
653
|
+
}
|
|
654
|
+
}, [reference, navigate, isTranslationsEnabled]);
|
|
655
|
+
const {
|
|
656
|
+
translatable_fields,
|
|
657
|
+
isPending: isTranslationSettingsPending,
|
|
658
|
+
isError: isTranslationSettingsError,
|
|
659
|
+
error: translationSettingsError
|
|
660
|
+
} = useTranslationSettings({ entity_type: reference });
|
|
661
|
+
const {
|
|
662
|
+
translations,
|
|
663
|
+
references,
|
|
664
|
+
fetchNextPage,
|
|
665
|
+
count,
|
|
666
|
+
isFetchingNextPage,
|
|
667
|
+
hasNextPage,
|
|
668
|
+
isPending,
|
|
669
|
+
isError,
|
|
670
|
+
error
|
|
671
|
+
} = useReferenceTranslations(
|
|
672
|
+
reference,
|
|
673
|
+
translatable_fields?.[reference] ?? [],
|
|
674
|
+
referenceIdParam,
|
|
675
|
+
{
|
|
676
|
+
enabled: !!translatable_fields && !!reference,
|
|
677
|
+
placeholderData: keepPreviousData
|
|
678
|
+
}
|
|
679
|
+
);
|
|
680
|
+
const {
|
|
681
|
+
store,
|
|
682
|
+
isPending: isStorePending,
|
|
683
|
+
isError: isStoreError,
|
|
684
|
+
error: storeError
|
|
685
|
+
} = useStore();
|
|
686
|
+
const ready = !isPending && !!translations && !!translatable_fields && !isTranslationSettingsPending && !!references && !isStorePending && !!store;
|
|
687
|
+
if (isError || isStoreError || isTranslationSettingsError) {
|
|
688
|
+
throw error || storeError || translationSettingsError;
|
|
689
|
+
}
|
|
690
|
+
return /* @__PURE__ */ jsx2(RouteFocusModal, { prev: referenceIdParam.length ? -1 : "..", children: ready && /* @__PURE__ */ jsx2(
|
|
691
|
+
TranslationsEditForm,
|
|
692
|
+
{
|
|
693
|
+
translations,
|
|
694
|
+
references,
|
|
695
|
+
entityType: reference,
|
|
696
|
+
availableLocales: store?.supported_locales ?? [],
|
|
697
|
+
translatableFields: translatable_fields[reference],
|
|
698
|
+
fetchNextPage,
|
|
699
|
+
hasNextPage,
|
|
700
|
+
isFetchingNextPage,
|
|
701
|
+
referenceCount: count
|
|
702
|
+
}
|
|
703
|
+
) });
|
|
704
|
+
};
|
|
705
|
+
export {
|
|
706
|
+
TranslationsEdit as Component
|
|
707
|
+
};
|