@designcrowd/library.brand-page 5.18.9-ast-padding-1 → 5.18.9-metadata-timeout-fix
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-CAZavzz5.js → CreatedOnBrandCrowd-de-de-DsoA9hc-.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-en-us-C3ykuu0O.js → CreatedOnBrandCrowd-en-us-BP6NEQ66.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-es-es-Dp1kdubS.js → CreatedOnBrandCrowd-es-es-D424uM1Z.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-fr-XQSZWskY.js → CreatedOnBrandCrowd-fr-ca-CJvuLTkB.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-ca-XQSZWskY.js → CreatedOnBrandCrowd-fr-fr-CJvuLTkB.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-pt-D7Gyr7mi.js → CreatedOnBrandCrowd-pt-br-Cc9L314u.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-br-D7Gyr7mi.js → CreatedOnBrandCrowd-pt-pt-Cc9L314u.js} +1 -1
- package/lib/src/{CreatedOnDcom-de-de-62-Y3e7k.js → CreatedOnDcom-de-de-CX-295FH.js} +1 -1
- package/lib/src/{CreatedOnDcom-en-us-D00b8Ozh.js → CreatedOnDcom-en-us-UFlORUgZ.js} +1 -1
- package/lib/src/{CreatedOnDcom-es-es-DiuuOBp4.js → CreatedOnDcom-es-es-D1tRpcq9.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-ca-D4_3lNx2.js → CreatedOnDcom-fr-ca-Dz_ry9uY.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-fr-DsAo2lNu.js → CreatedOnDcom-fr-fr-8Ydu6b1T.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-br-D7KY-upE.js → CreatedOnDcom-pt-br-COwvw5k4.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-pt-Nxz3ndA_.js → CreatedOnDcom-pt-pt-CB72-eaa.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 +0 -4
- package/lib/src/brand-page/components/testimonial-section/TestimonialSection.mixin.js +1 -4
- 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 -38
- 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/clients/asset-library-clients.js +19 -12
- 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-Sms5Rq17.js → lib-tHPi9EKk.js} +20005 -20191
- 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 +1 -7
- package/src/brand-page/components/testimonial-section/TestimonialSection.vue +6 -4
- 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 -252
- 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 -41
- 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/clients/asset-library-clients.ts +26 -13
- 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 -54
- 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 -72
- package/src/brand-page-maker/convertors/contact-layout-style.convertor.test.ts +0 -50
|
@@ -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,8 +239,6 @@ export const createInitialTextContent = (
|
|
|
245
239
|
]
|
|
246
240
|
: undefined,
|
|
247
241
|
type: 'text',
|
|
248
|
-
topPadding: 12,
|
|
249
|
-
bottomPadding: 12,
|
|
250
242
|
textSize: {
|
|
251
243
|
fontSize: FONT_SIZE_BODY,
|
|
252
244
|
lineHeight: LINE_HEIGHT_BODY,
|
|
@@ -290,8 +282,6 @@ export const createInitialMapContent = (): MapContent => {
|
|
|
290
282
|
formattedAddress: '',
|
|
291
283
|
placeId: '',
|
|
292
284
|
},
|
|
293
|
-
topPadding: 0,
|
|
294
|
-
bottomPadding: 0,
|
|
295
285
|
};
|
|
296
286
|
};
|
|
297
287
|
|
|
@@ -301,8 +291,6 @@ export const createInitialMailingListContent = (
|
|
|
301
291
|
return {
|
|
302
292
|
id: uuid.v4(),
|
|
303
293
|
type: 'mailing-list',
|
|
304
|
-
topPadding: 0,
|
|
305
|
-
bottomPadding: 0,
|
|
306
294
|
title: contentSettingsTr(`mailingListTitle`),
|
|
307
295
|
buttonText: contentSettingsTr(`subscribePlaceholder`),
|
|
308
296
|
acceptedFields: 'emailOnly',
|
|
@@ -336,8 +324,6 @@ export const createInitialRequestPaymentContent = (
|
|
|
336
324
|
successMessage: '',
|
|
337
325
|
title: contentSettingsTr(`buyNowTitle`),
|
|
338
326
|
type: 'request-payment',
|
|
339
|
-
topPadding: 0,
|
|
340
|
-
bottomPadding: 0,
|
|
341
327
|
fillColor: {},
|
|
342
328
|
defaultBorderColor: {},
|
|
343
329
|
selectedBorderColor: {},
|
|
@@ -370,8 +356,6 @@ export const createInitialShopContent = (
|
|
|
370
356
|
return {
|
|
371
357
|
id: uuid.v4(),
|
|
372
358
|
description: '',
|
|
373
|
-
topPadding: 16,
|
|
374
|
-
bottomPadding: 16,
|
|
375
359
|
products: [],
|
|
376
360
|
displayStyle: PAYMENT_OPTION_DISPLAY_TYPES.thumbnail,
|
|
377
361
|
aspectRatio: PAYMENT_OPTION_IMAGE_TYPES.auto,
|
|
@@ -431,8 +415,6 @@ export const createInitialSupportMeContent = (
|
|
|
431
415
|
successMessage: contentSettingsTr(`successSupportPlaceholder`),
|
|
432
416
|
description: contentSettingsTr(`makeADonationDescription`),
|
|
433
417
|
type: 'support-me',
|
|
434
|
-
topPadding: 0,
|
|
435
|
-
bottomPadding: 0,
|
|
436
418
|
titleStyle: {
|
|
437
419
|
applyAutoScale: options?.brandPageType === BRAND_PAGE_TYPES.brandSite,
|
|
438
420
|
textStyleType: TEXT_STYLE_TYPES.headings,
|
|
@@ -471,21 +453,14 @@ export const createInitialContactFormContent: CreateInitialContentFunction<
|
|
|
471
453
|
console.error('userState.emailAddress should not be undefined');
|
|
472
454
|
}
|
|
473
455
|
|
|
474
|
-
// New blocks inherit the padding their initial layout previously had
|
|
475
|
-
// hard-coded — same source as the migration backfill for existing pages.
|
|
476
|
-
const layoutStyle =
|
|
477
|
-
options?.brandPageType === 'brandSite' ? 'center-card-aligned' : '';
|
|
478
|
-
const padding = CONTACT_FORM_LAYOUT_DEFAULT_PADDING[layoutStyle] ?? 0;
|
|
479
|
-
|
|
480
456
|
return {
|
|
481
457
|
id: uuid.v4(),
|
|
482
458
|
title: contentSettingsTr(`contactUsTitle`),
|
|
483
459
|
description: '',
|
|
484
460
|
buttonText: contentSettingsTr(`sendPlaceholder`),
|
|
485
461
|
displayStyle: DISPLAY_STYLE_PREVIEW,
|
|
486
|
-
layoutStyle
|
|
487
|
-
|
|
488
|
-
bottomPadding: padding,
|
|
462
|
+
layoutStyle:
|
|
463
|
+
options?.brandPageType === 'brandSite' ? 'center-card-aligned' : '',
|
|
489
464
|
imageUrl: '',
|
|
490
465
|
fields: [
|
|
491
466
|
{
|
|
@@ -578,8 +553,6 @@ export const createInitialBannerSectionContent: CreateInitialContentFunction<
|
|
|
578
553
|
> = (options?: CreateInitialContentOptions) => {
|
|
579
554
|
return {
|
|
580
555
|
id: uuid.v4(),
|
|
581
|
-
topPadding: 32,
|
|
582
|
-
bottomPadding: 32,
|
|
583
556
|
imageUrl: '',
|
|
584
557
|
title: contentSettingsTr(`thisIsABannerTitle`),
|
|
585
558
|
description: '',
|
|
@@ -626,8 +599,6 @@ export const createInitialBookingSectionContent: CreateInitialContentFunction<
|
|
|
626
599
|
buttonText: contentSettingsTr(`bookNowLabel`),
|
|
627
600
|
url: '',
|
|
628
601
|
type: 'booking-section',
|
|
629
|
-
topPadding: 32,
|
|
630
|
-
bottomPadding: 32,
|
|
631
602
|
descriptionStyle: {
|
|
632
603
|
applyAutoScale: options?.brandPageType === BRAND_PAGE_TYPES.brandSite,
|
|
633
604
|
textStyleType: TEXT_STYLE_TYPES.paragraphs,
|
|
@@ -657,8 +628,6 @@ export const createInitialImagesSectionContent: CreateInitialContentFunction<
|
|
|
657
628
|
title: contentSettingsTr(`imagesTitle`),
|
|
658
629
|
description: '',
|
|
659
630
|
type: 'images-section',
|
|
660
|
-
topPadding: 32,
|
|
661
|
-
bottomPadding: 32,
|
|
662
631
|
displayStyle: 'centered',
|
|
663
632
|
aspectRatio: 'Default',
|
|
664
633
|
areImagesFullWidth: false,
|
|
@@ -714,8 +683,6 @@ export const createInitialTestimonialSectionContent: CreateInitialContentFunctio
|
|
|
714
683
|
title: contentSettingsTr(`testimonialsTitle`),
|
|
715
684
|
type: 'testimonial-section',
|
|
716
685
|
displayStyle: 'centered',
|
|
717
|
-
topPadding: TESTIMONIAL_DEFAULT_PADDING,
|
|
718
|
-
bottomPadding: TESTIMONIAL_DEFAULT_PADDING,
|
|
719
686
|
items: [],
|
|
720
687
|
titleStyle: {
|
|
721
688
|
applyAutoScale: options?.brandPageType === BRAND_PAGE_TYPES.brandSite,
|
|
@@ -764,8 +731,6 @@ export const createInitialAboutSectionContent: CreateInitialContentFunction<
|
|
|
764
731
|
textAlign: 'center',
|
|
765
732
|
},
|
|
766
733
|
backgroundStyle: {},
|
|
767
|
-
topPadding: 32,
|
|
768
|
-
bottomPadding: 32,
|
|
769
734
|
};
|
|
770
735
|
};
|
|
771
736
|
|
|
@@ -828,8 +793,6 @@ export const createInitialSocialLinksContent = (
|
|
|
828
793
|
return {
|
|
829
794
|
id: uuid.v4(),
|
|
830
795
|
type: 'social-links',
|
|
831
|
-
topPadding: 32,
|
|
832
|
-
bottomPadding: 32,
|
|
833
796
|
title: contentSettingsTr(`followUsOnTitle`),
|
|
834
797
|
links: [
|
|
835
798
|
{
|
|
@@ -883,8 +846,6 @@ export const createInitialShapesSectionContent: CreateInitialContentFunction<
|
|
|
883
846
|
title: contentSettingsTr(`shapesTitle`),
|
|
884
847
|
description: '',
|
|
885
848
|
type: 'shapes-section',
|
|
886
|
-
topPadding: 32,
|
|
887
|
-
bottomPadding: 32,
|
|
888
849
|
displayStyle: 'centered',
|
|
889
850
|
items: [
|
|
890
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",
|
|
@@ -147,19 +147,32 @@ export default class AssetLibraryClient {
|
|
|
147
147
|
async getBrandPageMetadataAsync(
|
|
148
148
|
s3Url: string,
|
|
149
149
|
): Promise<BrandPageData | null> {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
150
|
+
const maxAttempts = 2;
|
|
151
|
+
|
|
152
|
+
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
|
|
153
|
+
try {
|
|
154
|
+
const response = await axios.get(s3Url, {
|
|
155
|
+
timeout: 30000,
|
|
156
|
+
headers: {
|
|
157
|
+
Accept: 'application/json',
|
|
158
|
+
},
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
return response.data;
|
|
162
|
+
} catch (error) {
|
|
163
|
+
console.error(
|
|
164
|
+
`Error fetching brand page metadata (attempt ${attempt}/${maxAttempts}):`,
|
|
165
|
+
error,
|
|
166
|
+
);
|
|
167
|
+
|
|
168
|
+
if (attempt === maxAttempts) {
|
|
169
|
+
return null;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
await new Promise((resolve) => setTimeout(resolve, 500));
|
|
173
|
+
}
|
|
163
174
|
}
|
|
175
|
+
|
|
176
|
+
return null;
|
|
164
177
|
}
|
|
165
178
|
}
|
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,54 +0,0 @@
|
|
|
1
|
-
import { CONTACT_FORM_LAYOUT_DEFAULT_PADDING, TESTIMONIAL_DEFAULT_PADDING, bannerDisplayStyleDefaultPadding, } from '../../constants';
|
|
2
|
-
/**
|
|
3
|
-
* Padding Control backfill (BP-5699 Tier 2, BP-5700 Store): blocks that already
|
|
4
|
-
* had hard-coded top/bottom spacing. Backfill that spacing as the block's explicit
|
|
5
|
-
* topPadding/bottomPadding so existing pages render unchanged once the spacing
|
|
6
|
-
* moves to the Padding Control sliders. Type-scoped and idempotent — only the
|
|
7
|
-
* listed types, and only when the value isn't already set.
|
|
8
|
-
*
|
|
9
|
-
* Exception — `testimonial-section` (BP-5703): testimonials had 32px mobile / 80px
|
|
10
|
-
* desktop and are intentionally collapsing to a single value across both breakpoints,
|
|
11
|
-
* so the backfill sets that single value rather than preserving the old desktop 80px.
|
|
12
|
-
* Existing testimonials will look tighter on desktop / roomier on mobile — by design.
|
|
13
|
-
*/
|
|
14
|
-
const BLOCK_DEFAULT_PADDING = {
|
|
15
|
-
text: 12,
|
|
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 {
|
|
40
|
-
value = BLOCK_DEFAULT_PADDING[content.type];
|
|
41
|
-
}
|
|
42
|
-
if (value === undefined) {
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
if (content.topPadding === undefined) {
|
|
46
|
-
content.topPadding = value;
|
|
47
|
-
}
|
|
48
|
-
if (content.bottomPadding === undefined) {
|
|
49
|
-
content.bottomPadding = value;
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
|
-
return migrationResult;
|
|
54
|
-
};
|
|
@@ -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,72 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -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
|
-
});
|