@designcrowd/library.brand-page 6.0.18 → 6.0.19-ast-btns-2
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-CIrk6Brm.js → CreatedOnBrandCrowd-de-de-BI4rJV_V.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-en-us-CvXk0moH.js → CreatedOnBrandCrowd-en-us-Crf-sBeO.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-es-es-BhtZbjjU.js → CreatedOnBrandCrowd-es-es-DE_kK1yb.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-fr-B6TD57O-.js → CreatedOnBrandCrowd-fr-ca-BXhEu1vY.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-ca-B6TD57O-.js → CreatedOnBrandCrowd-fr-fr-BXhEu1vY.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-pt-Bto0xOtS.js → CreatedOnBrandCrowd-pt-br-DG1azcKI.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-br-Bto0xOtS.js → CreatedOnBrandCrowd-pt-pt-DG1azcKI.js} +1 -1
- package/lib/src/{CreatedOnDcom-de-de-2h2W3y5z.js → CreatedOnDcom-de-de-BFL99-ya.js} +1 -1
- package/lib/src/{CreatedOnDcom-en-us-D6Jgk6yv.js → CreatedOnDcom-en-us-DqWMpFgs.js} +1 -1
- package/lib/src/{CreatedOnDcom-es-es-sBCqYQIm.js → CreatedOnDcom-es-es-Ds0zIzXx.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-ca-C8hg5hTU.js → CreatedOnDcom-fr-ca-X-GSmpwv.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-fr-_DP1Umyh.js → CreatedOnDcom-fr-fr-Cm1eyNiD.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-br-BdwYAy5p.js → CreatedOnDcom-pt-br-BUOePaaJ.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-pt-Bm1NHVaH.js → CreatedOnDcom-pt-pt-CJSZsybQ.js} +1 -1
- package/lib/src/brand-page/components/collapsible/Collapsible.mixin.d.ts +11 -0
- package/lib/src/brand-page/components/collapsible/Collapsible.mixin.js +10 -0
- package/lib/src/brand-page/components/contact-form/ContactForm.mixin.d.ts +1 -0
- package/lib/src/brand-page/components/contact-form/ContactForm.mixin.js +7 -0
- package/lib/src/brand-page/components/mailing-list/MailingList.mixin.js +5 -0
- package/lib/src/brand-page/components/payment/Payment.mixin.js +5 -0
- package/lib/src/brand-page/models/index.d.ts +1 -0
- package/lib/src/brand-page/models/payment.model.d.ts +2 -0
- package/lib/src/brand-page/utils/button.util.d.ts +5 -0
- package/lib/src/brand-page/utils/button.util.js +13 -0
- package/lib/src/brand-page/utils/migration/migration-19.d.ts +2 -0
- package/lib/src/brand-page/utils/migration/migration-19.js +48 -0
- package/lib/src/brand-page/utils/migration.util.js +9 -0
- package/lib/src/brand-page/utils/view-model.util.js +1 -0
- package/lib/src/brand-page-maker/constants/config-settings-constant.js +41 -1
- package/lib/src/brand-page-maker/default-getters/contact-form-background-color.default-getter.d.ts +8 -0
- package/lib/src/brand-page-maker/default-getters/contact-form-background-color.default-getter.js +16 -0
- package/lib/src/brand-page-maker/default-getters/index.d.ts +1 -0
- package/lib/src/brand-page-maker/default-getters/index.js +1 -0
- package/lib/src/brand-page-maker/models/button-styles-config.js +15 -3
- package/lib/src/brand-page-maker/models/content-settings-configs.d.ts +1 -1
- package/lib/src/brand-page-maker/models/content-settings.js +3 -0
- package/lib/src/css/library.brand-page-brandCrowd.min.css +96 -68
- package/lib/src/css/library.brand-page-brandPage.min.css +96 -68
- package/lib/src/css/library.brand-page-designCom.min.css +96 -68
- package/lib/src/css/library.brand-page-preview.min.css +96 -68
- package/lib/src/index.mjs +1 -1
- package/lib/src/{lib-CPTMajMv.js → lib-CfENvLvt.js} +18121 -17791
- package/lib/src/metadata-builder/builders/section-rules/banner-section.rules.js +6 -0
- package/lib/src/metadata-builder/parsers/section-tool-arguments.d.ts +1 -1
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.js +5 -0
- package/package.json +2 -2
- package/src/brand-page/components/button/ButtonStyleWrapper.vue +112 -44
- package/src/brand-page/components/button/ButtonStyleWrapper.vue.test.ts +167 -0
- package/src/brand-page/components/collapsible/Collapsible.mixin.ts +11 -0
- package/src/brand-page/components/contact-form/ContactForm.mixin.ts +10 -0
- package/src/brand-page/components/contact-form/ContactForm.vue +94 -39
- package/src/brand-page/components/mailing-list/MailingList.mixin.ts +6 -0
- package/src/brand-page/components/mailing-list/MailingList.vue +18 -10
- package/src/brand-page/components/payment/Payment.mixin.ts +6 -0
- package/src/brand-page/components/payment/Payment.vue +43 -24
- package/src/brand-page/components/payment/RequestPaymentStripe.vue +26 -22
- package/src/brand-page/components/shop/Shop.vue +15 -6
- package/src/brand-page/models/index.ts +1 -0
- package/src/brand-page/models/payment.model.ts +2 -0
- package/src/brand-page/utils/__snapshots__/migration.util.test.ts.snap +3 -3
- package/src/brand-page/utils/button.util.ts +17 -0
- package/src/brand-page/utils/migration/migration-19.test.ts +120 -0
- package/src/brand-page/utils/migration/migration-19.ts +67 -0
- package/src/brand-page/utils/migration.util.ts +10 -0
- package/src/brand-page/utils/view-model.util.ts +1 -0
- package/src/brand-page-maker/constants/config-settings-constant.ts +44 -0
- package/src/brand-page-maker/default-getters/contact-form-background-color.default-getter.ts +23 -0
- package/src/brand-page-maker/default-getters/index.ts +1 -0
- package/src/brand-page-maker/models/button-styles-config.ts +15 -3
- package/src/brand-page-maker/models/content-settings-configs.ts +1 -1
- package/src/brand-page-maker/models/content-settings.ts +3 -0
- package/src/metadata-builder/builders/section-rules/banner-section.rules.ts +6 -0
- package/src/metadata-builder/parsers/section-tool-arguments.ts +7 -1
- package/src/metadata-builder/sanitizers/__tests__/section-args-validator.test.ts +13 -0
- package/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.ts +6 -0
- package/src/shared/style-settings/components/StyleSettings.vue +1 -0
|
@@ -25,6 +25,11 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
25
25
|
required: false;
|
|
26
26
|
default: undefined;
|
|
27
27
|
};
|
|
28
|
+
backgroundStyle: {
|
|
29
|
+
type: PropType<BrandPageCssStyle>;
|
|
30
|
+
required: false;
|
|
31
|
+
default: undefined;
|
|
32
|
+
};
|
|
28
33
|
context: {
|
|
29
34
|
type: PropType<BrandPageContext>;
|
|
30
35
|
required: true;
|
|
@@ -61,6 +66,11 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
61
66
|
required: false;
|
|
62
67
|
default: undefined;
|
|
63
68
|
};
|
|
69
|
+
backgroundStyle: {
|
|
70
|
+
type: PropType<BrandPageCssStyle>;
|
|
71
|
+
required: false;
|
|
72
|
+
default: undefined;
|
|
73
|
+
};
|
|
64
74
|
context: {
|
|
65
75
|
type: PropType<BrandPageContext>;
|
|
66
76
|
required: true;
|
|
@@ -68,6 +78,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
68
78
|
}>> & Readonly<{}>, {
|
|
69
79
|
titleStyle: BrandPageCssStyle;
|
|
70
80
|
cardStyle: BrandPageCssStyle;
|
|
81
|
+
backgroundStyle: BrandPageCssStyle;
|
|
71
82
|
buttonStyles: BrandPageCssStyle;
|
|
72
83
|
canCollapse: boolean;
|
|
73
84
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -25,6 +25,11 @@ export default defineComponent({
|
|
|
25
25
|
required: false,
|
|
26
26
|
default: undefined,
|
|
27
27
|
},
|
|
28
|
+
backgroundStyle: {
|
|
29
|
+
type: Object,
|
|
30
|
+
required: false,
|
|
31
|
+
default: undefined,
|
|
32
|
+
},
|
|
28
33
|
context: {
|
|
29
34
|
type: Object,
|
|
30
35
|
required: true,
|
|
@@ -43,6 +48,11 @@ export default defineComponent({
|
|
|
43
48
|
if (this.cardStyle) {
|
|
44
49
|
containerStyle.backgroundColor = this.cardStyle.backgroundColor;
|
|
45
50
|
}
|
|
51
|
+
// Own background colour decouples the container from the button fill (BP-5800).
|
|
52
|
+
// Guarded on backgroundColor so an empty {} never blanks the container.
|
|
53
|
+
if (this.backgroundStyle?.backgroundColor) {
|
|
54
|
+
containerStyle.backgroundColor = this.backgroundStyle.backgroundColor;
|
|
55
|
+
}
|
|
46
56
|
return containerStyle;
|
|
47
57
|
},
|
|
48
58
|
arrowStyle() {
|
|
@@ -43,6 +43,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
43
43
|
isSubmitting: boolean;
|
|
44
44
|
submitError: string | undefined;
|
|
45
45
|
}, {
|
|
46
|
+
isDecorativeSubmitStyle(): boolean;
|
|
46
47
|
submitButtonStyle(): BrandPageCssStyle;
|
|
47
48
|
submitButtonTextStyle(): BrandPageCssStyle;
|
|
48
49
|
contentPaddingStyle(): {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { defineComponent } from 'vue';
|
|
2
2
|
import { FORM_FIELD_TYPES } from '@brand-page/models';
|
|
3
3
|
import { getEmailValidationError, getMessageValidationError, getNameValidationError, getPhoneValidationError, } from '@brand-page/utils';
|
|
4
|
+
import { isDecorativeButtonStyle } from '../../utils/button.util';
|
|
4
5
|
import brandPageClient from '../../clients/brand-page.client';
|
|
5
6
|
import { isEmail } from '../../../utils/validator.util';
|
|
6
7
|
import { ALIGN_CARD_CENTER, ALIGN_CARD_CENTER_IMAGE, ALIGN_CENTERED, ALIGN_LEFT_FULL_IMAGE, ALIGN_RIGHT_FULL_IMAGE, DISPLAY_STYLE_COLLAPSED, RECAPTCHA_ACTION_CONTACT_FORM, TEXT_ONLY, } from '../../constants';
|
|
@@ -44,6 +45,12 @@ export default defineComponent({
|
|
|
44
45
|
submitError: undefined,
|
|
45
46
|
}),
|
|
46
47
|
computed: {
|
|
48
|
+
// Decorative styles (brushstroke/arrow/paper) render a shape that needs width
|
|
49
|
+
// to read — at pure w-fit the arrow chevron collapses. Give the submit button a
|
|
50
|
+
// ~200px min-width so the decoration looks intentional without going full-width.
|
|
51
|
+
isDecorativeSubmitStyle() {
|
|
52
|
+
return isDecorativeButtonStyle(this.viewModel.buttonStyles?.selectedButtonStyleId);
|
|
53
|
+
},
|
|
47
54
|
submitButtonStyle() {
|
|
48
55
|
const buttonStyle = { ...this.viewModel.buttonStyles?.style };
|
|
49
56
|
const buttonTextStyle = {
|
|
@@ -94,6 +94,11 @@ export default defineComponent({
|
|
|
94
94
|
if (borderRadius === '9999px') {
|
|
95
95
|
buttonStyle.borderRadius = '24px';
|
|
96
96
|
}
|
|
97
|
+
// Own background colour decouples the container from the button fill (BP-5800).
|
|
98
|
+
if (this.viewModel.backgroundStyle?.backgroundColor) {
|
|
99
|
+
buttonStyle.backgroundColor =
|
|
100
|
+
this.viewModel.backgroundStyle.backgroundColor;
|
|
101
|
+
}
|
|
97
102
|
return buttonStyle;
|
|
98
103
|
},
|
|
99
104
|
isFormDisabled() {
|
|
@@ -77,6 +77,11 @@ export default defineComponent({
|
|
|
77
77
|
if (borderRadius === '9999px') {
|
|
78
78
|
buttonStyle.borderRadius = '26px';
|
|
79
79
|
}
|
|
80
|
+
// Own background colour decouples the container from the button fill (BP-5800).
|
|
81
|
+
if (this.viewModel.backgroundStyle?.backgroundColor) {
|
|
82
|
+
buttonStyle.backgroundColor =
|
|
83
|
+
this.viewModel.backgroundStyle.backgroundColor;
|
|
84
|
+
}
|
|
80
85
|
return buttonStyle;
|
|
81
86
|
},
|
|
82
87
|
continueButtonStyle() {
|
|
@@ -195,6 +195,7 @@ export interface MailingListContent extends Content {
|
|
|
195
195
|
buttonText: string;
|
|
196
196
|
titleStyle: TextStyleDeclaration;
|
|
197
197
|
buttonTextStyle: TextStyleDeclaration;
|
|
198
|
+
backgroundStyle?: BrandPageCssStyle;
|
|
198
199
|
}
|
|
199
200
|
export declare const FORM_FIELD_TYPES: {
|
|
200
201
|
readonly text: "text";
|
|
@@ -134,6 +134,7 @@ export interface RequestPaymentContent extends Content {
|
|
|
134
134
|
descriptionStyle?: TextStyleDeclaration;
|
|
135
135
|
itemTextStyle: TextStyleDeclaration;
|
|
136
136
|
buttonTextStyle?: TextStyleDeclaration;
|
|
137
|
+
backgroundStyle?: BrandPageCssStyle;
|
|
137
138
|
}
|
|
138
139
|
export interface ShopContentConfig extends PaymentConfig {
|
|
139
140
|
paymentOptionDisplayType: PaymentOptionDisplayType;
|
|
@@ -174,6 +175,7 @@ export interface SupportMeContent extends Content {
|
|
|
174
175
|
descriptionStyle: TextStyleDeclaration;
|
|
175
176
|
buttonTextStyle: TextStyleDeclaration;
|
|
176
177
|
itemTextStyle: TextStyleDeclaration;
|
|
178
|
+
backgroundStyle?: BrandPageCssStyle;
|
|
177
179
|
}
|
|
178
180
|
export interface CreateStripePaymentIntentResponse {
|
|
179
181
|
paymentIntent: StripePaymentIntent;
|
|
@@ -5,3 +5,8 @@ import type { ButtonStyles } from '../models';
|
|
|
5
5
|
* @returns The calculated box shadow CSS value
|
|
6
6
|
*/
|
|
7
7
|
export declare const getBoxShadowValue: (buttonStyles: ButtonStyles) => string;
|
|
8
|
+
export declare const BUTTON_STYLE_BRUSHSTROKE = "BUTTON_STYLE_19";
|
|
9
|
+
export declare const BUTTON_STYLE_ARROW = "BUTTON_STYLE_20";
|
|
10
|
+
export declare const BUTTON_STYLE_PAPER = "BUTTON_STYLE_21";
|
|
11
|
+
export declare const DECORATIVE_BUTTON_STYLE_IDS: string[];
|
|
12
|
+
export declare const isDecorativeButtonStyle: (styleId?: string) => boolean;
|
|
@@ -27,3 +27,16 @@ export const getBoxShadowValue = (buttonStyles) => {
|
|
|
27
27
|
}
|
|
28
28
|
return boxShadowValue;
|
|
29
29
|
};
|
|
30
|
+
// The "decorative" button styles — brushstroke / arrow / torn-paper — whose visual
|
|
31
|
+
// is drawn by ButtonStyleWrapper rather than plain CSS. Their banner-like SVG
|
|
32
|
+
// decoration needs the button to be reasonably wide to render legibly, so narrow
|
|
33
|
+
// (w-fit) hosts should widen when one of these is active (BP-5800).
|
|
34
|
+
export const BUTTON_STYLE_BRUSHSTROKE = 'BUTTON_STYLE_19';
|
|
35
|
+
export const BUTTON_STYLE_ARROW = 'BUTTON_STYLE_20';
|
|
36
|
+
export const BUTTON_STYLE_PAPER = 'BUTTON_STYLE_21';
|
|
37
|
+
export const DECORATIVE_BUTTON_STYLE_IDS = [
|
|
38
|
+
BUTTON_STYLE_BRUSHSTROKE,
|
|
39
|
+
BUTTON_STYLE_ARROW,
|
|
40
|
+
BUTTON_STYLE_PAPER,
|
|
41
|
+
];
|
|
42
|
+
export const isDecorativeButtonStyle = (styleId) => !!styleId && DECORATIVE_BUTTON_STYLE_IDS.includes(styleId);
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { BRAND_PAGE_TYPES } from '../../models';
|
|
2
|
+
/**
|
|
3
|
+
* BP-5800 — decouple the section container background from the global button fill.
|
|
4
|
+
*
|
|
5
|
+
* These blocks' outer container historically took its background from the button
|
|
6
|
+
* fill colour (`containerStyle = { ...buttonStyles }`). They now own a
|
|
7
|
+
* `backgroundStyle`; seed its `backgroundColor` from the current button fill so
|
|
8
|
+
* existing sites render identically while the colour becomes independently editable.
|
|
9
|
+
*
|
|
10
|
+
* runAlways + idempotent: only seeds when the colour is unset, so it never overrides
|
|
11
|
+
* a colour the user has set.
|
|
12
|
+
*/
|
|
13
|
+
const CONTAINER_BACKGROUND_TYPES = new Set([
|
|
14
|
+
'contact-form',
|
|
15
|
+
'mailing-list',
|
|
16
|
+
'request-payment',
|
|
17
|
+
'support-me',
|
|
18
|
+
]);
|
|
19
|
+
export const migration19 = async (migrationResult) => {
|
|
20
|
+
const { brandPageModel } = migrationResult;
|
|
21
|
+
const buttonFill = brandPageModel.styles?.buttonStyles?.style?.backgroundColor;
|
|
22
|
+
if (buttonFill === undefined) {
|
|
23
|
+
return migrationResult;
|
|
24
|
+
}
|
|
25
|
+
const isBrandSite = brandPageModel.brandPageType === BRAND_PAGE_TYPES.brandSite;
|
|
26
|
+
brandPageModel.pages.forEach((page) => {
|
|
27
|
+
page.contents.forEach((content) => {
|
|
28
|
+
if (!CONTAINER_BACKGROUND_TYPES.has(content.type)) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
// contact-form already paints its own backgroundStyle on brand-site (default
|
|
32
|
+
// transparent); only its BP/BC container takes the button fill. mailing-list /
|
|
33
|
+
// payment use the button-fill container on every type, so they always seed.
|
|
34
|
+
if (content.type === 'contact-form' && isBrandSite) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
const block = content;
|
|
38
|
+
if (block.backgroundStyle?.backgroundColor !== undefined) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
block.backgroundStyle = {
|
|
42
|
+
...block.backgroundStyle,
|
|
43
|
+
backgroundColor: buttonFill,
|
|
44
|
+
};
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
return migrationResult;
|
|
48
|
+
};
|
|
@@ -21,6 +21,7 @@ import { migration15 } from './migration/migration-15';
|
|
|
21
21
|
import { migration16 } from './migration/migration-16';
|
|
22
22
|
import { migration17 } from './migration/migration-17';
|
|
23
23
|
import { migration18 } from './migration/migration-18';
|
|
24
|
+
import { migration19 } from './migration/migration-19';
|
|
24
25
|
const MIGRATION_TABLE = [
|
|
25
26
|
{
|
|
26
27
|
version: 1,
|
|
@@ -138,6 +139,14 @@ const MIGRATION_TABLE = [
|
|
|
138
139
|
migrateFn: migration18,
|
|
139
140
|
description: 'BP-5603: backfill stable item ids on all nested items (gallery/section/testimonial/text items, section + footer social links) — the item id is now non-nullable',
|
|
140
141
|
},
|
|
142
|
+
{
|
|
143
|
+
version: 19,
|
|
144
|
+
migrateFn: migration19,
|
|
145
|
+
// runAlways: re-apply on every load so already-published sites pick up the seed
|
|
146
|
+
// without a version bump. Idempotent — only seeds backgroundColor when unset.
|
|
147
|
+
runAlways: true,
|
|
148
|
+
description: 'BP-5800: seed own container backgroundStyle from the button fill colour for contact-form, mailing-list, request-payment and support-me so the container background is independent of the site button (existing sites render unchanged)',
|
|
149
|
+
},
|
|
141
150
|
];
|
|
142
151
|
export const GetLatestModelVersion = () => Math.max(...MIGRATION_TABLE.map((x) => x.version));
|
|
143
152
|
export const migrateBrandPageModel = async (brandPageModel, options) => {
|
|
@@ -526,6 +526,7 @@ const mapToShapesSectionViewModel = (content, styles, brandPageType) => {
|
|
|
526
526
|
};
|
|
527
527
|
const mapToShopViewModel = (content, styles) => {
|
|
528
528
|
const buttonStyles = new ButtonStyles({
|
|
529
|
+
selectedButtonStyleId: styles.buttonStyles.selectedButtonStyleId,
|
|
529
530
|
style: {
|
|
530
531
|
...styles.buttonStyles.style,
|
|
531
532
|
},
|
|
@@ -4,7 +4,7 @@ import * as uuid from 'uuid';
|
|
|
4
4
|
import { colorConvertor, backgroundColorConvertor, borderColorConvertor, displayStyleConvertor, galleryTypeConvertor, imageAspectRatioConvertor, textAlignmentOptionsConvertor, videoContentStateConvertor, fillColorConvertor, bannerAlignDisplayStyleConvertor, aboutDisplayStyleConvertor, dividerStyleConvertor, shapeSizeOptionsConvertor, buttonLinkStyleConvertor, textSizeValueConvertor, textColumnStyleConvertor, contactLayoutStyleConvertor, paymentLinkDisplayStyleConvertor, shopDisplayConvertor, shopAspectRatioConvertor, } from '../convertors';
|
|
5
5
|
import { ALIGN_CENTERED, DISPLAY_STYLE_COLLAPSED, DISPLAY_STYLE_PREVIEW, } from '@brand-page';
|
|
6
6
|
import { imageFieldVisibilityAssessor, imageOptionVisibilityAssessor, imageGalleryFieldVisibilityAssessor, cardFillVisibilityAssessor, mediaSectionItemsFieldTypeAssessor, dividerToggleFieldVisibilityAssessor, shapeSectionItemsFieldTypeAssessor, colorReplacementVisibilityTypeAssessor, colorReplacementProfileVisibilityTypeAssessor, colorReplacementIconVisibilityTypeAssessor, imagesSectionCardStyleVisibilityAssessor, contactCardDisplayTypeVisibilityAssessor, imageUrlVisibilityAssessor, displayTypeVisibilityAssessor, logoFieldVisibilityAssessor, shapesSectionCardStyleVisibilityAssessor, shopImageOptionVisibilityAssessor, shopItemColorVisibility, personalisationOverrideVisibility, } from '../assessors';
|
|
7
|
-
import { logoBackgroundColorDefaultGetter, paymentFillColorFieldDefaultGetter, paymentTextAndBorderColorFieldDefaultGetter, shopBorderColorFieldDefaultGetter, shopFillColorFieldDefaultGetter, textColorFieldDefaultGetter, } from '../default-getters';
|
|
7
|
+
import { contactFormBackgroundColorDefaultGetter, logoBackgroundColorDefaultGetter, paymentFillColorFieldDefaultGetter, paymentTextAndBorderColorFieldDefaultGetter, shopBorderColorFieldDefaultGetter, shopFillColorFieldDefaultGetter, textColorFieldDefaultGetter, } from '../default-getters';
|
|
8
8
|
import { socialLinksIconDisplayStyleConvertor } from '../convertors/social-links-icon-display-style.convertor';
|
|
9
9
|
import { getTextMediaOptionsConverterByMediaType } from '../convertors/text-image-display-style.convertor';
|
|
10
10
|
import { testimonialDisplayStyleConvertor } from '../convertors/testimonial-display-style-convertor';
|
|
@@ -455,6 +455,10 @@ const testimonialReplaceImageSettings = () => ({
|
|
|
455
455
|
desiredWidth: undefined,
|
|
456
456
|
mediaType: MEDIA_TYPES.image,
|
|
457
457
|
});
|
|
458
|
+
// Transparent bg is disallowed on the single-page side (brand-page /
|
|
459
|
+
// brand-contact) so the added background colour stays a solid backdrop for the
|
|
460
|
+
// decorative button styles (BP-5800); brand-site sections keep transparent.
|
|
461
|
+
const disableTransparentOffBrandSite = (brandPageType) => brandPageType !== BRAND_PAGE_TYPES.brandSite;
|
|
458
462
|
export const LOGO_SETTINGS_CONFIG = () => ({
|
|
459
463
|
createInitialContent: createInitialLogoContent,
|
|
460
464
|
type: 'logo',
|
|
@@ -1463,6 +1467,17 @@ export const MAILING_LIST_CONTENT_SETTINGS_CONFIG = () => ({
|
|
|
1463
1467
|
titleStyle: DEFAULT_TITLE_STYLE_SETTINGS_FILED_WITH_TITLE(),
|
|
1464
1468
|
buttonTextStyle: DEFAULT_BUTTON_TEXT_STYLE_FIELD(),
|
|
1465
1469
|
...PADDING_CONTROL_FIELDS(SETTINGS_STYLE_FIELD_GROUP_IDS.style),
|
|
1470
|
+
backgroundStyle: {
|
|
1471
|
+
type: 'color',
|
|
1472
|
+
groupId: SETTINGS_STYLE_FIELD_GROUP_IDS.style,
|
|
1473
|
+
defaultValue: {},
|
|
1474
|
+
isInline: true,
|
|
1475
|
+
showToggle: false,
|
|
1476
|
+
title: contentSettingsTr(`backgroundColorTitle`),
|
|
1477
|
+
disableTransparent: disableTransparentOffBrandSite,
|
|
1478
|
+
valueConvertor: backgroundColorConvertor,
|
|
1479
|
+
defaultGetter: paymentFillColorFieldDefaultGetter,
|
|
1480
|
+
},
|
|
1466
1481
|
},
|
|
1467
1482
|
isEnabled: true,
|
|
1468
1483
|
isLocked: false,
|
|
@@ -1634,6 +1649,17 @@ export const REQUEST_PAYMENT_CONTENT_SETTINGS_CONFIG = () => ({
|
|
|
1634
1649
|
label: contentSettingsTr(`buttonTextStyleLabel`),
|
|
1635
1650
|
},
|
|
1636
1651
|
...PADDING_CONTROL_FIELDS(REQUEST_PAYMENT_GROUPS.style),
|
|
1652
|
+
backgroundStyle: {
|
|
1653
|
+
type: 'color',
|
|
1654
|
+
groupId: REQUEST_PAYMENT_GROUPS.style,
|
|
1655
|
+
defaultValue: {},
|
|
1656
|
+
isInline: true,
|
|
1657
|
+
showToggle: false,
|
|
1658
|
+
title: contentSettingsTr(`backgroundColorTitle`),
|
|
1659
|
+
disableTransparent: disableTransparentOffBrandSite,
|
|
1660
|
+
valueConvertor: backgroundColorConvertor,
|
|
1661
|
+
defaultGetter: paymentFillColorFieldDefaultGetter,
|
|
1662
|
+
},
|
|
1637
1663
|
},
|
|
1638
1664
|
isEnabled: (features) => features.canAddRequestPaymentContents,
|
|
1639
1665
|
isLocked: false,
|
|
@@ -1699,6 +1725,17 @@ export const SUPPORT_ME_CONTENT_SETTINGS_CONFIG = () => ({
|
|
|
1699
1725
|
},
|
|
1700
1726
|
buttonTextStyle: DEFAULT_BUTTON_TEXT_STYLE_FIELD(),
|
|
1701
1727
|
...PADDING_CONTROL_FIELDS(SETTINGS_STYLE_FIELD_GROUP_IDS.style),
|
|
1728
|
+
backgroundStyle: {
|
|
1729
|
+
type: 'color',
|
|
1730
|
+
groupId: SETTINGS_STYLE_FIELD_GROUP_IDS.style,
|
|
1731
|
+
defaultValue: {},
|
|
1732
|
+
isInline: true,
|
|
1733
|
+
showToggle: false,
|
|
1734
|
+
title: contentSettingsTr(`backgroundColorTitle`),
|
|
1735
|
+
disableTransparent: disableTransparentOffBrandSite,
|
|
1736
|
+
valueConvertor: backgroundColorConvertor,
|
|
1737
|
+
defaultGetter: paymentFillColorFieldDefaultGetter,
|
|
1738
|
+
},
|
|
1702
1739
|
},
|
|
1703
1740
|
isEnabled: (features) => features.canAddRequestPaymentContents,
|
|
1704
1741
|
isLocked: false,
|
|
@@ -1846,7 +1883,9 @@ export const CONTACT_FORM_SETTINGS_CONFIG = () => ({
|
|
|
1846
1883
|
isInline: true,
|
|
1847
1884
|
showToggle: false,
|
|
1848
1885
|
title: contentSettingsTr(`backgroundColorTitle`),
|
|
1886
|
+
disableTransparent: disableTransparentOffBrandSite,
|
|
1849
1887
|
valueConvertor: backgroundColorConvertor,
|
|
1888
|
+
defaultGetter: contactFormBackgroundColorDefaultGetter,
|
|
1850
1889
|
},
|
|
1851
1890
|
},
|
|
1852
1891
|
isEnabled: true,
|
|
@@ -2663,6 +2702,7 @@ export const SHOP_SECTION_SETTINGS_CONFIG = () => ({
|
|
|
2663
2702
|
isInline: true,
|
|
2664
2703
|
showToggle: false,
|
|
2665
2704
|
title: contentSettingsTr(`backgroundColorTitle`),
|
|
2705
|
+
disableTransparent: disableTransparentOffBrandSite,
|
|
2666
2706
|
valueConvertor: backgroundColorConvertor,
|
|
2667
2707
|
},
|
|
2668
2708
|
},
|
package/lib/src/brand-page-maker/default-getters/contact-form-background-color.default-getter.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { DefaultGetter } from '../models';
|
|
2
|
+
/**
|
|
3
|
+
* Contact-form "Background color" default (BP-5800). On brand-page/brand-contact the
|
|
4
|
+
* collapsible container takes the button fill, so default the picker to it. On
|
|
5
|
+
* brand-site the field is the section background behind the card (its own "Card color"),
|
|
6
|
+
* which stays transparent — so no default there.
|
|
7
|
+
*/
|
|
8
|
+
export declare const contactFormBackgroundColorDefaultGetter: DefaultGetter<BrandPageCssStyle>;
|
package/lib/src/brand-page-maker/default-getters/contact-form-background-color.default-getter.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { RGBAtoHex } from '@utils/helpers';
|
|
2
|
+
import { BRAND_PAGE_TYPES } from '@brand-page';
|
|
3
|
+
/**
|
|
4
|
+
* Contact-form "Background color" default (BP-5800). On brand-page/brand-contact the
|
|
5
|
+
* collapsible container takes the button fill, so default the picker to it. On
|
|
6
|
+
* brand-site the field is the section background behind the card (its own "Card color"),
|
|
7
|
+
* which stays transparent — so no default there.
|
|
8
|
+
*/
|
|
9
|
+
export const contactFormBackgroundColorDefaultGetter = (brandPage) => {
|
|
10
|
+
if (brandPage.brandPageType === BRAND_PAGE_TYPES.brandSite) {
|
|
11
|
+
return {};
|
|
12
|
+
}
|
|
13
|
+
return {
|
|
14
|
+
backgroundColor: RGBAtoHex(brandPage.styles.buttonStyles.style.backgroundColor),
|
|
15
|
+
};
|
|
16
|
+
};
|
|
@@ -2,3 +2,4 @@ export * from './text-color.default-getter';
|
|
|
2
2
|
export * from './payment-fill-color.default-getter';
|
|
3
3
|
export * from './payment-text-and-border-color.default-getter';
|
|
4
4
|
export * from './logo-background-fill.default-getter';
|
|
5
|
+
export * from './contact-form-background-color.default-getter';
|
|
@@ -2,3 +2,4 @@ export * from './text-color.default-getter';
|
|
|
2
2
|
export * from './payment-fill-color.default-getter';
|
|
3
3
|
export * from './payment-text-and-border-color.default-getter';
|
|
4
4
|
export * from './logo-background-fill.default-getter';
|
|
5
|
+
export * from './contact-form-background-color.default-getter';
|
|
@@ -352,7 +352,11 @@ export const availableButtonStyleConfigs = [
|
|
|
352
352
|
iconName: 'button-brushstroke',
|
|
353
353
|
iconViewBox: '0 0 60 20',
|
|
354
354
|
options: ['buttonFillColor', 'buttonIconColor'],
|
|
355
|
-
brandPageType: [
|
|
355
|
+
brandPageType: [
|
|
356
|
+
BRAND_PAGE_TYPES.default,
|
|
357
|
+
BRAND_PAGE_TYPES.brandContact,
|
|
358
|
+
BRAND_PAGE_TYPES.brandSite,
|
|
359
|
+
],
|
|
356
360
|
},
|
|
357
361
|
{
|
|
358
362
|
id: 'BUTTON_STYLE_20',
|
|
@@ -369,7 +373,11 @@ export const availableButtonStyleConfigs = [
|
|
|
369
373
|
iconName: 'button-arrow',
|
|
370
374
|
iconViewBox: '0 0 60 20',
|
|
371
375
|
options: ['buttonFillColor', 'buttonIconColor'],
|
|
372
|
-
brandPageType: [
|
|
376
|
+
brandPageType: [
|
|
377
|
+
BRAND_PAGE_TYPES.default,
|
|
378
|
+
BRAND_PAGE_TYPES.brandContact,
|
|
379
|
+
BRAND_PAGE_TYPES.brandSite,
|
|
380
|
+
],
|
|
373
381
|
},
|
|
374
382
|
{
|
|
375
383
|
id: 'BUTTON_STYLE_21',
|
|
@@ -386,6 +394,10 @@ export const availableButtonStyleConfigs = [
|
|
|
386
394
|
iconName: 'button-paper',
|
|
387
395
|
iconViewBox: '0 0 60 20',
|
|
388
396
|
options: ['buttonFillColor', 'buttonIconColor'],
|
|
389
|
-
brandPageType: [
|
|
397
|
+
brandPageType: [
|
|
398
|
+
BRAND_PAGE_TYPES.default,
|
|
399
|
+
BRAND_PAGE_TYPES.brandContact,
|
|
400
|
+
BRAND_PAGE_TYPES.brandSite,
|
|
401
|
+
],
|
|
390
402
|
},
|
|
391
403
|
];
|
|
@@ -90,7 +90,7 @@ export interface ContentSettingsField<TContent> {
|
|
|
90
90
|
variant?: VariantDisplayModes | ((brandPageType: BrandPageType) => VariantDisplayModes);
|
|
91
91
|
replaceImageSettings?: ContentReplaceImageSettings<TContent>;
|
|
92
92
|
showToggle?: boolean;
|
|
93
|
-
disableTransparent?: boolean;
|
|
93
|
+
disableTransparent?: boolean | ((brandPageType: BrandPageType) => boolean);
|
|
94
94
|
valueConvertor?: ValueConvertor<any, any>;
|
|
95
95
|
canReplace?: boolean;
|
|
96
96
|
placeholderAssessor?: PlaceholderTypeAssessor<TContent>;
|
|
@@ -232,6 +232,7 @@ export const createInitialMailingListContent = (options) => {
|
|
|
232
232
|
textStyleType: TEXT_STYLE_TYPES.buttons,
|
|
233
233
|
textAlign: 'center',
|
|
234
234
|
},
|
|
235
|
+
backgroundStyle: {},
|
|
235
236
|
};
|
|
236
237
|
};
|
|
237
238
|
export const createInitialRequestPaymentContent = (options) => {
|
|
@@ -274,6 +275,7 @@ export const createInitialRequestPaymentContent = (options) => {
|
|
|
274
275
|
textStyleType: TEXT_STYLE_TYPES.buttons,
|
|
275
276
|
textAlign: 'center',
|
|
276
277
|
},
|
|
278
|
+
backgroundStyle: {},
|
|
277
279
|
};
|
|
278
280
|
};
|
|
279
281
|
export const createInitialShopContent = (options) => {
|
|
@@ -365,6 +367,7 @@ export const createInitialSupportMeContent = (options) => {
|
|
|
365
367
|
textStyleType: TEXT_STYLE_TYPES.buttons,
|
|
366
368
|
textAlign: 'center',
|
|
367
369
|
},
|
|
370
|
+
backgroundStyle: {},
|
|
368
371
|
};
|
|
369
372
|
};
|
|
370
373
|
export const createInitialContactFormContent = (options) => {
|