@medusajs/dashboard 3.0.0-snapshot-20251216145629 → 3.0.0-snapshot-20260102134455

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 (290) hide show
  1. package/dist/add-locales-2OZXZCT5.mjs +81 -0
  2. package/dist/{adjust-inventory-26YXAXQL.mjs → adjust-inventory-47KGDWME.mjs} +2 -2
  3. package/dist/{api-key-management-create-EMP32G2D.mjs → api-key-management-create-EFPPZPZ7.mjs} +4 -4
  4. package/dist/{api-key-management-detail-6RCDH73M.mjs → api-key-management-detail-4IFED7SF.mjs} +15 -15
  5. package/dist/{api-key-management-edit-IBM3ZXHK.mjs → api-key-management-edit-QGVBNLUL.mjs} +4 -4
  6. package/dist/{api-key-management-list-KC5GOWAU.mjs → api-key-management-list-ROIJIIPQ.mjs} +4 -4
  7. package/dist/{api-key-management-sales-channels-LUB5G6RC.mjs → api-key-management-sales-channels-7P5L45AT.mjs} +6 -6
  8. package/dist/app.css +33 -3
  9. package/dist/app.js +18467 -16698
  10. package/dist/app.mjs +13 -13
  11. package/dist/{campaign-create-FJOECKGT.mjs → campaign-create-EZGZ4SBQ.mjs} +3 -3
  12. package/dist/{campaign-detail-5Q4BYCPX.mjs → campaign-detail-NFKLFPY4.mjs} +12 -12
  13. package/dist/{categories-metadata-J7M3XWI7.mjs → categories-metadata-G7BACZ26.mjs} +12 -12
  14. package/dist/{category-create-KHJZSC7G.mjs → category-create-7MV25HYX.mjs} +6 -6
  15. package/dist/{category-detail-S5IPXMHX.mjs → category-detail-XJQQ7UU4.mjs} +14 -14
  16. package/dist/{category-edit-CTA2EPDG.mjs → category-edit-LV7EARAB.mjs} +3 -3
  17. package/dist/{category-list-QBYJ4T3R.mjs → category-list-NIVLV5S3.mjs} +6 -6
  18. package/dist/{category-organize-SXP33XET.mjs → category-organize-SCRGWKDG.mjs} +3 -3
  19. package/dist/{category-products-KPW6BA5J.mjs → category-products-FXFSMCR6.mjs} +13 -13
  20. package/dist/{chunk-OXPE5TAY.mjs → chunk-24C2YVFU.mjs} +1 -1
  21. package/dist/{chunk-4JQR6QNW.mjs → chunk-333HK6Y6.mjs} +2 -2
  22. package/dist/{chunk-DODQ3KJT.mjs → chunk-3RRA56WC.mjs} +8 -3
  23. package/dist/{chunk-5LGRZSEH.mjs → chunk-3YPZ3R4U.mjs} +1 -1
  24. package/dist/chunk-5BUFAGKR.mjs +13 -0
  25. package/dist/{chunk-2DULKOPN.mjs → chunk-5ISRTMYH.mjs} +1 -1
  26. package/dist/{chunk-PHLCT2HA.mjs → chunk-5ZPKY5XP.mjs} +1 -1
  27. package/dist/{chunk-U6G4M5LP.mjs → chunk-6EXKKRZY.mjs} +1 -1
  28. package/dist/{chunk-GRZSG4EP.mjs → chunk-74WPAWMW.mjs} +127 -226
  29. package/dist/{chunk-UULAOAFM.mjs → chunk-772OR7OQ.mjs} +358 -242
  30. package/dist/chunk-7AXHHXCX.mjs +4 -0
  31. package/dist/{chunk-BMS2QLJY.mjs → chunk-BMJ5RYIO.mjs} +1 -1
  32. package/dist/{chunk-Y2YVTIJI.mjs → chunk-CW5PQUJ6.mjs} +1 -1
  33. package/dist/{chunk-IAV7IKJ6.mjs → chunk-DN5BRKVN.mjs} +1 -1
  34. package/dist/{chunk-RS7DWLEP.mjs → chunk-DQUXK4WW.mjs} +1 -1
  35. package/dist/{chunk-2XTBDCGE.mjs → chunk-DWH2OQFK.mjs} +1 -1
  36. package/dist/{chunk-CCQD65EY.mjs → chunk-FKNW5MLZ.mjs} +360 -288
  37. package/dist/{chunk-HTCYX4VD.mjs → chunk-G35UUG2P.mjs} +1 -1
  38. package/dist/{chunk-QKALAT7P.mjs → chunk-GGONMC2N.mjs} +1 -1
  39. package/dist/{chunk-FYWHE3W5.mjs → chunk-GJN5SXGZ.mjs} +1 -1
  40. package/dist/{chunk-CVHJAKLQ.mjs → chunk-HDO2UCKF.mjs} +1 -1
  41. package/dist/{chunk-3C6WQ7NH.mjs → chunk-IWNNQ6HA.mjs} +37 -3
  42. package/dist/{chunk-OL24RDYM.mjs → chunk-KHJL6MUQ.mjs} +8 -8
  43. package/dist/{chunk-6P4Q4AAP.mjs → chunk-KPI4WFJU.mjs} +3 -3
  44. package/dist/{chunk-AHZLMCZF.mjs → chunk-KSDXSKJ7.mjs} +1 -1
  45. package/dist/{chunk-BZKI5J2M.mjs → chunk-L7A2JIQY.mjs} +3 -3
  46. package/dist/{chunk-XY7A7GZJ.mjs → chunk-LEAMWI5H.mjs} +1 -1
  47. package/dist/{chunk-A4XYK3MY.mjs → chunk-LG5B2BVB.mjs} +2 -2
  48. package/dist/{chunk-23GTCEOV.mjs → chunk-ML7BA2NY.mjs} +1 -1
  49. package/dist/{chunk-OFN7DIZA.mjs → chunk-OYHFHBNL.mjs} +94 -7
  50. package/dist/{chunk-OSHH5GAS.mjs → chunk-Q34TRFIW.mjs} +1 -13
  51. package/dist/{chunk-UJ2TMPV4.mjs → chunk-QBIQEVTU.mjs} +0 -12
  52. package/dist/{chunk-YYOPBKME.mjs → chunk-QHRAWZGA.mjs} +3 -3
  53. package/dist/{chunk-A2WBKOXJ.mjs → chunk-SO2DE6MM.mjs} +2 -2
  54. package/dist/{chunk-EHU67PIM.mjs → chunk-TOCMU7UV.mjs} +7 -3
  55. package/dist/{chunk-YIOBBZUB.mjs → chunk-U7KANQ5A.mjs} +2 -2
  56. package/dist/{chunk-Z6BFNHEO.mjs → chunk-UCYUWNJL.mjs} +109 -62
  57. package/dist/{chunk-WYATCUOM.mjs → chunk-V2RGYIAG.mjs} +10 -10
  58. package/dist/{chunk-UWY5ZV66.mjs → chunk-VQ73B7ZZ.mjs} +1 -13
  59. package/dist/chunk-XD72PXRS.mjs +329 -0
  60. package/dist/{store-add-locales-VJ4RJ7UI.mjs → chunk-YFXI6CWD.mjs} +2 -67
  61. package/dist/{chunk-AWRCV3ME.mjs → chunk-YM4XGCHB.mjs} +1 -1
  62. package/dist/{chunk-ZMG5B4FG.mjs → chunk-ZGV5NOTE.mjs} +1 -1
  63. package/dist/{collection-add-products-FU2BS3D3.mjs → collection-add-products-YDMBU2JY.mjs} +13 -13
  64. package/dist/{collection-create-GWKWVT7B.mjs → collection-create-RXHEXU6T.mjs} +3 -3
  65. package/dist/{collection-detail-VJE7XHLV.mjs → collection-detail-75XPGVOX.mjs} +13 -13
  66. package/dist/{collection-edit-EZIO2BR5.mjs → collection-edit-CGF47VIN.mjs} +3 -3
  67. package/dist/{collection-list-IGA6SCNF.mjs → collection-list-75N5NYXQ.mjs} +18 -17
  68. package/dist/{collection-metadata-QK7MI3D2.mjs → collection-metadata-TGGC6HM2.mjs} +12 -12
  69. package/dist/{customer-detail-MOV2T3LF.mjs → customer-detail-KDLZ23B3.mjs} +17 -16
  70. package/dist/{customer-group-detail-6T7OXGQD.mjs → customer-group-detail-ZIAVMOYS.mjs} +12 -12
  71. package/dist/{customer-group-list-AJEAF5D2.mjs → customer-group-list-BDDC5VVZ.mjs} +15 -15
  72. package/dist/{customers-add-customer-group-QVTVSQYM.mjs → customers-add-customer-group-B3ASQGP6.mjs} +12 -12
  73. package/dist/{edit-inventory-item-H7DAZWIT.mjs → edit-inventory-item-OKAXQRJ5.mjs} +2 -2
  74. package/dist/{edit-inventory-item-attributes-7HTXXPGZ.mjs → edit-inventory-item-attributes-FVWDV6O5.mjs} +2 -2
  75. package/dist/{edit-reservation-OVTRZHJR.mjs → edit-reservation-3PU6YSNJ.mjs} +3 -3
  76. package/dist/{edit-rules-SMVRTCUP.mjs → edit-rules-LOJ3P4YB.mjs} +14 -14
  77. package/dist/en.json +73 -5
  78. package/dist/{inventory-create-ANYUM4P5.mjs → inventory-create-C2WWS7QR.mjs} +13 -13
  79. package/dist/{inventory-detail-ZPSEMYI2.mjs → inventory-detail-AKOZ4T3Z.mjs} +12 -12
  80. package/dist/{inventory-list-RXJPSVZE.mjs → inventory-list-DRFJIU2O.mjs} +2 -2
  81. package/dist/{inventory-metadata-FNEJ3RAT.mjs → inventory-metadata-N6CJZEWD.mjs} +12 -12
  82. package/dist/{inventory-stock-FD4ZM4BB.mjs → inventory-stock-IJ2N7LKC.mjs} +14 -14
  83. package/dist/{location-detail-N3GUZSY7.mjs → location-detail-PL4Y43RS.mjs} +16 -16
  84. package/dist/{location-fulfillment-providers-7ZUJAGNY.mjs → location-fulfillment-providers-2PLOVSXC.mjs} +17 -16
  85. package/dist/{location-sales-channels-P3QJTFDT.mjs → location-sales-channels-SZARSLWT.mjs} +5 -5
  86. package/dist/{location-service-zone-shipping-option-create-ZJ4GIBTJ.mjs → location-service-zone-shipping-option-create-CUNSAP24.mjs} +15 -15
  87. package/dist/{location-service-zone-shipping-option-edit-4CGPQ3VT.mjs → location-service-zone-shipping-option-edit-OJ462SVM.mjs} +1 -1
  88. package/dist/{location-service-zone-shipping-option-pricing-CR4BVYG3.mjs → location-service-zone-shipping-option-pricing-5HN2Z5RB.mjs} +2 -2
  89. package/dist/login-VBUNWZHI.mjs +301 -0
  90. package/dist/{manage-locations-7HH6R4UP.mjs → manage-locations-JPCSBA5D.mjs} +2 -2
  91. package/dist/{order-allocate-items-HZGGYJ42.mjs → order-allocate-items-6QHQASQJ.mjs} +4 -4
  92. package/dist/{order-create-claim-SCDJGM46.mjs → order-create-claim-ECVSH5GC.mjs} +22 -22
  93. package/dist/{order-create-edit-JIE3HDHP.mjs → order-create-edit-EVIOJIXE.mjs} +14 -13
  94. package/dist/{order-create-exchange-LQU4YN7F.mjs → order-create-exchange-ZVYYOGI3.mjs} +22 -22
  95. package/dist/{order-create-fulfillment-OWUVTZXW.mjs → order-create-fulfillment-FDIFEV6X.mjs} +16 -16
  96. package/dist/{order-create-refund-Q6HQY42R.mjs → order-create-refund-TNPGKR5P.mjs} +17 -17
  97. package/dist/{order-create-return-52GHGW5Z.mjs → order-create-return-NR6XQLDD.mjs} +9 -9
  98. package/dist/{order-create-shipment-WAGGEPRW.mjs → order-create-shipment-UP3WGRWB.mjs} +12 -12
  99. package/dist/{order-detail-PVPGEWGY.mjs → order-detail-F6D5DV74.mjs} +28 -28
  100. package/dist/{order-edit-billing-address-UM76J4KX.mjs → order-edit-billing-address-D4AJ6Z5Q.mjs} +44 -12
  101. package/dist/{order-edit-email-CL3KNOCM.mjs → order-edit-email-MXYA5BII.mjs} +12 -12
  102. package/dist/{order-edit-shipping-address-PIESTGVL.mjs → order-edit-shipping-address-GKW2ZPGR.mjs} +42 -12
  103. package/dist/{order-export-LE363ZLB.mjs → order-export-KQUI2TK7.mjs} +14 -14
  104. package/dist/{order-list-GRLQWN4L.mjs → order-list-7A5UKGXR.mjs} +11 -11
  105. package/dist/{order-metadata-FHBB7MTG.mjs → order-metadata-2IXELA7C.mjs} +12 -12
  106. package/dist/{order-receive-return-PRVKP6J2.mjs → order-receive-return-XXHOXGDC.mjs} +13 -13
  107. package/dist/{order-request-transfer-XSAGRUMT.mjs → order-request-transfer-2ENR64VR.mjs} +13 -13
  108. package/dist/{price-list-configuration-6S3MLNXQ.mjs → price-list-configuration-BZ3ZH5FY.mjs} +3 -3
  109. package/dist/{price-list-create-MFRUQADC.mjs → price-list-create-GFGNP6OS.mjs} +16 -16
  110. package/dist/{price-list-detail-Q5VG5VGW.mjs → price-list-detail-SNNOR5N7.mjs} +17 -17
  111. package/dist/{price-list-edit-53UW35L3.mjs → price-list-edit-YW5BXBF2.mjs} +3 -3
  112. package/dist/{price-list-list-DG5YEZ44.mjs → price-list-list-OF562HME.mjs} +4 -4
  113. package/dist/{price-list-prices-add-SDU5YZAT.mjs → price-list-prices-add-F7A2EV7L.mjs} +15 -15
  114. package/dist/{price-list-prices-edit-5USQR4D4.mjs → price-list-prices-edit-PQ26MOJE.mjs} +5 -5
  115. package/dist/{product-attributes-K4FGFORS.mjs → product-attributes-HO2B4OHP.mjs} +13 -13
  116. package/dist/{product-create-7YTRHZQQ.mjs → product-create-UEVW5JO4.mjs} +485 -561
  117. package/dist/{product-create-variant-ERKHTEJZ.mjs → product-create-variant-PLZ5Q2R6.mjs} +14 -14
  118. package/dist/{product-detail-32ZXNWOP.mjs → product-detail-Z7K5TGZY.mjs} +45 -66
  119. package/dist/{product-edit-FBAKONMR.mjs → product-edit-6I6JG4GP.mjs} +13 -13
  120. package/dist/{product-export-5AD7NELI.mjs → product-export-UMMROQ7T.mjs} +18 -17
  121. package/dist/{product-image-variants-edit-M6QF2RLE.mjs → product-image-variants-edit-VRG3AJID.mjs} +12 -12
  122. package/dist/{product-import-V3KQN4TV.mjs → product-import-EPS4KDID.mjs} +12 -12
  123. package/dist/{product-list-EUWZIFTM.mjs → product-list-37O7VB2L.mjs} +20 -20
  124. package/dist/{product-media-3VJ7KENL.mjs → product-media-IV5NUSLW.mjs} +3 -3
  125. package/dist/{product-metadata-GL2MVPDI.mjs → product-metadata-KTVRI7B3.mjs} +12 -12
  126. package/dist/product-option-create-C5BPN6P6.mjs +268 -0
  127. package/dist/product-option-detail-VVK3YBCE.mjs +331 -0
  128. package/dist/product-option-edit-7FQSKI2R.mjs +325 -0
  129. package/dist/product-option-list-YHGRI7OJ.mjs +268 -0
  130. package/dist/product-option-metadata-P2DHDGYR.mjs +73 -0
  131. package/dist/product-options-manage-B4N54NCR.mjs +358 -0
  132. package/dist/{product-organization-IUSVX22S.mjs → product-organization-L23V4JA7.mjs} +15 -15
  133. package/dist/{product-prices-4C36AG4R.mjs → product-prices-GUO3KM2U.mjs} +3 -3
  134. package/dist/{product-sales-channels-PPXUG4KT.mjs → product-sales-channels-BOZD3AC3.mjs} +5 -5
  135. package/dist/{product-shipping-profile-ETQFZ7DC.mjs → product-shipping-profile-FNFRDY47.mjs} +3 -3
  136. package/dist/{product-stock-VEGE6SUZ.mjs → product-stock-2DNYG73L.mjs} +14 -14
  137. package/dist/{product-tag-create-PQMDDKWH.mjs → product-tag-create-CW7GUCZW.mjs} +12 -12
  138. package/dist/{product-tag-detail-I3MBZX7U.mjs → product-tag-detail-IB5VIZ3K.mjs} +26 -25
  139. package/dist/{product-tag-edit-K3BBQLJR.mjs → product-tag-edit-ZSXD3DOC.mjs} +12 -12
  140. package/dist/{product-tag-list-JUWSOMB7.mjs → product-tag-list-MJO5PURP.mjs} +24 -23
  141. package/dist/{product-tag-metadata-MJH5LH7E.mjs → product-tag-metadata-DAKCXWZF.mjs} +12 -12
  142. package/dist/{product-type-create-DRFXTL5O.mjs → product-type-create-NRLNMABQ.mjs} +2 -2
  143. package/dist/{product-type-detail-RKHT5NBL.mjs → product-type-detail-J2IMAZW6.mjs} +14 -14
  144. package/dist/{product-type-edit-SRHCZDK7.mjs → product-type-edit-BHTPMMVI.mjs} +2 -2
  145. package/dist/{product-type-list-QQKAHBJ3.mjs → product-type-list-MQ2PW2IE.mjs} +3 -3
  146. package/dist/{product-type-metadata-CDJDFFGQ.mjs → product-type-metadata-BCZMUG3K.mjs} +12 -12
  147. package/dist/{product-variant-detail-XAYG5CKE.mjs → product-variant-detail-4L6DHT3K.mjs} +12 -12
  148. package/dist/{product-variant-edit-DEZEY2H2.mjs → product-variant-edit-PZU4P65H.mjs} +13 -13
  149. package/dist/{product-variant-manage-inventory-items-Y2VEOHP7.mjs → product-variant-manage-inventory-items-E3GPBPEZ.mjs} +3 -3
  150. package/dist/{product-variant-media-2WLVNGI4.mjs → product-variant-media-BSNCO642.mjs} +2 -2
  151. package/dist/{product-variant-metadata-VTZDNWUT.mjs → product-variant-metadata-FHGGZGPV.mjs} +12 -12
  152. package/dist/{promotion-add-campaign-DO67QK6M.mjs → promotion-add-campaign-NQSIFI33.mjs} +3 -3
  153. package/dist/{promotion-create-HWFNUQXG.mjs → promotion-create-GBZWJVAI.mjs} +24 -21
  154. package/dist/{promotion-detail-QC36KXB3.mjs → promotion-detail-W2OGUESO.mjs} +12 -12
  155. package/dist/{refund-reason-create-YHCDEHGQ.mjs → refund-reason-create-DLVRT5OU.mjs} +12 -12
  156. package/dist/{refund-reason-edit-CZ5QZ2SZ.mjs → refund-reason-edit-XCSU7RMH.mjs} +12 -12
  157. package/dist/{refund-reason-list-OJYYEYJE.mjs → refund-reason-list-G6UNVGPG.mjs} +18 -18
  158. package/dist/{region-create-NA7Y2LN4.mjs → region-create-2CRTF7HJ.mjs} +1 -1
  159. package/dist/{region-edit-WAU347DP.mjs → region-edit-IB3PJE7V.mjs} +1 -1
  160. package/dist/{region-metadata-H6XXUQ4S.mjs → region-metadata-WBEUKOI6.mjs} +12 -12
  161. package/dist/{reservation-create-ZCIYM6JI.mjs → reservation-create-ERFJUBME.mjs} +4 -4
  162. package/dist/{reservation-detail-LZAQL4XA.mjs → reservation-detail-Y6UZRZXY.mjs} +12 -12
  163. package/dist/{reservation-list-B47DXTA7.mjs → reservation-list-LEDZB7KL.mjs} +3 -3
  164. package/dist/{reservation-metadata-5HZSDDOK.mjs → reservation-metadata-7KH4EXMN.mjs} +12 -12
  165. package/dist/{return-reason-list-SCBGTOEI.mjs → return-reason-list-UUQAL464.mjs} +6 -6
  166. package/dist/{sales-channel-add-products-F7YV4MO5.mjs → sales-channel-add-products-GSPG7OTK.mjs} +14 -14
  167. package/dist/{sales-channel-create-MI7HHZYE.mjs → sales-channel-create-MM237EBQ.mjs} +3 -3
  168. package/dist/{sales-channel-detail-MXIPZCGA.mjs → sales-channel-detail-65ZFV2OI.mjs} +14 -14
  169. package/dist/{sales-channel-edit-VSHOIR37.mjs → sales-channel-edit-AC2J4N3M.mjs} +3 -3
  170. package/dist/{sales-channel-list-RLGL7FM3.mjs → sales-channel-list-LXLW7X3U.mjs} +14 -14
  171. package/dist/{sales-channel-metadata-M364R4RJ.mjs → sales-channel-metadata-QUAL2RH6.mjs} +13 -13
  172. package/dist/{shipping-option-type-create-C5WUWON7.mjs → shipping-option-type-create-EU75JC2Q.mjs} +12 -12
  173. package/dist/{shipping-option-type-detail-PENS2K73.mjs → shipping-option-type-detail-5GYEWATD.mjs} +13 -13
  174. package/dist/{shipping-option-type-edit-CIU5EHRP.mjs → shipping-option-type-edit-YR4JXT5M.mjs} +12 -12
  175. package/dist/{shipping-option-type-list-DIOX7VG7.mjs → shipping-option-type-list-BLC4Z5QW.mjs} +13 -13
  176. package/dist/{shipping-profile-metadata-75G2NNMA.mjs → shipping-profile-metadata-64YRWPDA.mjs} +12 -12
  177. package/dist/store-add-locales-TSMLNFZP.mjs +81 -0
  178. package/dist/{store-detail-JSNPOB2F.mjs → store-detail-3SS53LZR.mjs} +13 -13
  179. package/dist/{store-edit-5ZS562ZO.mjs → store-edit-SMEWFETF.mjs} +1 -1
  180. package/dist/{store-metadata-CYXTVJUE.mjs → store-metadata-IJGVDDA6.mjs} +12 -12
  181. package/dist/{tax-region-create-DWGL4EUT.mjs → tax-region-create-XLYIS5XX.mjs} +13 -13
  182. package/dist/{tax-region-detail-2AE2EFI3.mjs → tax-region-detail-66FKEGFB.mjs} +29 -28
  183. package/dist/{tax-region-edit-EEVEEU2Q.mjs → tax-region-edit-GBR4EDW7.mjs} +13 -13
  184. package/dist/{tax-region-province-detail-4ERSEQFF.mjs → tax-region-province-detail-OBA7Q7MQ.mjs} +29 -28
  185. package/dist/{tax-region-tax-override-create-PHCGEF7V.mjs → tax-region-tax-override-create-34WYD2QZ.mjs} +28 -27
  186. package/dist/{tax-region-tax-override-edit-SMRPSILC.mjs → tax-region-tax-override-edit-6WJVOGWA.mjs} +27 -26
  187. package/dist/translation-list-J65VNNAX.mjs +527 -0
  188. package/dist/{translations-edit-KECSHYZY.mjs → translations-edit-6P3KC4MO.mjs} +280 -304
  189. package/dist/{user-detail-BJUXLZZQ.mjs → user-detail-VMOJFHIJ.mjs} +2 -2
  190. package/dist/{user-metadata-2WPJOEJA.mjs → user-metadata-UOPVFX2L.mjs} +12 -12
  191. package/dist/{workflow-execution-detail-H2AKEZJX.mjs → workflow-execution-detail-WAQ7IG4T.mjs} +12 -12
  192. package/package.json +9 -9
  193. package/src/components/data-grid/components/data-grid-cell-container.tsx +7 -10
  194. package/src/components/data-grid/components/data-grid-multiline-cell.tsx +103 -0
  195. package/src/components/data-grid/components/data-grid-readonly-cell.tsx +1 -4
  196. package/src/components/data-grid/components/data-grid-root.tsx +68 -51
  197. package/src/components/data-grid/components/data-grid-text-cell.tsx +6 -76
  198. package/src/components/data-grid/components/index.ts +1 -0
  199. package/src/components/data-grid/data-grid.tsx +2 -0
  200. package/src/components/data-grid/hooks/use-data-grid-cell.tsx +12 -0
  201. package/src/components/data-grid/hooks/use-data-grid-form-handlers.tsx +1 -0
  202. package/src/components/data-grid/hooks/use-data-grid-keydown-event.tsx +65 -7
  203. package/src/components/data-grid/types.ts +1 -0
  204. package/src/components/inputs/combobox/combobox.tsx +185 -95
  205. package/src/components/layout/main-layout/main-layout.tsx +7 -4
  206. package/src/components/table/table-cells/order/country-cell/country-cell.tsx +5 -1
  207. package/src/dashboard-app/routes/get-route.map.tsx +68 -12
  208. package/src/hooks/api/cloud.tsx +41 -0
  209. package/src/hooks/api/index.ts +3 -1
  210. package/src/hooks/api/product-options.tsx +151 -0
  211. package/src/hooks/api/products.tsx +26 -66
  212. package/src/hooks/api/translations.tsx +103 -191
  213. package/src/hooks/table/columns/use-order-table-columns.tsx +5 -3
  214. package/src/hooks/table/columns/use-product-option-table-columns.tsx +44 -0
  215. package/src/hooks/table/filters/index.ts +1 -0
  216. package/src/hooks/table/filters/use-product-option-table-filters.tsx +33 -0
  217. package/src/hooks/table/query/use-product-option-table-query.tsx +34 -0
  218. package/src/i18n/translations/$schema.json +290 -32
  219. package/src/i18n/translations/en.json +73 -5
  220. package/src/i18n/translations/es.json +9 -1
  221. package/src/routes/customers/customer-detail/components/customer-order-section/customer-order-section.tsx +1 -1
  222. package/src/routes/login/components/cloud-auth-login.tsx +114 -0
  223. package/src/routes/login/login.tsx +9 -1
  224. package/src/routes/orders/order-create-edit/components/order-edit-create-form/order-edit-item.tsx +1 -0
  225. package/src/routes/orders/order-edit-billing-address/components/edit-order-billing-address-form/edit-order-billing-address-form.tsx +34 -0
  226. package/src/routes/orders/order-edit-shipping-address/components/edit-order-shipping-address-form/edit-order-shipping-address-form.tsx +32 -0
  227. package/src/routes/product-options/common/hooks/use-delete-product-option-action.tsx +41 -0
  228. package/src/routes/product-options/product-option-create/components/create-product-option-form/create-product-option-details.tsx +71 -0
  229. package/src/routes/product-options/product-option-create/components/create-product-option-form/create-product-option-form.tsx +97 -0
  230. package/src/routes/product-options/product-option-create/components/create-product-option-form/create-product-option-organize.tsx +92 -0
  231. package/src/routes/product-options/product-option-create/components/create-product-option-form/index.ts +1 -0
  232. package/src/routes/product-options/product-option-create/components/create-product-option-form/schema.ts +15 -0
  233. package/src/routes/product-options/product-option-create/index.ts +1 -0
  234. package/src/routes/product-options/product-option-create/product-option-create.tsx +10 -0
  235. package/src/routes/product-options/product-option-detail/breadcrumb.tsx +14 -0
  236. package/src/routes/product-options/product-option-detail/components/product-option-general-section/index.ts +1 -0
  237. package/src/routes/product-options/product-option-detail/components/product-option-general-section/product-option-general-section.tsx +84 -0
  238. package/src/routes/product-options/product-option-detail/components/product-option-product-section/index.ts +1 -0
  239. package/src/routes/product-options/product-option-detail/components/product-option-product-section/product-option-product-section.tsx +82 -0
  240. package/src/routes/product-options/product-option-detail/index.ts +3 -0
  241. package/src/routes/product-options/product-option-detail/loader.ts +18 -0
  242. package/src/routes/product-options/product-option-detail/product-option-detail.tsx +50 -0
  243. package/src/routes/product-options/product-option-edit/components/edit-product-option-form/edit-product-option-details.tsx +94 -0
  244. package/src/routes/product-options/product-option-edit/components/edit-product-option-form/edit-product-option-form.tsx +116 -0
  245. package/src/routes/product-options/product-option-edit/components/edit-product-option-form/edit-product-option-organize.tsx +77 -0
  246. package/src/routes/product-options/product-option-edit/components/edit-product-option-form/index.ts +1 -0
  247. package/src/routes/product-options/product-option-edit/components/edit-product-option-form/schema.ts +13 -0
  248. package/src/routes/product-options/product-option-edit/index.ts +1 -0
  249. package/src/routes/product-options/product-option-edit/product-option-edit.tsx +34 -0
  250. package/src/routes/product-options/product-option-list/components/product-option-list-table/index.ts +1 -0
  251. package/src/routes/product-options/product-option-list/components/product-option-list-table/product-option-list-table.tsx +140 -0
  252. package/src/routes/product-options/product-option-list/index.ts +1 -0
  253. package/src/routes/product-options/product-option-list/product-option-list.tsx +19 -0
  254. package/src/routes/product-options/product-option-metadata/index.ts +1 -0
  255. package/src/routes/product-options/product-option-metadata/product-option-metadata.tsx +27 -0
  256. package/src/routes/products/product-create/components/product-create-details-form/components/product-create-details-general-section/product-create-general-section.tsx +16 -4
  257. package/src/routes/products/product-create/components/product-create-details-form/components/product-create-details-variant-section/product-create-details-variant-section.tsx +327 -194
  258. package/src/routes/products/product-create/components/product-create-form/product-create-form.tsx +4 -7
  259. package/src/routes/products/product-create/constants.ts +2 -0
  260. package/src/routes/products/product-create/utils.ts +6 -1
  261. package/src/routes/products/product-detail/components/product-option-section/product-option-section.tsx +33 -51
  262. package/src/routes/products/product-options-manage/components/product-options-manage-form/index.ts +1 -0
  263. package/src/routes/products/product-options-manage/components/product-options-manage-form/product-options-manage-form.tsx +328 -0
  264. package/src/routes/products/product-options-manage/index.ts +1 -0
  265. package/src/routes/products/product-options-manage/product-options-manage.tsx +35 -0
  266. package/src/routes/promotions/promotion-create/components/create-promotion-form/create-promotion-form.tsx +6 -0
  267. package/src/routes/translations/add-locales/add-locales.tsx +29 -0
  268. package/src/routes/translations/add-locales/index.tsx +1 -0
  269. package/src/routes/translations/translation-list/components/active-locales-section/active-locales-section.tsx +42 -17
  270. package/src/routes/translations/translation-list/components/translation-list-section/translation-list-section.tsx +5 -1
  271. package/src/routes/translations/translation-list/components/translations-completion-section/translations-completion-section.tsx +182 -121
  272. package/src/routes/translations/translations-edit/components/translations-edit-form/translations-edit-form.tsx +330 -361
  273. package/src/routes/translations/translations-edit/translations-edit.tsx +8 -13
  274. package/dist/chunk-HGRIOEAR.mjs +0 -32
  275. package/dist/chunk-XDJ7OMBR.mjs +0 -160
  276. package/dist/login-VNOLI5YG.mjs +0 -201
  277. package/dist/product-create-option-7AOXAA4S.mjs +0 -151
  278. package/dist/product-edit-option-LWJT3CYJ.mjs +0 -156
  279. package/dist/translation-list-UF7FLXOW.mjs +0 -441
  280. package/src/routes/products/product-create-option/components/create-product-option-form/create-product-option-form.tsx +0 -122
  281. package/src/routes/products/product-create-option/components/create-product-option-form/index.ts +0 -1
  282. package/src/routes/products/product-create-option/index.ts +0 -1
  283. package/src/routes/products/product-create-option/product-create-option.tsx +0 -30
  284. package/src/routes/products/product-edit-option/components/edit-product-option-form/edit-product-option-form.tsx +0 -123
  285. package/src/routes/products/product-edit-option/components/edit-product-option-form/index.ts +0 -1
  286. package/src/routes/products/product-edit-option/index.ts +0 -1
  287. package/src/routes/products/product-edit-option/product-edit-option.tsx +0 -35
  288. package/dist/{chunk-FBYTX6K7.mjs → chunk-ORWRXJJT.mjs} +4 -4
  289. package/dist/{location-list-KVBA6J47.mjs → location-list-3WP65J3E.mjs} +1 -1
  290. package/dist/{user-list-YTZQNYSO.mjs → user-list-3EAKK4XC.mjs} +3 -3
@@ -2,6 +2,7 @@ export * from "./api-keys"
2
2
  export * from "./auth"
3
3
  export * from "./campaigns"
4
4
  export * from "./categories"
5
+ export * from "./cloud"
5
6
  export * from "./collections"
6
7
  export * from "./currencies"
7
8
  export * from "./customer-groups"
@@ -18,6 +19,7 @@ export * from "./payment-collections"
18
19
  export * from "./payments"
19
20
  export * from "./plugins"
20
21
  export * from "./price-lists"
22
+ export * from "./product-options"
21
23
  export * from "./product-types"
22
24
  export * from "./product-variants"
23
25
  export * from "./products"
@@ -26,8 +28,8 @@ export * from "./refund-reasons"
26
28
  export * from "./regions"
27
29
  export * from "./reservations"
28
30
  export * from "./sales-channels"
29
- export * from "./shipping-options"
30
31
  export * from "./shipping-option-types"
32
+ export * from "./shipping-options"
31
33
  export * from "./shipping-profiles"
32
34
  export * from "./stock-locations"
33
35
  export * from "./store"
@@ -0,0 +1,151 @@
1
+ import { FetchError } from "@medusajs/js-sdk"
2
+ import {
3
+ QueryKey,
4
+ useMutation,
5
+ UseMutationOptions,
6
+ useQuery,
7
+ UseQueryOptions,
8
+ } from "@tanstack/react-query"
9
+ import { sdk } from "../../lib/client"
10
+ import { queryKeysFactory } from "../../lib/query-key-factory"
11
+ import { HttpTypes } from "@medusajs/types"
12
+ import { queryClient } from "../../lib/query-client.ts"
13
+
14
+ const PRODUCT_OPTIONS_QUERY_KEY = "product_options" as const
15
+ export const productOptionsQueryKeys = queryKeysFactory(
16
+ PRODUCT_OPTIONS_QUERY_KEY
17
+ )
18
+
19
+ export const useProductOption = (
20
+ id: string,
21
+ query?: HttpTypes.AdminProductOptionParams,
22
+ options?: Omit<
23
+ UseQueryOptions<
24
+ HttpTypes.AdminProductOptionResponse,
25
+ FetchError,
26
+ HttpTypes.AdminProductOptionResponse,
27
+ QueryKey
28
+ >,
29
+ "queryFn" | "queryKey"
30
+ >
31
+ ) => {
32
+ const { data, ...rest } = useQuery({
33
+ queryKey: productOptionsQueryKeys.detail(id, query),
34
+ queryFn: () => sdk.admin.productOption.retrieve(id, query),
35
+ ...options,
36
+ })
37
+
38
+ return { ...data, ...rest }
39
+ }
40
+
41
+ export const useProductOptions = (
42
+ query?: HttpTypes.AdminProductOptionListParams,
43
+ options?: Omit<
44
+ UseQueryOptions<
45
+ HttpTypes.AdminProductOptionListResponse,
46
+ FetchError,
47
+ HttpTypes.AdminProductOptionListResponse,
48
+ QueryKey
49
+ >,
50
+ "queryFn" | "queryKey"
51
+ >
52
+ ) => {
53
+ const { data, ...rest } = useQuery({
54
+ queryFn: () => sdk.admin.productOption.list(query),
55
+ queryKey: productOptionsQueryKeys.list(query),
56
+ ...options,
57
+ })
58
+
59
+ return { ...data, ...rest }
60
+ }
61
+
62
+ export const useCreateProductOption = (
63
+ options?: UseMutationOptions<
64
+ HttpTypes.AdminProductOptionResponse,
65
+ FetchError,
66
+ HttpTypes.AdminCreateProductOption
67
+ >
68
+ ) => {
69
+ return useMutation({
70
+ mutationFn: (payload) => sdk.admin.productOption.create(payload),
71
+ onSuccess: (data, variables, context) => {
72
+ queryClient.invalidateQueries({
73
+ queryKey: productOptionsQueryKeys.lists(),
74
+ })
75
+
76
+ options?.onSuccess?.(data, variables, context)
77
+ },
78
+ ...options,
79
+ })
80
+ }
81
+
82
+ export const useUpdateProductOption = (
83
+ id: string,
84
+ options?: UseMutationOptions<
85
+ HttpTypes.AdminProductOptionResponse,
86
+ FetchError,
87
+ HttpTypes.AdminUpdateProductOption
88
+ >
89
+ ) => {
90
+ return useMutation({
91
+ mutationFn: (payload) => sdk.admin.productOption.update(id, payload),
92
+ onSuccess: (data, variables, context) => {
93
+ queryClient.invalidateQueries({
94
+ queryKey: productOptionsQueryKeys.lists(),
95
+ })
96
+ queryClient.invalidateQueries({
97
+ queryKey: productOptionsQueryKeys.detail(id),
98
+ })
99
+
100
+ options?.onSuccess?.(data, variables, context)
101
+ },
102
+ ...options,
103
+ })
104
+ }
105
+
106
+ export const useDeleteProductOption = (
107
+ id: string,
108
+ options?: UseMutationOptions<
109
+ HttpTypes.AdminProductOptionDeleteResponse,
110
+ FetchError,
111
+ void
112
+ >
113
+ ) => {
114
+ return useMutation({
115
+ mutationFn: () => sdk.admin.productOption.delete(id),
116
+ onSuccess: (data, variables, context) => {
117
+ queryClient.invalidateQueries({
118
+ queryKey: productOptionsQueryKeys.lists(),
119
+ })
120
+ queryClient.invalidateQueries({
121
+ queryKey: productOptionsQueryKeys.detail(id),
122
+ })
123
+
124
+ options?.onSuccess?.(data, variables, context)
125
+ },
126
+ ...options,
127
+ })
128
+ }
129
+
130
+ export const useDeleteProductOptionLazy = (
131
+ options?: UseMutationOptions<
132
+ HttpTypes.AdminProductOptionDeleteResponse,
133
+ FetchError,
134
+ string
135
+ >
136
+ ) => {
137
+ return useMutation({
138
+ mutationFn: (id: string) => sdk.admin.productOption.delete(id),
139
+ onSuccess: (data, variables, context) => {
140
+ queryClient.invalidateQueries({
141
+ queryKey: productOptionsQueryKeys.lists(),
142
+ })
143
+ queryClient.invalidateQueries({
144
+ queryKey: productOptionsQueryKeys.details(),
145
+ })
146
+
147
+ options?.onSuccess?.(data, variables, context)
148
+ },
149
+ ...options,
150
+ })
151
+ }
@@ -13,6 +13,7 @@ import { sdk } from "../../lib/client"
13
13
  import { queryClient } from "../../lib/query-client"
14
14
  import { queryKeysFactory } from "../../lib/query-key-factory"
15
15
  import { inventoryItemsQueryKeys } from "./inventory.tsx"
16
+ import { productOptionsQueryKeys } from "./product-options.tsx"
16
17
  import { useInfiniteList } from "../use-infinite-list.tsx"
17
18
 
18
19
  const PRODUCTS_QUERY_KEY = "products" as const
@@ -21,72 +22,6 @@ export const productsQueryKeys = queryKeysFactory(PRODUCTS_QUERY_KEY)
21
22
  const VARIANTS_QUERY_KEY = "product_variants" as const
22
23
  export const variantsQueryKeys = queryKeysFactory(VARIANTS_QUERY_KEY)
23
24
 
24
- const OPTIONS_QUERY_KEY = "product_options" as const
25
- export const optionsQueryKeys = queryKeysFactory(OPTIONS_QUERY_KEY)
26
-
27
- export const useCreateProductOption = (
28
- productId: string,
29
- options?: UseMutationOptions<any, FetchError, any>
30
- ) => {
31
- return useMutation({
32
- mutationFn: (payload: HttpTypes.AdminCreateProductOption) =>
33
- sdk.admin.product.createOption(productId, payload),
34
- onSuccess: (data: any, variables: any, context: any) => {
35
- queryClient.invalidateQueries({ queryKey: optionsQueryKeys.lists() })
36
- queryClient.invalidateQueries({
37
- queryKey: productsQueryKeys.detail(productId),
38
- })
39
- options?.onSuccess?.(data, variables, context)
40
- },
41
- ...options,
42
- })
43
- }
44
-
45
- export const useUpdateProductOption = (
46
- productId: string,
47
- optionId: string,
48
- options?: UseMutationOptions<any, FetchError, any>
49
- ) => {
50
- return useMutation({
51
- mutationFn: (payload: HttpTypes.AdminUpdateProductOption) =>
52
- sdk.admin.product.updateOption(productId, optionId, payload),
53
- onSuccess: (data: any, variables: any, context: any) => {
54
- queryClient.invalidateQueries({ queryKey: optionsQueryKeys.lists() })
55
- queryClient.invalidateQueries({
56
- queryKey: optionsQueryKeys.detail(optionId),
57
- })
58
- queryClient.invalidateQueries({
59
- queryKey: productsQueryKeys.detail(productId),
60
- })
61
-
62
- options?.onSuccess?.(data, variables, context)
63
- },
64
- ...options,
65
- })
66
- }
67
-
68
- export const useDeleteProductOption = (
69
- productId: string,
70
- optionId: string,
71
- options?: UseMutationOptions<any, FetchError, void>
72
- ) => {
73
- return useMutation({
74
- mutationFn: () => sdk.admin.product.deleteOption(productId, optionId),
75
- onSuccess: (data: any, variables: any, context: any) => {
76
- queryClient.invalidateQueries({ queryKey: optionsQueryKeys.lists() })
77
- queryClient.invalidateQueries({
78
- queryKey: optionsQueryKeys.detail(optionId),
79
- })
80
- queryClient.invalidateQueries({
81
- queryKey: productsQueryKeys.detail(productId),
82
- })
83
-
84
- options?.onSuccess?.(data, variables, context)
85
- },
86
- ...options,
87
- })
88
- }
89
-
90
25
  export const useProductVariant = (
91
26
  productId: string,
92
27
  variantId: string,
@@ -408,6 +343,31 @@ export const useDeleteProduct = (
408
343
  })
409
344
  }
410
345
 
346
+ export const useLinkProductOptions = (
347
+ productId: string,
348
+ options?: UseMutationOptions<
349
+ HttpTypes.AdminProductResponse,
350
+ FetchError,
351
+ HttpTypes.AdminLinkProductOptions
352
+ >
353
+ ) => {
354
+ return useMutation({
355
+ mutationFn: (payload) => sdk.admin.product.linkOptions(productId, payload),
356
+ onSuccess: (data, variables, context) => {
357
+ queryClient.invalidateQueries({ queryKey: productsQueryKeys.lists() })
358
+ queryClient.invalidateQueries({
359
+ queryKey: productsQueryKeys.detail(productId),
360
+ })
361
+ queryClient.invalidateQueries({
362
+ queryKey: productOptionsQueryKeys.lists(),
363
+ })
364
+
365
+ options?.onSuccess?.(data, variables, context)
366
+ },
367
+ ...options,
368
+ })
369
+ }
370
+
411
371
  export const useExportProducts = (
412
372
  query?: HttpTypes.AdminProductListParams,
413
373
  options?: UseMutationOptions<
@@ -2,25 +2,16 @@ import { FetchError } from "@medusajs/js-sdk"
2
2
  import { HttpTypes } from "@medusajs/types"
3
3
  import {
4
4
  QueryKey,
5
+ useInfiniteQuery,
5
6
  UseInfiniteQueryOptions,
6
- UseInfiniteQueryResult,
7
7
  useMutation,
8
8
  UseMutationOptions,
9
9
  useQuery,
10
10
  UseQueryOptions,
11
11
  } from "@tanstack/react-query"
12
12
  import { sdk } from "../../lib/client"
13
- import { queryKeysFactory } from "../../lib/query-key-factory"
14
13
  import { queryClient } from "../../lib/query-client"
15
- import { productsQueryKeys, useInfiniteProducts } from "./products"
16
- import {
17
- productVariantQueryKeys,
18
- useInfiniteVariants,
19
- } from "./product-variants"
20
- import { categoriesQueryKeys, useInfiniteCategories } from "./categories"
21
- import { collectionsQueryKeys, useInfiniteCollections } from "./collections"
22
- import { productTagsQueryKeys, useInfiniteProductTags } from "./tags"
23
- import { productTypesQueryKeys, useInfiniteProductTypes } from "./product-types"
14
+ import { queryKeysFactory } from "../../lib/query-key-factory"
24
15
 
25
16
  const TRANSLATIONS_QUERY_KEY = "translations" as const
26
17
  export const translationsQueryKeys = queryKeysFactory(TRANSLATIONS_QUERY_KEY)
@@ -35,177 +26,77 @@ export const translationStatisticsQueryKeys = queryKeysFactory(
35
26
  TRANSLATION_STATISTICS_QUERY_KEY
36
27
  )
37
28
 
29
+ const TRANSLATION_ENTITIES_QUERY_KEY = "translation_entities" as const
30
+ export const translationEntitiesQueryKeys = queryKeysFactory(
31
+ TRANSLATION_ENTITIES_QUERY_KEY
32
+ )
33
+
34
+ const DEFAULT_PAGE_SIZE = 20
35
+
36
+ /**
37
+ * Hook to fetch entities with their translatable fields and all translations.
38
+ * Uses the /admin/translations/entities endpoint which returns entities
39
+ * with all their translations for all locales.
40
+ *
41
+ * @param reference - The entity type (e.g., "product", "product_variant")
42
+ * @param referenceId - Optional ID(s) to filter specific entities
43
+ * @param options - React Query options
44
+ */
38
45
  export const useReferenceTranslations = (
39
46
  reference: string,
40
- translatableFields: string[],
41
47
  referenceId?: string | string[],
42
48
  options?: Omit<
43
- UseInfiniteQueryOptions<any, FetchError, any, any, QueryKey, number>,
49
+ UseInfiniteQueryOptions<
50
+ HttpTypes.AdminTranslationEntitiesResponse,
51
+ FetchError,
52
+ {
53
+ pages: HttpTypes.AdminTranslationEntitiesResponse[]
54
+ pageParams: number[]
55
+ },
56
+ HttpTypes.AdminTranslationEntitiesResponse,
57
+ QueryKey,
58
+ number
59
+ >,
44
60
  "queryFn" | "queryKey" | "initialPageParam" | "getNextPageParam"
45
61
  >
46
62
  ) => {
47
- const referenceHookMap = new Map<
48
- string,
49
- () => Omit<UseInfiniteQueryResult<any, FetchError>, "data"> & {
50
- data: {
51
- translations: HttpTypes.AdminTranslation[]
52
- references: (Record<string, any> & { id: string })[]
53
- count: number
54
- }
55
- }
56
- >([
57
- [
58
- "product",
59
- () => {
60
- const fields = translatableFields.concat(["translations.*"]).join(",")
61
-
62
- const { data, ...rest } = useInfiniteProducts(
63
- { fields, id: referenceId ?? [] },
64
- options
65
- )
66
- const products = data?.pages.flatMap((page) => page.products) ?? []
67
-
68
- return {
69
- ...rest,
70
- data: {
71
- translations:
72
- products?.flatMap((product) => product.translations ?? []) ?? [],
73
- references: products ?? [],
74
- count: data?.pages[0]?.count ?? 0,
75
- },
76
- }
77
- },
78
- ],
79
- [
80
- "product_variant",
81
- () => {
82
- const fields = translatableFields.concat(["translations.*"]).join(",")
83
-
84
- const { data, ...rest } = useInfiniteVariants(
85
- { id: referenceId ?? [], fields },
86
- options
87
- )
88
- const variants = data?.pages.flatMap((page) => page.variants) ?? []
89
-
90
- return {
91
- ...rest,
92
- data: {
93
- translations:
94
- variants?.flatMap((variant) => variant.translations ?? []) ?? [],
95
- references: variants ?? [],
96
- translatableFields,
97
- count: data?.pages[0]?.count ?? 0,
98
- },
99
- }
100
- },
101
- ],
102
- [
103
- "product_category",
104
- () => {
105
- const fields = translatableFields.concat(["translations.*"]).join(",")
106
-
107
- const { data, ...rest } = useInfiniteCategories(
108
- { id: referenceId ?? [], fields },
109
- options
110
- )
111
- const categories =
112
- data?.pages.flatMap((page) => page.product_categories) ?? []
113
-
114
- return {
115
- ...rest,
116
- data: {
117
- translations:
118
- categories?.flatMap((category) => category.translations ?? []) ??
119
- [],
120
- references: categories ?? [],
121
- translatableFields,
122
- count: data?.pages[0]?.count ?? 0,
123
- },
124
- }
125
- },
126
- ],
127
- [
128
- "product_collection",
129
- () => {
130
- const fields = translatableFields.concat(["translations.*"]).join(",")
131
-
132
- const { data, ...rest } = useInfiniteCollections(
133
- { id: referenceId ?? [], fields },
134
- options
135
- )
136
- const collections =
137
- data?.pages.flatMap((page) => page.collections) ?? []
138
-
139
- return {
140
- ...rest,
141
- data: {
142
- translations:
143
- collections?.flatMap(
144
- (collection) => collection.translations ?? []
145
- ) ?? [],
146
- references: collections ?? [],
147
- translatableFields,
148
- count: data?.pages[0]?.count ?? 0,
149
- },
150
- }
151
- },
152
- ],
153
- [
154
- "product_type",
155
- () => {
156
- const fields = translatableFields.concat(["translations.*"]).join(",")
157
-
158
- const { data, ...rest } = useInfiniteProductTypes(
159
- { id: referenceId ?? [], fields },
160
- options
161
- )
162
- const product_types =
163
- data?.pages.flatMap((page) => page.product_types) ?? []
164
-
165
- return {
166
- ...rest,
167
- data: {
168
- translations:
169
- product_types?.flatMap((type) => type.translations ?? []) ?? [],
170
- references: product_types ?? [],
171
- count: data?.pages[0]?.count ?? 0,
172
- translatableFields,
173
- },
174
- }
175
- },
176
- ],
177
- [
178
- "product_tag",
179
- () => {
180
- const fields = translatableFields.concat(["translations.*"]).join(",")
181
-
182
- const { data, ...rest } = useInfiniteProductTags(
183
- { id: referenceId ?? [], fields },
184
- options
185
- )
186
- const product_tags =
187
- data?.pages.flatMap((page) => page.product_tags) ?? []
63
+ const { data, ...rest } = useInfiniteQuery({
64
+ queryKey: translationEntitiesQueryKeys.list({
65
+ type: reference,
66
+ id: referenceId,
67
+ }),
68
+ queryFn: async ({ pageParam = 0 }) => {
69
+ return sdk.admin.translation.entities({
70
+ type: reference,
71
+ id: referenceId,
72
+ limit: DEFAULT_PAGE_SIZE,
73
+ offset: pageParam,
74
+ })
75
+ },
76
+ initialPageParam: 0,
77
+ getNextPageParam: (lastPage) => {
78
+ const nextOffset = lastPage.offset + lastPage.limit
79
+ return nextOffset < lastPage.count ? nextOffset : undefined
80
+ },
81
+ ...options,
82
+ })
188
83
 
189
- return {
190
- ...rest,
191
- data: {
192
- translations:
193
- product_tags?.flatMap((tag) => tag.translations ?? []) ?? [],
194
- references: product_tags ?? [],
195
- translatableFields,
196
- count: data?.pages[0]?.count ?? 0,
197
- },
198
- }
199
- },
200
- ],
201
- // TODO: product option and option values
202
- ])
203
- const referenceHook = referenceHookMap.get(reference)
204
- if (!referenceHook) {
205
- throw new Error(`No hook found for reference type: ${reference}`)
84
+ const entitiesWithTranslations =
85
+ data?.pages.flatMap((page) => page.data) ?? []
86
+ const translations = entitiesWithTranslations.flatMap(
87
+ (entity) => entity.translations ?? []
88
+ )
89
+ const references = entitiesWithTranslations.map(
90
+ ({ translations: _, ...entity }) => entity
91
+ )
92
+ const count = data?.pages[0]?.count ?? 0
93
+
94
+ return {
95
+ references,
96
+ translations,
97
+ count,
98
+ ...rest,
206
99
  }
207
- const { data, ...rest } = referenceHook()
208
- return { ...data, ...rest }
209
100
  }
210
101
 
211
102
  export const useTranslations = (
@@ -237,30 +128,30 @@ export const useBatchTranslations = (
237
128
  HttpTypes.AdminBatchTranslations
238
129
  >
239
130
  ) => {
240
- const referenceInvalidationKeysMap = new Map<string, QueryKey>([
241
- ["product", productsQueryKeys.lists()],
242
- ["product_variant", productVariantQueryKeys.lists()],
243
- ["product_category", categoriesQueryKeys.lists()],
244
- ["product_collection", collectionsQueryKeys.lists()],
245
- ["product_type", productTypesQueryKeys.lists()],
246
- ["product_tag", productTagsQueryKeys.lists()],
247
- ])
248
-
249
- return useMutation({
131
+ const mutation = useMutation({
250
132
  mutationFn: (payload: HttpTypes.AdminBatchTranslations) =>
251
133
  sdk.admin.translation.batch(payload),
252
- onSuccess: (data, variables, context) => {
134
+ ...options,
135
+ })
136
+
137
+ /**
138
+ * Useful to call the invalidation separately from the batch request and await the refetch finishes.
139
+ */
140
+ const invalidateQueries = async () => {
141
+ await Promise.all([
253
142
  queryClient.invalidateQueries({
254
- queryKey: referenceInvalidationKeysMap.get(reference),
255
- })
143
+ queryKey: translationEntitiesQueryKeys.list({ type: reference }),
144
+ }),
256
145
  queryClient.invalidateQueries({
257
146
  queryKey: translationStatisticsQueryKeys.lists(),
258
- })
147
+ }),
148
+ ])
149
+ }
259
150
 
260
- options?.onSuccess?.(data, variables, context)
261
- },
262
- ...options,
263
- })
151
+ return {
152
+ ...mutation,
153
+ invalidateQueries,
154
+ }
264
155
  }
265
156
 
266
157
  export const useTranslationSettings = (
@@ -284,6 +175,27 @@ export const useTranslationSettings = (
284
175
  return { ...data, ...rest }
285
176
  }
286
177
 
178
+ export const useTranslationEntities = (
179
+ query: HttpTypes.AdminTranslationEntitiesParams,
180
+ options?: Omit<
181
+ UseQueryOptions<
182
+ HttpTypes.AdminTranslationEntitiesResponse,
183
+ FetchError,
184
+ HttpTypes.AdminTranslationEntitiesResponse,
185
+ QueryKey
186
+ >,
187
+ "queryFn" | "queryKey"
188
+ >
189
+ ) => {
190
+ const { data, ...rest } = useQuery({
191
+ queryKey: translationEntitiesQueryKeys.list(query),
192
+ queryFn: () => sdk.admin.translation.entities(query),
193
+ ...options,
194
+ })
195
+
196
+ return { ...data, ...rest }
197
+ }
198
+
287
199
  export const useTranslationStatistics = (
288
200
  query?: HttpTypes.AdminTranslationStatisticsParams,
289
201
  options?: Omit<
@@ -9,6 +9,7 @@ import {
9
9
  DateCell,
10
10
  DateHeader,
11
11
  } from "../../../components/table/table-cells/common/date-cell"
12
+ import { countries } from "../../../lib/data/countries"
12
13
  import { CountryCell } from "../../../components/table/table-cells/order/country-cell"
13
14
  import {
14
15
  CustomerCell,
@@ -101,10 +102,10 @@ export const useOrderTableColumns = (props: UseOrderTableColumnsProps) => {
101
102
  const isFullyRefunded = row.original.payment_status === "refunded"
102
103
  const total = !isFullyRefunded
103
104
  ? getValue()
104
- : row.original.payment_collections.reduce(
105
+ : row.original.payment_collections?.reduce(
105
106
  (acc, payCol) => acc + (payCol.refunded_amount ?? 0),
106
107
  0
107
- )
108
+ ) || 0
108
109
  const currencyCode = row.original.currency_code
109
110
 
110
111
  return (
@@ -121,7 +122,8 @@ export const useOrderTableColumns = (props: UseOrderTableColumnsProps) => {
121
122
  columnHelper.display({
122
123
  id: "actions",
123
124
  cell: ({ row }) => {
124
- const country = row.original.shipping_address?.country
125
+ const countryCode = row.original.shipping_address?.country_code
126
+ const country = countries.find((c) => c.iso_2 === countryCode)
125
127
 
126
128
  return <CountryCell country={country} />
127
129
  },