@funhub/platform 0.2.4 → 0.2.5

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 (214) hide show
  1. package/dist/assets/icons/detail/collect_nor.mjs +2 -0
  2. package/dist/assets/icons/detail/collect_sel.mjs +2 -0
  3. package/dist/assets/icons/detail/share.mjs +2 -0
  4. package/dist/assets/icons/eye-off-icon.mjs +1 -1
  5. package/dist/assets/icons/marquee-enter.mjs +2 -0
  6. package/dist/assets/icons/right_arrow.mjs +2 -0
  7. package/dist/assets/icons/search/avatar.mjs +2 -0
  8. package/dist/assets/images/marquee.mjs +2 -0
  9. package/dist/biz.d.mts +6 -10
  10. package/dist/biz.mjs +1 -1
  11. package/dist/common.d.mts +2 -5
  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 +3 -7
  16. package/dist/components/biz/business/advertisement/ad-match.mjs +1 -1
  17. package/dist/components/biz/business/advertisement/banner-ad/client.mjs +1 -1
  18. package/dist/components/biz/business/advertisement/banner-ad/material.d.mts +2 -2
  19. package/dist/components/biz/business/advertisement/banner-ad/material.mjs +1 -1
  20. package/dist/components/biz/business/advertisement/banner-ad/schema.d.mts +4 -9
  21. package/dist/components/biz/business/advertisement/banner-ad/schema.mjs +1 -1
  22. package/dist/components/biz/business/advertisement/feed-ad/index.d.mts +31 -1
  23. package/dist/components/biz/business/advertisement/feed-ad/index.mjs +1 -1
  24. package/dist/components/biz/business/advertisement/floating-ad/client.d.mts +3 -4
  25. package/dist/components/biz/business/advertisement/floating-ad/client.mjs +1 -1
  26. package/dist/components/biz/business/advertisement/floating-ad/index.d.mts +1 -1
  27. package/dist/components/biz/business/advertisement/floating-ad/material.d.mts +0 -5
  28. package/dist/components/biz/business/advertisement/floating-ad/schema.d.mts +6 -21
  29. package/dist/components/biz/business/advertisement/floating-ad/schema.mjs +1 -1
  30. package/dist/components/biz/business/advertisement/icon-ad/client.mjs +1 -1
  31. package/dist/components/biz/business/advertisement/icon-ad/material.d.mts +1 -1
  32. package/dist/components/biz/business/advertisement/icon-ad/material.mjs +1 -1
  33. package/dist/components/biz/business/advertisement/icon-ad/schema.d.mts +1 -7
  34. package/dist/components/biz/business/advertisement/icon-ad/schema.mjs +1 -1
  35. package/dist/components/biz/business/advertisement/index.d.mts +4 -4
  36. package/dist/components/biz/business/advertisement/popup-ad/client.mjs +2 -2
  37. package/dist/components/biz/business/advertisement/popup-ad/index.d.mts +1 -1
  38. package/dist/components/biz/business/advertisement/popup-ad/material.d.mts +2 -2
  39. package/dist/components/biz/business/advertisement/popup-ad/schema.d.mts +15 -14
  40. package/dist/components/biz/business/advertisement/popup-ad/schema.mjs +1 -1
  41. package/dist/components/biz/business/advertisement/text-ad/client.mjs +1 -1
  42. package/dist/components/biz/business/advertisement/text-ad/material.d.mts +1 -1
  43. package/dist/components/biz/business/advertisement/text-ad/material.mjs +1 -1
  44. package/dist/components/biz/business/advertisement/text-ad/schema.d.mts +1 -5
  45. package/dist/components/biz/business/advertisement/text-ad/schema.mjs +1 -1
  46. package/dist/components/biz/business/banner/variants/basic-banner/runtime/client.mjs +1 -1
  47. package/dist/components/biz/business/banner-carousel/client.d.mts +1 -2
  48. package/dist/components/biz/business/banner-carousel/client.mjs +1 -1
  49. package/dist/components/biz/business/banner-carousel/default-props.mjs +1 -1
  50. package/dist/components/biz/business/channel-list/client.mjs +1 -1
  51. package/dist/components/biz/business/channel-list/default-props.mjs +1 -1
  52. package/dist/components/biz/business/detail/shared/detail-introduction.mjs +2 -0
  53. package/dist/components/biz/business/detail/shared/detail-operate.mjs +1 -1
  54. package/dist/components/biz/business/detail/shared/editor-preview.mjs +1 -1
  55. package/dist/components/biz/business/detail/video-detail-actions/client.mjs +1 -1
  56. package/dist/components/biz/business/detail/video-detail-info/client.mjs +1 -1
  57. package/dist/components/biz/business/detail/video-detail-recommend/client.d.mts +13 -1
  58. package/dist/components/biz/business/detail/video-detail-recommend/client.mjs +1 -1
  59. package/dist/components/biz/business/detail/video-detail-recommend/material.mjs +1 -1
  60. package/dist/components/biz/business/detail/video-detail-recommend/schema.mjs +1 -1
  61. package/dist/components/biz/business/header-search/header-avatar-icon/client.mjs +1 -1
  62. package/dist/components/biz/business/header-search/header-avatar-logo-search/client.d.mts +1 -1
  63. package/dist/components/biz/business/header-search/header-avatar-logo-search/client.mjs +1 -1
  64. package/dist/components/biz/business/header-search/header-avatar-logo-search/schema.d.mts +3 -4
  65. package/dist/components/biz/business/header-search/header-avatar-logo-search/schema.mjs +1 -1
  66. package/dist/components/biz/business/header-search/header-avatar-logo-search-icon/client.mjs +1 -1
  67. package/dist/components/biz/business/header-search/header-logo-search/client.mjs +1 -1
  68. package/dist/components/biz/business/header-search/header-search/client.mjs +1 -1
  69. package/dist/components/biz/business/header-search/shared/avatar.mjs +1 -1
  70. package/dist/components/biz/business/header-search/shared/logo.mjs +1 -1
  71. package/dist/components/biz/business/header-search/shared/search.mjs +1 -1
  72. package/dist/components/biz/business/home-recommend/home-recommend-grid/inspector-schema.d.mts +8 -0
  73. package/dist/components/biz/business/home-recommend/home-recommend-grid/inspector-schema.mjs +1 -1
  74. package/dist/components/biz/business/home-recommend/home-recommend-grid/material.d.mts +8 -0
  75. package/dist/components/biz/business/home-recommend/home-recommend-waterfall/inspector-schema.d.mts +8 -0
  76. package/dist/components/biz/business/home-recommend/home-recommend-waterfall/inspector-schema.mjs +1 -1
  77. package/dist/components/biz/business/home-recommend/home-recommend-waterfall/material.d.mts +8 -0
  78. package/dist/components/biz/business/home-recommend/shared/home-recommend-base.mjs +1 -1
  79. package/dist/components/biz/business/home-recommend/shared/home-recommend-preview.mjs +1 -1
  80. package/dist/components/biz/business/index.d.mts +5 -10
  81. package/dist/components/biz/business/large-feature-grid/card-item.mjs +1 -1
  82. package/dist/components/biz/business/large-feature-grid/client.mjs +1 -1
  83. package/dist/components/biz/business/large-feature-grid/schema.mjs +1 -1
  84. package/dist/components/biz/business/marquee/client.mjs +1 -1
  85. package/dist/components/biz/business/marquee/marquee.module.mjs +6 -2
  86. package/dist/components/biz/business/nav-bar/variants/basic-nav-bar/runtime/client.mjs +1 -1
  87. package/dist/components/biz/business/profile/index.d.mts +1 -1
  88. package/dist/components/biz/business/profile/profile-header/client.d.mts +1 -2
  89. package/dist/components/biz/business/profile/profile-header/client.mjs +1 -1
  90. package/dist/components/biz/business/profile/profile-header/index.d.mts +1 -1
  91. package/dist/components/biz/business/profile/profile-header/user-profile-avatar.mjs +1 -1
  92. package/dist/components/biz/business/profile/profile-header/user-profile-cover-background.mjs +1 -1
  93. package/dist/components/biz/business/profile/profile-main/client.mjs +1 -1
  94. package/dist/components/biz/business/profile/profile-main/shell.mjs +1 -1
  95. package/dist/components/biz/business/profile/profile-main/tabs/collect-tab/client.mjs +1 -1
  96. package/dist/components/biz/business/profile/profile-main/tabs/history-tab/client.mjs +1 -1
  97. package/dist/components/biz/business/profile/profile-main/tabs/like-tab/client.d.mts +1 -5
  98. package/dist/components/biz/business/profile/profile-main/tabs/like-tab/client.mjs +1 -1
  99. package/dist/components/biz/business/profile/profile-main/utils.mjs +1 -1
  100. package/dist/components/biz/business/search-history/client.mjs +1 -1
  101. package/dist/components/biz/business/search-history/schema.mjs +1 -1
  102. package/dist/components/biz/business/search-input/client.mjs +1 -1
  103. package/dist/components/biz/business/shortcut-grid/client.mjs +1 -1
  104. package/dist/components/biz/business/tab-bar/client.d.mts +2 -0
  105. package/dist/components/biz/business/tab-bar/client.mjs +1 -1
  106. package/dist/components/common/collection-popup/collection-create-modal.mjs +2 -0
  107. package/dist/components/common/collection-popup/index.d.mts +0 -1
  108. package/dist/components/common/collection-popup/index.mjs +1 -1
  109. package/dist/components/common/icons/setting.mjs +1 -1
  110. package/dist/components/common/list/collection-list/collection-list-item.d.mts +0 -8
  111. package/dist/components/common/list/collection-list/collection-list-item.mjs +1 -1
  112. package/dist/components/common/list/collection-list/collection-list.d.mts +0 -6
  113. package/dist/components/common/list/collection-list/collection-list.mjs +1 -1
  114. package/dist/components/common/series-episodes/index.d.mts +1 -3
  115. package/dist/components/common/series-episodes/index.mjs +1 -1
  116. package/dist/components/common/skeleton/search-video-card-skeleton.mjs +2 -0
  117. package/dist/components/common/tab-bar/index.mjs +1 -1
  118. package/dist/components/pages/collection-detail/detail.mjs +1 -1
  119. package/dist/components/pages/edit/page.mjs +1 -1
  120. package/dist/components/pages/feedback/_components/feedback-form.mjs +1 -1
  121. package/dist/components/pages/home/client.mjs +1 -1
  122. package/dist/components/pages/login/login-client.mjs +1 -1
  123. package/dist/components/pages/login/register.mjs +1 -1
  124. package/dist/components/pages/login/verify.mjs +4 -1
  125. package/dist/components/pages/publish/components/collection.mjs +1 -1
  126. package/dist/components/pages/search/page-client.mjs +1 -1
  127. package/dist/components/pages/search/search-result/index.mjs +1 -1
  128. package/dist/components/pages/search/search-result/search-all.mjs +1 -1
  129. package/dist/components/pages/search/search-result/search-user.mjs +1 -1
  130. package/dist/components/pages/search/search-result/search-video-info.mjs +1 -1
  131. package/dist/components/pages/search/search-utils.mjs +2 -0
  132. package/dist/components/pages/search/top-header.mjs +1 -1
  133. package/dist/components/pages/search-result/page-client.mjs +1 -1
  134. package/dist/components/pages/search-result/search-all.mjs +1 -1
  135. package/dist/components/pages/search-result/search-result-skeleton.mjs +2 -0
  136. package/dist/components/pages/search-result/search-tab.mjs +1 -1
  137. package/dist/components/pages/search-result/search-user.mjs +1 -1
  138. package/dist/components/pages/search-result/search-video.mjs +2 -0
  139. package/dist/components/pages/settings/_components/reset-password-drawer.mjs +2 -2
  140. package/dist/components/pages/settings/_components/settings.mjs +1 -1
  141. package/dist/components/pages/user-follow/_components/follow-no-login.mjs +1 -1
  142. package/dist/components/pages/video-list/video-list-client.mjs +1 -1
  143. package/dist/components/pages/video-list/video-list-item.mjs +2 -0
  144. package/dist/components/pages/video-list/video-list-skeleton.d.mts +3 -2
  145. package/dist/components/pages/video-list/video-list-skeleton.mjs +1 -1
  146. package/dist/components/ui/badge.d.mts +1 -1
  147. package/dist/components/ui/box.d.mts +1 -1
  148. package/dist/components/ui/button.d.mts +1 -1
  149. package/dist/components/ui/image.d.mts +4 -4
  150. package/dist/i18n/locales/en.mjs +2 -2
  151. package/dist/i18n/locales/zh-CN.mjs +2 -2
  152. package/dist/materials.d.mts +1 -3
  153. package/dist/materials.mjs +1 -1
  154. package/dist/service/generated/client.d.mts +2 -38
  155. package/dist/service/generated/client.mjs +1 -1
  156. package/dist/service/generated/tanstack.d.mts +2 -47
  157. package/dist/service/generated/tanstack.mjs +1 -1
  158. package/dist/service.d.mts +3 -3
  159. package/dist/service.mjs +1 -1
  160. package/dist/types.d.mts +9 -662
  161. package/dist/utils/helper.d.mts +1 -1
  162. package/dist/utils/helper.mjs +1 -1
  163. package/dist/utils/schema/inspector.d.mts +2 -2
  164. package/package.json +2 -8
  165. package/theme.css +59 -170
  166. package/dist/assets/icons/channel-list/channel-active-indicator.mjs +0 -2
  167. package/dist/assets/icons/common/header-menu.mjs +0 -2
  168. package/dist/assets/icons/common/header-search-icon.mjs +0 -2
  169. package/dist/assets/icons/common/right_arrow_thin.mjs +0 -2
  170. package/dist/assets/icons/marquee-close.mjs +0 -2
  171. package/dist/assets/icons/marquee-speaker.mjs +0 -2
  172. package/dist/assets/images/shortcut-grid/shortcut-grid-card-bg-primary.mjs +0 -2
  173. package/dist/components/biz/business/detail/video-detail-recommend/shared.mjs +0 -2
  174. package/dist/components/biz/business/header-search/shared/header-action.mjs +0 -2
  175. package/dist/components/biz/business/header-search/shared/header-search-icon.mjs +0 -2
  176. package/dist/components/biz/business/header-search/shared/header-shell.mjs +0 -2
  177. package/dist/components/biz/business/hot-recommend/client.d.mts +0 -17
  178. package/dist/components/biz/business/hot-recommend/client.mjs +0 -2
  179. package/dist/components/biz/business/hot-recommend/index.d.mts +0 -5
  180. package/dist/components/biz/business/hot-recommend/material.d.mts +0 -24
  181. package/dist/components/biz/business/hot-recommend/material.mjs +0 -2
  182. package/dist/components/biz/business/hot-recommend/schema.d.mts +0 -23
  183. package/dist/components/biz/business/hot-recommend/schema.mjs +0 -2
  184. package/dist/components/biz/business/hot-recommend/server.d.mts +0 -11
  185. package/dist/components/biz/business/hot-recommend/server.mjs +0 -2
  186. package/dist/components/biz/business/profile/profile-main/empty-state.mjs +0 -2
  187. package/dist/components/biz/business/profile/profile-main/tabs/collect-tab/video-waterfall.mjs +0 -2
  188. package/dist/components/biz/business/ranking-recommend/client.d.mts +0 -17
  189. package/dist/components/biz/business/ranking-recommend/client.mjs +0 -70
  190. package/dist/components/biz/business/ranking-recommend/material.d.mts +0 -35
  191. package/dist/components/biz/business/ranking-recommend/material.mjs +0 -2
  192. package/dist/components/biz/business/ranking-recommend/schema.d.mts +0 -35
  193. package/dist/components/biz/business/ranking-recommend/schema.mjs +0 -2
  194. package/dist/components/biz/business/ranking-recommend/server.d.mts +0 -11
  195. package/dist/components/biz/business/ranking-recommend/server.mjs +0 -2
  196. package/dist/components/biz/business/ranking-recommend/shared/query.mjs +0 -2
  197. package/dist/components/biz/business/ranking-recommend/shared.d.mts +0 -15
  198. package/dist/components/biz/business/ranking-recommend/shared.mjs +0 -2
  199. package/dist/components/common/collection-popup/create-collection-sheet.d.mts +0 -41
  200. package/dist/components/common/collection-popup/create-collection-sheet.mjs +0 -2
  201. package/dist/components/common/list/collection-list/collection-select-icon.mjs +0 -2
  202. package/dist/components/common/list/waterfall-recommend/index.d.mts +0 -2
  203. package/dist/components/common/list/waterfall-recommend/waterfall-recommend.d.mts +0 -116
  204. package/dist/components/common/list/waterfall-recommend/waterfall-recommend.mjs +0 -2
  205. package/dist/components/pages/collection-detail/_components/collection-detail-video-card.mjs +0 -2
  206. package/dist/components/pages/login/auth-page-styles.mjs +0 -6
  207. package/dist/components/pages/search/search-result/shared.mjs +0 -2
  208. package/dist/components/pages/search-result/search-empty.mjs +0 -2
  209. package/dist/components/pages/search-result/search-video-info.mjs +0 -2
  210. package/dist/components/pages/search-result/shared.mjs +0 -2
  211. package/dist/components/pages/search-result/top-header.mjs +0 -2
  212. package/dist/components/pages/video-list/video-list-recommend-item.mjs +0 -2
  213. package/dist/theme-tokens.d.mts +0 -9
  214. package/dist/theme-tokens.mjs +0 -2
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{Image as e}from"../../../../ui/image.mjs";import{Box as t}from"../../../../ui/box.mjs";import n from"../../../../ui/link.mjs";import{adaptFloatingAdItem as r}from"../ad-match.mjs";import{useAdProvider as i}from"../ad-provider.mjs";import{useMemo as a}from"react";import{jsx as o}from"react/jsx-runtime";function s({mode:s=`renderer`,ad:c,materialUrl:l,jumpUrl:u,name:d,bottomOffset:f=100,rightOffset:p=20,pointerEventsDisabled:m=!1,onClick:h}){let g=i(),_=a(()=>{let e=c??{materialUrl:l||``,jumpUrl:u||``,name:d};return r(g?.matchData)??e},[c,g?.matchData,u,l,d]);if(!_.materialUrl||!_.jumpUrl)return null;let v=o(t,{className:`relative flex h-full w-full overflow-hidden`,style:{borderRadius:`8px`},"aria-label":_.name||`悬浮广告`,children:o(t,{className:`absolute inset-0`,children:o(e,{src:_.materialUrl,alt:_.name||`悬浮广告`,fill:!0,className:`object-cover object-center`,unoptimized:!0})})}),y={bottom:`${f}px`,right:`${p}px`,width:`75px`,height:`75px`,pointerEvents:m?`none`:void 0};return h?o(t,{className:`fixed z-50 block cursor-pointer`,style:y,onClick:h,children:v}):o(n,{href:_.jumpUrl,className:`fixed z-50 block`,style:y,children:v})}export{s as FloatingAd};
2
+ "use client";import{Image as e}from"../../../../ui/image.mjs";import{Box as t}from"../../../../ui/box.mjs";import n from"../../../../ui/link.mjs";import{adaptFloatingAdItems as r,hasMatchedAds as i}from"../ad-match.mjs";import{useAdProvider as a}from"../ad-provider.mjs";import{useMemo as o}from"react";import{jsx as s}from"react/jsx-runtime";const c={materialUrl:`/static/components-resource/banner.png`,jumpUrl:`/search`,name:`悬浮广告`};function l({mode:l=`renderer`,bottomOffset:u=100,rightOffset:d=20,pointerEventsDisabled:f=!1,onClick:p}){let m=a(),h=o(()=>l===`editor`?c:i(m?.matchData)?r(m?.matchData)[0]??null:null,[l,m?.matchData]);if(!h?.materialUrl||!h?.jumpUrl)return null;let g=s(t,{className:`relative flex h-full w-full overflow-hidden`,style:{borderRadius:`8px`},"aria-label":h.name||`悬浮广告`,children:s(t,{className:`absolute inset-0`,children:s(e,{src:h.materialUrl,alt:h.name||`悬浮广告`,fill:!0,className:`object-cover object-center`,unoptimized:!0})})}),_={bottom:`${u}px`,right:`${d}px`,width:`75px`,height:`75px`,pointerEvents:f?`none`:void 0};return p?s(t,{className:`fixed z-50 block cursor-pointer`,style:_,onClick:p,children:g}):s(n,{href:h.jumpUrl,className:`fixed z-50 block`,style:_,children:g})}export{l as FloatingAd};
@@ -1,5 +1,5 @@
1
1
 
2
- import { FloatingAdEditableProps, FloatingAdInspectorProps, FloatingAdItem, FloatingAdProps, floatingAdInspectorDefaultProps, floatingAdInspectorPropsSchema } from "./schema.mjs";
2
+ import { FloatingAdItem, FloatingAdProps, floatingAdInspectorDefaultProps, floatingAdInspectorPropsSchema } from "./schema.mjs";
3
3
  import { FloatingAd } from "./client.mjs";
4
4
  import { FloatingAdServer } from "./server.mjs";
5
5
  import { floatingAdMaterial } from "./material.mjs";
@@ -1,5 +1,4 @@
1
1
 
2
- import { SchemaHasDefaultValue } from "../../../../../utils/schema/schema.mjs";
3
2
  import { DefineMaterialOption } from "../../../../../utils/schema/material.mjs";
4
3
  import "../../../../../utils.mjs";
5
4
  import { FloatingAd } from "./client.mjs";
@@ -12,10 +11,6 @@ import * as zod_v4_core0 from "zod/v4/core";
12
11
  * 悬浮广告物料定义。
13
12
  */
14
13
  declare const floatingAdMaterial: DefineMaterialOption<typeof FloatingAdServer, typeof FloatingAd, zod.ZodObject<{
15
- readonly materialUrl: zod.ZodString & SchemaHasDefaultValue;
16
- readonly jumpUrl: zod.ZodString & SchemaHasDefaultValue;
17
- readonly name: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
18
- } & {
19
14
  mode: zod.ZodOptional<zod.ZodEnum<{
20
15
  renderer: "renderer";
21
16
  editor: "editor";
@@ -1,6 +1,5 @@
1
1
 
2
- import { InferSchemaProps, MaterialComponentMode, SchemaHasDefaultValue } from "../../../../../utils/schema/schema.mjs";
3
- import "../../../../../utils.mjs";
2
+ import { MaterialComponentMode } from "../../../../../utils/schema/schema.mjs";
4
3
  import { AdsMatchSceneContext } from "../../../../../service/advertisement.mjs";
5
4
  import * as zod from "zod";
6
5
  import * as zod_v4_core0 from "zod/v4/core";
@@ -24,29 +23,19 @@ interface FloatingAdItem {
24
23
  name?: string;
25
24
  }
26
25
  /**
27
- * 悬浮广告物料属性。
26
+ * 悬浮广告物料属性(无 inspector 可配置字段,数据来自广告接口)。
28
27
  */
29
28
  declare const floatingAdInspectorPropsSchema: zod.ZodObject<{
30
- readonly materialUrl: zod.ZodString & SchemaHasDefaultValue;
31
- readonly jumpUrl: zod.ZodString & SchemaHasDefaultValue;
32
- readonly name: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
33
- } & {
34
29
  mode: zod.ZodOptional<zod.ZodEnum<{
35
30
  renderer: "renderer";
36
31
  editor: "editor";
37
32
  }>>;
38
33
  }, zod_v4_core0.$strip>;
39
- declare const floatingAdInspectorDefaultProps: {
40
- readonly materialUrl: string;
41
- readonly jumpUrl: string;
42
- readonly name: string;
43
- };
44
- type FloatingAdInspectorProps<T extends object = object> = InferSchemaProps<typeof floatingAdInspectorPropsSchema> & T;
45
- type FloatingAdEditableProps = InferSchemaProps<typeof floatingAdInspectorPropsSchema>;
34
+ declare const floatingAdInspectorDefaultProps: {};
46
35
  /**
47
36
  * 悬浮广告组件 props。
48
37
  */
49
- type FloatingAdProps = Partial<FloatingAdEditableProps> & {
38
+ interface FloatingAdProps {
50
39
  /**
51
40
  * 渲染模式。
52
41
  */
@@ -59,10 +48,6 @@ type FloatingAdProps = Partial<FloatingAdEditableProps> & {
59
48
  * 广告场景控制对象。
60
49
  */
61
50
  sceneContext?: AdsMatchSceneContext;
62
- /**
63
- * 广告数据。
64
- */
65
- ad?: FloatingAdItem;
66
51
  /**
67
52
  * 距离底部的偏移量。
68
53
  */
@@ -79,6 +64,6 @@ type FloatingAdProps = Partial<FloatingAdEditableProps> & {
79
64
  * 自定义点击事件。
80
65
  */
81
66
  onClick?: () => void;
82
- };
67
+ }
83
68
  //#endregion
84
- export { FloatingAdEditableProps, FloatingAdInspectorProps, FloatingAdItem, FloatingAdProps, floatingAdInspectorDefaultProps, floatingAdInspectorPropsSchema };
69
+ export { FloatingAdItem, FloatingAdProps, floatingAdInspectorDefaultProps, floatingAdInspectorPropsSchema };
@@ -1,2 +1,2 @@
1
1
 
2
- import{defineComponentPropsSchema as e,getSchemaDefaultProps as t}from"../../../../../utils/schema/schema.mjs";const n=e(e=>({materialUrl:e.string(``,{label:`广告素材`,required:!0}),jumpUrl:e.string(``,{label:`跳转链接`,required:!0}),name:e.string(`悬浮广告`,{label:`广告名称`,required:!1})})),r=t(n);export{r as floatingAdInspectorDefaultProps,n as floatingAdInspectorPropsSchema};
2
+ import{defineComponentPropsSchema as e,getSchemaDefaultProps as t}from"../../../../../utils/schema/schema.mjs";const n=e(()=>({})),r=t(n);export{r as floatingAdInspectorDefaultProps,n as floatingAdInspectorPropsSchema};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{Image as e}from"../../../../ui/image.mjs";import{Box as t}from"../../../../ui/box.mjs";import{Text as n}from"../../../../ui/text.mjs";import r from"../../../../ui/link.mjs";import{adaptIconAdProps as i,hasMatchedAds as a}from"../ad-match.mjs";import{useAdProvider as o}from"../ad-provider.mjs";import{useMemo as s}from"react";import{jsx as c,jsxs as l}from"react/jsx-runtime";function u({mode:u=`renderer`,displayCount:d,items:f,pointerEventsDisabled:p=!1}){let m=o(),h=s(()=>a(m?.matchData)?i(m?.matchData):{displayCount:d,items:f},[m?.matchData,d,f]),g=Math.min(Math.max(h.displayCount,0),Math.min(h.items.length,5)),_=h.items.slice(0,g);return _.length===0?null:c(t,{as:`section`,className:`w-full`,"aria-label":`图标广告`,style:{pointerEvents:p?`none`:void 0},children:c(t,{className:`flex overflow-x-auto`,style:{gap:`8px`,padding:`16px 24px`,backgroundColor:`#131313`,alignItems:`center`,justifyContent:_.length>=5?`space-between`:`flex-start`},children:_.map((i,a)=>c(r,{href:i.jumpUrl,className:`block shrink-0`,style:{width:`100px`},children:l(t,{className:`flex flex-col items-center`,style:{gap:`12px`},children:[c(t,{className:`relative overflow-hidden`,style:{width:`100px`,height:`61px`,borderRadius:`10px`,backgroundColor:`#616161`},children:c(e,{src:i.icon,alt:i.title||`图标广告`,fill:!0,className:`object-cover object-center`,unoptimized:!0})}),c(n,{className:`truncate text-center text-white`,style:{width:`100px`,fontSize:`12px`,lineHeight:1,fontWeight:500},children:i.title}),c(t,{className:`flex items-center justify-center`,style:{minWidth:`35px`,padding:`2px 8px`,borderRadius:`4px`,backgroundColor:`rgba(255, 255, 255, 0.33)`},children:c(n,{className:`whitespace-nowrap text-white`,style:{fontSize:`10px`,lineHeight:`normal`,fontWeight:400},children:i.badgeText||`广告`})})]})},`${i.jumpUrl}-${a}`))})})}export{u as IconAd};
2
+ "use client";import{Image as e}from"../../../../ui/image.mjs";import{Box as t}from"../../../../ui/box.mjs";import{Text as n}from"../../../../ui/text.mjs";import r from"../../../../ui/link.mjs";import{adaptIconAdProps as i,hasMatchedAds as a}from"../ad-match.mjs";import{useAdProvider as o}from"../ad-provider.mjs";import{iconAdInspectorDefaultProps as s}from"./schema.mjs";import{useMemo as c}from"react";import{jsx as l,jsxs as u}from"react/jsx-runtime";const d=[{title:`图标广告1`,icon:`/static/components-resource/banner.png`,jumpUrl:`/search`,badgeText:`广告`},{title:`图标广告2`,icon:`/static/components-resource/banner.png`,jumpUrl:`/search`,badgeText:`广告`},{title:`图标广告3`,icon:`/static/components-resource/banner.png`,jumpUrl:`/search`,badgeText:`广告`},{title:`图标广告4`,icon:`/static/components-resource/banner.png`,jumpUrl:`/search`,badgeText:`广告`},{title:`图标广告5`,icon:`/static/components-resource/banner.png`,jumpUrl:`/search`,badgeText:`广告`}];function f(e,t){return Array.isArray(e)&&e.length>0?e:t??[]}function p(e,t){return typeof e==`number`&&e>0?e:t}function m({mode:m=`renderer`,displayCount:h,items:g,pointerEventsDisabled:_=!1}){let v=m===`editor`?{displayCount:p(h,s.displayCount),items:f(g,d)}:{displayCount:h,items:g},y=o(),b=c(()=>a(y?.matchData)?i(y?.matchData):{displayCount:v.displayCount,items:v.items},[y?.matchData,v.displayCount,v.items]),x=b.displayCount??b.items.length,S=Math.min(Math.max(x,0),Math.min(b.items.length,5)),C=b.items.slice(0,S);return C.length===0?null:l(t,{as:`section`,className:`w-full`,"aria-label":`图标广告`,style:{pointerEvents:_?`none`:void 0},children:l(t,{className:`flex overflow-x-auto`,style:{gap:`8px`,padding:`16px 24px`,backgroundColor:`#131313`,alignItems:`center`,justifyContent:C.length>=5?`space-between`:`flex-start`},children:C.map((i,a)=>l(r,{href:i.jumpUrl,className:`block shrink-0`,style:{width:`100px`},children:u(t,{className:`flex flex-col items-center`,style:{gap:`12px`},children:[l(t,{className:`relative overflow-hidden`,style:{width:`100px`,height:`61px`,borderRadius:`10px`,backgroundColor:`#616161`},children:l(e,{src:i.icon,alt:i.title||`图标广告`,fill:!0,className:`object-cover object-center`,unoptimized:!0})}),l(n,{className:`truncate text-center text-white`,style:{width:`100px`,fontSize:`12px`,lineHeight:1,fontWeight:500},children:i.title}),l(t,{className:`flex items-center justify-center`,style:{minWidth:`35px`,padding:`2px 8px`,borderRadius:`4px`,backgroundColor:`rgba(255, 255, 255, 0.33)`},children:l(n,{className:`whitespace-nowrap text-white`,style:{fontSize:`10px`,lineHeight:`normal`,fontWeight:400},children:i.badgeText||`广告`})})]})},`${i.jumpUrl}-${a}`))})})}export{m as IconAd};
@@ -18,7 +18,7 @@ declare const iconAdMaterial: DefineMaterialOption<typeof IconAdServer, typeof I
18
18
  icon: zod.ZodString & SchemaHasDefaultValue;
19
19
  jumpUrl: zod.ZodString & SchemaHasDefaultValue;
20
20
  badgeText: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
21
- }, zod_v4_core0.$strip>> & SchemaHasDefaultValue;
21
+ }, zod_v4_core0.$strip>>;
22
22
  } & {
23
23
  mode: zod.ZodOptional<zod.ZodEnum<{
24
24
  renderer: "renderer";
@@ -1,2 +1,2 @@
1
1
 
2
- import{defineMaterial as e}from"../../../../../utils/schema/material.mjs";import{IconAd as t}from"./client.mjs";import{iconAdInspectorPropsSchema as n}from"./schema.mjs";import{IconAdServer as r}from"./server.mjs";const i=e({type:`icon-ad`,name:`图标广告`,icon:`/static/components-thumb/shortcut_grid_5.png`,category:`广告组件`,serverComponent:r,clientComponent:t,propsSchema:n});export{i as iconAdMaterial};
2
+ import{defineMaterial as e}from"../../../../../utils/schema/material.mjs";import{iconAdInspectorPropsSchema as t}from"./schema.mjs";import{IconAd as n}from"./client.mjs";import{IconAdServer as r}from"./server.mjs";const i=e({type:`icon-ad`,name:`图标广告`,icon:`/static/components-thumb/shortcut_grid_5.png`,category:`广告组件`,serverComponent:r,clientComponent:n,propsSchema:t});export{i as iconAdMaterial};
@@ -36,7 +36,7 @@ declare const iconAdInspectorPropsSchema: z$1.ZodObject<{
36
36
  icon: z$1.ZodString & SchemaHasDefaultValue;
37
37
  jumpUrl: z$1.ZodString & SchemaHasDefaultValue;
38
38
  badgeText: z$1.ZodOptional<z$1.ZodString> & SchemaHasDefaultValue;
39
- }, z$1.core.$strip>> & SchemaHasDefaultValue;
39
+ }, z$1.core.$strip>>;
40
40
  } & {
41
41
  mode: z$1.ZodOptional<z$1.ZodEnum<{
42
42
  renderer: "renderer";
@@ -45,12 +45,6 @@ declare const iconAdInspectorPropsSchema: z$1.ZodObject<{
45
45
  }, z$1.core.$strip>;
46
46
  declare const iconAdInspectorDefaultProps: {
47
47
  readonly displayCount: number;
48
- readonly items: {
49
- title: string;
50
- icon: string;
51
- jumpUrl: string;
52
- badgeText?: string | undefined;
53
- }[];
54
48
  };
55
49
  type IconAdInspectorProps<T extends object = object> = InferSchemaProps<typeof iconAdInspectorPropsSchema> & T;
56
50
  /**
@@ -1,2 +1,2 @@
1
1
 
2
- import{defineComponentPropsSchema as e,getSchemaDefaultProps as t}from"../../../../../utils/schema/schema.mjs";import n from"zod";const r=e(e=>({displayCount:e.number(5,{label:`数量选择`,required:!0}).refine(e=>e>=1&&e<=5,`数量选择必须为 1-5`),items:e.array(n.object({title:e.string(`广告标题`,{label:`标题`,required:!0}),icon:e.string(``,{label:`素材`,required:!0}),jumpUrl:e.string(``,{label:`跳转链接`,required:!0}),badgeText:e.string(`广告`,{label:`广告标识`,required:!1})}),{label:`广告列表`,required:!0,defaultValue:[{title:`图标广告1`,icon:`/static/components-resource/banner.png`,jumpUrl:`/search`,badgeText:`广告`},{title:`图标广告2`,icon:`/static/components-resource/banner.png`,jumpUrl:`/search`,badgeText:`广告`},{title:`图标广告3`,icon:`/static/components-resource/banner.png`,jumpUrl:`/search`,badgeText:`广告`}]})})),i=t(r);export{i as iconAdInspectorDefaultProps,r as iconAdInspectorPropsSchema};
2
+ import{defineComponentPropsSchema as e,getSchemaDefaultProps as t}from"../../../../../utils/schema/schema.mjs";import n from"zod";const r=e(e=>({displayCount:e.number(5,{label:`数量选择`,required:!0}).refine(e=>e>=1&&e<=5,`数量选择必须为 1-5`),items:e.array(n.object({title:e.string(`广告标题`,{label:`标题`,required:!0}),icon:e.string(``,{label:`素材`,required:!0}),jumpUrl:e.string(``,{label:`跳转链接`,required:!0}),badgeText:e.string(`广告`,{label:`广告标识`,required:!1})}),{label:`广告列表`,required:!0})})),i=t(r);export{i as iconAdInspectorDefaultProps,r as iconAdInspectorPropsSchema};
@@ -1,9 +1,9 @@
1
1
 
2
2
  import { BannerAdInspectorProps, BannerAdItem, BannerAdProps, BannerAdStyleSize, bannerAdInspectorDefaultProps, bannerAdInspectorPropsSchema, bannerAdStyleSizeOptions } from "./banner-ad/schema.mjs";
3
- import { FloatingAdEditableProps, FloatingAdInspectorProps, FloatingAdItem, FloatingAdProps, floatingAdInspectorDefaultProps, floatingAdInspectorPropsSchema } from "./floating-ad/schema.mjs";
3
+ import { FloatingAdItem, FloatingAdProps, floatingAdInspectorDefaultProps, floatingAdInspectorPropsSchema } from "./floating-ad/schema.mjs";
4
4
  import { IconAdInspectorProps, IconAdItem, IconAdProps, iconAdInspectorDefaultProps, iconAdInspectorPropsSchema } from "./icon-ad/schema.mjs";
5
5
  import { TextAdInspectorProps, TextAdItem, TextAdProps, textAdInspectorDefaultProps, textAdInspectorPropsSchema } from "./text-ad/schema.mjs";
6
- import { AdsMatchExtData, adaptBannerAdProps, adaptFloatingAdItem, adaptIconAdProps, adaptPopupAdMaterials, adaptTextAdProps, buildAdsMatchRequest, getFirstMatchedMaterial, hasMatchedAds, parseAdsMatchExtData, resolveAdsAppCode, sortAdsMatchMaterials } from "./ad-match.mjs";
6
+ import { AdsMatchExtData, adaptBannerAdProps, adaptFloatingAdItems, adaptIconAdProps, adaptPopupAdMaterials, adaptTextAdProps, buildAdsMatchRequest, hasMatchedAds, parseAdsMatchExtData, resolveAdsAppCode, sortAdsMatchMaterials } from "./ad-match.mjs";
7
7
  import { AdProvider, AdProviderProps, AdProviderValue, useAdProvider } from "./ad-provider.mjs";
8
8
  import { AdsMatchQueryOptions, createAdsMatchPrefetchItem, createAdsMatchQueryFn, getAdsMatchQueryKey } from "./ad-query.mjs";
9
9
  import { AdRuntimeProvider, AdRuntimeProviderProps } from "./ad-runtime-provider.mjs";
@@ -11,7 +11,7 @@ import { BannerAd } from "./banner-ad/client.mjs";
11
11
  import { BannerAdServer } from "./banner-ad/server.mjs";
12
12
  import { bannerAdMaterial } from "./banner-ad/material.mjs";
13
13
  import "./banner-ad/index.mjs";
14
- import { FeedAdBadge, FeedAdItemLike, getFeedAdIcon, getFeedAdJumpUrl, isFeedAdItem } from "./feed-ad/index.mjs";
14
+ import { FeedAdBadge, FeedAdItemLike, FeedAdPayloadLike, getFeedAdIcon, getFeedAdJumpUrl, isFeedAdItem } from "./feed-ad/index.mjs";
15
15
  import { FloatingAd } from "./floating-ad/client.mjs";
16
16
  import { FloatingAdServer } from "./floating-ad/server.mjs";
17
17
  import { floatingAdMaterial } from "./floating-ad/material.mjs";
@@ -20,7 +20,7 @@ import { IconAd } from "./icon-ad/client.mjs";
20
20
  import { IconAdServer } from "./icon-ad/server.mjs";
21
21
  import { iconAdMaterial } from "./icon-ad/material.mjs";
22
22
  import "./icon-ad/index.mjs";
23
- import { PopupAdInspectorProps, PopupAdItem, PopupAdProps, popupAdInspectorDefaultProps, popupAdInspectorPropsSchema } from "./popup-ad/schema.mjs";
23
+ import { PopupAdBaseProps, PopupAdInspectorProps, PopupAdItem, PopupAdProps, popupAdInspectorDefaultProps, popupAdInspectorPropsSchema } from "./popup-ad/schema.mjs";
24
24
  import { PopupAd } from "./popup-ad/client.mjs";
25
25
  import { PopupAdServer } from "./popup-ad/server.mjs";
26
26
  import { popupAdMaterial } from "./popup-ad/material.mjs";
@@ -1,5 +1,5 @@
1
1
 
2
- "use client";import{Button as e}from"../../../../ui/button.mjs";import{Image as t}from"../../../../ui/image.mjs";import{Box as n}from"../../../../ui/box.mjs";import{Dialog as r,DialogContent as i}from"../../../../ui/dialog.mjs";import a from"../../../../ui/link.mjs";import{adaptPopupAdMaterials as o,hasMatchedAds as s}from"../ad-match.mjs";import{useAdProvider as c}from"../ad-provider.mjs";import{useEffect as l,useMemo as u,useRef as d,useState as f}from"react";import{jsx as p,jsxs as m}from"react/jsx-runtime";function h({items:h,mode:g=`renderer`}){let _=c(),v=u(()=>s(_?.matchData)?o(_?.matchData):h,[_?.matchData,h]),[y,b]=f(0),[x,S]=f(!1),C=d(null);l(()=>{b(0)},[v]),l(()=>{S(!1)},[y,v]),l(()=>()=>{C.current&&window.clearTimeout(C.current)},[]);let w=v[y];function T(){b(e=>e+1)}function E(){x||(S(!0),C.current&&window.clearTimeout(C.current),C.current=window.setTimeout(()=>{C.current=null,T()},260))}function D(e){e||E()}return w?p(r,{open:!0,onOpenChange:D,disablePointerDismissal:!0,children:m(i,{showCloseButton:!1,className:`w-[320px] max-w-[calc(100vw-32px)] border-none bg-transparent p-0 shadow-none`,children:[m(n,{className:`flex flex-col items-center gap-[24px]`,style:{animation:x?`funhub-popup-ad-exit 260ms cubic-bezier(0.4, 0, 0.2, 1) both`:`funhub-popup-ad-enter 420ms cubic-bezier(0.2, 0.9, 0.2, 1) both, funhub-popup-ad-float 3.2s ease-in-out 420ms infinite`,transformOrigin:`center bottom`},children:[p(a,{href:w.jumpUrl,className:`block w-full overflow-hidden rounded-[20px] bg-[#434343]`,style:{boxShadow:`0 18px 48px rgba(0, 0, 0, 0.26)`},children:p(n,{className:`w-full overflow-hidden bg-[#434343]`,children:p(t,{src:w.materialUrl,alt:w.title||`弹窗广告`,width:1200,height:1600,className:`block w-full h-auto`,unoptimized:!0})})}),p(e,{type:`button`,"aria-label":`关闭弹窗广告`,variant:`ghost`,size:`icon-lg`,className:`relative h-[54px] w-[54px] rounded-full border-[3px] border-white bg-transparent p-0 text-white hover:bg-white/8`,onClick:E,style:{animation:x?`funhub-popup-ad-close-exit 260ms ease-out both`:`funhub-popup-ad-close-breathe 2.4s ease-in-out 480ms infinite`},children:m(n,{className:`relative h-[24px] w-[24px]`,children:[p(n,{className:`absolute left-1/2 top-1/2 h-[4px] w-full -translate-x-1/2 -translate-y-1/2 rotate-45 rounded-full bg-current`}),p(n,{className:`absolute left-1/2 top-1/2 h-[4px] w-full -translate-x-1/2 -translate-y-1/2 -rotate-45 rounded-full bg-current`})]})})]},w.id),p(`style`,{jsx:!0,children:`
2
+ "use client";import{Button as e}from"../../../../ui/button.mjs";import{Image as t}from"../../../../ui/image.mjs";import{Box as n}from"../../../../ui/box.mjs";import{Dialog as r,DialogContent as i}from"../../../../ui/dialog.mjs";import a from"../../../../ui/link.mjs";import{adaptPopupAdMaterials as o,hasMatchedAds as s}from"../ad-match.mjs";import{useAdProvider as c}from"../ad-provider.mjs";import{useEffect as l,useMemo as u,useRef as d,useState as f}from"react";import{jsx as p,jsxs as m}from"react/jsx-runtime";const h=[{id:`popup-ad-1`,title:`弹窗广告标题`,jumpUrl:`/search`,materialUrl:`/static/components-resource/banner.png`,desc:`这里是弹窗广告描述`}];function g(e,t){return Array.isArray(e)&&e.length>0?e:t??[]}function _({items:_,mode:v=`renderer`}){let y=c(),b=u(()=>s(y?.matchData)?o(y?.matchData):v===`editor`?g(_,h):_??[],[y?.matchData,v,_]),[x,S]=f(0),[C,w]=f(!1),T=d(null);l(()=>{S(0)},[b]),l(()=>{w(!1)},[x,b]),l(()=>()=>{T.current&&window.clearTimeout(T.current)},[]);let E=b[x];function D(){S(e=>e+1)}function O(){C||(w(!0),T.current&&window.clearTimeout(T.current),T.current=window.setTimeout(()=>{T.current=null,D()},260))}function k(e){e||O()}return E?p(r,{open:!0,onOpenChange:k,disablePointerDismissal:!0,children:m(i,{showCloseButton:!1,className:`w-[320px] max-w-[calc(100vw-32px)] border-none bg-transparent p-0 shadow-none`,children:[m(n,{className:`flex flex-col items-center gap-[24px]`,style:{animation:C?`funhub-popup-ad-exit 260ms cubic-bezier(0.4, 0, 0.2, 1) both`:`funhub-popup-ad-enter 420ms cubic-bezier(0.2, 0.9, 0.2, 1) both, funhub-popup-ad-float 3.2s ease-in-out 420ms infinite`,transformOrigin:`center bottom`},children:[p(a,{href:E.jumpUrl,className:`block w-full overflow-hidden rounded-[20px] bg-[#434343]`,style:{boxShadow:`0 18px 48px rgba(0, 0, 0, 0.26)`},children:p(n,{className:`w-full overflow-hidden bg-[#434343]`,children:p(t,{src:E.materialUrl,alt:E.title||`弹窗广告`,width:1200,height:1600,className:`block w-full h-auto`,unoptimized:!0})})}),p(e,{type:`button`,"aria-label":`关闭弹窗广告`,variant:`ghost`,size:`icon-lg`,className:`relative h-[54px] w-[54px] rounded-full border-[3px] border-white bg-transparent p-0 text-white hover:bg-white/8`,onClick:O,style:{animation:C?`funhub-popup-ad-close-exit 260ms ease-out both`:`funhub-popup-ad-close-breathe 2.4s ease-in-out 480ms infinite`},children:m(n,{className:`relative h-[24px] w-[24px]`,children:[p(n,{className:`absolute left-1/2 top-1/2 h-[4px] w-full -translate-x-1/2 -translate-y-1/2 rotate-45 rounded-full bg-current`}),p(n,{className:`absolute left-1/2 top-1/2 h-[4px] w-full -translate-x-1/2 -translate-y-1/2 -rotate-45 rounded-full bg-current`})]})})]},E.id),p(`style`,{jsx:!0,children:`
3
3
  @keyframes funhub-popup-ad-enter {
4
4
  0% {
5
5
  opacity: 0;
@@ -61,4 +61,4 @@
61
61
  animation-iteration-count: 1 !important;
62
62
  }
63
63
  }
64
- `})]})}):null}export{h as PopupAd};
64
+ `})]})}):null}export{_ as PopupAd};
@@ -1,5 +1,5 @@
1
1
 
2
- import { PopupAdInspectorProps, PopupAdItem, PopupAdProps, popupAdInspectorDefaultProps, popupAdInspectorPropsSchema } from "./schema.mjs";
2
+ import { PopupAdBaseProps, PopupAdInspectorProps, PopupAdItem, PopupAdProps, popupAdInspectorDefaultProps, popupAdInspectorPropsSchema } from "./schema.mjs";
3
3
  import { PopupAd } from "./client.mjs";
4
4
  import { PopupAdServer } from "./server.mjs";
5
5
  import { popupAdMaterial } from "./material.mjs";
@@ -12,13 +12,13 @@ import * as zod_v4_core0 from "zod/v4/core";
12
12
  * 弹窗广告物料定义。
13
13
  */
14
14
  declare const popupAdMaterial: DefineMaterialOption<typeof PopupAdServer, typeof PopupAd, zod.ZodObject<{
15
- readonly items: zod.ZodArray<zod.ZodObject<{
15
+ readonly items: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
16
16
  id: zod.ZodString & SchemaHasDefaultValue;
17
17
  title: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
18
18
  jumpUrl: zod.ZodString & SchemaHasDefaultValue;
19
19
  materialUrl: zod.ZodString & SchemaHasDefaultValue;
20
20
  desc: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
21
- }, zod_v4_core0.$strip>> & SchemaHasDefaultValue;
21
+ }, zod_v4_core0.$strip>>>;
22
22
  } & {
23
23
  mode: zod.ZodOptional<zod.ZodEnum<{
24
24
  renderer: "renderer";
@@ -19,36 +19,37 @@ interface PopupAdItem {
19
19
  * 弹窗广告物料属性。
20
20
  */
21
21
  declare const popupAdInspectorPropsSchema: z$1.ZodObject<{
22
- readonly items: z$1.ZodArray<z$1.ZodObject<{
22
+ readonly items: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
23
23
  id: z$1.ZodString & SchemaHasDefaultValue;
24
24
  title: z$1.ZodOptional<z$1.ZodString> & SchemaHasDefaultValue;
25
25
  jumpUrl: z$1.ZodString & SchemaHasDefaultValue;
26
26
  materialUrl: z$1.ZodString & SchemaHasDefaultValue;
27
27
  desc: z$1.ZodOptional<z$1.ZodString> & SchemaHasDefaultValue;
28
- }, z$1.core.$strip>> & SchemaHasDefaultValue;
28
+ }, z$1.core.$strip>>>;
29
29
  } & {
30
30
  mode: z$1.ZodOptional<z$1.ZodEnum<{
31
31
  renderer: "renderer";
32
32
  editor: "editor";
33
33
  }>>;
34
34
  }, z$1.core.$strip>;
35
- declare const popupAdInspectorDefaultProps: {
36
- readonly items: {
37
- id: string;
38
- jumpUrl: string;
39
- materialUrl: string;
40
- title?: string | undefined;
41
- desc?: string | undefined;
42
- }[];
43
- };
35
+ declare const popupAdInspectorDefaultProps: {};
44
36
  type PopupAdInspectorProps<T extends object = object> = InferSchemaProps<typeof popupAdInspectorPropsSchema> & T;
45
37
  /**
46
38
  * 弹窗广告组件 props。
47
39
  */
48
- type PopupAdProps = PopupAdInspectorProps<{
40
+ interface PopupAdBaseProps {
41
+ /**
42
+ * 广告列表。
43
+ */
44
+ items?: PopupAdItem[];
45
+ }
46
+ /**
47
+ * 弹窗广告组件 props。
48
+ */
49
+ type PopupAdProps = Omit<PopupAdInspectorProps<{
49
50
  mode?: MaterialComponentMode;
50
51
  componentId?: string;
51
52
  sceneContext?: AdsMatchSceneContext;
52
- }>;
53
+ }>, 'items'> & PopupAdBaseProps;
53
54
  //#endregion
54
- export { PopupAdInspectorProps, PopupAdItem, PopupAdProps, popupAdInspectorDefaultProps, popupAdInspectorPropsSchema };
55
+ export { PopupAdBaseProps, PopupAdInspectorProps, PopupAdItem, PopupAdProps, popupAdInspectorDefaultProps, popupAdInspectorPropsSchema };
@@ -1,2 +1,2 @@
1
1
 
2
- import{defineComponentPropsSchema as e,getSchemaDefaultProps as t}from"../../../../../utils/schema/schema.mjs";import n from"zod";const r=e(e=>({items:e.array(n.object({id:e.string(`popup-ad-1`,{label:`广告 ID`,required:!0}),title:e.string(`弹窗广告标题`,{label:`标题`,required:!1}),jumpUrl:e.string(`/search`,{label:`跳转链接`,required:!0}),materialUrl:e.string(`/static/components-resource/banner.png`,{label:`素材地址`,required:!0}),desc:e.string(`这里是弹窗广告描述`,{label:`描述`,required:!1})}),{label:`广告列表`,required:!0,defaultValue:[{id:`popup-ad-1`,title:`弹窗广告标题`,jumpUrl:`/search`,materialUrl:`/static/components-resource/banner.png`,desc:`这里是弹窗广告描述`}]})})),i=t(r);export{i as popupAdInspectorDefaultProps,r as popupAdInspectorPropsSchema};
2
+ import{defineComponentPropsSchema as e,getSchemaDefaultProps as t}from"../../../../../utils/schema/schema.mjs";import n from"zod";const r=e(e=>({items:e.array(n.object({id:e.string(`popup-ad-1`,{label:`广告 ID`,required:!0}),title:e.string(`弹窗广告标题`,{label:`标题`,required:!1}),jumpUrl:e.string(`/search`,{label:`跳转链接`,required:!0}),materialUrl:e.string(`/static/components-resource/banner.png`,{label:`素材地址`,required:!0}),desc:e.string(`这里是弹窗广告描述`,{label:`描述`,required:!1})}),{label:`广告列表`,required:!1})})),i=t(r);export{i as popupAdInspectorDefaultProps,r as popupAdInspectorPropsSchema};
@@ -1,2 +1,2 @@
1
1
 
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{adaptTextAdProps as r,hasMatchedAds as i}from"../ad-match.mjs";import{useAdProvider as a}from"../ad-provider.mjs";import{useEffect as o,useMemo as s,useState as c}from"react";import{jsx as l,jsxs as u}from"react/jsx-runtime";const d=`text_ad_list`;let f=null;function p(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 m(e,t){return p(e.closedAt,t)}function h(){if(f)return f;if(typeof window>`u`)return{};let e=window.localStorage.getItem(d);if(!e)return f={},{};try{let t=JSON.parse(e);return f=t&&typeof t==`object`?t:{},f}catch{return f={},{}}}function g(e){f=e,!(typeof window>`u`)&&window.localStorage.setItem(d,JSON.stringify(e))}function _(e){return h()[e]??{}}function v(e,t){g({...h(),[e]:t})}function y({displayCount:d,items:f,mode:p=`renderer`}){let h=a(),g=e(),y=p===`editor`,[b,x]=c(!1),[S,C]=c(y),[w,T]=c(y),E=s(()=>i(h?.matchData)?r(h?.matchData):{displayCount:d,items:f},[h?.matchData,d,f]),D=s(()=>{let e=E.items.filter(e=>e.text?.trim());return typeof E.displayCount==`number`?e.slice(0,Math.max(E.displayCount,0)):e},[E]),O=D[0],k=s(()=>D.map(e=>`${e.text}:${e.jumpUrl||``}`).join(`|`),[D]);if(o(()=>{x(!0)},[]),o(()=>{if(b){if(y){C(!0),T(!0);return}if(!k||!O){C(!1),T(!0);return}C(!m(_(k),`daily`)),T(!0)}},[O,y,b,k]),!O||!y&&(!b||!w||!S))return null;function A(){k&&v(k,{..._(k),closedAt:Date.now()})}function j(e){e.jumpUrl&&g.push(e.jumpUrl)}function M(e){e.stopPropagation(),C(!1),A()}function N(){y||(C(!1),A(),j(O))}return l(t,{className:`w-full`,style:{backgroundColor:`#131313`,padding:`8px 16px`},children:u(t,{className:`relative flex w-full items-center justify-between overflow-hidden cursor-pointer`,style:{minHeight:`40px`,backgroundColor:`#FFE7E7`,padding:`0 8px`},onClick:N,children:[u(t,{className:`flex min-w-0 items-center`,style:{gap:`8px`,width:`280px`},children:[l(t,{className:`shrink-0`,style:{padding:`4px 8px`,borderRadius:`8px`,backgroundColor:`rgba(0, 0, 0, 0.33)`},children:l(n,{className:`flex h-full items-center justify-center text-white`,style:{fontSize:`12px`,lineHeight:`normal`,fontWeight:400},children:`广告`})}),l(n,{className:`truncate`,style:{flex:`1 0 0`,color:`#FD4C5E`,fontSize:`14px`,lineHeight:`normal`,fontWeight:400},children:O.text})]}),u(t,{className:`flex shrink-0 items-center`,style:{gap:`6px`,width:`54px`},children:[l(t,{className:`flex shrink-0 items-center justify-center`,style:{width:`20px`,height:`34px`},children:l(`svg`,{width:`10`,height:`17`,viewBox:`0 0 10 17`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,children:l(`path`,{d:`M1 1L8.5 8.5L1 16`,stroke:`#FD4C5E`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`})})}),u(`button`,{type:`button`,"aria-label":`关闭文字广告`,className:`relative shrink-0 border-none p-0`,style:{width:`17px`,height:`17px`,borderRadius:`999px`,backgroundColor:`#F9A9AE`},onClick:M,children:[l(t,{className:`absolute left-1/2 top-1/2`,style:{width:`9px`,height:`2px`,borderRadius:`999px`,backgroundColor:`#FFFFFF`,transform:`translate(-50%, -50%) rotate(45deg)`}}),l(t,{className:`absolute left-1/2 top-1/2`,style:{width:`9px`,height:`2px`,borderRadius:`999px`,backgroundColor:`#FFFFFF`,transform:`translate(-50%, -50%) rotate(-45deg)`}})]})]})]})})}export{y as TextAd};
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{adaptTextAdProps as r,hasMatchedAds as i}from"../ad-match.mjs";import{useAdProvider as a}from"../ad-provider.mjs";import{textAdInspectorDefaultProps as o}from"./schema.mjs";import{useEffect as s,useMemo as c,useState as l}from"react";import{jsx as u,jsxs as d}from"react/jsx-runtime";const f=`text_ad_list`,p=[{text:`这是第一条文字广告`,jumpUrl:`/search`},{text:`这是第二条文字广告`,jumpUrl:`/search`},{text:`这是第三条文字广告`,jumpUrl:`/search`},{text:`这是第四条文字广告`,jumpUrl:`/search`},{text:`这是第五条文字广告`,jumpUrl:`/search`}];let m=null;function h(e,t){return Array.isArray(e)&&e.length>0?e:t??[]}function g(e,t){return typeof e==`number`&&e>0?e:t}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(e,t){return _(e.closedAt,t)}function y(){if(m)return m;if(typeof window>`u`)return{};let e=window.localStorage.getItem(f);if(!e)return m={},{};try{let t=JSON.parse(e);return m=t&&typeof t==`object`?t:{},m}catch{return m={},{}}}function b(e){m=e,!(typeof window>`u`)&&window.localStorage.setItem(f,JSON.stringify(e))}function x(e){return y()[e]??{}}function S(e,t){b({...y(),[e]:t})}function C({displayCount:f,items:m,mode:_=`renderer`}){let y=_===`editor`?{displayCount:g(f,o.displayCount),items:h(m,p)}:{displayCount:f,items:m},b=a(),C=e(),w=_===`editor`,[T,E]=l(!1),[D,O]=l(w),[k,A]=l(w),[j,M]=l(0),[N,P]=l(`idle`),F=c(()=>i(b?.matchData)?r(b?.matchData):{displayCount:y.displayCount,items:y.items},[b?.matchData,y.displayCount,y.items]),I=c(()=>{let e=F.items.filter(e=>e.text?.trim());return typeof F.displayCount==`number`?e.slice(0,Math.max(F.displayCount,0)):e},[F]),L=I[j],R=(j+1)%Math.max(I.length,1),z=I.length>1?I[R]:null,B=c(()=>I.map(e=>`${e.text}:${e.jumpUrl||``}`).join(`|`),[I]);if(s(()=>{E(!0)},[]),s(()=>{if(T){if(w){O(!0),A(!0);return}if(!B||!L){O(!1),A(!0);return}O(!v(x(B),`daily`)),A(!0)}},[L,w,T,B]),s(()=>{M(0),P(`idle`)},[B]),s(()=>{if(!D||I.length<=1)return;let e=setInterval(()=>{P(`animating`)},3e3);return()=>clearInterval(e)},[D,I.length]),s(()=>{if(N!==`animating`)return;let e=setTimeout(()=>{M(e=>(e+1)%I.length),P(`idle`)},350);return()=>clearTimeout(e)},[N,I.length]),!L||!w&&(!T||!k||!D))return null;function V(){B&&S(B,{...x(B),closedAt:Date.now()})}function H(e){e.jumpUrl&&C.push(e.jumpUrl)}function U(e){e.stopPropagation(),O(!1),V()}function W(){w||(O(!1),V(),H(L))}return u(t,{className:`w-full`,style:{backgroundColor:`#131313`,padding:`8px 16px`},children:d(t,{className:`relative flex w-full items-center justify-between overflow-hidden cursor-pointer`,style:{minHeight:`40px`,backgroundColor:`#FFE7E7`,padding:`0 8px`},onClick:W,children:[d(t,{className:`flex min-w-0 items-center`,style:{gap:`8px`,width:`280px`},children:[u(t,{className:`shrink-0`,style:{padding:`4px 8px`,borderRadius:`8px`,backgroundColor:`rgba(0, 0, 0, 0.33)`},children:u(n,{className:`flex h-full items-center justify-center text-white`,style:{fontSize:`12px`,lineHeight:`normal`,fontWeight:400},children:`广告`})}),d(t,{className:`relative overflow-hidden`,style:{flex:`1 0 0`,height:`20px`},children:[u(n,{className:`absolute w-full truncate`,style:{color:`#FD4C5E`,fontSize:`14px`,lineHeight:`20px`,fontWeight:400,transform:N===`animating`?`translateY(-100%)`:`translateY(0)`,transition:N===`animating`?`transform 0.35s ease, opacity 0.35s ease`:`none`,opacity:N===`animating`?0:1},children:L.text}),z&&u(n,{className:`absolute w-full truncate`,style:{color:`#FD4C5E`,fontSize:`14px`,lineHeight:`20px`,fontWeight:400,transform:N===`animating`?`translateY(0)`:`translateY(100%)`,transition:N===`animating`?`transform 0.35s ease, opacity 0.35s ease`:`none`,opacity:N===`animating`?1:0},children:z.text})]})]}),d(t,{className:`flex shrink-0 items-center`,style:{gap:`6px`,width:`54px`},children:[u(t,{className:`flex shrink-0 items-center justify-center`,style:{width:`20px`,height:`34px`},children:u(`svg`,{width:`10`,height:`17`,viewBox:`0 0 10 17`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,children:u(`path`,{d:`M1 1L8.5 8.5L1 16`,stroke:`#FD4C5E`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`})})}),d(`button`,{type:`button`,"aria-label":`关闭文字广告`,className:`relative shrink-0 border-none p-0`,style:{width:`17px`,height:`17px`,borderRadius:`999px`,backgroundColor:`#F9A9AE`},onClick:U,children:[u(t,{className:`absolute left-1/2 top-1/2`,style:{width:`9px`,height:`2px`,borderRadius:`999px`,backgroundColor:`#FFFFFF`,transform:`translate(-50%, -50%) rotate(45deg)`}}),u(t,{className:`absolute left-1/2 top-1/2`,style:{width:`9px`,height:`2px`,borderRadius:`999px`,backgroundColor:`#FFFFFF`,transform:`translate(-50%, -50%) rotate(-45deg)`}})]})]})]})})}export{C as TextAd};
@@ -16,7 +16,7 @@ declare const textAdMaterial: DefineMaterialOption<typeof TextAdServer, typeof T
16
16
  readonly items: zod.ZodArray<zod.ZodObject<{
17
17
  text: zod.ZodString & SchemaHasDefaultValue;
18
18
  jumpUrl: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
19
- }, zod_v4_core0.$strip>> & SchemaHasDefaultValue;
19
+ }, zod_v4_core0.$strip>>;
20
20
  } & {
21
21
  mode: zod.ZodOptional<zod.ZodEnum<{
22
22
  renderer: "renderer";
@@ -1,2 +1,2 @@
1
1
 
2
- import{defineMaterial as e}from"../../../../../utils/schema/material.mjs";import{TextAd as t}from"./client.mjs";import{textAdInspectorPropsSchema as n}from"./schema.mjs";import{TextAdServer as r}from"./server.mjs";const i=e({type:`text-ad`,name:`文字广告`,icon:`/static/components-thumb/marquee_clickable_closable.png`,category:`广告组件`,serverComponent:r,clientComponent:t,propsSchema:n});export{i as textAdMaterial};
2
+ import{defineMaterial as e}from"../../../../../utils/schema/material.mjs";import{textAdInspectorPropsSchema as t}from"./schema.mjs";import{TextAd as n}from"./client.mjs";import{TextAdServer as r}from"./server.mjs";const i=e({type:`text-ad`,name:`文字广告`,icon:`/static/components-thumb/marquee_clickable_closable.png`,category:`广告组件`,serverComponent:r,clientComponent:n,propsSchema:t});export{i as textAdMaterial};
@@ -26,7 +26,7 @@ declare const textAdInspectorPropsSchema: z$1.ZodObject<{
26
26
  readonly items: z$1.ZodArray<z$1.ZodObject<{
27
27
  text: z$1.ZodString & SchemaHasDefaultValue;
28
28
  jumpUrl: z$1.ZodOptional<z$1.ZodString> & SchemaHasDefaultValue;
29
- }, z$1.core.$strip>> & SchemaHasDefaultValue;
29
+ }, z$1.core.$strip>>;
30
30
  } & {
31
31
  mode: z$1.ZodOptional<z$1.ZodEnum<{
32
32
  renderer: "renderer";
@@ -35,10 +35,6 @@ declare const textAdInspectorPropsSchema: z$1.ZodObject<{
35
35
  }, z$1.core.$strip>;
36
36
  declare const textAdInspectorDefaultProps: {
37
37
  readonly displayCount: number;
38
- readonly items: {
39
- text: string;
40
- jumpUrl?: string | undefined;
41
- }[];
42
38
  };
43
39
  type TextAdInspectorProps<T extends object = object> = InferSchemaProps<typeof textAdInspectorPropsSchema> & T;
44
40
  /**
@@ -1,2 +1,2 @@
1
1
 
2
- import{defineComponentPropsSchema as e,getSchemaDefaultProps as t}from"../../../../../utils/schema/schema.mjs";import n from"zod";const r=e(e=>({displayCount:e.number(1,{label:`广告展示数量选择`,required:!0}).refine(e=>e>=1&&e<=5,`广告展示数量必须为 1-5`),items:e.array(n.object({text:e.string(`请输入广告文案`,{label:`广告文案`,required:!0}),jumpUrl:e.string(``,{label:`跳转链接`,required:!1})}),{label:`广告列表`,required:!0,defaultValue:[{text:`这是第一条文字广告`,jumpUrl:`/search`},{text:`这是第二条文字广告`,jumpUrl:`/search`}]})})),i=t(r);export{i as textAdInspectorDefaultProps,r as textAdInspectorPropsSchema};
2
+ import{defineComponentPropsSchema as e,getSchemaDefaultProps as t}from"../../../../../utils/schema/schema.mjs";import n from"zod";const r=e(e=>({displayCount:e.number(1,{label:`广告展示数量选择`,required:!0}).refine(e=>e>=1&&e<=5,`广告展示数量必须为 1-5`),items:e.array(n.object({text:e.string(`请输入广告文案`,{label:`广告文案`,required:!0}),jumpUrl:e.string(``,{label:`跳转链接`,required:!1})}),{label:`广告列表`,required:!0})})),i=t(r);export{i as textAdInspectorDefaultProps,r as textAdInspectorPropsSchema};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{buildContentUrl as e}from"../../../../../utils/helpers/url.mjs";import{mergeStyles as t}from"../../../../../utils/styles/helpers.mjs";import{Image as n}from"../../../../../../ui/image.mjs";import{Box as r}from"../../../../../../ui/box.mjs";import{Carousel as i,CarouselContent as a,CarouselItem as o}from"../../../../../../ui/carousel.mjs";import{Text as s}from"../../../../../../ui/text.mjs";import c from"../../../../../../ui/link.mjs";import{defaultProps as l}from"../defaults/default-props.mjs";import u from"clsx";import{useIsClient as d}from"foxact/use-is-client";import{useEffect as f,useRef as p,useState as m}from"react";import{jsx as h,jsxs as g}from"react/jsx-runtime";const _={list:[]};function v({mode:v=`renderer`,props:y=_,styles:b,events:x}){let S=v===`editor`,{autoplay:C=l.autoplay,interval:w=l.interval,loop:T=l.loop,showTitle:E=l.showTitle,showIndicator:D=l.showIndicator,list:O=[]}={...l,...y},[k,A]=m(),[j,M]=m(0),N=d(),P=p(null);if(f(()=>{if(!k||!N)return;let e=()=>{M(k.selectedScrollSnap())};return k.on(`select`,e),e(),()=>{k.off(`select`,e)}},[k,x,N]),f(()=>!C||!k||O.length<=1?void 0:(P.current=setInterval(()=>{k.canScrollNext()?k.scrollNext():T&&k.scrollTo(0)},w),()=>{P.current&&=(clearInterval(P.current),null)}),[C,k,w,T,O.length]),!O||O.length===0)return null;let F=O[j],I=b?t(b,{}):void 0;return h(r,{className:u(`w-full px-[16px]`,S&&`pointer-events-none`),style:I,children:g(r,{className:`relative w-full`,children:[h(i,{setApi:A,opts:{align:`start`,loop:T,skipSnaps:!1,dragFree:!1},className:`w-full`,children:h(a,{className:`ml-0`,children:O.map((t,r)=>h(o,{className:`pl-0`,children:h(c,{href:e({url:``,contentId:t.contentId,contentType:1,title:t.title}),className:u(`block relative w-full overflow-hidden touch-manipulation`,`aspect-[358/166]`),children:h(n,{src:t.coverUrl,alt:t.title||`Banner ${r+1}`,fill:!0,objectFit:`cover`,unoptimized:!0})})},r))})}),(E||D&&O.length>1)&&h(r,{className:`absolute inset-x-0 bottom-0 h-[72px] pointer-events-none`,style:{background:`linear-gradient(180deg, rgba(8, 2, 17, 0) 0%, rgba(8, 2, 17, 0.28) 55%, rgba(8, 2, 17, 0.4) 100%)`}}),E&&F?.title&&h(r,{className:`absolute left-[12px] right-[12px] bottom-[34px] pointer-events-none`,children:h(s,{as:`p`,className:`text-white text-[16px] leading-[22px] font-medium line-clamp-1`,children:F.title})}),D&&O.length>1&&h(r,{className:`absolute left-1/2 -translate-x-1/2 bottom-[16px] flex items-center gap-[4px] pointer-events-auto`,children:O.map((e,t)=>h(`button`,{type:`button`,className:u(`block size-[6px] rounded-full`,t===j?`bg-theme5`:`bg-[rgba(0,0,0,0.6)]`),"aria-label":`跳转到第 ${t+1} 个 Banner`},t))})]})})}export{v as default};
2
+ "use client";import{buildContentUrl as e}from"../../../../../utils/helpers/url.mjs";import{mergeStyles as t}from"../../../../../utils/styles/helpers.mjs";import{Image as n}from"../../../../../../ui/image.mjs";import{Box as r}from"../../../../../../ui/box.mjs";import{Carousel as i,CarouselContent as a,CarouselItem as o}from"../../../../../../ui/carousel.mjs";import{Text as s}from"../../../../../../ui/text.mjs";import c from"../../../../../../ui/legacy/button.mjs";import l from"../../../../../../ui/link.mjs";import{defaultProps as u}from"../defaults/default-props.mjs";import d from"clsx";import{useIsClient as f}from"foxact/use-is-client";import{useEffect as p,useRef as m,useState as h}from"react";import{jsx as g,jsxs as _}from"react/jsx-runtime";const v={list:[]};function y({mode:y=`renderer`,props:b=v,styles:x,events:S}){let C=y===`editor`,{autoplay:w=u.autoplay,interval:T=u.interval,loop:E=u.loop,showTitle:D=u.showTitle,showIndicator:O=u.showIndicator,list:k=[]}={...u,...b},[A,j]=h(),[M,N]=h(0),P=f(),F=m(null);if(p(()=>{if(!A||!P)return;let e=()=>{N(A.selectedScrollSnap())};return A.on(`select`,e),e(),()=>{A.off(`select`,e)}},[A,S,P]),p(()=>!w||!A||k.length<=1?void 0:(F.current=setInterval(()=>{A.canScrollNext()?A.scrollNext():E&&A.scrollTo(0)},T),()=>{F.current&&=(clearInterval(F.current),null)}),[w,A,T,E,k.length]),!k||k.length===0)return null;let I=k[M],L=x?t(x,{}):void 0;return _(r,{className:C?`relative w-full pointer-events-none`:`relative w-full`,style:L,children:[g(i,{setApi:j,opts:{align:`start`,loop:E,skipSnaps:!1,dragFree:!1},className:`w-full`,children:g(a,{className:`ml-0`,children:k.map((t,r)=>g(o,{className:`pl-0`,children:g(l,{href:e({url:``,contentId:t.contentId,contentType:1,title:t.title}),className:`block relative w-full h-[242px] overflow-hidden touch-manipulation`,children:g(n,{src:t.coverUrl,alt:t.title||`Banner ${r+1}`,fill:!0,objectFit:`cover`,unoptimized:!0})})},r))})}),D&&I?.title&&g(r,{className:`absolute bottom-[8px] left-[8px]`,children:g(s,{as:`p`,className:`text-white text-[16px] line-clamp-1`,children:I.title})}),O&&k.length>1&&g(r,{className:`absolute bottom-[16px] right-[8px] flex items-center gap-[4px]`,children:k.map((e,t)=>g(c,{type:`button`,className:d(`transition-all duration-300 rounded-full !p-0`,t===M?`w-[10px] h-[6px] bg-black`:`w-[6px] h-[6px] bg-white/50`),"aria-label":`跳转到第 ${t+1} 个 Banner`},t))})]})}export{y as default};
@@ -9,10 +9,9 @@ import * as react_jsx_runtime0 from "react/jsx-runtime";
9
9
  //#region components/biz/business/banner-carousel/client.d.ts
10
10
  declare function BannerCarouselClient({
11
11
  mode,
12
- props: nestedPropsConfig,
13
12
  styles,
14
13
  events,
15
- ...directPropsConfig
14
+ ...componentPops
16
15
  }: BaseComponentProps<any> & {
17
16
  mode?: MaterialComponentMode;
18
17
  } & BasicBannerProps): react_jsx_runtime0.JSX.Element | null;
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{mergeStyles as e}from"../../utils/styles/helpers.mjs";import{Image as t}from"../../../ui/image.mjs";import{Box as n}from"../../../ui/box.mjs";import{Carousel as r,CarouselContent as i,CarouselItem as a}from"../../../ui/carousel.mjs";import{Text as o}from"../../../ui/text.mjs";import s from"../../../ui/link.mjs";import c from"../../../../assets/icons/detail/video_flag.mjs";import{defaultProps as l}from"./default-props.mjs";import u from"clsx";import{useIsClient as d}from"foxact/use-is-client";import{useEffect as f,useRef as p,useState as m}from"react";import{jsx as h,jsxs as g}from"react/jsx-runtime";const _={list:[]};function v(e){let t=Number(e||0);if(!Number.isFinite(t)||t<=0)return`0`;if(t>=1e4){let e=t/1e4;return`${e%1==0?e:e.toFixed(1)}万`}if(t>=1e3){let e=t/1e3;return`${e%1==0?e:e.toFixed(1)}千`}return String(Math.floor(t))}function y(e){let t=e.playCount;if(typeof t==`number`&&Number.isFinite(t))return t;let n=e.video;if(!n||typeof n!=`object`)return 0;let r=n;return Number(r.static?.browse_cnt??r.play_count??0)||0}function b({mode:b=`renderer`,props:x=_,styles:S,events:C,...w}){let T=b===`editor`,{autoplay:E=l.autoplay,interval:D=l.interval,loop:O=l.loop,showTitle:k=l.showTitle,showIndicator:A=l.showIndicator,list:j=[]}={...l,...x,...w},[M,N]=m(),[P,F]=m(0),I=d(),L=p(null);if(f(()=>{if(!M||!I)return;let e=()=>{F(M.selectedScrollSnap())};return M.on(`select`,e),e(),()=>{M.off(`select`,e)}},[M,C,I]),f(()=>{if(!(!E||!M||j.length<=1))return L.current=setInterval(()=>{M.canScrollNext()?M.scrollNext():O&&M.scrollTo(0)},D*1e3),()=>{L.current&&=(clearInterval(L.current),null)}},[E,M,D,O,j.length]),!j||j.length===0)return null;let R=j[P],z=S?e(S,{}):void 0,B=R?.badgeUrl||``,V=R?.showPlayCount??!0,H=R?.showEpisodeCount??!0,U=y(R),W=typeof R?.episodeInfo==`string`?R.episodeInfo.trim():``;return h(n,{className:u(`w-full px-[16px]`,T&&`pointer-events-none`),style:z,children:g(n,{className:`relative w-full overflow-hidden rounded-[8px]`,children:[h(r,{setApi:N,opts:{align:`start`,loop:O,skipSnaps:!1,dragFree:!1},className:`w-full`,children:h(i,{className:`ml-0`,children:j.map((e,n)=>h(a,{className:`pl-0`,children:h(s,{href:e.target,className:u(`block relative w-full overflow-hidden touch-manipulation`,`aspect-[358/166]`),children:h(t,{src:e.coverUrl,alt:e.title||`Banner ${n+1}`,fill:!0,objectFit:`cover`,unoptimized:!0})})},n))})}),h(n,{className:`absolute inset-0 pointer-events-none flex flex-col justify-end`,style:{background:`linear-gradient(180deg, rgba(8, 2, 17, 0) 0%, rgba(8, 2, 17, 0.28) 55%, rgba(8, 2, 17, 0.4) 100%)`},children:h(n,{className:`flex items-end px-[12px] pb-[32px] pt-[36px]`,children:g(n,{className:`flex-1 min-w-0 flex flex-col gap-[4px]`,children:[k&&R?.title!=null&&h(o,{as:`p`,className:`text-white text-[16px] leading-[22px] font-semibold line-clamp-1`,children:String(R.title)}),g(n,{className:`flex items-center gap-[8px]`,children:[V&&g(n,{className:`flex items-center gap-[4px] px-[4px] py-0 rounded-[4px] bg-white/10 shrink-0`,children:[h(c,{className:`w-[12px] h-[12px] text-white shrink-0`}),h(o,{as:`span`,className:`text-white text-[12px] leading-[20px]`,children:v(U)})]}),H&&W&&h(o,{as:`span`,className:`text-white text-[12px] leading-[20px] shrink-0`,children:W})]})]})})}),A&&j.length>1&&h(n,{className:`absolute left-1/2 -translate-x-1/2 bottom-[16px] flex items-center gap-[4px] pointer-events-auto`,children:j.map((e,t)=>h(`button`,{type:`button`,className:u(`block size-[6px] rounded-full`,t===P?`bg-theme5`:`bg-[rgba(0,0,0,0.6)]`),"aria-label":`跳转到第 ${t+1} 个 Banner`,onClick:()=>M?.scrollTo(t)},t))}),B&&h(n,{className:`absolute top-0 right-0 overflow-hidden rounded-bl-[8px] pointer-events-none`,children:h(t,{src:B,alt:``,width:37,height:20,className:`object-contain`,unoptimized:!0})})]})})}export{b as default};
2
+ "use client";import{mergeStyles as e}from"../../utils/styles/helpers.mjs";import{Button as t}from"../../../ui/button.mjs";import{Image as n}from"../../../ui/image.mjs";import{Box as r}from"../../../ui/box.mjs";import{Carousel as i,CarouselContent as a,CarouselItem as o}from"../../../ui/carousel.mjs";import{Text as s}from"../../../ui/text.mjs";import c from"../../../ui/link.mjs";import l from"../../../../assets/icons/detail/video_flag.mjs";import{defaultProps as u}from"./default-props.mjs";import d from"clsx";import{useIsClient as f}from"foxact/use-is-client";import{useEffect as p,useRef as m,useState as h}from"react";import{jsx as g,jsxs as _}from"react/jsx-runtime";function v(e){let t=Number(e||0);if(!Number.isFinite(t)||t<=0)return`0`;if(t>=1e4){let e=t/1e4;return`${e%1==0?e:e.toFixed(1)}万`}if(t>=1e3){let e=t/1e3;return`${e%1==0?e:e.toFixed(1)}千`}return String(Math.floor(t))}function y(e){let t=e.playCount;if(typeof t==`number`&&Number.isFinite(t))return t;let n=e.video;if(!n||typeof n!=`object`)return 0;let r=n;return Number(r.static?.browse_cnt??r.play_count??0)||0}function b({mode:b=`renderer`,styles:x,events:S,...C}){let w=b===`editor`,{autoplay:T=u.autoplay,interval:E=u.interval,loop:D=u.loop,showTitle:O=u.showTitle,showIndicator:k=u.showIndicator,list:A=[]}={...u,...C},[j,M]=h(),[N,P]=h(0),F=f(),I=m(null);if(p(()=>{if(!j||!F)return;let e=()=>{P(j.selectedScrollSnap())};return j.on(`select`,e),e(),()=>{j.off(`select`,e)}},[j,S,F]),p(()=>{if(!(!T||!j||A.length<=1))return I.current=setInterval(()=>{j.canScrollNext()?j.scrollNext():D&&j.scrollTo(0)},E*1e3),()=>{I.current&&=(clearInterval(I.current),null)}},[T,j,E,D,A.length]),!A||A.length===0)return null;let L=A[N],R=x?e(x,{}):void 0,z=L?.badgeUrl||``,B=L?.showPlayCount??!0,V=L?.showEpisodeCount??!0,H=y(L),U=typeof L?.episodeInfo==`string`?L.episodeInfo.trim():``;return _(r,{className:d(`relative w-full overflow-hidden`,w&&`pointer-events-none`),style:R,children:[g(i,{setApi:M,opts:{align:`start`,loop:D,skipSnaps:!1,dragFree:!1},className:`w-full`,children:g(a,{className:`ml-0`,children:A.map((e,t)=>g(o,{className:`pl-0`,children:g(c,{href:e.target,className:`block relative w-full h-[219px] overflow-hidden touch-manipulation`,children:g(n,{src:e.coverUrl,alt:e.title||`Banner ${t+1}`,fill:!0,objectFit:`cover`,unoptimized:!0})})},t))})}),g(r,{className:`absolute inset-0 pointer-events-none flex flex-col justify-end`,style:{background:`linear-gradient(to top, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0) 100%)`},children:_(r,{className:`flex items-end justify-between gap-2 p-[8px]`,children:[_(r,{className:`flex-1 min-w-0 flex flex-col gap-[4px]`,children:[O&&L?.title!=null&&g(s,{as:`p`,className:`text-white text-[16px] leading-[24px] font-bold line-clamp-1`,children:String(L.title)}),_(r,{className:`flex items-center gap-[8px]`,children:[B&&_(r,{className:`flex items-center gap-[4px] px-[4px] py-0 rounded-[4px] bg-white/10 shrink-0`,children:[g(l,{className:`w-[12px] h-[12px] text-white shrink-0`}),g(s,{as:`span`,className:`text-white text-[12px] leading-[20px]`,children:v(H)})]}),V&&U&&g(s,{as:`span`,className:`text-white text-[12px] leading-[20px] shrink-0`,children:U})]})]}),k&&A.length>1&&g(r,{className:`flex items-center gap-[4px] py-[4px] shrink-0 pointer-events-auto`,children:A.map((e,n)=>g(t,{type:`button`,size:`xs`,className:d(`transition-all duration-300 rounded-full !p-0 shrink-0`,n===N?`w-[10px] h-[6px] bg-theme5`:`w-[6px] h-[6px] bg-white/30`),style:{padding:`0 !important`},"aria-label":`跳转到第 ${n+1} 个 Banner`,onClick:()=>j?.scrollTo(n)},n))})]})}),z&&g(r,{className:`absolute top-0 right-0 overflow-hidden rounded-bl-[8px] pointer-events-none`,children:g(n,{src:z,alt:``,width:37,height:20,className:`object-contain`,unoptimized:!0})})]})}export{b as default};
@@ -1,2 +1,2 @@
1
1
 
2
- const e={autoplay:!0,interval:3,loop:!0,showTitle:!1,showIndicator:!0,list:[]};export{e as defaultProps};
2
+ const e={autoplay:!0,interval:3,loop:!0,showTitle:!0,showIndicator:!0,list:[]};export{e as defaultProps};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{mergeStyles as e}from"../../utils/styles/helpers.mjs";import{Box as t}from"../../../ui/box.mjs";import n from"../../../ui/link.mjs";import{urlPrefix as r}from"../../../../constants/url-prefix.mjs";import{useSticky as i}from"../../../../hooks/use-sticky.mjs";import a from"../../../../assets/icons/channel-list/channel-active-indicator.mjs";import o from"../../../../assets/icons/common/header-menu.mjs";import s,{loadHiddenChannelIdsFromStorage as c}from"./channel-filter-dialog.mjs";import{defaultProps as l}from"./default-props.mjs";import{clsx as u}from"clsx";import{useEffect as d,useMemo as f,useState as p}from"react";import{Fragment as m,jsx as h,jsxs as g}from"react/jsx-runtime";import{usePathname as _}from"next/navigation";import{useTranslations as v}from"next-intl";const y={},b=`h-[26px]`;function x(e,t){let n=`${r.DOMAIN}/`,i=t.indexOf(n),a=i!==-1,o=a?t.slice(i+n.length).split(`/`)[0]:void 0;return e.isDefault?a&&o?`${r.DOMAIN}/${o}`:`/`:a&&o?`${r.DOMAIN}/${o}/${encodeURIComponent(e.name)}`:`${r.CHANNEL}/${encodeURIComponent(e.name)}`}function S(r){let S=v(`components.biz.business.navBar.variants.basicNavBar.runtime`),{mode:C=`renderer`,styles:w,events:T,...E}=r,D=_()??`/`,O=C===`editor`,k=E||y,A={...l,...k},[j,M]=p(!1),{isSticky:N,ref:P}=i(),[F,I]=p(!1),[L,R]=p(A.list),z=f(()=>A.list.find(e=>e.isDefault)?.name??null,[A.list]),B=f(()=>A.currentChannelId??z,[A.currentChannelId,z]);d(()=>{let e=c();R(e?.length?A.list.filter(t=>!e.includes(t.name)):A.list)},[A.list]);let V=e=>{R(e)},H=(e,t)=>{T?.onChannelChange?.(e,t)},U=w?e(w,{}):void 0,W=()=>{M(!0),T?.onFilterClick?.()};return d(()=>{let e=()=>{let e=window.scrollY??document.documentElement.scrollTop??0,t=window.innerHeight,n=document.documentElement.scrollHeight;I(e+t>=n-1)};return window.addEventListener(`scroll`,e,{passive:!0}),e(),()=>{window.removeEventListener(`scroll`,e)}},[]),g(m,{children:[N&&h(t,{className:u(`w-full`,b)}),h(t,{as:`nav`,ref:P,className:u(`w-full bg-transparent transition-all duration-200`,O&&`pointer-events-none`,N&&`fixed top-0 left-0 right-0 z-50`),style:U,children:g(t,{className:u(`relative flex w-full items-center px-4`,b,A.modifiable&&`gap-2`),children:[h(t,{className:`[-webkit-overflow-scrolling:touch] [-ms-overflow-style:none] [scrollbar-width:none] flex h-full min-w-0 flex-1 items-center overflow-x-auto overflow-y-hidden [&::-webkit-scrollbar]:hidden`,children:h(t,{className:`inline-flex h-full min-w-full items-center gap-[23.8px]`,children:L.map((e,r)=>{let i=B===e.name||B===null&&r===0;return h(n,{href:x(e,D),webviewNavMode:`spa`,className:u(`group relative inline-flex h-full shrink-0 cursor-pointer whitespace-nowrap transition-all duration-200`,i?`text-white`:`text-white/70`),onClick:()=>H(e,r),children:i?g(t,{className:u(`inline-grid grid-cols-1 grid-rows-1 place-items-start`,b),children:[h(t,{as:`span`,className:`relative z-[1] block h-[24px] text-center text-[20px] font-['PingFang_SC'] font-semibold leading-[24px] text-white transition-all duration-200`,children:e.name}),h(t,{"aria-hidden":`true`,className:`col-start-1 row-start-1 ml-px mt-[15px] h-[11px] w-[39px]`,children:h(a,{className:`block h-full w-full`})})]}):h(t,{className:`inline-flex h-full items-center`,children:h(t,{as:`span`,className:`block h-[24px] text-center text-[16px] font-['PingFang_SC'] font-normal leading-[24px] transition-all duration-200`,children:e.name})})},e.name||`channel-${r}`)})})}),A.modifiable?h(`button`,{type:`button`,"aria-label":S(`moreChannelEntry`),className:`relative flex size-6 shrink-0 items-center justify-center border-0 bg-transparent p-0`,onClick:W,children:h(o,{"aria-hidden":`true`,className:`h-[24px] w-[24px] text-white`})}):null]})}),h(s,{open:j,onOpenChange:M,channels:A.list,currentChannelId:B,onChannelClick:H,onChannelsChange:V})]})}export{S as default};
2
+ "use client";import{mergeStyles as e}from"../../utils/styles/helpers.mjs";import{Box as t}from"../../../ui/box.mjs";import n from"../../../ui/link.mjs";import{urlPrefix as r}from"../../../../constants/url-prefix.mjs";import{useSticky as i}from"../../../../hooks/use-sticky.mjs";import a from"../../../../assets/icons/filter_dark.mjs";import o,{loadHiddenChannelIdsFromStorage as s}from"./channel-filter-dialog.mjs";import{defaultProps as c}from"./default-props.mjs";import{clsx as l}from"clsx";import{useEffect as u,useMemo as d,useState as f}from"react";import{Fragment as p,jsx as m,jsxs as h}from"react/jsx-runtime";import{usePathname as g}from"next/navigation";const _={};function v(e,t){let n=`${r.DOMAIN}/`,i=t.indexOf(n),a=i!==-1,o=a?t.slice(i+n.length).split(`/`)[0]:void 0;return e.isDefault?a&&o?`${r.DOMAIN}/${o}`:`/`:a&&o?`${r.DOMAIN}/${o}/${encodeURIComponent(e.name)}`:`${r.CHANNEL}/${encodeURIComponent(e.name)}`}function y(r){let{mode:y=`renderer`,styles:b,events:x,...S}=r,C=g()??`/`,w=y===`editor`,T=S||_,E={...c,...T},[D,O]=f(!1),{isSticky:k,ref:A}=i(),[j,M]=f(!1),[N,P]=f(E.list),F=d(()=>E.list.find(e=>e.isDefault)?.name??null,[E.list]),I=d(()=>E.currentChannelId??F,[E.currentChannelId,F]);u(()=>{let e=s();P(e?.length?E.list.filter(t=>!e.includes(t.name)):E.list)},[E.list]);let L=e=>{P(e)},R=(e,t)=>{x?.onChannelChange?.(e,t)},z=b?e(b,{}):void 0;return u(()=>{let e=()=>{let e=window.scrollY??document.documentElement.scrollTop??0,t=window.innerHeight,n=document.documentElement.scrollHeight;M(e+t>=n-1)};return window.addEventListener(`scroll`,e,{passive:!0}),e(),()=>{window.removeEventListener(`scroll`,e)}},[]),h(p,{children:[k&&m(t,{className:`w-full h-11`}),m(t,{as:`nav`,ref:A,className:l(`w-full transition-all duration-200 bg-bg1`,w&&`pointer-events-none`,k&&`fixed top-0 left-0 right-0 z-50`),style:z,children:h(t,{className:`relative flex items-center h-[44px]`,children:[m(t,{className:`flex-1 overflow-x-auto overflow-y-hidden [&::-webkit-scrollbar]:hidden`,style:{scrollbarWidth:`none`,msOverflowStyle:`none`,WebkitOverflowScrolling:`touch`},children:m(t,{className:`flex items-center h-full pl-4 pr-4 gap-4`,children:N.map((e,t)=>{let r=I===e.name||I===null&&t===0;return m(n,{href:v(e,C),webviewNavMode:`spa`,className:l(`whitespace-nowrap cursor-pointer transition-all duration-200`,`flex items-center justify-center h-11`,`${r?`text-xl`:`text-base`}`),style:{fontWeight:r?`bold`:`normal`,color:r?`var(--color-theme5)`:`var(--color-text2)`},onClick:()=>R(e,t),children:e.name},e.name||`channel-${t}`)})})}),r.modifiable?m(t,{className:`flex items-center gap-[12px] px-[8px]`,children:m(t,{className:`flex items-center justify-center cursor-pointer w-7 h-8`,onClick:()=>{O(!0),x?.onFilterClick?.()},children:m(a,{className:`w-5 h-5`,style:{color:`var(--color-text1)`}})})}):null]})}),m(o,{open:D,onOpenChange:O,channels:E.list,currentChannelId:I,onChannelClick:R,onChannelsChange:L})]})}export{y as default};
@@ -1,2 +1,2 @@
1
1
 
2
- const e={currentChannelId:null,isFullfeed:!1,modifiable:!0,list:[]};export{e as defaultProps};
2
+ const e={currentChannelId:null,isFullfeed:!1,list:[]};export{e as defaultProps};
@@ -0,0 +1,2 @@
1
+
2
+ "use client";import{Box as e}from"../../../../ui/box.mjs";import{Text as t}from"../../../../ui/text.mjs";import{useCardDecoration as n}from"../../../../../hooks/use-card-decoration.mjs";import{DetailInfoTags as r}from"./detail-info-tags.mjs";import{DetailInfoTitle as i}from"./detail-info-title.mjs";import{useEffect as a,useMemo as o,useRef as s,useState as c}from"react";import{jsx as l,jsxs as u}from"react/jsx-runtime";import{useTranslations as d}from"next-intl";function f({information:f,isShow:m,showTags:h=!0}){let g=d(`components.biz.business.detail`),{getTitleText:_}=n(),v=o(()=>_(f),[_,f]),y=o(()=>f.description||``,[f.description]),[b,x]=c(!1),[S,C]=c(!1),w=s(null),T=o(()=>p(f.score),[f.score]),E=f.tags||[],D=h&&E.length>0;a(()=>{x(!1)},[y]),a(()=>{if(b){C(!0);return}let e=w.current;if(!y||!m||!e){C(!1);return}let t=()=>{C(e.scrollHeight>e.clientHeight+1)};t();let n=new ResizeObserver(t);return n.observe(e),()=>{n.disconnect()}},[y,b,m]);function O(){x(e=>!e)}return!v&&!y&&!D?null:u(e,{className:`w-full pt-4 px-[12px]`,children:[u(e,{className:`w-full flex items-start justify-between min-w-0`,children:[l(e,{className:`flex-1 pr-[12px] min-w-0`,children:l(i,{title:v})}),u(e,{className:`ml-4 shrink-0 flex flex-col items-center`,children:[l(e,{className:`text-[28px] leading-[36px] h-[36px] font-bold text-[#FF9F1A]`,children:T}),l(t,{className:`text-[12px] text-text2 leading-4`,children:g(`detailIntroduction.score`)})]})]}),y&&m&&u(e,{className:`mt-[12px]`,children:[l(`p`,{ref:w,className:`text-[14px] leading-[22px] text-text2 break-all ${b?``:`line-clamp-1`}`,children:y}),S&&l(`button`,{type:`button`,className:`mt-[8px] text-theme5 inline-flex items-center text-[12px] leading-[18px] text-text2`,onClick:O,children:g(b?`detailIntroduction.collapse`:`detailIntroduction.expand`)})]}),D&&l(r,{tags:E,className:`mt-[12px]`})]})}function p(e){let t=Number(e||`0`);return Number.isFinite(t)?(t>10?t/10:t).toFixed(1):`0`}export{f as DetailIntroduction};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{useUserStore as e}from"../../../../../store/modules/user-store.mjs";import{pCommunityMoveCollectionContent as t}from"../../../../../service/generated/client.mjs";import{Box as n}from"../../../../ui/box.mjs";import{Text as r}from"../../../../ui/text.mjs";import{useLoginModalStore as i}from"../../../../../store/modules/login-modal-store.mjs";import{useDeleteRequest as a}from"../../../../../hooks/query/use-query.mjs";import o from"../../../../common/interaction-animations.module.mjs";import s from"../../../../common/collection-popup/index.mjs";import c from"../../../../common/share-popup/share-popup.mjs";import{useInteractionAnimation as l}from"../../../../../hooks/use-interaction-animation.mjs";import{useContentOperate as ee}from"../../../../../hooks/use-content-operate.mjs";import te from"../../../../../assets/icons/detail/check-ok.mjs";import{useCallback as u,useEffect as d,useMemo as f,useRef as p,useState as m}from"react";import{jsx as h,jsxs as g}from"react/jsx-runtime";import{toast as _}from"sonner";import{usePathname as v,useSearchParams as y}from"next/navigation";import{useTranslations as b}from"next-intl";function x({className:e}){return h(`svg`,{viewBox:`0 0 24 21`,fill:`none`,className:e,children:h(`path`,{d:`M21.2121 6.89394C21.2121 4.25805 19.0753 2.12121 16.4394 2.12121C14.8261 2.12121 13.3991 2.92114 12.5336 4.15024C12.3349 4.4321 12.0115 4.59976 11.6667 4.59976C11.3218 4.59976 10.9984 4.4321 10.7997 4.15024C9.93421 2.92114 8.50725 2.12121 6.89394 2.12121C4.25804 2.12121 2.12121 4.25805 2.12121 6.89394C2.12121 9.40321 3.62133 11.9321 5.72562 14.0572C7.68391 16.0348 10.0088 17.5016 11.6667 18.137C13.3246 17.5016 15.6494 16.0348 17.6077 14.0572C19.712 11.9321 21.2121 9.40321 21.2121 6.89394ZM23.3333 6.89394C23.3333 10.2178 21.3863 13.2566 19.1158 15.5497C16.8347 17.8533 14.0447 19.5915 12.0012 20.2706C11.7841 20.3428 11.5493 20.3428 11.3321 20.2706C9.28858 19.5915 6.4986 17.8533 4.21757 15.5497C1.94701 13.2566 0 10.2178 0 6.89394C0 3.08654 3.08652 0 6.89394 0C8.74758 0 10.4287 0.733771 11.6667 1.92235C12.9047 0.733771 14.5858 0 16.4394 0C20.2468 0 23.3333 3.08654 23.3333 6.89394Z`,fill:`currentColor`})})}function S({className:e}){return h(`svg`,{viewBox:`0 0 24 21`,fill:`none`,className:e,children:h(`path`,{d:`M23.3333 6.89394C23.3333 10.2178 21.3863 13.2566 19.1158 15.5497C16.8347 17.8533 14.0447 19.5915 12.0012 20.2706C11.7841 20.3428 11.5493 20.3428 11.3321 20.2706C9.28858 19.5915 6.4986 17.8533 4.21757 15.5497C1.94701 13.2566 0 10.2178 0 6.89394C0 3.08654 3.08652 0 6.89394 0C8.74758 0 10.4287 0.733771 11.6667 1.92235C12.9047 0.733771 14.5858 0 16.4394 0C20.2468 0 23.3333 3.08654 23.3333 6.89394Z`,fill:`currentColor`})})}function C({className:e}){return h(`svg`,{viewBox:`0 0 24 23`,fill:`none`,className:e,children:h(`path`,{d:`M11.6636 2.65236e-06C12.0673 -0.000898131 12.437 0.227705 12.6165 0.589326L15.6522 6.70732L22.4258 7.69539C22.8246 7.75364 23.1564 8.03302 23.2813 8.41625C23.4062 8.79955 23.3021 9.22064 23.0141 9.50272L18.0882 14.3261L19.2585 21.0292C19.3281 21.4283 19.1639 21.8323 18.836 22.0701C18.5077 22.3079 18.072 22.3385 17.7143 22.1478L11.6657 18.9226L5.61917 22.1478C5.26131 22.3386 4.82579 22.3082 4.49748 22.0701C4.16923 21.832 4.00582 21.4276 4.07595 21.0282L5.25356 14.3271L0.319396 9.50376C0.0308898 9.2217 -0.0728394 8.79987 0.0521809 8.41625C0.177201 8.03266 0.509448 7.7533 0.90872 7.69539L7.71753 6.70732L10.7139 0.593469L10.7884 0.464005C10.9835 0.177012 11.3103 0.000910321 11.6636 2.65236e-06ZM9.37675 8.14386C9.22265 8.45841 8.92279 8.6767 8.57614 8.72697L3.33644 9.48615L7.1365 13.2013C7.38683 13.446 7.50059 13.799 7.43996 14.1438L6.54096 19.2509L11.1675 16.7859L11.2866 16.731C11.5714 16.6219 11.8921 16.6405 12.1649 16.7859L16.7946 19.253L15.9028 14.1427C15.8428 13.7988 15.9559 13.4467 16.2052 13.2023L20.0001 9.48511L14.7967 8.72697C14.4525 8.67672 14.155 8.46057 14.0002 8.14904L11.6719 3.45827L9.37675 8.14386Z`,fill:`currentColor`})})}function ne({className:e}){return h(`svg`,{viewBox:`0 0 24 23`,fill:`none`,className:e,children:h(`path`,{d:`M11.6636 2.65236e-06C12.0673 -0.000898131 12.437 0.227705 12.6165 0.589326L15.6522 6.70732L22.4258 7.69539C22.8246 7.75364 23.1564 8.03302 23.2813 8.41625C23.4062 8.79955 23.3021 9.22064 23.0141 9.50272L18.0882 14.3261L19.2585 21.0292C19.3281 21.4283 19.1639 21.8323 18.836 22.0701C18.5077 22.3079 18.072 22.3385 17.7143 22.1478L11.6657 18.9226L5.61917 22.1478C5.26131 22.3386 4.82579 22.3082 4.49748 22.0701C4.16923 21.832 4.00582 21.4276 4.07595 21.0282L5.25356 14.3271L0.319396 9.50376C0.0308898 9.2217 -0.0728394 8.79987 0.0521809 8.41625C0.177201 8.03266 0.509448 7.7533 0.90872 7.69539L7.71753 6.70732L10.7139 0.593469L10.7884 0.464005C10.9835 0.177012 11.3103 0.000910321 11.6636 2.65236e-06Z`,fill:`currentColor`})})}function w({className:e}){return h(`svg`,{viewBox:`0 0 24 24`,fill:`none`,className:e,children:h(`path`,{d:`M11.7968 0.0846035C12.212 -0.0873746 12.69 0.00771373 13.0078 0.325488L23.0077 10.3254C23.22 10.5377 23.3375 10.8271 23.3332 11.1273C23.3288 11.4272 23.2029 11.7123 22.9849 11.9183L12.985 21.3627C12.6625 21.6673 12.1901 21.7509 11.7827 21.5754C11.3753 21.3998 11.1111 20.9991 11.1111 20.5554V15.6216C8.22953 15.9648 6.08879 17.6095 4.58982 19.3391C3.74967 20.3085 3.13167 21.2821 2.7246 22.0148C2.52173 22.38 2.37311 22.6823 2.27646 22.8894C2.22828 22.9927 2.19344 23.0722 2.17121 23.1238C2.16011 23.1495 2.15201 23.169 2.14734 23.1802C2.1451 23.1856 2.14372 23.1893 2.143 23.191C1.94502 23.6852 1.42342 23.9699 0.900603 23.8692C0.377728 23.7684 0 23.3102 0 22.7776C0 17.9877 0.696606 13.8374 2.60632 10.8582C4.41013 8.04448 7.21019 6.40446 11.1111 6.14686V1.11107C11.1111 0.661725 11.3817 0.256615 11.7968 0.0846035ZM13.3333 7.22216C13.3333 7.8358 12.8358 8.33326 12.2222 8.33326C8.37436 8.33326 5.97849 9.71592 4.47697 12.0583C3.44269 13.6719 2.79177 15.8074 2.46852 18.4168C2.60946 18.2401 2.75584 18.061 2.91014 17.8829C4.8356 15.6613 7.89407 13.3332 12.2222 13.3332C12.8358 13.3332 13.3333 13.8307 13.3333 14.4443V17.9773L20.6282 11.0882L13.3333 3.79335V7.22216Z`,fill:`currentColor`})})}function T({mode:T=`renderer`,information:O,onUpdate:k}){let A=T===`editor`||!O?.id||O.id.startsWith(`preview-`),j=`${v()}?${y()?.toString()||``}`,M=p(j),N=b(`components.biz.business.detail`),P=l(),[F,I]=m(!1),[L,R]=m(!1),z=p(0),B=p(0),V=e(e=>e.userId),H=e(e=>e.isLogin),U=a();d(()=>{M.current!==j&&(c.clear(),M.current=j)},[j]),d(()=>()=>{c.clear()},[]);let W=u(()=>{V&&(U([`user-profile`,`mine`,V,`user-like-video`]),U([`user-profile`,`mine`,V,`user-like-post`]),U([`user-profile`,`mine`,V,`user-collect-video`,V]),U([`user-profile`,`mine`,V,`user-collect-post`,V]))},[U,V]),{likeAnimation:G,handleLikeOperate:K,handleDefaultCollectionOperate:q,handleShareOperate:J}=ee({id:O.id,isLike:O.like||!1,isDislike:O.dislike||!1,isCollect:O.collect||!1,likeCnt:D(O.static?.like_cnt),dislikeCnt:D(O.static?.dislike_cnt),contentType:1,prefetchDefaultCollection:!A,animationClasses:{like:o.likeShakeAnimation,dislike:o.dislikeShakeAnimation}}),Y=u(e=>{k?.({...e})},[k]),X=u(async()=>{if(F)return;if(!H){i.getState().open();return}let e=Date.now();if(e-z.current<300)return;z.current=e,I(!0);let t=O.like||!1,n=O.dislike||!1,r=D(O.static?.like_cnt),a=D(O.static?.dislike_cnt),o=!t,s=Math.max(0,r+(o?1:-1)),c=o?!1:n,l=o&&n?Math.max(0,a-1):a;Y({like:o,dislike:c,static:{...O.static,like_cnt:s,dislike_cnt:l}});try{let e=await K();if(!e){Y({like:t,dislike:n,static:{...O.static,like_cnt:r,dislike_cnt:a}});return}Y({like:e.isLike,dislike:e.isDislike??c,static:{...O.static,like_cnt:e.likeCnt,dislike_cnt:e.dislikeCnt??l}}),W(),window.sensors?.track?.(`detail_like_click`,{object_id:O.id,action:e.isLike?`点赞`:`取消点赞`,like_count:e.likeCnt})}catch(e){console.error(`点赞操作失败:`,e),_.error(N(`detailOperate.operateFailed`))}finally{I(!1)}},[K,O,W,F,H,N,Y]),Z=f(()=>O.id,[O.id]),re=u(()=>{J(({isCollect:e})=>{Y({collect:e})},Z)},[J,Z,Y]),Q=u(()=>{s.show({mode:`select`,onCollect:async e=>{try{let n=await t({new_collection_id:e,content_id:O.id});if(n.code!==0)throw Error(n.message||N(`detailOperate.collectFailed`));Y({collect:!0}),W(),_.success(N(`detailOperate.modifyCollectionSuccess`))}catch(e){console.error(`修改收藏夹失败:`,e),_.error(N(`detailOperate.collectFailed`))}}})},[O.id,W,N,Y]),$=u(e=>{let t=e||N(`detailOperate.defaultCollection`);_.custom(e=>g(`div`,{className:`flex items-center justify-between gap-[16px] px-[16px] py-[12px] rounded-[12px] bg-black text-white shadow-lg min-w-[280px]`,children:[g(`div`,{className:`flex items-center gap-[10px]`,children:[h(`div`,{className:`w-[24px] h-[24px] rounded-full bg-white flex items-center justify-center`,children:h(te,{className:`w-[14px] h-[14px]`})}),g(`div`,{className:`flex items-center gap-[6px]`,children:[h(`span`,{className:`text-[14px] leading-[20px]`,children:N(`detailOperate.collectAdded`)}),h(`span`,{className:`text-[14px] leading-[20px] font-semibold`,children:t})]})]}),h(`button`,{type:`button`,className:`text-[14px] text-theme5 font-semibold`,onClick:()=>{_.dismiss(e),Q()},children:N(`detailOperate.modifyCollection`)})]}))},[Q,N]),ie=u(async()=>{if(L)return;if(!H){i.getState().open();return}let e=Date.now();if(e-B.current<300)return;B.current=e;let t=O.collect||!1,n=!t;R(!0),Y({collect:n}),n&&P.trigger(o.likeShakeAnimation),window.sensors?.track?.(`detail_fav_click`,{object_id:O.id,action:t?`取消收藏`:`收藏`});try{let e=await q({currentCollect:t,onUpdate:({isCollect:e})=>{Y({collect:e})}});if(!e?.success){Y({collect:t}),_.error(e?.message||N(`detailOperate.collectFailed`));return}Y({collect:e.isCollect??n}),W(),window.sensors?.track?.(`detail_fav_click`,{object_id:O.id,action:e.isCollect?`收藏`:`取消收藏`}),!t&&e.isCollect&&$(e.collectionTitle),t&&e.isCollect===!1&&_.success(N(`detailOperate.uncollectSuccess`))}catch(e){Y({collect:t}),console.error(`收藏操作失败:`,e),_.error(e?.message||N(`detailOperate.collectFailed`))}finally{R(!1)}},[P,q,O.id,O.collect,W,L,H,$,N,Y]);return g(n,{className:`mt-[16px] flex h-[52px] w-full items-center justify-between px-[48px] ${A?`pointer-events-none`:``}`,children:[g(n,{className:`flex h-full w-[43px] flex-col items-center justify-center gap-[2px] ${F?`opacity-50 cursor-not-allowed`:`cursor-pointer`}`,onClick:X,children:[O.like?h(S,{className:`size-[28px] text-[#FF5D8F] ${G.animationClass}`}):h(x,{className:`size-[28px] text-white`}),h(r,{className:`text-center text-[14px] leading-[22px] ${O.like?`text-[#FF5D8F]`:`text-white`}`,children:O.static?O.static.like_cnt===0?N(`detailOperate.like`):E(O.static?.like_cnt):N(`detailOperate.like`)})]}),g(n,{className:`flex h-full w-[43px] flex-col items-center justify-center gap-[2px] ${L?`opacity-50 cursor-not-allowed`:`cursor-pointer`}`,onClick:ie,children:[O.collect?h(ne,{className:`size-[28px] text-[#FFC039] ${P.animationClass}`}):h(C,{className:`size-[28px] text-white`}),h(r,{className:`text-center text-[14px] leading-[22px] text-white`,children:N(`detailOperate.collection`)})]}),g(n,{className:`flex h-full w-[43px] flex-col items-center justify-center gap-[2px] cursor-pointer`,onClick:re,children:[h(w,{className:`size-[28px] text-white`}),h(r,{className:`text-center text-[14px] leading-[22px] text-white`,children:N(`detailOperate.share`)})]})]})}function E(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(e){if(e==null)return 0;if(typeof e==`number`)return e;let t=Number(e);return Number.isNaN(t)?0:t}export{T as DetailOperate};
2
+ "use client";import{useUserStore as e}from"../../../../../store/modules/user-store.mjs";import{pCommunityMoveCollectionContent as t}from"../../../../../service/generated/client.mjs";import{Box as n}from"../../../../ui/box.mjs";import{Text as r}from"../../../../ui/text.mjs";import{useLoginModalStore as i}from"../../../../../store/modules/login-modal-store.mjs";import{useDeleteRequest as a}from"../../../../../hooks/query/use-query.mjs";import o from"../../../../common/interaction-animations.module.mjs";import s from"../../../../common/collection-popup/index.mjs";import c from"../../../../common/share-popup/share-popup.mjs";import{useInteractionAnimation as l}from"../../../../../hooks/use-interaction-animation.mjs";import{useContentOperate as u}from"../../../../../hooks/use-content-operate.mjs";import d from"../../../../../assets/icons/detail/check-ok.mjs";import f from"../../../../../assets/icons/detail/collect_nor.mjs";import p from"../../../../../assets/icons/detail/collect_sel.mjs";import ee from"../../../../../assets/icons/detail/give_like.mjs";import m from"../../../../../assets/icons/detail/give_like_sel.mjs";import te from"../../../../../assets/icons/detail/share.mjs";import{useCallback as h,useEffect as g,useMemo as _,useRef as v,useState as y}from"react";import{jsx as b,jsxs as x}from"react/jsx-runtime";import{toast as S}from"sonner";import{usePathname as C,useSearchParams as ne}from"next/navigation";import{useTranslations as w}from"next-intl";function T({mode:T=`renderer`,information:O,onUpdate:k}){let A=T===`editor`||!O?.id||O.id.startsWith(`preview-`),j=`${C()}?${ne()?.toString()||``}`,M=v(j),N=w(`components.biz.business.detail`),P=l(),[F,I]=y(!1),[L,R]=y(!1),z=v(0),B=v(0),V=e(e=>e.userId),H=e(e=>e.isLogin),U=a();g(()=>{M.current!==j&&(c.clear(),M.current=j)},[j]),g(()=>()=>{c.clear()},[]);let W=h(()=>{V&&(U([`user-profile`,`mine`,V,`user-like-video`]),U([`user-profile`,`mine`,V,`user-like-post`]),U([`user-profile`,`mine`,V,`user-collect-video`,V]),U([`user-profile`,`mine`,V,`user-collect-post`,V]))},[U,V]),{likeAnimation:G,handleLikeOperate:K,handleDefaultCollectionOperate:q,handleShareOperate:J}=u({id:O.id,isLike:O.like||!1,isDislike:O.dislike||!1,isCollect:O.collect||!1,likeCnt:D(O.static?.like_cnt),dislikeCnt:D(O.static?.dislike_cnt),contentType:1,prefetchDefaultCollection:!A,animationClasses:{like:o.likeShakeAnimation,dislike:o.dislikeShakeAnimation}}),Y=h(e=>{k?.({...e})},[k]),X=h(async()=>{if(F)return;if(!H){i.getState().open();return}let e=Date.now();if(e-z.current<300)return;z.current=e,I(!0);let t=O.like||!1,n=O.dislike||!1,r=D(O.static?.like_cnt),a=D(O.static?.dislike_cnt),o=!t,s=Math.max(0,r+(o?1:-1)),c=o?!1:n,l=o&&n?Math.max(0,a-1):a;Y({like:o,dislike:c,static:{...O.static,like_cnt:s,dislike_cnt:l}});try{let e=await K();if(!e){Y({like:t,dislike:n,static:{...O.static,like_cnt:r,dislike_cnt:a}});return}Y({like:e.isLike,dislike:e.isDislike??c,static:{...O.static,like_cnt:e.likeCnt,dislike_cnt:e.dislikeCnt??l}}),W(),window.sensors?.track?.(`detail_like_click`,{object_id:O.id,action:e.isLike?`点赞`:`取消点赞`,like_count:e.likeCnt})}catch(e){console.error(`点赞操作失败:`,e),S.error(N(`detailOperate.operateFailed`))}finally{I(!1)}},[K,O,W,F,H,N,Y]),Z=_(()=>O.id,[O.id]),re=h(()=>{J(({isCollect:e})=>{Y({collect:e})},Z)},[J,Z,Y]),Q=h(()=>{s.show({mode:`select`,onCollect:async e=>{try{let n=await t({new_collection_id:e,content_id:O.id});if(n.code!==0)throw Error(n.message||N(`detailOperate.collectFailed`));Y({collect:!0}),W(),S.success(N(`detailOperate.modifyCollectionSuccess`))}catch(e){console.error(`修改收藏夹失败:`,e),S.error(N(`detailOperate.collectFailed`))}}})},[O.id,W,N,Y]),$=h(e=>{let t=e||N(`detailOperate.defaultCollection`);S.custom(e=>x(`div`,{className:`flex items-center justify-between gap-[16px] px-[16px] py-[12px] rounded-[12px] bg-black text-white shadow-lg min-w-[280px]`,children:[x(`div`,{className:`flex items-center gap-[10px]`,children:[b(`div`,{className:`w-[24px] h-[24px] rounded-full bg-white flex items-center justify-center`,children:b(d,{className:`w-[14px] h-[14px]`})}),x(`div`,{className:`flex items-center gap-[6px]`,children:[b(`span`,{className:`text-[14px] leading-[20px]`,children:N(`detailOperate.collectAdded`)}),b(`span`,{className:`text-[14px] leading-[20px] font-semibold`,children:t})]})]}),b(`button`,{type:`button`,className:`text-[14px] text-theme5 font-semibold`,onClick:()=>{S.dismiss(e),Q()},children:N(`detailOperate.modifyCollection`)})]}))},[Q,N]),ie=h(async()=>{if(L)return;if(!H){i.getState().open();return}let e=Date.now();if(e-B.current<300)return;B.current=e;let t=O.collect||!1,n=!t;R(!0),Y({collect:n}),n&&P.trigger(o.likeShakeAnimation),window.sensors?.track?.(`detail_fav_click`,{object_id:O.id,action:t?`取消收藏`:`收藏`});try{let e=await q({currentCollect:t,onUpdate:({isCollect:e})=>{Y({collect:e})}});if(!e?.success){Y({collect:t}),S.error(e?.message||N(`detailOperate.collectFailed`));return}Y({collect:e.isCollect??n}),W(),window.sensors?.track?.(`detail_fav_click`,{object_id:O.id,action:e.isCollect?`收藏`:`取消收藏`}),!t&&e.isCollect&&$(e.collectionTitle),t&&e.isCollect===!1&&S.success(N(`detailOperate.uncollectSuccess`))}catch(e){Y({collect:t}),console.error(`收藏操作失败:`,e),S.error(e?.message||N(`detailOperate.collectFailed`))}finally{R(!1)}},[P,q,O.id,O.collect,W,L,H,$,N,Y]);return x(n,{className:`w-full h-[42px] mt-[16px] flex items-center justify-between ${A?`pointer-events-none`:``}`,children:[x(n,{className:`w-[25%] h-full flex flex-col items-center justify-center ${F?`opacity-50 cursor-not-allowed`:`cursor-pointer`}`,onClick:X,children:[O.like?b(m,{className:`w-[20px] h-[20px] ${G.animationClass}`}):b(ee,{className:`w-[20px] h-[20px] text-text2`}),b(r,{className:`text-[12px] text-text2 leading-[20px]`,children:O.static?O.static.like_cnt===0?N(`detailOperate.like`):E(O.static?.like_cnt):N(`detailOperate.like`)})]}),x(n,{className:`w-[25%] h-full flex flex-col items-center justify-center ${L?`opacity-50 cursor-not-allowed`:`cursor-pointer`}`,onClick:ie,children:[O.collect?b(p,{className:`w-[20px] h-[20px] ${P.animationClass}`}):b(f,{className:`w-[20px] h-[20px] text-text2`}),b(r,{className:`text-[12px] text-text2 leading-[20px]`,children:N(`detailOperate.collection`)})]}),x(n,{className:`w-[25%] h-full flex flex-col items-center justify-center cursor-pointer`,onClick:re,children:[b(te,{className:`w-[20px] h-[20px] text-text2`}),b(r,{className:`text-[12px] text-text2 leading-[20px]`,children:N(`detailOperate.share`)})]})]})}function E(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(e){if(e==null)return 0;if(typeof e==`number`)return e;let t=Number(e);return Number.isNaN(t)?0:t}export{T as DetailOperate};
@@ -1,2 +1,2 @@
1
1
 
2
- const e=`/static/components-thumb/items_cover.png`,t=[{id:`tag-1`,name:`标签`,group:`类型`},{id:`tag-2`,name:`标签`,group:`类型`},{id:`tag-3`,name:`标签`,group:`类型`}],n=Array.from({length:6}).map((e,t)=>({id:`episode-${t+1}`,name:`第${t+1}集`,preview_m3u8_url:``,m3u8_url:``})),r={id:`preview-detail`,mid:`preview-detail`,name:`电影名称电影名称电影名称电影名称电影名称`,img_x:e,img_y:e,preview_images:[e],description:`简介文案,简介文案简介文案简介文案简介文案简介文案简介文案简介文案简介文案简介文案简介文案简介文案简介文案简介文案。`,score:`9.6`,is_more_link:`y`,update_status:`1`,tags:t,links:n,content_type:0,play_count:123,episode_cnt:n.length,like:!1,dislike:!1,collect:!1,static:{like_cnt:0,dislike_cnt:0}};function i(e=6){let t=Math.max(1,Math.floor(e));return Array.from({length:t}).map((e,t)=>({...r,id:`preview-recommend-${t+1}`,name:`猜你喜欢 ${t+1}`,play_count:8e3+t*873,img_type:t%3==1?`long`:`short`}))}export{i as buildEditorPreviewRecommendList,r as editorPreviewInformation};
2
+ const e=`/static/components-thumb/video_player.png`,t=[{id:`tag-1`,name:`标签`,group:`类型`},{id:`tag-2`,name:`标签`,group:`类型`},{id:`tag-3`,name:`标签`,group:`类型`}],n=Array.from({length:6}).map((e,t)=>({id:`episode-${t+1}`,name:`第${t+1}集`,preview_m3u8_url:``,m3u8_url:``})),r={id:`preview-detail`,mid:`preview-detail`,name:`电影名称电影名称电影名称电影名称电影名称`,img_x:e,img_y:e,preview_images:[e],description:`简介文案,简介文案简介文案简介文案简介文案简介文案简介文案简介文案简介文案简介文案简介文案简介文案简介文案简介文案。`,score:`9.6`,is_more_link:`y`,update_status:`1`,tags:t,links:n,content_type:0,play_count:123,episode_cnt:n.length,like:!1,dislike:!1,collect:!1,static:{like_cnt:0,dislike_cnt:0}};function i(e=6){let t=Math.max(1,Math.floor(e));return Array.from({length:t}).map((e,t)=>({...r,id:`preview-recommend-${t+1}`,name:`猜你喜欢 ${t+1}`,play_count:8e3+t*873}))}export{i as buildEditorPreviewRecommendList,r as editorPreviewInformation};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{useRequest as e}from"../../../../../hooks/query/use-query.mjs";import{batchQueryContentInteractions as t}from"../../../../../hooks/use-content-operate.mjs";import{DetailOperate as n}from"../shared/detail-operate.mjs";import{editorPreviewInformation as r}from"../shared/editor-preview.mjs";import{useVideoDetailMaterialRuntimeContext as i}from"../shared/runtime-context-provider.mjs";import{useCallback as a,useEffect as o,useRef as s,useState as c}from"react";import{jsx as l}from"react/jsx-runtime";function u({mode:u=`renderer`}){let d=i(),f=d?.information,p=d?.onUpdateInformation,m=u===`editor`,h=u===`renderer`,g=m,_=g?r:f,[v,y]=c(_),b=s(_),x=s(``),S=s(!1);o(()=>{y(_)},[_]);let C=p?_:v;o(()=>{b.current=C},[C]);let w=h&&!!_?.id,{data:T}=e([`video-detail-actions-interaction`,_?.id],async()=>_?.id?await t([_.id],1):null,{enabled:w,staleTime:0,refetchOnMount:`always`,refetchOnWindowFocus:!1}),E=a(e=>{if(!g){if(S.current=!0,p){p(e);return}y(t=>{if(!t)return t;let n=e.static?{...t.static||{},...e.static||{}}:t.static;return{...t,...e,static:n}})}},[p,g]);return o(()=>{if(S.current)return;let e=T?.interaction_list?.[0],t=b.current;if(!e||!t)return;let n=`${e.is_liked?1:0}-${e.is_disliked?1:0}-${e.is_collected?1:0}`;if(x.current===n)return;x.current=n;let r=e.is_liked||!1,i=e.is_disliked||!1,a=e.is_collected||!1,o=!!t.like,s=!!t.dislike,c=!!t.collect,l=t.static?.like_cnt,u=typeof l==`number`?l:Number(l||0),d=u;!r&&u>0?d=Math.max(0,u-1):o===r?r&&u===0&&(d=1):d=Math.max(0,u+(r?1:-1));let f=d!==u;o===r&&s===i&&c===a&&!f||E({like:r,dislike:i,collect:a,...f?{static:{...t.static||{},like_cnt:d}}:{}})},[E,T]),C?l(`div`,{className:g?`pointer-events-none`:void 0,children:l(n,{mode:u,information:C,onUpdate:E})}):null}export{u as VideoDetailActionsClient};
2
+ "use client";import{useRequest as e}from"../../../../../hooks/query/use-query.mjs";import{batchQueryContentInteractions as t}from"../../../../../hooks/use-content-operate.mjs";import{DetailOperate as n}from"../shared/detail-operate.mjs";import{editorPreviewInformation as r}from"../shared/editor-preview.mjs";import{useVideoDetailMaterialRuntimeContext as i}from"../shared/runtime-context-provider.mjs";import{useCallback as a,useEffect as o,useRef as s,useState as c}from"react";import{jsx as l}from"react/jsx-runtime";function u({mode:u=`renderer`}){let d=i(),f=d?.information,p=d?.onUpdateInformation,m=u===`editor`,h=u===`renderer`,g=m,_=g?r:f,[v,y]=c(_),b=s(_),x=s(``);o(()=>{y(_)},[_]);let S=p?_:v;o(()=>{b.current=S},[S]);let C=h&&!!_?.id,{data:w}=e([`video-detail-actions-interaction`,_?.id],async()=>_?.id?await t([_.id],1):null,{enabled:C,staleTime:0,refetchOnMount:`always`,refetchOnWindowFocus:!1}),T=a(e=>{if(!g){if(p){p(e);return}y(t=>{if(!t)return t;let n=e.static?{...t.static||{},...e.static||{}}:t.static;return{...t,...e,static:n}})}},[p,g]);return o(()=>{let e=w?.interaction_list?.[0],t=b.current;if(!e||!t)return;let n=`${e.is_liked?1:0}-${e.is_disliked?1:0}-${e.is_collected?1:0}`;if(x.current===n)return;x.current=n;let r=e.is_liked||!1,i=e.is_disliked||!1,a=e.is_collected||!1,o=!!t.like,s=!!t.dislike,c=!!t.collect,l=t.static?.like_cnt,u=typeof l==`number`?l:Number(l||0),d=u;!r&&u>0?d=Math.max(0,u-1):o===r?r&&u===0&&(d=1):d=Math.max(0,u+(r?1:-1));let f=d!==u;o===r&&s===i&&c===a&&!f||T({like:r,dislike:i,collect:a,...f?{static:{...t.static||{},like_cnt:d}}:{}})},[T,w]),S?l(`div`,{className:g?`pointer-events-none`:void 0,children:l(n,{mode:u,information:S,onUpdate:T})}):null}export{u as VideoDetailActionsClient};