@designcrowd/library.brand-page 5.16.2-ast-preview-1 → 5.16.2-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.
Files changed (93) hide show
  1. package/lib/src/{CreatedOnBrandCrowd-de-de-BTQjYiwH.js → CreatedOnBrandCrowd-de-de-DNU1Er-B.js} +1 -1
  2. package/lib/src/{CreatedOnBrandCrowd-en-us-DzswEvvL.js → CreatedOnBrandCrowd-en-us-_rEZobcJ.js} +1 -1
  3. package/lib/src/{CreatedOnBrandCrowd-es-es-DPCSqIpT.js → CreatedOnBrandCrowd-es-es-Z8MVwPkv.js} +1 -1
  4. package/lib/src/{CreatedOnBrandCrowd-fr-fr-CZ29VWa6.js → CreatedOnBrandCrowd-fr-ca-DD-ahmng.js} +1 -1
  5. package/lib/src/{CreatedOnBrandCrowd-fr-ca-CZ29VWa6.js → CreatedOnBrandCrowd-fr-fr-DD-ahmng.js} +1 -1
  6. package/lib/src/{CreatedOnBrandCrowd-pt-pt-Da_WGhKg.js → CreatedOnBrandCrowd-pt-br-IBuHKnVv.js} +1 -1
  7. package/lib/src/{CreatedOnBrandCrowd-pt-br-Da_WGhKg.js → CreatedOnBrandCrowd-pt-pt-IBuHKnVv.js} +1 -1
  8. package/lib/src/{CreatedOnDcom-de-de-blHR4WbT.js → CreatedOnDcom-de-de-3Og8TFZa.js} +1 -1
  9. package/lib/src/{CreatedOnDcom-en-us-fRN0Ox2R.js → CreatedOnDcom-en-us-C4Fb7TIR.js} +1 -1
  10. package/lib/src/{CreatedOnDcom-es-es-afLu2Y1A.js → CreatedOnDcom-es-es-DE5IMJv7.js} +1 -1
  11. package/lib/src/{CreatedOnDcom-fr-ca-fvpFoGkr.js → CreatedOnDcom-fr-ca-Cz86k5KW.js} +1 -1
  12. package/lib/src/{CreatedOnDcom-fr-fr-CEnbchMK.js → CreatedOnDcom-fr-fr-DdQ9z_Rb.js} +1 -1
  13. package/lib/src/{CreatedOnDcom-pt-br-B0QuvNvD.js → CreatedOnDcom-pt-br-DItYjheI.js} +1 -1
  14. package/lib/src/{CreatedOnDcom-pt-pt-Cg-reIwt.js → CreatedOnDcom-pt-pt-C0YW3Q40.js} +1 -1
  15. package/lib/src/brand-page/components/page/Page.mixin.js +20 -15
  16. package/lib/src/brand-page/components/page/Page.stories.js +2 -2
  17. package/lib/src/brand-page/models/index.d.ts +1 -0
  18. package/lib/src/brand-page/models/index.js +2 -0
  19. package/lib/src/brand-page/utils/migration/migration-07.js +1 -1
  20. package/lib/src/brand-page/utils/view-model.util.d.ts +2 -1
  21. package/lib/src/brand-page/utils/view-model.util.js +27 -2
  22. package/lib/src/brand-page/view-models.d.ts +17 -2
  23. package/lib/src/brand-page-maker/components/action-bar/ActionBar.mixin.d.ts +0 -3
  24. package/lib/src/brand-page-maker/components/admin-background-settings/AdminBackgroundSettings.mixin.d.ts +7 -2
  25. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.d.ts +0 -4
  26. package/lib/src/brand-page-maker/components/brandpage-settings/ReplaceImageSettingsForBrandPageSettings.mixin.d.ts +0 -3
  27. package/lib/src/brand-page-maker/components/preview/Preview.stories.js +2 -2
  28. package/lib/src/brand-page-maker/components/seo-settings/UrlSettings.mixin.d.ts +0 -22
  29. package/lib/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.d.ts +1 -243
  30. package/lib/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.js +4 -64
  31. package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.js +1 -9
  32. package/lib/src/brand-page-maker/stores/route/localised-route-store.d.ts +0 -23
  33. package/lib/src/brand-page-maker/stores/route/localised-route-store.js +0 -16
  34. package/lib/src/brand-page-maker/stores/user/user-store.d.ts +0 -4
  35. package/lib/src/brand-page-maker/stores/user/user-store.js +0 -4
  36. package/lib/src/brand-page-maker/stores/video/video-store.js +1 -1
  37. package/lib/src/bundled-translations-DEk3SiLd.js +161 -0
  38. package/lib/src/bundles/bundled-translations.json +3 -1
  39. package/lib/src/clients/design-template-client.d.ts +0 -1
  40. package/lib/src/clients/models.d.ts +0 -1
  41. package/lib/src/css/library.brand-page-brandCrowd.min.css +28 -50
  42. package/lib/src/css/library.brand-page-brandPage.min.css +28 -50
  43. package/lib/src/css/library.brand-page-designCom.min.css +28 -50
  44. package/lib/src/css/library.brand-page-preview.min.css +28 -50
  45. package/lib/src/index.mjs +1 -1
  46. package/lib/src/{lib-xSt_yR6c.js → lib-C_Vr2Dov.js} +17054 -17082
  47. package/lib/src/shared/background-settings/components/background-shapes/BackgroundShapeSettings.mixin.d.ts +7 -5
  48. package/lib/src/shared/background-settings/store/background-settings-store.d.ts +3 -0
  49. package/lib/src/shared/background-settings/store/background-settings-store.js +34 -2
  50. package/lib/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.mixin.d.ts +0 -3
  51. package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.d.ts +0 -3
  52. package/lib/src/shared/content-settings/components/image-field/ImageField.mixin.js +3 -1
  53. package/lib/src/shared/content-settings/components/page-dropdown-field/PageDropdownField.mixin.d.ts +0 -3
  54. package/lib/src/shared/page-settings/components/delete-page-modal/DeletePageModal.mixin.d.ts +1 -1
  55. package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.d.ts +0 -3
  56. package/lib/src/shared/side-bar/components/SideBar.mixin.d.ts +0 -3
  57. package/lib/src/shared/style-settings/components/StyleSettings.mixin.d.ts +2 -3
  58. package/lib/src/shared/template-settings/components/TemplatesSettings.mixin.d.ts +0 -1
  59. package/lib/src/shared/template-settings/models.d.ts +0 -2
  60. package/lib/src/shared/template-settings/store/template-settings-store.d.ts +0 -5
  61. package/lib/src/shared/template-settings/store/template-settings-store.js +8 -74
  62. package/package.json +1 -1
  63. package/src/brand-page/components/page/Page.mixin.ts +24 -15
  64. package/src/brand-page/components/page/Page.stories.ts +2 -1
  65. package/src/brand-page/components/page/Page.vue +19 -3
  66. package/src/brand-page/models/index.ts +3 -0
  67. package/src/brand-page/utils/__snapshots__/migration.util.test.ts.snap +3 -0
  68. package/src/brand-page/utils/__snapshots__/migration2.util.test.ts.snap +1 -0
  69. package/src/brand-page/utils/__snapshots__/model.util.test.ts.snap +2 -0
  70. package/src/brand-page/utils/migration/migration-07.ts +4 -6
  71. package/src/brand-page/utils/view-model.util.ts +42 -2
  72. package/src/brand-page/view-models.ts +23 -1
  73. package/src/brand-page-maker/components/preview/Preview.stories.ts +2 -1
  74. package/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.ts +5 -85
  75. package/src/brand-page-maker/components/template-preview/TemplatePreview.vue +4 -41
  76. package/src/brand-page-maker/components/template-preview-with-state/TemplatePreviewWithState.vue +6 -4
  77. package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.ts +1 -14
  78. package/src/brand-page-maker/stores/route/localised-route-store.ts +0 -33
  79. package/src/brand-page-maker/stores/user/user-store.ts +0 -5
  80. package/src/brand-page-maker/stores/video/video-store.ts +1 -1
  81. package/src/bundles/bundled-translations.json +3 -1
  82. package/src/clients/design-template-client.ts +0 -1
  83. package/src/clients/models.ts +0 -1
  84. package/src/shared/background-settings/components/BackgroundSettings.vue +28 -8
  85. package/src/shared/background-settings/components/ReplaceImageSettingsForBackgroundSettings.vue +9 -0
  86. package/src/shared/background-settings/components/i18n/background-settings.json +3 -1
  87. package/src/shared/background-settings/store/background-settings-store.ts +51 -2
  88. package/src/shared/content-settings/components/image-field/ImageField.mixin.ts +4 -1
  89. package/src/shared/content-settings/components/replace-image-base-settings/ReplaceImageBaseSettings.vue +3 -0
  90. package/src/shared/template-settings/models.ts +0 -2
  91. package/src/shared/template-settings/store/template-settings-store.ts +14 -105
  92. package/src/shared/video-library/VideoLibrary.vue +1 -1
  93. package/lib/src/bundled-translations-D9iHE5G9.js +0 -161
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as e, openBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-xSt_yR6c.js";
2
+ import { _ as t } from "./lib-C_Vr2Dov.js";
3
3
  const i = {}, h = {
4
4
  width: "275",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as e, openBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-xSt_yR6c.js";
2
+ import { _ as t } from "./lib-C_Vr2Dov.js";
3
3
  const i = {}, h = {
4
4
  width: "251",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as e, openBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-xSt_yR6c.js";
2
+ import { _ as t } from "./lib-C_Vr2Dov.js";
3
3
  const i = {}, h = {
4
4
  width: "250",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as e, openBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-xSt_yR6c.js";
2
+ import { _ as t } from "./lib-C_Vr2Dov.js";
3
3
  const i = {}, h = {
4
4
  width: "237",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as e, openBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-xSt_yR6c.js";
2
+ import { _ as t } from "./lib-C_Vr2Dov.js";
3
3
  const i = {}, h = {
4
4
  width: "237",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as e, openBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-xSt_yR6c.js";
2
+ import { _ as t } from "./lib-C_Vr2Dov.js";
3
3
  const i = {}, h = {
4
4
  width: "263",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as e, openBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-xSt_yR6c.js";
2
+ import { _ as t } from "./lib-C_Vr2Dov.js";
3
3
  const i = {}, h = {
4
4
  width: "263",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as H, openBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as e } from "./lib-xSt_yR6c.js";
2
+ import { _ as e } from "./lib-C_Vr2Dov.js";
3
3
  const M = {}, Z = {
4
4
  width: "242",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as H, openBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as e } from "./lib-xSt_yR6c.js";
2
+ import { _ as e } from "./lib-C_Vr2Dov.js";
3
3
  const i = {}, M = {
4
4
  width: "231",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as H, openBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as e } from "./lib-xSt_yR6c.js";
2
+ import { _ as e } from "./lib-C_Vr2Dov.js";
3
3
  const M = {}, Z = {
4
4
  width: "230",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as H, openBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as e } from "./lib-xSt_yR6c.js";
2
+ import { _ as e } from "./lib-C_Vr2Dov.js";
3
3
  const i = {}, l = {
4
4
  width: "216",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as H, openBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as e } from "./lib-xSt_yR6c.js";
2
+ import { _ as e } from "./lib-C_Vr2Dov.js";
3
3
  const i = {}, l = {
4
4
  width: "216",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as H, openBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as M } from "./lib-xSt_yR6c.js";
2
+ import { _ as M } from "./lib-C_Vr2Dov.js";
3
3
  const Z = {}, e = {
4
4
  width: "232",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as H, openBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as M } from "./lib-xSt_yR6c.js";
2
+ import { _ as M } from "./lib-C_Vr2Dov.js";
3
3
  const Z = {}, e = {
4
4
  width: "232",
5
5
  height: "36",
@@ -79,15 +79,18 @@ export default defineComponent({
79
79
  },
80
80
  backgroundShapes() {
81
81
  const backgroundShapes = [
82
- ...(this.viewModel?.styles?.backgroundStyles?.backgroundShapes || []),
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?.backgroundStyles?.backgroundImageUrl) {
87
+ if (this.viewModel.styles?.backgroundStylesViewModel?.backgroundImageUrl) {
87
88
  backgroundShapes.splice(0, 0, {
88
- name: this.viewModel.styles.backgroundStyles.backgroundImageUrl,
89
+ name: this.viewModel.styles.backgroundStylesViewModel
90
+ .backgroundImageUrl,
89
91
  style: {
90
- ...this.viewModel.styles.backgroundStyles.backgroundShapeStyle,
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?.backgroundStyles?.backgroundImageUrl &&
101
- this.viewModel?.styles?.backgroundStyles?.style) {
103
+ if (!this.viewModel?.styles?.backgroundStylesViewModel
104
+ ?.backgroundImageUrl &&
105
+ this.viewModel?.styles?.backgroundStylesViewModel?.style) {
102
106
  styles = {
103
- ...this.viewModel?.styles?.backgroundStyles?.style,
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?.backgroundStyles?.style || {}),
125
+ ...(this.viewModel?.styles?.backgroundStylesViewModel?.style || {}),
121
126
  };
122
127
  delete styles.backgroundAttachment;
123
- if (this.viewModel.styles?.backgroundStyles?.backgroundImageUrl &&
124
- (this.viewModel.styles.backgroundStyles.backgroundImageUrl.endsWith(`.svg`) ||
125
- !this.viewModel.styles?.backgroundStyles?.backgroundImageUrl.startsWith('http'))) {
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?.backgroundStyles?.backgroundImageUrl) {
134
+ else if (this.viewModel?.styles?.backgroundStylesViewModel?.backgroundImageUrl) {
130
135
  // if background is a gradient
131
- if (this.viewModel?.styles?.backgroundStyles?.style?.background?.startsWith('linear-gradient')) {
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?.backgroundStyles?.backgroundImageUrl}), ${this.viewModel?.styles?.backgroundStyles?.style?.background}`;
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?.backgroundStyles?.backgroundImageUrl})`;
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, } from '../..';
1
+ import { BRAND_PAGE_TYPES, DEFAULT_LOGO_HEIGHT, DEFAULT_LOGO_WIDTH, PageFooterDesktop, PageFooterMobile, PageHeaderDesktop, PageHeaderMobile, } 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?.backgroundStyles.backgroundImageUrl;
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 { PageStyles, 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 } from './models';
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: PageStyles;
155
+ styles: PageStylesViewModel;
141
156
  pages: PageViewModel[];
142
157
  brandPageType: BrandPageType;
143
158
  headerViewModelDesktop: PageHeaderViewModel;
@@ -11,9 +11,6 @@ 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;
17
14
  }>;
18
15
  brandPageMakerStore: import("pinia").Store<"brandPageMaker", import("../../stores").BrandPageMakerState, {
19
16
  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,9 +197,6 @@ 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;
203
200
  }>;
204
201
  containerStore: import("pinia").Store<"brandPageContainer", import("../../stores").BrandPageContainerState, {
205
202
  brandPageContentTypes(): string[];
@@ -1024,7 +1021,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
1024
1021
  }): void;
1025
1022
  clearTemplates(): void;
1026
1023
  getTemplateByTemplateId(id: string): import("../../../shared/template-settings/models").TemplateSettingsTemplate | undefined;
1027
- setupLogoChangeWatcher(): void;
1028
1024
  }>;
1029
1025
  shopSettingStore: import("pinia").Store<"shopConfig", import("../../../shared/ecommerce-settings/store/shop-settings-store").ShopConfigState, {
1030
1026
  productsJson(state: {
@@ -143,9 +143,6 @@ 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;
149
146
  }>;
150
147
  }, {
151
148
  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),
@@ -375,7 +375,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
375
375
  currentPublishedSlugUrl: (state: {
376
376
  baseFabricRenderDomain: string;
377
377
  baseBrandPageDomain: string;
378
- baseTemplatePreviewDomain: string;
379
378
  upgradeSubscriptionUrlPath: string;
380
379
  reactivationUrlPath: string;
381
380
  backToWebsiteManageUrlPath: string;
@@ -394,7 +393,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
394
393
  currentBrandPageUrl: (state: {
395
394
  baseFabricRenderDomain: string;
396
395
  baseBrandPageDomain: string;
397
- baseTemplatePreviewDomain: string;
398
396
  upgradeSubscriptionUrlPath: string;
399
397
  reactivationUrlPath: string;
400
398
  backToWebsiteManageUrlPath: string;
@@ -414,7 +412,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
414
412
  getBuilderLandingPageByTypeUrl: (state: {
415
413
  baseFabricRenderDomain: string;
416
414
  baseBrandPageDomain: string;
417
- baseTemplatePreviewDomain: string;
418
415
  upgradeSubscriptionUrlPath: string;
419
416
  reactivationUrlPath: string;
420
417
  backToWebsiteManageUrlPath: string;
@@ -431,25 +428,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
431
428
  localisedBaseUrl: string;
432
429
  } & import("pinia").PiniaCustomStateProperties<import("../../stores").LocalisedRouteState>) => (isPreview: boolean, brandPageType: string, isDesignCom: boolean, locale: string) => string;
433
430
  getWebsiteBaseUrl: () => (isDesignCom: boolean) => "https://www.design.com" | "https://www.brandcrowd.com";
434
- getTemplatePreviewUrl: (state: {
435
- baseFabricRenderDomain: string;
436
- baseBrandPageDomain: string;
437
- baseTemplatePreviewDomain: string;
438
- upgradeSubscriptionUrlPath: string;
439
- reactivationUrlPath: string;
440
- backToWebsiteManageUrlPath: string;
441
- manageWebsiteDesignsUrlPath: string;
442
- createNewDesignUrlPath: string;
443
- termsOfUseUrlPath: string;
444
- websiteBuilderUrlPath: string;
445
- digitalBusinessCardBuilderUrlPath: string;
446
- linkInBioBuilderUrlPath: string;
447
- brandPageEditorUrlPath: string;
448
- brandSiteEditorUrlPath: string;
449
- brandContactEditorUrlPath: string;
450
- logoEditUrlPath: string;
451
- localisedBaseUrl: string;
452
- } & import("pinia").PiniaCustomStateProperties<import("../../stores").LocalisedRouteState>) => (templateId: string, logoDraftToken: string, deviceType: "desktop" | "mobile", contentKey?: string | undefined, userToken?: string | undefined, runtimeEnvironment?: string | undefined, isAiTemplate?: boolean | undefined) => string;
453
431
  }, {
454
432
  initialise(payload: any): void;
455
433
  }>;