@designcrowd/library.brand-page 5.18.4 → 5.18.6-ast-padding-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/src/{CreatedOnBrandCrowd-de-de-DQLtpdLe.js → CreatedOnBrandCrowd-de-de-CAtPZtwo.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-en-us-CvEhlADd.js → CreatedOnBrandCrowd-en-us-Dcx4yFkK.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-es-es-pYQeTTC0.js → CreatedOnBrandCrowd-es-es-DpodH0gD.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-fr-CcE-iCEq.js → CreatedOnBrandCrowd-fr-ca-DZbMRJn-.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-ca-CcE-iCEq.js → CreatedOnBrandCrowd-fr-fr-DZbMRJn-.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-pt-OyhWWWyO.js → CreatedOnBrandCrowd-pt-br-C3gBveLk.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-br-OyhWWWyO.js → CreatedOnBrandCrowd-pt-pt-C3gBveLk.js} +1 -1
- package/lib/src/{CreatedOnDcom-de-de-DH98FFLS.js → CreatedOnDcom-de-de-DHNyyTV9.js} +1 -1
- package/lib/src/{CreatedOnDcom-en-us-DK67NN1r.js → CreatedOnDcom-en-us-BjqZ0Jmw.js} +1 -1
- package/lib/src/{CreatedOnDcom-es-es-9-QU4BU6.js → CreatedOnDcom-es-es-tiNjDJmH.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-ca-U9J9H9VB.js → CreatedOnDcom-fr-ca-COUSI6w1.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-fr-DqdzB1DJ.js → CreatedOnDcom-fr-fr-c3UCfh9A.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-br-c4UiWtkB.js → CreatedOnDcom-pt-br-U1jbo_g5.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-pt-Do2qJsYp.js → CreatedOnDcom-pt-pt-BOW_n3bo.js} +1 -1
- package/lib/src/brand-page/components/contact-form/ContactForm.mixin.d.ts +4 -0
- package/lib/src/brand-page/components/contact-form/ContactForm.mixin.js +8 -4
- package/lib/src/brand-page/components/image-gallery/ImageGallery.mixin.d.ts +4 -0
- package/lib/src/brand-page/components/image-gallery/ImageGallery.mixin.js +4 -0
- package/lib/src/brand-page/components/mailing-list/MailingList.mixin.d.ts +4 -0
- package/lib/src/brand-page/components/mailing-list/MailingList.mixin.js +4 -1
- package/lib/src/brand-page/components/payment/request-payment/RequestPayment.mixin.d.ts +4 -0
- package/lib/src/brand-page/components/payment/request-payment/RequestPayment.mixin.js +4 -0
- package/lib/src/brand-page/components/payment/support-me/SupportMe.mixin.d.ts +4 -0
- package/lib/src/brand-page/components/payment/support-me/SupportMe.mixin.js +4 -1
- package/lib/src/brand-page/components/video/Video.mixin.d.ts +4 -0
- package/lib/src/brand-page/components/video/Video.mixin.js +4 -0
- package/lib/src/brand-page/constants/misc.constants.d.ts +30 -0
- package/lib/src/brand-page/constants/misc.constants.js +51 -0
- package/lib/src/brand-page/models/content.model.d.ts +2 -0
- package/lib/src/brand-page/models/navigation-styles.model.d.ts +7 -0
- package/lib/src/brand-page/models/navigation-styles.model.js +25 -2
- package/lib/src/brand-page/utils/content-padding.util.d.ts +13 -0
- package/lib/src/brand-page/utils/content-padding.util.js +10 -0
- package/lib/src/brand-page/utils/index.d.ts +1 -0
- package/lib/src/brand-page/utils/index.js +1 -0
- package/lib/src/brand-page/utils/migration/migration-16.d.ts +2 -0
- package/lib/src/brand-page/utils/migration/migration-16.js +47 -0
- package/lib/src/brand-page/utils/migration/migration-17.d.ts +2 -0
- package/lib/src/brand-page/utils/migration/migration-17.js +50 -0
- package/lib/src/brand-page/utils/migration.util.js +17 -0
- package/lib/src/brand-page-maker/components/admin-logo-settings/AdminLogoSettings.mixin.d.ts +2 -0
- package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.d.ts +12 -0
- package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.d.ts +14 -0
- package/lib/src/brand-page-maker/constants/config-settings-constant.js +37 -0
- package/lib/src/brand-page-maker/convertors/about-display-style.convertor.js +9 -1
- package/lib/src/brand-page-maker/convertors/banner-align-display-style.convertor.js +7 -1
- package/lib/src/brand-page-maker/convertors/contact-layout-style.convertor.js +6 -1
- package/lib/src/brand-page-maker/models/content-settings.js +36 -2
- package/lib/src/brand-page-maker/stores/ai-checkpoint/ai-checkpoint-store.d.ts +12 -0
- package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.js +1 -9
- package/lib/src/{bundled-translations-B5Fkt3qd.js → bundled-translations-Chw0nsFv.js} +9 -9
- package/lib/src/{bundled-translations.de-DE-DpdVePM9.js → bundled-translations.de-DE-cqBv7atZ.js} +1 -1
- package/lib/src/{bundled-translations.es-ES-BsIcrzZF.js → bundled-translations.es-ES-D9VXftl_.js} +9 -9
- package/lib/src/{bundled-translations.fr-CA-G1XCp2Qh.js → bundled-translations.fr-CA-BYstWXcO.js} +1 -1
- package/lib/src/{bundled-translations.fr-FR-BdwLXOnB.js → bundled-translations.fr-FR-D1H1hJD4.js} +1 -1
- package/lib/src/{bundled-translations.pt-BR-Bvn5ePe7.js → bundled-translations.pt-BR-DqNFuNHX.js} +1 -1
- package/lib/src/{bundled-translations.pt-PT-CDtkb2k1.js → bundled-translations.pt-PT-tOic0FfQ.js} +9 -9
- package/lib/src/bundles/bundled-translations.de-DE.json +2 -0
- package/lib/src/bundles/bundled-translations.es-ES.json +2 -0
- package/lib/src/bundles/bundled-translations.fr-CA.json +2 -0
- package/lib/src/bundles/bundled-translations.fr-FR.json +2 -0
- package/lib/src/bundles/bundled-translations.json +2 -0
- package/lib/src/bundles/bundled-translations.pt-BR.json +2 -0
- package/lib/src/bundles/bundled-translations.pt-PT.json +2 -0
- package/lib/src/css/library.brand-page-brandCrowd.min.css +150 -168
- package/lib/src/css/library.brand-page-brandPage.min.css +150 -168
- package/lib/src/css/library.brand-page-designCom.min.css +150 -168
- package/lib/src/css/library.brand-page-preview.min.css +150 -168
- package/lib/src/index.mjs +62 -60
- package/lib/src/{lib-BI3J4Mbk.js → lib-Bl7w5LQl.js} +19205 -18991
- package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.d.ts +14 -0
- package/lib/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.mixin.d.ts +14 -0
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItem.mixin.d.ts +12 -0
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.d.ts +12 -0
- package/lib/src/shared/content-settings/components/focused-content-item-settings/FocusedContentItemSettings.mixin.d.ts +12 -0
- package/lib/src/shared/content-settings/components/slider-field/SliderField.mixin.js +9 -0
- package/lib/src/shared/content-settings/store/content-settings-store.d.ts +12 -0
- package/lib/src/shared/navigation-style-settings/components/navigation-style-settings/NavigationStyleSettings.mixin.js +10 -8
- package/lib/src/shared/navigation-style-settings/store/index.js +1 -12
- package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.d.ts +16 -0
- package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.d.ts +14 -0
- package/lib/src/utils/minify-brand-page-metadata.js +11 -1
- package/package.json +1 -1
- package/src/brand-page/components/about-section/AboutSection.vue +10 -4
- package/src/brand-page/components/banner-section/BannerSection.vue +11 -4
- package/src/brand-page/components/booking-section/BookingSection.vue +11 -3
- package/src/brand-page/components/button/Button.vue +2 -10
- package/src/brand-page/components/contact-form/ContactForm.mixin.ts +12 -6
- package/src/brand-page/components/contact-form/ContactForm.vue +117 -120
- package/src/brand-page/components/image-gallery/ImageGallery.mixin.ts +5 -0
- package/src/brand-page/components/image-gallery/ImageGallery.vue +1 -1
- package/src/brand-page/components/mailing-list/MailingList.mixin.ts +8 -1
- package/src/brand-page/components/mailing-list/MailingList.vue +1 -1
- package/src/brand-page/components/map/Map.vue +5 -1
- package/src/brand-page/components/navigation/navigation-side-menu/NavigationSideMenu.vue +4 -1
- package/src/brand-page/components/payment/request-payment/RequestPayment.mixin.ts +5 -0
- package/src/brand-page/components/payment/request-payment/RequestPayment.vue +1 -0
- package/src/brand-page/components/payment/support-me/SupportMe.mixin.ts +8 -1
- package/src/brand-page/components/payment/support-me/SupportMe.vue +1 -0
- package/src/brand-page/components/shop/Shop.vue +7 -2
- package/src/brand-page/components/social-links/SocialLinks.vue +7 -3
- package/src/brand-page/components/text/Text.vue +12 -5
- package/src/brand-page/components/text-media-section/TextMediaSection.vue +11 -3
- package/src/brand-page/components/video/Video.mixin.ts +5 -0
- package/src/brand-page/components/video/Video.vue +1 -1
- package/src/brand-page/constants/misc.constants.ts +60 -0
- package/src/brand-page/models/content.model.ts +2 -0
- package/src/brand-page/models/navigation-styles.model.ts +39 -1
- package/src/brand-page/utils/__snapshots__/migration.util.test.ts.snap +9 -3
- package/src/brand-page/utils/content-padding.util.test.ts +29 -0
- package/src/brand-page/utils/content-padding.util.ts +13 -0
- package/src/brand-page/utils/index.ts +1 -0
- package/src/brand-page/utils/migration/migration-16.test.ts +319 -0
- package/src/brand-page/utils/migration/migration-16.ts +75 -0
- package/src/brand-page/utils/migration/migration-17.ts +73 -0
- package/src/brand-page/utils/migration.util.test.ts +145 -0
- package/src/brand-page/utils/migration.util.ts +19 -0
- package/src/brand-page-maker/components/color-palette/BpColorPalette.vue +9 -7
- package/src/brand-page-maker/constants/config-settings-constant.ts +43 -0
- package/src/brand-page-maker/convertors/about-display-style.convertor.ts +10 -0
- package/src/brand-page-maker/convertors/banner-align-display-style.convertor.ts +8 -0
- package/src/brand-page-maker/convertors/contact-layout-style.convertor.test.ts +50 -0
- package/src/brand-page-maker/convertors/contact-layout-style.convertor.ts +8 -0
- package/src/brand-page-maker/models/content-settings.ts +38 -2
- package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.test.ts +43 -0
- package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.ts +0 -14
- package/src/bundles/bundled-translations.de-DE.json +2 -0
- package/src/bundles/bundled-translations.es-ES.json +2 -0
- package/src/bundles/bundled-translations.fr-CA.json +2 -0
- package/src/bundles/bundled-translations.fr-FR.json +2 -0
- package/src/bundles/bundled-translations.json +2 -0
- package/src/bundles/bundled-translations.pt-BR.json +2 -0
- package/src/bundles/bundled-translations.pt-PT.json +2 -0
- package/src/shared/content-settings/components/color-field/ColorField.vue +10 -5
- package/src/shared/content-settings/components/content-settings/i18n/content-settings.de-DE.json +2 -0
- package/src/shared/content-settings/components/content-settings/i18n/content-settings.es-ES.json +2 -0
- package/src/shared/content-settings/components/content-settings/i18n/content-settings.fr-CA.json +2 -0
- package/src/shared/content-settings/components/content-settings/i18n/content-settings.fr-FR.json +2 -0
- package/src/shared/content-settings/components/content-settings/i18n/content-settings.json +2 -0
- package/src/shared/content-settings/components/content-settings/i18n/content-settings.pt-BR.json +2 -0
- package/src/shared/content-settings/components/content-settings/i18n/content-settings.pt-PT.json +2 -0
- 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 +9 -0
- package/src/shared/navigation-style-settings/components/navigation-style-settings/NavigationStyleSettings.mixin.ts +17 -11
- package/src/shared/navigation-style-settings/components/navigation-style-settings/NavigationStyleSettings.vue +4 -1
- package/src/shared/navigation-style-settings/store/index.ts +1 -21
- package/src/utils/minify-brand-page-metadata.ts +11 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div data-component="map">
|
|
2
|
+
<div data-component="map" :style="contentPaddingStyle">
|
|
3
3
|
<div
|
|
4
4
|
class="c-map"
|
|
5
5
|
:class="{
|
|
@@ -22,6 +22,7 @@ import Placeholder from '../placeholder/Placeholder.vue';
|
|
|
22
22
|
import type { MapViewModel } from '@brand-page/view-models';
|
|
23
23
|
import type { BrandPageContext } from '@brand-page/models';
|
|
24
24
|
import { mapTr } from '@src/composables/useTranslate';
|
|
25
|
+
import { contentPaddingStyle as toContentPaddingStyle } from '@brand-page/utils';
|
|
25
26
|
import { computed } from 'vue';
|
|
26
27
|
|
|
27
28
|
interface Props {
|
|
@@ -37,6 +38,9 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
37
38
|
});
|
|
38
39
|
|
|
39
40
|
const placeId = computed(() => props.viewModel?.address?.placeId);
|
|
41
|
+
const contentPaddingStyle = computed(() =>
|
|
42
|
+
toContentPaddingStyle(props.viewModel),
|
|
43
|
+
);
|
|
40
44
|
</script>
|
|
41
45
|
<style scoped>
|
|
42
46
|
.c-map {
|
|
@@ -119,7 +119,10 @@ export default {
|
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
.c-sidebar {
|
|
122
|
-
|
|
122
|
+
/* No hardcoded background: the panel background comes from the hamburger
|
|
123
|
+
defaultButtonStyle (bound via :style), so a transparent/unset default bg
|
|
124
|
+
renders transparent instead of being forced white */
|
|
125
|
+
@apply tw-h-full tw-fixed tw-inset-0 tw-z-50 tw-transition-all tw-duration-300 tw-ease-out tw-w-80;
|
|
123
126
|
max-width: 66%;
|
|
124
127
|
}
|
|
125
128
|
|
|
@@ -14,6 +14,7 @@ import type { RequestPaymentViewModel } from '../../../view-models';
|
|
|
14
14
|
import type { PaymentRequestDetails } from '../Payment.mixin';
|
|
15
15
|
import { DEFAULT_CURRENCY_SYMBOL } from '../../../constants';
|
|
16
16
|
import { addOpacityToHex } from '../../../utils/color.util';
|
|
17
|
+
import { contentPaddingStyle as toContentPaddingStyle } from '../../../utils';
|
|
17
18
|
import { RGBAtoHex } from '@utils/helpers';
|
|
18
19
|
|
|
19
20
|
const MAX_CUSTOM_REQUEST_CHARS = 500;
|
|
@@ -42,6 +43,10 @@ export default defineComponent({
|
|
|
42
43
|
};
|
|
43
44
|
},
|
|
44
45
|
computed: {
|
|
46
|
+
contentPaddingStyle(): { paddingTop: string; paddingBottom: string } {
|
|
47
|
+
return toContentPaddingStyle(this.viewModel);
|
|
48
|
+
},
|
|
49
|
+
|
|
45
50
|
isCustomerRequestDetailsValid(): boolean {
|
|
46
51
|
return (
|
|
47
52
|
!this.viewModel.requestPaymentConfig.isCustomerRequestDetailsEnabled ||
|
|
@@ -4,7 +4,10 @@ import { SUPPORT_ME_CUSTOM_PRODUCT_NAME } from '../../../constants';
|
|
|
4
4
|
import type { BrandPageContext, PaymentOption } from '../../../models';
|
|
5
5
|
import type { SupportMeViewModel } from '../../../view-models';
|
|
6
6
|
import type { PaymentRequestDetails } from '../Payment.mixin';
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
isPaymentAmountValid,
|
|
9
|
+
contentPaddingStyle as toContentPaddingStyle,
|
|
10
|
+
} from '../../../utils';
|
|
8
11
|
import {
|
|
9
12
|
DEFAULT_CURRENCY_SYMBOL,
|
|
10
13
|
DEFAULT_CURRENCY_CODE,
|
|
@@ -33,6 +36,10 @@ export default defineComponent({
|
|
|
33
36
|
};
|
|
34
37
|
},
|
|
35
38
|
computed: {
|
|
39
|
+
contentPaddingStyle(): { paddingTop: string; paddingBottom: string } {
|
|
40
|
+
return toContentPaddingStyle(this.viewModel);
|
|
41
|
+
},
|
|
42
|
+
|
|
36
43
|
isCustomAmountFieldVisible(): boolean {
|
|
37
44
|
return this.viewModel.supportMeConfig.paymentOptions.some(
|
|
38
45
|
(o) => o.name === SUPPORT_ME_CUSTOM_PRODUCT_NAME,
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
<section>
|
|
3
3
|
<div
|
|
4
4
|
v-if="shouldShowContainer"
|
|
5
|
-
class="tw-relative outer-container
|
|
5
|
+
class="tw-relative outer-container"
|
|
6
6
|
:class="{
|
|
7
7
|
'tw-my-8': context.isBrandSite,
|
|
8
8
|
'tw-mb-4': context.isBrandPageOrIsBrandContact,
|
|
9
9
|
}"
|
|
10
|
-
:style="backgroundStyle"
|
|
10
|
+
:style="[backgroundStyle, contentPaddingStyle]"
|
|
11
11
|
>
|
|
12
12
|
<div class="tw-p-4 inner-container">
|
|
13
13
|
<div class="tw-flex tw-flex-col tw-gap-2">
|
|
@@ -140,6 +140,7 @@ import brandPageClient from '../../clients/brand-page.client';
|
|
|
140
140
|
import raygunUtil from '@brand-page/utils/raygun.util';
|
|
141
141
|
import { shopTr } from '@src/composables/useTranslate';
|
|
142
142
|
import { useShopConfigStore } from '@shared/ecommerce-settings/store/shop-settings-store';
|
|
143
|
+
import { contentPaddingStyle as toContentPaddingStyle } from '@brand-page/utils';
|
|
143
144
|
|
|
144
145
|
const props = withDefaults(
|
|
145
146
|
defineProps<{
|
|
@@ -260,6 +261,10 @@ const itemStyle = computed((): BrandPageCssStyle => {
|
|
|
260
261
|
};
|
|
261
262
|
});
|
|
262
263
|
|
|
264
|
+
const contentPaddingStyle = computed(() =>
|
|
265
|
+
toContentPaddingStyle(props.viewModel),
|
|
266
|
+
);
|
|
267
|
+
|
|
263
268
|
const backgroundStyle = computed((): any => {
|
|
264
269
|
return props.viewModel.backgroundStyle;
|
|
265
270
|
});
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div data-component="social-links">
|
|
3
3
|
<div
|
|
4
|
-
class="tw-pb-8"
|
|
5
4
|
:class="{
|
|
6
5
|
'tw-mb-4': context.isBrandPageOrIsBrandContact,
|
|
7
6
|
}"
|
|
8
|
-
:style="containerStyles"
|
|
7
|
+
:style="[containerStyles, contentPaddingStyle]"
|
|
9
8
|
style="container-type: inline-size"
|
|
10
9
|
>
|
|
11
10
|
<TextWrapper
|
|
@@ -14,7 +13,7 @@
|
|
|
14
13
|
:text="title"
|
|
15
14
|
element="h1"
|
|
16
15
|
:class="textAlignClass"
|
|
17
|
-
class="tw-
|
|
16
|
+
class="tw-pb-8"
|
|
18
17
|
/>
|
|
19
18
|
<SocialLinksItems
|
|
20
19
|
:id="id"
|
|
@@ -34,6 +33,7 @@ import TextWrapper from '../text-wrapper/TextWrapper.vue';
|
|
|
34
33
|
import type { SocialLinksViewModel } from 'src/brand-page/view-models';
|
|
35
34
|
import { SOCIAL_LINKS_ICON_DISPLAY_STYLES } from '@brand-page/models';
|
|
36
35
|
import type { BrandPageContext, LinksItem } from '@brand-page/models';
|
|
36
|
+
import { contentPaddingStyle as toContentPaddingStyle } from '@brand-page/utils';
|
|
37
37
|
import { computed } from 'vue';
|
|
38
38
|
|
|
39
39
|
const props = withDefaults(
|
|
@@ -51,6 +51,10 @@ const containerStyles = computed((): BrandPageCssStyle => {
|
|
|
51
51
|
return props.viewModel.backgroundStyles || {};
|
|
52
52
|
});
|
|
53
53
|
|
|
54
|
+
const contentPaddingStyle = computed(() =>
|
|
55
|
+
toContentPaddingStyle(props.viewModel),
|
|
56
|
+
);
|
|
57
|
+
|
|
54
58
|
const iconStyle = computed((): BrandPageCssStyle => {
|
|
55
59
|
return props.viewModel.iconFillStyles || {};
|
|
56
60
|
});
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<div>
|
|
3
3
|
<div
|
|
4
4
|
v-if="!context.isBrandSite"
|
|
5
|
-
:style="containerStyle"
|
|
5
|
+
:style="[containerStyle, contentPaddingStyle]"
|
|
6
6
|
:class="{
|
|
7
7
|
[containerClasses]: true,
|
|
8
8
|
}"
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
data-test-tag="text-content-text"
|
|
16
16
|
/>
|
|
17
17
|
</div>
|
|
18
|
-
<div v-else :style="containerStyle">
|
|
18
|
+
<div v-else :style="[containerStyle, contentPaddingStyle]">
|
|
19
19
|
<div
|
|
20
|
-
class="c-text-container tw-
|
|
20
|
+
class="c-text-container tw-px-6 grid-container tw-gap-4"
|
|
21
21
|
:class="{
|
|
22
22
|
[containerClasses]: true,
|
|
23
23
|
[gridClass]: context.isBrandSite,
|
|
@@ -41,7 +41,10 @@
|
|
|
41
41
|
import TextWrapper from '../text-wrapper/TextWrapper.vue';
|
|
42
42
|
import { computed } from 'vue';
|
|
43
43
|
import type { TextViewModel } from '@brand-page/view-models';
|
|
44
|
-
import {
|
|
44
|
+
import {
|
|
45
|
+
getRenderText,
|
|
46
|
+
contentPaddingStyle as toContentPaddingStyle,
|
|
47
|
+
} from '@brand-page/utils';
|
|
45
48
|
import type { BrandPageContext } from '@brand-page/models';
|
|
46
49
|
|
|
47
50
|
interface Props {
|
|
@@ -51,6 +54,10 @@ interface Props {
|
|
|
51
54
|
|
|
52
55
|
const props = defineProps<Props>();
|
|
53
56
|
|
|
57
|
+
const contentPaddingStyle = computed(() =>
|
|
58
|
+
toContentPaddingStyle(props.viewModel),
|
|
59
|
+
);
|
|
60
|
+
|
|
54
61
|
const containerStyle = computed<any>(() => {
|
|
55
62
|
const containerStyles = {} as BrandPageCssStyle;
|
|
56
63
|
|
|
@@ -83,7 +90,7 @@ const containerClasses = computed(() => {
|
|
|
83
90
|
return '';
|
|
84
91
|
}
|
|
85
92
|
|
|
86
|
-
return 'tw-
|
|
93
|
+
return 'tw-px-6';
|
|
87
94
|
});
|
|
88
95
|
|
|
89
96
|
const renderText = computed(() => {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<section data-component="text-media-section">
|
|
3
3
|
<div
|
|
4
|
-
class="tw-relative tw-w-full tw-box-border
|
|
4
|
+
class="tw-relative tw-w-full tw-box-border"
|
|
5
5
|
:class="{
|
|
6
6
|
'tw-pl-0 tw-pr-0': hasNoPadding || !hasBrandSitePadding,
|
|
7
7
|
'tw-rounded-md': hasRoundedCorners,
|
|
8
8
|
}"
|
|
9
|
-
:style="viewModel.backgroundStyle"
|
|
9
|
+
:style="[viewModel.backgroundStyle, contentPaddingStyle]"
|
|
10
10
|
>
|
|
11
11
|
<div
|
|
12
12
|
:class="[
|
|
@@ -148,7 +148,11 @@ import {
|
|
|
148
148
|
MEDIA_ONLY,
|
|
149
149
|
} from '../../constants';
|
|
150
150
|
import { isHexTransparent } from '@brand-page/utils/color.util';
|
|
151
|
-
import {
|
|
151
|
+
import {
|
|
152
|
+
escapeContentText,
|
|
153
|
+
getRenderText,
|
|
154
|
+
contentPaddingStyle as toContentPaddingStyle,
|
|
155
|
+
} from '@brand-page/utils';
|
|
152
156
|
|
|
153
157
|
const props = defineProps({
|
|
154
158
|
viewModel: {
|
|
@@ -171,6 +175,10 @@ const props = defineProps({
|
|
|
171
175
|
},
|
|
172
176
|
});
|
|
173
177
|
|
|
178
|
+
const contentPaddingStyle = computed(() =>
|
|
179
|
+
toContentPaddingStyle(props.viewModel),
|
|
180
|
+
);
|
|
181
|
+
|
|
174
182
|
const items = computed(() => props.viewModel.items);
|
|
175
183
|
|
|
176
184
|
const shouldDisplayText = computed(
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { defineComponent } from 'vue';
|
|
2
2
|
import type { PropType } from 'vue';
|
|
3
3
|
import type { VideoViewModel } from '@brand-page/view-models';
|
|
4
|
+
import { contentPaddingStyle as toContentPaddingStyle } from '@brand-page/utils';
|
|
4
5
|
import ComponentCommonMixin from '../mixins/component-common.mixin';
|
|
5
6
|
import {
|
|
6
7
|
DISPLAY_STYLE_PREVIEW,
|
|
@@ -22,6 +23,10 @@ export default defineComponent({
|
|
|
22
23
|
title: 'Video',
|
|
23
24
|
}),
|
|
24
25
|
computed: {
|
|
26
|
+
contentPaddingStyle(): { paddingTop: string; paddingBottom: string } {
|
|
27
|
+
return toContentPaddingStyle(this.viewModel);
|
|
28
|
+
},
|
|
29
|
+
|
|
25
30
|
arrowStyle(): BrandPageCssStyle {
|
|
26
31
|
return {
|
|
27
32
|
color: this.viewModel.buttonStyles.style?.color,
|
|
@@ -38,6 +38,66 @@ export const ALIGN_LEFT_FULL_IMAGE = 'left-aligned-full-image';
|
|
|
38
38
|
export const ALIGN_RIGHT_FULL_IMAGE = 'right-aligned-full-image';
|
|
39
39
|
export const ALTERNATE_IMAGE = 'alternate-image';
|
|
40
40
|
|
|
41
|
+
/**
|
|
42
|
+
* Padding Control (BP-5699): the top/bottom padding each Contact Form layout
|
|
43
|
+
* had hard-coded before the sliders existed. Single source for new-block
|
|
44
|
+
* defaults (content-settings) and the migration backfill for existing pages.
|
|
45
|
+
* The image layouts (full-image divided and card-over-image) are 0: their
|
|
46
|
+
* padding sits on the section root and reveals the background colour around
|
|
47
|
+
* the image block (same as the banner), while the spacing inside/over the
|
|
48
|
+
* image stays fixed — existing pages rendered the image flush to the section
|
|
49
|
+
* edges.
|
|
50
|
+
*/
|
|
51
|
+
export const CONTACT_FORM_LAYOUT_DEFAULT_PADDING: Record<string, number> = {
|
|
52
|
+
'': 0, // collapsible (default on Brand Page / Brand Contact)
|
|
53
|
+
[ALIGN_CENTERED]: 24,
|
|
54
|
+
[ALIGN_CARD_CENTER]: 32,
|
|
55
|
+
[ALIGN_CARD_CENTER_IMAGE]: 0,
|
|
56
|
+
[TEXT_ONLY]: 32,
|
|
57
|
+
[ALIGN_LEFT_FULL_IMAGE]: 0,
|
|
58
|
+
[ALIGN_RIGHT_FULL_IMAGE]: 0,
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Banner: full-bleed display styles (divided + full-width stacked) render the
|
|
63
|
+
* image flush to the section edges, so their top/bottom padding defaults to 0 to
|
|
64
|
+
* match prod — the standard 32 would push the image off the edges. Every other
|
|
65
|
+
* banner style keeps 32. Used by the banner display-style convertor and the
|
|
66
|
+
* migration backfill, mirroring contact-form's per-layout map above.
|
|
67
|
+
*/
|
|
68
|
+
export const BANNER_DEFAULT_PADDING = 32;
|
|
69
|
+
export const BANNER_FULL_BLEED_DISPLAY_STYLES = [
|
|
70
|
+
ALIGN_LEFT_FULL_IMAGE,
|
|
71
|
+
ALIGN_RIGHT_FULL_IMAGE,
|
|
72
|
+
ALIGN_TOP_FULL_IMAGE,
|
|
73
|
+
ALIGN_BOTTOM_FULL_IMAGE,
|
|
74
|
+
ALIGN_MIDDLE_FULL_IMAGE,
|
|
75
|
+
];
|
|
76
|
+
export const bannerDisplayStyleDefaultPadding = (
|
|
77
|
+
displayStyle?: string,
|
|
78
|
+
): number =>
|
|
79
|
+
displayStyle && BANNER_FULL_BLEED_DISPLAY_STYLES.includes(displayStyle)
|
|
80
|
+
? 0
|
|
81
|
+
: BANNER_DEFAULT_PADDING;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* About: same rule as the banner. The two full-image display styles render the
|
|
85
|
+
* image flush to the section edges, so their top/bottom padding defaults to 0;
|
|
86
|
+
* every other About style keeps 32. Used by the About display-style convertor
|
|
87
|
+
* and the migration backfill.
|
|
88
|
+
*/
|
|
89
|
+
export const ABOUT_DEFAULT_PADDING = 32;
|
|
90
|
+
export const ABOUT_FULL_BLEED_DISPLAY_STYLES = [
|
|
91
|
+
ALIGN_LEFT_FULL_IMAGE,
|
|
92
|
+
ALIGN_RIGHT_FULL_IMAGE,
|
|
93
|
+
];
|
|
94
|
+
export const aboutDisplayStyleDefaultPadding = (
|
|
95
|
+
displayStyle?: string,
|
|
96
|
+
): number =>
|
|
97
|
+
displayStyle && ABOUT_FULL_BLEED_DISPLAY_STYLES.includes(displayStyle)
|
|
98
|
+
? 0
|
|
99
|
+
: ABOUT_DEFAULT_PADDING;
|
|
100
|
+
|
|
41
101
|
export const BIG_IMAGE = 'big-image';
|
|
42
102
|
export const MEDIA_ONLY = 'media-only';
|
|
43
103
|
export const COLUMNS = 'columns';
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
FONT_FAMILY_CONFIGS,
|
|
7
7
|
FONT_SIZE_BODY,
|
|
8
8
|
FONT_WEIGHT_NORMAL,
|
|
9
|
+
STYLE_THEME_KEYS,
|
|
9
10
|
defaultHamburgerNavigation,
|
|
10
11
|
type NavigationDisplayType,
|
|
11
12
|
NAVIGATION_DISPLAY,
|
|
@@ -50,6 +51,43 @@ export class NavigationMenuStyles {
|
|
|
50
51
|
}
|
|
51
52
|
}
|
|
52
53
|
|
|
54
|
+
export const getDefaultSubNavBackgroundColor = (
|
|
55
|
+
defaultTextColor: string | undefined,
|
|
56
|
+
): string | undefined => {
|
|
57
|
+
if (
|
|
58
|
+
defaultTextColor === STYLE_THEME_KEYS.LogoTextColor ||
|
|
59
|
+
defaultTextColor === STYLE_THEME_KEYS.LogoTextMultiColor
|
|
60
|
+
) {
|
|
61
|
+
return STYLE_THEME_KEYS.LogoBackgroundColor;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (
|
|
65
|
+
defaultTextColor === STYLE_THEME_KEYS.LogoBackgroundColor ||
|
|
66
|
+
defaultTextColor === STYLE_THEME_KEYS.LogoBackgroundMultiColor
|
|
67
|
+
) {
|
|
68
|
+
return STYLE_THEME_KEYS.LogoTextColor;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return undefined;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* The hamburger sub nav background colour is auto color-matched only when the
|
|
76
|
+
* user has not deliberately set it - i.e. it has no value or is transparent.
|
|
77
|
+
* Any explicit colour (a hex) or an already color-matched key is preserved.
|
|
78
|
+
*/
|
|
79
|
+
export const isUnsetOrTransparentColor = (
|
|
80
|
+
color: string | undefined | null,
|
|
81
|
+
): boolean => {
|
|
82
|
+
if (color == null) {
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const normalised = color.trim().toLowerCase();
|
|
87
|
+
|
|
88
|
+
return normalised === '' || normalised === 'transparent';
|
|
89
|
+
};
|
|
90
|
+
|
|
53
91
|
type NavigationStylesOptionType = Partial<
|
|
54
92
|
Omit<NavigationDesktop | NavigationMobile, 'hamburgerMenuStyle'>
|
|
55
93
|
> & {
|
|
@@ -148,7 +186,7 @@ abstract class NavigationStyles implements NavigationMenuStyles {
|
|
|
148
186
|
color: theme?.secondaryColor,
|
|
149
187
|
backgroundColor: theme?.primaryColor,
|
|
150
188
|
},
|
|
151
|
-
|
|
189
|
+
// No sub nav default: a hex here defeats migration-16's colour match.
|
|
152
190
|
},
|
|
153
191
|
);
|
|
154
192
|
}
|
|
@@ -292,6 +292,7 @@ exports[`migration.util > Banner Contents - text Align and Font Family should no
|
|
|
292
292
|
"contents": [
|
|
293
293
|
{
|
|
294
294
|
"backgroundStyle": {},
|
|
295
|
+
"bottomPadding": 32,
|
|
295
296
|
"buttonLinkType": "url",
|
|
296
297
|
"buttonPageId": "",
|
|
297
298
|
"buttonText": "Get Started",
|
|
@@ -330,6 +331,7 @@ exports[`migration.util > Banner Contents - text Align and Font Family should no
|
|
|
330
331
|
"textAlign": "center",
|
|
331
332
|
"wordBreak": "normal",
|
|
332
333
|
},
|
|
334
|
+
"topPadding": 32,
|
|
333
335
|
"type": "banner-section",
|
|
334
336
|
"url": "",
|
|
335
337
|
},
|
|
@@ -454,7 +456,7 @@ exports[`migration.util > Banner Contents - text Align and Font Family should no
|
|
|
454
456
|
},
|
|
455
457
|
},
|
|
456
458
|
},
|
|
457
|
-
"v":
|
|
459
|
+
"v": 17,
|
|
458
460
|
},
|
|
459
461
|
"useOldLogoRenderSize": true,
|
|
460
462
|
}
|
|
@@ -751,6 +753,7 @@ exports[`migration.util > migrateBrandPageModel should return brand page model w
|
|
|
751
753
|
{
|
|
752
754
|
"contents": [
|
|
753
755
|
{
|
|
756
|
+
"bottomPadding": 12,
|
|
754
757
|
"id": "bec5aca6-e3c5-4d4c-93fa-2894816a8040",
|
|
755
758
|
"text": "",
|
|
756
759
|
"textColor": {},
|
|
@@ -774,6 +777,7 @@ exports[`migration.util > migrateBrandPageModel should return brand page model w
|
|
|
774
777
|
"textAlign": "center",
|
|
775
778
|
"textStyleType": "paragraphs",
|
|
776
779
|
},
|
|
780
|
+
"topPadding": 12,
|
|
777
781
|
"type": "text",
|
|
778
782
|
},
|
|
779
783
|
],
|
|
@@ -897,7 +901,7 @@ exports[`migration.util > migrateBrandPageModel should return brand page model w
|
|
|
897
901
|
},
|
|
898
902
|
},
|
|
899
903
|
},
|
|
900
|
-
"v":
|
|
904
|
+
"v": 17,
|
|
901
905
|
},
|
|
902
906
|
"useOldLogoRenderSize": true,
|
|
903
907
|
}
|
|
@@ -1194,6 +1198,7 @@ exports[`migration.util > migrateBrandPageModel should return brand page model w
|
|
|
1194
1198
|
{
|
|
1195
1199
|
"contents": [
|
|
1196
1200
|
{
|
|
1201
|
+
"bottomPadding": 12,
|
|
1197
1202
|
"id": "bec5aca6-e3c5-4d4c-93fa-2894816a8040",
|
|
1198
1203
|
"text": "",
|
|
1199
1204
|
"textColor": {},
|
|
@@ -1224,6 +1229,7 @@ exports[`migration.util > migrateBrandPageModel should return brand page model w
|
|
|
1224
1229
|
"textAlign": "center",
|
|
1225
1230
|
"textStyleType": "paragraphs",
|
|
1226
1231
|
},
|
|
1232
|
+
"topPadding": 12,
|
|
1227
1233
|
"type": "text",
|
|
1228
1234
|
},
|
|
1229
1235
|
],
|
|
@@ -1347,7 +1353,7 @@ exports[`migration.util > migrateBrandPageModel should return brand page model w
|
|
|
1347
1353
|
},
|
|
1348
1354
|
},
|
|
1349
1355
|
},
|
|
1350
|
-
"v":
|
|
1356
|
+
"v": 17,
|
|
1351
1357
|
},
|
|
1352
1358
|
"useOldLogoRenderSize": true,
|
|
1353
1359
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { describe, test, expect } from 'vitest';
|
|
2
|
+
import { contentPaddingStyle } from './content-padding.util';
|
|
3
|
+
|
|
4
|
+
describe('content-padding.util', () => {
|
|
5
|
+
test('contentPaddingStyle should map stored padding to px values', () => {
|
|
6
|
+
expect(contentPaddingStyle({ topPadding: 53, bottomPadding: 24 })).toEqual({
|
|
7
|
+
paddingTop: '53px',
|
|
8
|
+
paddingBottom: '24px',
|
|
9
|
+
});
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
test('contentPaddingStyle should default missing values to 0 for content created before the field existed', () => {
|
|
13
|
+
expect(contentPaddingStyle({})).toEqual({
|
|
14
|
+
paddingTop: '0px',
|
|
15
|
+
paddingBottom: '0px',
|
|
16
|
+
});
|
|
17
|
+
expect(contentPaddingStyle({ topPadding: 16 })).toEqual({
|
|
18
|
+
paddingTop: '16px',
|
|
19
|
+
paddingBottom: '0px',
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
test('contentPaddingStyle should keep an explicit 0 rather than treating it as unset', () => {
|
|
24
|
+
expect(contentPaddingStyle({ topPadding: 0, bottomPadding: 0 })).toEqual({
|
|
25
|
+
paddingTop: '0px',
|
|
26
|
+
paddingBottom: '0px',
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Block top/bottom padding (BP-5687) as a bindable CSS style object. Defaults
|
|
3
|
+
* live in the data — `content-settings` for new content, a migration for
|
|
4
|
+
* existing — so this just reads the stored value (`?? 0` covers content from
|
|
5
|
+
* before the field existed).
|
|
6
|
+
*/
|
|
7
|
+
export const contentPaddingStyle = (content: {
|
|
8
|
+
topPadding?: number;
|
|
9
|
+
bottomPadding?: number;
|
|
10
|
+
}): { paddingTop: string; paddingBottom: string } => ({
|
|
11
|
+
paddingTop: `${content.topPadding ?? 0}px`,
|
|
12
|
+
paddingBottom: `${content.bottomPadding ?? 0}px`,
|
|
13
|
+
});
|