@liquidcommercedev/rmn-sdk 1.4.6-beta.5 → 1.4.6-beta.6
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 +199 -181
- package/dist/index.esm.js +199 -181
- package/dist/types/enums.d.ts +0 -1
- package/dist/types/modules/element/component/utils.d.ts +1 -0
- package/dist/types/modules/element/element.interface.d.ts +2 -0
- package/dist/types/modules/event/event.interface.d.ts +0 -14
- package/dist/types/modules/event/index.d.ts +1 -0
- package/package.json +1 -1
- package/umd/liquidcommerce-rmn-sdk.min.js +1 -1
package/dist/index.cjs
CHANGED
@@ -58,7 +58,6 @@ exports.RMN_SPOT_EVENT = void 0;
|
|
58
58
|
(function (RMN_SPOT_EVENT) {
|
59
59
|
RMN_SPOT_EVENT["MOUNTED"] = "MOUNTED";
|
60
60
|
RMN_SPOT_EVENT["UNMOUNTED"] = "UNMOUNTED";
|
61
|
-
RMN_SPOT_EVENT["RESIZED"] = "RESIZED";
|
62
61
|
RMN_SPOT_EVENT["IMPRESSION"] = "IMPRESSION";
|
63
62
|
RMN_SPOT_EVENT["CLICK"] = "CLICK";
|
64
63
|
RMN_SPOT_EVENT["PURCHASE"] = "PURCHASE";
|
@@ -15246,9 +15245,9 @@ class ResizeObserverService {
|
|
15246
15245
|
newWidth = Math.min(containerWidth, this.maxSize.width);
|
15247
15246
|
newHeight = newWidth / this.aspectRatio;
|
15248
15247
|
// If the height exceeds the container, adjust based on height
|
15249
|
-
if (
|
15250
|
-
|
15251
|
-
|
15248
|
+
if (newWidth > containerWidth) {
|
15249
|
+
newWidth = containerWidth;
|
15250
|
+
newHeight = containerHeight * this.aspectRatio;
|
15252
15251
|
}
|
15253
15252
|
// Ensure we're not going below minimum dimensions
|
15254
15253
|
newWidth = Math.max(newWidth, this.minSize.width);
|
@@ -15275,6 +15274,36 @@ class ResizeObserverService {
|
|
15275
15274
|
}
|
15276
15275
|
}
|
15277
15276
|
|
15277
|
+
function calculateScaleFactor(elementScale) {
|
15278
|
+
// Step 1: Apply square root for non-linear scaling
|
15279
|
+
// This creates a more gradual scaling effect, especially for larger changes
|
15280
|
+
// For example:
|
15281
|
+
// - elementScale of 0.25 (1/4 size) becomes 0.5
|
15282
|
+
// - elementScale of 1 (unchanged) remains 1
|
15283
|
+
// - elementScale of 4 (4x size) becomes 2
|
15284
|
+
const baseFactor = Math.sqrt(elementScale);
|
15285
|
+
// Step 2: Apply additional dampening to further soften the scaling effect
|
15286
|
+
// The dampening factor (0.5) can be adjusted:
|
15287
|
+
// - Lower values (closer to 0) make scaling more subtle
|
15288
|
+
// - Higher values (closer to 1) make scaling more pronounced
|
15289
|
+
const dampening = 0.35;
|
15290
|
+
// Calculate the scaleFactor:
|
15291
|
+
// 1. (baseFactor - 1) represents the change from the original size
|
15292
|
+
// 2. Multiply by dampening to reduce the effect
|
15293
|
+
// 3. Add 1 to center the scaling around the original size
|
15294
|
+
// For example, if baseFactor is 2:
|
15295
|
+
// scaleFactor = 1 + (2 - 1) * 0.5 = 1.5
|
15296
|
+
const scaleFactor = 1 + (baseFactor - 1) * dampening;
|
15297
|
+
// Step 3: Define the allowed range for the scale factor
|
15298
|
+
// This ensures that the font size never changes too drastically
|
15299
|
+
const minScale = 0.35; // Font will never be smaller than 50% of original
|
15300
|
+
const maxScale = 1.5; // Font will never be larger than 150% of original
|
15301
|
+
// Step 4: Clamp the scale factor to the defined range
|
15302
|
+
// Math.min ensures the value doesn't exceed maxScale
|
15303
|
+
// Math.max ensures the value isn't less than minScale
|
15304
|
+
return Math.max(minScale, Math.min(maxScale, scaleFactor));
|
15305
|
+
}
|
15306
|
+
|
15278
15307
|
const CAROUSEL_COMPONENT_STYLE = ({ width, height, fluid }) => `
|
15279
15308
|
:host {
|
15280
15309
|
position: relative;
|
@@ -15462,6 +15491,7 @@ if (typeof window !== 'undefined' && typeof window.customElements !== 'undefined
|
|
15462
15491
|
this.autoplayInterval = null;
|
15463
15492
|
this.useDots = false;
|
15464
15493
|
this.useButtons = false;
|
15494
|
+
this.originalFontSizes = new Map();
|
15465
15495
|
this.attachShadow({ mode: 'open' });
|
15466
15496
|
}
|
15467
15497
|
connectedCallback() {
|
@@ -15500,7 +15530,7 @@ if (typeof window !== 'undefined' && typeof window.customElements !== 'undefined
|
|
15500
15530
|
this.validateOptions();
|
15501
15531
|
}
|
15502
15532
|
setupResizeObserver() {
|
15503
|
-
if (this.data) {
|
15533
|
+
if (this.data && !this.data.fluid) {
|
15504
15534
|
this.resizeObserver = new ResizeObserverService({
|
15505
15535
|
element: this,
|
15506
15536
|
maxSize: {
|
@@ -15512,9 +15542,29 @@ if (typeof window !== 'undefined' && typeof window.customElements !== 'undefined
|
|
15512
15542
|
this.addEventListener('spotSizeChanged', this.handleCarouselSizeChanged.bind(this));
|
15513
15543
|
}
|
15514
15544
|
}
|
15515
|
-
|
15516
|
-
|
15517
|
-
|
15545
|
+
handleCarouselSizeChanged(event) {
|
15546
|
+
const isRBSpot = 'rbHeroadaksda'.startsWith('rb');
|
15547
|
+
if (!isRBSpot) {
|
15548
|
+
// Adjust text elements font size based on the scale factor
|
15549
|
+
this.adjustFontSize(event.detail.scale);
|
15550
|
+
}
|
15551
|
+
}
|
15552
|
+
adjustFontSize(elementScale) {
|
15553
|
+
var _a;
|
15554
|
+
const scaleFactor = calculateScaleFactor(elementScale);
|
15555
|
+
// Find all text elements within the shadow root
|
15556
|
+
const elements = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll('h1, h2, h3, h4, p, span');
|
15557
|
+
elements === null || elements === void 0 ? void 0 : elements.forEach((element) => {
|
15558
|
+
if (element instanceof HTMLElement) {
|
15559
|
+
if (!this.originalFontSizes.has(element)) {
|
15560
|
+
const originalSize = parseFloat(window.getComputedStyle(element).fontSize);
|
15561
|
+
this.originalFontSizes.set(element, originalSize);
|
15562
|
+
}
|
15563
|
+
const originalSize = this.originalFontSizes.get(element);
|
15564
|
+
const newFontSize = originalSize * scaleFactor;
|
15565
|
+
element.style.fontSize = `${newFontSize}px`;
|
15566
|
+
}
|
15567
|
+
});
|
15518
15568
|
}
|
15519
15569
|
render() {
|
15520
15570
|
var _a;
|
@@ -15723,7 +15773,7 @@ if (typeof window !== 'undefined' && typeof window.customElements !== 'undefined
|
|
15723
15773
|
* #########################################################
|
15724
15774
|
*/
|
15725
15775
|
setupResizeObserver() {
|
15726
|
-
if (this.data) {
|
15776
|
+
if (this.data && !this.data.fluid) {
|
15727
15777
|
this.resizeObserver = new ResizeObserverService({
|
15728
15778
|
element: this,
|
15729
15779
|
maxSize: {
|
@@ -15740,13 +15790,16 @@ if (typeof window !== 'undefined' && typeof window.customElements !== 'undefined
|
|
15740
15790
|
* #########################################################
|
15741
15791
|
*/
|
15742
15792
|
handleSpotSizeChanged(event) {
|
15743
|
-
|
15744
|
-
|
15745
|
-
|
15793
|
+
var _a, _b, _c;
|
15794
|
+
const isRBSpot = (_c = (_b = (_a = this.data) === null || _a === void 0 ? void 0 : _a.spot) === null || _b === void 0 ? void 0 : _b.startsWith('rb')) !== null && _c !== void 0 ? _c : false;
|
15795
|
+
if (!isRBSpot) {
|
15796
|
+
// Adjust text elements font size based on the scale factor
|
15797
|
+
this.adjustFontSize(event.detail.scale);
|
15798
|
+
}
|
15746
15799
|
}
|
15747
15800
|
adjustFontSize(elementScale) {
|
15748
15801
|
var _a;
|
15749
|
-
const scaleFactor =
|
15802
|
+
const scaleFactor = calculateScaleFactor(elementScale);
|
15750
15803
|
// Find all text elements within the shadow root
|
15751
15804
|
const elements = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll('h1, h2, h3, h4, p, span');
|
15752
15805
|
elements === null || elements === void 0 ? void 0 : elements.forEach((element) => {
|
@@ -15761,35 +15814,6 @@ if (typeof window !== 'undefined' && typeof window.customElements !== 'undefined
|
|
15761
15814
|
}
|
15762
15815
|
});
|
15763
15816
|
}
|
15764
|
-
calculateScaleFactor(elementScale) {
|
15765
|
-
// Step 1: Apply square root for non-linear scaling
|
15766
|
-
// This creates a more gradual scaling effect, especially for larger changes
|
15767
|
-
// For example:
|
15768
|
-
// - elementScale of 0.25 (1/4 size) becomes 0.5
|
15769
|
-
// - elementScale of 1 (unchanged) remains 1
|
15770
|
-
// - elementScale of 4 (4x size) becomes 2
|
15771
|
-
const baseFactor = Math.sqrt(elementScale);
|
15772
|
-
// Step 2: Apply additional dampening to further soften the scaling effect
|
15773
|
-
// The dampening factor (0.5) can be adjusted:
|
15774
|
-
// - Lower values (closer to 0) make scaling more subtle
|
15775
|
-
// - Higher values (closer to 1) make scaling more pronounced
|
15776
|
-
const dampening = 0.5;
|
15777
|
-
// Calculate the scaleFactor:
|
15778
|
-
// 1. (baseFactor - 1) represents the change from the original size
|
15779
|
-
// 2. Multiply by dampening to reduce the effect
|
15780
|
-
// 3. Add 1 to center the scaling around the original size
|
15781
|
-
// For example, if baseFactor is 2:
|
15782
|
-
// scaleFactor = 1 + (2 - 1) * 0.5 = 1.5
|
15783
|
-
const scaleFactor = 1 + (baseFactor - 1) * dampening;
|
15784
|
-
// Step 3: Define the allowed range for the scale factor
|
15785
|
-
// This ensures that the font size never changes too drastically
|
15786
|
-
const minScale = 0.5; // Font will never be smaller than 90% of original
|
15787
|
-
const maxScale = 1.5; // Font will never be larger than 110% of original
|
15788
|
-
// Step 4: Clamp the scale factor to the defined range
|
15789
|
-
// Math.min ensures the value doesn't exceed maxScale
|
15790
|
-
// Math.max ensures the value isn't less than minScale
|
15791
|
-
return Math.max(minScale, Math.min(maxScale, scaleFactor));
|
15792
|
-
}
|
15793
15817
|
/**
|
15794
15818
|
* Spot element rendering
|
15795
15819
|
* #########################################################
|
@@ -15840,6 +15864,7 @@ class ElementService {
|
|
15840
15864
|
}
|
15841
15865
|
const spot = document.createElement(SPOT_ELEMENT_TAG);
|
15842
15866
|
spot.data = {
|
15867
|
+
spot: config === null || config === void 0 ? void 0 : config.spot,
|
15843
15868
|
fluid: (_a = config === null || config === void 0 ? void 0 : config.fluid) !== null && _a !== void 0 ? _a : false,
|
15844
15869
|
...config,
|
15845
15870
|
};
|
@@ -15861,6 +15886,7 @@ class ElementService {
|
|
15861
15886
|
}
|
15862
15887
|
const carousel = document.createElement(CAROUSEL_ELEMENT_TAG);
|
15863
15888
|
carousel.data = {
|
15889
|
+
spot: config === null || config === void 0 ? void 0 : config.spot,
|
15864
15890
|
fluid: false,
|
15865
15891
|
...config,
|
15866
15892
|
};
|
@@ -16745,12 +16771,7 @@ function wideSkyscraperV1Template(spot) {
|
|
16745
16771
|
|
16746
16772
|
const STYLES$7 = ({ primaryImage, mobilePrimaryImage = primaryImage }, { prefix }) => `
|
16747
16773
|
<style>
|
16748
|
-
|
16749
|
-
min-width: 320px;
|
16750
|
-
min-height: 223px;
|
16751
|
-
}
|
16752
|
-
|
16753
|
-
.${prefix}__content {
|
16774
|
+
.${prefix} {
|
16754
16775
|
display: block;
|
16755
16776
|
width: 100%;
|
16756
16777
|
height: 100%;
|
@@ -16759,10 +16780,11 @@ const STYLES$7 = ({ primaryImage, mobilePrimaryImage = primaryImage }, { prefix
|
|
16759
16780
|
background-repeat: no-repeat;
|
16760
16781
|
background-position: center;
|
16761
16782
|
cursor: pointer;
|
16783
|
+
container-type: inline-size;
|
16762
16784
|
}
|
16763
16785
|
|
16764
|
-
@
|
16765
|
-
.${prefix}
|
16786
|
+
@container (min-width: 640px) {
|
16787
|
+
.${prefix} {
|
16766
16788
|
background-image: url("${primaryImage}");
|
16767
16789
|
}
|
16768
16790
|
}
|
@@ -16772,7 +16794,7 @@ function rbCollectionBannerWithoutTextBlockTemplate(spot, config) {
|
|
16772
16794
|
const { prefix = '' } = config;
|
16773
16795
|
return `
|
16774
16796
|
${STYLES$7(spot, config)}
|
16775
|
-
<div class="${prefix}
|
16797
|
+
<div class="${prefix}"></div>
|
16776
16798
|
`;
|
16777
16799
|
}
|
16778
16800
|
|
@@ -16781,16 +16803,6 @@ const STYLES$6 = ({ textColor = '#ffffff', ctaTextColor = textColor, ctaBorderCo
|
|
16781
16803
|
return `
|
16782
16804
|
<style>
|
16783
16805
|
.${prefix} {
|
16784
|
-
min-width: 320px;
|
16785
|
-
min-height: 388px;
|
16786
|
-
width: 100%;
|
16787
|
-
height: 100%;
|
16788
|
-
display: block;
|
16789
|
-
position: relative;
|
16790
|
-
container-type: inline-size;
|
16791
|
-
}
|
16792
|
-
|
16793
|
-
.${prefix}__content {
|
16794
16806
|
display: flex;
|
16795
16807
|
flex-direction: column;
|
16796
16808
|
justify-content: flex-end;
|
@@ -16805,6 +16817,7 @@ const STYLES$6 = ({ textColor = '#ffffff', ctaTextColor = textColor, ctaBorderCo
|
|
16805
16817
|
box-sizing: border-box;
|
16806
16818
|
color: ${textColor};
|
16807
16819
|
cursor: pointer;
|
16820
|
+
container-type: inline-size;
|
16808
16821
|
}
|
16809
16822
|
|
16810
16823
|
.${prefix}__text {
|
@@ -16849,17 +16862,17 @@ const STYLES$6 = ({ textColor = '#ffffff', ctaTextColor = textColor, ctaBorderCo
|
|
16849
16862
|
transition: background-color 0.3s ease;
|
16850
16863
|
}
|
16851
16864
|
|
16852
|
-
.${prefix}
|
16865
|
+
.${prefix}:hover .cta-button {
|
16853
16866
|
background-color: ${ctaBorderColor.length === 7 ? `${ctaBorderColor}15` : `${ctaBorderColor}`};
|
16854
16867
|
}
|
16855
16868
|
|
16856
|
-
@
|
16857
|
-
.${prefix}
|
16869
|
+
@container (min-width: 640px) {
|
16870
|
+
.${prefix} {
|
16858
16871
|
background-image: linear-gradient(to top, ${linearGradient}), url("${primaryImage}");
|
16859
16872
|
}
|
16860
16873
|
}
|
16861
16874
|
|
16862
|
-
@
|
16875
|
+
@container (min-width: 768px) {
|
16863
16876
|
.${prefix}__primary-image {
|
16864
16877
|
width: 66.66666%;
|
16865
16878
|
height: 100%;
|
@@ -16870,7 +16883,7 @@ const STYLES$6 = ({ textColor = '#ffffff', ctaTextColor = textColor, ctaBorderCo
|
|
16870
16883
|
height: 100%;
|
16871
16884
|
width: 33.33333%;
|
16872
16885
|
}
|
16873
|
-
|
16886
|
+
|
16874
16887
|
.${prefix}__secondary-image {
|
16875
16888
|
width: 100%;
|
16876
16889
|
height: 50%;
|
@@ -16879,7 +16892,7 @@ const STYLES$6 = ({ textColor = '#ffffff', ctaTextColor = textColor, ctaBorderCo
|
|
16879
16892
|
.${prefix}__header {
|
16880
16893
|
font-size: 22px;
|
16881
16894
|
}
|
16882
|
-
|
16895
|
+
|
16883
16896
|
.${prefix}__description {
|
16884
16897
|
font-size: 12px;
|
16885
16898
|
}
|
@@ -16889,7 +16902,7 @@ const STYLES$6 = ({ textColor = '#ffffff', ctaTextColor = textColor, ctaBorderCo
|
|
16889
16902
|
}
|
16890
16903
|
}
|
16891
16904
|
|
16892
|
-
@
|
16905
|
+
@container (min-width: 1024px) {
|
16893
16906
|
.${prefix}__header {
|
16894
16907
|
font-size: 24px;
|
16895
16908
|
}
|
@@ -16903,11 +16916,11 @@ const STYLES$6 = ({ textColor = '#ffffff', ctaTextColor = textColor, ctaBorderCo
|
|
16903
16916
|
}
|
16904
16917
|
}
|
16905
16918
|
|
16906
|
-
@
|
16919
|
+
@container (min-width: 1280px) {
|
16907
16920
|
.${prefix}__header {
|
16908
16921
|
font-size: 28px;
|
16909
16922
|
}
|
16910
|
-
|
16923
|
+
|
16911
16924
|
.${prefix}__description {
|
16912
16925
|
font-size: 14px;
|
16913
16926
|
}
|
@@ -16927,13 +16940,11 @@ function rbHomepageHeroFullImageTemplate(spot, config) {
|
|
16927
16940
|
${GFONT_CORMORANT}
|
16928
16941
|
${STYLES$6(spot, config)}
|
16929
16942
|
<div class="${prefix}">
|
16930
|
-
|
16931
|
-
|
16932
|
-
|
16933
|
-
|
16934
|
-
|
16935
|
-
</div>
|
16936
|
-
</div>
|
16943
|
+
<div class="${prefix}__text">
|
16944
|
+
${spot.header ? `<h2 class="${prefix}__header">${spot.header}</h2>` : ''}
|
16945
|
+
${spot.description ? `<p class="${prefix}__description">${spot.description}</p>` : ''}
|
16946
|
+
${spot.ctaText ? `<span class="${prefix}__cta-button">${spot.ctaText}</span>` : ''}
|
16947
|
+
</div>
|
16937
16948
|
</div>
|
16938
16949
|
`;
|
16939
16950
|
}
|
@@ -16941,8 +16952,6 @@ function rbHomepageHeroFullImageTemplate(spot, config) {
|
|
16941
16952
|
const STYLES$5 = ({ textColor = '#212121', backgroundColor = '#e8e6de', ctaTextColor = textColor, primaryImage, mobilePrimaryImage = primaryImage, secondaryImage, mobileSecondaryImage = secondaryImage, }, { prefix }) => `
|
16942
16953
|
<style>
|
16943
16954
|
.${prefix} {
|
16944
|
-
min-width: 320px;
|
16945
|
-
min-height: 388px;
|
16946
16955
|
width: 100%;
|
16947
16956
|
height: 100%;
|
16948
16957
|
display: block;
|
@@ -16954,7 +16963,7 @@ const STYLES$5 = ({ textColor = '#212121', backgroundColor = '#e8e6de', ctaTextC
|
|
16954
16963
|
width: 100%;
|
16955
16964
|
height: 100%;
|
16956
16965
|
display: flex;
|
16957
|
-
flex-direction: column;
|
16966
|
+
flex-direction: column;
|
16958
16967
|
background-color: transparent;
|
16959
16968
|
gap: 5px;
|
16960
16969
|
color: inherit;
|
@@ -17041,7 +17050,7 @@ const STYLES$5 = ({ textColor = '#212121', backgroundColor = '#e8e6de', ctaTextC
|
|
17041
17050
|
opacity: 0.8;
|
17042
17051
|
}
|
17043
17052
|
|
17044
|
-
@
|
17053
|
+
@container (min-width: 640px) {
|
17045
17054
|
.${prefix}__primary-image {
|
17046
17055
|
background-image: url("${primaryImage}");
|
17047
17056
|
}
|
@@ -17051,7 +17060,7 @@ const STYLES$5 = ({ textColor = '#212121', backgroundColor = '#e8e6de', ctaTextC
|
|
17051
17060
|
}
|
17052
17061
|
}
|
17053
17062
|
|
17054
|
-
@
|
17063
|
+
@container (min-width: 768px) {
|
17055
17064
|
.${prefix}__content {
|
17056
17065
|
flex-direction: row;
|
17057
17066
|
}
|
@@ -17076,6 +17085,39 @@ const STYLES$5 = ({ textColor = '#212121', backgroundColor = '#e8e6de', ctaTextC
|
|
17076
17085
|
width: 100%;
|
17077
17086
|
height: 50%;
|
17078
17087
|
}
|
17088
|
+
.${prefix}__header {
|
17089
|
+
font-size: 22px;
|
17090
|
+
}
|
17091
|
+
.${prefix}__description {
|
17092
|
+
font-size: 12px;
|
17093
|
+
}
|
17094
|
+
.${prefix}__cta-button {
|
17095
|
+
font-size: 12px;
|
17096
|
+
}
|
17097
|
+
}
|
17098
|
+
|
17099
|
+
@container (min-width: 1024px) {
|
17100
|
+
.${prefix}__header {
|
17101
|
+
font-size: 24px;
|
17102
|
+
}
|
17103
|
+
.${prefix}__description {
|
17104
|
+
font-size: 13px;
|
17105
|
+
}
|
17106
|
+
.${prefix}__cta-button {
|
17107
|
+
font-size: 13px;
|
17108
|
+
}
|
17109
|
+
}
|
17110
|
+
|
17111
|
+
@container (min-width: 1280px) {
|
17112
|
+
.${prefix}__header {
|
17113
|
+
font-size: 28px;
|
17114
|
+
}
|
17115
|
+
.${prefix}__description {
|
17116
|
+
font-size: 14px;
|
17117
|
+
}
|
17118
|
+
.${prefix}__cta-button {
|
17119
|
+
font-size: 14px;
|
17120
|
+
}
|
17079
17121
|
}
|
17080
17122
|
</style>
|
17081
17123
|
`;
|
@@ -17105,23 +17147,15 @@ function rbHomepageHeroThreeTileTemplate(spot, config) {
|
|
17105
17147
|
const STYLES$4 = ({ textColor = '#212121', backgroundColor = '#e8e6de', ctaTextColor = textColor, primaryImage, mobilePrimaryImage = primaryImage, }, { prefix }) => `
|
17106
17148
|
<style>
|
17107
17149
|
.${prefix} {
|
17108
|
-
min-width: 320px;
|
17109
|
-
min-height: 388px;
|
17110
|
-
width: 100%;
|
17111
|
-
height: 100%;
|
17112
|
-
display: block;
|
17113
|
-
position: relative;
|
17114
|
-
container-type: inline-size;
|
17115
|
-
}
|
17116
|
-
|
17117
|
-
.${prefix}__content {
|
17118
17150
|
width: 100%;
|
17119
17151
|
height: 100%;
|
17120
17152
|
display: flex;
|
17121
|
-
flex-direction: column-reverse;
|
17153
|
+
flex-direction: column-reverse;
|
17122
17154
|
background-color: transparent;
|
17123
17155
|
gap: 5px;
|
17124
17156
|
cursor: pointer;
|
17157
|
+
container-type: inline-size;
|
17158
|
+
position: relative;
|
17125
17159
|
}
|
17126
17160
|
|
17127
17161
|
.${prefix}__image {
|
@@ -17166,7 +17200,7 @@ const STYLES$4 = ({ textColor = '#212121', backgroundColor = '#e8e6de', ctaTextC
|
|
17166
17200
|
font-style: normal;
|
17167
17201
|
font-weight: 400;
|
17168
17202
|
}
|
17169
|
-
|
17203
|
+
|
17170
17204
|
.${prefix}__cta-button {
|
17171
17205
|
color: ${ctaTextColor};
|
17172
17206
|
background-color: transparent;
|
@@ -17187,25 +17221,57 @@ const STYLES$4 = ({ textColor = '#212121', backgroundColor = '#e8e6de', ctaTextC
|
|
17187
17221
|
opacity: 0.8;
|
17188
17222
|
}
|
17189
17223
|
|
17190
|
-
@
|
17224
|
+
@container (min-width: 640px) {
|
17191
17225
|
.${prefix}__image {
|
17192
17226
|
background-image: url("${primaryImage}");
|
17193
17227
|
}
|
17194
17228
|
}
|
17195
|
-
|
17196
|
-
|
17229
|
+
|
17230
|
+
@container (min-width: 768px) {
|
17231
|
+
.${prefix} {
|
17197
17232
|
flex-direction: row;
|
17198
17233
|
}
|
17199
|
-
|
17200
17234
|
.${prefix}__image {
|
17201
17235
|
width: 66.66666%;
|
17202
17236
|
height: 100%;
|
17203
17237
|
}
|
17204
|
-
|
17205
17238
|
.${prefix}__text {
|
17206
17239
|
width: 33.33333%;
|
17207
17240
|
height: 100%;
|
17208
17241
|
}
|
17242
|
+
.${prefix}__header {
|
17243
|
+
font-size: 22px;
|
17244
|
+
}
|
17245
|
+
.${prefix}__description {
|
17246
|
+
font-size: 12px;
|
17247
|
+
}
|
17248
|
+
.${prefix}__cta-button {
|
17249
|
+
font-size: 12px;
|
17250
|
+
}
|
17251
|
+
}
|
17252
|
+
|
17253
|
+
@container (min-width: 1024px) {
|
17254
|
+
.${prefix}__header {
|
17255
|
+
font-size: 24px;
|
17256
|
+
}
|
17257
|
+
.${prefix}__description {
|
17258
|
+
font-size: 13px;
|
17259
|
+
}
|
17260
|
+
.${prefix}__cta-button {
|
17261
|
+
font-size: 13px;
|
17262
|
+
}
|
17263
|
+
}
|
17264
|
+
|
17265
|
+
@container (min-width: 1280px) {
|
17266
|
+
.${prefix}__header {
|
17267
|
+
font-size: 28px;
|
17268
|
+
}
|
17269
|
+
.${prefix}__description {
|
17270
|
+
font-size: 14px;
|
17271
|
+
}
|
17272
|
+
.${prefix}__cta-button {
|
17273
|
+
font-size: 14px;
|
17274
|
+
}
|
17209
17275
|
}
|
17210
17276
|
</style>
|
17211
17277
|
`;
|
@@ -17217,14 +17283,12 @@ function rbHomepageHeroTwoTileTemplate(spot, config) {
|
|
17217
17283
|
${GFONT_CORMORANT}
|
17218
17284
|
${STYLES$4(spot, config)}
|
17219
17285
|
<div class="${prefix}">
|
17220
|
-
<div class="${prefix}
|
17221
|
-
|
17222
|
-
|
17223
|
-
|
17224
|
-
${spot.ctaText ? `<span class="${prefix}__cta-button">${spot.ctaText}</span>` : ''}
|
17225
|
-
</div>
|
17226
|
-
<div class="${prefix}__image"></div>
|
17286
|
+
<div class="${prefix}__text">
|
17287
|
+
${spot.header ? `<h2 class="${prefix}__header">${spot.header}</h2>` : ''}
|
17288
|
+
${spot.description ? `<p class="${prefix}__description">${spot.description}</p>` : ''}
|
17289
|
+
${spot.ctaText ? `<span class="${prefix}__cta-button">${spot.ctaText}</span>` : ''}
|
17227
17290
|
</div>
|
17291
|
+
<div class="${prefix}__image"></div>
|
17228
17292
|
</div>
|
17229
17293
|
`;
|
17230
17294
|
}
|
@@ -17233,12 +17297,7 @@ const STYLES$3 = ({ textColor = '#ffffff', ctaTextColor = textColor, ctaBorderCo
|
|
17233
17297
|
const linearGradient = linearGradientColorStop(overlay || [], 'rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0) 30%');
|
17234
17298
|
return `
|
17235
17299
|
<style>
|
17236
|
-
|
17237
|
-
min-width: 320px;
|
17238
|
-
min-height: 334px;
|
17239
|
-
}
|
17240
|
-
|
17241
|
-
.${prefix}__content {
|
17300
|
+
.${prefix} {
|
17242
17301
|
width: 100%;
|
17243
17302
|
height: 100%;
|
17244
17303
|
display: flex;
|
@@ -17252,6 +17311,7 @@ const STYLES$3 = ({ textColor = '#ffffff', ctaTextColor = textColor, ctaBorderCo
|
|
17252
17311
|
overflow: hidden;
|
17253
17312
|
cursor: pointer;
|
17254
17313
|
color: ${textColor};
|
17314
|
+
container-type: inline-size;
|
17255
17315
|
}
|
17256
17316
|
|
17257
17317
|
.${prefix}__text {
|
@@ -17298,17 +17358,17 @@ const STYLES$3 = ({ textColor = '#ffffff', ctaTextColor = textColor, ctaBorderCo
|
|
17298
17358
|
font-weight: 400;
|
17299
17359
|
}
|
17300
17360
|
|
17301
|
-
.${prefix}
|
17361
|
+
.${prefix}:hover .${prefix}__cta-button {
|
17302
17362
|
background-color: ${ctaBorderColor.length === 7 ? `${ctaBorderColor}15` : `${ctaBorderColor}`};
|
17303
17363
|
}
|
17304
17364
|
|
17305
|
-
@
|
17306
|
-
.${prefix}
|
17365
|
+
@container (min-width: 640px) {
|
17366
|
+
.${prefix} {
|
17307
17367
|
background-image: linear-gradient(to top, ${linearGradient}), url("${primaryImage}");
|
17308
17368
|
}
|
17309
17369
|
}
|
17310
17370
|
|
17311
|
-
@
|
17371
|
+
@container (min-width: 768px) {
|
17312
17372
|
.${prefix}__text {
|
17313
17373
|
padding: 25px;
|
17314
17374
|
}
|
@@ -17327,7 +17387,7 @@ const STYLES$3 = ({ textColor = '#ffffff', ctaTextColor = textColor, ctaBorderCo
|
|
17327
17387
|
}
|
17328
17388
|
}
|
17329
17389
|
|
17330
|
-
@
|
17390
|
+
@container (min-width: 1024px) {
|
17331
17391
|
.${prefix}__text {
|
17332
17392
|
padding: 30px;
|
17333
17393
|
}
|
@@ -17345,7 +17405,7 @@ const STYLES$3 = ({ textColor = '#ffffff', ctaTextColor = textColor, ctaBorderCo
|
|
17345
17405
|
}
|
17346
17406
|
}
|
17347
17407
|
|
17348
|
-
@
|
17408
|
+
@container (min-width: 1280px) {
|
17349
17409
|
.${prefix}__cta-button {
|
17350
17410
|
font-size: 14px;
|
17351
17411
|
}
|
@@ -17360,7 +17420,7 @@ function rbLargeCategoryImageToutTemplate(spot, config) {
|
|
17360
17420
|
${GFONT_SOURCE_SANS_3}
|
17361
17421
|
${GFONT_CORMORANT}
|
17362
17422
|
${STYLES$3(spot, config)}
|
17363
|
-
<div class="${prefix}
|
17423
|
+
<div class="${prefix}">
|
17364
17424
|
<div class="${prefix}__text">
|
17365
17425
|
${spot.header ? `<h2 class="${prefix}__header">${spot.header}</h2>` : ''}
|
17366
17426
|
${spot.description ? `<p class="${prefix}__description">${spot.description}</p>` : ''}
|
@@ -17374,12 +17434,7 @@ const STYLES$2 = ({ textColor = '#ffffff', primaryImage, mobilePrimaryImage = pr
|
|
17374
17434
|
const linearGradient = linearGradientColorStop(overlay || [], 'rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0) 30%');
|
17375
17435
|
return `
|
17376
17436
|
<style>
|
17377
|
-
|
17378
|
-
min-width: 320px;
|
17379
|
-
min-height: 150px;
|
17380
|
-
}
|
17381
|
-
|
17382
|
-
.${prefix}__content {
|
17437
|
+
.${prefix} {
|
17383
17438
|
width: 100%;
|
17384
17439
|
height: 100%;
|
17385
17440
|
display: flex;
|
@@ -17392,6 +17447,7 @@ const STYLES$2 = ({ textColor = '#ffffff', primaryImage, mobilePrimaryImage = pr
|
|
17392
17447
|
background-size: cover;
|
17393
17448
|
background-position: center;
|
17394
17449
|
background-repeat: no-repeat;
|
17450
|
+
container-type: inline-size;
|
17395
17451
|
}
|
17396
17452
|
|
17397
17453
|
.${prefix}__text {
|
@@ -17409,25 +17465,25 @@ const STYLES$2 = ({ textColor = '#ffffff', primaryImage, mobilePrimaryImage = pr
|
|
17409
17465
|
margin: 0;
|
17410
17466
|
}
|
17411
17467
|
|
17412
|
-
@
|
17413
|
-
.${prefix}
|
17468
|
+
@container (min-width: 640px) {
|
17469
|
+
.${prefix} {
|
17414
17470
|
background-image: linear-gradient(to top, ${linearGradient}), url("${primaryImage}");
|
17415
17471
|
}
|
17416
17472
|
}
|
17417
17473
|
|
17418
|
-
@
|
17474
|
+
@container (min-width: 768px) {
|
17419
17475
|
.${prefix}__header {
|
17420
17476
|
font-size: 22px;
|
17421
17477
|
}
|
17422
17478
|
}
|
17423
17479
|
|
17424
|
-
@
|
17480
|
+
@container (min-width: 1024px) {
|
17425
17481
|
.${prefix}__header {
|
17426
17482
|
font-size: 24px;
|
17427
17483
|
}
|
17428
17484
|
}
|
17429
17485
|
|
17430
|
-
@
|
17486
|
+
@container (min-width: 1280px) {
|
17431
17487
|
.${prefix}__header {
|
17432
17488
|
font-size: 28px;
|
17433
17489
|
}
|
@@ -17441,7 +17497,7 @@ function rbNavigationBannerTemplate(spot, config) {
|
|
17441
17497
|
${GFONT_PRECONNECT}
|
17442
17498
|
${GFONT_SOURCE_SANS_3}
|
17443
17499
|
${STYLES$2(spot, config)}
|
17444
|
-
<div class="${prefix}
|
17500
|
+
<div class="${prefix}">
|
17445
17501
|
<div class="${prefix}__text">
|
17446
17502
|
${spot.header ? `<h2 class="${prefix}__header">${spot.header}</h2>` : ''}
|
17447
17503
|
</div>
|
@@ -17453,12 +17509,7 @@ const STYLES$1 = ({ textColor = '#ffffff', primaryImage, mobilePrimaryImage = pr
|
|
17453
17509
|
const linearGradient = linearGradientColorStop(overlay || [], 'rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0) 30%');
|
17454
17510
|
return `
|
17455
17511
|
<style>
|
17456
|
-
|
17457
|
-
min-width: 165px;
|
17458
|
-
min-height: 300px;
|
17459
|
-
}
|
17460
|
-
|
17461
|
-
.${prefix}__content {
|
17512
|
+
.${prefix} {
|
17462
17513
|
width: 100%;
|
17463
17514
|
height: 100%;
|
17464
17515
|
display: flex;
|
@@ -17471,6 +17522,7 @@ const STYLES$1 = ({ textColor = '#ffffff', primaryImage, mobilePrimaryImage = pr
|
|
17471
17522
|
border-radius: 5px;
|
17472
17523
|
overflow: hidden;
|
17473
17524
|
cursor: pointer;
|
17525
|
+
container-type: inline-size;
|
17474
17526
|
}
|
17475
17527
|
|
17476
17528
|
.${prefix}__text {
|
@@ -17485,12 +17537,11 @@ const STYLES$1 = ({ textColor = '#ffffff', primaryImage, mobilePrimaryImage = pr
|
|
17485
17537
|
font-family: "Source Sans 3", system-ui;
|
17486
17538
|
font-style: normal;
|
17487
17539
|
font-weight: 400;
|
17488
|
-
line-height: normal;
|
17489
17540
|
margin: 0;
|
17490
17541
|
}
|
17491
17542
|
|
17492
|
-
@
|
17493
|
-
.${prefix}
|
17543
|
+
@container (min-width: 640px) {
|
17544
|
+
.${prefix} {
|
17494
17545
|
background-image: linear-gradient(to top, ${linearGradient}), url("${primaryImage}");
|
17495
17546
|
}
|
17496
17547
|
}
|
@@ -17503,7 +17554,7 @@ function rbSmallCategoryImageToutTemplate(spot, config) {
|
|
17503
17554
|
${GFONT_PRECONNECT}
|
17504
17555
|
${GFONT_CORMORANT}
|
17505
17556
|
${STYLES$1(spot, config)}
|
17506
|
-
<div class="${prefix}
|
17557
|
+
<div class="${prefix}">
|
17507
17558
|
<div class="${prefix}__text">
|
17508
17559
|
${spot.header ? `<h2 class="${prefix}__header">${spot.header}</h2>` : ''}
|
17509
17560
|
</div>
|
@@ -17513,12 +17564,7 @@ function rbSmallCategoryImageToutTemplate(spot, config) {
|
|
17513
17564
|
|
17514
17565
|
const STYLES = ({ textColor = '#000000', backgroundColor = 'transparent', primaryImage, mobilePrimaryImage = primaryImage, }, { prefix }) => `
|
17515
17566
|
<style>
|
17516
|
-
|
17517
|
-
min-width: 165px;
|
17518
|
-
min-height: 250px;
|
17519
|
-
}
|
17520
|
-
|
17521
|
-
.${prefix}__content {
|
17567
|
+
.${prefix} {
|
17522
17568
|
width: 100%;
|
17523
17569
|
height: 100%;
|
17524
17570
|
background-color: ${backgroundColor};
|
@@ -17526,6 +17572,7 @@ const STYLES = ({ textColor = '#000000', backgroundColor = 'transparent', primar
|
|
17526
17572
|
display: flex;
|
17527
17573
|
flex-direction: column;
|
17528
17574
|
border-radius: 5px;
|
17575
|
+
container-type: inline-size;
|
17529
17576
|
}
|
17530
17577
|
|
17531
17578
|
.${prefix}__image {
|
@@ -17557,11 +17604,10 @@ const STYLES = ({ textColor = '#000000', backgroundColor = 'transparent', primar
|
|
17557
17604
|
font-family: "Source Sans 3", system-ui;
|
17558
17605
|
font-style: normal;
|
17559
17606
|
font-weight: 400;
|
17560
|
-
line-height: normal;
|
17561
17607
|
margin: 0;
|
17562
17608
|
}
|
17563
17609
|
|
17564
|
-
@
|
17610
|
+
@container (min-width: 640px) {
|
17565
17611
|
.${prefix}__image {
|
17566
17612
|
background-image: url("${primaryImage}");
|
17567
17613
|
}
|
@@ -17574,7 +17620,7 @@ function rbSmallDiscoverToutTemplate(spot, config) {
|
|
17574
17620
|
${GFONT_PRECONNECT}
|
17575
17621
|
${GFONT_CORMORANT}
|
17576
17622
|
${STYLES(spot, config)}
|
17577
|
-
<div class="${prefix}
|
17623
|
+
<div class="${prefix}">
|
17578
17624
|
<div class="${prefix}__image"></div>
|
17579
17625
|
<div class="${prefix}__text">
|
17580
17626
|
${spot.header ? `<h2 class="${prefix}__header">${spot.header}</h2>` : ''}
|
@@ -17755,8 +17801,6 @@ class EventService {
|
|
17755
17801
|
element,
|
17756
17802
|
impressionTracked: false,
|
17757
17803
|
});
|
17758
|
-
// Handle resize observer
|
17759
|
-
// this.handleResizeObserver(placementId, spot, element);
|
17760
17804
|
// Handle intersection observer
|
17761
17805
|
this.handleIntersectionObserver(placementId, spot, element);
|
17762
17806
|
// Attach click event listener
|
@@ -17794,35 +17838,6 @@ class EventService {
|
|
17794
17838
|
this.activeSpots.delete(spotId);
|
17795
17839
|
}
|
17796
17840
|
}
|
17797
|
-
// private handleResizeObserver(placementId: string, spot: ISpot, element: HTMLElement): void {
|
17798
|
-
// // this.resizeObserver = new ResizeObserverService({
|
17799
|
-
// // element,
|
17800
|
-
// // maxSize: {
|
17801
|
-
// // width: spot.width,
|
17802
|
-
// // height: spot.height,
|
17803
|
-
// // },
|
17804
|
-
// // minScale: 0.25,
|
17805
|
-
// // });
|
17806
|
-
//
|
17807
|
-
// const sizeChangedCb = (event: ISizeChangedEvent) => {
|
17808
|
-
// // Publish spot resized event
|
17809
|
-
// this.pubSub.publish(RMN_SPOT_EVENT.RESIZED, {
|
17810
|
-
// placementId,
|
17811
|
-
// spotId: spot.id,
|
17812
|
-
// scale: event.detail.scale,
|
17813
|
-
// previousDimensions: {
|
17814
|
-
// width: event.detail.width,
|
17815
|
-
// height: event.detail.height,
|
17816
|
-
// },
|
17817
|
-
// currentDimensions: {
|
17818
|
-
// width: event.detail.newWidth,
|
17819
|
-
// height: event.detail.newHeight,
|
17820
|
-
// },
|
17821
|
-
// });
|
17822
|
-
// };
|
17823
|
-
//
|
17824
|
-
// element.addEventListener('spotSizeChanged', sizeChangedCb as EventListener);
|
17825
|
-
// }
|
17826
17841
|
handleIntersectionObserver(placementId, spot, element) {
|
17827
17842
|
const spotIsVisibleCb = async () => {
|
17828
17843
|
var _a, _b;
|
@@ -18031,6 +18046,7 @@ class LiquidCommerceRmnClient {
|
|
18031
18046
|
const carouselElement = this.elementService.createCarouselElement({
|
18032
18047
|
slides: carouselSlides,
|
18033
18048
|
config: {
|
18049
|
+
fluid: config === null || config === void 0 ? void 0 : config.fluid,
|
18034
18050
|
width: maxWidth,
|
18035
18051
|
height: maxHeight,
|
18036
18052
|
minScale: (_a = config === null || config === void 0 ? void 0 : config.minScale) !== null && _a !== void 0 ? _a : 0.25, // Scale down to 25% of the original size
|
@@ -18064,6 +18080,8 @@ class LiquidCommerceRmnClient {
|
|
18064
18080
|
const spotElement = this.elementService.createSpotElement({
|
18065
18081
|
content,
|
18066
18082
|
config: {
|
18083
|
+
fluid: config === null || config === void 0 ? void 0 : config.fluid,
|
18084
|
+
spot: spot.spot,
|
18067
18085
|
width: spot.width,
|
18068
18086
|
height: spot.height,
|
18069
18087
|
minScale: (_a = config === null || config === void 0 ? void 0 : config.minScale) !== null && _a !== void 0 ? _a : 0.25, // Scale down to 25% of the original size
|