@designcrowd/library.brand-page 5.16.24 → 5.16.25-2

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 (48) hide show
  1. package/lib/src/{CreatedOnBrandCrowd-de-de-BXPCJxUB.js → CreatedOnBrandCrowd-de-de-Ch0n753P.js} +1 -1
  2. package/lib/src/{CreatedOnBrandCrowd-en-us-CvZgqD0_.js → CreatedOnBrandCrowd-en-us-B48UACQl.js} +1 -1
  3. package/lib/src/{CreatedOnBrandCrowd-es-es-CH1AwQm4.js → CreatedOnBrandCrowd-es-es-BUFUO_0v.js} +1 -1
  4. package/lib/src/{CreatedOnBrandCrowd-fr-fr-kMRKllNk.js → CreatedOnBrandCrowd-fr-ca-DkM45w95.js} +1 -1
  5. package/lib/src/{CreatedOnBrandCrowd-fr-ca-kMRKllNk.js → CreatedOnBrandCrowd-fr-fr-DkM45w95.js} +1 -1
  6. package/lib/src/{CreatedOnBrandCrowd-pt-pt-DhzhLbLV.js → CreatedOnBrandCrowd-pt-br-BrfXhDcV.js} +1 -1
  7. package/lib/src/{CreatedOnBrandCrowd-pt-br-DhzhLbLV.js → CreatedOnBrandCrowd-pt-pt-BrfXhDcV.js} +1 -1
  8. package/lib/src/{CreatedOnDcom-de-de-CTWeVBI1.js → CreatedOnDcom-de-de-BXtSjuuW.js} +1 -1
  9. package/lib/src/{CreatedOnDcom-en-us-DNJO48Gt.js → CreatedOnDcom-en-us-0YJL5DzN.js} +1 -1
  10. package/lib/src/{CreatedOnDcom-es-es-BhxPOXSv.js → CreatedOnDcom-es-es-DL_QwZzN.js} +1 -1
  11. package/lib/src/{CreatedOnDcom-fr-ca-D5tOLgVL.js → CreatedOnDcom-fr-ca-Bv3VkWWL.js} +1 -1
  12. package/lib/src/{CreatedOnDcom-fr-fr-DwUUlEvf.js → CreatedOnDcom-fr-fr-BT5nAd3W.js} +1 -1
  13. package/lib/src/{CreatedOnDcom-pt-br-DTxNAcvO.js → CreatedOnDcom-pt-br-O4Y_UNoK.js} +1 -1
  14. package/lib/src/{CreatedOnDcom-pt-pt-Lj4Dmg1_.js → CreatedOnDcom-pt-pt-D06bNEGa.js} +1 -1
  15. package/lib/src/brand-page/constants/logo.constants.d.ts +0 -1
  16. package/lib/src/brand-page/constants/logo.constants.js +0 -2
  17. package/lib/src/brand-page/utils/logo.util.d.ts +4 -1
  18. package/lib/src/brand-page/utils/logo.util.js +21 -18
  19. package/lib/src/brand-page/utils/migration/migration-07.d.ts +2 -4
  20. package/lib/src/brand-page/utils/migration/migration-07.js +1 -1
  21. package/lib/src/brand-page/utils/migration/migration-08.d.ts +2 -5
  22. package/lib/src/brand-page/utils/migration/migration-08.js +2 -5
  23. package/lib/src/brand-page/utils/migration.util.d.ts +5 -3
  24. package/lib/src/brand-page/utils/migration.util.js +0 -1
  25. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMakerTemplateSettings.mixin.d.ts +1 -0
  26. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMakerTemplateSettings.mixin.js +8 -3
  27. package/lib/src/brand-page-maker/constants/template-constants.d.ts +1 -0
  28. package/lib/src/brand-page-maker/constants/template-constants.js +1 -0
  29. package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.js +6 -5
  30. package/lib/src/css/library.brand-page-brandCrowd.min.css +84 -82
  31. package/lib/src/css/library.brand-page-brandPage.min.css +84 -82
  32. package/lib/src/css/library.brand-page-designCom.min.css +84 -82
  33. package/lib/src/css/library.brand-page-preview.min.css +84 -82
  34. package/lib/src/index.mjs +106 -105
  35. package/lib/src/{lib-CrdwMib8.js → lib-CtPHohpu.js} +8776 -8776
  36. package/package.json +1 -1
  37. package/src/brand-page/components/page-header/HeaderLayout.vue +5 -3
  38. package/src/brand-page/constants/logo.constants.ts +0 -3
  39. package/src/brand-page/utils/logo.util.test.ts +0 -37
  40. package/src/brand-page/utils/logo.util.ts +28 -31
  41. package/src/brand-page/utils/migration/migration-07.test.ts +32 -8
  42. package/src/brand-page/utils/migration/migration-07.ts +3 -3
  43. package/src/brand-page/utils/migration/migration-08.test.ts +38 -10
  44. package/src/brand-page/utils/migration/migration-08.ts +4 -14
  45. package/src/brand-page/utils/migration.util.ts +10 -11
  46. package/src/brand-page-maker/components/brand-page-maker/BrandPageMakerTemplateSettings.mixin.ts +12 -2
  47. package/src/brand-page-maker/constants/template-constants.ts +1 -0
  48. package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.ts +7 -6
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as e, openBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-CrdwMib8.js";
2
+ import { _ as t } from "./lib-CtPHohpu.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-CrdwMib8.js";
2
+ import { _ as t } from "./lib-CtPHohpu.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-CrdwMib8.js";
2
+ import { _ as t } from "./lib-CtPHohpu.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-CrdwMib8.js";
2
+ import { _ as t } from "./lib-CtPHohpu.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-CrdwMib8.js";
2
+ import { _ as t } from "./lib-CtPHohpu.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-CrdwMib8.js";
2
+ import { _ as t } from "./lib-CtPHohpu.js";
3
3
  const i = {}, h = {
4
4
  width: "263",
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-CrdwMib8.js";
2
+ import { _ as t } from "./lib-CtPHohpu.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-CrdwMib8.js";
2
+ import { _ as e } from "./lib-CtPHohpu.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-CrdwMib8.js";
2
+ import { _ as e } from "./lib-CtPHohpu.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-CrdwMib8.js";
2
+ import { _ as e } from "./lib-CtPHohpu.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-CrdwMib8.js";
2
+ import { _ as e } from "./lib-CtPHohpu.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 e } from "./lib-CrdwMib8.js";
2
+ import { _ as e } from "./lib-CtPHohpu.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-CrdwMib8.js";
2
+ import { _ as M } from "./lib-CtPHohpu.js";
3
3
  const Z = {}, e = {
4
4
  width: "232",
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-CrdwMib8.js";
2
+ import { _ as M } from "./lib-CtPHohpu.js";
3
3
  const Z = {}, e = {
4
4
  width: "232",
5
5
  height: "36",
@@ -5,4 +5,3 @@ 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,5 +5,3 @@ 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;
@@ -1,3 +1,4 @@
1
+ import type { BrandPageType } from '../models';
1
2
  import { type BrandPageModel, type LogoImageModel, type LogoTemplateImageModel, type LogoVariation } from '../models';
2
3
  import { type LogoOutputFormat } from '../../clients/fabric-render-client';
3
4
  export declare const getLogoDraftTokenFromLogoImageUrl: (variationUrl?: string) => string;
@@ -12,7 +13,9 @@ export declare const applyLogoImageBase64UrlToBrandPageTemplateModel: (model: Br
12
13
  export declare const applyLogoTemplateImageToBrandPageTemplateModel: (model: BrandPageModel, logoTemplateImage: LogoTemplateImageModel) => BrandPageModel;
13
14
  export declare const getLogoVariationUrlByLogoImage: (logoImage: LogoImageModel) => string | undefined;
14
15
  export declare const getLogoTemplateUrlByLogoTemplateImage: (logoTemplateImage: LogoTemplateImageModel) => string;
15
- export declare const getOptimalLogoSize: (width: number, height: number, currentSize: string) => string;
16
+ export declare const getOptimalLogoSize: (brandPageType: BrandPageType, width: number, height: number) => {
17
+ newLogoSize: string;
18
+ };
16
19
  export declare const calculateLogoDimensions: (logoData: {
17
20
  width: number;
18
21
  height: number;
@@ -1,4 +1,4 @@
1
- import { DEFAULT_LOGO_VARIATION, LOGO_VARIATION, DEFAULT_LOGO_WIDTH, DEFAULT_LOGO_HEIGHT, } from '../constants';
1
+ import { DEFAULT_LOGO_VARIATION, LOGO_VARIATION } from '../constants';
2
2
  import { BRAND_PAGE_TYPES, } from '../models';
3
3
  import { FabricRenderClient, LogoVariationDefinitions, } from '../../clients/fabric-render-client';
4
4
  import { isLogoContent } from './model.util';
@@ -167,21 +167,26 @@ export const getLogoVariationUrlByLogoImage = (logoImage) => {
167
167
  export const getLogoTemplateUrlByLogoTemplateImage = (logoTemplateImage) => {
168
168
  return FabricRenderClient.getInstance().getLogoTemplateUrlByLogoTemplateImage(logoTemplateImage);
169
169
  };
170
- export const getOptimalLogoSize = (width, height, currentSize) => {
171
- if (parseFloat(currentSize) >= 16) {
172
- return currentSize;
173
- }
174
- const aspectRatio = width / height;
175
- if (!parseFloat(`${aspectRatio}`) || aspectRatio <= 1) {
176
- return currentSize;
177
- }
178
- const newSize = parseFloat(currentSize) + (aspectRatio - 1) * 4.5;
179
- if (newSize > 11) {
180
- return '11rem';
170
+ export const getOptimalLogoSize = (brandPageType, width, height) => {
171
+ const ratio = width / height;
172
+ let newLogoSize = '11rem'; // default size
173
+ if (brandPageType === BRAND_PAGE_TYPES.brandSite) {
174
+ if (ratio < 0.95) {
175
+ // tall logos
176
+ newLogoSize = '10rem';
177
+ }
178
+ else if (ratio >= 1.65) {
179
+ // wide logos
180
+ newLogoSize = '10rem';
181
+ }
181
182
  }
182
183
  else {
183
- return `${Math.round(newSize)}rem`;
184
+ // BP and BC default
185
+ newLogoSize = '8rem';
184
186
  }
187
+ return {
188
+ newLogoSize,
189
+ };
185
190
  };
186
191
  export const calculateLogoDimensions = (logoData, maxWidth, maxHeight) => {
187
192
  const maxWidthRem = parseFloat(maxWidth);
@@ -249,11 +254,9 @@ export const recalculateLogoContentDimensions = async (pageData, editableLogoVar
249
254
  }
250
255
  // Apply dimensions or fallback logic
251
256
  if (logoData && logoData.width && logoData.height) {
252
- const currentMaxWidth = content.logoImageWidth || DEFAULT_LOGO_WIDTH;
253
- const currentMaxHeight = content.logoImageHeight || DEFAULT_LOGO_HEIGHT;
254
- const dimensions = calculateOptimizedLogoDimensions(logoData, currentMaxWidth, currentMaxHeight);
255
- content.logoImageHeight = dimensions.height;
256
- content.logoImageWidth = dimensions.width;
257
+ const dimensions = getOptimalLogoSize(BRAND_PAGE_TYPES.default, logoData.width, logoData.height);
258
+ content.logoImageHeight = dimensions.newLogoSize;
259
+ content.logoImageWidth = dimensions.newLogoSize;
257
260
  }
258
261
  });
259
262
  }
@@ -1,4 +1,2 @@
1
- import type { MigrationData } from '../migration.util';
2
- export declare const migration07: (migrationResult: MigrationData, options: {
3
- isServerRender: boolean;
4
- }) => Promise<MigrationData>;
1
+ import type { MigrationData, MigrationOptions } from '../migration.util';
2
+ export declare const migration07: (migrationResult: MigrationData, options: MigrationOptions) => Promise<MigrationData>;
@@ -6,7 +6,7 @@ export const migration07 = async (migrationResult, options) => {
6
6
  if (brandPageModel.brandPageType !== BRAND_PAGE_TYPES.brandSite) {
7
7
  return migrationResult;
8
8
  }
9
- if (options.isServerRender !== undefined && options.isServerRender) {
9
+ if (options.disableLogoSizeMigration) {
10
10
  migrationResult.useOldLogoRenderSize = true;
11
11
  return migrationResult;
12
12
  }
@@ -1,5 +1,2 @@
1
- import type { MigrationData } from '../migration.util';
2
- export declare const migration08: (migrationResult: MigrationData, options: {
3
- isServerRender: boolean;
4
- isUserDraft?: boolean;
5
- }) => Promise<MigrationData>;
1
+ import type { MigrationData, MigrationOptions } from '../migration.util';
2
+ export declare const migration08: (migrationResult: MigrationData, options: MigrationOptions) => Promise<MigrationData>;
@@ -1,17 +1,14 @@
1
1
  import { DEFAULT_LOGO_HEIGHT, DEFAULT_LOGO_WIDTH, BRAND_PAGE_TYPES, } from '../..';
2
2
  import { FabricRenderClient } from '../../../clients/fabric-render-client';
3
3
  import { isLogoContent } from '../model.util';
4
- import { calculateLogoDimensions, safeGetLogoImageFromLogoImageUrl, } from '../logo.util';
4
+ import { calculateLogoDimensions } from '../logo.util';
5
5
  export const migration08 = async (migrationResult, options) => {
6
6
  const { brandPageModel } = migrationResult;
7
7
  if (brandPageModel.brandPageType !== BRAND_PAGE_TYPES.default &&
8
8
  brandPageModel.brandPageType !== BRAND_PAGE_TYPES.brandContact) {
9
9
  return migrationResult;
10
10
  }
11
- if (options.isUserDraft !== undefined && !options.isUserDraft) {
12
- return migrationResult;
13
- }
14
- if (options.isServerRender !== undefined && options.isServerRender) {
11
+ if (options.disableLogoSizeMigration) {
15
12
  migrationResult.useOldLogoRenderSize = true;
16
13
  return migrationResult;
17
14
  }
@@ -3,9 +3,11 @@ export interface MigrationData {
3
3
  brandPageModel: BrandPageModel;
4
4
  useOldLogoRenderSize: boolean;
5
5
  }
6
- export declare const GetLatestModelVersion: () => number;
7
- export declare const migrateBrandPageModel: (brandPageModel: BrandPageModel, options: {
6
+ export interface MigrationOptions {
8
7
  logoImage?: LogoImageModel;
9
8
  isUserDraft: boolean;
10
9
  isServerRender: boolean;
11
- }) => Promise<MigrationData>;
10
+ disableLogoSizeMigration?: boolean;
11
+ }
12
+ export declare const GetLatestModelVersion: () => number;
13
+ export declare const migrateBrandPageModel: (brandPageModel: BrandPageModel, options: MigrationOptions) => Promise<MigrationData>;
@@ -1,4 +1,3 @@
1
- import { LOGO_MIGRATION_VERSION } from '../constants';
2
1
  import {} from '../models';
3
2
  import { migration01 } from './migration/migration-01';
4
3
  import { migration01_1 } from './migration/migration-01_1';
@@ -1,6 +1,7 @@
1
1
  declare const _default: import("vue").DefineComponent<{}, {
2
2
  brandPageType: import("vue").ComputedRef<"default" | "brandSite" | "brandContact">;
3
3
  isBrandSite: import("vue").ComputedRef<boolean>;
4
+ isPrePurchase: import("vue").ComputedRef<boolean>;
4
5
  isBrandPageOrIsBrandContact: import("vue").ComputedRef<boolean>;
5
6
  brandPageMakerStore: import("pinia").Store<"brandPageMaker", import("../../stores").BrandPageMakerState, {
6
7
  contentErrorCount(): number;
@@ -1,12 +1,14 @@
1
1
  import { computed, defineComponent } from 'vue';
2
- import { DESKTOP_HEIGHT, DESKTOP_WIDTH, MOBILE_HEIGHT, MOBILE_WIDTH, } from '../../constants';
3
- import { useBrandPageMakerStore } from '../../../lib';
2
+ import { DESKTOP_HEIGHT, DESKTOP_WIDTH, MOBILE_HEIGHT, MOBILE_WIDTH, MOBILE_HEIGHT_POST_PURCHASE, } from '../../constants';
3
+ import { useBrandPageMakerStore, useBrandPageContainerStore, } from '../../../lib';
4
4
  export default defineComponent({
5
5
  setup() {
6
6
  const brandPageMakerStore = useBrandPageMakerStore();
7
+ const brandPageContainerStore = useBrandPageContainerStore();
7
8
  return {
8
9
  brandPageType: computed(() => brandPageMakerStore.brandPageType),
9
10
  isBrandSite: computed(() => brandPageMakerStore.isBrandSite),
11
+ isPrePurchase: computed(() => brandPageContainerStore.isPrePurchase),
10
12
  isBrandPageOrIsBrandContact: computed(() => brandPageMakerStore.isBrandPageOrIsBrandContact),
11
13
  brandPageMakerStore,
12
14
  };
@@ -19,7 +21,10 @@ export default defineComponent({
19
21
  return this.isBrandSite ? DESKTOP_WIDTH : MOBILE_WIDTH;
20
22
  },
21
23
  height() {
22
- return this.isBrandSite ? DESKTOP_HEIGHT : MOBILE_HEIGHT;
24
+ if (this.isBrandSite) {
25
+ return DESKTOP_HEIGHT;
26
+ }
27
+ return this.isPrePurchase ? MOBILE_HEIGHT : MOBILE_HEIGHT_POST_PURCHASE;
23
28
  },
24
29
  },
25
30
  });
@@ -1,4 +1,5 @@
1
1
  export declare const MOBILE_HEIGHT = 734;
2
+ export declare const MOBILE_HEIGHT_POST_PURCHASE = 636;
2
3
  export declare const MOBILE_WIDTH = 358;
3
4
  export declare const DESKTOP_HEIGHT = 600;
4
5
  export declare const DESKTOP_WIDTH = 1000;
@@ -1,4 +1,5 @@
1
1
  export const MOBILE_HEIGHT = 734;
2
+ export const MOBILE_HEIGHT_POST_PURCHASE = 636;
2
3
  export const MOBILE_WIDTH = 358;
3
4
  export const DESKTOP_HEIGHT = 600;
4
5
  export const DESKTOP_WIDTH = 1000;
@@ -552,13 +552,14 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
552
552
  ? logoPrePurchase
553
553
  : logoPostPurchase;
554
554
  if (logo && logoImageHeight) {
555
- const newLogoSize = getOptimalLogoSize(logo.width, logo.height, logoImageHeight);
556
- pageSettingsStore.sections[PAGE_SECTIONS.header][VIEWPORTS.desktop].logoImageWidth = newLogoSize;
557
- pageSettingsStore.sections[PAGE_SECTIONS.header][VIEWPORTS.desktop].logoImageHeight = newLogoSize;
555
+ const optimalSize = getOptimalLogoSize(this.brandPageType, logo.width, logo.height);
556
+ pageSettingsStore.sections[PAGE_SECTIONS.header][VIEWPORTS.desktop].logoImageWidth = optimalSize.newLogoSize;
557
+ pageSettingsStore.sections[PAGE_SECTIONS.header][VIEWPORTS.desktop].logoImageHeight = optimalSize.newLogoSize;
558
558
  }
559
559
  }
560
- else if (this.isBrandPageOrIsBrandContact &&
561
- brandPageContainerStore.isPrePurchase) {
560
+ else if (!brandPageContainerStore.designDraftToken &&
561
+ !userStore.isAdmin &&
562
+ this.isBrandPageOrIsBrandContact) {
562
563
  recalculateLogoContentDimensions(pageSettingsStore, editableLogoStore.editableLogoVariations);
563
564
  }
564
565
  const backgroundStyles = new BackgroundStyles(brandPageModel.styles.backgroundStyles);