@designcrowd/library.brand-page 5.14.0 → 5.14.1-flacky-nav-13

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 (70) hide show
  1. package/lib/src/{CreatedOnBrandCrowd-de-de-D0CkHfXG.js → CreatedOnBrandCrowd-de-de-CCRrBZM2.js} +1 -1
  2. package/lib/src/{CreatedOnBrandCrowd-en-us-Bie_S3_0.js → CreatedOnBrandCrowd-en-us-BlR-fd12.js} +1 -1
  3. package/lib/src/{CreatedOnBrandCrowd-es-es-BJIn_e1h.js → CreatedOnBrandCrowd-es-es-BtG_geHF.js} +1 -1
  4. package/lib/src/{CreatedOnBrandCrowd-fr-fr-X9J7z9Qo.js → CreatedOnBrandCrowd-fr-fr-Ce0a7XLa.js} +1 -1
  5. package/lib/src/{CreatedOnBrandCrowd-pt-pt-DJVAw13V.js → CreatedOnBrandCrowd-pt-pt-BdFaD1Ki.js} +1 -1
  6. package/lib/src/{CreatedOnDcom-de-de-BPpWDeUI.js → CreatedOnDcom-de-de-B94kxoDv.js} +1 -1
  7. package/lib/src/{CreatedOnDcom-en-us-DHFLppGF.js → CreatedOnDcom-en-us-BYiWjKqv.js} +1 -1
  8. package/lib/src/{CreatedOnDcom-es-es-DxwMrKji.js → CreatedOnDcom-es-es-D7gzuHyn.js} +1 -1
  9. package/lib/src/{CreatedOnDcom-fr-fr-Zh7tbbrd.js → CreatedOnDcom-fr-fr-DT5EOEYa.js} +1 -1
  10. package/lib/src/{CreatedOnDcom-pt-pt-CTfT63LR.js → CreatedOnDcom-pt-pt-CXprKfiq.js} +1 -1
  11. package/lib/src/brand-page/constants/logo.constants.d.ts +1 -0
  12. package/lib/src/brand-page/constants/logo.constants.js +2 -0
  13. package/lib/src/brand-page/utils/migration/migration-01.d.ts +1 -1
  14. package/lib/src/brand-page/utils/migration/migration-01.js +1 -1
  15. package/lib/src/brand-page/utils/migration/migration-02.d.ts +1 -1
  16. package/lib/src/brand-page/utils/migration/migration-02.js +1 -1
  17. package/lib/src/brand-page/utils/migration/migration-03.d.ts +1 -1
  18. package/lib/src/brand-page/utils/migration/migration-03.js +1 -1
  19. package/lib/src/brand-page/utils/migration/migration-04.d.ts +1 -1
  20. package/lib/src/brand-page/utils/migration/migration-04.js +1 -1
  21. package/lib/src/brand-page/utils/migration/migration-05.d.ts +5 -2
  22. package/lib/src/brand-page/utils/migration/migration-05.js +1 -1
  23. package/lib/src/brand-page/utils/migration/migration-06.d.ts +4 -0
  24. package/lib/src/brand-page/utils/migration/migration-06.js +56 -0
  25. package/lib/src/brand-page/utils/migration.util.d.ts +5 -1
  26. package/lib/src/brand-page/utils/migration.util.js +17 -5
  27. package/lib/src/brand-page/utils/view-model.util.d.ts +3 -3
  28. package/lib/src/brand-page/utils/view-model.util.js +12 -11
  29. package/lib/src/brand-page/view-models.d.ts +1 -0
  30. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.stories.d.ts +2 -0
  31. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.stories.js +98 -2
  32. package/lib/src/brand-page-maker/components/brand-page-maker/__fixtures__/brand-page-examples.d.ts +1122 -0
  33. package/lib/src/brand-page-maker/components/brand-page-maker/__fixtures__/brand-page-examples.js +1058 -0
  34. package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.js +2 -1
  35. package/lib/src/{bundled-translations.de-DE-BXAa3p16.js → bundled-translations.de-DE-BDSwnN6z.js} +1 -1
  36. package/lib/src/bundled-translations.fr-CA-SQDJwXv_.js +27 -0
  37. package/lib/src/bundled-translations.pt-BR-C9ZYeoLd.js +27 -0
  38. package/lib/src/css/library.brand-page-brandCrowd.min.css +3 -6
  39. package/lib/src/css/library.brand-page-brandPage.min.css +3 -6
  40. package/lib/src/css/library.brand-page-designCom.min.css +3 -6
  41. package/lib/src/css/library.brand-page-preview.min.css +3 -6
  42. package/lib/src/index.mjs +1 -1
  43. package/lib/src/{lib-B8KtxX1Y.js → lib-BrBG5gRu.js} +12782 -12694
  44. package/lib/src/shared/page-settings/store/page-settings-store.js +1 -1
  45. package/lib/src/shared/template-settings/store/template-settings-store.js +2 -1
  46. package/package.json +2 -2
  47. package/src/brand-page/components/logo/Logo.vue +14 -3
  48. package/src/brand-page/components/logo/LogoRender.vue +31 -13
  49. package/src/brand-page/constants/logo.constants.ts +3 -0
  50. package/src/brand-page/utils/__snapshots__/migration.util.test.ts.snap +1121 -1112
  51. package/src/brand-page/utils/migration/logo/migration.util.logo.test.ts +3 -3
  52. package/src/brand-page/utils/migration/migration-01.ts +2 -2
  53. package/src/brand-page/utils/migration/migration-02.ts +2 -2
  54. package/src/brand-page/utils/migration/migration-03.ts +2 -2
  55. package/src/brand-page/utils/migration/migration-04.ts +2 -2
  56. package/src/brand-page/utils/migration/migration-05.ts +12 -2
  57. package/src/brand-page/utils/migration/migration-06.test.ts +338 -0
  58. package/src/brand-page/utils/migration/migration-06.ts +100 -0
  59. package/src/brand-page/utils/migration.util.test.ts +274 -157
  60. package/src/brand-page/utils/migration.util.ts +22 -7
  61. package/src/brand-page/utils/migration2.util.test.ts +4 -2
  62. package/src/brand-page/utils/view-model.util.ts +20 -6
  63. package/src/brand-page/view-models.ts +1 -0
  64. package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.stories.ts +106 -1
  65. package/src/brand-page-maker/components/brand-page-maker/__fixtures__/brand-page-examples.ts +1090 -0
  66. package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.ts +2 -1
  67. package/src/shared/page-settings/store/page-settings-store.ts +1 -0
  68. package/src/shared/template-settings/store/template-settings-store.ts +2 -1
  69. package/lib/src/bundled-translations.fr-CA-DjWw6Iqb.js +0 -4
  70. package/lib/src/bundled-translations.pt-BR-BDMct_Gn.js +0 -4
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as e, openBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-B8KtxX1Y.js";
2
+ import { _ as t } from "./lib-BrBG5gRu.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-B8KtxX1Y.js";
2
+ import { _ as t } from "./lib-BrBG5gRu.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-B8KtxX1Y.js";
2
+ import { _ as t } from "./lib-BrBG5gRu.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-B8KtxX1Y.js";
2
+ import { _ as t } from "./lib-BrBG5gRu.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-B8KtxX1Y.js";
2
+ import { _ as t } from "./lib-BrBG5gRu.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-B8KtxX1Y.js";
2
+ import { _ as e } from "./lib-BrBG5gRu.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-B8KtxX1Y.js";
2
+ import { _ as e } from "./lib-BrBG5gRu.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-B8KtxX1Y.js";
2
+ import { _ as e } from "./lib-BrBG5gRu.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-B8KtxX1Y.js";
2
+ import { _ as e } from "./lib-BrBG5gRu.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-B8KtxX1Y.js";
2
+ import { _ as M } from "./lib-BrBG5gRu.js";
3
3
  const Z = {}, e = {
4
4
  width: "232",
5
5
  height: "36",
@@ -5,3 +5,4 @@ export declare const LOGO_VARIATION: {
5
5
  TEXT_ONLY_WITH_TRANSPARENT_BACKGROUND: number;
6
6
  };
7
7
  export declare const DEFAULT_LOGO_VARIATION: number;
8
+ export declare const LOGO_MIGRATION_VERSION = 6;
@@ -5,3 +5,5 @@ export const LOGO_VARIATION = {
5
5
  TEXT_ONLY_WITH_TRANSPARENT_BACKGROUND: 3,
6
6
  };
7
7
  export const DEFAULT_LOGO_VARIATION = LOGO_VARIATION.LOGO_WITH_TRANSPARENT_BACKGROUND;
8
+ // migrating logo images to a fixed height
9
+ export const LOGO_MIGRATION_VERSION = 6;
@@ -20,4 +20,4 @@ export declare const migrateConvertLineHeightOnFooterStyles: (brandPageModel: Br
20
20
  export declare const migration01: (brandPageModel: BrandPageModel, options: {
21
21
  logoImage?: LogoImageModel;
22
22
  isUserDraft: boolean;
23
- }) => BrandPageModel;
23
+ }) => Promise<BrandPageModel>;
@@ -857,7 +857,7 @@ export const migrateConvertLineHeightOnFooterStyles = (brandPageModel) => {
857
857
  };
858
858
  }
859
859
  };
860
- export const migration01 = (brandPageModel, options) => {
860
+ export const migration01 = async (brandPageModel, options) => {
861
861
  if (!brandPageModel.brandPageType) {
862
862
  brandPageModel.brandPageType = BRAND_PAGE_TYPES.default;
863
863
  }
@@ -3,4 +3,4 @@ export declare const convertLetterSpacingRemToEm: (fontSizeInEmOrRem: string | u
3
3
  export declare const migration02: (brandPageModel: BrandPageModel, options: {
4
4
  logoImage?: LogoImageModel;
5
5
  isUserDraft: boolean;
6
- }) => BrandPageModel;
6
+ }) => Promise<BrandPageModel>;
@@ -31,7 +31,7 @@ const handleConversion = (style) => {
31
31
  }
32
32
  style.letterSpacing = convertLetterSpacingRemToEm(style.fontSize, style.letterSpacing);
33
33
  };
34
- export const migration02 = (brandPageModel, options) => {
34
+ export const migration02 = async (brandPageModel, options) => {
35
35
  handleConversion(brandPageModel.pageHeaderDesktop?.navigation?.defaultButtonStyle);
36
36
  handleConversion(brandPageModel.pageHeaderMobile?.navigation?.defaultButtonStyle);
37
37
  handleConversion(brandPageModel.pageFooterDesktop?.copyrightStyle);
@@ -2,4 +2,4 @@ import { type BrandPageModel, type LogoImageModel } from '../..';
2
2
  export declare const migration03: (brandPageModel: BrandPageModel, options: {
3
3
  logoImage?: LogoImageModel;
4
4
  isUserDraft: boolean;
5
- }) => BrandPageModel;
5
+ }) => Promise<BrandPageModel>;
@@ -28,7 +28,7 @@ const migrateApplyAutoScaleProperty = (brandPageType, textStyle) => {
28
28
  textStyle.applyAutoScale =
29
29
  brandPageType && brandPageType === BRAND_PAGE_TYPES.brandSite;
30
30
  };
31
- export const migration03 = (brandPageModel, options) => {
31
+ export const migration03 = async (brandPageModel, options) => {
32
32
  handleRecursiveFontSizeMigration(brandPageModel.pageHeaderDesktop);
33
33
  handleRecursiveFontSizeMigration(brandPageModel.pageHeaderMobile);
34
34
  handleRecursiveFontSizeMigration(brandPageModel.pageFooterDesktop);
@@ -2,4 +2,4 @@ import { type BrandPageModel, type LogoImageModel } from '../..';
2
2
  export declare const migration04: (brandPageModel: BrandPageModel, options: {
3
3
  logoImage?: LogoImageModel;
4
4
  isUserDraft: boolean;
5
- }) => BrandPageModel;
5
+ }) => Promise<BrandPageModel>;
@@ -86,7 +86,7 @@ const updateUserUploadedImageUrls = (content) => {
86
86
  });
87
87
  }
88
88
  };
89
- export const migration04 = (brandPageModel, options) => {
89
+ export const migration04 = async (brandPageModel, options) => {
90
90
  if (brandPageModel.faviconUrl &&
91
91
  isUserUploadedImage(brandPageModel.faviconUrl)) {
92
92
  brandPageModel.faviconUrl = removeUserImageExtension(brandPageModel.faviconUrl);
@@ -1,2 +1,5 @@
1
- import { type BrandPageModel } from '../..';
2
- export declare const migration05: (brandPageModel: BrandPageModel) => BrandPageModel;
1
+ import { type BrandPageModel, type LogoImageModel } from '../..';
2
+ export declare const migration05: (brandPageModel: BrandPageModel, options: {
3
+ logoImage?: LogoImageModel;
4
+ isUserDraft: boolean;
5
+ }) => Promise<BrandPageModel>;
@@ -1,6 +1,6 @@
1
1
  import {} from '../..';
2
2
  import { isTextContent } from '../model.util';
3
- export const migration05 = (brandPageModel) => {
3
+ export const migration05 = async (brandPageModel, options) => {
4
4
  brandPageModel.pages.forEach((page) => {
5
5
  page.contents.forEach((content) => {
6
6
  if (isTextContent(content)) {
@@ -0,0 +1,4 @@
1
+ import { type BrandPageModel } from '../..';
2
+ export declare const migration06: (brandPageModel: BrandPageModel, options: {
3
+ skipMigration06?: boolean;
4
+ }) => Promise<BrandPageModel>;
@@ -0,0 +1,56 @@
1
+ import { DEFAULT_LOGO_HEIGHT, DEFAULT_LOGO_WIDTH, PageFooterDesktop, PageFooterMobile, PageHeaderDesktop, PageHeaderMobile, } from '../..';
2
+ import { FabricRenderClient } from '../../../clients/fabric-render-client';
3
+ const calculateConstrainedDimensions = (logoData, maxWidth, maxHeight) => {
4
+ const maxWidthRem = parseFloat(maxWidth);
5
+ const maxHeightRem = parseFloat(maxHeight);
6
+ const logoAspectRatio = logoData.width / logoData.height;
7
+ let actualHeight;
8
+ if (logoAspectRatio >= 1) {
9
+ actualHeight = maxWidthRem / logoAspectRatio;
10
+ }
11
+ else {
12
+ actualHeight = maxHeightRem;
13
+ }
14
+ const actualHeightRem = `${Math.ceil(actualHeight)}rem`;
15
+ return { width: actualHeightRem, height: actualHeightRem };
16
+ };
17
+ export const migration06 = async (brandPageModel, options) => {
18
+ if (options.skipMigration06 !== undefined && options.skipMigration06) {
19
+ return brandPageModel;
20
+ }
21
+ try {
22
+ const fabricClient = FabricRenderClient.getInstance();
23
+ // Define all sections that need logo data
24
+ const sections = [
25
+ { name: 'pageHeaderDesktop', config: brandPageModel.pageHeaderDesktop },
26
+ { name: 'pageHeaderMobile', config: brandPageModel.pageHeaderMobile },
27
+ { name: 'pageFooterDesktop', config: brandPageModel.pageFooterDesktop },
28
+ { name: 'pageFooterMobile', config: brandPageModel.pageFooterMobile },
29
+ ].filter((section) => section.config);
30
+ // Fetch logo data for all sections in parallel
31
+ const logoDataPromises = sections.map(async (section) => {
32
+ const logoData = section.config?.logoTemplateImage?.logoTemplateToken
33
+ ? await fabricClient.getLogoSvgUrlByLogoTemplateImageAsync(section.config.logoTemplateImage)
34
+ : await fabricClient.getLogoSvgUrlByLogoImageAsync(section.config.logoImage);
35
+ return {
36
+ sectionName: section.name,
37
+ logoData,
38
+ config: section.config,
39
+ };
40
+ });
41
+ const results = await Promise.all(logoDataPromises);
42
+ // Apply dimensions to each section
43
+ results.forEach(({ sectionName, logoData, config }) => {
44
+ if (logoData && logoData.width && logoData.height && config) {
45
+ const currentMaxWidth = config.logoImageWidth || DEFAULT_LOGO_WIDTH;
46
+ const currentMaxHeight = config.logoImageHeight || DEFAULT_LOGO_HEIGHT;
47
+ const dimensions = calculateConstrainedDimensions(logoData, currentMaxWidth, currentMaxHeight);
48
+ config.logoImageHeight = dimensions.height;
49
+ }
50
+ });
51
+ }
52
+ catch (error) {
53
+ console.warn('Migration 06: Failed to fetch logo dimensions:', error);
54
+ }
55
+ return brandPageModel;
56
+ };
@@ -3,4 +3,8 @@ export declare const GetLatestModelVersion: () => number;
3
3
  export declare const migrateBrandPageModel: (brandPageModel: BrandPageModel, options: {
4
4
  logoImage?: LogoImageModel;
5
5
  isUserDraft: boolean;
6
- }) => BrandPageModel;
6
+ isServerRender: boolean;
7
+ }) => Promise<{
8
+ brandPageModel: BrandPageModel;
9
+ useOldLogoRenderSize: boolean;
10
+ }>;
@@ -1,3 +1,4 @@
1
+ import { LOGO_MIGRATION_VERSION } from '../constants';
1
2
  import {} from '../models';
2
3
  import { migration01 } from './migration/migration-01';
3
4
  import { migration02 } from './migration/migration-02';
@@ -5,6 +6,7 @@ import { migration03 } from './migration/migration-03';
5
6
  import { migration04 } from './migration/migration-04';
6
7
  import { migration05 } from './migration/migration-05';
7
8
  import { migration051 } from './migration/migration-051';
9
+ import { migration06 } from './migration/migration-06';
8
10
  import { migration052 } from './migration/migration-052';
9
11
  const MIGRATION_TABLE = [
10
12
  {
@@ -35,19 +37,29 @@ const MIGRATION_TABLE = [
35
37
  version: 5.2,
36
38
  migrateFn: migration052,
37
39
  },
40
+ {
41
+ version: 6,
42
+ migrateFn: migration06,
43
+ },
38
44
  ];
39
45
  export const GetLatestModelVersion = () => Math.max(...MIGRATION_TABLE.map((x) => x.version));
40
- export const migrateBrandPageModel = (brandPageModel, options) => {
46
+ export const migrateBrandPageModel = async (brandPageModel, options) => {
41
47
  let modelVersion = brandPageModel.v;
48
+ let useOldLogoRenderSize = false;
42
49
  if (!modelVersion) {
43
50
  modelVersion = 0;
44
51
  }
45
- MIGRATION_TABLE.forEach((x) => {
52
+ for (const x of MIGRATION_TABLE) {
46
53
  if (modelVersion < x.version) {
47
- brandPageModel = x.migrateFn(brandPageModel, options);
54
+ if (options.isServerRender && x.version === LOGO_MIGRATION_VERSION) {
55
+ useOldLogoRenderSize = true;
56
+ }
57
+ else {
58
+ brandPageModel = await x.migrateFn(brandPageModel, options);
59
+ }
48
60
  }
49
- });
61
+ }
50
62
  // Set the model to latest version
51
63
  brandPageModel.v = GetLatestModelVersion();
52
- return brandPageModel;
64
+ return { brandPageModel, useOldLogoRenderSize };
53
65
  };
@@ -8,10 +8,10 @@ export declare const mapToTextViewModel: (content: TextContent, styles: PageStyl
8
8
  export declare const mapToBannerSectionViewModel: (content: BannerSectionContent, styles: PageStyles) => 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 mapToPageHeaderViewModel: (pageHeader: PageHeaderDesktop | PageHeaderMobile, pageStyles: PageStyles, pages: PageViewModel[]) => PageHeaderViewModel;
12
- export declare const mapToPageFooterViewModel: (pageFooter: PageFooterDesktop | PageFooterMobile, pageStyles: PageStyles) => PageFooterViewModel;
11
+ export declare const mapToPageHeaderViewModel: (pageHeader: PageHeaderDesktop | PageHeaderMobile, pageStyles: PageStyles, pages: PageViewModel[], useOldLogoRenderSize?: boolean) => PageHeaderViewModel;
12
+ export declare const mapToPageFooterViewModel: (pageFooter: PageFooterDesktop | PageFooterMobile, pageStyles: PageStyles, useOldLogoRenderSize?: boolean) => PageFooterViewModel;
13
13
  export declare const mapToViewModel: (styles: PageStyles, brandPageType: BrandPageType) => (content: Content) => ContentViewModel | undefined;
14
- export declare const getBrandPageViewModelFromBrandPageModel: (model: BrandPageModel, brandPageToken: string | undefined, showBrandCrowdLogo?: boolean) => BrandPageViewModel;
14
+ export declare const getBrandPageViewModelFromBrandPageModel: (model: BrandPageModel, brandPageToken: string | undefined, showBrandCrowdLogo?: boolean, useOldLogoRenderSize?: boolean) => BrandPageViewModel;
15
15
  export declare const isLogoViewModel: (viewModel: ContentViewModel) => viewModel is LogoViewModel;
16
16
  /** for service.brand-page website preview by logo draft token */
17
17
  export declare const applyLogoImageToBrandPageViewModel: (viewModel: BrandPageViewModel, logoImage: LogoImageModel) => BrandPageViewModel;
@@ -115,7 +115,7 @@ export const mapToImageGalleryViewModel = (content, globalStyles) => {
115
115
  styles: galleryStyles?.galleryType ? galleryStyles : globalStyles,
116
116
  };
117
117
  };
118
- const mapToLogoViewModel = (content, globalStyles, options) => {
118
+ const mapToLogoViewModel = (content, globalStyles, useOldLogoRenderSize, options) => {
119
119
  let background;
120
120
  if (content.backgroundStyle?.background &&
121
121
  isHexTransparent(content.backgroundStyle.background)) {
@@ -158,6 +158,7 @@ const mapToLogoViewModel = (content, globalStyles, options) => {
158
158
  },
159
159
  },
160
160
  isVisible: content.isLogoVisible,
161
+ useOldLogoRenderSize,
161
162
  });
162
163
  };
163
164
  const mapToVideoViewModel = (content, styles) => {
@@ -525,7 +526,7 @@ export const mapToBookingSectionViewModel = (content, styles) => {
525
526
  isFullWidth: true,
526
527
  }, styles);
527
528
  };
528
- export const mapToPageHeaderViewModel = (pageHeader, pageStyles, pages) => {
529
+ export const mapToPageHeaderViewModel = (pageHeader, pageStyles, pages, useOldLogoRenderSize = false) => {
529
530
  const viewport = pageHeader.viewport;
530
531
  const logoContent = {
531
532
  id: 'page-header-logo',
@@ -554,7 +555,7 @@ export const mapToPageHeaderViewModel = (pageHeader, pageStyles, pages) => {
554
555
  }), {});
555
556
  return {
556
557
  displayStyle: pageHeader.displayStyle,
557
- logo: mapToLogoViewModel(logoContent, logoStyles),
558
+ logo: mapToLogoViewModel(logoContent, logoStyles, useOldLogoRenderSize),
558
559
  pages: pages.filter((p) => !p.isHidden),
559
560
  navigation: viewport === VIEWPORTS.mobile
560
561
  ? new NavigationMobile({
@@ -574,7 +575,7 @@ export const mapToPageHeaderViewModel = (pageHeader, pageStyles, pages) => {
574
575
  backgroundColorEnabled: pageHeader.backgroundColorEnabled,
575
576
  };
576
577
  };
577
- export const mapToPageFooterViewModel = (pageFooter, pageStyles) => {
578
+ export const mapToPageFooterViewModel = (pageFooter, pageStyles, useOldLogoRenderSize = false) => {
578
579
  const { logoImageBase64Url, logoImage, logoTemplateImage, logoImageHeight, logoImageWidth, isLogoVisible, } = pageFooter;
579
580
  const logoContent = {
580
581
  id: 'page-header-logo',
@@ -598,7 +599,7 @@ export const mapToPageFooterViewModel = (pageFooter, pageStyles) => {
598
599
  copyrightStyle,
599
600
  displayStyle: pageFooter.displayStyle,
600
601
  iconStyle: Object.assign({ fill: pageStyles.textStyles?.style.color }, pageFooter.iconStyle),
601
- logo: mapToLogoViewModel(logoContent, logoStyles),
602
+ logo: mapToLogoViewModel(logoContent, logoStyles, useOldLogoRenderSize),
602
603
  socialLinks: pageFooter.socialLinks,
603
604
  textFontFamily: pageFooter.textFontFamily,
604
605
  };
@@ -613,7 +614,7 @@ export const mapToViewModel = (styles, brandPageType) => (content) => {
613
614
  if (brandPageType === BRAND_PAGE_TYPES.brandSite) {
614
615
  return undefined;
615
616
  }
616
- return mapToLogoViewModel(content, styles.logoStyles, {
617
+ return mapToLogoViewModel(content, styles.logoStyles, false, {
617
618
  height: DEFAULT_LOGO_HEIGHT,
618
619
  width: DEFAULT_LOGO_WIDTH,
619
620
  });
@@ -670,7 +671,7 @@ export const mapToViewModel = (styles, brandPageType) => (content) => {
670
671
  assertUnreachable();
671
672
  }
672
673
  };
673
- export const getBrandPageViewModelFromBrandPageModel = (model, brandPageToken, showBrandCrowdLogo = true) => {
674
+ export const getBrandPageViewModelFromBrandPageModel = (model, brandPageToken, showBrandCrowdLogo = true, useOldLogoRenderSize = false) => {
674
675
  const pages = model.pages.map((p) => {
675
676
  const contents = p.contents
676
677
  .map(mapToViewModel(model.styles, model.brandPageType || BRAND_PAGE_TYPES.default))
@@ -687,10 +688,10 @@ export const getBrandPageViewModelFromBrandPageModel = (model, brandPageToken, s
687
688
  pages,
688
689
  showBrandCrowdLogo,
689
690
  styles: model.styles,
690
- headerViewModelDesktop: mapToPageHeaderViewModel(model.pageHeaderDesktop, model.styles, pages),
691
- headerViewModelMobile: mapToPageHeaderViewModel(model.pageHeaderMobile, model.styles, pages),
692
- footerViewModelDesktop: mapToPageFooterViewModel(model.pageFooterDesktop, model.styles),
693
- footerViewModelMobile: mapToPageFooterViewModel(model.pageFooterMobile, model.styles),
691
+ headerViewModelDesktop: mapToPageHeaderViewModel(model.pageHeaderDesktop, model.styles, pages, useOldLogoRenderSize),
692
+ headerViewModelMobile: mapToPageHeaderViewModel(model.pageHeaderMobile, model.styles, pages, useOldLogoRenderSize),
693
+ footerViewModelDesktop: mapToPageFooterViewModel(model.pageFooterDesktop, model.styles, useOldLogoRenderSize),
694
+ footerViewModelMobile: mapToPageFooterViewModel(model.pageFooterMobile, model.styles, useOldLogoRenderSize),
694
695
  brandPageType: model.brandPageType || BRAND_PAGE_TYPES.default,
695
696
  faviconUrl: model.faviconUrl,
696
697
  ogImageUrl: model.ogImageUrl,
@@ -32,6 +32,7 @@ export interface LogoViewModel extends ContentViewModel {
32
32
  logoImageWidth: string | undefined;
33
33
  /** @deprecated */
34
34
  imageStyle?: LogoStyles['imageStyle'];
35
+ useOldLogoRenderSize?: boolean;
35
36
  }
36
37
  export interface ProfileViewModel extends ContentViewModel, Omit<ProfileContent, 'type'> {
37
38
  containerStyle?: BrandPageCssStyle;
@@ -27,6 +27,8 @@ export declare const SampleBanner: {
27
27
  export declare const SamplePersonalised: () => any;
28
28
  export declare const SamplePublished: Story;
29
29
  export declare const SamplePublishedWithCustomDomain: Story;
30
+ export declare const SamplePublishedBrandSiteWithLogo: Story;
31
+ export declare const SamplePublishedBrandSiteWithLogo2: Story;
30
32
  export declare const SamplePublishedBrandSite: Story;
31
33
  export declare const SampleProfile: {
32
34
  (): any;
@@ -6,7 +6,7 @@ import * as uuid from 'uuid';
6
6
  import { createMemoryHistory, createRouter } from 'vue-router';
7
7
  import { brandPageApiClient } from '@designcrowd/fe-shared-lib';
8
8
  import BrandPageMaker from './BrandPageMaker.vue';
9
- import { ADMIN_PREVIEW_LOGO_TEMPLATE_MODELS, BRAND_PAGE, brandPagePaymentConfigBrandPageToken, brandPagePaymentConfigsResponse, brandPageBackgroundColor, brandPageBackgroundColorWithShapes, brandPageBackgroundGradient, brandPageBackgroundGradientWithShapes, brandPageBackgroundImage, brandPageBackgroundImageWithShapes, brandPageEmpty, requestPaymentPaymentOptions, userFeatures, supportMePaymentOptions, BRAND_PAGE_MULTI_PAGE, PERSONALISATION_CONTENT, BRAND_PAGE_PERSONALISED, PUBLISHED_DESIGN_DRAFT_TOKEN, BRAND_SITE, CUSTOM_DOMAIN_DESIGN_DRAFT_TOKEN, brandPageCustom, BRAND_CONTACT, BRAND_SITE_SAMPLE, } from './__fixtures__';
9
+ import { ADMIN_PREVIEW_LOGO_TEMPLATE_MODELS, BRAND_PAGE, brandPagePaymentConfigBrandPageToken, brandPagePaymentConfigsResponse, brandPageBackgroundColor, brandPageBackgroundColorWithShapes, brandPageBackgroundGradient, brandPageBackgroundGradientWithShapes, brandPageBackgroundImage, brandPageBackgroundImageWithShapes, brandPageEmpty, requestPaymentPaymentOptions, userFeatures, supportMePaymentOptions, BRAND_PAGE_MULTI_PAGE, PERSONALISATION_CONTENT, BRAND_PAGE_PERSONALISED, PUBLISHED_DESIGN_DRAFT_TOKEN, BRAND_SITE, BRAND_SITE_SAMPLE_WITH_LOGO, CUSTOM_DOMAIN_DESIGN_DRAFT_TOKEN, brandPageCustom, BRAND_CONTACT, BRAND_SITE_SAMPLE, } from './__fixtures__';
10
10
  import { gradientLogoDesignAttributes, LOGO_IMAGE_URL, logoVariationImageUrls, sampleLogoTheme, simpleLogoDesignAttributes, } from '../../../__fixtures__';
11
11
  import { BRAND_PAGE_TYPES, CONTENT_TEXT_STYLE_PROPERTY_KEYS, CONTENT_TYPES, DISPLAY_STYLE_PREVIEW, PageStyles, BrandPageModel, PageHeaderDesktop, NavigationMobile, NavigationDesktop, NAVIGATION_DISPLAY, TEXT_STYLE_TYPES, VIEWPORTS, GalleryStyles, GALLERY_TYPES, SENSITIVE_CONTENT_TYPES, } from '../../../brand-page';
12
12
  import {} from './BrandPageMaker.mixin';
@@ -468,6 +468,102 @@ export const SamplePublishedWithCustomDomain = {
468
468
  pinia: setupStoryPinia(),
469
469
  }),
470
470
  };
471
+ export const SamplePublishedBrandSiteWithLogo = {
472
+ name: 'Sample (published brandsite with logo)',
473
+ render: () => ({
474
+ setup() {
475
+ InitialiseMakerStores({});
476
+ const containerStore = useBrandPageContainerStore();
477
+ containerStore.$patch({
478
+ isSellDomainNameEnabled: true,
479
+ baseFabricRenderUrl: FABRIC_RENDER_BASE_URL,
480
+ });
481
+ containerStore.setBrandPageStatus('Published');
482
+ containerStore.setDesignDraftToken({
483
+ designDraftToken: CUSTOM_DOMAIN_DESIGN_DRAFT_TOKEN,
484
+ });
485
+ containerStore.brandPageBaseUrl = 'https://brand.site';
486
+ containerStore.setSlug({
487
+ slug: 'my-page',
488
+ });
489
+ },
490
+ components: {
491
+ BrandPageMaker,
492
+ },
493
+ data() {
494
+ return {
495
+ viewModel: {
496
+ brandPageData: JSON.stringify(BRAND_SITE_SAMPLE_WITH_LOGO),
497
+ isSaving: false,
498
+ logoDraftDesignAttributes: simpleLogoDesignAttributes,
499
+ logoVariationImageUrls,
500
+ baseBrandPageUrl: 'https://brand.site',
501
+ features: userFeatures,
502
+ initialCategories: {},
503
+ },
504
+ show: false,
505
+ };
506
+ },
507
+ template: `
508
+ <BrandPageMaker v-if="show" :view-model="viewModel"/>
509
+ `,
510
+ pinia: setupStoryPinia(),
511
+ async beforeMount() {
512
+ await setLocaleAsync('en-US');
513
+ this.show = true;
514
+ },
515
+ }),
516
+ };
517
+ export const SamplePublishedBrandSiteWithLogo2 = {
518
+ name: 'Sample (published brandsite with logo2)',
519
+ render: () => ({
520
+ setup() {
521
+ InitialiseMakerStores({});
522
+ const containerStore = useBrandPageContainerStore();
523
+ containerStore.$patch({
524
+ isSellDomainNameEnabled: true,
525
+ baseFabricRenderUrl: FABRIC_RENDER_BASE_URL,
526
+ });
527
+ containerStore.setBrandPageStatus('Published');
528
+ containerStore.setDesignDraftToken({
529
+ designDraftToken: CUSTOM_DOMAIN_DESIGN_DRAFT_TOKEN,
530
+ });
531
+ containerStore.brandPageBaseUrl = 'https://brand.site';
532
+ containerStore.setSlug({
533
+ slug: 'my-page',
534
+ });
535
+ },
536
+ components: {
537
+ BrandPageMaker,
538
+ },
539
+ data() {
540
+ const BRAND_SITE_SAMPLE_WITH_LOGO_MODIFIED = {
541
+ ...BRAND_SITE_SAMPLE_WITH_LOGO,
542
+ v: 5.1,
543
+ };
544
+ return {
545
+ viewModel: {
546
+ brandPageData: JSON.stringify(BRAND_SITE_SAMPLE_WITH_LOGO_MODIFIED),
547
+ isSaving: false,
548
+ logoDraftDesignAttributes: simpleLogoDesignAttributes,
549
+ logoVariationImageUrls,
550
+ baseBrandPageUrl: 'https://brand.site',
551
+ features: userFeatures,
552
+ initialCategories: {},
553
+ },
554
+ show: false,
555
+ };
556
+ },
557
+ template: `
558
+ <BrandPageMaker v-if="show" :view-model="viewModel"/>
559
+ `,
560
+ pinia: setupStoryPinia(),
561
+ async beforeMount() {
562
+ await setLocaleAsync('en-US');
563
+ this.show = true;
564
+ },
565
+ }),
566
+ };
471
567
  export const SamplePublishedBrandSite = {
472
568
  name: 'Sample (published brandsite)',
473
569
  render: () => ({
@@ -1137,7 +1233,7 @@ SampleAdminMode.story = {
1137
1233
  name: 'Sample (admin mode)',
1138
1234
  };
1139
1235
  export const SampleAdminModeBrandSite = {
1140
- name: 'Sample (admin mode brandsite)',
1236
+ name: 'Sample (admin mode brandsite1)',
1141
1237
  render: () => ({
1142
1238
  setup() {
1143
1239
  InitialiseMakerStores({ isAdmin: true });