@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
|
@@ -156,6 +156,7 @@ const contactFormStyleFields = defineFieldMap({
|
|
|
156
156
|
title_style: 'titleStyle',
|
|
157
157
|
description_style: 'descriptionStyle',
|
|
158
158
|
button_text_style: 'buttonTextStyle',
|
|
159
|
+
success_message_style: 'successMessageStyle',
|
|
159
160
|
});
|
|
160
161
|
const imagesSectionStyleFields = defineFieldMap({
|
|
161
162
|
title_style: 'titleStyle',
|
|
@@ -85,6 +85,11 @@ const RTE_FIELD_STYLE_PAIRS = [
|
|
|
85
85
|
argKey: 'description_style',
|
|
86
86
|
},
|
|
87
87
|
{ textField: 'text', styleField: 'textStyle', argKey: 'text_style' },
|
|
88
|
+
{
|
|
89
|
+
textField: 'paragraph',
|
|
90
|
+
styleField: 'paragraphStyle',
|
|
91
|
+
argKey: 'paragraph_style',
|
|
92
|
+
},
|
|
88
93
|
];
|
|
89
94
|
/**
|
|
90
95
|
* Re-applies merged styles to RTE content fields after applyStyleFields has
|
|
@@ -3,6 +3,9 @@ import { useExternalRichTextEditor } from '../../brand-page-maker/composables/ri
|
|
|
3
3
|
import { getRenderText } from '../../brand-page/utils';
|
|
4
4
|
import { ESCAPED_NEWLINE_CHARACTER } from '../../constants/ui';
|
|
5
5
|
export const applyStyleToRTEText = (externalEditor, contentText, newContentStyle) => {
|
|
6
|
+
if (!contentText) {
|
|
7
|
+
return contentText;
|
|
8
|
+
}
|
|
6
9
|
const content = contentText.includes(ESCAPED_NEWLINE_CHARACTER)
|
|
7
10
|
? getRenderText(contentText)
|
|
8
11
|
: contentText;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent } from 'vue';
|
|
2
2
|
import debounce from 'lodash.debounce';
|
|
3
3
|
import { TextInput, Textarea } from '@designcrowd/fe-shared-lib';
|
|
4
|
-
import { escapeContentText, unescapeContentText } from '@brand-page/utils';
|
|
4
|
+
import { encodeContentText, escapeContentText, unescapeContentText, } from '@brand-page/utils';
|
|
5
5
|
import { genericTextInputTr } from '@src/composables/useTranslate';
|
|
6
6
|
const DEBOUNCE_WAIT_MS = 100;
|
|
7
7
|
export default defineComponent({
|
|
@@ -119,7 +119,13 @@ export default defineComponent({
|
|
|
119
119
|
if (this.value === false) {
|
|
120
120
|
return false;
|
|
121
121
|
}
|
|
122
|
-
|
|
122
|
+
if (!this.value) {
|
|
123
|
+
return '';
|
|
124
|
+
}
|
|
125
|
+
if (this.showRichTextEditor) {
|
|
126
|
+
return this.value;
|
|
127
|
+
}
|
|
128
|
+
return unescapeContentText(this.value);
|
|
123
129
|
},
|
|
124
130
|
set(newVal) {
|
|
125
131
|
if (newVal === false) {
|
|
@@ -127,11 +133,10 @@ export default defineComponent({
|
|
|
127
133
|
}
|
|
128
134
|
else {
|
|
129
135
|
if (this.showRichTextEditor) {
|
|
130
|
-
// Todo: re-visit this while working on content senatization
|
|
131
136
|
this._value = newVal;
|
|
132
137
|
}
|
|
133
138
|
else {
|
|
134
|
-
this._value =
|
|
139
|
+
this._value = encodeContentText(newVal);
|
|
135
140
|
}
|
|
136
141
|
}
|
|
137
142
|
this.emitChangeDebounce && this.emitChangeDebounce();
|
|
@@ -161,7 +166,7 @@ export default defineComponent({
|
|
|
161
166
|
},
|
|
162
167
|
showRichTextEditor(newVal) {
|
|
163
168
|
if (!newVal && this._value && typeof this._value === 'string') {
|
|
164
|
-
this._value =
|
|
169
|
+
this._value = encodeContentText(this._value);
|
|
165
170
|
this.emitChange();
|
|
166
171
|
}
|
|
167
172
|
},
|
|
@@ -23,6 +23,7 @@ const RTE_DISALLOWED_STYLE_FIELD_NAMES = [
|
|
|
23
23
|
'descriptionStyle',
|
|
24
24
|
'titleStyle',
|
|
25
25
|
'textStyle',
|
|
26
|
+
'paragraphStyle',
|
|
26
27
|
];
|
|
27
28
|
const AI_ALLOWED_FIELD_NAMES = ['description', 'title', 'text', 'paragraph'];
|
|
28
29
|
const RTE_DISALLOWED_FIELD_NAMES = ['buttonText'];
|
|
@@ -87,7 +88,7 @@ export default defineComponent({
|
|
|
87
88
|
return this.getContent(this.id);
|
|
88
89
|
},
|
|
89
90
|
styleName() {
|
|
90
|
-
return `${this.field.name}Style`;
|
|
91
|
+
return this.field.styleName || `${this.field.name}Style`;
|
|
91
92
|
},
|
|
92
93
|
contentType() {
|
|
93
94
|
return this.type;
|
|
@@ -2,7 +2,7 @@ import { defineComponent, computed } from 'vue';
|
|
|
2
2
|
import { FONT_SIZE_BODY, MAX_LENGTH_ERROR_MESSAGE, MAX_TEXT_LENGTH, TEXT_EMPTY, TEXT_STYLE_TYPES, } from '@brand-page';
|
|
3
3
|
import debounce from 'lodash.debounce';
|
|
4
4
|
import cloneDeep from 'lodash.clonedeep';
|
|
5
|
-
import { escapeContentText } from '@brand-page/utils';
|
|
5
|
+
import { decodeHtmlEntities, escapeContentText } from '@brand-page/utils';
|
|
6
6
|
import { useSnapshotStore } from '@brand-page-maker/stores';
|
|
7
7
|
import { getPlainTextFromRTE, replaceTextInRTE } from '@brand-page-maker/utils';
|
|
8
8
|
import { isDefaultContentText } from '../../utils';
|
|
@@ -102,9 +102,9 @@ export default defineComponent({
|
|
|
102
102
|
},
|
|
103
103
|
getItemTextPreview(text) {
|
|
104
104
|
if (this.showRichTextEditor) {
|
|
105
|
-
return escapeContentText(text) ?? '';
|
|
105
|
+
return decodeHtmlEntities(escapeContentText(text) ?? '');
|
|
106
106
|
}
|
|
107
|
-
return text;
|
|
107
|
+
return decodeHtmlEntities(text);
|
|
108
108
|
},
|
|
109
109
|
emitChange() {
|
|
110
110
|
const payload = {
|
|
@@ -989,6 +989,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
989
989
|
colorPickerValue(): (option: ButtonStyleConfigOption) => any;
|
|
990
990
|
isRenderedInStorybook(): boolean;
|
|
991
991
|
isWidthToggled(): boolean;
|
|
992
|
+
filteredButtonStyleOptions(): ButtonStyleConfigOption[];
|
|
992
993
|
brandName(): "Design.com" | "BrandCrowd";
|
|
993
994
|
hideText(): any;
|
|
994
995
|
}, {
|
|
@@ -78,6 +78,14 @@ export default defineComponent({
|
|
|
78
78
|
isWidthToggled() {
|
|
79
79
|
return this.brandPageType === 'brandSite';
|
|
80
80
|
},
|
|
81
|
+
filteredButtonStyleOptions() {
|
|
82
|
+
if (!this.selectedButtonStyleConfig)
|
|
83
|
+
return [];
|
|
84
|
+
if (this.brandPageType === 'brandSite') {
|
|
85
|
+
return this.selectedButtonStyleConfig.options.filter((o) => o !== 'buttonIconColor');
|
|
86
|
+
}
|
|
87
|
+
return this.selectedButtonStyleConfig.options;
|
|
88
|
+
},
|
|
81
89
|
brandName() {
|
|
82
90
|
return this.isDesignCom ? 'Design.com' : 'BrandCrowd';
|
|
83
91
|
},
|
package/package.json
CHANGED
|
@@ -91,6 +91,7 @@
|
|
|
91
91
|
v-if="renderText"
|
|
92
92
|
:text-style="viewModel.paragraphStyle"
|
|
93
93
|
:text="renderText"
|
|
94
|
+
element="div"
|
|
94
95
|
:class="textAlignClass"
|
|
95
96
|
/>
|
|
96
97
|
</div>
|
|
@@ -98,15 +99,71 @@
|
|
|
98
99
|
</div>
|
|
99
100
|
</section>
|
|
100
101
|
</template>
|
|
101
|
-
<script>
|
|
102
|
-
import
|
|
102
|
+
<script lang="ts" setup>
|
|
103
|
+
import { computed } from 'vue';
|
|
104
|
+
import type { AboutSectionViewModel } from '@brand-page/view-models';
|
|
105
|
+
import type { BrandPageContext } from '@brand-page/models';
|
|
106
|
+
import { getRenderText } from '@brand-page/utils';
|
|
107
|
+
import { hasRTEContent } from '@brand-page-maker/utils';
|
|
103
108
|
import Media from '../media/Media.vue';
|
|
104
109
|
import TextWrapper from '../text-wrapper/TextWrapper.vue';
|
|
105
110
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
111
|
+
const props = withDefaults(
|
|
112
|
+
defineProps<{
|
|
113
|
+
viewModel: AboutSectionViewModel;
|
|
114
|
+
context: BrandPageContext;
|
|
115
|
+
isPreview?: boolean;
|
|
116
|
+
isMobileDevice?: boolean;
|
|
117
|
+
contentIndex?: number;
|
|
118
|
+
}>(),
|
|
119
|
+
{
|
|
120
|
+
isPreview: false,
|
|
121
|
+
isMobileDevice: undefined,
|
|
122
|
+
contentIndex: undefined,
|
|
123
|
+
},
|
|
124
|
+
);
|
|
125
|
+
|
|
126
|
+
const isFullImage = computed(
|
|
127
|
+
() =>
|
|
128
|
+
props.viewModel.displayStyle === 'right-aligned-full-image' ||
|
|
129
|
+
props.viewModel.displayStyle === 'left-aligned-full-image',
|
|
130
|
+
);
|
|
131
|
+
|
|
132
|
+
const isRightAligned = computed(
|
|
133
|
+
() =>
|
|
134
|
+
props.viewModel.displayStyle === 'right-aligned-full-image' ||
|
|
135
|
+
props.viewModel.displayStyle === 'right-aligned',
|
|
136
|
+
);
|
|
137
|
+
|
|
138
|
+
const isLeftAligned = computed(
|
|
139
|
+
() =>
|
|
140
|
+
props.viewModel.displayStyle === 'left-aligned-full-image' ||
|
|
141
|
+
props.viewModel.displayStyle === 'left-aligned',
|
|
142
|
+
);
|
|
143
|
+
|
|
144
|
+
const isDividedContent = computed(
|
|
145
|
+
() =>
|
|
146
|
+
props.viewModel.displayStyle === 'right-aligned' ||
|
|
147
|
+
props.viewModel.displayStyle === 'left-aligned',
|
|
148
|
+
);
|
|
149
|
+
|
|
150
|
+
const textAlignClass = computed(() => ({
|
|
151
|
+
'tw-text-center': props.viewModel.displayStyle === 'centered',
|
|
152
|
+
'tw-text-left': props.viewModel.displayStyle !== 'centered',
|
|
153
|
+
'tw-px-6': isFullImage.value,
|
|
154
|
+
}));
|
|
155
|
+
|
|
156
|
+
const renderText = computed((): string => {
|
|
157
|
+
if (!props.viewModel.paragraph) {
|
|
158
|
+
return '';
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
if (hasRTEContent(props.viewModel.paragraph)) {
|
|
162
|
+
return props.viewModel.paragraph;
|
|
163
|
+
} else {
|
|
164
|
+
return getRenderText(props.viewModel.paragraph);
|
|
165
|
+
}
|
|
166
|
+
});
|
|
110
167
|
</script>
|
|
111
168
|
<style scoped>
|
|
112
169
|
/* classes */
|
|
@@ -15,10 +15,14 @@
|
|
|
15
15
|
'tw-mb-4': !isCollapsed,
|
|
16
16
|
'hover:tw-cursor-pointer': canCollapse,
|
|
17
17
|
}"
|
|
18
|
-
:style="titleStyle"
|
|
19
18
|
@click="onHeaderToggleClick"
|
|
20
19
|
>
|
|
21
|
-
<
|
|
20
|
+
<TextWrapper
|
|
21
|
+
:text-style="titleStyle"
|
|
22
|
+
:text="title"
|
|
23
|
+
element="div"
|
|
24
|
+
class="tw-select-none"
|
|
25
|
+
/>
|
|
22
26
|
<div v-if="canCollapse" class="tw-absolute tw-top-0 tw-right-4">
|
|
23
27
|
<Icon
|
|
24
28
|
:style="arrowStyle"
|
|
@@ -38,10 +42,12 @@
|
|
|
38
42
|
<script>
|
|
39
43
|
import { Icon } from '@designcrowd/fe-shared-lib';
|
|
40
44
|
import CollapsibleMixin from './Collapsible.mixin.ts';
|
|
45
|
+
import TextWrapper from '../text-wrapper/TextWrapper.vue';
|
|
41
46
|
|
|
42
47
|
export default {
|
|
43
48
|
components: {
|
|
44
49
|
Icon,
|
|
50
|
+
TextWrapper,
|
|
45
51
|
},
|
|
46
52
|
mixins: [CollapsibleMixin],
|
|
47
53
|
};
|
|
@@ -26,6 +26,7 @@ import {
|
|
|
26
26
|
TEXT_ONLY,
|
|
27
27
|
} from '../../constants';
|
|
28
28
|
import { getRenderText } from '@brand-page/utils';
|
|
29
|
+
import { hasRTEContent } from '@brand-page-maker/utils';
|
|
29
30
|
import { useReCaptcha } from '../../composables/recaptcha.composable';
|
|
30
31
|
|
|
31
32
|
export interface FieldValue {
|
|
@@ -171,7 +172,11 @@ export default defineComponent({
|
|
|
171
172
|
return '';
|
|
172
173
|
}
|
|
173
174
|
|
|
174
|
-
|
|
175
|
+
if (hasRTEContent(this.viewModel.description)) {
|
|
176
|
+
return this.viewModel.description;
|
|
177
|
+
} else {
|
|
178
|
+
return getRenderText(this.viewModel.description);
|
|
179
|
+
}
|
|
175
180
|
},
|
|
176
181
|
|
|
177
182
|
renderSuccessText(): string {
|
|
@@ -179,7 +184,21 @@ export default defineComponent({
|
|
|
179
184
|
return '';
|
|
180
185
|
}
|
|
181
186
|
|
|
182
|
-
|
|
187
|
+
if (hasRTEContent(this.viewModel.successMessage)) {
|
|
188
|
+
return this.viewModel.successMessage;
|
|
189
|
+
} else {
|
|
190
|
+
return getRenderText(this.viewModel.successMessage);
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
|
|
194
|
+
successMessageColorStyle(): BrandPageCssStyle {
|
|
195
|
+
const color = this.viewModel.successMessageStyle?.color;
|
|
196
|
+
|
|
197
|
+
if (color) {
|
|
198
|
+
return { color };
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
return {};
|
|
183
202
|
},
|
|
184
203
|
},
|
|
185
204
|
watch: {
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
v-if="renderText"
|
|
38
38
|
:text-style="viewModel.descriptionStyle"
|
|
39
39
|
:text="renderText"
|
|
40
|
-
element="
|
|
40
|
+
element="div"
|
|
41
41
|
class="tw-text-center tw-mb-2 tw-text-base"
|
|
42
42
|
/>
|
|
43
43
|
<div v-if="!isSubmitting">
|
|
@@ -97,10 +97,9 @@
|
|
|
97
97
|
{{ submitError }}
|
|
98
98
|
</p>
|
|
99
99
|
</form>
|
|
100
|
-
<div v-else>
|
|
100
|
+
<div v-else :style="successMessageColorStyle">
|
|
101
101
|
<TextWrapper
|
|
102
102
|
v-if="viewModel.successMessage"
|
|
103
|
-
:text-style="viewModel.messageTextColor"
|
|
104
103
|
:text="renderSuccessText"
|
|
105
104
|
element="p"
|
|
106
105
|
:class="'tw-text-center tw-font-bold tw-my-0.5'"
|
|
@@ -125,14 +124,14 @@
|
|
|
125
124
|
v-if="viewModel.title"
|
|
126
125
|
:text-style="viewModel.titleStyle"
|
|
127
126
|
:text="viewModel.title"
|
|
128
|
-
element="
|
|
127
|
+
element="div"
|
|
129
128
|
class="tw-text-center tw-mb-4 tw-text-base"
|
|
130
129
|
/>
|
|
131
130
|
<TextWrapper
|
|
132
131
|
v-if="renderText"
|
|
133
132
|
:text-style="viewModel.descriptionStyle"
|
|
134
133
|
:text="renderText"
|
|
135
|
-
element="
|
|
134
|
+
element="div"
|
|
136
135
|
class="tw-text-center tw-mb-4 tw-text-base"
|
|
137
136
|
/>
|
|
138
137
|
<div v-if="!isSubmitting" class="tw-grid tw-grid-cols-2 tw-gap-4">
|
|
@@ -199,10 +198,9 @@
|
|
|
199
198
|
{{ submitError }}
|
|
200
199
|
</p>
|
|
201
200
|
</form>
|
|
202
|
-
<div v-else>
|
|
201
|
+
<div v-else :style="successMessageColorStyle">
|
|
203
202
|
<TextWrapper
|
|
204
203
|
v-if="viewModel.successMessage"
|
|
205
|
-
:text-style="viewModel.messageTextColor"
|
|
206
204
|
:text="renderSuccessText"
|
|
207
205
|
element="p"
|
|
208
206
|
:class="'tw-text-center tw-font-bold tw-my-0.5'"
|
|
@@ -226,14 +224,14 @@
|
|
|
226
224
|
v-if="viewModel.title"
|
|
227
225
|
:text-style="viewModel.titleStyle"
|
|
228
226
|
:text="viewModel.title"
|
|
229
|
-
element="
|
|
227
|
+
element="div"
|
|
230
228
|
class="tw-text-center tw-mb-4 tw-text-base"
|
|
231
229
|
/>
|
|
232
230
|
<TextWrapper
|
|
233
231
|
v-if="renderText"
|
|
234
232
|
:text-style="viewModel.descriptionStyle"
|
|
235
233
|
:text="renderText"
|
|
236
|
-
element="
|
|
234
|
+
element="div"
|
|
237
235
|
class="tw-text-center tw-mb-4 tw-text-base"
|
|
238
236
|
/>
|
|
239
237
|
</div>
|
|
@@ -310,10 +308,13 @@
|
|
|
310
308
|
class="tw-w-full tw-flex tw-justify-center tw-col-span-2"
|
|
311
309
|
/>
|
|
312
310
|
</span>
|
|
313
|
-
<div
|
|
311
|
+
<div
|
|
312
|
+
v-else
|
|
313
|
+
class="tw-w-full tw-flex tw-justify-center"
|
|
314
|
+
:style="successMessageColorStyle"
|
|
315
|
+
>
|
|
314
316
|
<TextWrapper
|
|
315
317
|
v-if="viewModel.successMessage"
|
|
316
|
-
:text-style="viewModel.messageTextColor"
|
|
317
318
|
:text="renderSuccessText"
|
|
318
319
|
element="p"
|
|
319
320
|
:class="'tw-text-center tw-font-bold tw-my-0.5'"
|
|
@@ -357,14 +358,14 @@
|
|
|
357
358
|
v-if="viewModel.title && !isSubmitting"
|
|
358
359
|
:text-style="viewModel.titleStyle"
|
|
359
360
|
:text="viewModel.title"
|
|
360
|
-
element="
|
|
361
|
+
element="div"
|
|
361
362
|
class="tw-w-full tw-mb-2"
|
|
362
363
|
/>
|
|
363
364
|
<TextWrapper
|
|
364
365
|
v-if="renderText"
|
|
365
366
|
:text-style="viewModel.descriptionStyle"
|
|
366
367
|
:text="renderText"
|
|
367
|
-
element="
|
|
368
|
+
element="div"
|
|
368
369
|
class="tw-text-center tw-mb-4 tw-text-base"
|
|
369
370
|
/>
|
|
370
371
|
<form @submit.prevent="submitContactForm">
|
|
@@ -437,10 +438,9 @@
|
|
|
437
438
|
</p>
|
|
438
439
|
</form>
|
|
439
440
|
</span>
|
|
440
|
-
<div v-else>
|
|
441
|
+
<div v-else :style="successMessageColorStyle">
|
|
441
442
|
<TextWrapper
|
|
442
443
|
v-if="viewModel.successMessage"
|
|
443
|
-
:text-style="viewModel.messageTextColor"
|
|
444
444
|
:text="renderSuccessText"
|
|
445
445
|
element="p"
|
|
446
446
|
:class="'tw-text-center tw-font-bold tw-my-0.5'"
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
</div>
|
|
16
16
|
</template>
|
|
17
17
|
<script setup lang="ts">
|
|
18
|
-
import { hasRTEContent } from '@brand-page-maker/utils';
|
|
18
|
+
import { hasRTEContent, getPlainTextFromRTE } from '@brand-page-maker/utils';
|
|
19
19
|
import {
|
|
20
20
|
type FluidTextData,
|
|
21
21
|
type TextStyleDeclaration,
|
|
@@ -77,6 +77,10 @@ const isRTEContent = computed(() => {
|
|
|
77
77
|
});
|
|
78
78
|
|
|
79
79
|
const sanitizeText = computed(() => {
|
|
80
|
+
if (isRTEContent.value && !getPlainTextFromRTE(props.text)) {
|
|
81
|
+
return '';
|
|
82
|
+
}
|
|
83
|
+
|
|
80
84
|
return props.text;
|
|
81
85
|
});
|
|
82
86
|
|
|
@@ -387,7 +387,7 @@ export interface ContactFormContent extends Content {
|
|
|
387
387
|
descriptionStyle?: TextStyleDeclaration;
|
|
388
388
|
buttonTextStyle?: TextStyleDeclaration;
|
|
389
389
|
backgroundStyle?: BrandPageCssStyle;
|
|
390
|
-
|
|
390
|
+
successMessageStyle?: TextStyleDeclaration;
|
|
391
391
|
cardStyle?: BrandPageCssStyle;
|
|
392
392
|
colorReplacements?: ColorReplacement[];
|
|
393
393
|
mediaType?: string;
|
|
@@ -446,7 +446,7 @@ exports[`migration.util > Banner Contents - text Align and Font Family should no
|
|
|
446
446
|
},
|
|
447
447
|
},
|
|
448
448
|
},
|
|
449
|
-
"v":
|
|
449
|
+
"v": 14,
|
|
450
450
|
},
|
|
451
451
|
"useOldLogoRenderSize": true,
|
|
452
452
|
}
|
|
@@ -881,7 +881,7 @@ exports[`migration.util > migrateBrandPageModel should return brand page model w
|
|
|
881
881
|
},
|
|
882
882
|
},
|
|
883
883
|
},
|
|
884
|
-
"v":
|
|
884
|
+
"v": 14,
|
|
885
885
|
},
|
|
886
886
|
"useOldLogoRenderSize": true,
|
|
887
887
|
}
|
|
@@ -1323,7 +1323,7 @@ exports[`migration.util > migrateBrandPageModel should return brand page model w
|
|
|
1323
1323
|
},
|
|
1324
1324
|
},
|
|
1325
1325
|
},
|
|
1326
|
-
"v":
|
|
1326
|
+
"v": 14,
|
|
1327
1327
|
},
|
|
1328
1328
|
"useOldLogoRenderSize": true,
|
|
1329
1329
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { MigrationData } from '../migration.util';
|
|
2
|
+
import { isContact } from '../model.util';
|
|
3
|
+
|
|
4
|
+
export const migration14 = async (
|
|
5
|
+
migrationResult: MigrationData,
|
|
6
|
+
): Promise<MigrationData> => {
|
|
7
|
+
const { brandPageModel } = migrationResult;
|
|
8
|
+
|
|
9
|
+
brandPageModel.pages.forEach((page) => {
|
|
10
|
+
page.contents.forEach((content) => {
|
|
11
|
+
if (isContact(content)) {
|
|
12
|
+
const contactForm = content as any;
|
|
13
|
+
|
|
14
|
+
if ('messageTextColor' in contactForm) {
|
|
15
|
+
contactForm.successMessageStyle = contactForm.messageTextColor;
|
|
16
|
+
delete contactForm.messageTextColor;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
return migrationResult;
|
|
23
|
+
};
|
|
@@ -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
|
|
|
20
21
|
export interface MigrationData {
|
|
21
22
|
brandPageModel: BrandPageModel;
|
|
@@ -128,6 +129,12 @@ const MIGRATION_TABLE = [
|
|
|
128
129
|
migrateFn: migration13,
|
|
129
130
|
description: 'Migrating old page navigation refererences to use page ids',
|
|
130
131
|
},
|
|
132
|
+
{
|
|
133
|
+
version: 14,
|
|
134
|
+
migrateFn: migration14,
|
|
135
|
+
description:
|
|
136
|
+
'Renaming messageTextColor to successMessageStyle on contact form content',
|
|
137
|
+
},
|
|
131
138
|
] as MigrationTableItem[];
|
|
132
139
|
|
|
133
140
|
export const GetLatestModelVersion = () =>
|
|
@@ -405,7 +405,14 @@ const CONTENT_STYLE_PROP_NAME_SUFFIX = [
|
|
|
405
405
|
'Replacements',
|
|
406
406
|
];
|
|
407
407
|
|
|
408
|
-
const RTE_ALLOWED_FIELDS = [
|
|
408
|
+
const RTE_ALLOWED_FIELDS = [
|
|
409
|
+
'title',
|
|
410
|
+
'description',
|
|
411
|
+
'text',
|
|
412
|
+
'textItems',
|
|
413
|
+
'paragraph',
|
|
414
|
+
'successMessage',
|
|
415
|
+
];
|
|
409
416
|
|
|
410
417
|
export const applyLogoThemeToContents = (
|
|
411
418
|
logoTheme: LogoTheme,
|
|
@@ -20,5 +20,30 @@ export const escapeContentText = (
|
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
export const unescapeContentText = (text: string): string => {
|
|
23
|
-
return text
|
|
23
|
+
return text
|
|
24
|
+
.replace(new RegExp(`${ESCAPED_NEWLINE_CHARACTER}`, 'g'), '\n')
|
|
25
|
+
.replace(/</g, '<')
|
|
26
|
+
.replace(/>/g, '>')
|
|
27
|
+
.replace(/&/g, '&');
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const encodeContentText = (
|
|
31
|
+
text: string | undefined,
|
|
32
|
+
): string | undefined => {
|
|
33
|
+
if (!text) {
|
|
34
|
+
return text;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return text
|
|
38
|
+
.replace(/&/g, '&')
|
|
39
|
+
.replace(/</g, '<')
|
|
40
|
+
.replace(/>/g, '>')
|
|
41
|
+
.replace(/(\r\n|\r|\n)/g, ESCAPED_NEWLINE_CHARACTER);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export const decodeHtmlEntities = (text: string): string => {
|
|
45
|
+
return text
|
|
46
|
+
.replace(/</g, '<')
|
|
47
|
+
.replace(/>/g, '>')
|
|
48
|
+
.replace(/&/g, '&');
|
|
24
49
|
};
|
|
@@ -56,6 +56,7 @@
|
|
|
56
56
|
/>
|
|
57
57
|
</div>
|
|
58
58
|
<div
|
|
59
|
+
v-bind="attrs"
|
|
59
60
|
data-component="rich-text-editor"
|
|
60
61
|
class="rich-text-editor tw-border tw-border-solid tw-border-grayscale-500 tw-rounded"
|
|
61
62
|
>
|
|
@@ -381,7 +382,7 @@
|
|
|
381
382
|
</div>
|
|
382
383
|
</div>
|
|
383
384
|
</div>
|
|
384
|
-
<div class="tw-relative">
|
|
385
|
+
<div class="tw-relative" :class="{ 'editor-compact': isCompact }">
|
|
385
386
|
<BubbleMenu
|
|
386
387
|
:editor="editor"
|
|
387
388
|
:tippy-options="tippyOptions"
|
|
@@ -965,6 +966,9 @@ const {
|
|
|
965
966
|
selectedLinkType,
|
|
966
967
|
);
|
|
967
968
|
|
|
969
|
+
const COMPACT_FIELD_NAMES = ['title', 'name'];
|
|
970
|
+
const isCompact = computed(() => COMPACT_FIELD_NAMES.includes(props.name));
|
|
971
|
+
|
|
968
972
|
const isExternalLink = computed(() => {
|
|
969
973
|
const href = editor.getAttributes('link').href;
|
|
970
974
|
return href && (href.startsWith('http://') || href.startsWith('https://'));
|
|
@@ -1091,6 +1095,10 @@ const getSlugFromPageIdHref = (href: string): string => {
|
|
|
1091
1095
|
@apply tw-max-h-56 tw-overflow-auto;
|
|
1092
1096
|
}
|
|
1093
1097
|
|
|
1098
|
+
.editor-compact ::v-deep .ProseMirror {
|
|
1099
|
+
@apply tw-min-h-24;
|
|
1100
|
+
}
|
|
1101
|
+
|
|
1094
1102
|
::v-deep .ProseMirror:focus {
|
|
1095
1103
|
outline: none;
|
|
1096
1104
|
}
|
|
@@ -656,7 +656,7 @@ export const useRichTextEditor = (
|
|
|
656
656
|
selectedTextStyle ?? selectedGlobalTextStyles.value?.style;
|
|
657
657
|
|
|
658
658
|
if (globalStyles) {
|
|
659
|
-
globalStyles.fontWeight && toggleBoldAll();
|
|
659
|
+
globalStyles.fontWeight === 'bold' && toggleBoldAll();
|
|
660
660
|
globalStyles.fontStyle && toggleItalicAll();
|
|
661
661
|
globalStyles.textDecoration?.includes('underline') &&
|
|
662
662
|
toggleUnderlineAll();
|
|
@@ -2153,6 +2153,7 @@ export const CONTACT_FORM_SETTINGS_CONFIG =
|
|
|
2153
2153
|
placeholder: contentSettingsTr(`successMessagePlaceholder`),
|
|
2154
2154
|
title: contentSettingsTr(`successMessageTitle`),
|
|
2155
2155
|
groupId: CONTACT_FORM_GROUPS.settings,
|
|
2156
|
+
maxLength: 1000,
|
|
2156
2157
|
},
|
|
2157
2158
|
responseEmail: {
|
|
2158
2159
|
type: 'email',
|
|
@@ -2192,16 +2193,6 @@ export const CONTACT_FORM_SETTINGS_CONFIG =
|
|
|
2192
2193
|
title: contentSettingsTr(`backgroundColorTitle`),
|
|
2193
2194
|
valueConvertor: backgroundColorConvertor,
|
|
2194
2195
|
},
|
|
2195
|
-
messageTextColor: {
|
|
2196
|
-
type: 'color',
|
|
2197
|
-
groupId: CONTACT_FORM_GROUPS.style,
|
|
2198
|
-
defaultValue: {},
|
|
2199
|
-
isInline: true,
|
|
2200
|
-
showToggle: false,
|
|
2201
|
-
disableTransparent: true,
|
|
2202
|
-
title: contentSettingsTr(`successMessageTextColorTitle`),
|
|
2203
|
-
valueConvertor: colorConvertor,
|
|
2204
|
-
},
|
|
2205
2196
|
},
|
|
2206
2197
|
isEnabled: true,
|
|
2207
2198
|
isLocked: (features) => !features.canAddContactFormContents,
|