@designcrowd/library.brand-page 5.17.22 → 5.17.23-ast-bugs
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-CE3q_ouk.js → CreatedOnBrandCrowd-de-de-CDAxjKt-.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-en-us-YmCINEd2.js → CreatedOnBrandCrowd-en-us-DkA_TUjP.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-es-es-po716FZh.js → CreatedOnBrandCrowd-es-es-BYpg9xvN.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-fr-DgSeh7zq.js → CreatedOnBrandCrowd-fr-ca-C8hTipTz.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-ca-DgSeh7zq.js → CreatedOnBrandCrowd-fr-fr-C8hTipTz.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-pt-BY3I3OVc.js → CreatedOnBrandCrowd-pt-br-G8yyoNtI.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-br-BY3I3OVc.js → CreatedOnBrandCrowd-pt-pt-G8yyoNtI.js} +1 -1
- package/lib/src/{CreatedOnDcom-de-de-VF__9AH9.js → CreatedOnDcom-de-de-DyaUv6JA.js} +1 -1
- package/lib/src/{CreatedOnDcom-en-us-B653tDEJ.js → CreatedOnDcom-en-us-DpGsEh5B.js} +1 -1
- package/lib/src/{CreatedOnDcom-es-es-Cc3g0BMj.js → CreatedOnDcom-es-es-BiOgNsAu.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-ca-NzxsUZqx.js → CreatedOnDcom-fr-ca-tg_w97_1.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-fr-DFuj0umw.js → CreatedOnDcom-fr-fr-CwqXK1VU.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-br-VxpFX1Jd.js → CreatedOnDcom-pt-br-B4QG_xx7.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-pt-CG2qMIlw.js → CreatedOnDcom-pt-pt-CD2m6NMT.js} +1 -1
- package/lib/src/brand-page/components/banner-section/BannerSection.mixin.d.ts +1 -1
- 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 +20 -2
- package/lib/src/brand-page/models/index.d.ts +1 -1
- package/lib/src/brand-page/utils/migration/migration-14.d.ts +2 -0
- package/lib/src/brand-page/utils/migration/migration-14.js +16 -0
- package/lib/src/brand-page/utils/migration.util.js +6 -0
- package/lib/src/brand-page/utils/style.util.js +8 -1
- package/lib/src/brand-page/utils/text.util.d.ts +2 -0
- package/lib/src/brand-page/utils/text.util.js +21 -1
- package/lib/src/brand-page-maker/components/brand-page-maker/__fixtures__/brand-page-examples.d.ts +1 -1
- package/lib/src/brand-page-maker/components/brand-page-maker/__fixtures__/brand-page-examples.js +1 -1
- package/lib/src/brand-page-maker/components/brand-page-maker/__fixtures__/brand-site-template.examples.js +1 -1
- package/lib/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.js +1 -1
- package/lib/src/brand-page-maker/constants/config-settings-constant.js +1 -10
- package/lib/src/brand-page-maker/models/content-settings-configs.d.ts +5 -0
- package/lib/src/brand-page-maker/models/content-settings.js +3 -0
- package/lib/src/brand-page-maker/utils/rich-text-editor.util.js +170 -388
- package/lib/src/css/library.brand-page-brandCrowd.min.css +89 -86
- package/lib/src/css/library.brand-page-brandPage.min.css +89 -86
- package/lib/src/css/library.brand-page-designCom.min.css +89 -86
- package/lib/src/css/library.brand-page-preview.min.css +89 -86
- package/lib/src/index.mjs +1 -1
- package/lib/src/{lib-DO1Zk3d3.js → lib-CFEFnrUm.js} +24167 -24368
- package/lib/src/metadata-builder/builders/section-field-maps.js +1 -0
- package/lib/src/metadata-builder/builders/section-field-utils.js +5 -0
- package/lib/src/metadata-builder/helpers/rte.helpers.js +3 -0
- package/lib/src/shared/content-settings/components/GenericTextInput.mixin.js +10 -5
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.js +2 -1
- package/lib/src/shared/content-settings/components/text-items-field/TextItemsField.mixin.js +3 -3
- package/lib/src/shared/style-settings/components/StyleSettings.mixin.d.ts +1 -0
- package/lib/src/shared/style-settings/components/StyleSettings.mixin.js +8 -0
- package/package.json +1 -1
- package/src/brand-page/components/about-section/AboutSection.vue +63 -6
- package/src/brand-page/components/collapsible/Collapsible.vue +8 -2
- package/src/brand-page/components/contact-form/ContactForm.mixin.ts +21 -2
- package/src/brand-page/components/contact-form/ContactForm.vue +15 -15
- package/src/brand-page/components/text-wrapper/TextWrapper.vue +5 -1
- package/src/brand-page/models/index.ts +1 -1
- package/src/brand-page/utils/__snapshots__/migration.util.test.ts.snap +3 -3
- package/src/brand-page/utils/migration/migration-14.ts +23 -0
- package/src/brand-page/utils/migration.util.ts +7 -0
- package/src/brand-page/utils/style.util.ts +8 -1
- package/src/brand-page/utils/text.util.ts +26 -1
- package/src/brand-page-maker/components/brand-page-maker/__fixtures__/brand-page-examples.ts +1 -1
- package/src/brand-page-maker/components/brand-page-maker/__fixtures__/brand-site-template.examples.ts +1 -1
- package/src/brand-page-maker/components/rich-text-editor/RichTextEditor.vue +9 -1
- package/src/brand-page-maker/composables/rich-text-editor/useRichTextEditor.ts +1 -1
- package/src/brand-page-maker/constants/config-settings-constant.ts +1 -10
- package/src/brand-page-maker/models/content-settings-configs.ts +6 -0
- package/src/brand-page-maker/models/content-settings.ts +3 -0
- package/src/brand-page-maker/utils/rich-text-editor.util.ts +274 -684
- package/src/metadata-builder/builders/section-field-maps.ts +1 -0
- package/src/metadata-builder/builders/section-field-utils.ts +5 -0
- package/src/metadata-builder/helpers/rte.helpers.ts +4 -0
- package/src/shared/content-settings/components/GenericTextInput.mixin.ts +16 -5
- package/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.ts +2 -1
- package/src/shared/content-settings/components/testimonial-items-field/TestimonialItemsField.vue +3 -1
- package/src/shared/content-settings/components/text-items-field/TextItemsField.mixin.ts +3 -3
- package/src/shared/style-settings/components/StyleSettings.mixin.ts +11 -0
- package/src/shared/style-settings/components/StyleSettings.vue +1 -1
- package/lib/src/brand-page/components/about-section/AboutSection.mixin.d.ts +0 -83
- package/lib/src/brand-page/components/about-section/AboutSection.mixin.js +0 -65
- package/src/brand-page/components/about-section/AboutSection.mixin.ts +0 -78
|
@@ -96,8 +96,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
96
96
|
default: undefined;
|
|
97
97
|
};
|
|
98
98
|
}>> & Readonly<{}>, {
|
|
99
|
-
contentIndex: number;
|
|
100
99
|
containerClientWidth: number | undefined;
|
|
101
100
|
containerClientHeight: number | undefined;
|
|
101
|
+
contentIndex: number;
|
|
102
102
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
103
103
|
export default _default;
|
|
@@ -60,6 +60,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
60
60
|
title(): string;
|
|
61
61
|
renderText(): string;
|
|
62
62
|
renderSuccessText(): string;
|
|
63
|
+
successMessageColorStyle(): BrandPageCssStyle;
|
|
63
64
|
}, {
|
|
64
65
|
submitContactForm(): Promise<void>;
|
|
65
66
|
validateFormValues(): void;
|
|
@@ -5,6 +5,7 @@ import brandPageClient from '../../clients/brand-page.client';
|
|
|
5
5
|
import { isEmail } from '../../../utils/validator.util';
|
|
6
6
|
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';
|
|
7
7
|
import { getRenderText } from '@brand-page/utils';
|
|
8
|
+
import { hasRTEContent } from '@brand-page-maker/utils';
|
|
8
9
|
import { useReCaptcha } from '../../composables/recaptcha.composable';
|
|
9
10
|
export default defineComponent({
|
|
10
11
|
props: {
|
|
@@ -116,13 +117,30 @@ export default defineComponent({
|
|
|
116
117
|
if (!this.viewModel.description) {
|
|
117
118
|
return '';
|
|
118
119
|
}
|
|
119
|
-
|
|
120
|
+
if (hasRTEContent(this.viewModel.description)) {
|
|
121
|
+
return this.viewModel.description;
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
return getRenderText(this.viewModel.description);
|
|
125
|
+
}
|
|
120
126
|
},
|
|
121
127
|
renderSuccessText() {
|
|
122
128
|
if (!this.viewModel.successMessage) {
|
|
123
129
|
return '';
|
|
124
130
|
}
|
|
125
|
-
|
|
131
|
+
if (hasRTEContent(this.viewModel.successMessage)) {
|
|
132
|
+
return this.viewModel.successMessage;
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
return getRenderText(this.viewModel.successMessage);
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
successMessageColorStyle() {
|
|
139
|
+
const color = this.viewModel.successMessageStyle?.color;
|
|
140
|
+
if (color) {
|
|
141
|
+
return { color };
|
|
142
|
+
}
|
|
143
|
+
return {};
|
|
126
144
|
},
|
|
127
145
|
},
|
|
128
146
|
watch: {
|
|
@@ -245,7 +245,7 @@ export interface ContactFormContent extends Content {
|
|
|
245
245
|
descriptionStyle?: TextStyleDeclaration;
|
|
246
246
|
buttonTextStyle?: TextStyleDeclaration;
|
|
247
247
|
backgroundStyle?: BrandPageCssStyle;
|
|
248
|
-
|
|
248
|
+
successMessageStyle?: TextStyleDeclaration;
|
|
249
249
|
cardStyle?: BrandPageCssStyle;
|
|
250
250
|
colorReplacements?: ColorReplacement[];
|
|
251
251
|
mediaType?: string;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { isContact } from '../model.util';
|
|
2
|
+
export const migration14 = async (migrationResult) => {
|
|
3
|
+
const { brandPageModel } = migrationResult;
|
|
4
|
+
brandPageModel.pages.forEach((page) => {
|
|
5
|
+
page.contents.forEach((content) => {
|
|
6
|
+
if (isContact(content)) {
|
|
7
|
+
const contactForm = content;
|
|
8
|
+
if ('messageTextColor' in contactForm) {
|
|
9
|
+
contactForm.successMessageStyle = contactForm.messageTextColor;
|
|
10
|
+
delete contactForm.messageTextColor;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
return migrationResult;
|
|
16
|
+
};
|
|
@@ -16,6 +16,7 @@ import { migration11 } from './migration/migration-11';
|
|
|
16
16
|
import { migration12 } from './migration/migration-12';
|
|
17
17
|
import { migration12_1 } from './migration/migration-12_1';
|
|
18
18
|
import { migration13 } from './migration/migration-13';
|
|
19
|
+
import { migration14 } from './migration/migration-14';
|
|
19
20
|
const MIGRATION_TABLE = [
|
|
20
21
|
{
|
|
21
22
|
version: 1,
|
|
@@ -103,6 +104,11 @@ const MIGRATION_TABLE = [
|
|
|
103
104
|
migrateFn: migration13,
|
|
104
105
|
description: 'Migrating old page navigation refererences to use page ids',
|
|
105
106
|
},
|
|
107
|
+
{
|
|
108
|
+
version: 14,
|
|
109
|
+
migrateFn: migration14,
|
|
110
|
+
description: 'Renaming messageTextColor to successMessageStyle on contact form content',
|
|
111
|
+
},
|
|
106
112
|
];
|
|
107
113
|
export const GetLatestModelVersion = () => Math.max(...MIGRATION_TABLE.map((x) => x.version));
|
|
108
114
|
export const migrateBrandPageModel = async (brandPageModel, options) => {
|
|
@@ -225,7 +225,14 @@ const CONTENT_STYLE_PROP_NAME_SUFFIX = [
|
|
|
225
225
|
'Color',
|
|
226
226
|
'Replacements',
|
|
227
227
|
];
|
|
228
|
-
const RTE_ALLOWED_FIELDS = [
|
|
228
|
+
const RTE_ALLOWED_FIELDS = [
|
|
229
|
+
'title',
|
|
230
|
+
'description',
|
|
231
|
+
'text',
|
|
232
|
+
'textItems',
|
|
233
|
+
'paragraph',
|
|
234
|
+
'successMessage',
|
|
235
|
+
];
|
|
229
236
|
export const applyLogoThemeToContents = (logoTheme, pages) => {
|
|
230
237
|
let isModified = false;
|
|
231
238
|
const newPages = pages.map((page) => {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export declare const getRenderText: (text: string) => string;
|
|
2
2
|
export declare const escapeContentText: (text: string | undefined) => string | undefined;
|
|
3
3
|
export declare const unescapeContentText: (text: string) => string;
|
|
4
|
+
export declare const encodeContentText: (text: string | undefined) => string | undefined;
|
|
5
|
+
export declare const decodeHtmlEntities: (text: string) => string;
|
|
@@ -11,5 +11,25 @@ export const escapeContentText = (text) => {
|
|
|
11
11
|
.replace(/(\r\n|\r|\n)/g, ESCAPED_NEWLINE_CHARACTER);
|
|
12
12
|
};
|
|
13
13
|
export const unescapeContentText = (text) => {
|
|
14
|
-
return text
|
|
14
|
+
return text
|
|
15
|
+
.replace(new RegExp(`${ESCAPED_NEWLINE_CHARACTER}`, 'g'), '\n')
|
|
16
|
+
.replace(/</g, '<')
|
|
17
|
+
.replace(/>/g, '>')
|
|
18
|
+
.replace(/&/g, '&');
|
|
19
|
+
};
|
|
20
|
+
export const encodeContentText = (text) => {
|
|
21
|
+
if (!text) {
|
|
22
|
+
return text;
|
|
23
|
+
}
|
|
24
|
+
return text
|
|
25
|
+
.replace(/&/g, '&')
|
|
26
|
+
.replace(/</g, '<')
|
|
27
|
+
.replace(/>/g, '>')
|
|
28
|
+
.replace(/(\r\n|\r|\n)/g, ESCAPED_NEWLINE_CHARACTER);
|
|
29
|
+
};
|
|
30
|
+
export const decodeHtmlEntities = (text) => {
|
|
31
|
+
return text
|
|
32
|
+
.replace(/</g, '<')
|
|
33
|
+
.replace(/>/g, '>')
|
|
34
|
+
.replace(/&/g, '&');
|
|
15
35
|
};
|
|
@@ -387,7 +387,7 @@ export const useRichTextEditor = (model, props, emit, fontSettings, fontStyleDro
|
|
|
387
387
|
const copyGlobalStyleSettings = (selectedTextStyle) => {
|
|
388
388
|
const globalStyles = selectedTextStyle ?? selectedGlobalTextStyles.value?.style;
|
|
389
389
|
if (globalStyles) {
|
|
390
|
-
globalStyles.fontWeight && toggleBoldAll();
|
|
390
|
+
globalStyles.fontWeight === 'bold' && toggleBoldAll();
|
|
391
391
|
globalStyles.fontStyle && toggleItalicAll();
|
|
392
392
|
globalStyles.textDecoration?.includes('underline') &&
|
|
393
393
|
toggleUnderlineAll();
|
|
@@ -1774,6 +1774,7 @@ export const CONTACT_FORM_SETTINGS_CONFIG = () => ({
|
|
|
1774
1774
|
placeholder: contentSettingsTr(`successMessagePlaceholder`),
|
|
1775
1775
|
title: contentSettingsTr(`successMessageTitle`),
|
|
1776
1776
|
groupId: CONTACT_FORM_GROUPS.settings,
|
|
1777
|
+
maxLength: 1000,
|
|
1777
1778
|
},
|
|
1778
1779
|
responseEmail: {
|
|
1779
1780
|
type: 'email',
|
|
@@ -1813,16 +1814,6 @@ export const CONTACT_FORM_SETTINGS_CONFIG = () => ({
|
|
|
1813
1814
|
title: contentSettingsTr(`backgroundColorTitle`),
|
|
1814
1815
|
valueConvertor: backgroundColorConvertor,
|
|
1815
1816
|
},
|
|
1816
|
-
messageTextColor: {
|
|
1817
|
-
type: 'color',
|
|
1818
|
-
groupId: CONTACT_FORM_GROUPS.style,
|
|
1819
|
-
defaultValue: {},
|
|
1820
|
-
isInline: true,
|
|
1821
|
-
showToggle: false,
|
|
1822
|
-
disableTransparent: true,
|
|
1823
|
-
title: contentSettingsTr(`successMessageTextColorTitle`),
|
|
1824
|
-
valueConvertor: colorConvertor,
|
|
1825
|
-
},
|
|
1826
1817
|
},
|
|
1827
1818
|
isEnabled: true,
|
|
1828
1819
|
isLocked: (features) => !features.canAddContactFormContents,
|
|
@@ -99,6 +99,11 @@ export interface ContentSettingsField<TContent> {
|
|
|
99
99
|
fieldTypeAssessor?: FieldTypeAssessor<TContent>;
|
|
100
100
|
defaultGetter?: DefaultGetter<any>;
|
|
101
101
|
validator?: ContentValidator<TContent>;
|
|
102
|
+
/**
|
|
103
|
+
* Override the style field name used by the RTE editor.
|
|
104
|
+
* Defaults to `${fieldName}Style` when not specified.
|
|
105
|
+
*/
|
|
106
|
+
styleName?: string;
|
|
102
107
|
}
|
|
103
108
|
export interface ContentSettingsMultiField<TContent, TField> extends Omit<ContentSettingsField<TContent>, 'type' | 'role'> {
|
|
104
109
|
type: ItemMultiFieldType;
|
|
@@ -437,6 +437,9 @@ export const createInitialContactFormContent = (options) => {
|
|
|
437
437
|
textStyleType: TEXT_STYLE_TYPES.paragraphs,
|
|
438
438
|
textAlign: 'center',
|
|
439
439
|
},
|
|
440
|
+
successMessageStyle: {
|
|
441
|
+
textStyleType: TEXT_STYLE_TYPES.paragraphs,
|
|
442
|
+
},
|
|
440
443
|
buttonTextStyle: {
|
|
441
444
|
applyAutoScale: options?.brandPageType === BRAND_PAGE_TYPES.brandSite,
|
|
442
445
|
textStyleType: TEXT_STYLE_TYPES.buttons,
|