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