@funhub/platform 0.2.3-beta.1 → 0.2.3
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/channel-list/channel-active-indicator.mjs +2 -0
- package/dist/assets/icons/common/header-menu.mjs +2 -0
- package/dist/assets/icons/common/header-search-icon.mjs +2 -0
- package/dist/assets/icons/common/right_arrow_thin.mjs +2 -0
- package/dist/assets/icons/eye-off-icon.mjs +1 -1
- package/dist/assets/icons/marquee-close.mjs +2 -0
- package/dist/assets/icons/marquee-speaker.mjs +2 -0
- package/dist/assets/images/shortcut-grid/shortcut-grid-card-bg-primary.mjs +2 -0
- package/dist/biz.d.mts +11 -4
- package/dist/biz.mjs +1 -1
- package/dist/common.d.mts +5 -2
- package/dist/common.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/business/advertisement/ad-match.mjs +1 -1
- package/dist/components/biz/business/advertisement/banner-ad/client.mjs +1 -1
- package/dist/components/biz/business/advertisement/banner-ad/material.d.mts +2 -2
- package/dist/components/biz/business/advertisement/banner-ad/material.mjs +1 -1
- package/dist/components/biz/business/advertisement/banner-ad/schema.d.mts +9 -4
- package/dist/components/biz/business/advertisement/banner-ad/schema.mjs +1 -1
- package/dist/components/biz/business/advertisement/feed-ad/index.d.mts +1 -31
- package/dist/components/biz/business/advertisement/feed-ad/index.mjs +1 -1
- package/dist/components/biz/business/advertisement/floating-ad/client.mjs +1 -1
- package/dist/components/biz/business/advertisement/floating-ad/material.mjs +1 -1
- package/dist/components/biz/business/advertisement/icon-ad/client.mjs +1 -1
- package/dist/components/biz/business/advertisement/icon-ad/material.d.mts +1 -1
- package/dist/components/biz/business/advertisement/icon-ad/material.mjs +1 -1
- package/dist/components/biz/business/advertisement/icon-ad/schema.d.mts +7 -1
- package/dist/components/biz/business/advertisement/icon-ad/schema.mjs +1 -1
- package/dist/components/biz/business/advertisement/index.d.mts +2 -2
- package/dist/components/biz/business/advertisement/popup-ad/client.mjs +2 -2
- package/dist/components/biz/business/advertisement/popup-ad/index.d.mts +1 -1
- package/dist/components/biz/business/advertisement/popup-ad/material.d.mts +2 -2
- package/dist/components/biz/business/advertisement/popup-ad/schema.d.mts +14 -15
- package/dist/components/biz/business/advertisement/popup-ad/schema.mjs +1 -1
- package/dist/components/biz/business/advertisement/text-ad/client.mjs +1 -1
- package/dist/components/biz/business/advertisement/text-ad/material.d.mts +1 -1
- package/dist/components/biz/business/advertisement/text-ad/material.mjs +1 -1
- package/dist/components/biz/business/advertisement/text-ad/schema.d.mts +5 -1
- package/dist/components/biz/business/advertisement/text-ad/schema.mjs +1 -1
- package/dist/components/biz/business/banner/variants/basic-banner/runtime/client.mjs +1 -1
- package/dist/components/biz/business/banner-carousel/client.d.mts +2 -1
- package/dist/components/biz/business/banner-carousel/client.mjs +1 -1
- package/dist/components/biz/business/banner-carousel/default-props.mjs +1 -1
- package/dist/components/biz/business/channel-list/client.mjs +1 -1
- package/dist/components/biz/business/channel-list/default-props.mjs +1 -1
- package/dist/components/biz/business/detail/shared/detail-operate.mjs +1 -1
- package/dist/components/biz/business/detail/shared/editor-preview.mjs +1 -1
- package/dist/components/biz/business/detail/shared/registry.d.mts +36 -1
- package/dist/components/biz/business/detail/shared/registry.mjs +1 -1
- package/dist/components/biz/business/detail/video-detail-actions/client.mjs +1 -1
- package/dist/components/biz/business/detail/video-detail-info/client.mjs +1 -1
- package/dist/components/biz/business/detail/video-detail-recommend/client.d.mts +1 -13
- package/dist/components/biz/business/detail/video-detail-recommend/client.mjs +1 -1
- package/dist/components/biz/business/detail/video-detail-recommend/material.mjs +1 -1
- package/dist/components/biz/business/detail/video-detail-recommend/shared.mjs +2 -0
- package/dist/components/biz/business/detail/video-detail-waterfall-recommend/client.d.mts +8 -0
- package/dist/components/biz/business/detail/video-detail-waterfall-recommend/client.mjs +2 -0
- package/dist/components/biz/business/detail/video-detail-waterfall-recommend/index.d.mts +5 -0
- package/dist/components/biz/business/detail/video-detail-waterfall-recommend/material.d.mts +45 -0
- package/dist/components/biz/business/detail/video-detail-waterfall-recommend/material.mjs +2 -0
- package/dist/components/biz/business/detail/video-detail-waterfall-recommend/schema.d.mts +9 -0
- package/dist/components/biz/business/detail/video-detail-waterfall-recommend/schema.mjs +2 -0
- package/dist/components/biz/business/detail/video-detail-waterfall-recommend/server.d.mts +11 -0
- package/dist/components/biz/business/detail/video-detail-waterfall-recommend/server.mjs +2 -0
- package/dist/components/biz/business/header-search/header-avatar-icon/client.mjs +1 -1
- package/dist/components/biz/business/header-search/header-avatar-logo-search/client.d.mts +1 -1
- package/dist/components/biz/business/header-search/header-avatar-logo-search/client.mjs +1 -1
- package/dist/components/biz/business/header-search/header-avatar-logo-search/schema.d.mts +4 -3
- package/dist/components/biz/business/header-search/header-avatar-logo-search/schema.mjs +1 -1
- package/dist/components/biz/business/header-search/header-avatar-logo-search-icon/client.mjs +1 -1
- package/dist/components/biz/business/header-search/header-logo-search/client.mjs +1 -1
- package/dist/components/biz/business/header-search/header-search/client.mjs +1 -1
- package/dist/components/biz/business/header-search/shared/avatar.mjs +1 -1
- package/dist/components/biz/business/header-search/shared/header-action.mjs +2 -0
- package/dist/components/biz/business/header-search/shared/header-search-icon.mjs +2 -0
- package/dist/components/biz/business/header-search/shared/header-shell.mjs +2 -0
- package/dist/components/biz/business/header-search/shared/logo.mjs +1 -1
- package/dist/components/biz/business/header-search/shared/search.mjs +1 -1
- package/dist/components/biz/business/home-recommend/home-recommend-grid/inspector-schema.d.mts +0 -8
- package/dist/components/biz/business/home-recommend/home-recommend-grid/inspector-schema.mjs +1 -1
- package/dist/components/biz/business/home-recommend/home-recommend-grid/material.d.mts +0 -8
- package/dist/components/biz/business/home-recommend/home-recommend-waterfall/inspector-schema.d.mts +0 -8
- package/dist/components/biz/business/home-recommend/home-recommend-waterfall/inspector-schema.mjs +1 -1
- package/dist/components/biz/business/home-recommend/home-recommend-waterfall/material.d.mts +0 -8
- package/dist/components/biz/business/home-recommend/shared/home-recommend-base.mjs +1 -1
- package/dist/components/biz/business/home-recommend/shared/home-recommend-preview.mjs +1 -1
- package/dist/components/biz/business/hot-recommend/client.d.mts +17 -0
- package/dist/components/biz/business/hot-recommend/client.mjs +2 -0
- package/dist/components/biz/business/hot-recommend/index.d.mts +5 -0
- package/dist/components/biz/business/hot-recommend/material.d.mts +24 -0
- package/dist/components/biz/business/hot-recommend/material.mjs +2 -0
- package/dist/components/biz/business/hot-recommend/schema.d.mts +23 -0
- package/dist/components/biz/business/hot-recommend/schema.mjs +2 -0
- package/dist/components/biz/business/hot-recommend/server.d.mts +11 -0
- package/dist/components/biz/business/hot-recommend/server.mjs +2 -0
- package/dist/components/biz/business/index.d.mts +12 -3
- package/dist/components/biz/business/large-feature-grid/card-item.mjs +1 -1
- package/dist/components/biz/business/large-feature-grid/client.mjs +1 -1
- package/dist/components/biz/business/large-feature-grid/schema.mjs +1 -1
- package/dist/components/biz/business/marquee/client.mjs +1 -1
- package/dist/components/biz/business/marquee/marquee.module.mjs +2 -6
- package/dist/components/biz/business/marquee/material.d.mts +1 -1
- package/dist/components/biz/business/marquee/schema.d.mts +1 -1
- package/dist/components/biz/business/nav-bar/variants/basic-nav-bar/runtime/client.mjs +1 -1
- package/dist/components/biz/business/profile/index.d.mts +1 -1
- package/dist/components/biz/business/profile/profile-header/client.d.mts +2 -1
- package/dist/components/biz/business/profile/profile-header/client.mjs +1 -1
- package/dist/components/biz/business/profile/profile-header/index.d.mts +1 -1
- 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/client.mjs +1 -1
- package/dist/components/biz/business/profile/profile-main/empty-state.mjs +2 -0
- package/dist/components/biz/business/profile/profile-main/shell.mjs +1 -1
- package/dist/components/biz/business/profile/profile-main/tabs/collect-tab/client.mjs +1 -1
- package/dist/components/biz/business/profile/profile-main/tabs/collect-tab/video-waterfall.mjs +2 -0
- package/dist/components/biz/business/profile/profile-main/tabs/history-tab/client.mjs +1 -1
- package/dist/components/biz/business/profile/profile-main/tabs/like-tab/client.d.mts +5 -1
- package/dist/components/biz/business/profile/profile-main/tabs/like-tab/client.mjs +1 -1
- package/dist/components/biz/business/profile/profile-main/utils.mjs +1 -1
- package/dist/components/biz/business/ranking-recommend/client.d.mts +17 -0
- package/dist/components/biz/business/ranking-recommend/client.mjs +70 -0
- package/dist/components/biz/business/ranking-recommend/material.d.mts +35 -0
- package/dist/components/biz/business/ranking-recommend/material.mjs +2 -0
- package/dist/components/biz/business/ranking-recommend/schema.d.mts +35 -0
- package/dist/components/biz/business/ranking-recommend/schema.mjs +2 -0
- package/dist/components/biz/business/ranking-recommend/server.d.mts +11 -0
- package/dist/components/biz/business/ranking-recommend/server.mjs +2 -0
- package/dist/components/biz/business/ranking-recommend/shared/query.mjs +2 -0
- package/dist/components/biz/business/ranking-recommend/shared.d.mts +15 -0
- package/dist/components/biz/business/ranking-recommend/shared.mjs +2 -0
- package/dist/components/biz/business/search-history/client.mjs +1 -1
- package/dist/components/biz/business/search-history/schema.mjs +1 -1
- package/dist/components/biz/business/search-input/client.mjs +1 -1
- package/dist/components/biz/business/search-waterfall-recommend/client.d.mts +9 -0
- package/dist/components/biz/business/search-waterfall-recommend/client.mjs +2 -0
- package/dist/components/biz/business/search-waterfall-recommend/index.d.mts +4 -0
- package/dist/components/biz/business/search-waterfall-recommend/material.d.mts +40 -0
- package/dist/components/biz/business/search-waterfall-recommend/material.mjs +2 -0
- package/dist/components/biz/business/search-waterfall-recommend/server.d.mts +8 -0
- package/dist/components/biz/business/search-waterfall-recommend/server.mjs +2 -0
- package/dist/components/biz/business/shortcut-grid/client.mjs +1 -1
- package/dist/components/biz/business/tab-bar/client.mjs +1 -1
- package/dist/components/common/collection-popup/create-collection-sheet.d.mts +41 -0
- package/dist/components/common/collection-popup/create-collection-sheet.mjs +2 -0
- package/dist/components/common/collection-popup/index.d.mts +1 -0
- package/dist/components/common/collection-popup/index.mjs +1 -1
- package/dist/components/common/icons/setting.mjs +1 -1
- package/dist/components/common/list/collection-list/collection-list-item.d.mts +8 -0
- package/dist/components/common/list/collection-list/collection-list-item.mjs +1 -1
- package/dist/components/common/list/collection-list/collection-list.d.mts +6 -0
- package/dist/components/common/list/collection-list/collection-list.mjs +1 -1
- package/dist/components/common/list/collection-list/collection-select-icon.mjs +2 -0
- package/dist/components/common/list/waterfall-recommend/index.d.mts +2 -0
- package/dist/components/common/list/waterfall-recommend/waterfall-recommend.d.mts +99 -0
- package/dist/components/common/list/waterfall-recommend/waterfall-recommend.mjs +2 -0
- package/dist/components/common/series-episodes/index.d.mts +3 -1
- package/dist/components/common/series-episodes/index.mjs +1 -1
- package/dist/components/common/tab-bar/index.mjs +1 -1
- package/dist/components/pages/collection-detail/_components/collection-detail-video-card.mjs +2 -0
- package/dist/components/pages/collection-detail/detail.mjs +1 -1
- package/dist/components/pages/edit/page.mjs +1 -1
- package/dist/components/pages/home/client.mjs +1 -1
- package/dist/components/pages/login/auth-page-styles.mjs +6 -0
- package/dist/components/pages/login/login-client.mjs +1 -1
- package/dist/components/pages/login/register.mjs +1 -1
- package/dist/components/pages/login/verify.mjs +1 -4
- package/dist/components/pages/publish/components/collection.mjs +1 -1
- package/dist/components/pages/search/page-client.mjs +1 -1
- package/dist/components/pages/search/search-result/index.mjs +1 -1
- package/dist/components/pages/search/search-result/search-all.mjs +1 -1
- package/dist/components/pages/search/search-result/search-user.mjs +1 -1
- package/dist/components/pages/search/search-result/search-video-info.mjs +1 -1
- package/dist/components/pages/search/search-result/shared.mjs +2 -0
- package/dist/components/pages/search/top-header.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-empty.mjs +2 -0
- 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-info.mjs +2 -0
- package/dist/components/pages/search-result/shared.mjs +2 -0
- package/dist/components/pages/search-result/top-header.mjs +2 -0
- package/dist/components/pages/settings/_components/reset-password-drawer.mjs +2 -2
- package/dist/components/pages/settings/_components/settings.mjs +1 -1
- package/dist/components/pages/user-follow/_components/follow-no-login.mjs +1 -1
- package/dist/components/pages/video-list/video-list-client.mjs +1 -1
- package/dist/components/pages/video-list/video-list-recommend-item.mjs +2 -0
- package/dist/components/pages/video-list/video-list-skeleton.d.mts +2 -3
- package/dist/components/pages/video-list/video-list-skeleton.mjs +1 -1
- package/dist/components/ui/badge.d.mts +1 -1
- package/dist/components/ui/box.d.mts +1 -1
- package/dist/components/ui/button.d.mts +1 -1
- package/dist/i18n/locales/en.mjs +2 -2
- package/dist/i18n/locales/zh-CN.mjs +2 -2
- package/dist/materials.d.mts +6 -1
- package/dist/materials.mjs +1 -1
- package/dist/service/generated/client.d.mts +38 -2
- package/dist/service/generated/client.mjs +1 -1
- package/dist/service/generated/tanstack.d.mts +47 -2
- package/dist/service/generated/tanstack.mjs +1 -1
- package/dist/service.d.mts +3 -3
- package/dist/service.mjs +1 -1
- package/dist/theme-tokens.d.mts +9 -0
- package/dist/theme-tokens.mjs +2 -0
- package/dist/types.d.mts +662 -9
- package/dist/utils/helper.d.mts +1 -1
- package/dist/utils/helper.mjs +1 -1
- package/package.json +7 -2
- package/theme.css +170 -59
- package/dist/assets/icons/detail/collect_nor.mjs +0 -2
- package/dist/assets/icons/detail/collect_sel.mjs +0 -2
- package/dist/assets/icons/detail/share.mjs +0 -2
- package/dist/assets/icons/marquee-enter.mjs +0 -2
- package/dist/assets/icons/right_arrow.mjs +0 -2
- package/dist/assets/icons/search/avatar.mjs +0 -2
- package/dist/assets/images/marquee.mjs +0 -2
- package/dist/components/biz/business/detail/shared/detail-introduction.mjs +0 -2
- package/dist/components/common/collection-popup/collection-create-modal.mjs +0 -2
- package/dist/components/common/skeleton/search-video-card-skeleton.mjs +0 -2
- package/dist/components/pages/search/search-utils.mjs +0 -2
- package/dist/components/pages/search-result/search-result-skeleton.mjs +0 -2
- package/dist/components/pages/search-result/search-video.mjs +0 -2
- package/dist/components/pages/video-list/video-list-item.mjs +0 -2
|
@@ -5,41 +5,11 @@ import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
|
5
5
|
/**
|
|
6
6
|
* 信息流广告项最小识别结构。
|
|
7
7
|
*/
|
|
8
|
-
interface FeedAdPayloadLike {
|
|
9
|
-
/**
|
|
10
|
-
* 广告业务编码。
|
|
11
|
-
*/
|
|
12
|
-
ad_code?: string;
|
|
13
|
-
/**
|
|
14
|
-
* 广告跳转链接。
|
|
15
|
-
*/
|
|
16
|
-
ad_advertise_url?: string;
|
|
17
|
-
/**
|
|
18
|
-
* 广告素材地址。
|
|
19
|
-
*/
|
|
20
|
-
ad_advertise_icon?: string;
|
|
21
|
-
/**
|
|
22
|
-
* 广告类型。
|
|
23
|
-
*/
|
|
24
|
-
ad_advertise_type?: number;
|
|
25
|
-
/**
|
|
26
|
-
* 广告文案描述。
|
|
27
|
-
*/
|
|
28
|
-
ad_advertise_desc?: string;
|
|
29
|
-
/**
|
|
30
|
-
* 广告扩展字段。
|
|
31
|
-
*/
|
|
32
|
-
ad_ext_data?: string;
|
|
33
|
-
}
|
|
34
8
|
interface FeedAdItemLike {
|
|
35
9
|
/**
|
|
36
10
|
* 是否广告。
|
|
37
11
|
*/
|
|
38
12
|
is_ad?: boolean;
|
|
39
|
-
/**
|
|
40
|
-
* 新版广告对象。
|
|
41
|
-
*/
|
|
42
|
-
ad?: FeedAdPayloadLike;
|
|
43
13
|
/**
|
|
44
14
|
* 广告跳转链接。
|
|
45
15
|
*/
|
|
@@ -66,4 +36,4 @@ declare function getFeedAdIcon(item: FeedAdItemLike | null | undefined): string;
|
|
|
66
36
|
*/
|
|
67
37
|
declare function FeedAdBadge(): react_jsx_runtime0.JSX.Element;
|
|
68
38
|
//#endregion
|
|
69
|
-
export { FeedAdBadge, FeedAdItemLike,
|
|
39
|
+
export { FeedAdBadge, FeedAdItemLike, getFeedAdIcon, getFeedAdJumpUrl, isFeedAdItem };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{Text as e}from"../../../../ui/text.mjs";import{jsx as t}from"react/jsx-runtime";function n(e){return e?.is_ad===!0}function r(e){return e?.
|
|
2
|
+
"use client";import{Text as e}from"../../../../ui/text.mjs";import{jsx as t}from"react/jsx-runtime";function n(e){return e?.is_ad===!0}function r(e){return e?.ad_advertise_url||``}function i(e){return e?.ad_advertise_icon||``}function a(){return t(e,{className:`inline-flex rounded-[10px] bg-black/65 px-[6px] py-[2px] text-[10px] leading-[14px] text-white`,children:`广告`})}export{a as FeedAdBadge,i as getFeedAdIcon,r as getFeedAdJumpUrl,n as isFeedAdItem};
|
|
@@ -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"../../../../ui/link.mjs";import{adaptFloatingAdItem as r}from"../ad-match.mjs";import{useAdProvider as i}from"../ad-provider.mjs";import{
|
|
2
|
+
"use client";import{Image as e}from"../../../../ui/image.mjs";import{Box as t}from"../../../../ui/box.mjs";import n from"../../../../ui/link.mjs";import{adaptFloatingAdItem as r}from"../ad-match.mjs";import{useAdProvider as i}from"../ad-provider.mjs";import{useMemo as a}from"react";import{jsx as o}from"react/jsx-runtime";function s({mode:s=`renderer`,ad:c,materialUrl:l,jumpUrl:u,name:d,bottomOffset:f=100,rightOffset:p=20,pointerEventsDisabled:m=!1,onClick:h}){let g=i(),_=a(()=>{let e=c??{materialUrl:l||``,jumpUrl:u||``,name:d};return r(g?.matchData)??e},[c,g?.matchData,u,l,d]);if(!_.materialUrl||!_.jumpUrl)return null;let v=o(t,{className:`relative flex h-full w-full overflow-hidden`,style:{borderRadius:`8px`},"aria-label":_.name||`悬浮广告`,children:o(t,{className:`absolute inset-0`,children:o(e,{src:_.materialUrl,alt:_.name||`悬浮广告`,fill:!0,className:`object-cover object-center`,unoptimized:!0})})}),y={bottom:`${f}px`,right:`${p}px`,width:`75px`,height:`75px`,pointerEvents:m?`none`:void 0};return h?o(t,{className:`fixed z-50 block cursor-pointer`,style:y,onClick:h,children:v}):o(n,{href:_.jumpUrl,className:`fixed z-50 block`,style:y,children:v})}export{s as FloatingAd};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{defineMaterial as e}from"../../../../../utils/schema/material.mjs";import{
|
|
2
|
+
import{defineMaterial as e}from"../../../../../utils/schema/material.mjs";import{FloatingAd as t}from"./client.mjs";import{floatingAdInspectorPropsSchema as n}from"./schema.mjs";import{FloatingAdServer as r}from"./server.mjs";const i=e({type:`floating-ad`,name:`悬浮广告`,icon:`/static/components-thumb/floating_action_button.png`,category:`广告组件`,serverComponent:r,clientComponent:t,propsSchema:n});export{i as floatingAdMaterial};
|
|
@@ -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 r from"../../../../ui/link.mjs";import{adaptIconAdProps as i,hasMatchedAds as a}from"../ad-match.mjs";import{useAdProvider as o}from"../ad-provider.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 r from"../../../../ui/link.mjs";import{adaptIconAdProps as i,hasMatchedAds as a}from"../ad-match.mjs";import{useAdProvider as o}from"../ad-provider.mjs";import{useMemo as s}from"react";import{jsx as c,jsxs as l}from"react/jsx-runtime";function u({mode:u=`renderer`,displayCount:d,items:f,pointerEventsDisabled:p=!1}){let m=o(),h=s(()=>a(m?.matchData)?i(m?.matchData):{displayCount:d,items:f},[m?.matchData,d,f]),g=Math.min(Math.max(h.displayCount,0),Math.min(h.items.length,5)),_=h.items.slice(0,g);return _.length===0?null:c(t,{as:`section`,className:`w-full`,"aria-label":`图标广告`,style:{pointerEvents:p?`none`:void 0},children:c(t,{className:`flex overflow-x-auto`,style:{gap:`8px`,padding:`16px 24px`,backgroundColor:`#131313`,alignItems:`center`,justifyContent:_.length>=5?`space-between`:`flex-start`},children:_.map((i,a)=>c(r,{href:i.jumpUrl,className:`block shrink-0`,style:{width:`100px`},children:l(t,{className:`flex flex-col items-center`,style:{gap:`12px`},children:[c(t,{className:`relative overflow-hidden`,style:{width:`100px`,height:`61px`,borderRadius:`10px`,backgroundColor:`#616161`},children:c(e,{src:i.icon,alt:i.title||`图标广告`,fill:!0,className:`object-cover object-center`,unoptimized:!0})}),c(n,{className:`truncate text-center text-white`,style:{width:`100px`,fontSize:`12px`,lineHeight:1,fontWeight:500},children:i.title}),c(t,{className:`flex items-center justify-center`,style:{minWidth:`35px`,padding:`2px 8px`,borderRadius:`4px`,backgroundColor:`rgba(255, 255, 255, 0.33)`},children:c(n,{className:`whitespace-nowrap text-white`,style:{fontSize:`10px`,lineHeight:`normal`,fontWeight:400},children:i.badgeText||`广告`})})]})},`${i.jumpUrl}-${a}`))})})}export{u as IconAd};
|
|
@@ -18,7 +18,7 @@ declare const iconAdMaterial: DefineMaterialOption<typeof IconAdServer, typeof I
|
|
|
18
18
|
icon: zod.ZodString & SchemaHasDefaultValue;
|
|
19
19
|
jumpUrl: zod.ZodString & SchemaHasDefaultValue;
|
|
20
20
|
badgeText: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
|
|
21
|
-
}, zod_v4_core0.$strip
|
|
21
|
+
}, zod_v4_core0.$strip>> & SchemaHasDefaultValue;
|
|
22
22
|
} & {
|
|
23
23
|
mode: zod.ZodOptional<zod.ZodEnum<{
|
|
24
24
|
renderer: "renderer";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{defineMaterial as e}from"../../../../../utils/schema/material.mjs";import{
|
|
2
|
+
import{defineMaterial as e}from"../../../../../utils/schema/material.mjs";import{IconAd as t}from"./client.mjs";import{iconAdInspectorPropsSchema as n}from"./schema.mjs";import{IconAdServer as r}from"./server.mjs";const i=e({type:`icon-ad`,name:`图标广告`,icon:`/static/components-thumb/shortcut_grid_5.png`,category:`广告组件`,serverComponent:r,clientComponent:t,propsSchema:n});export{i as iconAdMaterial};
|
|
@@ -36,7 +36,7 @@ declare const iconAdInspectorPropsSchema: z$1.ZodObject<{
|
|
|
36
36
|
icon: z$1.ZodString & SchemaHasDefaultValue;
|
|
37
37
|
jumpUrl: z$1.ZodString & SchemaHasDefaultValue;
|
|
38
38
|
badgeText: z$1.ZodOptional<z$1.ZodString> & SchemaHasDefaultValue;
|
|
39
|
-
}, z$1.core.$strip
|
|
39
|
+
}, z$1.core.$strip>> & SchemaHasDefaultValue;
|
|
40
40
|
} & {
|
|
41
41
|
mode: z$1.ZodOptional<z$1.ZodEnum<{
|
|
42
42
|
renderer: "renderer";
|
|
@@ -45,6 +45,12 @@ declare const iconAdInspectorPropsSchema: z$1.ZodObject<{
|
|
|
45
45
|
}, z$1.core.$strip>;
|
|
46
46
|
declare const iconAdInspectorDefaultProps: {
|
|
47
47
|
readonly displayCount: number;
|
|
48
|
+
readonly items: {
|
|
49
|
+
title: string;
|
|
50
|
+
icon: string;
|
|
51
|
+
jumpUrl: string;
|
|
52
|
+
badgeText?: string | undefined;
|
|
53
|
+
}[];
|
|
48
54
|
};
|
|
49
55
|
type IconAdInspectorProps<T extends object = object> = InferSchemaProps<typeof iconAdInspectorPropsSchema> & T;
|
|
50
56
|
/**
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{defineComponentPropsSchema as e,getSchemaDefaultProps as t}from"../../../../../utils/schema/schema.mjs";import n from"zod";const r=e(e=>({displayCount:e.number(5,{label:`数量选择`,required:!0}).refine(e=>e>=1&&e<=5,`数量选择必须为 1-5`),items:e.array(n.object({title:e.string(`广告标题`,{label:`标题`,required:!0}),icon:e.string(``,{label:`素材`,required:!0}),jumpUrl:e.string(``,{label:`跳转链接`,required:!0}),badgeText:e.string(`广告`,{label:`广告标识`,required:!1})}),{label:`广告列表`,required:!0})})),i=t(r);export{i as iconAdInspectorDefaultProps,r as iconAdInspectorPropsSchema};
|
|
2
|
+
import{defineComponentPropsSchema as e,getSchemaDefaultProps as t}from"../../../../../utils/schema/schema.mjs";import n from"zod";const r=e(e=>({displayCount:e.number(5,{label:`数量选择`,required:!0}).refine(e=>e>=1&&e<=5,`数量选择必须为 1-5`),items:e.array(n.object({title:e.string(`广告标题`,{label:`标题`,required:!0}),icon:e.string(``,{label:`素材`,required:!0}),jumpUrl:e.string(``,{label:`跳转链接`,required:!0}),badgeText:e.string(`广告`,{label:`广告标识`,required:!1})}),{label:`广告列表`,required:!0,defaultValue:[{title:`图标广告1`,icon:`/static/components-resource/banner.png`,jumpUrl:`/search`,badgeText:`广告`},{title:`图标广告2`,icon:`/static/components-resource/banner.png`,jumpUrl:`/search`,badgeText:`广告`},{title:`图标广告3`,icon:`/static/components-resource/banner.png`,jumpUrl:`/search`,badgeText:`广告`}]})})),i=t(r);export{i as iconAdInspectorDefaultProps,r as iconAdInspectorPropsSchema};
|
|
@@ -11,7 +11,7 @@ import { BannerAd } from "./banner-ad/client.mjs";
|
|
|
11
11
|
import { BannerAdServer } from "./banner-ad/server.mjs";
|
|
12
12
|
import { bannerAdMaterial } from "./banner-ad/material.mjs";
|
|
13
13
|
import "./banner-ad/index.mjs";
|
|
14
|
-
import { FeedAdBadge, FeedAdItemLike,
|
|
14
|
+
import { FeedAdBadge, FeedAdItemLike, getFeedAdIcon, getFeedAdJumpUrl, isFeedAdItem } from "./feed-ad/index.mjs";
|
|
15
15
|
import { FloatingAd } from "./floating-ad/client.mjs";
|
|
16
16
|
import { FloatingAdServer } from "./floating-ad/server.mjs";
|
|
17
17
|
import { floatingAdMaterial } from "./floating-ad/material.mjs";
|
|
@@ -20,7 +20,7 @@ import { IconAd } from "./icon-ad/client.mjs";
|
|
|
20
20
|
import { IconAdServer } from "./icon-ad/server.mjs";
|
|
21
21
|
import { iconAdMaterial } from "./icon-ad/material.mjs";
|
|
22
22
|
import "./icon-ad/index.mjs";
|
|
23
|
-
import {
|
|
23
|
+
import { PopupAdInspectorProps, PopupAdItem, PopupAdProps, popupAdInspectorDefaultProps, popupAdInspectorPropsSchema } from "./popup-ad/schema.mjs";
|
|
24
24
|
import { PopupAd } from "./popup-ad/client.mjs";
|
|
25
25
|
import { PopupAdServer } from "./popup-ad/server.mjs";
|
|
26
26
|
import { popupAdMaterial } from "./popup-ad/material.mjs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{Button as e}from"../../../../ui/button.mjs";import{Image as t}from"../../../../ui/image.mjs";import{Box as n}from"../../../../ui/box.mjs";import{Dialog as r,DialogContent as i}from"../../../../ui/dialog.mjs";import a from"../../../../ui/link.mjs";import{adaptPopupAdMaterials as o,hasMatchedAds as s}from"../ad-match.mjs";import{useAdProvider as c}from"../ad-provider.mjs";import{useEffect as l,useMemo as u,useRef as d,useState as f}from"react";import{jsx as p,jsxs as m}from"react/jsx-runtime";
|
|
2
|
+
"use client";import{Button as e}from"../../../../ui/button.mjs";import{Image as t}from"../../../../ui/image.mjs";import{Box as n}from"../../../../ui/box.mjs";import{Dialog as r,DialogContent as i}from"../../../../ui/dialog.mjs";import a from"../../../../ui/link.mjs";import{adaptPopupAdMaterials as o,hasMatchedAds as s}from"../ad-match.mjs";import{useAdProvider as c}from"../ad-provider.mjs";import{useEffect as l,useMemo as u,useRef as d,useState as f}from"react";import{jsx as p,jsxs as m}from"react/jsx-runtime";function h({items:h,mode:g=`renderer`}){let _=c(),v=u(()=>s(_?.matchData)?o(_?.matchData):h,[_?.matchData,h]),[y,b]=f(0),[x,S]=f(!1),C=d(null);l(()=>{b(0)},[v]),l(()=>{S(!1)},[y,v]),l(()=>()=>{C.current&&window.clearTimeout(C.current)},[]);let w=v[y];function T(){b(e=>e+1)}function E(){x||(S(!0),C.current&&window.clearTimeout(C.current),C.current=window.setTimeout(()=>{C.current=null,T()},260))}function D(e){e||E()}return w?p(r,{open:!0,onOpenChange:D,disablePointerDismissal:!0,children:m(i,{showCloseButton:!1,className:`w-[320px] max-w-[calc(100vw-32px)] border-none bg-transparent p-0 shadow-none`,children:[m(n,{className:`flex flex-col items-center gap-[24px]`,style:{animation:x?`funhub-popup-ad-exit 260ms cubic-bezier(0.4, 0, 0.2, 1) both`:`funhub-popup-ad-enter 420ms cubic-bezier(0.2, 0.9, 0.2, 1) both, funhub-popup-ad-float 3.2s ease-in-out 420ms infinite`,transformOrigin:`center bottom`},children:[p(a,{href:w.jumpUrl,className:`block w-full overflow-hidden rounded-[20px] bg-[#434343]`,style:{boxShadow:`0 18px 48px rgba(0, 0, 0, 0.26)`},children:p(n,{className:`w-full overflow-hidden bg-[#434343]`,children:p(t,{src:w.materialUrl,alt:w.title||`弹窗广告`,width:1200,height:1600,className:`block w-full h-auto`,unoptimized:!0})})}),p(e,{type:`button`,"aria-label":`关闭弹窗广告`,variant:`ghost`,size:`icon-lg`,className:`relative h-[54px] w-[54px] rounded-full border-[3px] border-white bg-transparent p-0 text-white hover:bg-white/8`,onClick:E,style:{animation:x?`funhub-popup-ad-close-exit 260ms ease-out both`:`funhub-popup-ad-close-breathe 2.4s ease-in-out 480ms infinite`},children:m(n,{className:`relative h-[24px] w-[24px]`,children:[p(n,{className:`absolute left-1/2 top-1/2 h-[4px] w-full -translate-x-1/2 -translate-y-1/2 rotate-45 rounded-full bg-current`}),p(n,{className:`absolute left-1/2 top-1/2 h-[4px] w-full -translate-x-1/2 -translate-y-1/2 -rotate-45 rounded-full bg-current`})]})})]},w.id),p(`style`,{jsx:!0,children:`
|
|
3
3
|
@keyframes funhub-popup-ad-enter {
|
|
4
4
|
0% {
|
|
5
5
|
opacity: 0;
|
|
@@ -61,4 +61,4 @@
|
|
|
61
61
|
animation-iteration-count: 1 !important;
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
`})]})}):null}export{
|
|
64
|
+
`})]})}):null}export{h as PopupAd};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
2
|
+
import { PopupAdInspectorProps, PopupAdItem, PopupAdProps, popupAdInspectorDefaultProps, popupAdInspectorPropsSchema } from "./schema.mjs";
|
|
3
3
|
import { PopupAd } from "./client.mjs";
|
|
4
4
|
import { PopupAdServer } from "./server.mjs";
|
|
5
5
|
import { popupAdMaterial } from "./material.mjs";
|
|
@@ -12,13 +12,13 @@ import * as zod_v4_core0 from "zod/v4/core";
|
|
|
12
12
|
* 弹窗广告物料定义。
|
|
13
13
|
*/
|
|
14
14
|
declare const popupAdMaterial: DefineMaterialOption<typeof PopupAdServer, typeof PopupAd, zod.ZodObject<{
|
|
15
|
-
readonly items: zod.
|
|
15
|
+
readonly items: zod.ZodArray<zod.ZodObject<{
|
|
16
16
|
id: zod.ZodString & SchemaHasDefaultValue;
|
|
17
17
|
title: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
|
|
18
18
|
jumpUrl: zod.ZodString & SchemaHasDefaultValue;
|
|
19
19
|
materialUrl: zod.ZodString & SchemaHasDefaultValue;
|
|
20
20
|
desc: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
|
|
21
|
-
}, zod_v4_core0.$strip
|
|
21
|
+
}, zod_v4_core0.$strip>> & SchemaHasDefaultValue;
|
|
22
22
|
} & {
|
|
23
23
|
mode: zod.ZodOptional<zod.ZodEnum<{
|
|
24
24
|
renderer: "renderer";
|
|
@@ -19,37 +19,36 @@ interface PopupAdItem {
|
|
|
19
19
|
* 弹窗广告物料属性。
|
|
20
20
|
*/
|
|
21
21
|
declare const popupAdInspectorPropsSchema: z$1.ZodObject<{
|
|
22
|
-
readonly items: z$1.
|
|
22
|
+
readonly items: z$1.ZodArray<z$1.ZodObject<{
|
|
23
23
|
id: z$1.ZodString & SchemaHasDefaultValue;
|
|
24
24
|
title: z$1.ZodOptional<z$1.ZodString> & SchemaHasDefaultValue;
|
|
25
25
|
jumpUrl: z$1.ZodString & SchemaHasDefaultValue;
|
|
26
26
|
materialUrl: z$1.ZodString & SchemaHasDefaultValue;
|
|
27
27
|
desc: z$1.ZodOptional<z$1.ZodString> & SchemaHasDefaultValue;
|
|
28
|
-
}, z$1.core.$strip
|
|
28
|
+
}, z$1.core.$strip>> & SchemaHasDefaultValue;
|
|
29
29
|
} & {
|
|
30
30
|
mode: z$1.ZodOptional<z$1.ZodEnum<{
|
|
31
31
|
renderer: "renderer";
|
|
32
32
|
editor: "editor";
|
|
33
33
|
}>>;
|
|
34
34
|
}, z$1.core.$strip>;
|
|
35
|
-
declare const popupAdInspectorDefaultProps: {
|
|
35
|
+
declare const popupAdInspectorDefaultProps: {
|
|
36
|
+
readonly items: {
|
|
37
|
+
id: string;
|
|
38
|
+
jumpUrl: string;
|
|
39
|
+
materialUrl: string;
|
|
40
|
+
title?: string | undefined;
|
|
41
|
+
desc?: string | undefined;
|
|
42
|
+
}[];
|
|
43
|
+
};
|
|
36
44
|
type PopupAdInspectorProps<T extends object = object> = InferSchemaProps<typeof popupAdInspectorPropsSchema> & T;
|
|
37
45
|
/**
|
|
38
46
|
* 弹窗广告组件 props。
|
|
39
47
|
*/
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* 广告列表。
|
|
43
|
-
*/
|
|
44
|
-
items?: PopupAdItem[];
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* 弹窗广告组件 props。
|
|
48
|
-
*/
|
|
49
|
-
type PopupAdProps = Omit<PopupAdInspectorProps<{
|
|
48
|
+
type PopupAdProps = PopupAdInspectorProps<{
|
|
50
49
|
mode?: MaterialComponentMode;
|
|
51
50
|
componentId?: string;
|
|
52
51
|
sceneContext?: AdsMatchSceneContext;
|
|
53
|
-
}
|
|
52
|
+
}>;
|
|
54
53
|
//#endregion
|
|
55
|
-
export {
|
|
54
|
+
export { PopupAdInspectorProps, PopupAdItem, PopupAdProps, popupAdInspectorDefaultProps, popupAdInspectorPropsSchema };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{defineComponentPropsSchema as e,getSchemaDefaultProps as t}from"../../../../../utils/schema/schema.mjs";import n from"zod";const r=e(e=>({items:e.array(n.object({id:e.string(`popup-ad-1`,{label:`广告 ID`,required:!0}),title:e.string(`弹窗广告标题`,{label:`标题`,required:!1}),jumpUrl:e.string(`/search`,{label:`跳转链接`,required:!0}),materialUrl:e.string(`/static/components-resource/banner.png`,{label:`素材地址`,required:!0}),desc:e.string(`这里是弹窗广告描述`,{label:`描述`,required:!1})}),{label:`广告列表`,required:!1})})),i=t(r);export{i as popupAdInspectorDefaultProps,r as popupAdInspectorPropsSchema};
|
|
2
|
+
import{defineComponentPropsSchema as e,getSchemaDefaultProps as t}from"../../../../../utils/schema/schema.mjs";import n from"zod";const r=e(e=>({items:e.array(n.object({id:e.string(`popup-ad-1`,{label:`广告 ID`,required:!0}),title:e.string(`弹窗广告标题`,{label:`标题`,required:!1}),jumpUrl:e.string(`/search`,{label:`跳转链接`,required:!0}),materialUrl:e.string(`/static/components-resource/banner.png`,{label:`素材地址`,required:!0}),desc:e.string(`这里是弹窗广告描述`,{label:`描述`,required:!1})}),{label:`广告列表`,required:!0,defaultValue:[{id:`popup-ad-1`,title:`弹窗广告标题`,jumpUrl:`/search`,materialUrl:`/static/components-resource/banner.png`,desc:`这里是弹窗广告描述`}]})})),i=t(r);export{i as popupAdInspectorDefaultProps,r as popupAdInspectorPropsSchema};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{useRouter as e}from"../../../../../utils/use-compatible-router.mjs";import{Box as t}from"../../../../ui/box.mjs";import{Text as n}from"../../../../ui/text.mjs";import{adaptTextAdProps as r,hasMatchedAds as i}from"../ad-match.mjs";import{useAdProvider as a}from"../ad-provider.mjs";import{
|
|
2
|
+
"use client";import{useRouter as e}from"../../../../../utils/use-compatible-router.mjs";import{Box as t}from"../../../../ui/box.mjs";import{Text as n}from"../../../../ui/text.mjs";import{adaptTextAdProps as r,hasMatchedAds as i}from"../ad-match.mjs";import{useAdProvider as a}from"../ad-provider.mjs";import{useEffect as o,useMemo as s,useState as c}from"react";import{jsx as l,jsxs as u}from"react/jsx-runtime";const d=`text_ad_list`;let f=null;function p(e,t){if(!e)return!1;if(t===`once`)return!0;let n=new Date(e),r=new Date;return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()&&n.getDate()===r.getDate()}function m(e,t){return p(e.closedAt,t)}function h(){if(f)return f;if(typeof window>`u`)return{};let e=window.localStorage.getItem(d);if(!e)return f={},{};try{let t=JSON.parse(e);return f=t&&typeof t==`object`?t:{},f}catch{return f={},{}}}function g(e){f=e,!(typeof window>`u`)&&window.localStorage.setItem(d,JSON.stringify(e))}function _(e){return h()[e]??{}}function v(e,t){g({...h(),[e]:t})}function y({displayCount:d,items:f,mode:p=`renderer`}){let h=a(),g=e(),y=p===`editor`,[b,x]=c(!1),[S,C]=c(y),[w,T]=c(y),E=s(()=>i(h?.matchData)?r(h?.matchData):{displayCount:d,items:f},[h?.matchData,d,f]),D=s(()=>{let e=E.items.filter(e=>e.text?.trim());return typeof E.displayCount==`number`?e.slice(0,Math.max(E.displayCount,0)):e},[E]),O=D[0],k=s(()=>D.map(e=>`${e.text}:${e.jumpUrl||``}`).join(`|`),[D]);if(o(()=>{x(!0)},[]),o(()=>{if(b){if(y){C(!0),T(!0);return}if(!k||!O){C(!1),T(!0);return}C(!m(_(k),`daily`)),T(!0)}},[O,y,b,k]),!O||!y&&(!b||!w||!S))return null;function A(){k&&v(k,{..._(k),closedAt:Date.now()})}function j(e){e.jumpUrl&&g.push(e.jumpUrl)}function M(e){e.stopPropagation(),C(!1),A()}function N(){y||(C(!1),A(),j(O))}return l(t,{className:`w-full`,style:{backgroundColor:`#131313`,padding:`8px 16px`},children:u(t,{className:`relative flex w-full items-center justify-between overflow-hidden cursor-pointer`,style:{minHeight:`40px`,backgroundColor:`#FFE7E7`,padding:`0 8px`},onClick:N,children:[u(t,{className:`flex min-w-0 items-center`,style:{gap:`8px`,width:`280px`},children:[l(t,{className:`shrink-0`,style:{padding:`4px 8px`,borderRadius:`8px`,backgroundColor:`rgba(0, 0, 0, 0.33)`},children:l(n,{className:`flex h-full items-center justify-center text-white`,style:{fontSize:`12px`,lineHeight:`normal`,fontWeight:400},children:`广告`})}),l(n,{className:`truncate`,style:{flex:`1 0 0`,color:`#FD4C5E`,fontSize:`14px`,lineHeight:`normal`,fontWeight:400},children:O.text})]}),u(t,{className:`flex shrink-0 items-center`,style:{gap:`6px`,width:`54px`},children:[l(t,{className:`flex shrink-0 items-center justify-center`,style:{width:`20px`,height:`34px`},children:l(`svg`,{width:`10`,height:`17`,viewBox:`0 0 10 17`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,children:l(`path`,{d:`M1 1L8.5 8.5L1 16`,stroke:`#FD4C5E`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`})})}),u(`button`,{type:`button`,"aria-label":`关闭文字广告`,className:`relative shrink-0 border-none p-0`,style:{width:`17px`,height:`17px`,borderRadius:`999px`,backgroundColor:`#F9A9AE`},onClick:M,children:[l(t,{className:`absolute left-1/2 top-1/2`,style:{width:`9px`,height:`2px`,borderRadius:`999px`,backgroundColor:`#FFFFFF`,transform:`translate(-50%, -50%) rotate(45deg)`}}),l(t,{className:`absolute left-1/2 top-1/2`,style:{width:`9px`,height:`2px`,borderRadius:`999px`,backgroundColor:`#FFFFFF`,transform:`translate(-50%, -50%) rotate(-45deg)`}})]})]})]})})}export{y as TextAd};
|
|
@@ -16,7 +16,7 @@ declare const textAdMaterial: DefineMaterialOption<typeof TextAdServer, typeof T
|
|
|
16
16
|
readonly items: zod.ZodArray<zod.ZodObject<{
|
|
17
17
|
text: zod.ZodString & SchemaHasDefaultValue;
|
|
18
18
|
jumpUrl: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
|
|
19
|
-
}, zod_v4_core0.$strip
|
|
19
|
+
}, zod_v4_core0.$strip>> & SchemaHasDefaultValue;
|
|
20
20
|
} & {
|
|
21
21
|
mode: zod.ZodOptional<zod.ZodEnum<{
|
|
22
22
|
renderer: "renderer";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{defineMaterial as e}from"../../../../../utils/schema/material.mjs";import{
|
|
2
|
+
import{defineMaterial as e}from"../../../../../utils/schema/material.mjs";import{TextAd as t}from"./client.mjs";import{textAdInspectorPropsSchema as n}from"./schema.mjs";import{TextAdServer as r}from"./server.mjs";const i=e({type:`text-ad`,name:`文字广告`,icon:`/static/components-thumb/marquee_clickable_closable.png`,category:`广告组件`,serverComponent:r,clientComponent:t,propsSchema:n});export{i as textAdMaterial};
|
|
@@ -26,7 +26,7 @@ declare const textAdInspectorPropsSchema: z$1.ZodObject<{
|
|
|
26
26
|
readonly items: z$1.ZodArray<z$1.ZodObject<{
|
|
27
27
|
text: z$1.ZodString & SchemaHasDefaultValue;
|
|
28
28
|
jumpUrl: z$1.ZodOptional<z$1.ZodString> & SchemaHasDefaultValue;
|
|
29
|
-
}, z$1.core.$strip
|
|
29
|
+
}, z$1.core.$strip>> & SchemaHasDefaultValue;
|
|
30
30
|
} & {
|
|
31
31
|
mode: z$1.ZodOptional<z$1.ZodEnum<{
|
|
32
32
|
renderer: "renderer";
|
|
@@ -35,6 +35,10 @@ declare const textAdInspectorPropsSchema: z$1.ZodObject<{
|
|
|
35
35
|
}, z$1.core.$strip>;
|
|
36
36
|
declare const textAdInspectorDefaultProps: {
|
|
37
37
|
readonly displayCount: number;
|
|
38
|
+
readonly items: {
|
|
39
|
+
text: string;
|
|
40
|
+
jumpUrl?: string | undefined;
|
|
41
|
+
}[];
|
|
38
42
|
};
|
|
39
43
|
type TextAdInspectorProps<T extends object = object> = InferSchemaProps<typeof textAdInspectorPropsSchema> & T;
|
|
40
44
|
/**
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{defineComponentPropsSchema as e,getSchemaDefaultProps as t}from"../../../../../utils/schema/schema.mjs";import n from"zod";const r=e(e=>({displayCount:e.number(1,{label:`广告展示数量选择`,required:!0}).refine(e=>e>=1&&e<=5,`广告展示数量必须为 1-5`),items:e.array(n.object({text:e.string(`请输入广告文案`,{label:`广告文案`,required:!0}),jumpUrl:e.string(``,{label:`跳转链接`,required:!1})}),{label:`广告列表`,required:!0})})),i=t(r);export{i as textAdInspectorDefaultProps,r as textAdInspectorPropsSchema};
|
|
2
|
+
import{defineComponentPropsSchema as e,getSchemaDefaultProps as t}from"../../../../../utils/schema/schema.mjs";import n from"zod";const r=e(e=>({displayCount:e.number(1,{label:`广告展示数量选择`,required:!0}).refine(e=>e>=1&&e<=5,`广告展示数量必须为 1-5`),items:e.array(n.object({text:e.string(`请输入广告文案`,{label:`广告文案`,required:!0}),jumpUrl:e.string(``,{label:`跳转链接`,required:!1})}),{label:`广告列表`,required:!0,defaultValue:[{text:`这是第一条文字广告`,jumpUrl:`/search`},{text:`这是第二条文字广告`,jumpUrl:`/search`}]})})),i=t(r);export{i as textAdInspectorDefaultProps,r as textAdInspectorPropsSchema};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{buildContentUrl as e}from"../../../../../utils/helpers/url.mjs";import{mergeStyles as t}from"../../../../../utils/styles/helpers.mjs";import{Image as n}from"../../../../../../ui/image.mjs";import{Box as r}from"../../../../../../ui/box.mjs";import{Carousel as i,CarouselContent as a,CarouselItem as o}from"../../../../../../ui/carousel.mjs";import{Text as s}from"../../../../../../ui/text.mjs";import c from"../../../../../../ui/
|
|
2
|
+
"use client";import{buildContentUrl as e}from"../../../../../utils/helpers/url.mjs";import{mergeStyles as t}from"../../../../../utils/styles/helpers.mjs";import{Image as n}from"../../../../../../ui/image.mjs";import{Box as r}from"../../../../../../ui/box.mjs";import{Carousel as i,CarouselContent as a,CarouselItem as o}from"../../../../../../ui/carousel.mjs";import{Text as s}from"../../../../../../ui/text.mjs";import c from"../../../../../../ui/link.mjs";import{defaultProps as l}from"../defaults/default-props.mjs";import u from"clsx";import{useIsClient as d}from"foxact/use-is-client";import{useEffect as f,useRef as p,useState as m}from"react";import{jsx as h,jsxs as g}from"react/jsx-runtime";const _={list:[]};function v({mode:v=`renderer`,props:y=_,styles:b,events:x}){let S=v===`editor`,{autoplay:C=l.autoplay,interval:w=l.interval,loop:T=l.loop,showTitle:E=l.showTitle,showIndicator:D=l.showIndicator,list:O=[]}={...l,...y},[k,A]=m(),[j,M]=m(0),N=d(),P=p(null);if(f(()=>{if(!k||!N)return;let e=()=>{M(k.selectedScrollSnap())};return k.on(`select`,e),e(),()=>{k.off(`select`,e)}},[k,x,N]),f(()=>!C||!k||O.length<=1?void 0:(P.current=setInterval(()=>{k.canScrollNext()?k.scrollNext():T&&k.scrollTo(0)},w),()=>{P.current&&=(clearInterval(P.current),null)}),[C,k,w,T,O.length]),!O||O.length===0)return null;let F=O[j],I=b?t(b,{}):void 0;return h(r,{className:u(`w-full px-[16px]`,S&&`pointer-events-none`),style:I,children:g(r,{className:`relative w-full`,children:[h(i,{setApi:A,opts:{align:`start`,loop:T,skipSnaps:!1,dragFree:!1},className:`w-full`,children:h(a,{className:`ml-0`,children:O.map((t,r)=>h(o,{className:`pl-0`,children:h(c,{href:e({url:``,contentId:t.contentId,contentType:1,title:t.title}),className:u(`block relative w-full overflow-hidden touch-manipulation`,`aspect-[358/166]`),children:h(n,{src:t.coverUrl,alt:t.title||`Banner ${r+1}`,fill:!0,objectFit:`cover`,unoptimized:!0})})},r))})}),(E||D&&O.length>1)&&h(r,{className:`absolute inset-x-0 bottom-0 h-[72px] pointer-events-none`,style:{background:`linear-gradient(180deg, rgba(8, 2, 17, 0) 0%, rgba(8, 2, 17, 0.28) 55%, rgba(8, 2, 17, 0.4) 100%)`}}),E&&F?.title&&h(r,{className:`absolute left-[12px] right-[12px] bottom-[34px] pointer-events-none`,children:h(s,{as:`p`,className:`text-white text-[16px] leading-[22px] font-medium line-clamp-1`,children:F.title})}),D&&O.length>1&&h(r,{className:`absolute left-1/2 -translate-x-1/2 bottom-[16px] flex items-center gap-[4px] pointer-events-auto`,children:O.map((e,t)=>h(`button`,{type:`button`,className:u(`block size-[6px] rounded-full`,t===j?`bg-theme5`:`bg-[rgba(0,0,0,0.6)]`),"aria-label":`跳转到第 ${t+1} 个 Banner`},t))})]})})}export{v as default};
|
|
@@ -9,9 +9,10 @@ import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
|
9
9
|
//#region components/biz/business/banner-carousel/client.d.ts
|
|
10
10
|
declare function BannerCarouselClient({
|
|
11
11
|
mode,
|
|
12
|
+
props: nestedPropsConfig,
|
|
12
13
|
styles,
|
|
13
14
|
events,
|
|
14
|
-
...
|
|
15
|
+
...directPropsConfig
|
|
15
16
|
}: BaseComponentProps<any> & {
|
|
16
17
|
mode?: MaterialComponentMode;
|
|
17
18
|
} & BasicBannerProps): react_jsx_runtime0.JSX.Element | null;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{mergeStyles as e}from"../../utils/styles/helpers.mjs";import{
|
|
2
|
+
"use client";import{mergeStyles as e}from"../../utils/styles/helpers.mjs";import{Image as t}from"../../../ui/image.mjs";import{Box as n}from"../../../ui/box.mjs";import{Carousel as r,CarouselContent as i,CarouselItem as a}from"../../../ui/carousel.mjs";import{Text as o}from"../../../ui/text.mjs";import s from"../../../ui/link.mjs";import c from"../../../../assets/icons/detail/video_flag.mjs";import{defaultProps as l}from"./default-props.mjs";import u from"clsx";import{useIsClient as d}from"foxact/use-is-client";import{useEffect as f,useRef as p,useState as m}from"react";import{jsx as h,jsxs as g}from"react/jsx-runtime";const _={list:[]};function v(e){let t=Number(e||0);if(!Number.isFinite(t)||t<=0)return`0`;if(t>=1e4){let e=t/1e4;return`${e%1==0?e:e.toFixed(1)}万`}if(t>=1e3){let e=t/1e3;return`${e%1==0?e:e.toFixed(1)}千`}return String(Math.floor(t))}function y(e){let t=e.playCount;if(typeof t==`number`&&Number.isFinite(t))return t;let n=e.video;if(!n||typeof n!=`object`)return 0;let r=n;return Number(r.static?.browse_cnt??r.play_count??0)||0}function b({mode:b=`renderer`,props:x=_,styles:S,events:C,...w}){let T=b===`editor`,{autoplay:E=l.autoplay,interval:D=l.interval,loop:O=l.loop,showTitle:k=l.showTitle,showIndicator:A=l.showIndicator,list:j=[]}={...l,...x,...w},[M,N]=m(),[P,F]=m(0),I=d(),L=p(null);if(f(()=>{if(!M||!I)return;let e=()=>{F(M.selectedScrollSnap())};return M.on(`select`,e),e(),()=>{M.off(`select`,e)}},[M,C,I]),f(()=>{if(!(!E||!M||j.length<=1))return L.current=setInterval(()=>{M.canScrollNext()?M.scrollNext():O&&M.scrollTo(0)},D*1e3),()=>{L.current&&=(clearInterval(L.current),null)}},[E,M,D,O,j.length]),!j||j.length===0)return null;let R=j[P],z=S?e(S,{}):void 0,B=R?.badgeUrl||``,V=R?.showPlayCount??!0,H=R?.showEpisodeCount??!0,U=y(R),W=typeof R?.episodeInfo==`string`?R.episodeInfo.trim():``;return h(n,{className:u(`w-full px-[16px]`,T&&`pointer-events-none`),style:z,children:g(n,{className:`relative w-full overflow-hidden rounded-[8px]`,children:[h(r,{setApi:N,opts:{align:`start`,loop:O,skipSnaps:!1,dragFree:!1},className:`w-full`,children:h(i,{className:`ml-0`,children:j.map((e,n)=>h(a,{className:`pl-0`,children:h(s,{href:e.target,className:u(`block relative w-full overflow-hidden touch-manipulation`,`aspect-[358/166]`),children:h(t,{src:e.coverUrl,alt:e.title||`Banner ${n+1}`,fill:!0,objectFit:`cover`,unoptimized:!0})})},n))})}),h(n,{className:`absolute inset-0 pointer-events-none flex flex-col justify-end`,style:{background:`linear-gradient(180deg, rgba(8, 2, 17, 0) 0%, rgba(8, 2, 17, 0.28) 55%, rgba(8, 2, 17, 0.4) 100%)`},children:h(n,{className:`flex items-end px-[12px] pb-[32px] pt-[36px]`,children:g(n,{className:`flex-1 min-w-0 flex flex-col gap-[4px]`,children:[k&&R?.title!=null&&h(o,{as:`p`,className:`text-white text-[16px] leading-[22px] font-semibold line-clamp-1`,children:String(R.title)}),g(n,{className:`flex items-center gap-[8px]`,children:[V&&g(n,{className:`flex items-center gap-[4px] px-[4px] py-0 rounded-[4px] bg-white/10 shrink-0`,children:[h(c,{className:`w-[12px] h-[12px] text-white shrink-0`}),h(o,{as:`span`,className:`text-white text-[12px] leading-[20px]`,children:v(U)})]}),H&&W&&h(o,{as:`span`,className:`text-white text-[12px] leading-[20px] shrink-0`,children:W})]})]})})}),A&&j.length>1&&h(n,{className:`absolute left-1/2 -translate-x-1/2 bottom-[16px] flex items-center gap-[4px] pointer-events-auto`,children:j.map((e,t)=>h(`button`,{type:`button`,className:u(`block size-[6px] rounded-full`,t===P?`bg-theme5`:`bg-[rgba(0,0,0,0.6)]`),"aria-label":`跳转到第 ${t+1} 个 Banner`,onClick:()=>M?.scrollTo(t)},t))}),B&&h(n,{className:`absolute top-0 right-0 overflow-hidden rounded-bl-[8px] pointer-events-none`,children:h(t,{src:B,alt:``,width:37,height:20,className:`object-contain`,unoptimized:!0})})]})})}export{b as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
const e={autoplay:!0,interval:3,loop:!0,showTitle:!
|
|
2
|
+
const e={autoplay:!0,interval:3,loop:!0,showTitle:!1,showIndicator:!0,list:[]};export{e as defaultProps};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{mergeStyles as e}from"../../utils/styles/helpers.mjs";import{Box as t}from"../../../ui/box.mjs";import n from"../../../ui/link.mjs";import{urlPrefix as r}from"../../../../constants/url-prefix.mjs";import{useSticky as i}from"../../../../hooks/use-sticky.mjs";import a from"../../../../assets/icons/
|
|
2
|
+
"use client";import{mergeStyles as e}from"../../utils/styles/helpers.mjs";import{Box as t}from"../../../ui/box.mjs";import n from"../../../ui/link.mjs";import{urlPrefix as r}from"../../../../constants/url-prefix.mjs";import{useSticky as i}from"../../../../hooks/use-sticky.mjs";import a from"../../../../assets/icons/channel-list/channel-active-indicator.mjs";import o from"../../../../assets/icons/common/header-menu.mjs";import s,{loadHiddenChannelIdsFromStorage as c}from"./channel-filter-dialog.mjs";import{defaultProps as l}from"./default-props.mjs";import{clsx as u}from"clsx";import{useEffect as d,useMemo as f,useState as p}from"react";import{Fragment as m,jsx as h,jsxs as g}from"react/jsx-runtime";import{usePathname as _}from"next/navigation";import{useTranslations as v}from"next-intl";const y={},b=`h-[26px]`;function x(e,t){let n=`${r.DOMAIN}/`,i=t.indexOf(n),a=i!==-1,o=a?t.slice(i+n.length).split(`/`)[0]:void 0;return e.isDefault?a&&o?`${r.DOMAIN}/${o}`:`/`:a&&o?`${r.DOMAIN}/${o}/${encodeURIComponent(e.name)}`:`${r.CHANNEL}/${encodeURIComponent(e.name)}`}function S(r){let S=v(`components.biz.business.navBar.variants.basicNavBar.runtime`),{mode:C=`renderer`,styles:w,events:T,...E}=r,D=_()??`/`,O=C===`editor`,k=E||y,A={...l,...k},[j,M]=p(!1),{isSticky:N,ref:P}=i(),[F,I]=p(!1),[L,R]=p(A.list),z=f(()=>A.list.find(e=>e.isDefault)?.name??null,[A.list]),B=f(()=>A.currentChannelId??z,[A.currentChannelId,z]);d(()=>{let e=c();R(e?.length?A.list.filter(t=>!e.includes(t.name)):A.list)},[A.list]);let V=e=>{R(e)},H=(e,t)=>{T?.onChannelChange?.(e,t)},U=w?e(w,{}):void 0,W=()=>{M(!0),T?.onFilterClick?.()};return d(()=>{let e=()=>{let e=window.scrollY??document.documentElement.scrollTop??0,t=window.innerHeight,n=document.documentElement.scrollHeight;I(e+t>=n-1)};return window.addEventListener(`scroll`,e,{passive:!0}),e(),()=>{window.removeEventListener(`scroll`,e)}},[]),g(m,{children:[N&&h(t,{className:u(`w-full`,b)}),h(t,{as:`nav`,ref:P,className:u(`w-full bg-transparent transition-all duration-200`,O&&`pointer-events-none`,N&&`fixed top-0 left-0 right-0 z-50`),style:U,children:g(t,{className:u(`relative flex w-full items-center px-4`,b,A.modifiable&&`gap-2`),children:[h(t,{className:`[-webkit-overflow-scrolling:touch] [-ms-overflow-style:none] [scrollbar-width:none] flex h-full min-w-0 flex-1 items-center overflow-x-auto overflow-y-hidden [&::-webkit-scrollbar]:hidden`,children:h(t,{className:`inline-flex h-full min-w-full items-center gap-[23.8px]`,children:L.map((e,r)=>{let i=B===e.name||B===null&&r===0;return h(n,{href:x(e,D),webviewNavMode:`spa`,className:u(`group relative inline-flex h-full shrink-0 cursor-pointer whitespace-nowrap transition-all duration-200`,i?`text-white`:`text-white/70`),onClick:()=>H(e,r),children:i?g(t,{className:u(`inline-grid grid-cols-1 grid-rows-1 place-items-start`,b),children:[h(t,{as:`span`,className:`relative z-[1] block h-[24px] text-center text-[20px] font-['PingFang_SC'] font-semibold leading-[24px] text-white transition-all duration-200`,children:e.name}),h(t,{"aria-hidden":`true`,className:`col-start-1 row-start-1 ml-px mt-[15px] h-[11px] w-[39px]`,children:h(a,{className:`block h-full w-full`})})]}):h(t,{className:`inline-flex h-full items-center`,children:h(t,{as:`span`,className:`block h-[24px] text-center text-[16px] font-['PingFang_SC'] font-normal leading-[24px] transition-all duration-200`,children:e.name})})},e.name||`channel-${r}`)})})}),A.modifiable?h(`button`,{type:`button`,"aria-label":S(`moreChannelEntry`),className:`relative flex size-6 shrink-0 items-center justify-center border-0 bg-transparent p-0`,onClick:W,children:h(o,{"aria-hidden":`true`,className:`h-[24px] w-[24px] text-white`})}):null]})}),h(s,{open:j,onOpenChange:M,channels:A.list,currentChannelId:B,onChannelClick:H,onChannelsChange:V})]})}export{S as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
const e={currentChannelId:null,isFullfeed:!1,list:[]};export{e as defaultProps};
|
|
2
|
+
const e={currentChannelId:null,isFullfeed:!1,modifiable:!0,list:[]};export{e as defaultProps};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{useUserStore as e}from"../../../../../store/modules/user-store.mjs";import{pCommunityMoveCollectionContent as t}from"../../../../../service/generated/client.mjs";import{Box as n}from"../../../../ui/box.mjs";import{Text as r}from"../../../../ui/text.mjs";import{useLoginModalStore as i}from"../../../../../store/modules/login-modal-store.mjs";import{useDeleteRequest as a}from"../../../../../hooks/query/use-query.mjs";import o from"../../../../common/interaction-animations.module.mjs";import s from"../../../../common/collection-popup/index.mjs";import c from"../../../../common/share-popup/share-popup.mjs";import{useInteractionAnimation as l}from"../../../../../hooks/use-interaction-animation.mjs";import{useContentOperate as u}from"../../../../../hooks/use-content-operate.mjs";import d from"../../../../../assets/icons/detail/check-ok.mjs";import f from"../../../../../assets/icons/detail/collect_nor.mjs";import p from"../../../../../assets/icons/detail/collect_sel.mjs";import ee from"../../../../../assets/icons/detail/give_like.mjs";import m from"../../../../../assets/icons/detail/give_like_sel.mjs";import te from"../../../../../assets/icons/detail/share.mjs";import{useCallback as h,useEffect as g,useMemo as _,useRef as v,useState as y}from"react";import{jsx as b,jsxs as x}from"react/jsx-runtime";import{toast as S}from"sonner";import{usePathname as C,useSearchParams as ne}from"next/navigation";import{useTranslations as w}from"next-intl";function T({mode:T=`renderer`,information:O,onUpdate:k}){let A=T===`editor`||!O?.id||O.id.startsWith(`preview-`),j=`${C()}?${ne()?.toString()||``}`,M=v(j),N=w(`components.biz.business.detail`),P=l(),[F,I]=y(!1),[L,R]=y(!1),z=v(0),B=v(0),V=e(e=>e.userId),H=e(e=>e.isLogin),U=a();g(()=>{M.current!==j&&(c.clear(),M.current=j)},[j]),g(()=>()=>{c.clear()},[]);let W=h(()=>{V&&(U([`user-profile`,`mine`,V,`user-like-video`]),U([`user-profile`,`mine`,V,`user-like-post`]),U([`user-profile`,`mine`,V,`user-collect-video`,V]),U([`user-profile`,`mine`,V,`user-collect-post`,V]))},[U,V]),{likeAnimation:G,handleLikeOperate:K,handleDefaultCollectionOperate:q,handleShareOperate:J}=u({id:O.id,isLike:O.like||!1,isDislike:O.dislike||!1,isCollect:O.collect||!1,likeCnt:D(O.static?.like_cnt),dislikeCnt:D(O.static?.dislike_cnt),contentType:1,prefetchDefaultCollection:!A,animationClasses:{like:o.likeShakeAnimation,dislike:o.dislikeShakeAnimation}}),Y=h(e=>{k?.({...e})},[k]),X=h(async()=>{if(F)return;if(!H){i.getState().open();return}let e=Date.now();if(e-z.current<300)return;z.current=e,I(!0);let t=O.like||!1,n=O.dislike||!1,r=D(O.static?.like_cnt),a=D(O.static?.dislike_cnt),o=!t,s=Math.max(0,r+(o?1:-1)),c=o?!1:n,l=o&&n?Math.max(0,a-1):a;Y({like:o,dislike:c,static:{...O.static,like_cnt:s,dislike_cnt:l}});try{let e=await K();if(!e){Y({like:t,dislike:n,static:{...O.static,like_cnt:r,dislike_cnt:a}});return}Y({like:e.isLike,dislike:e.isDislike??c,static:{...O.static,like_cnt:e.likeCnt,dislike_cnt:e.dislikeCnt??l}}),W(),window.sensors?.track?.(`detail_like_click`,{object_id:O.id,action:e.isLike?`点赞`:`取消点赞`,like_count:e.likeCnt})}catch(e){console.error(`点赞操作失败:`,e),S.error(N(`detailOperate.operateFailed`))}finally{I(!1)}},[K,O,W,F,H,N,Y]),Z=_(()=>O.id,[O.id]),re=h(()=>{J(({isCollect:e})=>{Y({collect:e})},Z)},[J,Z,Y]),Q=h(()=>{s.show({mode:`select`,onCollect:async e=>{try{let n=await t({new_collection_id:e,content_id:O.id});if(n.code!==0)throw Error(n.message||N(`detailOperate.collectFailed`));Y({collect:!0}),W(),S.success(N(`detailOperate.modifyCollectionSuccess`))}catch(e){console.error(`修改收藏夹失败:`,e),S.error(N(`detailOperate.collectFailed`))}}})},[O.id,W,N,Y]),$=h(e=>{let t=e||N(`detailOperate.defaultCollection`);S.custom(e=>x(`div`,{className:`flex items-center justify-between gap-[16px] px-[16px] py-[12px] rounded-[12px] bg-black text-white shadow-lg min-w-[280px]`,children:[x(`div`,{className:`flex items-center gap-[10px]`,children:[b(`div`,{className:`w-[24px] h-[24px] rounded-full bg-white flex items-center justify-center`,children:b(d,{className:`w-[14px] h-[14px]`})}),x(`div`,{className:`flex items-center gap-[6px]`,children:[b(`span`,{className:`text-[14px] leading-[20px]`,children:N(`detailOperate.collectAdded`)}),b(`span`,{className:`text-[14px] leading-[20px] font-semibold`,children:t})]})]}),b(`button`,{type:`button`,className:`text-[14px] text-theme5 font-semibold`,onClick:()=>{S.dismiss(e),Q()},children:N(`detailOperate.modifyCollection`)})]}))},[Q,N]),ie=h(async()=>{if(L)return;if(!H){i.getState().open();return}let e=Date.now();if(e-B.current<300)return;B.current=e;let t=O.collect||!1,n=!t;R(!0),Y({collect:n}),n&&P.trigger(o.likeShakeAnimation),window.sensors?.track?.(`detail_fav_click`,{object_id:O.id,action:t?`取消收藏`:`收藏`});try{let e=await q({currentCollect:t,onUpdate:({isCollect:e})=>{Y({collect:e})}});if(!e?.success){Y({collect:t}),S.error(e?.message||N(`detailOperate.collectFailed`));return}Y({collect:e.isCollect??n}),W(),window.sensors?.track?.(`detail_fav_click`,{object_id:O.id,action:e.isCollect?`收藏`:`取消收藏`}),!t&&e.isCollect&&$(e.collectionTitle),t&&e.isCollect===!1&&S.success(N(`detailOperate.uncollectSuccess`))}catch(e){Y({collect:t}),console.error(`收藏操作失败:`,e),S.error(e?.message||N(`detailOperate.collectFailed`))}finally{R(!1)}},[P,q,O.id,O.collect,W,L,H,$,N,Y]);return x(n,{className:`w-full h-[42px] mt-[16px] flex items-center justify-between ${A?`pointer-events-none`:``}`,children:[x(n,{className:`w-[25%] h-full flex flex-col items-center justify-center ${F?`opacity-50 cursor-not-allowed`:`cursor-pointer`}`,onClick:X,children:[O.like?b(m,{className:`w-[20px] h-[20px] ${G.animationClass}`}):b(ee,{className:`w-[20px] h-[20px] text-text2`}),b(r,{className:`text-[12px] text-text2 leading-[20px]`,children:O.static?O.static.like_cnt===0?N(`detailOperate.like`):E(O.static?.like_cnt):N(`detailOperate.like`)})]}),x(n,{className:`w-[25%] h-full flex flex-col items-center justify-center ${L?`opacity-50 cursor-not-allowed`:`cursor-pointer`}`,onClick:ie,children:[O.collect?b(p,{className:`w-[20px] h-[20px] ${P.animationClass}`}):b(f,{className:`w-[20px] h-[20px] text-text2`}),b(r,{className:`text-[12px] text-text2 leading-[20px]`,children:N(`detailOperate.collection`)})]}),x(n,{className:`w-[25%] h-full flex flex-col items-center justify-center cursor-pointer`,onClick:re,children:[b(te,{className:`w-[20px] h-[20px] text-text2`}),b(r,{className:`text-[12px] text-text2 leading-[20px]`,children:N(`detailOperate.share`)})]})]})}function E(e){let t=Number(e||0);return Number.isNaN(t)||t<=0?`0`:t>=1e4?`${(t/1e4).toFixed(1)}w`:t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}function D(e){if(e==null)return 0;if(typeof e==`number`)return e;let t=Number(e);return Number.isNaN(t)?0:t}export{T as DetailOperate};
|
|
2
|
+
"use client";import{useUserStore as e}from"../../../../../store/modules/user-store.mjs";import{pCommunityMoveCollectionContent as t}from"../../../../../service/generated/client.mjs";import{Box as n}from"../../../../ui/box.mjs";import{Text as r}from"../../../../ui/text.mjs";import{useLoginModalStore as i}from"../../../../../store/modules/login-modal-store.mjs";import{useDeleteRequest as a}from"../../../../../hooks/query/use-query.mjs";import o from"../../../../common/interaction-animations.module.mjs";import s from"../../../../common/collection-popup/index.mjs";import c from"../../../../common/share-popup/share-popup.mjs";import{useInteractionAnimation as l}from"../../../../../hooks/use-interaction-animation.mjs";import{useContentOperate as ee}from"../../../../../hooks/use-content-operate.mjs";import te from"../../../../../assets/icons/detail/check-ok.mjs";import{useCallback as u,useEffect as d,useMemo as f,useRef as p,useState as m}from"react";import{jsx as h,jsxs as g}from"react/jsx-runtime";import{toast as _}from"sonner";import{usePathname as v,useSearchParams as y}from"next/navigation";import{useTranslations as b}from"next-intl";function x({className:e}){return h(`svg`,{viewBox:`0 0 24 21`,fill:`none`,className:e,children:h(`path`,{d:`M21.2121 6.89394C21.2121 4.25805 19.0753 2.12121 16.4394 2.12121C14.8261 2.12121 13.3991 2.92114 12.5336 4.15024C12.3349 4.4321 12.0115 4.59976 11.6667 4.59976C11.3218 4.59976 10.9984 4.4321 10.7997 4.15024C9.93421 2.92114 8.50725 2.12121 6.89394 2.12121C4.25804 2.12121 2.12121 4.25805 2.12121 6.89394C2.12121 9.40321 3.62133 11.9321 5.72562 14.0572C7.68391 16.0348 10.0088 17.5016 11.6667 18.137C13.3246 17.5016 15.6494 16.0348 17.6077 14.0572C19.712 11.9321 21.2121 9.40321 21.2121 6.89394ZM23.3333 6.89394C23.3333 10.2178 21.3863 13.2566 19.1158 15.5497C16.8347 17.8533 14.0447 19.5915 12.0012 20.2706C11.7841 20.3428 11.5493 20.3428 11.3321 20.2706C9.28858 19.5915 6.4986 17.8533 4.21757 15.5497C1.94701 13.2566 0 10.2178 0 6.89394C0 3.08654 3.08652 0 6.89394 0C8.74758 0 10.4287 0.733771 11.6667 1.92235C12.9047 0.733771 14.5858 0 16.4394 0C20.2468 0 23.3333 3.08654 23.3333 6.89394Z`,fill:`currentColor`})})}function S({className:e}){return h(`svg`,{viewBox:`0 0 24 21`,fill:`none`,className:e,children:h(`path`,{d:`M23.3333 6.89394C23.3333 10.2178 21.3863 13.2566 19.1158 15.5497C16.8347 17.8533 14.0447 19.5915 12.0012 20.2706C11.7841 20.3428 11.5493 20.3428 11.3321 20.2706C9.28858 19.5915 6.4986 17.8533 4.21757 15.5497C1.94701 13.2566 0 10.2178 0 6.89394C0 3.08654 3.08652 0 6.89394 0C8.74758 0 10.4287 0.733771 11.6667 1.92235C12.9047 0.733771 14.5858 0 16.4394 0C20.2468 0 23.3333 3.08654 23.3333 6.89394Z`,fill:`currentColor`})})}function C({className:e}){return h(`svg`,{viewBox:`0 0 24 23`,fill:`none`,className:e,children:h(`path`,{d:`M11.6636 2.65236e-06C12.0673 -0.000898131 12.437 0.227705 12.6165 0.589326L15.6522 6.70732L22.4258 7.69539C22.8246 7.75364 23.1564 8.03302 23.2813 8.41625C23.4062 8.79955 23.3021 9.22064 23.0141 9.50272L18.0882 14.3261L19.2585 21.0292C19.3281 21.4283 19.1639 21.8323 18.836 22.0701C18.5077 22.3079 18.072 22.3385 17.7143 22.1478L11.6657 18.9226L5.61917 22.1478C5.26131 22.3386 4.82579 22.3082 4.49748 22.0701C4.16923 21.832 4.00582 21.4276 4.07595 21.0282L5.25356 14.3271L0.319396 9.50376C0.0308898 9.2217 -0.0728394 8.79987 0.0521809 8.41625C0.177201 8.03266 0.509448 7.7533 0.90872 7.69539L7.71753 6.70732L10.7139 0.593469L10.7884 0.464005C10.9835 0.177012 11.3103 0.000910321 11.6636 2.65236e-06ZM9.37675 8.14386C9.22265 8.45841 8.92279 8.6767 8.57614 8.72697L3.33644 9.48615L7.1365 13.2013C7.38683 13.446 7.50059 13.799 7.43996 14.1438L6.54096 19.2509L11.1675 16.7859L11.2866 16.731C11.5714 16.6219 11.8921 16.6405 12.1649 16.7859L16.7946 19.253L15.9028 14.1427C15.8428 13.7988 15.9559 13.4467 16.2052 13.2023L20.0001 9.48511L14.7967 8.72697C14.4525 8.67672 14.155 8.46057 14.0002 8.14904L11.6719 3.45827L9.37675 8.14386Z`,fill:`currentColor`})})}function ne({className:e}){return h(`svg`,{viewBox:`0 0 24 23`,fill:`none`,className:e,children:h(`path`,{d:`M11.6636 2.65236e-06C12.0673 -0.000898131 12.437 0.227705 12.6165 0.589326L15.6522 6.70732L22.4258 7.69539C22.8246 7.75364 23.1564 8.03302 23.2813 8.41625C23.4062 8.79955 23.3021 9.22064 23.0141 9.50272L18.0882 14.3261L19.2585 21.0292C19.3281 21.4283 19.1639 21.8323 18.836 22.0701C18.5077 22.3079 18.072 22.3385 17.7143 22.1478L11.6657 18.9226L5.61917 22.1478C5.26131 22.3386 4.82579 22.3082 4.49748 22.0701C4.16923 21.832 4.00582 21.4276 4.07595 21.0282L5.25356 14.3271L0.319396 9.50376C0.0308898 9.2217 -0.0728394 8.79987 0.0521809 8.41625C0.177201 8.03266 0.509448 7.7533 0.90872 7.69539L7.71753 6.70732L10.7139 0.593469L10.7884 0.464005C10.9835 0.177012 11.3103 0.000910321 11.6636 2.65236e-06Z`,fill:`currentColor`})})}function w({className:e}){return h(`svg`,{viewBox:`0 0 24 24`,fill:`none`,className:e,children:h(`path`,{d:`M11.7968 0.0846035C12.212 -0.0873746 12.69 0.00771373 13.0078 0.325488L23.0077 10.3254C23.22 10.5377 23.3375 10.8271 23.3332 11.1273C23.3288 11.4272 23.2029 11.7123 22.9849 11.9183L12.985 21.3627C12.6625 21.6673 12.1901 21.7509 11.7827 21.5754C11.3753 21.3998 11.1111 20.9991 11.1111 20.5554V15.6216C8.22953 15.9648 6.08879 17.6095 4.58982 19.3391C3.74967 20.3085 3.13167 21.2821 2.7246 22.0148C2.52173 22.38 2.37311 22.6823 2.27646 22.8894C2.22828 22.9927 2.19344 23.0722 2.17121 23.1238C2.16011 23.1495 2.15201 23.169 2.14734 23.1802C2.1451 23.1856 2.14372 23.1893 2.143 23.191C1.94502 23.6852 1.42342 23.9699 0.900603 23.8692C0.377728 23.7684 0 23.3102 0 22.7776C0 17.9877 0.696606 13.8374 2.60632 10.8582C4.41013 8.04448 7.21019 6.40446 11.1111 6.14686V1.11107C11.1111 0.661725 11.3817 0.256615 11.7968 0.0846035ZM13.3333 7.22216C13.3333 7.8358 12.8358 8.33326 12.2222 8.33326C8.37436 8.33326 5.97849 9.71592 4.47697 12.0583C3.44269 13.6719 2.79177 15.8074 2.46852 18.4168C2.60946 18.2401 2.75584 18.061 2.91014 17.8829C4.8356 15.6613 7.89407 13.3332 12.2222 13.3332C12.8358 13.3332 13.3333 13.8307 13.3333 14.4443V17.9773L20.6282 11.0882L13.3333 3.79335V7.22216Z`,fill:`currentColor`})})}function T({mode:T=`renderer`,information:O,onUpdate:k}){let A=T===`editor`||!O?.id||O.id.startsWith(`preview-`),j=`${v()}?${y()?.toString()||``}`,M=p(j),N=b(`components.biz.business.detail`),P=l(),[F,I]=m(!1),[L,R]=m(!1),z=p(0),B=p(0),V=e(e=>e.userId),H=e(e=>e.isLogin),U=a();d(()=>{M.current!==j&&(c.clear(),M.current=j)},[j]),d(()=>()=>{c.clear()},[]);let W=u(()=>{V&&(U([`user-profile`,`mine`,V,`user-like-video`]),U([`user-profile`,`mine`,V,`user-like-post`]),U([`user-profile`,`mine`,V,`user-collect-video`,V]),U([`user-profile`,`mine`,V,`user-collect-post`,V]))},[U,V]),{likeAnimation:G,handleLikeOperate:K,handleDefaultCollectionOperate:q,handleShareOperate:J}=ee({id:O.id,isLike:O.like||!1,isDislike:O.dislike||!1,isCollect:O.collect||!1,likeCnt:D(O.static?.like_cnt),dislikeCnt:D(O.static?.dislike_cnt),contentType:1,prefetchDefaultCollection:!A,animationClasses:{like:o.likeShakeAnimation,dislike:o.dislikeShakeAnimation}}),Y=u(e=>{k?.({...e})},[k]),X=u(async()=>{if(F)return;if(!H){i.getState().open();return}let e=Date.now();if(e-z.current<300)return;z.current=e,I(!0);let t=O.like||!1,n=O.dislike||!1,r=D(O.static?.like_cnt),a=D(O.static?.dislike_cnt),o=!t,s=Math.max(0,r+(o?1:-1)),c=o?!1:n,l=o&&n?Math.max(0,a-1):a;Y({like:o,dislike:c,static:{...O.static,like_cnt:s,dislike_cnt:l}});try{let e=await K();if(!e){Y({like:t,dislike:n,static:{...O.static,like_cnt:r,dislike_cnt:a}});return}Y({like:e.isLike,dislike:e.isDislike??c,static:{...O.static,like_cnt:e.likeCnt,dislike_cnt:e.dislikeCnt??l}}),W(),window.sensors?.track?.(`detail_like_click`,{object_id:O.id,action:e.isLike?`点赞`:`取消点赞`,like_count:e.likeCnt})}catch(e){console.error(`点赞操作失败:`,e),_.error(N(`detailOperate.operateFailed`))}finally{I(!1)}},[K,O,W,F,H,N,Y]),Z=f(()=>O.id,[O.id]),re=u(()=>{J(({isCollect:e})=>{Y({collect:e})},Z)},[J,Z,Y]),Q=u(()=>{s.show({mode:`select`,onCollect:async e=>{try{let n=await t({new_collection_id:e,content_id:O.id});if(n.code!==0)throw Error(n.message||N(`detailOperate.collectFailed`));Y({collect:!0}),W(),_.success(N(`detailOperate.modifyCollectionSuccess`))}catch(e){console.error(`修改收藏夹失败:`,e),_.error(N(`detailOperate.collectFailed`))}}})},[O.id,W,N,Y]),$=u(e=>{let t=e||N(`detailOperate.defaultCollection`);_.custom(e=>g(`div`,{className:`flex items-center justify-between gap-[16px] px-[16px] py-[12px] rounded-[12px] bg-black text-white shadow-lg min-w-[280px]`,children:[g(`div`,{className:`flex items-center gap-[10px]`,children:[h(`div`,{className:`w-[24px] h-[24px] rounded-full bg-white flex items-center justify-center`,children:h(te,{className:`w-[14px] h-[14px]`})}),g(`div`,{className:`flex items-center gap-[6px]`,children:[h(`span`,{className:`text-[14px] leading-[20px]`,children:N(`detailOperate.collectAdded`)}),h(`span`,{className:`text-[14px] leading-[20px] font-semibold`,children:t})]})]}),h(`button`,{type:`button`,className:`text-[14px] text-theme5 font-semibold`,onClick:()=>{_.dismiss(e),Q()},children:N(`detailOperate.modifyCollection`)})]}))},[Q,N]),ie=u(async()=>{if(L)return;if(!H){i.getState().open();return}let e=Date.now();if(e-B.current<300)return;B.current=e;let t=O.collect||!1,n=!t;R(!0),Y({collect:n}),n&&P.trigger(o.likeShakeAnimation),window.sensors?.track?.(`detail_fav_click`,{object_id:O.id,action:t?`取消收藏`:`收藏`});try{let e=await q({currentCollect:t,onUpdate:({isCollect:e})=>{Y({collect:e})}});if(!e?.success){Y({collect:t}),_.error(e?.message||N(`detailOperate.collectFailed`));return}Y({collect:e.isCollect??n}),W(),window.sensors?.track?.(`detail_fav_click`,{object_id:O.id,action:e.isCollect?`收藏`:`取消收藏`}),!t&&e.isCollect&&$(e.collectionTitle),t&&e.isCollect===!1&&_.success(N(`detailOperate.uncollectSuccess`))}catch(e){Y({collect:t}),console.error(`收藏操作失败:`,e),_.error(e?.message||N(`detailOperate.collectFailed`))}finally{R(!1)}},[P,q,O.id,O.collect,W,L,H,$,N,Y]);return g(n,{className:`mt-[16px] flex h-[52px] w-full items-center justify-between px-[48px] ${A?`pointer-events-none`:``}`,children:[g(n,{className:`flex h-full w-[43px] flex-col items-center justify-center gap-[2px] ${F?`opacity-50 cursor-not-allowed`:`cursor-pointer`}`,onClick:X,children:[O.like?h(S,{className:`size-[28px] text-[#FF5D8F] ${G.animationClass}`}):h(x,{className:`size-[28px] text-white`}),h(r,{className:`text-center text-[14px] leading-[22px] ${O.like?`text-[#FF5D8F]`:`text-white`}`,children:O.static?O.static.like_cnt===0?N(`detailOperate.like`):E(O.static?.like_cnt):N(`detailOperate.like`)})]}),g(n,{className:`flex h-full w-[43px] flex-col items-center justify-center gap-[2px] ${L?`opacity-50 cursor-not-allowed`:`cursor-pointer`}`,onClick:ie,children:[O.collect?h(ne,{className:`size-[28px] text-[#FFC039] ${P.animationClass}`}):h(C,{className:`size-[28px] text-white`}),h(r,{className:`text-center text-[14px] leading-[22px] text-white`,children:N(`detailOperate.collection`)})]}),g(n,{className:`flex h-full w-[43px] flex-col items-center justify-center gap-[2px] cursor-pointer`,onClick:re,children:[h(w,{className:`size-[28px] text-white`}),h(r,{className:`text-center text-[14px] leading-[22px] text-white`,children:N(`detailOperate.share`)})]})]})}function E(e){let t=Number(e||0);return Number.isNaN(t)||t<=0?`0`:t>=1e4?`${(t/1e4).toFixed(1)}w`:t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}function D(e){if(e==null)return 0;if(typeof e==`number`)return e;let t=Number(e);return Number.isNaN(t)?0:t}export{T as DetailOperate};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
const e=`/static/components-thumb/video_player.png`,t=[{id:`tag-1`,name:`标签`,group:`类型`},{id:`tag-2`,name:`标签`,group:`类型`},{id:`tag-3`,name:`标签`,group:`类型`}],n=Array.from({length:6}).map((e,t)=>({id:`episode-${t+1}`,name:`第${t+1}集`,preview_m3u8_url:``,m3u8_url:``})),r={id:`preview-detail`,mid:`preview-detail`,name:`电影名称电影名称电影名称电影名称电影名称`,img_x:e,img_y:e,preview_images:[e],description:`简介文案,简介文案简介文案简介文案简介文案简介文案简介文案简介文案简介文案简介文案简介文案简介文案简介文案简介文案。`,score:`9.6`,is_more_link:`y`,update_status:`1`,tags:t,links:n,content_type:0,play_count:123,episode_cnt:n.length,like:!1,dislike:!1,collect:!1,static:{like_cnt:0,dislike_cnt:0}};function i(e=6){let t=Math.max(1,Math.floor(e));return Array.from({length:t}).map((e,t)=>({...r,id:`preview-recommend-${t+1}`,name:`猜你喜欢 ${t+1}`,play_count:8e3+t*873}))}export{i as buildEditorPreviewRecommendList,r as editorPreviewInformation};
|
|
2
|
+
const e=`/static/components-thumb/video_player.png`,t=[{id:`tag-1`,name:`标签`,group:`类型`},{id:`tag-2`,name:`标签`,group:`类型`},{id:`tag-3`,name:`标签`,group:`类型`}],n=Array.from({length:6}).map((e,t)=>({id:`episode-${t+1}`,name:`第${t+1}集`,preview_m3u8_url:``,m3u8_url:``})),r={id:`preview-detail`,mid:`preview-detail`,name:`电影名称电影名称电影名称电影名称电影名称`,img_x:e,img_y:e,preview_images:[e],description:`简介文案,简介文案简介文案简介文案简介文案简介文案简介文案简介文案简介文案简介文案简介文案简介文案简介文案简介文案。`,score:`9.6`,is_more_link:`y`,update_status:`1`,tags:t,links:n,content_type:0,play_count:123,episode_cnt:n.length,like:!1,dislike:!1,collect:!1,static:{like_cnt:0,dislike_cnt:0}};function i(e=6){let t=Math.max(1,Math.floor(e));return Array.from({length:t}).map((e,t)=>({...r,id:`preview-recommend-${t+1}`,name:`猜你喜欢 ${t+1}`,play_count:8e3+t*873,img_type:t%3==1?`long`:`short`}))}export{i as buildEditorPreviewRecommendList,r as editorPreviewInformation};
|
|
@@ -20,6 +20,9 @@ import "../video-detail-actions/index.mjs";
|
|
|
20
20
|
import { VideoDetailRecommendClient } from "../video-detail-recommend/client.mjs";
|
|
21
21
|
import { VideoDetailRecommend } from "../video-detail-recommend/server.mjs";
|
|
22
22
|
import "../video-detail-recommend/index.mjs";
|
|
23
|
+
import { VideoDetailWaterfallRecommendClient } from "../video-detail-waterfall-recommend/client.mjs";
|
|
24
|
+
import { VideoDetailWaterfallRecommend } from "../video-detail-waterfall-recommend/server.mjs";
|
|
25
|
+
import "../video-detail-waterfall-recommend/index.mjs";
|
|
23
26
|
import "../../../../../utils.mjs";
|
|
24
27
|
import z$1 from "zod";
|
|
25
28
|
|
|
@@ -87,6 +90,38 @@ declare const videoDetailMaterials: MaterialMap<readonly [DefineMaterialOption<t
|
|
|
87
90
|
renderer: "renderer";
|
|
88
91
|
editor: "editor";
|
|
89
92
|
}>>;
|
|
90
|
-
}, z$1.core.$strip>, "video-detail-recommend", "详情页"
|
|
93
|
+
}, z$1.core.$strip>, "video-detail-recommend", "详情页">, DefineMaterialOption<typeof VideoDetailWaterfallRecommend, typeof VideoDetailWaterfallRecommendClient, z$1.ZodObject<{
|
|
94
|
+
readonly rows: z$1.ZodNumber & SchemaHasDefaultValue;
|
|
95
|
+
readonly columns: z$1.ZodNumber & SchemaHasDefaultValue;
|
|
96
|
+
readonly smartTagEnabled: z$1.ZodBoolean & SchemaHasDefaultValue;
|
|
97
|
+
readonly title: z$1.ZodString & SchemaHasDefaultValue;
|
|
98
|
+
readonly showPlayCount: z$1.ZodBoolean & SchemaHasDefaultValue;
|
|
99
|
+
readonly playCountDelta: z$1.ZodNumber & SchemaHasDefaultValue;
|
|
100
|
+
readonly showEpisode: z$1.ZodBoolean & SchemaHasDefaultValue;
|
|
101
|
+
readonly enableInfinite: z$1.ZodBoolean & SchemaHasDefaultValue;
|
|
102
|
+
readonly smartTagIds: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
103
|
+
readonly items: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
|
|
104
|
+
contentId: z$1.ZodString;
|
|
105
|
+
coverMode: z$1.ZodOptional<z$1.ZodEnum<{
|
|
106
|
+
content: "content";
|
|
107
|
+
upload: "upload";
|
|
108
|
+
}>>;
|
|
109
|
+
coverUrl: z$1.ZodOptional<z$1.ZodString>;
|
|
110
|
+
titleMode: z$1.ZodOptional<z$1.ZodEnum<{
|
|
111
|
+
content: "content";
|
|
112
|
+
custom: "custom";
|
|
113
|
+
}>>;
|
|
114
|
+
title: z$1.ZodOptional<z$1.ZodString>;
|
|
115
|
+
description: z$1.ZodOptional<z$1.ZodString>;
|
|
116
|
+
showPlayCount: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
117
|
+
playCountDelta: z$1.ZodOptional<z$1.ZodNumber>;
|
|
118
|
+
showEpisode: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
119
|
+
}, z$1.core.$strip>>>;
|
|
120
|
+
} & {
|
|
121
|
+
mode: z$1.ZodOptional<z$1.ZodEnum<{
|
|
122
|
+
renderer: "renderer";
|
|
123
|
+
editor: "editor";
|
|
124
|
+
}>>;
|
|
125
|
+
}, z$1.core.$strip>, "video-detail-waterfall-recommend", "详情页">]>;
|
|
91
126
|
//#endregion
|
|
92
127
|
export { videoDetailMaterials };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{getSchemaDefaultProps as e}from"../../../../../utils/schema/schema.mjs";import{generateMaterialMap as t}from"../../../../../utils/schema/utils.mjs";import{videoDetailInfoMaterial as n}from"../video-detail-info/material.mjs";import{videoDetailInfoTitleTagsEpisodesMaterial as r}from"../video-detail-info-title-tags-episodes/material.mjs";import{videoDetailPlayerMaterial as i}from"../video-detail-player/material.mjs";import{videoDetailPlayerBridgeOnlyMaterial as a}from"../video-detail-player-bridge-only/material.mjs";import{videoDetailRecommendMaterial as o}from"../video-detail-recommend/material.mjs";import{
|
|
2
|
+
import{getSchemaDefaultProps as e}from"../../../../../utils/schema/schema.mjs";import{generateMaterialMap as t}from"../../../../../utils/schema/utils.mjs";import{videoDetailInfoMaterial as n}from"../video-detail-info/material.mjs";import{videoDetailInfoTitleTagsEpisodesMaterial as r}from"../video-detail-info-title-tags-episodes/material.mjs";import{videoDetailPlayerMaterial as i}from"../video-detail-player/material.mjs";import{videoDetailPlayerBridgeOnlyMaterial as a}from"../video-detail-player-bridge-only/material.mjs";import{videoDetailRecommendMaterial as o}from"../video-detail-recommend/material.mjs";import{videoDetailWaterfallRecommendMaterial as s}from"../video-detail-waterfall-recommend/material.mjs";import{videoDetailActionsMaterial as c}from"../video-detail-actions/material.mjs";function l(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>typeof t==`number`&&Number.isFinite(t)?[e,String(t)]:[e,t]))}function u(t,n){let r={...e(t.propsSchema),...n??{}},i=t.propsSchema.safeParse(r);if(i.success)return{isValid:!0,props:i.data};let a=l(r),o=t.propsSchema.safeParse(a);return o.success?{isValid:!0,props:o.data}:{isValid:!1,props:r}}const d=t([i,a,n,r,c,o,s]);export{u as resolveMaterialProps,d as videoDetailMaterials};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{useRequest as e}from"../../../../../hooks/query/use-query.mjs";import{batchQueryContentInteractions as t}from"../../../../../hooks/use-content-operate.mjs";import{DetailOperate as n}from"../shared/detail-operate.mjs";import{editorPreviewInformation as r}from"../shared/editor-preview.mjs";import{useVideoDetailMaterialRuntimeContext as i}from"../shared/runtime-context-provider.mjs";import{useCallback as a,useEffect as o,useRef as s,useState as c}from"react";import{jsx as l}from"react/jsx-runtime";function u({mode:u=`renderer`}){let d=i(),f=d?.information,p=d?.onUpdateInformation,m=u===`editor`,h=u===`renderer`,g=m,_=g?r:f,[v,y]=c(_),b=s(_),x=s(``);o(()=>{y(_)},[_]);let
|
|
2
|
+
"use client";import{useRequest as e}from"../../../../../hooks/query/use-query.mjs";import{batchQueryContentInteractions as t}from"../../../../../hooks/use-content-operate.mjs";import{DetailOperate as n}from"../shared/detail-operate.mjs";import{editorPreviewInformation as r}from"../shared/editor-preview.mjs";import{useVideoDetailMaterialRuntimeContext as i}from"../shared/runtime-context-provider.mjs";import{useCallback as a,useEffect as o,useRef as s,useState as c}from"react";import{jsx as l}from"react/jsx-runtime";function u({mode:u=`renderer`}){let d=i(),f=d?.information,p=d?.onUpdateInformation,m=u===`editor`,h=u===`renderer`,g=m,_=g?r:f,[v,y]=c(_),b=s(_),x=s(``),S=s(!1);o(()=>{y(_)},[_]);let C=p?_:v;o(()=>{b.current=C},[C]);let w=h&&!!_?.id,{data:T}=e([`video-detail-actions-interaction`,_?.id],async()=>_?.id?await t([_.id],1):null,{enabled:w,staleTime:0,refetchOnMount:`always`,refetchOnWindowFocus:!1}),E=a(e=>{if(!g){if(S.current=!0,p){p(e);return}y(t=>{if(!t)return t;let n=e.static?{...t.static||{},...e.static||{}}:t.static;return{...t,...e,static:n}})}},[p,g]);return o(()=>{if(S.current)return;let e=T?.interaction_list?.[0],t=b.current;if(!e||!t)return;let n=`${e.is_liked?1:0}-${e.is_disliked?1:0}-${e.is_collected?1:0}`;if(x.current===n)return;x.current=n;let r=e.is_liked||!1,i=e.is_disliked||!1,a=e.is_collected||!1,o=!!t.like,s=!!t.dislike,c=!!t.collect,l=t.static?.like_cnt,u=typeof l==`number`?l:Number(l||0),d=u;!r&&u>0?d=Math.max(0,u-1):o===r?r&&u===0&&(d=1):d=Math.max(0,u+(r?1:-1));let f=d!==u;o===r&&s===i&&c===a&&!f||E({like:r,dislike:i,collect:a,...f?{static:{...t.static||{},like_cnt:d}}:{}})},[E,T]),C?l(`div`,{className:g?`pointer-events-none`:void 0,children:l(n,{mode:u,information:C,onUpdate:E})}):null}export{u as VideoDetailActionsClient};
|