@mercurjs/admin 2.2.0-canary.29 → 2.2.0-canary.30

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 (252) hide show
  1. package/dist/{add-campaign-promotions-PBKYGW67.js → add-campaign-promotions-7VQ4YSDF.js} +11 -11
  2. package/dist/{adjust-inventory-KNHM7QEV.js → adjust-inventory-DOJ66E2D.js} +8 -8
  3. package/dist/{api-key-management-create-7SIKAXEH.js → api-key-management-create-6FLITJ2S.js} +3 -3
  4. package/dist/{api-key-management-detail-ELMPBXEB.js → api-key-management-detail-ANVRI5YV.js} +12 -13
  5. package/dist/{api-key-management-edit-C4FYJZGH.js → api-key-management-edit-Z5F3GSZO.js} +3 -3
  6. package/dist/{api-key-management-list-CUL3EU54.js → api-key-management-list-AIFIEFQX.js} +5 -5
  7. package/dist/{api-key-management-sales-channels-JLSDZRG6.js → api-key-management-sales-channels-NLFQSL4H.js} +8 -9
  8. package/dist/{attribute-create-VR3TJH5H.js → attribute-create-BCNSJO5F.js} +11 -11
  9. package/dist/{attribute-create-possible-value-EXVHC272.js → attribute-create-possible-value-MLUBL2LB.js} +1 -1
  10. package/dist/{attribute-detail-AIARG6IK.js → attribute-detail-E7IQZW7F.js} +13 -13
  11. package/dist/{attribute-edit-3PISS3NP.js → attribute-edit-UYGZZCMQ.js} +3 -3
  12. package/dist/{attribute-edit-possible-value-QZWGVFK2.js → attribute-edit-possible-value-MVYVVF23.js} +3 -3
  13. package/dist/{attribute-edit-ranking-7AAAYEC7.js → attribute-edit-ranking-WHFPAM7T.js} +1 -1
  14. package/dist/{attribute-list-TH4VPJUA.js → attribute-list-XDW6VE4J.js} +12 -12
  15. package/dist/{breadcrumb-CO5DVI72.js → breadcrumb-OYF6FUUL.js} +1 -1
  16. package/dist/{campaign-detail-UIDRN6TA.js → campaign-detail-YEX2W33U.js} +14 -14
  17. package/dist/{categories-metadata-INVMU224.js → categories-metadata-WSFKMQSW.js} +8 -8
  18. package/dist/{category-create-AR33DJYX.js → category-create-QNQKIXYH.js} +3 -3
  19. package/dist/{category-detail-M7SYPDPA.js → category-detail-UHTEDGZ4.js} +18 -18
  20. package/dist/{category-edit-XKANIIH5.js → category-edit-6D6RZ7V2.js} +2 -2
  21. package/dist/{category-icon-edit-SP5TQYA7.js → category-icon-edit-SRCDLZ65.js} +2 -2
  22. package/dist/{category-list-XAINIL74.js → category-list-KNBCMJPI.js} +7 -7
  23. package/dist/{category-media-IGRRTZ65.js → category-media-MBK52QCA.js} +2 -2
  24. package/dist/{category-organize-U6UO35Y3.js → category-organize-7WFAJ46F.js} +2 -2
  25. package/dist/{category-products-LWPBSQMC.js → category-products-5VEHSKOC.js} +21 -21
  26. package/dist/{chunk-AWLDIHXR.js → chunk-27PAP64U.js} +1 -1
  27. package/dist/{chunk-3TZWLHMQ.js → chunk-3KL4OL3I.js} +1 -1
  28. package/dist/{chunk-CPL24ZKA.js → chunk-3MQJARVG.js} +5 -5
  29. package/dist/{chunk-7JLBIALC.js → chunk-3V54HZK7.js} +4 -4
  30. package/dist/{chunk-TKFNBBX7.js → chunk-3ZKJ4F7B.js} +6 -6
  31. package/dist/{chunk-GVEF6UDT.js → chunk-46MOMKPW.js} +1 -1
  32. package/dist/{chunk-6ERWTLAW.js → chunk-4XGB5NDV.js} +2 -2
  33. package/dist/{chunk-KYFWVLWO.js → chunk-5I6YZOBU.js} +1 -1
  34. package/dist/{chunk-QPLEFEOZ.js → chunk-5K5VNKSE.js} +1 -1
  35. package/dist/{chunk-FJHAAROU.js → chunk-6MZPZ5KV.js} +1 -1
  36. package/dist/{chunk-M2E3PKA4.js → chunk-AM5XDEIN.js} +22 -42
  37. package/dist/{chunk-WJGABDWC.js → chunk-ARAK63IS.js} +1 -1
  38. package/dist/{chunk-M3YII6OB.js → chunk-B33LL4AM.js} +1 -1
  39. package/dist/{chunk-GSIFJY3P.js → chunk-B4YTTIYS.js} +1 -1
  40. package/dist/{chunk-VS4LCJLY.js → chunk-BVWAWPJO.js} +1 -1
  41. package/dist/{chunk-JRLDKKCM.js → chunk-DBZV75X3.js} +5 -5
  42. package/dist/{chunk-ORWIYNP2.js → chunk-DCD5KNOW.js} +4 -4
  43. package/dist/{chunk-PJVUDTJF.js → chunk-DWAAPLKD.js} +6 -6
  44. package/dist/{chunk-LC3QY7KZ.js → chunk-EAJMQKL5.js} +1 -1
  45. package/dist/{chunk-CGG4U2MZ.js → chunk-ELYCSQWC.js} +10 -10
  46. package/dist/{chunk-533GMKEG.js → chunk-ER7GGJ5A.js} +22 -2
  47. package/dist/{chunk-UUTACMA5.js → chunk-ERQBTOAZ.js} +2 -2
  48. package/dist/{chunk-GY7LZODD.js → chunk-EXPDYI26.js} +9 -9
  49. package/dist/{chunk-PT3DTHQK.js → chunk-FDXE4XDD.js} +1 -1
  50. package/dist/{chunk-6IZ5YBWE.js → chunk-GFMTZ5O3.js} +9 -2
  51. package/dist/{chunk-3JN4WUVU.js → chunk-GK6V5XL3.js} +3 -3
  52. package/dist/{chunk-ZUW6LUA4.js → chunk-GKWXWN6R.js} +7 -7
  53. package/dist/{chunk-W6SVRN6P.js → chunk-GME72WUF.js} +68 -61
  54. package/dist/{chunk-RDTFLHYO.js → chunk-GV2Z3IHA.js} +1 -1
  55. package/dist/{chunk-4UWPTSZK.js → chunk-GX7OEF7F.js} +263 -625
  56. package/dist/{chunk-3C5MNNUD.js → chunk-HVDBP2QZ.js} +1 -1
  57. package/dist/{chunk-3MC3ZGY2.js → chunk-JFXAJYAT.js} +1 -1
  58. package/dist/{chunk-EWTSVKNN.js → chunk-KIQM7FNE.js} +1 -1
  59. package/dist/{chunk-3RKBBZGV.js → chunk-KOOVZT22.js} +44 -29
  60. package/dist/{chunk-4DP2SPYG.js → chunk-LPETBANQ.js} +5 -5
  61. package/dist/{chunk-PL44IXBM.js → chunk-LTYARVER.js} +5 -5
  62. package/dist/{chunk-RJNZPFXH.js → chunk-LX5XLXPI.js} +1 -1
  63. package/dist/{chunk-W7ZOQUWH.js → chunk-M674QP3K.js} +5 -5
  64. package/dist/{chunk-OQTFMCR7.js → chunk-MBWL2AUF.js} +9 -9
  65. package/dist/{chunk-QJSKG6JE.js → chunk-MHTSIOQS.js} +4 -4
  66. package/dist/{chunk-LMTZHAXQ.js → chunk-NK2VVZGH.js} +1 -1
  67. package/dist/{chunk-RF3LELGM.js → chunk-NNIU5SUY.js} +9 -9
  68. package/dist/{chunk-4INT6ILW.js → chunk-O4NME2PB.js} +1 -1
  69. package/dist/{chunk-LULXENH7.js → chunk-P4TBXTHK.js} +12 -12
  70. package/dist/{chunk-RNBZLAMF.js → chunk-PQZWP6CW.js} +1 -1
  71. package/dist/{chunk-5T45PYWI.js → chunk-PXETYIW2.js} +6 -6
  72. package/dist/{chunk-J3AMUGGZ.js → chunk-Q4Q5BKCY.js} +1 -1
  73. package/dist/{chunk-QKJGSZI2.js → chunk-Q5HXKDZG.js} +1 -1
  74. package/dist/{chunk-X4RTQG5W.js → chunk-QD5LDTJ3.js} +1 -1
  75. package/dist/{chunk-XGUUM3S6.js → chunk-QJ4J5F6T.js} +1 -1
  76. package/dist/{chunk-P23LLUTC.js → chunk-QKUCVPQ2.js} +2 -2
  77. package/dist/{chunk-XVSJKCCQ.js → chunk-QPFQLFKV.js} +1 -1
  78. package/dist/{chunk-S55ACYBL.js → chunk-R6MM5UOX.js} +4 -4
  79. package/dist/{chunk-45HY2CTD.js → chunk-RCOMAL7R.js} +4 -4
  80. package/dist/{chunk-I7OXXHTR.js → chunk-RUVEMICX.js} +1 -1
  81. package/dist/{chunk-LEHS6RED.js → chunk-RWAEZQCV.js} +77 -21
  82. package/dist/{chunk-55TMW3GW.js → chunk-SCYPLUXT.js} +8 -4
  83. package/dist/{chunk-FWWPSH6V.js → chunk-SU444Q24.js} +21 -53
  84. package/dist/{chunk-MASXQMJY.js → chunk-TKC3RDRT.js} +4 -4
  85. package/dist/{chunk-5AC76XY6.js → chunk-U5UXL42H.js} +2 -2
  86. package/dist/{chunk-UESUZHNN.js → chunk-VJ32NGUB.js} +1 -1
  87. package/dist/{chunk-N6R2WOJ7.js → chunk-WBSUHLO7.js} +1 -1
  88. package/dist/{chunk-7ZL46D3W.js → chunk-WE66XPIF.js} +1 -1
  89. package/dist/{chunk-2L4W75VS.js → chunk-WKTRJNOK.js} +1 -1
  90. package/dist/{chunk-B5OMHYJ5.js → chunk-WV43FOTY.js} +5 -5
  91. package/dist/{chunk-DZO3C6BC.js → chunk-XBMSMHRJ.js} +1 -1
  92. package/dist/{chunk-FNGPOGDR.js → chunk-XGWYGDQN.js} +4 -4
  93. package/dist/{chunk-LYZDVZWA.js → chunk-XH5GIQOS.js} +1 -1
  94. package/dist/{chunk-OKWGPKVK.js → chunk-XKRR5ALR.js} +1 -1
  95. package/dist/{chunk-TLMVUH67.js → chunk-XNGAFAQ7.js} +5 -5
  96. package/dist/{chunk-XZRINNEK.js → chunk-Y7KAW3E7.js} +1 -1
  97. package/dist/{chunk-7GSUDIU3.js → chunk-YTTITSCF.js} +9 -9
  98. package/dist/{chunk-CKQPO2SN.js → chunk-YW2P62WD.js} +2 -2
  99. package/dist/{chunk-6FLSBL4Q.js → chunk-YZBEJ3CY.js} +1914 -1625
  100. package/dist/{collection-add-products-JEV3HTQA.js → collection-add-products-QBUVYWEK.js} +20 -20
  101. package/dist/{collection-create-UNGPKT7H.js → collection-create-LTCUNTEN.js} +2 -2
  102. package/dist/{collection-detail-ZGKHTJ5H.js → collection-detail-CNMO72V2.js} +17 -17
  103. package/dist/{collection-edit-LQEQ6YGD.js → collection-edit-XB7XNWKT.js} +2 -2
  104. package/dist/{collection-icon-edit-HNYGQJXC.js → collection-icon-edit-SJUTX7SL.js} +2 -2
  105. package/dist/{collection-list-TRNIZE2V.js → collection-list-2LWAVDXE.js} +19 -19
  106. package/dist/{collection-media-G42DRQ6K.js → collection-media-NXMSBVNW.js} +2 -2
  107. package/dist/{collection-metadata-6SD67JUV.js → collection-metadata-4UP7MB2G.js} +8 -8
  108. package/dist/{commission-rule-commission-edit-AMJAHLPW.js → commission-rule-commission-edit-CPBCAN6K.js} +1 -1
  109. package/dist/{commission-rule-create-A2N3JNUI.js → commission-rule-create-6YJX5BRC.js} +10 -3
  110. package/dist/{commission-rule-detail-4RULHWYE.js → commission-rule-detail-QF2TJ6WF.js} +4 -4
  111. package/dist/{commissions-list-QDBOLLAF.js → commissions-list-ENBXDOND.js} +7 -7
  112. package/dist/{constants-Bahlh59D.d.ts → constants-DINN0J9x.d.ts} +12 -5
  113. package/dist/{customer-detail-HSVYFZN7.js → customer-detail-ASONGOEE.js} +11 -11
  114. package/dist/{customer-group-detail-YHWFAT2F.js → customer-group-detail-Z5DFQHBD.js} +9 -9
  115. package/dist/{customer-group-list-GAG6CY33.js → customer-group-list-NEN5EBVH.js} +9 -9
  116. package/dist/{customer-group-metadata-ELFKJMYK.js → customer-group-metadata-MWI6PEIS.js} +8 -8
  117. package/dist/{customer-metadata-4H6ADARR.js → customer-metadata-AAANMDFW.js} +8 -8
  118. package/dist/{customers-add-customer-group-DBKMGNEY.js → customers-add-customer-group-WU4TPDZL.js} +16 -16
  119. package/dist/{edit-inventory-item-NL5WNNI3.js → edit-inventory-item-DNSEIVDG.js} +8 -8
  120. package/dist/{edit-inventory-item-attributes-2JEH72WW.js → edit-inventory-item-attributes-NNSYKNZS.js} +8 -8
  121. package/dist/{edit-reservation-TBZL2REV.js → edit-reservation-UBOAYKRO.js} +2 -2
  122. package/dist/{edit-rules-XYTK7DQ2.js → edit-rules-DFLANIHQ.js} +8 -8
  123. package/dist/{global-commission-edit-444IQHQS.js → global-commission-edit-QDPLLFM5.js} +1 -1
  124. package/dist/index.d.ts +2 -2
  125. package/dist/index.js +220 -220
  126. package/dist/{inventory-create-7RQSCNCQ.js → inventory-create-TADTOF5K.js} +9 -9
  127. package/dist/{inventory-detail-BT3EEWZT.js → inventory-detail-SYC6STHZ.js} +13 -13
  128. package/dist/{inventory-list-JCSZES64.js → inventory-list-QK4YHPQ6.js} +3 -3
  129. package/dist/{inventory-metadata-ZGLTDSQB.js → inventory-metadata-FRVMXW4Q.js} +8 -8
  130. package/dist/{inventory-stock-US7LGBC4.js → inventory-stock-RD6RJLAY.js} +8 -8
  131. package/dist/{loader-XPJWDZU3.js → loader-PQ4CT5ZD.js} +1 -1
  132. package/dist/{location-detail-MPSZ6VYO.js → location-detail-WN5HVKYF.js} +10 -10
  133. package/dist/{location-fulfillment-providers-6SHQJMAO.js → location-fulfillment-providers-ABZ65GIC.js} +19 -19
  134. package/dist/{location-list-QXIHD6NJ.js → location-list-CZA5V424.js} +10 -10
  135. package/dist/{location-sales-channels-46SPET7R.js → location-sales-channels-J7ZV7RHB.js} +7 -8
  136. package/dist/{location-service-zone-create-R6OUVLOC.js → location-service-zone-create-7AQNNBIB.js} +6 -6
  137. package/dist/{location-service-zone-manage-areas-V5QULP5K.js → location-service-zone-manage-areas-FW7DW6C4.js} +6 -6
  138. package/dist/{location-service-zone-shipping-option-create-AUNZVIGU.js → location-service-zone-shipping-option-create-IPQF3VMS.js} +8 -8
  139. package/dist/{login-NFPUZDAL.js → login-J6UNTZII.js} +8 -8
  140. package/dist/{manage-locations-WW35SVOX.js → manage-locations-3IXLBRY5.js} +1 -1
  141. package/dist/{marketplace-detail-BIYPD5HW.js → marketplace-detail-HYZKPGFP.js} +10 -10
  142. package/dist/{marketplace-metadata-FYJ7TJLZ.js → marketplace-metadata-XWMSFSLY.js} +8 -8
  143. package/dist/{offer-detail-page-CHPMMAI3.js → offer-detail-page-563ISJ2A.js} +13 -13
  144. package/dist/{offers-GLTALPMB.js → offers-VAGLCRW6.js} +12 -12
  145. package/dist/{order-create-edit-AIE4ULOL.js → order-create-edit-A52YVMEP.js} +11 -11
  146. package/dist/{order-create-exchange-NUTFZBDA.js → order-create-exchange-MVNQIEXK.js} +16 -16
  147. package/dist/{order-create-refund-A4AXOFZC.js → order-create-refund-XXHC5LFS.js} +8 -8
  148. package/dist/{order-detail-5AT6CB7Y.js → order-detail-O327KLZC.js} +13 -13
  149. package/dist/{order-edit-billing-address-Y55XBPZI.js → order-edit-billing-address-ER7MGZEB.js} +9 -9
  150. package/dist/{order-edit-email-44O3ARQ4.js → order-edit-email-XYHRJQ2T.js} +8 -8
  151. package/dist/{order-edit-shipping-address-UI2AHBXW.js → order-edit-shipping-address-YPEC2Q6U.js} +8 -8
  152. package/dist/{order-list-YHFF6DGL.js → order-list-43LBG6AQ.js} +9 -9
  153. package/dist/{order-metadata-3U5KT3MW.js → order-metadata-EAGVYWZL.js} +8 -8
  154. package/dist/{order-request-transfer-OM3BPIWZ.js → order-request-transfer-O4Q73SK5.js} +8 -8
  155. package/dist/pages/index.d.ts +290 -280
  156. package/dist/pages/index.js +83 -84
  157. package/dist/{price-list-configuration-CNNPJPFF.js → price-list-configuration-XAQ2OEG4.js} +8 -8
  158. package/dist/{price-list-create-WA62TKA2.js → price-list-create-H7WBDAC5.js} +20 -20
  159. package/dist/{price-list-detail-GUKZPZ5N.js → price-list-detail-BYXRB2ND.js} +18 -18
  160. package/dist/{price-list-edit-MEM47NGY.js → price-list-edit-BYSFESIX.js} +2 -2
  161. package/dist/{price-list-list-GQ5KMQOH.js → price-list-list-NNCTFTSJ.js} +6 -6
  162. package/dist/{price-list-prices-add-3TR5HL2I.js → price-list-prices-add-RN5RKGF6.js} +19 -19
  163. package/dist/{price-list-prices-edit-R52K4MBL.js → price-list-prices-edit-P3HBNQVA.js} +8 -8
  164. package/dist/{product-add-existing-attributes-AC4643LI.js → product-add-existing-attributes-3DKKBGKG.js} +27 -24
  165. package/dist/{product-attributes-2LAKXXX6.js → product-attributes-CGLY56QN.js} +2 -2
  166. package/dist/{product-bulk-edit-G7QTYQHG.js → product-bulk-edit-L5VJUWHK.js} +1 -1
  167. package/dist/{product-create-JAZJIOHI.js → product-create-BJPAN5FR.js} +15 -15
  168. package/dist/{product-create-attribute-ELMLVRUB.js → product-create-attribute-LBQENHSF.js} +18 -8
  169. package/dist/{product-create-variant-FQSREC66.js → product-create-variant-4PS7DJUI.js} +5 -5
  170. package/dist/{product-detail-77DV4TAW.js → product-detail-JKPHVZT5.js} +17 -15
  171. package/dist/{product-edit-3Q5E5E5L.js → product-edit-P6XH3L6L.js} +2 -2
  172. package/dist/product-edit-attribute-VGOXQKZ3.js +368 -0
  173. package/dist/{product-list-33W3IZGZ.js → product-list-XSNCYJWP.js} +18 -18
  174. package/dist/{product-media-ZG5KTNVK.js → product-media-AH6H4HJX.js} +8 -5
  175. package/dist/{product-metadata-H53ZIWBS.js → product-metadata-NGELJKS3.js} +9 -9
  176. package/dist/{product-organization-ILQCXL7B.js → product-organization-CKUJWI3D.js} +84 -8
  177. package/dist/{product-sales-channels-7QCAABL4.js → product-sales-channels-5BL5U76N.js} +8 -9
  178. package/dist/{product-shipping-profile-4K7LTJ5K.js → product-shipping-profile-GOXQTNIA.js} +2 -2
  179. package/dist/{product-tag-create-4OT4PMCG.js → product-tag-create-26GJFMP3.js} +8 -8
  180. package/dist/{product-tag-detail-UG55ECBZ.js → product-tag-detail-GI7UI22V.js} +21 -21
  181. package/dist/{product-tag-edit-RXF6ZZ6E.js → product-tag-edit-LJ5LOAB4.js} +8 -8
  182. package/dist/{product-tag-list-ZCXPJR6Z.js → product-tag-list-H3BEJC3T.js} +21 -21
  183. package/dist/{product-tag-metadata-HN5QRCYY.js → product-tag-metadata-VUQYHROC.js} +8 -8
  184. package/dist/{product-type-detail-5U53ERTD.js → product-type-detail-YLTHK3WR.js} +16 -16
  185. package/dist/{product-type-metadata-QUCMB3ZJ.js → product-type-metadata-GX45OZJN.js} +8 -8
  186. package/dist/{product-variant-detail-6XBLXEXQ.js → product-variant-detail-NTZAL233.js} +9 -9
  187. package/dist/{product-variant-edit-3KAFS4OC.js → product-variant-edit-QJDI34H5.js} +10 -10
  188. package/dist/{product-variant-metadata-N5H2VPGQ.js → product-variant-metadata-7YFMPPB6.js} +8 -8
  189. package/dist/{promotion-create-Y2XVWGAT.js → promotion-create-4CYXDQ4X.js} +8 -8
  190. package/dist/{promotion-detail-CPZLLTKU.js → promotion-detail-NFNBZ6YZ.js} +12 -12
  191. package/dist/{promotion-list-TVXL23BH.js → promotion-list-QWALFJWV.js} +5 -5
  192. package/dist/{refund-reason-create-CIXYHBRC.js → refund-reason-create-UKEEJ47T.js} +8 -8
  193. package/dist/{refund-reason-edit-AXMEDPRT.js → refund-reason-edit-5TIFGV34.js} +8 -8
  194. package/dist/{refund-reason-list-LDLZ4JL6.js → refund-reason-list-T55XZNAP.js} +15 -15
  195. package/dist/{region-detail-2HFBXNZX.js → region-detail-4MELDU2I.js} +4 -4
  196. package/dist/{region-metadata-QGH7IBQU.js → region-metadata-ZCPAAMLY.js} +8 -8
  197. package/dist/{reservation-create-F6YDCLCG.js → reservation-create-WWGZ5A7Z.js} +2 -2
  198. package/dist/{reservation-detail-7TL2OFEM.js → reservation-detail-K7LQX5TT.js} +9 -9
  199. package/dist/{reservation-list-RM6QUKG7.js → reservation-list-AQFSNZNN.js} +4 -4
  200. package/dist/{reservation-metadata-UXACXYO6.js → reservation-metadata-4W5SP7OA.js} +8 -8
  201. package/dist/{reset-password-WLZSNWHV.js → reset-password-37QWVIGC.js} +1 -1
  202. package/dist/{return-reason-list-IXHFGQUJ.js → return-reason-list-IZNMWPEM.js} +11 -11
  203. package/dist/{sales-channel-add-products-76RTGNYX.js → sales-channel-add-products-RDYMBNAE.js} +21 -21
  204. package/dist/{sales-channel-create-TAKKGGK3.js → sales-channel-create-APJ6UXEW.js} +2 -2
  205. package/dist/{sales-channel-detail-QBCCXUMD.js → sales-channel-detail-XF3WPMVT.js} +16 -16
  206. package/dist/{sales-channel-edit-HEESIKZH.js → sales-channel-edit-CBZZQ2VG.js} +2 -2
  207. package/dist/{sales-channel-list-I72W2XTH.js → sales-channel-list-46AJDQZ6.js} +12 -13
  208. package/dist/{sales-channel-metadata-RD6QDHRW.js → sales-channel-metadata-AWVCB7DX.js} +8 -8
  209. package/dist/{shipping-option-type-create-LXYYXNSQ.js → shipping-option-type-create-NSGPERMQ.js} +8 -8
  210. package/dist/{shipping-option-type-detail-2IQSQ5BQ.js → shipping-option-type-detail-IZ2XRP3S.js} +8 -8
  211. package/dist/{shipping-option-type-edit-4XKXWCN3.js → shipping-option-type-edit-KFVTVVGH.js} +8 -8
  212. package/dist/{shipping-option-type-list-QLBJ333L.js → shipping-option-type-list-2P65XUH5.js} +9 -9
  213. package/dist/{shipping-profile-metadata-PVNYV7DY.js → shipping-profile-metadata-FPD35TQ3.js} +8 -8
  214. package/dist/{store-bulk-edit-JAOT5GY2.js → store-bulk-edit-N4XSW6UA.js} +1 -1
  215. package/dist/{store-create-F6W5CSH2.js → store-create-VFXM4O7E.js} +8 -8
  216. package/dist/{store-details-SNDIUE5E.js → store-details-2V46HEJD.js} +20 -20
  217. package/dist/{store-edit-BRS7YYE5.js → store-edit-G6JFYGXK.js} +3 -3
  218. package/dist/{store-list-IPMJOHOA.js → store-list-5FPJV3KV.js} +17 -17
  219. package/dist/{store-member-invite-MNRTPHUB.js → store-member-invite-7ORH52T4.js} +1 -1
  220. package/dist/{tax-region-create-3RBWOWVG.js → tax-region-create-HUF2FCLU.js} +9 -9
  221. package/dist/{tax-region-detail-L5AKP2R6.js → tax-region-detail-UZ776HBC.js} +11 -11
  222. package/dist/{tax-region-edit-XHO3ELVD.js → tax-region-edit-M24WWMU6.js} +8 -8
  223. package/dist/tax-region-list-6LH6TYQZ.js +1 -1
  224. package/dist/{tax-region-metadata-NYTCYO6D.js → tax-region-metadata-XJFQE3XR.js} +8 -8
  225. package/dist/{tax-region-province-detail-INTRLPOC.js → tax-region-province-detail-7JRSANC2.js} +11 -11
  226. package/dist/{tax-region-tax-override-create-M4NJX2F4.js → tax-region-tax-override-create-G5DAVZDV.js} +21 -21
  227. package/dist/{tax-region-tax-override-edit-LMMRTZZG.js → tax-region-tax-override-edit-D52MNBCS.js} +21 -21
  228. package/dist/{user-detail-6CCQQPFR.js → user-detail-JV2BQ43X.js} +1 -1
  229. package/dist/user-list-IUJTQS5X.js +1 -1
  230. package/dist/{user-metadata-VCWUSKHV.js → user-metadata-ZBON4ZVS.js} +8 -8
  231. package/package.json +7 -7
  232. package/dist/chunk-UKLRBS4W.js +0 -61
  233. package/dist/product-edit-attribute-WW4LCYD7.js +0 -175
  234. package/dist/{campaign-list-RSWCOH4J.js → campaign-list-IJCTNMOH.js} +1 -1
  235. package/dist/{chunk-3C53G3UL.js → chunk-24WHXAR7.js} +4 -4
  236. package/dist/{chunk-K5UDB76J.js → chunk-7WAQRY46.js} +4 -4
  237. package/dist/{chunk-ISS4LS3E.js → chunk-EW77LP7P.js} +3 -3
  238. package/dist/{chunk-3YVZLXH7.js → chunk-IOXHJONC.js} +4 -4
  239. package/dist/{chunk-PSM56FCC.js → chunk-UZO3CIEN.js} +3 -3
  240. package/dist/{customer-group-add-customers-MOWMJ7PG.js → customer-group-add-customers-CVFWLLP3.js} +8 -8
  241. package/dist/{customer-list-4Y27FCH6.js → customer-list-TBV4DHXV.js} +1 -1
  242. package/dist/{marketplace-add-currencies-J5NZQFVS.js → marketplace-add-currencies-7MNMK5MD.js} +8 -8
  243. package/dist/{offer-variant-detail-page-DW4L5LZW.js → offer-variant-detail-page-UNWZBHXM.js} +7 -7
  244. package/dist/{order-create-claim-CQ7ECVA6.js → order-create-claim-J5L46I5K.js} +8 -8
  245. package/dist/{order-create-return-LDLSBK3K.js → order-create-return-65KF5A2N.js} +8 -8
  246. package/dist/{payout-list-OJCFABOS.js → payout-list-6HQJM5YW.js} +2 -2
  247. package/dist/{product-type-list-3QPADFNI.js → product-type-list-FCPUCMHZ.js} +1 -1
  248. package/dist/{region-add-countries-UPRSJ6ZY.js → region-add-countries-C23C6QUJ.js} +8 -8
  249. package/dist/{region-create-3YST5TQW.js → region-create-L2JYP7DK.js} +8 -8
  250. package/dist/{region-list-Z6PIQFHM.js → region-list-SDMLAQCG.js} +1 -1
  251. package/dist/{shipping-profiles-list-LI6KACDB.js → shipping-profiles-list-VUUGBT24.js} +1 -1
  252. package/dist/{user-invite-RER7BW6S.js → user-invite-KYSDELAV.js} +8 -8
@@ -1,18 +1,12 @@
1
1
  import {
2
2
  ProductMediaSection
3
- } from "./chunk-AWLDIHXR.js";
3
+ } from "./chunk-27PAP64U.js";
4
4
  import {
5
5
  SectionRow
6
6
  } from "./chunk-3XPXUIK3.js";
7
- import {
8
- useDataTableDateColumns
9
- } from "./chunk-UKLRBS4W.js";
10
- import {
11
- useDataTableDateFilters
12
- } from "./chunk-DGCPYCHU.js";
13
7
  import {
14
8
  PRODUCT_DETAIL_QUERY
15
- } from "./chunk-GVEF6UDT.js";
9
+ } from "./chunk-46MOMKPW.js";
16
10
  import {
17
11
  TwoColumnPage
18
12
  } from "./chunk-E74OUNA3.js";
@@ -20,36 +14,21 @@ import {
20
14
  Thumbnail
21
15
  } from "./chunk-WIYFXWRI.js";
22
16
  import {
23
- DataTable
24
- } from "./chunk-C4XKPQ6T.js";
17
+ _DataTable,
18
+ useDataTable
19
+ } from "./chunk-JGCGVEFZ.js";
25
20
  import {
26
21
  useQueryParams
27
22
  } from "./chunk-THHRRYRS.js";
28
23
  import {
29
24
  require_dist
30
- } from "./chunk-6FLSBL4Q.js";
31
- import {
32
- useProductTag
33
- } from "./chunk-PJR6W35H.js";
34
- import {
35
- productAttributesQueryKeys,
36
- useProductAttribute
37
- } from "./chunk-533GMKEG.js";
38
- import {
39
- useProductType
40
- } from "./chunk-46M463BR.js";
41
- import {
42
- useCollection
43
- } from "./chunk-QKJGSZI2.js";
25
+ } from "./chunk-YZBEJ3CY.js";
44
26
  import {
45
27
  useSeller
46
28
  } from "./chunk-LEG67A2R.js";
47
29
  import {
48
30
  ActionMenu
49
31
  } from "./chunk-BDGZ4EQO.js";
50
- import {
51
- useProductCategory
52
- } from "./chunk-KYFWVLWO.js";
53
32
  import {
54
33
  TwoColumnPageSkeleton
55
34
  } from "./chunk-INNFZYX2.js";
@@ -64,9 +43,8 @@ import {
64
43
  useProductVariants,
65
44
  useRejectProduct,
66
45
  useRemoveAttributeFromProduct,
67
- useRequestProductChanges,
68
- variantsQueryKeys
69
- } from "./chunk-M2E3PKA4.js";
46
+ useRequestProductChanges
47
+ } from "./chunk-AM5XDEIN.js";
70
48
  import {
71
49
  sdk
72
50
  } from "./chunk-ZBWL72TB.js";
@@ -80,19 +58,11 @@ import { useLoaderData, useParams } from "react-router-dom";
80
58
 
81
59
  // src/pages/products/product-detail/components/product-active-edit-section/product-active-edit-section.tsx
82
60
  var import_types = __toESM(require_dist(), 1);
83
- import { Fragment, useMemo, useState as useState2 } from "react";
84
- import { ExclamationCircleSolid } from "@medusajs/icons";
85
- import { Button, Container, Heading, Text, toast } from "@medusajs/ui";
61
+ import { useState as useState2 } from "react";
62
+ import { Button, Text, toast } from "@medusajs/ui";
86
63
  import {
87
- describeProductChangeAction,
88
- extractReferenceIds,
89
- formatFieldValue,
90
- humanizeFieldName,
91
- isImageList,
92
- isReferenceField,
93
- partitionProductChangeActions
64
+ ProductChangePanel
94
65
  } from "@mercurjs/dashboard-shared";
95
- import { useQueries } from "@tanstack/react-query";
96
66
  import { useTranslation as useTranslation2 } from "react-i18next";
97
67
 
98
68
  // src/components/common/confirm-prompt/confirm-prompt.tsx
@@ -175,256 +145,49 @@ var ConfirmPrompt = ({
175
145
  };
176
146
 
177
147
  // src/pages/products/product-detail/components/product-active-edit-section/product-active-edit-section.tsx
178
- import { Fragment as Fragment2, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
148
+ import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
179
149
  var VARIANT_LOOKUP_FIELDS = "id,title,sku,*images";
180
- var ImageStrip = ({
181
- images,
182
- faded
183
- }) => /* @__PURE__ */ jsx2(
184
- "div",
185
- {
186
- className: faded ? "flex items-center gap-1.5 opacity-50" : "flex items-center gap-1.5",
187
- children: images.map((image, idx) => /* @__PURE__ */ jsx2(Thumbnail, { src: image.url, size: "base" }, `${image.url}-${idx}`))
188
- }
189
- );
190
- var TypeName = ({ id }) => {
191
- const { product_type } = useProductType(id);
192
- return /* @__PURE__ */ jsx2(Fragment2, { children: product_type?.value ?? id });
193
- };
194
- var CollectionName = ({ id }) => {
195
- const { collection } = useCollection(id);
196
- return /* @__PURE__ */ jsx2(Fragment2, { children: collection?.title ?? id });
197
- };
198
- var CategoryName = ({ id }) => {
199
- const { product_category } = useProductCategory(id);
200
- return /* @__PURE__ */ jsx2(Fragment2, { children: product_category?.name ?? id });
201
- };
202
- var TagName = ({ id }) => {
203
- const { product_tag } = useProductTag(id);
204
- return /* @__PURE__ */ jsx2(Fragment2, { children: product_tag?.value ?? id });
205
- };
206
- var ReferenceName = ({
207
- field,
208
- id
209
- }) => {
210
- switch (field) {
211
- case "type_id":
212
- return /* @__PURE__ */ jsx2(TypeName, { id });
213
- case "collection_id":
214
- return /* @__PURE__ */ jsx2(CollectionName, { id });
215
- case "categories":
216
- return /* @__PURE__ */ jsx2(CategoryName, { id });
217
- case "tags":
218
- return /* @__PURE__ */ jsx2(TagName, { id });
219
- }
220
- };
221
- var ReferenceList = ({
222
- field,
223
- ids
224
- }) => {
225
- if (!ids.length) return /* @__PURE__ */ jsx2(Fragment2, { children: "-" });
226
- return /* @__PURE__ */ jsx2(Fragment2, { children: ids.map((id, idx) => /* @__PURE__ */ jsxs2(Fragment, { children: [
227
- idx > 0 && ", ",
228
- /* @__PURE__ */ jsx2(ReferenceName, { field, id })
229
- ] }, `${field}-${id}`)) });
230
- };
231
- var FieldRow = ({ diff }) => {
232
- const { t } = useTranslation2();
233
- const hasPrevious = diff.previous !== void 0 && diff.previous !== null && diff.previous !== "" && !(Array.isArray(diff.previous) && diff.previous.length === 0);
234
- const nextIsImages = isImageList(diff.next);
235
- const previousIsImages = isImageList(diff.previous);
236
- const renderAsImages = nextIsImages || previousIsImages;
237
- const renderAsReference = isReferenceField(diff.field);
238
- return /* @__PURE__ */ jsxs2("div", { className: "flex items-start gap-4", children: [
239
- /* @__PURE__ */ jsx2(
240
- Text,
241
- {
242
- size: "small",
243
- weight: "plus",
244
- leading: "compact",
245
- className: "text-ui-fg-subtle w-[160px] shrink-0",
246
- children: t(`fields.${diff.field}`, {
247
- defaultValue: humanizeFieldName(diff.field)
248
- })
249
- }
250
- ),
251
- renderAsImages ? /* @__PURE__ */ jsxs2("div", { className: "flex flex-1 flex-wrap items-center gap-2", children: [
252
- hasPrevious && previousIsImages && /* @__PURE__ */ jsx2(ImageStrip, { images: diff.previous, faded: true }),
253
- hasPrevious && /* @__PURE__ */ jsx2(
254
- Text,
255
- {
256
- size: "small",
257
- leading: "compact",
258
- className: "text-ui-fg-subtle",
259
- children: "\u2192"
260
- }
261
- ),
262
- nextIsImages ? /* @__PURE__ */ jsx2(ImageStrip, { images: diff.next }) : /* @__PURE__ */ jsx2(
263
- Text,
264
- {
265
- size: "small",
266
- leading: "compact",
267
- className: "text-ui-fg-subtle",
268
- children: formatFieldValue(diff.next, diff.field)
269
- }
270
- )
271
- ] }) : renderAsReference ? /* @__PURE__ */ jsxs2(
272
- Text,
273
- {
274
- size: "small",
275
- leading: "compact",
276
- className: "text-ui-fg-subtle flex-1 whitespace-pre-line text-pretty",
277
- children: [
278
- hasPrevious && /* @__PURE__ */ jsx2("span", { className: "line-through", children: /* @__PURE__ */ jsx2(
279
- ReferenceList,
280
- {
281
- field: diff.field,
282
- ids: extractReferenceIds(
283
- diff.field,
284
- diff.previous
285
- )
286
- }
287
- ) }),
288
- hasPrevious && " \u2192 ",
289
- /* @__PURE__ */ jsx2(
290
- ReferenceList,
291
- {
292
- field: diff.field,
293
- ids: extractReferenceIds(diff.field, diff.next)
294
- }
295
- )
296
- ]
297
- }
298
- ) : /* @__PURE__ */ jsxs2(
299
- Text,
300
- {
301
- size: "small",
302
- leading: "compact",
303
- className: "text-ui-fg-subtle flex-1 whitespace-pre-line text-pretty",
304
- children: [
305
- hasPrevious && /* @__PURE__ */ jsx2("span", { className: "line-through", children: formatFieldValue(diff.previous, diff.field) }),
306
- hasPrevious && " \u2192 ",
307
- formatFieldValue(diff.next, diff.field)
308
- ]
309
- }
310
- )
311
- ] });
312
- };
313
- var AttributeActionLine = ({
314
- attributeId,
315
- valueIds
316
- }) => {
317
- const { product_attribute } = useProductAttribute(attributeId);
318
- const name = product_attribute?.name ?? attributeId;
319
- const values = product_attribute?.values ?? [];
320
- const selectedNames = valueIds && valueIds.length ? valueIds.map((id) => {
321
- const match = values.find((v) => v.id === id);
322
- return match?.name ?? id;
323
- }) : [];
324
- return /* @__PURE__ */ jsxs2(Text, { size: "small", leading: "compact", className: "text-ui-fg-subtle", children: [
325
- /* @__PURE__ */ jsx2("span", { className: "font-medium text-ui-fg-base", children: name }),
326
- selectedNames.length > 0 && `: ${selectedNames.join(", ")}`
327
- ] });
328
- };
329
- var VariantActionLine = ({
330
- title,
331
- images
332
- }) => /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-3", children: [
333
- images && images.length > 0 && /* @__PURE__ */ jsx2(ImageStrip, { images }),
334
- /* @__PURE__ */ jsx2(Text, { size: "small", leading: "compact", className: "text-ui-fg-subtle", children: /* @__PURE__ */ jsx2("span", { className: "font-medium text-ui-fg-base", children: title }) })
335
- ] });
336
- var ActionLine = ({
337
- action,
338
- variantsById
339
- }) => {
340
- const { t } = useTranslation2();
341
- const details = action.details ?? {};
342
- if (action.action === import_types.ProductChangeActionType.ATTRIBUTE_ADD || action.action === import_types.ProductChangeActionType.ATTRIBUTE_REMOVE) {
343
- if (!details.attribute_id) return null;
344
- return /* @__PURE__ */ jsx2(
345
- AttributeActionLine,
346
- {
347
- attributeId: details.attribute_id,
348
- valueIds: action.action === import_types.ProductChangeActionType.ATTRIBUTE_ADD ? details.attribute_value_ids : void 0
349
- }
350
- );
351
- }
352
- const variantFallback = t("fields.variant", { defaultValue: "Variant" });
353
- if (action.action === import_types.ProductChangeActionType.VARIANT_ADD) {
354
- const title = details.variant?.title || details.variant?.sku || variantFallback;
355
- return /* @__PURE__ */ jsx2(VariantActionLine, { title });
356
- }
357
- if (action.action === import_types.ProductChangeActionType.VARIANT_REMOVE) {
358
- const variantId = details.variant_id ?? "";
359
- const found = variantId ? variantsById.get(variantId) : void 0;
360
- const title = found?.title || found?.sku || variantId || variantFallback;
361
- const images = isImageList(found?.images) ? found?.images : void 0;
362
- return /* @__PURE__ */ jsx2(VariantActionLine, { title, images });
150
+ var resolversFor = (productId) => ({
151
+ getType: async (id) => {
152
+ const { product_type } = await sdk.admin.productTypes.$id.query({ $id: id });
153
+ return product_type?.value ?? null;
154
+ },
155
+ getCollection: async (id) => {
156
+ const { collection } = await sdk.admin.collections.$id.query({ $id: id });
157
+ return collection?.title ?? null;
158
+ },
159
+ getCategory: async (id) => {
160
+ const { product_category } = await sdk.admin.productCategories.$id.query({
161
+ $id: id
162
+ });
163
+ return product_category?.name ?? null;
164
+ },
165
+ getTag: async (id) => {
166
+ const { product_tag } = await sdk.admin.productTags.$id.query({ $id: id });
167
+ return product_tag?.value ?? null;
168
+ },
169
+ getAttribute: async (id) => {
170
+ const { product_attribute } = await sdk.admin.productAttributes.$id.query({
171
+ $id: id
172
+ });
173
+ if (!product_attribute) return null;
174
+ return {
175
+ name: product_attribute.name ?? id,
176
+ values: (product_attribute.values ?? []).map((v) => ({
177
+ id: v.id,
178
+ name: v.name ?? v.id
179
+ }))
180
+ };
181
+ },
182
+ getVariant: async (variantId) => {
183
+ const { variant } = await sdk.admin.products.$id.variants.$variantId.query({
184
+ $id: productId,
185
+ $variantId: variantId,
186
+ fields: VARIANT_LOOKUP_FIELDS
187
+ });
188
+ return variant ?? null;
363
189
  }
364
- const label = describeProductChangeAction(action, {
365
- variant: variantFallback
366
- });
367
- return /* @__PURE__ */ jsx2(Text, { size: "small", leading: "compact", className: "text-ui-fg-subtle", children: label });
368
- };
369
- var VariantUpdateBlock = ({
370
- variantId,
371
- diffs,
372
- variantsById
373
- }) => {
374
- const { t } = useTranslation2();
375
- const found = variantsById.get(variantId);
376
- const variantFallback = t("fields.variant", { defaultValue: "Variant" });
377
- const title = found?.title || found?.sku || variantId || variantFallback;
378
- const sku = found?.sku && title !== found.sku ? found.sku : void 0;
379
- const images = isImageList(found?.images) ? found?.images : void 0;
380
- return /* @__PURE__ */ jsxs2(Fragment2, { children: [
381
- /* @__PURE__ */ jsxs2(
382
- "div",
383
- {
384
- className: "flex items-start gap-4 px-6 py-4",
385
- "data-testid": `product-active-edit-variant-${variantId}`,
386
- children: [
387
- /* @__PURE__ */ jsx2(
388
- Text,
389
- {
390
- size: "small",
391
- weight: "plus",
392
- leading: "compact",
393
- className: "text-ui-fg-subtle w-[160px] shrink-0",
394
- children: variantFallback
395
- }
396
- ),
397
- /* @__PURE__ */ jsxs2("div", { className: "flex flex-1 items-center gap-2", children: [
398
- images && images.length > 0 && /* @__PURE__ */ jsx2(ImageStrip, { images }),
399
- /* @__PURE__ */ jsx2(
400
- Text,
401
- {
402
- size: "small",
403
- leading: "compact",
404
- className: "text-ui-fg-base font-medium",
405
- children: title
406
- }
407
- ),
408
- sku && /* @__PURE__ */ jsx2(Text, { size: "small", leading: "compact", className: "text-ui-fg-subtle", children: `\xB7 ${sku}` })
409
- ] })
410
- ]
411
- }
412
- ),
413
- diffs.length > 0 && /* @__PURE__ */ jsxs2("div", { className: "flex items-start gap-4 px-6 py-4", children: [
414
- /* @__PURE__ */ jsx2(
415
- Text,
416
- {
417
- size: "small",
418
- weight: "plus",
419
- leading: "compact",
420
- className: "text-ui-fg-subtle w-[160px] shrink-0",
421
- children: t("labels.updated")
422
- }
423
- ),
424
- /* @__PURE__ */ jsx2("div", { className: "flex flex-1 flex-col gap-y-4", children: diffs.map((diff, idx) => /* @__PURE__ */ jsx2(FieldRow, { diff }, `${variantId}-${diff.field}-${idx}`)) })
425
- ] })
426
- ] });
427
- };
190
+ });
428
191
  var ProductActiveEditSection = ({
429
192
  product
430
193
  }) => {
@@ -440,84 +203,12 @@ var ProductActiveEditSection = ({
440
203
  });
441
204
  const { mutateAsync: confirmChange, isPending: isConfirming } = useConfirmProductChange(product_change?.id ?? "", product.id);
442
205
  const { mutateAsync: cancelChange, isPending: isRejecting } = useCancelProductChange(product_change?.id ?? "", product.id);
443
- const { updated, added, removed, deleteRequested } = useMemo(
444
- () => partitionProductChangeActions(product_change?.actions ?? []),
445
- [product_change]
446
- );
447
- const productUpdated = useMemo(
448
- () => updated.filter((d) => !d.variant_id),
449
- [updated]
450
- );
451
- const variantsUpdated = useMemo(() => {
452
- const groups = /* @__PURE__ */ new Map();
453
- for (const diff of updated) {
454
- if (!diff.variant_id) continue;
455
- const bucket = groups.get(diff.variant_id) ?? [];
456
- bucket.push(diff);
457
- groups.set(diff.variant_id, bucket);
458
- }
459
- return groups;
460
- }, [updated]);
461
- const attributeIds = useMemo(() => {
462
- const ids = /* @__PURE__ */ new Set();
463
- for (const action of [...added, ...removed]) {
464
- if (action.action === import_types.ProductChangeActionType.ATTRIBUTE_ADD || action.action === import_types.ProductChangeActionType.ATTRIBUTE_REMOVE) {
465
- const details = action.details ?? {};
466
- if (details.attribute_id) ids.add(details.attribute_id);
467
- }
468
- }
469
- return Array.from(ids);
470
- }, [added, removed]);
471
- const attributeQueries = useQueries({
472
- queries: attributeIds.map((id) => ({
473
- queryKey: productAttributesQueryKeys.detail(id),
474
- queryFn: () => sdk.admin.productAttributes.$id.query({ $id: id })
475
- }))
476
- });
477
- const isLoadingAttributes = attributeQueries.some((q) => q.isPending);
478
- const variantIds = useMemo(() => {
479
- const ids = /* @__PURE__ */ new Set();
480
- for (const action of removed) {
481
- if (action.action === import_types.ProductChangeActionType.VARIANT_REMOVE) {
482
- const details = action.details ?? {};
483
- if (details.variant_id) ids.add(details.variant_id);
484
- }
485
- }
486
- for (const diff of updated) {
487
- if (diff.variant_id) ids.add(diff.variant_id);
488
- }
489
- return Array.from(ids);
490
- }, [removed, updated]);
491
- const variantQueryInput = { fields: VARIANT_LOOKUP_FIELDS };
492
- const variantQueries = useQueries({
493
- queries: variantIds.map((variantId) => ({
494
- queryKey: variantsQueryKeys.detail(variantId, variantQueryInput),
495
- queryFn: () => sdk.admin.products.$id.variants.$variantId.query({
496
- $id: product.id,
497
- $variantId: variantId,
498
- ...variantQueryInput
499
- })
500
- }))
501
- });
502
- const isLoadingVariants = variantQueries.some((q) => q.isPending);
503
- const variantsById = useMemo(() => {
504
- const map = /* @__PURE__ */ new Map();
505
- for (const query of variantQueries) {
506
- const variant = query.data?.variant;
507
- if (variant?.id) map.set(variant.id, variant);
508
- }
509
- return map;
510
- }, [variantQueries]);
511
206
  if (isError || !product_change) {
512
207
  return null;
513
208
  }
514
209
  if (product_change.status !== import_types.ProductChangeStatus.PENDING) {
515
210
  return null;
516
211
  }
517
- if (isLoadingAttributes || isLoadingVariants) {
518
- return null;
519
- }
520
- const hasContent = productUpdated.length > 0 || variantsUpdated.size > 0 || added.length > 0 || removed.length > 0 || deleteRequested;
521
212
  const handleConfirm = async (note) => {
522
213
  try {
523
214
  await confirmChange({ internal_note: note });
@@ -536,172 +227,84 @@ var ProductActiveEditSection = ({
536
227
  toast.error(e.message);
537
228
  }
538
229
  };
539
- return /* @__PURE__ */ jsxs2(
540
- Container,
541
- {
542
- className: "divide-y p-0",
543
- "data-testid": "product-active-edit-section",
544
- children: [
545
- /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-2 px-6 py-4", children: [
546
- /* @__PURE__ */ jsx2(ExclamationCircleSolid, { className: "text-ui-fg-interactive" }),
547
- /* @__PURE__ */ jsx2(Heading, { level: "h2", "data-testid": "product-active-edit-heading", children: t("products.edits.panel.title") })
548
- ] }),
549
- /* @__PURE__ */ jsx2("div", { className: "px-6 py-4", children: /* @__PURE__ */ jsx2(Text, { size: "small", leading: "compact", className: "text-ui-fg-subtle", children: t("products.edits.panel.description", {
230
+ const panelProduct = {
231
+ id: product.id,
232
+ title: product.title,
233
+ thumbnail: product.thumbnail,
234
+ variants: product.variants,
235
+ attributes: product.attributes
236
+ };
237
+ return /* @__PURE__ */ jsxs2(Fragment, { children: [
238
+ /* @__PURE__ */ jsx2(
239
+ ProductChangePanel,
240
+ {
241
+ product: panelProduct,
242
+ actions: product_change.actions ?? [],
243
+ resolvers: resolversFor(product.id),
244
+ headerDescription: /* @__PURE__ */ jsx2(Text, { size: "small", leading: "compact", className: "text-ui-fg-subtle", children: t("products.edits.panel.description", {
550
245
  store: requesterSeller?.name ?? t("products.request.fallbackStore")
551
- }) }) }),
552
- hasContent && /* @__PURE__ */ jsxs2(Fragment2, { children: [
553
- productUpdated.length > 0 && /* @__PURE__ */ jsxs2("div", { className: "flex items-start gap-4 px-6 py-4", children: [
554
- /* @__PURE__ */ jsx2(
555
- Text,
556
- {
557
- size: "small",
558
- weight: "plus",
559
- leading: "compact",
560
- className: "text-ui-fg-subtle w-[160px] shrink-0",
561
- children: t("labels.updated")
562
- }
563
- ),
564
- /* @__PURE__ */ jsx2("div", { className: "flex flex-1 flex-col gap-y-4", children: productUpdated.map((diff, idx) => /* @__PURE__ */ jsx2(FieldRow, { diff }, `${diff.field}-${idx}`)) })
565
- ] }),
566
- variantsUpdated.size > 0 && Array.from(variantsUpdated.entries()).map(([variantId, diffs]) => /* @__PURE__ */ jsx2(
567
- VariantUpdateBlock,
246
+ }) }),
247
+ footer: /* @__PURE__ */ jsxs2(Fragment, { children: [
248
+ /* @__PURE__ */ jsx2(
249
+ Button,
568
250
  {
569
- variantId,
570
- diffs,
571
- variantsById
572
- },
573
- variantId
574
- )),
575
- added.length > 0 && /* @__PURE__ */ jsxs2("div", { className: "flex items-start gap-4 px-6 py-4", children: [
576
- /* @__PURE__ */ jsx2(
577
- Text,
578
- {
579
- size: "small",
580
- weight: "plus",
581
- leading: "compact",
582
- className: "text-ui-fg-subtle w-[160px] shrink-0",
583
- children: t("labels.added")
584
- }
585
- ),
586
- /* @__PURE__ */ jsx2("div", { className: "flex flex-1 flex-col gap-y-2", children: added.map((action) => /* @__PURE__ */ jsx2(
587
- ActionLine,
588
- {
589
- action,
590
- variantsById
591
- },
592
- action.id
593
- )) })
594
- ] }),
595
- removed.length > 0 && /* @__PURE__ */ jsxs2("div", { className: "flex items-start gap-4 px-6 py-4", children: [
596
- /* @__PURE__ */ jsx2(
597
- Text,
598
- {
599
- size: "small",
600
- weight: "plus",
601
- leading: "compact",
602
- className: "text-ui-fg-subtle w-[160px] shrink-0",
603
- children: t("labels.removed")
604
- }
605
- ),
606
- /* @__PURE__ */ jsx2("div", { className: "flex flex-1 flex-col gap-y-2", children: removed.map((action) => /* @__PURE__ */ jsx2(
607
- ActionLine,
608
- {
609
- action,
610
- variantsById
611
- },
612
- action.id
613
- )) })
614
- ] }),
615
- deleteRequested && /* @__PURE__ */ jsxs2("div", { className: "flex items-start gap-4 px-6 py-4", children: [
616
- /* @__PURE__ */ jsx2(
617
- Text,
618
- {
619
- size: "small",
620
- weight: "plus",
621
- leading: "compact",
622
- className: "text-ui-fg-subtle w-[160px] shrink-0",
623
- children: t("labels.removed")
624
- }
625
- ),
626
- /* @__PURE__ */ jsx2(
627
- Text,
628
- {
629
- size: "small",
630
- leading: "compact",
631
- className: "text-ui-fg-subtle flex-1",
632
- children: t("products.edits.panel.deleteRequested")
633
- }
634
- )
635
- ] })
636
- ] }),
637
- /* @__PURE__ */ jsxs2(
638
- "div",
639
- {
640
- className: "bg-ui-bg-subtle flex items-center justify-end gap-x-2 rounded-b-xl px-6 py-4",
641
- "data-testid": "product-active-edit-actions",
642
- children: [
643
- /* @__PURE__ */ jsx2(
644
- Button,
645
- {
646
- size: "small",
647
- variant: "secondary",
648
- onClick: () => setConfirmOpen(true),
649
- "data-testid": "product-active-edit-confirm-button",
650
- children: t("actions.confirm")
651
- }
652
- ),
653
- /* @__PURE__ */ jsx2(
654
- Button,
655
- {
656
- size: "small",
657
- variant: "secondary",
658
- onClick: () => setRejectOpen(true),
659
- "data-testid": "product-active-edit-reject-button",
660
- children: t("products.edits.actions.reject")
661
- }
662
- )
663
- ]
664
- }
665
- ),
666
- /* @__PURE__ */ jsx2(
667
- ConfirmPrompt,
668
- {
669
- open: confirmOpen,
670
- onOpenChange: setConfirmOpen,
671
- title: t("products.edits.confirmPrompt.title"),
672
- description: t("products.edits.confirmPrompt.description"),
673
- noteLabel: t("products.edits.confirmPrompt.noteLabel"),
674
- noteOptional: true,
675
- notePlaceholder: t("products.edits.confirmPrompt.notePlaceholder"),
676
- isLoading: isConfirming,
677
- onConfirm: handleConfirm
678
- }
679
- ),
680
- /* @__PURE__ */ jsx2(
681
- ConfirmPrompt,
682
- {
683
- open: rejectOpen,
684
- onOpenChange: setRejectOpen,
685
- title: t("products.edits.rejectPrompt.title"),
686
- description: t("products.edits.rejectPrompt.description"),
687
- noteLabel: t("products.edits.rejectPrompt.noteLabel"),
688
- noteOptional: true,
689
- notePlaceholder: t("products.edits.rejectPrompt.notePlaceholder"),
690
- confirmLabel: t("products.edits.rejectPrompt.confirm"),
691
- isLoading: isRejecting,
692
- onConfirm: handleReject
693
- }
694
- )
695
- ]
696
- }
697
- );
251
+ size: "small",
252
+ variant: "secondary",
253
+ onClick: () => setConfirmOpen(true),
254
+ "data-testid": "product-active-edit-confirm-button",
255
+ children: t("actions.confirm")
256
+ }
257
+ ),
258
+ /* @__PURE__ */ jsx2(
259
+ Button,
260
+ {
261
+ size: "small",
262
+ variant: "secondary",
263
+ onClick: () => setRejectOpen(true),
264
+ "data-testid": "product-active-edit-reject-button",
265
+ children: t("products.edits.actions.reject")
266
+ }
267
+ )
268
+ ] })
269
+ }
270
+ ),
271
+ /* @__PURE__ */ jsx2(
272
+ ConfirmPrompt,
273
+ {
274
+ open: confirmOpen,
275
+ onOpenChange: setConfirmOpen,
276
+ title: t("products.edits.confirmPrompt.title"),
277
+ description: t("products.edits.confirmPrompt.description"),
278
+ noteLabel: t("products.edits.confirmPrompt.noteLabel"),
279
+ noteOptional: true,
280
+ notePlaceholder: t("products.edits.confirmPrompt.notePlaceholder"),
281
+ isLoading: isConfirming,
282
+ onConfirm: handleConfirm
283
+ }
284
+ ),
285
+ /* @__PURE__ */ jsx2(
286
+ ConfirmPrompt,
287
+ {
288
+ open: rejectOpen,
289
+ onOpenChange: setRejectOpen,
290
+ title: t("products.edits.rejectPrompt.title"),
291
+ description: t("products.edits.rejectPrompt.description"),
292
+ noteLabel: t("products.edits.rejectPrompt.noteLabel"),
293
+ noteOptional: true,
294
+ notePlaceholder: t("products.edits.rejectPrompt.notePlaceholder"),
295
+ confirmLabel: t("products.edits.rejectPrompt.confirm"),
296
+ isLoading: isRejecting,
297
+ onConfirm: handleReject
298
+ }
299
+ )
300
+ ] });
698
301
  };
699
302
 
700
303
  // src/pages/products/product-detail/components/product-active-request-section/product-active-request-section.tsx
701
304
  var import_types2 = __toESM(require_dist(), 1);
702
305
  import { useState as useState3 } from "react";
703
- import { Button as Button2, Container as Container2, Heading as Heading2, Text as Text2, toast as toast2 } from "@medusajs/ui";
704
- import { ExclamationCircleSolid as ExclamationCircleSolid2 } from "@medusajs/icons";
306
+ import { Button as Button2, Container, Heading, Text as Text2, toast as toast2 } from "@medusajs/ui";
307
+ import { ExclamationCircleSolid } from "@medusajs/icons";
705
308
  import { useTranslation as useTranslation3 } from "react-i18next";
706
309
  import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
707
310
  var ProductActiveRequestSection = ({
@@ -745,7 +348,7 @@ var ProductActiveRequestSection = ({
745
348
  }
746
349
  };
747
350
  return /* @__PURE__ */ jsxs3(
748
- Container2,
351
+ Container,
749
352
  {
750
353
  className: "divide-y p-0",
751
354
  "data-testid": "product-active-request-section",
@@ -756,8 +359,8 @@ var ProductActiveRequestSection = ({
756
359
  className: "flex items-center gap-2 px-6 py-4",
757
360
  "data-testid": "product-active-request-header",
758
361
  children: [
759
- /* @__PURE__ */ jsx3(ExclamationCircleSolid2, { className: "text-ui-fg-interactive" }),
760
- /* @__PURE__ */ jsx3(Heading2, { level: "h2", "data-testid": "product-active-request-heading", children: t("products.request.panel.title") })
362
+ /* @__PURE__ */ jsx3(ExclamationCircleSolid, { className: "text-ui-fg-interactive" }),
363
+ /* @__PURE__ */ jsx3(Heading, { level: "h2", "data-testid": "product-active-request-heading", children: t("products.request.panel.title") })
761
364
  ]
762
365
  }
763
366
  ),
@@ -866,8 +469,8 @@ import {
866
469
  } from "@medusajs/icons";
867
470
  import {
868
471
  Badge,
869
- Container as Container3,
870
- Heading as Heading3,
472
+ Container as Container2,
473
+ Heading as Heading2,
871
474
  Text as Text3,
872
475
  toast as toast3,
873
476
  Tooltip,
@@ -913,17 +516,17 @@ var AttributeActions = ({
913
516
  }
914
517
  ]
915
518
  },
916
- {
917
- actions: [
918
- {
919
- label: t("actions.delete"),
920
- onClick: handleDelete,
921
- icon: /* @__PURE__ */ jsx4(Trash, {}),
922
- disabled: attribute.is_required,
923
- disabledTooltip: attribute.is_required ? t("products.attributeRequiredDeleteDisabledTooltip") : void 0
924
- }
925
- ]
926
- }
519
+ ...attribute.is_required ? [] : [
520
+ {
521
+ actions: [
522
+ {
523
+ label: t("actions.delete"),
524
+ onClick: handleDelete,
525
+ icon: /* @__PURE__ */ jsx4(Trash, {})
526
+ }
527
+ ]
528
+ }
529
+ ]
927
530
  ]
928
531
  }
929
532
  );
@@ -973,7 +576,9 @@ var AttributeGroup = ({
973
576
  size: "small",
974
577
  leading: "compact",
975
578
  className: "text-ui-fg-subtle",
976
- children: values.join(", ") || "-"
579
+ children: attr.type === "toggle" ? values.map(
580
+ (val) => val === "true" ? t("general.yes") : t("general.no")
581
+ ).join(", ") || "-" : values.join(", ") || "-"
977
582
  }
978
583
  ) }),
979
584
  /* @__PURE__ */ jsx4(AttributeActions, { productId, attribute: attr })
@@ -992,13 +597,13 @@ var ProductAttributeSection = ({
992
597
  const variantAttributes = allAttributes.filter((a) => a.is_variant_axis);
993
598
  const infoAttributes = allAttributes.filter((a) => !a.is_variant_axis);
994
599
  const isEmpty = !variantAttributes.length && !infoAttributes.length;
995
- return /* @__PURE__ */ jsxs4(Container3, { className: "p-0", children: [
600
+ return /* @__PURE__ */ jsxs4(Container2, { className: "p-0", children: [
996
601
  /* @__PURE__ */ jsxs4(
997
602
  "div",
998
603
  {
999
604
  className: `flex items-center justify-between px-6 py-4${isEmpty ? "" : " border-b border-ui-border-base"}`,
1000
605
  children: [
1001
- /* @__PURE__ */ jsx4(Heading3, { level: "h2", children: t("products.attributes") }),
606
+ /* @__PURE__ */ jsx4(Heading2, { level: "h2", children: t("products.attributes") }),
1002
607
  /* @__PURE__ */ jsx4(
1003
608
  ActionMenu,
1004
609
  {
@@ -1049,7 +654,7 @@ var ProductAttributeSection = ({
1049
654
 
1050
655
  // src/pages/products/product-detail/components/product-general-section/product-general-section.tsx
1051
656
  import { PencilSquare as PencilSquare2, Trash as Trash2 } from "@medusajs/icons";
1052
- import { Container as Container4, Heading as Heading4, StatusBadge, usePrompt as usePrompt2 } from "@medusajs/ui";
657
+ import { Container as Container3, Heading as Heading3, StatusBadge, usePrompt as usePrompt2 } from "@medusajs/ui";
1053
658
  import { useTranslation as useTranslation5 } from "react-i18next";
1054
659
  import { useNavigate } from "react-router-dom";
1055
660
  import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
@@ -1092,14 +697,14 @@ var ProductGeneralSection = ({
1092
697
  }
1093
698
  });
1094
699
  };
1095
- return /* @__PURE__ */ jsxs5(Container4, { className: "divide-y p-0", "data-testid": "product-general-section", children: [
700
+ return /* @__PURE__ */ jsxs5(Container3, { className: "divide-y p-0", "data-testid": "product-general-section", children: [
1096
701
  /* @__PURE__ */ jsxs5(
1097
702
  "div",
1098
703
  {
1099
704
  className: "flex items-center justify-between px-6 py-4",
1100
705
  "data-testid": "product-general-header",
1101
706
  children: [
1102
- /* @__PURE__ */ jsx5(Heading4, { "data-testid": "product-general-title", children: product.title }),
707
+ /* @__PURE__ */ jsx5(Heading3, { "data-testid": "product-general-title", children: product.title }),
1103
708
  /* @__PURE__ */ jsxs5(
1104
709
  "div",
1105
710
  {
@@ -1183,7 +788,7 @@ var ProductGeneralSection = ({
1183
788
 
1184
789
  // src/pages/products/product-detail/components/product-organization-section/product-organization-section.tsx
1185
790
  import { PencilSquare as PencilSquare3 } from "@medusajs/icons";
1186
- import { Badge as Badge2, Container as Container5, Heading as Heading5, Tooltip as Tooltip2 } from "@medusajs/ui";
791
+ import { Badge as Badge2, Container as Container4, Heading as Heading4, Tooltip as Tooltip2 } from "@medusajs/ui";
1187
792
  import { useTranslation as useTranslation6 } from "react-i18next";
1188
793
  import { Link } from "react-router-dom";
1189
794
  import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
@@ -1192,7 +797,7 @@ var ProductOrganizationSection = ({
1192
797
  }) => {
1193
798
  const { t } = useTranslation6();
1194
799
  return /* @__PURE__ */ jsxs6(
1195
- Container5,
800
+ Container4,
1196
801
  {
1197
802
  className: "divide-y p-0",
1198
803
  "data-testid": "product-organization-section",
@@ -1203,7 +808,7 @@ var ProductOrganizationSection = ({
1203
808
  className: "flex items-center justify-between px-6 py-4",
1204
809
  "data-testid": "product-organization-header",
1205
810
  children: [
1206
- /* @__PURE__ */ jsx6(Heading5, { level: "h2", "data-testid": "product-organization-title", children: t("products.organization.header") }),
811
+ /* @__PURE__ */ jsx6(Heading4, { level: "h2", "data-testid": "product-organization-title", children: t("products.organization.header") }),
1207
812
  /* @__PURE__ */ jsx6(
1208
813
  ActionMenu,
1209
814
  {
@@ -1298,18 +903,19 @@ var OrganizationTag = ({ label, to }) => {
1298
903
  };
1299
904
 
1300
905
  // src/pages/products/product-detail/components/product-variant-section/product-variant-section.tsx
1301
- import { useCallback, useMemo as useMemo2 } from "react";
906
+ import { useCallback, useMemo } from "react";
1302
907
  import { PencilSquare as PencilSquare4, Trash as Trash3 } from "@medusajs/icons";
1303
908
  import {
1304
909
  Badge as Badge3,
1305
910
  Button as Button3,
1306
- Container as Container6,
1307
- createDataTableColumnHelper,
1308
- Heading as Heading6,
911
+ Container as Container5,
912
+ Heading as Heading5,
913
+ toast as toast4,
1309
914
  Tooltip as Tooltip3,
1310
915
  usePrompt as usePrompt3
1311
916
  } from "@medusajs/ui";
1312
917
  import { keepPreviousData } from "@tanstack/react-query";
918
+ import { createColumnHelper } from "@tanstack/react-table";
1313
919
  import { useTranslation as useTranslation7 } from "react-i18next";
1314
920
  import { Link as Link2, useNavigate as useNavigate2, useSearchParams } from "react-router-dom";
1315
921
  import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
@@ -1323,9 +929,7 @@ var ProductVariantSection = ({
1323
929
  ["q", "order", "offset", "created_at", "updated_at"],
1324
930
  PREFIX
1325
931
  );
1326
- const columns = useColumns(product);
1327
- const filters = useFilters();
1328
- const { variants, count, isPending, isError, error } = useProductVariants(
932
+ const { variants, count, isLoading, isError, error } = useProductVariants(
1329
933
  product.id,
1330
934
  {
1331
935
  q,
@@ -1340,12 +944,23 @@ var ProductVariantSection = ({
1340
944
  placeholderData: keepPreviousData
1341
945
  }
1342
946
  );
947
+ const columns = useColumns(product);
948
+ const filters = useFilters();
949
+ const orderBy = useOrderBy();
950
+ const { table } = useDataTable({
951
+ data: variants ?? [],
952
+ columns,
953
+ count,
954
+ pageSize: PAGE_SIZE,
955
+ getRowId: (row) => row.id,
956
+ prefix: PREFIX
957
+ });
1343
958
  if (isError) {
1344
959
  throw error;
1345
960
  }
1346
- return /* @__PURE__ */ jsxs7(Container6, { className: "p-0", "data-testid": "product-variant-section", children: [
961
+ return /* @__PURE__ */ jsxs7(Container5, { className: "divide-y p-0", "data-testid": "product-variant-section", children: [
1347
962
  /* @__PURE__ */ jsxs7("div", { className: "flex items-center justify-between px-6 py-4", children: [
1348
- /* @__PURE__ */ jsx7(Heading6, { level: "h2", children: t("products.variants.header") }),
963
+ /* @__PURE__ */ jsx7(Heading5, { level: "h2", children: t("products.variants.header") }),
1349
964
  /* @__PURE__ */ jsx7(
1350
965
  Button3,
1351
966
  {
@@ -1357,40 +972,37 @@ var ProductVariantSection = ({
1357
972
  }
1358
973
  )
1359
974
  ] }),
1360
- /* @__PURE__ */ jsx7("div", { "data-testid": "product-variants-table-container", children: /* @__PURE__ */ jsx7(
1361
- DataTable,
975
+ /* @__PURE__ */ jsx7(
976
+ _DataTable,
1362
977
  {
1363
- data: variants,
978
+ table,
1364
979
  columns,
1365
- filters,
1366
- rowCount: count,
1367
- getRowId: (row) => row.id,
1368
- rowHref: (row) => `/products/${product.id}/variants/${row.id}`,
980
+ count,
1369
981
  pageSize: PAGE_SIZE,
1370
- isLoading: isPending,
1371
- emptyState: {
1372
- empty: {
1373
- heading: t("products.variants.empty.heading"),
1374
- description: t("products.variants.empty.description")
1375
- },
1376
- filtered: {
1377
- heading: t("products.variants.filtered.heading"),
1378
- description: t("products.variants.filtered.description")
1379
- }
1380
- },
1381
- prefix: PREFIX
982
+ filters,
983
+ search: true,
984
+ pagination: true,
985
+ isLoading,
986
+ orderBy,
987
+ prefix: PREFIX,
988
+ queryObject: { q, order, created_at, updated_at },
989
+ navigateTo: (row) => `variants/${row.original.id}`,
990
+ noRecords: {
991
+ title: t("products.variants.empty.heading"),
992
+ message: t("products.variants.empty.description")
993
+ }
1382
994
  }
1383
- ) })
995
+ )
1384
996
  ] });
1385
997
  };
1386
- var columnHelper = createDataTableColumnHelper();
998
+ var columnHelper = createColumnHelper();
1387
999
  var useColumns = (product) => {
1388
1000
  const { t } = useTranslation7();
1389
1001
  const navigate = useNavigate2();
1390
1002
  const { mutateAsync } = useDeleteVariantLazy(product.id);
1391
1003
  const prompt = usePrompt3();
1392
1004
  const [searchParams] = useSearchParams();
1393
- const tableSearchParams = useMemo2(() => {
1005
+ const tableSearchParams = useMemo(() => {
1394
1006
  const filtered = new URLSearchParams();
1395
1007
  for (const [key, value] of searchParams.entries()) {
1396
1008
  if (key.startsWith(`${PREFIX}_`)) {
@@ -1399,7 +1011,6 @@ var useColumns = (product) => {
1399
1011
  }
1400
1012
  return filtered;
1401
1013
  }, [searchParams]);
1402
- const dateColumns = useDataTableDateColumns();
1403
1014
  const handleDelete = useCallback(
1404
1015
  async (id, title) => {
1405
1016
  const res = await prompt({
@@ -1413,11 +1024,18 @@ var useColumns = (product) => {
1413
1024
  if (!res) {
1414
1025
  return;
1415
1026
  }
1416
- await mutateAsync({ variantId: id });
1027
+ await mutateAsync(
1028
+ { variantId: id },
1029
+ {
1030
+ onError: (error) => {
1031
+ toast4.error(error.message);
1032
+ }
1033
+ }
1034
+ );
1417
1035
  },
1418
1036
  [mutateAsync, prompt, t]
1419
1037
  );
1420
- const attributeColumns = useMemo2(() => {
1038
+ const attributeColumns = useMemo(() => {
1421
1039
  const variantAttributes = product?.attributes?.filter((attr) => attr.is_variant_axis);
1422
1040
  if (!variantAttributes?.length) {
1423
1041
  return [];
@@ -1454,45 +1072,21 @@ var useColumns = (product) => {
1454
1072
  });
1455
1073
  });
1456
1074
  }, [product]);
1457
- const getActions = useCallback(
1458
- (ctx) => {
1459
- const variant = ctx.row.original;
1460
- const mainActions = [
1461
- {
1462
- icon: /* @__PURE__ */ jsx7(PencilSquare4, {}),
1463
- label: t("actions.edit"),
1464
- onClick: (row) => {
1465
- navigate(
1466
- `edit-variant?variant_id=${row.row.original.id}&${tableSearchParams.toString()}`,
1467
- {
1468
- state: {
1469
- restore_params: tableSearchParams.toString()
1470
- }
1471
- }
1472
- );
1473
- }
1474
- }
1475
- ];
1476
- const secondaryActions = [
1477
- {
1478
- icon: /* @__PURE__ */ jsx7(Trash3, {}),
1479
- label: t("actions.delete"),
1480
- onClick: () => handleDelete(variant.id, variant.title)
1481
- }
1482
- ];
1483
- return [mainActions, secondaryActions];
1484
- },
1485
- [handleDelete, navigate, t, tableSearchParams]
1486
- );
1487
- return useMemo2(() => {
1488
- return [
1075
+ return useMemo(
1076
+ () => [
1489
1077
  columnHelper.accessor("title", {
1078
+ id: "title",
1490
1079
  header: t("fields.title"),
1491
- enableSorting: true,
1492
- sortAscLabel: t("filters.sorting.alphabeticallyAsc"),
1493
- sortDescLabel: t("filters.sorting.alphabeticallyDesc")
1080
+ cell: ({ getValue }) => {
1081
+ const value = getValue();
1082
+ return /* @__PURE__ */ jsxs7("div", { className: "flex h-full w-full max-w-[250px] items-center gap-x-3 overflow-hidden", children: [
1083
+ /* @__PURE__ */ jsx7("div", { className: "w-fit flex-shrink-0", children: /* @__PURE__ */ jsx7(Thumbnail, { src: product.thumbnail }) }),
1084
+ value ? /* @__PURE__ */ jsx7("span", { title: value, className: "truncate", children: value }) : /* @__PURE__ */ jsx7("span", { className: "text-ui-fg-muted", children: "-" })
1085
+ ] });
1086
+ }
1494
1087
  }),
1495
1088
  columnHelper.accessor("sku", {
1089
+ id: "sku",
1496
1090
  header: t("fields.sku"),
1497
1091
  cell: ({ getValue }) => {
1498
1092
  const value = getValue();
@@ -1500,20 +1094,64 @@ var useColumns = (product) => {
1500
1094
  }
1501
1095
  }),
1502
1096
  ...attributeColumns,
1503
- ...dateColumns,
1504
- columnHelper.action({
1505
- actions: getActions
1097
+ columnHelper.display({
1098
+ id: "actions",
1099
+ cell: ({ row }) => /* @__PURE__ */ jsx7(
1100
+ ActionMenu,
1101
+ {
1102
+ groups: [
1103
+ {
1104
+ actions: [
1105
+ {
1106
+ icon: /* @__PURE__ */ jsx7(PencilSquare4, {}),
1107
+ label: t("actions.edit"),
1108
+ onClick: () => navigate(
1109
+ `edit-variant?variant_id=${row.original.id}&${tableSearchParams.toString()}`,
1110
+ {
1111
+ state: {
1112
+ restore_params: tableSearchParams.toString()
1113
+ }
1114
+ }
1115
+ )
1116
+ }
1117
+ ]
1118
+ },
1119
+ {
1120
+ actions: [
1121
+ {
1122
+ icon: /* @__PURE__ */ jsx7(Trash3, {}),
1123
+ label: t("actions.delete"),
1124
+ onClick: () => handleDelete(row.original.id, row.original.title ?? "")
1125
+ }
1126
+ ]
1127
+ }
1128
+ ]
1129
+ }
1130
+ )
1506
1131
  })
1507
- ];
1508
- }, [t, attributeColumns, dateColumns, getActions]);
1132
+ ],
1133
+ [t, attributeColumns, navigate, handleDelete, tableSearchParams, product]
1134
+ );
1509
1135
  };
1510
1136
  var useFilters = () => {
1511
- const dateFilters = useDataTableDateFilters();
1512
- return useMemo2(() => {
1513
- return [
1514
- ...dateFilters
1515
- ];
1516
- }, [dateFilters]);
1137
+ const { t } = useTranslation7();
1138
+ return useMemo(
1139
+ () => [
1140
+ { key: "created_at", label: t("fields.createdAt"), type: "date" },
1141
+ { key: "updated_at", label: t("fields.updatedAt"), type: "date" }
1142
+ ],
1143
+ [t]
1144
+ );
1145
+ };
1146
+ var useOrderBy = () => {
1147
+ const { t } = useTranslation7();
1148
+ return useMemo(
1149
+ () => [
1150
+ { key: "title", label: t("fields.title") },
1151
+ { key: "sku", label: t("fields.sku") }
1152
+ ],
1153
+ [t]
1154
+ );
1517
1155
  };
1518
1156
 
1519
1157
  // src/pages/products/product-detail/product-detail.tsx