@funhub/platform 0.1.23 → 0.1.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/icons/right_arrow.mjs +2 -0
- package/dist/assets/images/Frame.mjs +2 -0
- package/dist/assets/images/marquee.mjs +2 -0
- package/dist/biz.d.mts +25 -1
- package/dist/biz.mjs +1 -1
- package/dist/common.mjs +1 -1
- package/dist/components/biz/basics/fullscreen-feed/index.mjs +1 -1
- package/dist/components/biz/basics/fullscreen-feed/runtime/client.mjs +1 -1
- package/dist/components/biz/basics/fullscreen-feed/runtime/post-slide.mjs +1 -1
- package/dist/components/biz/basics/fullscreen-feed/runtime/use-mixed-feed-controller.mjs +1 -1
- package/dist/components/biz/basics/fullscreen-feed/runtime/use-series-feed-controller.mjs +1 -1
- package/dist/components/biz/basics/fullscreen-feed/runtime/user-action.mjs +1 -1
- package/dist/components/biz/basics/logo/variants/basic-logo/runtime/client.mjs +1 -1
- package/dist/components/biz/basics/search/shared/components/search-box.mjs +1 -1
- package/dist/components/biz/basics/search/variants/simple-search/runtime/client.mjs +1 -1
- package/dist/components/biz/business/banner/variants/basic-banner/inspector-schema.d.mts +0 -2
- 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 +0 -1
- package/dist/components/biz/business/banner/variants/basic-banner/runtime/client.mjs +1 -1
- package/dist/components/biz/business/card-grid/variants/card-grid-2x3-infinite/runtime/client.mjs +1 -1
- package/dist/components/biz/business/card-grid/variants/card-grid-3x3-infinite/runtime/client.mjs +1 -1
- package/dist/components/biz/business/channel-list/channel-filter-dialog.mjs +2 -0
- package/dist/components/biz/business/channel-list/client.d.mts +8 -0
- package/dist/components/biz/business/channel-list/client.mjs +2 -0
- package/dist/components/biz/business/channel-list/default-props.mjs +2 -0
- package/dist/components/biz/business/channel-list/material.d.mts +16 -0
- package/dist/components/biz/business/channel-list/material.mjs +2 -0
- package/dist/components/biz/business/channel-list/schema.d.mts +23 -0
- package/dist/components/biz/business/channel-list/schema.mjs +2 -0
- package/dist/components/biz/business/comment/comment-item.mjs +1 -1
- package/dist/components/biz/business/comment/comment-list.mjs +1 -1
- package/dist/components/biz/business/comment/reply-detail.mjs +1 -1
- package/dist/components/biz/business/detail/detail-operate.mjs +1 -1
- package/dist/components/biz/business/detail/materials/registry.d.mts +4 -4
- package/dist/components/biz/business/detail/materials/video-detail-actions/schema.d.mts +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-info/schema.d.mts +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-info-title/schema.d.mts +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-info-title-tags-episodes/schema.d.mts +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-player/schema.d.mts +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-recommend/client.mjs +1 -1
- package/dist/components/biz/business/detail/video-hero.mjs +1 -1
- package/dist/components/biz/business/fullscreen-feed/variants/shared/runtime-compat.mjs +1 -1
- package/dist/components/biz/business/home-recommend/shared/home-recommend-base.mjs +1 -1
- package/dist/components/biz/business/index.d.mts +31 -1
- package/dist/components/biz/business/index.mjs +1 -1
- package/dist/components/biz/business/marquee/client.d.mts +16 -0
- package/dist/components/biz/business/marquee/client.mjs +2 -0
- package/dist/components/biz/business/marquee/index.d.mts +5 -0
- package/dist/components/biz/business/marquee/material.d.mts +24 -0
- package/dist/components/biz/business/marquee/material.mjs +2 -0
- package/dist/components/biz/business/marquee/schema.d.mts +33 -0
- package/dist/components/biz/business/marquee/schema.mjs +2 -0
- package/dist/components/biz/business/marquee/server.d.mts +11 -0
- package/dist/components/biz/business/marquee/server.mjs +2 -0
- package/dist/components/biz/business/nav-bar/variants/basic-nav-bar/runtime/client.mjs +1 -1
- package/dist/components/biz/business/recommended-users/variants/basic-recommended-users/runtime/client.mjs +1 -1
- package/dist/components/biz/business/search-bar/variants/detail-search-bar/runtime/client.mjs +1 -1
- package/dist/components/biz/business/search-history/use-search-history.mjs +1 -1
- package/dist/components/biz/business/search-history2/client.d.mts +21 -0
- package/dist/components/biz/business/search-history2/client.mjs +2 -0
- package/dist/components/biz/business/search-history2/index.d.mts +5 -0
- package/dist/components/biz/business/search-history2/material.d.mts +15 -0
- package/dist/components/biz/business/search-history2/material.mjs +2 -0
- package/dist/components/biz/business/search-history2/schema.d.mts +21 -0
- package/dist/components/biz/business/search-history2/schema.mjs +2 -0
- package/dist/components/biz/business/search-history2/server.d.mts +11 -0
- package/dist/components/biz/business/search-history2/server.mjs +2 -0
- package/dist/components/biz/business/search-input/client.d.mts +19 -0
- package/dist/components/biz/business/search-input/client.mjs +2 -0
- package/dist/components/biz/business/search-input/index.d.mts +5 -0
- package/dist/components/biz/business/search-input/material.d.mts +14 -0
- package/dist/components/biz/business/search-input/material.mjs +2 -0
- package/dist/components/biz/business/search-input/schema.d.mts +19 -0
- package/dist/components/biz/business/search-input/schema.mjs +2 -0
- package/dist/components/biz/business/search-input/server.d.mts +11 -0
- package/dist/components/biz/business/search-input/server.mjs +2 -0
- package/dist/components/biz/business/shortcut-grid/client.d.mts +2 -2
- package/dist/components/biz/business/shortcut-grid/client.mjs +1 -1
- package/dist/components/biz/business/shortcut-grid/material.d.mts +12 -1
- package/dist/components/biz/business/shortcut-grid/material.mjs +1 -1
- package/dist/components/biz/business/shortcut-grid/schema.d.mts +13 -5
- package/dist/components/biz/business/shortcut-grid/schema.mjs +1 -1
- package/dist/components/biz/business/tab-bar/client.d.mts +13 -0
- package/dist/components/biz/business/tab-bar/client.mjs +2 -0
- package/dist/components/biz/business/tab-bar/index.d.mts +5 -0
- package/dist/components/biz/business/tab-bar/material.d.mts +21 -0
- package/dist/components/biz/business/tab-bar/material.mjs +2 -0
- package/dist/components/biz/business/tab-bar/schema.d.mts +27 -0
- package/dist/components/biz/business/tab-bar/schema.mjs +2 -0
- package/dist/components/biz/business/tab-bar/server.d.mts +11 -0
- package/dist/components/biz/business/tab-bar/server.mjs +2 -0
- package/dist/components/biz/business/text-recommend/client.d.mts +22 -0
- package/dist/components/biz/business/text-recommend/client.mjs +2 -0
- package/dist/components/biz/business/text-recommend/index.d.mts +5 -0
- package/dist/components/biz/business/text-recommend/material.d.mts +15 -0
- package/dist/components/biz/business/text-recommend/material.mjs +2 -0
- package/dist/components/biz/business/text-recommend/schema.d.mts +21 -0
- package/dist/components/biz/business/text-recommend/schema.mjs +2 -0
- package/dist/components/biz/business/text-recommend/server.d.mts +12 -0
- package/dist/components/biz/business/text-recommend/server.mjs +2 -0
- package/dist/components/biz/business/video-horizontal-list/client.d.mts +25 -0
- package/dist/components/biz/business/video-horizontal-list/client.mjs +2 -0
- package/dist/components/biz/business/video-horizontal-list/index.d.mts +5 -0
- package/dist/components/biz/business/video-horizontal-list/material.d.mts +18 -0
- package/dist/components/biz/business/video-horizontal-list/material.mjs +2 -0
- package/dist/components/biz/business/video-horizontal-list/schema.d.mts +21 -0
- package/dist/components/biz/business/video-horizontal-list/schema.mjs +2 -0
- package/dist/components/biz/business/video-horizontal-list/server.d.mts +12 -0
- package/dist/components/biz/business/video-horizontal-list/server.mjs +2 -0
- package/dist/components/biz/example/button/client.mjs +1 -1
- package/dist/components/biz/renderer/renderer.d.mts +1 -1
- package/dist/components/biz/renderer/renderer.mjs +1 -1
- package/dist/components/common/at-element/index.mjs +1 -1
- package/dist/components/common/blocked-dialog/blocked-dialog.mjs +1 -1
- package/dist/components/common/collection-popup/collection-create-modal.mjs +1 -1
- package/dist/components/common/delete-confirm-dialog/delete-confirm-dialog.mjs +1 -1
- package/dist/components/common/funhub-provider/funhub-provider.mjs +1 -1
- package/dist/components/common/header-nav/client.mjs +1 -1
- package/dist/components/common/info-card/card-header.mjs +1 -1
- package/dist/components/common/list/post-list/post-list.mjs +1 -1
- package/dist/components/common/list/user-activity-list/user-activity-list-actions.mjs +1 -1
- package/dist/components/common/list/user-activity-list/user-activity-list-item.mjs +1 -1
- package/dist/components/common/list/video-list/video-list.mjs +1 -1
- package/dist/components/common/popup-video/index.mjs +1 -1
- package/dist/components/common/series-episodes/index.mjs +1 -1
- package/dist/components/common/share-popup/share-popup.mjs +1 -1
- package/dist/components/common/tab-bar/index.mjs +1 -1
- package/dist/components/common/top-nav-bar/client.mjs +1 -1
- package/dist/components/common/video-player/index.mjs +2 -2
- package/dist/components/pages/(follow)/_components/interaction-tabs/index.mjs +1 -1
- package/dist/components/pages/(follow)/_components/user-list/index.mjs +1 -1
- package/dist/components/pages/(follow)/fans/page.mjs +1 -1
- package/dist/components/pages/(follow)/followed/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/feed-series/feed-series-client.mjs +1 -1
- package/dist/components/pages/feed-series/page.mjs +1 -1
- package/dist/components/pages/feedback/_components/feedback-form.mjs +1 -1
- package/dist/components/pages/fullscreen-feed/page.mjs +1 -1
- package/dist/components/pages/home/client.mjs +1 -1
- package/dist/components/pages/login/index.mjs +1 -1
- package/dist/components/pages/post-detail/post-detail-client.mjs +1 -1
- package/dist/components/pages/profile/_components/tabs/collect-tab/client.mjs +1 -1
- package/dist/components/pages/profile/_components/tabs/history-tab/client.mjs +1 -1
- package/dist/components/pages/profile/_components/tabs/like-tab/client.mjs +1 -1
- package/dist/components/pages/profile/_components/tabs/publish-tab/client.mjs +1 -1
- package/dist/components/pages/profile/_components/user-profile-container/client.mjs +1 -1
- package/dist/components/pages/profile/_components/user-profile-header/client.mjs +1 -1
- package/dist/components/pages/publish/components/collection-popup.mjs +1 -1
- package/dist/components/pages/publish/components/collection.mjs +1 -1
- package/dist/components/pages/publish/components/header.mjs +1 -1
- package/dist/components/pages/publish/page-client.mjs +1 -1
- package/dist/components/pages/search/hot-recommend.mjs +1 -1
- package/dist/components/pages/search/page-client.mjs +1 -1
- package/dist/components/pages/search/search-result/search-video-info.mjs +1 -1
- package/dist/components/pages/search/top-header.mjs +1 -1
- package/dist/components/pages/settings/_components/settings.mjs +1 -1
- package/dist/components/pages/user-follow/page.mjs +1 -1
- package/dist/components/pages/video-detail/page.mjs +1 -1
- package/dist/components/pages/video-detail/video-detail-client.mjs +1 -1
- package/dist/components/pages/video-list/video-list-client.mjs +1 -1
- package/dist/components/ui/image.d.mts +4 -4
- package/dist/hooks/use-content-operate.mjs +1 -1
- package/dist/hooks.mjs +1 -1
- package/dist/i18n/locales/en.mjs +1 -1
- package/dist/i18n/locales/zh-CN.mjs +1 -1
- package/dist/i18n.d.mts +1 -1
- package/dist/i18n.mjs +1 -1
- package/dist/materials.d.mts +8 -7
- package/dist/materials.mjs +1 -1
- package/dist/utils/schema/material.d.mts +1 -1
- package/dist/utils/share-manager.mjs +1 -1
- package/dist/utils.d.mts +4 -4
- package/dist/utils.mjs +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
|
|
2
|
+
import { TabBarProps } from "./schema.mjs";
|
|
3
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region components/biz/business/tab-bar/client.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* TabBar 物料组件 - 客户端交互部分
|
|
8
|
+
*/
|
|
9
|
+
declare function TabBarClient({
|
|
10
|
+
items
|
|
11
|
+
}: TabBarProps): react_jsx_runtime0.JSX.Element | null;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { TabBarClient };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
|
|
2
|
+
"use client";import{Box as e}from"../../../ui/box.mjs";import{Text as t}from"../../../ui/text.mjs";import n from"../../../ui/link.mjs";import r from"../../../../assets/icons/tabs/follow.mjs";import i from"../../../../assets/icons/tabs/follow_active.mjs";import a from"../../../../assets/icons/tabs/home.mjs";import o from"../../../../assets/icons/tabs/home_active.mjs";import s from"../../../../assets/icons/tabs/mine.mjs";import c from"../../../../assets/icons/tabs/mine_active.mjs";import{usePathname as l}from"next/navigation";import{useEffect as u,useState as d,useTransition as f}from"react";import{Fragment as p,jsx as m,jsxs as h}from"react/jsx-runtime";const g=`env(safe-area-inset-bottom, 0px)`;function _(e,t){if(t!==`/`)return e.startsWith(t);let n=[`/user`].some(t=>e.startsWith(t)),r=e.startsWith(`/category/`);return!n&&(e===`/`||r)}const v={home:{icon:a,activeIcon:o},follow:{icon:r,activeIcon:i},mine:{icon:s,activeIcon:c}};function y({items:r}){let i=l(),[a,o]=d(null),[,s]=f(),[c,y]=d(!1);return u(()=>{y(!0)},[]),u(()=>{a&&_(i,a)&&s(()=>{o(null)})},[i,a]),!r||r.length===0?null:m(e,{className:`fixed bottom-0 left-0 right-0 bg-bg1 border-t border-line1 flex items-center justify-around z-50`,style:{height:`calc(56px + ${g})`,paddingBottom:g},children:r.map((r,s)=>{let l=c?_(a||i||``,r.path):!1,u=v[r.iconType]||v.home,d=h(p,{children:[m(l?u.activeIcon:u.icon,{width:22,height:22}),m(t,{className:`text-[10px] mt-[4px] ${l?`text-theme5`:`text-text2`}`,children:r.label})]});return l?m(e,{className:`flex flex-col items-center justify-center flex-1 h-full`,children:d},`${r.path}-${s}`):m(n,{href:r.path,prefetch:!0,className:`flex flex-col items-center justify-center flex-1 h-full`,onClick:()=>{r.path!==i&&o(r.path)},children:d},`${r.path}-${s}`)})})}export{y as TabBarClient};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
|
|
2
|
+
import { SchemaHasDefaultValue } from "../../../../utils/schema/schema.mjs";
|
|
3
|
+
import { DefineMaterialOption } from "../../../../utils/schema/material.mjs";
|
|
4
|
+
import "../../../../utils.mjs";
|
|
5
|
+
import { TabBarServer } from "./server.mjs";
|
|
6
|
+
import * as zod from "zod";
|
|
7
|
+
import * as zod_v4_core0 from "zod/v4/core";
|
|
8
|
+
|
|
9
|
+
//#region components/biz/business/tab-bar/material.d.ts
|
|
10
|
+
/**
|
|
11
|
+
* TabBar 物料定义
|
|
12
|
+
*/
|
|
13
|
+
declare const tabBarMaterial: DefineMaterialOption<typeof TabBarServer, zod.ZodObject<{
|
|
14
|
+
items: zod.ZodArray<zod.ZodObject<{
|
|
15
|
+
label: zod.ZodString & SchemaHasDefaultValue;
|
|
16
|
+
path: zod.ZodString & SchemaHasDefaultValue;
|
|
17
|
+
iconType: zod.ZodString & SchemaHasDefaultValue;
|
|
18
|
+
}, zod_v4_core0.$strip>> & SchemaHasDefaultValue;
|
|
19
|
+
}, zod_v4_core0.$strip>, "tab-bar">;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { tabBarMaterial };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
|
|
2
|
+
import{defineMaterial as e}from"../../../../utils/schema/material.mjs";import{tabBarInspectorPropsSchema as t}from"./schema.mjs";import{TabBarServer as n}from"./server.mjs";const r=e({type:`tab-bar`,name:`底部导航栏`,icon:`https://cdn.example.com/icons/tab-bar.png`,category:`BOTTOM`,serverComponent:n,clientComponent:n,propsSchema:t});export{r as tabBarMaterial};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
|
|
2
|
+
import { SchemaHasDefaultValue } from "../../../../utils/schema/schema.mjs";
|
|
3
|
+
import "../../../../utils.mjs";
|
|
4
|
+
import z from "zod";
|
|
5
|
+
|
|
6
|
+
//#region components/biz/business/tab-bar/schema.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* TabBar 物料属性定义
|
|
9
|
+
*/
|
|
10
|
+
declare const tabBarInspectorPropsSchema: z.ZodObject<{
|
|
11
|
+
items: z.ZodArray<z.ZodObject<{
|
|
12
|
+
label: z.ZodString & SchemaHasDefaultValue;
|
|
13
|
+
path: z.ZodString & SchemaHasDefaultValue;
|
|
14
|
+
iconType: z.ZodString & SchemaHasDefaultValue;
|
|
15
|
+
}, z.core.$strip>> & SchemaHasDefaultValue;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
declare const tabBarInspectorDefaultProps: {
|
|
18
|
+
items: {
|
|
19
|
+
label: string;
|
|
20
|
+
path: string;
|
|
21
|
+
iconType: string;
|
|
22
|
+
}[];
|
|
23
|
+
};
|
|
24
|
+
type TabBarInspectorProps = z.infer<typeof tabBarInspectorPropsSchema>;
|
|
25
|
+
type TabBarProps = TabBarInspectorProps;
|
|
26
|
+
//#endregion
|
|
27
|
+
export { TabBarInspectorProps, TabBarProps, tabBarInspectorDefaultProps, tabBarInspectorPropsSchema };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
|
|
2
|
+
import{defineArrayItemPropSchema as e,defineComponentPropsSchema as t,defineTextPropSchema as n,getSchemaDefaultProps as r}from"../../../../utils/schema/schema.mjs";const i=t({items:e(t({label:n({label:`名称`,defaultValue:`首页`}),path:n({label:`跳转路径`,defaultValue:`/`}),iconType:n({label:`图标类型`,defaultValue:`home`})}),{label:`导航项`,defaultValue:[{label:`首页`,path:`/`,iconType:`home`},{label:`关注`,path:`/user/follow`,iconType:`follow`},{label:`我的`,path:`/user/mine`,iconType:`mine`}]})}),a=r(i);export{a as tabBarInspectorDefaultProps,i as tabBarInspectorPropsSchema};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
|
|
2
|
+
import { TabBarProps } from "./schema.mjs";
|
|
3
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region components/biz/business/tab-bar/server.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* TabBar 物料组件 - 服务端部分
|
|
8
|
+
*/
|
|
9
|
+
declare function TabBarServer(props: TabBarProps): Promise<react_jsx_runtime0.JSX.Element>;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { TabBarServer };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
|
|
2
|
+
import { ContentRecommendInfo } from "../../../../types.mjs";
|
|
3
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region components/biz/business/text-recommend/client.d.ts
|
|
6
|
+
interface TextRecommendClientProps {
|
|
7
|
+
title?: string;
|
|
8
|
+
count?: string;
|
|
9
|
+
initialList: ContentRecommendInfo[];
|
|
10
|
+
defaultTitle: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* 文字推荐物料组件 - 客户端交互部分
|
|
14
|
+
*/
|
|
15
|
+
declare function TextRecommendClient({
|
|
16
|
+
title,
|
|
17
|
+
count,
|
|
18
|
+
initialList,
|
|
19
|
+
defaultTitle
|
|
20
|
+
}: TextRecommendClientProps): react_jsx_runtime0.JSX.Element;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { TextRecommendClient };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
|
|
2
|
+
"use client";import{updateUrlParams as e}from"../../../../utils/common.mjs";import{useUserStore as t}from"../../../../store/modules/user-store.mjs";import{gContentGetRecommendSearchList as n}from"../../../../service/generated/client.mjs";import{useRequest as r}from"../../../../hooks/query/use-query.mjs";import i from"../../../../assets/icons/refresh.mjs";import{useRouter as a}from"next/navigation";import{useMemo as o,useState as s}from"react";import{jsx as c,jsxs as l}from"react/jsx-runtime";function u({title:u,count:d,initialList:f,defaultTitle:p}){let{userInfo:m}=t(),h=m?.user_id||`guest`,g=a(),[_,v]=s(null),{data:y,refetch:b,isFetching:x}=r([`hotSearchKey`,h],()=>n({user_id:h}),{enabled:!1}),S=o(()=>_||(y?.data?.recommend_list??f).slice(0,Number(d||6)),[y,_,f,d]),C=async()=>{let e=await b();e.data?.data?.recommend_list&&v(e.data.data.recommend_list)},w=t=>{e({q:t}),g.push(`${window.location.pathname}?q=${encodeURIComponent(t)}`)};return l(`div`,{className:`w-full mb-[24px] pt-[8px]`,children:[l(`div`,{className:`w-full px-[12px] h-[24px] mb-[12px] flex items-center justify-between`,children:[c(`span`,{className:`leading-[24px] text-[16px] text-text1 font-semibold`,children:u||p}),c(`div`,{className:`h-full px-[12px] flex items-center cursor-pointer`,onClick:C,children:c(i,{className:`w-[16px] h-[16px] text-text2 ${x?`animate-spin`:``}`})})]}),c(`div`,{className:`w-full px-[12px] flex gap-y-[16px] flex-wrap`,children:x&&!_?Array.from({length:Number(d||6)}).map((e,t)=>c(`div`,{className:`w-[50%] ${t%2==0?`pr-[4px]`:`pl-[4px]`}`,children:c(`div`,{className:`w-[70%] h-[22px] bg-bg2 animate-pulse rounded`})},`skeleton-${t}`)):S.map((e,t)=>c(`div`,{className:`w-[50%] ${t%2==0?`pr-[4px]`:`pl-[4px]`} cursor-pointer`,onClick:()=>w(e.title||``),children:c(`span`,{className:`text-text1 text-[14px] leading-[22px] max-w-[90%] line-clamp-1`,children:e.title})},String(e.title??t)))})]})}export{u as TextRecommendClient};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
|
|
2
|
+
import { TextRecommendInspectorProps, TextRecommendProps, textRecommendInspectorDefaultProps, textRecommendInspectorPropsSchema } from "./schema.mjs";
|
|
3
|
+
import { TextRecommendServer } from "./server.mjs";
|
|
4
|
+
import { textRecommendMaterial } from "./material.mjs";
|
|
5
|
+
import { TextRecommendClient } from "./client.mjs";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
|
|
2
|
+
import { SchemaHasDefaultValue } from "../../../../utils/schema/schema.mjs";
|
|
3
|
+
import { DefineMaterialOption } from "../../../../utils/schema/material.mjs";
|
|
4
|
+
import "../../../../utils.mjs";
|
|
5
|
+
import { TextRecommendServer } from "./server.mjs";
|
|
6
|
+
import * as zod from "zod";
|
|
7
|
+
import * as zod_v4_core0 from "zod/v4/core";
|
|
8
|
+
|
|
9
|
+
//#region components/biz/business/text-recommend/material.d.ts
|
|
10
|
+
declare const textRecommendMaterial: DefineMaterialOption<typeof TextRecommendServer, zod.ZodObject<{
|
|
11
|
+
title: zod.ZodString & SchemaHasDefaultValue;
|
|
12
|
+
count: zod.ZodType<"4" | "6" | "8" | "10", unknown, zod_v4_core0.$ZodTypeInternals<"4" | "6" | "8" | "10", unknown>> & SchemaHasDefaultValue;
|
|
13
|
+
}, zod_v4_core0.$strip>, "text-recommend">;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { textRecommendMaterial };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
|
|
2
|
+
import{defineMaterial as e}from"../../../../utils/schema/material.mjs";import{textRecommendInspectorPropsSchema as t}from"./schema.mjs";import{TextRecommendServer as n}from"./server.mjs";const r=e({type:`text-recommend`,name:`文字推荐`,icon:`https://cdn.example.com/icons/text-recommend.png`,category:`CENTER`,serverComponent:n,clientComponent:n,propsSchema:t});export{r as textRecommendMaterial};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
|
|
2
|
+
import { SchemaHasDefaultValue } from "../../../../utils/schema/schema.mjs";
|
|
3
|
+
import "../../../../utils.mjs";
|
|
4
|
+
import z from "zod";
|
|
5
|
+
|
|
6
|
+
//#region components/biz/business/text-recommend/schema.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* 文字推荐物料属性定义
|
|
9
|
+
*/
|
|
10
|
+
declare const textRecommendInspectorPropsSchema: z.ZodObject<{
|
|
11
|
+
title: z.ZodString & SchemaHasDefaultValue;
|
|
12
|
+
count: z.ZodType<"4" | "6" | "8" | "10", unknown, z.core.$ZodTypeInternals<"4" | "6" | "8" | "10", unknown>> & SchemaHasDefaultValue;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
declare const textRecommendInspectorDefaultProps: {
|
|
15
|
+
title: string;
|
|
16
|
+
count: "4" | "6" | "8" | "10";
|
|
17
|
+
};
|
|
18
|
+
type TextRecommendInspectorProps = z.infer<typeof textRecommendInspectorPropsSchema>;
|
|
19
|
+
type TextRecommendProps = TextRecommendInspectorProps;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { TextRecommendInspectorProps, TextRecommendProps, textRecommendInspectorDefaultProps, textRecommendInspectorPropsSchema };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
|
|
2
|
+
import{defineComponentPropsSchema as e,defineSelectEnumPropSchema as t,defineTextPropSchema as n,getSchemaDefaultProps as r}from"../../../../utils/schema/schema.mjs";const i=e({title:n({label:`标题名称`,defaultValue:`推荐搜索`}),count:t([`4`,`6`,`8`,`10`],{label:`展示个数`,defaultValue:`6`})}),a=r(i);export{a as textRecommendInspectorDefaultProps,i as textRecommendInspectorPropsSchema};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
|
|
2
|
+
import { TextRecommendProps } from "./schema.mjs";
|
|
3
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region components/biz/business/text-recommend/server.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* 文字推荐物料组件 (推荐搜索) - 服务端部分
|
|
8
|
+
* 负责初始数据的预取
|
|
9
|
+
*/
|
|
10
|
+
declare function TextRecommendServer(props: TextRecommendProps): Promise<react_jsx_runtime0.JSX.Element>;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { TextRecommendServer };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
|
|
2
|
+
import{gContentGetRecommendSearchList as e}from"../../../../service/generated/client.mjs";import{TextRecommendClient as t}from"./client.mjs";import{jsx as n}from"react/jsx-runtime";import{getTranslations as r}from"next-intl/server";async function i(i){let a=[],o=await r(`components.pages.search`);try{a=(await e({user_id:`guest`})).data?.recommend_list||[]}catch(e){console.error(`TextRecommendServer prefetch error:`,e)}return n(t,{...i,initialList:a,defaultTitle:o(`hotSearch.recommendedSearches`)})}export{i as TextRecommendServer};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
|
|
2
|
+
import { ContentGetAppChannelBlockDataResponse } from "../../../../types.mjs";
|
|
3
|
+
import { VideoHorizontalListProps } from "./schema.mjs";
|
|
4
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region components/biz/business/video-horizontal-list/client.d.ts
|
|
7
|
+
interface VideoHorizontalListClientProps extends VideoHorizontalListProps {
|
|
8
|
+
initialData?: ContentGetAppChannelBlockDataResponse | null;
|
|
9
|
+
defaultTitle: string;
|
|
10
|
+
allEpisodesText: string;
|
|
11
|
+
updatedToText: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* 视频横向列表物料组件 - 客户端部分
|
|
15
|
+
*/
|
|
16
|
+
declare function VideoHorizontalListClient({
|
|
17
|
+
blockId,
|
|
18
|
+
title: propTitle,
|
|
19
|
+
initialData,
|
|
20
|
+
defaultTitle,
|
|
21
|
+
allEpisodesText,
|
|
22
|
+
updatedToText
|
|
23
|
+
}: VideoHorizontalListClientProps): react_jsx_runtime0.JSX.Element;
|
|
24
|
+
//#endregion
|
|
25
|
+
export { VideoHorizontalListClient };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
|
|
2
|
+
"use client";import{gContentGetAppChannelBlockData as e}from"../../../../service/generated/client.mjs";import{Image as t}from"../../../ui/image.mjs";import{Box as n}from"../../../ui/box.mjs";import{Text as r}from"../../../ui/text.mjs";import{usePaginated as i}from"../../../../hooks/query/use-query.mjs";import a from"../../../../assets/images/Frame.mjs";import{useRouter as o}from"next/navigation";import{useCallback as s,useMemo as c,useRef as l}from"react";import{jsx as u,jsxs as d}from"react/jsx-runtime";function f({blockId:f,title:p,initialData:m,defaultTitle:h,allEpisodesText:g,updatedToText:_}){let v=l(null),y=o(),b=e=>{if(!e)return`00:00`;let t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=e%60,i=n.toString().padStart(2,`0`),a=r.toString().padStart(2,`0`);return t>0?`${t.toString().padStart(2,`0`)}:${i}:${a}`:`${i}:${a}`},x=g&&!g.includes(`.`)?g:`全{count}集`,S=_&&!_.includes(`.`)?_:`更新至{count}集`,C=s((e,t)=>!e&&e!==0?``:t===`1`?x.replace(`{count}`,String(e)):S.replace(`{count}`,String(e)),[x,S]),w=!!m?.block?.data?.videos?.length,T=c(()=>{if(w)return{pages:[{data:m}],pageParams:[void 0]}},[w,m]),{data:E,fetchNextPage:D,hasNextPage:O,isFetchingNextPage:k}=i({key:[`video-horizontal-list`,f],queryFn:t=>e({block_id:f,cursor:t}),getNextPageParam:e=>e.data?.block?.data?.cursor||void 0,options:{enabled:!!f,initialData:T},initialPageParam:void 0}),A=typeof a==`string`?a:a.src,j=c(()=>{let e=[];return E?.pages.forEach(t=>{let n=t.data?.block?.data?.videos;n&&e.push(...n)}),e.length===0?Array.from({length:4}).map((e,t)=>({id:`mock-${t}`,name:`这里是视频标题 ${t+1}`,img_x:A,type:2,episode_cnt:56,update_status:`1`,duration:3600,tags:[{name:`独家`}]})):e},[E,A]),M=s(()=>{if(!v.current||!O||k)return;let{scrollLeft:e,scrollWidth:t,clientWidth:n}=v.current;t-(e+n)<124.667*2&&D()},[O,k,D]),N=p||m?.block?.cn_name||h;return d(n,{className:`bg-bg1 flex flex-col gap-[12px] p-[12px] relative w-full overflow-hidden`,children:[N&&u(n,{className:`flex items-center relative shrink-0 w-full`,children:u(r,{as:`h2`,className:`text-[18px] font-bold text-text1 leading-[26px] truncate`,children:N})}),d(n,{ref:v,onScroll:M,className:`flex gap-[8px] items-start relative shrink-0 w-full overflow-x-auto no-scrollbar`,children:[j.map((e,i)=>{let a=e.tags?.[0]?.name;return d(n,{className:`flex flex-col gap-0 items-start relative shrink-0 w-[116.667px] cursor-pointer active:opacity-70 transition-opacity`,onClick:()=>{e.id&&!e.id.startsWith(`mock-`)&&y.push(`/video-detail/${e.id}`)},children:[d(n,{className:`flex flex-col items-start justify-between overflow-hidden relative rounded-[8px] w-full aspect-[116.667/155.5] bg-bg2`,children:[u(t,{src:e.img_x||A,alt:e.name||``,fill:!0,className:`object-cover`,unoptimized:!0,priority:!0}),a&&u(n,{className:`absolute top-0 right-0 h-[20px] flex items-center justify-center px-[6px] rounded-bl-[8px] rounded-tr-[8px] z-10`,style:{backgroundImage:`linear-gradient(120deg, #fd4c5e 1.59%, #f05d19 99.09%)`},children:u(r,{className:`text-[12px] text-white leading-[20px] font-medium whitespace-nowrap`,children:a})}),u(n,{className:`absolute bottom-0 left-0 right-0 bg-gradient-to-b from-transparent to-black/80 pt-[12px] pb-[4px] px-[4px] flex items-center justify-end`,children:u(r,{className:`text-[12px] text-white leading-[20px] whitespace-nowrap truncate max-w-full`,children:e.type===2?C(e.episode_cnt,e.update_status):b(e.duration)})})]}),u(n,{className:`py-[8px] w-full`,children:u(r,{className:`text-[16px] font-bold text-text1 leading-[24px] truncate w-full block`,children:e.name})})]},`${e.id}-${i}`)}),k&&u(n,{className:`flex items-center justify-center shrink-0 w-[40px] h-[80px]`,children:u(n,{className:`w-4 h-4 border-2 border-theme1 border-t-transparent rounded-full animate-spin`})})]})]})}export{f as VideoHorizontalListClient};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
|
|
2
|
+
import { VideoHorizontalListInspectorProps, VideoHorizontalListProps, videoHorizontalListInspectorDefaultProps, videoHorizontalListInspectorPropsSchema } from "./schema.mjs";
|
|
3
|
+
import { VideoHorizontalListServer } from "./server.mjs";
|
|
4
|
+
import { videoHorizontalListMaterial } from "./material.mjs";
|
|
5
|
+
import { VideoHorizontalListClient } from "./client.mjs";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
|
|
2
|
+
import { SchemaHasDefaultValue } from "../../../../utils/schema/schema.mjs";
|
|
3
|
+
import { DefineMaterialOption } from "../../../../utils/schema/material.mjs";
|
|
4
|
+
import "../../../../utils.mjs";
|
|
5
|
+
import { VideoHorizontalListServer } from "./server.mjs";
|
|
6
|
+
import * as zod from "zod";
|
|
7
|
+
import * as zod_v4_core0 from "zod/v4/core";
|
|
8
|
+
|
|
9
|
+
//#region components/biz/business/video-horizontal-list/material.d.ts
|
|
10
|
+
/**
|
|
11
|
+
* 视频横向列表物料定义
|
|
12
|
+
*/
|
|
13
|
+
declare const videoHorizontalListMaterial: DefineMaterialOption<typeof VideoHorizontalListServer, zod.ZodObject<{
|
|
14
|
+
blockId: zod.ZodString & SchemaHasDefaultValue;
|
|
15
|
+
title: zod.ZodString & SchemaHasDefaultValue;
|
|
16
|
+
}, zod_v4_core0.$strip>, "video-horizontal-list">;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { videoHorizontalListMaterial };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
|
|
2
|
+
import{defineMaterial as e}from"../../../../utils/schema/material.mjs";import{videoHorizontalListInspectorPropsSchema as t}from"./schema.mjs";import{VideoHorizontalListServer as n}from"./server.mjs";const r=e({type:`video-horizontal-list`,name:`视频横向列表`,icon:`https://cdn.example.com/icons/video-list.png`,category:`CENTER`,serverComponent:n,clientComponent:n,propsSchema:t});export{r as videoHorizontalListMaterial};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
|
|
2
|
+
import { SchemaHasDefaultValue } from "../../../../utils/schema/schema.mjs";
|
|
3
|
+
import "../../../../utils.mjs";
|
|
4
|
+
import z from "zod";
|
|
5
|
+
|
|
6
|
+
//#region components/biz/business/video-horizontal-list/schema.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* 视频横向列表物料属性定义
|
|
9
|
+
*/
|
|
10
|
+
declare const videoHorizontalListInspectorPropsSchema: z.ZodObject<{
|
|
11
|
+
blockId: z.ZodString & SchemaHasDefaultValue;
|
|
12
|
+
title: z.ZodString & SchemaHasDefaultValue;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
declare const videoHorizontalListInspectorDefaultProps: {
|
|
15
|
+
blockId: string;
|
|
16
|
+
title: string;
|
|
17
|
+
};
|
|
18
|
+
type VideoHorizontalListInspectorProps = z.infer<typeof videoHorizontalListInspectorPropsSchema>;
|
|
19
|
+
type VideoHorizontalListProps = VideoHorizontalListInspectorProps;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { VideoHorizontalListInspectorProps, VideoHorizontalListProps, videoHorizontalListInspectorDefaultProps, videoHorizontalListInspectorPropsSchema };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
|
|
2
|
+
import{defineComponentPropsSchema as e,defineTextPropSchema as t,getSchemaDefaultProps as n}from"../../../../utils/schema/schema.mjs";const r=e({blockId:t({label:`推荐位 ID`,defaultValue:``}),title:t({label:`推荐名称`,defaultValue:`推荐视频`})}),i=n(r);export{i as videoHorizontalListInspectorDefaultProps,r as videoHorizontalListInspectorPropsSchema};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
|
|
2
|
+
import { VideoHorizontalListProps } from "./schema.mjs";
|
|
3
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region components/biz/business/video-horizontal-list/server.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* 视频横向列表物料组件 - 服务端部分
|
|
8
|
+
* 负责初始数据的预取和国际化文案
|
|
9
|
+
*/
|
|
10
|
+
declare function VideoHorizontalListServer(props: VideoHorizontalListProps): Promise<react_jsx_runtime0.JSX.Element>;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { VideoHorizontalListServer };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
|
|
2
|
+
import{gContentGetAppChannelBlockData as e}from"../../../../service/generated/client.mjs";import{VideoHorizontalListClient as t}from"./client.mjs";import{jsx as n}from"react/jsx-runtime";import{getTranslations as r}from"next-intl/server";async function i(i){let{blockId:a}=i,o=null,s=await r(`components.biz.business.videoHorizontalList`);if(a)try{o=(await e({block_id:a})).data}catch(e){console.error(`VideoHorizontalListServer prefetch error:`,e)}return n(t,{...i,initialData:o,defaultTitle:s(`defaultTitle`),allEpisodesText:s.raw(`allEpisodes`),updatedToText:s.raw(`updatedTo`)})}export{i as VideoHorizontalListServer};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{cn as e}from"../../../../utils/cn.mjs";import{
|
|
2
|
+
"use client";import{cn as e}from"../../../../utils/cn.mjs";import{useAppContext as t}from"../../../../hooks/use-app-context/index.mjs";import{useRequest as n}from"../../../../hooks/query/use-query.mjs";import{buttonVariants as r}from"./variants.mjs";import{jsx as i}from"react/jsx-runtime";function a(a){let{text:o,disabled:s,loading:c,variant:l=`default`}=a,u=t();console.log({clientContext:u,text:o});function d(){u!==`editor`&&console.log(`invoke`)}return n([`demo`],()=>new Promise(e=>{setTimeout(()=>{e({message:`Hello World`})},200)}),{enabled:u===`renderer`}),u===`editor`?i(`div`,{children:`editor preview button`}):i(`button`,{className:e(r({variant:l})),onClick:d,disabled:s||c,children:o})}export{a as ButtonClient};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
2
|
import { DefineMaterialOption } from "../../../utils/schema/material.mjs";
|
|
3
|
+
import z from "zod";
|
|
3
4
|
import { ComponentType, ReactNode } from "react";
|
|
4
5
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
5
|
-
import z from "zod";
|
|
6
6
|
|
|
7
7
|
//#region components/biz/renderer/renderer.d.ts
|
|
8
8
|
type NodeInspectorProps = Record<string, unknown>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{
|
|
2
|
+
import{generateMaterialMap as e}from"../../../utils/schema/utils.mjs";import{cn as t}from"../../../utils/cn.mjs";import{materials_exports as n}from"../../../materials.mjs";import{Fragment as r,jsx as i,jsxs as a}from"react/jsx-runtime";function o(e,t){let n=t.props,r=e.propsSchema.safeParse(n);return r.success?{isValid:!0,props:r.data}:{isValid:!1,props:n,message:r.error?.message}}function s(e){let{document:t,materialMap:n,nodeId:c,ancestors:l,mode:u}=e;if(l.has(c))return null;let d=t.page.nodes[c];if(!d)return null;let f=new Set(l);f.add(c);let p=d.children.map(e=>i(s,{document:t,materialMap:n,nodeId:e,ancestors:f,mode:u},e)),m=n[d.type];if(!m)return p.length===0?null:i(r,{children:p});let h=o(m,d);return h.isValid?i(u===`client`?m.clientComponent:m.serverComponent,{...h.props,children:p}):a(`div`,{children:[`组件配置错误`,h.message]})}function c(r){let{className:a,document:o,materials:c,mode:l=`server`}=r,u=o.page.nodes[o.page.rootId];if(!u)return i(`div`,{className:t(`funhub-renderer`,a)});let d=e(c??Object.values(n));return i(`div`,{className:t(`funhub-renderer`,a),children:i(s,{document:o,materialMap:d,nodeId:u.id,ancestors:new Set,mode:l})})}export{c as Renderer};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{replaceAtUserElementHtmlStr as e}from"../../../utils/tools.mjs";import{
|
|
2
|
+
"use client";import{replaceAtUserElementHtmlStr as e}from"../../../utils/tools.mjs";import{useRouter as t}from"next/navigation";import{Fragment as n,jsx as r}from"react/jsx-runtime";import i from"html-react-parser";const a=[];function o(o){let{text:s=``,atUsers:c=a,enableNavigation:l=!0}=o,u=e({text:s,atUsers:c}),d=t();return r(n,{children:i(u,{replace:e=>{if(e.type===`tag`&&e.attribs&&e.attribs.class===`mention`){let t=e.attribs[`data-id`];if(!t)return e;let n=e.children&&e.children[0]?e.children[0].data:``;return r(`span`,{className:`mention text-theme1 transition-colors ${l?`hover:text-theme1/80 cursor-pointer`:``}`,"data-id":t,style:{pointerEvents:l?`auto`:`none`},onClick:l?e=>{e.preventDefault(),e.stopPropagation();let n=`/profile/${t}`;d.push(n)}:void 0,children:n})}return e}})})}export{o as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{AlertDialog as e,AlertDialogAction as t,AlertDialogContent as n,AlertDialogDescription as r,AlertDialogFooter as i,AlertDialogHeader as a,AlertDialogTitle as o}from"../../ui/alert-dialog.mjs";import{secondToTime as s}from"../../../utils/common.mjs";import{useBlockedModalStore as c}from"../../../store/modules/blocked-modal-store.mjs";import{useLoginModalStore as l}from"../../../store/modules/login-modal-store.mjs";import{
|
|
2
|
+
"use client";import{AlertDialog as e,AlertDialogAction as t,AlertDialogContent as n,AlertDialogDescription as r,AlertDialogFooter as i,AlertDialogHeader as a,AlertDialogTitle as o}from"../../ui/alert-dialog.mjs";import{secondToTime as s}from"../../../utils/common.mjs";import{useBlockedModalStore as c}from"../../../store/modules/blocked-modal-store.mjs";import{useLoginModalStore as l}from"../../../store/modules/login-modal-store.mjs";import{useRouter as u}from"next/navigation";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{useTranslations as p}from"next-intl";function m(){let m=u(),h=p(`components.common.blockedDialog`),{isOpen:g,blockedRemark:_,blockedEndTime:v,close:y,setOpen:b}=c(),x=v>0?s(v):h(`unblockTimePermanent`),S=_||h(`remarkDefault`);return d(e,{open:g,onOpenChange:e=>{b(e)},children:f(n,{size:`sm`,children:[f(a,{children:[d(o,{className:`text-[16px]`,children:h(`title`)}),d(r,{className:`text-center text-[14px] leading-6 whitespace-pre-line`,children:h(`description`,{remark:S,unblockTime:x})})]}),f(i,{children:[d(t,{onClick:()=>{l.getState().isOpen&&l.getState().setOpen(!1),y(),m.push(`/feedback`)},children:h(`contactSupport`)}),d(t,{onClick:y,children:h(`gotIt`)})]})]})})}export{m as BlockedDialog};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{useUserStore as e}from"../../../store/modules/user-store.mjs";import{pCommunityCreateCollection as t}from"../../../service/generated/client.mjs";import{InputGroup as n,InputGroupAddon as r,InputGroupInput as i}from"../../ui/input-group.mjs";import{useDeleteRequest as
|
|
2
|
+
"use client";import{useUserStore as e}from"../../../store/modules/user-store.mjs";import{pCommunityCreateCollection as t}from"../../../service/generated/client.mjs";import{InputGroup as n,InputGroupAddon as r,InputGroupInput as i}from"../../ui/input-group.mjs";import a from"../../ui/popup.mjs";import{useDeleteRequest as o}from"../../../hooks/query/use-query.mjs";import{useCallback as s,useEffect as c,useState as l}from"react";import{jsx as u,jsxs as d}from"react/jsx-runtime";import{toast as f}from"sonner";import{useTranslations as p}from"next-intl";function m({visible:m,onClose:h,onCreated:g}){let _=p(`components.pages.collectionCreate`),v=p(`components.common.collectionPopup`),{userId:y}=e(),b=o(),[x,S]=l(!1),[C,w]=l({title:``}),T=typeof document>`u`?void 0:document.body;c(()=>{m&&w({title:``})},[m]);let E=s((e,t)=>{w(n=>({...n,[e]:t}))},[]);function D(e){e||h?.()}async function O(){if(x)return;let e=C.title.trim();if(!e){f.error(_(`form.titleRequired`));return}try{S(!0);let n=await t({title:e,cover_image:``});if(n.code===0){f.success(_(`form.createSuccess`)),y&&b([`user-profile`,`mine`,y,`user-collection-created`,y]),g?.();return}f.error(n.message||_(`form.createFailed`))}catch(e){console.error(`创建收藏夹失败`,e),f.error(_(`form.createFailed`))}finally{S(!1)}}return u(a,{open:m,onOpenChange:D,showCloseButton:!1,className:`!z-[1210] h-[260px] rounded-t-[16px] bg-bg1 p-0 text-text1`,overlayClassName:`!z-[1200] bg-black/30`,overlayForceRender:!0,portalContainer:T,children:d(`div`,{className:`bg-bg1 h-[260px] flex flex-col`,children:[u(`div`,{className:`w-full px-[20px]`,children:d(`div`,{className:`w-full h-[56px] flex items-center justify-between`,children:[u(`div`,{className:`text-[18px] text-text1 font-medium`,children:v(`createModalTitle`)}),u(`button`,{type:`button`,className:`h-[56px] text-[16px] text-theme5 font-semibold disabled:text-text3`,onClick:O,disabled:x,children:x?_(`form.creating`):v(`createModalAction`)})]})}),u(`div`,{className:`w-full px-[20px] pt-[12px]`,children:d(n,{className:`!bg-bg2 h-[48px] rounded-[8px] px-[16px]`,children:[u(r,{className:`!text-text1 text-[16px] font-semibold pl-0 pr-2`,align:`inline-start`,children:_(`form.label`)}),u(i,{maxLength:50,className:`!text-text2 text-[16px] text-right placeholder:!text-text3`,placeholder:_(`form.titlePlaceholder`),value:C.title,onChange:e=>E(`title`,e.target.value)})]})})]})})}export{m as CollectionCreateModal};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{AlertDialog as e,AlertDialogAction as t,AlertDialogCancel as n,AlertDialogContent as r,AlertDialogDescription as i,
|
|
2
|
+
"use client";import{AlertDialog as e,AlertDialogAction as t,AlertDialogCancel as n,AlertDialogContent as r,AlertDialogDescription as i,AlertDialogHeader as a,AlertDialogTitle as o}from"../../ui/alert-dialog.mjs";import{jsx as s,jsxs as c}from"react/jsx-runtime";import{useTranslations as l}from"next-intl";function u({open:u,onOpenChange:d,onConfirm:f,onCancel:p,title:m,description:h,confirmText:g,cancelText:_,isConfirming:v=!1,children:y}){let b=l(`components.common`),x=m??b(`title`),S=h??b(`deleteConfirmDialog.description`),C=g??b(`deleteConfirmDialog.confirm`),w=_??b(`deleteConfirmDialog.cancel`);function T(e){e||p?.(),d(e)}function E(){v||f()}return s(e,{open:u,onOpenChange:T,children:c(r,{size:`sm`,className:`max-w-[330px] gap-0 p-0 overflow-hidden rounded-lg bg-bg1 shadow-2xl`,children:[c(a,{className:`flex flex-col items-center justify-center min-h-[110px] p-4 gap-2 text-center`,children:[s(o,{className:`text-[16px] font-normal leading-[24px] text-text1`,style:{fontFamily:`"Source Code Pro", sans-serif`},children:x}),S&&s(i,{className:`text-[14px] leading-[20px] text-text2`,children:S})]}),y,c(`div`,{className:`grid grid-cols-[1fr_1px_1fr] items-center h-[46px] border-t border-line1/5`,children:[s(n,{disabled:v,className:`h-full rounded-none border-none bg-transparent hover:bg-line1/10 text-[16px] font-normal text-text1 outline-none active:opacity-70 transition-opacity`,style:{fontFamily:`"Source Code Pro", sans-serif`},children:w}),s(`div`,{className:`h-[22px] w-px bg-line1/30`}),s(t,{disabled:v,onClick:E,className:`h-full rounded-none border-none bg-transparent hover:bg-line1/10 text-[16px] font-normal text-[#fd4c5e] outline-none active:opacity-70 transition-opacity`,style:{fontFamily:`"Source Code Pro", sans-serif`},children:C})]})]})})}export{u as DeleteConfirmDialog};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{useUserStore as e}from"../../../store/modules/user-store.mjs";import{gUserGetUserInfo as t}from"../../../service/generated/client.mjs";import{Toaster as n}from"../../ui/sonner.mjs";import{
|
|
2
|
+
"use client";import{useUserStore as e}from"../../../store/modules/user-store.mjs";import{gUserGetUserInfo as t}from"../../../service/generated/client.mjs";import{Toaster as n}from"../../ui/sonner.mjs";import{BlockedDialog as r}from"../blocked-dialog/blocked-dialog.mjs";import{useRequest as i}from"../../../hooks/query/use-query.mjs";import{CollectionPopupHost as a}from"../collection-popup/index.mjs";import{LoginDialog as o}from"../login-dialog/login-dialog.mjs";import{MediaPreview as s}from"../media-preview/index.mjs";import{useRouter as c}from"next/navigation";import{useEffect as l,useRef as u,useState as d}from"react";import{jsx as f,jsxs as p}from"react/jsx-runtime";import{QueryClient as m,QueryClientProvider as h}from"@tanstack/react-query";import{NuqsAdapter as g}from"nuqs/adapters/next/app";function _(){let{userId:n,setUserInfo:r}=e(),a={code:0,message:``,data:{}},{data:o}=i([`user-init`,n],()=>n?t({user_id:n}):Promise.resolve(a),{enabled:!!n});return l(()=>{if(!n)return;let e=o?.data;e&&r(e)},[r,n,o]),null}function v(t){let{queryClient:i,children:v}=t,[y]=d(()=>new m),b=i??y,x=c(),S=e(e=>e.isLogin&&!!e.token&&!!e.userId),C=u(S);return l(()=>{C.current&&!S&&(b.clear(),x.refresh()),C.current=S},[S,b,x]),f(h,{client:b,children:p(g,{children:[f(_,{}),v,f(r,{}),f(o,{}),f(a,{}),f(n,{position:`top-center`}),f(s,{})]})})}export{v as FunhubProvider};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{toast as e}from"../../../ui.mjs";import{LeftArrowIcon as t}from"../icons/left-arrow.mjs";import{
|
|
2
|
+
"use client";import{toast as e}from"../../../ui.mjs";import{LeftArrowIcon as t}from"../icons/left-arrow.mjs";import{useRouter as n}from"next/navigation";import{jsx as r,jsxs as i}from"react/jsx-runtime";function a({title:a,leftChild:o,centerChild:s,className:c,rightChild:l,leftIconCss:u,onBack:d}){let f=n();function p(){if(e.dismiss(),d){d?.();return}window.location.search.split(`from_code=`)[1]?f.push(`/`):f.back()}return r(`nav`,{className:`app-top-nav w-full relative ${c?.includes(`h-`)?(c.match(/h-\[?\d\w+\]?/)||[`h-12`])[0]:`h-12`}`,children:i(`div`,{className:`w-full bg-bg1 flex items-center justify-center fixed top-0 left-0 right-0 z-50 border-b border-text1/5 ${c}`,style:{willChange:`transform`,transform:`translateZ(0)`},children:[r(`div`,{className:`absolute z-[1] h-full left-0 top-0`,children:o||r(`div`,{onClick:p,className:`cursor-pointer h-full w-12 flex items-center justify-center`,children:r(t,{className:`w-4 h-4 text-text1 ${u}`})})}),s||r(`p`,{className:`text-text1 line-clamp-1 px-12 text-ellipsis text-lg`,children:a}),l&&r(`div`,{className:`absolute h-full right-2 top-0 flex items-center justify-center`,children:l})]})})}export{a as HeaderNav};
|
|
@@ -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{Text as n}from"../../ui/text.mjs";import{Time as r}from"../../ui/time.mjs";import{FollowButton as i}from"../../pages/(follow)/_components/follow-button/index.mjs";import{
|
|
2
|
+
"use client";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{Time as r}from"../../ui/time.mjs";import{FollowButton as i}from"../../pages/(follow)/_components/follow-button/index.mjs";import{usePathname as a,useRouter as o}from"next/navigation";import{jsx as s,jsxs as c}from"react/jsx-runtime";function l({className:l,infoData:u,onChangeFollow:d,rightChild:f}){let p=a(),m=o(),h=u?.author?.user_id||``,g=u?.author?.nickname||``,_=u?.show_at||u?.create_time;return s(t,{className:`w-full mb-[8px] pt-[16px] px-[12px] ${l}`,children:c(t,{className:`w-full flex items-center justify-between`,children:[c(t,{className:`flex items-center cursor-pointer`,onClick:e=>{e.stopPropagation(),e.preventDefault();let t=`/profile/${h}`;p!==t&&m.push(t)},children:[s(t,{className:`w-[36px] h-[36px] mr-[8px] rounded-full bg-bg2 overflow-hidden`,children:u?.author?.avatar&&s(e,{width:36,height:36,src:u?.author?.avatar,className:`w-full h-full object-cover`,alt:`avatar`})}),c(t,{className:`flex flex-col`,children:[s(n,{className:`block text-text1 text-[14px] leading-[18px] max-w-[220px] overflow-hidden whitespace-nowrap text-ellipsis`,children:g}),s(t,{className:`mt-[4px] h-[14px] leading-[14px]`,children:s(r,{mode:`relative`,value:_,className:`text-text3 text-[12px]`})})]})]}),s(t,{onClick:e=>{e.stopPropagation(),e.preventDefault()},children:f||(h?s(i,{userId:h,hasFollow:!1,onChange:d}):null)})]})})}export{l as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{Box as e}from"../../../ui/box.mjs";import{List as t}from"../../../ui/list.mjs";import{Text as n}from"../../../ui/text.mjs";import{normalizeTimeToMilliseconds as r}from"../../../ui/time.mjs";import{PostListItemSkeleton as i}from"../../skeleton/post-list-item-skeleton.mjs";import{PostListItem as a}from"./post-list-item.mjs";import{
|
|
2
|
+
"use client";import{Box as e}from"../../../ui/box.mjs";import{List as t}from"../../../ui/list.mjs";import{Text as n}from"../../../ui/text.mjs";import{normalizeTimeToMilliseconds as r}from"../../../ui/time.mjs";import{PostListItemSkeleton as i}from"../../skeleton/post-list-item-skeleton.mjs";import{PostListItem as a}from"./post-list-item.mjs";import{useMemo as o}from"react";import{Fragment as s,jsx as c,jsxs as l}from"react/jsx-runtime";import{useTranslations as u}from"next-intl";import d from"next/link";import{useIsClient as f}from"foxact/use-is-client";import{orderBy as p}from"lodash-es";function m(e){let t=r(e);if(!t)return!1;let n=new Date(t),i=new Date;return n.getFullYear()===i.getFullYear()&&n.getMonth()===i.getMonth()&&n.getDate()===i.getDate()}function h(r){let h=u(`components.ui.list`),g=f(),{list:_,loading:v,hasMore:y=!1,loadMore:b,isEditMode:x,selectedIds:S,onToggleSelection:C}=r,w=o(()=>p(_,[`publishTime`],[`desc`]),[_]),{todayList:T,earlierList:E}=o(()=>{if(!g)return{todayList:[],earlierList:w};let e=[],t=[];for(let n of _)m(n.publishTime)?e.push(n):t.push(n);return{todayList:p(e,[`publishTime`],[`desc`]),earlierList:p(t,[`publishTime`],[`desc`])}},[g,_,w]),D=!!v&&_.length===0,O=g;return D?c(e,{className:`bg-bg1`,children:Array.from({length:6}).map((e,t)=>c(i,{isEditMode:x},`post-list-item-skeleton-${t}`))}):l(t,{loading:v,loadMore:b,hasMore:y,empty:`no-content`,emptyText:h(`postList.empty`),children:[O&&T.length>0&&l(s,{children:[c(e,{className:` `,children:c(n,{className:`text-lg text-text1`,children:h(`postList.today`)})}),T.map(e=>x?c(a,{...e,isEditMode:x,isSelected:S?.has(e.id),onToggle:()=>C?.(e.id)},e.id):c(d,{href:`/post/${e.id}`,children:c(a,{...e,isEditMode:x,isSelected:S?.has(e.id),onToggle:()=>C?.(e.id)})},e.id))]}),E.length>0&&l(s,{children:[c(e,{className:` `,children:c(n,{className:`text-lg text-text1`,children:h(`postList.earlier`)})}),E.map(e=>x?c(a,{...e,isEditMode:x,isSelected:S?.has(e.id),onToggle:()=>C?.(e.id)},e.id):c(d,{href:`/post/${e.id}`,children:c(a,{...e,isEditMode:x,isSelected:S?.has(e.id),onToggle:()=>C?.(e.id)})},e.id))]})]})}export{h as PostList};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{useUserStore as e}from"../../../../store/modules/user-store.mjs";import{pInteractionCancelDislike as t,pInteractionCancelLike as n,pInteractionDislike as r,pInteractionLike as i}from"../../../../service/generated/client.mjs";import{useRequireLogin as a}from"../../../../hooks/use-auth.mjs";import{
|
|
2
|
+
"use client";import{useUserStore as e}from"../../../../store/modules/user-store.mjs";import{pInteractionCancelDislike as t,pInteractionCancelLike as n,pInteractionDislike as r,pInteractionLike as i}from"../../../../service/generated/client.mjs";import{useRequireLogin as a}from"../../../../hooks/use-auth.mjs";import{CommentIcon as o}from"../../icons/comment.mjs";import{DeleteIcon as s}from"../../icons/delete.mjs";import{ShareIcon as c}from"../../icons/share.mjs";import{ShareDrawer as l}from"../../share-popup/share-drawer.mjs";import{SharePlatformEnum as u}from"../../../../types/share.mjs";import d from"../../../../utils/share-manager.mjs";import f from"../../../../assets/icons/dislike.mjs";import p from"../../../../assets/icons/dislike_sel.mjs";import m from"../../../../assets/icons/like.mjs";import h from"../../../../assets/icons/like_sel.mjs";import{useState as g}from"react";import{Fragment as _,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(t){let r=x(`components.ui.list.userActivityList`),{contentId:o,count:s=0,isLiked:c=!1,isDisliked:l=!1,dislikeCount:u=0,onLikeSuccess:d,onSuccess:f,className:p=``}=t,[_,S]=g(!1),C=e(e=>e.userId),w=a(),T=c?Math.max(1,s):s>0?s:r(`userActivityListActions.like`);return y(`button`,{className:`flex justify-center items-center gap-1.5 p-2 cursor-pointer ${_?`opacity-50 cursor-not-allowed`:``} ${c?`text-red-500`:`text-text3`} ${p}`,onClick:async()=>{w(async()=>{if(_)return;S(!0);let e={isLiked:c,count:s,isDisliked:l,dislikeCount:u},t=!c,a=Math.max(0,t?s+1:s-1),p=t&&l?!1:l,m=t&&l?Math.max(0,u-1):u;d?.({isLiked:t,count:a,isDisliked:p,dislikeCount:m});try{let t=c?await n({id:o,user_id:C,content_type:2}):await i({id:o,user_id:C,content_type:2});t?.code===0||t?.data?f?.():(d?.({isLiked:e.isLiked,count:e.count,isDisliked:e.isDisliked,dislikeCount:e.dislikeCount}),b.error(t?.message||r(`userActivityListActions.likeFailed`)))}catch(t){console.error(`点赞操作失败:`,t),d?.({isLiked:e.isLiked,count:e.count,isDisliked:e.isDisliked,dislikeCount:e.dislikeCount}),b.error(r(`userActivityListActions.likeFailed`))}finally{S(!1)}})},disabled:_,children:[v(c?h:m,{}),v(`span`,{className:`text-sm`,children:T})]})}function C(n){let i=x(`components.ui.list.userActivityList`),{contentId:o,count:s=0,isDisliked:c=!1,isLiked:l=!1,likeCount:u=0,onDislikeSuccess:d,onSuccess:m,className:h=``}=n,[_,b]=g(!1),S=e(e=>e.userId),C=a();return y(`button`,{className:`flex justify-center items-center gap-1.5 p-2 cursor-pointer ${_?`opacity-50 cursor-not-allowed`:``} ${c?`text-primary`:`text-text3`} ${h}`,onClick:async()=>{C(async()=>{if(_)return;b(!0);let e={isDisliked:c,count:s,isLiked:l,likeCount:u},n=!c,i=Math.max(0,n?s+1:s-1),a=n&&l?!1:l,f=n&&l?Math.max(0,u-1):u;d?.({isDisliked:n,count:i,isLiked:a,likeCount:f});try{(c?await t({id:o,user_id:S,content_type:2}):await r({id:o,user_id:S,content_type:2})).data?m?.():d?.({isDisliked:e.isDisliked,count:e.count,isLiked:e.isLiked,likeCount:e.likeCount})}catch(t){console.error(`点踩操作失败:`,t),d?.({isDisliked:e.isDisliked,count:e.count,isLiked:e.isLiked,likeCount:e.likeCount})}finally{b(!1)}})},disabled:_,children:[v(c?p:f,{}),v(`span`,{className:`text-sm`,children:s||i(`userActivityListActions.dislike`)})]})}function w(e){let t=x(`components.ui.list.userActivityList`),{count:n=0,onClick:r,className:i=``}=e,a=n>0?n:t(`userActivityListActions.comment`);return y(`button`,{className:`flex justify-center items-center gap-1.5 p-2 cursor-pointer text-text3 ${i}`,onClick:r,children:[v(o,{}),v(`span`,{className:`text-sm`,children:a})]})}function T(e){let t=x(`components.ui.list.userActivityList`),{contentId:n,userId:r,isCollected:i,onShareSuccess:a,onClick:o,className:s=``,onCollect:f,onUncollect:p}=e,[m,h]=g(!1);function b(){o?.(),h(!0)}function S(){h(!1),a?.()}function C(){d.showSharePopup({type:u.WECHAT,data:{id:n},copyUrl:`${window.location.origin}/post/${n}`}),S()}function w(){d.showSharePopup({type:u.QQ,data:{id:n},copyUrl:`${window.location.origin}/post/${n}`}),S()}function T(){d.showSharePopup({type:u.WECHAT_MOMENTS,data:{id:n},copyUrl:`${window.location.origin}/post/${n}`}),S()}return y(_,{children:[y(`button`,{className:`flex justify-center items-center gap-1.5 p-2 cursor-pointer text-text3 ${s}`,onClick:b,children:[v(c,{}),v(`span`,{className:`text-sm`,children:t(`userActivityListActions.share`)})]}),v(l,{isCollected:i,open:m,onOpenChange:h,onShareWeChat:C,onShareQQ:w,onShareMoments:T,onCollect:f,onUncollect:p})]})}function E(e){let{onClick:t,disabled:n=!1,className:r=``}=e;return v(`button`,{className:`p-1 ${n?`cursor-not-allowed text-text3 opacity-60`:`cursor-pointer text-text3`} ${r}`,onClick:n?void 0:t,disabled:n,children:v(s,{})})}export{w as ActivityCommentButton,E as ActivityDeleteButton,C as ActivityDislikeButton,S as ActivityLikeButton,T as ActivityShareButton};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{Image as e}from"../../../ui/image.mjs";import{Avatar as t,AvatarFallback as n,AvatarImage as r}from"../../../ui/avatar.mjs";import{Box as i}from"../../../ui/box.mjs";import{Checkbox as a}from"../../../ui/checkbox.mjs";import{Text as o}from"../../../ui/text.mjs";import{Time as s}from"../../../ui/time.mjs";import{useMediaPreview as c}from"../../media-preview/index.mjs";import
|
|
2
|
+
"use client";import{Image as e}from"../../../ui/image.mjs";import{Avatar as t,AvatarFallback as n,AvatarImage as r}from"../../../ui/avatar.mjs";import{Box as i}from"../../../ui/box.mjs";import{Checkbox as a}from"../../../ui/checkbox.mjs";import{Text as o}from"../../../ui/text.mjs";import{Time as s}from"../../../ui/time.mjs";import{useMediaPreview as c}from"../../media-preview/index.mjs";import l from"../../../../assets/icons/detail/video_play.mjs";import{useContentOperate as u}from"../../../../hooks/use-content-operate.mjs";import{ActivityCommentButton as d,ActivityDeleteButton as f,ActivityDislikeButton as p,ActivityLikeButton as ee,ActivityShareButton as m}from"./user-activity-list-actions.mjs";import{useRouter as te}from"next/navigation";import{useEffect as h,useRef as ne,useState as g}from"react";import{jsx as _,jsxs as v}from"react/jsx-runtime";import{toast as y}from"sonner";import{useTranslations as b}from"next-intl";const x=[],S={post:2};function C({medias:t=x,className:n=``,onItemClick:r}){let a=b(`components.ui.list.userActivityList`),o=(t||[]).filter(Boolean).slice(0,9);if(!o.length)return null;function s(e){r?.(e)}function c(t,n,o){let{is_video:c,media_url:u,cover_image:d}=t||{},f=!!c,p=f?d||u||``:u||``;return p?v(i,{className:o||`relative w-full h-full`,onClick:e=>{r&&(e.stopPropagation(),e.preventDefault(),s(n))},children:[_(e,{src:p,alt:a(`userActivityListItem.mediaAlt`),fill:!0,className:`object-cover`}),f&&_(i,{className:`absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 bg-[rgba(0,0,0,0.5)] rounded-full`,children:_(l,{width:36,height:36})})]},n):null}if(o.length===1){let{is_video:e,media_url:t,cover_image:r}=o[0]||{};return _(i,{className:n,children:_(i,{className:`w-full rounded-xl overflow-hidden`,children:c({is_video:e,media_url:t,cover_image:r,__src:e?r||t||``:t||``},0,`relative w-full aspect-square`)})})}return o.length===2?_(i,{className:n,children:_(i,{className:`w-full flex gap-0.5 rounded-xl overflow-hidden`,children:o.map((e,t)=>_(i,{className:`flex-1 aspect-square relative`,children:c(e,t)},t))})}):o.length===3?_(i,{className:n,children:v(i,{className:`w-full h-89.25 flex gap-0.5 rounded-xl overflow-hidden`,children:[_(i,{className:`w-[56.65%] h-full relative`,children:c(o[0],0)}),_(i,{className:`flex-1 flex flex-col gap-0.5`,children:o.slice(1).map((e,t)=>_(i,{className:`w-full flex-1 relative`,children:c(e,t+1)},t))})]})}):o.length===4?_(i,{className:n,children:_(i,{className:`w-full h-89.25 rounded-xl overflow-hidden grid grid-cols-2 grid-rows-2 gap-0.5`,children:o.map((e,t)=>_(i,{className:`w-full h-full relative`,children:c(e,t)},t))})}):o.length===5?_(i,{className:n,children:v(i,{className:`w-full rounded-xl overflow-hidden flex flex-col gap-0.5`,children:[_(i,{className:`w-full h-49.5 flex gap-0.5`,children:o.slice(0,2).map((e,t)=>_(i,{className:`flex-1 h-full relative`,children:c(e,t)},t))}),_(i,{className:`w-full h-33.5 flex gap-0.5`,children:o.slice(2).map((e,t)=>_(i,{className:`flex-1 h-full relative`,children:c(e,t+2)},t))})]})}):o.length===6?_(i,{className:n,children:v(i,{className:`w-full rounded-xl overflow-hidden flex flex-col gap-0.5`,children:[v(i,{className:`w-full h-67.5 flex gap-0.5`,children:[_(i,{className:`w-67.5 h-full relative`,children:c(o[0],0)}),_(i,{className:`flex-1 grid grid-cols-1 grid-rows-2 gap-0.5`,children:o.slice(1,3).map((e,t)=>_(i,{className:`w-full h-full relative`,children:c(e,t+1)},t))})]}),_(i,{className:`w-full h-33.5 grid grid-cols-3 grid-rows-1 gap-0.5`,children:o.slice(3).map((e,t)=>_(i,{className:`w-full h-full relative`,children:c(e,t+3)},t))})]})}):o.length===7?_(i,{className:n,children:v(i,{className:`w-full rounded-xl overflow-hidden flex gap-0.5`,children:[_(i,{className:`w-76 h-67.5 grid grid-cols-2 grid-rows-2 gap-0.5`,children:o.slice(0,4).map((e,t)=>_(i,{className:`w-full h-full relative`,children:c(e,t)},t))}),_(i,{className:`flex-1 grid grid-cols-1 grid-rows-3 gap-0.5`,children:o.slice(4).map((e,t)=>_(i,{className:`w-full h-full relative`,children:c(e,t+4)},t))})]})}):o.length===8?_(i,{className:n,children:v(i,{className:`w-full rounded-xl overflow-hidden flex flex-col gap-0.5`,children:[_(i,{className:`w-full h-33.5 flex gap-0.5 items-center`,children:o.slice(0,2).map((e,t)=>_(i,{className:`flex-1 h-full relative`,children:c(e,t)},t))}),_(i,{className:`w-full h-67.5 grid grid-cols-3 grid-rows-2 gap-0.5`,children:o.slice(2).map((e,t)=>_(i,{className:`w-full h-full relative`,children:c(e,t+2)},t))})]})}):_(i,{className:n,children:_(i,{className:`w-full h-101.5 rounded-xl overflow-hidden grid grid-cols-3 grid-rows-3 gap-0.5`,children:o.slice(0,9).map((e,t)=>_(i,{className:`w-full h-full relative`,children:c(e,t)},t))})})}function w(e){let l=b(`components.ui.list.userActivityList`),{content_id:x,author:w,rightSlot:T,create_time:re,content:E,medias:ie,canEdit:ae=!1,isDeleting:oe=!1,isEditMode:se=!1,isSelected:D=!1,onToggle:O,interaction:k,like_count:A=0,is_liked:j=!1,onLikeSuccess:ce,dislike_count:M=0,is_dislike:N=!1,is_collected:le,onDislikeSuccess:P,comment_count:F=0,onDelete:I,onShare:L,onShareSuccess:R,onActionSuccess:z,onCollectChange:B}=e,V=k?.is_collected??le??!1,[H,U]=g({isLiked:j,likeCount:A,isDisliked:N,dislikeCount:M,isCollected:V}),[W,G]=g(!1),[ue,K]=g(!1),q=ne(null),J=ie?.filter(Boolean)??[],Y=w?.nickname||w?.nick_name||``,de=w?.avatar||w?.avatar_url||``;h(()=>{U({isLiked:j,likeCount:A,isDisliked:N,dislikeCount:M,isCollected:V})},[M,N,j,A,V]),h(()=>{G(!1)},[E]),h(()=>()=>{q.current&&=(clearTimeout(q.current),null)},[]);function fe(e){U(t=>({...t,isLiked:e.isLiked,likeCount:e.count,isDisliked:e.isDisliked??t.isDisliked,dislikeCount:e.dislikeCount??t.dislikeCount})),ce?.(e)}function pe(e){U(t=>({...t,isDisliked:e.isDisliked,dislikeCount:e.count,isLiked:e.isLiked??t.isLiked,likeCount:e.likeCount??t.likeCount})),P?.(e)}let{handleToCollectionOperate:me}=u({id:x||``,isLike:H.isLiked,isDislike:H.isDisliked,isCollect:H.isCollected,likeCnt:H.likeCount,dislikeCnt:H.dislikeCount,contentType:S.post});function X(){q.current&&=(clearTimeout(q.current),null)}function Z(e){U(t=>({...t,isCollected:e})),z?.(),x&&B?.(x,e)}function Q(e){if(!x){y.error(l(`userActivityListItem.collectFailed`));return}if(!ue){if(K(!0),X(),!me({currentCollect:e,onUpdate:({isCollect:e})=>{X(),Z(e),K(!1)}})){y.error(l(`userActivityListItem.collectFailed`)),K(!1);return}q.current=setTimeout(()=>{K(!1),q.current=null},300)}}function he(e){return!!(e&&e.length>180)}function ge(){G(e=>!e)}let $=te(),_e=()=>{$.push(`/post/${x}`)},ve=e=>{e.stopPropagation(),e.preventDefault(),$.push(`/profile/${w?.user_id}`)},ye=()=>{$.push(`/post/${x}?tab=comment`)},be=c();function xe(e){let t=J.map(e=>({src:e.media_url,type:e.is_video?`video`:`image`,cover:e.cover_image}));t.length&&be.open(t,e)}return _(i,{className:`flex items-start gap-2 p-3`,children:v(i,{className:`flex-1 min-w-0`,children:[v(i,{className:`flex items-center gap-2 mb-3`,children:[v(i,{className:`flex items-center gap-2 shrink-0`,children:[se&&_(a,{checked:D,onCheckedChange:O}),v(t,{className:`w-10 h-10`,onClick:ve,children:[_(r,{src:de,alt:Y}),_(n,{})]})]}),v(i,{className:`flex-1 min-w-0`,children:[_(o,{as:`p`,className:`text-sm text-text1 line-clamp-1 font-medium`,children:Y}),_(i,{className:`h-[1em]`,children:_(s,{value:re,className:`text-xs text-text3`,format:`YYYY-MM-DD HH:mm`})})]}),T&&_(i,{className:`shrink-0`,onClick:e=>{e.stopPropagation(),e.preventDefault()},children:T}),ae&&_(f,{onClick:I,disabled:oe})]}),v(i,{onClick:_e,children:[v(i,{className:`mb-3`,children:[E&&v(i,{children:[_(o,{className:`text-sm text-text1 leading-5 whitespace-pre-wrap text-ellipsis ${W?`break-all`:`line-clamp-3`}`,dangerouslySetInnerHTML:{__html:E}}),he(E)&&_(i,{className:`mt-1 text-xs text-text3`,onClick:e=>{e.stopPropagation(),e.preventDefault(),ge()},children:l(W?`userActivityListItem.collapse`:`userActivityListItem.expand`)})]}),J.length>0&&_(C,{className:`mt-2`,medias:J,onItemClick:xe})]}),v(i,{className:`flex items-center justify-around text-text3 *:min-w-20`,onClick:e=>{e.stopPropagation(),e.preventDefault()},children:[_(ee,{contentId:x||``,count:H.likeCount,isLiked:H.isLiked,isDisliked:H.isDisliked,dislikeCount:H.dislikeCount,onLikeSuccess:fe,onSuccess:z}),_(p,{contentId:x||``,count:H.dislikeCount,isDisliked:H.isDisliked,isLiked:H.isLiked,likeCount:H.likeCount,onDislikeSuccess:pe,onSuccess:z}),_(d,{count:F,onClick:ye}),_(m,{isCollected:H.isCollected,contentId:x||``,userId:w?.user_id??``,onShareSuccess:R,onClick:L,onCollect:()=>Q(!1),onUncollect:()=>Q(!0)})]})]})]})})}export{w as UserActivityListItem,C as UserActivityMediaGrid};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{Box as e}from"../../../ui/box.mjs";import{List as t}from"../../../ui/list.mjs";import{Text as n}from"../../../ui/text.mjs";import{normalizeTimeToMilliseconds as r}from"../../../ui/time.mjs";import{VideoListItemSkeleton as i}from"../../skeleton/video-list-item-skeleton.mjs";import{VideoListItem as a}from"./video-list-item.mjs";import{
|
|
2
|
+
"use client";import{Box as e}from"../../../ui/box.mjs";import{List as t}from"../../../ui/list.mjs";import{Text as n}from"../../../ui/text.mjs";import{normalizeTimeToMilliseconds as r}from"../../../ui/time.mjs";import{VideoListItemSkeleton as i}from"../../skeleton/video-list-item-skeleton.mjs";import{VideoListItem as a}from"./video-list-item.mjs";import{useMemo as o}from"react";import{Fragment as s,jsx as c,jsxs as l}from"react/jsx-runtime";import{useTranslations as u}from"next-intl";import d from"next/link";import{useIsClient as f}from"foxact/use-is-client";import{orderBy as p}from"lodash-es";function m(e){let t=r(e);if(!t)return!1;let n=new Date(t),i=new Date;return n.getFullYear()===i.getFullYear()&&n.getMonth()===i.getMonth()&&n.getDate()===i.getDate()}function h(r){let h=u(`components.ui.list`),g=f(),{list:_,showVideoProgress:v,loading:y,hasMore:b=!1,loadMore:x,isEditMode:S,selectedIds:C,onToggleSelection:w}=r,T=o(()=>p(_,[`publishTime`],[`desc`]),[_]),{todayList:E,earlierList:D}=o(()=>{if(!g)return{todayList:[],earlierList:T};let e=[],t=[];for(let n of _)m(n.publishTime)?e.push(n):t.push(n);return{todayList:p(e,[`publishTime`],[`desc`]),earlierList:p(t,[`publishTime`],[`desc`])}},[g,_,T]),O=!!y&&_.length===0,k=g;return O?c(e,{className:`bg-bg1`,children:Array.from({length:6}).map((e,t)=>c(i,{isEditMode:S,showVideoProgress:v},`video-list-item-skeleton-${t}`))}):l(t,{loading:y,loadMore:x,hasMore:b,empty:`no-content`,emptyText:h(`videoList.empty`),children:[k&&E.length>0&&l(s,{children:[c(e,{className:` `,children:c(n,{className:`text-lg text-text1`,children:h(`videoList.today`)})}),E.map(e=>S?c(a,{showVideoProgress:v,isEditMode:S,isSelected:C?.has(e.id),...e,onToggle:()=>w?.(e.id)},e.id):c(d,{href:`/video/${e.id}/${e.title}`,children:c(a,{showVideoProgress:v,isEditMode:S,isSelected:C?.has(e.id),...e,onToggle:()=>w?.(e.id)},e.id)},e.id))]}),D.length>0&&l(s,{children:[c(e,{className:` `,children:c(n,{className:`text-lg text-text1`,children:h(`videoList.earlier`)})}),D.map(e=>S?c(a,{showVideoProgress:v,isEditMode:S,isSelected:C?.has(e.id),...e,onToggle:()=>w?.(e.id)},e.id):c(d,{href:`/video/${e.id}/${e.title}`,children:c(a,{showVideoProgress:v,isEditMode:S,isSelected:C?.has(e.id),...e,onToggle:()=>w?.(e.id)},e.id)},e.id))]})]})}export{h as VideoList};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{Button as e}from"../../ui/button.mjs";import{parseResolution as t}from"../../../utils/common.mjs";import n from"../../../utils/event-bus.mjs";import r
|
|
2
|
+
"use client";import{Button as e}from"../../ui/button.mjs";import{parseResolution as t}from"../../../utils/common.mjs";import n from"../../../utils/event-bus.mjs";import{eventKey as r}from"../../../constants/event-key.mjs";import i from"../video-player/index.mjs";import a from"./popup-video.module.mjs";import{usePathname as o}from"next/navigation";import{useCallback as s,useEffect as c,useState as l}from"react";import{jsx as u,jsxs as d}from"react/jsx-runtime";function f(){let f=o(),[p,m]=l(!1),[h,g]=l(null),[_,v]=l(0),y=s(e=>{if(typeof window>`u`)return 0;let{width:n,height:r}=t(e.resolution);return n<=0?0:Math.max(0,r*(window.innerWidth/n))},[]),b=s(({info:e,show:t})=>{if(!e||!t){m(!1),g(null);return}g(e),v(y(e)),m(!0)},[y]);return c(()=>(n.on(r.SHOW_POPUP_VIDEO,b),()=>{n.off(r.SHOW_POPUP_VIDEO,b)}),[b]),c(()=>{m(!1),g(null)},[f]),!p||!h?null:d(`div`,{className:`fixed inset-0 z-[9999] flex items-center justify-center bg-black/95`,children:[u(e,{variant:`ghost`,className:`absolute left-4 top-4 h-10 w-10 rounded-full border border-white/20 text-white`,onClick:()=>{m(!1),g(null)},children:`←`}),u(`div`,{className:a.popupVideo,style:{width:`100%`,maxHeight:`100%`,height:_>0?`${_}px`:`auto`},children:u(i,{plyerId:h.plyerId,resolution:h.resolution,poster:h.poster||``,videoUrl:h.videoUrl||``,hlsList:h.hlsList,mergeConfig:_>0?{}:{fitVideoSize:`fixWidth`}})})]})}export{f as default};
|