@liquidcommercedev/rmn-sdk 1.4.5-beta.1 → 1.4.5-beta.2
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.cjs +65 -88
- package/dist/index.esm.js +65 -88
- package/dist/types/modules/spot/html/constants/html.constant.d.ts +8 -0
- package/dist/types/modules/spot/html/constants/index.d.ts +1 -0
- package/dist/types/modules/spot/spot.interface.d.ts +0 -2
- package/dist/types/modules/spot/spot.selection.service.d.ts +0 -1
- package/package.json +1 -1
- package/umd/liquidcommerce-rmn-sdk.min.js +1 -1
- package/dist/types/modules/spot/html/spot.element.shadow-root.d.ts +0 -5
- package/dist/types/modules/spot/html/templates/iab/constants/fonts.constant.d.ts +0 -3
package/dist/index.cjs
CHANGED
@@ -15154,9 +15154,18 @@ class AuthService extends BaseApi {
|
|
15154
15154
|
const SPOT_ELEMENT_TAG = 'spot-element';
|
15155
15155
|
const SPOT_ELEMENT_SLOT_NAME = `${SPOT_ELEMENT_TAG}-custom-content`;
|
15156
15156
|
const SPOTS_SELECTION_API_PATH = '/spots/selection';
|
15157
|
-
const SPOT_EVENT_API_PATH = '/spots/event';
|
15158
15157
|
|
15159
|
-
const
|
15158
|
+
const GFONT_PRECONNECT = `
|
15159
|
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
15160
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
15161
|
+
`;
|
15162
|
+
const GFONT_SOURCE_SANS_3 = `
|
15163
|
+
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Source+Sans+3:ital,wght@0,200..900;1,200..900&display=swap">
|
15164
|
+
`;
|
15165
|
+
const GFONT_CORMORANT = `
|
15166
|
+
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Cormorant:ital,wght@0,300..700;1,300..700&family=Source+Sans+3:ital,wght@0,200..900;1,200..900&display=swap">
|
15167
|
+
`;
|
15168
|
+
const SPOT_ELEMENT_TEMPLATE = (width, height, hasCustomContent) => {
|
15160
15169
|
const style = document.createElement('style');
|
15161
15170
|
style.textContent = `
|
15162
15171
|
:host {
|
@@ -15193,21 +15202,6 @@ const SPOT_ELEMENT_SHADOW_ROOT = (width, height, hasCustomContent) => {
|
|
15193
15202
|
return { style, wrapper, slot };
|
15194
15203
|
};
|
15195
15204
|
|
15196
|
-
const GFONT_PRECONNECT = () => `
|
15197
|
-
<link rel="preconnect" href="https://fonts.googleapis.com">
|
15198
|
-
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
15199
|
-
`;
|
15200
|
-
const GFONT_SOURCE_SANS_3 = () => `
|
15201
|
-
<link rel="stylesheet"
|
15202
|
-
href="https://fonts.googleapis.com/css2?family=Source+Sans+3:ital,wght@0,200..900;1,200..900&display=swap"
|
15203
|
-
>
|
15204
|
-
`;
|
15205
|
-
const GFONT_CORMORANT = () => `
|
15206
|
-
<link rel="stylesheet"
|
15207
|
-
href="https://fonts.googleapis.com/css2?family=Cormorant:ital,wght@0,300..700;1,300..700&family=Source+Sans+3:ital,wght@0,200..900;1,200..900&display=swap"
|
15208
|
-
>
|
15209
|
-
`;
|
15210
|
-
|
15211
15205
|
const STYLES$i = ({ primaryImage, secondaryImage }) => `
|
15212
15206
|
<style>
|
15213
15207
|
.content {
|
@@ -15303,9 +15297,9 @@ const STYLES$i = ({ primaryImage, secondaryImage }) => `
|
|
15303
15297
|
`;
|
15304
15298
|
function billboardV1Template(spot) {
|
15305
15299
|
return `
|
15306
|
-
${GFONT_PRECONNECT
|
15307
|
-
${GFONT_SOURCE_SANS_3
|
15308
|
-
${GFONT_CORMORANT
|
15300
|
+
${GFONT_PRECONNECT}
|
15301
|
+
${GFONT_SOURCE_SANS_3}
|
15302
|
+
${GFONT_CORMORANT}
|
15309
15303
|
${STYLES$i(spot)}
|
15310
15304
|
<div class="content">
|
15311
15305
|
<div class="big-image"></div>
|
@@ -15392,9 +15386,9 @@ const STYLES$h = ({ primaryImage }) => `
|
|
15392
15386
|
`;
|
15393
15387
|
function billboardV2Template(spot) {
|
15394
15388
|
return `
|
15395
|
-
${GFONT_PRECONNECT
|
15396
|
-
${GFONT_SOURCE_SANS_3
|
15397
|
-
${GFONT_CORMORANT
|
15389
|
+
${GFONT_PRECONNECT}
|
15390
|
+
${GFONT_SOURCE_SANS_3}
|
15391
|
+
${GFONT_CORMORANT}
|
15398
15392
|
${STYLES$h(spot)}
|
15399
15393
|
<div class="content">
|
15400
15394
|
<div class="text-container">
|
@@ -15493,9 +15487,9 @@ const STYLES$g = ({ primaryImage }) => `
|
|
15493
15487
|
`;
|
15494
15488
|
function billboardV3Template(spot) {
|
15495
15489
|
return `
|
15496
|
-
${GFONT_PRECONNECT
|
15497
|
-
${GFONT_SOURCE_SANS_3
|
15498
|
-
${GFONT_CORMORANT
|
15490
|
+
${GFONT_PRECONNECT}
|
15491
|
+
${GFONT_SOURCE_SANS_3}
|
15492
|
+
${GFONT_CORMORANT}
|
15499
15493
|
${STYLES$g(spot)}
|
15500
15494
|
<div class="content">
|
15501
15495
|
<div class="text">
|
@@ -15537,9 +15531,9 @@ const STYLES$f = () => `
|
|
15537
15531
|
`;
|
15538
15532
|
function inTextV1Template(spot) {
|
15539
15533
|
return `
|
15540
|
-
${GFONT_PRECONNECT
|
15541
|
-
${GFONT_SOURCE_SANS_3
|
15542
|
-
${GFONT_CORMORANT
|
15534
|
+
${GFONT_PRECONNECT}
|
15535
|
+
${GFONT_SOURCE_SANS_3}
|
15536
|
+
${GFONT_CORMORANT}
|
15543
15537
|
${STYLES$f()}
|
15544
15538
|
<div class="content">
|
15545
15539
|
<span class="header">${spot.header}</span>
|
@@ -15627,9 +15621,9 @@ const STYLES$e = ({ primaryImage }) => `
|
|
15627
15621
|
`;
|
15628
15622
|
function largeLeaderboardV1Template(spot) {
|
15629
15623
|
return `
|
15630
|
-
${GFONT_PRECONNECT
|
15631
|
-
${GFONT_SOURCE_SANS_3
|
15632
|
-
${GFONT_CORMORANT
|
15624
|
+
${GFONT_PRECONNECT}
|
15625
|
+
${GFONT_SOURCE_SANS_3}
|
15626
|
+
${GFONT_CORMORANT}
|
15633
15627
|
${STYLES$e(spot)}
|
15634
15628
|
<div class="content">
|
15635
15629
|
<div class="text">
|
@@ -15714,9 +15708,9 @@ const STYLES$d = ({ primaryImage }) => `
|
|
15714
15708
|
`;
|
15715
15709
|
function largeLeaderboardV2Template(spot) {
|
15716
15710
|
return `
|
15717
|
-
${GFONT_PRECONNECT
|
15718
|
-
${GFONT_SOURCE_SANS_3
|
15719
|
-
${GFONT_CORMORANT
|
15711
|
+
${GFONT_PRECONNECT}
|
15712
|
+
${GFONT_SOURCE_SANS_3}
|
15713
|
+
${GFONT_CORMORANT}
|
15720
15714
|
${STYLES$d(spot)}
|
15721
15715
|
<div class="content">
|
15722
15716
|
<div class="text">
|
@@ -15773,9 +15767,9 @@ const STYLES$c = ({ primaryImage }) => `
|
|
15773
15767
|
`;
|
15774
15768
|
function largeRectangleV1Template(spot) {
|
15775
15769
|
return `
|
15776
|
-
${GFONT_PRECONNECT
|
15777
|
-
${GFONT_SOURCE_SANS_3
|
15778
|
-
${GFONT_CORMORANT
|
15770
|
+
${GFONT_PRECONNECT}
|
15771
|
+
${GFONT_SOURCE_SANS_3}
|
15772
|
+
${GFONT_CORMORANT}
|
15779
15773
|
${STYLES$c(spot)}
|
15780
15774
|
<div class="content">
|
15781
15775
|
<div class="image"></div>
|
@@ -15871,9 +15865,9 @@ const STYLES$b = ({ primaryImage }) => `
|
|
15871
15865
|
`;
|
15872
15866
|
function squareV1Template(spot) {
|
15873
15867
|
return `
|
15874
|
-
${GFONT_PRECONNECT
|
15875
|
-
${GFONT_SOURCE_SANS_3
|
15876
|
-
${GFONT_CORMORANT
|
15868
|
+
${GFONT_PRECONNECT}
|
15869
|
+
${GFONT_SOURCE_SANS_3}
|
15870
|
+
${GFONT_CORMORANT}
|
15877
15871
|
${STYLES$b(spot)}
|
15878
15872
|
<div class="content">
|
15879
15873
|
<div class="text">
|
@@ -15926,9 +15920,9 @@ const STYLES$a = ({ primaryImage }) => `
|
|
15926
15920
|
`;
|
15927
15921
|
function squareV2Template(spot) {
|
15928
15922
|
return `
|
15929
|
-
${GFONT_PRECONNECT
|
15930
|
-
${GFONT_SOURCE_SANS_3
|
15931
|
-
${GFONT_CORMORANT
|
15923
|
+
${GFONT_PRECONNECT}
|
15924
|
+
${GFONT_SOURCE_SANS_3}
|
15925
|
+
${GFONT_CORMORANT}
|
15932
15926
|
${STYLES$a(spot)}
|
15933
15927
|
<div class="content">
|
15934
15928
|
<span class="header">${spot.header}</span>
|
@@ -15991,9 +15985,9 @@ const STYLES$9 = ({ primaryImage }) => `
|
|
15991
15985
|
`;
|
15992
15986
|
function verticalRectangleV1Template(spot) {
|
15993
15987
|
return `
|
15994
|
-
${GFONT_PRECONNECT
|
15995
|
-
${GFONT_SOURCE_SANS_3
|
15996
|
-
${GFONT_CORMORANT
|
15988
|
+
${GFONT_PRECONNECT}
|
15989
|
+
${GFONT_SOURCE_SANS_3}
|
15990
|
+
${GFONT_CORMORANT}
|
15997
15991
|
${STYLES$9(spot)}
|
15998
15992
|
<div class="content">
|
15999
15993
|
<div class="text">
|
@@ -16173,9 +16167,9 @@ const STYLES$6 = ({ textColor = '#ffffff', ctaTextColor = textColor, ctaBorderCo
|
|
16173
16167
|
`;
|
16174
16168
|
function rbHomepageHeroFullImageTemplate(spot) {
|
16175
16169
|
return `
|
16176
|
-
${GFONT_PRECONNECT
|
16177
|
-
${GFONT_SOURCE_SANS_3
|
16178
|
-
${GFONT_CORMORANT
|
16170
|
+
${GFONT_PRECONNECT}
|
16171
|
+
${GFONT_SOURCE_SANS_3}
|
16172
|
+
${GFONT_CORMORANT}
|
16179
16173
|
${STYLES$6(spot)}
|
16180
16174
|
<div class="content">
|
16181
16175
|
<div class="text">
|
@@ -16340,9 +16334,9 @@ const STYLES$5 = ({ textColor = '#212121', backgroundColor = '#e8e6de', ctaTextC
|
|
16340
16334
|
`;
|
16341
16335
|
function rbHomepageHeroThreeTileTemplate(spot) {
|
16342
16336
|
return `
|
16343
|
-
${GFONT_PRECONNECT
|
16344
|
-
${GFONT_SOURCE_SANS_3
|
16345
|
-
${GFONT_CORMORANT
|
16337
|
+
${GFONT_PRECONNECT}
|
16338
|
+
${GFONT_SOURCE_SANS_3}
|
16339
|
+
${GFONT_CORMORANT}
|
16346
16340
|
${STYLES$5(spot)}
|
16347
16341
|
<div class="content">
|
16348
16342
|
<div class="primary-image"></div>
|
@@ -16483,9 +16477,9 @@ const STYLES$4 = ({ textColor = '#212121', backgroundColor = '#e8e6de', ctaTextC
|
|
16483
16477
|
`;
|
16484
16478
|
function rbHomepageHeroTwoTileTemplate(spot) {
|
16485
16479
|
return `
|
16486
|
-
${GFONT_PRECONNECT
|
16487
|
-
${GFONT_SOURCE_SANS_3
|
16488
|
-
${GFONT_CORMORANT
|
16480
|
+
${GFONT_PRECONNECT}
|
16481
|
+
${GFONT_SOURCE_SANS_3}
|
16482
|
+
${GFONT_CORMORANT}
|
16489
16483
|
${STYLES$4(spot)}
|
16490
16484
|
<div class="content">
|
16491
16485
|
<div class="text">
|
@@ -16605,9 +16599,9 @@ const STYLES$3 = ({ textColor = '#ffffff', ctaTextColor = textColor, ctaBorderCo
|
|
16605
16599
|
`;
|
16606
16600
|
function rbLargeCategoryImageToutTemplate(spot) {
|
16607
16601
|
return `
|
16608
|
-
${GFONT_PRECONNECT
|
16609
|
-
${GFONT_SOURCE_SANS_3
|
16610
|
-
${GFONT_CORMORANT
|
16602
|
+
${GFONT_PRECONNECT}
|
16603
|
+
${GFONT_SOURCE_SANS_3}
|
16604
|
+
${GFONT_CORMORANT}
|
16611
16605
|
${STYLES$3(spot)}
|
16612
16606
|
<div class="content">
|
16613
16607
|
<div class="text">
|
@@ -16677,8 +16671,8 @@ const STYLES$2 = ({ textColor = '#ffffff', primaryImage, mobilePrimaryImage = pr
|
|
16677
16671
|
`;
|
16678
16672
|
function rbNavigationBannerTemplate(spot) {
|
16679
16673
|
return `
|
16680
|
-
${GFONT_PRECONNECT
|
16681
|
-
${GFONT_SOURCE_SANS_3
|
16674
|
+
${GFONT_PRECONNECT}
|
16675
|
+
${GFONT_SOURCE_SANS_3}
|
16682
16676
|
${STYLES$2(spot)}
|
16683
16677
|
<div class="content">
|
16684
16678
|
<div class="text">
|
@@ -16720,6 +16714,7 @@ const STYLES$1 = ({ textColor = '#ffffff', primaryImage, mobilePrimaryImage = pr
|
|
16720
16714
|
font-style: normal;
|
16721
16715
|
font-weight: 400;
|
16722
16716
|
line-height: normal;
|
16717
|
+
margin: 0;
|
16723
16718
|
}
|
16724
16719
|
@media (min-width: 640px) {
|
16725
16720
|
.content {
|
@@ -16730,8 +16725,8 @@ const STYLES$1 = ({ textColor = '#ffffff', primaryImage, mobilePrimaryImage = pr
|
|
16730
16725
|
`;
|
16731
16726
|
function rbSmallCategoryImageToutTemplate(spot) {
|
16732
16727
|
return `
|
16733
|
-
${GFONT_PRECONNECT
|
16734
|
-
${GFONT_CORMORANT
|
16728
|
+
${GFONT_PRECONNECT}
|
16729
|
+
${GFONT_CORMORANT}
|
16735
16730
|
${STYLES$1(spot)}
|
16736
16731
|
<div class="content">
|
16737
16732
|
<div class="text">
|
@@ -16784,6 +16779,7 @@ const STYLES = ({ textColor = '#000000', backgroundColor = 'transparent', primar
|
|
16784
16779
|
font-style: normal;
|
16785
16780
|
font-weight: 400;
|
16786
16781
|
line-height: normal;
|
16782
|
+
margin: 0;
|
16787
16783
|
}
|
16788
16784
|
@media (min-width: 640px) {
|
16789
16785
|
.image {
|
@@ -16794,8 +16790,8 @@ const STYLES = ({ textColor = '#000000', backgroundColor = 'transparent', primar
|
|
16794
16790
|
`;
|
16795
16791
|
function rbSmallDiscoverToutTemplate(spot) {
|
16796
16792
|
return `
|
16797
|
-
${GFONT_PRECONNECT
|
16798
|
-
${GFONT_CORMORANT
|
16793
|
+
${GFONT_PRECONNECT}
|
16794
|
+
${GFONT_CORMORANT}
|
16799
16795
|
${STYLES(spot)}
|
16800
16796
|
<div class="content">
|
16801
16797
|
<div class="image"></div>
|
@@ -16914,7 +16910,7 @@ if (typeof window !== 'undefined' && typeof window.customElements !== 'undefined
|
|
16914
16910
|
render() {
|
16915
16911
|
if (!this.shadowRoot || !this.data)
|
16916
16912
|
return;
|
16917
|
-
const { style, wrapper, slot } =
|
16913
|
+
const { style, wrapper, slot } = SPOT_ELEMENT_TEMPLATE(this.data.width, this.data.height, this.hasCustomContent);
|
16918
16914
|
this.shadowRoot.replaceChildren(style, slot);
|
16919
16915
|
if (this.hasCustomContent) {
|
16920
16916
|
this.setCustomContent();
|
@@ -16964,22 +16960,15 @@ if (typeof window !== 'undefined' && typeof window.customElements !== 'undefined
|
|
16964
16960
|
method: 'POST',
|
16965
16961
|
redirect: event === exports.RMN_SPOT_EVENT.CLICK && shouldRedirectOnClick ? 'follow' : 'manual',
|
16966
16962
|
};
|
16967
|
-
const
|
16968
|
-
const response = await fetch(normalizedUrl, options);
|
16963
|
+
const response = await fetch(eventUrl, options);
|
16969
16964
|
if (response.ok && event === exports.RMN_SPOT_EVENT.CLICK && shouldRedirectOnClick) {
|
16970
|
-
window.location.href = this.getRedirectUrlFromPayload(
|
16965
|
+
window.location.href = this.getRedirectUrlFromPayload(eventUrl);
|
16971
16966
|
}
|
16972
16967
|
}
|
16973
16968
|
catch (error) {
|
16974
16969
|
console.error(`Rmn error sending ${event} event:`, error);
|
16975
16970
|
}
|
16976
16971
|
}
|
16977
|
-
normalizeUrl(url) {
|
16978
|
-
if (!this.data)
|
16979
|
-
return url;
|
16980
|
-
const rmnUrl = `${SDK_CONFIG.url[this.data.env]}/api${SPOT_EVENT_API_PATH}`;
|
16981
|
-
return url.replace(/https?:\/\/[^/]+\/[^?]+/, `${rmnUrl}`);
|
16982
|
-
}
|
16983
16972
|
getRedirectUrlFromPayload(url) {
|
16984
16973
|
var _a, _b;
|
16985
16974
|
const base64String = (_a = new URL(url).searchParams.get('e')) !== null && _a !== void 0 ? _a : '';
|
@@ -17070,22 +17059,10 @@ class SpotSelectionService extends BaseApi {
|
|
17070
17059
|
if (isOk && val && val.data && (val === null || val === void 0 ? void 0 : val.refresh.token)) {
|
17071
17060
|
this.authInfo.authenticated = true;
|
17072
17061
|
this.authInfo.token = val.refresh.token;
|
17073
|
-
|
17074
|
-
spots = this.addEnvToSpotData(spots, this.authInfo.env);
|
17075
|
-
return spots;
|
17062
|
+
return val.data.spots;
|
17076
17063
|
}
|
17077
17064
|
throw new Error('Spot selection response was not successful');
|
17078
17065
|
}
|
17079
|
-
addEnvToSpotData(spots, env) {
|
17080
|
-
for (const key in spots) {
|
17081
|
-
if (spots[key]) {
|
17082
|
-
spots[key].forEach((spot) => {
|
17083
|
-
spot.env = env;
|
17084
|
-
});
|
17085
|
-
}
|
17086
|
-
}
|
17087
|
-
return spots;
|
17088
|
-
}
|
17089
17066
|
}
|
17090
17067
|
|
17091
17068
|
class LiquidCommerceRmnClient {
|
package/dist/index.esm.js
CHANGED
@@ -15152,9 +15152,18 @@ class AuthService extends BaseApi {
|
|
15152
15152
|
const SPOT_ELEMENT_TAG = 'spot-element';
|
15153
15153
|
const SPOT_ELEMENT_SLOT_NAME = `${SPOT_ELEMENT_TAG}-custom-content`;
|
15154
15154
|
const SPOTS_SELECTION_API_PATH = '/spots/selection';
|
15155
|
-
const SPOT_EVENT_API_PATH = '/spots/event';
|
15156
15155
|
|
15157
|
-
const
|
15156
|
+
const GFONT_PRECONNECT = `
|
15157
|
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
15158
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
15159
|
+
`;
|
15160
|
+
const GFONT_SOURCE_SANS_3 = `
|
15161
|
+
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Source+Sans+3:ital,wght@0,200..900;1,200..900&display=swap">
|
15162
|
+
`;
|
15163
|
+
const GFONT_CORMORANT = `
|
15164
|
+
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Cormorant:ital,wght@0,300..700;1,300..700&family=Source+Sans+3:ital,wght@0,200..900;1,200..900&display=swap">
|
15165
|
+
`;
|
15166
|
+
const SPOT_ELEMENT_TEMPLATE = (width, height, hasCustomContent) => {
|
15158
15167
|
const style = document.createElement('style');
|
15159
15168
|
style.textContent = `
|
15160
15169
|
:host {
|
@@ -15191,21 +15200,6 @@ const SPOT_ELEMENT_SHADOW_ROOT = (width, height, hasCustomContent) => {
|
|
15191
15200
|
return { style, wrapper, slot };
|
15192
15201
|
};
|
15193
15202
|
|
15194
|
-
const GFONT_PRECONNECT = () => `
|
15195
|
-
<link rel="preconnect" href="https://fonts.googleapis.com">
|
15196
|
-
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
15197
|
-
`;
|
15198
|
-
const GFONT_SOURCE_SANS_3 = () => `
|
15199
|
-
<link rel="stylesheet"
|
15200
|
-
href="https://fonts.googleapis.com/css2?family=Source+Sans+3:ital,wght@0,200..900;1,200..900&display=swap"
|
15201
|
-
>
|
15202
|
-
`;
|
15203
|
-
const GFONT_CORMORANT = () => `
|
15204
|
-
<link rel="stylesheet"
|
15205
|
-
href="https://fonts.googleapis.com/css2?family=Cormorant:ital,wght@0,300..700;1,300..700&family=Source+Sans+3:ital,wght@0,200..900;1,200..900&display=swap"
|
15206
|
-
>
|
15207
|
-
`;
|
15208
|
-
|
15209
15203
|
const STYLES$i = ({ primaryImage, secondaryImage }) => `
|
15210
15204
|
<style>
|
15211
15205
|
.content {
|
@@ -15301,9 +15295,9 @@ const STYLES$i = ({ primaryImage, secondaryImage }) => `
|
|
15301
15295
|
`;
|
15302
15296
|
function billboardV1Template(spot) {
|
15303
15297
|
return `
|
15304
|
-
${GFONT_PRECONNECT
|
15305
|
-
${GFONT_SOURCE_SANS_3
|
15306
|
-
${GFONT_CORMORANT
|
15298
|
+
${GFONT_PRECONNECT}
|
15299
|
+
${GFONT_SOURCE_SANS_3}
|
15300
|
+
${GFONT_CORMORANT}
|
15307
15301
|
${STYLES$i(spot)}
|
15308
15302
|
<div class="content">
|
15309
15303
|
<div class="big-image"></div>
|
@@ -15390,9 +15384,9 @@ const STYLES$h = ({ primaryImage }) => `
|
|
15390
15384
|
`;
|
15391
15385
|
function billboardV2Template(spot) {
|
15392
15386
|
return `
|
15393
|
-
${GFONT_PRECONNECT
|
15394
|
-
${GFONT_SOURCE_SANS_3
|
15395
|
-
${GFONT_CORMORANT
|
15387
|
+
${GFONT_PRECONNECT}
|
15388
|
+
${GFONT_SOURCE_SANS_3}
|
15389
|
+
${GFONT_CORMORANT}
|
15396
15390
|
${STYLES$h(spot)}
|
15397
15391
|
<div class="content">
|
15398
15392
|
<div class="text-container">
|
@@ -15491,9 +15485,9 @@ const STYLES$g = ({ primaryImage }) => `
|
|
15491
15485
|
`;
|
15492
15486
|
function billboardV3Template(spot) {
|
15493
15487
|
return `
|
15494
|
-
${GFONT_PRECONNECT
|
15495
|
-
${GFONT_SOURCE_SANS_3
|
15496
|
-
${GFONT_CORMORANT
|
15488
|
+
${GFONT_PRECONNECT}
|
15489
|
+
${GFONT_SOURCE_SANS_3}
|
15490
|
+
${GFONT_CORMORANT}
|
15497
15491
|
${STYLES$g(spot)}
|
15498
15492
|
<div class="content">
|
15499
15493
|
<div class="text">
|
@@ -15535,9 +15529,9 @@ const STYLES$f = () => `
|
|
15535
15529
|
`;
|
15536
15530
|
function inTextV1Template(spot) {
|
15537
15531
|
return `
|
15538
|
-
${GFONT_PRECONNECT
|
15539
|
-
${GFONT_SOURCE_SANS_3
|
15540
|
-
${GFONT_CORMORANT
|
15532
|
+
${GFONT_PRECONNECT}
|
15533
|
+
${GFONT_SOURCE_SANS_3}
|
15534
|
+
${GFONT_CORMORANT}
|
15541
15535
|
${STYLES$f()}
|
15542
15536
|
<div class="content">
|
15543
15537
|
<span class="header">${spot.header}</span>
|
@@ -15625,9 +15619,9 @@ const STYLES$e = ({ primaryImage }) => `
|
|
15625
15619
|
`;
|
15626
15620
|
function largeLeaderboardV1Template(spot) {
|
15627
15621
|
return `
|
15628
|
-
${GFONT_PRECONNECT
|
15629
|
-
${GFONT_SOURCE_SANS_3
|
15630
|
-
${GFONT_CORMORANT
|
15622
|
+
${GFONT_PRECONNECT}
|
15623
|
+
${GFONT_SOURCE_SANS_3}
|
15624
|
+
${GFONT_CORMORANT}
|
15631
15625
|
${STYLES$e(spot)}
|
15632
15626
|
<div class="content">
|
15633
15627
|
<div class="text">
|
@@ -15712,9 +15706,9 @@ const STYLES$d = ({ primaryImage }) => `
|
|
15712
15706
|
`;
|
15713
15707
|
function largeLeaderboardV2Template(spot) {
|
15714
15708
|
return `
|
15715
|
-
${GFONT_PRECONNECT
|
15716
|
-
${GFONT_SOURCE_SANS_3
|
15717
|
-
${GFONT_CORMORANT
|
15709
|
+
${GFONT_PRECONNECT}
|
15710
|
+
${GFONT_SOURCE_SANS_3}
|
15711
|
+
${GFONT_CORMORANT}
|
15718
15712
|
${STYLES$d(spot)}
|
15719
15713
|
<div class="content">
|
15720
15714
|
<div class="text">
|
@@ -15771,9 +15765,9 @@ const STYLES$c = ({ primaryImage }) => `
|
|
15771
15765
|
`;
|
15772
15766
|
function largeRectangleV1Template(spot) {
|
15773
15767
|
return `
|
15774
|
-
${GFONT_PRECONNECT
|
15775
|
-
${GFONT_SOURCE_SANS_3
|
15776
|
-
${GFONT_CORMORANT
|
15768
|
+
${GFONT_PRECONNECT}
|
15769
|
+
${GFONT_SOURCE_SANS_3}
|
15770
|
+
${GFONT_CORMORANT}
|
15777
15771
|
${STYLES$c(spot)}
|
15778
15772
|
<div class="content">
|
15779
15773
|
<div class="image"></div>
|
@@ -15869,9 +15863,9 @@ const STYLES$b = ({ primaryImage }) => `
|
|
15869
15863
|
`;
|
15870
15864
|
function squareV1Template(spot) {
|
15871
15865
|
return `
|
15872
|
-
${GFONT_PRECONNECT
|
15873
|
-
${GFONT_SOURCE_SANS_3
|
15874
|
-
${GFONT_CORMORANT
|
15866
|
+
${GFONT_PRECONNECT}
|
15867
|
+
${GFONT_SOURCE_SANS_3}
|
15868
|
+
${GFONT_CORMORANT}
|
15875
15869
|
${STYLES$b(spot)}
|
15876
15870
|
<div class="content">
|
15877
15871
|
<div class="text">
|
@@ -15924,9 +15918,9 @@ const STYLES$a = ({ primaryImage }) => `
|
|
15924
15918
|
`;
|
15925
15919
|
function squareV2Template(spot) {
|
15926
15920
|
return `
|
15927
|
-
${GFONT_PRECONNECT
|
15928
|
-
${GFONT_SOURCE_SANS_3
|
15929
|
-
${GFONT_CORMORANT
|
15921
|
+
${GFONT_PRECONNECT}
|
15922
|
+
${GFONT_SOURCE_SANS_3}
|
15923
|
+
${GFONT_CORMORANT}
|
15930
15924
|
${STYLES$a(spot)}
|
15931
15925
|
<div class="content">
|
15932
15926
|
<span class="header">${spot.header}</span>
|
@@ -15989,9 +15983,9 @@ const STYLES$9 = ({ primaryImage }) => `
|
|
15989
15983
|
`;
|
15990
15984
|
function verticalRectangleV1Template(spot) {
|
15991
15985
|
return `
|
15992
|
-
${GFONT_PRECONNECT
|
15993
|
-
${GFONT_SOURCE_SANS_3
|
15994
|
-
${GFONT_CORMORANT
|
15986
|
+
${GFONT_PRECONNECT}
|
15987
|
+
${GFONT_SOURCE_SANS_3}
|
15988
|
+
${GFONT_CORMORANT}
|
15995
15989
|
${STYLES$9(spot)}
|
15996
15990
|
<div class="content">
|
15997
15991
|
<div class="text">
|
@@ -16171,9 +16165,9 @@ const STYLES$6 = ({ textColor = '#ffffff', ctaTextColor = textColor, ctaBorderCo
|
|
16171
16165
|
`;
|
16172
16166
|
function rbHomepageHeroFullImageTemplate(spot) {
|
16173
16167
|
return `
|
16174
|
-
${GFONT_PRECONNECT
|
16175
|
-
${GFONT_SOURCE_SANS_3
|
16176
|
-
${GFONT_CORMORANT
|
16168
|
+
${GFONT_PRECONNECT}
|
16169
|
+
${GFONT_SOURCE_SANS_3}
|
16170
|
+
${GFONT_CORMORANT}
|
16177
16171
|
${STYLES$6(spot)}
|
16178
16172
|
<div class="content">
|
16179
16173
|
<div class="text">
|
@@ -16338,9 +16332,9 @@ const STYLES$5 = ({ textColor = '#212121', backgroundColor = '#e8e6de', ctaTextC
|
|
16338
16332
|
`;
|
16339
16333
|
function rbHomepageHeroThreeTileTemplate(spot) {
|
16340
16334
|
return `
|
16341
|
-
${GFONT_PRECONNECT
|
16342
|
-
${GFONT_SOURCE_SANS_3
|
16343
|
-
${GFONT_CORMORANT
|
16335
|
+
${GFONT_PRECONNECT}
|
16336
|
+
${GFONT_SOURCE_SANS_3}
|
16337
|
+
${GFONT_CORMORANT}
|
16344
16338
|
${STYLES$5(spot)}
|
16345
16339
|
<div class="content">
|
16346
16340
|
<div class="primary-image"></div>
|
@@ -16481,9 +16475,9 @@ const STYLES$4 = ({ textColor = '#212121', backgroundColor = '#e8e6de', ctaTextC
|
|
16481
16475
|
`;
|
16482
16476
|
function rbHomepageHeroTwoTileTemplate(spot) {
|
16483
16477
|
return `
|
16484
|
-
${GFONT_PRECONNECT
|
16485
|
-
${GFONT_SOURCE_SANS_3
|
16486
|
-
${GFONT_CORMORANT
|
16478
|
+
${GFONT_PRECONNECT}
|
16479
|
+
${GFONT_SOURCE_SANS_3}
|
16480
|
+
${GFONT_CORMORANT}
|
16487
16481
|
${STYLES$4(spot)}
|
16488
16482
|
<div class="content">
|
16489
16483
|
<div class="text">
|
@@ -16603,9 +16597,9 @@ const STYLES$3 = ({ textColor = '#ffffff', ctaTextColor = textColor, ctaBorderCo
|
|
16603
16597
|
`;
|
16604
16598
|
function rbLargeCategoryImageToutTemplate(spot) {
|
16605
16599
|
return `
|
16606
|
-
${GFONT_PRECONNECT
|
16607
|
-
${GFONT_SOURCE_SANS_3
|
16608
|
-
${GFONT_CORMORANT
|
16600
|
+
${GFONT_PRECONNECT}
|
16601
|
+
${GFONT_SOURCE_SANS_3}
|
16602
|
+
${GFONT_CORMORANT}
|
16609
16603
|
${STYLES$3(spot)}
|
16610
16604
|
<div class="content">
|
16611
16605
|
<div class="text">
|
@@ -16675,8 +16669,8 @@ const STYLES$2 = ({ textColor = '#ffffff', primaryImage, mobilePrimaryImage = pr
|
|
16675
16669
|
`;
|
16676
16670
|
function rbNavigationBannerTemplate(spot) {
|
16677
16671
|
return `
|
16678
|
-
${GFONT_PRECONNECT
|
16679
|
-
${GFONT_SOURCE_SANS_3
|
16672
|
+
${GFONT_PRECONNECT}
|
16673
|
+
${GFONT_SOURCE_SANS_3}
|
16680
16674
|
${STYLES$2(spot)}
|
16681
16675
|
<div class="content">
|
16682
16676
|
<div class="text">
|
@@ -16718,6 +16712,7 @@ const STYLES$1 = ({ textColor = '#ffffff', primaryImage, mobilePrimaryImage = pr
|
|
16718
16712
|
font-style: normal;
|
16719
16713
|
font-weight: 400;
|
16720
16714
|
line-height: normal;
|
16715
|
+
margin: 0;
|
16721
16716
|
}
|
16722
16717
|
@media (min-width: 640px) {
|
16723
16718
|
.content {
|
@@ -16728,8 +16723,8 @@ const STYLES$1 = ({ textColor = '#ffffff', primaryImage, mobilePrimaryImage = pr
|
|
16728
16723
|
`;
|
16729
16724
|
function rbSmallCategoryImageToutTemplate(spot) {
|
16730
16725
|
return `
|
16731
|
-
${GFONT_PRECONNECT
|
16732
|
-
${GFONT_CORMORANT
|
16726
|
+
${GFONT_PRECONNECT}
|
16727
|
+
${GFONT_CORMORANT}
|
16733
16728
|
${STYLES$1(spot)}
|
16734
16729
|
<div class="content">
|
16735
16730
|
<div class="text">
|
@@ -16782,6 +16777,7 @@ const STYLES = ({ textColor = '#000000', backgroundColor = 'transparent', primar
|
|
16782
16777
|
font-style: normal;
|
16783
16778
|
font-weight: 400;
|
16784
16779
|
line-height: normal;
|
16780
|
+
margin: 0;
|
16785
16781
|
}
|
16786
16782
|
@media (min-width: 640px) {
|
16787
16783
|
.image {
|
@@ -16792,8 +16788,8 @@ const STYLES = ({ textColor = '#000000', backgroundColor = 'transparent', primar
|
|
16792
16788
|
`;
|
16793
16789
|
function rbSmallDiscoverToutTemplate(spot) {
|
16794
16790
|
return `
|
16795
|
-
${GFONT_PRECONNECT
|
16796
|
-
${GFONT_CORMORANT
|
16791
|
+
${GFONT_PRECONNECT}
|
16792
|
+
${GFONT_CORMORANT}
|
16797
16793
|
${STYLES(spot)}
|
16798
16794
|
<div class="content">
|
16799
16795
|
<div class="image"></div>
|
@@ -16912,7 +16908,7 @@ if (typeof window !== 'undefined' && typeof window.customElements !== 'undefined
|
|
16912
16908
|
render() {
|
16913
16909
|
if (!this.shadowRoot || !this.data)
|
16914
16910
|
return;
|
16915
|
-
const { style, wrapper, slot } =
|
16911
|
+
const { style, wrapper, slot } = SPOT_ELEMENT_TEMPLATE(this.data.width, this.data.height, this.hasCustomContent);
|
16916
16912
|
this.shadowRoot.replaceChildren(style, slot);
|
16917
16913
|
if (this.hasCustomContent) {
|
16918
16914
|
this.setCustomContent();
|
@@ -16962,22 +16958,15 @@ if (typeof window !== 'undefined' && typeof window.customElements !== 'undefined
|
|
16962
16958
|
method: 'POST',
|
16963
16959
|
redirect: event === RMN_SPOT_EVENT.CLICK && shouldRedirectOnClick ? 'follow' : 'manual',
|
16964
16960
|
};
|
16965
|
-
const
|
16966
|
-
const response = await fetch(normalizedUrl, options);
|
16961
|
+
const response = await fetch(eventUrl, options);
|
16967
16962
|
if (response.ok && event === RMN_SPOT_EVENT.CLICK && shouldRedirectOnClick) {
|
16968
|
-
window.location.href = this.getRedirectUrlFromPayload(
|
16963
|
+
window.location.href = this.getRedirectUrlFromPayload(eventUrl);
|
16969
16964
|
}
|
16970
16965
|
}
|
16971
16966
|
catch (error) {
|
16972
16967
|
console.error(`Rmn error sending ${event} event:`, error);
|
16973
16968
|
}
|
16974
16969
|
}
|
16975
|
-
normalizeUrl(url) {
|
16976
|
-
if (!this.data)
|
16977
|
-
return url;
|
16978
|
-
const rmnUrl = `${SDK_CONFIG.url[this.data.env]}/api${SPOT_EVENT_API_PATH}`;
|
16979
|
-
return url.replace(/https?:\/\/[^/]+\/[^?]+/, `${rmnUrl}`);
|
16980
|
-
}
|
16981
16970
|
getRedirectUrlFromPayload(url) {
|
16982
16971
|
var _a, _b;
|
16983
16972
|
const base64String = (_a = new URL(url).searchParams.get('e')) !== null && _a !== void 0 ? _a : '';
|
@@ -17068,22 +17057,10 @@ class SpotSelectionService extends BaseApi {
|
|
17068
17057
|
if (isOk && val && val.data && (val === null || val === void 0 ? void 0 : val.refresh.token)) {
|
17069
17058
|
this.authInfo.authenticated = true;
|
17070
17059
|
this.authInfo.token = val.refresh.token;
|
17071
|
-
|
17072
|
-
spots = this.addEnvToSpotData(spots, this.authInfo.env);
|
17073
|
-
return spots;
|
17060
|
+
return val.data.spots;
|
17074
17061
|
}
|
17075
17062
|
throw new Error('Spot selection response was not successful');
|
17076
17063
|
}
|
17077
|
-
addEnvToSpotData(spots, env) {
|
17078
|
-
for (const key in spots) {
|
17079
|
-
if (spots[key]) {
|
17080
|
-
spots[key].forEach((spot) => {
|
17081
|
-
spot.env = env;
|
17082
|
-
});
|
17083
|
-
}
|
17084
|
-
}
|
17085
|
-
return spots;
|
17086
|
-
}
|
17087
17064
|
}
|
17088
17065
|
|
17089
17066
|
class LiquidCommerceRmnClient {
|
@@ -0,0 +1,8 @@
|
|
1
|
+
export declare const GFONT_PRECONNECT = "\n <link rel=\"preconnect\" href=\"https://fonts.googleapis.com\">\n <link rel=\"preconnect\" href=\"https://fonts.gstatic.com\" crossorigin>\n";
|
2
|
+
export declare const GFONT_SOURCE_SANS_3 = "\n <link rel=\"stylesheet\" href=\"https://fonts.googleapis.com/css2?family=Source+Sans+3:ital,wght@0,200..900;1,200..900&display=swap\">\n";
|
3
|
+
export declare const GFONT_CORMORANT = "\n <link rel=\"stylesheet\" href=\"https://fonts.googleapis.com/css2?family=Cormorant:ital,wght@0,300..700;1,300..700&family=Source+Sans+3:ital,wght@0,200..900;1,200..900&display=swap\">\n";
|
4
|
+
export declare const SPOT_ELEMENT_TEMPLATE: (width: number, height: number, hasCustomContent: boolean) => {
|
5
|
+
style: HTMLStyleElement;
|
6
|
+
wrapper: HTMLDivElement;
|
7
|
+
slot: HTMLSlotElement;
|
8
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './html.constant';
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import type { RMN_ENV } from './../../enums';
|
2
1
|
import type { RMN_SPOT_EVENT, RMN_SPOT_TYPE } from './spot.enum';
|
3
2
|
import type { RmnFilterType, RmnSpotType, SpotIdentifierType, SpotVariantType } from './spot.type';
|
4
3
|
export interface ISpotSelectionParams {
|
@@ -29,7 +28,6 @@ export interface ISpot {
|
|
29
28
|
mobilePrimaryImage?: string;
|
30
29
|
mobileSecondaryImage?: string;
|
31
30
|
productUpcs?: string[];
|
32
|
-
env: RMN_ENV;
|
33
31
|
}
|
34
32
|
export interface ICreateSpotElementConfig {
|
35
33
|
fluid?: boolean;
|