@funhub/platform 0.1.38 → 0.1.41
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/README.md +6 -0
- package/dist/common.d.mts +1 -2
- package/dist/common.mjs +1 -1
- package/dist/components/biz/business/banner/variants/basic-banner/inspector-schema.d.mts +4 -0
- package/dist/components/biz/business/banner/variants/basic-banner/material.d.mts +4 -0
- package/dist/components/biz/business/banner/variants/basic-banner/runtime/client.d.mts +6 -1
- package/dist/components/biz/business/banner/variants/basic-banner/runtime/client.mjs +1 -1
- package/dist/components/biz/business/banner/variants/basic-banner/server.mjs +1 -1
- package/dist/components/biz/business/banner-carousel/client.mjs +1 -1
- package/dist/components/biz/business/banner-carousel/material.d.mts +4 -0
- package/dist/components/biz/business/banner-carousel/schema.d.mts +4 -0
- package/dist/components/biz/business/banner-carousel/server.mjs +1 -1
- package/dist/components/biz/business/channel-list/client.mjs +1 -1
- package/dist/components/biz/business/channel-list/material.d.mts +4 -0
- package/dist/components/biz/business/channel-list/schema.d.mts +4 -0
- package/dist/components/biz/business/detail/detail-operate.mjs +1 -1
- package/dist/components/biz/business/detail/materials/registry.d.mts +30 -3
- package/dist/components/biz/business/detail/materials/video-detail-actions/client.d.mts +2 -1
- package/dist/components/biz/business/detail/materials/video-detail-actions/client.mjs +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-actions/material.d.mts +6 -1
- package/dist/components/biz/business/detail/materials/video-detail-actions/schema.d.mts +6 -1
- package/dist/components/biz/business/detail/materials/video-detail-actions/server.mjs +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-info/client.d.mts +2 -1
- package/dist/components/biz/business/detail/materials/video-detail-info/client.mjs +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-info/material.d.mts +4 -0
- package/dist/components/biz/business/detail/materials/video-detail-info/schema.d.mts +4 -0
- package/dist/components/biz/business/detail/materials/video-detail-info/server.mjs +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-info-title/client.d.mts +2 -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/material.d.mts +6 -1
- package/dist/components/biz/business/detail/materials/video-detail-info-title/schema.d.mts +6 -1
- package/dist/components/biz/business/detail/materials/video-detail-info-title/server.mjs +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-info-title-tags-episodes/client.d.mts +2 -1
- 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/material.d.mts +4 -0
- package/dist/components/biz/business/detail/materials/video-detail-info-title-tags-episodes/schema.d.mts +4 -0
- package/dist/components/biz/business/detail/materials/video-detail-info-title-tags-episodes/server.mjs +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-player/client.d.mts +2 -1
- package/dist/components/biz/business/detail/materials/video-detail-player/client.mjs +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-player/material.d.mts +6 -1
- package/dist/components/biz/business/detail/materials/video-detail-player/schema.d.mts +6 -1
- package/dist/components/biz/business/detail/materials/video-detail-player/server.mjs +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-recommend/client.d.mts +2 -1
- 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 +4 -0
- package/dist/components/biz/business/detail/materials/video-detail-recommend/schema.d.mts +4 -0
- package/dist/components/biz/business/detail/materials/video-detail-recommend/server.mjs +1 -1
- package/dist/components/biz/business/detail/video-hero.mjs +1 -1
- package/dist/components/biz/business/floating-ball/client.mjs +1 -1
- package/dist/components/biz/business/floating-ball/material.d.mts +4 -0
- package/dist/components/biz/business/floating-ball/schema.d.mts +4 -0
- package/dist/components/biz/business/floating-ball/server.mjs +1 -1
- package/dist/components/biz/business/header-search/header-avatar-icon/client.d.mts +3 -1
- package/dist/components/biz/business/header-search/header-avatar-icon/client.mjs +1 -1
- package/dist/components/biz/business/header-search/header-avatar-icon/material.d.mts +6 -1
- package/dist/components/biz/business/header-search/header-avatar-icon/schema.d.mts +6 -1
- package/dist/components/biz/business/header-search/header-avatar-icon/server.mjs +1 -1
- package/dist/components/biz/business/header-search/header-avatar-logo-search/client.mjs +1 -1
- package/dist/components/biz/business/header-search/header-avatar-logo-search/material.d.mts +4 -0
- package/dist/components/biz/business/header-search/header-avatar-logo-search/schema.d.mts +4 -0
- package/dist/components/biz/business/header-search/header-avatar-logo-search/server.mjs +1 -1
- package/dist/components/biz/business/header-search/header-avatar-logo-search-icon/client.mjs +1 -1
- package/dist/components/biz/business/header-search/header-avatar-logo-search-icon/material.d.mts +4 -0
- package/dist/components/biz/business/header-search/header-avatar-logo-search-icon/schema.d.mts +4 -0
- package/dist/components/biz/business/header-search/header-avatar-logo-search-icon/server.mjs +1 -1
- package/dist/components/biz/business/header-search/header-logo-search/client.mjs +1 -1
- package/dist/components/biz/business/header-search/header-logo-search/material.d.mts +4 -0
- package/dist/components/biz/business/header-search/header-logo-search/schema.d.mts +4 -0
- package/dist/components/biz/business/header-search/header-logo-search/server.mjs +1 -1
- package/dist/components/biz/business/header-search/header-search/client.d.mts +3 -1
- package/dist/components/biz/business/header-search/header-search/client.mjs +1 -1
- package/dist/components/biz/business/header-search/header-search/material.d.mts +6 -1
- package/dist/components/biz/business/header-search/header-search/schema.d.mts +6 -1
- package/dist/components/biz/business/header-search/header-search/server.mjs +1 -1
- package/dist/components/biz/business/home-recommend/shared/home-recommend-base.mjs +1 -1
- package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/inspector-schema.d.mts +4 -0
- package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/material.d.mts +4 -0
- package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/runtime/client.d.mts +8 -1
- package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/runtime/client.mjs +1 -1
- 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/inspector-schema.d.mts +4 -0
- package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/material.d.mts +4 -0
- package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/runtime/client.d.mts +8 -1
- package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/runtime/client.mjs +1 -1
- package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/server.mjs +1 -1
- package/dist/components/biz/business/large-feature-grid/card-item.mjs +1 -1
- package/dist/components/biz/business/large-feature-grid/client.d.mts +15 -0
- package/dist/components/biz/business/large-feature-grid/client.mjs +1 -1
- package/dist/components/biz/business/large-feature-grid/material.d.mts +34 -4
- package/dist/components/biz/business/large-feature-grid/schema.d.mts +42 -0
- package/dist/components/biz/business/large-feature-grid/server.d.mts +15 -0
- package/dist/components/biz/business/large-feature-grid/server.mjs +1 -1
- package/dist/components/biz/business/marquee/client.mjs +1 -1
- package/dist/components/biz/business/marquee/material.d.mts +4 -0
- package/dist/components/biz/business/marquee/schema.d.mts +4 -0
- package/dist/components/biz/business/marquee/server.mjs +1 -1
- package/dist/components/biz/business/profile/profile-header/client.d.mts +2 -1
- package/dist/components/biz/business/profile/profile-header/client.mjs +1 -1
- package/dist/components/biz/business/profile/profile-header/material.d.mts +18 -2
- package/dist/components/biz/business/profile/profile-header/material.mjs +1 -1
- package/dist/components/biz/business/profile/profile-header/schema.d.mts +7 -2
- package/dist/components/biz/business/profile/profile-header/server.d.mts +4 -1
- package/dist/components/biz/business/profile/profile-header/server.mjs +1 -1
- package/dist/components/biz/business/profile/profile-header/user-profile-cover-background.mjs +1 -1
- package/dist/components/biz/business/profile/profile-main/client.d.mts +2 -1
- package/dist/components/biz/business/profile/profile-main/client.mjs +1 -1
- package/dist/components/biz/business/profile/profile-main/material.d.mts +6 -1
- package/dist/components/biz/business/profile/profile-main/schema.d.mts +7 -2
- package/dist/components/biz/business/profile/profile-main/server.mjs +1 -1
- package/dist/components/biz/business/profile/profile-main/tabs/collect-tab/client.d.mts +5 -0
- package/dist/components/biz/business/profile/profile-main/tabs/collect-tab/client.mjs +1 -1
- package/dist/components/biz/business/profile/profile-main/tabs/collect-tab/server.mjs +1 -1
- package/dist/components/biz/business/profile/profile-main/tabs/history-tab/client.d.mts +5 -0
- package/dist/components/biz/business/profile/profile-main/tabs/history-tab/client.mjs +1 -1
- package/dist/components/biz/business/profile/profile-main/tabs/history-tab/server.mjs +1 -1
- package/dist/components/biz/business/profile/profile-main/tabs/like-tab/client.d.mts +5 -0
- package/dist/components/biz/business/profile/profile-main/tabs/like-tab/client.mjs +1 -1
- package/dist/components/biz/business/profile/profile-main/tabs/like-tab/server.mjs +1 -1
- package/dist/components/biz/business/profile/profile-main/tabs/publish-tab/client.d.mts +5 -0
- package/dist/components/biz/business/profile/profile-main/tabs/publish-tab/client.mjs +1 -1
- package/dist/components/biz/business/profile/profile-main/tabs/publish-tab/server.mjs +1 -1
- package/dist/components/biz/business/search-history/client.mjs +1 -1
- package/dist/components/biz/business/search-history/material.d.mts +4 -0
- package/dist/components/biz/business/search-history/schema.d.mts +4 -0
- package/dist/components/biz/business/search-history/server.mjs +1 -1
- package/dist/components/biz/business/search-input/client.mjs +1 -1
- package/dist/components/biz/business/search-input/material.d.mts +4 -0
- package/dist/components/biz/business/search-input/schema.d.mts +4 -0
- package/dist/components/biz/business/search-input/server.mjs +1 -1
- package/dist/components/biz/business/shortcut-grid/client.mjs +1 -1
- package/dist/components/biz/business/shortcut-grid/material.d.mts +4 -0
- package/dist/components/biz/business/shortcut-grid/schema.d.mts +4 -0
- package/dist/components/biz/business/shortcut-grid/server.mjs +1 -1
- package/dist/components/biz/business/tab-bar/client.mjs +1 -1
- package/dist/components/biz/business/tab-bar/material.d.mts +9 -1
- package/dist/components/biz/business/tab-bar/schema.d.mts +9 -1
- package/dist/components/biz/business/tab-bar/server.mjs +1 -1
- package/dist/components/biz/business/text-recommend/client.mjs +1 -1
- package/dist/components/biz/business/text-recommend/material.d.mts +4 -0
- package/dist/components/biz/business/text-recommend/schema.d.mts +4 -0
- package/dist/components/biz/business/text-recommend/server.mjs +1 -1
- package/dist/components/biz/business/video-horizontal-list/client.mjs +1 -1
- package/dist/components/biz/business/video-horizontal-list/material.d.mts +4 -0
- package/dist/components/biz/business/video-horizontal-list/schema.d.mts +4 -0
- package/dist/components/biz/business/video-horizontal-list/server.mjs +1 -1
- package/dist/components/biz/example/button/client.mjs +1 -1
- package/dist/components/biz/example/button/material.d.mts +4 -0
- package/dist/components/biz/example/button/schema.d.mts +4 -0
- package/dist/components/biz/example/button/server.d.mts +4 -1
- package/dist/components/biz/example/button/server.mjs +1 -1
- package/dist/components/ui/badge.d.mts +1 -1
- package/dist/components/ui/button.d.mts +2 -2
- package/dist/hooks.d.mts +1 -4
- package/dist/hooks.mjs +1 -1
- package/dist/utils/schema/index.d.mts +1 -1
- package/dist/utils/schema/material.d.mts +3 -2
- package/dist/utils/schema/schema.d.mts +18 -3
- package/dist/utils/schema/schema.mjs +1 -1
- package/dist/utils.d.mts +2 -2
- package/package.json +1 -1
- package/dist/components/common/app-context/index.d.mts +0 -19
- package/dist/components/common/app-context/index.mjs +0 -2
- package/dist/components/common/app-context/provider.mjs +0 -2
- package/dist/hooks/app-context.d.mts +0 -20
- package/dist/hooks/app-context.mjs +0 -2
- package/dist/hooks/get-app-context.d.mts +0 -19
- package/dist/hooks/get-app-context.mjs +0 -2
- package/dist/hooks/use-app-context/index.d.mts +0 -14
- package/dist/hooks/use-app-context/index.mjs +0 -2
|
@@ -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
|
|
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};
|
|
@@ -34,6 +34,10 @@ declare const videoDetailRecommendMaterial: DefineMaterialOption<typeof VideoDet
|
|
|
34
34
|
playCountDelta: zod.ZodOptional<zod.ZodNumber>;
|
|
35
35
|
showEpisode: zod.ZodOptional<zod.ZodBoolean>;
|
|
36
36
|
}, zod_v4_core0.$strip>>>;
|
|
37
|
+
mode: zod.ZodOptional<zod.ZodEnum<{
|
|
38
|
+
renderer: "renderer";
|
|
39
|
+
editor: "editor";
|
|
40
|
+
}>>;
|
|
37
41
|
}, zod_v4_core0.$strip>, "video-detail-recommend">;
|
|
38
42
|
//#endregion
|
|
39
43
|
export { videoDetailRecommendMaterial };
|
|
@@ -30,6 +30,10 @@ declare const videoDetailRecommendInspectorPropsSchema: z$1.ZodObject<{
|
|
|
30
30
|
playCountDelta: z$1.ZodOptional<z$1.ZodNumber>;
|
|
31
31
|
showEpisode: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
32
32
|
}, z$1.core.$strip>>>;
|
|
33
|
+
mode: z$1.ZodOptional<z$1.ZodEnum<{
|
|
34
|
+
renderer: "renderer";
|
|
35
|
+
editor: "editor";
|
|
36
|
+
}>>;
|
|
33
37
|
}, z$1.core.$strip>;
|
|
34
38
|
type VideoDetailRecommendInspectorProps = z$1.infer<typeof videoDetailRecommendInspectorPropsSchema>;
|
|
35
39
|
/** 推荐模块物料 props。 */
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{VideoDetailRecommendClient as e}from"./client.mjs";import{jsx as t}from"react/jsx-runtime";function n(n){return t(e,{...
|
|
2
|
+
import{VideoDetailRecommendClient as e}from"./client.mjs";import{jsx as t}from"react/jsx-runtime";function n(n){let{mode:r=`renderer`,...i}=n;return t(e,{...i,mode:r})}export{n as VideoDetailRecommend};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{cn as e}from"../../../../utils/cn.mjs";import{pxToVw as t}from"../../../../utils/helper.mjs";import{Image as n}from"../../../ui/image.mjs";import{Box as r}from"../../../ui/box.mjs";import{Text as i}from"../../../ui/text.mjs";import{
|
|
2
|
+
"use client";import{cn as e}from"../../../../utils/cn.mjs";import{pxToVw as t}from"../../../../utils/helper.mjs";import{Image as n}from"../../../ui/image.mjs";import{Box as r}from"../../../ui/box.mjs";import{Text as i}from"../../../ui/text.mjs";import{useBrowseReport as a}from"../../../../hooks/use-browse-report.mjs";import{MediaPreview as o,useMediaPreview as s}from"../../../common/media-preview/index.mjs";import c from"../../../common/video-player/index.mjs";import{UserActivityMediaGrid as l}from"../../../common/list/user-activity-list/user-activity-list-item.mjs";import{memo as u,useCallback as d,useEffect as f,useMemo as p,useRef as m}from"react";import{Fragment as h,jsx as g,jsxs as _}from"react/jsx-runtime";import{useTranslations as v}from"next-intl";const y=u(({mode:t=`renderer`,information:n,isVideo:a,episodeIndex:c=0,resumeProgressSeconds:u=0,className:f=``})=>{let m=t===`editor`,h=p(()=>({id:n.id,name:n.name,preview_images:n.preview_images,img_y:n.img_y,img_x:n.img_x}),[n.id,n.name,n.preview_images,n.img_y,n.img_x]),v=p(()=>{let e=n?.medias,t=Array.isArray(e)?e.filter(Boolean):[];return t.length>0?t:(h.preview_images?.length?h.preview_images:[h.img_y||h.img_x||``].filter(Boolean)).filter(Boolean).map(e=>({media_url:e,is_video:!1,cover_image:``}))},[h.img_x,h.img_y,h.preview_images,n]),y=s(),x=p(()=>v.filter(Boolean).map(e=>{let t=e?.is_video?`video`:`image`,r=String(e?.media_url||``),i=e?.cover_image||n.img_y||n.img_x;return{src:r,type:t,...i?{cover:String(i)}:{}}}).filter(e=>!!e.src),[n.img_x,n.img_y,v]),S=d(e=>{m||!x.length||y.open(x,e)},[m,y,x]);return m?g(`img`,{src:`/static/components-thumb/video_player.png`,alt:`video-preview`,className:`w-full block`}):a?g(b,{information:n,episodeIndex:c,resumeProgressSeconds:u,isEditor:m}):_(`div`,{className:e(`w-full`,f),children:[_(r,{className:`mt-3 px-[12px] space-y-1`,children:[g(i,{as:`p`,className:`break-all`,dangerouslySetInnerHTML:{__html:n.description}}),g(l,{medias:v,onItemClick:S})]}),g(o,{})]})});y.displayName=`DetailHero`;const b=u(({information:e,episodeIndex:t,resumeProgressSeconds:n,isEditor:r})=>{let i=p(()=>({id:e.id,mid:e.mid,img_width:e.img_width,img_height:e.img_height,img_y:e.img_y,img_x:e.img_x,preview_images:e.preview_images}),[e.id,e.mid,e.img_width,e.img_height,e.img_y,e.img_x,e.preview_images]);return g(x,{information:{...e,...i},episodeIndex:t,resumeProgressSeconds:n,isEditor:r})},(e,t)=>{let n=e.information,r=t.information;return n.id===r.id&&n.mid===r.mid&&n.img_width===r.img_width&&n.img_height===r.img_height&&n.img_y===r.img_y&&n.img_x===r.img_x&&e.resumeProgressSeconds===t.resumeProgressSeconds&&e.episodeIndex===t.episodeIndex&&e.isEditor===t.isEditor});b.displayName=`StableDetailPlayerBox`;function x({information:e,episodeIndex:i,resumeProgressSeconds:o,isEditor:s}){let l=v(`components.biz.business.detail`),u=m(0),y=m(0),b=Math.max(0,Number(i)||0),x=b+1,T=p(()=>e?.id,[e?.id]),E=p(()=>({id:e.id,mid:e.mid,img_width:e.img_width,img_height:e.img_height,img_y:e.img_y,img_x:e.img_x,preview_images:e.preview_images,links:e.links}),[e.id,e.mid,e.img_width,e.img_height,e.img_y,e.img_x,e.preview_images,e.links]),D=p(()=>E.mid||E.id,[E.id,E.mid]),O=p(()=>{let e=E.links?.[b]?.id;return e?String(e):`ep-${b+1}`},[b,E.links]),k=p(()=>`__reportData_detail_page__${E.id}:${O}`,[O,E.id]),A=p(()=>{if(s||typeof window>`u`)return 0;try{let e=sessionStorage.getItem(k);if(!e)return 0;let t=JSON.parse(e),n=Number(t.currentTime||0),r=Number(t.duration||0);if(!Number.isFinite(n)||!Number.isFinite(r))return 0;if(n>0&&r>0)return n}catch(e){console.error(`读取 sessionStorage 数据失败:`,e)}return 0},[s,k]),j=p(()=>{let e=Number(o||0);return Number.isFinite(e)&&e>0?e:0},[o]),M=p(()=>j>0?j:A,[j,A]),N=p(()=>{let t=w(e),n=t[t.length?Math.max(0,Math.min(b,t.length-1)):0]?.url||``,r=!!t.length;if(!r)return{hasVideo:!1,hlsList:[],videoUrl:``,width:1,height:1,resolution:`0x0`,aspectRatio:1,poster:``};let i=Number(E.img_width||0)||1,a=Number(E.img_height||0)||1;return{hasVideo:r,hlsList:t,videoUrl:n,width:i,height:a,resolution:S(i,a),aspectRatio:(i||1)/(a||1),poster:E.img_y||E.img_x||E.preview_images?.[0]||``}},[e.id,e.links,b,E.img_width,E.img_height,E.img_y,E.img_x,E.preview_images]),P=d((e,t)=>{u.current=e,y.current=t},[]),F=p(()=>N.videoUrl.endsWith(`m3u8`)?{startTimeSeconds:M,preload:`none`}:{startTimeSeconds:M},[M,N.videoUrl]);f(()=>{u.current=0,y.current=0},[T,b]);let I=a({contentId:T,browseEpisode:x,contentType:1,enabled:!s&&!!T,intervalMs:60*1e3,getCurrentTimeSeconds:()=>u.current,getDurationSeconds:()=>y.current});if(f(()=>{if(s)return;let e=()=>{if(!(typeof window>`u`)&&!(u.current<=0||y.current<=0))try{sessionStorage.setItem(k,JSON.stringify({episodeId:O,currentTime:u.current,duration:y.current}))}catch(e){console.error(`写入 sessionStorage 失败:`,e)}},t=()=>{e()},n=()=>{document.visibilityState===`hidden`&&e()},r=()=>{e()};return window.addEventListener(`beforeunload`,t),document.addEventListener(`visibilitychange`,n),window.addEventListener(`popstate`,r),()=>{window.removeEventListener(`beforeunload`,t),document.removeEventListener(`visibilitychange`,n),window.removeEventListener(`popstate`,r),e()}},[O,s,k]),!N.hasVideo)return g(`div`,{className:`mt-3 rounded-xl bg-bg1 px-3 py-10 text-center text-text3`,children:l(`videoHero.noVideos`)});let L=C(430,N.aspectRatio,242),R=L.height>0?t(L.height):`auto`,z=t(242);return _(h,{children:[g(r,{suppressHydrationWarning:!0,className:`w-full`,style:{height:R,maxWidth:`100%`,maxHeight:z}}),_(r,{className:`w-full relative bg-bg2 !fixed !top-[44px] !left-0 z-[10]`,children:[N.poster&&_(`div`,{className:`w-full h-full bg-bg2 absolute top-0 left-0 z-[1] overflow-hidden`,style:{height:R},children:[g(n,{src:N.poster,alt:l(`videoHero.coverAlt`),fill:!0,className:`object-cover`,priority:!0}),g(`div`,{className:`w-full h-full absolute top-0 left-0 z-[1] bg-[rgba(255,255,255,0.2)] backdrop-blur-[4px]`})]}),g(r,{suppressHydrationWarning:!0,"data-aspect-ratio":N.resolution,className:`w-full overflow-hidden flex justify-center relative z-[2]`,style:{height:R,maxWidth:`100%`,maxHeight:z,backdropFilter:`blur(0)`,WebkitBackdropFilter:`blur(0)`},children:g(c,{plyerId:`detail-player-${E.id}-${b}`,parentId:D,resolution:N.resolution||`0x0`,videoUrl:N.videoUrl,poster:N.poster,mergeConfig:F,onProgressUpdate:s?void 0:P,onPlay:s?void 0:I.handlePlay,onPause:s?void 0:I.handlePause,onEnded:s?void 0:I.handleEnded},`stable-player-${E.id}-${b}`)})]})]})}function S(e,t){return!e||!t?``:`${e}x${t}`}function C(e,t,n){let r=e/t;return r<=n?{width:e,height:r}:{width:n*t,height:n}}function w(e){let t=e.links||[];return t.length>0?t.map((e,t)=>({text:e.name||String(t+1),url:e.m3u8_url||e.preview_m3u8_url||``,definition:``,isDefault:t===0})).filter(e=>e.url):[]}export{y as DetailHero};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{Image as e}from"../../../ui/image.mjs";import{Box as t}from"../../../ui/box.mjs";import{jsx as n}from"react/jsx-runtime";import r from"next/link";function i(i){let{icon:a,href:o}=i;return n(r,{href:o,className
|
|
2
|
+
"use client";import{Image as e}from"../../../ui/image.mjs";import{Box as t}from"../../../ui/box.mjs";import{jsx as n}from"react/jsx-runtime";import r from"next/link";function i(i){let{icon:a,href:o,mode:s=`renderer`}=i;return n(r,{href:o,className:s===`editor`?`fixed bottom-[100px] right-[20px] z-50 block h-[50px] w-[50px] overflow-hidden rounded-[16px] pointer-events-none`:`fixed bottom-[100px] right-[20px] z-50 block h-[50px] w-[50px] overflow-hidden rounded-[16px]`,children:n(t,{className:`flex h-full w-full shadow-lg relative`,"aria-label":`悬浮球`,children:n(e,{src:a,alt:`悬浮球`,fill:!0,className:`object-cover`})})})}export{i as FloatingBallClient};
|
|
@@ -11,6 +11,10 @@ import * as zod_v4_core0 from "zod/v4/core";
|
|
|
11
11
|
declare const floatingBallMaterial: DefineMaterialOption<typeof FloatingBall, typeof FloatingBallClient, zod.ZodObject<{
|
|
12
12
|
icon: zod.ZodString & SchemaHasDefaultValue;
|
|
13
13
|
href: zod.ZodString & SchemaHasDefaultValue;
|
|
14
|
+
mode: zod.ZodOptional<zod.ZodEnum<{
|
|
15
|
+
renderer: "renderer";
|
|
16
|
+
editor: "editor";
|
|
17
|
+
}>>;
|
|
14
18
|
}, zod_v4_core0.$strip>, "floating-ball">;
|
|
15
19
|
//#endregion
|
|
16
20
|
export { floatingBallMaterial };
|
|
@@ -11,6 +11,10 @@ import * as zod_v4_core0 from "zod/v4/core";
|
|
|
11
11
|
declare const floatingBallInspectorPropsSchema: zod.ZodObject<{
|
|
12
12
|
icon: zod.ZodString & SchemaHasDefaultValue;
|
|
13
13
|
href: zod.ZodString & SchemaHasDefaultValue;
|
|
14
|
+
mode: zod.ZodOptional<zod.ZodEnum<{
|
|
15
|
+
renderer: "renderer";
|
|
16
|
+
editor: "editor";
|
|
17
|
+
}>>;
|
|
14
18
|
}, zod_v4_core0.$strip>;
|
|
15
19
|
declare const floatingBallInspectorDefaultProps: {
|
|
16
20
|
icon: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{FloatingBallClient as e}from"./client.mjs";import{jsx as t}from"react/jsx-runtime";function n(n){return t(e,{...
|
|
2
|
+
import{FloatingBallClient as e}from"./client.mjs";import{jsx as t}from"react/jsx-runtime";function n(n){let{mode:r=`renderer`,...i}=n;return t(e,{...i,mode:r})}export{n as FloatingBall};
|
|
@@ -7,6 +7,8 @@ type HeaderAvatarIconClientProps = HeaderAvatarIconInspectorProps;
|
|
|
7
7
|
/**
|
|
8
8
|
* 顶部-头像框+icon
|
|
9
9
|
*/
|
|
10
|
-
declare function HeaderAvatarIconClient(
|
|
10
|
+
declare function HeaderAvatarIconClient({
|
|
11
|
+
mode
|
|
12
|
+
}: HeaderAvatarIconClientProps): react_jsx_runtime0.JSX.Element;
|
|
11
13
|
//#endregion
|
|
12
14
|
export { HeaderAvatarIconClient, HeaderAvatarIconClientProps };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{Box as e}from"../../../../ui/box.mjs";import t from"../../../../../assets/icons/search.mjs";import{UserAvatar as n}from"../shared/avatar.mjs";import{jsx as r,jsxs as i}from"react/jsx-runtime";import a from"next/link";function o(o){return i(e,{as:`header`,className
|
|
2
|
+
"use client";import{Box as e}from"../../../../ui/box.mjs";import t from"../../../../../assets/icons/search.mjs";import{UserAvatar as n}from"../shared/avatar.mjs";import{jsx as r,jsxs as i}from"react/jsx-runtime";import a from"next/link";function o({mode:o=`renderer`}){return i(e,{as:`header`,className:o===`editor`?`px-[12px] py-[8px] flex gap-[16px] items-center justify-between pointer-events-none`:`px-[12px] py-[8px] flex gap-[16px] items-center justify-between`,children:[r(n,{}),r(a,{href:`/search`,"aria-label":`打开搜索页`,children:r(t,{className:`w-[22px] h-[22px] text-text1`,"aria-hidden":!0})})]})}export{o as HeaderAvatarIconClient};
|
|
@@ -6,6 +6,11 @@ import * as zod from "zod";
|
|
|
6
6
|
import * as zod_v4_core0 from "zod/v4/core";
|
|
7
7
|
|
|
8
8
|
//#region components/biz/business/header-search/header-avatar-icon/material.d.ts
|
|
9
|
-
declare const headerAvatarIconMaterial: DefineMaterialOption<typeof HeaderAvatarIcon, typeof HeaderAvatarIconClient, zod.ZodObject<{
|
|
9
|
+
declare const headerAvatarIconMaterial: DefineMaterialOption<typeof HeaderAvatarIcon, typeof HeaderAvatarIconClient, zod.ZodObject<{
|
|
10
|
+
mode: zod.ZodOptional<zod.ZodEnum<{
|
|
11
|
+
renderer: "renderer";
|
|
12
|
+
editor: "editor";
|
|
13
|
+
}>>;
|
|
14
|
+
}, zod_v4_core0.$strip>, "header-avatar-icon">;
|
|
10
15
|
//#endregion
|
|
11
16
|
export { headerAvatarIconMaterial };
|
|
@@ -8,7 +8,12 @@ import * as zod_v4_core0 from "zod/v4/core";
|
|
|
8
8
|
/**
|
|
9
9
|
* 顶部-头像框+icon 物料暂不对外开放配置,仅做占位展示。
|
|
10
10
|
*/
|
|
11
|
-
declare const headerAvatarIconInspectorPropsSchema: zod.ZodObject<{
|
|
11
|
+
declare const headerAvatarIconInspectorPropsSchema: zod.ZodObject<{
|
|
12
|
+
mode: zod.ZodOptional<zod.ZodEnum<{
|
|
13
|
+
renderer: "renderer";
|
|
14
|
+
editor: "editor";
|
|
15
|
+
}>>;
|
|
16
|
+
}, zod_v4_core0.$strip>;
|
|
12
17
|
type HeaderAvatarIconInspectorProps = InferSchemaProps<typeof headerAvatarIconInspectorPropsSchema>;
|
|
13
18
|
//#endregion
|
|
14
19
|
export { HeaderAvatarIconInspectorProps, headerAvatarIconInspectorPropsSchema };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{HeaderAvatarIconClient as e}from"./client.mjs";import{jsx as t}from"react/jsx-runtime";function n(n){return t(e,{...
|
|
2
|
+
import{HeaderAvatarIconClient as e}from"./client.mjs";import{jsx as t}from"react/jsx-runtime";function n(n){let{mode:r=`renderer`,...i}=n;return t(e,{...i,mode:r})}export{n as HeaderAvatarIcon};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{Box as e}from"../../../../ui/box.mjs";import{UserAvatar as t}from"../shared/avatar.mjs";import{Logo as n}from"../shared/logo.mjs";import{Search as r}from"../shared/search.mjs";import{headerAvatarLogoSearchInspectorDefaultProps as i}from"./schema.mjs";import{jsx as a,jsxs as o}from"react/jsx-runtime";function s(s){let{
|
|
2
|
+
"use client";import{Box as e}from"../../../../ui/box.mjs";import{UserAvatar as t}from"../shared/avatar.mjs";import{Logo as n}from"../shared/logo.mjs";import{Search as r}from"../shared/search.mjs";import{headerAvatarLogoSearchInspectorDefaultProps as i}from"./schema.mjs";import{jsx as a,jsxs as o}from"react/jsx-runtime";function s(s){let{mode:c=`renderer`,...l}=s,u=c===`editor`,{logoSrc:d,logoHref:f}={...i,...l};return o(e,{as:`header`,className:u?`px-[12px] py-[8px] flex gap-[8px] items-center pointer-events-none`:`px-[12px] py-[8px] flex gap-[8px] items-center`,children:[a(t,{}),a(r,{}),a(n,{logoSrc:d,logoHref:f})]})}export{s as HeaderAvatarLogoSearchClient};
|
|
@@ -11,6 +11,10 @@ import * as zod_v4_core0 from "zod/v4/core";
|
|
|
11
11
|
declare const headerAvatarLogoSearchMaterial: DefineMaterialOption<typeof HeaderAvatarLogoSearch, typeof HeaderAvatarLogoSearchClient, zod.ZodObject<{
|
|
12
12
|
logoSrc: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
|
|
13
13
|
logoHref: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
|
|
14
|
+
mode: zod.ZodOptional<zod.ZodEnum<{
|
|
15
|
+
renderer: "renderer";
|
|
16
|
+
editor: "editor";
|
|
17
|
+
}>>;
|
|
14
18
|
}, zod_v4_core0.$strip>, "header-avatar-logo-search">;
|
|
15
19
|
//#endregion
|
|
16
20
|
export { headerAvatarLogoSearchMaterial };
|
|
@@ -13,6 +13,10 @@ import * as zod_v4_core0 from "zod/v4/core";
|
|
|
13
13
|
declare const headerAvatarLogoSearchInspectorPropsSchema: zod.ZodObject<{
|
|
14
14
|
logoSrc: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
|
|
15
15
|
logoHref: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
|
|
16
|
+
mode: zod.ZodOptional<zod.ZodEnum<{
|
|
17
|
+
renderer: "renderer";
|
|
18
|
+
editor: "editor";
|
|
19
|
+
}>>;
|
|
16
20
|
}, zod_v4_core0.$strip>;
|
|
17
21
|
type HeaderAvatarLogoSearchInspectorProps = InferSchemaProps<typeof headerAvatarLogoSearchInspectorPropsSchema>;
|
|
18
22
|
//#endregion
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{HeaderAvatarLogoSearchClient as e}from"./client.mjs";import{jsx as t}from"react/jsx-runtime";function n(n){return t(e,{...
|
|
2
|
+
import{HeaderAvatarLogoSearchClient as e}from"./client.mjs";import{jsx as t}from"react/jsx-runtime";function n(n){let{mode:r=`renderer`,...i}=n;return t(e,{...i,mode:r})}export{n as HeaderAvatarLogoSearch};
|
package/dist/components/biz/business/header-search/header-avatar-logo-search-icon/client.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{Box as e}from"../../../../ui/box.mjs";import t from"../../../../../assets/icons/search.mjs";import{UserAvatar as n}from"../shared/avatar.mjs";import{Logo as r}from"../shared/logo.mjs";import{headerAvatarLogoSearchIconInspectorDefaultProps as i}from"./schema.mjs";import{jsx as a,jsxs as o}from"react/jsx-runtime";import s from"next/link";function c(c){let{
|
|
2
|
+
"use client";import{Box as e}from"../../../../ui/box.mjs";import t from"../../../../../assets/icons/search.mjs";import{UserAvatar as n}from"../shared/avatar.mjs";import{Logo as r}from"../shared/logo.mjs";import{headerAvatarLogoSearchIconInspectorDefaultProps as i}from"./schema.mjs";import{jsx as a,jsxs as o}from"react/jsx-runtime";import s from"next/link";function c(c){let{mode:l=`renderer`,...u}=c,d=l===`editor`,{logoSrc:f,logoHref:p}={...i,...u};return o(e,{as:`header`,className:d?`px-[12px] py-[8px] flex gap-[16px] items-center pointer-events-none`:`px-[12px] py-[8px] flex gap-[16px] items-center`,children:[a(n,{}),a(e,{className:`flex-1`}),a(s,{href:`/search`,"aria-label":`打开搜索页`,children:a(t,{className:`w-[22px] h-[22px] text-text1`,"aria-hidden":!0})}),a(r,{logoSrc:f,logoHref:p})]})}export{c as HeaderAvatarLogoSearchIconClient};
|
package/dist/components/biz/business/header-search/header-avatar-logo-search-icon/material.d.mts
CHANGED
|
@@ -11,6 +11,10 @@ import * as zod_v4_core0 from "zod/v4/core";
|
|
|
11
11
|
declare const headerAvatarLogoSearchIconMaterial: DefineMaterialOption<typeof HeaderAvatarLogoSearchIcon, typeof HeaderAvatarLogoSearchIconClient, zod.ZodObject<{
|
|
12
12
|
logoSrc: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
|
|
13
13
|
logoHref: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
|
|
14
|
+
mode: zod.ZodOptional<zod.ZodEnum<{
|
|
15
|
+
renderer: "renderer";
|
|
16
|
+
editor: "editor";
|
|
17
|
+
}>>;
|
|
14
18
|
}, zod_v4_core0.$strip>, "header-avatar-logo-search-icon">;
|
|
15
19
|
//#endregion
|
|
16
20
|
export { headerAvatarLogoSearchIconMaterial };
|
package/dist/components/biz/business/header-search/header-avatar-logo-search-icon/schema.d.mts
CHANGED
|
@@ -11,6 +11,10 @@ import * as zod_v4_core0 from "zod/v4/core";
|
|
|
11
11
|
declare const headerAvatarLogoSearchIconInspectorPropsSchema: zod.ZodObject<{
|
|
12
12
|
logoSrc: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
|
|
13
13
|
logoHref: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
|
|
14
|
+
mode: zod.ZodOptional<zod.ZodEnum<{
|
|
15
|
+
renderer: "renderer";
|
|
16
|
+
editor: "editor";
|
|
17
|
+
}>>;
|
|
14
18
|
}, zod_v4_core0.$strip>;
|
|
15
19
|
type HeaderAvatarLogoSearchIconInspectorProps = InferSchemaProps<typeof headerAvatarLogoSearchIconInspectorPropsSchema>;
|
|
16
20
|
//#endregion
|
package/dist/components/biz/business/header-search/header-avatar-logo-search-icon/server.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{HeaderAvatarLogoSearchIconClient as e}from"./client.mjs";import{jsx as t}from"react/jsx-runtime";function n(n){return t(e,{...
|
|
2
|
+
import{HeaderAvatarLogoSearchIconClient as e}from"./client.mjs";import{jsx as t}from"react/jsx-runtime";function n(n){let{mode:r=`renderer`,...i}=n;return t(e,{...i,mode:r})}export{n as HeaderAvatarLogoSearchIcon};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{Box as e}from"../../../../ui/box.mjs";import{Logo as t}from"../shared/logo.mjs";import{Search as n}from"../shared/search.mjs";import{headerLogoSearchInspectorDefaultProps as r}from"./schema.mjs";import{jsx as i,jsxs as a}from"react/jsx-runtime";function o(o){let{
|
|
2
|
+
"use client";import{Box as e}from"../../../../ui/box.mjs";import{Logo as t}from"../shared/logo.mjs";import{Search as n}from"../shared/search.mjs";import{headerLogoSearchInspectorDefaultProps as r}from"./schema.mjs";import{jsx as i,jsxs as a}from"react/jsx-runtime";function o(o){let{mode:s=`renderer`,...c}=o,l=s===`editor`,{logoSrc:u,logoHref:d}={...r,...c};return a(e,{as:`header`,className:l?`px-[12px] py-[8px] flex gap-[8px] pointer-events-none`:`px-[12px] py-[8px] flex gap-[8px]`,children:[i(t,{logoSrc:u,logoHref:d}),i(n,{})]})}export{o as HeaderLogoSearchClient};
|
|
@@ -11,6 +11,10 @@ import * as zod_v4_core0 from "zod/v4/core";
|
|
|
11
11
|
declare const headerLogoSearchMaterial: DefineMaterialOption<typeof HeaderLogoSearch, typeof HeaderLogoSearchClient, zod.ZodObject<{
|
|
12
12
|
logoSrc: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
|
|
13
13
|
logoHref: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
|
|
14
|
+
mode: zod.ZodOptional<zod.ZodEnum<{
|
|
15
|
+
renderer: "renderer";
|
|
16
|
+
editor: "editor";
|
|
17
|
+
}>>;
|
|
14
18
|
}, zod_v4_core0.$strip>, "header-logo-search">;
|
|
15
19
|
//#endregion
|
|
16
20
|
export { headerLogoSearchMaterial };
|
|
@@ -13,6 +13,10 @@ import * as zod_v4_core0 from "zod/v4/core";
|
|
|
13
13
|
declare const headerLogoSearchInspectorPropsSchema: zod.ZodObject<{
|
|
14
14
|
logoSrc: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
|
|
15
15
|
logoHref: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
|
|
16
|
+
mode: zod.ZodOptional<zod.ZodEnum<{
|
|
17
|
+
renderer: "renderer";
|
|
18
|
+
editor: "editor";
|
|
19
|
+
}>>;
|
|
16
20
|
}, zod_v4_core0.$strip>;
|
|
17
21
|
type HeaderLogoSearchInspectorProps = InferSchemaProps<typeof headerLogoSearchInspectorPropsSchema>;
|
|
18
22
|
//#endregion
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{HeaderLogoSearchClient as e}from"./client.mjs";import{jsx as t}from"react/jsx-runtime";function n(n){return t(e,{...
|
|
2
|
+
import{HeaderLogoSearchClient as e}from"./client.mjs";import{jsx as t}from"react/jsx-runtime";function n(n){let{mode:r=`renderer`,...i}=n;return t(e,{...i,mode:r})}export{n as HeaderLogoSearch};
|
|
@@ -7,6 +7,8 @@ type HeaderSearchClientProps = HeaderSearchInspectorProps;
|
|
|
7
7
|
/**
|
|
8
8
|
* 顶部-搜索框
|
|
9
9
|
*/
|
|
10
|
-
declare function HeaderSearchClient(
|
|
10
|
+
declare function HeaderSearchClient({
|
|
11
|
+
mode
|
|
12
|
+
}: HeaderSearchClientProps): react_jsx_runtime0.JSX.Element;
|
|
11
13
|
//#endregion
|
|
12
14
|
export { HeaderSearchClient, HeaderSearchClientProps };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{Box as e}from"../../../../ui/box.mjs";import{Search as t}from"../shared/search.mjs";import{jsx as n}from"react/jsx-runtime";function r(r){return n(e,{as:`header`,className
|
|
2
|
+
"use client";import{Box as e}from"../../../../ui/box.mjs";import{Search as t}from"../shared/search.mjs";import{jsx as n}from"react/jsx-runtime";function r({mode:r=`renderer`}){return n(e,{as:`header`,className:r===`editor`?`px-[12px] py-[8px] pointer-events-none`:`px-[12px] py-[8px]`,children:n(t,{})})}export{r as HeaderSearchClient};
|
|
@@ -6,6 +6,11 @@ import * as zod from "zod";
|
|
|
6
6
|
import * as zod_v4_core0 from "zod/v4/core";
|
|
7
7
|
|
|
8
8
|
//#region components/biz/business/header-search/header-search/material.d.ts
|
|
9
|
-
declare const headerSearchMaterial: DefineMaterialOption<typeof HeaderSearch, typeof HeaderSearchClient, zod.ZodObject<{
|
|
9
|
+
declare const headerSearchMaterial: DefineMaterialOption<typeof HeaderSearch, typeof HeaderSearchClient, zod.ZodObject<{
|
|
10
|
+
mode: zod.ZodOptional<zod.ZodEnum<{
|
|
11
|
+
renderer: "renderer";
|
|
12
|
+
editor: "editor";
|
|
13
|
+
}>>;
|
|
14
|
+
}, zod_v4_core0.$strip>, "header-search">;
|
|
10
15
|
//#endregion
|
|
11
16
|
export { headerSearchMaterial };
|
|
@@ -8,7 +8,12 @@ import * as zod_v4_core0 from "zod/v4/core";
|
|
|
8
8
|
/**
|
|
9
9
|
* 顶部-搜索框 物料暂不对外开放配置,仅做占位展示。
|
|
10
10
|
*/
|
|
11
|
-
declare const headerSearchInspectorPropsSchema: zod.ZodObject<{
|
|
11
|
+
declare const headerSearchInspectorPropsSchema: zod.ZodObject<{
|
|
12
|
+
mode: zod.ZodOptional<zod.ZodEnum<{
|
|
13
|
+
renderer: "renderer";
|
|
14
|
+
editor: "editor";
|
|
15
|
+
}>>;
|
|
16
|
+
}, zod_v4_core0.$strip>;
|
|
12
17
|
type HeaderSearchInspectorProps = InferSchemaProps<typeof headerSearchInspectorPropsSchema>;
|
|
13
18
|
//#endregion
|
|
14
19
|
export { HeaderSearchInspectorProps, headerSearchInspectorPropsSchema };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{HeaderSearchClient as e}from"./client.mjs";import{jsx as t}from"react/jsx-runtime";function n(n){return t(e,{...
|
|
2
|
+
import{HeaderSearchClient as e}from"./client.mjs";import{jsx as t}from"react/jsx-runtime";function n(n){let{mode:r=`renderer`,...i}=n;return t(e,{...i,mode:r})}export{n as HeaderSearch};
|
|
@@ -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
|
|
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};
|
|
@@ -11,6 +11,10 @@ declare const homeRecommendGridInspectorPropsSchema: z$1.ZodObject<{
|
|
|
11
11
|
title: z$1.ZodOptional<z$1.ZodString> & SchemaHasDefaultValue;
|
|
12
12
|
enableInfinite: z$1.ZodOptional<z$1.ZodBoolean> & SchemaHasDefaultValue;
|
|
13
13
|
moreLink: z$1.ZodOptional<z$1.ZodString> & SchemaHasDefaultValue;
|
|
14
|
+
mode: z$1.ZodOptional<z$1.ZodEnum<{
|
|
15
|
+
renderer: "renderer";
|
|
16
|
+
editor: "editor";
|
|
17
|
+
}>>;
|
|
14
18
|
}, z$1.core.$strip>;
|
|
15
19
|
declare const homeRecommendGridInspectorDefaultProps: {
|
|
16
20
|
title: string;
|
package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/material.d.mts
CHANGED
|
@@ -11,6 +11,10 @@ declare const homeRecommendGridMaterial: DefineMaterialOption<typeof HomeRecomme
|
|
|
11
11
|
title: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
|
|
12
12
|
enableInfinite: zod.ZodOptional<zod.ZodBoolean> & SchemaHasDefaultValue;
|
|
13
13
|
moreLink: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
|
|
14
|
+
mode: zod.ZodOptional<zod.ZodEnum<{
|
|
15
|
+
renderer: "renderer";
|
|
16
|
+
editor: "editor";
|
|
17
|
+
}>>;
|
|
14
18
|
}, zod_v4_core0.$strip>, "home-recommend-grid">;
|
|
15
19
|
//#endregion
|
|
16
20
|
export { homeRecommendGridMaterial };
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
|
|
2
2
|
import { BaseComponentProps } from "../../../../../utils/types/component.mjs";
|
|
3
3
|
import "../../../../../utils/index.mjs";
|
|
4
|
+
import { MaterialComponentMode } from "../../../../../../../utils/schema/schema.mjs";
|
|
5
|
+
import "../../../../../../../utils/schema/index.mjs";
|
|
4
6
|
import { HomeRecommendData } from "../../../types.mjs";
|
|
5
7
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
6
8
|
|
|
@@ -8,6 +10,11 @@ import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
|
8
10
|
/**
|
|
9
11
|
* 首页推荐两列宫格布局。
|
|
10
12
|
*/
|
|
11
|
-
declare function HomeRecommendGridClient(
|
|
13
|
+
declare function HomeRecommendGridClient({
|
|
14
|
+
mode,
|
|
15
|
+
...props
|
|
16
|
+
}: BaseComponentProps<HomeRecommendData> & {
|
|
17
|
+
mode?: MaterialComponentMode;
|
|
18
|
+
}): react_jsx_runtime0.JSX.Element;
|
|
12
19
|
//#endregion
|
|
13
20
|
export { HomeRecommendGridClient };
|
package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/runtime/client.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import
|
|
2
|
+
"use client";import e from"../../../shared/home-recommend-base.mjs";import{buildHomeRecommendEditorPreviewData as t}from"../../../shared/home-recommend-preview.mjs";import{useMemo as n}from"react";import{jsx as r}from"react/jsx-runtime";function i({mode:i=`renderer`,...a}){let o=i===`editor`,s=a.props||{},c=n(()=>o?t({variant:`grid`,schemaTitle:s.title,enableInfinite:s.enableInfinite,data:a.data}):a.data,[o,a.data,s.enableInfinite,s.title]);return r(`div`,{className:o?`pointer-events-none`:void 0,children:r(e,{variant:`grid`,mode:i,...a,data:c})})}export{i as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{defaultProps as e}from"./defaults/default-props.mjs";import t from"./runtime/client.mjs";import{jsx as n}from"react/jsx-runtime";function r(r){let{moreLink:
|
|
2
|
+
import{defaultProps as e}from"./defaults/default-props.mjs";import t from"./runtime/client.mjs";import{jsx as n}from"react/jsx-runtime";function r(r){let{mode:i=`renderer`,moreLink:a=e.moreLink,title:o,enableInfinite:s,data:c}=r;return n(t,{mode:i,props:{moreLink:a,title:o,enableInfinite:s},data:c})}export{r as HomeRecommendGrid};
|
|
@@ -10,6 +10,10 @@ import z$1 from "zod";
|
|
|
10
10
|
declare const homeRecommendWaterfallInspectorPropsSchema: z$1.ZodObject<{
|
|
11
11
|
title: z$1.ZodOptional<z$1.ZodString> & SchemaHasDefaultValue;
|
|
12
12
|
enableInfinite: z$1.ZodOptional<z$1.ZodBoolean> & SchemaHasDefaultValue;
|
|
13
|
+
mode: z$1.ZodOptional<z$1.ZodEnum<{
|
|
14
|
+
renderer: "renderer";
|
|
15
|
+
editor: "editor";
|
|
16
|
+
}>>;
|
|
13
17
|
}, z$1.core.$strip>;
|
|
14
18
|
declare const homeRecommendWaterfallInspectorDefaultProps: {
|
|
15
19
|
title: string;
|
package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/material.d.mts
CHANGED
|
@@ -10,6 +10,10 @@ import * as zod_v4_core0 from "zod/v4/core";
|
|
|
10
10
|
declare const homeRecommendWaterfallMaterial: DefineMaterialOption<typeof HomeRecommendWaterfall, typeof HomeRecommendWaterfall, zod.ZodObject<{
|
|
11
11
|
title: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
|
|
12
12
|
enableInfinite: zod.ZodOptional<zod.ZodBoolean> & SchemaHasDefaultValue;
|
|
13
|
+
mode: zod.ZodOptional<zod.ZodEnum<{
|
|
14
|
+
renderer: "renderer";
|
|
15
|
+
editor: "editor";
|
|
16
|
+
}>>;
|
|
13
17
|
}, zod_v4_core0.$strip>, "home-recommend-waterfall">;
|
|
14
18
|
//#endregion
|
|
15
19
|
export { homeRecommendWaterfallMaterial };
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
|
|
2
2
|
import { BaseComponentProps } from "../../../../../utils/types/component.mjs";
|
|
3
3
|
import "../../../../../utils/index.mjs";
|
|
4
|
+
import { MaterialComponentMode } from "../../../../../../../utils/schema/schema.mjs";
|
|
5
|
+
import "../../../../../../../utils/schema/index.mjs";
|
|
4
6
|
import { HomeRecommendData } from "../../../types.mjs";
|
|
5
7
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
6
8
|
|
|
@@ -8,6 +10,11 @@ import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
|
8
10
|
/**
|
|
9
11
|
* 首页推荐瀑布流布局。
|
|
10
12
|
*/
|
|
11
|
-
declare function HomeRecommendWaterfallClient(
|
|
13
|
+
declare function HomeRecommendWaterfallClient({
|
|
14
|
+
mode,
|
|
15
|
+
...props
|
|
16
|
+
}: BaseComponentProps<HomeRecommendData> & {
|
|
17
|
+
mode?: MaterialComponentMode;
|
|
18
|
+
}): react_jsx_runtime0.JSX.Element;
|
|
12
19
|
//#endregion
|
|
13
20
|
export { HomeRecommendWaterfallClient };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import
|
|
2
|
+
"use client";import e from"../../../shared/home-recommend-base.mjs";import{buildHomeRecommendEditorPreviewData as t}from"../../../shared/home-recommend-preview.mjs";import{useMemo as n}from"react";import{jsx as r}from"react/jsx-runtime";function i({mode:i=`renderer`,...a}){let o=i===`editor`,s=a.props||{},c=n(()=>o?t({variant:`waterfall`,schemaTitle:s.title,enableInfinite:s.enableInfinite,data:a.data}):a.data,[o,a.data,s.enableInfinite,s.title]);return r(`div`,{className:o?`pointer-events-none`:void 0,children:r(e,{variant:`waterfall`,mode:i,...a,data:c})})}export{i as default};
|
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 t}from"react/jsx-runtime";function n(n){let{title:
|
|
2
|
+
import e from"./runtime/client.mjs";import{jsx as t}from"react/jsx-runtime";function n(n){let{mode:r=`renderer`,title:i,enableInfinite:a,data:o}=n;return t(e,{mode:r,props:{title:i,enableInfinite:a},data:o})}export{n as HomeRecommendWaterfall};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{Image as e}from"../../../ui/image.mjs";import{Box as t}from"../../../ui/box.mjs";import{Text as n}from"../../../ui/text.mjs";import r from"../../../ui/link.mjs";import i from"../../../../assets/icons/view.mjs";import{jsx as a,jsxs as o}from"react/jsx-runtime";function s(e){if(e.duration===void 0||e.duration===null||e.duration===``)return null;let t=String(e.duration);if(t.includes(`集`))return t.startsWith(`全`)?t:`全${t.replace(/\D/g,``)}集`;let n=Number(e.duration);if(!Number.isNaN(n)&&n>0){let e=Math.floor(n),t=Math.floor(e/3600),r=Math.floor(e%3600/60),i=e%60,a=e=>String(e).padStart(2,`0`);return t>0?`${a(t)}:${a(r)}:${a(i)}`:`${a(r)}:${a(i)}`}return String(e.duration)}function c(e){if(e==null||e===``)return null;let t=Number(e);if(Number.isNaN(t))return String(e);if(t<1e3)return String(t);if(t<1e6){let e=(t/1e3).toFixed(1);return e.endsWith(`.0`)?`${e.slice(0,-2)}K`:`${e}K`}else{let e=(t/1e6).toFixed(1);return e.endsWith(`.0`)?`${e.slice(0,-2)}M`:`${e}M`}}function l(e,t,n){return t===`showPlayCount`?e.showPlayCount??n:t===`showEpisode`?e.showEpisode??n:n}function u(e){if(!l(e,`showPlayCount`,!0))return;let t=e.playCount,n=Number(e.playCountDelta??0);if(t==null||t===``)return t;let r=Number(t);return Number.isNaN(r)?t:r+(Number.isNaN(n)?0:n)}function d(e){let t=e.tag_image||e.tag_image_url||e.tagImage||e.tagImageUrl;return t?String(t):null}function f({data:f}){return f?a(t,{children:(Array.isArray(f)?f:[f]).map(f=>{let p=f.id?`/video/${f.id}/${f.title?encodeURIComponent(f.title):``}`:`#`,m=(e=>e===1?{text:`新剧`,fromColor:`#FD4C5E`,toColor:`#F05D19`,textColor:`#FFFFFF`}:e===2?{text:`热门`,fromColor:`#FFE485`,toColor:`#CF8125`,textColor:`#674100`}:null)(f.superscript),h=f.tag||m?.text,g=d(f),_=m?{from:m.fromColor,to:m.toColor,text:m.textColor}:{from:`#FD4C5E`,to:`#F05D19`,text:`#FFFFFF`},v=l(f,`showEpisode`,!0)?s(f):null,y=c(u(f));return a(t,{children:o(r,{href:p,children:[o(t,{className:`relative w-full overflow-hidden rounded-[12px] bg-neutral-800`,style:{aspectRatio:`16/9`},children:[f.cover&&a(e,{src:f.cover,alt:f.title,fill:!0,objectFit:`cover`}),g&&a(t,{className:`absolute right-0 top-0 z-10 h-[24px] w-[64px]`,children:a(e,{src:g,alt:f.title,fill:!0,objectFit:`contain`})}),!g&&h&&a(t,{className:`absolute right-0 top-0 flex items-center justify-center z-10`,style:{height:`24px`,padding:`0 10px`,borderTopRightRadius:`12px`,borderBottomLeftRadius:`18px`,background:`linear-gradient(to right, ${_.from}, ${_.to})`,color:_.text},children:a(n,{as:`span`,className:`text-[13px] font-medium leading-none`,children:h})}),a(t,{className:`absolute inset-x-0 bottom-0 h-[40px] bg-gradient-to-t from-black/80 to-transparent z-0 pointer-events-none`}),y&&o(t,{className:`absolute bottom-0 left-[8px] mb-[6px] z-10 flex items-center gap-[4px]`,children:[a(i,{className:`h-[14px] w-[14px] text-white`}),a(n,{as:`span`,className:`text-[12px] font-medium text-white drop-shadow-md`,children:y})]}),v&&a(t,{className:`absolute bottom-0 right-[8px] mb-[6px] z-10 flex items-center`,children:a(n,{as:`span`,className:`text-[12px] font-medium text-white drop-shadow-md`,children:v})})]}),o(t,{className:`flex items-center justify-between gap-[12px] pt-[10px] px-2`,children:[o(t,{className:`flex-1 min-w-0`,children:[a(n,{as:`h3`,className:`text-[16px] font-semibold leading-[24px] text-text1 line-clamp-1`,children:f.title}),f.desc&&a(n,{as:`p`,className:`mt-[4px] text-[13px] leading-[20px] text-text2 line-clamp-1`,children:f.desc})]}),a(n,{className:`shrink-0 rounded-[20px] border border-[#FD4C5E] px-[24px] py-[8px] text-[14px] font-normal text-[#FD4C5E]`,children:`观看`})]})]})},f.id||f.title)})}):null}export{f as LargeGridItemClient};
|
|
2
|
+
import{Image as e}from"../../../ui/image.mjs";import{Box as t}from"../../../ui/box.mjs";import{Text as n}from"../../../ui/text.mjs";import r from"../../../ui/link.mjs";import i from"../../../../assets/icons/view.mjs";import{jsx as a,jsxs as o}from"react/jsx-runtime";function s(e){if(e.duration===void 0||e.duration===null||e.duration===``)return null;let t=String(e.duration);if(t.includes(`集`))return t.startsWith(`全`)?t:`全${t.replace(/\D/g,``)}集`;let n=Number(e.duration);if(!Number.isNaN(n)&&n>0){let e=Math.floor(n),t=Math.floor(e/3600),r=Math.floor(e%3600/60),i=e%60,a=e=>String(e).padStart(2,`0`);return t>0?`${a(t)}:${a(r)}:${a(i)}`:`${a(r)}:${a(i)}`}return String(e.duration)}function c(e){if(e==null||e===``)return null;let t=Number(e);if(Number.isNaN(t))return String(e);if(t<1e3)return String(t);if(t<1e6){let e=(t/1e3).toFixed(1);return e.endsWith(`.0`)?`${e.slice(0,-2)}K`:`${e}K`}else{let e=(t/1e6).toFixed(1);return e.endsWith(`.0`)?`${e.slice(0,-2)}M`:`${e}M`}}function l(e,t,n){return t===`showPlayCount`?e.showPlayCount??n:t===`showEpisode`?e.showEpisode??n:n}function u(e){if(!l(e,`showPlayCount`,!0))return;let t=e.playCount,n=Number(e.playCountDelta??0);if(t==null||t===``)return t;let r=Number(t);return Number.isNaN(r)?t:r+(Number.isNaN(n)?0:n)}function d(e){let t=e.tag_image||e.tag_image_url||e.tagImage||e.tagImageUrl;return t?String(t):null}function f({data:f}){return f?a(t,{children:(Array.isArray(f)?f:[f]).map(f=>{let p=f.id?`/video/${f.id}/${f.title?encodeURIComponent(f.title):``}`:`#`,m=(e=>e===1?{text:`新剧`,fromColor:`#FD4C5E`,toColor:`#F05D19`,textColor:`#FFFFFF`}:e===2?{text:`热门`,fromColor:`#FFE485`,toColor:`#CF8125`,textColor:`#674100`}:null)(f.superscript),h=f.tag||m?.text,g=d(f),_=m?{from:m.fromColor,to:m.toColor,text:m.textColor}:{from:`#FD4C5E`,to:`#F05D19`,text:`#FFFFFF`},v=l(f,`showEpisode`,!0)?s(f):null,y=c(u(f));return a(t,{children:o(r,{href:p,children:[o(t,{className:`relative w-full overflow-hidden rounded-[12px] bg-neutral-800`,style:{aspectRatio:`16/9`},children:[f.cover&&a(e,{src:f.cover,alt:f.title,fill:!0,objectFit:`cover`}),g&&a(t,{className:`absolute right-0 top-0 z-10 h-[24px] w-[64px]`,children:a(e,{src:g,alt:f.title,fill:!0,objectFit:`contain`,style:{objectPosition:`right top`}})}),!g&&h&&a(t,{className:`absolute right-0 top-0 flex items-center justify-center z-10`,style:{height:`24px`,padding:`0 10px`,borderTopRightRadius:`12px`,borderBottomLeftRadius:`18px`,background:`linear-gradient(to right, ${_.from}, ${_.to})`,color:_.text},children:a(n,{as:`span`,className:`text-[13px] font-medium leading-none`,children:h})}),a(t,{className:`absolute inset-x-0 bottom-0 h-[40px] bg-gradient-to-t from-black/80 to-transparent z-0 pointer-events-none`}),y&&o(t,{className:`absolute bottom-0 left-[8px] mb-[6px] z-10 flex items-center gap-[4px]`,children:[a(i,{className:`h-[14px] w-[14px] text-white`}),a(n,{as:`span`,className:`text-[12px] font-medium text-white drop-shadow-md`,children:y})]}),v&&a(t,{className:`absolute bottom-0 right-[8px] mb-[6px] z-10 flex items-center`,children:a(n,{as:`span`,className:`text-[12px] font-medium text-white drop-shadow-md`,children:v})})]}),o(t,{className:`flex items-center justify-between gap-[12px] pt-[10px] px-2`,children:[o(t,{className:`flex-1 min-w-0`,children:[a(n,{as:`h3`,className:`text-[16px] font-semibold leading-[24px] text-text1 line-clamp-1`,children:f.title}),f.desc&&a(n,{as:`p`,className:`mt-[4px] text-[13px] leading-[20px] text-text2 line-clamp-1`,children:f.desc})]}),a(n,{className:`shrink-0 rounded-[20px] border border-[#FD4C5E] px-[24px] py-[8px] text-[14px] font-normal text-[#FD4C5E]`,children:`观看`})]})]})},f.id||f.title)})}):null}export{f as LargeGridItemClient};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
|
|
2
|
+
import { LargeFeatureGridInspectorProps } from "./schema.mjs";
|
|
3
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region components/biz/business/large-feature-grid/client.d.ts
|
|
6
|
+
type LargeFeatureGridClientProps = LargeFeatureGridInspectorProps;
|
|
7
|
+
/**
|
|
8
|
+
* 大图推荐客户端组件。
|
|
9
|
+
*/
|
|
10
|
+
declare function LargeFeatureGridClient({
|
|
11
|
+
mode,
|
|
12
|
+
data
|
|
13
|
+
}: LargeFeatureGridClientProps): react_jsx_runtime0.JSX.Element | null;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { LargeFeatureGridClient };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{Box as e}from"../../../ui/box.mjs";import{Text as t}from"../../../ui/text.mjs";import n from"../../../ui/link.mjs";import r from"../../../../assets/icons/common/right_arrow.mjs";import{LargeGridItemClient as i}from"./card-item.mjs";import{largeFeatureGridInspectorDefaultProps as a}from"./schema.mjs";import{jsx as o,jsxs as s}from"react/jsx-runtime";const c=[],l=a.data??[];function u(e){return e==null||e===``}function d(e,t){return u(e)?t:e}function f(e,t){return t?{...e,...t,id:d(t.id,e.id),cover:d(t.cover,e.cover),title:d(t.title,e.title),desc:d(t.desc,e.desc),tag:d(t.tag,e.tag),superscript:t.superscript??e.superscript,playCount:d(t.playCount,e.playCount),playCountDelta:t.playCountDelta??e.playCountDelta,showPlayCount:t.showPlayCount??e.showPlayCount,duration:d(t.duration,e.duration),showEpisode:t.showEpisode??e.showEpisode,useContentCover:t.useContentCover??e.useContentCover,tagImageUrl:d(t.tagImageUrl,e.tagImageUrl),tag_image:d(t.tag_image,e.tag_image),tag_image_url:d(t.tag_image_url,e.tag_image_url),tagImage:d(t.tagImage,e.tagImage)}:e}function p(e,t){if(!t)return e;let n=e.items;return{...e,...t,title:d(t.title,e.title),moreUrl:d(t.moreUrl,e.moreUrl),moreLinkType:t.moreLinkType??e.moreLinkType,recommendMode:t.recommendMode??e.recommendMode,items:n?f(n,t.items):t.items}}function m({data:
|
|
2
|
+
"use client";import{Box as e}from"../../../ui/box.mjs";import{Text as t}from"../../../ui/text.mjs";import n from"../../../ui/link.mjs";import r from"../../../../assets/icons/common/right_arrow.mjs";import{LargeGridItemClient as i}from"./card-item.mjs";import{largeFeatureGridInspectorDefaultProps as a}from"./schema.mjs";import{jsx as o,jsxs as s}from"react/jsx-runtime";const c=[],l=a.data??[];function u(e){return e==null||e===``}function d(e,t){return u(e)?t:e}function f(e,t){return t?{...e,...t,id:d(t.id,e.id),cover:d(t.cover,e.cover),title:d(t.title,e.title),desc:d(t.desc,e.desc),tag:d(t.tag,e.tag),superscript:t.superscript??e.superscript,playCount:d(t.playCount,e.playCount),playCountDelta:t.playCountDelta??e.playCountDelta,showPlayCount:t.showPlayCount??e.showPlayCount,duration:d(t.duration,e.duration),showEpisode:t.showEpisode??e.showEpisode,useContentCover:t.useContentCover??e.useContentCover,tagImageUrl:d(t.tagImageUrl,e.tagImageUrl),tag_image:d(t.tag_image,e.tag_image),tag_image_url:d(t.tag_image_url,e.tag_image_url),tagImage:d(t.tagImage,e.tagImage)}:e}function p(e,t){if(!t)return e;let n=e.items;return{...e,...t,title:d(t.title,e.title),moreUrl:d(t.moreUrl,e.moreUrl),moreLinkType:t.moreLinkType??e.moreLinkType,recommendMode:t.recommendMode??e.recommendMode,items:n?f(n,t.items):t.items}}function m({mode:a=`renderer`,data:u=c}){let d=a===`editor`,f=u??c,m=Array.isArray(f)&&f.length>0?[p(l[0],f[0])]:l;if(!m||m.length===0)return null;let h=m[0],g=h?.title,_=h?.moreUrl;return s(e,{className:d?`p-3 pointer-events-none`:`p-3`,children:[s(e,{className:`flex items-center justify-between mb-[10px] h-[24px]`,children:[g&&o(t,{as:`h2`,className:`text-[18px] font-bold text-text1 line-clamp-1 flex-1 min-w-0 mr-[12px]`,children:g}),_&&s(n,{href:_,className:`flex items-center text-[14px] text-text2 ml-auto`,children:[`更多`,o(r,{className:`ml-[2px] h-[12px] w-[12px] text-text2`})]})]}),m.map((t,n)=>{let{items:r}=t;return r?o(e,{className:n>0?`mt-3`:``,children:o(i,{data:r})},`large-feature-grid-items-${n}`):null})]})}export{m as LargeFeatureGridClient};
|