@funhub/platform 0.2.20 → 0.2.21

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.
@@ -30,6 +30,10 @@ interface AdsMatchExtData {
30
30
  * 展示数量。
31
31
  */
32
32
  displayCount?: number;
33
+ /**
34
+ * 视频分辨率。
35
+ */
36
+ resolution?: string;
33
37
  }
34
38
  /**
35
39
  * 构建广告匹配请求体。
@@ -77,6 +81,9 @@ declare function adaptPopupAdMaterials(matchData?: AdsMatchResponseData | null):
77
81
  title: string;
78
82
  jumpUrl: string;
79
83
  materialUrl: string;
84
+ advertiseType: number;
85
+ videoUrl: string;
86
+ resolution: string;
80
87
  desc: string;
81
88
  }[];
82
89
  //#endregion
@@ -1,2 +1,2 @@
1
1
 
2
- function e(e){return{...e}}function t(e){let t=e?.adExtData;if(!t)return{};try{let e=JSON.parse(t);return typeof e==`object`&&e?e:{}}catch{return{}}}function n(e){return[...e??[]].sort((e,t)=>Number(e?.sort??0)-Number(t?.sort??0))}function r(e){return!!(e?.hit&&Array.isArray(e.materials)&&e.materials.length>0)}function i(e){return n(e?.materials).filter(e=>e.advertiseIcon&&e.advertiseUrl).map(e=>({id:e.advertiseCode||``,materialUrl:e.advertiseIcon||``,jumpUrl:e.advertiseUrl||``,name:e.advertiseName||``}))}function a(e){let r=n(e?.materials).filter(e=>e.advertiseIcon&&e.advertiseUrl).map(e=>{let n=t(e);return{id:e.advertiseCode||``,title:n.title||e.advertiseName||``,icon:e.advertiseIcon||``,jumpUrl:e.advertiseUrl||``,badgeText:`广告`}}).filter(e=>e.title&&e.icon&&e.jumpUrl);return{displayCount:l(e?.config,r.length),items:r}}function o(e){let t=n(e?.materials).map(e=>({id:e.advertiseCode||``,text:e.advertiseName||e.advertiseDesc||``,jumpUrl:e.advertiseUrl||``})).filter(e=>e.text);return{displayCount:l(e?.config,t.length),items:t}}function s(e){let r=n(e?.materials).filter(e=>e.advertiseIcon&&e.advertiseUrl),i=r.map(e=>{let n=t(e);return{id:e.advertiseCode||``,coverUrl:e.advertiseIcon||``,jumpUrl:e.advertiseUrl||``,title:n.title||e.advertiseName||``}}).filter(e=>e.coverUrl&&e.jumpUrl);return{displayCount:l(e?.config,i.length),switchInterval:u(e?.config,r),styleSize:d(e?.config,r),items:i}}function c(e){return n(e?.materials).map(e=>{let n=t(e);return{id:e.advertiseCode||``,title:n.title||e.advertiseName||``,jumpUrl:e.advertiseUrl||``,materialUrl:e.advertiseIcon||``,desc:e.advertiseDesc||``}}).filter(e=>e.id&&e.materialUrl&&e.jumpUrl)}function l(e,t=0){let n=Number(e?.displayCount??t);return!Number.isFinite(n)||n<=0?t:Math.min(Math.floor(n),t)}function u(e,n){let r=t(n?.[0]),i=Number(e?.switchInterval??r.switchInterval??3e3);return!Number.isFinite(i)||i<=0?3e3:i}function d(e,n){let r=t(n?.[0]),i=String(e?.styleSize??r.styleSize??`large`);return i===`700x400`||i===`700x200`||i===`720x150`||i===`720x300`?i:i===`small`?`720x150`:i===`medium`?`700x200`:`700x400`}export{s as adaptBannerAdProps,i as adaptFloatingAdItems,a as adaptIconAdProps,c as adaptPopupAdMaterials,o as adaptTextAdProps,e as buildAdsMatchRequest,r as hasMatchedAds,t as parseAdsMatchExtData,n as sortAdsMatchMaterials};
2
+ function e(e){return{...e}}function t(e){let t=e?.adExtData;if(!t)return{};try{let e=JSON.parse(t);return typeof e==`object`&&e?e:{}}catch{return{}}}function n(e){return[...e??[]].sort((e,t)=>Number(e?.sort??0)-Number(t?.sort??0))}function r(e){return!!(e?.hit&&Array.isArray(e.materials)&&e.materials.length>0)}function i(e){return n(e?.materials).filter(e=>e.advertiseIcon&&e.advertiseUrl).map(e=>({id:e.advertiseCode||``,materialUrl:e.advertiseIcon||``,jumpUrl:e.advertiseUrl||``,name:e.advertiseName||``}))}function a(e){let r=n(e?.materials).filter(e=>e.advertiseIcon&&e.advertiseUrl).map(e=>{let n=t(e);return{id:e.advertiseCode||``,title:n.title||e.advertiseName||``,icon:e.advertiseIcon||``,jumpUrl:e.advertiseUrl||``,badgeText:`广告`}}).filter(e=>e.title&&e.icon&&e.jumpUrl);return{displayCount:l(e?.config,r.length),items:r}}function o(e){let t=n(e?.materials).map(e=>({id:e.advertiseCode||``,text:e.advertiseName||e.advertiseDesc||``,jumpUrl:e.advertiseUrl||``})).filter(e=>e.text);return{displayCount:l(e?.config,t.length),items:t}}function s(e){let r=n(e?.materials).filter(e=>e.advertiseIcon&&e.advertiseUrl),i=r.map(e=>{let n=t(e);return{id:e.advertiseCode||``,coverUrl:e.advertiseIcon||``,jumpUrl:e.advertiseUrl||``,title:n.title||e.advertiseName||``}}).filter(e=>e.coverUrl&&e.jumpUrl);return{displayCount:l(e?.config,i.length),switchInterval:u(e?.config,r),styleSize:d(e?.config,r),items:i}}function c(e){return n(e?.materials).map(e=>{let n=t(e);return{id:e.advertiseCode||``,title:n.title||e.advertiseName||``,jumpUrl:e.advertiseUrl||``,materialUrl:e.advertiseIcon||``,advertiseType:Number(e.advertiseType??1),videoUrl:e.advertiseVideo||``,resolution:n.resolution||``,desc:e.advertiseDesc||``}}).filter(e=>e.id&&(e.materialUrl||e.videoUrl)&&e.jumpUrl)}function l(e,t=0){let n=Number(e?.displayCount??t);return!Number.isFinite(n)||n<=0?t:Math.min(Math.floor(n),t)}function u(e,n){let r=t(n?.[0]),i=Number(e?.switchInterval??r.switchInterval??3e3);return!Number.isFinite(i)||i<=0?3e3:i}function d(e,n){let r=t(n?.[0]),i=String(e?.styleSize??r.styleSize??`large`);return i===`700x400`||i===`700x200`||i===`720x150`||i===`720x300`?i:i===`small`?`720x150`:i===`medium`?`700x200`:`700x400`}export{s as adaptBannerAdProps,i as adaptFloatingAdItems,a as adaptIconAdProps,c as adaptPopupAdMaterials,o as adaptTextAdProps,e as buildAdsMatchRequest,r as hasMatchedAds,t as parseAdsMatchExtData,n as sortAdsMatchMaterials};
@@ -1,5 +1,5 @@
1
1
 
2
- "use client";import{trackAdClick as e,trackAdImpression as t,trackAdvertising as n}from"../../../../../utils/tracking.mjs";import{Button as r}from"../../../../ui/button.mjs";import{Image as i}from"../../../../ui/image.mjs";import{Box as a}from"../../../../ui/box.mjs";import{Dialog as o,DialogContent as s}from"../../../../ui/dialog.mjs";import c from"../../../../ui/link.mjs";import{adaptPopupAdMaterials as l,hasMatchedAds as u}from"../ad-match.mjs";import{useAdProvider as d}from"../ad-provider.mjs";import{useEffect as f,useMemo as p,useRef as m,useState as h}from"react";import{jsx as g,jsxs as _}from"react/jsx-runtime";const v=[{id:`popup-ad-1`,title:`弹窗广告标题`,jumpUrl:`/search`,materialUrl:`/static/components-resource/banner.png`,desc:`这里是弹窗广告描述`}];function y(e,t){return Array.isArray(e)&&e.length>0?e:t??[]}function b({items:b,mode:x=`renderer`,pageKey:S=`home`,pageName:C=`首页`}){let w=d(),T=p(()=>u(w?.matchData)?l(w?.matchData):x===`editor`?y(b,v):b??[],[w?.matchData,x,b]),[E,D]=h(0),[O,k]=h(!1),A=m(null),j=w?.matchData?.advertiseLocationCode||`home_popup`;f(()=>{D(0)},[T]),f(()=>{k(!1)},[E,T]),f(()=>()=>{A.current&&window.clearTimeout(A.current)},[]);let M=T[E];f(()=>{M?.id&&t({page_key:S,page_name:C,ad_slot_key:j,ad_slot_name:`弹窗广告`,ad_id:M.id,ad_type:`pop-ups-600800`})},[M?.id,j,S,C]);function N(){D(e=>e+1)}function P(){O||(k(!0),A.current&&window.clearTimeout(A.current),A.current=window.setTimeout(()=>{A.current=null,N()},260))}function F(e){e||P()}function I(){M?.id&&e({page_key:S,page_name:C,ad_slot_key:j,ad_slot_name:`弹窗广告`,ad_id:M.id,ad_type:`pop-ups-600800`})}function L(){M?.id&&(n({event_type:`close`,advertising_key:j,advertising_name:`弹窗广告`,advertising_id:M.id}),P())}return M?g(o,{open:!0,onOpenChange:F,disablePointerDismissal:!0,children:_(s,{showCloseButton:!1,className:`w-[320px] max-w-[calc(100vw-32px)] border-none bg-transparent p-0 shadow-none`,children:[_(a,{className:`flex flex-col items-center gap-[24px]`,style:{animation:O?`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:[g(c,{href:M.jumpUrl,className:`block w-full overflow-hidden rounded-[20px] bg-[#434343]`,style:{boxShadow:`0 18px 48px rgba(0, 0, 0, 0.26)`},onClick:I,children:g(a,{className:`w-full overflow-hidden bg-[#434343]`,children:g(i,{src:M.materialUrl,alt:M.title||`弹窗广告`,width:1200,height:1600,className:`block w-full h-auto`,unoptimized:!0})})}),g(r,{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:L,style:{animation:O?`funhub-popup-ad-close-exit 260ms ease-out both`:`funhub-popup-ad-close-breathe 2.4s ease-in-out 480ms infinite`},children:_(a,{className:`relative h-[24px] w-[24px]`,children:[g(a,{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`}),g(a,{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`})]})})]},M.id),g(`style`,{children:`
2
+ "use client";import{trackAdClick as e,trackAdImpression as t,trackAdvertising as n}from"../../../../../utils/tracking.mjs";import{Button as r}from"../../../../ui/button.mjs";import{Image as i}from"../../../../ui/image.mjs";import{Box as a}from"../../../../ui/box.mjs";import{Dialog as o,DialogContent as s}from"../../../../ui/dialog.mjs";import c from"../../../../ui/link.mjs";import l from"../../../../common/video-player/index.mjs";import{adaptPopupAdMaterials as u,hasMatchedAds as d}from"../ad-match.mjs";import{useAdProvider as f}from"../ad-provider.mjs";import{useEffect as p,useMemo as m,useRef as h,useState as g}from"react";import{jsx as _,jsxs as v}from"react/jsx-runtime";const y=[{id:`popup-ad-1`,title:`弹窗广告标题`,jumpUrl:`/search`,materialUrl:`/static/components-resource/banner.png`,desc:`这里是弹窗广告描述`}];function b(e,t){return Array.isArray(e)&&e.length>0?e:t??[]}function x(e){return Number(e?.advertiseType)===2&&!!e?.videoUrl}function S(e){return e?.resolution||`1080x1920`}function C({items:C,mode:w=`renderer`,pageKey:T=`home`,pageName:E=`首页`}){let D=f(),O=m(()=>d(D?.matchData)?u(D?.matchData):w===`editor`?b(C,y):C??[],[D?.matchData,w,C]),[k,A]=g(0),[j,M]=g(!1),N=h(null),P=D?.matchData?.advertiseLocationCode||`home_popup`;p(()=>{A(0)},[O]),p(()=>{M(!1)},[k,O]),p(()=>()=>{N.current&&window.clearTimeout(N.current)},[]);let F=O[k],I=x(F);p(()=>{F?.id&&t({page_key:T,page_name:E,ad_slot_key:P,ad_slot_name:`弹窗广告`,ad_id:F.id,ad_type:`pop-ups-600800`})},[F?.id,P,T,E]);function L(){A(e=>e+1)}function R(){j||(M(!0),N.current&&window.clearTimeout(N.current),N.current=window.setTimeout(()=>{N.current=null,L()},260))}function z(e){e||R()}function B(){F?.id&&e({page_key:T,page_name:E,ad_slot_key:P,ad_slot_name:`弹窗广告`,ad_id:F.id,ad_type:`pop-ups-600800`})}function V(){F?.id&&(n({event_type:`close`,advertising_key:P,advertising_name:`弹窗广告`,advertising_id:F.id}),R())}return F?_(o,{open:!0,onOpenChange:z,disablePointerDismissal:!0,children:v(s,{showCloseButton:!1,className:`w-[320px] max-w-[calc(100vw-32px)] border-none bg-transparent p-0 shadow-none`,children:[v(a,{className:`flex flex-col items-center gap-[24px]`,style:{animation:j?`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:[_(a,{className:`w-full overflow-hidden rounded-[20px] bg-[#434343]`,style:{boxShadow:`0 18px 48px rgba(0, 0, 0, 0.26)`},onClick:B,children:I?v(a,{className:`w-full bg-black`,children:[_(a,{className:`relative aspect-[9/16] w-full overflow-hidden bg-black`,children:_(l,{plyerId:`popup-ad-${F.id}`,resolution:S(F),poster:F.materialUrl||``,videoUrl:F.videoUrl||``,mergeConfig:{fitVideoSize:`fixWidth`,autoplayMuted:!0}})}),F.jumpUrl?_(a,{className:`p-4 pt-3`,children:_(c,{href:F.jumpUrl,className:`block rounded-[14px] bg-white px-4 py-3 text-center text-sm font-medium text-black`,children:F.title||`查看详情`})}):null]}):_(c,{href:F.jumpUrl,className:`block w-full overflow-hidden bg-[#434343]`,children:_(a,{className:`w-full overflow-hidden bg-[#434343]`,children:_(i,{src:F.materialUrl,alt:F.title||`弹窗广告`,width:1200,height:1600,className:`block w-full h-auto`,unoptimized:!0})})})}),_(r,{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:V,style:{animation:j?`funhub-popup-ad-close-exit 260ms ease-out both`:`funhub-popup-ad-close-breathe 2.4s ease-in-out 480ms infinite`},children:v(a,{className:`relative h-[24px] w-[24px]`,children:[_(a,{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`}),_(a,{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`})]})})]},F.id),_(`style`,{children:`
3
3
  @keyframes funhub-popup-ad-enter {
4
4
  0% {
5
5
  opacity: 0;
@@ -61,4 +61,4 @@
61
61
  animation-iteration-count: 1 !important;
62
62
  }
63
63
  }
64
- `})]})}):null}export{b as PopupAd};
64
+ `})]})}):null}export{C as PopupAd};
@@ -17,6 +17,9 @@ declare const popupAdMaterial: DefineMaterialOption<typeof PopupAdServer, typeof
17
17
  title: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
18
18
  jumpUrl: zod.ZodString & SchemaHasDefaultValue;
19
19
  materialUrl: zod.ZodString & SchemaHasDefaultValue;
20
+ advertiseType: zod.ZodOptional<zod.ZodNumber> & SchemaHasDefaultValue;
21
+ videoUrl: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
22
+ resolution: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
20
23
  desc: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
21
24
  }, zod_v4_core0.$strip>>>;
22
25
  } & {
@@ -13,6 +13,9 @@ interface PopupAdItem {
13
13
  title?: string;
14
14
  jumpUrl: string;
15
15
  materialUrl: string;
16
+ advertiseType?: number;
17
+ videoUrl?: string;
18
+ resolution?: string;
16
19
  desc?: string;
17
20
  }
18
21
  /**
@@ -24,6 +27,9 @@ declare const popupAdInspectorPropsSchema: z$1.ZodObject<{
24
27
  title: z$1.ZodOptional<z$1.ZodString> & SchemaHasDefaultValue;
25
28
  jumpUrl: z$1.ZodString & SchemaHasDefaultValue;
26
29
  materialUrl: z$1.ZodString & SchemaHasDefaultValue;
30
+ advertiseType: z$1.ZodOptional<z$1.ZodNumber> & SchemaHasDefaultValue;
31
+ videoUrl: z$1.ZodOptional<z$1.ZodString> & SchemaHasDefaultValue;
32
+ resolution: z$1.ZodOptional<z$1.ZodString> & SchemaHasDefaultValue;
27
33
  desc: z$1.ZodOptional<z$1.ZodString> & SchemaHasDefaultValue;
28
34
  }, z$1.core.$strip>>>;
29
35
  } & {
@@ -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}),advertiseType:e.number(1,{label:`广告类型`,required:!1}),videoUrl:e.string(``,{label:`视频地址`,required:!1}),resolution:e.string(`1080x1920`,{label:`视频分辨率`,required:!1}),desc:e.string(`这里是弹窗广告描述`,{label:`描述`,required:!1})}),{label:`广告列表`,required:!1})})),i=t(r);export{i as popupAdInspectorDefaultProps,r as popupAdInspectorPropsSchema};
@@ -6,7 +6,7 @@ import * as class_variance_authority_types0 from "class-variance-authority/types
6
6
  //#region components/ui/badge.d.ts
7
7
  /** badgeVariants 工具定义。 */
8
8
  declare const badgeVariants: (props?: ({
9
- variant?: "default" | "link" | "destructive" | "secondary" | "outline" | "ghost" | null | undefined;
9
+ variant?: "link" | "default" | "destructive" | "secondary" | "outline" | "ghost" | null | undefined;
10
10
  } & class_variance_authority_types0.ClassProp) | undefined) => string;
11
11
  /** Badge 组件。 */
12
12
  declare function Badge({
@@ -7,7 +7,7 @@ import * as class_variance_authority_types0 from "class-variance-authority/types
7
7
  //#region components/ui/button.d.ts
8
8
  /** buttonVariants 工具定义。 */
9
9
  declare const buttonVariants: (props?: ({
10
- variant?: "default" | "link" | "destructive" | "secondary" | "outline" | "ghost" | null | undefined;
10
+ variant?: "link" | "default" | "destructive" | "secondary" | "outline" | "ghost" | null | undefined;
11
11
  size?: "icon" | "default" | "xs" | "sm" | "lg" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
12
12
  } & class_variance_authority_types0.ClassProp) | undefined) => string;
13
13
  /** Button 组件属性。 */
@@ -106,6 +106,10 @@ interface AdsMatchMaterial {
106
106
  * 第三方广告类型枚举。
107
107
  */
108
108
  advertiseType?: number;
109
+ /**
110
+ * 视频素材地址。
111
+ */
112
+ advertiseVideo?: string;
109
113
  /**
110
114
  * 广告文案描述。
111
115
  */
@@ -1,2 +1,2 @@
1
1
 
2
- import e from"../utils/http.mjs";async function t(t,n){let a=await e.request({...n??{},url:`/api/content/matchAds`,method:`POST`,data:i(t)});return{...a,data:r(a.data)??{}}}function n(e){return[`content-ads-match`,e.adType,e.componentId??``,e.sceneContext??{}]}function r(e){if(e)return{hit:e.hit,adType:e.adType??e.ad_type,advertiseLocationCode:e.advertiseLocationCode??e.advertise_location_code,config:o(e.config),materials:e.materials?.map(s)??[]}}function i(e){let t=a(e.sceneContext);return{ad_type:e.adType,component_id:e.componentId??`111111`,...t?{scene_context:t}:{}}}function a(e){if(e)return{startup_type:e.startupType,is_startup_hot:e.isStartupHot,background_durationMin:e.backgroundDurationMin,video_played_seconds:e.videoPlayedSeconds}}function o(e){if(e)return{skipSeconds:e.skipSeconds??e.skip_seconds,popupCount:e.popupCount??e.popup_count,dailyMaxShow:e.dailyMaxShow??e.daily_max_show,triggerVideoProgressMin:e.triggerVideoProgressMin??e.trigger_video_progress_min,switchInterval:e.switchInterval??e.switch_interval,displayCount:e.displayCount??e.display_count,styleSize:e.styleSize??e.style_size}}function s(e){return{advertiseCode:e.advertiseCode??e.advertise_code,advertiseName:e.advertiseName??e.advertise_name,advertiseUrl:e.advertiseUrl??e.advertise_url,advertiseIcon:e.advertiseIcon??e.advertise_icon,adPcAdvertiseIcon:e.adPcAdvertiseIcon??e.pc_advertise_icon,advertiseType:e.advertiseType??e.advertise_type,advertiseDesc:e.advertiseDesc??e.advertise_desc,sort:e.sort,startTimeStamp:e.startTimeStamp??e.start_timestamp,endTimeStamp:e.endTimeStamp??e.end_timestamp,adExtData:e.adExtData??e.ad_ext_data}}export{t as pContentAdsMatch,n as pContentAdsMatchKey};
2
+ import e from"../utils/http.mjs";async function t(t,n){let a=await e.request({...n??{},url:`/api/content/matchAds`,method:`POST`,data:i(t)});return{...a,data:r(a.data)??{}}}function n(e){return[`content-ads-match`,e.adType,e.componentId??``,e.sceneContext??{}]}function r(e){if(e)return{hit:e.hit,adType:e.adType??e.ad_type,advertiseLocationCode:e.advertiseLocationCode??e.advertise_location_code,config:o(e.config),materials:e.materials?.map(s)??[]}}function i(e){let t=a(e.sceneContext);return{ad_type:e.adType,component_id:e.componentId??`111111`,...t?{scene_context:t}:{}}}function a(e){if(e)return{startup_type:e.startupType,is_startup_hot:e.isStartupHot,background_durationMin:e.backgroundDurationMin,video_played_seconds:e.videoPlayedSeconds}}function o(e){if(e)return{skipSeconds:e.skipSeconds??e.skip_seconds,popupCount:e.popupCount??e.popup_count,dailyMaxShow:e.dailyMaxShow??e.daily_max_show,triggerVideoProgressMin:e.triggerVideoProgressMin??e.trigger_video_progress_min,switchInterval:e.switchInterval??e.switch_interval,displayCount:e.displayCount??e.display_count,styleSize:e.styleSize??e.style_size}}function s(e){return{advertiseCode:e.advertiseCode??e.advertise_code,advertiseName:e.advertiseName??e.advertise_name,advertiseUrl:e.advertiseUrl??e.advertise_url,advertiseIcon:e.advertiseIcon??e.advertise_icon,adPcAdvertiseIcon:e.adPcAdvertiseIcon??e.pc_advertise_icon,advertiseType:e.advertiseType??e.advertise_type,advertiseVideo:e.advertiseVideo??e.advertise_video,advertiseDesc:e.advertiseDesc??e.advertise_desc,sort:e.sort,startTimeStamp:e.startTimeStamp??e.start_timestamp,endTimeStamp:e.endTimeStamp??e.end_timestamp,adExtData:e.adExtData??e.ad_ext_data}}export{t as pContentAdsMatch,n as pContentAdsMatchKey};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@funhub/platform",
3
3
  "type": "module",
4
- "version": "0.2.20",
4
+ "version": "0.2.21",
5
5
  "private": false,
6
6
  "sideEffects": [
7
7
  "**/*.css"