@designcrowd/library.brand-page 5.18.9-ast-padding-2 → 5.18.9
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/lib/src/{CreatedOnBrandCrowd-de-de-BmLOUBDj.js → CreatedOnBrandCrowd-de-de-CDdi84ti.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-en-us-DGCwedd5.js → CreatedOnBrandCrowd-en-us-BvRiqC8_.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-es-es-qfWIO62h.js → CreatedOnBrandCrowd-es-es-BGjpqIbV.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-fr-Bh6tQfv-.js → CreatedOnBrandCrowd-fr-ca-BSLrflaD.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-ca-Bh6tQfv-.js → CreatedOnBrandCrowd-fr-fr-BSLrflaD.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-pt-DBF_gR3z.js → CreatedOnBrandCrowd-pt-br-CYdUgcJs.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-br-DBF_gR3z.js → CreatedOnBrandCrowd-pt-pt-CYdUgcJs.js} +1 -1
- package/lib/src/{CreatedOnDcom-de-de-B1ZibTqN.js → CreatedOnDcom-de-de-D3gzpYgh.js} +1 -1
- package/lib/src/{CreatedOnDcom-en-us-4qS61Om_.js → CreatedOnDcom-en-us-V6QwvLNX.js} +1 -1
- package/lib/src/{CreatedOnDcom-es-es-yX1FaMrI.js → CreatedOnDcom-es-es-BmgxqURo.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-ca-h5RbgiUo.js → CreatedOnDcom-fr-ca-DEAawXEa.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-fr-4cJbiAWr.js → CreatedOnDcom-fr-fr-Da7MhYpI.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-br-C0FUKVjn.js → CreatedOnDcom-pt-br-D6WUdxFK.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-pt-CFstpuvQ.js → CreatedOnDcom-pt-pt-CS5m0sQX.js} +1 -1
- package/lib/src/brand-page/components/contact-form/ContactForm.mixin.d.ts +0 -4
- package/lib/src/brand-page/components/contact-form/ContactForm.mixin.js +4 -8
- package/lib/src/brand-page/components/image-gallery/ImageGallery.mixin.d.ts +0 -4
- package/lib/src/brand-page/components/image-gallery/ImageGallery.mixin.js +0 -4
- package/lib/src/brand-page/components/mailing-list/MailingList.mixin.d.ts +0 -4
- package/lib/src/brand-page/components/mailing-list/MailingList.mixin.js +1 -4
- package/lib/src/brand-page/components/payment/request-payment/RequestPayment.mixin.d.ts +0 -4
- package/lib/src/brand-page/components/payment/request-payment/RequestPayment.mixin.js +0 -4
- package/lib/src/brand-page/components/payment/support-me/SupportMe.mixin.d.ts +0 -4
- package/lib/src/brand-page/components/payment/support-me/SupportMe.mixin.js +1 -4
- package/lib/src/brand-page/components/testimonial-section/TestimonialSection.mixin.d.ts +97 -0
- package/lib/src/brand-page/components/testimonial-section/TestimonialSection.mixin.js +112 -0
- package/lib/src/brand-page/components/video/Video.mixin.d.ts +0 -4
- package/lib/src/brand-page/components/video/Video.mixin.js +0 -4
- package/lib/src/brand-page/constants/font.constants.d.ts +4 -4
- package/lib/src/brand-page/constants/font.constants.js +4 -4
- package/lib/src/brand-page/constants/misc.constants.d.ts +0 -35
- package/lib/src/brand-page/constants/misc.constants.js +0 -51
- package/lib/src/brand-page/models/content.model.d.ts +0 -2
- package/lib/src/brand-page/utils/index.d.ts +0 -1
- package/lib/src/brand-page/utils/index.js +0 -1
- package/lib/src/brand-page/utils/migration.util.js +0 -10
- package/lib/src/brand-page-maker/components/admin-logo-settings/AdminLogoSettings.mixin.d.ts +0 -2
- package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.d.ts +0 -12
- package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.d.ts +0 -14
- package/lib/src/brand-page-maker/constants/config-settings-constant.js +0 -39
- package/lib/src/brand-page-maker/convertors/about-display-style.convertor.js +1 -9
- package/lib/src/brand-page-maker/convertors/banner-align-display-style.convertor.js +1 -7
- package/lib/src/brand-page-maker/convertors/contact-layout-style.convertor.js +1 -6
- package/lib/src/brand-page-maker/models/content-settings.js +2 -39
- package/lib/src/brand-page-maker/stores/ai-checkpoint/ai-checkpoint-store.d.ts +0 -12
- package/lib/src/{bundled-translations-BUyt4scr.js → bundled-translations-D1q3rSEz.js} +9 -9
- package/lib/src/{bundled-translations.de-DE-DEw_OVai.js → bundled-translations.de-DE-BxqLLwbh.js} +1 -1
- package/lib/src/{bundled-translations.es-ES-CFKWmkgY.js → bundled-translations.es-ES-uh249NlJ.js} +17 -17
- package/lib/src/{bundled-translations.fr-CA-DCl5LJS4.js → bundled-translations.fr-CA-BEQmv2fX.js} +1 -1
- package/lib/src/{bundled-translations.fr-FR-B5BjgllA.js → bundled-translations.fr-FR-BnNuCojH.js} +1 -1
- package/lib/src/{bundled-translations.pt-BR-5PWpMPuM.js → bundled-translations.pt-BR-CJUOxVlq.js} +1 -1
- package/lib/src/{bundled-translations.pt-PT-B9_wN0HR.js → bundled-translations.pt-PT-Ds9cMEqK.js} +9 -9
- package/lib/src/bundles/bundled-translations.de-DE.json +0 -2
- package/lib/src/bundles/bundled-translations.es-ES.json +0 -2
- package/lib/src/bundles/bundled-translations.fr-CA.json +0 -2
- package/lib/src/bundles/bundled-translations.fr-FR.json +0 -2
- package/lib/src/bundles/bundled-translations.json +0 -2
- package/lib/src/bundles/bundled-translations.pt-BR.json +0 -2
- package/lib/src/bundles/bundled-translations.pt-PT.json +0 -2
- package/lib/src/css/library.brand-page-brandCrowd.min.css +155 -141
- package/lib/src/css/library.brand-page-brandPage.min.css +155 -141
- package/lib/src/css/library.brand-page-designCom.min.css +155 -141
- package/lib/src/css/library.brand-page-preview.min.css +155 -141
- package/lib/src/index.mjs +1 -1
- package/lib/src/{lib-B3NH7cmE.js → lib--1xJXw4j.js} +21010 -21158
- package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.d.ts +0 -14
- package/lib/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.mixin.d.ts +0 -14
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItem.mixin.d.ts +0 -12
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.d.ts +0 -12
- package/lib/src/shared/content-settings/components/focused-content-item-settings/FocusedContentItemSettings.mixin.d.ts +0 -12
- package/lib/src/shared/content-settings/components/slider-field/SliderField.mixin.js +0 -9
- package/lib/src/shared/content-settings/store/content-settings-store.d.ts +0 -12
- package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.d.ts +0 -16
- package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.d.ts +0 -14
- package/lib/src/utils/minify-brand-page-metadata.js +1 -11
- package/package.json +1 -1
- package/src/brand-page/components/about-section/AboutSection.vue +4 -10
- package/src/brand-page/components/banner-section/BannerSection.vue +4 -11
- package/src/brand-page/components/booking-section/BookingSection.vue +3 -11
- package/src/brand-page/components/contact-form/ContactForm.mixin.ts +6 -12
- package/src/brand-page/components/contact-form/ContactForm.vue +104 -105
- package/src/brand-page/components/image-gallery/ImageGallery.mixin.ts +0 -5
- package/src/brand-page/components/image-gallery/ImageGallery.vue +1 -1
- package/src/brand-page/components/mailing-list/MailingList.mixin.ts +1 -8
- package/src/brand-page/components/mailing-list/MailingList.vue +1 -1
- package/src/brand-page/components/map/Map.vue +1 -5
- package/src/brand-page/components/payment/request-payment/RequestPayment.mixin.ts +0 -5
- package/src/brand-page/components/payment/request-payment/RequestPayment.vue +0 -1
- package/src/brand-page/components/payment/support-me/SupportMe.mixin.ts +1 -8
- package/src/brand-page/components/payment/support-me/SupportMe.vue +0 -1
- package/src/brand-page/components/shop/Shop.vue +2 -7
- package/src/brand-page/components/social-links/SocialLinks.vue +3 -7
- package/src/brand-page/components/testimonial-section/TestimonialSection.mixin.ts +132 -0
- package/src/brand-page/components/testimonial-section/TestimonialSection.vue +11 -120
- package/src/brand-page/components/text/Text.vue +5 -12
- package/src/brand-page/components/text-media-section/TextMediaSection.vue +3 -11
- package/src/brand-page/components/video/Video.mixin.ts +0 -5
- package/src/brand-page/components/video/Video.vue +1 -1
- package/src/brand-page/constants/font.constants.ts +4 -4
- package/src/brand-page/constants/misc.constants.ts +0 -58
- package/src/brand-page/models/content.model.ts +0 -2
- package/src/brand-page/utils/__snapshots__/migration.util.test.ts.snap +3 -9
- package/src/brand-page/utils/__snapshots__/migration2.util.test.ts.snap +6 -6
- package/src/brand-page/utils/__snapshots__/model.util.test.ts.snap +12 -12
- package/src/brand-page/utils/index.ts +0 -1
- package/src/brand-page/utils/migration.util.test.ts +0 -290
- package/src/brand-page/utils/migration.util.ts +0 -11
- package/src/brand-page-maker/constants/config-settings-constant.ts +0 -45
- package/src/brand-page-maker/convertors/about-display-style.convertor.ts +0 -10
- package/src/brand-page-maker/convertors/banner-align-display-style.convertor.ts +0 -8
- package/src/brand-page-maker/convertors/contact-layout-style.convertor.ts +0 -8
- package/src/brand-page-maker/models/content-settings.ts +2 -43
- package/src/bundles/bundled-translations.de-DE.json +0 -2
- package/src/bundles/bundled-translations.es-ES.json +0 -2
- package/src/bundles/bundled-translations.fr-CA.json +0 -2
- package/src/bundles/bundled-translations.fr-FR.json +0 -2
- package/src/bundles/bundled-translations.json +0 -2
- package/src/bundles/bundled-translations.pt-BR.json +0 -2
- package/src/bundles/bundled-translations.pt-PT.json +0 -2
- package/src/shared/content-settings/components/content-settings/i18n/content-settings.de-DE.json +0 -2
- package/src/shared/content-settings/components/content-settings/i18n/content-settings.es-ES.json +0 -2
- package/src/shared/content-settings/components/content-settings/i18n/content-settings.fr-CA.json +0 -2
- package/src/shared/content-settings/components/content-settings/i18n/content-settings.fr-FR.json +0 -2
- package/src/shared/content-settings/components/content-settings/i18n/content-settings.json +0 -2
- package/src/shared/content-settings/components/content-settings/i18n/content-settings.pt-BR.json +0 -2
- package/src/shared/content-settings/components/content-settings/i18n/content-settings.pt-PT.json +0 -2
- package/src/shared/content-settings/components/content-settings-item/ContentSettingsItem.vue +1 -1
- package/src/shared/content-settings/components/focused-content-item-settings/FocusedContentItemSettings.vue +2 -2
- package/src/shared/content-settings/components/slider-field/SliderField.mixin.ts +0 -9
- package/src/utils/minify-brand-page-metadata.ts +1 -11
- package/lib/src/brand-page/utils/content-padding.util.d.ts +0 -13
- package/lib/src/brand-page/utils/content-padding.util.js +0 -10
- package/lib/src/brand-page/utils/migration/migration-17.d.ts +0 -2
- package/lib/src/brand-page/utils/migration/migration-17.js +0 -60
- package/src/brand-page/utils/content-padding.util.test.ts +0 -29
- package/src/brand-page/utils/content-padding.util.ts +0 -13
- package/src/brand-page/utils/migration/migration-17.ts +0 -77
- package/src/brand-page-maker/convertors/contact-layout-style.convertor.test.ts +0 -50
|
@@ -6,7 +6,6 @@ import {
|
|
|
6
6
|
ALIGN_CARD_CENTER_IMAGE,
|
|
7
7
|
TEXT_ONLY,
|
|
8
8
|
ALIGN_CARD_CENTER,
|
|
9
|
-
CONTACT_FORM_LAYOUT_DEFAULT_PADDING,
|
|
10
9
|
} from '@brand-page/constants';
|
|
11
10
|
import type { ContactFormContent } from '@brand-page';
|
|
12
11
|
|
|
@@ -85,15 +84,8 @@ export const contactLayoutStyleConvertor: ValueConvertor<
|
|
|
85
84
|
textAlign = 'left';
|
|
86
85
|
}
|
|
87
86
|
|
|
88
|
-
// Switching layout adopts that layout's canonical look — same as the
|
|
89
|
-
// textAlign resets below — including its default block padding.
|
|
90
|
-
const padding =
|
|
91
|
-
CONTACT_FORM_LAYOUT_DEFAULT_PADDING[selectedOption?.value ?? ''] ?? 0;
|
|
92
|
-
|
|
93
87
|
return {
|
|
94
88
|
layoutStyle: selectedOption?.value,
|
|
95
|
-
topPadding: padding,
|
|
96
|
-
bottomPadding: padding,
|
|
97
89
|
titleStyle: {
|
|
98
90
|
textAlign,
|
|
99
91
|
},
|
|
@@ -24,8 +24,6 @@ import {
|
|
|
24
24
|
EMPTY_LOGO_IMAGE_MODEL,
|
|
25
25
|
BRAND_PAGE_TYPES,
|
|
26
26
|
SENSITIVE_CONTENT_TYPES,
|
|
27
|
-
CONTACT_FORM_LAYOUT_DEFAULT_PADDING,
|
|
28
|
-
TESTIMONIAL_DEFAULT_PADDING,
|
|
29
27
|
} from '@brand-page';
|
|
30
28
|
import type {
|
|
31
29
|
ButtonContent,
|
|
@@ -173,8 +171,6 @@ export const createInitialImageGalleryContent = (): ImageGalleryContent => {
|
|
|
173
171
|
galleryStyles: {
|
|
174
172
|
galleryType: 'grid',
|
|
175
173
|
},
|
|
176
|
-
topPadding: 0,
|
|
177
|
-
bottomPadding: 0,
|
|
178
174
|
};
|
|
179
175
|
};
|
|
180
176
|
|
|
@@ -186,8 +182,6 @@ export const createInitialVideoContent = (): VideoContent => {
|
|
|
186
182
|
displayStyle: DISPLAY_STYLE_PREVIEW,
|
|
187
183
|
mute: false,
|
|
188
184
|
videoUrl: '',
|
|
189
|
-
topPadding: 0,
|
|
190
|
-
bottomPadding: 0,
|
|
191
185
|
};
|
|
192
186
|
};
|
|
193
187
|
|
|
@@ -245,10 +239,6 @@ export const createInitialTextContent = (
|
|
|
245
239
|
]
|
|
246
240
|
: undefined,
|
|
247
241
|
type: 'text',
|
|
248
|
-
// Brand Site text blocks sit in a 12px outer padding; Brand Page / Brand Contact use 0.
|
|
249
|
-
topPadding: options?.brandPageType === BRAND_PAGE_TYPES.brandSite ? 12 : 0,
|
|
250
|
-
bottomPadding:
|
|
251
|
-
options?.brandPageType === BRAND_PAGE_TYPES.brandSite ? 12 : 0,
|
|
252
242
|
textSize: {
|
|
253
243
|
fontSize: FONT_SIZE_BODY,
|
|
254
244
|
lineHeight: LINE_HEIGHT_BODY,
|
|
@@ -292,8 +282,6 @@ export const createInitialMapContent = (): MapContent => {
|
|
|
292
282
|
formattedAddress: '',
|
|
293
283
|
placeId: '',
|
|
294
284
|
},
|
|
295
|
-
topPadding: 0,
|
|
296
|
-
bottomPadding: 0,
|
|
297
285
|
};
|
|
298
286
|
};
|
|
299
287
|
|
|
@@ -303,8 +291,6 @@ export const createInitialMailingListContent = (
|
|
|
303
291
|
return {
|
|
304
292
|
id: uuid.v4(),
|
|
305
293
|
type: 'mailing-list',
|
|
306
|
-
topPadding: 0,
|
|
307
|
-
bottomPadding: 0,
|
|
308
294
|
title: contentSettingsTr(`mailingListTitle`),
|
|
309
295
|
buttonText: contentSettingsTr(`subscribePlaceholder`),
|
|
310
296
|
acceptedFields: 'emailOnly',
|
|
@@ -338,8 +324,6 @@ export const createInitialRequestPaymentContent = (
|
|
|
338
324
|
successMessage: '',
|
|
339
325
|
title: contentSettingsTr(`buyNowTitle`),
|
|
340
326
|
type: 'request-payment',
|
|
341
|
-
topPadding: 0,
|
|
342
|
-
bottomPadding: 0,
|
|
343
327
|
fillColor: {},
|
|
344
328
|
defaultBorderColor: {},
|
|
345
329
|
selectedBorderColor: {},
|
|
@@ -372,8 +356,6 @@ export const createInitialShopContent = (
|
|
|
372
356
|
return {
|
|
373
357
|
id: uuid.v4(),
|
|
374
358
|
description: '',
|
|
375
|
-
topPadding: 16,
|
|
376
|
-
bottomPadding: 16,
|
|
377
359
|
products: [],
|
|
378
360
|
displayStyle: PAYMENT_OPTION_DISPLAY_TYPES.thumbnail,
|
|
379
361
|
aspectRatio: PAYMENT_OPTION_IMAGE_TYPES.auto,
|
|
@@ -433,8 +415,6 @@ export const createInitialSupportMeContent = (
|
|
|
433
415
|
successMessage: contentSettingsTr(`successSupportPlaceholder`),
|
|
434
416
|
description: contentSettingsTr(`makeADonationDescription`),
|
|
435
417
|
type: 'support-me',
|
|
436
|
-
topPadding: 0,
|
|
437
|
-
bottomPadding: 0,
|
|
438
418
|
titleStyle: {
|
|
439
419
|
applyAutoScale: options?.brandPageType === BRAND_PAGE_TYPES.brandSite,
|
|
440
420
|
textStyleType: TEXT_STYLE_TYPES.headings,
|
|
@@ -473,21 +453,14 @@ export const createInitialContactFormContent: CreateInitialContentFunction<
|
|
|
473
453
|
console.error('userState.emailAddress should not be undefined');
|
|
474
454
|
}
|
|
475
455
|
|
|
476
|
-
// New blocks inherit the padding their initial layout previously had
|
|
477
|
-
// hard-coded — same source as the migration backfill for existing pages.
|
|
478
|
-
const layoutStyle =
|
|
479
|
-
options?.brandPageType === 'brandSite' ? 'center-card-aligned' : '';
|
|
480
|
-
const padding = CONTACT_FORM_LAYOUT_DEFAULT_PADDING[layoutStyle] ?? 0;
|
|
481
|
-
|
|
482
456
|
return {
|
|
483
457
|
id: uuid.v4(),
|
|
484
458
|
title: contentSettingsTr(`contactUsTitle`),
|
|
485
459
|
description: '',
|
|
486
460
|
buttonText: contentSettingsTr(`sendPlaceholder`),
|
|
487
461
|
displayStyle: DISPLAY_STYLE_PREVIEW,
|
|
488
|
-
layoutStyle
|
|
489
|
-
|
|
490
|
-
bottomPadding: padding,
|
|
462
|
+
layoutStyle:
|
|
463
|
+
options?.brandPageType === 'brandSite' ? 'center-card-aligned' : '',
|
|
491
464
|
imageUrl: '',
|
|
492
465
|
fields: [
|
|
493
466
|
{
|
|
@@ -580,8 +553,6 @@ export const createInitialBannerSectionContent: CreateInitialContentFunction<
|
|
|
580
553
|
> = (options?: CreateInitialContentOptions) => {
|
|
581
554
|
return {
|
|
582
555
|
id: uuid.v4(),
|
|
583
|
-
topPadding: 32,
|
|
584
|
-
bottomPadding: 32,
|
|
585
556
|
imageUrl: '',
|
|
586
557
|
title: contentSettingsTr(`thisIsABannerTitle`),
|
|
587
558
|
description: '',
|
|
@@ -628,8 +599,6 @@ export const createInitialBookingSectionContent: CreateInitialContentFunction<
|
|
|
628
599
|
buttonText: contentSettingsTr(`bookNowLabel`),
|
|
629
600
|
url: '',
|
|
630
601
|
type: 'booking-section',
|
|
631
|
-
topPadding: 32,
|
|
632
|
-
bottomPadding: 32,
|
|
633
602
|
descriptionStyle: {
|
|
634
603
|
applyAutoScale: options?.brandPageType === BRAND_PAGE_TYPES.brandSite,
|
|
635
604
|
textStyleType: TEXT_STYLE_TYPES.paragraphs,
|
|
@@ -659,8 +628,6 @@ export const createInitialImagesSectionContent: CreateInitialContentFunction<
|
|
|
659
628
|
title: contentSettingsTr(`imagesTitle`),
|
|
660
629
|
description: '',
|
|
661
630
|
type: 'images-section',
|
|
662
|
-
topPadding: 32,
|
|
663
|
-
bottomPadding: 32,
|
|
664
631
|
displayStyle: 'centered',
|
|
665
632
|
aspectRatio: 'Default',
|
|
666
633
|
areImagesFullWidth: false,
|
|
@@ -716,8 +683,6 @@ export const createInitialTestimonialSectionContent: CreateInitialContentFunctio
|
|
|
716
683
|
title: contentSettingsTr(`testimonialsTitle`),
|
|
717
684
|
type: 'testimonial-section',
|
|
718
685
|
displayStyle: 'centered',
|
|
719
|
-
topPadding: TESTIMONIAL_DEFAULT_PADDING,
|
|
720
|
-
bottomPadding: TESTIMONIAL_DEFAULT_PADDING,
|
|
721
686
|
items: [],
|
|
722
687
|
titleStyle: {
|
|
723
688
|
applyAutoScale: options?.brandPageType === BRAND_PAGE_TYPES.brandSite,
|
|
@@ -766,8 +731,6 @@ export const createInitialAboutSectionContent: CreateInitialContentFunction<
|
|
|
766
731
|
textAlign: 'center',
|
|
767
732
|
},
|
|
768
733
|
backgroundStyle: {},
|
|
769
|
-
topPadding: 32,
|
|
770
|
-
bottomPadding: 32,
|
|
771
734
|
};
|
|
772
735
|
};
|
|
773
736
|
|
|
@@ -830,8 +793,6 @@ export const createInitialSocialLinksContent = (
|
|
|
830
793
|
return {
|
|
831
794
|
id: uuid.v4(),
|
|
832
795
|
type: 'social-links',
|
|
833
|
-
topPadding: 32,
|
|
834
|
-
bottomPadding: 32,
|
|
835
796
|
title: contentSettingsTr(`followUsOnTitle`),
|
|
836
797
|
links: [
|
|
837
798
|
{
|
|
@@ -885,8 +846,6 @@ export const createInitialShapesSectionContent: CreateInitialContentFunction<
|
|
|
885
846
|
title: contentSettingsTr(`shapesTitle`),
|
|
886
847
|
description: '',
|
|
887
848
|
type: 'shapes-section',
|
|
888
|
-
topPadding: 32,
|
|
889
|
-
bottomPadding: 32,
|
|
890
849
|
displayStyle: 'centered',
|
|
891
850
|
items: [
|
|
892
851
|
{
|
|
@@ -1529,8 +1529,6 @@
|
|
|
1529
1529
|
"iconFillColorTitle": "Farbe der Symbolfüllung",
|
|
1530
1530
|
"iconBackgroundColorTitle": "Symbolhintergrundfarbe",
|
|
1531
1531
|
"paddingTitle": "Polsterung",
|
|
1532
|
-
"topPaddingTitle": "Polsterung oben",
|
|
1533
|
-
"bottomPaddingTitle": "Polsterung unten",
|
|
1534
1532
|
"dividerStyleTitle": "Trennlinienstil",
|
|
1535
1533
|
"dividerColorTitle": "Trennlinienfarbe",
|
|
1536
1534
|
"addItemTitle": "Artikel hinzufügen",
|
|
@@ -1529,8 +1529,6 @@
|
|
|
1529
1529
|
"iconFillColorTitle": "Color de relleno del icono",
|
|
1530
1530
|
"iconBackgroundColorTitle": "Color de fondo del icono",
|
|
1531
1531
|
"paddingTitle": "Relleno",
|
|
1532
|
-
"topPaddingTitle": "Relleno superior",
|
|
1533
|
-
"bottomPaddingTitle": "Relleno inferior",
|
|
1534
1532
|
"dividerStyleTitle": "Estilo del divisor",
|
|
1535
1533
|
"dividerColorTitle": "Color del separador",
|
|
1536
1534
|
"addItemTitle": "Añadir artículo",
|
|
@@ -1529,8 +1529,6 @@
|
|
|
1529
1529
|
"iconFillColorTitle": "Couleur de remplissage de l’icône",
|
|
1530
1530
|
"iconBackgroundColorTitle": "Couleur d’arrière-plan de l’icône",
|
|
1531
1531
|
"paddingTitle": "Marges intérieures",
|
|
1532
|
-
"topPaddingTitle": "Marge intérieure supérieure",
|
|
1533
|
-
"bottomPaddingTitle": "Marges intérieures inférieures",
|
|
1534
1532
|
"dividerStyleTitle": "Style de séparateur",
|
|
1535
1533
|
"dividerColorTitle": "Couleur du séparateur",
|
|
1536
1534
|
"addItemTitle": "Ajouter un article",
|
|
@@ -1529,8 +1529,6 @@
|
|
|
1529
1529
|
"iconFillColorTitle": "Couleur de remplissage de l’icône",
|
|
1530
1530
|
"iconBackgroundColorTitle": "Couleur d’arrière-plan de l’icône",
|
|
1531
1531
|
"paddingTitle": "Marges intérieures",
|
|
1532
|
-
"topPaddingTitle": "Marges intérieures supérieures",
|
|
1533
|
-
"bottomPaddingTitle": "Marges intérieures inférieures",
|
|
1534
1532
|
"dividerStyleTitle": "Style de séparateur",
|
|
1535
1533
|
"dividerColorTitle": "Couleur du séparateur",
|
|
1536
1534
|
"addItemTitle": "Ajouter un article",
|
|
@@ -1529,8 +1529,6 @@
|
|
|
1529
1529
|
"iconFillColorTitle": "Icon fill color",
|
|
1530
1530
|
"iconBackgroundColorTitle": "Icon background color",
|
|
1531
1531
|
"paddingTitle": "Padding",
|
|
1532
|
-
"topPaddingTitle": "Top padding",
|
|
1533
|
-
"bottomPaddingTitle": "Bottom padding",
|
|
1534
1532
|
"dividerStyleTitle": "Divider Style",
|
|
1535
1533
|
"dividerColorTitle": "Divider color",
|
|
1536
1534
|
"addItemTitle": "Add Item",
|
|
@@ -1529,8 +1529,6 @@
|
|
|
1529
1529
|
"iconFillColorTitle": "Cor de preenchimento do ícone",
|
|
1530
1530
|
"iconBackgroundColorTitle": "Cor de fundo do ícone",
|
|
1531
1531
|
"paddingTitle": "Preenchimento",
|
|
1532
|
-
"topPaddingTitle": "Preenchimento superior",
|
|
1533
|
-
"bottomPaddingTitle": "Preenchimento inferior",
|
|
1534
1532
|
"dividerStyleTitle": "Estilo do separador",
|
|
1535
1533
|
"dividerColorTitle": "Cor do separador",
|
|
1536
1534
|
"addItemTitle": "Adicionar item",
|
|
@@ -1529,8 +1529,6 @@
|
|
|
1529
1529
|
"iconFillColorTitle": "Cor de preenchimento do ícone",
|
|
1530
1530
|
"iconBackgroundColorTitle": "Cor de fundo do ícone",
|
|
1531
1531
|
"paddingTitle": "Preenchimento",
|
|
1532
|
-
"topPaddingTitle": "Preenchimento superior",
|
|
1533
|
-
"bottomPaddingTitle": "Preenchimento inferior",
|
|
1534
1532
|
"dividerStyleTitle": "Estilo do separador",
|
|
1535
1533
|
"dividerColorTitle": "Cor do separador",
|
|
1536
1534
|
"addItemTitle": "Adicionar Item",
|
package/src/shared/content-settings/components/content-settings/i18n/content-settings.de-DE.json
CHANGED
|
@@ -113,8 +113,6 @@
|
|
|
113
113
|
"iconFillColorTitle": "Farbe der Symbolfüllung",
|
|
114
114
|
"iconBackgroundColorTitle": "Symbolhintergrundfarbe",
|
|
115
115
|
"paddingTitle": "Polsterung",
|
|
116
|
-
"topPaddingTitle": "Polsterung oben",
|
|
117
|
-
"bottomPaddingTitle": "Polsterung unten",
|
|
118
116
|
"dividerStyleTitle": "Trennlinienstil",
|
|
119
117
|
"dividerColorTitle": "Trennlinienfarbe",
|
|
120
118
|
"addItemTitle": "Artikel hinzufügen",
|
package/src/shared/content-settings/components/content-settings/i18n/content-settings.es-ES.json
CHANGED
|
@@ -113,8 +113,6 @@
|
|
|
113
113
|
"iconFillColorTitle": "Color de relleno del icono",
|
|
114
114
|
"iconBackgroundColorTitle": "Color de fondo del icono",
|
|
115
115
|
"paddingTitle": "Relleno",
|
|
116
|
-
"topPaddingTitle": "Relleno superior",
|
|
117
|
-
"bottomPaddingTitle": "Relleno inferior",
|
|
118
116
|
"dividerStyleTitle": "Estilo del divisor",
|
|
119
117
|
"dividerColorTitle": "Color del separador",
|
|
120
118
|
"addItemTitle": "Añadir artículo",
|
package/src/shared/content-settings/components/content-settings/i18n/content-settings.fr-CA.json
CHANGED
|
@@ -113,8 +113,6 @@
|
|
|
113
113
|
"iconFillColorTitle": "Couleur de remplissage de l’icône",
|
|
114
114
|
"iconBackgroundColorTitle": "Couleur d’arrière-plan de l’icône",
|
|
115
115
|
"paddingTitle": "Marges intérieures",
|
|
116
|
-
"topPaddingTitle": "Marge intérieure supérieure",
|
|
117
|
-
"bottomPaddingTitle": "Marges intérieures inférieures",
|
|
118
116
|
"dividerStyleTitle": "Style de séparateur",
|
|
119
117
|
"dividerColorTitle": "Couleur du séparateur",
|
|
120
118
|
"addItemTitle": "Ajouter un article",
|
package/src/shared/content-settings/components/content-settings/i18n/content-settings.fr-FR.json
CHANGED
|
@@ -113,8 +113,6 @@
|
|
|
113
113
|
"iconFillColorTitle": "Couleur de remplissage de l’icône",
|
|
114
114
|
"iconBackgroundColorTitle": "Couleur d’arrière-plan de l’icône",
|
|
115
115
|
"paddingTitle": "Marges intérieures",
|
|
116
|
-
"topPaddingTitle": "Marges intérieures supérieures",
|
|
117
|
-
"bottomPaddingTitle": "Marges intérieures inférieures",
|
|
118
116
|
"dividerStyleTitle": "Style de séparateur",
|
|
119
117
|
"dividerColorTitle": "Couleur du séparateur",
|
|
120
118
|
"addItemTitle": "Ajouter un article",
|
|
@@ -113,8 +113,6 @@
|
|
|
113
113
|
"iconFillColorTitle": "Icon fill color",
|
|
114
114
|
"iconBackgroundColorTitle": "Icon background color",
|
|
115
115
|
"paddingTitle": "Padding",
|
|
116
|
-
"topPaddingTitle": "Top padding",
|
|
117
|
-
"bottomPaddingTitle": "Bottom padding",
|
|
118
116
|
"dividerStyleTitle": "Divider Style",
|
|
119
117
|
"dividerColorTitle": "Divider color",
|
|
120
118
|
"addItemTitle": "Add Item",
|
package/src/shared/content-settings/components/content-settings/i18n/content-settings.pt-BR.json
CHANGED
|
@@ -113,8 +113,6 @@
|
|
|
113
113
|
"iconFillColorTitle": "Cor de preenchimento do ícone",
|
|
114
114
|
"iconBackgroundColorTitle": "Cor de fundo do ícone",
|
|
115
115
|
"paddingTitle": "Preenchimento",
|
|
116
|
-
"topPaddingTitle": "Preenchimento superior",
|
|
117
|
-
"bottomPaddingTitle": "Preenchimento inferior",
|
|
118
116
|
"dividerStyleTitle": "Estilo do separador",
|
|
119
117
|
"dividerColorTitle": "Cor do separador",
|
|
120
118
|
"addItemTitle": "Adicionar item",
|
package/src/shared/content-settings/components/content-settings/i18n/content-settings.pt-PT.json
CHANGED
|
@@ -113,8 +113,6 @@
|
|
|
113
113
|
"iconFillColorTitle": "Cor de preenchimento do ícone",
|
|
114
114
|
"iconBackgroundColorTitle": "Cor de fundo do ícone",
|
|
115
115
|
"paddingTitle": "Preenchimento",
|
|
116
|
-
"topPaddingTitle": "Preenchimento superior",
|
|
117
|
-
"bottomPaddingTitle": "Preenchimento inferior",
|
|
118
116
|
"dividerStyleTitle": "Estilo do separador",
|
|
119
117
|
"dividerColorTitle": "Cor do separador",
|
|
120
118
|
"addItemTitle": "Adicionar Item",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
>
|
|
26
26
|
<ul>
|
|
27
27
|
<li
|
|
28
|
-
v-for="field in group.fields"
|
|
29
|
-
:key="`content-settings-item-group-field-${id}-${group.id}-${
|
|
28
|
+
v-for="(field, fieldIndex) in group.fields"
|
|
29
|
+
:key="`content-settings-item-group-field-${id}-${group.id}-${fieldIndex}`"
|
|
30
30
|
>
|
|
31
31
|
<ContentSettingsItemField
|
|
32
32
|
v-if="
|
|
@@ -45,15 +45,6 @@ export default defineComponent({
|
|
|
45
45
|
sliderValue: value,
|
|
46
46
|
};
|
|
47
47
|
},
|
|
48
|
-
watch: {
|
|
49
|
-
// The value can change outside the slider (e.g. a layout switch
|
|
50
|
-
// re-applying default padding, or undo) — keep the display in sync.
|
|
51
|
-
value(newValue: string | undefined) {
|
|
52
|
-
this.sliderValue = this.valueConvertor
|
|
53
|
-
? this.valueConvertor.convert(newValue as any)
|
|
54
|
-
: newValue;
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
48
|
computed: {
|
|
58
49
|
innerMinLength(): number {
|
|
59
50
|
return this.minLength ?? 0;
|
|
@@ -205,17 +205,7 @@ const minifyContent = (
|
|
|
205
205
|
editor: Editor,
|
|
206
206
|
assets?: AssetEntry[],
|
|
207
207
|
): MinifiedContent => {
|
|
208
|
-
const base: MinifiedContent = {
|
|
209
|
-
id: content.id,
|
|
210
|
-
type: content.type,
|
|
211
|
-
// Padding Control (BP-5687) — shared across every block, persist when set.
|
|
212
|
-
...(typeof content.topPadding === 'number' && {
|
|
213
|
-
topPadding: content.topPadding,
|
|
214
|
-
}),
|
|
215
|
-
...(typeof content.bottomPadding === 'number' && {
|
|
216
|
-
bottomPadding: content.bottomPadding,
|
|
217
|
-
}),
|
|
218
|
-
};
|
|
208
|
+
const base: MinifiedContent = { id: content.id, type: content.type };
|
|
219
209
|
const c = content as any;
|
|
220
210
|
|
|
221
211
|
// Helper: include imageUrl and its asset key if available
|
|
@@ -1,13 +0,0 @@
|
|
|
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 declare const contentPaddingStyle: (content: {
|
|
8
|
-
topPadding?: number;
|
|
9
|
-
bottomPadding?: number;
|
|
10
|
-
}) => {
|
|
11
|
-
paddingTop: string;
|
|
12
|
-
paddingBottom: string;
|
|
13
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
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
|
-
paddingTop: `${content.topPadding ?? 0}px`,
|
|
9
|
-
paddingBottom: `${content.bottomPadding ?? 0}px`,
|
|
10
|
-
});
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { BRAND_PAGE_TYPES } from '../../models';
|
|
2
|
-
import { CONTACT_FORM_LAYOUT_DEFAULT_PADDING, TESTIMONIAL_DEFAULT_PADDING, bannerDisplayStyleDefaultPadding, } from '../../constants';
|
|
3
|
-
/**
|
|
4
|
-
* Padding Control backfill (BP-5699 Tier 2, BP-5700 Store): blocks that already
|
|
5
|
-
* had hard-coded top/bottom spacing. Backfill that spacing as the block's explicit
|
|
6
|
-
* topPadding/bottomPadding so existing pages render unchanged once the spacing
|
|
7
|
-
* moves to the Padding Control sliders. Type-scoped and idempotent — only the
|
|
8
|
-
* listed types, and only when the value isn't already set.
|
|
9
|
-
*
|
|
10
|
-
* Exception — `testimonial-section` (BP-5703): testimonials had 32px mobile / 80px
|
|
11
|
-
* desktop and are intentionally collapsing to a single value across both breakpoints,
|
|
12
|
-
* so the backfill sets that single value rather than preserving the old desktop 80px.
|
|
13
|
-
* Existing testimonials will look tighter on desktop / roomier on mobile — by design.
|
|
14
|
-
*/
|
|
15
|
-
const BLOCK_DEFAULT_PADDING = {
|
|
16
|
-
'images-section': 32,
|
|
17
|
-
'social-links': 32,
|
|
18
|
-
'shapes-section': 32,
|
|
19
|
-
'booking-section': 32,
|
|
20
|
-
'shop-section': 16,
|
|
21
|
-
'about-section': 32,
|
|
22
|
-
'testimonial-section': TESTIMONIAL_DEFAULT_PADDING,
|
|
23
|
-
};
|
|
24
|
-
export const migration17 = async (migrationResult) => {
|
|
25
|
-
const { brandPageModel } = migrationResult;
|
|
26
|
-
brandPageModel.pages.forEach((page) => {
|
|
27
|
-
page.contents.forEach((content) => {
|
|
28
|
-
// Contact Form and Banner previously varied their hard-coded spacing by
|
|
29
|
-
// layout/display style (full-bleed image layouts had no outer padding), so they're
|
|
30
|
-
// keyed by that rather than a single per-type value.
|
|
31
|
-
let value;
|
|
32
|
-
if (content.type === 'contact-form') {
|
|
33
|
-
value =
|
|
34
|
-
CONTACT_FORM_LAYOUT_DEFAULT_PADDING[content.layoutStyle ?? ''];
|
|
35
|
-
}
|
|
36
|
-
else if (content.type === 'banner-section') {
|
|
37
|
-
value = bannerDisplayStyleDefaultPadding(content.displayStyle);
|
|
38
|
-
}
|
|
39
|
-
else if (content.type === 'text') {
|
|
40
|
-
// Text outer padding is brand-page-type specific: 12 on Brand Site, 0 on
|
|
41
|
-
// Brand Page / Brand Contact - backfill per type so existing pages render unchanged.
|
|
42
|
-
value =
|
|
43
|
-
brandPageModel.brandPageType === BRAND_PAGE_TYPES.brandSite ? 12 : 0;
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
46
|
-
value = BLOCK_DEFAULT_PADDING[content.type];
|
|
47
|
-
}
|
|
48
|
-
if (value === undefined) {
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
if (content.topPadding === undefined) {
|
|
52
|
-
content.topPadding = value;
|
|
53
|
-
}
|
|
54
|
-
if (content.bottomPadding === undefined) {
|
|
55
|
-
content.bottomPadding = value;
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
return migrationResult;
|
|
60
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
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
|
-
});
|
|
@@ -1,13 +0,0 @@
|
|
|
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,77 +0,0 @@
|
|
|
1
|
-
import type { MigrationData } from '../migration.util';
|
|
2
|
-
import type { BannerSectionContent, ContactFormContent } from '../../models';
|
|
3
|
-
import { BRAND_PAGE_TYPES } from '../../models';
|
|
4
|
-
import {
|
|
5
|
-
CONTACT_FORM_LAYOUT_DEFAULT_PADDING,
|
|
6
|
-
TESTIMONIAL_DEFAULT_PADDING,
|
|
7
|
-
bannerDisplayStyleDefaultPadding,
|
|
8
|
-
} from '../../constants';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Padding Control backfill (BP-5699 Tier 2, BP-5700 Store): blocks that already
|
|
12
|
-
* had hard-coded top/bottom spacing. Backfill that spacing as the block's explicit
|
|
13
|
-
* topPadding/bottomPadding so existing pages render unchanged once the spacing
|
|
14
|
-
* moves to the Padding Control sliders. Type-scoped and idempotent — only the
|
|
15
|
-
* listed types, and only when the value isn't already set.
|
|
16
|
-
*
|
|
17
|
-
* Exception — `testimonial-section` (BP-5703): testimonials had 32px mobile / 80px
|
|
18
|
-
* desktop and are intentionally collapsing to a single value across both breakpoints,
|
|
19
|
-
* so the backfill sets that single value rather than preserving the old desktop 80px.
|
|
20
|
-
* Existing testimonials will look tighter on desktop / roomier on mobile — by design.
|
|
21
|
-
*/
|
|
22
|
-
const BLOCK_DEFAULT_PADDING: Partial<Record<string, number>> = {
|
|
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 if (content.type === 'text') {
|
|
54
|
-
// Text outer padding is brand-page-type specific: 12 on Brand Site, 0 on
|
|
55
|
-
// Brand Page / Brand Contact - backfill per type so existing pages render unchanged.
|
|
56
|
-
value =
|
|
57
|
-
brandPageModel.brandPageType === BRAND_PAGE_TYPES.brandSite ? 12 : 0;
|
|
58
|
-
} else {
|
|
59
|
-
value = BLOCK_DEFAULT_PADDING[content.type];
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
if (value === undefined) {
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
if (content.topPadding === undefined) {
|
|
67
|
-
content.topPadding = value;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
if (content.bottomPadding === undefined) {
|
|
71
|
-
content.bottomPadding = value;
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
return migrationResult;
|
|
77
|
-
};
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { describe, test, expect } from 'vitest';
|
|
2
|
-
import { contactLayoutStyleConvertor } from './contact-layout-style.convertor';
|
|
3
|
-
import {
|
|
4
|
-
ALIGN_CENTERED,
|
|
5
|
-
ALIGN_CARD_CENTER,
|
|
6
|
-
ALIGN_CARD_CENTER_IMAGE,
|
|
7
|
-
ALIGN_LEFT_FULL_IMAGE,
|
|
8
|
-
TEXT_ONLY,
|
|
9
|
-
} from '@brand-page/constants';
|
|
10
|
-
|
|
11
|
-
const configWithSelected = (selected: string) => ({
|
|
12
|
-
options: contactLayoutStyleConvertor
|
|
13
|
-
.convert(selected)
|
|
14
|
-
.options.map((option) => ({
|
|
15
|
-
...option,
|
|
16
|
-
isSelected: option.value === selected,
|
|
17
|
-
})),
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
describe('contact-layout-style.convertor', () => {
|
|
21
|
-
test.each([
|
|
22
|
-
[ALIGN_CARD_CENTER, 32, 'center'],
|
|
23
|
-
[ALIGN_CENTERED, 32, 'center'],
|
|
24
|
-
[ALIGN_CARD_CENTER_IMAGE, 0, 'center'],
|
|
25
|
-
[TEXT_ONLY, 32, 'left'],
|
|
26
|
-
[ALIGN_LEFT_FULL_IMAGE, 0, 'left'],
|
|
27
|
-
])(
|
|
28
|
-
'convertBack should apply the default padding and text alignment for %s',
|
|
29
|
-
(layoutStyle, padding, textAlign) => {
|
|
30
|
-
const result = contactLayoutStyleConvertor.convertBack(
|
|
31
|
-
configWithSelected(layoutStyle),
|
|
32
|
-
);
|
|
33
|
-
|
|
34
|
-
expect(result).toStrictEqual({
|
|
35
|
-
layoutStyle,
|
|
36
|
-
topPadding: padding,
|
|
37
|
-
bottomPadding: padding,
|
|
38
|
-
titleStyle: {
|
|
39
|
-
textAlign,
|
|
40
|
-
},
|
|
41
|
-
descriptionStyle: {
|
|
42
|
-
textAlign,
|
|
43
|
-
},
|
|
44
|
-
buttonTextStyle: {
|
|
45
|
-
textAlign: 'center',
|
|
46
|
-
},
|
|
47
|
-
});
|
|
48
|
-
},
|
|
49
|
-
);
|
|
50
|
-
});
|