@designcrowd/library.brand-page 5.15.21-ast-previews → 5.15.21-gettyfinal

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 (130) hide show
  1. package/lib/src/{CreatedOnBrandCrowd-de-de-B_xpayh-.js → CreatedOnBrandCrowd-de-de-K-AgT_7y.js} +1 -1
  2. package/lib/src/{CreatedOnBrandCrowd-en-us-vUtxwgjD.js → CreatedOnBrandCrowd-en-us-DX-eOXIJ.js} +1 -1
  3. package/lib/src/{CreatedOnBrandCrowd-es-es-F4XWuYlk.js → CreatedOnBrandCrowd-es-es-solPysq-.js} +1 -1
  4. package/lib/src/{CreatedOnBrandCrowd-fr-fr-Dp3p64Ng.js → CreatedOnBrandCrowd-fr-ca-DCdRbub4.js} +1 -1
  5. package/lib/src/{CreatedOnBrandCrowd-fr-ca-Dp3p64Ng.js → CreatedOnBrandCrowd-fr-fr-DCdRbub4.js} +1 -1
  6. package/lib/src/{CreatedOnBrandCrowd-pt-pt-DbvlKcTH.js → CreatedOnBrandCrowd-pt-br-CWy-ZMjD.js} +1 -1
  7. package/lib/src/{CreatedOnBrandCrowd-pt-br-DbvlKcTH.js → CreatedOnBrandCrowd-pt-pt-CWy-ZMjD.js} +1 -1
  8. package/lib/src/{CreatedOnDcom-de-de-CI0CBxU6.js → CreatedOnDcom-de-de-CZNGEnA1.js} +1 -1
  9. package/lib/src/{CreatedOnDcom-en-us-BeidG_AF.js → CreatedOnDcom-en-us-C9XDF01U.js} +1 -1
  10. package/lib/src/{CreatedOnDcom-es-es-PGD92ujM.js → CreatedOnDcom-es-es-BXZyfuHJ.js} +1 -1
  11. package/lib/src/{CreatedOnDcom-fr-ca-DDW5qahq.js → CreatedOnDcom-fr-ca-zOsQivrO.js} +1 -1
  12. package/lib/src/{CreatedOnDcom-fr-fr-H9uwg24x.js → CreatedOnDcom-fr-fr-DAtyVaxQ.js} +1 -1
  13. package/lib/src/{CreatedOnDcom-pt-br-DXzuBtQ6.js → CreatedOnDcom-pt-br-aZ6Ws1mJ.js} +1 -1
  14. package/lib/src/{CreatedOnDcom-pt-pt-DPNC6h9-.js → CreatedOnDcom-pt-pt-DytMZG1X.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/components/page/Page.stories.js +1 -1
  18. package/lib/src/brand-page/components/payment/__fixtures__/request-payment.d.ts +1 -0
  19. package/lib/src/brand-page/components/payment/__fixtures__/support-me.d.ts +1 -0
  20. package/lib/src/brand-page/models/brand-page-context.model.d.ts +1 -0
  21. package/lib/src/brand-page/models/index.d.ts +16 -0
  22. package/lib/src/brand-page/models/index.js +19 -0
  23. package/lib/src/brand-page/utils/view-model.util.d.ts +16 -5
  24. package/lib/src/brand-page/utils/view-model.util.js +48 -8
  25. package/lib/src/brand-page/view-models.d.ts +19 -1
  26. package/lib/src/brand-page-maker/components/action-bar/ActionBar.mixin.d.ts +1 -0
  27. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.d.ts +3 -0
  28. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.stories.js +1 -0
  29. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMakerTemplateSettings.mixin.d.ts +1 -0
  30. package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.d.ts +3 -0
  31. package/lib/src/brand-page-maker/components/brandpage-settings/ReplaceImageSettingsForBrandPageSettings.mixin.d.ts +1 -0
  32. package/lib/src/brand-page-maker/components/preview/Preview.mixin.js +1 -0
  33. package/lib/src/brand-page-maker/components/preview/Preview.stories.js +1 -1
  34. package/lib/src/brand-page-maker/components/seo-settings/SeoPageSettings.mixin.d.ts +1 -0
  35. package/lib/src/brand-page-maker/components/seo-settings/UrlSettings.mixin.d.ts +1 -0
  36. package/lib/src/brand-page-maker/components/social-share/SocialShare.mixin.d.ts +1 -0
  37. package/lib/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.d.ts +1 -227
  38. package/lib/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.js +12 -68
  39. package/lib/src/brand-page-maker/constants/config-settings-constant.js +28 -11
  40. package/lib/src/brand-page-maker/stores/brandpage-container/brand-page-container-store.d.ts +12 -0
  41. package/lib/src/brand-page-maker/stores/brandpage-container/brand-page-container-store.js +20 -3
  42. package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.d.ts +1 -0
  43. package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.js +24 -3
  44. package/lib/src/brand-page-maker/stores/index.d.ts +1 -0
  45. package/lib/src/brand-page-maker/stores/index.js +1 -0
  46. package/lib/src/brand-page-maker/stores/video/index.d.ts +1 -0
  47. package/lib/src/brand-page-maker/stores/video/index.js +1 -0
  48. package/lib/src/brand-page-maker/stores/video/video-store.d.ts +27 -0
  49. package/lib/src/brand-page-maker/stores/video/video-store.js +27 -0
  50. package/lib/src/{bundled-translations-wzmaFfsm.js → bundled-translations-D9iHE5G9.js} +1 -1
  51. package/lib/src/bundles/bundled-translations.json +4 -0
  52. package/lib/src/clients/brand-page-client.js +2 -1
  53. package/lib/src/clients/gettyimages-client.js +1 -1
  54. package/lib/src/css/library.brand-page-brandCrowd.min.css +24 -42
  55. package/lib/src/css/library.brand-page-brandPage.min.css +24 -42
  56. package/lib/src/css/library.brand-page-designCom.min.css +24 -42
  57. package/lib/src/css/library.brand-page-preview.min.css +24 -42
  58. package/lib/src/helpers/ts.helper.d.ts +1 -0
  59. package/lib/src/helpers/ts.helper.js +22 -0
  60. package/lib/src/index.d.ts +1 -1
  61. package/lib/src/index.mjs +183 -180
  62. package/lib/src/{lib-C-Ho4Aiu.js → lib-Cwr-7uws.js} +18034 -17805
  63. package/lib/src/lib.js +1 -1
  64. package/lib/src/shared/content-settings/components/GenericTextInput.mixin.d.ts +1 -1
  65. package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.d.ts +3 -0
  66. package/lib/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.mixin.d.ts +5 -1
  67. package/lib/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.mixin.js +4 -0
  68. package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItem.mixin.d.ts +2 -0
  69. package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItem.mixin.js +1 -0
  70. package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.d.ts +3 -0
  71. package/lib/src/shared/content-settings/components/email-field/EmailField.mixin.d.ts +1 -1
  72. package/lib/src/shared/content-settings/components/focused-content-item-settings/FocusedContentItemSettings.mixin.d.ts +2 -0
  73. package/lib/src/shared/content-settings/components/focused-content-item-settings/FocusedContentItemSettings.mixin.js +1 -0
  74. package/lib/src/shared/content-settings/components/image-field/ImageField.mixin.d.ts +23 -1
  75. package/lib/src/shared/content-settings/components/image-field/ImageField.mixin.js +25 -1
  76. package/lib/src/shared/content-settings/components/tel-field/TelField.mixin.d.ts +1 -1
  77. package/lib/src/shared/content-settings/components/text-field/TextField.mixin.d.ts +1 -1
  78. package/lib/src/shared/content-settings/components/textarea-field/TextareaField.mixin.d.ts +1 -1
  79. package/lib/src/shared/content-settings/components/url-field/UrlField.mixin.d.ts +1 -1
  80. package/lib/src/shared/content-settings/components/youtube-video-field/YoutubeVideoField.mixin.d.ts +1 -1
  81. package/lib/src/shared/content-settings/models.d.ts +2 -0
  82. package/lib/src/shared/content-settings/store/content-settings-store.d.ts +3 -0
  83. package/lib/src/shared/content-settings/store/content-settings-store.js +37 -1
  84. package/lib/src/shared/logo-settings/components/LogoSettings.mixin.d.ts +1 -0
  85. package/lib/src/shared/my-uploads/models.d.ts +12 -0
  86. package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.d.ts +3 -0
  87. package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.d.ts +3 -0
  88. package/lib/src/shared/publish-brand-page-with-state/PublishBrandPageModalWithState.mixin.d.ts +1 -0
  89. package/lib/src/shared/style-settings/components/StyleSettings.mixin.d.ts +1 -0
  90. package/lib/src/shared/template-settings/store/template-settings-store.js +4 -11
  91. package/package.json +1 -1
  92. package/src/brand-page/components/banner-section/BannerSection.vue +6 -1
  93. package/src/brand-page/components/media/Media.mixin.ts +6 -0
  94. package/src/brand-page/components/media/Media.vue +18 -3
  95. package/src/brand-page/components/media/Video.vue +62 -0
  96. package/src/brand-page/components/page/Page.stories.ts +1 -0
  97. package/src/brand-page/models/brand-page-context.model.ts +1 -0
  98. package/src/brand-page/models/index.ts +34 -0
  99. package/src/brand-page/utils/view-model.util.test.ts +10 -2
  100. package/src/brand-page/utils/view-model.util.ts +93 -7
  101. package/src/brand-page/view-models.ts +24 -0
  102. package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.stories.ts +1 -0
  103. package/src/brand-page-maker/components/preview/Preview.mixin.ts +1 -0
  104. package/src/brand-page-maker/components/preview/Preview.stories.ts +1 -0
  105. package/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.ts +12 -84
  106. package/src/brand-page-maker/components/template-preview/TemplatePreview.vue +4 -40
  107. package/src/brand-page-maker/constants/config-settings-constant.ts +30 -10
  108. package/src/brand-page-maker/stores/brandpage-container/brand-page-container-store.ts +46 -1
  109. package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.ts +25 -0
  110. package/src/brand-page-maker/stores/index.ts +1 -0
  111. package/src/brand-page-maker/stores/video/index.ts +1 -0
  112. package/src/brand-page-maker/stores/video/video-store.ts +47 -0
  113. package/src/bundles/bundled-translations.json +4 -0
  114. package/src/clients/brand-page-client.ts +2 -1
  115. package/src/clients/gettyimages-client.js +1 -1
  116. package/src/helpers/ts.helper.ts +30 -0
  117. package/src/lib.ts +1 -0
  118. package/src/shared/common/i18n/common.json +2 -0
  119. package/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.mixin.ts +12 -1
  120. package/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.vue +1 -0
  121. package/src/shared/content-settings/components/content-settings/i18n/content-settings.json +4 -0
  122. package/src/shared/content-settings/components/content-settings-item/ContentSettingsItem.mixin.ts +1 -0
  123. package/src/shared/content-settings/components/focused-content-item-settings/FocusedContentItemSettings.mixin.ts +1 -0
  124. package/src/shared/content-settings/components/image-field/ImageField.mixin.ts +31 -1
  125. package/src/shared/content-settings/components/replace-image-base-settings/ReplaceImageBaseSettings.vue +10 -2
  126. package/src/shared/content-settings/models.ts +3 -0
  127. package/src/shared/content-settings/store/content-settings-store.ts +68 -0
  128. package/src/shared/my-uploads/models.ts +16 -0
  129. package/src/shared/template-settings/store/template-settings-store.ts +6 -11
  130. package/src/shared/video-library/VideoLibrary.vue +32 -11
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as e, openBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-C-Ho4Aiu.js";
2
+ import { _ as t } from "./lib-Cwr-7uws.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-C-Ho4Aiu.js";
2
+ import { _ as t } from "./lib-Cwr-7uws.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-C-Ho4Aiu.js";
2
+ import { _ as t } from "./lib-Cwr-7uws.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-C-Ho4Aiu.js";
2
+ import { _ as t } from "./lib-Cwr-7uws.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-C-Ho4Aiu.js";
2
+ import { _ as t } from "./lib-Cwr-7uws.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-C-Ho4Aiu.js";
2
+ import { _ as t } from "./lib-Cwr-7uws.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-C-Ho4Aiu.js";
2
+ import { _ as t } from "./lib-Cwr-7uws.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-C-Ho4Aiu.js";
2
+ import { _ as e } from "./lib-Cwr-7uws.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-C-Ho4Aiu.js";
2
+ import { _ as e } from "./lib-Cwr-7uws.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-C-Ho4Aiu.js";
2
+ import { _ as e } from "./lib-Cwr-7uws.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-C-Ho4Aiu.js";
2
+ import { _ as e } from "./lib-Cwr-7uws.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-C-Ho4Aiu.js";
2
+ import { _ as e } from "./lib-Cwr-7uws.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-C-Ho4Aiu.js";
2
+ import { _ as M } from "./lib-Cwr-7uws.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-C-Ho4Aiu.js";
2
+ import { _ as M } from "./lib-Cwr-7uws.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 { MediaViewModel } 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<MediaViewModel>;
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<MediaViewModel>;
134
+ required: false;
135
+ default: undefined;
136
+ };
126
137
  }>> & Readonly<{}>, {
138
+ media: MediaViewModel;
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 {
@@ -12,7 +12,7 @@ const pages = brandPageModel.pages.map((p) => ({
12
12
  ...p,
13
13
  isHidden: false,
14
14
  contents: p.contents
15
- .map(mapToViewModel(brandPageModel.styles, brandPageModel.brandPageType || BRAND_PAGE_TYPES.default))
15
+ .map(mapToViewModel(brandPageModel.styles, brandPageModel.brandPageType || BRAND_PAGE_TYPES.default, {}))
16
16
  .filter((x) => x !== undefined),
17
17
  }));
18
18
  const viewModel = {
@@ -22,6 +22,7 @@ export declare const context: {
22
22
  options?: {
23
23
  disableNavigationSideMenu?: boolean | undefined;
24
24
  mediaSizes?: "size1x" | "size2x" | "sizeThumb" | undefined;
25
+ renderVideoAsImage?: boolean | undefined;
25
26
  } | undefined;
26
27
  abTests?: import("../../../models").AbTest | undefined;
27
28
  isCapturingPreview: boolean;
@@ -22,6 +22,7 @@ export declare const context: {
22
22
  options?: {
23
23
  disableNavigationSideMenu?: boolean | undefined;
24
24
  mediaSizes?: "size1x" | "size2x" | "sizeThumb" | undefined;
25
+ renderVideoAsImage?: boolean | undefined;
25
26
  } | undefined;
26
27
  abTests?: import("../../../models").AbTest | undefined;
27
28
  isCapturingPreview: boolean;
@@ -69,6 +69,7 @@ export interface BrandPageContext {
69
69
  options?: {
70
70
  disableNavigationSideMenu?: boolean;
71
71
  mediaSizes?: MediaSizes;
72
+ renderVideoAsImage?: boolean;
72
73
  };
73
74
  abTests?: AbTest;
74
75
  /** Is brand page rendered for preview */
@@ -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,25 @@ 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, options: ViewModelMappingOptions) => BannerSectionViewModel;
9
9
  export declare const mapToImagesSectionViewModel: (content: ImagesSectionContent, styles: PageStyles, brandPageType: BrandPageType) => TextImageSectionViewModel;
10
10
  export declare const mapToBookingSectionViewModel: (content: BookingSectionContent, styles: PageStyles) => BookingSectionViewModel;
11
11
  export declare const mapToPageHeaderViewModel: (pageHeader: PageHeaderDesktop | PageHeaderMobile, pageStyles: PageStyles, pages: PageViewModel[], useOldLogoRenderSize?: boolean) => PageHeaderViewModel;
12
12
  export declare const mapToPageFooterViewModel: (pageFooter: PageFooterDesktop | PageFooterMobile, pageStyles: PageStyles, useOldLogoRenderSize?: boolean) => PageFooterViewModel;
13
- export declare const mapToViewModel: (styles: PageStyles, brandPageType: BrandPageType, options?: {
14
- useOldLogoRenderSize: boolean;
15
- }) => (content: Content) => ContentViewModel | undefined;
16
- export declare const getBrandPageViewModelFromBrandPageModel: (model: BrandPageModel, brandPageToken: string | undefined, showBrandCrowdLogo?: boolean, useOldLogoRenderSize?: boolean) => BrandPageViewModel;
13
+ export declare const mapToViewModel: (styles: PageStyles, brandPageType: BrandPageType, options: ViewModelMappingOptions) => (content: Content) => ContentViewModel | undefined;
14
+ interface ViewModelMappingOptions {
15
+ useOldLogoRenderSize?: boolean;
16
+ getVideoUrls?: (token: string) => {
17
+ videoUrl: string;
18
+ previewImageUrl: string;
19
+ };
20
+ getS3VideoUrls?: (token: string) => {
21
+ videoUrl: string;
22
+ previewImageUrl: string;
23
+ };
24
+ setVideoUrlsWithToken?: (token: string, videoUrl: string, previewImageUrl: string, assetId: string) => void;
25
+ }
26
+ export declare const getBrandPageViewModelFromBrandPageModel: (model: BrandPageModel, brandPageToken: string | undefined, showBrandCrowdLogo: boolean | undefined, options: ViewModelMappingOptions) => BrandPageViewModel;
17
27
  export declare const isLogoViewModel: (viewModel: ContentViewModel) => viewModel is LogoViewModel;
18
28
  /** for service.brand-page website preview by logo draft token */
19
29
  export declare const applyLogoImageToBrandPageViewModel: (viewModel: BrandPageViewModel, logoImage: LogoImageModel) => BrandPageViewModel;
@@ -29,3 +39,4 @@ export interface CriticalResourceURLs {
29
39
  * For service.brand-page to preload critical resources
30
40
  */
31
41
  export declare const getCriticalResourceURLs: (viewModel: BrandPageViewModel) => CriticalResourceURLs;
42
+ export {};
@@ -391,7 +391,43 @@ const mapToContactFormViewModel = (content, styles, brandPageType) => {
391
391
  content.layoutStyle !== '',
392
392
  }, styles);
393
393
  };
394
- export const mapToBannerSectionViewModel = (content, styles) => {
394
+ const mapGettyVideoToGettyVideoViewModel = (media, options) => {
395
+ if (!options.getVideoUrls?.(media.gettyToken)) {
396
+ const s3Urls = options.getS3VideoUrls?.(media.gettyToken);
397
+ if (s3Urls && s3Urls?.videoUrl) {
398
+ options.setVideoUrlsWithToken?.(media.gettyToken, s3Urls.videoUrl, s3Urls.previewImageUrl, media.gettyAssetId);
399
+ }
400
+ }
401
+ const videoUrls = options.getVideoUrls?.(media.gettyToken) || {
402
+ videoUrl: undefined,
403
+ previewImageUrl: undefined,
404
+ };
405
+ return {
406
+ type: 'getty-video',
407
+ gettyToken: media.gettyToken,
408
+ gettyAssetId: media.gettyAssetId,
409
+ mimeType: media.mimeType,
410
+ videoUrl: videoUrls.videoUrl,
411
+ previewImageUrl: videoUrls.previewImageUrl,
412
+ settings: {
413
+ autoPlay: media.settings?.autoPlay || false,
414
+ },
415
+ };
416
+ };
417
+ const mapMediaToContentViewModel = ({ media, options, }) => {
418
+ if (!media) {
419
+ return undefined;
420
+ }
421
+ switch (media.type) {
422
+ case 'getty-video':
423
+ return mapGettyVideoToGettyVideoViewModel(media, options);
424
+ case 'image':
425
+ // TODO(jyao): Implement later
426
+ default:
427
+ throw new Error(`Unsupported media type: ${media.type}`);
428
+ }
429
+ };
430
+ export const mapToBannerSectionViewModel = (content, styles, options) => {
395
431
  return applyViewModelTextStyles({
396
432
  ...content,
397
433
  role: content.type,
@@ -410,6 +446,10 @@ export const mapToBannerSectionViewModel = (content, styles) => {
410
446
  isFullWidth: true,
411
447
  imageUrl: mapToBannerSectionImageUrl(content),
412
448
  isBigImageType: isBigImageType(content.displayStyle),
449
+ mediaViewModel: mapMediaToContentViewModel({
450
+ media: content.media,
451
+ options,
452
+ }),
413
453
  }, styles);
414
454
  };
415
455
  const mapToAboutSectionViewModel = (content, styles) => {
@@ -675,7 +715,7 @@ export const mapToViewModel = (styles, brandPageType, options) => (content) => {
675
715
  case 'contact-form':
676
716
  return mapToContactFormViewModel(content, styles, brandPageType);
677
717
  case 'banner-section':
678
- return mapToBannerSectionViewModel(content, styles);
718
+ return mapToBannerSectionViewModel(content, styles, options);
679
719
  case 'booking-section':
680
720
  return mapToBookingSectionViewModel(content, styles);
681
721
  case 'about-section':
@@ -709,10 +749,10 @@ export const mapToViewModel = (styles, brandPageType, options) => (content) => {
709
749
  assertUnreachable();
710
750
  }
711
751
  };
712
- export const getBrandPageViewModelFromBrandPageModel = (model, brandPageToken, showBrandCrowdLogo = true, useOldLogoRenderSize = false) => {
752
+ export const getBrandPageViewModelFromBrandPageModel = (model, brandPageToken, showBrandCrowdLogo = true, options) => {
713
753
  const pages = model.pages.map((p) => {
714
754
  const contents = p.contents
715
- .map(mapToViewModel(model.styles, model.brandPageType || BRAND_PAGE_TYPES.default, { useOldLogoRenderSize }))
755
+ .map(mapToViewModel(model.styles, model.brandPageType || BRAND_PAGE_TYPES.default, options))
716
756
  .filter((c) => c !== undefined);
717
757
  return {
718
758
  title: p.title,
@@ -726,10 +766,10 @@ export const getBrandPageViewModelFromBrandPageModel = (model, brandPageToken, s
726
766
  pages,
727
767
  showBrandCrowdLogo,
728
768
  styles: model.styles,
729
- headerViewModelDesktop: mapToPageHeaderViewModel(model.pageHeaderDesktop, model.styles, pages, useOldLogoRenderSize),
730
- headerViewModelMobile: mapToPageHeaderViewModel(model.pageHeaderMobile, model.styles, pages, useOldLogoRenderSize),
731
- footerViewModelDesktop: mapToPageFooterViewModel(model.pageFooterDesktop, model.styles, useOldLogoRenderSize),
732
- footerViewModelMobile: mapToPageFooterViewModel(model.pageFooterMobile, model.styles, useOldLogoRenderSize),
769
+ headerViewModelDesktop: mapToPageHeaderViewModel(model.pageHeaderDesktop, model.styles, pages, options.useOldLogoRenderSize),
770
+ headerViewModelMobile: mapToPageHeaderViewModel(model.pageHeaderMobile, model.styles, pages, options.useOldLogoRenderSize),
771
+ footerViewModelDesktop: mapToPageFooterViewModel(model.pageFooterDesktop, model.styles, options.useOldLogoRenderSize),
772
+ footerViewModelMobile: mapToPageFooterViewModel(model.pageFooterMobile, model.styles, options.useOldLogoRenderSize),
733
773
  brandPageType: model.brandPageType || BRAND_PAGE_TYPES.default,
734
774
  faviconUrl: model.faviconUrl,
735
775
  ogImageUrl: model.ogImageUrl,
@@ -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 | undefined;
84
+ previewImageUrl: string | undefined;
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;
@@ -23,6 +23,7 @@ declare const _default: import("vue").DefineComponent<{}, {
23
23
  brandPageTemplate(): any;
24
24
  brandPageTitle(): string;
25
25
  brandPageViewModel(): import("../../../brand-page").BrandPageViewModel;
26
+ gettyVideoIds(): string[];
26
27
  isInteractivePreviewEnabled(): boolean;
27
28
  isProduction(): boolean;
28
29
  isPublishButtonEnabled(): boolean;
@@ -66,6 +66,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
66
66
  brandPageTemplate(): any;
67
67
  brandPageTitle(): string;
68
68
  brandPageViewModel(): import("../../../brand-page").BrandPageViewModel;
69
+ gettyVideoIds(): string[];
69
70
  isInteractivePreviewEnabled(): boolean;
70
71
  isProduction(): boolean;
71
72
  isPublishButtonEnabled(): boolean;
@@ -752,6 +753,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
752
753
  colorReplacements?: import("../../../brand-page").ColorReplacement[] | undefined;
753
754
  aspectRatio?: number | null | undefined;
754
755
  }): void;
756
+ _setSelectedItemMedia(selectedItemId: string | null, mediaPayload: import("../../../shared/my-uploads/models").MediaBaseSelectedPayload): void;
755
757
  _setItems({ items }: {
756
758
  items: import("../../../shared/content-settings/models").ContentItem<any>[];
757
759
  }): void;
@@ -827,6 +829,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
827
829
  colorReplacements?: import("../../../brand-page").ColorReplacement[] | undefined;
828
830
  aspectRatio?: number | null | undefined;
829
831
  }): void;
832
+ setSelectedItemMedia(selectedItemId: string | null, mediaPayload: import("../../../shared/my-uploads/models").MediaBaseSelectedPayload): void;
830
833
  setItems(payload: {
831
834
  items: import("../../../shared/content-settings/models").ContentItem<import("../../../brand-page").Content>[];
832
835
  }): void;
@@ -174,6 +174,7 @@ const InitialiseMakerStores = (options) => {
174
174
  triggerSaveSuccessMessage: false,
175
175
  abTests: {},
176
176
  isSubsequentPublish: false,
177
+ gettyVideos: [],
177
178
  });
178
179
  userStore.setIsAdmin({ isAdmin: options.isAdmin || false });
179
180
  userStore.setHasBrandPagePremiumSubscription(false);
@@ -13,6 +13,7 @@ declare const _default: import("vue").DefineComponent<{}, {
13
13
  brandPageTemplate(): any;
14
14
  brandPageTitle(): string;
15
15
  brandPageViewModel(): import("../../../lib").BrandPageViewModel;
16
+ gettyVideoIds(): string[];
16
17
  isInteractivePreviewEnabled(): boolean;
17
18
  isProduction(): boolean;
18
19
  isPublishButtonEnabled(): boolean;
@@ -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;
@@ -518,6 +520,7 @@ declare const _default: import("vue").DefineComponent<{}, {
518
520
  brandPageTemplate(): any;
519
521
  brandPageTitle(): string;
520
522
  brandPageViewModel(): import("../../../brand-page").BrandPageViewModel;
523
+ gettyVideoIds(): string[];
521
524
  isInteractivePreviewEnabled(): boolean;
522
525
  isProduction(): boolean;
523
526
  isPublishButtonEnabled(): boolean;
@@ -20,6 +20,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
20
20
  brandPageTemplate(): any;
21
21
  brandPageTitle(): string;
22
22
  brandPageViewModel(): import("../../../brand-page").BrandPageViewModel;
23
+ gettyVideoIds(): string[];
23
24
  isInteractivePreviewEnabled(): boolean;
24
25
  isProduction(): boolean;
25
26
  isPublishButtonEnabled(): boolean;
@@ -77,6 +77,7 @@ export default defineComponent({
77
77
  isServerRender: false,
78
78
  options: {
79
79
  mediaSizes: MEDIA_SIZES.size1x,
80
+ renderVideoAsImage: true,
80
81
  },
81
82
  stripePublishableKey: undefined,
82
83
  runtimeEnvironment: this.runtimeEnvironment,
@@ -15,7 +15,7 @@ const pages = [
15
15
  slug: '',
16
16
  isHidden: false,
17
17
  contents: brandPageData
18
- .contents.map(mapToViewModel(pageStyles, brandPageData.brandPageType || BRAND_PAGE_TYPES.default))
18
+ .contents.map(mapToViewModel(pageStyles, brandPageData.brandPageType || BRAND_PAGE_TYPES.default, {}))
19
19
  .filter((x) => x !== undefined),
20
20
  },
21
21
  ];
@@ -257,6 +257,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
257
257
  brandPageTemplate(): any;
258
258
  brandPageTitle(): string;
259
259
  brandPageViewModel(): import("../../../brand-page").BrandPageViewModel;
260
+ gettyVideoIds(): string[];
260
261
  isInteractivePreviewEnabled(): boolean;
261
262
  isProduction(): boolean;
262
263
  isPublishButtonEnabled(): boolean;
@@ -256,6 +256,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
256
256
  brandPageTemplate(): any;
257
257
  brandPageTitle(): string;
258
258
  brandPageViewModel(): import("../../../brand-page").BrandPageViewModel;
259
+ gettyVideoIds(): string[];
259
260
  isInteractivePreviewEnabled(): boolean;
260
261
  isProduction(): boolean;
261
262
  isPublishButtonEnabled(): boolean;
@@ -30,6 +30,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
30
30
  brandPageTemplate(): any;
31
31
  brandPageTitle(): string;
32
32
  brandPageViewModel(): import("../../../brand-page").BrandPageViewModel;
33
+ gettyVideoIds(): string[];
33
34
  isInteractivePreviewEnabled(): boolean;
34
35
  isProduction(): boolean;
35
36
  isPublishButtonEnabled(): boolean;