@designcrowd/library.brand-page 5.15.24 → 5.15.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-D7rRFKgr.js → CreatedOnBrandCrowd-de-de-DvyH2DZQ.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-en-us-CaTNBPEK.js → CreatedOnBrandCrowd-en-us-BkhFX5IH.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-es-es-zdp6A-zF.js → CreatedOnBrandCrowd-es-es-BXVsJsEz.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-fr-TS3XLzo6.js → CreatedOnBrandCrowd-fr-ca-xVXVxfTs.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-ca-TS3XLzo6.js → CreatedOnBrandCrowd-fr-fr-xVXVxfTs.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-pt-DkyF49-j.js → CreatedOnBrandCrowd-pt-br-BClAECgN.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-br-DkyF49-j.js → CreatedOnBrandCrowd-pt-pt-BClAECgN.js} +1 -1
- package/lib/src/{CreatedOnDcom-de-de-BckUcm9C.js → CreatedOnDcom-de-de-DlzLknwo.js} +1 -1
- package/lib/src/{CreatedOnDcom-en-us-CqgIo3AG.js → CreatedOnDcom-en-us-NjczWDeO.js} +1 -1
- package/lib/src/{CreatedOnDcom-es-es-DOEOu0Gx.js → CreatedOnDcom-es-es-Dazo-CXa.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-ca-DjbwfTN3.js → CreatedOnDcom-fr-ca-DXzP_BfL.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-fr-By17z-yX.js → CreatedOnDcom-fr-fr-DSBumzDY.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-br-D9AAR_em.js → CreatedOnDcom-pt-br-DrQC5tTd.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-pt-Bz8SLuU2.js → CreatedOnDcom-pt-pt-CJubdGWs.js} +1 -1
- package/lib/src/brand-page/utils/migration/migration-07.js +1 -1
- package/lib/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.d.ts +287 -1
- package/lib/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.js +60 -5
- package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.js +11 -1
- package/lib/src/css/library.brand-page-brandCrowd.min.css +43 -19
- package/lib/src/css/library.brand-page-brandPage.min.css +43 -19
- package/lib/src/css/library.brand-page-designCom.min.css +43 -19
- package/lib/src/css/library.brand-page-preview.min.css +43 -19
- package/lib/src/index.mjs +1 -1
- package/lib/src/{lib-CgMLUv91.js → lib-BGjUW0Xe.js} +5839 -5764
- package/lib/src/shared/template-settings/store/template-settings-store.js +22 -5
- package/package.json +1 -1
- package/src/brand-page/components/page/Page.vue +2 -2
- package/src/brand-page/utils/migration/migration-07.ts +6 -4
- package/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.ts +87 -6
- package/src/brand-page-maker/components/template-preview/TemplatePreview.vue +42 -4
- package/src/brand-page-maker/components/template-preview-with-state/TemplatePreviewWithState.vue +4 -6
- package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.ts +16 -1
- package/src/shared/template-settings/store/template-settings-store.ts +29 -8
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BRAND_PAGE_TYPES, DEFAULT_LOGO_HEIGHT, DEFAULT_LOGO_WIDTH,
|
|
1
|
+
import { BRAND_PAGE_TYPES, DEFAULT_LOGO_HEIGHT, DEFAULT_LOGO_WIDTH, } from '../..';
|
|
2
2
|
import { FabricRenderClient } from '../../../clients/fabric-render-client';
|
|
3
3
|
import { calculateLogoDimensions } from '../logo.util';
|
|
4
4
|
export const migration07 = async (migrationResult, options) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="types/lodash-shims" />
|
|
2
2
|
import type { PropType } from 'vue';
|
|
3
3
|
import type { BrandPageContext, BrandPageViewModel, LogoImageModel, LogoTemplateImageModel, LogoTheme, UserPersonalisation } from '../../../brand-page';
|
|
4
|
-
import type
|
|
4
|
+
import { type TemplateSettingsTemplate } from '../../../shared/template-settings/models';
|
|
5
5
|
import type { DebounceHandle } from 'lodash.debounce';
|
|
6
6
|
interface TemplatePreviewData {
|
|
7
7
|
containerStyle: BrandPageCssStyle;
|
|
@@ -15,6 +15,8 @@ interface TemplatePreviewData {
|
|
|
15
15
|
renderHeight: number;
|
|
16
16
|
renderWidth: number;
|
|
17
17
|
rootStyles: BrandPageCssStyle;
|
|
18
|
+
imageLoadError: boolean;
|
|
19
|
+
imageLoading: boolean;
|
|
18
20
|
}
|
|
19
21
|
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
20
22
|
logoImage: {
|
|
@@ -61,6 +63,64 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
61
63
|
};
|
|
62
64
|
}>, {
|
|
63
65
|
selectedTemplateId: import("vue").ComputedRef<string | false>;
|
|
66
|
+
isPrePurchase: import("vue").ComputedRef<boolean>;
|
|
67
|
+
runtimeEnvironment: import("vue").ComputedRef<string>;
|
|
68
|
+
selectedTab: import("vue").ComputedRef<{
|
|
69
|
+
key: string;
|
|
70
|
+
displayName: string;
|
|
71
|
+
}>;
|
|
72
|
+
templateSettingsStore: import("pinia").Store<"uiTemplateSettings", import("../../../shared/template-settings/store").TemplatesSettingState, {}, {
|
|
73
|
+
_addTemplates({ templates }: {
|
|
74
|
+
templates: TemplateSettingsTemplate[];
|
|
75
|
+
}): void;
|
|
76
|
+
_setTemplates({ templates }: {
|
|
77
|
+
templates: TemplateSettingsTemplate[];
|
|
78
|
+
}): void;
|
|
79
|
+
_setIsBusy({ isBusy }: {
|
|
80
|
+
isBusy: boolean;
|
|
81
|
+
}): void;
|
|
82
|
+
_setPageCount({ pageCount }: {
|
|
83
|
+
pageCount: number;
|
|
84
|
+
}): void;
|
|
85
|
+
_setPageNo({ pageNo }: {
|
|
86
|
+
pageNo: number;
|
|
87
|
+
}): void;
|
|
88
|
+
_setPageNoLoaded({ pageNoLoaded }: {
|
|
89
|
+
pageNoLoaded: number;
|
|
90
|
+
}): void;
|
|
91
|
+
_setSearchTerm({ searchTerm }: {
|
|
92
|
+
searchTerm: string | undefined;
|
|
93
|
+
}): void;
|
|
94
|
+
_setSelectedTab({ tabName }: {
|
|
95
|
+
tabName: "all" | "AI" | "categories";
|
|
96
|
+
}): void;
|
|
97
|
+
_setSelectedCategory({ categoryName, }: {
|
|
98
|
+
categoryName: string | undefined;
|
|
99
|
+
}): void;
|
|
100
|
+
_setTemplateCategories({ categories }: {
|
|
101
|
+
categories: import("../../../shared/template-settings/models").TemplateCategory[];
|
|
102
|
+
}): void;
|
|
103
|
+
gotoNextPage(): Promise<void>;
|
|
104
|
+
gotoPreviousPage(): Promise<void>;
|
|
105
|
+
safeMapToTemplateSettingsTemplate(template: import("../../../clients/models").DesignTemplate | null): Promise<TemplateSettingsTemplate | null>;
|
|
106
|
+
loadPageNo({ pageNo }: {
|
|
107
|
+
pageNo: number;
|
|
108
|
+
}): Promise<void>;
|
|
109
|
+
getCachedTemplateByTokenAsync(token: string): Promise<TemplateSettingsTemplate | undefined>;
|
|
110
|
+
onTemplateSelected(payload: import("../../../shared/template-settings/models").OnTemplateSelectedPayload): Promise<void>;
|
|
111
|
+
onCategorySelected(payload: import("../../../shared/template-settings/models").OnCategorySelectedPayload): Promise<void>;
|
|
112
|
+
onSearch(payload: import("../../../shared/template-settings/models").OnSearchPayload): Promise<void>;
|
|
113
|
+
onTabSelected(payload: import("../../../shared/template-settings/models").OnTabSelectedPayload): Promise<void>;
|
|
114
|
+
setTemplateType({ templateType }: {
|
|
115
|
+
templateType: import("../../../shared/template-settings/models").DesignTemplateType;
|
|
116
|
+
}): void;
|
|
117
|
+
setTemplateCategories(payload: import("../../../shared/template-settings/models").SetTemplateCategoriesPayload): Promise<void>;
|
|
118
|
+
selectInitialTemplateCategory(payload: {
|
|
119
|
+
selectedCategory: string;
|
|
120
|
+
}): void;
|
|
121
|
+
clearTemplates(): void;
|
|
122
|
+
getTemplateByTemplateId(id: string): TemplateSettingsTemplate | undefined;
|
|
123
|
+
}>;
|
|
64
124
|
brandPageMakerStore: import("pinia").Store<"brandPageMaker", import("../../stores").BrandPageMakerState, {
|
|
65
125
|
contentErrorCount(): number;
|
|
66
126
|
brandPageBaseUrl(): string;
|
|
@@ -187,17 +247,243 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
187
247
|
showStripeOnboardingModal(): Promise<void>;
|
|
188
248
|
selectInitialCategories(payload: import("../../../shared/template-settings/models").InitialCategories): void;
|
|
189
249
|
}>;
|
|
250
|
+
brandPageContainerStore: import("pinia").Store<"brandPageContainer", import("../../stores").BrandPageContainerState, {
|
|
251
|
+
brandPageContentTypes(): string[];
|
|
252
|
+
isAdmin(): boolean;
|
|
253
|
+
isPublished: (state: {
|
|
254
|
+
availableTaxes: any[];
|
|
255
|
+
brandPageBaseUrl: string;
|
|
256
|
+
baseFabricRenderUrl: string;
|
|
257
|
+
brandPageDescription: string;
|
|
258
|
+
brandPageDisplayName: string;
|
|
259
|
+
sensitiveContent: number;
|
|
260
|
+
brandPageSlug: string;
|
|
261
|
+
brandPageStatus: string;
|
|
262
|
+
brandPageToken: string | undefined;
|
|
263
|
+
brandPageTitle: string;
|
|
264
|
+
customDomain: {
|
|
265
|
+
id: string;
|
|
266
|
+
created: Date;
|
|
267
|
+
updated: Date;
|
|
268
|
+
brandPageToken: string;
|
|
269
|
+
domainName: string;
|
|
270
|
+
status: "active" | "pending" | "failed" | "renewFailed" | "deleted";
|
|
271
|
+
dnsConfigurationStatus: "request_expired" | "missing_expected_dns_records" | "invalid_multiple_dns_records_exist" | "unexpected_aaaa_record" | "completed";
|
|
272
|
+
triggerOrigin?: string | undefined;
|
|
273
|
+
} | null;
|
|
274
|
+
createCustomDomainErrorMessage: string | null;
|
|
275
|
+
customDomainConfig?: {
|
|
276
|
+
dns: {
|
|
277
|
+
ipAddresses: string[];
|
|
278
|
+
};
|
|
279
|
+
} | undefined;
|
|
280
|
+
designDraftToken?: string | undefined;
|
|
281
|
+
designTemplateToken: string;
|
|
282
|
+
isCustomDomainEnabled: boolean;
|
|
283
|
+
isBrandPageSlugEditMode: boolean;
|
|
284
|
+
isPublishModalVisible: boolean;
|
|
285
|
+
isUpgradeModalVisible: boolean;
|
|
286
|
+
isPublishing: boolean;
|
|
287
|
+
isProduction: boolean;
|
|
288
|
+
isSellDomainNameEnabled: boolean;
|
|
289
|
+
isStripeOnboardingModalVisible: boolean;
|
|
290
|
+
isReactivationModal: boolean;
|
|
291
|
+
isPublishUpgradeModal: boolean;
|
|
292
|
+
isSaving: boolean;
|
|
293
|
+
backButtonLabel: string;
|
|
294
|
+
manageWebsiteDesignsUrl: string;
|
|
295
|
+
publishErrorMessage: string;
|
|
296
|
+
upgradeUrl: string;
|
|
297
|
+
reactivationUrl: string;
|
|
298
|
+
runtimeEnvironment: string;
|
|
299
|
+
selectedTaxId: number | undefined;
|
|
300
|
+
slug: string;
|
|
301
|
+
standalone: boolean;
|
|
302
|
+
triggerSaveSuccessMessage: boolean;
|
|
303
|
+
isDesignCom: boolean;
|
|
304
|
+
isPrePurchase: boolean;
|
|
305
|
+
makerFonts: any[];
|
|
306
|
+
eventButtonLocation?: string | undefined;
|
|
307
|
+
websiteUpsellModalViewModel?: any;
|
|
308
|
+
showPublishOptionModal?: boolean | undefined;
|
|
309
|
+
abTests: Record<string, string>;
|
|
310
|
+
isSubsequentPublish: boolean;
|
|
311
|
+
} & import("pinia").PiniaCustomStateProperties<import("../../stores").BrandPageContainerState>) => boolean;
|
|
312
|
+
isUserDraft: (state: {
|
|
313
|
+
availableTaxes: any[];
|
|
314
|
+
brandPageBaseUrl: string;
|
|
315
|
+
baseFabricRenderUrl: string;
|
|
316
|
+
brandPageDescription: string;
|
|
317
|
+
brandPageDisplayName: string;
|
|
318
|
+
sensitiveContent: number;
|
|
319
|
+
brandPageSlug: string;
|
|
320
|
+
brandPageStatus: string;
|
|
321
|
+
brandPageToken: string | undefined;
|
|
322
|
+
brandPageTitle: string;
|
|
323
|
+
customDomain: {
|
|
324
|
+
id: string;
|
|
325
|
+
created: Date;
|
|
326
|
+
updated: Date;
|
|
327
|
+
brandPageToken: string;
|
|
328
|
+
domainName: string;
|
|
329
|
+
status: "active" | "pending" | "failed" | "renewFailed" | "deleted";
|
|
330
|
+
dnsConfigurationStatus: "request_expired" | "missing_expected_dns_records" | "invalid_multiple_dns_records_exist" | "unexpected_aaaa_record" | "completed";
|
|
331
|
+
triggerOrigin?: string | undefined;
|
|
332
|
+
} | null;
|
|
333
|
+
createCustomDomainErrorMessage: string | null;
|
|
334
|
+
customDomainConfig?: {
|
|
335
|
+
dns: {
|
|
336
|
+
ipAddresses: string[];
|
|
337
|
+
};
|
|
338
|
+
} | undefined;
|
|
339
|
+
designDraftToken?: string | undefined;
|
|
340
|
+
designTemplateToken: string;
|
|
341
|
+
isCustomDomainEnabled: boolean;
|
|
342
|
+
isBrandPageSlugEditMode: boolean;
|
|
343
|
+
isPublishModalVisible: boolean;
|
|
344
|
+
isUpgradeModalVisible: boolean;
|
|
345
|
+
isPublishing: boolean;
|
|
346
|
+
isProduction: boolean;
|
|
347
|
+
isSellDomainNameEnabled: boolean;
|
|
348
|
+
isStripeOnboardingModalVisible: boolean;
|
|
349
|
+
isReactivationModal: boolean;
|
|
350
|
+
isPublishUpgradeModal: boolean;
|
|
351
|
+
isSaving: boolean;
|
|
352
|
+
backButtonLabel: string;
|
|
353
|
+
manageWebsiteDesignsUrl: string;
|
|
354
|
+
publishErrorMessage: string;
|
|
355
|
+
upgradeUrl: string;
|
|
356
|
+
reactivationUrl: string;
|
|
357
|
+
runtimeEnvironment: string;
|
|
358
|
+
selectedTaxId: number | undefined;
|
|
359
|
+
slug: string;
|
|
360
|
+
standalone: boolean;
|
|
361
|
+
triggerSaveSuccessMessage: boolean;
|
|
362
|
+
isDesignCom: boolean;
|
|
363
|
+
isPrePurchase: boolean;
|
|
364
|
+
makerFonts: any[];
|
|
365
|
+
eventButtonLocation?: string | undefined;
|
|
366
|
+
websiteUpsellModalViewModel?: any;
|
|
367
|
+
showPublishOptionModal?: boolean | undefined;
|
|
368
|
+
abTests: Record<string, string>;
|
|
369
|
+
isSubsequentPublish: boolean;
|
|
370
|
+
} & import("pinia").PiniaCustomStateProperties<import("../../stores").BrandPageContainerState>) => boolean;
|
|
371
|
+
}, {
|
|
372
|
+
initialise(payload: import("../../stores/brandpage-container").InitialisePayload): void;
|
|
373
|
+
setDesignTemplateToken(payload: any): void;
|
|
374
|
+
setDesignDraftToken(payload: any): void;
|
|
375
|
+
setIsBrandPageSlugEditMode(payload: any): void;
|
|
376
|
+
setIsPublishing(payload: any): void;
|
|
377
|
+
setIsPublishModalVisible(payload: any): void;
|
|
378
|
+
setIsPublishUpgradeModal(payload: any): void;
|
|
379
|
+
setIsSaving(payload: any): void;
|
|
380
|
+
setIsUpgradeModalVisible(payload: any): void;
|
|
381
|
+
setPublishErrorMessage(payload: any): void;
|
|
382
|
+
setTriggerSaveSuccessMessage(payload: any): void;
|
|
383
|
+
setSlug(payload: any): void;
|
|
384
|
+
updateBrandPageMeta(payload: any): void;
|
|
385
|
+
updateBrandPageSensitiveContent(payload: any): void;
|
|
386
|
+
setLogoDraftToken(payload: {
|
|
387
|
+
logoDraftToken: string;
|
|
388
|
+
}): void;
|
|
389
|
+
setBackUrl(payload: any): void;
|
|
390
|
+
setIsStripeOnboardingModalVisible(payload: any): void;
|
|
391
|
+
setSelectedTaxId(payload: any): void;
|
|
392
|
+
setBrandPageCustomDomainConfig({ customDomainConfig }: {
|
|
393
|
+
customDomainConfig: any;
|
|
394
|
+
}): void;
|
|
395
|
+
setBrandPageCustomDomain(payload: {
|
|
396
|
+
customDomain: import("../../models").CustomDomainModel | null;
|
|
397
|
+
}): void;
|
|
398
|
+
setCreateCustomDomainErrorMessage(payload: any): void;
|
|
399
|
+
setBrandPageIsCustomDomainEnabled(payload: any): void;
|
|
400
|
+
setIsSubsequentPublish(payload: any): void;
|
|
401
|
+
clearPublishErrorMessage(): void;
|
|
402
|
+
closePublishModal(payload?: {
|
|
403
|
+
skipShowNextNotificationMessage?: boolean | undefined;
|
|
404
|
+
}): Promise<void>;
|
|
405
|
+
closeUpgradeModal(): Promise<void>;
|
|
406
|
+
endBrandPageSlugEditMode(): void;
|
|
407
|
+
publishBrandPage({ shouldPublish, slug }: {
|
|
408
|
+
shouldPublish: any;
|
|
409
|
+
slug: any;
|
|
410
|
+
}): Promise<false | {
|
|
411
|
+
success: boolean;
|
|
412
|
+
websiteUpsellModalViewModel: any;
|
|
413
|
+
}>;
|
|
414
|
+
publishBrandPageWithCustomDomainAsync({ shouldPublish, slug, domain, isPurchasedDomain, }: {
|
|
415
|
+
shouldPublish: any;
|
|
416
|
+
slug: any;
|
|
417
|
+
domain: any;
|
|
418
|
+
isPurchasedDomain: any;
|
|
419
|
+
}): Promise<boolean | undefined>;
|
|
420
|
+
checkWebsiteSlugAsync(slug: string): Promise<import("../../models/api.model").WebsiteSlugCheckResponse | null>;
|
|
421
|
+
redirectToLogoEditPage(logoEditUrl: string, locale: string): Promise<void>;
|
|
422
|
+
redirectToCreateNewDesignPage(): Promise<void>;
|
|
423
|
+
redirectToStripeOnboarding(): Promise<void>;
|
|
424
|
+
exportDesignAsync(): Promise<any>;
|
|
425
|
+
saveBrandPage(payload?: {
|
|
426
|
+
isPublish?: boolean | undefined;
|
|
427
|
+
eventButtonLocation?: string | undefined;
|
|
428
|
+
}): Promise<false | {
|
|
429
|
+
saved: boolean;
|
|
430
|
+
canPublish: boolean;
|
|
431
|
+
websiteUpsellModalViewModel: any;
|
|
432
|
+
}>;
|
|
433
|
+
saveAndPublishBrandPage(eventButtonLocation: string): Promise<void>;
|
|
434
|
+
saveTemplate(): Promise<void>;
|
|
435
|
+
setBrandPageStatus(status: any): Promise<void>;
|
|
436
|
+
showPublishModal(eventButtonLocation?: string | undefined, websiteUpsellModalViewModel?: any, isSubsequentPublish?: boolean | undefined): void;
|
|
437
|
+
showBrandPageSlugEditModal(eventButtonLocation: string): Promise<void>;
|
|
438
|
+
showUpgradeModalAndSaveAsync(): Promise<void>;
|
|
439
|
+
showStripeOnboardingModal(): void;
|
|
440
|
+
closeStripeOnboardingModal(): void;
|
|
441
|
+
showSaveSuccessMessage(): Promise<void>;
|
|
442
|
+
startBrandPageSlugEditMode(): void;
|
|
443
|
+
triggerLockedContentClickedEvent(contentType: string): Promise<void>;
|
|
444
|
+
unpublishBrandPage(): Promise<void>;
|
|
445
|
+
updateBrandPageSettings({ description, title }: {
|
|
446
|
+
description: any;
|
|
447
|
+
title: any;
|
|
448
|
+
}): Promise<void>;
|
|
449
|
+
updateSensitiveContent({ sensitiveContent }: {
|
|
450
|
+
sensitiveContent: any;
|
|
451
|
+
}): Promise<void>;
|
|
452
|
+
createBrandPageCustomDomain({ domainName }: {
|
|
453
|
+
domainName: any;
|
|
454
|
+
}): Promise<false | undefined>;
|
|
455
|
+
createBrandPageWithPurchasedDomain({ domainName }: {
|
|
456
|
+
domainName: any;
|
|
457
|
+
}): Promise<false | undefined>;
|
|
458
|
+
deleteBrandPageCustomDomain({ designDraftToken, customDomainId }: {
|
|
459
|
+
designDraftToken: any;
|
|
460
|
+
customDomainId: any;
|
|
461
|
+
}): Promise<void>;
|
|
462
|
+
refreshBrandPageCustomDomainConfig(): Promise<void>;
|
|
463
|
+
refreshBrandPageCustomDomain(): Promise<void>;
|
|
464
|
+
updateBrandPageIsCustomDomainEnabled({ isCustomDomainEnabled }: {
|
|
465
|
+
isCustomDomainEnabled: any;
|
|
466
|
+
}): Promise<void>;
|
|
467
|
+
}>;
|
|
190
468
|
}, TemplatePreviewData, {
|
|
191
469
|
context(): BrandPageContext;
|
|
192
470
|
previewViewport(): string;
|
|
193
471
|
scaledContainerStyle(): BrandPageCssStyle;
|
|
194
472
|
innerContainerStyle(): BrandPageCssStyle;
|
|
195
473
|
isPersonalisable(): boolean;
|
|
474
|
+
isAiTemplate(): boolean;
|
|
475
|
+
shouldRenderAsPage(): boolean;
|
|
196
476
|
cssVariablesStyle(): Record<string, string>;
|
|
477
|
+
previewImageUrl(): string;
|
|
197
478
|
}, {
|
|
198
479
|
onOverlayClicked(): void;
|
|
199
480
|
onResize(): void;
|
|
200
481
|
onSetPreviewStyles(styles: BrandPageCssStyle): void;
|
|
482
|
+
onImageError(): void;
|
|
483
|
+
onImageLoad(): void;
|
|
484
|
+
generatePreviewImageUrl(): string;
|
|
485
|
+
getPreviewBaseUrl(): string;
|
|
486
|
+
regeneratePreview(): void;
|
|
201
487
|
updateViewModel(forceUpdate?: boolean): Promise<void>;
|
|
202
488
|
}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "template-selected"[], "template-selected", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
203
489
|
logoImage: {
|
|
@@ -2,19 +2,28 @@ import { computed, defineComponent } from 'vue';
|
|
|
2
2
|
import { BRAND_PAGE_TYPES, MEDIA_SIZES, VIEWPORTS } from '../../../brand-page';
|
|
3
3
|
import { applyLogoThemeToBrandPageModel, applyUserPersonalisationToBrandPageModelAsync, getBrandPageViewModelFromBrandPageModel, } from '../../../brand-page/utils';
|
|
4
4
|
import { STYLE_THEME_KEYS } from '../../../brand-page/constants';
|
|
5
|
+
import { TEMPLATE_TABS, } from '../../../shared/template-settings/models';
|
|
5
6
|
import debounce from 'lodash.debounce';
|
|
6
7
|
import { MOBILE_HEIGHT, MOBILE_WIDTH } from '../../constants';
|
|
7
|
-
import { useBrandPageMakerStore } from '../../stores';
|
|
8
|
+
import { useBrandPageContainerStore, useBrandPageMakerStore, } from '../../stores';
|
|
8
9
|
import { applyLogoImageBase64UrlToBrandPageTemplateModel, applyLogoImageToBrandPageTemplateModel, applyLogoTemplateImageToBrandPageTemplateModel, } from '../../../brand-page/utils/logo.util';
|
|
9
10
|
import { useVideoStore } from '../../../lib';
|
|
11
|
+
import { useUiTemplateSettingsStore } from '../../../shared/template-settings/store';
|
|
10
12
|
const DEBOUNCE_IN_MS = 250;
|
|
11
13
|
export default defineComponent({
|
|
12
14
|
emits: ['template-selected'],
|
|
13
15
|
setup() {
|
|
14
16
|
const brandPageMakerStore = useBrandPageMakerStore();
|
|
17
|
+
const brandPageContainerStore = useBrandPageContainerStore();
|
|
18
|
+
const templateSettingsStore = useUiTemplateSettingsStore();
|
|
15
19
|
return {
|
|
16
20
|
selectedTemplateId: computed(() => brandPageMakerStore.selectedTemplateId),
|
|
21
|
+
isPrePurchase: computed(() => brandPageContainerStore.isPrePurchase),
|
|
22
|
+
runtimeEnvironment: computed(() => brandPageContainerStore.runtimeEnvironment),
|
|
23
|
+
selectedTab: computed(() => templateSettingsStore.selectedTab),
|
|
24
|
+
templateSettingsStore,
|
|
17
25
|
brandPageMakerStore,
|
|
26
|
+
brandPageContainerStore,
|
|
18
27
|
};
|
|
19
28
|
},
|
|
20
29
|
props: {
|
|
@@ -73,6 +82,8 @@ export default defineComponent({
|
|
|
73
82
|
renderWidth: 400,
|
|
74
83
|
rootStyles: {},
|
|
75
84
|
viewModel: undefined,
|
|
85
|
+
imageLoadError: false,
|
|
86
|
+
imageLoading: true,
|
|
76
87
|
};
|
|
77
88
|
return data;
|
|
78
89
|
},
|
|
@@ -131,6 +142,13 @@ export default defineComponent({
|
|
|
131
142
|
isPersonalisable() {
|
|
132
143
|
return this.template.isPersonalisable || false;
|
|
133
144
|
},
|
|
145
|
+
isAiTemplate() {
|
|
146
|
+
return this.selectedTab.key === TEMPLATE_TABS.AI;
|
|
147
|
+
},
|
|
148
|
+
shouldRenderAsPage() {
|
|
149
|
+
const result = this.isPrePurchase || this.isAiTemplate;
|
|
150
|
+
return result;
|
|
151
|
+
},
|
|
134
152
|
cssVariablesStyle() {
|
|
135
153
|
if (!this.logoTheme) {
|
|
136
154
|
return {};
|
|
@@ -147,17 +165,24 @@ export default defineComponent({
|
|
|
147
165
|
});
|
|
148
166
|
return cssVariables;
|
|
149
167
|
},
|
|
168
|
+
previewImageUrl() {
|
|
169
|
+
return this.generatePreviewImageUrl();
|
|
170
|
+
},
|
|
150
171
|
},
|
|
151
172
|
watch: {
|
|
173
|
+
template() {
|
|
174
|
+
if (this.isPrePurchase) {
|
|
175
|
+
this.updateViewModel();
|
|
176
|
+
}
|
|
177
|
+
},
|
|
152
178
|
logoTheme: {
|
|
153
179
|
handler() {
|
|
154
|
-
this.
|
|
180
|
+
if (this.isPrePurchase) {
|
|
181
|
+
this.updateViewModel();
|
|
182
|
+
}
|
|
155
183
|
},
|
|
156
184
|
deep: true,
|
|
157
185
|
},
|
|
158
|
-
template() {
|
|
159
|
-
this.updateViewModel();
|
|
160
|
-
},
|
|
161
186
|
},
|
|
162
187
|
created() {
|
|
163
188
|
this.updateViewModel(false);
|
|
@@ -197,7 +222,37 @@ export default defineComponent({
|
|
|
197
222
|
onSetPreviewStyles(styles) {
|
|
198
223
|
this.rootStyles = styles;
|
|
199
224
|
},
|
|
225
|
+
onImageError() {
|
|
226
|
+
console.warn(`Failed to load preview image for template ${this.template.id}`);
|
|
227
|
+
this.imageLoadError = true;
|
|
228
|
+
this.imageLoading = false;
|
|
229
|
+
},
|
|
230
|
+
onImageLoad() {
|
|
231
|
+
this.imageLoadError = false;
|
|
232
|
+
this.imageLoading = false;
|
|
233
|
+
},
|
|
234
|
+
generatePreviewImageUrl() {
|
|
235
|
+
const baseUrl = this.getPreviewBaseUrl();
|
|
236
|
+
const logoDraftToken = this.logoImage?.logoDraftToken ||
|
|
237
|
+
'0B660926-D94A-4E29-99D1-F07E67AA6E49';
|
|
238
|
+
const deviceType = this.brandPageMakerStore.brandPageType === 'brandSite'
|
|
239
|
+
? 'desktop'
|
|
240
|
+
: 'mobile';
|
|
241
|
+
return `${baseUrl}/preview/template/${this.template.id}/${logoDraftToken}?deviceType=${deviceType}`;
|
|
242
|
+
},
|
|
243
|
+
getPreviewBaseUrl() {
|
|
244
|
+
const domainSuffix = '.brand.page';
|
|
245
|
+
return `https://preview-${this.runtimeEnvironment}${domainSuffix}`;
|
|
246
|
+
},
|
|
247
|
+
regeneratePreview() {
|
|
248
|
+
this.imageLoadError = false;
|
|
249
|
+
this.imageLoading = true;
|
|
250
|
+
this.$forceUpdate();
|
|
251
|
+
},
|
|
200
252
|
async updateViewModel(forceUpdate = true) {
|
|
253
|
+
if (!this.isPrePurchase) {
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
201
256
|
const videoStore = useVideoStore();
|
|
202
257
|
let model = this.template.brandPageModel;
|
|
203
258
|
if (this.logoImageBase64Url) {
|
|
@@ -178,13 +178,23 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
|
|
|
178
178
|
if (!this.selectedTemplateId) {
|
|
179
179
|
return;
|
|
180
180
|
}
|
|
181
|
-
|
|
181
|
+
let template = templateSettingsStore.getTemplateByTemplateId(this.selectedTemplateId);
|
|
182
182
|
if (!template) {
|
|
183
183
|
if (process.env.NODE_ENV !== 'production') {
|
|
184
184
|
throw new Error('template should not be falsy');
|
|
185
185
|
}
|
|
186
186
|
return;
|
|
187
187
|
}
|
|
188
|
+
// If template doesn't have brandPageModel (post-purchase mode), fetch it
|
|
189
|
+
if (!template.brandPageModel) {
|
|
190
|
+
template = await templateSettingsStore.getCachedTemplateByTokenAsync(this.selectedTemplateId);
|
|
191
|
+
if (!template || !template.brandPageModel) {
|
|
192
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
193
|
+
throw new Error('Failed to fetch template brandPageModel');
|
|
194
|
+
}
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
188
198
|
this.isApplyingTemplate = true;
|
|
189
199
|
let brandPageModel = cloneDeep(template.brandPageModel);
|
|
190
200
|
// Apply selected logo image to logo contents
|