@funhub/platform 0.2.9 → 0.2.11
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/search/video.mjs +2 -0
- package/dist/biz.d.mts +5 -5
- package/dist/biz.mjs +1 -1
- package/dist/components/biz/business/advertisement/ad-match.d.mts +8 -4
- package/dist/components/biz/business/advertisement/ad-match.mjs +1 -1
- package/dist/components/biz/business/advertisement/ad-provider.mjs +1 -1
- package/dist/components/biz/business/advertisement/ad-query.d.mts +1 -2
- package/dist/components/biz/business/advertisement/ad-query.mjs +1 -1
- package/dist/components/biz/business/advertisement/ad-runtime-provider.d.mts +2 -2
- package/dist/components/biz/business/advertisement/ad-runtime-provider.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 -3
- package/dist/components/biz/business/advertisement/banner-ad/material.mjs +1 -1
- package/dist/components/biz/business/advertisement/banner-ad/schema.d.mts +9 -6
- 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.d.mts +4 -4
- package/dist/components/biz/business/advertisement/floating-ad/client.mjs +1 -1
- package/dist/components/biz/business/advertisement/floating-ad/index.d.mts +1 -1
- package/dist/components/biz/business/advertisement/floating-ad/material.d.mts +5 -0
- package/dist/components/biz/business/advertisement/floating-ad/schema.d.mts +21 -10
- package/dist/components/biz/business/advertisement/floating-ad/schema.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 -2
- package/dist/components/biz/business/advertisement/icon-ad/material.mjs +1 -1
- package/dist/components/biz/business/advertisement/icon-ad/schema.d.mts +7 -2
- package/dist/components/biz/business/advertisement/icon-ad/schema.mjs +1 -1
- package/dist/components/biz/business/advertisement/index.d.mts +4 -4
- package/dist/components/biz/business/advertisement/popup-ad/client.mjs +3 -3
- 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 -2
- package/dist/components/biz/business/advertisement/text-ad/material.mjs +1 -1
- package/dist/components/biz/business/advertisement/text-ad/schema.d.mts +5 -3
- package/dist/components/biz/business/advertisement/text-ad/schema.mjs +1 -1
- package/dist/components/biz/business/banner-carousel/client.mjs +1 -1
- package/dist/components/biz/business/detail/shared/detail-operate.mjs +1 -1
- package/dist/components/biz/business/detail/shared/registry.d.mts +1 -0
- package/dist/components/biz/business/detail/shared/runtime-context-provider.mjs +1 -1
- package/dist/components/biz/business/detail/shared/video-hero.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.mjs +1 -1
- package/dist/components/biz/business/detail/video-detail-recommend/material.d.mts +1 -0
- package/dist/components/biz/business/detail/video-detail-recommend/schema.d.mts +1 -0
- package/dist/components/biz/business/detail/video-detail-recommend/schema.mjs +1 -1
- package/dist/components/biz/business/detail/video-detail-recommend/shared.mjs +1 -1
- package/dist/components/biz/business/detail/video-detail-recommend/utils.mjs +1 -1
- package/dist/components/biz/business/header-search/header-avatar-logo-search/schema.mjs +1 -1
- package/dist/components/biz/business/header-search/shared/logo.mjs +1 -1
- package/dist/components/biz/business/home-recommend/home-recommend-grid/client.mjs +1 -1
- package/dist/components/biz/business/home-recommend/home-recommend-grid/inspector-schema.d.mts +4 -24
- 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 +2 -22
- package/dist/components/biz/business/home-recommend/home-recommend-grid/server.mjs +1 -1
- package/dist/components/biz/business/home-recommend/home-recommend-waterfall/client.mjs +1 -1
- package/dist/components/biz/business/home-recommend/home-recommend-waterfall/inspector-schema.d.mts +4 -24
- 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 +2 -22
- package/dist/components/biz/business/home-recommend/home-recommend-waterfall/server.mjs +1 -1
- package/dist/components/biz/business/home-recommend/shared/home-recommend-base.mjs +1 -1
- package/dist/components/biz/business/home-recommend/shared/home-recommend-default-config.mjs +1 -1
- package/dist/components/biz/business/home-recommend/shared/home-recommend-play-count.mjs +2 -0
- package/dist/components/biz/business/home-recommend/shared/home-recommend-preview.mjs +1 -1
- package/dist/components/biz/business/home-recommend/shared/home-recommend-runtime-props.mjs +1 -1
- package/dist/components/biz/business/home-recommend/shared/home-recommend-server-data.mjs +1 -1
- package/dist/components/biz/business/home-recommend/shared/home-recommend-smart-tag.mjs +2 -0
- package/dist/components/biz/business/hot-recommend/client.mjs +1 -1
- package/dist/components/biz/business/hot-recommend/material.d.mts +0 -1
- package/dist/components/biz/business/hot-recommend/schema.d.mts +0 -1
- package/dist/components/biz/business/hot-recommend/schema.mjs +1 -1
- package/dist/components/biz/business/image-text-recommend/client.d.mts +1 -1
- package/dist/components/biz/business/image-text-recommend/client.mjs +1 -1
- package/dist/components/biz/business/image-text-recommend/material.d.mts +7 -7
- package/dist/components/biz/business/image-text-recommend/schema.d.mts +25 -30
- package/dist/components/biz/business/image-text-recommend/schema.mjs +1 -1
- package/dist/components/biz/business/image-text-recommend/server.mjs +1 -1
- package/dist/components/biz/business/image-text-recommend/shared/query.mjs +1 -1
- package/dist/components/biz/business/index.d.mts +4 -4
- 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 +24 -0
- package/dist/components/biz/business/marquee/material.d.mts +6 -5
- package/dist/components/biz/business/marquee/schema.d.mts +6 -5
- package/dist/components/biz/business/marquee/schema.mjs +1 -1
- package/dist/components/biz/business/profile/profile-header/client.mjs +1 -1
- package/dist/components/biz/business/profile/profile-header/user-profile-avatar.mjs +1 -1
- package/dist/components/biz/business/profile/profile-main/tabs/collect-tab/video-waterfall.mjs +1 -1
- package/dist/components/biz/business/profile/profile-main/utils.mjs +1 -1
- package/dist/components/biz/business/tab-bar/client.d.mts +0 -2
- package/dist/components/biz/business/tab-bar/client.mjs +1 -1
- package/dist/components/biz/business/text-recommend/client.mjs +1 -1
- package/dist/components/biz/business/text-recommend/material.d.mts +0 -1
- package/dist/components/biz/business/text-recommend/schema.d.mts +0 -1
- package/dist/components/biz/business/text-recommend/schema.mjs +1 -1
- package/dist/components/common/collection-popup/create-collection-sheet.d.mts +3 -0
- package/dist/components/common/collection-popup/create-collection-sheet.mjs +1 -1
- package/dist/components/common/collection-popup/index.mjs +1 -1
- package/dist/components/common/list/waterfall-recommend/recommend-badge-style.mjs +2 -0
- package/dist/components/common/list/waterfall-recommend/waterfall-recommend-display.mjs +2 -0
- package/dist/components/common/list/waterfall-recommend/waterfall-recommend.d.mts +5 -7
- package/dist/components/common/list/waterfall-recommend/waterfall-recommend.mjs +1 -1
- package/dist/components/common/series-episodes/index.d.mts +1 -0
- package/dist/components/common/series-episodes/index.mjs +1 -1
- package/dist/components/common/video-player/index.d.mts +1 -2
- 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/fullscreen-feed/page.mjs +1 -1
- package/dist/components/pages/search/search-result/shared.mjs +1 -1
- package/dist/components/pages/search-result/search-video-info.mjs +1 -1
- package/dist/components/pages/settings/_components/reset-password-drawer.mjs +1 -1
- package/dist/components/ui/badge.d.mts +1 -1
- package/dist/components/ui/button.d.mts +2 -2
- package/dist/components/ui/empty.d.mts +1 -1
- package/dist/components/ui/item.d.mts +1 -1
- package/dist/hooks.d.mts +1 -2
- 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/materials.d.mts +1 -2
- package/dist/materials.mjs +1 -1
- package/dist/service/advertisement.d.mts +1 -1
- package/dist/service/advertisement.mjs +1 -1
- package/dist/service/generated/client.d.mts +2 -10
- package/dist/service/generated/client.mjs +1 -1
- package/dist/service/generated/tanstack.d.mts +2 -12
- package/dist/service/generated/tanstack.mjs +1 -1
- package/dist/service.d.mts +3 -3
- package/dist/service.mjs +1 -1
- package/dist/store/modules/user-store.d.mts +1 -1
- package/dist/store/modules/user-store.mjs +1 -1
- package/dist/store.d.mts +1 -3
- package/dist/store.mjs +1 -1
- package/dist/types.d.mts +1 -171
- package/dist/utils/device-id.d.mts +2 -2
- package/dist/utils/device-id.mjs +1 -1
- package/dist/utils/http.mjs +1 -1
- package/dist/utils/password-validator.mjs +1 -1
- package/dist/utils/schema/inspector.d.mts +2 -2
- package/dist/utils.d.mts +1 -3
- package/dist/utils.mjs +1 -1
- package/package.json +1 -2
- package/dist/components/biz/business/home-recommend/shared/home-recommend-smart-layout.mjs +0 -2
- package/dist/components/biz/business/ranking-recommend/client.d.mts +0 -17
- package/dist/components/biz/business/ranking-recommend/client.mjs +0 -70
- package/dist/components/biz/business/ranking-recommend/material.d.mts +0 -35
- package/dist/components/biz/business/ranking-recommend/material.mjs +0 -2
- package/dist/components/biz/business/ranking-recommend/schema.d.mts +0 -35
- package/dist/components/biz/business/ranking-recommend/schema.mjs +0 -2
- package/dist/components/biz/business/ranking-recommend/server.d.mts +0 -11
- package/dist/components/biz/business/ranking-recommend/server.mjs +0 -2
- package/dist/components/biz/business/ranking-recommend/shared/query.mjs +0 -2
- package/dist/components/biz/business/ranking-recommend/shared.d.mts +0 -15
- package/dist/components/biz/business/ranking-recommend/shared.mjs +0 -2
- package/dist/components/common/video-player/video-blind-ad-overlay.mjs +0 -2
- package/dist/components/common/video-player/video-player-ref-context.mjs +0 -2
- package/dist/hooks/use-is-client.d.mts +0 -10
- package/dist/hooks/use-is-client.mjs +0 -2
- package/dist/store/modules/blind-spot-ad-store.d.mts +0 -116
- package/dist/store/modules/blind-spot-ad-store.mjs +0 -2
- package/dist/store/modules/video-player-ref-store.d.mts +0 -21
- package/dist/store/modules/video-player-ref-store.mjs +0 -2
- package/dist/utils/browser-fingerprint.d.mts +0 -13
- package/dist/utils/browser-fingerprint.mjs +0 -2
- package/dist/utils/request-user-id.d.mts +0 -12
- package/dist/utils/request-user-id.mjs +0 -2
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import { MaterialComponentMode } from "../../../../../utils/schema/schema.mjs";
|
|
2
|
+
import { InferSchemaProps, MaterialComponentMode, SchemaHasDefaultValue } from "../../../../../utils/schema/schema.mjs";
|
|
3
|
+
import "../../../../../utils.mjs";
|
|
3
4
|
import { AdsMatchSceneContext } from "../../../../../service/advertisement.mjs";
|
|
4
5
|
import * as zod from "zod";
|
|
5
6
|
import * as zod_v4_core0 from "zod/v4/core";
|
|
@@ -23,23 +24,29 @@ interface FloatingAdItem {
|
|
|
23
24
|
name?: string;
|
|
24
25
|
}
|
|
25
26
|
/**
|
|
26
|
-
*
|
|
27
|
+
* 悬浮广告物料属性。
|
|
27
28
|
*/
|
|
28
29
|
declare const floatingAdInspectorPropsSchema: zod.ZodObject<{
|
|
30
|
+
readonly materialUrl: zod.ZodString & SchemaHasDefaultValue;
|
|
31
|
+
readonly jumpUrl: zod.ZodString & SchemaHasDefaultValue;
|
|
32
|
+
readonly name: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
|
|
33
|
+
} & {
|
|
29
34
|
mode: zod.ZodOptional<zod.ZodEnum<{
|
|
30
35
|
renderer: "renderer";
|
|
31
36
|
editor: "editor";
|
|
32
37
|
}>>;
|
|
33
38
|
}, zod_v4_core0.$strip>;
|
|
34
|
-
declare const floatingAdInspectorDefaultProps: {
|
|
39
|
+
declare const floatingAdInspectorDefaultProps: {
|
|
40
|
+
readonly materialUrl: string;
|
|
41
|
+
readonly jumpUrl: string;
|
|
42
|
+
readonly name: string;
|
|
43
|
+
};
|
|
44
|
+
type FloatingAdInspectorProps<T extends object = object> = InferSchemaProps<typeof floatingAdInspectorPropsSchema> & T;
|
|
45
|
+
type FloatingAdEditableProps = InferSchemaProps<typeof floatingAdInspectorPropsSchema>;
|
|
35
46
|
/**
|
|
36
47
|
* 悬浮广告组件 props。
|
|
37
48
|
*/
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* 显式传入的广告数据,优先于广告上下文。
|
|
41
|
-
*/
|
|
42
|
-
ad?: FloatingAdItem;
|
|
49
|
+
type FloatingAdProps = Partial<FloatingAdEditableProps> & {
|
|
43
50
|
/**
|
|
44
51
|
* 渲染模式。
|
|
45
52
|
*/
|
|
@@ -52,6 +59,10 @@ interface FloatingAdProps {
|
|
|
52
59
|
* 广告场景控制对象。
|
|
53
60
|
*/
|
|
54
61
|
sceneContext?: AdsMatchSceneContext;
|
|
62
|
+
/**
|
|
63
|
+
* 广告数据。
|
|
64
|
+
*/
|
|
65
|
+
ad?: FloatingAdItem;
|
|
55
66
|
/**
|
|
56
67
|
* 距离底部的偏移量。
|
|
57
68
|
*/
|
|
@@ -68,6 +79,6 @@ interface FloatingAdProps {
|
|
|
68
79
|
* 自定义点击事件。
|
|
69
80
|
*/
|
|
70
81
|
onClick?: () => void;
|
|
71
|
-
}
|
|
82
|
+
};
|
|
72
83
|
//#endregion
|
|
73
|
-
export { FloatingAdItem, FloatingAdProps, floatingAdInspectorDefaultProps, floatingAdInspectorPropsSchema };
|
|
84
|
+
export { FloatingAdEditableProps, FloatingAdInspectorProps, FloatingAdItem, FloatingAdProps, floatingAdInspectorDefaultProps, floatingAdInspectorPropsSchema };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{defineComponentPropsSchema as e,getSchemaDefaultProps as t}from"../../../../../utils/schema/schema.mjs";const n=e(()
|
|
2
|
+
import{defineComponentPropsSchema as e,getSchemaDefaultProps as t}from"../../../../../utils/schema/schema.mjs";const n=e(e=>({materialUrl:e.string(``,{label:`广告素材`,required:!0}),jumpUrl:e.string(``,{label:`跳转链接`,required:!0}),name:e.string(`悬浮广告`,{label:`广告名称`,required:!1})})),r=t(n);export{r as floatingAdInspectorDefaultProps,n as floatingAdInspectorPropsSchema};
|
|
@@ -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};
|
|
@@ -15,11 +15,10 @@ declare const iconAdMaterial: DefineMaterialOption<typeof IconAdServer, typeof I
|
|
|
15
15
|
readonly displayCount: zod.ZodNumber & SchemaHasDefaultValue;
|
|
16
16
|
readonly items: zod.ZodArray<zod.ZodObject<{
|
|
17
17
|
title: zod.ZodString & SchemaHasDefaultValue;
|
|
18
|
-
default_advertise_location_code: zod.ZodString & SchemaHasDefaultValue;
|
|
19
18
|
icon: zod.ZodString & SchemaHasDefaultValue;
|
|
20
19
|
jumpUrl: zod.ZodString & SchemaHasDefaultValue;
|
|
21
20
|
badgeText: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
|
|
22
|
-
}, zod_v4_core0.$strip
|
|
21
|
+
}, zod_v4_core0.$strip>> & SchemaHasDefaultValue;
|
|
23
22
|
} & {
|
|
24
23
|
mode: zod.ZodOptional<zod.ZodEnum<{
|
|
25
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};
|
|
@@ -33,11 +33,10 @@ declare const iconAdInspectorPropsSchema: z$1.ZodObject<{
|
|
|
33
33
|
readonly displayCount: z$1.ZodNumber & SchemaHasDefaultValue;
|
|
34
34
|
readonly items: z$1.ZodArray<z$1.ZodObject<{
|
|
35
35
|
title: z$1.ZodString & SchemaHasDefaultValue;
|
|
36
|
-
default_advertise_location_code: z$1.ZodString & SchemaHasDefaultValue;
|
|
37
36
|
icon: z$1.ZodString & SchemaHasDefaultValue;
|
|
38
37
|
jumpUrl: z$1.ZodString & SchemaHasDefaultValue;
|
|
39
38
|
badgeText: z$1.ZodOptional<z$1.ZodString> & SchemaHasDefaultValue;
|
|
40
|
-
}, z$1.core.$strip
|
|
39
|
+
}, z$1.core.$strip>> & SchemaHasDefaultValue;
|
|
41
40
|
} & {
|
|
42
41
|
mode: z$1.ZodOptional<z$1.ZodEnum<{
|
|
43
42
|
renderer: "renderer";
|
|
@@ -46,6 +45,12 @@ declare const iconAdInspectorPropsSchema: z$1.ZodObject<{
|
|
|
46
45
|
}, z$1.core.$strip>;
|
|
47
46
|
declare const iconAdInspectorDefaultProps: {
|
|
48
47
|
readonly displayCount: number;
|
|
48
|
+
readonly items: {
|
|
49
|
+
title: string;
|
|
50
|
+
icon: string;
|
|
51
|
+
jumpUrl: string;
|
|
52
|
+
badgeText?: string | undefined;
|
|
53
|
+
}[];
|
|
49
54
|
};
|
|
50
55
|
type IconAdInspectorProps<T extends object = object> = InferSchemaProps<typeof iconAdInspectorPropsSchema> & T;
|
|
51
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}),
|
|
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};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
2
|
import { BannerAdInspectorProps, BannerAdItem, BannerAdProps, BannerAdStyleSize, bannerAdInspectorDefaultProps, bannerAdInspectorPropsSchema, bannerAdStyleSizeOptions } from "./banner-ad/schema.mjs";
|
|
3
|
-
import { FloatingAdItem, FloatingAdProps, floatingAdInspectorDefaultProps, floatingAdInspectorPropsSchema } from "./floating-ad/schema.mjs";
|
|
3
|
+
import { FloatingAdEditableProps, FloatingAdInspectorProps, FloatingAdItem, FloatingAdProps, floatingAdInspectorDefaultProps, floatingAdInspectorPropsSchema } from "./floating-ad/schema.mjs";
|
|
4
4
|
import { IconAdInspectorProps, IconAdItem, IconAdProps, iconAdInspectorDefaultProps, iconAdInspectorPropsSchema } from "./icon-ad/schema.mjs";
|
|
5
5
|
import { TextAdInspectorProps, TextAdItem, TextAdProps, textAdInspectorDefaultProps, textAdInspectorPropsSchema } from "./text-ad/schema.mjs";
|
|
6
|
-
import { AdsMatchExtData, adaptBannerAdProps,
|
|
6
|
+
import { AdsMatchExtData, adaptBannerAdProps, adaptFloatingAdItem, adaptIconAdProps, adaptPopupAdMaterials, adaptTextAdProps, buildAdsMatchRequest, getFirstMatchedMaterial, hasMatchedAds, parseAdsMatchExtData, resolveAdsAppCode, sortAdsMatchMaterials } from "./ad-match.mjs";
|
|
7
7
|
import { AdProvider, AdProviderProps, AdProviderValue, useAdProvider } from "./ad-provider.mjs";
|
|
8
8
|
import { AdsMatchQueryOptions, createAdsMatchPrefetchItem, createAdsMatchQueryFn, getAdsMatchQueryKey } from "./ad-query.mjs";
|
|
9
9
|
import { AdRuntimeProvider, AdRuntimeProviderProps } from "./ad-runtime-provider.mjs";
|
|
@@ -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;
|
|
@@ -56,9 +56,9 @@
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
@media (prefers-reduced-motion: reduce) {
|
|
59
|
-
* {
|
|
59
|
+
:global(*) {
|
|
60
60
|
animation-duration: 0ms !important;
|
|
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};
|
|
@@ -13,11 +13,10 @@ import * as zod_v4_core0 from "zod/v4/core";
|
|
|
13
13
|
*/
|
|
14
14
|
declare const textAdMaterial: DefineMaterialOption<typeof TextAdServer, typeof TextAd, zod.ZodObject<{
|
|
15
15
|
readonly displayCount: zod.ZodNumber & SchemaHasDefaultValue;
|
|
16
|
-
readonly default_advertise_location_code: zod.ZodString & SchemaHasDefaultValue;
|
|
17
16
|
readonly items: zod.ZodArray<zod.ZodObject<{
|
|
18
17
|
text: zod.ZodString & SchemaHasDefaultValue;
|
|
19
18
|
jumpUrl: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
|
|
20
|
-
}, zod_v4_core0.$strip
|
|
19
|
+
}, zod_v4_core0.$strip>> & SchemaHasDefaultValue;
|
|
21
20
|
} & {
|
|
22
21
|
mode: zod.ZodOptional<zod.ZodEnum<{
|
|
23
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};
|
|
@@ -23,11 +23,10 @@ interface TextAdItem {
|
|
|
23
23
|
*/
|
|
24
24
|
declare const textAdInspectorPropsSchema: z$1.ZodObject<{
|
|
25
25
|
readonly displayCount: z$1.ZodNumber & SchemaHasDefaultValue;
|
|
26
|
-
readonly default_advertise_location_code: z$1.ZodString & SchemaHasDefaultValue;
|
|
27
26
|
readonly items: z$1.ZodArray<z$1.ZodObject<{
|
|
28
27
|
text: z$1.ZodString & SchemaHasDefaultValue;
|
|
29
28
|
jumpUrl: z$1.ZodOptional<z$1.ZodString> & SchemaHasDefaultValue;
|
|
30
|
-
}, z$1.core.$strip
|
|
29
|
+
}, z$1.core.$strip>> & SchemaHasDefaultValue;
|
|
31
30
|
} & {
|
|
32
31
|
mode: z$1.ZodOptional<z$1.ZodEnum<{
|
|
33
32
|
renderer: "renderer";
|
|
@@ -36,7 +35,10 @@ declare const textAdInspectorPropsSchema: z$1.ZodObject<{
|
|
|
36
35
|
}, z$1.core.$strip>;
|
|
37
36
|
declare const textAdInspectorDefaultProps: {
|
|
38
37
|
readonly displayCount: number;
|
|
39
|
-
readonly
|
|
38
|
+
readonly items: {
|
|
39
|
+
text: string;
|
|
40
|
+
jumpUrl?: string | undefined;
|
|
41
|
+
}[];
|
|
40
42
|
};
|
|
41
43
|
type TextAdInspectorProps<T extends object = object> = InferSchemaProps<typeof textAdInspectorPropsSchema> & T;
|
|
42
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`),
|
|
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{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
|
|
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{defaultProps as c}from"./default-props.mjs";import l from"clsx";import{useIsClient as u}from"foxact/use-is-client";import{useEffect as d,useRef as f,useState as p}from"react";import{jsx as m,jsxs as h}from"react/jsx-runtime";const g={list:[]};function _({mode:_=`renderer`,props:v=g,styles:y,events:b,...x}){let S=_===`editor`,{autoplay:C=c.autoplay,interval:w=c.interval,loop:T=c.loop,showIndicator:E=c.showIndicator,list:D=[]}={...c,...v,...x},[O,k]=p(),[A,j]=p(0),M=u(),N=f(null);if(d(()=>{if(!O||!M)return;let e=()=>{j(O.selectedScrollSnap())};return O.on(`select`,e),e(),()=>{O.off(`select`,e)}},[O,b,M]),d(()=>{if(!(!C||!O||D.length<=1))return N.current=setInterval(()=>{O.canScrollNext()?O.scrollNext():T&&O.scrollTo(0)},w*1e3),()=>{N.current&&=(clearInterval(N.current),null)}},[C,O,w,T,D.length]),!D||D.length===0)return null;let P=D[A],F=y?e(y,{}):void 0,I=P?.title==null?``:String(P.title).trim();return m(n,{className:l(`w-full px-[16px]`,S&&`pointer-events-none`),style:F,children:h(n,{className:`relative w-full overflow-hidden rounded-[8px]`,children:[m(r,{setApi:k,opts:{align:`start`,loop:T,skipSnaps:!1,dragFree:!1},className:`w-full`,children:m(i,{className:`ml-0`,children:D.map((e,n)=>m(a,{className:`pl-0`,children:m(s,{href:e.target,className:l(`block relative w-full overflow-hidden touch-manipulation`,`aspect-[358/166]`),children:m(t,{src:e.coverUrl,alt:e.title||`Banner ${n+1}`,fill:!0,objectFit:`cover`,unoptimized:!0})})},n))})}),(I||E&&D.length>1)&&m(n,{className:`absolute inset-0 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%)`}}),I&&m(n,{className:l(`absolute left-[16px] bottom-[14px] pointer-events-none`,`right-[58px]`),children:m(o,{as:`p`,className:`text-[16px] leading-[22px] text-white/90 line-clamp-1`,children:I})}),E&&D.length>1&&m(n,{className:l(`absolute bottom-[22px] flex items-center gap-[6px] pointer-events-auto`,`right-[16px]`),children:D.map((e,t)=>m(`button`,{type:`button`,className:l(`block size-[4px] rounded-full`,t===A?`bg-white`:`bg-white/60`),"aria-label":`跳转到第 ${t+1} 个 Banner`,onClick:()=>O?.scrollTo(t)},t))})]})})}export{_ as default};
|
|
@@ -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 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};
|
|
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(),_.success(e.isLike?N(`detailOperate.likeSuccess`):N(`detailOperate.unlikeSuccess`)),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.likeFailed`))}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};
|
|
@@ -72,6 +72,7 @@ declare const videoDetailMaterials: MaterialMap<readonly [DefineMaterialOption<t
|
|
|
72
72
|
upload: "upload";
|
|
73
73
|
}>>;
|
|
74
74
|
coverUrl: z$1.ZodOptional<z$1.ZodString>;
|
|
75
|
+
badge_url: z$1.ZodOptional<z$1.ZodString>;
|
|
75
76
|
titleMode: z$1.ZodOptional<z$1.ZodEnum<{
|
|
76
77
|
content: "content";
|
|
77
78
|
custom: "custom";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{gContentGetVideoDetail as e}from"../../../../../service/generated/client.mjs";import{useRouter as t}from"../../../../../utils/use-compatible-router.mjs";import{buildVideoPlayerSrc as n}from"../../../../common/video-player/process-m3u8-cache.mjs";import{notifyBridgeEpisodeChanged as r}from"../../../../../utils/login-modal-bridge.mjs";import{useRequest as i}from"../../../../../hooks/query/use-query.mjs";import{useKeepAliveState as a}from"../../../../common/keep-scroll-position/index.mjs";import{createContext as o,use as s,useCallback as c,useEffect as l,useMemo as u}from"react";import{jsx as d}from"react/jsx-runtime";import{useParams as f}from"next/navigation";const p=o(void 0),m=`funhub:video-detail-episode-sync`;function h(e,t){let n=String(e||``).split(`/`).filter(Boolean),r=n.findIndex(e=>e===`video`||e===`webview`);return r<0?!1:n[r+1]===t}function g(e){let t=Math.floor(Number(e)||1);return t>0?t:1}function _(e){typeof window>`u`||window.dispatchEvent(new CustomEvent(m,{detail:e}))}function v(e){return e.type===m&&e instanceof CustomEvent}function y(e,t){if(!(!e&&!t))return{information:e?.information??t?.information,currentSeriesNum:e?.currentSeriesNum??t?.currentSeriesNum,onEpisodeChange:e?.onEpisodeChange??t?.onEpisodeChange,onUpdateInformation:e?.onUpdateInformation??t?.onUpdateInformation,detailId:e?.detailId??t?.detailId,episodeIndex:e?.episodeIndex??t?.episodeIndex,resumeProgressSeconds:e?.resumeProgressSeconds??t?.resumeProgressSeconds,isShow:e?.isShow??t?.isShow,isWebView:e?.isWebView??t?.isWebView,isInformationLoading:e?.isInformationLoading??t?.isInformationLoading,isInformationResolved:e?.isInformationResolved??t?.isInformationResolved
|
|
2
|
+
"use client";import{gContentGetVideoDetail as e}from"../../../../../service/generated/client.mjs";import{useRouter as t}from"../../../../../utils/use-compatible-router.mjs";import{buildVideoPlayerSrc as n}from"../../../../common/video-player/process-m3u8-cache.mjs";import{notifyBridgeEpisodeChanged as r}from"../../../../../utils/login-modal-bridge.mjs";import{useRequest as i}from"../../../../../hooks/query/use-query.mjs";import{useKeepAliveState as a}from"../../../../common/keep-scroll-position/index.mjs";import{createContext as o,use as s,useCallback as c,useEffect as l,useMemo as u}from"react";import{jsx as d}from"react/jsx-runtime";import{useParams as f}from"next/navigation";const p=o(void 0),m=`funhub:video-detail-episode-sync`;function h(e,t){let n=String(e||``).split(`/`).filter(Boolean),r=n.findIndex(e=>e===`video`||e===`webview`);return r<0?!1:n[r+1]===t}function g(e){let t=Math.floor(Number(e)||1);return t>0?t:1}function _(e){typeof window>`u`||window.dispatchEvent(new CustomEvent(m,{detail:e}))}function v(e){return e.type===m&&e instanceof CustomEvent}function y(e,t){if(!(!e&&!t))return{information:e?.information??t?.information,currentSeriesNum:e?.currentSeriesNum??t?.currentSeriesNum,onEpisodeChange:e?.onEpisodeChange??t?.onEpisodeChange,onUpdateInformation:e?.onUpdateInformation??t?.onUpdateInformation,detailId:e?.detailId??t?.detailId,episodeIndex:e?.episodeIndex??t?.episodeIndex,resumeProgressSeconds:e?.resumeProgressSeconds??t?.resumeProgressSeconds,isShow:e?.isShow??t?.isShow,isWebView:e?.isWebView??t?.isWebView,isInformationLoading:e?.isInformationLoading??t?.isInformationLoading,isInformationResolved:e?.isInformationResolved??t?.isInformationResolved}}function b({value:e,children:t}){let n=s(p);return d(p,{value:u(()=>y(n,e)??e,[n,e]),children:t})}function x(){let e=s(p),t=e!==void 0&&e.onEpisodeChange===void 0,n=S({enabled:e===void 0||e.onEpisodeChange===void 0||e.detailId===void 0||e.currentSeriesNum===void 0||e.episodeIndex===void 0||e.isInformationLoading===void 0||e.isInformationResolved===void 0,shouldRequestInformation:t||!e?.information});return u(()=>{let r=y(e,n);return r&&(e&&n&&t?{...r,information:n.information??r.information,currentSeriesNum:n.currentSeriesNum??r.currentSeriesNum,episodeIndex:n.episodeIndex??r.episodeIndex,onEpisodeChange:n.onEpisodeChange??r.onEpisodeChange,isInformationLoading:n.isInformationLoading??r.isInformationLoading,isInformationResolved:n.isInformationResolved??r.isInformationResolved}:r)},[e,n,t])}function S(o){let{enabled:s,shouldRequestInformation:d}=o,p=f(),y=t(),b=p.level,x=Array.isArray(b)?b:typeof b==`string`?[b]:[],S=x[0]||``,C=x.findIndex(e=>e===`episode`),w=C>=0?x[C+1]:x[2],T=Math.max(1,Number(w)||1),[E,D]=a(`video-detail-material-series-num-${S}`,T);l(()=>{D(T)},[T,D]),l(()=>{if(!S||typeof window>`u`)return;let e=e=>{if(!v(e))return;let t=e.detail;if(!t||t.detailId!==S)return;let n=g(t.seriesNum);D(e=>e===n?e:n)};return window.addEventListener(m,e),()=>{window.removeEventListener(m,e)}},[S,D]);let O=c(e=>{if(!S)return;let t=g(e);D(t),_({detailId:S,seriesNum:t})},[S,D]),k=Math.max(1,Number(E)||1),A=Math.max(0,k-1),j=x[1]||``,M=typeof window<`u`&&window.isWebView===!0,{data:N,isPending:P,isFetching:F,isError:I,isSuccess:L}=i([`video-detail`,S],async()=>S?await e({id:S}):null,{enabled:s&&d&&!!S}),R=u(()=>{let e=N?.data?.video;if(!(!e||typeof e!=`object`))return{...e,content_type:1,episode_cnt:e.links?.length||0}},[N?.data?.video]),z=c(e=>{let t=Math.max(1,Math.floor(Number(e)||1));if(!S||typeof window>`u`)return;let i=`/${M?`webview`:`video`}/${S}/${encodeURIComponent(j)}/episode/${t}`,{search:a,hash:o,pathname:s}=window.location,c=`${s}${a}${o}`,l=`${i}${a}${o}`,u=h(s,S);if(c!==l){if(M){let e=R?.links?.[Math.max(0,t-1)],i=n(String(e?.m3u8_url||e?.preview_m3u8_url||``).trim());r({poster:String(R?.img_y||R?.img_x||R?.preview_images?.[0]||``).trim(),src:i,title:String(R?.title||R?.name||``).trim(),contentId:S,episode:t}),k!==t&&O(t);return}u&&typeof window.history?.replaceState==`function`?(window.history.replaceState(window.history.state,``,l),O(t)):y.replace(l,{scroll:!1});return}k!==t&&O(t)},[k,S,R?.img_x,R?.img_y,R?.links,R?.name,R?.preview_images,R?.title,M,j,y,O]);if(l(()=>{let e=Array.isArray(R?.links)?R.links.length:0;e<=0||k<=e||z(1)},[k,R?.links,z]),s)return{information:R,currentSeriesNum:k,onEpisodeChange:z,detailId:S,episodeIndex:A,resumeProgressSeconds:0,isShow:!0,isWebView:M,isInformationLoading:d?!!S&&!R&&(P||F):!1,isInformationResolved:!S||!!R||!d||I||L}}export{b as VideoDetailMaterialRuntimeProvider,x as useVideoDetailMaterialRuntimeContext};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{cn as e}from"../../../../../utils/cn.mjs";import{pxToVw as t}from"../../../../../utils/helper.mjs";import{Image as n}from"../../../../ui/image.mjs";import{Box as r}from"../../../../ui/box.mjs";import{Text as i}from"../../../../ui/text.mjs";import{useBrowseReport as a}from"../../../../../hooks/use-browse-report.mjs";import{MediaPreview as o,useMediaPreview as s}from"../../../../common/media-preview/index.mjs";import c from"../../../../common/video-player/index.mjs";import{UserActivityMediaGrid as l}from"../../../../common/list/user-activity-list/user-activity-list-item.mjs";import{
|
|
2
|
+
"use client";import{cn as e}from"../../../../../utils/cn.mjs";import{pxToVw as t}from"../../../../../utils/helper.mjs";import{Image as n}from"../../../../ui/image.mjs";import{Box as r}from"../../../../ui/box.mjs";import{Text as i}from"../../../../ui/text.mjs";import{useBrowseReport as a}from"../../../../../hooks/use-browse-report.mjs";import{MediaPreview as o,useMediaPreview as s}from"../../../../common/media-preview/index.mjs";import c from"../../../../common/video-player/index.mjs";import{UserActivityMediaGrid as l}from"../../../../common/list/user-activity-list/user-activity-list-item.mjs";import{memo as u,useCallback as d,useEffect as f,useMemo as p,useRef as m}from"react";import{Fragment as h,jsx as g,jsxs as _}from"react/jsx-runtime";import{useTranslations as v}from"next-intl";const y=u(({mode:t=`renderer`,information:n,isVideo:a,episodeIndex:c=0,resumeProgressSeconds:u=0,className:f=``})=>{let m=t===`editor`,h=p(()=>({id:n.id,name:n.name,preview_images:n.preview_images,img_y:n.img_y,img_x:n.img_x}),[n.id,n.name,n.preview_images,n.img_y,n.img_x]),v=p(()=>{let e=n?.medias,t=Array.isArray(e)?e.filter(Boolean):[];return t.length>0?t:(h.preview_images?.length?h.preview_images:[h.img_y||h.img_x||``].filter(Boolean)).filter(Boolean).map(e=>({media_url:e,is_video:!1,cover_image:``}))},[h.img_x,h.img_y,h.preview_images,n]),y=s(),x=p(()=>v.filter(Boolean).map(e=>{let t=e?.is_video?`video`:`image`,r=String(e?.media_url||``),i=e?.cover_image||n.img_y||n.img_x;return{src:r,type:t,...i?{cover:String(i)}:{}}}).filter(e=>!!e.src),[n.img_x,n.img_y,v]),S=d(e=>{m||!x.length||y.open(x,e)},[m,y,x]);return m?g(`img`,{src:`/static/components-thumb/video_player.png`,alt:`video-preview`,className:`w-full block`}):a?g(b,{information:n,episodeIndex:c,resumeProgressSeconds:u,isEditor:m}):_(`div`,{className:e(`w-full`,f),children:[_(r,{className:`mt-3 px-[12px] space-y-1`,children:[g(i,{as:`p`,className:`break-all`,dangerouslySetInnerHTML:{__html:n.description}}),g(l,{medias:v,onItemClick:S})]}),g(o,{})]})});y.displayName=`DetailHero`;const b=u(({information:e,episodeIndex:t,resumeProgressSeconds:n,isEditor:r})=>{let i=p(()=>({id:e.id,mid:e.mid,img_width:e.img_width,img_height:e.img_height,img_y:e.img_y,img_x:e.img_x,preview_images:e.preview_images}),[e.id,e.mid,e.img_width,e.img_height,e.img_y,e.img_x,e.preview_images]);return g(x,{information:{...e,...i},episodeIndex:t,resumeProgressSeconds:n,isEditor:r})},(e,t)=>{let n=e.information,r=t.information;return n.id===r.id&&n.mid===r.mid&&n.img_width===r.img_width&&n.img_height===r.img_height&&n.img_y===r.img_y&&n.img_x===r.img_x&&e.resumeProgressSeconds===t.resumeProgressSeconds&&e.episodeIndex===t.episodeIndex&&e.isEditor===t.isEditor});b.displayName=`StableDetailPlayerBox`;function x({information:e,episodeIndex:i,resumeProgressSeconds:o,isEditor:s}){let l=v(`components.biz.business.detail`),u=m(0),y=m(0),b=Math.max(0,Number(i)||0),x=b+1,T=p(()=>e?.id,[e?.id]),E=p(()=>({id:e.id,mid:e.mid,img_width:e.img_width,img_height:e.img_height,img_y:e.img_y,img_x:e.img_x,preview_images:e.preview_images,links:e.links}),[e.id,e.mid,e.img_width,e.img_height,e.img_y,e.img_x,e.preview_images,e.links]),D=p(()=>E.mid||E.id,[E.id,E.mid]),O=p(()=>{let e=E.links?.[b]?.id;return e?String(e):`ep-${b+1}`},[b,E.links]),k=p(()=>`__reportData_detail_page__${E.id}:${O}`,[O,E.id]),A=p(()=>{if(s||typeof window>`u`)return 0;try{let e=sessionStorage.getItem(k);if(!e)return 0;let t=JSON.parse(e),n=Number(t.currentTime||0),r=Number(t.duration||0);if(!Number.isFinite(n)||!Number.isFinite(r))return 0;if(n>0&&r>0)return n}catch(e){console.error(`读取 sessionStorage 数据失败:`,e)}return 0},[s,k]),j=p(()=>{let e=Number(o||0);return Number.isFinite(e)&&e>0?e:0},[o]),M=p(()=>j>0?j:A,[j,A]),N=p(()=>{let t=w(e),n=t[t.length?Math.max(0,Math.min(b,t.length-1)):0]?.url||``,r=!!t.length;if(!r)return{hasVideo:!1,hlsList:[],videoUrl:``,width:1,height:1,resolution:`0x0`,aspectRatio:1,poster:``};let i=Number(E.img_width||0)||1,a=Number(E.img_height||0)||1;return{hasVideo:r,hlsList:t,videoUrl:n,width:i,height:a,resolution:S(i,a),aspectRatio:(i||1)/(a||1),poster:E.img_y||E.img_x||E.preview_images?.[0]||``}},[e.id,e.links,b,E.img_width,E.img_height,E.img_y,E.img_x,E.preview_images]),P=d((e,t)=>{u.current=e,y.current=t},[]),F=p(()=>N.videoUrl.endsWith(`m3u8`)?{startTimeSeconds:M,preload:`none`}:{startTimeSeconds:M},[M,N.videoUrl]);f(()=>{u.current=0,y.current=0},[T,b]);let I=a({contentId:T,browseEpisode:x,contentType:1,enabled:!s&&!!T,intervalMs:60*1e3,getCurrentTimeSeconds:()=>u.current,getDurationSeconds:()=>y.current});if(f(()=>{if(s)return;let e=()=>{if(!(typeof window>`u`)&&!(u.current<=0||y.current<=0))try{sessionStorage.setItem(k,JSON.stringify({episodeId:O,currentTime:u.current,duration:y.current}))}catch(e){console.error(`写入 sessionStorage 失败:`,e)}},t=()=>{e()},n=()=>{document.visibilityState===`hidden`&&e()},r=()=>{e()};return window.addEventListener(`beforeunload`,t),document.addEventListener(`visibilitychange`,n),window.addEventListener(`popstate`,r),()=>{window.removeEventListener(`beforeunload`,t),document.removeEventListener(`visibilitychange`,n),window.removeEventListener(`popstate`,r),e()}},[O,s,k]),!N.hasVideo)return g(`div`,{className:`mt-3 rounded-xl bg-bg1 px-3 py-10 text-center text-text3`,children:l(`videoHero.noVideos`)});let L=C(430,N.aspectRatio,242),R=L.height>0?t(L.height):`auto`,z=L.height>0?`calc(${R} + 0px)`:`auto`,B=t(242);return _(h,{children:[g(r,{suppressHydrationWarning:!0,className:`w-full`,style:{height:z,maxWidth:`100%`,maxHeight:`calc(${B} + 0px)`}}),_(r,{className:`w-full relative bg-bg2 !fixed !top-[44px] !left-0 z-[10]`,children:[N.poster&&_(`div`,{className:`w-full h-full bg-bg2 absolute top-0 left-0 z-[1] overflow-hidden`,style:{height:R},children:[g(n,{src:N.poster,alt:l(`videoHero.coverAlt`),fill:!0,className:`object-cover`,priority:!0}),g(`div`,{className:`w-full h-full absolute top-0 left-0 z-[1] bg-[rgba(255,255,255,0.2)] backdrop-blur-[4px]`})]}),g(r,{suppressHydrationWarning:!0,"data-aspect-ratio":N.resolution,className:`w-full overflow-hidden flex justify-center relative z-[2]`,style:{height:R,maxWidth:`100%`,maxHeight:B,backdropFilter:`blur(0)`,WebkitBackdropFilter:`blur(0)`},children:g(c,{plyerId:`detail-player-${E.id}-${b}`,parentId:D,resolution:N.resolution||`0x0`,videoUrl:N.videoUrl,poster:N.poster,mergeConfig:F,onProgressUpdate:s?void 0:P,onPlay:s?void 0:I.handlePlay,onPause:s?void 0:I.handlePause,onEnded:s?void 0:I.handleEnded},`stable-player-${E.id}-${b}`)})]})]})}function S(e,t){return!e||!t?``:`${e}x${t}`}function C(e,t,n){let r=e/t;return r<=n?{width:e,height:r}:{width:n*t,height:n}}function w(e){let t=e.links||[];return t.length>0?t.map((e,t)=>({text:e.name||String(t+1),url:e.m3u8_url||e.preview_m3u8_url||``,definition:``,isDefault:t===0})).filter(e=>e.url):[]}export{y as DetailHero};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import e from"../../../../../assets/icons/common/right_arrow_thin.mjs";import{DetailStyleOneActiveBorderLayer as t,SeriesEpisodes as n}from"../../../../common/series-episodes/index.mjs";import{useCardDecoration as r}from"../../../../../hooks/use-card-decoration.mjs";import{editorPreviewInformation as i}from"../shared/editor-preview.mjs";import{useVideoDetailMaterialRuntimeContext as a}from"../shared/runtime-context-provider.mjs";import{useEffect as o,useMemo as s,useRef as c,useState as l}from"react";import{Fragment as u,jsx as d,jsxs as f}from"react/jsx-runtime";import{useTranslations as p}from"next-intl";function m(e,t,n){let r=Number.parseInt(e.id||``,10);return Number.isNaN(r)?e.name?.trim()||n(t):n(r)}function h({text:e}){let t=p(`components.biz.business.detail.detailIntroduction`),[n,r]=l(!1),[i,a]=l(!1),s=c(null);return o(()=>{r(!1)},[e]),o(()=>{if(n){a(!0);return}let t=s.current;if(!e||!t){a(!1);return}let r=()=>{a(t.scrollHeight>t.clientHeight+1)};r();let i=new ResizeObserver(r);return i.observe(t),()=>{i.disconnect()}},[n,e]),e?f(`div`,{className:`relative w-full`,children:[d(`p`,{ref:s,className:`w-full font-['PingFang_SC'] text-[14px] font-normal not-italic leading-[24px] text-white/50 ${n?``:`line-clamp-3`}`,children:e}),i&&d(`button`,{type:`button`,className:`font-['PingFang_SC'] text-[14px] font-medium not-italic leading-normal text-[#9054E5] ${n?`mt-[8px] ml-auto block`:`absolute right-0 bottom-0 flex h-[24px] w-[40px] items-center justify-end bg-gradient-to-r from-transparent via-[#161616] to-[#161616]`}`,onClick:()=>r(e=>!e),children:t(n?`collapse`:`expand`)})]}):null}function g({information:r,currentSeriesNum:i,onEpisodeChange:a}){let o=p(`components.common.seriesEpisodes`);function s(e){return o(`episodeLabel`,{episode:e})}let[c,h]=l(!1),[g,_]=l(!1),v=r.links?.length??0,y=r.links?.[i-1]?.id||r.links?.[0]?.id||``;return v<=1?null:f(u,{children:[f(`div`,{className:`mt-[16px] flex w-full flex-col gap-[16px]`,children:[f(`button`,{type:`button`,className:`flex w-full items-center justify-between`,onClick:()=>h(!0),children:[d(`span`,{className:`font-['PingFang_SC'] text-[18px] font-medium not-italic leading-[24px] text-text1`,children:o(`selectorTitle`)}),d(`span`,{className:`flex items-center opacity-60`,children:d(`span`,{className:`flex h-[24px] w-[24px] items-center justify-center p-[2px]`,children:d(e,{className:`h-[20px] w-[20px] text-text1`})})})]}),d(`div`,{className:`flex gap-[8px] overflow-x-auto [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden`,children:(r.links||[]).map((e,n)=>{let o=n+1,c=o===i,l=m(e,o,s);return f(`button`,{type:`button`,className:g?`relative flex h-[40px] min-w-[88px] shrink-0 items-center justify-center overflow-hidden rounded-[8px] px-[16px] transition-colors ${c?``:`bg-white/10`}`:`relative flex h-[56px] w-[56px] shrink-0 items-center justify-center overflow-hidden rounded-[8px] transition-colors ${c?``:`bg-white/10`}`,onClick:()=>a(o),children:[c&&d(t,{}),d(`span`,{className:`relative z-10
|
|
2
|
+
"use client";import e from"../../../../../assets/icons/common/right_arrow_thin.mjs";import{DetailStyleOneActiveBorderLayer as t,SeriesEpisodes as n}from"../../../../common/series-episodes/index.mjs";import{useCardDecoration as r}from"../../../../../hooks/use-card-decoration.mjs";import{editorPreviewInformation as i}from"../shared/editor-preview.mjs";import{useVideoDetailMaterialRuntimeContext as a}from"../shared/runtime-context-provider.mjs";import{useEffect as o,useMemo as s,useRef as c,useState as l}from"react";import{Fragment as u,jsx as d,jsxs as f}from"react/jsx-runtime";import{useTranslations as p}from"next-intl";function m(e,t,n){let r=Number.parseInt(e.id||``,10);return Number.isNaN(r)?e.name?.trim()||n(t):n(r)}function h({text:e}){let t=p(`components.biz.business.detail.detailIntroduction`),[n,r]=l(!1),[i,a]=l(!1),s=c(null);return o(()=>{r(!1)},[e]),o(()=>{if(n){a(!0);return}let t=s.current;if(!e||!t){a(!1);return}let r=()=>{a(t.scrollHeight>t.clientHeight+1)};r();let i=new ResizeObserver(r);return i.observe(t),()=>{i.disconnect()}},[n,e]),e?f(`div`,{className:`relative w-full`,children:[d(`p`,{ref:s,className:`w-full font-['PingFang_SC'] text-[14px] font-normal not-italic leading-[24px] text-white/50 ${n?``:`line-clamp-3`}`,children:e}),i&&d(`button`,{type:`button`,className:`font-['PingFang_SC'] text-[14px] font-medium not-italic leading-normal text-[#9054E5] ${n?`mt-[8px] ml-auto block`:`absolute right-0 bottom-0 flex h-[24px] w-[40px] items-center justify-end bg-gradient-to-r from-transparent via-[#161616] to-[#161616]`}`,onClick:()=>r(e=>!e),children:t(n?`collapse`:`expand`)})]}):null}function g({information:r,currentSeriesNum:i,onEpisodeChange:a}){let o=p(`components.common.seriesEpisodes`);function s(e){return o(`episodeLabel`,{episode:e})}let[c,h]=l(!1),[g,_]=l(!1),v=r.links?.length??0,y=r.links?.[i-1]?.id||r.links?.[0]?.id||``;return v<=1?null:f(u,{children:[f(`div`,{className:`mt-[16px] flex w-full flex-col gap-[16px]`,children:[f(`button`,{type:`button`,className:`flex w-full items-center justify-between`,onClick:()=>h(!0),children:[d(`span`,{className:`font-['PingFang_SC'] text-[18px] font-medium not-italic leading-[24px] text-text1`,children:o(`selectorTitle`)}),d(`span`,{className:`flex items-center opacity-60`,children:d(`span`,{className:`flex h-[24px] w-[24px] items-center justify-center p-[2px]`,children:d(e,{className:`h-[20px] w-[20px] text-text1`})})})]}),d(`div`,{className:`flex gap-[8px] overflow-x-auto [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden`,children:(r.links||[]).map((e,n)=>{let o=n+1,c=o===i,l=m(e,o,s);return f(`button`,{type:`button`,className:g?`relative flex h-[40px] min-w-[88px] shrink-0 items-center justify-center overflow-hidden rounded-[8px] px-[16px] transition-colors ${c?``:`bg-white/10`}`:`relative flex h-[56px] w-[56px] shrink-0 items-center justify-center overflow-hidden rounded-[8px] transition-colors ${c?``:`bg-white/10`}`,onClick:()=>a(o),children:[c&&d(t,{}),d(`span`,{className:`relative z-10 leading-[16px] ${c?`text-[#CA3FE9]`:`text-text1`} ${g?`text-[14px] whitespace-nowrap`:`text-[16px]`}`,children:g?l:o})]},e.id||`${r.id}-episode-${o}`)})})]}),d(n,{mode:`selector`,open:c,variant:`popup`,title:o(`selectorTitle`),videoTitle:r.name,updateStatus:r.update_status,seriesList:(r.links||[]).map(e=>({id:e.id,name:e.name})),activeEpisodeId:y,showEpisodeTitle:g,onToggleTitle:e=>_(!!e),onClose:()=>h(!1),onSelectEpisode:(e,t)=>{h(!1),a(t)},popupStylePreset:`detail-style-one`})]})}function _({showTags:e=!0,showEpisodes:t=!0,mode:n=`renderer`}){let o=a(),c=o?.information,l=o?.currentSeriesNum??1,u=o?.onEpisodeChange,p=o?.isShow??!0,m=n===`editor`,{getTitleText:_}=r(),y=m,b=y?i:c,x=s(()=>b?_(b):``,[_,b]),S=s(()=>b?.description?.trim()||``,[b?.description]),C=s(()=>v(b?.score),[b?.score]);if(!b)return null;let w=Math.max(1,Number(l||1)),T=y?e=>{}:u??(()=>{}),E=e&&(b.tags?.length??0)>0,D=p&&!!S,O=(m||t)&&b.is_more_link===`y`&&(b.links?.length??0)>1;return!x&&!C&&!E&&!D&&!O?null:d(`div`,{className:y?`pointer-events-none`:void 0,children:f(`div`,{className:`w-full px-[12px] pt-[16px]`,children:[f(`div`,{className:`flex w-full flex-col gap-[12px]`,children:[(x||C)&&f(`div`,{className:`flex w-full items-center justify-between gap-[12px]`,children:[d(`p`,{className:`min-w-0 flex-1 truncate font-['PingFang_SC'] text-[18px] font-medium not-italic leading-normal text-text1`,children:x}),C&&d(`span`,{className:`shrink-0 font-['DIN'] text-[18px] font-bold not-italic leading-[20px] text-[#FFC039]`,children:C})]}),E&&d(`div`,{className:`flex items-center gap-[6px] overflow-x-auto overflow-y-hidden [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden`,children:(b.tags||[]).map((e,t)=>d(`div`,{className:`flex h-[24px] shrink-0 items-center justify-center rounded-[4px] bg-[rgba(217,217,217,0.2)] px-[4px] py-[2px]`,children:d(`span`,{className:`font-['PingFang_SC'] text-[12px] font-normal not-italic leading-[14px] text-text1`,children:e.name})},`${e.id||e.name}-${t}`))}),D&&d(h,{text:S})]}),O&&d(g,{information:b,currentSeriesNum:w,onEpisodeChange:T})]})})}function v(e){let t=Number(e||`0`);return!Number.isFinite(t)||t<=0?``:(t>10?t/10:t).toFixed(1)}export{_ as VideoDetailInfoClient};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{Box as e}from"../../../../ui/box.mjs";import t from"../../../../ui/loading.mjs";import{WaterfallRecommend as n}from"../../../../common/list/waterfall-recommend/waterfall-recommend.mjs";import{useVideoDetailRecommendData as r}from"./shared.mjs";import{useCallback as i,useMemo as a}from"react";import{jsx as o,jsxs as s}from"react/jsx-runtime";function c(e){let t=[],n=[],r=0,i=0;return e.forEach(e=>{let a=(e.cardKind===`short`?
|
|
2
|
+
"use client";import{Box as e}from"../../../../ui/box.mjs";import t from"../../../../ui/loading.mjs";import{WaterfallRecommend as n}from"../../../../common/list/waterfall-recommend/waterfall-recommend.mjs";import{useVideoDetailRecommendData as r}from"./shared.mjs";import{useCallback as i,useMemo as a}from"react";import{jsx as o,jsxs as s}from"react/jsx-runtime";function c(e){let t=[],n=[],r=0,i=0;return e.forEach(e=>{let a=(e.cardKind===`short`?142:216)+16;r<=i?(t.push(e),r+=a):(n.push(e),i+=a)}),{left:t,right:n}}function l(l){let{uiItems:u,shouldShowLoading:d,isPreview:f,resolvedModuleTitle:p,triggerIndex:m,triggerMarker:h}=r(l),g=a(()=>u.map((e,t)=>({key:e.info.id?`detail-recommend-${e.info.id}-${t}`:`detail-recommend-${t}`,sourceIndex:e.sourceIndex,href:e.detailPath||`#`,cardKind:e.cardKind,coverUrl:e.coverUrl,title:e.title,badgeImageUrl:e.badgeImageUrl,episodeText:e.showEpisode?e.videoInfoText:``,metaPrimaryText:e.showEpisode?e.videoInfoText:``,heatText:e.showPlayCount?e.playCountText:``,score:e.score})),[u]),_=a(()=>c(g),[g]),v=!!p,y=i(({item:e})=>{if(!(e.sourceIndex!==m||!h))return e=>{e&&e.setAttribute(`data-detail-recommend-trigger`,h)}},[m,h]);return g.length?s(e,{className:f?`mt-[16px] w-full pointer-events-none`:`mt-[16px] w-full`,children:[o(n,{title:p,columns:_,sectionClassName:`w-full`,headerClassName:v?`mb-[8px] flex items-center justify-between px-[12px]`:`hidden`,titleClassName:`flex-1 min-w-0 text-[18px] leading-[26px] font-bold line-clamp-1 text-text1`,containerClassName:`relative flex w-full gap-[15px] px-[12px]`,getItemRef:y}),d&&o(e,{className:`w-full flex justify-center py-[12px]`,children:o(t,{size:`medium`,showLabel:!1,className:`text-theme5`})})]}):null}export{l as VideoDetailRecommendClient};
|