@designcrowd/library.brand-page 5.14.13 → 5.14.14
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-ag_cJ5xM.js → CreatedOnBrandCrowd-de-de-D7ryk46x.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-en-us-CDVTqKqj.js → CreatedOnBrandCrowd-en-us-BiPE1ue8.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-es-es-CNPvY03W.js → CreatedOnBrandCrowd-es-es-BYmn7fSR.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-fr-CrUoctfw.js → CreatedOnBrandCrowd-fr-ca-D50Z2M1g.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-ca-CrUoctfw.js → CreatedOnBrandCrowd-fr-fr-D50Z2M1g.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-pt-CxKJIOga.js → CreatedOnBrandCrowd-pt-br-B2KzjGPW.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-br-CxKJIOga.js → CreatedOnBrandCrowd-pt-pt-B2KzjGPW.js} +1 -1
- package/lib/src/{CreatedOnDcom-de-de-BL3N0QX8.js → CreatedOnDcom-de-de-Ch5hMWS9.js} +1 -1
- package/lib/src/{CreatedOnDcom-en-us-BzJtMe4A.js → CreatedOnDcom-en-us-Dc200pCX.js} +1 -1
- package/lib/src/{CreatedOnDcom-es-es-DAXlwSu4.js → CreatedOnDcom-es-es-ClTYKnwP.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-ca-DSZI47j1.js → CreatedOnDcom-fr-ca-DLmg-UoU.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-fr-D24RG9RG.js → CreatedOnDcom-fr-fr-C9ikSDbM.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-br-BcyE_6oS.js → CreatedOnDcom-pt-br-4D9PnwCa.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-pt-DdGI9FyG.js → CreatedOnDcom-pt-pt-DDKAHEb_.js} +1 -1
- package/lib/src/brand-page-maker/components/admin-background-settings/AdminBackgroundSettings.mixin.d.ts +3 -0
- package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.js +1 -0
- package/lib/src/bundled-translations-Dy72EMki.js +155 -0
- package/lib/src/bundled-translations.de-DE-D8hpgB4c.js +155 -0
- package/lib/src/bundled-translations.es-ES-DDEID1pS.js +155 -0
- package/lib/src/bundled-translations.fr-CA-Bw7BvB5S.js +155 -0
- package/lib/src/bundled-translations.fr-FR-CYttyVyK.js +155 -0
- package/lib/src/bundled-translations.pt-BR-Ba0E7RWH.js +155 -0
- package/lib/src/bundled-translations.pt-PT-ChNJIgpc.js +155 -0
- package/lib/src/bundles/bundled-translations.de-DE.json +5 -1
- package/lib/src/bundles/bundled-translations.es-ES.json +5 -1
- package/lib/src/bundles/bundled-translations.fr-CA.json +5 -1
- package/lib/src/bundles/bundled-translations.fr-FR.json +5 -1
- package/lib/src/bundles/bundled-translations.json +5 -1
- package/lib/src/bundles/bundled-translations.pt-BR.json +5 -1
- package/lib/src/bundles/bundled-translations.pt-PT.json +5 -1
- package/lib/src/css/library.brand-page-brandCrowd.min.css +45 -48
- package/lib/src/css/library.brand-page-brandPage.min.css +45 -48
- package/lib/src/css/library.brand-page-designCom.min.css +45 -48
- package/lib/src/css/library.brand-page-preview.min.css +45 -48
- package/lib/src/index.mjs +1 -1
- package/lib/src/{lib-aSwCpNj3.js → lib-BAlwvkEk.js} +16907 -16843
- package/lib/src/shared/background-settings/components/background-shapes/BackgroundShapeSettings.mixin.d.ts +3 -0
- package/lib/src/shared/background-settings/store/background-settings-store.d.ts +5 -0
- package/lib/src/shared/background-settings/store/background-settings-store.js +5 -0
- package/lib/src/shared/content-settings/components/color-field/ColorField.mixin.d.ts +3 -0
- package/lib/src/shared/style-settings/components/StyleSettings.mixin.d.ts +3 -0
- package/package.json +1 -1
- package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.ts +1 -0
- package/src/bundles/bundled-translations.de-DE.json +5 -1
- package/src/bundles/bundled-translations.es-ES.json +5 -1
- package/src/bundles/bundled-translations.fr-CA.json +5 -1
- package/src/bundles/bundled-translations.fr-FR.json +5 -1
- package/src/bundles/bundled-translations.json +5 -1
- package/src/bundles/bundled-translations.pt-BR.json +5 -1
- package/src/bundles/bundled-translations.pt-PT.json +5 -1
- package/src/shared/background-settings/components/BackgroundSettings.vue +148 -146
- package/src/shared/background-settings/components/ReplaceImageSettingsForBackgroundSettings.vue +120 -0
- package/src/shared/background-settings/components/background-color/BackgroundColorSettings.vue +0 -3
- package/src/shared/background-settings/components/i18n/background-settings.de-DE.json +5 -1
- package/src/shared/background-settings/components/i18n/background-settings.es-ES.json +5 -1
- package/src/shared/background-settings/components/i18n/background-settings.fr-CA.json +5 -1
- package/src/shared/background-settings/components/i18n/background-settings.fr-FR.json +5 -1
- package/src/shared/background-settings/components/i18n/background-settings.json +5 -1
- package/src/shared/background-settings/components/i18n/background-settings.pt-BR.json +5 -1
- package/src/shared/background-settings/components/i18n/background-settings.pt-PT.json +5 -1
- package/src/shared/background-settings/store/background-settings-store.ts +10 -0
- package/lib/src/bundled-translations-fWikWTfa.js +0 -155
- package/lib/src/bundled-translations.de-DE-CwtsRCCr.js +0 -155
- package/lib/src/bundled-translations.es-ES-DELCLCbF.js +0 -155
- package/lib/src/bundled-translations.fr-CA-PDBhYlx8.js +0 -155
- package/lib/src/bundled-translations.fr-FR-OuZj3i-r.js +0 -155
- package/lib/src/bundled-translations.pt-BR-RPfprZOm.js +0 -155
- package/lib/src/bundled-translations.pt-PT-DF_GCXSl.js +0 -155
|
@@ -191,6 +191,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
191
191
|
}): void;
|
|
192
192
|
setBackgroundShapeSettings(payload: import("../../background-settings-models").SetBackgroundShapeSettingsPayload): void;
|
|
193
193
|
setRecommendedLogoColors(payload: import("../../background-settings-models").SetRecommendedLogoColorsPayload): void;
|
|
194
|
+
setBackgroundMode(payload: {
|
|
195
|
+
backgroundMode: "images" | "edit";
|
|
196
|
+
}): void;
|
|
194
197
|
}>;
|
|
195
198
|
}, {}, {
|
|
196
199
|
color(): string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { BackgroundShape, BackgroundStyle, BackgroundStyles, PersonalisationRole } from '../../../brand-page';
|
|
2
|
+
import { type BrandPageSettingsMode } from '../../../brand-page-maker/stores/brandpage-maker/brandpage-maker-store';
|
|
2
3
|
import type { SetBackgroundShapeSettingsPayload, SetLogoColorsPayload, SetRecommendedLogoColorsPayload } from '../background-settings-models';
|
|
3
4
|
import type { BackgroundSetStatePayload, BackgroundSettingsTabId } from '../models';
|
|
4
5
|
export interface BackgroundSettingsState {
|
|
@@ -7,6 +8,7 @@ export interface BackgroundSettingsState {
|
|
|
7
8
|
recommendedLogoColors: string[];
|
|
8
9
|
reservedImageUrlPrefixes: string[];
|
|
9
10
|
tab: BackgroundSettingsTabId;
|
|
11
|
+
backgroundMode: BrandPageSettingsMode;
|
|
10
12
|
}
|
|
11
13
|
export declare const useUiBackgroundSettingsStore: import("pinia").StoreDefinition<"uiBackgroundSettings", BackgroundSettingsState, {}, {
|
|
12
14
|
onBackgroundChanged(): void;
|
|
@@ -40,4 +42,7 @@ export declare const useUiBackgroundSettingsStore: import("pinia").StoreDefiniti
|
|
|
40
42
|
}): void;
|
|
41
43
|
setBackgroundShapeSettings(payload: SetBackgroundShapeSettingsPayload): void;
|
|
42
44
|
setRecommendedLogoColors(payload: SetRecommendedLogoColorsPayload): void;
|
|
45
|
+
setBackgroundMode(payload: {
|
|
46
|
+
backgroundMode: BrandPageSettingsMode;
|
|
47
|
+
}): void;
|
|
43
48
|
}>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { PageStyles } from '../../../brand-page';
|
|
2
|
+
import { BRANDPAGE_SETTINGS_MODES, } from '../../../brand-page-maker/stores/brandpage-maker/brandpage-maker-store';
|
|
2
3
|
import { backgroundSettingsTabId } from '../models';
|
|
3
4
|
import { defineStore } from 'pinia';
|
|
4
5
|
import { useUiStore } from '../../../brand-page-maker/stores';
|
|
@@ -14,6 +15,7 @@ export const useUiBackgroundSettingsStore = defineStore('uiBackgroundSettings',
|
|
|
14
15
|
recommendedLogoColors: [],
|
|
15
16
|
reservedImageUrlPrefixes: [],
|
|
16
17
|
tab: backgroundSettingsTabId.color,
|
|
18
|
+
backgroundMode: BRANDPAGE_SETTINGS_MODES.edit,
|
|
17
19
|
}),
|
|
18
20
|
actions: {
|
|
19
21
|
onBackgroundChanged() {
|
|
@@ -125,5 +127,8 @@ export const useUiBackgroundSettingsStore = defineStore('uiBackgroundSettings',
|
|
|
125
127
|
setRecommendedLogoColors(payload) {
|
|
126
128
|
this.recommendedLogoColors = payload.recommendedLogoColors;
|
|
127
129
|
},
|
|
130
|
+
setBackgroundMode(payload) {
|
|
131
|
+
this.backgroundMode = payload.backgroundMode;
|
|
132
|
+
},
|
|
128
133
|
},
|
|
129
134
|
});
|
|
@@ -270,6 +270,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
270
270
|
}): void;
|
|
271
271
|
setBackgroundShapeSettings(payload: import("../../../background-settings/background-settings-models").SetBackgroundShapeSettingsPayload): void;
|
|
272
272
|
setRecommendedLogoColors(payload: import("../../../background-settings/background-settings-models").SetRecommendedLogoColorsPayload): void;
|
|
273
|
+
setBackgroundMode(payload: {
|
|
274
|
+
backgroundMode: "images" | "edit";
|
|
275
|
+
}): void;
|
|
273
276
|
}>;
|
|
274
277
|
userStore: import("pinia").Store<"brandPageMakerUser", import("../../../../brand-page-maker/stores").UserState, {}, {
|
|
275
278
|
setEmailAddress(payload: string): void;
|
|
@@ -843,6 +843,9 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
843
843
|
}): void;
|
|
844
844
|
setBackgroundShapeSettings(payload: import("../../background-settings/background-settings-models").SetBackgroundShapeSettingsPayload): void;
|
|
845
845
|
setRecommendedLogoColors(payload: import("../../background-settings/background-settings-models").SetRecommendedLogoColorsPayload): void;
|
|
846
|
+
setBackgroundMode(payload: {
|
|
847
|
+
backgroundMode: "images" | "edit";
|
|
848
|
+
}): void;
|
|
846
849
|
}>;
|
|
847
850
|
eventTracker: {
|
|
848
851
|
sendExperimentStartedEvent: (abTestKey: string, abTestValue: string) => void;
|
package/package.json
CHANGED
|
@@ -892,6 +892,7 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
|
|
|
892
892
|
logoColors: logoDraftDesignAttributes?.logoColors,
|
|
893
893
|
recommendedLogoColors:
|
|
894
894
|
logoDraftDesignAttributes?.recommendedLogoColors,
|
|
895
|
+
backgroundMode: BRANDPAGE_SETTINGS_MODES.edit,
|
|
895
896
|
},
|
|
896
897
|
};
|
|
897
898
|
|
|
@@ -285,7 +285,11 @@
|
|
|
285
285
|
"color": "Farbe",
|
|
286
286
|
"imageLibrary": "Bilderbibliothek",
|
|
287
287
|
"myUploads": "Meine Uploads",
|
|
288
|
-
"backgroundColor": "Hintergrundfarbe"
|
|
288
|
+
"backgroundColor": "Hintergrundfarbe",
|
|
289
|
+
"addMedia": "Medien hinzufügen",
|
|
290
|
+
"addImage": "Bild hinzufügen",
|
|
291
|
+
"replaceImage": "Bild ersetzen",
|
|
292
|
+
"image": "Bild"
|
|
289
293
|
},
|
|
290
294
|
"colorPicker": {
|
|
291
295
|
"newColor": "Neue Farbe",
|
|
@@ -285,7 +285,11 @@
|
|
|
285
285
|
"color": "Color",
|
|
286
286
|
"imageLibrary": "Biblioteca de imágenes",
|
|
287
287
|
"myUploads": "Mis subidas",
|
|
288
|
-
"backgroundColor": "Color de fondo"
|
|
288
|
+
"backgroundColor": "Color de fondo",
|
|
289
|
+
"addMedia": "Añade elementos multimedia",
|
|
290
|
+
"addImage": "Añadir imagen",
|
|
291
|
+
"replaceImage": "Reemplazar imagen",
|
|
292
|
+
"image": "Imagen"
|
|
289
293
|
},
|
|
290
294
|
"colorPicker": {
|
|
291
295
|
"newColor": "Nuevo color",
|
|
@@ -285,7 +285,11 @@
|
|
|
285
285
|
"color": "Couleur",
|
|
286
286
|
"imageLibrary": "Bibliothèque d’images",
|
|
287
287
|
"myUploads": "Mes importations",
|
|
288
|
-
"backgroundColor": "Couleur d’arrière-plan"
|
|
288
|
+
"backgroundColor": "Couleur d’arrière-plan",
|
|
289
|
+
"addMedia": "Ajouter un média",
|
|
290
|
+
"addImage": "Ajouter une image",
|
|
291
|
+
"replaceImage": "Remplacer l'image",
|
|
292
|
+
"image": "Image"
|
|
289
293
|
},
|
|
290
294
|
"colorPicker": {
|
|
291
295
|
"newColor": "Nouvelle couleur",
|
|
@@ -285,7 +285,11 @@
|
|
|
285
285
|
"color": "Couleur",
|
|
286
286
|
"imageLibrary": "Bibliothèque d’images",
|
|
287
287
|
"myUploads": "Mes importations",
|
|
288
|
-
"backgroundColor": "Couleur d’arrière-plan"
|
|
288
|
+
"backgroundColor": "Couleur d’arrière-plan",
|
|
289
|
+
"addMedia": "Ajouter un média",
|
|
290
|
+
"addImage": "Ajouter une image",
|
|
291
|
+
"replaceImage": "Remplacer l'image",
|
|
292
|
+
"image": "Image"
|
|
289
293
|
},
|
|
290
294
|
"colorPicker": {
|
|
291
295
|
"newColor": "Nouvelle couleur",
|
|
@@ -285,7 +285,11 @@
|
|
|
285
285
|
"color": "Color",
|
|
286
286
|
"imageLibrary": "Image Library",
|
|
287
287
|
"myUploads": "My Uploads",
|
|
288
|
-
"backgroundColor": "Background Color"
|
|
288
|
+
"backgroundColor": "Background Color",
|
|
289
|
+
"addMedia": "Add Media",
|
|
290
|
+
"addImage": "Add Image",
|
|
291
|
+
"replaceImage": "Replace Image",
|
|
292
|
+
"image": "Image"
|
|
289
293
|
},
|
|
290
294
|
"colorPicker": {
|
|
291
295
|
"newColor": "New Color",
|
|
@@ -285,7 +285,11 @@
|
|
|
285
285
|
"color": "Cor",
|
|
286
286
|
"imageLibrary": "Biblioteca de imagens",
|
|
287
287
|
"myUploads": "Meus carregamentos",
|
|
288
|
-
"backgroundColor": "Cor de fundo"
|
|
288
|
+
"backgroundColor": "Cor de fundo",
|
|
289
|
+
"addMedia": "Adicionar mídia",
|
|
290
|
+
"addImage": "Adicionar imagem",
|
|
291
|
+
"replaceImage": "Substitua a imagem",
|
|
292
|
+
"image": "Imagem"
|
|
289
293
|
},
|
|
290
294
|
"colorPicker": {
|
|
291
295
|
"newColor": "Nova cor",
|
|
@@ -285,7 +285,11 @@
|
|
|
285
285
|
"color": "Cor",
|
|
286
286
|
"imageLibrary": "Biblioteca de imagens",
|
|
287
287
|
"myUploads": "Os meus carregamentos",
|
|
288
|
-
"backgroundColor": "Cor de fundo"
|
|
288
|
+
"backgroundColor": "Cor de fundo",
|
|
289
|
+
"addMedia": "Adicionar multimédia",
|
|
290
|
+
"addImage": "Adicionar imagem",
|
|
291
|
+
"replaceImage": "Substitua a imagem",
|
|
292
|
+
"image": "Imagem"
|
|
289
293
|
},
|
|
290
294
|
"colorPicker": {
|
|
291
295
|
"newColor": "Nova cor",
|
|
@@ -1,138 +1,122 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div data-test-tag="background-settings">
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
:
|
|
6
|
-
:
|
|
3
|
+
<ReplaceImageSettingsForBackgroundSettings
|
|
4
|
+
v-if="backgroundMode === BRANDPAGE_SETTINGS_MODES.images"
|
|
5
|
+
:media-type="data.mediaType"
|
|
6
|
+
:section-title="data.sectionTitle"
|
|
7
7
|
/>
|
|
8
|
-
<div
|
|
8
|
+
<div v-if="backgroundMode === BRANDPAGE_SETTINGS_MODES.edit">
|
|
9
|
+
<SideBarSettingsHeader :title="backgroundSettingsTr(`editBackground`)" />
|
|
10
|
+
<BackgroundColorSettings
|
|
11
|
+
:custom-groups="customGroups"
|
|
12
|
+
:logo-theme="logoTheme"
|
|
13
|
+
/>
|
|
14
|
+
<h4 class="tw-mt-3 tw-mb-1.5 tw-text-sm tw-font-bold tw-capitalize">
|
|
15
|
+
{{ backgroundSettingsTr(`addMedia`) }}
|
|
16
|
+
</h4>
|
|
17
|
+
|
|
18
|
+
<CollapsiblePanel :title="backgroundSettingsTr('image')">
|
|
19
|
+
<ImageField
|
|
20
|
+
id="background-image"
|
|
21
|
+
name="backgroundImage"
|
|
22
|
+
:value="imageFieldValue"
|
|
23
|
+
:is-required="false"
|
|
24
|
+
placeholder="Add background image"
|
|
25
|
+
media-type="Content"
|
|
26
|
+
@on-intent-image-replace="onIntentImageReplace"
|
|
27
|
+
@update:model-value="onBackgroundImageDeleted"
|
|
28
|
+
/>
|
|
29
|
+
</CollapsiblePanel>
|
|
9
30
|
<div
|
|
10
|
-
v-if="
|
|
11
|
-
class="tw-
|
|
31
|
+
v-if="templateSupportsMainShape || templateSupportsOtherShapes"
|
|
32
|
+
class="tw-py-4 tw-my-5 tw-border-t tw-border-solid tw-border-grayscale-500"
|
|
12
33
|
>
|
|
13
|
-
<
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
:
|
|
20
|
-
@on-click.stop="switchActiveTab(tab)"
|
|
34
|
+
<h4 class="tw-mb-4 tw-text-sm tw-font-bold tw-capitalize">
|
|
35
|
+
{{ backgroundSettingsTr(`shapes`) }}
|
|
36
|
+
</h4>
|
|
37
|
+
<div v-if="showPersonalisationField" class="tw-mb-4">
|
|
38
|
+
<PersonalisationRoleField
|
|
39
|
+
:value="personalisationRole"
|
|
40
|
+
@update:model-value="onPersonalisationRoleChange"
|
|
21
41
|
/>
|
|
22
42
|
</div>
|
|
23
|
-
</div>
|
|
24
|
-
|
|
25
|
-
<div v-if="showPersonalisationField" class="tw-mb-4">
|
|
26
|
-
<PersonalisationRoleField
|
|
27
|
-
:value="personalisationRole"
|
|
28
|
-
@update:model-value="onPersonalisationRoleChange"
|
|
29
|
-
/>
|
|
30
|
-
</div>
|
|
31
|
-
|
|
32
|
-
<TabMenu
|
|
33
|
-
v-if="data.activeTab === 'shapes' && data.shapeTabs.length > 1"
|
|
34
|
-
class="tw-w-full tw-mb-6"
|
|
35
|
-
:classes="tabMenuClasses"
|
|
36
|
-
:tab-names="data.shapeTabs"
|
|
37
|
-
:selected-tab-name="data.selectedShapeTab"
|
|
38
|
-
@on-tab-selected="selectShapeTab"
|
|
39
|
-
/>
|
|
40
43
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
v-if="isAdmin"
|
|
49
|
-
name="pre-shape"
|
|
50
|
-
config-option="backgroundShapeStyle"
|
|
44
|
+
<TabMenu
|
|
45
|
+
v-if="data.shapeTabs.length > 1"
|
|
46
|
+
class="tw-w-full tw-mb-6"
|
|
47
|
+
:classes="tabMenuClasses"
|
|
48
|
+
:tab-names="data.shapeTabs"
|
|
49
|
+
:selected-tab-name="data.selectedShapeTab"
|
|
50
|
+
@on-tab-selected="selectShapeTab"
|
|
51
51
|
/>
|
|
52
52
|
|
|
53
|
-
<
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
name="post-shape"
|
|
62
|
-
config-option="backgroundShapeStyle"
|
|
63
|
-
/>
|
|
64
|
-
</div>
|
|
65
|
-
<div
|
|
66
|
-
v-if="
|
|
67
|
-
data.activeTab === 'shapes' &&
|
|
68
|
-
data.selectedShapeTab === backgroundSettingsTr(`other`)
|
|
69
|
-
"
|
|
70
|
-
>
|
|
71
|
-
<slot v-if="isAdmin" name="pre-shape" config-option="shape" />
|
|
53
|
+
<div
|
|
54
|
+
v-if="data.selectedShapeTab === backgroundSettingsTr(`background`)"
|
|
55
|
+
>
|
|
56
|
+
<slot
|
|
57
|
+
v-if="isAdmin"
|
|
58
|
+
name="pre-shape"
|
|
59
|
+
config-option="backgroundShapeStyle"
|
|
60
|
+
/>
|
|
72
61
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
62
|
+
<BackgroundShapeSettings
|
|
63
|
+
key="main"
|
|
64
|
+
:custom-groups="customGroups"
|
|
65
|
+
color-type="main"
|
|
66
|
+
/>
|
|
78
67
|
|
|
79
|
-
|
|
80
|
-
|
|
68
|
+
<slot
|
|
69
|
+
v-if="isAdmin"
|
|
70
|
+
name="post-shape"
|
|
71
|
+
config-option="backgroundShapeStyle"
|
|
72
|
+
/>
|
|
73
|
+
</div>
|
|
74
|
+
<div v-if="data.selectedShapeTab === backgroundSettingsTr(`other`)">
|
|
75
|
+
<slot v-if="isAdmin" name="pre-shape" config-option="shape" />
|
|
81
76
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
:media-type="'Content'"
|
|
88
|
-
@on-select-image="onBackgroundImageSelected"
|
|
89
|
-
@on-delete-image="onBackgroundImageDeleted"
|
|
90
|
-
/>
|
|
91
|
-
<slot v-else name="user-image-upgrade" />
|
|
92
|
-
</div>
|
|
77
|
+
<BackgroundShapeSettings
|
|
78
|
+
key="secondary"
|
|
79
|
+
:custom-groups="customGroups"
|
|
80
|
+
color-type="secondary"
|
|
81
|
+
/>
|
|
93
82
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
v-if="features.canAddLibraryBackgroundImages"
|
|
97
|
-
@on-select-image="onBackgroundImageSelected"
|
|
98
|
-
/>
|
|
99
|
-
<slot v-else name="library-image-upgrade" />
|
|
100
|
-
</div>
|
|
83
|
+
<slot v-if="isAdmin" name="post-shape" config-option="shape" />
|
|
84
|
+
</div>
|
|
101
85
|
|
|
102
|
-
|
|
103
|
-
|
|
86
|
+
<div v-if="!isAdmin">
|
|
87
|
+
<ShapeLibrary @on-select-image="onBackgroundImageSelected" />
|
|
88
|
+
</div>
|
|
104
89
|
</div>
|
|
105
90
|
</div>
|
|
106
91
|
</div>
|
|
107
92
|
</template>
|
|
108
93
|
<script setup lang="ts">
|
|
109
|
-
import {
|
|
94
|
+
import { TabMenu, CollapsiblePanel, Button } from '@designcrowd/fe-shared-lib';
|
|
110
95
|
import BackgroundColorSettings from './background-color/BackgroundColorSettings.vue';
|
|
111
96
|
import BackgroundShapeSettings from './background-shapes/BackgroundShapeSettings.vue';
|
|
97
|
+
import ImageField from '../../content-settings/components/image-field/ImageField.vue';
|
|
112
98
|
import {
|
|
99
|
+
BRANDPAGE_SETTINGS_MODES,
|
|
113
100
|
useBrandPageContainerStore,
|
|
101
|
+
useBrandPageMakerStore,
|
|
114
102
|
useBrandPageMakerUserStore,
|
|
115
103
|
useUiStore,
|
|
116
104
|
} from '../../../brand-page-maker/stores';
|
|
117
105
|
import { useUiBackgroundSettingsStore } from '../store';
|
|
118
106
|
import SideBarSettingsHeader from '../../common/SideBarSettingsHeader.vue';
|
|
119
|
-
import MyUploads from '../../my-uploads/MyUploads.vue';
|
|
120
|
-
import UnsplashLibrary from '../../unsplash-library/UnsplashLibrary.vue';
|
|
121
107
|
import ShapeLibrary from '../../shape-library/ShapeLibrary.vue';
|
|
122
108
|
import PersonalisationRoleField from '../../content-settings/components/personalisation-role-field/PersonalisationRoleField.vue';
|
|
123
109
|
import { computed, onMounted, reactive } from 'vue';
|
|
124
110
|
import type { UserMediaItem } from '../../my-uploads/models';
|
|
125
111
|
import type { UpdateItemValuePayload } from '../../content-settings/models';
|
|
126
|
-
import type
|
|
112
|
+
import { MEDIA_TYPES, type PersonalisationRole } from '../../../brand-page';
|
|
127
113
|
import { backgroundSettingsTr } from '../../../composables/useTranslate';
|
|
128
|
-
import
|
|
129
|
-
backgroundSettingsTabId,
|
|
130
|
-
type BackgroundSettingsTab,
|
|
131
|
-
} from '../models/background-settings-models';
|
|
114
|
+
import ReplaceImageSettingsForBackgroundSettings from './ReplaceImageSettingsForBackgroundSettings.vue';
|
|
132
115
|
|
|
133
116
|
const backgroundSettingsStore = useUiBackgroundSettingsStore();
|
|
134
117
|
const userStore = useBrandPageMakerUserStore();
|
|
135
118
|
const containerStore = useBrandPageContainerStore();
|
|
119
|
+
const brandPageMakerStore = useBrandPageMakerStore();
|
|
136
120
|
const uiStore = useUiStore();
|
|
137
121
|
|
|
138
122
|
const backgroundStyles = computed(
|
|
@@ -143,23 +127,14 @@ const recommendedLogoColors = computed(
|
|
|
143
127
|
);
|
|
144
128
|
const logoColors = computed(() => backgroundSettingsStore.logoColors);
|
|
145
129
|
const logoTheme = computed(() => uiStore.logoTheme);
|
|
146
|
-
const
|
|
130
|
+
const backgroundMode = computed(() => backgroundSettingsStore.backgroundMode);
|
|
147
131
|
const isAdmin = computed(() => userStore.isAdmin);
|
|
148
132
|
const isPersonalisationEnabled = computed(
|
|
149
133
|
() => uiStore.isPersonalisationEnabled,
|
|
150
134
|
);
|
|
151
135
|
const isDesignCom = computed(() => containerStore.isDesignCom);
|
|
152
136
|
|
|
153
|
-
const
|
|
154
|
-
{
|
|
155
|
-
id: backgroundSettingsTabId['unsplash-image'],
|
|
156
|
-
label: backgroundSettingsTr(`imageLibrary`),
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
id: backgroundSettingsTabId['user-image'],
|
|
160
|
-
label: backgroundSettingsTr(`myUploads`),
|
|
161
|
-
},
|
|
162
|
-
];
|
|
137
|
+
const emit = defineEmits(['on-intent-image-replace']);
|
|
163
138
|
|
|
164
139
|
const shapeTabs = [
|
|
165
140
|
backgroundSettingsTr(`background`),
|
|
@@ -188,52 +163,46 @@ const personalisationRole = computed(() => {
|
|
|
188
163
|
return backgroundStyles.value.personalisationRole;
|
|
189
164
|
});
|
|
190
165
|
|
|
166
|
+
// Return empty string for ImageField when a shape is selected
|
|
167
|
+
// This hides the shape in the image field as there will be a future thumbnail for shapes
|
|
168
|
+
const imageFieldValue = computed(() => {
|
|
169
|
+
const backgroundImageUrl = backgroundStyles.value.backgroundImageUrl || '';
|
|
170
|
+
|
|
171
|
+
// If the background image is an SVG (shape), return empty string to hide it in the image field
|
|
172
|
+
if (backgroundImageUrl.endsWith('.svg')) {
|
|
173
|
+
return '';
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
return backgroundImageUrl;
|
|
177
|
+
});
|
|
178
|
+
|
|
191
179
|
const data = reactive({
|
|
192
|
-
activeTab: tabs[0].id,
|
|
193
|
-
tabs,
|
|
194
180
|
selectedShapeTab: shapeTabs[0],
|
|
195
181
|
shapeTabs,
|
|
182
|
+
BRANDPAGE_SETTINGS_MODES,
|
|
183
|
+
mediaType: '',
|
|
184
|
+
sectionTitle: '',
|
|
196
185
|
});
|
|
197
186
|
|
|
198
187
|
onMounted(() => {
|
|
199
188
|
if (!templateSupportsMainShape.value) {
|
|
200
189
|
data.shapeTabs.splice(
|
|
201
|
-
data.shapeTabs.findIndex((t) => t ===
|
|
190
|
+
data.shapeTabs.findIndex((t) => t === backgroundSettingsTr(`background`)),
|
|
202
191
|
1,
|
|
203
192
|
);
|
|
204
|
-
|
|
193
|
+
if (data.shapeTabs.length > 0) {
|
|
194
|
+
selectShapeTab(data.shapeTabs[0]);
|
|
195
|
+
}
|
|
205
196
|
}
|
|
206
197
|
|
|
207
198
|
if (!templateSupportsOtherShapes.value) {
|
|
208
199
|
data.shapeTabs.splice(
|
|
209
|
-
data.shapeTabs.findIndex((t) => t ===
|
|
210
|
-
1,
|
|
211
|
-
);
|
|
212
|
-
selectShapeTab(data.shapeTabs[0]);
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
if (
|
|
216
|
-
data.shapeTabs.length > 0 &&
|
|
217
|
-
!data.tabs.some((tab) => tab.id === 'shapes')
|
|
218
|
-
) {
|
|
219
|
-
selectShapeTab(data.shapeTabs[0]);
|
|
220
|
-
|
|
221
|
-
// only add the shapes tab if there are shapes in the store
|
|
222
|
-
data.tabs.push({
|
|
223
|
-
id: 'shapes',
|
|
224
|
-
label: backgroundSettingsTr(`shapes`),
|
|
225
|
-
});
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
if (
|
|
229
|
-
!templateSupportsMainShape.value &&
|
|
230
|
-
!templateSupportsOtherShapes.value &&
|
|
231
|
-
data.tabs.some((tab) => tab.id === 'shapes')
|
|
232
|
-
) {
|
|
233
|
-
data.tabs.splice(
|
|
234
|
-
data.tabs.findIndex((tab) => tab.id === 'shapes'),
|
|
200
|
+
data.shapeTabs.findIndex((t) => t === backgroundSettingsTr(`other`)),
|
|
235
201
|
1,
|
|
236
202
|
);
|
|
203
|
+
if (data.shapeTabs.length > 0) {
|
|
204
|
+
selectShapeTab(data.shapeTabs[0]);
|
|
205
|
+
}
|
|
237
206
|
}
|
|
238
207
|
});
|
|
239
208
|
|
|
@@ -252,24 +221,22 @@ const customGroups = computed(() => {
|
|
|
252
221
|
];
|
|
253
222
|
});
|
|
254
223
|
|
|
255
|
-
const switchActiveTab = (tab: BackgroundSettingsTab) => {
|
|
256
|
-
data.activeTab = tab.id;
|
|
257
|
-
};
|
|
258
|
-
|
|
259
224
|
const onBackgroundImageSelected = (image: UserMediaItem) => {
|
|
260
225
|
backgroundSettingsStore.setBackgroundImageUrl({
|
|
261
226
|
backgroundImageUrl: image.url,
|
|
262
227
|
});
|
|
263
228
|
};
|
|
264
229
|
|
|
265
|
-
const onBackgroundImageDeleted = (
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
230
|
+
const onBackgroundImageDeleted = (payload: {
|
|
231
|
+
id: string;
|
|
232
|
+
name: string;
|
|
233
|
+
value: string;
|
|
234
|
+
}) => {
|
|
235
|
+
if (payload.value === '') {
|
|
270
236
|
backgroundSettingsStore.setBackgroundImageUrl({
|
|
271
237
|
backgroundImageUrl: '',
|
|
272
238
|
});
|
|
239
|
+
}
|
|
273
240
|
};
|
|
274
241
|
|
|
275
242
|
const selectShapeTab = (tab: string) => {
|
|
@@ -283,4 +250,39 @@ const onPersonalisationRoleChange = (
|
|
|
283
250
|
personalisationRole: payload.value,
|
|
284
251
|
});
|
|
285
252
|
};
|
|
253
|
+
|
|
254
|
+
const onIntentImageReplace = (payload: {
|
|
255
|
+
id: string;
|
|
256
|
+
name: string;
|
|
257
|
+
value: string;
|
|
258
|
+
}) => {
|
|
259
|
+
data.mediaType = MEDIA_TYPES.image;
|
|
260
|
+
data.sectionTitle = 'Background Image';
|
|
261
|
+
|
|
262
|
+
// Set field settings for the image replacement interface
|
|
263
|
+
brandPageMakerStore.setFieldSettings({
|
|
264
|
+
settings: {
|
|
265
|
+
errorMessage: '',
|
|
266
|
+
isRequired: false,
|
|
267
|
+
replaceImageSettings: {
|
|
268
|
+
tabs: ['MY_UPLOADS', 'IMAGE_LIBRARY'],
|
|
269
|
+
buttonTitleAdd: backgroundSettingsTr(`addImage`),
|
|
270
|
+
titleAdd: backgroundSettingsTr(`addImage`),
|
|
271
|
+
titleReplace: backgroundSettingsTr(`replaceImage`),
|
|
272
|
+
contentMediaFieldName: payload.value ? 'backgroundImage' : '',
|
|
273
|
+
openByDefault: false,
|
|
274
|
+
mediaType: data.mediaType,
|
|
275
|
+
desiredHeight: undefined,
|
|
276
|
+
desiredWidth: undefined,
|
|
277
|
+
maxFiles: 1,
|
|
278
|
+
maxFilesize: 25,
|
|
279
|
+
},
|
|
280
|
+
isValid: true,
|
|
281
|
+
},
|
|
282
|
+
});
|
|
283
|
+
|
|
284
|
+
backgroundSettingsStore.setBackgroundMode({
|
|
285
|
+
backgroundMode: BRANDPAGE_SETTINGS_MODES.images,
|
|
286
|
+
});
|
|
287
|
+
};
|
|
286
288
|
</script>
|