@funhub/platform 0.1.150 → 0.1.152
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/biz/business/banner/variants/basic-banner/inspector-schema.d.mts +5 -4
- package/dist/components/biz/business/banner/variants/basic-banner/inspector-schema.mjs +1 -1
- package/dist/components/biz/business/banner/variants/basic-banner/material.d.mts +3 -2
- package/dist/components/biz/business/banner-carousel/material.d.mts +3 -2
- package/dist/components/biz/business/banner-carousel/schema.d.mts +3 -2
- package/dist/components/biz/business/banner-carousel/schema.mjs +1 -1
- package/dist/components/biz/business/channel-list/material.d.mts +3 -2
- package/dist/components/biz/business/channel-list/schema.d.mts +3 -2
- package/dist/components/biz/business/channel-list/schema.mjs +1 -1
- package/dist/components/biz/business/detail/shared/registry.d.mts +17 -14
- package/dist/components/biz/business/detail/video-detail-actions/schema.mjs +1 -1
- package/dist/components/biz/business/detail/video-detail-info/material.d.mts +3 -2
- package/dist/components/biz/business/detail/video-detail-info/schema.d.mts +3 -2
- package/dist/components/biz/business/detail/video-detail-info/schema.mjs +1 -1
- package/dist/components/biz/business/detail/video-detail-info-title-tags-episodes/material.d.mts +3 -2
- package/dist/components/biz/business/detail/video-detail-info-title-tags-episodes/schema.d.mts +3 -2
- package/dist/components/biz/business/detail/video-detail-info-title-tags-episodes/schema.mjs +1 -1
- package/dist/components/biz/business/detail/video-detail-player/schema.mjs +1 -1
- package/dist/components/biz/business/detail/video-detail-player-bridge-only/schema.mjs +1 -1
- package/dist/components/biz/business/detail/video-detail-recommend/client.mjs +1 -1
- package/dist/components/biz/business/detail/video-detail-recommend/material.d.mts +11 -10
- package/dist/components/biz/business/detail/video-detail-recommend/schema.d.mts +11 -10
- package/dist/components/biz/business/detail/video-detail-recommend/schema.mjs +1 -1
- package/dist/components/biz/business/floating-ball/material.d.mts +3 -2
- package/dist/components/biz/business/floating-ball/schema.d.mts +5 -4
- package/dist/components/biz/business/floating-ball/schema.mjs +1 -1
- package/dist/components/biz/business/header-search/header-avatar-icon/schema.mjs +1 -1
- package/dist/components/biz/business/header-search/header-avatar-logo-search/material.d.mts +3 -2
- package/dist/components/biz/business/header-search/header-avatar-logo-search/schema.d.mts +3 -2
- package/dist/components/biz/business/header-search/header-avatar-logo-search/schema.mjs +1 -1
- package/dist/components/biz/business/header-search/header-avatar-logo-search-icon/material.d.mts +3 -2
- package/dist/components/biz/business/header-search/header-avatar-logo-search-icon/schema.d.mts +3 -2
- package/dist/components/biz/business/header-search/header-avatar-logo-search-icon/schema.mjs +1 -1
- package/dist/components/biz/business/header-search/header-logo-search/material.d.mts +3 -2
- package/dist/components/biz/business/header-search/header-logo-search/schema.d.mts +3 -2
- package/dist/components/biz/business/header-search/header-logo-search/schema.mjs +1 -1
- package/dist/components/biz/business/header-search/header-search/schema.mjs +1 -1
- package/dist/components/biz/business/home-recommend/home-recommend-grid/inspector-schema.d.mts +13 -12
- package/dist/components/biz/business/home-recommend/home-recommend-grid/inspector-schema.mjs +1 -1
- package/dist/components/biz/business/home-recommend/home-recommend-grid/material.d.mts +13 -12
- package/dist/components/biz/business/home-recommend/home-recommend-waterfall/inspector-schema.d.mts +11 -10
- package/dist/components/biz/business/home-recommend/home-recommend-waterfall/inspector-schema.mjs +1 -1
- package/dist/components/biz/business/home-recommend/home-recommend-waterfall/material.d.mts +11 -10
- package/dist/components/biz/business/home-recommend/shared/home-recommend-base.mjs +1 -1
- package/dist/components/biz/business/home-recommend/shared/home-recommend-server-data.mjs +1 -1
- package/dist/components/biz/business/home-recommend/shared/home-recommend-video-detail.mjs +1 -1
- package/dist/components/biz/business/image-text-recommend/material.d.mts +15 -14
- package/dist/components/biz/business/image-text-recommend/schema.d.mts +15 -14
- package/dist/components/biz/business/image-text-recommend/schema.mjs +1 -1
- package/dist/components/biz/business/large-feature-grid/client.mjs +1 -1
- package/dist/components/biz/business/large-feature-grid/schema.mjs +1 -1
- package/dist/components/biz/business/marquee/material.d.mts +8 -7
- package/dist/components/biz/business/marquee/schema.d.mts +26 -24
- package/dist/components/biz/business/marquee/schema.mjs +1 -1
- package/dist/components/biz/business/profile/profile-header/schema.mjs +1 -1
- package/dist/components/biz/business/profile/profile-header/user-profile-avatar.mjs +1 -1
- package/dist/components/biz/business/profile/profile-main/schema.mjs +1 -1
- package/dist/components/biz/business/profile/profile-main/tabs/like-tab/client.d.mts +1 -1
- package/dist/components/biz/business/search-history/material.d.mts +3 -2
- package/dist/components/biz/business/search-history/schema.d.mts +3 -2
- package/dist/components/biz/business/search-history/schema.mjs +1 -1
- package/dist/components/biz/business/search-input/schema.mjs +1 -1
- package/dist/components/biz/business/shortcut-grid/material.d.mts +5 -4
- package/dist/components/biz/business/shortcut-grid/schema.d.mts +5 -4
- package/dist/components/biz/business/shortcut-grid/schema.mjs +1 -1
- package/dist/components/biz/business/tab-bar/schema.mjs +1 -1
- package/dist/components/biz/business/text-recommend/material.d.mts +4 -3
- package/dist/components/biz/business/text-recommend/schema.d.mts +4 -3
- package/dist/components/biz/business/text-recommend/schema.mjs +1 -1
- package/dist/components/biz/example/button/material.d.mts +9 -8
- package/dist/components/biz/example/button/schema.d.mts +21 -19
- package/dist/components/biz/example/button/schema.mjs +1 -1
- package/dist/components/pages/collection-add/page.mjs +1 -1
- package/dist/components/pages/collection-create/form.mjs +1 -1
- package/dist/components/pages/collection-detail/detail.mjs +1 -1
- package/dist/components/pages/login/verify.mjs +1 -1
- package/dist/components/pages/video-list/video-list-client.mjs +1 -1
- package/dist/components/ui/badge.d.mts +1 -1
- package/dist/components/ui/button-group.d.mts +1 -1
- package/dist/components/ui/button.d.mts +1 -1
- package/dist/components/ui/dots-loading.d.mts +25 -0
- package/dist/components/ui/dots-loading.mjs +2 -0
- package/dist/components/ui/field.d.mts +1 -1
- package/dist/hooks/use-first-row-height.d.mts +69 -0
- package/dist/hooks/use-first-row-height.mjs +2 -0
- package/dist/hooks/use-min-duration-loading.d.mts +18 -0
- package/dist/hooks/use-min-duration-loading.mjs +2 -0
- package/dist/hooks.d.mts +3 -1
- package/dist/hooks.mjs +1 -1
- package/dist/service/generated/client.d.mts +12 -4
- package/dist/service/generated/client.mjs +1 -1
- package/dist/service/generated/tanstack.d.mts +14 -4
- package/dist/service/generated/tanstack.mjs +1 -1
- package/dist/service/register-by-verify-email-code.d.mts +2 -2
- package/dist/service/register-by-verify-email-code.mjs +1 -1
- package/dist/service.d.mts +4 -4
- package/dist/service.mjs +1 -1
- package/dist/types.d.mts +548 -57
- package/dist/ui.d.mts +2 -1
- package/dist/ui.mjs +1 -1
- package/dist/utils/device-id.d.mts +14 -0
- package/dist/utils/device-id.mjs +2 -0
- package/dist/utils/http.mjs +1 -1
- package/dist/utils/schema/index.d.mts +1 -1
- package/dist/utils/schema/inspector.d.mts +43 -71
- package/dist/utils/schema/schema.d.mts +59 -53
- package/dist/utils/schema/schema.mjs +1 -1
- package/dist/utils.d.mts +3 -2
- package/dist/utils.mjs +1 -1
- package/package.json +28 -28
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
|
+
import { CommunityContentInfo } from "../../../../../../../types/community-types.mjs";
|
|
2
3
|
import { MaterialComponentMode } from "../../../../../../../utils/schema/schema.mjs";
|
|
3
4
|
import "../../../../../../../utils.mjs";
|
|
4
|
-
import { CommunityContentInfo } from "../../../../../../../types/community-types.mjs";
|
|
5
5
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
6
6
|
|
|
7
7
|
//#region components/biz/business/profile/profile-main/tabs/like-tab/client.d.ts
|
|
@@ -9,8 +9,9 @@ import * as zod_v4_core0 from "zod/v4/core";
|
|
|
9
9
|
|
|
10
10
|
//#region components/biz/business/search-history/material.d.ts
|
|
11
11
|
declare const searchHistoryMaterial: DefineMaterialOption<typeof SearchHistoryServer, typeof SearchHistoryClient, zod.ZodObject<{
|
|
12
|
-
title: zod.ZodString & SchemaHasDefaultValue;
|
|
13
|
-
rows: zod.ZodNumber & SchemaHasDefaultValue;
|
|
12
|
+
readonly title: zod.ZodString & SchemaHasDefaultValue;
|
|
13
|
+
readonly rows: zod.ZodNumber & SchemaHasDefaultValue;
|
|
14
|
+
} & {
|
|
14
15
|
mode: zod.ZodOptional<zod.ZodEnum<{
|
|
15
16
|
renderer: "renderer";
|
|
16
17
|
editor: "editor";
|
|
@@ -9,8 +9,9 @@ import * as zod_v4_core0 from "zod/v4/core";
|
|
|
9
9
|
* 搜索历史物料属性定义
|
|
10
10
|
*/
|
|
11
11
|
declare const searchHistoryInspectorPropsSchema: zod.ZodObject<{
|
|
12
|
-
title: zod.ZodString & SchemaHasDefaultValue;
|
|
13
|
-
rows: zod.ZodNumber & SchemaHasDefaultValue;
|
|
12
|
+
readonly title: zod.ZodString & SchemaHasDefaultValue;
|
|
13
|
+
readonly rows: zod.ZodNumber & SchemaHasDefaultValue;
|
|
14
|
+
} & {
|
|
14
15
|
mode: zod.ZodOptional<zod.ZodEnum<{
|
|
15
16
|
renderer: "renderer";
|
|
16
17
|
editor: "editor";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{defineComponentPropsSchema as e
|
|
2
|
+
import{defineComponentPropsSchema as e}from"../../../../utils/schema/schema.mjs";const t=e(e=>({title:e.string(`搜索历史`,{label:`标题名称`,description:`支持输入,中/英/数/符,6个字符`}),rows:e.number(1,{label:`展示行数`})}));export{t as searchHistoryInspectorPropsSchema};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{defineComponentPropsSchema as e,getSchemaDefaultProps as t}from"../../../../utils/schema/schema.mjs";const n=e({}),r=t(n);export{r as searchInputInspectorDefaultProps,n as searchInputInspectorPropsSchema};
|
|
2
|
+
import{defineComponentPropsSchema as e,getSchemaDefaultProps as t}from"../../../../utils/schema/schema.mjs";const n=e(e=>({})),r=t(n);export{r as searchInputInspectorDefaultProps,n as searchInputInspectorPropsSchema};
|
|
@@ -9,14 +9,15 @@ 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.ZodString & SchemaHasDefaultValue;
|
|
13
|
-
shortcutCount: zod.ZodNumber & SchemaHasDefaultValue;
|
|
14
|
-
isShortcutTitle: zod.ZodBoolean & SchemaHasDefaultValue;
|
|
15
|
-
shortcuts: zod.ZodArray<zod.ZodObject<{
|
|
12
|
+
readonly title: zod.ZodString & SchemaHasDefaultValue;
|
|
13
|
+
readonly shortcutCount: zod.ZodNumber & SchemaHasDefaultValue;
|
|
14
|
+
readonly isShortcutTitle: zod.ZodBoolean & SchemaHasDefaultValue;
|
|
15
|
+
readonly shortcuts: zod.ZodArray<zod.ZodObject<{
|
|
16
16
|
label: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
|
|
17
17
|
icon: zod.ZodString & SchemaHasDefaultValue;
|
|
18
18
|
href: zod.ZodString & SchemaHasDefaultValue;
|
|
19
19
|
}, zod_v4_core0.$strip>> & SchemaHasDefaultValue;
|
|
20
|
+
} & {
|
|
20
21
|
mode: zod.ZodOptional<zod.ZodEnum<{
|
|
21
22
|
renderer: "renderer";
|
|
22
23
|
editor: "editor";
|
|
@@ -8,14 +8,15 @@ import z$1 from "zod";
|
|
|
8
8
|
* 金刚区物料可配置字段:
|
|
9
9
|
*/
|
|
10
10
|
declare const shortcutGridInspectorPropsSchema: z$1.ZodObject<{
|
|
11
|
-
title: z$1.ZodString & SchemaHasDefaultValue;
|
|
12
|
-
shortcutCount: z$1.ZodNumber & SchemaHasDefaultValue;
|
|
13
|
-
isShortcutTitle: z$1.ZodBoolean & SchemaHasDefaultValue;
|
|
14
|
-
shortcuts: z$1.ZodArray<z$1.ZodObject<{
|
|
11
|
+
readonly title: z$1.ZodString & SchemaHasDefaultValue;
|
|
12
|
+
readonly shortcutCount: z$1.ZodNumber & SchemaHasDefaultValue;
|
|
13
|
+
readonly isShortcutTitle: z$1.ZodBoolean & SchemaHasDefaultValue;
|
|
14
|
+
readonly shortcuts: z$1.ZodArray<z$1.ZodObject<{
|
|
15
15
|
label: z$1.ZodOptional<z$1.ZodString> & SchemaHasDefaultValue;
|
|
16
16
|
icon: z$1.ZodString & SchemaHasDefaultValue;
|
|
17
17
|
href: z$1.ZodString & SchemaHasDefaultValue;
|
|
18
18
|
}, z$1.core.$strip>> & SchemaHasDefaultValue;
|
|
19
|
+
} & {
|
|
19
20
|
mode: z$1.ZodOptional<z$1.ZodEnum<{
|
|
20
21
|
renderer: "renderer";
|
|
21
22
|
editor: "editor";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{
|
|
2
|
+
import{defineComponentPropsSchema as e,getSchemaDefaultProps as t}from"../../../../utils/schema/schema.mjs";import n from"zod";const r=e(e=>({title:e.string(`推荐列表`,{label:`推荐位名称`,required:!0}),shortcutCount:e.number(4,{label:`入口数量`,required:!0}).refine(e=>e>=3&&e<=5,`入口数量必须为 3-5`),isShortcutTitle:e.boolean(!0,{fieldType:`switch`,label:`是否显示入口标题`,required:!0}),shortcuts:e.array(n.object({label:e.string(`最新`,{label:`入口标题`,required:!1}),icon:e.string(``,{label:`图标`,required:!0}),href:e.string(``,{label:`跳转指向`,required:!0})}),{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=动作`}]})})),i=t(r);export{i as shortcutGridInspectorDefaultProps,r as shortcutGridInspectorPropsSchema};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{defineComponentPropsSchema as e,getSchemaDefaultProps as t}from"../../../../utils/schema/schema.mjs";const n=e({}),r=t(n);export{r as tabBarInspectorDefaultProps,n as tabBarInspectorPropsSchema};
|
|
2
|
+
import{defineComponentPropsSchema as e,getSchemaDefaultProps as t}from"../../../../utils/schema/schema.mjs";const n=e(e=>({})),r=t(n);export{r as tabBarInspectorDefaultProps,n as tabBarInspectorPropsSchema};
|
|
@@ -9,11 +9,12 @@ import * as zod_v4_core0 from "zod/v4/core";
|
|
|
9
9
|
|
|
10
10
|
//#region components/biz/business/text-recommend/material.d.ts
|
|
11
11
|
declare const textRecommendMaterial: DefineMaterialOption<typeof TextRecommendServer, typeof TextRecommendClient, zod.ZodObject<{
|
|
12
|
-
title: zod.ZodString & SchemaHasDefaultValue;
|
|
13
|
-
displayCount: zod.ZodNumber & SchemaHasDefaultValue;
|
|
14
|
-
items: zod.ZodArray<zod.ZodObject<{
|
|
12
|
+
readonly title: zod.ZodString & SchemaHasDefaultValue;
|
|
13
|
+
readonly displayCount: zod.ZodNumber & SchemaHasDefaultValue;
|
|
14
|
+
readonly items: zod.ZodArray<zod.ZodObject<{
|
|
15
15
|
label: zod.ZodString & SchemaHasDefaultValue;
|
|
16
16
|
}, zod_v4_core0.$strip>> & SchemaHasDefaultValue;
|
|
17
|
+
} & {
|
|
17
18
|
mode: zod.ZodOptional<zod.ZodEnum<{
|
|
18
19
|
renderer: "renderer";
|
|
19
20
|
editor: "editor";
|
|
@@ -8,11 +8,12 @@ import { z } from "zod";
|
|
|
8
8
|
* 文字推荐物料属性定义
|
|
9
9
|
*/
|
|
10
10
|
declare const textRecommendInspectorPropsSchema: z.ZodObject<{
|
|
11
|
-
title: z.ZodString & SchemaHasDefaultValue;
|
|
12
|
-
displayCount: z.ZodNumber & SchemaHasDefaultValue;
|
|
13
|
-
items: z.ZodArray<z.ZodObject<{
|
|
11
|
+
readonly title: z.ZodString & SchemaHasDefaultValue;
|
|
12
|
+
readonly displayCount: z.ZodNumber & SchemaHasDefaultValue;
|
|
13
|
+
readonly items: z.ZodArray<z.ZodObject<{
|
|
14
14
|
label: z.ZodString & SchemaHasDefaultValue;
|
|
15
15
|
}, z.core.$strip>> & SchemaHasDefaultValue;
|
|
16
|
+
} & {
|
|
16
17
|
mode: z.ZodOptional<z.ZodEnum<{
|
|
17
18
|
renderer: "renderer";
|
|
18
19
|
editor: "editor";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{
|
|
2
|
+
import{defineComponentPropsSchema as e}from"../../../../utils/schema/schema.mjs";import{z as t}from"zod";const n=e(e=>({title:e.string(`文字推荐标题`,{label:`标题名称`,description:`支持输入,中/英/数/符,6个字符`}),displayCount:e.number(2,{label:`展示数`}),items:e.array(t.object({label:e.string(`推荐搜索1`,{label:`热词`})}),{label:`推荐位模块`,defaultValue:[{label:`推荐搜索2`},{label:`推荐搜索3`}]})}));export{n as textRecommendInspectorPropsSchema};
|
|
@@ -9,16 +9,17 @@ import * as zod_v4_core0 from "zod/v4/core";
|
|
|
9
9
|
|
|
10
10
|
//#region components/biz/example/button/material.d.ts
|
|
11
11
|
declare const exampleButtonMaterial: DefineMaterialOption<typeof Button, typeof ButtonClient, zod.ZodObject<{
|
|
12
|
-
text: zod.ZodString & SchemaHasDefaultValue;
|
|
13
|
-
variant: zod.ZodType<"default" | "blue" | "red", unknown, zod_v4_core0.$ZodTypeInternals<"default" | "blue" | "red", unknown>> & SchemaHasDefaultValue;
|
|
14
|
-
disabled: zod.ZodOptional<zod.ZodBoolean> & SchemaHasDefaultValue;
|
|
15
|
-
loading: zod.ZodOptional<zod.ZodBoolean>;
|
|
16
|
-
items: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
|
|
17
|
-
name: zod.ZodOptional<zod.ZodString>;
|
|
12
|
+
readonly text: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
|
|
13
|
+
readonly variant: zod.ZodType<"default" | "blue" | "red", unknown, zod_v4_core0.$ZodTypeInternals<"default" | "blue" | "red", unknown>> & SchemaHasDefaultValue;
|
|
14
|
+
readonly disabled: zod.ZodOptional<zod.ZodBoolean> & SchemaHasDefaultValue;
|
|
15
|
+
readonly loading: zod.ZodOptional<zod.ZodBoolean>;
|
|
16
|
+
readonly items: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
|
|
17
|
+
readonly name: zod.ZodOptional<zod.ZodString>;
|
|
18
18
|
}, zod_v4_core0.$strip>>> & SchemaHasDefaultValue;
|
|
19
|
-
info: zod.
|
|
19
|
+
readonly info: zod.ZodObject<{
|
|
20
20
|
readonly address: zod.ZodOptional<zod.ZodString>;
|
|
21
|
-
}, zod_v4_core0.$strip
|
|
21
|
+
}, zod_v4_core0.$strip> & SchemaHasDefaultValue;
|
|
22
|
+
} & {
|
|
22
23
|
mode: zod.ZodOptional<zod.ZodEnum<{
|
|
23
24
|
renderer: "renderer";
|
|
24
25
|
editor: "editor";
|
|
@@ -1,36 +1,38 @@
|
|
|
1
1
|
|
|
2
2
|
import { InferSchemaProps, 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/example/button/schema.d.ts
|
|
7
8
|
/**
|
|
8
9
|
* 定义可以被低代码右侧inspector编辑的props
|
|
9
10
|
*/
|
|
10
|
-
declare const buttonInspectorPropsSchema:
|
|
11
|
-
text:
|
|
12
|
-
variant:
|
|
13
|
-
disabled:
|
|
14
|
-
loading:
|
|
15
|
-
items:
|
|
16
|
-
name:
|
|
17
|
-
},
|
|
18
|
-
info:
|
|
19
|
-
readonly address:
|
|
20
|
-
},
|
|
21
|
-
|
|
11
|
+
declare const buttonInspectorPropsSchema: zod.ZodObject<{
|
|
12
|
+
readonly text: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
|
|
13
|
+
readonly variant: zod.ZodType<"default" | "blue" | "red", unknown, zod_v4_core0.$ZodTypeInternals<"default" | "blue" | "red", unknown>> & SchemaHasDefaultValue;
|
|
14
|
+
readonly disabled: zod.ZodOptional<zod.ZodBoolean> & SchemaHasDefaultValue;
|
|
15
|
+
readonly loading: zod.ZodOptional<zod.ZodBoolean>;
|
|
16
|
+
readonly items: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
|
|
17
|
+
readonly name: zod.ZodOptional<zod.ZodString>;
|
|
18
|
+
}, zod_v4_core0.$strip>>> & SchemaHasDefaultValue;
|
|
19
|
+
readonly info: zod.ZodObject<{
|
|
20
|
+
readonly address: zod.ZodOptional<zod.ZodString>;
|
|
21
|
+
}, zod_v4_core0.$strip> & SchemaHasDefaultValue;
|
|
22
|
+
} & {
|
|
23
|
+
mode: zod.ZodOptional<zod.ZodEnum<{
|
|
22
24
|
renderer: "renderer";
|
|
23
25
|
editor: "editor";
|
|
24
26
|
}>>;
|
|
25
|
-
},
|
|
27
|
+
}, zod_v4_core0.$strip>;
|
|
26
28
|
declare const buttonInspectorDefaultProps: {
|
|
27
|
-
text: string;
|
|
28
|
-
variant: "default" | "blue" | "red";
|
|
29
|
-
disabled: boolean;
|
|
30
|
-
items: {
|
|
29
|
+
readonly text: string;
|
|
30
|
+
readonly variant: "default" | "blue" | "red";
|
|
31
|
+
readonly disabled: boolean;
|
|
32
|
+
readonly items: {
|
|
31
33
|
name?: string | undefined;
|
|
32
34
|
}[];
|
|
33
|
-
info: {
|
|
35
|
+
readonly info: {
|
|
34
36
|
address?: string | undefined;
|
|
35
37
|
};
|
|
36
38
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{
|
|
2
|
+
import{defineComponentPropsSchema as e,getSchemaDefaultProps as t}from"../../../../utils/schema/schema.mjs";import{buttonVariantOptions as n}from"./variants.mjs";const r=e(e=>({text:e.string(`example button`,{label:`文本`,required:!1}),variant:e.enum(n,`red`,{label:`变体`}),disabled:e.boolean(!1,{fieldType:`checkbox`,label:`禁用`,required:!1}),loading:e.boolean({fieldType:`switch`,label:`加载`,required:!1}),items:e.array(e.object({name:e.string({label:`名称`,required:!1})}),{required:!1,label:`items`,defaultValue:[{name:`string`}]}),info:e.object({address:e.string({label:`地址`,required:!1})},{label:`info`,required:!0,defaultValue:{address:`SHENZHEN`}})})),i=t(r);export{i as buttonInspectorDefaultProps,r as buttonInspectorPropsSchema};
|
|
@@ -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{gCommunityGetContentList as n,pCommunityAddContentToCollection as r}from"../../../service/generated/client.mjs";import{Box as i}from"../../ui/box.mjs";import{useDeleteRequest as a,useMutation as o,usePaginated as s}from"../../../hooks/query/use-query.mjs";import{HeaderNav as c}from"../../common/header-nav/client.mjs";import{UserActivityList as l}from"../../common/list/user-activity-list/user-activity-list.mjs";import{useMemo as u,useState as d}from"react";import{jsx as f,jsxs as p}from"react/jsx-runtime";import{toast as m}from"sonner";import{
|
|
2
|
+
"use client";import{Button as e}from"../../ui/button.mjs";import{useUserStore as t}from"../../../store/modules/user-store.mjs";import{gCommunityGetContentList as n,pCommunityAddContentToCollection as r}from"../../../service/generated/client.mjs";import{Box as i}from"../../ui/box.mjs";import{useDeleteRequest as a,useMutation as o,usePaginated as s}from"../../../hooks/query/use-query.mjs";import{HeaderNav as c}from"../../common/header-nav/client.mjs";import{UserActivityList as l}from"../../common/list/user-activity-list/user-activity-list.mjs";import{useMemo as u,useState as d}from"react";import{jsx as f,jsxs as p}from"react/jsx-runtime";import{toast as m}from"sonner";import{useRouter as h}from"next/navigation";import{useTranslations as g}from"next-intl";function _(e){return{type:e.type,content_id:e.content_id||``,author:{nick_name:e.author?.nickname||``,nickname:e.author?.nickname||``,avatar:e.author?.avatar_url||``},content:e.content||``,medias:e.medias||[],like_count:e.like_count||0,is_liked:e.interaction?.is_liked||!1,dislike_count:e.dislike_count||0,is_dislike:e.interaction?.is_dislike||!1,comment_count:e.comment_count||0}}function v({id:v}){let{userId:y}=t(),b=v,[x,S]=d(()=>new Set),C=a(),{mutateAsync:w,isPending:T}=o(async e=>await r({collection_id:b,content_id:e})),{data:E,isFetching:D,fetchNextPage:O,hasNextPage:k}=s({key:[`collection-add`,b,y],initialPageParam:1,async queryFn(e){if(!y)return{data:{list:[],total:0}};let t=await n({user_id:y,page:e,collection_id:b,page_size:10}),r=t.data?.data?.contents??[];return{data:{list:r,total:t.data?.data?.total??r.length,has_more:t.data?.data?.has_more?!0:void 0}}},getNextPageParam(e,t){let n=e?.data||{},r=n.list||[];if(typeof n.has_more==`boolean`)return n.has_more?t.length+1:void 0;if(!(r.length===0||n.total===0))return t.length+1}}),A=g(`components.pages.collectionAdd`),j=u(()=>E?.pages.flatMap(e=>((e?.data).list||[]).map(e=>_(e)))??[],[E]);function M(e){T||S(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}async function N(){if(T)return;if(!b){m.error(A(`page.collectionNotFound`));return}if(!y){m.error(A(`page.userNotFound`));return}let e=Array.from(x);if(e.length===0){m.error(A(`page.selectPostFirst`));return}let t=m.loading(A(`page.submitting`));try{await Promise.all(e.map(e=>w(e))),m.success(A(`page.submitSuccess`),{id:t}),S(new Set),C([`collection-add`,b,y]),C([`collection-detail`,b])}catch(e){console.error(`添加合集失败`,e),m.error(A(`page.submitFailed`),{id:t})}}let P=h(),F=x.size;return p(i,{className:`bg-bg2 !min-h-screen`,children:[f(c,{onBack:()=>P.back(),className:`!bg-bg2`,title:A(`page.title`),rightChild:p(e,{onClick:N,disabled:T||F===0,children:[A(`page.done`),`(`,F,`)`]})}),f(l,{list:j,loading:D,hasMore:k,loadMore:async()=>{O()},emptyText:A(`page.emptyPublish`),showGroupHeaders:!1,isEditMode:!0,selectedIds:x,onToggleSelection:M})]})}export{v as CollectionAddPage};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{Button as e}from"../../ui/button.mjs";import{useUserStore as t}from"../../../store/modules/user-store.mjs";import{gCommunityGetCollectionInfo as n,pCommunityCreateCollection as r,pCommunityUpdateCollection as i}from"../../../service/generated/client.mjs";import{useRouter as a}from"../../../utils/use-compatible-router.mjs";import{Box as o}from"../../ui/box.mjs";import{InputGroup as s,InputGroupAddon as c,InputGroupTextarea as l}from"../../ui/input-group.mjs";import{Field as u,FieldLabel as d}from"../../ui/field.mjs";import{useDeleteRequest as f,useRequest as p}from"../../../hooks/query/use-query.mjs";import{HeaderNav as m}from"../../common/header-nav/client.mjs";import{useEffect as h,useRef as g,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";function S({mode:S=`create`,collectionId:C}){let w=x(`components.pages.collectionCreate`),T=a(),{userId:E}=t(),D=f();g(null);let O=S===`edit`&&!!C,k=g(!1),[A,j]=_(!1),[M,N]=_(!1),[P,F]=_(``),[I,L]=_({title:``,description:``}),R=p([`collection-detail`,C],()=>n({collection_id:C}),{enabled:!!(O&&C)}).data?.data?.data?.collection;h(()=>{!O||k.current||!R||(L({title:R.title??``,description:R.description??``}),F(R.cover_image??``),k.current=!0)},[R,O]);function z(e,t){L(n=>({...n,[e]:t}))}async function B(){if(A)return;let e=I.title.trim(),t=I.description.trim();if(!e){b.error(w(`form.titleRequired`));return}if(O&&!C){b.error(w(`form.collectionNotFound`));return}try{j(!0);let n=b.loading(w(O?`form.saving`:`form.creating`)),a=O?await i({collection_id:C,title:e,description:t,cover_image:P}):await r({title:e,description:t,cover_image:P});if(a.code===0){b.success(w(O?`form.saveSuccess`:`form.createSuccess`),{id:n}),E&&D([`user-profile`,`mine`,E,`user-collection-created`,E]),O&&C&&D([`collection-detail`,C]),T.back();return}b.error(a.message||w(O?`form.saveFailed`:`form.createFailed`),{id:n})}catch(e){console.error(O?`编辑合集失败`:`创建合集失败`,e),b.error(w(O?`form.saveFailed`:`form.createFailed`))}finally{j(!1)}}return y(o,{className:`min-h-screen !bg-bg2`,children:[v(m,{title:w(O?`form.editTitle`:`form.createTitle`),className:`!bg-bg2`,rightChild:v(e,{onClick:B,disabled:A||M,children:w(A?O?`form.saving`:`form.creating`:O?`form.save`:`form.create`)})}),y(o,{className:`pb-3`,children:[y(u,{className:`!bg-bg2 px-3 border-none`,children:[v(d,{required:!0,children:w(`form.label`)}),y(s,{children:[v(l,{className:`!bg-bg1 p-2.5`,maxLength:50,placeholder:w(`form.titlePlaceholder`),value:I.title,onChange:e=>z(`title`,e.target.value)}),v(c,{className:`!bg-bg1`,align:`block-end`,children:v(`div`,{className:`text-right w-full`,children:y(`span`,{className:`text-xs`,children:[I.title.length,`/50`]})})})]})]}),y(u,{className:`border-none px-3 bg-bg2! `,children:[v(d,{children:w(`form.descriptionLabel`)}),y(s,{children:[v(l,{className:`!bg-bg1 p-2.5`,maxLength:100,placeholder:w(`form.descriptionPlaceholder`),value:I.description,onChange:e=>z(`description`,e.target.value)}),v(c,{className:`!bg-bg1`,align:`block-end`,children:v(`div`,{className:`text-right w-full`,children:y(`span`,{className:`text-xs`,children:[I.description.length,`/100`]})})})]})]})]})]})}export{S as CollectionCreateForm};
|
|
2
|
+
"use client";import{Button as e}from"../../ui/button.mjs";import{useUserStore as t}from"../../../store/modules/user-store.mjs";import{gCommunityGetCollectionInfo as n,pCommunityCreateCollection as r,pCommunityUpdateCollection as i}from"../../../service/generated/client.mjs";import{useRouter as a}from"../../../utils/use-compatible-router.mjs";import{Box as o}from"../../ui/box.mjs";import{InputGroup as s,InputGroupAddon as c,InputGroupTextarea as l}from"../../ui/input-group.mjs";import{Field as u,FieldLabel as d}from"../../ui/field.mjs";import{useDeleteRequest as f,useRequest as p}from"../../../hooks/query/use-query.mjs";import{HeaderNav as m}from"../../common/header-nav/client.mjs";import{useEffect as h,useRef as g,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";function S({mode:S=`create`,collectionId:C}){let w=x(`components.pages.collectionCreate`),T=a(),{userId:E}=t(),D=f();g(null);let O=S===`edit`&&!!C,k=g(!1),[A,j]=_(!1),[M,N]=_(!1),[P,F]=_(``),[I,L]=_({title:``,description:``}),R=p([`collection-detail`,C],()=>n({collection_id:C}),{enabled:!!(O&&C)}).data?.data?.data?.collection;h(()=>{!O||k.current||!R||(L({title:R.title??``,description:R.description??``}),F(R.cover_image??``),k.current=!0)},[R,O]);function z(e,t){L(n=>({...n,[e]:t}))}async function B(){if(A)return;let e=I.title.trim(),t=I.description.trim();if(!e){b.error(w(`form.titleRequired`));return}if(O&&!C){b.error(w(`form.collectionNotFound`));return}try{j(!0);let n=b.loading(w(O?`form.saving`:`form.creating`)),a=O?await i({collection_id:C,title:e,description:t,cover_image:P}):await r({title:e,description:t,cover_image:P});if(a.code===0){b.success(w(O?`form.saveSuccess`:`form.createSuccess`),{id:n}),E&&D([`user-profile`,`mine`,E,`user-collection-created`,E]),O&&C&&D([`collection-detail`,C]),T.back();return}b.error(a.message||w(O?`form.saveFailed`:`form.createFailed`),{id:n})}catch(e){console.error(O?`编辑合集失败`:`创建合集失败`,e),b.error(w(O?`form.saveFailed`:`form.createFailed`))}finally{j(!1)}}return y(o,{className:`min-h-screen !bg-bg2`,children:[v(m,{title:w(O?`form.editTitle`:`form.createTitle`),onBack:()=>T.back(),className:`!bg-bg2`,rightChild:v(e,{onClick:B,disabled:A||M,children:w(A?O?`form.saving`:`form.creating`:O?`form.save`:`form.create`)})}),y(o,{className:`pb-3`,children:[y(u,{className:`!bg-bg2 px-3 border-none`,children:[v(d,{required:!0,children:w(`form.label`)}),y(s,{children:[v(l,{className:`!bg-bg1 p-2.5`,maxLength:50,placeholder:w(`form.titlePlaceholder`),value:I.title,onChange:e=>z(`title`,e.target.value)}),v(c,{className:`!bg-bg1`,align:`block-end`,children:v(`div`,{className:`text-right w-full`,children:y(`span`,{className:`text-xs`,children:[I.title.length,`/50`]})})})]})]}),y(u,{className:`border-none px-3 bg-bg2! `,children:[v(d,{children:w(`form.descriptionLabel`)}),y(s,{children:[v(l,{className:`!bg-bg1 p-2.5`,maxLength:100,placeholder:w(`form.descriptionPlaceholder`),value:I.description,onChange:e=>z(`description`,e.target.value)}),v(c,{className:`!bg-bg1`,align:`block-end`,children:v(`div`,{className:`text-right w-full`,children:y(`span`,{className:`text-xs`,children:[I.description.length,`/100`]})})})]})]})]})]})}export{S as CollectionCreateForm};
|
|
@@ -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{gCommunityGetCollectionInfo as n,gUserViewUserInfo as r,pCommunityDeleteCollection as i,pCommunityRemoveContentFromCollection as a,pCommunitySubscribeCollection as o,pInteractionBatchDeleteCollects as s}from"../../../service/generated/client.mjs";import{useRouter as ee}from"../../../utils/use-compatible-router.mjs";import{Box as c}from"../../ui/box.mjs";import{Checkbox as te}from"../../ui/checkbox.mjs";import{Drawer as ne,DrawerContent as re,DrawerDescription as ie,DrawerTitle as ae}from"../../ui/drawer.mjs";import{List as oe}from"../../ui/list.mjs";import{Text as l}from"../../ui/text.mjs";import{useLoginModalStore as se}from"../../../store/modules/login-modal-store.mjs";import{useDeleteRequest as ce,useMutation as u,useRequest as d,useUpdateRequest as le}from"../../../hooks/query/use-query.mjs";import{ShareDrawer as f}from"../../common/share-popup/share-drawer.mjs";import{SharePlatformEnum as p}from"../../../types/share.mjs";import m from"../../../utils/share-manager.mjs";import{DeleteConfirmDialog as ue}from"../../common/delete-confirm-dialog/delete-confirm-dialog.mjs";import{HeaderNav as de}from"../../common/header-nav/client.mjs";import{MoreIcon as fe}from"../../common/icons/more.mjs";import{CollectionDetailCard as pe}from"./_components/collection-detail-card.mjs";import{useEffect as me,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{useSearchParams as b}from"next/navigation";import{useTranslations as he}from"next-intl";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 S(e){let t=e.detail.info?.video_duration;if(typeof t==`number`&&Number.isFinite(t)&&t>0)return Math.floor(t);let n=e.medias?.find(e=>{let t=e?.video_duration;return typeof t==`number`&&Number.isFinite(t)&&t>0})?.video_duration;return typeof n==`number`&&Number.isFinite(n)&&n>0?Math.floor(n):0}function C(e){let t=e.detail.info?.play_count;if(typeof t==`number`&&Number.isFinite(t))return Math.max(0,Math.floor(t));let n=e.detail.view_count||e.viewCount;return typeof n==`number`&&Number.isFinite(n)?Math.max(0,Math.floor(n)):0}function ge(e){let t=e.detail,n=t.info,r=String(n?.cover_image||t.cover_image||x(e)||``),i=String(n?.text||n?.title||t.title||t.content||``),a=t.author_score??0,o=Array.isArray(t.tags)?t.tags:[];return{id:e.content_id?String(e.content_id):String(e.id),title:i,type:typeof e.type==`number`?e.type:0,coverImage:r,score:a,collectedAt:t.create_time==null?void 0:String(t.create_time),tags:o,duration:S(e),viewCount:C(e),publishTime:String(t.create_time??t.update_time??``),is_more_link:e.is_more_link??n?.is_more_link??!1,authorName:``}}function w({id:x}){let S=he(`components.pages.collectionDetail`),C=ee(),w=b(),{userId:T,isLogin:E}=t(),{open:D}=se(),O=ce();le();let k=d([`collection-detail`,x],()=>n({collection_id:x})),A=k.data?.data?.data?.collection?.user_id,j=!!(A&&T&&String(A)===String(T)),_e=d([`user-info`,A],()=>r({target_user_id:A,user_id:A})),[ve,M]=g(!1),[N,P]=g(!1),[F,I]=g(!1),[L,R]=g(!1),[z,B]=g(!1),[V,H]=g(()=>new Set),[U,W]=g(null);me(()=>{!N&&L&&(I(!0),R(!1))},[N,L]);let G=k.data?.data?.data?.collection,K=G?.contents,q=h(()=>K?K.map(e=>({content_id:e.content_id,is_more_link:e.is_more_link,id:Number(e.content_id),detail:e,type:Number(e.source_type??0),medias:e.medias,cover_image:e.cover_image,viewCount:e.view_count})):[],[K]).map(ge),J=h(()=>new Set(q.map(e=>e.id)),[q]),Y=J.size>0&&V.size===J.size;G?.cover_image,G?.content_count,G?.is_subscribe;let{mutateAsync:ye,isPending:be}=u(async e=>await o({collection_id:x,subscribe:e})),{mutateAsync:xe,isPending:Se}=u(async e=>await a({collection_id:x,content_id:e})),{mutateAsync:Ce,isPending:X}=u(async e=>await i({collection_id:e})),{mutateAsync:we,isPending:Z}=u(async e=>await s({app_id:0,user_id:T,folder_id:x,content_type:1,content_ids:e})),Q=_e.data?.data;Q?.avatar,Q?.nick_name;let Te=j&&G?.is_default===!1;function Ee(e){W({kind:`content`,id:e.id,type:e.type,title:e.title,isCollected:!0}),M(!0)}function De(){if(j){P(!0);return}W({kind:`collection`,id:x}),M(!0)}function Oe(){if(!E||!T){y.error(S(`detail.pleaseLogin`)),D();return}if(!j){y.error(S(`detail.operationFailed`));return}P(!1),H(new Set),B(!0)}function ke(){H(new Set),B(!1)}function Ae(e){H(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}function je(){if(Y){H(new Set);return}H(new Set(J))}async function Me(){if(!(V.size===0||Z)){if(!E||!T){y.error(S(`detail.pleaseLogin`)),D();return}try{let e=await we(Array.from(V));if(e.code===0){y.success(S(`detail.uncollectSuccess`)),O([`collection-detail`,x]),O([`user-profile`,`mine`]),O([`user-profile`,`profile`,A]),H(new Set),B(!1);return}y.error(e.message||S(`detail.uncollectFailed`))}catch(e){console.error(`批量取消收藏失败`,e),y.error(S(`detail.operationFailed`))}}}function Ne(e){if(typeof window>`u`)return``;if(e.kind===`collection`)return`${window.location.origin}/collection/${e.id}`;let t=e.title?encodeURIComponent(e.title):`detail`,n=e.type===1?`/video/${e.id}/${t}`:`/post/${e.id}`;return`${window.location.origin}${n}`}function $(e){if(!U)return;let t=Ne(U);t&&m.showSharePopup({type:e,data:{id:U.id},copyUrl:t})}function Pe(){$(p.WECHAT)}function Fe(){$(p.QQ)}function Ie(){$(p.WECHAT_MOMENTS)}function Le(){if(!Se){if(!E||!T){y.error(S(`detail.pleaseLogin`)),D();return}!U||U.kind!==`content`||xe(U.id).then(e=>{if(e.code===0){y.success(S(`detail.uncollectSuccess`)),O([`collection-detail`,x]),W(e=>e&&{...e,isCollected:!1});return}y.error(e.message||S(`detail.uncollectFailed`))}).catch(e=>{console.error(`取消收藏失败`,e),y.error(S(`detail.operationFailed`))})}}function Re(){let e=new URLSearchParams(w.toString());e.set(`id`,x),e.set(`type`,`edit`),C.push(`/collection/create?${e.toString()}`),P(!1),M(!1)}function ze(){if(!X){if(!E||!T){y.error(S(`detail.pleaseLogin`)),D();return}if(!Te){y.error(S(`detail.defaultCollectionDeleteNotSupported`));return}R(!0),P(!1)}}async function Be(){if(!X)try{let e=await Ce(x);if(e.code===0){y.success(S(`detail.deleteSuccess`)),O([`collection-detail`,x]),O([`user-profile`,`mine`]),O([`user-profile`,`profile`,A]),I(!1),P(!1),M(!1),C.back();return}y.error(e.message||S(`detail.deleteFailed`))}catch(e){console.error(`删除合集失败`,e),y.error(S(`detail.operationFailed`))}}return v(c,{className:`flex flex-col bg-bg1 min-h-screen ${z?`pb-28`:`pb-6`}`,children:[_(de,{title:G?.title??``,rightChild:j?z?_(`button`,{type:`button`,onClick:ke,className:`px-2 py-1 text-sm text-text1`,children:S(`detail.done`)}):_(`button`,{type:`button`,onClick:De,className:`p-2`,children:_(fe,{})}):void 0}),_(c,{className:`px-4 flex items-start gap-4`,children:v(c,{className:`flex-1 flex flex-col gap-2`,children:[_(c,{className:`flex items-center justify-between`}),_(c,{className:`text-text2 text-sm break-all text-ellipsis line-clamp-1`,children:G?.description})]})}),_(c,{className:`px-4 ${z?`pb-20`:``}`,children:_(oe,{loading:k.isLoading,hasMore:!1,emptyText:S(`detail.emptyContent`),className:`divide-y divide-text1/5`,children:q.map(e=>_(pe,{...e,onOpenShare:Ee,isEditMode:z,isSelected:V.has(e.id),onToggleSelection:Ae},e.id))})}),z&&v(c,{className:`fixed bottom-0 left-0 right-0 z-10 flex items-center justify-between border-t border-text1/10 bg-bg1 px-4 py-3`,children:[v(c,{className:`flex items-center gap-2`,children:[_(te,{checked:Y,onCheckedChange:je}),_(l,{className:`text-sm text-text1`,children:S(`detail.selectAll`)})]}),_(e,{className:`rounded-full py-2.5 h-auto px-6.5`,variant:V.size>0?`default`:`outline`,disabled:V.size===0||Z,onClick:Me,children:S(Z?`detail.deleting`:`detail.delete`)})]}),v(ne,{open:N,onOpenChange:P,children:[_(ae,{className:`hidden`,children:S(`detail.collectionManageTitle`)}),_(ie,{className:`hidden`,children:S(`detail.collectionManageTitle`)}),v(re,{className:`z-[2000]`,children:[v(c,{className:`px-4 py-5`,children:[_(l,{className:`text-base font-bold text-text1 text-center `,children:S(`detail.collectionManageTitle`)}),v(c,{className:`mt-4 border-t border-text1/10`,children:[_(`button`,{className:`w-full text-left py-4 border-b border-text1/10`,onClick:Re,children:_(l,{className:`text-text1`,children:S(`detail.editCollection`)})}),_(`button`,{className:`w-full text-left py-4 border-b border-text1/10`,onClick:Oe,children:_(l,{className:`text-text1`,children:S(`detail.manageCollection`)})}),_(`button`,{className:`w-full text-left py-4 ${X?`opacity-60 cursor-not-allowed`:``}`,onClick:ze,disabled:X,children:_(l,{className:`text-destructive`,children:S(X?`detail.deleting`:`detail.deleteCollection`)})})]})]}),_(e,{className:`w-full h-auto py-4 text-lg text-text1`,size:`lg`,onClick:()=>P(!1),variant:`secondary`,children:S(`detail.cancel`)})]})]}),_(f,{isShowCollect:U?.kind===`content`&&j&&E,isCollected:U?.isCollected,open:ve,onOpenChange:M,onShareWeChat:Pe,onShareQQ:Fe,onShareMoments:Ie,onUncollect:Le}),_(ue,{open:F,onOpenChange:I,onConfirm:Be,title:S(`detail.deleteCollection`),isConfirming:X})]})}export{w as CollectionDetail};
|
|
2
|
+
"use client";import{Button as e}from"../../ui/button.mjs";import{useUserStore as t}from"../../../store/modules/user-store.mjs";import{gCommunityGetCollectionInfo as n,gUserViewUserInfo as r,pCommunityDeleteCollection as i,pCommunityRemoveContentFromCollection as a,pCommunitySubscribeCollection as o,pInteractionBatchDeleteCollects as s}from"../../../service/generated/client.mjs";import{useRouter as ee}from"../../../utils/use-compatible-router.mjs";import{Box as c}from"../../ui/box.mjs";import{Checkbox as te}from"../../ui/checkbox.mjs";import{Drawer as ne,DrawerContent as re,DrawerDescription as ie,DrawerTitle as ae}from"../../ui/drawer.mjs";import{List as oe}from"../../ui/list.mjs";import{Text as l}from"../../ui/text.mjs";import{useLoginModalStore as se}from"../../../store/modules/login-modal-store.mjs";import{useDeleteRequest as ce,useMutation as u,useRequest as d,useUpdateRequest as le}from"../../../hooks/query/use-query.mjs";import{ShareDrawer as f}from"../../common/share-popup/share-drawer.mjs";import{SharePlatformEnum as p}from"../../../types/share.mjs";import m from"../../../utils/share-manager.mjs";import{DeleteConfirmDialog as ue}from"../../common/delete-confirm-dialog/delete-confirm-dialog.mjs";import{HeaderNav as de}from"../../common/header-nav/client.mjs";import{MoreIcon as fe}from"../../common/icons/more.mjs";import{CollectionDetailCard as pe}from"./_components/collection-detail-card.mjs";import{useEffect as me,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{useSearchParams as b}from"next/navigation";import{useTranslations as he}from"next-intl";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 S(e){let t=e.detail.info?.video_duration;if(typeof t==`number`&&Number.isFinite(t)&&t>0)return Math.floor(t);let n=e.medias?.find(e=>{let t=e?.video_duration;return typeof t==`number`&&Number.isFinite(t)&&t>0})?.video_duration;return typeof n==`number`&&Number.isFinite(n)&&n>0?Math.floor(n):0}function C(e){let t=e.detail.info?.play_count;if(typeof t==`number`&&Number.isFinite(t))return Math.max(0,Math.floor(t));let n=e.detail.view_count||e.viewCount;return typeof n==`number`&&Number.isFinite(n)?Math.max(0,Math.floor(n)):0}function ge(e){let t=e.detail,n=t.info,r=String(n?.cover_image||t.cover_image||x(e)||``),i=String(n?.text||n?.title||t.title||t.content||``),a=t.author_score??0,o=Array.isArray(t.tags)?t.tags:[];return{id:e.content_id?String(e.content_id):String(e.id),title:i,type:typeof e.type==`number`?e.type:0,coverImage:r,score:a,collectedAt:t.create_time==null?void 0:String(t.create_time),tags:o,duration:S(e),viewCount:C(e),publishTime:String(t.create_time??t.update_time??``),is_more_link:e.is_more_link??n?.is_more_link??!1,authorName:``}}function w({id:x}){let S=he(`components.pages.collectionDetail`),C=ee(),w=b(),{userId:T,isLogin:E}=t(),{open:D}=se(),O=ce();le();let k=d([`collection-detail`,x],()=>n({collection_id:x})),A=k.data?.data?.data?.collection?.user_id,j=!!(A&&T&&String(A)===String(T)),_e=d([`user-info`,A],()=>r({target_user_id:A,user_id:A})),[ve,M]=g(!1),[N,P]=g(!1),[F,I]=g(!1),[L,R]=g(!1),[z,B]=g(!1),[V,H]=g(()=>new Set),[U,W]=g(null);me(()=>{!N&&L&&(I(!0),R(!1))},[N,L]);let G=k.data?.data?.data?.collection,K=G?.contents,q=h(()=>K?K.map(e=>({content_id:e.content_id,is_more_link:e.is_more_link,id:Number(e.content_id),detail:e,type:Number(e.source_type??0),medias:e.medias,cover_image:e.cover_image,viewCount:e.view_count})):[],[K]).map(ge),J=h(()=>new Set(q.map(e=>e.id)),[q]),Y=J.size>0&&V.size===J.size;G?.cover_image,G?.content_count,G?.is_subscribe;let{mutateAsync:ye,isPending:be}=u(async e=>await o({collection_id:x,subscribe:e})),{mutateAsync:xe,isPending:Se}=u(async e=>await a({collection_id:x,content_id:e})),{mutateAsync:Ce,isPending:X}=u(async e=>await i({collection_id:e})),{mutateAsync:we,isPending:Z}=u(async e=>await s({app_id:0,user_id:T,folder_id:x,content_type:1,content_ids:e})),Q=_e.data?.data;Q?.avatar,Q?.nick_name;let Te=j&&G?.is_default===!1;function Ee(e){W({kind:`content`,id:e.id,type:e.type,title:e.title,isCollected:!0}),M(!0)}function De(){if(j){P(!0);return}W({kind:`collection`,id:x}),M(!0)}function Oe(){if(!E||!T){y.error(S(`detail.pleaseLogin`)),D();return}if(!j){y.error(S(`detail.operationFailed`));return}P(!1),H(new Set),B(!0)}function ke(){H(new Set),B(!1)}function Ae(e){H(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}function je(){if(Y){H(new Set);return}H(new Set(J))}async function Me(){if(!(V.size===0||Z)){if(!E||!T){y.error(S(`detail.pleaseLogin`)),D();return}try{let e=await we(Array.from(V));if(e.code===0){y.success(S(`detail.uncollectSuccess`)),O([`collection-detail`,x]),O([`user-profile`,`mine`]),O([`user-profile`,`profile`,A]),H(new Set),B(!1);return}y.error(e.message||S(`detail.uncollectFailed`))}catch(e){console.error(`批量取消收藏失败`,e),y.error(S(`detail.operationFailed`))}}}function Ne(e){if(typeof window>`u`)return``;if(e.kind===`collection`)return`${window.location.origin}/collection/${e.id}`;let t=e.title?encodeURIComponent(e.title):`detail`,n=e.type===1?`/video/${e.id}/${t}`:`/post/${e.id}`;return`${window.location.origin}${n}`}function $(e){if(!U)return;let t=Ne(U);t&&m.showSharePopup({type:e,data:{id:U.id},copyUrl:t})}function Pe(){$(p.WECHAT)}function Fe(){$(p.QQ)}function Ie(){$(p.WECHAT_MOMENTS)}function Le(){if(!Se){if(!E||!T){y.error(S(`detail.pleaseLogin`)),D();return}!U||U.kind!==`content`||xe(U.id).then(e=>{if(e.code===0){y.success(S(`detail.uncollectSuccess`)),O([`collection-detail`,x]),W(e=>e&&{...e,isCollected:!1});return}y.error(e.message||S(`detail.uncollectFailed`))}).catch(e=>{console.error(`取消收藏失败`,e),y.error(S(`detail.operationFailed`))})}}function Re(){let e=new URLSearchParams(w.toString());e.set(`id`,x),e.set(`type`,`edit`),C.push(`/collection/create?${e.toString()}`),P(!1),M(!1)}function ze(){if(!X){if(!E||!T){y.error(S(`detail.pleaseLogin`)),D();return}if(!Te){y.error(S(`detail.defaultCollectionDeleteNotSupported`));return}R(!0),P(!1)}}async function Be(){if(!X)try{let e=await Ce(x);if(e.code===0){y.success(S(`detail.deleteSuccess`)),O([`collection-detail`,x]),O([`user-profile`,`mine`]),O([`user-profile`,`profile`,A]),I(!1),P(!1),M(!1),C.back();return}y.error(e.message||S(`detail.deleteFailed`))}catch(e){console.error(`删除合集失败`,e),y.error(S(`detail.operationFailed`))}}return v(c,{className:`flex flex-col bg-bg1 min-h-screen ${z?`pb-28`:`pb-6`}`,children:[_(de,{title:G?.title??``,onBack:()=>C.back(),rightChild:j?z?_(`button`,{type:`button`,onClick:ke,className:`px-2 py-1 text-sm text-text1`,children:S(`detail.done`)}):_(`button`,{type:`button`,onClick:De,className:`p-2`,children:_(fe,{})}):void 0}),_(c,{className:`px-4 flex items-start gap-4`,children:v(c,{className:`flex-1 flex flex-col gap-2`,children:[_(c,{className:`flex items-center justify-between`}),_(c,{className:`text-text2 text-sm break-all text-ellipsis line-clamp-1`,children:G?.description})]})}),_(c,{className:`px-4 ${z?`pb-20`:``}`,children:_(oe,{loading:k.isLoading,hasMore:!1,emptyText:S(`detail.emptyContent`),className:`divide-y divide-text1/5`,children:q.map(e=>_(pe,{...e,onOpenShare:Ee,isEditMode:z,isSelected:V.has(e.id),onToggleSelection:Ae},e.id))})}),z&&v(c,{className:`fixed bottom-0 left-0 right-0 z-10 flex items-center justify-between border-t border-text1/10 bg-bg1 px-4 py-3`,children:[v(c,{className:`flex items-center gap-2`,children:[_(te,{checked:Y,onCheckedChange:je}),_(l,{className:`text-sm text-text1`,children:S(`detail.selectAll`)})]}),_(e,{className:`rounded-full py-2.5 h-auto px-6.5`,variant:V.size>0?`default`:`outline`,disabled:V.size===0||Z,onClick:Me,children:S(Z?`detail.deleting`:`detail.delete`)})]}),v(ne,{open:N,onOpenChange:P,children:[_(ae,{className:`hidden`,children:S(`detail.collectionManageTitle`)}),_(ie,{className:`hidden`,children:S(`detail.collectionManageTitle`)}),v(re,{className:`z-[2000]`,children:[v(c,{className:`px-4 py-5`,children:[_(l,{className:`text-base font-bold text-text1 text-center `,children:S(`detail.collectionManageTitle`)}),v(c,{className:`mt-4 border-t border-text1/10`,children:[_(`button`,{className:`w-full text-left py-4 border-b border-text1/10`,onClick:Re,children:_(l,{className:`text-text1`,children:S(`detail.editCollection`)})}),_(`button`,{className:`w-full text-left py-4 border-b border-text1/10`,onClick:Oe,children:_(l,{className:`text-text1`,children:S(`detail.manageCollection`)})}),_(`button`,{className:`w-full text-left py-4 ${X?`opacity-60 cursor-not-allowed`:``}`,onClick:ze,disabled:X,children:_(l,{className:`text-destructive`,children:S(X?`detail.deleting`:`detail.deleteCollection`)})})]})]}),_(e,{className:`w-full h-auto py-4 text-lg text-text1`,size:`lg`,onClick:()=>P(!1),variant:`secondary`,children:S(`detail.cancel`)})]})]}),_(f,{isShowCollect:U?.kind===`content`&&j&&E,isCollected:U?.isCollected,open:ve,onOpenChange:M,onShareWeChat:Pe,onShareQQ:Fe,onShareMoments:Ie,onUncollect:Le}),_(ue,{open:F,onOpenChange:I,onConfirm:Be,title:S(`detail.deleteCollection`),isConfirming:X})]})}export{w as CollectionDetail};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{Button as e}from"../../ui/button.mjs";import{getCookie as t}from"../../../utils/common.mjs";import{pUserSendEmailCode as n,pUserSendResetPasswordEmailCode as r,pUserVerifyForgetEmailCode as i,pUserVerifyResetPasswordEmailCode as a}from"../../../service/generated/client.mjs";import{
|
|
2
|
+
"use client";import{Button as e}from"../../ui/button.mjs";import{getCookie as t}from"../../../utils/common.mjs";import{pUserSendEmailCode as n,pUserSendResetPasswordEmailCode as r,pUserVerifyForgetEmailCode as i,pUserVerifyResetPasswordEmailCode as a}from"../../../service/generated/client.mjs";import{pUserRegisterByVerifyEmailCodeCompat as o}from"../../../service/register-by-verify-email-code.mjs";import{Box as s}from"../../ui/box.mjs";import{Text as c}from"../../ui/text.mjs";import{useLoginModalStore as l}from"../../../store/modules/login-modal-store.mjs";import{useDeleteRequest as u}from"../../../hooks/query/use-query.mjs";import{useSetAuthFields as d,useUserId as f}from"../../../hooks/use-auth.mjs";import{LeftArrowIcon as p}from"../../../assets/icons/left-arrow-icon.mjs";import{useCallback as m,useEffect as h,useMemo as g,useRef as _,useState as v}from"react";import{jsx as y,jsxs as b}from"react/jsx-runtime";import{toast as x}from"sonner";import{useTranslations as S}from"next-intl";function C(e){let[t,n]=e.split(`@`);return!t||!n?e:`${t.slice(0,3)}***${t.length>3?t.slice(-1):``}@${n}`}function w(w){let T=S(`components.pages.login`),{email:E,onClose:D,onPassword:O}=w,{verifyStep:k,resolveLogin:A}=l(),[j,M]=v([,,,,,,].fill(``)),[N,P]=v(0),[F,I]=v(!1),[L,R]=v(60),[z,B]=v(!1),[V,H]=v(``),U=_(null),W=f(),G=d(),K=u(),q=g(()=>C(E),[E]),J=m(async()=>{if(k===`reset-password`)return await a({user_id:W,email_code:j.join(``)});if(k===`forgot-password`)return await i({email:E,email_code:j.join(``)});if(k===`register-verify`){let e=await t(`guestUserId`);return await o({email:E,email_code:j.join(``),user_id:e})}throw Error(T(`verify.invalidCode`))},[k,j,W,E,T]),Y=g(()=>j.every(e=>e!==``)&&!F,[j,F]);h(()=>{if(L<=0)return;let e=setInterval(()=>{R(e=>e-1)},1e3);return()=>clearInterval(e)},[L]),h(()=>{U.current?.focus()},[]);let X=m(e=>{let t=e.target.value.replace(/\D/g,``);if(t.length===0)return;let n=[...j],r=t.split(``),i=N;for(let e of r)i<6&&(n[i]=e,i++);M(n),P(Math.min(i,5)),H(``)},[j,N]),Z=m(e=>{if(e.key===`Backspace`){e.preventDefault();let t=[...j];j[N]?t[N]=``:N>0&&(t[N-1]=``,P(N-1)),M(t),H(``)}else e.key===`ArrowLeft`&&N>0?P(N-1):e.key===`ArrowRight`&&N<5&&P(N+1)},[j,N]),Q=m(e=>{P(e),U.current?.focus()},[]);async function $(){if(!(L>0||z))try{B(!0),k===`reset-password`?await r({user_id:W}):await n({email:E}),R(60),H(``)}finally{B(!1)}}async function ee(){if(Y)try{I(!0);let e=await J();if(k===`register-verify`){let t=e?.data;if(t?.user_id){G({token:t.token??``,expireTime:t.expire_time??0,userId:t.user_id}),x.success(T(`index.loginSuccess`)),K([`user-profile`,`mine`]),A(!0);return}}O?.(E)}catch(e){H(e.message??T(`verify.invalidCode`))}finally{I(!1)}}return b(s,{className:`min-h-screen w-full h-full bg-bg1 text-text1 flex flex-col`,children:[b(s,{className:`flex justify-between items-center h-[60px] px-[16px]`,children:[y(e,{type:`button`,onClick:D,"aria-label":T(`verify.back`),className:`cursor-pointer bg-transparent !p-0 !px-0 !py-0`,children:y(p,{className:`w-[16px] h-[16px] text-text1/80`,"aria-hidden":`true`,focusable:`false`})}),y(c,{className:`text-[14px] text-text2`})]}),b(s,{className:`px-[24px] flex flex-col mt-[15px]`,children:[b(s,{className:`flex flex-col`,children:[y(c,{className:`text-[24px] leading-[32px] font-bold`,children:T(`verify.title`)}),b(s,{className:`mt-[12px] flex items-center`,children:[b(c,{className:`text-[14px] leading-[14px] text-text1/80`,children:[T(`verify.sentTo`),` `,q]}),y(e,{type:`button`,onClick:$,disabled:L>0||z,className:`ml-[8px] rounded-[19px] !px-[8px] !py-[8px] text-[12px] leading-[12px] cursor-pointer bg-line1 text-text1/80 disabled:cursor-not-allowed`,children:L>0?`${T(`verify.resend`)} (${L}s)`:T(`verify.resend`)})]})]}),b(`form`,{className:`mt-[38px]`,onSubmit:e=>{e.preventDefault(),ee()},children:[b(s,{className:`h-14 sm:h-16 md:h-20 relative`,children:[y(`input`,{ref:U,type:`text`,inputMode:`numeric`,pattern:`[0-9]*`,value:``,onChange:X,onKeyDown:Z,className:`absolute opacity-0 pointer-events-none w-full h-full border-none outline-none bg-transparent text-base`,autoComplete:`one-time-code`}),y(s,{className:`w-full flex justify-between items-center`,children:j.map((e,t)=>y(s,{onClick:()=>Q(t),className:`
|
|
3
3
|
w-14 h-14 sm:w-16 sm:h-16 md:w-20 md:h-20 rounded-xl border-2 flex items-center justify-center cursor-pointer transition-all duration-200
|
|
4
4
|
${t===N?`border-theme3 bg-theme3`:`border-transparent bg-bg2`}
|
|
5
5
|
`,children:y(c,{className:`select-none font-semibold text-2xl sm:text-3xl leading-none text-text1`,children:e})},t))})]}),y(s,{className:`h-[22px] mt-[16px] mb-[22px] ml-[12px] text-[14px] text-theme5`,children:V}),y(e,{type:`submit`,disabled:!Y,className:`w-full h-[60px] !rounded-[30px] !text-[18px] font-bold leading-[26px] bg-theme6 disabled:bg-theme6/40 disabled:text-text3 active:opacity-90 !px-0 !py-0`,children:T(F?`verify.verifying`:`verify.nextStep`)})]})]})]})}export{w as Verify};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{Button as e}from"../../ui/button.mjs";import{pContentGetNewstVideoList as t,
|
|
2
|
+
"use client";import{Button as e}from"../../ui/button.mjs";import{pContentGetNewstVideoList as t,pContentGetTopRatedVideoList as n}from"../../../service/generated/client.mjs";import{pContentGetNewstVideoListKey as r,pContentGetTopRatedVideoListKey as i}from"../../../service/generated/tanstack.mjs";import{useRouter as a}from"../../../utils/use-compatible-router.mjs";import{Box as o}from"../../ui/box.mjs";import{InfiniteScroll as s}from"../../ui/infinite-scroll.mjs";import{Text as c}from"../../ui/text.mjs";import{usePaginated as l}from"../../../hooks/query/use-query.mjs";import u from"../../../assets/icons/left_arrow.mjs";import{getNextVideoListPageParam as d,resolveNextCursor as f}from"./types.mjs";import{VideoListItemComponent as p}from"./video-list-item.mjs";import{useMemo as m,useState as h}from"react";import{jsx as g,jsxs as _}from"react/jsx-runtime";import v from"next/link";const y=[];function b({title:b=`列表页`,tags:x=y}){let S=a(),[C,w]=h(`hot`),T=m(()=>({page_size:10,tags:x.length?x:void 0}),[x]),{data:E,fetchNextPage:D,hasNextPage:O,isFetching:k,isFetchingNextPage:A}=l({key:m(()=>C===`hot`?i(T):r(T),[T,C]),queryFn:async e=>{let r={page_size:10,cursor:e||void 0,tags:x.length?x:void 0},i=(C===`hot`?await n(r):await t(r)).data;return{list:i?.videos??[],nextCursor:f(i)}},getNextPageParam:d,initialPageParam:``,options:{staleTime:0,refetchOnMount:`always`,refetchOnWindowFocus:!1,refetchOnReconnect:!1}}),j=m(()=>E?.pages?.flatMap(e=>e.list)??[],[E?.pages]);function M(){S.back()}let N=m(()=>j.map((e,t)=>{let n=e.id??e.mid??``;return g(v,{href:`/video/${n}/${e.name??``}`,children:g(p,{item:e})},n)}),[j]);return _(o,{as:`main`,className:`min-h-[100dvh] bg-bg1`,children:[_(o,{className:`fixed top-0 left-0 right-0 z-20 bg-bg1`,children:[_(o,{as:`header`,className:`flex items-center gap-2 px-4 py-3`,children:[g(u,{className:`w-[16px] h-[16px]`,onClick:M}),g(c,{as:`h1`,className:`flex-1 min-w-0 flex justify-center overflow-hidden text-[18px] pr-[16px]`,children:g(c,{className:`block max-w-full truncate`,children:b})})]}),_(o,{as:`nav`,className:`px-4 pb-2 flex gap-2`,children:[g(e,{type:`button`,onClick:()=>w(`hot`),className:`h-[30px] px-[12px] text-[14px] rounded-[50px] ${C===`hot`?`bg-theme5 text-text1`:`bg-transparent text-text2`}`,children:`最热`}),g(e,{type:`button`,onClick:()=>w(`latest`),className:`h-[30px] px-[12px] text-[14px] rounded-[50px] ${C===`latest`?`bg-theme5 text-text1`:`bg-transparent text-text2`}`,children:`最新`})]})]}),g(s,{loadMore:()=>D().then(()=>void 0),hasMore:O,threshold:300,className:`pt-[88px]`,children:g(o,{className:`grid grid-cols-2 gap-3 p-4`,children:N})})]})}export{b as default};
|
|
@@ -6,7 +6,7 @@ import * as class_variance_authority_types0 from "class-variance-authority/types
|
|
|
6
6
|
//#region components/ui/badge.d.ts
|
|
7
7
|
/** badgeVariants 工具定义。 */
|
|
8
8
|
declare const badgeVariants: (props?: ({
|
|
9
|
-
variant?: "link" | "default" | "
|
|
9
|
+
variant?: "link" | "default" | "destructive" | "secondary" | "outline" | "ghost" | null | undefined;
|
|
10
10
|
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
11
11
|
/** Badge 组件。 */
|
|
12
12
|
declare function Badge({
|
|
@@ -8,7 +8,7 @@ import * as class_variance_authority_types0 from "class-variance-authority/types
|
|
|
8
8
|
//#region components/ui/button-group.d.ts
|
|
9
9
|
/** buttonGroupVariants 工具定义。 */
|
|
10
10
|
declare const buttonGroupVariants: (props?: ({
|
|
11
|
-
orientation?: "
|
|
11
|
+
orientation?: "vertical" | "horizontal" | null | undefined;
|
|
12
12
|
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
13
13
|
/** ButtonGroupText 组件属性。 */
|
|
14
14
|
type ButtonGroupTextProps = useRender.ComponentProps<'div'>;
|
|
@@ -7,7 +7,7 @@ import * as class_variance_authority_types0 from "class-variance-authority/types
|
|
|
7
7
|
//#region components/ui/button.d.ts
|
|
8
8
|
/** buttonVariants 工具定义。 */
|
|
9
9
|
declare const buttonVariants: (props?: ({
|
|
10
|
-
variant?: "link" | "default" | "
|
|
10
|
+
variant?: "link" | "default" | "destructive" | "secondary" | "outline" | "ghost" | null | undefined;
|
|
11
11
|
size?: "default" | "icon" | "xs" | "sm" | "lg" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
12
12
|
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
13
13
|
/** Button 组件属性。 */
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region components/ui/dots-loading.d.ts
|
|
6
|
+
/** DotsLoading 组件属性。 */
|
|
7
|
+
interface DotsLoadingProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
8
|
+
/**
|
|
9
|
+
* 点的大小(px)。
|
|
10
|
+
* @default 6
|
|
11
|
+
*/
|
|
12
|
+
dotSize?: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* DotsLoading
|
|
16
|
+
*
|
|
17
|
+
* 三个点的 loading 动画,用于列表底部轻量提示。
|
|
18
|
+
*/
|
|
19
|
+
declare function DotsLoading({
|
|
20
|
+
className,
|
|
21
|
+
dotSize,
|
|
22
|
+
...rest
|
|
23
|
+
}: DotsLoadingProps): react_jsx_runtime0.JSX.Element;
|
|
24
|
+
//#endregion
|
|
25
|
+
export { DotsLoading };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
|
|
2
|
+
"use client";import{cn as e}from"../../utils/cn.mjs";import{jsx as t,jsxs as n}from"react/jsx-runtime";function r({className:r,dotSize:i=6,...a}){let o={width:i,height:i};return n(`div`,{className:e(`inline-flex items-center gap-2 text-text2`,r),role:`status`,"aria-label":`Loading`,...a,children:[t(`span`,{className:`inline-block rounded-full bg-current animate-bounce`,style:{...o,animationDelay:`0ms`}}),t(`span`,{className:`inline-block rounded-full bg-current animate-bounce`,style:{...o,animationDelay:`150ms`}}),t(`span`,{className:`inline-block rounded-full bg-current animate-bounce`,style:{...o,animationDelay:`300ms`}})]})}export{r as DotsLoading};
|
|
@@ -51,7 +51,7 @@ declare function FieldGroup({
|
|
|
51
51
|
}: FieldGroupProps): react_jsx_runtime0.JSX.Element;
|
|
52
52
|
/** fieldVariants 工具定义。 */
|
|
53
53
|
declare const fieldVariants: (props?: ({
|
|
54
|
-
orientation?: "
|
|
54
|
+
orientation?: "vertical" | "horizontal" | "responsive" | null | undefined;
|
|
55
55
|
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
56
56
|
/** Field 组件。 */
|
|
57
57
|
declare function Field({
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
|
|
2
|
+
import { DependencyList, RefObject } from "react";
|
|
3
|
+
|
|
4
|
+
//#region hooks/use-first-row-height.d.ts
|
|
5
|
+
interface GridFirstRowHeightOptions {
|
|
6
|
+
enabled?: boolean;
|
|
7
|
+
containerRef: RefObject<HTMLElement | null>;
|
|
8
|
+
/** 第一行每个 item 的 wrapper ref(索引从 0 开始)。 */
|
|
9
|
+
firstRowItemRef: RefObject<Array<HTMLElement | null>>;
|
|
10
|
+
/** 列数(用于确定第一行 item 数量)。 */
|
|
11
|
+
columns: number;
|
|
12
|
+
/** 列表总数(用于避免 columns > itemsCount 时越界)。 */
|
|
13
|
+
itemsCount: number;
|
|
14
|
+
deps?: DependencyList;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* useGridFirstRowHeight
|
|
18
|
+
*
|
|
19
|
+
* 两列/多列宫格场景:计算“第 1 行”高度(取首行 item wrapper 的最大高度)。
|
|
20
|
+
*/
|
|
21
|
+
declare function useGridFirstRowHeight({
|
|
22
|
+
enabled,
|
|
23
|
+
containerRef,
|
|
24
|
+
firstRowItemRef,
|
|
25
|
+
columns,
|
|
26
|
+
itemsCount,
|
|
27
|
+
deps
|
|
28
|
+
}: GridFirstRowHeightOptions): number;
|
|
29
|
+
interface WaterfallFirstRowHeightOptions {
|
|
30
|
+
enabled?: boolean;
|
|
31
|
+
containerRef: RefObject<HTMLElement | null>;
|
|
32
|
+
/** 左右列首卡的 wrapper ref。 */
|
|
33
|
+
firstRowRef: RefObject<{
|
|
34
|
+
left: HTMLElement | null;
|
|
35
|
+
right: HTMLElement | null;
|
|
36
|
+
}>;
|
|
37
|
+
deps?: DependencyList;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* useWaterfallFirstRowHeight
|
|
41
|
+
*
|
|
42
|
+
* 瀑布流场景:计算“第 1 行”高度(取左右列首卡 wrapper 高度的最大值)。
|
|
43
|
+
*/
|
|
44
|
+
declare function useWaterfallFirstRowHeight({
|
|
45
|
+
enabled,
|
|
46
|
+
containerRef,
|
|
47
|
+
firstRowRef,
|
|
48
|
+
deps
|
|
49
|
+
}: WaterfallFirstRowHeightOptions): number;
|
|
50
|
+
interface SingleFirstRowHeightOptions {
|
|
51
|
+
enabled?: boolean;
|
|
52
|
+
containerRef: RefObject<HTMLElement | null>;
|
|
53
|
+
/** 单个首屏卡片 wrapper ref。 */
|
|
54
|
+
itemRef: RefObject<HTMLElement | null>;
|
|
55
|
+
deps?: DependencyList;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* useSingleFirstRowHeight
|
|
59
|
+
*
|
|
60
|
+
* 单卡场景:计算首卡高度(用于 overlay 定位)。
|
|
61
|
+
*/
|
|
62
|
+
declare function useSingleFirstRowHeight({
|
|
63
|
+
enabled,
|
|
64
|
+
containerRef,
|
|
65
|
+
itemRef,
|
|
66
|
+
deps
|
|
67
|
+
}: SingleFirstRowHeightOptions): number;
|
|
68
|
+
//#endregion
|
|
69
|
+
export { useGridFirstRowHeight, useSingleFirstRowHeight, useWaterfallFirstRowHeight };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
|
|
2
|
+
import{useEffect as e,useLayoutEffect as t,useRef as n,useState as r}from"react";function i({enabled:i=!0,containerRef:a,measure:o,deps:s=[]}){let[c,l]=r(0),u=n(null),d=()=>{if(!i){l(0);return}u.current!=null&&cancelAnimationFrame(u.current),u.current=requestAnimationFrame(()=>{u.current=null;let e=o();l(t=>t===e?t:e)})};return t(()=>{d()},[i,...s]),e(()=>{if(!i)return;let e=a.current;if(!e)return;let t=new ResizeObserver(()=>{d()});return t.observe(e),()=>{t.disconnect()}},[i]),e(()=>()=>{u.current!=null&&cancelAnimationFrame(u.current)},[]),c}function a({enabled:e=!0,containerRef:t,firstRowItemRef:n,columns:r,itemsCount:a,deps:o=[]}){return i({enabled:e,containerRef:t,measure:()=>{let e=Math.min(a,Math.max(0,r)),t=0;for(let r=0;r<e;r+=1){let e=n.current[r]?.getBoundingClientRect().height??0;e>t&&(t=e)}return t},deps:[r,a,...o]})}function o({enabled:e=!0,containerRef:t,firstRowRef:n,deps:r=[]}){return i({enabled:e,containerRef:t,measure:()=>{let e=n.current.left?.getBoundingClientRect().height??0,t=n.current.right?.getBoundingClientRect().height??0;return Math.max(e,t)},deps:r})}function s({enabled:e=!0,containerRef:t,itemRef:n,deps:r=[]}){return i({enabled:e,containerRef:t,measure:()=>n.current?.getBoundingClientRect().height??0,deps:r})}export{a as useGridFirstRowHeight,s as useSingleFirstRowHeight,o as useWaterfallFirstRowHeight};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
|
|
2
|
+
//#region hooks/use-min-duration-loading.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* useMinDurationLoading
|
|
5
|
+
*
|
|
6
|
+
* 用于控制 loading 的展示时长:当请求很快完成时,保证 loading 至少展示 `minDuration` 毫秒,
|
|
7
|
+
* 避免 UI 闪烁。
|
|
8
|
+
*
|
|
9
|
+
* @param minDuration - 最小展示时长(ms),默认 500
|
|
10
|
+
*/
|
|
11
|
+
declare function useMinDurationLoading(minDuration?: number): {
|
|
12
|
+
isLoading: boolean;
|
|
13
|
+
show: () => void;
|
|
14
|
+
hide: () => void;
|
|
15
|
+
cancel: () => void;
|
|
16
|
+
};
|
|
17
|
+
//#endregion
|
|
18
|
+
export { useMinDurationLoading };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
|
|
2
|
+
import{useCallback as e,useEffect as t,useRef as n,useState as r}from"react";function i(i=500){let[a,o]=r(!1),s=n(!1),c=n(0),l=n(null),u=e(()=>{l.current&&=(clearTimeout(l.current),null),s.current=!1,o(!1)},[]),d=e(()=>{l.current&&=(clearTimeout(l.current),null),c.current=Date.now(),s.current=!0,o(!0)},[]),f=e(()=>{if(!s.current)return;let e=i-(Date.now()-(c.current||Date.now()));if(e<=0){s.current=!1,o(!1);return}l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{l.current=null,s.current=!1,o(!1)},e)},[i]);return t(()=>()=>{u()},[u]),{isLoading:a,show:d,hide:f,cancel:u}}export{i as useMinDurationLoading};
|
package/dist/hooks.d.mts
CHANGED
|
@@ -4,11 +4,13 @@ import { HydrationBoundary, PrefetchInfiniteItem, PrefetchItem, PrefetchQueryIte
|
|
|
4
4
|
import { useDeleteRequest, useMutation, usePaginated, usePrefetchQuery, useRefetchQuery, useRequest, useUpdateRequest } from "./hooks/query/use-query.mjs";
|
|
5
5
|
import { AuthFields, useAuth, useCloseLogin, useExpireTime, useIsLoggedIn, useLoginModalOpen, useLogout, useOpenLogin, useOpenLoginAsync, useOpenResetPassword, useRequireLogin, useSetAuthFields, useToken, useUserId, useUserInfo } from "./hooks/use-auth.mjs";
|
|
6
6
|
import { UseBrowseReportOptions, useBrowseReport } from "./hooks/use-browse-report.mjs";
|
|
7
|
+
import { useGridFirstRowHeight, useSingleFirstRowHeight, useWaterfallFirstRowHeight } from "./hooks/use-first-row-height.mjs";
|
|
7
8
|
import { useFollow } from "./hooks/use-follow.mjs";
|
|
8
9
|
import { useFullscreenGestures } from "./hooks/use-fullscreen-gestures.mjs";
|
|
9
10
|
import { useKeyboardOpen } from "./hooks/use-keyboard-open.mjs";
|
|
10
11
|
import { LikeableItem, useLikeDislike } from "./hooks/use-like-dislike.mjs";
|
|
12
|
+
import { useMinDurationLoading } from "./hooks/use-min-duration-loading.mjs";
|
|
11
13
|
import { useSearchHistory } from "./hooks/use-search-history.mjs";
|
|
12
14
|
import { useSticky } from "./hooks/use-sticky.mjs";
|
|
13
15
|
import { useKeepAliveEffect, useKeepAliveState } from "./components/common/keep-scroll-position/index.mjs";
|
|
14
|
-
export { AuthFields, HydrationBoundary, IMAGE_TEXT_RECOMMEND_FIXED_BATCH_SIZE, ImageTextRecommendAnyVideo, LikeableItem, PrefetchInfiniteItem, PrefetchItem, PrefetchQueryItem, UseBrowseReportOptions, buildImageTextRecommendChosenTags, buildImageTextRecommendRemoteMap, buildImageTextRecommendSmartPicked, getImageTextRecommendFixedIds, getImageTextRecommendLayoutTags, resolveImageTextRecommendVideoId, useAuth, useBrowseReport, useCloseLogin, useDeleteRequest, useExpireTime, useFollow, useFullscreenGestures, useIsLoggedIn, useKeepAliveEffect, useKeepAliveState, useKeyboardOpen, useLikeDislike, useLoginModalOpen, useLogout, useMutation, useOpenLogin, useOpenLoginAsync, useOpenResetPassword, usePaginated, usePrefetchQuery, useRefetchQuery, useRequest, useRequireLogin, useSearchHistory, useSetAuthFields, useSticky, useToken, useUpdateRequest, useUserId, useUserInfo };
|
|
16
|
+
export { AuthFields, HydrationBoundary, IMAGE_TEXT_RECOMMEND_FIXED_BATCH_SIZE, ImageTextRecommendAnyVideo, LikeableItem, PrefetchInfiniteItem, PrefetchItem, PrefetchQueryItem, UseBrowseReportOptions, buildImageTextRecommendChosenTags, buildImageTextRecommendRemoteMap, buildImageTextRecommendSmartPicked, getImageTextRecommendFixedIds, getImageTextRecommendLayoutTags, resolveImageTextRecommendVideoId, useAuth, useBrowseReport, useCloseLogin, useDeleteRequest, useExpireTime, useFollow, useFullscreenGestures, useGridFirstRowHeight, useIsLoggedIn, useKeepAliveEffect, useKeepAliveState, useKeyboardOpen, useLikeDislike, useLoginModalOpen, useLogout, useMinDurationLoading, useMutation, useOpenLogin, useOpenLoginAsync, useOpenResetPassword, usePaginated, usePrefetchQuery, useRefetchQuery, useRequest, useRequireLogin, useSearchHistory, useSetAuthFields, useSingleFirstRowHeight, useSticky, useToken, useUpdateRequest, useUserId, useUserInfo, useWaterfallFirstRowHeight };
|
package/dist/hooks.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{IMAGE_TEXT_RECOMMEND_FIXED_BATCH_SIZE as e,buildImageTextRecommendChosenTags as t,buildImageTextRecommendRemoteMap as n,buildImageTextRecommendSmartPicked as r,getImageTextRecommendFixedIds as i,getImageTextRecommendLayoutTags as a,resolveImageTextRecommendVideoId as o}from"./hooks/image-text-recommend.mjs";import{HydrationBoundary as s}from"./hooks/query/hydration-boundary.mjs";import{useDeleteRequest as c,useMutation as l,usePaginated as u,usePrefetchQuery as d,useRefetchQuery as f,useRequest as p,useUpdateRequest as m}from"./hooks/query/use-query.mjs";import{useAuth as h,useCloseLogin as g,useExpireTime as _,useIsLoggedIn as v,useLoginModalOpen as y,useLogout as b,useOpenLogin as x,useOpenLoginAsync as S,useOpenResetPassword as C,useRequireLogin as w,useSetAuthFields as T,useToken as E,useUserId as D,useUserInfo as O}from"./hooks/use-auth.mjs";import{useBrowseReport as k}from"./hooks/use-browse-report.mjs";import{
|
|
2
|
+
import{IMAGE_TEXT_RECOMMEND_FIXED_BATCH_SIZE as e,buildImageTextRecommendChosenTags as t,buildImageTextRecommendRemoteMap as n,buildImageTextRecommendSmartPicked as r,getImageTextRecommendFixedIds as i,getImageTextRecommendLayoutTags as a,resolveImageTextRecommendVideoId as o}from"./hooks/image-text-recommend.mjs";import{HydrationBoundary as s}from"./hooks/query/hydration-boundary.mjs";import{useDeleteRequest as c,useMutation as l,usePaginated as u,usePrefetchQuery as d,useRefetchQuery as f,useRequest as p,useUpdateRequest as m}from"./hooks/query/use-query.mjs";import{useAuth as h,useCloseLogin as g,useExpireTime as _,useIsLoggedIn as v,useLoginModalOpen as y,useLogout as b,useOpenLogin as x,useOpenLoginAsync as S,useOpenResetPassword as C,useRequireLogin as w,useSetAuthFields as T,useToken as E,useUserId as D,useUserInfo as O}from"./hooks/use-auth.mjs";import{useBrowseReport as k}from"./hooks/use-browse-report.mjs";import{useGridFirstRowHeight as A,useSingleFirstRowHeight as j,useWaterfallFirstRowHeight as M}from"./hooks/use-first-row-height.mjs";import{useFollow as N}from"./hooks/use-follow.mjs";import{useFullscreenGestures as P}from"./hooks/use-fullscreen-gestures.mjs";import{useKeyboardOpen as F}from"./hooks/use-keyboard-open.mjs";import{useLikeDislike as I}from"./hooks/use-like-dislike.mjs";import{useMinDurationLoading as L}from"./hooks/use-min-duration-loading.mjs";import{useSearchHistory as R}from"./hooks/use-search-history.mjs";import{useSticky as z}from"./hooks/use-sticky.mjs";import{useKeepAliveEffect as B,useKeepAliveState as V}from"./components/common/keep-scroll-position/index.mjs";export{s as HydrationBoundary,e as IMAGE_TEXT_RECOMMEND_FIXED_BATCH_SIZE,t as buildImageTextRecommendChosenTags,n as buildImageTextRecommendRemoteMap,r as buildImageTextRecommendSmartPicked,i as getImageTextRecommendFixedIds,a as getImageTextRecommendLayoutTags,o as resolveImageTextRecommendVideoId,h as useAuth,k as useBrowseReport,g as useCloseLogin,c as useDeleteRequest,_ as useExpireTime,N as useFollow,P as useFullscreenGestures,A as useGridFirstRowHeight,v as useIsLoggedIn,B as useKeepAliveEffect,V as useKeepAliveState,F as useKeyboardOpen,I as useLikeDislike,y as useLoginModalOpen,b as useLogout,L as useMinDurationLoading,l as useMutation,x as useOpenLogin,S as useOpenLoginAsync,C as useOpenResetPassword,u as usePaginated,d as usePrefetchQuery,f as useRefetchQuery,p as useRequest,w as useRequireLogin,R as useSearchHistory,T as useSetAuthFields,j as useSingleFirstRowHeight,z as useSticky,E as useToken,m as useUpdateRequest,D as useUserId,O as useUserInfo,M as useWaterfallFirstRowHeight};
|