@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.esm.js
CHANGED
@@ -11,6 +11,8 @@ var RMN_SPOT_TYPE;
|
|
11
11
|
RMN_SPOT_TYPE["RB_COLLECTION_BANNER_WITHOUT_TEXT_BLOCK"] = "rbCollectionBannerWithoutTextBlock";
|
12
12
|
RMN_SPOT_TYPE["RB_PRODUCT_UPCS"] = "rbProductUpcs";
|
13
13
|
RMN_SPOT_TYPE["RB_NAVIGATION_BANNER"] = "rbNavigationBanner";
|
14
|
+
RMN_SPOT_TYPE["RB_VIDEO_PLAYER"] = "rbVideoPlayer";
|
15
|
+
RMN_SPOT_TYPE["RB_IN_TEXT"] = "rbInText";
|
14
16
|
// IAB Standard Spot Types
|
15
17
|
RMN_SPOT_TYPE["BILLBOARD"] = "billboard";
|
16
18
|
RMN_SPOT_TYPE["LARGE_RECTANGLE"] = "largeRectangle";
|
@@ -6157,7 +6159,7 @@ const extractorConfig = {
|
|
6157
6159
|
'article_number',
|
6158
6160
|
'reference',
|
6159
6161
|
'salsifyGrouping',
|
6160
|
-
'grouping'
|
6162
|
+
'grouping',
|
6161
6163
|
],
|
6162
6164
|
price: [
|
6163
6165
|
'price',
|
@@ -6174,6 +6176,7 @@ const extractorConfig = {
|
|
6174
6176
|
'final_price',
|
6175
6177
|
'retail_price',
|
6176
6178
|
],
|
6179
|
+
quantity: ['quantity', 'qty'],
|
6177
6180
|
};
|
6178
6181
|
/**
|
6179
6182
|
* Extracts deep values from an object based on specified target type
|
@@ -15819,6 +15822,8 @@ const SPOT_DIMENSIONS = {
|
|
15819
15822
|
[RMN_SPOT_TYPE.RB_COLLECTION_BANNER_WITHOUT_TEXT_BLOCK]: { width: 887, height: 344 },
|
15820
15823
|
[RMN_SPOT_TYPE.RB_PRODUCT_UPCS]: { width: 1, height: 1 },
|
15821
15824
|
[RMN_SPOT_TYPE.RB_NAVIGATION_BANNER]: { width: 440, height: 220 },
|
15825
|
+
[RMN_SPOT_TYPE.RB_VIDEO_PLAYER]: { width: 1280, height: 720 },
|
15826
|
+
[RMN_SPOT_TYPE.RB_IN_TEXT]: { width: 1, height: 1 },
|
15822
15827
|
[RMN_SPOT_TYPE.SMALL_RECTANGLE]: { width: 180, height: 150 },
|
15823
15828
|
[RMN_SPOT_TYPE.MEDIUM_RECTANGLE]: { width: 300, height: 250 },
|
15824
15829
|
[RMN_SPOT_TYPE.LARGE_RECTANGLE]: { width: 336, height: 280 },
|
@@ -16668,8 +16673,15 @@ if (typeof window !== 'undefined' && typeof window.customElements !== 'undefined
|
|
16668
16673
|
const clonedSlide = this.slides[index].cloneNode(true);
|
16669
16674
|
// Map clone to original for event handling
|
16670
16675
|
this.cloneToOriginalMap.set(clonedSlide, this.slides[index]);
|
16676
|
+
let isDragging = false;
|
16677
|
+
slideElement.addEventListener('mousedown', () => (isDragging = false));
|
16678
|
+
slideElement.addEventListener('mousemove', () => (isDragging = true));
|
16671
16679
|
// Add event delegation to the slide container
|
16672
16680
|
slideElement.addEventListener('click', (e) => {
|
16681
|
+
if (isDragging) {
|
16682
|
+
e.stopPropagation();
|
16683
|
+
return;
|
16684
|
+
}
|
16673
16685
|
const original = this.slides[index];
|
16674
16686
|
// Dispatch a new event on the original element
|
16675
16687
|
const cloneEvent = new Event(e.type, { bubbles: true, cancelable: true });
|
@@ -17552,7 +17564,7 @@ function spotHtmlStringToElement(htmlString, spotType) {
|
|
17552
17564
|
return spot;
|
17553
17565
|
}
|
17554
17566
|
|
17555
|
-
const STYLES$
|
17567
|
+
const STYLES$j = ({ primaryImage, secondaryImage }) => `
|
17556
17568
|
<style>
|
17557
17569
|
.content {
|
17558
17570
|
width: 100%;
|
@@ -17650,7 +17662,7 @@ function billboardV1Template(spot) {
|
|
17650
17662
|
${GFONT_PRECONNECT}
|
17651
17663
|
${GFONT_SOURCE_SANS_3}
|
17652
17664
|
${GFONT_CORMORANT}
|
17653
|
-
${STYLES$
|
17665
|
+
${STYLES$j(spot)}
|
17654
17666
|
<div class="content">
|
17655
17667
|
<div class="big-image"></div>
|
17656
17668
|
<div class="main">
|
@@ -17665,7 +17677,7 @@ function billboardV1Template(spot) {
|
|
17665
17677
|
`;
|
17666
17678
|
}
|
17667
17679
|
|
17668
|
-
const STYLES$
|
17680
|
+
const STYLES$i = ({ primaryImage }) => `
|
17669
17681
|
<style>
|
17670
17682
|
.content {
|
17671
17683
|
display: flex;
|
@@ -17739,7 +17751,7 @@ function billboardV2Template(spot) {
|
|
17739
17751
|
${GFONT_PRECONNECT}
|
17740
17752
|
${GFONT_SOURCE_SANS_3}
|
17741
17753
|
${GFONT_CORMORANT}
|
17742
|
-
${STYLES$
|
17754
|
+
${STYLES$i(spot)}
|
17743
17755
|
<div class="content">
|
17744
17756
|
<div class="text-container">
|
17745
17757
|
<h2 class="header">${spot.header}</h2>
|
@@ -17750,7 +17762,7 @@ function billboardV2Template(spot) {
|
|
17750
17762
|
`;
|
17751
17763
|
}
|
17752
17764
|
|
17753
|
-
const STYLES$
|
17765
|
+
const STYLES$h = ({ primaryImage }) => `
|
17754
17766
|
<style>
|
17755
17767
|
.content {
|
17756
17768
|
width: 100%;
|
@@ -17840,7 +17852,7 @@ function billboardV3Template(spot) {
|
|
17840
17852
|
${GFONT_PRECONNECT}
|
17841
17853
|
${GFONT_SOURCE_SANS_3}
|
17842
17854
|
${GFONT_CORMORANT}
|
17843
|
-
${STYLES$
|
17855
|
+
${STYLES$h(spot)}
|
17844
17856
|
<div class="content">
|
17845
17857
|
<div class="text">
|
17846
17858
|
<h2 class="header">${spot.header}</h2>
|
@@ -17852,7 +17864,7 @@ function billboardV3Template(spot) {
|
|
17852
17864
|
`;
|
17853
17865
|
}
|
17854
17866
|
|
17855
|
-
const STYLES$
|
17867
|
+
const STYLES$g = () => `
|
17856
17868
|
<style>
|
17857
17869
|
.content {
|
17858
17870
|
display: inline-block;
|
@@ -17884,7 +17896,7 @@ function inTextV1Template(spot) {
|
|
17884
17896
|
${GFONT_PRECONNECT}
|
17885
17897
|
${GFONT_SOURCE_SANS_3}
|
17886
17898
|
${GFONT_CORMORANT}
|
17887
|
-
${STYLES$
|
17899
|
+
${STYLES$g()}
|
17888
17900
|
<div class="content">
|
17889
17901
|
<span class="header">${spot.header}</span>
|
17890
17902
|
<span class="description">${spot.description}</span>
|
@@ -17892,7 +17904,7 @@ function inTextV1Template(spot) {
|
|
17892
17904
|
`;
|
17893
17905
|
}
|
17894
17906
|
|
17895
|
-
const STYLES$
|
17907
|
+
const STYLES$f = ({ primaryImage }) => `
|
17896
17908
|
<style>
|
17897
17909
|
.content {
|
17898
17910
|
width: 100%;
|
@@ -17974,7 +17986,7 @@ function largeLeaderboardV1Template(spot) {
|
|
17974
17986
|
${GFONT_PRECONNECT}
|
17975
17987
|
${GFONT_SOURCE_SANS_3}
|
17976
17988
|
${GFONT_CORMORANT}
|
17977
|
-
${STYLES$
|
17989
|
+
${STYLES$f(spot)}
|
17978
17990
|
<div class="content">
|
17979
17991
|
<div class="text">
|
17980
17992
|
<h2 class="header">${spot.header}</h2>
|
@@ -17985,7 +17997,7 @@ function largeLeaderboardV1Template(spot) {
|
|
17985
17997
|
`;
|
17986
17998
|
}
|
17987
17999
|
|
17988
|
-
const STYLES$
|
18000
|
+
const STYLES$e = ({ primaryImage }) => `
|
17989
18001
|
<style>
|
17990
18002
|
.content {
|
17991
18003
|
width: 100%;
|
@@ -18061,7 +18073,7 @@ function largeLeaderboardV2Template(spot) {
|
|
18061
18073
|
${GFONT_PRECONNECT}
|
18062
18074
|
${GFONT_SOURCE_SANS_3}
|
18063
18075
|
${GFONT_CORMORANT}
|
18064
|
-
${STYLES$
|
18076
|
+
${STYLES$e(spot)}
|
18065
18077
|
<div class="content">
|
18066
18078
|
<div class="text">
|
18067
18079
|
<h2 class="header">${spot.header}</h2>
|
@@ -18072,7 +18084,7 @@ function largeLeaderboardV2Template(spot) {
|
|
18072
18084
|
`;
|
18073
18085
|
}
|
18074
18086
|
|
18075
|
-
const STYLES$
|
18087
|
+
const STYLES$d = ({ primaryImage }) => `
|
18076
18088
|
<style>
|
18077
18089
|
.content {
|
18078
18090
|
width: 100%;
|
@@ -18120,7 +18132,7 @@ function largeRectangleV1Template(spot) {
|
|
18120
18132
|
${GFONT_PRECONNECT}
|
18121
18133
|
${GFONT_SOURCE_SANS_3}
|
18122
18134
|
${GFONT_CORMORANT}
|
18123
|
-
${STYLES$
|
18135
|
+
${STYLES$d(spot)}
|
18124
18136
|
<div class="content">
|
18125
18137
|
<div class="image"></div>
|
18126
18138
|
<div class="text">
|
@@ -18131,7 +18143,7 @@ function largeRectangleV1Template(spot) {
|
|
18131
18143
|
`;
|
18132
18144
|
}
|
18133
18145
|
|
18134
|
-
const STYLES$
|
18146
|
+
const STYLES$c = ({ primaryImage }) => `
|
18135
18147
|
<style>
|
18136
18148
|
.content {
|
18137
18149
|
width: 100%;
|
@@ -18218,7 +18230,7 @@ function squareV1Template(spot) {
|
|
18218
18230
|
${GFONT_PRECONNECT}
|
18219
18231
|
${GFONT_SOURCE_SANS_3}
|
18220
18232
|
${GFONT_CORMORANT}
|
18221
|
-
${STYLES$
|
18233
|
+
${STYLES$c(spot)}
|
18222
18234
|
<div class="content">
|
18223
18235
|
<div class="text">
|
18224
18236
|
<h2 class="header">${spot.header}</h2>
|
@@ -18229,7 +18241,7 @@ function squareV1Template(spot) {
|
|
18229
18241
|
`;
|
18230
18242
|
}
|
18231
18243
|
|
18232
|
-
const STYLES$
|
18244
|
+
const STYLES$b = ({ primaryImage }) => `
|
18233
18245
|
<style>
|
18234
18246
|
.content {
|
18235
18247
|
width: 100%;
|
@@ -18273,14 +18285,14 @@ function squareV2Template(spot) {
|
|
18273
18285
|
${GFONT_PRECONNECT}
|
18274
18286
|
${GFONT_SOURCE_SANS_3}
|
18275
18287
|
${GFONT_CORMORANT}
|
18276
|
-
${STYLES$
|
18288
|
+
${STYLES$b(spot)}
|
18277
18289
|
<div class="content">
|
18278
18290
|
<span class="header">${spot.header}</span>
|
18279
18291
|
</div>
|
18280
18292
|
`;
|
18281
18293
|
}
|
18282
18294
|
|
18283
|
-
const STYLES$
|
18295
|
+
const STYLES$a = ({ primaryImage }) => `
|
18284
18296
|
<style>
|
18285
18297
|
.content {
|
18286
18298
|
width: 100%;
|
@@ -18338,7 +18350,7 @@ function verticalRectangleV1Template(spot) {
|
|
18338
18350
|
${GFONT_PRECONNECT}
|
18339
18351
|
${GFONT_SOURCE_SANS_3}
|
18340
18352
|
${GFONT_CORMORANT}
|
18341
|
-
${STYLES$
|
18353
|
+
${STYLES$a(spot)}
|
18342
18354
|
<div class="content">
|
18343
18355
|
<div class="text">
|
18344
18356
|
<h2 class="header">${spot.header}</h2>
|
@@ -18349,7 +18361,7 @@ function verticalRectangleV1Template(spot) {
|
|
18349
18361
|
`;
|
18350
18362
|
}
|
18351
18363
|
|
18352
|
-
const STYLES$
|
18364
|
+
const STYLES$9 = ({ primaryImage }) => `
|
18353
18365
|
<style>
|
18354
18366
|
.content {
|
18355
18367
|
width: 100%;
|
@@ -18364,12 +18376,12 @@ const STYLES$8 = ({ primaryImage }) => `
|
|
18364
18376
|
`;
|
18365
18377
|
function wideSkyscraperV1Template(spot) {
|
18366
18378
|
return `
|
18367
|
-
${STYLES$
|
18379
|
+
${STYLES$9(spot)}
|
18368
18380
|
<div class="content"></div>
|
18369
18381
|
`;
|
18370
18382
|
}
|
18371
18383
|
|
18372
|
-
const STYLES$
|
18384
|
+
const STYLES$8 = ({ primaryImage, mobilePrimaryImage = primaryImage }, { prefix }) => `
|
18373
18385
|
<style>
|
18374
18386
|
.${prefix} {
|
18375
18387
|
display: block;
|
@@ -18393,12 +18405,12 @@ const STYLES$7 = ({ primaryImage, mobilePrimaryImage = primaryImage }, { prefix
|
|
18393
18405
|
function rbCollectionBannerWithoutTextBlockTemplate(spot, config) {
|
18394
18406
|
const { prefix = '' } = config;
|
18395
18407
|
return `
|
18396
|
-
${STYLES$
|
18408
|
+
${STYLES$8(spot, config)}
|
18397
18409
|
<div class="${prefix}"></div>
|
18398
18410
|
`;
|
18399
18411
|
}
|
18400
18412
|
|
18401
|
-
const STYLES$
|
18413
|
+
const STYLES$7 = ({ textColor = '#ffffff', ctaTextColor = textColor, ctaBorderColor = ctaTextColor, primaryImage, mobilePrimaryImage = primaryImage, }, { prefix, overlay }) => {
|
18402
18414
|
const linearGradient = generateGradientColor(overlay, 'rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0) 40%');
|
18403
18415
|
return `
|
18404
18416
|
<style>
|
@@ -18537,7 +18549,7 @@ function rbHomepageHeroFullImageTemplate(spot, config) {
|
|
18537
18549
|
${GFONT_PRECONNECT}
|
18538
18550
|
${GFONT_SOURCE_SANS_3}
|
18539
18551
|
${GFONT_CORMORANT}
|
18540
|
-
${STYLES$
|
18552
|
+
${STYLES$7(spot, config)}
|
18541
18553
|
<div class="${prefix}">
|
18542
18554
|
<div class="${prefix}__text">
|
18543
18555
|
${spot.header ? `<h2 class="${prefix}__header">${spot.header}</h2>` : ''}
|
@@ -18548,7 +18560,7 @@ function rbHomepageHeroFullImageTemplate(spot, config) {
|
|
18548
18560
|
`;
|
18549
18561
|
}
|
18550
18562
|
|
18551
|
-
const STYLES$
|
18563
|
+
const STYLES$6 = ({ textColor = '#212121', backgroundColor = '#e8e6de', ctaTextColor = textColor, primaryImage, mobilePrimaryImage = primaryImage, secondaryImage, mobileSecondaryImage = secondaryImage, }, { prefix }) => `
|
18552
18564
|
<style>
|
18553
18565
|
.${prefix} {
|
18554
18566
|
width: 100%;
|
@@ -18613,7 +18625,7 @@ const STYLES$5 = ({ textColor = '#212121', backgroundColor = '#e8e6de', ctaTextC
|
|
18613
18625
|
color: inherit;
|
18614
18626
|
margin: 0;
|
18615
18627
|
font-size: 18px;
|
18616
|
-
font-family: "Cormorant";
|
18628
|
+
font-family: "Cormorant", system-ui;
|
18617
18629
|
font-style: normal;
|
18618
18630
|
font-weight: 700;
|
18619
18631
|
line-height: normal;
|
@@ -18725,7 +18737,7 @@ function rbHomepageHeroThreeTileTemplate(spot, config) {
|
|
18725
18737
|
${GFONT_PRECONNECT}
|
18726
18738
|
${GFONT_SOURCE_SANS_3}
|
18727
18739
|
${GFONT_CORMORANT}
|
18728
|
-
${STYLES$
|
18740
|
+
${STYLES$6(spot, config)}
|
18729
18741
|
<div class="${prefix}">
|
18730
18742
|
<div class="${prefix}__content">
|
18731
18743
|
<div class="${prefix}__primary-image"></div>
|
@@ -18742,7 +18754,7 @@ function rbHomepageHeroThreeTileTemplate(spot, config) {
|
|
18742
18754
|
`;
|
18743
18755
|
}
|
18744
18756
|
|
18745
|
-
const STYLES$
|
18757
|
+
const STYLES$5 = ({ textColor = '#212121', backgroundColor = '#e8e6de', ctaTextColor = textColor, primaryImage, mobilePrimaryImage = primaryImage, }, { prefix }) => `
|
18746
18758
|
<style>
|
18747
18759
|
.${prefix} {
|
18748
18760
|
width: 100%;
|
@@ -18884,7 +18896,7 @@ function rbHomepageHeroTwoTileTemplate(spot, config) {
|
|
18884
18896
|
${GFONT_PRECONNECT}
|
18885
18897
|
${GFONT_SOURCE_SANS_3}
|
18886
18898
|
${GFONT_CORMORANT}
|
18887
|
-
${STYLES$
|
18899
|
+
${STYLES$5(spot, config)}
|
18888
18900
|
<div class="${prefix}">
|
18889
18901
|
<div class="${prefix}__content">
|
18890
18902
|
<div class="${prefix}__text">
|
@@ -18898,6 +18910,41 @@ function rbHomepageHeroTwoTileTemplate(spot, config) {
|
|
18898
18910
|
`;
|
18899
18911
|
}
|
18900
18912
|
|
18913
|
+
const STYLES$4 = ({ textColor = '#212121', backgroundColor = 'transparent' }, { prefix }) => `
|
18914
|
+
<style>
|
18915
|
+
.${prefix} {
|
18916
|
+
display: block;
|
18917
|
+
cursor: pointer;
|
18918
|
+
max-width: fit-content;
|
18919
|
+
padding: 0;
|
18920
|
+
background-color: ${backgroundColor};
|
18921
|
+
}
|
18922
|
+
.${prefix}__header {
|
18923
|
+
font-size: 0.875rem;
|
18924
|
+
line-height: 1.25rem;
|
18925
|
+
font-weight: 500;
|
18926
|
+
color: ${textColor};
|
18927
|
+
font-family: "Source Sans 3", system-ui;
|
18928
|
+
margin: 0;
|
18929
|
+
}
|
18930
|
+
|
18931
|
+
.${prefix}__header:hover {
|
18932
|
+
color: #b5914a;
|
18933
|
+
}
|
18934
|
+
</style>
|
18935
|
+
`;
|
18936
|
+
function rbInTextTemplate(spot, config) {
|
18937
|
+
const { prefix = '' } = config;
|
18938
|
+
return `
|
18939
|
+
${GFONT_PRECONNECT}
|
18940
|
+
${GFONT_SOURCE_SANS_3}
|
18941
|
+
${STYLES$4(spot, config)}
|
18942
|
+
<div class="${prefix}">
|
18943
|
+
${spot.header ? `<h2 class="${prefix}__header">${spot.header}</h2>` : ''}
|
18944
|
+
</div>
|
18945
|
+
`;
|
18946
|
+
}
|
18947
|
+
|
18901
18948
|
const STYLES$3 = ({ textColor = '#ffffff', ctaTextColor = textColor, ctaBorderColor = ctaTextColor, primaryImage, mobilePrimaryImage = primaryImage, }, { prefix, overlay }) => {
|
18902
18949
|
const linearGradient = generateGradientColor(overlay, 'rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0) 30%');
|
18903
18950
|
return `
|
@@ -19254,6 +19301,13 @@ const SPOT_TEMPLATE_HTML_ELEMENT = (spot, config) => {
|
|
19254
19301
|
[RMN_SPOT_TYPE.RB_NAVIGATION_BANNER]: {
|
19255
19302
|
rbNavigationBanner: rbNavigationBannerTemplate,
|
19256
19303
|
},
|
19304
|
+
[RMN_SPOT_TYPE.RB_IN_TEXT]: {
|
19305
|
+
rbInText: rbInTextTemplate,
|
19306
|
+
},
|
19307
|
+
[RMN_SPOT_TYPE.RB_VIDEO_PLAYER]: {
|
19308
|
+
// rbVideoPlayer: rbVideoPlayerTemplate,
|
19309
|
+
rbVideoPlayer: () => '', // TODO: Implement this template.
|
19310
|
+
},
|
19257
19311
|
[RMN_SPOT_TYPE.RB_PRODUCT_UPCS]: {
|
19258
19312
|
rbProductUpcs: () => '', // No template for this spot type, it will be handled by ReserveBar App.
|
19259
19313
|
},
|
@@ -19359,8 +19413,13 @@ class DataLayerMonitor {
|
|
19359
19413
|
onlyFirst: true,
|
19360
19414
|
shouldIncludeZero: true,
|
19361
19415
|
});
|
19416
|
+
const productQuantity = extractDeepValues(data, 'quantity', {
|
19417
|
+
onlyFirst: true,
|
19418
|
+
shouldIncludeZero: true,
|
19419
|
+
});
|
19362
19420
|
if (productPrice) {
|
19363
19421
|
normalizedData.productPrice = productPrice;
|
19422
|
+
normalizedData.productQuantity = productQuantity !== null && productQuantity !== void 0 ? productQuantity : 1;
|
19364
19423
|
}
|
19365
19424
|
}
|
19366
19425
|
return normalizedData;
|
@@ -19410,7 +19469,7 @@ class MonitorService {
|
|
19410
19469
|
this.implementedMonitor.start();
|
19411
19470
|
}
|
19412
19471
|
async matchAndFireEvent(eventData, spots) {
|
19413
|
-
var _a
|
19472
|
+
var _a;
|
19414
19473
|
if (!spots)
|
19415
19474
|
return;
|
19416
19475
|
const eventProductIds = new Set(cleanProductIds(eventData.productIds));
|
@@ -19421,16 +19480,32 @@ class MonitorService {
|
|
19421
19480
|
if (!hasCommonProductIds || !Object.values(RMN_SPOT_EVENT).includes(eventData.event)) {
|
19422
19481
|
continue;
|
19423
19482
|
}
|
19424
|
-
const
|
19425
|
-
|
19426
|
-
|
19427
|
-
|
19483
|
+
const eventPosition = spot.events.findIndex((event) => event.event === eventData.event);
|
19484
|
+
if (eventPosition === -1)
|
19485
|
+
continue;
|
19486
|
+
const eventUrl = spot.events[eventPosition].url;
|
19487
|
+
const gmv = eventData.productPrice && eventData.productQuantity
|
19488
|
+
? eventData.productPrice * eventData.productQuantity
|
19489
|
+
: undefined;
|
19490
|
+
// gmv = gross merchandise value, it is calculated by multiplying the product price by the product quantity
|
19491
|
+
const additionalQueryParams = objectToQueryParams({ gmv });
|
19492
|
+
// Fire the event and publish it to the pubsub service
|
19428
19493
|
await this.fireAndPublishSpotEvent({
|
19429
19494
|
spotEvent: eventData.event,
|
19430
19495
|
eventUrl: `${eventUrl}${additionalQueryParams ? `&${additionalQueryParams}` : ''}`,
|
19431
19496
|
placementId: spot.placementId,
|
19432
19497
|
spotId: spot.spotId,
|
19433
19498
|
});
|
19499
|
+
// Remove the event url from the spot to prevent duplicate events
|
19500
|
+
spot.events[eventPosition].url = '';
|
19501
|
+
// Update the spots in the local storage
|
19502
|
+
(_a = this.localStorageService) === null || _a === void 0 ? void 0 : _a.setSpot(spot.spotId, {
|
19503
|
+
placementId: spot.placementId,
|
19504
|
+
spotId: spot.spotId,
|
19505
|
+
spotType: spot.spotType,
|
19506
|
+
events: spot.events,
|
19507
|
+
productIds: spot.productIds,
|
19508
|
+
});
|
19434
19509
|
}
|
19435
19510
|
}
|
19436
19511
|
async fireAndPublishSpotEvent({ spotEvent, eventUrl, placementId, spotId, }) {
|
@@ -20189,6 +20264,39 @@ const SPOT_EVENTS_EXAMPLE = [
|
|
20189
20264
|
productIds: [107, 108, 109, 110, 111],
|
20190
20265
|
},
|
20191
20266
|
],
|
20267
|
+
rbInText: [
|
20268
|
+
{
|
20269
|
+
id: 'mxo259',
|
20270
|
+
spot: RMN_SPOT_TYPE.RB_IN_TEXT,
|
20271
|
+
variant: RMN_SPOT_TYPE.RB_IN_TEXT,
|
20272
|
+
width: 1,
|
20273
|
+
height: 1,
|
20274
|
+
header: 'Premium Vodka',
|
20275
|
+
textColor: '#ffffff',
|
20276
|
+
backgroundColor: '#000000',
|
20277
|
+
events: SPOT_EVENTS_EXAMPLE,
|
20278
|
+
productIds: [107, 108, 109, 110, 111],
|
20279
|
+
},
|
20280
|
+
],
|
20281
|
+
rbVideoPlayer: [
|
20282
|
+
{
|
20283
|
+
id: 'mxo259',
|
20284
|
+
spot: RMN_SPOT_TYPE.RB_VIDEO_PLAYER,
|
20285
|
+
variant: RMN_SPOT_TYPE.RB_VIDEO_PLAYER,
|
20286
|
+
width: 1280,
|
20287
|
+
height: 720,
|
20288
|
+
videoUrl: 'https://www.youtube.com/watch?v=9bZkp7q19f0',
|
20289
|
+
videoOverlayImage: 'https://placehold.co/1280x720/png?text=Video+Overlay',
|
20290
|
+
videoOverlayHeader: 'Watch Our Story',
|
20291
|
+
videoOverlayDescription: 'Discover the history of our distillery',
|
20292
|
+
videoControls: true,
|
20293
|
+
videoAutoPlay: true,
|
20294
|
+
videoMute: true,
|
20295
|
+
videoLoop: true,
|
20296
|
+
events: SPOT_EVENTS_EXAMPLE,
|
20297
|
+
productIds: [107, 108, 109, 110, 111],
|
20298
|
+
},
|
20299
|
+
],
|
20192
20300
|
});
|
20193
20301
|
({
|
20194
20302
|
banner: [],
|
@@ -20549,7 +20657,7 @@ class LiquidCommerceRmnClient {
|
|
20549
20657
|
const spotElement = this.elementService.createSpotElement({
|
20550
20658
|
content,
|
20551
20659
|
config: {
|
20552
|
-
fluid: config === null || config === void 0 ? void 0 : config.fluid,
|
20660
|
+
fluid: spot.spot === RMN_SPOT_TYPE.RB_IN_TEXT ? true : config === null || config === void 0 ? void 0 : config.fluid,
|
20553
20661
|
spot: spot.spot,
|
20554
20662
|
width: spot.width,
|
20555
20663
|
height: spot.height,
|
package/dist/types/enums.d.ts
CHANGED
@@ -9,6 +9,8 @@ export declare enum RMN_SPOT_TYPE {
|
|
9
9
|
RB_COLLECTION_BANNER_WITHOUT_TEXT_BLOCK = "rbCollectionBannerWithoutTextBlock",
|
10
10
|
RB_PRODUCT_UPCS = "rbProductUpcs",
|
11
11
|
RB_NAVIGATION_BANNER = "rbNavigationBanner",
|
12
|
+
RB_VIDEO_PLAYER = "rbVideoPlayer",
|
13
|
+
RB_IN_TEXT = "rbInText",
|
12
14
|
BILLBOARD = "billboard",
|
13
15
|
LARGE_RECTANGLE = "largeRectangle",
|
14
16
|
VERTICAL_RECTANGLE = "verticalRectangle",
|
@@ -2,7 +2,9 @@ export * from './collection-banner-without-text-block.template';
|
|
2
2
|
export * from './homepage-hero-full-image.template';
|
3
3
|
export * from './homepage-hero-three-tile.template';
|
4
4
|
export * from './homepage-hero-two-tile.template';
|
5
|
+
export * from './in-text.template';
|
5
6
|
export * from './large-category-image-tout.template';
|
6
7
|
export * from './navigation-banner.template';
|
7
8
|
export * from './small-category-image-tout.template';
|
8
9
|
export * from './small-discover-tout.template';
|
10
|
+
export * from './video-player.template';
|
@@ -36,6 +36,14 @@ export interface ISpot {
|
|
36
36
|
mobilePrimaryImage?: string;
|
37
37
|
mobileSecondaryImage?: string;
|
38
38
|
productIds?: Array<string | number>;
|
39
|
+
videoUrl?: string;
|
40
|
+
videoOverlayImage?: string;
|
41
|
+
videoOverlayHeader?: string;
|
42
|
+
videoOverlayDescription?: string;
|
43
|
+
videoControls?: boolean;
|
44
|
+
videoAutoPlay?: boolean;
|
45
|
+
videoMute?: boolean;
|
46
|
+
videoLoop?: boolean;
|
39
47
|
rbProductUpcs?: Array<string | number>;
|
40
48
|
rbProductSalsifyGroupings?: Array<string | number>;
|
41
49
|
rbProductSalsifyPids?: Array<string | number>;
|
package/package.json
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
"name": "@liquidcommercedev/rmn-sdk",
|
3
3
|
"description": "LiquidCommerce RMN SDK",
|
4
4
|
"author": "LiquidCommerce Tech",
|
5
|
-
"version": "1.5.0-beta.
|
5
|
+
"version": "1.5.0-beta.26",
|
6
6
|
"homepage": "https://docs.liquidcommerce.co/rmn-sdk",
|
7
7
|
"main": "./dist/index.cjs",
|
8
8
|
"module": "./dist/index.esm.js",
|