@funhub/platform 0.1.36 → 0.1.38
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/config/tailwind/index.cjs +4 -0
- package/config/tailwind/index.mjs +4 -0
- package/dist/assets/images/subscript.mjs +2 -0
- package/dist/biz.mjs +1 -1
- package/dist/components/biz/business/comment/comment-input.mjs +1 -1
- package/dist/components/biz/business/detail/detail-operate.mjs +1 -1
- package/dist/components/biz/business/detail/materials/editor-preview.mjs +2 -0
- package/dist/components/biz/business/detail/materials/registry.d.mts +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-actions/client.mjs +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-info/client.d.mts +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-info/client.mjs +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-info/material.mjs +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-info/schema.d.mts +2 -2
- package/dist/components/biz/business/detail/materials/video-detail-info/server.d.mts +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-info-title/client.d.mts +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-info-title/client.mjs +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-info-title/material.mjs +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-info-title/schema.d.mts +2 -2
- package/dist/components/biz/business/detail/materials/video-detail-info-title/server.d.mts +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-info-title-tags-episodes/client.d.mts +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-info-title-tags-episodes/client.mjs +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-info-title-tags-episodes/material.mjs +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-info-title-tags-episodes/schema.d.mts +2 -2
- package/dist/components/biz/business/detail/materials/video-detail-info-title-tags-episodes/server.d.mts +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-player/client.mjs +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-recommend/client.mjs +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-recommend/material.d.mts +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-recommend/material.mjs +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-recommend/schema.d.mts +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-recommend/schema.mjs +1 -1
- package/dist/components/biz/business/detail/video-hero.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 +2 -0
- package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/inspector-schema.d.mts +4 -0
- package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/inspector-schema.mjs +1 -1
- package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/material.d.mts +2 -0
- package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/material.mjs +1 -1
- package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/runtime/client.mjs +1 -1
- package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/schema/component.mjs +1 -1
- package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/server.mjs +1 -1
- package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/defaults/default-props.d.mts +1 -3
- package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/defaults/default-props.mjs +1 -1
- package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/inspector-schema.d.mts +4 -2
- package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/inspector-schema.mjs +1 -1
- package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/material.d.mts +2 -1
- package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/material.mjs +1 -1
- package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/runtime/client.mjs +1 -1
- package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/schema/component.mjs +1 -1
- package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/schema/props.schema.mjs +1 -1
- package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/server.mjs +1 -1
- package/dist/components/biz/business/index.mjs +1 -1
- package/dist/components/biz/business/large-feature-grid/client.mjs +1 -1
- package/dist/components/biz/business/large-feature-grid/material.d.mts +4 -3
- package/dist/components/biz/business/large-feature-grid/material.mjs +1 -1
- package/dist/components/biz/business/large-feature-grid/schema.mjs +1 -1
- package/dist/components/biz/business/marquee/material.d.mts +1 -1
- package/dist/components/biz/business/marquee/schema.d.mts +1 -1
- package/dist/components/biz/business/profile/profile-header/client.mjs +1 -1
- package/dist/components/biz/business/profile/profile-header/material.mjs +1 -1
- package/dist/components/biz/business/profile/profile-main/material.mjs +1 -1
- package/dist/components/biz/business/profile/profile-main/server.mjs +1 -1
- 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/server.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/history-tab/server.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/like-tab/server.mjs +1 -1
- package/dist/components/biz/business/profile/profile-main/tabs/publish-tab/client.d.mts +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/tabs/publish-tab/server.mjs +1 -1
- package/dist/components/biz/business/profile/profile-main/utils.mjs +1 -1
- package/dist/components/biz/business/profile/profile-main/variants.d.mts +3 -3
- 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/shortcut-grid/material.d.mts +1 -1
- package/dist/components/biz/business/shortcut-grid/schema.d.mts +1 -1
- package/dist/components/biz/business/shortcut-grid/schema.mjs +1 -1
- package/dist/components/biz/business/tab-bar/client.mjs +1 -1
- package/dist/components/biz/business/tab-bar/material.d.mts +6 -2
- package/dist/components/biz/business/tab-bar/schema.d.mts +6 -2
- package/dist/components/biz/business/tab-bar/schema.mjs +1 -1
- package/dist/components/biz/business/video-horizontal-list/client.mjs +1 -1
- package/dist/components/biz/business/video-horizontal-list/schema.mjs +1 -1
- package/dist/components/common/list/collection-list/collection-list-item.d.mts +1 -0
- package/dist/components/common/list/collection-list/collection-list-item.mjs +1 -1
- package/dist/components/common/list/post-list/post-list.d.mts +2 -0
- package/dist/components/common/list/post-list/post-list.mjs +1 -1
- package/dist/components/common/list/video-list/video-list.d.mts +2 -0
- package/dist/components/common/list/video-list/video-list.mjs +1 -1
- package/dist/components/pages/collection-create/form.mjs +1 -1
- package/dist/components/pages/collection-detail/_components/collection-detail-card.mjs +1 -1
- package/dist/components/pages/collection-detail/detail.mjs +1 -1
- package/dist/components/pages/feedback/_components/feedback-form.mjs +1 -1
- package/dist/components/ui/image.d.mts +4 -4
- package/dist/i18n/locales/en.mjs +1 -1
- package/dist/i18n/locales/zh-CN.mjs +1 -1
- package/dist/utils/schema/material.d.mts +1 -1
- package/package.json +1 -1
- package/theme.css +4 -0
- package/dist/components/biz/business/large-feature-grid/client.d.mts +0 -15
- package/dist/components/biz/business/large-feature-grid/default.mjs +0 -2
- package/dist/components/biz/business/large-feature-grid/server.d.mts +0 -13
- package/dist/components/biz/business/large-feature-grid/types.d.mts +0 -53
- package/dist/components/common/icons/edit.mjs +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{gContentGetAppChannelBlockData as e}from"../../../../../service/generated/client.mjs";import{Image as t}from"../../../../ui/image.mjs";import{Box as n}from"../../../../ui/box.mjs";import{Text as r}from"../../../../ui/text.mjs";import{usePaginated as i}from"../../../../../hooks/query/use-query.mjs";import{useAppContext as a}from"../../../../../hooks/use-app-context/index.mjs";import o from"../../../../../assets/icons/detail/video_flag.mjs";import{MiniThreeCard as s}from"../../../../common/cards/mini-three-card.mjs";import{useCallback as c,useEffect as l,useLayoutEffect as u,useMemo as d,useRef as f,useState as p}from"react";import{jsx as m,jsxs as h}from"react/jsx-runtime";import{useRouter as g}from"next/navigation";const _={},v={list:[]};function y({variant:e,props:t=_,data:i=v}){let o=a(),s=g(),{list:y,title:x,cursor:S,block_id:w,channel_id:T}=i,E=Array.isArray(i.icons)?i.icons:[],{moreLink:D}=t,[
|
|
2
|
+
"use client";import{gContentGetAppChannelBlockData as e}from"../../../../../service/generated/client.mjs";import{Image as t}from"../../../../ui/image.mjs";import{Box as n}from"../../../../ui/box.mjs";import{Text as r}from"../../../../ui/text.mjs";import{usePaginated as i}from"../../../../../hooks/query/use-query.mjs";import{useAppContext as a}from"../../../../../hooks/use-app-context/index.mjs";import o from"../../../../../assets/icons/detail/video_flag.mjs";import{MiniThreeCard as s}from"../../../../common/cards/mini-three-card.mjs";import{useCallback as c,useEffect as l,useLayoutEffect as u,useMemo as d,useRef as f,useState as p}from"react";import{jsx as m,jsxs as h}from"react/jsx-runtime";import{useRouter as g}from"next/navigation";const _={},v={list:[]};function y({variant:e,props:t=_,data:i=v}){let o=a(),s=g(),{list:y,title:x,cursor:S,block_id:w,channel_id:T}=i,E=Array.isArray(i.icons)?i.icons:[],{moreLink:D,title:O,enableInfinite:k}=t,[j,P]=p(0),F=f(null),I=k===!0,{items:L,icons:R,hasNextPage:z,isFetchingNextPage:B,fetchNextPage:V}=N({blockId:w||``,initialCursor:S||``,initialIcons:E,initialList:y,pageSize:16,enabled:o===`renderer`&&I}),H=e===`waterfall`?6:4,U=L.length>=H?L.length-H:-1,W=f(null),G=f(!1),K=O&&O.trim()||x||``,q=e!==`waterfall`&&!I,J=q?C(D,w||``,T||``):``,Y=!!(S&&S.trim()),X=o===`renderer`&&I&&(Y||z===!0),Z=c(()=>{J&&(J.startsWith(`http`)?window.location.href=J:s.push(J))},[J,s]);u(()=>{let t=F.current;if(!t||e!==`waterfall`)return;let n=()=>{let e=t.clientWidth||0;P(e>0?(e-12)/2:0)};n();let r=new ResizeObserver(n);return r.observe(t),()=>{r.disconnect()}},[e]),l(()=>{let e=W.current;if(!e||!X||L.length<16)return;let t=document.getElementById(`app-scroll-container`)||null,n=new IntersectionObserver(e=>{e[0]?.isIntersecting&&(B||G.current||(G.current=!0,V().finally(()=>{G.current=!1})))},{root:t,threshold:0});return n.observe(e),()=>{n.disconnect()}},[X,V,B,L.length,U]);let Q=d(()=>e===`waterfall`?A(L,R,j):{left:[],right:[]},[j,L,R,e]);return L.length?h(n,{className:`w-full mt-[16px]`,children:[h(n,{className:`flex items-center justify-between px-[12px] mb-[8px]`,children:[m(r,{className:`text-text1 text-[18px] leading-[26px] font-bold line-clamp-1`,children:K}),q&&m(r,{className:`text-text3 text-[12px] leading-[18px] ${J?`cursor-pointer`:``}`,onClick:Z,children:`更多`})]}),e===`grid`&&m(n,{className:`w-full flex flex-wrap px-[12px]`,children:L.map((e,t)=>{let n=R[t];return m(`div`,{ref:t===U?W:void 0,className:`w-1/2 px-[6px]`,children:m(b,{item:e,icon:n,index:t,widthStyle:{width:`100%`}})},M(e,t))})}),e===`waterfall`&&h(n,{ref:F,className:`w-full px-[12px] flex gap-[12px]`,children:[m(n,{className:`flex-1 min-w-0 flex flex-col`,children:Q.left.map(e=>m(`div`,{ref:e.index===U?W:void 0,children:m(b,{item:e.item,icon:e.icon,index:e.index,widthStyle:{width:`100%`}})},M(e.item,e.index)))}),m(n,{className:`flex-1 min-w-0 flex flex-col`,children:Q.right.map(e=>m(`div`,{ref:e.index===U?W:void 0,children:m(b,{item:e.item,icon:e.icon,index:e.index,widthStyle:{width:`100%`}})},M(e.item,e.index)))})]})]}):null}function b({item:e,icon:t,index:i,widthStyle:a}){let c=w(e),l=e.name||``,u=E(e.static?.browse_cnt??0),d=T(e),f=k(e,t,i);return m(s,{url:c,text:l,className:`w-full`,style:a,topRightChild:f?m(x,{url:f}):void 0,bottomLeftChild:h(n,{className:`h-[20px] leading-[20px] text-[#fff] text-[12px] px-[4px] rounded-[4px] bg-[#333] ml-[4px] flex items-center`,children:[m(o,{className:`w-[16px] h-[auto] text-[#fff] mr-[4px]`}),u]}),textChild:h(n,{className:`mt-[4px]`,children:[m(r,{as:`h3`,className:`text-text1 text-[14px] leading-[20px] line-clamp-1`,children:l}),d&&m(r,{className:`text-text3 text-[12px] leading-[18px]`,children:d})]}),linkPath:S(e)})}function x({url:e}){return m(n,{className:`relative w-[40px] h-[20px] mr-[6px] mt-[6px]`,children:m(t,{src:e,alt:`corner`,fill:!0,objectFit:`contain`})})}function S(e){let t=encodeURIComponent(e.name||``);return`/video/${e.id||``}/${t}/episode/1`}function C(e,t,n){if(e)return e;if(!t)return``;let r=new URLSearchParams({blockId:t});return n&&r.set(`channelId`,n),`/featured?${r.toString()}`}function w(e){return e.img_y||e.img_x||``}function T(e){if((e.type??0)===2){let t=Number(e.episode_cnt||e.links?.length||0);return t>0?`全${t}集`:``}return O(Number(e.duration||0))}function E(e){return!Number.isFinite(e)||e<=0?`0`:e>=1e6?`${D(e/1e6)}M`:e>=1e3?`${D(e/1e3)}k`:Math.floor(e).toString()}function D(e){let t=e.toFixed(1);return t.endsWith(`.0`)?t.slice(0,-2):t}function O(e){if(!Number.isFinite(e)||e<=0)return``;let t=Math.floor(e),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60,a=e=>String(e).padStart(2,`0`);return n>0?`${a(n)}:${a(r)}:${a(i)}`:`${a(r)}:${a(i)}`}function k(e,t,n){let r=e;return r.corner_icon_url||r.corner_icon||r.icon_url||t?.material_url||``}function A(e,t,n){let r=[],i=[],a=0,o=0;return e.forEach((e,s)=>{let c=t[s],l=j(n,e);a<=o?(r.push({item:e,icon:c,index:s}),a+=l):(i.push({item:e,icon:c,index:s}),o+=l)}),{left:r,right:i}}function j(e,t){if(!e)return 0;let n=e*1.3461538461538463,r=T(t)?18:0;return n+20+r+6+16}function M(e,t){return e.id?`home-recommend-${e.id}`:`home-recommend-${t}`}function N({blockId:t,initialList:n,initialCursor:r,initialIcons:a,pageSize:o,enabled:s}){let m=n.length>0,h=f(n),g=f(a),[_,v]=p(!1);l(()=>{h.current=n,g.current=a},[a,n]);let y=d(()=>{if(!m)return;let e=r&&r.trim()?r:void 0;return{pages:[{data:{block:{data:{videos:n,icons:a,cursor:r||``}}}}],pageParams:[e]}},[m,r,a,n]),{data:b,fetchNextPage:x,hasNextPage:S,isFetchingNextPage:C}=i({key:[`home-recommend`,t],queryFn:n=>e({block_id:t,cursor:n||void 0,page_size:o}),getNextPageParam:e=>{let t=e.data?.block?.data?.cursor;return t&&t.trim()?t:void 0},options:{enabled:s&&!!t,initialData:y,refetchOnMount:!1,refetchOnWindowFocus:!1,refetchOnReconnect:!1},initialPageParam:m&&r&&r.trim()?r:void 0});u(()=>{v(!0)},[]);let w=d(()=>{if(!_)return{items:m?[...h.current]:[],icons:m?[...g.current]:[]};let e=b?.pages||[],t=[],n=[],r=m?1:0;m&&(t.push(...h.current),n.push(...g.current));for(let i=r;i<e.length;i++){let r=e[i].data?.block?.data,a=r?.videos||[],o=r?.icons||[];t.push(...a),n.push(...o)}return{items:t,icons:n}},[m,_,b?.pages]),T=c(async()=>{await x()},[x]);return{items:w.items,icons:w.icons,hasNextPage:S,isFetchingNextPage:C,fetchNextPage:T}}export{y as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
|
|
2
|
+
const e=`/static/components-thumb/video_player.png`,t=Array.from({length:12},(t,n)=>{let r=n%2==1,i={browse_cnt:12345+n*731};return{id:`preview-recommend-${n+1}`,name:`媒资标题 ${n+1}`,img_y:e,img_x:e,type:r?2:1,duration:r?0:60*(18+n),episode_cnt:r?12+n%3*6:0,static:i}});function n(e,t){return t?8:e===`waterfall`?4:2}function r(e){let n=Math.max(1,Math.floor(e));return Array.from({length:n},(e,n)=>({...t[n%t.length],id:`preview-recommend-${n+1}`,name:`媒资标题 ${n+1}`}))}function i({variant:e,schemaTitle:t,enableInfinite:i,data:a}){let o=Array.isArray(a?.list)?a.list.filter(Boolean):[],s=n(e,i);return{title:t&&t.trim()||a?.title||`推荐位名称`,list:o.length?o:r(s),icons:Array.isArray(a?.icons)?a.icons:[],cursor:a?.cursor||``,block_id:a?.block_id||``,channel_id:a?.channel_id||``,show_style:a?.show_style}}export{i as buildHomeRecommendEditorPreviewData};
|
|
@@ -8,9 +8,13 @@ import z$1 from "zod";
|
|
|
8
8
|
* HomeRecommendGrid 物料属性 schema 定义。
|
|
9
9
|
*/
|
|
10
10
|
declare const homeRecommendGridInspectorPropsSchema: z$1.ZodObject<{
|
|
11
|
+
title: z$1.ZodOptional<z$1.ZodString> & SchemaHasDefaultValue;
|
|
12
|
+
enableInfinite: z$1.ZodOptional<z$1.ZodBoolean> & SchemaHasDefaultValue;
|
|
11
13
|
moreLink: z$1.ZodOptional<z$1.ZodString> & SchemaHasDefaultValue;
|
|
12
14
|
}, z$1.core.$strip>;
|
|
13
15
|
declare const homeRecommendGridInspectorDefaultProps: {
|
|
16
|
+
title: string;
|
|
17
|
+
enableInfinite: boolean;
|
|
14
18
|
moreLink: string;
|
|
15
19
|
};
|
|
16
20
|
type HomeRecommendGridInspectorProps = z$1.infer<typeof homeRecommendGridInspectorPropsSchema>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{defineComponentPropsSchema as e,
|
|
2
|
+
import{defineComponentPropsSchema as e,defineSwitchPropSchema as t,defineTextPropSchema as n,getSchemaDefaultProps as r}from"../../../../../../utils/schema/schema.mjs";const i=e({title:n({label:`推荐位名称`,description:``,required:!1,defaultValue:``}),enableInfinite:t({label:`无限下拉`,defaultValue:!1,required:!1}),moreLink:n({label:`更多`,description:``,required:!1,defaultValue:``})}),a=r(i);export{a as homeRecommendGridInspectorDefaultProps,i as homeRecommendGridInspectorPropsSchema};
|
package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/material.d.mts
CHANGED
|
@@ -8,6 +8,8 @@ import * as zod_v4_core0 from "zod/v4/core";
|
|
|
8
8
|
|
|
9
9
|
//#region components/biz/business/home-recommend/variants/home-recommend-grid/material.d.ts
|
|
10
10
|
declare const homeRecommendGridMaterial: DefineMaterialOption<typeof HomeRecommendGrid, typeof HomeRecommendGrid, zod.ZodObject<{
|
|
11
|
+
title: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
|
|
12
|
+
enableInfinite: zod.ZodOptional<zod.ZodBoolean> & SchemaHasDefaultValue;
|
|
11
13
|
moreLink: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
|
|
12
14
|
}, zod_v4_core0.$strip>, "home-recommend-grid">;
|
|
13
15
|
//#endregion
|
package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/material.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{defineMaterial as e}from"../../../../../../utils/schema/material.mjs";import{homeRecommendGridInspectorPropsSchema as t}from"./inspector-schema.mjs";import{HomeRecommendGrid as n}from"./server.mjs";const r=e({type:`home-recommend-grid`,name:`两列宫格`,icon:`/static/components-thumb/grid_two_column_single_row.png`,category
|
|
2
|
+
import{defineMaterial as e}from"../../../../../../utils/schema/material.mjs";import{homeRecommendGridInspectorPropsSchema as t}from"./inspector-schema.mjs";import{HomeRecommendGrid as n}from"./server.mjs";const r=e({type:`home-recommend-grid`,name:`两列宫格`,icon:`/static/components-thumb/grid_two_column_single_row.png`,category:`内容组件`,serverComponent:n,clientComponent:n,propsSchema:t});export{r as homeRecommendGridMaterial};
|
package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/runtime/client.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{useAppContext as e}from"../../../../../../../hooks/use-app-context/index.mjs";import t from"../../../shared/home-recommend-base.mjs";import{
|
|
2
|
+
"use client";import{useAppContext as e}from"../../../../../../../hooks/use-app-context/index.mjs";import t from"../../../shared/home-recommend-base.mjs";import{buildHomeRecommendEditorPreviewData as n}from"../../../shared/home-recommend-preview.mjs";import{useMemo as r}from"react";import{jsx as i}from"react/jsx-runtime";function a(a){let o=e()===`editor`,s=a.props||{},c=r(()=>o?n({variant:`grid`,schemaTitle:s.title,enableInfinite:s.enableInfinite,data:a.data}):a.data,[o,a.data,s.enableInfinite,s.title]);return i(`div`,{className:o?`pointer-events-none`:void 0,children:i(t,{variant:`grid`,...a,data:c})})}export{a as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
const e={componentName:`HomeRecommendGrid`,displayName:`两列宫格推荐位`,category:`HomeRecommend`,categoryName
|
|
2
|
+
const e={componentName:`HomeRecommendGrid`,displayName:`两列宫格推荐位`,category:`HomeRecommend`,categoryName:`内容组件`,enabled:!0};export{e as componentMeta};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{defaultProps as e}from"./defaults/default-props.mjs";import t from"./runtime/client.mjs";import{jsx as n}from"react/jsx-runtime";function r(r){let{moreLink:i=e.moreLink,data:
|
|
2
|
+
import{defaultProps as e}from"./defaults/default-props.mjs";import t from"./runtime/client.mjs";import{jsx as n}from"react/jsx-runtime";function r(r){let{moreLink:i=e.moreLink,title:a,enableInfinite:o,data:s}=r;return n(t,{props:{moreLink:i,title:a,enableInfinite:o},data:s})}export{r as HomeRecommendGrid};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
const e={
|
|
2
|
+
const e={};export{e as defaultProps};
|
|
@@ -8,10 +8,12 @@ import z$1 from "zod";
|
|
|
8
8
|
* HomeRecommendWaterfall 物料属性 schema 定义。
|
|
9
9
|
*/
|
|
10
10
|
declare const homeRecommendWaterfallInspectorPropsSchema: z$1.ZodObject<{
|
|
11
|
-
|
|
11
|
+
title: z$1.ZodOptional<z$1.ZodString> & SchemaHasDefaultValue;
|
|
12
|
+
enableInfinite: z$1.ZodOptional<z$1.ZodBoolean> & SchemaHasDefaultValue;
|
|
12
13
|
}, z$1.core.$strip>;
|
|
13
14
|
declare const homeRecommendWaterfallInspectorDefaultProps: {
|
|
14
|
-
|
|
15
|
+
title: string;
|
|
16
|
+
enableInfinite: boolean;
|
|
15
17
|
};
|
|
16
18
|
type HomeRecommendWaterfallInspectorProps = z$1.infer<typeof homeRecommendWaterfallInspectorPropsSchema>;
|
|
17
19
|
//#endregion
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{defineComponentPropsSchema as e,
|
|
2
|
+
import{defineComponentPropsSchema as e,defineSwitchPropSchema as t,defineTextPropSchema as n,getSchemaDefaultProps as r}from"../../../../../../utils/schema/schema.mjs";const i=e({title:n({label:`推荐位名称`,description:``,required:!1,defaultValue:``}),enableInfinite:t({label:`无限下拉`,defaultValue:!1,required:!1})}),a=r(i);export{a as homeRecommendWaterfallInspectorDefaultProps,i as homeRecommendWaterfallInspectorPropsSchema};
|
package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/material.d.mts
CHANGED
|
@@ -8,7 +8,8 @@ import * as zod_v4_core0 from "zod/v4/core";
|
|
|
8
8
|
|
|
9
9
|
//#region components/biz/business/home-recommend/variants/home-recommend-waterfall/material.d.ts
|
|
10
10
|
declare const homeRecommendWaterfallMaterial: DefineMaterialOption<typeof HomeRecommendWaterfall, typeof HomeRecommendWaterfall, zod.ZodObject<{
|
|
11
|
-
|
|
11
|
+
title: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
|
|
12
|
+
enableInfinite: zod.ZodOptional<zod.ZodBoolean> & SchemaHasDefaultValue;
|
|
12
13
|
}, zod_v4_core0.$strip>, "home-recommend-waterfall">;
|
|
13
14
|
//#endregion
|
|
14
15
|
export { homeRecommendWaterfallMaterial };
|
package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/material.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{defineMaterial as e}from"../../../../../../utils/schema/material.mjs";import{homeRecommendWaterfallInspectorPropsSchema as t}from"./inspector-schema.mjs";import{HomeRecommendWaterfall as n}from"./server.mjs";const r=e({type:`home-recommend-waterfall`,name:`瀑布流`,icon:`/static/components-thumb/grid_waterfall_two_column.png`,category
|
|
2
|
+
import{defineMaterial as e}from"../../../../../../utils/schema/material.mjs";import{homeRecommendWaterfallInspectorPropsSchema as t}from"./inspector-schema.mjs";import{HomeRecommendWaterfall as n}from"./server.mjs";const r=e({type:`home-recommend-waterfall`,name:`瀑布流`,icon:`/static/components-thumb/grid_waterfall_two_column.png`,category:`内容组件`,serverComponent:n,clientComponent:n,propsSchema:t});export{r as homeRecommendWaterfallMaterial};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{useAppContext as e}from"../../../../../../../hooks/use-app-context/index.mjs";import t from"../../../shared/home-recommend-base.mjs";import{
|
|
2
|
+
"use client";import{useAppContext as e}from"../../../../../../../hooks/use-app-context/index.mjs";import t from"../../../shared/home-recommend-base.mjs";import{buildHomeRecommendEditorPreviewData as n}from"../../../shared/home-recommend-preview.mjs";import{useMemo as r}from"react";import{jsx as i}from"react/jsx-runtime";function a(a){let o=e()===`editor`,s=a.props||{},c=r(()=>o?n({variant:`waterfall`,schemaTitle:s.title,enableInfinite:s.enableInfinite,data:a.data}):a.data,[o,a.data,s.enableInfinite,s.title]);return i(`div`,{className:o?`pointer-events-none`:void 0,children:i(t,{variant:`waterfall`,...a,data:c})})}export{a as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
const e={componentName:`HomeRecommendWaterfall`,displayName
|
|
2
|
+
const e={componentName:`HomeRecommendWaterfall`,displayName:`瀑布流`,category:`HomeRecommend`,categoryName:`内容组件`,enabled:!0};export{e as componentMeta};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
const e={
|
|
2
|
+
const e={};export{e as propsSchema};
|
package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/server.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import
|
|
2
|
+
import e from"./runtime/client.mjs";import{jsx as t}from"react/jsx-runtime";function n(n){let{title:r,enableInfinite:i,data:a}=n;return t(e,{props:{title:r,enableInfinite:i},data:a})}export{n as HomeRecommendWaterfall};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{__exportAll as e}from"../../../_virtual/_rolldown/runtime.mjs";import{defaultProps as t}from"./banner/variants/basic-banner/defaults/default-props.mjs";import{schema as n}from"./banner/variants/basic-banner/schema/index.mjs";import{basicBannerInspectorDefaultProps as r,basicBannerInspectorPropsSchema as i}from"./banner/variants/basic-banner/inspector-schema.mjs";import{BasicBanner as a}from"./banner/variants/basic-banner/server.mjs";import{basicBannerMaterial as o}from"./banner/variants/basic-banner/material.mjs";import s from"./banner/variants/basic-banner/index.mjs";import{defaultProps as c}from"./card-grid/variants/card-grid-2x3/defaults/default-props.mjs";import{schema as l}from"./card-grid/variants/card-grid-2x3/schema/index.mjs";import u from"./card-grid/variants/card-grid-2x3/index.mjs";import{defaultProps as d}from"./card-grid/variants/card-grid-2x3-infinite/defaults/default-props.mjs";import{schema as f}from"./card-grid/variants/card-grid-2x3-infinite/schema/index.mjs";import p from"./card-grid/variants/card-grid-2x3-infinite/index.mjs";import{defaultProps as m}from"./card-grid/variants/card-grid-2x4/defaults/default-props.mjs";import{schema as h}from"./card-grid/variants/card-grid-2x4/schema/index.mjs";import g from"./card-grid/variants/card-grid-2x4/index.mjs";import{defaultProps as _}from"./card-grid/variants/card-grid-3x3/defaults/default-props.mjs";import{schema as v}from"./card-grid/variants/card-grid-3x3/schema/index.mjs";import y from"./card-grid/variants/card-grid-3x3/index.mjs";import{defaultProps as b}from"./card-grid/variants/card-grid-3x3-infinite/defaults/default-props.mjs";import{schema as x}from"./card-grid/variants/card-grid-3x3-infinite/schema/index.mjs";import S from"./card-grid/variants/card-grid-3x3-infinite/index.mjs";import{defaultProps as C}from"./feature-grid/variants/basic-feature-grid/defaults/default-props.mjs";import{schema as w}from"./feature-grid/variants/basic-feature-grid/schema/index.mjs";import T from"./feature-grid/variants/basic-feature-grid/index.mjs";import{FloatingBallClient as E}from"./floating-ball/client.mjs";import{floatingBallInspectorDefaultProps as D,floatingBallInspectorPropsSchema as O}from"./floating-ball/schema.mjs";import{FloatingBall as k}from"./floating-ball/server.mjs";import{floatingBallMaterial as A}from"./floating-ball/material.mjs";import{defaultProps as j}from"../basics/fullscreen-feed/defaults/default-props.mjs";import{schema as M}from"../basics/fullscreen-feed/schema/index.mjs";import N from"../basics/fullscreen-feed/index.mjs";import{defaultProps as P}from"./fullscreen-feed/variants/fullscreen-post-feed/defaults/default-props.mjs";import{schema as F}from"./fullscreen-feed/variants/fullscreen-post-feed/schema/index.mjs";import I from"./fullscreen-feed/variants/fullscreen-post-feed/index.mjs";import{defaultProps as L}from"./fullscreen-feed/variants/fullscreen-video-feed/defaults/default-props.mjs";import{schema as R}from"./fullscreen-feed/variants/fullscreen-video-feed/schema/index.mjs";import z from"./fullscreen-feed/variants/fullscreen-video-feed/index.mjs";import{defaultProps as B}from"./home-recommend/variants/home-recommend-grid/defaults/default-props.mjs";import{defaultProps as V}from"./search-bar/variants/detail-search-bar/defaults/default-props.mjs";import{schema as H}from"./search-bar/variants/detail-search-bar/schema/index.mjs";import U from"./search-bar/variants/detail-search-bar/index.mjs";import{schema as W}from"./home-recommend/variants/home-recommend-grid/schema/index.mjs";import{homeRecommendGridInspectorDefaultProps as G,homeRecommendGridInspectorPropsSchema as K}from"./home-recommend/variants/home-recommend-grid/inspector-schema.mjs";import{HomeRecommendGrid as q}from"./home-recommend/variants/home-recommend-grid/server.mjs";import{homeRecommendGridMaterial as J}from"./home-recommend/variants/home-recommend-grid/material.mjs";import Y from"./home-recommend/variants/home-recommend-grid/index.mjs";import{defaultProps as X}from"./home-recommend/variants/home-recommend-waterfall/defaults/default-props.mjs";import{schema as Z}from"./home-recommend/variants/home-recommend-waterfall/schema/index.mjs";import{homeRecommendWaterfallInspectorDefaultProps as Q,homeRecommendWaterfallInspectorPropsSchema as $}from"./home-recommend/variants/home-recommend-waterfall/inspector-schema.mjs";import{HomeRecommendWaterfall as ee}from"./home-recommend/variants/home-recommend-waterfall/server.mjs";import{homeRecommendWaterfallMaterial as te}from"./home-recommend/variants/home-recommend-waterfall/material.mjs";import ne from"./home-recommend/variants/home-recommend-waterfall/index.mjs";import{MarqueeClient as re}from"./marquee/client.mjs";import{marqueeInspectorPropsSchema as ie}from"./marquee/schema.mjs";import{MarqueeServer as ae}from"./marquee/server.mjs";import{marqueeMaterial as oe}from"./marquee/material.mjs";import{defaultProps as se}from"./nav-bar/variants/basic-nav-bar/defaults/default-props.mjs";import{schema as ce}from"./nav-bar/variants/basic-nav-bar/schema/index.mjs";import le from"./nav-bar/variants/basic-nav-bar/index.mjs";import{defaultProps as ue}from"./post-card/variants/basic-post-card/defaults/default-props.mjs";import{schema as de}from"./post-card/variants/basic-post-card/schema/index.mjs";import fe from"./post-card/variants/basic-post-card/index.mjs";import{UserProfileHeaderClient as pe}from"./profile/profile-header/client.mjs";import{profileHeaderInspectorDefaultProps as me,profileHeaderInspectorPropsSchema as he}from"./profile/profile-header/schema.mjs";import{UserProfileHeader as ge,buildUserProfileHeaderPrefetch as _e}from"./profile/profile-header/server.mjs";import{profileHeaderMaterial as ve,profileHeaderMaterialWithDisabledBackground as ye}from"./profile/profile-header/material.mjs";import{profileMainCollectCollectionTabOptions as be,profileMainCollectTabOptions as xe,profileMainHistoryTabOptions as Se,profileMainLikeTabOptions as Ce,profileMainMineTabOptions as we,profileMainProfileTabOptions as Te,profileMainTabOptions as Ee}from"./profile/profile-main/variants.mjs";import{UserProfileMainShell as De}from"./profile/profile-main/shell.mjs";import{UserProfileMainClient as Oe}from"./profile/profile-main/client.mjs";import{profileMainInspectorDefaultProps as ke,profileMainInspectorPropsSchema as Ae}from"./profile/profile-main/schema.mjs";import{CollectTab as je}from"./profile/profile-main/tabs/collect-tab/client.mjs";import{CollectTabServer as Me,buildCollectTabPrefetch as Ne}from"./profile/profile-main/tabs/collect-tab/server.mjs";import{HistoryTab as Pe}from"./profile/profile-main/tabs/history-tab/client.mjs";import{HistoryTabServer as Fe,buildHistoryTabPrefetch as Ie}from"./profile/profile-main/tabs/history-tab/server.mjs";import{LikeTab as Le}from"./profile/profile-main/tabs/like-tab/client.mjs";import{LikeTabServer as Re,buildLikeTabPrefetch as ze}from"./profile/profile-main/tabs/like-tab/server.mjs";import{PublishTab as Be}from"./profile/profile-main/tabs/publish-tab/client.mjs";import{PublishTabServer as Ve,buildPublishTabPrefetch as He}from"./profile/profile-main/tabs/publish-tab/server.mjs";import{UserProfileMain as Ue}from"./profile/profile-main/server.mjs";import{profileMainMaterial as We}from"./profile/profile-main/material.mjs";import{defaultProps as Ge}from"./recommended-users/variants/basic-recommended-users/defaults/default-props.mjs";import{schema as Ke}from"./recommended-users/variants/basic-recommended-users/schema/index.mjs";import qe from"./recommended-users/variants/basic-recommended-users/index.mjs";import{defaultProps as Je}from"./search-bar/variants/basic-search-bar/defaults/default-props.mjs";import{schema as Ye}from"./search-bar/variants/basic-search-bar/schema/index.mjs";import Xe from"./search-bar/variants/basic-search-bar/index.mjs";import{defaultProps as Ze}from"./search-bar/variants/filter-search-bar/defaults/default-props.mjs";import{schema as Qe}from"./search-bar/variants/filter-search-bar/schema/index.mjs";import $e from"./search-bar/variants/filter-search-bar/index.mjs";import{defaultProps as et}from"./search-bar/variants/tag-search-bar/defaults/default-props.mjs";import{schema as tt}from"./search-bar/variants/tag-search-bar/schema/index.mjs";import nt from"./search-bar/variants/tag-search-bar/index.mjs";import{SearchHistoryClient as rt}from"./search-history/client.mjs";import{searchHistoryInspectorPropsSchema as it}from"./search-history/schema.mjs";import{SearchHistoryServer as at}from"./search-history/server.mjs";import{searchHistoryMaterial as ot}from"./search-history/material.mjs";import{SearchInputClient as st}from"./search-input/client.mjs";import{searchInputInspectorPropsSchema as ct}from"./search-input/schema.mjs";import{SearchInputServer as lt}from"./search-input/server.mjs";import{searchInputMaterial as ut}from"./search-input/material.mjs";import{TabBarClient as dt}from"./tab-bar/client.mjs";import{tabBarInspectorPropsSchema as ft}from"./tab-bar/schema.mjs";import{TabBarServer as pt}from"./tab-bar/server.mjs";import{tabBarMaterial as mt}from"./tab-bar/material.mjs";import{TextRecommendClient as ht}from"./text-recommend/client.mjs";import{textRecommendInspectorPropsSchema as gt}from"./text-recommend/schema.mjs";import{TextRecommendServer as _t}from"./text-recommend/server.mjs";import{textRecommendMaterial as vt}from"./text-recommend/material.mjs";import{VideoHorizontalListClient as yt}from"./video-horizontal-list/client.mjs";import{videoHorizontalListInspectorPropsSchema as bt}from"./video-horizontal-list/schema.mjs";import{VideoHorizontalListServer as xt}from"./video-horizontal-list/server.mjs";import{videoHorizontalListMaterial as St}from"./video-horizontal-list/material.mjs";var Ct=e({BasicBanner:()=>s,BasicBannerDefaultData:()=>t,BasicBannerMaterialComponent:()=>a,BasicBannerSchema:()=>n,BasicFeatureGrid:()=>T,BasicFeatureGridDefaultData:()=>C,BasicFeatureGridSchema:()=>w,BasicFullscreenFeed:()=>N,BasicFullscreenFeedDefaultData:()=>j,BasicFullscreenFeedSchema:()=>M,BasicNavBar:()=>le,BasicNavBarDefaultData:()=>se,BasicNavBarSchema:()=>ce,BasicPostCard:()=>fe,BasicPostCardDefaultData:()=>ue,BasicPostCardSchema:()=>de,BasicRecommendedUsers:()=>qe,BasicRecommendedUsersDefaultData:()=>Ge,BasicRecommendedUsersSchema:()=>Ke,BasicSearchBar:()=>Xe,BasicSearchBarDefaultData:()=>Je,BasicSearchBarSchema:()=>Ye,CardGrid2x3:()=>u,CardGrid2x3DefaultData:()=>c,CardGrid2x3Infinite:()=>p,CardGrid2x3InfiniteDefaultData:()=>d,CardGrid2x3InfiniteSchema:()=>f,CardGrid2x3Schema:()=>l,CardGrid2x4:()=>g,CardGrid2x4DefaultData:()=>m,CardGrid2x4Schema:()=>h,CardGrid3x3:()=>y,CardGrid3x3DefaultData:()=>_,CardGrid3x3Infinite:()=>S,CardGrid3x3InfiniteDefaultData:()=>b,CardGrid3x3InfiniteSchema:()=>x,CardGrid3x3Schema:()=>v,CollectTab:()=>je,CollectTabServer:()=>Me,DetailSearchBar:()=>U,DetailSearchBarDefaultData:()=>V,DetailSearchBarSchema:()=>H,FilterSearchBar:()=>$e,FilterSearchBarDefaultData:()=>Ze,FilterSearchBarSchema:()=>Qe,FloatingBall:()=>k,FloatingBallClient:()=>E,FullscreenFeedClient:()=>I,FullscreenPostFeedDefaultData:()=>P,FullscreenPostFeedSchema:()=>F,FullscreenVideoClient:()=>z,FullscreenVideoFeedDefaultData:()=>L,FullscreenVideoFeedSchema:()=>R,HistoryTab:()=>Pe,HistoryTabServer:()=>Fe,HomeRecommendGrid:()=>Y,HomeRecommendGridDefaultData:()=>B,HomeRecommendGridMaterialComponent:()=>q,HomeRecommendGridSchema:()=>W,HomeRecommendWaterfall:()=>ne,HomeRecommendWaterfallDefaultData:()=>X,HomeRecommendWaterfallMaterialComponent:()=>ee,HomeRecommendWaterfallSchema:()=>Z,LikeTab:()=>Le,LikeTabServer:()=>Re,MarqueeClient:()=>re,MarqueeServer:()=>ae,PublishTab:()=>Be,PublishTabServer:()=>Ve,SearchHistoryClient:()=>rt,SearchHistoryServer:()=>at,SearchInputClient:()=>st,SearchInputServer:()=>lt,TabBarClient:()=>dt,TabBarServer:()=>pt,TagSearchBar:()=>nt,TagSearchBarDefaultData:()=>et,TagSearchBarSchema:()=>tt,TextRecommendClient:()=>ht,TextRecommendServer:()=>_t,UserProfileHeader:()=>ge,UserProfileHeaderClient:()=>pe,UserProfileMain:()=>Ue,UserProfileMainClient:()=>Oe,UserProfileMainShell:()=>De,VideoHorizontalListClient:()=>yt,VideoHorizontalListServer:()=>xt,basicBannerInspectorDefaultProps:()=>r,basicBannerInspectorPropsSchema:()=>i,basicBannerMaterial:()=>o,buildCollectTabPrefetch:()=>Ne,buildHistoryTabPrefetch:()=>Ie,buildLikeTabPrefetch:()=>ze,buildPublishTabPrefetch:()=>He,buildUserProfileHeaderPrefetch:()=>_e,floatingBallInspectorDefaultProps:()=>D,floatingBallInspectorPropsSchema:()=>O,floatingBallMaterial:()=>A,homeRecommendGridInspectorDefaultProps:()=>G,homeRecommendGridInspectorPropsSchema:()=>K,homeRecommendGridMaterial:()=>J,homeRecommendWaterfallInspectorDefaultProps:()=>Q,homeRecommendWaterfallInspectorPropsSchema:()=>$,homeRecommendWaterfallMaterial:()=>te,marqueeInspectorPropsSchema:()=>ie,marqueeMaterial:()=>oe,profileHeaderInspectorDefaultProps:()=>me,profileHeaderInspectorPropsSchema:()=>he,profileHeaderMaterial:()=>ve,profileHeaderMaterialWithDisabledBackground:()=>ye,profileMainCollectCollectionTabOptions:()=>be,profileMainCollectTabOptions:()=>xe,profileMainHistoryTabOptions:()=>Se,profileMainInspectorDefaultProps:()=>ke,profileMainInspectorPropsSchema:()=>Ae,profileMainLikeTabOptions:()=>Ce,profileMainMaterial:()=>We,profileMainMineTabOptions:()=>we,profileMainProfileTabOptions:()=>Te,profileMainTabOptions:()=>Ee,searchHistoryInspectorPropsSchema:()=>it,searchHistoryMaterial:()=>ot,searchInputInspectorPropsSchema:()=>ct,searchInputMaterial:()=>ut,tabBarInspectorPropsSchema:()=>ft,tabBarMaterial:()=>mt,textRecommendInspectorPropsSchema:()=>gt,textRecommendMaterial:()=>vt,videoHorizontalListInspectorPropsSchema:()=>bt,videoHorizontalListMaterial:()=>St});export{Ct as business_exports};
|
|
2
|
+
import{__exportAll as e}from"../../../_virtual/_rolldown/runtime.mjs";import{defaultProps as t}from"./banner/variants/basic-banner/defaults/default-props.mjs";import{schema as n}from"./banner/variants/basic-banner/schema/index.mjs";import{basicBannerInspectorDefaultProps as r,basicBannerInspectorPropsSchema as i}from"./banner/variants/basic-banner/inspector-schema.mjs";import{BasicBanner as a}from"./banner/variants/basic-banner/server.mjs";import{basicBannerMaterial as o}from"./banner/variants/basic-banner/material.mjs";import s from"./banner/variants/basic-banner/index.mjs";import{defaultProps as c}from"./card-grid/variants/card-grid-2x3/defaults/default-props.mjs";import{schema as l}from"./card-grid/variants/card-grid-2x3/schema/index.mjs";import u from"./card-grid/variants/card-grid-2x3/index.mjs";import{defaultProps as d}from"./card-grid/variants/card-grid-2x3-infinite/defaults/default-props.mjs";import{schema as f}from"./card-grid/variants/card-grid-2x3-infinite/schema/index.mjs";import p from"./card-grid/variants/card-grid-2x3-infinite/index.mjs";import{defaultProps as m}from"./card-grid/variants/card-grid-2x4/defaults/default-props.mjs";import{schema as h}from"./card-grid/variants/card-grid-2x4/schema/index.mjs";import g from"./card-grid/variants/card-grid-2x4/index.mjs";import{defaultProps as _}from"./card-grid/variants/card-grid-3x3/defaults/default-props.mjs";import{schema as v}from"./card-grid/variants/card-grid-3x3/schema/index.mjs";import y from"./card-grid/variants/card-grid-3x3/index.mjs";import{defaultProps as b}from"./card-grid/variants/card-grid-3x3-infinite/defaults/default-props.mjs";import{schema as x}from"./card-grid/variants/card-grid-3x3-infinite/schema/index.mjs";import S from"./card-grid/variants/card-grid-3x3-infinite/index.mjs";import{defaultProps as C}from"./feature-grid/variants/basic-feature-grid/defaults/default-props.mjs";import{schema as w}from"./feature-grid/variants/basic-feature-grid/schema/index.mjs";import T from"./feature-grid/variants/basic-feature-grid/index.mjs";import{FloatingBallClient as E}from"./floating-ball/client.mjs";import{floatingBallInspectorDefaultProps as D,floatingBallInspectorPropsSchema as O}from"./floating-ball/schema.mjs";import{FloatingBall as k}from"./floating-ball/server.mjs";import{floatingBallMaterial as A}from"./floating-ball/material.mjs";import{defaultProps as j}from"../basics/fullscreen-feed/defaults/default-props.mjs";import{schema as M}from"../basics/fullscreen-feed/schema/index.mjs";import N from"../basics/fullscreen-feed/index.mjs";import{defaultProps as P}from"./fullscreen-feed/variants/fullscreen-post-feed/defaults/default-props.mjs";import{schema as F}from"./fullscreen-feed/variants/fullscreen-post-feed/schema/index.mjs";import I from"./fullscreen-feed/variants/fullscreen-post-feed/index.mjs";import{defaultProps as L}from"./fullscreen-feed/variants/fullscreen-video-feed/defaults/default-props.mjs";import{schema as R}from"./fullscreen-feed/variants/fullscreen-video-feed/schema/index.mjs";import z from"./fullscreen-feed/variants/fullscreen-video-feed/index.mjs";import{defaultProps as B}from"./home-recommend/variants/home-recommend-grid/defaults/default-props.mjs";import{defaultProps as V}from"./search-bar/variants/detail-search-bar/defaults/default-props.mjs";import{schema as H}from"./search-bar/variants/detail-search-bar/schema/index.mjs";import U from"./search-bar/variants/detail-search-bar/index.mjs";import{schema as W}from"./home-recommend/variants/home-recommend-grid/schema/index.mjs";import{homeRecommendGridInspectorDefaultProps as G,homeRecommendGridInspectorPropsSchema as K}from"./home-recommend/variants/home-recommend-grid/inspector-schema.mjs";import{HomeRecommendGrid as q}from"./home-recommend/variants/home-recommend-grid/server.mjs";import{homeRecommendGridMaterial as J}from"./home-recommend/variants/home-recommend-grid/material.mjs";import Y from"./home-recommend/variants/home-recommend-grid/index.mjs";import{defaultProps as X}from"./home-recommend/variants/home-recommend-waterfall/defaults/default-props.mjs";import{schema as Z}from"./home-recommend/variants/home-recommend-waterfall/schema/index.mjs";import{homeRecommendWaterfallInspectorDefaultProps as Q,homeRecommendWaterfallInspectorPropsSchema as $}from"./home-recommend/variants/home-recommend-waterfall/inspector-schema.mjs";import{HomeRecommendWaterfall as ee}from"./home-recommend/variants/home-recommend-waterfall/server.mjs";import{homeRecommendWaterfallMaterial as te}from"./home-recommend/variants/home-recommend-waterfall/material.mjs";import ne from"./home-recommend/variants/home-recommend-waterfall/index.mjs";import{MarqueeClient as re}from"./marquee/client.mjs";import{marqueeInspectorPropsSchema as ie}from"./marquee/schema.mjs";import{MarqueeServer as ae}from"./marquee/server.mjs";import{marqueeMaterial as oe}from"./marquee/material.mjs";import{defaultProps as se}from"./nav-bar/variants/basic-nav-bar/defaults/default-props.mjs";import{schema as ce}from"./nav-bar/variants/basic-nav-bar/schema/index.mjs";import le from"./nav-bar/variants/basic-nav-bar/index.mjs";import{defaultProps as ue}from"./post-card/variants/basic-post-card/defaults/default-props.mjs";import{schema as de}from"./post-card/variants/basic-post-card/schema/index.mjs";import fe from"./post-card/variants/basic-post-card/index.mjs";import{UserProfileHeaderClient as pe}from"./profile/profile-header/client.mjs";import{profileHeaderInspectorDefaultProps as me,profileHeaderInspectorPropsSchema as he}from"./profile/profile-header/schema.mjs";import{UserProfileHeader as ge,buildUserProfileHeaderPrefetch as _e}from"./profile/profile-header/server.mjs";import{profileHeaderMaterial as ve,profileHeaderMaterialWithDisabledBackground as ye}from"./profile/profile-header/material.mjs";import{profileMainCollectCollectionTabOptions as be,profileMainCollectTabOptions as xe,profileMainHistoryTabOptions as Se,profileMainLikeTabOptions as Ce,profileMainMineTabOptions as we,profileMainProfileTabOptions as Te,profileMainTabOptions as Ee}from"./profile/profile-main/variants.mjs";import{UserProfileMainShell as De}from"./profile/profile-main/shell.mjs";import{UserProfileMainClient as Oe}from"./profile/profile-main/client.mjs";import{profileMainInspectorDefaultProps as ke,profileMainInspectorPropsSchema as Ae}from"./profile/profile-main/schema.mjs";import{CollectTab as je}from"./profile/profile-main/tabs/collect-tab/client.mjs";import{CollectTabServer as Me,buildCollectTabPrefetch as Ne}from"./profile/profile-main/tabs/collect-tab/server.mjs";import{HistoryTab as Pe}from"./profile/profile-main/tabs/history-tab/client.mjs";import{HistoryTabServer as Fe,buildHistoryTabPrefetch as Ie}from"./profile/profile-main/tabs/history-tab/server.mjs";import{LikeTab as Le}from"./profile/profile-main/tabs/like-tab/client.mjs";import{LikeTabServer as Re,buildLikeTabPrefetch as ze}from"./profile/profile-main/tabs/like-tab/server.mjs";import{UserProfileMain as Be}from"./profile/profile-main/server.mjs";import{profileMainMaterial as Ve}from"./profile/profile-main/material.mjs";import{PublishTab as He}from"./profile/profile-main/tabs/publish-tab/client.mjs";import{PublishTabServer as Ue,buildPublishTabPrefetch as We}from"./profile/profile-main/tabs/publish-tab/server.mjs";import{defaultProps as Ge}from"./recommended-users/variants/basic-recommended-users/defaults/default-props.mjs";import{schema as Ke}from"./recommended-users/variants/basic-recommended-users/schema/index.mjs";import qe from"./recommended-users/variants/basic-recommended-users/index.mjs";import{defaultProps as Je}from"./search-bar/variants/basic-search-bar/defaults/default-props.mjs";import{schema as Ye}from"./search-bar/variants/basic-search-bar/schema/index.mjs";import Xe from"./search-bar/variants/basic-search-bar/index.mjs";import{defaultProps as Ze}from"./search-bar/variants/filter-search-bar/defaults/default-props.mjs";import{schema as Qe}from"./search-bar/variants/filter-search-bar/schema/index.mjs";import $e from"./search-bar/variants/filter-search-bar/index.mjs";import{defaultProps as et}from"./search-bar/variants/tag-search-bar/defaults/default-props.mjs";import{schema as tt}from"./search-bar/variants/tag-search-bar/schema/index.mjs";import nt from"./search-bar/variants/tag-search-bar/index.mjs";import{SearchHistoryClient as rt}from"./search-history/client.mjs";import{searchHistoryInspectorPropsSchema as it}from"./search-history/schema.mjs";import{SearchHistoryServer as at}from"./search-history/server.mjs";import{searchHistoryMaterial as ot}from"./search-history/material.mjs";import{SearchInputClient as st}from"./search-input/client.mjs";import{searchInputInspectorPropsSchema as ct}from"./search-input/schema.mjs";import{SearchInputServer as lt}from"./search-input/server.mjs";import{searchInputMaterial as ut}from"./search-input/material.mjs";import{TabBarClient as dt}from"./tab-bar/client.mjs";import{tabBarInspectorPropsSchema as ft}from"./tab-bar/schema.mjs";import{TabBarServer as pt}from"./tab-bar/server.mjs";import{tabBarMaterial as mt}from"./tab-bar/material.mjs";import{TextRecommendClient as ht}from"./text-recommend/client.mjs";import{textRecommendInspectorPropsSchema as gt}from"./text-recommend/schema.mjs";import{TextRecommendServer as _t}from"./text-recommend/server.mjs";import{textRecommendMaterial as vt}from"./text-recommend/material.mjs";import{VideoHorizontalListClient as yt}from"./video-horizontal-list/client.mjs";import{videoHorizontalListInspectorPropsSchema as bt}from"./video-horizontal-list/schema.mjs";import{VideoHorizontalListServer as xt}from"./video-horizontal-list/server.mjs";import{videoHorizontalListMaterial as St}from"./video-horizontal-list/material.mjs";var Ct=e({BasicBanner:()=>s,BasicBannerDefaultData:()=>t,BasicBannerMaterialComponent:()=>a,BasicBannerSchema:()=>n,BasicFeatureGrid:()=>T,BasicFeatureGridDefaultData:()=>C,BasicFeatureGridSchema:()=>w,BasicFullscreenFeed:()=>N,BasicFullscreenFeedDefaultData:()=>j,BasicFullscreenFeedSchema:()=>M,BasicNavBar:()=>le,BasicNavBarDefaultData:()=>se,BasicNavBarSchema:()=>ce,BasicPostCard:()=>fe,BasicPostCardDefaultData:()=>ue,BasicPostCardSchema:()=>de,BasicRecommendedUsers:()=>qe,BasicRecommendedUsersDefaultData:()=>Ge,BasicRecommendedUsersSchema:()=>Ke,BasicSearchBar:()=>Xe,BasicSearchBarDefaultData:()=>Je,BasicSearchBarSchema:()=>Ye,CardGrid2x3:()=>u,CardGrid2x3DefaultData:()=>c,CardGrid2x3Infinite:()=>p,CardGrid2x3InfiniteDefaultData:()=>d,CardGrid2x3InfiniteSchema:()=>f,CardGrid2x3Schema:()=>l,CardGrid2x4:()=>g,CardGrid2x4DefaultData:()=>m,CardGrid2x4Schema:()=>h,CardGrid3x3:()=>y,CardGrid3x3DefaultData:()=>_,CardGrid3x3Infinite:()=>S,CardGrid3x3InfiniteDefaultData:()=>b,CardGrid3x3InfiniteSchema:()=>x,CardGrid3x3Schema:()=>v,CollectTab:()=>je,CollectTabServer:()=>Me,DetailSearchBar:()=>U,DetailSearchBarDefaultData:()=>V,DetailSearchBarSchema:()=>H,FilterSearchBar:()=>$e,FilterSearchBarDefaultData:()=>Ze,FilterSearchBarSchema:()=>Qe,FloatingBall:()=>k,FloatingBallClient:()=>E,FullscreenFeedClient:()=>I,FullscreenPostFeedDefaultData:()=>P,FullscreenPostFeedSchema:()=>F,FullscreenVideoClient:()=>z,FullscreenVideoFeedDefaultData:()=>L,FullscreenVideoFeedSchema:()=>R,HistoryTab:()=>Pe,HistoryTabServer:()=>Fe,HomeRecommendGrid:()=>Y,HomeRecommendGridDefaultData:()=>B,HomeRecommendGridMaterialComponent:()=>q,HomeRecommendGridSchema:()=>W,HomeRecommendWaterfall:()=>ne,HomeRecommendWaterfallDefaultData:()=>X,HomeRecommendWaterfallMaterialComponent:()=>ee,HomeRecommendWaterfallSchema:()=>Z,LikeTab:()=>Le,LikeTabServer:()=>Re,MarqueeClient:()=>re,MarqueeServer:()=>ae,PublishTab:()=>He,PublishTabServer:()=>Ue,SearchHistoryClient:()=>rt,SearchHistoryServer:()=>at,SearchInputClient:()=>st,SearchInputServer:()=>lt,TabBarClient:()=>dt,TabBarServer:()=>pt,TagSearchBar:()=>nt,TagSearchBarDefaultData:()=>et,TagSearchBarSchema:()=>tt,TextRecommendClient:()=>ht,TextRecommendServer:()=>_t,UserProfileHeader:()=>ge,UserProfileHeaderClient:()=>pe,UserProfileMain:()=>Be,UserProfileMainClient:()=>Oe,UserProfileMainShell:()=>De,VideoHorizontalListClient:()=>yt,VideoHorizontalListServer:()=>xt,basicBannerInspectorDefaultProps:()=>r,basicBannerInspectorPropsSchema:()=>i,basicBannerMaterial:()=>o,buildCollectTabPrefetch:()=>Ne,buildHistoryTabPrefetch:()=>Ie,buildLikeTabPrefetch:()=>ze,buildPublishTabPrefetch:()=>We,buildUserProfileHeaderPrefetch:()=>_e,floatingBallInspectorDefaultProps:()=>D,floatingBallInspectorPropsSchema:()=>O,floatingBallMaterial:()=>A,homeRecommendGridInspectorDefaultProps:()=>G,homeRecommendGridInspectorPropsSchema:()=>K,homeRecommendGridMaterial:()=>J,homeRecommendWaterfallInspectorDefaultProps:()=>Q,homeRecommendWaterfallInspectorPropsSchema:()=>$,homeRecommendWaterfallMaterial:()=>te,marqueeInspectorPropsSchema:()=>ie,marqueeMaterial:()=>oe,profileHeaderInspectorDefaultProps:()=>me,profileHeaderInspectorPropsSchema:()=>he,profileHeaderMaterial:()=>ve,profileHeaderMaterialWithDisabledBackground:()=>ye,profileMainCollectCollectionTabOptions:()=>be,profileMainCollectTabOptions:()=>xe,profileMainHistoryTabOptions:()=>Se,profileMainInspectorDefaultProps:()=>ke,profileMainInspectorPropsSchema:()=>Ae,profileMainLikeTabOptions:()=>Ce,profileMainMaterial:()=>Ve,profileMainMineTabOptions:()=>we,profileMainProfileTabOptions:()=>Te,profileMainTabOptions:()=>Ee,searchHistoryInspectorPropsSchema:()=>it,searchHistoryMaterial:()=>ot,searchInputInspectorPropsSchema:()=>ct,searchInputMaterial:()=>ut,tabBarInspectorPropsSchema:()=>ft,tabBarMaterial:()=>mt,textRecommendInspectorPropsSchema:()=>gt,textRecommendMaterial:()=>vt,videoHorizontalListInspectorPropsSchema:()=>bt,videoHorizontalListMaterial:()=>St});export{Ct as business_exports};
|
|
@@ -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{
|
|
2
|
+
"use client";import{Box as e}from"../../../ui/box.mjs";import{Text as t}from"../../../ui/text.mjs";import n from"../../../ui/link.mjs";import r from"../../../../assets/icons/common/right_arrow.mjs";import{LargeGridItemClient as i}from"./card-item.mjs";import{largeFeatureGridInspectorDefaultProps as a}from"./schema.mjs";import{jsx as o,jsxs as s}from"react/jsx-runtime";const c=[],l=a.data??[];function u(e){return e==null||e===``}function d(e,t){return u(e)?t:e}function f(e,t){return t?{...e,...t,id:d(t.id,e.id),cover:d(t.cover,e.cover),title:d(t.title,e.title),desc:d(t.desc,e.desc),tag:d(t.tag,e.tag),superscript:t.superscript??e.superscript,playCount:d(t.playCount,e.playCount),playCountDelta:t.playCountDelta??e.playCountDelta,showPlayCount:t.showPlayCount??e.showPlayCount,duration:d(t.duration,e.duration),showEpisode:t.showEpisode??e.showEpisode,useContentCover:t.useContentCover??e.useContentCover,tagImageUrl:d(t.tagImageUrl,e.tagImageUrl),tag_image:d(t.tag_image,e.tag_image),tag_image_url:d(t.tag_image_url,e.tag_image_url),tagImage:d(t.tagImage,e.tagImage)}:e}function p(e,t){if(!t)return e;let n=e.items;return{...e,...t,title:d(t.title,e.title),moreUrl:d(t.moreUrl,e.moreUrl),moreLinkType:t.moreLinkType??e.moreLinkType,recommendMode:t.recommendMode??e.recommendMode,items:n?f(n,t.items):t.items}}function m({data:a=c}){let u=Array.isArray(a)&&a.length>0?[p(l[0],a[0])]:l;if(!u||u.length===0)return null;let d=u[0],f=d?.title,m=d?.moreUrl;return s(e,{className:`p-3`,children:[s(e,{className:`flex items-center justify-between mb-[10px] h-[24px]`,children:[f&&o(t,{as:`h2`,className:`text-[18px] font-bold text-text1 line-clamp-1 flex-1 min-w-0 mr-[12px]`,children:f}),m&&s(n,{href:m,className:`flex items-center text-[14px] text-text2 ml-auto`,children:[`更多`,o(r,{className:`ml-[2px] h-[12px] w-[12px] text-text2`})]})]}),u.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,11 +1,12 @@
|
|
|
1
1
|
|
|
2
2
|
import { DefineMaterialOption } from "../../../../utils/schema/material.mjs";
|
|
3
|
-
import
|
|
4
|
-
import { LargeFeatureGrid } from "./server.mjs";
|
|
3
|
+
import * as react from "react";
|
|
5
4
|
import * as zod from "zod";
|
|
6
5
|
import * as zod_v4_core0 from "zod/v4/core";
|
|
7
6
|
|
|
8
7
|
//#region components/biz/business/large-feature-grid/material.d.ts
|
|
9
|
-
declare const largeFeatureGridMaterial: DefineMaterialOption<
|
|
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>;
|
|
10
11
|
//#endregion
|
|
11
12
|
export { largeFeatureGridMaterial };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{defineMaterial as e}from"../../../../utils/schema/material.mjs";import{
|
|
2
|
+
import{defineMaterial as e}from"../../../../utils/schema/material.mjs";import{largeFeatureGridInspectorPropsSchema as t}from"./schema.mjs";import{LargeFeatureGridClient as n}from"./client.mjs";import{LargeFeatureGrid as r}from"./server.mjs";const i=e({type:`large-feature-grid`,name:`大图推荐`,icon:`/static/components-thumb/grid_large_feature.png`,category:`内容组件`,serverComponent:r,clientComponent:n,propsSchema:t});export{i as largeFeatureGridMaterial};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{
|
|
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};
|
|
@@ -18,7 +18,7 @@ declare const marqueeMaterial: DefineMaterialOption<typeof MarqueeServer, typeof
|
|
|
18
18
|
}, zod_v4_core0.$strip>> & SchemaHasDefaultValue;
|
|
19
19
|
click: zod.ZodObject<{
|
|
20
20
|
readonly enabled: zod.ZodBoolean & SchemaHasDefaultValue;
|
|
21
|
-
readonly redirectType: zod.ZodOptional<zod.ZodType<"
|
|
21
|
+
readonly redirectType: zod.ZodOptional<zod.ZodType<"content" | "link" | "content_list", unknown, zod_v4_core0.$ZodTypeInternals<"content" | "link" | "content_list", unknown>>> & SchemaHasDefaultValue;
|
|
22
22
|
readonly link: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
|
|
23
23
|
}, zod_v4_core0.$strip> & SchemaHasDefaultValue;
|
|
24
24
|
close: zod.ZodObject<{
|
|
@@ -14,7 +14,7 @@ declare const marqueeInspectorPropsSchema: z.ZodObject<{
|
|
|
14
14
|
}, z.core.$strip>> & SchemaHasDefaultValue;
|
|
15
15
|
click: z.ZodObject<{
|
|
16
16
|
readonly enabled: z.ZodBoolean & SchemaHasDefaultValue;
|
|
17
|
-
readonly redirectType: z.ZodOptional<z.ZodType<"
|
|
17
|
+
readonly redirectType: z.ZodOptional<z.ZodType<"content" | "link" | "content_list", unknown, z.core.$ZodTypeInternals<"content" | "link" | "content_list", unknown>>> & SchemaHasDefaultValue;
|
|
18
18
|
readonly link: z.ZodOptional<z.ZodString> & SchemaHasDefaultValue;
|
|
19
19
|
}, z.core.$strip> & SchemaHasDefaultValue;
|
|
20
20
|
close: z.ZodObject<{
|
|
@@ -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{useAppContext as p}from"../../../../../hooks/use-app-context/index.mjs";import{useLoginModalStore as m}from"../../../../../store/modules/login-modal-store.mjs";import{LeftArrowIcon as h}from"../../../../common/icons/left-arrow.mjs";import{SettingIcon as g}from"../../../../common/icons/setting.mjs";import{UserProfileAvatar as _}from"./user-profile-avatar.mjs";import{UserProfileCoverBackground as v}from"./user-profile-cover-background.mjs";import{useEffect as y,useMemo as b,useState as ee}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
|
|
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{useAppContext as p}from"../../../../../hooks/use-app-context/index.mjs";import{useLoginModalStore as m}from"../../../../../store/modules/login-modal-store.mjs";import{LeftArrowIcon as h}from"../../../../common/icons/left-arrow.mjs";import{SettingIcon as g}from"../../../../common/icons/setting.mjs";import{UserProfileAvatar as _}from"./user-profile-avatar.mjs";import{UserProfileCoverBackground as v}from"./user-profile-cover-background.mjs";import{useEffect as y,useMemo as b,useState as ee}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 E}from"next/navigation";const D=n.persist,O=`https://guadd-sg-ccs-sing-dev.s3.ap-southeast-1.amazonaws.com/default/default_avatar.png`,k=`/images/mine/img_mine_head_bg.png`;function te({userId:e,currentUserId:n,isFollowing:r}){let i=w(`components.pages.profile`),{open:s}=m(),c=l(),d=f(),{mutateAsync:p,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 p({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 A({id:a,enableCustomBackground:o=!0,showBackButton:l=!0,requireLogin:u=!1,cookieToken:f,cookieUserId:C,isEditorPreview:A=!1,className:j}){let M=w(`components.pages.profile`);w(`components.pages.profile.components`);let ne=p(),N=A||ne===`editor`,re=!N,ie=E(),{open:ae}=m(),{isLogin:P,userId:F,token:I}=n(),[L,R]=ee(!1);y(()=>{if(!D){R(!0);return}R(D.hasHydrated());let e=D.onHydrate(()=>{R(!1)}),t=D.onFinishHydration(()=>{R(!0)});return()=>{e(),t()}},[]);let z=N?!1:L?P&&!!F&&!!I:!!C&&!!f,B=N?``:L?F:F||C,V=B,H=a==null||!!a&&!!V&&a===V,U=!H&&!!a,W=H?[`user-profile`,`mine`]:[`user-profile`,`profile`,a],{data:G}=d(N?[`editor-preview`,...W]:W,()=>a?i({target_user_id:a,user_id:B||a}):r({user_id:a||B||``}),{staleTime:0,enabled:re&&(!!a||!!B)}),K=b(()=>{let e=G?G.data:void 0;return e?{userId:e.user_id,isFollowing:e.is_following||!1,name:e.nick_name||`User${a??``}`,avatar:e.avatar||O,followingCnt:e.following_count??0,followersCnt:e.follower_count??0,likeCnt:e.like_count??0,signature:e.signature||``,background:e.bg_image||k}:{}},[a,G]),q=u&&H&&!z,oe=!z&&U,J=H&&z&&!q,Y=!z,se=o&&J,ce=o&&Y,le={name:M(`client.welcomeToPlanet`),description:M(`client.exploreAdventures`),avatar:O,followingCnt:0,followersCnt:0,likeCnt:0,background:k};function X(){ae()}function ue(){ie.back()}let de=q?x(t,{className:`rounded-full`,size:`lg`,onClick:X,children:M(`client.loginNow`)}):oe?x(t,{className:`rounded-full`,size:`lg`,onClick:X,children:M(`client.follow`)}):z?H?x(T,{href:`/edit`,children:x(t,{variant:`outline`,className:`rounded-full`,children:M(`client.editProfile`)})}):x(te,{userId:a||``,currentUserId:B,isFollowing:K?.isFollowing}):x(t,{className:`rounded-full`,size:`lg`,onClick:X,children:M(`client.loginNow`)}),Z=q?le:K,Q=Z.name||``,$=Z.description||Z.signature||``;Z.followingCnt,Z.followersCnt,Z.likeCnt;let fe=Z.avatar||``;return S(s,{className:e(`flex flex-col relative`,j),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:ue,className:e(`h-4 w-4 p-0 hover:bg-transparent`,{invisible:!l}),children:x(h,{className:`w-4 h-4`})}),x(T,{href:`/settings`,className:e({invisible:!H}),children:x(g,{})})]}),x(v,{isMine:se,enableCustomBackground:o,src:Z.background,onUnauthorizedClick:ce?X:void 0}),S(s,{className:`flex-1 px-3`,children:[S(s,{className:`relative flex justify-end`,children:[x(_,{isMine:J,src:fe,alt:Q||`avatar`,onUnauthorizedClick:Y?X: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}),de]}),$&&x(c,{as:`p`,className:`text-sm py-1 line-clamp-3 text-text1/66`,children:$})]})]})}export{A as UserProfileHeaderClient};
|
|
@@ -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";const a=e({type:`profile-header`,category
|
|
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:e=>i(r,{...e,enableCustomBackground:!1}),clientComponent:e=>i(t,{...e,enableCustomBackground:!1}),propsSchema:n});export{a as profileHeaderMaterial,o as profileHeaderMaterialWithDisabledBackground};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{defineMaterial as e}from"../../../../../utils/schema/material.mjs";import{UserProfileMainClient as t}from"./client.mjs";import{profileMainInspectorPropsSchema as n}from"./schema.mjs";import{UserProfileMain as r}from"./server.mjs";const i=e({type:`profile-main`,category
|
|
2
|
+
import{defineMaterial as e}from"../../../../../utils/schema/material.mjs";import{UserProfileMainClient as t}from"./client.mjs";import{profileMainInspectorPropsSchema as n}from"./schema.mjs";import{UserProfileMain as r}from"./server.mjs";const i=e({type:`profile-main`,category:`内容组件`,name:`用户行为模块`,icon:`/icon/profile-main.png`,serverComponent:r,clientComponent:t,propsSchema:n});export{i as profileMainMaterial};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{gUserViewUserInfo as e}from"../../../../../service/generated/client.mjs";import{getAppContextResolved as t}from"../../../../../hooks/get-app-context.mjs";import{profileMainCollectCollectionTabOptions as n,profileMainCollectTabOptions as r,profileMainHistoryTabOptions as i,profileMainLikeTabOptions as a,profileMainMineTabOptions as o,profileMainProfileTabOptions as s}from"./variants.mjs";import{UserProfileMainShell as c}from"./shell.mjs";import{CollectTabServer as l}from"./tabs/collect-tab/server.mjs";import{HistoryTabServer as u}from"./tabs/history-tab/server.mjs";import{LikeTabServer as d}from"./tabs/like-tab/server.mjs";import{
|
|
2
|
+
import{gUserViewUserInfo as e}from"../../../../../service/generated/client.mjs";import{getAppContextResolved as t}from"../../../../../hooks/get-app-context.mjs";import{profileMainCollectCollectionTabOptions as n,profileMainCollectTabOptions as r,profileMainHistoryTabOptions as i,profileMainLikeTabOptions as a,profileMainMineTabOptions as o,profileMainProfileTabOptions as s}from"./variants.mjs";import{UserProfileMainShell as c}from"./shell.mjs";import{CollectTabServer as l}from"./tabs/collect-tab/server.mjs";import{HistoryTabServer as u}from"./tabs/history-tab/server.mjs";import{LikeTabServer as d}from"./tabs/like-tab/server.mjs";import{jsx as f}from"react/jsx-runtime";function p({isMine:e,tab:t}){let n=e?o:s;return t&&n.includes(t)?t:n[0]}function m(e,t,n){return e&&t.includes(e)?e:n}function h(e,t){return e&&(t===`collect`||t===`like`)}function g(e){return f(_,{...e})}async function _({id:o,showCreateAction:s=!1,requireLogin:g=!1,cookieToken:_,cookieUserId:v,className:y,token:b=``,currentUserId:x=``,authConfig:S,tab:C,likeTab:w,historyTab:T,collectTab:E,collectCollectionTab:D}){let O=(await t()).value===`editor`,k=b||_||``,A=x||v||``,j=!!k,M=o==null||!!A&&o===A,N=!M&&!!o,P=M?A:o?String(o):void 0,F=M?[`user-profile`,`mine`]:[`user-profile`,`profile`,o],I=p({isMine:M,tab:C}),L=`content`;if(g&&M&&!j&&(L=`login-required`),!O&&L===`content`&&h(N,I)){let t=(await e({target_user_id:String(o),user_id:A||String(o)},S))?.data??{},n=Number(t.collections_open??1)>0,r=Number(t.like_open??1)>0;I===`collect`&&!n&&(L=`privacy-collect`),I===`like`&&!r&&(L=`privacy-like`)}let R=O?[]:void 0,z=null;if(L===`content`)switch(I){case`like`:z=f(d,{isMine:M,targetUserId:P,queryKeyPrefix:F,resolvedLikeTab:m(w,a,`video`),prefetch:R});break;case`history`:z=f(u,{targetUserId:P,queryKeyPrefix:F,resolvedHistoryTab:m(T,i,`video`),authConfig:S,prefetch:R});break;default:z=f(l,{isMine:M,userId:P,showCreateAction:s&&M,queryKeyPrefix:F,resolvedCollectTab:m(E,r,`video`),resolvedCollectCollectionTab:m(D,n,`created`),authConfig:S,prefetch:R});break}return f(c,{isMine:M,renderMode:L,className:y,children:z})}export{g as UserProfileMain};
|
|
@@ -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{Box as n}from"../../../../ui/box.mjs";import{EmptyState as r}from"../../../../ui/empty.mjs";import{Tabs as i,TabsList as a,TabsTrigger as o}from"../../../../ui/tabs.mjs";import{Text as s}from"../../../../ui/text.mjs";import{useLoginModalStore as c}from"../../../../../store/modules/login-modal-store.mjs";import{profileMainMineTabOptions as l,profileMainProfileTabOptions as u}from"./variants.mjs";import{useEffect as d,useMemo as f}from"react";import{jsx as p,jsxs as m}from"react/jsx-runtime";import{useTranslations as h}from"next-intl";import{parseAsString as g,useQueryState as _}from"nuqs";function v(e){return e?[...l]:[...u]}function y(e,t){let n=v(t);return n.includes(e)?e:n[0]}function b({isMine:l,renderMode:u,className:b,children:x}){let S=h(`components.pages.profile`),{open:C}=c(),w=v(l),[T,E]=_(`tab`,g.withDefault(`collect`)),D=f(()=>y(T,l),[l,T]);d(()=>{T!==D&&E(D,{shallow:!1})},[D,E,T]);let O={collect:S(`client.collect`),
|
|
2
|
+
"use client";import{cn as e}from"../../../../../utils/cn.mjs";import{Button as t}from"../../../../ui/button.mjs";import{Box as n}from"../../../../ui/box.mjs";import{EmptyState as r}from"../../../../ui/empty.mjs";import{Tabs as i,TabsList as a,TabsTrigger as o}from"../../../../ui/tabs.mjs";import{Text as s}from"../../../../ui/text.mjs";import{useLoginModalStore as c}from"../../../../../store/modules/login-modal-store.mjs";import{profileMainMineTabOptions as l,profileMainProfileTabOptions as u}from"./variants.mjs";import{useEffect as d,useMemo as f}from"react";import{jsx as p,jsxs as m}from"react/jsx-runtime";import{useTranslations as h}from"next-intl";import{parseAsString as g,useQueryState as _}from"nuqs";function v(e){return e?[...l]:[...u]}function y(e,t){let n=v(t);return n.includes(e)?e:n[0]}function b({isMine:l,renderMode:u,className:b,children:x}){let S=h(`components.pages.profile`),{open:C}=c(),w=v(l),[T,E]=_(`tab`,g.withDefault(`collect`)),D=f(()=>y(T,l),[l,T]);d(()=>{T!==D&&E(D,{shallow:!1})},[D,E,T]);let O={collect:S(`client.collect`),like:S(`client.like`),history:S(`client.history`)},k=x;return u===`login-required`?k=m(n,{className:`flex gap-4 flex-col items-center justify-center py-10 text-center`,children:[p(s,{className:`text-base text-text1`,children:S(`client.loginToView`)}),p(t,{size:`lg`,variant:`secondary`,onClick:C,children:S(`client.loginNow`)})]}):u===`privacy-collect`?k=p(r,{type:`no-content`,text:S(`client.collectionNotPublic`)}):u===`privacy-like`&&(k=p(r,{type:`no-content`,text:S(`client.likeNotPublic`)})),m(n,{className:e(b),children:[p(n,{className:`border-b bg-bg1 sticky z-10 top-0 border-text1/5 h-10`,children:p(i,{value:D,onValueChange:e=>{E(e,{shallow:!1})},className:`w-fit`,children:p(a,{variant:`default`,className:`inline-flex h-9`,children:w.map(e=>p(o,{value:e,className:`p-2.5 !text-base !w-fit data-active:!text-lg data-active:font-bold`,children:O[e]},e))})})}),p(n,{className:`p-2`,children:k})]})}export{b as UserProfileMainShell};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{Button as e}from"../../../../../../ui/button.mjs";import{useUserStore as t}from"../../../../../../../store/modules/user-store.mjs";import{gCommunityGetSubscribedCollections as n,gCommunityGetUserCollections as r,gInteractionListCollects as i,pInteractionBatchDeleteCollects as a}from"../../../../../../../service/generated/client.mjs";import{Box as o}from"../../../../../../ui/box.mjs";import{Checkbox as ee}from"../../../../../../ui/checkbox.mjs";import{Tabs as s,TabsList as
|
|
2
|
+
"use client";import{Button as e}from"../../../../../../ui/button.mjs";import{useUserStore as t}from"../../../../../../../store/modules/user-store.mjs";import{gCommunityGetSubscribedCollections as n,gCommunityGetUserCollections as r,gInteractionListCollects as i,pInteractionBatchDeleteCollects as a}from"../../../../../../../service/generated/client.mjs";import{Box as o}from"../../../../../../ui/box.mjs";import{Checkbox as ee}from"../../../../../../ui/checkbox.mjs";import{Tabs as s,TabsList as te,TabsTrigger as c}from"../../../../../../ui/tabs.mjs";import{Text as ne}from"../../../../../../ui/text.mjs";import{useMutation as re,usePaginated as l,useUpdateRequest as ie}from"../../../../../../../hooks/query/use-query.mjs";import{useAppContext as ae}from"../../../../../../../hooks/use-app-context/index.mjs";import{CollectionList as oe}from"../../../../../../common/list/collection-list/collection-list.mjs";import{PostList as se}from"../../../../../../common/list/post-list/post-list.mjs";import{VideoList as ce}from"../../../../../../common/list/video-list/video-list.mjs";import{useEffect as u,useMemo as d,useState as f}from"react";import{jsx as p,jsxs as m}from"react/jsx-runtime";import{toast as h}from"sonner";import{useTranslations as g}from"next-intl";import _ from"dayjs";import le from"next/link";import{parseAsString as v,useQueryState as y}from"nuqs";const b={video:1,post:2};function ue(e,t){if(!e)return e;let n=0,r=e.pages.map(e=>({page:e,filteredList:(e.data?.list??T).filter(e=>{let r=e?.id??``,i=t.has(r);return i&&(n+=1),!i})}));return{...e,pages:r.map(({page:e,filteredList:t})=>{if(!e.data)return e;let r=typeof e.data.total==`number`?Math.max(0,e.data.total-n):e.data.total;return{...e,data:{...e.data,list:t,total:r}}})}}function x(e){if(e.cover_image)return e.cover_image;let t=``;return e.medias?.find(e=>e?(!e.is_video&&!t&&e.media_url&&(t=e.media_url),!!e.cover_image):!1)?.cover_image||t}function de(e,t){let n=t[e.content_id||``]?.create_time,r=x(e);return{id:e.content_id||``,title:e.content||``,coverImage:r,publishTime:_(n).toDate().getTime()}}function fe(e,t){let n=t[e.id||``]?.create_time;return{is_more_link:e.is_more_link,id:e.id||``,title:e.name||``,coverImage:e.img_x||``,duration:Number(e.duration??0),authorName:e.up_user||e.source_username||``,viewCount:e.play_count??0,publishTime:_(n).toDate().getTime()}}function S(e){let t=x(e);return{contentType:e.source_type,id:e.content_id,title:e.title||e.content,coverImage:t,isVideo:!1,isMovie:!1}}function C(e){return Array.from({length:3},(t,n)=>({id:`${e}-placeholder-${n}`,isPlaceholder:!0}))}function w(e){let t=(e.contents??[]).slice(0,3).map(S),n=e.content_count??t.length;return{id:e.collection_id||``,title:e.title||``,contentCount:n,contents:n===0?C(e.collection_id||`collection`):t}}const T=[],pe=[`video`,`post`,`collection`],me=[`created`,`subscribed`];function E({userId:_,showCreateAction:x=!1,queryKeyPrefix:S,isMine:C=!1}){let E=g(),D=g(`components.pages.profile.components.tabs`),O=ae()===`renderer`,k=S??[],[A,j]=y(`collectTab`,v.withDefault(`video`)),[M,N]=y(`collectCollectionTab`,v.withDefault(`created`)),P=d(()=>pe.includes(A)?A:`video`,[A]),F=d(()=>me.includes(M)?M:`created`,[M]),[I,L]=f(!1),[R,z]=f(()=>new Set),{userId:he,userInfo:ge}=t(),B=_||he||ge?.userId||``,_e=ie();async function ve(e,t){if(!B)return{data:{list:[],total:0}};let n=await i({user_id:B,folder_id:``,content_type:t,page:e,page_size:10}),r=n.data.collect_infos?.reduce((e,t)=>(t.content_id&&(e[t.content_id]=t),e),{})||{},a=t===b.video?(n.data?.video_infos??[]).map(e=>fe(e,r)):(n.data?.post_infos??[]).map(e=>de(e,r));return{data:{list:a,total:n.data?.total??a.length}}}let V=l({key:[...k,`user-collect-video`,B],initialPageParam:1,async queryFn(e){return ve(e,b.video)},options:{staleTime:0,enabled:O},getNextPageParam(e,t){if((e?.data?.list||[]).length!==0)return t.length+1}}),H=l({key:[...k,`user-collect-post`,B],initialPageParam:1,options:{staleTime:0,enabled:O},async queryFn(e){return{data:{list:[],total:0,has_more:!1}}},getNextPageParam(e,t){if((e?.data?.list||[]).length!==0)return t.length+1}});async function ye(e){if(!B)return{data:{list:[],total:0}};let t=await r({page:e,user_id:_,page_size:10}),n=t.data?.data?.collections??[];return{data:{list:n.map(w),total:t.data?.data?.total??n.length}}}async function be(e){if(!B)return{data:{list:[],total:0}};let t=(await n({page:e,user_id:_,page_size:10})).data?.data,r=t?.collections??[];return{data:{list:r.map(w),total:t?.total??r.length}}}let U=l({key:[...k,`user-collection-created`,B],initialPageParam:1,options:{staleTime:0,enabled:O},async queryFn(e){return ye(e)},getNextPageParam(e,t){if((e?.data?.list||[]).length!==0)return t.length+1}}),W=l({key:[...k,`user-collection-subscribed`,B],initialPageParam:1,options:{staleTime:0,enabled:O},async queryFn(e){return be(e)},getNextPageParam(e,t){if((e?.data?.list||[]).length!==0)return t.length+1}}),G=d(()=>V.data?.pages.flatMap(e=>e.data?.list??T)??T,[V.data]),K=d(()=>H.data?.pages.flatMap(e=>e.data?.list??T)??T,[H.data]),xe=d(()=>U.data?.pages.flatMap(e=>e.data?.list??T)??T,[U.data]),Se=d(()=>W.data?.pages.flatMap(e=>e.data?.list??T)??T,[W.data]),Ce=P===`video`?G:P===`post`?K:T,q=new Set(Ce.map(e=>e.id)),J=P===`video`?V:H,Y=F===`created`?U:W,we=F===`created`?xe:Se,X=P===`video`,Te=[...k,`user-collect-video`,B],Ee=[...k,`user-collect-post`,B],{mutateAsync:De,isPending:Z}=re(async e=>await a({app_id:0,user_id:B,folder_id:``,content_type:X?1:2,content_ids:e})),Oe=()=>{L(!I),z(new Set)};u(()=>{z(new Set),P===`collection`&&L(!1)},[P]),u(()=>{A!==P&&j(P)},[P,A,j]),u(()=>{M!==F&&N(F)},[F,M,N]);let Q=e=>{z(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},ke=()=>{R.size===q.size&&q.size>0?z(new Set):z(new Set(q))},Ae=async()=>{if(!(R.size===0||Z)){if(!B){h.error(D(`collectTab.pleaseLogin`));return}try{let e=Array.from(R),t=await De(e);if(t.code===0){h.success(D(`collectTab.uncollectedSuccess`));let t=new Set(e);_e(X?Te:Ee,e=>ue(e,t)),z(new Set),L(!1)}else h.error(t.message||D(`collectTab.uncollectFailed`))}catch(e){console.error(`取消收藏失败`,e),h.error(D(`collectTab.operationFailed`))}}},$=async()=>{if(O){if(P===`collection`){await Y.fetchNextPage();return}await J.fetchNextPage()}};return m(o,{children:[m(o,{className:`flex justify-between items-center`,children:[p(s,{value:P,onValueChange:e=>{j(e)},children:m(te,{variant:`tag`,children:[p(c,{value:`video`,className:`text-sm`,children:D(`collectTab.video`)}),p(c,{value:`collection`,className:`text-sm`,children:D(`collectTab.collections`)})]})}),P===`collection`?p(le,{href:`/collection/create`,className:`flex items-center justify-center rounded-full text-text3 text-sm`,children:E(`components.pages.collectionCreate.form.create`)}):C&&p(e,{variant:`ghost`,size:`sm`,className:`h-6.25 px-0 text-sm text-text3`,onClick:Oe,children:D(I?`collectTab.cancel`:`collectTab.edit`)})]}),p(o,{className:`pt-2`,children:P===`video`?p(ce,{list:G,showVideoProgress:!1,loading:J.isFetching,hasMore:J.hasNextPage??!1,loadMore:$,emptyText:D(`collectTab.emptyContent`),isEditMode:I,selectedIds:R,onToggleSelection:Q}):P===`post`?p(se,{list:K,loading:J.isFetching,hasMore:J.hasNextPage??!1,loadMore:$,emptyText:D(`collectTab.emptyContent`),isEditMode:I,selectedIds:R,onToggleSelection:Q}):p(oe,{list:we,loading:Y.isFetching,hasMore:Y.hasNextPage??!1,loadMore:$,emptyText:D(`collectTab.emptyContent`)})}),I&&P!==`collection`&&m(o,{style:{bottom:`calc(56px + env(safe-area-inset-bottom, 0px))`},className:`flex fixed z-10 left-0 w-full items-center justify-between px-3 py-2 bg-bg1 `,children:[m(o,{className:`flex items-center gap-2`,children:[p(ee,{checked:R.size===q.size&&q.size>0,onCheckedChange:ke}),p(ne,{className:`text-sm text-text1`,children:D(`collectTab.selectAll`)})]}),p(e,{className:`rounded-full py-2.5 h-auto px-6.5`,variant:R.size>0?`default`:`outline`,disabled:R.size===0||Z,onClick:Ae,children:D(Z?`collectTab.processing`:`collectTab.delete`)})]})]})}export{E as CollectTab};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{gCommunityGetSubscribedCollections as e,gCommunityGetUserCollections as t,gInteractionListCollects as n}from"../../../../../../../service/generated/client.mjs";import{HydrationBoundary as r}from"../../../../../../../hooks/query/hydration-boundary.mjs";import{defaultPageSize as i}from"../../utils.mjs";import{CollectTab as a}from"./client.mjs";import{jsx as o}from"react/jsx-runtime";import s from"dayjs";function c({queryKeyPrefix:e,targetUserId:t,resolvedCollectTab:n,resolvedCollectCollectionTab:r,authConfig:i}){
|
|
2
|
+
import{gCommunityGetSubscribedCollections as e,gCommunityGetUserCollections as t,gInteractionListCollects as n}from"../../../../../../../service/generated/client.mjs";import{HydrationBoundary as r}from"../../../../../../../hooks/query/hydration-boundary.mjs";import{defaultPageSize as i}from"../../utils.mjs";import{CollectTab as a}from"./client.mjs";import{jsx as o}from"react/jsx-runtime";import s from"dayjs";function c({queryKeyPrefix:e,targetUserId:t,resolvedCollectTab:n,resolvedCollectCollectionTab:r,authConfig:i}){return t?n===`collection`?[{type:`infinite`,queryKey:r===`subscribed`?[...e,`user-collection-subscribed`,t]:[...e,`user-collection-created`,t],async queryFn(e){return r===`subscribed`?f({targetUserId:t,page:e,authConfig:i}):d({targetUserId:t,page:e,authConfig:i})},initialPageParam:1,getNextPageParam(){}}]:[{type:`infinite`,queryKey:n===`post`?[...e,`user-collect-post`,t]:[...e,`user-collect-video`,t],async queryFn(e){return u({targetUserId:t,page:e,contentType:1,authConfig:i})},initialPageParam:1,getNextPageParam(){}}]:[]}function l({prefetch:e,resolvedCollectTab:t=`video`,resolvedCollectCollectionTab:n=`created`,authConfig:i,...s}){return o(r,{prefetch:e??c({queryKeyPrefix:s.queryKeyPrefix??[],targetUserId:s.userId,resolvedCollectTab:t,resolvedCollectCollectionTab:n,authConfig:i}),children:o(a,{...s})})}async function u({targetUserId:e,page:t,contentType:r,authConfig:a}){let o=await n({user_id:e,folder_id:``,content_type:r,page:t,page_size:i},a),s=o.data.collect_infos?.reduce((e,t)=>(t.content_id&&(e[t.content_id]=t),e),{})||{},c=r===1?(o.data?.video_infos??[]).map(e=>h(e,s)):(o.data?.post_infos??[]).map(e=>m(e,s));return{data:{list:c,total:o.data?.total??c.length}}}async function d({targetUserId:e,page:n,authConfig:r}){let a=await t({page:n,user_id:e,page_size:i},r),o=a.data?.data?.collections??[];return{data:{list:o.map(v),total:a.data?.data?.total??o.length}}}async function f({targetUserId:t,page:n,authConfig:r}){let a=(await e({page:n,user_id:t,page_size:i},r)).data?.data,o=a?.collections??[];return{data:{list:o.map(v),total:a?.total??o.length}}}function p(e){if(e.cover_image)return e.cover_image;let t=``;return e.medias?.find(e=>e?(!e.is_video&&!t&&e.media_url&&(t=e.media_url),!!e.cover_image):!1)?.cover_image||t}function m(e,t){let n=t[e.content_id||``]?.create_time,r=p(e);return{id:e.content_id||``,title:e.content||``,coverImage:r,publishTime:s(n).toDate().getTime()}}function h(e,t){let n=t[e.id||``]?.create_time;return{is_more_link:e.is_more_link,id:e.id||``,title:e.name||``,coverImage:e.img_x||``,duration:Number(e.duration??0),authorName:e.up_user||e.source_username||``,viewCount:e.play_count??0,publishTime:s(n).toDate().getTime()}}function g(e){let t=p(e);return{contentType:e.source_type,id:e.content_id,title:e.title||e.content,coverImage:t,isVideo:!1,isMovie:!1}}function _(e){return Array.from({length:3},(t,n)=>({id:`${e}-placeholder-${n}`,isPlaceholder:!0}))}function v(e){let t=(e.contents??[]).slice(0,3).map(g),n=e.content_count??t.length;return{id:e.collection_id||``,title:e.title||``,contentCount:n,contents:n===0?_(e.collection_id||`collection`):t}}export{l as CollectTabServer,c as buildCollectTabPrefetch};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{Button as e}from"../../../../../../ui/button.mjs";import{useUserStore as t}from"../../../../../../../store/modules/user-store.mjs";import{pInteractionBatchClearBrowse as n}from"../../../../../../../service/generated/client.mjs";import{Box as r}from"../../../../../../ui/box.mjs";import{Checkbox as i}from"../../../../../../ui/checkbox.mjs";import{
|
|
2
|
+
"use client";import{Button as e}from"../../../../../../ui/button.mjs";import{useUserStore as t}from"../../../../../../../store/modules/user-store.mjs";import{pInteractionBatchClearBrowse as n}from"../../../../../../../service/generated/client.mjs";import{Box as r}from"../../../../../../ui/box.mjs";import{Checkbox as i}from"../../../../../../ui/checkbox.mjs";import{Text as a}from"../../../../../../ui/text.mjs";import{useMutation as o,usePaginated as s,useUpdateRequest as ee}from"../../../../../../../hooks/query/use-query.mjs";import{useAppContext as c}from"../../../../../../../hooks/use-app-context/index.mjs";import{PostList as l}from"../../../../../../common/list/post-list/post-list.mjs";import{VideoList as u}from"../../../../../../common/list/video-list/video-list.mjs";import{getHistoryData as d,likeContentType as f}from"../../utils.mjs";import{useEffect as p,useMemo as m,useState as h}from"react";import{jsx as g,jsxs as _}from"react/jsx-runtime";import{toast as v}from"sonner";import{useTranslations as y}from"next-intl";import{parseAsString as b,useQueryState as x}from"nuqs";function S(e){let{detail:t}=e,{info:n,publish_time:r}=t;return{id:e.id,title:n.title||n.text||``,coverImage:n.cover_image_thumbnail||n.cover_image||n.cover_horizontal_image_thumbnail||void 0,publishTime:r}}function C(e){let{detail:t,content_play_progress:n}=e,{user_info:r,info:i,statics_cnt:a,publish_time:o,parent_content_info:s}=t;return{is_more_link:i.is_more_link,id:e.id,title:i.title||i.text||i.name||``,coverImage:i.cover_image_thumbnail||i.cover_image||i.cover_horizontal_image_thumbnail||``,duration:Number(i.video_duration??0),progress:n?.percent??0,seriesNum:n?.series_num,authorName:r.name,viewCount:i?.play_count??a?.browse_cnt??0,publishTime:o,type:s?.type}}function w(e,t,n){if(!e)return e;let r=0,i=e.pages.map(e=>({page:e,filteredList:(e.data?.list??[]).filter(e=>{let i=n(e)??``,a=t.has(i);return a&&(r+=1),!a})}));return{...e,pages:i.map(({page:e,filteredList:t})=>{if(!e.data)return e;let n=typeof e.data.total==`number`?Math.max(0,e.data.total-r):e.data.total;return{...e,data:{...e.data,list:t,total:n}}})}}const T=[`video`,`post`];function E({targetUserId:E,queryKeyPrefix:D}){let O=y(`components.pages.profile.components.tabs`),k=c()===`renderer`,A=D??[],[j,M]=x(`historyTab`,b.withDefault(`video`)),N=m(()=>T.includes(j)?j:`video`,[j]),[P,F]=h(!1),[I,L]=h(()=>new Set),R=t(e=>e.userId),z=ee(),B=[...A,`user-history-video`],V=[...A,`user-history-post`],H=s({key:B,initialPageParam:1,async queryFn(e){return d({targetUserId:E,page:e,contentType:f.video})},options:{staleTime:0,enabled:k},getNextPageParam(e,t){if(!((e?.data?.list??[]).length===0||e?.data?.total===0))return t.length+1}}),U=s({key:V,initialPageParam:1,async queryFn(e){return{data:{list:[],total:0,has_more:!1}}},options:{staleTime:0,enabled:k},getNextPageParam(e,t){if(!((e?.data?.list??[]).length===0||e?.data?.total===0))return t.length+1}}),W=N===`video`?H:U,G=H.data?.pages.flatMap(e=>(e.data?.list??[]).map(C))??[],K=U.data?.pages.flatMap(e=>(e.data?.list??[]).map(S))??[],q=N===`video`?G:K,J=new Set(q.map(e=>e.id)),Y=N===`video`,{mutateAsync:X,isPending:Z}=o(async e=>await n({app_id:0,user_id:R,content_type:e.contentType,content_ids:e.contentIds}));p(()=>{L(new Set)},[N]),p(()=>{j!==N&&M(N)},[N,j,M]);let Q=e=>{L(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},te=()=>{I.size===J.size&&J.size>0?L(new Set):L(new Set(J))},ne=async()=>{if(!(I.size===0||Z)){if(!R){v.error(O(`historyTab.pleaseLogin`));return}try{let e=Array.from(I),t=await X({contentIds:e,contentType:Y?1:2});if(t.code===0){v.success(O(`historyTab.historyDeletedSuccess`));let t=new Set(e);z(Y?B:V,e=>w(e,t,e=>e.id)),L(new Set),F(!1)}else v.error(t.message||O(`historyTab.deleteFailed`))}catch(e){console.error(`删除浏览记录失败`,e),v.error(O(`historyTab.operationFailed`))}}},$=async()=>{k&&await W.fetchNextPage()};return _(r,{children:[g(r,{className:``,children:N===`video`?g(u,{showVideoProgress:!0,list:G,loading:W.isFetching,hasMore:W.hasNextPage??!1,loadMore:$,emptyText:O(`historyTab.emptyContent`),isEditMode:P,selectedIds:I,onToggleSelection:Q}):g(l,{list:K,loading:W.isFetching,hasMore:W.hasNextPage??!1,loadMore:$,emptyText:O(`historyTab.emptyContent`),isEditMode:P,selectedIds:I,onToggleSelection:Q})}),P&&_(r,{style:{bottom:`calc(56px + env(safe-area-inset-bottom, 0px))`},className:`flex fixed z-10 left-0 w-full items-center justify-between px-3 py-2 bg-bg1 `,children:[_(r,{className:`flex items-center gap-2`,children:[g(i,{checked:I.size===J.size&&J.size>0,onCheckedChange:te}),g(a,{className:`text-sm text-text1`,children:O(`historyTab.selectAll`)})]}),g(e,{className:`rounded-full py-2.5 h-auto px-6.5`,variant:I.size>0?`default`:`outline`,disabled:I.size===0||Z,onClick:ne,children:O(Z?`historyTab.processing`:`historyTab.delete`)})]})]})}export{E as HistoryTab};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{HydrationBoundary as e}from"../../../../../../../hooks/query/hydration-boundary.mjs";import{getHistoryData as t,likeContentType as n}from"../../utils.mjs";import{HistoryTab as r}from"./client.mjs";import{jsx as i}from"react/jsx-runtime";function a({queryKeyPrefix:e,targetUserId:r,resolvedHistoryTab:i,authConfig:a}){
|
|
2
|
+
import{HydrationBoundary as e}from"../../../../../../../hooks/query/hydration-boundary.mjs";import{getHistoryData as t,likeContentType as n}from"../../utils.mjs";import{HistoryTab as r}from"./client.mjs";import{jsx as i}from"react/jsx-runtime";function a({queryKeyPrefix:e,targetUserId:r,resolvedHistoryTab:i,authConfig:a}){return r?[{type:`infinite`,queryKey:i===`post`?[...e,`user-history-post`]:[...e,`user-history-video`],async queryFn(e){return t({targetUserId:r,page:e,contentType:n.video,authConfig:a})},initialPageParam:1,getNextPageParam(){}}]:[]}function o({prefetch:t,resolvedHistoryTab:n=`video`,authConfig:o,...s}){return i(e,{prefetch:t??a({queryKeyPrefix:s.queryKeyPrefix??[],targetUserId:s.targetUserId,resolvedHistoryTab:n,authConfig:o}),children:i(r,{...s})})}export{o as HistoryTabServer,a as buildHistoryTabPrefetch};
|