@adview/react 1.0.12 → 1.0.14
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/AdViewUnit/AdViewProvider.d.cts +4 -4
- package/dist/AdViewUnit/AdViewProvider.d.ts +4 -4
- package/dist/AdViewUnit/AdViewUnit.cjs +106 -298
- package/dist/AdViewUnit/AdViewUnit.cjs.map +1 -1
- package/dist/AdViewUnit/AdViewUnit.client.cjs +86 -256
- package/dist/AdViewUnit/AdViewUnit.client.cjs.map +1 -1
- package/dist/AdViewUnit/AdViewUnit.client.d.cts +3 -3
- package/dist/AdViewUnit/AdViewUnit.client.d.ts +3 -3
- package/dist/AdViewUnit/AdViewUnit.client.js +69 -239
- package/dist/AdViewUnit/AdViewUnit.client.js.map +1 -1
- package/dist/AdViewUnit/AdViewUnit.d.cts +3 -3
- package/dist/AdViewUnit/AdViewUnit.d.ts +3 -3
- package/dist/AdViewUnit/AdViewUnit.js +85 -277
- package/dist/AdViewUnit/AdViewUnit.js.map +1 -1
- package/dist/AdViewUnit/AdViewUnit.server.cjs +82 -214
- package/dist/AdViewUnit/AdViewUnit.server.cjs.map +1 -1
- package/dist/AdViewUnit/AdViewUnit.server.d.cts +3 -3
- package/dist/AdViewUnit/AdViewUnit.server.d.ts +3 -3
- package/dist/AdViewUnit/AdViewUnit.server.js +72 -204
- package/dist/AdViewUnit/AdViewUnit.server.js.map +1 -1
- package/dist/AdViewUnit/{AdViewUnitBanner.cjs → AdViewUnitBannerTemplate.cjs} +17 -14
- package/dist/AdViewUnit/AdViewUnitBannerTemplate.cjs.map +1 -0
- package/dist/AdViewUnit/AdViewUnitBannerTemplate.d.cts +12 -0
- package/dist/AdViewUnit/AdViewUnitBannerTemplate.d.ts +12 -0
- package/dist/AdViewUnit/AdViewUnitBannerTemplate.js +32 -0
- package/dist/AdViewUnit/AdViewUnitBannerTemplate.js.map +1 -0
- package/dist/AdViewUnit/AdViewUnitDefaultTemplate.cjs +48 -0
- package/dist/AdViewUnit/AdViewUnitDefaultTemplate.cjs.map +1 -0
- package/dist/AdViewUnit/AdViewUnitDefaultTemplate.d.cts +17 -0
- package/dist/AdViewUnit/AdViewUnitDefaultTemplate.d.ts +17 -0
- package/dist/AdViewUnit/AdViewUnitDefaultTemplate.js +17 -0
- package/dist/AdViewUnit/AdViewUnitDefaultTemplate.js.map +1 -0
- package/dist/AdViewUnit/{AdViewUnitNative.cjs → AdViewUnitNativeTemplate.cjs} +12 -13
- package/dist/AdViewUnit/AdViewUnitNativeTemplate.cjs.map +1 -0
- package/dist/AdViewUnit/AdViewUnitNativeTemplate.d.cts +11 -0
- package/dist/AdViewUnit/AdViewUnitNativeTemplate.d.ts +11 -0
- package/dist/AdViewUnit/{AdViewUnitNative.js → AdViewUnitNativeTemplate.js} +9 -10
- package/dist/AdViewUnit/AdViewUnitNativeTemplate.js.map +1 -0
- package/dist/AdViewUnit/{AdViewUnitProxy.cjs → AdViewUnitProxyTemplate.cjs} +14 -13
- package/dist/AdViewUnit/AdViewUnitProxyTemplate.cjs.map +1 -0
- package/dist/AdViewUnit/AdViewUnitProxyTemplate.d.cts +12 -0
- package/dist/AdViewUnit/AdViewUnitProxyTemplate.d.ts +12 -0
- package/dist/AdViewUnit/AdViewUnitProxyTemplate.js +33 -0
- package/dist/AdViewUnit/AdViewUnitProxyTemplate.js.map +1 -0
- package/dist/AdViewUnit/AdViewUnitTemplate.cjs +114 -0
- package/dist/AdViewUnit/AdViewUnitTemplate.cjs.map +1 -1
- package/dist/AdViewUnit/AdViewUnitTemplate.d.cts +14 -1
- package/dist/AdViewUnit/AdViewUnitTemplate.d.ts +14 -1
- package/dist/AdViewUnit/AdViewUnitTemplate.js +77 -0
- package/dist/AdViewUnit/AdViewUnitTemplate.js.map +1 -1
- package/dist/AdViewUnit/AdViewUnitTracking.d.cts +3 -3
- package/dist/AdViewUnit/AdViewUnitTracking.d.ts +3 -3
- package/dist/AdViewUnit/useAdViewController.cjs +5 -1
- package/dist/AdViewUnit/useAdViewController.cjs.map +1 -1
- package/dist/AdViewUnit/useAdViewController.d.cts +2 -2
- package/dist/AdViewUnit/useAdViewController.d.ts +2 -2
- package/dist/AdViewUnit/useAdViewController.js +5 -1
- package/dist/AdViewUnit/useAdViewController.js.map +1 -1
- package/dist/index.cjs +250 -255
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -22
- package/dist/index.d.ts +10 -22
- package/dist/index.js +232 -240
- package/dist/index.js.map +1 -1
- package/dist/server.cjs +214 -173
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +7 -17
- package/dist/server.d.ts +7 -17
- package/dist/server.js +195 -161
- package/dist/server.js.map +1 -1
- package/dist/{types-BaV07oMT.d.cts → types-B65WDsgh.d.cts} +29 -25
- package/dist/{types-BaV07oMT.d.ts → types-B65WDsgh.d.ts} +29 -25
- package/package.json +1 -1
- package/dist/AdViewUnit/AdViewUnitBanner.cjs.map +0 -1
- package/dist/AdViewUnit/AdViewUnitBanner.d.cts +0 -10
- package/dist/AdViewUnit/AdViewUnitBanner.d.ts +0 -10
- package/dist/AdViewUnit/AdViewUnitBanner.js +0 -29
- package/dist/AdViewUnit/AdViewUnitBanner.js.map +0 -1
- package/dist/AdViewUnit/AdViewUnitNative.cjs.map +0 -1
- package/dist/AdViewUnit/AdViewUnitNative.d.cts +0 -10
- package/dist/AdViewUnit/AdViewUnitNative.d.ts +0 -10
- package/dist/AdViewUnit/AdViewUnitNative.js.map +0 -1
- package/dist/AdViewUnit/AdViewUnitProxy.cjs.map +0 -1
- package/dist/AdViewUnit/AdViewUnitProxy.d.cts +0 -10
- package/dist/AdViewUnit/AdViewUnitProxy.d.ts +0 -10
- package/dist/AdViewUnit/AdViewUnitProxy.js +0 -32
- package/dist/AdViewUnit/AdViewUnitProxy.js.map +0 -1
- package/dist/AdViewUnit/AdViewUnitTypeSwitch.cjs +0 -203
- package/dist/AdViewUnit/AdViewUnitTypeSwitch.cjs.map +0 -1
- package/dist/AdViewUnit/AdViewUnitTypeSwitch.d.cts +0 -12
- package/dist/AdViewUnit/AdViewUnitTypeSwitch.d.ts +0 -12
- package/dist/AdViewUnit/AdViewUnitTypeSwitch.js +0 -170
- package/dist/AdViewUnit/AdViewUnitTypeSwitch.js.map +0 -1
- package/dist/AdViewUnit/AdViewUnitWrapper.client.cjs +0 -250
- package/dist/AdViewUnit/AdViewUnitWrapper.client.cjs.map +0 -1
- package/dist/AdViewUnit/AdViewUnitWrapper.client.d.cts +0 -11
- package/dist/AdViewUnit/AdViewUnitWrapper.client.d.ts +0 -11
- package/dist/AdViewUnit/AdViewUnitWrapper.client.js +0 -220
- package/dist/AdViewUnit/AdViewUnitWrapper.client.js.map +0 -1
- package/dist/AdViewUnit/AdViewUnitWrapper.server.cjs +0 -232
- package/dist/AdViewUnit/AdViewUnitWrapper.server.cjs.map +0 -1
- package/dist/AdViewUnit/AdViewUnitWrapper.server.d.cts +0 -11
- package/dist/AdViewUnit/AdViewUnitWrapper.server.d.ts +0 -11
- package/dist/AdViewUnit/AdViewUnitWrapper.server.js +0 -201
- package/dist/AdViewUnit/AdViewUnitWrapper.server.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/AdViewUnit/useAdViewController.ts","../../src/AdViewUnit/AdViewProvider.tsx"],"sourcesContent":["'use client';\n\nimport { AdViewData } from '@adview/core/typings';\nimport { adViewFetcher, getAdRequestUrl, getResolveConfig } from '@adview/core/utils';\nimport { useContext, useEffect, useState } from 'react';\nimport { AdLoadState, AdViewConfig } from '../types';\nimport { AdViewProviderContext } from './AdViewProvider';\n\ntype UseAdViewControllerProps = [AdViewData | null, Error | null, AdLoadState];\n\nfunction useAdViewController(\n adUnitConfig: AdViewConfig,\n unitId: string,\n format?: string,\n): UseAdViewControllerProps {\n const [adLoadState, setAdLoadState] = useState<string>('initial');\n const [adData, setAdData] = useState<AdViewData | null>(null);\n const [errorMessage, setErrorMessage] = useState<Error | null>(null);\n const globalConfig = useContext(AdViewProviderContext);\n const baseConfig = getResolveConfig({ ...adUnitConfig, ...globalConfig });\n const requestUrl = getAdRequestUrl(baseConfig, unitId
|
|
1
|
+
{"version":3,"sources":["../../src/AdViewUnit/useAdViewController.ts","../../src/AdViewUnit/AdViewProvider.tsx"],"sourcesContent":["'use client';\n\nimport { AdViewData } from '@adview/core/typings';\nimport { adViewFetcher, getAdRequestUrl, getResolveConfig } from '@adview/core/utils';\nimport { useContext, useEffect, useState } from 'react';\nimport { AdLoadState, AdViewConfig } from '../types';\nimport { AdViewProviderContext } from './AdViewProvider';\n\ntype UseAdViewControllerProps = [AdViewData | null, Error | null, AdLoadState];\n\nfunction useAdViewController(\n adUnitConfig: AdViewConfig,\n unitId: string,\n format?: string | string[],\n): UseAdViewControllerProps {\n const [adLoadState, setAdLoadState] = useState<string>('initial');\n const [adData, setAdData] = useState<AdViewData | null>(null);\n const [errorMessage, setErrorMessage] = useState<Error | null>(null);\n const globalConfig = useContext(AdViewProviderContext);\n const baseConfig = getResolveConfig({ ...adUnitConfig, ...globalConfig });\n const requestUrl = getAdRequestUrl(baseConfig, unitId,\n typeof format === 'string' ? format : format?.join(',') || '');\n\n const loadAd = async () => {\n setAdLoadState('loading');\n\n try {\n console.log('Requesting ad data from:', adViewFetcher, 'with URL:', requestUrl);\n const response = await adViewFetcher(requestUrl, baseConfig.defaultAdData);\n console.log('AdViewController response:', response);\n\n if (response instanceof Error) {\n setAdLoadState('error');\n setErrorMessage(response);\n } else {\n setAdData(response);\n }\n setAdLoadState('complete');\n } catch (error) {\n setAdLoadState('error');\n setAdLoadState('complete');\n setErrorMessage(error as Error);\n }\n };\n\n const loadState = {\n isInitial: adLoadState === 'initial',\n isLoading: adLoadState === 'loading',\n isComplete: adLoadState === 'complete',\n isError: adLoadState === 'error',\n };\n\n useEffect(() => {loadAd()}, []);\n\n return [adData, errorMessage, loadState];\n}\n\nexport default useAdViewController;\n","'use client';\n\nimport React, { createContext } from 'react';\nimport { type AdViewConfig } from '../types';\n\ntype AdViewProviderContextProps = AdViewConfig;\n\nexport const AdViewProviderContext = createContext<AdViewProviderContextProps>(\n {} as AdViewProviderContextProps,\n);\n\ntype AdViewProviderProps = {\n children: React.ReactNode;\n} & AdViewProviderContextProps;\n\nconst AdViewProvider = ({ children, ...props }: AdViewProviderProps) => {\n return (\n <AdViewProviderContext.Provider value={props}>\n {children}\n </AdViewProviderContext.Provider>\n );\n};\n\nexport default AdViewProvider;\n"],"mappings":";;;AAGA,SAAS,eAAe,iBAAiB,wBAAwB;AACjE,SAAS,YAAY,WAAW,gBAAgB;;;ACFhD,OAAO,SAAS,qBAAqB;AAK9B,IAAM,wBAAwB;AAAA,EACnC,CAAC;AACH;;;ADCA,SAAS,oBACP,cACA,QACA,QAC0B;AAC1B,QAAM,CAAC,aAAa,cAAc,IAAI,SAAiB,SAAS;AAChE,QAAM,CAAC,QAAQ,SAAS,IAAI,SAA4B,IAAI;AAC5D,QAAM,CAAC,cAAc,eAAe,IAAI,SAAuB,IAAI;AACnE,QAAM,eAAe,WAAW,qBAAqB;AACrD,QAAM,aAAa,iBAAiB,EAAE,GAAG,cAAc,GAAG,aAAa,CAAC;AACxE,QAAM,aAAa;AAAA,IAAgB;AAAA,IAAY;AAAA,IAC7C,OAAO,WAAW,WAAW,SAAS,QAAQ,KAAK,GAAG,KAAK;AAAA,EAAE;AAE/D,QAAM,SAAS,YAAY;AACzB,mBAAe,SAAS;AAExB,QAAI;AACF,cAAQ,IAAI,4BAA4B,eAAe,aAAa,UAAU;AAC9E,YAAM,WAAW,MAAM,cAAc,YAAY,WAAW,aAAa;AACzE,cAAQ,IAAI,8BAA8B,QAAQ;AAElD,UAAI,oBAAoB,OAAO;AAC7B,uBAAe,OAAO;AACtB,wBAAgB,QAAQ;AAAA,MAC1B,OAAO;AACL,kBAAU,QAAQ;AAAA,MACpB;AACA,qBAAe,UAAU;AAAA,IAC3B,SAAS,OAAO;AACd,qBAAe,OAAO;AACtB,qBAAe,UAAU;AACzB,sBAAgB,KAAc;AAAA,IAChC;AAAA,EACF;AAEA,QAAM,YAAY;AAAA,IAChB,WAAW,gBAAgB;AAAA,IAC3B,WAAW,gBAAgB;AAAA,IAC3B,YAAY,gBAAgB;AAAA,IAC5B,SAAS,gBAAgB;AAAA,EAC3B;AAEA,YAAU,MAAM;AAAC,WAAO;AAAA,EAAC,GAAG,CAAC,CAAC;AAE9B,SAAO,CAAC,QAAQ,cAAc,SAAS;AACzC;AAEA,IAAO,8BAAQ;","names":[]}
|
package/dist/index.cjs
CHANGED
|
@@ -33,17 +33,19 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
33
33
|
var index_exports = {};
|
|
34
34
|
__export(index_exports, {
|
|
35
35
|
AdViewProvider: () => AdViewProvider_default,
|
|
36
|
-
|
|
36
|
+
AdViewUnitBannerTemplate: () => AdViewUnitBannerTemplate_default,
|
|
37
37
|
AdViewUnitClient: () => AdViewUnit_client_default,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
38
|
+
AdViewUnitDefaultTemplate: () => AdViewUnitDefaultTemplate_default,
|
|
39
|
+
AdViewUnitNativeTemplate: () => AdViewUnitNativeTemplate_default,
|
|
40
|
+
AdViewUnitProxyTemplate: () => AdViewUnitProxyTemplate_default,
|
|
41
|
+
AdViewUnitTemplate: () => AdViewUnitTemplate_default,
|
|
42
|
+
BannerTemplate: () => AdViewUnitBannerTemplate_default,
|
|
43
|
+
DefaultTemplate: () => AdViewUnitDefaultTemplate_default,
|
|
44
|
+
NativeTemplate: () => AdViewUnitNativeTemplate_default,
|
|
45
|
+
Provider: () => AdViewProvider_default,
|
|
46
|
+
ProxyTemplate: () => AdViewUnitProxyTemplate_default,
|
|
47
|
+
Template: () => AdViewUnitTemplate_default,
|
|
48
|
+
Unit: () => AdViewUnit_client_default
|
|
47
49
|
});
|
|
48
50
|
module.exports = __toCommonJS(index_exports);
|
|
49
51
|
|
|
@@ -58,11 +60,82 @@ var AdViewProvider = ({ children, ...props }) => {
|
|
|
58
60
|
var AdViewProvider_default = AdViewProvider;
|
|
59
61
|
|
|
60
62
|
// src/AdViewUnit/AdViewUnit.client.tsx
|
|
61
|
-
var
|
|
63
|
+
var import_react5 = __toESM(require("react"), 1);
|
|
64
|
+
|
|
65
|
+
// src/AdViewUnit/AdViewUnitTemplate.tsx
|
|
66
|
+
var import_react2 = __toESM(require("react"), 1);
|
|
67
|
+
var templateFromListRender = (tmpls, data, wrap) => {
|
|
68
|
+
let renderedRemplates = tmpls.map((tmpl, index) => {
|
|
69
|
+
let tmp = renderTemplate(tmpl, data);
|
|
70
|
+
return !!tmp && import_react2.default.isValidElement(tmp) ? /* @__PURE__ */ import_react2.default.createElement(import_react2.default.Fragment, { key: index }, !!wrap ? wrap(tmp) : tmp) : null;
|
|
71
|
+
}).filter((it) => !!it);
|
|
72
|
+
if (!renderedRemplates.length) {
|
|
73
|
+
renderedRemplates = tmpls.map((tmpl, index) => {
|
|
74
|
+
let tmp = renderTemplate(tmpl, { ...data, type: "default" });
|
|
75
|
+
return !!tmp && import_react2.default.isValidElement(tmp) ? /* @__PURE__ */ import_react2.default.createElement(import_react2.default.Fragment, { key: index }, !!wrap ? wrap(tmp) : tmp) : null;
|
|
76
|
+
}).filter((it) => !!it);
|
|
77
|
+
}
|
|
78
|
+
return /* @__PURE__ */ import_react2.default.createElement(import_react2.default.Fragment, null, renderedRemplates);
|
|
79
|
+
};
|
|
80
|
+
var renderTemplate = (tmpl, data) => {
|
|
81
|
+
const isFunction = typeof tmpl === "function";
|
|
82
|
+
const isReactElement = import_react2.default.isValidElement(tmpl);
|
|
83
|
+
if (isReactElement) {
|
|
84
|
+
const { type, children } = tmpl.props;
|
|
85
|
+
console.log("=====>\nrenderTemplate: React element detected, type:", type, "data:", data.type, data.type !== type);
|
|
86
|
+
if (data.type !== type) {
|
|
87
|
+
return null;
|
|
88
|
+
}
|
|
89
|
+
if (typeof children === "function") {
|
|
90
|
+
return children(data);
|
|
91
|
+
}
|
|
92
|
+
console.log("CLONE ELEMENT", tmpl);
|
|
93
|
+
return import_react2.default.cloneElement(tmpl, {
|
|
94
|
+
...data,
|
|
95
|
+
children
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
if (isFunction) {
|
|
99
|
+
return tmpl(data);
|
|
100
|
+
}
|
|
101
|
+
return null;
|
|
102
|
+
};
|
|
103
|
+
var renderTemplates = (tmpls, data, listRender) => {
|
|
104
|
+
return listRender ? listRender(tmpls) : templateFromListRender(tmpls, data);
|
|
105
|
+
};
|
|
106
|
+
var renderAnyTemplates = (tmpls, data, listRender) => {
|
|
107
|
+
if (!tmpls) {
|
|
108
|
+
return null;
|
|
109
|
+
}
|
|
110
|
+
if (Array.isArray(tmpls)) {
|
|
111
|
+
return renderTemplates(tmpls, data, listRender);
|
|
112
|
+
}
|
|
113
|
+
if (typeof tmpls === "function") {
|
|
114
|
+
return tmpls(data);
|
|
115
|
+
}
|
|
116
|
+
if (import_react2.default.isValidElement(tmpls)) {
|
|
117
|
+
return templateFromListRender([tmpls], data);
|
|
118
|
+
}
|
|
119
|
+
return null;
|
|
120
|
+
};
|
|
121
|
+
var AdViewUnitTemplate = ({ type, children, ...data }) => {
|
|
122
|
+
const tmplProps = {
|
|
123
|
+
type,
|
|
124
|
+
...data
|
|
125
|
+
};
|
|
126
|
+
if (typeof children === "function") {
|
|
127
|
+
return children(tmplProps);
|
|
128
|
+
}
|
|
129
|
+
if (import_react2.default.isValidElement(children)) {
|
|
130
|
+
return import_react2.default.cloneElement(children, tmplProps);
|
|
131
|
+
}
|
|
132
|
+
return /* @__PURE__ */ import_react2.default.createElement(import_react2.default.Fragment, null);
|
|
133
|
+
};
|
|
134
|
+
var AdViewUnitTemplate_default = AdViewUnitTemplate;
|
|
62
135
|
|
|
63
136
|
// src/AdViewUnit/AdViewUnitTracking.tsx
|
|
64
137
|
var import_utils = require("@adview/core/utils");
|
|
65
|
-
var
|
|
138
|
+
var import_react3 = __toESM(require("react"), 1);
|
|
66
139
|
function AdViewUnitTracking({
|
|
67
140
|
impressions,
|
|
68
141
|
views,
|
|
@@ -70,12 +143,12 @@ function AdViewUnitTracking({
|
|
|
70
143
|
children
|
|
71
144
|
}) {
|
|
72
145
|
const isServer = typeof window === "undefined";
|
|
73
|
-
const wrapperRef = (0,
|
|
74
|
-
const executeImpressionsTrackingHandler = (0,
|
|
146
|
+
const wrapperRef = (0, import_react3.useRef)(null);
|
|
147
|
+
const executeImpressionsTrackingHandler = (0, import_react3.useCallback)(
|
|
75
148
|
() => (0, import_utils.executeImpressionsTracking)(impressions),
|
|
76
149
|
[impressions]
|
|
77
150
|
);
|
|
78
|
-
const trackingObserverInstanceHandler = (0,
|
|
151
|
+
const trackingObserverInstanceHandler = (0, import_react3.useCallback)(
|
|
79
152
|
(entries) => {
|
|
80
153
|
entries.forEach((entry) => {
|
|
81
154
|
if (entry.isIntersecting) {
|
|
@@ -86,14 +159,14 @@ function AdViewUnitTracking({
|
|
|
86
159
|
},
|
|
87
160
|
[views]
|
|
88
161
|
);
|
|
89
|
-
const trackingObserverInstance = (0,
|
|
162
|
+
const trackingObserverInstance = (0, import_react3.useMemo)(() => {
|
|
90
163
|
return !isServer ? new IntersectionObserver(trackingObserverInstanceHandler) : null;
|
|
91
164
|
}, [isServer, trackingObserverInstanceHandler]);
|
|
92
|
-
const clickTrackerHandler = (0,
|
|
165
|
+
const clickTrackerHandler = (0, import_react3.useCallback)(() => {
|
|
93
166
|
(0, import_utils.executeImpressionsTracking)(clicks);
|
|
94
167
|
wrapperRef.current?.removeEventListener("click", clickTrackerHandler);
|
|
95
168
|
}, [clicks]);
|
|
96
|
-
(0,
|
|
169
|
+
(0, import_react3.useEffect)(() => {
|
|
97
170
|
if (wrapperRef.current && trackingObserverInstance) {
|
|
98
171
|
executeImpressionsTrackingHandler();
|
|
99
172
|
wrapperRef.current?.addEventListener("click", clickTrackerHandler);
|
|
@@ -111,113 +184,223 @@ function AdViewUnitTracking({
|
|
|
111
184
|
executeImpressionsTrackingHandler,
|
|
112
185
|
clickTrackerHandler
|
|
113
186
|
]);
|
|
114
|
-
return /* @__PURE__ */
|
|
187
|
+
return /* @__PURE__ */ import_react3.default.createElement("div", { ref: wrapperRef }, children);
|
|
115
188
|
}
|
|
116
189
|
var AdViewUnitTracking_default = AdViewUnitTracking;
|
|
117
190
|
|
|
118
|
-
// src/AdViewUnit/
|
|
119
|
-
var import_react7 = __toESM(require("react"), 1);
|
|
120
|
-
|
|
121
|
-
// src/AdViewUnit/AdViewUnitNative.tsx
|
|
191
|
+
// src/AdViewUnit/useAdViewController.ts
|
|
122
192
|
var import_utils2 = require("@adview/core/utils");
|
|
123
|
-
var
|
|
124
|
-
function
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
193
|
+
var import_react4 = require("react");
|
|
194
|
+
function useAdViewController(adUnitConfig, unitId, format) {
|
|
195
|
+
const [adLoadState, setAdLoadState] = (0, import_react4.useState)("initial");
|
|
196
|
+
const [adData, setAdData] = (0, import_react4.useState)(null);
|
|
197
|
+
const [errorMessage, setErrorMessage] = (0, import_react4.useState)(null);
|
|
198
|
+
const globalConfig = (0, import_react4.useContext)(AdViewProviderContext);
|
|
199
|
+
const baseConfig = (0, import_utils2.getResolveConfig)({ ...adUnitConfig, ...globalConfig });
|
|
200
|
+
const requestUrl = (0, import_utils2.getAdRequestUrl)(
|
|
201
|
+
baseConfig,
|
|
202
|
+
unitId,
|
|
203
|
+
typeof format === "string" ? format : format?.join(",") || ""
|
|
204
|
+
);
|
|
205
|
+
const loadAd = async () => {
|
|
206
|
+
setAdLoadState("loading");
|
|
207
|
+
try {
|
|
208
|
+
console.log("Requesting ad data from:", import_utils2.adViewFetcher, "with URL:", requestUrl);
|
|
209
|
+
const response = await (0, import_utils2.adViewFetcher)(requestUrl, baseConfig.defaultAdData);
|
|
210
|
+
console.log("AdViewController response:", response);
|
|
211
|
+
if (response instanceof Error) {
|
|
212
|
+
setAdLoadState("error");
|
|
213
|
+
setErrorMessage(response);
|
|
214
|
+
} else {
|
|
215
|
+
setAdData(response);
|
|
216
|
+
}
|
|
217
|
+
setAdLoadState("complete");
|
|
218
|
+
} catch (error) {
|
|
219
|
+
setAdLoadState("error");
|
|
220
|
+
setAdLoadState("complete");
|
|
221
|
+
setErrorMessage(error);
|
|
222
|
+
}
|
|
223
|
+
};
|
|
224
|
+
const loadState = {
|
|
225
|
+
isInitial: adLoadState === "initial",
|
|
226
|
+
isLoading: adLoadState === "loading",
|
|
227
|
+
isComplete: adLoadState === "complete",
|
|
228
|
+
isError: adLoadState === "error"
|
|
229
|
+
};
|
|
230
|
+
(0, import_react4.useEffect)(() => {
|
|
231
|
+
loadAd();
|
|
232
|
+
}, []);
|
|
233
|
+
return [adData, errorMessage, loadState];
|
|
234
|
+
}
|
|
235
|
+
var useAdViewController_default = useAdViewController;
|
|
236
|
+
|
|
237
|
+
// src/AdViewUnit/AdViewUnit.client.tsx
|
|
238
|
+
function AdViewUnitClient({
|
|
239
|
+
unitId,
|
|
240
|
+
format,
|
|
241
|
+
children,
|
|
242
|
+
...config
|
|
129
243
|
}) {
|
|
130
|
-
const
|
|
244
|
+
const [response, error, loadState] = useAdViewController_default(
|
|
245
|
+
config,
|
|
246
|
+
unitId,
|
|
247
|
+
format
|
|
248
|
+
);
|
|
249
|
+
const responseGroup = error ? null : response?.groups?.[0];
|
|
250
|
+
const customTracker = responseGroup?.custom_tracker ?? {};
|
|
251
|
+
const groupItems = responseGroup?.items;
|
|
252
|
+
if (groupItems && groupItems?.length > 0) {
|
|
253
|
+
return groupItems.map(({ tracker, ...data }) => {
|
|
254
|
+
return /* @__PURE__ */ import_react5.default.createElement(AdViewUnitTracking_default, { key: data.id, ...tracker }, renderAnyTemplates(children, { data, type: data.type || "default", error, state: loadState }));
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
return /* @__PURE__ */ import_react5.default.createElement(AdViewUnitTracking_default, { ...customTracker }, renderAnyTemplates(children, { data: null, type: "default", error, state: loadState }));
|
|
258
|
+
}
|
|
259
|
+
var AdViewUnit_client_default = AdViewUnitClient;
|
|
260
|
+
|
|
261
|
+
// src/AdViewUnit/AdViewUnitBannerTemplate.tsx
|
|
262
|
+
var import_utils3 = require("@adview/core/utils");
|
|
263
|
+
var import_react6 = __toESM(require("react"), 1);
|
|
264
|
+
function AdViewUnitBannerTemplate({ className = "banner", style, data, state }) {
|
|
265
|
+
if (!data || !data.assets || !data.assets.length || !state?.isComplete) {
|
|
266
|
+
return null;
|
|
267
|
+
}
|
|
268
|
+
const asset = (0, import_utils3.getAssetByName)("main", data.assets);
|
|
269
|
+
return /* @__PURE__ */ import_react6.default.createElement(
|
|
270
|
+
"a",
|
|
271
|
+
{
|
|
272
|
+
target: "_blank",
|
|
273
|
+
rel: "noopener noreferrer",
|
|
274
|
+
href: (0, import_utils3.getPrepareURL)(data.url),
|
|
275
|
+
className,
|
|
276
|
+
style: { fontSize: 0, ...style }
|
|
277
|
+
},
|
|
278
|
+
asset && /* @__PURE__ */ import_react6.default.createElement(
|
|
279
|
+
"img",
|
|
280
|
+
{
|
|
281
|
+
alt: "main",
|
|
282
|
+
src: asset.path,
|
|
283
|
+
srcSet: asset.thumbs ? (0, import_utils3.getSrcSetCSSThumbs)(asset.thumbs) : ""
|
|
284
|
+
}
|
|
285
|
+
)
|
|
286
|
+
);
|
|
287
|
+
}
|
|
288
|
+
var AdViewUnitBannerTemplate_default = AdViewUnitBannerTemplate;
|
|
289
|
+
|
|
290
|
+
// src/AdViewUnit/AdViewUnitDefaultTemplate.tsx
|
|
291
|
+
var import_react7 = __toESM(require("react"), 1);
|
|
292
|
+
function AdViewUnitDefaultTemplate({ type = "default", data, state, children, ...props }) {
|
|
293
|
+
if (typeof children === "function") {
|
|
294
|
+
return /* @__PURE__ */ import_react7.default.createElement(import_react7.default.Fragment, null, children({ data, state, ...props }));
|
|
295
|
+
}
|
|
296
|
+
return children ? /* @__PURE__ */ import_react7.default.createElement(import_react7.default.Fragment, null, children) : /* @__PURE__ */ import_react7.default.createElement("div", { style: { padding: "1rem", textAlign: "center", color: "#666" } }, /* @__PURE__ */ import_react7.default.createElement("p", null, "\u{1F504} Default content for ad unit"), /* @__PURE__ */ import_react7.default.createElement("p", null, "Data: ", JSON.stringify(data)), /* @__PURE__ */ import_react7.default.createElement("p", null, "State: ", JSON.stringify(state)));
|
|
297
|
+
}
|
|
298
|
+
AdViewUnitDefaultTemplate.defaultProps = {
|
|
299
|
+
type: "default",
|
|
300
|
+
children: null
|
|
301
|
+
};
|
|
302
|
+
var AdViewUnitDefaultTemplate_default = AdViewUnitDefaultTemplate;
|
|
303
|
+
|
|
304
|
+
// src/AdViewUnit/AdViewUnitNativeTemplate.tsx
|
|
305
|
+
var import_utils4 = require("@adview/core/utils");
|
|
306
|
+
var import_react8 = __toESM(require("react"), 1);
|
|
307
|
+
function AdViewUnitNativeTemplate({ classNames, data, state }) {
|
|
308
|
+
if (!data || !data.assets || !data.assets.length || !state?.isComplete) {
|
|
309
|
+
return null;
|
|
310
|
+
}
|
|
311
|
+
const { assets, url, fields } = data;
|
|
312
|
+
const asset = (0, import_utils4.getAssetByName)("main", assets);
|
|
131
313
|
if (!url) {
|
|
132
314
|
return null;
|
|
133
315
|
}
|
|
134
|
-
return /* @__PURE__ */
|
|
316
|
+
return /* @__PURE__ */ import_react8.default.createElement("div", { className: classNames?.container }, /* @__PURE__ */ import_react8.default.createElement(
|
|
135
317
|
"a",
|
|
136
318
|
{
|
|
137
319
|
target: "_blank",
|
|
138
320
|
rel: "noopener noreferrer",
|
|
139
|
-
href: (0,
|
|
321
|
+
href: (0, import_utils4.getPrepareURL)(url),
|
|
140
322
|
className: classNames?.imageLink
|
|
141
323
|
},
|
|
142
|
-
asset && /* @__PURE__ */
|
|
324
|
+
asset && /* @__PURE__ */ import_react8.default.createElement(
|
|
143
325
|
"img",
|
|
144
326
|
{
|
|
145
327
|
alt: fields?.title,
|
|
146
328
|
title: fields?.title,
|
|
147
329
|
src: asset.path,
|
|
148
|
-
srcSet: asset.thumbs ? (0,
|
|
330
|
+
srcSet: asset.thumbs ? (0, import_utils4.getSrcSetCSSThumbs)(asset.thumbs) : void 0,
|
|
149
331
|
className: classNames?.image,
|
|
150
332
|
style: { objectFit: "cover", width: "100%", height: "100%" }
|
|
151
333
|
}
|
|
152
334
|
)
|
|
153
|
-
), /* @__PURE__ */
|
|
335
|
+
), /* @__PURE__ */ import_react8.default.createElement("div", { className: classNames?.label }, fields?.title && /* @__PURE__ */ import_react8.default.createElement(
|
|
154
336
|
"a",
|
|
155
337
|
{
|
|
156
338
|
target: "_blank",
|
|
157
339
|
rel: "noopener noreferrer",
|
|
158
|
-
href: (0,
|
|
340
|
+
href: (0, import_utils4.getPrepareURL)(url),
|
|
159
341
|
"data-class": "titleLink",
|
|
160
342
|
className: classNames?.titleLink
|
|
161
343
|
},
|
|
162
344
|
fields.title
|
|
163
|
-
), fields?.description && /* @__PURE__ */
|
|
345
|
+
), fields?.description && /* @__PURE__ */ import_react8.default.createElement(
|
|
164
346
|
"a",
|
|
165
347
|
{
|
|
166
348
|
target: "_blank",
|
|
167
349
|
rel: "noopener noreferrer",
|
|
168
|
-
href: (0,
|
|
350
|
+
href: (0, import_utils4.getPrepareURL)(url),
|
|
169
351
|
"data-class": "descriptionLink",
|
|
170
352
|
className: classNames?.descriptionLink
|
|
171
353
|
},
|
|
172
354
|
fields.description
|
|
173
|
-
), fields?.brandname && /* @__PURE__ */
|
|
355
|
+
), fields?.brandname && /* @__PURE__ */ import_react8.default.createElement(
|
|
174
356
|
"a",
|
|
175
357
|
{
|
|
176
358
|
target: "_blank",
|
|
177
359
|
rel: "noopener noreferrer",
|
|
178
|
-
href: (0,
|
|
360
|
+
href: (0, import_utils4.getPrepareURL)(url),
|
|
179
361
|
"data-class": "brandNameLink",
|
|
180
362
|
className: classNames?.brandNameLink
|
|
181
363
|
},
|
|
182
364
|
fields.brandname
|
|
183
|
-
), fields?.phone && /* @__PURE__ */
|
|
365
|
+
), fields?.phone && /* @__PURE__ */ import_react8.default.createElement(
|
|
184
366
|
"a",
|
|
185
367
|
{
|
|
186
368
|
target: "_blank",
|
|
187
369
|
rel: "noopener noreferrer",
|
|
188
|
-
href: (0,
|
|
370
|
+
href: (0, import_utils4.getPrepareURL)(url),
|
|
189
371
|
"data-class": "phoneLink",
|
|
190
372
|
className: classNames?.phoneLink
|
|
191
373
|
},
|
|
192
374
|
fields.phone
|
|
193
|
-
), fields?.url && /* @__PURE__ */
|
|
375
|
+
), fields?.url && /* @__PURE__ */ import_react8.default.createElement(
|
|
194
376
|
"a",
|
|
195
377
|
{
|
|
196
378
|
target: "_blank",
|
|
197
379
|
rel: "noopener noreferrer",
|
|
198
|
-
href: (0,
|
|
380
|
+
href: (0, import_utils4.getPrepareURL)(url),
|
|
199
381
|
"data-class": "urlLink",
|
|
200
382
|
className: classNames?.urlLink
|
|
201
383
|
},
|
|
202
384
|
fields?.url
|
|
203
385
|
)));
|
|
204
386
|
}
|
|
205
|
-
var
|
|
387
|
+
var AdViewUnitNativeTemplate_default = AdViewUnitNativeTemplate;
|
|
206
388
|
|
|
207
|
-
// src/AdViewUnit/
|
|
208
|
-
var
|
|
209
|
-
function
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
}
|
|
389
|
+
// src/AdViewUnit/AdViewUnitProxyTemplate.tsx
|
|
390
|
+
var import_react9 = __toESM(require("react"), 1);
|
|
391
|
+
function AdViewUnitProxyTemplate({ className, style, data, state }) {
|
|
392
|
+
if (!data || !state?.isComplete) {
|
|
393
|
+
return null;
|
|
394
|
+
}
|
|
395
|
+
const { url, fields } = data;
|
|
214
396
|
const iframeSrc = fields?.url || url;
|
|
215
397
|
if (!iframeSrc) {
|
|
216
398
|
return null;
|
|
217
399
|
}
|
|
218
|
-
return /* @__PURE__ */
|
|
400
|
+
return /* @__PURE__ */ import_react9.default.createElement(
|
|
219
401
|
"iframe",
|
|
220
402
|
{
|
|
403
|
+
className,
|
|
221
404
|
width: "100%",
|
|
222
405
|
height: "100%",
|
|
223
406
|
frameBorder: "0",
|
|
@@ -226,215 +409,27 @@ function AdViewUnitProxy({
|
|
|
226
409
|
allowTransparency: true,
|
|
227
410
|
scrolling: "no",
|
|
228
411
|
allowFullScreen: true,
|
|
229
|
-
style: { width: "100%", height: "100%" },
|
|
412
|
+
style: { width: "100%", height: "100%", border: "none", ...style },
|
|
230
413
|
src: iframeSrc
|
|
231
414
|
}
|
|
232
415
|
);
|
|
233
416
|
}
|
|
234
|
-
var
|
|
235
|
-
|
|
236
|
-
// src/AdViewUnit/AdViewUnitBanner.tsx
|
|
237
|
-
var import_utils3 = require("@adview/core/utils");
|
|
238
|
-
var import_react5 = __toESM(require("react"), 1);
|
|
239
|
-
function AdViewUnitBanner({ assets, url }) {
|
|
240
|
-
const asset = (0, import_utils3.getAssetByName)("main", assets);
|
|
241
|
-
return /* @__PURE__ */ import_react5.default.createElement("center", null, /* @__PURE__ */ import_react5.default.createElement(
|
|
242
|
-
"a",
|
|
243
|
-
{
|
|
244
|
-
target: "_blank",
|
|
245
|
-
rel: "noopener noreferrer",
|
|
246
|
-
href: (0, import_utils3.getPrepareURL)(url),
|
|
247
|
-
className: "banner",
|
|
248
|
-
style: { fontSize: 0 }
|
|
249
|
-
},
|
|
250
|
-
asset && /* @__PURE__ */ import_react5.default.createElement(
|
|
251
|
-
"img",
|
|
252
|
-
{
|
|
253
|
-
alt: "main",
|
|
254
|
-
src: asset.path,
|
|
255
|
-
srcSet: asset.thumbs ? (0, import_utils3.getSrcSetCSSThumbs)(asset.thumbs) : ""
|
|
256
|
-
}
|
|
257
|
-
)
|
|
258
|
-
));
|
|
259
|
-
}
|
|
260
|
-
var AdViewUnitBanner_default = AdViewUnitBanner;
|
|
261
|
-
|
|
262
|
-
// src/AdViewUnit/AdViewUnitTypeSwitch.tsx
|
|
263
|
-
var import_react6 = __toESM(require("react"), 1);
|
|
264
|
-
function AdViewUnitTypeSwitch({
|
|
265
|
-
data,
|
|
266
|
-
classNames,
|
|
267
|
-
onDefault
|
|
268
|
-
}) {
|
|
269
|
-
switch (data?.type) {
|
|
270
|
-
case "native":
|
|
271
|
-
return /* @__PURE__ */ import_react6.default.createElement(AdViewUnitNative_default, { ...data, classNames: classNames?.native });
|
|
272
|
-
case "proxy":
|
|
273
|
-
return /* @__PURE__ */ import_react6.default.createElement(AdViewUnitProxy_default, { ...data, classNames: classNames?.proxy });
|
|
274
|
-
case "banner":
|
|
275
|
-
return /* @__PURE__ */ import_react6.default.createElement(AdViewUnitBanner_default, { ...data, classNames: classNames?.banner });
|
|
276
|
-
default:
|
|
277
|
-
if (import_react6.default.isValidElement(onDefault)) {
|
|
278
|
-
return import_react6.default.cloneElement(onDefault);
|
|
279
|
-
}
|
|
280
|
-
if (typeof onDefault === "function") {
|
|
281
|
-
return onDefault();
|
|
282
|
-
}
|
|
283
|
-
return null;
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
var AdViewUnitTypeSwitch_default = AdViewUnitTypeSwitch;
|
|
287
|
-
|
|
288
|
-
// src/AdViewUnit/AdViewUnitWrapper.client.tsx
|
|
289
|
-
function AdViewUnitWrapperClient({
|
|
290
|
-
data,
|
|
291
|
-
state,
|
|
292
|
-
error,
|
|
293
|
-
children,
|
|
294
|
-
onDefault
|
|
295
|
-
}) {
|
|
296
|
-
const { isLoading, isError } = state;
|
|
297
|
-
const isChildrenReactNode = import_react7.default.isValidElement(children);
|
|
298
|
-
const isChildrenFunction = typeof children === "function";
|
|
299
|
-
if (isChildrenReactNode) {
|
|
300
|
-
return import_react7.default.cloneElement(children, {
|
|
301
|
-
data,
|
|
302
|
-
state,
|
|
303
|
-
error,
|
|
304
|
-
onDefault
|
|
305
|
-
});
|
|
306
|
-
}
|
|
307
|
-
if (isChildrenFunction) {
|
|
308
|
-
return children({
|
|
309
|
-
data,
|
|
310
|
-
state,
|
|
311
|
-
error,
|
|
312
|
-
onDefault
|
|
313
|
-
});
|
|
314
|
-
}
|
|
315
|
-
if (isLoading) {
|
|
316
|
-
return null;
|
|
317
|
-
}
|
|
318
|
-
if (!children && !isError && data) {
|
|
319
|
-
return /* @__PURE__ */ import_react7.default.createElement(AdViewUnitTypeSwitch_default, { data, onDefault });
|
|
320
|
-
}
|
|
321
|
-
if (import_react7.default.isValidElement(onDefault)) {
|
|
322
|
-
return import_react7.default.cloneElement(onDefault);
|
|
323
|
-
}
|
|
324
|
-
if (typeof onDefault === "function") {
|
|
325
|
-
return onDefault();
|
|
326
|
-
}
|
|
327
|
-
return null;
|
|
328
|
-
}
|
|
329
|
-
var AdViewUnitWrapper_client_default = AdViewUnitWrapperClient;
|
|
330
|
-
|
|
331
|
-
// src/AdViewUnit/useAdViewController.ts
|
|
332
|
-
var import_utils4 = require("@adview/core/utils");
|
|
333
|
-
var import_react8 = require("react");
|
|
334
|
-
function useAdViewController(adUnitConfig, unitId, format) {
|
|
335
|
-
const [adLoadState, setAdLoadState] = (0, import_react8.useState)("initial");
|
|
336
|
-
const [adData, setAdData] = (0, import_react8.useState)(null);
|
|
337
|
-
const [errorMessage, setErrorMessage] = (0, import_react8.useState)(null);
|
|
338
|
-
const globalConfig = (0, import_react8.useContext)(AdViewProviderContext);
|
|
339
|
-
const baseConfig = (0, import_utils4.getResolveConfig)({ ...adUnitConfig, ...globalConfig });
|
|
340
|
-
const requestUrl = (0, import_utils4.getAdRequestUrl)(baseConfig, unitId, format);
|
|
341
|
-
const loadAd = async () => {
|
|
342
|
-
setAdLoadState("loading");
|
|
343
|
-
try {
|
|
344
|
-
console.log("Requesting ad data from:", import_utils4.adViewFetcher, "with URL:", requestUrl);
|
|
345
|
-
const response = await (0, import_utils4.adViewFetcher)(requestUrl, baseConfig.defaultAdData);
|
|
346
|
-
console.log("AdViewController response:", response);
|
|
347
|
-
if (response instanceof Error) {
|
|
348
|
-
setAdLoadState("error");
|
|
349
|
-
setErrorMessage(response);
|
|
350
|
-
} else {
|
|
351
|
-
setAdData(response);
|
|
352
|
-
}
|
|
353
|
-
setAdLoadState("complete");
|
|
354
|
-
} catch (error) {
|
|
355
|
-
setAdLoadState("error");
|
|
356
|
-
setAdLoadState("complete");
|
|
357
|
-
setErrorMessage(error);
|
|
358
|
-
}
|
|
359
|
-
};
|
|
360
|
-
const loadState = {
|
|
361
|
-
isInitial: adLoadState === "initial",
|
|
362
|
-
isLoading: adLoadState === "loading",
|
|
363
|
-
isComplete: adLoadState === "complete",
|
|
364
|
-
isError: adLoadState === "error"
|
|
365
|
-
};
|
|
366
|
-
(0, import_react8.useEffect)(() => {
|
|
367
|
-
loadAd();
|
|
368
|
-
}, []);
|
|
369
|
-
return [adData, errorMessage, loadState];
|
|
370
|
-
}
|
|
371
|
-
var useAdViewController_default = useAdViewController;
|
|
372
|
-
|
|
373
|
-
// src/AdViewUnit/AdViewUnit.client.tsx
|
|
374
|
-
function AdViewUnitClient({
|
|
375
|
-
unitId,
|
|
376
|
-
format,
|
|
377
|
-
children,
|
|
378
|
-
onDefault = () => null,
|
|
379
|
-
...config
|
|
380
|
-
}) {
|
|
381
|
-
const [response, error, loadState] = useAdViewController_default(
|
|
382
|
-
config,
|
|
383
|
-
unitId,
|
|
384
|
-
format
|
|
385
|
-
);
|
|
386
|
-
const responseGroup = error ? null : response?.groups?.[0];
|
|
387
|
-
const customTracker = responseGroup?.custom_tracker ?? {};
|
|
388
|
-
const groupItems = responseGroup?.items;
|
|
389
|
-
if (groupItems && groupItems?.length) {
|
|
390
|
-
return groupItems.map(({ tracker, ...data }) => {
|
|
391
|
-
return /* @__PURE__ */ import_react9.default.createElement(AdViewUnitTracking_default, { key: data.id, ...tracker }, /* @__PURE__ */ import_react9.default.createElement(
|
|
392
|
-
AdViewUnitWrapper_client_default,
|
|
393
|
-
{
|
|
394
|
-
state: loadState,
|
|
395
|
-
error,
|
|
396
|
-
data,
|
|
397
|
-
onDefault
|
|
398
|
-
},
|
|
399
|
-
children
|
|
400
|
-
));
|
|
401
|
-
});
|
|
402
|
-
}
|
|
403
|
-
return /* @__PURE__ */ import_react9.default.createElement(AdViewUnitTracking_default, { ...customTracker }, /* @__PURE__ */ import_react9.default.createElement(
|
|
404
|
-
AdViewUnitWrapper_client_default,
|
|
405
|
-
{
|
|
406
|
-
state: loadState,
|
|
407
|
-
error,
|
|
408
|
-
onDefault
|
|
409
|
-
},
|
|
410
|
-
children
|
|
411
|
-
));
|
|
412
|
-
}
|
|
413
|
-
var AdViewUnit_client_default = AdViewUnitClient;
|
|
414
|
-
|
|
415
|
-
// src/index.ts
|
|
416
|
-
var AdView = {};
|
|
417
|
-
var AdViewExport = Object.assign(AdView, {
|
|
418
|
-
Provider: AdViewProvider_default,
|
|
419
|
-
Unit: AdViewUnit_client_default,
|
|
420
|
-
Banner: AdViewUnitBanner_default,
|
|
421
|
-
Native: AdViewUnitNative_default,
|
|
422
|
-
Proxy: AdViewUnitProxy_default,
|
|
423
|
-
TypeSwitch: AdViewUnitTypeSwitch_default
|
|
424
|
-
});
|
|
425
|
-
var index_default = AdViewExport;
|
|
417
|
+
var AdViewUnitProxyTemplate_default = AdViewUnitProxyTemplate;
|
|
426
418
|
// Annotate the CommonJS export names for ESM import in node:
|
|
427
419
|
0 && (module.exports = {
|
|
428
420
|
AdViewProvider,
|
|
429
|
-
|
|
421
|
+
AdViewUnitBannerTemplate,
|
|
430
422
|
AdViewUnitClient,
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
423
|
+
AdViewUnitDefaultTemplate,
|
|
424
|
+
AdViewUnitNativeTemplate,
|
|
425
|
+
AdViewUnitProxyTemplate,
|
|
426
|
+
AdViewUnitTemplate,
|
|
427
|
+
BannerTemplate,
|
|
428
|
+
DefaultTemplate,
|
|
429
|
+
NativeTemplate,
|
|
430
|
+
Provider,
|
|
431
|
+
ProxyTemplate,
|
|
432
|
+
Template,
|
|
433
|
+
Unit
|
|
439
434
|
});
|
|
440
435
|
//# sourceMappingURL=index.cjs.map
|