@funhub/platform 0.1.22 → 0.1.24

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 (345) hide show
  1. package/dist/assets/icons/right_arrow.mjs +2 -0
  2. package/dist/assets/images/Frame.mjs +2 -0
  3. package/dist/assets/images/marquee.mjs +2 -0
  4. package/dist/biz.d.mts +41 -10
  5. package/dist/biz.mjs +1 -1
  6. package/dist/common.d.mts +3 -1
  7. package/dist/common.mjs +1 -1
  8. package/dist/components/biz/basics/fullscreen-feed/index.mjs +1 -1
  9. package/dist/components/biz/basics/fullscreen-feed/runtime/client.mjs +1 -1
  10. package/dist/components/biz/basics/fullscreen-feed/runtime/post-slide.mjs +1 -1
  11. package/dist/components/biz/basics/fullscreen-feed/runtime/use-mixed-feed-controller.mjs +1 -1
  12. package/dist/components/biz/basics/fullscreen-feed/runtime/use-series-feed-controller.mjs +1 -1
  13. package/dist/components/biz/basics/fullscreen-feed/runtime/user-action.mjs +1 -1
  14. package/dist/components/biz/basics/logo/variants/basic-logo/runtime/client.mjs +1 -1
  15. package/dist/components/biz/basics/search/shared/components/search-box.mjs +1 -1
  16. package/dist/components/biz/basics/search/variants/simple-search/runtime/client.mjs +1 -1
  17. package/dist/components/biz/business/banner/variants/basic-banner/inspector-schema.d.mts +0 -2
  18. package/dist/components/biz/business/banner/variants/basic-banner/inspector-schema.mjs +1 -1
  19. package/dist/components/biz/business/banner/variants/basic-banner/material.d.mts +0 -1
  20. package/dist/components/biz/business/banner/variants/basic-banner/material.mjs +1 -1
  21. package/dist/components/biz/business/banner/variants/basic-banner/runtime/client.mjs +1 -1
  22. package/dist/components/biz/business/card-grid/variants/card-grid-2x3-infinite/runtime/client.mjs +1 -1
  23. package/dist/components/biz/business/card-grid/variants/card-grid-3x3-infinite/runtime/client.mjs +1 -1
  24. package/dist/components/biz/business/channel-list/channel-filter-dialog.mjs +2 -0
  25. package/dist/components/biz/business/channel-list/client.d.mts +8 -0
  26. package/dist/components/biz/business/channel-list/client.mjs +2 -0
  27. package/dist/components/biz/business/channel-list/default-props.mjs +2 -0
  28. package/dist/components/biz/business/channel-list/material.d.mts +16 -0
  29. package/dist/components/biz/business/channel-list/material.mjs +2 -0
  30. package/dist/components/biz/business/channel-list/schema.d.mts +23 -0
  31. package/dist/components/biz/business/channel-list/schema.mjs +2 -0
  32. package/dist/components/biz/business/comment/comment-item.mjs +1 -1
  33. package/dist/components/biz/business/comment/comment-list.mjs +1 -1
  34. package/dist/components/biz/business/comment/reply-detail.mjs +1 -1
  35. package/dist/components/biz/business/detail/detail-follow-action.mjs +1 -1
  36. package/dist/components/biz/business/detail/detail-info-title.mjs +1 -1
  37. package/dist/components/biz/business/detail/detail-introduction.mjs +1 -1
  38. package/dist/components/biz/business/detail/detail-operate.mjs +1 -1
  39. package/dist/components/biz/business/detail/materials/registry.d.mts +35 -41
  40. package/dist/components/biz/business/detail/materials/registry.mjs +1 -1
  41. package/dist/components/biz/business/detail/materials/video-detail-actions/client.d.mts +2 -9
  42. package/dist/components/biz/business/detail/materials/video-detail-actions/index.d.mts +3 -3
  43. package/dist/components/biz/business/detail/materials/video-detail-actions/material.d.mts +9 -3
  44. package/dist/components/biz/business/detail/materials/video-detail-actions/schema.d.mts +7 -1
  45. package/dist/components/biz/business/detail/materials/video-detail-actions/server.d.mts +1 -1
  46. package/dist/components/biz/business/detail/materials/video-detail-info/client.d.mts +2 -13
  47. package/dist/components/biz/business/detail/materials/video-detail-info/index.d.mts +3 -3
  48. package/dist/components/biz/business/detail/materials/video-detail-info/material.d.mts +13 -3
  49. package/dist/components/biz/business/detail/materials/video-detail-info/schema.d.mts +9 -1
  50. package/dist/components/biz/business/detail/materials/video-detail-info/server.d.mts +1 -1
  51. package/dist/components/biz/business/detail/materials/video-detail-info-title/client.d.mts +2 -7
  52. package/dist/components/biz/business/detail/materials/video-detail-info-title/index.d.mts +3 -3
  53. package/dist/components/biz/business/detail/materials/video-detail-info-title/material.d.mts +9 -3
  54. package/dist/components/biz/business/detail/materials/video-detail-info-title/schema.d.mts +6 -1
  55. package/dist/components/biz/business/detail/materials/video-detail-info-title/server.d.mts +1 -1
  56. package/dist/components/biz/business/detail/materials/video-detail-info-title-tags-episodes/client.d.mts +2 -11
  57. package/dist/components/biz/business/detail/materials/video-detail-info-title-tags-episodes/index.d.mts +3 -3
  58. package/dist/components/biz/business/detail/materials/video-detail-info-title-tags-episodes/material.d.mts +13 -3
  59. package/dist/components/biz/business/detail/materials/video-detail-info-title-tags-episodes/schema.d.mts +8 -1
  60. package/dist/components/biz/business/detail/materials/video-detail-info-title-tags-episodes/server.d.mts +1 -1
  61. package/dist/components/biz/business/detail/materials/video-detail-player/client.d.mts +2 -11
  62. package/dist/components/biz/business/detail/materials/video-detail-player/index.d.mts +3 -3
  63. package/dist/components/biz/business/detail/materials/video-detail-player/material.d.mts +9 -3
  64. package/dist/components/biz/business/detail/materials/video-detail-player/schema.d.mts +8 -1
  65. package/dist/components/biz/business/detail/materials/video-detail-player/server.d.mts +1 -1
  66. package/dist/components/biz/business/detail/materials/video-detail-recommend/client.d.mts +2 -6
  67. package/dist/components/biz/business/detail/materials/video-detail-recommend/client.mjs +1 -1
  68. package/dist/components/biz/business/detail/materials/video-detail-recommend/index.d.mts +3 -3
  69. package/dist/components/biz/business/detail/materials/video-detail-recommend/material.d.mts +36 -3
  70. package/dist/components/biz/business/detail/materials/video-detail-recommend/schema.d.mts +5 -1
  71. package/dist/components/biz/business/detail/materials/video-detail-recommend/server.d.mts +1 -1
  72. package/dist/components/biz/business/detail/post-recommend-list.mjs +1 -1
  73. package/dist/components/biz/business/detail/video-hero.mjs +1 -1
  74. package/dist/components/biz/business/floating-ball/client.d.mts +12 -0
  75. package/dist/components/biz/business/floating-ball/client.mjs +2 -0
  76. package/dist/components/biz/business/floating-ball/material.d.mts +10 -0
  77. package/dist/components/biz/business/floating-ball/material.mjs +2 -0
  78. package/dist/components/biz/business/floating-ball/schema.d.mts +14 -0
  79. package/dist/components/biz/business/floating-ball/schema.mjs +2 -0
  80. package/dist/components/biz/business/floating-ball/server.mjs +2 -0
  81. package/dist/components/biz/business/fullscreen-feed/variants/shared/runtime-compat.mjs +1 -1
  82. package/dist/components/biz/business/header-search/header-avatar-icon/client.d.mts +12 -0
  83. package/dist/components/biz/business/header-search/header-avatar-icon/client.mjs +2 -0
  84. package/dist/components/biz/business/header-search/header-avatar-icon/index.d.mts +5 -0
  85. package/dist/components/biz/business/header-search/header-avatar-icon/material.d.mts +10 -0
  86. package/dist/components/biz/business/header-search/header-avatar-icon/material.mjs +2 -0
  87. package/dist/components/biz/business/header-search/header-avatar-icon/schema.d.mts +14 -0
  88. package/dist/components/biz/business/header-search/header-avatar-icon/schema.mjs +2 -0
  89. package/dist/components/biz/business/header-search/header-avatar-icon/server.d.mts +3 -0
  90. package/dist/components/biz/business/header-search/header-avatar-icon/server.mjs +2 -0
  91. package/dist/components/biz/business/header-search/header-avatar-logo-search/client.d.mts +12 -0
  92. package/dist/components/biz/business/header-search/header-avatar-logo-search/client.mjs +2 -0
  93. package/dist/components/biz/business/header-search/header-avatar-logo-search/index.d.mts +5 -0
  94. package/dist/components/biz/business/header-search/header-avatar-logo-search/material.d.mts +10 -0
  95. package/dist/components/biz/business/header-search/header-avatar-logo-search/material.mjs +2 -0
  96. package/dist/components/biz/business/header-search/header-avatar-logo-search/schema.d.mts +14 -0
  97. package/dist/components/biz/business/header-search/header-avatar-logo-search/schema.mjs +2 -0
  98. package/dist/components/biz/business/header-search/header-avatar-logo-search/server.d.mts +3 -0
  99. package/dist/components/biz/business/header-search/header-avatar-logo-search/server.mjs +2 -0
  100. package/dist/components/biz/business/header-search/header-avatar-logo-search-icon/client.d.mts +12 -0
  101. package/dist/components/biz/business/header-search/header-avatar-logo-search-icon/client.mjs +2 -0
  102. package/dist/components/biz/business/header-search/header-avatar-logo-search-icon/index.d.mts +5 -0
  103. package/dist/components/biz/business/header-search/header-avatar-logo-search-icon/material.d.mts +10 -0
  104. package/dist/components/biz/business/header-search/header-avatar-logo-search-icon/material.mjs +2 -0
  105. package/dist/components/biz/business/header-search/header-avatar-logo-search-icon/schema.d.mts +14 -0
  106. package/dist/components/biz/business/header-search/header-avatar-logo-search-icon/schema.mjs +2 -0
  107. package/dist/components/biz/business/header-search/header-avatar-logo-search-icon/server.d.mts +3 -0
  108. package/dist/components/biz/business/header-search/header-avatar-logo-search-icon/server.mjs +2 -0
  109. package/dist/components/biz/business/header-search/header-logo-search/client.d.mts +12 -0
  110. package/dist/components/biz/business/header-search/header-logo-search/client.mjs +2 -0
  111. package/dist/components/biz/business/header-search/header-logo-search/index.d.mts +5 -0
  112. package/dist/components/biz/business/header-search/header-logo-search/material.d.mts +10 -0
  113. package/dist/components/biz/business/header-search/header-logo-search/material.mjs +2 -0
  114. package/dist/components/biz/business/header-search/header-logo-search/schema.d.mts +14 -0
  115. package/dist/components/biz/business/header-search/header-logo-search/schema.mjs +2 -0
  116. package/dist/components/biz/business/header-search/header-logo-search/server.d.mts +3 -0
  117. package/dist/components/biz/business/header-search/header-logo-search/server.mjs +2 -0
  118. package/dist/components/biz/business/header-search/header-search/client.d.mts +12 -0
  119. package/dist/components/biz/business/header-search/header-search/client.mjs +2 -0
  120. package/dist/components/biz/business/header-search/header-search/index.d.mts +5 -0
  121. package/dist/components/biz/business/header-search/header-search/material.d.mts +10 -0
  122. package/dist/components/biz/business/header-search/header-search/material.mjs +2 -0
  123. package/dist/components/biz/business/header-search/header-search/schema.d.mts +14 -0
  124. package/dist/components/biz/business/header-search/header-search/schema.mjs +2 -0
  125. package/dist/components/biz/business/header-search/header-search/server.d.mts +3 -0
  126. package/dist/components/biz/business/header-search/header-search/server.mjs +2 -0
  127. package/dist/components/biz/business/header-search/index.d.mts +11 -0
  128. package/dist/components/biz/business/home-recommend/index.d.mts +9 -0
  129. package/dist/components/biz/business/home-recommend/shared/home-recommend-base.mjs +2 -0
  130. package/dist/components/biz/business/home-recommend/types.d.mts +25 -0
  131. package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/defaults/default-props.d.mts +10 -0
  132. package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/defaults/default-props.mjs +2 -0
  133. package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/index.d.mts +4 -0
  134. package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/index.mjs +2 -0
  135. package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/runtime/client.d.mts +13 -0
  136. package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/runtime/client.mjs +2 -0
  137. package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/schema/component.mjs +2 -0
  138. package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/schema/data.schema.mjs +2 -0
  139. package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/schema/event.schema.mjs +2 -0
  140. package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/schema/index.d.mts +8 -0
  141. package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/schema/index.mjs +2 -0
  142. package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/schema/props.schema.mjs +2 -0
  143. package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/schema/style.schema.mjs +2 -0
  144. package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/defaults/default-props.d.mts +10 -0
  145. package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/defaults/default-props.mjs +2 -0
  146. package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/index.d.mts +4 -0
  147. package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/index.mjs +2 -0
  148. package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/runtime/client.d.mts +13 -0
  149. package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/runtime/client.mjs +2 -0
  150. package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/schema/component.mjs +2 -0
  151. package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/schema/data.schema.mjs +2 -0
  152. package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/schema/event.schema.mjs +2 -0
  153. package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/schema/index.d.mts +8 -0
  154. package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/schema/index.mjs +2 -0
  155. package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/schema/props.schema.mjs +2 -0
  156. package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/schema/style.schema.mjs +2 -0
  157. package/dist/components/biz/business/index.d.mts +52 -15
  158. package/dist/components/biz/business/index.mjs +1 -1
  159. package/dist/components/biz/business/large-feature-grid/client.d.mts +12 -0
  160. package/dist/components/biz/business/large-feature-grid/client.mjs +2 -0
  161. package/dist/components/biz/business/large-feature-grid/material.d.mts +10 -0
  162. package/dist/components/biz/business/large-feature-grid/material.mjs +2 -0
  163. package/dist/components/biz/business/large-feature-grid/schema.d.mts +14 -0
  164. package/dist/components/biz/business/large-feature-grid/schema.mjs +2 -0
  165. package/dist/components/biz/business/large-feature-grid/server.mjs +2 -0
  166. package/dist/components/biz/business/marquee/client.d.mts +16 -0
  167. package/dist/components/biz/business/marquee/client.mjs +2 -0
  168. package/dist/components/biz/business/marquee/index.d.mts +5 -0
  169. package/dist/components/biz/business/marquee/material.d.mts +24 -0
  170. package/dist/components/biz/business/marquee/material.mjs +2 -0
  171. package/dist/components/biz/business/marquee/schema.d.mts +33 -0
  172. package/dist/components/biz/business/marquee/schema.mjs +2 -0
  173. package/dist/components/biz/business/marquee/server.d.mts +11 -0
  174. package/dist/components/biz/business/marquee/server.mjs +2 -0
  175. package/dist/components/biz/business/nav-bar/variants/basic-nav-bar/runtime/client.mjs +1 -1
  176. package/dist/components/biz/business/profile/profile-header/material.d.mts +9 -0
  177. package/dist/components/biz/business/profile/profile-header/material.mjs +2 -0
  178. package/dist/components/biz/business/profile/profile-main/material.d.mts +9 -0
  179. package/dist/components/biz/business/profile/profile-main/material.mjs +2 -0
  180. package/dist/components/biz/business/recommended-users/variants/basic-recommended-users/runtime/client.mjs +1 -1
  181. package/dist/components/biz/business/search-bar/variants/detail-search-bar/runtime/client.mjs +1 -1
  182. package/dist/components/biz/business/search-history/use-search-history.mjs +1 -1
  183. package/dist/components/biz/business/search-history2/client.d.mts +21 -0
  184. package/dist/components/biz/business/search-history2/client.mjs +2 -0
  185. package/dist/components/biz/business/search-history2/index.d.mts +5 -0
  186. package/dist/components/biz/business/search-history2/material.d.mts +15 -0
  187. package/dist/components/biz/business/search-history2/material.mjs +2 -0
  188. package/dist/components/biz/business/search-history2/schema.d.mts +21 -0
  189. package/dist/components/biz/business/search-history2/schema.mjs +2 -0
  190. package/dist/components/biz/business/search-history2/server.d.mts +11 -0
  191. package/dist/components/biz/business/search-history2/server.mjs +2 -0
  192. package/dist/components/biz/business/search-input/client.d.mts +19 -0
  193. package/dist/components/biz/business/search-input/client.mjs +2 -0
  194. package/dist/components/biz/business/search-input/index.d.mts +5 -0
  195. package/dist/components/biz/business/search-input/material.d.mts +14 -0
  196. package/dist/components/biz/business/search-input/material.mjs +2 -0
  197. package/dist/components/biz/business/search-input/schema.d.mts +19 -0
  198. package/dist/components/biz/business/search-input/schema.mjs +2 -0
  199. package/dist/components/biz/business/search-input/server.d.mts +11 -0
  200. package/dist/components/biz/business/search-input/server.mjs +2 -0
  201. package/dist/components/biz/business/shortcut-grid/client.d.mts +12 -0
  202. package/dist/components/biz/business/shortcut-grid/client.mjs +2 -0
  203. package/dist/components/biz/business/shortcut-grid/material.d.mts +10 -0
  204. package/dist/components/biz/business/shortcut-grid/material.mjs +2 -0
  205. package/dist/components/biz/business/shortcut-grid/schema.d.mts +14 -0
  206. package/dist/components/biz/business/shortcut-grid/schema.mjs +2 -0
  207. package/dist/components/biz/business/shortcut-grid/server.mjs +2 -0
  208. package/dist/components/biz/business/tab-bar/client.d.mts +13 -0
  209. package/dist/components/biz/business/tab-bar/client.mjs +2 -0
  210. package/dist/components/biz/business/tab-bar/index.d.mts +5 -0
  211. package/dist/components/biz/business/tab-bar/material.d.mts +21 -0
  212. package/dist/components/biz/business/tab-bar/material.mjs +2 -0
  213. package/dist/components/biz/business/tab-bar/schema.d.mts +27 -0
  214. package/dist/components/biz/business/tab-bar/schema.mjs +2 -0
  215. package/dist/components/biz/business/tab-bar/server.d.mts +11 -0
  216. package/dist/components/biz/business/tab-bar/server.mjs +2 -0
  217. package/dist/components/biz/business/text-recommend/client.d.mts +22 -0
  218. package/dist/components/biz/business/text-recommend/client.mjs +2 -0
  219. package/dist/components/biz/business/text-recommend/index.d.mts +5 -0
  220. package/dist/components/biz/business/text-recommend/material.d.mts +15 -0
  221. package/dist/components/biz/business/text-recommend/material.mjs +2 -0
  222. package/dist/components/biz/business/text-recommend/schema.d.mts +21 -0
  223. package/dist/components/biz/business/text-recommend/schema.mjs +2 -0
  224. package/dist/components/biz/business/text-recommend/server.d.mts +12 -0
  225. package/dist/components/biz/business/text-recommend/server.mjs +2 -0
  226. package/dist/components/biz/business/video-horizontal-list/client.d.mts +25 -0
  227. package/dist/components/biz/business/video-horizontal-list/client.mjs +2 -0
  228. package/dist/components/biz/business/video-horizontal-list/index.d.mts +5 -0
  229. package/dist/components/biz/business/video-horizontal-list/material.d.mts +18 -0
  230. package/dist/components/biz/business/video-horizontal-list/material.mjs +2 -0
  231. package/dist/components/biz/business/video-horizontal-list/schema.d.mts +21 -0
  232. package/dist/components/biz/business/video-horizontal-list/schema.mjs +2 -0
  233. package/dist/components/biz/business/video-horizontal-list/server.d.mts +12 -0
  234. package/dist/components/biz/business/video-horizontal-list/server.mjs +2 -0
  235. package/dist/components/biz/example/button/client.mjs +1 -1
  236. package/dist/components/biz/renderer/renderer.d.mts +3 -2
  237. package/dist/components/biz/renderer/renderer.mjs +1 -1
  238. package/dist/components/biz/utils/helpers/get-channel-list.d.mts +20 -0
  239. package/dist/components/biz/utils/helpers/get-channel-list.mjs +2 -0
  240. package/dist/components/biz/utils/index.d.mts +5 -4
  241. package/dist/components/biz/utils/schema/component.d.mts +1 -1
  242. package/dist/components/biz/utils/transformers/data.d.mts +3 -0
  243. package/dist/components/biz/utils/transformers/data.mjs +1 -1
  244. package/dist/components/common/at-element/index.mjs +1 -1
  245. package/dist/components/common/blocked-dialog/blocked-dialog.d.mts +10 -0
  246. package/dist/components/common/blocked-dialog/blocked-dialog.mjs +2 -0
  247. package/dist/components/common/blocked-dialog/index.d.mts +2 -0
  248. package/dist/components/common/collection-popup/collection-create-modal.mjs +1 -1
  249. package/dist/components/common/delete-confirm-dialog/delete-confirm-dialog.mjs +1 -1
  250. package/dist/components/common/follow-button/index.mjs +1 -1
  251. package/dist/components/common/funhub-provider/funhub-provider.mjs +1 -1
  252. package/dist/components/common/header-nav/client.mjs +1 -1
  253. package/dist/components/common/icons/video.mjs +2 -0
  254. package/dist/components/common/info-card/card-header.mjs +1 -1
  255. package/dist/components/common/list/post-list/post-list.mjs +1 -1
  256. package/dist/components/common/list/user-activity-list/user-activity-list-actions.mjs +1 -1
  257. package/dist/components/common/list/user-activity-list/user-activity-list-item.mjs +1 -1
  258. package/dist/components/common/list/video-list/video-list-item.d.mts +1 -1
  259. package/dist/components/common/list/video-list/video-list-item.mjs +1 -1
  260. package/dist/components/common/list/video-list/video-list.mjs +1 -1
  261. package/dist/components/common/photo-grid/index.mjs +1 -1
  262. package/dist/components/common/popup-video/index.mjs +1 -1
  263. package/dist/components/common/series-episodes/index.mjs +1 -1
  264. package/dist/components/common/share-popup/share-popup.mjs +1 -1
  265. package/dist/components/common/tab-bar/index.mjs +1 -1
  266. package/dist/components/common/top-nav-bar/client.mjs +1 -1
  267. package/dist/components/common/top-nav-bar/index.mjs +1 -1
  268. package/dist/components/common/video-player/index.mjs +2 -2
  269. package/dist/components/pages/(follow)/_components/follow-button/index.mjs +1 -1
  270. package/dist/components/pages/(follow)/_components/interaction-tabs/index.mjs +1 -1
  271. package/dist/components/pages/(follow)/_components/user-list/index.mjs +1 -1
  272. package/dist/components/pages/(follow)/fans/page.mjs +1 -1
  273. package/dist/components/pages/(follow)/followed/page.mjs +1 -1
  274. package/dist/components/pages/collection-create/form.mjs +1 -1
  275. package/dist/components/pages/collection-detail/detail.mjs +1 -1
  276. package/dist/components/pages/feed-series/feed-series-client.mjs +1 -1
  277. package/dist/components/pages/feed-series/page.mjs +1 -1
  278. package/dist/components/pages/feedback/_components/feedback-form.mjs +1 -1
  279. package/dist/components/pages/fullscreen-feed/page.mjs +1 -1
  280. package/dist/components/pages/home/client.mjs +1 -1
  281. package/dist/components/pages/home/index.mjs +1 -1
  282. package/dist/components/pages/login/index.mjs +1 -1
  283. package/dist/components/pages/post-detail/post-detail-client.mjs +1 -1
  284. package/dist/components/pages/profile/_components/tabs/collect-tab/client.mjs +1 -1
  285. package/dist/components/pages/profile/_components/tabs/collect-tab/server.mjs +1 -1
  286. package/dist/components/pages/profile/_components/tabs/history-tab/client.mjs +1 -1
  287. package/dist/components/pages/profile/_components/tabs/like-tab/client.mjs +1 -1
  288. package/dist/components/pages/profile/_components/tabs/publish-tab/client.mjs +1 -1
  289. package/dist/components/pages/profile/_components/user-profile-container/client.mjs +1 -1
  290. package/dist/components/pages/profile/_components/user-profile-header/client.mjs +1 -1
  291. package/dist/components/pages/profile/utils.mjs +1 -1
  292. package/dist/components/pages/publish/components/collection-popup.mjs +1 -1
  293. package/dist/components/pages/publish/components/collection.mjs +1 -1
  294. package/dist/components/pages/publish/components/header.mjs +1 -1
  295. package/dist/components/pages/publish/page-client.mjs +1 -1
  296. package/dist/components/pages/search/hot-recommend.mjs +1 -1
  297. package/dist/components/pages/search/page-client.mjs +1 -1
  298. package/dist/components/pages/search/search-result/search-all.mjs +1 -1
  299. package/dist/components/pages/search/search-result/search-video-info.mjs +1 -1
  300. package/dist/components/pages/search/top-header.mjs +1 -1
  301. package/dist/components/pages/settings/_components/settings.mjs +1 -1
  302. package/dist/components/pages/user-follow/_components/follow-top-header.mjs +1 -1
  303. package/dist/components/pages/user-follow/page.mjs +1 -1
  304. package/dist/components/pages/video-detail/page.mjs +1 -1
  305. package/dist/components/pages/video-detail/video-detail-client.mjs +1 -1
  306. package/dist/components/pages/video-list/index.d.mts +16 -0
  307. package/dist/components/pages/video-list/index.mjs +2 -0
  308. package/dist/components/pages/video-list/types.mjs +2 -0
  309. package/dist/components/pages/video-list/video-list-client.mjs +2 -0
  310. package/dist/components/pages/video-list/video-list-item.mjs +2 -0
  311. package/dist/components/ui/badge.d.mts +1 -1
  312. package/dist/components/ui/button.d.mts +1 -1
  313. package/dist/components/ui/image.d.mts +4 -4
  314. package/dist/hooks/use-content-operate.mjs +1 -1
  315. package/dist/hooks.mjs +1 -1
  316. package/dist/i18n/locales/en.mjs +3 -1
  317. package/dist/i18n/locales/zh-CN.mjs +3 -1
  318. package/dist/i18n.d.mts +1 -1
  319. package/dist/i18n.mjs +1 -1
  320. package/dist/materials.d.mts +25 -1
  321. package/dist/materials.mjs +1 -1
  322. package/dist/pages.d.mts +2 -1
  323. package/dist/pages.mjs +1 -1
  324. package/dist/service/generated/client.d.mts +28 -12
  325. package/dist/service/generated/client.mjs +1 -1
  326. package/dist/service/generated/tanstack.d.mts +34 -14
  327. package/dist/service/generated/tanstack.mjs +1 -1
  328. package/dist/service.d.mts +3 -3
  329. package/dist/service.mjs +1 -1
  330. package/dist/store/create-store.mjs +1 -1
  331. package/dist/store/modules/blocked-modal-store.d.mts +26 -0
  332. package/dist/store/modules/blocked-modal-store.mjs +2 -0
  333. package/dist/store/modules/user-store.d.mts +1 -1
  334. package/dist/store/modules/user-store.mjs +1 -1
  335. package/dist/store.d.mts +2 -1
  336. package/dist/store.mjs +1 -1
  337. package/dist/types.d.mts +1348 -129
  338. package/dist/utils/http.mjs +1 -1
  339. package/dist/utils/schema/index.d.mts +1 -1
  340. package/dist/utils/schema/material.d.mts +6 -1
  341. package/dist/utils/schema/utils.d.mts +1 -1
  342. package/dist/utils/share-manager.mjs +1 -1
  343. package/dist/utils.d.mts +5 -5
  344. package/dist/utils.mjs +1 -1
  345. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{mergeStyles as e}from"../../../../../utils/styles/helpers.mjs";import{disablePageScroll as t,enablePageScroll as n,pxToVw as r}from"../../../../../../../utils/helper.mjs";import{Image as i}from"../../../../../../ui/image.mjs";import{Box as a}from"../../../../../../ui/box.mjs";import{Text as o}from"../../../../../../ui/text.mjs";import s from"../../../../../../ui/legacy/button.mjs";import c from"../../../../../../ui/link.mjs";import{urlPrefix as l}from"../../../../../../../constants/url-prefix.mjs";import{loadHiddenChannelIdsFromStorage as u}from"../../../../../business/nav-bar/variants/basic-nav-bar/runtime/channel-filter-dialog.mjs";import{defaultProps as d}from"../defaults/default-props.mjs";import f from"../../../../../../../assets/images/logo.mjs";import{Popover as p}from"../../../../../../ui/legacy/popover.mjs";import{Mask as m}from"../../../../../../ui/mask.mjs";import{clsx as h}from"clsx";import{useIsClient as g}from"foxact/use-is-client";import{useEffect as _,useMemo as v,useRef as y,useState as b}from"react";import{jsx as x,jsxs as S}from"react/jsx-runtime";import{usePathname as C}from"next/navigation";const w={overscrollBehavior:`contain`},T={},E=[];function D(e,t){return t===0?`/`:`${l.CHANNEL}/${encodeURIComponent(e.cn_name)}`}function O(e,t,n){return h(`w-full leading-[58px] px-[20px] text-[16px] text-text2 border-t border-solid border-line1 transition-all duration-150 block`,e===0&&`border-t-0`,t&&`!text-[20px] !text-theme5 !font-bold`,n&&`!text-(--color-theme5)`)}function k(e){let t=e;try{t=decodeURIComponent(e)}catch{t=e}return t.length>1&&t.endsWith(`/`)?t.slice(0,-1):t}function A(e){e.stopPropagation()}function j({props:l=T,styles:h,events:j,data:M=E}){let{logoAlt:N,logoWidth:P,logoHeight:F,popoverPlacement:I,popoverWidth:L,maxHeight:R,itemHeight:z,currentChannelId:B}={...d,...l},[V,H]=b(!1),U=y(null),W=C(),[G,K]=b(B??null),q=g(),J=(e,t)=>{K(e.id),j?.onChannelChange?.(e,t),setTimeout(()=>{H(!1)},150)};_(()=>{if(B||!W||M.length===0)return;let e=k(W),t=M.find((t,n)=>k(D(t,n))===e);t?K(t.id):e===`/`&&K(M[0]?.id||null)},[W,q,M,B]);let Y=v(()=>{if(!q||!V)return M;let e=u();return M.filter(t=>!e.includes(t.id))},[M,q,V]);_(()=>{if(V)return t(),()=>{n()}},[V]);let X=h?e(h,{}):{},Z={width:r(L),maxHeight:r(R),...w};return S(a,{style:X,className:`leading-0 flex items-center`,children:[x(m,{visible:V,onMaskClick:()=>{H(!1)}}),x(p,{placement:I,visible:V,content:x(a,{as:`nav`,className:`overflow-y-auto overscroll-contain`,style:Z,onTouchMove:A,children:Y.map((e,t)=>{let n=D(e,t),i=k(W||``)===k(n);return x(c,{href:n,className:O(t,G===e.id,i),style:{height:r(z)},onClick:()=>J(e,t),children:e.cn_name},e.id||`channel-${t}`)})}),children:x(o,{ref:U,as:`h1`,className:`flex items-center`,children:x(s,{onClick:()=>{H(e=>!e),j?.onClick?.()},className:`!m-0 !p-0`,children:x(i,{alt:N,src:typeof f==`string`?f:f.src,width:P,height:F})})},`logo-button`)})]})}export{j as default};
2
+ "use client";import{mergeStyles as e}from"../../../../../utils/styles/helpers.mjs";import{disablePageScroll as t,enablePageScroll as n,pxToVw as r}from"../../../../../../../utils/helper.mjs";import{Image as i}from"../../../../../../ui/image.mjs";import{Box as a}from"../../../../../../ui/box.mjs";import{Text as o}from"../../../../../../ui/text.mjs";import s from"../../../../../../ui/legacy/button.mjs";import{defaultProps as c}from"../defaults/default-props.mjs";import l from"../../../../../../../assets/images/logo.mjs";import{loadHiddenChannelIdsFromStorage as u}from"../../../../../business/nav-bar/variants/basic-nav-bar/runtime/channel-filter-dialog.mjs";import{Popover as d}from"../../../../../../ui/legacy/popover.mjs";import f from"../../../../../../ui/link.mjs";import{Mask as p}from"../../../../../../ui/mask.mjs";import{urlPrefix as m}from"../../../../../../../constants/url-prefix.mjs";import{usePathname as h}from"next/navigation";import{useEffect as g,useMemo as _,useRef as v,useState as y}from"react";import{clsx as b}from"clsx";import{jsx as x,jsxs as S}from"react/jsx-runtime";import{useIsClient as C}from"foxact/use-is-client";const w={overscrollBehavior:`contain`},T={},E=[];function D(e,t){return t===0?`/`:`${m.CHANNEL}/${encodeURIComponent(e.cn_name)}`}function O(e,t,n){return b(`w-full leading-[58px] px-[20px] text-[16px] text-text2 border-t border-solid border-line1 transition-all duration-150 block`,e===0&&`border-t-0`,t&&`!text-[20px] !text-theme5 !font-bold`,n&&`!text-(--color-theme5)`)}function k(e){let t=e;try{t=decodeURIComponent(e)}catch{t=e}return t.length>1&&t.endsWith(`/`)?t.slice(0,-1):t}function A(e){e.stopPropagation()}function j({props:m=T,styles:b,events:j,data:M=E}){let{logoAlt:N,logoWidth:P,logoHeight:F,popoverPlacement:I,popoverWidth:L,maxHeight:R,itemHeight:z,currentChannelId:B}={...c,...m},[V,H]=y(!1),U=v(null),W=h(),[G,K]=y(B??null),q=C(),J=(e,t)=>{K(e.id),j?.onChannelChange?.(e,t),setTimeout(()=>{H(!1)},150)};g(()=>{if(B||!W||M.length===0)return;let e=k(W),t=M.find((t,n)=>k(D(t,n))===e);t?K(t.id):e===`/`&&K(M[0]?.id||null)},[W,q,M,B]);let Y=_(()=>{if(!q||!V)return M;let e=u();return M.filter(t=>!e.includes(t.id))},[M,q,V]);g(()=>{if(V)return t(),()=>{n()}},[V]);let X=b?e(b,{}):{},Z={width:r(L),maxHeight:r(R),...w};return S(a,{style:X,className:`leading-0 flex items-center`,children:[x(p,{visible:V,onMaskClick:()=>{H(!1)}}),x(d,{placement:I,visible:V,content:x(a,{as:`nav`,className:`overflow-y-auto overscroll-contain`,style:Z,onTouchMove:A,children:Y.map((e,t)=>{let n=D(e,t),i=k(W||``)===k(n);return x(f,{href:n,className:O(t,G===e.id,i),style:{height:r(z)},onClick:()=>J(e,t),children:e.cn_name},e.id||`channel-${t}`)})}),children:x(o,{ref:U,as:`h1`,className:`flex items-center`,children:x(s,{onClick:()=>{H(e=>!e),j?.onClick?.()},className:`!m-0 !p-0`,children:x(i,{alt:N,src:typeof l==`string`?l:l.src,width:P,height:F})})},`logo-button`)})]})}export{j as default};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{pxToVw as e}from"../../../../../../utils/helper.mjs";import{Box as t}from"../../../../../ui/box.mjs";import{Text as n}from"../../../../../ui/text.mjs";import r from"../../../../../ui/link.mjs";import i from"../../../../../../assets/icons/search.mjs";import"react";import{jsx as a,jsxs as o}from"react/jsx-runtime";function s({placeholder:s,searchUrl:c,iconSize:l,showPlaceholderText:u,borderColor:d,onClick:f,marginRight:p=16,className:m=`flex-1`,wrapperStyle:h}){let g=a(r,{className:m,href:c,onClick:()=>{f?.()},children:o(t,{className:`h-[38px] flex px-[12px] items-center rounded-[19px] cursor-pointer transition-colors text-text3 relative`,style:{border:`1px solid ${d}`,marginRight:p>0?e(p):void 0},children:[a(i,{width:e(l),height:e(l)}),u&&a(n,{className:`ml-[4px] text-text3 text-[16px] leading-none select-none flex-1`,children:s})]})});return h?a(t,{style:h,children:g}):g}export{s as SearchBox};
2
+ "use client";import{pxToVw as e}from"../../../../../../utils/helper.mjs";import{Box as t}from"../../../../../ui/box.mjs";import{Text as n}from"../../../../../ui/text.mjs";import r from"../../../../../../assets/icons/search.mjs";import i from"../../../../../ui/link.mjs";import"react";import{jsx as a,jsxs as o}from"react/jsx-runtime";function s({placeholder:s,searchUrl:c,iconSize:l,showPlaceholderText:u,borderColor:d,onClick:f,marginRight:p=16,className:m=`flex-1`,wrapperStyle:h}){let g=a(i,{className:m,href:c,onClick:()=>{f?.()},children:o(t,{className:`h-[38px] flex px-[12px] items-center rounded-[19px] cursor-pointer transition-colors text-text3 relative`,style:{border:`1px solid ${d}`,marginRight:p>0?e(p):void 0},children:[a(r,{width:e(l),height:e(l)}),u&&a(n,{className:`ml-[4px] text-text3 text-[16px] leading-none select-none flex-1`,children:s})]})});return h?a(t,{style:h,children:g}):g}export{s as SearchBox};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{mergeStyles as e}from"../../../../../utils/styles/helpers.mjs";import{pxToVw as t}from"../../../../../../../utils/helper.mjs";import n from"../../../../../../ui/link.mjs";import r from"../../../../../../../assets/icons/search.mjs";import{defaultProps as i}from"../defaults/default-props.mjs";import{jsx as a}from"react/jsx-runtime";function o({props:o,styles:s,events:c}){let{searchUrl:l,iconSize:u}={...i,...o||{}},d=()=>{c?.onClick?.()},f=s?e(s,{}):void 0,p=t(u);return a(n,{href:l,onClick:d,style:f,"aria-label":`搜索`,children:a(r,{width:p,height:p})})}export{o as default};
2
+ "use client";import{mergeStyles as e}from"../../../../../utils/styles/helpers.mjs";import{pxToVw as t}from"../../../../../../../utils/helper.mjs";import n from"../../../../../../../assets/icons/search.mjs";import r from"../../../../../../ui/link.mjs";import{defaultProps as i}from"../defaults/default-props.mjs";import{jsx as a}from"react/jsx-runtime";function o({props:o,styles:s,events:c}){let{searchUrl:l,iconSize:u}={...i,...o||{}},d=()=>{c?.onClick?.()},f=s?e(s,{}):void 0,p=t(u);return a(r,{href:l,onClick:d,style:f,"aria-label":`搜索`,children:a(n,{width:p,height:p})})}export{o as default};
@@ -12,7 +12,6 @@ declare const basicBannerInspectorPropsSchema: z.ZodObject<{
12
12
  list: z.ZodOptional<z.ZodArray<z.ZodObject<{
13
13
  contentId: z.ZodOptional<z.ZodNumber>;
14
14
  title: z.ZodOptional<z.ZodString>;
15
- desc: z.ZodOptional<z.ZodString>;
16
15
  coverUrl: z.ZodOptional<z.ZodString>;
17
16
  showViewCount: z.ZodOptional<z.ZodBoolean>;
18
17
  }, z.core.$strip>>> & SchemaHasDefaultValue;
@@ -22,7 +21,6 @@ declare const basicBannerInspectorDefaultProps: {
22
21
  list: {
23
22
  contentId?: number | undefined;
24
23
  title?: string | undefined;
25
- desc?: string | undefined;
26
24
  coverUrl?: string | undefined;
27
25
  showViewCount?: boolean | undefined;
28
26
  }[];
@@ -1,2 +1,2 @@
1
1
 
2
- import{defaultProps as e}from"./defaults/default-props.mjs";import{defineArrayItemPropSchema as t,defineComponentPropsSchema as n,defineNumberPropSchema as r,defineSwitchPropSchema as i,defineTextPropSchema as a,getSchemaDefaultProps as o}from"../../../../../../utils/schema/schema.mjs";import s from"zod";const c=n({interval:r({label:`播放间隔`,defaultValue:e.interval}),list:t(s.object({contentId:r({label:`内容ID`,required:!1}),title:a({label:`内容标题`,required:!1}),desc:a({label:`内容简介`,required:!1}),coverUrl:a({label:`封面`,required:!1}),showViewCount:i({label:`角标`,required:!1})}),{required:!1,label:`list`,defaultValue:[{contentId:1,title:`视频标题`,desc:`视频描述`,coverUrl:`/banner/banner1.png`,showViewCount:!1}]})}),l=o(c);export{l as basicBannerInspectorDefaultProps,c as basicBannerInspectorPropsSchema};
2
+ import{defineArrayItemPropSchema as e,defineComponentPropsSchema as t,defineNumberPropSchema as n,defineSwitchPropSchema as r,defineTextPropSchema as i,getSchemaDefaultProps as a}from"../../../../../../utils/schema/schema.mjs";import{defaultProps as o}from"./defaults/default-props.mjs";import s from"zod";const c=t({interval:n({label:`播放间隔`,defaultValue:o.interval}),list:e(s.object({contentId:n({label:`内容ID`,required:!1}),title:i({label:`内容标题`,required:!1}),coverUrl:i({label:`封面`,required:!1}),showViewCount:r({label:`角标`,required:!1})}),{required:!1,label:`list`,defaultValue:[{contentId:1,title:`视频标题一`,desc:`视频描述`,coverUrl:`/static/components-resource/banner.png`,showViewCount:!1},{contentId:2,title:`视频标题二`,coverUrl:`/static/components-resource/banner.png`,showViewCount:!1},{contentId:3,title:`视频标题三`,coverUrl:`/static/components-resource/banner.png`,showViewCount:!1}]})}),l=a(c);export{l as basicBannerInspectorDefaultProps,c as basicBannerInspectorPropsSchema};
@@ -12,7 +12,6 @@ declare const basicBannerMaterial: DefineMaterialOption<typeof BasicBanner, zod.
12
12
  list: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
13
13
  contentId: zod.ZodOptional<zod.ZodNumber>;
14
14
  title: zod.ZodOptional<zod.ZodString>;
15
- desc: zod.ZodOptional<zod.ZodString>;
16
15
  coverUrl: zod.ZodOptional<zod.ZodString>;
17
16
  showViewCount: zod.ZodOptional<zod.ZodBoolean>;
18
17
  }, zod_v4_core0.$strip>>> & SchemaHasDefaultValue;
@@ -1,2 +1,2 @@
1
1
 
2
- import{defineMaterial as e}from"../../../../../../utils/schema/material.mjs";import{basicBannerInspectorPropsSchema as t}from"./inspector-schema.mjs";import{BasicBanner as n}from"./server.mjs";const r=e({type:`basic-banner`,name:`基础轮播图`,icon:`/static/components-thumb/banner.png`,category:`CENTER`,serverComponent:n,clientComponent:n,propsSchema:t});export{r as basicBannerMaterial};
2
+ import{defineMaterial as e}from"../../../../../../utils/schema/material.mjs";import{basicBannerInspectorPropsSchema as t}from"./inspector-schema.mjs";import{BasicBanner as n}from"./server.mjs";const r=e({type:`basic-banner`,name:`基础轮播图`,icon:`/static/components-thumb/carousel_banner.png`,category:`内容组件`,serverComponent:n,clientComponent:n,propsSchema:t});export{r as basicBannerMaterial};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{buildContentUrl as e}from"../../../../../utils/helpers/url.mjs";import{mergeStyles as t}from"../../../../../utils/styles/helpers.mjs";import{defaultProps as n}from"../defaults/default-props.mjs";import{Image as r}from"../../../../../../ui/image.mjs";import{Box as i}from"../../../../../../ui/box.mjs";import{Carousel as a,CarouselContent as o,CarouselItem as s}from"../../../../../../ui/carousel.mjs";import{Text as c}from"../../../../../../ui/text.mjs";import l from"../../../../../../ui/legacy/button.mjs";import u from"../../../../../../ui/link.mjs";import d from"clsx";import{useIsClient as f}from"foxact/use-is-client";import{useEffect as p,useRef as m,useState as h}from"react";import{jsx as g,jsxs as _}from"react/jsx-runtime";const v={list:[]};function y({props:y=v,styles:b,events:x}){let{autoplay:S=n.autoplay,interval:C=n.interval,loop:w=n.loop,showTitle:T=n.showTitle,showIndicator:E=n.showIndicator,list:D=[]}={...n,...y},[O,k]=h(),[A,j]=h(0),M=f(),N=m(null);if(p(()=>{if(!O||!M)return;let e=()=>{j(O.selectedScrollSnap())};return O.on(`select`,e),e(),()=>{O.off(`select`,e)}},[O,x,M]),p(()=>!S||!O||D.length<=1?void 0:(N.current=setInterval(()=>{O.canScrollNext()?O.scrollNext():w&&O.scrollTo(0)},C),()=>{N.current&&=(clearInterval(N.current),null)}),[S,O,C,w,D.length]),!D||D.length===0)return null;let P=D[A];return _(i,{className:`relative w-full`,style:b?t(b,{}):void 0,children:[g(a,{setApi:k,opts:{align:`start`,loop:w,skipSnaps:!1,dragFree:!1},className:`w-full`,children:g(o,{className:`ml-0`,children:D.map((t,n)=>g(s,{className:`pl-0`,children:g(u,{href:e({url:``,contentId:t.contentId,contentType:1,title:t.title}),className:`block relative w-full h-[242px] overflow-hidden touch-manipulation`,children:g(r,{src:t.coverUrl,alt:t.title||`Banner ${n+1}`,fill:!0,objectFit:`cover`,unoptimized:!0})})},n))})}),T&&P?.title&&g(i,{className:`absolute bottom-[8px] left-[8px]`,children:g(c,{as:`p`,className:`text-white text-[16px] line-clamp-1`,children:P.title})}),E&&D.length>1&&g(i,{className:`absolute bottom-[16px] right-[8px] flex items-center gap-[4px]`,children:D.map((e,t)=>g(l,{type:`button`,className:d(`transition-all duration-300 rounded-full !p-0`,t===A?`w-[10px] h-[6px] bg-black`:`w-[6px] h-[6px] bg-white/50`),"aria-label":`跳转到第 ${t+1} 个 Banner`},t))})]})}export{y as default};
2
+ "use client";import{buildContentUrl as e}from"../../../../../utils/helpers/url.mjs";import{mergeStyles as t}from"../../../../../utils/styles/helpers.mjs";import{Image as n}from"../../../../../../ui/image.mjs";import{Box as r}from"../../../../../../ui/box.mjs";import{Carousel as i,CarouselContent as a,CarouselItem as o}from"../../../../../../ui/carousel.mjs";import{Text as s}from"../../../../../../ui/text.mjs";import c from"../../../../../../ui/legacy/button.mjs";import l from"../../../../../../ui/link.mjs";import{defaultProps as u}from"../defaults/default-props.mjs";import{useEffect as d,useRef as f,useState as p}from"react";import m from"clsx";import{jsx as h,jsxs as g}from"react/jsx-runtime";import{useIsClient as _}from"foxact/use-is-client";const v={list:[]};function y({props:y=v,styles:b,events:x}){let{autoplay:S=u.autoplay,interval:C=u.interval,loop:w=u.loop,showTitle:T=u.showTitle,showIndicator:E=u.showIndicator,list:D=[]}={...u,...y},[O,k]=p(),[A,j]=p(0),M=_(),N=f(null);if(d(()=>{if(!O||!M)return;let e=()=>{j(O.selectedScrollSnap())};return O.on(`select`,e),e(),()=>{O.off(`select`,e)}},[O,x,M]),d(()=>!S||!O||D.length<=1?void 0:(N.current=setInterval(()=>{O.canScrollNext()?O.scrollNext():w&&O.scrollTo(0)},C),()=>{N.current&&=(clearInterval(N.current),null)}),[S,O,C,w,D.length]),!D||D.length===0)return null;let P=D[A];return g(r,{className:`relative w-full`,style:b?t(b,{}):void 0,children:[h(i,{setApi:k,opts:{align:`start`,loop:w,skipSnaps:!1,dragFree:!1},className:`w-full`,children:h(a,{className:`ml-0`,children:D.map((t,r)=>h(o,{className:`pl-0`,children:h(l,{href:e({url:``,contentId:t.contentId,contentType:1,title:t.title}),className:`block relative w-full h-[242px] overflow-hidden touch-manipulation`,children:h(n,{src:t.coverUrl,alt:t.title||`Banner ${r+1}`,fill:!0,objectFit:`cover`,unoptimized:!0})})},r))})}),T&&P?.title&&h(r,{className:`absolute bottom-[8px] left-[8px]`,children:h(s,{as:`p`,className:`text-white text-[16px] line-clamp-1`,children:P.title})}),E&&D.length>1&&h(r,{className:`absolute bottom-[16px] right-[8px] flex items-center gap-[4px]`,children:D.map((e,t)=>h(c,{type:`button`,className:m(`transition-all duration-300 rounded-full !p-0`,t===A?`w-[10px] h-[6px] bg-black`:`w-[6px] h-[6px] bg-white/50`),"aria-label":`跳转到第 ${t+1} 个 Banner`},t))})]})}export{y as default};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{CardSpec as e}from"../../../../../utils/constants/card-spec.mjs";import{mergeStyles as t}from"../../../../../utils/styles/helpers.mjs";import{transformContentListToCardItems as n}from"../../../../../utils/transformers/card-grid.mjs";import{gContentGetAppChannelBlockData as r}from"../../../../../../../service/generated/client.mjs";import{Box as i}from"../../../../../../ui/box.mjs";import{InfiniteScroll as a}from"../../../../../../ui/infinite-scroll.mjs";import{Text as o}from"../../../../../../ui/text.mjs";import s from"../../../../../basics/card-layout/runtime/client.mjs";import{usePaginated as c}from"../../../../../../../hooks/query/use-query.mjs";import{useLayoutEffect as l,useMemo as u,useRef as d,useState as f}from"react";import{jsx as p,jsxs as m}from"react/jsx-runtime";const h={},g={list:[],title:``,cursor:``,block_id:``};function _({props:_=h,styles:v,data:y=g}){let b=e.V2_LARGE,{gap:x=8}=_||{},{title:S,cursor:C,block_id:w,list:T}=y,E=v?t(v,{}):void 0,D=T&&T.length>0,O=u(()=>{if(!D)return;let e=C&&C.trim()?C:void 0;return{pages:[{data:{block:{data:{videos:T,cursor:C||``}}}}],pageParams:[e]}},[D,T,C]),{data:k,fetchNextPage:A,hasNextPage:j}=c({key:[`card-grid-2x3-infinite`,w],queryFn:e=>r({block_id:w,cursor:e||void 0,page_size:20}),getNextPageParam:e=>{let t=e.data?.block?.data?.cursor;return t&&t.trim()?t:void 0},options:{enabled:!!w,initialData:O,refetchOnMount:!1,refetchOnWindowFocus:!1,refetchOnReconnect:!1},initialPageParam:D&&C&&C.trim()?C:void 0}),M=d(T),[N,P]=f(!1);l(()=>{P(!0)},[]);let F=u(()=>{let e=[...M.current];if(!N)return e;let t=[...e],n=k?.pages;if(n&&n.length>1)for(let e=1;e<n.length;e++){let r=n[e].data?.block?.data?.videos||[];t.push(...r)}return t},[N,k?.pages]),I=u(()=>n(F,`view-duration`),[F]);return m(i,{children:[S&&p(o,{as:`h2`,className:`text-[18px] font-bold text-text1 mb-[10px] px-[12px]`,children:S}),p(a,{loadMore:()=>A().then(()=>void 0),hasMore:j===!0||j===void 0&&!!C&&T.length>0,initialLoad:!0,rootId:`app-scroll-container`,threshold:1e3,className:``,children:p(s,{props:{cardSpec:b,gap:x},data:I,styles:E})})]})}export{_ as default};
2
+ "use client";import{CardSpec as e}from"../../../../../utils/constants/card-spec.mjs";import{mergeStyles as t}from"../../../../../utils/styles/helpers.mjs";import{transformContentListToCardItems as n}from"../../../../../utils/transformers/card-grid.mjs";import{gContentGetAppChannelBlockData as r}from"../../../../../../../service/generated/client.mjs";import{Box as i}from"../../../../../../ui/box.mjs";import{InfiniteScroll as a}from"../../../../../../ui/infinite-scroll.mjs";import{Text as o}from"../../../../../../ui/text.mjs";import{usePaginated as s}from"../../../../../../../hooks/query/use-query.mjs";import c from"../../../../../basics/card-layout/runtime/client.mjs";import{useLayoutEffect as l,useMemo as u,useRef as d,useState as f}from"react";import{jsx as p,jsxs as m}from"react/jsx-runtime";const h={},g={list:[],title:``,cursor:``,block_id:``};function _({props:_=h,styles:v,data:y=g}){let b=e.V2_LARGE,{gap:x=8}=_||{},{title:S,cursor:C,block_id:w,list:T}=y,E=v?t(v,{}):void 0,D=T&&T.length>0,O=u(()=>{if(!D)return;let e=C&&C.trim()?C:void 0;return{pages:[{data:{block:{data:{videos:T,cursor:C||``}}}}],pageParams:[e]}},[D,T,C]),{data:k,fetchNextPage:A,hasNextPage:j}=s({key:[`card-grid-2x3-infinite`,w],queryFn:e=>r({block_id:w,cursor:e||void 0,page_size:20}),getNextPageParam:e=>{let t=e.data?.block?.data?.cursor;return t&&t.trim()?t:void 0},options:{enabled:!!w,initialData:O,refetchOnMount:!1,refetchOnWindowFocus:!1,refetchOnReconnect:!1},initialPageParam:D&&C&&C.trim()?C:void 0}),M=d(T),[N,P]=f(!1);l(()=>{P(!0)},[]);let F=u(()=>{let e=[...M.current];if(!N)return e;let t=[...e],n=k?.pages;if(n&&n.length>1)for(let e=1;e<n.length;e++){let r=n[e].data?.block?.data?.videos||[];t.push(...r)}return t},[N,k?.pages]),I=u(()=>n(F,`view-duration`),[F]);return m(i,{children:[S&&p(o,{as:`h2`,className:`text-[18px] font-bold text-text1 mb-[10px] px-[12px]`,children:S}),p(a,{loadMore:()=>A().then(()=>void 0),hasMore:j===!0||j===void 0&&!!C&&T.length>0,initialLoad:!0,rootId:`app-scroll-container`,threshold:1e3,className:``,children:p(c,{props:{cardSpec:b,gap:x},data:I,styles:E})})]})}export{_ as default};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{CardSpec as e}from"../../../../../utils/constants/card-spec.mjs";import{mergeStyles as t}from"../../../../../utils/styles/helpers.mjs";import{transformContentListToCardItems as n}from"../../../../../utils/transformers/card-grid.mjs";import{gContentGetAppChannelBlockData as r}from"../../../../../../../service/generated/client.mjs";import{Box as i}from"../../../../../../ui/box.mjs";import{InfiniteScroll as a}from"../../../../../../ui/infinite-scroll.mjs";import{Text as o}from"../../../../../../ui/text.mjs";import s from"../../../../../basics/card-layout/runtime/client.mjs";import{usePaginated as c}from"../../../../../../../hooks/query/use-query.mjs";import{useLayoutEffect as l,useMemo as u,useRef as d,useState as f}from"react";import{jsx as p,jsxs as m}from"react/jsx-runtime";const h={},g={list:[],title:``,cursor:``,block_id:``};function _({props:_=h,styles:v,data:y=g}){let b=e.V3_SMALL,{gap:x=8}=_||{},{title:S,cursor:C,block_id:w,list:T}=y,E=v?t(v,{}):void 0,D=T&&T.length>0,O=u(()=>{if(!D)return;let e=C&&C.trim()?C:void 0;return{pages:[{data:{block:{data:{videos:T,cursor:C||``}}}}],pageParams:[e]}},[D,T,C]),{data:k,fetchNextPage:A,hasNextPage:j}=c({key:[`card-grid-3x3-infinite`,w],queryFn:e=>r({block_id:w,cursor:e||void 0,page_size:21}),getNextPageParam:e=>{let t=e.data?.block?.data?.cursor;return t&&t.trim()?t:void 0},options:{enabled:!!w,initialData:O,refetchOnMount:!1,refetchOnWindowFocus:!1,refetchOnReconnect:!1},initialPageParam:D&&C&&C.trim()?C:void 0}),M=d(T),[N,P]=f(!1);l(()=>{P(!0)},[]);let F=u(()=>{let e=[...M.current];if(!N)return e;let t=[...e],n=k?.pages;if(n&&n.length>1)for(let e=1;e<n.length;e++){let r=n[e].data?.block?.data?.videos||[];t.push(...r)}return t},[N,k?.pages]),I=u(()=>n(F,`view-duration`),[F]);return m(i,{children:[S&&p(o,{as:`h2`,className:`text-[18px] font-bold text-text1 mb-[10px] px-[12px]`,children:S}),p(a,{loadMore:()=>A().then(()=>void 0),hasMore:j===!0||j===void 0&&!!C&&T.length>0,className:``,initialLoad:!0,rootId:`app-scroll-container`,threshold:1e3,children:p(s,{props:{cardSpec:b,gap:x},data:I,styles:E})})]})}export{_ as default};
2
+ "use client";import{CardSpec as e}from"../../../../../utils/constants/card-spec.mjs";import{mergeStyles as t}from"../../../../../utils/styles/helpers.mjs";import{transformContentListToCardItems as n}from"../../../../../utils/transformers/card-grid.mjs";import{gContentGetAppChannelBlockData as r}from"../../../../../../../service/generated/client.mjs";import{Box as i}from"../../../../../../ui/box.mjs";import{InfiniteScroll as a}from"../../../../../../ui/infinite-scroll.mjs";import{Text as o}from"../../../../../../ui/text.mjs";import{usePaginated as s}from"../../../../../../../hooks/query/use-query.mjs";import c from"../../../../../basics/card-layout/runtime/client.mjs";import{useLayoutEffect as l,useMemo as u,useRef as d,useState as f}from"react";import{jsx as p,jsxs as m}from"react/jsx-runtime";const h={},g={list:[],title:``,cursor:``,block_id:``};function _({props:_=h,styles:v,data:y=g}){let b=e.V3_SMALL,{gap:x=8}=_||{},{title:S,cursor:C,block_id:w,list:T}=y,E=v?t(v,{}):void 0,D=T&&T.length>0,O=u(()=>{if(!D)return;let e=C&&C.trim()?C:void 0;return{pages:[{data:{block:{data:{videos:T,cursor:C||``}}}}],pageParams:[e]}},[D,T,C]),{data:k,fetchNextPage:A,hasNextPage:j}=s({key:[`card-grid-3x3-infinite`,w],queryFn:e=>r({block_id:w,cursor:e||void 0,page_size:21}),getNextPageParam:e=>{let t=e.data?.block?.data?.cursor;return t&&t.trim()?t:void 0},options:{enabled:!!w,initialData:O,refetchOnMount:!1,refetchOnWindowFocus:!1,refetchOnReconnect:!1},initialPageParam:D&&C&&C.trim()?C:void 0}),M=d(T),[N,P]=f(!1);l(()=>{P(!0)},[]);let F=u(()=>{let e=[...M.current];if(!N)return e;let t=[...e],n=k?.pages;if(n&&n.length>1)for(let e=1;e<n.length;e++){let r=n[e].data?.block?.data?.videos||[];t.push(...r)}return t},[N,k?.pages]),I=u(()=>n(F,`view-duration`),[F]);return m(i,{children:[S&&p(o,{as:`h2`,className:`text-[18px] font-bold text-text1 mb-[10px] px-[12px]`,children:S}),p(a,{loadMore:()=>A().then(()=>void 0),hasMore:j===!0||j===void 0&&!!C&&T.length>0,className:``,initialLoad:!0,rootId:`app-scroll-container`,threshold:1e3,children:p(c,{props:{cardSpec:b,gap:x},data:I,styles:E})})]})}export{_ as default};
@@ -0,0 +1,2 @@
1
+
2
+ "use client";import{Image as e}from"../../../ui/image.mjs";import{Box as t}from"../../../ui/box.mjs";import{Text as n}from"../../../ui/text.mjs";import r from"../../../ui/popup.mjs";import i from"../../../../assets/images/add.mjs";import a from"../../../../assets/images/less.mjs";import{useEffect as o,useMemo as s,useState as c}from"react";import{jsx as l,jsxs as u}from"react/jsx-runtime";import{useTranslations as d}from"next-intl";const f=`channel-filter-hidden-channel-ids`;function p(){if(typeof window>`u`)return[];try{let e=localStorage.getItem(f);return e?JSON.parse(e):[]}catch(e){return console.error(`Failed to load hidden channel IDs:`,e),[]}}function m(e){if(!(typeof window>`u`))try{localStorage.setItem(f,JSON.stringify(e))}catch(e){console.error(`Failed to save hidden channel IDs:`,e)}}function h({open:f,onOpenChange:h,channels:g,onChannelClick:_,onChannelsChange:v}){let y=d(`components.biz.business.navBar.variants.basicNavBar.runtime`),[b,x]=c(g);o(()=>{if(g.length>0){let e=p();x(g.filter(t=>!e.includes(t.title)))}},[g]);let S=s(()=>g.filter(e=>!b.some(t=>t.title===e.title)),[g,b]),C=e=>{if(h(e),!e){m(S.map(e=>e.title)),v?.(b);let e=new URL(window.location.href).pathname,t=decodeURIComponent(e.split(`/`).pop());S.find(e=>e.title===t)&&b[0]&&(window.location.href=`/`)}},w=e=>{x(t=>t.filter(t=>t.title!==e.title))},T=e=>{x(t=>[...t,e])},E=(e,t)=>{_?.(e,t)},D=()=>{x(g),m([])},O=e=>e===`推荐`;return l(r,{open:f,onOpenChange:C,side:`top`,showCloseButton:!0,className:`!h-screen max-h-screen`,closeButtonClassName:`border-0`,children:u(t,{className:`flex flex-col h-full px-[12px]`,children:[l(t,{className:`mb-4 pt-4`,children:l(n,{className:`text-text1 font-bold text-[18px]`,children:y(`channelFilterDialog.allChannels`)})}),u(t,{className:`mb-[32px]`,children:[u(t,{className:`flex items-center justify-between h-6 mb-[12px]`,children:[l(n,{className:`text-text1 text-[16px]`,children:y(`channelFilterDialog.myChannels`)}),l(t,{onClick:D,children:l(n,{className:`text-text1 text-[16px]`,children:y(`channelFilterDialog.resetDefault`)})})]}),l(t,{className:`grid grid-cols-4 gap-[12px]`,children:b.map((r,i)=>{let o=O(r.title);return u(t,{className:`relative h-[40px] px-4 bg-bg1 rounded-[50px] cursor-pointer flex items-center justify-center whitespace-nowrap`,onClick:()=>E(r,i),children:[l(n,{className:`text-text1 text-[14px]`,children:r.title}),!o&&l(t,{className:`absolute top-0 right-0 flex items-center justify-center cursor-pointer w-[16px] h-[16px]`,onClick:e=>{e.stopPropagation(),w(r)},children:l(e,{src:typeof a==`string`?a:a.src,alt:y(`channelFilterDialog.delete`),width:16,height:16})})]},r.title||`my-channel-${i}`)})})]}),u(t,{children:[l(t,{className:`h-6 mb-[12px]`,children:l(n,{className:`text-text1 text-[16px]`,children:y(`channelFilterDialog.moreChannels`)})}),S.length===0?l(t,{className:`flex justify-center`,children:u(n,{className:`text-text3 text-[14px]`,children:[y(`channelFilterDialog.allAddedTo`),`"`,y(`channelFilterDialog.myChannels`),`"`]})}):l(t,{className:`grid grid-cols-4 gap-[12px]`,children:S.map((r,a)=>u(t,{className:`relative h-[40px] px-4 bg-bg1 rounded-[50px] cursor-pointer flex items-center justify-center whitespace-nowrap`,onClick:()=>E(r,a),children:[l(n,{className:`text-text1 text-[14px]`,children:r.title}),l(t,{className:`absolute top-0 right-0 flex items-center justify-center cursor-pointer w-[16px] h-[16px]`,onClick:e=>{e.stopPropagation(),T(r)},children:l(e,{src:typeof i==`string`?i:i.src,alt:y(`channelFilterDialog.add`),width:16,height:16})})]},r.title||`more-channel-${a}`))})]})]})})}export{h as default,p as loadHiddenChannelIdsFromStorage};
@@ -0,0 +1,8 @@
1
+
2
+ import { ChannelListProps } from "./schema.mjs";
3
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
4
+
5
+ //#region components/biz/business/channel-list/client.d.ts
6
+ declare function BasicNavBarClient(props: ChannelListProps): react_jsx_runtime0.JSX.Element;
7
+ //#endregion
8
+ export { BasicNavBarClient };
@@ -0,0 +1,2 @@
1
+
2
+ "use client";import{mergeStyles as e}from"../../utils/styles/helpers.mjs";import{pxToVw as t}from"../../../../utils/helper.mjs";import{Box as n}from"../../../ui/box.mjs";import{useSticky as r}from"../../../../hooks/use-sticky.mjs";import i from"../../../ui/link.mjs";import{urlPrefix as a}from"../../../../constants/url-prefix.mjs";import o,{loadHiddenChannelIdsFromStorage as s}from"./channel-filter-dialog.mjs";import{defaultProps as c}from"./default-props.mjs";import{useEffect as l,useMemo as u,useState as d}from"react";import{clsx as f}from"clsx";import{Fragment as p,jsx as m,jsxs as h}from"react/jsx-runtime";const g={};function _(e,t){return t===0?`/`:`${a.CHANNEL}/${encodeURIComponent(e.title)}`}function v(a){let{styles:v,events:y,...b}=a,x=b||g,S={...c,...x},{channelItemHeight:C,channelItemFontSize:w,channelItemActiveFontSize:T,channelItemGap:E}=S,[D,O]=d(!1),{isSticky:k,ref:A}=r(),[j,M]=d(S.list),N=u(()=>S.currentChannelId??null,[S.currentChannelId]);l(()=>{let e=s();M(e?.length?S.list.filter(t=>!e.includes(t.title)):S.list)},[S.list]);let P=e=>{M(e)},F=(e,t)=>{y?.onChannelChange?.(e,t)},I=v?e(v,{}):void 0;return h(p,{children:[k&&m(n,{className:`w-full`,style:{height:t(44)}}),m(n,{as:`nav`,ref:A,className:f(`w-full transition-all duration-200`,!S.isFullfeed&&k&&`fixed top-0 left-0 right-0 z-50`,S.isFullfeed&&`fixed top-[54px] left-0 z-10 w-full`,!S.isFullfeed&&`bg-bg1`),style:I,children:m(n,{className:`relative flex items-center h-[44px]`,children:m(n,{className:`flex-1 overflow-x-auto overflow-y-hidden [&::-webkit-scrollbar]:hidden`,style:{scrollbarWidth:`none`,msOverflowStyle:`none`,WebkitOverflowScrolling:`touch`},children:m(n,{className:`flex items-center h-full`,style:{paddingLeft:t(16),paddingRight:t(16),gap:t(E)},children:j.map((e,n)=>{let r=N===e.title||N===null&&n===0;return m(i,{href:_(e,n),className:f(`whitespace-nowrap cursor-pointer transition-all duration-200`,`flex items-center justify-center`),style:{height:t(C),fontSize:t(r?T:w),fontWeight:r?`bold`:`normal`,color:r?`var(--color-theme5)`:`var(--color-text2)`},onClick:()=>F(e,n),children:e.title},e.title||`channel-${n}`)})})})})}),m(o,{open:D,onOpenChange:O,channels:S.list,currentChannelId:N,onChannelClick:F,onChannelsChange:P})]})}export{v as default};
@@ -0,0 +1,2 @@
1
+
2
+ const e={currentChannelId:null,channelItemHeight:44,channelItemFontSize:16,channelItemActiveFontSize:20,channelItemGap:16,isFullfeed:!1,list:[]};export{e as defaultProps};
@@ -0,0 +1,16 @@
1
+
2
+ import { SchemaHasDefaultValue } from "../../../../utils/schema/schema.mjs";
3
+ import { DefineMaterialOption } from "../../../../utils/schema/material.mjs";
4
+ import "../../../../utils/schema/index.mjs";
5
+ import { BasicNavBarClient } from "./client.mjs";
6
+ import * as zod from "zod";
7
+ import * as zod_v4_core0 from "zod/v4/core";
8
+
9
+ //#region components/biz/business/channel-list/material.d.ts
10
+ declare const channelListMaterial: DefineMaterialOption<typeof BasicNavBarClient, zod.ZodObject<{
11
+ list: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
12
+ title: zod.ZodOptional<zod.ZodString>;
13
+ }, zod_v4_core0.$strip>>> & SchemaHasDefaultValue;
14
+ }, zod_v4_core0.$strip>, "channel-list">;
15
+ //#endregion
16
+ export { channelListMaterial };
@@ -0,0 +1,2 @@
1
+
2
+ import{defineMaterial as e}from"../../../../utils/schema/material.mjs";import t from"./client.mjs";import{channelListInspectorPropsSchema as n}from"./schema.mjs";const r=e({type:`channel-list`,name:`频道`,icon:`/static/components-thumb/channel_list_editable.png`,category:`内容组件`,serverComponent:t,clientComponent:t,propsSchema:n});export{r as channelListMaterial};
@@ -0,0 +1,23 @@
1
+
2
+ import { BaseComponentProps } from "../../utils/types/component.mjs";
3
+ import "../../utils/index.mjs";
4
+ import { SchemaHasDefaultValue } from "../../../../utils/schema/schema.mjs";
5
+ import "../../../../utils/schema/index.mjs";
6
+ import z from "zod";
7
+
8
+ //#region components/biz/business/channel-list/schema.d.ts
9
+ /**
10
+ * 定义可以被低代码右侧inspector编辑的props
11
+ */
12
+ declare const channelListInspectorPropsSchema: z.ZodObject<{
13
+ list: z.ZodOptional<z.ZodArray<z.ZodObject<{
14
+ title: z.ZodOptional<z.ZodString>;
15
+ }, z.core.$strip>>> & SchemaHasDefaultValue;
16
+ }, z.core.$strip>;
17
+ type ChannelListInspectorProps<T extends object = object> = z.infer<typeof channelListInspectorPropsSchema> & BaseComponentProps;
18
+ /**
19
+ * 基于ButtonInspectorProps再派生出组件真正的props(因为不是所有props都需要被编辑,比如说下面的children就不需要,但是button组件又需要传入children)
20
+ */
21
+ type ChannelListProps = ChannelListInspectorProps;
22
+ //#endregion
23
+ export { ChannelListProps };
@@ -0,0 +1,2 @@
1
+
2
+ import{defineArrayItemPropSchema as e,defineComponentPropsSchema as t,defineTextPropSchema as n,getSchemaDefaultProps as r}from"../../../../utils/schema/schema.mjs";import i from"zod";const a=t({list:e(i.object({title:n({label:`内容标题`,required:!1})}),{required:!1,label:`list`,defaultValue:[{title:`频道列表`}]})});r(a);export{a as channelListInspectorPropsSchema};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{cn as e}from"../../../../utils/cn.mjs";import{Avatar as t,AvatarImage as n}from"../../../ui/avatar.mjs";import r from"../../../common/interaction-animations.module.mjs";import i from"../../../../assets/icons/common/right_arrow.mjs";import{useInteractionAnimation as a}from"../../../../hooks/use-interaction-animation.mjs";import o from"../../../../assets/icons/detail/give_like.mjs";import s from"../../../../assets/icons/detail/give_like_sel.mjs";import c from"../../../../assets/icons/common/god_comment.mjs";import l from"../../../../assets/icons/detail/un_like.mjs";import u from"../../../../assets/icons/detail/un_like_sel.mjs";import{CommentMedia as d}from"./comment-media.mjs";import{CommentRichText as f}from"./comment-rich-text.mjs";import{TimeDisplay as p}from"./time-display.mjs";import{memo as m}from"react";import{jsx as h,jsxs as g}from"react/jsx-runtime";import{useTranslations as _}from"next-intl";import v from"next/link";function y(e){let t=Number(e)||0;return t>=1e4?`${(t/1e4).toFixed(1)}w`:t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}const b=m(({comment:m,isHighlight:b,onReply:x,onViewReplies:S,onReplyAction:C,onLike:w,onDislike:T,onRequireLogin:E,variant:D=`dark`,rightSlot:O,showReplyButton:k=!0,isLogin:A=!0})=>{let j=_(`components.biz.business.comment`),M=D===`light`,N=m.status===`0`,P=a();function F(){E?.()}function I(){if(!A){F();return}P.trigger(r.likeShakeAnimation),w?.(m)}function L(){if(!A){F();return}T?.(m)}function R(){if(!A){F();return}if(!x){F();return}x(m)}function z(){if(!A){F();return}S?.(m)}function B(){if(!A){F();return}if(C){C(m);return}if(+m.reply_cnt==0){R();return}z()}function V(){return m.reply_cnt===`0`?j(`commentItem.reply`):j(`commentItem.replyCount`,{count:m.reply_cnt})}return g(`div`,{className:e(`flex flex-col p-[16px] relative`,M?`text-text1`:`text-white`),children:[b&&h(c,{className:`w-[70px] h-[70px] absolute top-0 right-[80px]`}),g(`div`,{className:`flex flex-row justify-between relative z-[2]`,children:[g(v,{className:`flex flex-row items-center`,href:`/profile/${m.user_id}`,children:[h(t,{children:h(n,{src:m.avatar,alt:m.user_name})}),g(`div`,{className:`ml-[12px] flex flex-col min-w-0`,children:[h(`span`,{className:e(`text-[14px] leading-[14px] max-w-[180px] text-ellipsis overflow-hidden whitespace-nowrap`,M?`text-text2`:`text-white/80`),children:m.user_name}),h(`span`,{className:e(`mt-[8px] text-[12px] leading-[12px]`,M?`text-text3`:`text-white/50`),children:h(p,{timestamp:m.created_at})})]})]}),N?h(`div`,{className:`px-[8px] py-[4px] bg-text3/10 rounded-[12px]`,children:h(`span`,{className:e(`text-[12px] leading-[12px]`,M?`text-text3`:`text-white/60`),children:j(`commentItem.contentInReview`)})}):O||g(`div`,{className:`flex flex-row items-center`,children:[g(`button`,{type:`button`,className:`px-[4px] flex flex-col items-center`,onClick:I,children:[m.like_flag===`1`?h(s,{className:e(`w-[14px] h-[14px]`,P.animationClass)}):h(o,{className:e(`w-[14px] h-[14px]`,M?`text-text3`:`text-white/70`,P.animationClass)}),h(`span`,{className:e(`mt-[4px] text-[12px] leading-[12px]`,M?`text-text3`:`text-white/70`),children:m.like_cnt===`0`?j(`commentItem.like`):y(m.like_cnt)})]}),g(`button`,{type:`button`,className:`ml-[12px] px-[4px] flex flex-col items-center`,onClick:L,children:[m.like_flag===`2`?h(u,{className:`w-[14px] h-[14px]`}):h(l,{className:e(`w-[14px] h-[14px]`,M?`text-text3`:`text-white/70`)}),h(`span`,{className:e(`mt-[4px] text-[12px] leading-[12px]`,M?`text-text3`:`text-white/70`),children:m.dislike_cnt===`0`?j(`commentItem.dislike`):y(m.dislike_cnt)})]})]})]}),g(`div`,{className:`mt-[4px] pl-[50px] flex flex-col`,children:[m.text&&h(f,{className:e(`text-[14px] leading-[22px] break-all`,M?`text-text1`:`text-white/90`),text:m.text,atUsers:m.at_users}),h(d,{list:m.nine_grid_content_info,disabled:N,hasText:!!m.text,playerId:m.id}),k&&g(`button`,{type:`button`,className:e(`mt-[4px] w-[fit-content] h-[30px] px-[12px] text-[14px] leading-[22px] flex flex-row items-center rounded-[15px]`,M?`text-text1 bg-bg2`:`text-white bg-white/10`),onClick:B,children:[h(`span`,{children:V()}),m.reply_cnt!==`0`&&h(i,{className:`w-[10px] h-[10px] ml-[2px]`})]})]})]})});export{b as CommentItem};
2
+ "use client";import{cn as e}from"../../../../utils/cn.mjs";import{Avatar as t,AvatarImage as n}from"../../../ui/avatar.mjs";import r from"../../../../assets/icons/common/right_arrow.mjs";import{useInteractionAnimation as i}from"../../../../hooks/use-interaction-animation.mjs";import a from"../../../common/interaction-animations.module.mjs";import o from"../../../../assets/icons/detail/give_like.mjs";import s from"../../../../assets/icons/detail/give_like_sel.mjs";import c from"../../../../assets/icons/common/god_comment.mjs";import l from"../../../../assets/icons/detail/un_like.mjs";import u from"../../../../assets/icons/detail/un_like_sel.mjs";import{CommentMedia as d}from"./comment-media.mjs";import{CommentRichText as f}from"./comment-rich-text.mjs";import{TimeDisplay as p}from"./time-display.mjs";import{memo as m}from"react";import{jsx as h,jsxs as g}from"react/jsx-runtime";import{useTranslations as _}from"next-intl";import v from"next/link";function y(e){let t=Number(e)||0;return t>=1e4?`${(t/1e4).toFixed(1)}w`:t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}const b=m(({comment:m,isHighlight:b,onReply:x,onViewReplies:S,onReplyAction:C,onLike:w,onDislike:T,onRequireLogin:E,variant:D=`dark`,rightSlot:O,showReplyButton:k=!0,isLogin:A=!0})=>{let j=_(`components.biz.business.comment`),M=D===`light`,N=m.status===`0`,P=i();function F(){E?.()}function I(){if(!A){F();return}P.trigger(a.likeShakeAnimation),w?.(m)}function L(){if(!A){F();return}T?.(m)}function R(){if(!A){F();return}if(!x){F();return}x(m)}function z(){if(!A){F();return}S?.(m)}function B(){if(!A){F();return}if(C){C(m);return}if(+m.reply_cnt==0){R();return}z()}function V(){return m.reply_cnt===`0`?j(`commentItem.reply`):j(`commentItem.replyCount`,{count:m.reply_cnt})}return g(`div`,{className:e(`flex flex-col p-[16px] relative`,M?`text-text1`:`text-white`),children:[b&&h(c,{className:`w-[70px] h-[70px] absolute top-0 right-[80px]`}),g(`div`,{className:`flex flex-row justify-between relative z-[2]`,children:[g(v,{className:`flex flex-row items-center`,href:`/profile/${m.user_id}`,children:[h(t,{children:h(n,{src:m.avatar,alt:m.user_name})}),g(`div`,{className:`ml-[12px] flex flex-col min-w-0`,children:[h(`span`,{className:e(`text-[14px] leading-[14px] max-w-[180px] text-ellipsis overflow-hidden whitespace-nowrap`,M?`text-text2`:`text-white/80`),children:m.user_name}),h(`span`,{className:e(`mt-[8px] text-[12px] leading-[12px]`,M?`text-text3`:`text-white/50`),children:h(p,{timestamp:m.created_at})})]})]}),N?h(`div`,{className:`px-[8px] py-[4px] bg-text3/10 rounded-[12px]`,children:h(`span`,{className:e(`text-[12px] leading-[12px]`,M?`text-text3`:`text-white/60`),children:j(`commentItem.contentInReview`)})}):O||g(`div`,{className:`flex flex-row items-center`,children:[g(`button`,{type:`button`,className:`px-[4px] flex flex-col items-center`,onClick:I,children:[m.like_flag===`1`?h(s,{className:e(`w-[14px] h-[14px]`,P.animationClass)}):h(o,{className:e(`w-[14px] h-[14px]`,M?`text-text3`:`text-white/70`,P.animationClass)}),h(`span`,{className:e(`mt-[4px] text-[12px] leading-[12px]`,M?`text-text3`:`text-white/70`),children:m.like_cnt===`0`?j(`commentItem.like`):y(m.like_cnt)})]}),g(`button`,{type:`button`,className:`ml-[12px] px-[4px] flex flex-col items-center`,onClick:L,children:[m.like_flag===`2`?h(u,{className:`w-[14px] h-[14px]`}):h(l,{className:e(`w-[14px] h-[14px]`,M?`text-text3`:`text-white/70`)}),h(`span`,{className:e(`mt-[4px] text-[12px] leading-[12px]`,M?`text-text3`:`text-white/70`),children:m.dislike_cnt===`0`?j(`commentItem.dislike`):y(m.dislike_cnt)})]})]})]}),g(`div`,{className:`mt-[4px] pl-[50px] flex flex-col`,children:[m.text&&h(f,{className:e(`text-[14px] leading-[22px] break-all`,M?`text-text1`:`text-white/90`),text:m.text,atUsers:m.at_users}),h(d,{list:m.nine_grid_content_info,disabled:N,hasText:!!m.text,playerId:m.id}),k&&g(`button`,{type:`button`,className:e(`mt-[4px] w-[fit-content] h-[30px] px-[12px] text-[14px] leading-[22px] flex flex-row items-center rounded-[15px]`,M?`text-text1 bg-bg2`:`text-white bg-white/10`),onClick:B,children:[h(`span`,{children:V()}),m.reply_cnt!==`0`&&h(r,{className:`w-[10px] h-[10px] ml-[2px]`})]})]})]})});export{b as CommentItem};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{cn as e}from"../../../../utils/cn.mjs";import{debounceFun as t,getCurrentSecondTime as n,parseTextAtUserIds as r,replaceAtUserElement as i}from"../../../../utils/common.mjs";import{useUserStore as a}from"../../../../store/modules/user-store.mjs";import{gCommunityGetComments as o,pCommunityCreateComment as s,pCommunityDislikeComment as c,pCommunityLikeComment as l}from"../../../../service/generated/client.mjs";import{Box as u}from"../../../ui/box.mjs";import{InfiniteScroll as ee}from"../../../ui/infinite-scroll.mjs";import{Text as d}from"../../../ui/text.mjs";import{useDeleteRequest as te}from"../../../../hooks/query/use-query.mjs";import{useLoginModalStore as ne}from"../../../../store/modules/login-modal-store.mjs";import{useLikeDislike as re}from"../../../../hooks/use-like-dislike.mjs";import{useKeepAliveEffect as ie,useKeepAliveState as f}from"../../../common/keep-scroll-position/index.mjs";import{isMobileIOS as ae}from"../../../../utils/tools.mjs";import{MediaPreview as oe}from"../../../common/media-preview/index.mjs";import{mapApiCommentToComment as p}from"../../../../types/safe-comment.mjs";import se from"../../../../assets/icons/common/solid-arrow.mjs";import ce from"./comment-input.mjs";import{CommentItem as le}from"./comment-item.mjs";import ue from"./reply-detail.mjs";import{memo as m,useCallback as h,useEffect as de,useMemo as g,useRef as fe,useState as pe}from"react";import{Fragment as me,jsx as _,jsxs as v}from"react/jsx-runtime";import{toast as he}from"sonner";import{useTranslations as ge}from"next-intl";const _e=t(e=>{e()},0),ve=t(e=>{e()},10),ye=t(e=>{try{l({comment_id:e.id,is_like:e.like_flag!==`1`},{revalidate:!1})}catch(e){console.error(`点赞评论失败:`,e)}},200),be=t(e=>{try{c({comment_id:e.id,is_dislike:e.like_flag!==`2`},{revalidate:!1})}catch(e){console.error(`点踩评论失败:`,e)}},200);function xe(e){if(e==null)return 0;let t=typeof e==`number`?e:Number(e);if(!Number.isNaN(t)&&t>0)return t>0xe8d4a51000?Math.floor(t/1e3):Math.floor(t);let n=Date.parse(String(e));return Number.isNaN(n)?0:Math.floor(n/1e3)}function y(e,t,n){let r=[];return Array.isArray(n)&&n.length>0?(n.forEach(e=>{let t=!!e?.is_video,n=String(e?.media_url||``),i=String(e?.cover_image||``);!n&&!i||r.push({cover_image:i,cover_image_thumbnail:i,cover_image_radio:1,cover_image_resolution:String(e?.cover_image_resolution||``),image_url:t?``:n,image_thumbnail:t?``:n,image_radio:1,image_resolution:String(e?.image_resolution||``),is_video:t,resolution:String(e?.video_resolution||``),video_duration:Number(e?.video_duration||0),video_url:t?n:``,video_size:Number(e?.video_size||0),video_codec_info:{hls_info:[],video_codec_deal:!1}})}),r):(e?.length&&e.forEach(e=>{r.push({cover_image:``,cover_image_thumbnail:``,cover_image_radio:1,cover_image_resolution:``,image_url:e,image_thumbnail:e,image_radio:1,image_resolution:``,is_video:!1,resolution:``,video_duration:0,video_url:``,video_size:0,video_codec_info:{hls_info:[],video_codec_deal:!1}})}),t?.length&&t.forEach(e=>{r.push({cover_image:``,cover_image_thumbnail:``,cover_image_radio:1,cover_image_resolution:``,image_url:``,image_thumbnail:``,image_radio:1,image_resolution:``,is_video:!0,resolution:``,video_duration:0,video_url:e,video_size:0,video_codec_info:{hls_info:[],video_codec_deal:!1}})}),r)}function Se(e){let t=typeof e.reply_count==`number`?e.reply_count:0,n=Array.isArray(e.sub_comments)?e.sub_comments.length:0,r=t>0?t:n,i=e.is_liked?`1`:e.is_dislike?`2`:`0`,a=b(e.mentioned_users),o=a.length>0?a:Ce(e.content||``),s=String(e.comment_id??e.id??``),c=typeof e.like_count==`number`?e.like_count:0,l=e.is_liked&&c===0?1:c;return p({id:s,reply_cnt:r.toString(),like_cnt:l,dislike_cnt:0,created_at:xe(e.create_time),text:e.content||``,type:`4`,like_flag:i,user_id:e.user_id||``,user_name:e.user?.nickname||e.user?.username||``,avatar:e.user?.avatar_url||``,files:[],at_users:o,nine_grid_content_info:y(e?.images,e?.videos,e?.medias),is_follow:!1})}function b(e){return Array.isArray(e)?e.map(e=>({user_id:e.user_id||``,name:e.nickname||e.username||``,avatar:e.avatar_url||``,birthday:``,signature:e.signature||``})):[]}function Ce(e){if(!e)return[];let t=new Map,n=/<span[^>]*class=['"]mention['"][^>]*data-id=['"]([^'"]+)['"][^>]*>@([^<]*)<\/span>/g,r;for(;(r=n.exec(e))!==null;){let e=r[1]?String(r[1]):``,n=(r[2]?String(r[2]):``).replace(/^@/,``)||e;!e||t.has(e)||t.set(e,{user_id:e,name:n,avatar:``,birthday:``,signature:``})}if(t.size>0)return Array.from(t.values());let i=/<@_user>(\w+)<\/@_user>/g;for(;(r=i.exec(e))!==null;){let e=r[1]?String(r[1]):``;!e||t.has(e)||t.set(e,{user_id:e,name:e,avatar:``,birthday:``,signature:``})}return Array.from(t.values())}function we(e){return!Array.isArray(e)||e.length===0?[]:e.map(e=>{let t=!!e.is_video,n=t?String(e.video_url||``):String(e.image_url||e.cover_image||``),r=String(e.cover_image||e.image_url||``);return{media_url:n,is_video:t,image_resolution:String(e.image_resolution||``),cover_image:r,cover_image_resolution:String(e.cover_image_resolution||``),video_resolution:String(e.resolution||``),video_duration:Number(e.video_duration||0),video_size:Number(e.video_size||0)}}).filter(e=>!!e.media_url)}const x=m(({information:t,listQueryKey:c,contentId:l,contentType:m,isShow:xe=!0,isClickLoad:y=!1,initialComments:b,initialTotal:x,initialHasMore:S,addCommentCount:Te,onCommentAdded:Ee,onRequireLogin:C,onTotalChange:w,onReplyDetailVisibleChange:T,className:De})=>{let{userInfo:E,userId:Oe,isLogin:D}=a(),{open:ke}=ne(),O=ge(`components.biz.business.comment`),Ae=Te??Ee??(()=>{});function je(e){if(!e)return``;if(Array.isArray(e))return String(e[0]||``);if(typeof e==`object`){if(Object.prototype.hasOwnProperty.call(e,`comment_id`))return String(e.comment_id??``);if(Array.isArray(e.data))return String(e.data[0]||``)}return``}let k=h(()=>{C?C():ke()},[C,ke]),A=y?5:20,j=g(()=>b?.length?b.map(Se):[],[b]),M=b!==void 0||typeof x==`number`||typeof S==`boolean`,Me=g(()=>typeof S==`boolean`?S:typeof x==`number`?j.length<x:M?j.length===0?!1:j.length>=A:!0,[M,S,j.length,x,A]),[N,P]=f(`info-detail-comment-list-${l}`,j),[F,I]=f(`info-detail-comment-list-has-more-${l}`,Me),[L,Ne]=f(`info-comment-detail-page-${l}`,j.length>0?2:1),[Pe,R]=f(`info-detail-comment-list-loading-${l}`,!1),[z,B]=f(`info-detail-selected-comment-${l}`,p({id:``,user_id:``})),[V,H]=f(`info-detail-reply-detail-visible-${l}`,!1),[U,W]=pe(!1),G=fe(null),K=h(e=>{typeof window>`u`||window.dispatchEvent(new CustomEvent(`funhub:comment-reply-detail-visible-change`,{detail:{visible:e}}))},[]);de(()=>{K(V),T?.(V)},[K,T,V]),de(()=>()=>{K(!1),T?.(!1)},[K,T]);let q=g(()=>Pe||F&&N.length===0?O(`commentList.loading`):N.length>0&&!F?O(`commentList.noMore`):N.length===0&&!F?O(`commentList.emptyPrompt`):``,[N.length,F,Pe,O]),Fe=g(()=>U?`回复@${z.user_name}`:``,[U,z.user_name]),{getLikedListData:Ie,getDislikedListData:J}=re(),Le=h(()=>{P(e=>e.map(e=>e.id===z.id?{...e,reply_cnt:(Number(e.reply_cnt||0)+1).toString()}:e)),B(e=>({...e,reply_cnt:(Number(e.reply_cnt||0)+1).toString()}))},[z.id,P,B]),Y=h(async()=>{if(l)try{let e=await o({content_id:l,page:L,page_size:A,sort_by:`latest`});if(e.code!==0)throw Error(e.message||O(`commentList.fetchCommentsFailed`));let t=(e.data?.data?.comments??[]).map(Se),n=e.data?.data?.total??0;L===1&&w&&w(n),((e.data?.data?.has_more??!1)===!1||t.length<A)&&I(!1),P(e=>{let n=new Set(e.map(e=>e.id)),r=t.filter(e=>!n.has(e.id));return[...e,...r]}),Ne(L+1)}catch(e){console.error(`获取评论列表失败:`,e),I(!1)}},[l,L,A,P,I,Ne]),X=h(async()=>{R(!0);try{await Y()}catch(e){console.error(`获取评论列表失败:`,e)}R(!1)},[Y,R]);ie(()=>{y&&!M&&X()},[M,y,X],`info-detail-comment-initial-load-more-${l}`),ie(()=>{!M||!w||typeof x==`number`&&w(x)},[M,x,w],`info-detail-comment-initial-total-${l}`);function Re(){_e(()=>{W(!1)})}async function ze({text:e,imageVideoInfoList:t}){try{if(!D)return k(),{success:!1,message:O(`commentList.loginRequired`)};let a=E?.userId||E?.user_id||Oe||``;if(!a)return k(),{success:!1,message:O(`commentList.loginRequired`)};let o=E?.nick_name||E?.nickname||E?.name||E?.user_name||E?.username||``,c=E?.avatar||E?.avatar_url||``,u=we(t),ee=r(e),d=await s({content_id:l,content:i(e),medias:u,mentioned_users:ee,source_type:m===`video`?1:2},{revalidate:!1});if(d.code===0){let r=je(d.data);if(!r||r===`0`)return{success:!1,message:O(`commentList.publishCommentFailed`)};let i=Ce(e),s=p({text:e,id:r,avatar:c,user_id:a,user_name:o,like_cnt:d.data.like_count,created_at:n(),nine_grid_content_info:t,at_users:i});return P(e=>[s,...e]),{success:!0}}else return{success:!1,message:d.message||O(`commentList.publishCommentFailed`)}}catch(e){return console.error(e),{success:!1,message:O(`commentList.publishCommentFailed`)}}}let Z=h(async({text:e,imageVideoInfoList:t,callback:n})=>{try{if(!D)return k(),{success:!1,message:O(`commentList.loginRequired`)};if(!z?.id||z.id===`0`)return{success:!1,message:O(`commentList.invalidReplyTarget`)};let a=we(t),o=r(e),c=await s({content_id:l,content:i(e),medias:a,mentioned_users:o,parent_id:z.id,source_type:m===`video`?1:2},{revalidate:!1});if(c.code!==0)return{success:!1,message:c.message||O(`commentList.publishReplyFailed`)};P(e=>e.map(e=>e.id===z.id?{...e,reply_cnt:(Number(e.reply_cnt)+1).toString()}:e));let u=je(c.data);return!u||u===`0`?{success:!1,message:O(`commentList.publishReplyFailed`)}:(n?.(u),{success:!0})}catch(e){return console.error(`发布回复评论失败:`,e),{success:!1,message:O(`commentList.publishReplyFailed`)}}},[l,m,D,k,z.id,P,O]);async function Be({text:e,imageVideoInfoList:t}){let n=e=>e.success?e:(he.error(e.message||O(`commentList.publishCommentFailed`)),{...e,toastHandled:!0});if(U){let r=await Z({text:e,imageVideoInfoList:t,callback:e=>{}});return W(!1),n(r)}else{let r=await ze({text:e,imageVideoInfoList:t});return r.success&&Ae(),W(!1),n(r)}}let Q=h(e=>{B(e),ae()&&G.current?.focus(),ve(()=>{W(!0),G.current?.focus()})},[B]),$=h(e=>{B(e),H(!0)},[H,B]),Ve=h(e=>{if(e.reply_cnt===`0`){Q(e);return}$(e)},[Q,$]),He=h(e=>{if(!D){C?.();return}P(Ie(N,e.id)),ye(e)},[N,Ie,D,C,P]),Ue=h(e=>{if(!D){C?.();return}e.like_flag!==`2`&&he.message(O(`commentList.dislikeHint`)),P(J(N,e.id)),be(e)},[N,J,D,C,P,O]),We=te();function Ge(){c&&We(c),H(!1)}return v(me,{children:[v(u,{className:e(`w-full pb-[60px]`,De),children:[N.map((e,t)=>_(le,{comment:e,onReply:Q,onViewReplies:$,onReplyAction:Ve,onLike:He,onDislike:Ue,isLogin:D,onRequireLogin:k},`${e.id}-${t}-comment`)),xe&&_(ee,{loadMore:async()=>{await Y()},hasMore:F,initialLoad:!y&&N.length===0&&F!==!1}),y&&v(u,{className:`w-full my-[8px]`,children:[!q&&v(u,{className:`w-[fit-content] h-[42px] flex items-center justify-center mx-[auto]`,onClick:()=>{X()},children:[_(d,{className:`text-text3 text-[14px]`,children:O(`commentList.viewMore`)}),_(se,{className:`w-[8px] h-[auto] ml-[4px] text-text3`})]}),q&&_(u,{className:`w-full h-[42px] flex items-center justify-center`,children:_(d,{className:`text-text3 text-[12px]`,children:q})})]}),_(ce,{placeholder:Fe,onPublish:({text:e,imageVideoInfoList:t})=>Be({text:e,imageVideoInfoList:t}),onInputBlur:Re,onRequireLogin:k,ref:G})]}),_(ue,{visible:V,comment:z,information:t,contentType:m,onClose:Ge,onReplyComment:Z,onReplyAdded:Le,onRequireLogin:k},z.id),_(oe,{})]})});export{x as default};
2
+ "use client";import{cn as e}from"../../../../utils/cn.mjs";import{debounceFun as t,getCurrentSecondTime as n,parseTextAtUserIds as r,replaceAtUserElement as i}from"../../../../utils/common.mjs";import{useUserStore as a}from"../../../../store/modules/user-store.mjs";import{gCommunityGetComments as o,pCommunityCreateComment as s,pCommunityDislikeComment as c,pCommunityLikeComment as l}from"../../../../service/generated/client.mjs";import{Box as u}from"../../../ui/box.mjs";import{InfiniteScroll as ee}from"../../../ui/infinite-scroll.mjs";import{Text as d}from"../../../ui/text.mjs";import{isMobileIOS as te}from"../../../../utils/tools.mjs";import{useLoginModalStore as ne}from"../../../../store/modules/login-modal-store.mjs";import{useDeleteRequest as re}from"../../../../hooks/query/use-query.mjs";import{useLikeDislike as ie}from"../../../../hooks/use-like-dislike.mjs";import{useKeepAliveEffect as ae,useKeepAliveState as f}from"../../../common/keep-scroll-position/index.mjs";import{MediaPreview as oe}from"../../../common/media-preview/index.mjs";import{mapApiCommentToComment as p}from"../../../../types/safe-comment.mjs";import se from"../../../../assets/icons/common/solid-arrow.mjs";import ce from"./comment-input.mjs";import{CommentItem as le}from"./comment-item.mjs";import ue from"./reply-detail.mjs";import{memo as m,useCallback as h,useEffect as de,useMemo as g,useRef as fe,useState as pe}from"react";import{Fragment as me,jsx as _,jsxs as v}from"react/jsx-runtime";import{toast as he}from"sonner";import{useTranslations as ge}from"next-intl";const _e=t(e=>{e()},0),ve=t(e=>{e()},10),ye=t(e=>{try{l({comment_id:e.id,is_like:e.like_flag!==`1`},{revalidate:!1})}catch(e){console.error(`点赞评论失败:`,e)}},200),be=t(e=>{try{c({comment_id:e.id,is_dislike:e.like_flag!==`2`},{revalidate:!1})}catch(e){console.error(`点踩评论失败:`,e)}},200);function xe(e){if(e==null)return 0;let t=typeof e==`number`?e:Number(e);if(!Number.isNaN(t)&&t>0)return t>0xe8d4a51000?Math.floor(t/1e3):Math.floor(t);let n=Date.parse(String(e));return Number.isNaN(n)?0:Math.floor(n/1e3)}function y(e,t,n){let r=[];return Array.isArray(n)&&n.length>0?(n.forEach(e=>{let t=!!e?.is_video,n=String(e?.media_url||``),i=String(e?.cover_image||``);!n&&!i||r.push({cover_image:i,cover_image_thumbnail:i,cover_image_radio:1,cover_image_resolution:String(e?.cover_image_resolution||``),image_url:t?``:n,image_thumbnail:t?``:n,image_radio:1,image_resolution:String(e?.image_resolution||``),is_video:t,resolution:String(e?.video_resolution||``),video_duration:Number(e?.video_duration||0),video_url:t?n:``,video_size:Number(e?.video_size||0),video_codec_info:{hls_info:[],video_codec_deal:!1}})}),r):(e?.length&&e.forEach(e=>{r.push({cover_image:``,cover_image_thumbnail:``,cover_image_radio:1,cover_image_resolution:``,image_url:e,image_thumbnail:e,image_radio:1,image_resolution:``,is_video:!1,resolution:``,video_duration:0,video_url:``,video_size:0,video_codec_info:{hls_info:[],video_codec_deal:!1}})}),t?.length&&t.forEach(e=>{r.push({cover_image:``,cover_image_thumbnail:``,cover_image_radio:1,cover_image_resolution:``,image_url:``,image_thumbnail:``,image_radio:1,image_resolution:``,is_video:!0,resolution:``,video_duration:0,video_url:e,video_size:0,video_codec_info:{hls_info:[],video_codec_deal:!1}})}),r)}function Se(e){let t=typeof e.reply_count==`number`?e.reply_count:0,n=Array.isArray(e.sub_comments)?e.sub_comments.length:0,r=t>0?t:n,i=e.is_liked?`1`:e.is_dislike?`2`:`0`,a=b(e.mentioned_users),o=a.length>0?a:Ce(e.content||``),s=String(e.comment_id??e.id??``),c=typeof e.like_count==`number`?e.like_count:0,l=e.is_liked&&c===0?1:c;return p({id:s,reply_cnt:r.toString(),like_cnt:l,dislike_cnt:0,created_at:xe(e.create_time),text:e.content||``,type:`4`,like_flag:i,user_id:e.user_id||``,user_name:e.user?.nickname||e.user?.username||``,avatar:e.user?.avatar_url||``,files:[],at_users:o,nine_grid_content_info:y(e?.images,e?.videos,e?.medias),is_follow:!1})}function b(e){return Array.isArray(e)?e.map(e=>({user_id:e.user_id||``,name:e.nickname||e.username||``,avatar:e.avatar_url||``,birthday:``,signature:e.signature||``})):[]}function Ce(e){if(!e)return[];let t=new Map,n=/<span[^>]*class=['"]mention['"][^>]*data-id=['"]([^'"]+)['"][^>]*>@([^<]*)<\/span>/g,r;for(;(r=n.exec(e))!==null;){let e=r[1]?String(r[1]):``,n=(r[2]?String(r[2]):``).replace(/^@/,``)||e;!e||t.has(e)||t.set(e,{user_id:e,name:n,avatar:``,birthday:``,signature:``})}if(t.size>0)return Array.from(t.values());let i=/<@_user>(\w+)<\/@_user>/g;for(;(r=i.exec(e))!==null;){let e=r[1]?String(r[1]):``;!e||t.has(e)||t.set(e,{user_id:e,name:e,avatar:``,birthday:``,signature:``})}return Array.from(t.values())}function we(e){return!Array.isArray(e)||e.length===0?[]:e.map(e=>{let t=!!e.is_video,n=t?String(e.video_url||``):String(e.image_url||e.cover_image||``),r=String(e.cover_image||e.image_url||``);return{media_url:n,is_video:t,image_resolution:String(e.image_resolution||``),cover_image:r,cover_image_resolution:String(e.cover_image_resolution||``),video_resolution:String(e.resolution||``),video_duration:Number(e.video_duration||0),video_size:Number(e.video_size||0)}}).filter(e=>!!e.media_url)}const x=m(({information:t,listQueryKey:c,contentId:l,contentType:m,isShow:xe=!0,isClickLoad:y=!1,initialComments:b,initialTotal:x,initialHasMore:S,addCommentCount:Te,onCommentAdded:Ee,onRequireLogin:C,onTotalChange:w,onReplyDetailVisibleChange:T,className:De})=>{let{userInfo:E,userId:Oe,isLogin:D}=a(),{open:ke}=ne(),O=ge(`components.biz.business.comment`),Ae=Te??Ee??(()=>{});function je(e){if(!e)return``;if(Array.isArray(e))return String(e[0]||``);if(typeof e==`object`){if(Object.prototype.hasOwnProperty.call(e,`comment_id`))return String(e.comment_id??``);if(Array.isArray(e.data))return String(e.data[0]||``)}return``}let k=h(()=>{C?C():ke()},[C,ke]),A=y?5:20,j=g(()=>b?.length?b.map(Se):[],[b]),M=b!==void 0||typeof x==`number`||typeof S==`boolean`,Me=g(()=>typeof S==`boolean`?S:typeof x==`number`?j.length<x:M?j.length===0?!1:j.length>=A:!0,[M,S,j.length,x,A]),[N,P]=f(`info-detail-comment-list-${l}`,j),[F,I]=f(`info-detail-comment-list-has-more-${l}`,Me),[L,Ne]=f(`info-comment-detail-page-${l}`,j.length>0?2:1),[Pe,R]=f(`info-detail-comment-list-loading-${l}`,!1),[z,B]=f(`info-detail-selected-comment-${l}`,p({id:``,user_id:``})),[V,H]=f(`info-detail-reply-detail-visible-${l}`,!1),[U,W]=pe(!1),G=fe(null),K=h(e=>{typeof window>`u`||window.dispatchEvent(new CustomEvent(`funhub:comment-reply-detail-visible-change`,{detail:{visible:e}}))},[]);de(()=>{K(V),T?.(V)},[K,T,V]),de(()=>()=>{K(!1),T?.(!1)},[K,T]);let q=g(()=>Pe||F&&N.length===0?O(`commentList.loading`):N.length>0&&!F?O(`commentList.noMore`):N.length===0&&!F?O(`commentList.emptyPrompt`):``,[N.length,F,Pe,O]),Fe=g(()=>U?`回复@${z.user_name}`:``,[U,z.user_name]),{getLikedListData:Ie,getDislikedListData:J}=ie(),Le=h(()=>{P(e=>e.map(e=>e.id===z.id?{...e,reply_cnt:(Number(e.reply_cnt||0)+1).toString()}:e)),B(e=>({...e,reply_cnt:(Number(e.reply_cnt||0)+1).toString()}))},[z.id,P,B]),Y=h(async()=>{if(l)try{let e=await o({content_id:l,page:L,page_size:A,sort_by:`latest`});if(e.code!==0)throw Error(e.message||O(`commentList.fetchCommentsFailed`));let t=(e.data?.data?.comments??[]).map(Se),n=e.data?.data?.total??0;L===1&&w&&w(n),((e.data?.data?.has_more??!1)===!1||t.length<A)&&I(!1),P(e=>{let n=new Set(e.map(e=>e.id)),r=t.filter(e=>!n.has(e.id));return[...e,...r]}),Ne(L+1)}catch(e){console.error(`获取评论列表失败:`,e),I(!1)}},[l,L,A,P,I,Ne]),X=h(async()=>{R(!0);try{await Y()}catch(e){console.error(`获取评论列表失败:`,e)}R(!1)},[Y,R]);ae(()=>{y&&!M&&X()},[M,y,X],`info-detail-comment-initial-load-more-${l}`),ae(()=>{!M||!w||typeof x==`number`&&w(x)},[M,x,w],`info-detail-comment-initial-total-${l}`);function Re(){_e(()=>{W(!1)})}async function ze({text:e,imageVideoInfoList:t}){try{if(!D)return k(),{success:!1,message:O(`commentList.loginRequired`)};let a=E?.userId||E?.user_id||Oe||``;if(!a)return k(),{success:!1,message:O(`commentList.loginRequired`)};let o=E?.nick_name||E?.nickname||E?.name||E?.user_name||E?.username||``,c=E?.avatar||E?.avatar_url||``,u=we(t),ee=r(e),d=await s({content_id:l,content:i(e),medias:u,mentioned_users:ee,source_type:m===`video`?1:2},{revalidate:!1});if(d.code===0){let r=je(d.data);if(!r||r===`0`)return{success:!1,message:O(`commentList.publishCommentFailed`)};let i=Ce(e),s=p({text:e,id:r,avatar:c,user_id:a,user_name:o,like_cnt:d.data.like_count,created_at:n(),nine_grid_content_info:t,at_users:i});return P(e=>[s,...e]),{success:!0}}else return{success:!1,message:d.message||O(`commentList.publishCommentFailed`)}}catch(e){return console.error(e),{success:!1,message:O(`commentList.publishCommentFailed`)}}}let Z=h(async({text:e,imageVideoInfoList:t,callback:n})=>{try{if(!D)return k(),{success:!1,message:O(`commentList.loginRequired`)};if(!z?.id||z.id===`0`)return{success:!1,message:O(`commentList.invalidReplyTarget`)};let a=we(t),o=r(e),c=await s({content_id:l,content:i(e),medias:a,mentioned_users:o,parent_id:z.id,source_type:m===`video`?1:2},{revalidate:!1});if(c.code!==0)return{success:!1,message:c.message||O(`commentList.publishReplyFailed`)};P(e=>e.map(e=>e.id===z.id?{...e,reply_cnt:(Number(e.reply_cnt)+1).toString()}:e));let u=je(c.data);return!u||u===`0`?{success:!1,message:O(`commentList.publishReplyFailed`)}:(n?.(u),{success:!0})}catch(e){return console.error(`发布回复评论失败:`,e),{success:!1,message:O(`commentList.publishReplyFailed`)}}},[l,m,D,k,z.id,P,O]);async function Be({text:e,imageVideoInfoList:t}){let n=e=>e.success?e:(he.error(e.message||O(`commentList.publishCommentFailed`)),{...e,toastHandled:!0});if(U){let r=await Z({text:e,imageVideoInfoList:t,callback:e=>{}});return W(!1),n(r)}else{let r=await ze({text:e,imageVideoInfoList:t});return r.success&&Ae(),W(!1),n(r)}}let Q=h(e=>{B(e),te()&&G.current?.focus(),ve(()=>{W(!0),G.current?.focus()})},[B]),$=h(e=>{B(e),H(!0)},[H,B]),Ve=h(e=>{if(e.reply_cnt===`0`){Q(e);return}$(e)},[Q,$]),He=h(e=>{if(!D){C?.();return}P(Ie(N,e.id)),ye(e)},[N,Ie,D,C,P]),Ue=h(e=>{if(!D){C?.();return}e.like_flag!==`2`&&he.message(O(`commentList.dislikeHint`)),P(J(N,e.id)),be(e)},[N,J,D,C,P,O]),We=re();function Ge(){c&&We(c),H(!1)}return v(me,{children:[v(u,{className:e(`w-full pb-[60px]`,De),children:[N.map((e,t)=>_(le,{comment:e,onReply:Q,onViewReplies:$,onReplyAction:Ve,onLike:He,onDislike:Ue,isLogin:D,onRequireLogin:k},`${e.id}-${t}-comment`)),xe&&_(ee,{loadMore:async()=>{await Y()},hasMore:F,initialLoad:!y&&N.length===0&&F!==!1}),y&&v(u,{className:`w-full my-[8px]`,children:[!q&&v(u,{className:`w-[fit-content] h-[42px] flex items-center justify-center mx-[auto]`,onClick:()=>{X()},children:[_(d,{className:`text-text3 text-[14px]`,children:O(`commentList.viewMore`)}),_(se,{className:`w-[8px] h-[auto] ml-[4px] text-text3`})]}),q&&_(u,{className:`w-full h-[42px] flex items-center justify-center`,children:_(d,{className:`text-text3 text-[12px]`,children:q})})]}),_(ce,{placeholder:Fe,onPublish:({text:e,imageVideoInfoList:t})=>Be({text:e,imageVideoInfoList:t}),onInputBlur:Re,onRequireLogin:k,ref:G})]}),_(ue,{visible:V,comment:z,information:t,contentType:m,onClose:Ge,onReplyComment:Z,onReplyAdded:Le,onRequireLogin:k},z.id),_(oe,{})]})});export{x as default};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{cn as e}from"../../../../utils/cn.mjs";import{debounceFun as t,getCurrentSecondTime as n,parseTextAtUserIds as r,replaceAtUserElement as i}from"../../../../utils/common.mjs";import{useUserStore as a}from"../../../../store/modules/user-store.mjs";import{gCommunityGetComments as o,pCommunityCreateComment as s,pCommunityDislikeComment as c,pCommunityLikeComment as l,pInteractionFollow as u,pInteractionUnfollow as d}from"../../../../service/generated/client.mjs";import{checkFollowStatus as f}from"../../../../utils/follow-service.mjs";import{Image as p}from"../../../ui/image.mjs";import{Dialog as m,DialogContent as h}from"../../../ui/dialog.mjs";import{InfiniteScroll as g}from"../../../ui/infinite-scroll.mjs";import{useLikeDislike as _}from"../../../../hooks/use-like-dislike.mjs";import{useKeepAliveState as v}from"../../../common/keep-scroll-position/index.mjs";import{useFollowIdsState as y}from"../../../../store/modules/follow-ids-store.mjs";import b from"../../../../assets/icons/close.mjs";import x from"../../../../assets/icons/common/follow_sel.mjs";import S from"../../../../assets/icons/common/follow_user.mjs";import{UnfollowConfirmDialog as C}from"../../../common/follow-button/unfollow-confirm-dialog.mjs";import w from"../../../../assets/icons/detail/give_like.mjs";import T from"../../../../assets/icons/detail/give_like_sel.mjs";import E from"./comment-input.mjs";import D from"../../../../assets/icons/detail/un_like.mjs";import O from"../../../../assets/icons/detail/un_like_sel.mjs";import{CommentMedia as k}from"./comment-media.mjs";import{CommentRichText as A}from"./comment-rich-text.mjs";import{TimeDisplay as j}from"./time-display.mjs";import{CommentItem as M}from"./comment-item.mjs";import{mapApiReplayToReplay as N}from"../../../../types/safe-replay.mjs";import{memo as P,useCallback as F,useEffect as I,useMemo as L,useRef as R,useState as z}from"react";import{Fragment as B,jsx as V,jsxs as H}from"react/jsx-runtime";import{toast as U}from"sonner";import{useTranslations as W}from"next-intl";import{useRouter as G}from"next/navigation";function K(e){if(e==null)return 0;let t=typeof e==`number`?e:Number(e);if(!Number.isNaN(t)&&t>0)return t>0xe8d4a51000?Math.floor(t/1e3):Math.floor(t);let n=Date.parse(String(e));return Number.isNaN(n)?0:Math.floor(n/1e3)}function q(e,t,n){let r=[];return Array.isArray(n)&&n.length>0?(n.forEach(e=>{let t=!!e?.is_video,n=String(e?.media_url||``),i=String(e?.cover_image||``);!n&&!i||r.push({cover_image:i,cover_image_thumbnail:i,cover_image_radio:1,cover_image_resolution:String(e?.cover_image_resolution||``),image_url:t?``:n,image_thumbnail:t?``:n,image_radio:1,image_resolution:String(e?.image_resolution||``),is_video:t,resolution:String(e?.video_resolution||``),video_duration:Number(e?.video_duration||0),video_url:t?n:``,video_size:Number(e?.video_size||0),video_codec_info:{hls_info:[],video_codec_deal:!1}})}),r):(e?.length&&e.forEach(e=>{r.push({cover_image:``,cover_image_thumbnail:``,cover_image_radio:1,cover_image_resolution:``,image_url:e,image_thumbnail:e,image_radio:1,image_resolution:``,is_video:!1,resolution:``,video_duration:0,video_url:``,video_size:0,video_codec_info:{hls_info:[],video_codec_deal:!1}})}),t?.length&&t.forEach(e=>{r.push({cover_image:``,cover_image_thumbnail:``,cover_image_radio:1,cover_image_resolution:``,image_url:``,image_thumbnail:``,image_radio:1,image_resolution:``,is_video:!0,resolution:``,video_duration:0,video_url:e,video_size:0,video_codec_info:{hls_info:[],video_codec_deal:!1}})}),r)}function J(e){let t=X(e.mentioned_users),n=t.length>0?t:Z(e.content||``);return{id:String(e.comment_id??e.id??``),user_name:e.user?.nickname||e.user?.username||``,text:e.content||``,type:`4`,files:[],at_users:n,cover_image:``,nine_grid_content_info:q(e?.images,e?.videos,e?.medias)}}function Y(e,t){let n=e.is_liked?`1`:e.is_dislike?`2`:`0`,r=X(e.mentioned_users),i=r.length>0?r:Z(e.content||``),a=String(e.comment_id??e.id??``),o=typeof e.like_count==`number`?e.like_count:0,s=N({id:a,like_cnt:(e.is_liked&&o===0?1:o).toString(),dislike_cnt:(e.dislike_count||0).toString(),created_at:K(e.create_time),text:e.content||``,type:`4`,like_flag:n,user_id:e.user_id||``,user_name:e.user?.nickname||e.user?.username||``,avatar:e.user?.avatar_url||``,reply_cnt:(e.reply_count||0).toString(),nine_grid_content_info:q(e?.images,e?.videos,e?.medias),at_users:i,parent_reply:void 0});return t&&(s.parent_reply=J(t)),s}function X(e){return Array.isArray(e)?e.map(e=>({user_id:e.user_id||``,name:e.nickname||e.username||``,avatar:e.avatar_url||``,birthday:``,signature:e.signature||``})):[]}function Z(e){if(!e)return[];let t=new Map,n=/<span[^>]*class=['"]mention['"][^>]*data-id=['"]([^'"]+)['"][^>]*>@([^<]*)<\/span>/g,r;for(;(r=n.exec(e))!==null;){let e=r[1]?String(r[1]):``,n=(r[2]?String(r[2]):``).replace(/^@/,``)||e;!e||t.has(e)||t.set(e,{user_id:e,name:n,avatar:``,birthday:``,signature:``})}if(t.size>0)return Array.from(t.values());let i=/<@_user>(\w+)<\/@_user>/g;for(;(r=i.exec(e))!==null;){let e=r[1]?String(r[1]):``;!e||t.has(e)||t.set(e,{user_id:e,name:e,avatar:``,birthday:``,signature:``})}return Array.from(t.values())}function ee(e){return!Array.isArray(e)||e.length===0?[]:e.map(e=>{let t=!!e.is_video,n=t?String(e.video_url||``):String(e.image_url||e.cover_image||``),r=String(e.cover_image||e.image_url||``);return{media_url:n,is_video:t,image_resolution:String(e.image_resolution||``),cover_image:r,cover_image_resolution:String(e.cover_image_resolution||``),video_resolution:String(e.resolution||``),video_duration:Number(e.video_duration||0),video_size:Number(e.video_size||0)}}).filter(e=>!!e.media_url)}function Q(e,t){let n=[];return e.forEach(e=>{n.push(Y(e,t)),e.sub_comments?.length&&n.push(...Q(e.sub_comments,e))}),n}function $(e){let t=Number(e)||0;return t>=1e4?`${(t/1e4).toFixed(1)}w`:t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}const te=t((e,t,n)=>{try{if(!e?.id)return;l({comment_id:e.id,is_like:e.like_flag!==`1`},{revalidate:!1})}catch(e){console.error(`点赞回复失败:`,e)}},200),ne=t((e,t,n)=>{try{if(!e?.id)return;c({comment_id:e.id,is_dislike:e.like_flag!==`2`},{revalidate:!1})}catch(e){console.error(`点踩回复失败:`,e)}},200),re=P(({comment:e,updateFollow:t,onRequireLogin:n})=>{let{userInfo:r,userId:i,isLogin:o}=a(),s=r?.userId||r?.user_id||i||``;return V(`div`,{className:`w-full bg-bg1`,children:V(M,{comment:e,variant:`light`,isLogin:o,onRequireLogin:n,rightSlot:L(()=>!!s&&String(s)===String(e.user_id||``),[e.user_id,s])?V(B,{}):V(ie,{userId:e.user_id,hasFollow:e.is_follow,onChange:t,onRequireLogin:n}),showReplyButton:!1})})});function ie({userId:t,hasFollow:n=!1,onChange:r,onRequireLogin:i}){let o=W(`components.biz.business.comment`),{isLogin:s,userInfo:c,userId:l}=a(),{followIds:f}=y(),[p,m]=z(n),[h,g]=z(!1),_=c?.userId||c?.user_id||l||``,v=L(()=>!!_&&String(_)===String(t||``),[t,_]),b=L(()=>n||f.includes(t),[f,n,t]);I(()=>{m(b)},[b]);let w=F(async()=>{try{if(!_||!t||t===`0`){U.error(o(`replyDetail.loginRequired`));return}if(p){let e=await d({follower_id:String(_),followee_id:t});if(e.code!==0){U.error(e.message||o(`replyDetail.unfollowFailed`));return}}else{let e=await u({follower_id:String(_),followee_id:t});if(e.code!==0){U.error(e.message||o(`replyDetail.followFailed`));return}}window.sensors?.track(`detail_follow_click`,{object_id:``,action:p?`取消关注`:`关注`,author_id:t}),sessionStorage.setItem(`user_page_refresh`,`1`)}catch(e){console.error(`关注或取消关注失败:`,e),U.error(o(p?`replyDetail.unfollowFailed`:`replyDetail.followFailed`));return}let e=!p;r?.(e),m(e);let{followIds:n,setFollowIds:i}=y.getState(),a=new Set(n);e?a.add(t):a.delete(t),i(Array.from(a))},[t,p,r,_,o]),T=F(()=>{if(!s){i?.();return}if(p){g(!0);return}w()},[w,p,s,i]);function E(){g(!1),w()}function D(){g(!1)}return v||!t||t===`0`?null:H(B,{children:[V(`div`,{className:e(`h-[28px] rounded-[14px] px-[8px] border border-solid cursor-pointer flex items-center justify-center`,p?`border-text3`:`border-theme5`),onClick:T,children:p?H(B,{children:[V(x,{className:`w-[12px] h-[12px] text-text3 shrink-0`}),V(`span`,{className:`text-text3 text-[12px] leading-[18px] ml-[4px] shrink-0`,children:o(`replyDetail.followed`)})]}):H(B,{children:[V(S,{className:`block w-[12px] h-[12px] text-theme5 shrink-0`}),V(`span`,{className:`block text-theme5 text-[12px] leading-[18px] ml-[4px] shrink-0`,children:o(`replyDetail.follow`)})]})}),V(C,{open:h,onOpenChange:g,onCancel:D,onConfirm:E})]})}const ae=t(e=>{e()},0);function oe(e,t,n,r){let i=R(!1);I(()=>{i.current=!1},[r]),I(()=>{let r=e.current;if(!r)return;!i.current&&t>0&&(r.scrollTop=t,i.current=!0);let a=()=>{i.current=!0,n(r.scrollTop)};return r.addEventListener(`scroll`,a,{passive:!0}),()=>r.removeEventListener(`scroll`,a)},[e,n,t,r])}const se=P(({commentId:e,informationId:t,handleReplyComment:n,onReplyListUpdate:r})=>{let i=W(`components.biz.business.comment`),[a,s]=v(`replay-detail-list-${e}`,[]),[c,l]=v(`replay-detail-has-more-${e}`,!0),[u,d]=v(`replay-detail-page-${e}`,1),{getLikedListData:f,getDislikedListData:p}=_(),m=R(!1),h=F(async()=>{if(!(!e||!t)&&!m.current){m.current=!0;try{let n=await o({content_id:t,parent_id:e,page:u,page_size:20,sort_by:`latest`});if(n.code!==0)throw Error(n.message||i(`replyDetail.fetchRepliesFailed`));let r=n.data?.data?.comments??[],a=Q(r);((n.data?.data?.has_more??!1)===!1||r.length<20)&&l(!1),s(e=>{let t=new Set(e.map(e=>e.id)),n=a.filter(e=>!t.has(e.id));return[...e,...n]}),a.length>0&&d(u+1)}catch(e){console.error(`获取回复列表失败:`,e),l(!1)}finally{m.current=!1}}},[e,t,u,s,l,d,i]),y=F(e=>{s(t=>[e,...t])},[s]);I(()=>{r(y)},[r,y]),I(()=>{e&&t&&(s(e=>e.length===0?e:[]),l(e=>e===!0?e:!0),d(e=>e===1?e:1))},[e,t,s,l,d]);let b=F(n=>{s(e=>f(e,n.id)),te(n,t,e)},[e,f,t,s]),x=F(n=>{n.like_flag!==`2`&&U.message(i(`replyDetail.dislikeHint`)),s(e=>p(e,n.id)),ne(n,t,e)},[e,p,t,s,i]),[S,C]=v(`replay-detail-scroll-top-${e}`,0),w=R(null);oe(w,S,C,e),I(()=>{!e||!t||a.length===0&&c&&h()},[e,t,h,a.length,c]);let T=F(async()=>{await h()},[h]);return H(`div`,{ref:w,className:`w-full pb-[66px]`,children:[a.map((e,t)=>V(ce,{replyItem:e,replyComment:n,onLikeReply:b,onDislikeReply:x},`${e.id}-${t}`)),V(g,{loadMore:T,hasMore:c})]})});function ce({replyItem:e,replyComment:t,onLikeReply:n,onDislikeReply:r}){let i=W(`components.biz.business.comment`),a=G(),o=e.status===`0`;function s(){n?.(e)}function c(){r?.(e)}function l(){t(e)}return H(`div`,{className:`p-[16px] flex flex-col`,children:[H(`div`,{className:`flex flex-row justify-between`,children:[H(`button`,{type:`button`,className:`flex flex-row items-center text-left`,onClick:()=>{a.push(`/profile/${e.user_id}`)},children:[V(`div`,{className:`w-[38px] h-[38px] rounded-full overflow-hidden relative bg-bg2`,children:e.avatar&&V(p,{src:e.avatar,fill:!0,objectFit:`cover`,alt:`avatar`})}),H(`div`,{className:`ml-[12px] flex flex-col`,children:[V(`span`,{className:`text-text2 text-[14px] leading-[14px] max-w-[180px] text-ellipsis overflow-hidden whitespace-nowrap`,children:e.user_name}),V(`span`,{className:`mt-[8px] text-text3 text-[12px] leading-[12px]`,children:V(j,{timestamp:e.created_at})})]})]}),o?V(`div`,{className:`px-[8px] py-[4px] bg-text3/10 rounded-[12px]`,children:V(`span`,{className:`text-text3 text-[12px] leading-[12px]`,children:i(`replyDetail.underReview`)})}):H(`div`,{className:`flex flex-row items-center`,children:[H(`div`,{className:`px-[4px] flex flex-col items-center`,onClick:s,children:[e.like_flag===`1`?V(T,{className:`w-[14px] h-[14px]`}):V(w,{className:`w-[14px] h-[14px] text-text3`}),V(`span`,{className:`mt-[4px] text-text3 text-[12px] leading-[12px]`,children:e.like_cnt===`0`?i(`replyDetail.like`):$(e.like_cnt)})]}),H(`div`,{className:`ml-[12px] px-[4px] flex flex-col items-center`,onClick:c,children:[e.like_flag===`2`?V(O,{className:`w-[14px] h-[14px]`}):V(D,{className:`w-[14px] h-[14px] text-text3`}),V(`span`,{className:`mt-[4px] text-text3 text-[12px] leading-[12px]`,children:e.dislike_cnt===`0`?i(`replyDetail.dislike`):$(e.dislike_cnt)})]})]})]}),H(`div`,{className:`mt-[4px] pl-[50px] flex flex-col`,children:[e.text&&V(A,{className:`text-text1 text-[14px] leading-[22px] break-all`,text:e.text,atUsers:e.at_users}),V(k,{list:e.nine_grid_content_info,disabled:o,hasText:!!e.text,playerId:e.id}),e.parent_reply&&e.parent_reply.text&&H(B,{children:[H(`div`,{className:`mt-[4px] flex flex-row items-center text-[14px] leading-[22px] relative pl-[8px]`,children:[V(`div`,{className:`w-[2px] h-full bg-line1 mr-[8px] absolute left-0 top-0 bottom-0 m-auto`}),H(`span`,{className:`text-theme1`,children:[e.parent_reply.user_name,`:`,e.parent_reply.text&&V(`span`,{className:`text-text1`,children:V(A,{text:e.parent_reply.text,atUsers:e.parent_reply.at_users})})]})]}),V(`div`,{className:`mt-1`,children:V(k,{list:e.parent_reply.nine_grid_content_info,disabled:o,hasText:!!e.parent_reply.text,playerId:e.parent_reply.id})})]}),V(`div`,{className:`mt-[4px] w-[fit-content] h-[30px] px-[12px] text-text1 text-[14px] leading-[22px] flex flex-row items-center bg-bg1 rounded-[15px]`,onClick:l,children:V(`span`,{children:i(`replyDetail.reply`)})})]})]})}function le({comment:e,information:t,contentType:o,visible:c,onClose:l,onReplyComment:u,onReplyAdded:d,onRequireLogin:p}){let g=W(`components.biz.business.comment`),_=R(null),[v,x]=z(()=>N({})),[S,C]=z(!1),{userInfo:w,userId:T}=a(),{followIds:D,setFollowIds:O}=y(),k=w?.userId||w?.user_id||T||``,A=w?.name||w?.nick_name||w?.nickname||w?.user_name||``,j=w?.avatar||w?.avatar_url||``,M=R({commentId:``,userId:``});function P(e){if(!e)return``;if(Array.isArray(e))return String(e[0]||``);if(typeof e==`object`){if(Object.prototype.hasOwnProperty.call(e,`comment_id`))return String(e.comment_id??``);if(Array.isArray(e.data))return String(e.data[0]||``)}return``}I(()=>{c&&(!k||!e.user_id||e.user_id!==`0`&&String(k)!==String(e.user_id)&&(M.current.commentId===e.id&&M.current.userId===k||(M.current={commentId:e.id,userId:k},(async()=>{let t=await f({app_id:0,follower_id:k,followee_ids:[e.user_id]});if(!t.success||!t.data?.is_following_map)return;let n=!!t.data.is_following_map[e.user_id];e.is_follow=n;let r=new Set(D);n?r.add(e.user_id):r.delete(e.user_id),O(Array.from(r))})())))},[e,D,k,O,c]);let L=F(e=>{x(e),setTimeout(()=>{C(!0),_.current?.focus()},10)},[]);function B(){ae(()=>{C(!1)})}async function G({text:e,imageVideoInfoList:t}){let n=e=>e.success?e:(U.error(e.message||g(`replyDetail.publishReplyFailed`)),{...e,toastHandled:!0});if(S){let r=await q({text:e,imageVideoInfoList:t});return C(!1),n(r)}else{let r=await K({text:e,imageVideoInfoList:t});return C(!1),n(r)}}async function K({text:e,imageVideoInfoList:t}){return await u?.({text:e,imageVideoInfoList:t,callback:r=>{let i=Z(e);if(!r||r===`0`)return;let a=N({id:r,user_id:k,user_name:A,avatar:j,text:e,created_at:n(),type:`4`,nine_grid_content_info:t,at_users:i});J?.(a)}})??{success:!0}}async function q({text:e,imageVideoInfoList:a}){if(!v?.id||v.id===`0`)return{success:!1,message:g(`replyDetail.invalidReplyTarget`)};let c=ee(a),l=r(e),u=o===`video`?1:2;try{let r=await s({content_id:t.id,content:i(e),medias:c,mentioned_users:l,parent_id:v.id,source_type:u},{revalidate:!1});if(r.code!==0)return{success:!1,message:r.message||g(`replyDetail.publishReplyFailed`)};let o=P(r.data);if(!o||o===`0`)return{success:!1,message:g(`replyDetail.publishReplyFailed`)};let f=N({id:o,user_id:k,user_name:A,avatar:j,text:e,created_at:n(),type:`4`,nine_grid_content_info:a,at_users:Z(e)});return f.parent_reply=v,J?.(f),d?.(),{success:!0}}catch(e){return console.error(`发布回复回复失败:`,e),{success:!1,message:g(`replyDetail.publishReplyFailed`)}}}let[J,Y]=z(null),X=F(e=>{Y(()=>e)},[]),Q=S?`回复@${v.user_name}`:``;function $(e){e||l()}return V(m,{open:c,onOpenChange:$,children:H(h,{showCloseButton:!1,className:`fixed left-0 right-0 bottom-0 top-[84px] z-[1000] h-auto w-full max-w-none translate-x-0 translate-y-0 rounded-none bg-bg2 p-0 text-text1 !flex !flex-col !gap-0`,children:[H(`div`,{className:`w-full h-[60px] bg-bg1 flex items-center justify-center relative`,children:[V(`button`,{type:`button`,className:`w-[48px] focus-within:outline-none focus-within:border-none focus-within:ring-0 h-full flex items-center justify-center absolute left-0 top-0`,onClick:l,children:V(b,{className:`w-[16px] h-[16px] text-text1`})}),V(`span`,{className:`text-[18px] font-bold`,children:g(`replyDetail.commentDetail`)})]}),H(`div`,{className:`flex-1 min-h-0 w-full overflow-y-auto bg-bg2`,children:[V(re,{comment:e,updateFollow:t=>{e.is_follow=t},onRequireLogin:p}),V(se,{commentId:e.id,informationId:t.id,handleReplyComment:L,onReplyListUpdate:X}),V(E,{placeholder:Q,onInputBlur:B,onPublish:G,onRequireLogin:p,ref:_})]})]})})}export{le as default};
2
+ "use client";import{cn as e}from"../../../../utils/cn.mjs";import{debounceFun as t,getCurrentSecondTime as n,parseTextAtUserIds as r,replaceAtUserElement as i}from"../../../../utils/common.mjs";import{useFollowIdsState as a}from"../../../../store/modules/follow-ids-store.mjs";import{useUserStore as o}from"../../../../store/modules/user-store.mjs";import{gCommunityGetComments as s,pCommunityCreateComment as c,pCommunityDislikeComment as l,pCommunityLikeComment as u,pInteractionFollow as d,pInteractionUnfollow as f}from"../../../../service/generated/client.mjs";import{checkFollowStatus as p}from"../../../../utils/follow-service.mjs";import{Image as m}from"../../../ui/image.mjs";import{Dialog as h,DialogContent as g}from"../../../ui/dialog.mjs";import{InfiniteScroll as _}from"../../../ui/infinite-scroll.mjs";import v from"../../../../assets/icons/close.mjs";import{useLikeDislike as y}from"../../../../hooks/use-like-dislike.mjs";import{useKeepAliveState as b}from"../../../common/keep-scroll-position/index.mjs";import x from"../../../../assets/icons/common/follow_sel.mjs";import S from"../../../../assets/icons/common/follow_user.mjs";import{UnfollowConfirmDialog as C}from"../../../common/follow-button/unfollow-confirm-dialog.mjs";import w from"../../../../assets/icons/detail/give_like.mjs";import T from"../../../../assets/icons/detail/give_like_sel.mjs";import E from"./comment-input.mjs";import D from"../../../../assets/icons/detail/un_like.mjs";import O from"../../../../assets/icons/detail/un_like_sel.mjs";import{CommentMedia as k}from"./comment-media.mjs";import{CommentRichText as A}from"./comment-rich-text.mjs";import{TimeDisplay as j}from"./time-display.mjs";import{CommentItem as M}from"./comment-item.mjs";import{mapApiReplayToReplay as N}from"../../../../types/safe-replay.mjs";import{useRouter as P}from"next/navigation";import{memo as F,useCallback as I,useEffect as L,useMemo as R,useRef as z,useState as B}from"react";import{Fragment as V,jsx as H,jsxs as U}from"react/jsx-runtime";import{toast as W}from"sonner";import{useTranslations as G}from"next-intl";function K(e){if(e==null)return 0;let t=typeof e==`number`?e:Number(e);if(!Number.isNaN(t)&&t>0)return t>0xe8d4a51000?Math.floor(t/1e3):Math.floor(t);let n=Date.parse(String(e));return Number.isNaN(n)?0:Math.floor(n/1e3)}function q(e,t,n){let r=[];return Array.isArray(n)&&n.length>0?(n.forEach(e=>{let t=!!e?.is_video,n=String(e?.media_url||``),i=String(e?.cover_image||``);!n&&!i||r.push({cover_image:i,cover_image_thumbnail:i,cover_image_radio:1,cover_image_resolution:String(e?.cover_image_resolution||``),image_url:t?``:n,image_thumbnail:t?``:n,image_radio:1,image_resolution:String(e?.image_resolution||``),is_video:t,resolution:String(e?.video_resolution||``),video_duration:Number(e?.video_duration||0),video_url:t?n:``,video_size:Number(e?.video_size||0),video_codec_info:{hls_info:[],video_codec_deal:!1}})}),r):(e?.length&&e.forEach(e=>{r.push({cover_image:``,cover_image_thumbnail:``,cover_image_radio:1,cover_image_resolution:``,image_url:e,image_thumbnail:e,image_radio:1,image_resolution:``,is_video:!1,resolution:``,video_duration:0,video_url:``,video_size:0,video_codec_info:{hls_info:[],video_codec_deal:!1}})}),t?.length&&t.forEach(e=>{r.push({cover_image:``,cover_image_thumbnail:``,cover_image_radio:1,cover_image_resolution:``,image_url:``,image_thumbnail:``,image_radio:1,image_resolution:``,is_video:!0,resolution:``,video_duration:0,video_url:e,video_size:0,video_codec_info:{hls_info:[],video_codec_deal:!1}})}),r)}function J(e){let t=X(e.mentioned_users),n=t.length>0?t:Z(e.content||``);return{id:String(e.comment_id??e.id??``),user_name:e.user?.nickname||e.user?.username||``,text:e.content||``,type:`4`,files:[],at_users:n,cover_image:``,nine_grid_content_info:q(e?.images,e?.videos,e?.medias)}}function Y(e,t){let n=e.is_liked?`1`:e.is_dislike?`2`:`0`,r=X(e.mentioned_users),i=r.length>0?r:Z(e.content||``),a=String(e.comment_id??e.id??``),o=typeof e.like_count==`number`?e.like_count:0,s=N({id:a,like_cnt:(e.is_liked&&o===0?1:o).toString(),dislike_cnt:(e.dislike_count||0).toString(),created_at:K(e.create_time),text:e.content||``,type:`4`,like_flag:n,user_id:e.user_id||``,user_name:e.user?.nickname||e.user?.username||``,avatar:e.user?.avatar_url||``,reply_cnt:(e.reply_count||0).toString(),nine_grid_content_info:q(e?.images,e?.videos,e?.medias),at_users:i,parent_reply:void 0});return t&&(s.parent_reply=J(t)),s}function X(e){return Array.isArray(e)?e.map(e=>({user_id:e.user_id||``,name:e.nickname||e.username||``,avatar:e.avatar_url||``,birthday:``,signature:e.signature||``})):[]}function Z(e){if(!e)return[];let t=new Map,n=/<span[^>]*class=['"]mention['"][^>]*data-id=['"]([^'"]+)['"][^>]*>@([^<]*)<\/span>/g,r;for(;(r=n.exec(e))!==null;){let e=r[1]?String(r[1]):``,n=(r[2]?String(r[2]):``).replace(/^@/,``)||e;!e||t.has(e)||t.set(e,{user_id:e,name:n,avatar:``,birthday:``,signature:``})}if(t.size>0)return Array.from(t.values());let i=/<@_user>(\w+)<\/@_user>/g;for(;(r=i.exec(e))!==null;){let e=r[1]?String(r[1]):``;!e||t.has(e)||t.set(e,{user_id:e,name:e,avatar:``,birthday:``,signature:``})}return Array.from(t.values())}function ee(e){return!Array.isArray(e)||e.length===0?[]:e.map(e=>{let t=!!e.is_video,n=t?String(e.video_url||``):String(e.image_url||e.cover_image||``),r=String(e.cover_image||e.image_url||``);return{media_url:n,is_video:t,image_resolution:String(e.image_resolution||``),cover_image:r,cover_image_resolution:String(e.cover_image_resolution||``),video_resolution:String(e.resolution||``),video_duration:Number(e.video_duration||0),video_size:Number(e.video_size||0)}}).filter(e=>!!e.media_url)}function Q(e,t){let n=[];return e.forEach(e=>{n.push(Y(e,t)),e.sub_comments?.length&&n.push(...Q(e.sub_comments,e))}),n}function $(e){let t=Number(e)||0;return t>=1e4?`${(t/1e4).toFixed(1)}w`:t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}const te=t((e,t,n)=>{try{if(!e?.id)return;u({comment_id:e.id,is_like:e.like_flag!==`1`},{revalidate:!1})}catch(e){console.error(`点赞回复失败:`,e)}},200),ne=t((e,t,n)=>{try{if(!e?.id)return;l({comment_id:e.id,is_dislike:e.like_flag!==`2`},{revalidate:!1})}catch(e){console.error(`点踩回复失败:`,e)}},200),re=F(({comment:e,updateFollow:t,onRequireLogin:n})=>{let{userInfo:r,userId:i,isLogin:a}=o(),s=r?.userId||r?.user_id||i||``;return H(`div`,{className:`w-full bg-bg1`,children:H(M,{comment:e,variant:`light`,isLogin:a,onRequireLogin:n,rightSlot:R(()=>!!s&&String(s)===String(e.user_id||``),[e.user_id,s])?H(V,{}):H(ie,{userId:e.user_id,hasFollow:e.is_follow,onChange:t,onRequireLogin:n}),showReplyButton:!1})})});function ie({userId:t,hasFollow:n=!1,onChange:r,onRequireLogin:i}){let s=G(`components.biz.business.comment`),{isLogin:c,userInfo:l,userId:u}=o(),{followIds:p}=a(),[m,h]=B(n),[g,_]=B(!1),v=l?.userId||l?.user_id||u||``,y=R(()=>!!v&&String(v)===String(t||``),[t,v]),b=R(()=>n||p.includes(t),[p,n,t]);L(()=>{h(b)},[b]);let w=I(async()=>{try{if(!v||!t||t===`0`){W.error(s(`replyDetail.loginRequired`));return}if(m){let e=await f({follower_id:String(v),followee_id:t});if(e.code!==0){W.error(e.message||s(`replyDetail.unfollowFailed`));return}}else{let e=await d({follower_id:String(v),followee_id:t});if(e.code!==0){W.error(e.message||s(`replyDetail.followFailed`));return}}window.sensors?.track(`detail_follow_click`,{object_id:``,action:m?`取消关注`:`关注`,author_id:t}),sessionStorage.setItem(`user_page_refresh`,`1`)}catch(e){console.error(`关注或取消关注失败:`,e),W.error(s(m?`replyDetail.unfollowFailed`:`replyDetail.followFailed`));return}let e=!m;r?.(e),h(e);let{followIds:n,setFollowIds:i}=a.getState(),o=new Set(n);e?o.add(t):o.delete(t),i(Array.from(o))},[t,m,r,v,s]),T=I(()=>{if(!c){i?.();return}if(m){_(!0);return}w()},[w,m,c,i]);function E(){_(!1),w()}function D(){_(!1)}return y||!t||t===`0`?null:U(V,{children:[H(`div`,{className:e(`h-[28px] rounded-[14px] px-[8px] border border-solid cursor-pointer flex items-center justify-center`,m?`border-text3`:`border-theme5`),onClick:T,children:m?U(V,{children:[H(x,{className:`w-[12px] h-[12px] text-text3 shrink-0`}),H(`span`,{className:`text-text3 text-[12px] leading-[18px] ml-[4px] shrink-0`,children:s(`replyDetail.followed`)})]}):U(V,{children:[H(S,{className:`block w-[12px] h-[12px] text-theme5 shrink-0`}),H(`span`,{className:`block text-theme5 text-[12px] leading-[18px] ml-[4px] shrink-0`,children:s(`replyDetail.follow`)})]})}),H(C,{open:g,onOpenChange:_,onCancel:D,onConfirm:E})]})}const ae=t(e=>{e()},0);function oe(e,t,n,r){let i=z(!1);L(()=>{i.current=!1},[r]),L(()=>{let r=e.current;if(!r)return;!i.current&&t>0&&(r.scrollTop=t,i.current=!0);let a=()=>{i.current=!0,n(r.scrollTop)};return r.addEventListener(`scroll`,a,{passive:!0}),()=>r.removeEventListener(`scroll`,a)},[e,n,t,r])}const se=F(({commentId:e,informationId:t,handleReplyComment:n,onReplyListUpdate:r})=>{let i=G(`components.biz.business.comment`),[a,o]=b(`replay-detail-list-${e}`,[]),[c,l]=b(`replay-detail-has-more-${e}`,!0),[u,d]=b(`replay-detail-page-${e}`,1),{getLikedListData:f,getDislikedListData:p}=y(),m=z(!1),h=I(async()=>{if(!(!e||!t)&&!m.current){m.current=!0;try{let n=await s({content_id:t,parent_id:e,page:u,page_size:20,sort_by:`latest`});if(n.code!==0)throw Error(n.message||i(`replyDetail.fetchRepliesFailed`));let r=n.data?.data?.comments??[],a=Q(r);((n.data?.data?.has_more??!1)===!1||r.length<20)&&l(!1),o(e=>{let t=new Set(e.map(e=>e.id)),n=a.filter(e=>!t.has(e.id));return[...e,...n]}),a.length>0&&d(u+1)}catch(e){console.error(`获取回复列表失败:`,e),l(!1)}finally{m.current=!1}}},[e,t,u,o,l,d,i]),g=I(e=>{o(t=>[e,...t])},[o]);L(()=>{r(g)},[r,g]),L(()=>{e&&t&&(o(e=>e.length===0?e:[]),l(e=>e===!0?e:!0),d(e=>e===1?e:1))},[e,t,o,l,d]);let v=I(n=>{o(e=>f(e,n.id)),te(n,t,e)},[e,f,t,o]),x=I(n=>{n.like_flag!==`2`&&W.message(i(`replyDetail.dislikeHint`)),o(e=>p(e,n.id)),ne(n,t,e)},[e,p,t,o,i]),[S,C]=b(`replay-detail-scroll-top-${e}`,0),w=z(null);oe(w,S,C,e),L(()=>{!e||!t||a.length===0&&c&&h()},[e,t,h,a.length,c]);let T=I(async()=>{await h()},[h]);return U(`div`,{ref:w,className:`w-full pb-[66px]`,children:[a.map((e,t)=>H(ce,{replyItem:e,replyComment:n,onLikeReply:v,onDislikeReply:x},`${e.id}-${t}`)),H(_,{loadMore:T,hasMore:c})]})});function ce({replyItem:e,replyComment:t,onLikeReply:n,onDislikeReply:r}){let i=G(`components.biz.business.comment`),a=P(),o=e.status===`0`;function s(){n?.(e)}function c(){r?.(e)}function l(){t(e)}return U(`div`,{className:`p-[16px] flex flex-col`,children:[U(`div`,{className:`flex flex-row justify-between`,children:[U(`button`,{type:`button`,className:`flex flex-row items-center text-left`,onClick:()=>{a.push(`/profile/${e.user_id}`)},children:[H(`div`,{className:`w-[38px] h-[38px] rounded-full overflow-hidden relative bg-bg2`,children:e.avatar&&H(m,{src:e.avatar,fill:!0,objectFit:`cover`,alt:`avatar`})}),U(`div`,{className:`ml-[12px] flex flex-col`,children:[H(`span`,{className:`text-text2 text-[14px] leading-[14px] max-w-[180px] text-ellipsis overflow-hidden whitespace-nowrap`,children:e.user_name}),H(`span`,{className:`mt-[8px] text-text3 text-[12px] leading-[12px]`,children:H(j,{timestamp:e.created_at})})]})]}),o?H(`div`,{className:`px-[8px] py-[4px] bg-text3/10 rounded-[12px]`,children:H(`span`,{className:`text-text3 text-[12px] leading-[12px]`,children:i(`replyDetail.underReview`)})}):U(`div`,{className:`flex flex-row items-center`,children:[U(`div`,{className:`px-[4px] flex flex-col items-center`,onClick:s,children:[e.like_flag===`1`?H(T,{className:`w-[14px] h-[14px]`}):H(w,{className:`w-[14px] h-[14px] text-text3`}),H(`span`,{className:`mt-[4px] text-text3 text-[12px] leading-[12px]`,children:e.like_cnt===`0`?i(`replyDetail.like`):$(e.like_cnt)})]}),U(`div`,{className:`ml-[12px] px-[4px] flex flex-col items-center`,onClick:c,children:[e.like_flag===`2`?H(O,{className:`w-[14px] h-[14px]`}):H(D,{className:`w-[14px] h-[14px] text-text3`}),H(`span`,{className:`mt-[4px] text-text3 text-[12px] leading-[12px]`,children:e.dislike_cnt===`0`?i(`replyDetail.dislike`):$(e.dislike_cnt)})]})]})]}),U(`div`,{className:`mt-[4px] pl-[50px] flex flex-col`,children:[e.text&&H(A,{className:`text-text1 text-[14px] leading-[22px] break-all`,text:e.text,atUsers:e.at_users}),H(k,{list:e.nine_grid_content_info,disabled:o,hasText:!!e.text,playerId:e.id}),e.parent_reply&&e.parent_reply.text&&U(V,{children:[U(`div`,{className:`mt-[4px] flex flex-row items-center text-[14px] leading-[22px] relative pl-[8px]`,children:[H(`div`,{className:`w-[2px] h-full bg-line1 mr-[8px] absolute left-0 top-0 bottom-0 m-auto`}),U(`span`,{className:`text-theme1`,children:[e.parent_reply.user_name,`:`,e.parent_reply.text&&H(`span`,{className:`text-text1`,children:H(A,{text:e.parent_reply.text,atUsers:e.parent_reply.at_users})})]})]}),H(`div`,{className:`mt-1`,children:H(k,{list:e.parent_reply.nine_grid_content_info,disabled:o,hasText:!!e.parent_reply.text,playerId:e.parent_reply.id})})]}),H(`div`,{className:`mt-[4px] w-[fit-content] h-[30px] px-[12px] text-text1 text-[14px] leading-[22px] flex flex-row items-center bg-bg1 rounded-[15px]`,onClick:l,children:H(`span`,{children:i(`replyDetail.reply`)})})]})]})}function le({comment:e,information:t,contentType:s,visible:l,onClose:u,onReplyComment:d,onReplyAdded:f,onRequireLogin:m}){let _=G(`components.biz.business.comment`),y=z(null),[b,x]=B(()=>N({})),[S,C]=B(!1),{userInfo:w,userId:T}=o(),{followIds:D,setFollowIds:O}=a(),k=w?.userId||w?.user_id||T||``,A=w?.name||w?.nick_name||w?.nickname||w?.user_name||``,j=w?.avatar||w?.avatar_url||``,M=z({commentId:``,userId:``});function P(e){if(!e)return``;if(Array.isArray(e))return String(e[0]||``);if(typeof e==`object`){if(Object.prototype.hasOwnProperty.call(e,`comment_id`))return String(e.comment_id??``);if(Array.isArray(e.data))return String(e.data[0]||``)}return``}L(()=>{l&&(!k||!e.user_id||e.user_id!==`0`&&String(k)!==String(e.user_id)&&(M.current.commentId===e.id&&M.current.userId===k||(M.current={commentId:e.id,userId:k},(async()=>{let t=await p({app_id:0,follower_id:k,followee_ids:[e.user_id]});if(!t.success||!t.data?.is_following_map)return;let n=!!t.data.is_following_map[e.user_id];e.is_follow=n;let r=new Set(D);n?r.add(e.user_id):r.delete(e.user_id),O(Array.from(r))})())))},[e,D,k,O,l]);let F=I(e=>{x(e),setTimeout(()=>{C(!0),y.current?.focus()},10)},[]);function R(){ae(()=>{C(!1)})}async function V({text:e,imageVideoInfoList:t}){let n=e=>e.success?e:(W.error(e.message||_(`replyDetail.publishReplyFailed`)),{...e,toastHandled:!0});if(S){let r=await q({text:e,imageVideoInfoList:t});return C(!1),n(r)}else{let r=await K({text:e,imageVideoInfoList:t});return C(!1),n(r)}}async function K({text:e,imageVideoInfoList:t}){return await d?.({text:e,imageVideoInfoList:t,callback:r=>{let i=Z(e);if(!r||r===`0`)return;let a=N({id:r,user_id:k,user_name:A,avatar:j,text:e,created_at:n(),type:`4`,nine_grid_content_info:t,at_users:i});J?.(a)}})??{success:!0}}async function q({text:e,imageVideoInfoList:a}){if(!b?.id||b.id===`0`)return{success:!1,message:_(`replyDetail.invalidReplyTarget`)};let o=ee(a),l=r(e),u=s===`video`?1:2;try{let r=await c({content_id:t.id,content:i(e),medias:o,mentioned_users:l,parent_id:b.id,source_type:u},{revalidate:!1});if(r.code!==0)return{success:!1,message:r.message||_(`replyDetail.publishReplyFailed`)};let s=P(r.data);if(!s||s===`0`)return{success:!1,message:_(`replyDetail.publishReplyFailed`)};let d=N({id:s,user_id:k,user_name:A,avatar:j,text:e,created_at:n(),type:`4`,nine_grid_content_info:a,at_users:Z(e)});return d.parent_reply=b,J?.(d),f?.(),{success:!0}}catch(e){return console.error(`发布回复回复失败:`,e),{success:!1,message:_(`replyDetail.publishReplyFailed`)}}}let[J,Y]=B(null),X=I(e=>{Y(()=>e)},[]),Q=S?`回复@${b.user_name}`:``;function $(e){e||u()}return H(h,{open:l,onOpenChange:$,children:U(g,{showCloseButton:!1,className:`fixed left-0 right-0 bottom-0 top-[84px] z-[1000] h-auto w-full max-w-none translate-x-0 translate-y-0 rounded-none bg-bg2 p-0 text-text1 !flex !flex-col !gap-0`,children:[U(`div`,{className:`w-full h-[60px] bg-bg1 flex items-center justify-center relative`,children:[H(`button`,{type:`button`,className:`w-[48px] focus-within:outline-none focus-within:border-none focus-within:ring-0 h-full flex items-center justify-center absolute left-0 top-0`,onClick:u,children:H(v,{className:`w-[16px] h-[16px] text-text1`})}),H(`span`,{className:`text-[18px] font-bold`,children:_(`replyDetail.commentDetail`)})]}),U(`div`,{className:`flex-1 min-h-0 w-full overflow-y-auto bg-bg2`,children:[H(re,{comment:e,updateFollow:t=>{e.is_follow=t},onRequireLogin:m}),H(se,{commentId:e.id,informationId:t.id,handleReplyComment:F,onReplyListUpdate:X}),H(E,{placeholder:Q,onInputBlur:R,onPublish:V,onRequireLogin:m,ref:y})]})]})})}export{le as default};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{cn as e}from"../../../../utils/cn.mjs";import{useUserStore as t}from"../../../../store/modules/user-store.mjs";import{followUser as n,unfollowUser as r}from"../../../../utils/follow-service.mjs";import{useFollowIdsState as i}from"../../../../store/modules/follow-ids-store.mjs";import a from"../../../../assets/icons/common/follow_sel.mjs";import o from"../../../../assets/icons/common/follow_user.mjs";import{UnfollowConfirmDialog as s}from"../../../common/follow-button/unfollow-confirm-dialog.mjs";import{useEffect as c,useState as l}from"react";import{Fragment as u,jsx as d,jsxs as f}from"react/jsx-runtime";import{useTranslations as p}from"next-intl";function m({information:e,onUpdate:a}){let{userId:o,userInfo:p}=t(),m=o||p?.userId||``,g=e.author,_=e.up_user||g?.user_id||``,v=!!(m&&_&&m===_),[y,b]=l(!!e.is_followed),[x,S]=l(!1),[C,w]=l(!1);c(()=>{b(!!e.is_followed)},[e.id,e.is_followed]);async function T(){if(!_){console.warn(`用户信息不完整,无法执行关注操作`);return}w(!0);let e=!y;try{let t;if(t=e?await n({app_id:0,follower_id:m,followee_id:_}):await r({app_id:0,follower_id:m,followee_id:_}),t.success){b(e),a({is_followed:e});let{followIds:t,setFollowIds:n}=i.getState(),r=new Set(t);e?r.add(_):r.delete(_),n(Array.from(r))}else console.error(`关注操作失败:`,t.message)}catch(e){console.error(`关注操作异常:`,e)}finally{w(!1)}}function E(){if(!C){if(y){S(!0);return}T()}}function D(){S(!1),T()}function O(){S(!1)}return f(u,{children:[e.up_user&&_&&!v?d(h,{followed:y,loading:C,onToggle:E}):null,d(s,{open:x,onOpenChange:S,onCancel:O,onConfirm:D})]})}function h({followed:t,loading:n=!1,onToggle:r}){let i=p(`components.biz.business.detail`);return d(`button`,{type:`button`,disabled:n,className:e(`flex h-7 items-center rounded-full border border-solid px-3 text-xs font-medium transition-colors`,n&&`opacity-50 cursor-not-allowed`,t?`border-text3 text-text3`:`border-theme5 text-theme5`),onClick:r,children:t?f(u,{children:[d(a,{className:`w-[12px] h-[12px] text-text3 shrink-0`}),d(`span`,{className:`text-text3 text-[12px] leading-[18px] ml-[4px] shrink-0`,children:i(`detailFollowAction.following`)})]}):f(u,{children:[d(o,{className:`block w-[12px] h-[12px] text-theme5 shrink-0`}),d(`span`,{className:`block text-theme5 text-[12px] leading-[18px] ml-[4px] shrink-0`,children:i(`detailFollowAction.follow`)})]})})}export{m as DetailFollowAction};
2
+ "use client";import{cn as e}from"../../../../utils/cn.mjs";import{useFollowIdsState as t}from"../../../../store/modules/follow-ids-store.mjs";import{useUserStore as n}from"../../../../store/modules/user-store.mjs";import{followUser as r,unfollowUser as i}from"../../../../utils/follow-service.mjs";import a from"../../../../assets/icons/common/follow_sel.mjs";import o from"../../../../assets/icons/common/follow_user.mjs";import{UnfollowConfirmDialog as s}from"../../../common/follow-button/unfollow-confirm-dialog.mjs";import{useEffect as c,useState as l}from"react";import{Fragment as u,jsx as d,jsxs as f}from"react/jsx-runtime";import{useTranslations as p}from"next-intl";function m({information:e,onUpdate:a}){let{userId:o,userInfo:p}=n(),m=o||p?.userId||``,g=e.author,_=e.up_user||g?.user_id||``,v=!!(m&&_&&m===_),[y,b]=l(!!e.is_followed),[x,S]=l(!1),[C,w]=l(!1);c(()=>{b(!!e.is_followed)},[e.id,e.is_followed]);async function T(){if(!_){console.warn(`用户信息不完整,无法执行关注操作`);return}w(!0);let e=!y;try{let n;if(n=e?await r({app_id:0,follower_id:m,followee_id:_}):await i({app_id:0,follower_id:m,followee_id:_}),n.success){b(e),a({is_followed:e});let{followIds:n,setFollowIds:r}=t.getState(),i=new Set(n);e?i.add(_):i.delete(_),r(Array.from(i))}else console.error(`关注操作失败:`,n.message)}catch(e){console.error(`关注操作异常:`,e)}finally{w(!1)}}function E(){if(!C){if(y){S(!0);return}T()}}function D(){S(!1),T()}function O(){S(!1)}return f(u,{children:[e.up_user&&_&&!v?d(h,{followed:y,loading:C,onToggle:E}):null,d(s,{open:x,onOpenChange:S,onCancel:O,onConfirm:D})]})}function h({followed:t,loading:n=!1,onToggle:r}){let i=p(`components.biz.business.detail`);return d(`button`,{type:`button`,disabled:n,className:e(`flex h-7 items-center rounded-full border border-solid px-3 text-xs font-medium transition-colors`,n&&`opacity-50 cursor-not-allowed`,t?`border-text3 text-text3`:`border-theme5 text-theme5`),onClick:r,children:t?f(u,{children:[d(a,{className:`w-[12px] h-[12px] text-text3 shrink-0`}),d(`span`,{className:`text-text3 text-[12px] leading-[18px] ml-[4px] shrink-0`,children:i(`detailFollowAction.following`)})]}):f(u,{children:[d(o,{className:`block w-[12px] h-[12px] text-theme5 shrink-0`}),d(`span`,{className:`block text-theme5 text-[12px] leading-[18px] ml-[4px] shrink-0`,children:i(`detailFollowAction.follow`)})]})})}export{m as DetailFollowAction};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{Box as e}from"../../../ui/box.mjs";import t from"../../../../assets/icons/common/right_arrow.mjs";import{useEffect as n,useMemo as r,useRef as i,useState as a}from"react";import{jsx as o,jsxs as s}from"react/jsx-runtime";function c({title:c,className:l=``}){let[u,d]=a(!1),[f,p]=a(!1),m=i(null),h=r(()=>c?.trim()??``,[c]);if(n(()=>{let e=m.current;if(!e){p(!1);return}if(u){p(!0);return}if(!h){p(!1);return}let t=()=>{p(e.scrollWidth>e.clientWidth)},n=new ResizeObserver(t);n.observe(e);let r=window.requestAnimationFrame(t);return()=>{window.cancelAnimationFrame(r),n.disconnect()}},[u,h]),n(()=>{d(!1)},[h]),!h)return null;function g(){d(e=>!e)}return s(e,{className:`flex items-start min-w-0 ${l}`,children:[o(`p`,{ref:m,className:`flex-1 min-w-0 text-[20px] leading-[28px] font-bold text-text1 ${u?``:`line-clamp-1`}`,children:h}),f&&o(`button`,{type:`button`,className:`ml-[8px] h-[24px] w-[24px] flex items-center justify-center`,onClick:g,children:o(t,{className:`h-[12px] w-[12px] text-text2 transition-transform ${u?`-rotate-90`:`rotate-90`}`})})]})}export{c as DetailInfoTitle};
2
+ "use client";import{Box as e}from"../../../ui/box.mjs";import t from"../../../../assets/icons/common/right_arrow.mjs";import{useEffect as n,useMemo as r,useRef as i,useState as a}from"react";import{jsx as o,jsxs as s}from"react/jsx-runtime";function c({title:c,className:l=``}){let[u,d]=a(!1),[f,p]=a(!1),m=i(null),h=i(null),g=i(null),_=r(()=>c?.trim()??``,[c]);if(n(()=>{d(!1)},[_]),n(()=>{if(u){p(!0);return}if(!_){p(!1);return}let e=h.current,t=g.current;if(!e||!t){p(!1);return}let n=()=>{let n=e.clientWidth||e.getBoundingClientRect().width,r=t.getBoundingClientRect().width;p(r>n+1)};n();let r=new ResizeObserver(n);return r.observe(e),m.current&&r.observe(m.current),()=>{r.disconnect()}},[u,_]),!_)return null;function v(){d(e=>!e)}return s(e,{ref:m,className:`relative flex items-start min-w-0 ${l}`,children:[o(`span`,{ref:g,className:`absolute invisible whitespace-nowrap text-[20px] leading-[28px] font-bold`,children:_}),o(`p`,{ref:h,className:`flex-1 min-w-0 text-[20px] leading-[28px] font-bold text-text1 ${u?``:`line-clamp-1`}`,children:_}),f&&o(`button`,{type:`button`,className:`ml-[8px] h-[24px] w-[24px] flex items-center justify-center`,onClick:v,children:o(t,{className:`h-[12px] w-[12px] text-text2 transition-transform ${u?`-rotate-90`:`rotate-90`}`})})]})}export{c as DetailInfoTitle};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{Box as e}from"../../../ui/box.mjs";import{Text as t}from"../../../ui/text.mjs";import{useCardDecoration as n}from"../../../../hooks/use-card-decoration.mjs";import{DetailInfoTags as r}from"./detail-info-tags.mjs";import{DetailInfoTitle as i}from"./detail-info-title.mjs";import{useMemo as a}from"react";import{jsx as o,jsxs as s}from"react/jsx-runtime";import{useTranslations as c}from"next-intl";function l({information:l,isShow:d,showTags:f=!0}){let p=c(`components.biz.business.detail`),{getTitleText:m}=n(),h=a(()=>m(l),[m,l]),g=a(()=>l.description||``,[l.description]),_=a(()=>u(l.score),[l.score]),v=l.tags||[],y=f&&v.length>0;return!h&&!g&&!y?null:s(e,{className:`w-full mt-4 px-[12px]`,children:[s(e,{className:`w-full flex items-start justify-between`,children:[o(e,{className:`flex-1 pr-[12px]`,children:o(i,{title:h})}),s(e,{className:`ml-4 shrink-0 flex flex-col items-center`,children:[o(e,{className:`text-[28px] leading-[36px] h-[36px] font-bold text-[#FF9F1A]`,children:_}),o(t,{className:`text-[12px] text-text2 leading-4`,children:p(`detailIntroduction.score`)})]})]}),g&&d&&o(t,{className:`mt-[12px] text-[14px] leading-[22px] text-text2`,children:g}),y&&o(r,{tags:v,className:`mt-[12px]`})]})}function u(e){let t=Number(e||`0`);return Number.isFinite(t)?(t>10?t/10:t).toFixed(1):`0`}export{l as DetailIntroduction};
2
+ "use client";import{Box as e}from"../../../ui/box.mjs";import{Text as t}from"../../../ui/text.mjs";import{useCardDecoration as n}from"../../../../hooks/use-card-decoration.mjs";import{DetailInfoTags as r}from"./detail-info-tags.mjs";import{DetailInfoTitle as i}from"./detail-info-title.mjs";import{useMemo as a}from"react";import{jsx as o,jsxs as s}from"react/jsx-runtime";import{useTranslations as c}from"next-intl";function l({information:l,isShow:d,showTags:f=!0}){let p=c(`components.biz.business.detail`),{getTitleText:m}=n(),h=a(()=>m(l),[m,l]),g=a(()=>l.description||``,[l.description]),_=a(()=>u(l.score),[l.score]),v=l.tags||[],y=f&&v.length>0;return!h&&!g&&!y?null:s(e,{className:`w-full mt-4 px-[12px]`,children:[s(e,{className:`w-full flex items-start justify-between min-w-0`,children:[o(e,{className:`flex-1 pr-[12px] min-w-0`,children:o(i,{title:h})}),s(e,{className:`ml-4 shrink-0 flex flex-col items-center`,children:[o(e,{className:`text-[28px] leading-[36px] h-[36px] font-bold text-[#FF9F1A]`,children:_}),o(t,{className:`text-[12px] text-text2 leading-4`,children:p(`detailIntroduction.score`)})]})]}),g&&d&&o(t,{className:`mt-[12px] text-[14px] leading-[22px] text-text2`,children:g}),y&&o(r,{tags:v,className:`mt-[12px]`})]})}function u(e){let t=Number(e||`0`);return Number.isFinite(t)?(t>10?t/10:t).toFixed(1):`0`}export{l as DetailIntroduction};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{useUserStore as e}from"../../../../store/modules/user-store.mjs";import{Box as t}from"../../../ui/box.mjs";import{Text as n}from"../../../ui/text.mjs";import{useDeleteRequest as r}from"../../../../hooks/query/use-query.mjs";import{useLoginModalStore as i}from"../../../../store/modules/login-modal-store.mjs";import{debounceFun as a}from"../../../../utils/tools.mjs";import o from"../../../common/interaction-animations.module.mjs";import s from"../../../common/collection-popup/index.mjs";import{useContentOperate as c}from"../../../../hooks/use-content-operate.mjs";import l from"../../../../assets/icons/detail/check-ok.mjs";import u from"../../../../assets/icons/detail/collect_nor.mjs";import d from"../../../../assets/icons/detail/collect_sel.mjs";import f from"../../../../assets/icons/detail/give_like.mjs";import p from"../../../../assets/icons/detail/give_like_sel.mjs";import m from"../../../../assets/icons/detail/share.mjs";import{useCallback as h,useMemo as g,useRef as _,useState as v}from"react";import{jsx as y,jsxs as b}from"react/jsx-runtime";import{toast as x}from"sonner";import{useTranslations as S}from"next-intl";function C({information:C,onUpdate:E}){let D=S(`components.biz.business.detail`),[O,k]=v(!1),[A,j]=v(!1),M=_(0),N=e(e=>e.userId),P=e(e=>e.isLogin),F=r(),I=h(()=>{N&&(F([`user-profile`,`mine`,N,`user-like-video`]),F([`user-profile`,`mine`,N,`user-like-post`]),F([`user-profile`,`mine`,N,`user-collect-video`,N]),F([`user-profile`,`mine`,N,`user-collect-post`,N]))},[F,N]),{likeAnimation:L,handleLikeOperate:R,handleDefaultCollectionOperate:z,handleShareOperate:B}=c({id:C.id,isLike:C.like||!1,isDislike:C.dislike||!1,isCollect:C.collect||!1,likeCnt:T(C.static?.like_cnt),dislikeCnt:T(C.static?.dislike_cnt),contentType:C.content_type,animationClasses:{like:o.likeShakeAnimation,dislike:o.dislikeShakeAnimation}}),V=h(e=>{E?.({...e})},[E]),H=h(async()=>{if(O)return;if(!P){i.getState().open();return}let e=Date.now();if(e-M.current<300)return;M.current=e,k(!0);let t=C.like||!1,n=C.dislike||!1,r=T(C.static?.like_cnt),a=T(C.static?.dislike_cnt),o=!t,s=Math.max(0,r+(o?1:-1)),c=o?!1:n,l=o&&n?Math.max(0,a-1):a;V({like:o,dislike:c,static:{...C.static,like_cnt:s,dislike_cnt:l}});try{let e=await R();if(!e){V({like:t,dislike:n,static:{...C.static,like_cnt:r,dislike_cnt:a}});return}V({like:e.isLike,dislike:e.isDislike??c,static:{...C.static,like_cnt:e.likeCnt,dislike_cnt:e.dislikeCnt??l}}),I(),window.sensors?.track?.(`detail_like_click`,{object_id:C.id,action:e.isLike?`点赞`:`取消点赞`,like_count:e.likeCnt})}catch(e){console.error(`点赞操作失败:`,e),x.error(D(`detailOperate.operateFailed`))}finally{k(!1)}},[R,C,I,O,P,D,V]),U=g(()=>C.id,[C.id]),W=h(()=>{B(({isCollect:e})=>{V({collect:e})},U)},[B,U,V]);async function G(e){return await new Promise(e=>setTimeout(e,300)),e}let K=h(()=>{s.show({mode:`select`,onCollect:async e=>{try{await G({contentId:C.id,collectionId:e}),V({collect:!0}),I(),x.success(D(`detailOperate.modifyCollectionSuccess`))}catch(e){console.error(`修改收藏夹失败:`,e),x.error(D(`detailOperate.collectFailed`))}}})},[C.id,I,D,V]),q=h(e=>{let t=e||D(`detailOperate.defaultCollection`);x.custom(e=>b(`div`,{className:`flex items-center justify-between gap-[16px] px-[16px] py-[12px] rounded-[12px] bg-black text-white shadow-lg min-w-[280px]`,children:[b(`div`,{className:`flex items-center gap-[10px]`,children:[y(`div`,{className:`w-[24px] h-[24px] rounded-full bg-white flex items-center justify-center`,children:y(l,{className:`w-[14px] h-[14px]`})}),b(`div`,{className:`flex items-center gap-[6px]`,children:[y(`span`,{className:`text-[14px] leading-[20px]`,children:D(`detailOperate.collectAdded`)}),y(`span`,{className:`text-[14px] leading-[20px] font-semibold`,children:t})]})]}),y(`button`,{type:`button`,className:`text-[14px] text-theme5 font-semibold`,onClick:()=>{x.dismiss(e),K()},children:D(`detailOperate.modifyCollection`)})]}))},[K,D]),J=h(async()=>{if(A)return;if(!P){i.getState().open();return}let e=C.collect||!1;j(!0),window.sensors?.track?.(`detail_fav_click`,{object_id:C.id,action:e?`取消收藏`:`收藏`});try{let t=await z({currentCollect:e,onUpdate:({isCollect:e})=>{V({collect:e})}});if(!t?.success){x.error(D(`detailOperate.collectFailed`));return}I(),window.sensors?.track?.(`detail_fav_click`,{object_id:C.id,action:t.isCollect?`收藏`:`取消收藏`}),!e&&t.isCollect&&q(t.collectionTitle)}catch(e){console.error(`收藏操作失败:`,e),x.error(D(`detailOperate.collectFailed`))}finally{j(!1)}},[z,C.collect,C.id,I,A,P,q,D,V]),Y=g(()=>a(J,300),[J]);return b(t,{className:`w-full h-[42px] mt-[16px] flex items-center justify-between`,children:[b(t,{className:`w-[25%] h-full flex flex-col items-center justify-center ${O?`opacity-50 cursor-not-allowed`:`cursor-pointer`}`,onClick:H,children:[C.like?y(p,{className:`w-[20px] h-[20px] ${L.animationClass}`}):y(f,{className:`w-[20px] h-[20px] text-text2`}),y(n,{className:`text-[12px] text-text2 leading-[20px]`,children:C.static?C.static.like_cnt===0?D(`detailOperate.like`):w(C.static?.like_cnt):D(`detailOperate.like`)})]}),b(t,{className:`w-[25%] h-full flex flex-col items-center justify-center ${A?`opacity-50 cursor-not-allowed`:`cursor-pointer`}`,onClick:Y,children:[C.collect?y(d,{className:`w-[20px] h-[20px]`}):y(u,{className:`w-[20px] h-[20px] text-text2`}),y(n,{className:`text-[12px] text-text2 leading-[20px]`,children:D(`detailOperate.collection`)})]}),b(t,{className:`w-[25%] h-full flex flex-col items-center justify-center cursor-pointer`,onClick:W,children:[y(m,{className:`w-[20px] h-[20px] text-text2`}),y(n,{className:`text-[12px] text-text2 leading-[20px]`,children:D(`detailOperate.share`)})]})]})}function w(e){let t=Number(e||0);return Number.isNaN(t)||t<=0?`0`:t>=1e4?`${(t/1e4).toFixed(1)}w`:t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}function T(e){if(e==null)return 0;if(typeof e==`number`)return e;let t=Number(e);return Number.isNaN(t)?0:t}export{C as DetailOperate};
2
+ "use client";import{useUserStore as e}from"../../../../store/modules/user-store.mjs";import{Box as t}from"../../../ui/box.mjs";import{Text as n}from"../../../ui/text.mjs";import{debounceFun as r}from"../../../../utils/tools.mjs";import{useLoginModalStore as i}from"../../../../store/modules/login-modal-store.mjs";import{useDeleteRequest as a}from"../../../../hooks/query/use-query.mjs";import o from"../../../common/collection-popup/index.mjs";import{useContentOperate as s}from"../../../../hooks/use-content-operate.mjs";import c from"../../../common/interaction-animations.module.mjs";import l from"../../../../assets/icons/detail/check-ok.mjs";import u from"../../../../assets/icons/detail/collect_nor.mjs";import d from"../../../../assets/icons/detail/collect_sel.mjs";import f from"../../../../assets/icons/detail/give_like.mjs";import p from"../../../../assets/icons/detail/give_like_sel.mjs";import m from"../../../../assets/icons/detail/share.mjs";import{useCallback as h,useMemo as g,useRef as _,useState as v}from"react";import{jsx as y,jsxs as b}from"react/jsx-runtime";import{toast as x}from"sonner";import{useTranslations as S}from"next-intl";function C({information:C,onUpdate:E}){let D=S(`components.biz.business.detail`),[O,k]=v(!1),[A,j]=v(!1),M=_(0),N=e(e=>e.userId),P=e(e=>e.isLogin),F=a(),I=h(()=>{N&&(F([`user-profile`,`mine`,N,`user-like-video`]),F([`user-profile`,`mine`,N,`user-like-post`]),F([`user-profile`,`mine`,N,`user-collect-video`,N]),F([`user-profile`,`mine`,N,`user-collect-post`,N]))},[F,N]),{likeAnimation:L,handleLikeOperate:R,handleDefaultCollectionOperate:z,handleShareOperate:B}=s({id:C.id,isLike:C.like||!1,isDislike:C.dislike||!1,isCollect:C.collect||!1,likeCnt:T(C.static?.like_cnt),dislikeCnt:T(C.static?.dislike_cnt),contentType:C.content_type,prefetchDefaultCollection:!0,animationClasses:{like:c.likeShakeAnimation,dislike:c.dislikeShakeAnimation}}),V=h(e=>{E?.({...e})},[E]),H=h(async()=>{if(O)return;if(!P){i.getState().open();return}let e=Date.now();if(e-M.current<300)return;M.current=e,k(!0);let t=C.like||!1,n=C.dislike||!1,r=T(C.static?.like_cnt),a=T(C.static?.dislike_cnt),o=!t,s=Math.max(0,r+(o?1:-1)),c=o?!1:n,l=o&&n?Math.max(0,a-1):a;V({like:o,dislike:c,static:{...C.static,like_cnt:s,dislike_cnt:l}});try{let e=await R();if(!e){V({like:t,dislike:n,static:{...C.static,like_cnt:r,dislike_cnt:a}});return}V({like:e.isLike,dislike:e.isDislike??c,static:{...C.static,like_cnt:e.likeCnt,dislike_cnt:e.dislikeCnt??l}}),I(),window.sensors?.track?.(`detail_like_click`,{object_id:C.id,action:e.isLike?`点赞`:`取消点赞`,like_count:e.likeCnt})}catch(e){console.error(`点赞操作失败:`,e),x.error(D(`detailOperate.operateFailed`))}finally{k(!1)}},[R,C,I,O,P,D,V]),U=g(()=>C.id,[C.id]),W=h(()=>{B(({isCollect:e})=>{V({collect:e})},U)},[B,U,V]);async function G(e){return await new Promise(e=>setTimeout(e,300)),e}let K=h(()=>{o.show({mode:`select`,onCollect:async e=>{try{await G({contentId:C.id,collectionId:e}),V({collect:!0}),I(),x.success(D(`detailOperate.modifyCollectionSuccess`))}catch(e){console.error(`修改收藏夹失败:`,e),x.error(D(`detailOperate.collectFailed`))}}})},[C.id,I,D,V]),q=h(e=>{let t=e||D(`detailOperate.defaultCollection`);x.custom(e=>b(`div`,{className:`flex items-center justify-between gap-[16px] px-[16px] py-[12px] rounded-[12px] bg-black text-white shadow-lg min-w-[280px]`,children:[b(`div`,{className:`flex items-center gap-[10px]`,children:[y(`div`,{className:`w-[24px] h-[24px] rounded-full bg-white flex items-center justify-center`,children:y(l,{className:`w-[14px] h-[14px]`})}),b(`div`,{className:`flex items-center gap-[6px]`,children:[y(`span`,{className:`text-[14px] leading-[20px]`,children:D(`detailOperate.collectAdded`)}),y(`span`,{className:`text-[14px] leading-[20px] font-semibold`,children:t})]})]}),y(`button`,{type:`button`,className:`text-[14px] text-theme5 font-semibold`,onClick:()=>{x.dismiss(e),K()},children:D(`detailOperate.modifyCollection`)})]}))},[K,D]),J=h(async()=>{if(A)return;if(!P){i.getState().open();return}let e=C.collect||!1;j(!0),window.sensors?.track?.(`detail_fav_click`,{object_id:C.id,action:e?`取消收藏`:`收藏`});try{let t=await z({currentCollect:e,onUpdate:({isCollect:e})=>{V({collect:e})}});if(!t?.success){x.error(t?.message||D(`detailOperate.collectFailed`));return}I(),window.sensors?.track?.(`detail_fav_click`,{object_id:C.id,action:t.isCollect?`收藏`:`取消收藏`}),!e&&t.isCollect&&q(t.collectionTitle)}catch(e){console.error(`收藏操作失败:`,e),x.error(e?.message||D(`detailOperate.collectFailed`))}finally{j(!1)}},[z,C.collect,C.id,I,A,P,q,D,V]),Y=g(()=>r(J,300),[J]);return b(t,{className:`w-full h-[42px] mt-[16px] flex items-center justify-between`,children:[b(t,{className:`w-[25%] h-full flex flex-col items-center justify-center ${O?`opacity-50 cursor-not-allowed`:`cursor-pointer`}`,onClick:H,children:[C.like?y(p,{className:`w-[20px] h-[20px] ${L.animationClass}`}):y(f,{className:`w-[20px] h-[20px] text-text2`}),y(n,{className:`text-[12px] text-text2 leading-[20px]`,children:C.static?C.static.like_cnt===0?D(`detailOperate.like`):w(C.static?.like_cnt):D(`detailOperate.like`)})]}),b(t,{className:`w-[25%] h-full flex flex-col items-center justify-center ${A?`opacity-50 cursor-not-allowed`:`cursor-pointer`}`,onClick:Y,children:[C.collect?y(d,{className:`w-[20px] h-[20px]`}):y(u,{className:`w-[20px] h-[20px] text-text2`}),y(n,{className:`text-[12px] text-text2 leading-[20px]`,children:D(`detailOperate.collection`)})]}),b(t,{className:`w-[25%] h-full flex flex-col items-center justify-center cursor-pointer`,onClick:W,children:[y(m,{className:`w-[20px] h-[20px] text-text2`}),y(n,{className:`text-[12px] text-text2 leading-[20px]`,children:D(`detailOperate.share`)})]})]})}function w(e){let t=Number(e||0);return Number.isNaN(t)||t<=0?`0`:t>=1e4?`${(t/1e4).toFixed(1)}w`:t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}function T(e){if(e==null)return 0;if(typeof e==`number`)return e;let t=Number(e);return Number.isNaN(t)?0:t}export{C as DetailOperate};
@@ -1,11 +1,11 @@
1
1
 
2
2
  import { SchemaHasDefaultValue } from "../../../../../utils/schema/schema.mjs";
3
3
  import { DefineMaterialOption } from "../../../../../utils/schema/material.mjs";
4
+ import { MaterialMap } from "../../../../../utils/schema/utils.mjs";
4
5
  import { VideoDetailPlayerClient } from "./video-detail-player/client.mjs";
5
6
  import "./video-detail-player/index.mjs";
6
7
  import { VideoDetailInfoClient } from "./video-detail-info/client.mjs";
7
8
  import "./video-detail-info/index.mjs";
8
- import "../../../../../utils.mjs";
9
9
  import { VideoDetailInfoTitleClient } from "./video-detail-info-title/client.mjs";
10
10
  import "./video-detail-info-title/index.mjs";
11
11
  import { VideoDetailInfoTitleTagsEpisodesClient } from "./video-detail-info-title-tags-episodes/client.mjs";
@@ -14,48 +14,42 @@ import { VideoDetailActionsClient } from "./video-detail-actions/client.mjs";
14
14
  import "./video-detail-actions/index.mjs";
15
15
  import { VideoDetailRecommendClient } from "./video-detail-recommend/client.mjs";
16
16
  import "./video-detail-recommend/index.mjs";
17
+ import "../../../../../utils.mjs";
17
18
  import z from "zod";
18
19
 
19
20
  //#region components/biz/business/detail/materials/registry.d.ts
20
- declare const videoDetailMaterials: {
21
- 'video-detail-player': DefineMaterialOption<typeof VideoDetailPlayerClient, z.ZodObject<{}, z.core.$strip>, "video-detail-player">;
22
- 'video-detail-info': DefineMaterialOption<typeof VideoDetailInfoClient, z.ZodObject<{
23
- showTags: z.ZodBoolean & SchemaHasDefaultValue;
24
- showEpisodes: z.ZodBoolean & SchemaHasDefaultValue;
25
- }, z.core.$strip>, "video-detail-info">;
26
- 'video-detail-info-title': DefineMaterialOption<typeof VideoDetailInfoTitleClient, z.ZodObject<{}, z.core.$strip>, "video-detail-info-title">;
27
- 'video-detail-info-title-tags-episodes': DefineMaterialOption<typeof VideoDetailInfoTitleTagsEpisodesClient, z.ZodObject<{
28
- showTags: z.ZodBoolean & SchemaHasDefaultValue;
29
- showEpisodes: z.ZodBoolean & SchemaHasDefaultValue;
30
- }, z.core.$strip>, "video-detail-info-title-tags-episodes">;
31
- 'video-detail-actions': DefineMaterialOption<typeof VideoDetailActionsClient, z.ZodObject<{}, z.core.$strip>, "video-detail-actions">;
32
- 'video-detail-recommend': DefineMaterialOption<typeof VideoDetailRecommendClient, z.ZodObject<{
33
- rows: z.ZodNumber & SchemaHasDefaultValue;
34
- columns: z.ZodNumber & SchemaHasDefaultValue;
35
- smartTagEnabled: z.ZodBoolean & SchemaHasDefaultValue;
36
- title: z.ZodString & SchemaHasDefaultValue;
37
- showPlayCount: z.ZodBoolean & SchemaHasDefaultValue;
38
- playCountDelta: z.ZodNumber & SchemaHasDefaultValue;
39
- showEpisode: z.ZodBoolean & SchemaHasDefaultValue;
40
- enableInfinite: z.ZodBoolean & SchemaHasDefaultValue;
41
- smartTagIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
42
- items: z.ZodOptional<z.ZodArray<z.ZodObject<{
43
- contentId: z.ZodString;
44
- coverMode: z.ZodOptional<z.ZodEnum<{
45
- content: "content";
46
- upload: "upload";
47
- }>>;
48
- coverUrl: z.ZodOptional<z.ZodString>;
49
- titleMode: z.ZodOptional<z.ZodEnum<{
50
- content: "content";
51
- custom: "custom";
52
- }>>;
53
- title: z.ZodOptional<z.ZodString>;
54
- showPlayCount: z.ZodOptional<z.ZodBoolean>;
55
- playCountDelta: z.ZodOptional<z.ZodNumber>;
56
- showEpisode: z.ZodOptional<z.ZodBoolean>;
57
- }, z.core.$strip>>>;
58
- }, z.core.$strip>, "video-detail-recommend">;
59
- };
21
+ declare const videoDetailMaterials: MaterialMap<readonly [DefineMaterialOption<typeof VideoDetailPlayerClient, z.ZodObject<{}, z.core.$strip>, "video-detail-player">, DefineMaterialOption<typeof VideoDetailInfoClient, z.ZodObject<{
22
+ showTags: z.ZodBoolean & SchemaHasDefaultValue;
23
+ showEpisodes: z.ZodBoolean & SchemaHasDefaultValue;
24
+ }, z.core.$strip>, "video-detail-info">, DefineMaterialOption<typeof VideoDetailInfoTitleClient, z.ZodObject<{}, z.core.$strip>, "video-detail-info-title">, DefineMaterialOption<typeof VideoDetailInfoTitleTagsEpisodesClient, z.ZodObject<{
25
+ showTags: z.ZodBoolean & SchemaHasDefaultValue;
26
+ showEpisodes: z.ZodBoolean & SchemaHasDefaultValue;
27
+ }, z.core.$strip>, "video-detail-info-title-tags-episodes">, DefineMaterialOption<typeof VideoDetailActionsClient, z.ZodObject<{}, z.core.$strip>, "video-detail-actions">, DefineMaterialOption<typeof VideoDetailRecommendClient, z.ZodObject<{
28
+ rows: z.ZodNumber & SchemaHasDefaultValue;
29
+ columns: z.ZodNumber & SchemaHasDefaultValue;
30
+ smartTagEnabled: z.ZodBoolean & SchemaHasDefaultValue;
31
+ title: z.ZodString & SchemaHasDefaultValue;
32
+ showPlayCount: z.ZodBoolean & SchemaHasDefaultValue;
33
+ playCountDelta: z.ZodNumber & SchemaHasDefaultValue;
34
+ showEpisode: z.ZodBoolean & SchemaHasDefaultValue;
35
+ enableInfinite: z.ZodBoolean & SchemaHasDefaultValue;
36
+ smartTagIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
37
+ items: z.ZodOptional<z.ZodArray<z.ZodObject<{
38
+ contentId: z.ZodString;
39
+ coverMode: z.ZodOptional<z.ZodEnum<{
40
+ content: "content";
41
+ upload: "upload";
42
+ }>>;
43
+ coverUrl: z.ZodOptional<z.ZodString>;
44
+ titleMode: z.ZodOptional<z.ZodEnum<{
45
+ content: "content";
46
+ custom: "custom";
47
+ }>>;
48
+ title: z.ZodOptional<z.ZodString>;
49
+ showPlayCount: z.ZodOptional<z.ZodBoolean>;
50
+ playCountDelta: z.ZodOptional<z.ZodNumber>;
51
+ showEpisode: z.ZodOptional<z.ZodBoolean>;
52
+ }, z.core.$strip>>>;
53
+ }, z.core.$strip>, "video-detail-recommend">]>;
60
54
  //#endregion
61
55
  export { videoDetailMaterials };