@designcrowd/library.brand-page 5.14.3 → 5.14.4-flacky-nav-20

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 (99) hide show
  1. package/lib/src/{CreatedOnBrandCrowd-de-de-D0D9APwq.js → CreatedOnBrandCrowd-de-de-D6fmcmiG.js} +1 -1
  2. package/lib/src/{CreatedOnBrandCrowd-en-us-D0TLbaE5.js → CreatedOnBrandCrowd-en-us-0e6iElRh.js} +1 -1
  3. package/lib/src/{CreatedOnBrandCrowd-es-es-CljMPMgZ.js → CreatedOnBrandCrowd-es-es-DyVOGiYK.js} +1 -1
  4. package/lib/src/{CreatedOnBrandCrowd-fr-fr-LJjcPzL-.js → CreatedOnBrandCrowd-fr-fr-D8wrO0EO.js} +1 -1
  5. package/lib/src/{CreatedOnBrandCrowd-pt-pt-BRr9vOwt.js → CreatedOnBrandCrowd-pt-pt-DZCcVTVy.js} +1 -1
  6. package/lib/src/{CreatedOnDcom-de-de-DYTf3ViS.js → CreatedOnDcom-de-de-IIkhu8ZZ.js} +1 -1
  7. package/lib/src/{CreatedOnDcom-en-us-CoVdLYRn.js → CreatedOnDcom-en-us-D_Quyqbp.js} +1 -1
  8. package/lib/src/{CreatedOnDcom-es-es-Cwv2fL04.js → CreatedOnDcom-es-es-BfKHaFhp.js} +1 -1
  9. package/lib/src/{CreatedOnDcom-fr-fr-CB-bp8IS.js → CreatedOnDcom-fr-fr-BrNaR5yK.js} +1 -1
  10. package/lib/src/{CreatedOnDcom-pt-pt-BU6yS2P1.js → CreatedOnDcom-pt-pt-DUac_-1A.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/constants/styles.constants.d.ts +2 -2
  14. package/lib/src/brand-page/constants/styles.constants.js +2 -2
  15. package/lib/src/brand-page/utils/migration/migration-01.d.ts +3 -2
  16. package/lib/src/brand-page/utils/migration/migration-01.js +3 -2
  17. package/lib/src/brand-page/utils/migration/migration-01_1.d.ts +4 -3
  18. package/lib/src/brand-page/utils/migration/migration-01_1.js +3 -2
  19. package/lib/src/brand-page/utils/migration/migration-02.d.ts +4 -3
  20. package/lib/src/brand-page/utils/migration/migration-02.js +3 -2
  21. package/lib/src/brand-page/utils/migration/migration-03.d.ts +4 -3
  22. package/lib/src/brand-page/utils/migration/migration-03.js +3 -2
  23. package/lib/src/brand-page/utils/migration/migration-04.d.ts +4 -3
  24. package/lib/src/brand-page/utils/migration/migration-04.js +3 -2
  25. package/lib/src/brand-page/utils/migration/migration-05.d.ts +6 -2
  26. package/lib/src/brand-page/utils/migration/migration-05.js +3 -2
  27. package/lib/src/brand-page/utils/migration/migration-05_1.d.ts +3 -3
  28. package/lib/src/brand-page/utils/migration/migration-05_1.js +3 -3
  29. package/lib/src/brand-page/utils/migration/migration-05_2.d.ts +3 -3
  30. package/lib/src/brand-page/utils/migration/migration-05_2.js +3 -2
  31. package/lib/src/brand-page/utils/migration/migration-06.d.ts +4 -0
  32. package/lib/src/brand-page/utils/migration/migration-06.js +60 -0
  33. package/lib/src/brand-page/utils/migration.util.d.ts +6 -1
  34. package/lib/src/brand-page/utils/migration.util.js +16 -6
  35. package/lib/src/brand-page/utils/view-model.util.d.ts +6 -4
  36. package/lib/src/brand-page/utils/view-model.util.js +14 -13
  37. package/lib/src/brand-page/view-models.d.ts +1 -0
  38. package/lib/src/brand-page-maker/components/action-bar/ActionBar.mixin.d.ts +1 -1
  39. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.d.ts +1 -1
  40. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.stories.d.ts +1 -0
  41. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.stories.js +48 -2
  42. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMakerTemplateSettings.mixin.d.ts +1 -1
  43. package/lib/src/brand-page-maker/components/brand-page-maker/__fixtures__/brand-page-examples.d.ts +1122 -0
  44. package/lib/src/brand-page-maker/components/brand-page-maker/__fixtures__/brand-page-examples.js +1058 -0
  45. package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.d.ts +1 -1
  46. package/lib/src/brand-page-maker/components/brandpage-settings/ReplaceImageSettingsForBrandPageSettings.mixin.d.ts +1 -1
  47. package/lib/src/brand-page-maker/components/google-analytics/GoogleAnalytics.mixin.d.ts +1 -1
  48. package/lib/src/brand-page-maker/components/seo-settings/SeoPageSettings.mixin.d.ts +1 -1
  49. package/lib/src/brand-page-maker/components/seo-settings/UrlSettings.mixin.d.ts +1 -1
  50. package/lib/src/brand-page-maker/components/social-share/SocialShare.mixin.d.ts +1 -1
  51. package/lib/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.d.ts +1 -1
  52. package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.d.ts +2 -1
  53. package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.js +3 -2
  54. package/lib/src/css/library.brand-page-brandCrowd.min.css +3 -6
  55. package/lib/src/css/library.brand-page-brandPage.min.css +3 -6
  56. package/lib/src/css/library.brand-page-designCom.min.css +3 -6
  57. package/lib/src/css/library.brand-page-preview.min.css +3 -6
  58. package/lib/src/index.mjs +1 -1
  59. package/lib/src/{lib-tM_6RdaI.js → lib-BRaFRV_F.js} +12482 -12351
  60. package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.d.ts +1 -1
  61. package/lib/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.mixin.d.ts +1 -1
  62. package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.d.ts +1 -1
  63. package/lib/src/shared/logo-settings/components/LogoSettings.mixin.d.ts +1 -1
  64. package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.d.ts +1 -1
  65. package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.d.ts +1 -1
  66. package/lib/src/shared/page-settings/store/page-settings-store.js +1 -1
  67. package/lib/src/shared/publish-brand-page-with-state/PublishBrandPageModalWithState.mixin.d.ts +1 -1
  68. package/lib/src/shared/style-settings/components/StyleSettings.mixin.d.ts +1 -1
  69. package/lib/src/shared/template-settings/components/TemplatesSettings.mixin.js +0 -5
  70. package/lib/src/shared/template-settings/store/template-settings-store.js +2 -1
  71. package/package.json +1 -1
  72. package/src/brand-page/components/logo/Logo.vue +24 -1
  73. package/src/brand-page/components/logo/LogoRender.vue +56 -20
  74. package/src/brand-page/constants/logo.constants.ts +3 -0
  75. package/src/brand-page/constants/styles.constants.ts +2 -2
  76. package/src/brand-page/utils/__snapshots__/migration.util.test.ts.snap +1121 -1112
  77. package/src/brand-page/utils/__snapshots__/migration2.util.test.ts.snap +416 -413
  78. package/src/brand-page/utils/migration/logo/migration.util.logo.test.ts +3 -3
  79. package/src/brand-page/utils/migration/migration-01.ts +7 -4
  80. package/src/brand-page/utils/migration/migration-01_1.ts +6 -3
  81. package/src/brand-page/utils/migration/migration-02.ts +7 -4
  82. package/src/brand-page/utils/migration/migration-03.ts +7 -4
  83. package/src/brand-page/utils/migration/migration-04.ts +7 -4
  84. package/src/brand-page/utils/migration/migration-05.ts +16 -3
  85. package/src/brand-page/utils/migration/migration-05_1.ts +6 -4
  86. package/src/brand-page/utils/migration/migration-05_2.ts +6 -3
  87. package/src/brand-page/utils/migration/migration-06.test.ts +384 -0
  88. package/src/brand-page/utils/migration/migration-06.ts +108 -0
  89. package/src/brand-page/utils/migration.util.test.ts +274 -157
  90. package/src/brand-page/utils/migration.util.ts +26 -9
  91. package/src/brand-page/utils/migration2.util.test.ts +7 -2
  92. package/src/brand-page/utils/view-model.util.ts +26 -7
  93. package/src/brand-page/view-models.ts +1 -0
  94. package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.stories.ts +52 -1
  95. package/src/brand-page-maker/components/brand-page-maker/__fixtures__/brand-page-examples.ts +1090 -0
  96. package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.ts +4 -1
  97. package/src/shared/page-settings/store/page-settings-store.ts +1 -0
  98. package/src/shared/template-settings/components/TemplatesSettings.mixin.ts +0 -6
  99. package/src/shared/template-settings/store/template-settings-store.ts +2 -1
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as e, openBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-tM_6RdaI.js";
2
+ import { _ as t } from "./lib-BRaFRV_F.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-tM_6RdaI.js";
2
+ import { _ as t } from "./lib-BRaFRV_F.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-tM_6RdaI.js";
2
+ import { _ as t } from "./lib-BRaFRV_F.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-tM_6RdaI.js";
2
+ import { _ as t } from "./lib-BRaFRV_F.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-tM_6RdaI.js";
2
+ import { _ as t } from "./lib-BRaFRV_F.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-tM_6RdaI.js";
2
+ import { _ as e } from "./lib-BRaFRV_F.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-tM_6RdaI.js";
2
+ import { _ as e } from "./lib-BRaFRV_F.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-tM_6RdaI.js";
2
+ import { _ as e } from "./lib-BRaFRV_F.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-tM_6RdaI.js";
2
+ import { _ as e } from "./lib-BRaFRV_F.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-tM_6RdaI.js";
2
+ import { _ as M } from "./lib-BRaFRV_F.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;
@@ -16,9 +16,9 @@ export declare const defaultHamburgerNavigation: {
16
16
  export declare const OLD_DEFAULT_LOGO_HEIGHT = "6rem";
17
17
  export declare const DEFAULT_LOGO_HEIGHT = "9rem";
18
18
  export declare const DEFAULT_LOGO_WIDTH = "9rem";
19
- export declare const LOGO_SLIDER_DESKTOP_MIN = 5;
19
+ export declare const LOGO_SLIDER_DESKTOP_MIN = 1;
20
20
  export declare const LOGO_SLIDER_DESKTOP_MAX = 20;
21
- export declare const LOGO_SLIDER_MOBILE_MIN = 4;
21
+ export declare const LOGO_SLIDER_MOBILE_MIN = 1;
22
22
  export declare const LOGO_SLIDER_MOBILE_MAX = 13;
23
23
  export declare const CONTENT_TEXT_STYLE_PROPERTY_KEYS: {
24
24
  readonly descriptionStyle: "descriptionStyle";
@@ -18,9 +18,9 @@ export const OLD_DEFAULT_LOGO_HEIGHT = '6rem';
18
18
  export const DEFAULT_LOGO_HEIGHT = '9rem';
19
19
  export const DEFAULT_LOGO_WIDTH = '9rem';
20
20
  // Logo slider values are unit of rem
21
- export const LOGO_SLIDER_DESKTOP_MIN = 5;
21
+ export const LOGO_SLIDER_DESKTOP_MIN = 1;
22
22
  export const LOGO_SLIDER_DESKTOP_MAX = 20;
23
- export const LOGO_SLIDER_MOBILE_MIN = 4;
23
+ export const LOGO_SLIDER_MOBILE_MIN = 1;
24
24
  export const LOGO_SLIDER_MOBILE_MAX = 13;
25
25
  export const CONTENT_TEXT_STYLE_PROPERTY_KEYS = {
26
26
  descriptionStyle: 'descriptionStyle',
@@ -1,4 +1,5 @@
1
1
  import type { BrandPageModel } from '../../';
2
+ import { type MigrationData } from '../../utils';
2
3
  export declare const applyTextContentTextToTextItemsMigration: (brandPageModel: BrandPageModel) => void;
3
4
  export declare const migrateProfileContentToHaveTextStyles: (brandPageModel: BrandPageModel) => void;
4
5
  export declare const migrateMailingListContentToHaveTextStyles: (brandPageModel: BrandPageModel) => void;
@@ -17,6 +18,6 @@ export declare const migrateNewLogoLogic: (brandPageModel: BrandPageModel, isUse
17
18
  export declare const migrateGlobalTextStylesToHaveMissingStyles: (brandPageModel: BrandPageModel) => void;
18
19
  export declare const migrateConvertLineHeightOnNavigationStyles: (brandPageModel: BrandPageModel) => void;
19
20
  export declare const migrateConvertLineHeightOnFooterStyles: (brandPageModel: BrandPageModel) => void;
20
- export declare const migration01: (brandPageModel: BrandPageModel, options: {
21
+ export declare const migration01: (migrationResult: MigrationData, options: {
21
22
  isUserDraft: boolean;
22
- }) => BrandPageModel;
23
+ }) => Promise<MigrationData>;
@@ -856,7 +856,8 @@ export const migrateConvertLineHeightOnFooterStyles = (brandPageModel) => {
856
856
  };
857
857
  }
858
858
  };
859
- export const migration01 = (brandPageModel, options) => {
859
+ export const migration01 = async (migrationResult, options) => {
860
+ const { brandPageModel } = migrationResult;
860
861
  if (!brandPageModel.brandPageType) {
861
862
  brandPageModel.brandPageType = BRAND_PAGE_TYPES.default;
862
863
  }
@@ -888,5 +889,5 @@ export const migration01 = (brandPageModel, options) => {
888
889
  migrateGlobalTextStylesToHaveMissingStyles(brandPageModel);
889
890
  migrateConvertLineHeightOnNavigationStyles(brandPageModel);
890
891
  migrateConvertLineHeightOnFooterStyles(brandPageModel);
891
- return brandPageModel;
892
+ return migrationResult;
892
893
  };
@@ -1,4 +1,5 @@
1
- import type { BrandPageModel, LogoImageModel } from '../..';
2
- export declare const migration01_1: (brandPageModel: BrandPageModel, options: {
1
+ import type { LogoImageModel } from '../..';
2
+ import type { MigrationData } from '../migration.util';
3
+ export declare const migration01_1: (migrationResult: MigrationData, options: {
3
4
  logoImage?: LogoImageModel;
4
- }) => BrandPageModel;
5
+ }) => MigrationData;
@@ -1,5 +1,6 @@
1
1
  import { migrateLogoImage } from './logo/logo.migration.util';
2
- export const migration01_1 = (brandPageModel, options) => {
2
+ export const migration01_1 = (migrationResult, options) => {
3
+ const { brandPageModel } = migrationResult;
3
4
  migrateLogoImage(brandPageModel, options.logoImage);
4
- return brandPageModel;
5
+ return migrationResult;
5
6
  };
@@ -1,6 +1,7 @@
1
- import { type BrandPageModel, type LogoImageModel } from '../..';
1
+ import { type LogoImageModel } from '../..';
2
+ import type { MigrationData } from '../migration.util';
2
3
  export declare const convertLetterSpacingRemToEm: (fontSizeInEmOrRem: string | undefined, letterSpacingRemValue: string | undefined) => string | undefined;
3
- export declare const migration02: (brandPageModel: BrandPageModel, options: {
4
+ export declare const migration02: (migrationResult: MigrationData, options: {
4
5
  logoImage?: LogoImageModel;
5
6
  isUserDraft: boolean;
6
- }) => BrandPageModel;
7
+ }) => Promise<MigrationData>;
@@ -31,7 +31,8 @@ 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 (migrationResult, options) => {
35
+ const { brandPageModel } = migrationResult;
35
36
  handleConversion(brandPageModel.pageHeaderDesktop?.navigation?.defaultButtonStyle);
36
37
  handleConversion(brandPageModel.pageHeaderMobile?.navigation?.defaultButtonStyle);
37
38
  handleConversion(brandPageModel.pageFooterDesktop?.copyrightStyle);
@@ -127,5 +128,5 @@ export const migration02 = (brandPageModel, options) => {
127
128
  }
128
129
  });
129
130
  });
130
- return brandPageModel;
131
+ return migrationResult;
131
132
  };
@@ -1,5 +1,6 @@
1
- import { type BrandPageModel, type LogoImageModel } from '../..';
2
- export declare const migration03: (brandPageModel: BrandPageModel, options: {
1
+ import { type LogoImageModel } from '../..';
2
+ import type { MigrationData } from '../migration.util';
3
+ export declare const migration03: (migrationResult: MigrationData, options: {
3
4
  logoImage?: LogoImageModel;
4
5
  isUserDraft: boolean;
5
- }) => BrandPageModel;
6
+ }) => Promise<MigrationData>;
@@ -28,7 +28,8 @@ 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 (migrationResult, options) => {
32
+ const { brandPageModel } = migrationResult;
32
33
  handleRecursiveFontSizeMigration(brandPageModel.pageHeaderDesktop);
33
34
  handleRecursiveFontSizeMigration(brandPageModel.pageHeaderMobile);
34
35
  handleRecursiveFontSizeMigration(brandPageModel.pageFooterDesktop);
@@ -116,5 +117,5 @@ export const migration03 = (brandPageModel, options) => {
116
117
  }
117
118
  });
118
119
  });
119
- return brandPageModel;
120
+ return migrationResult;
120
121
  };
@@ -1,5 +1,6 @@
1
- import { type BrandPageModel, type LogoImageModel } from '../..';
2
- export declare const migration04: (brandPageModel: BrandPageModel, options: {
1
+ import { type LogoImageModel } from '../..';
2
+ import type { MigrationData } from '../migration.util';
3
+ export declare const migration04: (migrationResult: MigrationData, options: {
3
4
  logoImage?: LogoImageModel;
4
5
  isUserDraft: boolean;
5
- }) => BrandPageModel;
6
+ }) => Promise<MigrationData>;
@@ -86,7 +86,8 @@ const updateUserUploadedImageUrls = (content) => {
86
86
  });
87
87
  }
88
88
  };
89
- export const migration04 = (brandPageModel, options) => {
89
+ export const migration04 = async (migrationResult, options) => {
90
+ const { brandPageModel } = migrationResult;
90
91
  if (brandPageModel.faviconUrl &&
91
92
  isUserUploadedImage(brandPageModel.faviconUrl)) {
92
93
  brandPageModel.faviconUrl = removeUserImageExtension(brandPageModel.faviconUrl);
@@ -111,5 +112,5 @@ export const migration04 = (brandPageModel, options) => {
111
112
  }
112
113
  });
113
114
  }
114
- return brandPageModel;
115
+ return migrationResult;
115
116
  };
@@ -1,2 +1,6 @@
1
- import { type BrandPageModel } from '../..';
2
- export declare const migration05: (brandPageModel: BrandPageModel) => BrandPageModel;
1
+ import { type LogoImageModel } from '../..';
2
+ import type { MigrationData } from '../migration.util';
3
+ export declare const migration05: (migrationResult: MigrationData, options: {
4
+ logoImage?: LogoImageModel;
5
+ isUserDraft: boolean;
6
+ }) => Promise<MigrationData>;
@@ -1,6 +1,7 @@
1
1
  import {} from '../..';
2
2
  import { isTextContent } from '../model.util';
3
- export const migration05 = (brandPageModel) => {
3
+ export const migration05 = async (migrationResult, options) => {
4
+ const { brandPageModel } = migrationResult;
4
5
  brandPageModel.pages.forEach((page) => {
5
6
  page.contents.forEach((content) => {
6
7
  if (isTextContent(content)) {
@@ -13,5 +14,5 @@ export const migration05 = (brandPageModel) => {
13
14
  }
14
15
  });
15
16
  });
16
- return brandPageModel;
17
+ return migrationResult;
17
18
  };
@@ -1,4 +1,4 @@
1
- import { type BrandPageModel } from '../..';
2
- export declare const migration05_1: (brandPageModel: BrandPageModel, options: {
1
+ import type { MigrationData } from '../migration.util';
2
+ export declare const migration05_1: (migrationResult: MigrationData, options: {
3
3
  isUserDraft: boolean;
4
- }) => BrandPageModel;
4
+ }) => MigrationData;
@@ -1,5 +1,5 @@
1
- import {} from '../..';
2
- export const migration05_1 = (brandPageModel, options) => {
1
+ export const migration05_1 = (migrationResult, options) => {
2
+ const { brandPageModel } = migrationResult;
3
3
  if (!options.isUserDraft) {
4
4
  brandPageModel.pageFooterDesktop?.socialLinks?.forEach((link) => {
5
5
  if (link.imageUrl === 'twitter') {
@@ -14,5 +14,5 @@ export const migration05_1 = (brandPageModel, options) => {
14
14
  }
15
15
  });
16
16
  }
17
- return brandPageModel;
17
+ return migrationResult;
18
18
  };
@@ -1,4 +1,4 @@
1
- import { type BrandPageModel } from '../..';
2
- export declare const migration05_2: (brandPageModel: BrandPageModel, options: {
1
+ import type { MigrationData } from '../migration.util';
2
+ export declare const migration05_2: (migrationResult: MigrationData, options: {
3
3
  isUserDraft: boolean;
4
- }) => BrandPageModel;
4
+ }) => MigrationData;
@@ -1,5 +1,6 @@
1
1
  import {} from '../..';
2
- export const migration05_2 = (brandPageModel, options) => {
2
+ export const migration05_2 = (migrationResult, options) => {
3
+ const { brandPageModel } = migrationResult;
3
4
  brandPageModel.pages.forEach((page) => {
4
5
  page.contents.forEach((content) => {
5
6
  // Casting content type to string to avoid adding placeholder types in CONTENT_SETTINGS_CONFIGS
@@ -10,5 +11,5 @@ export const migration05_2 = (brandPageModel, options) => {
10
11
  }
11
12
  });
12
13
  });
13
- return brandPageModel;
14
+ return migrationResult;
14
15
  };
@@ -0,0 +1,4 @@
1
+ import type { MigrationData } from '../migration.util';
2
+ export declare const migration06: (migrationResult: MigrationData, options: {
3
+ isServerRender: boolean;
4
+ }) => Promise<MigrationData>;
@@ -0,0 +1,60 @@
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 (migrationResult, options) => {
18
+ const { brandPageModel } = migrationResult;
19
+ if (options.isServerRender !== undefined && options.isServerRender) {
20
+ migrationResult.useOldLogoRenderSize = true;
21
+ return migrationResult;
22
+ }
23
+ try {
24
+ const fabricClient = FabricRenderClient.getInstance();
25
+ // Define all sections that need logo data
26
+ const sections = [
27
+ { name: 'pageHeaderDesktop', config: brandPageModel.pageHeaderDesktop },
28
+ { name: 'pageHeaderMobile', config: brandPageModel.pageHeaderMobile },
29
+ { name: 'pageFooterDesktop', config: brandPageModel.pageFooterDesktop },
30
+ { name: 'pageFooterMobile', config: brandPageModel.pageFooterMobile },
31
+ ].filter((section) => section.config);
32
+ // Fetch logo data for all sections in parallel
33
+ const logoDataPromises = sections.map(async (section) => {
34
+ const logoData = section.config?.logoTemplateImage?.logoTemplateToken
35
+ ? await fabricClient.getLogoSvgUrlByLogoTemplateImageAsync(section.config.logoTemplateImage)
36
+ : await fabricClient.getLogoSvgUrlByLogoImageAsync(section.config.logoImage);
37
+ return {
38
+ sectionName: section.name,
39
+ logoData,
40
+ config: section.config,
41
+ };
42
+ });
43
+ const results = await Promise.all(logoDataPromises);
44
+ // Apply dimensions to each section
45
+ results.forEach(({ sectionName, logoData, config }) => {
46
+ if (logoData && logoData.width && logoData.height && config) {
47
+ const currentMaxWidth = config.logoImageWidth || DEFAULT_LOGO_WIDTH;
48
+ const currentMaxHeight = config.logoImageHeight || DEFAULT_LOGO_HEIGHT;
49
+ const dimensions = calculateConstrainedDimensions(logoData, currentMaxWidth, currentMaxHeight);
50
+ config.logoImageHeight = dimensions.height;
51
+ }
52
+ });
53
+ }
54
+ catch (error) {
55
+ console.warn('Migration 06: Failed to fetch logo dimensions:', error);
56
+ migrationResult.useOldLogoRenderSize = true;
57
+ return migrationResult;
58
+ }
59
+ return migrationResult;
60
+ };
@@ -1,6 +1,11 @@
1
1
  import { type BrandPageModel, type LogoImageModel } from '../models';
2
+ export interface MigrationData {
3
+ brandPageModel: BrandPageModel;
4
+ useOldLogoRenderSize: boolean;
5
+ }
2
6
  export declare const GetLatestModelVersion: () => number;
3
7
  export declare const migrateBrandPageModel: (brandPageModel: BrandPageModel, options: {
4
8
  logoImage?: LogoImageModel;
5
9
  isUserDraft: boolean;
6
- }) => BrandPageModel;
10
+ isServerRender: boolean;
11
+ }) => Promise<MigrationData>;
@@ -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 { migration01_1 } from './migration/migration-01_1';
@@ -5,6 +6,7 @@ import { migration02 } from './migration/migration-02';
5
6
  import { migration03 } from './migration/migration-03';
6
7
  import { migration04 } from './migration/migration-04';
7
8
  import { migration05 } from './migration/migration-05';
9
+ import { migration06 } from './migration/migration-06';
8
10
  import { migration05_1 } from './migration/migration-05_1';
9
11
  import { migration05_2 } from './migration/migration-05_2';
10
12
  const MIGRATION_TABLE = [
@@ -49,19 +51,27 @@ const MIGRATION_TABLE = [
49
51
  migrateFn: migration05_2,
50
52
  description: 'Migrating twitter content to x content',
51
53
  },
54
+ {
55
+ version: 6,
56
+ migrateFn: migration06,
57
+ },
52
58
  ];
53
59
  export const GetLatestModelVersion = () => Math.max(...MIGRATION_TABLE.map((x) => x.version));
54
- export const migrateBrandPageModel = (brandPageModel, options) => {
60
+ export const migrateBrandPageModel = async (brandPageModel, options) => {
55
61
  let modelVersion = brandPageModel.v;
62
+ let migrationResult = {
63
+ brandPageModel,
64
+ useOldLogoRenderSize: false,
65
+ };
56
66
  if (!modelVersion) {
57
67
  modelVersion = 0;
58
68
  }
59
- MIGRATION_TABLE.forEach((x) => {
69
+ for (const x of MIGRATION_TABLE) {
60
70
  if (x.runAlways || modelVersion < x.version) {
61
- brandPageModel = x.migrateFn(brandPageModel, options);
71
+ migrationResult = await x.migrateFn(migrationResult, options);
62
72
  }
63
- });
73
+ }
64
74
  // Set the model to latest version
65
- brandPageModel.v = GetLatestModelVersion();
66
- return brandPageModel;
75
+ migrationResult.brandPageModel.v = GetLatestModelVersion();
76
+ return migrationResult;
67
77
  };
@@ -8,10 +8,12 @@ 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;
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;
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
+ export declare const mapToViewModel: (styles: PageStyles, brandPageType: BrandPageType, options?: {
14
+ useOldLogoRenderSize: boolean;
15
+ }) => (content: Content) => ContentViewModel | undefined;
16
+ export declare const getBrandPageViewModelFromBrandPageModel: (model: BrandPageModel, brandPageToken: string | undefined, showBrandCrowdLogo?: boolean, useOldLogoRenderSize?: boolean) => BrandPageViewModel;
15
17
  export declare const isLogoViewModel: (viewModel: ContentViewModel) => viewModel is LogoViewModel;
16
18
  /** for service.brand-page website preview by logo draft token */
17
19
  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,12 +599,12 @@ 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
  };
605
606
  };
606
- export const mapToViewModel = (styles, brandPageType) => (content) => {
607
+ export const mapToViewModel = (styles, brandPageType, options) => (content) => {
607
608
  switch (content.type) {
608
609
  case 'image':
609
610
  return mapToImageViewModel(content);
@@ -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, options?.useOldLogoRenderSize || false, {
617
618
  height: DEFAULT_LOGO_HEIGHT,
618
619
  width: DEFAULT_LOGO_WIDTH,
619
620
  });
@@ -670,10 +671,10 @@ 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
- .map(mapToViewModel(model.styles, model.brandPageType || BRAND_PAGE_TYPES.default))
677
+ .map(mapToViewModel(model.styles, model.brandPageType || BRAND_PAGE_TYPES.default, { useOldLogoRenderSize }))
677
678
  .filter((c) => c !== undefined);
678
679
  return {
679
680
  title: p.title,
@@ -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;
@@ -107,7 +107,7 @@ declare const _default: import("vue").DefineComponent<{}, {
107
107
  setBrandPageType({ brandPageType }: {
108
108
  brandPageType: "default" | "brandSite" | "brandContact";
109
109
  }): void;
110
- initialise({ brandPage, brandPageType, emailAddress, features, logoDraftDesignAttributes, unsplashApplicationName, templateCategories, personalisationData, isPersonalisationEnabled, businessName, logoVariationImageUrls, shopConfigData, }: import("../../stores").InitialisePayload): Promise<void>;
110
+ initialise({ brandPage, brandPageType, emailAddress, features, logoDraftDesignAttributes, unsplashApplicationName, templateCategories, personalisationData, isPersonalisationEnabled, businessName, logoVariationImageUrls, shopConfigData, isServerRenderOverride, }: import("../../stores").InitialisePayload): Promise<void>;
111
111
  initialisePages({ pages, sections, }: {
112
112
  pages: import("../../../brand-page").PageModel[];
113
113
  sections: import("../../../shared/page-settings/store").PageSettingsStateSections;
@@ -149,7 +149,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
149
149
  setBrandPageType({ brandPageType }: {
150
150
  brandPageType: "default" | "brandSite" | "brandContact";
151
151
  }): void;
152
- initialise({ brandPage, brandPageType, emailAddress, features, logoDraftDesignAttributes, unsplashApplicationName, templateCategories, personalisationData, isPersonalisationEnabled, businessName, logoVariationImageUrls, shopConfigData, }: import("../../stores").InitialisePayload): Promise<void>;
152
+ initialise({ brandPage, brandPageType, emailAddress, features, logoDraftDesignAttributes, unsplashApplicationName, templateCategories, personalisationData, isPersonalisationEnabled, businessName, logoVariationImageUrls, shopConfigData, isServerRenderOverride, }: import("../../stores").InitialisePayload): Promise<void>;
153
153
  initialisePages({ pages, sections, }: {
154
154
  pages: import("../../../brand-page").PageModel[];
155
155
  sections: import("../../../shared/page-settings/store").PageSettingsStateSections;
@@ -27,6 +27,7 @@ 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;
30
31
  export declare const SamplePublishedBrandSite: Story;
31
32
  export declare const SampleProfile: {
32
33
  (): any;