@designcrowd/library.brand-page 5.15.19 → 5.15.21-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.
Files changed (32) hide show
  1. package/lib/src/{CreatedOnBrandCrowd-de-de-DD3ObRWo.js → CreatedOnBrandCrowd-de-de-B_xpayh-.js} +1 -1
  2. package/lib/src/{CreatedOnBrandCrowd-en-us-CBplGQp6.js → CreatedOnBrandCrowd-en-us-vUtxwgjD.js} +1 -1
  3. package/lib/src/{CreatedOnBrandCrowd-es-es-DJMz8f-I.js → CreatedOnBrandCrowd-es-es-F4XWuYlk.js} +1 -1
  4. package/lib/src/{CreatedOnBrandCrowd-fr-fr-C_MmRu4G.js → CreatedOnBrandCrowd-fr-ca-Dp3p64Ng.js} +1 -1
  5. package/lib/src/{CreatedOnBrandCrowd-fr-ca-C_MmRu4G.js → CreatedOnBrandCrowd-fr-fr-Dp3p64Ng.js} +1 -1
  6. package/lib/src/{CreatedOnBrandCrowd-pt-pt-4T9iN569.js → CreatedOnBrandCrowd-pt-br-DbvlKcTH.js} +1 -1
  7. package/lib/src/{CreatedOnBrandCrowd-pt-br-4T9iN569.js → CreatedOnBrandCrowd-pt-pt-DbvlKcTH.js} +1 -1
  8. package/lib/src/{CreatedOnDcom-de-de-CbNUacST.js → CreatedOnDcom-de-de-CI0CBxU6.js} +1 -1
  9. package/lib/src/{CreatedOnDcom-en-us-CaEyyD87.js → CreatedOnDcom-en-us-BeidG_AF.js} +1 -1
  10. package/lib/src/{CreatedOnDcom-es-es-DcV6ec9r.js → CreatedOnDcom-es-es-PGD92ujM.js} +1 -1
  11. package/lib/src/{CreatedOnDcom-fr-ca-CtOjmVPg.js → CreatedOnDcom-fr-ca-DDW5qahq.js} +1 -1
  12. package/lib/src/{CreatedOnDcom-fr-fr-RaSxMrZK.js → CreatedOnDcom-fr-fr-H9uwg24x.js} +1 -1
  13. package/lib/src/{CreatedOnDcom-pt-br-CtXTUBup.js → CreatedOnDcom-pt-br-DXzuBtQ6.js} +1 -1
  14. package/lib/src/{CreatedOnDcom-pt-pt-BjH7kv4x.js → CreatedOnDcom-pt-pt-DPNC6h9-.js} +1 -1
  15. package/lib/src/brand-page/utils/svg-shape.util.js +7 -1
  16. package/lib/src/brand-page-maker/components/brand-page-maker/__fixtures__/shape-fixture.js +24 -0
  17. package/lib/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.d.ts +227 -0
  18. package/lib/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.js +67 -5
  19. package/lib/src/css/library.brand-page-brandCrowd.min.css +34 -16
  20. package/lib/src/css/library.brand-page-brandPage.min.css +34 -16
  21. package/lib/src/css/library.brand-page-designCom.min.css +34 -16
  22. package/lib/src/css/library.brand-page-preview.min.css +34 -16
  23. package/lib/src/index.mjs +1 -1
  24. package/lib/src/{lib-D48JKE-R.js → lib-C-Ho4Aiu.js} +1964 -1898
  25. package/lib/src/shared/template-settings/store/template-settings-store.js +11 -4
  26. package/package.json +1 -1
  27. package/src/brand-page/components/brand-page-footer/BrandPageFooter.vue +18 -9
  28. package/src/brand-page/utils/svg-shape.util.ts +9 -1
  29. package/src/brand-page-maker/components/brand-page-maker/__fixtures__/shape-fixture.ts +24 -0
  30. package/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.ts +85 -5
  31. package/src/brand-page-maker/components/template-preview/TemplatePreview.vue +40 -4
  32. package/src/shared/template-settings/store/template-settings-store.ts +11 -6
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as e, openBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-D48JKE-R.js";
2
+ import { _ as t } from "./lib-C-Ho4Aiu.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-D48JKE-R.js";
2
+ import { _ as t } from "./lib-C-Ho4Aiu.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-D48JKE-R.js";
2
+ import { _ as t } from "./lib-C-Ho4Aiu.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-D48JKE-R.js";
2
+ import { _ as t } from "./lib-C-Ho4Aiu.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-D48JKE-R.js";
2
+ import { _ as t } from "./lib-C-Ho4Aiu.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-D48JKE-R.js";
2
+ import { _ as t } from "./lib-C-Ho4Aiu.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-D48JKE-R.js";
2
+ import { _ as t } from "./lib-C-Ho4Aiu.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-D48JKE-R.js";
2
+ import { _ as e } from "./lib-C-Ho4Aiu.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-D48JKE-R.js";
2
+ import { _ as e } from "./lib-C-Ho4Aiu.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-D48JKE-R.js";
2
+ import { _ as e } from "./lib-C-Ho4Aiu.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-D48JKE-R.js";
2
+ import { _ as e } from "./lib-C-Ho4Aiu.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-D48JKE-R.js";
2
+ import { _ as e } from "./lib-C-Ho4Aiu.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-D48JKE-R.js";
2
+ import { _ as M } from "./lib-C-Ho4Aiu.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-D48JKE-R.js";
2
+ import { _ as M } from "./lib-C-Ho4Aiu.js";
3
3
  const Z = {}, e = {
4
4
  width: "232",
5
5
  height: "36",
@@ -234,7 +234,13 @@ export const handleAttributes = (svgConfig, childElement) => {
234
234
  }
235
235
  let elementAttributeString = '';
236
236
  Object.keys(attributes).forEach((k) => {
237
- elementAttributeString += ` ${k}="${attributes[k]}"`;
237
+ const value = attributes[k];
238
+ // Remove quotes from URL references to prevent malformed HTML
239
+ let escapedValue = value;
240
+ if (typeof value === 'string' && value.includes('url(')) {
241
+ escapedValue = value.replace(/"/g, '').replace(/'/g, '');
242
+ }
243
+ elementAttributeString += ` ${k}="${escapedValue}"`;
238
244
  });
239
245
  childElement.properties = attributes;
240
246
  return {
@@ -12,6 +12,30 @@ export const SHAPES_RESPONSE = {
12
12
  isEnabledToAdmin: true,
13
13
  category: 'Badge',
14
14
  },
15
+ {
16
+ token: 'c8eeb978-b998-431b-9203-5a43f2f85bdf',
17
+ url: 'https://bcassetcdn.com/shapes/prod/c8eeb978-b998-431b-9203-5a43f2f85bdf.svg',
18
+ keepColor: false,
19
+ isEnabled: true,
20
+ isEnabledToAdmin: true,
21
+ category: 'Gradient',
22
+ },
23
+ {
24
+ token: '5d3f4e14-4f52-4a1a-85ec-8cd32f5ceae7',
25
+ url: 'https://bcassetcdn.com/shapes/prod/5d3f4e14-4f52-4a1a-85ec-8cd32f5ceae7.svg',
26
+ keepColor: false,
27
+ isEnabled: true,
28
+ isEnabledToAdmin: true,
29
+ category: 'Gradient',
30
+ },
31
+ {
32
+ token: '0031c50d-8940-4f50-a86e-04d191d4ec76',
33
+ url: 'https://bcassetcdn.com/shapes/prod/0031c50d-8940-4f50-a86e-04d191d4ec76.svg',
34
+ keepColor: false,
35
+ isEnabled: true,
36
+ isEnabledToAdmin: true,
37
+ category: 'Gradient',
38
+ },
15
39
  {
16
40
  token: '005d86ec-351b-4ac5-be07-17c8300d2022',
17
41
  url: 'https://bcassetcdn.com/shapes/prod/9ed5803f-c621-49fe-99ca-9c9b7c7b3050.svg',
@@ -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,7 @@ 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>;
64
67
  brandPageMakerStore: import("pinia").Store<"brandPageMaker", import("../../stores").BrandPageMakerState, {
65
68
  contentErrorCount(): number;
66
69
  brandPageBaseUrl(): string;
@@ -186,6 +189,224 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
186
189
  showStripeOnboardingModal(): Promise<void>;
187
190
  selectInitialCategories(payload: import("../../../shared/template-settings/models").InitialCategories): void;
188
191
  }>;
192
+ brandPageContainerStore: import("pinia").Store<"brandPageContainer", import("../../stores").BrandPageContainerState, {
193
+ brandPageContentTypes(): string[];
194
+ isAdmin(): boolean;
195
+ isPublished: (state: {
196
+ availableTaxes: any[];
197
+ brandPageBaseUrl: string;
198
+ baseFabricRenderUrl: string;
199
+ brandPageDescription: string;
200
+ brandPageDisplayName: string;
201
+ sensitiveContent: number;
202
+ brandPageSlug: string;
203
+ brandPageStatus: string;
204
+ brandPageToken: string | undefined;
205
+ brandPageTitle: string;
206
+ customDomain: {
207
+ id: string;
208
+ created: Date;
209
+ updated: Date;
210
+ brandPageToken: string;
211
+ domainName: string;
212
+ status: "active" | "pending" | "failed" | "renewFailed" | "deleted";
213
+ dnsConfigurationStatus: "request_expired" | "missing_expected_dns_records" | "invalid_multiple_dns_records_exist" | "unexpected_aaaa_record" | "completed";
214
+ triggerOrigin?: string | undefined;
215
+ } | null;
216
+ createCustomDomainErrorMessage: string | null;
217
+ customDomainConfig?: {
218
+ dns: {
219
+ ipAddresses: string[];
220
+ };
221
+ } | undefined;
222
+ designDraftToken?: string | undefined;
223
+ designTemplateToken: string;
224
+ isCustomDomainEnabled: boolean;
225
+ isBrandPageSlugEditMode: boolean;
226
+ isPublishModalVisible: boolean;
227
+ isUpgradeModalVisible: boolean;
228
+ isPublishing: boolean;
229
+ isProduction: boolean;
230
+ isSellDomainNameEnabled: boolean;
231
+ isStripeOnboardingModalVisible: boolean;
232
+ isReactivationModal: boolean;
233
+ isPublishUpgradeModal: boolean;
234
+ isSaving: boolean;
235
+ backButtonLabel: string;
236
+ manageWebsiteDesignsUrl: string;
237
+ publishErrorMessage: string;
238
+ upgradeUrl: string;
239
+ reactivationUrl: string;
240
+ runtimeEnvironment: string;
241
+ selectedTaxId: number | undefined;
242
+ slug: string;
243
+ standalone: boolean;
244
+ triggerSaveSuccessMessage: boolean;
245
+ isDesignCom: boolean;
246
+ isPrePurchase: boolean;
247
+ makerFonts: any[];
248
+ eventButtonLocation?: string | undefined;
249
+ websiteUpsellModalViewModel?: any;
250
+ showPublishOptionModal?: boolean | undefined;
251
+ abTests: Record<string, string>;
252
+ isSubsequentPublish: boolean;
253
+ } & import("pinia").PiniaCustomStateProperties<import("../../stores").BrandPageContainerState>) => boolean;
254
+ isUserDraft: (state: {
255
+ availableTaxes: any[];
256
+ brandPageBaseUrl: string;
257
+ baseFabricRenderUrl: string;
258
+ brandPageDescription: string;
259
+ brandPageDisplayName: string;
260
+ sensitiveContent: number;
261
+ brandPageSlug: string;
262
+ brandPageStatus: string;
263
+ brandPageToken: string | undefined;
264
+ brandPageTitle: string;
265
+ customDomain: {
266
+ id: string;
267
+ created: Date;
268
+ updated: Date;
269
+ brandPageToken: string;
270
+ domainName: string;
271
+ status: "active" | "pending" | "failed" | "renewFailed" | "deleted";
272
+ dnsConfigurationStatus: "request_expired" | "missing_expected_dns_records" | "invalid_multiple_dns_records_exist" | "unexpected_aaaa_record" | "completed";
273
+ triggerOrigin?: string | undefined;
274
+ } | null;
275
+ createCustomDomainErrorMessage: string | null;
276
+ customDomainConfig?: {
277
+ dns: {
278
+ ipAddresses: string[];
279
+ };
280
+ } | undefined;
281
+ designDraftToken?: string | undefined;
282
+ designTemplateToken: string;
283
+ isCustomDomainEnabled: boolean;
284
+ isBrandPageSlugEditMode: boolean;
285
+ isPublishModalVisible: boolean;
286
+ isUpgradeModalVisible: boolean;
287
+ isPublishing: boolean;
288
+ isProduction: boolean;
289
+ isSellDomainNameEnabled: boolean;
290
+ isStripeOnboardingModalVisible: boolean;
291
+ isReactivationModal: boolean;
292
+ isPublishUpgradeModal: boolean;
293
+ isSaving: boolean;
294
+ backButtonLabel: string;
295
+ manageWebsiteDesignsUrl: string;
296
+ publishErrorMessage: string;
297
+ upgradeUrl: string;
298
+ reactivationUrl: string;
299
+ runtimeEnvironment: string;
300
+ selectedTaxId: number | undefined;
301
+ slug: string;
302
+ standalone: boolean;
303
+ triggerSaveSuccessMessage: boolean;
304
+ isDesignCom: boolean;
305
+ isPrePurchase: boolean;
306
+ makerFonts: any[];
307
+ eventButtonLocation?: string | undefined;
308
+ websiteUpsellModalViewModel?: any;
309
+ showPublishOptionModal?: boolean | undefined;
310
+ abTests: Record<string, string>;
311
+ isSubsequentPublish: boolean;
312
+ } & import("pinia").PiniaCustomStateProperties<import("../../stores").BrandPageContainerState>) => boolean;
313
+ }, {
314
+ initialise(payload: import("../../stores/brandpage-container").InitialisePayload): void;
315
+ setDesignTemplateToken(payload: any): void;
316
+ setDesignDraftToken(payload: any): void;
317
+ setIsBrandPageSlugEditMode(payload: any): void;
318
+ setIsPublishing(payload: any): void;
319
+ setIsPublishModalVisible(payload: any): void;
320
+ setIsPublishUpgradeModal(payload: any): void;
321
+ setIsSaving(payload: any): void;
322
+ setIsUpgradeModalVisible(payload: any): void;
323
+ setPublishErrorMessage(payload: any): void;
324
+ setTriggerSaveSuccessMessage(payload: any): void;
325
+ setSlug(payload: any): void;
326
+ updateBrandPageMeta(payload: any): void;
327
+ updateBrandPageSensitiveContent(payload: any): void;
328
+ setLogoDraftToken(payload: {
329
+ logoDraftToken: string;
330
+ }): void;
331
+ setBackUrl(payload: any): void;
332
+ setIsStripeOnboardingModalVisible(payload: any): void;
333
+ setSelectedTaxId(payload: any): void;
334
+ setBrandPageCustomDomainConfig({ customDomainConfig }: {
335
+ customDomainConfig: any;
336
+ }): void;
337
+ setBrandPageCustomDomain(payload: {
338
+ customDomain: import("../../models").CustomDomainModel | null;
339
+ }): void;
340
+ setCreateCustomDomainErrorMessage(payload: any): void;
341
+ setBrandPageIsCustomDomainEnabled(payload: any): void;
342
+ setIsSubsequentPublish(payload: any): void;
343
+ clearPublishErrorMessage(): void;
344
+ closePublishModal(payload?: {
345
+ skipShowNextNotificationMessage?: boolean | undefined;
346
+ }): Promise<void>;
347
+ closeUpgradeModal(): Promise<void>;
348
+ endBrandPageSlugEditMode(): void;
349
+ publishBrandPage({ shouldPublish, slug }: {
350
+ shouldPublish: any;
351
+ slug: any;
352
+ }): Promise<false | {
353
+ success: boolean;
354
+ websiteUpsellModalViewModel: any;
355
+ }>;
356
+ publishBrandPageWithCustomDomainAsync({ shouldPublish, slug, domain, isPurchasedDomain, }: {
357
+ shouldPublish: any;
358
+ slug: any;
359
+ domain: any;
360
+ isPurchasedDomain: any;
361
+ }): Promise<boolean | undefined>;
362
+ checkWebsiteSlugAsync(slug: string): Promise<import("../../models/api.model").WebsiteSlugCheckResponse | null>;
363
+ redirectToLogoEditPage(logoEditUrl: string, locale: string): Promise<void>;
364
+ redirectToCreateNewDesignPage(): Promise<void>;
365
+ redirectToStripeOnboarding(): Promise<void>;
366
+ exportDesignAsync(): Promise<any>;
367
+ saveBrandPage(payload?: {
368
+ isPublish?: boolean | undefined;
369
+ eventButtonLocation?: string | undefined;
370
+ }): Promise<false | {
371
+ saved: boolean;
372
+ canPublish: boolean;
373
+ websiteUpsellModalViewModel: any;
374
+ }>;
375
+ saveAndPublishBrandPage(eventButtonLocation: string): Promise<void>;
376
+ saveTemplate(): Promise<void>;
377
+ setBrandPageStatus(status: any): Promise<void>;
378
+ showPublishModal(eventButtonLocation?: string | undefined, websiteUpsellModalViewModel?: any, isSubsequentPublish?: boolean | undefined): void;
379
+ showBrandPageSlugEditModal(eventButtonLocation: string): Promise<void>;
380
+ showUpgradeModalAndSaveAsync(): Promise<void>;
381
+ showStripeOnboardingModal(): void;
382
+ closeStripeOnboardingModal(): void;
383
+ showSaveSuccessMessage(): Promise<void>;
384
+ startBrandPageSlugEditMode(): void;
385
+ triggerLockedContentClickedEvent(contentType: string): Promise<void>;
386
+ unpublishBrandPage(): Promise<void>;
387
+ updateBrandPageSettings({ description, title }: {
388
+ description: any;
389
+ title: any;
390
+ }): Promise<void>;
391
+ updateSensitiveContent({ sensitiveContent }: {
392
+ sensitiveContent: any;
393
+ }): Promise<void>;
394
+ createBrandPageCustomDomain({ domainName }: {
395
+ domainName: any;
396
+ }): Promise<false | undefined>;
397
+ createBrandPageWithPurchasedDomain({ domainName }: {
398
+ domainName: any;
399
+ }): Promise<false | undefined>;
400
+ deleteBrandPageCustomDomain({ designDraftToken, customDomainId }: {
401
+ designDraftToken: any;
402
+ customDomainId: any;
403
+ }): Promise<void>;
404
+ refreshBrandPageCustomDomainConfig(): Promise<void>;
405
+ refreshBrandPageCustomDomain(): Promise<void>;
406
+ updateBrandPageIsCustomDomainEnabled({ isCustomDomainEnabled }: {
407
+ isCustomDomainEnabled: any;
408
+ }): Promise<void>;
409
+ }>;
189
410
  }, TemplatePreviewData, {
190
411
  context(): BrandPageContext;
191
412
  previewViewport(): string;
@@ -193,10 +414,16 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
193
414
  innerContainerStyle(): BrandPageCssStyle;
194
415
  isPersonalisable(): boolean;
195
416
  cssVariablesStyle(): Record<string, string>;
417
+ previewImageUrl(): string;
196
418
  }, {
197
419
  onOverlayClicked(): void;
198
420
  onResize(): void;
199
421
  onSetPreviewStyles(styles: BrandPageCssStyle): void;
422
+ onImageError(): void;
423
+ onImageLoad(): void;
424
+ generatePreviewImageUrl(): string;
425
+ getPreviewBaseUrl(): string;
426
+ regeneratePreview(): void;
200
427
  updateViewModel(forceUpdate?: boolean): Promise<void>;
201
428
  }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "template-selected"[], "template-selected", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
202
429
  logoImage: {
@@ -4,16 +4,19 @@ import { applyLogoThemeToBrandPageModel, applyUserPersonalisationToBrandPageMode
4
4
  import { STYLE_THEME_KEYS } from '../../../brand-page/constants';
5
5
  import debounce from 'lodash.debounce';
6
6
  import { MOBILE_HEIGHT, MOBILE_WIDTH } from '../../constants';
7
- import { useBrandPageMakerStore } from '../../stores';
7
+ import { useBrandPageContainerStore, useBrandPageMakerStore, } from '../../stores';
8
8
  import { applyLogoImageBase64UrlToBrandPageTemplateModel, applyLogoImageToBrandPageTemplateModel, applyLogoTemplateImageToBrandPageTemplateModel, } from '../../../brand-page/utils/logo.util';
9
9
  const DEBOUNCE_IN_MS = 250;
10
10
  export default defineComponent({
11
11
  emits: ['template-selected'],
12
12
  setup() {
13
13
  const brandPageMakerStore = useBrandPageMakerStore();
14
+ const brandPageContainerStore = useBrandPageContainerStore();
14
15
  return {
15
16
  selectedTemplateId: computed(() => brandPageMakerStore.selectedTemplateId),
17
+ isPrePurchase: computed(() => brandPageContainerStore.isPrePurchase),
16
18
  brandPageMakerStore,
19
+ brandPageContainerStore,
17
20
  };
18
21
  },
19
22
  props: {
@@ -72,6 +75,8 @@ export default defineComponent({
72
75
  renderWidth: 400,
73
76
  rootStyles: {},
74
77
  viewModel: undefined,
78
+ imageLoadError: false,
79
+ imageLoading: true,
75
80
  };
76
81
  return data;
77
82
  },
@@ -145,16 +150,42 @@ export default defineComponent({
145
150
  });
146
151
  return cssVariables;
147
152
  },
153
+ previewImageUrl() {
154
+ return this.generatePreviewImageUrl();
155
+ },
148
156
  },
149
157
  watch: {
150
- logoTheme: {
151
- handler() {
158
+ template() {
159
+ if (this.isPrePurchase) {
152
160
  this.updateViewModel();
161
+ }
162
+ else {
163
+ this.imageLoading = true;
164
+ this.regeneratePreview();
165
+ }
166
+ },
167
+ logoImage: {
168
+ handler() {
169
+ this.regeneratePreview();
153
170
  },
154
171
  deep: true,
155
172
  },
156
- template() {
157
- this.updateViewModel();
173
+ logoTemplateImage: {
174
+ handler() {
175
+ this.regeneratePreview();
176
+ },
177
+ deep: true,
178
+ },
179
+ logoTheme: {
180
+ handler() {
181
+ if (this.isPrePurchase) {
182
+ this.updateViewModel();
183
+ }
184
+ else {
185
+ this.regeneratePreview();
186
+ }
187
+ },
188
+ deep: true,
158
189
  },
159
190
  },
160
191
  created() {
@@ -195,7 +226,38 @@ export default defineComponent({
195
226
  onSetPreviewStyles(styles) {
196
227
  this.rootStyles = styles;
197
228
  },
229
+ onImageError() {
230
+ console.warn(`Failed to load preview image for template ${this.template.id}`);
231
+ this.imageLoadError = true;
232
+ this.imageLoading = false;
233
+ },
234
+ onImageLoad() {
235
+ this.imageLoadError = false;
236
+ this.imageLoading = false;
237
+ },
238
+ generatePreviewImageUrl() {
239
+ const baseUrl = this.getPreviewBaseUrl();
240
+ const logoDraftToken = this.logoImage?.logoDraftToken ||
241
+ '0B660926-D94A-4E29-99D1-F07E67AA6E49';
242
+ const deviceType = this.brandPageMakerStore.brandPageType === 'brandSite'
243
+ ? 'desktop'
244
+ : 'mobile';
245
+ return `${baseUrl}/preview/template/${this.template.id}/${logoDraftToken}?deviceType=${deviceType}`;
246
+ },
247
+ getPreviewBaseUrl() {
248
+ const domainSuffix = '.brand.page';
249
+ const envPrefix = window.location.hostname.split('.')[0];
250
+ return `https://preview-${envPrefix}${domainSuffix}`;
251
+ },
252
+ regeneratePreview() {
253
+ this.imageLoadError = false;
254
+ this.imageLoading = true;
255
+ this.$forceUpdate();
256
+ },
198
257
  async updateViewModel(forceUpdate = true) {
258
+ if (!this.isPrePurchase) {
259
+ return;
260
+ }
199
261
  let model = this.template.brandPageModel;
200
262
  if (this.logoImageBase64Url) {
201
263
  model = applyLogoImageBase64UrlToBrandPageTemplateModel(model, this.logoImageBase64Url);
@@ -4996,7 +4996,7 @@ input[data-v-4cd691db]::-webkit-inner-spin-button {
4996
4996
  border-radius: 0 !important;
4997
4997
  }
4998
4998
 
4999
- @-webkit-keyframes slide-2647dcd6 {
4999
+ @-webkit-keyframes slide-37727356 {
5000
5000
  0% {
5001
5001
  -webkit-transform: translateX(-40%);
5002
5002
  transform: translateX(-40%);
@@ -5021,7 +5021,7 @@ input[data-v-4cd691db]::-webkit-inner-spin-button {
5021
5021
  transform: translateX(150%);
5022
5022
  }
5023
5023
  }
5024
- @keyframes slide-2647dcd6 {
5024
+ @keyframes slide-37727356 {
5025
5025
  0% {
5026
5026
  -webkit-transform: translateX(-40%);
5027
5027
  transform: translateX(-40%);
@@ -5046,7 +5046,7 @@ input[data-v-4cd691db]::-webkit-inner-spin-button {
5046
5046
  transform: translateX(150%);
5047
5047
  }
5048
5048
  }
5049
- .brand-page__footer[data-v-2647dcd6] {
5049
+ .brand-page__footer[data-v-37727356] {
5050
5050
  display: -webkit-box;
5051
5051
  display: -ms-flexbox;
5052
5052
  display: flex;
@@ -5054,7 +5054,7 @@ input[data-v-4cd691db]::-webkit-inner-spin-button {
5054
5054
  -ms-flex-pack: center;
5055
5055
  justify-content: center;
5056
5056
  }
5057
- .brand-page__footer-link[data-v-2647dcd6] {
5057
+ .brand-page__footer-link[data-v-37727356] {
5058
5058
  display: block;
5059
5059
  border-radius: 0.25rem;
5060
5060
  padding: 0.75rem;
@@ -5062,37 +5062,37 @@ input[data-v-4cd691db]::-webkit-inner-spin-button {
5062
5062
  -webkit-transition: background 0.2s ease-in-out;
5063
5063
  transition: background 0.2s ease-in-out;
5064
5064
  }
5065
- .brand-page__footer-link[data-v-2647dcd6]:hover {
5065
+ .brand-page__footer-link[data-v-37727356]:hover {
5066
5066
  opacity: 0.9;
5067
5067
  }
5068
- .icon-container[data-v-2647dcd6] {
5068
+ .icon-container[data-v-37727356] {
5069
5069
  width: 20px;
5070
5070
  overflow: hidden;
5071
5071
  }
5072
- .icon-right[data-v-2647dcd6] {
5072
+ .icon-right[data-v-37727356] {
5073
5073
  left: 50%;
5074
5074
  -webkit-transform: translateX(-50%);
5075
5075
  transform: translateX(-50%);
5076
- -webkit-animation-name: slide-2647dcd6;
5077
- animation-name: slide-2647dcd6;
5076
+ -webkit-animation-name: slide-37727356;
5077
+ animation-name: slide-37727356;
5078
5078
  -webkit-animation-duration: 3s;
5079
5079
  animation-duration: 3s;
5080
5080
  -webkit-animation-iteration-count: infinite;
5081
5081
  animation-iteration-count: infinite;
5082
5082
  }
5083
- .btn-dcom[data-v-2647dcd6] {
5083
+ .btn-dcom[data-v-37727356] {
5084
5084
  --tw-border-opacity: 1;
5085
5085
  --tw-bg-opacity: 1;
5086
5086
  border-color: rgb(63 89 246 / var(--tw-border-opacity));
5087
5087
  background-color: rgb(63 89 246 / var(--tw-bg-opacity));
5088
5088
  font-family: 'Inter', Lato, sans-serif;
5089
5089
  }
5090
- .extra-height[data-v-2647dcd6] {
5090
+ .extra-height[data-v-37727356] {
5091
5091
  -webkit-transition: height 0.5s ease-in-out;
5092
5092
  transition: height 0.5s ease-in-out;
5093
5093
  width: 100%;
5094
5094
  }
5095
- .btn-bc[data-v-2647dcd6] {
5095
+ .btn-bc[data-v-37727356] {
5096
5096
  font-family: Lato, Helvetica, sans-serif;
5097
5097
  }
5098
5098
 
@@ -8630,11 +8630,11 @@ input[type='number'][data-v-28a532b4] {
8630
8630
  }
8631
8631
  }
8632
8632
 
8633
- .template-preview[data-v-c5fa6125] {
8633
+ .template-preview[data-v-072c3b9b] {
8634
8634
  position: relative;
8635
8635
  background-attachment: initial !important
8636
8636
  }
8637
- .template-preview__overlay[data-v-c5fa6125] {
8637
+ .template-preview__overlay[data-v-072c3b9b] {
8638
8638
  position: absolute;
8639
8639
  top: 0px;
8640
8640
  left: 0px;
@@ -8645,10 +8645,28 @@ input[type='number'][data-v-28a532b4] {
8645
8645
  cursor: pointer;
8646
8646
  opacity: 0
8647
8647
  }
8648
- .template-preview__page[data-v-c5fa6125] {
8648
+ .template-preview__image-container[data-v-072c3b9b] {
8649
+ pointer-events: none;
8650
+ height: 100%;
8651
+ width: 100%
8652
+ }
8653
+ .template-preview__image[data-v-072c3b9b] {
8654
+ height: 100%;
8655
+ width: 100%;
8656
+ -o-object-fit: fill;
8657
+ object-fit: fill;
8658
+ -webkit-transition: -webkit-filter 0.2s ease;
8659
+ transition: -webkit-filter 0.2s ease;
8660
+ transition: filter 0.2s ease;
8661
+ transition: filter 0.2s ease, -webkit-filter 0.2s ease
8662
+ }
8663
+ .template-preview__page[data-v-072c3b9b] {
8649
8664
  pointer-events: none
8650
8665
  }
8651
- .template-preview[data-v-c5fa6125] .c-shape-background {
8666
+ .template-preview[data-v-072c3b9b] .c-shape-background {
8667
+ position: absolute
8668
+ }
8669
+ .template-preview__image[data-v-072c3b9b] .c-shape-background {
8652
8670
  position: absolute
8653
8671
  }
8654
8672