@designcrowd/library.brand-page 5.16.24-pre-temp-7 → 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-CKSMoYph.js → CreatedOnBrandCrowd-de-de-Ch0n753P.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-en-us-BE826zG3.js → CreatedOnBrandCrowd-en-us-B48UACQl.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-es-es-BT1_CiIR.js → CreatedOnBrandCrowd-es-es-BUFUO_0v.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-fr-Dd7QbEx8.js → CreatedOnBrandCrowd-fr-ca-DkM45w95.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-ca-Dd7QbEx8.js → CreatedOnBrandCrowd-fr-fr-DkM45w95.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-pt-Cj3w8Tzr.js → CreatedOnBrandCrowd-pt-br-BrfXhDcV.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-br-Cj3w8Tzr.js → CreatedOnBrandCrowd-pt-pt-BrfXhDcV.js} +1 -1
- package/lib/src/{CreatedOnDcom-de-de-DgG4EwAb.js → CreatedOnDcom-de-de-BXtSjuuW.js} +1 -1
- package/lib/src/{CreatedOnDcom-en-us-Zf_zsQD-.js → CreatedOnDcom-en-us-0YJL5DzN.js} +1 -1
- package/lib/src/{CreatedOnDcom-es-es-BI5_Uta1.js → CreatedOnDcom-es-es-DL_QwZzN.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-ca-Bwc9B1Ma.js → CreatedOnDcom-fr-ca-Bv3VkWWL.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-fr-CdUHAhrh.js → CreatedOnDcom-fr-fr-BT5nAd3W.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-br-CnqCmpYk.js → CreatedOnDcom-pt-br-O4Y_UNoK.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-pt-B20uZkxO.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/components/template-preview/TemplatePreview.mixin.js +4 -4
- 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 -7
- package/lib/src/clients/design-template-client.d.ts +0 -2
- package/lib/src/clients/fabric-render-client.d.ts +0 -3
- 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.d.ts +1 -1
- package/lib/src/index.mjs +97 -97
- package/lib/src/{lib-CUR1pqIf.js → lib-CtPHohpu.js} +8791 -8820
- package/lib/src/lib.js +1 -1
- package/lib/src/shared/logo-settings/components/EditLogoSettings.mixin.d.ts +0 -2
- package/lib/src/shared/logo-settings/components/LogoSettings.mixin.d.ts +0 -2
- package/lib/src/shared/logo-settings/store/editable-logo-store.d.ts +0 -4
- package/lib/src/shared/logo-settings/store/editable-logo-store.js +0 -11
- package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.d.ts +0 -2
- package/lib/src/shared/template-settings/store/template-settings-store.js +8 -39
- 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/components/template-preview/TemplatePreview.mixin.ts +4 -4
- package/src/brand-page-maker/constants/template-constants.ts +1 -0
- package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.ts +7 -9
- package/src/clients/design-template-client.ts +0 -2
- package/src/clients/fabric-render-client.ts +0 -3
- package/src/lib.ts +0 -1
- package/src/shared/logo-settings/store/editable-logo-store.ts +0 -13
- package/src/shared/template-settings/store/template-settings-store.ts +9 -52
|
@@ -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
|
});
|
|
@@ -189,7 +189,7 @@ export default defineComponent({
|
|
|
189
189
|
},
|
|
190
190
|
watch: {
|
|
191
191
|
template() {
|
|
192
|
-
if (this.isAdmin) {
|
|
192
|
+
if (this.isAdmin || this.isPrePurchase) {
|
|
193
193
|
this.updateViewModel();
|
|
194
194
|
}
|
|
195
195
|
else {
|
|
@@ -200,7 +200,7 @@ export default defineComponent({
|
|
|
200
200
|
},
|
|
201
201
|
logoTheme: {
|
|
202
202
|
handler() {
|
|
203
|
-
if (this.isAdmin) {
|
|
203
|
+
if (this.isAdmin || this.isPrePurchase) {
|
|
204
204
|
this.updateViewModel();
|
|
205
205
|
}
|
|
206
206
|
},
|
|
@@ -208,7 +208,7 @@ export default defineComponent({
|
|
|
208
208
|
},
|
|
209
209
|
previewImageUrl() {
|
|
210
210
|
// Reset loading state whenever the preview URL changes
|
|
211
|
-
if (!this.isAdmin) {
|
|
211
|
+
if (!this.isAdmin && !this.isPrePurchase) {
|
|
212
212
|
this.imageLoading = true;
|
|
213
213
|
this.imageLoadError = false;
|
|
214
214
|
}
|
|
@@ -267,7 +267,7 @@ export default defineComponent({
|
|
|
267
267
|
},
|
|
268
268
|
async updateViewModel(forceUpdate = true) {
|
|
269
269
|
// Only update view model for admin or pre-purchase mode
|
|
270
|
-
if (!this.isAdmin) {
|
|
270
|
+
if (!this.isAdmin && !this.isPrePurchase) {
|
|
271
271
|
return;
|
|
272
272
|
}
|
|
273
273
|
const videoStore = useVideoStore();
|
|
@@ -176,7 +176,6 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
|
|
|
176
176
|
const userStore = useBrandPageMakerUserStore();
|
|
177
177
|
const containerStore = useBrandPageContainerStore();
|
|
178
178
|
const uiContentSettings = useUiContentSettingsStore();
|
|
179
|
-
// look into this
|
|
180
179
|
if (!this.selectedTemplateId) {
|
|
181
180
|
return;
|
|
182
181
|
}
|
|
@@ -553,13 +552,14 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
|
|
|
553
552
|
? logoPrePurchase
|
|
554
553
|
: logoPostPurchase;
|
|
555
554
|
if (logo && logoImageHeight) {
|
|
556
|
-
const
|
|
557
|
-
pageSettingsStore.sections[PAGE_SECTIONS.header][VIEWPORTS.desktop].logoImageWidth = newLogoSize;
|
|
558
|
-
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;
|
|
559
558
|
}
|
|
560
559
|
}
|
|
561
|
-
else if (
|
|
562
|
-
|
|
560
|
+
else if (!brandPageContainerStore.designDraftToken &&
|
|
561
|
+
!userStore.isAdmin &&
|
|
562
|
+
this.isBrandPageOrIsBrandContact) {
|
|
563
563
|
recalculateLogoContentDimensions(pageSettingsStore, editableLogoStore.editableLogoVariations);
|
|
564
564
|
}
|
|
565
565
|
const backgroundStyles = new BackgroundStyles(brandPageModel.styles.backgroundStyles);
|
|
@@ -898,7 +898,6 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
|
|
|
898
898
|
const uiStore = useUiStore();
|
|
899
899
|
const videoStore = useVideoStore();
|
|
900
900
|
if (userStore.isAdmin && uiStore.logoTheme) {
|
|
901
|
-
// need something like this on template selection too
|
|
902
901
|
const themedBrandPage = applyLogoThemeToBrandPageModel(uiStore.logoTheme, this.brandPageData).model;
|
|
903
902
|
return getBrandPageViewModelFromBrandPageModel(themedBrandPage, this.brandPageToken, undefined, {
|
|
904
903
|
useOldLogoRenderSize: false,
|
|
@@ -18,8 +18,6 @@ interface GetTemplatesAsyncOptions {
|
|
|
18
18
|
personalisable?: boolean;
|
|
19
19
|
selectedTemplateToken?: string | false;
|
|
20
20
|
locale?: string;
|
|
21
|
-
logoS3Token?: string;
|
|
22
|
-
logoTemplateToken?: string;
|
|
23
21
|
}
|
|
24
22
|
export declare const getTemplatesEndpoint: (templateTypeName: string) => string;
|
|
25
23
|
export declare const getTemplateEndpoint: (templateToken: any) => string;
|
|
@@ -26,7 +26,6 @@ export interface ModifyLogoDataRequest {
|
|
|
26
26
|
dimensionsType: string;
|
|
27
27
|
variation: string;
|
|
28
28
|
primaryText?: string;
|
|
29
|
-
generateS3Url?: boolean;
|
|
30
29
|
logo: {
|
|
31
30
|
template: {
|
|
32
31
|
token: string;
|
|
@@ -50,8 +49,6 @@ export interface ModifyLogoDataResponse {
|
|
|
50
49
|
metadata: string | null;
|
|
51
50
|
width: number;
|
|
52
51
|
height: number;
|
|
53
|
-
expiryDate?: string;
|
|
54
|
-
s3Token?: string;
|
|
55
52
|
}
|
|
56
53
|
export declare const LOGO_DIMENSION_TYPES: {
|
|
57
54
|
PREVIEW_IMAGE_TRANSPARENT_NO_BUFFER: string;
|