@medusajs/dashboard 3.0.0-snapshot-20251212142124 → 3.0.0-snapshot-20251214110905

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.
Files changed (248) hide show
  1. package/dist/{add-campaign-promotions-JQKPED4U.mjs → add-campaign-promotions-PHAHMGXP.mjs} +2 -2
  2. package/dist/{adjust-inventory-2MFA656V.mjs → adjust-inventory-I5VYMAI4.mjs} +2 -2
  3. package/dist/{api-key-management-create-ZUVF3SLR.mjs → api-key-management-create-CVRFY4PL.mjs} +2 -2
  4. package/dist/{api-key-management-detail-F7ZRCFPA.mjs → api-key-management-detail-HRVP6HRC.mjs} +3 -3
  5. package/dist/{api-key-management-edit-42HNUSXL.mjs → api-key-management-edit-JMU3WEPX.mjs} +2 -2
  6. package/dist/{api-key-management-sales-channels-7FVABESO.mjs → api-key-management-sales-channels-4OU5VGIG.mjs} +2 -2
  7. package/dist/app.css +45 -0
  8. package/dist/app.js +13473 -12039
  9. package/dist/app.mjs +4 -4
  10. package/dist/{campaign-budget-edit-6DMZGUCI.mjs → campaign-budget-edit-B5MSE26J.mjs} +2 -2
  11. package/dist/{campaign-configuration-UNFRB5HR.mjs → campaign-configuration-QOE3D2BE.mjs} +2 -2
  12. package/dist/{campaign-create-QXG7PD3S.mjs → campaign-create-FJOECKGT.mjs} +3 -3
  13. package/dist/{campaign-detail-6VNSVZHQ.mjs → campaign-detail-BDI3P2SF.mjs} +3 -3
  14. package/dist/{campaign-edit-HN4US7DV.mjs → campaign-edit-K2POQH7M.mjs} +2 -2
  15. package/dist/{categories-metadata-ORPB2LIW.mjs → categories-metadata-BARTITD5.mjs} +6 -6
  16. package/dist/{category-create-FFIBWXAH.mjs → category-create-L2KJCHPO.mjs} +2 -2
  17. package/dist/{category-detail-RICXPIVS.mjs → category-detail-CUMEBNXU.mjs} +22 -7
  18. package/dist/{category-edit-74MZ6TXN.mjs → category-edit-U6SLZSAX.mjs} +2 -2
  19. package/dist/{category-list-AH2EGTI7.mjs → category-list-W7JW4PWA.mjs} +16 -1
  20. package/dist/{category-organize-B6EFBFKB.mjs → category-organize-LLSVAO3U.mjs} +2 -2
  21. package/dist/{category-products-L4XIX3IQ.mjs → category-products-GYXTDDBQ.mjs} +8 -8
  22. package/dist/{chunk-XTQ7UFA3.mjs → chunk-2HDKZN4Q.mjs} +1 -1
  23. package/dist/chunk-35LSPN2U.mjs +66 -0
  24. package/dist/{chunk-PNPT4W2F.mjs → chunk-3BJLNORD.mjs} +1 -1
  25. package/dist/{chunk-4G2UHUXX.mjs → chunk-67KHYLIQ.mjs} +9 -9
  26. package/dist/{chunk-AMOGGDOW.mjs → chunk-AIZ6W4QI.mjs} +1 -1
  27. package/dist/{chunk-EQBVGH3N.mjs → chunk-B3AOQW2B.mjs} +1 -1
  28. package/dist/{chunk-UKECZ5PA.mjs → chunk-BBTE6VKD.mjs} +3 -3
  29. package/dist/{chunk-3YPRDSZ6.mjs → chunk-BZKI5J2M.mjs} +1 -1
  30. package/dist/{chunk-25UWYEJX.mjs → chunk-CQOOXWPZ.mjs} +1 -1
  31. package/dist/{chunk-42OOM4DJ.mjs → chunk-D6UW7URG.mjs} +23 -6
  32. package/dist/{chunk-LHNU4DYZ.mjs → chunk-DS5IRNJY.mjs} +2 -2
  33. package/dist/{chunk-4VNR7DND.mjs → chunk-F5NZDW7L.mjs} +2 -2
  34. package/dist/{chunk-JJGE3EV6.mjs → chunk-F63F3FIT.mjs} +2 -2
  35. package/dist/{chunk-W7SLPIO2.mjs → chunk-FEB3ZGTL.mjs} +214 -17
  36. package/dist/{chunk-4YAPXPLM.mjs → chunk-FPBKWWSI.mjs} +1 -1
  37. package/dist/{chunk-EXDBX4YX.mjs → chunk-GC3QXC6D.mjs} +3 -3
  38. package/dist/{chunk-JUVGXLY5.mjs → chunk-HKKZJTRO.mjs} +188 -13
  39. package/dist/{chunk-EQTBJSBZ.mjs → chunk-KIIT4BNH.mjs} +3 -0
  40. package/dist/{chunk-KF7ZWW4K.mjs → chunk-LCEKY54O.mjs} +2 -2
  41. package/dist/{chunk-D4J3CEWH.mjs → chunk-N3SAXQVR.mjs} +2 -2
  42. package/dist/{chunk-Q6MSICBU.mjs → chunk-O333RR6K.mjs} +1 -1
  43. package/dist/{chunk-YV4ANEZF.mjs → chunk-PXZEQZ6Q.mjs} +1 -1
  44. package/dist/{chunk-Q4E6LV6K.mjs → chunk-Q4AXBDFH.mjs} +269 -182
  45. package/dist/{chunk-CZFLKMYE.mjs → chunk-RMDYKRWW.mjs} +4 -4
  46. package/dist/{chunk-GN6OCHP4.mjs → chunk-RU4ZS47V.mjs} +11 -1
  47. package/dist/{chunk-UM4OIJZ3.mjs → chunk-S22SJRPO.mjs} +1 -1
  48. package/dist/{chunk-HWKLNKOY.mjs → chunk-U726TGCM.mjs} +1 -1
  49. package/dist/{chunk-XXBP2Z5M.mjs → chunk-WVA4O7QS.mjs} +1 -1
  50. package/dist/{chunk-L4NOVTH5.mjs → chunk-YIOBBZUB.mjs} +2 -2
  51. package/dist/{chunk-FIFVOKTK.mjs → chunk-Z6NHG5LQ.mjs} +1 -1
  52. package/dist/{collection-add-products-MO4FGYD5.mjs → collection-add-products-4WBPS6PY.mjs} +8 -8
  53. package/dist/{collection-create-DCRW344Z.mjs → collection-create-4JX4YE47.mjs} +2 -2
  54. package/dist/{collection-detail-ZCHVPXW5.mjs → collection-detail-HT4SSV32.mjs} +22 -7
  55. package/dist/{collection-edit-UNFEW6HT.mjs → collection-edit-MXL35GQQ.mjs} +2 -2
  56. package/dist/{collection-list-3UUFO7AP.mjs → collection-list-FYONEBDN.mjs} +29 -14
  57. package/dist/{collection-metadata-ZOYQDOOT.mjs → collection-metadata-YEZ2TBRX.mjs} +6 -6
  58. package/dist/{customer-create-XCLZENJS.mjs → customer-create-IA56MXE6.mjs} +2 -2
  59. package/dist/{customer-create-address-4HZUIAM7.mjs → customer-create-address-27M25HTO.mjs} +2 -2
  60. package/dist/{customer-detail-RMZTHQIQ.mjs → customer-detail-MB7CS7OG.mjs} +6 -6
  61. package/dist/{customer-edit-BW5GVTQI.mjs → customer-edit-XQ5NWIVX.mjs} +2 -2
  62. package/dist/{customer-group-add-customers-HUGHHMU6.mjs → customer-group-add-customers-DM4VLTNB.mjs} +5 -5
  63. package/dist/{customer-group-create-6YV7W6TI.mjs → customer-group-create-RY4FVEIW.mjs} +2 -2
  64. package/dist/{customer-group-detail-4S7WB3WV.mjs → customer-group-detail-U5UAP7QS.mjs} +6 -6
  65. package/dist/{customer-group-edit-7NXU34BQ.mjs → customer-group-edit-MQWARIQZ.mjs} +2 -2
  66. package/dist/{customer-group-list-JQX6PW6E.mjs → customer-group-list-KAS6JSCQ.mjs} +3 -3
  67. package/dist/{customer-group-metadata-WK2BGEGO.mjs → customer-group-metadata-JQJRLLXG.mjs} +3 -3
  68. package/dist/{customer-metadata-ZUWCUTM7.mjs → customer-metadata-HN2DYD5I.mjs} +3 -3
  69. package/dist/{customers-add-customer-group-JKTM33OU.mjs → customers-add-customer-group-UKLSPYEU.mjs} +8 -8
  70. package/dist/{edit-inventory-item-Y5W6VTHJ.mjs → edit-inventory-item-RATTNP2Y.mjs} +2 -2
  71. package/dist/{edit-inventory-item-attributes-NAAZDFEJ.mjs → edit-inventory-item-attributes-JHH5GSNL.mjs} +2 -2
  72. package/dist/{edit-reservation-2UD4RZJX.mjs → edit-reservation-UZCSNLHY.mjs} +2 -2
  73. package/dist/{edit-rules-AXG2NQNS.mjs → edit-rules-VMEHCXYQ.mjs} +5 -5
  74. package/dist/en.json +34 -0
  75. package/dist/{inventory-create-6SKU4TZL.mjs → inventory-create-KN72V2KK.mjs} +6 -6
  76. package/dist/{inventory-detail-LAYYI2QT.mjs → inventory-detail-7OHCFAJO.mjs} +3 -3
  77. package/dist/{inventory-metadata-Q6E6SZF3.mjs → inventory-metadata-I3IRRMLH.mjs} +6 -6
  78. package/dist/{inventory-stock-SNAWXRBE.mjs → inventory-stock-5IUICNEH.mjs} +7 -7
  79. package/dist/{invite-VKHAAF4Z.mjs → invite-FVE4ZBKB.mjs} +2 -2
  80. package/dist/{location-create-RPLEXUZR.mjs → location-create-WZ43K3W7.mjs} +2 -2
  81. package/dist/{location-detail-XXH22FLG.mjs → location-detail-3MSUGB4W.mjs} +8 -8
  82. package/dist/{location-edit-L4ISEQHX.mjs → location-edit-VCS7GVWQ.mjs} +2 -2
  83. package/dist/{location-fulfillment-providers-FSC27EK7.mjs → location-fulfillment-providers-ZVZMLCIC.mjs} +6 -6
  84. package/dist/{location-list-Z42ZYHUF.mjs → location-list-KVBA6J47.mjs} +2 -2
  85. package/dist/{location-sales-channels-YMABMECM.mjs → location-sales-channels-NKNM5TQK.mjs} +2 -2
  86. package/dist/{location-service-zone-create-NSMZCD5N.mjs → location-service-zone-create-3FWF3DG5.mjs} +3 -3
  87. package/dist/{location-service-zone-edit-6OUAFEZD.mjs → location-service-zone-edit-KHHMSPXD.mjs} +2 -2
  88. package/dist/{location-service-zone-manage-areas-SEC6LKCZ.mjs → location-service-zone-manage-areas-YFEAZUUN.mjs} +3 -3
  89. package/dist/{location-service-zone-shipping-option-create-GWNLLSM5.mjs → location-service-zone-shipping-option-create-CZWEHKVJ.mjs} +7 -7
  90. package/dist/{location-service-zone-shipping-option-edit-QS6HTWST.mjs → location-service-zone-shipping-option-edit-4CGPQ3VT.mjs} +5 -5
  91. package/dist/{location-service-zone-shipping-option-pricing-23QLNSBT.mjs → location-service-zone-shipping-option-pricing-Z5IFOLFJ.mjs} +4 -4
  92. package/dist/{login-MFUCIAT6.mjs → login-OCYZM7SI.mjs} +5 -5
  93. package/dist/{manage-locations-JD6FSBOT.mjs → manage-locations-MLNMPQ5I.mjs} +2 -2
  94. package/dist/{order-allocate-items-3DDI4V3W.mjs → order-allocate-items-VRPPVPP3.mjs} +3 -3
  95. package/dist/{order-create-claim-G7BDA7WR.mjs → order-create-claim-O3ZYTAIC.mjs} +7 -7
  96. package/dist/{order-create-edit-BXYPZRZV.mjs → order-create-edit-HUS7IRS3.mjs} +6 -6
  97. package/dist/{order-create-exchange-AGEXEKOF.mjs → order-create-exchange-TUP4NHHX.mjs} +13 -13
  98. package/dist/{order-create-fulfillment-GMLSBCEK.mjs → order-create-fulfillment-4BGDYHBB.mjs} +5 -5
  99. package/dist/{order-create-refund-BT33POIN.mjs → order-create-refund-FA5ERI7M.mjs} +5 -5
  100. package/dist/{order-create-return-QGXWSPMP.mjs → order-create-return-7GPHJ2WU.mjs} +4 -4
  101. package/dist/{order-create-shipment-ZVTOKNC4.mjs → order-create-shipment-27UBYPKT.mjs} +5 -5
  102. package/dist/{order-detail-MORQRSHL.mjs → order-detail-2J7KDTKG.mjs} +11 -11
  103. package/dist/{order-edit-billing-address-IUVC4GSZ.mjs → order-edit-billing-address-E7CD5FBQ.mjs} +5 -5
  104. package/dist/{order-edit-email-MKLJPREH.mjs → order-edit-email-ELRIQYVN.mjs} +5 -5
  105. package/dist/{order-edit-shipping-address-GFSRTDFG.mjs → order-edit-shipping-address-HVNAJUZI.mjs} +5 -5
  106. package/dist/order-export-TRMFVBFO.mjs +121 -0
  107. package/dist/{order-list-QOYJFYD5.mjs → order-list-Y4FET3XV.mjs} +38 -82
  108. package/dist/{order-metadata-BRSYOGKE.mjs → order-metadata-THARHEJC.mjs} +6 -6
  109. package/dist/{order-receive-return-NI345L43.mjs → order-receive-return-X5ASB7DL.mjs} +6 -6
  110. package/dist/{order-request-transfer-ZGGIUFRV.mjs → order-request-transfer-PKF4ULJY.mjs} +5 -5
  111. package/dist/{price-list-configuration-CWTP3Y5X.mjs → price-list-configuration-SZRY7CXO.mjs} +4 -4
  112. package/dist/{price-list-create-HDYM5ZGW.mjs → price-list-create-TYNSJDDM.mjs} +15 -15
  113. package/dist/{price-list-detail-GVGNB5AY.mjs → price-list-detail-ORYFRNB6.mjs} +6 -6
  114. package/dist/{price-list-edit-SW7YIR3Z.mjs → price-list-edit-I5QNCWJP.mjs} +2 -2
  115. package/dist/{price-list-prices-add-P4XHE3F4.mjs → price-list-prices-add-MWAUNUBF.mjs} +10 -10
  116. package/dist/{price-list-prices-edit-C6SX2TLJ.mjs → price-list-prices-edit-Z4YJ4YBY.mjs} +4 -4
  117. package/dist/{product-attributes-AXSXHPI5.mjs → product-attributes-5QW6ZEYB.mjs} +6 -6
  118. package/dist/{product-create-CAGTWFTS.mjs → product-create-YQ76CEF3.mjs} +7 -7
  119. package/dist/{product-create-option-GEGQNSMQ.mjs → product-create-option-UMZKRNTC.mjs} +2 -2
  120. package/dist/{product-create-variant-5DLZZQPL.mjs → product-create-variant-IASRY2JX.mjs} +6 -6
  121. package/dist/{product-detail-FSORFVRL.mjs → product-detail-NVLJQGGK.mjs} +51 -10
  122. package/dist/{product-edit-EYQIREZ6.mjs → product-edit-DP42G3EU.mjs} +6 -6
  123. package/dist/{product-edit-option-HBIOBQTS.mjs → product-edit-option-ZMTSLRG5.mjs} +2 -2
  124. package/dist/{product-export-4XRDDWZQ.mjs → product-export-OK5FCD42.mjs} +15 -15
  125. package/dist/{product-image-variants-edit-KCFCTXE2.mjs → product-image-variants-edit-VEWNL52X.mjs} +5 -5
  126. package/dist/{product-import-JTEXWYY7.mjs → product-import-LX625CIX.mjs} +5 -5
  127. package/dist/{product-list-T4OZG4OC.mjs → product-list-TXEPE6NL.mjs} +19 -7
  128. package/dist/{product-media-EGK66SRX.mjs → product-media-ULNJ7JJY.mjs} +2 -2
  129. package/dist/{product-metadata-5BLG4EIR.mjs → product-metadata-ZKKBE6GG.mjs} +6 -6
  130. package/dist/{product-organization-BEXN2KXC.mjs → product-organization-NMA2WJNT.mjs} +6 -6
  131. package/dist/{product-prices-WQDE4XYT.mjs → product-prices-5WCCQDS6.mjs} +3 -3
  132. package/dist/{product-sales-channels-ZICOOOKY.mjs → product-sales-channels-2PN4L7II.mjs} +2 -2
  133. package/dist/{product-shipping-profile-KIDRTPWA.mjs → product-shipping-profile-45XXB7FM.mjs} +2 -2
  134. package/dist/{product-stock-SSJVQPBZ.mjs → product-stock-KUHH6MFA.mjs} +7 -7
  135. package/dist/{product-tag-create-ZPYRJTC4.mjs → product-tag-create-7EVRE5BL.mjs} +5 -5
  136. package/dist/{product-tag-detail-VRGVJNDT.mjs → product-tag-detail-WULO55NT.mjs} +31 -16
  137. package/dist/{product-tag-edit-2KFYOID4.mjs → product-tag-edit-J4ODRLXN.mjs} +5 -5
  138. package/dist/{product-tag-list-WTX6GV7O.mjs → product-tag-list-V4CCQTL6.mjs} +31 -16
  139. package/dist/{product-tag-metadata-Y7YHTUKM.mjs → product-tag-metadata-KHDYQMSG.mjs} +6 -6
  140. package/dist/{product-type-create-HBDROTGB.mjs → product-type-create-KHSNCQCV.mjs} +2 -2
  141. package/dist/{product-type-detail-3ZLSMENL.mjs → product-type-detail-F35MUSLD.mjs} +22 -7
  142. package/dist/{product-type-edit-H3JCMVRV.mjs → product-type-edit-3LRBWZ3S.mjs} +2 -2
  143. package/dist/{product-type-list-QX7QC6RI.mjs → product-type-list-K2GULUPF.mjs} +19 -4
  144. package/dist/{product-type-metadata-GJACA4N6.mjs → product-type-metadata-CGXFFEJO.mjs} +6 -6
  145. package/dist/{product-variant-detail-L5G4CPVH.mjs → product-variant-detail-NT2MB3Z4.mjs} +19 -4
  146. package/dist/{product-variant-edit-YXALQPQT.mjs → product-variant-edit-KZ6D5CSA.mjs} +5 -5
  147. package/dist/{product-variant-manage-inventory-items-BLHCH6QD.mjs → product-variant-manage-inventory-items-OGM64KYP.mjs} +2 -2
  148. package/dist/{product-variant-media-KLSUISGH.mjs → product-variant-media-C3KCFODU.mjs} +2 -2
  149. package/dist/{product-variant-metadata-OQOE34VY.mjs → product-variant-metadata-I2PN64TH.mjs} +6 -6
  150. package/dist/{profile-edit-5EEKOEO5.mjs → profile-edit-YZCUGEXF.mjs} +2 -2
  151. package/dist/{promotion-add-campaign-JRTM7WBR.mjs → promotion-add-campaign-DO67QK6M.mjs} +3 -3
  152. package/dist/{promotion-create-OXNLKBL7.mjs → promotion-create-4KVSXYAI.mjs} +12 -12
  153. package/dist/{promotion-detail-N6VHHN3X.mjs → promotion-detail-NGNVELME.mjs} +3 -3
  154. package/dist/{promotion-edit-details-AREFQ6O5.mjs → promotion-edit-details-6BSOOWQN.mjs} +2 -2
  155. package/dist/{refund-reason-create-L36EUXXM.mjs → refund-reason-create-CTAPBK3X.mjs} +5 -5
  156. package/dist/{refund-reason-edit-364ALB4G.mjs → refund-reason-edit-B6HRNXGE.mjs} +5 -5
  157. package/dist/{refund-reason-list-ICO2GYRP.mjs → refund-reason-list-7OUHUORB.mjs} +4 -4
  158. package/dist/{region-add-countries-AFWXMQ6W.mjs → region-add-countries-7U4J5RW6.mjs} +2 -2
  159. package/dist/{region-create-YC4VZ4AS.mjs → region-create-IUGX33M5.mjs} +2 -2
  160. package/dist/{region-edit-5GO25GDF.mjs → region-edit-WAU347DP.mjs} +2 -2
  161. package/dist/{region-metadata-VNLW6NYZ.mjs → region-metadata-GRG3QSJY.mjs} +6 -6
  162. package/dist/{reservation-create-Z2SUMBGT.mjs → reservation-create-C6HTEF3R.mjs} +2 -2
  163. package/dist/{reservation-detail-YXIUIN5I.mjs → reservation-detail-KAI7N5UP.mjs} +3 -3
  164. package/dist/{reservation-metadata-7H7TYWZW.mjs → reservation-metadata-TWV7KLOB.mjs} +6 -6
  165. package/dist/{reset-password-5TAYQEUV.mjs → reset-password-Y5WVXV4Q.mjs} +2 -2
  166. package/dist/{return-reason-create-NXWDC6AC.mjs → return-reason-create-HM54WRJY.mjs} +2 -2
  167. package/dist/{return-reason-edit-M6IKNNKB.mjs → return-reason-edit-VSIRHVQ6.mjs} +2 -2
  168. package/dist/return-reason-list-IFFIDA5O.mjs +1 -1
  169. package/dist/{sales-channel-add-products-N7EPWF2N.mjs → sales-channel-add-products-CBECZU46.mjs} +8 -8
  170. package/dist/{sales-channel-create-E7BDTPWD.mjs → sales-channel-create-4XLJDVJO.mjs} +2 -2
  171. package/dist/{sales-channel-detail-DV6BKC5B.mjs → sales-channel-detail-NQSBPPIE.mjs} +6 -6
  172. package/dist/{sales-channel-edit-HMPA3Y3L.mjs → sales-channel-edit-UZGSXD5X.mjs} +2 -2
  173. package/dist/{sales-channel-list-33QC2ZXP.mjs → sales-channel-list-UYN2OCBR.mjs} +3 -3
  174. package/dist/{sales-channel-metadata-HYYQEVRZ.mjs → sales-channel-metadata-4XWXYN2E.mjs} +6 -6
  175. package/dist/{shipping-option-type-create-IXYDKBKG.mjs → shipping-option-type-create-U7PIKVMV.mjs} +5 -5
  176. package/dist/{shipping-option-type-detail-WMZ3DEY6.mjs → shipping-option-type-detail-QNZLQGI6.mjs} +4 -4
  177. package/dist/{shipping-option-type-edit-YYO3Q2QV.mjs → shipping-option-type-edit-BP6HLZ7B.mjs} +5 -5
  178. package/dist/{shipping-option-type-list-YAL6IQF2.mjs → shipping-option-type-list-L274RM6A.mjs} +4 -4
  179. package/dist/{shipping-profile-create-752TMBBE.mjs → shipping-profile-create-26R64I3Z.mjs} +2 -2
  180. package/dist/{shipping-profile-metadata-YBXPOVZF.mjs → shipping-profile-metadata-BZKPLXHO.mjs} +6 -6
  181. package/dist/{store-add-currencies-3VMLZ6KB.mjs → store-add-currencies-ZFS3WZHG.mjs} +2 -2
  182. package/dist/{store-add-locales-AYY44DB3.mjs → store-add-locales-EXR3NLOM.mjs} +4 -4
  183. package/dist/{store-detail-4YVABC3P.mjs → store-detail-T4YY5NHG.mjs} +3 -3
  184. package/dist/{store-edit-EPAHLLKP.mjs → store-edit-AB5CDUTK.mjs} +2 -2
  185. package/dist/{store-metadata-QQD2NP5U.mjs → store-metadata-FN3WZLXA.mjs} +6 -6
  186. package/dist/{tax-region-create-AFGAIC3C.mjs → tax-region-create-PWXTFE3Q.mjs} +5 -5
  187. package/dist/{tax-region-detail-LM7VIA2N.mjs → tax-region-detail-GJW63AMV.mjs} +22 -22
  188. package/dist/{tax-region-edit-ZLSY22NQ.mjs → tax-region-edit-WOUO7TPQ.mjs} +5 -5
  189. package/dist/{tax-region-list-BXZBUXRJ.mjs → tax-region-list-P4LDOPZD.mjs} +3 -3
  190. package/dist/{tax-region-province-create-5JP3PVID.mjs → tax-region-province-create-GKJ7WMRS.mjs} +2 -2
  191. package/dist/{tax-region-province-detail-ZF75A3Z2.mjs → tax-region-province-detail-FCHPIRXW.mjs} +21 -21
  192. package/dist/{tax-region-tax-override-create-JVMTMMWB.mjs → tax-region-tax-override-create-ZLWXRNLN.mjs} +16 -16
  193. package/dist/{tax-region-tax-override-edit-HS4BCVC7.mjs → tax-region-tax-override-edit-ZM2JUFNJ.mjs} +17 -17
  194. package/dist/{tax-region-tax-rate-create-O2SDSXCH.mjs → tax-region-tax-rate-create-MECFGVPL.mjs} +2 -2
  195. package/dist/{tax-region-tax-rate-edit-W62VEVKT.mjs → tax-region-tax-rate-edit-7DYSPYOD.mjs} +2 -2
  196. package/dist/translation-list-Y2GWTRGW.mjs +302 -0
  197. package/dist/translations-edit-PM4PSMRF.mjs +390 -0
  198. package/dist/{user-edit-LXQCTDGA.mjs → user-edit-ZBB4RMTP.mjs} +2 -2
  199. package/dist/{user-invite-2OKB7SCF.mjs → user-invite-XB635N26.mjs} +2 -2
  200. package/dist/{user-metadata-U3WGLABX.mjs → user-metadata-LNADHFTW.mjs} +6 -6
  201. package/dist/{workflow-execution-detail-L4IESFKA.mjs → workflow-execution-detail-POTSURJX.mjs} +4 -4
  202. package/package.json +9 -9
  203. package/src/components/common/icon-avatar/icon-avatar.tsx +4 -0
  204. package/src/components/data-grid/components/data-grid-textarea-modal-cell.tsx +233 -0
  205. package/src/components/data-grid/components/index.ts +1 -0
  206. package/src/components/data-grid/data-grid.tsx +2 -0
  207. package/src/components/layout/settings-layout/settings-layout.tsx +11 -1
  208. package/src/components/modals/route-focus-modal/route-focus-modal.tsx +8 -3
  209. package/src/components/modals/route-modal-form/route-modal-form.tsx +6 -1
  210. package/src/components/modals/route-modal-provider/route-provider.tsx +16 -4
  211. package/src/dashboard-app/routes/get-route.map.tsx +25 -0
  212. package/src/hooks/api/index.ts +1 -0
  213. package/src/hooks/api/orders.tsx +18 -1
  214. package/src/hooks/api/product-variants.tsx +7 -1
  215. package/src/hooks/api/translations.tsx +254 -0
  216. package/src/i18n/translations/$schema.json +104 -0
  217. package/src/i18n/translations/en.json +34 -0
  218. package/src/i18n/translations/es.json +22 -0
  219. package/src/routes/categories/category-detail/components/category-general-section/category-general-section.tsx +16 -1
  220. package/src/routes/categories/category-list/components/category-list-table/category-list-table.tsx +16 -1
  221. package/src/routes/collections/collection-detail/components/collection-general-section/collection-general-section.tsx +16 -1
  222. package/src/routes/collections/collection-list/components/collection-list-table/collection-row-actions.tsx +16 -1
  223. package/src/routes/orders/order-export/components/export-filters.tsx +22 -0
  224. package/src/routes/orders/order-export/index.ts +1 -0
  225. package/src/routes/orders/order-export/order-export.tsx +66 -0
  226. package/src/routes/orders/order-list/components/order-list-table/configurable-order-list-table.tsx +14 -6
  227. package/src/routes/orders/order-list/components/order-list-table/order-list-table.tsx +8 -2
  228. package/src/routes/product-tags/product-tag-detail/components/product-tag-general-section/product-tag-general-section.tsx +16 -1
  229. package/src/routes/product-tags/product-tag-list/components/product-tag-list-table/product-tag-list-table.tsx +16 -1
  230. package/src/routes/product-types/product-type-detail/components/product-type-general-section/product-type-general-section.tsx +16 -1
  231. package/src/routes/product-types/product-type-list/components/product-type-list-table/product-table-row-actions.tsx +16 -1
  232. package/src/routes/product-variants/product-variant-detail/components/variant-general-section/variant-general-section.tsx +16 -1
  233. package/src/routes/products/product-detail/components/product-general-section/product-general-section.tsx +16 -1
  234. package/src/routes/products/product-detail/components/product-variant-section/product-variant-section.tsx +32 -1
  235. package/src/routes/products/product-list/components/product-list-table/product-list-table.tsx +15 -1
  236. package/src/routes/translations/translation-list/components/active-locales-section/active-locales-section.tsx +68 -0
  237. package/src/routes/translations/translation-list/components/translation-list-section/translation-list-section.tsx +46 -0
  238. package/src/routes/translations/translation-list/components/translations-completion-section/translations-completion-section.tsx +67 -0
  239. package/src/routes/translations/translation-list/index.tsx +1 -0
  240. package/src/routes/translations/translation-list/translation-list.tsx +128 -0
  241. package/src/routes/translations/translations-edit/components/translations-edit-form/index.ts +1 -0
  242. package/src/routes/translations/translations-edit/components/translations-edit-form/translations-edit-form.tsx +423 -0
  243. package/src/routes/translations/translations-edit/index.ts +1 -0
  244. package/src/routes/translations/translations-edit/translations-edit.tsx +67 -0
  245. package/src/routes/translations/translations-edit/utils/index.ts +1 -0
  246. package/src/routes/translations/translations-edit/utils/reference-label-map.ts +10 -0
  247. package/dist/{customer-list-ZXCGIXJC.mjs → customer-list-TG4D4QOT.mjs} +3 -3
  248. package/dist/{region-list-XQRIBDMF.mjs → region-list-JAQXIBYD.mjs} +3 -3
@@ -0,0 +1,302 @@
1
+ import {
2
+ IconAvatar
3
+ } from "./chunk-KIIT4BNH.mjs";
4
+ import {
5
+ TwoColumnPage
6
+ } from "./chunk-GIZFNLKK.mjs";
7
+ import {
8
+ TwoColumnPageSkeleton
9
+ } from "./chunk-LPEUYMRK.mjs";
10
+ import "./chunk-HKKZJTRO.mjs";
11
+ import "./chunk-I4OBEAOJ.mjs";
12
+ import "./chunk-HI6URQ7H.mjs";
13
+ import "./chunk-6CLQKVAU.mjs";
14
+ import "./chunk-KI7TOXBR.mjs";
15
+ import "./chunk-HKIF5HVL.mjs";
16
+ import "./chunk-XIVBRONM.mjs";
17
+ import "./chunk-WAXMT4IY.mjs";
18
+ import "./chunk-DYDGGABK.mjs";
19
+ import "./chunk-LGNTHZ5Y.mjs";
20
+ import "./chunk-CN7JXSGW.mjs";
21
+ import "./chunk-5BQQRHQS.mjs";
22
+ import "./chunk-Y5UO73CH.mjs";
23
+ import "./chunk-5AFMB7XQ.mjs";
24
+ import "./chunk-NHDFPGQ3.mjs";
25
+ import "./chunk-A63RZVX6.mjs";
26
+ import "./chunk-HBXV7ENS.mjs";
27
+ import "./chunk-CDORR33H.mjs";
28
+ import "./chunk-RU4ZS47V.mjs";
29
+ import "./chunk-N4O5FAUC.mjs";
30
+ import "./chunk-7AX6R6G6.mjs";
31
+ import "./chunk-N3FCYZV6.mjs";
32
+ import "./chunk-3BF5SC66.mjs";
33
+ import {
34
+ useStore
35
+ } from "./chunk-VCSSQVPD.mjs";
36
+ import "./chunk-HP2JH45P.mjs";
37
+ import "./chunk-SQDIZZDW.mjs";
38
+ import "./chunk-LEJUZW3P.mjs";
39
+ import "./chunk-FXYH54JP.mjs";
40
+ import "./chunk-774WSTCC.mjs";
41
+ import "./chunk-NFEK63OE.mjs";
42
+ import "./chunk-QZ7TP4HQ.mjs";
43
+
44
+ // src/routes/translations/translation-list/translation-list.tsx
45
+ import { Container as Container4, Heading as Heading3, Text as Text4 } from "@medusajs/ui";
46
+ import { useTranslation as useTranslation3 } from "react-i18next";
47
+ import { Buildings } from "@medusajs/icons";
48
+
49
+ // src/routes/translations/translation-list/components/active-locales-section/active-locales-section.tsx
50
+ import { PencilSquare, Text as TextIcon } from "@medusajs/icons";
51
+ import { Container, Heading, IconButton, InlineTip, Text } from "@medusajs/ui";
52
+ import { useTranslation } from "react-i18next";
53
+ import { useCallback } from "react";
54
+ import { useNavigate } from "react-router-dom";
55
+ import { jsx, jsxs } from "react/jsx-runtime";
56
+ var ActiveLocalesSection = ({
57
+ locales
58
+ }) => {
59
+ const { t } = useTranslation();
60
+ const navigate = useNavigate();
61
+ const handleManageLocales = useCallback(() => {
62
+ navigate("/settings/store/locales");
63
+ }, [navigate]);
64
+ const renderLocales = useCallback(() => {
65
+ const maxLocalesToDetail = 2;
66
+ if (locales.length <= maxLocalesToDetail) {
67
+ return locales.map((locale) => locale.name).join(", ");
68
+ }
69
+ return `${locales.slice(0, maxLocalesToDetail).map((locale) => locale.name).join(", ")} + ${locales.length - maxLocalesToDetail}`;
70
+ }, [locales]);
71
+ const hasLocales = locales.length > 0;
72
+ return /* @__PURE__ */ jsxs(Container, { className: "flex flex-col p-0", children: [
73
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-6 py-4", children: [
74
+ /* @__PURE__ */ jsx(Heading, { children: t("translations.activeLocales.heading") }),
75
+ /* @__PURE__ */ jsx(IconButton, { variant: "transparent", onClick: handleManageLocales, children: /* @__PURE__ */ jsx(PencilSquare, {}) })
76
+ ] }),
77
+ /* @__PURE__ */ jsx("div", { className: "px-1 pb-1", children: hasLocales ? /* @__PURE__ */ jsxs(Container, { className: "bg-ui-bg-component flex items-center gap-x-4 px-6 py-2", children: [
78
+ /* @__PURE__ */ jsx(IconAvatar, { children: /* @__PURE__ */ jsx(TextIcon, {}) }),
79
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
80
+ /* @__PURE__ */ jsx(Text, { size: "small", weight: "plus", children: t("translations.activeLocales.subtitle") }),
81
+ /* @__PURE__ */ jsx(Text, { className: "text-ui-fg-subtle", size: "small", children: renderLocales() })
82
+ ] })
83
+ ] }) : /* @__PURE__ */ jsx(InlineTip, { label: "Tip", children: t("translations.activeLocales.noLocalesTip") }) })
84
+ ] });
85
+ };
86
+
87
+ // src/routes/translations/translation-list/components/translation-list-section/translation-list-section.tsx
88
+ import { Button, Container as Container2, Text as Text2 } from "@medusajs/ui";
89
+ import { Link } from "react-router-dom";
90
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
91
+ var TranslationListSection = ({
92
+ entities,
93
+ hasLocales = false
94
+ }) => {
95
+ return /* @__PURE__ */ jsx2(Container2, { className: "divide-y p-0", children: entities.map((entity) => /* @__PURE__ */ jsxs2(
96
+ "div",
97
+ {
98
+ className: "grid grid-cols-[250px_1fr_auto] items-center gap-x-4 px-6 py-4",
99
+ children: [
100
+ /* @__PURE__ */ jsx2(Text2, { size: "small", weight: "plus", children: entity.label }),
101
+ /* @__PURE__ */ jsxs2(Text2, { size: "small", className: "text-ui-fg-subtle", children: [
102
+ (entity.translatedCount ?? 0).toLocaleString(),
103
+ " of",
104
+ " ",
105
+ (entity.totalCount ?? 0).toLocaleString(),
106
+ " fields translated"
107
+ ] }),
108
+ /* @__PURE__ */ jsx2(
109
+ Link,
110
+ {
111
+ to: `/settings/translations/edit?reference=${entity.reference}`,
112
+ children: /* @__PURE__ */ jsx2(Button, { variant: "secondary", size: "small", disabled: !hasLocales, children: "Edit" })
113
+ }
114
+ )
115
+ ]
116
+ },
117
+ entity.reference
118
+ )) });
119
+ };
120
+
121
+ // src/routes/translations/translation-list/components/translations-completion-section/translations-completion-section.tsx
122
+ import { Container as Container3, Heading as Heading2, Text as Text3 } from "@medusajs/ui";
123
+ import { useTranslation as useTranslation2 } from "react-i18next";
124
+ import { Fragment, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
125
+ var TranslationsCompletionSection = ({
126
+ translatedCount = 0,
127
+ totalCount = 0
128
+ }) => {
129
+ const { t } = useTranslation2();
130
+ const percentage = totalCount > 0 ? translatedCount / totalCount * 100 : 0;
131
+ const remaining = Math.max(0, totalCount - translatedCount);
132
+ return /* @__PURE__ */ jsxs3(Container3, { className: "flex flex-col gap-y-3 px-6 py-4", children: [
133
+ /* @__PURE__ */ jsxs3("div", { className: "flex items-center justify-between", children: [
134
+ /* @__PURE__ */ jsx3(Heading2, { children: t("translations.completion.heading") }),
135
+ /* @__PURE__ */ jsxs3(Text3, { size: "small", className: "text-ui-fg-subtle", children: [
136
+ translatedCount.toLocaleString(),
137
+ " ",
138
+ t("general.of"),
139
+ " ",
140
+ totalCount.toLocaleString()
141
+ ] })
142
+ ] }),
143
+ /* @__PURE__ */ jsx3("div", { className: "flex h-2 w-full overflow-hidden rounded-full", children: percentage > 0 ? /* @__PURE__ */ jsxs3(Fragment, { children: [
144
+ /* @__PURE__ */ jsx3(
145
+ "div",
146
+ {
147
+ className: "mr-0.5 h-full rounded-l-full transition-all",
148
+ style: {
149
+ width: `${percentage}%`,
150
+ backgroundColor: "var(--bg-interactive)"
151
+ }
152
+ }
153
+ ),
154
+ /* @__PURE__ */ jsx3(
155
+ "div",
156
+ {
157
+ className: "h-full flex-1 rounded-r-full",
158
+ style: {
159
+ backgroundColor: "var(--bg-interactive)",
160
+ opacity: 0.3
161
+ }
162
+ }
163
+ )
164
+ ] }) : /* @__PURE__ */ jsx3(
165
+ "div",
166
+ {
167
+ className: "h-full w-full rounded-full",
168
+ style: {
169
+ backgroundColor: "var(--bg-interactive)",
170
+ opacity: 0.3
171
+ }
172
+ }
173
+ ) }),
174
+ /* @__PURE__ */ jsxs3("div", { className: "flex items-center justify-between", children: [
175
+ /* @__PURE__ */ jsxs3(Text3, { size: "small", className: "text-ui-fg-subtle", children: [
176
+ percentage.toFixed(1),
177
+ "%"
178
+ ] }),
179
+ /* @__PURE__ */ jsxs3(Text3, { size: "small", className: "text-ui-fg-subtle", children: [
180
+ remaining.toLocaleString(),
181
+ " ",
182
+ t("general.remaining").toLowerCase()
183
+ ] })
184
+ ] })
185
+ ] });
186
+ };
187
+
188
+ // src/routes/translations/translation-list/translation-list.tsx
189
+ import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
190
+ var TRANSLATABLE_ENTITIES = [
191
+ {
192
+ icon: /* @__PURE__ */ jsx4(Buildings, {}),
193
+ label: "Product",
194
+ reference: "product",
195
+ translatedCount: 4,
196
+ totalCount: 96
197
+ },
198
+ {
199
+ icon: /* @__PURE__ */ jsx4(Buildings, {}),
200
+ label: "Product Variants",
201
+ reference: "product_variant",
202
+ translatedCount: 4,
203
+ totalCount: 2e5
204
+ },
205
+ {
206
+ icon: /* @__PURE__ */ jsx4(Buildings, {}),
207
+ label: "Product Categories",
208
+ reference: "product_category",
209
+ translatedCount: 96,
210
+ totalCount: 96
211
+ },
212
+ {
213
+ icon: /* @__PURE__ */ jsx4(Buildings, {}),
214
+ label: "Product Collections",
215
+ reference: "product_collection",
216
+ translatedCount: 4,
217
+ totalCount: 96
218
+ },
219
+ {
220
+ icon: /* @__PURE__ */ jsx4(Buildings, {}),
221
+ label: "Product Types",
222
+ reference: "product_type",
223
+ translatedCount: 4,
224
+ totalCount: 96
225
+ },
226
+ {
227
+ icon: /* @__PURE__ */ jsx4(Buildings, {}),
228
+ label: "Product Tags",
229
+ reference: "product_tag",
230
+ translatedCount: 96,
231
+ totalCount: 96
232
+ },
233
+ {
234
+ icon: /* @__PURE__ */ jsx4(Buildings, {}),
235
+ label: "Product Options",
236
+ reference: "product_option",
237
+ translatedCount: 96,
238
+ totalCount: 96
239
+ },
240
+ {
241
+ icon: /* @__PURE__ */ jsx4(Buildings, {}),
242
+ label: "Product Option Values",
243
+ reference: "product_option_value",
244
+ translatedCount: 96,
245
+ totalCount: 96
246
+ }
247
+ ];
248
+ var TranslationList = () => {
249
+ const { t } = useTranslation3();
250
+ const { store, isPending, isError, error } = useStore();
251
+ if (isError) {
252
+ throw error;
253
+ }
254
+ const isReady = !!store && !isPending;
255
+ if (!isReady) {
256
+ return /* @__PURE__ */ jsx4(TwoColumnPageSkeleton, { sidebarSections: 2 });
257
+ }
258
+ const hasLocales = (store?.supported_locales ?? []).length > 0;
259
+ return /* @__PURE__ */ jsxs4(
260
+ TwoColumnPage,
261
+ {
262
+ widgets: {
263
+ before: [],
264
+ after: [],
265
+ sideBefore: [],
266
+ sideAfter: []
267
+ },
268
+ children: [
269
+ /* @__PURE__ */ jsxs4(TwoColumnPage.Main, { children: [
270
+ /* @__PURE__ */ jsxs4(Container4, { className: "flex flex-col px-6 py-4", children: [
271
+ /* @__PURE__ */ jsxs4(Heading3, { children: [
272
+ "Manage ",
273
+ t("translations.domain")
274
+ ] }),
275
+ /* @__PURE__ */ jsx4(Text4, { className: "text-ui-fg-subtle", size: "small", children: t("translations.subtitle") })
276
+ ] }),
277
+ /* @__PURE__ */ jsx4(
278
+ TranslationListSection,
279
+ {
280
+ entities: TRANSLATABLE_ENTITIES,
281
+ hasLocales
282
+ }
283
+ )
284
+ ] }),
285
+ /* @__PURE__ */ jsxs4(TwoColumnPage.Sidebar, { children: [
286
+ /* @__PURE__ */ jsx4(
287
+ ActiveLocalesSection,
288
+ {
289
+ locales: store?.supported_locales?.map(
290
+ (suportedLocale) => suportedLocale.locale
291
+ ) ?? []
292
+ }
293
+ ),
294
+ /* @__PURE__ */ jsx4(TranslationsCompletionSection, {})
295
+ ] })
296
+ ]
297
+ }
298
+ );
299
+ };
300
+ export {
301
+ TranslationList as Component
302
+ };
@@ -0,0 +1,390 @@
1
+ import {
2
+ DataGrid,
3
+ createDataGridHelper
4
+ } from "./chunk-FEB3ZGTL.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 {
21
+ useDocumentDirection
22
+ } from "./chunk-S4DMV3ZT.mjs";
23
+ import "./chunk-OBQI23QM.mjs";
24
+ import {
25
+ useBatchTranslations,
26
+ useReferenceTranslations
27
+ } from "./chunk-HKKZJTRO.mjs";
28
+ import "./chunk-I4OBEAOJ.mjs";
29
+ import "./chunk-HI6URQ7H.mjs";
30
+ import "./chunk-6CLQKVAU.mjs";
31
+ import "./chunk-KI7TOXBR.mjs";
32
+ import "./chunk-HKIF5HVL.mjs";
33
+ import "./chunk-XIVBRONM.mjs";
34
+ import "./chunk-WAXMT4IY.mjs";
35
+ import "./chunk-DYDGGABK.mjs";
36
+ import "./chunk-LGNTHZ5Y.mjs";
37
+ import "./chunk-CN7JXSGW.mjs";
38
+ import "./chunk-5BQQRHQS.mjs";
39
+ import "./chunk-Y5UO73CH.mjs";
40
+ import "./chunk-5AFMB7XQ.mjs";
41
+ import "./chunk-NHDFPGQ3.mjs";
42
+ import "./chunk-A63RZVX6.mjs";
43
+ import "./chunk-HBXV7ENS.mjs";
44
+ import "./chunk-CDORR33H.mjs";
45
+ import "./chunk-RU4ZS47V.mjs";
46
+ import "./chunk-N4O5FAUC.mjs";
47
+ import "./chunk-7AX6R6G6.mjs";
48
+ import "./chunk-N3FCYZV6.mjs";
49
+ import "./chunk-3BF5SC66.mjs";
50
+ import {
51
+ useStore
52
+ } from "./chunk-VCSSQVPD.mjs";
53
+ import "./chunk-HP2JH45P.mjs";
54
+ import "./chunk-SQDIZZDW.mjs";
55
+ import "./chunk-LEJUZW3P.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, ProgressTabs, toast } from "@medusajs/ui";
67
+ import { useMemo, useRef } from "react";
68
+ import { useForm } from "react-hook-form";
69
+ import { useTranslation } from "react-i18next";
70
+ import { z } from "zod";
71
+
72
+ // src/routes/translations/translations-edit/utils/reference-label-map.ts
73
+ var REFERENCE_LABEL_MAP = {
74
+ product: "Products",
75
+ product_variant: "Product Variants",
76
+ product_category: "Product Categories",
77
+ product_collection: "Product Collections",
78
+ product_type: "Product Types",
79
+ product_tag: "Product Tags",
80
+ product_option: "Product Options",
81
+ product_option_value: "Product Option Values"
82
+ };
83
+
84
+ // src/routes/translations/translations-edit/components/translations-edit-form/translations-edit-form.tsx
85
+ import { jsx, jsxs } from "react/jsx-runtime";
86
+ var LocaleTranslationSchema = z.object({
87
+ id: z.string().nullish(),
88
+ locale_code: z.string(),
89
+ fields: z.record(z.string().optional())
90
+ });
91
+ var EntityTranslationsSchema = z.object({
92
+ locales: z.record(LocaleTranslationSchema)
93
+ });
94
+ var TranslationsFormSchema = z.object({
95
+ entities: z.record(EntityTranslationsSchema)
96
+ });
97
+ function isEntityRow(row) {
98
+ return row._type === "entity";
99
+ }
100
+ function initTranslationsFormState(translations, references, availableLocales, translatableFields) {
101
+ const existingMap = /* @__PURE__ */ new Map();
102
+ for (const t of translations) {
103
+ existingMap.set(`${t.reference_id}:${t.locale_code}`, t);
104
+ }
105
+ const entitiesTranslationState = {};
106
+ for (const reference of references) {
107
+ const locales = {};
108
+ for (const locale of availableLocales) {
109
+ const key = `${reference.id}:${locale.locale_code}`;
110
+ const existing = existingMap.get(key);
111
+ const isDefaultLocale = locale.is_default;
112
+ const fields = {};
113
+ for (const fieldName of translatableFields) {
114
+ const fieldValue = isDefaultLocale ? existing?.translations?.[fieldName] ?? reference[fieldName] : existing?.translations?.[fieldName] ?? "";
115
+ fields[fieldName] = fieldValue;
116
+ }
117
+ locales[locale.locale_code] = {
118
+ id: existing?.id ?? null,
119
+ locale_code: locale.locale_code,
120
+ fields
121
+ };
122
+ }
123
+ entitiesTranslationState[reference.id] = { locales };
124
+ }
125
+ return {
126
+ entities: entitiesTranslationState
127
+ };
128
+ }
129
+ function buildTranslationRows(references, availableLocales, translations) {
130
+ const existingMap = /* @__PURE__ */ new Map();
131
+ for (const t of translations) {
132
+ existingMap.set(`${t.reference_id}:${t.locale_code}`, t);
133
+ }
134
+ return references.map((reference) => ({
135
+ _type: "entity",
136
+ reference_id: reference.id,
137
+ subRows: availableLocales.map((locale) => {
138
+ const key = `${reference.id}:${locale.locale_code}`;
139
+ const existing = existingMap.get(key);
140
+ return {
141
+ _type: "locale",
142
+ reference_id: reference.id,
143
+ locale_code: locale.locale_code,
144
+ locale_name: locale.locale.name,
145
+ id: existing?.id
146
+ };
147
+ })
148
+ }));
149
+ }
150
+ function transformToBatchPayload(currentState, initialState, entityType) {
151
+ const payload = {
152
+ create: [],
153
+ update: [],
154
+ delete: []
155
+ };
156
+ for (const [entityId, entityData] of Object.entries(currentState.entities)) {
157
+ for (const [localeCode, localeTranslations] of Object.entries(
158
+ entityData.locales
159
+ )) {
160
+ const initial = initialState.entities[entityId]?.locales[localeCode];
161
+ const hasContent = Object.values(localeTranslations.fields).some(
162
+ (v) => v !== void 0 && v.trim() !== ""
163
+ );
164
+ const hadContent = initial && Object.values(initial.fields).some(
165
+ (v) => v !== void 0 && v.trim() !== ""
166
+ );
167
+ if (!localeTranslations.id && hasContent) {
168
+ payload.create.push({
169
+ reference_id: entityId,
170
+ reference: entityType,
171
+ locale_code: localeTranslations.locale_code,
172
+ translations: localeTranslations.fields
173
+ });
174
+ } else if (localeTranslations.id && hasContent) {
175
+ const hasChanged = !initial || JSON.stringify(localeTranslations.fields) !== JSON.stringify(initial.fields);
176
+ if (hasChanged) {
177
+ payload.update.push({
178
+ id: localeTranslations.id,
179
+ translations: localeTranslations.fields
180
+ });
181
+ }
182
+ } else if (localeTranslations.id && !hasContent && hadContent) {
183
+ payload.delete.push(localeTranslations.id);
184
+ }
185
+ }
186
+ }
187
+ return payload;
188
+ }
189
+ var columnHelper = createDataGridHelper();
190
+ function useTranslationsGridColumns({
191
+ translatableFields,
192
+ modalFields = []
193
+ }) {
194
+ const { t } = useTranslation();
195
+ const columns = useMemo(() => {
196
+ return [
197
+ columnHelper.column({
198
+ id: "locale",
199
+ header: t("translations.bulk.mainColumn"),
200
+ cell: (context) => {
201
+ const row = context.row.original;
202
+ if (isEntityRow(row)) {
203
+ return /* @__PURE__ */ jsx(DataGrid.ReadonlyCell, { context });
204
+ }
205
+ 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("span", { className: "truncate", children: row.locale_name }) }) });
206
+ },
207
+ disableHiding: true
208
+ }),
209
+ ...translatableFields.map((fieldName) => {
210
+ const useModal = modalFields.includes(fieldName);
211
+ return columnHelper.column({
212
+ id: fieldName,
213
+ header: t(`fields.${fieldName}`, { defaultValue: fieldName }),
214
+ cell: (context) => {
215
+ const row = context.row.original;
216
+ if (isEntityRow(row)) {
217
+ return /* @__PURE__ */ jsx(DataGrid.ReadonlyCell, { context, children: /* @__PURE__ */ jsx("span", { className: "text-ui-fg-muted", children: "\u2014" }) });
218
+ }
219
+ if (useModal) {
220
+ return /* @__PURE__ */ jsx(
221
+ DataGrid.ExpandableTextCell,
222
+ {
223
+ context,
224
+ fieldLabel: fieldName
225
+ }
226
+ );
227
+ }
228
+ return /* @__PURE__ */ jsx(DataGrid.TextCell, { context });
229
+ },
230
+ field: (context) => {
231
+ const row = context.row.original;
232
+ if (isEntityRow(row)) {
233
+ return null;
234
+ }
235
+ return `entities.${row.reference_id}.locales.${row.locale_code}.fields.${fieldName}`;
236
+ },
237
+ type: "text"
238
+ });
239
+ })
240
+ ];
241
+ }, [t, translatableFields, modalFields]);
242
+ return columns;
243
+ }
244
+ var TranslationsEditForm = ({
245
+ translations,
246
+ references,
247
+ entityType,
248
+ availableLocales,
249
+ translatableFields,
250
+ modalFields = []
251
+ }) => {
252
+ const { t } = useTranslation();
253
+ const { handleSuccess, setCloseOnEscape } = useRouteModal();
254
+ const direction = useDocumentDirection();
255
+ const entities = useMemo(() => references, [references]);
256
+ const initialState = useRef(
257
+ initTranslationsFormState(
258
+ translations,
259
+ entities,
260
+ availableLocales,
261
+ translatableFields
262
+ )
263
+ );
264
+ const form = useForm({
265
+ resolver: zodResolver(TranslationsFormSchema),
266
+ defaultValues: initialState.current
267
+ });
268
+ const rows = useMemo(
269
+ () => buildTranslationRows(entities, availableLocales, translations),
270
+ [entities, availableLocales, translations]
271
+ );
272
+ const { mutateAsync, isPending } = useBatchTranslations(entityType);
273
+ const handleSubmit = form.handleSubmit(async (values) => {
274
+ const payload = transformToBatchPayload(
275
+ values,
276
+ initialState.current,
277
+ entityType
278
+ );
279
+ if (payload.create.length === 0 && payload.update.length === 0 && payload.delete.length === 0) {
280
+ toast.info(
281
+ t("translations.noChanges", { defaultValue: "No changes to save" })
282
+ );
283
+ return;
284
+ }
285
+ await mutateAsync(payload, {
286
+ onSuccess: () => {
287
+ toast.success(
288
+ t("translations.edit.successToast", {
289
+ defaultValue: "Translations updated successfully"
290
+ })
291
+ );
292
+ handleSuccess();
293
+ },
294
+ onError: (error) => {
295
+ toast.error(error.message);
296
+ }
297
+ });
298
+ });
299
+ const columns = useTranslationsGridColumns({
300
+ translatableFields,
301
+ modalFields
302
+ });
303
+ return /* @__PURE__ */ jsx(RouteFocusModal.Form, { form, children: /* @__PURE__ */ jsx(KeyboundForm, { onSubmit: handleSubmit, className: "flex h-full flex-col", children: /* @__PURE__ */ jsxs(
304
+ ProgressTabs,
305
+ {
306
+ dir: direction,
307
+ defaultValue: entityType,
308
+ className: "flex h-full flex-col overflow-hidden",
309
+ children: [
310
+ /* @__PURE__ */ jsx(RouteFocusModal.Header, { children: /* @__PURE__ */ jsx("div", { className: "-my-2 w-full border-l", children: /* @__PURE__ */ jsx(ProgressTabs.List, { className: "justify-start-start flex w-full items-center", children: /* @__PURE__ */ jsx(ProgressTabs.Trigger, { value: entityType, children: REFERENCE_LABEL_MAP[entityType] }) }) }) }),
311
+ /* @__PURE__ */ jsx(RouteFocusModal.Body, { className: "size-full overflow-hidden", children: /* @__PURE__ */ jsx(
312
+ ProgressTabs.Content,
313
+ {
314
+ value: entityType,
315
+ className: "size-full overflow-y-auto",
316
+ children: /* @__PURE__ */ jsx(
317
+ DataGrid,
318
+ {
319
+ columns,
320
+ data: rows,
321
+ getSubRows: (row) => {
322
+ if (isEntityRow(row)) {
323
+ return row.subRows;
324
+ }
325
+ },
326
+ state: form,
327
+ onEditingChange: (editing) => setCloseOnEscape(!editing)
328
+ }
329
+ )
330
+ }
331
+ ) }),
332
+ /* @__PURE__ */ jsx(RouteFocusModal.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-end gap-x-2", children: [
333
+ /* @__PURE__ */ jsx(RouteFocusModal.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: t("actions.cancel") }) }),
334
+ /* @__PURE__ */ jsx(Button, { size: "small", type: "submit", isLoading: isPending, children: t("actions.save") })
335
+ ] }) })
336
+ ]
337
+ }
338
+ ) }) });
339
+ };
340
+
341
+ // src/routes/translations/translations-edit/translations-edit.tsx
342
+ import { useEffect } from "react";
343
+ import { jsx as jsx2 } from "react/jsx-runtime";
344
+ var TranslationsEdit = () => {
345
+ const isTranslationsEnabled = useFeatureFlag("translation");
346
+ const navigate = useNavigate();
347
+ const [searchParams] = useSearchParams();
348
+ const reference = searchParams.get("reference");
349
+ const referenceIdParam = searchParams.getAll("reference_id");
350
+ useEffect(() => {
351
+ if (!reference || !isTranslationsEnabled) {
352
+ navigate(-1);
353
+ return;
354
+ }
355
+ }, [reference, navigate, isTranslationsEnabled]);
356
+ const {
357
+ translations,
358
+ references,
359
+ translatableFields,
360
+ isPending,
361
+ isError,
362
+ error
363
+ } = useReferenceTranslations(reference, referenceIdParam, {
364
+ enabled: !!reference
365
+ });
366
+ const {
367
+ store,
368
+ isPending: isStorePending,
369
+ isError: isStoreError,
370
+ error: storeError
371
+ } = useStore();
372
+ const ready = !isPending && !!translations && !!translatableFields && !!references && !isStorePending && !!store;
373
+ if (isError || isStoreError) {
374
+ throw error || storeError;
375
+ }
376
+ return /* @__PURE__ */ jsx2(RouteFocusModal, { prev: referenceIdParam.length ? -1 : "..", children: ready && /* @__PURE__ */ jsx2(
377
+ TranslationsEditForm,
378
+ {
379
+ translations,
380
+ references,
381
+ entityType: reference,
382
+ availableLocales: store?.supported_locales ?? [],
383
+ translatableFields,
384
+ modalFields: translatableFields
385
+ }
386
+ ) });
387
+ };
388
+ export {
389
+ TranslationsEdit as Component
390
+ };