@designcrowd/library.brand-page 5.16.10 → 5.16.11

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 (82) hide show
  1. package/lib/src/{CreatedOnBrandCrowd-de-de-Br0lVuG3.js → CreatedOnBrandCrowd-de-de-bzhKDyJv.js} +1 -1
  2. package/lib/src/{CreatedOnBrandCrowd-en-us-BUh01IwB.js → CreatedOnBrandCrowd-en-us-j4ZI_pqK.js} +1 -1
  3. package/lib/src/{CreatedOnBrandCrowd-es-es-CpsF5FnB.js → CreatedOnBrandCrowd-es-es--kt8fo5B.js} +1 -1
  4. package/lib/src/{CreatedOnBrandCrowd-fr-fr-Cf9afSIR.js → CreatedOnBrandCrowd-fr-ca-CiCdKxFb.js} +1 -1
  5. package/lib/src/{CreatedOnBrandCrowd-fr-ca-Cf9afSIR.js → CreatedOnBrandCrowd-fr-fr-CiCdKxFb.js} +1 -1
  6. package/lib/src/{CreatedOnBrandCrowd-pt-pt-CFdOEKvD.js → CreatedOnBrandCrowd-pt-br-CgEfKC9V.js} +1 -1
  7. package/lib/src/{CreatedOnBrandCrowd-pt-br-CFdOEKvD.js → CreatedOnBrandCrowd-pt-pt-CgEfKC9V.js} +1 -1
  8. package/lib/src/{CreatedOnDcom-de-de-cmu5K1ho.js → CreatedOnDcom-de-de-CUZ6g2BX.js} +1 -1
  9. package/lib/src/{CreatedOnDcom-en-us-B268amgO.js → CreatedOnDcom-en-us-Dk3tpBIt.js} +1 -1
  10. package/lib/src/{CreatedOnDcom-es-es-CfGG58vu.js → CreatedOnDcom-es-es-UMt6sl46.js} +1 -1
  11. package/lib/src/{CreatedOnDcom-fr-ca-Bjl75MMT.js → CreatedOnDcom-fr-ca-DB-oAlcL.js} +1 -1
  12. package/lib/src/{CreatedOnDcom-fr-fr-kklHfB6q.js → CreatedOnDcom-fr-fr-DDQ5o8K8.js} +1 -1
  13. package/lib/src/{CreatedOnDcom-pt-br-D_kwlo71.js → CreatedOnDcom-pt-br-Bp6ian7l.js} +1 -1
  14. package/lib/src/{CreatedOnDcom-pt-pt-XwJDiVHY.js → CreatedOnDcom-pt-pt-DNRtLje1.js} +1 -1
  15. package/lib/src/brand-page/components/page/Page.mixin.js +19 -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/view-model.util.d.ts +2 -1
  20. package/lib/src/brand-page/utils/view-model.util.js +27 -2
  21. package/lib/src/brand-page/view-models.d.ts +17 -2
  22. package/lib/src/brand-page-maker/components/admin-background-settings/AdminBackgroundSettings.mixin.d.ts +7 -2
  23. package/lib/src/brand-page-maker/components/preview/Preview.stories.js +2 -2
  24. package/lib/src/bundled-translations-0k_bW9M3.js +163 -0
  25. package/lib/src/bundled-translations.de-DE-alPJDdV5.js +163 -0
  26. package/lib/src/bundled-translations.es-ES-DvG6dxbl.js +163 -0
  27. package/lib/src/bundled-translations.fr-CA-uKGhZH2y.js +163 -0
  28. package/lib/src/bundled-translations.fr-FR-DsR3NACS.js +163 -0
  29. package/lib/src/bundled-translations.pt-BR-Bh9w3i0j.js +163 -0
  30. package/lib/src/bundled-translations.pt-PT-BzegT--8.js +163 -0
  31. package/lib/src/bundles/bundled-translations.de-DE.json +3 -1
  32. package/lib/src/bundles/bundled-translations.es-ES.json +3 -1
  33. package/lib/src/bundles/bundled-translations.fr-CA.json +3 -1
  34. package/lib/src/bundles/bundled-translations.fr-FR.json +3 -1
  35. package/lib/src/bundles/bundled-translations.json +3 -1
  36. package/lib/src/bundles/bundled-translations.pt-BR.json +3 -1
  37. package/lib/src/bundles/bundled-translations.pt-PT.json +3 -1
  38. package/lib/src/css/library.brand-page-brandCrowd.min.css +18 -15
  39. package/lib/src/css/library.brand-page-brandPage.min.css +18 -15
  40. package/lib/src/css/library.brand-page-designCom.min.css +18 -15
  41. package/lib/src/css/library.brand-page-preview.min.css +18 -15
  42. package/lib/src/index.mjs +1 -1
  43. package/lib/src/{lib-l_4XUq5L.js → lib-cP7DqVjt.js} +10026 -9952
  44. package/lib/src/shared/background-settings/components/background-shapes/BackgroundShapeSettings.mixin.d.ts +7 -2
  45. package/lib/src/shared/background-settings/store/background-settings-store.d.ts +3 -0
  46. package/lib/src/shared/background-settings/store/background-settings-store.js +43 -2
  47. package/lib/src/shared/style-settings/components/StyleSettings.mixin.d.ts +2 -0
  48. package/package.json +1 -1
  49. package/src/brand-page/components/page/Page.mixin.ts +23 -15
  50. package/src/brand-page/components/page/Page.stories.ts +2 -1
  51. package/src/brand-page/components/page/Page.vue +17 -1
  52. package/src/brand-page/models/index.ts +2 -0
  53. package/src/brand-page/utils/__snapshots__/migration.util.test.ts.snap +3 -0
  54. package/src/brand-page/utils/__snapshots__/migration2.util.test.ts.snap +1 -0
  55. package/src/brand-page/utils/__snapshots__/model.util.test.ts.snap +2 -0
  56. package/src/brand-page/utils/view-model.util.ts +42 -2
  57. package/src/brand-page/view-models.ts +23 -1
  58. package/src/brand-page-maker/components/preview/Preview.stories.ts +2 -1
  59. package/src/bundles/bundled-translations.de-DE.json +3 -1
  60. package/src/bundles/bundled-translations.es-ES.json +3 -1
  61. package/src/bundles/bundled-translations.fr-CA.json +3 -1
  62. package/src/bundles/bundled-translations.fr-FR.json +3 -1
  63. package/src/bundles/bundled-translations.json +3 -1
  64. package/src/bundles/bundled-translations.pt-BR.json +3 -1
  65. package/src/bundles/bundled-translations.pt-PT.json +3 -1
  66. package/src/shared/background-settings/components/BackgroundSettings.vue +25 -8
  67. package/src/shared/background-settings/components/ReplaceImageSettingsForBackgroundSettings.vue +13 -1
  68. package/src/shared/background-settings/components/i18n/background-settings.de-DE.json +3 -1
  69. package/src/shared/background-settings/components/i18n/background-settings.es-ES.json +3 -1
  70. package/src/shared/background-settings/components/i18n/background-settings.fr-CA.json +3 -1
  71. package/src/shared/background-settings/components/i18n/background-settings.fr-FR.json +3 -1
  72. package/src/shared/background-settings/components/i18n/background-settings.json +3 -1
  73. package/src/shared/background-settings/components/i18n/background-settings.pt-BR.json +3 -1
  74. package/src/shared/background-settings/components/i18n/background-settings.pt-PT.json +3 -1
  75. package/src/shared/background-settings/store/background-settings-store.ts +60 -2
  76. package/lib/src/bundled-translations-Dw3XtNmX.js +0 -163
  77. package/lib/src/bundled-translations.de-DE-B82Ik9M7.js +0 -163
  78. package/lib/src/bundled-translations.es-ES-cf3pdNuN.js +0 -163
  79. package/lib/src/bundled-translations.fr-CA-DP44EcAZ.js +0 -163
  80. package/lib/src/bundled-translations.fr-FR-V0Zt25kg.js +0 -163
  81. package/lib/src/bundled-translations.pt-BR-Brv6rCss.js +0 -163
  82. package/lib/src/bundled-translations.pt-PT-BTgscCTG.js +0 -163
@@ -16,7 +16,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
16
16
  aspectRatio?: string | undefined;
17
17
  width?: string | undefined;
18
18
  height?: string | undefined;
19
- textAlign?: string | undefined;
20
19
  backgroundAttachment?: string | undefined;
21
20
  background?: string | undefined;
22
21
  backgroundImage?: string | undefined;
@@ -48,6 +47,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
48
47
  overflowWrap?: string | undefined;
49
48
  paddingTop?: string | undefined;
50
49
  position?: string | undefined;
50
+ textAlign?: string | undefined;
51
51
  textDecoration?: string | undefined;
52
52
  top?: string | undefined;
53
53
  transform?: string | undefined;
@@ -60,7 +60,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
60
60
  aspectRatio?: string | undefined;
61
61
  width?: string | undefined;
62
62
  height?: string | undefined;
63
- textAlign?: string | undefined;
64
63
  backgroundAttachment?: string | undefined;
65
64
  background?: string | undefined;
66
65
  backgroundImage?: string | undefined;
@@ -92,6 +91,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
92
91
  overflowWrap?: string | undefined;
93
92
  paddingTop?: string | undefined;
94
93
  position?: string | undefined;
94
+ textAlign?: string | undefined;
95
95
  textDecoration?: string | undefined;
96
96
  top?: string | undefined;
97
97
  transform?: string | undefined;
@@ -149,6 +149,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
149
149
  };
150
150
  }[];
151
151
  personalisationRole?: "website" | "email" | "phone" | "profile" | "about" | "information" | "media" | undefined;
152
+ media?: {
153
+ type: import("../../../../brand-page").MediaTypes;
154
+ } | undefined;
152
155
  }>;
153
156
  userStore: import("pinia").Store<"brandPageMakerUser", import("../../../../brand-page-maker/stores").UserState, {}, {
154
157
  setEmailAddress(payload: string): void;
@@ -197,6 +200,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
197
200
  setBackgroundMode(payload: {
198
201
  backgroundMode: "images" | "edit";
199
202
  }): void;
203
+ setBackgroundMedia(payload: import("../../../my-uploads/models").MediaBaseSelectedPayload): void;
204
+ removeBackgroundVideo(): void;
200
205
  }>;
201
206
  }, {}, {
202
207
  color(): string;
@@ -2,6 +2,7 @@ import type { BackgroundShape, BackgroundStyle, BackgroundStyles, Personalisatio
2
2
  import { type BrandPageSettingsMode } from '../../../brand-page-maker/stores/brandpage-maker/brandpage-maker-store';
3
3
  import type { SetBackgroundShapeSettingsPayload, SetLogoColorsPayload, SetRecommendedLogoColorsPayload } from '../background-settings-models';
4
4
  import type { BackgroundSetStatePayload, BackgroundSettingsTabId } from '../models';
5
+ import type { MediaBaseSelectedPayload } from '../../my-uploads/models';
5
6
  export interface BackgroundSettingsState {
6
7
  backgroundStyles: BackgroundStyles;
7
8
  logoColors: string[];
@@ -45,4 +46,6 @@ export declare const useUiBackgroundSettingsStore: import("pinia").StoreDefiniti
45
46
  setBackgroundMode(payload: {
46
47
  backgroundMode: BrandPageSettingsMode;
47
48
  }): void;
49
+ setBackgroundMedia(payload: MediaBaseSelectedPayload): void;
50
+ removeBackgroundVideo(): void;
48
51
  }>;
@@ -1,8 +1,8 @@
1
- import { PageStyles } from '../../../brand-page';
1
+ import { GettyVideoMedia, PageStyles } from '../../../brand-page';
2
2
  import { BRANDPAGE_SETTINGS_MODES, } from '../../../brand-page-maker/stores/brandpage-maker/brandpage-maker-store';
3
3
  import { backgroundSettingsTabId } from '../models';
4
4
  import { defineStore } from 'pinia';
5
- import { useUiStore } from '../../../brand-page-maker/stores';
5
+ import { useUiStore, useVideoStore } from '../../../brand-page-maker/stores';
6
6
  export const useUiBackgroundSettingsStore = defineStore('uiBackgroundSettings', {
7
7
  state: () => ({
8
8
  backgroundStyles: {
@@ -10,6 +10,7 @@ export const useUiBackgroundSettingsStore = defineStore('uiBackgroundSettings',
10
10
  backgroundShapeStyle: {},
11
11
  backgroundShapes: [],
12
12
  backgroundImageUrl: '',
13
+ media: undefined,
13
14
  },
14
15
  logoColors: [],
15
16
  recommendedLogoColors: [],
@@ -48,6 +49,10 @@ export const useUiBackgroundSettingsStore = defineStore('uiBackgroundSettings',
48
49
  },
49
50
  setBackgroundImageUrl({ backgroundImageUrl, }) {
50
51
  this.backgroundStyles.backgroundImageUrl = backgroundImageUrl;
52
+ // Clear media
53
+ if (this.backgroundStyles?.media) {
54
+ this.backgroundStyles.media = undefined;
55
+ }
51
56
  this.setBackgroundStyle({
52
57
  backgroundStyle: {
53
58
  backgroundRepeat: 'no-repeat',
@@ -111,6 +116,12 @@ export const useUiBackgroundSettingsStore = defineStore('uiBackgroundSettings',
111
116
  this.setBackgroundPersonalisationRole({
112
117
  personalisationRole: backgroundStyles.personalisationRole,
113
118
  });
119
+ if (backgroundStyles.media) {
120
+ this.backgroundStyles.media = backgroundStyles.media;
121
+ }
122
+ else {
123
+ this.backgroundStyles.media = undefined;
124
+ }
114
125
  this.onBackgroundChanged();
115
126
  },
116
127
  setBackgroundShapeSettings(payload) {
@@ -130,5 +141,35 @@ export const useUiBackgroundSettingsStore = defineStore('uiBackgroundSettings',
130
141
  setBackgroundMode(payload) {
131
142
  this.backgroundMode = payload.backgroundMode;
132
143
  },
144
+ setBackgroundMedia(payload) {
145
+ if (payload.type === 'getty-video') {
146
+ const gettyMedia = payload;
147
+ const videoStore = useVideoStore();
148
+ videoStore.setVideoUrlsWithToken(gettyMedia.token, gettyMedia.videoSrc, gettyMedia.imageSrc, gettyMedia.assetId);
149
+ this.backgroundStyles.media = new GettyVideoMedia({
150
+ gettyToken: gettyMedia.token,
151
+ gettyAssetId: gettyMedia.assetId,
152
+ mimeType: gettyMedia.mimeType,
153
+ settings: {
154
+ autoPlay: gettyMedia.autoPlay,
155
+ },
156
+ });
157
+ // Clear any existing background image/shape
158
+ this.backgroundStyles.backgroundImageUrl = '';
159
+ // Default background style for videos
160
+ this.setBackgroundStyle({
161
+ backgroundStyle: {
162
+ backgroundRepeat: 'no-repeat',
163
+ backgroundPosition: 'center center',
164
+ backgroundSize: 'cover',
165
+ },
166
+ });
167
+ this.onBackgroundChanged();
168
+ }
169
+ },
170
+ removeBackgroundVideo() {
171
+ this.backgroundStyles.media = undefined;
172
+ this.onBackgroundChanged();
173
+ },
133
174
  },
134
175
  });
@@ -853,6 +853,8 @@ declare const _default: import("vue").DefineComponent<{}, {
853
853
  setBackgroundMode(payload: {
854
854
  backgroundMode: "images" | "edit";
855
855
  }): void;
856
+ setBackgroundMedia(payload: import("../../my-uploads/models").MediaBaseSelectedPayload): void;
857
+ removeBackgroundVideo(): void;
856
858
  }>;
857
859
  eventTracker: {
858
860
  sendExperimentStartedEvent: (abTestKey: string, abTestValue: string) => void;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@designcrowd/library.brand-page",
3
3
  "description": "A collection of Maker/Designer applications",
4
- "version": "5.16.10",
4
+ "version": "5.16.11",
5
5
  "author": "Design.com Eng",
6
6
  "license": "UNLICENSED",
7
7
  "type": "module",
@@ -99,16 +99,21 @@ export default defineComponent({
99
99
 
100
100
  backgroundShapes(): BackgroundShape[] {
101
101
  const backgroundShapes: BackgroundShape[] = [
102
- ...(this.viewModel?.styles?.backgroundStyles?.backgroundShapes || []),
102
+ ...(this.viewModel?.styles?.backgroundStylesViewModel
103
+ ?.backgroundShapes || []),
103
104
  ];
104
105
 
105
106
  // TODO: create style viewmodel object to include backgroundImageContent attribute only on viewmodel
106
107
  // p.s backgroundImageUrl can be url or SVG content string
107
- if (this.viewModel.styles?.backgroundStyles?.backgroundImageUrl) {
108
+ if (
109
+ this.viewModel.styles?.backgroundStylesViewModel?.backgroundImageUrl
110
+ ) {
108
111
  backgroundShapes.splice(0, 0, {
109
- name: this.viewModel.styles.backgroundStyles.backgroundImageUrl,
112
+ name: this.viewModel.styles.backgroundStylesViewModel
113
+ .backgroundImageUrl,
110
114
  style: {
111
- ...this.viewModel.styles.backgroundStyles.backgroundShapeStyle,
115
+ ...this.viewModel.styles.backgroundStylesViewModel
116
+ .backgroundShapeStyle,
112
117
  width: `100%`,
113
118
  height: `100%`,
114
119
  },
@@ -122,11 +127,12 @@ export default defineComponent({
122
127
  let styles: BrandPageCssStyle = {};
123
128
 
124
129
  if (
125
- !this.viewModel?.styles?.backgroundStyles?.backgroundImageUrl &&
126
- this.viewModel?.styles?.backgroundStyles?.style
130
+ !this.viewModel?.styles?.backgroundStylesViewModel
131
+ ?.backgroundImageUrl &&
132
+ this.viewModel?.styles?.backgroundStylesViewModel?.style
127
133
  ) {
128
134
  styles = {
129
- ...this.viewModel?.styles?.backgroundStyles?.style,
135
+ ...this.viewModel?.styles?.backgroundStylesViewModel?.style,
130
136
  };
131
137
  }
132
138
 
@@ -150,37 +156,39 @@ export default defineComponent({
150
156
 
151
157
  rootBackgroundStyles(): BrandPageCssStyle {
152
158
  const styles: BrandPageCssStyle = {
153
- ...(this.viewModel?.styles?.backgroundStyles?.style || {}),
159
+ ...(this.viewModel?.styles?.backgroundStylesViewModel?.style || {}),
154
160
  };
155
161
 
156
162
  delete styles.backgroundAttachment;
157
163
 
158
164
  if (
159
- this.viewModel.styles?.backgroundStyles?.backgroundImageUrl &&
160
- (this.viewModel.styles.backgroundStyles.backgroundImageUrl.endsWith(
165
+ this.viewModel.styles?.backgroundStylesViewModel?.backgroundImageUrl &&
166
+ (this.viewModel.styles.backgroundStylesViewModel.backgroundImageUrl.endsWith(
161
167
  `.svg`,
162
168
  ) ||
163
- !this.viewModel.styles?.backgroundStyles?.backgroundImageUrl.startsWith(
169
+ !this.viewModel.styles?.backgroundStylesViewModel?.backgroundImageUrl.startsWith(
164
170
  'http',
165
171
  ))
166
172
  ) {
167
173
  // Any backgroundImageUrl that handles svg file, svg markup is handled as BackgroundShape object
168
174
  delete styles.backgroundImage;
169
- } else if (this.viewModel?.styles?.backgroundStyles?.backgroundImageUrl) {
175
+ } else if (
176
+ this.viewModel?.styles?.backgroundStylesViewModel?.backgroundImageUrl
177
+ ) {
170
178
  // if background is a gradient
171
179
  if (
172
- this.viewModel?.styles?.backgroundStyles?.style?.background?.startsWith(
180
+ this.viewModel?.styles?.backgroundStylesViewModel?.style?.background?.startsWith(
173
181
  'linear-gradient',
174
182
  )
175
183
  ) {
176
184
  // combine image and gradient into the `background` property
177
- styles.backgroundImage = `url(${this.viewModel?.styles?.backgroundStyles?.backgroundImageUrl}), ${this.viewModel?.styles?.backgroundStyles?.style?.background}`;
185
+ styles.backgroundImage = `url(${this.viewModel?.styles?.backgroundStylesViewModel?.backgroundImageUrl}), ${this.viewModel?.styles?.backgroundStylesViewModel?.style?.background}`;
178
186
 
179
187
  delete styles.background;
180
188
  } else {
181
189
  // background is a solid color
182
190
  styles.backgroundColor = styles.background;
183
- styles.backgroundImage = `url(${this.viewModel?.styles?.backgroundStyles?.backgroundImageUrl})`;
191
+ styles.backgroundImage = `url(${this.viewModel?.styles?.backgroundStylesViewModel?.backgroundImageUrl})`;
184
192
 
185
193
  delete styles.background;
186
194
  }
@@ -4,6 +4,7 @@ import type { ContentViewModel, BrandPageViewModel } from '../../view-models';
4
4
  import {
5
5
  mapToPageFooterViewModel,
6
6
  mapToPageHeaderViewModel,
7
+ mapToPageStyleViewModel,
7
8
  mapToViewModel,
8
9
  } from '../../utils';
9
10
  import {
@@ -41,7 +42,7 @@ const pages = brandPageModel.pages.map((p) => ({
41
42
 
42
43
  const viewModel: BrandPageViewModel = {
43
44
  showBrandCrowdLogo: true,
44
- styles: brandPageModel.styles,
45
+ styles: mapToPageStyleViewModel(brandPageModel.styles, {}),
45
46
  headerViewModelDesktop: mapToPageHeaderViewModel(
46
47
  brandPageModel.pageHeaderDesktop,
47
48
  brandPageModel.styles,
@@ -1,5 +1,19 @@
1
1
  <template>
2
- <div class="brand-page-root-background" :style="rootBackgroundStyles" />
2
+ <div
3
+ v-if="!viewModel.styles?.backgroundStylesViewModel?.mediaViewModel"
4
+ class="brand-page-root-background"
5
+ :style="rootBackgroundStyles"
6
+ />
7
+ <Media
8
+ v-if="viewModel.styles?.backgroundStylesViewModel?.mediaViewModel"
9
+ :media="viewModel.styles.backgroundStylesViewModel.mediaViewModel"
10
+ :context="context"
11
+ :img-classes="{
12
+ 'tw-absolute tw-left-0 tw-top-0 tw-z-0 tw-w-full tw-h-full tw-object-cover': true,
13
+ }"
14
+ :media-type="viewModel.styles.backgroundStylesViewModel.mediaViewModel.type"
15
+ content-index="0"
16
+ />
3
17
  <div
4
18
  class="brand-page-root"
5
19
  :style="rootElementStyles"
@@ -266,6 +280,7 @@ import PageFooter from '../page-footer/PageFooter.vue';
266
280
  import NavigationSideMenu from '../navigation/navigation-side-menu/NavigationSideMenu.vue';
267
281
  import BrandSiteNavigationLayout from './BrandSiteNavigationLayout.vue';
268
282
  import MediaQuery from '../media-query';
283
+ import Media from '../media/Media.vue';
269
284
 
270
285
  export default {
271
286
  components: {
@@ -278,6 +293,7 @@ export default {
278
293
  PageHeader,
279
294
  PageFooter,
280
295
  BrandSiteNavigationLayout,
296
+ Media,
281
297
  },
282
298
  mixins: [PageMixin],
283
299
  setup(props) {
@@ -83,6 +83,7 @@ export class BackgroundStyles {
83
83
  public backgroundImageUrl: string;
84
84
  public backgroundShapes: BackgroundShape[];
85
85
  public personalisationRole?: PersonalisationRole;
86
+ public media?: AbstractMedia;
86
87
 
87
88
  constructor(option: Partial<BackgroundStyles> = {}) {
88
89
  this.backgroundImageUrl = option.backgroundImageUrl || '';
@@ -96,6 +97,7 @@ export class BackgroundStyles {
96
97
  background: '',
97
98
  };
98
99
  this.personalisationRole = option.personalisationRole;
100
+ this.media = option.media || undefined;
99
101
  }
100
102
  }
101
103
 
@@ -327,6 +327,7 @@ exports[`migration.util > Banner Contents - text Align and Font Family should no
327
327
  "background": "",
328
328
  },
329
329
  "backgroundShapes": [],
330
+ "media": undefined,
330
331
  "personalisationRole": undefined,
331
332
  "style": {
332
333
  "background": "logo-background-color",
@@ -744,6 +745,7 @@ exports[`migration.util > migrateBrandPageModel should return brand page model w
744
745
  "background": "",
745
746
  },
746
747
  "backgroundShapes": [],
748
+ "media": undefined,
747
749
  "personalisationRole": undefined,
748
750
  "style": {
749
751
  "background": "logo-background-color",
@@ -1168,6 +1170,7 @@ exports[`migration.util > migrateBrandPageModel should return brand page model w
1168
1170
  "background": "",
1169
1171
  },
1170
1172
  "backgroundShapes": [],
1173
+ "media": undefined,
1171
1174
  "personalisationRole": undefined,
1172
1175
  "style": {
1173
1176
  "background": "logo-background-color",
@@ -365,6 +365,7 @@ exports[`migration02.ts > migration02 should return converted letterspacing 1`]
365
365
  "background": "",
366
366
  },
367
367
  "backgroundShapes": [],
368
+ "media": undefined,
368
369
  "personalisationRole": undefined,
369
370
  "style": {
370
371
  "background": "logo-background-color",
@@ -339,6 +339,7 @@ BrandPageModel {
339
339
  "background": "",
340
340
  },
341
341
  "backgroundShapes": [],
342
+ "media": undefined,
342
343
  "personalisationRole": undefined,
343
344
  "style": {
344
345
  "background": "#0000ff",
@@ -795,6 +796,7 @@ BrandPageModel {
795
796
  "background": "",
796
797
  },
797
798
  "backgroundShapes": [],
799
+ "media": undefined,
798
800
  "personalisationRole": undefined,
799
801
  "style": {
800
802
  "background": "#0000ff",
@@ -40,6 +40,7 @@ import type {
40
40
  TextShapeItem,
41
41
  GettyVideoMedia,
42
42
  AbstractMedia,
43
+ BackgroundStyles,
43
44
  } from '../models';
44
45
  import { ButtonStyles, SENSITIVE_CONTENT_TYPES, VIEWPORTS } from '../models';
45
46
  import {
@@ -78,6 +79,8 @@ import type {
78
79
  ShopViewModel,
79
80
  BookingSectionViewModel,
80
81
  GettyVideoViewModel,
82
+ PageStylesViewModel,
83
+ BackgroundStylesViewModel,
81
84
  } from '../view-models';
82
85
  import { isHexTransparent, setRgbAlpha } from './color.util';
83
86
  import type { ContentTextStylePropertyKey } from '../constants';
@@ -985,6 +988,22 @@ export const mapToBookingSectionViewModel = (
985
988
  );
986
989
  };
987
990
 
991
+ export const mapToPageStyleViewModel = (
992
+ pageStyles: PageStyles,
993
+ options: ViewModelMappingOptions,
994
+ ): PageStylesViewModel => {
995
+ return {
996
+ backgroundStylesViewModel: mapBackgroundStylesToViewModel(
997
+ pageStyles.backgroundStyles,
998
+ options,
999
+ ),
1000
+ buttonStyles: pageStyles.buttonStyles,
1001
+ logoStyles: pageStyles.logoStyles,
1002
+ textStyles: pageStyles.textStyles,
1003
+ galleryStyles: pageStyles.galleryStyles,
1004
+ };
1005
+ };
1006
+
988
1007
  export const mapToPageHeaderViewModel = (
989
1008
  pageHeader: PageHeaderDesktop | PageHeaderMobile,
990
1009
  pageStyles: PageStyles,
@@ -1284,6 +1303,26 @@ interface ViewModelMappingOptions {
1284
1303
  ) => void;
1285
1304
  }
1286
1305
 
1306
+ const mapBackgroundStylesToViewModel = (
1307
+ backgroundStyles: BackgroundStyles,
1308
+ options: ViewModelMappingOptions,
1309
+ ): BackgroundStylesViewModel => {
1310
+ // TODO(jyao): These need to be mapped to a view model eventually
1311
+ return {
1312
+ style: backgroundStyles.style,
1313
+ backgroundShapeStyle: backgroundStyles.backgroundShapeStyle,
1314
+ backgroundImageUrl: backgroundStyles.backgroundImageUrl,
1315
+ backgroundShapes: backgroundStyles.backgroundShapes,
1316
+ personalisationRole: backgroundStyles.personalisationRole,
1317
+ mediaViewModel: backgroundStyles.media
1318
+ ? mapMediaToContentViewModel({
1319
+ media: backgroundStyles.media,
1320
+ options,
1321
+ })
1322
+ : undefined,
1323
+ };
1324
+ };
1325
+
1287
1326
  export const getBrandPageViewModelFromBrandPageModel = (
1288
1327
  model: BrandPageModel,
1289
1328
  brandPageToken: string | undefined,
@@ -1313,7 +1352,7 @@ export const getBrandPageViewModelFromBrandPageModel = (
1313
1352
  brandPageToken,
1314
1353
  pages,
1315
1354
  showBrandCrowdLogo,
1316
- styles: model.styles,
1355
+ styles: mapToPageStyleViewModel(model.styles, options),
1317
1356
  headerViewModelDesktop: mapToPageHeaderViewModel(
1318
1357
  model.pageHeaderDesktop,
1319
1358
  model.styles,
@@ -1460,7 +1499,8 @@ export const getCriticalResourceURLs = (
1460
1499
  }
1461
1500
 
1462
1501
  // shapes
1463
- const bgShapeFullBg = viewModel.styles?.backgroundStyles.backgroundImageUrl;
1502
+ const bgShapeFullBg =
1503
+ viewModel.styles?.backgroundStylesViewModel.backgroundImageUrl;
1464
1504
 
1465
1505
  if (typeof bgShapeFullBg !== 'undefined' && isValidSvgUrl(bgShapeFullBg)) {
1466
1506
  shapes.push(String(bgShapeFullBg));
@@ -39,6 +39,10 @@ import type {
39
39
  SensitiveContent,
40
40
  BookingSectionContent,
41
41
  MediaTypes,
42
+ TextStyles,
43
+ BackgroundStyle,
44
+ BackgroundShape,
45
+ PersonalisationRole,
42
46
  } from './models';
43
47
  import type { ImagesSectionContentDisplayStyle } from './constants';
44
48
 
@@ -280,10 +284,28 @@ export interface PageFooterViewModel
280
284
  logo: LogoViewModel;
281
285
  }
282
286
 
287
+ export interface BackgroundStylesViewModel {
288
+ style: BackgroundStyle;
289
+ backgroundShapeStyle: BackgroundStyle;
290
+ backgroundImageUrl: string;
291
+ backgroundShapes: BackgroundShape[];
292
+ personalisationRole?: PersonalisationRole;
293
+ mediaViewModel?: MediaViewModel;
294
+ }
295
+
296
+ // Note(jyao): View model for page styles, we will need to create new view model mapping for each style here in future
297
+ export interface PageStylesViewModel {
298
+ backgroundStylesViewModel: BackgroundStylesViewModel;
299
+ buttonStyles: ButtonStyles; // TODO(jyao): Convert to view model
300
+ logoStyles: LogoStyles; // TODO(jyao): Convert to view model
301
+ textStyles: TextStyles; // TODO(jyao): Convert to view model
302
+ galleryStyles: GalleryStyles; // TODO(jyao): Convert to view model
303
+ }
304
+
283
305
  export interface BrandPageViewModel {
284
306
  brandPageToken?: string;
285
307
  showBrandCrowdLogo: boolean;
286
- styles: PageStyles;
308
+ styles: PageStylesViewModel;
287
309
  pages: PageViewModel[];
288
310
  brandPageType: BrandPageType;
289
311
  headerViewModelDesktop: PageHeaderViewModel;
@@ -17,6 +17,7 @@ import { setupStoryPinia } from '../brand-page-maker/__fixtures__/store-fixture'
17
17
  import {
18
18
  mapToPageFooterViewModel,
19
19
  mapToPageHeaderViewModel,
20
+ mapToPageStyleViewModel,
20
21
  mapToViewModel,
21
22
  } from '../../../brand-page/utils';
22
23
 
@@ -46,7 +47,7 @@ const pages = [
46
47
 
47
48
  const viewModel: BrandPageViewModel = {
48
49
  showBrandCrowdLogo: true,
49
- styles: pageStyles,
50
+ styles: mapToPageStyleViewModel(pageStyles, {}),
50
51
  headerViewModelDesktop: mapToPageHeaderViewModel(
51
52
  new PageHeaderDesktop(),
52
53
  pageStyles,
@@ -297,7 +297,9 @@
297
297
  "addMedia": "Medien hinzufügen",
298
298
  "addImage": "Bild hinzufügen",
299
299
  "replaceImage": "Bild ersetzen",
300
- "image": "Bild"
300
+ "image": "Bild",
301
+ "media": "Medien",
302
+ "replaceMedia": "Medien ersetzen"
301
303
  },
302
304
  "colorPicker": {
303
305
  "newColor": "Neue Farbe",
@@ -297,7 +297,9 @@
297
297
  "addMedia": "Añade elementos multimedia",
298
298
  "addImage": "Añadir imagen",
299
299
  "replaceImage": "Reemplazar imagen",
300
- "image": "Imagen"
300
+ "image": "Imagen",
301
+ "media": "Redes sociales",
302
+ "replaceMedia": "Reemplazar elementos multimedia"
301
303
  },
302
304
  "colorPicker": {
303
305
  "newColor": "Nuevo color",
@@ -297,7 +297,9 @@
297
297
  "addMedia": "Ajouter un média",
298
298
  "addImage": "Ajouter une image",
299
299
  "replaceImage": "Remplacer l'image",
300
- "image": "Image"
300
+ "image": "Image",
301
+ "media": "Médias",
302
+ "replaceMedia": "Remplacer le média"
301
303
  },
302
304
  "colorPicker": {
303
305
  "newColor": "Nouvelle couleur",
@@ -297,7 +297,9 @@
297
297
  "addMedia": "Ajouter un média",
298
298
  "addImage": "Ajouter une image",
299
299
  "replaceImage": "Remplacer l'image",
300
- "image": "Image"
300
+ "image": "Image",
301
+ "media": "Réseaux",
302
+ "replaceMedia": "Remplacer un média"
301
303
  },
302
304
  "colorPicker": {
303
305
  "newColor": "Nouvelle couleur",
@@ -297,7 +297,9 @@
297
297
  "addMedia": "Add Media",
298
298
  "addImage": "Add Image",
299
299
  "replaceImage": "Replace Image",
300
- "image": "Image"
300
+ "image": "Image",
301
+ "media": "Media",
302
+ "replaceMedia": "Replace Media"
301
303
  },
302
304
  "colorPicker": {
303
305
  "newColor": "New Color",
@@ -297,7 +297,9 @@
297
297
  "addMedia": "Adicionar mídia",
298
298
  "addImage": "Adicionar imagem",
299
299
  "replaceImage": "Substitua a imagem",
300
- "image": "Imagem"
300
+ "image": "Imagem",
301
+ "media": "Mídia",
302
+ "replaceMedia": "Substituir mídia"
301
303
  },
302
304
  "colorPicker": {
303
305
  "newColor": "Nova cor",
@@ -297,7 +297,9 @@
297
297
  "addMedia": "Adicionar multimédia",
298
298
  "addImage": "Adicionar imagem",
299
299
  "replaceImage": "Substitua a imagem",
300
- "image": "Imagem"
300
+ "image": "Imagem",
301
+ "media": "Multimédia",
302
+ "replaceMedia": "Substituir multimédia"
301
303
  },
302
304
  "colorPicker": {
303
305
  "newColor": "Nova cor",