@designcrowd/library.brand-page 5.18.7-ast-padding-1 → 5.18.7
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-Cn8zNuGM.js → CreatedOnBrandCrowd-de-de-CZmqvsOT.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-en-us-CP8xAFc-.js → CreatedOnBrandCrowd-en-us-5nTR1eLT.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-es-es-Ds8NijwP.js → CreatedOnBrandCrowd-es-es-xLvoayrw.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-fr-BiVV_7lj.js → CreatedOnBrandCrowd-fr-ca-CN5n8X8v.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-ca-BiVV_7lj.js → CreatedOnBrandCrowd-fr-fr-CN5n8X8v.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-pt-CjjrYojo.js → CreatedOnBrandCrowd-pt-br-CdkYC12E.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-br-CjjrYojo.js → CreatedOnBrandCrowd-pt-pt-CdkYC12E.js} +1 -1
- package/lib/src/{CreatedOnDcom-de-de-ChR5jvlP.js → CreatedOnDcom-de-de-B8rV2rD7.js} +1 -1
- package/lib/src/{CreatedOnDcom-en-us-C4rO1BMA.js → CreatedOnDcom-en-us-C4WaRIpF.js} +1 -1
- package/lib/src/{CreatedOnDcom-es-es-DxGMS6JK.js → CreatedOnDcom-es-es-BPHPey0b.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-ca-n31u4t7u.js → CreatedOnDcom-fr-ca-xrMr4xlv.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-fr-gwdsX7YV.js → CreatedOnDcom-fr-fr-BEozL-o2.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-br-iZjFp--s.js → CreatedOnDcom-pt-br-CoN-ZhjG.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-pt-B3Z3-RLC.js → CreatedOnDcom-pt-pt-9vfUJ3ks.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/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/misc.constants.d.ts +0 -26
- package/lib/src/brand-page/constants/misc.constants.js +0 -42
- 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 -38
- 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 -36
- 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 +116 -108
- package/lib/src/css/library.brand-page-brandPage.min.css +116 -108
- package/lib/src/css/library.brand-page-designCom.min.css +116 -108
- package/lib/src/css/library.brand-page-preview.min.css +116 -108
- package/lib/src/index.mjs +1 -1
- package/lib/src/{lib-CIj_C38s.js → lib-xHNclG2R.js} +19655 -19841
- package/lib/src/metadata-builder/builders/reorder-pages-builder.d.ts +13 -0
- package/lib/src/metadata-builder/builders/reorder-pages-builder.js +49 -0
- 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/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/misc.constants.ts +0 -48
- 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/index.ts +0 -1
- package/src/brand-page/utils/migration.util.test.ts +0 -195
- package/src/brand-page/utils/migration.util.ts +0 -11
- package/src/brand-page-maker/constants/config-settings-constant.ts +0 -44
- 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 -38
- 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/metadata-builder/builders/reorder-pages-builder.ts +80 -0
- 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 -48
- 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 -65
- package/src/brand-page-maker/convertors/contact-layout-style.convertor.test.ts +0 -50
|
@@ -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,48 +0,0 @@
|
|
|
1
|
-
import { CONTACT_FORM_LAYOUT_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
|
-
const BLOCK_DEFAULT_PADDING = {
|
|
10
|
-
text: 12,
|
|
11
|
-
'images-section': 32,
|
|
12
|
-
'social-links': 32,
|
|
13
|
-
'shapes-section': 32,
|
|
14
|
-
'booking-section': 32,
|
|
15
|
-
'shop-section': 16,
|
|
16
|
-
'about-section': 32,
|
|
17
|
-
};
|
|
18
|
-
export const migration17 = async (migrationResult) => {
|
|
19
|
-
const { brandPageModel } = migrationResult;
|
|
20
|
-
brandPageModel.pages.forEach((page) => {
|
|
21
|
-
page.contents.forEach((content) => {
|
|
22
|
-
// Contact Form and Banner previously varied their hard-coded spacing by
|
|
23
|
-
// layout/display style (full-bleed image layouts had no outer padding), so they're
|
|
24
|
-
// keyed by that rather than a single per-type value.
|
|
25
|
-
let value;
|
|
26
|
-
if (content.type === 'contact-form') {
|
|
27
|
-
value =
|
|
28
|
-
CONTACT_FORM_LAYOUT_DEFAULT_PADDING[content.layoutStyle ?? ''];
|
|
29
|
-
}
|
|
30
|
-
else if (content.type === 'banner-section') {
|
|
31
|
-
value = bannerDisplayStyleDefaultPadding(content.displayStyle);
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
value = BLOCK_DEFAULT_PADDING[content.type];
|
|
35
|
-
}
|
|
36
|
-
if (value === undefined) {
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
if (content.topPadding === undefined) {
|
|
40
|
-
content.topPadding = value;
|
|
41
|
-
}
|
|
42
|
-
if (content.bottomPadding === undefined) {
|
|
43
|
-
content.bottomPadding = value;
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
});
|
|
47
|
-
return migrationResult;
|
|
48
|
-
};
|
|
@@ -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,65 +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
|
-
bannerDisplayStyleDefaultPadding,
|
|
6
|
-
} from '../../constants';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Padding Control backfill (BP-5699 Tier 2, BP-5700 Store): blocks that already
|
|
10
|
-
* had hard-coded top/bottom spacing. Backfill that spacing as the block's explicit
|
|
11
|
-
* topPadding/bottomPadding so existing pages render unchanged once the spacing
|
|
12
|
-
* moves to the Padding Control sliders. Type-scoped and idempotent — only the
|
|
13
|
-
* listed types, and only when the value isn't already set.
|
|
14
|
-
*/
|
|
15
|
-
const BLOCK_DEFAULT_PADDING: Partial<Record<string, number>> = {
|
|
16
|
-
text: 12,
|
|
17
|
-
'images-section': 32,
|
|
18
|
-
'social-links': 32,
|
|
19
|
-
'shapes-section': 32,
|
|
20
|
-
'booking-section': 32,
|
|
21
|
-
'shop-section': 16,
|
|
22
|
-
'about-section': 32,
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export const migration17 = async (
|
|
26
|
-
migrationResult: MigrationData,
|
|
27
|
-
): Promise<MigrationData> => {
|
|
28
|
-
const { brandPageModel } = migrationResult;
|
|
29
|
-
|
|
30
|
-
brandPageModel.pages.forEach((page) => {
|
|
31
|
-
page.contents.forEach((content) => {
|
|
32
|
-
// Contact Form and Banner previously varied their hard-coded spacing by
|
|
33
|
-
// layout/display style (full-bleed image layouts had no outer padding), so they're
|
|
34
|
-
// keyed by that rather than a single per-type value.
|
|
35
|
-
let value: number | undefined;
|
|
36
|
-
|
|
37
|
-
if (content.type === 'contact-form') {
|
|
38
|
-
value =
|
|
39
|
-
CONTACT_FORM_LAYOUT_DEFAULT_PADDING[
|
|
40
|
-
(content as ContactFormContent).layoutStyle ?? ''
|
|
41
|
-
];
|
|
42
|
-
} else if (content.type === 'banner-section') {
|
|
43
|
-
value = bannerDisplayStyleDefaultPadding(
|
|
44
|
-
(content as BannerSectionContent).displayStyle,
|
|
45
|
-
);
|
|
46
|
-
} else {
|
|
47
|
-
value = BLOCK_DEFAULT_PADDING[content.type];
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
if (value === undefined) {
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
if (content.topPadding === undefined) {
|
|
55
|
-
content.topPadding = value;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
if (content.bottomPadding === undefined) {
|
|
59
|
-
content.bottomPadding = value;
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
return migrationResult;
|
|
65
|
-
};
|
|
@@ -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
|
-
});
|