@funhub/platform 0.2.6 → 0.2.8

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 (237) hide show
  1. package/dist/assets/icons/channel-list/channel-active-indicator.mjs +2 -0
  2. package/dist/assets/icons/common/header-menu.mjs +2 -0
  3. package/dist/assets/icons/common/header-search-icon.mjs +2 -0
  4. package/dist/assets/icons/common/right_arrow_thin.mjs +2 -0
  5. package/dist/assets/icons/eye-off-icon.mjs +1 -1
  6. package/dist/assets/icons/marquee-close.mjs +2 -0
  7. package/dist/assets/icons/marquee-speaker.mjs +2 -0
  8. package/dist/assets/images/shortcut-grid/shortcut-grid-card-bg-primary.mjs +2 -0
  9. package/dist/biz.d.mts +6 -2
  10. package/dist/biz.mjs +1 -1
  11. package/dist/common.d.mts +5 -2
  12. package/dist/common.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/business/advertisement/ad-match.d.mts +1 -1
  16. package/dist/components/biz/business/advertisement/ad-match.mjs +1 -1
  17. package/dist/components/biz/business/advertisement/ad-provider.mjs +1 -1
  18. package/dist/components/biz/business/advertisement/ad-query.d.mts +2 -1
  19. package/dist/components/biz/business/advertisement/ad-query.mjs +1 -1
  20. package/dist/components/biz/business/advertisement/ad-runtime-provider.d.mts +2 -2
  21. package/dist/components/biz/business/advertisement/ad-runtime-provider.mjs +1 -1
  22. package/dist/components/biz/business/advertisement/banner-ad/client.mjs +1 -1
  23. package/dist/components/biz/business/advertisement/banner-ad/material.d.mts +1 -0
  24. package/dist/components/biz/business/advertisement/banner-ad/schema.d.mts +2 -0
  25. package/dist/components/biz/business/advertisement/banner-ad/schema.mjs +1 -1
  26. package/dist/components/biz/business/advertisement/floating-ad/client.d.mts +1 -0
  27. package/dist/components/biz/business/advertisement/floating-ad/client.mjs +1 -1
  28. package/dist/components/biz/business/advertisement/floating-ad/schema.d.mts +4 -0
  29. package/dist/components/biz/business/advertisement/icon-ad/client.mjs +1 -1
  30. package/dist/components/biz/business/advertisement/icon-ad/material.d.mts +1 -0
  31. package/dist/components/biz/business/advertisement/icon-ad/schema.d.mts +1 -0
  32. package/dist/components/biz/business/advertisement/icon-ad/schema.mjs +1 -1
  33. package/dist/components/biz/business/advertisement/popup-ad/client.mjs +2 -2
  34. package/dist/components/biz/business/advertisement/text-ad/client.mjs +1 -1
  35. package/dist/components/biz/business/advertisement/text-ad/material.d.mts +1 -0
  36. package/dist/components/biz/business/advertisement/text-ad/schema.d.mts +2 -0
  37. package/dist/components/biz/business/advertisement/text-ad/schema.mjs +1 -1
  38. package/dist/components/biz/business/banner/variants/basic-banner/runtime/client.mjs +1 -1
  39. package/dist/components/biz/business/banner-carousel/client.d.mts +2 -1
  40. package/dist/components/biz/business/banner-carousel/client.mjs +1 -1
  41. package/dist/components/biz/business/banner-carousel/default-props.mjs +1 -1
  42. package/dist/components/biz/business/channel-list/client.mjs +1 -1
  43. package/dist/components/biz/business/channel-list/default-props.mjs +1 -1
  44. package/dist/components/biz/business/detail/shared/detail-operate.mjs +1 -1
  45. package/dist/components/biz/business/detail/shared/editor-preview.mjs +1 -1
  46. package/dist/components/biz/business/detail/video-detail-actions/client.mjs +1 -1
  47. package/dist/components/biz/business/detail/video-detail-info/client.mjs +1 -1
  48. package/dist/components/biz/business/detail/video-detail-recommend/client.d.mts +1 -13
  49. package/dist/components/biz/business/detail/video-detail-recommend/client.mjs +1 -1
  50. package/dist/components/biz/business/detail/video-detail-recommend/material.mjs +1 -1
  51. package/dist/components/biz/business/detail/video-detail-recommend/schema.mjs +1 -1
  52. package/dist/components/biz/business/detail/video-detail-recommend/shared.mjs +2 -0
  53. package/dist/components/biz/business/header-search/header-avatar-icon/client.mjs +1 -1
  54. package/dist/components/biz/business/header-search/header-avatar-logo-search/client.d.mts +1 -1
  55. package/dist/components/biz/business/header-search/header-avatar-logo-search/client.mjs +1 -1
  56. package/dist/components/biz/business/header-search/header-avatar-logo-search/schema.d.mts +4 -3
  57. package/dist/components/biz/business/header-search/header-avatar-logo-search/schema.mjs +1 -1
  58. package/dist/components/biz/business/header-search/header-avatar-logo-search-icon/client.mjs +1 -1
  59. package/dist/components/biz/business/header-search/header-logo-search/client.mjs +1 -1
  60. package/dist/components/biz/business/header-search/header-search/client.mjs +1 -1
  61. package/dist/components/biz/business/header-search/shared/avatar.mjs +1 -1
  62. package/dist/components/biz/business/header-search/shared/header-action.mjs +2 -0
  63. package/dist/components/biz/business/header-search/shared/header-search-icon.mjs +2 -0
  64. package/dist/components/biz/business/header-search/shared/header-shell.mjs +2 -0
  65. package/dist/components/biz/business/header-search/shared/logo.mjs +1 -1
  66. package/dist/components/biz/business/header-search/shared/search.mjs +1 -1
  67. package/dist/components/biz/business/home-recommend/home-recommend-grid/client.mjs +1 -1
  68. package/dist/components/biz/business/home-recommend/home-recommend-grid/inspector-schema.d.mts +16 -4
  69. package/dist/components/biz/business/home-recommend/home-recommend-grid/inspector-schema.mjs +1 -1
  70. package/dist/components/biz/business/home-recommend/home-recommend-grid/material.d.mts +14 -2
  71. package/dist/components/biz/business/home-recommend/home-recommend-grid/server.mjs +1 -1
  72. package/dist/components/biz/business/home-recommend/home-recommend-waterfall/client.mjs +1 -1
  73. package/dist/components/biz/business/home-recommend/home-recommend-waterfall/inspector-schema.d.mts +16 -4
  74. package/dist/components/biz/business/home-recommend/home-recommend-waterfall/inspector-schema.mjs +1 -1
  75. package/dist/components/biz/business/home-recommend/home-recommend-waterfall/material.d.mts +14 -2
  76. package/dist/components/biz/business/home-recommend/home-recommend-waterfall/server.mjs +1 -1
  77. package/dist/components/biz/business/home-recommend/shared/home-recommend-base.mjs +1 -1
  78. package/dist/components/biz/business/home-recommend/shared/home-recommend-default-config.mjs +1 -1
  79. package/dist/components/biz/business/home-recommend/shared/home-recommend-preview.mjs +1 -1
  80. package/dist/components/biz/business/home-recommend/shared/home-recommend-runtime-props.mjs +1 -1
  81. package/dist/components/biz/business/home-recommend/shared/home-recommend-server-data.mjs +1 -1
  82. package/dist/components/biz/business/home-recommend/shared/home-recommend-smart-layout.mjs +2 -0
  83. package/dist/components/biz/business/hot-recommend/client.d.mts +17 -0
  84. package/dist/components/biz/business/hot-recommend/client.mjs +2 -0
  85. package/dist/components/biz/business/hot-recommend/index.d.mts +5 -0
  86. package/dist/components/biz/business/hot-recommend/material.d.mts +25 -0
  87. package/dist/components/biz/business/hot-recommend/material.mjs +2 -0
  88. package/dist/components/biz/business/hot-recommend/schema.d.mts +24 -0
  89. package/dist/components/biz/business/hot-recommend/schema.mjs +2 -0
  90. package/dist/components/biz/business/hot-recommend/server.d.mts +11 -0
  91. package/dist/components/biz/business/hot-recommend/server.mjs +2 -0
  92. package/dist/components/biz/business/image-text-recommend/client.d.mts +1 -1
  93. package/dist/components/biz/business/image-text-recommend/client.mjs +1 -1
  94. package/dist/components/biz/business/image-text-recommend/material.d.mts +7 -7
  95. package/dist/components/biz/business/image-text-recommend/schema.d.mts +30 -25
  96. package/dist/components/biz/business/image-text-recommend/schema.mjs +1 -1
  97. package/dist/components/biz/business/image-text-recommend/server.mjs +1 -1
  98. package/dist/components/biz/business/image-text-recommend/shared/query.mjs +1 -1
  99. package/dist/components/biz/business/index.d.mts +6 -1
  100. package/dist/components/biz/business/large-feature-grid/card-item.mjs +1 -1
  101. package/dist/components/biz/business/large-feature-grid/client.mjs +1 -1
  102. package/dist/components/biz/business/marquee/client.mjs +1 -1
  103. package/dist/components/biz/business/marquee/material.d.mts +5 -6
  104. package/dist/components/biz/business/marquee/schema.d.mts +5 -6
  105. package/dist/components/biz/business/marquee/schema.mjs +1 -1
  106. package/dist/components/biz/business/nav-bar/variants/basic-nav-bar/runtime/client.mjs +1 -1
  107. package/dist/components/biz/business/profile/index.d.mts +1 -1
  108. package/dist/components/biz/business/profile/profile-header/client.d.mts +2 -1
  109. package/dist/components/biz/business/profile/profile-header/client.mjs +1 -1
  110. package/dist/components/biz/business/profile/profile-header/index.d.mts +1 -1
  111. package/dist/components/biz/business/profile/profile-header/user-profile-avatar.mjs +1 -1
  112. package/dist/components/biz/business/profile/profile-header/user-profile-cover-background.mjs +1 -1
  113. package/dist/components/biz/business/profile/profile-main/client.mjs +1 -1
  114. package/dist/components/biz/business/profile/profile-main/empty-state.mjs +2 -0
  115. package/dist/components/biz/business/profile/profile-main/shell.mjs +1 -1
  116. package/dist/components/biz/business/profile/profile-main/tabs/collect-tab/client.mjs +1 -1
  117. package/dist/components/biz/business/profile/profile-main/tabs/collect-tab/video-waterfall.mjs +2 -0
  118. package/dist/components/biz/business/profile/profile-main/tabs/history-tab/client.mjs +1 -1
  119. package/dist/components/biz/business/profile/profile-main/tabs/like-tab/client.d.mts +5 -1
  120. package/dist/components/biz/business/profile/profile-main/tabs/like-tab/client.mjs +1 -1
  121. package/dist/components/biz/business/profile/profile-main/utils.mjs +1 -1
  122. package/dist/components/biz/business/ranking-recommend/client.d.mts +17 -0
  123. package/dist/components/biz/business/ranking-recommend/client.mjs +70 -0
  124. package/dist/components/biz/business/ranking-recommend/material.d.mts +35 -0
  125. package/dist/components/biz/business/ranking-recommend/material.mjs +2 -0
  126. package/dist/components/biz/business/ranking-recommend/schema.d.mts +35 -0
  127. package/dist/components/biz/business/ranking-recommend/schema.mjs +2 -0
  128. package/dist/components/biz/business/ranking-recommend/server.d.mts +11 -0
  129. package/dist/components/biz/business/ranking-recommend/server.mjs +2 -0
  130. package/dist/components/biz/business/ranking-recommend/shared/query.mjs +2 -0
  131. package/dist/components/biz/business/ranking-recommend/shared.d.mts +15 -0
  132. package/dist/components/biz/business/ranking-recommend/shared.mjs +2 -0
  133. package/dist/components/biz/business/search-history/client.mjs +1 -1
  134. package/dist/components/biz/business/search-history/schema.mjs +1 -1
  135. package/dist/components/biz/business/search-input/client.mjs +1 -1
  136. package/dist/components/biz/business/shortcut-grid/client.mjs +1 -1
  137. package/dist/components/biz/business/tab-bar/client.mjs +1 -1
  138. package/dist/components/biz/business/text-recommend/client.mjs +1 -1
  139. package/dist/components/biz/business/text-recommend/material.d.mts +1 -0
  140. package/dist/components/biz/business/text-recommend/schema.d.mts +1 -0
  141. package/dist/components/biz/business/text-recommend/schema.mjs +1 -1
  142. package/dist/components/common/collection-popup/create-collection-sheet.d.mts +41 -0
  143. package/dist/components/common/collection-popup/create-collection-sheet.mjs +2 -0
  144. package/dist/components/common/collection-popup/index.d.mts +1 -0
  145. package/dist/components/common/collection-popup/index.mjs +1 -1
  146. package/dist/components/common/icons/setting.mjs +1 -1
  147. package/dist/components/common/list/collection-list/collection-list-item.d.mts +8 -0
  148. package/dist/components/common/list/collection-list/collection-list-item.mjs +1 -1
  149. package/dist/components/common/list/collection-list/collection-list.d.mts +6 -0
  150. package/dist/components/common/list/collection-list/collection-list.mjs +1 -1
  151. package/dist/components/common/list/collection-list/collection-select-icon.mjs +2 -0
  152. package/dist/components/common/list/waterfall-recommend/index.d.mts +2 -0
  153. package/dist/components/common/list/waterfall-recommend/waterfall-recommend.d.mts +116 -0
  154. package/dist/components/common/list/waterfall-recommend/waterfall-recommend.mjs +2 -0
  155. package/dist/components/common/series-episodes/index.d.mts +3 -1
  156. package/dist/components/common/series-episodes/index.mjs +1 -1
  157. package/dist/components/common/tab-bar/index.mjs +1 -1
  158. package/dist/components/pages/collection-detail/_components/collection-detail-video-card.mjs +2 -0
  159. package/dist/components/pages/collection-detail/detail.mjs +1 -1
  160. package/dist/components/pages/edit/page.mjs +1 -1
  161. package/dist/components/pages/feedback/_components/feedback-form.mjs +1 -1
  162. package/dist/components/pages/home/client.mjs +1 -1
  163. package/dist/components/pages/login/auth-page-styles.mjs +6 -0
  164. package/dist/components/pages/login/forgot.mjs +1 -1
  165. package/dist/components/pages/login/login-client.mjs +1 -1
  166. package/dist/components/pages/login/register.mjs +1 -1
  167. package/dist/components/pages/login/verify.mjs +1 -4
  168. package/dist/components/pages/publish/components/collection.mjs +1 -1
  169. package/dist/components/pages/search/page-client.mjs +1 -1
  170. package/dist/components/pages/search/search-result/index.mjs +1 -1
  171. package/dist/components/pages/search/search-result/search-all.mjs +1 -1
  172. package/dist/components/pages/search/search-result/search-user.mjs +1 -1
  173. package/dist/components/pages/search/search-result/search-video-info.mjs +1 -1
  174. package/dist/components/pages/search/search-result/shared.mjs +2 -0
  175. package/dist/components/pages/search/top-header.mjs +1 -1
  176. package/dist/components/pages/search-result/page-client.mjs +1 -1
  177. package/dist/components/pages/search-result/search-all.mjs +1 -1
  178. package/dist/components/pages/search-result/search-empty.mjs +2 -0
  179. package/dist/components/pages/search-result/search-tab.mjs +1 -1
  180. package/dist/components/pages/search-result/search-user.mjs +1 -1
  181. package/dist/components/pages/search-result/search-video-info.mjs +2 -0
  182. package/dist/components/pages/search-result/shared.mjs +2 -0
  183. package/dist/components/pages/search-result/top-header.mjs +2 -0
  184. package/dist/components/pages/settings/_components/reset-password-drawer.mjs +1 -4
  185. package/dist/components/pages/settings/_components/settings.mjs +1 -1
  186. package/dist/components/pages/user-follow/_components/follow-no-login.mjs +1 -1
  187. package/dist/components/pages/video-list/video-list-client.mjs +1 -1
  188. package/dist/components/pages/video-list/video-list-recommend-item.mjs +2 -0
  189. package/dist/components/pages/video-list/video-list-skeleton.d.mts +2 -3
  190. package/dist/components/pages/video-list/video-list-skeleton.mjs +1 -1
  191. package/dist/components/ui/badge.d.mts +1 -1
  192. package/dist/components/ui/box.d.mts +1 -1
  193. package/dist/components/ui/button.d.mts +2 -2
  194. package/dist/components/ui/empty.d.mts +1 -1
  195. package/dist/components/ui/image.d.mts +4 -4
  196. package/dist/components/ui/input-group.d.mts +1 -1
  197. package/dist/components/ui/item.d.mts +2 -2
  198. package/dist/i18n/locales/en.mjs +2 -2
  199. package/dist/i18n/locales/zh-CN.mjs +2 -2
  200. package/dist/materials.d.mts +3 -1
  201. package/dist/materials.mjs +1 -1
  202. package/dist/store/modules/user-store.d.mts +1 -1
  203. package/dist/store/modules/user-store.mjs +1 -1
  204. package/dist/theme-tokens.d.mts +9 -0
  205. package/dist/theme-tokens.mjs +2 -0
  206. package/dist/types.d.mts +32 -0
  207. package/dist/utils/browser-fingerprint.d.mts +13 -0
  208. package/dist/utils/browser-fingerprint.mjs +2 -0
  209. package/dist/utils/device-id.d.mts +2 -2
  210. package/dist/utils/device-id.mjs +1 -1
  211. package/dist/utils/email-validator.d.mts +8 -0
  212. package/dist/utils/email-validator.mjs +2 -0
  213. package/dist/utils/helper.d.mts +1 -1
  214. package/dist/utils/helper.mjs +1 -1
  215. package/dist/utils/http.mjs +1 -1
  216. package/dist/utils/request-user-id.d.mts +12 -0
  217. package/dist/utils/request-user-id.mjs +2 -0
  218. package/dist/utils.d.mts +4 -1
  219. package/dist/utils.mjs +1 -1
  220. package/package.json +8 -2
  221. package/theme.css +172 -59
  222. package/dist/assets/icons/detail/collect_nor.mjs +0 -2
  223. package/dist/assets/icons/detail/collect_sel.mjs +0 -2
  224. package/dist/assets/icons/detail/share.mjs +0 -2
  225. package/dist/assets/icons/marquee-enter.mjs +0 -2
  226. package/dist/assets/icons/right_arrow.mjs +0 -2
  227. package/dist/assets/icons/search/avatar.mjs +0 -2
  228. package/dist/assets/icons/search/video.mjs +0 -2
  229. package/dist/assets/images/marquee.mjs +0 -2
  230. package/dist/components/biz/business/detail/shared/detail-introduction.mjs +0 -2
  231. package/dist/components/biz/business/marquee/marquee.module.mjs +0 -28
  232. package/dist/components/common/collection-popup/collection-create-modal.mjs +0 -2
  233. package/dist/components/common/skeleton/search-video-card-skeleton.mjs +0 -2
  234. package/dist/components/pages/search/search-utils.mjs +0 -2
  235. package/dist/components/pages/search-result/search-result-skeleton.mjs +0 -2
  236. package/dist/components/pages/search-result/search-video.mjs +0 -2
  237. package/dist/components/pages/video-list/video-list-item.mjs +0 -2
@@ -14,13 +14,13 @@ import * as zod_v4_core0 from "zod/v4/core";
14
14
  declare const imageTextRecommendMaterial: DefineMaterialOption<typeof ImageTextRecommendServer, typeof ImageTextRecommendClient, zod.ZodObject<{
15
15
  readonly title: zod.ZodString & SchemaHasDefaultValue;
16
16
  readonly moduleCount: zod.ZodNumber & SchemaHasDefaultValue;
17
- readonly layout: zod.ZodObject<{
18
- readonly enabled: zod.ZodBoolean & SchemaHasDefaultValue;
19
- readonly tags: zod.ZodArray<zod.ZodString> & SchemaHasDefaultValue;
20
- }, zod_v4_core0.$strip> | zod.ZodOptional<zod.ZodObject<{
21
- readonly enabled: zod.ZodBoolean & SchemaHasDefaultValue;
22
- readonly tags: zod.ZodArray<zod.ZodString> & SchemaHasDefaultValue;
23
- }, zod_v4_core0.$strip>>;
17
+ readonly layout: zod.ZodOptional<zod.ZodObject<{
18
+ enabled: zod.ZodOptional<zod.ZodBoolean>;
19
+ categories: zod.ZodOptional<zod.ZodArray<zod.ZodAny>>;
20
+ tags: zod.ZodOptional<zod.ZodArray<zod.ZodAny>>;
21
+ sortRule: zod.ZodOptional<zod.ZodString>;
22
+ contentForms: zod.ZodOptional<zod.ZodArray<zod.ZodString>>;
23
+ }, zod_v4_core0.$loose>>;
24
24
  readonly commonPlayCount: zod.ZodBoolean & SchemaHasDefaultValue;
25
25
  readonly commonEpisodes: zod.ZodBoolean & SchemaHasDefaultValue;
26
26
  readonly items: zod.ZodArray<zod.ZodObject<{
@@ -1,39 +1,44 @@
1
1
 
2
2
  import { SchemaHasDefaultValue } from "../../../../utils/schema/schema.mjs";
3
3
  import "../../../../utils.mjs";
4
- import { z } from "zod";
4
+ import * as zod from "zod";
5
+ import * as zod_v4_core0 from "zod/v4/core";
5
6
 
6
7
  //#region components/biz/business/image-text-recommend/schema.d.ts
7
8
  /**
8
9
  * 图文推荐物料属性定义
9
10
  */
10
- declare const imageTextRecommendInspectorPropsSchema: z.ZodObject<{
11
- readonly title: z.ZodString & SchemaHasDefaultValue;
12
- readonly moduleCount: z.ZodNumber & SchemaHasDefaultValue;
13
- readonly layout: z.ZodObject<{
14
- readonly enabled: z.ZodBoolean & SchemaHasDefaultValue;
15
- readonly tags: z.ZodArray<z.ZodString> & SchemaHasDefaultValue;
16
- }, z.core.$strip> | z.ZodOptional<z.ZodObject<{
17
- readonly enabled: z.ZodBoolean & SchemaHasDefaultValue;
18
- readonly tags: z.ZodArray<z.ZodString> & SchemaHasDefaultValue;
19
- }, z.core.$strip>>;
20
- readonly commonPlayCount: z.ZodBoolean & SchemaHasDefaultValue;
21
- readonly commonEpisodes: z.ZodBoolean & SchemaHasDefaultValue;
22
- readonly items: z.ZodArray<z.ZodObject<{
23
- readonly contentId: z.ZodString & SchemaHasDefaultValue;
24
- readonly title: z.ZodString & SchemaHasDefaultValue;
25
- readonly contentDescription: z.ZodString & SchemaHasDefaultValue;
26
- readonly cover: z.ZodString & SchemaHasDefaultValue;
27
- readonly useVideoPoster: z.ZodBoolean & SchemaHasDefaultValue;
28
- readonly showPlayCount: z.ZodBoolean & SchemaHasDefaultValue;
29
- readonly showEpisodes: z.ZodBoolean & SchemaHasDefaultValue;
30
- readonly badge: z.ZodString & SchemaHasDefaultValue;
31
- }, z.core.$strip>> & SchemaHasDefaultValue;
11
+ declare const imageTextRecommendInspectorPropsSchema: zod.ZodObject<{
12
+ readonly title: zod.ZodString & SchemaHasDefaultValue;
13
+ readonly moduleCount: zod.ZodNumber & SchemaHasDefaultValue;
14
+ /**
15
+ * 智能推荐配置(与首页宫格 smartLayout / recommendContentConfig 字段形态一致)。
16
+ * enabled 为 true 时走热门或最新列表;categories → cat_ids,tags 取项的 name 透传 tags。
17
+ */
18
+ readonly layout: zod.ZodOptional<zod.ZodObject<{
19
+ enabled: zod.ZodOptional<zod.ZodBoolean>;
20
+ categories: zod.ZodOptional<zod.ZodArray<zod.ZodAny>>;
21
+ tags: zod.ZodOptional<zod.ZodArray<zod.ZodAny>>;
22
+ sortRule: zod.ZodOptional<zod.ZodString>;
23
+ contentForms: zod.ZodOptional<zod.ZodArray<zod.ZodString>>;
24
+ }, zod_v4_core0.$loose>>;
25
+ readonly commonPlayCount: zod.ZodBoolean & SchemaHasDefaultValue;
26
+ readonly commonEpisodes: zod.ZodBoolean & SchemaHasDefaultValue;
27
+ readonly items: zod.ZodArray<zod.ZodObject<{
28
+ readonly contentId: zod.ZodString & SchemaHasDefaultValue;
29
+ readonly title: zod.ZodString & SchemaHasDefaultValue;
30
+ readonly contentDescription: zod.ZodString & SchemaHasDefaultValue;
31
+ readonly cover: zod.ZodString & SchemaHasDefaultValue;
32
+ readonly useVideoPoster: zod.ZodBoolean & SchemaHasDefaultValue;
33
+ readonly showPlayCount: zod.ZodBoolean & SchemaHasDefaultValue;
34
+ readonly showEpisodes: zod.ZodBoolean & SchemaHasDefaultValue;
35
+ readonly badge: zod.ZodString & SchemaHasDefaultValue;
36
+ }, zod_v4_core0.$strip>> & SchemaHasDefaultValue;
32
37
  } & {
33
- mode: z.ZodOptional<z.ZodEnum<{
38
+ mode: zod.ZodOptional<zod.ZodEnum<{
34
39
  renderer: "renderer";
35
40
  editor: "editor";
36
41
  }>>;
37
- }, z.core.$strip>;
42
+ }, zod_v4_core0.$strip>;
38
43
  //#endregion
39
44
  export { imageTextRecommendInspectorPropsSchema };
@@ -1,2 +1,2 @@
1
1
 
2
- import{defineComponentPropsSchema as e}from"../../../../utils/schema/schema.mjs";import{z as t}from"zod";const n=e(e=>({title:e.string(`推荐视频`,{label:`推荐位名称`}),moduleCount:e.number(1,{label:`推荐模块数`}),layout:e.object({enabled:e.boolean(!1,{fieldType:`switch`,label:`智能铺设`}),tags:e.array(t.string(),{label:`取数范围标签`,defaultValue:[`电影`]})},{label:`智能铺设`,defaultValue:{enabled:!1,tags:[`电影`]}}),commonPlayCount:e.boolean(!0,{fieldType:`switch`,label:`通用播放量`}),commonEpisodes:e.boolean(!0,{fieldType:`switch`,label:`通用集数`}),items:e.array(e.object({contentId:e.string(``,{label:`推荐位内容`}),title:e.string(`视频标题`,{label:`推荐位内容名称`}),contentDescription:e.string(``,{label:`内容说明简介`}),cover:e.string(``,{label:`推荐位封面`}),useVideoPoster:e.boolean(!0,{fieldType:`switch`,label:`沿用视频海报`}),showPlayCount:e.boolean(!1,{fieldType:`switch`,label:`播放量显示`}),showEpisodes:e.boolean(!0,{fieldType:`switch`,label:`集数展示`}),badge:e.string(``,{label:`推荐位角标`,description:`角标图片地址,可通过低代码平台配置上传;留空则使用默认角标图`})}),{label:`推荐位模块`,defaultValue:[{contentId:`d6a35ba3279e6f0d`,title:`视频标题 1`,contentDescription:``,cover:``,useVideoPoster:!0,showPlayCount:!0,showEpisodes:!0,badge:``},{contentId:`eaf60eab4938489d`,title:`视频标题 2`,contentDescription:``,cover:``,useVideoPoster:!0,showPlayCount:!0,showEpisodes:!0,badge:``},{contentId:`c45fe58f91d1c986`,title:`视频标题 3`,contentDescription:``,cover:``,useVideoPoster:!0,showPlayCount:!0,showEpisodes:!0,badge:``}]})}));export{n as imageTextRecommendInspectorPropsSchema};
2
+ import{defineComponentPropsSchema as e}from"../../../../utils/schema/schema.mjs";import{homeRecommendSmartLayoutSchema as t}from"../home-recommend/shared/home-recommend-smart-layout.mjs";const n=e(e=>({title:e.string(`推荐视频`,{label:`推荐位名称`}),moduleCount:e.number(1,{label:`推荐模块数`}),layout:t.optional(),commonPlayCount:e.boolean(!0,{fieldType:`switch`,label:`通用播放量`}),commonEpisodes:e.boolean(!0,{fieldType:`switch`,label:`通用集数`}),items:e.array(e.object({contentId:e.string(``,{label:`推荐位内容`}),title:e.string(`视频标题`,{label:`推荐位内容名称`}),contentDescription:e.string(``,{label:`内容说明简介`}),cover:e.string(``,{label:`推荐位封面`}),useVideoPoster:e.boolean(!0,{fieldType:`switch`,label:`沿用视频海报`}),showPlayCount:e.boolean(!1,{fieldType:`switch`,label:`播放量显示`}),showEpisodes:e.boolean(!0,{fieldType:`switch`,label:`集数展示`}),badge:e.string(``,{label:`推荐位角标`,description:`角标图片地址,可通过低代码平台配置上传;留空则使用默认角标图`})}),{label:`推荐位模块`,defaultValue:[{contentId:`d6a35ba3279e6f0d`,title:`视频标题 1`,contentDescription:``,cover:``,useVideoPoster:!0,showPlayCount:!0,showEpisodes:!0,badge:``},{contentId:`eaf60eab4938489d`,title:`视频标题 2`,contentDescription:``,cover:``,useVideoPoster:!0,showPlayCount:!0,showEpisodes:!0,badge:``},{contentId:`c45fe58f91d1c986`,title:`视频标题 3`,contentDescription:``,cover:``,useVideoPoster:!0,showPlayCount:!0,showEpisodes:!0,badge:``}]})}));export{n as imageTextRecommendInspectorPropsSchema};
@@ -1,2 +1,2 @@
1
1
 
2
- import{pContentBatchGetVideoDetail as e,pContentGetPopularVideoList as t}from"../../../../service/generated/client.mjs";import{pContentBatchGetVideoDetailKey as n,pContentGetPopularVideoListKey as r}from"../../../../service/generated/tanstack.mjs";import{IMAGE_TEXT_RECOMMEND_FIXED_BATCH_SIZE as i,getImageTextRecommendFixedIds as a,getImageTextRecommendLayoutTags as o}from"../../../../hooks/image-text-recommend.mjs";import{HydrationBoundary as s}from"../../../../hooks/query/hydration-boundary.mjs";import{buildSmartPopularQuery as c,buildStableChosenTags as l}from"./shared/query.mjs";import{ImageTextRecommendClient as u}from"./client.mjs";import{jsx as d}from"react/jsx-runtime";const f=[];async function p(p){let{mode:m=`renderer`,...h}=p,g=h.items??f,_=h.layout,v=[],y=!!_?.enabled,b=a(g,y),x=o(_),S=g?.length??0;if(m===`renderer`&&g?.length)try{if(y){let e=c(l(x,S),S),n=await t(e);v.push({queryKey:r(e),queryFn:()=>Promise.resolve(n)})}else if(b.length>0){let t={ids:b.length<=i?b:b.slice(0,i)},r=await e(t);console.log(`res`,r),v.push({queryKey:n(t),queryFn:()=>Promise.resolve(r)})}}catch(e){console.warn(`[image-text-recommend] server prefetch failed:`,e)}return d(s,{prefetch:v,children:d(u,{...h,mode:m})})}export{p as ImageTextRecommendServer};
2
+ import{pContentBatchGetVideoDetail as e,pContentGetNewstVideoList as t,pContentGetPopularVideoList as n}from"../../../../service/generated/client.mjs";import{pContentBatchGetVideoDetailKey as r,pContentGetNewstVideoListKey as i,pContentGetPopularVideoListKey as a}from"../../../../service/generated/tanstack.mjs";import{IMAGE_TEXT_RECOMMEND_FIXED_BATCH_SIZE as o,getImageTextRecommendFixedIds as s}from"../../../../hooks/image-text-recommend.mjs";import{HydrationBoundary as c}from"../../../../hooks/query/hydration-boundary.mjs";import{normalizeHomeRecommendSmartLayout as l}from"../home-recommend/shared/home-recommend-smart-layout.mjs";import{buildImageTextSmartListBody as u,resolveImageTextSmartListKind as d}from"./shared/query.mjs";import{ImageTextRecommendClient as f}from"./client.mjs";import{jsx as p}from"react/jsx-runtime";const m=[];async function h(h){let{mode:g=`renderer`,..._}=h,v=_.items??m,y=[],b=l(_.layout),x=b?.enabled===!0,S=s(v,x),C=v?.length??0;if(g===`renderer`&&v?.length)try{if(x&&b){let e=d(b.sortRule),r=u(b,{targetCount:C}),o=e===`newest`?await t(r):await n(r);y.push({queryKey:e===`newest`?i(r):a(r),queryFn:()=>Promise.resolve(o)})}else if(S.length>0){let t={ids:S.length<=o?S:S.slice(0,o)},n=await e(t);y.push({queryKey:r(t),queryFn:()=>Promise.resolve(n)})}}catch(e){console.warn(`[image-text-recommend] server prefetch failed:`,e)}return p(c,{prefetch:y,children:p(f,{..._,mode:g})})}export{h as ImageTextRecommendServer};
@@ -1,2 +1,2 @@
1
1
 
2
- import{IMAGE_TEXT_RECOMMEND_FIXED_BATCH_SIZE as e}from"../../../../../hooks/image-text-recommend.mjs";function t(e,t){let n=e.map(e=>String(e).trim()).filter(Boolean);if(!n.length||t<=0)return[];if(n.length>=t)return n.slice(0,t);let r=[...n];for(;r.length<t;)r.push(n[r.length%n.length]);return r}function n(t,n){return n>e?{page_size:e,tags:t.length?Array.from(new Set(t)):void 0}:{page_size:Math.max(20,n*10),tags:t.length?Array.from(new Set(t)):void 0}}export{n as buildSmartPopularQuery,t as buildStableChosenTags};
2
+ import{IMAGE_TEXT_RECOMMEND_FIXED_BATCH_SIZE as e}from"../../../../../hooks/image-text-recommend.mjs";import{isHomeRecommendLatestSortRule as t}from"../../home-recommend/shared/home-recommend-smart-layout.mjs";function n(e){return t(e)?`newest`:`popular`}function r(t,n){let{targetCount:r,cursor:i,pageSize:a}=n,o=t.tagIds.length>0?t.tagIds:void 0,s=t.catIds.length>0?t.catIds:void 0,c;return c=a===void 0?r>e?e:Math.max(20,r*10):a,{cursor:i||void 0,page_size:c,tags:o,cat_ids:s}}export{r as buildImageTextSmartListBody,n as resolveImageTextSmartListKind};
@@ -78,6 +78,11 @@ import { schema as schema$11 } from "./home-recommend/home-recommend-waterfall/s
78
78
  import { HomeRecommendWaterfall } from "./home-recommend/home-recommend-waterfall/server.mjs";
79
79
  import { homeRecommendWaterfallMaterial } from "./home-recommend/home-recommend-waterfall/material.mjs";
80
80
  import "./home-recommend/index.mjs";
81
+ import { hotRecommendInspectorPropsSchema } from "./hot-recommend/schema.mjs";
82
+ import { HotRecommendClient, HotRecommendProps } from "./hot-recommend/client.mjs";
83
+ import { HotRecommendServer } from "./hot-recommend/server.mjs";
84
+ import { hotRecommendMaterial } from "./hot-recommend/material.mjs";
85
+ import "./hot-recommend/index.mjs";
81
86
  import { imageTextRecommendInspectorPropsSchema } from "./image-text-recommend/schema.mjs";
82
87
  import { ImageTextRecommendClient, ImageTextRecommendProps } from "./image-text-recommend/client.mjs";
83
88
  import { ImageTextRecommendServer } from "./image-text-recommend/server.mjs";
@@ -97,7 +102,7 @@ import { BasicPostCardClient } from "./post-card/variants/basic-post-card/runtim
97
102
  import { schema as schema$13 } from "./post-card/variants/basic-post-card/schema/index.mjs";
98
103
  import "./post-card/index.mjs";
99
104
  import { ProfileHeaderInspectorProps, UserProfileHeaderAuthConfig, UserProfileHeaderClientProps, profileHeaderInspectorDefaultProps, profileHeaderInspectorPropsSchema } from "./profile/profile-header/schema.mjs";
100
- import { UserProfileHeaderClient } from "./profile/profile-header/client.mjs";
105
+ import { UserProfileHeaderClient, defaultBackground } from "./profile/profile-header/client.mjs";
101
106
  import { profileHeaderMaterial, profileHeaderMaterialWithDisabledBackground } from "./profile/profile-header/material.mjs";
102
107
  import { ProfileMainInspectorProps, UserProfileMainProps, profileMainInspectorDefaultProps, profileMainInspectorPropsSchema } from "./profile/profile-main/schema.mjs";
103
108
  import { UserProfileMainClient } from "./profile/profile-main/client.mjs";
@@ -1,2 +1,2 @@
1
1
 
2
- 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/link.mjs";import{getFeedAdIcon as i,getFeedAdJumpUrl as a,isFeedAdItem as o}from"../advertisement/feed-ad/index.mjs";import s from"../../../../assets/icons/view.mjs";import{jsx as c,jsxs as l}from"react/jsx-runtime";function u(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 d({data:d}){return d?c(t,{children:(Array.isArray(d)?d:[d]).map((d,f)=>{if(!d||typeof d!=`object`)return null;let{id:p,title:m,desc:h,cover:g,tagImageUrl:_,showEpisode:v,episodeText:y,showPlayCount:b,play_count:x}=d,S=o(d),C=m||``,w=(S?i(d):``)||g,T=S?a(d):p?`/video/${p}/${C?encodeURIComponent(C):``}`:`#`,E=_?String(_):null,D=y==null?``:String(y).trim(),O=!S&&(v??!0)&&D!==``,k=!S&&(b??!0),A=u(x);return S?c(t,{children:c(r,{href:T,children:l(t,{className:`relative w-full overflow-hidden rounded-[8px] bg-[rgba(90,90,90,0.48)]`,style:{aspectRatio:`358 / 263`},children:[l(t,{className:`absolute inset-x-0 top-0 overflow-hidden`,style:{height:`83.65%`},children:[w&&c(t,{className:`absolute top-0`,style:{left:`-6.42%`,width:`202.24%`,height:`163.64%`},children:c(e,{src:w,alt:C||`广告封面`,fill:!0,objectFit:`cover`})}),c(t,{className:`absolute right-0 top-0 flex items-center justify-center`,style:{width:`15.64%`,height:`9.51%`,minWidth:`56px`,minHeight:`25px`,borderBottomLeftRadius:`16px`,backgroundColor:`rgba(0, 0, 0, 0.33)`},children:c(n,{className:`text-white`,style:{fontSize:`clamp(12px, 3.35vw, 16px)`,lineHeight:`normal`},children:`广告`})})]}),l(t,{className:`absolute inset-x-0 bottom-0 flex items-center justify-between bg-white`,style:{height:`16.35%`,minHeight:`43px`,padding:`0 3.35%`},children:[c(t,{className:`min-w-0 flex-1`,style:{paddingRight:`3.35%`},children:c(n,{as:`h3`,className:`line-clamp-1 text-[#161616]`,style:{fontSize:`clamp(14px, 3.9vw, 18px)`,lineHeight:`normal`},children:C})}),c(t,{className:`flex shrink-0 items-center justify-center rounded-[16px] border border-[#FD4C5E]`,style:{width:`14.53%`,height:`10.27%`,minWidth:`52px`,minHeight:`27px`},children:c(n,{className:`text-[#FD4C5E]`,style:{fontSize:`clamp(14px, 3.9vw, 18px)`,lineHeight:`normal`},children:`前往`})})]})]})})},p||C||`large-grid-item-${f}`):c(t,{children:l(r,{href:T,children:[l(t,{className:`relative w-full overflow-hidden rounded-[12px] bg-neutral-800`,style:{aspectRatio:`16/9`},children:[w&&c(e,{src:w,alt:C||`封面`,fill:!0,objectFit:`cover`}),E&&c(t,{className:`absolute top-0 right-0 z-10 w-[37px] h-[20px]`,children:c(e,{src:E,alt:C||`角标`,fill:!0,sizes:`37px`,className:`object-contain`})}),c(t,{className:`absolute inset-x-0 bottom-0 h-[40px] bg-gradient-to-t from-black/80 to-transparent z-0 pointer-events-none`}),k&&l(t,{className:`absolute bottom-0 left-[8px] mb-[6px] z-10 flex items-center gap-[4px]`,children:[c(s,{className:`h-[14px] w-[14px] text-white`}),c(n,{as:`span`,className:`text-[12px] font-medium text-white drop-shadow-md`,children:A})]}),O&&c(t,{className:`absolute bottom-0 right-[8px] mb-[6px] z-10 flex items-center`,children:c(n,{as:`span`,className:`text-[12px] font-medium text-white drop-shadow-md`,children:D})})]}),l(t,{className:`flex items-center justify-between gap-[12px] pt-[10px] px-2`,children:[l(t,{className:`flex-1 min-w-0`,children:[c(n,{as:`h3`,className:`text-[16px] font-semibold leading-[24px] text-text1 line-clamp-1`,children:C}),h&&c(n,{as:`p`,className:`mt-[4px] text-[13px] leading-[20px] text-text2 line-clamp-1`,children:h})]}),c(n,{className:`shrink-0 rounded-[20px] border border-[#FD4C5E] px-[24px] py-[8px] text-[14px] font-normal text-[#FD4C5E]`,children:`观看`})]})]})},p||C||`large-grid-item-${f}`)})}):null}export{d as LargeGridItemClient};
2
+ 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/link.mjs";import i from"../../../../assets/icons/view.mjs";import{Fragment as a,jsx as o,jsxs as s}from"react/jsx-runtime";function c(e){let t=Number(e||0);if(Number.isNaN(t)||t<=0)return``;if(t>=1e6){let e=(t/1e6).toFixed(1);return e.endsWith(`.0`)?`${e.slice(0,-2)}M`:`${e}M`}return t>=1e3?`${(t/1e3).toFixed(1)}k`:String(Math.floor(t))}function l({data:l}){return l?o(t,{className:`flex flex-col gap-[12px]`,children:(Array.isArray(l)?l:[l]).map((l,u)=>{if(!l||typeof l!=`object`)return null;let{id:d,title:f,desc:p,cover:m,tagImageUrl:h,showEpisode:g,episodeText:_,showPlayCount:v,play_count:y}=l,b=f||``,x=d?`/video/${d}/${b?encodeURIComponent(b):``}`:`#`,S=_==null?``:String(_).trim(),C=(g??!0)&&S!==``,w=v??!0,T=c(y)||`0`;return o(t,{children:o(r,{href:x,className:`block`,children:s(t,{className:`relative h-[204px] w-full overflow-hidden rounded-[8px] bg-[rgba(6,3,20,0.5)]`,children:[s(t,{className:`relative h-[134px] w-full overflow-hidden rounded-t-[8px]`,children:[m&&o(e,{src:m,alt:b||`封面`,fill:!0,objectFit:`cover`}),h&&String(h).trim()&&o(t,{className:`absolute left-[16px] top-[12px]`,children:o(t,{className:`inline-flex items-center justify-center rounded-[4px] px-[4px] py-[4px]`,style:{background:`linear-gradient(90deg, #CA3FE9 0%, #9756E3 100%)`},children:o(e,{src:String(h),alt:``,width:75,height:14,className:`h-[14px] w-auto object-contain`})})}),s(t,{className:`absolute bottom-[12px] left-[16px] right-[16px] flex items-center justify-between`,children:[o(t,{className:`flex items-center gap-[4px]`,children:w&&s(a,{children:[o(i,{className:`size-[22px] text-white opacity-80`}),o(n,{className:`text-[14px] leading-[20px] text-white`,children:T})]})}),C&&o(n,{className:`text-[14px] leading-[20px] text-white`,children:S})]})]}),o(t,{className:`px-[16px] pt-[12px]`,children:s(t,{className:`flex flex-col gap-[2px]`,children:[o(n,{className:`line-clamp-1 text-[16px] font-medium leading-[22px] text-white`,children:b}),p&&o(n,{className:`line-clamp-1 text-[14px] leading-[20px] text-white/50`,children:p})]})})]})})},d||b||`large-grid-item-${u}`)})}):null}export{l as LargeGridItemClient};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{isClient as e}from"../../../../utils/common.mjs";import{pContentBatchGetVideoDetail as t}from"../../../../service/generated/client.mjs";import{Box as n}from"../../../ui/box.mjs";import{Text as r}from"../../../ui/text.mjs";import i from"../../../ui/loading.mjs";import a from"../../../ui/link.mjs";import{useSingleFirstRowHeight as o}from"../../../../hooks/use-first-row-height.mjs";import{useMinDurationLoading as s}from"../../../../hooks/use-min-duration-loading.mjs";import c from"../../../../assets/icons/common/right_arrow.mjs";import{isFeedAdItem as l}from"../advertisement/feed-ad/index.mjs";import{LargeGridItemClient as u}from"./card-item.mjs";import{largeFeatureGridInspectorDefaultProps as d}from"./schema.mjs";import{useEffect as f,useMemo as p,useRef as m,useState as h}from"react";import{jsx as g,jsxs as _}from"react/jsx-runtime";const v=[],y=d.data??[];function b(e){return e==null}function x(e,t){return b(e)?t:e}function S(e){return typeof e==`string`?e.trim():``}function C(e){return S(e)}function w(e){let t=Number(e);if(!(!Number.isFinite(t)||t<0))return t}function T(e){let t=e,n=S(e.update_status)===`0`,r=(Array.isArray(t.episodes)?t.episodes.length:0)||(Array.isArray(e.video_episodes)?e.video_episodes.length:0)||(Array.isArray(e.links)?e.links.length:0)||(w(e.episode_cnt)??0);return!Number.isFinite(r)||r<=0?``:`${n?`更新至`:`全`}${Math.floor(r)}集`}function E(e,t){return t?{...e,...t,id:x(t.id,e.id),cover:x(t.cover,e.cover),title:x(t.title,e.title),desc:x(t.desc,e.desc),play_count:x(t.play_count,e.play_count),showPlayCount:t.showPlayCount??e.showPlayCount,episodeText:x(t.episodeText,e.episodeText),showEpisode:t.showEpisode??e.showEpisode,useContentCover:t.useContentCover??e.useContentCover,tagImageUrl:x(t.tagImageUrl,e.tagImageUrl)}:e}function D(e,t){if(!t)return e;let n=e.items;return{...e,...t,title:x(t.title,e.title),moreUrl:x(t.moreUrl,e.moreUrl),moreLinkType:t.moreLinkType??e.moreLinkType,items:n?E(n,t.items):t.items}}function O({mode:d=`renderer`,data:b=v}){let x=d===`editor`,S=b??v,E=Array.isArray(S)&&S.length>0,O=p(()=>E?[D(y[0],S[0])]:y,[E,S]),[k,A]=h(O),j=m(``),M=m(null),{isLoading:N,show:P,hide:F,cancel:I}=s(500);f(()=>{A(O)},[O]);let L=o({enabled:!x,containerRef:M,itemRef:M,deps:[k.length]}),R=p(()=>{if(x||!E)return``;let e=O.map(e=>C(e?.items?.id)).filter(Boolean);return Array.from(new Set(e)).join(`,`)},[E,x,O]);if(f(()=>{if(x||!e()||!R||j.current===R)return;j.current=R;let n=!1;async function r(){try{P();let e=await t({ids:R.split(`,`).filter(Boolean)},{cache:`no-store`}),r=Array.isArray(e.data?.videos)?e.data.videos:[],i=new Map;if(r.forEach(e=>{let t=C(e.video_id||e.id||e.mid);t&&i.set(t,e)}),n)return;A(e=>e.map(e=>{let t=e.items;if(!t||l(t))return e;let n=C(t.id),r=n?i.get(n):void 0;if(!r)return e;let a=w(r.play_count)??w(r.browse_count),o=T(r);return{...e,items:{...t,play_count:a??t.play_count,episodeText:o||t.episodeText}}}))}catch(e){console.error(`大图推荐刷新首屏失败(client)`,e)}finally{n||F()}}return r(),()=>{n=!0,I()}},[I,R,F,x,P]),!k||k.length===0)return null;let z=k[0],B=z?.title,V=z?.moreUrl,H=L>0?L/2:160,U=!x&&N;return _(n,{className:x?`p-3 pointer-events-none`:`p-3`,children:[_(n,{className:`flex items-center justify-between mb-[10px] h-[24px]`,children:[B&&g(r,{as:`h2`,className:`text-[18px] font-bold text-text1 line-clamp-1 flex-1 min-w-0 mr-[12px]`,children:B}),V&&_(a,{href:V,className:`flex items-center text-[14px] text-text2 ml-auto`,children:[`更多`,g(c,{className:`ml-[2px] h-[12px] w-[12px] text-text2`})]})]}),_(n,{className:`relative`,children:[k.map((e,t)=>{let{items:r}=e;return r?g(n,{ref:t===0?M:void 0,className:t>0?`mt-3`:``,children:g(u,{data:r})},`large-feature-grid-items-${t}`):null}),U&&g(n,{className:`absolute inset-0 z-10 bg-black/15 backdrop-blur-[1px] dark:bg-white/10`,"aria-hidden":!0}),U&&g(n,{className:`absolute left-1/2 -translate-x-1/2 -translate-y-1/2 z-20 pointer-events-none`,style:{top:H},"aria-hidden":!0,children:g(i,{size:`large`,showLabel:!1,className:`text-theme5`})})]})]})}export{O as LargeFeatureGridClient};
2
+ "use client";import{isClient as e}from"../../../../utils/common.mjs";import{pContentBatchGetVideoDetail as t}from"../../../../service/generated/client.mjs";import{Box as n}from"../../../ui/box.mjs";import{Text as r}from"../../../ui/text.mjs";import i from"../../../ui/loading.mjs";import a from"../../../ui/link.mjs";import{useSingleFirstRowHeight as o}from"../../../../hooks/use-first-row-height.mjs";import{useMinDurationLoading as s}from"../../../../hooks/use-min-duration-loading.mjs";import c from"../../../../assets/icons/common/right_arrow.mjs";import{isFeedAdItem as l}from"../advertisement/feed-ad/index.mjs";import{LargeGridItemClient as u}from"./card-item.mjs";import{largeFeatureGridInspectorDefaultProps as d}from"./schema.mjs";import{useEffect as f,useMemo as p,useRef as m,useState as h}from"react";import{jsx as g,jsxs as _}from"react/jsx-runtime";const v=[],y=d.data??[];function b(e){return e==null}function x(e,t){return b(e)?t:e}function S(e){return typeof e==`string`?e.trim():``}function C(e){return S(e)}function w(e){let t=Number(e);if(!(!Number.isFinite(t)||t<0))return t}function T(e){let t=e,n=S(e.update_status)===`0`,r=(Array.isArray(t.episodes)?t.episodes.length:0)||(Array.isArray(e.video_episodes)?e.video_episodes.length:0)||(Array.isArray(e.links)?e.links.length:0)||(w(e.episode_cnt)??0);return!Number.isFinite(r)||r<=0?``:`${n?`更新至`:`全`}${Math.floor(r)}集`}function E(e,t){return t?{...e,...t,id:x(t.id,e.id),cover:x(t.cover,e.cover),title:x(t.title,e.title),desc:x(t.desc,e.desc),play_count:x(t.play_count,e.play_count),showPlayCount:t.showPlayCount??e.showPlayCount,episodeText:x(t.episodeText,e.episodeText),showEpisode:t.showEpisode??e.showEpisode,useContentCover:t.useContentCover??e.useContentCover,tagImageUrl:x(t.tagImageUrl,e.tagImageUrl)}:e}function D(e,t){if(!t)return e;let n=e.items;return{...e,...t,title:x(t.title,e.title),moreUrl:x(t.moreUrl,e.moreUrl),moreLinkType:t.moreLinkType??e.moreLinkType,items:n?E(n,t.items):t.items}}function O({mode:d=`renderer`,data:b=v}){let x=d===`editor`,S=b??v,E=Array.isArray(S)&&S.length>0,O=p(()=>E?[D(y[0],S[0])]:y,[E,S]),[k,A]=h(O),j=m(``),M=m(null),{isLoading:N,show:P,hide:F,cancel:I}=s(500);f(()=>{A(O)},[O]);let L=o({enabled:!x,containerRef:M,itemRef:M,deps:[k.length]}),R=p(()=>{if(x||!E)return``;let e=O.map(e=>C(e?.items?.id)).filter(Boolean);return Array.from(new Set(e)).join(`,`)},[E,x,O]);if(f(()=>{if(x||!e()||!R||j.current===R)return;j.current=R;let n=!1;async function r(){try{P();let e=await t({ids:R.split(`,`).filter(Boolean)},{cache:`no-store`}),r=Array.isArray(e.data?.videos)?e.data.videos:[],i=new Map;if(r.forEach(e=>{let t=C(e.video_id||e.id||e.mid);t&&i.set(t,e)}),n)return;A(e=>e.map(e=>{let t=e.items;if(!t||l(t))return e;let n=C(t.id),r=n?i.get(n):void 0;if(!r)return e;let a=w(r.play_count)??w(r.browse_count)??w(r.view_count),o=T(r);return{...e,items:{...t,play_count:a??t.play_count,episodeText:o||t.episodeText}}}))}catch(e){console.error(`大图推荐刷新首屏失败(client)`,e)}finally{n||F()}}return r(),()=>{n=!0,I()}},[I,R,F,x,P]),!k||k.length===0)return null;let z=k[0],B=z?.title,V=z?.moreUrl,H=L>0?L/2:160,U=!x&&N;return _(n,{className:x?`p-3 pointer-events-none`:`p-3`,children:[_(n,{className:`flex items-center justify-between mb-[10px] h-[24px]`,children:[B&&g(r,{as:`h2`,className:`text-[18px] font-bold text-text1 line-clamp-1 flex-1 min-w-0 mr-[12px]`,children:B}),V&&_(a,{href:V,className:`flex items-center text-[14px] text-text2 ml-auto`,children:[`更多`,g(c,{className:`ml-[2px] h-[12px] w-[12px] text-text2`})]})]}),_(n,{className:`relative`,children:[k.map((e,t)=>{let{items:r}=e;return r?g(n,{ref:t===0?M:void 0,className:t>0?`mt-3`:``,children:g(u,{data:r})},`large-feature-grid-items-${t}`):null}),U&&g(n,{className:`absolute inset-0 z-10 bg-black/15 backdrop-blur-[1px] dark:bg-white/10`,"aria-hidden":!0}),U&&g(n,{className:`absolute left-1/2 -translate-x-1/2 -translate-y-1/2 z-20 pointer-events-none`,style:{top:H},"aria-hidden":!0,children:g(i,{size:`large`,showLabel:!1,className:`text-theme5`})})]})]})}export{O as LargeFeatureGridClient};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{useRouter as e}from"../../../../utils/use-compatible-router.mjs";import{Image as t}from"../../../ui/image.mjs";import{Box as n}from"../../../ui/box.mjs";import{Text as r}from"../../../ui/text.mjs";import i from"../../../../assets/icons/marquee-enter.mjs";import a from"../../../../assets/images/marquee.mjs";import o from"./marquee.module.mjs";import{defaultMarqueePeriod as s}from"./schema.mjs";import{useEffect as c,useMemo as l,useRef as u,useState as d}from"react";import{X as f}from"lucide-react";import{jsx as p,jsxs as m}from"react/jsx-runtime";import{useTranslations as h}from"next-intl";const g=[],_=`marquee_list`;let v=null;function y(e,t=20){let n=Array.from(e);return n.length<=t?e:`${n.slice(0,t).join(``)}...`}function b(e,t){if(!e)return!1;if(t===`once`)return!0;let n=new Date(e),r=new Date;return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()&&n.getDate()===r.getDate()}function x(){if(v)return v;let e=localStorage.getItem(_);if(!e)return v={},{};try{let t=JSON.parse(e);if(!t||typeof t!=`object`)return{};let n={};return Object.entries(t).forEach(([e,t])=>{if(!t||typeof t!=`object`)return;let r=t.closedAt;typeof r!=`number`||Number.isNaN(r)||(n[e]={closedAt:r})}),v=n,n}catch{return v={},{}}}function S(e){v=e,localStorage.setItem(_,JSON.stringify(e))}function C(e){return x()[e]??{}}function w(e,t){S({...x(),[e]:t})}function T(e,t){return b(e.closedAt,t)}function E(_){let v=h(`components.biz.business.marquee`),{marqueeKey:b,contents:x=g,click:S,close:E,displayStrategy:D,mode:O=`renderer`}=_,k=O===`editor`,A=e(),j=u(!1),[M,N]=d(k),[P,F]=d(k),[I,L]=d(!1),[R,z]=d(0);c(()=>{L(!0)},[]);let B=l(()=>{let e=D?.period??s,t=e.start,n=e.end;if(!t&&!n)return!0;let r=Date.now(),i=t?new Date(t).getTime():0,a=n?new Date(n).getTime():2**53-1;return r>=i&&r<=a},[D?.period]),V=l(()=>(x??[]).map(e=>({...e,text:y(String(e?.text??``))})).filter(e=>!!e.text),[x]),H=b?.trim()??``;if(c(()=>{z(0)},[l(()=>V.map(e=>`${e.text??``}::${e.link??``}`).join(`|`),[V]),H]),c(()=>{k||H||j.current||process.env.NODE_ENV===`production`||(j.current=!0,console.warn(`[MarqueeClient] marqueeKey is required in renderer mode.`))},[k,H]),c(()=>{if(I){if(k){N(!0),F(!0);return}if(!D?.rule||!B||V.length===0){N(!1),F(!0);return}if(!H){N(!1),F(!0);return}N(!T(C(H),D.rule)),F(!0)}},[D?.rule,k,I,B,V.length,H]),!k&&(!I||!P||!M||!B)||V.length===0)return null;let U=V[R%V.length],W=S?.enabled===!0,G=S?.link||U.link,K=W&&!!G,q=E?.enabled===!0;function J(){!H||!D?.rule||V.length===0||w(H,{...C(H),closedAt:Date.now()})}let Y=e=>{e.stopPropagation(),N(!1),J()};function X(e){if(typeof window>`u`){A.push(e);return}if(window.isWebView===!0)try{let t=new URL(e,window.location.href);if(t.origin===window.location.origin){let e=t.pathname.split(`/`).filter(Boolean),n=e.findIndex(e=>e===`video`);n>=0&&(e[n]=`webview`,t.pathname=`/${e.join(`/`)}`)}window.location.href=t.toString();return}catch{window.location.href=e;return}A.push(e)}function Z(){k||K&&G&&(N(!1),J(),X(G))}let Q=()=>{k||!M||V.length<=1||z(e=>(e+1)%V.length)},$=k?o[`marquee-item-paused`]:V.length>1?o[`marquee-item-once`]:o[`marquee-item-loop`];return p(n,{className:k?`px-3 py-2 w-full bg-bg1 pointer-events-none`:`px-3 py-2 w-full bg-bg1`,children:m(n,{className:`pl-[2px] pr-[12px] py-[2px] flex items-center w-full cursor-pointer relative rounded-[8px] overflow-hidden ${o[`marquee-shell`]}`,onClick:Z,children:[p(n,{className:`relative shrink-0 w-[36px] h-[36px] mr-[4px]`,children:p(t,{src:typeof a==`string`?a:a.src,alt:v(`noticeAlt`),fill:!0,className:`object-cover`,unoptimized:!0})}),p(n,{className:`flex-1 overflow-hidden relative h-[22px] ml-1`,children:p(n,{className:`absolute inset-y-0 left-0 flex items-center whitespace-nowrap ${$}`,onAnimationEnd:Q,children:p(r,{className:`inline-block text-[14px] text-[#f59e0b] leading-[22px] font-medium`,children:U.text})},`marquee-item-${R}`)}),m(n,{className:`flex items-center gap-[12px] shrink-0 ml-[4px]`,children:[K&&p(i,{className:`h-[16px] w-[16px] shrink-0`}),q&&p(n,{className:`opacity-30 hover:opacity-100 transition-opacity`,onClick:Y,children:p(f,{className:`w-[12px] h-[12px] text-[#F59E0B]`})})]})]})})}export{E as MarqueeClient};
2
+ "use client";import{useRouter as e}from"../../../../utils/use-compatible-router.mjs";import{Box as t}from"../../../ui/box.mjs";import{Text as n}from"../../../ui/text.mjs";import r from"../../../../assets/icons/marquee-close.mjs";import i from"../../../../assets/icons/marquee-speaker.mjs";import{defaultMarqueePeriod as a}from"./schema.mjs";import{useEffect as o,useLayoutEffect as s,useMemo as c,useRef as l,useState as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";const p=[],m=`marquee_list`;let h=null;function g(e,t=20){let n=Array.from(e);return n.length<=t?e:`${n.slice(0,t).join(``)}...`}function _(e,t){if(!e)return!1;if(t===`once`)return!0;let n=new Date(e),r=new Date;return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()&&n.getDate()===r.getDate()}function v(){if(h)return h;let e=localStorage.getItem(m);if(!e)return h={},{};try{let t=JSON.parse(e);if(!t||typeof t!=`object`)return{};let n={};return Object.entries(t).forEach(([e,t])=>{if(!t||typeof t!=`object`)return;let r=t.closedAt;typeof r!=`number`||Number.isNaN(r)||(n[e]={closedAt:r})}),h=n,n}catch{return h={},{}}}function y(e){h=e,localStorage.setItem(m,JSON.stringify(e))}function b(e){return v()[e]??{}}function x(e,t){y({...v(),[e]:t})}function S(e,t){return _(e.closedAt,t)}function C(m){let{marqueeKey:h,contents:_=p,close:v,displayStrategy:y,mode:C=`renderer`}=m,w=C===`editor`,T=e(),E=l(!1),D=l(null),O=l(null),[k,A]=u(w),[j,M]=u(w),[N,P]=u(!1),[F,I]=u(0);o(()=>{P(!0)},[]);let L=c(()=>{let e=y?.period??a,t=e.start,n=e.end;if(!t&&!n)return!0;let r=Date.now(),i=t?new Date(t).getTime():0,o=n?new Date(n).getTime():2**53-1;return r>=i&&r<=o},[y?.period]),R=c(()=>(_??[]).map(e=>({...e,text:g(String(e?.text??``))})).filter(e=>!!e.text),[_]),z=h?.trim()??``,B=c(()=>R.map(e=>`${e.text??``}::${e.link??``}`).join(`|`),[R]);if(o(()=>{I(0)},[B,z]),o(()=>{w||z||E.current||process.env.NODE_ENV===`production`||(E.current=!0,console.warn(`[MarqueeClient] marqueeKey is required in renderer mode.`))},[w,z]),o(()=>{if(N){if(w){A(!0),M(!0);return}if(!y?.rule||!L||R.length===0){A(!1),M(!0);return}if(!z){A(!0),M(!0);return}A(!S(b(z),y.rule)),M(!0)}},[y?.rule,w,N,L,R.length,z]),s(()=>{if(w)return;let e=D.current,t=O.current;if(!e||!t)return;let n=e.offsetWidth,r=t.scrollWidth,i=n+r,a=Math.max(i/80,3)*1e3,o=t.animate([{transform:`translateX(${n}px)`},{transform:`translateX(-${r}px)`}],{duration:a,iterations:R.length<=1?1/0:1,easing:`linear`,fill:`forwards`});return o.onfinish=()=>{R.length>1&&I(e=>(e+1)%R.length)},()=>o.cancel()},[F,B,w,k,R.length]),!w&&(!N||!j||!k||!L)||R.length===0)return null;let V=R[F%R.length],H=V?.click,U=H?.enabled===!0,W=H?.link,G=U&&!!W,K=v?.enabled===!0;function q(){!z||!y?.rule||R.length===0||x(z,{...b(z),closedAt:Date.now()})}let J=e=>{e.stopPropagation(),A(!1),q()};function Y(e){if(typeof window>`u`){T.push(e);return}if(window.isWebView===!0)try{let t=new URL(e,window.location.href);if(t.origin===window.location.origin){let e=t.pathname.split(`/`).filter(Boolean),n=e.findIndex(e=>e===`video`);n>=0&&(e[n]=`webview`,t.pathname=`/${e.join(`/`)}`)}window.location.href=t.toString();return}catch{window.location.href=e;return}T.push(e)}function X(){w||G&&W&&(A(!1),q(),Y(W))}let Z=K?d(`button`,{type:`button`,"aria-label":`关闭`,className:`flex size-6 shrink-0 items-center justify-center overflow-hidden p-0.5`,onClick:J,children:d(r,{className:`h-5 w-5`,"aria-hidden":!0})}):d(t,{className:`flex size-6 shrink-0 items-center justify-center overflow-hidden p-0.5`,"aria-hidden":!0});return f(t,{className:`grid h-8 w-full grid-cols-[20px_1fr_24px] items-center gap-2 bg-white/10 px-4 py-1 backdrop-blur-[2px] ${G?`cursor-pointer`:``} ${w?`pointer-events-none`:``}`,onClick:X,children:[d(i,{className:`h-5 w-5 shrink-0`,"aria-hidden":!0}),d(t,{ref:D,className:`relative h-5 min-w-0 w-full overflow-hidden`,children:d(t,{ref:O,className:`absolute inset-y-0 left-0 flex items-center whitespace-nowrap`,children:d(n,{className:`inline-block font-sans text-[14px] font-normal leading-[20px] not-italic text-white/90`,children:V.text})},`marquee-item-${F}`)}),Z]})}export{C as MarqueeClient};
@@ -15,13 +15,12 @@ declare const marqueeMaterial: DefineMaterialOption<typeof MarqueeServer, typeof
15
15
  readonly marqueeKey: zod.ZodString & SchemaHasDefaultValue;
16
16
  readonly contents: zod.ZodArray<zod.ZodObject<{
17
17
  readonly text: zod.ZodString & SchemaHasDefaultValue;
18
- readonly link: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
18
+ readonly click: zod.ZodObject<{
19
+ readonly enabled: zod.ZodBoolean & SchemaHasDefaultValue;
20
+ readonly redirectType: zod.ZodOptional<zod.ZodType<"content" | "link" | "content_list", unknown, zod_v4_core0.$ZodTypeInternals<"content" | "link" | "content_list", unknown>>> & SchemaHasDefaultValue;
21
+ readonly link: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
22
+ }, zod_v4_core0.$strip> & SchemaHasDefaultValue;
19
23
  }, zod_v4_core0.$strip>> & SchemaHasDefaultValue;
20
- readonly click: zod.ZodObject<{
21
- readonly enabled: zod.ZodBoolean & SchemaHasDefaultValue;
22
- readonly redirectType: zod.ZodOptional<zod.ZodType<"content" | "link" | "content_list", unknown, zod_v4_core0.$ZodTypeInternals<"content" | "link" | "content_list", unknown>>> & SchemaHasDefaultValue;
23
- readonly link: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
24
- }, zod_v4_core0.$strip> & SchemaHasDefaultValue;
25
24
  readonly close: zod.ZodObject<{
26
25
  readonly enabled: zod.ZodBoolean & SchemaHasDefaultValue;
27
26
  }, zod_v4_core0.$strip> & SchemaHasDefaultValue;
@@ -20,13 +20,12 @@ declare const marqueeInspectorPropsSchema: zod.ZodObject<{
20
20
  readonly marqueeKey: zod.ZodString & SchemaHasDefaultValue;
21
21
  readonly contents: zod.ZodArray<zod.ZodObject<{
22
22
  readonly text: zod.ZodString & SchemaHasDefaultValue;
23
- readonly link: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
23
+ readonly click: zod.ZodObject<{
24
+ readonly enabled: zod.ZodBoolean & SchemaHasDefaultValue;
25
+ readonly redirectType: zod.ZodOptional<zod.ZodType<"content" | "link" | "content_list", unknown, zod_v4_core0.$ZodTypeInternals<"content" | "link" | "content_list", unknown>>> & SchemaHasDefaultValue;
26
+ readonly link: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
27
+ }, zod_v4_core0.$strip> & SchemaHasDefaultValue;
24
28
  }, zod_v4_core0.$strip>> & SchemaHasDefaultValue;
25
- readonly click: zod.ZodObject<{
26
- readonly enabled: zod.ZodBoolean & SchemaHasDefaultValue;
27
- readonly redirectType: zod.ZodOptional<zod.ZodType<"content" | "link" | "content_list", unknown, zod_v4_core0.$ZodTypeInternals<"content" | "link" | "content_list", unknown>>> & SchemaHasDefaultValue;
28
- readonly link: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
29
- }, zod_v4_core0.$strip> & SchemaHasDefaultValue;
30
29
  readonly close: zod.ZodObject<{
31
30
  readonly enabled: zod.ZodBoolean & SchemaHasDefaultValue;
32
31
  }, zod_v4_core0.$strip> & SchemaHasDefaultValue;
@@ -1,2 +1,2 @@
1
1
 
2
- import{defineComponentPropsSchema as e}from"../../../../utils/schema/schema.mjs";import t from"dayjs";function n(){return{start:t().startOf(`day`).format(`YYYY-MM-DD HH:mm:ss`),end:t().endOf(`day`).format(`YYYY-MM-DD HH:mm:ss`)}}const r=n(),i=e(e=>({marqueeKey:e.string(``,{label:`状态唯一标识`,required:!0,description:`外部传入唯一 marqueeKey,用于本地展示状态持久化`}),contents:e.array(e.object({text:e.string(``,{label:`文本内容`}),link:e.string(``,{label:`跳转链接`,required:!1})}),{label:`消息内容`,defaultValue:[{text:`请输入跑马灯内容`}],description:`支持多条消息循环播放`}),click:e.object({enabled:e.boolean(!0,{fieldType:`switch`,label:`支持点击`}),redirectType:e.enum([`content_list`,`content`,`link`],`link`,{label:`跳转指向`,required:!1}),link:e.string(``,{label:`跳转链接`,required:!1})},{label:`点击配置`,defaultValue:{enabled:!0,redirectType:`link`,link:``}}),close:e.object({enabled:e.boolean(!0,{fieldType:`switch`,label:`支持关闭`})},{label:`关闭配置`,defaultValue:{enabled:!0}}),displayStrategy:e.object({rule:e.enum([`once`,`daily`],`once`,{label:`展示规则`,description:`「只展示1次」即当前消息只展示1次;「每天展示1次」即当前消息每天展示1次,0点刷新`}),period:e.timeRange(r,{label:`展示周期`,required:!1})},{label:`展示策略`,defaultValue:{rule:`once`,period:r}})}));export{r as defaultMarqueePeriod,n as getDefaultMarqueePeriod,i as marqueeInspectorPropsSchema};
2
+ import{defineComponentPropsSchema as e}from"../../../../utils/schema/schema.mjs";import t from"dayjs";function n(){return{start:t().startOf(`day`).format(`YYYY-MM-DD HH:mm:ss`),end:t().endOf(`day`).format(`YYYY-MM-DD HH:mm:ss`)}}const r=n(),i=e(e=>({marqueeKey:e.string(``,{label:`状态唯一标识`,required:!0,description:`外部传入唯一 marqueeKey,用于本地展示状态持久化`}),contents:e.array(e.object({text:e.string(``,{label:`文本内容`}),click:e.object({enabled:e.boolean(!0,{fieldType:`switch`,label:`支持点击`}),redirectType:e.enum([`content_list`,`content`,`link`],`link`,{label:`跳转指向`,required:!1}),link:e.string(``,{label:`跳转链接`,required:!1})},{label:`点击配置`,defaultValue:{enabled:!0,redirectType:`link`,link:``}})}),{label:`消息内容`,defaultValue:[{text:`请输入跑马灯内容`,click:{enabled:!0,redirectType:`link`,link:``}}],description:`支持多条消息循环播放(1~5条),展示顺序与配置顺序一致`}),close:e.object({enabled:e.boolean(!0,{fieldType:`switch`,label:`支持关闭`})},{label:`关闭配置`,defaultValue:{enabled:!0}}),displayStrategy:e.object({rule:e.enum([`once`,`daily`],`once`,{label:`展示规则`,description:`「只展示1次」即当前消息只展示1次;「每天展示1次」即当前消息每天展示1次,0点刷新`}),period:e.timeRange(r,{label:`展示周期`,required:!1})},{label:`展示策略`,defaultValue:{rule:`once`,period:r}})}));export{r as defaultMarqueePeriod,n as getDefaultMarqueePeriod,i as marqueeInspectorPropsSchema};
@@ -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{Box as n}from"../../../../../../ui/box.mjs";import r from"../../../../../../ui/link.mjs";import{urlPrefix as i}from"../../../../../../../constants/url-prefix.mjs";import{useSticky as a}from"../../../../../../../hooks/use-sticky.mjs";import o from"../../../../../../../assets/icons/search.mjs";import s,{loadHiddenChannelIdsFromStorage as c}from"./channel-filter-dialog.mjs";import{defaultProps as l}from"../defaults/default-props.mjs";import u from"../../../../../../../assets/icons/filter_dark.mjs";import{clsx as d}from"clsx";import{useEffect as f,useMemo as p,useState as m}from"react";import{Fragment as h,jsx as g,jsxs as _}from"react/jsx-runtime";const v={},y={list:[],currentChannelId:null,isFullfeed:!1};function b(e,t){return t===0?`/`:`${i.CHANNEL}/${encodeURIComponent(e.cn_name)}`}function x({props:i=v,styles:x,events:S,data:C=y}){let{searchUrl:w,searchIconSize:T,filterIconSize:E,channelItemHeight:D,channelItemFontSize:O,channelItemActiveFontSize:k,channelItemGap:A}={...l,...i},[j,M]=m(!1),{isSticky:N,ref:P}=a(),[F,I]=m(C.list),L=p(()=>C.currentChannelId??null,[C.currentChannelId]);f(()=>{let e=c();I(C.list.filter(t=>!e.includes(t.id)))},[C.list]);let R=e=>{I(e)},z=(e,t)=>{S?.onChannelChange?.(e,t)},B=()=>{M(!0),S?.onFilterClick?.()},V=()=>{S?.onSearchClick?.()},H=x?e(x,{}):void 0,U=N?E+T+24:E+16;return _(h,{children:[N&&g(n,{className:`w-full`,style:{height:t(44)}}),g(n,{as:`nav`,ref:P,className:d(`w-full transition-all duration-200`,!C.isFullfeed&&N&&`fixed top-0 left-0 right-0 z-50`,C.isFullfeed&&`fixed top-[54px] left-0 z-10 w-full`,!C.isFullfeed&&`bg-bg1`),style:H,children:_(n,{className:`relative flex items-center h-[44px]`,children:[g(n,{className:`flex-1 overflow-x-auto overflow-y-hidden [&::-webkit-scrollbar]:hidden`,style:{scrollbarWidth:`none`,msOverflowStyle:`none`,WebkitOverflowScrolling:`touch`},children:g(n,{className:`flex items-center h-full`,style:{paddingLeft:t(16),paddingRight:t(U+16),gap:t(A)},children:F.map((e,n)=>{let i=L===e.id||L===null&&n===0;return g(r,{href:b(e,n),className:d(`whitespace-nowrap cursor-pointer transition-all duration-200`,`flex items-center justify-center`),style:{height:t(D),fontSize:t(i?k:O),fontWeight:i?`bold`:`normal`,color:i?`var(--color-theme5)`:`var(--color-text2)`},onClick:()=>z(e,n),children:e.cn_name},e.id||`channel-${n}`)})})}),_(n,{className:`flex items-center gap-[12px] px-[8px]`,children:[g(n,{className:`flex items-center justify-center cursor-pointer`,style:{width:t(E+8),height:t(E+8)},onClick:B,children:g(u,{width:t(E),height:t(E),style:{color:`var(--color-text1)`}})}),N&&g(r,{href:w,onClick:V,children:g(n,{className:`flex items-center justify-center cursor-pointer`,style:{width:t(T+8),height:t(T+8)},children:g(o,{width:t(T),height:t(T),style:{color:`var(--color-text1)`}})})})]})]})}),g(s,{open:j,onOpenChange:M,channels:C.list,currentChannelId:L,onChannelClick:z,onChannelsChange:R})]})}export{x as default};
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 r from"../../../../../../ui/link.mjs";import{urlPrefix as i}from"../../../../../../../constants/url-prefix.mjs";import{useSticky as a}from"../../../../../../../hooks/use-sticky.mjs";import o from"../../../../../../../assets/icons/search.mjs";import s,{loadHiddenChannelIdsFromStorage as c}from"./channel-filter-dialog.mjs";import{defaultProps as l}from"../defaults/default-props.mjs";import u from"../../../../../../../assets/icons/filter_dark.mjs";import{clsx as d}from"clsx";import{useEffect as f,useMemo as p,useState as m}from"react";import{Fragment as h,jsx as g,jsxs as _}from"react/jsx-runtime";const v={},y={list:[],currentChannelId:null,isFullfeed:!1};function b(e,t){return t===0?`/`:`${i.CHANNEL}/${encodeURIComponent(e.cn_name)}`}function x({props:i=v,styles:x,events:S,data:C=y}){let{searchUrl:w,searchIconSize:T,filterIconSize:E,channelItemHeight:D,channelItemFontSize:O,channelItemActiveFontSize:k,channelItemGap:A}={...l,...i},[j,M]=m(!1),{isSticky:N,ref:P}=a(),[F,I]=m(C.list),L=p(()=>C.currentChannelId??null,[C.currentChannelId]);f(()=>{let e=c();I(C.list.filter(t=>!e.includes(t.id)))},[C.list]);let R=e=>{I(e)},z=(e,t)=>{S?.onChannelChange?.(e,t)},B=()=>{M(!0),S?.onFilterClick?.()},V=()=>{S?.onSearchClick?.()},H=x?e(x,{}):void 0,U=N?E+T+24:E+16;return _(h,{children:[N&&g(n,{className:`w-full`,style:{height:t(44)}}),g(n,{as:`nav`,ref:P,className:d(`w-full bg-transparent transition-all duration-200`,!C.isFullfeed&&N&&`fixed top-0 left-0 right-0 z-50`,C.isFullfeed&&`fixed top-[54px] left-0 z-10 w-full`),style:H,children:_(n,{className:`relative flex items-center h-[44px]`,children:[g(n,{className:`flex-1 overflow-x-auto overflow-y-hidden [&::-webkit-scrollbar]:hidden`,style:{scrollbarWidth:`none`,msOverflowStyle:`none`,WebkitOverflowScrolling:`touch`},children:g(n,{className:`flex items-center h-full`,style:{paddingLeft:t(16),paddingRight:t(U+16),gap:t(A)},children:F.map((e,n)=>{let i=L===e.id||L===null&&n===0;return g(r,{href:b(e,n),className:d(`whitespace-nowrap cursor-pointer transition-all duration-200`,`flex items-center justify-center`),style:{height:t(D),fontSize:t(i?k:O),fontWeight:i?`bold`:`normal`,color:i?`var(--color-theme5)`:`var(--color-text2)`},onClick:()=>z(e,n),children:e.cn_name},e.id||`channel-${n}`)})})}),_(n,{className:`flex items-center gap-[12px] px-[8px]`,children:[g(n,{className:`flex items-center justify-center cursor-pointer`,style:{width:t(E+8),height:t(E+8)},onClick:B,children:g(u,{width:t(E),height:t(E),style:{color:`var(--color-text1)`}})}),N&&g(r,{href:w,onClick:V,children:g(n,{className:`flex items-center justify-center cursor-pointer`,style:{width:t(T+8),height:t(T+8)},children:g(o,{width:t(T),height:t(T),style:{color:`var(--color-text1)`}})})})]})]})}),g(s,{open:j,onOpenChange:M,channels:C.list,currentChannelId:L,onChannelClick:z,onChannelsChange:R})]})}export{x as default};
@@ -1,6 +1,6 @@
1
1
 
2
2
  import { ProfileHeaderInspectorProps, UserProfileHeaderAuthConfig, UserProfileHeaderClientProps, profileHeaderInspectorDefaultProps, profileHeaderInspectorPropsSchema } from "./profile-header/schema.mjs";
3
- import { UserProfileHeaderClient } from "./profile-header/client.mjs";
3
+ import { UserProfileHeaderClient, defaultBackground } from "./profile-header/client.mjs";
4
4
  import { profileHeaderMaterial, profileHeaderMaterialWithDisabledBackground } from "./profile-header/material.mjs";
5
5
  import "./profile-header/index.mjs";
6
6
  import { ProfileMainInspectorProps, UserProfileMainProps, profileMainInspectorDefaultProps, profileMainInspectorPropsSchema } from "./profile-main/schema.mjs";
@@ -3,6 +3,7 @@ import { UserProfileHeaderClientProps } from "./schema.mjs";
3
3
  import * as react_jsx_runtime0 from "react/jsx-runtime";
4
4
 
5
5
  //#region components/biz/business/profile/profile-header/client.d.ts
6
+ declare const defaultBackground = "/images/mine/img_mine_head_bg.png";
6
7
  /**
7
8
  * 用户资料头部组件,包含资料请求与头部交互。
8
9
  */
@@ -16,4 +17,4 @@ declare function UserProfileHeaderClient({
16
17
  mode
17
18
  }: UserProfileHeaderClientProps): react_jsx_runtime0.JSX.Element;
18
19
  //#endregion
19
- export { UserProfileHeaderClient };
20
+ export { UserProfileHeaderClient, defaultBackground };
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{cn as e}from"../../../../../utils/cn.mjs";import{Button as t}from"../../../../ui/button.mjs";import{useUserStore as n}from"../../../../../store/modules/user-store.mjs";import{gUserGetUserInfo as r,gUserViewUserInfo as i}from"../../../../../service/generated/client.mjs";import{useRouter as a}from"../../../../../utils/use-compatible-router.mjs";import{Box as o}from"../../../../ui/box.mjs";import{Text as s}from"../../../../ui/text.mjs";import{Skeleton as c}from"../../../../ui/skeleton.mjs";import{useLoginModalStore as l}from"../../../../../store/modules/login-modal-store.mjs";import{useRequest as u}from"../../../../../hooks/query/use-query.mjs";import{LeftArrowIcon as d}from"../../../../common/icons/left-arrow.mjs";import{SettingIcon as f}from"../../../../common/icons/setting.mjs";import{UserProfileAvatar as p}from"./user-profile-avatar.mjs";import{UserProfileCoverBackground as m}from"./user-profile-cover-background.mjs";import{useEffect as ee,useMemo as te,useState as h}from"react";import{jsx as g,jsxs as _}from"react/jsx-runtime";import{useTranslations as v}from"next-intl";import y from"next/link";const b=n.persist,x=`https://guadd-sg-ccs-sing-dev.s3.ap-southeast-1.amazonaws.com/default/default_avatar.png`,S=`/images/mine/img_mine_head_bg.png`;function C({showBackButton:n,isMine:r,enableCustomBackground:i,className:a}){return _(o,{className:e(`flex flex-col relative`,a),children:[_(o,{className:`absolute top-0 p-3 z-10 flex items-center justify-between w-full`,children:[g(t,{variant:`ghost`,size:`icon-xs`,className:e(`h-4 w-4 p-0 hover:bg-transparent`,{invisible:!n}),disabled:!0,children:g(d,{className:`w-4 h-4`})}),g(o,{className:e({invisible:!r}),children:g(f,{})})]}),g(o,{className:i?`h-33.75`:`h-24`,children:g(c,{className:`h-full w-full rounded-none`})}),_(o,{className:`flex-1 px-3`,children:[_(o,{className:`relative flex justify-end`,children:[g(c,{className:`absolute bottom-3 left-0 h-22 w-22 rounded-full`}),g(o,{className:`py-4 h-12`})]}),_(o,{className:`flex items-center justify-between gap-1`,children:[g(c,{className:`h-7 w-[132px]`}),g(c,{className:`h-10 w-[104px] rounded-full shrink-0`})]}),_(o,{className:`min-h-11 pt-1 pb-0 flex flex-col gap-2`,children:[g(c,{className:`h-4 w-[76%]`}),g(c,{className:`h-4 w-[58%]`})]})]})]})}function w({id:c,enableCustomBackground:w=!0,showBackButton:T=!0,requireLogin:E=!1,isEditorPreview:D=!1,className:O,mode:k=`renderer`}){let A=v(`components.pages.profile`),j=D||k===`editor`,M=!j,N=a(),{open:ne}=l(),{isLogin:P,userId:F,token:re}=n(),[ie,I]=h(!1);ee(()=>{if(!b){I(!0);return}I(b.hasHydrated());let e=b.onHydrate(()=>{I(!1)}),t=b.onFinishHydration(()=>{I(!0)});return()=>{e(),t()}},[]);let L=j?!1:P&&!!F&&!!re,R=j?``:F,z=R,B=c==null||!!c&&!!z&&c===z,V=B?[`user-profile`,`mine`]:[`user-profile`,`profile`,c],{data:H,isLoading:U}=u(j?[`editor-preview`,...V]:V,()=>c?i({target_user_id:c,user_id:R||c}):r({user_id:c||R||``}),{staleTime:0,enabled:M&&(!!c||!!R)}),W=te(()=>{let e=H?H.data:void 0;return e?{userId:e.user_id,isFollowing:e.is_following||!1,name:e.nick_name||`User${c??``}`,avatar:e.avatar||x,followingCnt:e.following_count??0,followersCnt:e.follower_count??0,likeCnt:e.like_count??0,signature:e.signature||``,background:e.bg_image||S}:{}},[c,H]),G=j||E&&B&&!L,K=B&&L&&!G,q=!L,J=w&&K,Y=w&&q,ae={name:A(`client.welcomeToPlanet`),description:A(`client.exploreAdventures`),avatar:x,followingCnt:0,followersCnt:0,likeCnt:0,background:S};function X(){ne()}function oe(){N.back()}let se=G?g(t,{className:`rounded-full`,size:`lg`,onClick:X,children:A(`client.loginNow`)}):B?g(y,{href:`/edit`,children:g(t,{variant:`outline`,className:`rounded-full`,children:A(`client.editProfile`)})}):null,Z=G?ae:W,Q=Z.name||``,$=Z.description||Z.signature||``,ce=Z.avatar||``;return M&&U&&!H?g(C,{showBackButton:T,isMine:B,enableCustomBackground:w,className:O}):_(o,{className:e(`flex flex-col relative`,O),children:[_(o,{className:`absolute top-0 p-3 z-10 flex items-center justify-between w-full`,children:[g(t,{variant:`ghost`,size:`icon-xs`,onClick:oe,className:e(`h-4 w-4 p-0 hover:bg-transparent`,{invisible:!T}),children:g(d,{className:`w-4 h-4`})}),g(y,{href:`/settings`,className:e({invisible:!B}),children:g(f,{})})]}),g(m,{isMine:J,enableCustomBackground:w,src:Z.background,onUnauthorizedClick:Y?X:void 0}),_(o,{className:`flex-1 px-3`,children:[_(o,{className:`relative flex justify-end`,children:[g(p,{isMine:K,src:ce,alt:Q||`avatar`,onUnauthorizedClick:q?X:void 0}),g(o,{className:`flex divide-x divide-text1/5 py-4 h-12`})]}),_(o,{className:`flex items-center justify-between gap-1`,children:[P&&B?g(y,{href:`/edit`,children:g(s,{as:`p`,className:`text-text1 max-w-[14em] text-xl overflow-hidden whitespace-nowrap text-ellipsis font-bold `,children:Q})}):g(s,{as:`p`,className:`text-text1 max-w-[14em] text-xl overflow-hidden whitespace-nowrap text-ellipsis font-bold `,children:Q}),se]}),$&&g(o,{className:`min-h-11 pt-1 pb-0`,children:g(s,{as:`p`,className:`text-sm line-clamp-2 break-all text-text1/66`,children:$})})]})]})}export{w as UserProfileHeaderClient};
2
+ "use client";import{cn as e}from"../../../../../utils/cn.mjs";import{Button as t}from"../../../../ui/button.mjs";import{useUserStore as n}from"../../../../../store/modules/user-store.mjs";import{gUserGetUserInfo as r,gUserViewUserInfo as i,pInteractionFollow as a,pInteractionUnfollow as o}from"../../../../../service/generated/client.mjs";import{useRouter as s}from"../../../../../utils/use-compatible-router.mjs";import{Box as c}from"../../../../ui/box.mjs";import{Text as l}from"../../../../ui/text.mjs";import{Skeleton as u}from"../../../../ui/skeleton.mjs";import{toast as d}from"../../../../../ui.mjs";import{useLoginModalStore as f}from"../../../../../store/modules/login-modal-store.mjs";import{useDeleteRequest as p,useMutation as m,useRequest as h,useUpdateRequest as g}from"../../../../../hooks/query/use-query.mjs";import{LeftArrowIcon as _}from"../../../../common/icons/left-arrow.mjs";import{SettingIcon as v}from"../../../../common/icons/setting.mjs";import{UserProfileAvatar as y}from"./user-profile-avatar.mjs";import{UserProfileCoverBackground as b}from"./user-profile-cover-background.mjs";import{useEffect as x,useMemo as S,useState as ee}from"react";import{Check as C,Plus as w}from"lucide-react";import{jsx as T,jsxs as E}from"react/jsx-runtime";import{useTranslations as D}from"next-intl";import O from"next/link";const k=n.persist,A=`https://guadd-sg-ccs-sing-dev.s3.ap-southeast-1.amazonaws.com/default/default_avatar.png`,j=`/images/mine/img_mine_head_bg.png`;function te({showBackButton:n,isMine:r,enableCustomBackground:i,className:a}){return E(c,{className:e(`relative overflow-hidden px-4 pb-8 pt-[16px]`,a),children:[T(c,{className:e(`pointer-events-none absolute inset-x-0 top-0 h-[220px]`,i?`bg-[image:var(--gradient-card-mask-strong)]`:`bg-[linear-gradient(180deg,var(--color-overlay-mask-start)_0%,var(--color-overlay-mask-end80)_100%)]`)}),E(c,{className:`absolute left-4 right-4 top-[16px] z-10 flex items-center justify-between`,children:[T(t,{variant:`ghost`,size:`icon-xs`,className:e(`h-4 w-4 p-0 hover:bg-transparent`,{invisible:!n}),disabled:!0,children:T(_,{className:`w-4 h-4`})}),T(c,{className:e({invisible:!r}),children:T(v,{className:`text-text1`})})]}),E(c,{className:`relative z-10 mt-[56px] flex items-start gap-4`,children:[T(u,{className:`h-[72px] w-[72px] shrink-0 rounded-full bg-[var(--color-surface-white10)]`}),E(c,{className:`min-w-0 flex-1`,children:[T(u,{className:`h-[26px] w-[132px] rounded-md bg-[var(--color-surface-white10)]`}),E(c,{className:`mt-1 flex flex-col gap-1`,children:[T(u,{className:`h-[20px] w-[76%] rounded-md bg-[var(--color-surface-white10)]`}),T(u,{className:`h-[20px] w-[58%] rounded-md bg-[var(--color-surface-white10)]`})]})]})]})]})}function ne({userId:n,currentUserId:r,isFollowing:i}){let s=D(`components.pages.profile`),{open:c}=f(),l=p(),u=g(),{mutateAsync:h,isPending:_}=m(async e=>a(e)),{mutateAsync:v,isPending:y}=m(async e=>o(e)),b=_||y;async function x(){if(!b){if(!r){c();return}try{if(i){let e=await v({app_id:0,follower_id:r,followee_id:n});e.code===0?(d.success(s(`client.unfollowSuccess`)),S(!1),l([`check-follow`,n]),l([`user-profile`,`profile`,n])):d.error(e.message||s(`client.unfollowFailed`))}else{let e=await h({app_id:0,follower_id:r,followee_id:n});e.code===0?(d.success(s(`client.followSuccess`)),S(!0),l([`check-follow`,n]),l([`user-profile`,`profile`,n])):d.error(e.message||s(`client.followFailed`))}}catch(e){console.error(`关注操作失败`,e),d.error(s(`client.operationFailed`))}}}function S(e){u([`user-profile`,`profile`,n],t=>!t||!t.data?t:{...t,data:{...t.data,is_following:e}})}return E(t,{type:`button`,variant:`ghost`,size:`xs`,className:e(`h-6 min-w-0 gap-1 rounded-full border px-2 py-0 text-[14px] font-normal leading-5 shadow-none`,`disabled:pointer-events-none disabled:opacity-100`,i?`border-[var(--color-text-tertiary)] bg-transparent text-[var(--color-text-tertiary)] hover:!bg-[var(--color-surface-white10)] hover:!text-[var(--color-text-tertiary)]`:`border-[var(--color-text-secondary)] bg-[var(--color-overlay-create-top-black50)] text-[var(--color-text-secondary)] backdrop-blur-[2px] hover:!bg-[var(--color-overlay-create-top-black50)] hover:!text-[var(--color-text-secondary)]`),onClick:x,disabled:b,children:[T(i?C:w,{className:`size-[14px]`}),s(b?`client.processing`:i?`client.followed`:`client.follow`)]})}function M({id:a,enableCustomBackground:o=!0,showBackButton:u=!0,requireLogin:d=!1,isEditorPreview:p=!1,className:m,mode:g=`renderer`}){let C=D(`components.pages.profile`),w=p||g===`editor`,M=!w,N=s(),{open:P}=f(),{isLogin:F,userId:I,token:L}=n(),[re,R]=ee(!1);x(()=>{if(!k){R(!0);return}R(k.hasHydrated());let e=k.onHydrate(()=>{R(!1)}),t=k.onFinishHydration(()=>{R(!0)});return()=>{e(),t()}},[]);let z=w?!1:F&&!!I&&!!L,B=w?``:I,V=B,H=a==null||!!a&&!!V&&a===V,U=H?[`user-profile`,`mine`]:[`user-profile`,`profile`,a],{data:W,isLoading:ie}=h(w?[`editor-preview`,...U]:U,()=>a?i({target_user_id:a,user_id:B||a}):r({user_id:a||B||``}),{staleTime:0,enabled:M&&(!!a||!!B)}),G=S(()=>{let e=W?W.data:void 0;return e?{userId:e.user_id,isFollowing:e.is_following||!1,name:e.nick_name||`User${a??``}`,avatar:e.avatar||A,followingCnt:e.following_count??0,followersCnt:e.follower_count??0,likeCnt:e.like_count??0,signature:e.signature||``,background:e.bg_image||j}:{}},[a,W]),K=w||d&&H&&!z,q=H&&z&&!K,J=!z,ae=o&&q,oe=o&&J,se={name:C(`client.welcomeToPlanet`),description:C(`client.exploreAdventures`),avatar:A,followingCnt:0,followersCnt:0,likeCnt:0,background:j};function Y(){P()}function ce(){N.back()}let X=K?null:H?z?T(O,{href:`/edit`,children:T(t,{variant:`ghost`,className:`h-auto min-h-0 rounded-full border border-[rgba(255,255,255,0.8)] bg-[rgba(11,3,23,0.5)] px-2 py-1 text-[14px] font-normal leading-5 text-[rgba(255,255,255,0.8)] backdrop-blur-[2px] hover:bg-[rgba(11,3,23,0.65)] hover:text-[rgba(255,255,255,0.9)]`,children:C(`client.editProfile`)})}):null:T(ne,{userId:a||``,currentUserId:B,isFollowing:G?.isFollowing}),Z=K?se:G,Q=Z.name||``,$=Z.description||Z.signature||``,le=Z.avatar||``;return M&&ie&&!W?T(te,{showBackButton:u,isMine:H,enableCustomBackground:o,className:m}):E(c,{className:e(`relative px-4 pb-8 pt-[16px]`,m),children:[T(c,{className:`absolute inset-x-0 top-0 overflow-hidden`,children:T(b,{isMine:ae,enableCustomBackground:o,src:Z.background,onUnauthorizedClick:oe?Y:void 0})}),T(c,{className:e(`pointer-events-none absolute inset-x-0 top-0 h-[220px]`,o?`bg-[image:var(--gradient-card-mask-strong)]`:`bg-[linear-gradient(180deg,var(--color-overlay-mask-start)_0%,var(--color-overlay-mask-end80)_100%)]`)}),E(c,{className:`absolute left-4 right-4 top-[16px] z-10 flex items-center justify-between`,children:[T(t,{variant:`ghost`,size:`icon-xs`,onClick:ce,className:e(`h-6 w-6 p-0 text-text1 hover:bg-transparent hover:text-[var(--color-text-secondary)]`,{invisible:!u}),children:T(_,{className:`h-4 w-4`})}),T(O,{href:`/settings`,className:e(`text-[var(--color-text-secondary)] opacity-80 transition-opacity hover:opacity-100`,{invisible:!H}),children:T(v,{})})]}),E(c,{className:e(`relative z-10 mt-[56px] flex justify-between gap-3 items-center`),children:[T(y,{isMine:q,src:le,alt:Q||`avatar`,onUnauthorizedClick:J?Y:void 0}),E(c,{className:`min-w-0 flex-1`,children:[E(c,{className:e(`flex justify-between gap-3 items-center`),children:[F&&H?T(O,{href:`/edit`,className:`min-w-0`,children:T(l,{as:`p`,className:`max-w-[195px] text-[18px] font-semibold leading-[26px] text-[var(--color-text-primary)]`,children:Q})}):T(l,{as:`p`,className:`max-w-[195px] text-[18px] font-semibold leading-[26px] text-[var(--color-text-primary)]`,onClick:()=>{!F&&H&&Y()},children:Q}),X?T(c,{className:`shrink-0 pt-0.5`,children:X}):null]}),$&&T(c,{className:`pt-1`,children:T(l,{as:`p`,className:`line-clamp-2 max-w-[195px] break-words text-[14px] leading-[20px] text-[var(--color-text-white80)]`,children:$})})]})]})]})}export{M as UserProfileHeaderClient,j as defaultBackground};
@@ -1,4 +1,4 @@
1
1
 
2
2
  import { ProfileHeaderInspectorProps, UserProfileHeaderAuthConfig, UserProfileHeaderClientProps, profileHeaderInspectorDefaultProps, profileHeaderInspectorPropsSchema } from "./schema.mjs";
3
- import { UserProfileHeaderClient } from "./client.mjs";
3
+ import { UserProfileHeaderClient, defaultBackground } from "./client.mjs";
4
4
  import { profileHeaderMaterial, profileHeaderMaterialWithDisabledBackground } from "./material.mjs";
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{cn as e}from"../../../../../utils/cn.mjs";import{Button as t}from"../../../../ui/button.mjs";import{useUserStore as n}from"../../../../../store/modules/user-store.mjs";import{gUserGetUserEditInfo as r,pUserEditUserInfo as i}from"../../../../../service/generated/client.mjs";import{uploadFile as a}from"../../../../../utils/upload-file.mjs";import{Avatar as o,AvatarFallback as s,AvatarImage as c}from"../../../../ui/avatar.mjs";import{Box as l}from"../../../../ui/box.mjs";import{Input as u}from"../../../../ui/input.mjs";import{Dialog as d,DialogContent as f}from"../../../../ui/dialog.mjs";import{Text as p}from"../../../../ui/text.mjs";import{useDeleteRequest as m}from"../../../../../hooks/query/use-query.mjs";import{ImageCropModal as h}from"../../../../common/image-crop-modal/image-crop-modal.mjs";import{useRef as g,useState as _}from"react";import{Fragment as v,jsx as y,jsxs as b}from"react/jsx-runtime";import{toast as x}from"sonner";import{useTranslations as S}from"next-intl";const C=`https://guadd-sg-ccs-sing-dev.s3.ap-southeast-1.amazonaws.com/default/default_avatar.png`,w=[`image/jpeg`,`image/png`];function T(e){let t=e.name.toLowerCase(),n=e.type.toLowerCase();return w.includes(n)||/\.(?:jpg|jpeg|png)$/i.test(t)}function E({isMine:w,src:E,alt:D,onUnauthorizedClick:O}){let k=S(`components.pages.profile`),A=g(null),{userId:j,setUserInfo:M,userInfo:N}=n(),P=m(),[F,I]=_(!1),[L,R]=_(!1),[z,B]=_(``),[V,H]=_(!1);function U(){if(!V){if(w){I(!0);return}O?.()}}function W(){z&&(URL.revokeObjectURL(z),B(``))}function G(){I(!1)}function K(){V||A.current?.click()}async function q(e){let t=(await r({user_id:String(j)})).data;return{user_id:String(j),nick_name:t?.nick_name??N?.nick_name??void 0,avatar:e||void 0,signature:t?.signature??N?.signature??void 0,gender:t?.gender??N?.gender??void 0}}function J(e){let t=e.target.files?.[0];if(t){if(!T(t)){x.error(k(`client.imageTypeInvalid`)),e.target&&(e.target.value=``);return}if(t.size>5242880){x.error(k(`client.imageTooLarge`)),e.target&&(e.target.value=``);return}B(URL.createObjectURL(t)),R(!0),e.target&&(e.target.value=``)}}async function Y(e){if(!j){x.error(k(`client.loginRequiredForUpload`));return}try{H(!0);let t=await a(new File([e],`avatar.jpg`,{type:`image/jpeg`}),1),n=await q(t.objectKey);await i(n),M({...N,nick_name:n.nick_name,avatar:t.objectKey,signature:n.signature,gender:n.gender}),P([`user-profile`,`mine`]),P([`user-profile`,`profile`,String(j)]),P([`user-edit-info`,String(j)]),I(!1),R(!1),x.success(k(`client.mediaUpdateSuccess`))}catch(e){console.error(`上传头像失败`,e),x.error(k(`client.uploadFailed`))}finally{W(),H(!1)}}function X(){R(!1),W()}return b(v,{children:[w||O?y(t,{variant:`ghost`,size:`icon`,className:`!absolute bottom-3 left-0 h-22 w-22 rounded-full p-0 hover:bg-transparent`,onClick:U,"aria-label":`打开头像预览`,children:b(o,{className:`w-22 h-22`,children:[y(c,{src:E||C,alt:D||`avatar`}),y(s,{})]})}):b(o,{className:`!absolute bottom-3 left-0 w-22 h-22`,children:[y(c,{src:E||C,alt:D||`avatar`}),y(s,{})]}),y(d,{open:F,onOpenChange:G,children:y(f,{showCloseButton:!1,className:`bg-black !m-0 !p-0 !fixed !inset-0 !w-screen !h-screen !max-w-none !rounded-none !top-0 !left-0 !translate-x-0 !translate-y-0 !transform-none z-[9999] !pointer-events-auto`,children:b(l,{className:`relative flex h-full w-full flex-col items-center justify-center`,children:[y(t,{variant:`ghost`,size:`icon`,className:`absolute left-0 top-0 h-14 w-14 text-white hover:bg-transparent hover:text-white/80`,onClick:G,"aria-label":`关闭头像预览`,children:y(`svg`,{className:`w-4 h-4`,xmlns:`http://www.w3.org/2000/svg`,fill:`currentColor`,viewBox:`0 0 16 16`,children:y(`path`,{d:`M14.55.2a.889.889 0 0 1 1.25 1.25l-.06.067L9.255 8l6.483 6.482.06.069a.888.888 0 0 1-1.25 1.25l-.067-.062L8 9.256l-6.482 6.483A.888.888 0 1 1 .26 14.482L6.742 8 .26 1.517.2 1.45A.888.888 0 0 1 1.45.2l.067.062 6.482 6.482L14.482.261l.068-.062Z`})})}),b(o,{className:`w-50 h-50`,children:[y(c,{src:E||C,alt:D||`avatar`}),y(s,{})]}),b(t,{variant:`ghost`,className:e(`absolute bottom-8 left-0 right-0 mx-auto flex w-[366px] max-w-[90%] items-center justify-between rounded-3xl bg-white/10 px-3 py-3 transition-colors hover:bg-white/20`,`active:scale-95`),onClick:K,disabled:V,children:[y(p,{as:`span`,className:`text-base font-medium text-white`,children:V?`上传中...`:`更换头像`}),b(`svg`,{className:`w-6 h-6 text-white`,xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,children:[y(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M3 9a2 2 0 012-2h.93a2 2 0 001.664-.89l.812-1.22A2 2 0 0110.07 4h3.86a2 2 0 011.664.89l.812 1.22A2 2 0 0018.07 7H19a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V9z`}),y(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M15 13a3 3 0 11-6 0 3 3 0 016 0z`})]})]})]})})}),y(u,{ref:A,type:`file`,accept:`.jpg,.jpeg,.png,image/jpeg,image/png`,className:`hidden`,onChange:J}),y(h,{open:L,onClose:X,imageSrc:z,onConfirm:Y})]})}export{E as UserProfileAvatar};
2
+ "use client";import{cn as e}from"../../../../../utils/cn.mjs";import{Button as t}from"../../../../ui/button.mjs";import{useUserStore as n}from"../../../../../store/modules/user-store.mjs";import{gUserGetUserEditInfo as r,pUserEditUserInfo as i}from"../../../../../service/generated/client.mjs";import{uploadFile as a}from"../../../../../utils/upload-file.mjs";import{Avatar as o,AvatarFallback as s,AvatarImage as c}from"../../../../ui/avatar.mjs";import{Box as l}from"../../../../ui/box.mjs";import{Input as u}from"../../../../ui/input.mjs";import{Dialog as d,DialogContent as f}from"../../../../ui/dialog.mjs";import{Text as p}from"../../../../ui/text.mjs";import{useDeleteRequest as m}from"../../../../../hooks/query/use-query.mjs";import{ImageCropModal as h}from"../../../../common/image-crop-modal/image-crop-modal.mjs";import{useRef as g,useState as _}from"react";import{Fragment as v,jsx as y,jsxs as b}from"react/jsx-runtime";import{toast as x}from"sonner";import{useTranslations as S}from"next-intl";const C=`https://guadd-sg-ccs-sing-dev.s3.ap-southeast-1.amazonaws.com/default/default_avatar.png`,w=[`image/jpeg`,`image/png`];function T(e){let t=e.name.toLowerCase(),n=e.type.toLowerCase();return w.includes(n)||/\.(?:jpg|jpeg|png)$/i.test(t)}function E({isMine:w,src:E,alt:D,onUnauthorizedClick:O}){let k=S(`components.pages.profile`),A=g(null),{userId:j,setUserInfo:M,userInfo:N}=n(),P=m(),[F,I]=_(!1),[L,R]=_(!1),[z,B]=_(``),[V,H]=_(!1);function U(){if(!V){if(w){I(!0);return}O?.()}}function W(){z&&(URL.revokeObjectURL(z),B(``))}function G(){I(!1)}function K(){V||A.current?.click()}async function q(e){let t=(await r({user_id:String(j)})).data;return{user_id:String(j),nick_name:t?.nick_name??N?.nick_name??void 0,avatar:e||void 0,signature:t?.signature??N?.signature??void 0,gender:t?.gender??N?.gender??void 0}}function J(e){let t=e.target.files?.[0];if(t){if(!T(t)){x.error(k(`client.imageTypeInvalid`)),e.target&&(e.target.value=``);return}if(t.size>5242880){x.error(k(`client.imageTooLarge`)),e.target&&(e.target.value=``);return}B(URL.createObjectURL(t)),R(!0),e.target&&(e.target.value=``)}}async function Y(e){if(!j){x.error(k(`client.loginRequiredForUpload`));return}try{H(!0);let t=await a(new File([e],`avatar.jpg`,{type:`image/jpeg`}),1),n=await q(t.objectKey);await i(n),M({...N,nick_name:n.nick_name,avatar:t.objectKey,signature:n.signature,gender:n.gender}),P([`user-profile`,`mine`]),P([`user-profile`,`profile`,String(j)]),P([`user-edit-info`,String(j)]),I(!1),R(!1),x.success(k(`client.mediaUpdateSuccess`))}catch(e){console.error(`上传头像失败`,e),x.error(k(`client.uploadFailed`))}finally{W(),H(!1)}}function X(){R(!1),W()}return b(v,{children:[w||O?y(t,{variant:`ghost`,size:`icon`,className:`h-[72px] w-[72px] rounded-full p-0 hover:bg-transparent`,onClick:U,"aria-label":`打开头像预览`,children:y(l,{className:`flex h-[72px] w-[72px] items-center justify-center rounded-full bg-[var(--color-surface-white20)]`,children:b(o,{className:`h-[60px] w-[60px] border-[3px] border-[var(--color-surface-white20)]`,children:[y(c,{src:E||C,alt:D||`avatar`}),y(s,{})]})})}):y(l,{className:`flex h-[72px] w-[72px] items-center justify-center rounded-full bg-[var(--color-surface-white20)]`,children:b(o,{className:`h-[60px] w-[60px] border-[3px] border-[var(--color-surface-white20)]`,children:[y(c,{src:E||C,alt:D||`avatar`}),y(s,{})]})}),y(d,{open:F,onOpenChange:G,children:y(f,{showCloseButton:!1,className:`bg-black !m-0 !p-0 !fixed !inset-0 !w-screen !h-screen !max-w-none !rounded-none !top-0 !left-0 !translate-x-0 !translate-y-0 !transform-none z-[9999] !pointer-events-auto`,children:b(l,{className:`relative flex h-full w-full flex-col items-center justify-center`,children:[y(t,{variant:`ghost`,size:`icon`,className:`absolute left-0 top-0 h-14 w-14 text-text1 hover:bg-transparent hover:text-[var(--color-text-secondary)]`,onClick:G,"aria-label":`关闭头像预览`,children:y(`svg`,{className:`w-4 h-4`,xmlns:`http://www.w3.org/2000/svg`,fill:`currentColor`,viewBox:`0 0 16 16`,children:y(`path`,{d:`M14.55.2a.889.889 0 0 1 1.25 1.25l-.06.067L9.255 8l6.483 6.482.06.069a.888.888 0 0 1-1.25 1.25l-.067-.062L8 9.256l-6.482 6.483A.888.888 0 1 1 .26 14.482L6.742 8 .26 1.517.2 1.45A.888.888 0 0 1 1.45.2l.067.062 6.482 6.482L14.482.261l.068-.062Z`})})}),b(o,{className:`w-50 h-50`,children:[y(c,{src:E||C,alt:D||`avatar`}),y(s,{})]}),b(t,{variant:`ghost`,className:e(`absolute bottom-8 left-0 right-0 mx-auto flex w-[366px] max-w-[90%] items-center justify-between rounded-3xl bg-[var(--color-surface-white10)] px-3 py-3 transition-colors hover:bg-[var(--color-surface-white20)]`,`active:scale-95 h-auto`),onClick:K,disabled:V,children:[y(p,{as:`span`,className:`text-base font-medium text-text1`,children:V?`上传中...`:`更换头像`}),b(`svg`,{className:`w-6 h-6 text-text1`,xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,children:[y(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M3 9a2 2 0 012-2h.93a2 2 0 001.664-.89l.812-1.22A2 2 0 0110.07 4h3.86a2 2 0 011.664.89l.812 1.22A2 2 0 0018.07 7H19a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V9z`}),y(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M15 13a3 3 0 11-6 0 3 3 0 016 0z`})]})]})]})})}),y(u,{ref:A,type:`file`,accept:`.jpg,.jpeg,.png,image/jpeg,image/png`,className:`hidden`,onChange:J}),y(h,{open:L,onClose:X,imageSrc:z,onConfirm:Y})]})}export{E as UserProfileAvatar};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{useUserStore as e}from"../../../../../store/modules/user-store.mjs";import{pUserUploadUserBgImage as t}from"../../../../../service/generated/client.mjs";import{uploadFile as n}from"../../../../../utils/upload-file.mjs";import{Image as r}from"../../../../ui/image.mjs";import{Box as i}from"../../../../ui/box.mjs";import{Input as a}from"../../../../ui/input.mjs";import{useDeleteRequest as o}from"../../../../../hooks/query/use-query.mjs";import{ImageCropModal as s}from"../../../../common/image-crop-modal/image-crop-modal.mjs";import{BackgroundPreviewModal as c}from"../../../../common/background-preview-modal/background-preview-modal.mjs";import{useCallback as l,useEffect as u,useRef as d,useState as f}from"react";import{Fragment as p,jsx as m,jsxs as h}from"react/jsx-runtime";import{toast as g}from"sonner";import{useTranslations as _}from"next-intl";const v=[`image/jpeg`,`image/png`];function y(e){let t=e.name.toLowerCase(),n=e.type.toLowerCase();return v.includes(n)||/\.(?:jpg|jpeg|png)$/i.test(t)}function b({isMine:v,enableCustomBackground:b=!0,src:x,onUnauthorizedClick:S}){let C=_(`components.pages.profile`),w=`/images/mine/img_mine_head_bg.png`,T=d(null),{userId:E,setUserInfo:D,userInfo:O}=e(),k=o(),[A,j]=f(!1),[M,N]=f(!1),[P,F]=f(!1),[I,L]=f(``),R=b&&(!!v||typeof S==`function`),z=l(()=>{I&&(URL.revokeObjectURL(I),L(``))},[I]),B=()=>{if(b){if(v){A||N(!0);return}S?.()}},V=()=>{N(!1)};function H(){A||T.current?.click()}async function U(e){let t=e.target.files?.[0];if(e.target&&(e.target.value=``),t)try{if(!y(t)){g.error(C(`client.imageTypeInvalid`));return}if(t.size>5242880){g.error(C(`client.imageTooLarge`));return}z(),L(URL.createObjectURL(t)),N(!1),F(!0)}catch(e){console.error(`上传背景图失败`,e),g.error(C(`client.uploadFailed`))}}let W=l(()=>{F(!1),z()},[z]);u(()=>{b||(N(!1),F(!1),z())},[z,b]);async function G(e){if(!E){g.error(C(`client.loginRequiredForUpload`));return}try{j(!0);let r=await n(new File([e],`background.jpg`,{type:`image/jpeg`}),1);await t({user_id:String(E),bg_image:r.objectKey}),D({...O,bg_image:r.objectKey}),k([`user-profile`,`mine`]),N(!1),F(!1),g.success(C(`client.mediaUpdateSuccess`))}catch(e){console.error(`上传背景图失败`,e),g.error(C(`client.uploadFailed`))}finally{z(),j(!1)}}return h(p,{children:[m(i,{className:b?`h-33.75`:`h-24`,children:b?m(i,{className:`relative h-full w-full`,onClick:R?B:void 0,children:m(r,{alt:`cover background`,fill:!0,objectFit:`cover`,className:`pointer-events-none`,src:x||w})}):m(i,{className:`h-full w-full bg-bg1`})}),b&&h(p,{children:[m(c,{open:M,onClose:V,bgUrl:x||w,onUpload:H}),m(a,{ref:T,type:`file`,accept:`.jpg,.jpeg,.png,image/jpeg,image/png`,className:`hidden`,onChange:U}),m(s,{open:P,onClose:W,imageSrc:I,onConfirm:G,cropShape:`rect`,aspectRatio:430/256})]})]})}export{b as UserProfileCoverBackground};
2
+ "use client";import{useUserStore as e}from"../../../../../store/modules/user-store.mjs";import{pUserUploadUserBgImage as t}from"../../../../../service/generated/client.mjs";import{uploadFile as n}from"../../../../../utils/upload-file.mjs";import{Image as r}from"../../../../ui/image.mjs";import{Box as i}from"../../../../ui/box.mjs";import{Input as a}from"../../../../ui/input.mjs";import{useDeleteRequest as o}from"../../../../../hooks/query/use-query.mjs";import{ImageCropModal as s}from"../../../../common/image-crop-modal/image-crop-modal.mjs";import{BackgroundPreviewModal as c}from"../../../../common/background-preview-modal/background-preview-modal.mjs";import{defaultBackground as l}from"./client.mjs";import{useCallback as u,useEffect as d,useRef as f,useState as p}from"react";import{Fragment as m,jsx as h,jsxs as g}from"react/jsx-runtime";import{toast as _}from"sonner";import{useTranslations as v}from"next-intl";const y=[`image/jpeg`,`image/png`];function b(e){let t=e.name.toLowerCase(),n=e.type.toLowerCase();return y.includes(n)||/\.(?:jpg|jpeg|png)$/i.test(t)}function x({isMine:y,enableCustomBackground:x=!0,src:S,onUnauthorizedClick:C}){let w=v(`components.pages.profile`),T=l,E=f(null),{userId:D,setUserInfo:O,userInfo:k}=e(),A=o(),[j,M]=p(!1),[N,P]=p(!1),[F,I]=p(!1),[L,R]=p(``),z=x&&(!!y||typeof C==`function`),B=u(()=>{L&&(URL.revokeObjectURL(L),R(``))},[L]),V=()=>{if(x){if(y){j||P(!0);return}C?.()}},H=()=>{P(!1)};function U(){j||E.current?.click()}async function W(e){let t=e.target.files?.[0];if(e.target&&(e.target.value=``),t)try{if(!b(t)){_.error(w(`client.imageTypeInvalid`));return}if(t.size>5242880){_.error(w(`client.imageTooLarge`));return}B(),R(URL.createObjectURL(t)),P(!1),I(!0)}catch(e){console.error(`上传背景图失败`,e),_.error(w(`client.uploadFailed`))}}let G=u(()=>{I(!1),B()},[B]);d(()=>{x||(P(!1),I(!1),B())},[B,x]);async function K(e){if(!D){_.error(w(`client.loginRequiredForUpload`));return}try{M(!0);let r=await n(new File([e],`background.jpg`,{type:`image/jpeg`}),1);await t({user_id:String(D),bg_image:r.objectKey}),O({...k,bg_image:r.objectKey}),A([`user-profile`,`mine`]),P(!1),I(!1),_.success(w(`client.mediaUpdateSuccess`))}catch(e){console.error(`上传背景图失败`,e),_.error(w(`client.uploadFailed`))}finally{B(),M(!1)}}return g(m,{children:[h(i,{className:`h-[284px]`,children:x?h(i,{className:`relative h-full w-full`,onClick:z?V:void 0,children:h(r,{alt:`cover background`,fill:!0,objectFit:`cover`,className:`pointer-events-none`,src:S||T})}):h(i,{className:`h-full w-full bg-bg1`})}),x&&g(m,{children:[h(c,{open:N,onClose:H,bgUrl:S||T,onUpload:U}),h(a,{ref:E,type:`file`,accept:`.jpg,.jpeg,.png,image/jpeg,image/png`,className:`hidden`,onChange:W}),h(s,{open:F,onClose:G,imageSrc:L,onConfirm:K,cropShape:`rect`,aspectRatio:430/256})]})]})}export{x as UserProfileCoverBackground};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{useUserStore as e}from"../../../../../store/modules/user-store.mjs";import{gUserViewUserInfo as t}from"../../../../../service/generated/client.mjs";import{useRequest as n}from"../../../../../hooks/query/use-query.mjs";import{VideoList as r}from"../../../../common/list/video-list/video-list.mjs";import{profileMainMineTabOptions as i,profileMainProfileTabOptions as a}from"./variants.mjs";import{UserProfileMainShell as o}from"./shell.mjs";import{CollectTab as s}from"./tabs/collect-tab/client.mjs";import{HistoryTab as c}from"./tabs/history-tab/client.mjs";import{LikeTab as l}from"./tabs/like-tab/client.mjs";import{useMemo as u}from"react";import{jsx as d}from"react/jsx-runtime";import{parseAsString as f,useQueryState as p}from"nuqs";function m(e){return e*1e3}const h=[{id:`00d21b841126c976`,title:`朝朝暮暮都是你`,coverImage:`/md-204/uploads/default/other/2024-04-15/2750647625e6193940163169b77fb566.jpg`,duration:192,viewCount:237,createTime:1772175066,isMoreLink:!0},{id:`009f2e1820718add`,title:`狗哥的乡村爱情故事`,coverImage:`/md-204/uploads/default/other/2024-04-11/579bc5eb807d29657828945330b0ac47.jpg`,duration:74,viewCount:191,createTime:1770714221,isMoreLink:!0},{id:`02e2a11f78a3ffbf`,title:`唯爱百分之十二`,coverImage:`/md-204/resource/b6/b689e34f40d0e5baccb8f79630b99425.jpg`,duration:3348,viewCount:214,createTime:1770347155,isMoreLink:!0},{id:`2c19073cbd3c5c5a`,title:`疯狂磕学家`,coverImage:`/md-204/uploads/default/other/2024-08-23/5e174eeb8f2009dd7bb797fcabd5a649.jpg`,duration:2359,viewCount:17,createTime:1769757646,isMoreLink:!0},{id:`07e029915c2a9c96`,title:`我和祖宗做交易`,coverImage:`/md-204/uploads/default/other/2024-05-23/b53e50fa75986b41aac766c253a91fea.jpg`,duration:194,viewCount:75,createTime:1769670600,isMoreLink:!0},{id:`0ae1056a620b286f`,title:`识汝不识丁`,coverImage:`/md-204/uploads/default/other/2024-08-24/8958d46da3087a420d1d55e691dcb10a.jpg`,duration:2053,viewCount:13,createTime:1769651310,isMoreLink:!0},{id:`05564bf1aaf5fad6`,title:`我们的天空`,coverImage:`/md-204/resource/1a/1af6ce7117dcda390cf08db26e832684.jpg`,duration:2737,viewCount:180,createTime:1769566315,isMoreLink:!0},{id:`00f61e5be01409bb`,title:`我初初爱你`,coverImage:`/md-204/resource/bd/bd657a65bc6adc202a94acb8aca33f38.jpg`,duration:2898,viewCount:362,createTime:1769410683,isMoreLink:!0},{id:`062cd69d44fcb772`,title:`料理情缘`,coverImage:`/md-204/uploads/default/other/2023-11-27/de0491f07909b05fa012d15552e02cd0.png`,duration:2726,viewCount:33,createTime:1769157580,isMoreLink:!0},{id:`05751871b640b1a7`,title:`穷小伙被碎玻璃割伤眼睛,却因祸得福获得了一只超能神眼,人生直接开挂,之前欺负他的人统统匍匐在他脚下,征服姐妹花,走向人生巅峰!`,coverImage:`/md-204/dcc-file/29/29a0fdc86f0d756ad8f123e81693d233-small.jpgbnc`,duration:9236,viewCount:137,createTime:1769157575,isMoreLink:!1}].map(e=>({id:e.id,title:e.title,coverImage:e.coverImage,duration:e.duration,authorName:``,viewCount:e.viewCount,publishTime:m(e.createTime),is_more_link:e.isMoreLink}));function g({isMine:e,tab:t}){let n=e?i:a;return t&&n.includes(t)?t:n[0]}function _(e,t){return e&&(t===`collect`||t===`like`)}function v({id:i,showCreateAction:a=!1,requireLogin:m=!1,className:v,currentUserId:y,mode:b=`renderer`,tab:x}){let S=b===`renderer`,C=e(e=>e.userId),[w]=p(`tab`,f),T=b===`editor`?``:y||C||``,E=i==null||!!T&&i===T,D=!E&&!!i,O=E?T:i?String(i):void 0,k=E?[`user-profile`,`mine`]:[`user-profile`,`profile`,i],A=u(()=>g({isMine:E,tab:w??x}),[E,x,w]),j=S&&_(D,A)&&!!i,{data:M}=n([`user-profile`,`privacy`,i,T],async()=>await t({target_user_id:String(i),user_id:T||String(i)}),{staleTime:0,enabled:j}),N=`content`;if(b===`editor`)N=`content`;else if(m&&E&&!T)N=`login-required`;else if(j&&M){let e=M.data??{},t=Number(e.collections_open??1)>0,n=Number(e.like_open??1)>0;A===`collect`&&!t&&(N=`privacy-collect`),A===`like`&&!n&&(N=`privacy-like`)}let P=N===`content`&&(!j||!!M),F=null;if(b===`editor`)F=d(r,{list:h,loading:!1,hasMore:!1,showVideoProgress:!1});else if(P)switch(A){case`like`:F=d(l,{mode:b,isMine:E,targetUserId:O,queryKeyPrefix:k});break;case`history`:F=d(c,{mode:b,targetUserId:O,queryKeyPrefix:k});break;default:F=d(s,{mode:b,isMine:E,userId:O,showCreateAction:a&&E,queryKeyPrefix:k});break}return d(o,{profileId:i,currentUserId:T,isMine:E,renderMode:N,className:v,children:F})}export{v as UserProfileMainClient};
2
+ "use client";import{useUserStore as e}from"../../../../../store/modules/user-store.mjs";import{gUserViewUserInfo as t}from"../../../../../service/generated/client.mjs";import{useRequest as n}from"../../../../../hooks/query/use-query.mjs";import{profileMainMineTabOptions as r,profileMainProfileTabOptions as i}from"./variants.mjs";import{UserProfileMainShell as a}from"./shell.mjs";import{CollectVideoWaterfall as o}from"./tabs/collect-tab/video-waterfall.mjs";import{CollectTab as s}from"./tabs/collect-tab/client.mjs";import{HistoryTab as c}from"./tabs/history-tab/client.mjs";import{LikeTab as l}from"./tabs/like-tab/client.mjs";import{useMemo as u}from"react";import{jsx as d}from"react/jsx-runtime";import{parseAsString as f,useQueryState as p}from"nuqs";function m(e){return e*1e3}const h=[{id:`00d21b841126c976`,title:`朝朝暮暮都是你`,coverImage:`/md-204/uploads/default/other/2024-04-15/2750647625e6193940163169b77fb566.jpg`,duration:192,viewCount:237,createTime:1772175066,isMoreLink:!0},{id:`009f2e1820718add`,title:`狗哥的乡村爱情故事`,coverImage:`/md-204/uploads/default/other/2024-04-11/579bc5eb807d29657828945330b0ac47.jpg`,duration:74,viewCount:191,createTime:1770714221,isMoreLink:!0},{id:`02e2a11f78a3ffbf`,title:`唯爱百分之十二`,coverImage:`/md-204/resource/b6/b689e34f40d0e5baccb8f79630b99425.jpg`,duration:3348,viewCount:214,createTime:1770347155,isMoreLink:!0},{id:`2c19073cbd3c5c5a`,title:`疯狂磕学家`,coverImage:`/md-204/uploads/default/other/2024-08-23/5e174eeb8f2009dd7bb797fcabd5a649.jpg`,duration:2359,viewCount:17,createTime:1769757646,isMoreLink:!0},{id:`07e029915c2a9c96`,title:`我和祖宗做交易`,coverImage:`/md-204/uploads/default/other/2024-05-23/b53e50fa75986b41aac766c253a91fea.jpg`,duration:194,viewCount:75,createTime:1769670600,isMoreLink:!0},{id:`0ae1056a620b286f`,title:`识汝不识丁`,coverImage:`/md-204/uploads/default/other/2024-08-24/8958d46da3087a420d1d55e691dcb10a.jpg`,duration:2053,viewCount:13,createTime:1769651310,isMoreLink:!0},{id:`05564bf1aaf5fad6`,title:`我们的天空`,coverImage:`/md-204/resource/1a/1af6ce7117dcda390cf08db26e832684.jpg`,duration:2737,viewCount:180,createTime:1769566315,isMoreLink:!0},{id:`00f61e5be01409bb`,title:`我初初爱你`,coverImage:`/md-204/resource/bd/bd657a65bc6adc202a94acb8aca33f38.jpg`,duration:2898,viewCount:362,createTime:1769410683,isMoreLink:!0},{id:`062cd69d44fcb772`,title:`料理情缘`,coverImage:`/md-204/uploads/default/other/2023-11-27/de0491f07909b05fa012d15552e02cd0.png`,duration:2726,viewCount:33,createTime:1769157580,isMoreLink:!0},{id:`05751871b640b1a7`,title:`穷小伙被碎玻璃割伤眼睛,却因祸得福获得了一只超能神眼,人生直接开挂,之前欺负他的人统统匍匐在他脚下,征服姐妹花,走向人生巅峰!`,coverImage:`/md-204/dcc-file/29/29a0fdc86f0d756ad8f123e81693d233-small.jpgbnc`,duration:9236,viewCount:137,createTime:1769157575,isMoreLink:!1}].map((e,t)=>({id:e.id,title:e.title,coverImage:e.coverImage,duration:e.duration,authorName:``,viewCount:e.viewCount,publishTime:m(e.createTime),is_more_link:e.isMoreLink,imgType:t%3==1?`long`:`short`}));function g({isMine:e,tab:t}){let n=e?r:i;return t&&n.includes(t)?t:n[0]}function _(e,t){return e&&(t===`collect`||t===`like`)}function v({id:r,showCreateAction:i=!1,requireLogin:m=!1,className:v,currentUserId:y,mode:b=`renderer`,tab:x}){let S=b===`renderer`,C=e(e=>e.userId),[w]=p(`tab`,f),T=b===`editor`?``:y||C||``,E=r==null||!!T&&r===T,D=!E&&!!r,O=E?T:r?String(r):void 0,k=E?[`user-profile`,`mine`]:[`user-profile`,`profile`,r],A=u(()=>g({isMine:E,tab:w??x}),[E,x,w]),j=S&&_(D,A)&&!!r,{data:M}=n([`user-profile`,`privacy`,r,T],async()=>await t({target_user_id:String(r),user_id:T||String(r)}),{staleTime:0,enabled:j}),N=`content`;if(b===`editor`)N=`content`;else if(m&&E&&!T)N=`login-required`;else if(j&&M){let e=M.data??{},t=Number(e.collections_open??1)>0,n=Number(e.like_open??1)>0;A===`collect`&&!t&&(N=`privacy-collect`),A===`like`&&!n&&(N=`privacy-like`)}let P=N===`content`&&(!j||!!M),F=null;if(b===`editor`)F=d(o,{list:h,loading:!1,hasMore:!1});else if(P)switch(A){case`like`:F=d(l,{mode:b,isMine:E,targetUserId:O,queryKeyPrefix:k});break;case`history`:F=d(c,{mode:b,targetUserId:O,queryKeyPrefix:k});break;default:F=d(s,{mode:b,isMine:E,userId:O,showCreateAction:i&&E,queryKeyPrefix:k});break}return d(a,{profileId:r,currentUserId:T,isMine:E,renderMode:N,className:v,children:F})}export{v as UserProfileMainClient};
@@ -0,0 +1,2 @@
1
+
2
+ "use client";import{cn as e}from"../../../../../utils/cn.mjs";import{Box as t}from"../../../../ui/box.mjs";import{Text as n}from"../../../../ui/text.mjs";import{jsx as r,jsxs as i}from"react/jsx-runtime";function a(a){let{text:o,className:s}=a;return i(t,{className:e(`flex min-h-[360px] w-full flex-col items-center pt-[132px]`,s),children:[i(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`68`,height:`58`,viewBox:`0 0 68 58`,fill:`none`,className:`h-[58px] w-[68px]`,children:[r(`rect`,{x:`0.5`,y:`0.5`,width:`67`,height:`57`,rx:`7.5`,fill:`#1B1829`,stroke:`#322F3E`}),r(`path`,{d:`M27.1175 33.8211L27.118 23.9652C27.1182 21.7159 29.502 20.2667 31.4989 21.3021L40.5835 26.0125C42.6976 27.1086 42.7531 30.1126 40.681 31.2861L31.5959 36.4317C29.596 37.5644 27.1173 36.1195 27.1175 33.8211Z`,fill:`#54525E`})]}),r(n,{className:`mt-[16px] text-center text-[15px] leading-[normal] text-[#54525E]`,children:o})]})}export{a as ProfileMainEmptyState};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{cn as e}from"../../../../../utils/cn.mjs";import{Button as t}from"../../../../ui/button.mjs";import{useUserStore as n}from"../../../../../store/modules/user-store.mjs";import{Box as r}from"../../../../ui/box.mjs";import{EmptyState as i}from"../../../../ui/empty.mjs";import{Text as a}from"../../../../ui/text.mjs";import{Tabs as o,TabsList as s,TabsTrigger as c}from"../../../../ui/tabs.mjs";import{useLoginModalStore as l}from"../../../../../store/modules/login-modal-store.mjs";import{profileMainMineTabOptions as u,profileMainProfileTabOptions as d}from"./variants.mjs";import{useEffect as f,useMemo as p,useRef as m}from"react";import{jsx as h,jsxs as g}from"react/jsx-runtime";import{useTranslations as _}from"next-intl";import{parseAsString as v,useQueryState as y}from"nuqs";function b(e){return e?[...u]:[...d]}function x(e,t){let n=b(t);return n.includes(e)?e:n[0]}function S(e){let t=window.getComputedStyle(e);return/auto|scroll|overlay/.test(t.overflowY)}function C(e){if(typeof window>`u`)return null;let t=e?.parentElement??null;for(;t;){if(S(t))return t;t=t.parentElement}return null}function w(e){return typeof window>`u`?0:e?e.scrollTop:window.scrollY||window.pageYOffset||0}function T(e,t){if(!(typeof window>`u`)){if(e){e.scrollTo({top:t});return}window.scrollTo({top:t,left:0})}}function E({profileId:u,currentUserId:d,isMine:S,renderMode:E,className:D,children:O}){let k=_(`components.pages.profile`),A=m(null),j=l(e=>e.open),M=n(e=>e.userId),N=m(``),P=b(S),[F,I]=y(`tab`,v.withDefault(`collect`)),L=p(()=>x(F,S),[S,F]),R=d||M||``,z=S?R:u,B=p(()=>`profile-scroll:${z||(S?`mine`:`guest`)}:${L}`,[S,L,z]);f(()=>{F!==L&&I(L,{shallow:!1})},[L,I,F]),f(()=>{if(typeof window>`u`)return;let e=`${S?`mine`:`profile`}:${z||``}:${L}`;N.current!==e&&(N.current=e,window.WebSDK?.track?.({event:`recommend_list_click`,payload:{page_type:S?`mine`:`profile`,profile_id:u||z||``,current_user_id:R,tab:L,page_source:window.location?.pathname||``}}))},[S,u,R,L,z]),f(()=>{if(typeof window>`u`)return;let e=C(A.current),t=window.sessionStorage.getItem(B),n=t?Number(t):0;Number.isFinite(n)&&n>0&&requestAnimationFrame(()=>{T(e,n)});let r=!1,i=()=>{r||(r=!0,requestAnimationFrame(()=>{window.sessionStorage.setItem(B,String(w(e))),r=!1}))};return e?(e.addEventListener(`scroll`,i,{passive:!0}),()=>{e.removeEventListener(`scroll`,i)}):(window.addEventListener(`scroll`,i,{passive:!0}),()=>{window.removeEventListener(`scroll`,i)})},[B]);let V={collect:k(`client.collect`),like:k(`client.like`),history:k(`client.history`)},H=O;return E===`login-required`?H=g(r,{className:`flex gap-4 flex-col items-center justify-center py-10 text-center`,children:[h(a,{className:`text-base text-text1`,children:k(`client.loginToView`)}),h(t,{size:`lg`,variant:`secondary`,onClick:j,children:k(`client.loginNow`)})]}):E===`privacy-collect`?H=h(i,{type:`no-content`,text:k(`client.collectionNotPublic`)}):E===`privacy-like`&&(H=h(i,{type:`no-content`,text:k(`client.likeNotPublic`)})),g(r,{ref:A,className:e(D),children:[h(r,{className:`border-b bg-bg1 sticky z-10 top-0 border-text1/5 h-10`,children:h(o,{value:L,onValueChange:e=>{I(e,{shallow:!1})},className:`w-fit`,children:h(s,{variant:`default`,className:`inline-flex h-9`,children:P.map(e=>h(c,{value:e,className:`p-2.5 !text-base !w-fit data-active:!text-lg data-active:font-bold`,children:V[e]},e))})})}),h(r,{className:`p-2`,children:H})]})}export{E as UserProfileMainShell};
2
+ "use client";import{cn as e}from"../../../../../utils/cn.mjs";import{Button as t}from"../../../../ui/button.mjs";import{useUserStore as n}from"../../../../../store/modules/user-store.mjs";import{Box as r}from"../../../../ui/box.mjs";import{EmptyState as i}from"../../../../ui/empty.mjs";import{Text as a}from"../../../../ui/text.mjs";import{Tabs as o,TabsList as s,TabsTrigger as c}from"../../../../ui/tabs.mjs";import{useLoginModalStore as l}from"../../../../../store/modules/login-modal-store.mjs";import{profileMainMineTabOptions as u,profileMainProfileTabOptions as d}from"./variants.mjs";import{useEffect as f,useId as p,useMemo as m,useRef as h}from"react";import{jsx as g,jsxs as _}from"react/jsx-runtime";import{useTranslations as v}from"next-intl";import{parseAsString as y,useQueryState as b}from"nuqs";function x(e){let t=p();return _(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`37`,height:`10`,viewBox:`0 0 37 10`,fill:`none`,...e,children:[g(`path`,{d:`M32.8921 0.212888C34.4317 -0.398985 36.1765 0.353067 36.7886 1.89258C37.4004 3.43219 36.6484 5.17704 35.1089 5.78906L29.9204 7.85058C26.0475 9.38961 21.7156 9.29046 17.9175 7.57519C15.9234 6.67463 13.6771 6.5 11.5679 7.08203L3.79833 9.22656C2.20143 9.66708 0.549808 8.72958 0.108873 7.13281C-0.331916 5.53567 0.605478 3.88317 2.20262 3.44238L9.97118 1.29785C13.431 0.342993 17.1161 0.629191 20.3872 2.10644C22.7028 3.15218 25.3434 3.21271 27.7046 2.27441L32.8921 0.212888Z`,fill:`url(#${t})`}),g(`defs`,{children:_(`linearGradient`,{id:t,x1:`3.00047`,y1:`5.00097`,x2:`34.0005`,y2:`5.00097`,gradientUnits:`userSpaceOnUse`,children:[g(`stop`,{stopColor:`var(--color-brand-tag-gradient-start)`}),g(`stop`,{offset:`1`,stopColor:`var(--color-brand-tag-gradient-end)`})]})})]})}function S(e){return _(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`68`,height:`58`,viewBox:`0 0 68 58`,fill:`none`,...e,children:[g(`rect`,{x:`0.5`,y:`0.5`,width:`67`,height:`57`,rx:`7.5`,fill:`#1B1829`,stroke:`#322F3E`}),g(`path`,{d:`M27.1175 33.8211L27.118 23.9652C27.1182 21.7159 29.502 20.2667 31.4989 21.3021L40.5835 26.0125C42.6976 27.1086 42.7531 30.1126 40.681 31.2861L31.5959 36.4317C29.596 37.5644 27.1173 36.1195 27.1175 33.8211Z`,fill:`#54525E`})]})}function C(e){return e?[...u]:[...d]}function w(e,t){let n=C(t);return n.includes(e)?e:n[0]}function T(e){let t=window.getComputedStyle(e);return/auto|scroll|overlay/.test(t.overflowY)}function E(e){if(typeof window>`u`)return null;let t=e?.parentElement??null;for(;t;){if(T(t))return t;t=t.parentElement}return null}function D(e){return typeof window>`u`?0:e?e.scrollTop:window.scrollY||window.pageYOffset||0}function O(e,t){if(!(typeof window>`u`)){if(e){e.scrollTo({top:t});return}window.scrollTo({top:t,left:0})}}function k({profileId:u,currentUserId:d,isMine:p,renderMode:T,className:k,children:A}){let j=v(`components.pages.profile`),M=h(null),N=l(e=>e.open),P=n(e=>e.userId),F=h(``),I=C(p),[L,R]=b(`tab`,y.withDefault(`collect`)),z=m(()=>w(L,p),[p,L]),B=d||P||``,V=p?B:u,H=m(()=>`profile-scroll:${V||(p?`mine`:`guest`)}:${z}`,[p,z,V]);f(()=>{L!==z&&R(z,{shallow:!1})},[z,R,L]),f(()=>{if(typeof window>`u`)return;let e=`${p?`mine`:`profile`}:${V||``}:${z}`;F.current!==e&&(F.current=e,window.WebSDK?.track?.({event:`recommend_list_click`,payload:{page_type:p?`mine`:`profile`,profile_id:u||V||``,current_user_id:B,tab:z,page_source:window.location?.pathname||``}}))},[p,u,B,z,V]),f(()=>{if(typeof window>`u`)return;let e=E(M.current),t=window.sessionStorage.getItem(H),n=t?Number(t):0;Number.isFinite(n)&&n>0&&requestAnimationFrame(()=>{O(e,n)});let r=!1,i=()=>{r||(r=!0,requestAnimationFrame(()=>{window.sessionStorage.setItem(H,String(D(e))),r=!1}))};return e?(e.addEventListener(`scroll`,i,{passive:!0}),()=>{e.removeEventListener(`scroll`,i)}):(window.addEventListener(`scroll`,i,{passive:!0}),()=>{window.removeEventListener(`scroll`,i)})},[H]);let U={collect:j(`client.collect`),like:j(`client.like`),history:j(`client.history`)},W=A;return T===`login-required`?W=_(r,{className:`flex flex-col items-center pt-[132px] text-center`,children:[g(S,{className:`h-[58px] w-[68px]`}),g(a,{className:`mt-[16px] text-[15px] leading-[normal] text-[#54525E]`,children:j(`client.loginToSeeMoreVideos`)}),g(t,{type:`button`,onClick:N,className:`mt-[16px] h-[40px] min-w-[100px] rounded-[8px] border-0 bg-[linear-gradient(90deg,#9756E3_0%,#6C43EE_100%)] px-[24px] py-0 text-[16px] font-normal leading-[24px] text-white active:opacity-90`,children:j(`client.loginNow`)})]}):T===`privacy-collect`?W=g(i,{type:`no-content`,text:j(`client.collectionNotPublic`)}):T===`privacy-like`&&(W=g(i,{type:`no-content`,text:j(`client.likeNotPublic`)})),_(r,{ref:M,className:e(`relative grow overflow-hidden rounded-t-[24px] bg-[var(--color-surface-panel-dark)]`,k),children:[g(r,{className:`sticky top-0 z-10 bg-[var(--color-surface-panel-dark)] px-4 pt-8`,children:g(o,{value:z,onValueChange:e=>{R(e,{shallow:!1})},className:`h-6 w-full`,children:g(s,{variant:`default`,className:`h-6 w-fit gap-8 px-0`,children:I.map(t=>_(c,{value:t,className:e(`group/profile-main-tab !flex-none !h-6 min-w-8 !px-0 !py-0 !pb-0 text-[16px] !font-normal leading-6 text-[var(--color-text-secondary)]`,`data-[active]:!text-text1 data-[active]:!font-semibold data-[active]:!text-[18px]`,`data-[state=active]:!text-text1 data-[state=active]:!font-semibold data-[state=active]:!text-[18px]`,`after:hidden`),children:[g(x,{"aria-hidden":`true`,className:e(`pointer-events-none absolute bottom-0 left-1/2 h-[10px] w-[37px] -translate-x-1/2 opacity-0 transition-opacity duration-200`,`group-data-[active]/profile-main-tab:opacity-100`,`group-data-[state=active]/profile-main-tab:opacity-100`)}),g(`span`,{className:`relative z-10`,children:U[t]})]},t))})})}),g(r,{className:`relative px-4 pb-6 pt-7`,children:W})]})}export{k as UserProfileMainShell};