@funhub/platform 0.2.27 → 0.2.29
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 +4 -6
- package/dist/biz.mjs +1 -1
- package/dist/cli/init/create-client.mjs +1 -1
- package/dist/cli/init/shared/constants.mjs +1 -1
- package/dist/cli/init/shared/create-project.mjs +1 -1
- package/dist/cli/init/shared/prompts.mjs +1 -1
- package/dist/cli/init/shared/template.mjs +1 -1
- package/dist/cli.mjs +2 -2
- package/dist/components/biz/basics/fullscreen-feed/runtime/client.mjs +1 -1
- package/dist/components/biz/basics/logo/variants/basic-logo/runtime/client.mjs +1 -1
- package/dist/components/biz/business/advertisement/ad-match.d.mts +7 -0
- package/dist/components/biz/business/advertisement/ad-match.mjs +1 -1
- package/dist/components/biz/business/advertisement/popup-ad/client.mjs +2 -2
- package/dist/components/biz/business/advertisement/popup-ad/material.d.mts +3 -0
- package/dist/components/biz/business/advertisement/popup-ad/schema.d.mts +6 -0
- package/dist/components/biz/business/advertisement/popup-ad/schema.mjs +1 -1
- package/dist/components/biz/business/channel-list/client.mjs +1 -1
- package/dist/components/biz/business/detail/shared/detail-operate.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/shared/video-hero.mjs +1 -1
- package/dist/components/biz/business/detail/video-detail-actions/client.mjs +1 -1
- package/dist/components/biz/business/detail/video-detail-info/client.mjs +1 -1
- package/dist/components/biz/business/detail/video-detail-recommend/client.mjs +1 -1
- package/dist/components/biz/business/header-search/header-avatar-logo-search/client.mjs +1 -1
- package/dist/components/biz/business/home-recommend/shared/home-recommend-base.mjs +1 -1
- package/dist/components/biz/business/home-recommend/shared/home-recommend-preview.mjs +1 -1
- package/dist/components/biz/business/image-text-recommend/client.mjs +1 -1
- package/dist/components/biz/business/index.d.mts +3 -5
- 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/biz/business/large-feature-grid/schema.mjs +1 -1
- package/dist/components/biz/business/marquee/client.mjs +1 -1
- package/dist/components/biz/business/profile/index.d.mts +3 -5
- package/dist/components/biz/business/profile/profile-header/client.d.mts +2 -3
- package/dist/components/biz/business/profile/profile-header/client.mjs +1 -1
- package/dist/components/biz/business/profile/profile-header/index.d.mts +2 -4
- package/dist/components/biz/business/profile/profile-header/material.d.mts +1 -44
- package/dist/components/biz/business/profile/profile-header/material.mjs +1 -1
- package/dist/components/biz/business/profile/profile-header/schema.d.mts +5 -13
- package/dist/components/biz/business/profile/profile-header/schema.mjs +1 -1
- package/dist/components/biz/business/profile/profile-header/user-profile-avatar.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 +0 -1
- package/dist/components/biz/business/profile/profile-main/client.mjs +1 -1
- package/dist/components/biz/business/profile/profile-main/index.d.mts +2 -2
- package/dist/components/biz/business/profile/profile-main/material.d.mts +0 -3
- package/dist/components/biz/business/profile/profile-main/schema.d.mts +3 -7
- package/dist/components/biz/business/profile/profile-main/schema.mjs +1 -1
- package/dist/components/biz/business/profile/profile-main/shell.d.mts +0 -7
- package/dist/components/biz/business/profile/profile-main/shell.mjs +1 -1
- 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/video-waterfall.mjs +1 -1
- package/dist/components/biz/business/profile/profile-main/tabs/history-tab/client.mjs +1 -1
- package/dist/components/biz/business/profile/profile-main/tabs/like-tab/client.mjs +1 -1
- package/dist/components/biz/business/profile/profile-main/tabs/publish-tab/client.mjs +1 -1
- package/dist/components/biz/business/profile/profile-main/variants.d.mts +3 -22
- package/dist/components/biz/business/profile/profile-main/variants.mjs +1 -1
- package/dist/components/biz/business/search-history/client.mjs +1 -1
- package/dist/components/biz/business/search-input/client.mjs +1 -1
- package/dist/components/biz/business/shortcut-grid/client.mjs +1 -1
- package/dist/components/biz/business/tab-bar/client.mjs +1 -1
- package/dist/components/biz/business/text-recommend/client.mjs +1 -1
- package/dist/components/common/analytics-init/page-lifecycle-tracker.mjs +1 -1
- package/dist/components/common/background-preview-modal/background-preview-modal.mjs +1 -1
- package/dist/components/common/list/waterfall-recommend/waterfall-recommend.mjs +1 -1
- package/dist/components/common/popup-video/index.mjs +1 -1
- package/dist/components/common/series-episodes/index.mjs +1 -1
- package/dist/components/common/tab-bar/index.mjs +1 -1
- package/dist/components/common/top-nav-bar/client.mjs +1 -1
- package/dist/components/common/video-player/style.module.mjs +4 -0
- package/dist/components/common/video-player/video-blind-ad-overlay.mjs +1 -1
- package/dist/components/common/video-player/video-preroll-ad-overlay.mjs +1 -1
- package/dist/components/pages/collection-add/page.mjs +1 -1
- package/dist/components/pages/edit/page.mjs +1 -1
- package/dist/components/pages/fullscreen-feed/page.mjs +1 -1
- package/dist/components/pages/post-detail/post-detail-client.mjs +1 -1
- package/dist/components/pages/search/hot-recommend.mjs +1 -1
- package/dist/components/pages/search/hot-search.mjs +1 -1
- package/dist/components/pages/search/page-client.mjs +1 -1
- package/dist/components/pages/search/search-result/search-all.mjs +1 -1
- package/dist/components/pages/search/search-result/search-video-info.mjs +1 -1
- package/dist/components/pages/search/top-header.mjs +1 -1
- package/dist/components/pages/search-result/page-client.mjs +1 -1
- package/dist/components/pages/search-result/search-all.mjs +1 -1
- package/dist/components/pages/search-result/search-tab.mjs +1 -1
- package/dist/components/pages/search-result/search-user.mjs +1 -1
- package/dist/components/pages/search-result/top-header.mjs +1 -1
- package/dist/components/pages/settings/_components/settings.mjs +1 -1
- package/dist/components/pages/video-detail/video-detail-client.mjs +1 -1
- package/dist/components/pages/video-list/video-list-client.mjs +1 -1
- package/dist/components/pages/video-list/video-list-recommend-item.mjs +1 -1
- package/dist/components/pages/video-list/video-list-skeleton.mjs +1 -1
- package/dist/components/ui/badge.d.mts +1 -1
- package/dist/components/ui/button.d.mts +2 -2
- package/dist/components/ui/empty.d.mts +1 -1
- package/dist/components/ui/item.d.mts +1 -1
- package/dist/hooks/use-content-operate.mjs +1 -1
- package/dist/i18n/locales/en.mjs +1 -1
- package/dist/i18n/locales/zh-CN.mjs +1 -1
- package/dist/materials.d.mts +2 -2
- package/dist/materials.mjs +1 -1
- package/dist/service/advertisement.d.mts +4 -0
- package/dist/service/advertisement.mjs +1 -1
- package/dist/utils/common.mjs +1 -1
- package/dist/utils/http.mjs +1 -1
- package/dist/utils/schema/inspector.d.mts +2 -2
- package/dist/utils/tracking.d.mts +3 -11
- package/dist/utils/tracking.mjs +1 -1
- package/dist/utils/use-compatible-router.mjs +1 -1
- package/dist/utils.d.mts +2 -2
- package/dist/utils.mjs +1 -1
- package/package.json +1 -1
- package/theme.css +47 -0
- package/dist/components/biz/business/profile/profile-header/my-client.d.mts +0 -12
- package/dist/components/biz/business/profile/profile-header/my-client.mjs +0 -2
- package/dist/components/biz/business/profile/profile-header/my-profile-actions.mjs +0 -2
- package/dist/components/biz/business/profile/profile-header/my-profile-header.mjs +0 -2
- package/dist/components/biz/business/profile/profile-header/shared.mjs +0 -2
- package/dist/components/biz/business/profile/profile-header/visitor-client.d.mts +0 -12
- package/dist/components/biz/business/profile/profile-header/visitor-client.mjs +0 -2
- package/dist/components/biz/business/profile/profile-header/visitor-profile-actions.mjs +0 -2
- package/dist/components/biz/business/profile/profile-header/visitor-profile-header.mjs +0 -2
|
@@ -1,28 +1,9 @@
|
|
|
1
1
|
|
|
2
2
|
//#region components/biz/business/profile/profile-main/variants.d.ts
|
|
3
|
-
/**
|
|
4
|
-
* 内容类型配置项。
|
|
5
|
-
*/
|
|
6
|
-
declare const profileMainContentTypeOptions: readonly ["video", "novel", "comic", "post"];
|
|
7
|
-
/**
|
|
8
|
-
* 主内容 Tab 基础项。
|
|
9
|
-
*/
|
|
10
|
-
declare const profileMainBaseTabOptions: readonly ["collect", "like", "history"];
|
|
11
|
-
/**
|
|
12
|
-
* 主内容 Tab 中的帖子发布项。
|
|
13
|
-
*/
|
|
14
|
-
declare const profileMainPublishTabOption: "publish";
|
|
15
|
-
type ProfileMainContentType = typeof profileMainContentTypeOptions[number];
|
|
16
|
-
type ProfileMainBaseTabKey = typeof profileMainBaseTabOptions[number];
|
|
17
|
-
type ProfileMainTabKey = ProfileMainBaseTabKey | typeof profileMainPublishTabOption;
|
|
18
|
-
/**
|
|
19
|
-
* 根据内容类型配置解析主 Tab。
|
|
20
|
-
*/
|
|
21
|
-
declare function getProfileMainTabOptions(contentTypes?: ProfileMainContentType[]): ProfileMainTabKey[];
|
|
22
3
|
/**
|
|
23
4
|
* 个人主页主 Tab(本人视角)。
|
|
24
5
|
*/
|
|
25
|
-
declare const profileMainMineTabOptions:
|
|
6
|
+
declare const profileMainMineTabOptions: readonly ["collect", "like", "history"];
|
|
26
7
|
/**
|
|
27
8
|
* 个人主页主 Tab(他人视角)。
|
|
28
9
|
*/
|
|
@@ -30,7 +11,7 @@ declare const profileMainProfileTabOptions: readonly ["collect", "like"];
|
|
|
30
11
|
/**
|
|
31
12
|
* 物料主 Tab 可选项。
|
|
32
13
|
*/
|
|
33
|
-
declare const profileMainTabOptions:
|
|
14
|
+
declare const profileMainTabOptions: readonly ["collect", "like", "history"];
|
|
34
15
|
/**
|
|
35
16
|
* 点赞子 Tab 可选项。
|
|
36
17
|
*/
|
|
@@ -48,4 +29,4 @@ declare const profileMainCollectTabOptions: readonly ["video", "post", "collecti
|
|
|
48
29
|
*/
|
|
49
30
|
declare const profileMainCollectCollectionTabOptions: readonly ["created", "subscribed"];
|
|
50
31
|
//#endregion
|
|
51
|
-
export {
|
|
32
|
+
export { profileMainCollectCollectionTabOptions, profileMainCollectTabOptions, profileMainHistoryTabOptions, profileMainLikeTabOptions, profileMainMineTabOptions, profileMainProfileTabOptions, profileMainTabOptions };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
const e=[`
|
|
2
|
+
const e=[`collect`,`like`,`history`],t=[`collect`,`like`],n=e,r=[`video`,`post`],i=[`video`,`post`],a=[`video`,`post`,`collection`],o=[`created`,`subscribed`];export{o as profileMainCollectCollectionTabOptions,a as profileMainCollectTabOptions,i as profileMainHistoryTabOptions,r as profileMainLikeTabOptions,e as profileMainMineTabOptions,t as profileMainProfileTabOptions,n as profileMainTabOptions};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import e from"../../../../utils/event-bus.mjs";import{useUserStore as t}from"../../../../store/modules/user-store.mjs";import{trackKeywordClick as n}from"../../../../utils/tracking.mjs";import{useRouter as r}from"../../../../utils/use-compatible-router.mjs";import{Box as i}from"../../../ui/box.mjs";import{Text as a}from"../../../ui/text.mjs";import{eventKey as o}from"../../../../constants/event-key.mjs";import{useSearchHistory as s}from"../../../../hooks/use-search-history.mjs";import{DeleteConfirmDialog as c}from"../../../common/delete-confirm-dialog/delete-confirm-dialog.mjs";import{DeleteIcon as l}from"../../../common/icons/delete.mjs";import{
|
|
2
|
+
"use client";import e from"../../../../utils/event-bus.mjs";import{useUserStore as t}from"../../../../store/modules/user-store.mjs";import{trackKeywordClick as n}from"../../../../utils/tracking.mjs";import{useRouter as r}from"../../../../utils/use-compatible-router.mjs";import{Box as i}from"../../../ui/box.mjs";import{Text as a}from"../../../ui/text.mjs";import{eventKey as o}from"../../../../constants/event-key.mjs";import{useSearchHistory as s}from"../../../../hooks/use-search-history.mjs";import{DeleteConfirmDialog as c}from"../../../common/delete-confirm-dialog/delete-confirm-dialog.mjs";import{DeleteIcon as l}from"../../../common/icons/delete.mjs";import{usePathname as u,useSearchParams as d}from"next/navigation";import{useLayoutEffect as f,useMemo as p,useRef as m,useState as h}from"react";import{jsx as g,jsxs as _}from"react/jsx-runtime";function v(e,t){let n=Array.from(e);return n.length<=t?e:`${n.slice(0,t).join(``)}...`}function y(y){let{title:b,rows:x=2,clearText:S,confirmDescription:C,onHistoryClick:w,mode:T=`renderer`}=y,E=T===`editor`,D=b??`搜索历史`,O=S??`清空`,k=C??`确定要清除所有搜索历史吗?`,A=p(()=>[`海市蜃楼`,`迷雾追凶`,`夜行者`,`狂飙`,`三大队`,`破冰行动`],[]),[j,M]=h(!1),[N,P]=h(null),F=m(null),I=m([]),L=m(null),R=r(),z=u(),B=d(),{userInfo:V}=t(),{history:H,addHistory:U,clearHistory:W}=s({storageKey:V?.user_id||`guest`}),G=()=>{W(),M(!1),e.emit(o.SEARCH_HISTORY_UPDATE)},K=p(()=>(H.length?H:T===`editor`?A:[]).slice(0,x*10),[H,T,A,x]);if(f(()=>{if(K.length===0){P(null);return}let e=F.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect(),n=[];I.current.slice(0,K.length).forEach(e=>{if(!e)return;let r=e.getBoundingClientRect(),i=Math.round(r.top-t.top),a=Math.round(r.bottom-t.top),o=n.find(e=>Math.abs(e.top-i)<=1);if(o){o.bottom=Math.max(o.bottom,a);return}n.push({top:i,bottom:a})}),n.sort((e,t)=>e.top-t.top);let r=n.slice(0,x).reduce((e,t)=>Math.max(e,t.bottom),0);P(e=>e===r?e:r)},n=()=>{L.current!=null&&cancelAnimationFrame(L.current),L.current=requestAnimationFrame(()=>{L.current=null,t()})};if(n(),typeof ResizeObserver>`u`)return()=>{L.current!=null&&(cancelAnimationFrame(L.current),L.current=null)};let r=new ResizeObserver(()=>{n()});return r.observe(e),I.current.slice(0,K.length).forEach(e=>{e&&r.observe(e)}),()=>{r.disconnect(),L.current!=null&&(cancelAnimationFrame(L.current),L.current=null)}},[K,x]),K.length===0)return null;let q=(e,t)=>{if(n({keyword:e,click_item_id:``,click_item_type_key:``,click_item_type_name:``,click_position:t,search_trace_id:``}),U(e),w){w(e);return}let r=new URLSearchParams(B.toString());r.set(`q`,e);let i=z.includes(`/search-result`)?z:`/search-result`;R.push(`${i}?${r.toString()}`)};return _(i,{className:E?`mt-[24px] no-vw-x-16 py-[16px]`:`mt-[24px] no-vw-x-16 py-0`,children:[_(i,{className:`mb-[15px] flex items-center justify-between`,children:[g(a,{className:`font-['PingFang_SC'] text-[16px] font-medium not-italic leading-normal text-white`,children:D}),g(`button`,{type:`button`,"aria-label":O,className:`flex h-[24px] w-[24px] shrink-0 items-center justify-center text-white/50`,onClick:()=>M(!0),children:g(l,{className:`h-[24px] w-[24px]`})})]}),g(i,{ref:F,className:`flex flex-wrap content-start items-center gap-[6px] overflow-hidden`,style:N?{maxHeight:`${N}px`}:void 0,children:K.map((e,t)=>g(i,{ref:e=>{I.current[t]=e},className:`flex min-w-[56px] cursor-pointer items-center justify-center rounded-full px-[8px] py-[4px] ${E?`bg-[#1F1F1F]/10`:`bg-white/20`}`,onClick:()=>q(e,t),children:g(a,{className:`max-w-full whitespace-nowrap font-['PingFang_SC'] text-[14px] font-normal not-italic leading-[20px] text-white`,children:v(e,8)})},t))}),g(c,{open:j,onOpenChange:M,onConfirm:G,title:``,description:k})]})}export{y as SearchHistoryClient};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{useRouter as e}from"../../../../utils/use-compatible-router.mjs";import{Box as t}from"../../../ui/box.mjs";import{Input as n}from"../../../ui/input.mjs";import{LeftArrowIcon as r}from"../../../common/icons/left-arrow.mjs";import i from"../../../../assets/icons/search.mjs";import a from"../../../../assets/icons/clear.mjs";import{
|
|
2
|
+
"use client";import{useRouter as e}from"../../../../utils/use-compatible-router.mjs";import{Box as t}from"../../../ui/box.mjs";import{Input as n}from"../../../ui/input.mjs";import{LeftArrowIcon as r}from"../../../common/icons/left-arrow.mjs";import i from"../../../../assets/icons/search.mjs";import a from"../../../../assets/icons/clear.mjs";import{usePathname as o,useSearchParams as s}from"next/navigation";import{useCallback as c,useState as l}from"react";import{jsx as u,jsxs as d}from"react/jsx-runtime";function f(e){if(!e||typeof e!=`string`)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t.map(e=>e==null?``:String(e).trim()).filter(Boolean):[]}catch{return[]}}function p(p){let{placeholder:m,defaultPlaceholder:h,searchLabel:g,storageKey:_=`guest`,onSearch:v,mode:y=`renderer`}=p,b=m||(h??`请输入搜索内容`),x=g??`搜索`,S=y===`editor`,[C,w]=l(``),T=e(),E=o(),D=s(),O=`search_history_${_}`,k=c(e=>{if(S)return;let t=e.trim();if(t){try{let e=[t,...f(localStorage.getItem(O)).filter(e=>e!==t)].slice(0,20);localStorage.setItem(O,JSON.stringify(e))}catch(e){console.error(`Failed to save search history`,e)}if(v)v(t);else{let e=new URLSearchParams(D.toString());e.set(`q`,t);let n=E.includes(`/search-result`)?E:`/search-result`;T.push(`${n}?${e.toString()}`)}}},[O,S,v,E,T,D]),A=()=>{S||T.back()};return d(t,{className:`flex h-[66px] w-full items-center gap-[8px] no-vw-x-16 py-[16px]${S?` pointer-events-none`:``}`,children:[u(`button`,{type:`button`,"aria-label":`返回`,className:`flex size-[24px] shrink-0 items-center justify-center text-white active:opacity-70`,onClick:A,children:u(r,{className:`h-[16px] w-[16px]`})}),d(t,{className:`flex h-[34px] min-w-0 flex-1 items-center overflow-hidden rounded-[100px] border border-[#E62AFF]/90 bg-black/40 backdrop-blur-[2px]`,children:[d(t,{className:`relative flex h-full min-w-0 flex-1 items-center pl-[12px] pr-[10px]`,children:[u(`span`,{className:`pointer-events-none absolute inset-y-0 left-[12px] flex items-center justify-center`,children:u(i,{className:`h-[14px] w-[14px] text-white/60`})}),u(n,{className:`!h-[20px] !w-full !rounded-none !border-0 !bg-transparent !px-0 !pl-[22px] !pr-[18px] !py-0 !text-[14px] !leading-[20px] !text-white !caret-white placeholder:!text-white/90 focus-visible:!ring-0`,placeholder:b,value:C,maxLength:128,onChange:e=>w(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),k(C))}}),C&&u(`span`,{className:`absolute inset-y-0 right-0 flex items-center justify-center`,children:u(a,{className:`h-[15px] w-[15px] shrink-0 cursor-pointer text-white/50 active:opacity-70`,onClick:()=>w(``)})})]}),u(`button`,{type:`button`,className:`mx-[2px] flex h-[30px] w-[56px] shrink-0 items-center justify-center rounded-[100px] bg-[linear-gradient(90deg,#9756E3_0%,#6C43EE_100%)] text-[14px] leading-[20px] text-white active:opacity-90`,onClick:()=>k(C),children:x})]})]})}export{p as SearchInputClient};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{Image as e}from"../../../ui/image.mjs";import{Box as t}from"../../../ui/box.mjs";import{Text as n}from"../../../ui/text.mjs";import r from"../../../ui/link.mjs";import i from"../../../../assets/images/shortcut-grid/shortcut-grid-card-bg-primary.mjs";import{shortcutGridInspectorDefaultProps as a}from"./schema.mjs";import{jsx as o,jsxs as s}from"react/jsx-runtime";function c(c){let{mode:l=`renderer`,title:u,shortcutCount:d,isShortcutTitle:f,shortcuts:p}={...a,...c},m=l===`editor`,h=(()=>{let e=d??p.length??0;return Math.min(Math.max(e,3),5)})(),g=(p??[]).slice(0,h);return o(t,{as:`section`,className
|
|
2
|
+
"use client";import{Image as e}from"../../../ui/image.mjs";import{Box as t}from"../../../ui/box.mjs";import{Text as n}from"../../../ui/text.mjs";import r from"../../../ui/link.mjs";import i from"../../../../assets/images/shortcut-grid/shortcut-grid-card-bg-primary.mjs";import{shortcutGridInspectorDefaultProps as a}from"./schema.mjs";import{jsx as o,jsxs as s}from"react/jsx-runtime";function c(c){let{mode:l=`renderer`,title:u,shortcutCount:d,isShortcutTitle:f,shortcuts:p}={...a,...c},m=l===`editor`,h=(()=>{let e=d??p.length??0;return Math.min(Math.max(e,3),5)})(),g=(p??[]).slice(0,h);return o(t,{as:`section`,className:`py-3 no-vw-x-16`,"aria-label":`金刚区`,children:s(t,{className:`w-full`,children:[m&&u?.trim()?o(n,{as:`h2`,className:`mb-3 text-[12px] leading-[16px] text-white/45`,children:u}):null,o(t,{className:`grid w-full items-start gap-4`,style:{gridTemplateColumns:`repeat(${h}, minmax(0, 1fr))`},children:g.map((a,c)=>{let l=o(t,{className:`relative h-[79px] w-full min-w-0 overflow-visible`,children:s(t,{className:`absolute inset-x-0 bottom-0 h-[63px] w-full overflow-visible`,children:[o(i,{"aria-hidden":!0,className:`absolute inset-0 h-full w-full`}),o(t,{className:`pointer-events-none absolute left-1/2 top-[32px] z-20 -translate-x-1/2`,children:f?o(n,{className:`whitespace-nowrap text-center text-[12px] leading-[16px] text-white/80`,title:a.label||void 0,children:a.label}):null}),o(t,{className:`pointer-events-none absolute right-0 top-[-14px] z-30`,children:o(t,{className:`relative h-[43px] w-[42px] overflow-visible`,"aria-hidden":!a.label,children:a.icon?o(e,{src:a.icon,alt:a.label||`入口图标`,fill:!0,className:`object-contain drop-shadow-[0_10px_18px_rgba(0,0,0,0.3)]`}):o(t,{className:`h-full w-full rounded-full bg-white/12`})})})]})});return o(r,{href:a.href,className:`block w-full min-w-0 transition-transform duration-200 active:scale-[0.98]`,children:l},a.href||a.label||c)})})]})})}export{c as ShortcutGridClient};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{trackNavigation as e}from"../../../../utils/tracking.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{
|
|
2
|
+
"use client";import{trackNavigation as e}from"../../../../utils/tracking.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{usePathname as i}from"next/navigation";import{useMemo as a}from"react";import{jsx as o,jsxs as s}from"react/jsx-runtime";import c from"next/link";const l=[],u={backgroundColor:`rgba(5, 1, 15, 0.1)`,backdropFilter:`blur(8px)`,WebkitBackdropFilter:`blur(8px)`},d={background:`linear-gradient(0deg, rgba(6, 3, 21, 0.03) 0%, rgba(6, 3, 21, 0.03) 100%), rgba(255, 255, 255, 0.10)`},f={background:`linear-gradient(180deg, rgba(255, 255, 255, 0.3) 0%, transparent 100%)`,padding:`1px`,WebkitMask:`linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)`,WebkitMaskComposite:`xor`,mask:`linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)`,maskComposite:`exclude`};function p(e){return e.split(`?`)[0].replace(/\/+$/,``)||`/`}function m(e){if(e.configType===1)switch(e.functionPageType){case`搜索`:return`/search`;case`个人中心`:return`/user/mine`;case`内容列表`:return`/video-list?tags=${e.tags}&title=${e.title}`;default:return`/`}let t=(e.domainId??``).toString().trim();return t?`/domain/${t}`:`/`}function h(e,t){let n=p(t);if(e.configType===1){let t=p(m(e).split(`?`)[0]);return n===t||n.startsWith(`${t}/`)}let r=e.domainId.trim();if(!r)return n===`/`||n.startsWith(`/category/`);let i=`/domain/${r}`;return n===i||n.startsWith(`${i}/`)}function g(e,t){return e.findIndex(e=>h(e,t))}function _(e){return typeof e.show_nav_name==`boolean`?e.show_nav_name:typeof e.showNavName==`boolean`?e.showNavName:!0}function v(p){let{items:h=l,mode:v=`renderer`}=p,y=i(),b=a(()=>{if(v===`editor`)return 0;let e=g(h??[],y);return e>=0?e:0},[h,y,v]),x=a(()=>(h??[]).some(e=>_(e)&&e.label.trim()!==``),[h]);if(!h?.length)return null;function S(t,n){v===`editor`?t.preventDefault():e({navigation_key:`navigation_${n.label}`,navigation_name:n.label})}let C=`size-full rounded-[6px] bg-white/20`;return o(n,{as:`nav`,"aria-label":`Bottom navigation`,className:`fixed bottom-0 left-0 right-0 z-50 flex flex-col items-center`,style:u,children:s(n,{className:`relative my-[4px] flex h-[56px] w-[358px] items-center justify-between rounded-[100px] px-[40px]`,children:[o(n,{className:`pointer-events-none absolute inset-0 rounded-[100px]`,style:d,"aria-hidden":`true`}),o(n,{className:`pointer-events-none absolute inset-0 rounded-[100px]`,style:f,"aria-hidden":`true`}),h.map((e,i)=>{let a=b===i,l=a?e.activeIcon:e.icon,u=e.label,d=_(e)&&u.trim()!==``,f=m(e),p=x?a?`gap-[5px]`:`gap-[4px]`:``,h=a?`whitespace-nowrap text-center text-[12px] leading-[16px] font-normal text-[#C043E8]`:`whitespace-nowrap text-center text-[12px] leading-[16px] font-normal text-white/50`;return s(c,{href:f,className:`flex flex-col items-center justify-center ${p}`,"aria-current":a?`page`:void 0,"data-index":i,"data-webview-nav":`spa`,onClick:t=>S(t,e),children:[o(n,{className:`relative size-5 shrink-0`,children:l?o(t,{src:l,alt:u,fill:!0,className:`object-contain`}):o(n,{className:a?`${C} bg-[#C043E8]`:C})}),x&&d?o(r,{"data-active":a,className:h,children:u}):null]},i)})]})})}export{v as TabBarClient};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{useUserStore as e}from"../../../../store/modules/user-store.mjs";import{gContentGetRecommendSearchList as t}from"../../../../service/generated/client.mjs";import{useRouter as n}from"../../../../utils/use-compatible-router.mjs";import{Box as r}from"../../../ui/box.mjs";import{Text as i}from"../../../ui/text.mjs";import{useRequest as a}from"../../../../hooks/query/use-query.mjs";import o from"../../../../assets/icons/refresh.mjs";import{
|
|
2
|
+
"use client";import{useUserStore as e}from"../../../../store/modules/user-store.mjs";import{gContentGetRecommendSearchList as t}from"../../../../service/generated/client.mjs";import{useRouter as n}from"../../../../utils/use-compatible-router.mjs";import{Box as r}from"../../../ui/box.mjs";import{Text as i}from"../../../ui/text.mjs";import{useRequest as a}from"../../../../hooks/query/use-query.mjs";import o from"../../../../assets/icons/refresh.mjs";import{usePathname as s,useSearchParams as c}from"next/navigation";import{useMemo as l,useState as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{useShallow as p}from"zustand/react/shallow";function m(e,t){if(e.length<=t)return[...e];let n=[...e];for(let e=0;e<t;e++){let t=e+Math.floor(Math.random()*(n.length-e));[n[e],n[t]]=[n[t],n[e]]}return n.slice(0,t)}function h(h){let{title:g,displayCount:_=6,showRefresh:v=!1,onItemClick:y,mode:b=`renderer`}=h,x=b===`editor`,S=n(),C=s(),w=c(),[T,E]=u(0),{userInfo:D}=e(p(e=>({userInfo:e.userInfo}))),O=D?.user_id||`guest`,{data:k}=a([`text-recommend-keyword-list`,O],()=>t({user_id:O}),{enabled:!x}),A=l(()=>(k?.data?.recommend_list??[]).map(e=>({label:e.title??``})).filter(e=>e.label),[k]),j=_*2,M=l(()=>x?Array.from({length:j},(e,t)=>({label:`推荐搜索${t+1}`})):A,[x,A,j]),N=l(()=>m(M,j),[M,T,j]);if(!x&&A.length<2)return null;let P=e=>{e.stopPropagation(),E(e=>e+1)},F=e=>{if(y){y(e);return}let t=new URLSearchParams(w.toString());t.set(`q`,e);let n=C.includes(`/search-result`)?C:`/search-result`;S.push(`${n}?${t.toString()}`)};return f(r,{className:`bg-bg1 p-3 flex flex-col gap-3 w-full${x?` pointer-events-none`:``}`,children:[f(r,{className:`flex items-center justify-between w-full`,children:[d(i,{className:`text-[18px] font-bold text-text1 leading-[26px]`,children:g}),v&&f(r,{className:`flex items-center gap-1 cursor-pointer active:opacity-70 transition-opacity`,onClick:P,children:[d(i,{className:`text-[14px] text-text3 leading-[22px]`,children:`换一批`}),d(o,{className:`w-3 h-3 text-text3`})]})]}),d(r,{className:`grid grid-cols-2 gap-x-1 gap-y-1 w-full`,children:N.map((e,t)=>d(r,{className:`flex items-center h-[32px] cursor-pointer active:opacity-70 transition-opacity overflow-hidden`,onClick:()=>F(e.label),children:d(i,{className:`text-[14px] text-text1 leading-[22px] truncate w-full`,children:e.label})},`${T}-${t}`))})]})}export{h as TextRecommendClient};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{trackPageLifecycle as e}from"../../../utils/tracking.mjs";import{
|
|
2
|
+
"use client";import{trackPageLifecycle as e}from"../../../utils/tracking.mjs";import{usePathname as t}from"next/navigation";import{useEffect as n,useRef as r}from"react";const i=[`zh-CN`,`en`];function a(e){for(let t of i){if(e===`/${t}`)return`/`;if(e.startsWith(`/${t}/`))return e.slice(t.length+1)}return e}function o(e){if(e===`/`||e.startsWith(`/category/`)||e.startsWith(`/domain/`))return{key:`page_home`,name:`首页`,path:e};if(e.startsWith(`/video/`))return{key:`page_video_detail`,name:`详情页`,path:e};if(e.startsWith(`/post/`))return{key:`page_post_detail`,name:`详情页`,path:e};if(e.startsWith(`/search-result`))return{key:`page_search_result`,name:`搜索结果`,path:e};if(e.startsWith(`/search`))return{key:`page_search`,name:`搜索`,path:e};if(e.startsWith(`/profile/`))return{key:`page_user`,name:`个人中心`,path:e};if(e===`/settings`)return{key:`page_settings`,name:`设置`,path:e};if(e===`/edit`)return{key:`page_edit_profile`,name:`编辑资料`,path:e};if(e===`/publish`)return{key:`page_publish`,name:`发布`,path:e};if(e.startsWith(`/feed-series/`))return{key:`page_feed_series`,name:`短剧`,path:e};if(e===`/feedback`)return{key:`page_feedback`,name:`意见反馈`,path:e};if(e===`/collection/add`)return{key:`page_collection_add`,name:`添加到合集`,path:e};if(e===`/collection/create`)return{key:`page_collection_create`,name:`创建合集`,path:e};if(e.startsWith(`/collection/`))return{key:`page_collection_detail`,name:`合集详情`,path:e};if(e===`/fans`)return{key:`page_fans`,name:`粉丝`,path:e};if(e===`/followed`)return{key:`page_followed`,name:`关注`,path:e};if(e===`/user/follow`)return{key:`page_user_follow`,name:`关注`,path:e};if(e===`/user/mine`)return{key:`page_mine`,name:`我的`,path:e};if(e===`/user/message`)return{key:`page_message`,name:`消息`,path:e};if(e.startsWith(`/video-list`))return{key:`page_video_list`,name:`视频列表`,path:e};if(e.startsWith(`/feed-series`))return{key:`page_feed_series`,name:`短剧`,path:e};if(e===`/hot`)return{key:`page_hot`,name:`热门`,path:e};if(e===`/ranking`)return{key:`page_ranking`,name:`排行榜`,path:e};if(e.startsWith(`/tag/`))return{key:`page_tag`,name:`标签`,path:e};let t=e.split(`/`)[1]||`unknown`;return{key:`page_${t}`,name:t,path:e}}function s(){let i=a(t()??`/`),s=r(Date.now()),c=r(null),l=r(!0);return n(()=>{let t=Date.now(),n=c.current,r=o(i);if(n&&n.key!==r.key){let r=Math.floor((t-s.current)/1e3);e({lifecycle_status:`hide`,page_key:n.key,page_name:n.name,page_path:n.path,duration:r})}c.current=r,s.current=t,l.current=typeof document<`u`?document.visibilityState!==`hidden`:!0,e({lifecycle_status:`show`,page_key:r.key,page_name:r.name,page_path:r.path,duration:0});let a=setInterval(()=>{if(!l.current)return;let t=c.current;if(!t)return;let n=Math.floor((Date.now()-s.current)/1e3);e({lifecycle_status:`show`,page_key:t.key,page_name:t.name,page_path:t.path,duration:n})},600*1e3);return()=>clearInterval(a)},[i]),n(()=>{function t(){if(!l.current)return;l.current=!1;let t=c.current;if(!t)return;let n=Math.floor((Date.now()-s.current)/1e3);e({lifecycle_status:`hide`,page_key:t.key,page_name:t.name,page_path:t.path,duration:n})}function n(){if(l.current)return;l.current=!0,s.current=Date.now();let t=c.current;t&&e({lifecycle_status:`show`,page_key:t.key,page_name:t.name,page_path:t.path,duration:0})}function r(){document.visibilityState===`hidden`?t():n()}return document.addEventListener(`visibilitychange`,r),window.addEventListener(`pagehide`,t),()=>{document.removeEventListener(`visibilitychange`,r),window.removeEventListener(`pagehide`,t)}},[]),null}export{s as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{cn as e}from"../../../utils/cn.mjs";import{Image as t}from"../../ui/image.mjs";import{Dialog as n,DialogContent as r}from"../../ui/dialog.mjs";import{jsx as i,jsxs as a}from"react/jsx-runtime";function o({open:o,onClose:s,bgUrl:c,onUpload:l}){return i(n,{open:o,onOpenChange:s,children:i(r,{showCloseButton:!1,className:`bg-black !m-0 !p-0 !fixed !inset-0 !w-screen !h-screen !max-w-none !rounded-none !top-0 !left-0 !translate-x-0 !translate-y-0 !transform-none z-[9999] !pointer-events-auto`,children:a(`div`,{className:`relative flex h-full w-full flex-col items-center justify-center`,children:[i(`button`,{type:`button`,className:`absolute left-0 focus-within:outline-none top-0 flex h-14 w-14 items-center justify-center text-white transition-colors hover:text-white/80`,onClick:s,children:i(`svg`,{className:`w-4 h-4`,xmlns:`http://www.w3.org/2000/svg`,fill:`currentColor`,viewBox:`0 0 16 16`,children:i(`path`,{d:`M14.55.2a.889.889 0 0 1 1.25 1.25l-.06.067L9.255 8l6.483 6.482.06.069a.888.888 0 0 1-1.25 1.25l-.067-.062L8 9.256l-6.482 6.483A.888.888 0 1 1 .26 14.482L6.742 8 .26 1.517.2 1.45A.888.888 0 0 1 1.45.2l.067.062 6.482 6.482L14.482.261l.068-.062Z`})})}),i(`div`,{className:`relative h-[256px] w-full overflow-hidden bg-white/10`,children:i(t,{src:c||`/images/mine/img_mine_head_bg.png`,alt:`背景图预览`,fill:!0,className:`object-cover`,style:{pointerEvents:`none`}})}),a(`button`,{type:`button`,className:e(`absolute bottom-8 left-0 right-0 mx-auto flex w-[366px] max-w-[90%] items-center justify-between rounded-
|
|
2
|
+
"use client";import{cn as e}from"../../../utils/cn.mjs";import{Image as t}from"../../ui/image.mjs";import{Dialog as n,DialogContent as r}from"../../ui/dialog.mjs";import{jsx as i,jsxs as a}from"react/jsx-runtime";function o({open:o,onClose:s,bgUrl:c,onUpload:l}){return i(n,{open:o,onOpenChange:s,children:i(r,{showCloseButton:!1,className:`bg-black !m-0 !p-0 !fixed !inset-0 !w-screen !h-screen !max-w-none !rounded-none !top-0 !left-0 !translate-x-0 !translate-y-0 !transform-none z-[9999] !pointer-events-auto`,children:a(`div`,{className:`relative flex h-full w-full flex-col items-center justify-center`,children:[i(`button`,{type:`button`,className:`absolute left-0 focus-within:outline-none top-0 flex h-14 w-14 items-center justify-center text-white transition-colors hover:text-white/80`,onClick:s,children:i(`svg`,{className:`w-4 h-4`,xmlns:`http://www.w3.org/2000/svg`,fill:`currentColor`,viewBox:`0 0 16 16`,children:i(`path`,{d:`M14.55.2a.889.889 0 0 1 1.25 1.25l-.06.067L9.255 8l6.483 6.482.06.069a.888.888 0 0 1-1.25 1.25l-.067-.062L8 9.256l-6.482 6.483A.888.888 0 1 1 .26 14.482L6.742 8 .26 1.517.2 1.45A.888.888 0 0 1 1.45.2l.067.062 6.482 6.482L14.482.261l.068-.062Z`})})}),i(`div`,{className:`relative h-[256px] w-full overflow-hidden bg-white/10`,children:i(t,{src:c||`/images/mine/img_mine_head_bg.png`,alt:`背景图预览`,fill:!0,className:`object-cover`,style:{pointerEvents:`none`}})}),a(`button`,{type:`button`,className:e(`absolute bottom-8 left-0 right-0 mx-auto flex w-[366px] max-w-[90%] items-center justify-between rounded-[12px] bg-white/10 p-[12px] transition-colors hover:bg-white/20`,`active:scale-95`),onClick:l,children:[i(`span`,{className:`text-base font-medium text-white`,children:`更换背景图`}),a(`svg`,{className:`w-6 h-6 text-white`,xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,children:[i(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M3 9a2 2 0 012-2h.93a2 2 0 001.664-.89l.812-1.22A2 2 0 0110.07 4h3.86a2 2 0 011.664.89l.812 1.22A2 2 0 0018.07 7H19a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V9z`}),i(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M15 13a3 3 0 11-6 0 3 3 0 016 0z`})]})]})]})})})}export{o as BackgroundPreviewModal};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{Image as e}from"../../../ui/image.mjs";import{Box as t}from"../../../ui/box.mjs";import{Text as n}from"../../../ui/text.mjs";import r from"../../../ui/link.mjs";import i from"../../../../assets/icons/detail/video_flag.mjs";import{CollectionSelectIcon as a,CollectionSelectedIcon as o}from"../collection-list/collection-select-icon.mjs";import{RECOMMEND_BADGE_IMAGE_CLASS_NAME as s,RECOMMEND_TOP_LEFT_BADGE_WRAPPER_CLASS_NAME as c,normalizeRecommendBadgeUrl as l}from"./recommend-badge-style.mjs";import{WATERFALL_SHORT_CARD_ASPECT_RATIO as u,WATERFALL_TALL_CARD_ASPECT_RATIO as d,buildWaterfallRecommendLegacyDisplay as f}from"./waterfall-recommend-display.mjs";import{Fragment as p,jsx as m,jsxs as h}from"react/jsx-runtime";const g={backgroundImage:`var(--gradient-card-mask-strong)`};function _({title:e,moreHref:i,onMoreClick:a,moreIcon:o,columns:s,sectionClassName:c=`w-full`,headerClassName:l=`mb-[16px] flex items-center justify-between
|
|
2
|
+
"use client";import{Image as e}from"../../../ui/image.mjs";import{Box as t}from"../../../ui/box.mjs";import{Text as n}from"../../../ui/text.mjs";import r from"../../../ui/link.mjs";import i from"../../../../assets/icons/detail/video_flag.mjs";import{CollectionSelectIcon as a,CollectionSelectedIcon as o}from"../collection-list/collection-select-icon.mjs";import{RECOMMEND_BADGE_IMAGE_CLASS_NAME as s,RECOMMEND_TOP_LEFT_BADGE_WRAPPER_CLASS_NAME as c,normalizeRecommendBadgeUrl as l}from"./recommend-badge-style.mjs";import{WATERFALL_SHORT_CARD_ASPECT_RATIO as u,WATERFALL_TALL_CARD_ASPECT_RATIO as d,buildWaterfallRecommendLegacyDisplay as f}from"./waterfall-recommend-display.mjs";import{Fragment as p,jsx as m,jsxs as h}from"react/jsx-runtime";const g={backgroundImage:`var(--gradient-card-mask-strong)`};function _({title:e,moreHref:i,onMoreClick:a,moreIcon:o,columns:s,sectionClassName:c=`w-full`,headerClassName:l=`mb-[16px] flex items-center justify-between no-vw-x-16`,titleClassName:u=`flex-1 min-w-0 text-[18px] leading-[24px] font-medium line-clamp-1 text-text2`,moreLinkClassName:d=`ml-[8px] flex size-[24px] shrink-0 items-center justify-center opacity-50`,containerClassName:f=`relative flex w-full gap-[8px] no-vw-x-16`,overlay:p,footer:g,getItemRef:_,selectionMode:y=!1,selectedIds:b,onToggleSelection:x,onItemClick:S}){return h(t,{className:c,children:[h(t,{className:l,children:[m(n,{className:u,children:e}),o&&i&&m(r,{href:i,"aria-label":`更多`,className:d,onClick:a,children:o}),o&&!i&&a&&m(`button`,{type:`button`,"aria-label":`更多`,className:d,onClick:a,children:o})]}),h(t,{className:f,children:[m(t,{className:`flex-1 min-w-0 flex flex-col`,children:s.left.map((e,t)=>m(`div`,{ref:_?.({item:e,column:`left`,columnIndex:t}),children:m(v,{item:e,selectionMode:y,selectedIds:b,onToggleSelection:x,onItemClick:S})},e.key))}),m(t,{className:`flex-1 min-w-0 flex flex-col`,children:s.right.map((e,t)=>m(`div`,{ref:_?.({item:e,column:`right`,columnIndex:t}),children:m(v,{item:e,selectionMode:y,selectedIds:b,onToggleSelection:x,onItemClick:S})},e.key))}),p]}),g]})}function v({item:_,selectionMode:v=!1,selectedIds:y,onToggleSelection:b,onItemClick:x}){let S=_.cardKind===`short`?u:d,C=_.selectionId??``,w=!!(C&&y?.has(C)),T=f(_),E=l(T.topLeftBadgeImageUrl);function D(){!v||!C||b?.(C)}let O=h(p,{children:[h(t,{className:`relative w-full overflow-hidden rounded-[8px] bg-[#18111f]`,style:{aspectRatio:S},children:[_.coverUrl&&m(e,{src:_.coverUrl,alt:_.title||`推荐封面`,fill:!0,objectFit:`cover`,className:`object-cover`}),m(t,{className:`pointer-events-none absolute inset-0 rounded-[8px]`,style:g,"aria-hidden":!0}),v&&m(t,{className:`pointer-events-none absolute left-[8px] top-[8px] z-[2]`,children:m(w?o:a,{})}),!v&&h(p,{children:[E&&m(t,{className:c,children:m(e,{src:E,alt:`角标`,width:96,height:18,className:s})}),T.topRightScoreText&&m(n,{as:`span`,className:`absolute right-[8px] top-[8px] z-[1] shrink-0 text-[14px] leading-[22px] font-semibold text-[#FFC24B]`,children:T.topRightScoreText}),h(t,{className:`absolute left-[8px] right-[8px] bottom-[10px] z-[1] flex items-end justify-between gap-[8px]`,children:[m(t,{className:`flex min-w-0 items-center gap-[4px]`,children:T.bottomLeftHeatText&&h(p,{children:[m(i,{className:`h-[16px] w-[16px] shrink-0 text-white`}),m(n,{as:`span`,className:`min-w-0 truncate text-[14px] leading-[20px] text-white`,children:T.bottomLeftHeatText})]})}),T.bottomRightEpisodeText&&m(n,{as:`span`,className:`shrink-0 text-[14px] leading-[20px] text-white`,children:T.bottomRightEpisodeText})]})]})]}),!v&&m(t,{className:`mt-[8px] overflow-hidden`,children:m(n,{as:`h3`,className:`line-clamp-2 text-[16px] leading-[22px] text-[--color-text-white80]`,children:T.title})})]});return v?m(`button`,{type:`button`,className:`mb-[16px] block w-full cursor-pointer border-0 bg-transparent p-0 text-left`,onClick:D,"aria-pressed":w,disabled:!C,children:O}):m(r,{href:_.href,className:`mb-[16px] block w-full`,onClick:()=>x?.(_),children:O})}export{_ as WaterfallRecommend};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{parseResolution as e}from"../../../utils/common.mjs";import t from"../../../utils/event-bus.mjs";import{Button as n}from"../../ui/button.mjs";import{eventKey as r}from"../../../constants/event-key.mjs";import i from"../video-player/index.mjs";import a from"./popup-video.module.mjs";import{
|
|
2
|
+
"use client";import{parseResolution as e}from"../../../utils/common.mjs";import t from"../../../utils/event-bus.mjs";import{Button as n}from"../../ui/button.mjs";import{eventKey as r}from"../../../constants/event-key.mjs";import i from"../video-player/index.mjs";import a from"./popup-video.module.mjs";import{usePathname as o}from"next/navigation";import{useCallback as s,useEffect as c,useState as l}from"react";import{jsx as u,jsxs as d}from"react/jsx-runtime";function f(){let f=o(),[p,m]=l(!1),[h,g]=l(null),[_,v]=l(0),y=s(t=>{if(typeof window>`u`)return 0;let{width:n,height:r}=e(t.resolution);return n<=0?0:Math.max(0,r*(window.innerWidth/n))},[]),b=s(({info:e,show:t})=>{if(!e||!t){m(!1),g(null);return}g(e),v(y(e)),m(!0)},[y]);return c(()=>(t.on(r.SHOW_POPUP_VIDEO,b),()=>{t.off(r.SHOW_POPUP_VIDEO,b)}),[b]),c(()=>{m(!1),g(null)},[f]),!p||!h?null:d(`div`,{className:`fixed inset-0 z-[9999] flex items-center justify-center bg-black/95`,children:[u(n,{variant:`ghost`,className:`absolute left-4 top-4 h-10 w-10 rounded-full border border-white/20 text-white`,onClick:()=>{m(!1),g(null)},children:`←`}),u(`div`,{className:a.popupVideo,style:{width:`100%`,maxHeight:`100%`,height:_>0?`${_}px`:`auto`},children:u(i,{plyerId:h.plyerId,resolution:h.resolution,poster:h.poster||``,videoUrl:h.videoUrl||``,hlsList:h.hlsList,mergeConfig:_>0?{}:{fitVideoSize:`fixWidth`}})})]})}export{f as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{trackPageClick as e}from"../../../utils/tracking.mjs";import{Box as t}from"../../ui/box.mjs";import{Text as n}from"../../ui/text.mjs";import{Sheet as r,SheetContent as i,SheetHeader as a,SheetTitle as o}from"../../ui/sheet.mjs";import{Switch as s}from"../../ui/switch.mjs";import{useKeepAliveState as c}from"../keep-scroll-position/index.mjs";import l from"../../../assets/icons/common/right_arrow.mjs";import u from"../../ui/popup.mjs";import{toast as d}from"sonner";import{useCallback as f,useEffect as p,useMemo as m,useRef as h,useState as g}from"react";import{Fragment as _,jsx as v,jsxs as y}from"react/jsx-runtime";import{useTranslations as ee}from"next-intl";const b=`funhub:detail-series-popup-query`,x=`funhub:detail-series-popup-close`;function S(e){return e.type===b&&e instanceof CustomEvent}function C({active:e}){return e?y(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,className:`shrink-0`,"aria-hidden":!0,children:[v(`circle`,{cx:`16`,cy:`12`,r:`3`,fill:`white`}),v(`path`,{d:`M8 5H16C19.866 5 23 8.13401 23 12C23 15.866 19.866 19 16 19H8C4.13401 19 1 15.866 1 12C1 8.13401 4.13401 5 8 5ZM16 15C17.6569 15 19 13.6569 19 12C19 10.3431 17.6569 9 16 9C14.3431 9 13 10.3431 13 12C13 13.6569 14.3431 15 16 15Z`,fill:`#9054E5`})]}):y(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,className:`shrink-0`,"aria-hidden":!0,children:[v(`path`,{d:`M1.5 12C1.5 8.68629 4.18629 6 7.5 6H16.5C19.8137 6 22.5 8.68629 22.5 12C22.5 15.3137 19.8137 18 16.5 18H7.5C4.18629 18 1.5 15.3137 1.5 12Z`,stroke:`currentColor`,strokeWidth:`1.5`,strokeOpacity:`0.6`}),v(`circle`,{cx:`9`,cy:`12`,r:`3`,fill:`rgba(255,255,255,0.6)`})]})}function te(){return v(`svg`,{width:`20`,height:`20`,viewBox:`0 0 20 20`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,className:`block h-[20px] w-[20px]`,"aria-hidden":!0,children:v(`path`,{d:`M10 8.61116L14.8611 3.75L16.25 5.13889L11.3889 10L16.25 14.8611L14.8611 16.25L10 11.3889L5.13889 16.25L3.75 14.8611L8.61111 10L3.75 5.13889L5.13889 3.75L10 8.61116Z`,fill:`currentColor`})})}function w(e,t){let n=String(t||``).trim();if(!n)return e;let r=e.replace(/\s+/g,``);return n.replace(/\s+/g,``)===r?e:`${e} ${n}`}function T(e,t,n){return(e||[]).map((e,r)=>{let i=Number.parseInt(e?.id||``,10),a=Number.isNaN(i)?r+1:i,o=e?.name||``,s=w(n(a),o);return{id:e?.id||`${t}-${a}`,series_num:a,title:s}})}function E(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 D(e,t,n){return e<=0?n(`singleContent`):n(t===`1`?`completedSeriesTotal`:`ongoingSeriesTotal`,{total:e})}function O(){return v(`span`,{"aria-hidden":!0,className:`pointer-events-none absolute inset-0 overflow-hidden rounded-[8px] p-[0.5px]`,style:{backgroundImage:`linear-gradient(90deg, rgba(255,30,172,0.7) 0%, rgba(108,67,238,0) 100%), linear-gradient(180deg, #9756E3 0%, #6C43EE 100%)`},children:v(`span`,{className:`block h-full w-full`,style:{borderRadius:`7.5px`,backgroundColor:`#000000`,backgroundImage:`linear-gradient(90deg, rgba(246,206,255,0.1) 0%, rgba(246,206,255,0.1) 100%), linear-gradient(90deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.1) 100%)`}})})}function k(e){return e.mode===`detail`?v(j,{information:e.information,series_num:e.series_num,onEpisodeChange:e.onEpisodeChange}):v(A,{open:e.open,variant:e.variant,title:e.title,videoTitle:e.videoTitle,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,popupStylePreset:e.popupStylePreset})}function A({open:e,variant:c,title:l,videoTitle:d,updateStatus:_,summaryText:b,seriesList:x,activeEpisodeId:S,showEpisodeTitle:E=!1,onToggleTitle:k,onClose:A,onSelectEpisode:j,popupBodyStyle:M,popupStylePreset:N=`default`}){let P=ee(`components.common.seriesEpisodes`),F=!!k,I=F&&E,L=c===`popup`&&N===`detail-style-one`,R=h(null),z=h(null),B=m(()=>T(x,`episode`,e=>P(`episodeLabel`,{episode:e})),[x,P]),V=m(()=>{if(B.length===0)return[];let e=[];return B.forEach((t,n)=>{let r=Math.floor(n/50);e[r]||(e[r]=[]),e[r].push(t)}),e},[B,50]),H=m(()=>{if(!S)return 0;let e=B.findIndex(e=>e.id===S);return e<0?0:Math.floor(e/50)},[S,B,50]),[U,W]=g(H);p(()=>{W(H)},[H]);let G=m(()=>typeof b==`string`&&b.trim()?b:D(B.length,_,P),[B.length,b,P,_]),K=l||P(`selectorTitle`),q=String(d||``).trim(),J=f(e=>w(P(`episodeLabel`,{episode:e.series_num}),q),[q,P]);function Y(){let e=R.current;if(e){z.current&&=(window.cancelAnimationFrame(z.current),null),e.scrollTop=0;try{e.scrollTo({top:0,left:0,behavior:`auto`})}catch{}z.current=window.requestAnimationFrame(()=>{z.current=null;let e=R.current;e&&(e.scrollTop=0)})}}p(()=>{e&&Y()},[e,E,U]);function X(e){k&&(k(e),Y())}function Z(e){j?.(e.id,e.series_num),A()}let Q=I?2:5,$=V.length>1?v(`div`,{className:`shrink-0 w-full flex gap-[8px] overflow-x-auto`,children:V.map((e,t)=>{if(e.length===0)return null;let n=t===U,r=t*50+1,i=Math.min((t+1)*50,B.length);return y(`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:()=>{W(t),Y()},children:[r,`-`,i,n&&v(`div`,{className:`absolute w-full h-full top-0 left-0 opacity-20 bg-theme5`})]},`series-group-${t}`)})}):null,ne=y(`div`,{className:`pb-[8px] flex justify-between`,children:[v(`span`,{className:`text-[16px] text-text1`,children:G}),F&&y(`div`,{className:`flex items-center gap-[4px]`,children:[v(s,{size:`sm`,className:`data-checked:bg-theme5 h-[20px] w-[33px]`,checked:E,onCheckedChange:e=>{X(!!e)}}),v(`button`,{type:`button`,className:`text-[16px] text-text1`,onClick:()=>{X(!E)},children:P(`episodeTitle`)})]})]}),re=v(`div`,{className:`grid w-full gap-2 ${Q===2?`grid-cols-2`:`grid-cols-5`}`,children:(V[U]||[]).map((e,t)=>{let n=!!(S&&e.id===S);return v(`button`,{type:`button`,"data-episode-id":e.id,onClick:()=>{Z(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`} ${I?`h-[72px] px-[10px] text-[14px]`:``} ${t%Q===0?``:`border-l-0`}`,children:I?v(`span`,{className:`block w-full truncate leading-[22px]`,children:J(e)}):e.series_num},e.id)})}),ie=V.length>1?v(`div`,{className:`flex gap-[8px] overflow-x-auto [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden`,children:V.map((e,t)=>{if(e.length===0)return null;let n=t===U,r=t*50+1,i=Math.min((t+1)*50,B.length);return v(`button`,{type:`button`,className:`flex h-[28px] w-[72px] shrink-0 items-center justify-center rounded-[100px] px-[4px] transition-colors ${n?`bg-[linear-gradient(90deg,#9756E3_0%,#6C43EE_100%)] text-white`:`bg-white/20 text-white`}`,onClick:()=>{W(t),Y()},children:y(`span`,{className:`font-['PingFang_SC'] text-[14px] font-normal not-italic leading-[20px]`,children:[r,`-`,i]})},`series-popup-group-${t}`)})}):null,ae=y(`div`,{className:`flex items-center justify-between`,children:[v(`span`,{className:`font-['PingFang_SC'] text-[14px] font-normal not-italic leading-[24px] text-white/60`,children:G}),F&&y(`button`,{type:`button`,className:`flex items-center gap-[3px] text-white/60`,onClick:()=>{X(!E)},children:[v(C,{active:E}),v(`span`,{className:`font-['PingFang_SC'] text-[14px] font-normal not-italic leading-[24px] text-white/60`,children:P(`episodeTitle`)})]})]}),oe=I?v(`div`,{className:`flex w-full flex-col gap-[12px]`,children:(V[U]||[]).map(e=>{let t=!!(S&&e.id===S);return y(`button`,{type:`button`,"data-episode-id":e.id,onClick:()=>{Z(e)},className:`relative flex w-full items-start overflow-hidden rounded-[8px] px-[16px] py-[18px] text-left transition-colors ${t?L?``:`border border-[#FF1EFF] bg-[linear-gradient(90deg,rgba(246,206,255,0.1)_0%,rgba(246,206,255,0.1)_100%),linear-gradient(90deg,rgba(255,255,255,0.1)_0%,rgba(255,255,255,0.1)_100%)]`:`bg-white/10`}`,children:[t&&L&&v(O,{}),v(`span`,{className:`relative z-[1] block w-full truncate font-['PingFang_SC'] text-[14px] ${t?`font-medium leading-[16px] text-[#CA3FE9]`:`font-normal leading-[16px] text-white/80`}`,children:J(e)})]},`popup-${e.id}`)})}):v(`div`,{className:`grid w-full grid-cols-[repeat(6,52px)] justify-between gap-y-[8px]`,children:(V[U]||[]).map(e=>{let t=!!(S&&e.id===S);return y(`button`,{type:`button`,"data-episode-id":e.id,onClick:()=>{Z(e)},className:`relative flex h-[52px] w-[52px] items-center justify-center overflow-hidden rounded-[8px] transition-colors ${t?L?`text-[#9756E3]`:`border border-[#E62AFF]/90 bg-[linear-gradient(90deg,rgba(246,206,255,0.1)_0%,rgba(246,206,255,0.1)_100%),linear-gradient(90deg,rgba(255,255,255,0.1)_0%,rgba(255,255,255,0.1)_100%)] text-[#9756E3]`:`bg-white/10 text-white/80`}`,children:[t&&L&&v(O,{}),v(`span`,{className:`relative z-[1] font-['PingFang_SC'] text-[16px] font-medium not-italic leading-[16px]`,children:e.series_num})]},`popup-${e.id}`)})});return c===`sheet`?v(r,{open:e,onOpenChange:e=>!e&&A(),children:y(i,{side:`bottom`,showCloseButton:!0,className:`min-h-[50vh] bg-bg1 text-text1 rounded-t-2xl border-t border-white/10`,children:[v(a,{className:`pt-3 pb-0`,children:v(o,{className:`flex items-center justify-between text-lg text-text1`,children:K})}),y(`div`,{className:`px-4 pb-2 flex flex-col gap-3`,children:[$,ne]}),v(`div`,{ref:R,className:`flex-1 h-0 pt-[4px] pb-[12px] overflow-y-auto px-4`,children:re})]})}):v(u,{open:e,onOpenChange:e=>{e||A()},showCloseButton:!1,className:`!gap-0 !border-0 !bg-transparent !p-0 !shadow-none`,overlayClassName:`bg-black/50 backdrop-blur-0`,children:y(t,{className:`flex h-full w-full flex-col overflow-hidden rounded-t-[16px] bg-black text-text1`,style:{height:`70vh`,...M},children:[y(t,{className:`shrink-0 flex items-center justify-between px-[16px] pt-[32px]`,children:[v(n,{className:`font-['PingFang_SC'] text-[18px] font-medium not-italic leading-[24px] text-white`,children:K}),v(`button`,{type:`button`,"aria-label":`关闭`,className:`flex h-[24px] w-[24px] items-center justify-center text-white opacity-60`,onClick:A,children:v(`span`,{className:`flex h-[24px] w-[24px] items-center overflow-hidden p-[2px]`,children:v(te,{})})})]}),v(t,{className:`flex-1 h-0 w-full px-[16px] pb-[24px]`,children:y(t,{className:`flex h-full flex-col`,children:[ie&&v(t,{className:`mt-[16px] shrink-0`,children:ie}),v(t,{className:`mt-[16px] shrink-0`,children:ae}),v(t,{ref:R,className:`flex-1 overflow-y-auto pb-[17px] [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden ${I?`mt-[12px]`:`mt-[8px]`}`,children:oe})]})})]})})}function j({information:r,series_num:i,onEpisodeChange:a}){let o=ee(`components.common`),[s,u]=c(`detail-series-popup-${r.id}`,!1),[C,te]=c(`detail-series-title-toggle-${r.id}`,!1),[w,T]=c(`detail-series-scroll-left-${r.id}`,null),[D,k]=g(i);p(()=>{k(i)},[r.id,i]),p(()=>{if(typeof window>`u`)return;let e=()=>{u(!1)};return window.addEventListener(x,e),()=>{window.removeEventListener(x,e)}},[u]),p(()=>{if(typeof window>`u`)return;let e=e=>{if(!S(e))return;let t=e.detail||{};t.open=!!t.open||!!s};return window.addEventListener(b,e),()=>{window.removeEventListener(b,e)}},[s]),p(()=>{s&&e(`page_video_detail`,`详情页`,null,`detail_select_episode_popup`)},[s]);let j=m(()=>E((r.links||[]).map(e=>({id:e.id,name:e.name})),r.id||`episode`,e=>o(`seriesEpisodes.episodeLabel`,{episode:e})),[r.id,r.links,o]),M=r.update_status===`1`?o(`seriesEpisodes.completedSeriesTotal`,{total:r.links.length}):o(`seriesEpisodes.ongoingSeriesUpdatedTo`,{total:r.links.length}),N=m(()=>r.links[D-1]?.id||r.links[0]?.id||``,[r.links,D]),P=h(null),F=h(null),I=h(null),L=h(!1),R=h(null),z=h(null),B=h(null),[V,H]=g(!1),U=f((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=f(()=>{z.current!==null&&(window.clearTimeout(z.current),z.current=null)},[]),G=f(()=>{B.current!==null&&(window.clearTimeout(B.current),B.current=null)},[]),K=f(()=>{R.current!==null&&(d.dismiss(R.current),R.current=null),W(),G()},[G,W]),q=f(()=>{F.current=null,I.current=null,K(),H(!1)},[K]),J=f((e,t)=>{G(),B.current=window.setTimeout(()=>{B.current=null,F.current===e&&q()},Math.max(0,t))},[G,q]);p(()=>{L.current=!1},[r.id]),p(()=>{if(L.current||!N)return;let e=window.requestAnimationFrame(()=>{let e=P.current;e&&(typeof w==`number`?e.scrollTo({left:Math.max(0,w),behavior:`auto`}):(U(N,`auto`),T(Math.max(0,Math.round(e.scrollLeft)))),L.current=!0)});return()=>{window.cancelAnimationFrame(e)}},[N,w,U,T]),p(()=>{let e=F.current;!e||e!==i||J(e,1e3)},[J,i]),p(()=>()=>{q()},[q]);let Y=f((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=f((e,t=`inline`,n,s)=>{if(e!==D){if(!r.links[e-1]){d.error(o(`seriesEpisodes.episodeNotFound`));return}if(typeof window<`u`&&window.isWebView===!0){try{k(e);let c=n||r.links[e-1]?.id||``,l=Math.max(0,Math.round(P.current?.scrollLeft||0));t===`popup`?(c&&U(c,`auto`),T(Math.max(0,Math.round(P.current?.scrollLeft||0)))):T(Y(c,l,s)),H(!0),K(),R.current=d.loading(o(`seriesEpisodes.episodeSwitching`)),F.current=e,I.current=t,z.current=window.setTimeout(()=>{F.current===e&&(k(i),q(),d.error(o(`seriesEpisodes.episodeSwitchFailed`)))},3e3),a(e)}catch(e){k(i),q(),console.error(`切换剧集失败`,e),d.error(o(`seriesEpisodes.episodeSwitchFailed`))}return}try{k(e);let c=n||r.links[e-1]?.id||``,l=Math.max(0,Math.round(P.current?.scrollLeft||0));t===`popup`?(c&&U(c,`auto`),T(Math.max(0,Math.round(P.current?.scrollLeft||0)))):T(Y(c,l,s)),H(!0),K(),R.current=d.loading(o(`seriesEpisodes.episodeSwitching`)),F.current=e,I.current=t,z.current=window.setTimeout(()=>{F.current===e&&(k(i),q(),d.error(o(`seriesEpisodes.episodeSwitchFailed`)))},8e3),a(e)}catch(e){k(i),q(),console.error(`切换剧集失败`,e),d.error(o(`seriesEpisodes.episodeSwitchFailed`))}}},[q,K,r.links,a,D,i,Y,U,T,o]),[Z,Q]=g(`70vh`),$=f(()=>{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 p(()=>{if(!s)return;$();let e=()=>{$()};return window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[$,s]),j.length<=1?null:y(_,{children:[y(t,{className:`w-full mt-[16px] flex flex-col items-end mb-[4px]`,children:[y(t,{className:`w-fit flex items-center px-[12px] h-[28px]`,onClick:()=>{e(`page_video_detail`,`详情页`,null,`detail_select_episode_btn`),u(!0)},children:[v(n,{className:`text-[14px] text-text2 leading-[20px]`,children:M}),v(l,{className:`w-[11px] h-[18px] ml-[4px] text-text2`})]}),v(`div`,{ref:P,className:`w-full mt-[12px] overflow-x-auto px-[12px] flex gap-x-[8px] ${C?`h-[76px]`:`h-[60px]`} ${V?`touch-none`:``}`,children:j.map((t,r)=>y(`div`,{"data-content-id":t.id,className:`relative shrink-0 h-[full] overflow-hidden px-[18px] rounded-[8px] border border-line1 flex items-center ${C?`w-[162px]`:`w-[60px] !px-[0] justify-center`} ${t.id===N?`border-transparent bg-transparent`:``}`,onClick:n=>{e(`page_video_detail`,`详情页`,n,`detail_episode_click`,{episode_num:r+1,episode_id:t.id}),X(r+1,`inline`,t.id,n.clientX)},children:[t.id===N&&v(O,{}),v(n,{className:`relative z-[1] text-[16px] text-text1 leading-[22px] line-clamp-2 ${t.id===N?`font-bold !text-[#CA3FE9]`:``}`,children:C?t.title:t.series_num})]},t.id))})]}),v(A,{title:o(`seriesEpisodes.selectorTitle`),videoTitle:r.name,variant:`popup`,open:s,updateStatus:r.update_status,summaryText:M,seriesList:(r.links||[]).map(e=>({id:e.id,name:e.name})),activeEpisodeId:N,showEpisodeTitle:C,onToggleTitle:e=>{te(e)},onClose:()=>u(!1),onSelectEpisode:(e,t)=>{u(!1),X(t,`popup`,e)},popupBodyStyle:{height:Z},popupStylePreset:`default`})]})}export{O as DetailStyleOneActiveBorderLayer,k as SeriesEpisodes};
|
|
2
|
+
"use client";import{trackPageClick as e}from"../../../utils/tracking.mjs";import{Box as t}from"../../ui/box.mjs";import{Text as n}from"../../ui/text.mjs";import{Sheet as r,SheetContent as i,SheetHeader as a,SheetTitle as o}from"../../ui/sheet.mjs";import{Switch as s}from"../../ui/switch.mjs";import{useKeepAliveState as c}from"../keep-scroll-position/index.mjs";import l from"../../../assets/icons/common/right_arrow.mjs";import u from"../../ui/popup.mjs";import{toast as d}from"sonner";import{useCallback as f,useEffect as p,useMemo as m,useRef as h,useState as g}from"react";import{Fragment as _,jsx as v,jsxs as y}from"react/jsx-runtime";import{useTranslations as ee}from"next-intl";const b=`funhub:detail-series-popup-query`,x=`funhub:detail-series-popup-close`;function S(e){return e.type===b&&e instanceof CustomEvent}function C({active:e}){return e?y(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,className:`shrink-0`,"aria-hidden":!0,children:[v(`circle`,{cx:`16`,cy:`12`,r:`3`,fill:`white`}),v(`path`,{d:`M8 5H16C19.866 5 23 8.13401 23 12C23 15.866 19.866 19 16 19H8C4.13401 19 1 15.866 1 12C1 8.13401 4.13401 5 8 5ZM16 15C17.6569 15 19 13.6569 19 12C19 10.3431 17.6569 9 16 9C14.3431 9 13 10.3431 13 12C13 13.6569 14.3431 15 16 15Z`,fill:`#9054E5`})]}):y(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,className:`shrink-0`,"aria-hidden":!0,children:[v(`path`,{d:`M1.5 12C1.5 8.68629 4.18629 6 7.5 6H16.5C19.8137 6 22.5 8.68629 22.5 12C22.5 15.3137 19.8137 18 16.5 18H7.5C4.18629 18 1.5 15.3137 1.5 12Z`,stroke:`currentColor`,strokeWidth:`1.5`,strokeOpacity:`0.6`}),v(`circle`,{cx:`9`,cy:`12`,r:`3`,fill:`rgba(255,255,255,0.6)`})]})}function te(){return v(`svg`,{width:`20`,height:`20`,viewBox:`0 0 20 20`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,className:`block h-[20px] w-[20px]`,"aria-hidden":!0,children:v(`path`,{d:`M10 8.61116L14.8611 3.75L16.25 5.13889L11.3889 10L16.25 14.8611L14.8611 16.25L10 11.3889L5.13889 16.25L3.75 14.8611L8.61111 10L3.75 5.13889L5.13889 3.75L10 8.61116Z`,fill:`currentColor`})})}function w(e,t){let n=String(t||``).trim();if(!n)return e;let r=e.replace(/\s+/g,``);return n.replace(/\s+/g,``)===r?e:`${e} ${n}`}function T(e,t,n){return(e||[]).map((e,r)=>{let i=Number.parseInt(e?.id||``,10),a=Number.isNaN(i)?r+1:i,o=e?.name||``,s=w(n(a),o);return{id:e?.id||`${t}-${a}`,series_num:a,title:s}})}function E(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 D(e,t,n){return e<=0?n(`singleContent`):n(t===`1`?`completedSeriesTotal`:`ongoingSeriesTotal`,{total:e})}function O(){return v(`span`,{"aria-hidden":!0,className:`pointer-events-none absolute inset-0 overflow-hidden rounded-[8px] p-[0.5px]`,style:{backgroundImage:`linear-gradient(90deg, rgba(255,30,172,0.7) 0%, rgba(108,67,238,0) 100%), linear-gradient(180deg, #9756E3 0%, #6C43EE 100%)`},children:v(`span`,{className:`block h-full w-full`,style:{borderRadius:`7.5px`,backgroundColor:`#000000`,backgroundImage:`linear-gradient(90deg, rgba(246,206,255,0.1) 0%, rgba(246,206,255,0.1) 100%), linear-gradient(90deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.1) 100%)`}})})}function k(e){return e.mode===`detail`?v(j,{information:e.information,series_num:e.series_num,onEpisodeChange:e.onEpisodeChange}):v(A,{open:e.open,variant:e.variant,title:e.title,videoTitle:e.videoTitle,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,popupStylePreset:e.popupStylePreset})}function A({open:e,variant:c,title:l,videoTitle:d,updateStatus:_,summaryText:b,seriesList:x,activeEpisodeId:S,showEpisodeTitle:E=!1,onToggleTitle:k,onClose:A,onSelectEpisode:j,popupBodyStyle:M,popupStylePreset:N=`default`}){let P=ee(`components.common.seriesEpisodes`),F=!!k,I=F&&E,L=c===`popup`&&N===`detail-style-one`,R=h(null),z=h(null),B=m(()=>T(x,`episode`,e=>P(`episodeLabel`,{episode:e})),[x,P]),V=m(()=>{if(B.length===0)return[];let e=[];return B.forEach((t,n)=>{let r=Math.floor(n/50);e[r]||(e[r]=[]),e[r].push(t)}),e},[B,50]),H=m(()=>{if(!S)return 0;let e=B.findIndex(e=>e.id===S);return e<0?0:Math.floor(e/50)},[S,B,50]),[U,W]=g(H);p(()=>{W(H)},[H]);let G=m(()=>typeof b==`string`&&b.trim()?b:D(B.length,_,P),[B.length,b,P,_]),K=l||P(`selectorTitle`),q=String(d||``).trim(),J=f(e=>w(P(`episodeLabel`,{episode:e.series_num}),q),[q,P]);function Y(){let e=R.current;if(e){z.current&&=(window.cancelAnimationFrame(z.current),null),e.scrollTop=0;try{e.scrollTo({top:0,left:0,behavior:`auto`})}catch{}z.current=window.requestAnimationFrame(()=>{z.current=null;let e=R.current;e&&(e.scrollTop=0)})}}p(()=>{e&&Y()},[e,E,U]);function X(e){k&&(k(e),Y())}function Z(e){j?.(e.id,e.series_num),A()}let Q=I?2:5,$=V.length>1?v(`div`,{className:`shrink-0 w-full flex gap-[8px] overflow-x-auto`,children:V.map((e,t)=>{if(e.length===0)return null;let n=t===U,r=t*50+1,i=Math.min((t+1)*50,B.length);return y(`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:()=>{W(t),Y()},children:[r,`-`,i,n&&v(`div`,{className:`absolute w-full h-full top-0 left-0 opacity-20 bg-theme5`})]},`series-group-${t}`)})}):null,ne=y(`div`,{className:`pb-[8px] flex justify-between`,children:[v(`span`,{className:`text-[16px] text-text1`,children:G}),F&&y(`div`,{className:`flex items-center gap-[4px]`,children:[v(s,{size:`sm`,className:`data-checked:bg-theme5 h-[20px] w-[33px]`,checked:E,onCheckedChange:e=>{X(!!e)}}),v(`button`,{type:`button`,className:`text-[16px] text-text1`,onClick:()=>{X(!E)},children:P(`episodeTitle`)})]})]}),re=v(`div`,{className:`grid w-full gap-2 ${Q===2?`grid-cols-2`:`grid-cols-5`}`,children:(V[U]||[]).map((e,t)=>{let n=!!(S&&e.id===S);return v(`button`,{type:`button`,"data-episode-id":e.id,onClick:()=>{Z(e)},className:`flex items-center justify-center w-full h-[56px] rounded-[8px] transition-colors ${n?``:`bg-white/10`} cursor-pointer select-none transition-colors relative overflow-hidden ${I?`h-[72px] px-[10px] text-[14px]`:``} ${t%Q===0?``:`border-l-0`}`,children:I?v(`span`,{className:`block w-full truncate leading-[22px]`,children:J(e)}):e.series_num},e.id)})}),ie=V.length>1?v(`div`,{className:`flex gap-[8px] overflow-x-auto [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden`,children:V.map((e,t)=>{if(e.length===0)return null;let n=t===U,r=t*50+1,i=Math.min((t+1)*50,B.length);return v(`button`,{type:`button`,className:`flex h-[28px] w-[72px] shrink-0 items-center justify-center rounded-[100px] px-[4px] transition-colors ${n?`bg-[linear-gradient(90deg,#9756E3_0%,#6C43EE_100%)] text-white`:`bg-white/20 text-white`}`,onClick:()=>{W(t),Y()},children:y(`span`,{className:`font-['PingFang_SC'] text-[14px] font-normal not-italic leading-[20px]`,children:[r,`-`,i]})},`series-popup-group-${t}`)})}):null,ae=y(`div`,{className:`flex items-center justify-between`,children:[v(`span`,{className:`font-['PingFang_SC'] text-[14px] font-normal not-italic leading-[24px] text-white/60`,children:G}),F&&y(`button`,{type:`button`,className:`flex items-center gap-[3px] text-white/60`,onClick:()=>{X(!E)},children:[v(C,{active:E}),v(`span`,{className:`font-['PingFang_SC'] text-[14px] font-normal not-italic leading-[24px] text-white/60`,children:P(`episodeTitle`)})]})]}),oe=I?v(`div`,{className:`flex w-full flex-col gap-[12px]`,children:(V[U]||[]).map(e=>{let t=!!(S&&e.id===S);return y(`button`,{type:`button`,"data-episode-id":e.id,onClick:()=>{Z(e)},className:`relative flex w-full items-start overflow-hidden rounded-[8px] px-[16px] py-[18px] text-left transition-colors ${t?L?``:`border border-[#FF1EFF] bg-[linear-gradient(90deg,rgba(246,206,255,0.1)_0%,rgba(246,206,255,0.1)_100%),linear-gradient(90deg,rgba(255,255,255,0.1)_0%,rgba(255,255,255,0.1)_100%)]`:`bg-white/10`}`,children:[t&&L&&v(O,{}),v(`span`,{className:`relative z-[1] block w-full truncate font-['PingFang_SC'] text-[14px] ${t?`font-medium leading-[16px] text-[#CA3FE9]`:`font-normal leading-[16px] text-white/80`}`,children:J(e)})]},`popup-${e.id}`)})}):v(`div`,{className:`grid w-full grid-cols-[repeat(6,52px)] justify-between gap-y-[8px]`,children:(V[U]||[]).map(e=>{let t=!!(S&&e.id===S);return y(`button`,{type:`button`,"data-episode-id":e.id,onClick:()=>{Z(e)},className:`relative flex h-[52px] w-[52px] items-center justify-center overflow-hidden rounded-[8px] transition-colors ${t?L?`text-[#9756E3]`:`border border-[#E62AFF]/90 bg-[linear-gradient(90deg,rgba(246,206,255,0.1)_0%,rgba(246,206,255,0.1)_100%),linear-gradient(90deg,rgba(255,255,255,0.1)_0%,rgba(255,255,255,0.1)_100%)] text-[#9756E3]`:`bg-white/10 text-white/80`}`,children:[t&&L&&v(O,{}),v(`span`,{className:`relative z-[1] font-['PingFang_SC'] text-[16px] font-medium not-italic leading-[16px]`,children:e.series_num})]},`popup-${e.id}`)})});return c===`sheet`?v(r,{open:e,onOpenChange:e=>!e&&A(),children:y(i,{side:`bottom`,showCloseButton:!0,className:`min-h-[50vh] bg-bg1 text-text1 rounded-t-2xl border-t border-white/10`,children:[v(a,{className:`pt-3 pb-0`,children:v(o,{className:`flex items-center justify-between text-lg text-text1`,children:K})}),y(`div`,{className:`px-4 pb-2 flex flex-col gap-3`,children:[$,ne]}),v(`div`,{ref:R,className:`flex-1 h-0 pt-[4px] pb-[12px] overflow-y-auto px-4`,children:re})]})}):v(u,{open:e,onOpenChange:e=>{e||A()},showCloseButton:!1,className:`!gap-0 !border-0 !bg-transparent !p-0 !shadow-none`,overlayClassName:`bg-black/50 backdrop-blur-0`,children:y(t,{className:`flex h-full w-full flex-col overflow-hidden rounded-t-[16px] bg-black text-text1`,style:{height:`70vh`,...M},children:[y(t,{className:`shrink-0 flex items-center justify-between px-[16px] pt-[32px]`,children:[v(n,{className:`font-['PingFang_SC'] text-[18px] font-medium not-italic leading-[24px] text-white`,children:K}),v(`button`,{type:`button`,"aria-label":`关闭`,className:`flex h-[24px] w-[24px] items-center justify-center text-white opacity-60`,onClick:A,children:v(`span`,{className:`flex h-[24px] w-[24px] items-center overflow-hidden p-[2px]`,children:v(te,{})})})]}),v(t,{className:`flex-1 h-0 w-full px-[16px] pb-[24px]`,children:y(t,{className:`flex h-full flex-col`,children:[ie&&v(t,{className:`mt-[16px] shrink-0`,children:ie}),v(t,{className:`mt-[16px] shrink-0`,children:ae}),v(t,{ref:R,className:`flex-1 overflow-y-auto pb-[17px] [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden ${I?`mt-[12px]`:`mt-[8px]`}`,children:oe})]})})]})})}function j({information:r,series_num:i,onEpisodeChange:a}){let o=ee(`components.common`),[s,u]=c(`detail-series-popup-${r.id}`,!1),[C,te]=c(`detail-series-title-toggle-${r.id}`,!1),[w,T]=c(`detail-series-scroll-left-${r.id}`,null),[D,k]=g(i);p(()=>{k(i)},[r.id,i]),p(()=>{if(typeof window>`u`)return;let e=()=>{u(!1)};return window.addEventListener(x,e),()=>{window.removeEventListener(x,e)}},[u]),p(()=>{if(typeof window>`u`)return;let e=e=>{if(!S(e))return;let t=e.detail||{};t.open=!!t.open||!!s};return window.addEventListener(b,e),()=>{window.removeEventListener(b,e)}},[s]),p(()=>{s&&e(`page_video_detail`,`详情页`,null,`detail_select_episode_popup`)},[s]);let j=m(()=>E((r.links||[]).map(e=>({id:e.id,name:e.name})),r.id||`episode`,e=>o(`seriesEpisodes.episodeLabel`,{episode:e})),[r.id,r.links,o]),M=r.update_status===`1`?o(`seriesEpisodes.completedSeriesTotal`,{total:r.links.length}):o(`seriesEpisodes.ongoingSeriesUpdatedTo`,{total:r.links.length}),N=m(()=>r.links[D-1]?.id||r.links[0]?.id||``,[r.links,D]),P=h(null),F=h(null),I=h(null),L=h(!1),R=h(null),z=h(null),B=h(null),[V,H]=g(!1),U=f((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=f(()=>{z.current!==null&&(window.clearTimeout(z.current),z.current=null)},[]),G=f(()=>{B.current!==null&&(window.clearTimeout(B.current),B.current=null)},[]),K=f(()=>{R.current!==null&&(d.dismiss(R.current),R.current=null),W(),G()},[G,W]),q=f(()=>{F.current=null,I.current=null,K(),H(!1)},[K]),J=f((e,t)=>{G(),B.current=window.setTimeout(()=>{B.current=null,F.current===e&&q()},Math.max(0,t))},[G,q]);p(()=>{L.current=!1},[r.id]),p(()=>{if(L.current||!N)return;let e=window.requestAnimationFrame(()=>{let e=P.current;e&&(typeof w==`number`?e.scrollTo({left:Math.max(0,w),behavior:`auto`}):(U(N,`auto`),T(Math.max(0,Math.round(e.scrollLeft)))),L.current=!0)});return()=>{window.cancelAnimationFrame(e)}},[N,w,U,T]),p(()=>{let e=F.current;!e||e!==i||J(e,1e3)},[J,i]),p(()=>()=>{q()},[q]);let Y=f((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=f((e,t=`inline`,n,s)=>{if(e!==D){if(!r.links[e-1]){d.error(o(`seriesEpisodes.episodeNotFound`));return}if(typeof window<`u`&&window.isWebView===!0){try{k(e);let c=n||r.links[e-1]?.id||``,l=Math.max(0,Math.round(P.current?.scrollLeft||0));t===`popup`?(c&&U(c,`auto`),T(Math.max(0,Math.round(P.current?.scrollLeft||0)))):T(Y(c,l,s)),H(!0),K(),R.current=d.loading(o(`seriesEpisodes.episodeSwitching`)),F.current=e,I.current=t,z.current=window.setTimeout(()=>{F.current===e&&(k(i),q(),d.error(o(`seriesEpisodes.episodeSwitchFailed`)))},3e3),a(e)}catch(e){k(i),q(),console.error(`切换剧集失败`,e),d.error(o(`seriesEpisodes.episodeSwitchFailed`))}return}try{k(e);let c=n||r.links[e-1]?.id||``,l=Math.max(0,Math.round(P.current?.scrollLeft||0));t===`popup`?(c&&U(c,`auto`),T(Math.max(0,Math.round(P.current?.scrollLeft||0)))):T(Y(c,l,s)),H(!0),K(),R.current=d.loading(o(`seriesEpisodes.episodeSwitching`)),F.current=e,I.current=t,z.current=window.setTimeout(()=>{F.current===e&&(k(i),q(),d.error(o(`seriesEpisodes.episodeSwitchFailed`)))},8e3),a(e)}catch(e){k(i),q(),console.error(`切换剧集失败`,e),d.error(o(`seriesEpisodes.episodeSwitchFailed`))}}},[q,K,r.links,a,D,i,Y,U,T,o]),[Z,Q]=g(`70vh`),$=f(()=>{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 p(()=>{if(!s)return;$();let e=()=>{$()};return window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[$,s]),j.length<=1?null:y(_,{children:[y(t,{className:`w-full mt-[16px] flex flex-col items-end mb-[4px]`,children:[y(t,{className:`w-fit flex items-center px-[12px] h-[28px]`,onClick:()=>{e(`page_video_detail`,`详情页`,null,`detail_select_episode_btn`),u(!0)},children:[v(n,{className:`text-[14px] text-text2 leading-[20px]`,children:M}),v(l,{className:`w-[11px] h-[18px] ml-[4px] text-text2`})]}),v(`div`,{ref:P,className:`w-full mt-[12px] overflow-x-auto px-[12px] flex gap-x-[8px] h-[56px] ${V?`touch-none`:``}`,children:j.map((t,r)=>y(`div`,{"data-content-id":t.id,className:`relative shrink-0 h-[full] overflow-hidden px-[18px] rounded-[8px] flex items-center justify-center ${C?`min-w-[88px] h-[40px]`:`w-[56px] !px-[0] justify-center`} ${t.id===N?`bg-transparent`:`bg-white/10`}`,onClick:n=>{e(`page_video_detail`,`详情页`,n,`detail_episode_click`,{episode_num:r+1,episode_id:t.id}),X(r+1,`inline`,t.id,n.clientX)},children:[t.id===N&&v(O,{}),v(n,{className:`relative z-[1] text-[14px] text-text1 leading-[22px] line-clamp-2 ${t.id===N?`!text-[#CA3FE9]`:``}`,children:C?t.title:t.series_num})]},t.id))})]}),v(A,{title:o(`seriesEpisodes.selectorTitle`),videoTitle:r.name,variant:`popup`,open:s,updateStatus:r.update_status,summaryText:M,seriesList:(r.links||[]).map(e=>({id:e.id,name:e.name})),activeEpisodeId:N,showEpisodeTitle:C,onToggleTitle:e=>{te(e)},onClose:()=>u(!1),onSelectEpisode:(e,t)=>{u(!1),X(t,`popup`,e)},popupBodyStyle:{height:Z},popupStylePreset:`default`})]})}export{O as DetailStyleOneActiveBorderLayer,k as SeriesEpisodes};
|
|
@@ -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/tabs/follow.mjs";import i from"../../../assets/icons/tabs/follow_active.mjs";import a from"../../../assets/icons/tabs/home.mjs";import o from"../../../assets/icons/tabs/home_active.mjs";import s from"../../../assets/icons/tabs/mine.mjs";import c from"../../../assets/icons/tabs/mine_active.mjs";import l from"../../ui/legacy/badge.mjs";import{
|
|
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/tabs/follow.mjs";import i from"../../../assets/icons/tabs/follow_active.mjs";import a from"../../../assets/icons/tabs/home.mjs";import o from"../../../assets/icons/tabs/home_active.mjs";import s from"../../../assets/icons/tabs/mine.mjs";import c from"../../../assets/icons/tabs/mine_active.mjs";import l from"../../ui/legacy/badge.mjs";import{usePathname as u}from"next/navigation";import{useEffect as d,useState as f,useTransition as p}from"react";import{jsx as m,jsxs as h}from"react/jsx-runtime";import{useTranslations as g}from"next-intl";function _(e,t){if(t!==`/`)return e.startsWith(t);let n=[`/user`].some(t=>e.startsWith(t)),r=e.startsWith(`/category/`);return!n&&(e===`/`||r)}const v=[`/nav-page`];function y(y){let{className:b}=y,x=u(),S=g(`tabBar`),[C,w]=f(null),[,T]=p(),[E]=f(0),[D,O]=f(!1),k=[{badge:!1,id:1,labelKey:`home`,path:`/`,icon:a,activeIcon:o,width:20,height:20},{badge:!1,id:2,labelKey:`follow`,path:`/user/follow`,icon:r,activeIcon:i,width:20,height:20},{badge:!1,id:5,labelKey:`mine`,path:`/user/mine`,icon:s,activeIcon:c,width:20,height:20}],A=(e,t,n)=>{t!==x&&w(t)};return d(()=>{C&&_(x,C)&&T(()=>{w(null)})},[x,C]),d(()=>{let e=setTimeout(()=>{O(!0)},0);return()=>clearTimeout(e)},[]),x&&v.some(e=>x.includes(e))?null:m(e,{className:`fixed bottom-0 left-0 right-0 z-50 flex flex-col items-center ${b||``}`,style:{background:`rgba(5, 1, 15, 0.1)`,backdropFilter:`blur(8px)`,WebkitBackdropFilter:`blur(8px)`},children:h(e,{className:`relative my-[4px] flex h-[56px] w-[358px] items-center justify-between rounded-[100px] px-[40px]`,children:[m(e,{className:`pointer-events-none absolute inset-0 rounded-[100px]`,style:{background:`linear-gradient(0deg, rgba(6, 3, 21, 0.03) 0%, rgba(6, 3, 21, 0.03) 100%), rgba(255, 255, 255, 0.10)`},"aria-hidden":`true`}),m(e,{className:`pointer-events-none absolute inset-0 rounded-[100px]`,style:{background:`linear-gradient(180deg, rgba(255, 255, 255, 0.3) 0%, transparent 100%)`,padding:`1px`,WebkitMask:`linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)`,WebkitMaskComposite:`xor`,mask:`linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)`,maskComposite:`exclude`},"aria-hidden":`true`}),k.map(r=>{let i=D&&x?_(C||x||``,r.path):!1,a=i?r.activeIcon:r.icon,o=h(e,{className:`flex flex-col items-center ${i?`gap-[5px]`:`gap-[4px]`}`,children:[r.badge&&E>0?m(l,{dot:!0,children:m(a,{width:20,height:20})}):m(a,{width:20,height:20}),m(t,{className:`whitespace-nowrap text-center text-[12px] leading-[16px] ${i?`text-[#C043E8]`:`text-white/50`}`,children:S(r.labelKey)})]});return i?m(e,{className:`flex items-center justify-center`,children:o},r.id):m(n,{href:r.path,prefetch:!0,className:`flex items-center justify-center`,onClick:e=>{A(e,r.path,r.labelKey)},children:o},r.id)})]})})}export{y as TabBar};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{getChannelList as e}from"../../biz/utils/helpers/get-channel-list.mjs";import{gContentGetAppChannelBlock as t,gContentGetAppChannels as n}from"../../../service/generated/client.mjs";import{trackAppPageView as r}from"../../../utils/tracking.mjs";import{Box as i}from"../../ui/box.mjs";import{useRequest as a}from"../../../hooks/query/use-query.mjs";import{queryKey as o}from"../../../constants/query-key.mjs";import{matchChannelByPath as s}from"../../pages/home/channel-matcher.mjs";import{TopNavBarFullscreen as c}from"./fullscreen.mjs";import{TopNavBarNormal as l}from"./normal.mjs";import{
|
|
2
|
+
"use client";import{getChannelList as e}from"../../biz/utils/helpers/get-channel-list.mjs";import{gContentGetAppChannelBlock as t,gContentGetAppChannels as n}from"../../../service/generated/client.mjs";import{trackAppPageView as r}from"../../../utils/tracking.mjs";import{Box as i}from"../../ui/box.mjs";import{useRequest as a}from"../../../hooks/query/use-query.mjs";import{queryKey as o}from"../../../constants/query-key.mjs";import{matchChannelByPath as s}from"../../pages/home/channel-matcher.mjs";import{TopNavBarFullscreen as c}from"./fullscreen.mjs";import{TopNavBarNormal as l}from"./normal.mjs";import{usePathname as u}from"next/navigation";import{useEffect as d,useMemo as f}from"react";import{jsx as p}from"react/jsx-runtime";function m(e){return e===`/`?[]:e.startsWith(`/category/`)?e.replace(`/category/`,``).split(`/`).map(e=>decodeURIComponent(e)):[]}function h({categoryPath:h,currentChannelId:g}){let _=u()||`/`,{data:v}=a([o.CHANNEL],()=>n()),y=f(()=>e(v?.data),[v?.data]),b=f(()=>typeof window>`u`?h||[]:m(_),[h,_]),x=f(()=>y.length===0?null:s(b,y),[b,y])?.id??g??``;d(()=>{r({page_key:`page_home_top_nav`,page_name:`首页顶部导航栏`})},[]);let{data:S}=a(o.GET_CONTENT_LIST(x),()=>t({channel_id:x}),{enabled:!!x}),C=f(()=>S?.data?.blocks||[],[S?.data?.blocks]),w=f(()=>C.length>0&&C[0].show_style===6,[C]);return p(i,{className:`w-full`,"data-top-nav-root":`true`,children:p(w?c:l,{channelDataList:y,currentChannelId:x})})}export{h as TopNavBar};
|
|
@@ -136,6 +136,10 @@ import e from"../../../node_modules/.pnpm/style-inject@0.3.0/node_modules/style-
|
|
|
136
136
|
display: none !important;
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
+
.style-module_videoBox__4Gmdw .xgplayer-volume.slide-show .xgplayer-slider {
|
|
140
|
+
display: none !important;
|
|
141
|
+
}
|
|
142
|
+
|
|
139
143
|
.style-module_videoBox__4Gmdw .xgplayer.xgplayer-mobile.xgplayer-is-fullscreen .xg-inner-controls,
|
|
140
144
|
.style-module_videoBox__4Gmdw .xgplayer.xgplayer-mobile.xgplayer-is-fullscreen .xgplayer-replay,
|
|
141
145
|
.style-module_videoBox__4Gmdw .xgplayer.xgplayer-mobile.xgplayer-is-fullscreen .xgplayer-loading,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{useUserStore as e}from"../../../store/modules/user-store.mjs";import{pContentMatchAds as t}from"../../../service/generated/client.mjs";import{pContentMatchAdsKey as n}from"../../../service/generated/tanstack.mjs";import{trackAdClick as r,trackAdImpression as i}from"../../../utils/tracking.mjs";import{useRequest as a}from"../../../hooks/query/use-query.mjs";import{useVideoPlayerRef as o}from"./video-player-ref-context.mjs";import{create as s}from"zustand";import{createJSONStorage as c,persist as l}from"zustand/middleware";import{useEffect as u,useRef as d,useState as f}from"react";import{useIsClient as p}from"foxact/use-is-client";import{jsx as m}from"react/jsx-runtime";import{createPortal as h}from"react-dom";const g=s()(l((e,t)=>({shownVideoIds:new Set,hasShown:e=>t().shownVideoIds.has(e),markAsShown:n=>{let r=t().shownVideoIds;if(!r.has(n)){let t=new Set(r);t.add(n),e({shownVideoIds:t})}}}),{name:`video-blind-ad-storage`,storage:typeof window<`u`?c(()=>sessionStorage):void 0,partialize:e=>({shownVideoIds:Array.from(e.shownVideoIds)}),merge:(e,t)=>({...t,shownVideoIds:new Set(e.shownVideoIds||[])})})),_=`video_blind`;function v({videoId:s}){let
|
|
2
|
+
"use client";import{useUserStore as e}from"../../../store/modules/user-store.mjs";import{pContentMatchAds as t}from"../../../service/generated/client.mjs";import{pContentMatchAdsKey as n}from"../../../service/generated/tanstack.mjs";import{trackAdClick as r,trackAdImpression as i}from"../../../utils/tracking.mjs";import{useRequest as a}from"../../../hooks/query/use-query.mjs";import{useVideoPlayerRef as o}from"./video-player-ref-context.mjs";import{create as s}from"zustand";import{createJSONStorage as c,persist as l}from"zustand/middleware";import{useEffect as u,useRef as d,useState as f}from"react";import{useIsClient as p}from"foxact/use-is-client";import{jsx as m}from"react/jsx-runtime";import{createPortal as h}from"react-dom";const g=s()(l((e,t)=>({shownVideoIds:new Set,hasShown:e=>t().shownVideoIds.has(e),markAsShown:n=>{let r=t().shownVideoIds;if(!r.has(n)){let t=new Set(r);t.add(n),e({shownVideoIds:t})}}}),{name:`video-blind-ad-storage`,storage:typeof window<`u`?c(()=>sessionStorage):void 0,partialize:e=>({shownVideoIds:Array.from(e.shownVideoIds)}),merge:(e,t)=>({...t,shownVideoIds:new Set(e.shownVideoIds||[])})})),_=`video_blind`;function v(e,t){return`${e}:${Math.max(1,Math.floor(Number(t)||1))}`}function y({videoId:s,episode:c}){let l=o(),y=p(),b=e(e=>e.userId),{hasShown:x,markAsShown:S}=g(),[C,w]=f(!1),T=d(!1),E={user_id:b,ad_type:`blind`},{data:D,isLoading:O}=a(n(E),()=>t(E)),k=v(s,c),A=x(k),j=D?.data?.materials?.[0]?.advertise_code||``,M=!A&&C;u(()=>{!M||!j||i({page_key:`detail`,page_name:`详情页`,ad_slot_key:_,ad_slot_name:`盲点广告`,ad_id:j,ad_type:`blind`})},[M,j]),u(()=>{if(!D||A)return;let e=(D.data?.settings?.trigger_video_progress_min??0)*60,t=null,n=null;function r(n){if(T.current){t?.off(`timeupdate`,r);return}Number(n?.currentTime||t?.currentTime||0)>=e&&(T.current=!0,w(!0))}function i(){let n=l?.current?.getPlayer?.();return n?(t=n,Number(n.currentTime||0)>=e?(T.current=!0,w(!0),!0):(n.on(`timeupdate`,r),!0)):!1}return i()||(n=window.setInterval(()=>{i()&&n!==null&&(window.clearInterval(n),n=null)},200)),()=>{n!==null&&window.clearInterval(n),t?.off(`timeupdate`,r)}},[l,D,A]),u(()=>{if(M)return document.body.style.overflow=`hidden`,()=>{document.body.style.overflow=``}},[M]);function N(){A||(j&&r({page_key:`detail`,page_name:`详情页`,ad_slot_key:_,ad_slot_name:`盲点广告`,ad_id:j,ad_type:`blind`}),S(k),window.open(D?.data.materials?.[0].advertise_url))}return!y||typeof document>`u`||O||D?.data?.hit===!1||A||!C?null:h(m(`div`,{className:`blind-ad-overlay fixed inset-0 h-screen w-screen z-[99999]`,onClick:N}),document.body)}export{y as VideoBlindAdOverlay};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{useUserStore as e}from"../../../store/modules/user-store.mjs";import{pContentMatchAds as t}from"../../../service/generated/client.mjs";import{pContentMatchAdsKey as n}from"../../../service/generated/tanstack.mjs";import{trackAdClick as r,trackAdImpression as i,trackAdvertising as a}from"../../../utils/tracking.mjs";import{useRequest as o}from"../../../hooks/query/use-query.mjs";import{useVideoPlayerRef as s}from"./video-player-ref-context.mjs";import{PrerollSkipButtonContent as c}from"./preroll-skip-button-content.mjs";import{useCallback as l,useEffect as u,useRef as d,useState as f}from"react";import{useIsClient as p}from"foxact/use-is-client";import{jsx as m,jsxs as h}from"react/jsx-runtime";import{createPortal as g}from"react-dom";const _=`video_preroll
|
|
2
|
+
"use client";import{useUserStore as e}from"../../../store/modules/user-store.mjs";import{pContentMatchAds as t}from"../../../service/generated/client.mjs";import{pContentMatchAdsKey as n}from"../../../service/generated/tanstack.mjs";import{trackAdClick as r,trackAdImpression as i,trackAdvertising as a}from"../../../utils/tracking.mjs";import{useRequest as o}from"../../../hooks/query/use-query.mjs";import{useVideoPlayerRef as s}from"./video-player-ref-context.mjs";import{PrerollSkipButtonContent as c}from"./preroll-skip-button-content.mjs";import{useCallback as l,useEffect as u,useRef as d,useState as f}from"react";import{useIsClient as p}from"foxact/use-is-client";import{jsx as m,jsxs as h}from"react/jsx-runtime";import{createPortal as g}from"react-dom";const _=`video_preroll`;function v(e,t){return`${e}:${Math.max(1,Math.floor(Number(t)||1))}`}const y=new Set;function b({videoId:b,episode:x}){let S=s(),C=p(),w=e(e=>e.userId),[T,E]=f(!1),[D,O]=f(0),k=d(null),A=d(!1),j={user_id:w,ad_type:`preroll`},{data:M,isLoading:N}=o(n(j),()=>t(j)),P=M?.data?.materials?.[0],F=M?.data?.settings?.skip_seconds??5,I=P?.advertise_code||``,L=v(b,x),R=y.has(L);u(()=>{if(M?.data?.hit!==!0||!P||A.current||R)return;function e(){if(!A.current){A.current=!0,E(!0),O(F);try{S?.current?.getPlayer()?.pause?.()}catch{}}}let t=S?.current?.getPlayer();if(t)if(S?.current?.isPlayerReady())e();else return t.once?.(`ready`,e),()=>{t.off?.(`ready`,e)}},[M,R,P,S,F]),u(()=>{if(!(!T||F<=0))return k.current=setInterval(()=>{O(e=>e<=1?(k.current&&=(clearInterval(k.current),null),0):e-1)},1e3),()=>{k.current&&=(clearInterval(k.current),null)}},[T,F]),u(()=>{!T||!I||i({page_key:`detail`,page_name:`详情页`,ad_slot_key:_,ad_slot_name:`视频贴片广告`,ad_id:I,ad_type:`preroll`})},[T,I]);let z=l(()=>{k.current&&=(clearInterval(k.current),null),E(!1),y.add(L);try{S?.current?.getPlayer()?.play?.().catch?.(()=>{})}catch{}I&&a({event_type:`close`,advertising_key:_,advertising_name:`视频贴片广告`,advertising_id:I})},[I,S,L]);function B(){I&&r({page_key:`detail`,page_name:`详情页`,ad_slot_key:_,ad_slot_name:`视频贴片广告`,ad_id:I,ad_type:`preroll`}),P?.advertise_url&&window.open(P.advertise_url)}return!C||typeof document>`u`||N||!T?null:g(h(`div`,{className:`fixed inset-0 z-[99998] bg-black`,children:[P?.advertise_icon&&m(`img`,{src:P.advertise_icon,alt:P.advertise_name||`视频贴片广告`,className:`h-full w-full cursor-pointer object-cover`,onClick:B}),m(`div`,{className:`absolute right-4 top-4 z-10`,children:D<=0?m(`button`,{type:`button`,className:`cursor-pointer rounded-lg bg-black/60 px-3 py-1 text-sm text-white`,onClick:z,children:m(c,{label:`跳过广告`})}):h(`div`,{className:`rounded-lg bg-black/60 px-3 py-1 text-sm text-white`,children:[D,`秒后可跳过`]})})]}),document.body)}export{b as VideoPrerollAdOverlay};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{useUserStore as e}from"../../../store/modules/user-store.mjs";import{gCommunityGetContentList as t,pCommunityAddContentToCollection as n}from"../../../service/generated/client.mjs";import{Button as r}from"../../ui/button.mjs";import{Box as i}from"../../ui/box.mjs";import{useDeleteRequest as a,useMutation as o,usePaginated as s}from"../../../hooks/query/use-query.mjs";import{HeaderNav as c}from"../../common/header-nav/client.mjs";import{UserActivityList as l}from"../../common/list/user-activity-list/user-activity-list.mjs";import{toast as u}from"sonner";import{
|
|
2
|
+
"use client";import{useUserStore as e}from"../../../store/modules/user-store.mjs";import{gCommunityGetContentList as t,pCommunityAddContentToCollection as n}from"../../../service/generated/client.mjs";import{Button as r}from"../../ui/button.mjs";import{Box as i}from"../../ui/box.mjs";import{useDeleteRequest as a,useMutation as o,usePaginated as s}from"../../../hooks/query/use-query.mjs";import{HeaderNav as c}from"../../common/header-nav/client.mjs";import{UserActivityList as l}from"../../common/list/user-activity-list/user-activity-list.mjs";import{toast as u}from"sonner";import{useRouter as d}from"next/navigation";import{useMemo as f,useState as p}from"react";import{jsx as m,jsxs as h}from"react/jsx-runtime";import{useTranslations as g}from"next-intl";function _(e){return{type:e.type,content_id:e.content_id||``,author:{nick_name:e.author?.nickname||``,nickname:e.author?.nickname||``,avatar:e.author?.avatar_url||``},content:e.content||``,medias:e.medias||[],like_count:e.like_count||0,is_liked:e.interaction?.is_liked||!1,dislike_count:e.dislike_count||0,is_dislike:e.interaction?.is_dislike||!1,comment_count:e.comment_count||0}}function v({id:v}){let{userId:y}=e(),b=v,[x,S]=p(()=>new Set),C=a(),{mutateAsync:w,isPending:T}=o(async e=>await n({collection_id:b,content_id:e})),{data:E,isFetching:D,fetchNextPage:O,hasNextPage:k}=s({key:[`collection-add`,b,y],initialPageParam:1,async queryFn(e){if(!y)return{data:{list:[],total:0}};let n=await t({user_id:y,page:e,collection_id:b,page_size:10}),r=n.data?.data?.contents??[];return{data:{list:r,total:n.data?.data?.total??r.length,has_more:n.data?.data?.has_more?!0:void 0}}},getNextPageParam(e,t){let n=e?.data||{},r=n.list||[];if(typeof n.has_more==`boolean`)return n.has_more?t.length+1:void 0;if(!(r.length===0||n.total===0))return t.length+1}}),A=g(`components.pages.collectionAdd`),j=f(()=>E?.pages.flatMap(e=>((e?.data).list||[]).map(e=>_(e)))??[],[E]);function M(e){T||S(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}async function N(){if(T)return;if(!b){u.error(A(`page.collectionNotFound`));return}if(!y){u.error(A(`page.userNotFound`));return}let e=Array.from(x);if(e.length===0){u.error(A(`page.selectPostFirst`));return}let t=u.loading(A(`page.submitting`));try{await Promise.all(e.map(e=>w(e))),u.success(A(`page.submitSuccess`),{id:t}),S(new Set),C([`collection-add`,b,y]),C([`collection-detail`,b])}catch(e){console.error(`添加合集失败`,e),u.error(A(`page.submitFailed`),{id:t})}}let P=d(),F=x.size;return h(i,{className:`bg-bg2 !min-h-screen`,children:[m(c,{onBack:()=>P.back(),className:`!bg-bg2`,title:A(`page.title`),rightChild:h(r,{onClick:N,disabled:T||F===0,children:[A(`page.done`),`(`,F,`)`]})}),m(l,{list:j,loading:D,hasMore:k,loadMore:async()=>{O()},emptyText:A(`page.emptyPublish`),showGroupHeaders:!1,isEditMode:!0,selectedIds:x,onToggleSelection:M})]})}export{v as CollectionAddPage};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{useUserStore as e}from"../../../store/modules/user-store.mjs";import{gUserGetUserEditInfo as t,gUserGetUserInfo as n,pUserEditUserInfo as r}from"../../../service/generated/client.mjs";import{uploadFile as i}from"../../../utils/upload-file.mjs";import{Avatar as ee,AvatarFallback as te,AvatarImage as ne}from"../../ui/avatar.mjs";import{Box as a}from"../../ui/box.mjs";import{InputGroup as re,InputGroupAddon as ie,InputGroupTextarea as ae}from"../../ui/input-group.mjs";import{Text as o}from"../../ui/text.mjs";import{useDeleteRequest as oe,useMutation as se,useRequest as ce}from"../../../hooks/query/use-query.mjs";import{HeaderNav as le}from"../../common/header-nav/client.mjs";import{PickerDrawer as s}from"../../common/picker/picker-drawer/picker-drawer.mjs";import{GenderPicker as ue}from"../../common/picker/gender-picker/gender-picker.mjs";import{ImageCropModal as de}from"../../common/image-crop-modal/image-crop-modal.mjs";import{toast as c}from"sonner";import{useEffect as l,useRef as u,useState as d}from"react";import{ChevronDown as fe}from"lucide-react";import{jsx as f,jsxs as p}from"react/jsx-runtime";import{useTranslations as pe}from"next-intl";import{produce as me}from"immer";const m={0:`secret`,1:`male`,2:`female`},h={male:1,female:2,secret:0},g=[`image/jpeg`,`image/png`],he=/^[\u4E00-\u9FFF\w.-]+$/;function ge(e){let t=e.name.toLowerCase(),n=e.type.toLowerCase();return g.includes(n)||/\.(?:jpg|jpeg|png)$/i.test(t)}function _(e){return e?h[e]===void 0?m[e]??`secret`:e:`secret`}function v(e){if(!e)return;if(h[e]!==void 0)return h[e];let t=Number(e);return Number.isNaN(t)?void 0:t}function _e(e){return{nickname:e?.nick_name??``,gender:_(e?.gender?.toString()),signature:e?.signature??``,avatar:e?.avatar??``}}function ve(e){if(!e)return;e.focus();let t=e.value.length;e.setSelectionRange(t,t)}function ye({id:m}){let h=pe(`components.pages.edit`),{userId:g,userInfo:_,setUserInfo:ye}=e(),y=m??g,b=oe(),be={male:h(`page.genderMale`),female:h(`page.genderFemale`),secret:h(`page.genderSecret`)},xe=u(null),x=u(null),S=u(null),C=u(null),[w,T]=d(()=>_e()),[E,D]=d(!1),[Se,O]=d(null),[Ce,k]=d(!1),[A,j]=d(``),[M,N]=d(!1),[P,F]=d(``),[we,I]=d(!1),[L,R]=d(`secret`),[z,Te]=d(!1),[B,V]=d(``),Ee={code:0,message:``,data:{}},De={code:0,message:``,data:{}},{data:Oe,isLoading:H}=ce([`user-edit-info`,y],()=>y?t({user_id:y}):Promise.resolve(Ee)),{data:ke}=ce([`user-info-basic`,y],()=>y?n({user_id:y}):Promise.resolve(De)),{mutateAsync:Ae,isPending:je}=se(async e=>r(e)),Me=E||je||Se!==null,U=H||Me,W=U?`cursor-not-allowed opacity-60`:`cursor-pointer`,Ne=ke?.data?.display_id||_?.display_id||`--`,G=w.gender||`secret`,Pe=U||P.trim()===w.nickname,Fe=U||L===G,Ie=U||B===w.signature,K=`flex h-12 w-full items-center rounded-md bg-[var(--color-surface-field-bg)] px-4`,q=`text-sm leading-6 text-text3`,J=`block min-w-0 flex-1 truncate text-sm leading-5 text-text3`;l(()=>{let e=Oe?.data;e&&T(_e(e))},[Oe]),l(()=>{if(!M)return;let e=window.setTimeout(()=>{ve(x.current)},250);return()=>{window.clearTimeout(e)}},[M]),l(()=>{if(!z)return;let e=window.setTimeout(()=>{ve(S.current)},250);return()=>{window.clearTimeout(e)}},[z]),l(()=>()=>{A&&URL.revokeObjectURL(A)},[A]);function Y(e,t){T(me(n=>{n[e]=t}))}function Le(){A&&(URL.revokeObjectURL(A),j(``))}function Re(){y&&(b([`user-edit-info`,y]),b([`user-info-basic`,y]),b([`user-profile`,`mine`]),b([`user-profile`,`mine`,y]),b([`user-profile`,`profile`,y]))}function X(e){!y||y!==g||ye({..._,user_id:y,...e})}function ze(){c.info(h(`page.editBlockedWhileSaving`))}function Z(){return H?!0:Me?(ze(),!0):!1}function Be(e){return C.current?(ze(),!1):(C.current=e,O(e),!0)}function Ve(e){C.current===e&&(C.current=null,O(null))}async function Q(e,t){if(!Be(e))return!1;let n=c.loading(h(`page.savingInProgress`));try{return await t()}finally{c.dismiss(n),Ve(e)}}function He(e,t){let n={...w,...t},r={nickname:[`nick_name`,n.nickname||void 0],avatar:[`avatar`,n.avatar||void 0],signature:[`signature`,n.signature||void 0],gender:[`gender`,v(n.gender)]},i=Object.keys(r).filter(t=>t!==e).map(e=>r[e]);return i.push(r[e]),Object.fromEntries(i)}async function $(e,t){if(!y)return c.error(h(`page.userNotFound`)),!1;let n=He(e,t);try{return await Ae({user_id:y,...n}),Re(),!0}catch(e){return console.error(`更新用户信息失败`,e),c.error(h(`page.updateFailed`)),!1}}function Ue(){Z()||E||xe.current?.click()}function We(e){if(Z()){e.target&&(e.target.value=``);return}let t=e.target.files?.[0];if(t){if(!ge(t)){c.error(h(`page.imageTypeInvalid`)),e.target&&(e.target.value=``);return}j(URL.createObjectURL(t)),k(!0),e.target&&(e.target.value=``)}}async function Ge(e){await Q(`avatar`,async()=>{try{D(!0);let t=await i(new File([e],`avatar.jpg`,{type:`image/jpeg`}),1);return await $(`avatar`,{avatar:t.objectKey})?(Y(`avatar`,t.objectKey),X({avatar:t.objectKey}),Ke(),c.success(h(`page.avatarUpdateSuccess`)),!0):!1}catch(e){return console.error(`上传头像失败`,e),c.error(h(`page.avatarUploadFailed`)),!1}finally{D(!1)}})}function Ke(){k(!1),Le()}function qe(){Z()||(F(w.nickname),N(!0))}function Je(e){let t=e.target.value;
|
|
2
|
+
"use client";import{useUserStore as e}from"../../../store/modules/user-store.mjs";import{gUserGetUserEditInfo as t,gUserGetUserInfo as n,pUserEditUserInfo as r}from"../../../service/generated/client.mjs";import{uploadFile as i}from"../../../utils/upload-file.mjs";import{Avatar as ee,AvatarFallback as te,AvatarImage as ne}from"../../ui/avatar.mjs";import{Box as a}from"../../ui/box.mjs";import{InputGroup as re,InputGroupAddon as ie,InputGroupTextarea as ae}from"../../ui/input-group.mjs";import{Text as o}from"../../ui/text.mjs";import{useDeleteRequest as oe,useMutation as se,useRequest as ce}from"../../../hooks/query/use-query.mjs";import{HeaderNav as le}from"../../common/header-nav/client.mjs";import{PickerDrawer as s}from"../../common/picker/picker-drawer/picker-drawer.mjs";import{GenderPicker as ue}from"../../common/picker/gender-picker/gender-picker.mjs";import{ImageCropModal as de}from"../../common/image-crop-modal/image-crop-modal.mjs";import{toast as c}from"sonner";import{useEffect as l,useRef as u,useState as d}from"react";import{ChevronDown as fe}from"lucide-react";import{jsx as f,jsxs as p}from"react/jsx-runtime";import{useTranslations as pe}from"next-intl";import{produce as me}from"immer";const m={0:`secret`,1:`male`,2:`female`},h={male:1,female:2,secret:0},g=[`image/jpeg`,`image/png`],he=/^[\u4E00-\u9FFF\w.-]+$/;function ge(e){let t=e.name.toLowerCase(),n=e.type.toLowerCase();return g.includes(n)||/\.(?:jpg|jpeg|png)$/i.test(t)}function _(e){return e?h[e]===void 0?m[e]??`secret`:e:`secret`}function v(e){if(!e)return;if(h[e]!==void 0)return h[e];let t=Number(e);return Number.isNaN(t)?void 0:t}function _e(e){return{nickname:e?.nick_name??``,gender:_(e?.gender?.toString()),signature:e?.signature??``,avatar:e?.avatar??``}}function ve(e){if(!e)return;e.focus();let t=e.value.length;e.setSelectionRange(t,t)}function ye({id:m}){let h=pe(`components.pages.edit`),{userId:g,userInfo:_,setUserInfo:ye}=e(),y=m??g,b=oe(),be={male:h(`page.genderMale`),female:h(`page.genderFemale`),secret:h(`page.genderSecret`)},xe=u(null),x=u(null),S=u(null),C=u(null),[w,T]=d(()=>_e()),[E,D]=d(!1),[Se,O]=d(null),[Ce,k]=d(!1),[A,j]=d(``),[M,N]=d(!1),[P,F]=d(``),[we,I]=d(!1),[L,R]=d(`secret`),[z,Te]=d(!1),[B,V]=d(``),Ee={code:0,message:``,data:{}},De={code:0,message:``,data:{}},{data:Oe,isLoading:H}=ce([`user-edit-info`,y],()=>y?t({user_id:y}):Promise.resolve(Ee)),{data:ke}=ce([`user-info-basic`,y],()=>y?n({user_id:y}):Promise.resolve(De)),{mutateAsync:Ae,isPending:je}=se(async e=>r(e)),Me=E||je||Se!==null,U=H||Me,W=U?`cursor-not-allowed opacity-60`:`cursor-pointer`,Ne=ke?.data?.display_id||_?.display_id||`--`,G=w.gender||`secret`,Pe=U||P.trim()===w.nickname,Fe=U||L===G,Ie=U||B===w.signature,K=`flex h-12 w-full items-center rounded-md bg-[var(--color-surface-field-bg)] px-4`,q=`text-sm leading-6 text-text3`,J=`block min-w-0 flex-1 truncate text-sm leading-5 text-text3`;l(()=>{let e=Oe?.data;e&&T(_e(e))},[Oe]),l(()=>{if(!M)return;let e=window.setTimeout(()=>{ve(x.current)},250);return()=>{window.clearTimeout(e)}},[M]),l(()=>{if(!z)return;let e=window.setTimeout(()=>{ve(S.current)},250);return()=>{window.clearTimeout(e)}},[z]),l(()=>()=>{A&&URL.revokeObjectURL(A)},[A]);function Y(e,t){T(me(n=>{n[e]=t}))}function Le(){A&&(URL.revokeObjectURL(A),j(``))}function Re(){y&&(b([`user-edit-info`,y]),b([`user-info-basic`,y]),b([`user-profile`,`mine`]),b([`user-profile`,`mine`,y]),b([`user-profile`,`profile`,y]))}function X(e){!y||y!==g||ye({..._,user_id:y,...e})}function ze(){c.info(h(`page.editBlockedWhileSaving`))}function Z(){return H?!0:Me?(ze(),!0):!1}function Be(e){return C.current?(ze(),!1):(C.current=e,O(e),!0)}function Ve(e){C.current===e&&(C.current=null,O(null))}async function Q(e,t){if(!Be(e))return!1;let n=c.loading(h(`page.savingInProgress`));try{return await t()}finally{c.dismiss(n),Ve(e)}}function He(e,t){let n={...w,...t},r={nickname:[`nick_name`,n.nickname||void 0],avatar:[`avatar`,n.avatar||void 0],signature:[`signature`,n.signature||void 0],gender:[`gender`,v(n.gender)]},i=Object.keys(r).filter(t=>t!==e).map(e=>r[e]);return i.push(r[e]),Object.fromEntries(i)}async function $(e,t){if(!y)return c.error(h(`page.userNotFound`)),!1;let n=He(e,t);try{return await Ae({user_id:y,...n}),Re(),!0}catch(e){return console.error(`更新用户信息失败`,e),c.error(h(`page.updateFailed`)),!1}}function Ue(){Z()||E||xe.current?.click()}function We(e){if(Z()){e.target&&(e.target.value=``);return}let t=e.target.files?.[0];if(t){if(!ge(t)){c.error(h(`page.imageTypeInvalid`)),e.target&&(e.target.value=``);return}j(URL.createObjectURL(t)),k(!0),e.target&&(e.target.value=``)}}async function Ge(e){await Q(`avatar`,async()=>{try{D(!0);let t=await i(new File([e],`avatar.jpg`,{type:`image/jpeg`}),1);return await $(`avatar`,{avatar:t.objectKey})?(Y(`avatar`,t.objectKey),X({avatar:t.objectKey}),Ke(),c.success(h(`page.avatarUpdateSuccess`)),!0):!1}catch(e){return console.error(`上传头像失败`,e),c.error(h(`page.avatarUploadFailed`)),!1}finally{D(!1)}})}function Ke(){k(!1),Le()}function qe(){Z()||(F(w.nickname),N(!0))}function Je(e){let t=e.target.value;F(t)}function Ye(e){return e?e.length<2?h(`page.nicknameTooShort`):he.test(e)?``:h(`page.nicknameInvalidChars`):h(`page.nicknameRequired`)}async function Xe(e){if(Pe)return!1;let t=e.trim(),n=Ye(t);return n?(c.error(n),!1):await Q(`nickname`,async()=>$(`nickname`,{nickname:t}))?(Y(`nickname`,t),X({nick_name:t}),F(t),c.success(h(`page.nicknameUpdateSuccess`)),!0):!1}function Ze(){Z()||(R(G),I(!0))}function Qe(){I(!1)}function $e(e){R(e)}async function et(e){let t=e||L||`secret`;if(t===G)return!1;let n=v(t);return await Q(`gender`,async()=>$(`gender`,{gender:t}))?(Y(`gender`,t),X({gender:n}),R(t),c.success(h(`page.genderUpdateSuccess`)),!0):!1}function tt(){Z()||(V(w.signature),Te(!0))}function nt(e){let t=e.target.value;V(t)}function rt(e){let t=e.trim();return t.length>0&&t.length<2?h(`page.signatureTooShort`):``}async function it(e){if(Ie)return!1;let t=rt(e);return t?(c.error(t),!1):await Q(`signature`,async()=>$(`signature`,{signature:e}))?(Y(`signature`,e),X({signature:e}),V(e),c.success(h(`page.signatureUpdateSuccess`)),!0):!1}return p(a,{className:`min-h-screen bg-[var(--color-surface-panel-dark)]`,children:[f(le,{className:`h-11 !border-none !bg-[var(--color-surface-panel-dark)]`,title:h(`page.title`)}),p(a,{className:`mx-auto flex w-full max-w-[390px] flex-col px-8 pb-10 pt-17`,children:[p(`button`,{type:`button`,onClick:Ue,className:`flex flex-col items-center gap-4 pb-10 ${W}`,children:[f(`input`,{ref:xe,type:`file`,accept:`.jpg,.jpeg,.png,image/jpeg,image/png`,className:`hidden`,onChange:We}),f(a,{className:`flex h-[72px] w-[72px] items-center justify-center rounded-full bg-[var(--color-surface-white20)]`,children:p(ee,{className:`h-[60px] w-[60px] border-[3px] border-[var(--color-surface-white20)]`,children:[f(ne,{src:w.avatar}),f(te,{})]})}),p(o,{className:`text-base leading-5 text-text3`,children:[`ID:`,` `,H?h(`page.loading`):E?h(`page.avatarUploading`):`${Ne}`]})]}),p(a,{className:`flex flex-col gap-6`,children:[p(a,{className:`flex flex-col gap-2`,children:[f(o,{as:`p`,className:q,children:h(`page.label`)}),f(`button`,{type:`button`,onClick:qe,className:`${K} ${W}`,children:f(o,{className:J,children:w.nickname||h(`page.nicknamePlaceholder`)})})]}),p(a,{className:`flex flex-col gap-2`,children:[f(o,{as:`p`,className:q,children:h(`page.genderLabel`)}),p(`button`,{type:`button`,onClick:Ze,className:`${K} justify-between gap-3 ${W}`,children:[f(o,{className:J,children:be[G]||h(`page.genderSecret`)}),f(fe,{className:`h-5 w-5 shrink-0 text-text3`,strokeWidth:1.75})]})]}),p(a,{className:`flex flex-col gap-2`,children:[f(o,{as:`p`,className:q,children:h(`page.signatureLabel`)}),f(`button`,{type:`button`,onClick:tt,className:`${K} ${W}`,children:f(o,{className:J,children:w.signature||h(`page.signaturePlaceholder`)})})]})]})]}),f(s,{open:M,onClose:()=>N(!1),title:h(`page.label`),confirmText:h(`page.submit`),onConfirm:e=>Xe(String(e)),confirmDisabled:Pe,children:({onValueChange:e})=>f(a,{className:`px-4 py-4 min-h-[230px]`,children:p(re,{children:[f(ae,{ref:x,className:`!bg-bg1 p-2.5`,rows:4,maxLength:24,placeholder:h(`page.nicknamePlaceholder`),value:P,onChange:t=>{Je(t),e(t.target.value)},disabled:U}),f(ie,{className:`!bg-bg1`,align:`block-end`,children:f(`div`,{className:`text-right w-full`,children:p(`span`,{className:`text-xs`,children:[P.length,`/`,24]})})})]})})}),f(ue,{open:we,onClose:Qe,value:L,onValueChange:$e,onConfirm:et,confirmDisabled:Fe}),f(s,{open:z,onClose:()=>Te(!1),title:h(`page.signatureLabel`),confirmText:h(`page.submit`),onConfirm:e=>it(String(e)),confirmDisabled:Ie,children:({onValueChange:e})=>f(a,{className:`px-4 py-4 min-h-[230px]`,children:p(re,{children:[f(ae,{ref:S,className:`!bg-bg1 p-2.5`,rows:4,maxLength:100,placeholder:h(`page.signaturePlaceholder`),value:B,onChange:t=>{nt(t),e(t.target.value)},disabled:U}),f(ie,{className:`!bg-bg1`,align:`block-end`,children:f(`div`,{className:`text-right w-full`,children:p(`span`,{className:`text-xs`,children:[B.length,`/`,100]})})})]})})}),f(de,{open:Ce,onClose:Ke,imageSrc:A,onConfirm:Ge,cropShape:`round`})]})}export{ye as EditClient};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import e from"../../biz/basics/fullscreen-feed/runtime/client.mjs";import{useMixedFeedController as t}from"../../biz/basics/fullscreen-feed/runtime/use-mixed-feed-controller.mjs";import{useSeriesFeedController as n}from"../../biz/basics/fullscreen-feed/runtime/use-series-feed-controller.mjs";import{SeriesEpisodes as r}from"../../common/series-episodes/index.mjs";import{
|
|
2
|
+
"use client";import e from"../../biz/basics/fullscreen-feed/runtime/client.mjs";import{useMixedFeedController as t}from"../../biz/basics/fullscreen-feed/runtime/use-mixed-feed-controller.mjs";import{useSeriesFeedController as n}from"../../biz/basics/fullscreen-feed/runtime/use-series-feed-controller.mjs";import{SeriesEpisodes as r}from"../../common/series-episodes/index.mjs";import{usePathname as i}from"next/navigation";import{useCallback as a,useEffect as o,useMemo as s}from"react";import{Fragment as c,jsx as l,jsxs as u}from"react/jsx-runtime";import{useTranslations as d}from"next-intl";function f({blockId:f,seriesId:p,initialContents:m,videoConfig:h,hasBottom:g,pageSize:_=6,initialActiveIndex:v=0,items:y,onSwipeTo:b,onEpisodeNavigate:x,onGoToEpisode:S,currentUserId:C,followIds:w,onFollowIdsChange:T,onRequireLogin:E}){let D=d(`components.pages.fullscreenFeed`),O=i(),k=s(()=>{let e=p?`series:${p}`:`block:${f||``}`;return`${O||`unknown`}:fullscreen-feed:${e}:pageSize:${_}`},[f,_,O,p]),A=`${k}:series-controller`,j=`${k}:mixed-controller`,M=n({seriesId:p||``,initialContents:m,initialActiveIndex:v,onEpisodeNavigate:x,keepAliveKey:A}),N=t({blockId:f||``,initialContents:m,initialActiveIndex:v,pageSize:_,keepAliveKey:j}),P=p?M:N,F=y||P.items,I=P.activeIndex,L=P.userInteracted,R=a((e,t)=>{P.setActiveIndex(e,t),p||N.maybeLoadMore(e),b?.({activeIndex:e,items:F,direction:t})},[P,F,b,p,N]),z=a((e,t)=>{P.updateItemData(e,t)},[P]),B=a(e=>P.getNavigationInfo(e),[P]);return o(()=>{S&&S(e=>{R(e,`jump`)})},[S,R]),!f&&!p?l(`div`,{className:`flex h-screen w-full items-center justify-center bg-black text-white/70`,children:D(`page.missingParams`)}):u(c,{children:[l(e,{items:F,activeIndex:I,bottom:g?56:void 0,videoConfig:h,userInteracted:L,onUserInteracted:P.setUserInteracted,onActiveIndexChange:R,onDataUpdate:z,getNavigationInfo:B,currentUserId:C,followIds:w,onFollowIdsChange:T,onRequireLogin:E}),p&&M.isSeriesSelectorOpen&&l(r,{title:D(`page.episodeSelectorTitle`),videoTitle:M.seriesMeta.seriesTitle,mode:`selector`,variant:`sheet`,open:M.isSeriesSelectorOpen,seriesList:M.seriesMeta.seriesList,activeEpisodeId:M.activeEpisodeId,onClose:M.closeSeriesSelector,onSelectEpisode:M.onSelectEpisode})]})}export{f as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{getChannelList as e}from"../../biz/utils/helpers/get-channel-list.mjs";import{useUserStore as t}from"../../../store/modules/user-store.mjs";import{gCommunityGetComments as n,gCommunityGetContentInfo as r,gCommunityGetContentList as i,gContentGetAppChannels as a}from"../../../service/generated/client.mjs";import{checkFollowStatus as o}from"../../../utils/follow-service.mjs";import{EmptyState as s}from"../../ui/empty.mjs";import{useRequest as c}from"../../../hooks/query/use-query.mjs";import{useBrowseReport as l}from"../../../hooks/use-browse-report.mjs";import{queryKey as u}from"../../../constants/query-key.mjs";import{useKeepAliveEffect as ee,useKeepAliveState as d}from"../../common/keep-scroll-position/index.mjs";import{apiCollectClick as f}from"../../../utils/api-collect.mjs";import{batchQueryContentInteractions as p}from"../../../hooks/use-content-operate.mjs";import m from"../../biz/business/search-bar/variants/detail-search-bar/index.mjs";import{DetailFollowAction as te}from"../../biz/business/detail/shared/detail-follow-action.mjs";import{DetailOperate as ne}from"../../biz/business/detail/shared/detail-operate.mjs";import{PostRecommendList as re}from"../../biz/business/detail/shared/post-recommend-list.mjs";import{DetailHero as h}from"../../biz/business/detail/shared/video-hero.mjs";import g from"../../biz/business/comment/comment-list.mjs";import ie from"../../common/info-card/card-header.mjs";import ae from"../../common/info-card/card-text.mjs";import{useCallback as oe,useEffect as _,useMemo as v}from"react";import{useSearchParams as y}from"next/navigation";import{Fragment as b,jsx as x,jsxs as S}from"react/jsx-runtime";import{useTranslations as se}from"next-intl";function C(e){if(!e||typeof e!=`object`||!e.content_id)return null;let t=Array.isArray(e.medias)?e.medias:[],n=t.filter(e=>e&&e.is_video===!1),r=t.filter(e=>e&&e.is_video===!0),i=n.map(e=>e.media_url).filter(e=>typeof e==`string`&&e.length>0),a=(Array.isArray(e.images)?e.images:[]).map(e=>typeof e==`string`?e:e&&typeof e==`object`&&(e.url||e.image_url||e.media_url)||``).filter(e=>typeof e==`string`&&e.length>0),o=i.length?i:a,s=r.map(e=>e.cover_image).find(e=>typeof e==`string`&&e.length>0),c=o[0]||``,l=e.cover_image||s||c||``,u=(Array.isArray(e.tags)?e.tags:[]).map(e=>{if(e&&typeof e==`object`){let t=e.id??e.name??``,n=e.name??e.id??``,r=e.group??``;return{id:String(t),name:String(n),group:String(r)}}return{id:String(e),name:String(e),group:``}}).filter(e=>!!(e.id||e.name));return{...t.length?{medias:t}:{},id:e.content_id,mid:e.content_id,name:e.title||``,cat_id:``,cat_name:``,status:String(e.status||`2`),status_text:``,create_time:e.create_time,show_at:e.create_time,position:``,img_type:``,img_x:l,img_y:l,img_width:``,img_height:``,preview_images:o,score:``,duration:``,is_more_link:`n`,update_status:`1`,description:e.content||``,language:``,director:``,actor:``,area:``,issue_date:``,publisher:``,series:``,number:``,tags:u,source_tags:u.map(e=>e.name).filter(Boolean).join(`,`),source_actor:[],links:[],money:``,up_user:e.user_id||e.author?.user_id||``,source_username:e.author?.nickname||e.author?.username||``,task_id:``,file_status:``,content_type:2,author:{...e.author,avatar:e.author.avatar_url},like:e.interaction?.is_liked||!1,dislike:e.interaction?.is_dislike||!1,collect:e.interaction?.is_collected||!1,is_followed:e.interaction?.is_followed||!1,static:{like_cnt:e.like_count||0,comment_cnt:e.comment_count||0,share_cnt:e.share_count||0,browse_cnt:e.view_count||0},info:{text:e.content||``,images:o}}}function ce(e){let t=Array.isArray(e.medias)?e.medias:[],n=t.filter(e=>e&&e.is_video===!1).map(e=>e.media_url).filter(e=>typeof e==`string`&&e.length>0),r=(Array.isArray(e.images)?e.images:[]).map(e=>typeof e==`string`?e:e&&typeof e==`object`&&(e.url||e.image_url||e.media_url)||``).filter(e=>typeof e==`string`&&e.length>0),i=n.length?n:r,a=t.filter(e=>e&&e.is_video===!0).map(e=>e.cover_image).find(e=>typeof e==`string`&&e.length>0),o=e.cover_image||a||i[0]||``,s=(Array.isArray(e.tags)?e.tags:[]).map(e=>{if(e&&typeof e==`object`){let t=e.id??e.name??``,n=e.name??e.id??``,r=e.group??``;return{id:String(t),name:String(n),group:String(r)}}return{id:String(e),name:String(e),group:``}}).filter(e=>!!(e.id||e.name)),c=t.length?t:i.filter(Boolean).map(e=>({media_url:e,is_video:!1,cover_image:``}));return{...c.length?{medias:c}:{},id:e.content_id||``,mid:e.content_id||``,name:e.title||``,cat_id:``,cat_name:``,status:String(e.status||`2`),status_text:``,create_time:e.create_time,show_at:e.create_time,position:``,img_type:``,img_x:o,img_y:o,img_width:``,img_height:``,preview_images:i,score:``,duration:``,is_more_link:`n`,update_status:`1`,description:e.content||``,language:``,director:``,actor:``,area:``,issue_date:``,publisher:``,series:``,number:``,tags:s,source_tags:s.map(e=>e.name).filter(Boolean).join(`,`),source_actor:[],links:[],money:``,up_user:e.user_id||e.author?.user_id||``,source_username:e.author?.nickname||e.author?.username||``,task_id:``,file_status:``,content_type:2,author:{...e.author,avatar:e.author.avatar_url},like:e.interaction?.is_liked||!1,dislike:e.interaction?.is_dislike||!1,collect:e.interaction?.is_collected||!1,is_followed:e.interaction?.is_followed||!1,statics_cnt:{like_cnt:String(e.like_count||0),dislike_cnt:String(e.dislike_count||0),comment_cnt:String(e.comment_count||0),share_cnt:String(e.share_count||0),browse_cnt:String(e.view_count||0),collect_cnt:String(e.collect_count||0)}}}function w({detailId:f,initialInformation:w,initialRecommendList:le,initialCommentList:T,initialCommentTotal:E,initialCommentHasMore:D}){let O=se(`components.pages.postDetail`),k=y(),{isLogin:ue,userInfo:de,userId:A}=t(),j=A||de?.userId||``;l({contentId:f,contentType:2,enabled:!!f,enableIntervalReport:!1,enableExitReport:!1});let{data:M}=c(v(()=>[`post-detail`,f],[f]),async()=>f?await r({content_id:f}):null,{enabled:!!f}),N=v(()=>{let e=M?.data?.data;return C(e)},[M?.data?.data]),fe=w??N??null,{data:P}=c(v(()=>[`post-detail-recommend`,f],[f]),async()=>f?await i({page:1,page_size:6,sort_by:`recommend`}):null,{enabled:!!f}),F=v(()=>(P?.data?.data?.contents??[]).filter(e=>e.content_id!==f).slice(0,4).map(e=>ce(e)),[f,P?.data?.data?.contents]),I=le??F??[],[L,R]=d(`detail-information-${f}`,fe),[z,B]=d(`detail-recommend-${f}`,I),[V,H]=d(`info-detail-comment-add-count-${f}`,0),U=v(()=>L?.content_type===0,[L?.content_type]),W=v(()=>[`post-detail-comments`,f,1,5],[5,f]),{data:G}=c(W,async()=>f?await n({content_id:f,page:1,page_size:5,sort_by:`latest`}):null,{enabled:!!f}),pe=v(()=>{if(T?.length)return T;let e=G?.data?.data?.comments??[];if(e.length>0)return e},[G?.data?.data?.comments,T]),K=v(()=>{if(typeof E==`number`)return E;if(G?.data?.data)return typeof G?.data?.data?.total==`number`?G.data.data.total:void 0},[G?.data?.data,E]),me=v(()=>{if(typeof D==`boolean`)return D;if(G?.data?.data)return G?.data?.data?.has_more??!1},[G?.data?.data,D]),[q,J]=d(`post-detail-comment-total-${f}`,typeof E==`number`?E:void 0);_(()=>{typeof K==`number`&&J(e=>typeof e==`number`?Math.max(e,K):K)},[K,J]);let he=v(()=>[`detail-interaction`,L?.id,L?.content_type],[L?.content_type,L?.id]),Y=L?.up_user||``,ge=!!(j&&Y&&j===Y),_e=v(()=>[`detail-follow-status`,j,Y],[j,Y]),{data:X}=c(he,async()=>!L?.id||typeof L.content_type!=`number`?null:await p([L.id],2),{enabled:!!L?.id}),{data:Z}=c(_e,async()=>!j||!Y?null:await o({app_id:0,follower_id:j,followee_ids:[Y]}),{enabled:!!ue&&!!j&&!!Y&&!ge});_(()=>{!L&&N&&R(N)},[L,N,R]),_(()=>{z.length===0&&F.length>0&&B(F)},[z.length,F,B]),_(()=>{if(!X?.interaction_list?.[0])return;let e=X.interaction_list[0];R(t=>{if(!t)return t;let n=t.static?.like_cnt,r=typeof n==`number`?n:Number(n||0),i=!!e.is_liked&&r===0;return{...t,like:e.is_liked||!1,dislike:e.is_disliked||!1,collect:e.is_collected||!1,static:i?{...t.static||{},like_cnt:1}:t.static}})},[X,R]),_(()=>{if(!Z?.data||!Y)return;let e=!!Z.data?.is_following_map?.[Y];R(t=>!t||t.is_followed===e?t:{...t,is_followed:e})},[Z?.data,Y,R]);let Q=oe(e=>{R(t=>t&&{...t,...e})},[R]);ee(()=>{L?.id&&L.id},[L?.id],`detail-page-report-${f}`),_(()=>{!L||typeof window>`u`||window.sensors?.track?.(`detail_page_view`,{object_id:L.id||f,author_id:L.up_user,object_type:L.content_type,object_category:L.content_type,object_tags:L.tags?.map(e=>e.name),block_id:``,page_source:window.location?.pathname||``})},[f,L]),_(()=>{H(0)},[L?.id,H]);let ve=v(()=>(typeof q==`number`?q:typeof K==`number`?K:0)+V,[V,q,K]);_(()=>{k?.get(`tab`)===`comment`&&(typeof window>`u`||window.requestAnimationFrame(()=>{document.getElementById(`detail-comments`)?.scrollIntoView({behavior:`smooth`,block:`start`})}))},[L?.id,k]);let $=L?.status===`2`,{data:ye}=c([u.CHANNEL],()=>a());return S(`div`,{className:`w-full min-h-screen bg-bg2 text-text1 pt-11`,children:[x(`div`,{className:`fixed top-0 left-0 right-0 z-40`,children:x(m,{data:{list:e(ye?.data)}})}),x(`div`,{className:`mx-auto w-full max-w-[840px] pb-6`,children:S(b,{children:[L&&!$&&x(s,{type:`no-content`,text:O(`postDetailClient.postOffline`)}),L&&$&&S(b,{children:[U&&x(h,{information:L,isVideo:!0}),S(`article`,{className:`w-full`,children:[x(ie,{infoData:L,rightChild:x(te,{information:L,onUpdate:Q})}),x(ae,{infoData:L,isEllipsis:!1}),!U&&x(`div`,{className:`mt-[12px]`,children:x(h,{information:L,isVideo:!1})})]}),x(ne,{information:L,onUpdate:Q}),S(`div`,{id:`detail-comments`,className:`w-full border-t-[8px] border-bg2 mt-[12px]`,children:[S(`div`,{className:`w-full px-[16px] h-[40px] flex items-center justify-between border-b-[1px] border-line1`,children:[x(`p`,{className:`text-[16px] text-text1 font-bold`,children:O(`postDetailClient.comment`)}),S(`p`,{className:`text-[12px] text-text3`,children:[ve,O(`postDetailClient.reactions`)]})]}),x(g,{listQueryKey:W,contentId:L.id,information:L,isShow:!1,isClickLoad:!0,initialComments:pe,initialTotal:K,initialHasMore:me,addCommentCount:()=>{H(e=>e+1)},onTotalChange:e=>{J(t=>typeof t==`number`?Math.max(t,e):e)}})]}),z.length>0&&x(re,{information:L,initRecommendList:z})]}),!L&&x(s,{type:`no-content`,text:O(`postDetailClient.postDeleted`)})]})})]})}export{w as default};
|
|
2
|
+
"use client";import{getChannelList as e}from"../../biz/utils/helpers/get-channel-list.mjs";import{useUserStore as t}from"../../../store/modules/user-store.mjs";import{gCommunityGetComments as n,gCommunityGetContentInfo as r,gCommunityGetContentList as i,gContentGetAppChannels as a}from"../../../service/generated/client.mjs";import{checkFollowStatus as o}from"../../../utils/follow-service.mjs";import{EmptyState as s}from"../../ui/empty.mjs";import{useRequest as c}from"../../../hooks/query/use-query.mjs";import{useBrowseReport as l}from"../../../hooks/use-browse-report.mjs";import{queryKey as u}from"../../../constants/query-key.mjs";import{useKeepAliveEffect as ee,useKeepAliveState as d}from"../../common/keep-scroll-position/index.mjs";import{apiCollectClick as f}from"../../../utils/api-collect.mjs";import{batchQueryContentInteractions as p}from"../../../hooks/use-content-operate.mjs";import m from"../../biz/business/search-bar/variants/detail-search-bar/index.mjs";import{DetailFollowAction as te}from"../../biz/business/detail/shared/detail-follow-action.mjs";import{DetailOperate as ne}from"../../biz/business/detail/shared/detail-operate.mjs";import{PostRecommendList as re}from"../../biz/business/detail/shared/post-recommend-list.mjs";import{DetailHero as h}from"../../biz/business/detail/shared/video-hero.mjs";import g from"../../biz/business/comment/comment-list.mjs";import ie from"../../common/info-card/card-header.mjs";import _ from"../../common/info-card/card-text.mjs";import{useSearchParams as ae}from"next/navigation";import{useCallback as oe,useEffect as v,useMemo as y}from"react";import{Fragment as b,jsx as x,jsxs as S}from"react/jsx-runtime";import{useTranslations as se}from"next-intl";function C(e){if(!e||typeof e!=`object`||!e.content_id)return null;let t=Array.isArray(e.medias)?e.medias:[],n=t.filter(e=>e&&e.is_video===!1),r=t.filter(e=>e&&e.is_video===!0),i=n.map(e=>e.media_url).filter(e=>typeof e==`string`&&e.length>0),a=(Array.isArray(e.images)?e.images:[]).map(e=>typeof e==`string`?e:e&&typeof e==`object`&&(e.url||e.image_url||e.media_url)||``).filter(e=>typeof e==`string`&&e.length>0),o=i.length?i:a,s=r.map(e=>e.cover_image).find(e=>typeof e==`string`&&e.length>0),c=o[0]||``,l=e.cover_image||s||c||``,u=(Array.isArray(e.tags)?e.tags:[]).map(e=>{if(e&&typeof e==`object`){let t=e.id??e.name??``,n=e.name??e.id??``,r=e.group??``;return{id:String(t),name:String(n),group:String(r)}}return{id:String(e),name:String(e),group:``}}).filter(e=>!!(e.id||e.name));return{...t.length?{medias:t}:{},id:e.content_id,mid:e.content_id,name:e.title||``,cat_id:``,cat_name:``,status:String(e.status||`2`),status_text:``,create_time:e.create_time,show_at:e.create_time,position:``,img_type:``,img_x:l,img_y:l,img_width:``,img_height:``,preview_images:o,score:``,duration:``,is_more_link:`n`,update_status:`1`,description:e.content||``,language:``,director:``,actor:``,area:``,issue_date:``,publisher:``,series:``,number:``,tags:u,source_tags:u.map(e=>e.name).filter(Boolean).join(`,`),source_actor:[],links:[],money:``,up_user:e.user_id||e.author?.user_id||``,source_username:e.author?.nickname||e.author?.username||``,task_id:``,file_status:``,content_type:2,author:{...e.author,avatar:e.author.avatar_url},like:e.interaction?.is_liked||!1,dislike:e.interaction?.is_dislike||!1,collect:e.interaction?.is_collected||!1,is_followed:e.interaction?.is_followed||!1,static:{like_cnt:e.like_count||0,comment_cnt:e.comment_count||0,share_cnt:e.share_count||0,browse_cnt:e.view_count||0},info:{text:e.content||``,images:o}}}function ce(e){let t=Array.isArray(e.medias)?e.medias:[],n=t.filter(e=>e&&e.is_video===!1).map(e=>e.media_url).filter(e=>typeof e==`string`&&e.length>0),r=(Array.isArray(e.images)?e.images:[]).map(e=>typeof e==`string`?e:e&&typeof e==`object`&&(e.url||e.image_url||e.media_url)||``).filter(e=>typeof e==`string`&&e.length>0),i=n.length?n:r,a=t.filter(e=>e&&e.is_video===!0).map(e=>e.cover_image).find(e=>typeof e==`string`&&e.length>0),o=e.cover_image||a||i[0]||``,s=(Array.isArray(e.tags)?e.tags:[]).map(e=>{if(e&&typeof e==`object`){let t=e.id??e.name??``,n=e.name??e.id??``,r=e.group??``;return{id:String(t),name:String(n),group:String(r)}}return{id:String(e),name:String(e),group:``}}).filter(e=>!!(e.id||e.name)),c=t.length?t:i.filter(Boolean).map(e=>({media_url:e,is_video:!1,cover_image:``}));return{...c.length?{medias:c}:{},id:e.content_id||``,mid:e.content_id||``,name:e.title||``,cat_id:``,cat_name:``,status:String(e.status||`2`),status_text:``,create_time:e.create_time,show_at:e.create_time,position:``,img_type:``,img_x:o,img_y:o,img_width:``,img_height:``,preview_images:i,score:``,duration:``,is_more_link:`n`,update_status:`1`,description:e.content||``,language:``,director:``,actor:``,area:``,issue_date:``,publisher:``,series:``,number:``,tags:s,source_tags:s.map(e=>e.name).filter(Boolean).join(`,`),source_actor:[],links:[],money:``,up_user:e.user_id||e.author?.user_id||``,source_username:e.author?.nickname||e.author?.username||``,task_id:``,file_status:``,content_type:2,author:{...e.author,avatar:e.author.avatar_url},like:e.interaction?.is_liked||!1,dislike:e.interaction?.is_dislike||!1,collect:e.interaction?.is_collected||!1,is_followed:e.interaction?.is_followed||!1,statics_cnt:{like_cnt:String(e.like_count||0),dislike_cnt:String(e.dislike_count||0),comment_cnt:String(e.comment_count||0),share_cnt:String(e.share_count||0),browse_cnt:String(e.view_count||0),collect_cnt:String(e.collect_count||0)}}}function w({detailId:f,initialInformation:w,initialRecommendList:le,initialCommentList:T,initialCommentTotal:E,initialCommentHasMore:D}){let O=se(`components.pages.postDetail`),k=ae(),{isLogin:ue,userInfo:de,userId:A}=t(),j=A||de?.userId||``;l({contentId:f,contentType:2,enabled:!!f,enableIntervalReport:!1,enableExitReport:!1});let{data:M}=c(y(()=>[`post-detail`,f],[f]),async()=>f?await r({content_id:f}):null,{enabled:!!f}),N=y(()=>{let e=M?.data?.data;return C(e)},[M?.data?.data]),fe=w??N??null,{data:P}=c(y(()=>[`post-detail-recommend`,f],[f]),async()=>f?await i({page:1,page_size:6,sort_by:`recommend`}):null,{enabled:!!f}),F=y(()=>(P?.data?.data?.contents??[]).filter(e=>e.content_id!==f).slice(0,4).map(e=>ce(e)),[f,P?.data?.data?.contents]),I=le??F??[],[L,R]=d(`detail-information-${f}`,fe),[z,B]=d(`detail-recommend-${f}`,I),[V,H]=d(`info-detail-comment-add-count-${f}`,0),U=y(()=>L?.content_type===0,[L?.content_type]),W=y(()=>[`post-detail-comments`,f,1,5],[5,f]),{data:G}=c(W,async()=>f?await n({content_id:f,page:1,page_size:5,sort_by:`latest`}):null,{enabled:!!f}),pe=y(()=>{if(T?.length)return T;let e=G?.data?.data?.comments??[];if(e.length>0)return e},[G?.data?.data?.comments,T]),K=y(()=>{if(typeof E==`number`)return E;if(G?.data?.data)return typeof G?.data?.data?.total==`number`?G.data.data.total:void 0},[G?.data?.data,E]),me=y(()=>{if(typeof D==`boolean`)return D;if(G?.data?.data)return G?.data?.data?.has_more??!1},[G?.data?.data,D]),[q,J]=d(`post-detail-comment-total-${f}`,typeof E==`number`?E:void 0);v(()=>{typeof K==`number`&&J(e=>typeof e==`number`?Math.max(e,K):K)},[K,J]);let he=y(()=>[`detail-interaction`,L?.id,L?.content_type],[L?.content_type,L?.id]),Y=L?.up_user||``,ge=!!(j&&Y&&j===Y),_e=y(()=>[`detail-follow-status`,j,Y],[j,Y]),{data:X}=c(he,async()=>!L?.id||typeof L.content_type!=`number`?null:await p([L.id],2),{enabled:!!L?.id}),{data:Z}=c(_e,async()=>!j||!Y?null:await o({app_id:0,follower_id:j,followee_ids:[Y]}),{enabled:!!ue&&!!j&&!!Y&&!ge});v(()=>{!L&&N&&R(N)},[L,N,R]),v(()=>{z.length===0&&F.length>0&&B(F)},[z.length,F,B]),v(()=>{if(!X?.interaction_list?.[0])return;let e=X.interaction_list[0];R(t=>{if(!t)return t;let n=t.static?.like_cnt,r=typeof n==`number`?n:Number(n||0),i=!!e.is_liked&&r===0;return{...t,like:e.is_liked||!1,dislike:e.is_disliked||!1,collect:e.is_collected||!1,static:i?{...t.static||{},like_cnt:1}:t.static}})},[X,R]),v(()=>{if(!Z?.data||!Y)return;let e=!!Z.data?.is_following_map?.[Y];R(t=>!t||t.is_followed===e?t:{...t,is_followed:e})},[Z?.data,Y,R]);let Q=oe(e=>{R(t=>t&&{...t,...e})},[R]);ee(()=>{L?.id&&L.id},[L?.id],`detail-page-report-${f}`),v(()=>{!L||typeof window>`u`||window.sensors?.track?.(`detail_page_view`,{object_id:L.id||f,author_id:L.up_user,object_type:L.content_type,object_category:L.content_type,object_tags:L.tags?.map(e=>e.name),block_id:``,page_source:window.location?.pathname||``})},[f,L]),v(()=>{H(0)},[L?.id,H]);let ve=y(()=>(typeof q==`number`?q:typeof K==`number`?K:0)+V,[V,q,K]);v(()=>{k?.get(`tab`)===`comment`&&(typeof window>`u`||window.requestAnimationFrame(()=>{document.getElementById(`detail-comments`)?.scrollIntoView({behavior:`smooth`,block:`start`})}))},[L?.id,k]);let $=L?.status===`2`,{data:ye}=c([u.CHANNEL],()=>a());return S(`div`,{className:`w-full min-h-screen bg-bg2 text-text1 pt-11`,children:[x(`div`,{className:`fixed top-0 left-0 right-0 z-40`,children:x(m,{data:{list:e(ye?.data)}})}),x(`div`,{className:`mx-auto w-full max-w-[840px] pb-6`,children:S(b,{children:[L&&!$&&x(s,{type:`no-content`,text:O(`postDetailClient.postOffline`)}),L&&$&&S(b,{children:[U&&x(h,{information:L,isVideo:!0}),S(`article`,{className:`w-full`,children:[x(ie,{infoData:L,rightChild:x(te,{information:L,onUpdate:Q})}),x(_,{infoData:L,isEllipsis:!1}),!U&&x(`div`,{className:`mt-[12px]`,children:x(h,{information:L,isVideo:!1})})]}),x(ne,{information:L,onUpdate:Q}),S(`div`,{id:`detail-comments`,className:`w-full border-t-[8px] border-bg2 mt-[12px]`,children:[S(`div`,{className:`w-full px-[16px] h-[40px] flex items-center justify-between border-b-[1px] border-line1`,children:[x(`p`,{className:`text-[16px] text-text1 font-bold`,children:O(`postDetailClient.comment`)}),S(`p`,{className:`text-[12px] text-text3`,children:[ve,O(`postDetailClient.reactions`)]})]}),x(g,{listQueryKey:W,contentId:L.id,information:L,isShow:!1,isClickLoad:!0,initialComments:pe,initialTotal:K,initialHasMore:me,addCommentCount:()=>{H(e=>e+1)},onTotalChange:e=>{J(t=>typeof t==`number`?Math.max(t,e):e)}})]}),z.length>0&&x(re,{information:L,initRecommendList:z})]}),!L&&x(s,{type:`no-content`,text:O(`postDetailClient.postDeleted`)})]})})]})}export{w as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{useUserStore as e}from"../../../store/modules/user-store.mjs";import{gCommunityGetHotContentList as t,gContentGetHotVideoList as n}from"../../../service/generated/client.mjs";import{Image as r}from"../../ui/image.mjs";import{Box as i}from"../../ui/box.mjs";import{Text as a}from"../../ui/text.mjs";import{Skeleton as o}from"../../ui/skeleton.mjs";import{useRequest as s}from"../../../hooks/query/use-query.mjs";import{getPostDetailPagePath as c}from"../../../utils/tools.mjs";import l from"../../common/at-element/index.mjs";import{useCardDecoration as u}from"../../../hooks/use-card-decoration.mjs";import d from"../../ui/rate.mjs";import f from"./style.module.mjs";import{trackSearchMediaRecommendClick as p}from"./tracking.mjs";import{memo as m}from"react";import{jsx as h,jsxs as g}from"react/jsx-runtime";import{useTranslations as _}from"next-intl";import v from"next/link";const y=m(({list:e})=>{let t=_(`components.pages.search`),{getCalculationScore:n}=u();return e.length===0?h(i,{className:`w-[324px] h-auto border rounded-[12px] shrink-0 p-[12px]`,style:{background:`linear-gradient( 156deg, rgba(254,201,207,0.5) 0%, rgba(254,201,207,0.1) 100%)`,borderColor:`rgba(255,119,131,0.2)`},children:g(i,{children:[h(a,{className:`leading-[26px] block text-theme5 text-[18px] font-bold`,children:t(`hotRecommend.hotVideosTitle`)}),g(`div`,{className:`flex flex-col gap-[8px]`,children:[h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`})]})]})}):g(i,{className:`w-[324px] h-auto border rounded-[12px] shrink-0 p-[12px]`,style:{background:`linear-gradient( 156deg, rgba(254,201,207,0.5) 0%, rgba(254,201,207,0.1) 100%)`,borderColor:`rgba(255,119,131,0.2)`},children:[h(a,{className:`leading-[26px] block text-theme5 text-[18px] font-bold`,children:t(`hotRecommend.hotVideosTitle`)}),e.map((e,t)=>g(v,{className:`w-full flex items-center justify-between mt-[12px] shrink-0`,href:c({id:e.video_id,contentType:0}),onClick:()=>{p(String(e.video_id??``))},children:[g(i,{className:`w-[76px] h-[102px] rounded-[8px] overflow-hidden relative bg-bg2`,children:[h(r,{src:e.cover||``,fill:!0,alt:e.name||``,objectFit:`cover`}),h(i,{className:`w-[18px] h-[18px] rounded-tl-[8px] rounded-br-[8px] flex items-center justify-center overflow-hidden absolute left-0 top-0 z-[1]`,style:{background:t>2?`linear-gradient( 218deg, #909BB7 0%, #5D7198 100%)`:`linear-gradient( 175deg, #FD4C5E 0%, #F05D19 100%)`},children:h(a,{className:`text-[12px] leading-[12px] text-white`,children:t+1})})]}),g(i,{className:`flex-1 flex flex-col ml-[12px]`,children:[h(a,{className:`leading-[26px] text-text1 text-[18px] font-bold max-w-[200px] line-clamp-1 mb-[4px]`,children:e.name}),g(i,{className:`flex items-center`,style:{transform:`scale(0.6)`,transformOrigin:`left center`},children:[h(d,{allowHalf:!0,value:n({score:String(e.score??0)})}),h(a,{className:`ml-[8px] text-[24px] text-[#F59E0B] font-bold leading-[24px]`,children:e.score?(Number(e.score)/10).toFixed(1):0})]}),h(i,{className:`w-fit mt-[4px] h-[20px] leading-[20px] px-[6px] text-text2 text-[12px] bg-line1 rounded-[4px]`,children:e.cat_name})]})]},String(e.video_id??t)))]})}),b=m(({list:e})=>{let t=_(`components.pages.search`);return e.length===0?g(i,{className:`w-[324px] h-auto border rounded-[12px] shrink-0 p-[12px]`,style:{background:`linear-gradient( 156deg, rgba(153,215,255,0.5) 0%, rgba(153,215,255,0.1) 100%)`,borderColor:`rgba(31,167,255,0.2)`},children:[h(a,{className:`leading-[26px] block text-theme1 text-[18px] font-bold mb-[4px]`,children:t(`hotRecommend.hotPostsTitle`)}),g(`div`,{className:`flex flex-col gap-[8px]`,children:[h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`})]})]}):g(i,{className:`w-[324px] h-auto border rounded-[12px] shrink-0 p-[12px]`,style:{background:`linear-gradient( 156deg, rgba(153,215,255,0.5) 0%, rgba(153,215,255,0.1) 100%)`,borderColor:`rgba(31,167,255,0.2)`},children:[h(a,{className:`leading-[26px] block text-theme1 text-[18px] font-bold mb-[4px]`,children:t(`hotRecommend.hotPostsTitle`)}),e.map((e,t)=>g(v,{className:`w-full h-[48px] mt-[8px] flex items-center`,href:c({id:e.content_id,contentType:1}),onClick:()=>{p(String(e.content_id??``))},children:[g(a,{className:`text-[16px] leading-[24px] font-bold ${t<3?`text-theme1`:`text-text3`}`,children:[t+1,`.`]}),h(a,{className:`ml-[8px] text-[16px] text-text1 leading-[24px] line-clamp-1 max-w-[260px] ${f.hotInfoTitle}`,children:h(l,{text:e.title??``,atUsers:[]})})]},String(e.content_id??t)))]})});function x({isShow:r}){let{userInfo:a}=e(),{data:o}=s([`hotVideo`],()=>n({user_id:a.user_id})),c=o?.data?.hot_video_list??[],{data:l}=s([`hotContent`],()=>t({user_id:a.user_id})),u=l?.data?.hot_content_list??[];return r?g(i,{className:`w-full
|
|
2
|
+
"use client";import{useUserStore as e}from"../../../store/modules/user-store.mjs";import{gCommunityGetHotContentList as t,gContentGetHotVideoList as n}from"../../../service/generated/client.mjs";import{Image as r}from"../../ui/image.mjs";import{Box as i}from"../../ui/box.mjs";import{Text as a}from"../../ui/text.mjs";import{Skeleton as o}from"../../ui/skeleton.mjs";import{useRequest as s}from"../../../hooks/query/use-query.mjs";import{getPostDetailPagePath as c}from"../../../utils/tools.mjs";import l from"../../common/at-element/index.mjs";import{useCardDecoration as u}from"../../../hooks/use-card-decoration.mjs";import d from"../../ui/rate.mjs";import f from"./style.module.mjs";import{trackSearchMediaRecommendClick as p}from"./tracking.mjs";import{memo as m}from"react";import{jsx as h,jsxs as g}from"react/jsx-runtime";import{useTranslations as _}from"next-intl";import v from"next/link";const y=m(({list:e})=>{let t=_(`components.pages.search`),{getCalculationScore:n}=u();return e.length===0?h(i,{className:`w-[324px] h-auto border rounded-[12px] shrink-0 p-[12px]`,style:{background:`linear-gradient( 156deg, rgba(254,201,207,0.5) 0%, rgba(254,201,207,0.1) 100%)`,borderColor:`rgba(255,119,131,0.2)`},children:g(i,{children:[h(a,{className:`leading-[26px] block text-theme5 text-[18px] font-bold`,children:t(`hotRecommend.hotVideosTitle`)}),g(`div`,{className:`flex flex-col gap-[8px]`,children:[h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`})]})]})}):g(i,{className:`w-[324px] h-auto border rounded-[12px] shrink-0 p-[12px]`,style:{background:`linear-gradient( 156deg, rgba(254,201,207,0.5) 0%, rgba(254,201,207,0.1) 100%)`,borderColor:`rgba(255,119,131,0.2)`},children:[h(a,{className:`leading-[26px] block text-theme5 text-[18px] font-bold`,children:t(`hotRecommend.hotVideosTitle`)}),e.map((e,t)=>g(v,{className:`w-full flex items-center justify-between mt-[12px] shrink-0`,href:c({id:e.video_id,contentType:0}),onClick:()=>{p(String(e.video_id??``))},children:[g(i,{className:`w-[76px] h-[102px] rounded-[8px] overflow-hidden relative bg-bg2`,children:[h(r,{src:e.cover||``,fill:!0,alt:e.name||``,objectFit:`cover`}),h(i,{className:`w-[18px] h-[18px] rounded-tl-[8px] rounded-br-[8px] flex items-center justify-center overflow-hidden absolute left-0 top-0 z-[1]`,style:{background:t>2?`linear-gradient( 218deg, #909BB7 0%, #5D7198 100%)`:`linear-gradient( 175deg, #FD4C5E 0%, #F05D19 100%)`},children:h(a,{className:`text-[12px] leading-[12px] text-white`,children:t+1})})]}),g(i,{className:`flex-1 flex flex-col ml-[12px]`,children:[h(a,{className:`leading-[26px] text-text1 text-[18px] font-bold max-w-[200px] line-clamp-1 mb-[4px]`,children:e.name}),g(i,{className:`flex items-center`,style:{transform:`scale(0.6)`,transformOrigin:`left center`},children:[h(d,{allowHalf:!0,value:n({score:String(e.score??0)})}),h(a,{className:`ml-[8px] text-[24px] text-[#F59E0B] font-bold leading-[24px]`,children:e.score?(Number(e.score)/10).toFixed(1):0})]}),h(i,{className:`w-fit mt-[4px] h-[20px] leading-[20px] px-[6px] text-text2 text-[12px] bg-line1 rounded-[4px]`,children:e.cat_name})]})]},String(e.video_id??t)))]})}),b=m(({list:e})=>{let t=_(`components.pages.search`);return e.length===0?g(i,{className:`w-[324px] h-auto border rounded-[12px] shrink-0 p-[12px]`,style:{background:`linear-gradient( 156deg, rgba(153,215,255,0.5) 0%, rgba(153,215,255,0.1) 100%)`,borderColor:`rgba(31,167,255,0.2)`},children:[h(a,{className:`leading-[26px] block text-theme1 text-[18px] font-bold mb-[4px]`,children:t(`hotRecommend.hotPostsTitle`)}),g(`div`,{className:`flex flex-col gap-[8px]`,children:[h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`})]})]}):g(i,{className:`w-[324px] h-auto border rounded-[12px] shrink-0 p-[12px]`,style:{background:`linear-gradient( 156deg, rgba(153,215,255,0.5) 0%, rgba(153,215,255,0.1) 100%)`,borderColor:`rgba(31,167,255,0.2)`},children:[h(a,{className:`leading-[26px] block text-theme1 text-[18px] font-bold mb-[4px]`,children:t(`hotRecommend.hotPostsTitle`)}),e.map((e,t)=>g(v,{className:`w-full h-[48px] mt-[8px] flex items-center`,href:c({id:e.content_id,contentType:1}),onClick:()=>{p(String(e.content_id??``))},children:[g(a,{className:`text-[16px] leading-[24px] font-bold ${t<3?`text-theme1`:`text-text3`}`,children:[t+1,`.`]}),h(a,{className:`ml-[8px] text-[16px] text-text1 leading-[24px] line-clamp-1 max-w-[260px] ${f.hotInfoTitle}`,children:h(l,{text:e.title??``,atUsers:[]})})]},String(e.content_id??t)))]})});function x({isShow:r}){let{userInfo:a}=e(),{data:o}=s([`hotVideo`],()=>n({user_id:a.user_id})),c=o?.data?.hot_video_list??[],{data:l}=s([`hotContent`],()=>t({user_id:a.user_id})),u=l?.data?.hot_content_list??[];return r?g(i,{className:`w-full no-vw-x-16 flex gap-x-[12px] flex-nowrap pb-[24px] ${f.gScrollBoxX}`,children:[h(y,{list:c}),h(b,{list:u})]}):null}export{x as default};
|