@designcrowd/library.brand-page 5.15.16 → 5.15.17-ast-previews
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-DwjHHx8U.js → CreatedOnBrandCrowd-de-de-DhqVq1R4.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-en-us-wnQWDaLj.js → CreatedOnBrandCrowd-en-us-gHKO7Euu.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-es-es-BPLwmFYf.js → CreatedOnBrandCrowd-es-es-BiqMA1-P.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-fr-ZLo9mFvK.js → CreatedOnBrandCrowd-fr-ca-DeD80sNd.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-ca-ZLo9mFvK.js → CreatedOnBrandCrowd-fr-fr-DeD80sNd.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-pt-PeE8kWqc.js → CreatedOnBrandCrowd-pt-br-FYtTRyJj.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-br-PeE8kWqc.js → CreatedOnBrandCrowd-pt-pt-FYtTRyJj.js} +1 -1
- package/lib/src/{CreatedOnDcom-de-de-DckpvOP7.js → CreatedOnDcom-de-de-DiyaqKgn.js} +1 -1
- package/lib/src/{CreatedOnDcom-en-us-CFzquTUz.js → CreatedOnDcom-en-us-BsH92alk.js} +1 -1
- package/lib/src/{CreatedOnDcom-es-es-BpbcQQtf.js → CreatedOnDcom-es-es-DXv36XgZ.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-ca-bV4zOxfZ.js → CreatedOnDcom-fr-ca-DwCGXfKv.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-fr-dGkZsGAG.js → CreatedOnDcom-fr-fr-zHQ4Y1xm.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-br-C2hFs0vl.js → CreatedOnDcom-pt-br-CZoYGQlg.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-pt-VWtI0WwK.js → CreatedOnDcom-pt-pt-BZOFxo9Q.js} +1 -1
- package/lib/src/brand-page/utils/migration/migration-07.js +1 -1
- package/lib/src/brand-page-maker/components/action-bar/ActionBar.mixin.d.ts +0 -1
- package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.d.ts +1 -5
- package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.js +3 -36
- package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMakerTemplateSettings.mixin.d.ts +0 -1
- package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.d.ts +0 -1
- package/lib/src/brand-page-maker/components/brandpage-settings/ReplaceImageSettingsForBrandPageSettings.mixin.d.ts +0 -1
- package/lib/src/brand-page-maker/components/seo-settings/SeoPageSettings.mixin.d.ts +0 -1
- package/lib/src/brand-page-maker/components/seo-settings/UrlSettings.mixin.d.ts +0 -1
- package/lib/src/brand-page-maker/components/social-share/SocialShare.mixin.d.ts +0 -1
- package/lib/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.d.ts +14 -15
- package/lib/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.js +56 -70
- package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.d.ts +0 -2
- package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.js +0 -4
- package/lib/src/bundled-translations-wzmaFfsm.js +161 -0
- package/lib/src/bundled-translations.de-DE-BNwDY0Gw.js +161 -0
- package/lib/src/bundled-translations.es-ES-DTvCIjvS.js +161 -0
- package/lib/src/bundled-translations.fr-CA-5oL4PLEx.js +161 -0
- package/lib/src/bundled-translations.fr-FR-DWL7DJQp.js +161 -0
- package/lib/src/bundled-translations.pt-BR-CDj0L4EF.js +161 -0
- package/lib/src/bundled-translations.pt-PT-M916KJYD.js +161 -0
- package/lib/src/bundles/bundled-translations.de-DE.json +3 -0
- package/lib/src/bundles/bundled-translations.es-ES.json +3 -0
- package/lib/src/bundles/bundled-translations.fr-CA.json +3 -0
- package/lib/src/bundles/bundled-translations.fr-FR.json +3 -0
- package/lib/src/bundles/bundled-translations.json +3 -0
- package/lib/src/bundles/bundled-translations.pt-BR.json +3 -0
- package/lib/src/bundles/bundled-translations.pt-PT.json +3 -0
- package/lib/src/clients/asset-library-clients.d.ts +0 -2
- package/lib/src/clients/asset-library-clients.js +0 -15
- package/lib/src/css/library.brand-page-brandCrowd.min.css +42 -33
- package/lib/src/css/library.brand-page-brandPage.min.css +42 -33
- package/lib/src/css/library.brand-page-designCom.min.css +42 -33
- package/lib/src/css/library.brand-page-preview.min.css +42 -33
- package/lib/src/index.mjs +1 -1
- package/lib/src/{lib-DaxXE-vZ.js → lib-7x9ead9m.js} +7790 -7845
- package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.d.ts +0 -1
- package/lib/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.mixin.d.ts +0 -1
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.d.ts +0 -1
- package/lib/src/shared/logo-settings/components/LogoSettings.mixin.d.ts +0 -1
- package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.d.ts +0 -1
- package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.d.ts +0 -1
- package/lib/src/shared/publish-brand-page-with-state/PublishBrandPageModalWithState.mixin.d.ts +0 -1
- package/lib/src/shared/publish-brand-page-with-state/PublishBrandPageModalWithState.mixin.js +1 -2
- package/lib/src/shared/side-bar/components/SideBar.mixin.d.ts +0 -1
- package/lib/src/shared/side-bar/components/SideBar.mixin.js +1 -6
- package/lib/src/shared/style-settings/components/StyleSettings.mixin.d.ts +0 -1
- package/package.json +2 -2
- 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/brand-page-maker/BrandPageMaker.mixin.ts +4 -40
- package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.vue +1 -9
- package/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.ts +70 -90
- package/src/brand-page-maker/components/template-preview/TemplatePreview.vue +16 -17
- package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.ts +0 -5
- package/src/bundles/bundled-translations.de-DE.json +3 -0
- package/src/bundles/bundled-translations.es-ES.json +3 -0
- package/src/bundles/bundled-translations.fr-CA.json +3 -0
- package/src/bundles/bundled-translations.fr-FR.json +3 -0
- package/src/bundles/bundled-translations.json +3 -0
- package/src/bundles/bundled-translations.pt-BR.json +3 -0
- package/src/bundles/bundled-translations.pt-PT.json +3 -0
- package/src/clients/asset-library-clients.ts +0 -20
- package/src/shared/common/i18n/common.de-DE.json +3 -0
- package/src/shared/common/i18n/common.es-ES.json +3 -0
- package/src/shared/common/i18n/common.fr-CA.json +3 -0
- package/src/shared/common/i18n/common.fr-FR.json +3 -0
- package/src/shared/common/i18n/common.json +3 -0
- package/src/shared/common/i18n/common.pt-BR.json +3 -0
- package/src/shared/common/i18n/common.pt-PT.json +3 -0
- package/src/shared/content-settings/components/draggable-item-list/DraggableItemList.vue +8 -3
- package/src/shared/content-settings/components/text-items-field/TextItemsField.vue +8 -2
- package/src/shared/publish-brand-page-with-state/PublishBrandPageModalWithState.mixin.ts +1 -2
- package/src/shared/side-bar/components/SideBar.mixin.ts +0 -7
- package/src/shared/side-bar/components/SideBar.vue +1 -9
- package/lib/src/bundled-translations-GvfzVUdP.js +0 -161
- package/lib/src/bundled-translations.de-DE-CbdKWmRe.js +0 -161
- package/lib/src/bundled-translations.es-ES-nP95fALh.js +0 -161
- package/lib/src/bundled-translations.fr-CA-HvN6Ib_d.js +0 -161
- package/lib/src/bundled-translations.fr-FR-C6X4Au0M.js +0 -161
- package/lib/src/bundled-translations.pt-BR-DLC1LHBm.js +0 -161
- package/lib/src/bundled-translations.pt-PT-CDT0Os9V.js +0 -161
|
@@ -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) => {
|
|
@@ -82,7 +82,6 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
82
82
|
setIsInitialising(payload: {
|
|
83
83
|
isInitialising: boolean;
|
|
84
84
|
}): void;
|
|
85
|
-
setIsBrandPageLoaded(isLoaded: boolean): void;
|
|
86
85
|
setIsModifiedAfterTemplateApplied({ isModified, }?: import("../../stores").SetIsModifiedPayload): void;
|
|
87
86
|
setSelectedTemplateId(payload: {
|
|
88
87
|
templateId: string | false;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="types/lodash-shims" />
|
|
2
2
|
import type { PropType } from 'vue';
|
|
3
3
|
import type { DebounceHandle } from 'lodash.debounce';
|
|
4
|
-
import { type
|
|
4
|
+
import { type BrandPageType, type ViewportsType, type UserPersonalisationContent } from '../../../brand-page';
|
|
5
5
|
import type { InitialCategories, TemplateCategory } from '../../../shared/template-settings/models';
|
|
6
6
|
import type { UserFeatures } from '../../stores';
|
|
7
7
|
import { type LogoDesignAttributesModel } from '../../../shared/models';
|
|
@@ -10,7 +10,6 @@ import type { UpdateItemValuePayload } from '../../../shared/content-settings/mo
|
|
|
10
10
|
export interface BrandPageMakerViewModel {
|
|
11
11
|
adminPreviewLogoTemplateModels?: AdminPreviewLogoTemplateModel[];
|
|
12
12
|
brandPageData?: string;
|
|
13
|
-
brandPageMetadataS3Url?: string;
|
|
14
13
|
emailAddress: string;
|
|
15
14
|
features: UserFeatures;
|
|
16
15
|
logoVariationImageUrls: string[];
|
|
@@ -125,7 +124,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
125
124
|
setIsInitialising(payload: {
|
|
126
125
|
isInitialising: boolean;
|
|
127
126
|
}): void;
|
|
128
|
-
setIsBrandPageLoaded(isLoaded: boolean): void;
|
|
129
127
|
setIsModifiedAfterTemplateApplied({ isModified, }?: import("../../stores").SetIsModifiedPayload): void;
|
|
130
128
|
setSelectedTemplateId(payload: {
|
|
131
129
|
templateId: string | false;
|
|
@@ -1138,13 +1136,11 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
1138
1136
|
router: import("vue-router").Router;
|
|
1139
1137
|
}, {
|
|
1140
1138
|
mounted: boolean;
|
|
1141
|
-
isBrandPageLoaded: boolean;
|
|
1142
1139
|
debounceOnResize: DebounceHandle | undefined;
|
|
1143
1140
|
showSaveSuccessMessage: boolean;
|
|
1144
1141
|
}, {
|
|
1145
1142
|
previewContainer(): any;
|
|
1146
1143
|
}, {
|
|
1147
|
-
getBrandPageFromFallback(viewModel: any): BrandPageData;
|
|
1148
1144
|
onResizeWithDebounce(): void;
|
|
1149
1145
|
onResize(): void;
|
|
1150
1146
|
setUiScreenSizeModeBasedOnDeviceWidth(): void;
|
|
@@ -16,7 +16,6 @@ import { useUiTemplateSettingsStore } from '../../../shared/template-settings/st
|
|
|
16
16
|
import { useUiPageSettingsStore } from '../../../shared/page-settings/store';
|
|
17
17
|
import { useRouter } from 'vue-router';
|
|
18
18
|
import { FabricRenderClient } from '../../../clients/fabric-render-client';
|
|
19
|
-
import AssetLibraryClient from '../../../clients/asset-library-clients';
|
|
20
19
|
import { useShopConfigStore } from '../../../shared/ecommerce-settings/store/shop-settings-store';
|
|
21
20
|
import { useProductConfigStore } from '../../../brand-page-maker/stores/product-config/product-config-store';
|
|
22
21
|
import { UPGRADE_CTA_LOCATIONS } from '../../composables/useEventTracker';
|
|
@@ -84,7 +83,6 @@ export default defineComponent({
|
|
|
84
83
|
data() {
|
|
85
84
|
return {
|
|
86
85
|
mounted: false,
|
|
87
|
-
isBrandPageLoaded: false,
|
|
88
86
|
debounceOnResize: undefined,
|
|
89
87
|
showSaveSuccessMessage: false,
|
|
90
88
|
};
|
|
@@ -99,22 +97,9 @@ export default defineComponent({
|
|
|
99
97
|
typeof this.viewModel?.logoDraftDesignAttributes.logoTheme !== 'object') {
|
|
100
98
|
console.error('logo theme is missing');
|
|
101
99
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
baseUrl: '',
|
|
106
|
-
});
|
|
107
|
-
const metadata = await assetClient.getBrandPageMetadataAsync(this.viewModel.brandPageMetadataS3Url);
|
|
108
|
-
if (metadata) {
|
|
109
|
-
brandPage = metadata;
|
|
110
|
-
}
|
|
111
|
-
else {
|
|
112
|
-
brandPage = this.getBrandPageFromFallback(this.viewModel);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
else {
|
|
116
|
-
brandPage = this.getBrandPageFromFallback(this.viewModel);
|
|
117
|
-
}
|
|
100
|
+
const brandPage = typeof this.viewModel?.brandPageData === 'string'
|
|
101
|
+
? JSON.parse(this.viewModel.brandPageData)
|
|
102
|
+
: createInitialBrandPage(this.viewModel.brandPageType);
|
|
118
103
|
const shopConfigData = this.viewModel?.shopConfigData?.trim()
|
|
119
104
|
? JSON.parse(this.viewModel.shopConfigData)
|
|
120
105
|
: null;
|
|
@@ -162,16 +147,6 @@ export default defineComponent({
|
|
|
162
147
|
navigateToPageBySlug(this.brandPageViewModel.pages[0].slug);
|
|
163
148
|
}
|
|
164
149
|
this.brandPageMakerStore.selectInitialCategories(this.viewModel.initialCategories);
|
|
165
|
-
// Mark brand page as fully loaded
|
|
166
|
-
this.isBrandPageLoaded = true;
|
|
167
|
-
this.brandPageMakerStore.setIsBrandPageLoaded(true);
|
|
168
|
-
// set initial screen size mode
|
|
169
|
-
if (this.isBrandPageOrIsBrandContact) {
|
|
170
|
-
this.brandPageMakerStore.setViewport({ viewport: VIEWPORTS.mobile });
|
|
171
|
-
}
|
|
172
|
-
else {
|
|
173
|
-
this.setViewportBasedOnDeviceWidth(true);
|
|
174
|
-
}
|
|
175
150
|
this.$emit(EVENTS.Initialised);
|
|
176
151
|
},
|
|
177
152
|
mounted() {
|
|
@@ -198,14 +173,6 @@ export default defineComponent({
|
|
|
198
173
|
}, 800);
|
|
199
174
|
},
|
|
200
175
|
methods: {
|
|
201
|
-
getBrandPageFromFallback(viewModel) {
|
|
202
|
-
if (typeof viewModel?.brandPageData === 'string') {
|
|
203
|
-
return JSON.parse(viewModel.brandPageData);
|
|
204
|
-
}
|
|
205
|
-
else {
|
|
206
|
-
return createInitialBrandPage(viewModel.brandPageType);
|
|
207
|
-
}
|
|
208
|
-
},
|
|
209
176
|
onResizeWithDebounce() {
|
|
210
177
|
if (this.debounceOnResize) {
|
|
211
178
|
this.debounceOnResize();
|
|
@@ -72,7 +72,6 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
72
72
|
setIsInitialising(payload: {
|
|
73
73
|
isInitialising: boolean;
|
|
74
74
|
}): void;
|
|
75
|
-
setIsBrandPageLoaded(isLoaded: boolean): void;
|
|
76
75
|
setIsModifiedAfterTemplateApplied({ isModified, }?: import("../../stores").SetIsModifiedPayload): void;
|
|
77
76
|
setSelectedTemplateId(payload: {
|
|
78
77
|
templateId: string | false;
|
package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.d.ts
CHANGED
|
@@ -577,7 +577,6 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
577
577
|
setIsInitialising(payload: {
|
|
578
578
|
isInitialising: boolean;
|
|
579
579
|
}): void;
|
|
580
|
-
setIsBrandPageLoaded(isLoaded: boolean): void;
|
|
581
580
|
setIsModifiedAfterTemplateApplied({ isModified, }?: import("../../stores").SetIsModifiedPayload): void;
|
|
582
581
|
setSelectedTemplateId(payload: {
|
|
583
582
|
templateId: string | false;
|
|
@@ -79,7 +79,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
79
79
|
setIsInitialising(payload: {
|
|
80
80
|
isInitialising: boolean;
|
|
81
81
|
}): void;
|
|
82
|
-
setIsBrandPageLoaded(isLoaded: boolean): void;
|
|
83
82
|
setIsModifiedAfterTemplateApplied({ isModified, }?: import("../../stores").SetIsModifiedPayload): void;
|
|
84
83
|
setSelectedTemplateId(payload: {
|
|
85
84
|
templateId: string | false;
|
|
@@ -316,7 +316,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
316
316
|
setIsInitialising(payload: {
|
|
317
317
|
isInitialising: boolean;
|
|
318
318
|
}): void;
|
|
319
|
-
setIsBrandPageLoaded(isLoaded: boolean): void;
|
|
320
319
|
setIsModifiedAfterTemplateApplied({ isModified, }?: import("../../stores").SetIsModifiedPayload): void;
|
|
321
320
|
setSelectedTemplateId(payload: {
|
|
322
321
|
templateId: string | false;
|
|
@@ -315,7 +315,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
315
315
|
setIsInitialising(payload: {
|
|
316
316
|
isInitialising: boolean;
|
|
317
317
|
}): void;
|
|
318
|
-
setIsBrandPageLoaded(isLoaded: boolean): void;
|
|
319
318
|
setIsModifiedAfterTemplateApplied({ isModified, }?: import("../../stores").SetIsModifiedPayload): void;
|
|
320
319
|
setSelectedTemplateId(payload: {
|
|
321
320
|
templateId: string | false;
|
|
@@ -89,7 +89,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
89
89
|
setIsInitialising(payload: {
|
|
90
90
|
isInitialising: boolean;
|
|
91
91
|
}): void;
|
|
92
|
-
setIsBrandPageLoaded(isLoaded: boolean): void;
|
|
93
92
|
setIsModifiedAfterTemplateApplied({ isModified, }?: import("../../stores").SetIsModifiedPayload): void;
|
|
94
93
|
setSelectedTemplateId(payload: {
|
|
95
94
|
templateId: string | false;
|
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
/// <reference types="types/lodash-shims" />
|
|
2
2
|
import type { PropType } from 'vue';
|
|
3
|
-
import type {
|
|
3
|
+
import type { BrandPageViewModel, LogoImageModel, LogoTemplateImageModel, LogoTheme, UserPersonalisation } from '../../../brand-page';
|
|
4
4
|
import type { TemplateSettingsTemplate } from '../../../shared/template-settings/models';
|
|
5
5
|
import type { DebounceHandle } from 'lodash.debounce';
|
|
6
|
-
interface TemplatePreviewData {
|
|
7
|
-
containerStyle:
|
|
6
|
+
export interface TemplatePreviewData {
|
|
7
|
+
containerStyle: Record<string, string>;
|
|
8
8
|
debouncedOnResize?: DebounceHandle;
|
|
9
9
|
resizeObserver?: ResizeObserver;
|
|
10
|
-
viewModel?: BrandPageViewModel;
|
|
11
10
|
resized: boolean;
|
|
12
11
|
scale: number;
|
|
13
|
-
mobileRenderHeight: number;
|
|
14
|
-
desktopRenderHeight: number;
|
|
15
12
|
renderHeight: number;
|
|
16
13
|
renderWidth: number;
|
|
17
|
-
|
|
14
|
+
imageLoadError: boolean;
|
|
18
15
|
}
|
|
19
16
|
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
20
17
|
logoImage: {
|
|
@@ -131,7 +128,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
131
128
|
setIsInitialising(payload: {
|
|
132
129
|
isInitialising: boolean;
|
|
133
130
|
}): void;
|
|
134
|
-
setIsBrandPageLoaded(isLoaded: boolean): void;
|
|
135
131
|
setIsModifiedAfterTemplateApplied({ isModified, }?: import("../../stores").SetIsModifiedPayload): void;
|
|
136
132
|
setSelectedTemplateId(payload: {
|
|
137
133
|
templateId: string | false;
|
|
@@ -187,17 +183,20 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
187
183
|
selectInitialCategories(payload: import("../../../shared/template-settings/models").InitialCategories): void;
|
|
188
184
|
}>;
|
|
189
185
|
}, TemplatePreviewData, {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
186
|
+
scaledContainerStyle(): Record<string, string>;
|
|
187
|
+
innerContainerStyle(): Record<string, string>;
|
|
188
|
+
previewImageUrl(): string;
|
|
189
|
+
themeFilterStyle(): Record<string, string>;
|
|
194
190
|
isPersonalisable(): boolean;
|
|
195
|
-
cssVariablesStyle(): Record<string, string>;
|
|
196
191
|
}, {
|
|
197
192
|
onOverlayClicked(): void;
|
|
198
193
|
onResize(): void;
|
|
199
|
-
|
|
200
|
-
|
|
194
|
+
onImageError(): void;
|
|
195
|
+
onImageLoad(): void;
|
|
196
|
+
generatePreviewImageUrl(): string;
|
|
197
|
+
getPreviewBaseUrl(): string;
|
|
198
|
+
regeneratePreview(): void;
|
|
199
|
+
generateFullViewModel(): Promise<BrandPageViewModel>;
|
|
201
200
|
}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "template-selected"[], "template-selected", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
202
201
|
logoImage: {
|
|
203
202
|
type: PropType<LogoImageModel>;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { computed, defineComponent } from 'vue';
|
|
2
|
-
import { BRAND_PAGE_TYPES, MEDIA_SIZES, VIEWPORTS } from '../../../brand-page';
|
|
3
2
|
import { applyLogoThemeToBrandPageModel, applyUserPersonalisationToBrandPageModelAsync, getBrandPageViewModelFromBrandPageModel, } from '../../../brand-page/utils';
|
|
4
|
-
import { STYLE_THEME_KEYS } from '../../../brand-page/constants';
|
|
5
3
|
import debounce from 'lodash.debounce';
|
|
6
4
|
import { MOBILE_HEIGHT, MOBILE_WIDTH } from '../../constants';
|
|
7
5
|
import { useBrandPageMakerStore } from '../../stores';
|
|
@@ -66,51 +64,13 @@ export default defineComponent({
|
|
|
66
64
|
debouncedOnResize: undefined,
|
|
67
65
|
resized: false,
|
|
68
66
|
scale: 1,
|
|
69
|
-
mobileRenderHeight: 650,
|
|
70
|
-
desktopRenderHeight: 900,
|
|
71
67
|
renderHeight: 900,
|
|
72
68
|
renderWidth: 400,
|
|
73
|
-
|
|
74
|
-
viewModel: undefined,
|
|
69
|
+
imageLoadError: false,
|
|
75
70
|
};
|
|
76
71
|
return data;
|
|
77
72
|
},
|
|
78
73
|
computed: {
|
|
79
|
-
context() {
|
|
80
|
-
return {
|
|
81
|
-
isTemplate: true,
|
|
82
|
-
isPreview: true,
|
|
83
|
-
isProduction: true,
|
|
84
|
-
isDesignCom: false,
|
|
85
|
-
isServerRender: false,
|
|
86
|
-
brandPageSlug: '',
|
|
87
|
-
brandPageToken: this.viewModel?.brandPageToken,
|
|
88
|
-
runtimeEnvironment: '',
|
|
89
|
-
stripePublishableKey: undefined,
|
|
90
|
-
pageTitle: this.brandPageTitle,
|
|
91
|
-
pages: this.viewModel?.pages || [],
|
|
92
|
-
currentPageSlug: this.viewModel?.pages[0]?.slug || '',
|
|
93
|
-
customDomain: undefined,
|
|
94
|
-
brandPageType: this.viewModel?.brandPageType || BRAND_PAGE_TYPES.default,
|
|
95
|
-
isBrandPage: this.viewModel?.brandPageType === BRAND_PAGE_TYPES.default,
|
|
96
|
-
isBrandPageOrIsBrandContact: this.viewModel?.brandPageType === BRAND_PAGE_TYPES.default ||
|
|
97
|
-
this.viewModel?.brandPageType === BRAND_PAGE_TYPES.brandContact,
|
|
98
|
-
isBrandSite: this.viewModel?.brandPageType === BRAND_PAGE_TYPES.brandSite,
|
|
99
|
-
isBrandContact: this.viewModel?.brandPageType === BRAND_PAGE_TYPES.brandContact,
|
|
100
|
-
options: {
|
|
101
|
-
disableNavigationSideMenu: true,
|
|
102
|
-
mediaSizes: MEDIA_SIZES.sizeThumb,
|
|
103
|
-
},
|
|
104
|
-
isCapturingPreview: false,
|
|
105
|
-
};
|
|
106
|
-
},
|
|
107
|
-
previewViewport() {
|
|
108
|
-
if (!this.viewModel?.brandPageType ||
|
|
109
|
-
this.viewModel?.brandPageType === BRAND_PAGE_TYPES.default) {
|
|
110
|
-
return VIEWPORTS.mobile;
|
|
111
|
-
}
|
|
112
|
-
return VIEWPORTS.desktop;
|
|
113
|
-
},
|
|
114
74
|
scaledContainerStyle() {
|
|
115
75
|
return {
|
|
116
76
|
transform: 'scale(' + this.scale + ')',
|
|
@@ -121,44 +81,49 @@ export default defineComponent({
|
|
|
121
81
|
return {
|
|
122
82
|
width: `${this.renderWidth}px`,
|
|
123
83
|
height: `${this.renderHeight}px`,
|
|
124
|
-
...this.rootStyles,
|
|
125
|
-
backgroundAttachment: 'scroll',
|
|
126
84
|
position: 'relative',
|
|
127
85
|
};
|
|
128
86
|
},
|
|
129
|
-
|
|
130
|
-
return this.
|
|
87
|
+
previewImageUrl() {
|
|
88
|
+
return this.generatePreviewImageUrl();
|
|
131
89
|
},
|
|
132
|
-
|
|
133
|
-
if (!this.logoTheme) {
|
|
90
|
+
themeFilterStyle() {
|
|
91
|
+
if (!this.logoTheme?.logoBackgroundColor?.hsl) {
|
|
134
92
|
return {};
|
|
135
93
|
}
|
|
136
|
-
const
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
cssVariables[`--${value}`] = themeColor.rgb;
|
|
144
|
-
}
|
|
145
|
-
});
|
|
146
|
-
return cssVariables;
|
|
94
|
+
const hue = this.logoTheme.logoBackgroundColor.hsl.h;
|
|
95
|
+
return {
|
|
96
|
+
filter: `hue-rotate(${hue}deg)`,
|
|
97
|
+
};
|
|
98
|
+
},
|
|
99
|
+
isPersonalisable() {
|
|
100
|
+
return this.template.isPersonalisable || false;
|
|
147
101
|
},
|
|
148
102
|
},
|
|
149
103
|
watch: {
|
|
150
|
-
|
|
104
|
+
template() {
|
|
105
|
+
this.regeneratePreview();
|
|
106
|
+
},
|
|
107
|
+
logoImage: {
|
|
151
108
|
handler() {
|
|
152
|
-
this.
|
|
109
|
+
this.regeneratePreview();
|
|
153
110
|
},
|
|
154
111
|
deep: true,
|
|
155
112
|
},
|
|
156
|
-
|
|
157
|
-
|
|
113
|
+
logoTemplateImage: {
|
|
114
|
+
handler() {
|
|
115
|
+
this.regeneratePreview();
|
|
116
|
+
},
|
|
117
|
+
deep: true,
|
|
118
|
+
},
|
|
119
|
+
logoTheme: {
|
|
120
|
+
handler() {
|
|
121
|
+
this.regeneratePreview();
|
|
122
|
+
},
|
|
123
|
+
deep: true,
|
|
158
124
|
},
|
|
159
125
|
},
|
|
160
126
|
created() {
|
|
161
|
-
this.updateViewModel(false);
|
|
162
127
|
this.debouncedOnResize = debounce(this.onResize, DEBOUNCE_IN_MS);
|
|
163
128
|
this.$nextTick(() => {
|
|
164
129
|
this.resized = true;
|
|
@@ -192,10 +157,34 @@ export default defineComponent({
|
|
|
192
157
|
this.scale = container.clientWidth / this.renderWidth;
|
|
193
158
|
this.containerStyle.height = `${this.renderHeight * this.scale}px`;
|
|
194
159
|
},
|
|
195
|
-
|
|
196
|
-
|
|
160
|
+
onImageError() {
|
|
161
|
+
console.warn(`Failed to load preview image for template ${this.template.id}`);
|
|
162
|
+
this.imageLoadError = true;
|
|
163
|
+
},
|
|
164
|
+
onImageLoad() {
|
|
165
|
+
this.imageLoadError = false;
|
|
166
|
+
},
|
|
167
|
+
generatePreviewImageUrl() {
|
|
168
|
+
const baseUrl = this.getPreviewBaseUrl();
|
|
169
|
+
const logoDraftToken = this.logoImage?.logoDraftToken ||
|
|
170
|
+
'0B660926-D94A-4E29-99D1-F07E67AA6E49';
|
|
171
|
+
return `${baseUrl}/preview/template/${this.template.id}/${logoDraftToken}?deviceType=mobile`;
|
|
172
|
+
},
|
|
173
|
+
getPreviewBaseUrl() {
|
|
174
|
+
let domainSuffix = '.brand.page';
|
|
175
|
+
if (this.brandPageMakerStore.brandPageType === 'brandSite') {
|
|
176
|
+
domainSuffix = '.brand.site';
|
|
177
|
+
}
|
|
178
|
+
else if (this.brandPageMakerStore.brandPageType === 'brandContact') {
|
|
179
|
+
domainSuffix = '.brand.contact';
|
|
180
|
+
}
|
|
181
|
+
return `https://preview-${window.location.hostname}${domainSuffix}`;
|
|
197
182
|
},
|
|
198
|
-
|
|
183
|
+
regeneratePreview() {
|
|
184
|
+
this.imageLoadError = false;
|
|
185
|
+
this.$forceUpdate();
|
|
186
|
+
},
|
|
187
|
+
async generateFullViewModel() {
|
|
199
188
|
let model = this.template.brandPageModel;
|
|
200
189
|
if (this.logoImageBase64Url) {
|
|
201
190
|
model = applyLogoImageBase64UrlToBrandPageTemplateModel(model, this.logoImageBase64Url);
|
|
@@ -211,10 +200,7 @@ export default defineComponent({
|
|
|
211
200
|
model = result.model;
|
|
212
201
|
}
|
|
213
202
|
model = applyLogoThemeToBrandPageModel(this.logoTheme, model).model;
|
|
214
|
-
|
|
215
|
-
if (forceUpdate) {
|
|
216
|
-
this.$forceUpdate();
|
|
217
|
-
}
|
|
203
|
+
return await getBrandPageViewModelFromBrandPageModel(model, undefined, false);
|
|
218
204
|
},
|
|
219
205
|
},
|
|
220
206
|
});
|
|
@@ -37,7 +37,6 @@ export interface BrandPageMakerState {
|
|
|
37
37
|
isPageNavigating: boolean;
|
|
38
38
|
isChangeTemplateConfirmModalVisible: boolean;
|
|
39
39
|
isInitialising: boolean;
|
|
40
|
-
isBrandPageLoaded: boolean;
|
|
41
40
|
isModifiedAfterTemplateApplied: boolean;
|
|
42
41
|
notificationMessageQueue: NotificationMessage[];
|
|
43
42
|
selectedTemplateId: string | false;
|
|
@@ -153,7 +152,6 @@ export declare const useBrandPageMakerStore: import("pinia").StoreDefinition<"br
|
|
|
153
152
|
setIsInitialising(payload: {
|
|
154
153
|
isInitialising: boolean;
|
|
155
154
|
}): void;
|
|
156
|
-
setIsBrandPageLoaded(isLoaded: boolean): void;
|
|
157
155
|
setIsModifiedAfterTemplateApplied({ isModified, }?: SetIsModifiedPayload): void;
|
|
158
156
|
setSelectedTemplateId(payload: {
|
|
159
157
|
templateId: string | false;
|
|
@@ -46,7 +46,6 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
|
|
|
46
46
|
isApplyingTemplate: false,
|
|
47
47
|
isChangeTemplateConfirmModalVisible: false,
|
|
48
48
|
isInitialising: false,
|
|
49
|
-
isBrandPageLoaded: false,
|
|
50
49
|
isPageNavigating: false,
|
|
51
50
|
isModifiedAfterTemplateApplied: false,
|
|
52
51
|
notificationMessageQueue: [],
|
|
@@ -142,9 +141,6 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
|
|
|
142
141
|
setIsInitialising(payload) {
|
|
143
142
|
this.isInitialising = payload.isInitialising;
|
|
144
143
|
},
|
|
145
|
-
setIsBrandPageLoaded(isLoaded) {
|
|
146
|
-
this.isBrandPageLoaded = isLoaded;
|
|
147
|
-
},
|
|
148
144
|
setIsModifiedAfterTemplateApplied({ isModified, } = {}) {
|
|
149
145
|
const sideBarStore = useUiSideBarStore();
|
|
150
146
|
if (this.isApplyingTemplate ||
|