@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.
- package/lib/src/{CreatedOnBrandCrowd-de-de-BXPCJxUB.js → CreatedOnBrandCrowd-de-de-Ch0n753P.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-en-us-CvZgqD0_.js → CreatedOnBrandCrowd-en-us-B48UACQl.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-es-es-CH1AwQm4.js → CreatedOnBrandCrowd-es-es-BUFUO_0v.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-fr-kMRKllNk.js → CreatedOnBrandCrowd-fr-ca-DkM45w95.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-ca-kMRKllNk.js → CreatedOnBrandCrowd-fr-fr-DkM45w95.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-pt-DhzhLbLV.js → CreatedOnBrandCrowd-pt-br-BrfXhDcV.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-br-DhzhLbLV.js → CreatedOnBrandCrowd-pt-pt-BrfXhDcV.js} +1 -1
- package/lib/src/{CreatedOnDcom-de-de-CTWeVBI1.js → CreatedOnDcom-de-de-BXtSjuuW.js} +1 -1
- package/lib/src/{CreatedOnDcom-en-us-DNJO48Gt.js → CreatedOnDcom-en-us-0YJL5DzN.js} +1 -1
- package/lib/src/{CreatedOnDcom-es-es-BhxPOXSv.js → CreatedOnDcom-es-es-DL_QwZzN.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-ca-D5tOLgVL.js → CreatedOnDcom-fr-ca-Bv3VkWWL.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-fr-DwUUlEvf.js → CreatedOnDcom-fr-fr-BT5nAd3W.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-br-DTxNAcvO.js → CreatedOnDcom-pt-br-O4Y_UNoK.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-pt-Lj4Dmg1_.js → CreatedOnDcom-pt-pt-D06bNEGa.js} +1 -1
- package/lib/src/brand-page/constants/logo.constants.d.ts +0 -1
- package/lib/src/brand-page/constants/logo.constants.js +0 -2
- package/lib/src/brand-page/utils/logo.util.d.ts +4 -1
- package/lib/src/brand-page/utils/logo.util.js +21 -18
- package/lib/src/brand-page/utils/migration/migration-07.d.ts +2 -4
- package/lib/src/brand-page/utils/migration/migration-07.js +1 -1
- package/lib/src/brand-page/utils/migration/migration-08.d.ts +2 -5
- package/lib/src/brand-page/utils/migration/migration-08.js +2 -5
- package/lib/src/brand-page/utils/migration.util.d.ts +5 -3
- package/lib/src/brand-page/utils/migration.util.js +0 -1
- package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMakerTemplateSettings.mixin.d.ts +1 -0
- package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMakerTemplateSettings.mixin.js +8 -3
- package/lib/src/brand-page-maker/constants/template-constants.d.ts +1 -0
- package/lib/src/brand-page-maker/constants/template-constants.js +1 -0
- package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.js +6 -5
- package/lib/src/css/library.brand-page-brandCrowd.min.css +84 -82
- package/lib/src/css/library.brand-page-brandPage.min.css +84 -82
- package/lib/src/css/library.brand-page-designCom.min.css +84 -82
- package/lib/src/css/library.brand-page-preview.min.css +84 -82
- package/lib/src/index.mjs +106 -105
- package/lib/src/{lib-CrdwMib8.js → lib-CtPHohpu.js} +8776 -8776
- package/package.json +1 -1
- package/src/brand-page/components/page-header/HeaderLayout.vue +5 -3
- package/src/brand-page/constants/logo.constants.ts +0 -3
- package/src/brand-page/utils/logo.util.test.ts +0 -37
- package/src/brand-page/utils/logo.util.ts +28 -31
- package/src/brand-page/utils/migration/migration-07.test.ts +32 -8
- package/src/brand-page/utils/migration/migration-07.ts +3 -3
- package/src/brand-page/utils/migration/migration-08.test.ts +38 -10
- package/src/brand-page/utils/migration/migration-08.ts +4 -14
- package/src/brand-page/utils/migration.util.ts +10 -11
- package/src/brand-page-maker/components/brand-page-maker/BrandPageMakerTemplateSettings.mixin.ts +12 -2
- package/src/brand-page-maker/constants/template-constants.ts +1 -0
- package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.ts +7 -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: (
|
|
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
|
|
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
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
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
|
-
|
|
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
|
|
253
|
-
|
|
254
|
-
|
|
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.
|
|
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
|
|
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.
|
|
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
|
|
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
|
-
|
|
10
|
+
disableLogoSizeMigration?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare const GetLatestModelVersion: () => number;
|
|
13
|
+
export declare const migrateBrandPageModel: (brandPageModel: BrandPageModel, options: MigrationOptions) => Promise<MigrationData>;
|
|
@@ -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;
|
package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMakerTemplateSettings.mixin.js
CHANGED
|
@@ -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
|
-
|
|
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
|
});
|
|
@@ -552,13 +552,14 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
|
|
|
552
552
|
? logoPrePurchase
|
|
553
553
|
: logoPostPurchase;
|
|
554
554
|
if (logo && logoImageHeight) {
|
|
555
|
-
const
|
|
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 (
|
|
561
|
-
|
|
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);
|