@designcrowd/library.brand-page 5.15.17-ast-previews → 5.15.17

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 (96) hide show
  1. package/lib/src/{CreatedOnBrandCrowd-de-de-DhqVq1R4.js → CreatedOnBrandCrowd-de-de-DwjHHx8U.js} +1 -1
  2. package/lib/src/{CreatedOnBrandCrowd-en-us-gHKO7Euu.js → CreatedOnBrandCrowd-en-us-wnQWDaLj.js} +1 -1
  3. package/lib/src/{CreatedOnBrandCrowd-es-es-BiqMA1-P.js → CreatedOnBrandCrowd-es-es-BPLwmFYf.js} +1 -1
  4. package/lib/src/{CreatedOnBrandCrowd-fr-fr-DeD80sNd.js → CreatedOnBrandCrowd-fr-ca-ZLo9mFvK.js} +1 -1
  5. package/lib/src/{CreatedOnBrandCrowd-fr-ca-DeD80sNd.js → CreatedOnBrandCrowd-fr-fr-ZLo9mFvK.js} +1 -1
  6. package/lib/src/{CreatedOnBrandCrowd-pt-pt-FYtTRyJj.js → CreatedOnBrandCrowd-pt-br-PeE8kWqc.js} +1 -1
  7. package/lib/src/{CreatedOnBrandCrowd-pt-br-FYtTRyJj.js → CreatedOnBrandCrowd-pt-pt-PeE8kWqc.js} +1 -1
  8. package/lib/src/{CreatedOnDcom-de-de-DiyaqKgn.js → CreatedOnDcom-de-de-DckpvOP7.js} +1 -1
  9. package/lib/src/{CreatedOnDcom-en-us-BsH92alk.js → CreatedOnDcom-en-us-CFzquTUz.js} +1 -1
  10. package/lib/src/{CreatedOnDcom-es-es-DXv36XgZ.js → CreatedOnDcom-es-es-BpbcQQtf.js} +1 -1
  11. package/lib/src/{CreatedOnDcom-fr-ca-DwCGXfKv.js → CreatedOnDcom-fr-ca-bV4zOxfZ.js} +1 -1
  12. package/lib/src/{CreatedOnDcom-fr-fr-zHQ4Y1xm.js → CreatedOnDcom-fr-fr-dGkZsGAG.js} +1 -1
  13. package/lib/src/{CreatedOnDcom-pt-br-CZoYGQlg.js → CreatedOnDcom-pt-br-C2hFs0vl.js} +1 -1
  14. package/lib/src/{CreatedOnDcom-pt-pt-BZOFxo9Q.js → CreatedOnDcom-pt-pt-VWtI0WwK.js} +1 -1
  15. package/lib/src/brand-page/utils/migration/migration-07.js +1 -1
  16. package/lib/src/brand-page-maker/components/action-bar/ActionBar.mixin.d.ts +1 -0
  17. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.d.ts +5 -1
  18. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.js +36 -3
  19. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMakerTemplateSettings.mixin.d.ts +1 -0
  20. package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.d.ts +1 -0
  21. package/lib/src/brand-page-maker/components/brandpage-settings/ReplaceImageSettingsForBrandPageSettings.mixin.d.ts +1 -0
  22. package/lib/src/brand-page-maker/components/seo-settings/SeoPageSettings.mixin.d.ts +1 -0
  23. package/lib/src/brand-page-maker/components/seo-settings/UrlSettings.mixin.d.ts +1 -0
  24. package/lib/src/brand-page-maker/components/social-share/SocialShare.mixin.d.ts +1 -0
  25. package/lib/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.d.ts +15 -14
  26. package/lib/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.js +70 -56
  27. package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.d.ts +2 -0
  28. package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.js +4 -0
  29. package/lib/src/bundled-translations-GvfzVUdP.js +161 -0
  30. package/lib/src/bundled-translations.de-DE-CbdKWmRe.js +161 -0
  31. package/lib/src/bundled-translations.es-ES-nP95fALh.js +161 -0
  32. package/lib/src/bundled-translations.fr-CA-HvN6Ib_d.js +161 -0
  33. package/lib/src/bundled-translations.fr-FR-C6X4Au0M.js +161 -0
  34. package/lib/src/bundled-translations.pt-BR-DLC1LHBm.js +161 -0
  35. package/lib/src/bundled-translations.pt-PT-CDT0Os9V.js +161 -0
  36. package/lib/src/bundles/bundled-translations.de-DE.json +0 -3
  37. package/lib/src/bundles/bundled-translations.es-ES.json +0 -3
  38. package/lib/src/bundles/bundled-translations.fr-CA.json +0 -3
  39. package/lib/src/bundles/bundled-translations.fr-FR.json +0 -3
  40. package/lib/src/bundles/bundled-translations.json +0 -3
  41. package/lib/src/bundles/bundled-translations.pt-BR.json +0 -3
  42. package/lib/src/bundles/bundled-translations.pt-PT.json +0 -3
  43. package/lib/src/clients/asset-library-clients.d.ts +2 -0
  44. package/lib/src/clients/asset-library-clients.js +15 -0
  45. package/lib/src/css/library.brand-page-brandCrowd.min.css +33 -42
  46. package/lib/src/css/library.brand-page-brandPage.min.css +33 -42
  47. package/lib/src/css/library.brand-page-designCom.min.css +33 -42
  48. package/lib/src/css/library.brand-page-preview.min.css +33 -42
  49. package/lib/src/index.mjs +1 -1
  50. package/lib/src/{lib-7x9ead9m.js → lib-DaxXE-vZ.js} +7845 -7790
  51. package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.d.ts +1 -0
  52. package/lib/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.mixin.d.ts +1 -0
  53. package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.d.ts +1 -0
  54. package/lib/src/shared/logo-settings/components/LogoSettings.mixin.d.ts +1 -0
  55. package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.d.ts +1 -0
  56. package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.d.ts +1 -0
  57. package/lib/src/shared/publish-brand-page-with-state/PublishBrandPageModalWithState.mixin.d.ts +1 -0
  58. package/lib/src/shared/publish-brand-page-with-state/PublishBrandPageModalWithState.mixin.js +2 -1
  59. package/lib/src/shared/side-bar/components/SideBar.mixin.d.ts +1 -0
  60. package/lib/src/shared/side-bar/components/SideBar.mixin.js +6 -1
  61. package/lib/src/shared/style-settings/components/StyleSettings.mixin.d.ts +1 -0
  62. package/package.json +2 -2
  63. package/src/brand-page/components/page/Page.vue +2 -2
  64. package/src/brand-page/utils/migration/migration-07.ts +4 -6
  65. package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.ts +40 -4
  66. package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.vue +9 -1
  67. package/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.ts +90 -70
  68. package/src/brand-page-maker/components/template-preview/TemplatePreview.vue +17 -16
  69. package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.ts +5 -0
  70. package/src/bundles/bundled-translations.de-DE.json +0 -3
  71. package/src/bundles/bundled-translations.es-ES.json +0 -3
  72. package/src/bundles/bundled-translations.fr-CA.json +0 -3
  73. package/src/bundles/bundled-translations.fr-FR.json +0 -3
  74. package/src/bundles/bundled-translations.json +0 -3
  75. package/src/bundles/bundled-translations.pt-BR.json +0 -3
  76. package/src/bundles/bundled-translations.pt-PT.json +0 -3
  77. package/src/clients/asset-library-clients.ts +20 -0
  78. package/src/shared/common/i18n/common.de-DE.json +0 -3
  79. package/src/shared/common/i18n/common.es-ES.json +0 -3
  80. package/src/shared/common/i18n/common.fr-CA.json +0 -3
  81. package/src/shared/common/i18n/common.fr-FR.json +0 -3
  82. package/src/shared/common/i18n/common.json +0 -3
  83. package/src/shared/common/i18n/common.pt-BR.json +0 -3
  84. package/src/shared/common/i18n/common.pt-PT.json +0 -3
  85. package/src/shared/content-settings/components/draggable-item-list/DraggableItemList.vue +3 -8
  86. package/src/shared/content-settings/components/text-items-field/TextItemsField.vue +2 -8
  87. package/src/shared/publish-brand-page-with-state/PublishBrandPageModalWithState.mixin.ts +2 -1
  88. package/src/shared/side-bar/components/SideBar.mixin.ts +7 -0
  89. package/src/shared/side-bar/components/SideBar.vue +9 -1
  90. package/lib/src/bundled-translations-wzmaFfsm.js +0 -161
  91. package/lib/src/bundled-translations.de-DE-BNwDY0Gw.js +0 -161
  92. package/lib/src/bundled-translations.es-ES-DTvCIjvS.js +0 -161
  93. package/lib/src/bundled-translations.fr-CA-5oL4PLEx.js +0 -161
  94. package/lib/src/bundled-translations.fr-FR-DWL7DJQp.js +0 -161
  95. package/lib/src/bundled-translations.pt-BR-CDj0L4EF.js +0 -161
  96. package/lib/src/bundled-translations.pt-PT-M916KJYD.js +0 -161
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as e, openBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-7x9ead9m.js";
2
+ import { _ as t } from "./lib-DaxXE-vZ.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-7x9ead9m.js";
2
+ import { _ as t } from "./lib-DaxXE-vZ.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-7x9ead9m.js";
2
+ import { _ as t } from "./lib-DaxXE-vZ.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-7x9ead9m.js";
2
+ import { _ as t } from "./lib-DaxXE-vZ.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-7x9ead9m.js";
2
+ import { _ as t } from "./lib-DaxXE-vZ.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-7x9ead9m.js";
2
+ import { _ as t } from "./lib-DaxXE-vZ.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-7x9ead9m.js";
2
+ import { _ as t } from "./lib-DaxXE-vZ.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-7x9ead9m.js";
2
+ import { _ as e } from "./lib-DaxXE-vZ.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-7x9ead9m.js";
2
+ import { _ as e } from "./lib-DaxXE-vZ.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-7x9ead9m.js";
2
+ import { _ as e } from "./lib-DaxXE-vZ.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-7x9ead9m.js";
2
+ import { _ as e } from "./lib-DaxXE-vZ.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-7x9ead9m.js";
2
+ import { _ as e } from "./lib-DaxXE-vZ.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-7x9ead9m.js";
2
+ import { _ as M } from "./lib-DaxXE-vZ.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-7x9ead9m.js";
2
+ import { _ as M } from "./lib-DaxXE-vZ.js";
3
3
  const Z = {}, e = {
4
4
  width: "232",
5
5
  height: "36",
@@ -1,4 +1,4 @@
1
- import { BRAND_PAGE_TYPES, DEFAULT_LOGO_HEIGHT, DEFAULT_LOGO_WIDTH, } from '../..';
1
+ import { BRAND_PAGE_TYPES, DEFAULT_LOGO_HEIGHT, DEFAULT_LOGO_WIDTH, PageFooterDesktop, PageFooterMobile, PageHeaderDesktop, PageHeaderMobile, } 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,6 +82,7 @@ declare const _default: import("vue").DefineComponent<{}, {
82
82
  setIsInitialising(payload: {
83
83
  isInitialising: boolean;
84
84
  }): void;
85
+ setIsBrandPageLoaded(isLoaded: boolean): void;
85
86
  setIsModifiedAfterTemplateApplied({ isModified, }?: import("../../stores").SetIsModifiedPayload): void;
86
87
  setSelectedTemplateId(payload: {
87
88
  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 BrandPageType, type ViewportsType, type UserPersonalisationContent } from '../../../brand-page';
4
+ import { type BrandPageData, 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,6 +10,7 @@ import type { UpdateItemValuePayload } from '../../../shared/content-settings/mo
10
10
  export interface BrandPageMakerViewModel {
11
11
  adminPreviewLogoTemplateModels?: AdminPreviewLogoTemplateModel[];
12
12
  brandPageData?: string;
13
+ brandPageMetadataS3Url?: string;
13
14
  emailAddress: string;
14
15
  features: UserFeatures;
15
16
  logoVariationImageUrls: string[];
@@ -124,6 +125,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
124
125
  setIsInitialising(payload: {
125
126
  isInitialising: boolean;
126
127
  }): void;
128
+ setIsBrandPageLoaded(isLoaded: boolean): void;
127
129
  setIsModifiedAfterTemplateApplied({ isModified, }?: import("../../stores").SetIsModifiedPayload): void;
128
130
  setSelectedTemplateId(payload: {
129
131
  templateId: string | false;
@@ -1136,11 +1138,13 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
1136
1138
  router: import("vue-router").Router;
1137
1139
  }, {
1138
1140
  mounted: boolean;
1141
+ isBrandPageLoaded: boolean;
1139
1142
  debounceOnResize: DebounceHandle | undefined;
1140
1143
  showSaveSuccessMessage: boolean;
1141
1144
  }, {
1142
1145
  previewContainer(): any;
1143
1146
  }, {
1147
+ getBrandPageFromFallback(viewModel: any): BrandPageData;
1144
1148
  onResizeWithDebounce(): void;
1145
1149
  onResize(): void;
1146
1150
  setUiScreenSizeModeBasedOnDeviceWidth(): void;
@@ -16,6 +16,7 @@ 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';
19
20
  import { useShopConfigStore } from '../../../shared/ecommerce-settings/store/shop-settings-store';
20
21
  import { useProductConfigStore } from '../../../brand-page-maker/stores/product-config/product-config-store';
21
22
  import { UPGRADE_CTA_LOCATIONS } from '../../composables/useEventTracker';
@@ -83,6 +84,7 @@ export default defineComponent({
83
84
  data() {
84
85
  return {
85
86
  mounted: false,
87
+ isBrandPageLoaded: false,
86
88
  debounceOnResize: undefined,
87
89
  showSaveSuccessMessage: false,
88
90
  };
@@ -97,9 +99,22 @@ export default defineComponent({
97
99
  typeof this.viewModel?.logoDraftDesignAttributes.logoTheme !== 'object') {
98
100
  console.error('logo theme is missing');
99
101
  }
100
- const brandPage = typeof this.viewModel?.brandPageData === 'string'
101
- ? JSON.parse(this.viewModel.brandPageData)
102
- : createInitialBrandPage(this.viewModel.brandPageType);
102
+ let brandPage;
103
+ if (this.viewModel?.brandPageMetadataS3Url) {
104
+ const assetClient = new AssetLibraryClient({
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
+ }
103
118
  const shopConfigData = this.viewModel?.shopConfigData?.trim()
104
119
  ? JSON.parse(this.viewModel.shopConfigData)
105
120
  : null;
@@ -147,6 +162,16 @@ export default defineComponent({
147
162
  navigateToPageBySlug(this.brandPageViewModel.pages[0].slug);
148
163
  }
149
164
  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
+ }
150
175
  this.$emit(EVENTS.Initialised);
151
176
  },
152
177
  mounted() {
@@ -173,6 +198,14 @@ export default defineComponent({
173
198
  }, 800);
174
199
  },
175
200
  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
+ },
176
209
  onResizeWithDebounce() {
177
210
  if (this.debounceOnResize) {
178
211
  this.debounceOnResize();
@@ -72,6 +72,7 @@ declare const _default: import("vue").DefineComponent<{}, {
72
72
  setIsInitialising(payload: {
73
73
  isInitialising: boolean;
74
74
  }): void;
75
+ setIsBrandPageLoaded(isLoaded: boolean): void;
75
76
  setIsModifiedAfterTemplateApplied({ isModified, }?: import("../../stores").SetIsModifiedPayload): void;
76
77
  setSelectedTemplateId(payload: {
77
78
  templateId: string | false;
@@ -577,6 +577,7 @@ declare const _default: import("vue").DefineComponent<{}, {
577
577
  setIsInitialising(payload: {
578
578
  isInitialising: boolean;
579
579
  }): void;
580
+ setIsBrandPageLoaded(isLoaded: boolean): void;
580
581
  setIsModifiedAfterTemplateApplied({ isModified, }?: import("../../stores").SetIsModifiedPayload): void;
581
582
  setSelectedTemplateId(payload: {
582
583
  templateId: string | false;
@@ -79,6 +79,7 @@ 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;
82
83
  setIsModifiedAfterTemplateApplied({ isModified, }?: import("../../stores").SetIsModifiedPayload): void;
83
84
  setSelectedTemplateId(payload: {
84
85
  templateId: string | false;
@@ -316,6 +316,7 @@ 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;
319
320
  setIsModifiedAfterTemplateApplied({ isModified, }?: import("../../stores").SetIsModifiedPayload): void;
320
321
  setSelectedTemplateId(payload: {
321
322
  templateId: string | false;
@@ -315,6 +315,7 @@ 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;
318
319
  setIsModifiedAfterTemplateApplied({ isModified, }?: import("../../stores").SetIsModifiedPayload): void;
319
320
  setSelectedTemplateId(payload: {
320
321
  templateId: string | false;
@@ -89,6 +89,7 @@ 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;
92
93
  setIsModifiedAfterTemplateApplied({ isModified, }?: import("../../stores").SetIsModifiedPayload): void;
93
94
  setSelectedTemplateId(payload: {
94
95
  templateId: string | false;
@@ -1,17 +1,20 @@
1
1
  /// <reference types="types/lodash-shims" />
2
2
  import type { PropType } from 'vue';
3
- import type { BrandPageViewModel, LogoImageModel, LogoTemplateImageModel, LogoTheme, UserPersonalisation } from '../../../brand-page';
3
+ import type { BrandPageContext, 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
- export interface TemplatePreviewData {
7
- containerStyle: Record<string, string>;
6
+ interface TemplatePreviewData {
7
+ containerStyle: BrandPageCssStyle;
8
8
  debouncedOnResize?: DebounceHandle;
9
9
  resizeObserver?: ResizeObserver;
10
+ viewModel?: BrandPageViewModel;
10
11
  resized: boolean;
11
12
  scale: number;
13
+ mobileRenderHeight: number;
14
+ desktopRenderHeight: number;
12
15
  renderHeight: number;
13
16
  renderWidth: number;
14
- imageLoadError: boolean;
17
+ rootStyles: BrandPageCssStyle;
15
18
  }
16
19
  declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
17
20
  logoImage: {
@@ -128,6 +131,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
128
131
  setIsInitialising(payload: {
129
132
  isInitialising: boolean;
130
133
  }): void;
134
+ setIsBrandPageLoaded(isLoaded: boolean): void;
131
135
  setIsModifiedAfterTemplateApplied({ isModified, }?: import("../../stores").SetIsModifiedPayload): void;
132
136
  setSelectedTemplateId(payload: {
133
137
  templateId: string | false;
@@ -183,20 +187,17 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
183
187
  selectInitialCategories(payload: import("../../../shared/template-settings/models").InitialCategories): void;
184
188
  }>;
185
189
  }, TemplatePreviewData, {
186
- scaledContainerStyle(): Record<string, string>;
187
- innerContainerStyle(): Record<string, string>;
188
- previewImageUrl(): string;
189
- themeFilterStyle(): Record<string, string>;
190
+ context(): BrandPageContext;
191
+ previewViewport(): string;
192
+ scaledContainerStyle(): BrandPageCssStyle;
193
+ innerContainerStyle(): BrandPageCssStyle;
190
194
  isPersonalisable(): boolean;
195
+ cssVariablesStyle(): Record<string, string>;
191
196
  }, {
192
197
  onOverlayClicked(): void;
193
198
  onResize(): void;
194
- onImageError(): void;
195
- onImageLoad(): void;
196
- generatePreviewImageUrl(): string;
197
- getPreviewBaseUrl(): string;
198
- regeneratePreview(): void;
199
- generateFullViewModel(): Promise<BrandPageViewModel>;
199
+ onSetPreviewStyles(styles: BrandPageCssStyle): void;
200
+ updateViewModel(forceUpdate?: boolean): Promise<void>;
200
201
  }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "template-selected"[], "template-selected", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
201
202
  logoImage: {
202
203
  type: PropType<LogoImageModel>;
@@ -1,5 +1,7 @@
1
1
  import { computed, defineComponent } from 'vue';
2
+ import { BRAND_PAGE_TYPES, MEDIA_SIZES, VIEWPORTS } from '../../../brand-page';
2
3
  import { applyLogoThemeToBrandPageModel, applyUserPersonalisationToBrandPageModelAsync, getBrandPageViewModelFromBrandPageModel, } from '../../../brand-page/utils';
4
+ import { STYLE_THEME_KEYS } from '../../../brand-page/constants';
3
5
  import debounce from 'lodash.debounce';
4
6
  import { MOBILE_HEIGHT, MOBILE_WIDTH } from '../../constants';
5
7
  import { useBrandPageMakerStore } from '../../stores';
@@ -64,13 +66,51 @@ export default defineComponent({
64
66
  debouncedOnResize: undefined,
65
67
  resized: false,
66
68
  scale: 1,
69
+ mobileRenderHeight: 650,
70
+ desktopRenderHeight: 900,
67
71
  renderHeight: 900,
68
72
  renderWidth: 400,
69
- imageLoadError: false,
73
+ rootStyles: {},
74
+ viewModel: undefined,
70
75
  };
71
76
  return data;
72
77
  },
73
78
  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
+ },
74
114
  scaledContainerStyle() {
75
115
  return {
76
116
  transform: 'scale(' + this.scale + ')',
@@ -81,49 +121,44 @@ export default defineComponent({
81
121
  return {
82
122
  width: `${this.renderWidth}px`,
83
123
  height: `${this.renderHeight}px`,
124
+ ...this.rootStyles,
125
+ backgroundAttachment: 'scroll',
84
126
  position: 'relative',
85
127
  };
86
128
  },
87
- previewImageUrl() {
88
- return this.generatePreviewImageUrl();
129
+ isPersonalisable() {
130
+ return this.template.isPersonalisable || false;
89
131
  },
90
- themeFilterStyle() {
91
- if (!this.logoTheme?.logoBackgroundColor?.hsl) {
132
+ cssVariablesStyle() {
133
+ if (!this.logoTheme) {
92
134
  return {};
93
135
  }
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;
136
+ const cssVariables = {};
137
+ // Generate CSS variables for logo theme colors
138
+ Object.entries(STYLE_THEME_KEYS).forEach(([key, value]) => {
139
+ const themeColor = key.includes('Background')
140
+ ? this.logoTheme.logoBackgroundColor
141
+ : this.logoTheme.logoTextColor;
142
+ if (themeColor?.rgb) {
143
+ cssVariables[`--${value}`] = themeColor.rgb;
144
+ }
145
+ });
146
+ return cssVariables;
101
147
  },
102
148
  },
103
149
  watch: {
104
- template() {
105
- this.regeneratePreview();
106
- },
107
- logoImage: {
108
- handler() {
109
- this.regeneratePreview();
110
- },
111
- deep: true,
112
- },
113
- logoTemplateImage: {
114
- handler() {
115
- this.regeneratePreview();
116
- },
117
- deep: true,
118
- },
119
150
  logoTheme: {
120
151
  handler() {
121
- this.regeneratePreview();
152
+ this.updateViewModel();
122
153
  },
123
154
  deep: true,
124
155
  },
156
+ template() {
157
+ this.updateViewModel();
158
+ },
125
159
  },
126
160
  created() {
161
+ this.updateViewModel(false);
127
162
  this.debouncedOnResize = debounce(this.onResize, DEBOUNCE_IN_MS);
128
163
  this.$nextTick(() => {
129
164
  this.resized = true;
@@ -157,34 +192,10 @@ export default defineComponent({
157
192
  this.scale = container.clientWidth / this.renderWidth;
158
193
  this.containerStyle.height = `${this.renderHeight * this.scale}px`;
159
194
  },
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}`;
195
+ onSetPreviewStyles(styles) {
196
+ this.rootStyles = styles;
182
197
  },
183
- regeneratePreview() {
184
- this.imageLoadError = false;
185
- this.$forceUpdate();
186
- },
187
- async generateFullViewModel() {
198
+ async updateViewModel(forceUpdate = true) {
188
199
  let model = this.template.brandPageModel;
189
200
  if (this.logoImageBase64Url) {
190
201
  model = applyLogoImageBase64UrlToBrandPageTemplateModel(model, this.logoImageBase64Url);
@@ -200,7 +211,10 @@ export default defineComponent({
200
211
  model = result.model;
201
212
  }
202
213
  model = applyLogoThemeToBrandPageModel(this.logoTheme, model).model;
203
- return await getBrandPageViewModelFromBrandPageModel(model, undefined, false);
214
+ this.viewModel = await getBrandPageViewModelFromBrandPageModel(model, undefined, false);
215
+ if (forceUpdate) {
216
+ this.$forceUpdate();
217
+ }
204
218
  },
205
219
  },
206
220
  });
@@ -37,6 +37,7 @@ export interface BrandPageMakerState {
37
37
  isPageNavigating: boolean;
38
38
  isChangeTemplateConfirmModalVisible: boolean;
39
39
  isInitialising: boolean;
40
+ isBrandPageLoaded: boolean;
40
41
  isModifiedAfterTemplateApplied: boolean;
41
42
  notificationMessageQueue: NotificationMessage[];
42
43
  selectedTemplateId: string | false;
@@ -152,6 +153,7 @@ export declare const useBrandPageMakerStore: import("pinia").StoreDefinition<"br
152
153
  setIsInitialising(payload: {
153
154
  isInitialising: boolean;
154
155
  }): void;
156
+ setIsBrandPageLoaded(isLoaded: boolean): void;
155
157
  setIsModifiedAfterTemplateApplied({ isModified, }?: SetIsModifiedPayload): void;
156
158
  setSelectedTemplateId(payload: {
157
159
  templateId: string | false;
@@ -46,6 +46,7 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
46
46
  isApplyingTemplate: false,
47
47
  isChangeTemplateConfirmModalVisible: false,
48
48
  isInitialising: false,
49
+ isBrandPageLoaded: false,
49
50
  isPageNavigating: false,
50
51
  isModifiedAfterTemplateApplied: false,
51
52
  notificationMessageQueue: [],
@@ -141,6 +142,9 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
141
142
  setIsInitialising(payload) {
142
143
  this.isInitialising = payload.isInitialising;
143
144
  },
145
+ setIsBrandPageLoaded(isLoaded) {
146
+ this.isBrandPageLoaded = isLoaded;
147
+ },
144
148
  setIsModifiedAfterTemplateApplied({ isModified, } = {}) {
145
149
  const sideBarStore = useUiSideBarStore();
146
150
  if (this.isApplyingTemplate ||