@mercurjs/admin 2.2.0-canary.3 → 2.2.0-canary.31

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 (380) hide show
  1. package/dist/{add-campaign-promotions-OLNTDP26.js → add-campaign-promotions-7VQ4YSDF.js} +12 -12
  2. package/dist/{adjust-inventory-CVWSBMHU.js → adjust-inventory-DOJ66E2D.js} +21 -22
  3. package/dist/{api-key-management-create-7RWOCVAO.js → api-key-management-create-6FLITJ2S.js} +4 -4
  4. package/dist/{api-key-management-detail-ZIIDMHFI.js → api-key-management-detail-ANVRI5YV.js} +26 -27
  5. package/dist/{api-key-management-edit-ACH6TJAX.js → api-key-management-edit-Z5F3GSZO.js} +4 -4
  6. package/dist/{api-key-management-list-JHBBXGHH.js → api-key-management-list-AIFIEFQX.js} +7 -7
  7. package/dist/{api-key-management-sales-channels-XEBTUB5V.js → api-key-management-sales-channels-NLFQSL4H.js} +9 -9
  8. package/dist/{attribute-create-HGNJXJBO.js → attribute-create-BCNSJO5F.js} +79 -59
  9. package/dist/{attribute-create-possible-value-EXVHC272.js → attribute-create-possible-value-MLUBL2LB.js} +1 -1
  10. package/dist/{attribute-detail-JF2RHBXC.js → attribute-detail-E7IQZW7F.js} +33 -31
  11. package/dist/{attribute-edit-ADBGDZTL.js → attribute-edit-UYGZZCMQ.js} +4 -4
  12. package/dist/{attribute-edit-possible-value-OLHGHLA3.js → attribute-edit-possible-value-MVYVVF23.js} +4 -4
  13. package/dist/{attribute-edit-ranking-7AAAYEC7.js → attribute-edit-ranking-WHFPAM7T.js} +1 -1
  14. package/dist/{attribute-list-OHU2QMUG.js → attribute-list-XDW6VE4J.js} +26 -27
  15. package/dist/breadcrumb-OYF6FUUL.js +26 -0
  16. package/dist/breadcrumb-RYIHOYZE.js +27 -0
  17. package/dist/{campaign-budget-edit-WKSYXTBX.js → campaign-budget-edit-N2WWGO2G.js} +1 -1
  18. package/dist/{campaign-configuration-ZTK46EB5.js → campaign-configuration-MFFZXUEN.js} +1 -1
  19. package/dist/{campaign-create-VFFIIRE4.js → campaign-create-NMIOUGXQ.js} +3 -3
  20. package/dist/{campaign-detail-AZKBPDLC.js → campaign-detail-YEX2W33U.js} +28 -29
  21. package/dist/{campaign-edit-ZGLDY4X4.js → campaign-edit-PA7FGIY3.js} +1 -1
  22. package/dist/{campaign-list-NQGNOFVZ.js → campaign-list-IJCTNMOH.js} +4 -4
  23. package/dist/{categories-metadata-YZUP43OH.js → categories-metadata-WSFKMQSW.js} +22 -23
  24. package/dist/{category-create-2MRYTSYM.js → category-create-QNQKIXYH.js} +8 -5
  25. package/dist/{category-detail-B2TSD5V4.js → category-detail-UHTEDGZ4.js} +34 -33
  26. package/dist/{category-edit-QLOS2LBA.js → category-edit-6D6RZ7V2.js} +3 -3
  27. package/dist/category-icon-edit-SRCDLZ65.js +117 -0
  28. package/dist/{category-list-U7ZQBSZN.js → category-list-KNBCMJPI.js} +10 -7
  29. package/dist/category-media-MBK52QCA.js +654 -0
  30. package/dist/{category-organize-TIKTYJFZ.js → category-organize-7WFAJ46F.js} +2 -2
  31. package/dist/{category-products-KIP4KAF2.js → category-products-5VEHSKOC.js} +36 -37
  32. package/dist/{chunk-3VTAK3S6.js → chunk-24WHXAR7.js} +4 -4
  33. package/dist/chunk-27PAP64U.js +204 -0
  34. package/dist/{chunk-26UTIAAZ.js → chunk-32URSQ4F.js} +1 -1
  35. package/dist/{chunk-AB2LHP3M.js → chunk-3KL4OL3I.js} +1 -1
  36. package/dist/{chunk-3JSAS7QP.js → chunk-3MQJARVG.js} +21 -5
  37. package/dist/{chunk-X2IZZAII.js → chunk-3V54HZK7.js} +7 -7
  38. package/dist/{chunk-VKOE5J66.js → chunk-3XOE4NV5.js} +11 -2
  39. package/dist/{chunk-SRDK3XX7.js → chunk-3ZKJ4F7B.js} +6 -6
  40. package/dist/chunk-46MOMKPW.js +8 -0
  41. package/dist/{chunk-ZHOI4QMK.js → chunk-4OEYCLBE.js} +1 -1
  42. package/dist/{chunk-M75FCGHK.js → chunk-4XGB5NDV.js} +3 -3
  43. package/dist/{chunk-H5PYBIOZ.js → chunk-5I6YZOBU.js} +1 -1
  44. package/dist/{chunk-5DNAS3T4.js → chunk-5K5VNKSE.js} +1 -1
  45. package/dist/{chunk-3EDQIZV6.js → chunk-6LG3VL3Q.js} +2 -2
  46. package/dist/{chunk-FTAR3BDS.js → chunk-6MZPZ5KV.js} +1 -1
  47. package/dist/{chunk-X45JKZYW.js → chunk-7WAQRY46.js} +4 -4
  48. package/dist/{chunk-UXD3VNBO.js → chunk-AJLGY3LQ.js} +1 -2
  49. package/dist/{chunk-CMHI2RPL.js → chunk-AKSUGT5I.js} +21 -0
  50. package/dist/{chunk-2YYXP6XI.js → chunk-AM5XDEIN.js} +202 -238
  51. package/dist/{chunk-WDH5C2NS.js → chunk-ARAK63IS.js} +1 -1
  52. package/dist/{chunk-WYA62MUL.js → chunk-AROCMF45.js} +1 -1
  53. package/dist/{chunk-YLKG7W4P.js → chunk-B33LL4AM.js} +73 -20
  54. package/dist/{chunk-ED7XNGZD.js → chunk-B4YTTIYS.js} +5 -5
  55. package/dist/chunk-BN6OOLJA.js +358 -0
  56. package/dist/{chunk-3IVTUFBM.js → chunk-BVWAWPJO.js} +2 -2
  57. package/dist/{chunk-LYZT5REU.js → chunk-C4XKPQ6T.js} +14 -1
  58. package/dist/chunk-CGIVQ7D2.js +115 -0
  59. package/dist/{chunk-CVFVEDMV.js → chunk-D6ELCGPF.js} +1 -1
  60. package/dist/{chunk-WKCYMDTV.js → chunk-DBZV75X3.js} +5 -5
  61. package/dist/{chunk-CBGXKU7Z.js → chunk-DCD5KNOW.js} +7 -7
  62. package/dist/{chunk-54RTJBYO.js → chunk-DGCPYCHU.js} +8 -63
  63. package/dist/{chunk-BGGUVHDG.js → chunk-DWAAPLKD.js} +607 -747
  64. package/dist/{chunk-A7JOHU6Q.js → chunk-E3O5GAYR.js} +1 -1
  65. package/dist/{chunk-VOMVHF67.js → chunk-EAJMQKL5.js} +4 -4
  66. package/dist/{chunk-PE4STCQ5.js → chunk-ELYCSQWC.js} +13 -13
  67. package/dist/{chunk-533GMKEG.js → chunk-ER7GGJ5A.js} +22 -2
  68. package/dist/{chunk-WS63IRBI.js → chunk-ERQBTOAZ.js} +6 -6
  69. package/dist/{chunk-DRJAKRTI.js → chunk-EW77LP7P.js} +3 -3
  70. package/dist/{chunk-XTSMGXL2.js → chunk-EXPDYI26.js} +22 -13
  71. package/dist/{chunk-6FIU2V6Y.js → chunk-FDXE4XDD.js} +1 -1
  72. package/dist/{chunk-4LXBQTFN.js → chunk-FREUYHMS.js} +1 -1
  73. package/dist/{chunk-PXTJJQKJ.js → chunk-FYKG35MR.js} +1 -1
  74. package/dist/{chunk-637OFDFC.js → chunk-GFMTZ5O3.js} +282 -84
  75. package/dist/{chunk-GNLPUGYK.js → chunk-GHGOOZEL.js} +2 -2
  76. package/dist/{chunk-R2MI5GL4.js → chunk-GK6V5XL3.js} +4 -8
  77. package/dist/{chunk-YL3SCKWU.js → chunk-GKWXWN6R.js} +8 -8
  78. package/dist/{chunk-EREXPX6I.js → chunk-GME72WUF.js} +86 -93
  79. package/dist/{chunk-ZSFJVRRS.js → chunk-GQUGCSJV.js} +2 -2
  80. package/dist/{chunk-OSEIN4Y2.js → chunk-GV2Z3IHA.js} +2 -2
  81. package/dist/{chunk-3O6YY3R5.js → chunk-GX7OEF7F.js} +348 -788
  82. package/dist/{chunk-V6OGMYAI.js → chunk-HHW4PPNH.js} +159 -169
  83. package/dist/{chunk-CKD5563X.js → chunk-HSNKADGW.js} +1 -1
  84. package/dist/{chunk-UXQAHUGZ.js → chunk-HVDBP2QZ.js} +1 -1
  85. package/dist/{chunk-BFT3CN5L.js → chunk-HXPW7OZG.js} +1 -1
  86. package/dist/{chunk-GKW445WA.js → chunk-IHTQOPB6.js} +13 -187
  87. package/dist/{chunk-HR7TFO2X.js → chunk-IOXHJONC.js} +7 -7
  88. package/dist/chunk-JFXAJYAT.js +103 -0
  89. package/dist/{chunk-NQEXDLYH.js → chunk-JGCGVEFZ.js} +1 -1
  90. package/dist/{chunk-Y2M536WR.js → chunk-JHBNG7OD.js} +17 -0
  91. package/dist/{chunk-N2LH7A4X.js → chunk-JR4T4OQU.js} +10 -10
  92. package/dist/{chunk-YGRTRAWX.js → chunk-KDE4HKH2.js} +1 -0
  93. package/dist/{chunk-TP7L6M7V.js → chunk-KIQM7FNE.js} +2 -2
  94. package/dist/{chunk-XALYF4WJ.js → chunk-KOOVZT22.js} +141 -430
  95. package/dist/{chunk-BE6JLTMI.js → chunk-L5Z4JGRD.js} +1 -1
  96. package/dist/{chunk-FB7DDNCA.js → chunk-LHVXXHPO.js} +1 -1
  97. package/dist/{chunk-XJ3WC4G7.js → chunk-LM6IBDJ3.js} +1 -1
  98. package/dist/{chunk-YGAX72XV.js → chunk-LO2ZWQGL.js} +0 -2
  99. package/dist/{chunk-TITPJHIL.js → chunk-LPETBANQ.js} +5 -5
  100. package/dist/{chunk-IAWZQKUH.js → chunk-LSJMVVI4.js} +1 -1
  101. package/dist/{chunk-3P4VTL4S.js → chunk-LTAQZW2L.js} +6 -6
  102. package/dist/{chunk-6UQ5WDW6.js → chunk-LTYARVER.js} +6 -6
  103. package/dist/{chunk-DTYQWWHT.js → chunk-LX5XLXPI.js} +15 -7
  104. package/dist/{chunk-UPNMDPFX.js → chunk-M674QP3K.js} +19 -7
  105. package/dist/{chunk-CIZUUV2Y.js → chunk-MBWL2AUF.js} +210 -115
  106. package/dist/{chunk-EJTB2SLE.js → chunk-MHTSIOQS.js} +4 -4
  107. package/dist/{chunk-KXIA66EJ.js → chunk-MYDNPTDK.js} +8 -4
  108. package/dist/{chunk-COP7NFSJ.js → chunk-NHBHU7X7.js} +1 -1
  109. package/dist/{chunk-XODRTI2W.js → chunk-NK2VVZGH.js} +2 -2
  110. package/dist/{chunk-JRUUOZ5S.js → chunk-NNIU5SUY.js} +11 -11
  111. package/dist/{chunk-JQV7CXEC.js → chunk-NONPU75Q.js} +17 -2
  112. package/dist/{chunk-MVNO35S5.js → chunk-NVBITQAB.js} +1 -1
  113. package/dist/chunk-O4NME2PB.js +184 -0
  114. package/dist/chunk-O4XMXNZL.js +280 -0
  115. package/dist/{chunk-FFNSWUDC.js → chunk-O5BX4VGQ.js} +12 -5
  116. package/dist/{chunk-RVBZV3BH.js → chunk-P4TBXTHK.js} +127 -192
  117. package/dist/{chunk-634XVU3D.js → chunk-PAYQJPGK.js} +8 -1
  118. package/dist/{chunk-AXTQMIIK.js → chunk-PJR6W35H.js} +8 -27
  119. package/dist/{chunk-2V4BOCYF.js → chunk-PQZWP6CW.js} +4 -4
  120. package/dist/{chunk-IRTI3AS3.js → chunk-PXETYIW2.js} +6 -6
  121. package/dist/chunk-PZ27H46M.js +358 -0
  122. package/dist/{chunk-JQBSPUH2.js → chunk-Q4Q5BKCY.js} +14 -1
  123. package/dist/{chunk-XZZTC7E5.js → chunk-Q5HXKDZG.js} +1 -1
  124. package/dist/{chunk-CKACZXMP.js → chunk-QD5LDTJ3.js} +5 -5
  125. package/dist/{chunk-A772RAKB.js → chunk-QJ4J5F6T.js} +1 -1
  126. package/dist/{chunk-Q6I2IKJB.js → chunk-QKUCVPQ2.js} +3 -3
  127. package/dist/chunk-QPFQLFKV.js +142 -0
  128. package/dist/chunk-QR3GYYX6.js +0 -0
  129. package/dist/{chunk-3B6MTW5G.js → chunk-QUHSHIAC.js} +3 -0
  130. package/dist/{chunk-PRBE5CM3.js → chunk-QYDWMBEX.js} +31 -0
  131. package/dist/{chunk-QBVFUDNG.js → chunk-R6MM5UOX.js} +5 -5
  132. package/dist/chunk-RCOMAL7R.js +381 -0
  133. package/dist/{chunk-B3EEDC47.js → chunk-RMAQKNBA.js} +10 -94
  134. package/dist/{chunk-QIU6DJY6.js → chunk-RUVEMICX.js} +2 -2
  135. package/dist/{chunk-CKNQJPAG.js → chunk-RWAEZQCV.js} +77 -19
  136. package/dist/chunk-S6A4FVM2.js +170 -0
  137. package/dist/chunk-SCYPLUXT.js +86 -0
  138. package/dist/{chunk-U2ZFCAPX.js → chunk-SITRHMZZ.js} +11 -8
  139. package/dist/{chunk-RQPDD3RI.js → chunk-SKKF3CU6.js} +1 -1
  140. package/dist/{chunk-DQGGJSOO.js → chunk-SU444Q24.js} +21 -53
  141. package/dist/{chunk-K4TGNN4P.js → chunk-TAKY7IW6.js} +3 -3
  142. package/dist/{chunk-SUHCZ33F.js → chunk-TKC3RDRT.js} +5 -5
  143. package/dist/{chunk-BLYJZMNE.js → chunk-TLOJG7LK.js} +2 -2
  144. package/dist/{chunk-EAC7NFA2.js → chunk-U5UXL42H.js} +4 -4
  145. package/dist/chunk-UIVWOKWT.js +63 -0
  146. package/dist/{chunk-BCVUMATY.js → chunk-UZO3CIEN.js} +220 -44
  147. package/dist/{chunk-2LQ5SCPB.js → chunk-VJ32NGUB.js} +20 -8
  148. package/dist/{chunk-4KX6CBJ4.js → chunk-VSLHL2AZ.js} +2 -0
  149. package/dist/{chunk-6RQR3B6T.js → chunk-WBSUHLO7.js} +1 -2
  150. package/dist/{chunk-G4PROEJI.js → chunk-WE66XPIF.js} +4 -4
  151. package/dist/{chunk-YPESX7CE.js → chunk-WKTRJNOK.js} +3 -3
  152. package/dist/{chunk-BHOZKBYY.js → chunk-WV43FOTY.js} +10 -8
  153. package/dist/{chunk-2S6VXFBZ.js → chunk-XBMSMHRJ.js} +5 -5
  154. package/dist/chunk-XGWYGDQN.js +213 -0
  155. package/dist/{chunk-LYZDVZWA.js → chunk-XH5GIQOS.js} +1 -1
  156. package/dist/{chunk-I5THQVYP.js → chunk-XIFE4VUR.js} +1 -1
  157. package/dist/{chunk-S5BJ5CMF.js → chunk-XKRR5ALR.js} +1 -1
  158. package/dist/{chunk-AMOSVDPE.js → chunk-XNGAFAQ7.js} +160 -29
  159. package/dist/chunk-Y3RABQC4.js +33 -0
  160. package/dist/{chunk-P25PIADJ.js → chunk-Y7KAW3E7.js} +1 -1
  161. package/dist/{chunk-YXSTDH2B.js → chunk-YTTITSCF.js} +12 -12
  162. package/dist/{chunk-S4SVK5DE.js → chunk-YVLANFBK.js} +29 -1
  163. package/dist/{chunk-NQBSSM5V.js → chunk-YW2P62WD.js} +2 -2
  164. package/dist/{chunk-FMRP2CNF.js → chunk-YZBEJ3CY.js} +2101 -1867
  165. package/dist/{chunk-BGQ7H2KL.js → chunk-ZF75KDQ2.js} +3 -3
  166. package/dist/{chunk-OHOWEMHO.js → chunk-ZIFHQXP3.js} +31 -25
  167. package/dist/{collection-add-products-5ULJZWE2.js → collection-add-products-QBUVYWEK.js} +34 -35
  168. package/dist/{collection-create-HUNYHKUJ.js → collection-create-LTCUNTEN.js} +86 -15
  169. package/dist/{collection-detail-2KCCLJMV.js → collection-detail-CNMO72V2.js} +32 -31
  170. package/dist/{collection-edit-OQGYTQDO.js → collection-edit-XB7XNWKT.js} +3 -3
  171. package/dist/collection-icon-edit-SJUTX7SL.js +117 -0
  172. package/dist/{collection-list-QHZSZGPO.js → collection-list-2LWAVDXE.js} +39 -37
  173. package/dist/collection-media-NXMSBVNW.js +654 -0
  174. package/dist/{collection-metadata-47N7TUOH.js → collection-metadata-4UP7MB2G.js} +22 -23
  175. package/dist/commission-rule-commission-edit-CPBCAN6K.js +182 -0
  176. package/dist/commission-rule-create-6YJX5BRC.js +485 -0
  177. package/dist/commission-rule-detail-QF2TJ6WF.js +45 -0
  178. package/dist/commission-rule-edit-OWGW6HLN.js +331 -0
  179. package/dist/commissions-list-ENBXDOND.js +36 -0
  180. package/dist/{constants-26tEckuq.d.ts → constants-DINN0J9x.d.ts} +15 -4
  181. package/dist/{customer-create-QHA4KM6N.js → customer-create-HZXLOIZH.js} +2 -2
  182. package/dist/{customer-create-address-TYWVWNUE.js → customer-create-address-AEZNVQOG.js} +2 -2
  183. package/dist/{customer-detail-D5SSLNFT.js → customer-detail-ASONGOEE.js} +29 -34
  184. package/dist/{customer-edit-JZ4PQTIN.js → customer-edit-MMRTWOAF.js} +2 -2
  185. package/dist/customer-edit-address-AEYX2LMP.js +302 -0
  186. package/dist/{customer-group-add-customers-VJUBEN7M.js → customer-group-add-customers-CVFWLLP3.js} +11 -11
  187. package/dist/{customer-group-create-NA2UKCF6.js → customer-group-create-25JT74S3.js} +2 -2
  188. package/dist/{customer-group-detail-KRT7E2JA.js → customer-group-detail-Z5DFQHBD.js} +25 -26
  189. package/dist/{customer-group-edit-3O6HAYYN.js → customer-group-edit-AAI47MUL.js} +2 -2
  190. package/dist/{customer-group-list-KKDIESQ6.js → customer-group-list-NEN5EBVH.js} +26 -27
  191. package/dist/{customer-group-metadata-J6JY7DZ3.js → customer-group-metadata-MWI6PEIS.js} +22 -23
  192. package/dist/{customer-list-MB6WZFMA.js → customer-list-TBV4DHXV.js} +6 -6
  193. package/dist/{customer-metadata-AH2LBK4T.js → customer-metadata-AAANMDFW.js} +22 -23
  194. package/dist/{customers-add-customer-group-AHGAPEIS.js → customers-add-customer-group-WU4TPDZL.js} +31 -32
  195. package/dist/{edit-inventory-item-ADNLKLCN.js → edit-inventory-item-DNSEIVDG.js} +21 -22
  196. package/dist/{edit-inventory-item-attributes-XVR2WLDU.js → edit-inventory-item-attributes-NNSYKNZS.js} +21 -22
  197. package/dist/{edit-reservation-HQQL42QX.js → edit-reservation-UBOAYKRO.js} +3 -3
  198. package/dist/{edit-rules-YMKM5JPI.js → edit-rules-DFLANIHQ.js} +22 -23
  199. package/dist/global-commission-edit-QDPLLFM5.js +198 -0
  200. package/dist/index.d.ts +2 -2
  201. package/dist/index.js +648 -654
  202. package/dist/{inventory-create-IVESXFSV.js → inventory-create-TADTOF5K.js} +25 -26
  203. package/dist/{inventory-detail-TINIAFVB.js → inventory-detail-SYC6STHZ.js} +26 -27
  204. package/dist/{inventory-list-YLIAKQXI.js → inventory-list-QK4YHPQ6.js} +5 -5
  205. package/dist/{inventory-metadata-6INRH2JC.js → inventory-metadata-FRVMXW4Q.js} +22 -23
  206. package/dist/{inventory-stock-6YGTATID.js → inventory-stock-RD6RJLAY.js} +205 -44
  207. package/dist/loader-PQ4CT5ZD.js +32 -0
  208. package/dist/loader-S77URTQS.js +32 -0
  209. package/dist/{location-create-ZMNB7YKR.js → location-create-SO2CURZL.js} +1 -1
  210. package/dist/{location-detail-EK2S7WOK.js → location-detail-WN5HVKYF.js} +23 -24
  211. package/dist/{location-edit-DMBF3CYZ.js → location-edit-XA53657R.js} +1 -1
  212. package/dist/{location-fulfillment-providers-YQAUTEWK.js → location-fulfillment-providers-ABZ65GIC.js} +34 -35
  213. package/dist/{location-list-IV323QW2.js → location-list-CZA5V424.js} +22 -23
  214. package/dist/{location-sales-channels-EYUXMTW7.js → location-sales-channels-J7ZV7RHB.js} +8 -8
  215. package/dist/{location-service-zone-create-ZS3UWJAA.js → location-service-zone-create-7AQNNBIB.js} +7 -7
  216. package/dist/{location-service-zone-edit-MTGU2O4C.js → location-service-zone-edit-X37BNDRP.js} +1 -1
  217. package/dist/{location-service-zone-manage-areas-S7QZTIFT.js → location-service-zone-manage-areas-FW7DW6C4.js} +7 -7
  218. package/dist/{location-service-zone-shipping-option-create-36JZFRGY.js → location-service-zone-shipping-option-create-IPQF3VMS.js} +25 -26
  219. package/dist/{location-service-zone-shipping-option-edit-3PGSNKYT.js → location-service-zone-shipping-option-edit-WRSLBO23.js} +4 -4
  220. package/dist/{location-service-zone-shipping-option-pricing-JLGCOZGS.js → location-service-zone-shipping-option-pricing-FZNCTVT6.js} +8 -8
  221. package/dist/{login-6L3RMREO.js → login-J6UNTZII.js} +20 -21
  222. package/dist/{manage-locations-CFTM6DNH.js → manage-locations-3IXLBRY5.js} +1 -1
  223. package/dist/{marketplace-add-currencies-6ANNBGZM.js → marketplace-add-currencies-7MNMK5MD.js} +9 -9
  224. package/dist/{marketplace-detail-BAU2MEJT.js → marketplace-detail-HYZKPGFP.js} +25 -26
  225. package/dist/{marketplace-edit-6Q3G2OY5.js → marketplace-edit-QNFCTDUC.js} +1 -1
  226. package/dist/{marketplace-metadata-KRCGKOCA.js → marketplace-metadata-XWMSFSLY.js} +23 -24
  227. package/dist/offer-detail-page-563ISJ2A.js +572 -0
  228. package/dist/offer-variant-detail-page-UNWZBHXM.js +143 -0
  229. package/dist/offers-VAGLCRW6.js +603 -0
  230. package/dist/{order-create-claim-RMDDCUZ6.js → order-create-claim-J5L46I5K.js} +278 -253
  231. package/dist/{order-create-edit-PQ54JFZZ.js → order-create-edit-A52YVMEP.js} +214 -119
  232. package/dist/{order-create-exchange-T6DBVS75.js → order-create-exchange-MVNQIEXK.js} +287 -260
  233. package/dist/{order-create-refund-OW3MIXBY.js → order-create-refund-XXHC5LFS.js} +25 -26
  234. package/dist/{order-create-return-YCX6C3VP.js → order-create-return-65KF5A2N.js} +54 -27
  235. package/dist/{order-detail-2OAEGBQG.js → order-detail-O327KLZC.js} +36 -38
  236. package/dist/{order-edit-billing-address-VGZBQHF5.js → order-edit-billing-address-ER7MGZEB.js} +23 -24
  237. package/dist/{order-edit-email-OOCXVRET.js → order-edit-email-XYHRJQ2T.js} +22 -23
  238. package/dist/{order-edit-shipping-address-B4F3E5RE.js → order-edit-shipping-address-YPEC2Q6U.js} +22 -23
  239. package/dist/{order-list-M6F7PKVN.js → order-list-43LBG6AQ.js} +15 -15
  240. package/dist/{order-metadata-AN6MPHHT.js → order-metadata-EAGVYWZL.js} +22 -23
  241. package/dist/{order-request-transfer-A2NJSQ4H.js → order-request-transfer-O4Q73SK5.js} +22 -23
  242. package/dist/pages/index.d.ts +586 -756
  243. package/dist/pages/index.js +200 -204
  244. package/dist/{payout-list-7WJZFNW5.js → payout-list-6HQJM5YW.js} +5 -5
  245. package/dist/{price-list-configuration-XAHXLCXR.js → price-list-configuration-XAQ2OEG4.js} +13 -12
  246. package/dist/{price-list-create-CZAQLDSW.js → price-list-create-H7WBDAC5.js} +38 -39
  247. package/dist/{price-list-detail-6VXW6O5I.js → price-list-detail-BYXRB2ND.js} +32 -33
  248. package/dist/{price-list-edit-ZVLD4M5T.js → price-list-edit-BYSFESIX.js} +4 -4
  249. package/dist/{price-list-list-ER4TOZTY.js → price-list-list-NNCTFTSJ.js} +9 -9
  250. package/dist/{price-list-prices-add-FQI7EF6V.js → price-list-prices-add-RN5RKGF6.js} +35 -36
  251. package/dist/{price-list-prices-edit-WHCIGSB2.js → price-list-prices-edit-P3HBNQVA.js} +23 -24
  252. package/dist/{product-add-existing-attributes-QKIGOAE2.js → product-add-existing-attributes-3DKKBGKG.js} +81 -42
  253. package/dist/{product-attributes-MHRXZK5S.js → product-attributes-CGLY56QN.js} +3 -3
  254. package/dist/{product-bulk-edit-J6ZP7GGM.js → product-bulk-edit-L5VJUWHK.js} +6 -8
  255. package/dist/{product-create-ZVQOFCJA.js → product-create-BJPAN5FR.js} +33 -34
  256. package/dist/{product-create-attribute-ZT3VZDNZ.js → product-create-attribute-LBQENHSF.js} +91 -53
  257. package/dist/product-create-variant-4PS7DJUI.js +20 -0
  258. package/dist/{product-detail-N6W4M6TC.js → product-detail-JKPHVZT5.js} +29 -27
  259. package/dist/{product-edit-EKAZRIJ6.js → product-edit-P6XH3L6L.js} +3 -5
  260. package/dist/product-edit-attribute-VGOXQKZ3.js +368 -0
  261. package/dist/{product-list-VWBUTMXT.js → product-list-XSNCYJWP.js} +32 -33
  262. package/dist/{product-media-KREKRDOC.js → product-media-AH6H4HJX.js} +13 -9
  263. package/dist/{product-metadata-O3BAEUYB.js → product-metadata-NGELJKS3.js} +23 -24
  264. package/dist/{product-organization-SBQY44IF.js → product-organization-CKUJWI3D.js} +83 -50
  265. package/dist/{product-sales-channels-TFOGXCMI.js → product-sales-channels-5BL5U76N.js} +8 -8
  266. package/dist/{product-shipping-profile-E4HJ4EYW.js → product-shipping-profile-GOXQTNIA.js} +3 -3
  267. package/dist/{product-tag-create-7JBM6I3V.js → product-tag-create-26GJFMP3.js} +21 -22
  268. package/dist/{product-tag-detail-KSJ45MJU.js → product-tag-detail-GI7UI22V.js} +49 -48
  269. package/dist/{product-tag-edit-O2ADFDD6.js → product-tag-edit-LJ5LOAB4.js} +21 -22
  270. package/dist/{product-tag-list-NQPPUWZG.js → product-tag-list-H3BEJC3T.js} +49 -48
  271. package/dist/{product-tag-metadata-SBOUTUXY.js → product-tag-metadata-VUQYHROC.js} +22 -23
  272. package/dist/{product-type-create-RHG4KEAV.js → product-type-create-A7SUR2OX.js} +1 -1
  273. package/dist/{product-type-detail-L2ASZ4GW.js → product-type-detail-YLTHK3WR.js} +31 -32
  274. package/dist/{product-type-edit-CABB7R7Y.js → product-type-edit-DM4U2VB4.js} +1 -1
  275. package/dist/{product-type-list-TM26QMHR.js → product-type-list-FCPUCMHZ.js} +4 -4
  276. package/dist/{product-type-metadata-KN5OXR6J.js → product-type-metadata-GX45OZJN.js} +23 -24
  277. package/dist/{product-variant-detail-H2YRFDAU.js → product-variant-detail-NTZAL233.js} +25 -35
  278. package/dist/{product-variant-edit-T267E4SW.js → product-variant-edit-QJDI34H5.js} +172 -263
  279. package/dist/{product-variant-metadata-QESZ7VS2.js → product-variant-metadata-7YFMPPB6.js} +22 -23
  280. package/dist/{profile-edit-HQTWYWZ7.js → profile-edit-H5QZ66PF.js} +1 -1
  281. package/dist/{promotion-add-campaign-O3RTMS3W.js → promotion-add-campaign-V3RJ634F.js} +4 -4
  282. package/dist/{promotion-create-TGC6BVWF.js → promotion-create-4CYXDQ4X.js} +26 -27
  283. package/dist/{promotion-detail-VYIXZMMD.js → promotion-detail-NFNBZ6YZ.js} +24 -25
  284. package/dist/{promotion-edit-details-TKRC5HES.js → promotion-edit-details-NWOBD3YD.js} +1 -1
  285. package/dist/{promotion-list-C3SKV5BJ.js → promotion-list-QWALFJWV.js} +7 -7
  286. package/dist/{refund-reason-create-2KEQFOID.js → refund-reason-create-UKEEJ47T.js} +21 -22
  287. package/dist/{refund-reason-edit-E7CB7SM3.js → refund-reason-edit-5TIFGV34.js} +21 -22
  288. package/dist/{refund-reason-list-PAWAU6KN.js → refund-reason-list-T55XZNAP.js} +39 -38
  289. package/dist/{region-add-countries-COXN4LP3.js → region-add-countries-C23C6QUJ.js} +9 -9
  290. package/dist/{region-create-P66Q65XY.js → region-create-L2JYP7DK.js} +9 -9
  291. package/dist/{region-detail-P2HHBYFV.js → region-detail-4MELDU2I.js} +6 -6
  292. package/dist/{region-edit-XFE54SAO.js → region-edit-YQZCZIX3.js} +1 -1
  293. package/dist/{region-list-2XXKCDDX.js → region-list-SDMLAQCG.js} +5 -5
  294. package/dist/{region-metadata-723RQGHS.js → region-metadata-ZCPAAMLY.js} +25 -26
  295. package/dist/{reservation-create-Y3HG4AZA.js → reservation-create-WWGZ5A7Z.js} +3 -3
  296. package/dist/{reservation-detail-HQMADZ56.js → reservation-detail-K7LQX5TT.js} +21 -22
  297. package/dist/{reservation-list-YKC3JJ6K.js → reservation-list-AQFSNZNN.js} +6 -6
  298. package/dist/{reservation-metadata-UG4YTEMY.js → reservation-metadata-4W5SP7OA.js} +22 -23
  299. package/dist/{reset-password-2VNU52CE.js → reset-password-37QWVIGC.js} +1 -1
  300. package/dist/{return-reason-create-KED7446I.js → return-reason-create-G7ON7U3A.js} +1 -1
  301. package/dist/{return-reason-edit-57EU3XSE.js → return-reason-edit-77RVRFF6.js} +1 -1
  302. package/dist/{return-reason-list-YH3HHTLJ.js → return-reason-list-IZNMWPEM.js} +26 -24
  303. package/dist/{sales-channel-add-products-IOS5FT56.js → sales-channel-add-products-RDYMBNAE.js} +35 -36
  304. package/dist/{sales-channel-create-BSNCLZWR.js → sales-channel-create-APJ6UXEW.js} +3 -3
  305. package/dist/{sales-channel-detail-6T4M2IEH.js → sales-channel-detail-XF3WPMVT.js} +30 -31
  306. package/dist/{sales-channel-edit-FUDXMZYV.js → sales-channel-edit-CBZZQ2VG.js} +3 -3
  307. package/dist/{sales-channel-list-GYLGH4U7.js → sales-channel-list-46AJDQZ6.js} +24 -25
  308. package/dist/{sales-channel-metadata-H6RSHKVP.js → sales-channel-metadata-AWVCB7DX.js} +22 -23
  309. package/dist/{shipping-option-type-create-QAOW7753.js → shipping-option-type-create-NSGPERMQ.js} +21 -22
  310. package/dist/{shipping-option-type-detail-QGWVDTDU.js → shipping-option-type-detail-IZ2XRP3S.js} +22 -23
  311. package/dist/{shipping-option-type-edit-WXYBDRNY.js → shipping-option-type-edit-KFVTVVGH.js} +21 -22
  312. package/dist/{shipping-option-type-list-YSWP6DSC.js → shipping-option-type-list-2P65XUH5.js} +25 -26
  313. package/dist/{shipping-profile-create-UJNCCKKK.js → shipping-profile-create-JYRXTOBF.js} +1 -1
  314. package/dist/{shipping-profile-metadata-UE53IA3J.js → shipping-profile-metadata-FPD35TQ3.js} +23 -24
  315. package/dist/{shipping-profiles-list-JF2SQIQ7.js → shipping-profiles-list-VUUGBT24.js} +4 -4
  316. package/dist/{store-address-edit-PKIBRFH4.js → store-address-edit-SWLACMPC.js} +1 -1
  317. package/dist/{store-bulk-edit-AMSI34AW.js → store-bulk-edit-N4XSW6UA.js} +3 -3
  318. package/dist/{store-closure-edit-OK7MTUHY.js → store-closure-edit-Y3FOCDRX.js} +1 -1
  319. package/dist/{store-create-WNFRHXWR.js → store-create-VFXM4O7E.js} +25 -26
  320. package/dist/{store-details-4KYA642K.js → store-details-2V46HEJD.js} +39 -54
  321. package/dist/{store-edit-GWHK5PX5.js → store-edit-G6JFYGXK.js} +8 -8
  322. package/dist/{store-list-SUFT46IY.js → store-list-5FPJV3KV.js} +35 -36
  323. package/dist/{store-member-invite-MUSU7EQ7.js → store-member-invite-7ORH52T4.js} +2 -2
  324. package/dist/{store-payment-details-edit-HOGHZMZC.js → store-payment-details-edit-DF2WURRI.js} +1 -1
  325. package/dist/{store-professional-details-edit-DPJ4ZFDR.js → store-professional-details-edit-FPOLORSE.js} +1 -1
  326. package/dist/{tax-region-create-3KVECMFN.js → tax-region-create-HUF2FCLU.js} +22 -23
  327. package/dist/{tax-region-detail-AOT4X4DZ.js → tax-region-detail-UZ776HBC.js} +28 -29
  328. package/dist/{tax-region-edit-5T7VHKIA.js → tax-region-edit-M24WWMU6.js} +21 -22
  329. package/dist/{tax-region-list-FIBHEFVD.js → tax-region-list-6LH6TYQZ.js} +4 -4
  330. package/dist/{tax-region-metadata-RSZCJGJT.js → tax-region-metadata-XJFQE3XR.js} +22 -23
  331. package/dist/{tax-region-province-create-OVLIZPNP.js → tax-region-province-create-SEPY4OAZ.js} +1 -1
  332. package/dist/{tax-region-province-detail-XEMIX5SQ.js → tax-region-province-detail-7JRSANC2.js} +26 -27
  333. package/dist/{tax-region-tax-override-create-74C24OCP.js → tax-region-tax-override-create-G5DAVZDV.js} +52 -53
  334. package/dist/{tax-region-tax-override-edit-KSQI4ITI.js → tax-region-tax-override-edit-D52MNBCS.js} +53 -54
  335. package/dist/{tax-region-tax-rate-create-KDN6G52Y.js → tax-region-tax-rate-create-ZITIAU3K.js} +1 -1
  336. package/dist/{tax-region-tax-rate-edit-D4BFDDJ7.js → tax-region-tax-rate-edit-RQLUPHD4.js} +1 -1
  337. package/dist/{user-detail-W7DGVXDZ.js → user-detail-JV2BQ43X.js} +1 -1
  338. package/dist/{user-edit-MXS2DV37.js → user-edit-DVIMNODF.js} +1 -1
  339. package/dist/{user-invite-HLZJ7FST.js → user-invite-KYSDELAV.js} +9 -9
  340. package/dist/{user-list-TR7RSGUO.js → user-list-IUJTQS5X.js} +4 -4
  341. package/dist/{user-metadata-3AFZX3DM.js → user-metadata-ZBON4ZVS.js} +22 -23
  342. package/package.json +12 -12
  343. package/dist/[id]-YI7UXOO2.js +0 -499
  344. package/dist/chunk-AKTAFKIU.js +0 -228
  345. package/dist/chunk-ALATTLBM.js +0 -390
  346. package/dist/chunk-IEPNHH7Z.js +0 -170
  347. package/dist/chunk-J65IXAGI.js +0 -292
  348. package/dist/chunk-QSGR43JM.js +0 -30
  349. package/dist/chunk-RAWXS763.js +0 -652
  350. package/dist/chunk-RQ4NMLSS.js +0 -8
  351. package/dist/chunk-RXM4B6HR.js +0 -8
  352. package/dist/chunk-SNPNLTCO.js +0 -207
  353. package/dist/chunk-SWL7ZCP3.js +0 -11
  354. package/dist/chunk-U7XILJH6.js +0 -423
  355. package/dist/chunk-UM7ZR3VU.js +0 -14
  356. package/dist/chunk-V5XHY5LP.js +0 -39
  357. package/dist/chunk-WV4SQ57G.js +0 -141
  358. package/dist/chunk-ZZ3XFIEM.js +0 -84
  359. package/dist/commission-rate-create-7SH3LKQP.js +0 -783
  360. package/dist/commission-rate-detail-LAZZLZVX.js +0 -86
  361. package/dist/commission-rate-edit-ISER2E7G.js +0 -768
  362. package/dist/commission-rate-list-Y5XLEO67.js +0 -26
  363. package/dist/loader-6KDBTRVR.js +0 -26
  364. package/dist/offers-566UJ2JF.js +0 -440
  365. package/dist/order-allocate-items-DJ2V4B7A.js +0 -563
  366. package/dist/order-create-fulfillment-SMSUJSBN.js +0 -644
  367. package/dist/order-create-shipment-5ZAWH5CZ.js +0 -215
  368. package/dist/order-receive-return-DZ4IUOHY.js +0 -563
  369. package/dist/product-brand-create-B3ZJGHUQ.js +0 -171
  370. package/dist/product-brand-detail-WYALM342.js +0 -100
  371. package/dist/product-brand-edit-3TQDHZNN.js +0 -179
  372. package/dist/product-brand-list-ZBPBSRQN.js +0 -30
  373. package/dist/product-brand-metadata-EAMW6PQJ.js +0 -87
  374. package/dist/product-create-option-NIAP75EE.js +0 -130
  375. package/dist/product-create-variant-KKOMOEDX.js +0 -60
  376. package/dist/product-edit-option-OZUZGMIM.js +0 -166
  377. package/dist/product-prices-R5JOHVGS.js +0 -267
  378. package/dist/product-stock-EIP2XJUR.js +0 -545
  379. package/dist/product-variant-manage-inventory-items-Q5MJG3EJ.js +0 -337
  380. package/dist/{chunk-WVKVPGJW.js → chunk-FNKBJCNF.js} +3 -3
@@ -1,13 +1,12 @@
1
+ import {
2
+ ProductMediaSection
3
+ } from "./chunk-27PAP64U.js";
1
4
  import {
2
5
  SectionRow
3
6
  } from "./chunk-3XPXUIK3.js";
4
- import {
5
- useDataTableDateColumns,
6
- useDataTableDateFilters
7
- } from "./chunk-54RTJBYO.js";
8
7
  import {
9
8
  PRODUCT_DETAIL_QUERY
10
- } from "./chunk-RQ4NMLSS.js";
9
+ } from "./chunk-46MOMKPW.js";
11
10
  import {
12
11
  TwoColumnPage
13
12
  } from "./chunk-E74OUNA3.js";
@@ -15,35 +14,21 @@ import {
15
14
  Thumbnail
16
15
  } from "./chunk-WIYFXWRI.js";
17
16
  import {
18
- DataTable
19
- } from "./chunk-LYZT5REU.js";
20
- import {
21
- require_dist
22
- } from "./chunk-FMRP2CNF.js";
17
+ _DataTable,
18
+ useDataTable
19
+ } from "./chunk-JGCGVEFZ.js";
23
20
  import {
24
21
  useQueryParams
25
22
  } from "./chunk-THHRRYRS.js";
26
23
  import {
27
- useProductTag
28
- } from "./chunk-AXTQMIIK.js";
29
- import {
30
- useProductType
31
- } from "./chunk-46M463BR.js";
32
- import {
33
- useCollection
34
- } from "./chunk-XZZTC7E5.js";
24
+ require_dist
25
+ } from "./chunk-YZBEJ3CY.js";
35
26
  import {
36
27
  useSeller
37
28
  } from "./chunk-LEG67A2R.js";
38
29
  import {
39
30
  ActionMenu
40
31
  } from "./chunk-BDGZ4EQO.js";
41
- import {
42
- useProductCategory
43
- } from "./chunk-H5PYBIOZ.js";
44
- import {
45
- PRODUCT_VARIANT_IDS_KEY
46
- } from "./chunk-YGAX72XV.js";
47
32
  import {
48
33
  TwoColumnPageSkeleton
49
34
  } from "./chunk-INNFZYX2.js";
@@ -58,9 +43,8 @@ import {
58
43
  useProductVariants,
59
44
  useRejectProduct,
60
45
  useRemoveAttributeFromProduct,
61
- useRequestProductChanges,
62
- useUpdateProduct
63
- } from "./chunk-2YYXP6XI.js";
46
+ useRequestProductChanges
47
+ } from "./chunk-AM5XDEIN.js";
64
48
  import {
65
49
  sdk
66
50
  } from "./chunk-ZBWL72TB.js";
@@ -74,19 +58,11 @@ import { useLoaderData, useParams } from "react-router-dom";
74
58
 
75
59
  // src/pages/products/product-detail/components/product-active-edit-section/product-active-edit-section.tsx
76
60
  var import_types = __toESM(require_dist(), 1);
77
- import { Fragment, useMemo, useState as useState2 } from "react";
78
- import { ExclamationCircleSolid } from "@medusajs/icons";
79
- import { Button, Container, Heading, Text, toast } from "@medusajs/ui";
61
+ import { useState as useState2 } from "react";
62
+ import { Button, Text, toast } from "@medusajs/ui";
80
63
  import {
81
- describeProductChangeAction,
82
- extractReferenceIds,
83
- formatFieldValue,
84
- humanizeFieldName,
85
- isImageList,
86
- isReferenceField,
87
- partitionProductChangeActions
64
+ ProductChangePanel
88
65
  } from "@mercurjs/dashboard-shared";
89
- import { useQuery } from "@tanstack/react-query";
90
66
  import { useTranslation as useTranslation2 } from "react-i18next";
91
67
 
92
68
  // src/components/common/confirm-prompt/confirm-prompt.tsx
@@ -169,157 +145,49 @@ var ConfirmPrompt = ({
169
145
  };
170
146
 
171
147
  // src/pages/products/product-detail/components/product-active-edit-section/product-active-edit-section.tsx
172
- import { Fragment as Fragment2, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
173
- var ImageStrip = ({
174
- images,
175
- faded
176
- }) => /* @__PURE__ */ jsx2(
177
- "div",
178
- {
179
- className: faded ? "flex items-center gap-1.5 opacity-50" : "flex items-center gap-1.5",
180
- children: images.map((image, idx) => /* @__PURE__ */ jsx2(Thumbnail, { src: image.url, size: "base" }, `${image.url}-${idx}`))
181
- }
182
- );
183
- var BrandName = ({ id }) => {
184
- const { data } = useQuery({
185
- queryKey: ["product_brand", id],
186
- queryFn: () => sdk.admin.productBrands.$id.query({ $id: id }),
187
- enabled: !!id
188
- });
189
- return /* @__PURE__ */ jsx2(Fragment2, { children: data?.product_brand?.name ?? id });
190
- };
191
- var TypeName = ({ id }) => {
192
- const { product_type } = useProductType(id);
193
- return /* @__PURE__ */ jsx2(Fragment2, { children: product_type?.value ?? id });
194
- };
195
- var CollectionName = ({ id }) => {
196
- const { collection } = useCollection(id);
197
- return /* @__PURE__ */ jsx2(Fragment2, { children: collection?.title ?? id });
198
- };
199
- var CategoryName = ({ id }) => {
200
- const { product_category } = useProductCategory(id);
201
- return /* @__PURE__ */ jsx2(Fragment2, { children: product_category?.name ?? id });
202
- };
203
- var TagName = ({ id }) => {
204
- const { product_tag } = useProductTag(id);
205
- return /* @__PURE__ */ jsx2(Fragment2, { children: product_tag?.value ?? id });
206
- };
207
- var ReferenceName = ({
208
- field,
209
- id
210
- }) => {
211
- switch (field) {
212
- case "brand_id":
213
- return /* @__PURE__ */ jsx2(BrandName, { id });
214
- case "type_id":
215
- return /* @__PURE__ */ jsx2(TypeName, { id });
216
- case "collection_id":
217
- return /* @__PURE__ */ jsx2(CollectionName, { id });
218
- case "categories":
219
- return /* @__PURE__ */ jsx2(CategoryName, { id });
220
- case "tags":
221
- return /* @__PURE__ */ jsx2(TagName, { id });
148
+ import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
149
+ var VARIANT_LOOKUP_FIELDS = "id,title,sku,*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;
222
189
  }
223
- };
224
- var ReferenceList = ({
225
- field,
226
- ids
227
- }) => {
228
- if (!ids.length) return /* @__PURE__ */ jsx2(Fragment2, { children: "-" });
229
- return /* @__PURE__ */ jsx2(Fragment2, { children: ids.map((id, idx) => /* @__PURE__ */ jsxs2(Fragment, { children: [
230
- idx > 0 && ", ",
231
- /* @__PURE__ */ jsx2(ReferenceName, { field, id })
232
- ] }, `${field}-${id}`)) });
233
- };
234
- var FieldRow = ({ diff }) => {
235
- const { t } = useTranslation2();
236
- const hasPrevious = diff.previous !== void 0 && diff.previous !== null && diff.previous !== "" && !(Array.isArray(diff.previous) && diff.previous.length === 0);
237
- const nextIsImages = isImageList(diff.next);
238
- const previousIsImages = isImageList(diff.previous);
239
- const renderAsImages = nextIsImages || previousIsImages;
240
- const renderAsReference = isReferenceField(diff.field);
241
- return /* @__PURE__ */ jsxs2("div", { className: "flex items-start gap-4", children: [
242
- /* @__PURE__ */ jsx2(
243
- Text,
244
- {
245
- size: "small",
246
- weight: "plus",
247
- leading: "compact",
248
- className: "text-ui-fg-subtle w-[160px] shrink-0",
249
- children: t(`fields.${diff.field}`, {
250
- defaultValue: humanizeFieldName(diff.field)
251
- })
252
- }
253
- ),
254
- renderAsImages ? /* @__PURE__ */ jsxs2("div", { className: "flex flex-1 flex-wrap items-center gap-2", children: [
255
- hasPrevious && previousIsImages && /* @__PURE__ */ jsx2(ImageStrip, { images: diff.previous, faded: true }),
256
- hasPrevious && /* @__PURE__ */ jsx2(
257
- Text,
258
- {
259
- size: "small",
260
- leading: "compact",
261
- className: "text-ui-fg-subtle",
262
- children: "\u2192"
263
- }
264
- ),
265
- nextIsImages ? /* @__PURE__ */ jsx2(ImageStrip, { images: diff.next }) : /* @__PURE__ */ jsx2(
266
- Text,
267
- {
268
- size: "small",
269
- leading: "compact",
270
- className: "text-ui-fg-subtle",
271
- children: formatFieldValue(diff.next, diff.field)
272
- }
273
- )
274
- ] }) : renderAsReference ? /* @__PURE__ */ jsxs2(
275
- Text,
276
- {
277
- size: "small",
278
- leading: "compact",
279
- className: "text-ui-fg-subtle flex-1 whitespace-pre-line text-pretty",
280
- children: [
281
- hasPrevious && /* @__PURE__ */ jsx2("span", { className: "line-through", children: /* @__PURE__ */ jsx2(
282
- ReferenceList,
283
- {
284
- field: diff.field,
285
- ids: extractReferenceIds(
286
- diff.field,
287
- diff.previous
288
- )
289
- }
290
- ) }),
291
- hasPrevious && " \u2192 ",
292
- /* @__PURE__ */ jsx2(
293
- ReferenceList,
294
- {
295
- field: diff.field,
296
- ids: extractReferenceIds(diff.field, diff.next)
297
- }
298
- )
299
- ]
300
- }
301
- ) : /* @__PURE__ */ jsxs2(
302
- Text,
303
- {
304
- size: "small",
305
- leading: "compact",
306
- className: "text-ui-fg-subtle flex-1 whitespace-pre-line text-pretty",
307
- children: [
308
- hasPrevious && /* @__PURE__ */ jsx2("span", { className: "line-through", children: formatFieldValue(diff.previous, diff.field) }),
309
- hasPrevious && " \u2192 ",
310
- formatFieldValue(diff.next, diff.field)
311
- ]
312
- }
313
- )
314
- ] });
315
- };
316
- var ActionLine = ({ action }) => {
317
- const { t } = useTranslation2();
318
- const label = describeProductChangeAction(action, {
319
- variant: t("fields.variant", { defaultValue: "Variant" })
320
- });
321
- return /* @__PURE__ */ jsx2(Text, { size: "small", leading: "compact", className: "text-ui-fg-subtle", children: label });
322
- };
190
+ });
323
191
  var ProductActiveEditSection = ({
324
192
  product
325
193
  }) => {
@@ -335,17 +203,12 @@ var ProductActiveEditSection = ({
335
203
  });
336
204
  const { mutateAsync: confirmChange, isPending: isConfirming } = useConfirmProductChange(product_change?.id ?? "", product.id);
337
205
  const { mutateAsync: cancelChange, isPending: isRejecting } = useCancelProductChange(product_change?.id ?? "", product.id);
338
- const { updated, added, removed, deleteRequested } = useMemo(
339
- () => partitionProductChangeActions(product_change?.actions ?? []),
340
- [product_change]
341
- );
342
206
  if (isError || !product_change) {
343
207
  return null;
344
208
  }
345
209
  if (product_change.status !== import_types.ProductChangeStatus.PENDING) {
346
210
  return null;
347
211
  }
348
- const hasContent = updated.length > 0 || added.length > 0 || removed.length > 0 || deleteRequested;
349
212
  const handleConfirm = async (note) => {
350
213
  try {
351
214
  await confirmChange({ internal_note: note });
@@ -364,149 +227,84 @@ var ProductActiveEditSection = ({
364
227
  toast.error(e.message);
365
228
  }
366
229
  };
367
- return /* @__PURE__ */ jsxs2(
368
- Container,
369
- {
370
- className: "divide-y p-0",
371
- "data-testid": "product-active-edit-section",
372
- children: [
373
- /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-2 px-6 py-4", children: [
374
- /* @__PURE__ */ jsx2(ExclamationCircleSolid, { className: "text-ui-fg-interactive" }),
375
- /* @__PURE__ */ jsx2(Heading, { level: "h2", "data-testid": "product-active-edit-heading", children: t("products.edits.panel.title") })
376
- ] }),
377
- /* @__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", {
378
245
  store: requesterSeller?.name ?? t("products.request.fallbackStore")
379
- }) }) }),
380
- hasContent && /* @__PURE__ */ jsxs2(Fragment2, { children: [
381
- updated.length > 0 && /* @__PURE__ */ jsxs2("div", { className: "flex items-start gap-4 px-6 py-4", children: [
382
- /* @__PURE__ */ jsx2(
383
- Text,
384
- {
385
- size: "small",
386
- weight: "plus",
387
- leading: "compact",
388
- className: "text-ui-fg-subtle w-[160px] shrink-0",
389
- children: t("labels.updated")
390
- }
391
- ),
392
- /* @__PURE__ */ jsx2("div", { className: "flex flex-1 flex-col gap-y-4", children: updated.map((diff, idx) => /* @__PURE__ */ jsx2(FieldRow, { diff }, `${diff.field}-${idx}`)) })
393
- ] }),
394
- added.length > 0 && /* @__PURE__ */ jsxs2("div", { className: "flex items-start gap-4 px-6 py-4", children: [
395
- /* @__PURE__ */ jsx2(
396
- Text,
397
- {
398
- size: "small",
399
- weight: "plus",
400
- leading: "compact",
401
- className: "text-ui-fg-subtle w-[160px] shrink-0",
402
- children: t("labels.added")
403
- }
404
- ),
405
- /* @__PURE__ */ jsx2("div", { className: "flex flex-1 flex-col gap-y-2", children: added.map((action) => /* @__PURE__ */ jsx2(ActionLine, { action }, action.id)) })
406
- ] }),
407
- removed.length > 0 && /* @__PURE__ */ jsxs2("div", { className: "flex items-start gap-4 px-6 py-4", children: [
408
- /* @__PURE__ */ jsx2(
409
- Text,
410
- {
411
- size: "small",
412
- weight: "plus",
413
- leading: "compact",
414
- className: "text-ui-fg-subtle w-[160px] shrink-0",
415
- children: t("labels.removed")
416
- }
417
- ),
418
- /* @__PURE__ */ jsx2("div", { className: "flex flex-1 flex-col gap-y-2", children: removed.map((action) => /* @__PURE__ */ jsx2(ActionLine, { action }, action.id)) })
419
- ] }),
420
- deleteRequested && /* @__PURE__ */ jsxs2("div", { className: "flex items-start gap-4 px-6 py-4", children: [
421
- /* @__PURE__ */ jsx2(
422
- Text,
423
- {
424
- size: "small",
425
- weight: "plus",
426
- leading: "compact",
427
- className: "text-ui-fg-subtle w-[160px] shrink-0",
428
- children: t("labels.removed")
429
- }
430
- ),
431
- /* @__PURE__ */ jsx2(
432
- Text,
433
- {
434
- size: "small",
435
- leading: "compact",
436
- className: "text-ui-fg-subtle flex-1",
437
- children: t("products.edits.panel.deleteRequested")
438
- }
439
- )
440
- ] })
441
- ] }),
442
- /* @__PURE__ */ jsxs2(
443
- "div",
444
- {
445
- className: "bg-ui-bg-subtle flex items-center justify-end gap-x-2 rounded-b-xl px-6 py-4",
446
- "data-testid": "product-active-edit-actions",
447
- children: [
448
- /* @__PURE__ */ jsx2(
449
- Button,
450
- {
451
- size: "small",
452
- variant: "secondary",
453
- onClick: () => setConfirmOpen(true),
454
- "data-testid": "product-active-edit-confirm-button",
455
- children: t("actions.confirm")
456
- }
457
- ),
458
- /* @__PURE__ */ jsx2(
459
- Button,
460
- {
461
- size: "small",
462
- variant: "secondary",
463
- onClick: () => setRejectOpen(true),
464
- "data-testid": "product-active-edit-reject-button",
465
- children: t("products.edits.actions.reject")
466
- }
467
- )
468
- ]
469
- }
470
- ),
471
- /* @__PURE__ */ jsx2(
472
- ConfirmPrompt,
473
- {
474
- open: confirmOpen,
475
- onOpenChange: setConfirmOpen,
476
- title: t("products.edits.confirmPrompt.title"),
477
- description: t("products.edits.confirmPrompt.description"),
478
- noteLabel: t("products.edits.confirmPrompt.noteLabel"),
479
- noteOptional: true,
480
- notePlaceholder: t("products.edits.confirmPrompt.notePlaceholder"),
481
- isLoading: isConfirming,
482
- onConfirm: handleConfirm
483
- }
484
- ),
485
- /* @__PURE__ */ jsx2(
486
- ConfirmPrompt,
487
- {
488
- open: rejectOpen,
489
- onOpenChange: setRejectOpen,
490
- title: t("products.edits.rejectPrompt.title"),
491
- description: t("products.edits.rejectPrompt.description"),
492
- noteLabel: t("products.edits.rejectPrompt.noteLabel"),
493
- noteOptional: true,
494
- notePlaceholder: t("products.edits.rejectPrompt.notePlaceholder"),
495
- confirmLabel: t("products.edits.rejectPrompt.confirm"),
496
- isLoading: isRejecting,
497
- onConfirm: handleReject
498
- }
499
- )
500
- ]
501
- }
502
- );
246
+ }) }),
247
+ footer: /* @__PURE__ */ jsxs2(Fragment, { children: [
248
+ /* @__PURE__ */ jsx2(
249
+ Button,
250
+ {
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
+ ] });
503
301
  };
504
302
 
505
303
  // src/pages/products/product-detail/components/product-active-request-section/product-active-request-section.tsx
506
304
  var import_types2 = __toESM(require_dist(), 1);
507
305
  import { useState as useState3 } from "react";
508
- import { Button as Button2, Container as Container2, Heading as Heading2, Text as Text2, toast as toast2 } from "@medusajs/ui";
509
- 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";
510
308
  import { useTranslation as useTranslation3 } from "react-i18next";
511
309
  import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
512
310
  var ProductActiveRequestSection = ({
@@ -550,7 +348,7 @@ var ProductActiveRequestSection = ({
550
348
  }
551
349
  };
552
350
  return /* @__PURE__ */ jsxs3(
553
- Container2,
351
+ Container,
554
352
  {
555
353
  className: "divide-y p-0",
556
354
  "data-testid": "product-active-request-section",
@@ -561,8 +359,8 @@ var ProductActiveRequestSection = ({
561
359
  className: "flex items-center gap-2 px-6 py-4",
562
360
  "data-testid": "product-active-request-header",
563
361
  children: [
564
- /* @__PURE__ */ jsx3(ExclamationCircleSolid2, { className: "text-ui-fg-interactive" }),
565
- /* @__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") })
566
364
  ]
567
365
  }
568
366
  ),
@@ -666,12 +464,13 @@ import {
666
464
  Trash,
667
465
  Swatch,
668
466
  DropCap,
669
- InformationCircleSolid
467
+ InformationCircleSolid,
468
+ PencilSquare
670
469
  } from "@medusajs/icons";
671
470
  import {
672
471
  Badge,
673
- Container as Container3,
674
- Heading as Heading3,
472
+ Container as Container2,
473
+ Heading as Heading2,
675
474
  Text as Text3,
676
475
  toast as toast3,
677
476
  Tooltip,
@@ -711,12 +510,23 @@ var AttributeActions = ({
711
510
  {
712
511
  actions: [
713
512
  {
714
- label: t("actions.delete"),
715
- onClick: handleDelete,
716
- icon: /* @__PURE__ */ jsx4(Trash, {})
513
+ label: t("actions.edit"),
514
+ to: `attributes/${attribute.id}/edit`,
515
+ icon: /* @__PURE__ */ jsx4(PencilSquare, {})
717
516
  }
718
517
  ]
719
- }
518
+ },
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
+ ]
720
530
  ]
721
531
  }
722
532
  );
@@ -766,7 +576,9 @@ var AttributeGroup = ({
766
576
  size: "small",
767
577
  leading: "compact",
768
578
  className: "text-ui-fg-subtle",
769
- children: values.join(", ") || "-"
579
+ children: attr.type === "toggle" ? values.map(
580
+ (val) => val === "true" ? t("general.yes") : t("general.no")
581
+ ).join(", ") || "-" : values.join(", ") || "-"
770
582
  }
771
583
  ) }),
772
584
  /* @__PURE__ */ jsx4(AttributeActions, { productId, attribute: attr })
@@ -785,13 +597,13 @@ var ProductAttributeSection = ({
785
597
  const variantAttributes = allAttributes.filter((a) => a.is_variant_axis);
786
598
  const infoAttributes = allAttributes.filter((a) => !a.is_variant_axis);
787
599
  const isEmpty = !variantAttributes.length && !infoAttributes.length;
788
- return /* @__PURE__ */ jsxs4(Container3, { className: "p-0", children: [
600
+ return /* @__PURE__ */ jsxs4(Container2, { className: "p-0", children: [
789
601
  /* @__PURE__ */ jsxs4(
790
602
  "div",
791
603
  {
792
604
  className: `flex items-center justify-between px-6 py-4${isEmpty ? "" : " border-b border-ui-border-base"}`,
793
605
  children: [
794
- /* @__PURE__ */ jsx4(Heading3, { level: "h2", children: t("products.attributes") }),
606
+ /* @__PURE__ */ jsx4(Heading2, { level: "h2", children: t("products.attributes") }),
795
607
  /* @__PURE__ */ jsx4(
796
608
  ActionMenu,
797
609
  {
@@ -841,8 +653,8 @@ var ProductAttributeSection = ({
841
653
  };
842
654
 
843
655
  // src/pages/products/product-detail/components/product-general-section/product-general-section.tsx
844
- import { PencilSquare, Trash as Trash2 } from "@medusajs/icons";
845
- import { Container as Container4, Heading as Heading4, StatusBadge, usePrompt as usePrompt2 } from "@medusajs/ui";
656
+ import { PencilSquare as PencilSquare2, Trash as Trash2 } from "@medusajs/icons";
657
+ import { Container as Container3, Heading as Heading3, StatusBadge, usePrompt as usePrompt2 } from "@medusajs/ui";
846
658
  import { useTranslation as useTranslation5 } from "react-i18next";
847
659
  import { useNavigate } from "react-router-dom";
848
660
  import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
@@ -854,8 +666,6 @@ var productStatusColor = (status) => {
854
666
  return "orange";
855
667
  case "published":
856
668
  return "green";
857
- case "requires_action":
858
- return "blue";
859
669
  case "rejected":
860
670
  return "red";
861
671
  default:
@@ -887,14 +697,14 @@ var ProductGeneralSection = ({
887
697
  }
888
698
  });
889
699
  };
890
- 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: [
891
701
  /* @__PURE__ */ jsxs5(
892
702
  "div",
893
703
  {
894
704
  className: "flex items-center justify-between px-6 py-4",
895
705
  "data-testid": "product-general-header",
896
706
  children: [
897
- /* @__PURE__ */ jsx5(Heading4, { "data-testid": "product-general-title", children: product.title }),
707
+ /* @__PURE__ */ jsx5(Heading3, { "data-testid": "product-general-title", children: product.title }),
898
708
  /* @__PURE__ */ jsxs5(
899
709
  "div",
900
710
  {
@@ -918,7 +728,7 @@ var ProductGeneralSection = ({
918
728
  {
919
729
  label: t("actions.edit"),
920
730
  to: "edit",
921
- icon: /* @__PURE__ */ jsx5(PencilSquare, {})
731
+ icon: /* @__PURE__ */ jsx5(PencilSquare2, {})
922
732
  }
923
733
  ]
924
734
  },
@@ -976,210 +786,30 @@ var ProductGeneralSection = ({
976
786
  ] });
977
787
  };
978
788
 
979
- // src/pages/products/product-detail/components/product-media-section/product-media-section.tsx
980
- import { PencilSquare as PencilSquare2, ThumbnailBadge } from "@medusajs/icons";
981
- import {
982
- Button as Button3,
983
- Checkbox,
984
- CommandBar,
985
- Container as Container5,
986
- Heading as Heading5,
987
- Text as Text4,
988
- Tooltip as Tooltip2,
989
- clx,
990
- usePrompt as usePrompt3
991
- } from "@medusajs/ui";
992
- import { useState as useState4 } from "react";
789
+ // src/pages/products/product-detail/components/product-organization-section/product-organization-section.tsx
790
+ import { PencilSquare as PencilSquare3 } from "@medusajs/icons";
791
+ import { Badge as Badge2, Container as Container4, Heading as Heading4, Tooltip as Tooltip2 } from "@medusajs/ui";
993
792
  import { useTranslation as useTranslation6 } from "react-i18next";
994
793
  import { Link } from "react-router-dom";
995
794
  import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
996
- var ProductMediaSection = ({
997
- product
998
- }) => {
999
- const { t } = useTranslation6();
1000
- const prompt = usePrompt3();
1001
- const [selection, setSelection] = useState4({});
1002
- const media = getMedia(product);
1003
- const handleCheckedChange = (id) => {
1004
- setSelection((prev) => {
1005
- if (prev[id]) {
1006
- const { [id]: _, ...rest } = prev;
1007
- return rest;
1008
- } else {
1009
- return { ...prev, [id]: true };
1010
- }
1011
- });
1012
- };
1013
- const { mutateAsync } = useUpdateProduct(product.id);
1014
- const handleDelete = async () => {
1015
- const ids = Object.keys(selection);
1016
- const includingThumbnail = ids.some(
1017
- (id) => media.find((m) => m.id === id)?.isThumbnail
1018
- );
1019
- const res = await prompt({
1020
- title: t("general.areYouSure"),
1021
- description: includingThumbnail ? t("products.media.deleteWarningWithThumbnail", {
1022
- count: ids.length
1023
- }) : t("products.media.deleteWarning", {
1024
- count: ids.length
1025
- }),
1026
- confirmText: t("actions.delete"),
1027
- cancelText: t("actions.cancel")
1028
- });
1029
- if (!res) {
1030
- return;
1031
- }
1032
- const mediaToKeep = product.images?.filter((i) => !ids.includes(i.id)).map((i) => ({ url: i.url }));
1033
- await mutateAsync(
1034
- {
1035
- images: mediaToKeep,
1036
- thumbnail: includingThumbnail ? "" : void 0
1037
- },
1038
- {
1039
- onSuccess: () => {
1040
- setSelection({});
1041
- }
1042
- }
1043
- );
1044
- };
1045
- return /* @__PURE__ */ jsxs6(Container5, { className: "divide-y p-0", "data-testid": "product-media-section", children: [
1046
- /* @__PURE__ */ jsxs6("div", { className: "flex items-center justify-between px-6 py-4", "data-testid": "product-media-header", children: [
1047
- /* @__PURE__ */ jsx6(Heading5, { level: "h2", "data-testid": "product-media-title", children: t("products.media.label") }),
1048
- /* @__PURE__ */ jsx6(
1049
- ActionMenu,
1050
- {
1051
- groups: [
1052
- {
1053
- actions: [
1054
- {
1055
- label: t("actions.edit"),
1056
- to: "media?view=edit",
1057
- icon: /* @__PURE__ */ jsx6(PencilSquare2, {})
1058
- }
1059
- ]
1060
- }
1061
- ],
1062
- "data-testid": "product-media-action-menu"
1063
- }
1064
- )
1065
- ] }),
1066
- media.length > 0 ? /* @__PURE__ */ jsx6("div", { className: "grid grid-cols-[repeat(auto-fill,minmax(96px,1fr))] gap-4 px-6 py-4", "data-testid": "product-media-grid", children: media.map((i, index) => {
1067
- const isSelected = selection[i.id];
1068
- return /* @__PURE__ */ jsxs6(
1069
- "div",
1070
- {
1071
- className: "shadow-elevation-card-rest hover:shadow-elevation-card-hover transition-fg group relative aspect-square size-full cursor-pointer overflow-hidden rounded-[8px]",
1072
- "data-testid": `product-media-item-${i.id}`,
1073
- children: [
1074
- /* @__PURE__ */ jsx6(
1075
- "div",
1076
- {
1077
- className: clx(
1078
- "transition-fg invisible absolute right-2 top-2 opacity-0 group-hover:visible group-hover:opacity-100",
1079
- {
1080
- "visible opacity-100": isSelected
1081
- }
1082
- ),
1083
- "data-testid": `product-media-checkbox-container-${i.id}`,
1084
- children: /* @__PURE__ */ jsx6(
1085
- Checkbox,
1086
- {
1087
- checked: selection[i.id] || false,
1088
- onCheckedChange: () => handleCheckedChange(i.id),
1089
- "data-testid": `product-media-checkbox-${i.id}`
1090
- }
1091
- )
1092
- }
1093
- ),
1094
- i.isThumbnail && /* @__PURE__ */ jsx6("div", { className: "absolute left-2 top-2", "data-testid": `product-media-thumbnail-badge-${i.id}`, children: /* @__PURE__ */ jsx6(Tooltip2, { content: t("fields.thumbnail"), children: /* @__PURE__ */ jsx6(ThumbnailBadge, {}) }) }),
1095
- /* @__PURE__ */ jsx6(Link, { to: `media`, state: { curr: index }, "data-testid": `product-media-link-${i.id}`, children: /* @__PURE__ */ jsx6(
1096
- "img",
1097
- {
1098
- src: i.url,
1099
- alt: product.title,
1100
- className: "size-full object-cover",
1101
- "data-testid": `product-media-image-${i.id}`
1102
- }
1103
- ) })
1104
- ]
1105
- },
1106
- i.id
1107
- );
1108
- }) }) : /* @__PURE__ */ jsxs6("div", { className: "flex flex-col items-center gap-y-4 pb-8 pt-6", "data-testid": "product-media-empty-state", children: [
1109
- /* @__PURE__ */ jsxs6("div", { className: "flex flex-col items-center", children: [
1110
- /* @__PURE__ */ jsx6(
1111
- Text4,
1112
- {
1113
- size: "small",
1114
- leading: "compact",
1115
- weight: "plus",
1116
- className: "text-ui-fg-subtle",
1117
- "data-testid": "product-media-empty-state-header",
1118
- children: t("products.media.emptyState.header")
1119
- }
1120
- ),
1121
- /* @__PURE__ */ jsx6(Text4, { size: "small", className: "text-ui-fg-muted", "data-testid": "product-media-empty-state-description", children: t("products.media.emptyState.description") })
1122
- ] }),
1123
- /* @__PURE__ */ jsx6(Button3, { size: "small", variant: "secondary", asChild: true, "data-testid": "product-media-empty-state-button", children: /* @__PURE__ */ jsx6(Link, { to: "media?view=edit", "data-testid": "product-media-empty-state-link", children: t("products.media.emptyState.action") }) })
1124
- ] }),
1125
- /* @__PURE__ */ jsx6(CommandBar, { open: !!Object.keys(selection).length, "data-testid": "product-media-command-bar", children: /* @__PURE__ */ jsxs6(CommandBar.Bar, { "data-testid": "product-media-command-bar-bar", children: [
1126
- /* @__PURE__ */ jsx6(CommandBar.Value, { "data-testid": "product-media-command-bar-value", children: t("general.countSelected", {
1127
- count: Object.keys(selection).length
1128
- }) }),
1129
- /* @__PURE__ */ jsx6(CommandBar.Seperator, { "data-testid": "product-media-command-bar-separator" }),
1130
- /* @__PURE__ */ jsx6(
1131
- CommandBar.Command,
1132
- {
1133
- action: handleDelete,
1134
- label: t("actions.delete"),
1135
- shortcut: "d",
1136
- "data-testid": "product-media-command-bar-delete"
1137
- }
1138
- )
1139
- ] }) })
1140
- ] });
1141
- };
1142
- var getMedia = (product) => {
1143
- const { images = [], thumbnail } = product;
1144
- const media = images.map((image) => ({
1145
- id: image.id,
1146
- url: image.url,
1147
- isThumbnail: image.url === thumbnail
1148
- }));
1149
- if (thumbnail && !media.some((mediaItem) => mediaItem.url === thumbnail)) {
1150
- media.unshift({
1151
- id: "img_thumbnail",
1152
- url: thumbnail,
1153
- isThumbnail: true
1154
- });
1155
- }
1156
- return media;
1157
- };
1158
-
1159
- // src/pages/products/product-detail/components/product-organization-section/product-organization-section.tsx
1160
- import { PencilSquare as PencilSquare3 } from "@medusajs/icons";
1161
- import { Badge as Badge2, Container as Container6, Heading as Heading6, Tooltip as Tooltip3 } from "@medusajs/ui";
1162
- import { useTranslation as useTranslation7 } from "react-i18next";
1163
- import { Link as Link2 } from "react-router-dom";
1164
- import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
1165
795
  var ProductOrganizationSection = ({
1166
796
  product
1167
797
  }) => {
1168
- const { t } = useTranslation7();
1169
- return /* @__PURE__ */ jsxs7(
1170
- Container6,
798
+ const { t } = useTranslation6();
799
+ return /* @__PURE__ */ jsxs6(
800
+ Container4,
1171
801
  {
1172
802
  className: "divide-y p-0",
1173
803
  "data-testid": "product-organization-section",
1174
804
  children: [
1175
- /* @__PURE__ */ jsxs7(
805
+ /* @__PURE__ */ jsxs6(
1176
806
  "div",
1177
807
  {
1178
808
  className: "flex items-center justify-between px-6 py-4",
1179
809
  "data-testid": "product-organization-header",
1180
810
  children: [
1181
- /* @__PURE__ */ jsx7(Heading6, { level: "h2", "data-testid": "product-organization-title", children: t("products.organization.header") }),
1182
- /* @__PURE__ */ jsx7(
811
+ /* @__PURE__ */ jsx6(Heading4, { level: "h2", "data-testid": "product-organization-title", children: t("products.organization.header") }),
812
+ /* @__PURE__ */ jsx6(
1183
813
  ActionMenu,
1184
814
  {
1185
815
  groups: [
@@ -1188,7 +818,7 @@ var ProductOrganizationSection = ({
1188
818
  {
1189
819
  label: t("actions.edit"),
1190
820
  to: "organization",
1191
- icon: /* @__PURE__ */ jsx7(PencilSquare3, {})
821
+ icon: /* @__PURE__ */ jsx6(PencilSquare3, {})
1192
822
  }
1193
823
  ]
1194
824
  }
@@ -1199,11 +829,11 @@ var ProductOrganizationSection = ({
1199
829
  ]
1200
830
  }
1201
831
  ),
1202
- /* @__PURE__ */ jsx7(
832
+ /* @__PURE__ */ jsx6(
1203
833
  SectionRow,
1204
834
  {
1205
835
  title: t("fields.tags"),
1206
- value: product.tags?.length ? product.tags.map((tag) => /* @__PURE__ */ jsx7(
836
+ value: product.tags?.length ? product.tags.map((tag) => /* @__PURE__ */ jsx6(
1207
837
  OrganizationTag,
1208
838
  {
1209
839
  label: tag.value,
@@ -1214,11 +844,11 @@ var ProductOrganizationSection = ({
1214
844
  "data-testid": "product-tags-row"
1215
845
  }
1216
846
  ),
1217
- /* @__PURE__ */ jsx7(
847
+ /* @__PURE__ */ jsx6(
1218
848
  SectionRow,
1219
849
  {
1220
850
  title: t("fields.type"),
1221
- value: product.type ? /* @__PURE__ */ jsx7(
851
+ value: product.type ? /* @__PURE__ */ jsx6(
1222
852
  OrganizationTag,
1223
853
  {
1224
854
  label: product.type.value,
@@ -1228,25 +858,11 @@ var ProductOrganizationSection = ({
1228
858
  "data-testid": "product-type-row"
1229
859
  }
1230
860
  ),
1231
- /* @__PURE__ */ jsx7(
1232
- SectionRow,
1233
- {
1234
- title: t("fields.brand"),
1235
- value: product.brand ? /* @__PURE__ */ jsx7(
1236
- OrganizationTag,
1237
- {
1238
- label: product.brand.name,
1239
- to: `/settings/product-brands/${product.brand.id}`
1240
- }
1241
- ) : void 0,
1242
- "data-testid": "product-brand-row"
1243
- }
1244
- ),
1245
- /* @__PURE__ */ jsx7(
861
+ /* @__PURE__ */ jsx6(
1246
862
  SectionRow,
1247
863
  {
1248
864
  title: t("fields.collection"),
1249
- value: product.collection ? /* @__PURE__ */ jsx7(
865
+ value: product.collection ? /* @__PURE__ */ jsx6(
1250
866
  OrganizationTag,
1251
867
  {
1252
868
  label: product.collection.title,
@@ -1256,11 +872,11 @@ var ProductOrganizationSection = ({
1256
872
  "data-testid": "product-collection-row"
1257
873
  }
1258
874
  ),
1259
- /* @__PURE__ */ jsx7(
875
+ /* @__PURE__ */ jsx6(
1260
876
  SectionRow,
1261
877
  {
1262
878
  title: t("fields.categories"),
1263
- value: product.categories?.length ? product.categories.map((pcat) => /* @__PURE__ */ jsx7(
879
+ value: product.categories?.length ? product.categories.map((pcat) => /* @__PURE__ */ jsx6(
1264
880
  OrganizationTag,
1265
881
  {
1266
882
  label: pcat.name,
@@ -1276,8 +892,8 @@ var ProductOrganizationSection = ({
1276
892
  );
1277
893
  };
1278
894
  var OrganizationTag = ({ label, to }) => {
1279
- return /* @__PURE__ */ jsx7(Tooltip3, { content: label, children: /* @__PURE__ */ jsx7(Badge2, { size: "2xsmall", className: "block w-fit truncate", asChild: true, children: /* @__PURE__ */ jsx7(
1280
- Link2,
895
+ return /* @__PURE__ */ jsx6(Tooltip2, { content: label, children: /* @__PURE__ */ jsx6(Badge2, { size: "2xsmall", className: "block w-fit truncate", asChild: true, children: /* @__PURE__ */ jsx6(
896
+ Link,
1281
897
  {
1282
898
  to,
1283
899
  "data-testid": `organization-tag-${label.toLowerCase().replace(/\s+/g, "-")}`,
@@ -1287,34 +903,33 @@ var OrganizationTag = ({ label, to }) => {
1287
903
  };
1288
904
 
1289
905
  // src/pages/products/product-detail/components/product-variant-section/product-variant-section.tsx
1290
- import { useCallback, useMemo as useMemo2 } from "react";
1291
- import { Buildings, Component, PencilSquare as PencilSquare4, Trash as Trash3 } from "@medusajs/icons";
906
+ import { useCallback, useMemo } from "react";
907
+ import { PencilSquare as PencilSquare4, Trash as Trash3 } from "@medusajs/icons";
1292
908
  import {
1293
909
  Badge as Badge3,
1294
- Container as Container7,
1295
- createDataTableColumnHelper,
1296
- createDataTableCommandHelper,
1297
- Tooltip as Tooltip4,
1298
- usePrompt as usePrompt4
910
+ Button as Button3,
911
+ Container as Container5,
912
+ Heading as Heading5,
913
+ toast as toast4,
914
+ Tooltip as Tooltip3,
915
+ usePrompt as usePrompt3
1299
916
  } from "@medusajs/ui";
1300
917
  import { keepPreviousData } from "@tanstack/react-query";
1301
- import { useTranslation as useTranslation8 } from "react-i18next";
1302
- import { useNavigate as useNavigate2, useSearchParams } from "react-router-dom";
1303
- import { jsx as jsx8 } from "react/jsx-runtime";
918
+ import { createColumnHelper } from "@tanstack/react-table";
919
+ import { useTranslation as useTranslation7 } from "react-i18next";
920
+ import { Link as Link2, useNavigate as useNavigate2, useSearchParams } from "react-router-dom";
921
+ import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
1304
922
  var PAGE_SIZE = 10;
1305
923
  var PREFIX = "pv";
1306
924
  var ProductVariantSection = ({
1307
925
  product
1308
926
  }) => {
1309
- const { t } = useTranslation8();
927
+ const { t } = useTranslation7();
1310
928
  const { q, order, offset, created_at, updated_at } = useQueryParams(
1311
929
  ["q", "order", "offset", "created_at", "updated_at"],
1312
930
  PREFIX
1313
931
  );
1314
- const columns = useColumns(product);
1315
- const filters = useFilters();
1316
- const commands = useCommands();
1317
- const { variants, count, isPending, isError, error } = useProductVariants(
932
+ const { variants, count, isLoading, isError, error } = useProductVariants(
1318
933
  product.id,
1319
934
  {
1320
935
  q,
@@ -1323,73 +938,71 @@ var ProductVariantSection = ({
1323
938
  limit: PAGE_SIZE,
1324
939
  created_at: created_at ? JSON.parse(created_at) : void 0,
1325
940
  updated_at: updated_at ? JSON.parse(updated_at) : void 0,
1326
- fields: "title,created_at,updated_at,*attribute_values,*attribute_values.attribute"
941
+ fields: "title,sku,created_at,updated_at,*options,*options.option"
1327
942
  },
1328
943
  {
1329
944
  placeholderData: keepPreviousData
1330
945
  }
1331
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
+ });
1332
958
  if (isError) {
1333
959
  throw error;
1334
960
  }
1335
- return /* @__PURE__ */ jsx8(Container7, { className: "divide-y p-0", "data-testid": "product-variant-section", children: /* @__PURE__ */ jsx8("div", { "data-testid": "product-variants-table-container", children: /* @__PURE__ */ jsx8(
1336
- DataTable,
1337
- {
1338
- data: variants,
1339
- columns,
1340
- filters,
1341
- rowCount: count,
1342
- getRowId: (row) => row.id,
1343
- rowHref: (row) => `/products/${product.id}/variants/${row.id}`,
1344
- pageSize: PAGE_SIZE,
1345
- isLoading: isPending,
1346
- heading: t("products.variants.header"),
1347
- emptyState: {
1348
- empty: {
1349
- heading: t("products.variants.empty.heading"),
1350
- description: t("products.variants.empty.description")
1351
- },
1352
- filtered: {
1353
- heading: t("products.variants.filtered.heading"),
1354
- description: t("products.variants.filtered.description")
961
+ return /* @__PURE__ */ jsxs7(Container5, { className: "divide-y p-0", "data-testid": "product-variant-section", children: [
962
+ /* @__PURE__ */ jsxs7("div", { className: "flex items-center justify-between px-6 py-4", children: [
963
+ /* @__PURE__ */ jsx7(Heading5, { level: "h2", children: t("products.variants.header") }),
964
+ /* @__PURE__ */ jsx7(
965
+ Button3,
966
+ {
967
+ size: "small",
968
+ variant: "secondary",
969
+ asChild: true,
970
+ "data-testid": "product-variants-create-button",
971
+ children: /* @__PURE__ */ jsx7(Link2, { to: "variants/create", children: t("actions.create") })
1355
972
  }
1356
- },
1357
- action: {
1358
- label: t("actions.create"),
1359
- to: `variants/create`
1360
- },
1361
- actionMenu: {
1362
- groups: [
1363
- {
1364
- actions: [
1365
- {
1366
- label: t("products.editPrices"),
1367
- to: `prices`,
1368
- icon: /* @__PURE__ */ jsx8(PencilSquare4, {})
1369
- },
1370
- {
1371
- label: t("inventory.stock.action"),
1372
- to: `stock`,
1373
- icon: /* @__PURE__ */ jsx8(Buildings, {})
1374
- }
1375
- ]
1376
- }
1377
- ],
1378
- "data-testid": "product-variant-section-action-menu"
1379
- },
1380
- commands,
1381
- prefix: PREFIX
1382
- }
1383
- ) }) });
973
+ )
974
+ ] }),
975
+ /* @__PURE__ */ jsx7(
976
+ _DataTable,
977
+ {
978
+ table,
979
+ columns,
980
+ count,
981
+ pageSize: PAGE_SIZE,
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
+ }
994
+ }
995
+ )
996
+ ] });
1384
997
  };
1385
- var columnHelper = createDataTableColumnHelper();
998
+ var columnHelper = createColumnHelper();
1386
999
  var useColumns = (product) => {
1387
- const { t } = useTranslation8();
1000
+ const { t } = useTranslation7();
1388
1001
  const navigate = useNavigate2();
1389
1002
  const { mutateAsync } = useDeleteVariantLazy(product.id);
1390
- const prompt = usePrompt4();
1003
+ const prompt = usePrompt3();
1391
1004
  const [searchParams] = useSearchParams();
1392
- const tableSearchParams = useMemo2(() => {
1005
+ const tableSearchParams = useMemo(() => {
1393
1006
  const filtered = new URLSearchParams();
1394
1007
  for (const [key, value] of searchParams.entries()) {
1395
1008
  if (key.startsWith(`${PREFIX}_`)) {
@@ -1398,7 +1011,6 @@ var useColumns = (product) => {
1398
1011
  }
1399
1012
  return filtered;
1400
1013
  }, [searchParams]);
1401
- const dateColumns = useDataTableDateColumns();
1402
1014
  const handleDelete = useCallback(
1403
1015
  async (id, title) => {
1404
1016
  const res = await prompt({
@@ -1412,48 +1024,19 @@ var useColumns = (product) => {
1412
1024
  if (!res) {
1413
1025
  return;
1414
1026
  }
1415
- await mutateAsync({ variantId: id });
1027
+ await mutateAsync(
1028
+ { variantId: id },
1029
+ {
1030
+ onError: (error) => {
1031
+ toast4.error(error.message);
1032
+ }
1033
+ }
1034
+ );
1416
1035
  },
1417
1036
  [mutateAsync, prompt, t]
1418
1037
  );
1419
- const optionColumns = useMemo2(() => {
1420
- if (!product?.options) {
1421
- return [];
1422
- }
1423
- return product.options.map((option) => {
1424
- return columnHelper.display({
1425
- id: option.id,
1426
- header: option.title,
1427
- cell: ({ row }) => {
1428
- const variantOpt = row.original.options?.find(
1429
- (opt) => opt.option_id === option.id
1430
- );
1431
- if (!variantOpt) {
1432
- return /* @__PURE__ */ jsx8("span", { className: "text-ui-fg-muted", children: "-" });
1433
- }
1434
- return /* @__PURE__ */ jsx8(
1435
- "div",
1436
- {
1437
- className: "flex items-center",
1438
- "data-testid": `product-variant-option-${option.id}-${row.original.id}`,
1439
- children: /* @__PURE__ */ jsx8(Tooltip4, { content: variantOpt.value, children: /* @__PURE__ */ jsx8(
1440
- Badge3,
1441
- {
1442
- size: "2xsmall",
1443
- title: variantOpt.value,
1444
- className: "inline-flex min-w-[20px] max-w-[140px] items-center justify-center overflow-hidden truncate",
1445
- "data-testid": `product-variant-option-badge-${option.id}-${row.original.id}-${variantOpt.value}`,
1446
- children: variantOpt.value
1447
- }
1448
- ) })
1449
- }
1450
- );
1451
- }
1452
- });
1453
- });
1454
- }, [product]);
1455
- const attributeColumns = useMemo2(() => {
1456
- const variantAttributes = product?.variant_attributes?.filter((attr) => attr.is_variant_axis);
1038
+ const attributeColumns = useMemo(() => {
1039
+ const variantAttributes = product?.attributes?.filter((attr) => attr.is_variant_axis);
1457
1040
  if (!variantAttributes?.length) {
1458
1041
  return [];
1459
1042
  }
@@ -1462,140 +1045,117 @@ var useColumns = (product) => {
1462
1045
  id: `attribute-${attribute.id}`,
1463
1046
  header: attribute.name,
1464
1047
  cell: ({ row }) => {
1465
- const variant = row.original;
1466
- const matches = variant.attribute_values?.filter(
1467
- (v) => v.attribute?.id === attribute.id
1468
- ) ?? [];
1469
- if (!matches.length) {
1470
- return /* @__PURE__ */ jsx8("span", { className: "text-ui-fg-muted", children: "-" });
1048
+ const variantOpt = row.original.options?.find(
1049
+ (opt) => opt.option?.title === attribute.name
1050
+ );
1051
+ if (!variantOpt?.value) {
1052
+ return /* @__PURE__ */ jsx7("span", { className: "text-ui-fg-muted", children: "-" });
1471
1053
  }
1472
- return /* @__PURE__ */ jsx8(
1054
+ return /* @__PURE__ */ jsx7(
1473
1055
  "div",
1474
1056
  {
1475
1057
  className: "flex flex-wrap items-center gap-1",
1476
1058
  "data-testid": `product-variant-attribute-${attribute.id}-${row.original.id}`,
1477
- children: matches.map((value) => /* @__PURE__ */ jsx8(Tooltip4, { content: value.name, children: /* @__PURE__ */ jsx8(
1059
+ children: /* @__PURE__ */ jsx7(Tooltip3, { content: variantOpt.value, children: /* @__PURE__ */ jsx7(
1478
1060
  Badge3,
1479
1061
  {
1480
1062
  size: "2xsmall",
1481
- title: value.name,
1063
+ title: variantOpt.value,
1482
1064
  className: "inline-flex min-w-[20px] max-w-[140px] items-center justify-center overflow-hidden truncate",
1483
- "data-testid": `product-variant-attribute-badge-${attribute.id}-${row.original.id}-${value.name}`,
1484
- children: value.name
1065
+ "data-testid": `product-variant-attribute-badge-${attribute.id}-${row.original.id}-${variantOpt.value}`,
1066
+ children: variantOpt.value
1485
1067
  }
1486
- ) }, value.id))
1068
+ ) })
1487
1069
  }
1488
1070
  );
1489
1071
  }
1490
1072
  });
1491
1073
  });
1492
1074
  }, [product]);
1493
- const getActions = useCallback(
1494
- (ctx) => {
1495
- const variant = ctx.row.original;
1496
- const mainActions = [
1497
- {
1498
- icon: /* @__PURE__ */ jsx8(PencilSquare4, {}),
1499
- label: t("actions.edit"),
1500
- onClick: (row) => {
1501
- navigate(
1502
- `edit-variant?variant_id=${row.row.original.id}&${tableSearchParams.toString()}`,
1503
- {
1504
- state: {
1505
- restore_params: tableSearchParams.toString()
1506
- }
1507
- }
1508
- );
1509
- }
1510
- }
1511
- ];
1512
- const secondaryActions = [
1513
- {
1514
- icon: /* @__PURE__ */ jsx8(Trash3, {}),
1515
- label: t("actions.delete"),
1516
- onClick: () => handleDelete(variant.id, variant.title)
1517
- }
1518
- ];
1519
- const inventoryItemsCount = variant.inventory_items?.length || 0;
1520
- switch (inventoryItemsCount) {
1521
- case 0:
1522
- break;
1523
- case 1: {
1524
- const inventoryItemLink = `/inventory/${variant.inventory_items[0].inventory.id}`;
1525
- mainActions.push({
1526
- label: t("products.variant.inventory.actions.inventoryItems"),
1527
- onClick: () => {
1528
- navigate(inventoryItemLink);
1529
- },
1530
- icon: /* @__PURE__ */ jsx8(Buildings, {})
1531
- });
1532
- break;
1533
- }
1534
- default: {
1535
- const ids = variant.inventory_items?.map((i) => i.inventory?.id);
1536
- if (!ids || ids.length === 0) {
1537
- break;
1538
- }
1539
- const inventoryKitLink = `/inventory?${new URLSearchParams({
1540
- id: ids.join(",")
1541
- }).toString()}`;
1542
- mainActions.push({
1543
- label: t("products.variant.inventory.actions.inventoryKit"),
1544
- onClick: () => {
1545
- navigate(inventoryKitLink);
1546
- },
1547
- icon: /* @__PURE__ */ jsx8(Component, {})
1548
- });
1549
- }
1550
- }
1551
- return [mainActions, secondaryActions];
1552
- },
1553
- [handleDelete, navigate, t, tableSearchParams]
1554
- );
1555
- return useMemo2(() => {
1556
- return [
1075
+ return useMemo(
1076
+ () => [
1557
1077
  columnHelper.accessor("title", {
1078
+ id: "title",
1558
1079
  header: t("fields.title"),
1559
- enableSorting: true,
1560
- sortAscLabel: t("filters.sorting.alphabeticallyAsc"),
1561
- 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
+ }
1087
+ }),
1088
+ columnHelper.accessor("sku", {
1089
+ id: "sku",
1090
+ header: t("fields.sku"),
1091
+ cell: ({ getValue }) => {
1092
+ const value = getValue();
1093
+ return value ? value : /* @__PURE__ */ jsx7("span", { className: "text-ui-fg-muted", children: "-" });
1094
+ }
1562
1095
  }),
1563
- ...optionColumns,
1564
1096
  ...attributeColumns,
1565
- ...dateColumns,
1566
- columnHelper.action({
1567
- 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
+ )
1568
1131
  })
1569
- ];
1570
- }, [t, optionColumns, attributeColumns, dateColumns, getActions]);
1132
+ ],
1133
+ [t, attributeColumns, navigate, handleDelete, tableSearchParams, product]
1134
+ );
1571
1135
  };
1572
1136
  var useFilters = () => {
1573
- const dateFilters = useDataTableDateFilters();
1574
- return useMemo2(() => {
1575
- return [
1576
- ...dateFilters
1577
- ];
1578
- }, [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
+ );
1579
1145
  };
1580
- var commandHelper = createDataTableCommandHelper();
1581
- var useCommands = () => {
1582
- const { t } = useTranslation8();
1583
- const navigate = useNavigate2();
1584
- return [
1585
- commandHelper.command({
1586
- label: t("inventory.stock.action"),
1587
- shortcut: "i",
1588
- action: async (selection) => {
1589
- navigate(
1590
- `stock?${PRODUCT_VARIANT_IDS_KEY}=${Object.keys(selection).join(",")}`
1591
- );
1592
- }
1593
- })
1594
- ];
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
+ );
1595
1155
  };
1596
1156
 
1597
1157
  // src/pages/products/product-detail/product-detail.tsx
1598
- import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
1158
+ import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
1599
1159
  var Root = ({ children }) => {
1600
1160
  const initialData = useLoaderData();
1601
1161
  const { id } = useParams();
@@ -1609,7 +1169,7 @@ var Root = ({ children }) => {
1609
1169
  });
1610
1170
  const product = rawProduct;
1611
1171
  if (isLoading || !product) {
1612
- return /* @__PURE__ */ jsx9(
1172
+ return /* @__PURE__ */ jsx8(
1613
1173
  TwoColumnPageSkeleton,
1614
1174
  {
1615
1175
  mainSections: 4,
@@ -1622,7 +1182,7 @@ var Root = ({ children }) => {
1622
1182
  if (isError) {
1623
1183
  throw error;
1624
1184
  }
1625
- return Children.count(children) > 0 ? /* @__PURE__ */ jsx9(
1185
+ return Children.count(children) > 0 ? /* @__PURE__ */ jsx8(
1626
1186
  TwoColumnPage,
1627
1187
  {
1628
1188
  data: product,
@@ -1640,15 +1200,15 @@ var Root = ({ children }) => {
1640
1200
  "data-testid": "product-detail-page",
1641
1201
  children: [
1642
1202
  /* @__PURE__ */ jsxs8(TwoColumnPage.Main, { "data-testid": "product-detail-main", children: [
1643
- /* @__PURE__ */ jsx9(ProductActiveRequestSection, { product }),
1644
- /* @__PURE__ */ jsx9(ProductActiveEditSection, { product }),
1645
- /* @__PURE__ */ jsx9(ProductGeneralSection, { product }),
1646
- /* @__PURE__ */ jsx9(ProductMediaSection, { product }),
1647
- /* @__PURE__ */ jsx9(ProductVariantSection, { product })
1203
+ /* @__PURE__ */ jsx8(ProductActiveRequestSection, { product }),
1204
+ /* @__PURE__ */ jsx8(ProductActiveEditSection, { product }),
1205
+ /* @__PURE__ */ jsx8(ProductGeneralSection, { product }),
1206
+ /* @__PURE__ */ jsx8(ProductMediaSection, { product }),
1207
+ /* @__PURE__ */ jsx8(ProductVariantSection, { product })
1648
1208
  ] }),
1649
1209
  /* @__PURE__ */ jsxs8(TwoColumnPage.Sidebar, { "data-testid": "product-detail-sidebar", children: [
1650
- /* @__PURE__ */ jsx9(ProductOrganizationSection, { product }),
1651
- /* @__PURE__ */ jsx9(ProductAttributeSection, { product })
1210
+ /* @__PURE__ */ jsx8(ProductOrganizationSection, { product }),
1211
+ /* @__PURE__ */ jsx8(ProductAttributeSection, { product })
1652
1212
  ] })
1653
1213
  ]
1654
1214
  }