@designcrowd/library.brand-page 5.15.21-gettyfinal → 5.15.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/src/{CreatedOnBrandCrowd-de-de-K-AgT_7y.js → CreatedOnBrandCrowd-de-de-DZ5Vucii.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-en-us-DX-eOXIJ.js → CreatedOnBrandCrowd-en-us-DknGL3Zu.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-es-es-solPysq-.js → CreatedOnBrandCrowd-es-es-NwtO4oKe.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-fr-DCdRbub4.js → CreatedOnBrandCrowd-fr-ca-DfUf3ajR.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-ca-DCdRbub4.js → CreatedOnBrandCrowd-fr-fr-DfUf3ajR.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-pt-CWy-ZMjD.js → CreatedOnBrandCrowd-pt-br-TjO5ceZp.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-br-CWy-ZMjD.js → CreatedOnBrandCrowd-pt-pt-TjO5ceZp.js} +1 -1
- package/lib/src/{CreatedOnDcom-de-de-CZNGEnA1.js → CreatedOnDcom-de-de-CiEaeern.js} +1 -1
- package/lib/src/{CreatedOnDcom-en-us-C9XDF01U.js → CreatedOnDcom-en-us-BsQTy39u.js} +1 -1
- package/lib/src/{CreatedOnDcom-es-es-BXZyfuHJ.js → CreatedOnDcom-es-es-BgUs8RD2.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-ca-zOsQivrO.js → CreatedOnDcom-fr-ca-5Rt16LTN.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-fr-DAtyVaxQ.js → CreatedOnDcom-fr-fr-DRajgiLq.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-br-aZ6Ws1mJ.js → CreatedOnDcom-pt-br-CpGsGCmj.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-pt-DytMZG1X.js → CreatedOnDcom-pt-pt-C1CjD8Ks.js} +1 -1
- package/lib/src/brand-page/components/media/Media.mixin.d.ts +0 -12
- package/lib/src/brand-page/components/media/Media.mixin.js +0 -5
- package/lib/src/brand-page/components/page/Page.stories.js +1 -1
- package/lib/src/brand-page/components/payment/__fixtures__/request-payment.d.ts +0 -1
- package/lib/src/brand-page/components/payment/__fixtures__/support-me.d.ts +0 -1
- package/lib/src/brand-page/models/brand-page-context.model.d.ts +0 -1
- package/lib/src/brand-page/models/index.d.ts +0 -16
- package/lib/src/brand-page/models/index.js +0 -19
- package/lib/src/brand-page/utils/view-model.util.d.ts +5 -16
- package/lib/src/brand-page/utils/view-model.util.js +8 -48
- package/lib/src/brand-page/view-models.d.ts +1 -19
- package/lib/src/brand-page-maker/components/action-bar/ActionBar.mixin.d.ts +0 -1
- package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.d.ts +0 -3
- package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.stories.js +0 -1
- package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMakerTemplateSettings.mixin.d.ts +0 -1
- package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.d.ts +0 -3
- package/lib/src/brand-page-maker/components/brandpage-settings/ReplaceImageSettingsForBrandPageSettings.mixin.d.ts +0 -1
- package/lib/src/brand-page-maker/components/preview/Preview.mixin.js +0 -1
- package/lib/src/brand-page-maker/components/preview/Preview.stories.js +1 -1
- package/lib/src/brand-page-maker/components/seo-settings/SeoPageSettings.mixin.d.ts +0 -1
- package/lib/src/brand-page-maker/components/seo-settings/UrlSettings.mixin.d.ts +0 -1
- package/lib/src/brand-page-maker/components/social-share/SocialShare.mixin.d.ts +0 -1
- package/lib/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.d.ts +0 -1
- package/lib/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.js +1 -7
- package/lib/src/brand-page-maker/constants/config-settings-constant.js +11 -28
- package/lib/src/brand-page-maker/stores/brandpage-container/brand-page-container-store.d.ts +0 -12
- package/lib/src/brand-page-maker/stores/brandpage-container/brand-page-container-store.js +3 -20
- package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.d.ts +0 -1
- package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.js +3 -24
- package/lib/src/brand-page-maker/stores/index.d.ts +0 -1
- package/lib/src/brand-page-maker/stores/index.js +0 -1
- package/lib/src/{bundled-translations-D9iHE5G9.js → bundled-translations-wzmaFfsm.js} +1 -1
- package/lib/src/bundles/bundled-translations.json +0 -4
- package/lib/src/clients/brand-page-client.js +1 -2
- package/lib/src/clients/gettyimages-client.js +1 -1
- package/lib/src/css/library.brand-page-brandCrowd.min.css +20 -20
- package/lib/src/css/library.brand-page-brandPage.min.css +20 -20
- package/lib/src/css/library.brand-page-designCom.min.css +20 -20
- package/lib/src/css/library.brand-page-preview.min.css +20 -20
- package/lib/src/helpers/ts.helper.d.ts +0 -1
- package/lib/src/helpers/ts.helper.js +0 -22
- package/lib/src/index.d.ts +1 -1
- package/lib/src/index.mjs +180 -183
- package/lib/src/{lib-Cwr-7uws.js → lib-BpQH-xbj.js} +17615 -17908
- package/lib/src/lib.js +1 -1
- package/lib/src/shared/content-settings/components/GenericTextInput.mixin.d.ts +1 -1
- package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.d.ts +0 -3
- package/lib/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.mixin.d.ts +1 -5
- package/lib/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.mixin.js +0 -4
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItem.mixin.d.ts +0 -2
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItem.mixin.js +0 -1
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.d.ts +0 -3
- package/lib/src/shared/content-settings/components/email-field/EmailField.mixin.d.ts +1 -1
- package/lib/src/shared/content-settings/components/focused-content-item-settings/FocusedContentItemSettings.mixin.d.ts +0 -2
- package/lib/src/shared/content-settings/components/focused-content-item-settings/FocusedContentItemSettings.mixin.js +0 -1
- package/lib/src/shared/content-settings/components/image-field/ImageField.mixin.d.ts +1 -23
- package/lib/src/shared/content-settings/components/image-field/ImageField.mixin.js +1 -25
- package/lib/src/shared/content-settings/components/tel-field/TelField.mixin.d.ts +1 -1
- package/lib/src/shared/content-settings/components/text-field/TextField.mixin.d.ts +1 -1
- package/lib/src/shared/content-settings/components/textarea-field/TextareaField.mixin.d.ts +1 -1
- package/lib/src/shared/content-settings/components/url-field/UrlField.mixin.d.ts +1 -1
- package/lib/src/shared/content-settings/components/youtube-video-field/YoutubeVideoField.mixin.d.ts +1 -1
- package/lib/src/shared/content-settings/models.d.ts +0 -2
- package/lib/src/shared/content-settings/store/content-settings-store.d.ts +0 -3
- package/lib/src/shared/content-settings/store/content-settings-store.js +1 -37
- package/lib/src/shared/logo-settings/components/LogoSettings.mixin.d.ts +0 -1
- package/lib/src/shared/my-uploads/models.d.ts +0 -12
- package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.d.ts +0 -3
- package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.d.ts +0 -3
- package/lib/src/shared/publish-brand-page-with-state/PublishBrandPageModalWithState.mixin.d.ts +0 -1
- package/lib/src/shared/style-settings/components/StyleSettings.mixin.d.ts +0 -1
- package/package.json +1 -1
- package/src/brand-page/components/banner-section/BannerSection.vue +1 -6
- package/src/brand-page/components/media/Media.mixin.ts +0 -6
- package/src/brand-page/components/media/Media.vue +3 -18
- package/src/brand-page/components/page/Page.stories.ts +0 -1
- package/src/brand-page/models/brand-page-context.model.ts +0 -1
- package/src/brand-page/models/index.ts +0 -34
- package/src/brand-page/utils/view-model.util.test.ts +2 -10
- package/src/brand-page/utils/view-model.util.ts +7 -93
- package/src/brand-page/view-models.ts +0 -24
- package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.stories.ts +0 -1
- package/src/brand-page-maker/components/preview/Preview.mixin.ts +0 -1
- package/src/brand-page-maker/components/preview/Preview.stories.ts +0 -1
- package/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.ts +0 -8
- package/src/brand-page-maker/constants/config-settings-constant.ts +10 -30
- package/src/brand-page-maker/stores/brandpage-container/brand-page-container-store.ts +1 -46
- package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.ts +0 -25
- package/src/brand-page-maker/stores/index.ts +0 -1
- package/src/bundles/bundled-translations.json +0 -4
- package/src/clients/brand-page-client.ts +1 -2
- package/src/clients/gettyimages-client.js +1 -1
- package/src/helpers/ts.helper.ts +0 -30
- package/src/lib.ts +0 -1
- package/src/shared/common/i18n/common.json +0 -2
- package/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.mixin.ts +1 -12
- package/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.vue +0 -1
- package/src/shared/content-settings/components/content-settings/i18n/content-settings.json +0 -4
- package/src/shared/content-settings/components/content-settings-item/ContentSettingsItem.mixin.ts +0 -1
- package/src/shared/content-settings/components/focused-content-item-settings/FocusedContentItemSettings.mixin.ts +0 -1
- package/src/shared/content-settings/components/image-field/ImageField.mixin.ts +1 -31
- package/src/shared/content-settings/components/replace-image-base-settings/ReplaceImageBaseSettings.vue +2 -10
- package/src/shared/content-settings/models.ts +0 -3
- package/src/shared/content-settings/store/content-settings-store.ts +0 -68
- package/src/shared/my-uploads/models.ts +0 -16
- package/src/shared/video-library/VideoLibrary.vue +11 -32
- package/lib/src/brand-page-maker/stores/video/index.d.ts +0 -1
- package/lib/src/brand-page-maker/stores/video/index.js +0 -1
- package/lib/src/brand-page-maker/stores/video/video-store.d.ts +0 -27
- package/lib/src/brand-page-maker/stores/video/video-store.js +0 -27
- package/src/brand-page/components/media/Video.vue +0 -62
- package/src/brand-page-maker/stores/video/index.ts +0 -1
- package/src/brand-page-maker/stores/video/video-store.ts +0 -47
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { defineComponent } from 'vue';
|
|
2
2
|
import type { PropType } from 'vue';
|
|
3
3
|
import type { BrandPageContext, ColorReplacement } from '../../models';
|
|
4
|
-
import type { MediaViewModel } from '../../../lib';
|
|
5
4
|
|
|
6
5
|
export default defineComponent({
|
|
7
6
|
props: {
|
|
@@ -63,11 +62,6 @@ export default defineComponent({
|
|
|
63
62
|
required: false,
|
|
64
63
|
default: undefined,
|
|
65
64
|
},
|
|
66
|
-
media: {
|
|
67
|
-
type: Object as PropType<MediaViewModel>,
|
|
68
|
-
required: false,
|
|
69
|
-
default: undefined,
|
|
70
|
-
},
|
|
71
65
|
},
|
|
72
66
|
data() {
|
|
73
67
|
return {
|
|
@@ -5,22 +5,8 @@
|
|
|
5
5
|
'tw-h-full tw-w-full': mediaType === 'shape',
|
|
6
6
|
}"
|
|
7
7
|
>
|
|
8
|
-
<Video
|
|
9
|
-
v-if="media && media.type === 'getty-video'"
|
|
10
|
-
:media="media"
|
|
11
|
-
:class="{ 'tw-flex tw-justify-center': size }"
|
|
12
|
-
:video-classes="imgClasses"
|
|
13
|
-
:display-style="displayStyle"
|
|
14
|
-
:context="context"
|
|
15
|
-
:content-index="contentIndex"
|
|
16
|
-
/>
|
|
17
8
|
<FallbackImage
|
|
18
|
-
v-if="
|
|
19
|
-
imageUrl &&
|
|
20
|
-
(mediaType === 'image' || !mediaType) &&
|
|
21
|
-
!isImageBroken &&
|
|
22
|
-
!media
|
|
23
|
-
"
|
|
9
|
+
v-if="imageUrl && (mediaType === 'image' || !mediaType) && !isImageBroken"
|
|
24
10
|
:image-url="imageUrl"
|
|
25
11
|
:alt="altText"
|
|
26
12
|
:classes="imgClasses"
|
|
@@ -41,7 +27,7 @@
|
|
|
41
27
|
/>
|
|
42
28
|
<Placeholder
|
|
43
29
|
v-if="
|
|
44
|
-
(context.isPreview &&
|
|
30
|
+
(context.isPreview && imageUrl === '') ||
|
|
45
31
|
(context.isPreview && isImageBroken)
|
|
46
32
|
"
|
|
47
33
|
class="tw-w-full"
|
|
@@ -56,10 +42,9 @@ import Shape from './Shape.vue';
|
|
|
56
42
|
import MediaMixin from './Media.mixin.ts';
|
|
57
43
|
import Placeholder from '../placeholder/Placeholder.vue';
|
|
58
44
|
import FallbackImage from '../fallback-image/FallbackImage.vue';
|
|
59
|
-
import Video from './Video.vue';
|
|
60
45
|
|
|
61
46
|
export default {
|
|
62
|
-
components: { Shape, Placeholder, FallbackImage
|
|
47
|
+
components: { Shape, Placeholder, FallbackImage },
|
|
63
48
|
mixins: [MediaMixin],
|
|
64
49
|
};
|
|
65
50
|
</script>
|
|
@@ -413,7 +413,6 @@ export interface BannerSectionContent extends Content {
|
|
|
413
413
|
overlayColor: BrandPageCssStyle;
|
|
414
414
|
overlayOpacity: number;
|
|
415
415
|
aspectRatio?: number | null;
|
|
416
|
-
media?: AbstractMedia;
|
|
417
416
|
}
|
|
418
417
|
|
|
419
418
|
export const MEDIA_TYPES = {
|
|
@@ -833,39 +832,6 @@ export abstract class AbstractPageFooterStyles {
|
|
|
833
832
|
}
|
|
834
833
|
}
|
|
835
834
|
|
|
836
|
-
//jyao: START: Media related entities and classes
|
|
837
|
-
export type MediaTypes = 'getty-video' | 'user-upload-video' | 'image';
|
|
838
|
-
|
|
839
|
-
export abstract class AbstractMedia {
|
|
840
|
-
abstract type: MediaTypes;
|
|
841
|
-
}
|
|
842
|
-
|
|
843
|
-
type GettyVideoMediaType = Partial<GettyVideoMedia>;
|
|
844
|
-
|
|
845
|
-
export class GettyVideoMedia extends AbstractMedia {
|
|
846
|
-
type: MediaTypes = 'getty-video';
|
|
847
|
-
gettyToken: string;
|
|
848
|
-
gettyAssetId: string;
|
|
849
|
-
mimeType: string;
|
|
850
|
-
|
|
851
|
-
settings: {
|
|
852
|
-
autoPlay?: boolean;
|
|
853
|
-
};
|
|
854
|
-
|
|
855
|
-
constructor(options: GettyVideoMediaType = {}) {
|
|
856
|
-
options = cloneDeep(options);
|
|
857
|
-
super();
|
|
858
|
-
|
|
859
|
-
this.type = 'getty-video';
|
|
860
|
-
this.gettyToken = options.gettyToken || '';
|
|
861
|
-
this.gettyAssetId = options.gettyAssetId || '';
|
|
862
|
-
this.mimeType = options.mimeType || '';
|
|
863
|
-
|
|
864
|
-
this.settings = options.settings || {};
|
|
865
|
-
}
|
|
866
|
-
}
|
|
867
|
-
//jyao: END of media related entities and classes
|
|
868
|
-
|
|
869
835
|
export class PageFooterDesktop extends AbstractPageFooterStyles {
|
|
870
836
|
constructor(options: AbstractPageFooterStylesType = {}) {
|
|
871
837
|
options = cloneDeep(options);
|
|
@@ -172,11 +172,7 @@ describe('view model util', () => {
|
|
|
172
172
|
};
|
|
173
173
|
|
|
174
174
|
// Act
|
|
175
|
-
const viewModel = mapToBannerSectionViewModel(
|
|
176
|
-
bannerContent,
|
|
177
|
-
pageStyles,
|
|
178
|
-
{},
|
|
179
|
-
);
|
|
175
|
+
const viewModel = mapToBannerSectionViewModel(bannerContent, pageStyles);
|
|
180
176
|
|
|
181
177
|
// Assert
|
|
182
178
|
const url = new URL(viewModel.imageUrl);
|
|
@@ -199,11 +195,7 @@ describe('view model util', () => {
|
|
|
199
195
|
};
|
|
200
196
|
|
|
201
197
|
// Act
|
|
202
|
-
const viewModel = mapToBannerSectionViewModel(
|
|
203
|
-
bannerContent,
|
|
204
|
-
pageStyles,
|
|
205
|
-
{},
|
|
206
|
-
);
|
|
198
|
+
const viewModel = mapToBannerSectionViewModel(bannerContent, pageStyles);
|
|
207
199
|
|
|
208
200
|
// Assert
|
|
209
201
|
const url = new URL(viewModel.imageUrl);
|
|
@@ -38,8 +38,6 @@ import type {
|
|
|
38
38
|
SensitiveContent,
|
|
39
39
|
BookingSectionContent,
|
|
40
40
|
TextShapeItem,
|
|
41
|
-
GettyVideoMedia,
|
|
42
|
-
AbstractMedia,
|
|
43
41
|
} from '../models';
|
|
44
42
|
import { ButtonStyles, SENSITIVE_CONTENT_TYPES, VIEWPORTS } from '../models';
|
|
45
43
|
import {
|
|
@@ -77,7 +75,6 @@ import type {
|
|
|
77
75
|
ShapesSectionViewModel,
|
|
78
76
|
ShopViewModel,
|
|
79
77
|
BookingSectionViewModel,
|
|
80
|
-
GettyVideoViewModel,
|
|
81
78
|
} from '../view-models';
|
|
82
79
|
import { isHexTransparent, setRgbAlpha } from './color.util';
|
|
83
80
|
import type { ContentTextStylePropertyKey } from '../constants';
|
|
@@ -664,69 +661,9 @@ const mapToContactFormViewModel = (
|
|
|
664
661
|
);
|
|
665
662
|
};
|
|
666
663
|
|
|
667
|
-
const mapGettyVideoToGettyVideoViewModel = (
|
|
668
|
-
media: GettyVideoMedia,
|
|
669
|
-
options: ViewModelMappingOptions,
|
|
670
|
-
): GettyVideoViewModel => {
|
|
671
|
-
if (!options.getVideoUrls?.(media.gettyToken)) {
|
|
672
|
-
const s3Urls = options.getS3VideoUrls?.(media.gettyToken);
|
|
673
|
-
|
|
674
|
-
if (s3Urls && s3Urls?.videoUrl) {
|
|
675
|
-
options.setVideoUrlsWithToken?.(
|
|
676
|
-
media.gettyToken,
|
|
677
|
-
s3Urls.videoUrl,
|
|
678
|
-
s3Urls.previewImageUrl,
|
|
679
|
-
media.gettyAssetId,
|
|
680
|
-
);
|
|
681
|
-
}
|
|
682
|
-
}
|
|
683
|
-
|
|
684
|
-
const videoUrls = options.getVideoUrls?.(media.gettyToken) || {
|
|
685
|
-
videoUrl: undefined,
|
|
686
|
-
previewImageUrl: undefined,
|
|
687
|
-
};
|
|
688
|
-
|
|
689
|
-
return {
|
|
690
|
-
type: 'getty-video',
|
|
691
|
-
gettyToken: media.gettyToken,
|
|
692
|
-
gettyAssetId: media.gettyAssetId,
|
|
693
|
-
mimeType: media.mimeType,
|
|
694
|
-
videoUrl: videoUrls.videoUrl,
|
|
695
|
-
previewImageUrl: videoUrls.previewImageUrl,
|
|
696
|
-
settings: {
|
|
697
|
-
autoPlay: media.settings?.autoPlay || false,
|
|
698
|
-
},
|
|
699
|
-
};
|
|
700
|
-
};
|
|
701
|
-
|
|
702
|
-
const mapMediaToContentViewModel = ({
|
|
703
|
-
media,
|
|
704
|
-
options,
|
|
705
|
-
}: {
|
|
706
|
-
media?: AbstractMedia;
|
|
707
|
-
options: ViewModelMappingOptions;
|
|
708
|
-
}) => {
|
|
709
|
-
if (!media) {
|
|
710
|
-
return undefined;
|
|
711
|
-
}
|
|
712
|
-
|
|
713
|
-
switch (media.type) {
|
|
714
|
-
case 'getty-video':
|
|
715
|
-
return mapGettyVideoToGettyVideoViewModel(
|
|
716
|
-
media as GettyVideoMedia,
|
|
717
|
-
options,
|
|
718
|
-
);
|
|
719
|
-
case 'image':
|
|
720
|
-
// TODO(jyao): Implement later
|
|
721
|
-
default:
|
|
722
|
-
throw new Error(`Unsupported media type: ${media.type}`);
|
|
723
|
-
}
|
|
724
|
-
};
|
|
725
|
-
|
|
726
664
|
export const mapToBannerSectionViewModel = (
|
|
727
665
|
content: BannerSectionContent,
|
|
728
666
|
styles: PageStyles,
|
|
729
|
-
options: ViewModelMappingOptions,
|
|
730
667
|
): BannerSectionViewModel => {
|
|
731
668
|
return applyViewModelTextStyles(
|
|
732
669
|
{
|
|
@@ -751,10 +688,6 @@ export const mapToBannerSectionViewModel = (
|
|
|
751
688
|
isFullWidth: true,
|
|
752
689
|
imageUrl: mapToBannerSectionImageUrl(content),
|
|
753
690
|
isBigImageType: isBigImageType(content.displayStyle),
|
|
754
|
-
mediaViewModel: mapMediaToContentViewModel({
|
|
755
|
-
media: content.media,
|
|
756
|
-
options,
|
|
757
|
-
}),
|
|
758
691
|
},
|
|
759
692
|
styles,
|
|
760
693
|
);
|
|
@@ -1131,7 +1064,7 @@ export const mapToViewModel =
|
|
|
1131
1064
|
(
|
|
1132
1065
|
styles: PageStyles,
|
|
1133
1066
|
brandPageType: BrandPageType,
|
|
1134
|
-
options:
|
|
1067
|
+
options?: { useOldLogoRenderSize: boolean },
|
|
1135
1068
|
) =>
|
|
1136
1069
|
(content: Content): ContentViewModel | undefined => {
|
|
1137
1070
|
switch (content.type) {
|
|
@@ -1200,7 +1133,6 @@ export const mapToViewModel =
|
|
|
1200
1133
|
return mapToBannerSectionViewModel(
|
|
1201
1134
|
content as BannerSectionContent,
|
|
1202
1135
|
styles,
|
|
1203
|
-
options,
|
|
1204
1136
|
);
|
|
1205
1137
|
|
|
1206
1138
|
case 'booking-section':
|
|
@@ -1266,29 +1198,11 @@ export const mapToViewModel =
|
|
|
1266
1198
|
}
|
|
1267
1199
|
};
|
|
1268
1200
|
|
|
1269
|
-
interface ViewModelMappingOptions {
|
|
1270
|
-
useOldLogoRenderSize?: boolean;
|
|
1271
|
-
getVideoUrls?: (token: string) => {
|
|
1272
|
-
videoUrl: string;
|
|
1273
|
-
previewImageUrl: string;
|
|
1274
|
-
};
|
|
1275
|
-
getS3VideoUrls?: (token: string) => {
|
|
1276
|
-
videoUrl: string;
|
|
1277
|
-
previewImageUrl: string;
|
|
1278
|
-
};
|
|
1279
|
-
setVideoUrlsWithToken?: (
|
|
1280
|
-
token: string,
|
|
1281
|
-
videoUrl: string,
|
|
1282
|
-
previewImageUrl: string,
|
|
1283
|
-
assetId: string,
|
|
1284
|
-
) => void;
|
|
1285
|
-
}
|
|
1286
|
-
|
|
1287
1201
|
export const getBrandPageViewModelFromBrandPageModel = (
|
|
1288
1202
|
model: BrandPageModel,
|
|
1289
1203
|
brandPageToken: string | undefined,
|
|
1290
1204
|
showBrandCrowdLogo = true,
|
|
1291
|
-
|
|
1205
|
+
useOldLogoRenderSize = false,
|
|
1292
1206
|
): BrandPageViewModel => {
|
|
1293
1207
|
const pages = model.pages.map((p) => {
|
|
1294
1208
|
const contents = p.contents
|
|
@@ -1296,7 +1210,7 @@ export const getBrandPageViewModelFromBrandPageModel = (
|
|
|
1296
1210
|
mapToViewModel(
|
|
1297
1211
|
model.styles,
|
|
1298
1212
|
model.brandPageType || BRAND_PAGE_TYPES.default,
|
|
1299
|
-
|
|
1213
|
+
{ useOldLogoRenderSize },
|
|
1300
1214
|
),
|
|
1301
1215
|
)
|
|
1302
1216
|
.filter((c) => c !== undefined) as ContentViewModel[];
|
|
@@ -1318,23 +1232,23 @@ export const getBrandPageViewModelFromBrandPageModel = (
|
|
|
1318
1232
|
model.pageHeaderDesktop,
|
|
1319
1233
|
model.styles,
|
|
1320
1234
|
pages,
|
|
1321
|
-
|
|
1235
|
+
useOldLogoRenderSize,
|
|
1322
1236
|
),
|
|
1323
1237
|
headerViewModelMobile: mapToPageHeaderViewModel(
|
|
1324
1238
|
model.pageHeaderMobile,
|
|
1325
1239
|
model.styles,
|
|
1326
1240
|
pages,
|
|
1327
|
-
|
|
1241
|
+
useOldLogoRenderSize,
|
|
1328
1242
|
),
|
|
1329
1243
|
footerViewModelDesktop: mapToPageFooterViewModel(
|
|
1330
1244
|
model.pageFooterDesktop,
|
|
1331
1245
|
model.styles,
|
|
1332
|
-
|
|
1246
|
+
useOldLogoRenderSize,
|
|
1333
1247
|
),
|
|
1334
1248
|
footerViewModelMobile: mapToPageFooterViewModel(
|
|
1335
1249
|
model.pageFooterMobile,
|
|
1336
1250
|
model.styles,
|
|
1337
|
-
|
|
1251
|
+
useOldLogoRenderSize,
|
|
1338
1252
|
),
|
|
1339
1253
|
brandPageType: model.brandPageType || BRAND_PAGE_TYPES.default,
|
|
1340
1254
|
faviconUrl: model.faviconUrl,
|
|
@@ -38,7 +38,6 @@ import type {
|
|
|
38
38
|
CookieOptions,
|
|
39
39
|
SensitiveContent,
|
|
40
40
|
BookingSectionContent,
|
|
41
|
-
MediaTypes,
|
|
42
41
|
} from './models';
|
|
43
42
|
import type { ImagesSectionContentDisplayStyle } from './constants';
|
|
44
43
|
|
|
@@ -172,29 +171,6 @@ export interface BannerSectionViewModel
|
|
|
172
171
|
buttonViewModel: ButtonViewModel;
|
|
173
172
|
isFullWidth: boolean;
|
|
174
173
|
isBigImageType: boolean;
|
|
175
|
-
mediaViewModel?: MediaViewModel;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
export interface MediaViewModel {
|
|
179
|
-
type: MediaTypes;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
// Note(jyao): We will construct the getty video url in the getty video vue component
|
|
183
|
-
export interface GettyVideoViewModel extends MediaViewModel {
|
|
184
|
-
type: 'getty-video';
|
|
185
|
-
gettyToken: string;
|
|
186
|
-
gettyAssetId: string;
|
|
187
|
-
mimeType: string;
|
|
188
|
-
videoUrl: string | undefined;
|
|
189
|
-
previewImageUrl: string | undefined;
|
|
190
|
-
settings: {
|
|
191
|
-
autoPlay: boolean;
|
|
192
|
-
};
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
export interface ImageMediaViewModel extends MediaViewModel {
|
|
196
|
-
type: 'image';
|
|
197
|
-
// TODO(jyao): Add image stuff later
|
|
198
174
|
}
|
|
199
175
|
|
|
200
176
|
export interface TextImageSectionViewModel {
|
|
@@ -25,7 +25,6 @@ import {
|
|
|
25
25
|
applyLogoImageToBrandPageTemplateModel,
|
|
26
26
|
applyLogoTemplateImageToBrandPageTemplateModel,
|
|
27
27
|
} from '../../../brand-page/utils/logo.util';
|
|
28
|
-
import { useVideoStore } from '../../../lib';
|
|
29
28
|
|
|
30
29
|
const DEBOUNCE_IN_MS = 250;
|
|
31
30
|
|
|
@@ -144,7 +143,6 @@ export default defineComponent({
|
|
|
144
143
|
options: {
|
|
145
144
|
disableNavigationSideMenu: true,
|
|
146
145
|
mediaSizes: MEDIA_SIZES.sizeThumb,
|
|
147
|
-
renderVideoAsImage: true,
|
|
148
146
|
},
|
|
149
147
|
isCapturingPreview: false,
|
|
150
148
|
};
|
|
@@ -261,8 +259,6 @@ export default defineComponent({
|
|
|
261
259
|
},
|
|
262
260
|
|
|
263
261
|
async updateViewModel(forceUpdate = true) {
|
|
264
|
-
const videoStore = useVideoStore();
|
|
265
|
-
|
|
266
262
|
let model = this.template.brandPageModel;
|
|
267
263
|
|
|
268
264
|
if (this.logoImageBase64Url) {
|
|
@@ -294,10 +290,6 @@ export default defineComponent({
|
|
|
294
290
|
model,
|
|
295
291
|
undefined,
|
|
296
292
|
false,
|
|
297
|
-
{
|
|
298
|
-
useOldLogoRenderSize: false,
|
|
299
|
-
getVideoUrls: videoStore.getS3VideoUrlsForToken,
|
|
300
|
-
},
|
|
301
293
|
);
|
|
302
294
|
|
|
303
295
|
if (forceUpdate) {
|
|
@@ -50,7 +50,6 @@ import {
|
|
|
50
50
|
DEFAULT_SHAPE_SIZE,
|
|
51
51
|
PAYMENT_OPTION_DISPLAY_TYPES,
|
|
52
52
|
PAYMENT_OPTION_IMAGE_TYPES,
|
|
53
|
-
GettyVideoMedia,
|
|
54
53
|
} from '../../brand-page';
|
|
55
54
|
import type {
|
|
56
55
|
ContentSettingsConfig,
|
|
@@ -169,7 +168,6 @@ import {
|
|
|
169
168
|
brandSiteTypeVisibilityAssessor,
|
|
170
169
|
} from '../assessors/brand-page-type-visibility.assessor';
|
|
171
170
|
import { contentSettingsTr } from '../../composables/useTranslate';
|
|
172
|
-
import type { GettyVideoMediaSelectedPayload } from '../../shared/my-uploads/models';
|
|
173
171
|
|
|
174
172
|
const MediaFieldNames = {
|
|
175
173
|
aspectRatio: 'aspectRatio',
|
|
@@ -430,13 +428,12 @@ const shopReplaceImageSettings =
|
|
|
430
428
|
desiredWidth: undefined,
|
|
431
429
|
});
|
|
432
430
|
|
|
433
|
-
// TOOD(jyao): This should be reworked to bannerSectionReplaceMediaSettings
|
|
434
431
|
const bannerSectionReplaceImageSettings =
|
|
435
432
|
(): ContentReplaceImageSettings<BannerSectionContent> => ({
|
|
436
433
|
tabs: ['MY_UPLOADS', 'IMAGE_LIBRARY', 'VIDEO_LIBRARY', 'SHAPE_LIBRARY'],
|
|
437
|
-
buttonTitleAdd: contentSettingsTr(`
|
|
438
|
-
titleAdd: contentSettingsTr(`
|
|
439
|
-
titleReplace: contentSettingsTr(`
|
|
434
|
+
buttonTitleAdd: contentSettingsTr(`addImageButtonTitle`),
|
|
435
|
+
titleAdd: contentSettingsTr(`addImageHeaderTitle`),
|
|
436
|
+
titleReplace: contentSettingsTr(`imageReplaceTitle`),
|
|
440
437
|
contentMediaFieldName: MediaFieldNames.avatarImageUrl,
|
|
441
438
|
openByDefault: false,
|
|
442
439
|
mediaType: MEDIA_TYPES.image,
|
|
@@ -448,30 +445,13 @@ const bannerSectionReplaceImageSettings =
|
|
|
448
445
|
content: BannerSectionContent,
|
|
449
446
|
value: SetContentMediaPayload,
|
|
450
447
|
) => {
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
content.media = new GettyVideoMedia({
|
|
455
|
-
gettyToken: gettyMedia.token,
|
|
456
|
-
gettyAssetId: gettyMedia.assetId,
|
|
457
|
-
mimeType: gettyMedia.mimeType,
|
|
458
|
-
settings: {
|
|
459
|
-
autoPlay: gettyMedia.autoPlay,
|
|
460
|
-
},
|
|
461
|
-
});
|
|
462
|
-
content.imageUrl = '';
|
|
463
|
-
} else {
|
|
464
|
-
content.imageUrl = value.imageUrl;
|
|
465
|
-
content.mediaType = MEDIA_TYPES.image;
|
|
466
|
-
|
|
467
|
-
// Note(jyao): Temporarily here until we move all images/shapes to media
|
|
468
|
-
content.media = undefined;
|
|
448
|
+
content.imageUrl = value.imageUrl;
|
|
449
|
+
content.mediaType = MEDIA_TYPES.image;
|
|
469
450
|
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
}
|
|
451
|
+
if (isValidSvgUrl(content.imageUrl)) {
|
|
452
|
+
content.size = DEFAULT_SHAPE_SIZE;
|
|
453
|
+
content.mediaType = MEDIA_TYPES.shape;
|
|
454
|
+
content.colorReplacements = value.colorReplacements || [];
|
|
475
455
|
}
|
|
476
456
|
},
|
|
477
457
|
});
|
|
@@ -2233,7 +2213,7 @@ export const BANNER_SECTION_SETTINGS_CONFIG =
|
|
|
2233
2213
|
imageUrl: {
|
|
2234
2214
|
type: 'image',
|
|
2235
2215
|
replaceImageSettings: bannerSectionReplaceImageSettings(),
|
|
2236
|
-
title: contentSettingsTr(`
|
|
2216
|
+
title: contentSettingsTr(`imageTitle`),
|
|
2237
2217
|
groupId: SETTINGS_STYLE_FIELD_GROUP_IDS.settings,
|
|
2238
2218
|
},
|
|
2239
2219
|
imageUrlOverride: {
|
|
@@ -6,7 +6,6 @@ import {
|
|
|
6
6
|
useLocalisedRouteStore,
|
|
7
7
|
useLogoStore,
|
|
8
8
|
useUiStore,
|
|
9
|
-
useVideoStore,
|
|
10
9
|
type LogoDraftAsset,
|
|
11
10
|
type LogoTemplateAsset,
|
|
12
11
|
} from '../../stores';
|
|
@@ -32,7 +31,6 @@ import {
|
|
|
32
31
|
import { navigationTr } from '../../../composables/useTranslate';
|
|
33
32
|
import type { WebsiteSlugCheckResponse } from '../../../brand-page-maker/models/api.model';
|
|
34
33
|
import { errorTr, constantsTr } from '../../../composables/useTranslate';
|
|
35
|
-
import { findValuesByKey } from '../../../helpers/ts.helper';
|
|
36
34
|
|
|
37
35
|
export interface BrandPageContainerState {
|
|
38
36
|
availableTaxes: any[];
|
|
@@ -81,18 +79,6 @@ export interface BrandPageContainerState {
|
|
|
81
79
|
isSubsequentPublish: boolean;
|
|
82
80
|
}
|
|
83
81
|
|
|
84
|
-
export type GettyVideoEditorViewModelResponse = {
|
|
85
|
-
assetId: string;
|
|
86
|
-
token: string;
|
|
87
|
-
isGettyAsset: string;
|
|
88
|
-
videoPreviewAsset: {
|
|
89
|
-
uri: string;
|
|
90
|
-
};
|
|
91
|
-
imagePreviewAsset: {
|
|
92
|
-
uri: string;
|
|
93
|
-
};
|
|
94
|
-
};
|
|
95
|
-
|
|
96
82
|
export type InitialisePayload = Omit<
|
|
97
83
|
BrandPageContainerState,
|
|
98
84
|
'customDomain' | 'customDomainConfig'
|
|
@@ -102,7 +88,6 @@ export type InitialisePayload = Omit<
|
|
|
102
88
|
isBrandPageCustomDomainEnabled: boolean;
|
|
103
89
|
logoTemplateAsset: LogoTemplateAsset | undefined;
|
|
104
90
|
logoDraftAssets: LogoDraftAsset[];
|
|
105
|
-
gettyVideos: GettyVideoEditorViewModelResponse[];
|
|
106
91
|
};
|
|
107
92
|
|
|
108
93
|
export const BRANDPAGE_STATUS = Object.freeze({
|
|
@@ -162,7 +147,6 @@ export const useBrandPageContainerStore = defineStore('brandPageContainer', {
|
|
|
162
147
|
actions: {
|
|
163
148
|
initialise(payload: InitialisePayload) {
|
|
164
149
|
const localisedRouteStore = useLocalisedRouteStore();
|
|
165
|
-
const videoStore = useVideoStore();
|
|
166
150
|
|
|
167
151
|
if (process.env.NODE_ENV !== 'production') {
|
|
168
152
|
if (
|
|
@@ -240,15 +224,6 @@ export const useBrandPageContainerStore = defineStore('brandPageContainer', {
|
|
|
240
224
|
if (payload.logoDraftToken) {
|
|
241
225
|
uiStore.setLogoDraftToken({ logoDraftToken: payload.logoDraftToken });
|
|
242
226
|
}
|
|
243
|
-
|
|
244
|
-
payload?.gettyVideos?.forEach((video) =>
|
|
245
|
-
videoStore.setVideoUrlsWithToken(
|
|
246
|
-
video.token,
|
|
247
|
-
video.videoPreviewAsset.uri,
|
|
248
|
-
video.imagePreviewAsset.uri,
|
|
249
|
-
video.assetId,
|
|
250
|
-
),
|
|
251
|
-
);
|
|
252
227
|
},
|
|
253
228
|
|
|
254
229
|
setDesignTemplateToken(payload) {
|
|
@@ -413,8 +388,6 @@ export const useBrandPageContainerStore = defineStore('brandPageContainer', {
|
|
|
413
388
|
|
|
414
389
|
this.setIsPublishing({ isPublishing: true });
|
|
415
390
|
|
|
416
|
-
const gettyVideoIds: string[] = brandPageMakerStore.gettyVideoIds;
|
|
417
|
-
|
|
418
391
|
try {
|
|
419
392
|
const response = await brandPageClient.setBrandPageSlugAsync(
|
|
420
393
|
brandPageMakerStore.brandPageType,
|
|
@@ -423,7 +396,6 @@ export const useBrandPageContainerStore = defineStore('brandPageContainer', {
|
|
|
423
396
|
slug,
|
|
424
397
|
shouldPublish,
|
|
425
398
|
brandPageContentTypes: this.brandPageContentTypes,
|
|
426
|
-
gettyVideoIds,
|
|
427
399
|
},
|
|
428
400
|
);
|
|
429
401
|
|
|
@@ -565,8 +537,6 @@ export const useBrandPageContainerStore = defineStore('brandPageContainer', {
|
|
|
565
537
|
|
|
566
538
|
this.setBrandPageCustomDomain({ customDomain: customDomainResponse });
|
|
567
539
|
|
|
568
|
-
const gettyVideoIds: string[] = brandPageMakerStore.gettyVideoIds;
|
|
569
|
-
|
|
570
540
|
if (customDomainResponse) {
|
|
571
541
|
const response = await brandPageClient.setBrandPageSlugAsync(
|
|
572
542
|
brandPageMakerStore.brandPageType,
|
|
@@ -575,7 +545,6 @@ export const useBrandPageContainerStore = defineStore('brandPageContainer', {
|
|
|
575
545
|
slug: bpSlug,
|
|
576
546
|
shouldPublish,
|
|
577
547
|
brandPageContentTypes: this.brandPageContentTypes,
|
|
578
|
-
gettyVideoIds,
|
|
579
548
|
},
|
|
580
549
|
);
|
|
581
550
|
|
|
@@ -829,8 +798,6 @@ export const useBrandPageContainerStore = defineStore('brandPageContainer', {
|
|
|
829
798
|
);
|
|
830
799
|
}
|
|
831
800
|
|
|
832
|
-
const gettyAssetIds = findValuesByKey(brandPageData, 'gettyAssetId');
|
|
833
|
-
|
|
834
801
|
return {
|
|
835
802
|
designTemplateToken: this.designTemplateToken,
|
|
836
803
|
logoDraftToken: uiStore.logoDraftToken, // TODO: remove this property after the release as second release for smooth release transition use below `logoDraftTokens`
|
|
@@ -841,7 +808,6 @@ export const useBrandPageContainerStore = defineStore('brandPageContainer', {
|
|
|
841
808
|
: undefined,
|
|
842
809
|
brandPageContentTypes: this.brandPageContentTypes,
|
|
843
810
|
shouldPublish: this.isPublished,
|
|
844
|
-
gettyAssetIds,
|
|
845
811
|
...prepurchaseExportData,
|
|
846
812
|
};
|
|
847
813
|
},
|
|
@@ -1042,26 +1008,15 @@ export const useBrandPageContainerStore = defineStore('brandPageContainer', {
|
|
|
1042
1008
|
throw new Error('saveTemplate is not allowed in non admin mode');
|
|
1043
1009
|
}
|
|
1044
1010
|
|
|
1045
|
-
const
|
|
1046
|
-
const data = JSON.stringify(dataObject);
|
|
1011
|
+
const data = JSON.stringify(brandPageMakerStore.brandPageTemplate);
|
|
1047
1012
|
|
|
1048
1013
|
if (typeof (window?.parent as any)?.saveTemplate !== 'function') {
|
|
1049
1014
|
throw new Error('required saveTemplate function is undefined');
|
|
1050
1015
|
}
|
|
1051
1016
|
|
|
1052
|
-
const gettyAssetIds = findValuesByKey(dataObject, 'gettyAssetId');
|
|
1053
|
-
|
|
1054
|
-
const exportedOptions = {
|
|
1055
|
-
designAttributes: {
|
|
1056
|
-
gettyAssetIds: gettyAssetIds,
|
|
1057
|
-
hasGettyVideos: gettyAssetIds.length > 0,
|
|
1058
|
-
},
|
|
1059
|
-
};
|
|
1060
|
-
|
|
1061
1017
|
const success = await (window.parent as any).saveTemplate(
|
|
1062
1018
|
!this.designTemplateToken,
|
|
1063
1019
|
data,
|
|
1064
|
-
exportedOptions,
|
|
1065
1020
|
);
|
|
1066
1021
|
|
|
1067
1022
|
if (success) {
|