@surfside/ads-react 0.1.14 → 0.1.16
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/lib/cjs/BuildInfo.js +5 -0
- package/lib/cjs/BuildInfo.js.map +1 -0
- package/lib/esm/BuildInfo.js +2 -0
- package/lib/esm/BuildInfo.js.map +1 -0
- package/lib/esm/components/SurfsideBanner.js +4 -3
- package/lib/esm/components/SurfsideBanner.js.map +1 -1
- package/lib/esm/components/SurfsideCarousel.js +16 -4
- package/lib/esm/components/SurfsideCarousel.js.map +1 -1
- package/lib/esm/components/SurfsideDynamicZone.js +6 -4
- package/lib/esm/components/SurfsideDynamicZone.js.map +1 -1
- package/lib/esm/components/SurfsideProduct.js +9 -6
- package/lib/esm/components/SurfsideProduct.js.map +1 -1
- package/lib/esm/components/SurfsideVideo.js +7 -4
- package/lib/esm/components/SurfsideVideo.js.map +1 -1
- package/lib/esm/hooks/useSurfsideBanner.js +7 -4
- package/lib/esm/hooks/useSurfsideBanner.js.map +1 -1
- package/lib/esm/hooks/useSurfsideDynamicZone.js +48 -9
- package/lib/esm/hooks/useSurfsideDynamicZone.js.map +1 -1
- package/lib/esm/hooks/useSurfsideProducts.js +55 -18
- package/lib/esm/hooks/useSurfsideProducts.js.map +1 -1
- package/lib/esm/hooks/useSurfsideVideo.js +8 -4
- package/lib/esm/hooks/useSurfsideVideo.js.map +1 -1
- package/lib/esm/index.js +1 -0
- package/lib/esm/index.js.map +1 -1
- package/lib/types/BuildInfo.d.ts +5 -0
- package/lib/types/components/SurfsideBanner.d.ts +4 -0
- package/lib/types/components/SurfsideCarousel.d.ts +2 -1
- package/lib/types/components/SurfsideDynamicZone.d.ts +2 -1
- package/lib/types/components/SurfsideProduct.d.ts +2 -1
- package/lib/types/components/SurfsideVideo.d.ts +6 -1
- package/lib/types/hooks/useSurfsideBanner.d.ts +5 -1
- package/lib/types/hooks/useSurfsideDynamicZone.d.ts +1 -0
- package/lib/types/hooks/useSurfsideProducts.d.ts +4 -0
- package/lib/types/hooks/useSurfsideVideo.d.ts +5 -1
- package/lib/types/index.d.ts +1 -0
- package/package.json +8 -4
- package/lib/cjs/components/SurfsideBanner.js +0 -46
- package/lib/cjs/components/SurfsideBanner.js.map +0 -1
- package/lib/cjs/components/SurfsideBannerRenderer.js +0 -45
- package/lib/cjs/components/SurfsideBannerRenderer.js.map +0 -1
- package/lib/cjs/components/SurfsideBannerVideoRenderer.js +0 -25
- package/lib/cjs/components/SurfsideBannerVideoRenderer.js.map +0 -1
- package/lib/cjs/components/SurfsideCarousel.js +0 -104
- package/lib/cjs/components/SurfsideCarousel.js.map +0 -1
- package/lib/cjs/components/SurfsideDynamicZone.js +0 -131
- package/lib/cjs/components/SurfsideDynamicZone.js.map +0 -1
- package/lib/cjs/components/SurfsideProduct.js +0 -116
- package/lib/cjs/components/SurfsideProduct.js.map +0 -1
- package/lib/cjs/components/SurfsideVideo.js +0 -82
- package/lib/cjs/components/SurfsideVideo.js.map +0 -1
- package/lib/cjs/components/SurfsideVideoRenderer.js +0 -42
- package/lib/cjs/components/SurfsideVideoRenderer.js.map +0 -1
- package/lib/cjs/components/index.js +0 -23
- package/lib/cjs/components/index.js.map +0 -1
- package/lib/cjs/hooks/index.js +0 -20
- package/lib/cjs/hooks/index.js.map +0 -1
- package/lib/cjs/hooks/useSurfsideBanner.js +0 -212
- package/lib/cjs/hooks/useSurfsideBanner.js.map +0 -1
- package/lib/cjs/hooks/useSurfsideDynamicZone.js +0 -244
- package/lib/cjs/hooks/useSurfsideDynamicZone.js.map +0 -1
- package/lib/cjs/hooks/useSurfsideProducts.js +0 -397
- package/lib/cjs/hooks/useSurfsideProducts.js.map +0 -1
- package/lib/cjs/hooks/useSurfsideVideo.js +0 -295
- package/lib/cjs/hooks/useSurfsideVideo.js.map +0 -1
- package/lib/cjs/index.js +0 -56
- package/lib/cjs/index.js.map +0 -1
- package/lib/cjs/provider/SurfsideContextProvider.js +0 -159
- package/lib/cjs/provider/SurfsideContextProvider.js.map +0 -1
- package/lib/cjs/provider/index.js +0 -9
- package/lib/cjs/provider/index.js.map +0 -1
- package/lib/cjs/utils/Analytics.js +0 -181
- package/lib/cjs/utils/Analytics.js.map +0 -1
- package/lib/cjs/utils/index.js +0 -12
- package/lib/cjs/utils/index.js.map +0 -1
|
@@ -1,212 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
'use client';
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.InvalidBannerStateError = exports.useSurfsideBannerResponse = exports.useSurfsideBanner = void 0;
|
|
5
|
-
const react_1 = require("react");
|
|
6
|
-
const provider_1 = require("../provider");
|
|
7
|
-
const ads_core_client_1 = require("@surfside/ads-core-client");
|
|
8
|
-
/**
|
|
9
|
-
* Requests and returns a banner creative. Accepts a size argument and returns an object wrapping the creative markup
|
|
10
|
-
* (called the `adm`) and some analytics callbacks for tracking auction events, as well as metadata such as the original
|
|
11
|
-
* bid response which creatived the banner.
|
|
12
|
-
*
|
|
13
|
-
* For documentation on the return values and possible states of this hook, see {@link UseSurfsideBannerReturn}.
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* To request a banner and display it, pass a desired creative aspect ratio and check the status of the hook, then
|
|
17
|
-
* render when the banner has returned successfully
|
|
18
|
-
*
|
|
19
|
-
* ```tsx
|
|
20
|
-
* const { banner, loading, error, analytics } = useSurfsideBanner({
|
|
21
|
-
* zoneId: 'my-zone',
|
|
22
|
-
* size: [4, 1] // 4x1 banner
|
|
23
|
-
* })
|
|
24
|
-
*
|
|
25
|
-
* // Track win event
|
|
26
|
-
* useEffect(() => analytics?.trackWin(banner), [analytics]);
|
|
27
|
-
*
|
|
28
|
-
* if (loading) {
|
|
29
|
-
* return <div>Loading...</div>
|
|
30
|
-
* }
|
|
31
|
-
*
|
|
32
|
-
* if (error !== undefined) {
|
|
33
|
-
* throw error.error; // error.error is the Javascript "Error" type which can be safely thrown
|
|
34
|
-
* }
|
|
35
|
-
*
|
|
36
|
-
* return <div dangerouslySetInnerHTML={{ __html: banner.adm }}></div>;
|
|
37
|
-
* ```
|
|
38
|
-
*
|
|
39
|
-
* @expandType IUseSurfsideBannerOptions
|
|
40
|
-
* @expandType UseSurfsideBannerReturn
|
|
41
|
-
*
|
|
42
|
-
* @param {IUseSurfsideBannerOptions} params
|
|
43
|
-
*/
|
|
44
|
-
const useSurfsideBanner = ({ zoneId, size, enabled = true }) => {
|
|
45
|
-
const respProps = (0, react_1.useMemo)(() => ({
|
|
46
|
-
banner: undefined,
|
|
47
|
-
zoneId,
|
|
48
|
-
size,
|
|
49
|
-
enabled
|
|
50
|
-
}), [zoneId, size?.[0], size?.[1], enabled]);
|
|
51
|
-
const internalState = (0, exports.useSurfsideBannerResponse)(respProps);
|
|
52
|
-
(0, react_1.useEffect)(() => {
|
|
53
|
-
internalState.refetch?.();
|
|
54
|
-
}, [internalState.refetch]);
|
|
55
|
-
return internalState;
|
|
56
|
-
};
|
|
57
|
-
exports.useSurfsideBanner = useSurfsideBanner;
|
|
58
|
-
const useSurfsideBannerResponse = (props) => {
|
|
59
|
-
const { startRequest, requestBids, buildBannerResponse, logger, error: apiError, hasError: apiHasError, isReady: apiIsReady } = (0, provider_1.useSurfsideContext)();
|
|
60
|
-
const [internalBanner, setInternalBanner] = (0, react_1.useState)(props?.banner);
|
|
61
|
-
const [banner, setBanner] = (0, react_1.useState)();
|
|
62
|
-
const [loading, setLoading] = (0, react_1.useState)(true);
|
|
63
|
-
const [bannerError, setBannerError] = (0, react_1.useState)();
|
|
64
|
-
const log = (0, ads_core_client_1.Ctx)(logger)?.with('SurfsideBanner');
|
|
65
|
-
log?.info('Fetching Surfside Banner');
|
|
66
|
-
(0, react_1.useEffect)(() => {
|
|
67
|
-
if (internalBanner?.ok === true) {
|
|
68
|
-
setSuccessState({
|
|
69
|
-
...internalBanner.value,
|
|
70
|
-
id: internalBanner.value.bid.id
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
else if (internalBanner?.ok === false) {
|
|
74
|
-
setErrorState(internalBanner);
|
|
75
|
-
}
|
|
76
|
-
}, [internalBanner]);
|
|
77
|
-
(0, react_1.useEffect)(() => {
|
|
78
|
-
if (props?.banner === undefined) {
|
|
79
|
-
setLoadingState();
|
|
80
|
-
}
|
|
81
|
-
else {
|
|
82
|
-
setInternalBanner(props?.banner);
|
|
83
|
-
}
|
|
84
|
-
}, [props?.banner]);
|
|
85
|
-
const setErrorState = (err) => {
|
|
86
|
-
log?.error('Setting banner error state', err);
|
|
87
|
-
setBannerError(err);
|
|
88
|
-
setBanner(undefined);
|
|
89
|
-
setLoading(false);
|
|
90
|
-
};
|
|
91
|
-
const setLoadingState = () => {
|
|
92
|
-
log?.info('Setting banner loading state');
|
|
93
|
-
setBannerError(undefined);
|
|
94
|
-
setBanner(undefined);
|
|
95
|
-
setLoading(true);
|
|
96
|
-
};
|
|
97
|
-
const setSuccessState = (banner) => {
|
|
98
|
-
log?.info('Setting banner success state', banner);
|
|
99
|
-
setBannerError(undefined);
|
|
100
|
-
setLoading(false);
|
|
101
|
-
setBanner({ ...banner });
|
|
102
|
-
};
|
|
103
|
-
const refetch = (0, react_1.useCallback)(async () => {
|
|
104
|
-
log?.info('Running banner refetch');
|
|
105
|
-
if (props === undefined || !apiIsReady || props.enabled === false) {
|
|
106
|
-
if (apiHasError) {
|
|
107
|
-
log?.warn('Banner unable to render do to api error');
|
|
108
|
-
setErrorState(apiError);
|
|
109
|
-
}
|
|
110
|
-
log?.warn('Banner not fetching, either enabled is false or incorrect initialization');
|
|
111
|
-
return;
|
|
112
|
-
}
|
|
113
|
-
setLoadingState();
|
|
114
|
-
const request = startRequest(props.zoneId)
|
|
115
|
-
.withBanner(props.size[0], props.size[1])
|
|
116
|
-
.build();
|
|
117
|
-
const bannerResult = await (0, ads_core_client_1.AsyncPipe)(requestBids(request))
|
|
118
|
-
.then(bidResponse => (0, ads_core_client_1.WrapValue)(bidResponse.seatbid?.[0]?.bid?.[0]))
|
|
119
|
-
.then(buildBannerResponse)
|
|
120
|
-
.result();
|
|
121
|
-
log?.info('Setting banner result');
|
|
122
|
-
setInternalBanner(bannerResult);
|
|
123
|
-
}, [
|
|
124
|
-
apiIsReady,
|
|
125
|
-
apiError,
|
|
126
|
-
startRequest,
|
|
127
|
-
buildBannerResponse,
|
|
128
|
-
props?.enabled,
|
|
129
|
-
props?.zoneId,
|
|
130
|
-
props?.size?.[0],
|
|
131
|
-
props?.size?.[1],
|
|
132
|
-
props
|
|
133
|
-
]);
|
|
134
|
-
// memoize this for rerender edge cases
|
|
135
|
-
const analytics = (0, react_1.useMemo)(() => {
|
|
136
|
-
if (banner === undefined) {
|
|
137
|
-
return undefined;
|
|
138
|
-
}
|
|
139
|
-
return {
|
|
140
|
-
trackWin: trackWin(banner, logger)
|
|
141
|
-
};
|
|
142
|
-
}, [banner?.id]);
|
|
143
|
-
if (!loading && bannerError === undefined && banner !== undefined) { /* Handle Success State */
|
|
144
|
-
return {
|
|
145
|
-
banner,
|
|
146
|
-
error: bannerError,
|
|
147
|
-
loading,
|
|
148
|
-
isReady: true,
|
|
149
|
-
analytics,
|
|
150
|
-
refetch: refetch
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
|
-
else if (!loading && bannerError !== undefined && banner === undefined) { /* Handle Error State */
|
|
154
|
-
return {
|
|
155
|
-
banner,
|
|
156
|
-
error: bannerError,
|
|
157
|
-
loading: loading,
|
|
158
|
-
isReady: false,
|
|
159
|
-
analytics: undefined,
|
|
160
|
-
refetch: refetch
|
|
161
|
-
};
|
|
162
|
-
}
|
|
163
|
-
else if (loading && bannerError === undefined && banner === undefined) { /* Handle Loading State */
|
|
164
|
-
return {
|
|
165
|
-
banner,
|
|
166
|
-
error: bannerError,
|
|
167
|
-
loading,
|
|
168
|
-
isReady: false,
|
|
169
|
-
analytics: undefined,
|
|
170
|
-
refetch: refetch
|
|
171
|
-
};
|
|
172
|
-
}
|
|
173
|
-
else { /* Handle Invalid State */
|
|
174
|
-
return {
|
|
175
|
-
banner: undefined,
|
|
176
|
-
error: (0, ads_core_client_1.Err)(new InvalidBannerStateError(banner, bannerError, loading)),
|
|
177
|
-
loading: false,
|
|
178
|
-
isReady: false,
|
|
179
|
-
analytics: undefined,
|
|
180
|
-
refetch: refetch,
|
|
181
|
-
};
|
|
182
|
-
}
|
|
183
|
-
};
|
|
184
|
-
exports.useSurfsideBannerResponse = useSurfsideBannerResponse;
|
|
185
|
-
class InvalidBannerStateError extends Error {
|
|
186
|
-
banner;
|
|
187
|
-
error;
|
|
188
|
-
loading;
|
|
189
|
-
constructor(banner, error, loading) {
|
|
190
|
-
super('useSurfsideBanner resulted in an invalid state');
|
|
191
|
-
this.banner = banner;
|
|
192
|
-
this.error = error;
|
|
193
|
-
this.loading = loading;
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
exports.InvalidBannerStateError = InvalidBannerStateError;
|
|
197
|
-
;
|
|
198
|
-
const trackWin = (banner, logger) => () => {
|
|
199
|
-
if (banner === undefined) {
|
|
200
|
-
return;
|
|
201
|
-
}
|
|
202
|
-
const log = (0, ads_core_client_1.Ctx)(logger)?.with('trackWin');
|
|
203
|
-
if (banner.bid.nurl !== undefined) {
|
|
204
|
-
const url = new URL(banner.bid.nurl);
|
|
205
|
-
url.searchParams.delete('url');
|
|
206
|
-
fetch(url.toString()).then(() => log?.debug('Won auction', banner));
|
|
207
|
-
}
|
|
208
|
-
else {
|
|
209
|
-
log?.error('Missing nurl on banner bid response! This should never happen', banner);
|
|
210
|
-
}
|
|
211
|
-
};
|
|
212
|
-
//# sourceMappingURL=useSurfsideBanner.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useSurfsideBanner.js","sourceRoot":"src/","sources":["hooks/useSurfsideBanner.ts"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;AAEb,iCAAkE;AAClE,0CAAiD;AACjD,+DASmC;AAuOnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;G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,CAAC,CAAC;IACxE,CAAC;SAAM,CAAC;QACJ,GAAG,EAAE,KAAK,CACN,+DAA+D,EAC/D,MAAM,CACT,CAAC;IACN,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -1,244 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
'use client';
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.InvalidDynamicZoneState = void 0;
|
|
5
|
-
exports.useSurfsideDynamicZone = useSurfsideDynamicZone;
|
|
6
|
-
const react_1 = require("react");
|
|
7
|
-
const provider_1 = require("../provider");
|
|
8
|
-
const ads_core_client_1 = require("@surfside/ads-core-client");
|
|
9
|
-
const hooks_1 = require("../hooks");
|
|
10
|
-
;
|
|
11
|
-
;
|
|
12
|
-
;
|
|
13
|
-
;
|
|
14
|
-
;
|
|
15
|
-
;
|
|
16
|
-
/**
|
|
17
|
-
* @overload
|
|
18
|
-
*
|
|
19
|
-
* Returns a typed version of the `UseSurfsideDynamicZoneReturn` populated with full product data, if product data is
|
|
20
|
-
* available. If you pass `withProductInfo: true` to props (or pass nothing at all), this overload will be used.
|
|
21
|
-
* @expandType UseSurfDynamicZoneOptionsWithProductInfo
|
|
22
|
-
* @param {UseSurfDynamicZoneOptionsWithProductInfo} props
|
|
23
|
-
*/ ;
|
|
24
|
-
/**
|
|
25
|
-
* React hook for surfside dynamic zones. A dynamic zone is a creative which determines which type of creative to
|
|
26
|
-
* request based on the dimensions of the screen (i.e, it can request different creatives for desktop vs mobile).
|
|
27
|
-
* Dynamic zones can also define an order of priority for backup creatives. This requires you to have configured a
|
|
28
|
-
* dynamic zone ahead of time within the Surfside platform
|
|
29
|
-
*
|
|
30
|
-
* For example, a dynamic zone might be configured to request A carousel and a 4x1 banner on Desktop, or a 1x4 banner
|
|
31
|
-
* and 1x1 video on Mobile. Once it has selected the screen size, it will send a request for all configured creative
|
|
32
|
-
* types. It will then return the first available creative in order of priority. In our example, the dynamic zone might
|
|
33
|
-
* detect that we are on a Desktop view and then request the carousel and 4x1 banner at the same time. It will then try
|
|
34
|
-
* to render the carousel, if it is available. If it is not, it will render the banner. If neither are available,
|
|
35
|
-
* `useSurfsideDynamicZone` will return an error of type {@link NoBidsError}.
|
|
36
|
-
*
|
|
37
|
-
* @example
|
|
38
|
-
* To handle the output of each creative, check the `type` field after checking the value of `loading` and `error`.
|
|
39
|
-
* It is recommended that you implement renderer components which you can pass creative responses to, rather than trying
|
|
40
|
-
* to render each creative in the same component as your `useSurfsideDynamicZone` call.
|
|
41
|
-
*
|
|
42
|
-
* ```tsx
|
|
43
|
-
* const { data, error, loading, type } = useSurfsideDynamicZone({
|
|
44
|
-
* zoneId: 'my-zone'
|
|
45
|
-
* });
|
|
46
|
-
*
|
|
47
|
-
* if (loading) {
|
|
48
|
-
* return <div>Loading...</div>
|
|
49
|
-
* }
|
|
50
|
-
*
|
|
51
|
-
* if (error !== undefined) {
|
|
52
|
-
* throw error.error; // error.error is a Javascript Error type and can be safely thrown.
|
|
53
|
-
* }
|
|
54
|
-
*
|
|
55
|
-
* switch(type) {
|
|
56
|
-
* case 'banner': return <MyRenderBannerComponent banner={data} />;
|
|
57
|
-
* case 'video': return <MyRenderVideoComponent video={data} />;
|
|
58
|
-
* case 'products': return <MyRenderCarouselComponent products={data} />;
|
|
59
|
-
* }
|
|
60
|
-
* ```
|
|
61
|
-
*
|
|
62
|
-
* This pattern will allow you to re-use the renderer component across dynamic zones or pages where you call the other
|
|
63
|
-
* use hooks (i.e, `useSurfsideBanner`, `useSurfsideProducts`) directly.
|
|
64
|
-
* @param {UseSurfDynamicZoneOptions} props
|
|
65
|
-
*/
|
|
66
|
-
function useSurfsideDynamicZone({ zoneId, pageSize, enabled = true, withProductInfo = true }) {
|
|
67
|
-
const { getDynamicZone, buildDynamicZoneRequest, buildDynamicResponse, isReady: apiIsReady, hasError: apiHasError, error: apiError, logger } = (0, provider_1.useSurfsideContext)();
|
|
68
|
-
const log = (0, ads_core_client_1.Ctx)(logger)?.with('useSurfsideDynamicZone');
|
|
69
|
-
const [type, setType] = (0, react_1.useState)();
|
|
70
|
-
/* Products */
|
|
71
|
-
const [productsProps, setProductsProps] = (0, react_1.useState)();
|
|
72
|
-
const productsResponseState = (0, hooks_1.useSurfsideProductsResponse)(productsProps);
|
|
73
|
-
/* Banner */
|
|
74
|
-
const [bannerProps, setBannerProps] = (0, react_1.useState)();
|
|
75
|
-
const bannerResponseState = (0, hooks_1.useSurfsideBannerResponse)(bannerProps);
|
|
76
|
-
/* Video */
|
|
77
|
-
const [videoProps, setVideoProps] = (0, react_1.useState)();
|
|
78
|
-
const videoResponseState = (0, hooks_1.useSurfsideVideoResponse)(videoProps);
|
|
79
|
-
const [loading, setLoading] = (0, react_1.useState)(true);
|
|
80
|
-
const [error, setError] = (0, react_1.useState)();
|
|
81
|
-
const fetchDynamicZone = (0, react_1.useCallback)(async () => {
|
|
82
|
-
const localLog = log?.with('fetchDynamicZone');
|
|
83
|
-
if (!enabled || !apiIsReady) {
|
|
84
|
-
if (apiHasError) {
|
|
85
|
-
localLog?.debug('api has error', apiError);
|
|
86
|
-
setErrorState(apiError);
|
|
87
|
-
}
|
|
88
|
-
localLog?.debug('Not fetching dynamic zone yet');
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
setLoadingState();
|
|
92
|
-
// Get dynamic response
|
|
93
|
-
const result = await (0, ads_core_client_1.AsyncPipe)(getDynamicZone(zoneId))
|
|
94
|
-
.then(buildDynamicZoneRequest.bind(undefined, zoneId))
|
|
95
|
-
.then(buildDynamicResponse)
|
|
96
|
-
.result();
|
|
97
|
-
/* If no creatives are available, this may return an error that should be handled explicitly */
|
|
98
|
-
if (!result.ok) {
|
|
99
|
-
localLog?.debug('No creatives available, setting error state');
|
|
100
|
-
setErrorState(result);
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
const dynamicZone = result.value;
|
|
104
|
-
if (dynamicZone.type === 'carousel') {
|
|
105
|
-
localLog?.debug('Got carousel back from dynamic zone');
|
|
106
|
-
setProductsSuccessState((0, ads_core_client_1.Ok)(dynamicZone)); // re-box for type purposes
|
|
107
|
-
}
|
|
108
|
-
else if (dynamicZone.type === 'banner') {
|
|
109
|
-
localLog?.debug('Got banner back from dynamic zone');
|
|
110
|
-
setBannerSuccessState((0, ads_core_client_1.Ok)(dynamicZone));
|
|
111
|
-
}
|
|
112
|
-
else if (dynamicZone.type === 'video') {
|
|
113
|
-
localLog?.debug('Got video back from dynamic zone');
|
|
114
|
-
setVideoSuccessState((0, ads_core_client_1.Ok)(dynamicZone));
|
|
115
|
-
}
|
|
116
|
-
}, [enabled, apiError, getDynamicZone, zoneId]);
|
|
117
|
-
// Fetch dynamic zone when dependencies change
|
|
118
|
-
(0, react_1.useEffect)(() => {
|
|
119
|
-
log?.info('Fetching dynamic zone', apiIsReady);
|
|
120
|
-
fetchDynamicZone();
|
|
121
|
-
}, [fetchDynamicZone, apiIsReady, zoneId]);
|
|
122
|
-
const setLoadingState = () => {
|
|
123
|
-
log?.info('Setting loading state');
|
|
124
|
-
setLoading(true);
|
|
125
|
-
setError(undefined);
|
|
126
|
-
setBannerProps(undefined);
|
|
127
|
-
setProductsProps(undefined);
|
|
128
|
-
setType(undefined);
|
|
129
|
-
};
|
|
130
|
-
const setErrorState = (error) => {
|
|
131
|
-
log?.info('Setting error state');
|
|
132
|
-
setLoading(false);
|
|
133
|
-
setError(error);
|
|
134
|
-
};
|
|
135
|
-
const setProductsSuccessState = (products) => {
|
|
136
|
-
log?.info('Setting carousel success state');
|
|
137
|
-
setLoading(false);
|
|
138
|
-
setError(undefined);
|
|
139
|
-
setType('products');
|
|
140
|
-
setProductsProps({
|
|
141
|
-
zoneId,
|
|
142
|
-
carousel: products,
|
|
143
|
-
pageSize,
|
|
144
|
-
strategy: products.value.dynamicCarouselRequest.strategy,
|
|
145
|
-
withProductInfo
|
|
146
|
-
});
|
|
147
|
-
};
|
|
148
|
-
const setBannerSuccessState = (banner) => {
|
|
149
|
-
log?.info('Setting banner success state');
|
|
150
|
-
setLoading(false);
|
|
151
|
-
setError(undefined);
|
|
152
|
-
setType('banner');
|
|
153
|
-
const { width, height } = banner.value.dynamicBannerRequest;
|
|
154
|
-
setBannerProps({
|
|
155
|
-
banner,
|
|
156
|
-
zoneId,
|
|
157
|
-
size: [width, height]
|
|
158
|
-
});
|
|
159
|
-
};
|
|
160
|
-
const setVideoSuccessState = (video) => {
|
|
161
|
-
log?.info('Setting video success state');
|
|
162
|
-
setLoading(false);
|
|
163
|
-
setError(undefined);
|
|
164
|
-
setType('video');
|
|
165
|
-
const request = video.value.dynamicVideoRequest;
|
|
166
|
-
setVideoProps({
|
|
167
|
-
video,
|
|
168
|
-
mimes: ['video/mp4', 'video/webm'],
|
|
169
|
-
minDuration: request.minDuration,
|
|
170
|
-
maxDuration: request.maxDuration,
|
|
171
|
-
zoneId: request.zoneId,
|
|
172
|
-
size: [request.width, request.height],
|
|
173
|
-
enabled
|
|
174
|
-
});
|
|
175
|
-
};
|
|
176
|
-
if (error !== undefined) {
|
|
177
|
-
return {
|
|
178
|
-
type: undefined,
|
|
179
|
-
loading: false,
|
|
180
|
-
refetchDynamicZone: fetchDynamicZone,
|
|
181
|
-
data: undefined,
|
|
182
|
-
error
|
|
183
|
-
};
|
|
184
|
-
}
|
|
185
|
-
else if (loading || !enabled) {
|
|
186
|
-
return {
|
|
187
|
-
type: undefined,
|
|
188
|
-
loading: true,
|
|
189
|
-
refetchDynamicZone: fetchDynamicZone,
|
|
190
|
-
data: undefined,
|
|
191
|
-
error
|
|
192
|
-
};
|
|
193
|
-
}
|
|
194
|
-
else if (type === 'banner' &&
|
|
195
|
-
bannerResponseState !== undefined &&
|
|
196
|
-
bannerResponseState.loading === false &&
|
|
197
|
-
bannerResponseState.error === undefined) {
|
|
198
|
-
return {
|
|
199
|
-
type: 'banner',
|
|
200
|
-
loading,
|
|
201
|
-
error,
|
|
202
|
-
data: bannerResponseState,
|
|
203
|
-
refetchDynamicZone: fetchDynamicZone
|
|
204
|
-
};
|
|
205
|
-
}
|
|
206
|
-
else if (type === 'products' && productsResponseState !== undefined) {
|
|
207
|
-
return {
|
|
208
|
-
type: 'products',
|
|
209
|
-
loading,
|
|
210
|
-
error,
|
|
211
|
-
data: productsResponseState,
|
|
212
|
-
refetchDynamicZone: fetchDynamicZone
|
|
213
|
-
};
|
|
214
|
-
}
|
|
215
|
-
else if (type === 'video' && videoResponseState !== undefined) {
|
|
216
|
-
return {
|
|
217
|
-
type: 'video',
|
|
218
|
-
loading,
|
|
219
|
-
error,
|
|
220
|
-
data: videoResponseState,
|
|
221
|
-
refetchDynamicZone: fetchDynamicZone
|
|
222
|
-
};
|
|
223
|
-
}
|
|
224
|
-
else {
|
|
225
|
-
return {
|
|
226
|
-
error: (0, ads_core_client_1.Err)(new InvalidDynamicZoneState(zoneId)),
|
|
227
|
-
loading: false,
|
|
228
|
-
data: undefined,
|
|
229
|
-
refetchDynamicZone: fetchDynamicZone,
|
|
230
|
-
type: undefined
|
|
231
|
-
};
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
;
|
|
235
|
-
class InvalidDynamicZoneState extends Error {
|
|
236
|
-
zoneId;
|
|
237
|
-
constructor(zoneId) {
|
|
238
|
-
super('useSurfsideDynamicZone was left in an invalid state. This is an internal error, please ' +
|
|
239
|
-
'contact Surfside');
|
|
240
|
-
this.zoneId = zoneId;
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
exports.InvalidDynamicZoneState = InvalidDynamicZoneState;
|
|
244
|
-
//# sourceMappingURL=useSurfsideDynamicZone.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useSurfsideDynamicZone.js","sourceRoot":"src/","sources":["hooks/useSurfsideDynamicZone.ts"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;AAwTb,wDA+LC;AArfD,iCAAyD;AACzD,0CAAiD;AACjD,+DAWmC;AACnC,oCAckB;AAoHjB,CAAC;AAWD,CAAC;AAUD,CAAC;AAoBD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