@designcrowd/library.brand-page 5.14.11 → 5.14.12
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-BJ3Foxao.js → CreatedOnBrandCrowd-de-de-C5tl1NwD.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-en-us-BjI_fxWY.js → CreatedOnBrandCrowd-en-us-C7J2vGwU.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-es-es-Dt8190BK.js → CreatedOnBrandCrowd-es-es-IREekVx2.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-fr-Ck6zCiIn.js → CreatedOnBrandCrowd-fr-fr-EJkAJ0iH.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-pt-CaNvmzQJ.js → CreatedOnBrandCrowd-pt-pt-mKBH6Ary.js} +1 -1
- package/lib/src/{CreatedOnDcom-de-de-DMEecXw8.js → CreatedOnDcom-de-de-CWWw2LBb.js} +1 -1
- package/lib/src/{CreatedOnDcom-en-us-BZIPLMxJ.js → CreatedOnDcom-en-us-Db6zzKtc.js} +1 -1
- package/lib/src/{CreatedOnDcom-es-es-D6ey1TnI.js → CreatedOnDcom-es-es-CsMu_iBW.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-fr-NaeiDsv-.js → CreatedOnDcom-fr-fr-oJRc8eop.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-pt-BwEUUii2.js → CreatedOnDcom-pt-pt-CQ_otC6l.js} +1 -1
- package/lib/src/brand-page/components/button/Button.mixin.js +4 -2
- package/lib/src/brand-page/models/index.d.ts +9 -2
- package/lib/src/brand-page/utils/migration/migration-06.d.ts +2 -0
- package/lib/src/brand-page/utils/migration/migration-06.js +48 -0
- package/lib/src/brand-page/utils/migration.util.js +6 -0
- package/lib/src/brand-page/utils/view-model.util.js +49 -11
- package/lib/src/brand-page/view-models.d.ts +10 -3
- package/lib/src/brand-page-maker/constants/config-settings-constant.js +8 -1
- package/lib/src/brand-page-maker/models/content-settings.js +7 -1
- package/lib/src/{bundled-translations-B54196Rf.js → bundled-translations-fWikWTfa.js} +15 -15
- package/lib/src/{bundled-translations.de-DE-CNESUsYJ.js → bundled-translations.de-DE-CwtsRCCr.js} +33 -33
- package/lib/src/{bundled-translations.es-ES-FWge029M.js → bundled-translations.es-ES-DELCLCbF.js} +9 -9
- package/lib/src/{bundled-translations.fr-CA-DlWfm29N.js → bundled-translations.fr-CA-PDBhYlx8.js} +17 -17
- package/lib/src/{bundled-translations.fr-FR-DRCMzVfh.js → bundled-translations.fr-FR-OuZj3i-r.js} +24 -24
- package/lib/src/{bundled-translations.pt-BR-llUnBWoL.js → bundled-translations.pt-BR-RPfprZOm.js} +36 -36
- package/lib/src/{bundled-translations.pt-PT-K74Dt682.js → bundled-translations.pt-PT-DF_GCXSl.js} +5 -5
- package/lib/src/bundles/bundled-translations.de-DE.json +18 -2
- package/lib/src/bundles/bundled-translations.es-ES.json +18 -2
- package/lib/src/bundles/bundled-translations.fr-CA.json +18 -2
- package/lib/src/bundles/bundled-translations.fr-FR.json +18 -2
- package/lib/src/bundles/bundled-translations.json +18 -2
- package/lib/src/bundles/bundled-translations.pt-BR.json +18 -2
- package/lib/src/bundles/bundled-translations.pt-PT.json +18 -2
- package/lib/src/css/library.brand-page-brandCrowd.min.css +31 -28
- package/lib/src/css/library.brand-page-brandPage.min.css +31 -28
- package/lib/src/css/library.brand-page-designCom.min.css +31 -28
- package/lib/src/css/library.brand-page-preview.min.css +31 -28
- package/lib/src/index.mjs +1 -1
- package/lib/src/{lib-C0mkZ8UD.js → lib-CwoD7AhY.js} +26687 -26581
- package/lib/src/shared/content-settings/components/items-field/ItemsField.mixin.d.ts +3 -3
- package/lib/src/shared/content-settings/components/items-field/ItemsField.mixin.js +3 -3
- package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.d.ts +2 -2
- package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.d.ts +2 -2
- package/package.json +1 -1
- package/src/brand-page/components/button/Button.mixin.ts +4 -2
- package/src/brand-page/components/fallback-image/FallbackImage.vue +1 -1
- package/src/brand-page/components/image/Image.vue +1 -1
- package/src/brand-page/components/images-section/ImagesSection.test.ts +230 -0
- package/src/brand-page/components/images-section/ImagesSection.vue +185 -18
- package/src/brand-page/components/shapes-section/ShapesSection.vue +19 -9
- package/src/brand-page/components/text-media-section/TextMediaSection.vue +166 -7
- package/src/brand-page/models/index.ts +10 -2
- package/src/brand-page/utils/__snapshots__/migration.util.test.ts.snap +3 -3
- package/src/brand-page/utils/migration/migration-06.ts +64 -0
- package/src/brand-page/utils/migration.util.ts +6 -0
- package/src/brand-page/utils/view-model.util.ts +62 -13
- package/src/brand-page/view-models.ts +8 -2
- package/src/brand-page-maker/constants/config-settings-constant.ts +7 -1
- package/src/brand-page-maker/models/content-settings.ts +7 -1
- package/src/bundles/bundled-translations.de-DE.json +18 -2
- package/src/bundles/bundled-translations.es-ES.json +18 -2
- package/src/bundles/bundled-translations.fr-CA.json +18 -2
- package/src/bundles/bundled-translations.fr-FR.json +18 -2
- package/src/bundles/bundled-translations.json +18 -2
- package/src/bundles/bundled-translations.pt-BR.json +18 -2
- package/src/bundles/bundled-translations.pt-PT.json +18 -2
- package/src/shared/content-settings/components/button-configuration-field/ButtonConfigurationField.vue +283 -0
- package/src/shared/content-settings/components/content-settings/i18n/content-settings.de-DE.json +1 -0
- package/src/shared/content-settings/components/content-settings/i18n/content-settings.es-ES.json +1 -0
- package/src/shared/content-settings/components/content-settings/i18n/content-settings.fr-CA.json +1 -0
- package/src/shared/content-settings/components/content-settings/i18n/content-settings.fr-FR.json +1 -0
- package/src/shared/content-settings/components/content-settings/i18n/content-settings.json +1 -0
- package/src/shared/content-settings/components/content-settings/i18n/content-settings.pt-BR.json +1 -0
- package/src/shared/content-settings/components/content-settings/i18n/content-settings.pt-PT.json +1 -0
- package/src/shared/content-settings/components/items-field/ItemsField.mixin.ts +3 -3
- package/src/shared/content-settings/components/text-image-field/TextImageField.vue +428 -92
- package/src/shared/content-settings/components/text-image-field/i18n/text-image-field.de-DE.json +18 -3
- package/src/shared/content-settings/components/text-image-field/i18n/text-image-field.es-ES.json +18 -3
- package/src/shared/content-settings/components/text-image-field/i18n/text-image-field.fr-CA.json +18 -3
- package/src/shared/content-settings/components/text-image-field/i18n/text-image-field.fr-FR.json +18 -3
- package/src/shared/content-settings/components/text-image-field/i18n/text-image-field.json +18 -2
- package/src/shared/content-settings/components/text-image-field/i18n/text-image-field.pt-BR.json +18 -3
- package/src/shared/content-settings/components/text-image-field/i18n/text-image-field.pt-PT.json +18 -3
- package/lib/src/brand-page/components/images-section/ImagesSection.mixin.d.ts +0 -86
- package/lib/src/brand-page/components/images-section/ImagesSection.mixin.js +0 -149
- package/lib/src/brand-page/components/shapes-section/ShapesSection.mixin.d.ts +0 -62
- package/lib/src/brand-page/components/shapes-section/ShapesSection.mixin.js +0 -25
- package/lib/src/brand-page/components/text-media-section/TextMediaSection.mixin.d.ts +0 -66
- package/lib/src/brand-page/components/text-media-section/TextMediaSection.mixin.js +0 -90
- package/lib/src/shared/content-settings/components/text-image-field/TextImageField.mixin.d.ts +0 -126
- package/lib/src/shared/content-settings/components/text-image-field/TextImageField.mixin.js +0 -192
- package/src/brand-page/components/images-section/ImagesSection.mixin.ts +0 -183
- package/src/brand-page/components/shapes-section/ShapesSection.mixin.ts +0 -29
- package/src/brand-page/components/text-media-section/TextMediaSection.mixin.ts +0 -124
- package/src/shared/content-settings/components/text-image-field/TextImageField.mixin.ts +0 -252
|
@@ -1,252 +0,0 @@
|
|
|
1
|
-
import { defineComponent } from 'vue';
|
|
2
|
-
import type { PropType } from 'vue';
|
|
3
|
-
import type {
|
|
4
|
-
ColorReplacement,
|
|
5
|
-
LogoTheme,
|
|
6
|
-
TextMediaItem,
|
|
7
|
-
TextShapeItem,
|
|
8
|
-
Content,
|
|
9
|
-
ImagesSectionContent,
|
|
10
|
-
} from '../../../../brand-page';
|
|
11
|
-
import {
|
|
12
|
-
MAX_DESCRIPTION_LENGTH,
|
|
13
|
-
MAX_LENGTH_ERROR_MESSAGE,
|
|
14
|
-
MAX_TITLE_LENGTH,
|
|
15
|
-
INVALID_URL_MESSAGE,
|
|
16
|
-
BRAND_PAGE_TYPES,
|
|
17
|
-
ALIGN_LEFT_ALIGNED,
|
|
18
|
-
ALIGN_RIGHT_ALIGNED,
|
|
19
|
-
CONTENT_TYPES,
|
|
20
|
-
MAX_IMAGES_SECTION_ALIGNMENT_ITEMS_LENGTH,
|
|
21
|
-
} from '../../../../brand-page';
|
|
22
|
-
import type { DebounceHandle } from 'lodash.debounce';
|
|
23
|
-
import debounce from 'lodash.debounce';
|
|
24
|
-
import type { UpdateItemValuePayload } from '../../models';
|
|
25
|
-
import cloneDeep from 'lodash.clonedeep';
|
|
26
|
-
import { isURL } from '../../../../utils/validator.util';
|
|
27
|
-
|
|
28
|
-
const DEBOUNCE_IN_MS = 250;
|
|
29
|
-
|
|
30
|
-
export default defineComponent({
|
|
31
|
-
props: {
|
|
32
|
-
id: {
|
|
33
|
-
type: String,
|
|
34
|
-
required: true,
|
|
35
|
-
},
|
|
36
|
-
name: {
|
|
37
|
-
type: String,
|
|
38
|
-
required: true,
|
|
39
|
-
},
|
|
40
|
-
content: {
|
|
41
|
-
type: Object as PropType<Content>,
|
|
42
|
-
required: true,
|
|
43
|
-
},
|
|
44
|
-
value: {
|
|
45
|
-
type: Array as PropType<TextMediaItem[]>,
|
|
46
|
-
required: true,
|
|
47
|
-
},
|
|
48
|
-
maxLength: {
|
|
49
|
-
type: Number,
|
|
50
|
-
required: false,
|
|
51
|
-
default: undefined,
|
|
52
|
-
},
|
|
53
|
-
logoTheme: {
|
|
54
|
-
type: Object as PropType<LogoTheme>,
|
|
55
|
-
required: true,
|
|
56
|
-
},
|
|
57
|
-
settings: {
|
|
58
|
-
type: Object,
|
|
59
|
-
required: true,
|
|
60
|
-
},
|
|
61
|
-
isAdmin: {
|
|
62
|
-
type: Boolean,
|
|
63
|
-
required: true,
|
|
64
|
-
},
|
|
65
|
-
brandPageType: {
|
|
66
|
-
type: String,
|
|
67
|
-
required: true,
|
|
68
|
-
default: BRAND_PAGE_TYPES.brandSite,
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
emits: ['update:modelValue', 'on-intent-image-replace'],
|
|
72
|
-
data: () => ({
|
|
73
|
-
changeDebounce: undefined as DebounceHandle | undefined,
|
|
74
|
-
options: [] as (TextMediaItem | TextShapeItem)[],
|
|
75
|
-
maxLengthError: MAX_LENGTH_ERROR_MESSAGE(),
|
|
76
|
-
invalidUrlError: INVALID_URL_MESSAGE(),
|
|
77
|
-
titleLength: MAX_TITLE_LENGTH,
|
|
78
|
-
urlError: {},
|
|
79
|
-
mediaType: undefined,
|
|
80
|
-
descriptionLength: MAX_DESCRIPTION_LENGTH,
|
|
81
|
-
schema: 'https',
|
|
82
|
-
maxItemsLength: 0,
|
|
83
|
-
}),
|
|
84
|
-
watch: {
|
|
85
|
-
options: {
|
|
86
|
-
handler() {
|
|
87
|
-
if (this.changeDebounce) {
|
|
88
|
-
this.changeDebounce();
|
|
89
|
-
}
|
|
90
|
-
},
|
|
91
|
-
deep: true,
|
|
92
|
-
},
|
|
93
|
-
},
|
|
94
|
-
created() {
|
|
95
|
-
this.options = cloneDeep(this.value);
|
|
96
|
-
this.mediaType = this.settings.replaceImageSettings.mediaType;
|
|
97
|
-
this.options = this.options.map((o) => ({
|
|
98
|
-
...o,
|
|
99
|
-
mediaType: this.mediaType,
|
|
100
|
-
imageLink: o.imageLink || '',
|
|
101
|
-
}));
|
|
102
|
-
|
|
103
|
-
if (!this.changeDebounce) {
|
|
104
|
-
this.changeDebounce = debounce(this.emitChange, DEBOUNCE_IN_MS);
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
computed: {
|
|
108
|
-
items() {
|
|
109
|
-
if (
|
|
110
|
-
this.maxLength &&
|
|
111
|
-
this.maxLength > 2 &&
|
|
112
|
-
this.content.type === CONTENT_TYPES['images-section']
|
|
113
|
-
) {
|
|
114
|
-
const imagesSectionContent = this.content as ImagesSectionContent;
|
|
115
|
-
|
|
116
|
-
if (
|
|
117
|
-
[ALIGN_LEFT_ALIGNED, ALIGN_RIGHT_ALIGNED].some(
|
|
118
|
-
(s) => imagesSectionContent.displayStyle === s,
|
|
119
|
-
)
|
|
120
|
-
) {
|
|
121
|
-
this.setMaxLayoutLength(MAX_IMAGES_SECTION_ALIGNMENT_ITEMS_LENGTH);
|
|
122
|
-
|
|
123
|
-
return this.value.length > 3
|
|
124
|
-
? this.value.slice(0, MAX_IMAGES_SECTION_ALIGNMENT_ITEMS_LENGTH)
|
|
125
|
-
: this.value;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
if (this.maxLength) {
|
|
130
|
-
this.setMaxLayoutLength(this.maxLength);
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
return this.value;
|
|
134
|
-
},
|
|
135
|
-
},
|
|
136
|
-
methods: {
|
|
137
|
-
setMaxLayoutLength(value: number) {
|
|
138
|
-
this.maxItemsLength = value;
|
|
139
|
-
},
|
|
140
|
-
onItemsDelete(index: number) {
|
|
141
|
-
this.options = this.options.filter((_o, i) => i !== index);
|
|
142
|
-
|
|
143
|
-
if (this.changeDebounce) {
|
|
144
|
-
this.changeDebounce();
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
const payload: UpdateItemValuePayload<TextMediaItem[]> = {
|
|
148
|
-
id: this.id,
|
|
149
|
-
name: this.name,
|
|
150
|
-
value: cloneDeep(this.options),
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
this.$emit('update:modelValue', payload);
|
|
154
|
-
},
|
|
155
|
-
onAddNewItem() {
|
|
156
|
-
this.addOption();
|
|
157
|
-
},
|
|
158
|
-
addOption(): void {
|
|
159
|
-
this.options.push({
|
|
160
|
-
paragraph: '',
|
|
161
|
-
title: '',
|
|
162
|
-
imageUrl: '',
|
|
163
|
-
imageTitle: '',
|
|
164
|
-
height: -1,
|
|
165
|
-
width: -1,
|
|
166
|
-
mediaType: this.mediaType,
|
|
167
|
-
imageLink: '',
|
|
168
|
-
itemsId: -1,
|
|
169
|
-
});
|
|
170
|
-
|
|
171
|
-
if (this.changeDebounce) {
|
|
172
|
-
this.changeDebounce();
|
|
173
|
-
}
|
|
174
|
-
},
|
|
175
|
-
emitChange(): void {
|
|
176
|
-
const payload: UpdateItemValuePayload<TextMediaItem[]> = {
|
|
177
|
-
id: this.id,
|
|
178
|
-
name: this.name,
|
|
179
|
-
value: this.options,
|
|
180
|
-
};
|
|
181
|
-
|
|
182
|
-
this.$emit('update:modelValue', payload);
|
|
183
|
-
},
|
|
184
|
-
onItemsChange(items: TextMediaItem[]) {
|
|
185
|
-
this.options = items;
|
|
186
|
-
|
|
187
|
-
if (this.changeDebounce) {
|
|
188
|
-
this.changeDebounce();
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
const payload: UpdateItemValuePayload<TextMediaItem[]> = {
|
|
192
|
-
id: this.id,
|
|
193
|
-
name: this.name,
|
|
194
|
-
value: cloneDeep(items),
|
|
195
|
-
};
|
|
196
|
-
|
|
197
|
-
this.$emit('update:modelValue', payload);
|
|
198
|
-
},
|
|
199
|
-
onReplaceImage(index: number, imageUrl: string) {
|
|
200
|
-
this.$emit('on-intent-image-replace', {
|
|
201
|
-
id: this.id,
|
|
202
|
-
name: this.name,
|
|
203
|
-
index,
|
|
204
|
-
value: imageUrl,
|
|
205
|
-
});
|
|
206
|
-
},
|
|
207
|
-
onRemoveImage(index: number) {
|
|
208
|
-
this.options[index].imageUrl = '';
|
|
209
|
-
(this.options[index] as TextShapeItem).colorReplacements =
|
|
210
|
-
[] as ColorReplacement[];
|
|
211
|
-
this.emitChange();
|
|
212
|
-
},
|
|
213
|
-
onColorReplacementsChange(
|
|
214
|
-
payload: UpdateItemValuePayload<ColorReplacement[]>,
|
|
215
|
-
index: number,
|
|
216
|
-
) {
|
|
217
|
-
(this.options[index] as TextShapeItem).colorReplacements = payload.value;
|
|
218
|
-
this.emitChange();
|
|
219
|
-
},
|
|
220
|
-
onValueChange(value: string, index: number) {
|
|
221
|
-
if (!value.includes(this.schema)) {
|
|
222
|
-
this.options[index].imageLink = `${this.schema}://${value}`;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
this.urlError[index] = isURL(value);
|
|
226
|
-
},
|
|
227
|
-
checkUrl(index: number) {
|
|
228
|
-
return this.urlError[index] !== undefined ? this.urlError[index] : true;
|
|
229
|
-
},
|
|
230
|
-
onTextAreaTextChange(
|
|
231
|
-
payload: {
|
|
232
|
-
id: string;
|
|
233
|
-
name: string;
|
|
234
|
-
value: string;
|
|
235
|
-
},
|
|
236
|
-
index: number,
|
|
237
|
-
) {
|
|
238
|
-
this.options[index].paragraph = payload.value;
|
|
239
|
-
},
|
|
240
|
-
onPersonalisationOverrideChange(
|
|
241
|
-
payload: {
|
|
242
|
-
id: string;
|
|
243
|
-
name: string;
|
|
244
|
-
value: string;
|
|
245
|
-
},
|
|
246
|
-
index: number,
|
|
247
|
-
) {
|
|
248
|
-
this.options[index][payload.name] = payload.value;
|
|
249
|
-
this.emitChange();
|
|
250
|
-
},
|
|
251
|
-
},
|
|
252
|
-
});
|