@funhub/platform 0.1.159 → 0.1.160-beta.0
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 +22 -1
- package/dist/biz.mjs +1 -1
- package/dist/components/biz/business/advertisement/ad-match.d.mts +98 -0
- package/dist/components/biz/business/advertisement/ad-match.mjs +2 -0
- package/dist/components/biz/business/advertisement/ad-provider.d.mts +33 -0
- package/dist/components/biz/business/advertisement/ad-provider.mjs +2 -0
- package/dist/components/biz/business/advertisement/ad-query.d.mts +27 -0
- package/dist/components/biz/business/advertisement/ad-query.mjs +2 -0
- package/dist/components/biz/business/advertisement/ad-runtime-provider.d.mts +25 -0
- package/dist/components/biz/business/advertisement/ad-runtime-provider.mjs +2 -0
- package/dist/components/biz/business/advertisement/banner-ad/client.d.mts +18 -0
- package/dist/components/biz/business/advertisement/banner-ad/client.mjs +2 -0
- package/dist/components/biz/business/advertisement/banner-ad/index.d.mts +5 -0
- package/dist/components/biz/business/advertisement/banner-ad/material.d.mts +30 -0
- package/dist/components/biz/business/advertisement/banner-ad/material.mjs +2 -0
- package/dist/components/biz/business/advertisement/banner-ad/schema.d.mts +75 -0
- package/dist/components/biz/business/advertisement/banner-ad/schema.mjs +2 -0
- package/dist/components/biz/business/advertisement/banner-ad/server.d.mts +11 -0
- package/dist/components/biz/business/advertisement/banner-ad/server.mjs +2 -0
- package/dist/components/biz/business/advertisement/feed-ad/index.d.mts +39 -0
- package/dist/components/biz/business/advertisement/feed-ad/index.mjs +2 -0
- package/dist/components/biz/business/advertisement/floating-ad/client.d.mts +21 -0
- package/dist/components/biz/business/advertisement/floating-ad/client.mjs +2 -0
- package/dist/components/biz/business/advertisement/floating-ad/index.d.mts +5 -0
- package/dist/components/biz/business/advertisement/floating-ad/material.d.mts +25 -0
- package/dist/components/biz/business/advertisement/floating-ad/material.mjs +2 -0
- package/dist/components/biz/business/advertisement/floating-ad/schema.d.mts +75 -0
- package/dist/components/biz/business/advertisement/floating-ad/schema.mjs +2 -0
- package/dist/components/biz/business/advertisement/floating-ad/server.d.mts +11 -0
- package/dist/components/biz/business/advertisement/floating-ad/server.mjs +2 -0
- package/dist/components/biz/business/advertisement/icon-ad/client.d.mts +16 -0
- package/dist/components/biz/business/advertisement/icon-ad/client.mjs +2 -0
- package/dist/components/biz/business/advertisement/icon-ad/index.d.mts +5 -0
- package/dist/components/biz/business/advertisement/icon-ad/material.d.mts +29 -0
- package/dist/components/biz/business/advertisement/icon-ad/material.mjs +2 -0
- package/dist/components/biz/business/advertisement/icon-ad/schema.d.mts +69 -0
- package/dist/components/biz/business/advertisement/icon-ad/schema.mjs +2 -0
- package/dist/components/biz/business/advertisement/icon-ad/server.d.mts +11 -0
- package/dist/components/biz/business/advertisement/icon-ad/server.mjs +2 -0
- package/dist/components/biz/business/advertisement/index.d.mts +26 -0
- package/dist/components/biz/business/advertisement/text-ad/client.d.mts +15 -0
- package/dist/components/biz/business/advertisement/text-ad/client.mjs +2 -0
- package/dist/components/biz/business/advertisement/text-ad/index.d.mts +5 -0
- package/dist/components/biz/business/advertisement/text-ad/material.d.mts +27 -0
- package/dist/components/biz/business/advertisement/text-ad/material.mjs +2 -0
- package/dist/components/biz/business/advertisement/text-ad/schema.d.mts +53 -0
- package/dist/components/biz/business/advertisement/text-ad/schema.mjs +2 -0
- package/dist/components/biz/business/advertisement/text-ad/server.d.mts +11 -0
- package/dist/components/biz/business/advertisement/text-ad/server.mjs +2 -0
- package/dist/components/biz/business/detail/shared/detail-follow-action.mjs +1 -1
- package/dist/components/biz/business/detail/shared/runtime-context-provider.mjs +1 -1
- package/dist/components/biz/business/detail/shared/use-video-detail-webview-bridge.mjs +1 -1
- package/dist/components/biz/business/detail/video-detail-actions/client.mjs +1 -1
- package/dist/components/biz/business/home-recommend/shared/home-recommend-base.mjs +1 -1
- package/dist/components/biz/business/index.d.mts +22 -0
- package/dist/components/biz/business/large-feature-grid/card-item.mjs +1 -1
- package/dist/components/biz/business/large-feature-grid/client.mjs +1 -1
- package/dist/components/common/series-episodes/index.mjs +1 -1
- package/dist/components/pages/home/client.mjs +1 -1
- package/dist/components/pages/video-detail/video-detail-client.mjs +1 -1
- package/dist/components/pages/video-list/index.mjs +1 -1
- package/dist/components/pages/video-list/video-list-client.mjs +1 -1
- package/dist/components/ui/badge.d.mts +1 -1
- package/dist/components/ui/button.d.mts +1 -1
- package/dist/hooks.d.mts +1 -1
- package/dist/materials.d.mts +6 -1
- package/dist/materials.mjs +1 -1
- package/dist/service/advertisement.d.mts +172 -0
- package/dist/service/advertisement.mjs +2 -0
- package/dist/service.d.mts +2 -1
- package/dist/service.mjs +1 -1
- package/dist/utils/schema/material.d.mts +1 -0
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{pContentGetPopularVideoList as e}from"../../../../../service/generated/client.mjs";import{useRouter as t}from"../../../../../utils/use-compatible-router.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 a from"../../../../ui/loading.mjs";import{useGridFirstRowHeight as o,useWaterfallFirstRowHeight as s}from"../../../../../hooks/use-first-row-height.mjs";import{useMinDurationLoading as c}from"../../../../../hooks/use-min-duration-loading.mjs";import l from"../../../../../assets/icons/detail/video_flag.mjs";import{
|
|
2
|
+
"use client";import{pContentGetPopularVideoList as e}from"../../../../../service/generated/client.mjs";import{useRouter as t}from"../../../../../utils/use-compatible-router.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 a from"../../../../ui/loading.mjs";import{useGridFirstRowHeight as o,useWaterfallFirstRowHeight as s}from"../../../../../hooks/use-first-row-height.mjs";import{useMinDurationLoading as c}from"../../../../../hooks/use-min-duration-loading.mjs";import l from"../../../../../assets/icons/detail/video_flag.mjs";import{FeedAdBadge as u,getFeedAdJumpUrl as ee,isFeedAdItem as d}from"../../advertisement/feed-ad/index.mjs";import{MiniThreeCard as te}from"../../../../common/cards/mini-three-card.mjs";import{HOME_RECOMMEND_DEFAULT_GRID_COLUMNS as ne,HOME_RECOMMEND_DEFAULT_GRID_ROWS as f,HOME_RECOMMEND_DEFAULT_PLAY_COUNT_DELTA as re,HOME_RECOMMEND_DEFAULT_SHOW_EPISODE as p,HOME_RECOMMEND_DEFAULT_SHOW_PLAY_COUNT as ie,HOME_RECOMMEND_MAX_GRID_COLUMNS as m,HOME_RECOMMEND_MAX_GRID_ROWS as ae}from"./home-recommend-default-config.mjs";import{HOME_RECOMMEND_CARD_CONFIG_FIELD as h}from"./home-recommend-preview.mjs";import{enrichHomeRecommendItemsWithVideoDetails as oe}from"./home-recommend-video-detail.mjs";import{useCallback as g,useEffect as _,useLayoutEffect as se,useMemo as v,useRef as y,useState as b}from"react";import{jsx as x,jsxs as S}from"react/jsx-runtime";const ce={},le={list:[]};function ue({variant:n,props:l=ce,data:u=le,mode:ee=`renderer`}){let d=ee===`editor`,te=t(),{list:h,title:ue,cursor:w}=u,T=v(()=>Array.isArray(h)?h:[],[h]),E=v(()=>Array.isArray(u.icons)?u.icons:[],[u.icons]),{rows:me,columns:he,moreLink:ge,title:D,smartTagEnabled:_e,smartTagIds:O,catId:k,showPlayCount:ve,playCountDelta:be,showEpisode:xe,enableInfinite:Se,items:j}=l,M=_e===!0,N=Se===!0&&M,P=!d&&N&&T.length>=16,F=v(()=>Array.isArray(O)?O.map(e=>String(e||``).trim()).filter(Boolean):[],[O]),I=typeof k==`string`?k.trim():``,L=v(()=>M||!Array.isArray(j)?``:j.map(e=>String(e?.contentId||``).trim()).filter(Boolean).join(`,`),[M,j]),[Ce,we]=b(0),[R,z]=b(T),[Te,Ee]=b(E),[B,V]=b(()=>typeof w==`string`?w:void 0),[H,De]=b(!1),U=y(null),Oe=y(null),W=y(null),ke=y([]),G=y({left:null,right:null}),Ae=y(!1),je=y(``),{isLoading:Me,show:Ne,hide:Pe}=c(600),Fe=fe(me,f,ae),K=fe(he,ne,m),q=N?16:n===`grid`?Fe*K:16,J=v(()=>[n,M?`smart`:`manual:${L}`,F.join(`,`),I,String(q)].join(`|`),[M,L,I,q,F,n]);_(()=>{je.current!==J&&(z(T),Ee(E),V(typeof w==`string`?w:void 0))},[w,E,T,J]);let Ie=Fe*K,Le=d&&n===`grid`,Y=Le?R.slice(0,Ie):R,Re=Le?Te.slice(0,Ie):Te,ze=n===`waterfall`?6:4,X=Y.length>0?Math.max(0,Y.length-ze):-1,Be=!!B,Ve=D&&D.trim()||ue||``,He=ve??ie,Ue=Number(be??re),We=xe??p,Ge=!N,Z=Ge?de(ge):``,Ke=Ge&&!!Z,qe=o({enabled:!d&&n===`grid`,containerRef:Oe,firstRowItemRef:ke,columns:K,itemsCount:Y.length,deps:[n]}),Je=s({enabled:!d&&n===`waterfall`,containerRef:U,firstRowRef:G,deps:[n,Y.length]}),Ye=n===`grid`?qe:Je,Xe=g(async()=>{if(!d&&je.current!==J&&(je.current=J,M||L))try{if(Ne(),!M){if(!L)return;z(await oe(R));return}let t=await e({page_size:q,tags:F.length>0?F:void 0,cat_id:I||void 0},{cache:`no-store`}),n=Array.isArray(t.data?.videos)?t.data.videos:[],r=t.data?.cursor;z(n),V(r)}catch(e){console.error(`推荐位刷新首屏失败(client)`,e)}finally{Pe()}},[Pe,d,M,L,J,I,q,F,R,Ne]);_(()=>{Xe()},[Xe]);let Ze=g(async()=>{let t=B;if(!(!P||!t||Ae.current)){Ae.current=!0,De(!0);try{let n=await e({cursor:t,page_size:q,tags:F.length>0?F:void 0,cat_id:I||void 0}),r=Array.isArray(n.data?.videos)?n.data.videos:[],i=n.data?.cursor;r.length>0&&z(e=>e.concat(r)),V(e=>{if(!(!r.length||!i))return i===e?void 0:i})}catch(e){console.error(`推荐位加载下一页失败(client)`,e),V(void 0)}finally{Ae.current=!1,De(!1)}}},[B,I,q,F,P]),Qe=g(()=>{if(Z){if(Z.startsWith(`http`)){window.location.href=Z;return}te.push(Z)}},[Z,te]);_(()=>{let e=W.current;if(!e||!P||!Be)return;let t=new IntersectionObserver(e=>{!e[0]?.isIntersecting||H||Ze()},{root:null,threshold:0});return t.observe(e),()=>{t.disconnect()}},[Ze,Be,H,Y.length,q,P,X]),se(()=>{let e=U.current;if(!e||n!==`waterfall`)return;let t=()=>{let t=e.clientWidth||0;we(t>0?(t-12)/2:0)};t();let r=new ResizeObserver(t);return r.observe(e),()=>{r.disconnect()}},[n]);let Q=v(()=>n===`waterfall`?ye(Y,Re,Ce):{left:[],right:[]},[Ce,Re,Y,n]);if(_(()=>{n===`waterfall`&&(Q.left.length||(G.current.left=null),Q.right.length||(G.current.right=null))},[n,Q.left.length,Q.right.length]),!Y.length)return null;let $=!d&&Me,$e=!d&&H,et=Ye>0?Ye/2:160;return S(r,{className:`w-full mt-[16px]`,children:[S(r,{className:`flex items-center justify-between px-[12px] mb-[8px]`,children:[x(i,{className:`flex-1 min-w-0 text-text1 text-[18px] leading-[26px] font-bold line-clamp-1`,children:Ve}),Ke&&x(i,{className:`text-text3 text-[12px] leading-[18px] cursor-pointer`,onClick:Qe,children:`更多`})]}),n===`grid`&&S(r,{ref:Oe,className:`w-full flex flex-wrap px-[12px] relative`,children:[Y.map((e,t)=>{let r=Re[t],i=pe(e),a=He&&(i?.showPlayCount??!0),o=i?.playCountDelta??Ue,s=i?.showEpisode??We,c=t%K,l=K>1?{paddingLeft:12*c/K,paddingRight:12*(K-c-1)/K}:void 0;return x(`div`,{ref:e=>{t===X&&(W.current=e),t<K&&(ke.current[t]=e)},className:`min-w-0`,style:{width:`${100/K}%`,...l||{}},children:x(C,{variant:n,item:e,icon:r,index:t,showPlayCount:a,playCountDelta:o,showEpisode:s,widthStyle:{width:`100%`}})},A(e,t))}),$&&x(r,{className:`absolute inset-0 z-10 bg-black/15 backdrop-blur-[1px] dark:bg-white/10`,"aria-hidden":!0}),$&&x(r,{className:`absolute left-1/2 -translate-x-1/2 -translate-y-1/2 z-20 pointer-events-none`,style:{top:et},"aria-hidden":!0,children:x(a,{size:`large`,showLabel:!1,className:`text-theme5`})})]}),n===`waterfall`&&S(r,{ref:U,className:`w-full px-[12px] flex gap-[12px] relative`,children:[x(r,{className:`flex-1 min-w-0 flex flex-col`,children:Q.left.map((e,t)=>{let r=pe(e.item),i=He&&(r?.showPlayCount??!0),a=r?.playCountDelta??Ue,o=r?.showEpisode??We;return x(`div`,{ref:n=>{e.index===X&&(W.current=n),t===0&&(G.current.left=n)},children:x(C,{variant:n,item:e.item,icon:e.icon,index:e.index,showPlayCount:i,playCountDelta:a,showEpisode:o,widthStyle:{width:`100%`}})},A(e.item,e.index))})}),x(r,{className:`flex-1 min-w-0 flex flex-col`,children:Q.right.map((e,t)=>{let r=pe(e.item),i=He&&(r?.showPlayCount??!0),a=r?.playCountDelta??Ue,o=r?.showEpisode??We;return x(`div`,{ref:n=>{e.index===X&&(W.current=n),t===0&&(G.current.right=n)},children:x(C,{variant:n,item:e.item,icon:e.icon,index:e.index,showPlayCount:i,playCountDelta:a,showEpisode:o,widthStyle:{width:`100%`}})},A(e.item,e.index))})}),$&&x(r,{className:`absolute inset-0 z-10 bg-black/15 backdrop-blur-[1px] dark:bg-white/10`,"aria-hidden":!0}),$&&x(r,{className:`absolute left-1/2 -translate-x-1/2 -translate-y-1/2 z-20 pointer-events-none`,style:{top:et},"aria-hidden":!0,children:x(a,{size:`large`,showLabel:!1,className:`text-theme5`})})]}),$e&&x(r,{className:`w-full flex justify-center py-[12px]`,children:x(a,{size:`medium`,showLabel:!1,className:`text-theme5`})})]})}function C({variant:e,item:t,icon:n,index:a,showPlayCount:o,playCountDelta:s,showEpisode:c,widthStyle:ne}){let f=d(t),re=E(t),p=t.name||t?.title||``,ie=D(_e(t.static?.browse_cnt??0,s)),m=he(t,c),ae=ve(t,n,a),h=f?ee(t):T(t);return x(te,{url:re,text:p,className:`w-full`,style:ne,topRightChild:ae?x(w,{url:ae}):void 0,bottomLeftChild:f?x(u,{}):o&&!f?S(r,{className:`h-[20px] leading-[20px] text-[#fff] text-[12px] px-[4px] py-0 rounded-[4px] bg-[rgba(255,255,255,0.1)] ml-[4px] flex items-center gap-[4px]`,children:[x(l,{className:`w-[12px] h-[12px] text-[#fff] shrink-0`}),ie]}):null,bottomRightChild:c&&!f?m&&x(i,{className:`text-[#fff] text-[12px] leading-[18px] pr-2`,children:m}):null,textChild:x(r,{className:`py-[4px]`,children:x(i,{as:`h3`,className:`text-text1 text-[16px] leading-[24px] ${e===`waterfall`?`break-words line-clamp-3`:`line-clamp-1`}`,children:p})}),linkPath:h})}function w({url:e}){return x(r,{className:`relative w-[40px] h-[20px]`,children:x(n,{src:e,alt:`corner`,width:40,height:20,className:`w-full h-auto`})})}function T(e){let t=encodeURIComponent(e.name||``);return`/video/${e.id||``}/${t}/episode/1`}function de(e){return e?e.trim():``}function fe(e,t,n){let r=Number(e);return!Number.isFinite(r)||r<=0?t:Math.min(n,Math.floor(r))}function pe(e){return e[h]}function E(e){return e.img_y||e.img_x||e?.coverUrl}function me(e){return typeof e==`string`?e:``}function he(e,t){if(!t)return``;if(ge(e)){let t=e.update_status===`0`,n=Number(e.episode_cnt||e.links?.length||0);return n>0?`${t?`更新至`:`全`}${n}集`:``}return k(Number(e.duration||0))}function ge(e){if(Number(e.type??0)===2)return!0;let t=Number(e.episode_cnt||e.links?.length||0);return Number.isFinite(t)&&t>1}function D(e){return!Number.isFinite(e)||e<=0?`0`:e>=1e6?`${O(e/1e6)}M`:e>=1e3?`${O(e/1e3)}k`:Math.floor(e).toString()}function _e(e,t){let n=Number(e||0),r=Number(t||0);return!Number.isFinite(n)||!Number.isFinite(r)?0:Math.max(0,n+r)}function O(e){let t=e.toFixed(1);return t.endsWith(`.0`)?t.slice(0,-2):t}function k(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 ve(e,t,n){return me(e.badge_url)||me(t?.material_url)||``}function ye(e,t,n){let r=[],i=[],a=n<=0,o=0,s=0;return e.forEach((e,c)=>{let l=t[c];if(a){c%2==0?r.push({item:e,icon:l,index:c}):i.push({item:e,icon:l,index:c});return}let u=be(n,e);o<=s?(r.push({item:e,icon:l,index:c}),o+=u):(i.push({item:e,icon:l,index:c}),s+=u)}),{left:r,right:i}}function be(e,t){if(!e)return 0;let n=e*1.3461538461538463,r=he(t,!0)?18:0;return n+20+r+6+16}function A(e,t){return e.id?`home-recommend-${e.id}`:`home-recommend-${t}`}export{ue as default};
|
|
@@ -2,6 +2,28 @@
|
|
|
2
2
|
import { defaultProps } from "../basics/fullscreen-feed/defaults/default-props.mjs";
|
|
3
3
|
import { FullscreenFeedClient } from "../basics/fullscreen-feed/runtime/client.mjs";
|
|
4
4
|
import { schema } from "../basics/fullscreen-feed/schema/index.mjs";
|
|
5
|
+
import { BannerAdInspectorProps, BannerAdItem, BannerAdProps, BannerAdStyleSize, bannerAdInspectorDefaultProps, bannerAdInspectorPropsSchema, bannerAdStyleSizeOptions } from "./advertisement/banner-ad/schema.mjs";
|
|
6
|
+
import { FloatingAdEditableProps, FloatingAdInspectorProps, FloatingAdItem, FloatingAdProps, floatingAdInspectorDefaultProps, floatingAdInspectorPropsSchema } from "./advertisement/floating-ad/schema.mjs";
|
|
7
|
+
import { IconAdInspectorProps, IconAdItem, IconAdProps, iconAdInspectorDefaultProps, iconAdInspectorPropsSchema } from "./advertisement/icon-ad/schema.mjs";
|
|
8
|
+
import { TextAdInspectorProps, TextAdItem, TextAdProps, textAdInspectorDefaultProps, textAdInspectorPropsSchema } from "./advertisement/text-ad/schema.mjs";
|
|
9
|
+
import { AdsMatchExtData, adaptBannerAdProps, adaptFloatingAdItem, adaptIconAdProps, adaptPopupAdMaterials, adaptTextAdProps, buildAdsMatchRequest, getFirstMatchedMaterial, hasMatchedAds, parseAdsMatchExtData, resolveAdsAppCode, sortAdsMatchMaterials } from "./advertisement/ad-match.mjs";
|
|
10
|
+
import { AdProvider, AdProviderProps, AdProviderValue, useAdProvider } from "./advertisement/ad-provider.mjs";
|
|
11
|
+
import { AdsMatchQueryOptions, createAdsMatchPrefetchItem, createAdsMatchQueryFn, getAdsMatchQueryKey } from "./advertisement/ad-query.mjs";
|
|
12
|
+
import { AdRuntimeProvider, AdRuntimeProviderProps } from "./advertisement/ad-runtime-provider.mjs";
|
|
13
|
+
import { BannerAd } from "./advertisement/banner-ad/client.mjs";
|
|
14
|
+
import { BannerAdServer } from "./advertisement/banner-ad/server.mjs";
|
|
15
|
+
import { bannerAdMaterial } from "./advertisement/banner-ad/material.mjs";
|
|
16
|
+
import { FeedAdBadge, FeedAdItemLike, getFeedAdIcon, getFeedAdJumpUrl, isFeedAdItem } from "./advertisement/feed-ad/index.mjs";
|
|
17
|
+
import { FloatingAd } from "./advertisement/floating-ad/client.mjs";
|
|
18
|
+
import { FloatingAdServer } from "./advertisement/floating-ad/server.mjs";
|
|
19
|
+
import { floatingAdMaterial } from "./advertisement/floating-ad/material.mjs";
|
|
20
|
+
import { IconAd } from "./advertisement/icon-ad/client.mjs";
|
|
21
|
+
import { IconAdServer } from "./advertisement/icon-ad/server.mjs";
|
|
22
|
+
import { iconAdMaterial } from "./advertisement/icon-ad/material.mjs";
|
|
23
|
+
import { TextAd } from "./advertisement/text-ad/client.mjs";
|
|
24
|
+
import { TextAdServer } from "./advertisement/text-ad/server.mjs";
|
|
25
|
+
import { textAdMaterial } from "./advertisement/text-ad/material.mjs";
|
|
26
|
+
import "./advertisement/index.mjs";
|
|
5
27
|
import { defaultProps as defaultProps$1 } from "./banner/variants/basic-banner/defaults/default-props.mjs";
|
|
6
28
|
import { BasicBannerClient } from "./banner/variants/basic-banner/runtime/client.mjs";
|
|
7
29
|
import { schema as schema$1 } from "./banner/variants/basic-banner/schema/index.mjs";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{Image as e}from"../../../ui/image.mjs";import{Box as t}from"../../../ui/box.mjs";import{Text as n}from"../../../ui/text.mjs";import r from"../../../ui/link.mjs";import i from"../../../../assets/icons/view.mjs";import{jsx as
|
|
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{FeedAdBadge as i,getFeedAdIcon as a,getFeedAdJumpUrl as o,isFeedAdItem as s}from"../advertisement/feed-ad/index.mjs";import c from"../../../../assets/icons/view.mjs";import{jsx as l,jsxs as u}from"react/jsx-runtime";function d(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 f({data:f}){return f?l(t,{children:(Array.isArray(f)?f:[f]).map((f,p)=>{if(!f||typeof f!=`object`)return null;let{id:m,title:h,desc:g,cover:_,tagImageUrl:v,showEpisode:y,episodeText:b,showPlayCount:x,play_count:S}=f,C=s(f),w=h||``,T=(C?a(f):``)||_,E=C?o(f):m?`/video/${m}/${w?encodeURIComponent(w):``}`:`#`,D=v?String(v):null,O=b==null?``:String(b).trim(),k=!C&&(y??!0)&&O!==``,A=!C&&(x??!0),j=d(S);return l(t,{children:u(r,{href:E,children:[u(t,{className:`relative w-full overflow-hidden rounded-[12px] bg-neutral-800`,style:{aspectRatio:`16/9`},children:[T&&l(e,{src:T,alt:w||`封面`,fill:!0,objectFit:`cover`}),D&&l(t,{className:`absolute top-0 right-0 z-10 w-[37px] h-[20px]`,children:l(e,{src:D,alt:w||`角标`,fill:!0,sizes:`37px`,className:`object-contain`})}),l(t,{className:`absolute inset-x-0 bottom-0 h-[40px] bg-gradient-to-t from-black/80 to-transparent z-0 pointer-events-none`}),C?l(t,{className:`absolute bottom-0 left-[8px] mb-[6px] z-10 flex items-center gap-[4px]`,children:l(i,{})}):A&&u(t,{className:`absolute bottom-0 left-[8px] mb-[6px] z-10 flex items-center gap-[4px]`,children:[l(c,{className:`h-[14px] w-[14px] text-white`}),l(n,{as:`span`,className:`text-[12px] font-medium text-white drop-shadow-md`,children:j})]}),k&&l(t,{className:`absolute bottom-0 right-[8px] mb-[6px] z-10 flex items-center`,children:l(n,{as:`span`,className:`text-[12px] font-medium text-white drop-shadow-md`,children:O})})]}),u(t,{className:`flex items-center justify-between gap-[12px] pt-[10px] px-2`,children:[u(t,{className:`flex-1 min-w-0`,children:[l(n,{as:`h3`,className:`text-[16px] font-semibold leading-[24px] text-text1 line-clamp-1`,children:w}),g&&l(n,{as:`p`,className:`mt-[4px] text-[13px] leading-[20px] text-text2 line-clamp-1`,children:g})]}),l(n,{className:`shrink-0 rounded-[20px] border border-[#FD4C5E] px-[24px] py-[8px] text-[14px] font-normal text-[#FD4C5E]`,children:`观看`})]})]})},m||w||`large-grid-item-${p}`)})}):null}export{f as LargeGridItemClient};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{isClient as e}from"../../../../utils/common.mjs";import{pContentBatchGetVideoDetail as t}from"../../../../service/generated/client.mjs";import{Box as n}from"../../../ui/box.mjs";import{Text as r}from"../../../ui/text.mjs";import i from"../../../ui/loading.mjs";import a from"../../../ui/link.mjs";import{useSingleFirstRowHeight as o}from"../../../../hooks/use-first-row-height.mjs";import{useMinDurationLoading as s}from"../../../../hooks/use-min-duration-loading.mjs";import c from"../../../../assets/icons/common/right_arrow.mjs";import{
|
|
2
|
+
"use client";import{isClient as e}from"../../../../utils/common.mjs";import{pContentBatchGetVideoDetail as t}from"../../../../service/generated/client.mjs";import{Box as n}from"../../../ui/box.mjs";import{Text as r}from"../../../ui/text.mjs";import i from"../../../ui/loading.mjs";import a from"../../../ui/link.mjs";import{useSingleFirstRowHeight as o}from"../../../../hooks/use-first-row-height.mjs";import{useMinDurationLoading as s}from"../../../../hooks/use-min-duration-loading.mjs";import c from"../../../../assets/icons/common/right_arrow.mjs";import{isFeedAdItem as l}from"../advertisement/feed-ad/index.mjs";import{LargeGridItemClient as u}from"./card-item.mjs";import{largeFeatureGridInspectorDefaultProps as d}from"./schema.mjs";import{useEffect as f,useMemo as p,useRef as m,useState as h}from"react";import{jsx as g,jsxs as _}from"react/jsx-runtime";const v=[],y=d.data??[];function b(e){return e==null}function x(e,t){return b(e)?t:e}function S(e){return typeof e==`string`?e.trim():``}function C(e){return S(e)}function w(e){let t=Number(e);if(!(!Number.isFinite(t)||t<0))return t}function T(e){let t=e,n=S(e.update_status)===`0`,r=(Array.isArray(t.episodes)?t.episodes.length:0)||(Array.isArray(e.video_episodes)?e.video_episodes.length:0)||(Array.isArray(e.links)?e.links.length:0)||(w(e.episode_cnt)??0);return!Number.isFinite(r)||r<=0?``:`${n?`更新至`:`全`}${Math.floor(r)}集`}function E(e,t){return t?{...e,...t,id:x(t.id,e.id),cover:x(t.cover,e.cover),title:x(t.title,e.title),desc:x(t.desc,e.desc),play_count:x(t.play_count,e.play_count),showPlayCount:t.showPlayCount??e.showPlayCount,episodeText:x(t.episodeText,e.episodeText),showEpisode:t.showEpisode??e.showEpisode,useContentCover:t.useContentCover??e.useContentCover,tagImageUrl:x(t.tagImageUrl,e.tagImageUrl)}:e}function D(e,t){if(!t)return e;let n=e.items;return{...e,...t,title:x(t.title,e.title),moreUrl:x(t.moreUrl,e.moreUrl),moreLinkType:t.moreLinkType??e.moreLinkType,items:n?E(n,t.items):t.items}}function O({mode:d=`renderer`,data:b=v}){let x=d===`editor`,S=b??v,E=Array.isArray(S)&&S.length>0,O=p(()=>E?[D(y[0],S[0])]:y,[E,S]),[k,A]=h(O),j=m(``),M=m(null),{isLoading:N,show:P,hide:F,cancel:I}=s(500);f(()=>{A(O)},[O]);let L=o({enabled:!x,containerRef:M,itemRef:M,deps:[k.length]}),R=p(()=>{if(x||!E)return``;let e=O.map(e=>C(e?.items?.id)).filter(Boolean);return Array.from(new Set(e)).join(`,`)},[E,x,O]);if(f(()=>{if(x||!e()||!R||j.current===R)return;j.current=R;let n=!1;async function r(){try{P();let e=await t({ids:R.split(`,`).filter(Boolean)},{cache:`no-store`}),r=Array.isArray(e.data?.videos)?e.data.videos:[],i=new Map;if(r.forEach(e=>{let t=C(e.video_id||e.id||e.mid);t&&i.set(t,e)}),n)return;A(e=>e.map(e=>{let t=e.items;if(!t||l(t))return e;let n=C(t.id),r=n?i.get(n):void 0;if(!r)return e;let a=w(r.play_count)??w(r.browse_count),o=T(r);return{...e,items:{...t,play_count:a??t.play_count,episodeText:o||t.episodeText}}}))}catch(e){console.error(`大图推荐刷新首屏失败(client)`,e)}finally{n||F()}}return r(),()=>{n=!0,I()}},[I,R,F,x,P]),!k||k.length===0)return null;let z=k[0],B=z?.title,V=z?.moreUrl,H=L>0?L/2:160,U=!x&&N;return _(n,{className:x?`p-3 pointer-events-none`:`p-3`,children:[_(n,{className:`flex items-center justify-between mb-[10px] h-[24px]`,children:[B&&g(r,{as:`h2`,className:`text-[18px] font-bold text-text1 line-clamp-1 flex-1 min-w-0 mr-[12px]`,children:B}),V&&_(a,{href:V,className:`flex items-center text-[14px] text-text2 ml-auto`,children:[`更多`,g(c,{className:`ml-[2px] h-[12px] w-[12px] text-text2`})]})]}),_(n,{className:`relative`,children:[k.map((e,t)=>{let{items:r}=e;return r?g(n,{ref:t===0?M:void 0,className:t>0?`mt-3`:``,children:g(u,{data:r})},`large-feature-grid-items-${t}`):null}),U&&g(n,{className:`absolute inset-0 z-10 bg-black/15 backdrop-blur-[1px] dark:bg-white/10`,"aria-hidden":!0}),U&&g(n,{className:`absolute left-1/2 -translate-x-1/2 -translate-y-1/2 z-20 pointer-events-none`,style:{top:H},"aria-hidden":!0,children:g(i,{size:`large`,showLabel:!1,className:`text-theme5`})})]})]})}export{O as LargeFeatureGridClient};
|
|
@@ -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{Sheet as n,SheetContent as r,SheetHeader as i,SheetTitle as a}from"../../ui/sheet.mjs";import{Switch as o}from"../../ui/switch.mjs";import{useKeepAliveState as s}from"../keep-scroll-position/index.mjs";import c from"../../../assets/icons/close.mjs";import l from"../../../assets/icons/common/right_arrow.mjs";import u from"../../ui/popup.mjs";import{useCallback as d,useEffect as f,useMemo as p,useRef as m,useState as h}from"react";import{Fragment as g,jsx as _,jsxs as v}from"react/jsx-runtime";import{toast as y}from"sonner";import{useTranslations as b}from"next-intl";const x=`funhub:detail-series-popup-query`,S=`funhub:detail-series-popup-close`;function C(e){return e.type===x&&e instanceof CustomEvent}function w(e,t,n){return(e||[]).map((e,r)=>{let i=Number.parseInt(e?.id||``,10),a=Number.isNaN(i)?r+1:i,o=e?.id||``,s=Number.isNaN(i)&&o||n(a);return{id:e?.id||`${t}-${a}`,series_num:a,title:s}})}function T(e,t,n){return(e||[]).map((e,r)=>{let i=Number(e?.id),a=Number.isNaN(i)?r+1:i,o=n(a);return{id:e?.id||`${t}-${a}`,series_num:a,title:o}})}function E(e,t,n){return e<=0?n(`singleContent`):n(t===`1`?`completedSeriesTotal`:`ongoingSeriesTotal`,{total:e})}function D(e){return e.mode===`detail`?_(k,{information:e.information,series_num:e.series_num,onEpisodeChange:e.onEpisodeChange}):_(O,{open:e.open,variant:e.variant,title:e.title,updateStatus:e.updateStatus,summaryText:e.summaryText,seriesList:e.seriesList,activeEpisodeId:e.activeEpisodeId,showEpisodeTitle:e.showEpisodeTitle,onToggleTitle:e.onToggleTitle,onClose:e.onClose,onSelectEpisode:e.onSelectEpisode,popupBodyStyle:e.popupBodyStyle})}function O({open:s,variant:l,title:d,updateStatus:g,summaryText:y,seriesList:x,activeEpisodeId:S,showEpisodeTitle:C=!1,onToggleTitle:T,onClose:D,onSelectEpisode:O,popupBodyStyle:k}){let A=b(`components.common.seriesEpisodes`),j=!!T,M=j&&C,N=m(null),P=m(null),F=p(()=>w(x,`episode`,e=>A(`episodeLabel`,{episode:e})),[x,A]),I=p(()=>{if(F.length===0)return[];let e=[];return F.forEach((t,n)=>{let r=Math.floor(n/50);e[r]||(e[r]=[]),e[r].push(t)}),e},[F]),L=p(()=>{if(!S)return 0;let e=F.findIndex(e=>e.id===S);return e<0?0:Math.floor(e/50)},[S,F]),[R,z]=h(L);f(()=>{z(L)},[L]);let B=p(()=>typeof y==`string`&&y.trim()?y:E(F.length,g,A),[F.length,y,A,g]),V=d||A(`selectorTitle`);function H(){let e=N.current;if(e){P.current&&=(window.cancelAnimationFrame(P.current),null),e.scrollTop=0;try{e.scrollTo({top:0,left:0,behavior:`auto`})}catch{}P.current=window.requestAnimationFrame(()=>{P.current=null;let e=N.current;e&&(e.scrollTop=0)})}}f(()=>{s&&H()},[s,C,R]);function U(e){T&&(T(e),H())}function W(e){O?.(e.id,e.series_num),D()}let G=M?2:5,K=I.length>1?_(`div`,{className:`shrink-0 w-full flex gap-[8px] overflow-x-auto`,children:I.map((e,t)=>{if(e.length===0)return null;let n=t===R,r=t*50+1,i=Math.min((t+1)*50,F.length);return v(`div`,{className:`shrink-0 px-[16px] py-[6px] rounded-[16px] text-[14px] transition-colors cursor-pointer relative overflow-hidden ${n?`text-theme5 bg-bg2`:`text-text2 bg-bg2`}`,onClick:()=>{z(t),H()},children:[r,`-`,i,n&&_(`div`,{className:`absolute w-full h-full top-0 left-0 opacity-20 bg-theme5`})]},`series-group-${t}`)})}):null,q=v(`div`,{className:`pb-[8px] flex justify-between`,children:[_(`span`,{className:`text-[16px] text-text1`,children:B}),j&&v(`div`,{className:`flex items-center gap-[4px]`,children:[_(o,{size:`sm`,className:`data-checked:bg-theme5 h-[20px] w-[33px]`,checked:C,onCheckedChange:e=>{U(!!e)}}),_(`button`,{type:`button`,className:`text-[16px] text-text1`,onClick:()=>{U(!C)},children:A(`episodeTitle`)})]})]}),J=_(`div`,{className:`grid w-full gap-2 ${G===2?`grid-cols-2`:`grid-cols-5`}`,children:(I[R]||[]).map((e,t)=>{let n=!!(S&&e.id===S);return _(`button`,{type:`button`,"data-episode-id":e.id,onClick:()=>{W(e)},className:`flex items-center justify-center w-full h-[60px] rounded-[8px] border border-line1 border-solid text-[16px] cursor-pointer select-none transition-colors relative overflow-hidden ${n?`font-bold text-theme5 bg-line1`:`text-text1`} ${M?`h-[72px] px-[10px] text-[14px]`:``} ${t%G===0?``:`border-l-0`}`,children:M?_(`span`,{className:`leading-[22px] line-clamp-2`,children:e.title}):e.series_num},e.id)})});return l===`sheet`?_(n,{open:s,onOpenChange:e=>!e&&D(),children:v(r,{side:`bottom`,showCloseButton:!0,className:`min-h-[50vh] bg-bg1 text-text1 rounded-t-2xl border-t border-white/10`,children:[_(i,{className:`pt-3 pb-0`,children:_(a,{className:`flex items-center justify-between text-lg text-text1`,children:V})}),v(`div`,{className:`px-4 pb-2 flex flex-col gap-3`,children:[K,q]}),_(`div`,{ref:N,className:`flex-1 h-0 pt-[4px] pb-[12px] overflow-y-auto px-4`,children:J})]})}):_(u,{open:s,onOpenChange:e=>{e||D()},showCloseButton:!1,className:`border-0 bg-transparent p-0`,children:v(e,{className:`w-full flex flex-col bg-bg1 px-[12px] text-text1`,style:{height:`70vh`,...k},children:[v(e,{className:`shrink-0 flex justify-between items-center h-[48px]`,children:[_(t,{className:`text-[16px] font-bold text-text1`,children:V}),_(e,{className:`pl-[12px] h-full flex items-center`,onClick:D,children:_(c,{className:`w-[14px] h-[14px] text-text1 cursor-pointer`})})]}),v(e,{className:`flex-1 h-0 w-full pb-[12px] flex flex-col gap-3`,children:[K,q,_(e,{ref:N,className:`flex-1 h-0 pt-[4px] pb-[12px] overflow-y-auto`,children:J})]})]})})}function k({information:n,series_num:r,onEpisodeChange:i}){let a=b(`components.common`),[o,c]=s(`detail-series-popup-${n.id}`,!1),[u,w]=s(`detail-series-title-toggle-${n.id}`,!1),[E,D]=s(`detail-series-scroll-left-${n.id}`,null),[k,A]=h(r);f(()=>{A(r)},[n.id,r]),f(()=>{if(typeof window>`u`)return;let e=()=>{c(!1)};return window.addEventListener(S,e),()=>{window.removeEventListener(S,e)}},[c]),f(()=>{if(typeof window>`u`)return;let e=e=>{if(!C(e))return;let t=e.detail||{};t.open=!!t.open||!!o};return window.addEventListener(x,e),()=>{window.removeEventListener(x,e)}},[o]);let j=p(()=>T((n.links||[]).map(e=>({id:e.id,name:e.name})),n.id||`episode`,e=>a(`seriesEpisodes.episodeLabel`,{episode:e})),[n.id,n.links,a]),M=n.update_status===`1`?a(`seriesEpisodes.completedSeriesTotal`,{total:n.links.length}):a(`seriesEpisodes.ongoingSeriesUpdatedTo`,{total:n.links.length}),N=p(()=>n.links[k-1]?.id||n.links[0]?.id||``,[n.links,k]),P=m(null),F=m(null),I=m(null),L=m(!1),R=m(null),z=m(null),B=m(null),[V,H]=h(!1),U=d((e,t=`smooth`)=>{let n=P.current?.querySelector(`[data-content-id="${e}"]`);if(n&&P.current){let e=P.current,r=Math.max(0,n.offsetLeft-10);e.scrollTo({left:r,behavior:t})}},[]),W=d(()=>{z.current!==null&&(window.clearTimeout(z.current),z.current=null)},[]),G=d(()=>{B.current!==null&&(window.clearTimeout(B.current),B.current=null)},[]),K=d(()=>{R.current!==null&&(y.dismiss(R.current),R.current=null),W(),G()},[G,W]),q=d(()=>{F.current=null,I.current=null,K(),H(!1)},[K]),J=d((e,t)=>{G(),B.current=window.setTimeout(()=>{B.current=null,F.current===e&&q()},Math.max(0,t))},[G,q]);f(()=>{L.current=!1},[n.id]),f(()=>{if(L.current||!N)return;let e=window.requestAnimationFrame(()=>{let e=P.current;e&&(typeof E==`number`?e.scrollTo({left:Math.max(0,E),behavior:`auto`}):(U(N,`auto`),D(Math.max(0,Math.round(e.scrollLeft)))),L.current=!0)});return()=>{window.cancelAnimationFrame(e)}},[N,E,U,D]),f(()=>{let e=F.current;!e||e!==r||J(e,1e3)},[J,r]),f(()=>()=>{q()},[q]);let Y=d((e,t,n)=>{let r=P.current;if(!r||!e)return t;let i=r.querySelector(`[data-content-id="${e}"]`);if(!i)return t;let a=r.getBoundingClientRect();if(a.width<=0||typeof n!=`number`||(n-a.left)/a.width<.5)return t;let o=i.offsetLeft+i.offsetWidth/2,s=r.clientWidth/2,c=Math.max(0,r.scrollWidth-r.clientWidth),l=Math.min(c,Math.max(0,o-s));return r.scrollTo({left:l,behavior:`smooth`}),Math.round(l)},[]),X=d((e,t=`inline`,o,s)=>{if(e!==k){if(!n.links[e-1]){y.error(a(`seriesEpisodes.episodeNotFound`));return}if(typeof window<`u`&&window.isWebView===!0){try{A(e);let c=o||n.links[e-1]?.id||``,l=Math.max(0,Math.round(P.current?.scrollLeft||0));t===`popup`?(c&&U(c,`auto`),D(Math.max(0,Math.round(P.current?.scrollLeft||0)))):D(Y(c,l,s)),H(!0),K(),R.current=y.loading(a(`seriesEpisodes.episodeSwitching`)),F.current=e,I.current=t,z.current=window.setTimeout(()=>{F.current===e&&(A(r),q(),y.error(a(`seriesEpisodes.episodeSwitchFailed`)))},3e3),i(e)}catch(e){A(r),q(),console.error(`切换剧集失败`,e),y.error(a(`seriesEpisodes.episodeSwitchFailed`))}return}try{A(e);let c=o||n.links[e-1]?.id||``,l=Math.max(0,Math.round(P.current?.scrollLeft||0));t===`popup`?(c&&U(c,`auto`),D(Math.max(0,Math.round(P.current?.scrollLeft||0)))):D(Y(c,l,s)),H(!0),K(),R.current=y.loading(a(`seriesEpisodes.episodeSwitching`)),F.current=e,I.current=t,z.current=window.setTimeout(()=>{F.current===e&&(A(r),q(),y.error(a(`seriesEpisodes.episodeSwitchFailed`)))},8e3),i(e)}catch(e){A(r),q(),console.error(`切换剧集失败`,e),y.error(a(`seriesEpisodes.episodeSwitchFailed`))}}},[q,K,n.links,i,k,r,Y,U,D,a]),[Z,Q]=h(`70vh`),$=d(()=>{if(typeof window>`u`)return;if(window.isWebView===!0){Q(`100vh`);return}let e=document.getElementById(`selectPopupPosition`),t=window.visualViewport?.height||window.innerHeight;if(!e){Q(`70vh`);return}let n=Math.max(0,t-e.offsetTop);if(n<=0){Q(`70vh`);return}Q(`${n}px`)},[]);return f(()=>{if(!o)return;$();let e=()=>{$()};return window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[$,o]),j.length<=1?null:v(g,{children:[v(e,{className:`w-full mt-[16px] flex flex-col items-end mb-[4px]`,children:[v(e,{className:`w-fit flex items-center px-[12px] h-[28px]`,onClick:()=>c(!0),children:[_(t,{className:`text-[14px] text-text2 leading-[20px]`,children:M}),_(l,{className:`w-[11px] h-[18px] ml-[4px] text-text2`})]}),_(`div`,{ref:P,className:`w-full mt-[12px] overflow-x-auto px-[12px] flex gap-x-[8px] ${u?`h-[76px]`:`h-[60px]`} ${V?`touch-none`:``}`,children:j.map((e,n)=>_(`div`,{"data-content-id":e.id,className:`shrink-0 h-[full] px-[18px] rounded-[6px] border border-line1 flex items-center ${u?`w-[162px]`:`w-[60px] !px-[0] justify-center`} ${e.id===N?`!border-theme5 bg-line1`:``}`,onClick:t=>{X(n+1,`inline`,e.id,t.clientX)},children:_(t,{className:`text-[16px] text-text1 leading-[22px] line-clamp-2 ${e.id===N?`font-bold !text-theme5`:``}`,children:u?e.title:e.series_num})},e.id))})]}),_(O,{title:a(`seriesEpisodes.selectorTitle`),variant:`popup`,open:o,updateStatus:n.update_status,summaryText:M,seriesList:(n.links||[]).map(e=>({id:e.id,name:e.name})),activeEpisodeId:N,showEpisodeTitle:u,onToggleTitle:e=>{w(e)},onClose:()=>c(!1),onSelectEpisode:(e,t)=>{c(!1),X(t,`popup`,e)},popupBodyStyle:{height:Z}})]})}export{D as SeriesEpisodes};
|
|
2
|
+
"use client";import{Box as e}from"../../ui/box.mjs";import{Text as t}from"../../ui/text.mjs";import{Sheet as n,SheetContent as r,SheetHeader as i,SheetTitle as a}from"../../ui/sheet.mjs";import{Switch as o}from"../../ui/switch.mjs";import{useKeepAliveState as s}from"../keep-scroll-position/index.mjs";import c from"../../../assets/icons/close.mjs";import l from"../../../assets/icons/common/right_arrow.mjs";import u from"../../ui/popup.mjs";import{useCallback as d,useEffect as f,useMemo as p,useRef as m,useState as h}from"react";import{Fragment as g,jsx as _,jsxs as v}from"react/jsx-runtime";import{toast as y}from"sonner";import{useTranslations as b}from"next-intl";function x(e,t,n){return(e||[]).map((e,r)=>{let i=Number.parseInt(e?.id||``,10),a=Number.isNaN(i)?r+1:i,o=e?.id||``,s=Number.isNaN(i)&&o||n(a);return{id:e?.id||`${t}-${a}`,series_num:a,title:s}})}function S(e,t,n){return(e||[]).map((e,r)=>{let i=Number(e?.id),a=Number.isNaN(i)?r+1:i,o=n(a);return{id:e?.id||`${t}-${a}`,series_num:a,title:o}})}function C(e,t,n){return e<=0?n(`singleContent`):n(t===`1`?`completedSeriesTotal`:`ongoingSeriesTotal`,{total:e})}function w(e){return e.mode===`detail`?_(E,{information:e.information,series_num:e.series_num,onEpisodeChange:e.onEpisodeChange}):_(T,{open:e.open,variant:e.variant,title:e.title,updateStatus:e.updateStatus,summaryText:e.summaryText,seriesList:e.seriesList,activeEpisodeId:e.activeEpisodeId,showEpisodeTitle:e.showEpisodeTitle,onToggleTitle:e.onToggleTitle,onClose:e.onClose,onSelectEpisode:e.onSelectEpisode,popupBodyStyle:e.popupBodyStyle})}function T({open:s,variant:l,title:d,updateStatus:g,summaryText:y,seriesList:S,activeEpisodeId:w,showEpisodeTitle:T=!1,onToggleTitle:E,onClose:D,onSelectEpisode:O,popupBodyStyle:k}){let A=b(`components.common.seriesEpisodes`),j=!!E,M=j&&T,N=m(null),P=m(null),F=p(()=>x(S,`episode`,e=>A(`episodeLabel`,{episode:e})),[S,A]),I=p(()=>{if(F.length===0)return[];let e=[];return F.forEach((t,n)=>{let r=Math.floor(n/50);e[r]||(e[r]=[]),e[r].push(t)}),e},[F]),L=p(()=>{if(!w)return 0;let e=F.findIndex(e=>e.id===w);return e<0?0:Math.floor(e/50)},[w,F]),[R,z]=h(L);f(()=>{z(L)},[L]);let B=p(()=>typeof y==`string`&&y.trim()?y:C(F.length,g,A),[F.length,y,A,g]),V=d||A(`selectorTitle`);function H(){let e=N.current;if(e){P.current&&=(window.cancelAnimationFrame(P.current),null),e.scrollTop=0;try{e.scrollTo({top:0,left:0,behavior:`auto`})}catch{}P.current=window.requestAnimationFrame(()=>{P.current=null;let e=N.current;e&&(e.scrollTop=0)})}}f(()=>{s&&H()},[s,T,R]);function U(e){E&&(E(e),H())}function W(e){O?.(e.id,e.series_num),D()}let G=M?2:5,K=I.length>1?_(`div`,{className:`shrink-0 w-full flex gap-[8px] overflow-x-auto`,children:I.map((e,t)=>{if(e.length===0)return null;let n=t===R,r=t*50+1,i=Math.min((t+1)*50,F.length);return v(`div`,{className:`shrink-0 px-[16px] py-[6px] rounded-[16px] text-[14px] transition-colors cursor-pointer relative overflow-hidden ${n?`text-theme5 bg-bg2`:`text-text2 bg-bg2`}`,onClick:()=>{z(t),H()},children:[r,`-`,i,n&&_(`div`,{className:`absolute w-full h-full top-0 left-0 opacity-20 bg-theme5`})]},`series-group-${t}`)})}):null,q=v(`div`,{className:`pb-[8px] flex justify-between`,children:[_(`span`,{className:`text-[16px] text-text1`,children:B}),j&&v(`div`,{className:`flex items-center gap-[4px]`,children:[_(o,{size:`sm`,className:`data-checked:bg-theme5 h-[20px] w-[33px]`,checked:T,onCheckedChange:e=>{U(!!e)}}),_(`button`,{type:`button`,className:`text-[16px] text-text1`,onClick:()=>{U(!T)},children:A(`episodeTitle`)})]})]}),J=_(`div`,{className:`grid w-full gap-2 ${G===2?`grid-cols-2`:`grid-cols-5`}`,children:(I[R]||[]).map((e,t)=>{let n=!!(w&&e.id===w);return _(`button`,{type:`button`,"data-episode-id":e.id,onClick:()=>{W(e)},className:`flex items-center justify-center w-full h-[60px] rounded-[8px] border border-line1 border-solid text-[16px] cursor-pointer select-none transition-colors relative overflow-hidden ${n?`font-bold text-theme5 bg-line1`:`text-text1`} ${M?`h-[72px] px-[10px] text-[14px]`:``} ${t%G===0?``:`border-l-0`}`,children:M?_(`span`,{className:`leading-[22px] line-clamp-2`,children:e.title}):e.series_num},e.id)})});return l===`sheet`?_(n,{open:s,onOpenChange:e=>!e&&D(),children:v(r,{side:`bottom`,showCloseButton:!0,className:`min-h-[50vh] bg-bg1 text-text1 rounded-t-2xl border-t border-white/10`,children:[_(i,{className:`pt-3 pb-0`,children:_(a,{className:`flex items-center justify-between text-lg text-text1`,children:V})}),v(`div`,{className:`px-4 pb-2 flex flex-col gap-3`,children:[K,q]}),_(`div`,{ref:N,className:`flex-1 h-0 pt-[4px] pb-[12px] overflow-y-auto px-4`,children:J})]})}):_(u,{open:s,onOpenChange:e=>{e||D()},showCloseButton:!1,className:`border-0 bg-transparent p-0`,children:v(e,{className:`w-full flex flex-col bg-bg1 px-[12px] text-text1`,style:{height:`70vh`,...k},children:[v(e,{className:`shrink-0 flex justify-between items-center h-[48px]`,children:[_(t,{className:`text-[16px] font-bold text-text1`,children:V}),_(e,{className:`pl-[12px] h-full flex items-center`,onClick:D,children:_(c,{className:`w-[14px] h-[14px] text-text1 cursor-pointer`})})]}),v(e,{className:`flex-1 h-0 w-full pb-[12px] flex flex-col gap-3`,children:[K,q,_(e,{ref:N,className:`flex-1 h-0 pt-[4px] pb-[12px] overflow-y-auto`,children:J})]})]})})}function E({information:n,series_num:r,onEpisodeChange:i}){let a=b(`components.common`),[o,c]=s(`detail-series-popup-${n.id}`,!1),[u,x]=s(`detail-series-title-toggle-${n.id}`,!1),[C,w]=s(`detail-series-scroll-left-${n.id}`,null),[E,D]=h(r);f(()=>{D(r)},[n.id,r]);let O=p(()=>S((n.links||[]).map(e=>({id:e.id,name:e.name})),n.id||`episode`,e=>a(`seriesEpisodes.episodeLabel`,{episode:e})),[n.id,n.links,a]),k=n.update_status===`1`?a(`seriesEpisodes.completedSeriesTotal`,{total:n.links.length}):a(`seriesEpisodes.ongoingSeriesUpdatedTo`,{total:n.links.length}),A=p(()=>n.links[E-1]?.id||n.links[0]?.id||``,[n.links,E]),j=m(null),M=m(null),N=m(null),P=m(!1),F=m(null),I=m(null),L=m(null),[R,z]=h(!1),B=d((e,t=`smooth`)=>{let n=j.current?.querySelector(`[data-content-id="${e}"]`);if(n&&j.current){let e=j.current,r=Math.max(0,n.offsetLeft-10);e.scrollTo({left:r,behavior:t})}},[]),V=d(()=>{I.current!==null&&(window.clearTimeout(I.current),I.current=null)},[]),H=d(()=>{L.current!==null&&(window.clearTimeout(L.current),L.current=null)},[]),U=d(()=>{F.current!==null&&(y.dismiss(F.current),F.current=null),V(),H()},[H,V]),W=d(()=>{M.current=null,N.current=null,U(),z(!1)},[U]),G=d((e,t)=>{H(),L.current=window.setTimeout(()=>{L.current=null,M.current===e&&W()},Math.max(0,t))},[H,W]);f(()=>{P.current=!1},[n.id]),f(()=>{if(P.current||!A)return;let e=window.requestAnimationFrame(()=>{let e=j.current;e&&(typeof C==`number`?e.scrollTo({left:Math.max(0,C),behavior:`auto`}):(B(A,`auto`),w(Math.max(0,Math.round(e.scrollLeft)))),P.current=!0)});return()=>{window.cancelAnimationFrame(e)}},[A,C,B,w]),f(()=>{let e=M.current;!e||e!==r||G(e,1e3)},[G,r]),f(()=>()=>{W()},[W]);let K=d((e,t,n)=>{let r=j.current;if(!r||!e)return t;let i=r.querySelector(`[data-content-id="${e}"]`);if(!i)return t;let a=r.getBoundingClientRect();if(a.width<=0||typeof n!=`number`||(n-a.left)/a.width<.5)return t;let o=i.offsetLeft+i.offsetWidth/2,s=r.clientWidth/2,c=Math.max(0,r.scrollWidth-r.clientWidth),l=Math.min(c,Math.max(0,o-s));return r.scrollTo({left:l,behavior:`smooth`}),Math.round(l)},[]),q=d((e,t=`inline`,o,s)=>{if(e!==E){if(!n.links[e-1]){y.error(a(`seriesEpisodes.episodeNotFound`));return}if(typeof window<`u`&&window.isWebView===!0){let t=String(n.id||``).trim(),r=`/webview/${encodeURIComponent(t)}/${encodeURIComponent(String(n.name||``))}/episode/${e}`,{search:i,hash:a}=window.location;window.location.href=`${r}${i}${a}`;return}try{D(e);let c=o||n.links[e-1]?.id||``,l=Math.max(0,Math.round(j.current?.scrollLeft||0));t===`popup`?(c&&B(c,`auto`),w(Math.max(0,Math.round(j.current?.scrollLeft||0)))):w(K(c,l,s)),z(!0),U(),F.current=y.loading(a(`seriesEpisodes.episodeSwitching`)),M.current=e,N.current=t,I.current=window.setTimeout(()=>{M.current===e&&(D(r),W(),y.error(a(`seriesEpisodes.episodeSwitchFailed`)))},8e3),i(e)}catch(e){D(r),W(),console.error(`切换剧集失败`,e),y.error(a(`seriesEpisodes.episodeSwitchFailed`))}}},[W,U,n.id,n.links,n.name,i,E,r,K,B,w,a]),[J,Y]=h(`70vh`),X=d(()=>{if(typeof window>`u`)return;if(window.isWebView===!0){Y(`100vh`);return}let e=document.getElementById(`selectPopupPosition`),t=window.visualViewport?.height||window.innerHeight;if(!e){Y(`70vh`);return}let n=Math.max(0,t-e.offsetTop);if(n<=0){Y(`70vh`);return}Y(`${n}px`)},[]);return f(()=>{if(!o)return;X();let e=()=>{X()};return window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[X,o]),O.length<=1?null:v(g,{children:[v(e,{className:`w-full mt-[16px] flex flex-col items-end mb-[4px]`,children:[v(e,{className:`w-fit flex items-center px-[12px] h-[28px]`,onClick:()=>c(!0),children:[_(t,{className:`text-[14px] text-text2 leading-[20px]`,children:k}),_(l,{className:`w-[11px] h-[18px] ml-[4px] text-text2`})]}),_(`div`,{ref:j,className:`w-full mt-[12px] overflow-x-auto px-[12px] flex gap-x-[8px] ${u?`h-[76px]`:`h-[60px]`} ${R?`touch-none`:``}`,children:O.map((e,n)=>_(`div`,{"data-content-id":e.id,className:`shrink-0 h-[full] px-[18px] rounded-[6px] border border-line1 flex items-center ${u?`w-[162px]`:`w-[60px] !px-[0] justify-center`} ${e.id===A?`!border-theme5 bg-line1`:``}`,onClick:t=>{q(n+1,`inline`,e.id,t.clientX)},children:_(t,{className:`text-[16px] text-text1 leading-[22px] line-clamp-2 ${e.id===A?`font-bold !text-theme5`:``}`,children:u?e.title:e.series_num})},e.id))})]}),_(T,{title:a(`seriesEpisodes.selectorTitle`),variant:`popup`,open:o,updateStatus:n.update_status,summaryText:k,seriesList:(n.links||[]).map(e=>({id:e.id,name:e.name})),activeEpisodeId:A,showEpisodeTitle:u,onToggleTitle:e=>{x(e)},onClose:()=>c(!1),onSelectEpisode:(e,t)=>{c(!1),q(t,`popup`,e)},popupBodyStyle:{height:J}})]})}export{w as SeriesEpisodes};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{gContentGetAppChannelBlock as e,gContentGetAppChannelBlockData as t,gContentListVisibleFloatingBall as n}from"../../../service/generated/client.mjs";import{useRouter as r}from"../../../utils/use-compatible-router.mjs";import{
|
|
2
|
+
"use client";import{gContentGetAppChannelBlock as e,gContentGetAppChannelBlockData as t,gContentListVisibleFloatingBall as n}from"../../../service/generated/client.mjs";import{useRouter as r}from"../../../utils/use-compatible-router.mjs";import{useRequest as i}from"../../../hooks/query/use-query.mjs";import{useRequireLogin as a}from"../../../hooks/use-auth.mjs";import{queryKey as o}from"../../../constants/query-key.mjs";import{useKeepAliveState as s}from"../../common/keep-scroll-position/index.mjs";import{FloatingAd as c}from"../../biz/business/advertisement/floating-ad/client.mjs";import{extractDataByComponentType as l}from"../../biz/utils/transformers/data.mjs";import{useEffect as u,useLayoutEffect as d,useMemo as f,useRef as p}from"react";import{Fragment as m,jsx as h,jsxs as g}from"react/jsx-runtime";function _(){if(typeof document>`u`)return 0;let e=document.querySelector(`[data-top-nav-root="true"]`);return e&&e.getBoundingClientRect().height||0}function v({currentChannelId:v,isPGC:y}){let b=r(),x=a(),{data:S}=i(o.GET_CONTENT_LIST(v),()=>e({channel_id:v})),{data:C}=i([o.FLOATING_BALL],()=>n()),w=f(()=>S?.data?.blocks||[],[S?.data?.blocks]),T=f(()=>{let e=w.findIndex(e=>e.type===4),t=e>=0?w[e]:null;return{index:e,block:t,blockId:t?.id||``}},[w]),{data:E}=i([o.GUESS_YOU_LIKE_USER_DATA,T.blockId],()=>t({block_id:T.blockId}),{enabled:!!T.blockId}),D=f(()=>{if(T.index<0)return w;let e=E?.data.block?.data?.users||[];return w.map((t,n)=>n===T.index?{...t,data:{...t.data||{},users:e}}:t)},[w,E,T.index]),[O,k]=s(`home-scroll-top-${v}`,0),A=p({restored:!1,lastScrollTop:O,key:v,rafId:null}),j=p(k),M=p(O);u(()=>{j.current=k},[k]),u(()=>{M.current=O},[O]),u(()=>{A.current.key!==v&&(A.current.restored=!1,A.current.lastScrollTop=O,M.current=O,A.current.key=v)},[v,O]);let N=D.length>0;d(()=>{if(!N||A.current.restored||O<=0)return;let e=_(),t=Math.max(0,O+e);window.requestAnimationFrame(()=>{window.scrollTo({top:t}),A.current.restored=!0,A.current.lastScrollTop=t})},[N,v,O]),u(()=>{let e=A.current;function t(){e.restored=!0,e.rafId!==null&&window.cancelAnimationFrame(e.rafId),e.rafId=window.requestAnimationFrame(()=>{e.rafId=null;let t=window.scrollY??document.documentElement.scrollTop??0,n=_(),r=Math.max(0,t-n);Math.abs(t-e.lastScrollTop)>1&&(e.lastScrollTop=t,j.current(r))})}return window.addEventListener(`scroll`,t,{passive:!0}),()=>{e.rafId!==null&&(window.cancelAnimationFrame(e.rafId),e.rafId=null),window.removeEventListener(`scroll`,t)}},[v]);let P=f(()=>l(D,y),[D,y]),F=f(()=>C?.data?.ball_infos?.find(e=>e.channel_id===v),[C?.data?.ball_infos,v]);return g(m,{children:[F&&h(c,{ad:{materialUrl:F.material_url||``,jumpUrl:F.jump_url||``,name:F.name||``},onClick:()=>{x(()=>{F?.jump_url&&b.push(F.jump_url)})}}),P.map(e=>{let t=e.component,n=e.data.block_id||`block-${e.data.title||``}`;return h(t,{data:e.data},n)})]})}export{v as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{getChannelList as e}from"../../biz/utils/helpers/get-channel-list.mjs";import{cn as t}from"../../../utils/cn.mjs";import{gContentGetAppChannels as n,gContentGetVideoDetail as r}from"../../../service/generated/client.mjs";import{useRouter as i}from"../../../utils/use-compatible-router.mjs";import{EmptyState as a}from"../../ui/empty.mjs";import{
|
|
2
|
+
"use client";import{getChannelList as e}from"../../biz/utils/helpers/get-channel-list.mjs";import{cn as t}from"../../../utils/cn.mjs";import{gContentGetAppChannels as n,gContentGetVideoDetail as r}from"../../../service/generated/client.mjs";import{useRouter as i}from"../../../utils/use-compatible-router.mjs";import{EmptyState as a}from"../../ui/empty.mjs";import{notifyBridgeEpisodeChanged as ee}from"../../../utils/login-modal-bridge.mjs";import{useRequest as o}from"../../../hooks/query/use-query.mjs";import{queryKey as s}from"../../../constants/query-key.mjs";import{useKeepAliveEffect as c,useKeepAliveState as l}from"../../common/keep-scroll-position/index.mjs";import{apiCollectClick as u}from"../../../utils/api-collect.mjs";import te from"../../biz/business/search-bar/variants/detail-search-bar/index.mjs";import{VideoDetailMaterialRuntimeProvider as d}from"../../biz/business/detail/shared/runtime-context-provider.mjs";import{resolveMaterialProps as f,videoDetailMaterials as ne}from"../../biz/business/detail/shared/registry.mjs";import{DetailHero as p}from"../../biz/business/detail/shared/video-hero.mjs";import{Fragment as m,useCallback as h,useEffect as g,useMemo as _}from"react";import{Fragment as v,jsx as y,jsxs as b}from"react/jsx-runtime";import{useParams as re,useSearchParams as ie}from"next/navigation";import{useTranslations as x}from"next-intl";const S=[{id:`detail-info`,componentName:`video-detail-info`,props:{}},{id:`detail-info-title-tags-episodes`,componentName:`video-detail-info-title-tags-episodes`,props:{}},{id:`detail-actions`,componentName:`video-detail-actions`,props:{}},{id:`detail-recommend`,componentName:`video-detail-recommend`,props:{title:`猜你喜欢`,rows:2,columns:3,smartTagEnabled:!1,smartTagIds:[`腐剧`],showPlayCount:!0,playCountDelta:0,showEpisode:!0,enableInfinite:!1,items:[{contentId:`d6a35ba3279e6f0d`,contentName:`贺总的私宠罪妻`,titleMode:`custom`,title:`贺总的私宠罪妻`,description:`简介多少字是不是两百简介多少字是不是两百简介多少字是不是两百简介多少字是不是两百简介多少字是不是两百简介多少字是不是两百简介多少字是不是两百简介多少字是不是两百简介多少字是不是两百简介多少字是不是两百简介多少字是不是两百简介多少字是不是两百简介多少字是不是两百简介多少字是不是两百简介多少字是不是两百简介多少字是不是两百简介多少字是不是两百简介多少字是不是两百简介多少字是不是两百简介多少字是不是两百`,coverMode:`upload`,coverUrl:`/truss/20260227/69a136457d10f.jpgxxx`,showPlayCount:!0,playCountDelta:0,showEpisode:!0},{contentId:`b0f42fed731239a7`,contentName:`少年江湖物语`,titleMode:`custom`,title:`少年江湖物语`,description:`网剧《少年江湖物语》讲述了一个江湖中邪不压正,青春正好,有情有爱的温暖故事。剧中有魔教教主,有天下第一剑客,有身世成谜的江湖大夫,有忠心耿耿的小丫鬟,更有艳压秦淮的当红花魁,众多看似完全没有交集的人物纷纷亮相登场,搅乱江湖一池春水。`,coverMode:`content`,coverUrl:`/md-204/uploads/default/other/2024-08-26/14664d2c31e61c201a29cd4abba267c5.jpg`,showPlayCount:!0,playCountDelta:0,showEpisode:!0},{contentId:`c2304e94ec0ba208`,contentName:`王的男人`,titleMode:`custom`,title:`王的男人`,description:`朝鲜第十代王燕山王君时期,艺人长生(甘宇成饰)和孔吉(李俊基饰)因为不肯加入当地的艺人团,来到京城汉阳谋生。此时暴君燕山君(郑镇荣饰)沉迷于宠妾张绿水(姜成妍饰),朝纲混乱,民不聊生。长生与孔吉二人在街头开始表演讽刺君主的喜剧,大受欢迎,却遭逮捕。后要求到王面前表演,求得一笑。结果,多亏孔吉的急中生智,燕山君才笑了出来。两人随即被留在宫中取乐,孔吉更是因为美色令王倍加宠爱。他们不停表演,大臣们却各自心怀鬼胎,导致了杀戮局面。最终,君王和艺人的命运又将如何呢?`,coverMode:`content`,coverUrl:`/md-204/resource/8c/8cb28f46831558fbeb2f34b2076c3b4e.jpg`,showPlayCount:!0,playCountDelta:0,showEpisode:!0},{contentId:`c7ffc6a558ae8683`,contentName:`怒`,titleMode:`custom`,title:`怒`,description:`炎炎夏日,东京八王子郊外社区,一对夫妇惨遭杀害。事后凶手用血在墙上写下大大的“怒”字,随后逃亡,销声匿迹长达一年之久。而在此期间,三个身份不明的男子和身边的人相遇了。曾自甘堕落的爱子(宫崎葵饰)被父亲(渡边谦饰)领回海滨小镇,邂逅了不善言辞的哲也(松山研一饰)。在东京工作的同性恋优马(妻夫木聪饰)将柔情似水的直人(绫野刚饰)带回了家,他不相信对方,却又尝试去相信。随母亲搬到冲绳的小泉(广濑铃饰)跟着同学辰哉(佐久本宝饰)登上一座荒岛,在废墟中遇到了背包客田中(森山未来饰),他们短暂成为朋友,而可怕的命运突然降临泉的头上。不久之后,通缉令遍布全国,三个男子的真实身份引人生疑……本片根据吉田修一的同名原作改编。`,coverMode:`content`,coverUrl:`/md-204/resource/24/24ef267eef2c35b5e4cf12dac8b55c14.jpg`,showPlayCount:!0,playCountDelta:0,showEpisode:!0},{contentId:`98217427ed96ec51`,contentName:`熔炉`,titleMode:`custom`,title:`熔炉`,description:`来自首尔的哑语美术老师仁浩(孔宥饰)来到雾津,应聘慈爱聋哑人学校。天降大雾,他意外撞车,维修时邂逅了人权组织成员柔珍(郑有美饰)。仁浩妻子早亡,8岁女儿天生哮喘由祖母照看,所以他不辞辛苦谋职养家。然而,双胞胎的校长与教导主任竟逼仁浩索贿5千万韩元。同时,仁浩逐渐发现学校笼罩着一种紧张压抑的气氛,令人窒息。有三个孩子引人关注:聪颖的金妍斗(金贤秀饰)、贪吃的陈宥利(郑仁絮饰)和弟弟自杀身亡的全民秀(白承焕饰),民秀总是满脸淤青。下课后,仁浩还听到女厕所中有呼喊与哭泣,在门卫的阻拦下他未深究。之后。他意外目睹了校长行贿警察,教导员毒打民秀,宿导溺罚妍斗的行径。一个惊天的隐秘被慢慢揭开,真相令韩国震惊……本片取材于2005年光州一所聋哑障碍人学校的真实事件,改编自韩国作家孔枝泳的同名小说。`,coverMode:`content`,coverUrl:`/md-204/resource/b4/b410ccdcd86936455b9460a9152aaa47.jpg`,showPlayCount:!0,playCountDelta:0,showEpisode:!0},{contentId:`caa2b4eb4eb40de0`,contentName:`再次来寻我`,titleMode:`custom`,title:`再次来寻我`,description:`在宇回到曾经与初恋志勋相遇的303号房,这里即将被拆迁,他在房间里回忆和志勋的点点滴滴,突然被书桌上的电话所吸引,一拿起话筒听到的竟是志勋的声音!在房子主人的同意下,在宇带着电话离开了303室,在回家的途中他发现自己像走在一个陌生的地方,而对面走来的竟是已消失已久的志勋…`,coverMode:`content`,coverUrl:`/md-204/resource/2b/2b43375f2248c1a012847d4507fd21a3.jpg`,showPlayCount:!0,playCountDelta:0,showEpisode:!0}]}}];function ae(e,t){let n=String(e||``).split(`/`).filter(Boolean),r=n.findIndex(e=>e===`video`||e===`webview`);return r<0?!1:n[r+1]===t}function C({detailId:u,initialInformation:C,isWebView:w=!1,materialConfig:T}){let E=x(`components.pages.videoDetail`),D=i(),O=re(),k=ie(),A=O.level,j=Array.isArray(A)?A:typeof A==`string`?[A]:[],M=j.findIndex(e=>e===`episode`),oe=M>=0?j[M+1]:j[2],N=Math.max(1,Number(oe)||1),[se,P]=l(`detail-current-series-num-${u}`,N);g(()=>{P(N)},[N,P]);let F=Math.max(1,Number(se)||1),I=Math.max(0,F-1),{data:L,isPending:R,isFetching:z,isError:B,isSuccess:V}=o(_(()=>[`video-detail`,u],[u]),async()=>u?await r({id:u}):null,{enabled:!!u}),H=_(()=>{let e=L?.data?.video;return!e||typeof e!=`object`?null:{...e,content_type:1,episode_cnt:e.links?.length||0}},[L?.data?.video]),U=C??H??null,[W,G]=l(`detail-information-${u}`,U),ce=W?.links?.[I]?.id||``,K=!!u&&!W&&(R||z),q=!u||!!W||B||V,[le,ue]=l(`info-detail-active-tab-${u}`,`video`),[J,Y]=l(`info-detail-comment-add-count-${u}`,0),[X,de]=l(`info-detail-comment-total-${u}`,void 0);g(()=>{!W&&H&&G(H)},[W,H,G]);let Z=h(e=>{G(t=>t&&{...t,...e})},[G]);c(()=>{W?.id&&W.id},[W?.id],`detail-page-report-${u}`),g(()=>{!W||typeof window>`u`||window.sensors?.track?.(`detail_page_view`,{object_id:W.id||u,author_id:W.up_user,object_type:W.content_type,object_category:W.content_type,object_tags:W.tags?.map(e=>e.name),block_id:``,page_source:window.location?.pathname||``})},[u,W]),g(()=>{Y(0)},[ce,Y]),_(()=>(typeof X==`number`?X:0)+J,[J,X]);let fe=h(()=>{},[!1,ue]);h(()=>{Y(e=>e+1)},[Y]),g(()=>{},[!1,fe,W?.id,k]);let Q=h(e=>{let t=Math.max(1,Math.floor(Number(e)||1));if(typeof window>`u`)return;let n=String(W?.id||u||``).trim();if(!n)return;let r=`/video/${n}/${encodeURIComponent(W?.name||``)}/episode/${t}`,{search:i,hash:a,pathname:o}=window.location,s=`${r}${i}${a}`,c=`${o}${i}${a}`,l=ae(o,n);if(c!==s){w&&ee({title:W?.title||``,detailId:n,seriesNum:t,nextPath:r}),l&&typeof window.history?.replaceState==`function`?(window.history.replaceState(window.history.state,``,s),P(t)):D.replace(s,{scroll:!1});return}F!==t&&P(t)},[F,u,W?.id,W?.name,W?.title,w,D,P]),$=W?.status===`1`,{data:pe}=o([s.CHANNEL],()=>n()),me=e(pe?.data),he=_(()=>{if(T!==void 0){let e=new Map(S.map(e=>[e.componentName,e]));return T.map(t=>{let n=e.get(t.componentName);return{...n,...t,props:{...n?.props??{},...t.props??{}}}})}return S},[T]),ge=_(()=>({information:W??void 0,currentSeriesNum:F,onEpisodeChange:Q,onUpdateInformation:Z,detailId:u,episodeIndex:I,isShow:!0,isWebView:w,isInformationLoading:K,isInformationResolved:q}),[F,u,I,Q,Z,W,K,q,w,!0]),_e=h(e=>{if(!W)return null;let t=ne[e.componentName];if(!t)return null;let n=t.clientComponent,r=f(t,e.props);return r.isValid?y(n,{...r.props}):y(`div`,{children:`组件配置错误`})},[W]);return b(`div`,{className:`w-full min-h-screen bg-bg2 text-text1 ${w?``:`pt-11`}`,children:[!w&&y(`div`,{className:`fixed bg-black top-0 left-0 right-0 z-[1000]`,children:y(te,{data:{list:me}})}),y(`div`,{className:`mx-auto w-full max-w-[840px] pb-6`,children:b(v,{children:[W&&!$&&y(a,{type:`no-content`,text:E(`videoDetailClient.videoUnavailable`)}),W&&$&&b(v,{children:[!w&&y(p,{isVideo:!0,information:W,episodeIndex:I}),y(`div`,{id:`selectPopupPosition`,className:`w-full`}),!1,b(`div`,{className:t(`w-full`,!1),children:[y(d,{value:ge,children:he.map(e=>y(m,{children:_e(e)},e.id))}),!1]}),!1]}),!W&&y(a,{type:`no-content`,text:E(`videoDetailClient.videoDeleted`)})]})})]})}export{C as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{pContentGetNewstVideoList as e,pContentGetTopRatedVideoList as t}from"../../../service/generated/client.mjs";import{pContentGetNewstVideoListKey as n,pContentGetTopRatedVideoListKey as r}from"../../../service/generated/tanstack.mjs";import{HydrationBoundary as i}from"../../../hooks/query/hydration-boundary.mjs";import{revalidate as a}from"../../../constants/revalidate.mjs";import{getNextVideoListPageParam as o,resolveNextCursor as s}from"./types.mjs";import c from"./video-list-client.mjs";import{jsx as l}from"react/jsx-runtime";async function u({title:u=`列表页`,tags:d=[]}={}){let f={page_size:10,tags:d.length?d:void 0};return l(i,{prefetch:[{type:`infinite`,queryKey:r(f),queryFn:async e=>{let n=(await t({page_size:10,cursor:e||void 0,tags:d.length?d:void 0},{revalidate:a.TIME})).data,r=Array.isArray(n?.videos)?n.videos:[];return{list:r,nextCursor:r.length<10?``:s(n)}},initialPageParam:``,getNextPageParam:e=>o(e)},{type:`infinite`,queryKey:n(f),queryFn:async t=>{let n=(await e({page_size:10,cursor:t||void 0,tags:d.length?d:void 0},{revalidate:a.TIME})).data
|
|
2
|
+
import{pContentGetNewstVideoList as e,pContentGetTopRatedVideoList as t}from"../../../service/generated/client.mjs";import{pContentGetNewstVideoListKey as n,pContentGetTopRatedVideoListKey as r}from"../../../service/generated/tanstack.mjs";import{HydrationBoundary as i}from"../../../hooks/query/hydration-boundary.mjs";import{revalidate as a}from"../../../constants/revalidate.mjs";import{getNextVideoListPageParam as o,resolveNextCursor as s}from"./types.mjs";import c from"./video-list-client.mjs";import{jsx as l}from"react/jsx-runtime";async function u({title:u=`列表页`,tags:d=[]}={}){let f={page_size:10,tags:d.length?d:void 0};return l(i,{prefetch:[{type:`infinite`,queryKey:r(f),queryFn:async e=>{let n=(await t({page_size:10,cursor:e||void 0,tags:d.length?d:void 0},{revalidate:a.TIME})).data,r=Array.isArray(n?.videos)?n.videos:[];return{list:r,nextCursor:r.length<10?``:s(n)}},initialPageParam:``,getNextPageParam:e=>o(e)},{type:`infinite`,queryKey:n(f),queryFn:async t=>{let n=(await e({page_size:10,cursor:t||void 0,tags:d.length?d:void 0},{revalidate:a.TIME})).data;return{list:n?.videos??[],nextCursor:s(n)}},initialPageParam:``,getNextPageParam:e=>o(e)}],children:l(c,{title:u,tags:d})})}export{u as VideoListPage};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{Button as e}from"../../ui/button.mjs";import{pContentGetNewstVideoList as t,pContentGetTopRatedVideoList as n}from"../../../service/generated/client.mjs";import{pContentGetNewstVideoListKey as r,pContentGetTopRatedVideoListKey as i}from"../../../service/generated/tanstack.mjs";import{useRouter as a}from"../../../utils/use-compatible-router.mjs";import{Box as o}from"../../ui/box.mjs";import{InfiniteScroll as s}from"../../ui/infinite-scroll.mjs";import{Text as c}from"../../ui/text.mjs";import{usePaginated as l}from"../../../hooks/query/use-query.mjs";import u from"../../../assets/icons/left_arrow.mjs";import{getNextVideoListPageParam as d,resolveNextCursor as f}from"./types.mjs";import{VideoListItemComponent as p}from"./video-list-item.mjs";import{VideoListSkeleton as m}from"./video-list-skeleton.mjs";import{useEffect as h,useMemo as g,useState as _}from"react";import{jsx as v,jsxs as y}from"react/jsx-runtime";import b from"next/link";const x=[];function S({title:S=`列表页`,tags:C=x}){let w=a(),[T,E]=_(`hot`),D=g(()=>({page_size:10,tags:C.length?C:void 0}),[C]),{data:O,fetchNextPage:k,hasNextPage:A,isPending:j,isFetching:M}=l({key:g(()=>T===`hot`?i(D):r(D),[D,T]),queryFn:async e=>{let r={page_size:10,cursor:e||void 0,tags:C.length?C:void 0},i=(T===`hot`?await n(r):await t(r)).data,a=Array.isArray(i?.videos)?i.videos:[];return{list:a,nextCursor:a.length<10?``:f(i)}},getNextPageParam:d,initialPageParam:``,options:{staleTime:0,refetchOnMount:`always`,refetchOnWindowFocus:!1,refetchOnReconnect:!1}}),N=g(()=>O?.pages?.flatMap(e=>e.list)??[],[O?.pages]),P=(O?.pages?.length??0)>0,F=g(()=>P?A??!1:!0,[P,A]),I=N.length===0&&(!P||j||M);h(()=>{typeof window>`u`||window.scrollTo({top:0,behavior:`auto`})},[T]);function L(){w.back()}let R=g(()=>N.map(e=>{let t=e.id??e.mid??``;return v(b,{href:`/video/${t}/${e.name??``}`,children:v(p,{item:e})},t)}),[N]);return I?v(m,{}):y(o,{as:`main`,className:`min-h-[100dvh] bg-bg1`,children:[y(o,{className:`fixed top-0 left-0 right-0 z-20 bg-bg1`,children:[y(o,{as:`header`,className:`flex items-center gap-2 px-4 py-3`,children:[v(u,{className:`w-[16px] h-[16px]`,onClick:L}),v(c,{as:`h1`,className:`flex-1 min-w-0 flex justify-center overflow-hidden text-[18px] pr-[16px]`,children:v(c,{className:`block max-w-full truncate`,children:S})})]}),y(o,{as:`nav`,className:`px-4 pb-2 flex gap-2`,children:[v(e,{type:`button`,onClick:()=>E(`hot`),className:`h-[30px] px-[12px] text-[14px] rounded-[50px] ${T===`hot`?`bg-theme5 text-text1`:`bg-transparent text-text2`}`,children:`最热`}),v(e,{type:`button`,onClick:()=>E(`latest`),className:`h-[30px] px-[12px] text-[14px] rounded-[50px] ${T===`latest`?`bg-theme5 text-text1`:`bg-transparent text-text2`}`,children:`最新`})]})]}),v(s,{loadMore:()=>k().then(()=>void 0),hasMore:F,noMoreText:`没有更多了`,threshold:300,className:`pt-[88px]`,children:v(o,{className:`grid grid-cols-2 gap-3 p-4`,children:R})},T)]})}export{S as default};
|
|
2
|
+
"use client";import{Button as e}from"../../ui/button.mjs";import{pContentGetNewstVideoList as t,pContentGetTopRatedVideoList as n}from"../../../service/generated/client.mjs";import{pContentGetNewstVideoListKey as r,pContentGetTopRatedVideoListKey as i}from"../../../service/generated/tanstack.mjs";import{useRouter as a}from"../../../utils/use-compatible-router.mjs";import{Box as o}from"../../ui/box.mjs";import{InfiniteScroll as s}from"../../ui/infinite-scroll.mjs";import{Text as c}from"../../ui/text.mjs";import{usePaginated as l}from"../../../hooks/query/use-query.mjs";import u from"../../../assets/icons/left_arrow.mjs";import{getNextVideoListPageParam as d,resolveNextCursor as f}from"./types.mjs";import{VideoListItemComponent as p}from"./video-list-item.mjs";import{VideoListSkeleton as m}from"./video-list-skeleton.mjs";import{useEffect as h,useMemo as g,useState as _}from"react";import{jsx as v,jsxs as y}from"react/jsx-runtime";import b from"next/link";const x=[];function S({title:S=`列表页`,tags:C=x}){let w=a(),[T,E]=_(`hot`),D=g(()=>({page_size:10,tags:C.length?C:void 0}),[C]),{data:O,fetchNextPage:k,hasNextPage:A,isPending:j,isFetching:M}=l({key:g(()=>T===`hot`?i(D):r(D),[D,T]),queryFn:async e=>{let r={page_size:10,cursor:e||void 0,tags:C.length?C:void 0},i=(T===`hot`?await n(r):await t(r)).data,a=Array.isArray(i?.videos)?i.videos:[];return{list:a,nextCursor:T===`hot`&&a.length<10?``:f(i)}},getNextPageParam:d,initialPageParam:``,options:{staleTime:0,refetchOnMount:`always`,refetchOnWindowFocus:!1,refetchOnReconnect:!1}}),N=g(()=>O?.pages?.flatMap(e=>e.list)??[],[O?.pages]),P=(O?.pages?.length??0)>0,F=g(()=>P?A??!1:!0,[P,A]),I=N.length===0&&(!P||j||M);h(()=>{typeof window>`u`||window.scrollTo({top:0,behavior:`auto`})},[T]);function L(){w.back()}let R=g(()=>N.map(e=>{let t=e.id??e.mid??``;return v(b,{href:`/video/${t}/${e.name??``}`,children:v(p,{item:e})},t)}),[N]);return I?v(m,{}):y(o,{as:`main`,className:`min-h-[100dvh] bg-bg1`,children:[y(o,{className:`fixed top-0 left-0 right-0 z-20 bg-bg1`,children:[y(o,{as:`header`,className:`flex items-center gap-2 px-4 py-3`,children:[v(u,{className:`w-[16px] h-[16px]`,onClick:L}),v(c,{as:`h1`,className:`flex-1 min-w-0 flex justify-center overflow-hidden text-[18px] pr-[16px]`,children:v(c,{className:`block max-w-full truncate`,children:S})})]}),y(o,{as:`nav`,className:`px-4 pb-2 flex gap-2`,children:[v(e,{type:`button`,onClick:()=>E(`hot`),className:`h-[30px] px-[12px] text-[14px] rounded-[50px] ${T===`hot`?`bg-theme5 text-text1`:`bg-transparent text-text2`}`,children:`最热`}),v(e,{type:`button`,onClick:()=>E(`latest`),className:`h-[30px] px-[12px] text-[14px] rounded-[50px] ${T===`latest`?`bg-theme5 text-text1`:`bg-transparent text-text2`}`,children:`最新`})]})]}),v(s,{loadMore:()=>k().then(()=>void 0),hasMore:F,noMoreText:`没有更多了`,threshold:300,className:`pt-[88px]`,children:v(o,{className:`grid grid-cols-2 gap-3 p-4`,children:R})},T)]})}export{S as default};
|
|
@@ -6,7 +6,7 @@ import * as class_variance_authority_types0 from "class-variance-authority/types
|
|
|
6
6
|
//#region components/ui/badge.d.ts
|
|
7
7
|
/** badgeVariants 工具定义。 */
|
|
8
8
|
declare const badgeVariants: (props?: ({
|
|
9
|
-
variant?: "
|
|
9
|
+
variant?: "link" | "default" | "destructive" | "secondary" | "outline" | "ghost" | null | undefined;
|
|
10
10
|
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
11
11
|
/** Badge 组件。 */
|
|
12
12
|
declare function Badge({
|
|
@@ -7,7 +7,7 @@ import * as class_variance_authority_types0 from "class-variance-authority/types
|
|
|
7
7
|
//#region components/ui/button.d.ts
|
|
8
8
|
/** buttonVariants 工具定义。 */
|
|
9
9
|
declare const buttonVariants: (props?: ({
|
|
10
|
-
variant?: "
|
|
10
|
+
variant?: "link" | "default" | "destructive" | "secondary" | "outline" | "ghost" | null | undefined;
|
|
11
11
|
size?: "default" | "icon" | "xs" | "sm" | "lg" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
12
12
|
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
13
13
|
/** Button 组件属性。 */
|
package/dist/hooks.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import { IMAGE_TEXT_RECOMMEND_FIXED_BATCH_SIZE, ImageTextRecommendAnyVideo, buildImageTextRecommendChosenTags, buildImageTextRecommendRemoteMap, buildImageTextRecommendSmartPicked, getImageTextRecommendFixedIds, getImageTextRecommendLayoutTags, resolveImageTextRecommendVideoId } from "./hooks/image-text-recommend.mjs";
|
|
3
2
|
import { HydrationBoundary, PrefetchInfiniteItem, PrefetchItem, PrefetchQueryItem } from "./hooks/query/hydration-boundary.mjs";
|
|
3
|
+
import { IMAGE_TEXT_RECOMMEND_FIXED_BATCH_SIZE, ImageTextRecommendAnyVideo, buildImageTextRecommendChosenTags, buildImageTextRecommendRemoteMap, buildImageTextRecommendSmartPicked, getImageTextRecommendFixedIds, getImageTextRecommendLayoutTags, resolveImageTextRecommendVideoId } from "./hooks/image-text-recommend.mjs";
|
|
4
4
|
import { useDeleteRequest, useMutation, usePaginated, usePrefetchQuery, useRefetchQuery, useRequest, useUpdateRequest } from "./hooks/query/use-query.mjs";
|
|
5
5
|
import { AuthFields, useAuth, useCloseLogin, useExpireTime, useIsLoggedIn, useLoginModalOpen, useLogout, useOpenLogin, useOpenLoginAsync, useOpenResetPassword, useRequireLogin, useSetAuthFields, useToken, useUserId, useUserInfo } from "./hooks/use-auth.mjs";
|
|
6
6
|
import { UseBrowseReportOptions, useBrowseReport } from "./hooks/use-browse-report.mjs";
|
package/dist/materials.d.mts
CHANGED
|
@@ -11,6 +11,11 @@ import { videoDetailActionsMaterial } from "./components/biz/business/detail/vid
|
|
|
11
11
|
import "./components/biz/business/detail/video-detail-actions/index.mjs";
|
|
12
12
|
import { videoDetailRecommendMaterial } from "./components/biz/business/detail/video-detail-recommend/material.mjs";
|
|
13
13
|
import "./components/biz/business/detail/video-detail-recommend/index.mjs";
|
|
14
|
+
import { bannerAdMaterial } from "./components/biz/business/advertisement/banner-ad/material.mjs";
|
|
15
|
+
import { floatingAdMaterial } from "./components/biz/business/advertisement/floating-ad/material.mjs";
|
|
16
|
+
import { iconAdMaterial } from "./components/biz/business/advertisement/icon-ad/material.mjs";
|
|
17
|
+
import { textAdMaterial } from "./components/biz/business/advertisement/text-ad/material.mjs";
|
|
18
|
+
import "./components/biz/business/advertisement/index.mjs";
|
|
14
19
|
import { floatingBallMaterial } from "./components/biz/business/floating-ball/material.mjs";
|
|
15
20
|
import { homeRecommendGridMaterial } from "./components/biz/business/home-recommend/home-recommend-grid/material.mjs";
|
|
16
21
|
import { homeRecommendWaterfallMaterial } from "./components/biz/business/home-recommend/home-recommend-waterfall/material.mjs";
|
|
@@ -33,4 +38,4 @@ import { headerSearchMaterial } from "./components/biz/business/header-search/he
|
|
|
33
38
|
import "./components/biz/business/header-search/index.mjs";
|
|
34
39
|
import { largeFeatureGridMaterial } from "./components/biz/business/large-feature-grid/material.mjs";
|
|
35
40
|
import { shortcutGridMaterial } from "./components/biz/business/shortcut-grid/material.mjs";
|
|
36
|
-
export { BannerCarouselMaterial, channelListMaterial, exampleButtonMaterial, floatingBallMaterial, headerAvatarIconMaterial, headerAvatarLogoSearchIconMaterial, headerAvatarLogoSearchMaterial, headerLogoSearchMaterial, headerSearchMaterial, homeRecommendGridMaterial, homeRecommendWaterfallMaterial, imageTextRecommendMaterial, largeFeatureGridMaterial, marqueeMaterial, profileHeaderMaterial, profileHeaderMaterialWithDisabledBackground, profileMainMaterial, searchHistoryMaterial, searchInputMaterial, shortcutGridMaterial, tabBarMaterial, textRecommendMaterial, videoDetailActionsMaterial, videoDetailInfoMaterial, videoDetailInfoTitleTagsEpisodesMaterial, videoDetailPlayerBridgeOnlyMaterial, videoDetailPlayerMaterial, videoDetailRecommendMaterial };
|
|
41
|
+
export { BannerCarouselMaterial, bannerAdMaterial, channelListMaterial, exampleButtonMaterial, floatingAdMaterial, floatingBallMaterial, headerAvatarIconMaterial, headerAvatarLogoSearchIconMaterial, headerAvatarLogoSearchMaterial, headerLogoSearchMaterial, headerSearchMaterial, homeRecommendGridMaterial, homeRecommendWaterfallMaterial, iconAdMaterial, imageTextRecommendMaterial, largeFeatureGridMaterial, marqueeMaterial, profileHeaderMaterial, profileHeaderMaterialWithDisabledBackground, profileMainMaterial, searchHistoryMaterial, searchInputMaterial, shortcutGridMaterial, tabBarMaterial, textAdMaterial, textRecommendMaterial, videoDetailActionsMaterial, videoDetailInfoMaterial, videoDetailInfoTitleTagsEpisodesMaterial, videoDetailPlayerBridgeOnlyMaterial, videoDetailPlayerMaterial, videoDetailRecommendMaterial };
|
package/dist/materials.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{__exportAll as e}from"./_virtual/_rolldown/runtime.mjs";import{
|
|
2
|
+
import{__exportAll as e}from"./_virtual/_rolldown/runtime.mjs";import{bannerAdMaterial as t}from"./components/biz/business/advertisement/banner-ad/material.mjs";import{floatingAdMaterial as n}from"./components/biz/business/advertisement/floating-ad/material.mjs";import{iconAdMaterial as r}from"./components/biz/business/advertisement/icon-ad/material.mjs";import{marqueeMaterial as i}from"./components/biz/business/marquee/material.mjs";import{textAdMaterial as a}from"./components/biz/business/advertisement/text-ad/material.mjs";import{floatingBallMaterial as o}from"./components/biz/business/floating-ball/material.mjs";import{homeRecommendGridMaterial as s}from"./components/biz/business/home-recommend/home-recommend-grid/material.mjs";import{homeRecommendWaterfallMaterial as c}from"./components/biz/business/home-recommend/home-recommend-waterfall/material.mjs";import{imageTextRecommendMaterial as l}from"./components/biz/business/image-text-recommend/material.mjs";import{profileHeaderMaterial as u,profileHeaderMaterialWithDisabledBackground as d}from"./components/biz/business/profile/profile-header/material.mjs";import{profileMainMaterial as f}from"./components/biz/business/profile/profile-main/material.mjs";import{searchHistoryMaterial as p}from"./components/biz/business/search-history/material.mjs";import{searchInputMaterial as m}from"./components/biz/business/search-input/material.mjs";import{tabBarMaterial as h}from"./components/biz/business/tab-bar/material.mjs";import{textRecommendMaterial as g}from"./components/biz/business/text-recommend/material.mjs";import{exampleButtonMaterial as _}from"./components/biz/example/button/material.mjs";import{BannerCarouselMaterial as v}from"./components/biz/business/banner-carousel/material.mjs";import{channelListMaterial as y}from"./components/biz/business/channel-list/material.mjs";import{videoDetailInfoMaterial as b}from"./components/biz/business/detail/video-detail-info/material.mjs";import{videoDetailInfoTitleTagsEpisodesMaterial as x}from"./components/biz/business/detail/video-detail-info-title-tags-episodes/material.mjs";import{videoDetailPlayerMaterial as S}from"./components/biz/business/detail/video-detail-player/material.mjs";import{videoDetailPlayerBridgeOnlyMaterial as C}from"./components/biz/business/detail/video-detail-player-bridge-only/material.mjs";import{videoDetailRecommendMaterial as w}from"./components/biz/business/detail/video-detail-recommend/material.mjs";import{videoDetailActionsMaterial as T}from"./components/biz/business/detail/video-detail-actions/material.mjs";import{headerAvatarIconMaterial as E}from"./components/biz/business/header-search/header-avatar-icon/material.mjs";import{headerAvatarLogoSearchMaterial as D}from"./components/biz/business/header-search/header-avatar-logo-search/material.mjs";import{headerAvatarLogoSearchIconMaterial as O}from"./components/biz/business/header-search/header-avatar-logo-search-icon/material.mjs";import{headerLogoSearchMaterial as k}from"./components/biz/business/header-search/header-logo-search/material.mjs";import{headerSearchMaterial as A}from"./components/biz/business/header-search/header-search/material.mjs";import{largeFeatureGridMaterial as j}from"./components/biz/business/large-feature-grid/material.mjs";import{shortcutGridMaterial as M}from"./components/biz/business/shortcut-grid/material.mjs";var N=e({BannerCarouselMaterial:()=>v,bannerAdMaterial:()=>t,channelListMaterial:()=>y,exampleButtonMaterial:()=>_,floatingAdMaterial:()=>n,floatingBallMaterial:()=>o,headerAvatarIconMaterial:()=>E,headerAvatarLogoSearchIconMaterial:()=>O,headerAvatarLogoSearchMaterial:()=>D,headerLogoSearchMaterial:()=>k,headerSearchMaterial:()=>A,homeRecommendGridMaterial:()=>s,homeRecommendWaterfallMaterial:()=>c,iconAdMaterial:()=>r,imageTextRecommendMaterial:()=>l,largeFeatureGridMaterial:()=>j,marqueeMaterial:()=>i,profileHeaderMaterial:()=>u,profileHeaderMaterialWithDisabledBackground:()=>d,profileMainMaterial:()=>f,searchHistoryMaterial:()=>p,searchInputMaterial:()=>m,shortcutGridMaterial:()=>M,tabBarMaterial:()=>h,textAdMaterial:()=>a,textRecommendMaterial:()=>g,videoDetailActionsMaterial:()=>T,videoDetailInfoMaterial:()=>b,videoDetailInfoTitleTagsEpisodesMaterial:()=>x,videoDetailPlayerBridgeOnlyMaterial:()=>C,videoDetailPlayerMaterial:()=>S,videoDetailRecommendMaterial:()=>w});export{v as BannerCarouselMaterial,t as bannerAdMaterial,y as channelListMaterial,_ as exampleButtonMaterial,n as floatingAdMaterial,o as floatingBallMaterial,E as headerAvatarIconMaterial,O as headerAvatarLogoSearchIconMaterial,D as headerAvatarLogoSearchMaterial,k as headerLogoSearchMaterial,A as headerSearchMaterial,s as homeRecommendGridMaterial,c as homeRecommendWaterfallMaterial,r as iconAdMaterial,l as imageTextRecommendMaterial,j as largeFeatureGridMaterial,i as marqueeMaterial,N as materials_exports,u as profileHeaderMaterial,d as profileHeaderMaterialWithDisabledBackground,f as profileMainMaterial,p as searchHistoryMaterial,m as searchInputMaterial,M as shortcutGridMaterial,h as tabBarMaterial,a as textAdMaterial,g as textRecommendMaterial,T as videoDetailActionsMaterial,b as videoDetailInfoMaterial,x as videoDetailInfoTitleTagsEpisodesMaterial,C as videoDetailPlayerBridgeOnlyMaterial,S as videoDetailPlayerMaterial,w as videoDetailRecommendMaterial};
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
|
|
2
|
+
import { RequestConfig, ResponseData } from "../utils/http.mjs";
|
|
3
|
+
|
|
4
|
+
//#region service/advertisement.d.ts
|
|
5
|
+
type ExtraRequestConfig = Omit<RequestConfig, 'url' | 'method' | 'params' | 'data'>;
|
|
6
|
+
/**
|
|
7
|
+
* 广告匹配请求场景上下文。
|
|
8
|
+
*/
|
|
9
|
+
interface AdsMatchSceneContext {
|
|
10
|
+
/**
|
|
11
|
+
* 开屏广告启动类型:cold | hot。
|
|
12
|
+
*/
|
|
13
|
+
startupType?: 'cold' | 'hot';
|
|
14
|
+
/**
|
|
15
|
+
* 是否为热启动。
|
|
16
|
+
*/
|
|
17
|
+
isStartupHot?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* 热启动距离上次退后台的分钟数。
|
|
20
|
+
*/
|
|
21
|
+
backgroundDurationMin?: number;
|
|
22
|
+
/**
|
|
23
|
+
* 当前视频已播放秒数,盲点广告使用。
|
|
24
|
+
*/
|
|
25
|
+
videoPlayedSeconds?: number;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* 广告匹配请求类型。
|
|
29
|
+
*/
|
|
30
|
+
type AdsMatchAdType = 'splash' | 'popup' | 'floating' | 'icon' | 'text' | 'banner' | 'preroll' | 'blind';
|
|
31
|
+
/**
|
|
32
|
+
* 广告匹配请求体。
|
|
33
|
+
*/
|
|
34
|
+
interface AdsMatchRequest {
|
|
35
|
+
/**
|
|
36
|
+
* 广告类型。
|
|
37
|
+
*/
|
|
38
|
+
adType: AdsMatchAdType;
|
|
39
|
+
/**
|
|
40
|
+
* 登录用户 ID,已登录时优先传。
|
|
41
|
+
*/
|
|
42
|
+
userId?: string;
|
|
43
|
+
/**
|
|
44
|
+
* 设备 ID,游客场景建议传。
|
|
45
|
+
*/
|
|
46
|
+
deviceId?: string;
|
|
47
|
+
/**
|
|
48
|
+
* 应用 code。
|
|
49
|
+
*/
|
|
50
|
+
appCode: string;
|
|
51
|
+
/**
|
|
52
|
+
* 场景上下文。
|
|
53
|
+
*/
|
|
54
|
+
sceneContext?: AdsMatchSceneContext;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* 广告匹配返回配置。
|
|
58
|
+
*/
|
|
59
|
+
interface AdsMatchConfig {
|
|
60
|
+
/**
|
|
61
|
+
* 跳过时间,开屏 / 贴片类广告使用。
|
|
62
|
+
*/
|
|
63
|
+
skipSeconds?: number;
|
|
64
|
+
/**
|
|
65
|
+
* 弹窗广告连续展示条数。
|
|
66
|
+
*/
|
|
67
|
+
popupCount?: number;
|
|
68
|
+
/**
|
|
69
|
+
* 单用户单日最大展示次数,-1 表示不限制。
|
|
70
|
+
*/
|
|
71
|
+
dailyMaxShow?: number;
|
|
72
|
+
/**
|
|
73
|
+
* 盲点广告触发分钟数。
|
|
74
|
+
*/
|
|
75
|
+
triggerVideoProgressMin?: number;
|
|
76
|
+
/**
|
|
77
|
+
* 轮播切换时间。
|
|
78
|
+
*/
|
|
79
|
+
switchInterval?: number;
|
|
80
|
+
/**
|
|
81
|
+
* 组件展示数量。
|
|
82
|
+
*/
|
|
83
|
+
displayCount?: number;
|
|
84
|
+
/**
|
|
85
|
+
* Banner 样式尺寸。
|
|
86
|
+
*/
|
|
87
|
+
styleSize?: string;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* 广告素材原始项。
|
|
91
|
+
*/
|
|
92
|
+
interface AdsMatchMaterial {
|
|
93
|
+
/**
|
|
94
|
+
* 广告业务编码。
|
|
95
|
+
*/
|
|
96
|
+
advertiseCode?: string;
|
|
97
|
+
/**
|
|
98
|
+
* 广告名称。
|
|
99
|
+
*/
|
|
100
|
+
advertiseName?: string;
|
|
101
|
+
/**
|
|
102
|
+
* 跳转地址。
|
|
103
|
+
*/
|
|
104
|
+
advertiseUrl?: string;
|
|
105
|
+
/**
|
|
106
|
+
* 图片素材地址。
|
|
107
|
+
*/
|
|
108
|
+
advertiseIcon?: string;
|
|
109
|
+
/**
|
|
110
|
+
* PC 图片素材地址。
|
|
111
|
+
*/
|
|
112
|
+
adPcAdvertiseIcon?: string;
|
|
113
|
+
/**
|
|
114
|
+
* 第三方广告类型枚举。
|
|
115
|
+
*/
|
|
116
|
+
advertiseType?: number;
|
|
117
|
+
/**
|
|
118
|
+
* 广告文案描述。
|
|
119
|
+
*/
|
|
120
|
+
advertiseDesc?: string;
|
|
121
|
+
/**
|
|
122
|
+
* 排序值。
|
|
123
|
+
*/
|
|
124
|
+
sort?: number;
|
|
125
|
+
/**
|
|
126
|
+
* 投放开始时间。
|
|
127
|
+
*/
|
|
128
|
+
startTimeStamp?: number;
|
|
129
|
+
/**
|
|
130
|
+
* 投放结束时间。
|
|
131
|
+
*/
|
|
132
|
+
endTimeStamp?: number;
|
|
133
|
+
/**
|
|
134
|
+
* 扩展展示信息。
|
|
135
|
+
*/
|
|
136
|
+
adExtData?: string;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* 广告匹配响应 data。
|
|
140
|
+
*/
|
|
141
|
+
interface AdsMatchResponseData {
|
|
142
|
+
/**
|
|
143
|
+
* 是否命中广告。
|
|
144
|
+
*/
|
|
145
|
+
hit?: boolean;
|
|
146
|
+
/**
|
|
147
|
+
* 本次返回的广告类型。
|
|
148
|
+
*/
|
|
149
|
+
adType?: AdsMatchAdType;
|
|
150
|
+
/**
|
|
151
|
+
* 命中的第三方广告位编码。
|
|
152
|
+
*/
|
|
153
|
+
advertiseLocationCode?: string;
|
|
154
|
+
/**
|
|
155
|
+
* 服务端配置。
|
|
156
|
+
*/
|
|
157
|
+
config?: AdsMatchConfig;
|
|
158
|
+
/**
|
|
159
|
+
* 广告素材列表。
|
|
160
|
+
*/
|
|
161
|
+
materials?: AdsMatchMaterial[];
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* 广告匹配接口。
|
|
165
|
+
*/
|
|
166
|
+
declare function pContentAdsMatch(data: AdsMatchRequest, config?: ExtraRequestConfig): Promise<ResponseData<AdsMatchResponseData>>;
|
|
167
|
+
/**
|
|
168
|
+
* 广告匹配接口缓存 key。
|
|
169
|
+
*/
|
|
170
|
+
declare function pContentAdsMatchKey(data: Pick<AdsMatchRequest, 'adType' | 'appCode' | 'sceneContext'>): (string | AdsMatchSceneContext)[];
|
|
171
|
+
//#endregion
|
|
172
|
+
export { AdsMatchAdType, AdsMatchConfig, AdsMatchMaterial, AdsMatchRequest, AdsMatchResponseData, AdsMatchSceneContext, pContentAdsMatch, pContentAdsMatchKey };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
|
|
2
|
+
import e from"../utils/http.mjs";async function t(t,n){let i=await e.request({...n??{},url:`/api/content/ads/match`,method:`POST`,data:t});return{...i,data:r(i.data)}}function n(e){return[`content-ads-match`,e.adType,e.appCode,e.sceneContext??{}]}function r(e){if(e)return{hit:e.hit,adType:e.adType??e.ad_type,advertiseLocationCode:e.advertiseLocationCode??e.advertise_location_code,config:i(e.config),materials:e.materials?.map(a)??[]}}function i(e){if(e)return{skipSeconds:e.skipSeconds??e.skip_seconds,popupCount:e.popupCount??e.popup_count,dailyMaxShow:e.dailyMaxShow??e.daily_max_show,triggerVideoProgressMin:e.triggerVideoProgressMin??e.trigger_video_progress_min,switchInterval:e.switchInterval??e.switch_interval,displayCount:e.displayCount??e.display_count,styleSize:e.styleSize??e.style_size}}function a(e){return{advertiseCode:e.advertiseCode??e.advertise_code,advertiseName:e.advertiseName??e.advertise_name,advertiseUrl:e.advertiseUrl??e.advertise_url,advertiseIcon:e.advertiseIcon??e.advertise_icon,adPcAdvertiseIcon:e.adPcAdvertiseIcon??e.pc_advertise_icon,advertiseType:e.advertiseType??e.advertise_type,advertiseDesc:e.advertiseDesc??e.advertise_desc,sort:e.sort,startTimeStamp:e.startTimeStamp??e.start_timestamp,endTimeStamp:e.endTimeStamp??e.end_timestamp,adExtData:e.adExtData??e.ad_ext_data}}export{t as pContentAdsMatch,n as pContentAdsMatchKey};
|