@funhub/platform 0.1.44 → 0.1.45

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.
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{mergeStyles as e}from"../../utils/styles/helpers.mjs";import{Box as t}from"../../../ui/box.mjs";import n from"../../../ui/link.mjs";import{urlPrefix as r}from"../../../../constants/url-prefix.mjs";import{useSticky as i}from"../../../../hooks/use-sticky.mjs";import a,{loadHiddenChannelIdsFromStorage as o}from"./channel-filter-dialog.mjs";import{defaultProps as s}from"./default-props.mjs";import{clsx as c}from"clsx";import{useEffect as l,useMemo as u,useState as d}from"react";import{Fragment as f,jsx as p,jsxs as m}from"react/jsx-runtime";const h={};function g(e,t){return t===0?`/`:`${r.CHANNEL}/${encodeURIComponent(e.name)}`}function _(r){let{mode:_=`renderer`,styles:v,events:y,...b}=r,x=_===`editor`,S=b||h,C={...s,...S},[w,T]=d(!1),{isSticky:E,ref:D}=i(),[O,k]=d(C.list),A=u(()=>C.currentChannelId??null,[C.currentChannelId]);l(()=>{let e=o();k(e?.length?C.list.filter(t=>!e.includes(t.name)):C.list)},[C.list]);let j=e=>{k(e)},M=(e,t)=>{y?.onChannelChange?.(e,t)},N=v?e(v,{}):void 0;return m(f,{children:[E&&p(t,{className:`w-full h-11`}),p(t,{as:`nav`,ref:D,className:c(`w-full transition-all duration-200`,x&&`pointer-events-none`,!C.isFullfeed&&E&&`fixed top-0 left-0 right-0 z-50`,C.isFullfeed&&`fixed top-[54px] left-0 z-10 w-full`,!C.isFullfeed&&`bg-bg1`),style:N,children:p(t,{className:`relative flex items-center h-[44px]`,children:p(t,{className:`flex-1 overflow-x-auto overflow-y-hidden [&::-webkit-scrollbar]:hidden`,style:{scrollbarWidth:`none`,msOverflowStyle:`none`,WebkitOverflowScrolling:`touch`},children:p(t,{className:`flex items-center h-full w-4 h-4 gap-4`,children:O.map((e,t)=>{let r=A===e.name||A===null&&t===0;return p(n,{href:g(e,t),className:c(`whitespace-nowrap cursor-pointer transition-all duration-200`,`flex items-center justify-center h-11`,`${r?`text-xl`:`text-base`}`),style:{fontWeight:r?`bold`:`normal`,color:r?`var(--color-theme5)`:`var(--color-text2)`},onClick:()=>M(e,t),children:e.name},e.name||`channel-${t}`)})})})})}),p(a,{open:w,onOpenChange:T,channels:C.list,currentChannelId:A,onChannelClick:M,onChannelsChange:j})]})}export{_ as default};
2
+ "use client";import{mergeStyles as e}from"../../utils/styles/helpers.mjs";import{Box as t}from"../../../ui/box.mjs";import n from"../../../ui/link.mjs";import{urlPrefix as r}from"../../../../constants/url-prefix.mjs";import{useSticky as i}from"../../../../hooks/use-sticky.mjs";import a,{loadHiddenChannelIdsFromStorage as o}from"./channel-filter-dialog.mjs";import{defaultProps as s}from"./default-props.mjs";import{clsx as c}from"clsx";import{useEffect as l,useMemo as u,useState as d}from"react";import{Fragment as f,jsx as p,jsxs as m}from"react/jsx-runtime";const h={};function g(e,t){return t===0?`/`:`${r.CHANNEL}/${encodeURIComponent(e.name)}`}function _(r){let{mode:_=`renderer`,styles:v,events:y,...b}=r,x=_===`editor`,S=b||h,C={...s,...S},[w,T]=d(!1),{isSticky:E,ref:D}=i(),[O,k]=d(C.list),A=u(()=>C.list.find(e=>e.isDefault)?.name??null,[C.list]),j=u(()=>C.currentChannelId??A,[C.currentChannelId,A]);l(()=>{let e=o();k(e?.length?C.list.filter(t=>!e.includes(t.name)):C.list)},[C.list]);let M=e=>{k(e)},N=(e,t)=>{y?.onChannelChange?.(e,t)},P=v?e(v,{}):void 0;return m(f,{children:[E&&p(t,{className:`w-full h-11`}),p(t,{as:`nav`,ref:D,className:c(`w-full transition-all duration-200`,x&&`pointer-events-none`,!C.isFullfeed&&E&&`fixed top-0 left-0 right-0 z-50`,C.isFullfeed&&`fixed top-[54px] left-0 z-10 w-full`,!C.isFullfeed&&`bg-bg1`),style:P,children:p(t,{className:`relative flex items-center h-[44px]`,children:p(t,{className:`flex-1 overflow-x-auto overflow-y-hidden [&::-webkit-scrollbar]:hidden`,style:{scrollbarWidth:`none`,msOverflowStyle:`none`,WebkitOverflowScrolling:`touch`},children:p(t,{className:`flex items-center h-full w-4 h-4 gap-4`,children:O.map((e,t)=>{let r=j===e.name||j===null&&t===0;return p(n,{href:g(e,t),className:c(`whitespace-nowrap cursor-pointer transition-all duration-200`,`flex items-center justify-center h-11`,`${r?`text-xl`:`text-base`}`),style:{fontWeight:r?`bold`:`normal`,color:r?`var(--color-theme5)`:`var(--color-text2)`},onClick:()=>N(e,t),children:e.name},e.name||`channel-${t}`)})})})})}),p(a,{open:w,onOpenChange:T,channels:C.list,currentChannelId:j,onChannelClick:N,onChannelsChange:M})]})}export{_ as default};
@@ -1,2 +1,2 @@
1
1
 
2
- import{Image as e}from"../../../ui/image.mjs";import{Box as t}from"../../../ui/box.mjs";import{Text as n}from"../../../ui/text.mjs";import r from"../../../ui/link.mjs";import i from"../../../../assets/icons/view.mjs";import{jsx as a,jsxs as o}from"react/jsx-runtime";function s(e){if(e.duration===void 0||e.duration===null||e.duration===``)return null;let t=String(e.duration);if(t.includes(`集`))return t.startsWith(`全`)?t:`全${t.replace(/\D/g,``)}集`;let n=Number(e.duration);if(!Number.isNaN(n)&&n>0){let e=Math.floor(n),t=Math.floor(e/3600),r=Math.floor(e%3600/60),i=e%60,a=e=>String(e).padStart(2,`0`);return t>0?`${a(t)}:${a(r)}:${a(i)}`:`${a(r)}:${a(i)}`}return String(e.duration)}function c(e){if(e==null||e===``)return null;let t=Number(e);if(Number.isNaN(t))return String(e);if(t<1e3)return String(t);if(t<1e6){let e=(t/1e3).toFixed(1);return e.endsWith(`.0`)?`${e.slice(0,-2)}K`:`${e}K`}else{let e=(t/1e6).toFixed(1);return e.endsWith(`.0`)?`${e.slice(0,-2)}M`:`${e}M`}}function l(e,t,n){return t===`showPlayCount`?e.showPlayCount??n:t===`showEpisode`?e.showEpisode??n:n}function u(e){if(!l(e,`showPlayCount`,!0))return;let t=e.playCount,n=Number(e.playCountDelta??0);if(t==null||t===``)return t;let r=Number(t);return Number.isNaN(r)?t:r+(Number.isNaN(n)?0:n)}function d(e){let t=e.tag_image||e.tag_image_url||e.tagImage||e.tagImageUrl;return t?String(t):null}function f({data:f}){return f?a(t,{children:(Array.isArray(f)?f:[f]).map(f=>{let p=f.id?`/video/${f.id}/${f.title?encodeURIComponent(f.title):``}`:`#`,m=(e=>e===1?{text:`新剧`,fromColor:`#FD4C5E`,toColor:`#F05D19`,textColor:`#FFFFFF`}:e===2?{text:`热门`,fromColor:`#FFE485`,toColor:`#CF8125`,textColor:`#674100`}:null)(f.superscript),h=f.tag||m?.text,g=d(f),_=m?{from:m.fromColor,to:m.toColor,text:m.textColor}:{from:`#FD4C5E`,to:`#F05D19`,text:`#FFFFFF`},v=l(f,`showEpisode`,!0)?s(f):null,y=c(u(f));return a(t,{children:o(r,{href:p,children:[o(t,{className:`relative w-full overflow-hidden rounded-[12px] bg-neutral-800`,style:{aspectRatio:`16/9`},children:[f.cover&&a(e,{src:f.cover,alt:f.title,fill:!0,objectFit:`cover`}),g&&a(t,{className:`absolute right-0 top-0 z-10 h-[24px] w-[64px]`,children:a(e,{src:g,alt:f.title,fill:!0,objectFit:`contain`,style:{objectPosition:`right top`}})}),!g&&h&&a(t,{className:`absolute right-0 top-0 flex items-center justify-center z-10`,style:{height:`24px`,padding:`0 10px`,borderTopRightRadius:`12px`,borderBottomLeftRadius:`18px`,background:`linear-gradient(to right, ${_.from}, ${_.to})`,color:_.text},children:a(n,{as:`span`,className:`text-[13px] font-medium leading-none`,children:h})}),a(t,{className:`absolute inset-x-0 bottom-0 h-[40px] bg-gradient-to-t from-black/80 to-transparent z-0 pointer-events-none`}),y&&o(t,{className:`absolute bottom-0 left-[8px] mb-[6px] z-10 flex items-center gap-[4px]`,children:[a(i,{className:`h-[14px] w-[14px] text-white`}),a(n,{as:`span`,className:`text-[12px] font-medium text-white drop-shadow-md`,children:y})]}),v&&a(t,{className:`absolute bottom-0 right-[8px] mb-[6px] z-10 flex items-center`,children:a(n,{as:`span`,className:`text-[12px] font-medium text-white drop-shadow-md`,children:v})})]}),o(t,{className:`flex items-center justify-between gap-[12px] pt-[10px] px-2`,children:[o(t,{className:`flex-1 min-w-0`,children:[a(n,{as:`h3`,className:`text-[16px] font-semibold leading-[24px] text-text1 line-clamp-1`,children:f.title}),f.desc&&a(n,{as:`p`,className:`mt-[4px] text-[13px] leading-[20px] text-text2 line-clamp-1`,children:f.desc})]}),a(n,{className:`shrink-0 rounded-[20px] border border-[#FD4C5E] px-[24px] py-[8px] text-[14px] font-normal text-[#FD4C5E]`,children:`观看`})]})]})},f.id||f.title)})}):null}export{f as LargeGridItemClient};
2
+ import{Image as e}from"../../../ui/image.mjs";import{Box as t}from"../../../ui/box.mjs";import{Text as n}from"../../../ui/text.mjs";import r from"../../../ui/link.mjs";import i from"../../../../assets/icons/view.mjs";import{jsx as a,jsxs as o}from"react/jsx-runtime";function s(e){if(e.episodeText===void 0||e.episodeText===null||e.episodeText===``)return null;let t=String(e.episodeText).trim();if(!t)return null;if(t===`已完结`||t===`连载中`)return t;let n=Number(t);return Number.isFinite(n)&&n>0?`全${Math.floor(n)}集`:/^全\d+集$/.test(t)?t:null}function c(e){if(e==null||e===``)return null;let t=Number(e);if(Number.isNaN(t))return String(e);if(t<1e3)return String(t);if(t<1e6){let e=(t/1e3).toFixed(1);return e.endsWith(`.0`)?`${e.slice(0,-2)}K`:`${e}K`}else{let e=(t/1e6).toFixed(1);return e.endsWith(`.0`)?`${e.slice(0,-2)}M`:`${e}M`}}function l(e,t,n){return t===`showPlayCount`?e.showPlayCount??n:t===`showEpisode`?e.showEpisode??n:n}function u(e){if(l(e,`showPlayCount`,!0))return e.playCount}function d(e){let t=e.tagImageUrl;return t?String(t):null}function f({data:f}){return f?a(t,{children:(Array.isArray(f)?f:[f]).map(f=>{let p=f.id?`/video/${f.id}/${f.title?encodeURIComponent(f.title):``}`:`#`,m=d(f),h=l(f,`showEpisode`,!0)?s(f):null,g=c(u(f));return a(t,{children:o(r,{href:p,children:[o(t,{className:`relative w-full overflow-hidden rounded-[12px] bg-neutral-800`,style:{aspectRatio:`16/9`},children:[f.cover&&a(e,{src:f.cover,alt:f.title,fill:!0,objectFit:`cover`}),m&&a(t,{className:`absolute right-0 top-0 z-10 h-[37px] w-[20px] overflow-hidden`,style:{borderRadius:`0 8px`},children:a(e,{src:m,alt:f.title,fill:!0,objectFit:`cover`})}),a(t,{className:`absolute inset-x-0 bottom-0 h-[40px] bg-gradient-to-t from-black/80 to-transparent z-0 pointer-events-none`}),g&&o(t,{className:`absolute bottom-0 left-[8px] mb-[6px] z-10 flex items-center gap-[4px]`,children:[a(i,{className:`h-[14px] w-[14px] text-white`}),a(n,{as:`span`,className:`text-[12px] font-medium text-white drop-shadow-md`,children:g})]}),h&&a(t,{className:`absolute bottom-0 right-[8px] mb-[6px] z-10 flex items-center`,children:a(n,{as:`span`,className:`text-[12px] font-medium text-white drop-shadow-md`,children:h})})]}),o(t,{className:`flex items-center justify-between gap-[12px] pt-[10px] px-2`,children:[o(t,{className:`flex-1 min-w-0`,children:[a(n,{as:`h3`,className:`text-[16px] font-semibold leading-[24px] text-text1 line-clamp-1`,children:f.title}),f.desc&&a(n,{as:`p`,className:`mt-[4px] text-[13px] leading-[20px] text-text2 line-clamp-1`,children:f.desc})]}),a(n,{className:`shrink-0 rounded-[20px] border border-[#FD4C5E] px-[24px] py-[8px] text-[14px] font-normal text-[#FD4C5E]`,children:`观看`})]})]})},f.id||f.title)})}):null}export{f as LargeGridItemClient};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{Box as e}from"../../../ui/box.mjs";import{Text as t}from"../../../ui/text.mjs";import n from"../../../ui/link.mjs";import r from"../../../../assets/icons/common/right_arrow.mjs";import{LargeGridItemClient as i}from"./card-item.mjs";import{largeFeatureGridInspectorDefaultProps as a}from"./schema.mjs";import{jsx as o,jsxs as s}from"react/jsx-runtime";const c=[],l=a.data??[];function u(e){return e==null||e===``}function d(e,t){return u(e)?t:e}function f(e,t){return t?{...e,...t,id:d(t.id,e.id),cover:d(t.cover,e.cover),title:d(t.title,e.title),desc:d(t.desc,e.desc),tag:d(t.tag,e.tag),superscript:t.superscript??e.superscript,playCount:d(t.playCount,e.playCount),playCountDelta:t.playCountDelta??e.playCountDelta,showPlayCount:t.showPlayCount??e.showPlayCount,duration:d(t.duration,e.duration),showEpisode:t.showEpisode??e.showEpisode,useContentCover:t.useContentCover??e.useContentCover,tagImageUrl:d(t.tagImageUrl,e.tagImageUrl),tag_image:d(t.tag_image,e.tag_image),tag_image_url:d(t.tag_image_url,e.tag_image_url),tagImage:d(t.tagImage,e.tagImage)}:e}function p(e,t){if(!t)return e;let n=e.items;return{...e,...t,title:d(t.title,e.title),moreUrl:d(t.moreUrl,e.moreUrl),moreLinkType:t.moreLinkType??e.moreLinkType,recommendMode:t.recommendMode??e.recommendMode,items:n?f(n,t.items):t.items}}function m({mode:a=`renderer`,data:u=c}){let d=a===`editor`,f=u??c,m=Array.isArray(f)&&f.length>0?[p(l[0],f[0])]:l;if(!m||m.length===0)return null;let h=m[0],g=h?.title,_=h?.moreUrl;return s(e,{className:d?`p-3 pointer-events-none`:`p-3`,children:[s(e,{className:`flex items-center justify-between mb-[10px] h-[24px]`,children:[g&&o(t,{as:`h2`,className:`text-[18px] font-bold text-text1 line-clamp-1 flex-1 min-w-0 mr-[12px]`,children:g}),_&&s(n,{href:_,className:`flex items-center text-[14px] text-text2 ml-auto`,children:[`更多`,o(r,{className:`ml-[2px] h-[12px] w-[12px] text-text2`})]})]}),m.map((t,n)=>{let{items:r}=t;return r?o(e,{className:n>0?`mt-3`:``,children:o(i,{data:r})},`large-feature-grid-items-${n}`):null})]})}export{m as LargeFeatureGridClient};
2
+ "use client";import{Box as e}from"../../../ui/box.mjs";import{Text as t}from"../../../ui/text.mjs";import n from"../../../ui/link.mjs";import r from"../../../../assets/icons/common/right_arrow.mjs";import{LargeGridItemClient as i}from"./card-item.mjs";import{largeFeatureGridInspectorDefaultProps as a}from"./schema.mjs";import{jsx as o,jsxs as s}from"react/jsx-runtime";const c=[],l=a.data??[];function u(e){return e==null||e===``}function d(e,t){return u(e)?t:e}function f(e,t){return t?{...e,...t,id:d(t.id,e.id),cover:d(t.cover,e.cover),title:d(t.title,e.title),desc:d(t.desc,e.desc),playCount:d(t.playCount,e.playCount),showPlayCount:t.showPlayCount??e.showPlayCount,episodeText:d(t.episodeText,e.episodeText),showEpisode:t.showEpisode??e.showEpisode,useContentCover:t.useContentCover??e.useContentCover,tagImageUrl:d(t.tagImageUrl,e.tagImageUrl)}:e}function p(e,t){if(!t)return e;let n=e.items;return{...e,...t,title:d(t.title,e.title),moreUrl:d(t.moreUrl,e.moreUrl),moreLinkType:t.moreLinkType??e.moreLinkType,items:n?f(n,t.items):t.items}}function m({mode:a=`renderer`,data:u=c}){let d=a===`editor`,f=u??c,m=Array.isArray(f)&&f.length>0?[p(l[0],f[0])]:l;if(!m||m.length===0)return null;let h=m[0],g=h?.title,_=h?.moreUrl;return s(e,{className:d?`p-3 pointer-events-none`:`p-3`,children:[s(e,{className:`flex items-center justify-between mb-[10px] h-[24px]`,children:[g&&o(t,{as:`h2`,className:`text-[18px] font-bold text-text1 line-clamp-1 flex-1 min-w-0 mr-[12px]`,children:g}),_&&s(n,{href:_,className:`flex items-center text-[14px] text-text2 ml-auto`,children:[`更多`,o(r,{className:`ml-[2px] h-[12px] w-[12px] text-text2`})]})]}),m.map((t,n)=>{let{items:r}=t;return r?o(e,{className:n>0?`mt-3`:``,children:o(i,{data:r})},`large-feature-grid-items-${n}`):null})]})}export{m as LargeFeatureGridClient};
@@ -1,42 +1,12 @@
1
1
 
2
- import { SchemaHasDefaultValue } from "../../../../utils/schema/schema.mjs";
3
2
  import { DefineMaterialOption } from "../../../../utils/schema/material.mjs";
4
- import "../../../../utils/schema/index.mjs";
5
- import { LargeFeatureGridClient } from "./client.mjs";
6
- import { LargeFeatureGrid } from "./server.mjs";
3
+ import * as react from "react";
7
4
  import * as zod from "zod";
8
5
  import * as zod_v4_core0 from "zod/v4/core";
9
6
 
10
7
  //#region components/biz/business/large-feature-grid/material.d.ts
11
- declare const largeFeatureGridMaterial: DefineMaterialOption<typeof LargeFeatureGrid, typeof LargeFeatureGridClient, zod.ZodObject<{
12
- data: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
13
- title: zod.ZodOptional<zod.ZodString>;
14
- moreUrl: zod.ZodOptional<zod.ZodString>;
15
- moreLinkType: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
16
- recommendMode: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
17
- items: zod.ZodObject<{
18
- id: zod.ZodString;
19
- cover: zod.ZodString;
20
- tag: zod.ZodOptional<zod.ZodString>;
21
- playCount: zod.ZodOptional<zod.ZodString>;
22
- playCountDelta: zod.ZodOptional<zod.ZodNumber> & SchemaHasDefaultValue;
23
- showPlayCount: zod.ZodOptional<zod.ZodBoolean> & SchemaHasDefaultValue;
24
- duration: zod.ZodOptional<zod.ZodString>;
25
- showEpisode: zod.ZodOptional<zod.ZodBoolean> & SchemaHasDefaultValue;
26
- useContentCover: zod.ZodOptional<zod.ZodBoolean> & SchemaHasDefaultValue;
27
- title: zod.ZodString;
28
- desc: zod.ZodOptional<zod.ZodString>;
29
- tagImageUrl: zod.ZodOptional<zod.ZodString>;
30
- mode: zod.ZodOptional<zod.ZodEnum<{
31
- renderer: "renderer";
32
- editor: "editor";
33
- }>>;
34
- }, zod_v4_core0.$strip>;
35
- }, zod_v4_core0.$strip>>> & SchemaHasDefaultValue;
36
- mode: zod.ZodOptional<zod.ZodEnum<{
37
- renderer: "renderer";
38
- editor: "editor";
39
- }>>;
40
- }, zod_v4_core0.$strip>, "large-feature-grid">;
8
+ declare const largeFeatureGridMaterial: DefineMaterialOption<react.ComponentType<any>, react.ComponentType<any>, zod.ZodObject<Readonly<{
9
+ [k: string]: zod_v4_core0.$ZodType<unknown, unknown, zod_v4_core0.$ZodTypeInternals<unknown, unknown>>;
10
+ }>, zod_v4_core0.$strip>, string>;
41
11
  //#endregion
42
12
  export { largeFeatureGridMaterial };
@@ -1,2 +1,2 @@
1
1
 
2
- import{defineArrayItemPropSchema as e,defineComponentPropsSchema as t,defineNumberPropSchema as n,defineSwitchPropSchema as r,defineTextPropSchema as i,getSchemaDefaultProps as a}from"../../../../utils/schema/schema.mjs";import o from"zod";const s=t({data:e(o.object({title:i({label:`推荐位名称`,required:!1}),moreUrl:i({label:`更多链接`,required:!1}),moreLinkType:i({label:`更多链接类型`,required:!1,defaultValue:`content-list`}),recommendMode:i({label:`推荐位内容类型`,required:!1,defaultValue:`content`}),items:t({id:i({label:`内容ID`}),cover:i({label:`封面`}),tag:i({label:`角标文案`,required:!1}),playCount:i({label:`播放量`,required:!1}),playCountDelta:n({label:`播放量增量`,required:!1,defaultValue:0}),showPlayCount:r({label:`展示播放量`,required:!1,defaultValue:!0}),duration:i({label:`时长/集数`,required:!1}),showEpisode:r({label:`展示集数`,required:!1,defaultValue:!0}),useContentCover:r({label:`沿用内容海报`,required:!1,defaultValue:!0}),title:i({label:`内容标题`}),desc:i({label:`内容简介`,required:!1}),tagImageUrl:i({label:`角标图`,required:!1})})}),{label:`大图推荐数据`,required:!1,defaultValue:[{title:`推荐位名称`,moreUrl:`/channel`,moreLinkType:`content-list`,recommendMode:`content`,items:{id:`22edc8693ebbdaf1`,cover:`https://base-resources.guadd.fun/md-204/dcc-file/f7/f70a9f9f0c17aa9aff6c3a3e03a822db-small.jpg`,tag:`独家`,playCount:`11111`,playCountDelta:0,showPlayCount:!0,duration:`3600`,showEpisode:!0,useContentCover:!0,title:`穷小伙一睁眼穿越古代,娶个老婆就能得到奖励,后宫3000宠都宠不过来!谁料女帝主动送上门来,征服女帝可以直接开终极宝箱,不用选择全都可以!`,desc:`穷小伙一睁眼穿越古代,娶个老婆就能得到奖励,后宫3000宠都宠不过来!谁料女帝主动送上门来,征服女帝可以直接开终极宝箱,不用选择全都可以!`}}]})}),c=a(s);export{c as largeFeatureGridInspectorDefaultProps,s as largeFeatureGridInspectorPropsSchema};
2
+ import{defineArrayItemPropSchema as e,defineComponentPropsSchema as t,defineSwitchPropSchema as n,defineTextPropSchema as r,getSchemaDefaultProps as i}from"../../../../utils/schema/schema.mjs";import a from"zod";const o=t({data:e(a.object({title:r({label:`推荐位名称`,required:!1}),moreUrl:r({label:`更多链接`,required:!1}),moreLinkType:r({label:`更多链接类型`,required:!1,defaultValue:`content-list`}),items:t({id:r({label:`内容ID`}),cover:r({label:`封面`}),playCount:r({label:`播放量`,required:!1}),showPlayCount:n({label:`展示播放量`,required:!1,defaultValue:!0}),episodeText:r({label:`集数文案`,required:!1}),showEpisode:n({label:`展示集数`,required:!1,defaultValue:!0}),useContentCover:n({label:`沿用内容海报`,required:!1,defaultValue:!0}),title:r({label:`内容标题`}),desc:r({label:`内容简介`,required:!1}),tagImageUrl:r({label:`角标图`,required:!1})})}),{label:`大图推荐数据`,required:!1,defaultValue:[{title:`推荐位名称`,moreUrl:`/channel`,moreLinkType:`content-list`,items:{id:`22edc8693ebbdaf1`,cover:`https://base-resources.guadd.fun/md-204/dcc-file/f7/f70a9f9f0c17aa9aff6c3a3e03a822db-small.jpg`,playCount:`11111`,showPlayCount:!0,episodeText:`连载中`,showEpisode:!0,useContentCover:!0,title:`穷小伙一睁眼穿越古代,娶个老婆就能得到奖励,后宫3000宠都宠不过来!谁料女帝主动送上门来,征服女帝可以直接开终极宝箱,不用选择全都可以!`,desc:`穷小伙一睁眼穿越古代,娶个老婆就能得到奖励,后宫3000宠都宠不过来!谁料女帝主动送上门来,征服女帝可以直接开终极宝箱,不用选择全都可以!`}}]})}),s=i(o);export{s as largeFeatureGridInspectorDefaultProps,o as largeFeatureGridInspectorPropsSchema};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{cn as e}from"../../../../../utils/cn.mjs";import{Button as t}from"../../../../ui/button.mjs";import{useUserStore as n}from"../../../../../store/modules/user-store.mjs";import{gUserGetUserInfo as r,gUserViewUserInfo as i,pInteractionFollow as a,pInteractionUnfollow as o}from"../../../../../service/generated/client.mjs";import{Box as s}from"../../../../ui/box.mjs";import{Text as c}from"../../../../ui/text.mjs";import{useDeleteRequest as l,useMutation as u,useRequest as d,useUpdateRequest as f}from"../../../../../hooks/query/use-query.mjs";import{useLoginModalStore as p}from"../../../../../store/modules/login-modal-store.mjs";import{LeftArrowIcon as m}from"../../../../common/icons/left-arrow.mjs";import{SettingIcon as h}from"../../../../common/icons/setting.mjs";import{UserProfileAvatar as g}from"./user-profile-avatar.mjs";import{UserProfileCoverBackground as _}from"./user-profile-cover-background.mjs";import{useEffect as v,useMemo as y,useState as b}from"react";import{jsx as x,jsxs as S}from"react/jsx-runtime";import{toast as C}from"sonner";import{useTranslations as w}from"next-intl";import T from"next/link";import{useRouter as ee}from"next/navigation";const E=n.persist,D=`https://guadd-sg-ccs-sing-dev.s3.ap-southeast-1.amazonaws.com/default/default_avatar.png`,O=`/images/mine/img_mine_head_bg.png`;function te({userId:e,currentUserId:n,isFollowing:r}){let i=w(`components.pages.profile`),{open:s}=p(),c=l(),d=f(),{mutateAsync:m,isPending:h}=u(async e=>a(e)),{mutateAsync:g,isPending:_}=u(async e=>o(e)),v=h||_;async function y(){if(!v){if(!n){s();return}try{if(r){let t=await g({app_id:0,follower_id:n,followee_id:e});t.code===0?(C.success(i(`client.unfollowSuccess`)),b(!1),c([`check-follow`,e]),c([`user-profile`,`profile`,e])):C.error(t.message||i(`client.unfollowFailed`))}else{let t=await m({app_id:0,follower_id:n,followee_id:e});t.code===0?(C.success(i(`client.followSuccess`)),b(!0),c([`check-follow`,e]),c([`user-profile`,`profile`,e])):C.error(t.message||i(`client.followFailed`))}}catch(e){console.error(`关注操作失败`,e),C.error(i(`client.operationFailed`))}}}function b(t){d([`user-profile`,`profile`,e],e=>!e||!e.data?e:{...e,data:{...e.data,is_following:t}})}return x(t,{variant:r?`outline`:`default`,className:`rounded-full disabled:opacity-100`,onClick:y,disabled:v,children:i(v?`client.processing`:r?`client.followed`:`client.follow`)})}function k({id:a,enableCustomBackground:o=!0,showBackButton:l=!0,requireLogin:u=!1,cookieToken:f,cookieUserId:C,isEditorPreview:k=!1,className:A,mode:j=`renderer`}){let M=w(`components.pages.profile`);w(`components.pages.profile.components`);let N=k||j===`editor`,ne=!N,re=ee(),{open:ie}=p(),{isLogin:ae,userId:P,token:F}=n(),[I,L]=b(!1);v(()=>{if(!E){L(!0);return}L(E.hasHydrated());let e=E.onHydrate(()=>{L(!1)}),t=E.onFinishHydration(()=>{L(!0)});return()=>{e(),t()}},[]);let R=N?!1:I?ae&&!!P&&!!F:!!C&&!!f,z=N?``:I?P:P||C,B=z,V=a==null||!!a&&!!B&&a===B,oe=!V&&!!a,H=V?[`user-profile`,`mine`]:[`user-profile`,`profile`,a],{data:U}=d(N?[`editor-preview`,...H]:H,()=>a?i({target_user_id:a,user_id:z||a}):r({user_id:a||z||``}),{staleTime:0,enabled:ne&&(!!a||!!z)}),W=y(()=>{let e=U?U.data:void 0;return e?{userId:e.user_id,isFollowing:e.is_following||!1,name:e.nick_name||`User${a??``}`,avatar:e.avatar||D,followingCnt:e.following_count??0,followersCnt:e.follower_count??0,likeCnt:e.like_count??0,signature:e.signature||``,background:e.bg_image||O}:{}},[a,U]),G=N||u&&V&&!R,K=!G&&!R&&oe,q=V&&R&&!G,J=!R,se=o&&q,ce=o&&J,le={name:M(`client.welcomeToPlanet`),description:M(`client.exploreAdventures`),avatar:D,followingCnt:0,followersCnt:0,likeCnt:0,background:O};function Y(){ie()}function X(){re.back()}let ue=G?x(t,{className:`rounded-full`,size:`lg`,onClick:Y,children:M(`client.loginNow`)}):K?x(t,{className:`rounded-full`,size:`lg`,onClick:Y,children:M(`client.follow`)}):R?V?x(T,{href:`/edit`,children:x(t,{variant:`outline`,className:`rounded-full`,children:M(`client.editProfile`)})}):x(te,{userId:a||``,currentUserId:z,isFollowing:W?.isFollowing}):x(t,{className:`rounded-full`,size:`lg`,onClick:Y,children:M(`client.loginNow`)}),Z=G?le:W,Q=Z.name||``,$=Z.description||Z.signature||``;Z.followingCnt,Z.followersCnt,Z.likeCnt;let de=Z.avatar||``;return S(s,{className:e(`flex flex-col relative`,A),children:[S(s,{className:`absolute top-0 p-3 z-10 flex items-center justify-between w-full`,children:[x(t,{variant:`ghost`,size:`icon-xs`,onClick:X,className:e(`h-4 w-4 p-0 hover:bg-transparent`,{invisible:!l}),children:x(m,{className:`w-4 h-4`})}),x(T,{href:`/settings`,className:e({invisible:!V}),children:x(h,{})})]}),x(_,{isMine:se,enableCustomBackground:o,src:Z.background,onUnauthorizedClick:ce?Y:void 0}),S(s,{className:`flex-1 px-3`,children:[S(s,{className:`relative flex justify-end`,children:[x(g,{isMine:q,src:de,alt:Q||`avatar`,onUnauthorizedClick:J?Y:void 0}),x(s,{className:`flex divide-x divide-text1/5 py-4 h-12`})]}),S(s,{className:`flex items-center justify-between gap-1`,children:[x(c,{as:`p`,className:`text-text1 text-xl line-clamp-2 font-bold`,children:Q}),ue]}),$&&x(c,{as:`p`,className:`text-sm py-1 line-clamp-3 text-text1/66`,children:$})]})]})}export{k as UserProfileHeaderClient};
2
+ "use client";import{cn as e}from"../../../../../utils/cn.mjs";import{Button as t}from"../../../../ui/button.mjs";import{useUserStore as n}from"../../../../../store/modules/user-store.mjs";import{gUserGetUserInfo as r,gUserViewUserInfo as i,pInteractionFollow as a,pInteractionUnfollow as o}from"../../../../../service/generated/client.mjs";import{Box as s}from"../../../../ui/box.mjs";import{Text as c}from"../../../../ui/text.mjs";import{useDeleteRequest as l,useMutation as u,useRequest as d,useUpdateRequest as f}from"../../../../../hooks/query/use-query.mjs";import{useLoginModalStore as p}from"../../../../../store/modules/login-modal-store.mjs";import{LeftArrowIcon as m}from"../../../../common/icons/left-arrow.mjs";import{SettingIcon as h}from"../../../../common/icons/setting.mjs";import{UserProfileAvatar as g}from"./user-profile-avatar.mjs";import{UserProfileCoverBackground as _}from"./user-profile-cover-background.mjs";import{useEffect as v,useMemo as y,useState as b}from"react";import{jsx as x,jsxs as S}from"react/jsx-runtime";import{toast as C}from"sonner";import{useTranslations as w}from"next-intl";import T from"next/link";import{useRouter as ee}from"next/navigation";const E=n.persist,D=`https://guadd-sg-ccs-sing-dev.s3.ap-southeast-1.amazonaws.com/default/default_avatar.png`,O=`/images/mine/img_mine_head_bg.png`;function te({userId:e,currentUserId:n,isFollowing:r}){let i=w(`components.pages.profile`),{open:s}=p(),c=l(),d=f(),{mutateAsync:m,isPending:h}=u(async e=>a(e)),{mutateAsync:g,isPending:_}=u(async e=>o(e)),v=h||_;async function y(){if(!v){if(!n){s();return}try{if(r){let t=await g({app_id:0,follower_id:n,followee_id:e});t.code===0?(C.success(i(`client.unfollowSuccess`)),b(!1),c([`check-follow`,e]),c([`user-profile`,`profile`,e])):C.error(t.message||i(`client.unfollowFailed`))}else{let t=await m({app_id:0,follower_id:n,followee_id:e});t.code===0?(C.success(i(`client.followSuccess`)),b(!0),c([`check-follow`,e]),c([`user-profile`,`profile`,e])):C.error(t.message||i(`client.followFailed`))}}catch(e){console.error(`关注操作失败`,e),C.error(i(`client.operationFailed`))}}}function b(t){d([`user-profile`,`profile`,e],e=>!e||!e.data?e:{...e,data:{...e.data,is_following:t}})}return x(t,{variant:r?`outline`:`default`,className:`rounded-full disabled:opacity-100`,onClick:y,disabled:v,children:i(v?`client.processing`:r?`client.followed`:`client.follow`)})}function k({id:a,enableCustomBackground:o=!0,showBackButton:l=!0,requireLogin:u=!1,cookieToken:f,cookieUserId:C,isEditorPreview:k=!1,className:A,mode:j=`renderer`}){let M=w(`components.pages.profile`);w(`components.pages.profile.components`);let N=k||j===`editor`,ne=!N,re=ee(),{open:ie}=p(),{isLogin:ae,userId:P,token:F}=n(),[I,L]=b(!1);v(()=>{if(!E){L(!0);return}L(E.hasHydrated());let e=E.onHydrate(()=>{L(!1)}),t=E.onFinishHydration(()=>{L(!0)});return()=>{e(),t()}},[]);let R=N?!1:I?ae&&!!P&&!!F:!!C&&!!f,z=N?``:I?P:P||C,B=z,V=a==null||!!a&&!!B&&a===B,oe=!V&&!!a,H=V?[`user-profile`,`mine`]:[`user-profile`,`profile`,a],{data:U}=d(N?[`editor-preview`,...H]:H,()=>a?i({target_user_id:a,user_id:z||a}):r({user_id:a||z||``}),{staleTime:0,enabled:ne&&(!!a||!!z)}),W=y(()=>{let e=U?U.data:void 0;return e?{userId:e.user_id,isFollowing:e.is_following||!1,name:e.nick_name||`User${a??``}`,avatar:e.avatar||D,followingCnt:e.following_count??0,followersCnt:e.follower_count??0,likeCnt:e.like_count??0,signature:e.signature||``,background:e.bg_image||O}:{}},[a,U]),G=u&&V&&!R,K=!R&&oe,q=V&&R&&!G,J=!R,se=o&&q,ce=o&&J,le={name:M(`client.welcomeToPlanet`),description:M(`client.exploreAdventures`),avatar:D,followingCnt:0,followersCnt:0,likeCnt:0,background:O};function Y(){ie()}function X(){re.back()}let ue=G?x(t,{className:`rounded-full`,size:`lg`,onClick:Y,children:M(`client.loginNow`)}):K?x(t,{className:`rounded-full`,size:`lg`,onClick:Y,children:M(`client.follow`)}):R?V?x(T,{href:`/edit`,children:x(t,{variant:`outline`,className:`rounded-full`,children:M(`client.editProfile`)})}):x(te,{userId:a||``,currentUserId:z,isFollowing:W?.isFollowing}):x(t,{className:`rounded-full`,size:`lg`,onClick:Y,children:M(`client.loginNow`)}),Z=G?le:W,Q=Z.name||``,$=Z.description||Z.signature||``;Z.followingCnt,Z.followersCnt,Z.likeCnt;let de=Z.avatar||``;return S(s,{className:e(`flex flex-col relative`,A),children:[S(s,{className:`absolute top-0 p-3 z-10 flex items-center justify-between w-full`,children:[x(t,{variant:`ghost`,size:`icon-xs`,onClick:X,className:e(`h-4 w-4 p-0 hover:bg-transparent`,{invisible:!l}),children:x(m,{className:`w-4 h-4`})}),x(T,{href:`/settings`,className:e({invisible:!V}),children:x(h,{})})]}),x(_,{isMine:se,enableCustomBackground:o,src:Z.background,onUnauthorizedClick:ce?Y:void 0}),S(s,{className:`flex-1 px-3`,children:[S(s,{className:`relative flex justify-end`,children:[x(g,{isMine:q,src:de,alt:Q||`avatar`,onUnauthorizedClick:J?Y:void 0}),x(s,{className:`flex divide-x divide-text1/5 py-4 h-12`})]}),S(s,{className:`flex items-center justify-between gap-1`,children:[x(c,{as:`p`,className:`text-text1 text-xl line-clamp-2 font-bold`,children:Q}),ue]}),$&&x(c,{as:`p`,className:`text-sm py-1 line-clamp-3 text-text1/66`,children:$})]})]})}export{k as UserProfileHeaderClient};
@@ -7,13 +7,7 @@ import * as zod from "zod";
7
7
  import * as zod_v4_core0 from "zod/v4/core";
8
8
 
9
9
  //#region components/biz/business/profile/profile-header/material.d.ts
10
- declare const profileHeaderMaterial: DefineMaterialOption<({
11
- mode,
12
- ...props
13
- }: React.ComponentProps<typeof UserProfileHeader>) => react_jsx_runtime0.JSX.Element, ({
14
- mode,
15
- ...props
16
- }: React.ComponentProps<typeof UserProfileHeaderClient>) => react_jsx_runtime0.JSX.Element, zod.ZodObject<{
10
+ declare const profileHeaderMaterial: DefineMaterialOption<typeof UserProfileHeader, typeof UserProfileHeaderClient, zod.ZodObject<{
17
11
  mode: zod.ZodOptional<zod.ZodEnum<{
18
12
  renderer: "renderer";
19
13
  editor: "editor";
@@ -1,2 +1,2 @@
1
1
 
2
- import{defineMaterial as e}from"../../../../../utils/schema/material.mjs";import{UserProfileHeaderClient as t}from"./client.mjs";import{profileHeaderInspectorPropsSchema as n}from"./schema.mjs";import{UserProfileHeader as r}from"./server.mjs";import{jsx as i}from"react/jsx-runtime";function a(e){return e===`editor`?{id:void 0,requireLogin:!0,cookieToken:``,cookieUserId:``,token:``,currentUserId:``}:{}}const o=e({type:`profile-header`,category:`内容组件`,name:`用户信息模块(有背景图)`,icon:`/static/components-thumb/user_profile_with_background.png`,serverComponent:({mode:e=`renderer`,...t})=>i(r,{...t,...a(e),mode:e}),clientComponent:({mode:e=`renderer`,...n})=>i(t,{...n,...a(e),mode:e}),propsSchema:n}),s=e({type:`profile-header-with-disabled-background`,category:`内容组件`,name:`用户信息模块(无背景图)`,icon:`/static/components-thumb/user_profile_plain.png`,serverComponent:({mode:e=`renderer`,...t})=>i(r,{...t,...a(e),mode:e,enableCustomBackground:!1}),clientComponent:({mode:e=`renderer`,...n})=>i(t,{...n,...a(e),mode:e,enableCustomBackground:!1}),propsSchema:n});export{o as profileHeaderMaterial,s as profileHeaderMaterialWithDisabledBackground};
2
+ import{defineMaterial as e}from"../../../../../utils/schema/material.mjs";import{UserProfileHeaderClient as t}from"./client.mjs";import{profileHeaderInspectorPropsSchema as n}from"./schema.mjs";import{UserProfileHeader as r}from"./server.mjs";import{jsx as i}from"react/jsx-runtime";const a=e({type:`profile-header`,category:`内容组件`,name:`用户信息模块(有背景图)`,icon:`/static/components-thumb/user_profile_with_background.png`,serverComponent:r,clientComponent:t,propsSchema:n}),o=e({type:`profile-header-with-disabled-background`,category:`内容组件`,name:`用户信息模块(无背景图)`,icon:`/static/components-thumb/user_profile_plain.png`,serverComponent:({mode:e=`renderer`,...t})=>i(r,{...t,mode:e,enableCustomBackground:!1}),clientComponent:({mode:e=`renderer`,...n})=>i(t,{...n,mode:e,enableCustomBackground:!1}),propsSchema:n});export{a as profileHeaderMaterial,o as profileHeaderMaterialWithDisabledBackground};
@@ -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?: "link" | "default" | "destructive" | "secondary" | "outline" | "ghost" | null | undefined;
9
+ variant?: "default" | "link" | "destructive" | "secondary" | "outline" | "ghost" | 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?: "link" | "default" | "destructive" | "secondary" | "outline" | "ghost" | null | undefined;
11
- size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
10
+ variant?: "default" | "link" | "destructive" | "secondary" | "outline" | "ghost" | 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> & {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@funhub/platform",
3
3
  "type": "module",
4
- "version": "0.1.44",
4
+ "version": "0.1.45",
5
5
  "private": false,
6
6
  "sideEffects": [
7
7
  "**/*.css"
@@ -1,15 +0,0 @@
1
-
2
- import { LargeFeatureGridInspectorProps } from "./schema.mjs";
3
- import * as react_jsx_runtime0 from "react/jsx-runtime";
4
-
5
- //#region components/biz/business/large-feature-grid/client.d.ts
6
- type LargeFeatureGridClientProps = LargeFeatureGridInspectorProps;
7
- /**
8
- * 大图推荐客户端组件。
9
- */
10
- declare function LargeFeatureGridClient({
11
- mode,
12
- data
13
- }: LargeFeatureGridClientProps): react_jsx_runtime0.JSX.Element | null;
14
- //#endregion
15
- export { LargeFeatureGridClient };
@@ -1,42 +0,0 @@
1
-
2
- import { InferSchemaProps, SchemaHasDefaultValue } from "../../../../utils/schema/schema.mjs";
3
- import "../../../../utils/schema/index.mjs";
4
- import z$1 from "zod";
5
-
6
- //#region components/biz/business/large-feature-grid/schema.d.ts
7
- /**
8
- * 大图推荐物料 schema
9
- */
10
- declare const largeFeatureGridInspectorPropsSchema: z$1.ZodObject<{
11
- data: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
12
- title: z$1.ZodOptional<z$1.ZodString>;
13
- moreUrl: z$1.ZodOptional<z$1.ZodString>;
14
- moreLinkType: z$1.ZodOptional<z$1.ZodString> & SchemaHasDefaultValue;
15
- recommendMode: z$1.ZodOptional<z$1.ZodString> & SchemaHasDefaultValue;
16
- items: z$1.ZodObject<{
17
- id: z$1.ZodString;
18
- cover: z$1.ZodString;
19
- tag: z$1.ZodOptional<z$1.ZodString>;
20
- playCount: z$1.ZodOptional<z$1.ZodString>;
21
- playCountDelta: z$1.ZodOptional<z$1.ZodNumber> & SchemaHasDefaultValue;
22
- showPlayCount: z$1.ZodOptional<z$1.ZodBoolean> & SchemaHasDefaultValue;
23
- duration: z$1.ZodOptional<z$1.ZodString>;
24
- showEpisode: z$1.ZodOptional<z$1.ZodBoolean> & SchemaHasDefaultValue;
25
- useContentCover: z$1.ZodOptional<z$1.ZodBoolean> & SchemaHasDefaultValue;
26
- title: z$1.ZodString;
27
- desc: z$1.ZodOptional<z$1.ZodString>;
28
- tagImageUrl: z$1.ZodOptional<z$1.ZodString>;
29
- mode: z$1.ZodOptional<z$1.ZodEnum<{
30
- renderer: "renderer";
31
- editor: "editor";
32
- }>>;
33
- }, z$1.core.$strip>;
34
- }, z$1.core.$strip>>> & SchemaHasDefaultValue;
35
- mode: z$1.ZodOptional<z$1.ZodEnum<{
36
- renderer: "renderer";
37
- editor: "editor";
38
- }>>;
39
- }, z$1.core.$strip>;
40
- type LargeFeatureGridInspectorProps = InferSchemaProps<typeof largeFeatureGridInspectorPropsSchema>;
41
- //#endregion
42
- export { LargeFeatureGridInspectorProps };
@@ -1,15 +0,0 @@
1
-
2
- import { LargeFeatureGridInspectorProps } from "./schema.mjs";
3
- import * as react_jsx_runtime0 from "react/jsx-runtime";
4
-
5
- //#region components/biz/business/large-feature-grid/server.d.ts
6
- type LargeFeatureGridProps = LargeFeatureGridInspectorProps;
7
- /**
8
- * 大图推荐服务端组件,直接渲染客户端组件。
9
- */
10
- declare function LargeFeatureGrid({
11
- mode,
12
- ...props
13
- }: LargeFeatureGridProps): react_jsx_runtime0.JSX.Element;
14
- //#endregion
15
- export { LargeFeatureGrid };