@funhub/platform 0.1.160-beta.0 → 0.1.161

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.
Files changed (87) hide show
  1. package/dist/biz.d.mts +1 -22
  2. package/dist/biz.mjs +1 -1
  3. package/dist/components/biz/business/banner-carousel/client.d.mts +19 -0
  4. package/dist/components/biz/business/banner-carousel/client.mjs +1 -1
  5. package/dist/components/biz/business/banner-carousel/default-props.mjs +1 -1
  6. package/dist/components/biz/business/banner-carousel/material.d.mts +4 -1
  7. package/dist/components/biz/business/banner-carousel/material.mjs +1 -1
  8. package/dist/components/biz/business/banner-carousel/schema.d.mts +2 -0
  9. package/dist/components/biz/business/banner-carousel/schema.mjs +1 -1
  10. package/dist/components/biz/business/banner-carousel/server.d.mts +4 -2
  11. package/dist/components/biz/business/banner-carousel/server.mjs +1 -1
  12. package/dist/components/biz/business/channel-list/client.mjs +1 -1
  13. package/dist/components/biz/business/detail/shared/detail-follow-action.mjs +1 -1
  14. package/dist/components/biz/business/detail/shared/runtime-context-provider.mjs +1 -1
  15. package/dist/components/biz/business/detail/shared/use-video-detail-webview-bridge.mjs +1 -1
  16. package/dist/components/biz/business/detail/video-detail-actions/client.mjs +1 -1
  17. package/dist/components/biz/business/home-recommend/shared/home-recommend-base.mjs +1 -1
  18. package/dist/components/biz/business/index.d.mts +0 -22
  19. package/dist/components/biz/business/large-feature-grid/card-item.mjs +1 -1
  20. package/dist/components/biz/business/large-feature-grid/client.mjs +1 -1
  21. package/dist/components/common/series-episodes/index.mjs +1 -1
  22. package/dist/components/common/video-player/index.mjs +4 -4
  23. package/dist/components/common/video-player/process-m3u8-cache.mjs +1 -1
  24. package/dist/components/pages/home/client.mjs +1 -1
  25. package/dist/components/pages/login/verify.mjs +1 -1
  26. package/dist/components/pages/video-detail/video-detail-client.mjs +1 -1
  27. package/dist/components/pages/video-list/index.mjs +1 -1
  28. package/dist/components/pages/video-list/video-list-client.mjs +1 -1
  29. package/dist/components/ui/badge.d.mts +1 -1
  30. package/dist/components/ui/button.d.mts +2 -2
  31. package/dist/hooks.d.mts +1 -1
  32. package/dist/materials.d.mts +1 -6
  33. package/dist/materials.mjs +1 -1
  34. package/dist/service.d.mts +1 -2
  35. package/dist/service.mjs +1 -1
  36. package/dist/utils/schema/inspector.d.mts +2 -2
  37. package/dist/utils/schema/material.d.mts +0 -1
  38. package/package.json +1 -1
  39. package/dist/components/biz/business/advertisement/ad-match.d.mts +0 -98
  40. package/dist/components/biz/business/advertisement/ad-match.mjs +0 -2
  41. package/dist/components/biz/business/advertisement/ad-provider.d.mts +0 -33
  42. package/dist/components/biz/business/advertisement/ad-provider.mjs +0 -2
  43. package/dist/components/biz/business/advertisement/ad-query.d.mts +0 -27
  44. package/dist/components/biz/business/advertisement/ad-query.mjs +0 -2
  45. package/dist/components/biz/business/advertisement/ad-runtime-provider.d.mts +0 -25
  46. package/dist/components/biz/business/advertisement/ad-runtime-provider.mjs +0 -2
  47. package/dist/components/biz/business/advertisement/banner-ad/client.d.mts +0 -18
  48. package/dist/components/biz/business/advertisement/banner-ad/client.mjs +0 -2
  49. package/dist/components/biz/business/advertisement/banner-ad/index.d.mts +0 -5
  50. package/dist/components/biz/business/advertisement/banner-ad/material.d.mts +0 -30
  51. package/dist/components/biz/business/advertisement/banner-ad/material.mjs +0 -2
  52. package/dist/components/biz/business/advertisement/banner-ad/schema.d.mts +0 -75
  53. package/dist/components/biz/business/advertisement/banner-ad/schema.mjs +0 -2
  54. package/dist/components/biz/business/advertisement/banner-ad/server.d.mts +0 -11
  55. package/dist/components/biz/business/advertisement/banner-ad/server.mjs +0 -2
  56. package/dist/components/biz/business/advertisement/feed-ad/index.d.mts +0 -39
  57. package/dist/components/biz/business/advertisement/feed-ad/index.mjs +0 -2
  58. package/dist/components/biz/business/advertisement/floating-ad/client.d.mts +0 -21
  59. package/dist/components/biz/business/advertisement/floating-ad/client.mjs +0 -2
  60. package/dist/components/biz/business/advertisement/floating-ad/index.d.mts +0 -5
  61. package/dist/components/biz/business/advertisement/floating-ad/material.d.mts +0 -25
  62. package/dist/components/biz/business/advertisement/floating-ad/material.mjs +0 -2
  63. package/dist/components/biz/business/advertisement/floating-ad/schema.d.mts +0 -75
  64. package/dist/components/biz/business/advertisement/floating-ad/schema.mjs +0 -2
  65. package/dist/components/biz/business/advertisement/floating-ad/server.d.mts +0 -11
  66. package/dist/components/biz/business/advertisement/floating-ad/server.mjs +0 -2
  67. package/dist/components/biz/business/advertisement/icon-ad/client.d.mts +0 -16
  68. package/dist/components/biz/business/advertisement/icon-ad/client.mjs +0 -2
  69. package/dist/components/biz/business/advertisement/icon-ad/index.d.mts +0 -5
  70. package/dist/components/biz/business/advertisement/icon-ad/material.d.mts +0 -29
  71. package/dist/components/biz/business/advertisement/icon-ad/material.mjs +0 -2
  72. package/dist/components/biz/business/advertisement/icon-ad/schema.d.mts +0 -69
  73. package/dist/components/biz/business/advertisement/icon-ad/schema.mjs +0 -2
  74. package/dist/components/biz/business/advertisement/icon-ad/server.d.mts +0 -11
  75. package/dist/components/biz/business/advertisement/icon-ad/server.mjs +0 -2
  76. package/dist/components/biz/business/advertisement/index.d.mts +0 -26
  77. package/dist/components/biz/business/advertisement/text-ad/client.d.mts +0 -15
  78. package/dist/components/biz/business/advertisement/text-ad/client.mjs +0 -2
  79. package/dist/components/biz/business/advertisement/text-ad/index.d.mts +0 -5
  80. package/dist/components/biz/business/advertisement/text-ad/material.d.mts +0 -27
  81. package/dist/components/biz/business/advertisement/text-ad/material.mjs +0 -2
  82. package/dist/components/biz/business/advertisement/text-ad/schema.d.mts +0 -53
  83. package/dist/components/biz/business/advertisement/text-ad/schema.mjs +0 -2
  84. package/dist/components/biz/business/advertisement/text-ad/server.d.mts +0 -11
  85. package/dist/components/biz/business/advertisement/text-ad/server.mjs +0 -2
  86. package/dist/service/advertisement.d.mts +0 -172
  87. package/dist/service/advertisement.mjs +0 -2
@@ -6,10 +6,10 @@ type InspectorFieldOption<T> = Omit<T, 'type'>;
6
6
  declare const stringInspectorFieldSchema: z.ZodObject<{
7
7
  type: z.ZodLiteral<"string">;
8
8
  fieldType: z.ZodOptional<z.ZodEnum<{
9
+ select: "select";
9
10
  input: "input";
10
11
  textarea: "textarea";
11
12
  color: "color";
12
- select: "select";
13
13
  }>>;
14
14
  defaultValue: z.ZodOptional<z.ZodString>;
15
15
  label: z.ZodOptional<z.ZodString>;
@@ -68,10 +68,10 @@ type ObjectInspectorFieldOption = InspectorFieldOption<z.infer<typeof objectInsp
68
68
  declare const componentInspectorFieldMetaSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
69
69
  type: z.ZodLiteral<"string">;
70
70
  fieldType: z.ZodOptional<z.ZodEnum<{
71
+ select: "select";
71
72
  input: "input";
72
73
  textarea: "textarea";
73
74
  color: "color";
74
- select: "select";
75
75
  }>>;
76
76
  defaultValue: z.ZodOptional<z.ZodString>;
77
77
  label: z.ZodOptional<z.ZodString>;
@@ -8,7 +8,6 @@ import { z } from "zod";
8
8
  * 物料分类
9
9
  */
10
10
  declare const MATERIAL_CATEGORY: {
11
- readonly 广告组件: "广告组件";
12
11
  readonly 内容组件: "内容组件";
13
12
  readonly 金刚组件: "金刚组件";
14
13
  readonly 大图宫格: "大图宫格";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@funhub/platform",
3
3
  "type": "module",
4
- "version": "0.1.160-beta.0",
4
+ "version": "0.1.161",
5
5
  "private": false,
6
6
  "sideEffects": [
7
7
  "**/*.css"
@@ -1,98 +0,0 @@
1
-
2
- import { BannerAdProps } from "./banner-ad/schema.mjs";
3
- import { FloatingAdItem } from "./floating-ad/schema.mjs";
4
- import { IconAdItem } from "./icon-ad/schema.mjs";
5
- import { TextAdItem } from "./text-ad/schema.mjs";
6
- import { AdsMatchMaterial, AdsMatchRequest, AdsMatchResponseData } from "../../../../service/advertisement.mjs";
7
-
8
- //#region components/biz/business/advertisement/ad-match.d.ts
9
- /**
10
- * 广告扩展字段。
11
- */
12
- interface AdsMatchExtData {
13
- /**
14
- * 通用标题。
15
- */
16
- title?: string;
17
- /**
18
- * 通用按钮文案。
19
- */
20
- buttonText?: string;
21
- /**
22
- * 轮播切换时间。
23
- */
24
- switchInterval?: number;
25
- /**
26
- * 样式尺寸。
27
- */
28
- styleSize?: string;
29
- /**
30
- * 展示数量。
31
- */
32
- displayCount?: number;
33
- }
34
- /**
35
- * 构建广告匹配请求体。
36
- *
37
- * 按项目现有约定:
38
- * - 用户 ID 优先从显式入参获取,其次读取 cookie。
39
- * - 设备 ID 优先从显式入参获取,其次在客户端读取本地设备标识。
40
- */
41
- declare function buildAdsMatchRequest(input: Omit<AdsMatchRequest, 'userId' | 'deviceId'> & {
42
- userId?: string;
43
- deviceId?: string;
44
- }): Promise<AdsMatchRequest>;
45
- /**
46
- * 获取广告请求使用的 appCode。
47
- */
48
- declare function resolveAdsAppCode(appCode?: string): string;
49
- /**
50
- * 解析广告扩展数据。
51
- */
52
- declare function parseAdsMatchExtData(material?: AdsMatchMaterial | null): AdsMatchExtData;
53
- /**
54
- * 对素材按排序值升序排列。
55
- */
56
- declare function sortAdsMatchMaterials(materials?: AdsMatchMaterial[] | null): AdsMatchMaterial[];
57
- /**
58
- * 判断当前响应是否命中有效广告。
59
- */
60
- declare function hasMatchedAds(matchData?: AdsMatchResponseData | null): boolean;
61
- /**
62
- * 获取首个有效素材。
63
- */
64
- declare function getFirstMatchedMaterial(matchData?: AdsMatchResponseData | null): AdsMatchMaterial | undefined;
65
- /**
66
- * 适配悬浮广告数据。
67
- */
68
- declare function adaptFloatingAdItem(matchData?: AdsMatchResponseData | null): FloatingAdItem | undefined;
69
- /**
70
- * 适配图标广告数据。
71
- */
72
- declare function adaptIconAdProps(matchData?: AdsMatchResponseData | null): Pick<{
73
- displayCount: number;
74
- items: IconAdItem[];
75
- }, 'displayCount' | 'items'>;
76
- /**
77
- * 适配文字广告数据。
78
- */
79
- declare function adaptTextAdProps(matchData?: AdsMatchResponseData | null): Pick<{
80
- displayCount?: number;
81
- items: TextAdItem[];
82
- }, 'displayCount' | 'items'>;
83
- /**
84
- * 适配 Banner 广告数据。
85
- */
86
- declare function adaptBannerAdProps(matchData?: AdsMatchResponseData | null): Pick<BannerAdProps, 'displayCount' | 'switchInterval' | 'styleSize' | 'items'>;
87
- /**
88
- * 适配弹窗广告数据。
89
- */
90
- declare function adaptPopupAdMaterials(matchData?: AdsMatchResponseData | null): {
91
- id: string;
92
- title: string;
93
- jumpUrl: string;
94
- materialUrl: string;
95
- desc: string;
96
- }[];
97
- //#endregion
98
- export { AdsMatchExtData, adaptBannerAdProps, adaptFloatingAdItem, adaptIconAdProps, adaptPopupAdMaterials, adaptTextAdProps, buildAdsMatchRequest, getFirstMatchedMaterial, hasMatchedAds, parseAdsMatchExtData, resolveAdsAppCode, sortAdsMatchMaterials };
@@ -1,2 +0,0 @@
1
-
2
- import{getCookie as e}from"../../../../utils/common.mjs";import{getOrCreateDeviceId as t}from"../../../../utils/device-id.mjs";const n=process.env.NEXT_PUBLIC_APP_CODE||`APP001`;async function r(n){let r=n.userId??await e(`userId`),i=n.deviceId??t();return{...n,userId:r||void 0,deviceId:i||void 0}}function i(e){return e?.trim()||n}function a(e){let t=e?.adExtData;if(!t)return{};try{let e=JSON.parse(t);return typeof e==`object`&&e?e:{}}catch{return{}}}function o(e){return[...e??[]].sort((e,t)=>Number(e?.sort??0)-Number(t?.sort??0))}function s(e){return!!(e?.hit&&Array.isArray(e.materials)&&e.materials.length>0)}function c(e){return o(e?.materials).find(e=>!!(e?.advertiseIcon&&e?.advertiseUrl))}function l(e){let t=c(e);if(t)return{materialUrl:t.advertiseIcon||``,jumpUrl:t.advertiseUrl||``,name:t.advertiseName||``}}function u(e){let t=o(e?.materials).filter(e=>e.advertiseIcon&&e.advertiseUrl).map(e=>({title:a(e).title||e.advertiseName||``,icon:e.advertiseIcon||``,jumpUrl:e.advertiseUrl||``,badgeText:`广告`})).filter(e=>e.title&&e.icon&&e.jumpUrl);return{displayCount:m(e?.config,t.length),items:t}}function d(e){let t=o(e?.materials).map(e=>({text:a(e).title||e.advertiseName||e.advertiseDesc||``,jumpUrl:e.advertiseUrl||``})).filter(e=>e.text);return{displayCount:m(e?.config,t.length),items:t}}function f(e){let t=o(e?.materials).filter(e=>e.advertiseIcon&&e.advertiseUrl),n=t.map(e=>{let t=a(e);return{coverUrl:e.advertiseIcon||``,jumpUrl:e.advertiseUrl||``,title:t.title||e.advertiseName||``}}).filter(e=>e.coverUrl&&e.jumpUrl);return{displayCount:m(e?.config,n.length),switchInterval:h(e?.config,t),styleSize:g(e?.config,t),items:n}}function p(e){return o(e?.materials).map(e=>{let t=a(e);return{id:e.advertiseCode||``,title:t.title||e.advertiseName||``,jumpUrl:e.advertiseUrl||``,materialUrl:e.advertiseIcon||``,desc:e.advertiseDesc||``}}).filter(e=>e.id&&e.materialUrl&&e.jumpUrl)}function m(e,t=0){let n=Number(e?.displayCount??t);return!Number.isFinite(n)||n<=0?t:Math.min(Math.floor(n),t)}function h(e,t){let n=a(t?.[0]),r=Number(e?.switchInterval??n.switchInterval??3e3);return!Number.isFinite(r)||r<=0?3e3:r}function g(e,t){let n=a(t?.[0]),r=String(e?.styleSize??n.styleSize??`large`);return r===`small`||r===`medium`||r===`large`?r:`large`}export{f as adaptBannerAdProps,l as adaptFloatingAdItem,u as adaptIconAdProps,p as adaptPopupAdMaterials,d as adaptTextAdProps,r as buildAdsMatchRequest,c as getFirstMatchedMaterial,s as hasMatchedAds,a as parseAdsMatchExtData,i as resolveAdsAppCode,o as sortAdsMatchMaterials};
@@ -1,33 +0,0 @@
1
-
2
- import { MaterialComponentMode } from "../../../../utils/schema/schema.mjs";
3
- import { AdsMatchAdType, AdsMatchResponseData } from "../../../../service/advertisement.mjs";
4
- import { PropsWithChildren } from "react";
5
- import * as react_jsx_runtime0 from "react/jsx-runtime";
6
-
7
- //#region components/biz/business/advertisement/ad-provider.d.ts
8
- interface AdProviderProps extends PropsWithChildren {
9
- adType: AdsMatchAdType;
10
- appCode?: string;
11
- mode?: MaterialComponentMode;
12
- }
13
- interface AdProviderValue {
14
- adType: AdsMatchAdType;
15
- appCode?: string;
16
- mode?: MaterialComponentMode;
17
- matchData?: AdsMatchResponseData;
18
- }
19
- /**
20
- * 广告运行时 Provider。
21
- */
22
- declare function AdProvider({
23
- adType,
24
- appCode,
25
- mode,
26
- children
27
- }: AdProviderProps): react_jsx_runtime0.JSX.Element;
28
- /**
29
- * 获取广告运行时上下文。
30
- */
31
- declare function useAdProvider(): AdProviderValue | undefined;
32
- //#endregion
33
- export { AdProvider, AdProviderProps, AdProviderValue, useAdProvider };
@@ -1,2 +0,0 @@
1
-
2
- "use client";import{useRequest as e}from"../../../../hooks/query/use-query.mjs";import{createAdsMatchQueryFn as t,getAdsMatchQueryKey as n}from"./ad-query.mjs";import{createContext as r,use as i,useMemo as a}from"react";import{jsx as o}from"react/jsx-runtime";const s=r(void 0);function c({adType:r,appCode:i,mode:c=`renderer`,children:l}){let{data:u}=e(n({adType:r,appCode:i}),t({adType:r,appCode:i}),{enabled:c===`renderer`});return o(s,{value:a(()=>({adType:r,appCode:i,mode:c,matchData:u?.data}),[r,u?.data,i,c]),children:l})}function l(){return i(s)}export{c as AdProvider,l as useAdProvider};
@@ -1,27 +0,0 @@
1
-
2
- import { ResponseData } from "../../../../utils/http.mjs";
3
- import "../../../../utils.mjs";
4
- import { AdsMatchAdType, AdsMatchResponseData, AdsMatchSceneContext } from "../../../../service/advertisement.mjs";
5
- import { PrefetchQueryItem } from "../../../../hooks/query/hydration-boundary.mjs";
6
-
7
- //#region components/biz/business/advertisement/ad-query.d.ts
8
- interface AdsMatchQueryOptions {
9
- adType: AdsMatchAdType;
10
- appCode?: string;
11
- }
12
- /**
13
- * 获取广告查询 key。
14
- */
15
- declare function getAdsMatchQueryKey(options: AdsMatchQueryOptions): (string | AdsMatchSceneContext)[];
16
- /**
17
- * 获取广告查询函数。
18
- */
19
- declare function createAdsMatchQueryFn(options: AdsMatchQueryOptions): () => Promise<ResponseData<AdsMatchResponseData>>;
20
- /**
21
- * 获取广告预取配置。
22
- */
23
- declare function createAdsMatchPrefetchItem(options: AdsMatchQueryOptions): PrefetchQueryItem<{
24
- data?: AdsMatchResponseData;
25
- }>;
26
- //#endregion
27
- export { AdsMatchQueryOptions, createAdsMatchPrefetchItem, createAdsMatchQueryFn, getAdsMatchQueryKey };
@@ -1,2 +0,0 @@
1
-
2
- import{pContentAdsMatch as e,pContentAdsMatchKey as t}from"../../../../service/advertisement.mjs";import{buildAdsMatchRequest as n,resolveAdsAppCode as r}from"./ad-match.mjs";function i(e){let n=r(e.appCode);return t({adType:e.adType,appCode:n})}function a(t){let i=r(t.appCode);return async()=>e(await n({adType:t.adType,appCode:i}),{revalidate:!1})}function o(e){return{type:`query`,queryKey:i(e),queryFn:a(e)}}export{o as createAdsMatchPrefetchItem,a as createAdsMatchQueryFn,i as getAdsMatchQueryKey};
@@ -1,25 +0,0 @@
1
-
2
- import { MaterialComponentMode } from "../../../../utils/schema/schema.mjs";
3
- import { AdsMatchAdType } from "../../../../service/advertisement.mjs";
4
- import { PropsWithChildren } from "react";
5
- import * as react_jsx_runtime0 from "react/jsx-runtime";
6
-
7
- //#region components/biz/business/advertisement/ad-runtime-provider.d.ts
8
- interface AdRuntimeProviderProps extends PropsWithChildren {
9
- adType: AdsMatchAdType;
10
- appCode?: string;
11
- mode?: MaterialComponentMode;
12
- }
13
- /**
14
- * 广告运行时 Provider。
15
- *
16
- * 在服务端统一完成预取与 Hydration,再由客户端 Provider 负责消费。
17
- */
18
- declare function AdRuntimeProvider({
19
- adType,
20
- appCode,
21
- mode,
22
- children
23
- }: AdRuntimeProviderProps): Promise<react_jsx_runtime0.JSX.Element>;
24
- //#endregion
25
- export { AdRuntimeProvider, AdRuntimeProviderProps };
@@ -1,2 +0,0 @@
1
-
2
- import{HydrationBoundary as e}from"../../../../hooks/query/hydration-boundary.mjs";import{createAdsMatchPrefetchItem as t}from"./ad-query.mjs";import{AdProvider as n}from"./ad-provider.mjs";import{jsx as r}from"react/jsx-runtime";async function i({adType:i,appCode:a,mode:o=`renderer`,children:s}){return r(e,{prefetch:o===`renderer`?[t({adType:i,appCode:a})]:[],children:r(n,{adType:i,appCode:a,mode:o,children:s})})}export{i as AdRuntimeProvider};
@@ -1,18 +0,0 @@
1
-
2
- import { BannerAdProps } from "./schema.mjs";
3
- import * as react_jsx_runtime0 from "react/jsx-runtime";
4
-
5
- //#region components/biz/business/advertisement/banner-ad/client.d.ts
6
- /**
7
- * Banner 广告组件。
8
- */
9
- declare function BannerAd({
10
- mode: _mode,
11
- displayCount,
12
- switchInterval,
13
- styleSize,
14
- items,
15
- pointerEventsDisabled
16
- }: BannerAdProps): react_jsx_runtime0.JSX.Element | null;
17
- //#endregion
18
- export { BannerAd };
@@ -1,2 +0,0 @@
1
-
2
- "use client";import{Image as e}from"../../../../ui/image.mjs";import{Box as t}from"../../../../ui/box.mjs";import{Carousel as n,CarouselContent as r,CarouselItem as i}from"../../../../ui/carousel.mjs";import{Text as a}from"../../../../ui/text.mjs";import o from"../../../../ui/link.mjs";import{adaptBannerAdProps as s,hasMatchedAds as c}from"../ad-match.mjs";import{useAdProvider as l}from"../ad-provider.mjs";import u from"clsx";import{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";const _={small:`h-[140px]`,medium:`h-[180px]`,large:`h-[242px]`};function v({mode:v=`renderer`,displayCount:y,switchInterval:b=3e3,styleSize:x=`large`,items:S,pointerEventsDisabled:C=!1}){let w=l(),T=f(()=>c(w?.matchData)?s(w?.matchData):{displayCount:y,switchInterval:b,styleSize:x,items:S},[w?.matchData,y,S,x,b]),[E,D]=m(),[O,k]=m(0),A=p(null),j=f(()=>typeof T.displayCount==`number`?T.items.slice(0,Math.max(T.displayCount,0)):T.items,[T]);return d(()=>{if(!E||j.length<=1)return;let e=()=>{k(E.selectedScrollSnap())};return E.on(`select`,e),e(),()=>{E.off(`select`,e)}},[E,j.length]),d(()=>{if(!(!E||j.length<=1))return A.current=setInterval(()=>{if(E.canScrollNext()){E.scrollNext();return}E.scrollTo(0)},T.switchInterval??3e3),()=>{A.current&&=(clearInterval(A.current),null)}},[E,T.switchInterval,j.length]),j.length===0?null:g(t,{as:`section`,className:`w-full px-[12px] py-[12px]`,"aria-label":`Banner 广告`,style:{pointerEvents:C?`none`:void 0},children:[h(n,{setApi:D,opts:{align:`start`,loop:j.length>1},className:`w-full`,children:h(r,{className:`ml-0`,children:j.map((n,r)=>h(i,{className:`pl-0`,children:g(o,{href:n.jumpUrl,className:u(`relative block w-full overflow-hidden rounded-[16px]`,_[T.styleSize??`large`]),children:[h(e,{src:n.coverUrl,alt:n.title||`Banner 广告`,fill:!0,className:`object-cover`,unoptimized:!0}),g(t,{className:`absolute left-[12px] bottom-[12px] flex items-center gap-[6px]`,children:[h(a,{className:`rounded-[10px] bg-black/60 px-[6px] py-[2px] text-[10px] leading-[14px] text-white`,children:`广告`}),n.title?h(a,{className:`max-w-[220px] truncate text-[14px] font-medium leading-[20px] text-white`,children:n.title}):null]})]})},`${n.jumpUrl}-${r}`))})}),j.length>1?h(t,{className:`mt-[8px] flex items-center justify-center gap-[4px]`,children:j.map((e,n)=>h(t,{className:u(`h-[6px] rounded-full transition-all duration-300`,n===O?`w-[12px] bg-black`:`w-[6px] bg-black/20`)},n))}):null]})}export{v as BannerAd};
@@ -1,5 +0,0 @@
1
-
2
- import { BannerAdInspectorProps, BannerAdItem, BannerAdProps, BannerAdStyleSize, bannerAdInspectorDefaultProps, bannerAdInspectorPropsSchema, bannerAdStyleSizeOptions } from "./schema.mjs";
3
- import { BannerAd } from "./client.mjs";
4
- import { BannerAdServer } from "./server.mjs";
5
- import { bannerAdMaterial } from "./material.mjs";
@@ -1,30 +0,0 @@
1
-
2
- import { SchemaHasDefaultValue } from "../../../../../utils/schema/schema.mjs";
3
- import { DefineMaterialOption } from "../../../../../utils/schema/material.mjs";
4
- import "../../../../../utils.mjs";
5
- import { BannerAd } from "./client.mjs";
6
- import { BannerAdServer } from "./server.mjs";
7
- import * as zod from "zod";
8
- import * as zod_v4_core0 from "zod/v4/core";
9
-
10
- //#region components/biz/business/advertisement/banner-ad/material.d.ts
11
- /**
12
- * Banner 广告物料定义。
13
- */
14
- declare const bannerAdMaterial: DefineMaterialOption<typeof BannerAdServer, typeof BannerAd, zod.ZodObject<{
15
- readonly displayCount: zod.ZodNumber & SchemaHasDefaultValue;
16
- readonly switchInterval: zod.ZodNumber & SchemaHasDefaultValue;
17
- readonly styleSize: zod.ZodType<"medium" | "small" | "large", unknown, zod_v4_core0.$ZodTypeInternals<"medium" | "small" | "large", unknown>> & SchemaHasDefaultValue;
18
- readonly items: zod.ZodArray<zod.ZodObject<{
19
- coverUrl: zod.ZodString & SchemaHasDefaultValue;
20
- jumpUrl: zod.ZodString & SchemaHasDefaultValue;
21
- title: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
22
- }, zod_v4_core0.$strip>> & SchemaHasDefaultValue;
23
- } & {
24
- mode: zod.ZodOptional<zod.ZodEnum<{
25
- renderer: "renderer";
26
- editor: "editor";
27
- }>>;
28
- }, zod_v4_core0.$strip>, "banner-ad", "广告组件">;
29
- //#endregion
30
- export { bannerAdMaterial };
@@ -1,2 +0,0 @@
1
-
2
- import{defineMaterial as e}from"../../../../../utils/schema/material.mjs";import{BannerAd as t}from"./client.mjs";import{bannerAdInspectorPropsSchema as n}from"./schema.mjs";import{BannerAdServer as r}from"./server.mjs";const i=e({type:`banner-ad`,name:`Banner广告`,icon:`/static/components-thumb/carousel_banner.png`,category:`广告组件`,serverComponent:r,clientComponent:t,propsSchema:n});export{i as bannerAdMaterial};
@@ -1,75 +0,0 @@
1
-
2
- import { InferSchemaProps, MaterialComponentMode, SchemaHasDefaultValue } from "../../../../../utils/schema/schema.mjs";
3
- import "../../../../../utils.mjs";
4
- import z$1 from "zod";
5
-
6
- //#region components/biz/business/advertisement/banner-ad/schema.d.ts
7
- /**
8
- * Banner 尺寸选项。
9
- */
10
- declare const bannerAdStyleSizeOptions: readonly ["small", "medium", "large"];
11
- /**
12
- * Banner 广告样式尺寸。
13
- */
14
- type BannerAdStyleSize = typeof bannerAdStyleSizeOptions[number];
15
- /**
16
- * Banner 广告单条数据。
17
- */
18
- interface BannerAdItem {
19
- /**
20
- * 封面图地址。
21
- */
22
- coverUrl: string;
23
- /**
24
- * 跳转链接。
25
- */
26
- jumpUrl: string;
27
- /**
28
- * 标题。
29
- */
30
- title?: string;
31
- }
32
- /**
33
- * Banner 广告物料属性。
34
- */
35
- declare const bannerAdInspectorPropsSchema: z$1.ZodObject<{
36
- readonly displayCount: z$1.ZodNumber & SchemaHasDefaultValue;
37
- readonly switchInterval: z$1.ZodNumber & SchemaHasDefaultValue;
38
- readonly styleSize: z$1.ZodType<"medium" | "small" | "large", unknown, z$1.core.$ZodTypeInternals<"medium" | "small" | "large", unknown>> & SchemaHasDefaultValue;
39
- readonly items: z$1.ZodArray<z$1.ZodObject<{
40
- coverUrl: z$1.ZodString & SchemaHasDefaultValue;
41
- jumpUrl: z$1.ZodString & SchemaHasDefaultValue;
42
- title: z$1.ZodOptional<z$1.ZodString> & SchemaHasDefaultValue;
43
- }, z$1.core.$strip>> & SchemaHasDefaultValue;
44
- } & {
45
- mode: z$1.ZodOptional<z$1.ZodEnum<{
46
- renderer: "renderer";
47
- editor: "editor";
48
- }>>;
49
- }, z$1.core.$strip>;
50
- declare const bannerAdInspectorDefaultProps: {
51
- readonly displayCount: number;
52
- readonly switchInterval: number;
53
- readonly styleSize: "medium" | "small" | "large";
54
- readonly items: {
55
- coverUrl: string;
56
- jumpUrl: string;
57
- title?: string | undefined;
58
- }[];
59
- };
60
- type BannerAdInspectorProps<T extends object = object> = InferSchemaProps<typeof bannerAdInspectorPropsSchema> & T;
61
- /**
62
- * Banner 广告组件 props。
63
- */
64
- type BannerAdProps = BannerAdInspectorProps<{
65
- /**
66
- * 渲染模式。
67
- */
68
- mode?: MaterialComponentMode;
69
- /**
70
- * 编辑态下禁用交互。
71
- */
72
- pointerEventsDisabled?: boolean;
73
- }>;
74
- //#endregion
75
- export { BannerAdInspectorProps, BannerAdItem, BannerAdProps, BannerAdStyleSize, bannerAdInspectorDefaultProps, bannerAdInspectorPropsSchema, bannerAdStyleSizeOptions };
@@ -1,2 +0,0 @@
1
-
2
- import{defineComponentPropsSchema as e,getSchemaDefaultProps as t}from"../../../../../utils/schema/schema.mjs";import n from"zod";const r=[`small`,`medium`,`large`],i=e(e=>({displayCount:e.number(1,{label:`轮播数量`,required:!0}).refine(e=>e>=1&&e<=5,`轮播数量必须为 1-5`),switchInterval:e.number(3e3,{label:`轮播切换时间`,required:!0}),styleSize:e.enum(r,`large`,{label:`样式尺寸选择`,required:!0}),items:e.array(n.object({coverUrl:e.string(``,{label:`封面图`,required:!0}),jumpUrl:e.string(``,{label:`跳转链接`,required:!0}),title:e.string(`Banner 广告`,{label:`标题`,required:!1})}),{label:`Banner 列表`,required:!0,defaultValue:[{coverUrl:`/static/components-resource/banner.png`,jumpUrl:`/search`,title:`Banner 广告一`},{coverUrl:`/static/components-resource/banner.png`,jumpUrl:`/search`,title:`Banner 广告二`}]})})),a=t(i);export{a as bannerAdInspectorDefaultProps,i as bannerAdInspectorPropsSchema,r as bannerAdStyleSizeOptions};
@@ -1,11 +0,0 @@
1
-
2
- import { BannerAdProps } from "./schema.mjs";
3
- import * as react_jsx_runtime0 from "react/jsx-runtime";
4
-
5
- //#region components/biz/business/advertisement/banner-ad/server.d.ts
6
- /**
7
- * Banner 广告服务端组件。
8
- */
9
- declare function BannerAdServer(props: BannerAdProps): Promise<react_jsx_runtime0.JSX.Element>;
10
- //#endregion
11
- export { BannerAdServer };
@@ -1,2 +0,0 @@
1
-
2
- import{resolveAdsAppCode as e}from"../ad-match.mjs";import{AdRuntimeProvider as t}from"../ad-runtime-provider.mjs";import{BannerAd as n}from"./client.mjs";import{jsx as r}from"react/jsx-runtime";async function i(i){let{mode:a=`renderer`,...o}=i;return r(t,{adType:`banner`,appCode:e(),mode:a,children:r(n,{...o,mode:a})})}export{i as BannerAdServer};
@@ -1,39 +0,0 @@
1
-
2
- import * as react_jsx_runtime0 from "react/jsx-runtime";
3
-
4
- //#region components/biz/business/advertisement/feed-ad/index.d.ts
5
- /**
6
- * 信息流广告项最小识别结构。
7
- */
8
- interface FeedAdItemLike {
9
- /**
10
- * 是否广告。
11
- */
12
- is_ad?: boolean;
13
- /**
14
- * 广告跳转链接。
15
- */
16
- ad_advertise_url?: string;
17
- /**
18
- * 广告素材地址。
19
- */
20
- ad_advertise_icon?: string;
21
- }
22
- /**
23
- * 判断当前信息流项是否为广告。
24
- */
25
- declare function isFeedAdItem(item: FeedAdItemLike | null | undefined): boolean;
26
- /**
27
- * 读取信息流广告跳转地址。
28
- */
29
- declare function getFeedAdJumpUrl(item: FeedAdItemLike | null | undefined): string;
30
- /**
31
- * 读取信息流广告素材地址。
32
- */
33
- declare function getFeedAdIcon(item: FeedAdItemLike | null | undefined): string;
34
- /**
35
- * 信息流广告标识。
36
- */
37
- declare function FeedAdBadge(): react_jsx_runtime0.JSX.Element;
38
- //#endregion
39
- export { FeedAdBadge, FeedAdItemLike, getFeedAdIcon, getFeedAdJumpUrl, isFeedAdItem };
@@ -1,2 +0,0 @@
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?.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,21 +0,0 @@
1
-
2
- import { FloatingAdProps } from "./schema.mjs";
3
- import * as react_jsx_runtime0 from "react/jsx-runtime";
4
-
5
- //#region components/biz/business/advertisement/floating-ad/client.d.ts
6
- /**
7
- * 悬浮广告组件。
8
- */
9
- declare function FloatingAd({
10
- mode: _mode,
11
- ad,
12
- materialUrl,
13
- jumpUrl,
14
- name,
15
- bottomOffset,
16
- rightOffset,
17
- pointerEventsDisabled,
18
- onClick
19
- }: FloatingAdProps): react_jsx_runtime0.JSX.Element | null;
20
- //#endregion
21
- export { FloatingAd };
@@ -1,2 +0,0 @@
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{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 shadow-lg`,"aria-label":_.name||`悬浮广告`,children:o(e,{src:_.materialUrl,alt:_.name||`悬浮广告`,fill:!0,className:`object-cover`})}),y={bottom:`${f}px`,right:`${p}px`,pointerEvents:m?`none`:void 0};return h?o(t,{className:`fixed z-50 block h-[50px] w-[50px] overflow-hidden rounded-[16px] cursor-pointer`,style:y,onClick:h,children:v}):o(n,{href:_.jumpUrl,className:`fixed z-50 block h-[50px] w-[50px] overflow-hidden rounded-[16px]`,style:y,children:v})}export{s as FloatingAd};
@@ -1,5 +0,0 @@
1
-
2
- import { FloatingAdEditableProps, FloatingAdInspectorProps, FloatingAdItem, FloatingAdProps, floatingAdInspectorDefaultProps, floatingAdInspectorPropsSchema } from "./schema.mjs";
3
- import { FloatingAd } from "./client.mjs";
4
- import { FloatingAdServer } from "./server.mjs";
5
- import { floatingAdMaterial } from "./material.mjs";
@@ -1,25 +0,0 @@
1
-
2
- import { SchemaHasDefaultValue } from "../../../../../utils/schema/schema.mjs";
3
- import { DefineMaterialOption } from "../../../../../utils/schema/material.mjs";
4
- import "../../../../../utils.mjs";
5
- import { FloatingAd } from "./client.mjs";
6
- import { FloatingAdServer } from "./server.mjs";
7
- import * as zod from "zod";
8
- import * as zod_v4_core0 from "zod/v4/core";
9
-
10
- //#region components/biz/business/advertisement/floating-ad/material.d.ts
11
- /**
12
- * 悬浮广告物料定义。
13
- */
14
- declare const floatingAdMaterial: DefineMaterialOption<typeof FloatingAdServer, typeof FloatingAd, zod.ZodObject<{
15
- readonly materialUrl: zod.ZodString & SchemaHasDefaultValue;
16
- readonly jumpUrl: zod.ZodString & SchemaHasDefaultValue;
17
- readonly name: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
18
- } & {
19
- mode: zod.ZodOptional<zod.ZodEnum<{
20
- renderer: "renderer";
21
- editor: "editor";
22
- }>>;
23
- }, zod_v4_core0.$strip>, "floating-ad", "广告组件">;
24
- //#endregion
25
- export { floatingAdMaterial };
@@ -1,2 +0,0 @@
1
-
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,75 +0,0 @@
1
-
2
- import { InferSchemaProps, MaterialComponentMode, SchemaHasDefaultValue } from "../../../../../utils/schema/schema.mjs";
3
- import "../../../../../utils.mjs";
4
- import * as zod from "zod";
5
- import * as zod_v4_core0 from "zod/v4/core";
6
-
7
- //#region components/biz/business/advertisement/floating-ad/schema.d.ts
8
- /**
9
- * 悬浮广告单条数据。
10
- */
11
- interface FloatingAdItem {
12
- /**
13
- * 广告素材地址。
14
- */
15
- materialUrl: string;
16
- /**
17
- * 广告跳转链接。
18
- */
19
- jumpUrl: string;
20
- /**
21
- * 广告名称。
22
- */
23
- name?: string;
24
- }
25
- /**
26
- * 悬浮广告物料属性。
27
- */
28
- declare const floatingAdInspectorPropsSchema: zod.ZodObject<{
29
- readonly materialUrl: zod.ZodString & SchemaHasDefaultValue;
30
- readonly jumpUrl: zod.ZodString & SchemaHasDefaultValue;
31
- readonly name: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
32
- } & {
33
- mode: zod.ZodOptional<zod.ZodEnum<{
34
- renderer: "renderer";
35
- editor: "editor";
36
- }>>;
37
- }, zod_v4_core0.$strip>;
38
- declare const floatingAdInspectorDefaultProps: {
39
- readonly materialUrl: string;
40
- readonly jumpUrl: string;
41
- readonly name: string;
42
- };
43
- type FloatingAdInspectorProps<T extends object = object> = InferSchemaProps<typeof floatingAdInspectorPropsSchema> & T;
44
- type FloatingAdEditableProps = InferSchemaProps<typeof floatingAdInspectorPropsSchema>;
45
- /**
46
- * 悬浮广告组件 props。
47
- */
48
- type FloatingAdProps = Partial<FloatingAdEditableProps> & {
49
- /**
50
- * 渲染模式。
51
- */
52
- mode?: MaterialComponentMode;
53
- /**
54
- * 广告数据。
55
- */
56
- ad?: FloatingAdItem;
57
- /**
58
- * 距离底部的偏移量。
59
- */
60
- bottomOffset?: number;
61
- /**
62
- * 距离右侧的偏移量。
63
- */
64
- rightOffset?: number;
65
- /**
66
- * 编辑态下禁用交互。
67
- */
68
- pointerEventsDisabled?: boolean;
69
- /**
70
- * 自定义点击事件。
71
- */
72
- onClick?: () => void;
73
- };
74
- //#endregion
75
- export { FloatingAdEditableProps, FloatingAdInspectorProps, FloatingAdItem, FloatingAdProps, floatingAdInspectorDefaultProps, floatingAdInspectorPropsSchema };
@@ -1,2 +0,0 @@
1
-
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,11 +0,0 @@
1
-
2
- import { FloatingAdProps } from "./schema.mjs";
3
- import * as react_jsx_runtime0 from "react/jsx-runtime";
4
-
5
- //#region components/biz/business/advertisement/floating-ad/server.d.ts
6
- /**
7
- * 悬浮广告服务端组件。
8
- */
9
- declare function FloatingAdServer(props: FloatingAdProps): Promise<react_jsx_runtime0.JSX.Element>;
10
- //#endregion
11
- export { FloatingAdServer };
@@ -1,2 +0,0 @@
1
-
2
- import{resolveAdsAppCode as e}from"../ad-match.mjs";import{AdRuntimeProvider as t}from"../ad-runtime-provider.mjs";import{FloatingAd as n}from"./client.mjs";import{jsx as r}from"react/jsx-runtime";async function i(i){let{mode:a=`renderer`,...o}=i;return r(t,{adType:`floating`,appCode:e(),mode:a,children:r(n,{...o,mode:a})})}export{i as FloatingAdServer};
@@ -1,16 +0,0 @@
1
-
2
- import { IconAdProps } from "./schema.mjs";
3
- import * as react_jsx_runtime0 from "react/jsx-runtime";
4
-
5
- //#region components/biz/business/advertisement/icon-ad/client.d.ts
6
- /**
7
- * 图标广告组件。
8
- */
9
- declare function IconAd({
10
- mode: _mode,
11
- displayCount,
12
- items,
13
- pointerEventsDisabled
14
- }: IconAdProps): react_jsx_runtime0.JSX.Element | null;
15
- //#endregion
16
- export { IconAd };