@designcrowd/library.brand-page 5.13.5 → 5.13.6-flacky-nav-12

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 (63) hide show
  1. package/lib/src/{CreatedOnBrandCrowd-de-de-BkWIskLx.js → CreatedOnBrandCrowd-de-de-aCiBdDxv.js} +1 -1
  2. package/lib/src/{CreatedOnBrandCrowd-en-us-Di3Bscjn.js → CreatedOnBrandCrowd-en-us-BPgeTfh8.js} +1 -1
  3. package/lib/src/{CreatedOnBrandCrowd-es-es-BouDPfN1.js → CreatedOnBrandCrowd-es-es-DMbQhRwF.js} +1 -1
  4. package/lib/src/{CreatedOnBrandCrowd-fr-fr-ex-VCVjf.js → CreatedOnBrandCrowd-fr-fr-Co7HnCCh.js} +1 -1
  5. package/lib/src/{CreatedOnBrandCrowd-pt-pt-BnxPrMQQ.js → CreatedOnBrandCrowd-pt-pt-CUfwZY_0.js} +1 -1
  6. package/lib/src/{CreatedOnDcom-de-de-Bwxloguf.js → CreatedOnDcom-de-de-BKFAgXuQ.js} +1 -1
  7. package/lib/src/{CreatedOnDcom-en-us-CbiXSOCF.js → CreatedOnDcom-en-us-JoPkBvCX.js} +1 -1
  8. package/lib/src/{CreatedOnDcom-es-es-CbkeqCK4.js → CreatedOnDcom-es-es-FrxFKf7g.js} +1 -1
  9. package/lib/src/{CreatedOnDcom-fr-fr-BrkRGyPq.js → CreatedOnDcom-fr-fr-BV8sZ9a3.js} +1 -1
  10. package/lib/src/{CreatedOnDcom-pt-pt-Q-46uDXU.js → CreatedOnDcom-pt-pt-LYSFhF61.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 +75 -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/stores/brandpage-maker/brandpage-maker-store.js +2 -1
  31. package/lib/src/css/library.brand-page-brandCrowd.min.css +3 -6
  32. package/lib/src/css/library.brand-page-brandPage.min.css +3 -6
  33. package/lib/src/css/library.brand-page-designCom.min.css +3 -6
  34. package/lib/src/css/library.brand-page-preview.min.css +3 -6
  35. package/lib/src/index.mjs +1 -1
  36. package/lib/src/{lib-DQfmtI-m.js → lib-uIEOdQjT.js} +12010 -11915
  37. package/lib/src/shared/page-settings/store/page-settings-store.js +1 -1
  38. package/lib/src/shared/template-settings/store/template-settings-store.js +2 -1
  39. package/package.json +1 -1
  40. package/src/brand-page/components/logo/Logo.vue +14 -3
  41. package/src/brand-page/components/logo/LogoRender.vue +31 -13
  42. package/src/brand-page/constants/logo.constants.ts +3 -0
  43. package/src/brand-page/utils/__snapshots__/migration.util.test.ts.snap +1121 -1112
  44. package/src/brand-page/utils/migration/logo/migration.util.logo.test.ts +3 -3
  45. package/src/brand-page/utils/migration/migration-01.ts +2 -2
  46. package/src/brand-page/utils/migration/migration-02.ts +2 -2
  47. package/src/brand-page/utils/migration/migration-03.ts +2 -2
  48. package/src/brand-page/utils/migration/migration-04.ts +2 -2
  49. package/src/brand-page/utils/migration/migration-05.ts +12 -2
  50. package/src/brand-page/utils/migration/migration-06.test.ts +338 -0
  51. package/src/brand-page/utils/migration/migration-06.ts +125 -0
  52. package/src/brand-page/utils/migration.util.test.ts +274 -157
  53. package/src/brand-page/utils/migration.util.ts +22 -7
  54. package/src/brand-page/utils/migration2.util.test.ts +4 -2
  55. package/src/brand-page/utils/view-model.util.ts +20 -6
  56. package/src/brand-page/view-models.ts +1 -0
  57. package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.ts +2 -1
  58. package/src/shared/page-settings/store/page-settings-store.ts +1 -0
  59. package/src/shared/template-settings/store/template-settings-store.ts +2 -1
  60. package/lib/src/clients/axios-locale-wrapper.d.ts +0 -1
  61. package/lib/src/clients/axios-locale-wrapper.js +0 -10
  62. package/src/clients/axios-locale-wrapper.js +0 -17
  63. package/src/shared/page-settings/components/page-settings/PageElement.FIX_INSTRUCTIONS.txt +0 -0
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as e, openBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-DQfmtI-m.js";
2
+ import { _ as t } from "./lib-uIEOdQjT.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-DQfmtI-m.js";
2
+ import { _ as t } from "./lib-uIEOdQjT.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-DQfmtI-m.js";
2
+ import { _ as t } from "./lib-uIEOdQjT.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-DQfmtI-m.js";
2
+ import { _ as t } from "./lib-uIEOdQjT.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-DQfmtI-m.js";
2
+ import { _ as t } from "./lib-uIEOdQjT.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-DQfmtI-m.js";
2
+ import { _ as e } from "./lib-uIEOdQjT.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-DQfmtI-m.js";
2
+ import { _ as e } from "./lib-uIEOdQjT.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-DQfmtI-m.js";
2
+ import { _ as e } from "./lib-uIEOdQjT.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-DQfmtI-m.js";
2
+ import { _ as e } from "./lib-uIEOdQjT.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-DQfmtI-m.js";
2
+ import { _ as M } from "./lib-uIEOdQjT.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,75 @@
1
+ import { DEFAULT_LOGO_HEIGHT, DEFAULT_LOGO_WIDTH, } from '../..';
2
+ import { FabricRenderClient } from '../../../clients/fabric-render-client';
3
+ import { emToPx } from '../../../brand-page-maker/utils/text.util';
4
+ const REM_TO_PIXELS_RATIO = 16;
5
+ export const migration06 = async (brandPageModel, options) => {
6
+ if (options.skipMigration06 !== undefined && options.skipMigration06) {
7
+ return brandPageModel;
8
+ }
9
+ try {
10
+ const headerLogo = brandPageModel.pageHeaderDesktop;
11
+ const fabricClient = FabricRenderClient.getInstance();
12
+ const logoData = headerLogo?.logoTemplateImage?.logoTemplateToken
13
+ ? await fabricClient.getLogoSvgUrlByLogoTemplateImageAsync(headerLogo.logoTemplateImage)
14
+ : await fabricClient.getLogoSvgUrlByLogoImageAsync(headerLogo.logoImage);
15
+ if (logoData && logoData.width && logoData.height) {
16
+ const remToPixels = (remValue) => {
17
+ return parseFloat(emToPx(remValue));
18
+ };
19
+ const calculateConstrainedDimensions = (maxWidth, maxHeight) => {
20
+ const maxWidthPx = remToPixels(maxWidth);
21
+ const maxHeightPx = remToPixels(maxHeight);
22
+ // Calculate the actual displayed dimensions considering max-width and max-height constraints
23
+ const logoAspectRatio = logoData.width / logoData.height;
24
+ const maxAspectRatio = maxWidthPx / maxHeightPx;
25
+ let actualWidth;
26
+ let actualHeight;
27
+ if (logoAspectRatio > maxAspectRatio) {
28
+ // Logo is wider relative to max dimensions, constrain by width
29
+ actualWidth = Math.min(logoData.width, maxWidthPx);
30
+ actualHeight = actualWidth / logoAspectRatio;
31
+ }
32
+ else {
33
+ // Logo is taller relative to max dimensions, constrain by height
34
+ actualHeight = Math.min(logoData.height, maxHeightPx);
35
+ actualWidth = actualHeight * logoAspectRatio;
36
+ }
37
+ const actualWidthRem = `${Math.round(actualWidth / REM_TO_PIXELS_RATIO)}rem`;
38
+ const actualHeightRem = `${Math.ceil(actualHeight / REM_TO_PIXELS_RATIO)}rem`;
39
+ return { width: actualWidthRem, height: actualHeightRem };
40
+ };
41
+ if (brandPageModel.pageHeaderDesktop) {
42
+ const currentMaxWidth = brandPageModel.pageHeaderDesktop.logoImageWidth || DEFAULT_LOGO_WIDTH;
43
+ const currentMaxHeight = brandPageModel.pageHeaderDesktop.logoImageHeight ||
44
+ DEFAULT_LOGO_HEIGHT;
45
+ const dimensions = calculateConstrainedDimensions(currentMaxWidth, currentMaxHeight);
46
+ brandPageModel.pageHeaderDesktop.logoImageHeight = dimensions.height;
47
+ }
48
+ if (brandPageModel.pageHeaderMobile) {
49
+ const currentMaxWidth = brandPageModel.pageHeaderMobile.logoImageWidth || DEFAULT_LOGO_WIDTH;
50
+ const currentMaxHeight = brandPageModel.pageHeaderMobile.logoImageHeight ||
51
+ DEFAULT_LOGO_HEIGHT;
52
+ const dimensions = calculateConstrainedDimensions(currentMaxWidth, currentMaxHeight);
53
+ brandPageModel.pageHeaderMobile.logoImageHeight = dimensions.height;
54
+ }
55
+ if (brandPageModel.pageFooterDesktop) {
56
+ const currentMaxWidth = brandPageModel.pageFooterDesktop.logoImageWidth || DEFAULT_LOGO_WIDTH;
57
+ const currentMaxHeight = brandPageModel.pageFooterDesktop.logoImageHeight ||
58
+ DEFAULT_LOGO_HEIGHT;
59
+ const dimensions = calculateConstrainedDimensions(currentMaxWidth, currentMaxHeight);
60
+ brandPageModel.pageFooterDesktop.logoImageHeight = dimensions.height;
61
+ }
62
+ if (brandPageModel.pageFooterMobile) {
63
+ const currentMaxWidth = brandPageModel.pageFooterMobile.logoImageWidth || DEFAULT_LOGO_WIDTH;
64
+ const currentMaxHeight = brandPageModel.pageFooterMobile.logoImageHeight ||
65
+ DEFAULT_LOGO_HEIGHT;
66
+ const dimensions = calculateConstrainedDimensions(currentMaxWidth, currentMaxHeight);
67
+ brandPageModel.pageFooterMobile.logoImageHeight = dimensions.height;
68
+ }
69
+ }
70
+ }
71
+ catch (error) {
72
+ console.warn('Migration 06: Failed to fetch logo dimensions:', error);
73
+ }
74
+ return brandPageModel;
75
+ };
@@ -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
  const MIGRATION_TABLE = [
9
11
  {
10
12
  version: 1,
@@ -30,19 +32,29 @@ const MIGRATION_TABLE = [
30
32
  version: 5.1,
31
33
  migrateFn: migration051,
32
34
  },
35
+ {
36
+ version: 6,
37
+ migrateFn: migration06,
38
+ },
33
39
  ];
34
40
  export const GetLatestModelVersion = () => Math.max(...MIGRATION_TABLE.map((x) => x.version));
35
- export const migrateBrandPageModel = (brandPageModel, options) => {
41
+ export const migrateBrandPageModel = async (brandPageModel, options) => {
36
42
  let modelVersion = brandPageModel.v;
43
+ let useOldLogoRenderSize = false;
37
44
  if (!modelVersion) {
38
45
  modelVersion = 0;
39
46
  }
40
- MIGRATION_TABLE.forEach((x) => {
47
+ for (const x of MIGRATION_TABLE) {
41
48
  if (modelVersion < x.version) {
42
- brandPageModel = x.migrateFn(brandPageModel, options);
49
+ if (options.isServerRender && x.version === LOGO_MIGRATION_VERSION) {
50
+ useOldLogoRenderSize = true;
51
+ }
52
+ else {
53
+ brandPageModel = await x.migrateFn(brandPageModel, options);
54
+ }
43
55
  }
44
- });
56
+ }
45
57
  // Set the model to latest version
46
58
  brandPageModel.v = GetLatestModelVersion();
47
- return brandPageModel;
59
+ return { brandPageModel, useOldLogoRenderSize };
48
60
  };
@@ -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;
@@ -418,9 +418,10 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
418
418
  if (!logoImage?.logoDraftToken) {
419
419
  logoImage = logoUtil.safeGetLogoImageFromLogoImageUrl(logoVariationImageUrls[0]);
420
420
  }
421
- migrateBrandPageModel(brandPageModel, {
421
+ await migrateBrandPageModel(brandPageModel, {
422
422
  logoImage,
423
423
  isUserDraft: this.isUserDraft,
424
+ isServerRender: false,
424
425
  });
425
426
  const userPersonalisation = personalisationData && personalisationData.length > 0
426
427
  ? personalisationData[await getAiContentIndexByTemplateTokenAndNumberOfVariations(this.selectedTemplateId, personalisationData.length)].userPersonalisation
@@ -5332,21 +5332,18 @@ input[data-v-4cd691db]::-webkit-inner-spin-button {
5332
5332
  }
5333
5333
  }
5334
5334
 
5335
- .logo__container[data-v-d24cdbe3] {
5335
+ .logo__container[data-v-810d4098] {
5336
5336
  border: 0.125rem solid var(--logo-border-colour);
5337
5337
  border-radius: 0.75rem;
5338
5338
  }
5339
- .logo__image[data-v-d24cdbe3] {
5339
+ .logo__image[data-v-810d4098] {
5340
5340
  display: block;
5341
5341
  -o-object-fit: contain;
5342
5342
  object-fit: contain;
5343
5343
  height: 6rem;
5344
- }
5345
- .brand-page .logo__image[data-v-d24cdbe3] {
5346
- margin: var(--logo-spacing) auto;
5347
5344
  }
5348
5345
 
5349
- .logo[data-v-0de93a73] {
5346
+ .logo[data-v-b263e6e9] {
5350
5347
  --logo-border-colour: #00000000;
5351
5348
  --logo-size: 8rem;
5352
5349
  --logo-spacing: 0.75rem;
@@ -5660,21 +5660,18 @@ input[data-v-4cd691db]::-webkit-inner-spin-button {
5660
5660
  }
5661
5661
  }
5662
5662
 
5663
- .logo__container[data-v-d24cdbe3] {
5663
+ .logo__container[data-v-810d4098] {
5664
5664
  border: 0.125rem solid var(--logo-border-colour);
5665
5665
  border-radius: 0.75rem;
5666
5666
  }
5667
- .logo__image[data-v-d24cdbe3] {
5667
+ .logo__image[data-v-810d4098] {
5668
5668
  display: block;
5669
5669
  -o-object-fit: contain;
5670
5670
  object-fit: contain;
5671
5671
  height: 6rem;
5672
- }
5673
- .brand-page .logo__image[data-v-d24cdbe3] {
5674
- margin: var(--logo-spacing) auto;
5675
5672
  }
5676
5673
 
5677
- .logo[data-v-0de93a73] {
5674
+ .logo[data-v-b263e6e9] {
5678
5675
  --logo-border-colour: #00000000;
5679
5676
  --logo-size: 8rem;
5680
5677
  --logo-spacing: 0.75rem;
@@ -5350,21 +5350,18 @@ input[data-v-4cd691db]::-webkit-inner-spin-button {
5350
5350
  }
5351
5351
  }
5352
5352
 
5353
- .logo__container[data-v-d24cdbe3] {
5353
+ .logo__container[data-v-810d4098] {
5354
5354
  border: 0.125rem solid var(--logo-border-colour);
5355
5355
  border-radius: 0.75rem;
5356
5356
  }
5357
- .logo__image[data-v-d24cdbe3] {
5357
+ .logo__image[data-v-810d4098] {
5358
5358
  display: block;
5359
5359
  -o-object-fit: contain;
5360
5360
  object-fit: contain;
5361
5361
  height: 6rem;
5362
- }
5363
- .brand-page .logo__image[data-v-d24cdbe3] {
5364
- margin: var(--logo-spacing) auto;
5365
5362
  }
5366
5363
 
5367
- .logo[data-v-0de93a73] {
5364
+ .logo[data-v-b263e6e9] {
5368
5365
  --logo-border-colour: #00000000;
5369
5366
  --logo-size: 8rem;
5370
5367
  --logo-spacing: 0.75rem;
@@ -5092,21 +5092,18 @@ input[data-v-4cd691db]::-webkit-inner-spin-button {
5092
5092
  }
5093
5093
  }
5094
5094
 
5095
- .bp .logo__container[data-v-d24cdbe3] {
5095
+ .bp .logo__container[data-v-810d4098] {
5096
5096
  border: 0.125rem solid var(--logo-border-colour);
5097
5097
  border-radius: 0.75rem;
5098
5098
  }
5099
- .bp .logo__image[data-v-d24cdbe3] {
5099
+ .bp .logo__image[data-v-810d4098] {
5100
5100
  display: block;
5101
5101
  -o-object-fit: contain;
5102
5102
  object-fit: contain;
5103
5103
  height: 6rem;
5104
- }
5105
- .bp .brand-page .logo__image[data-v-d24cdbe3] {
5106
- margin: var(--logo-spacing) auto;
5107
5104
  }
5108
5105
 
5109
- .bp .logo[data-v-0de93a73] {
5106
+ .bp .logo[data-v-b263e6e9] {
5110
5107
  --logo-border-colour: #00000000;
5111
5108
  --logo-size: 8rem;
5112
5109
  --logo-spacing: 0.75rem;
package/lib/src/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { by as E, an as T, aP as I, a3 as N, ag as S, ad as s, bo as A, bF as O, c6 as e, c5 as G, c4 as C, b_ as D, aZ as P, aY as R, bK as t, bL as L, bS as M, bH as o, bJ as b, bI as r, bM as F, bN as n, bZ as B, bX as g, am as l, bY as i, a6 as Y, aU as U, aW as c, aV as d, e as H, f as u, B as y, Y as K, d as p, Z as k, j as V, aj as X, X as m, bn as v, bG as h, at as W, aR as x, aN as f, bV as Z, bU as w, C as z, b0 as Q, D as j, b as q, a as J, bQ as $, a$ as aa, aS as _a, aO as Ea, c2 as Ta, c3 as Ia, bT as Na, bC as Sa, ab as sa, bW as Aa, b$ as Oa, b5 as ea, aF as Ga, bb as Ca, F as Da, a5 as Pa, a4 as Ra, h as ta, $ as La, b2 as Ma, aQ as oa, aM as ba, a1 as ra, G as Fa, I as na, H as Ba, a7 as ga, bz as la, b6 as ia, b7 as Ya, bx as Ua, bd as ca, bf as da, b1 as Ha, L as ua, aE as ya, bk as Ka, aK as pa, bj as ka, ao as Va, a9 as Xa, bR as ma, c0 as va, c1 as ha, aT as Wa, N as xa, aw as fa, av as Za, ax as wa, ar as za, as as Qa, au as ja, b9 as qa, bg as Ja, b3 as $a, n as a_, ah as __, ai as E_, ae as T_, af as I_, ac as N_, a2 as S_, l as s_, bl as A_, al as O_, bD as e_, bE as G_, bP as C_, aa as D_, bB as P_, bm as R_, m as t_, S as L_, P as M_, aD as o_, bA as b_, ba as r_, bs as F_, br as n_, bu as B_, bp as g_, bv as l_, bw as i_, bq as Y_, bt as U_, ay as c_, az as d_, bi as H_, bh as u_, aB as y_, aC as K_, aH as p_, aX as k_, aG as V_, aI as X_, U as m_, a8 as v_, aL as h_, k as W_, b8 as x_, ak as f_, b4 as Z_, bc as w_, be as z_, a_ as Q_, M as j_, a0 as q_, g as J_, bO as $_, q as aE, J as _E, W as EE, aA as TE, aJ as IE, ap as NE, o as SE, T as sE, r as AE, u as OE, i as eE, aq as GE, c as CE, p as DE, t as PE, R as RE, K as tE, s as LE, V as ME, y as oE, v as bE, w as rE, Q as FE, z as nE, O as BE, A as gE, E as lE, x as iE } from "./lib-DQfmtI-m.js";
1
+ import { by as E, an as T, aP as I, a3 as N, ag as S, ad as s, bo as A, bF as O, c6 as e, c5 as G, c4 as C, b_ as D, aZ as P, aY as R, bK as t, bL as L, bS as M, bH as o, bJ as b, bI as r, bM as F, bN as n, bZ as B, bX as g, am as l, bY as i, a6 as Y, aU as U, aW as c, aV as d, e as H, f as u, B as y, Y as K, d as p, Z as k, j as V, aj as X, X as m, bn as v, bG as h, at as W, aR as x, aN as f, bV as Z, bU as w, C as z, b0 as Q, D as j, b as q, a as J, bQ as $, a$ as aa, aS as _a, aO as Ea, c2 as Ta, c3 as Ia, bT as Na, bC as Sa, ab as sa, bW as Aa, b$ as Oa, b5 as ea, aF as Ga, bb as Ca, F as Da, a5 as Pa, a4 as Ra, h as ta, $ as La, b2 as Ma, aQ as oa, aM as ba, a1 as ra, G as Fa, I as na, H as Ba, a7 as ga, bz as la, b6 as ia, b7 as Ya, bx as Ua, bd as ca, bf as da, b1 as Ha, L as ua, aE as ya, bk as Ka, aK as pa, bj as ka, ao as Va, a9 as Xa, bR as ma, c0 as va, c1 as ha, aT as Wa, N as xa, aw as fa, av as Za, ax as wa, ar as za, as as Qa, au as ja, b9 as qa, bg as Ja, b3 as $a, n as a_, ah as __, ai as E_, ae as T_, af as I_, ac as N_, a2 as S_, l as s_, bl as A_, al as O_, bD as e_, bE as G_, bP as C_, aa as D_, bB as P_, bm as R_, m as t_, S as L_, P as M_, aD as o_, bA as b_, ba as r_, bs as F_, br as n_, bu as B_, bp as g_, bv as l_, bw as i_, bq as Y_, bt as U_, ay as c_, az as d_, bi as H_, bh as u_, aB as y_, aC as K_, aH as p_, aX as k_, aG as V_, aI as X_, U as m_, a8 as v_, aL as h_, k as W_, b8 as x_, ak as f_, b4 as Z_, bc as w_, be as z_, a_ as Q_, M as j_, a0 as q_, g as J_, bO as $_, q as aE, J as _E, W as EE, aA as TE, aJ as IE, ap as NE, o as SE, T as sE, r as AE, u as OE, i as eE, aq as GE, c as CE, p as DE, t as PE, R as RE, K as tE, s as LE, V as ME, y as oE, v as bE, w as rE, Q as FE, z as nE, O as BE, A as gE, E as lE, x as iE } from "./lib-uIEOdQjT.js";
2
2
  import { createPinia as UE, setActivePinia as cE } from "pinia";
3
3
  export {
4
4
  E as ABOUT_SECTION_SETTINGS_CONFIG,