@designcrowd/library.brand-page 5.18.7 → 5.18.8-ast-padding-1

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 (144) hide show
  1. package/lib/src/{CreatedOnBrandCrowd-de-de-CZmqvsOT.js → CreatedOnBrandCrowd-de-de-4K_VkRLQ.js} +1 -1
  2. package/lib/src/{CreatedOnBrandCrowd-en-us-5nTR1eLT.js → CreatedOnBrandCrowd-en-us-n6Fd47e_.js} +1 -1
  3. package/lib/src/{CreatedOnBrandCrowd-es-es-xLvoayrw.js → CreatedOnBrandCrowd-es-es-BcCANYX_.js} +1 -1
  4. package/lib/src/{CreatedOnBrandCrowd-fr-fr-CN5n8X8v.js → CreatedOnBrandCrowd-fr-ca-qusGdhEQ.js} +1 -1
  5. package/lib/src/{CreatedOnBrandCrowd-fr-ca-CN5n8X8v.js → CreatedOnBrandCrowd-fr-fr-qusGdhEQ.js} +1 -1
  6. package/lib/src/{CreatedOnBrandCrowd-pt-pt-CdkYC12E.js → CreatedOnBrandCrowd-pt-br-C9IBrRc_.js} +1 -1
  7. package/lib/src/{CreatedOnBrandCrowd-pt-br-CdkYC12E.js → CreatedOnBrandCrowd-pt-pt-C9IBrRc_.js} +1 -1
  8. package/lib/src/{CreatedOnDcom-de-de-B8rV2rD7.js → CreatedOnDcom-de-de-BY13DaXj.js} +1 -1
  9. package/lib/src/{CreatedOnDcom-en-us-C4WaRIpF.js → CreatedOnDcom-en-us-BPc5Nacx.js} +1 -1
  10. package/lib/src/{CreatedOnDcom-es-es-BPHPey0b.js → CreatedOnDcom-es-es-KrsweAGY.js} +1 -1
  11. package/lib/src/{CreatedOnDcom-fr-ca-xrMr4xlv.js → CreatedOnDcom-fr-ca-NaPJNFZH.js} +1 -1
  12. package/lib/src/{CreatedOnDcom-fr-fr-BEozL-o2.js → CreatedOnDcom-fr-fr-DjZKRox_.js} +1 -1
  13. package/lib/src/{CreatedOnDcom-pt-br-CoN-ZhjG.js → CreatedOnDcom-pt-br-xGSMGQZa.js} +1 -1
  14. package/lib/src/{CreatedOnDcom-pt-pt-9vfUJ3ks.js → CreatedOnDcom-pt-pt-B7CcpJ4c.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/image-gallery/masonry/MasonryGallery.mixin.d.ts +1 -1
  20. package/lib/src/brand-page/components/mailing-list/MailingList.mixin.d.ts +4 -0
  21. package/lib/src/brand-page/components/mailing-list/MailingList.mixin.js +4 -1
  22. package/lib/src/brand-page/components/media/Media.mixin.d.ts +2 -2
  23. package/lib/src/brand-page/components/payment/request-payment/RequestPayment.mixin.d.ts +4 -0
  24. package/lib/src/brand-page/components/payment/request-payment/RequestPayment.mixin.js +4 -0
  25. package/lib/src/brand-page/components/payment/support-me/SupportMe.mixin.d.ts +4 -0
  26. package/lib/src/brand-page/components/payment/support-me/SupportMe.mixin.js +4 -1
  27. package/lib/src/brand-page/components/testimonial-section/TestimonialSection.mixin.d.ts +4 -0
  28. package/lib/src/brand-page/components/testimonial-section/TestimonialSection.mixin.js +4 -1
  29. package/lib/src/brand-page/components/video/Video.mixin.d.ts +4 -0
  30. package/lib/src/brand-page/components/video/Video.mixin.js +4 -0
  31. package/lib/src/brand-page/constants/misc.constants.d.ts +35 -0
  32. package/lib/src/brand-page/constants/misc.constants.js +51 -0
  33. package/lib/src/brand-page/models/content.model.d.ts +2 -0
  34. package/lib/src/brand-page/utils/content-padding.util.d.ts +13 -0
  35. package/lib/src/brand-page/utils/content-padding.util.js +10 -0
  36. package/lib/src/brand-page/utils/index.d.ts +1 -0
  37. package/lib/src/brand-page/utils/index.js +1 -0
  38. package/lib/src/brand-page/utils/migration/migration-17.d.ts +2 -0
  39. package/lib/src/brand-page/utils/migration/migration-17.js +54 -0
  40. package/lib/src/brand-page/utils/migration.util.js +10 -0
  41. package/lib/src/brand-page-maker/components/admin-logo-settings/AdminLogoSettings.mixin.d.ts +2 -0
  42. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.d.ts +12 -0
  43. package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.d.ts +14 -0
  44. package/lib/src/brand-page-maker/composables/ai-chat/useAiWebsiteBuilderChat.js +16 -3
  45. package/lib/src/brand-page-maker/constants/config-settings-constant.js +39 -0
  46. package/lib/src/brand-page-maker/convertors/about-display-style.convertor.js +9 -1
  47. package/lib/src/brand-page-maker/convertors/banner-align-display-style.convertor.js +7 -1
  48. package/lib/src/brand-page-maker/convertors/contact-layout-style.convertor.js +6 -1
  49. package/lib/src/brand-page-maker/models/content-settings.js +38 -2
  50. package/lib/src/brand-page-maker/stores/ai-checkpoint/ai-checkpoint-store.d.ts +12 -0
  51. package/lib/src/{bundled-translations-D1q3rSEz.js → bundled-translations-BUyt4scr.js} +9 -9
  52. package/lib/src/{bundled-translations.de-DE-BxqLLwbh.js → bundled-translations.de-DE-DEw_OVai.js} +1 -1
  53. package/lib/src/{bundled-translations.es-ES-uh249NlJ.js → bundled-translations.es-ES-CFKWmkgY.js} +17 -17
  54. package/lib/src/{bundled-translations.fr-CA-BEQmv2fX.js → bundled-translations.fr-CA-DCl5LJS4.js} +1 -1
  55. package/lib/src/{bundled-translations.fr-FR-BnNuCojH.js → bundled-translations.fr-FR-B5BjgllA.js} +1 -1
  56. package/lib/src/{bundled-translations.pt-BR-CJUOxVlq.js → bundled-translations.pt-BR-5PWpMPuM.js} +1 -1
  57. package/lib/src/{bundled-translations.pt-PT-Ds9cMEqK.js → bundled-translations.pt-PT-B9_wN0HR.js} +9 -9
  58. package/lib/src/bundles/bundled-translations.de-DE.json +2 -0
  59. package/lib/src/bundles/bundled-translations.es-ES.json +2 -0
  60. package/lib/src/bundles/bundled-translations.fr-CA.json +2 -0
  61. package/lib/src/bundles/bundled-translations.fr-FR.json +2 -0
  62. package/lib/src/bundles/bundled-translations.json +2 -0
  63. package/lib/src/bundles/bundled-translations.pt-BR.json +2 -0
  64. package/lib/src/bundles/bundled-translations.pt-PT.json +2 -0
  65. package/lib/src/composables/useSnapshot.js +233 -21
  66. package/lib/src/css/library.brand-page-brandCrowd.min.css +147 -161
  67. package/lib/src/css/library.brand-page-brandPage.min.css +147 -161
  68. package/lib/src/css/library.brand-page-designCom.min.css +147 -161
  69. package/lib/src/css/library.brand-page-preview.min.css +147 -161
  70. package/lib/src/index.mjs +1 -1
  71. package/lib/src/{lib-xHNclG2R.js → lib-ClPLZIYL.js} +21178 -20848
  72. package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.d.ts +14 -0
  73. package/lib/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.mixin.d.ts +14 -0
  74. package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItem.mixin.d.ts +12 -0
  75. package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.d.ts +12 -0
  76. package/lib/src/shared/content-settings/components/focused-content-item-settings/FocusedContentItemSettings.mixin.d.ts +12 -0
  77. package/lib/src/shared/content-settings/components/slider-field/SliderField.mixin.js +9 -0
  78. package/lib/src/shared/content-settings/store/content-settings-store.d.ts +12 -0
  79. package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.d.ts +16 -0
  80. package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.d.ts +14 -0
  81. package/lib/src/utils/minify-brand-page-metadata.js +11 -1
  82. package/package.json +1 -1
  83. package/src/brand-page/components/about-section/AboutSection.vue +10 -4
  84. package/src/brand-page/components/banner-section/BannerSection.vue +11 -4
  85. package/src/brand-page/components/booking-section/BookingSection.vue +11 -3
  86. package/src/brand-page/components/contact-form/ContactForm.mixin.ts +12 -6
  87. package/src/brand-page/components/contact-form/ContactForm.vue +105 -104
  88. package/src/brand-page/components/image-gallery/ImageGallery.mixin.ts +5 -0
  89. package/src/brand-page/components/image-gallery/ImageGallery.vue +1 -1
  90. package/src/brand-page/components/mailing-list/MailingList.mixin.ts +8 -1
  91. package/src/brand-page/components/mailing-list/MailingList.vue +1 -1
  92. package/src/brand-page/components/map/Map.vue +5 -1
  93. package/src/brand-page/components/payment/request-payment/RequestPayment.mixin.ts +5 -0
  94. package/src/brand-page/components/payment/request-payment/RequestPayment.vue +1 -0
  95. package/src/brand-page/components/payment/support-me/SupportMe.mixin.ts +8 -1
  96. package/src/brand-page/components/payment/support-me/SupportMe.vue +1 -0
  97. package/src/brand-page/components/shop/Shop.vue +7 -2
  98. package/src/brand-page/components/social-links/SocialLinks.vue +7 -3
  99. package/src/brand-page/components/testimonial-section/TestimonialSection.mixin.ts +7 -1
  100. package/src/brand-page/components/testimonial-section/TestimonialSection.vue +4 -6
  101. package/src/brand-page/components/text/Text.vue +12 -5
  102. package/src/brand-page/components/text-media-section/TextMediaSection.vue +11 -3
  103. package/src/brand-page/components/video/Video.mixin.ts +5 -0
  104. package/src/brand-page/components/video/Video.vue +1 -1
  105. package/src/brand-page/constants/misc.constants.ts +58 -0
  106. package/src/brand-page/models/content.model.ts +2 -0
  107. package/src/brand-page/utils/__snapshots__/migration.util.test.ts.snap +9 -3
  108. package/src/brand-page/utils/content-padding.util.test.ts +29 -0
  109. package/src/brand-page/utils/content-padding.util.ts +13 -0
  110. package/src/brand-page/utils/index.ts +1 -0
  111. package/src/brand-page/utils/migration/migration-17.ts +72 -0
  112. package/src/brand-page/utils/migration.util.test.ts +252 -0
  113. package/src/brand-page/utils/migration.util.ts +11 -0
  114. package/src/brand-page-maker/components/ai-website-builder/AiWebsiteBuilder.vue +3 -4
  115. package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.vue +8 -1
  116. package/src/brand-page-maker/composables/ai-chat/useAiWebsiteBuilderChat.ts +19 -4
  117. package/src/brand-page-maker/constants/config-settings-constant.ts +45 -0
  118. package/src/brand-page-maker/convertors/about-display-style.convertor.ts +10 -0
  119. package/src/brand-page-maker/convertors/banner-align-display-style.convertor.ts +8 -0
  120. package/src/brand-page-maker/convertors/contact-layout-style.convertor.test.ts +50 -0
  121. package/src/brand-page-maker/convertors/contact-layout-style.convertor.ts +8 -0
  122. package/src/brand-page-maker/models/content-settings.ts +41 -2
  123. package/src/bundles/bundled-translations.de-DE.json +2 -0
  124. package/src/bundles/bundled-translations.es-ES.json +2 -0
  125. package/src/bundles/bundled-translations.fr-CA.json +2 -0
  126. package/src/bundles/bundled-translations.fr-FR.json +2 -0
  127. package/src/bundles/bundled-translations.json +2 -0
  128. package/src/bundles/bundled-translations.pt-BR.json +2 -0
  129. package/src/bundles/bundled-translations.pt-PT.json +2 -0
  130. package/src/composables/useSnapshot.ts +316 -31
  131. package/src/shared/content-settings/components/content-settings/i18n/content-settings.de-DE.json +2 -0
  132. package/src/shared/content-settings/components/content-settings/i18n/content-settings.es-ES.json +2 -0
  133. package/src/shared/content-settings/components/content-settings/i18n/content-settings.fr-CA.json +2 -0
  134. package/src/shared/content-settings/components/content-settings/i18n/content-settings.fr-FR.json +2 -0
  135. package/src/shared/content-settings/components/content-settings/i18n/content-settings.json +2 -0
  136. package/src/shared/content-settings/components/content-settings/i18n/content-settings.pt-BR.json +2 -0
  137. package/src/shared/content-settings/components/content-settings/i18n/content-settings.pt-PT.json +2 -0
  138. package/src/shared/content-settings/components/content-settings-item/ContentSettingsItem.vue +1 -1
  139. package/src/shared/content-settings/components/focused-content-item-settings/FocusedContentItemSettings.vue +2 -2
  140. package/src/shared/content-settings/components/slider-field/SliderField.mixin.ts +9 -0
  141. package/src/utils/minify-brand-page-metadata.ts +11 -1
  142. package/lib/src/metadata-builder/builders/reorder-pages-builder.d.ts +0 -13
  143. package/lib/src/metadata-builder/builders/reorder-pages-builder.js +0 -49
  144. package/src/metadata-builder/builders/reorder-pages-builder.ts +0 -80
@@ -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="{
@@ -221,17 +221,15 @@ export default {
221
221
  --line-height: 1.5;
222
222
  --name-spacing: 0.75rem;
223
223
  --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;
224
+ @apply tw-relative tw-box-border tw-max-w-full;
225
+ /* Top/bottom padding is config-bound via the Padding Control sliders (BP-5703),
226
+ applied as an inline style on the root. Horizontal padding stays responsive. */
227
227
  padding-left: 1.5rem;
228
228
  padding-right: 1.5rem;
229
229
  }
230
230
 
231
231
  @media (min-width: 767px) {
232
232
  .c_testimonial-image {
233
- padding-top: 5rem;
234
- padding-bottom: 5rem;
235
233
  padding-left: 4rem;
236
234
  padding-right: 4rem;
237
235
  }
@@ -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
@@ -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
  }
@@ -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
+ });
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Block top/bottom padding (BP-5687) as a bindable CSS style object. Defaults
3
+ * live in the data — `content-settings` for new content, a migration for
4
+ * existing — so this just reads the stored value (`?? 0` covers content from
5
+ * before the field existed).
6
+ */
7
+ export const contentPaddingStyle = (content: {
8
+ topPadding?: number;
9
+ bottomPadding?: number;
10
+ }): { paddingTop: string; paddingBottom: string } => ({
11
+ paddingTop: `${content.topPadding ?? 0}px`,
12
+ paddingBottom: `${content.bottomPadding ?? 0}px`,
13
+ });
@@ -1,4 +1,5 @@
1
1
  export * from './style.util';
2
+ export * from './content-padding.util';
2
3
  export * from './view-model.util';
3
4
  export * from './text.util';
4
5
  export * from './model.util';
@@ -0,0 +1,72 @@
1
+ import type { MigrationData } from '../migration.util';
2
+ import type { BannerSectionContent, ContactFormContent } from '../../models';
3
+ import {
4
+ CONTACT_FORM_LAYOUT_DEFAULT_PADDING,
5
+ TESTIMONIAL_DEFAULT_PADDING,
6
+ bannerDisplayStyleDefaultPadding,
7
+ } from '../../constants';
8
+
9
+ /**
10
+ * Padding Control backfill (BP-5699 Tier 2, BP-5700 Store): blocks that already
11
+ * had hard-coded top/bottom spacing. Backfill that spacing as the block's explicit
12
+ * topPadding/bottomPadding so existing pages render unchanged once the spacing
13
+ * moves to the Padding Control sliders. Type-scoped and idempotent — only the
14
+ * listed types, and only when the value isn't already set.
15
+ *
16
+ * Exception — `testimonial-section` (BP-5703): testimonials had 32px mobile / 80px
17
+ * desktop and are intentionally collapsing to a single value across both breakpoints,
18
+ * so the backfill sets that single value rather than preserving the old desktop 80px.
19
+ * Existing testimonials will look tighter on desktop / roomier on mobile — by design.
20
+ */
21
+ const BLOCK_DEFAULT_PADDING: Partial<Record<string, number>> = {
22
+ text: 12,
23
+ 'images-section': 32,
24
+ 'social-links': 32,
25
+ 'shapes-section': 32,
26
+ 'booking-section': 32,
27
+ 'shop-section': 16,
28
+ 'about-section': 32,
29
+ 'testimonial-section': TESTIMONIAL_DEFAULT_PADDING,
30
+ };
31
+
32
+ export const migration17 = async (
33
+ migrationResult: MigrationData,
34
+ ): Promise<MigrationData> => {
35
+ const { brandPageModel } = migrationResult;
36
+
37
+ brandPageModel.pages.forEach((page) => {
38
+ page.contents.forEach((content) => {
39
+ // Contact Form and Banner previously varied their hard-coded spacing by
40
+ // layout/display style (full-bleed image layouts had no outer padding), so they're
41
+ // keyed by that rather than a single per-type value.
42
+ let value: number | undefined;
43
+
44
+ if (content.type === 'contact-form') {
45
+ value =
46
+ CONTACT_FORM_LAYOUT_DEFAULT_PADDING[
47
+ (content as ContactFormContent).layoutStyle ?? ''
48
+ ];
49
+ } else if (content.type === 'banner-section') {
50
+ value = bannerDisplayStyleDefaultPadding(
51
+ (content as BannerSectionContent).displayStyle,
52
+ );
53
+ } else {
54
+ value = BLOCK_DEFAULT_PADDING[content.type];
55
+ }
56
+
57
+ if (value === undefined) {
58
+ return;
59
+ }
60
+
61
+ if (content.topPadding === undefined) {
62
+ content.topPadding = value;
63
+ }
64
+
65
+ if (content.bottomPadding === undefined) {
66
+ content.bottomPadding = value;
67
+ }
68
+ });
69
+ });
70
+
71
+ return migrationResult;
72
+ };
@@ -24,11 +24,18 @@ import {
24
24
  createInitialTestimonialSectionContent,
25
25
  } from '@brand-page-maker/models';
26
26
  import {
27
+ ALIGN_CARD_CENTER_IMAGE,
28
+ ALIGN_LEFT_FULL_IMAGE,
29
+ ALIGN_RIGHT_FULL_IMAGE,
30
+ ALIGN_TOP_FULL_IMAGE,
31
+ ALIGN_BOTTOM_FULL_IMAGE,
32
+ ALIGN_MIDDLE_FULL_IMAGE,
27
33
  DEFAULT_LETTER_SPACING,
28
34
  LINE_HEIGHT_BODY,
29
35
  LINE_HEIGHT_HEADINGS,
30
36
  LINE_HEIGHT_TITLE,
31
37
  TEXT_ONLY,
38
+ TESTIMONIAL_DEFAULT_PADDING,
32
39
  } from '../constants';
33
40
 
34
41
  describe('migration.util', () => {
@@ -1464,6 +1471,251 @@ describe('migration.util', () => {
1464
1471
  expect(content.layoutStyle).toBe(TEXT_ONLY);
1465
1472
  });
1466
1473
 
1474
+ test('migration17 should backfill contact form padding from its layout style', async () => {
1475
+ const model = await migrateBrandPageModel(getBsModel(), {
1476
+ isUserDraft: false,
1477
+ isServerRender: false,
1478
+ });
1479
+
1480
+ const collapsible = model.brandPageModel.pages[3]
1481
+ .contents[0] as ContactFormContent;
1482
+ const textOnly = model.brandPageModel.pages[3]
1483
+ .contents[1] as ContactFormContent;
1484
+
1485
+ expect(collapsible.topPadding).toBe(0);
1486
+ expect(collapsible.bottomPadding).toBe(0);
1487
+ expect(textOnly.topPadding).toBe(32);
1488
+ expect(textOnly.bottomPadding).toBe(32);
1489
+ });
1490
+
1491
+ test.each([
1492
+ [ALIGN_LEFT_FULL_IMAGE],
1493
+ [ALIGN_RIGHT_FULL_IMAGE],
1494
+ [ALIGN_CARD_CENTER_IMAGE],
1495
+ ])(
1496
+ 'migration17 should backfill zero padding for the %s contact form layout',
1497
+ async (layoutStyle) => {
1498
+ const brandPageModel = getBsModel();
1499
+
1500
+ (
1501
+ brandPageModel.pages[3].contents[1] as ContactFormContent
1502
+ ).layoutStyle = layoutStyle;
1503
+
1504
+ const model = await migrateBrandPageModel(brandPageModel, {
1505
+ isUserDraft: false,
1506
+ isServerRender: false,
1507
+ });
1508
+
1509
+ const content = model.brandPageModel.pages[3]
1510
+ .contents[1] as ContactFormContent;
1511
+
1512
+ expect(content.topPadding).toBe(0);
1513
+ expect(content.bottomPadding).toBe(0);
1514
+ },
1515
+ );
1516
+
1517
+ test('migration17 should not overwrite contact form padding that is already set', async () => {
1518
+ const brandPageModel = getBsModel();
1519
+
1520
+ (brandPageModel.pages[3].contents[1] as ContactFormContent).topPadding =
1521
+ 10;
1522
+
1523
+ const model = await migrateBrandPageModel(brandPageModel, {
1524
+ isUserDraft: false,
1525
+ isServerRender: false,
1526
+ });
1527
+
1528
+ const content = model.brandPageModel.pages[3]
1529
+ .contents[1] as ContactFormContent;
1530
+
1531
+ expect(content.topPadding).toBe(10);
1532
+ expect(content.bottomPadding).toBe(32);
1533
+ });
1534
+
1535
+ test('migration17 should backfill 32 padding for standard banner display styles', async () => {
1536
+ const model = await migrateBrandPageModel(getBsModel(), {
1537
+ isUserDraft: false,
1538
+ isServerRender: false,
1539
+ });
1540
+
1541
+ // pages[0].contents[0] is a 'centered' banner (standard, not full-bleed).
1542
+ const banner = model.brandPageModel.pages[0]
1543
+ .contents[0] as BannerSectionContent;
1544
+
1545
+ expect(banner.topPadding).toBe(32);
1546
+ expect(banner.bottomPadding).toBe(32);
1547
+ });
1548
+
1549
+ test.each([
1550
+ [ALIGN_LEFT_FULL_IMAGE],
1551
+ [ALIGN_RIGHT_FULL_IMAGE],
1552
+ [ALIGN_TOP_FULL_IMAGE],
1553
+ [ALIGN_BOTTOM_FULL_IMAGE],
1554
+ [ALIGN_MIDDLE_FULL_IMAGE],
1555
+ ])(
1556
+ 'migration17 should backfill zero padding for the %s full-bleed banner style',
1557
+ async (displayStyle) => {
1558
+ const brandPageModel = getBsModel();
1559
+
1560
+ (
1561
+ brandPageModel.pages[0].contents[0] as BannerSectionContent
1562
+ ).displayStyle = displayStyle;
1563
+
1564
+ const model = await migrateBrandPageModel(brandPageModel, {
1565
+ isUserDraft: false,
1566
+ isServerRender: false,
1567
+ });
1568
+
1569
+ const banner = model.brandPageModel.pages[0]
1570
+ .contents[0] as BannerSectionContent;
1571
+
1572
+ expect(banner.topPadding).toBe(0);
1573
+ expect(banner.bottomPadding).toBe(0);
1574
+ },
1575
+ );
1576
+
1577
+ test('migration17 should backfill 32 padding for standard about display styles', async () => {
1578
+ const model = await migrateBrandPageModel(getBsModel(), {
1579
+ isUserDraft: false,
1580
+ isServerRender: false,
1581
+ });
1582
+
1583
+ // pages[0].contents[2] is a 'centered' about section (standard, not full-image).
1584
+ const about = model.brandPageModel.pages[0]
1585
+ .contents[2] as AboutSectionContent;
1586
+
1587
+ expect(about.topPadding).toBe(32);
1588
+ expect(about.bottomPadding).toBe(32);
1589
+ });
1590
+
1591
+ test.each([[ALIGN_LEFT_FULL_IMAGE], [ALIGN_RIGHT_FULL_IMAGE]])(
1592
+ 'migration17 should backfill 32 padding for the %s full-image about style',
1593
+ async (displayStyle) => {
1594
+ const brandPageModel = getBsModel();
1595
+
1596
+ (
1597
+ brandPageModel.pages[0].contents[2] as AboutSectionContent
1598
+ ).displayStyle = displayStyle;
1599
+
1600
+ const model = await migrateBrandPageModel(brandPageModel, {
1601
+ isUserDraft: false,
1602
+ isServerRender: false,
1603
+ });
1604
+
1605
+ const about = model.brandPageModel.pages[0]
1606
+ .contents[2] as AboutSectionContent;
1607
+
1608
+ expect(about.topPadding).toBe(32);
1609
+ expect(about.bottomPadding).toBe(32);
1610
+ },
1611
+ );
1612
+
1613
+ test('migration17 should backfill 16 padding for the shop section', async () => {
1614
+ const oldTemplate: BrandPageModel = {
1615
+ pages: [
1616
+ {
1617
+ slug: 'shop',
1618
+ title: 'Shop',
1619
+ contents: [{ type: 'shop-section', id: 'shop-1' }],
1620
+ },
1621
+ ],
1622
+ brandPageType: 'brandSite',
1623
+ } as any;
1624
+
1625
+ const model = await migrateBrandPageModel(
1626
+ new BrandPageModel(oldTemplate),
1627
+ {
1628
+ isUserDraft: false,
1629
+ isServerRender: false,
1630
+ },
1631
+ );
1632
+ const shop = model.brandPageModel.pages[0].contents[0] as any;
1633
+
1634
+ expect(shop.topPadding).toBe(16);
1635
+ expect(shop.bottomPadding).toBe(16);
1636
+ });
1637
+
1638
+ test('migration17 should not overwrite shop padding that is already set', async () => {
1639
+ const oldTemplate: BrandPageModel = {
1640
+ pages: [
1641
+ {
1642
+ slug: 'shop',
1643
+ title: 'Shop',
1644
+ contents: [{ type: 'shop-section', id: 'shop-1', topPadding: 40 }],
1645
+ },
1646
+ ],
1647
+ brandPageType: 'brandSite',
1648
+ } as any;
1649
+
1650
+ const model = await migrateBrandPageModel(
1651
+ new BrandPageModel(oldTemplate),
1652
+ {
1653
+ isUserDraft: false,
1654
+ isServerRender: false,
1655
+ },
1656
+ );
1657
+ const shop = model.brandPageModel.pages[0].contents[0] as any;
1658
+
1659
+ expect(shop.topPadding).toBe(40);
1660
+ expect(shop.bottomPadding).toBe(16);
1661
+ });
1662
+
1663
+ test('migration17 should backfill the single testimonial padding across both breakpoints', async () => {
1664
+ const oldTemplate: BrandPageModel = {
1665
+ pages: [
1666
+ {
1667
+ slug: 'testimonials',
1668
+ title: 'Testimonials',
1669
+ contents: [{ type: 'testimonial-section', id: 'testimonial-1' }],
1670
+ },
1671
+ ],
1672
+ brandPageType: 'brandSite',
1673
+ } as any;
1674
+
1675
+ const model = await migrateBrandPageModel(
1676
+ new BrandPageModel(oldTemplate),
1677
+ {
1678
+ isUserDraft: false,
1679
+ isServerRender: false,
1680
+ },
1681
+ );
1682
+ const testimonial = model.brandPageModel.pages[0].contents[0] as any;
1683
+
1684
+ expect(testimonial.topPadding).toBe(TESTIMONIAL_DEFAULT_PADDING);
1685
+ expect(testimonial.bottomPadding).toBe(TESTIMONIAL_DEFAULT_PADDING);
1686
+ });
1687
+
1688
+ test('migration17 should not overwrite testimonial padding that is already set', async () => {
1689
+ const oldTemplate: BrandPageModel = {
1690
+ pages: [
1691
+ {
1692
+ slug: 'testimonials',
1693
+ title: 'Testimonials',
1694
+ contents: [
1695
+ {
1696
+ type: 'testimonial-section',
1697
+ id: 'testimonial-1',
1698
+ topPadding: 40,
1699
+ },
1700
+ ],
1701
+ },
1702
+ ],
1703
+ brandPageType: 'brandSite',
1704
+ } as any;
1705
+
1706
+ const model = await migrateBrandPageModel(
1707
+ new BrandPageModel(oldTemplate),
1708
+ {
1709
+ isUserDraft: false,
1710
+ isServerRender: false,
1711
+ },
1712
+ );
1713
+ const testimonial = model.brandPageModel.pages[0].contents[0] as any;
1714
+
1715
+ expect(testimonial.topPadding).toBe(40);
1716
+ expect(testimonial.bottomPadding).toBe(TESTIMONIAL_DEFAULT_PADDING);
1717
+ });
1718
+
1467
1719
  test('migrateNewLogoLogic should migrate logoDraftToken and logoVariation', () => {
1468
1720
  const oldTemplate: BrandPageData = {
1469
1721
  pages: [