@designcrowd/library.brand-page 5.17.21-ast-bugs → 5.17.21
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-BZf1Z-Ho.js → CreatedOnBrandCrowd-de-de-Brtp2yWB.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-en-us-BIH5PQbq.js → CreatedOnBrandCrowd-en-us-BIJ5VoX4.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-es-es-B0PasijA.js → CreatedOnBrandCrowd-es-es-JrKK9K0u.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-fr-DPKgPGHP.js → CreatedOnBrandCrowd-fr-ca-D_HvOZe-.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-ca-DPKgPGHP.js → CreatedOnBrandCrowd-fr-fr-D_HvOZe-.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-pt-D-TiqOOV.js → CreatedOnBrandCrowd-pt-br-SSLb0vlp.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-br-D-TiqOOV.js → CreatedOnBrandCrowd-pt-pt-SSLb0vlp.js} +1 -1
- package/lib/src/{CreatedOnDcom-de-de-C2OpWVVd.js → CreatedOnDcom-de-de-BG39ozFo.js} +1 -1
- package/lib/src/{CreatedOnDcom-en-us-BqKkc9GD.js → CreatedOnDcom-en-us-D2NzqECZ.js} +1 -1
- package/lib/src/{CreatedOnDcom-es-es-BXd-ohEb.js → CreatedOnDcom-es-es-C55r2Lb4.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-ca-Kx-61xKG.js → CreatedOnDcom-fr-ca-Bj-sAaJI.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-fr-CfTi-OlD.js → CreatedOnDcom-fr-fr-D8l0r-Tc.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-br-BU3tYJor.js → CreatedOnDcom-pt-br-CXHC6E1h.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-pt-Dc5RNYAJ.js → CreatedOnDcom-pt-pt-2dMvgnyi.js} +1 -1
- package/lib/src/brand-page/utils/text.util.d.ts +0 -2
- package/lib/src/brand-page/utils/text.util.js +1 -21
- package/lib/src/css/library.brand-page-brandCrowd.min.css +1 -1
- package/lib/src/css/library.brand-page-brandPage.min.css +1 -1
- package/lib/src/css/library.brand-page-designCom.min.css +1 -1
- package/lib/src/css/library.brand-page-preview.min.css +1 -1
- package/lib/src/index.mjs +1 -1
- package/lib/src/{lib-WqnzkNPP.js → lib-CrBvj1a5.js} +12862 -12870
- package/lib/src/shared/content-settings/components/GenericTextInput.mixin.js +5 -10
- 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 +0 -1
- package/lib/src/shared/style-settings/components/StyleSettings.mixin.js +0 -8
- package/package.json +1 -1
- package/src/brand-page/utils/text.util.ts +1 -26
- package/src/shared/content-settings/components/GenericTextInput.mixin.ts +5 -16
- package/src/shared/content-settings/components/testimonial-items-field/TestimonialItemsField.vue +1 -3
- package/src/shared/content-settings/components/text-items-field/TextItemsField.mixin.ts +3 -3
- package/src/shared/style-settings/components/StyleSettings.mixin.ts +0 -11
- package/src/shared/style-settings/components/StyleSettings.vue +1 -1
|
@@ -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 {
|
|
4
|
+
import { 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,13 +119,7 @@ export default defineComponent({
|
|
|
119
119
|
if (this.value === false) {
|
|
120
120
|
return false;
|
|
121
121
|
}
|
|
122
|
-
|
|
123
|
-
return '';
|
|
124
|
-
}
|
|
125
|
-
if (this.showRichTextEditor) {
|
|
126
|
-
return this.value;
|
|
127
|
-
}
|
|
128
|
-
return unescapeContentText(this.value);
|
|
122
|
+
return this.value ? unescapeContentText(this.value) : '';
|
|
129
123
|
},
|
|
130
124
|
set(newVal) {
|
|
131
125
|
if (newVal === false) {
|
|
@@ -133,10 +127,11 @@ export default defineComponent({
|
|
|
133
127
|
}
|
|
134
128
|
else {
|
|
135
129
|
if (this.showRichTextEditor) {
|
|
130
|
+
// Todo: re-visit this while working on content senatization
|
|
136
131
|
this._value = newVal;
|
|
137
132
|
}
|
|
138
133
|
else {
|
|
139
|
-
this._value =
|
|
134
|
+
this._value = escapeContentText(newVal);
|
|
140
135
|
}
|
|
141
136
|
}
|
|
142
137
|
this.emitChangeDebounce && this.emitChangeDebounce();
|
|
@@ -166,7 +161,7 @@ export default defineComponent({
|
|
|
166
161
|
},
|
|
167
162
|
showRichTextEditor(newVal) {
|
|
168
163
|
if (!newVal && this._value && typeof this._value === 'string') {
|
|
169
|
-
this._value =
|
|
164
|
+
this._value = escapeContentText(this._value);
|
|
170
165
|
this.emitChange();
|
|
171
166
|
}
|
|
172
167
|
},
|
|
@@ -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 {
|
|
5
|
+
import { 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
|
|
105
|
+
return escapeContentText(text) ?? '';
|
|
106
106
|
}
|
|
107
|
-
return
|
|
107
|
+
return text;
|
|
108
108
|
},
|
|
109
109
|
emitChange() {
|
|
110
110
|
const payload = {
|
|
@@ -989,7 +989,6 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
989
989
|
colorPickerValue(): (option: ButtonStyleConfigOption) => any;
|
|
990
990
|
isRenderedInStorybook(): boolean;
|
|
991
991
|
isWidthToggled(): boolean;
|
|
992
|
-
filteredButtonStyleOptions(): ButtonStyleConfigOption[];
|
|
993
992
|
brandName(): "Design.com" | "BrandCrowd";
|
|
994
993
|
hideText(): any;
|
|
995
994
|
}, {
|
|
@@ -78,14 +78,6 @@ 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
|
-
},
|
|
89
81
|
brandName() {
|
|
90
82
|
return this.isDesignCom ? 'Design.com' : 'BrandCrowd';
|
|
91
83
|
},
|
package/package.json
CHANGED
|
@@ -20,30 +20,5 @@ export const escapeContentText = (
|
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
export const unescapeContentText = (text: string): string => {
|
|
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, '&');
|
|
23
|
+
return text.replace(new RegExp(`${ESCAPED_NEWLINE_CHARACTER}`, 'g'), '\n');
|
|
49
24
|
};
|
|
@@ -4,11 +4,7 @@ import debounce from 'lodash.debounce';
|
|
|
4
4
|
import type { PropType } from 'vue';
|
|
5
5
|
import { TextInput, Textarea } from '@designcrowd/fe-shared-lib';
|
|
6
6
|
import type { ContentItemFieldSettings } from '../models';
|
|
7
|
-
import {
|
|
8
|
-
encodeContentText,
|
|
9
|
-
escapeContentText,
|
|
10
|
-
unescapeContentText,
|
|
11
|
-
} from '@brand-page/utils';
|
|
7
|
+
import { escapeContentText, unescapeContentText } from '@brand-page/utils';
|
|
12
8
|
import { genericTextInputTr } from '@src/composables/useTranslate';
|
|
13
9
|
|
|
14
10
|
const DEBOUNCE_WAIT_MS = 100;
|
|
@@ -133,24 +129,17 @@ export default defineComponent({
|
|
|
133
129
|
return false;
|
|
134
130
|
}
|
|
135
131
|
|
|
136
|
-
|
|
137
|
-
return '';
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
if (this.showRichTextEditor) {
|
|
141
|
-
return this.value;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
return unescapeContentText(this.value);
|
|
132
|
+
return this.value ? unescapeContentText(this.value) : '';
|
|
145
133
|
},
|
|
146
134
|
set(newVal: string | false): void {
|
|
147
135
|
if (newVal === false) {
|
|
148
136
|
this._value = false;
|
|
149
137
|
} else {
|
|
150
138
|
if (this.showRichTextEditor) {
|
|
139
|
+
// Todo: re-visit this while working on content senatization
|
|
151
140
|
this._value = newVal;
|
|
152
141
|
} else {
|
|
153
|
-
this._value =
|
|
142
|
+
this._value = escapeContentText(newVal);
|
|
154
143
|
}
|
|
155
144
|
}
|
|
156
145
|
|
|
@@ -184,7 +173,7 @@ export default defineComponent({
|
|
|
184
173
|
|
|
185
174
|
showRichTextEditor(newVal: boolean) {
|
|
186
175
|
if (!newVal && this._value && typeof this._value === 'string') {
|
|
187
|
-
this._value =
|
|
176
|
+
this._value = escapeContentText(this._value);
|
|
188
177
|
this.emitChange();
|
|
189
178
|
}
|
|
190
179
|
},
|
package/src/shared/content-settings/components/testimonial-items-field/TestimonialItemsField.vue
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
>
|
|
10
10
|
<template #preview="option">
|
|
11
11
|
<p class="tw-w-full testimonial-preview">
|
|
12
|
-
{{
|
|
12
|
+
{{ option.item.testimonials }}
|
|
13
13
|
</p>
|
|
14
14
|
</template>
|
|
15
15
|
<template #form="option">
|
|
@@ -209,7 +209,6 @@ import GenerateAiButton from '../generate-ai-button/GenerateAiButton.vue';
|
|
|
209
209
|
import { testimonialItemsFieldTr } from '@src/composables/useTranslate';
|
|
210
210
|
import { getCtaLocationFromFieldType } from '@brand-page-maker/utils/mixpanel.util';
|
|
211
211
|
import PersonalisationOverrideField from '../../../content-settings/components/personalisation-override-field/PersonalisationOverrideField.vue';
|
|
212
|
-
import { decodeHtmlEntities } from '@brand-page/utils';
|
|
213
212
|
|
|
214
213
|
export default {
|
|
215
214
|
components: {
|
|
@@ -227,7 +226,6 @@ export default {
|
|
|
227
226
|
return {
|
|
228
227
|
testimonialItemsFieldTr,
|
|
229
228
|
getCtaLocationFromFieldType,
|
|
230
|
-
decodeHtmlEntities,
|
|
231
229
|
};
|
|
232
230
|
},
|
|
233
231
|
};
|
|
@@ -17,7 +17,7 @@ import type { DebounceHandle } from 'lodash.debounce';
|
|
|
17
17
|
import debounce from 'lodash.debounce';
|
|
18
18
|
import type { UpdateItemValuePayload } from '../../models';
|
|
19
19
|
import cloneDeep from 'lodash.clonedeep';
|
|
20
|
-
import {
|
|
20
|
+
import { escapeContentText } from '@brand-page/utils';
|
|
21
21
|
import { useSnapshotStore } from '@brand-page-maker/stores';
|
|
22
22
|
import { getPlainTextFromRTE, replaceTextInRTE } from '@brand-page-maker/utils';
|
|
23
23
|
import { isDefaultContentText } from '../../utils';
|
|
@@ -125,10 +125,10 @@ export default defineComponent({
|
|
|
125
125
|
},
|
|
126
126
|
getItemTextPreview(text: string): string {
|
|
127
127
|
if (this.showRichTextEditor) {
|
|
128
|
-
return
|
|
128
|
+
return escapeContentText(text) ?? '';
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
-
return
|
|
131
|
+
return text;
|
|
132
132
|
},
|
|
133
133
|
emitChange(): void {
|
|
134
134
|
const payload: UpdateItemValuePayload<TextItem[]> = {
|
|
@@ -114,17 +114,6 @@ export default defineComponent({
|
|
|
114
114
|
isWidthToggled() {
|
|
115
115
|
return this.brandPageType === 'brandSite';
|
|
116
116
|
},
|
|
117
|
-
filteredButtonStyleOptions(): ButtonStyleConfigOption[] {
|
|
118
|
-
if (!this.selectedButtonStyleConfig) return [];
|
|
119
|
-
|
|
120
|
-
if (this.brandPageType === 'brandSite') {
|
|
121
|
-
return this.selectedButtonStyleConfig.options.filter(
|
|
122
|
-
(o) => o !== 'buttonIconColor',
|
|
123
|
-
);
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
return this.selectedButtonStyleConfig.options;
|
|
127
|
-
},
|
|
128
117
|
brandName() {
|
|
129
118
|
return this.isDesignCom ? 'Design.com' : 'BrandCrowd';
|
|
130
119
|
},
|
|
@@ -195,7 +195,7 @@
|
|
|
195
195
|
<!-- Start Button options -->
|
|
196
196
|
<div v-if="selectedButtonStyleConfig">
|
|
197
197
|
<div
|
|
198
|
-
v-for="(option, optionIndex) in
|
|
198
|
+
v-for="(option, optionIndex) in selectedButtonStyleConfig.options"
|
|
199
199
|
:key="optionIndex"
|
|
200
200
|
class="tw-mb-4 tw-flex tw-justify-between"
|
|
201
201
|
:class="{
|