@designcrowd/library.brand-page 5.15.5 → 5.15.6-getty-3

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 (95) hide show
  1. package/lib/src/{CreatedOnBrandCrowd-de-de-BxSRz5rV.js → CreatedOnBrandCrowd-de-de-BqBtYinU.js} +1 -1
  2. package/lib/src/{CreatedOnBrandCrowd-en-us-bvRHsK4P.js → CreatedOnBrandCrowd-en-us-CKvgampI.js} +1 -1
  3. package/lib/src/{CreatedOnBrandCrowd-es-es-B7UhGZ_i.js → CreatedOnBrandCrowd-es-es-DGn6o_T4.js} +1 -1
  4. package/lib/src/{CreatedOnBrandCrowd-fr-fr-DbrCnQfL.js → CreatedOnBrandCrowd-fr-ca-DwjTocXU.js} +1 -1
  5. package/lib/src/{CreatedOnBrandCrowd-fr-ca-DbrCnQfL.js → CreatedOnBrandCrowd-fr-fr-DwjTocXU.js} +1 -1
  6. package/lib/src/{CreatedOnBrandCrowd-pt-pt-DHBSkoHf.js → CreatedOnBrandCrowd-pt-br-DaCU-CcP.js} +1 -1
  7. package/lib/src/{CreatedOnBrandCrowd-pt-br-DHBSkoHf.js → CreatedOnBrandCrowd-pt-pt-DaCU-CcP.js} +1 -1
  8. package/lib/src/{CreatedOnDcom-de-de-CJ5PfRgk.js → CreatedOnDcom-de-de-Ci8-WB33.js} +1 -1
  9. package/lib/src/{CreatedOnDcom-en-us-CFgQcJsC.js → CreatedOnDcom-en-us-BmW9R2mS.js} +1 -1
  10. package/lib/src/{CreatedOnDcom-es-es-2qGiWLwl.js → CreatedOnDcom-es-es-D2fkI_U1.js} +1 -1
  11. package/lib/src/{CreatedOnDcom-fr-ca-BrBIvOOs.js → CreatedOnDcom-fr-ca-BQKfPaed.js} +1 -1
  12. package/lib/src/{CreatedOnDcom-fr-fr-CrvtNu83.js → CreatedOnDcom-fr-fr-CvHbnSy5.js} +1 -1
  13. package/lib/src/{CreatedOnDcom-pt-br-BwnlmEkz.js → CreatedOnDcom-pt-br-BQTCVFRZ.js} +1 -1
  14. package/lib/src/{CreatedOnDcom-pt-pt-DMqOsUps.js → CreatedOnDcom-pt-pt-Bu-Vs8uA.js} +1 -1
  15. package/lib/src/brand-page/components/media/Media.mixin.d.ts +12 -0
  16. package/lib/src/brand-page/components/media/Media.mixin.js +5 -0
  17. package/lib/src/brand-page/models/index.d.ts +16 -0
  18. package/lib/src/brand-page/models/index.js +19 -0
  19. package/lib/src/brand-page/utils/view-model.util.d.ts +14 -2
  20. package/lib/src/brand-page/utils/view-model.util.js +35 -4
  21. package/lib/src/brand-page/view-models.d.ts +19 -1
  22. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.d.ts +2 -0
  23. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.stories.js +1 -0
  24. package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.d.ts +2 -0
  25. package/lib/src/brand-page-maker/constants/config-settings-constant.js +25 -11
  26. package/lib/src/brand-page-maker/stores/brandpage-container/brand-page-container-store.d.ts +13 -0
  27. package/lib/src/brand-page-maker/stores/brandpage-container/brand-page-container-store.js +20 -3
  28. package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.js +5 -3
  29. package/lib/src/brand-page-maker/stores/index.d.ts +1 -0
  30. package/lib/src/brand-page-maker/stores/index.js +1 -0
  31. package/lib/src/brand-page-maker/stores/video/index.d.ts +1 -0
  32. package/lib/src/brand-page-maker/stores/video/index.js +1 -0
  33. package/lib/src/brand-page-maker/stores/video/video-store.d.ts +18 -0
  34. package/lib/src/brand-page-maker/stores/video/video-store.js +19 -0
  35. package/lib/src/{bundled-translations-Gwpp-xB6.js → bundled-translations-Cmyak1c7.js} +1 -1
  36. package/lib/src/bundles/bundled-translations.json +4 -0
  37. package/lib/src/clients/gettyimages-client.js +1 -1
  38. package/lib/src/css/library.brand-page-brandCrowd.min.css +22 -22
  39. package/lib/src/css/library.brand-page-brandPage.min.css +22 -22
  40. package/lib/src/css/library.brand-page-designCom.min.css +22 -22
  41. package/lib/src/css/library.brand-page-preview.min.css +22 -22
  42. package/lib/src/helpers/ts.helper.d.ts +1 -0
  43. package/lib/src/helpers/ts.helper.js +22 -0
  44. package/lib/src/index.mjs +188 -186
  45. package/lib/src/{lib-NaxZd0H-.js → lib-CeUSV6Wj.js} +12977 -12757
  46. package/lib/src/shared/content-settings/components/GenericTextInput.mixin.d.ts +1 -1
  47. package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.d.ts +2 -0
  48. package/lib/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.mixin.d.ts +4 -1
  49. package/lib/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.mixin.js +3 -0
  50. package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItem.mixin.d.ts +2 -0
  51. package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.d.ts +2 -0
  52. package/lib/src/shared/content-settings/components/email-field/EmailField.mixin.d.ts +1 -1
  53. package/lib/src/shared/content-settings/components/focused-content-item-settings/FocusedContentItemSettings.mixin.d.ts +2 -0
  54. package/lib/src/shared/content-settings/components/image-field/ImageField.mixin.d.ts +23 -1
  55. package/lib/src/shared/content-settings/components/image-field/ImageField.mixin.js +25 -1
  56. package/lib/src/shared/content-settings/components/tel-field/TelField.mixin.d.ts +1 -1
  57. package/lib/src/shared/content-settings/components/text-field/TextField.mixin.d.ts +1 -1
  58. package/lib/src/shared/content-settings/components/textarea-field/TextareaField.mixin.d.ts +1 -1
  59. package/lib/src/shared/content-settings/components/url-field/UrlField.mixin.d.ts +1 -1
  60. package/lib/src/shared/content-settings/components/youtube-video-field/YoutubeVideoField.mixin.d.ts +1 -1
  61. package/lib/src/shared/content-settings/models.d.ts +2 -0
  62. package/lib/src/shared/content-settings/store/content-settings-store.d.ts +3 -0
  63. package/lib/src/shared/content-settings/store/content-settings-store.js +37 -1
  64. package/lib/src/shared/my-uploads/models.d.ts +12 -0
  65. package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.d.ts +2 -0
  66. package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.d.ts +2 -0
  67. package/package.json +1 -1
  68. package/src/brand-page/components/banner-section/BannerSection.vue +6 -1
  69. package/src/brand-page/components/logo/LogoRender.vue +0 -1
  70. package/src/brand-page/components/media/Media.mixin.ts +11 -1
  71. package/src/brand-page/components/media/Media.vue +15 -3
  72. package/src/brand-page/components/media/Video.vue +38 -0
  73. package/src/brand-page/models/index.ts +34 -0
  74. package/src/brand-page/utils/view-model.util.ts +74 -2
  75. package/src/brand-page/view-models.ts +24 -0
  76. package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.stories.ts +1 -0
  77. package/src/brand-page-maker/constants/config-settings-constant.ts +26 -10
  78. package/src/brand-page-maker/stores/brandpage-container/brand-page-container-store.ts +47 -1
  79. package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.ts +9 -0
  80. package/src/brand-page-maker/stores/index.ts +1 -0
  81. package/src/brand-page-maker/stores/video/index.ts +1 -0
  82. package/src/brand-page-maker/stores/video/video-store.ts +37 -0
  83. package/src/bundles/bundled-translations.json +4 -0
  84. package/src/clients/gettyimages-client.js +1 -1
  85. package/src/helpers/ts.helper.ts +30 -0
  86. package/src/shared/common/i18n/common.json +2 -0
  87. package/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.mixin.ts +10 -1
  88. package/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.vue +1 -0
  89. package/src/shared/content-settings/components/content-settings/i18n/content-settings.json +4 -0
  90. package/src/shared/content-settings/components/image-field/ImageField.mixin.ts +31 -1
  91. package/src/shared/content-settings/components/replace-image-base-settings/ReplaceImageBaseSettings.vue +10 -2
  92. package/src/shared/content-settings/models.ts +3 -0
  93. package/src/shared/content-settings/store/content-settings-store.ts +68 -0
  94. package/src/shared/my-uploads/models.ts +16 -0
  95. package/src/shared/video-library/VideoLibrary.vue +13 -7
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as e, openBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-NaxZd0H-.js";
2
+ import { _ as t } from "./lib-CeUSV6Wj.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-NaxZd0H-.js";
2
+ import { _ as t } from "./lib-CeUSV6Wj.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-NaxZd0H-.js";
2
+ import { _ as t } from "./lib-CeUSV6Wj.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-NaxZd0H-.js";
2
+ import { _ as t } from "./lib-CeUSV6Wj.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-NaxZd0H-.js";
2
+ import { _ as t } from "./lib-CeUSV6Wj.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-NaxZd0H-.js";
2
+ import { _ as t } from "./lib-CeUSV6Wj.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-NaxZd0H-.js";
2
+ import { _ as t } from "./lib-CeUSV6Wj.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-NaxZd0H-.js";
2
+ import { _ as e } from "./lib-CeUSV6Wj.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-NaxZd0H-.js";
2
+ import { _ as e } from "./lib-CeUSV6Wj.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-NaxZd0H-.js";
2
+ import { _ as e } from "./lib-CeUSV6Wj.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-NaxZd0H-.js";
2
+ import { _ as e } from "./lib-CeUSV6Wj.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-NaxZd0H-.js";
2
+ import { _ as e } from "./lib-CeUSV6Wj.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-NaxZd0H-.js";
2
+ import { _ as M } from "./lib-CeUSV6Wj.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-NaxZd0H-.js";
2
+ import { _ as M } from "./lib-CeUSV6Wj.js";
3
3
  const Z = {}, e = {
4
4
  width: "232",
5
5
  height: "36",
@@ -1,5 +1,6 @@
1
1
  import type { PropType } from 'vue';
2
2
  import type { BrandPageContext, ColorReplacement } from '../../models';
3
+ import type { GettyVideoViewModel } from '../../../lib';
3
4
  declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
5
  mediaType: {
5
6
  type: StringConstructor;
@@ -59,6 +60,11 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
59
60
  required: false;
60
61
  default: undefined;
61
62
  };
63
+ media: {
64
+ type: PropType<GettyVideoViewModel>;
65
+ required: false;
66
+ default: undefined;
67
+ };
62
68
  }>, {}, {
63
69
  type: string | undefined;
64
70
  isImageBroken: boolean;
@@ -123,7 +129,13 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
123
129
  required: false;
124
130
  default: undefined;
125
131
  };
132
+ media: {
133
+ type: PropType<GettyVideoViewModel>;
134
+ required: false;
135
+ default: undefined;
136
+ };
126
137
  }>> & Readonly<{}>, {
138
+ media: GettyVideoViewModel;
127
139
  colorReplacements: ColorReplacement[];
128
140
  mediaType: string;
129
141
  size: string;
@@ -59,6 +59,11 @@ export default defineComponent({
59
59
  required: false,
60
60
  default: undefined,
61
61
  },
62
+ media: {
63
+ type: Object,
64
+ required: false,
65
+ default: undefined,
66
+ },
62
67
  },
63
68
  data() {
64
69
  return {
@@ -271,6 +271,7 @@ export interface BannerSectionContent extends Content {
271
271
  overlayColor: BrandPageCssStyle;
272
272
  overlayOpacity: number;
273
273
  aspectRatio?: number | null;
274
+ media?: AbstractMedia;
274
275
  }
275
276
  export declare const MEDIA_TYPES: {
276
277
  readonly image: "image";
@@ -493,6 +494,21 @@ export declare abstract class AbstractPageFooterStyles {
493
494
  logoImageWidth: string | undefined;
494
495
  protected constructor(options?: AbstractPageFooterStylesType);
495
496
  }
497
+ export type MediaTypes = 'getty-video' | 'user-upload-video' | 'image';
498
+ export declare abstract class AbstractMedia {
499
+ abstract type: MediaTypes;
500
+ }
501
+ type GettyVideoMediaType = Partial<GettyVideoMedia>;
502
+ export declare class GettyVideoMedia extends AbstractMedia {
503
+ type: MediaTypes;
504
+ gettyToken: string;
505
+ gettyAssetId: string;
506
+ mimeType: string;
507
+ settings: {
508
+ autoPlay?: boolean;
509
+ };
510
+ constructor(options?: GettyVideoMediaType);
511
+ }
496
512
  export declare class PageFooterDesktop extends AbstractPageFooterStyles {
497
513
  constructor(options?: AbstractPageFooterStylesType);
498
514
  }
@@ -351,6 +351,25 @@ export class AbstractPageFooterStyles {
351
351
  this.textFontFamily = options.textFontFamily;
352
352
  }
353
353
  }
354
+ export class AbstractMedia {
355
+ }
356
+ export class GettyVideoMedia extends AbstractMedia {
357
+ type = 'getty-video';
358
+ gettyToken;
359
+ gettyAssetId;
360
+ mimeType;
361
+ settings;
362
+ constructor(options = {}) {
363
+ options = cloneDeep(options);
364
+ super();
365
+ this.type = 'getty-video';
366
+ this.gettyToken = options.gettyToken || '';
367
+ this.gettyAssetId = options.gettyAssetId || '';
368
+ this.mimeType = options.mimeType || '';
369
+ this.settings = options.settings || {};
370
+ }
371
+ }
372
+ //jyao: END of media related entities and classes
354
373
  export class PageFooterDesktop extends AbstractPageFooterStyles {
355
374
  constructor(options = {}) {
356
375
  options = cloneDeep(options);
@@ -5,15 +5,26 @@ export declare const mapToImageViewModel: (content: ImageContent) => ImageViewMo
5
5
  export declare const mapToImageGalleryViewModel: (content: ImageGalleryContent, globalStyles: GalleryStyles) => ImageGalleryViewModel;
6
6
  export declare const mapToProfileViewModel: (content: ProfileContent, styles: PageStyles) => ProfileViewModel;
7
7
  export declare const mapToTextViewModel: (content: TextContent, styles: PageStyles, brandPageType: BrandPageType) => TextViewModel;
8
- export declare const mapToBannerSectionViewModel: (content: BannerSectionContent, styles: PageStyles) => BannerSectionViewModel;
8
+ export declare const mapToBannerSectionViewModel: (content: BannerSectionContent, styles: PageStyles, contentOptions?: {
9
+ getVideoUrls?: GetVideoUrls;
10
+ }) => BannerSectionViewModel;
9
11
  export declare const mapToImagesSectionViewModel: (content: ImagesSectionContent, styles: PageStyles, brandPageType: BrandPageType) => TextImageSectionViewModel;
10
12
  export declare const mapToBookingSectionViewModel: (content: BookingSectionContent, styles: PageStyles) => BookingSectionViewModel;
11
13
  export declare const mapToPageHeaderViewModel: (pageHeader: PageHeaderDesktop | PageHeaderMobile, pageStyles: PageStyles, pages: PageViewModel[], useOldLogoRenderSize?: boolean) => PageHeaderViewModel;
12
14
  export declare const mapToPageFooterViewModel: (pageFooter: PageFooterDesktop | PageFooterMobile, pageStyles: PageStyles, useOldLogoRenderSize?: boolean) => PageFooterViewModel;
13
15
  export declare const mapToViewModel: (styles: PageStyles, brandPageType: BrandPageType, options?: {
14
16
  useOldLogoRenderSize: boolean;
17
+ contentOptions?: {
18
+ getVideoUrls?: GetVideoUrls;
19
+ };
15
20
  }) => (content: Content) => ContentViewModel | undefined;
16
- export declare const getBrandPageViewModelFromBrandPageModel: (model: BrandPageModel, brandPageToken: string | undefined, showBrandCrowdLogo?: boolean, useOldLogoRenderSize?: boolean) => BrandPageViewModel;
21
+ type GetVideoUrls = (token: string) => {
22
+ videoUrl: string;
23
+ previewImageUrl: string;
24
+ } | undefined;
25
+ export declare const getBrandPageViewModelFromBrandPageModel: (model: BrandPageModel, brandPageToken: string | undefined, showBrandCrowdLogo?: boolean, useOldLogoRenderSize?: boolean, contentOptions?: {
26
+ getVideoUrls?: GetVideoUrls;
27
+ }) => BrandPageViewModel;
17
28
  export declare const isLogoViewModel: (viewModel: ContentViewModel) => viewModel is LogoViewModel;
18
29
  /** for service.brand-page website preview by logo draft token */
19
30
  export declare const applyLogoImageToBrandPageViewModel: (viewModel: BrandPageViewModel, logoImage: LogoImageModel) => BrandPageViewModel;
@@ -29,3 +40,4 @@ export interface CriticalResourceURLs {
29
40
  * For service.brand-page to preload critical resources
30
41
  */
31
42
  export declare const getCriticalResourceURLs: (viewModel: BrandPageViewModel) => CriticalResourceURLs;
43
+ export {};
@@ -391,7 +391,37 @@ const mapToContactFormViewModel = (content, styles, brandPageType) => {
391
391
  content.layoutStyle !== '',
392
392
  }, styles);
393
393
  };
394
- export const mapToBannerSectionViewModel = (content, styles) => {
394
+ const mapGettyVideoToGettyVideoViewModel = (media, contentOptions) => {
395
+ const videoUrls = contentOptions?.getVideoUrls?.(media.gettyToken) || {
396
+ videoUrl: '',
397
+ previewImageUrl: '',
398
+ };
399
+ return {
400
+ type: 'getty-video',
401
+ gettyToken: media.gettyToken,
402
+ gettyAssetId: media.gettyAssetId,
403
+ mimeType: media.mimeType,
404
+ videoUrl: videoUrls.videoUrl,
405
+ previewImageUrl: videoUrls.previewImageUrl,
406
+ settings: {
407
+ autoPlay: media.settings?.autoPlay || false,
408
+ },
409
+ };
410
+ };
411
+ const mapMediaToContentViewModel = (media, displayStyle, contentOptions) => {
412
+ if (!media) {
413
+ return undefined;
414
+ }
415
+ switch (media.type) {
416
+ case 'getty-video':
417
+ return mapGettyVideoToGettyVideoViewModel(media, contentOptions);
418
+ case 'image':
419
+ // TODO(jyao): Implement later
420
+ default:
421
+ throw new Error(`Unsupported media type: ${media.type}`);
422
+ }
423
+ };
424
+ export const mapToBannerSectionViewModel = (content, styles, contentOptions) => {
395
425
  return applyViewModelTextStyles({
396
426
  ...content,
397
427
  role: content.type,
@@ -410,6 +440,7 @@ export const mapToBannerSectionViewModel = (content, styles) => {
410
440
  isFullWidth: true,
411
441
  imageUrl: mapToBannerSectionImageUrl(content),
412
442
  isBigImageType: isBigImageType(content.displayStyle),
443
+ mediaViewModel: mapMediaToContentViewModel(content.media, content.displayStyle, contentOptions),
413
444
  }, styles);
414
445
  };
415
446
  const mapToAboutSectionViewModel = (content, styles) => {
@@ -675,7 +706,7 @@ export const mapToViewModel = (styles, brandPageType, options) => (content) => {
675
706
  case 'contact-form':
676
707
  return mapToContactFormViewModel(content, styles, brandPageType);
677
708
  case 'banner-section':
678
- return mapToBannerSectionViewModel(content, styles);
709
+ return mapToBannerSectionViewModel(content, styles, options?.contentOptions);
679
710
  case 'booking-section':
680
711
  return mapToBookingSectionViewModel(content, styles);
681
712
  case 'about-section':
@@ -709,10 +740,10 @@ export const mapToViewModel = (styles, brandPageType, options) => (content) => {
709
740
  assertUnreachable();
710
741
  }
711
742
  };
712
- export const getBrandPageViewModelFromBrandPageModel = (model, brandPageToken, showBrandCrowdLogo = true, useOldLogoRenderSize = false) => {
743
+ export const getBrandPageViewModelFromBrandPageModel = (model, brandPageToken, showBrandCrowdLogo = true, useOldLogoRenderSize = false, contentOptions) => {
713
744
  const pages = model.pages.map((p) => {
714
745
  const contents = p.contents
715
- .map(mapToViewModel(model.styles, model.brandPageType || BRAND_PAGE_TYPES.default, { useOldLogoRenderSize }))
746
+ .map(mapToViewModel(model.styles, model.brandPageType || BRAND_PAGE_TYPES.default, { useOldLogoRenderSize, contentOptions }))
716
747
  .filter((c) => c !== undefined);
717
748
  return {
718
749
  title: p.title,
@@ -1,4 +1,4 @@
1
- import type { PageStyles, ButtonWithModalContent, ProfileContent, TextContent, VideoContent, ImageContent, ContentType, ButtonStyles, LogoStyles, MapContent, ImageGalleryContent, GalleryStyles, MailingListContent, RequestPaymentContent, ShopContent, SupportMeContent, ContactFormContent, BannerSectionContent, BrandPageType, SocialLinksContent, TestimonialSectionContent, AboutSectionContent, DividerSectionContent, ShapesSectionContent, ButtonLinkType, PageHeaderMobile, PageHeaderDesktop, PageFooterMobile, PageFooterDesktop, TextMediaItem, TextShapeItem, TextStyleDeclaration, AspectRatio, LogoImageModel, LogoTemplateImageModel, CookieOptions, BookingSectionContent } from './models';
1
+ import type { PageStyles, ButtonWithModalContent, ProfileContent, TextContent, VideoContent, ImageContent, ContentType, ButtonStyles, LogoStyles, MapContent, ImageGalleryContent, GalleryStyles, MailingListContent, RequestPaymentContent, ShopContent, SupportMeContent, ContactFormContent, BannerSectionContent, BrandPageType, SocialLinksContent, TestimonialSectionContent, AboutSectionContent, DividerSectionContent, ShapesSectionContent, ButtonLinkType, PageHeaderMobile, PageHeaderDesktop, PageFooterMobile, PageFooterDesktop, TextMediaItem, TextShapeItem, TextStyleDeclaration, AspectRatio, LogoImageModel, LogoTemplateImageModel, CookieOptions, BookingSectionContent, MediaTypes } from './models';
2
2
  import type { ImagesSectionContentDisplayStyle } from './constants';
3
3
  export type ViewModelType = 'button' | 'image' | 'image-gallery' | 'logo' | 'map' | 'mailing-list' | 'profile' | 'support-me' | 'request-payment' | 'text' | 'video' | 'contact-form' | 'banner-section' | 'images-section' | 'about-section' | 'divider-section' | 'testimonial-section' | 'social-links' | 'shapes-section' | 'shop-section' | 'booking-section';
4
4
  export interface ContentViewModel {
@@ -70,6 +70,24 @@ export interface BannerSectionViewModel extends ContentViewModel, Omit<BannerSec
70
70
  buttonViewModel: ButtonViewModel;
71
71
  isFullWidth: boolean;
72
72
  isBigImageType: boolean;
73
+ mediaViewModel?: MediaViewModel;
74
+ }
75
+ export interface MediaViewModel {
76
+ type: MediaTypes;
77
+ }
78
+ export interface GettyVideoViewModel extends MediaViewModel {
79
+ type: 'getty-video';
80
+ gettyToken: string;
81
+ gettyAssetId: string;
82
+ mimeType: string;
83
+ videoUrl: string;
84
+ previewImageUrl: string;
85
+ settings: {
86
+ autoPlay: boolean;
87
+ };
88
+ }
89
+ export interface ImageMediaViewModel extends MediaViewModel {
90
+ type: 'image';
73
91
  }
74
92
  export interface TextImageSectionViewModel {
75
93
  id: string;
@@ -746,6 +746,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
746
746
  colorReplacements?: import("../../../brand-page").ColorReplacement[] | undefined;
747
747
  aspectRatio?: number | null | undefined;
748
748
  }): void;
749
+ _setSelectedItemMedia(selectedItemId: string | null, mediaPayload: import("../../../shared/my-uploads/models").MediaBaseSelectedPayload): void;
749
750
  _setItems({ items }: {
750
751
  items: import("../../../shared/content-settings/models").ContentItem<any>[];
751
752
  }): void;
@@ -821,6 +822,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
821
822
  colorReplacements?: import("../../../brand-page").ColorReplacement[] | undefined;
822
823
  aspectRatio?: number | null | undefined;
823
824
  }): void;
825
+ setSelectedItemMedia(selectedItemId: string | null, mediaPayload: import("../../../shared/my-uploads/models").MediaBaseSelectedPayload): void;
824
826
  setItems(payload: {
825
827
  items: import("../../../shared/content-settings/models").ContentItem<import("../../../brand-page").Content>[];
826
828
  }): void;
@@ -175,6 +175,7 @@ const InitialiseMakerStores = (options) => {
175
175
  triggerSaveSuccessMessage: false,
176
176
  abTests: {},
177
177
  isSubsequentPublish: false,
178
+ gettyVideos: [],
178
179
  });
179
180
  userStore.setIsAdmin({ isAdmin: options.isAdmin || false });
180
181
  userStore.setHasBrandPagePremiumSubscription(false);
@@ -408,6 +408,7 @@ declare const _default: import("vue").DefineComponent<{}, {
408
408
  colorReplacements?: import("../../../brand-page").ColorReplacement[] | undefined;
409
409
  aspectRatio?: number | null | undefined;
410
410
  }): void;
411
+ _setSelectedItemMedia(selectedItemId: string | null, mediaPayload: import("../../../shared/my-uploads/models").MediaBaseSelectedPayload): void;
411
412
  _setItems({ items }: {
412
413
  items: ContentItem<any>[];
413
414
  }): void;
@@ -483,6 +484,7 @@ declare const _default: import("vue").DefineComponent<{}, {
483
484
  colorReplacements?: import("../../../brand-page").ColorReplacement[] | undefined;
484
485
  aspectRatio?: number | null | undefined;
485
486
  }): void;
487
+ setSelectedItemMedia(selectedItemId: string | null, mediaPayload: import("../../../shared/my-uploads/models").MediaBaseSelectedPayload): void;
486
488
  setItems(payload: {
487
489
  items: ContentItem<Content>[];
488
490
  }): void;
@@ -1,4 +1,4 @@
1
- import { SOCIAL_LINKS_ICON_DISPLAY_STYLES, BRAND_PAGE_TYPES, DIVIDER_STYLES, MEDIA_TYPES, BUTTON_LINK_TYPE, FONT_SIZE_BODY, LINE_HEIGHT_BODY, MIN_TEXT_SIZE_PX, MAX_TEXT_SIZE_PX, TEXT_COLUMNS, DEFAULT_SHAPE_SIZE, PAYMENT_OPTION_DISPLAY_TYPES, PAYMENT_OPTION_IMAGE_TYPES, } from '../../brand-page';
1
+ import { SOCIAL_LINKS_ICON_DISPLAY_STYLES, BRAND_PAGE_TYPES, DIVIDER_STYLES, MEDIA_TYPES, BUTTON_LINK_TYPE, FONT_SIZE_BODY, LINE_HEIGHT_BODY, MIN_TEXT_SIZE_PX, MAX_TEXT_SIZE_PX, TEXT_COLUMNS, DEFAULT_SHAPE_SIZE, PAYMENT_OPTION_DISPLAY_TYPES, PAYMENT_OPTION_IMAGE_TYPES, GettyVideoMedia, } from '../../brand-page';
2
2
  import { createInitialButtonContent, createInitialImageContent, createInitialProfileContent, createInitialTextContent, createInitialVideoContent, createInitialLogoContent, createInitialMapContent, createInitialImageGalleryContent, createInitialGeneralLinkContent, createInitialMailingListContent, createInitialRequestPaymentContent, createInitialSupportMeContent, createInitialContactFormContent, CONTENT_SETTINGS_DISPLAY_MODES, createInitialBannerSectionContent, createInitialSocialLinksContent, createInitialImagesSectionContent, createInitialTestimonialSectionContent, createInitialAboutSectionContent, createInitialDividerSectionContent, createInitialShapesSectionContent, VARIANT_DISPLAY_MODES, createInitialShopContent, createInitialBookingSectionContent, } from '../models';
3
3
  import { colorConvertor, backgroundColorConvertor, borderColorConvertor, displayStyleConvertor, galleryTypeConvertor, imageAspectRatioConvertor, textAlignmentOptionsConvertor, videoContentStateConvertor, fillColorConvertor, bannerAlignDisplayStyleConvertor, aboutDisplayStyleConvertor, dividerStyleConvertor, shapeSizeOptionsConvertor, buttonLinkStyleConvertor, textSizeValueConvertor, textColumnStyleConvertor, contactLayoutStyleConvertor, paymentLinkDisplayStyleConvertor, shopDisplayConvertor, shopAspectRatioConvertor, } from '../convertors';
4
4
  import { ALIGN_CENTERED, DISPLAY_STYLE_COLLAPSED, DISPLAY_STYLE_PREVIEW, } from '../../brand-page';
@@ -225,11 +225,12 @@ const shopReplaceImageSettings = () => ({
225
225
  desiredHeight: undefined,
226
226
  desiredWidth: undefined,
227
227
  });
228
+ // TOOD(jyao): This should be reworked to bannerSectionReplaceMediaSettings
228
229
  const bannerSectionReplaceImageSettings = () => ({
229
230
  tabs: ['MY_UPLOADS', 'IMAGE_LIBRARY', 'VIDEO_LIBRARY', 'SHAPE_LIBRARY'],
230
- buttonTitleAdd: contentSettingsTr(`addImageButtonTitle`),
231
- titleAdd: contentSettingsTr(`addImageHeaderTitle`),
232
- titleReplace: contentSettingsTr(`imageReplaceTitle`),
231
+ buttonTitleAdd: contentSettingsTr(`addMediaTitle`),
232
+ titleAdd: contentSettingsTr(`addMediaTitle`),
233
+ titleReplace: contentSettingsTr(`replaceMediaTitle`),
233
234
  contentMediaFieldName: MediaFieldNames.avatarImageUrl,
234
235
  openByDefault: false,
235
236
  mediaType: MEDIA_TYPES.image,
@@ -238,12 +239,25 @@ const bannerSectionReplaceImageSettings = () => ({
238
239
  desiredHeight: undefined,
239
240
  desiredWidth: undefined,
240
241
  setContentMedia: (content, value) => {
241
- content.imageUrl = value.imageUrl;
242
- content.mediaType = MEDIA_TYPES.image;
243
- if (isValidSvgUrl(content.imageUrl)) {
244
- content.size = DEFAULT_SHAPE_SIZE;
245
- content.mediaType = MEDIA_TYPES.shape;
246
- content.colorReplacements = value.colorReplacements || [];
242
+ if (value.media && value.media.type === 'getty-video') {
243
+ const gettyMedia = value.media;
244
+ content.media = new GettyVideoMedia({
245
+ gettyToken: gettyMedia.token,
246
+ gettyAssetId: gettyMedia.assetId,
247
+ mimeType: gettyMedia.mimeType,
248
+ settings: {
249
+ autoPlay: gettyMedia.autoPlay,
250
+ },
251
+ });
252
+ }
253
+ else {
254
+ content.imageUrl = value.imageUrl;
255
+ content.mediaType = MEDIA_TYPES.image;
256
+ if (isValidSvgUrl(content.imageUrl)) {
257
+ content.size = DEFAULT_SHAPE_SIZE;
258
+ content.mediaType = MEDIA_TYPES.shape;
259
+ content.colorReplacements = value.colorReplacements || [];
260
+ }
247
261
  }
248
262
  },
249
263
  });
@@ -1836,7 +1850,7 @@ export const BANNER_SECTION_SETTINGS_CONFIG = () => ({
1836
1850
  imageUrl: {
1837
1851
  type: 'image',
1838
1852
  replaceImageSettings: bannerSectionReplaceImageSettings(),
1839
- title: contentSettingsTr(`imageTitle`),
1853
+ title: contentSettingsTr(`media`),
1840
1854
  groupId: SETTINGS_STYLE_FIELD_GROUP_IDS.settings,
1841
1855
  },
1842
1856
  imageUrlOverride: {
@@ -48,12 +48,24 @@ export interface BrandPageContainerState {
48
48
  abTests: Record<string, string>;
49
49
  isSubsequentPublish: boolean;
50
50
  }
51
+ type GettyVideoAdminEditorViewModelResponse = {
52
+ assetId: string;
53
+ token: string;
54
+ isGettyAsset: string;
55
+ videoPreviewAsset: {
56
+ uri: string;
57
+ };
58
+ imagePreviewAsset: {
59
+ uri: string;
60
+ };
61
+ };
51
62
  export type InitialisePayload = Omit<BrandPageContainerState, 'customDomain' | 'customDomainConfig'> & {
52
63
  logoDraftToken?: string;
53
64
  brandPageCustomDomain?: CustomDomainModel;
54
65
  isBrandPageCustomDomainEnabled: boolean;
55
66
  logoTemplateAsset: LogoTemplateAsset | undefined;
56
67
  logoDraftAssets: LogoDraftAsset[];
68
+ gettyVideos: GettyVideoAdminEditorViewModelResponse[];
57
69
  };
58
70
  export declare const BRANDPAGE_STATUS: Readonly<{
59
71
  Published: "Published";
@@ -279,3 +291,4 @@ export declare const useBrandPageContainerStore: import("pinia").StoreDefinition
279
291
  isCustomDomainEnabled: any;
280
292
  }): Promise<void>;
281
293
  }>;
294
+ export {};
@@ -1,6 +1,6 @@
1
1
  import { defineStore } from 'pinia';
2
2
  import brandPageClient from '../../../clients/brand-page-client';
3
- import { useBrandPageMakerStore, useBrandPageMakerUserStore, useLocalisedRouteStore, useLogoStore, useUiStore, } from '../../stores';
3
+ import { useBrandPageMakerStore, useBrandPageMakerUserStore, useLocalisedRouteStore, useLogoStore, useUiStore, useVideoStore, } from '../../stores';
4
4
  import { SIDE_BAR_TAB_NAMES } from '../../constants';
5
5
  import { BRAND_PAGE_TYPES, SENSITIVE_CONTENT_TYPES, getAbTestResults, getValueType, } from '../../../brand-page';
6
6
  import { isLogoContent } from '../../../brand-page/utils';
@@ -11,6 +11,7 @@ import { useShopConfigStore } from '../../../shared/ecommerce-settings/store/sho
11
11
  import { TRIGGER_TYPE, UPGRADE_CTA_LOCATIONS, useEventTracker, } from '../../composables/useEventTracker';
12
12
  import { navigationTr } from '../../../composables/useTranslate';
13
13
  import { errorTr, constantsTr } from '../../../composables/useTranslate';
14
+ import { findValuesByKey } from '../../../helpers/ts.helper';
14
15
  export const BRANDPAGE_STATUS = Object.freeze({
15
16
  Published: 'Published',
16
17
  Unpublished: 'Unpublished',
@@ -68,6 +69,7 @@ export const useBrandPageContainerStore = defineStore('brandPageContainer', {
68
69
  actions: {
69
70
  initialise(payload) {
70
71
  const localisedRouteStore = useLocalisedRouteStore();
72
+ const videoStore = useVideoStore();
71
73
  if (process.env.NODE_ENV !== 'production') {
72
74
  if (typeof localisedRouteStore.baseBrandPageDomain !== 'string') {
73
75
  console.error('brandPageBaseUrl should not be undefined');
@@ -130,6 +132,7 @@ export const useBrandPageContainerStore = defineStore('brandPageContainer', {
130
132
  if (payload.logoDraftToken) {
131
133
  uiStore.setLogoDraftToken({ logoDraftToken: payload.logoDraftToken });
132
134
  }
135
+ payload?.gettyVideos?.map((video) => videoStore.setVideoUrlsWithToken(video.token, video.videoPreviewAsset.uri, video.imagePreviewAsset.uri, video.assetId));
133
136
  },
134
137
  setDesignTemplateToken(payload) {
135
138
  this.designTemplateToken = payload.designTemplateToken;
@@ -464,6 +467,7 @@ export const useBrandPageContainerStore = defineStore('brandPageContainer', {
464
467
  const uiStore = useUiStore();
465
468
  const brandPageMakerStore = useBrandPageMakerStore();
466
469
  const shopSettingStore = useShopConfigStore();
470
+ const videoStore = useVideoStore();
467
471
  await brandPageMakerStore.validateContentItems();
468
472
  await brandPageMakerStore.validateBrandPageData();
469
473
  const brandPageData = cloneDeep(brandPageMakerStore.brandPageData);
@@ -516,6 +520,10 @@ export const useBrandPageContainerStore = defineStore('brandPageContainer', {
516
520
  .map((x) => x.logoImage.logoDraftToken)
517
521
  .filter((x) => !!x));
518
522
  }
523
+ const gettyAssetIds = [];
524
+ if (videoStore.videoUrls) {
525
+ Object.values(videoStore.videoUrls).map((video) => gettyAssetIds.push(video.assetId));
526
+ }
519
527
  return {
520
528
  designTemplateToken: this.designTemplateToken,
521
529
  logoDraftToken: uiStore.logoDraftToken, // TODO: remove this property after the release as second release for smooth release transition use below `logoDraftTokens`
@@ -526,6 +534,7 @@ export const useBrandPageContainerStore = defineStore('brandPageContainer', {
526
534
  : undefined,
527
535
  brandPageContentTypes: this.brandPageContentTypes,
528
536
  shouldPublish: this.isPublished,
537
+ gettyAssetIds,
529
538
  ...prepurchaseExportData,
530
539
  };
531
540
  },
@@ -659,11 +668,19 @@ export const useBrandPageContainerStore = defineStore('brandPageContainer', {
659
668
  if (!userStore.isAdmin) {
660
669
  throw new Error('saveTemplate is not allowed in non admin mode');
661
670
  }
662
- const data = JSON.stringify(brandPageMakerStore.brandPageTemplate);
671
+ const dataObject = brandPageMakerStore.brandPageTemplate;
672
+ const data = JSON.stringify(dataObject);
663
673
  if (typeof window?.parent?.saveTemplate !== 'function') {
664
674
  throw new Error('required saveTemplate function is undefined');
665
675
  }
666
- const success = await window.parent.saveTemplate(!this.designTemplateToken, data);
676
+ const gettyAssetIds = findValuesByKey(dataObject, 'gettyAssetId');
677
+ const exportedOptions = {
678
+ designAttributes: {
679
+ gettyAssetIds: gettyAssetIds,
680
+ hasGettyVideos: gettyAssetIds.length > 0,
681
+ },
682
+ };
683
+ const success = await window.parent.saveTemplate(!this.designTemplateToken, data, exportedOptions);
667
684
  if (success) {
668
685
  await brandPageMakerStore.enqueueSaveSuccessMessage({
669
686
  description: 'Template saved',
@@ -31,6 +31,7 @@ import { FabricRenderClient } from '../../../clients/fabric-render-client';
31
31
  import { useConsent } from '../../../brand-page/composables/consent.composable';
32
32
  import { commonTr, errorTr } from '../../../composables/useTranslate';
33
33
  import { UPGRADE_CTA_LOCATIONS } from '../../composables/useEventTracker';
34
+ import { useVideoStore } from '../video';
34
35
  const brandPageTypeTemplateTypeMap = {
35
36
  [BRAND_PAGE_TYPES.default]: 'Brand Page',
36
37
  [BRAND_PAGE_TYPES.brandSite]: 'Brand Site',
@@ -862,9 +863,10 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
862
863
  brandPageViewModel() {
863
864
  const userStore = useBrandPageMakerUserStore();
864
865
  const uiStore = useUiStore();
866
+ const videoStore = useVideoStore();
865
867
  if (userStore.isAdmin && uiStore.logoTheme) {
866
868
  const themedBrandPage = applyLogoThemeToBrandPageModel(uiStore.logoTheme, this.brandPageData).model;
867
- return getBrandPageViewModelFromBrandPageModel(themedBrandPage, this.brandPageToken);
869
+ return getBrandPageViewModelFromBrandPageModel(themedBrandPage, this.brandPageToken, undefined, undefined, { getVideoUrls: videoStore.getVideoUrlsForToken });
868
870
  }
869
871
  const showBrandCrowdLogo = userStore.features.showBrandCrowdLogo;
870
872
  if (process.env.NODE_ENV !== 'production') {
@@ -872,9 +874,9 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
872
874
  if (isModified) {
873
875
  console.error('BrandPageData styles should not contain STYLE_THEME key(s) when in non-admin mode');
874
876
  }
875
- return getBrandPageViewModelFromBrandPageModel(model, this.brandPageToken, showBrandCrowdLogo);
877
+ return getBrandPageViewModelFromBrandPageModel(model, this.brandPageToken, showBrandCrowdLogo, undefined, { getVideoUrls: videoStore.getVideoUrlsForToken });
876
878
  }
877
- return getBrandPageViewModelFromBrandPageModel(this.brandPageData, this.brandPageToken, showBrandCrowdLogo);
879
+ return getBrandPageViewModelFromBrandPageModel(this.brandPageData, this.brandPageToken, showBrandCrowdLogo, undefined, { getVideoUrls: videoStore.getVideoUrlsForToken });
878
880
  },
879
881
  isInteractivePreviewEnabled() {
880
882
  const uiStore = useUiStore();
@@ -6,3 +6,4 @@ export * from './brandpage-container';
6
6
  export * from './event-manager';
7
7
  export * from './route';
8
8
  export * from './logo-store';
9
+ export * from './video';
@@ -5,3 +5,4 @@ export * from './brandpage-container';
5
5
  export * from './event-manager';
6
6
  export * from './route';
7
7
  export * from './logo-store';
8
+ export * from './video';
@@ -0,0 +1 @@
1
+ export * from './video-store';
@@ -0,0 +1 @@
1
+ export * from './video-store';