@liquidcommercedev/rmn-sdk 1.5.0-beta.24 → 1.5.0-beta.26
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/index.cjs +146 -38
- package/dist/index.esm.js +146 -38
- package/dist/types/common/helpers/extract-deep.helper.d.ts +1 -1
- package/dist/types/enums.d.ts +2 -0
- package/dist/types/modules/element/template/reservebar/in-text.template.d.ts +3 -0
- package/dist/types/modules/element/template/reservebar/index.d.ts +2 -0
- package/dist/types/modules/element/template/reservebar/video-player.template.d.ts +3 -0
- package/dist/types/modules/monitor/monitor.interface.d.ts +1 -0
- package/dist/types/modules/selection/selection.interface.d.ts +8 -0
- package/package.json +1 -1
- package/umd/liquidcommerce-rmn-sdk.min.js +1 -1
package/dist/index.cjs
CHANGED
@@ -13,6 +13,8 @@ exports.RMN_SPOT_TYPE = void 0;
|
|
13
13
|
RMN_SPOT_TYPE["RB_COLLECTION_BANNER_WITHOUT_TEXT_BLOCK"] = "rbCollectionBannerWithoutTextBlock";
|
14
14
|
RMN_SPOT_TYPE["RB_PRODUCT_UPCS"] = "rbProductUpcs";
|
15
15
|
RMN_SPOT_TYPE["RB_NAVIGATION_BANNER"] = "rbNavigationBanner";
|
16
|
+
RMN_SPOT_TYPE["RB_VIDEO_PLAYER"] = "rbVideoPlayer";
|
17
|
+
RMN_SPOT_TYPE["RB_IN_TEXT"] = "rbInText";
|
16
18
|
// IAB Standard Spot Types
|
17
19
|
RMN_SPOT_TYPE["BILLBOARD"] = "billboard";
|
18
20
|
RMN_SPOT_TYPE["LARGE_RECTANGLE"] = "largeRectangle";
|
@@ -6159,7 +6161,7 @@ const extractorConfig = {
|
|
6159
6161
|
'article_number',
|
6160
6162
|
'reference',
|
6161
6163
|
'salsifyGrouping',
|
6162
|
-
'grouping'
|
6164
|
+
'grouping',
|
6163
6165
|
],
|
6164
6166
|
price: [
|
6165
6167
|
'price',
|
@@ -6176,6 +6178,7 @@ const extractorConfig = {
|
|
6176
6178
|
'final_price',
|
6177
6179
|
'retail_price',
|
6178
6180
|
],
|
6181
|
+
quantity: ['quantity', 'qty'],
|
6179
6182
|
};
|
6180
6183
|
/**
|
6181
6184
|
* Extracts deep values from an object based on specified target type
|
@@ -15821,6 +15824,8 @@ const SPOT_DIMENSIONS = {
|
|
15821
15824
|
[exports.RMN_SPOT_TYPE.RB_COLLECTION_BANNER_WITHOUT_TEXT_BLOCK]: { width: 887, height: 344 },
|
15822
15825
|
[exports.RMN_SPOT_TYPE.RB_PRODUCT_UPCS]: { width: 1, height: 1 },
|
15823
15826
|
[exports.RMN_SPOT_TYPE.RB_NAVIGATION_BANNER]: { width: 440, height: 220 },
|
15827
|
+
[exports.RMN_SPOT_TYPE.RB_VIDEO_PLAYER]: { width: 1280, height: 720 },
|
15828
|
+
[exports.RMN_SPOT_TYPE.RB_IN_TEXT]: { width: 1, height: 1 },
|
15824
15829
|
[exports.RMN_SPOT_TYPE.SMALL_RECTANGLE]: { width: 180, height: 150 },
|
15825
15830
|
[exports.RMN_SPOT_TYPE.MEDIUM_RECTANGLE]: { width: 300, height: 250 },
|
15826
15831
|
[exports.RMN_SPOT_TYPE.LARGE_RECTANGLE]: { width: 336, height: 280 },
|
@@ -16670,8 +16675,15 @@ if (typeof window !== 'undefined' && typeof window.customElements !== 'undefined
|
|
16670
16675
|
const clonedSlide = this.slides[index].cloneNode(true);
|
16671
16676
|
// Map clone to original for event handling
|
16672
16677
|
this.cloneToOriginalMap.set(clonedSlide, this.slides[index]);
|
16678
|
+
let isDragging = false;
|
16679
|
+
slideElement.addEventListener('mousedown', () => (isDragging = false));
|
16680
|
+
slideElement.addEventListener('mousemove', () => (isDragging = true));
|
16673
16681
|
// Add event delegation to the slide container
|
16674
16682
|
slideElement.addEventListener('click', (e) => {
|
16683
|
+
if (isDragging) {
|
16684
|
+
e.stopPropagation();
|
16685
|
+
return;
|
16686
|
+
}
|
16675
16687
|
const original = this.slides[index];
|
16676
16688
|
// Dispatch a new event on the original element
|
16677
16689
|
const cloneEvent = new Event(e.type, { bubbles: true, cancelable: true });
|
@@ -17554,7 +17566,7 @@ function spotHtmlStringToElement(htmlString, spotType) {
|
|
17554
17566
|
return spot;
|
17555
17567
|
}
|
17556
17568
|
|
17557
|
-
const STYLES$
|
17569
|
+
const STYLES$j = ({ primaryImage, secondaryImage }) => `
|
17558
17570
|
<style>
|
17559
17571
|
.content {
|
17560
17572
|
width: 100%;
|
@@ -17652,7 +17664,7 @@ function billboardV1Template(spot) {
|
|
17652
17664
|
${GFONT_PRECONNECT}
|
17653
17665
|
${GFONT_SOURCE_SANS_3}
|
17654
17666
|
${GFONT_CORMORANT}
|
17655
|
-
${STYLES$
|
17667
|
+
${STYLES$j(spot)}
|
17656
17668
|
<div class="content">
|
17657
17669
|
<div class="big-image"></div>
|
17658
17670
|
<div class="main">
|
@@ -17667,7 +17679,7 @@ function billboardV1Template(spot) {
|
|
17667
17679
|
`;
|
17668
17680
|
}
|
17669
17681
|
|
17670
|
-
const STYLES$
|
17682
|
+
const STYLES$i = ({ primaryImage }) => `
|
17671
17683
|
<style>
|
17672
17684
|
.content {
|
17673
17685
|
display: flex;
|
@@ -17741,7 +17753,7 @@ function billboardV2Template(spot) {
|
|
17741
17753
|
${GFONT_PRECONNECT}
|
17742
17754
|
${GFONT_SOURCE_SANS_3}
|
17743
17755
|
${GFONT_CORMORANT}
|
17744
|
-
${STYLES$
|
17756
|
+
${STYLES$i(spot)}
|
17745
17757
|
<div class="content">
|
17746
17758
|
<div class="text-container">
|
17747
17759
|
<h2 class="header">${spot.header}</h2>
|
@@ -17752,7 +17764,7 @@ function billboardV2Template(spot) {
|
|
17752
17764
|
`;
|
17753
17765
|
}
|
17754
17766
|
|
17755
|
-
const STYLES$
|
17767
|
+
const STYLES$h = ({ primaryImage }) => `
|
17756
17768
|
<style>
|
17757
17769
|
.content {
|
17758
17770
|
width: 100%;
|
@@ -17842,7 +17854,7 @@ function billboardV3Template(spot) {
|
|
17842
17854
|
${GFONT_PRECONNECT}
|
17843
17855
|
${GFONT_SOURCE_SANS_3}
|
17844
17856
|
${GFONT_CORMORANT}
|
17845
|
-
${STYLES$
|
17857
|
+
${STYLES$h(spot)}
|
17846
17858
|
<div class="content">
|
17847
17859
|
<div class="text">
|
17848
17860
|
<h2 class="header">${spot.header}</h2>
|
@@ -17854,7 +17866,7 @@ function billboardV3Template(spot) {
|
|
17854
17866
|
`;
|
17855
17867
|
}
|
17856
17868
|
|
17857
|
-
const STYLES$
|
17869
|
+
const STYLES$g = () => `
|
17858
17870
|
<style>
|
17859
17871
|
.content {
|
17860
17872
|
display: inline-block;
|
@@ -17886,7 +17898,7 @@ function inTextV1Template(spot) {
|
|
17886
17898
|
${GFONT_PRECONNECT}
|
17887
17899
|
${GFONT_SOURCE_SANS_3}
|
17888
17900
|
${GFONT_CORMORANT}
|
17889
|
-
${STYLES$
|
17901
|
+
${STYLES$g()}
|
17890
17902
|
<div class="content">
|
17891
17903
|
<span class="header">${spot.header}</span>
|
17892
17904
|
<span class="description">${spot.description}</span>
|
@@ -17894,7 +17906,7 @@ function inTextV1Template(spot) {
|
|
17894
17906
|
`;
|
17895
17907
|
}
|
17896
17908
|
|
17897
|
-
const STYLES$
|
17909
|
+
const STYLES$f = ({ primaryImage }) => `
|
17898
17910
|
<style>
|
17899
17911
|
.content {
|
17900
17912
|
width: 100%;
|
@@ -17976,7 +17988,7 @@ function largeLeaderboardV1Template(spot) {
|
|
17976
17988
|
${GFONT_PRECONNECT}
|
17977
17989
|
${GFONT_SOURCE_SANS_3}
|
17978
17990
|
${GFONT_CORMORANT}
|
17979
|
-
${STYLES$
|
17991
|
+
${STYLES$f(spot)}
|
17980
17992
|
<div class="content">
|
17981
17993
|
<div class="text">
|
17982
17994
|
<h2 class="header">${spot.header}</h2>
|
@@ -17987,7 +17999,7 @@ function largeLeaderboardV1Template(spot) {
|
|
17987
17999
|
`;
|
17988
18000
|
}
|
17989
18001
|
|
17990
|
-
const STYLES$
|
18002
|
+
const STYLES$e = ({ primaryImage }) => `
|
17991
18003
|
<style>
|
17992
18004
|
.content {
|
17993
18005
|
width: 100%;
|
@@ -18063,7 +18075,7 @@ function largeLeaderboardV2Template(spot) {
|
|
18063
18075
|
${GFONT_PRECONNECT}
|
18064
18076
|
${GFONT_SOURCE_SANS_3}
|
18065
18077
|
${GFONT_CORMORANT}
|
18066
|
-
${STYLES$
|
18078
|
+
${STYLES$e(spot)}
|
18067
18079
|
<div class="content">
|
18068
18080
|
<div class="text">
|
18069
18081
|
<h2 class="header">${spot.header}</h2>
|
@@ -18074,7 +18086,7 @@ function largeLeaderboardV2Template(spot) {
|
|
18074
18086
|
`;
|
18075
18087
|
}
|
18076
18088
|
|
18077
|
-
const STYLES$
|
18089
|
+
const STYLES$d = ({ primaryImage }) => `
|
18078
18090
|
<style>
|
18079
18091
|
.content {
|
18080
18092
|
width: 100%;
|
@@ -18122,7 +18134,7 @@ function largeRectangleV1Template(spot) {
|
|
18122
18134
|
${GFONT_PRECONNECT}
|
18123
18135
|
${GFONT_SOURCE_SANS_3}
|
18124
18136
|
${GFONT_CORMORANT}
|
18125
|
-
${STYLES$
|
18137
|
+
${STYLES$d(spot)}
|
18126
18138
|
<div class="content">
|
18127
18139
|
<div class="image"></div>
|
18128
18140
|
<div class="text">
|
@@ -18133,7 +18145,7 @@ function largeRectangleV1Template(spot) {
|
|
18133
18145
|
`;
|
18134
18146
|
}
|
18135
18147
|
|
18136
|
-
const STYLES$
|
18148
|
+
const STYLES$c = ({ primaryImage }) => `
|
18137
18149
|
<style>
|
18138
18150
|
.content {
|
18139
18151
|
width: 100%;
|
@@ -18220,7 +18232,7 @@ function squareV1Template(spot) {
|
|
18220
18232
|
${GFONT_PRECONNECT}
|
18221
18233
|
${GFONT_SOURCE_SANS_3}
|
18222
18234
|
${GFONT_CORMORANT}
|
18223
|
-
${STYLES$
|
18235
|
+
${STYLES$c(spot)}
|
18224
18236
|
<div class="content">
|
18225
18237
|
<div class="text">
|
18226
18238
|
<h2 class="header">${spot.header}</h2>
|
@@ -18231,7 +18243,7 @@ function squareV1Template(spot) {
|
|
18231
18243
|
`;
|
18232
18244
|
}
|
18233
18245
|
|
18234
|
-
const STYLES$
|
18246
|
+
const STYLES$b = ({ primaryImage }) => `
|
18235
18247
|
<style>
|
18236
18248
|
.content {
|
18237
18249
|
width: 100%;
|
@@ -18275,14 +18287,14 @@ function squareV2Template(spot) {
|
|
18275
18287
|
${GFONT_PRECONNECT}
|
18276
18288
|
${GFONT_SOURCE_SANS_3}
|
18277
18289
|
${GFONT_CORMORANT}
|
18278
|
-
${STYLES$
|
18290
|
+
${STYLES$b(spot)}
|
18279
18291
|
<div class="content">
|
18280
18292
|
<span class="header">${spot.header}</span>
|
18281
18293
|
</div>
|
18282
18294
|
`;
|
18283
18295
|
}
|
18284
18296
|
|
18285
|
-
const STYLES$
|
18297
|
+
const STYLES$a = ({ primaryImage }) => `
|
18286
18298
|
<style>
|
18287
18299
|
.content {
|
18288
18300
|
width: 100%;
|
@@ -18340,7 +18352,7 @@ function verticalRectangleV1Template(spot) {
|
|
18340
18352
|
${GFONT_PRECONNECT}
|
18341
18353
|
${GFONT_SOURCE_SANS_3}
|
18342
18354
|
${GFONT_CORMORANT}
|
18343
|
-
${STYLES$
|
18355
|
+
${STYLES$a(spot)}
|
18344
18356
|
<div class="content">
|
18345
18357
|
<div class="text">
|
18346
18358
|
<h2 class="header">${spot.header}</h2>
|
@@ -18351,7 +18363,7 @@ function verticalRectangleV1Template(spot) {
|
|
18351
18363
|
`;
|
18352
18364
|
}
|
18353
18365
|
|
18354
|
-
const STYLES$
|
18366
|
+
const STYLES$9 = ({ primaryImage }) => `
|
18355
18367
|
<style>
|
18356
18368
|
.content {
|
18357
18369
|
width: 100%;
|
@@ -18366,12 +18378,12 @@ const STYLES$8 = ({ primaryImage }) => `
|
|
18366
18378
|
`;
|
18367
18379
|
function wideSkyscraperV1Template(spot) {
|
18368
18380
|
return `
|
18369
|
-
${STYLES$
|
18381
|
+
${STYLES$9(spot)}
|
18370
18382
|
<div class="content"></div>
|
18371
18383
|
`;
|
18372
18384
|
}
|
18373
18385
|
|
18374
|
-
const STYLES$
|
18386
|
+
const STYLES$8 = ({ primaryImage, mobilePrimaryImage = primaryImage }, { prefix }) => `
|
18375
18387
|
<style>
|
18376
18388
|
.${prefix} {
|
18377
18389
|
display: block;
|
@@ -18395,12 +18407,12 @@ const STYLES$7 = ({ primaryImage, mobilePrimaryImage = primaryImage }, { prefix
|
|
18395
18407
|
function rbCollectionBannerWithoutTextBlockTemplate(spot, config) {
|
18396
18408
|
const { prefix = '' } = config;
|
18397
18409
|
return `
|
18398
|
-
${STYLES$
|
18410
|
+
${STYLES$8(spot, config)}
|
18399
18411
|
<div class="${prefix}"></div>
|
18400
18412
|
`;
|
18401
18413
|
}
|
18402
18414
|
|
18403
|
-
const STYLES$
|
18415
|
+
const STYLES$7 = ({ textColor = '#ffffff', ctaTextColor = textColor, ctaBorderColor = ctaTextColor, primaryImage, mobilePrimaryImage = primaryImage, }, { prefix, overlay }) => {
|
18404
18416
|
const linearGradient = generateGradientColor(overlay, 'rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0) 40%');
|
18405
18417
|
return `
|
18406
18418
|
<style>
|
@@ -18539,7 +18551,7 @@ function rbHomepageHeroFullImageTemplate(spot, config) {
|
|
18539
18551
|
${GFONT_PRECONNECT}
|
18540
18552
|
${GFONT_SOURCE_SANS_3}
|
18541
18553
|
${GFONT_CORMORANT}
|
18542
|
-
${STYLES$
|
18554
|
+
${STYLES$7(spot, config)}
|
18543
18555
|
<div class="${prefix}">
|
18544
18556
|
<div class="${prefix}__text">
|
18545
18557
|
${spot.header ? `<h2 class="${prefix}__header">${spot.header}</h2>` : ''}
|
@@ -18550,7 +18562,7 @@ function rbHomepageHeroFullImageTemplate(spot, config) {
|
|
18550
18562
|
`;
|
18551
18563
|
}
|
18552
18564
|
|
18553
|
-
const STYLES$
|
18565
|
+
const STYLES$6 = ({ textColor = '#212121', backgroundColor = '#e8e6de', ctaTextColor = textColor, primaryImage, mobilePrimaryImage = primaryImage, secondaryImage, mobileSecondaryImage = secondaryImage, }, { prefix }) => `
|
18554
18566
|
<style>
|
18555
18567
|
.${prefix} {
|
18556
18568
|
width: 100%;
|
@@ -18615,7 +18627,7 @@ const STYLES$5 = ({ textColor = '#212121', backgroundColor = '#e8e6de', ctaTextC
|
|
18615
18627
|
color: inherit;
|
18616
18628
|
margin: 0;
|
18617
18629
|
font-size: 18px;
|
18618
|
-
font-family: "Cormorant";
|
18630
|
+
font-family: "Cormorant", system-ui;
|
18619
18631
|
font-style: normal;
|
18620
18632
|
font-weight: 700;
|
18621
18633
|
line-height: normal;
|
@@ -18727,7 +18739,7 @@ function rbHomepageHeroThreeTileTemplate(spot, config) {
|
|
18727
18739
|
${GFONT_PRECONNECT}
|
18728
18740
|
${GFONT_SOURCE_SANS_3}
|
18729
18741
|
${GFONT_CORMORANT}
|
18730
|
-
${STYLES$
|
18742
|
+
${STYLES$6(spot, config)}
|
18731
18743
|
<div class="${prefix}">
|
18732
18744
|
<div class="${prefix}__content">
|
18733
18745
|
<div class="${prefix}__primary-image"></div>
|
@@ -18744,7 +18756,7 @@ function rbHomepageHeroThreeTileTemplate(spot, config) {
|
|
18744
18756
|
`;
|
18745
18757
|
}
|
18746
18758
|
|
18747
|
-
const STYLES$
|
18759
|
+
const STYLES$5 = ({ textColor = '#212121', backgroundColor = '#e8e6de', ctaTextColor = textColor, primaryImage, mobilePrimaryImage = primaryImage, }, { prefix }) => `
|
18748
18760
|
<style>
|
18749
18761
|
.${prefix} {
|
18750
18762
|
width: 100%;
|
@@ -18886,7 +18898,7 @@ function rbHomepageHeroTwoTileTemplate(spot, config) {
|
|
18886
18898
|
${GFONT_PRECONNECT}
|
18887
18899
|
${GFONT_SOURCE_SANS_3}
|
18888
18900
|
${GFONT_CORMORANT}
|
18889
|
-
${STYLES$
|
18901
|
+
${STYLES$5(spot, config)}
|
18890
18902
|
<div class="${prefix}">
|
18891
18903
|
<div class="${prefix}__content">
|
18892
18904
|
<div class="${prefix}__text">
|
@@ -18900,6 +18912,41 @@ function rbHomepageHeroTwoTileTemplate(spot, config) {
|
|
18900
18912
|
`;
|
18901
18913
|
}
|
18902
18914
|
|
18915
|
+
const STYLES$4 = ({ textColor = '#212121', backgroundColor = 'transparent' }, { prefix }) => `
|
18916
|
+
<style>
|
18917
|
+
.${prefix} {
|
18918
|
+
display: block;
|
18919
|
+
cursor: pointer;
|
18920
|
+
max-width: fit-content;
|
18921
|
+
padding: 0;
|
18922
|
+
background-color: ${backgroundColor};
|
18923
|
+
}
|
18924
|
+
.${prefix}__header {
|
18925
|
+
font-size: 0.875rem;
|
18926
|
+
line-height: 1.25rem;
|
18927
|
+
font-weight: 500;
|
18928
|
+
color: ${textColor};
|
18929
|
+
font-family: "Source Sans 3", system-ui;
|
18930
|
+
margin: 0;
|
18931
|
+
}
|
18932
|
+
|
18933
|
+
.${prefix}__header:hover {
|
18934
|
+
color: #b5914a;
|
18935
|
+
}
|
18936
|
+
</style>
|
18937
|
+
`;
|
18938
|
+
function rbInTextTemplate(spot, config) {
|
18939
|
+
const { prefix = '' } = config;
|
18940
|
+
return `
|
18941
|
+
${GFONT_PRECONNECT}
|
18942
|
+
${GFONT_SOURCE_SANS_3}
|
18943
|
+
${STYLES$4(spot, config)}
|
18944
|
+
<div class="${prefix}">
|
18945
|
+
${spot.header ? `<h2 class="${prefix}__header">${spot.header}</h2>` : ''}
|
18946
|
+
</div>
|
18947
|
+
`;
|
18948
|
+
}
|
18949
|
+
|
18903
18950
|
const STYLES$3 = ({ textColor = '#ffffff', ctaTextColor = textColor, ctaBorderColor = ctaTextColor, primaryImage, mobilePrimaryImage = primaryImage, }, { prefix, overlay }) => {
|
18904
18951
|
const linearGradient = generateGradientColor(overlay, 'rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0) 30%');
|
18905
18952
|
return `
|
@@ -19256,6 +19303,13 @@ const SPOT_TEMPLATE_HTML_ELEMENT = (spot, config) => {
|
|
19256
19303
|
[exports.RMN_SPOT_TYPE.RB_NAVIGATION_BANNER]: {
|
19257
19304
|
rbNavigationBanner: rbNavigationBannerTemplate,
|
19258
19305
|
},
|
19306
|
+
[exports.RMN_SPOT_TYPE.RB_IN_TEXT]: {
|
19307
|
+
rbInText: rbInTextTemplate,
|
19308
|
+
},
|
19309
|
+
[exports.RMN_SPOT_TYPE.RB_VIDEO_PLAYER]: {
|
19310
|
+
// rbVideoPlayer: rbVideoPlayerTemplate,
|
19311
|
+
rbVideoPlayer: () => '', // TODO: Implement this template.
|
19312
|
+
},
|
19259
19313
|
[exports.RMN_SPOT_TYPE.RB_PRODUCT_UPCS]: {
|
19260
19314
|
rbProductUpcs: () => '', // No template for this spot type, it will be handled by ReserveBar App.
|
19261
19315
|
},
|
@@ -19361,8 +19415,13 @@ class DataLayerMonitor {
|
|
19361
19415
|
onlyFirst: true,
|
19362
19416
|
shouldIncludeZero: true,
|
19363
19417
|
});
|
19418
|
+
const productQuantity = extractDeepValues(data, 'quantity', {
|
19419
|
+
onlyFirst: true,
|
19420
|
+
shouldIncludeZero: true,
|
19421
|
+
});
|
19364
19422
|
if (productPrice) {
|
19365
19423
|
normalizedData.productPrice = productPrice;
|
19424
|
+
normalizedData.productQuantity = productQuantity !== null && productQuantity !== void 0 ? productQuantity : 1;
|
19366
19425
|
}
|
19367
19426
|
}
|
19368
19427
|
return normalizedData;
|
@@ -19412,7 +19471,7 @@ class MonitorService {
|
|
19412
19471
|
this.implementedMonitor.start();
|
19413
19472
|
}
|
19414
19473
|
async matchAndFireEvent(eventData, spots) {
|
19415
|
-
var _a
|
19474
|
+
var _a;
|
19416
19475
|
if (!spots)
|
19417
19476
|
return;
|
19418
19477
|
const eventProductIds = new Set(cleanProductIds(eventData.productIds));
|
@@ -19423,16 +19482,32 @@ class MonitorService {
|
|
19423
19482
|
if (!hasCommonProductIds || !Object.values(exports.RMN_SPOT_EVENT).includes(eventData.event)) {
|
19424
19483
|
continue;
|
19425
19484
|
}
|
19426
|
-
const
|
19427
|
-
|
19428
|
-
|
19429
|
-
|
19485
|
+
const eventPosition = spot.events.findIndex((event) => event.event === eventData.event);
|
19486
|
+
if (eventPosition === -1)
|
19487
|
+
continue;
|
19488
|
+
const eventUrl = spot.events[eventPosition].url;
|
19489
|
+
const gmv = eventData.productPrice && eventData.productQuantity
|
19490
|
+
? eventData.productPrice * eventData.productQuantity
|
19491
|
+
: undefined;
|
19492
|
+
// gmv = gross merchandise value, it is calculated by multiplying the product price by the product quantity
|
19493
|
+
const additionalQueryParams = objectToQueryParams({ gmv });
|
19494
|
+
// Fire the event and publish it to the pubsub service
|
19430
19495
|
await this.fireAndPublishSpotEvent({
|
19431
19496
|
spotEvent: eventData.event,
|
19432
19497
|
eventUrl: `${eventUrl}${additionalQueryParams ? `&${additionalQueryParams}` : ''}`,
|
19433
19498
|
placementId: spot.placementId,
|
19434
19499
|
spotId: spot.spotId,
|
19435
19500
|
});
|
19501
|
+
// Remove the event url from the spot to prevent duplicate events
|
19502
|
+
spot.events[eventPosition].url = '';
|
19503
|
+
// Update the spots in the local storage
|
19504
|
+
(_a = this.localStorageService) === null || _a === void 0 ? void 0 : _a.setSpot(spot.spotId, {
|
19505
|
+
placementId: spot.placementId,
|
19506
|
+
spotId: spot.spotId,
|
19507
|
+
spotType: spot.spotType,
|
19508
|
+
events: spot.events,
|
19509
|
+
productIds: spot.productIds,
|
19510
|
+
});
|
19436
19511
|
}
|
19437
19512
|
}
|
19438
19513
|
async fireAndPublishSpotEvent({ spotEvent, eventUrl, placementId, spotId, }) {
|
@@ -20191,6 +20266,39 @@ const SPOT_EVENTS_EXAMPLE = [
|
|
20191
20266
|
productIds: [107, 108, 109, 110, 111],
|
20192
20267
|
},
|
20193
20268
|
],
|
20269
|
+
rbInText: [
|
20270
|
+
{
|
20271
|
+
id: 'mxo259',
|
20272
|
+
spot: exports.RMN_SPOT_TYPE.RB_IN_TEXT,
|
20273
|
+
variant: exports.RMN_SPOT_TYPE.RB_IN_TEXT,
|
20274
|
+
width: 1,
|
20275
|
+
height: 1,
|
20276
|
+
header: 'Premium Vodka',
|
20277
|
+
textColor: '#ffffff',
|
20278
|
+
backgroundColor: '#000000',
|
20279
|
+
events: SPOT_EVENTS_EXAMPLE,
|
20280
|
+
productIds: [107, 108, 109, 110, 111],
|
20281
|
+
},
|
20282
|
+
],
|
20283
|
+
rbVideoPlayer: [
|
20284
|
+
{
|
20285
|
+
id: 'mxo259',
|
20286
|
+
spot: exports.RMN_SPOT_TYPE.RB_VIDEO_PLAYER,
|
20287
|
+
variant: exports.RMN_SPOT_TYPE.RB_VIDEO_PLAYER,
|
20288
|
+
width: 1280,
|
20289
|
+
height: 720,
|
20290
|
+
videoUrl: 'https://www.youtube.com/watch?v=9bZkp7q19f0',
|
20291
|
+
videoOverlayImage: 'https://placehold.co/1280x720/png?text=Video+Overlay',
|
20292
|
+
videoOverlayHeader: 'Watch Our Story',
|
20293
|
+
videoOverlayDescription: 'Discover the history of our distillery',
|
20294
|
+
videoControls: true,
|
20295
|
+
videoAutoPlay: true,
|
20296
|
+
videoMute: true,
|
20297
|
+
videoLoop: true,
|
20298
|
+
events: SPOT_EVENTS_EXAMPLE,
|
20299
|
+
productIds: [107, 108, 109, 110, 111],
|
20300
|
+
},
|
20301
|
+
],
|
20194
20302
|
});
|
20195
20303
|
({
|
20196
20304
|
banner: [],
|
@@ -20551,7 +20659,7 @@ class LiquidCommerceRmnClient {
|
|
20551
20659
|
const spotElement = this.elementService.createSpotElement({
|
20552
20660
|
content,
|
20553
20661
|
config: {
|
20554
|
-
fluid: config === null || config === void 0 ? void 0 : config.fluid,
|
20662
|
+
fluid: spot.spot === exports.RMN_SPOT_TYPE.RB_IN_TEXT ? true : config === null || config === void 0 ? void 0 : config.fluid,
|
20555
20663
|
spot: spot.spot,
|
20556
20664
|
width: spot.width,
|
20557
20665
|
height: spot.height,
|