@funhub/platform 0.1.52 → 0.1.53
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/README.md +0 -13
- package/dist/biz.d.mts +8 -10
- package/dist/biz.mjs +1 -1
- package/dist/components/biz/business/banner/variants/basic-banner/material.d.mts +1 -1
- package/dist/components/biz/business/banner-carousel/material.d.mts +1 -1
- package/dist/components/biz/business/channel-list/material.d.mts +1 -1
- package/dist/components/biz/business/detail/materials/registry.d.mts +7 -6
- package/dist/components/biz/business/detail/materials/runtime-context-provider.mjs +2 -0
- package/dist/components/biz/business/detail/materials/video-detail-actions/client.d.mts +0 -2
- package/dist/components/biz/business/detail/materials/video-detail-actions/client.mjs +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-actions/material.d.mts +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-actions/schema.d.mts +1 -5
- package/dist/components/biz/business/detail/materials/video-detail-info/client.d.mts +0 -4
- 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.d.mts +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-info/schema.d.mts +1 -7
- package/dist/components/biz/business/detail/materials/video-detail-info-title/client.d.mts +0 -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.d.mts +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-info-title/schema.d.mts +1 -4
- package/dist/components/biz/business/detail/materials/video-detail-info-title-tags-episodes/client.d.mts +0 -3
- 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.d.mts +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-info-title-tags-episodes/schema.d.mts +1 -6
- package/dist/components/biz/business/detail/materials/video-detail-player/client.d.mts +0 -3
- package/dist/components/biz/business/detail/materials/video-detail-player/client.mjs +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-player/material.d.mts +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-player/schema.d.mts +1 -6
- package/dist/components/biz/business/detail/materials/video-detail-recommend/client.d.mts +1 -2
- package/dist/components/biz/business/detail/materials/video-detail-recommend/client.mjs +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-recommend/material.d.mts +2 -1
- package/dist/components/biz/business/detail/materials/video-detail-recommend/schema.d.mts +2 -3
- package/dist/components/biz/business/detail/materials/video-detail-recommend/schema.mjs +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-recommend/utils.mjs +1 -1
- package/dist/components/biz/business/floating-ball/material.d.mts +1 -1
- package/dist/components/biz/business/header-search/header-avatar-icon/material.d.mts +1 -1
- package/dist/components/biz/business/header-search/header-avatar-logo-search/material.d.mts +1 -1
- package/dist/components/biz/business/header-search/header-avatar-logo-search-icon/material.d.mts +1 -1
- package/dist/components/biz/business/header-search/header-logo-search/material.d.mts +1 -1
- package/dist/components/biz/business/header-search/header-search/material.d.mts +1 -1
- package/dist/components/biz/business/home-recommend/index.d.mts +4 -6
- package/dist/components/biz/business/home-recommend/shared/home-recommend-base.mjs +1 -1
- package/dist/components/biz/business/home-recommend/shared/home-recommend-default-config.mjs +2 -0
- package/dist/components/biz/business/home-recommend/shared/home-recommend-feed-mode.mjs +2 -0
- package/dist/components/biz/business/home-recommend/shared/home-recommend-preview.mjs +1 -1
- package/dist/components/biz/business/home-recommend/shared/home-recommend-server-data.mjs +2 -0
- package/dist/components/biz/business/home-recommend/shared/home-recommend-video-detail.mjs +2 -0
- package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/index.d.mts +2 -3
- package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/index.mjs +1 -1
- package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/inspector-schema.d.mts +35 -1
- 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 +29 -3
- 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/prefetch-client.d.mts +27 -0
- package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/runtime/prefetch-client.mjs +2 -0
- package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/schema/index.mjs +1 -1
- package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/server.d.mts +3 -6
- 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/index.d.mts +2 -3
- package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/index.mjs +1 -1
- package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/inspector-schema.d.mts +30 -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 +26 -4
- 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/prefetch-client.d.mts +27 -0
- package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/runtime/prefetch-client.mjs +2 -0
- package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/schema/index.mjs +1 -1
- package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/server.d.mts +3 -6
- package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/server.mjs +1 -1
- package/dist/components/biz/business/index.d.mts +11 -13
- package/dist/components/biz/business/large-feature-grid/card-item.mjs +1 -1
- package/dist/components/biz/business/large-feature-grid/material.d.mts +2 -2
- package/dist/components/biz/business/marquee/material.d.mts +1 -1
- package/dist/components/biz/business/profile/profile-header/material.d.mts +2 -2
- package/dist/components/biz/business/profile/profile-header/user-profile-avatar.mjs +1 -1
- package/dist/components/biz/business/profile/profile-header/user-profile-cover-background.mjs +1 -1
- package/dist/components/biz/business/profile/profile-main/material.d.mts +1 -1
- package/dist/components/biz/business/search-history/material.d.mts +1 -1
- package/dist/components/biz/business/search-input/material.d.mts +1 -1
- package/dist/components/biz/business/shortcut-grid/material.d.mts +1 -1
- package/dist/components/biz/business/tab-bar/material.d.mts +2 -2
- package/dist/components/biz/business/tab-bar/schema.d.mts +1 -1
- package/dist/components/biz/business/text-recommend/material.d.mts +1 -1
- package/dist/components/biz/business/video-horizontal-list/material.d.mts +1 -1
- package/dist/components/biz/example/button/material.d.mts +1 -1
- package/dist/components/biz/example/button/material.mjs +1 -1
- package/dist/components/biz/utils/transformers/data.mjs +1 -1
- package/dist/components/common/cards/mini-three-card.mjs +1 -1
- package/dist/components/pages/(follow)/_components/follow-button/index.mjs +1 -1
- package/dist/components/pages/login/password.mjs +1 -1
- package/dist/components/pages/login/register.mjs +1 -1
- package/dist/components/pages/login/reset-password.mjs +1 -1
- package/dist/components/pages/login/verify.mjs +1 -1
- package/dist/components/pages/search-result/page-client.mjs +1 -1
- package/dist/components/pages/search-result/search-all.mjs +1 -1
- package/dist/components/pages/search-result/search-tab.mjs +1 -1
- package/dist/components/pages/search-result/search-user.mjs +1 -1
- package/dist/components/pages/search-result/search-video.mjs +1 -1
- package/dist/components/pages/settings/_components/reset-password-drawer.mjs +1 -1
- package/dist/components/pages/settings/_components/settings.mjs +1 -1
- package/dist/components/pages/video-detail/video-detail-client.mjs +1 -1
- package/dist/components/ui/badge.d.mts +1 -1
- package/dist/components/ui/button.d.mts +1 -1
- package/dist/components/ui/image.d.mts +4 -4
- package/dist/i18n/locales/en.mjs +1 -1
- package/dist/i18n/locales/zh-CN.mjs +1 -1
- package/dist/service/content-batch-get-video-detail.d.mts +21 -0
- package/dist/service/content-batch-get-video-detail.mjs +2 -0
- package/dist/service.d.mts +2 -1
- package/dist/service.mjs +1 -1
- package/dist/utils/schema/index.d.mts +1 -1
- package/dist/utils/schema/material.d.mts +9 -7
- package/dist/utils/schema/utils.d.mts +3 -13
- package/dist/utils/schema/utils.mjs +1 -1
- package/dist/utils.d.mts +2 -3
- package/dist/utils.mjs +1 -1
- package/package.json +2 -7
- package/bin/index.mjs +0 -323
- package/dist/assets/images/user/default_avatar.mjs +0 -2
- package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/defaults/default-props.d.mts +0 -10
- package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/defaults/default-props.mjs +0 -2
- package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/runtime/client.d.mts +0 -20
- package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/runtime/client.mjs +0 -2
- package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/schema/props.schema.mjs +0 -2
- package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/defaults/default-props.d.mts +0 -8
- package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/defaults/default-props.mjs +0 -2
- package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/runtime/client.d.mts +0 -20
- package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/runtime/client.mjs +0 -2
- package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/schema/props.schema.mjs +0 -2
- package/dist/utils/password-validator.d.mts +0 -28
- package/dist/utils/password-validator.mjs +0 -2
- package/templates/base/_meta.json +0 -4
- package/templates/base/template/README.md.template +0 -32
- package/templates/base/template/__dot__gitignore +0 -6
- package/templates/base/template/app/[locale]/layout.tsx.template +0 -36
- package/templates/base/template/app/[locale]/page.tsx.template +0 -24
- package/templates/base/template/app/globals.css +0 -26
- package/templates/base/template/app/layout.tsx.template +0 -38
- package/templates/base/template/eslint.config.mjs.template +0 -68
- package/templates/base/template/i18n/request.ts.template +0 -3
- package/templates/base/template/next-env.d.ts.template +0 -4
- package/templates/base/template/next.config.ts.template +0 -21
- package/templates/base/template/package.json.template +0 -37
- package/templates/base/template/postcss.config.js.template +0 -18
- package/templates/base/template/proxy.ts.template +0 -18
- package/templates/base/template/tailwind.config.cjs.template +0 -13
- package/templates/base/template/tsconfig.json.template +0 -43
package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/material.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{defineMaterial as e}from"../../../../../../utils/schema/material.mjs";import{homeRecommendWaterfallInspectorPropsSchema as
|
|
2
|
+
import{defineMaterial as e}from"../../../../../../utils/schema/material.mjs";import t from"./runtime/prefetch-client.mjs";import{homeRecommendWaterfallInspectorPropsSchema as n}from"./inspector-schema.mjs";import{HomeRecommendWaterfall as r}from"./server.mjs";const i=e({type:`home-recommend-waterfall`,name:`瀑布流`,icon:`/static/components-thumb/grid_waterfall_two_column.png`,category:`内容组件`,serverComponent:r,clientComponent:t,propsSchema:n});export{i as homeRecommendWaterfallMaterial};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
|
|
2
|
+
import { MaterialComponentMode } from "../../../../../../../utils/schema/schema.mjs";
|
|
3
|
+
import "../../../../../../../utils/schema/index.mjs";
|
|
4
|
+
import { HomeRecommendData } from "../../../types.mjs";
|
|
5
|
+
import { HomeRecommendWaterfallInspectorProps } from "../inspector-schema.mjs";
|
|
6
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
7
|
+
|
|
8
|
+
//#region components/biz/business/home-recommend/variants/home-recommend-waterfall/runtime/prefetch-client.d.ts
|
|
9
|
+
interface HomeRecommendWaterfallPrefetchClientProps extends Partial<Omit<HomeRecommendWaterfallInspectorProps, 'mode'>> {
|
|
10
|
+
/** 预取数据(可选)。 */
|
|
11
|
+
prefetchData?: HomeRecommendData;
|
|
12
|
+
/** 兼容内容块转换链路的数据字段。 */
|
|
13
|
+
data?: HomeRecommendData;
|
|
14
|
+
/** 渲染模式。 */
|
|
15
|
+
mode?: MaterialComponentMode;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* 首页推荐瀑布流布局(支持预取数据)。
|
|
19
|
+
*/
|
|
20
|
+
declare function HomeRecommendWaterfallPrefetchClient({
|
|
21
|
+
prefetchData,
|
|
22
|
+
data,
|
|
23
|
+
mode,
|
|
24
|
+
...propsConfig
|
|
25
|
+
}: HomeRecommendWaterfallPrefetchClientProps): react_jsx_runtime0.JSX.Element;
|
|
26
|
+
//#endregion
|
|
27
|
+
export { HomeRecommendWaterfallPrefetchClient };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
|
|
2
|
+
"use client";import{buildHomeRecommendEditorPreviewData as e}from"../../../shared/home-recommend-preview.mjs";import t from"../../../shared/home-recommend-base.mjs";import{useMemo as n}from"react";import{jsx as r}from"react/jsx-runtime";function i({prefetchData:i,data:a,mode:o=`renderer`,...s}){let c=o===`editor`,l=s,u=i??a,d=n(()=>c?e({variant:`waterfall`,schemaTitle:l.title,enableInfinite:l.enableInfinite,smartTagEnabled:l.smartTagEnabled,items:l.items}):u,[c,u,l.enableInfinite,l.items,l.smartTagEnabled,l.title]);return r(`div`,{className:c?`pointer-events-none`:void 0,children:r(t,{variant:`waterfall`,props:l,data:d,mode:o})})}export{i as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{
|
|
2
|
+
import{homeRecommendWaterfallPropsSchema as e}from"../inspector-schema.mjs";import{componentMeta as t}from"./component.mjs";import{dataSchema as n}from"./data.schema.mjs";import{eventSchema as r}from"./event.schema.mjs";import{styleSchema as i}from"./style.schema.mjs";const a={...t,propsSchema:e,dataSchema:n,styleSchema:i,eventSchema:r};export{a as schema};
|
package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/server.d.mts
CHANGED
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
|
|
2
|
-
import { HomeRecommendData } from "../../types.mjs";
|
|
3
2
|
import { HomeRecommendWaterfallInspectorProps } from "./inspector-schema.mjs";
|
|
4
3
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
5
4
|
|
|
6
5
|
//#region components/biz/business/home-recommend/variants/home-recommend-waterfall/server.d.ts
|
|
7
|
-
/** HomeRecommendWaterfall 物料组件 props
|
|
8
|
-
type HomeRecommendWaterfallProps = HomeRecommendWaterfallInspectorProps
|
|
9
|
-
/** 推荐位数据 */data?: HomeRecommendData;
|
|
10
|
-
};
|
|
6
|
+
/** HomeRecommendWaterfall 物料组件 props。 */
|
|
7
|
+
type HomeRecommendWaterfallProps = HomeRecommendWaterfallInspectorProps;
|
|
11
8
|
/**
|
|
12
9
|
* HomeRecommendWaterfall 物料组件
|
|
13
10
|
* 接收 inspector 可编辑的 props,转换为 BaseComponentProps 传给 runtime client
|
|
14
11
|
*/
|
|
15
|
-
declare function HomeRecommendWaterfall(props: HomeRecommendWaterfallProps): react_jsx_runtime0.JSX.Element
|
|
12
|
+
declare function HomeRecommendWaterfall(props: HomeRecommendWaterfallProps): Promise<react_jsx_runtime0.JSX.Element>;
|
|
16
13
|
//#endregion
|
|
17
14
|
export { HomeRecommendWaterfall };
|
package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/server.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import e from"./runtime/client.mjs";import{jsx as
|
|
2
|
+
import{HydrationBoundary as e}from"../../../../../../hooks/query/hydration-boundary.mjs";import t from"./runtime/prefetch-client.mjs";import{resolveHomeRecommendServerData as n}from"../../shared/home-recommend-server-data.mjs";import{jsx as r}from"react/jsx-runtime";function i(e){let t=Array.isArray(e)?e.length:0;return t>0?t:16}function a(e){if(typeof e==`string`)return e.trim()||void 0}async function o(o){let{mode:s=`renderer`,...c}=o;if(s!==`renderer`)return r(t,{...c,mode:s});let l=await n({smartTagEnabled:c.smartTagEnabled,pageSize:i(c.items)});return r(e,{prefetch:[{type:`infinite`,queryKey:[`home-recommend`,l.feedMode,l.data.block_id||`popular`],queryFn:async()=>({items:l.data.list||[],icons:l.data.icons||[],nextCursor:a(l.data.cursor)}),initialPageParam:``,getNextPageParam:()=>void 0}],children:r(t,{...c,prefetchData:l.data,mode:s})})}export{o as HomeRecommendWaterfall};
|
|
@@ -41,16 +41,14 @@ import { defaultProps as defaultProps$9 } from "./fullscreen-feed/variants/fulls
|
|
|
41
41
|
import { FullscreenVideoFeedClient } from "./fullscreen-feed/variants/fullscreen-video-feed/runtime/client.mjs";
|
|
42
42
|
import { schema as schema$9 } from "./fullscreen-feed/variants/fullscreen-video-feed/schema/index.mjs";
|
|
43
43
|
import "./fullscreen-feed/index.mjs";
|
|
44
|
-
import { defaultProps as defaultProps$10 } from "./home-recommend/variants/home-recommend-grid/defaults/default-props.mjs";
|
|
45
|
-
import { HomeRecommendGridClient } from "./home-recommend/variants/home-recommend-grid/runtime/client.mjs";
|
|
46
|
-
import { schema as schema$10 } from "./home-recommend/variants/home-recommend-grid/schema/index.mjs";
|
|
47
44
|
import { homeRecommendGridInspectorDefaultProps, homeRecommendGridInspectorPropsSchema } from "./home-recommend/variants/home-recommend-grid/inspector-schema.mjs";
|
|
45
|
+
import { HomeRecommendGridPrefetchClient } from "./home-recommend/variants/home-recommend-grid/runtime/prefetch-client.mjs";
|
|
46
|
+
import { schema as schema$10 } from "./home-recommend/variants/home-recommend-grid/schema/index.mjs";
|
|
48
47
|
import { HomeRecommendGrid } from "./home-recommend/variants/home-recommend-grid/server.mjs";
|
|
49
48
|
import { homeRecommendGridMaterial } from "./home-recommend/variants/home-recommend-grid/material.mjs";
|
|
50
|
-
import { defaultProps as defaultProps$11 } from "./home-recommend/variants/home-recommend-waterfall/defaults/default-props.mjs";
|
|
51
|
-
import { HomeRecommendWaterfallClient } from "./home-recommend/variants/home-recommend-waterfall/runtime/client.mjs";
|
|
52
|
-
import { schema as schema$11 } from "./home-recommend/variants/home-recommend-waterfall/schema/index.mjs";
|
|
53
49
|
import { homeRecommendWaterfallInspectorDefaultProps, homeRecommendWaterfallInspectorPropsSchema } from "./home-recommend/variants/home-recommend-waterfall/inspector-schema.mjs";
|
|
50
|
+
import { HomeRecommendWaterfallPrefetchClient } from "./home-recommend/variants/home-recommend-waterfall/runtime/prefetch-client.mjs";
|
|
51
|
+
import { schema as schema$11 } from "./home-recommend/variants/home-recommend-waterfall/schema/index.mjs";
|
|
54
52
|
import { HomeRecommendWaterfall } from "./home-recommend/variants/home-recommend-waterfall/server.mjs";
|
|
55
53
|
import { homeRecommendWaterfallMaterial } from "./home-recommend/variants/home-recommend-waterfall/material.mjs";
|
|
56
54
|
import "./home-recommend/index.mjs";
|
|
@@ -59,11 +57,11 @@ import { MarqueeClient, MarqueeProps } from "./marquee/client.mjs";
|
|
|
59
57
|
import { MarqueeServer } from "./marquee/server.mjs";
|
|
60
58
|
import { marqueeMaterial } from "./marquee/material.mjs";
|
|
61
59
|
import "./marquee/index.mjs";
|
|
62
|
-
import { defaultProps as defaultProps$
|
|
60
|
+
import { defaultProps as defaultProps$10 } from "./nav-bar/variants/basic-nav-bar/defaults/default-props.mjs";
|
|
63
61
|
import { BasicNavBarClient } from "./nav-bar/variants/basic-nav-bar/runtime/client.mjs";
|
|
64
62
|
import { schema as schema$12 } from "./nav-bar/variants/basic-nav-bar/schema/index.mjs";
|
|
65
63
|
import "./nav-bar/index.mjs";
|
|
66
|
-
import { defaultProps as defaultProps$
|
|
64
|
+
import { defaultProps as defaultProps$11 } from "./post-card/variants/basic-post-card/defaults/default-props.mjs";
|
|
67
65
|
import { BasicPostCardClient } from "./post-card/variants/basic-post-card/runtime/client.mjs";
|
|
68
66
|
import { schema as schema$13 } from "./post-card/variants/basic-post-card/schema/index.mjs";
|
|
69
67
|
import "./post-card/index.mjs";
|
|
@@ -86,20 +84,20 @@ import { PublishTab, PublishTabProps, PublishTabUserInfo } from "./profile/profi
|
|
|
86
84
|
import { BuildPublishTabPrefetchParams, PublishTabServer, buildPublishTabPrefetch } from "./profile/profile-main/tabs/publish-tab/server.mjs";
|
|
87
85
|
import { profileMainCollectCollectionTabOptions, profileMainCollectTabOptions, profileMainHistoryTabOptions, profileMainLikeTabOptions, profileMainMineTabOptions, profileMainProfileTabOptions, profileMainTabOptions } from "./profile/profile-main/variants.mjs";
|
|
88
86
|
import "./profile/index.mjs";
|
|
89
|
-
import { defaultProps as defaultProps$
|
|
87
|
+
import { defaultProps as defaultProps$12 } from "./recommended-users/variants/basic-recommended-users/defaults/default-props.mjs";
|
|
90
88
|
import { BasicRecommendedUsersClient } from "./recommended-users/variants/basic-recommended-users/runtime/client.mjs";
|
|
91
89
|
import { schema as schema$14 } from "./recommended-users/variants/basic-recommended-users/schema/index.mjs";
|
|
92
90
|
import "./recommended-users/index.mjs";
|
|
93
|
-
import { defaultProps as defaultProps$
|
|
91
|
+
import { defaultProps as defaultProps$13 } from "./search-bar/variants/basic-search-bar/defaults/default-props.mjs";
|
|
94
92
|
import { BasicSearchBarClient } from "./search-bar/variants/basic-search-bar/runtime/client.mjs";
|
|
95
93
|
import { schema as schema$15 } from "./search-bar/variants/basic-search-bar/schema/index.mjs";
|
|
96
|
-
import { defaultProps as defaultProps$
|
|
94
|
+
import { defaultProps as defaultProps$14 } from "./search-bar/variants/detail-search-bar/defaults/default-props.mjs";
|
|
97
95
|
import { DetailSearchBarClient } from "./search-bar/variants/detail-search-bar/runtime/client.mjs";
|
|
98
96
|
import { schema as schema$16 } from "./search-bar/variants/detail-search-bar/schema/index.mjs";
|
|
99
|
-
import { defaultProps as defaultProps$
|
|
97
|
+
import { defaultProps as defaultProps$15 } from "./search-bar/variants/filter-search-bar/defaults/default-props.mjs";
|
|
100
98
|
import { FilterSearchBarClient } from "./search-bar/variants/filter-search-bar/runtime/client.mjs";
|
|
101
99
|
import { schema as schema$17 } from "./search-bar/variants/filter-search-bar/schema/index.mjs";
|
|
102
|
-
import { defaultProps as defaultProps$
|
|
100
|
+
import { defaultProps as defaultProps$16 } from "./search-bar/variants/tag-search-bar/defaults/default-props.mjs";
|
|
103
101
|
import { TagSearchBarClient } from "./search-bar/variants/tag-search-bar/runtime/client.mjs";
|
|
104
102
|
import { schema as schema$18 } from "./search-bar/variants/tag-search-bar/schema/index.mjs";
|
|
105
103
|
import "./search-bar/index.mjs";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{Image as e}from"../../../ui/image.mjs";import{Box as t}from"../../../ui/box.mjs";import{Text as n}from"../../../ui/text.mjs";import r from"../../../ui/link.mjs";import i from"../../../../assets/icons/view.mjs";import{jsx as a,jsxs as o}from"react/jsx-runtime";function s({
|
|
2
|
+
import{Image as e}from"../../../ui/image.mjs";import{Box as t}from"../../../ui/box.mjs";import{Text as n}from"../../../ui/text.mjs";import r from"../../../ui/link.mjs";import i from"../../../../assets/icons/view.mjs";import{jsx as a,jsxs as o}from"react/jsx-runtime";function s(e){if(e.episodeText===void 0||e.episodeText===null||e.episodeText===``)return null;let t=String(e.episodeText).trim();if(!t)return null;if(t===`已完结`||t===`连载中`)return t;let n=Number(t);return Number.isFinite(n)&&n>0?`全${Math.floor(n)}集`:/^全\d+集$/.test(t)?t:null}function c(e){if(e==null||e===``)return null;let t=Number(e);if(Number.isNaN(t))return String(e);if(t<1e3)return String(t);if(t<1e6){let e=(t/1e3).toFixed(1);return e.endsWith(`.0`)?`${e.slice(0,-2)}K`:`${e}K`}else{let e=(t/1e6).toFixed(1);return e.endsWith(`.0`)?`${e.slice(0,-2)}M`:`${e}M`}}function l(e,t,n){return t===`showPlayCount`?e.showPlayCount??n:t===`showEpisode`?e.showEpisode??n:n}function u(e){if(l(e,`showPlayCount`,!0))return e.playCount}function d(e){let t=e.tagImageUrl;return t?String(t):null}function f({data:f}){return f?a(t,{children:(Array.isArray(f)?f:[f]).map(f=>{let p=f.id?`/video/${f.id}/${f.title?encodeURIComponent(f.title):``}`:`#`,m=d(f),h=l(f,`showEpisode`,!0)?s(f):null,g=c(u(f));return a(t,{children:o(r,{href:p,children:[o(t,{className:`relative w-full overflow-hidden rounded-[12px] bg-neutral-800`,style:{aspectRatio:`16/9`},children:[f.cover&&a(e,{src:f.cover,alt:f.title,fill:!0,objectFit:`cover`}),m&&a(t,{className:`absolute right-0 top-0 z-10 h-[37px] w-[20px] overflow-hidden`,style:{borderRadius:`0 8px`},children:a(e,{src:m,alt:f.title,fill:!0,objectFit:`cover`})}),a(t,{className:`absolute inset-x-0 bottom-0 h-[40px] bg-gradient-to-t from-black/80 to-transparent z-0 pointer-events-none`}),g&&o(t,{className:`absolute bottom-0 left-[8px] mb-[6px] z-10 flex items-center gap-[4px]`,children:[a(i,{className:`h-[14px] w-[14px] text-white`}),a(n,{as:`span`,className:`text-[12px] font-medium text-white drop-shadow-md`,children:g})]}),h&&a(t,{className:`absolute bottom-0 right-[8px] mb-[6px] z-10 flex items-center`,children:a(n,{as:`span`,className:`text-[12px] font-medium text-white drop-shadow-md`,children:h})})]}),o(t,{className:`flex items-center justify-between gap-[12px] pt-[10px] px-2`,children:[o(t,{className:`flex-1 min-w-0`,children:[a(n,{as:`h3`,className:`text-[16px] font-semibold leading-[24px] text-text1 line-clamp-1`,children:f.title}),f.desc&&a(n,{as:`p`,className:`mt-[4px] text-[13px] leading-[20px] text-text2 line-clamp-1`,children:f.desc})]}),a(n,{className:`shrink-0 rounded-[20px] border border-[#FD4C5E] px-[24px] py-[8px] text-[14px] font-normal text-[#FD4C5E]`,children:`观看`})]})]})},f.id||f.title)})}):null}export{f as LargeGridItemClient};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { DefineMaterialOption
|
|
2
|
+
import { DefineMaterialOption } from "../../../../utils/schema/material.mjs";
|
|
3
3
|
import * as react from "react";
|
|
4
4
|
import * as zod from "zod";
|
|
5
5
|
import * as zod_v4_core0 from "zod/v4/core";
|
|
@@ -7,6 +7,6 @@ import * as zod_v4_core0 from "zod/v4/core";
|
|
|
7
7
|
//#region components/biz/business/large-feature-grid/material.d.ts
|
|
8
8
|
declare const largeFeatureGridMaterial: DefineMaterialOption<react.ComponentType<any>, react.ComponentType<any>, zod.ZodObject<Readonly<{
|
|
9
9
|
[k: string]: zod_v4_core0.$ZodType<unknown, unknown, zod_v4_core0.$ZodTypeInternals<unknown, unknown>>;
|
|
10
|
-
}>, zod_v4_core0.$strip>, string
|
|
10
|
+
}>, zod_v4_core0.$strip>, string>;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { largeFeatureGridMaterial };
|
|
@@ -35,6 +35,6 @@ declare const marqueeMaterial: DefineMaterialOption<typeof MarqueeServer, typeof
|
|
|
35
35
|
renderer: "renderer";
|
|
36
36
|
editor: "editor";
|
|
37
37
|
}>>;
|
|
38
|
-
}, zod_v4_core0.$strip>, "marquee"
|
|
38
|
+
}, zod_v4_core0.$strip>, "marquee">;
|
|
39
39
|
//#endregion
|
|
40
40
|
export { marqueeMaterial };
|
|
@@ -18,7 +18,7 @@ declare const profileHeaderMaterial: DefineMaterialOption<({
|
|
|
18
18
|
renderer: "renderer";
|
|
19
19
|
editor: "editor";
|
|
20
20
|
}>>;
|
|
21
|
-
}, zod_v4_core0.$strip>, "profile-header"
|
|
21
|
+
}, zod_v4_core0.$strip>, "profile-header">;
|
|
22
22
|
declare const profileHeaderMaterialWithDisabledBackground: DefineMaterialOption<({
|
|
23
23
|
mode,
|
|
24
24
|
...props
|
|
@@ -30,6 +30,6 @@ declare const profileHeaderMaterialWithDisabledBackground: DefineMaterialOption<
|
|
|
30
30
|
renderer: "renderer";
|
|
31
31
|
editor: "editor";
|
|
32
32
|
}>>;
|
|
33
|
-
}, zod_v4_core0.$strip>, "profile-header-with-disabled-background"
|
|
33
|
+
}, zod_v4_core0.$strip>, "profile-header-with-disabled-background">;
|
|
34
34
|
//#endregion
|
|
35
35
|
export { profileHeaderMaterial, profileHeaderMaterialWithDisabledBackground };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{cn as e}from"../../../../../utils/cn.mjs";import{Button as t}from"../../../../ui/button.mjs";import{useUserStore as n}from"../../../../../store/modules/user-store.mjs";import{pUserEditUserInfo as r}from"../../../../../service/generated/client.mjs";import{uploadFile as i}from"../../../../../utils/upload-file.mjs";import{Avatar as a,AvatarFallback as o,AvatarImage as s}from"../../../../ui/avatar.mjs";import{Box as c}from"../../../../ui/box.mjs";import{Input as l}from"../../../../ui/input.mjs";import{Dialog as u,DialogContent as d}from"../../../../ui/dialog.mjs";import{Text as f}from"../../../../ui/text.mjs";import{useDeleteRequest as p}from"../../../../../hooks/query/use-query.mjs";import{ImageCropModal as m}from"../../../../common/image-crop-modal/image-crop-modal.mjs";import{useRef as h,useState as g}from"react";import{Fragment as _,jsx as v,jsxs as y}from"react/jsx-runtime";import{toast as b}from"sonner";
|
|
2
|
+
"use client";import{cn as e}from"../../../../../utils/cn.mjs";import{Button as t}from"../../../../ui/button.mjs";import{useUserStore as n}from"../../../../../store/modules/user-store.mjs";import{pUserEditUserInfo as r}from"../../../../../service/generated/client.mjs";import{uploadFile as i}from"../../../../../utils/upload-file.mjs";import{Avatar as a,AvatarFallback as o,AvatarImage as s}from"../../../../ui/avatar.mjs";import{Box as c}from"../../../../ui/box.mjs";import{Input as l}from"../../../../ui/input.mjs";import{Dialog as u,DialogContent as d}from"../../../../ui/dialog.mjs";import{Text as f}from"../../../../ui/text.mjs";import{useDeleteRequest as p}from"../../../../../hooks/query/use-query.mjs";import{ImageCropModal as m}from"../../../../common/image-crop-modal/image-crop-modal.mjs";import{useRef as h,useState as g}from"react";import{Fragment as _,jsx as v,jsxs as y}from"react/jsx-runtime";import{toast as b}from"sonner";const x=`https://guadd-sg-ccs-sing-dev.s3.ap-southeast-1.amazonaws.com/default/default_avatar.png`,S=[`image/jpeg`,`image/png`];function C(e){let t=e.name.toLowerCase(),n=e.type.toLowerCase();return S.includes(n)||/\.(?:jpg|jpeg|png)$/i.test(t)}function w({isMine:S,src:w,alt:T,onUnauthorizedClick:E}){let D=h(null),{userId:O,setUserInfo:k,userInfo:A}=n(),j=p(),[M,N]=g(!1),[P,F]=g(!1),[I,L]=g(``),[R,z]=g(!1);function B(){if(!R){if(S){N(!0);return}E?.()}}function V(){I&&(URL.revokeObjectURL(I),L(``))}function H(){N(!1)}function U(){R||D.current?.click()}function W(e){let t=e.target.files?.[0];if(t){if(!C(t)){b.error(`仅支持 JPG/JPEG/PNG 格式`),e.target&&(e.target.value=``);return}L(URL.createObjectURL(t)),F(!0),e.target&&(e.target.value=``)}}async function G(e){if(!O){b.error(`请先登录后再试`);return}try{z(!0);let t=await i(new File([e],`avatar.jpg`,{type:`image/jpeg`}),1);await r({user_id:String(O),avatar:t.objectKey}),k({...A,avatar:t.objectKey}),j([`user-profile`,`mine`]),j([`user-edit-info`,String(O)]),N(!1),F(!1),b.success(`更换完成`)}catch(e){console.error(`上传头像失败`,e),b.error(`头像上传失败,请稍后再试`)}finally{V(),z(!1)}}function K(){F(!1),V()}return y(_,{children:[S||E?v(t,{variant:`ghost`,size:`icon`,className:`!absolute bottom-3 left-0 h-22 w-22 rounded-full p-0 hover:bg-transparent`,onClick:B,"aria-label":`打开头像预览`,children:y(a,{className:`w-22 h-22`,children:[v(s,{src:w||x,alt:T||`avatar`}),v(o,{})]})}):y(a,{className:`!absolute bottom-3 left-0 w-22 h-22`,children:[v(s,{src:w||x,alt:T||`avatar`}),v(o,{})]}),v(u,{open:M,onOpenChange:H,children:v(d,{showCloseButton:!1,className:`bg-black !m-0 !p-0 !fixed !inset-0 !w-screen !h-screen !max-w-none !rounded-none !top-0 !left-0 !translate-x-0 !translate-y-0 !transform-none z-[9999] !pointer-events-auto`,children:y(c,{className:`relative flex h-full w-full flex-col items-center justify-center`,children:[v(t,{variant:`ghost`,size:`icon`,className:`absolute left-0 top-0 h-14 w-14 text-white hover:bg-transparent hover:text-white/80`,onClick:H,"aria-label":`关闭头像预览`,children:v(`svg`,{className:`w-4 h-4`,xmlns:`http://www.w3.org/2000/svg`,fill:`currentColor`,viewBox:`0 0 16 16`,children:v(`path`,{d:`M14.55.2a.889.889 0 0 1 1.25 1.25l-.06.067L9.255 8l6.483 6.482.06.069a.888.888 0 0 1-1.25 1.25l-.067-.062L8 9.256l-6.482 6.483A.888.888 0 1 1 .26 14.482L6.742 8 .26 1.517.2 1.45A.888.888 0 0 1 1.45.2l.067.062 6.482 6.482L14.482.261l.068-.062Z`})})}),y(a,{className:`w-50 h-50`,children:[v(s,{src:w||x,alt:T||`avatar`}),v(o,{})]}),y(t,{variant:`ghost`,className:e(`absolute bottom-8 left-0 right-0 mx-auto flex w-[366px] max-w-[90%] items-center justify-between rounded-3xl bg-white/10 px-3 py-3 transition-colors hover:bg-white/20`,`active:scale-95`),onClick:U,disabled:R,children:[v(f,{as:`span`,className:`text-base font-medium text-white`,children:R?`上传中...`:`更换头像`}),y(`svg`,{className:`w-6 h-6 text-white`,xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,children:[v(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M3 9a2 2 0 012-2h.93a2 2 0 001.664-.89l.812-1.22A2 2 0 0110.07 4h3.86a2 2 0 011.664.89l.812 1.22A2 2 0 0018.07 7H19a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V9z`}),v(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M15 13a3 3 0 11-6 0 3 3 0 016 0z`})]})]})]})})}),v(l,{ref:D,type:`file`,accept:`.jpg,.jpeg,.png,image/jpeg,image/png`,className:`hidden`,onChange:W}),v(m,{open:P,onClose:K,imageSrc:I,onConfirm:G})]})}export{w as UserProfileAvatar};
|
package/dist/components/biz/business/profile/profile-header/user-profile-cover-background.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{useUserStore as e}from"../../../../../store/modules/user-store.mjs";import{pUserUploadUserBgImage as t}from"../../../../../service/generated/client.mjs";import{uploadFile as n}from"../../../../../utils/upload-file.mjs";import{Image as r}from"../../../../ui/image.mjs";import{Box as i}from"../../../../ui/box.mjs";import{Input as a}from"../../../../ui/input.mjs";import{useDeleteRequest as o}from"../../../../../hooks/query/use-query.mjs";import{BackgroundPreviewModal as s}from"../../../../common/background-preview-modal/background-preview-modal.mjs";import{showImageCrop as c}from"../../../../common/image-crop/show-image-crop.mjs";import{useEffect as l,useRef as u,useState as d}from"react";import{Fragment as f,jsx as p,jsxs as m}from"react/jsx-runtime";import{toast as h}from"sonner";
|
|
2
|
+
"use client";import{useUserStore as e}from"../../../../../store/modules/user-store.mjs";import{pUserUploadUserBgImage as t}from"../../../../../service/generated/client.mjs";import{uploadFile as n}from"../../../../../utils/upload-file.mjs";import{Image as r}from"../../../../ui/image.mjs";import{Box as i}from"../../../../ui/box.mjs";import{Input as a}from"../../../../ui/input.mjs";import{useDeleteRequest as o}from"../../../../../hooks/query/use-query.mjs";import{BackgroundPreviewModal as s}from"../../../../common/background-preview-modal/background-preview-modal.mjs";import{showImageCrop as c}from"../../../../common/image-crop/show-image-crop.mjs";import{useEffect as l,useRef as u,useState as d}from"react";import{Fragment as f,jsx as p,jsxs as m}from"react/jsx-runtime";import{toast as h}from"sonner";const g=[`image/jpeg`,`image/png`];function _(e){let t=e.name.toLowerCase(),n=e.type.toLowerCase();return g.includes(n)||/\.(?:jpg|jpeg|png)$/i.test(t)}function v({isMine:g,enableCustomBackground:v=!0,src:y,onUnauthorizedClick:b}){let x=`/images/mine/img_mine_head_bg.png`,S=u(null),{userId:C,setUserInfo:w,userInfo:T}=e(),E=o(),[D,O]=d(!1),[k,A]=d(!1),j=v&&(!!g||typeof b==`function`);l(()=>{v||A(!1)},[v]);let M=()=>{if(v){if(g){D||A(!0);return}b?.()}},N=()=>{A(!1)};function P(){D||S.current?.click()}async function F(e){let r=e.target.files?.[0];if(e.target&&(e.target.value=``),r)try{if(!_(r)){h.error(`仅支持 JPG/JPEG/PNG 格式`);return}O(!0);let e=await n(await c(r,{aspectRatio:430/256,cropShape:`rect`,quality:.92,maxWidth:1920,maxHeight:1920}),1);await t({user_id:String(C),bg_image:e.objectKey}),w({...T,bg_image:e.objectKey}),E([`user-profile`,`mine`]),A(!1),h.success(`更换完成`)}catch(e){console.error(`上传背景图失败`,e),e instanceof Error&&e.message!==`用户取消`&&h.error(`背景图上传失败,请稍后再试`)}finally{O(!1)}}return m(f,{children:[p(i,{className:v?`h-33.75`:`h-24`,children:v?p(i,{className:`relative h-full w-full`,onClick:j?M:void 0,children:p(r,{alt:`cover background`,fill:!0,objectFit:`cover`,className:`pointer-events-none`,src:y||x})}):p(i,{className:`h-full w-full bg-bg1`})}),v&&m(f,{children:[p(s,{open:k,onClose:N,bgUrl:y||x,onUpload:P}),p(a,{ref:S,type:`file`,accept:`.jpg,.jpeg,.png,image/jpeg,image/png`,className:`hidden`,onChange:F})]})]})}export{v as UserProfileCoverBackground};
|
|
@@ -11,6 +11,6 @@ declare const profileMainMaterial: DefineMaterialOption<typeof UserProfileMain,
|
|
|
11
11
|
renderer: "renderer";
|
|
12
12
|
editor: "editor";
|
|
13
13
|
}>>;
|
|
14
|
-
}, zod_v4_core0.$strip>, "profile-main"
|
|
14
|
+
}, zod_v4_core0.$strip>, "profile-main">;
|
|
15
15
|
//#endregion
|
|
16
16
|
export { profileMainMaterial };
|
|
@@ -15,6 +15,6 @@ declare const searchHistoryMaterial: DefineMaterialOption<typeof SearchHistorySe
|
|
|
15
15
|
renderer: "renderer";
|
|
16
16
|
editor: "editor";
|
|
17
17
|
}>>;
|
|
18
|
-
}, zod_v4_core0.$strip>, "search-history"
|
|
18
|
+
}, zod_v4_core0.$strip>, "search-history">;
|
|
19
19
|
//#endregion
|
|
20
20
|
export { searchHistoryMaterial };
|
|
@@ -14,6 +14,6 @@ declare const searchInputMaterial: DefineMaterialOption<typeof SearchInputServer
|
|
|
14
14
|
renderer: "renderer";
|
|
15
15
|
editor: "editor";
|
|
16
16
|
}>>;
|
|
17
|
-
}, zod_v4_core0.$strip>, "search-input"
|
|
17
|
+
}, zod_v4_core0.$strip>, "search-input">;
|
|
18
18
|
//#endregion
|
|
19
19
|
export { searchInputMaterial };
|
|
@@ -21,6 +21,6 @@ declare const shortcutGridMaterial: DefineMaterialOption<typeof ShortcutGrid, ty
|
|
|
21
21
|
renderer: "renderer";
|
|
22
22
|
editor: "editor";
|
|
23
23
|
}>>;
|
|
24
|
-
}, zod_v4_core0.$strip>, "shortcut-grid"
|
|
24
|
+
}, zod_v4_core0.$strip>, "shortcut-grid">;
|
|
25
25
|
//#endregion
|
|
26
26
|
export { shortcutGridMaterial };
|
|
@@ -18,7 +18,7 @@ declare const tabBarMaterial: DefineMaterialOption<typeof TabBarServer, typeof T
|
|
|
18
18
|
icon: zod.ZodString & SchemaHasDefaultValue;
|
|
19
19
|
activeIcon: zod.ZodString & SchemaHasDefaultValue;
|
|
20
20
|
configType: zod.ZodType<"function" | "product", unknown, zod_v4_core0.$ZodTypeInternals<"function" | "product", unknown>> & SchemaHasDefaultValue;
|
|
21
|
-
functionPageType: zod.ZodType<"search" | "
|
|
21
|
+
functionPageType: zod.ZodType<"search" | "detail" | "profile" | "content_list", unknown, zod_v4_core0.$ZodTypeInternals<"search" | "detail" | "profile" | "content_list", unknown>> & SchemaHasDefaultValue;
|
|
22
22
|
selectData: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
|
|
23
23
|
mode: zod.ZodOptional<zod.ZodEnum<{
|
|
24
24
|
renderer: "renderer";
|
|
@@ -29,6 +29,6 @@ declare const tabBarMaterial: DefineMaterialOption<typeof TabBarServer, typeof T
|
|
|
29
29
|
renderer: "renderer";
|
|
30
30
|
editor: "editor";
|
|
31
31
|
}>>;
|
|
32
|
-
}, zod_v4_core0.$strip>, "tab-bar"
|
|
32
|
+
}, zod_v4_core0.$strip>, "tab-bar">;
|
|
33
33
|
//#endregion
|
|
34
34
|
export { tabBarMaterial };
|
|
@@ -15,7 +15,7 @@ declare const tabBarInspectorPropsSchema: zod.ZodObject<{
|
|
|
15
15
|
icon: zod.ZodString & SchemaHasDefaultValue;
|
|
16
16
|
activeIcon: zod.ZodString & SchemaHasDefaultValue;
|
|
17
17
|
configType: zod.ZodType<"function" | "product", unknown, zod_v4_core0.$ZodTypeInternals<"function" | "product", unknown>> & SchemaHasDefaultValue;
|
|
18
|
-
functionPageType: zod.ZodType<"search" | "
|
|
18
|
+
functionPageType: zod.ZodType<"search" | "detail" | "profile" | "content_list", unknown, zod_v4_core0.$ZodTypeInternals<"search" | "detail" | "profile" | "content_list", unknown>> & SchemaHasDefaultValue;
|
|
19
19
|
selectData: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
|
|
20
20
|
mode: zod.ZodOptional<zod.ZodEnum<{
|
|
21
21
|
renderer: "renderer";
|
|
@@ -18,6 +18,6 @@ declare const textRecommendMaterial: DefineMaterialOption<typeof TextRecommendSe
|
|
|
18
18
|
renderer: "renderer";
|
|
19
19
|
editor: "editor";
|
|
20
20
|
}>>;
|
|
21
|
-
}, zod_v4_core0.$strip>, "text-recommend"
|
|
21
|
+
}, zod_v4_core0.$strip>, "text-recommend">;
|
|
22
22
|
//#endregion
|
|
23
23
|
export { textRecommendMaterial };
|
|
@@ -38,6 +38,6 @@ declare const videoHorizontalListMaterial: DefineMaterialOption<typeof VideoHori
|
|
|
38
38
|
renderer: "renderer";
|
|
39
39
|
editor: "editor";
|
|
40
40
|
}>>;
|
|
41
|
-
}, zod_v4_core0.$strip>, "video-horizontal-list"
|
|
41
|
+
}, zod_v4_core0.$strip>, "video-horizontal-list">;
|
|
42
42
|
//#endregion
|
|
43
43
|
export { videoHorizontalListMaterial };
|
|
@@ -23,6 +23,6 @@ declare const exampleButtonMaterial: DefineMaterialOption<typeof Button, typeof
|
|
|
23
23
|
renderer: "renderer";
|
|
24
24
|
editor: "editor";
|
|
25
25
|
}>>;
|
|
26
|
-
}, zod_v4_core0.$strip>, "example-button"
|
|
26
|
+
}, zod_v4_core0.$strip>, "example-button">;
|
|
27
27
|
//#endregion
|
|
28
28
|
export { exampleButtonMaterial };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{defineMaterial as e}from"../../../../utils/schema/material.mjs";import{ButtonClient as t}from"./client.mjs";import{buttonInspectorPropsSchema as n}from"./schema.mjs";import{Button as r}from"./server.mjs";const i=e({type:`example-button`,name:`按钮`,icon:`/icon/button.png`,category
|
|
2
|
+
import{defineMaterial as e}from"../../../../utils/schema/material.mjs";import{ButtonClient as t}from"./client.mjs";import{buttonInspectorPropsSchema as n}from"./schema.mjs";import{Button as r}from"./server.mjs";const i=e({type:`example-button`,name:`按钮`,icon:`/icon/button.png`,category:`TOP`,serverComponent:r,clientComponent:t,propsSchema:n});export{i as exampleButtonMaterial};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import e from"../../business/banner/variants/basic-banner/runtime/client.mjs";import{schema as t}from"../../business/banner/variants/basic-banner/schema/index.mjs";import n from"../../business/feature-grid/variants/basic-feature-grid/runtime/client.mjs";import{schema as r}from"../../business/feature-grid/variants/basic-feature-grid/schema/index.mjs";import i from"../../business/fullscreen-feed/variants/fullscreen-post-feed/runtime/client.mjs";import{schema as a}from"../../business/fullscreen-feed/variants/fullscreen-post-feed/schema/index.mjs";import o from"../../business/fullscreen-feed/variants/fullscreen-video-feed/runtime/client.mjs";import{schema as s}from"../../business/fullscreen-feed/variants/fullscreen-video-feed/schema/index.mjs";import c from"../../business/home-recommend/variants/home-recommend-grid/runtime/client.mjs";import{schema as l}from"../../business/home-recommend/variants/home-recommend-grid/schema/index.mjs";import u from"../../business/home-recommend/variants/home-recommend-waterfall/runtime/client.mjs";import{schema as d}from"../../business/home-recommend/variants/home-recommend-waterfall/schema/index.mjs";import f from"../../business/post-card/variants/basic-post-card/runtime/client.mjs";import{schema as p}from"../../business/post-card/variants/basic-post-card/schema/index.mjs";import m from"../../business/recommended-users/variants/basic-recommended-users/runtime/client.mjs";import{schema as h}from"../../business/recommended-users/variants/basic-recommended-users/schema/index.mjs";let g=function(e){return e[e.Banner=1]=`Banner`,e[e.CardGrid=2]=`CardGrid`,e[e.FeatureGrid=3]=`FeatureGrid`,e[e.RecommendedUsers=4]=`RecommendedUsers`,e}({});const _={[g.Banner]:{schemaName:`BasicBannerSchema`,componentName:`BasicBanner`},[g.FeatureGrid]:{schemaName:`BasicFeatureGridSchema`,componentName:`BasicFeatureGrid`},[g.RecommendedUsers]:{schemaName:`BasicRecommendedUsersSchema`,componentName:`BasicRecommendedUsers`}},v={1:{schemaName:`HomeRecommendGridSchema`,componentName:`HomeRecommendGrid`},2:{schemaName:`HomeRecommendWaterfallSchema`,componentName:`HomeRecommendWaterfall`},3:{schemaName:`HomeRecommendGridSchema`,componentName:`HomeRecommendGrid`},4:{schemaName:`HomeRecommendGridSchema`,componentName:`HomeRecommendGrid`},5:{schemaName:`HomeRecommendWaterfallSchema`,componentName:`HomeRecommendWaterfall`},6:{schemaName:`FullscreenVideoFeedSchema`,componentName:`FullscreenVideoClient`}},y={schemaName:`HomeRecommendGridSchema`,componentName:`HomeRecommendGrid`},b={6:{schemaName:`FullscreenPostFeedSchema`,componentName:`FullscreenFeedClient`}},x={schemaName:`BasicPostCardSchema`,componentName:`BasicPostCard`},S={BasicBannerSchema:t,BasicFeatureGridSchema:r,BasicPostCardSchema:p,BasicRecommendedUsersSchema:h,FullscreenPostFeedSchema:a,FullscreenVideoFeedSchema:s,HomeRecommendGridSchema:l,HomeRecommendWaterfallSchema:d},C={BasicBanner:e,BasicFeatureGrid:n,BasicPostCard:f,BasicRecommendedUsers:m,FullscreenFeedClient:i,FullscreenVideoClient:o,HomeRecommendGrid:c,HomeRecommendWaterfall:u};function w(e,t){return e.type===g.CardGrid?t?v[e.show_style]??y:b[e.show_style]??x:_[e.type]}function T(e,t){let n=w(e,t),r=S[n.schemaName];if(!r)return console.warn(`[extractDataByComponentType] 未找到 Schema: ${n.schemaName}`),null;let i=C[n.componentName];if(!i)return console.warn(`[extractDataByComponentType] 未找到组件: ${n.componentName}`),null;let a=r.dataSchema?.dataBinding?.field;if(!a)return console.warn(`[extractDataByComponentType] Schema ${n.schemaName} 缺少 dataBinding.field`),null;let o=e.data?.[a],s=Array.isArray(o)?o:[],c={component:i,data:{title:e.cn_name,list:s,icons:e.data?.icons??[],block_id:String(e.id??``),channel_id:String(e.channel_id??``),show_style:e.show_style}};return e.data?.cursor&&(c.data.cursor=String(e.data?.cursor??``)),e.show_style===6&&(c.data.bottom=56,c.data.top=42),c}function E(e,t){return!Array.isArray(e)||e.length===0?[]:e.map(e=>T(e,t)).filter(e=>e!==null)}export{g as ComponentType,E as extractDataByComponentType};
|
|
2
|
+
import e from"../../business/banner/variants/basic-banner/runtime/client.mjs";import{schema as t}from"../../business/banner/variants/basic-banner/schema/index.mjs";import n from"../../business/feature-grid/variants/basic-feature-grid/runtime/client.mjs";import{schema as r}from"../../business/feature-grid/variants/basic-feature-grid/schema/index.mjs";import i from"../../business/fullscreen-feed/variants/fullscreen-post-feed/runtime/client.mjs";import{schema as a}from"../../business/fullscreen-feed/variants/fullscreen-post-feed/schema/index.mjs";import o from"../../business/fullscreen-feed/variants/fullscreen-video-feed/runtime/client.mjs";import{schema as s}from"../../business/fullscreen-feed/variants/fullscreen-video-feed/schema/index.mjs";import c from"../../business/home-recommend/variants/home-recommend-grid/runtime/prefetch-client.mjs";import{schema as l}from"../../business/home-recommend/variants/home-recommend-grid/schema/index.mjs";import u from"../../business/home-recommend/variants/home-recommend-waterfall/runtime/prefetch-client.mjs";import{schema as d}from"../../business/home-recommend/variants/home-recommend-waterfall/schema/index.mjs";import f from"../../business/post-card/variants/basic-post-card/runtime/client.mjs";import{schema as p}from"../../business/post-card/variants/basic-post-card/schema/index.mjs";import m from"../../business/recommended-users/variants/basic-recommended-users/runtime/client.mjs";import{schema as h}from"../../business/recommended-users/variants/basic-recommended-users/schema/index.mjs";let g=function(e){return e[e.Banner=1]=`Banner`,e[e.CardGrid=2]=`CardGrid`,e[e.FeatureGrid=3]=`FeatureGrid`,e[e.RecommendedUsers=4]=`RecommendedUsers`,e}({});const _={[g.Banner]:{schemaName:`BasicBannerSchema`,componentName:`BasicBanner`},[g.FeatureGrid]:{schemaName:`BasicFeatureGridSchema`,componentName:`BasicFeatureGrid`},[g.RecommendedUsers]:{schemaName:`BasicRecommendedUsersSchema`,componentName:`BasicRecommendedUsers`}},v={1:{schemaName:`HomeRecommendGridSchema`,componentName:`HomeRecommendGrid`},2:{schemaName:`HomeRecommendWaterfallSchema`,componentName:`HomeRecommendWaterfall`},3:{schemaName:`HomeRecommendGridSchema`,componentName:`HomeRecommendGrid`},4:{schemaName:`HomeRecommendGridSchema`,componentName:`HomeRecommendGrid`},5:{schemaName:`HomeRecommendWaterfallSchema`,componentName:`HomeRecommendWaterfall`},6:{schemaName:`FullscreenVideoFeedSchema`,componentName:`FullscreenVideoClient`}},y={schemaName:`HomeRecommendGridSchema`,componentName:`HomeRecommendGrid`},b={6:{schemaName:`FullscreenPostFeedSchema`,componentName:`FullscreenFeedClient`}},x={schemaName:`BasicPostCardSchema`,componentName:`BasicPostCard`},S={BasicBannerSchema:t,BasicFeatureGridSchema:r,BasicPostCardSchema:p,BasicRecommendedUsersSchema:h,FullscreenPostFeedSchema:a,FullscreenVideoFeedSchema:s,HomeRecommendGridSchema:l,HomeRecommendWaterfallSchema:d},C={BasicBanner:e,BasicFeatureGrid:n,BasicPostCard:f,BasicRecommendedUsers:m,FullscreenFeedClient:i,FullscreenVideoClient:o,HomeRecommendGrid:c,HomeRecommendWaterfall:u};function w(e,t){return e.type===g.CardGrid?t?v[e.show_style]??y:b[e.show_style]??x:_[e.type]}function T(e,t){let n=w(e,t),r=S[n.schemaName];if(!r)return console.warn(`[extractDataByComponentType] 未找到 Schema: ${n.schemaName}`),null;let i=C[n.componentName];if(!i)return console.warn(`[extractDataByComponentType] 未找到组件: ${n.componentName}`),null;let a=r.dataSchema?.dataBinding?.field;if(!a)return console.warn(`[extractDataByComponentType] Schema ${n.schemaName} 缺少 dataBinding.field`),null;let o=e.data?.[a],s=Array.isArray(o)?o:[],c={component:i,data:{title:e.cn_name,list:s,icons:e.data?.icons??[],block_id:String(e.id??``),channel_id:String(e.channel_id??``),show_style:e.show_style}};return e.data?.cursor&&(c.data.cursor=String(e.data?.cursor??``)),e.show_style===6&&(c.data.bottom=56,c.data.top=42),c}function E(e,t){return!Array.isArray(e)||e.length===0?[]:e.map(e=>T(e,t)).filter(e=>e!==null)}export{g as ComponentType,E as extractDataByComponentType};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{Image as e}from"../../ui/image.mjs";import{Box as t}from"../../ui/box.mjs";import n from"./style.module.mjs";import{jsx as r,jsxs as i}from"react/jsx-runtime";import a from"next/link";function o({url:o,text:s,showText:c=!0,imagePriority:l=!1,className:u,style:d,textChild:f,topChild:p,bottomChild:m,topLeftChild:h,topRightChild:g,bottomLeftChild:_,bottomRightChild:v,linkPath:y=``,onClick:b}){return i(a,{href:y||`javascript:void(0)`,className:`
|
|
2
|
+
"use client";import{Image as e}from"../../ui/image.mjs";import{Box as t}from"../../ui/box.mjs";import n from"./style.module.mjs";import{jsx as r,jsxs as i}from"react/jsx-runtime";import a from"next/link";function o({url:o,text:s,showText:c=!0,imagePriority:l=!1,className:u,style:d,textChild:f,topChild:p,bottomChild:m,topLeftChild:h,topRightChild:g,bottomLeftChild:_,bottomRightChild:v,linkPath:y=``,onClick:b}){let x={width:`33.333333%`,...d};return i(a,{href:y||`javascript:void(0)`,className:`mb-[16px] ${n.miniThreeCard} ${u||``}`,style:x,suppressHydrationWarning:!0,onClick:e=>{y||e.preventDefault(),b?.()},children:[i(t,{className:`w-full pb-[134.62%] bg-bg2 relative rounded-[8px] flex flex-col items-start justify-between overflow-hidden`,children:[r(e,{src:o,fill:!0,alt:s||``,objectFit:`cover`,priority:l}),p||(h||g)&&i(t,{className:`w-full flex items-center justify-between absolute top-0 left-0 z-[1]`,children:[h||r(t,{}),g||r(t,{})]}),m||(_||v)&&i(t,{className:`w-full h-[28px] flex items-center justify-between absolute bottom-0 left-0 z-[1]`,style:{background:`linear-gradient( 360deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%)`},children:[_||r(t,{}),v||r(t,{})]})]}),c&&(f||r(`h3`,{className:`text-text1 text-[16px] h-[24px] leading-[24px] mt-[4px] line-clamp-1`,children:s||``}))]})}export{o as MiniThreeCard};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{useFollowIdsState as e}from"../../../../../store/modules/follow-ids-store.mjs";import{useUserStore as t}from"../../../../../store/modules/user-store.mjs";import{pInteractionFollow as n,pInteractionUnfollow as r}from"../../../../../service/generated/client.mjs";import{useEffect as i,useState as a}from"react";import{Fragment as o,jsx as s}from"react/jsx-runtime";import{useTranslations as c}from"next-intl";function l(l){let u=c(`components.pages.follow.components.followButton`),{userId:d,hasFollow:f,followText:p=``,onChange:m}=l,h=p||u(`follow`),[g,_]=a(f),{isLogin:v,userInfo:y,userId:b}=t(),{followIds:x}=e(),S=b||y?.userId||``,C=y?.userId===d,w=f||x.includes(d);i(()=>{_(w)},[w]);async function T(){
|
|
2
|
+
"use client";import{useFollowIdsState as e}from"../../../../../store/modules/follow-ids-store.mjs";import{useUserStore as t}from"../../../../../store/modules/user-store.mjs";import{pInteractionFollow as n,pInteractionUnfollow as r}from"../../../../../service/generated/client.mjs";import{useEffect as i,useState as a}from"react";import{Fragment as o,jsx as s}from"react/jsx-runtime";import{useTranslations as c}from"next-intl";function l(l){let u=c(`components.pages.follow.components.followButton`),{userId:d,hasFollow:f,followText:p=``,onChange:m}=l,h=p||u(`follow`),[g,_]=a(f),{isLogin:v,userInfo:y,userId:b}=t(),{followIds:x}=e(),S=b||y?.userId||``,C=y?.userId===d,w=f||x.includes(d);i(()=>{_(w)},[w]);async function T(){try{g?await r({follower_id:S,followee_id:d}):await n({follower_id:S,followee_id:d}),window.sensors?.track(`detail_follow_click`,{object_id:``,action:g?`取消关注`:`关注`,author_id:d}),sessionStorage.setItem(`user_page_refresh`,`1`)}catch(e){console.error(`关注或取消关注失败:`,e)}_(!g),m?.(!g)}function E(){T(),v&&(g||T())}return C?null:s(`button`,{className:` h-7 rounded-full px-4 py-1.5 border border-solid cursor-pointer flex items-center justify-center ${g?`border-text3`:`border-theme5`}`,onClick:()=>E(),children:g?s(o,{children:s(`span`,{className:`text-text3 text-xs leading-4.5 ml-1 shrink-0`,children:u(`following`)})}):s(o,{children:s(`span`,{className:`block text-theme5 text-xs leading-4.5 ml-1 shrink-0`,children:h})})})}export{l as FollowButton};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{Button as e}from"../../ui/button.mjs";import{getCookie as t,hashPassword as n}from"../../../utils/common.mjs";import{pUserRegister as r,pUserResetForgetPassword as i,pUserResetPassword as a}from"../../../service/generated/client.mjs";import{
|
|
2
|
+
"use client";import{Button as e}from"../../ui/button.mjs";import{getCookie as t,hashPassword as n}from"../../../utils/common.mjs";import{pUserRegister as r,pUserResetForgetPassword as i,pUserResetPassword as a}from"../../../service/generated/client.mjs";import{Box as o}from"../../ui/box.mjs";import{Input as s}from"../../ui/input.mjs";import{Text as c}from"../../ui/text.mjs";import{useLoginModalStore as l}from"../../../store/modules/login-modal-store.mjs";import{useSetAuthFields as u,useUserId as d}from"../../../hooks/use-auth.mjs";import{LeftArrowIcon as f}from"../../../assets/icons/left-arrow-icon.mjs";import{EyeIcon as p}from"../../../assets/icons/eye-icon.mjs";import{EyeOffIcon as m}from"../../../assets/icons/eye-off-icon.mjs";import{useCallback as h,useMemo 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(S){let C=x(`components.pages.login`),{email:w,onClose:T}=S,E=u(),D=d(),{resolveLogin:O}=l(),[k,A]=_(``),[j,M]=_(``),[N,P]=_(!1),[F,I]=_(!1),[L,R]=_(!1),[z,B]=_(``),{verifyStep:V}=l(),H=h(async()=>{let e=n(k);return V===`reset-password`?await a({user_id:D,password:e}):V===`forgot-password`?await i({email:w,password:e}):await r({email:w,user_id:await t(`guestUserId`),password:e})},[V,D,w,k]),U=g(()=>k.length===0||j.length===0?``:k.length<6?C(`password.passwordTooShort`):k.length>18?C(`password.passwordTooLong`):k===j?``:C(`password.passwordsNotMatch`),[k,j,C]),W=g(()=>k.length>=6&&k.length<=18&&k===j&&!L,[k,j,L]);async function G(){if(W)try{R(!0),B(``);let{data:e}=await H();e?.user_id&&(E({token:e.token,expireTime:e.expire_time,userId:e.user_id}),b.success(C(`password.passwordSetSuccess`))),O(!0)}catch(e){B(e.message??C(`password.submitFailed`))}finally{R(!1)}}let K=C(V===`reset-password`?`password.confirmModify`:V===`forgot-password`?`password.confirmReset`:`password.register`),q=C(V===`reset-password`||V===`forgot-password`?`password.setNewPassword`:`password.setLoginPassword`);return y(o,{className:`min-h-screen w-full h-full bg-bg1 text-text1 flex flex-col`,children:[y(o,{className:`flex justify-between items-center h-[60px] px-[16px]`,children:[v(e,{type:`button`,onClick:T,"aria-label":C(`password.back`),className:`cursor-pointer bg-transparent !p-0 !px-0 !py-0`,children:v(f,{className:`w-[16px] h-[16px] text-text1/80`,"aria-hidden":`true`,focusable:`false`})}),v(c,{className:`text-[14px] text-text2`})]}),y(o,{className:`px-[24px] flex flex-col mt-[15px]`,children:[v(o,{className:`flex flex-col`,children:v(c,{className:`text-[24px] leading-[32px] font-bold`,children:q})}),y(`form`,{className:`mt-[58px]`,autoComplete:`off`,onSubmit:e=>{e.preventDefault(),G()},children:[y(o,{className:`space-y-[16px]`,children:[y(o,{className:`flex items-center justify-between px-[28px] rounded-[50px] h-[66px] bg-line1 border border-line1`,children:[v(s,{placeholder:C(`password.passwordPlaceholder`),type:N?`text`:`password`,name:`funhub-password`,value:k,onChange:e=>A(e.target.value),autoComplete:`new-password`,autoCorrect:`off`,autoCapitalize:`none`,spellCheck:!1,"data-lpignore":`true`,"data-1p-ignore":`true`,"data-form-type":`other`,className:`flex-1 !bg-transparent !px-0 !py-0 !rounded-none !text-text1 placeholder:!text-text3 leading-[26px] text-[18px]`}),v(e,{type:`button`,onClick:()=>P(!N),className:`ml-[10px] cursor-pointer bg-transparent !p-0 !px-0 !py-0`,children:v(N?p:m,{className:`w-[20px] h-[20px] text-text3`})})]}),y(o,{className:`flex items-center justify-between px-[28px] rounded-[50px] h-[66px] bg-line1 border border-line1`,children:[v(s,{placeholder:C(`password.confirmPasswordPlaceholder`),type:F?`text`:`password`,name:`funhub-confirm-password`,value:j,onChange:e=>M(e.target.value),autoComplete:`new-password`,autoCorrect:`off`,autoCapitalize:`none`,spellCheck:!1,"data-lpignore":`true`,"data-1p-ignore":`true`,"data-form-type":`other`,className:`flex-1 !bg-transparent !px-0 !py-0 !rounded-none !text-text1 placeholder:!text-text3 leading-[26px] text-[18px]`}),v(e,{type:`button`,onClick:()=>I(!F),className:`ml-[10px] cursor-pointer bg-transparent !p-0 !px-0 !py-0`,children:v(F?p:m,{className:`w-[20px] h-[20px] text-text3`})})]})]}),v(o,{className:`h-[22px] mt-[16px] mb-[22px] ml-[12px] text-[14px] text-theme5`,children:U||z}),v(e,{type:`submit`,disabled:!W,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:L?C(`password.submitting`):K})]})]})]})}export{S as Password};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{Button as e}from"../../ui/button.mjs";import{pUserSendEmailCode as t}from"../../../service/generated/client.mjs";import{Box as n}from"../../ui/box.mjs";import{
|
|
2
|
+
"use client";import{Button as e}from"../../ui/button.mjs";import{pUserSendEmailCode as t}from"../../../service/generated/client.mjs";import{Box as n}from"../../ui/box.mjs";import{Input as r}from"../../ui/input.mjs";import{Text as i}from"../../ui/text.mjs";import{useLoginModalStore as a}from"../../../store/modules/login-modal-store.mjs";import{LeftArrowIcon as o}from"../../../assets/icons/left-arrow-icon.mjs";import{useMemo as s,useState as c}from"react";import{jsx as l,jsxs as u}from"react/jsx-runtime";import{useTranslations as d}from"next-intl";function f(f){let p=d(`components.pages.login`),{onClose:m,onLogin:h,onVerify:g}=f,{setVerifyStep:_}=a(),[v,y]=c(``),[b,x]=c(!1),[S,C]=c(``),w=s(()=>v.trim().length>0&&!b,[v,b]);function T(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)}function E(e){y(e),S&&C(``)}async function D(){if(w)try{x(!0),C(``);let e=v.trim();if(!T(e)){C(p(`register.invalidEmail`));return}await t({email:e}),_(`register-verify`),g?.(e)}catch(e){C(e.message??p(`register.sendFailed`))}finally{x(!1)}}return u(n,{className:`min-h-screen w-full h-full bg-bg1 text-text1 flex flex-col`,children:[u(n,{className:`flex justify-between items-center h-[60px] px-[16px]`,children:[l(e,{type:`button`,onClick:m,"aria-label":p(`register.back`),className:`cursor-pointer bg-transparent !p-0 !px-0 !py-0`,children:l(o,{className:`w-[16px] h-[16px] text-text1/80`,"aria-hidden":`true`,focusable:`false`})}),l(i,{className:`text-[14px] text-text2`})]}),u(n,{className:`px-[24px] flex flex-col mt-[15px]`,children:[u(n,{className:`flex flex-col`,children:[l(i,{className:`text-[24px] leading-[32px] font-bold`,children:p(`register.title`)}),u(i,{className:`text-[14px] leading-[22px] mt-[12px] text-text1/80`,children:[p(`register.hasAccount`),`?`,l(e,{type:`button`,onClick:h,className:`cursor-pointer text-theme5 hover:opacity-90 bg-transparent !p-0 !px-0 !py-0`,children:p(`register.loginLink`)})]})]}),u(n,{className:`mt-[38px]`,children:[l(n,{className:`flex items-center px-[28px] rounded-[50px] h-[66px] bg-line1 border border-line1`,children:l(r,{placeholder:p(`register.emailPlaceholder`),type:`email`,name:`funhub-register-email`,value:v,onChange:e=>E(e.target.value),autoComplete:`off`,autoCorrect:`off`,autoCapitalize:`none`,spellCheck:!1,"data-lpignore":`true`,"data-1p-ignore":`true`,"data-form-type":`other`,className:`!bg-transparent !px-0 !py-0 !rounded-none !text-text1 placeholder:!text-text3 leading-[26px] text-[18px]`})}),l(n,{className:`h-[22px] mt-[16px] mb-[22px] ml-[12px] text-[14px] text-theme5`,children:S}),l(e,{type:`button`,onClick:D,disabled:!w,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:p(b?`register.sending`:`register.getCode`)})]})]})]})}export{f as Register};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{Button as e}from"../../ui/button.mjs";import{pUserSendResetPasswordEmailCode as t,pUserVerifyResetPasswordEmailCode as n}from"../../../service/generated/client.mjs";import{Box as r}from"../../ui/box.mjs";import{Input as i}from"../../ui/input.mjs";import{Text as a}from"../../ui/text.mjs";import{useLoginModalStore as o}from"../../../store/modules/login-modal-store.mjs";import{useUserId as s,useUserInfo as c}from"../../../hooks/use-auth.mjs";import{LeftArrowIcon as l}from"../../../assets/icons/left-arrow-icon.mjs";import{useEffect as u,useMemo as d,useState as f}from"react";import{jsx as p,jsxs as m}from"react/jsx-runtime";import{useTranslations as h}from"next-intl";function g(e){let[t,n]=e.split(`@`);return!t||!n?e:`${t.slice(0,3)}***${t.length>3?t.slice(-1):``}@${n}`}function _(_){let v=h(`components.pages.login`),{onClose:y,onPassword:b}=_,x=s(),S=c(),{setVerifyStep:C}=o(),[w,T]=f(``),[E,D]=f(0),[O,k]=f(!1),[A,j]=f(!1),[M,N]=f(``),P=d(()=>{let e=S;return e?.email||e?.mail||``},[S]),F=d(()=>P?g(P):``,[P]);u(()=>{C(`reset-password`)},[C]),u(()=>{if(E<=0)return;let e=setInterval(()=>{D(e=>e-1)},1e3);return()=>clearInterval(e)},[E]);let I=d(()=>w.trim().length>=6&&!A,[w,A]);function L(e){T(e.replace(/\D/g,``))}function R(e){e.preventDefault(),B()}async function z(){if(!(!x||O||E>0))try{k(!0),N(``),await t({user_id:x}),D(60)}catch(e){N(e.message??v(`resetPassword.sendFailed`))}finally{k(!1)}}async function B(){if(!(!I||!x))try{j(!0),N(``),await n({user_id:x,email_code:w.trim()}),b?.(P)}catch(e){N(e.message??v(`resetPassword.verifyFailed`))}finally{j(!1)}}return m(r,{className:`min-h-screen w-full h-full bg-bg1 text-text1 flex flex-col`,children:[m(r,{className:`flex items-center h-[60px] px-[16px]`,children:[p(e,{type:`button`,onClick:y,"aria-label":v(`resetPassword.back`),className:`cursor-pointer bg-transparent !p-0 !px-0 !py-0`,children:p(l,{className:`w-[16px] h-[16px] text-text1/80`,"aria-hidden":`true`,focusable:`false`})}),p(a,{className:`flex-1 text-center text-[16px] font-semibold`,children:v(`resetPassword.title`)}),p(r,{className:`w-[16px]`,"aria-hidden":`true`})]}),m(r,{className:`px-[24px] flex flex-col mt-[24px]`,children:[m(a,{className:`text-[14px] leading-[22px] text-text1/80`,children:[v(`resetPassword.verifyViaEmail`),F?` ${F} `:` `,v(`resetPassword.verifyHint`)]}),
|
|
2
|
+
"use client";import{Button as e}from"../../ui/button.mjs";import{pUserSendResetPasswordEmailCode as t,pUserVerifyResetPasswordEmailCode as n}from"../../../service/generated/client.mjs";import{Box as r}from"../../ui/box.mjs";import{Input as i}from"../../ui/input.mjs";import{Text as a}from"../../ui/text.mjs";import{useLoginModalStore as o}from"../../../store/modules/login-modal-store.mjs";import{useUserId as s,useUserInfo as c}from"../../../hooks/use-auth.mjs";import{LeftArrowIcon as l}from"../../../assets/icons/left-arrow-icon.mjs";import{useEffect as u,useMemo as d,useState as f}from"react";import{jsx as p,jsxs as m}from"react/jsx-runtime";import{useTranslations as h}from"next-intl";function g(e){let[t,n]=e.split(`@`);return!t||!n?e:`${t.slice(0,3)}***${t.length>3?t.slice(-1):``}@${n}`}function _(_){let v=h(`components.pages.login`),{onClose:y,onPassword:b}=_,x=s(),S=c(),{setVerifyStep:C}=o(),[w,T]=f(``),[E,D]=f(0),[O,k]=f(!1),[A,j]=f(!1),[M,N]=f(``),P=d(()=>{let e=S;return e?.email||e?.mail||``},[S]),F=d(()=>P?g(P):``,[P]);u(()=>{C(`reset-password`)},[C]),u(()=>{if(E<=0)return;let e=setInterval(()=>{D(e=>e-1)},1e3);return()=>clearInterval(e)},[E]);let I=d(()=>w.trim().length>=6&&!A,[w,A]);function L(e){T(e.replace(/\D/g,``))}function R(e){e.preventDefault(),B()}async function z(){if(!(!x||O||E>0))try{k(!0),N(``),await t({user_id:x}),D(60)}catch(e){N(e.message??v(`resetPassword.sendFailed`))}finally{k(!1)}}async function B(){if(!(!I||!x))try{j(!0),N(``),await n({user_id:x,email_code:w.trim()}),b?.(P)}catch(e){N(e.message??v(`resetPassword.verifyFailed`))}finally{j(!1)}}return m(r,{className:`min-h-screen w-full h-full bg-bg1 text-text1 flex flex-col`,children:[m(r,{className:`flex items-center h-[60px] px-[16px]`,children:[p(e,{type:`button`,onClick:y,"aria-label":v(`resetPassword.back`),className:`cursor-pointer bg-transparent !p-0 !px-0 !py-0`,children:p(l,{className:`w-[16px] h-[16px] text-text1/80`,"aria-hidden":`true`,focusable:`false`})}),p(a,{className:`flex-1 text-center text-[16px] font-semibold`,children:v(`resetPassword.title`)}),p(r,{className:`w-[16px]`,"aria-hidden":`true`})]}),m(r,{className:`px-[24px] flex flex-col mt-[24px]`,children:[m(a,{className:`text-[14px] leading-[22px] text-text1/80`,children:[v(`resetPassword.verifyViaEmail`),F?` ${F} `:` `,v(`resetPassword.verifyHint`)]}),m(`form`,{className:`mt-[36px]`,autoComplete:`off`,onSubmit:R,children:[m(r,{className:`flex items-center justify-between px-[20px] rounded-[50px] h-[56px] bg-line1 border border-line1`,children:[p(i,{placeholder:v(`resetPassword.codePlaceholder`),type:`text`,name:`funhub-reset-password-code`,value:w,onChange:e=>L(e.target.value),inputMode:`numeric`,autoComplete:`one-time-code`,autoCorrect:`off`,autoCapitalize:`none`,spellCheck:!1,"data-lpignore":`true`,"data-1p-ignore":`true`,"data-form-type":`other`,className:`flex-1 !bg-transparent !px-0 !py-0 !rounded-none !text-text1 placeholder:!text-text3 leading-[24px] text-[16px]`}),p(e,{type:`button`,onClick:z,disabled:O||E>0,className:`ml-[12px] cursor-pointer text-theme5 !p-0 !px-0 !py-0 disabled:text-text3`,children:E>0?v(`resetPassword.resend`,{countdown:E}):v(`resetPassword.sendCode`)})]}),p(r,{className:`h-[22px] mt-[16px] mb-[22px] ml-[12px] text-[14px] text-theme5`,children:M}),p(e,{type:`submit`,disabled:!I,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:v(A?`resetPassword.verifying`:`resetPassword.verifyEmail`)})]})]})]})}export{_ as ResetPassword};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{Button as e}from"../../ui/button.mjs";import{pUserSendEmailCode as t,pUserSendResetPasswordEmailCode as n,pUserVerifyEmailCode as r,pUserVerifyForgetEmailCode as i,pUserVerifyResetPasswordEmailCode as a}from"../../../service/generated/client.mjs";import{Box as o}from"../../ui/box.mjs";import{Text as s}from"../../ui/text.mjs";import{useLoginModalStore as c}from"../../../store/modules/login-modal-store.mjs";import{useUserId as l}from"../../../hooks/use-auth.mjs";import{LeftArrowIcon as u}from"../../../assets/icons/left-arrow-icon.mjs";import{useCallback as d,useEffect as f,useMemo as p,useRef as m,useState as h}from"react";import{jsx as g,jsxs as _}from"react/jsx-runtime";import{useTranslations as v}from"next-intl";function y(e){let[t,n]=e.split(`@`);return!t||!n?e:`${t.slice(0,3)}***${t.length>3?t.slice(-1):``}@${n}`}function b(b){let x=v(`components.pages.login`),{email:S,onClose:C,onPassword:w}=b,{verifyStep:T}=c(),[E,D]=h([,,,,,,].fill(``)),[O,k]=h(0),[A,j]=h(!1),[M,N]=h(60),[P,F]=h(!1),[I,L]=h(``),R=m(null),z=l(),B=p(()=>y(S),[S]),V=d(async()=>T===`reset-password`?await a({user_id:z,email_code:E.join(``)}):T===`forgot-password`?await i({email:S,email_code:E.join(``)}):await r({email:S,email_code:E.join(``)}),[T,E,z,S]),H=p(()=>E.every(e=>e!==``)&&!A,[E,A]);f(()=>{if(M<=0)return;let e=setInterval(()=>{N(e=>e-1)},1e3);return()=>clearInterval(e)},[M]),f(()=>{R.current?.focus()},[]);let U=d(e=>{let t=e.target.value.replace(/\D/g,``);if(t.length===0)return;let n=[...E],r=t.split(``),i=O;for(let e of r)i<6&&(n[i]=e,i++);D(n),k(Math.min(i,5)),L(``)},[E,O]),W=d(e=>{if(e.key===`Backspace`){e.preventDefault();let t=[...E];E[O]?t[O]=``:O>0&&(t[O-1]=``,k(O-1)),D(t),L(``)}else e.key===`ArrowLeft`&&O>0?k(O-1):e.key===`ArrowRight`&&O<5&&k(O+1)},[E,O]),G=d(e=>{k(e),R.current?.focus()},[]);async function K(){if(!(M>0||P))try{F(!0),T===`reset-password`?await n({user_id:z}):await t({email:S}),N(60),L(``)}finally{F(!1)}}async function q(){if(H)try{j(!0),await V(),w?.(S)}catch(e){L(e.message??x(`verify.invalidCode`))}finally{j(!1)}}return _(o,{className:`min-h-screen w-full h-full bg-bg1 text-text1 flex flex-col`,children:[_(o,{className:`flex justify-between items-center h-[60px] px-[16px]`,children:[g(e,{type:`button`,onClick:C,"aria-label":x(`verify.back`),className:`cursor-pointer bg-transparent !p-0 !px-0 !py-0`,children:g(u,{className:`w-[16px] h-[16px] text-text1/80`,"aria-hidden":`true`,focusable:`false`})}),g(s,{className:`text-[14px] text-text2`})]}),_(o,{className:`px-[24px] flex flex-col mt-[15px]`,children:[_(o,{className:`flex flex-col`,children:[g(s,{className:`text-[24px] leading-[32px] font-bold`,children:x(`verify.title`)}),_(o,{className:`mt-[12px] flex items-center`,children:[_(s,{className:`text-[14px] leading-[14px] text-text1/80`,children:[x(`verify.sentTo`),` `,B]}),g(e,{type:`button`,onClick:K,disabled:M>0||P,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:M>0
|
|
2
|
+
"use client";import{Button as e}from"../../ui/button.mjs";import{pUserSendEmailCode as t,pUserSendResetPasswordEmailCode as n,pUserVerifyEmailCode as r,pUserVerifyForgetEmailCode as i,pUserVerifyResetPasswordEmailCode as a}from"../../../service/generated/client.mjs";import{Box as o}from"../../ui/box.mjs";import{Text as s}from"../../ui/text.mjs";import{useLoginModalStore as c}from"../../../store/modules/login-modal-store.mjs";import{useUserId as l}from"../../../hooks/use-auth.mjs";import{LeftArrowIcon as u}from"../../../assets/icons/left-arrow-icon.mjs";import{useCallback as d,useEffect as f,useMemo as p,useRef as m,useState as h}from"react";import{jsx as g,jsxs as _}from"react/jsx-runtime";import{useTranslations as v}from"next-intl";function y(e){let[t,n]=e.split(`@`);return!t||!n?e:`${t.slice(0,3)}***${t.length>3?t.slice(-1):``}@${n}`}function b(b){let x=v(`components.pages.login`),{email:S,onClose:C,onPassword:w}=b,{verifyStep:T}=c(),[E,D]=h([,,,,,,].fill(``)),[O,k]=h(0),[A,j]=h(!1),[M,N]=h(60),[P,F]=h(!1),[I,L]=h(``),R=m(null),z=l(),B=p(()=>y(S),[S]),V=d(async()=>T===`reset-password`?await a({user_id:z,email_code:E.join(``)}):T===`forgot-password`?await i({email:S,email_code:E.join(``)}):await r({email:S,email_code:E.join(``)}),[T,E,z,S]),H=p(()=>E.every(e=>e!==``)&&!A,[E,A]);f(()=>{if(M<=0)return;let e=setInterval(()=>{N(e=>e-1)},1e3);return()=>clearInterval(e)},[M]),f(()=>{R.current?.focus()},[]);let U=d(e=>{let t=e.target.value.replace(/\D/g,``);if(t.length===0)return;let n=[...E],r=t.split(``),i=O;for(let e of r)i<6&&(n[i]=e,i++);D(n),k(Math.min(i,5)),L(``)},[E,O]),W=d(e=>{if(e.key===`Backspace`){e.preventDefault();let t=[...E];E[O]?t[O]=``:O>0&&(t[O-1]=``,k(O-1)),D(t),L(``)}else e.key===`ArrowLeft`&&O>0?k(O-1):e.key===`ArrowRight`&&O<5&&k(O+1)},[E,O]),G=d(e=>{k(e),R.current?.focus()},[]);async function K(){if(!(M>0||P))try{F(!0),T===`reset-password`?await n({user_id:z}):await t({email:S}),N(60),L(``)}finally{F(!1)}}async function q(){if(H)try{j(!0),await V(),w?.(S)}catch(e){L(e.message??x(`verify.invalidCode`))}finally{j(!1)}}return _(o,{className:`min-h-screen w-full h-full bg-bg1 text-text1 flex flex-col`,children:[_(o,{className:`flex justify-between items-center h-[60px] px-[16px]`,children:[g(e,{type:`button`,onClick:C,"aria-label":x(`verify.back`),className:`cursor-pointer bg-transparent !p-0 !px-0 !py-0`,children:g(u,{className:`w-[16px] h-[16px] text-text1/80`,"aria-hidden":`true`,focusable:`false`})}),g(s,{className:`text-[14px] text-text2`})]}),_(o,{className:`px-[24px] flex flex-col mt-[15px]`,children:[_(o,{className:`flex flex-col`,children:[g(s,{className:`text-[24px] leading-[32px] font-bold`,children:x(`verify.title`)}),_(o,{className:`mt-[12px] flex items-center`,children:[_(s,{className:`text-[14px] leading-[14px] text-text1/80`,children:[x(`verify.sentTo`),` `,B]}),g(e,{type:`button`,onClick:K,disabled:M>0||P,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:M>0?x(`verify.resend`,{countdown:M}):x(`verify.resend`)})]})]}),_(`form`,{className:`mt-[38px]`,onSubmit:e=>{e.preventDefault(),q()},children:[_(o,{className:`h-14 sm:h-16 md:h-20 relative`,children:[g(`input`,{ref:R,type:`text`,inputMode:`numeric`,pattern:`[0-9]*`,value:``,onChange:U,onKeyDown:W,className:`absolute opacity-0 pointer-events-none w-full h-full border-none outline-none bg-transparent text-base`,autoComplete:`one-time-code`}),g(o,{className:`w-full flex justify-between items-center`,children:E.map((e,t)=>g(o,{onClick:()=>G(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===O?`border-theme3 bg-theme3`:`border-transparent bg-bg2`}
|
|
5
5
|
`,children:g(s,{className:`select-none font-semibold text-2xl sm:text-3xl leading-none text-text1`,children:e})},t))})]}),g(o,{className:`h-[22px] mt-[16px] mb-[22px] ml-[12px] text-[14px] text-theme5`,children:I}),g(e,{type:`submit`,disabled:!H,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:x(A?`verify.verifying`:`verify.nextStep`)})]})]})]})}export{b as Verify};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{updateUrlParams as e}from"../../../utils/common.mjs";import t from"../../../utils/event-bus.mjs";import{useUserStore as n}from"../../../store/modules/user-store.mjs";import{Box as r}from"../../ui/box.mjs";import{eventKey as i}from"../../../constants/event-key.mjs";import{useSearchHistory as a}from"../../../hooks/use-search-history.mjs";import o from"../search/top-header.mjs";import s from"./search-user.mjs";import c from"./search-video.mjs";import l from"./search-all.mjs";import{SORT_OPTIONS as u,SearchTab as d}from"./search-tab.mjs";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";import{useSearchParams as v}from"next/navigation";const y=[{label:`综合`,value:`all`},{label:`视频`,value:`video`},{label:`用户`,value:`user`}];function b(){let{userInfo:b}=n(),x=b?.user_id||`guest`,S=v().get(`q`)?.toString()||``,C=S?decodeURIComponent(S):``,[w,T]=m(C),[E]=m(C),[D]=m(0),[O,k]=m(y[0].value),[A,j]=m(u[0].value),[M
|
|
2
|
+
"use client";import{updateUrlParams as e}from"../../../utils/common.mjs";import t from"../../../utils/event-bus.mjs";import{useUserStore as n}from"../../../store/modules/user-store.mjs";import{Box as r}from"../../ui/box.mjs";import{eventKey as i}from"../../../constants/event-key.mjs";import{useSearchHistory as a}from"../../../hooks/use-search-history.mjs";import o from"../search/top-header.mjs";import s from"./search-user.mjs";import c from"./search-video.mjs";import l from"./search-all.mjs";import{SORT_OPTIONS as u,SearchTab as d}from"./search-tab.mjs";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";import{useSearchParams as v}from"next/navigation";const y=[{label:`综合`,value:`all`},{label:`视频`,value:`video`},{label:`用户`,value:`user`}];function b(){let{userInfo:b}=n(),x=b?.user_id||`guest`,S=v().get(`q`)?.toString()||``,C=S?decodeURIComponent(S):``,[w,T]=m(C),[E]=m(C),[D]=m(0),[O,k]=m(y[0].value),[A,j]=m(u[0].value),[,M]=m([]),{addHistory:N}=a({storageKey:x}),P=p(()=>w.trim()!==``,[w]);return f(()=>(t.on(i.EXCHANGE_SEARCH_TYPE,k),()=>{t.off(i.EXCHANGE_SEARCH_TYPE,k)}),[k]),_(r,{className:`w-full min-h-screen bg-bg1 pb-[12px] overscroll-y-none`,children:[g(o,{setSearchInputVal:t=>{t!==w&&(M([]),T(t),e({q:t}))},initInputVal:E,initInputVersion:D,addSearchHistory:N}),g(d,{searchType:O,tabList:y,onChange:e=>{k(e),M([])},sort:A,onSortChange:j}),P&&_(h,{children:[O===`user`&&g(s,{mode:`user`,inputVal:w}),O===`all`&&g(l,{searchInputVal:w,sort:A}),O===`video`&&g(c,{searchType:O,inputVal:w})]}),!P&&g(r,{className:`w-full pt-[12px]`})]})}export{b as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{gContentGetRecommendVideoList as e}from"../../../service/generated/client.mjs";import{gContentGetRecommendVideoListKey as t}from"../../../service/generated/tanstack.mjs";import{Box as n}from"../../ui/box.mjs";import{List as r}from"../../ui/list.mjs";import{useRequest as i}from"../../../hooks/query/use-query.mjs";import a from"./search-user.mjs";import o from"./search-video.mjs";import{useMemo as s}from"react";import{jsx as c,jsxs as l}from"react/jsx-runtime";import{useTranslations as u}from"next-intl";function d(e,t=1){return JSON.stringify({type:1,keywords:e,sort:t})}function f({searchInputVal:f,sort:p
|
|
2
|
+
"use client";import{gContentGetRecommendVideoList as e}from"../../../service/generated/client.mjs";import{gContentGetRecommendVideoListKey as t}from"../../../service/generated/tanstack.mjs";import{Box as n}from"../../ui/box.mjs";import{List as r}from"../../ui/list.mjs";import{useRequest as i}from"../../../hooks/query/use-query.mjs";import a from"./search-user.mjs";import o from"./search-video.mjs";import{useMemo as s}from"react";import{jsx as c,jsxs as l}from"react/jsx-runtime";import{useTranslations as u}from"next-intl";function d(e,t=1){return JSON.stringify({type:1,keywords:e,sort:t})}function f({searchInputVal:f,sort:p}){let m=u(`components.pages.search.searchResult`),h=s(()=>d(f,p),[f,p]),{data:g,isFetching:_}=i(t({data_type:2,extra_params:h,page:1,page_size:10}),async()=>(await e({data_type:2,extra_params:h,page:1,page_size:10})).data??{}),v=s(()=>g?.videos?.list??[],[g]),y=s(()=>g?.users?.list??[],[g]);return v.length===0&&y.length===0&&!_?c(n,{className:`w-full pt-[12px]`,children:c(r,{loading:_,empty:`nodata`,emptyText:m(`searchAll.emptyResult`)})}):l(n,{className:`w-full pt-[12px]`,children:[y.length>0&&c(a,{mode:`all`,list:y}),c(o,{list:v})]})}export{f as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{Button as e}from"../../ui/button.mjs";import{Box as t}from"../../ui/box.mjs";import{Popover as n,PopoverContent as r,PopoverTrigger as i}from"../../ui/popover.mjs";import{Text as a}from"../../ui/text.mjs";import o from"../../../assets/icons/search/filter.mjs";import{memo as s,useState as c}from"react";import{ChevronUpIcon as l}from"lucide-react";import{Fragment as u,jsx as d,jsxs as f}from"react/jsx-runtime";const p=[{label:`综合`,value:1},{label:`最新`,value:2},{label:`最热`,value:3}],m=s(({searchType:s,onChange:m,tabList:h,sort:g,onSortChange:_})=>{let[v,y]=c(!1);return f(u,{children:[f(t,{as:`nav`,className:`w-full h-[42px] bg-bg1 flex items-center justify-between px-[3px] fixed top-[
|
|
2
|
+
"use client";import{Button as e}from"../../ui/button.mjs";import{Box as t}from"../../ui/box.mjs";import{Popover as n,PopoverContent as r,PopoverTrigger as i}from"../../ui/popover.mjs";import{Text as a}from"../../ui/text.mjs";import o from"../../../assets/icons/search/filter.mjs";import{memo as s,useState as c}from"react";import{ChevronUpIcon as l}from"lucide-react";import{Fragment as u,jsx as d,jsxs as f}from"react/jsx-runtime";const p=[{label:`综合`,value:1},{label:`最新`,value:2},{label:`最热`,value:3}],m=s(({searchType:s,onChange:m,tabList:h,sort:g,onSortChange:_})=>{let[v,y]=c(!1);return f(u,{children:[f(t,{as:`nav`,className:`w-full h-[42px] bg-bg1 flex items-center justify-between px-[3px] fixed top-[55px] left-0 right-0 z-40`,children:[d(t,{className:`flex items-center`,children:h.map(e=>d(a,{className:`h-[30px] rounded-[15px] leading-[30px] px-[9px] text-[16px] bg-transparent transition-all duration-150 ${s===e.value?`text-theme5 !text-[20px] font-bold`:`text-text2`}`,onClick:()=>{s!==e.value&&m(e.value)},children:e.label},e.value))}),f(n,{open:v,onOpenChange:y,children:[d(i,{"aria-label":`排序筛选`,className:`shrink-0 w-7 h-7 rounded-[min(var(--radius-md),12px)] inline-flex items-center justify-center`,children:d(o,{className:`w-[16px] h-[16px]`})}),f(r,{side:`bottom`,align:`end`,className:`w-[100vw] bg-muted`,children:[d(a,{as:`p`,className:`text-[14px] font-medium text-text1 mb-[12px]`,children:`排序方式`}),f(t,{className:`flex flex-col gap-[8px]`,children:[d(t,{className:`flex justify-between gap-[8px]`,children:p.map(t=>d(e,{variant:g===t.value?`default`:`outline`,size:`sm`,className:`w-[100px]`,onClick:()=>{_(t.value),y(!1)},children:t.label},t.value))}),f(e,{variant:`ghost`,size:`sm`,className:`w-full justify-center gap-[4px] text-text2`,onClick:()=>y(!1),children:[d(l,{className:`w-[14px] h-[14px]`}),`收起`]})]})]})]})]}),d(t,{className:`w-full h-[42px]`})]})});m.displayName=`SearchTab`;export{p as SORT_OPTIONS,m as SearchTab};
|