@designcrowd/library.brand-page 5.14.1 → 5.14.2-flacky-nav-14

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 (106) hide show
  1. package/lib/src/{CreatedOnBrandCrowd-de-de-GGeRP-yJ.js → CreatedOnBrandCrowd-de-de-C2c1FQGf.js} +1 -1
  2. package/lib/src/{CreatedOnBrandCrowd-en-us-D-mcoYKD.js → CreatedOnBrandCrowd-en-us-Cks6Jqvc.js} +1 -1
  3. package/lib/src/{CreatedOnBrandCrowd-es-es-UB-XVZLH.js → CreatedOnBrandCrowd-es-es-DH8PrvuY.js} +1 -1
  4. package/lib/src/{CreatedOnBrandCrowd-fr-fr-BcLwD-Ww.js → CreatedOnBrandCrowd-fr-fr-DF8Jbj0Z.js} +1 -1
  5. package/lib/src/{CreatedOnBrandCrowd-pt-pt-DuTtIiT7.js → CreatedOnBrandCrowd-pt-pt-BwY8Z3h2.js} +1 -1
  6. package/lib/src/{CreatedOnDcom-de-de-6nOtKdaY.js → CreatedOnDcom-de-de-BcxMTDdt.js} +1 -1
  7. package/lib/src/{CreatedOnDcom-en-us-BlzEFog2.js → CreatedOnDcom-en-us-CWkGPIq5.js} +1 -1
  8. package/lib/src/{CreatedOnDcom-es-es-B_v3IYem.js → CreatedOnDcom-es-es-qScwKYog.js} +1 -1
  9. package/lib/src/{CreatedOnDcom-fr-fr-DmWvH9K_.js → CreatedOnDcom-fr-fr-CdAeulis.js} +1 -1
  10. package/lib/src/{CreatedOnDcom-pt-pt-P25mfZVx.js → CreatedOnDcom-pt-pt-BAi_UyIx.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/models/brand-page-context.model.d.ts +2 -0
  14. package/lib/src/brand-page/models/brand-page-context.model.js +2 -1
  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-02.d.ts +4 -3
  18. package/lib/src/brand-page/utils/migration/migration-02.js +3 -2
  19. package/lib/src/brand-page/utils/migration/migration-03.d.ts +4 -3
  20. package/lib/src/brand-page/utils/migration/migration-03.js +3 -2
  21. package/lib/src/brand-page/utils/migration/migration-04.d.ts +4 -3
  22. package/lib/src/brand-page/utils/migration/migration-04.js +3 -2
  23. package/lib/src/brand-page/utils/migration/migration-05.d.ts +6 -2
  24. package/lib/src/brand-page/utils/migration/migration-05.js +3 -2
  25. package/lib/src/brand-page/utils/migration/migration-051.d.ts +3 -3
  26. package/lib/src/brand-page/utils/migration/migration-051.js +3 -2
  27. package/lib/src/brand-page/utils/migration/migration-052.d.ts +3 -3
  28. package/lib/src/brand-page/utils/migration/migration-052.js +3 -2
  29. package/lib/src/brand-page/utils/migration/migration-06.d.ts +4 -0
  30. package/lib/src/brand-page/utils/migration/migration-06.js +59 -0
  31. package/lib/src/brand-page/utils/migration.util.d.ts +6 -1
  32. package/lib/src/brand-page/utils/migration.util.js +16 -6
  33. package/lib/src/brand-page/utils/view-model.util.d.ts +3 -3
  34. package/lib/src/brand-page/utils/view-model.util.js +12 -11
  35. package/lib/src/brand-page/view-models.d.ts +1 -0
  36. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.d.ts +12 -3
  37. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.stories.d.ts +1 -0
  38. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.stories.js +49 -2
  39. package/lib/src/brand-page-maker/components/brand-page-maker/__fixtures__/brand-page-examples.d.ts +1122 -0
  40. package/lib/src/brand-page-maker/components/brand-page-maker/__fixtures__/brand-page-examples.js +1058 -0
  41. package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.d.ts +16 -3
  42. package/lib/src/brand-page-maker/components/quick-link-bar/QuickLinkBar.mixin.d.ts +12 -3
  43. package/lib/src/brand-page-maker/components/seo-settings/SeoPageSettings.mixin.d.ts +12 -3
  44. package/lib/src/brand-page-maker/components/seo-settings/UrlSettings.mixin.d.ts +12 -3
  45. package/lib/src/brand-page-maker/components/seo-settings/UseExistingDomainModal.mixin.d.ts +12 -3
  46. package/lib/src/brand-page-maker/components/upgrade-to-premium-button/UpgradeToPremiumButton.mixin.d.ts +12 -3
  47. package/lib/src/brand-page-maker/composables/useEventTracker.d.ts +7 -1
  48. package/lib/src/brand-page-maker/composables/useEventTracker.js +29 -4
  49. package/lib/src/brand-page-maker/stores/brandpage-container/brand-page-container-store.d.ts +14 -3
  50. package/lib/src/brand-page-maker/stores/brandpage-container/brand-page-container-store.js +56 -9
  51. package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.js +2 -1
  52. package/lib/src/clients/brand-page-client.d.ts +20 -3
  53. package/lib/src/clients/brand-page-client.js +29 -17
  54. package/lib/src/css/library.brand-page-brandCrowd.min.css +17 -17
  55. package/lib/src/css/library.brand-page-brandPage.min.css +17 -17
  56. package/lib/src/css/library.brand-page-designCom.min.css +17 -17
  57. package/lib/src/css/library.brand-page-preview.min.css +17 -17
  58. package/lib/src/index.mjs +35 -34
  59. package/lib/src/{lib-CQSKlB0S.js → lib-DcY5D4Az.js} +21202 -20928
  60. package/lib/src/mockServiceWorker.js +1 -1
  61. package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.d.ts +4 -0
  62. package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItem.mixin.d.ts +4 -0
  63. package/lib/src/shared/content-settings/components/payment-config-field/PaymentConfigField.mixin.d.ts +12 -3
  64. package/lib/src/shared/logo-settings/components/LogoSettings.mixin.d.ts +12 -3
  65. package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.d.ts +16 -3
  66. package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.d.ts +12 -3
  67. package/lib/src/shared/page-settings/store/page-settings-store.js +1 -1
  68. package/lib/src/shared/publish-brand-page-with-state/PublishBrandPageModalWithState.mixin.d.ts +30 -10
  69. package/lib/src/shared/publish-brand-page-with-state/PublishBrandPageModalWithState.mixin.js +25 -2
  70. package/lib/src/shared/side-bar/components/SideBar.mixin.d.ts +12 -3
  71. package/lib/src/shared/side-bar/components/SideBarTabButton.mixin.d.ts +4 -0
  72. package/lib/src/shared/style-settings/components/StyleSettings.mixin.d.ts +16 -3
  73. package/lib/src/shared/template-settings/components/TemplatesSettings.mixin.d.ts +4 -0
  74. package/lib/src/shared/template-settings/store/template-settings-store.js +2 -1
  75. package/package.json +2 -2
  76. package/src/brand-page/components/logo/Logo.vue +24 -1
  77. package/src/brand-page/components/logo/LogoRender.vue +38 -13
  78. package/src/brand-page/constants/logo.constants.ts +3 -0
  79. package/src/brand-page/models/brand-page-context.model.ts +7 -1
  80. package/src/brand-page/utils/__snapshots__/migration.util.test.ts.snap +1121 -1112
  81. package/src/brand-page/utils/__snapshots__/migration2.util.test.ts.snap +416 -413
  82. package/src/brand-page/utils/migration/logo/migration.util.logo.test.ts +3 -3
  83. package/src/brand-page/utils/migration/migration-01.ts +7 -4
  84. package/src/brand-page/utils/migration/migration-02.ts +7 -4
  85. package/src/brand-page/utils/migration/migration-03.ts +7 -4
  86. package/src/brand-page/utils/migration/migration-04.ts +7 -4
  87. package/src/brand-page/utils/migration/migration-05.ts +16 -3
  88. package/src/brand-page/utils/migration/migration-051.ts +6 -3
  89. package/src/brand-page/utils/migration/migration-052.ts +6 -3
  90. package/src/brand-page/utils/migration/migration-06.test.ts +384 -0
  91. package/src/brand-page/utils/migration/migration-06.ts +106 -0
  92. package/src/brand-page/utils/migration.util.test.ts +274 -157
  93. package/src/brand-page/utils/migration.util.ts +26 -9
  94. package/src/brand-page/utils/migration2.util.test.ts +7 -2
  95. package/src/brand-page/utils/view-model.util.ts +20 -6
  96. package/src/brand-page/view-models.ts +1 -0
  97. package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.stories.ts +53 -1
  98. package/src/brand-page-maker/components/brand-page-maker/__fixtures__/brand-page-examples.ts +1090 -0
  99. package/src/brand-page-maker/composables/useEventTracker.ts +37 -4
  100. package/src/brand-page-maker/stores/brandpage-container/brand-page-container-store.ts +96 -9
  101. package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.ts +2 -1
  102. package/src/clients/brand-page-client.ts +55 -20
  103. package/src/shared/page-settings/store/page-settings-store.ts +1 -0
  104. package/src/shared/publish-brand-page-with-state/PublishBrandPageModalWithState.mixin.ts +31 -2
  105. package/src/shared/publish-brand-page-with-state/PublishBrandPageModalWithState.vue +8 -0
  106. 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-CQSKlB0S.js";
2
+ import { _ as t } from "./lib-DcY5D4Az.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-CQSKlB0S.js";
2
+ import { _ as t } from "./lib-DcY5D4Az.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-CQSKlB0S.js";
2
+ import { _ as t } from "./lib-DcY5D4Az.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-CQSKlB0S.js";
2
+ import { _ as t } from "./lib-DcY5D4Az.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-CQSKlB0S.js";
2
+ import { _ as t } from "./lib-DcY5D4Az.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-CQSKlB0S.js";
2
+ import { _ as e } from "./lib-DcY5D4Az.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-CQSKlB0S.js";
2
+ import { _ as e } from "./lib-DcY5D4Az.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-CQSKlB0S.js";
2
+ import { _ as e } from "./lib-DcY5D4Az.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-CQSKlB0S.js";
2
+ import { _ as e } from "./lib-DcY5D4Az.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-CQSKlB0S.js";
2
+ import { _ as M } from "./lib-DcY5D4Az.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;
@@ -36,6 +36,7 @@ export interface AbTestResult {
36
36
  }
37
37
  export interface AbTest {
38
38
  bp_3926_freemium_watermark?: AbTestResult;
39
+ bp_4092_rotating_upsells_at_publish?: AbTestResult;
39
40
  }
40
41
  export declare const MEDIA_SIZES: {
41
42
  readonly size1x: "size1x";
@@ -74,4 +75,5 @@ export interface BrandPageContext {
74
75
  isCapturingPreview: boolean;
75
76
  disableLogoRenderOnServerside?: boolean;
76
77
  }
78
+ export declare const getValueType: (key: string, abtestValue?: string) => AbTestResult;
77
79
  export declare const getAbTestResults: (abtestKeyValues: Record<string, string>) => AbTest;
@@ -24,13 +24,14 @@ export const AB_TEST_FLAG = {
24
24
  };
25
25
  const AB_TEST_KEYS = {
26
26
  BP_3926_FREEMIUM_WATERMARK: 'bc-bp-3926-freemium-cta-in-website-editor',
27
+ BP_4092_ROTATING_UPSELLS_AT_PUBLISH: 'bc-bp-4092-rotating-upsells-at-website-publish',
27
28
  };
28
29
  export const MEDIA_SIZES = {
29
30
  size1x: 'size1x',
30
31
  size2x: 'size2x',
31
32
  sizeThumb: 'sizeThumb',
32
33
  };
33
- const getValueType = (key, abtestValue) => {
34
+ export const getValueType = (key, abtestValue) => {
34
35
  return {
35
36
  key: key,
36
37
  value: abtestValue || '',
@@ -1,4 +1,5 @@
1
1
  import type { BrandPageModel, LogoImageModel } 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,7 +18,7 @@ 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
  logoImage?: LogoImageModel;
22
23
  isUserDraft: boolean;
23
- }) => BrandPageModel;
24
+ }) => Promise<MigrationData>;
@@ -857,7 +857,8 @@ export const migrateConvertLineHeightOnFooterStyles = (brandPageModel) => {
857
857
  };
858
858
  }
859
859
  };
860
- export const migration01 = (brandPageModel, options) => {
860
+ export const migration01 = async (migrationResult, options) => {
861
+ const { brandPageModel } = migrationResult;
861
862
  if (!brandPageModel.brandPageType) {
862
863
  brandPageModel.brandPageType = BRAND_PAGE_TYPES.default;
863
864
  }
@@ -890,5 +891,5 @@ export const migration01 = (brandPageModel, options) => {
890
891
  migrateConvertLineHeightOnNavigationStyles(brandPageModel);
891
892
  migrateConvertLineHeightOnFooterStyles(brandPageModel);
892
893
  migrateLogoImage(brandPageModel, options.logoImage);
893
- return brandPageModel;
894
+ return migrationResult;
894
895
  };
@@ -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 migration051: (brandPageModel: BrandPageModel, options: {
1
+ import type { MigrationData } from '../migration.util';
2
+ export declare const migration051: (migrationResult: MigrationData, options: {
3
3
  isUserDraft: boolean;
4
- }) => BrandPageModel;
4
+ }) => MigrationData;
@@ -1,5 +1,6 @@
1
1
  import {} from '../..';
2
- export const migration051 = (brandPageModel, options) => {
2
+ export const migration051 = (migrationResult, options) => {
3
+ const { brandPageModel } = migrationResult;
3
4
  if (!options.isUserDraft) {
4
5
  brandPageModel.pageFooterDesktop?.socialLinks?.forEach((link) => {
5
6
  if (link.imageUrl === 'twitter') {
@@ -14,5 +15,5 @@ export const migration051 = (brandPageModel, options) => {
14
15
  }
15
16
  });
16
17
  }
17
- return brandPageModel;
18
+ return migrationResult;
18
19
  };
@@ -1,4 +1,4 @@
1
- import { type BrandPageModel } from '../..';
2
- export declare const migration052: (brandPageModel: BrandPageModel, options: {
1
+ import type { MigrationData } from '../migration.util';
2
+ export declare const migration052: (migrationResult: MigrationData, options: {
3
3
  isUserDraft: boolean;
4
- }) => BrandPageModel;
4
+ }) => MigrationData;
@@ -1,5 +1,6 @@
1
1
  import {} from '../..';
2
- export const migration052 = (brandPageModel, options) => {
2
+ export const migration052 = (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 migration052 = (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,59 @@
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
+ }
58
+ return migrationResult;
59
+ };
@@ -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 { 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,27 @@ 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 migrationResult = {
49
+ brandPageModel,
50
+ useOldLogoRenderSize: false,
51
+ };
42
52
  if (!modelVersion) {
43
53
  modelVersion = 0;
44
54
  }
45
- MIGRATION_TABLE.forEach((x) => {
55
+ for (const x of MIGRATION_TABLE) {
46
56
  if (modelVersion < x.version) {
47
- brandPageModel = x.migrateFn(brandPageModel, options);
57
+ migrationResult = await x.migrateFn(migrationResult, options);
48
58
  }
49
- });
59
+ }
50
60
  // Set the model to latest version
51
- brandPageModel.v = GetLatestModelVersion();
52
- return brandPageModel;
61
+ migrationResult.brandPageModel.v = GetLatestModelVersion();
62
+ return migrationResult;
53
63
  };
@@ -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;
@@ -246,8 +246,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
246
246
  isPrePurchase: boolean;
247
247
  makerFonts: any[];
248
248
  eventButtonLocation?: string | undefined;
249
+ websiteUpsellModalViewModel?: any;
249
250
  showPublishOptionModal?: boolean | undefined;
250
251
  abTests: Record<string, string>;
252
+ isSubsequentPublish: boolean;
251
253
  } & import("pinia").PiniaCustomStateProperties<import("../../stores").BrandPageContainerState>) => boolean;
252
254
  isUserDraft: (state: {
253
255
  availableTaxes: any[];
@@ -305,8 +307,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
305
307
  isPrePurchase: boolean;
306
308
  makerFonts: any[];
307
309
  eventButtonLocation?: string | undefined;
310
+ websiteUpsellModalViewModel?: any;
308
311
  showPublishOptionModal?: boolean | undefined;
309
312
  abTests: Record<string, string>;
313
+ isSubsequentPublish: boolean;
310
314
  } & import("pinia").PiniaCustomStateProperties<import("../../stores").BrandPageContainerState>) => boolean;
311
315
  }, {
312
316
  clearTriggerSaveEventApiOnPublishModalClose(): void;
@@ -339,6 +343,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
339
343
  }): void;
340
344
  setCreateCustomDomainErrorMessage(payload: any): void;
341
345
  setBrandPageIsCustomDomainEnabled(payload: any): void;
346
+ setIsSubsequentPublish(payload: any): void;
342
347
  clearPublishErrorMessage(): void;
343
348
  closePublishModal(payload?: {
344
349
  skipShowNextNotificationMessage?: boolean | undefined;
@@ -348,7 +353,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
348
353
  publishBrandPage({ shouldPublish, slug }: {
349
354
  shouldPublish: any;
350
355
  slug: any;
351
- }): Promise<boolean>;
356
+ }): Promise<false | {
357
+ success: boolean;
358
+ websiteUpsellModalViewModel: any;
359
+ }>;
352
360
  publishBrandPageWithCustomDomainAsync({ shouldPublish, slug, domain, isPurchasedDomain, }: {
353
361
  shouldPublish: any;
354
362
  slug: any;
@@ -365,12 +373,13 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
365
373
  eventButtonLocation?: string | undefined;
366
374
  }): Promise<false | {
367
375
  saved: boolean;
368
- canPublish: any;
376
+ canPublish: boolean;
377
+ websiteUpsellModalViewModel: any;
369
378
  }>;
370
379
  saveAndPublishBrandPage(eventButtonLocation: string): Promise<void>;
371
380
  saveTemplate(): Promise<void>;
372
381
  setBrandPageStatus(status: any): Promise<void>;
373
- showPublishModal(eventButtonLocation?: string | undefined): void;
382
+ showPublishModal(eventButtonLocation?: string | undefined, websiteUpsellModalViewModel?: any, isSubsequentPublish?: boolean | undefined): void;
374
383
  showBrandPageSlugEditModal(): Promise<void>;
375
384
  showUpgradeModalAndSaveAsync(): Promise<void>;
376
385
  showStripeOnboardingModal(): void;
@@ -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;