@designcrowd/library.brand-page 5.16.2 → 5.16.3-background-1
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-Oj_ab97C.js → CreatedOnBrandCrowd-de-de-SsqsrkVk.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-en-us-GsCBx_Vo.js → CreatedOnBrandCrowd-en-us-DsGqYTNa.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-es-es-CWp_kHxD.js → CreatedOnBrandCrowd-es-es-C7s1ZcE5.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-fr-DrPrFgKC.js → CreatedOnBrandCrowd-fr-ca-DsNnq4vF.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-ca-DrPrFgKC.js → CreatedOnBrandCrowd-fr-fr-DsNnq4vF.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-pt-BgvbBOFa.js → CreatedOnBrandCrowd-pt-br-BxAl5qbC.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-br-BgvbBOFa.js → CreatedOnBrandCrowd-pt-pt-BxAl5qbC.js} +1 -1
- package/lib/src/{CreatedOnDcom-de-de-BZRXmSAH.js → CreatedOnDcom-de-de-rwohNRHC.js} +1 -1
- package/lib/src/{CreatedOnDcom-en-us-D_xjisVj.js → CreatedOnDcom-en-us-CvwjVlGZ.js} +1 -1
- package/lib/src/{CreatedOnDcom-es-es-CJzkN8Oq.js → CreatedOnDcom-es-es-X40dNkrj.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-ca-C5ilNf57.js → CreatedOnDcom-fr-ca-DHVcZD4U.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-fr-CZypZWWq.js → CreatedOnDcom-fr-fr-Bx2kBJe8.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-br-JZXunSWT.js → CreatedOnDcom-pt-br-OFY9pGT7.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-pt-CjL1qKnl.js → CreatedOnDcom-pt-pt-Del779gQ.js} +1 -1
- package/lib/src/brand-page/components/page/Page.mixin.js +20 -15
- package/lib/src/brand-page/components/page/Page.stories.js +2 -2
- 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/migration/migration-07.js +1 -1
- 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/action-bar/ActionBar.mixin.d.ts +3 -0
- package/lib/src/brand-page-maker/components/admin-background-settings/AdminBackgroundSettings.mixin.d.ts +7 -2
- package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.d.ts +4 -0
- package/lib/src/brand-page-maker/components/brandpage-settings/ReplaceImageSettingsForBrandPageSettings.mixin.d.ts +3 -0
- package/lib/src/brand-page-maker/components/preview/Preview.stories.js +2 -2
- package/lib/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.d.ts +244 -1
- package/lib/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.js +68 -4
- package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.js +9 -1
- package/lib/src/brand-page-maker/stores/user/user-store.d.ts +4 -0
- package/lib/src/brand-page-maker/stores/user/user-store.js +4 -0
- package/lib/src/bundled-translations-DEk3SiLd.js +161 -0
- package/lib/src/bundles/bundled-translations.json +3 -1
- package/lib/src/clients/design-template-client.d.ts +1 -0
- package/lib/src/clients/models.d.ts +1 -0
- package/lib/src/css/library.brand-page-brandCrowd.min.css +48 -20
- package/lib/src/css/library.brand-page-brandPage.min.css +48 -20
- package/lib/src/css/library.brand-page-designCom.min.css +48 -20
- package/lib/src/css/library.brand-page-preview.min.css +48 -20
- package/lib/src/index.mjs +1 -1
- package/lib/src/{lib-BCV7U_Bf.js → lib-Dv7p4Gdd.js} +13374 -13187
- package/lib/src/shared/background-settings/components/background-shapes/BackgroundShapeSettings.mixin.d.ts +10 -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 +34 -2
- package/lib/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.mixin.d.ts +3 -0
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.d.ts +26 -0
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.js +6 -1
- package/lib/src/shared/content-settings/components/image-field/ImageField.mixin.js +3 -1
- package/lib/src/shared/content-settings/components/page-dropdown-field/PageDropdownField.mixin.d.ts +3 -0
- package/lib/src/shared/page-settings/components/delete-page-modal/DeletePageModal.mixin.d.ts +1 -1
- package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.d.ts +3 -0
- package/lib/src/shared/side-bar/components/SideBar.mixin.d.ts +3 -0
- package/lib/src/shared/style-settings/components/StyleSettings.mixin.d.ts +5 -0
- package/lib/src/shared/template-settings/components/TemplatesSettings.mixin.d.ts +1 -0
- package/lib/src/shared/template-settings/models.d.ts +2 -0
- package/lib/src/shared/template-settings/store/template-settings-store.d.ts +6 -0
- package/lib/src/shared/template-settings/store/template-settings-store.js +109 -35
- package/package.json +1 -1
- package/src/brand-page/components/page/Page.mixin.ts +24 -15
- package/src/brand-page/components/page/Page.stories.ts +2 -1
- package/src/brand-page/components/page/Page.vue +19 -3
- package/src/brand-page/models/index.ts +3 -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/migration/migration-07.ts +6 -4
- 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/components/template-preview/TemplatePreview.mixin.ts +90 -5
- package/src/brand-page-maker/components/template-preview/TemplatePreview.vue +41 -4
- package/src/brand-page-maker/components/template-preview-with-state/TemplatePreviewWithState.vue +4 -6
- package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.ts +14 -1
- package/src/brand-page-maker/stores/user/user-store.ts +5 -0
- package/src/bundles/bundled-translations.json +3 -1
- package/src/clients/design-template-client.ts +1 -0
- package/src/clients/models.ts +1 -0
- package/src/shared/background-settings/components/BackgroundSettings.vue +28 -8
- package/src/shared/background-settings/components/ReplaceImageSettingsForBackgroundSettings.vue +9 -0
- package/src/shared/background-settings/components/i18n/background-settings.json +3 -1
- package/src/shared/background-settings/store/background-settings-store.ts +51 -2
- package/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.ts +9 -3
- package/src/shared/content-settings/components/image-field/ImageField.mixin.ts +4 -1
- package/src/shared/template-settings/models.ts +2 -0
- package/src/shared/template-settings/store/template-settings-store.ts +141 -41
- package/lib/src/bundled-translations-D9iHE5G9.js +0 -161
|
@@ -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);
|
|
@@ -116,27 +120,28 @@ export default defineComponent({
|
|
|
116
120
|
return styles;
|
|
117
121
|
},
|
|
118
122
|
rootBackgroundStyles() {
|
|
123
|
+
console.log('vm styles ', this.viewModel.styles);
|
|
119
124
|
const styles = {
|
|
120
|
-
...(this.viewModel?.styles?.
|
|
125
|
+
...(this.viewModel?.styles?.backgroundStylesViewModel?.style || {}),
|
|
121
126
|
};
|
|
122
127
|
delete styles.backgroundAttachment;
|
|
123
|
-
if (this.viewModel.styles?.
|
|
124
|
-
(this.viewModel.styles.
|
|
125
|
-
!this.viewModel.styles?.
|
|
128
|
+
if (this.viewModel.styles?.backgroundStylesViewModel?.backgroundImageUrl &&
|
|
129
|
+
(this.viewModel.styles.backgroundStylesViewModel.backgroundImageUrl.endsWith(`.svg`) ||
|
|
130
|
+
!this.viewModel.styles?.backgroundStylesViewModel?.backgroundImageUrl.startsWith('http'))) {
|
|
126
131
|
// Any backgroundImageUrl that handles svg file, svg markup is handled as BackgroundShape object
|
|
127
132
|
delete styles.backgroundImage;
|
|
128
133
|
}
|
|
129
|
-
else if (this.viewModel?.styles?.
|
|
134
|
+
else if (this.viewModel?.styles?.backgroundStylesViewModel?.backgroundImageUrl) {
|
|
130
135
|
// if background is a gradient
|
|
131
|
-
if (this.viewModel?.styles?.
|
|
136
|
+
if (this.viewModel?.styles?.backgroundStylesViewModel?.style?.background?.startsWith('linear-gradient')) {
|
|
132
137
|
// combine image and gradient into the `background` property
|
|
133
|
-
styles.backgroundImage = `url(${this.viewModel?.styles?.
|
|
138
|
+
styles.backgroundImage = `url(${this.viewModel?.styles?.backgroundStylesViewModel?.backgroundImageUrl}), ${this.viewModel?.styles?.backgroundStylesViewModel?.style?.background}`;
|
|
134
139
|
delete styles.background;
|
|
135
140
|
}
|
|
136
141
|
else {
|
|
137
142
|
// background is a solid color
|
|
138
143
|
styles.backgroundColor = styles.background;
|
|
139
|
-
styles.backgroundImage = `url(${this.viewModel?.styles?.
|
|
144
|
+
styles.backgroundImage = `url(${this.viewModel?.styles?.backgroundStylesViewModel?.backgroundImageUrl})`;
|
|
140
145
|
delete styles.background;
|
|
141
146
|
}
|
|
142
147
|
}
|
|
@@ -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),
|
|
@@ -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,4 +1,4 @@
|
|
|
1
|
-
import { BRAND_PAGE_TYPES, DEFAULT_LOGO_HEIGHT, DEFAULT_LOGO_WIDTH,
|
|
1
|
+
import { BRAND_PAGE_TYPES, DEFAULT_LOGO_HEIGHT, DEFAULT_LOGO_WIDTH, } from '../..';
|
|
2
2
|
import { FabricRenderClient } from '../../../clients/fabric-render-client';
|
|
3
3
|
import { calculateLogoDimensions } from '../logo.util';
|
|
4
4
|
export const migration07 = async (migrationResult, options) => {
|
|
@@ -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;
|
|
@@ -11,6 +11,9 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
11
11
|
isAdmin: boolean;
|
|
12
12
|
}): void;
|
|
13
13
|
setBrandPageCommissionPercentage(payload: number): void;
|
|
14
|
+
setUserToken(payload: {
|
|
15
|
+
userToken: string;
|
|
16
|
+
}): void;
|
|
14
17
|
}>;
|
|
15
18
|
brandPageMakerStore: import("pinia").Store<"brandPageMaker", import("../../stores").BrandPageMakerState, {
|
|
16
19
|
contentErrorCount(): number;
|
|
@@ -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: {};
|
|
@@ -197,6 +197,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
197
197
|
isAdmin: boolean;
|
|
198
198
|
}): void;
|
|
199
199
|
setBrandPageCommissionPercentage(payload: number): void;
|
|
200
|
+
setUserToken(payload: {
|
|
201
|
+
userToken: string;
|
|
202
|
+
}): void;
|
|
200
203
|
}>;
|
|
201
204
|
containerStore: import("pinia").Store<"brandPageContainer", import("../../stores").BrandPageContainerState, {
|
|
202
205
|
brandPageContentTypes(): string[];
|
|
@@ -1021,6 +1024,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
1021
1024
|
}): void;
|
|
1022
1025
|
clearTemplates(): void;
|
|
1023
1026
|
getTemplateByTemplateId(id: string): import("../../../shared/template-settings/models").TemplateSettingsTemplate | undefined;
|
|
1027
|
+
setupLogoChangeWatcher(): void;
|
|
1024
1028
|
}>;
|
|
1025
1029
|
shopSettingStore: import("pinia").Store<"shopConfig", import("../../../shared/ecommerce-settings/store/shop-settings-store").ShopConfigState, {
|
|
1026
1030
|
productsJson(state: {
|
|
@@ -143,6 +143,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
143
143
|
isAdmin: boolean;
|
|
144
144
|
}): void;
|
|
145
145
|
setBrandPageCommissionPercentage(payload: number): void;
|
|
146
|
+
setUserToken(payload: {
|
|
147
|
+
userToken: string;
|
|
148
|
+
}): void;
|
|
146
149
|
}>;
|
|
147
150
|
}, {
|
|
148
151
|
imageExtension: string[];
|
|
@@ -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),
|