@funhub/platform 0.1.52 → 0.1.55
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.
- package/dist/biz.d.mts +8 -10
- package/dist/biz.mjs +1 -1
- package/dist/components/biz/business/detail/materials/registry.d.mts +1 -0
- package/dist/components/biz/business/detail/materials/runtime-context-provider.mjs +2 -0
- package/dist/components/biz/business/detail/materials/video-detail-actions/client.d.mts +0 -2
- package/dist/components/biz/business/detail/materials/video-detail-actions/client.mjs +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-actions/schema.d.mts +1 -5
- package/dist/components/biz/business/detail/materials/video-detail-info/client.d.mts +0 -4
- package/dist/components/biz/business/detail/materials/video-detail-info/client.mjs +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-info/schema.d.mts +1 -7
- package/dist/components/biz/business/detail/materials/video-detail-info-title/client.d.mts +0 -1
- package/dist/components/biz/business/detail/materials/video-detail-info-title/client.mjs +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-info-title/schema.d.mts +1 -4
- package/dist/components/biz/business/detail/materials/video-detail-info-title-tags-episodes/client.d.mts +0 -3
- package/dist/components/biz/business/detail/materials/video-detail-info-title-tags-episodes/client.mjs +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-info-title-tags-episodes/schema.d.mts +1 -6
- package/dist/components/biz/business/detail/materials/video-detail-player/client.d.mts +0 -3
- package/dist/components/biz/business/detail/materials/video-detail-player/client.mjs +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-player/schema.d.mts +1 -6
- package/dist/components/biz/business/detail/materials/video-detail-recommend/client.d.mts +1 -2
- package/dist/components/biz/business/detail/materials/video-detail-recommend/client.mjs +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-recommend/material.d.mts +1 -0
- package/dist/components/biz/business/detail/materials/video-detail-recommend/schema.d.mts +2 -3
- package/dist/components/biz/business/detail/materials/video-detail-recommend/schema.mjs +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-recommend/utils.mjs +1 -1
- package/dist/components/biz/business/home-recommend/index.d.mts +4 -6
- package/dist/components/biz/business/home-recommend/shared/home-recommend-base.mjs +1 -1
- package/dist/components/biz/business/home-recommend/shared/home-recommend-default-config.mjs +2 -0
- package/dist/components/biz/business/home-recommend/shared/home-recommend-feed-mode.mjs +2 -0
- package/dist/components/biz/business/home-recommend/shared/home-recommend-preview.mjs +1 -1
- package/dist/components/biz/business/home-recommend/shared/home-recommend-server-data.mjs +2 -0
- package/dist/components/biz/business/home-recommend/shared/home-recommend-video-detail.mjs +2 -0
- package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/index.d.mts +2 -3
- package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/index.mjs +1 -1
- package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/inspector-schema.d.mts +35 -1
- package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/inspector-schema.mjs +1 -1
- package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/material.d.mts +28 -2
- package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/material.mjs +1 -1
- package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/runtime/prefetch-client.d.mts +27 -0
- package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/runtime/prefetch-client.mjs +2 -0
- package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/schema/index.mjs +1 -1
- package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/server.d.mts +3 -6
- package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/server.mjs +1 -1
- package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/index.d.mts +2 -3
- package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/index.mjs +1 -1
- package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/inspector-schema.d.mts +30 -2
- package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/inspector-schema.mjs +1 -1
- package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/material.d.mts +25 -3
- package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/material.mjs +1 -1
- package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/runtime/prefetch-client.d.mts +27 -0
- package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/runtime/prefetch-client.mjs +2 -0
- package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/schema/index.mjs +1 -1
- package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/server.d.mts +3 -6
- package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/server.mjs +1 -1
- package/dist/components/biz/business/index.d.mts +11 -13
- package/dist/components/biz/utils/transformers/data.mjs +1 -1
- package/dist/components/common/cards/mini-three-card.mjs +1 -1
- package/dist/components/common/list/post-list/post-list.mjs +1 -1
- package/dist/components/common/list/user-activity-list/user-activity-list.d.mts +1 -1
- package/dist/components/common/list/user-activity-list/user-activity-list.mjs +1 -1
- package/dist/components/common/list/video-list/video-list.mjs +1 -1
- package/dist/components/pages/video-detail/video-detail-client.mjs +1 -1
- package/dist/components/ui/badge.d.mts +1 -1
- package/dist/components/ui/button.d.mts +2 -2
- package/dist/i18n/locales/en.mjs +1 -1
- package/dist/i18n/locales/zh-CN.mjs +1 -1
- package/dist/service/content-batch-get-video-detail.d.mts +21 -0
- package/dist/service/content-batch-get-video-detail.mjs +2 -0
- package/dist/service.d.mts +2 -1
- package/dist/service.mjs +1 -1
- package/package.json +1 -1
- package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/defaults/default-props.d.mts +0 -10
- package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/defaults/default-props.mjs +0 -2
- package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/runtime/client.d.mts +0 -20
- package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/runtime/client.mjs +0 -2
- package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/schema/props.schema.mjs +0 -2
- package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/defaults/default-props.d.mts +0 -8
- package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/defaults/default-props.mjs +0 -2
- package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/runtime/client.d.mts +0 -20
- package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/runtime/client.mjs +0 -2
- package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/schema/props.schema.mjs +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{
|
|
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};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
const
|
|
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};
|
package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/index.d.mts
CHANGED
|
@@ -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{
|
|
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
|
-
|
|
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,
|
|
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};
|
package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/material.d.mts
CHANGED
|
@@ -2,15 +2,41 @@
|
|
|
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
|
|
11
|
-
|
|
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";
|
package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/material.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{defineMaterial as e}from"../../../../../../utils/schema/material.mjs";import{homeRecommendGridInspectorPropsSchema as
|
|
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};
|
package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/schema/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{
|
|
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};
|
package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/server.d.mts
CHANGED
|
@@ -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
|
|
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{
|
|
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};
|
package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/index.d.mts
CHANGED
|
@@ -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";
|
package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import e from"./runtime/client.mjs";import{
|
|
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
|
-
|
|
12
|
-
|
|
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,
|
|
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};
|
package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/material.d.mts
CHANGED
|
@@ -2,14 +2,36 @@
|
|
|
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
|
|
11
|
-
|
|
12
|
-
|
|
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";
|
package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/material.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{defineMaterial as e}from"../../../../../../utils/schema/material.mjs";import{homeRecommendWaterfallInspectorPropsSchema as
|
|
2
|
+
import{defineMaterial as e}from"../../../../../../utils/schema/material.mjs";import t from"./runtime/prefetch-client.mjs";import{homeRecommendWaterfallInspectorPropsSchema as n}from"./inspector-schema.mjs";import{HomeRecommendWaterfall as r}from"./server.mjs";const i=e({type:`home-recommend-waterfall`,name:`瀑布流`,icon:`/static/components-thumb/grid_waterfall_two_column.png`,category:`内容组件`,serverComponent:r,clientComponent:t,propsSchema:n});export{i as homeRecommendWaterfallMaterial};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
|
|
2
|
+
import { MaterialComponentMode } from "../../../../../../../utils/schema/schema.mjs";
|
|
3
|
+
import "../../../../../../../utils/schema/index.mjs";
|
|
4
|
+
import { HomeRecommendData } from "../../../types.mjs";
|
|
5
|
+
import { HomeRecommendWaterfallInspectorProps } from "../inspector-schema.mjs";
|
|
6
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
7
|
+
|
|
8
|
+
//#region components/biz/business/home-recommend/variants/home-recommend-waterfall/runtime/prefetch-client.d.ts
|
|
9
|
+
interface HomeRecommendWaterfallPrefetchClientProps extends Partial<Omit<HomeRecommendWaterfallInspectorProps, 'mode'>> {
|
|
10
|
+
/** 预取数据(可选)。 */
|
|
11
|
+
prefetchData?: HomeRecommendData;
|
|
12
|
+
/** 兼容内容块转换链路的数据字段。 */
|
|
13
|
+
data?: HomeRecommendData;
|
|
14
|
+
/** 渲染模式。 */
|
|
15
|
+
mode?: MaterialComponentMode;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* 首页推荐瀑布流布局(支持预取数据)。
|
|
19
|
+
*/
|
|
20
|
+
declare function HomeRecommendWaterfallPrefetchClient({
|
|
21
|
+
prefetchData,
|
|
22
|
+
data,
|
|
23
|
+
mode,
|
|
24
|
+
...propsConfig
|
|
25
|
+
}: HomeRecommendWaterfallPrefetchClientProps): react_jsx_runtime0.JSX.Element;
|
|
26
|
+
//#endregion
|
|
27
|
+
export { HomeRecommendWaterfallPrefetchClient };
|
|
@@ -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:`waterfall`,schemaTitle:l.title,enableInfinite:l.enableInfinite,smartTagEnabled:l.smartTagEnabled,items:l.items}):u,[c,u,l.enableInfinite,l.items,l.smartTagEnabled,l.title]);return r(`div`,{className:c?`pointer-events-none`:void 0,children:r(t,{variant:`waterfall`,props:l,data:d,mode:o})})}export{i as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{
|
|
2
|
+
import{homeRecommendWaterfallPropsSchema 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};
|
package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/server.d.mts
CHANGED
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
|
|
2
|
-
import { HomeRecommendData } from "../../types.mjs";
|
|
3
2
|
import { HomeRecommendWaterfallInspectorProps } 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-waterfall/server.d.ts
|
|
7
|
-
/** HomeRecommendWaterfall 物料组件 props
|
|
8
|
-
type HomeRecommendWaterfallProps = HomeRecommendWaterfallInspectorProps
|
|
9
|
-
/** 推荐位数据 */data?: HomeRecommendData;
|
|
10
|
-
};
|
|
6
|
+
/** HomeRecommendWaterfall 物料组件 props。 */
|
|
7
|
+
type HomeRecommendWaterfallProps = HomeRecommendWaterfallInspectorProps;
|
|
11
8
|
/**
|
|
12
9
|
* HomeRecommendWaterfall 物料组件
|
|
13
10
|
* 接收 inspector 可编辑的 props,转换为 BaseComponentProps 传给 runtime client
|
|
14
11
|
*/
|
|
15
|
-
declare function HomeRecommendWaterfall(props: HomeRecommendWaterfallProps): react_jsx_runtime0.JSX.Element
|
|
12
|
+
declare function HomeRecommendWaterfall(props: HomeRecommendWaterfallProps): Promise<react_jsx_runtime0.JSX.Element>;
|
|
16
13
|
//#endregion
|
|
17
14
|
export { HomeRecommendWaterfall };
|
package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/server.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import e from"./runtime/client.mjs";import{jsx as
|
|
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(e){let t=Array.isArray(e)?e.length:0;return t>0?t:16}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.items)});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 HomeRecommendWaterfall};
|
|
@@ -41,16 +41,14 @@ import { defaultProps as defaultProps$9 } from "./fullscreen-feed/variants/fulls
|
|
|
41
41
|
import { FullscreenVideoFeedClient } from "./fullscreen-feed/variants/fullscreen-video-feed/runtime/client.mjs";
|
|
42
42
|
import { schema as schema$9 } from "./fullscreen-feed/variants/fullscreen-video-feed/schema/index.mjs";
|
|
43
43
|
import "./fullscreen-feed/index.mjs";
|
|
44
|
-
import { defaultProps as defaultProps$10 } from "./home-recommend/variants/home-recommend-grid/defaults/default-props.mjs";
|
|
45
|
-
import { HomeRecommendGridClient } from "./home-recommend/variants/home-recommend-grid/runtime/client.mjs";
|
|
46
|
-
import { schema as schema$10 } from "./home-recommend/variants/home-recommend-grid/schema/index.mjs";
|
|
47
44
|
import { homeRecommendGridInspectorDefaultProps, homeRecommendGridInspectorPropsSchema } from "./home-recommend/variants/home-recommend-grid/inspector-schema.mjs";
|
|
45
|
+
import { HomeRecommendGridPrefetchClient } from "./home-recommend/variants/home-recommend-grid/runtime/prefetch-client.mjs";
|
|
46
|
+
import { schema as schema$10 } from "./home-recommend/variants/home-recommend-grid/schema/index.mjs";
|
|
48
47
|
import { HomeRecommendGrid } from "./home-recommend/variants/home-recommend-grid/server.mjs";
|
|
49
48
|
import { homeRecommendGridMaterial } from "./home-recommend/variants/home-recommend-grid/material.mjs";
|
|
50
|
-
import { defaultProps as defaultProps$11 } from "./home-recommend/variants/home-recommend-waterfall/defaults/default-props.mjs";
|
|
51
|
-
import { HomeRecommendWaterfallClient } from "./home-recommend/variants/home-recommend-waterfall/runtime/client.mjs";
|
|
52
|
-
import { schema as schema$11 } from "./home-recommend/variants/home-recommend-waterfall/schema/index.mjs";
|
|
53
49
|
import { homeRecommendWaterfallInspectorDefaultProps, homeRecommendWaterfallInspectorPropsSchema } from "./home-recommend/variants/home-recommend-waterfall/inspector-schema.mjs";
|
|
50
|
+
import { HomeRecommendWaterfallPrefetchClient } from "./home-recommend/variants/home-recommend-waterfall/runtime/prefetch-client.mjs";
|
|
51
|
+
import { schema as schema$11 } from "./home-recommend/variants/home-recommend-waterfall/schema/index.mjs";
|
|
54
52
|
import { HomeRecommendWaterfall } from "./home-recommend/variants/home-recommend-waterfall/server.mjs";
|
|
55
53
|
import { homeRecommendWaterfallMaterial } from "./home-recommend/variants/home-recommend-waterfall/material.mjs";
|
|
56
54
|
import "./home-recommend/index.mjs";
|
|
@@ -59,11 +57,11 @@ import { MarqueeClient, MarqueeProps } from "./marquee/client.mjs";
|
|
|
59
57
|
import { MarqueeServer } from "./marquee/server.mjs";
|
|
60
58
|
import { marqueeMaterial } from "./marquee/material.mjs";
|
|
61
59
|
import "./marquee/index.mjs";
|
|
62
|
-
import { defaultProps as defaultProps$
|
|
60
|
+
import { defaultProps as defaultProps$10 } from "./nav-bar/variants/basic-nav-bar/defaults/default-props.mjs";
|
|
63
61
|
import { BasicNavBarClient } from "./nav-bar/variants/basic-nav-bar/runtime/client.mjs";
|
|
64
62
|
import { schema as schema$12 } from "./nav-bar/variants/basic-nav-bar/schema/index.mjs";
|
|
65
63
|
import "./nav-bar/index.mjs";
|
|
66
|
-
import { defaultProps as defaultProps$
|
|
64
|
+
import { defaultProps as defaultProps$11 } from "./post-card/variants/basic-post-card/defaults/default-props.mjs";
|
|
67
65
|
import { BasicPostCardClient } from "./post-card/variants/basic-post-card/runtime/client.mjs";
|
|
68
66
|
import { schema as schema$13 } from "./post-card/variants/basic-post-card/schema/index.mjs";
|
|
69
67
|
import "./post-card/index.mjs";
|
|
@@ -86,20 +84,20 @@ import { PublishTab, PublishTabProps, PublishTabUserInfo } from "./profile/profi
|
|
|
86
84
|
import { BuildPublishTabPrefetchParams, PublishTabServer, buildPublishTabPrefetch } from "./profile/profile-main/tabs/publish-tab/server.mjs";
|
|
87
85
|
import { profileMainCollectCollectionTabOptions, profileMainCollectTabOptions, profileMainHistoryTabOptions, profileMainLikeTabOptions, profileMainMineTabOptions, profileMainProfileTabOptions, profileMainTabOptions } from "./profile/profile-main/variants.mjs";
|
|
88
86
|
import "./profile/index.mjs";
|
|
89
|
-
import { defaultProps as defaultProps$
|
|
87
|
+
import { defaultProps as defaultProps$12 } from "./recommended-users/variants/basic-recommended-users/defaults/default-props.mjs";
|
|
90
88
|
import { BasicRecommendedUsersClient } from "./recommended-users/variants/basic-recommended-users/runtime/client.mjs";
|
|
91
89
|
import { schema as schema$14 } from "./recommended-users/variants/basic-recommended-users/schema/index.mjs";
|
|
92
90
|
import "./recommended-users/index.mjs";
|
|
93
|
-
import { defaultProps as defaultProps$
|
|
91
|
+
import { defaultProps as defaultProps$13 } from "./search-bar/variants/basic-search-bar/defaults/default-props.mjs";
|
|
94
92
|
import { BasicSearchBarClient } from "./search-bar/variants/basic-search-bar/runtime/client.mjs";
|
|
95
93
|
import { schema as schema$15 } from "./search-bar/variants/basic-search-bar/schema/index.mjs";
|
|
96
|
-
import { defaultProps as defaultProps$
|
|
94
|
+
import { defaultProps as defaultProps$14 } from "./search-bar/variants/detail-search-bar/defaults/default-props.mjs";
|
|
97
95
|
import { DetailSearchBarClient } from "./search-bar/variants/detail-search-bar/runtime/client.mjs";
|
|
98
96
|
import { schema as schema$16 } from "./search-bar/variants/detail-search-bar/schema/index.mjs";
|
|
99
|
-
import { defaultProps as defaultProps$
|
|
97
|
+
import { defaultProps as defaultProps$15 } from "./search-bar/variants/filter-search-bar/defaults/default-props.mjs";
|
|
100
98
|
import { FilterSearchBarClient } from "./search-bar/variants/filter-search-bar/runtime/client.mjs";
|
|
101
99
|
import { schema as schema$17 } from "./search-bar/variants/filter-search-bar/schema/index.mjs";
|
|
102
|
-
import { defaultProps as defaultProps$
|
|
100
|
+
import { defaultProps as defaultProps$16 } from "./search-bar/variants/tag-search-bar/defaults/default-props.mjs";
|
|
103
101
|
import { TagSearchBarClient } from "./search-bar/variants/tag-search-bar/runtime/client.mjs";
|
|
104
102
|
import { schema as schema$18 } from "./search-bar/variants/tag-search-bar/schema/index.mjs";
|
|
105
103
|
import "./search-bar/index.mjs";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import e from"../../business/banner/variants/basic-banner/runtime/client.mjs";import{schema as t}from"../../business/banner/variants/basic-banner/schema/index.mjs";import n from"../../business/feature-grid/variants/basic-feature-grid/runtime/client.mjs";import{schema as r}from"../../business/feature-grid/variants/basic-feature-grid/schema/index.mjs";import i from"../../business/fullscreen-feed/variants/fullscreen-post-feed/runtime/client.mjs";import{schema as a}from"../../business/fullscreen-feed/variants/fullscreen-post-feed/schema/index.mjs";import o from"../../business/fullscreen-feed/variants/fullscreen-video-feed/runtime/client.mjs";import{schema as s}from"../../business/fullscreen-feed/variants/fullscreen-video-feed/schema/index.mjs";import c from"../../business/home-recommend/variants/home-recommend-grid/runtime/client.mjs";import{schema as l}from"../../business/home-recommend/variants/home-recommend-grid/schema/index.mjs";import u from"../../business/home-recommend/variants/home-recommend-waterfall/runtime/client.mjs";import{schema as d}from"../../business/home-recommend/variants/home-recommend-waterfall/schema/index.mjs";import f from"../../business/post-card/variants/basic-post-card/runtime/client.mjs";import{schema as p}from"../../business/post-card/variants/basic-post-card/schema/index.mjs";import m from"../../business/recommended-users/variants/basic-recommended-users/runtime/client.mjs";import{schema as h}from"../../business/recommended-users/variants/basic-recommended-users/schema/index.mjs";let g=function(e){return e[e.Banner=1]=`Banner`,e[e.CardGrid=2]=`CardGrid`,e[e.FeatureGrid=3]=`FeatureGrid`,e[e.RecommendedUsers=4]=`RecommendedUsers`,e}({});const _={[g.Banner]:{schemaName:`BasicBannerSchema`,componentName:`BasicBanner`},[g.FeatureGrid]:{schemaName:`BasicFeatureGridSchema`,componentName:`BasicFeatureGrid`},[g.RecommendedUsers]:{schemaName:`BasicRecommendedUsersSchema`,componentName:`BasicRecommendedUsers`}},v={1:{schemaName:`HomeRecommendGridSchema`,componentName:`HomeRecommendGrid`},2:{schemaName:`HomeRecommendWaterfallSchema`,componentName:`HomeRecommendWaterfall`},3:{schemaName:`HomeRecommendGridSchema`,componentName:`HomeRecommendGrid`},4:{schemaName:`HomeRecommendGridSchema`,componentName:`HomeRecommendGrid`},5:{schemaName:`HomeRecommendWaterfallSchema`,componentName:`HomeRecommendWaterfall`},6:{schemaName:`FullscreenVideoFeedSchema`,componentName:`FullscreenVideoClient`}},y={schemaName:`HomeRecommendGridSchema`,componentName:`HomeRecommendGrid`},b={6:{schemaName:`FullscreenPostFeedSchema`,componentName:`FullscreenFeedClient`}},x={schemaName:`BasicPostCardSchema`,componentName:`BasicPostCard`},S={BasicBannerSchema:t,BasicFeatureGridSchema:r,BasicPostCardSchema:p,BasicRecommendedUsersSchema:h,FullscreenPostFeedSchema:a,FullscreenVideoFeedSchema:s,HomeRecommendGridSchema:l,HomeRecommendWaterfallSchema:d},C={BasicBanner:e,BasicFeatureGrid:n,BasicPostCard:f,BasicRecommendedUsers:m,FullscreenFeedClient:i,FullscreenVideoClient:o,HomeRecommendGrid:c,HomeRecommendWaterfall:u};function w(e,t){return e.type===g.CardGrid?t?v[e.show_style]??y:b[e.show_style]??x:_[e.type]}function T(e,t){let n=w(e,t),r=S[n.schemaName];if(!r)return console.warn(`[extractDataByComponentType] 未找到 Schema: ${n.schemaName}`),null;let i=C[n.componentName];if(!i)return console.warn(`[extractDataByComponentType] 未找到组件: ${n.componentName}`),null;let a=r.dataSchema?.dataBinding?.field;if(!a)return console.warn(`[extractDataByComponentType] Schema ${n.schemaName} 缺少 dataBinding.field`),null;let o=e.data?.[a],s=Array.isArray(o)?o:[],c={component:i,data:{title:e.cn_name,list:s,icons:e.data?.icons??[],block_id:String(e.id??``),channel_id:String(e.channel_id??``),show_style:e.show_style}};return e.data?.cursor&&(c.data.cursor=String(e.data?.cursor??``)),e.show_style===6&&(c.data.bottom=56,c.data.top=42),c}function E(e,t){return!Array.isArray(e)||e.length===0?[]:e.map(e=>T(e,t)).filter(e=>e!==null)}export{g as ComponentType,E as extractDataByComponentType};
|
|
2
|
+
import e from"../../business/banner/variants/basic-banner/runtime/client.mjs";import{schema as t}from"../../business/banner/variants/basic-banner/schema/index.mjs";import n from"../../business/feature-grid/variants/basic-feature-grid/runtime/client.mjs";import{schema as r}from"../../business/feature-grid/variants/basic-feature-grid/schema/index.mjs";import i from"../../business/fullscreen-feed/variants/fullscreen-post-feed/runtime/client.mjs";import{schema as a}from"../../business/fullscreen-feed/variants/fullscreen-post-feed/schema/index.mjs";import o from"../../business/fullscreen-feed/variants/fullscreen-video-feed/runtime/client.mjs";import{schema as s}from"../../business/fullscreen-feed/variants/fullscreen-video-feed/schema/index.mjs";import c from"../../business/home-recommend/variants/home-recommend-grid/runtime/prefetch-client.mjs";import{schema as l}from"../../business/home-recommend/variants/home-recommend-grid/schema/index.mjs";import u from"../../business/home-recommend/variants/home-recommend-waterfall/runtime/prefetch-client.mjs";import{schema as d}from"../../business/home-recommend/variants/home-recommend-waterfall/schema/index.mjs";import f from"../../business/post-card/variants/basic-post-card/runtime/client.mjs";import{schema as p}from"../../business/post-card/variants/basic-post-card/schema/index.mjs";import m from"../../business/recommended-users/variants/basic-recommended-users/runtime/client.mjs";import{schema as h}from"../../business/recommended-users/variants/basic-recommended-users/schema/index.mjs";let g=function(e){return e[e.Banner=1]=`Banner`,e[e.CardGrid=2]=`CardGrid`,e[e.FeatureGrid=3]=`FeatureGrid`,e[e.RecommendedUsers=4]=`RecommendedUsers`,e}({});const _={[g.Banner]:{schemaName:`BasicBannerSchema`,componentName:`BasicBanner`},[g.FeatureGrid]:{schemaName:`BasicFeatureGridSchema`,componentName:`BasicFeatureGrid`},[g.RecommendedUsers]:{schemaName:`BasicRecommendedUsersSchema`,componentName:`BasicRecommendedUsers`}},v={1:{schemaName:`HomeRecommendGridSchema`,componentName:`HomeRecommendGrid`},2:{schemaName:`HomeRecommendWaterfallSchema`,componentName:`HomeRecommendWaterfall`},3:{schemaName:`HomeRecommendGridSchema`,componentName:`HomeRecommendGrid`},4:{schemaName:`HomeRecommendGridSchema`,componentName:`HomeRecommendGrid`},5:{schemaName:`HomeRecommendWaterfallSchema`,componentName:`HomeRecommendWaterfall`},6:{schemaName:`FullscreenVideoFeedSchema`,componentName:`FullscreenVideoClient`}},y={schemaName:`HomeRecommendGridSchema`,componentName:`HomeRecommendGrid`},b={6:{schemaName:`FullscreenPostFeedSchema`,componentName:`FullscreenFeedClient`}},x={schemaName:`BasicPostCardSchema`,componentName:`BasicPostCard`},S={BasicBannerSchema:t,BasicFeatureGridSchema:r,BasicPostCardSchema:p,BasicRecommendedUsersSchema:h,FullscreenPostFeedSchema:a,FullscreenVideoFeedSchema:s,HomeRecommendGridSchema:l,HomeRecommendWaterfallSchema:d},C={BasicBanner:e,BasicFeatureGrid:n,BasicPostCard:f,BasicRecommendedUsers:m,FullscreenFeedClient:i,FullscreenVideoClient:o,HomeRecommendGrid:c,HomeRecommendWaterfall:u};function w(e,t){return e.type===g.CardGrid?t?v[e.show_style]??y:b[e.show_style]??x:_[e.type]}function T(e,t){let n=w(e,t),r=S[n.schemaName];if(!r)return console.warn(`[extractDataByComponentType] 未找到 Schema: ${n.schemaName}`),null;let i=C[n.componentName];if(!i)return console.warn(`[extractDataByComponentType] 未找到组件: ${n.componentName}`),null;let a=r.dataSchema?.dataBinding?.field;if(!a)return console.warn(`[extractDataByComponentType] Schema ${n.schemaName} 缺少 dataBinding.field`),null;let o=e.data?.[a],s=Array.isArray(o)?o:[],c={component:i,data:{title:e.cn_name,list:s,icons:e.data?.icons??[],block_id:String(e.id??``),channel_id:String(e.channel_id??``),show_style:e.show_style}};return e.data?.cursor&&(c.data.cursor=String(e.data?.cursor??``)),e.show_style===6&&(c.data.bottom=56,c.data.top=42),c}function E(e,t){return!Array.isArray(e)||e.length===0?[]:e.map(e=>T(e,t)).filter(e=>e!==null)}export{g as ComponentType,E as extractDataByComponentType};
|