@funhub/platform 0.1.52 → 0.1.53

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 (147) hide show
  1. package/README.md +0 -13
  2. package/dist/biz.d.mts +8 -10
  3. package/dist/biz.mjs +1 -1
  4. package/dist/components/biz/business/banner/variants/basic-banner/material.d.mts +1 -1
  5. package/dist/components/biz/business/banner-carousel/material.d.mts +1 -1
  6. package/dist/components/biz/business/channel-list/material.d.mts +1 -1
  7. package/dist/components/biz/business/detail/materials/registry.d.mts +7 -6
  8. package/dist/components/biz/business/detail/materials/runtime-context-provider.mjs +2 -0
  9. package/dist/components/biz/business/detail/materials/video-detail-actions/client.d.mts +0 -2
  10. package/dist/components/biz/business/detail/materials/video-detail-actions/client.mjs +1 -1
  11. package/dist/components/biz/business/detail/materials/video-detail-actions/material.d.mts +1 -1
  12. package/dist/components/biz/business/detail/materials/video-detail-actions/schema.d.mts +1 -5
  13. package/dist/components/biz/business/detail/materials/video-detail-info/client.d.mts +0 -4
  14. package/dist/components/biz/business/detail/materials/video-detail-info/client.mjs +1 -1
  15. package/dist/components/biz/business/detail/materials/video-detail-info/material.d.mts +1 -1
  16. package/dist/components/biz/business/detail/materials/video-detail-info/schema.d.mts +1 -7
  17. package/dist/components/biz/business/detail/materials/video-detail-info-title/client.d.mts +0 -1
  18. package/dist/components/biz/business/detail/materials/video-detail-info-title/client.mjs +1 -1
  19. package/dist/components/biz/business/detail/materials/video-detail-info-title/material.d.mts +1 -1
  20. package/dist/components/biz/business/detail/materials/video-detail-info-title/schema.d.mts +1 -4
  21. package/dist/components/biz/business/detail/materials/video-detail-info-title-tags-episodes/client.d.mts +0 -3
  22. package/dist/components/biz/business/detail/materials/video-detail-info-title-tags-episodes/client.mjs +1 -1
  23. package/dist/components/biz/business/detail/materials/video-detail-info-title-tags-episodes/material.d.mts +1 -1
  24. package/dist/components/biz/business/detail/materials/video-detail-info-title-tags-episodes/schema.d.mts +1 -6
  25. package/dist/components/biz/business/detail/materials/video-detail-player/client.d.mts +0 -3
  26. package/dist/components/biz/business/detail/materials/video-detail-player/client.mjs +1 -1
  27. package/dist/components/biz/business/detail/materials/video-detail-player/material.d.mts +1 -1
  28. package/dist/components/biz/business/detail/materials/video-detail-player/schema.d.mts +1 -6
  29. package/dist/components/biz/business/detail/materials/video-detail-recommend/client.d.mts +1 -2
  30. package/dist/components/biz/business/detail/materials/video-detail-recommend/client.mjs +1 -1
  31. package/dist/components/biz/business/detail/materials/video-detail-recommend/material.d.mts +2 -1
  32. package/dist/components/biz/business/detail/materials/video-detail-recommend/schema.d.mts +2 -3
  33. package/dist/components/biz/business/detail/materials/video-detail-recommend/schema.mjs +1 -1
  34. package/dist/components/biz/business/detail/materials/video-detail-recommend/utils.mjs +1 -1
  35. package/dist/components/biz/business/floating-ball/material.d.mts +1 -1
  36. package/dist/components/biz/business/header-search/header-avatar-icon/material.d.mts +1 -1
  37. package/dist/components/biz/business/header-search/header-avatar-logo-search/material.d.mts +1 -1
  38. package/dist/components/biz/business/header-search/header-avatar-logo-search-icon/material.d.mts +1 -1
  39. package/dist/components/biz/business/header-search/header-logo-search/material.d.mts +1 -1
  40. package/dist/components/biz/business/header-search/header-search/material.d.mts +1 -1
  41. package/dist/components/biz/business/home-recommend/index.d.mts +4 -6
  42. package/dist/components/biz/business/home-recommend/shared/home-recommend-base.mjs +1 -1
  43. package/dist/components/biz/business/home-recommend/shared/home-recommend-default-config.mjs +2 -0
  44. package/dist/components/biz/business/home-recommend/shared/home-recommend-feed-mode.mjs +2 -0
  45. package/dist/components/biz/business/home-recommend/shared/home-recommend-preview.mjs +1 -1
  46. package/dist/components/biz/business/home-recommend/shared/home-recommend-server-data.mjs +2 -0
  47. package/dist/components/biz/business/home-recommend/shared/home-recommend-video-detail.mjs +2 -0
  48. package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/index.d.mts +2 -3
  49. package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/index.mjs +1 -1
  50. package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/inspector-schema.d.mts +35 -1
  51. package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/inspector-schema.mjs +1 -1
  52. package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/material.d.mts +29 -3
  53. package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/material.mjs +1 -1
  54. package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/runtime/prefetch-client.d.mts +27 -0
  55. package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/runtime/prefetch-client.mjs +2 -0
  56. package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/schema/index.mjs +1 -1
  57. package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/server.d.mts +3 -6
  58. package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/server.mjs +1 -1
  59. package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/index.d.mts +2 -3
  60. package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/index.mjs +1 -1
  61. package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/inspector-schema.d.mts +30 -2
  62. package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/inspector-schema.mjs +1 -1
  63. package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/material.d.mts +26 -4
  64. package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/material.mjs +1 -1
  65. package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/runtime/prefetch-client.d.mts +27 -0
  66. package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/runtime/prefetch-client.mjs +2 -0
  67. package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/schema/index.mjs +1 -1
  68. package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/server.d.mts +3 -6
  69. package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/server.mjs +1 -1
  70. package/dist/components/biz/business/index.d.mts +11 -13
  71. package/dist/components/biz/business/large-feature-grid/card-item.mjs +1 -1
  72. package/dist/components/biz/business/large-feature-grid/material.d.mts +2 -2
  73. package/dist/components/biz/business/marquee/material.d.mts +1 -1
  74. package/dist/components/biz/business/profile/profile-header/material.d.mts +2 -2
  75. package/dist/components/biz/business/profile/profile-header/user-profile-avatar.mjs +1 -1
  76. package/dist/components/biz/business/profile/profile-header/user-profile-cover-background.mjs +1 -1
  77. package/dist/components/biz/business/profile/profile-main/material.d.mts +1 -1
  78. package/dist/components/biz/business/search-history/material.d.mts +1 -1
  79. package/dist/components/biz/business/search-input/material.d.mts +1 -1
  80. package/dist/components/biz/business/shortcut-grid/material.d.mts +1 -1
  81. package/dist/components/biz/business/tab-bar/material.d.mts +2 -2
  82. package/dist/components/biz/business/tab-bar/schema.d.mts +1 -1
  83. package/dist/components/biz/business/text-recommend/material.d.mts +1 -1
  84. package/dist/components/biz/business/video-horizontal-list/material.d.mts +1 -1
  85. package/dist/components/biz/example/button/material.d.mts +1 -1
  86. package/dist/components/biz/example/button/material.mjs +1 -1
  87. package/dist/components/biz/utils/transformers/data.mjs +1 -1
  88. package/dist/components/common/cards/mini-three-card.mjs +1 -1
  89. package/dist/components/pages/(follow)/_components/follow-button/index.mjs +1 -1
  90. package/dist/components/pages/login/password.mjs +1 -1
  91. package/dist/components/pages/login/register.mjs +1 -1
  92. package/dist/components/pages/login/reset-password.mjs +1 -1
  93. package/dist/components/pages/login/verify.mjs +1 -1
  94. package/dist/components/pages/search-result/page-client.mjs +1 -1
  95. package/dist/components/pages/search-result/search-all.mjs +1 -1
  96. package/dist/components/pages/search-result/search-tab.mjs +1 -1
  97. package/dist/components/pages/search-result/search-user.mjs +1 -1
  98. package/dist/components/pages/search-result/search-video.mjs +1 -1
  99. package/dist/components/pages/settings/_components/reset-password-drawer.mjs +1 -1
  100. package/dist/components/pages/settings/_components/settings.mjs +1 -1
  101. package/dist/components/pages/video-detail/video-detail-client.mjs +1 -1
  102. package/dist/components/ui/badge.d.mts +1 -1
  103. package/dist/components/ui/button.d.mts +1 -1
  104. package/dist/components/ui/image.d.mts +4 -4
  105. package/dist/i18n/locales/en.mjs +1 -1
  106. package/dist/i18n/locales/zh-CN.mjs +1 -1
  107. package/dist/service/content-batch-get-video-detail.d.mts +21 -0
  108. package/dist/service/content-batch-get-video-detail.mjs +2 -0
  109. package/dist/service.d.mts +2 -1
  110. package/dist/service.mjs +1 -1
  111. package/dist/utils/schema/index.d.mts +1 -1
  112. package/dist/utils/schema/material.d.mts +9 -7
  113. package/dist/utils/schema/utils.d.mts +3 -13
  114. package/dist/utils/schema/utils.mjs +1 -1
  115. package/dist/utils.d.mts +2 -3
  116. package/dist/utils.mjs +1 -1
  117. package/package.json +2 -7
  118. package/bin/index.mjs +0 -323
  119. package/dist/assets/images/user/default_avatar.mjs +0 -2
  120. package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/defaults/default-props.d.mts +0 -10
  121. package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/defaults/default-props.mjs +0 -2
  122. package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/runtime/client.d.mts +0 -20
  123. package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/runtime/client.mjs +0 -2
  124. package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/schema/props.schema.mjs +0 -2
  125. package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/defaults/default-props.d.mts +0 -8
  126. package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/defaults/default-props.mjs +0 -2
  127. package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/runtime/client.d.mts +0 -20
  128. package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/runtime/client.mjs +0 -2
  129. package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/schema/props.schema.mjs +0 -2
  130. package/dist/utils/password-validator.d.mts +0 -28
  131. package/dist/utils/password-validator.mjs +0 -2
  132. package/templates/base/_meta.json +0 -4
  133. package/templates/base/template/README.md.template +0 -32
  134. package/templates/base/template/__dot__gitignore +0 -6
  135. package/templates/base/template/app/[locale]/layout.tsx.template +0 -36
  136. package/templates/base/template/app/[locale]/page.tsx.template +0 -24
  137. package/templates/base/template/app/globals.css +0 -26
  138. package/templates/base/template/app/layout.tsx.template +0 -38
  139. package/templates/base/template/eslint.config.mjs.template +0 -68
  140. package/templates/base/template/i18n/request.ts.template +0 -3
  141. package/templates/base/template/next-env.d.ts.template +0 -4
  142. package/templates/base/template/next.config.ts.template +0 -21
  143. package/templates/base/template/package.json.template +0 -37
  144. package/templates/base/template/postcss.config.js.template +0 -18
  145. package/templates/base/template/proxy.ts.template +0 -18
  146. package/templates/base/template/tailwind.config.cjs.template +0 -13
  147. package/templates/base/template/tsconfig.json.template +0 -43
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{gContentGetGuessYouLikeVideos as e}from"../../../../../../service/generated/client.mjs";import{Box as t}from"../../../../../ui/box.mjs";import{Text as n}from"../../../../../ui/text.mjs";import{useRequest as r}from"../../../../../../hooks/query/use-query.mjs";import i from"../../../../../../assets/icons/detail/video_flag.mjs";import{MiniThreeCard as a}from"../../../../../common/cards/mini-three-card.mjs";import{useCardDecoration as o}from"../../../../../../hooks/use-card-decoration.mjs";import{buildEditorPreviewRecommendList as s}from"../editor-preview.mjs";import{applyPlayCountDelta as c,buildEpisodeLabel as l,clampColumns as u,mergeManualAndPool as d,mockPagedList as f,resolveRows as p}from"./utils.mjs";import{useEffect as m,useMemo as h,useRef as ee,useState as g}from"react";import{jsx as _,jsxs as v}from"react/jsx-runtime";import{useTranslations as te}from"next-intl";function y({detailId:y,rows:b,columns:x,smartTagEnabled:S,smartTagIds:C,title:w,showPlayCount:T,playCountDelta:E,showEpisode:D,enableInfinite:O,items:k,mode:A=`renderer`}){let j=A===`editor`,M=j||!y,ae=te(`components.biz.business.detail`),{getVerticalHoCoverImageUrl:N,getTitleText:P}=o(),[F,I]=g(1),L=ee(null),R=h(()=>C??[],[C]),z=h(()=>k??[],[k]),B=!!O&&!j,V=p(b,B),H=u(x),U=V*H,W=h(()=>s(U),[U]),{data:G}=r([`video-detail-recommend`,y],async()=>!y||M?null:await e(),{enabled:!M&&!!y}),K=h(()=>{if(M)return W;let e=G?.data?.videos;return Array.isArray(e)?e.map(e=>ne(e)).filter(e=>!y||!e.id||e.id!==y):[]},[G?.data?.videos,y,W,M]),q=h(()=>new Set(z.map(e=>e.contentId)),[z]),J=h(()=>{if(M)return K;let e=K.filter(e=>!q.has(e.id));if(!S||R.length===0)return e;let t=new Set(R.map(String));return e.filter(e=>(Array.isArray(e.source_tags)?e.source_tags:String(e.source_tags||``).split(`,`).filter(Boolean)).some(e=>t.has(String(e?.id??e))))},[M,q,K,S,R]),Y=h(()=>{if(!z.length)return[];let e=new Map(J.map(e=>[e.id,e]));return z.map((t,n)=>{let r=W[n%Math.max(1,W.length)],i=e.get(t.contentId)??(M?{...r,id:t.contentId||r.id||`preview-manual-${n+1}`,name:r.name||`猜你喜欢 ${n+1}`}:null);if(!i)return null;let a=t.titleMode===`custom`?t.title:P(i),o=t.coverMode===`upload`?t.coverUrl:N(i);return{info:{...i,name:a||i.name,img_y:o||i.img_y,img_x:o||i.img_x},config:{showPlayCount:t.showPlayCount,playCountDelta:t.playCountDelta,showEpisode:t.showEpisode}}}).filter(Boolean)},[W,J,P,N,M,z]),X=h(()=>J.map(e=>({info:e})),[J]),Z=h(()=>d(Y,X,U),[Y,U,X]),Q=h(()=>{if(!B)return Z;let e=f(X,F,U,5);return F===1?Z:Z.concat(e)},[Z,F,U,X,B]),$=B&&F<5&&X.length>0;return m(()=>{B&&I(1)},[y,B]),m(()=>{if(!B)return;let e=L.current;if(!e||!$)return;let t=new IntersectionObserver(e=>{e[0]?.isIntersecting&&I(e=>Math.min(e+1,5))});return t.observe(e),()=>{t.disconnect()}},[$,B]),Q.length?v(t,{className:`w-full mt-[16px] ${M?`pointer-events-none`:``}`,children:[_(n,{className:`block pl-[12px] mb-[8px] text-text1 text-[18px] leading-[26px] font-bold`,children:w||ae(`detailGuessLike.title`)}),_(t,{className:`w-full flex flex-wrap px-[12px]`,children:Q.map((e,t)=>{let n=e.config?.showPlayCount??T,r=e.config?.playCountDelta??E,o=e.config?.showEpisode??D,s=re(c(e.info.play_count||0,r)),u=l(Number(e.info.update_status)===1?`done`:`updating`,e.info.episode_cnt||e.info.links?.length,e.info.episode_cnt||e.info.links?.length),d=Number.isFinite(H)&&H>0?`${100/H}%`:`33.333333%`;return _(a,{url:N(e.info),text:P(e.info),style:{width:d},bottomLeftChild:n?v(`div`,{className:`h-[20px] leading-[20px] text-[#fff] text-[12px] px-[4px] rounded-[4px] bg-[#333] ml-[4px] flex items-center`,children:[_(i,{className:`w-[16px] h-[auto] text-[#fff] mr-[4px]`}),s]}):null,bottomRightChild:o&&u?_(`div`,{className:`text-[#F59E0B] text-[12px] font-bold leading-[20px] pr-[8px]`,children:u}):null,linkPath:M?``:ie(e.info)},`guess-like-${t}`)})}),B&&_(`div`,{ref:L,className:`h-[1px] w-full`})]}):null}function ne(e){return{id:e.video_id||``,mid:``,name:e.name||``,cat_id:``,cat_name:``,status:`1`,status_text:``,create_time:``,content_type:0,episode_cnt:e.episode_count||0,show_at:e.show_at??``,position:``,img_type:e.img_type??``,img_x:e.img_x??``,img_y:e.img_y??``,img_width:``,img_height:``,play_count:e.play_count,preview_images:[],duration:String(e.duration??``),score:String(e.score??``),is_more_link:e.is_more_link?`y`:`n`,update_status:String(e.update_status??``),description:e.description??``,language:``,director:``,actor:``,area:``,issue_date:``,publisher:``,series:``,number:``,tags:[],source_tags:e.source_tags??``,source_actor:[],links:Array.isArray(e.episodes)?e.episodes.map(e=>({id:e.id??``,name:e.name??``,preview_m3u8_url:e.preview_m3u8_url??``,m3u8_url:e.m3u8_url??``})):[],money:``,up_user:``,source_username:``,task_id:``,file_status:``}}function re(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 ie(e){if(e.content_type===0){let t=encodeURIComponent(e.name||``);return`/video/${e.id}/${t}/episode/1`}return`/post/${e.id}`}export{y as VideoDetailRecommendClient};
2
+ "use client";import{gContentGetGuessYouLikeVideos as e}from"../../../../../../service/generated/client.mjs";import{Box as t}from"../../../../../ui/box.mjs";import{Text as n}from"../../../../../ui/text.mjs";import{useRequest as r}from"../../../../../../hooks/query/use-query.mjs";import i from"../../../../../../assets/icons/detail/video_flag.mjs";import{MiniThreeCard as a}from"../../../../../common/cards/mini-three-card.mjs";import{useCardDecoration as o}from"../../../../../../hooks/use-card-decoration.mjs";import{buildEditorPreviewRecommendList as s}from"../editor-preview.mjs";import{useVideoDetailMaterialRuntimeContext as c}from"../runtime-context-provider.mjs";import{buildEpisodeLabel as l,clampColumns as u,mergeManualAndPool as d,mockPagedList as f,resolveRows as p}from"./utils.mjs";import{useEffect as m,useMemo as h,useRef as g,useState as _}from"react";import{jsx as v,jsxs as y}from"react/jsx-runtime";function b({rows:b,columns:ne,smartTagEnabled:S,smartTagIds:C,title:re,showPlayCount:w,playCountDelta:ie,showEpisode:T,enableInfinite:E,items:D,mode:O=`renderer`}){let k=c()?.detailId||``,A=O===`editor`,j=A||!k,{getVerticalHoCoverImageUrl:M,getTitleText:N}=o(),[P,F]=_(1),I=g(null),L=h(()=>C??[],[C]),R=h(()=>D??[],[D]),z=!!E&&!A,B=p(b,z),V=u(ne),H=B*V,U=h(()=>s(H),[H]),{data:W}=r([`video-detail-recommend`,k],async()=>!k||j?null:await e(),{enabled:!j&&!!k}),G=h(()=>{if(j)return U;let e=W?.data?.videos;return Array.isArray(e)?e.map(e=>x(e)).filter(e=>!k||!e.id||e.id!==k):[]},[W?.data?.videos,k,U,j]),K=h(()=>S?new Set:new Set(R.map(e=>e.contentId)),[R,S]),q=h(()=>{if(j)return G;let e=G.filter(e=>!K.has(e.id));if(!S||L.length===0)return e;let t=new Set(L.map(String));return e.filter(e=>(Array.isArray(e.source_tags)?e.source_tags:String(e.source_tags||``).split(`,`).filter(Boolean)).some(e=>t.has(String(e?.id??e))))},[j,K,G,S,L]),J=h(()=>{if(S||!R.length)return[];let e=new Map(q.map(e=>[e.id,e]));return R.map((t,n)=>{let r=U[n%Math.max(1,U.length)],i=e.get(t.contentId)??(j?{...r,id:t.contentId||r.id||`preview-manual-${n+1}`,name:r.name||`猜你喜欢 ${n+1}`}:null);if(!i)return null;let a=t.titleMode===`custom`?t.title:N(i),o=t.coverMode===`upload`?t.coverUrl:M(i);return{info:{...i,name:a||i.name,img_y:o||i.img_y,img_x:o||i.img_x},config:{showPlayCount:t.showPlayCount,playCountDelta:t.playCountDelta,showEpisode:t.showEpisode}}}).filter(Boolean)},[U,q,N,M,j,R,S]),Y=h(()=>q.map(e=>({info:e})),[q]),X=h(()=>d(J,Y,H),[J,H,Y]),Z=h(()=>{if(!z)return X;let e=f(Y,P,H,5);return P===1?X:X.concat(e)},[X,P,H,Y,z]),Q=z&&P<5&&Y.length>0,$=String(re||``).trim();return m(()=>{z&&F(1)},[k,z]),m(()=>{if(!z)return;let e=I.current;if(!e||!Q)return;let t=new IntersectionObserver(e=>{e[0]?.isIntersecting&&F(e=>Math.min(e+1,5))});return t.observe(e),()=>{t.disconnect()}},[Q,z]),Z.length?y(t,{className:`w-full mt-[16px] ${j?`pointer-events-none`:``}`,children:[$?v(n,{className:`block pl-[12px] mb-[8px] text-text1 text-[18px] leading-[26px] font-bold`,children:$}):null,v(t,{className:`w-full flex flex-wrap px-[12px]`,children:Z.map((e,t)=>{let n=w!==!1&&(e.config?.showPlayCount??!0),r=e.config?.showEpisode??T,o=ee(e.info.play_count||0),s=l(Number(e.info.update_status)===1?`done`:`updating`,e.info.episode_cnt||e.info.links?.length,e.info.episode_cnt||e.info.links?.length),c=Number.isFinite(V)&&V>0?V:3,u=`${100/c}%`,d=t%c,f=c>1?{paddingLeft:8*d/c,paddingRight:8*(c-d-1)/c}:null;return v(a,{url:M(e.info),text:N(e.info),style:{width:u,...f||{}},bottomLeftChild:n?y(`div`,{className:`h-[20px] leading-[20px] text-[#fff] text-[12px] px-[4px] rounded-[4px] bg-[#333] ml-[4px] flex items-center`,children:[v(i,{className:`w-[16px] h-[auto] text-[#fff] mr-[4px]`}),o]}):null,bottomRightChild:r&&s?v(`div`,{className:`text-[#fff] text-[12px] leading-[20px] pr-2`,children:s}):null,linkPath:j?``:te(e.info)},`guess-like-${t}`)})}),z&&v(`div`,{ref:I,className:`h-[1px] w-full`})]}):null}function x(e){return{id:e.video_id||``,mid:``,name:e.name||``,cat_id:``,cat_name:``,status:`1`,status_text:``,create_time:``,content_type:0,episode_cnt:e.episode_count||0,show_at:e.show_at??``,position:``,img_type:e.img_type??``,img_x:e.img_x??``,img_y:e.img_y??``,img_width:``,img_height:``,play_count:e.play_count,preview_images:[],duration:String(e.duration??``),score:String(e.score??``),is_more_link:e.is_more_link?`y`:`n`,update_status:String(e.update_status??``),description:e.description??``,language:``,director:``,actor:``,area:``,issue_date:``,publisher:``,series:``,number:``,tags:[],source_tags:e.source_tags??``,source_actor:[],links:Array.isArray(e.episodes)?e.episodes.map(e=>({id:e.id??``,name:e.name??``,preview_m3u8_url:e.preview_m3u8_url??``,m3u8_url:e.m3u8_url??``})):[],money:``,up_user:``,source_username:``,task_id:``,file_status:``}}function ee(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 te(e){if(e.content_type===0){let t=encodeURIComponent(e.name||``);return`/video/${e.id}/${t}/episode/1`}return`/post/${e.id}`}export{b as VideoDetailRecommendClient};
@@ -30,6 +30,7 @@ declare const videoDetailRecommendMaterial: DefineMaterialOption<typeof VideoDet
30
30
  custom: "custom";
31
31
  }>>;
32
32
  title: zod.ZodOptional<zod.ZodString>;
33
+ description: zod.ZodOptional<zod.ZodString>;
33
34
  showPlayCount: zod.ZodOptional<zod.ZodBoolean>;
34
35
  playCountDelta: zod.ZodOptional<zod.ZodNumber>;
35
36
  showEpisode: zod.ZodOptional<zod.ZodBoolean>;
@@ -38,6 +39,6 @@ declare const videoDetailRecommendMaterial: DefineMaterialOption<typeof VideoDet
38
39
  renderer: "renderer";
39
40
  editor: "editor";
40
41
  }>>;
41
- }, zod_v4_core0.$strip>, "video-detail-recommend", "详情页">;
42
+ }, zod_v4_core0.$strip>, "video-detail-recommend">;
42
43
  //#endregion
43
44
  export { videoDetailRecommendMaterial };
@@ -26,6 +26,7 @@ declare const videoDetailRecommendInspectorPropsSchema: z$1.ZodObject<{
26
26
  custom: "custom";
27
27
  }>>;
28
28
  title: z$1.ZodOptional<z$1.ZodString>;
29
+ description: z$1.ZodOptional<z$1.ZodString>;
29
30
  showPlayCount: z$1.ZodOptional<z$1.ZodBoolean>;
30
31
  playCountDelta: z$1.ZodOptional<z$1.ZodNumber>;
31
32
  showEpisode: z$1.ZodOptional<z$1.ZodBoolean>;
@@ -37,8 +38,6 @@ declare const videoDetailRecommendInspectorPropsSchema: z$1.ZodObject<{
37
38
  }, z$1.core.$strip>;
38
39
  type VideoDetailRecommendInspectorProps = z$1.infer<typeof videoDetailRecommendInspectorPropsSchema>;
39
40
  /** 推荐模块物料 props。 */
40
- type VideoDetailRecommendProps = VideoDetailRecommendInspectorProps & {
41
- /** 当前视频 id,用于过滤。 */detailId: string;
42
- };
41
+ type VideoDetailRecommendProps = VideoDetailRecommendInspectorProps;
43
42
  //#endregion
44
43
  export { VideoDetailRecommendInspectorProps, VideoDetailRecommendProps, videoDetailRecommendInspectorPropsSchema };
@@ -1,2 +1,2 @@
1
1
 
2
- import{defineComponentPropsSchema as e,defineNumberPropSchema as t,defineSwitchPropSchema as n,defineTextPropSchema as r,getSchemaDefaultProps as i}from"../../../../../../utils/schema/schema.mjs";import a from"zod";const o=e({rows:t({label:`行数`,defaultValue:1}),columns:t({label:`列数`,defaultValue:2}),smartTagEnabled:n({label:`智能铺设`,defaultValue:!1}),title:r({label:`推荐位名称`,defaultValue:`猜你喜欢`}),showPlayCount:n({label:`显示播放量`,defaultValue:!0}),playCountDelta:t({label:`播放量浮动`,defaultValue:0}),showEpisode:n({label:`显示集数`,defaultValue:!0}),enableInfinite:n({label:`无限下拉`,defaultValue:!1}),smartTagIds:a.array(a.string()).optional(),items:a.array(a.object({contentId:a.string(),coverMode:a.enum([`upload`,`content`]).optional(),coverUrl:a.string().optional(),titleMode:a.enum([`custom`,`content`]).optional(),title:a.string().optional(),showPlayCount:a.boolean().optional(),playCountDelta:a.number().optional(),showEpisode:a.boolean().optional()})).optional()});({...i(o)});export{o as videoDetailRecommendInspectorPropsSchema};
2
+ import{defineComponentPropsSchema as e,defineNumberPropSchema as t,defineSwitchPropSchema as n,defineTextPropSchema as r,getSchemaDefaultProps as i}from"../../../../../../utils/schema/schema.mjs";import a from"zod";const o=e({rows:t({label:`行数`,defaultValue:1}),columns:t({label:`列数`,defaultValue:2}),smartTagEnabled:n({label:`智能铺设`,defaultValue:!1}),title:r({label:`推荐位名称`,defaultValue:`猜你喜欢`}),showPlayCount:n({label:`显示播放量`,defaultValue:!0}),playCountDelta:t({label:`播放量浮动`,defaultValue:0}),showEpisode:n({label:`显示集数`,defaultValue:!0}),enableInfinite:n({label:`无限下拉`,defaultValue:!1}),smartTagIds:a.array(a.string()).optional(),items:a.array(a.object({contentId:a.string(),coverMode:a.enum([`upload`,`content`]).optional(),coverUrl:a.string().optional(),titleMode:a.enum([`custom`,`content`]).optional(),title:a.string().optional(),description:a.string().optional(),showPlayCount:a.boolean().optional(),playCountDelta:a.number().optional(),showEpisode:a.boolean().optional()})).optional()});({...i(o)});export{o as videoDetailRecommendInspectorPropsSchema};
@@ -1,2 +1,2 @@
1
1
 
2
- function e(e,t){let n=Number(e||1);if(!Number.isFinite(n))return 1;let r=Math.max(1,Math.floor(n));return t?r:Math.min(10,r)}function t(e){let t=Number(e??3);return Number.isFinite(t)?Math.min(6,Math.max(1,Math.floor(t))):3}function n(e,t){let n=Number(e||0),r=Number(t||0);return!Number.isFinite(n)||!Number.isFinite(r)?0:Math.max(0,n+r)}function r(e,t,n){return e===`done`?`全集${Number(t||0)}`:e===`updating`?`更新至${Number(n||0)}`:``}function i(e,t,n){let r=Math.max(0,n),i=e.slice(0,r);return i.length>=r?i:i.concat(t.slice(0,r-i.length))}function a(e,t,n,r){if(!e.length||t<1||t>r)return[];let i=Math.max(0,n);if(!i)return[];let a=(t-1)*i%e.length,o=a+i;return o<=e.length?e.slice(a,o):e.slice(a).concat(e.slice(0,o-e.length))}export{n as applyPlayCountDelta,r as buildEpisodeLabel,t as clampColumns,i as mergeManualAndPool,a as mockPagedList,e as resolveRows};
2
+ function e(e,t){let n=Number(e||1);if(!Number.isFinite(n))return 1;let r=Math.max(1,Math.floor(n));return t?r:Math.min(10,r)}function t(e){let t=Number(e??3);return Number.isFinite(t)?Math.min(6,Math.max(1,Math.floor(t))):3}function n(e,t,n){return e===`done`?`全${Number(t||0)}集`:e===`updating`?`更新至${Number(n||0)}`:``}function r(e,t,n){let r=Math.max(0,n),i=e.slice(0,r);return i.length>=r?i:i.concat(t.slice(0,r-i.length))}function i(e,t,n,r){if(!e.length||t<1||t>r)return[];let i=Math.max(0,n);if(!i)return[];let a=(t-1)*i%e.length,o=a+i;return o<=e.length?e.slice(a,o):e.slice(a).concat(e.slice(0,o-e.length))}export{n as buildEpisodeLabel,t as clampColumns,r as mergeManualAndPool,i as mockPagedList,e as resolveRows};
@@ -15,6 +15,6 @@ declare const floatingBallMaterial: DefineMaterialOption<typeof FloatingBall, ty
15
15
  renderer: "renderer";
16
16
  editor: "editor";
17
17
  }>>;
18
- }, zod_v4_core0.$strip>, "floating-ball", "内容组件">;
18
+ }, zod_v4_core0.$strip>, "floating-ball">;
19
19
  //#endregion
20
20
  export { floatingBallMaterial };
@@ -11,6 +11,6 @@ declare const headerAvatarIconMaterial: DefineMaterialOption<typeof HeaderAvatar
11
11
  renderer: "renderer";
12
12
  editor: "editor";
13
13
  }>>;
14
- }, zod_v4_core0.$strip>, "header-avatar-icon", "顶部功能">;
14
+ }, zod_v4_core0.$strip>, "header-avatar-icon">;
15
15
  //#endregion
16
16
  export { headerAvatarIconMaterial };
@@ -15,6 +15,6 @@ declare const headerAvatarLogoSearchMaterial: DefineMaterialOption<typeof Header
15
15
  renderer: "renderer";
16
16
  editor: "editor";
17
17
  }>>;
18
- }, zod_v4_core0.$strip>, "header-avatar-logo-search", "顶部功能">;
18
+ }, zod_v4_core0.$strip>, "header-avatar-logo-search">;
19
19
  //#endregion
20
20
  export { headerAvatarLogoSearchMaterial };
@@ -15,6 +15,6 @@ declare const headerAvatarLogoSearchIconMaterial: DefineMaterialOption<typeof He
15
15
  renderer: "renderer";
16
16
  editor: "editor";
17
17
  }>>;
18
- }, zod_v4_core0.$strip>, "header-avatar-logo-search-icon", "顶部功能">;
18
+ }, zod_v4_core0.$strip>, "header-avatar-logo-search-icon">;
19
19
  //#endregion
20
20
  export { headerAvatarLogoSearchIconMaterial };
@@ -15,6 +15,6 @@ declare const headerLogoSearchMaterial: DefineMaterialOption<typeof HeaderLogoSe
15
15
  renderer: "renderer";
16
16
  editor: "editor";
17
17
  }>>;
18
- }, zod_v4_core0.$strip>, "header-logo-search", "顶部功能">;
18
+ }, zod_v4_core0.$strip>, "header-logo-search">;
19
19
  //#endregion
20
20
  export { headerLogoSearchMaterial };
@@ -11,6 +11,6 @@ declare const headerSearchMaterial: DefineMaterialOption<typeof HeaderSearch, ty
11
11
  renderer: "renderer";
12
12
  editor: "editor";
13
13
  }>>;
14
- }, zod_v4_core0.$strip>, "header-search", "顶部功能">;
14
+ }, zod_v4_core0.$strip>, "header-search">;
15
15
  //#endregion
16
16
  export { headerSearchMaterial };
@@ -1,15 +1,13 @@
1
1
 
2
- import { defaultProps } from "./variants/home-recommend-grid/defaults/default-props.mjs";
3
- import { HomeRecommendGridClient } from "./variants/home-recommend-grid/runtime/client.mjs";
4
- import { schema } from "./variants/home-recommend-grid/schema/index.mjs";
5
2
  import { homeRecommendGridInspectorDefaultProps, homeRecommendGridInspectorPropsSchema } from "./variants/home-recommend-grid/inspector-schema.mjs";
3
+ import { HomeRecommendGridPrefetchClient } from "./variants/home-recommend-grid/runtime/prefetch-client.mjs";
4
+ import { schema } from "./variants/home-recommend-grid/schema/index.mjs";
6
5
  import { HomeRecommendGrid } from "./variants/home-recommend-grid/server.mjs";
7
6
  import { homeRecommendGridMaterial } from "./variants/home-recommend-grid/material.mjs";
8
7
  import "./variants/home-recommend-grid/index.mjs";
9
- import { defaultProps as defaultProps$1 } from "./variants/home-recommend-waterfall/defaults/default-props.mjs";
10
- import { HomeRecommendWaterfallClient } from "./variants/home-recommend-waterfall/runtime/client.mjs";
11
- import { schema as schema$1 } from "./variants/home-recommend-waterfall/schema/index.mjs";
12
8
  import { homeRecommendWaterfallInspectorDefaultProps, homeRecommendWaterfallInspectorPropsSchema } from "./variants/home-recommend-waterfall/inspector-schema.mjs";
9
+ import { HomeRecommendWaterfallPrefetchClient } from "./variants/home-recommend-waterfall/runtime/prefetch-client.mjs";
10
+ import { schema as schema$1 } from "./variants/home-recommend-waterfall/schema/index.mjs";
13
11
  import { HomeRecommendWaterfall } from "./variants/home-recommend-waterfall/server.mjs";
14
12
  import { homeRecommendWaterfallMaterial } from "./variants/home-recommend-waterfall/material.mjs";
15
13
  import "./variants/home-recommend-waterfall/index.mjs";
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{gContentGetAppChannelBlockData as e}from"../../../../../service/generated/client.mjs";import{Image as t}from"../../../../ui/image.mjs";import{Box as n}from"../../../../ui/box.mjs";import{Text as r}from"../../../../ui/text.mjs";import{usePaginated as i}from"../../../../../hooks/query/use-query.mjs";import a from"../../../../../assets/icons/detail/video_flag.mjs";import{MiniThreeCard as o}from"../../../../common/cards/mini-three-card.mjs";import{useCallback as s,useEffect as c,useLayoutEffect as l,useMemo as u,useRef as d,useState as f}from"react";import{jsx as p,jsxs as m}from"react/jsx-runtime";import{useRouter as h}from"next/navigation";const g={},_={list:[]};function v({variant:e,props:t=g,data:i=_,mode:a=`renderer`}){let o=h(),{list:v,title:b,cursor:x,block_id:C,channel_id:w}=i,T=Array.isArray(i.icons)?i.icons:[],{moreLink:E,title:D,enableInfinite:O}=t,[A,N]=f(0),P=d(null),F=O===!0,{items:I,icons:L,hasNextPage:R,isFetchingNextPage:z,fetchNextPage:B}=M({blockId:C||``,initialCursor:x||``,initialIcons:T,initialList:v,pageSize:16,enabled:a===`renderer`&&F}),V=e===`waterfall`?6:4,H=I.length>=V?I.length-V:-1,U=d(null),W=d(!1),G=D&&D.trim()||b||``,K=e!==`waterfall`&&!F,q=K?S(E,C||``,w||``):``,J=!!(x&&x.trim()),Y=a===`renderer`&&F&&(J||R===!0),X=s(()=>{q&&(q.startsWith(`http`)?window.location.href=q:o.push(q))},[q,o]);l(()=>{let t=P.current;if(!t||e!==`waterfall`)return;let n=()=>{let e=t.clientWidth||0;N(e>0?(e-12)/2:0)};n();let r=new ResizeObserver(n);return r.observe(t),()=>{r.disconnect()}},[e]),c(()=>{let e=U.current;if(!e||!Y||I.length<16)return;let t=document.getElementById(`app-scroll-container`)||null,n=new IntersectionObserver(e=>{e[0]?.isIntersecting&&(z||W.current||(W.current=!0,B().finally(()=>{W.current=!1})))},{root:t,threshold:0});return n.observe(e),()=>{n.disconnect()}},[Y,B,z,I.length,H]);let Z=u(()=>e===`waterfall`?k(I,L,A):{left:[],right:[]},[A,I,L,e]);return I.length?m(n,{className:`w-full mt-[16px]`,children:[m(n,{className:`flex items-center justify-between px-[12px] mb-[8px]`,children:[p(r,{className:`text-text1 text-[18px] leading-[26px] font-bold line-clamp-1`,children:G}),K&&p(r,{className:`text-text3 text-[12px] leading-[18px] ${q?`cursor-pointer`:``}`,onClick:X,children:`更多`})]}),e===`grid`&&p(n,{className:`w-full flex flex-wrap px-[12px]`,children:I.map((e,t)=>{let n=L[t];return p(`div`,{ref:t===H?U:void 0,className:`w-1/2 px-[6px]`,children:p(y,{item:e,icon:n,index:t,widthStyle:{width:`100%`}})},j(e,t))})}),e===`waterfall`&&m(n,{ref:P,className:`w-full px-[12px] flex gap-[12px]`,children:[p(n,{className:`flex-1 min-w-0 flex flex-col`,children:Z.left.map(e=>p(`div`,{ref:e.index===H?U:void 0,children:p(y,{item:e.item,icon:e.icon,index:e.index,widthStyle:{width:`100%`}})},j(e.item,e.index)))}),p(n,{className:`flex-1 min-w-0 flex flex-col`,children:Z.right.map(e=>p(`div`,{ref:e.index===H?U:void 0,children:p(y,{item:e.item,icon:e.icon,index:e.index,widthStyle:{width:`100%`}})},j(e.item,e.index)))})]})]}):null}function y({item:e,icon:t,index:i,widthStyle:s}){let c=C(e),l=e.name||``,u=T(e.static?.browse_cnt??0),d=w(e),f=O(e,t,i);return p(o,{url:c,text:l,className:`w-full`,style:s,topRightChild:f?p(b,{url:f}):void 0,bottomLeftChild:m(n,{className:`h-[20px] leading-[20px] text-[#fff] text-[12px] px-[4px] rounded-[4px] bg-[#333] ml-[4px] flex items-center`,children:[p(a,{className:`w-[16px] h-[auto] text-[#fff] mr-[4px]`}),u]}),textChild:m(n,{className:`mt-[4px]`,children:[p(r,{as:`h3`,className:`text-text1 text-[14px] leading-[20px] line-clamp-1`,children:l}),d&&p(r,{className:`text-text3 text-[12px] leading-[18px]`,children:d})]}),linkPath:x(e)})}function b({url:e}){return p(n,{className:`relative w-[40px] h-[20px] mr-[6px] mt-[6px]`,children:p(t,{src:e,alt:`corner`,fill:!0,objectFit:`contain`})})}function x(e){let t=encodeURIComponent(e.name||``);return`/video/${e.id||``}/${t}/episode/1`}function S(e,t,n){if(e)return e;if(!t)return``;let r=new URLSearchParams({blockId:t});return n&&r.set(`channelId`,n),`/featured?${r.toString()}`}function C(e){return e.img_y||e.img_x||``}function w(e){if((e.type??0)===2){let t=Number(e.episode_cnt||e.links?.length||0);return t>0?`全${t}集`:``}return D(Number(e.duration||0))}function T(e){return!Number.isFinite(e)||e<=0?`0`:e>=1e6?`${E(e/1e6)}M`:e>=1e3?`${E(e/1e3)}k`:Math.floor(e).toString()}function E(e){let t=e.toFixed(1);return t.endsWith(`.0`)?t.slice(0,-2):t}function D(e){if(!Number.isFinite(e)||e<=0)return``;let t=Math.floor(e),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60,a=e=>String(e).padStart(2,`0`);return n>0?`${a(n)}:${a(r)}:${a(i)}`:`${a(r)}:${a(i)}`}function O(e,t,n){let r=e;return r.corner_icon_url||r.corner_icon||r.icon_url||t?.material_url||``}function k(e,t,n){let r=[],i=[],a=0,o=0;return e.forEach((e,s)=>{let c=t[s],l=A(n,e);a<=o?(r.push({item:e,icon:c,index:s}),a+=l):(i.push({item:e,icon:c,index:s}),o+=l)}),{left:r,right:i}}function A(e,t){if(!e)return 0;let n=e*1.3461538461538463,r=w(t)?18:0;return n+20+r+6+16}function j(e,t){return e.id?`home-recommend-${e.id}`:`home-recommend-${t}`}function M({blockId:t,initialList:n,initialCursor:r,initialIcons:a,pageSize:o,enabled:p}){let m=n.length>0,h=d(n),g=d(a),[_,v]=f(!1);c(()=>{h.current=n,g.current=a},[a,n]);let y=u(()=>{if(!m)return;let e=r&&r.trim()?r:void 0;return{pages:[{data:{block:{data:{videos:n,icons:a,cursor:r||``}}}}],pageParams:[e]}},[m,r,a,n]),{data:b,fetchNextPage:x,hasNextPage:S,isFetchingNextPage:C}=i({key:[`home-recommend`,t],queryFn:n=>e({block_id:t,cursor:n||void 0,page_size:o}),getNextPageParam:e=>{let t=e.data?.block?.data?.cursor;return t&&t.trim()?t:void 0},options:{enabled:p&&!!t,initialData:y,refetchOnMount:!1,refetchOnWindowFocus:!1,refetchOnReconnect:!1},initialPageParam:m&&r&&r.trim()?r:void 0});l(()=>{v(!0)},[]);let w=u(()=>{if(!_)return{items:m?[...h.current]:[],icons:m?[...g.current]:[]};let e=b?.pages||[],t=[],n=[],r=m?1:0;m&&(t.push(...h.current),n.push(...g.current));for(let i=r;i<e.length;i++){let r=e[i].data?.block?.data,a=r?.videos||[],o=r?.icons||[];t.push(...a),n.push(...o)}return{items:t,icons:n}},[m,_,b?.pages]),T=s(async()=>{await x()},[x]);return{items:w.items,icons:w.icons,hasNextPage:S,isFetchingNextPage:C,fetchNextPage:T}}export{v as default};
2
+ "use client";import{gContentGetPopularVideoList as e}from"../../../../../service/generated/client.mjs";import{Image as t}from"../../../../ui/image.mjs";import{Box as n}from"../../../../ui/box.mjs";import{Text as r}from"../../../../ui/text.mjs";import{usePaginated as i}from"../../../../../hooks/query/use-query.mjs";import a from"../../../../../assets/icons/detail/video_flag.mjs";import{MiniThreeCard as o}from"../../../../common/cards/mini-three-card.mjs";import{HOME_RECOMMEND_DEFAULT_GRID_COLUMNS as s,HOME_RECOMMEND_DEFAULT_GRID_ROWS as c,HOME_RECOMMEND_DEFAULT_PLAY_COUNT_DELTA as l,HOME_RECOMMEND_DEFAULT_SHOW_EPISODE as u,HOME_RECOMMEND_DEFAULT_SHOW_PLAY_COUNT as d,HOME_RECOMMEND_MAX_GRID_COLUMNS as f,HOME_RECOMMEND_MAX_GRID_ROWS as p}from"./home-recommend-default-config.mjs";import{resolveHomeRecommendFeedMode as m}from"./home-recommend-feed-mode.mjs";import{HOME_RECOMMEND_CARD_CONFIG_FIELD as h}from"./home-recommend-preview.mjs";import{enrichHomeRecommendItemsWithVideoDetails as g}from"./home-recommend-video-detail.mjs";import{useCallback as _,useEffect as v,useLayoutEffect as ee,useMemo as y,useRef as b,useState as x}from"react";import{jsx as S,jsxs as C}from"react/jsx-runtime";import{useRouter as te}from"next/navigation";const ne={},re={list:[]};function ie({variant:e,props:t=ne,data:i=re,mode:a=`renderer`}){let o=a===`editor`,h=!o,g=te(),{list:ie,title:ae,cursor:T,block_id:O,channel_id:k}=i,A=Array.isArray(i.icons)?i.icons:[],{rows:se,columns:j,moreLink:M,title:N,showPlayCount:P,playCountDelta:I,showEpisode:ue,enableInfinite:de}=t,[fe,pe]=x(0),me=b(null),he=m(t.smartTagEnabled),L=de===!0,{items:R,icons:z,hasNextPage:ge,isFetchingNextPage:B,fetchNextPage:V}=le({feedMode:he,blockId:O||``,initialCursor:T||``,initialIcons:A,initialList:ie,pageSize:16,enabled:h,enableInfinite:L}),_e=E(se,c,p),H=E(j,s,f),U=_e*H,W=o&&e===`grid`&&!L,G=W?R.slice(0,U):R,ve=W?z.slice(0,U):z,K=e===`waterfall`?6:4,q=G.length>=K?G.length-K:-1,J=b(null),Y=b(!1),ye=N&&N.trim()||ae||``,X=P??d,Z=Number(I??l),Q=ue??u,be=e!==`waterfall`&&!L,$=be?oe(M,O||``,k||``):``,xe=!!(T&&T.trim()),Se=h&&L&&(xe||ge===!0),Ce=_(()=>{$&&($.startsWith(`http`)?window.location.href=$:g.push($))},[$,g]);ee(()=>{let t=me.current;if(!t||e!==`waterfall`)return;let n=()=>{let e=t.clientWidth||0;pe(e>0?(e-12)/2:0)};n();let r=new ResizeObserver(n);return r.observe(t),()=>{r.disconnect()}},[e]),v(()=>{let e=J.current;if(!e||!Se||G.length<16)return;let t=document.getElementById(`app-scroll-container`)||null,n=new IntersectionObserver(e=>{e[0]?.isIntersecting&&(B||Y.current||(Y.current=!0,V().finally(()=>{Y.current=!1})))},{root:t,threshold:0});return n.observe(e),()=>{n.disconnect()}},[Se,V,B,G.length,q]);let we=y(()=>e===`waterfall`?ce(R,z,fe):{left:[],right:[]},[fe,R,z,e]);return G.length?C(n,{className:`w-full mt-[16px]`,children:[C(n,{className:`flex items-center justify-between px-[12px] mb-[8px]`,children:[S(r,{className:`text-text1 text-[18px] leading-[26px] font-bold line-clamp-1`,children:ye}),be&&S(r,{className:`text-text3 text-[12px] leading-[18px] ${$?`cursor-pointer`:``}`,onClick:Ce,children:`更多`})]}),e===`grid`&&S(n,{className:`w-full flex flex-wrap px-[12px]`,children:G.map((t,n)=>{let r=ve[n],i=D(t),a=X&&(i?.showPlayCount??!0),o=i?.playCountDelta??Z,s=i?.showEpisode??Q,c=n%H,l=H>1?{paddingLeft:12*c/H,paddingRight:12*(H-c-1)/H}:void 0;return S(`div`,{ref:n===q?J:void 0,className:`min-w-0`,style:{width:`${100/H}%`,...l||{}},children:S(w,{variant:e,item:t,icon:r,index:n,showPlayCount:a,playCountDelta:o,showEpisode:s,widthStyle:{width:`100%`}})},F(t,n))})}),e===`waterfall`&&C(n,{ref:me,className:`w-full px-[12px] flex gap-[12px]`,children:[S(n,{className:`flex-1 min-w-0 flex flex-col`,children:we.left.map(t=>{let n=D(t.item),r=X&&(n?.showPlayCount??!0),i=n?.playCountDelta??Z,a=n?.showEpisode??Q;return S(`div`,{ref:t.index===q?J:void 0,children:S(w,{variant:e,item:t.item,icon:t.icon,index:t.index,showPlayCount:r,playCountDelta:i,showEpisode:a,widthStyle:{width:`100%`}})},F(t.item,t.index))})}),S(n,{className:`flex-1 min-w-0 flex flex-col`,children:we.right.map(t=>{let n=D(t.item),r=X&&(n?.showPlayCount??!0),i=n?.playCountDelta??Z,a=n?.showEpisode??Q;return S(`div`,{ref:t.index===q?J:void 0,children:S(w,{variant:e,item:t.item,icon:t.icon,index:t.index,showPlayCount:r,playCountDelta:i,showEpisode:a,widthStyle:{width:`100%`}})},F(t.item,t.index))})})]})]}):null}function w({variant:e,item:t,icon:i,index:s,showPlayCount:c,playCountDelta:l,showEpisode:u,widthStyle:d}){let f=O(t),p=t.name||``,m=se(t.static?.browse_cnt??0),h=A(t,u),g=N(t,i,s);return S(o,{url:f,text:p,className:`w-full`,style:d,topRightChild:g?S(ae,{url:g}):void 0,bottomLeftChild:c?C(n,{className:`h-[20px] leading-[20px] text-[#fff] text-[12px] px-[4px] rounded-[4px] bg-[#333] ml-[4px] flex items-center`,children:[S(a,{className:`w-[16px] h-[auto] text-[#fff] mr-[4px]`}),m]}):null,bottomRightChild:u?h&&S(r,{className:`text-[#fff] text-[12px] leading-[18px] pr-2`,children:h}):null,textChild:S(n,{className:`mt-[4px]`,children:S(r,{as:`h3`,className:e===`waterfall`?`text-text1 text-[14px] leading-[20px] line-clamp-5`:`text-text1 text-[14px] leading-[20px] line-clamp-1`,children:p})}),linkPath:T(t)})}function ae({url:e}){return S(n,{className:`relative w-[40px] h-[20px]`,children:S(t,{src:e,alt:`corner`,fill:!0,objectFit:`cover`})})}function T(e){let t=encodeURIComponent(e.name||``);return`/video/${e.id||``}/${t}/episode/1`}function oe(e,t,n){if(e)return e;if(!t)return``;let r=new URLSearchParams({blockId:t});return n&&r.set(`channelId`,n),`/featured?${r.toString()}`}function E(e,t,n){let r=Number(e);return!Number.isFinite(r)||r<=0?t:Math.min(n,Math.floor(r))}function D(e){return e[h]}function O(e){return e.img_y||e.img_x||``}function k(e){return typeof e==`string`?e:``}function A(e,t){if((e.type??0)===2){if(!t)return``;let n=Number(e.episode_cnt||e.links?.length||0);return n>0?`全${n}集`:``}return M(Number(e.duration||0))}function se(e){return!Number.isFinite(e)||e<=0?`0`:e>=1e6?`${j(e/1e6)}M`:e>=1e3?`${j(e/1e3)}k`:Math.floor(e).toString()}function j(e){let t=e.toFixed(1);return t.endsWith(`.0`)?t.slice(0,-2):t}function M(e){if(!Number.isFinite(e)||e<=0)return``;let t=Math.floor(e),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60,a=e=>String(e).padStart(2,`0`);return n>0?`${a(n)}:${a(r)}:${a(i)}`:`${a(r)}:${a(i)}`}function N(e,t,n){return k(e.badge_url)||k(t?.material_url)||``}function ce(e,t,n){let r=[],i=[],a=0,o=0;return e.forEach((e,s)=>{let c=t[s],l=P(n,e);a<=o?(r.push({item:e,icon:c,index:s}),a+=l):(i.push({item:e,icon:c,index:s}),o+=l)}),{left:r,right:i}}function P(e,t){if(!e)return 0;let n=e*1.3461538461538463,r=A(t,!0)?18:0;return n+20+r+6+16}function F(e,t){return e.id?`home-recommend-${e.id}`:`home-recommend-${t}`}function I(e){if(typeof e==`string`)return e.trim()||void 0}function le({feedMode:t,blockId:n,initialList:r,initialCursor:a,initialIcons:o,pageSize:s,enabled:c,enableInfinite:l}){let u=r.length>0,[d,f]=x(!1),p=y(()=>{if(!u)return;let e=I(a);return{pages:[{items:r,icons:o,nextCursor:e}],pageParams:[e]}},[u,a,o,r]),{data:m,fetchNextPage:h,hasNextPage:v,isFetchingNextPage:b}=i({key:[`home-recommend`,t,n||`popular`],queryFn:async n=>{let r=await e({cursor:I(n),page_size:s}),i=r.data?.videos||[],a=i;if(t===`popular-with-video-detail`)try{a=await g(i)}catch(e){console.error(`推荐位批量补齐视频详情失败(client)`,e)}return{items:a,icons:[],nextCursor:I(r.data?.cusor)}},getNextPageParam:e=>{if(l)return I(e.nextCursor)},options:{enabled:c,initialData:p,refetchOnMount:!1,refetchOnWindowFocus:!1,refetchOnReconnect:!1},initialPageParam:u?I(a):``});ee(()=>{f(!0)},[]);let S=y(()=>{if(!d)return{items:u?[...r]:[],icons:u?[...o]:[]};let e=m?.pages||[],t=[],n=[],i=u?1:0;u&&(t.push(...r),n.push(...o));for(let r=i;r<e.length;r++){let i=e[r];t.push(...i.items||[]),n.push(...i.icons||[])}return{items:t,icons:n}},[u,o,r,d,m?.pages]),C=_(async()=>{await h()},[h]);return{items:S.items,icons:S.icons,hasNextPage:l?v:!1,isFetchingNextPage:b,fetchNextPage:C}}export{ie as default};
@@ -0,0 +1,2 @@
1
+
2
+ const e=`推荐`,t=1,n=2,r=10,i=6,a=!1,o=!0,s=0,c=!0,l=!1;export{l as HOME_RECOMMEND_DEFAULT_ENABLE_INFINITE,n as HOME_RECOMMEND_DEFAULT_GRID_COLUMNS,t as HOME_RECOMMEND_DEFAULT_GRID_ROWS,s as HOME_RECOMMEND_DEFAULT_PLAY_COUNT_DELTA,c as HOME_RECOMMEND_DEFAULT_SHOW_EPISODE,o as HOME_RECOMMEND_DEFAULT_SHOW_PLAY_COUNT,a as HOME_RECOMMEND_DEFAULT_SMART_TAG_ENABLED,e as HOME_RECOMMEND_DEFAULT_TITLE,i as HOME_RECOMMEND_MAX_GRID_COLUMNS,r as HOME_RECOMMEND_MAX_GRID_ROWS};
@@ -0,0 +1,2 @@
1
+
2
+ function e(e){return e===!0?`popular-with-video-detail`:`popular`}export{e as resolveHomeRecommendFeedMode};
@@ -1,2 +1,2 @@
1
1
 
2
- const e=`/static/components-thumb/video_player.png`,t=Array.from({length:12},(t,n)=>{let r=n%2==1,i={browse_cnt:12345+n*731};return{id:`preview-recommend-${n+1}`,name:`媒资标题 ${n+1}`,img_y:e,img_x:e,type:r?2:1,duration:r?0:60*(18+n),episode_cnt:r?12+n%3*6:0,static:i}});function n(e,t){return t?8:e===`waterfall`?4:2}function r(e){let n=Math.max(1,Math.floor(e));return Array.from({length:n},(e,n)=>({...t[n%t.length],id:`preview-recommend-${n+1}`,name:`媒资标题 ${n+1}`}))}function i({variant:e,schemaTitle:t,enableInfinite:i,data:a}){let o=Array.isArray(a?.list)?a.list.filter(Boolean):[],s=n(e,i);return{title:t&&t.trim()||a?.title||`推荐位名称`,list:o.length?o:r(s),icons:Array.isArray(a?.icons)?a.icons:[],cursor:a?.cursor||``,block_id:a?.block_id||``,channel_id:a?.channel_id||``,show_style:a?.show_style}}export{i as buildHomeRecommendEditorPreviewData};
2
+ import{HOME_RECOMMEND_DEFAULT_GRID_COLUMNS as e,HOME_RECOMMEND_DEFAULT_GRID_ROWS as t,HOME_RECOMMEND_DEFAULT_TITLE as n,HOME_RECOMMEND_MAX_GRID_COLUMNS as r,HOME_RECOMMEND_MAX_GRID_ROWS as i}from"./home-recommend-default-config.mjs";const a=`/static/components-thumb/video_player.png`,o=`__homeRecommendCardConfig`,s=Array.from({length:60},(e,t)=>{let n=t%2==1,r={browse_cnt:12345+t*731};return{id:`preview-recommend-${t+1}`,name:`${`媒资标题`.repeat((t+1)*2)}`,img_y:a,img_x:a,type:n?2:1,duration:n?0:60*(18+t),episode_cnt:n?12+t%3*6:0,static:r}});function c({variant:e,enableInfinite:t,rows:n,columns:r,items:i}){let a=Array.isArray(i)?i.length:0;return t?Math.max(8,a):e===`waterfall`?Math.max(4,a):Math.max(f(n,r),2,a)}function l(e){let t=Math.max(1,Math.floor(e));return Array.from({length:t},(e,t)=>{let n=s[t%s.length];return{...n,id:`preview-recommend-${t+1}`,name:n.name}})}function u(e,t,n){return t.length?e.map((e,r)=>{let i=t[r];if(!i)return e;let a=(i.contentId?n.get(i.contentId):void 0)||e,s=i.titleMode===`custom`?i.title?.trim()||a.name||e.name||``:a.name||e.name||``,c=i.coverMode===`upload`&&!!i.coverUrl,l=c?i.coverUrl||``:a.img_y||a.img_x||e.img_y||e.img_x||``,u=c?i.coverUrl||``:a.img_x||a.img_y||e.img_x||e.img_y||``,f=a.badge_url||e.badge_url||``,p=i.badge_url??f,m=d(i,a);return{...e,...a,id:a.id||e.id||`preview-recommend-${r+1}`,name:s,img_y:l,img_x:u,badge_url:p||void 0,[o]:m}}):e}function d(e,t){let n=t[o],r={showPlayCount:e.showPlayCount??n?.showPlayCount,playCountDelta:e.playCountDelta??n?.playCountDelta,showEpisode:e.showEpisode??n?.showEpisode};if(!(r.showPlayCount===void 0&&r.playCountDelta===void 0&&r.showEpisode===void 0))return r}function f(n,a){return p(n,t,1,i)*p(a,e,1,r)}function p(e,t,n,r){let i=Number(e);return Number.isFinite(i)?Math.min(r,Math.max(n,Math.floor(i))):t}function m({variant:e,schemaTitle:t,enableInfinite:r,smartTagEnabled:i,rows:a,columns:o,items:s}){let d=new Map,f=i?[]:Array.isArray(s)?s.filter(Boolean):[],p=u(l(c({variant:e,enableInfinite:r,rows:a,columns:o,items:f})),f,d);return{title:t&&t.trim()||n,list:p,icons:[],cursor:``,block_id:``,channel_id:``,show_style:void 0}}export{o as HOME_RECOMMEND_CARD_CONFIG_FIELD,m as buildHomeRecommendEditorPreviewData};
@@ -0,0 +1,2 @@
1
+
2
+ import{gContentGetPopularVideoList as e}from"../../../../../service/generated/client.mjs";import{resolveHomeRecommendFeedMode as t}from"./home-recommend-feed-mode.mjs";import{enrichHomeRecommendItemsWithVideoDetails as n}from"./home-recommend-video-detail.mjs";async function r(t){try{let n=await e({page_size:t,cursor:void 0});return{videos:Array.isArray(n.data?.videos)?n.data.videos:[],nextCursor:n.data?.cusor||``,loaded:!0}}catch(e){return console.error(`推荐位获取热门视频失败(server)`,e),{videos:[],nextCursor:``,loaded:!1}}}async function i({smartTagEnabled:e,pageSize:i=16}){let a=t(e),o={list:[],icons:[],cursor:``,title:``,block_id:``,channel_id:``,show_style:void 0};if(a===`popular-with-video-detail`){let e=o.list,t=o.cursor||``,s=e.length>0;if(!s){let n=await r(i);e=n.videos,t=n.nextCursor,s=n.loaded}let c=e;try{c=await n(e)}catch(e){console.error(`推荐位批量补齐视频详情失败(server)`,e)}return{feedMode:a,data:{...o,list:c,cursor:t}}}let s=await r(i),c=s.loaded?s.videos:o.list,l=s.loaded?s.nextCursor:o.cursor||``;return{feedMode:a,data:{...o,list:c,icons:[],cursor:l}}}export{i as resolveHomeRecommendServerData};
@@ -0,0 +1,2 @@
1
+
2
+ import{gContentBatchGetVideoDetail as e}from"../../../../../service/content-batch-get-video-detail.mjs";function t(e){return typeof e==`string`?e.trim():``}function n(e){return t(e.id||e.mid)}function r(e){let t=Number(e);if(!(!Number.isFinite(t)||t<0))return t}async function i(r){let i=Array.from(new Set(r.map(n).filter(Boolean)));if(!i.length)return new Map;let a=await e({video_ids:i}),o=Array.isArray(a.data?.videos)?a.data.videos:[],s=new Map;return o.forEach(e=>{let n=t(e.video_id||e.id||e.mid);n&&s.set(n,e)}),s}function a(e,t){return!e.length||!t.size?e:e.map(e=>{let i=n(e),a=t.get(i);if(!a)return e;let o=e.static||{},s=r(a.play_count)??o.browse_cnt,c=r(a.like_count)??o.like_cnt,l=r(a.collect_count)??o.collect_cnt,u=r(a.duration)??e.duration,d=r(Array.isArray(a.episodes)?a.episodes.length:void 0)??e.episode_cnt;return{...e,duration:u,episode_cnt:d,time:a.time||e.time,static:{...o,browse_cnt:s,like_cnt:c,collect_cnt:l}}})}async function o(e){return e.length?a(e,await i(e)):e}export{o as enrichHomeRecommendItemsWithVideoDetails};
@@ -1,7 +1,6 @@
1
1
 
2
- import { defaultProps } from "./defaults/default-props.mjs";
3
- import { HomeRecommendGridClient } from "./runtime/client.mjs";
4
- import { schema } from "./schema/index.mjs";
5
2
  import { homeRecommendGridInspectorDefaultProps, homeRecommendGridInspectorPropsSchema } from "./inspector-schema.mjs";
3
+ import { HomeRecommendGridPrefetchClient } from "./runtime/prefetch-client.mjs";
4
+ import { schema } from "./schema/index.mjs";
6
5
  import { HomeRecommendGrid } from "./server.mjs";
7
6
  import { homeRecommendGridMaterial } from "./material.mjs";
@@ -1,2 +1,2 @@
1
1
 
2
- import e from"./runtime/client.mjs";import{schema as t}from"./schema/index.mjs";import{defaultProps as n}from"./defaults/default-props.mjs";import{homeRecommendGridInspectorDefaultProps as r,homeRecommendGridInspectorPropsSchema as i}from"./inspector-schema.mjs";import{HomeRecommendGrid as a}from"./server.mjs";import{homeRecommendGridMaterial as o}from"./material.mjs";var s=e;export{s as default};
2
+ import e from"./runtime/prefetch-client.mjs";import{homeRecommendGridInspectorDefaultProps as t,homeRecommendGridInspectorPropsSchema as n}from"./inspector-schema.mjs";import{schema as r}from"./schema/index.mjs";import{HomeRecommendGrid as i}from"./server.mjs";import{homeRecommendGridMaterial as a}from"./material.mjs";var o=e;export{o as default};
@@ -1,4 +1,5 @@
1
1
 
2
+ import "../../../../utils/index.mjs";
2
3
  import { SchemaHasDefaultValue } from "../../../../../../utils/schema/schema.mjs";
3
4
  import "../../../../../../utils/schema/index.mjs";
4
5
  import z$1 from "zod";
@@ -8,16 +9,49 @@ import z$1 from "zod";
8
9
  * HomeRecommendGrid 物料属性 schema 定义。
9
10
  */
10
11
  declare const homeRecommendGridInspectorPropsSchema: z$1.ZodObject<{
11
- title: z$1.ZodOptional<z$1.ZodString> & SchemaHasDefaultValue;
12
+ rows: z$1.ZodNumber & SchemaHasDefaultValue;
13
+ columns: z$1.ZodNumber & SchemaHasDefaultValue;
14
+ smartTagEnabled: z$1.ZodBoolean & SchemaHasDefaultValue;
15
+ title: z$1.ZodString & SchemaHasDefaultValue;
16
+ showPlayCount: z$1.ZodBoolean & SchemaHasDefaultValue;
17
+ playCountDelta: z$1.ZodNumber & SchemaHasDefaultValue;
18
+ showEpisode: z$1.ZodBoolean & SchemaHasDefaultValue;
12
19
  enableInfinite: z$1.ZodOptional<z$1.ZodBoolean> & SchemaHasDefaultValue;
13
20
  moreLink: z$1.ZodOptional<z$1.ZodString> & SchemaHasDefaultValue;
21
+ smartTagIds: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
22
+ items: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
23
+ contentId: z$1.ZodString;
24
+ coverMode: z$1.ZodOptional<z$1.ZodEnum<{
25
+ content: "content";
26
+ upload: "upload";
27
+ }>>;
28
+ coverUrl: z$1.ZodOptional<z$1.ZodString>;
29
+ badge_url: z$1.ZodOptional<z$1.ZodString>;
30
+ titleMode: z$1.ZodOptional<z$1.ZodEnum<{
31
+ content: "content";
32
+ custom: "custom";
33
+ }>>;
34
+ title: z$1.ZodOptional<z$1.ZodString>;
35
+ description: z$1.ZodOptional<z$1.ZodString>;
36
+ showPlayCount: z$1.ZodOptional<z$1.ZodBoolean>;
37
+ playCountDelta: z$1.ZodOptional<z$1.ZodNumber>;
38
+ showEpisode: z$1.ZodOptional<z$1.ZodBoolean>;
39
+ }, z$1.core.$strip>>>;
14
40
  mode: z$1.ZodOptional<z$1.ZodEnum<{
15
41
  renderer: "renderer";
16
42
  editor: "editor";
17
43
  }>>;
18
44
  }, z$1.core.$strip>;
19
45
  declare const homeRecommendGridInspectorDefaultProps: {
46
+ smartTagIds: never[];
47
+ items: never[];
48
+ rows: number;
49
+ columns: number;
50
+ smartTagEnabled: boolean;
20
51
  title: string;
52
+ showPlayCount: boolean;
53
+ playCountDelta: number;
54
+ showEpisode: boolean;
21
55
  enableInfinite: boolean;
22
56
  moreLink: string;
23
57
  };
@@ -1,2 +1,2 @@
1
1
 
2
- import{defineComponentPropsSchema as e,defineSwitchPropSchema as t,defineTextPropSchema as n,getSchemaDefaultProps as r}from"../../../../../../utils/schema/schema.mjs";const i=e({title:n({label:`推荐位名称`,description:``,required:!1,defaultValue:``}),enableInfinite:t({label:`无限下拉`,defaultValue:!1,required:!1}),moreLink:n({label:`更多`,description:``,required:!1,defaultValue:``})}),a=r(i);export{a as homeRecommendGridInspectorDefaultProps,i as homeRecommendGridInspectorPropsSchema};
2
+ import{defineComponentPropsSchema as e,defineNumberPropSchema as t,defineSwitchPropSchema as n,defineTextPropSchema as r,getSchemaDefaultProps as i}from"../../../../../../utils/schema/schema.mjs";import{HOME_RECOMMEND_DEFAULT_ENABLE_INFINITE as a,HOME_RECOMMEND_DEFAULT_GRID_COLUMNS as o,HOME_RECOMMEND_DEFAULT_GRID_ROWS as s,HOME_RECOMMEND_DEFAULT_PLAY_COUNT_DELTA as c,HOME_RECOMMEND_DEFAULT_SHOW_EPISODE as l,HOME_RECOMMEND_DEFAULT_SHOW_PLAY_COUNT as u,HOME_RECOMMEND_DEFAULT_SMART_TAG_ENABLED as d,HOME_RECOMMEND_DEFAULT_TITLE as f}from"../../shared/home-recommend-default-config.mjs";import p from"zod";const m=e({rows:t({label:`行数`,defaultValue:s}),columns:t({label:`列数`,defaultValue:o}),smartTagEnabled:n({label:`智能铺设`,defaultValue:d}),title:r({label:`推荐位名称`,defaultValue:f}),showPlayCount:n({label:`显示播放量`,defaultValue:u}),playCountDelta:t({label:`播放量浮动`,defaultValue:c}),showEpisode:n({label:`显示集数`,defaultValue:l}),enableInfinite:n({label:`无限下拉`,defaultValue:a,required:!1}),moreLink:r({label:`更多`,description:``,required:!1,defaultValue:``}),smartTagIds:p.array(p.string()).optional(),items:p.array(p.object({contentId:p.string(),coverMode:p.enum([`upload`,`content`]).optional(),coverUrl:p.string().optional(),badge_url:p.string().optional(),titleMode:p.enum([`custom`,`content`]).optional(),title:p.string().optional(),description:p.string().optional(),showPlayCount:p.boolean().optional(),playCountDelta:p.number().optional(),showEpisode:p.boolean().optional()})).optional()}),h={...i(m),smartTagIds:[],items:[]},g={rows:{type:`number`,title:`行数`,default:h.rows},columns:{type:`number`,title:`列数`,default:h.columns},smartTagEnabled:{type:`boolean`,title:`智能铺设`,default:h.smartTagEnabled},title:{type:`string`,title:`推荐位名称`,default:h.title},showPlayCount:{type:`boolean`,title:`显示播放量`,default:h.showPlayCount},playCountDelta:{type:`number`,title:`播放量浮动`,default:h.playCountDelta},showEpisode:{type:`boolean`,title:`显示集数`,default:h.showEpisode},enableInfinite:{type:`boolean`,title:`无限下拉`,default:h.enableInfinite},moreLink:{type:`string`,title:`更多`,description:``,default:h.moreLink},smartTagIds:{type:`array`,title:`智能铺设标签`,default:h.smartTagIds,items:{type:`string`,title:`标签 ID`}},items:{type:`array`,title:`推荐项`,default:h.items,items:{type:`object`,title:`推荐项`,properties:{contentId:{type:`string`,title:`内容 ID`},coverMode:{type:`string`,title:`封面模式`},coverUrl:{type:`string`,title:`封面地址`},badge_url:{type:`string`,title:`角标地址`},titleMode:{type:`string`,title:`标题模式`},title:{type:`string`,title:`标题`},description:{type:`string`,title:`简介`},showPlayCount:{type:`boolean`,title:`显示播放量`},playCountDelta:{type:`number`,title:`播放量浮动`},showEpisode:{type:`boolean`,title:`显示集数`}}}}};export{h as homeRecommendGridInspectorDefaultProps,m as homeRecommendGridInspectorPropsSchema,g as homeRecommendGridPropsSchema};
@@ -2,19 +2,45 @@
2
2
  import { SchemaHasDefaultValue } from "../../../../../../utils/schema/schema.mjs";
3
3
  import { DefineMaterialOption } from "../../../../../../utils/schema/material.mjs";
4
4
  import "../../../../../../utils/schema/index.mjs";
5
+ import { HomeRecommendGridPrefetchClient } from "./runtime/prefetch-client.mjs";
5
6
  import { HomeRecommendGrid } from "./server.mjs";
6
7
  import * as zod from "zod";
7
8
  import * as zod_v4_core0 from "zod/v4/core";
8
9
 
9
10
  //#region components/biz/business/home-recommend/variants/home-recommend-grid/material.d.ts
10
- declare const homeRecommendGridMaterial: DefineMaterialOption<typeof HomeRecommendGrid, typeof HomeRecommendGrid, zod.ZodObject<{
11
- title: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
11
+ declare const homeRecommendGridMaterial: DefineMaterialOption<typeof HomeRecommendGrid, typeof HomeRecommendGridPrefetchClient, zod.ZodObject<{
12
+ rows: zod.ZodNumber & SchemaHasDefaultValue;
13
+ columns: zod.ZodNumber & SchemaHasDefaultValue;
14
+ smartTagEnabled: zod.ZodBoolean & SchemaHasDefaultValue;
15
+ title: zod.ZodString & SchemaHasDefaultValue;
16
+ showPlayCount: zod.ZodBoolean & SchemaHasDefaultValue;
17
+ playCountDelta: zod.ZodNumber & SchemaHasDefaultValue;
18
+ showEpisode: zod.ZodBoolean & SchemaHasDefaultValue;
12
19
  enableInfinite: zod.ZodOptional<zod.ZodBoolean> & SchemaHasDefaultValue;
13
20
  moreLink: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
21
+ smartTagIds: zod.ZodOptional<zod.ZodArray<zod.ZodString>>;
22
+ items: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
23
+ contentId: zod.ZodString;
24
+ coverMode: zod.ZodOptional<zod.ZodEnum<{
25
+ content: "content";
26
+ upload: "upload";
27
+ }>>;
28
+ coverUrl: zod.ZodOptional<zod.ZodString>;
29
+ badge_url: zod.ZodOptional<zod.ZodString>;
30
+ titleMode: zod.ZodOptional<zod.ZodEnum<{
31
+ content: "content";
32
+ custom: "custom";
33
+ }>>;
34
+ title: zod.ZodOptional<zod.ZodString>;
35
+ description: zod.ZodOptional<zod.ZodString>;
36
+ showPlayCount: zod.ZodOptional<zod.ZodBoolean>;
37
+ playCountDelta: zod.ZodOptional<zod.ZodNumber>;
38
+ showEpisode: zod.ZodOptional<zod.ZodBoolean>;
39
+ }, zod_v4_core0.$strip>>>;
14
40
  mode: zod.ZodOptional<zod.ZodEnum<{
15
41
  renderer: "renderer";
16
42
  editor: "editor";
17
43
  }>>;
18
- }, zod_v4_core0.$strip>, "home-recommend-grid", "内容组件">;
44
+ }, zod_v4_core0.$strip>, "home-recommend-grid">;
19
45
  //#endregion
20
46
  export { homeRecommendGridMaterial };
@@ -1,2 +1,2 @@
1
1
 
2
- import{defineMaterial as e}from"../../../../../../utils/schema/material.mjs";import{homeRecommendGridInspectorPropsSchema as t}from"./inspector-schema.mjs";import{HomeRecommendGrid as n}from"./server.mjs";const r=e({type:`home-recommend-grid`,name:`两列宫格`,icon:`/static/components-thumb/grid_two_column_single_row.png`,category:`内容组件`,serverComponent:n,clientComponent:n,propsSchema:t});export{r as homeRecommendGridMaterial};
2
+ import{defineMaterial as e}from"../../../../../../utils/schema/material.mjs";import t from"./runtime/prefetch-client.mjs";import{homeRecommendGridInspectorPropsSchema as n}from"./inspector-schema.mjs";import{HomeRecommendGrid as r}from"./server.mjs";const i=e({type:`home-recommend-grid`,name:`两列宫格`,icon:`/static/components-thumb/grid_two_column_single_row.png`,category:`内容组件`,serverComponent:r,clientComponent:t,propsSchema:n});export{i as homeRecommendGridMaterial};
@@ -0,0 +1,27 @@
1
+
2
+ import { MaterialComponentMode } from "../../../../../../../utils/schema/schema.mjs";
3
+ import "../../../../../../../utils/schema/index.mjs";
4
+ import { HomeRecommendGridInspectorProps } from "../inspector-schema.mjs";
5
+ import { HomeRecommendData } from "../../../types.mjs";
6
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
7
+
8
+ //#region components/biz/business/home-recommend/variants/home-recommend-grid/runtime/prefetch-client.d.ts
9
+ interface HomeRecommendGridPrefetchClientProps extends Partial<Omit<HomeRecommendGridInspectorProps, 'mode'>> {
10
+ /** 预取数据(可选)。 */
11
+ prefetchData?: HomeRecommendData;
12
+ /** 兼容内容块转换链路的数据字段。 */
13
+ data?: HomeRecommendData;
14
+ /** 渲染模式。 */
15
+ mode?: MaterialComponentMode;
16
+ }
17
+ /**
18
+ * 首页推荐两列宫格布局(支持预取数据)。
19
+ */
20
+ declare function HomeRecommendGridPrefetchClient({
21
+ prefetchData,
22
+ data,
23
+ mode,
24
+ ...propsConfig
25
+ }: HomeRecommendGridPrefetchClientProps): react_jsx_runtime0.JSX.Element;
26
+ //#endregion
27
+ export { HomeRecommendGridPrefetchClient };
@@ -0,0 +1,2 @@
1
+
2
+ "use client";import{buildHomeRecommendEditorPreviewData as e}from"../../../shared/home-recommend-preview.mjs";import t from"../../../shared/home-recommend-base.mjs";import{useMemo as n}from"react";import{jsx as r}from"react/jsx-runtime";function i({prefetchData:i,data:a,mode:o=`renderer`,...s}){let c=o===`editor`,l=s,u=i??a,d=n(()=>c?e({variant:`grid`,schemaTitle:l.title,enableInfinite:l.enableInfinite,smartTagEnabled:l.smartTagEnabled,rows:l.rows,columns:l.columns,items:l.items}):u,[c,u,l.columns,l.enableInfinite,l.items,l.rows,l.smartTagEnabled,l.title]);return r(`div`,{className:c?`pointer-events-none`:void 0,children:r(t,{variant:`grid`,props:l,data:d,mode:o})})}export{i as default};
@@ -1,2 +1,2 @@
1
1
 
2
- import{componentMeta as e}from"./component.mjs";import{dataSchema as t}from"./data.schema.mjs";import{eventSchema as n}from"./event.schema.mjs";import{propsSchema as r}from"./props.schema.mjs";import{styleSchema as i}from"./style.schema.mjs";const a={...e,propsSchema:r,dataSchema:t,styleSchema:i,eventSchema:n};export{a as schema};
2
+ import{homeRecommendGridPropsSchema as e}from"../inspector-schema.mjs";import{componentMeta as t}from"./component.mjs";import{dataSchema as n}from"./data.schema.mjs";import{eventSchema as r}from"./event.schema.mjs";import{styleSchema as i}from"./style.schema.mjs";const a={...t,propsSchema:e,dataSchema:n,styleSchema:i,eventSchema:r};export{a as schema};
@@ -1,17 +1,14 @@
1
1
 
2
- import { HomeRecommendData } from "../../types.mjs";
3
2
  import { HomeRecommendGridInspectorProps } from "./inspector-schema.mjs";
4
3
  import * as react_jsx_runtime0 from "react/jsx-runtime";
5
4
 
6
5
  //#region components/biz/business/home-recommend/variants/home-recommend-grid/server.d.ts
7
- /** HomeRecommendGrid 物料组件 props(inspector 可编辑字段 + 可选数据) */
8
- type HomeRecommendGridProps = HomeRecommendGridInspectorProps & {
9
- /** 推荐位数据 */data?: HomeRecommendData;
10
- };
6
+ /** HomeRecommendGrid 物料组件 props */
7
+ type HomeRecommendGridProps = HomeRecommendGridInspectorProps;
11
8
  /**
12
9
  * HomeRecommendGrid 物料组件
13
10
  * 接收 inspector 可编辑的 props,转换为 BaseComponentProps 传给 runtime client
14
11
  */
15
- declare function HomeRecommendGrid(props: HomeRecommendGridProps): react_jsx_runtime0.JSX.Element;
12
+ declare function HomeRecommendGrid(props: HomeRecommendGridProps): Promise<react_jsx_runtime0.JSX.Element>;
16
13
  //#endregion
17
14
  export { HomeRecommendGrid };
@@ -1,2 +1,2 @@
1
1
 
2
- import e from"./runtime/client.mjs";import{defaultProps as t}from"./defaults/default-props.mjs";import{jsx as n}from"react/jsx-runtime";function r(r){let{mode:i=`renderer`,moreLink:a=t.moreLink,title:o,enableInfinite:s,data:c}=r;return n(e,{mode:i,props:{moreLink:a,title:o,enableInfinite:s},data:c})}export{r as HomeRecommendGrid};
2
+ import{HydrationBoundary as e}from"../../../../../../hooks/query/hydration-boundary.mjs";import t from"./runtime/prefetch-client.mjs";import{resolveHomeRecommendServerData as n}from"../../shared/home-recommend-server-data.mjs";import{jsx as r}from"react/jsx-runtime";function i({rows:e,columns:t}){let n=Number(e),r=Number(t);if(!Number.isFinite(n)||!Number.isFinite(r))return 16;let i=Math.floor(n)*Math.floor(r);return!Number.isFinite(i)||i<=0?16:i}function a(e){if(typeof e==`string`)return e.trim()||void 0}async function o(o){let{mode:s=`renderer`,...c}=o;if(s!==`renderer`)return r(t,{...c,mode:s});let l=await n({smartTagEnabled:c.smartTagEnabled,pageSize:i(c)});return r(e,{prefetch:[{type:`infinite`,queryKey:[`home-recommend`,l.feedMode,l.data.block_id||`popular`],queryFn:async()=>({items:l.data.list||[],icons:l.data.icons||[],nextCursor:a(l.data.cursor)}),initialPageParam:``,getNextPageParam:()=>void 0}],children:r(t,{...c,prefetchData:l.data,mode:s})})}export{o as HomeRecommendGrid};
@@ -1,7 +1,6 @@
1
1
 
2
- import { defaultProps } from "./defaults/default-props.mjs";
3
- import { HomeRecommendWaterfallClient } from "./runtime/client.mjs";
4
- import { schema } from "./schema/index.mjs";
5
2
  import { homeRecommendWaterfallInspectorDefaultProps, homeRecommendWaterfallInspectorPropsSchema } from "./inspector-schema.mjs";
3
+ import { HomeRecommendWaterfallPrefetchClient } from "./runtime/prefetch-client.mjs";
4
+ import { schema } from "./schema/index.mjs";
6
5
  import { HomeRecommendWaterfall } from "./server.mjs";
7
6
  import { homeRecommendWaterfallMaterial } from "./material.mjs";
@@ -1,2 +1,2 @@
1
1
 
2
- import e from"./runtime/client.mjs";import{schema as t}from"./schema/index.mjs";import{defaultProps as n}from"./defaults/default-props.mjs";import{homeRecommendWaterfallInspectorDefaultProps as r,homeRecommendWaterfallInspectorPropsSchema as i}from"./inspector-schema.mjs";import{HomeRecommendWaterfall as a}from"./server.mjs";import{homeRecommendWaterfallMaterial as o}from"./material.mjs";var s=e;export{s as default};
2
+ import e from"./runtime/prefetch-client.mjs";import{homeRecommendWaterfallInspectorDefaultProps as t,homeRecommendWaterfallInspectorPropsSchema as n}from"./inspector-schema.mjs";import{schema as r}from"./schema/index.mjs";import{HomeRecommendWaterfall as i}from"./server.mjs";import{homeRecommendWaterfallMaterial as a}from"./material.mjs";var o=e;export{o as default};
@@ -1,4 +1,5 @@
1
1
 
2
+ import "../../../../utils/index.mjs";
2
3
  import { SchemaHasDefaultValue } from "../../../../../../utils/schema/schema.mjs";
3
4
  import "../../../../../../utils/schema/index.mjs";
4
5
  import z$1 from "zod";
@@ -8,15 +9,42 @@ import z$1 from "zod";
8
9
  * HomeRecommendWaterfall 物料属性 schema 定义。
9
10
  */
10
11
  declare const homeRecommendWaterfallInspectorPropsSchema: z$1.ZodObject<{
11
- title: z$1.ZodOptional<z$1.ZodString> & SchemaHasDefaultValue;
12
- enableInfinite: z$1.ZodOptional<z$1.ZodBoolean> & SchemaHasDefaultValue;
12
+ smartTagEnabled: z$1.ZodBoolean & SchemaHasDefaultValue;
13
+ title: z$1.ZodString & SchemaHasDefaultValue;
14
+ showPlayCount: z$1.ZodBoolean & SchemaHasDefaultValue;
15
+ playCountDelta: z$1.ZodNumber & SchemaHasDefaultValue;
16
+ showEpisode: z$1.ZodBoolean & SchemaHasDefaultValue;
17
+ enableInfinite: z$1.ZodBoolean & SchemaHasDefaultValue;
18
+ smartTagIds: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
19
+ items: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
20
+ contentId: z$1.ZodString;
21
+ coverMode: z$1.ZodOptional<z$1.ZodEnum<{
22
+ content: "content";
23
+ upload: "upload";
24
+ }>>;
25
+ coverUrl: z$1.ZodOptional<z$1.ZodString>;
26
+ titleMode: z$1.ZodOptional<z$1.ZodEnum<{
27
+ content: "content";
28
+ custom: "custom";
29
+ }>>;
30
+ title: z$1.ZodOptional<z$1.ZodString>;
31
+ showPlayCount: z$1.ZodOptional<z$1.ZodBoolean>;
32
+ playCountDelta: z$1.ZodOptional<z$1.ZodNumber>;
33
+ showEpisode: z$1.ZodOptional<z$1.ZodBoolean>;
34
+ }, z$1.core.$strip>>>;
13
35
  mode: z$1.ZodOptional<z$1.ZodEnum<{
14
36
  renderer: "renderer";
15
37
  editor: "editor";
16
38
  }>>;
17
39
  }, z$1.core.$strip>;
18
40
  declare const homeRecommendWaterfallInspectorDefaultProps: {
41
+ smartTagIds: never[];
42
+ items: never[];
43
+ smartTagEnabled: boolean;
19
44
  title: string;
45
+ showPlayCount: boolean;
46
+ playCountDelta: number;
47
+ showEpisode: boolean;
20
48
  enableInfinite: boolean;
21
49
  };
22
50
  type HomeRecommendWaterfallInspectorProps = z$1.infer<typeof homeRecommendWaterfallInspectorPropsSchema>;
@@ -1,2 +1,2 @@
1
1
 
2
- import{defineComponentPropsSchema as e,defineSwitchPropSchema as t,defineTextPropSchema as n,getSchemaDefaultProps as r}from"../../../../../../utils/schema/schema.mjs";const i=e({title:n({label:`推荐位名称`,description:``,required:!1,defaultValue:``}),enableInfinite:t({label:`无限下拉`,defaultValue:!1,required:!1})}),a=r(i);export{a as homeRecommendWaterfallInspectorDefaultProps,i as homeRecommendWaterfallInspectorPropsSchema};
2
+ import{defineComponentPropsSchema as e,defineNumberPropSchema as t,defineSwitchPropSchema as n,defineTextPropSchema as r,getSchemaDefaultProps as i}from"../../../../../../utils/schema/schema.mjs";import{HOME_RECOMMEND_DEFAULT_ENABLE_INFINITE as a,HOME_RECOMMEND_DEFAULT_PLAY_COUNT_DELTA as o,HOME_RECOMMEND_DEFAULT_SHOW_EPISODE as s,HOME_RECOMMEND_DEFAULT_SHOW_PLAY_COUNT as c,HOME_RECOMMEND_DEFAULT_SMART_TAG_ENABLED as l,HOME_RECOMMEND_DEFAULT_TITLE as u}from"../../shared/home-recommend-default-config.mjs";import d from"zod";const f=e({smartTagEnabled:n({label:`智能铺设`,defaultValue:l}),title:r({label:`推荐位名称`,defaultValue:u}),showPlayCount:n({label:`显示播放量`,defaultValue:c}),playCountDelta:t({label:`播放量浮动`,defaultValue:o}),showEpisode:n({label:`显示集数`,defaultValue:s}),enableInfinite:n({label:`无限下拉`,defaultValue:a}),smartTagIds:d.array(d.string()).optional(),items:d.array(d.object({contentId:d.string(),coverMode:d.enum([`upload`,`content`]).optional(),coverUrl:d.string().optional(),titleMode:d.enum([`custom`,`content`]).optional(),title:d.string().optional(),showPlayCount:d.boolean().optional(),playCountDelta:d.number().optional(),showEpisode:d.boolean().optional()})).optional()}),p={...i(f),smartTagIds:[],items:[]},m={smartTagEnabled:{type:`boolean`,title:`智能铺设`,default:p.smartTagEnabled},title:{type:`string`,title:`推荐位名称`,default:p.title},showPlayCount:{type:`boolean`,title:`显示播放量`,default:p.showPlayCount},playCountDelta:{type:`number`,title:`播放量浮动`,default:p.playCountDelta},showEpisode:{type:`boolean`,title:`显示集数`,default:p.showEpisode},enableInfinite:{type:`boolean`,title:`无限下拉`,default:p.enableInfinite},smartTagIds:{type:`array`,title:`智能铺设标签`,default:p.smartTagIds,items:{type:`string`,title:`标签 ID`}},items:{type:`array`,title:`推荐项`,default:p.items,items:{type:`object`,title:`推荐项`,properties:{contentId:{type:`string`,title:`内容 ID`},coverMode:{type:`string`,title:`封面模式`},coverUrl:{type:`string`,title:`封面地址`},titleMode:{type:`string`,title:`标题模式`},title:{type:`string`,title:`标题`},showPlayCount:{type:`boolean`,title:`显示播放量`},playCountDelta:{type:`number`,title:`播放量浮动`},showEpisode:{type:`boolean`,title:`显示集数`}}}}};export{p as homeRecommendWaterfallInspectorDefaultProps,f as homeRecommendWaterfallInspectorPropsSchema,m as homeRecommendWaterfallPropsSchema};
@@ -2,18 +2,40 @@
2
2
  import { SchemaHasDefaultValue } from "../../../../../../utils/schema/schema.mjs";
3
3
  import { DefineMaterialOption } from "../../../../../../utils/schema/material.mjs";
4
4
  import "../../../../../../utils/schema/index.mjs";
5
+ import { HomeRecommendWaterfallPrefetchClient } from "./runtime/prefetch-client.mjs";
5
6
  import { HomeRecommendWaterfall } from "./server.mjs";
6
7
  import * as zod from "zod";
7
8
  import * as zod_v4_core0 from "zod/v4/core";
8
9
 
9
10
  //#region components/biz/business/home-recommend/variants/home-recommend-waterfall/material.d.ts
10
- declare const homeRecommendWaterfallMaterial: DefineMaterialOption<typeof HomeRecommendWaterfall, typeof HomeRecommendWaterfall, zod.ZodObject<{
11
- title: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
12
- enableInfinite: zod.ZodOptional<zod.ZodBoolean> & SchemaHasDefaultValue;
11
+ declare const homeRecommendWaterfallMaterial: DefineMaterialOption<typeof HomeRecommendWaterfall, typeof HomeRecommendWaterfallPrefetchClient, zod.ZodObject<{
12
+ smartTagEnabled: zod.ZodBoolean & SchemaHasDefaultValue;
13
+ title: zod.ZodString & SchemaHasDefaultValue;
14
+ showPlayCount: zod.ZodBoolean & SchemaHasDefaultValue;
15
+ playCountDelta: zod.ZodNumber & SchemaHasDefaultValue;
16
+ showEpisode: zod.ZodBoolean & SchemaHasDefaultValue;
17
+ enableInfinite: zod.ZodBoolean & SchemaHasDefaultValue;
18
+ smartTagIds: zod.ZodOptional<zod.ZodArray<zod.ZodString>>;
19
+ items: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
20
+ contentId: zod.ZodString;
21
+ coverMode: zod.ZodOptional<zod.ZodEnum<{
22
+ content: "content";
23
+ upload: "upload";
24
+ }>>;
25
+ coverUrl: zod.ZodOptional<zod.ZodString>;
26
+ titleMode: zod.ZodOptional<zod.ZodEnum<{
27
+ content: "content";
28
+ custom: "custom";
29
+ }>>;
30
+ title: zod.ZodOptional<zod.ZodString>;
31
+ showPlayCount: zod.ZodOptional<zod.ZodBoolean>;
32
+ playCountDelta: zod.ZodOptional<zod.ZodNumber>;
33
+ showEpisode: zod.ZodOptional<zod.ZodBoolean>;
34
+ }, zod_v4_core0.$strip>>>;
13
35
  mode: zod.ZodOptional<zod.ZodEnum<{
14
36
  renderer: "renderer";
15
37
  editor: "editor";
16
38
  }>>;
17
- }, zod_v4_core0.$strip>, "home-recommend-waterfall", "内容组件">;
39
+ }, zod_v4_core0.$strip>, "home-recommend-waterfall">;
18
40
  //#endregion
19
41
  export { homeRecommendWaterfallMaterial };