@funhub/platform 0.1.101 → 0.1.102
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/components/biz/business/marquee/client.mjs +1 -1
- package/dist/components/biz/business/marquee/material.d.mts +1 -0
- package/dist/components/biz/business/marquee/schema.d.mts +1 -0
- package/dist/components/biz/business/marquee/schema.mjs +1 -1
- package/dist/components/biz/business/text-recommend/client.mjs +1 -1
- package/dist/components/pages/search/page-client.mjs +1 -1
- package/dist/components/pages/search-result/search-all.mjs +1 -1
- package/dist/components/pages/search-result/search-result-skeleton.mjs +2 -0
- package/dist/components/pages/video-list/video-list-item.mjs +1 -1
- package/dist/components/ui/badge.d.mts +1 -1
- package/dist/components/ui/button.d.mts +2 -2
- package/package.json +1 -1
|
@@ -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"../../../../assets/icons/right_arrow.mjs";import i from"../../../../assets/images/marquee.mjs";import a from"./marquee.module.mjs";import{defaultMarqueePeriod as o}from"./schema.mjs";import{useEffect as s,useMemo as c,useRef as l,useState as u}from"react";import{X as d}from"lucide-react";import{jsx as f,jsxs as p}from"react/jsx-runtime";import{useTranslations as m}from"next-intl";import{useRouter as h}from"next/navigation";const g=[];function
|
|
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"../../../../assets/icons/right_arrow.mjs";import i from"../../../../assets/images/marquee.mjs";import a from"./marquee.module.mjs";import{defaultMarqueePeriod as o}from"./schema.mjs";import{useEffect as s,useMemo as c,useRef as l,useState as u}from"react";import{X as d}from"lucide-react";import{jsx as f,jsxs as p}from"react/jsx-runtime";import{useTranslations as m}from"next-intl";import{useRouter as h}from"next/navigation";const g=[],_=`marquee_list`;let v=null;function y(e,t=20){let n=Array.from(e);return n.length<=t?e:`${n.slice(0,t).join(``)}...`}function b(e,t){if(!e)return!1;if(t===`once`)return!0;let n=new Date(e),r=new Date;return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()&&n.getDate()===r.getDate()}function x(){if(v)return v;let e=localStorage.getItem(_);if(!e)return v={},{};try{let t=JSON.parse(e);if(!t||typeof t!=`object`)return{};let n={};return Object.entries(t).forEach(([e,t])=>{if(!t||typeof t!=`object`)return;let r=t.closedAt;typeof r!=`number`||Number.isNaN(r)||(n[e]={closedAt:r})}),v=n,n}catch{return v={},{}}}function S(e){v=e,localStorage.setItem(_,JSON.stringify(e))}function C(e){return x()[e]??{}}function w(e,t){S({...x(),[e]:t})}function T(e,t){return b(e.closedAt,t)}function E(_){let v=m(`components.biz.business.marquee`),{marqueeKey:b,contents:x=g,click:S,close:E,displayStrategy:D,mode:O=`renderer`}=_,k=O===`editor`,A=h(),j=l(!1),[M,N]=u(k),[P,F]=u(k),[I,L]=u(!1),[R,z]=u(0);s(()=>{L(!0)},[]);let B=c(()=>{let e=D?.period??o,t=e.start,n=e.end;if(!t&&!n)return!0;let r=Date.now(),i=t?new Date(t).getTime():0,a=n?new Date(n).getTime():2**53-1;return r>=i&&r<=a},[D?.period]),V=c(()=>(x??[]).map(e=>({...e,text:y(String(e?.text??``))})).filter(e=>!!e.text),[x]),H=b?.trim()??``;if(s(()=>{z(0)},[c(()=>V.map(e=>`${e.text??``}::${e.link??``}`).join(`|`),[V]),H]),s(()=>{k||H||j.current||process.env.NODE_ENV===`production`||(j.current=!0,console.warn(`[MarqueeClient] marqueeKey is required in renderer mode.`))},[k,H]),s(()=>{if(I){if(k){N(!0),F(!0);return}if(!D?.rule||!B||V.length===0){N(!1),F(!0);return}if(!H){N(!1),F(!0);return}N(!T(C(H),D.rule)),F(!0)}},[D?.rule,k,I,B,V.length,H]),!k&&(!I||!P||!M||!B)||V.length===0)return null;let U=V[R%V.length],W=S?.enabled===!0,G=S?.link||U.link,K=W&&!!G,q=E?.enabled===!0;function J(){!H||!D?.rule||V.length===0||w(H,{...C(H),closedAt:Date.now()})}let Y=e=>{e.stopPropagation(),N(!1),J()},X=()=>{k||K&&G&&A.push(G)},Z=()=>{k||!M||V.length<=1||z(e=>(e+1)%V.length)},Q=k?a[`marquee-item-paused`]:V.length>1?a[`marquee-item-once`]:a[`marquee-item-loop`];return f(t,{className:k?`px-3 py-2 w-full bg-bg1 pointer-events-none`:`px-3 py-2 w-full bg-bg1`,children:p(t,{className:`pl-[2px] pr-[12px] py-[2px] flex items-center w-full cursor-pointer relative rounded-[8px] overflow-hidden ${a[`marquee-shell`]}`,onClick:X,children:[f(t,{className:`relative shrink-0 w-[36px] h-[36px] mr-[4px]`,children:f(e,{src:typeof i==`string`?i:i.src,alt:v(`noticeAlt`),fill:!0,className:`object-cover`,unoptimized:!0})}),f(t,{className:`flex-1 overflow-hidden relative h-[22px] ml-1`,children:f(t,{className:`absolute inset-y-0 left-0 flex items-center whitespace-nowrap ${Q}`,onAnimationEnd:Z,children:f(n,{className:`inline-block text-[14px] text-[#f59e0b] leading-[22px] font-medium`,children:U.text})},`marquee-item-${R}`)}),p(t,{className:`flex items-center gap-[12px] shrink-0 ml-[4px]`,children:[K&&f(r,{className:`w-[16px] h-[16px] text-[#f59e0b]`}),q&&f(t,{className:`opacity-30 hover:opacity-100 transition-opacity`,onClick:Y,children:f(d,{className:`w-[12px] h-[12px] text-[#F59E0B]`})})]})]})})}export{E as MarqueeClient};
|
|
@@ -12,6 +12,7 @@ import * as zod_v4_core0 from "zod/v4/core";
|
|
|
12
12
|
* 跑马灯物料定义
|
|
13
13
|
*/
|
|
14
14
|
declare const marqueeMaterial: DefineMaterialOption<typeof MarqueeServer, typeof MarqueeClient, zod.ZodObject<{
|
|
15
|
+
marqueeKey: zod.ZodString & SchemaHasDefaultValue;
|
|
15
16
|
contents: zod.ZodArray<zod.ZodObject<{
|
|
16
17
|
text: zod.ZodString & SchemaHasDefaultValue;
|
|
17
18
|
link: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
|
|
@@ -16,6 +16,7 @@ declare const defaultMarqueePeriod: {
|
|
|
16
16
|
* 跑马灯物料属性定义
|
|
17
17
|
*/
|
|
18
18
|
declare const marqueeInspectorPropsSchema: z.ZodObject<{
|
|
19
|
+
marqueeKey: z.ZodString & SchemaHasDefaultValue;
|
|
19
20
|
contents: z.ZodArray<z.ZodObject<{
|
|
20
21
|
text: z.ZodString & SchemaHasDefaultValue;
|
|
21
22
|
link: z.ZodOptional<z.ZodString> & SchemaHasDefaultValue;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{defineArrayItemPropSchema as e,defineComponentPropsSchema as t,defineObjectPropSchema as n,defineSelectEnumPropSchema as r,defineSwitchPropSchema as i,defineTextPropSchema as a,defineTimeRangePropSchema as o}from"../../../../utils/schema/schema.mjs";import{z as s}from"zod";import c from"dayjs";function l(){return{start:c().startOf(`day`).format(`YYYY-MM-DD HH:mm:ss`),end:c().endOf(`day`).format(`YYYY-MM-DD HH:mm:ss`)}}const u=l(),d=
|
|
2
|
+
import{defineArrayItemPropSchema as e,defineComponentPropsSchema as t,defineObjectPropSchema as n,defineSelectEnumPropSchema as r,defineSwitchPropSchema as i,defineTextPropSchema as a,defineTimeRangePropSchema as o}from"../../../../utils/schema/schema.mjs";import{z as s}from"zod";import c from"dayjs";function l(){return{start:c().startOf(`day`).format(`YYYY-MM-DD HH:mm:ss`),end:c().endOf(`day`).format(`YYYY-MM-DD HH:mm:ss`)}}const u=l(),d=s.object({text:a({label:`文本内容`,defaultValue:``}),link:a({label:`跳转链接`,defaultValue:``,required:!1})}),f=t({marqueeKey:a({label:`状态唯一标识`,defaultValue:``,required:!0,description:`外部传入唯一 marqueeKey,用于本地展示状态持久化`}),contents:e(d,{label:`消息内容`,defaultValue:[{text:`请输入跑马灯内容`}],description:`支持多条消息循环播放`}),click:n({enabled:i({label:`支持点击`,defaultValue:!0}),redirectType:r([`content_list`,`content`,`link`],{label:`跳转指向`,defaultValue:`link`,required:!1}),link:a({label:`跳转链接`,defaultValue:``,required:!1})},{label:`点击配置`,defaultValue:{enabled:!0,redirectType:`link`,link:``}}),close:n({enabled:i({label:`支持关闭`,defaultValue:!0})},{label:`关闭配置`,defaultValue:{enabled:!0}}),displayStrategy:n({rule:r([`once`,`daily`],{label:`展示规则`,defaultValue:`once`,description:`「只展示1次」即当前消息只展示1次;「每天展示1次」即当前消息每天展示1次,0点刷新`}),period:o({label:`展示周期`,defaultValue:u,required:!1})},{label:`展示策略`,defaultValue:{rule:`once`,period:u}})});export{u as defaultMarqueePeriod,l as getDefaultMarqueePeriod,f as marqueeInspectorPropsSchema};
|
|
@@ -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
|
|
2
|
+
"use client";import{Box as e}from"../../../ui/box.mjs";import{Text as t}from"../../../ui/text.mjs";import{useMemo as n,useState as r}from"react";import{jsx as i,jsxs as a}from"react/jsx-runtime";import{usePathname as o,useRouter as s,useSearchParams as c}from"next/navigation";const l=[];function u(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 d(d){let{title:f,items:p=l,onItemClick:m,mode:h=`renderer`}=d,g=h===`editor`,_=s(),v=o(),y=c(),[b,x]=r(0),S=n(()=>u(p,6),[p,b]);if(p.length===0)return null;let C=e=>{if(m){m(e);return}let t=new URLSearchParams(y.toString());t.set(`q`,e);let n=v.includes(`/search-result`)?v:`/search-result`;_.push(`${n}?${t.toString()}`)};return a(e,{className:`bg-bg1 p-3 flex flex-col gap-3 w-full${g?` pointer-events-none`:``}`,children:[i(e,{className:`flex items-center justify-between w-full`,children:i(t,{className:`text-[18px] font-bold text-text1 leading-[26px]`,children:f})}),i(e,{className:`grid grid-cols-2 gap-x-1 gap-y-1 w-full`,children:S.map((n,r)=>i(e,{className:`flex items-center h-[32px] cursor-pointer active:opacity-70 transition-opacity overflow-hidden`,onClick:()=>C(n.label),children:i(t,{className:`text-[14px] text-text1 leading-[22px] truncate w-full`,children:n.label})},`${b}-${r}`))})]})}export{d as TextRecommendClient};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{updateUrlParams as e}from"../../../utils/common.mjs";import t from"../../../utils/event-bus.mjs";import{useUserStore as n}from"../../../store/modules/user-store.mjs";import{gContentGetRecommendSearchList as r}from"../../../service/generated/client.mjs";import{Text as i}from"../../ui/text.mjs";import{useRequest as a}from"../../../hooks/query/use-query.mjs";import{eventKey as o}from"../../../constants/event-key.mjs";import{useSearchHistory as s}from"../../../hooks/use-search-history.mjs";import{SearchHistoryClient as c}from"../../biz/business/search-history/client.mjs";import l from"./hot-recommend.mjs";import u from"./hot-search.mjs";import d from"./search-result/index.mjs";import f from"./top-header.mjs";import{memo as p,useEffect as m,useMemo as h,useState as g}from"react";import{Fragment as _,jsx as v,jsxs as y}from"react/jsx-runtime";import{useTranslations as b}from"next-intl";import{usePathname as x,useRouter as S,useSearchParams as C}from"next/navigation";const w=[{labelKey:`tabs.all`,value:`all`},{labelKey:`tabs.video`,value:`video`},{labelKey:`tabs.post`,value:`info`},{labelKey:`tabs.user`,value:`user`}],T=p(({searchType:e,onChange:t,tabList:n})=>v(`nav`,{className:`w-full h-[42px] bg-bg1 flex items-center px-[3px] sticky top-[53px] left-0 z-50`,children:n.map(n=>v(i,{className:`h-[30px] rounded-[15px] leading-[30px] px-[9px] text-[16px] bg-transparent transition-all duration-150 ${e===n.value?`text-theme5 !text-[20px] font-bold`:`text-text2`}`,onClick:()=>{e!==n.value&&t(n.value)},children:n.label},n.value))}));function E(){let i=b(`components.pages.search.pageClient`),{userInfo:p}=n(),E=p?.user_id||`guest`,D=C(),O=x(),k=S(),A=D.get(`q`)?.toString()||``,j=A?decodeURIComponent(A):``,{data:M,refetch:N}=a([`hotSearchKey`],()=>r({user_id:E})),P=h(()=>M?.data?.recommend_list??[],[M]),[F,I]=g(j),L=h(()=>w.map(e=>({value:e.value,label:i(e.labelKey)})),[i]),[R,z]=g(j),[B,V]=g(0),[H,U]=g(w[0].value),[,W]=g([]),{history:G,addHistory:K}=s({storageKey:E}),q=h(()=>F.trim()===``?P.length>0||G.length>0||F.trim()===``:!1,[P,F,G]),J=h(()=>F.trim()!==``&&!q,[F,q]);return m(()=>(t.on(o.EXCHANGE_SEARCH_TYPE,U),()=>{t.off(o.EXCHANGE_SEARCH_TYPE,U)}),[U]),y(`div`,{className:`w-full min-h-screen bg-bg1 pb-[12px]`,children:[v(f,{setSearchInputVal:t=>{t!==F&&(W([]),I(t),e({q:t}))},initInputVal:R,initInputVersion:B,addSearchHistory:K}),q&&y(`div`,{className:`w-full pt-[8px]`,children:[G.length>0&&v(c,{title:i(`searchHistory`),rows:2,storageKey:E,onHistoryClick:e=>{z(e),V(e=>e+1);let t=new URLSearchParams(D.toString());t.set(`q`,e),k.push(`${O}?${t.toString()}`)}}),v(u,{initHotSearchKeywordList:P,onRefreshHotKey:async()=>(await N()).data??{code:0,message:``,data:{recommend_list:[]}},onClick:e=>{z(e.title||``),V(e=>e+1)}})]}),v(l,{isShow:F.trim()===``}),J&&y(_,{children:[v(T,{searchType:H,tabList:L,onChange:e=>{U(e),W([])}}),v(d,{inputVal:F,searchType:H},`${H}-${F}`)]})]})}export{E as default};
|
|
2
|
+
"use client";import{updateUrlParams as e}from"../../../utils/common.mjs";import t from"../../../utils/event-bus.mjs";import{useUserStore as n}from"../../../store/modules/user-store.mjs";import{gContentGetRecommendSearchList as r}from"../../../service/generated/client.mjs";import{Text as i}from"../../ui/text.mjs";import{useRequest as a}from"../../../hooks/query/use-query.mjs";import{eventKey as o}from"../../../constants/event-key.mjs";import{useSearchHistory as s}from"../../../hooks/use-search-history.mjs";import{SearchHistoryClient as c}from"../../biz/business/search-history/client.mjs";import l from"./hot-recommend.mjs";import u from"./hot-search.mjs";import d from"./search-result/index.mjs";import f from"./top-header.mjs";import{memo as p,useEffect as m,useMemo as h,useState as g}from"react";import{Fragment as _,jsx as v,jsxs as y}from"react/jsx-runtime";import{useTranslations as b}from"next-intl";import{usePathname as x,useRouter as S,useSearchParams as C}from"next/navigation";const w=[{labelKey:`tabs.all`,value:`all`},{labelKey:`tabs.video`,value:`video`},{labelKey:`tabs.post`,value:`info`},{labelKey:`tabs.user`,value:`user`}],T=p(({searchType:e,onChange:t,tabList:n})=>v(`nav`,{className:`w-full h-[42px] bg-bg1 flex items-center px-[3px] sticky top-[53px] left-0 z-50`,children:n.map(n=>v(i,{className:`h-[30px] rounded-[15px] leading-[30px] px-[9px] text-[16px] bg-transparent transition-all duration-150 ${e===n.value?`text-theme5 !text-[20px] font-bold`:`text-text2`}`,onClick:()=>{e!==n.value&&t(n.value)},children:n.label},n.value))}));function E(){let i=b(`components.pages.search.pageClient`),{userInfo:p}=n(),E=p?.user_id||`guest`,D=C(),O=x(),k=S(),A=D.get(`q`)?.toString()||``,j=A?decodeURIComponent(A):``,{data:M,refetch:N}=a([`hotSearchKey`],()=>r({user_id:E})),P=h(()=>M?.data?.recommend_list??[],[M]),[F,I]=g(j),L=h(()=>w.map(e=>({value:e.value,label:i(e.labelKey)})),[i]),[R,z]=g(j),[B,V]=g(0),[H,U]=g(w[0].value),[,W]=g([]),{history:G,addHistory:K}=s({storageKey:E}),q=h(()=>F.trim()===``?P.length>0||G.length>0||F.trim()===``:!1,[P,F,G]),J=h(()=>F.trim()!==``&&!q,[F,q]);return m(()=>(t.on(o.EXCHANGE_SEARCH_TYPE,U),()=>{t.off(o.EXCHANGE_SEARCH_TYPE,U)}),[U]),y(`div`,{className:`w-full min-h-screen bg-bg1 pb-[12px]`,children:[v(f,{setSearchInputVal:t=>{t!==F&&(W([]),I(t),e({q:t}))},initInputVal:R,initInputVersion:B,addSearchHistory:K}),q&&y(`div`,{className:`w-full pt-[8px]`,children:[G.length>0&&v(c,{title:i(`searchHistory`),rows:2,storageKey:E,onHistoryClick:e=>{z(e),V(e=>e+1);let t=new URLSearchParams(D.toString());t.set(`q`,e),k.push(`${O}?${t.toString()}`)}}),v(u,{initHotSearchKeywordList:P,onRefreshHotKey:async()=>(await N()).data??{code:0,message:``,data:{recommend_list:[]}},onClick:e=>{z(e.title||``),V(e=>e+1),K(e.title)}})]}),v(l,{isShow:F.trim()===``}),J&&y(_,{children:[v(T,{searchType:H,tabList:L,onChange:e=>{U(e),W([])}}),v(d,{inputVal:F,searchType:H},`${H}-${F}`)]})]})}export{E as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{gContentGetRecommendVideoList as e}from"../../../service/generated/client.mjs";import{gContentGetRecommendVideoListKey as t}from"../../../service/generated/tanstack.mjs";import{Box as n}from"../../ui/box.mjs";import{List as r}from"../../ui/list.mjs";import{useRequest as i}from"../../../hooks/query/use-query.mjs";import a from"./search-user.mjs";import
|
|
2
|
+
"use client";import{gContentGetRecommendVideoList as e}from"../../../service/generated/client.mjs";import{gContentGetRecommendVideoListKey as t}from"../../../service/generated/tanstack.mjs";import{Box as n}from"../../ui/box.mjs";import{List as r}from"../../ui/list.mjs";import{useRequest as i}from"../../../hooks/query/use-query.mjs";import{SearchResultSkeleton as a}from"./search-result-skeleton.mjs";import o from"./search-user.mjs";import s from"./search-video.mjs";import{useMemo as c}from"react";import{jsx as l,jsxs as u}from"react/jsx-runtime";import{useTranslations as d}from"next-intl";function f(e,t=1){return JSON.stringify({type:1,keywords:e,sort:t})}function p({searchInputVal:p,sort:m,refreshVersion:h}){let g=d(`components.pages.search.searchResult`),_=c(()=>f(p,m),[p,m]),{data:v,isFetching:y,isLoading:b}=i(c(()=>[...t({data_type:2,extra_params:_,page:1,page_size:10}),h],[h,_]),async()=>(await e({data_type:2,extra_params:_,page:1,page_size:10})).data??{}),x=c(()=>v?.videos?.list??[],[v]),S=c(()=>!!v?.videos?.has_more,[v]),C=c(()=>v?.users?.list??[],[v]),w=x.length===0&&C.length===0&&!y;return x.length===0&&C.length===0&&(b||y)?l(a,{}):w?l(n,{className:`w-full pt-[12px]`,children:l(r,{loading:y,empty:`nodata`,emptyText:g(`searchAll.emptyResult`)})}):u(n,{className:`w-full pt-[12px]`,children:[C.length>0&&l(o,{mode:`all`,list:C}),l(s,{mode:`all`,list:x,hasMore:S})]})}export{p as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
|
|
2
|
+
"use client";import{Box as e}from"../../ui/box.mjs";import{VideoListItemSkeleton as t}from"../../common/skeleton/video-list-item-skeleton.mjs";import{jsx as n}from"react/jsx-runtime";function r({count:r=6}){return n(e,{className:`w-full pt-[12px] bg-bg1`,children:Array.from({length:r}).map((e,r)=>n(t,{isEditMode:!1,showVideoProgress:!1},`search-result-skeleton-${r}`))})}export{r as SearchResultSkeleton};
|
|
@@ -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{memo as r,useMemo as i}from"react";import{jsx as a,jsxs as o}from"react/jsx-runtime";const s=r(({item:r})=>{let s=r.img_x??r.img_y??``,c=r.name??r.id??``;function l(e){if(!Number.isFinite(e)||e<=0)return``;let t=Math.floor(e),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60,a=e=>String(e).padStart(2,`0`);return n>0?`${a(n)}:${a(r)}:${a(i)}`:`${a(r)}:${a(i)}`}let u=i(()=>{let e=r.static?.browse_cnt??0;if(!Number.isFinite(e)||e<=0)return
|
|
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{memo as r,useMemo as i}from"react";import{jsx as a,jsxs as o}from"react/jsx-runtime";const s=r(({item:r})=>{let s=r.img_x??r.img_y??``,c=r.name??r.id??``;function l(e){if(!Number.isFinite(e)||e<=0)return``;let t=Math.floor(e),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60,a=e=>String(e).padStart(2,`0`);return n>0?`${a(n)}:${a(r)}:${a(i)}`:`${a(r)}:${a(i)}`}let u=i(()=>{let e=r.static?.browse_cnt??0;if(!Number.isFinite(e)||e<=0)return 0;if(e>=1e6){let t=(e/1e6).toFixed(1);return t.endsWith(`.0`)?`${t.slice(0,-2)}M`:`${t}M`}if(e>=1e3){let t=(e/1e3).toFixed(1);return t.endsWith(`.0`)?`${t.slice(0,-2)}k`:`${t}k`}return Math.floor(e).toString()},[r]),d=i(()=>{let{type:e,duration:t,links:n}=r;if(e===1)return l(t??0);if(e===2)return`全${n?.length??0}集`},[r]);return o(t,{className:`overflow-hidden rounded-[8px] shadow-sm relative`,children:[s?a(t,{className:`relative w-full aspect-video h-[240px]`,children:a(e,{src:s,alt:c,fill:!0,className:`object-cover`})}):null,a(t,{className:`py-[8px]`,children:a(n,{as:`h3`,className:`line-clamp-1 text-[16px] text-bold text-text1`,children:c})}),o(t,{className:`absolute z-[2] bottom-10 left-1 rounded-xs bg-black/60 px-1 text-[10px] text-white flex items-center gap-1`,children:[a(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`10`,viewBox:`0 0 12 10`,fill:`none`,className:`shrink-0`,"aria-hidden":!0,children:a(`path`,{d:`M7.56 5.18437L5.013 6.56737C4.893 6.63337 4.761 6.66937 4.638 6.66937C4.269 6.66937 4.002 6.38737 4.002 5.99737V3.28237C4.002 2.89237 4.269 2.61037 4.638 2.61037C4.764 2.61037 4.893 2.64637 5.013 2.70937L7.572 4.09237C7.803 4.21837 7.938 4.41637 7.938 4.63237C7.938 4.85137 7.8 5.05537 7.56 5.18437ZM9.807 9.27637L2.133 8.52937C0.954 8.52937 0 7.57537 0 6.39637V2.79937C0 1.62037 0.954 0.666368 2.133 0.666368L9.81 0.000367165C10.989 0.000367165 11.943 0.954367 11.943 2.13337V7.14337C11.9422 7.70935 11.7168 8.25188 11.3163 8.65181C10.9158 9.05174 10.373 9.27637 9.807 9.27637ZM10.875 2.13337C10.875 1.99351 10.8475 1.85502 10.7939 1.72581C10.7404 1.5966 10.662 1.47919 10.5631 1.3803C10.4642 1.2814 10.3468 1.20296 10.2176 1.14944C10.0883 1.09591 9.94986 1.06837 9.81 1.06837L2.133 1.73437C1.99314 1.73437 1.85465 1.76191 1.72544 1.81544C1.59623 1.86896 1.47883 1.9474 1.37993 2.0463C1.28104 2.14519 1.20259 2.2626 1.14907 2.39181C1.09555 2.52102 1.068 2.65951 1.068 2.79937V6.39637C1.068 6.67882 1.1802 6.94971 1.37993 7.14944C1.57966 7.34916 1.85054 7.46137 2.133 7.46137L9.807 8.20837C9.94686 8.20837 10.0853 8.18082 10.2146 8.1273C10.3438 8.07378 10.4612 7.99533 10.5601 7.89644C10.659 7.79754 10.7374 7.68014 10.7909 7.55093C10.8445 7.42171 10.872 7.28323 10.872 7.14337V2.13337H10.875Z`,fill:`white`})}),a(n,{className:`text-white text-[12px] leading-[20px]`,children:u})]}),d&&a(t,{className:`absolute z-[2] bottom-10 right-1`,children:a(n,{className:`text-white text-[12px] leading-[20px]`,children:d})})]})});export{s as VideoListItemComponent};
|
|
@@ -6,7 +6,7 @@ import * as class_variance_authority_types0 from "class-variance-authority/types
|
|
|
6
6
|
//#region components/ui/badge.d.ts
|
|
7
7
|
/** badgeVariants 工具定义。 */
|
|
8
8
|
declare const badgeVariants: (props?: ({
|
|
9
|
-
variant?: "
|
|
9
|
+
variant?: "default" | "link" | "outline" | "secondary" | "ghost" | "destructive" | null | undefined;
|
|
10
10
|
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
11
11
|
/** Badge 组件。 */
|
|
12
12
|
declare function Badge({
|
|
@@ -7,8 +7,8 @@ import * as class_variance_authority_types0 from "class-variance-authority/types
|
|
|
7
7
|
//#region components/ui/button.d.ts
|
|
8
8
|
/** buttonVariants 工具定义。 */
|
|
9
9
|
declare const buttonVariants: (props?: ({
|
|
10
|
-
variant?: "
|
|
11
|
-
size?: "default" | "
|
|
10
|
+
variant?: "default" | "link" | "outline" | "secondary" | "ghost" | "destructive" | null | undefined;
|
|
11
|
+
size?: "default" | "icon" | "xs" | "sm" | "lg" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
12
12
|
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
13
13
|
/** Button 组件属性。 */
|
|
14
14
|
type ButtonProps = Button.Props & VariantProps<typeof buttonVariants> & {
|