@designcrowd/library.brand-page 5.18.8 → 5.18.9-ast-padding-2

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.
Files changed (139) hide show
  1. package/lib/src/{CreatedOnBrandCrowd-de-de-BRbznSpr.js → CreatedOnBrandCrowd-de-de-BmLOUBDj.js} +1 -1
  2. package/lib/src/{CreatedOnBrandCrowd-en-us-DTgCvurL.js → CreatedOnBrandCrowd-en-us-DGCwedd5.js} +1 -1
  3. package/lib/src/{CreatedOnBrandCrowd-es-es-ZEi7ypLq.js → CreatedOnBrandCrowd-es-es-qfWIO62h.js} +1 -1
  4. package/lib/src/{CreatedOnBrandCrowd-fr-fr-DNDjgJA5.js → CreatedOnBrandCrowd-fr-ca-Bh6tQfv-.js} +1 -1
  5. package/lib/src/{CreatedOnBrandCrowd-fr-ca-DNDjgJA5.js → CreatedOnBrandCrowd-fr-fr-Bh6tQfv-.js} +1 -1
  6. package/lib/src/{CreatedOnBrandCrowd-pt-pt-BrKUBLlc.js → CreatedOnBrandCrowd-pt-br-DBF_gR3z.js} +1 -1
  7. package/lib/src/{CreatedOnBrandCrowd-pt-br-BrKUBLlc.js → CreatedOnBrandCrowd-pt-pt-DBF_gR3z.js} +1 -1
  8. package/lib/src/{CreatedOnDcom-de-de-ZxFuF7Zf.js → CreatedOnDcom-de-de-B1ZibTqN.js} +1 -1
  9. package/lib/src/{CreatedOnDcom-en-us-Bbe6q32b.js → CreatedOnDcom-en-us-4qS61Om_.js} +1 -1
  10. package/lib/src/{CreatedOnDcom-es-es-B1xxtqwW.js → CreatedOnDcom-es-es-yX1FaMrI.js} +1 -1
  11. package/lib/src/{CreatedOnDcom-fr-ca-dYIw-XKa.js → CreatedOnDcom-fr-ca-h5RbgiUo.js} +1 -1
  12. package/lib/src/{CreatedOnDcom-fr-fr-CdvwGLYf.js → CreatedOnDcom-fr-fr-4cJbiAWr.js} +1 -1
  13. package/lib/src/{CreatedOnDcom-pt-br-oBMlRSZf.js → CreatedOnDcom-pt-br-C0FUKVjn.js} +1 -1
  14. package/lib/src/{CreatedOnDcom-pt-pt-BA0tAdwI.js → CreatedOnDcom-pt-pt-CFstpuvQ.js} +1 -1
  15. package/lib/src/brand-page/components/contact-form/ContactForm.mixin.d.ts +4 -0
  16. package/lib/src/brand-page/components/contact-form/ContactForm.mixin.js +8 -4
  17. package/lib/src/brand-page/components/image-gallery/ImageGallery.mixin.d.ts +4 -0
  18. package/lib/src/brand-page/components/image-gallery/ImageGallery.mixin.js +4 -0
  19. package/lib/src/brand-page/components/mailing-list/MailingList.mixin.d.ts +4 -0
  20. package/lib/src/brand-page/components/mailing-list/MailingList.mixin.js +4 -1
  21. package/lib/src/brand-page/components/payment/request-payment/RequestPayment.mixin.d.ts +4 -0
  22. package/lib/src/brand-page/components/payment/request-payment/RequestPayment.mixin.js +4 -0
  23. package/lib/src/brand-page/components/payment/support-me/SupportMe.mixin.d.ts +4 -0
  24. package/lib/src/brand-page/components/payment/support-me/SupportMe.mixin.js +4 -1
  25. package/lib/src/brand-page/components/video/Video.mixin.d.ts +4 -0
  26. package/lib/src/brand-page/components/video/Video.mixin.js +4 -0
  27. package/lib/src/brand-page/constants/font.constants.d.ts +4 -4
  28. package/lib/src/brand-page/constants/font.constants.js +4 -4
  29. package/lib/src/brand-page/constants/misc.constants.d.ts +35 -0
  30. package/lib/src/brand-page/constants/misc.constants.js +51 -0
  31. package/lib/src/brand-page/models/content.model.d.ts +2 -0
  32. package/lib/src/brand-page/utils/content-padding.util.d.ts +13 -0
  33. package/lib/src/brand-page/utils/content-padding.util.js +10 -0
  34. package/lib/src/brand-page/utils/index.d.ts +1 -0
  35. package/lib/src/brand-page/utils/index.js +1 -0
  36. package/lib/src/brand-page/utils/migration/migration-17.d.ts +2 -0
  37. package/lib/src/brand-page/utils/migration/migration-17.js +60 -0
  38. package/lib/src/brand-page/utils/migration.util.js +10 -0
  39. package/lib/src/brand-page-maker/components/admin-logo-settings/AdminLogoSettings.mixin.d.ts +2 -0
  40. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.d.ts +12 -0
  41. package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.d.ts +14 -0
  42. package/lib/src/brand-page-maker/constants/config-settings-constant.js +39 -0
  43. package/lib/src/brand-page-maker/convertors/about-display-style.convertor.js +9 -1
  44. package/lib/src/brand-page-maker/convertors/banner-align-display-style.convertor.js +7 -1
  45. package/lib/src/brand-page-maker/convertors/contact-layout-style.convertor.js +6 -1
  46. package/lib/src/brand-page-maker/models/content-settings.js +39 -2
  47. package/lib/src/brand-page-maker/stores/ai-checkpoint/ai-checkpoint-store.d.ts +12 -0
  48. package/lib/src/{bundled-translations-D1q3rSEz.js → bundled-translations-BUyt4scr.js} +9 -9
  49. package/lib/src/{bundled-translations.de-DE-BxqLLwbh.js → bundled-translations.de-DE-DEw_OVai.js} +1 -1
  50. package/lib/src/{bundled-translations.es-ES-uh249NlJ.js → bundled-translations.es-ES-CFKWmkgY.js} +17 -17
  51. package/lib/src/{bundled-translations.fr-CA-BEQmv2fX.js → bundled-translations.fr-CA-DCl5LJS4.js} +1 -1
  52. package/lib/src/{bundled-translations.fr-FR-BnNuCojH.js → bundled-translations.fr-FR-B5BjgllA.js} +1 -1
  53. package/lib/src/{bundled-translations.pt-BR-CJUOxVlq.js → bundled-translations.pt-BR-5PWpMPuM.js} +1 -1
  54. package/lib/src/{bundled-translations.pt-PT-Ds9cMEqK.js → bundled-translations.pt-PT-B9_wN0HR.js} +9 -9
  55. package/lib/src/bundles/bundled-translations.de-DE.json +2 -0
  56. package/lib/src/bundles/bundled-translations.es-ES.json +2 -0
  57. package/lib/src/bundles/bundled-translations.fr-CA.json +2 -0
  58. package/lib/src/bundles/bundled-translations.fr-FR.json +2 -0
  59. package/lib/src/bundles/bundled-translations.json +2 -0
  60. package/lib/src/bundles/bundled-translations.pt-BR.json +2 -0
  61. package/lib/src/bundles/bundled-translations.pt-PT.json +2 -0
  62. package/lib/src/css/library.brand-page-brandCrowd.min.css +165 -170
  63. package/lib/src/css/library.brand-page-brandPage.min.css +165 -170
  64. package/lib/src/css/library.brand-page-designCom.min.css +165 -170
  65. package/lib/src/css/library.brand-page-preview.min.css +165 -170
  66. package/lib/src/index.mjs +1 -1
  67. package/lib/src/{lib-DZmDarKM.js → lib-B3NH7cmE.js} +21158 -21010
  68. package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.d.ts +14 -0
  69. package/lib/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.mixin.d.ts +14 -0
  70. package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItem.mixin.d.ts +12 -0
  71. package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.d.ts +12 -0
  72. package/lib/src/shared/content-settings/components/focused-content-item-settings/FocusedContentItemSettings.mixin.d.ts +12 -0
  73. package/lib/src/shared/content-settings/components/slider-field/SliderField.mixin.js +9 -0
  74. package/lib/src/shared/content-settings/store/content-settings-store.d.ts +12 -0
  75. package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.d.ts +16 -0
  76. package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.d.ts +14 -0
  77. package/lib/src/utils/minify-brand-page-metadata.js +11 -1
  78. package/package.json +1 -1
  79. package/src/brand-page/components/about-section/AboutSection.vue +10 -4
  80. package/src/brand-page/components/banner-section/BannerSection.vue +11 -4
  81. package/src/brand-page/components/booking-section/BookingSection.vue +11 -3
  82. package/src/brand-page/components/button/Button.vue +10 -2
  83. package/src/brand-page/components/contact-form/ContactForm.mixin.ts +12 -6
  84. package/src/brand-page/components/contact-form/ContactForm.vue +107 -106
  85. package/src/brand-page/components/image-gallery/ImageGallery.mixin.ts +5 -0
  86. package/src/brand-page/components/image-gallery/ImageGallery.vue +1 -1
  87. package/src/brand-page/components/mailing-list/MailingList.mixin.ts +8 -1
  88. package/src/brand-page/components/mailing-list/MailingList.vue +1 -1
  89. package/src/brand-page/components/map/Map.vue +5 -1
  90. package/src/brand-page/components/payment/request-payment/RequestPayment.mixin.ts +5 -0
  91. package/src/brand-page/components/payment/request-payment/RequestPayment.vue +1 -0
  92. package/src/brand-page/components/payment/support-me/SupportMe.mixin.ts +8 -1
  93. package/src/brand-page/components/payment/support-me/SupportMe.vue +1 -0
  94. package/src/brand-page/components/shop/Shop.vue +7 -2
  95. package/src/brand-page/components/social-links/SocialLinks.vue +7 -3
  96. package/src/brand-page/components/testimonial-section/TestimonialSection.vue +120 -11
  97. package/src/brand-page/components/text/Text.vue +12 -5
  98. package/src/brand-page/components/text-media-section/TextMediaSection.vue +11 -3
  99. package/src/brand-page/components/video/Video.mixin.ts +5 -0
  100. package/src/brand-page/components/video/Video.vue +1 -1
  101. package/src/brand-page/constants/font.constants.ts +4 -4
  102. package/src/brand-page/constants/misc.constants.ts +58 -0
  103. package/src/brand-page/models/content.model.ts +2 -0
  104. package/src/brand-page/utils/__snapshots__/migration.util.test.ts.snap +9 -3
  105. package/src/brand-page/utils/__snapshots__/migration2.util.test.ts.snap +6 -6
  106. package/src/brand-page/utils/__snapshots__/model.util.test.ts.snap +12 -12
  107. package/src/brand-page/utils/content-padding.util.test.ts +29 -0
  108. package/src/brand-page/utils/content-padding.util.ts +13 -0
  109. package/src/brand-page/utils/index.ts +1 -0
  110. package/src/brand-page/utils/migration/migration-17.ts +77 -0
  111. package/src/brand-page/utils/migration.util.test.ts +290 -0
  112. package/src/brand-page/utils/migration.util.ts +11 -0
  113. package/src/brand-page-maker/constants/config-settings-constant.ts +45 -0
  114. package/src/brand-page-maker/convertors/about-display-style.convertor.ts +10 -0
  115. package/src/brand-page-maker/convertors/banner-align-display-style.convertor.ts +8 -0
  116. package/src/brand-page-maker/convertors/contact-layout-style.convertor.test.ts +50 -0
  117. package/src/brand-page-maker/convertors/contact-layout-style.convertor.ts +8 -0
  118. package/src/brand-page-maker/models/content-settings.ts +43 -2
  119. package/src/bundles/bundled-translations.de-DE.json +2 -0
  120. package/src/bundles/bundled-translations.es-ES.json +2 -0
  121. package/src/bundles/bundled-translations.fr-CA.json +2 -0
  122. package/src/bundles/bundled-translations.fr-FR.json +2 -0
  123. package/src/bundles/bundled-translations.json +2 -0
  124. package/src/bundles/bundled-translations.pt-BR.json +2 -0
  125. package/src/bundles/bundled-translations.pt-PT.json +2 -0
  126. package/src/shared/content-settings/components/content-settings/i18n/content-settings.de-DE.json +2 -0
  127. package/src/shared/content-settings/components/content-settings/i18n/content-settings.es-ES.json +2 -0
  128. package/src/shared/content-settings/components/content-settings/i18n/content-settings.fr-CA.json +2 -0
  129. package/src/shared/content-settings/components/content-settings/i18n/content-settings.fr-FR.json +2 -0
  130. package/src/shared/content-settings/components/content-settings/i18n/content-settings.json +2 -0
  131. package/src/shared/content-settings/components/content-settings/i18n/content-settings.pt-BR.json +2 -0
  132. package/src/shared/content-settings/components/content-settings/i18n/content-settings.pt-PT.json +2 -0
  133. package/src/shared/content-settings/components/content-settings-item/ContentSettingsItem.vue +1 -1
  134. package/src/shared/content-settings/components/focused-content-item-settings/FocusedContentItemSettings.vue +2 -2
  135. package/src/shared/content-settings/components/slider-field/SliderField.mixin.ts +9 -0
  136. package/src/utils/minify-brand-page-metadata.ts +11 -1
  137. package/lib/src/brand-page/components/testimonial-section/TestimonialSection.mixin.d.ts +0 -97
  138. package/lib/src/brand-page/components/testimonial-section/TestimonialSection.mixin.js +0 -112
  139. package/src/brand-page/components/testimonial-section/TestimonialSection.mixin.ts +0 -132
@@ -1,11 +1,10 @@
1
1
  <template>
2
2
  <div data-component="social-links">
3
3
  <div
4
- class="tw-pb-8"
5
4
  :class="{
6
5
  'tw-mb-4': context.isBrandPageOrIsBrandContact,
7
6
  }"
8
- :style="containerStyles"
7
+ :style="[containerStyles, contentPaddingStyle]"
9
8
  style="container-type: inline-size"
10
9
  >
11
10
  <TextWrapper
@@ -14,7 +13,7 @@
14
13
  :text="title"
15
14
  element="h1"
16
15
  :class="textAlignClass"
17
- class="tw-py-8"
16
+ class="tw-pb-8"
18
17
  />
19
18
  <SocialLinksItems
20
19
  :id="id"
@@ -34,6 +33,7 @@ import TextWrapper from '../text-wrapper/TextWrapper.vue';
34
33
  import type { SocialLinksViewModel } from 'src/brand-page/view-models';
35
34
  import { SOCIAL_LINKS_ICON_DISPLAY_STYLES } from '@brand-page/models';
36
35
  import type { BrandPageContext, LinksItem } from '@brand-page/models';
36
+ import { contentPaddingStyle as toContentPaddingStyle } from '@brand-page/utils';
37
37
  import { computed } from 'vue';
38
38
 
39
39
  const props = withDefaults(
@@ -51,6 +51,10 @@ const containerStyles = computed((): BrandPageCssStyle => {
51
51
  return props.viewModel.backgroundStyles || {};
52
52
  });
53
53
 
54
+ const contentPaddingStyle = computed(() =>
55
+ toContentPaddingStyle(props.viewModel),
56
+ );
57
+
54
58
  const iconStyle = computed((): BrandPageCssStyle => {
55
59
  return props.viewModel.iconFillStyles || {};
56
60
  });
@@ -3,7 +3,7 @@
3
3
  data-component="testimonial-section"
4
4
  class="c_testimonial-image"
5
5
  style="container-type: inline-size"
6
- :style="viewModel.backgroundStyle"
6
+ :style="[viewModel.backgroundStyle, contentPaddingStyle]"
7
7
  >
8
8
  <div
9
9
  :class="{
@@ -201,16 +201,127 @@
201
201
  </div>
202
202
  </section>
203
203
  </template>
204
- <script>
204
+ <script setup lang="ts">
205
+ import { computed, ref, watch } from 'vue';
205
206
  import { Carousel, Icon } from '@designcrowd/fe-shared-lib';
206
- import TestimonialSectionMixin from './TestimonialSection.mixin.ts';
207
207
  import Media from '../media/Media.vue';
208
208
  import TextWrapper from '../text-wrapper/TextWrapper.vue';
209
+ import type { TestimonialSectionViewModel } from '@brand-page/view-models';
210
+ import type { BrandPageContext } from '@brand-page/models';
211
+ import {
212
+ getRenderText,
213
+ contentPaddingStyle as toContentPaddingStyle,
214
+ } from '@brand-page/utils';
215
+ import debounce from 'lodash.debounce';
216
+ import { DEVICE_CSS_TRANSITION_DELAY } from '@brand-page-maker/constants';
209
217
 
210
- export default {
211
- components: { Carousel, Media, Icon, TextWrapper },
212
- mixins: [TestimonialSectionMixin],
218
+ const DEBOUNCE_WAIT_MS = 100;
219
+
220
+ const props = withDefaults(
221
+ defineProps<{
222
+ viewModel: TestimonialSectionViewModel;
223
+ context: BrandPageContext;
224
+ isPreview?: boolean;
225
+ isMobileDevice?: boolean;
226
+ contentIndex?: number;
227
+ }>(),
228
+ {
229
+ isPreview: false,
230
+ isMobileDevice: undefined,
231
+ contentIndex: undefined,
232
+ },
233
+ );
234
+
235
+ const carouselRef = ref<any>();
236
+
237
+ const contentPaddingStyle = computed(() =>
238
+ toContentPaddingStyle(props.viewModel),
239
+ );
240
+
241
+ const textAlignClass = computed(() => ({
242
+ 'c_testimonial-big-image-text-item':
243
+ props.viewModel.displayStyle === 'big-image',
244
+ 'tw-mb-2': props.viewModel.displayStyle !== 'big-image',
245
+ }));
246
+
247
+ const navigationUniqueIndexer = computed(
248
+ () => `testimonial-${props.viewModel.id}`,
249
+ );
250
+
251
+ const swiperOptions = computed(() => ({
252
+ autoHeight: true,
253
+ navigation: {
254
+ prevEl: `.carousel__button-prev--${navigationUniqueIndexer.value}`,
255
+ nextEl: `.carousel__button-next--${navigationUniqueIndexer.value}`,
256
+ },
257
+ pagination: {
258
+ el: `.pagination--${navigationUniqueIndexer.value}`,
259
+ clickable: true,
260
+ },
261
+ }));
262
+
263
+ const renderText = (val: string): string => (val ? getRenderText(val) : '');
264
+
265
+ const forceCarouselUpdate = (): boolean => {
266
+ const shouldUpdateCarousel = Boolean(
267
+ props.isPreview &&
268
+ (props.viewModel.items.length > 1 ||
269
+ props.viewModel.displayStyle === 'big-image') &&
270
+ carouselRef.value,
271
+ );
272
+
273
+ if (shouldUpdateCarousel) {
274
+ carouselRef.value.update();
275
+
276
+ return true;
277
+ }
278
+
279
+ return false;
280
+ };
281
+
282
+ const forceCarouselUpdateSlideWidth = (): void => {
283
+ if (forceCarouselUpdate()) {
284
+ try {
285
+ const width = carouselRef.value.swiper.slidesEl.scrollWidth;
286
+
287
+ carouselRef.value.swiper.slidesEl.children.forEach(
288
+ (slide: HTMLElement) => {
289
+ const slideWidth = parseFloat(slide.style.width);
290
+
291
+ if (slideWidth !== width) {
292
+ slide.style.width = width + 'px';
293
+ }
294
+ },
295
+ );
296
+ } catch (error) {
297
+ console.warn('Testimonial: Unable to auto update slide width');
298
+ }
299
+ }
213
300
  };
301
+
302
+ const debouncedForceCarouselUpdate = debounce(() => {
303
+ forceCarouselUpdate();
304
+ }, DEBOUNCE_WAIT_MS);
305
+
306
+ watch(
307
+ () => props.viewModel,
308
+ () => {
309
+ debouncedForceCarouselUpdate();
310
+ },
311
+ { deep: true },
312
+ );
313
+
314
+ watch(
315
+ () => props.isMobileDevice,
316
+ (next, old) => {
317
+ if (next !== old) {
318
+ setTimeout(
319
+ forceCarouselUpdateSlideWidth,
320
+ DEVICE_CSS_TRANSITION_DELAY + 1,
321
+ );
322
+ }
323
+ },
324
+ );
214
325
  </script>
215
326
 
216
327
  <style scoped>
@@ -221,17 +332,15 @@ export default {
221
332
  --line-height: 1.5;
222
333
  --name-spacing: 0.75rem;
223
334
  --title-spacing: 1rem;
224
- @apply tw-relative tw-p-24 tw-box-border tw-max-w-full;
225
- padding-top: 2rem;
226
- padding-bottom: 2rem;
335
+ @apply tw-relative tw-box-border tw-max-w-full;
336
+ /* Top/bottom padding is config-bound via the Padding Control sliders (BP-5703),
337
+ applied as an inline style on the root. Horizontal padding stays responsive. */
227
338
  padding-left: 1.5rem;
228
339
  padding-right: 1.5rem;
229
340
  }
230
341
 
231
342
  @media (min-width: 767px) {
232
343
  .c_testimonial-image {
233
- padding-top: 5rem;
234
- padding-bottom: 5rem;
235
344
  padding-left: 4rem;
236
345
  padding-right: 4rem;
237
346
  }
@@ -2,7 +2,7 @@
2
2
  <div>
3
3
  <div
4
4
  v-if="!context.isBrandSite"
5
- :style="containerStyle"
5
+ :style="[containerStyle, contentPaddingStyle]"
6
6
  :class="{
7
7
  [containerClasses]: true,
8
8
  }"
@@ -15,9 +15,9 @@
15
15
  data-test-tag="text-content-text"
16
16
  />
17
17
  </div>
18
- <div v-else :style="containerStyle">
18
+ <div v-else :style="[containerStyle, contentPaddingStyle]">
19
19
  <div
20
- class="c-text-container tw-py-3 tw-px-6 grid-container tw-gap-4"
20
+ class="c-text-container tw-px-6 grid-container tw-gap-4"
21
21
  :class="{
22
22
  [containerClasses]: true,
23
23
  [gridClass]: context.isBrandSite,
@@ -41,7 +41,10 @@
41
41
  import TextWrapper from '../text-wrapper/TextWrapper.vue';
42
42
  import { computed } from 'vue';
43
43
  import type { TextViewModel } from '@brand-page/view-models';
44
- import { getRenderText } from '@brand-page/utils';
44
+ import {
45
+ getRenderText,
46
+ contentPaddingStyle as toContentPaddingStyle,
47
+ } from '@brand-page/utils';
45
48
  import type { BrandPageContext } from '@brand-page/models';
46
49
 
47
50
  interface Props {
@@ -51,6 +54,10 @@ interface Props {
51
54
 
52
55
  const props = defineProps<Props>();
53
56
 
57
+ const contentPaddingStyle = computed(() =>
58
+ toContentPaddingStyle(props.viewModel),
59
+ );
60
+
54
61
  const containerStyle = computed<any>(() => {
55
62
  const containerStyles = {} as BrandPageCssStyle;
56
63
 
@@ -83,7 +90,7 @@ const containerClasses = computed(() => {
83
90
  return '';
84
91
  }
85
92
 
86
- return 'tw-py-3 tw-px-6';
93
+ return 'tw-px-6';
87
94
  });
88
95
 
89
96
  const renderText = computed(() => {
@@ -1,12 +1,12 @@
1
1
  <template>
2
2
  <section data-component="text-media-section">
3
3
  <div
4
- class="tw-relative tw-w-full tw-box-border tw-py-8"
4
+ class="tw-relative tw-w-full tw-box-border"
5
5
  :class="{
6
6
  'tw-pl-0 tw-pr-0': hasNoPadding || !hasBrandSitePadding,
7
7
  'tw-rounded-md': hasRoundedCorners,
8
8
  }"
9
- :style="viewModel.backgroundStyle"
9
+ :style="[viewModel.backgroundStyle, contentPaddingStyle]"
10
10
  >
11
11
  <div
12
12
  :class="[
@@ -148,7 +148,11 @@ import {
148
148
  MEDIA_ONLY,
149
149
  } from '../../constants';
150
150
  import { isHexTransparent } from '@brand-page/utils/color.util';
151
- import { escapeContentText, getRenderText } from '@brand-page/utils';
151
+ import {
152
+ escapeContentText,
153
+ getRenderText,
154
+ contentPaddingStyle as toContentPaddingStyle,
155
+ } from '@brand-page/utils';
152
156
 
153
157
  const props = defineProps({
154
158
  viewModel: {
@@ -171,6 +175,10 @@ const props = defineProps({
171
175
  },
172
176
  });
173
177
 
178
+ const contentPaddingStyle = computed(() =>
179
+ toContentPaddingStyle(props.viewModel),
180
+ );
181
+
174
182
  const items = computed(() => props.viewModel.items);
175
183
 
176
184
  const shouldDisplayText = computed(
@@ -1,6 +1,7 @@
1
1
  import { defineComponent } from 'vue';
2
2
  import type { PropType } from 'vue';
3
3
  import type { VideoViewModel } from '@brand-page/view-models';
4
+ import { contentPaddingStyle as toContentPaddingStyle } from '@brand-page/utils';
4
5
  import ComponentCommonMixin from '../mixins/component-common.mixin';
5
6
  import {
6
7
  DISPLAY_STYLE_PREVIEW,
@@ -22,6 +23,10 @@ export default defineComponent({
22
23
  title: 'Video',
23
24
  }),
24
25
  computed: {
26
+ contentPaddingStyle(): { paddingTop: string; paddingBottom: string } {
27
+ return toContentPaddingStyle(this.viewModel);
28
+ },
29
+
25
30
  arrowStyle(): BrandPageCssStyle {
26
31
  return {
27
32
  color: this.viewModel.buttonStyles.style?.color,
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="c-video">
2
+ <div class="c-video" :style="contentPaddingStyle">
3
3
  <div v-if="viewModel.videoUrl">
4
4
  <!-- Start -->
5
5
  <div
@@ -8,10 +8,10 @@ export const DISPlAY_TEXT_BUTTONS = 'Button Texts';
8
8
  export const DEFAULT_TEXT_DECORATION = undefined;
9
9
  export const DEFAULT_FONT_STYLE = undefined;
10
10
 
11
- export const FONT_SIZE_TITLE = '2.25rem';
12
- export const FONT_SIZE_HEADINGS = '1.5rem';
13
- export const FONT_SIZE_BODY = '1rem';
14
- export const FONT_SIZE_PROFILE_NAME = '1.5rem';
11
+ export const FONT_SIZE_TITLE = '2.25em';
12
+ export const FONT_SIZE_HEADINGS = '1.5em';
13
+ export const FONT_SIZE_BODY = '1em';
14
+ export const FONT_SIZE_PROFILE_NAME = '1.5em';
15
15
 
16
16
  export const FONT_WEIGHT_PROFILE_NAME = '800';
17
17
  export const FONT_WEIGHT_NORMAL = 'normal';
@@ -38,6 +38,64 @@ export const ALIGN_LEFT_FULL_IMAGE = 'left-aligned-full-image';
38
38
  export const ALIGN_RIGHT_FULL_IMAGE = 'right-aligned-full-image';
39
39
  export const ALTERNATE_IMAGE = 'alternate-image';
40
40
 
41
+ /**
42
+ * Padding Control (BP-5699): the top/bottom padding each Contact Form layout
43
+ * had hard-coded before the sliders existed. Single source for new-block
44
+ * defaults (content-settings) and the migration backfill for existing pages.
45
+ * The image layouts (full-image divided and card-over-image) are 0: the bg
46
+ * image expands with the section padding (banner-style), so the default starts
47
+ * flush at the edges; the spacing inside/over the image stays fixed.
48
+ */
49
+ export const CONTACT_FORM_LAYOUT_DEFAULT_PADDING: Record<string, number> = {
50
+ '': 0, // collapsible (default on Brand Page / Brand Contact)
51
+ [ALIGN_CENTERED]: 32,
52
+ [ALIGN_CARD_CENTER]: 32,
53
+ [ALIGN_CARD_CENTER_IMAGE]: 0,
54
+ [TEXT_ONLY]: 32,
55
+ [ALIGN_LEFT_FULL_IMAGE]: 0,
56
+ [ALIGN_RIGHT_FULL_IMAGE]: 0,
57
+ };
58
+
59
+ /**
60
+ * Banner: full-bleed display styles (divided + full-width stacked) render the
61
+ * image flush to the section edges, so their top/bottom padding defaults to 0 to
62
+ * match prod — the standard 32 would push the image off the edges. Every other
63
+ * banner style keeps 32. Used by the banner display-style convertor and the
64
+ * migration backfill, mirroring contact-form's per-layout map above.
65
+ */
66
+ export const BANNER_DEFAULT_PADDING = 32;
67
+ export const BANNER_FULL_BLEED_DISPLAY_STYLES = [
68
+ ALIGN_LEFT_FULL_IMAGE,
69
+ ALIGN_RIGHT_FULL_IMAGE,
70
+ ALIGN_TOP_FULL_IMAGE,
71
+ ALIGN_BOTTOM_FULL_IMAGE,
72
+ ALIGN_MIDDLE_FULL_IMAGE,
73
+ ];
74
+ export const bannerDisplayStyleDefaultPadding = (
75
+ displayStyle?: string,
76
+ ): number =>
77
+ displayStyle && BANNER_FULL_BLEED_DISPLAY_STYLES.includes(displayStyle)
78
+ ? 0
79
+ : BANNER_DEFAULT_PADDING;
80
+
81
+ /**
82
+ * About: a flat 32 for every display style, including the two full-image styles.
83
+ * The full-image About renders the image inside the padded container, so the
84
+ * standard 32 band is the intended look. Used by the About display-style
85
+ * convertor and the migration backfill.
86
+ */
87
+ export const ABOUT_DEFAULT_PADDING = 32;
88
+
89
+ /**
90
+ * Testimonials: a single top/bottom value across both breakpoints, replacing the
91
+ * old 32px mobile / 80px desktop split. The same value applies to every display
92
+ * style (centered / big-image / columns) — they share one root, so padding does
93
+ * not vary by style. Used by the new-block default and the migration backfill.
94
+ * Default (BP-5703): 48px — the single value chosen for both breakpoints (replaces
95
+ * the old 32px mobile / 80px desktop split).
96
+ */
97
+ export const TESTIMONIAL_DEFAULT_PADDING = 48;
98
+
41
99
  export const BIG_IMAGE = 'big-image';
42
100
  export const MEDIA_ONLY = 'media-only';
43
101
  export const COLUMNS = 'columns';
@@ -51,6 +51,8 @@ export interface Content {
51
51
  id: string;
52
52
  type: ContentType;
53
53
  personalisationRole?: PersonalisationRole;
54
+ topPadding?: number;
55
+ bottomPadding?: number;
54
56
 
55
57
  // Overrides for personalisation
56
58
  imageUrlOverride?: string;
@@ -292,6 +292,7 @@ exports[`migration.util > Banner Contents - text Align and Font Family should no
292
292
  "contents": [
293
293
  {
294
294
  "backgroundStyle": {},
295
+ "bottomPadding": 32,
295
296
  "buttonLinkType": "url",
296
297
  "buttonPageId": "",
297
298
  "buttonText": "Get Started",
@@ -330,6 +331,7 @@ exports[`migration.util > Banner Contents - text Align and Font Family should no
330
331
  "textAlign": "center",
331
332
  "wordBreak": "normal",
332
333
  },
334
+ "topPadding": 32,
333
335
  "type": "banner-section",
334
336
  "url": "",
335
337
  },
@@ -454,7 +456,7 @@ exports[`migration.util > Banner Contents - text Align and Font Family should no
454
456
  },
455
457
  },
456
458
  },
457
- "v": 16,
459
+ "v": 17,
458
460
  },
459
461
  "useOldLogoRenderSize": true,
460
462
  }
@@ -751,6 +753,7 @@ exports[`migration.util > migrateBrandPageModel should return brand page model w
751
753
  {
752
754
  "contents": [
753
755
  {
756
+ "bottomPadding": 12,
754
757
  "id": "bec5aca6-e3c5-4d4c-93fa-2894816a8040",
755
758
  "text": "",
756
759
  "textColor": {},
@@ -774,6 +777,7 @@ exports[`migration.util > migrateBrandPageModel should return brand page model w
774
777
  "textAlign": "center",
775
778
  "textStyleType": "paragraphs",
776
779
  },
780
+ "topPadding": 12,
777
781
  "type": "text",
778
782
  },
779
783
  ],
@@ -897,7 +901,7 @@ exports[`migration.util > migrateBrandPageModel should return brand page model w
897
901
  },
898
902
  },
899
903
  },
900
- "v": 16,
904
+ "v": 17,
901
905
  },
902
906
  "useOldLogoRenderSize": true,
903
907
  }
@@ -1194,6 +1198,7 @@ exports[`migration.util > migrateBrandPageModel should return brand page model w
1194
1198
  {
1195
1199
  "contents": [
1196
1200
  {
1201
+ "bottomPadding": 12,
1197
1202
  "id": "bec5aca6-e3c5-4d4c-93fa-2894816a8040",
1198
1203
  "text": "",
1199
1204
  "textColor": {},
@@ -1224,6 +1229,7 @@ exports[`migration.util > migrateBrandPageModel should return brand page model w
1224
1229
  "textAlign": "center",
1225
1230
  "textStyleType": "paragraphs",
1226
1231
  },
1232
+ "topPadding": 12,
1227
1233
  "type": "text",
1228
1234
  },
1229
1235
  ],
@@ -1347,7 +1353,7 @@ exports[`migration.util > migrateBrandPageModel should return brand page model w
1347
1353
  },
1348
1354
  },
1349
1355
  },
1350
- "v": 16,
1356
+ "v": 17,
1351
1357
  },
1352
1358
  "useOldLogoRenderSize": true,
1353
1359
  }
@@ -156,7 +156,7 @@ exports[`migration02.ts > migration02 should return converted letterspacing 1`]
156
156
  "borderTopWidth": "0px",
157
157
  "color": undefined,
158
158
  "fontFamily": "Lato",
159
- "fontSize": "1rem",
159
+ "fontSize": "1em",
160
160
  "fontStyle": undefined,
161
161
  "fontWeight": "normal",
162
162
  "textAlign": "center",
@@ -230,7 +230,7 @@ exports[`migration02.ts > migration02 should return converted letterspacing 1`]
230
230
  "borderTopWidth": "0px",
231
231
  "color": undefined,
232
232
  "fontFamily": "Lato",
233
- "fontSize": "1rem",
233
+ "fontSize": "1em",
234
234
  "fontStyle": undefined,
235
235
  "fontWeight": "normal",
236
236
  "textAlign": "center",
@@ -410,7 +410,7 @@ exports[`migration02.ts > migration02 should return converted letterspacing 1`]
410
410
  "style": {
411
411
  "color": undefined,
412
412
  "fontFamily": "Lato",
413
- "fontSize": "1rem",
413
+ "fontSize": "1em",
414
414
  "fontStyle": undefined,
415
415
  "fontWeight": undefined,
416
416
  "letterSpacing": undefined,
@@ -426,7 +426,7 @@ exports[`migration02.ts > migration02 should return converted letterspacing 1`]
426
426
  "style": {
427
427
  "color": undefined,
428
428
  "fontFamily": "Lato",
429
- "fontSize": "1.5rem",
429
+ "fontSize": "1.5em",
430
430
  "fontStyle": undefined,
431
431
  "fontWeight": undefined,
432
432
  "letterSpacing": undefined,
@@ -442,7 +442,7 @@ exports[`migration02.ts > migration02 should return converted letterspacing 1`]
442
442
  "style": {
443
443
  "color": undefined,
444
444
  "fontFamily": "Lato",
445
- "fontSize": "1rem",
445
+ "fontSize": "1em",
446
446
  "fontStyle": undefined,
447
447
  "fontWeight": undefined,
448
448
  "letterSpacing": undefined,
@@ -458,7 +458,7 @@ exports[`migration02.ts > migration02 should return converted letterspacing 1`]
458
458
  "style": {
459
459
  "color": undefined,
460
460
  "fontFamily": "Lato",
461
- "fontSize": "2.25rem",
461
+ "fontSize": "2.25em",
462
462
  "fontStyle": undefined,
463
463
  "fontWeight": undefined,
464
464
  "letterSpacing": undefined,
@@ -155,7 +155,7 @@ BrandPageModel {
155
155
  "borderTopWidth": "0px",
156
156
  "color": undefined,
157
157
  "fontFamily": "Lato",
158
- "fontSize": "1rem",
158
+ "fontSize": "1em",
159
159
  "fontStyle": undefined,
160
160
  "fontWeight": "normal",
161
161
  "textAlign": "center",
@@ -229,7 +229,7 @@ BrandPageModel {
229
229
  "borderTopWidth": "0px",
230
230
  "color": undefined,
231
231
  "fontFamily": "Lato",
232
- "fontSize": "1rem",
232
+ "fontSize": "1em",
233
233
  "fontStyle": undefined,
234
234
  "fontWeight": "normal",
235
235
  "textAlign": "center",
@@ -384,7 +384,7 @@ BrandPageModel {
384
384
  "style": {
385
385
  "color": undefined,
386
386
  "fontFamily": "Lato",
387
- "fontSize": "1rem",
387
+ "fontSize": "1em",
388
388
  "fontStyle": undefined,
389
389
  "fontWeight": undefined,
390
390
  "letterSpacing": undefined,
@@ -400,7 +400,7 @@ BrandPageModel {
400
400
  "style": {
401
401
  "color": undefined,
402
402
  "fontFamily": "Lato",
403
- "fontSize": "1.5rem",
403
+ "fontSize": "1.5em",
404
404
  "fontStyle": undefined,
405
405
  "fontWeight": undefined,
406
406
  "letterSpacing": undefined,
@@ -416,7 +416,7 @@ BrandPageModel {
416
416
  "style": {
417
417
  "color": undefined,
418
418
  "fontFamily": "Lato",
419
- "fontSize": "1rem",
419
+ "fontSize": "1em",
420
420
  "fontStyle": undefined,
421
421
  "fontWeight": undefined,
422
422
  "letterSpacing": undefined,
@@ -432,7 +432,7 @@ BrandPageModel {
432
432
  "style": {
433
433
  "color": undefined,
434
434
  "fontFamily": "Lato",
435
- "fontSize": "2.25rem",
435
+ "fontSize": "2.25em",
436
436
  "fontStyle": undefined,
437
437
  "fontWeight": undefined,
438
438
  "letterSpacing": undefined,
@@ -605,7 +605,7 @@ BrandPageModel {
605
605
  "borderTopWidth": "0px",
606
606
  "color": undefined,
607
607
  "fontFamily": "Lato",
608
- "fontSize": "1rem",
608
+ "fontSize": "1em",
609
609
  "fontStyle": undefined,
610
610
  "fontWeight": "normal",
611
611
  "textAlign": "center",
@@ -679,7 +679,7 @@ BrandPageModel {
679
679
  "borderTopWidth": "0px",
680
680
  "color": undefined,
681
681
  "fontFamily": "Lato",
682
- "fontSize": "1rem",
682
+ "fontSize": "1em",
683
683
  "fontStyle": undefined,
684
684
  "fontWeight": "normal",
685
685
  "textAlign": "center",
@@ -849,7 +849,7 @@ BrandPageModel {
849
849
  "style": {
850
850
  "color": undefined,
851
851
  "fontFamily": "Lato",
852
- "fontSize": "1rem",
852
+ "fontSize": "1em",
853
853
  "fontStyle": undefined,
854
854
  "fontWeight": undefined,
855
855
  "letterSpacing": undefined,
@@ -865,7 +865,7 @@ BrandPageModel {
865
865
  "style": {
866
866
  "color": undefined,
867
867
  "fontFamily": "Lato",
868
- "fontSize": "1.5rem",
868
+ "fontSize": "1.5em",
869
869
  "fontStyle": undefined,
870
870
  "fontWeight": undefined,
871
871
  "letterSpacing": undefined,
@@ -881,7 +881,7 @@ BrandPageModel {
881
881
  "style": {
882
882
  "color": undefined,
883
883
  "fontFamily": "Lato",
884
- "fontSize": "1rem",
884
+ "fontSize": "1em",
885
885
  "fontStyle": undefined,
886
886
  "fontWeight": undefined,
887
887
  "letterSpacing": undefined,
@@ -897,7 +897,7 @@ BrandPageModel {
897
897
  "style": {
898
898
  "color": undefined,
899
899
  "fontFamily": "Lato",
900
- "fontSize": "2.25rem",
900
+ "fontSize": "2.25em",
901
901
  "fontStyle": undefined,
902
902
  "fontWeight": undefined,
903
903
  "letterSpacing": undefined,
@@ -0,0 +1,29 @@
1
+ import { describe, test, expect } from 'vitest';
2
+ import { contentPaddingStyle } from './content-padding.util';
3
+
4
+ describe('content-padding.util', () => {
5
+ test('contentPaddingStyle should map stored padding to px values', () => {
6
+ expect(contentPaddingStyle({ topPadding: 53, bottomPadding: 24 })).toEqual({
7
+ paddingTop: '53px',
8
+ paddingBottom: '24px',
9
+ });
10
+ });
11
+
12
+ test('contentPaddingStyle should default missing values to 0 for content created before the field existed', () => {
13
+ expect(contentPaddingStyle({})).toEqual({
14
+ paddingTop: '0px',
15
+ paddingBottom: '0px',
16
+ });
17
+ expect(contentPaddingStyle({ topPadding: 16 })).toEqual({
18
+ paddingTop: '16px',
19
+ paddingBottom: '0px',
20
+ });
21
+ });
22
+
23
+ test('contentPaddingStyle should keep an explicit 0 rather than treating it as unset', () => {
24
+ expect(contentPaddingStyle({ topPadding: 0, bottomPadding: 0 })).toEqual({
25
+ paddingTop: '0px',
26
+ paddingBottom: '0px',
27
+ });
28
+ });
29
+ });