@designcrowd/library.brand-page 5.16.8 → 5.16.10-getty-10
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-BIOe-8IA.js → CreatedOnBrandCrowd-de-de-BIjRKi0F.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-en-us-DV20bca1.js → CreatedOnBrandCrowd-en-us-BJtBDIyA.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-es-es-DKqBeyh-.js → CreatedOnBrandCrowd-es-es-B7J67yjT.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-fr-BzxDd-OM.js → CreatedOnBrandCrowd-fr-ca-C5TLsBYX.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-ca-BzxDd-OM.js → CreatedOnBrandCrowd-fr-fr-C5TLsBYX.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-pt-B1jO4ynE.js → CreatedOnBrandCrowd-pt-br-D-KHM2hS.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-br-B1jO4ynE.js → CreatedOnBrandCrowd-pt-pt-D-KHM2hS.js} +1 -1
- package/lib/src/{CreatedOnDcom-de-de-Dbz_XUoY.js → CreatedOnDcom-de-de--GWR7Qla.js} +1 -1
- package/lib/src/{CreatedOnDcom-en-us-C5klzL2y.js → CreatedOnDcom-en-us-BO2F6SS7.js} +1 -1
- package/lib/src/{CreatedOnDcom-es-es-CP1DRQVG.js → CreatedOnDcom-es-es-33HIiu3I.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-ca-Dh-kd_pp.js → CreatedOnDcom-fr-ca-UUaaDmf2.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-fr-DP2Sztda.js → CreatedOnDcom-fr-fr-oUrNkYca.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-br-C8n0YKop.js → CreatedOnDcom-pt-br-1EEVqgW5.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-pt-DqGJHyCL.js → CreatedOnDcom-pt-pt-JNtXR9kt.js} +1 -1
- package/lib/src/brand-page/components/page/Page.mixin.js +19 -15
- package/lib/src/brand-page/components/page/Page.stories.js +2 -2
- package/lib/src/brand-page/models/brand-page-context.model.d.ts +0 -1
- package/lib/src/brand-page/models/brand-page-context.model.js +0 -1
- package/lib/src/brand-page/models/index.d.ts +1 -0
- package/lib/src/brand-page/models/index.js +2 -0
- package/lib/src/brand-page/utils/view-model.util.d.ts +2 -1
- package/lib/src/brand-page/utils/view-model.util.js +27 -2
- package/lib/src/brand-page/view-models.d.ts +17 -2
- package/lib/src/brand-page-maker/components/admin-background-settings/AdminBackgroundSettings.mixin.d.ts +7 -2
- package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.d.ts +1 -0
- package/lib/src/brand-page-maker/components/preview/Preview.stories.js +2 -2
- package/lib/src/brand-page-maker/composables/useEventTracker.d.ts +18 -0
- package/lib/src/brand-page-maker/composables/useEventTracker.js +23 -0
- package/lib/src/brand-page-maker/stores/brandpage-container/brand-page-container-store.js +0 -12
- package/lib/src/brand-page-maker/utils/mixpanel.util.d.ts +1 -0
- package/lib/src/brand-page-maker/utils/mixpanel.util.js +29 -0
- package/lib/src/bundled-translations-0k_bW9M3.js +163 -0
- package/lib/src/bundled-translations.de-DE-alPJDdV5.js +163 -0
- package/lib/src/bundled-translations.es-ES-DvG6dxbl.js +163 -0
- package/lib/src/bundled-translations.fr-CA-uKGhZH2y.js +163 -0
- package/lib/src/bundled-translations.fr-FR-DsR3NACS.js +163 -0
- package/lib/src/bundled-translations.pt-BR-Bh9w3i0j.js +163 -0
- package/lib/src/bundled-translations.pt-PT-BzegT--8.js +163 -0
- package/lib/src/bundles/bundled-translations.de-DE.json +3 -1
- package/lib/src/bundles/bundled-translations.es-ES.json +3 -1
- package/lib/src/bundles/bundled-translations.fr-CA.json +3 -1
- package/lib/src/bundles/bundled-translations.fr-FR.json +3 -1
- package/lib/src/bundles/bundled-translations.json +3 -1
- package/lib/src/bundles/bundled-translations.pt-BR.json +3 -1
- package/lib/src/bundles/bundled-translations.pt-PT.json +3 -1
- package/lib/src/clients/brand-page-client.d.ts +0 -4
- package/lib/src/css/library.brand-page-brandCrowd.min.css +40 -37
- package/lib/src/css/library.brand-page-brandPage.min.css +40 -37
- package/lib/src/css/library.brand-page-designCom.min.css +40 -37
- package/lib/src/css/library.brand-page-preview.min.css +40 -37
- package/lib/src/index.mjs +1 -1
- package/lib/src/{lib-CaUOFYrW.js → lib-CBNatjpQ.js} +14034 -13892
- package/lib/src/shared/background-settings/components/background-shapes/BackgroundShapeSettings.mixin.d.ts +7 -2
- package/lib/src/shared/background-settings/store/background-settings-store.d.ts +3 -0
- package/lib/src/shared/background-settings/store/background-settings-store.js +43 -2
- package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.d.ts +1 -0
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItem.mixin.d.ts +1 -0
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.d.ts +1 -0
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.js +4 -0
- package/lib/src/shared/content-settings/components/image-field/ImageField.mixin.js +3 -1
- package/lib/src/shared/logo-settings/components/EditLogoSettings.mixin.d.ts +1 -0
- package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.d.ts +1 -0
- package/lib/src/shared/publish-brand-page-with-state/PublishBrandPageModalWithState.mixin.d.ts +1 -1
- package/lib/src/shared/publish-brand-page-with-state/PublishBrandPageModalWithState.mixin.js +0 -4
- package/lib/src/shared/side-bar/components/SideBarTabButton.mixin.d.ts +1 -0
- package/lib/src/shared/style-settings/components/StyleSettings.mixin.d.ts +3 -0
- package/lib/src/shared/template-settings/components/TemplatesSettings.mixin.d.ts +1 -0
- package/package.json +1 -1
- package/src/brand-page/components/page/Page.mixin.ts +23 -15
- package/src/brand-page/components/page/Page.stories.ts +2 -1
- package/src/brand-page/components/page/Page.vue +19 -1
- package/src/brand-page/models/brand-page-context.model.ts +0 -3
- package/src/brand-page/models/index.ts +2 -0
- package/src/brand-page/utils/__snapshots__/migration.util.test.ts.snap +3 -0
- package/src/brand-page/utils/__snapshots__/migration2.util.test.ts.snap +1 -0
- package/src/brand-page/utils/__snapshots__/model.util.test.ts.snap +2 -0
- package/src/brand-page/utils/view-model.util.ts +42 -2
- package/src/brand-page/view-models.ts +23 -1
- package/src/brand-page-maker/components/preview/Preview.stories.ts +2 -1
- package/src/brand-page-maker/composables/useEventTracker.ts +28 -0
- package/src/brand-page-maker/stores/brandpage-container/brand-page-container-store.ts +0 -36
- package/src/brand-page-maker/utils/mixpanel.util.ts +42 -0
- package/src/bundles/bundled-translations.de-DE.json +3 -1
- package/src/bundles/bundled-translations.es-ES.json +3 -1
- package/src/bundles/bundled-translations.fr-CA.json +3 -1
- package/src/bundles/bundled-translations.fr-FR.json +3 -1
- package/src/bundles/bundled-translations.json +3 -1
- package/src/bundles/bundled-translations.pt-BR.json +3 -1
- package/src/bundles/bundled-translations.pt-PT.json +3 -1
- package/src/clients/brand-page-client.ts +0 -4
- package/src/shared/background-settings/components/BackgroundSettings.vue +25 -8
- package/src/shared/background-settings/components/ReplaceImageSettingsForBackgroundSettings.vue +13 -1
- package/src/shared/background-settings/components/i18n/background-settings.de-DE.json +3 -1
- package/src/shared/background-settings/components/i18n/background-settings.es-ES.json +3 -1
- package/src/shared/background-settings/components/i18n/background-settings.fr-CA.json +3 -1
- package/src/shared/background-settings/components/i18n/background-settings.fr-FR.json +3 -1
- package/src/shared/background-settings/components/i18n/background-settings.json +3 -1
- package/src/shared/background-settings/components/i18n/background-settings.pt-BR.json +3 -1
- package/src/shared/background-settings/components/i18n/background-settings.pt-PT.json +3 -1
- package/src/shared/background-settings/store/background-settings-store.ts +60 -2
- package/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.ts +4 -0
- package/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.vue +1 -1
- package/src/shared/content-settings/components/generate-ai-button/GenerateAiButton.vue +24 -6
- package/src/shared/content-settings/components/generate-ai-modal/GenerateAiModal.vue +47 -4
- package/src/shared/content-settings/components/image-field/ImageField.mixin.ts +4 -1
- package/src/shared/content-settings/components/testimonial-items-field/TestimonialItemsField.vue +3 -1
- package/src/shared/content-settings/components/text-items-field/TextItemsField.vue +3 -1
- package/src/shared/publish-brand-page-with-state/PublishBrandPageModalWithState.mixin.ts +0 -6
- package/src/shared/publish-brand-page-with-state/PublishBrandPageModalWithState.vue +1 -1
- package/lib/src/bundled-translations-Dw3XtNmX.js +0 -163
- package/lib/src/bundled-translations.de-DE-B82Ik9M7.js +0 -163
- package/lib/src/bundled-translations.es-ES-cf3pdNuN.js +0 -163
- package/lib/src/bundled-translations.fr-CA-DP44EcAZ.js +0 -163
- package/lib/src/bundled-translations.fr-FR-V0Zt25kg.js +0 -163
- package/lib/src/bundled-translations.pt-BR-Brv6rCss.js +0 -163
- package/lib/src/bundled-translations.pt-PT-BTgscCTG.js +0 -163
|
@@ -79,15 +79,18 @@ export default defineComponent({
|
|
|
79
79
|
},
|
|
80
80
|
backgroundShapes() {
|
|
81
81
|
const backgroundShapes = [
|
|
82
|
-
...(this.viewModel?.styles?.
|
|
82
|
+
...(this.viewModel?.styles?.backgroundStylesViewModel
|
|
83
|
+
?.backgroundShapes || []),
|
|
83
84
|
];
|
|
84
85
|
// TODO: create style viewmodel object to include backgroundImageContent attribute only on viewmodel
|
|
85
86
|
// p.s backgroundImageUrl can be url or SVG content string
|
|
86
|
-
if (this.viewModel.styles?.
|
|
87
|
+
if (this.viewModel.styles?.backgroundStylesViewModel?.backgroundImageUrl) {
|
|
87
88
|
backgroundShapes.splice(0, 0, {
|
|
88
|
-
name: this.viewModel.styles.
|
|
89
|
+
name: this.viewModel.styles.backgroundStylesViewModel
|
|
90
|
+
.backgroundImageUrl,
|
|
89
91
|
style: {
|
|
90
|
-
...this.viewModel.styles.
|
|
92
|
+
...this.viewModel.styles.backgroundStylesViewModel
|
|
93
|
+
.backgroundShapeStyle,
|
|
91
94
|
width: `100%`,
|
|
92
95
|
height: `100%`,
|
|
93
96
|
},
|
|
@@ -97,10 +100,11 @@ export default defineComponent({
|
|
|
97
100
|
},
|
|
98
101
|
rootElementStyles() {
|
|
99
102
|
let styles = {};
|
|
100
|
-
if (!this.viewModel?.styles?.
|
|
101
|
-
|
|
103
|
+
if (!this.viewModel?.styles?.backgroundStylesViewModel
|
|
104
|
+
?.backgroundImageUrl &&
|
|
105
|
+
this.viewModel?.styles?.backgroundStylesViewModel?.style) {
|
|
102
106
|
styles = {
|
|
103
|
-
...this.viewModel?.styles?.
|
|
107
|
+
...this.viewModel?.styles?.backgroundStylesViewModel?.style,
|
|
104
108
|
};
|
|
105
109
|
}
|
|
106
110
|
Object.assign(styles, this.viewModel?.styles?.textStyles?.style);
|
|
@@ -117,26 +121,26 @@ export default defineComponent({
|
|
|
117
121
|
},
|
|
118
122
|
rootBackgroundStyles() {
|
|
119
123
|
const styles = {
|
|
120
|
-
...(this.viewModel?.styles?.
|
|
124
|
+
...(this.viewModel?.styles?.backgroundStylesViewModel?.style || {}),
|
|
121
125
|
};
|
|
122
126
|
delete styles.backgroundAttachment;
|
|
123
|
-
if (this.viewModel.styles?.
|
|
124
|
-
(this.viewModel.styles.
|
|
125
|
-
!this.viewModel.styles?.
|
|
127
|
+
if (this.viewModel.styles?.backgroundStylesViewModel?.backgroundImageUrl &&
|
|
128
|
+
(this.viewModel.styles.backgroundStylesViewModel.backgroundImageUrl.endsWith(`.svg`) ||
|
|
129
|
+
!this.viewModel.styles?.backgroundStylesViewModel?.backgroundImageUrl.startsWith('http'))) {
|
|
126
130
|
// Any backgroundImageUrl that handles svg file, svg markup is handled as BackgroundShape object
|
|
127
131
|
delete styles.backgroundImage;
|
|
128
132
|
}
|
|
129
|
-
else if (this.viewModel?.styles?.
|
|
133
|
+
else if (this.viewModel?.styles?.backgroundStylesViewModel?.backgroundImageUrl) {
|
|
130
134
|
// if background is a gradient
|
|
131
|
-
if (this.viewModel?.styles?.
|
|
135
|
+
if (this.viewModel?.styles?.backgroundStylesViewModel?.style?.background?.startsWith('linear-gradient')) {
|
|
132
136
|
// combine image and gradient into the `background` property
|
|
133
|
-
styles.backgroundImage = `url(${this.viewModel?.styles?.
|
|
137
|
+
styles.backgroundImage = `url(${this.viewModel?.styles?.backgroundStylesViewModel?.backgroundImageUrl}), ${this.viewModel?.styles?.backgroundStylesViewModel?.style?.background}`;
|
|
134
138
|
delete styles.background;
|
|
135
139
|
}
|
|
136
140
|
else {
|
|
137
141
|
// background is a solid color
|
|
138
142
|
styles.backgroundColor = styles.background;
|
|
139
|
-
styles.backgroundImage = `url(${this.viewModel?.styles?.
|
|
143
|
+
styles.backgroundImage = `url(${this.viewModel?.styles?.backgroundStylesViewModel?.backgroundImageUrl})`;
|
|
140
144
|
delete styles.background;
|
|
141
145
|
}
|
|
142
146
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent } from 'vue';
|
|
2
2
|
import Page from './Page.vue';
|
|
3
|
-
import { mapToPageFooterViewModel, mapToPageHeaderViewModel, mapToViewModel, } from '../../utils';
|
|
3
|
+
import { mapToPageFooterViewModel, mapToPageHeaderViewModel, mapToPageStyleViewModel, mapToViewModel, } from '../../utils';
|
|
4
4
|
import { BRAND_PAGE_TYPES, BrandPageModel, SENSITIVE_CONTENT_TYPES, VIEWPORTS, } from '../../models';
|
|
5
5
|
export default {
|
|
6
6
|
title: 'Components/BrandPage/Page',
|
|
@@ -17,7 +17,7 @@ const pages = brandPageModel.pages.map((p) => ({
|
|
|
17
17
|
}));
|
|
18
18
|
const viewModel = {
|
|
19
19
|
showBrandCrowdLogo: true,
|
|
20
|
-
styles: brandPageModel.styles,
|
|
20
|
+
styles: mapToPageStyleViewModel(brandPageModel.styles, {}),
|
|
21
21
|
headerViewModelDesktop: mapToPageHeaderViewModel(brandPageModel.pageHeaderDesktop, brandPageModel.styles, pages),
|
|
22
22
|
headerViewModelMobile: mapToPageHeaderViewModel(brandPageModel.pageHeaderMobile, brandPageModel.styles, pages),
|
|
23
23
|
footerViewModelDesktop: mapToPageFooterViewModel(brandPageModel.pageFooterDesktop, brandPageModel.styles),
|
|
@@ -36,7 +36,6 @@ export interface AbTestResult {
|
|
|
36
36
|
}
|
|
37
37
|
export interface AbTest {
|
|
38
38
|
bp_3926_freemium_watermark?: AbTestResult;
|
|
39
|
-
bp_4092_rotating_upsells_at_publish?: AbTestResult;
|
|
40
39
|
bp_4572_ai_text_generation_post_purchase?: AbTestResult;
|
|
41
40
|
}
|
|
42
41
|
export declare const MEDIA_SIZES: {
|
|
@@ -24,7 +24,6 @@ export const AB_TEST_FLAG = {
|
|
|
24
24
|
};
|
|
25
25
|
const AB_TEST_KEYS = {
|
|
26
26
|
BP_3926_FREEMIUM_WATERMARK: 'bc-bp-3926-freemium-cta-in-website-editor',
|
|
27
|
-
BP_4092_ROTATING_UPSELLS_AT_PUBLISH: 'bc-bp-4092-rotating-upsells-at-website-publish',
|
|
28
27
|
BP_4572_AI_TEXT_GENERATION_POST_PURCHASE: 'bc-bp-4572-ai-text-generation-post-purchase',
|
|
29
28
|
};
|
|
30
29
|
export const MEDIA_SIZES = {
|
|
@@ -32,6 +32,7 @@ export declare class BackgroundStyles {
|
|
|
32
32
|
backgroundImageUrl: string;
|
|
33
33
|
backgroundShapes: BackgroundShape[];
|
|
34
34
|
personalisationRole?: PersonalisationRole;
|
|
35
|
+
media?: AbstractMedia;
|
|
35
36
|
constructor(option?: Partial<BackgroundStyles>);
|
|
36
37
|
}
|
|
37
38
|
export declare const GALLERY_TYPES: {
|
|
@@ -47,6 +47,7 @@ export class BackgroundStyles {
|
|
|
47
47
|
backgroundImageUrl;
|
|
48
48
|
backgroundShapes;
|
|
49
49
|
personalisationRole;
|
|
50
|
+
media;
|
|
50
51
|
constructor(option = {}) {
|
|
51
52
|
this.backgroundImageUrl = option.backgroundImageUrl || '';
|
|
52
53
|
this.backgroundShapes = (option.backgroundShapes ||
|
|
@@ -59,6 +60,7 @@ export class BackgroundStyles {
|
|
|
59
60
|
background: '',
|
|
60
61
|
};
|
|
61
62
|
this.personalisationRole = option.personalisationRole;
|
|
63
|
+
this.media = option.media || undefined;
|
|
62
64
|
}
|
|
63
65
|
}
|
|
64
66
|
export const GALLERY_TYPES = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ImageContent, ProfileContent, TextContent, PageStyles, Content, BrandPageModel, ImageGalleryContent, GalleryStyles, BannerSectionContent, ImagesSectionContent, BrandPageType, PageHeaderDesktop, PageFooterDesktop, PageFooterMobile, PageHeaderMobile, LogoImageModel, LogoTemplateImageModel, BookingSectionContent } from '../models';
|
|
2
|
-
import type { ImageViewModel, LogoViewModel, ProfileViewModel, TextViewModel, ContentViewModel, BrandPageViewModel, ImageGalleryViewModel, PageViewModel, BannerSectionViewModel, PageHeaderViewModel, PageFooterViewModel, TextImageSectionViewModel, BookingSectionViewModel } from '../view-models';
|
|
2
|
+
import type { ImageViewModel, LogoViewModel, ProfileViewModel, TextViewModel, ContentViewModel, BrandPageViewModel, ImageGalleryViewModel, PageViewModel, BannerSectionViewModel, PageHeaderViewModel, PageFooterViewModel, TextImageSectionViewModel, BookingSectionViewModel, PageStylesViewModel } from '../view-models';
|
|
3
3
|
export declare const applyViewModelTextStyles: <T extends ContentViewModel>(content: T, styles: PageStyles) => T;
|
|
4
4
|
export declare const mapToImageViewModel: (content: ImageContent) => ImageViewModel;
|
|
5
5
|
export declare const mapToImageGalleryViewModel: (content: ImageGalleryContent, globalStyles: GalleryStyles) => ImageGalleryViewModel;
|
|
@@ -8,6 +8,7 @@ export declare const mapToTextViewModel: (content: TextContent, styles: PageStyl
|
|
|
8
8
|
export declare const mapToBannerSectionViewModel: (content: BannerSectionContent, styles: PageStyles, options: ViewModelMappingOptions) => BannerSectionViewModel;
|
|
9
9
|
export declare const mapToImagesSectionViewModel: (content: ImagesSectionContent, styles: PageStyles, brandPageType: BrandPageType) => TextImageSectionViewModel;
|
|
10
10
|
export declare const mapToBookingSectionViewModel: (content: BookingSectionContent, styles: PageStyles) => BookingSectionViewModel;
|
|
11
|
+
export declare const mapToPageStyleViewModel: (pageStyles: PageStyles, options: ViewModelMappingOptions) => PageStylesViewModel;
|
|
11
12
|
export declare const mapToPageHeaderViewModel: (pageHeader: PageHeaderDesktop | PageHeaderMobile, pageStyles: PageStyles, pages: PageViewModel[], useOldLogoRenderSize?: boolean) => PageHeaderViewModel;
|
|
12
13
|
export declare const mapToPageFooterViewModel: (pageFooter: PageFooterDesktop | PageFooterMobile, pageStyles: PageStyles, useOldLogoRenderSize?: boolean) => PageFooterViewModel;
|
|
13
14
|
export declare const mapToViewModel: (styles: PageStyles, brandPageType: BrandPageType, options: ViewModelMappingOptions) => (content: Content) => ContentViewModel | undefined;
|
|
@@ -604,6 +604,15 @@ export const mapToBookingSectionViewModel = (content, styles) => {
|
|
|
604
604
|
isFullWidth: true,
|
|
605
605
|
}, styles);
|
|
606
606
|
};
|
|
607
|
+
export const mapToPageStyleViewModel = (pageStyles, options) => {
|
|
608
|
+
return {
|
|
609
|
+
backgroundStylesViewModel: mapBackgroundStylesToViewModel(pageStyles.backgroundStyles, options),
|
|
610
|
+
buttonStyles: pageStyles.buttonStyles,
|
|
611
|
+
logoStyles: pageStyles.logoStyles,
|
|
612
|
+
textStyles: pageStyles.textStyles,
|
|
613
|
+
galleryStyles: pageStyles.galleryStyles,
|
|
614
|
+
};
|
|
615
|
+
};
|
|
607
616
|
export const mapToPageHeaderViewModel = (pageHeader, pageStyles, pages, useOldLogoRenderSize = false) => {
|
|
608
617
|
const viewport = pageHeader.viewport;
|
|
609
618
|
const logoContent = {
|
|
@@ -749,6 +758,22 @@ export const mapToViewModel = (styles, brandPageType, options) => (content) => {
|
|
|
749
758
|
assertUnreachable();
|
|
750
759
|
}
|
|
751
760
|
};
|
|
761
|
+
const mapBackgroundStylesToViewModel = (backgroundStyles, options) => {
|
|
762
|
+
// TODO(jyao): These need to be mapped to a view model eventually
|
|
763
|
+
return {
|
|
764
|
+
style: backgroundStyles.style,
|
|
765
|
+
backgroundShapeStyle: backgroundStyles.backgroundShapeStyle,
|
|
766
|
+
backgroundImageUrl: backgroundStyles.backgroundImageUrl,
|
|
767
|
+
backgroundShapes: backgroundStyles.backgroundShapes,
|
|
768
|
+
personalisationRole: backgroundStyles.personalisationRole,
|
|
769
|
+
mediaViewModel: backgroundStyles.media
|
|
770
|
+
? mapMediaToContentViewModel({
|
|
771
|
+
media: backgroundStyles.media,
|
|
772
|
+
options,
|
|
773
|
+
})
|
|
774
|
+
: undefined,
|
|
775
|
+
};
|
|
776
|
+
};
|
|
752
777
|
export const getBrandPageViewModelFromBrandPageModel = (model, brandPageToken, showBrandCrowdLogo = true, options) => {
|
|
753
778
|
const pages = model.pages.map((p) => {
|
|
754
779
|
const contents = p.contents
|
|
@@ -765,7 +790,7 @@ export const getBrandPageViewModelFromBrandPageModel = (model, brandPageToken, s
|
|
|
765
790
|
brandPageToken,
|
|
766
791
|
pages,
|
|
767
792
|
showBrandCrowdLogo,
|
|
768
|
-
styles: model.styles,
|
|
793
|
+
styles: mapToPageStyleViewModel(model.styles, options),
|
|
769
794
|
headerViewModelDesktop: mapToPageHeaderViewModel(model.pageHeaderDesktop, model.styles, pages, options.useOldLogoRenderSize),
|
|
770
795
|
headerViewModelMobile: mapToPageHeaderViewModel(model.pageHeaderMobile, model.styles, pages, options.useOldLogoRenderSize),
|
|
771
796
|
footerViewModelDesktop: mapToPageFooterViewModel(model.pageFooterDesktop, model.styles, options.useOldLogoRenderSize),
|
|
@@ -850,7 +875,7 @@ export const getCriticalResourceURLs = (viewModel) => {
|
|
|
850
875
|
}
|
|
851
876
|
}
|
|
852
877
|
// shapes
|
|
853
|
-
const bgShapeFullBg = viewModel.styles?.
|
|
878
|
+
const bgShapeFullBg = viewModel.styles?.backgroundStylesViewModel.backgroundImageUrl;
|
|
854
879
|
if (typeof bgShapeFullBg !== 'undefined' && isValidSvgUrl(bgShapeFullBg)) {
|
|
855
880
|
shapes.push(String(bgShapeFullBg));
|
|
856
881
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ButtonWithModalContent, ProfileContent, TextContent, VideoContent, ImageContent, ContentType, ButtonStyles, LogoStyles, MapContent, ImageGalleryContent, GalleryStyles, MailingListContent, RequestPaymentContent, ShopContent, SupportMeContent, ContactFormContent, BannerSectionContent, BrandPageType, SocialLinksContent, TestimonialSectionContent, AboutSectionContent, DividerSectionContent, ShapesSectionContent, ButtonLinkType, PageHeaderMobile, PageHeaderDesktop, PageFooterMobile, PageFooterDesktop, TextMediaItem, TextShapeItem, TextStyleDeclaration, AspectRatio, LogoImageModel, LogoTemplateImageModel, CookieOptions, BookingSectionContent, MediaTypes, TextStyles, BackgroundStyle, BackgroundShape, PersonalisationRole } from './models';
|
|
2
2
|
import type { ImagesSectionContentDisplayStyle } from './constants';
|
|
3
3
|
export type ViewModelType = 'button' | 'image' | 'image-gallery' | 'logo' | 'map' | 'mailing-list' | 'profile' | 'support-me' | 'request-payment' | 'text' | 'video' | 'contact-form' | 'banner-section' | 'images-section' | 'about-section' | 'divider-section' | 'testimonial-section' | 'social-links' | 'shapes-section' | 'shop-section' | 'booking-section';
|
|
4
4
|
export interface ContentViewModel {
|
|
@@ -134,10 +134,25 @@ export interface PageHeaderViewModel extends Omit<PageHeaderDesktop | PageHeader
|
|
|
134
134
|
export interface PageFooterViewModel extends Omit<PageFooterDesktop | PageFooterMobile, 'logoImage' | 'logoImageStyle' | 'isLogoOptional' | 'viewport' | 'isLogoVisible' | 'logoTemplateImage' | 'logoImageHeight' | 'logoImageWidth'> {
|
|
135
135
|
logo: LogoViewModel;
|
|
136
136
|
}
|
|
137
|
+
export interface BackgroundStylesViewModel {
|
|
138
|
+
style: BackgroundStyle;
|
|
139
|
+
backgroundShapeStyle: BackgroundStyle;
|
|
140
|
+
backgroundImageUrl: string;
|
|
141
|
+
backgroundShapes: BackgroundShape[];
|
|
142
|
+
personalisationRole?: PersonalisationRole;
|
|
143
|
+
mediaViewModel?: MediaViewModel;
|
|
144
|
+
}
|
|
145
|
+
export interface PageStylesViewModel {
|
|
146
|
+
backgroundStylesViewModel: BackgroundStylesViewModel;
|
|
147
|
+
buttonStyles: ButtonStyles;
|
|
148
|
+
logoStyles: LogoStyles;
|
|
149
|
+
textStyles: TextStyles;
|
|
150
|
+
galleryStyles: GalleryStyles;
|
|
151
|
+
}
|
|
137
152
|
export interface BrandPageViewModel {
|
|
138
153
|
brandPageToken?: string;
|
|
139
154
|
showBrandCrowdLogo: boolean;
|
|
140
|
-
styles:
|
|
155
|
+
styles: PageStylesViewModel;
|
|
141
156
|
pages: PageViewModel[];
|
|
142
157
|
brandPageType: BrandPageType;
|
|
143
158
|
headerViewModelDesktop: PageHeaderViewModel;
|
|
@@ -48,7 +48,6 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
48
48
|
aspectRatio?: string | undefined;
|
|
49
49
|
width?: string | undefined;
|
|
50
50
|
height?: string | undefined;
|
|
51
|
-
textAlign?: string | undefined;
|
|
52
51
|
backgroundAttachment?: string | undefined;
|
|
53
52
|
background?: string | undefined;
|
|
54
53
|
backgroundImage?: string | undefined;
|
|
@@ -80,6 +79,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
80
79
|
overflowWrap?: string | undefined;
|
|
81
80
|
paddingTop?: string | undefined;
|
|
82
81
|
position?: string | undefined;
|
|
82
|
+
textAlign?: string | undefined;
|
|
83
83
|
textDecoration?: string | undefined;
|
|
84
84
|
top?: string | undefined;
|
|
85
85
|
transform?: string | undefined;
|
|
@@ -92,7 +92,6 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
92
92
|
aspectRatio?: string | undefined;
|
|
93
93
|
width?: string | undefined;
|
|
94
94
|
height?: string | undefined;
|
|
95
|
-
textAlign?: string | undefined;
|
|
96
95
|
backgroundAttachment?: string | undefined;
|
|
97
96
|
background?: string | undefined;
|
|
98
97
|
backgroundImage?: string | undefined;
|
|
@@ -124,6 +123,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
124
123
|
overflowWrap?: string | undefined;
|
|
125
124
|
paddingTop?: string | undefined;
|
|
126
125
|
position?: string | undefined;
|
|
126
|
+
textAlign?: string | undefined;
|
|
127
127
|
textDecoration?: string | undefined;
|
|
128
128
|
top?: string | undefined;
|
|
129
129
|
transform?: string | undefined;
|
|
@@ -181,6 +181,9 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
181
181
|
};
|
|
182
182
|
}[];
|
|
183
183
|
personalisationRole?: "website" | "email" | "phone" | "profile" | "about" | "information" | "media" | undefined;
|
|
184
|
+
media?: {
|
|
185
|
+
type: import("../../../brand-page").MediaTypes;
|
|
186
|
+
} | undefined;
|
|
184
187
|
}>;
|
|
185
188
|
uiStore: import("pinia").Store<"ui", import("../../../lib").UIRootState, {
|
|
186
189
|
endpoints: () => import("../../../lib").Endpoints;
|
|
@@ -255,6 +258,8 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
255
258
|
setBackgroundMode(payload: {
|
|
256
259
|
backgroundMode: "images" | "edit";
|
|
257
260
|
}): void;
|
|
261
|
+
setBackgroundMedia(payload: import("src/shared/my-uploads/models").MediaBaseSelectedPayload): void;
|
|
262
|
+
removeBackgroundVideo(): void;
|
|
258
263
|
}>;
|
|
259
264
|
}, {
|
|
260
265
|
isColorMatch: {};
|
package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.d.ts
CHANGED
|
@@ -1009,6 +1009,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
1009
1009
|
sendAddContentContinuationEvent: (continuation: string) => void;
|
|
1010
1010
|
sendUpsellOfferEvent: (upsellType: string) => void;
|
|
1011
1011
|
sendUpsellOfferActionEvent: (upsellType: string, action: string) => void;
|
|
1012
|
+
sendGenerateTextContinuationEvent: (cta_location: string, continuation: string | null) => void;
|
|
1012
1013
|
};
|
|
1013
1014
|
externalEditor: import("@tiptap/vue-3").Editor;
|
|
1014
1015
|
styleSettingsStore: import("pinia").Store<"uiStyleSettings", import("../../../shared/style-settings/store").StyleSettingsState, {
|
|
@@ -3,7 +3,7 @@ import Preview from './Preview.vue';
|
|
|
3
3
|
import { brandPageData } from '../../../brand-page/__fixtures__/brand-page-sample-data';
|
|
4
4
|
import { PageStyles, BRAND_PAGE_TYPES, PageHeaderDesktop, PageHeaderMobile, PageFooterDesktop, PageFooterMobile, SENSITIVE_CONTENT_TYPES, } from '../../../brand-page';
|
|
5
5
|
import { setupStoryPinia } from '../brand-page-maker/__fixtures__/store-fixture';
|
|
6
|
-
import { mapToPageFooterViewModel, mapToPageHeaderViewModel, mapToViewModel, } from '../../../brand-page/utils';
|
|
6
|
+
import { mapToPageFooterViewModel, mapToPageHeaderViewModel, mapToPageStyleViewModel, mapToViewModel, } from '../../../brand-page/utils';
|
|
7
7
|
export default {
|
|
8
8
|
title: 'Components/BrandPageMaker/Preview',
|
|
9
9
|
component: Preview,
|
|
@@ -21,7 +21,7 @@ const pages = [
|
|
|
21
21
|
];
|
|
22
22
|
const viewModel = {
|
|
23
23
|
showBrandCrowdLogo: true,
|
|
24
|
-
styles: pageStyles,
|
|
24
|
+
styles: mapToPageStyleViewModel(pageStyles, {}),
|
|
25
25
|
headerViewModelDesktop: mapToPageHeaderViewModel(new PageHeaderDesktop(), pageStyles, pages),
|
|
26
26
|
headerViewModelMobile: mapToPageHeaderViewModel(new PageHeaderMobile(), pageStyles, pages),
|
|
27
27
|
footerViewModelDesktop: mapToPageFooterViewModel(new PageFooterDesktop(), pageStyles),
|
|
@@ -42,6 +42,11 @@ export declare const EVENTS: {
|
|
|
42
42
|
WEBSITE_MAKER_UPSELL_ACTION: string;
|
|
43
43
|
WEBSITE_MAKER_SWITCH_LOGO: string;
|
|
44
44
|
WEBSITE_MAKER_SWITCH_LOGO_MODAL: string;
|
|
45
|
+
WEBSITE_MAKER_AI_GENERATE_TEXT: string;
|
|
46
|
+
WEBSITE_MAKER_AI_REGENERATE_TEXT: string;
|
|
47
|
+
WEBSITE_MAKER_AI_SEND_PROMPT: string;
|
|
48
|
+
WEBSITE_MAKER_AI_COPY_RESPONSE: string;
|
|
49
|
+
WEBSITE_MAKER_AI_STOP_GENERATION: string;
|
|
45
50
|
};
|
|
46
51
|
export declare const SELECT_LOCATIONS: {
|
|
47
52
|
MAKER_PREVIEW: string;
|
|
@@ -62,6 +67,14 @@ export declare const UPGRADE_CTA_LOCATIONS: {
|
|
|
62
67
|
SLUG_CHANGE_MANAGE_PAGE: string;
|
|
63
68
|
GOOGLE_ADSENSE: string;
|
|
64
69
|
};
|
|
70
|
+
export declare const GENERATE_AI_TEXT_CTA_LOCATIONS: {
|
|
71
|
+
BANNER_DESCRIPTION: string;
|
|
72
|
+
BANNER_TITLE: string;
|
|
73
|
+
ABOUT_TITLE: string;
|
|
74
|
+
ABOUT_PARAGRAPH: string;
|
|
75
|
+
TEXT_ITEM: string;
|
|
76
|
+
TESTIMONIAL_ITEM: string;
|
|
77
|
+
};
|
|
65
78
|
export declare const TRIGGER_TYPE: {
|
|
66
79
|
AUTOMATIC: string;
|
|
67
80
|
USER_TRIGGERED: string;
|
|
@@ -74,6 +87,10 @@ export declare const PUBLISH_MODAL_CONTINUATION_EVENTS: {
|
|
|
74
87
|
COPY_LINK: string;
|
|
75
88
|
VIEW_WEBSITE: string;
|
|
76
89
|
};
|
|
90
|
+
export declare const GENERATE_TEXT_CONTINUATION_EVENTS: {
|
|
91
|
+
USE_TEXT: string;
|
|
92
|
+
EXIT: string;
|
|
93
|
+
};
|
|
77
94
|
export declare const PUBLISH_OPTION_MODAL_CONTINUATION_EVENTS: {
|
|
78
95
|
PREMIUM: string;
|
|
79
96
|
EXIT: string;
|
|
@@ -104,5 +121,6 @@ declare const useEventTracker: () => {
|
|
|
104
121
|
sendAddContentContinuationEvent: (continuation: string) => void;
|
|
105
122
|
sendUpsellOfferEvent: (upsellType: string) => void;
|
|
106
123
|
sendUpsellOfferActionEvent: (upsellType: string, action: string) => void;
|
|
124
|
+
sendGenerateTextContinuationEvent: (cta_location: string, continuation: string | null) => void;
|
|
107
125
|
};
|
|
108
126
|
export { useEventTracker };
|
|
@@ -25,6 +25,11 @@ export const EVENTS = {
|
|
|
25
25
|
WEBSITE_MAKER_UPSELL_ACTION: 'website_maker_upsell_action',
|
|
26
26
|
WEBSITE_MAKER_SWITCH_LOGO: 'website_maker_switch_logo',
|
|
27
27
|
WEBSITE_MAKER_SWITCH_LOGO_MODAL: 'website_maker_switch_logo_modal',
|
|
28
|
+
WEBSITE_MAKER_AI_GENERATE_TEXT: 'website_maker_ai_generate_text',
|
|
29
|
+
WEBSITE_MAKER_AI_REGENERATE_TEXT: 'website_maker_ai_regenerate_text',
|
|
30
|
+
WEBSITE_MAKER_AI_SEND_PROMPT: 'website_maker_ai_send_prompt',
|
|
31
|
+
WEBSITE_MAKER_AI_COPY_RESPONSE: 'website_maker_ai_copy_response',
|
|
32
|
+
WEBSITE_MAKER_AI_STOP_GENERATION: 'website_maker_ai_stop_generation',
|
|
28
33
|
};
|
|
29
34
|
export const SELECT_LOCATIONS = {
|
|
30
35
|
MAKER_PREVIEW: 'maker_preview',
|
|
@@ -45,6 +50,14 @@ export const UPGRADE_CTA_LOCATIONS = {
|
|
|
45
50
|
SLUG_CHANGE_MANAGE_PAGE: 'slug_change_manage_page',
|
|
46
51
|
GOOGLE_ADSENSE: 'google_adsense',
|
|
47
52
|
};
|
|
53
|
+
export const GENERATE_AI_TEXT_CTA_LOCATIONS = {
|
|
54
|
+
BANNER_DESCRIPTION: 'banner_description',
|
|
55
|
+
BANNER_TITLE: 'banner_title',
|
|
56
|
+
ABOUT_TITLE: 'about_title',
|
|
57
|
+
ABOUT_PARAGRAPH: 'about_paragraph',
|
|
58
|
+
TEXT_ITEM: 'text_item',
|
|
59
|
+
TESTIMONIAL_ITEM: 'testimonial_item',
|
|
60
|
+
};
|
|
48
61
|
export const TRIGGER_TYPE = {
|
|
49
62
|
AUTOMATIC: 'automatic',
|
|
50
63
|
USER_TRIGGERED: 'user_triggered',
|
|
@@ -57,6 +70,10 @@ export const PUBLISH_MODAL_CONTINUATION_EVENTS = {
|
|
|
57
70
|
COPY_LINK: 'copy_link',
|
|
58
71
|
VIEW_WEBSITE: 'view_website',
|
|
59
72
|
};
|
|
73
|
+
export const GENERATE_TEXT_CONTINUATION_EVENTS = {
|
|
74
|
+
USE_TEXT: 'use_text',
|
|
75
|
+
EXIT: 'exit',
|
|
76
|
+
};
|
|
60
77
|
export const PUBLISH_OPTION_MODAL_CONTINUATION_EVENTS = {
|
|
61
78
|
PREMIUM: 'premium',
|
|
62
79
|
EXIT: 'exit',
|
|
@@ -212,6 +229,12 @@ const useEventTracker = () => {
|
|
|
212
229
|
action,
|
|
213
230
|
});
|
|
214
231
|
},
|
|
232
|
+
sendGenerateTextContinuationEvent: (cta_location, continuation) => {
|
|
233
|
+
_publishEvent(EVENTS.WEBSITE_MAKER_AI_GENERATE_TEXT, {
|
|
234
|
+
cta_location,
|
|
235
|
+
continuation,
|
|
236
|
+
});
|
|
237
|
+
},
|
|
215
238
|
};
|
|
216
239
|
};
|
|
217
240
|
export { useEventTracker };
|
|
@@ -255,10 +255,6 @@ export const useBrandPageContainerStore = defineStore('brandPageContainer', {
|
|
|
255
255
|
if (!response) {
|
|
256
256
|
throw new Error('Failed to set brand page slug');
|
|
257
257
|
}
|
|
258
|
-
if (response.websiteUpsellAbTestKey) {
|
|
259
|
-
this.abTests.bp_4092_rotating_upsells_at_publish = getValueType(response.websiteUpsellAbTestKey, response.websiteUpsellAbTestValue);
|
|
260
|
-
eventTracker.sendExperimentStartedEvent(response.websiteUpsellAbTestKey, response.websiteUpsellAbTestValue);
|
|
261
|
-
}
|
|
262
258
|
if (response.status) {
|
|
263
259
|
await this.setBrandPageStatus(response.status);
|
|
264
260
|
}
|
|
@@ -357,10 +353,6 @@ export const useBrandPageContainerStore = defineStore('brandPageContainer', {
|
|
|
357
353
|
if (!response) {
|
|
358
354
|
throw new Error('Failed to set brand page slug');
|
|
359
355
|
}
|
|
360
|
-
if (response.websiteUpsellAbTestKey) {
|
|
361
|
-
this.abTests.bp_4092_rotating_upsells_at_publish = getValueType(response.websiteUpsellAbTestKey, response.websiteUpsellAbTestValue);
|
|
362
|
-
eventTracker.sendExperimentStartedEvent(response.websiteUpsellAbTestKey, response.websiteUpsellAbTestValue);
|
|
363
|
-
}
|
|
364
356
|
await brandPageClient.getBrandPageIsCustomDomainEnabledAsync(brandPageMakerStore.brandPageType, this.designDraftToken);
|
|
365
357
|
const updatedIsCustomDomainEnabled = await brandPageClient.updateBrandPageIsCustomDomainEnabledAsync(brandPageMakerStore.brandPageType, this.designDraftToken, true);
|
|
366
358
|
this.setBrandPageIsCustomDomainEnabled({
|
|
@@ -561,10 +553,6 @@ export const useBrandPageContainerStore = defineStore('brandPageContainer', {
|
|
|
561
553
|
if (!response) {
|
|
562
554
|
return false;
|
|
563
555
|
}
|
|
564
|
-
if (response.websiteUpsellAbTestKey) {
|
|
565
|
-
this.abTests.bp_4092_rotating_upsells_at_publish = getValueType(response.websiteUpsellAbTestKey, response.websiteUpsellAbTestValue);
|
|
566
|
-
eventTracker.sendExperimentStartedEvent(response.websiteUpsellAbTestKey, response.websiteUpsellAbTestValue);
|
|
567
|
-
}
|
|
568
556
|
if (this.brandPageStatus !== response.status) {
|
|
569
557
|
await this.setBrandPageStatus(response.status);
|
|
570
558
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getCtaLocationFromFieldType: (fieldType: string, sectionType?: string) => string;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { GENERATE_AI_TEXT_CTA_LOCATIONS } from '../composables/useEventTracker';
|
|
2
|
+
export const getCtaLocationFromFieldType = (fieldType, sectionType) => {
|
|
3
|
+
if (fieldType === 'text') {
|
|
4
|
+
return GENERATE_AI_TEXT_CTA_LOCATIONS.TEXT_ITEM;
|
|
5
|
+
}
|
|
6
|
+
if (fieldType === 'testimonials') {
|
|
7
|
+
return GENERATE_AI_TEXT_CTA_LOCATIONS.TESTIMONIAL_ITEM;
|
|
8
|
+
}
|
|
9
|
+
if (sectionType === 'banner-section') {
|
|
10
|
+
if (fieldType === 'description') {
|
|
11
|
+
return GENERATE_AI_TEXT_CTA_LOCATIONS.BANNER_DESCRIPTION;
|
|
12
|
+
}
|
|
13
|
+
if (fieldType === 'title') {
|
|
14
|
+
return GENERATE_AI_TEXT_CTA_LOCATIONS.BANNER_TITLE;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
if (sectionType === 'about-section') {
|
|
18
|
+
if (fieldType === 'title') {
|
|
19
|
+
return GENERATE_AI_TEXT_CTA_LOCATIONS.ABOUT_TITLE;
|
|
20
|
+
}
|
|
21
|
+
if (fieldType === 'paragraph') {
|
|
22
|
+
return GENERATE_AI_TEXT_CTA_LOCATIONS.ABOUT_PARAGRAPH;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
// Fallback: try to match directly with field type
|
|
26
|
+
// This handles cases where fieldType might already be in the correct format
|
|
27
|
+
const matchingLocation = Object.values(GENERATE_AI_TEXT_CTA_LOCATIONS).find((location) => location === fieldType);
|
|
28
|
+
return matchingLocation || fieldType;
|
|
29
|
+
};
|