@funhub/platform 0.1.35 → 0.1.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/images/frame.mjs +2 -0
- package/dist/biz.d.mts +13 -13
- package/dist/biz.mjs +1 -1
- package/dist/components/biz/basics/logo/variants/basic-logo/runtime/client.mjs +1 -1
- package/dist/components/biz/business/channel-list/client.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/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.mjs +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.d.mts +12 -12
- 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/client.d.mts +7 -9
- package/dist/components/biz/business/marquee/client.mjs +1 -1
- package/dist/components/biz/business/marquee/index.d.mts +2 -2
- package/dist/components/biz/business/marquee/material.d.mts +15 -6
- package/dist/components/biz/business/marquee/schema.d.mts +23 -28
- package/dist/components/biz/business/marquee/schema.mjs +1 -1
- package/dist/components/biz/business/marquee/server.d.mts +1 -1
- package/dist/components/biz/business/nav-bar/variants/basic-nav-bar/runtime/client.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/search-history/client.d.mts +10 -12
- package/dist/components/biz/business/search-history/client.mjs +1 -1
- package/dist/components/biz/business/search-history/index.d.mts +2 -2
- package/dist/components/biz/business/search-history/material.d.mts +1 -1
- package/dist/components/biz/business/search-history/schema.d.mts +7 -15
- package/dist/components/biz/business/search-history/schema.mjs +1 -1
- package/dist/components/biz/business/search-history/server.d.mts +6 -2
- package/dist/components/biz/business/search-input/client.d.mts +11 -9
- package/dist/components/biz/business/search-input/client.mjs +1 -1
- package/dist/components/biz/business/search-input/index.d.mts +2 -2
- package/dist/components/biz/business/search-input/schema.d.mts +6 -10
- package/dist/components/biz/business/search-input/schema.mjs +1 -1
- package/dist/components/biz/business/search-input/server.d.mts +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.d.mts +6 -5
- package/dist/components/biz/business/tab-bar/client.mjs +1 -1
- package/dist/components/biz/business/tab-bar/index.d.mts +2 -2
- package/dist/components/biz/business/tab-bar/schema.d.mts +10 -18
- package/dist/components/biz/business/tab-bar/schema.mjs +1 -1
- package/dist/components/biz/business/tab-bar/server.d.mts +1 -1
- package/dist/components/biz/business/text-recommend/client.d.mts +10 -14
- package/dist/components/biz/business/text-recommend/client.mjs +1 -1
- package/dist/components/biz/business/text-recommend/index.d.mts +2 -2
- package/dist/components/biz/business/text-recommend/material.d.mts +4 -1
- package/dist/components/biz/business/text-recommend/schema.d.mts +9 -12
- package/dist/components/biz/business/text-recommend/schema.mjs +1 -1
- package/dist/components/biz/business/text-recommend/server.d.mts +1 -1
- package/dist/components/biz/business/text-recommend/server.mjs +1 -1
- package/dist/components/biz/business/video-horizontal-list/client.d.mts +5 -2
- package/dist/components/biz/business/video-horizontal-list/client.mjs +1 -1
- package/dist/components/biz/business/video-horizontal-list/index.d.mts +2 -2
- package/dist/components/biz/business/video-horizontal-list/material.d.mts +19 -8
- package/dist/components/biz/business/video-horizontal-list/schema.d.mts +20 -24
- package/dist/components/biz/business/video-horizontal-list/schema.mjs +1 -1
- package/dist/components/biz/business/video-horizontal-list/server.d.mts +1 -1
- package/dist/components/common/delete-confirm-dialog/delete-confirm-dialog.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/popup-video/index.mjs +1 -1
- package/dist/components/pages/feed-series/feed-series-client.mjs +1 -1
- package/dist/components/pages/home/client.mjs +1 -1
- package/dist/components/pages/post-detail/post-detail-client.mjs +1 -1
- package/dist/components/pages/publish/page-client.mjs +1 -1
- package/dist/components/pages/search/hot-recommend.mjs +1 -1
- package/dist/components/pages/search/page-client.mjs +1 -1
- package/dist/components/pages/search/search-result/search-all.mjs +1 -1
- package/dist/components/pages/user-follow/page.mjs +1 -1
- package/dist/components/pages/video-detail/page.mjs +1 -1
- package/dist/components/pages/video-detail/video-detail-client.mjs +1 -1
- package/dist/components/ui/button.d.mts +1 -1
- package/dist/components/ui/image.d.mts +4 -4
- package/dist/constants/event-key.mjs +1 -1
- package/dist/hooks/use-search-history.mjs +1 -1
- package/dist/i18n/locales/en.mjs +1 -1
- package/dist/i18n/locales/zh-CN.mjs +1 -1
- package/dist/utils/schema/index.d.mts +1 -1
- package/dist/utils/schema/inspector.d.mts +31 -1
- package/dist/utils/schema/material.d.mts +1 -1
- package/dist/utils/schema/schema.d.mts +31 -2
- package/dist/utils/schema/schema.mjs +1 -1
- package/dist/utils.d.mts +2 -2
- package/dist/utils.mjs +1 -1
- package/package.json +1 -1
- 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
|
@@ -14,14 +14,23 @@ import * as zod_v4_core0 from "zod/v4/core";
|
|
|
14
14
|
declare const marqueeMaterial: DefineMaterialOption<typeof MarqueeServer, typeof MarqueeClient, zod.ZodObject<{
|
|
15
15
|
contents: zod.ZodArray<zod.ZodObject<{
|
|
16
16
|
text: zod.ZodString & SchemaHasDefaultValue;
|
|
17
|
-
enableClick: zod.ZodBoolean & SchemaHasDefaultValue;
|
|
18
|
-
linkType: zod.ZodType<"content" | "content-list" | "url", unknown, zod_v4_core0.$ZodTypeInternals<"content" | "content-list" | "url", unknown>> & SchemaHasDefaultValue;
|
|
19
17
|
link: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
|
|
20
18
|
}, zod_v4_core0.$strip>> & SchemaHasDefaultValue;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
click: zod.ZodObject<{
|
|
20
|
+
readonly enabled: zod.ZodBoolean & SchemaHasDefaultValue;
|
|
21
|
+
readonly redirectType: zod.ZodOptional<zod.ZodType<"content" | "link" | "content_list", unknown, zod_v4_core0.$ZodTypeInternals<"content" | "link" | "content_list", unknown>>> & SchemaHasDefaultValue;
|
|
22
|
+
readonly link: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
|
|
23
|
+
}, zod_v4_core0.$strip> & SchemaHasDefaultValue;
|
|
24
|
+
close: zod.ZodObject<{
|
|
25
|
+
readonly enabled: zod.ZodBoolean & SchemaHasDefaultValue;
|
|
26
|
+
}, zod_v4_core0.$strip> & SchemaHasDefaultValue;
|
|
27
|
+
displayStrategy: zod.ZodObject<{
|
|
28
|
+
readonly rule: zod.ZodType<"once" | "daily", unknown, zod_v4_core0.$ZodTypeInternals<"once" | "daily", unknown>> & SchemaHasDefaultValue;
|
|
29
|
+
readonly period: zod.ZodOptional<zod.ZodObject<{
|
|
30
|
+
readonly start: zod.ZodString;
|
|
31
|
+
readonly end: zod.ZodString;
|
|
32
|
+
}, zod_v4_core0.$strip>> & SchemaHasDefaultValue;
|
|
33
|
+
}, zod_v4_core0.$strip> & SchemaHasDefaultValue;
|
|
25
34
|
}, zod_v4_core0.$strip>, "marquee">;
|
|
26
35
|
//#endregion
|
|
27
36
|
export { marqueeMaterial };
|
|
@@ -1,37 +1,32 @@
|
|
|
1
1
|
|
|
2
2
|
import { SchemaHasDefaultValue } from "../../../../utils/schema/schema.mjs";
|
|
3
3
|
import "../../../../utils.mjs";
|
|
4
|
-
import z
|
|
4
|
+
import { z } from "zod";
|
|
5
5
|
|
|
6
6
|
//#region components/biz/business/marquee/schema.d.ts
|
|
7
7
|
/**
|
|
8
8
|
* 跑马灯物料属性定义
|
|
9
9
|
*/
|
|
10
|
-
declare const marqueeInspectorPropsSchema: z
|
|
11
|
-
contents: z
|
|
12
|
-
text: z
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
startTime: string;
|
|
32
|
-
endTime: string;
|
|
33
|
-
};
|
|
34
|
-
type MarqueeInspectorProps = z$1.infer<typeof marqueeInspectorPropsSchema>;
|
|
35
|
-
type MarqueeProps = MarqueeInspectorProps;
|
|
10
|
+
declare const marqueeInspectorPropsSchema: z.ZodObject<{
|
|
11
|
+
contents: z.ZodArray<z.ZodObject<{
|
|
12
|
+
text: z.ZodString & SchemaHasDefaultValue;
|
|
13
|
+
link: z.ZodOptional<z.ZodString> & SchemaHasDefaultValue;
|
|
14
|
+
}, z.core.$strip>> & SchemaHasDefaultValue;
|
|
15
|
+
click: z.ZodObject<{
|
|
16
|
+
readonly enabled: z.ZodBoolean & SchemaHasDefaultValue;
|
|
17
|
+
readonly redirectType: z.ZodOptional<z.ZodType<"content" | "link" | "content_list", unknown, z.core.$ZodTypeInternals<"content" | "link" | "content_list", unknown>>> & SchemaHasDefaultValue;
|
|
18
|
+
readonly link: z.ZodOptional<z.ZodString> & SchemaHasDefaultValue;
|
|
19
|
+
}, z.core.$strip> & SchemaHasDefaultValue;
|
|
20
|
+
close: z.ZodObject<{
|
|
21
|
+
readonly enabled: z.ZodBoolean & SchemaHasDefaultValue;
|
|
22
|
+
}, z.core.$strip> & SchemaHasDefaultValue;
|
|
23
|
+
displayStrategy: z.ZodObject<{
|
|
24
|
+
readonly rule: z.ZodType<"once" | "daily", unknown, z.core.$ZodTypeInternals<"once" | "daily", unknown>> & SchemaHasDefaultValue;
|
|
25
|
+
readonly period: z.ZodOptional<z.ZodObject<{
|
|
26
|
+
readonly start: z.ZodString;
|
|
27
|
+
readonly end: z.ZodString;
|
|
28
|
+
}, z.core.$strip>> & SchemaHasDefaultValue;
|
|
29
|
+
}, z.core.$strip> & SchemaHasDefaultValue;
|
|
30
|
+
}, z.core.$strip>;
|
|
36
31
|
//#endregion
|
|
37
|
-
export {
|
|
32
|
+
export { marqueeInspectorPropsSchema };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{defineArrayItemPropSchema as e,defineComponentPropsSchema as t,
|
|
2
|
+
import{defineArrayItemPropSchema as e,defineComponentPropsSchema as t,defineObjectPropSchema as n,defineSelectEnumPropSchema as r,defineSwitchPropSchema as i,defineTextPropSchema as a,defineTimeRangePropSchema as o}from"../../../../utils/schema/schema.mjs";import{z as s}from"zod";const c=t({contents:e(s.object({text:a({label:`文本内容`,defaultValue:``}),link:a({label:`跳转链接`,defaultValue:``,required:!1})}),{label:`消息内容`,defaultValue:[{text:`请输入跑马灯内容`}],description:`支持多条消息循环播放`}),click:n({enabled:i({label:`支持点击`,defaultValue:!0}),redirectType:r([`content_list`,`content`,`link`],{label:`跳转指向`,defaultValue:`link`,required:!1}),link:a({label:`跳转链接`,defaultValue:``,required:!1})},{label:`点击配置`,defaultValue:{enabled:!0,redirectType:`link`,link:``}}),close:n({enabled:i({label:`支持关闭`,defaultValue:!0})},{label:`关闭配置`,defaultValue:{enabled:!0}}),displayStrategy:n({rule:r([`once`,`daily`],{label:`展示规则`,defaultValue:`once`,description:`「只展示1次」即当前消息只展示1次;「每天展示1次」即当前消息每天展示1次,0点刷新`}),period:o({label:`展示周期`,defaultValue:{start:``,end:``},required:!1})},{label:`展示策略`,defaultValue:{rule:`once`,period:{start:``,end:``}}})});export{c as marqueeInspectorPropsSchema};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{mergeStyles as e}from"../../../../../utils/styles/helpers.mjs";import{pxToVw as t}from"../../../../../../../utils/helper.mjs";import{Box as n}from"../../../../../../ui/box.mjs";import r from"../../../../../../ui/link.mjs";import{
|
|
2
|
+
"use client";import{mergeStyles as e}from"../../../../../utils/styles/helpers.mjs";import{pxToVw as t}from"../../../../../../../utils/helper.mjs";import{Box as n}from"../../../../../../ui/box.mjs";import r from"../../../../../../ui/link.mjs";import{urlPrefix as i}from"../../../../../../../constants/url-prefix.mjs";import{useSticky as a}from"../../../../../../../hooks/use-sticky.mjs";import o,{loadHiddenChannelIdsFromStorage as s}from"./channel-filter-dialog.mjs";import c from"../../../../../../../assets/icons/search.mjs";import{defaultProps as l}from"../defaults/default-props.mjs";import u from"../../../../../../../assets/icons/filter_dark.mjs";import{clsx as d}from"clsx";import{useEffect as f,useMemo as p,useState as m}from"react";import{Fragment as h,jsx as g,jsxs as _}from"react/jsx-runtime";const v={},y={list:[],currentChannelId:null,isFullfeed:!1};function b(e,t){return t===0?`/`:`${i.CHANNEL}/${encodeURIComponent(e.cn_name)}`}function x({props:i=v,styles:x,events:S,data:C=y}){let{searchUrl:w,searchIconSize:T,filterIconSize:E,channelItemHeight:D,channelItemFontSize:O,channelItemActiveFontSize:k,channelItemGap:A}={...l,...i},[j,M]=m(!1),{isSticky:N,ref:P}=a(),[F,I]=m(C.list),L=p(()=>C.currentChannelId??null,[C.currentChannelId]);f(()=>{let e=s();I(C.list.filter(t=>!e.includes(t.id)))},[C.list]);let R=e=>{I(e)},z=(e,t)=>{S?.onChannelChange?.(e,t)},B=()=>{M(!0),S?.onFilterClick?.()},V=()=>{S?.onSearchClick?.()},H=x?e(x,{}):void 0,U=N?E+T+24:E+16;return _(h,{children:[N&&g(n,{className:`w-full`,style:{height:t(44)}}),g(n,{as:`nav`,ref:P,className:d(`w-full transition-all duration-200`,!C.isFullfeed&&N&&`fixed top-0 left-0 right-0 z-50`,C.isFullfeed&&`fixed top-[54px] left-0 z-10 w-full`,!C.isFullfeed&&`bg-bg1`),style:H,children:_(n,{className:`relative flex items-center h-[44px]`,children:[g(n,{className:`flex-1 overflow-x-auto overflow-y-hidden [&::-webkit-scrollbar]:hidden`,style:{scrollbarWidth:`none`,msOverflowStyle:`none`,WebkitOverflowScrolling:`touch`},children:g(n,{className:`flex items-center h-full`,style:{paddingLeft:t(16),paddingRight:t(U+16),gap:t(A)},children:F.map((e,n)=>{let i=L===e.id||L===null&&n===0;return g(r,{href:b(e,n),className:d(`whitespace-nowrap cursor-pointer transition-all duration-200`,`flex items-center justify-center`),style:{height:t(D),fontSize:t(i?k:O),fontWeight:i?`bold`:`normal`,color:i?`var(--color-theme5)`:`var(--color-text2)`},onClick:()=>z(e,n),children:e.cn_name},e.id||`channel-${n}`)})})}),_(n,{className:`flex items-center gap-[12px] px-[8px]`,children:[g(n,{className:`flex items-center justify-center cursor-pointer`,style:{width:t(E+8),height:t(E+8)},onClick:B,children:g(u,{width:t(E),height:t(E),style:{color:`var(--color-text1)`}})}),N&&g(r,{href:w,onClick:V,children:g(n,{className:`flex items-center justify-center cursor-pointer`,style:{width:t(T+8),height:t(T+8)},children:g(c,{width:t(T),height:t(T),style:{color:`var(--color-text1)`}})})})]})]})}),g(o,{open:j,onOpenChange:M,channels:C.list,currentChannelId:L,onChannelClick:z,onChannelsChange:R})]})}export{x as default};
|
|
@@ -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 c,TabsTrigger as l}from"../../../../../../ui/tabs.mjs";import{Text as te}from"../../../../../../ui/text.mjs";import{useMutation as ne,usePaginated as u,useUpdateRequest as re}from"../../../../../../../hooks/query/use-query.mjs";import{useAppContext as ie}from"../../../../../../../hooks/use-app-context/index.mjs";import{AddIcon as ae}from"../../../../../../common/icons/add.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 d,useMemo as f,useState as p}from"react";import{jsx as m,jsxs as h}from"react/jsx-runtime";import{toast as g}from"sonner";import{useTranslations as le}from"next-intl";import _ from"dayjs";import ue from"next/link";import{parseAsString as v,useQueryState as y}from"nuqs";const b={video:1,post:2};function de(e,t){if(!e)return e;let n=0,r=e.pages.map(e=>({page:e,filteredList:(e.data?.list??
|
|
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 c,TabsTrigger as l}from"../../../../../../ui/tabs.mjs";import{Text as te}from"../../../../../../ui/text.mjs";import{useMutation as ne,usePaginated as u,useUpdateRequest as re}from"../../../../../../../hooks/query/use-query.mjs";import{useAppContext as ie}from"../../../../../../../hooks/use-app-context/index.mjs";import{AddIcon as ae}from"../../../../../../common/icons/add.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 d,useMemo as f,useState as p}from"react";import{jsx as m,jsxs as h}from"react/jsx-runtime";import{toast as g}from"sonner";import{useTranslations as le}from"next-intl";import _ from"dayjs";import ue from"next/link";import{parseAsString as v,useQueryState as y}from"nuqs";const b={video:1,post:2};function de(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 fe(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 pe(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=[],me=[`video`,`post`,`collection`],he=[`created`,`subscribed`];function E({userId:_,showCreateAction:x=!1,queryKeyPrefix:S,isMine:C=!1}){let E=le(`components.pages.profile.components.tabs`),D=ie()===`renderer`,O=S??[],[k,A]=y(`collectTab`,v.withDefault(`video`)),[j,M]=y(`collectCollectionTab`,v.withDefault(`created`)),N=f(()=>me.includes(k)?k:`video`,[k]),P=f(()=>he.includes(j)?j:`created`,[j]),[F,I]=p(!1),[L,R]=p(()=>new Set),{userId:z,userInfo:ge}=t(),B=_||z||ge?.userId||``,_e=re();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=>pe(e,r)):(n.data?.post_infos??[]).map(e=>fe(e,r));return{data:{list:a,total:n.data?.total??a.length}}}let V=u({key:[...O,`user-collect-video`,B],initialPageParam:1,async queryFn(e){return ve(e,b.video)},options:{staleTime:0,enabled:D},getNextPageParam(e,t){if((e?.data?.list||[]).length!==0)return t.length+1}}),H=u({key:[...O,`user-collect-post`,B],initialPageParam:1,options:{staleTime:0,enabled:D},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=u({key:[...O,`user-collection-created`,B],initialPageParam:1,options:{staleTime:0,enabled:D},async queryFn(e){return ye(e)},getNextPageParam(e,t){if((e?.data?.list||[]).length!==0)return t.length+1}}),W=u({key:[...O,`user-collection-subscribed`,B],initialPageParam:1,options:{staleTime:0,enabled:D},async queryFn(e){return be(e)},getNextPageParam(e,t){if((e?.data?.list||[]).length!==0)return t.length+1}}),G=f(()=>V.data?.pages.flatMap(e=>e.data?.list??T)??T,[V.data]),K=f(()=>H.data?.pages.flatMap(e=>e.data?.list??T)??T,[H.data]),xe=f(()=>U.data?.pages.flatMap(e=>e.data?.list??T)??T,[U.data]),Se=f(()=>W.data?.pages.flatMap(e=>e.data?.list??T)??T,[W.data]),Ce=N===`video`?G:N===`post`?K:T,q=new Set(Ce.map(e=>e.id)),J=N===`video`?V:H,Y=P===`created`?U:W,we=P===`created`?xe:Se,X=N===`video`,Te=[...O,`user-collect-video`,B],Ee=[...O,`user-collect-post`,B],{mutateAsync:De,isPending:Z}=ne(async e=>await a({app_id:0,user_id:B,folder_id:``,content_type:X?1:2,content_ids:e})),Oe=()=>{I(!F),R(new Set)};d(()=>{R(new Set),N===`collection`&&I(!1)},[N]),d(()=>{k!==N&&A(N)},[N,k,A]),d(()=>{j!==P&&M(P)},[P,j,M]);let Q=e=>{R(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},ke=()=>{L.size===q.size&&q.size>0?R(new Set):R(new Set(q))},Ae=async()=>{if(!(L.size===0||Z)){if(!B){g.error(E(`collectTab.pleaseLogin`));return}try{let e=Array.from(L),t=await De(e);if(t.code===0){g.success(E(`collectTab.uncollectedSuccess`));let t=new Set(e);_e(X?Te:Ee,e=>de(e,t)),R(new Set),I(!1)}else g.error(t.message||E(`collectTab.uncollectFailed`))}catch(e){console.error(`取消收藏失败`,e),g.error(E(`collectTab.operationFailed`))}}},$=async()=>{if(D){if(N===`collection`){await Y.fetchNextPage();return}await J.fetchNextPage()}};return h(o,{children:[h(o,{className:`flex justify-between items-center`,children:[m(s,{value:N,onValueChange:e=>{A(e)},children:h(c,{variant:`tag`,children:[m(l,{value:`video`,className:`text-sm`,children:E(`collectTab.video`)}),m(l,{value:`collection`,className:`text-sm`,children:E(`collectTab.collections`)})]})}),N===`collection`?h(o,{className:`flex items-center gap-2 h-6.25`,children:[m(s,{value:P,onValueChange:e=>{M(e)},children:h(c,{variant:`segment`,children:[m(l,{value:`created`,className:`text-sm`,children:E(`collectTab.created`)}),m(l,{value:`subscribed`,className:`text-sm`,children:E(`collectTab.subscribed`)})]})}),x&&m(ue,{href:`/collection/create`,className:`flex items-center justify-center rounded-full bg-bg2 p-1.5`,children:m(ae,{})})]}):C&&m(e,{variant:`ghost`,size:`sm`,className:`h-6.25 px-0 text-sm text-text3`,onClick:Oe,children:E(F?`collectTab.cancel`:`collectTab.edit`)})]}),m(o,{className:`pt-2`,children:N===`video`?m(ce,{list:G,showVideoProgress:!1,loading:J.isFetching,hasMore:J.hasNextPage??!1,loadMore:$,isEditMode:F,selectedIds:L,onToggleSelection:Q}):N===`post`?m(se,{list:K,loading:J.isFetching,hasMore:J.hasNextPage??!1,loadMore:$,isEditMode:F,selectedIds:L,onToggleSelection:Q}):m(oe,{list:we,loading:Y.isFetching,hasMore:Y.hasNextPage??!1,loadMore:$,emptyText:E(P===`created`?`collectTab.noCreatedCollections`:`collectTab.noSubscribedCollections`)})}),F&&N!==`collection`&&h(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:[h(o,{className:`flex items-center gap-2`,children:[m(ee,{checked:L.size===q.size&&q.size>0,onCheckedChange:ke}),m(te,{className:`text-sm text-text1`,children:E(`collectTab.selectAll`)})]}),m(e,{className:`rounded-full py-2.5 h-auto px-6.5`,variant:L.size>0?`default`:`outline`,disabled:L.size===0||Z,onClick:Ae,children:E(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{Tabs as a,TabsList as o,TabsTrigger as s}from"../../../../../../ui/tabs.mjs";import{Text as c}from"../../../../../../ui/text.mjs";import{useMutation as
|
|
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{Tabs as a,TabsList as o,TabsTrigger as s}from"../../../../../../ui/tabs.mjs";import{Text as c}from"../../../../../../ui/text.mjs";import{useMutation as l,usePaginated as u,useUpdateRequest as d}from"../../../../../../../hooks/query/use-query.mjs";import{useAppContext as ee}from"../../../../../../../hooks/use-app-context/index.mjs";import{PostList as te}from"../../../../../../common/list/post-list/post-list.mjs";import{VideoList as ne}from"../../../../../../common/list/video-list/video-list.mjs";import{getHistoryData as f,likeContentType as p}from"../../utils.mjs";import{useEffect as m,useMemo as h,useState as g}from"react";import{jsx as _,jsxs as v}from"react/jsx-runtime";import{toast as y}from"sonner";import{useTranslations as b}from"next-intl";import{parseAsString as x,useQueryState as S}from"nuqs";function re(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=b(`components.pages.profile.components.tabs`),k=ee()===`renderer`,A=D??[],[j,M]=S(`historyTab`,x.withDefault(`video`)),N=h(()=>T.includes(j)?j:`video`,[j]),[P,F]=g(!1),[I,L]=g(()=>new Set),R=t(e=>e.userId),z=d(),B=[...A,`user-history-video`],V=[...A,`user-history-post`],H=u({key:B,initialPageParam:1,async queryFn(e){return f({targetUserId:E,page:e,contentType:p.video})},options:{staleTime:0,enabled:k},getNextPageParam(e,t){if(!((e?.data?.list??[]).length===0||e?.data?.total===0))return t.length+1}}),U=u({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(re))??[],q=N===`video`?G:K,J=new Set(q.map(e=>e.id)),Y=N===`video`,{mutateAsync:ie,isPending:X}=l(async e=>await n({app_id:0,user_id:R,content_type:e.contentType,content_ids:e.contentIds})),Z=()=>{F(!P),L(new Set)};m(()=>{L(new Set)},[N]),m(()=>{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})},ae=()=>{I.size===J.size&&J.size>0?L(new Set):L(new Set(J))},oe=async()=>{if(!(I.size===0||X)){if(!R){y.error(O(`historyTab.pleaseLogin`));return}try{let e=Array.from(I),t=await ie({contentIds:e,contentType:Y?1:2});if(t.code===0){y.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 y.error(t.message||O(`historyTab.deleteFailed`))}catch(e){console.error(`删除浏览记录失败`,e),y.error(O(`historyTab.operationFailed`))}}},$=async()=>{k&&await W.fetchNextPage()};return v(r,{children:[v(r,{className:`flex justify-between items-center`,children:[_(a,{value:N,onValueChange:e=>{M(e)},children:_(o,{variant:`tag`,children:_(s,{value:`video`,className:`text-sm`,children:O(`historyTab.video`)})})}),_(e,{variant:`ghost`,size:`sm`,className:`px-0 text-sm text-text3`,onClick:Z,children:O(P?`historyTab.cancel`:`historyTab.edit`)})]}),_(r,{className:`pt-2`,children:N===`video`?_(ne,{showVideoProgress:!0,list:G,loading:W.isFetching,hasMore:W.hasNextPage??!1,loadMore:$,isEditMode:P,selectedIds:I,onToggleSelection:Q}):_(te,{list:K,loading:W.isFetching,hasMore:W.hasNextPage??!1,loadMore:$,isEditMode:P,selectedIds:I,onToggleSelection:Q})}),P&&v(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:[v(r,{className:`flex items-center gap-2`,children:[_(i,{checked:I.size===J.size&&J.size>0,onCheckedChange:ae}),_(c,{className:`text-sm text-text1`,children:O(`historyTab.selectAll`)})]}),_(e,{className:`rounded-full py-2.5 h-auto px-6.5`,variant:I.size>0?`default`:`outline`,disabled:I.size===0||X,onClick:oe,children:O(X?`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};
|
|
@@ -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{pInteractionUnifiedBatchLikeDislike as n}from"../../../../../../../service/generated/client.mjs";import{Box as r}from"../../../../../../ui/box.mjs";import{Checkbox as i}from"../../../../../../ui/checkbox.mjs";import{Tabs as a,TabsList as o,TabsTrigger as s}from"../../../../../../ui/tabs.mjs";import{Text as c}from"../../../../../../ui/text.mjs";import{useMutation as l,usePaginated as u,useUpdateRequest as d}from"../../../../../../../hooks/query/use-query.mjs";import{useAppContext as
|
|
2
|
+
"use client";import{Button as e}from"../../../../../../ui/button.mjs";import{useUserStore as t}from"../../../../../../../store/modules/user-store.mjs";import{pInteractionUnifiedBatchLikeDislike as n}from"../../../../../../../service/generated/client.mjs";import{Box as r}from"../../../../../../ui/box.mjs";import{Checkbox as i}from"../../../../../../ui/checkbox.mjs";import{Tabs as a,TabsList as o,TabsTrigger as s}from"../../../../../../ui/tabs.mjs";import{Text as c}from"../../../../../../ui/text.mjs";import{useMutation as l,usePaginated as u,useUpdateRequest as d}from"../../../../../../../hooks/query/use-query.mjs";import{useAppContext as f}from"../../../../../../../hooks/use-app-context/index.mjs";import{PostList as ee}from"../../../../../../common/list/post-list/post-list.mjs";import{VideoList as p}from"../../../../../../common/list/video-list/video-list.mjs";import{getLikeData as m,likeContentType as h}from"../../utils.mjs";import{useEffect as g,useMemo as te,useState as _}from"react";import{jsx as v,jsxs as y}from"react/jsx-runtime";import{toast as b}from"sonner";import{useTranslations as x}from"next-intl";import{parseAsString as S,useQueryState as ne}from"nuqs";function re(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}}})}}function C(e){let{detail:t}=e,{info:n,publish_time:r}=t;return{id:e.id,title:n?.name||n?.text||n?.content||``,coverImage:n?.cover_image_thumbnail||n?.cover_image||n?.cover_horizontal_image_thumbnail||``,publishTime:r??0}}function w(e){let{detail:t}=e,{user_info:n,info:r,statics_cnt:i,publish_time:a,parent_content_info:o}=t;return{id:e.id,is_more_link:r?.is_more_link||!1,title:r?.name||r?.text||r?.content||``,coverImage:r?.cover_image_thumbnail||r?.cover_image||r?.cover_horizontal_image_thumbnail||``,duration:Number(r?.video_duration??0),progress:e.content_play_progress?.percent??0,seriesNum:e.content_play_progress?.series_num,authorName:n?.name||``,viewCount:r?.play_count??i?.browse_cnt??0,publishTime:a??0,type:o?.type}}const T=[`video`,`post`];function E({targetUserId:E,queryKeyPrefix:D,isMine:O=!1}){let k=x(`components.pages.profile.components.tabs`),A=f()===`renderer`,j=D??[],[M,N]=ne(`likeTab`,S.withDefault(`video`)),P=te(()=>T.includes(M)?M:`video`,[M]),[F,I]=_(!1),[L,R]=_(()=>new Set),z=t(e=>e.userId),B=d(),V=[...j,`user-like-video`],H=[...j,`user-like-post`],U=u({key:V,initialPageParam:1,async queryFn(e){return m({targetUserId:E,page:e,contentType:h.video})},options:{staleTime:0,enabled:A},getNextPageParam(e,t){if(typeof e?.data?.has_more==`boolean`)return e.data.has_more?t.length+1:void 0;if(!((e?.data?.list??[]).length===0||e?.data?.total===0))return t.length+1}}),W=u({key:H,options:{staleTime:0,enabled:A},initialPageParam:1,async queryFn(e){return{data:{list:[],total:0,has_more:!1}}},getNextPageParam(e,t){if(typeof e?.data?.has_more==`boolean`)return e.data.has_more?t.length+1:void 0;if(!((e?.data?.list??[]).length===0||e?.data?.total===0))return t.length+1}}),G=P===`video`?U:W,K=U.data?.pages.flatMap(e=>(e.data?.list??[]).map(w))??[],q=W.data?.pages.flatMap(e=>(e.data?.list??[]).map(C))??[],J=P===`video`?K:q,Y=new Set(J.map(e=>e.id)),X=P===`video`,{mutateAsync:ie,isPending:Z}=l(async e=>await n({app_id:0,user_id:z,action:`cancel_like`,content_ids:e,content_type:X?1:2})),ae=()=>{I(!F),R(new Set)};g(()=>{R(new Set)},[P]),g(()=>{M!==P&&N(P)},[P,M,N]);let Q=e=>{R(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},oe=()=>{L.size===Y.size&&Y.size>0?R(new Set):R(new Set(Y))},se=async()=>{if(!(L.size===0||Z)){if(!z){b.error(k(`likeTab.pleaseLogin`));return}try{let e=Array.from(L),t=await ie(e);if(t.code===0){b.success(k(`likeTab.unlikedSuccess`));let t=new Set(e);B(X?V:H,e=>re(e,t,e=>e.id)),R(new Set),I(!1)}else b.error(t.message||k(`likeTab.unlikeFailed`))}catch(e){console.error(`取消点赞失败`,e),b.error(k(`likeTab.operationFailed`))}}},$=async()=>{A&&await G.fetchNextPage()};return y(r,{children:[y(r,{className:`flex justify-between items-center`,children:[v(a,{value:P,onValueChange:e=>{N(e)},children:v(o,{variant:`tag`,children:v(s,{value:`video`,className:`text-sm`,children:k(`likeTab.video`)})})}),O&&v(e,{variant:`ghost`,size:`sm`,className:`h-6.25 px-0 text-sm text-text3`,onClick:ae,children:k(F?`likeTab.cancel`:`likeTab.edit`)})]}),v(r,{className:`pt-2`,children:P===`video`?v(p,{list:K,loading:G.isFetching,hasMore:G.hasNextPage??!1,loadMore:$,isEditMode:F,selectedIds:L,showVideoProgress:!1,onToggleSelection:Q}):v(ee,{list:q,loading:G.isFetching,hasMore:G.hasNextPage??!1,loadMore:$,isEditMode:F,selectedIds:L,onToggleSelection:Q})}),F&&y(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:[y(r,{className:`flex items-center gap-2`,children:[v(i,{checked:L.size===Y.size&&Y.size>0,onCheckedChange:oe}),v(c,{className:`text-sm text-text1`,children:k(`likeTab.selectAll`)})]}),v(e,{className:`rounded-full py-2.5 h-auto px-6.5`,variant:L.size>0?`default`:`outline`,disabled:L.size===0||Z,onClick:se,children:k(Z?`likeTab.processing`:`likeTab.delete`)})]})]})}export{E as LikeTab};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{HydrationBoundary as e}from"../../../../../../../hooks/query/hydration-boundary.mjs";import{getLikeData as t,likeContentType as n}from"../../utils.mjs";import{LikeTab as r}from"./client.mjs";import{jsx as i}from"react/jsx-runtime";function a({queryKeyPrefix:e,targetUserId:r,resolvedLikeTab:i}){
|
|
2
|
+
import{HydrationBoundary as e}from"../../../../../../../hooks/query/hydration-boundary.mjs";import{getLikeData as t,likeContentType as n}from"../../utils.mjs";import{LikeTab as r}from"./client.mjs";import{jsx as i}from"react/jsx-runtime";function a({queryKeyPrefix:e,targetUserId:r,resolvedLikeTab:i}){return r?[{type:`infinite`,queryKey:i===`post`?[...e,`user-like-post`]:[...e,`user-like-video`],async queryFn(e){return t({targetUserId:r,page:e,contentType:n.video})},initialPageParam:1,getNextPageParam(){}}]:[]}function o({prefetch:t,resolvedLikeTab:n=`video`,...o}){return i(e,{prefetch:t??a({queryKeyPrefix:o.queryKeyPrefix??[],targetUserId:o.targetUserId,resolvedLikeTab:n}),children:i(r,{...o})})}export{o as LikeTabServer,a as buildLikeTabPrefetch};
|
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
2
|
+
import { InferSchemaProps } from "../../../../utils/schema/schema.mjs";
|
|
3
|
+
import "../../../../utils/schema/index.mjs";
|
|
4
|
+
import { searchHistoryInspectorPropsSchema } from "./schema.mjs";
|
|
3
5
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
6
|
|
|
5
7
|
//#region components/biz/business/search-history/client.d.ts
|
|
6
|
-
|
|
8
|
+
type SearchHistoryProps = InferSchemaProps<typeof searchHistoryInspectorPropsSchema>;
|
|
9
|
+
interface ClientProps extends SearchHistoryProps {
|
|
7
10
|
clearText?: string;
|
|
8
11
|
confirmDescription?: string;
|
|
12
|
+
storageKey?: string;
|
|
13
|
+
onHistoryClick?: (keyword: string) => void;
|
|
9
14
|
}
|
|
10
15
|
/**
|
|
11
|
-
* 搜索历史物料组件 - 客户端交互部分
|
|
16
|
+
* 搜索历史物料组件 (search-history) - 客户端交互部分
|
|
12
17
|
*/
|
|
13
|
-
declare function SearchHistoryClient(
|
|
14
|
-
rows,
|
|
15
|
-
title,
|
|
16
|
-
clearText,
|
|
17
|
-
confirmDescription,
|
|
18
|
-
storageKey,
|
|
19
|
-
onHistoryClick
|
|
20
|
-
}: SearchHistoryClientProps): react_jsx_runtime0.JSX.Element | null;
|
|
18
|
+
declare function SearchHistoryClient(props: ClientProps): react_jsx_runtime0.JSX.Element | null;
|
|
21
19
|
//#endregion
|
|
22
|
-
export { SearchHistoryClient };
|
|
20
|
+
export { SearchHistoryClient, SearchHistoryProps };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{
|
|
2
|
+
"use client";import{Button as e}from"../../../ui/button.mjs";import t from"../../../../utils/event-bus.mjs";import{Box as n}from"../../../ui/box.mjs";import{Text as r}from"../../../ui/text.mjs";import{useAppContext as i}from"../../../../hooks/use-app-context/index.mjs";import{eventKey as a}from"../../../../constants/event-key.mjs";import{DeleteConfirmDialog as o}from"../../../common/delete-confirm-dialog/delete-confirm-dialog.mjs";import{useCallback as s,useEffect as c,useMemo as l,useState as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{usePathname as p,useRouter as m,useSearchParams as h}from"next/navigation";const g=[`示例历史1`,`示例历史2`,`示例历史3`];function _(_){let{title:v,rows:y=1,clearText:b=`清理`,confirmDescription:x=`确认删除全部搜索历史吗?`,storageKey:S=`guest`,onHistoryClick:C}=_,w=i(),[T,E]=u([]),[D,O]=u(!1),k=m(),A=p(),j=h(),M=`search_history_${S}`,N=s(()=>{let e=localStorage.getItem(M);if(e)try{E(JSON.parse(e))}catch(e){console.error(`Failed to parse search history`,e)}else E([])},[M]);c(()=>{N()},[N]),c(()=>(t.on(a.SEARCH_HISTORY_UPDATE,N),()=>{t.off(a.SEARCH_HISTORY_UPDATE,N)}),[N]);let P=()=>{E([]),localStorage.removeItem(M),O(!1),t.emit(a.SEARCH_HISTORY_UPDATE)},F=l(()=>{let e=T.length>0?T:w===`editor`?g:[],t=y*10;return e.slice(0,t)},[T,y,w]);if(F.length===0)return null;let I=e=>{if(C)C(e);else{let t=new URLSearchParams(j.toString());t.set(`q`,e);let n=A.includes(`/search`)?A:`/search`;k.push(`${n}?${t.toString()}`)}};return f(n,{className:`px-4 py-2`,children:[f(n,{className:`flex justify-between items-center mb-2`,children:[d(r,{className:`text-[16px] font-bold text-text1`,children:v}),d(e,{variant:`ghost`,size:`sm`,className:`text-text3 text-[12px] p-0 h-auto`,onClick:()=>O(!0),children:b})]}),d(n,{className:`flex flex-wrap gap-2 overflow-hidden`,style:{maxHeight:`${y*40}px`},children:F.map((e,t)=>d(n,{className:`px-3 py-1 bg-bg2 rounded-full cursor-pointer`,onClick:()=>I(e),children:d(r,{className:`text-[14px] text-text2 truncate max-w-[150px]`,children:e})},t))}),d(o,{open:D,onOpenChange:O,onConfirm:()=>{P()},title:``,description:x})]})}export{_ as SearchHistoryClient};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
3
|
-
import { SearchHistoryClient } from "./client.mjs";
|
|
2
|
+
import { searchHistoryInspectorPropsSchema } from "./schema.mjs";
|
|
3
|
+
import { SearchHistoryClient, SearchHistoryProps } from "./client.mjs";
|
|
4
4
|
import { SearchHistoryServer } from "./server.mjs";
|
|
5
5
|
import { searchHistoryMaterial } from "./material.mjs";
|
|
@@ -10,7 +10,7 @@ import * as zod_v4_core0 from "zod/v4/core";
|
|
|
10
10
|
//#region components/biz/business/search-history/material.d.ts
|
|
11
11
|
declare const searchHistoryMaterial: DefineMaterialOption<typeof SearchHistoryServer, typeof SearchHistoryClient, zod.ZodObject<{
|
|
12
12
|
title: zod.ZodString & SchemaHasDefaultValue;
|
|
13
|
-
rows: zod.
|
|
13
|
+
rows: zod.ZodNumber & SchemaHasDefaultValue;
|
|
14
14
|
}, zod_v4_core0.$strip>, "search-history">;
|
|
15
15
|
//#endregion
|
|
16
16
|
export { searchHistoryMaterial };
|
|
@@ -1,24 +1,16 @@
|
|
|
1
1
|
|
|
2
2
|
import { SchemaHasDefaultValue } from "../../../../utils/schema/schema.mjs";
|
|
3
3
|
import "../../../../utils.mjs";
|
|
4
|
-
import
|
|
4
|
+
import * as zod from "zod";
|
|
5
|
+
import * as zod_v4_core0 from "zod/v4/core";
|
|
5
6
|
|
|
6
7
|
//#region components/biz/business/search-history/schema.d.ts
|
|
7
8
|
/**
|
|
8
9
|
* 搜索历史物料属性定义
|
|
9
10
|
*/
|
|
10
|
-
declare const searchHistoryInspectorPropsSchema:
|
|
11
|
-
title:
|
|
12
|
-
rows:
|
|
13
|
-
},
|
|
14
|
-
declare const searchHistoryInspectorDefaultProps: {
|
|
15
|
-
title: string;
|
|
16
|
-
rows: "2" | "1" | "3";
|
|
17
|
-
};
|
|
18
|
-
type SearchHistoryInspectorProps = z$1.infer<typeof searchHistoryInspectorPropsSchema>;
|
|
19
|
-
type SearchHistoryProps = SearchHistoryInspectorProps & {
|
|
20
|
-
storageKey?: string;
|
|
21
|
-
onHistoryClick?: (keyword: string) => void;
|
|
22
|
-
};
|
|
11
|
+
declare const searchHistoryInspectorPropsSchema: zod.ZodObject<{
|
|
12
|
+
title: zod.ZodString & SchemaHasDefaultValue;
|
|
13
|
+
rows: zod.ZodNumber & SchemaHasDefaultValue;
|
|
14
|
+
}, zod_v4_core0.$strip>;
|
|
23
15
|
//#endregion
|
|
24
|
-
export {
|
|
16
|
+
export { searchHistoryInspectorPropsSchema };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{defineComponentPropsSchema as e,
|
|
2
|
+
import{defineComponentPropsSchema as e,defineNumberPropSchema as t,defineTextPropSchema as n}from"../../../../utils/schema/schema.mjs";const r=e({title:n({label:`标题名称`,defaultValue:`搜索历史`,description:`支持输入,中/英/数/符,6个字符`}),rows:t({label:`展示行数`,defaultValue:1})});export{r as searchHistoryInspectorPropsSchema};
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
|
|
2
|
-
import { SearchHistoryProps } from "./
|
|
2
|
+
import { SearchHistoryProps } from "./client.mjs";
|
|
3
3
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
4
|
|
|
5
5
|
//#region components/biz/business/search-history/server.d.ts
|
|
6
|
+
interface ServerProps extends SearchHistoryProps {
|
|
7
|
+
storageKey?: string;
|
|
8
|
+
onHistoryClick?: (keyword: string) => void;
|
|
9
|
+
}
|
|
6
10
|
/**
|
|
7
11
|
* 搜索历史物料组件 (search-history) - 服务端部分
|
|
8
12
|
*/
|
|
9
|
-
declare function SearchHistoryServer(props:
|
|
13
|
+
declare function SearchHistoryServer(props: ServerProps): Promise<react_jsx_runtime0.JSX.Element>;
|
|
10
14
|
//#endregion
|
|
11
15
|
export { SearchHistoryServer };
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
|
|
2
|
+
import { InferSchemaProps } from "../../../../utils/schema/schema.mjs";
|
|
3
|
+
import "../../../../utils/schema/index.mjs";
|
|
4
|
+
import { searchInputInspectorPropsSchema } from "./schema.mjs";
|
|
2
5
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
6
|
|
|
4
7
|
//#region components/biz/business/search-input/client.d.ts
|
|
5
|
-
|
|
6
|
-
|
|
8
|
+
type SearchInputProps = InferSchemaProps<typeof searchInputInspectorPropsSchema>;
|
|
9
|
+
interface ClientProps extends SearchInputProps {
|
|
7
10
|
defaultPlaceholder?: string;
|
|
8
11
|
searchLabel?: string;
|
|
12
|
+
storageKey?: string;
|
|
13
|
+
onSearch?: (keyword: string) => void;
|
|
9
14
|
}
|
|
10
15
|
/**
|
|
11
|
-
* 搜索输入框物料组件 - 客户端交互部分
|
|
16
|
+
* 搜索输入框物料组件 (SearchInput) - 客户端交互部分
|
|
17
|
+
* 适配 Figma 设计稿布局:包含返回按钮、带边框的输入框、外部搜索按钮
|
|
12
18
|
*/
|
|
13
|
-
declare function SearchInputClient(
|
|
14
|
-
placeholder,
|
|
15
|
-
defaultPlaceholder,
|
|
16
|
-
searchLabel
|
|
17
|
-
}: SearchInputClientProps): react_jsx_runtime0.JSX.Element;
|
|
19
|
+
declare function SearchInputClient(props: ClientProps): react_jsx_runtime0.JSX.Element;
|
|
18
20
|
//#endregion
|
|
19
|
-
export { SearchInputClient };
|
|
21
|
+
export { SearchInputClient, SearchInputProps };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import
|
|
2
|
+
"use client";import e from"../../../../utils/event-bus.mjs";import{Box as t}from"../../../ui/box.mjs";import{Input as n}from"../../../ui/input.mjs";import{Text as r}from"../../../ui/text.mjs";import{eventKey as i}from"../../../../constants/event-key.mjs";import a from"../../../../assets/icons/left_arrow.mjs";import o from"../../../../assets/icons/search.mjs";import s from"../../../../assets/icons/clear.mjs";import{useCallback as c,useEffect as l,useState as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{usePathname as p,useRouter as m,useSearchParams as h}from"next/navigation";function g(g){let{placeholder:_,defaultPlaceholder:v=`请输入搜索关键词`,searchLabel:y=`搜索`,storageKey:b=`guest`,onSearch:x}=g,[S,C]=u(``),w=m(),T=p(),E=h(),D=`search_history_${b}`,O=c(t=>{if(t.trim()){try{let n=localStorage.getItem(D),r=n?JSON.parse(n):[];r=[t,...r.filter(e=>e!==t)],localStorage.setItem(D,JSON.stringify(r.slice(0,20))),e.emit(i.SEARCH_HISTORY_UPDATE)}catch(e){console.error(`Failed to save search history`,e)}if(x)x(t);else{let e=new URLSearchParams(E.toString());e.set(`q`,t);let n=T.includes(`/search`)?T:`/search`;w.push(`${n}?${e.toString()}`)}}},[D,x,T,w,E]);l(()=>{let e=E.get(`q`);e&&e!==S&&(C(e),O(e))},[E,O,S]),l(()=>{if(S===``){if(E.has(`q`)){let e=new URLSearchParams(E.toString());e.delete(`q`);let t=T.includes(`/search`)?T:`/search`;w.push(`${t}${e.toString()?`?${e.toString()}`:``}`)}e.emit(i.SEARCH_HISTORY_UPDATE)}},[S,T,w,E]);let k=()=>{O(S)};return f(t,{className:`px-3 py-2 bg-bg1 flex items-center gap-3 w-full`,children:[d(t,{className:`shrink-0 cursor-pointer active:opacity-70`,onClick:()=>{w.back()},children:d(a,{className:`w-4 h-4 text-text1`})}),f(t,{className:`flex-1 flex items-center gap-1 bg-bg2 border border-theme5 rounded-[20px] px-2 py-1.5 overflow-hidden`,children:[d(t,{className:`p-1 shrink-0`,children:d(o,{className:`w-[14px] h-[14px] text-text3`})}),d(n,{className:`flex-1 border-none bg-transparent p-0 h-auto text-[14px] leading-[22px] focus-visible:ring-0 text-text1 placeholder:text-text3`,placeholder:_||v,value:S,onChange:e=>C(e.target.value),onKeyDown:e=>e.key===`Enter`&&k()}),S&&d(s,{className:`w-[15px] h-[15px] text-text3 shrink-0 cursor-pointer active:opacity-70`,onClick:()=>{C(``)}})]}),d(t,{className:`shrink-0 cursor-pointer active:opacity-70`,onClick:k,children:d(r,{className:`text-[16px] text-text1 leading-[24px] font-normal`,children:y})})]})}export{g as SearchInputClient};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { searchInputInspectorPropsSchema } from "./schema.mjs";
|
|
3
|
+
import { SearchInputClient, SearchInputProps } from "./client.mjs";
|
|
4
4
|
import { SearchInputServer } from "./server.mjs";
|
|
5
5
|
import { searchInputMaterial } from "./material.mjs";
|
|
@@ -1,19 +1,15 @@
|
|
|
1
1
|
|
|
2
2
|
import { SchemaHasDefaultValue } from "../../../../utils/schema/schema.mjs";
|
|
3
3
|
import "../../../../utils.mjs";
|
|
4
|
-
import
|
|
4
|
+
import * as zod from "zod";
|
|
5
|
+
import * as zod_v4_core0 from "zod/v4/core";
|
|
5
6
|
|
|
6
7
|
//#region components/biz/business/search-input/schema.d.ts
|
|
7
8
|
/**
|
|
8
9
|
* 搜索输入框物料属性定义
|
|
9
10
|
*/
|
|
10
|
-
declare const searchInputInspectorPropsSchema:
|
|
11
|
-
placeholder:
|
|
12
|
-
},
|
|
13
|
-
declare const searchInputInspectorDefaultProps: {
|
|
14
|
-
placeholder: string;
|
|
15
|
-
};
|
|
16
|
-
type SearchInputInspectorProps = z$1.infer<typeof searchInputInspectorPropsSchema>;
|
|
17
|
-
type SearchInputProps = SearchInputInspectorProps;
|
|
11
|
+
declare const searchInputInspectorPropsSchema: zod.ZodObject<{
|
|
12
|
+
placeholder: zod.ZodString & SchemaHasDefaultValue;
|
|
13
|
+
}, zod_v4_core0.$strip>;
|
|
18
14
|
//#endregion
|
|
19
|
-
export {
|
|
15
|
+
export { searchInputInspectorPropsSchema };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{defineComponentPropsSchema as e,defineTextPropSchema as t
|
|
2
|
+
import{defineComponentPropsSchema as e,defineTextPropSchema as t}from"../../../../utils/schema/schema.mjs";const n=e({placeholder:t({label:`占位文本`,defaultValue:`搜索关键词`})});export{n as searchInputInspectorPropsSchema};
|
|
@@ -9,7 +9,7 @@ import * as zod_v4_core0 from "zod/v4/core";
|
|
|
9
9
|
|
|
10
10
|
//#region components/biz/business/shortcut-grid/material.d.ts
|
|
11
11
|
declare const shortcutGridMaterial: DefineMaterialOption<typeof ShortcutGrid, typeof ShortcutGridClient, zod.ZodObject<{
|
|
12
|
-
title: zod.
|
|
12
|
+
title: zod.ZodString & SchemaHasDefaultValue;
|
|
13
13
|
shortcutCount: zod.ZodNumber & SchemaHasDefaultValue;
|
|
14
14
|
isShortcutTitle: zod.ZodBoolean & SchemaHasDefaultValue;
|
|
15
15
|
shortcuts: zod.ZodArray<zod.ZodObject<{
|
|
@@ -8,7 +8,7 @@ import z$1 from "zod";
|
|
|
8
8
|
* 金刚区物料可配置字段:
|
|
9
9
|
*/
|
|
10
10
|
declare const shortcutGridInspectorPropsSchema: z$1.ZodObject<{
|
|
11
|
-
title: z$1.
|
|
11
|
+
title: z$1.ZodString & SchemaHasDefaultValue;
|
|
12
12
|
shortcutCount: z$1.ZodNumber & SchemaHasDefaultValue;
|
|
13
13
|
isShortcutTitle: z$1.ZodBoolean & SchemaHasDefaultValue;
|
|
14
14
|
shortcuts: z$1.ZodArray<z$1.ZodObject<{
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{defineArrayItemPropSchema as e,defineComponentPropsSchema as t,defineNumberPropSchema as n,defineSwitchPropSchema as r,defineTextPropSchema as i,getSchemaDefaultProps as a}from"../../../../utils/schema/schema.mjs";import o from"zod";const s=t({title:i({label:`推荐位名称`,required:!
|
|
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({title:i({label:`推荐位名称`,required:!0,defaultValue:`推荐列表`}),shortcutCount:n({label:`入口数量`,required:!0,defaultValue:4}).refine(e=>e>=3&&e<=5,`入口数量必须为 3-5`),isShortcutTitle:r({label:`是否显示入口标题`,required:!0,defaultValue:!0}),shortcuts:e(o.object({label:i({label:`入口标题`,required:!1,defaultValue:`最新`}),icon:i({label:`图标`,required:!0,defaultValue:``}),href:i({label:`跳转指向`,required:!0,defaultValue:``})}),{label:`推荐列表`,required:!0,defaultValue:[{label:`热门`,icon:`/images/2026/01/21/6967aec2d806ed47d5238861/fce0a95c-1e8f-4872-ab69-86212435e1bc.jpegxxx`,href:`/video-list?title=穷小伙刚离婚,找了他3年的女总裁蒙着面纱出现了,一身红嫁衣当众求嫁,前妻嘲笑她是丑八怪,下秒揭开面纱后全场沉默了&tags=动作`},{label:`新上架`,icon:`/images/2026/01/21/6967aec2d806ed47d5238861/fce0a95c-1e8f-4872-ab69-86212435e1bc.jpegxxx`,href:`/video-list?title=穷小伙刚离婚,找了他3年的女总裁蒙着面纱出现了,一身红嫁衣当众求嫁,前妻嘲笑她是丑八怪,下秒揭开面纱后全场沉默了&tags=动作`},{label:`排行榜`,icon:`/images/2026/01/21/6967aec2d806ed47d5238861/fce0a95c-1e8f-4872-ab69-86212435e1bc.jpegxxx`,href:`/video-list?title=穷小伙刚离婚,找了他3年的女总裁蒙着面纱出现了,一身红嫁衣当众求嫁,前妻嘲笑她是丑八怪,下秒揭开面纱后全场沉默了&tags=动作`},{label:`筛选`,icon:`/images/2026/01/21/6967aec2d806ed47d5238861/fce0a95c-1e8f-4872-ab69-86212435e1bc.jpegxxx`,href:`/video-list?title=穷小伙刚离婚,找了他3年的女总裁蒙着面纱出现了,一身红嫁衣当众求嫁,前妻嘲笑她是丑八怪,下秒揭开面纱后全场沉默了&tags=动作`}]})}),c=a(s);export{c as shortcutGridInspectorDefaultProps,s as shortcutGridInspectorPropsSchema};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
2
|
+
import { InferSchemaProps } from "../../../../utils/schema/schema.mjs";
|
|
3
|
+
import "../../../../utils/schema/index.mjs";
|
|
4
|
+
import { tabBarInspectorPropsSchema } from "./schema.mjs";
|
|
3
5
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
6
|
|
|
5
7
|
//#region components/biz/business/tab-bar/client.d.ts
|
|
8
|
+
type TabBarProps = InferSchemaProps<typeof tabBarInspectorPropsSchema>;
|
|
6
9
|
/**
|
|
7
10
|
* TabBar 物料组件 - 客户端交互部分
|
|
8
11
|
*/
|
|
9
|
-
declare function TabBarClient(
|
|
10
|
-
items
|
|
11
|
-
}: TabBarProps): react_jsx_runtime0.JSX.Element | null;
|
|
12
|
+
declare function TabBarClient(props: TabBarProps): react_jsx_runtime0.JSX.Element | null;
|
|
12
13
|
//#endregion
|
|
13
|
-
export { TabBarClient };
|
|
14
|
+
export { TabBarClient, TabBarProps };
|