@designcrowd/library.brand-page 5.15.21-gettyfinal → 5.15.23
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-DVlAk_mx.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-en-us-DX-eOXIJ.js → CreatedOnBrandCrowd-en-us-i2KX3alI.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-es-es-solPysq-.js → CreatedOnBrandCrowd-es-es-ClzzzTI3.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-fr-DCdRbub4.js → CreatedOnBrandCrowd-fr-ca-D6dxQ5KM.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-ca-DCdRbub4.js → CreatedOnBrandCrowd-fr-fr-D6dxQ5KM.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-pt-CWy-ZMjD.js → CreatedOnBrandCrowd-pt-br-DmVuNb2Y.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-br-CWy-ZMjD.js → CreatedOnBrandCrowd-pt-pt-DmVuNb2Y.js} +1 -1
- package/lib/src/{CreatedOnDcom-de-de-CZNGEnA1.js → CreatedOnDcom-de-de-BXuZSAv5.js} +1 -1
- package/lib/src/{CreatedOnDcom-en-us-C9XDF01U.js → CreatedOnDcom-en-us-BUJtytFW.js} +1 -1
- package/lib/src/{CreatedOnDcom-es-es-BXZyfuHJ.js → CreatedOnDcom-es-es-6XTjYuA1.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-ca-zOsQivrO.js → CreatedOnDcom-fr-ca-DFWSAIta.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-fr-DAtyVaxQ.js → CreatedOnDcom-fr-fr-DKE1TLWp.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-br-aZ6Ws1mJ.js → CreatedOnDcom-pt-br-C_NMPYYH.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-pt-DytMZG1X.js → CreatedOnDcom-pt-pt-CdJEmjZb.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/models/payment.model.d.ts +7 -0
- 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 +1 -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 +1 -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-DfL3kp2E.js +27 -0
- package/lib/src/{bundled-translations-D9iHE5G9.js → bundled-translations-wzmaFfsm.js} +1 -1
- package/lib/src/bundled-translations.de-DE-C-Q--DoV.js +27 -0
- package/lib/src/bundled-translations.es-ES-C2bDEZN2.js +27 -0
- package/lib/src/bundled-translations.fr-CA-BT6vKgDQ.js +27 -0
- package/lib/src/bundled-translations.fr-FR-BekT99Kc.js +27 -0
- package/lib/src/bundled-translations.pt-BR-DjzgcAmv.js +27 -0
- package/lib/src/bundled-translations.pt-PT-ZxaU_1Hw.js +27 -0
- package/lib/src/bundles/bundled-translations.json +0 -4
- package/lib/src/clients/brand-page-client.d.ts +1 -0
- package/lib/src/clients/brand-page-client.js +10 -2
- package/lib/src/clients/gettyimages-client.js +1 -1
- package/lib/src/css/library.brand-page-brandCrowd.min.css +22 -25
- package/lib/src/css/library.brand-page-brandPage.min.css +22 -25
- package/lib/src/css/library.brand-page-designCom.min.css +22 -25
- package/lib/src/css/library.brand-page-preview.min.css +22 -25
- 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-D-d2RO3p.js} +18094 -18240
- 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 +1 -3
- package/lib/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.mixin.d.ts +2 -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 +1 -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/page-dropdown-field/PageDropdownField.mixin.d.ts +1 -0
- package/lib/src/shared/content-settings/components/payment-config-field/PaymentConfigField.mixin.d.ts +79 -1
- package/lib/src/shared/content-settings/components/payment-config-field/PaymentConfigField.mixin.js +16 -0
- 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 +1 -1
- package/lib/src/shared/my-uploads/models.d.ts +0 -12
- package/lib/src/shared/page-settings/components/new-page-modal/NewPageModal.mixin.d.ts +1 -0
- package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.d.ts +1 -3
- package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.d.ts +1 -3
- package/lib/src/shared/page-settings/store/page-settings-store.d.ts +2 -1
- package/lib/src/shared/page-settings/store/page-settings-store.js +35 -0
- 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 +2 -2
- 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/models/payment.model.ts +8 -0
- 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 +19 -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/payment-config-field/PaymentConfigField.mixin.ts +34 -0
- package/src/shared/content-settings/components/payment-config-field/PaymentConfigField.vue +23 -8
- 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/page-settings/store/page-settings-store.ts +58 -0
- 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/lib/src/bundled-translations-BMr0LtzI.js +0 -27
- package/lib/src/bundled-translations.de-DE-BDSwnN6z.js +0 -27
- package/lib/src/bundled-translations.es-ES-B4FHib2V.js +0 -27
- package/lib/src/bundled-translations.fr-CA-SQDJwXv_.js +0 -27
- package/lib/src/bundled-translations.fr-FR-B84T67W5.js +0 -27
- package/lib/src/bundled-translations.pt-BR-C9ZYeoLd.js +0 -27
- package/lib/src/bundled-translations.pt-PT-BB4hTIYd.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
|
@@ -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) {
|
|
@@ -98,8 +98,6 @@ import { FabricRenderClient } from '../../../clients/fabric-render-client';
|
|
|
98
98
|
import { useConsent } from '../../../brand-page/composables/consent.composable';
|
|
99
99
|
import { commonTr, errorTr } from '../../../composables/useTranslate';
|
|
100
100
|
import { UPGRADE_CTA_LOCATIONS } from '../../composables/useEventTracker';
|
|
101
|
-
import { useVideoStore } from '../video';
|
|
102
|
-
import { findValuesByKey } from '../../../helpers/ts.helper';
|
|
103
101
|
|
|
104
102
|
export interface NotificationMessage {
|
|
105
103
|
type: 'success' | 'warning' | 'error';
|
|
@@ -1362,7 +1360,6 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
|
|
|
1362
1360
|
brandPageViewModel(): BrandPageViewModel {
|
|
1363
1361
|
const userStore = useBrandPageMakerUserStore();
|
|
1364
1362
|
const uiStore = useUiStore();
|
|
1365
|
-
const videoStore = useVideoStore();
|
|
1366
1363
|
|
|
1367
1364
|
if (userStore.isAdmin && uiStore.logoTheme) {
|
|
1368
1365
|
const themedBrandPage = applyLogoThemeToBrandPageModel(
|
|
@@ -1373,13 +1370,6 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
|
|
|
1373
1370
|
return getBrandPageViewModelFromBrandPageModel(
|
|
1374
1371
|
themedBrandPage,
|
|
1375
1372
|
this.brandPageToken,
|
|
1376
|
-
undefined,
|
|
1377
|
-
{
|
|
1378
|
-
useOldLogoRenderSize: false,
|
|
1379
|
-
getVideoUrls: videoStore.getVideoUrlsForToken,
|
|
1380
|
-
getS3VideoUrls: videoStore.getS3VideoUrlsForToken,
|
|
1381
|
-
setVideoUrlsWithToken: videoStore.setVideoUrlsWithToken,
|
|
1382
|
-
},
|
|
1383
1373
|
);
|
|
1384
1374
|
}
|
|
1385
1375
|
|
|
@@ -1401,12 +1391,6 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
|
|
|
1401
1391
|
model,
|
|
1402
1392
|
this.brandPageToken,
|
|
1403
1393
|
showBrandCrowdLogo,
|
|
1404
|
-
{
|
|
1405
|
-
useOldLogoRenderSize: false,
|
|
1406
|
-
getVideoUrls: videoStore.getVideoUrlsForToken,
|
|
1407
|
-
getS3VideoUrls: videoStore.getS3VideoUrlsForToken,
|
|
1408
|
-
setVideoUrlsWithToken: videoStore.setVideoUrlsWithToken,
|
|
1409
|
-
},
|
|
1410
1394
|
);
|
|
1411
1395
|
}
|
|
1412
1396
|
|
|
@@ -1414,17 +1398,8 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
|
|
|
1414
1398
|
this.brandPageData,
|
|
1415
1399
|
this.brandPageToken,
|
|
1416
1400
|
showBrandCrowdLogo,
|
|
1417
|
-
{
|
|
1418
|
-
useOldLogoRenderSize: false,
|
|
1419
|
-
getVideoUrls: videoStore.getVideoUrlsForToken,
|
|
1420
|
-
getS3VideoUrls: videoStore.getS3VideoUrlsForToken,
|
|
1421
|
-
setVideoUrlsWithToken: videoStore.setVideoUrlsWithToken,
|
|
1422
|
-
},
|
|
1423
1401
|
);
|
|
1424
1402
|
},
|
|
1425
|
-
gettyVideoIds(): string[] {
|
|
1426
|
-
return findValuesByKey(this.brandPageData, 'gettyAssetId');
|
|
1427
|
-
},
|
|
1428
1403
|
isInteractivePreviewEnabled(): boolean {
|
|
1429
1404
|
const uiStore = useUiStore();
|
|
1430
1405
|
|
|
@@ -346,7 +346,6 @@
|
|
|
346
346
|
"addShapeLabel": "Add Shape",
|
|
347
347
|
"addImageLabel": "Add Image",
|
|
348
348
|
"addFaviconLabel": "Add Favicon",
|
|
349
|
-
"addMediaLabel": "Add Media",
|
|
350
349
|
"replaceFaviconLabel": "Replace Favicon",
|
|
351
350
|
"updateSettings": "Update Settings",
|
|
352
351
|
"shapeColor": "Shape Color",
|
|
@@ -453,7 +452,6 @@
|
|
|
453
452
|
"addImageButtonTitle": "Add image",
|
|
454
453
|
"addImageHeaderTitle": "Add image",
|
|
455
454
|
"imageReplaceTitle": "Replace image",
|
|
456
|
-
"replaceMediaTitle": "Replace media",
|
|
457
455
|
"imageGalleryAddButtonTitle": "Add images",
|
|
458
456
|
"imageGalleryReplaceTitle": "Add image",
|
|
459
457
|
"iconReplaceTitle": "Replace thumbnail",
|
|
@@ -574,8 +572,6 @@
|
|
|
574
572
|
"styleCircleOption": "Circle",
|
|
575
573
|
"mediaTypeImage": "image",
|
|
576
574
|
"mediaTypeShape": "shape",
|
|
577
|
-
"media": "Media",
|
|
578
|
-
"addMediaTitle": "Add media",
|
|
579
575
|
"firstNameLabel": "First name",
|
|
580
576
|
"lastNameLabel": "Last name",
|
|
581
577
|
"emailAddressLabel": "Email address",
|
|
@@ -100,7 +100,7 @@ const setBrandPageSlugAsync = async (
|
|
|
100
100
|
designDraftToken,
|
|
101
101
|
options,
|
|
102
102
|
): Promise<PublishBrandPageResponse | null> => {
|
|
103
|
-
const { slug, shouldPublish, brandPageContentTypes
|
|
103
|
+
const { slug, shouldPublish, brandPageContentTypes } = options;
|
|
104
104
|
|
|
105
105
|
const url = `${getApiUrlPrefix(brandPageType)}/${designDraftToken}/publish`;
|
|
106
106
|
|
|
@@ -108,7 +108,6 @@ const setBrandPageSlugAsync = async (
|
|
|
108
108
|
slug,
|
|
109
109
|
shouldPublish,
|
|
110
110
|
brandPageContentTypes: brandPageContentTypes || [],
|
|
111
|
-
gettyVideoIds: gettyVideoIds || [],
|
|
112
111
|
});
|
|
113
112
|
|
|
114
113
|
if (response.status !== 200) {
|
|
@@ -377,6 +376,23 @@ const sendLogoSearchImpressionClickData = async (
|
|
|
377
376
|
}
|
|
378
377
|
};
|
|
379
378
|
|
|
379
|
+
const updatePaymentConfigCurrencyAsync = async (
|
|
380
|
+
brandPageToken: string,
|
|
381
|
+
paymentConfigId: string,
|
|
382
|
+
newCurrencyId: string,
|
|
383
|
+
) => {
|
|
384
|
+
const url = `${getApiUrlPrefix(
|
|
385
|
+
BRAND_PAGE_TYPES.default,
|
|
386
|
+
)}/${brandPageToken}/payment-configs/update-currency`;
|
|
387
|
+
|
|
388
|
+
const response = await getAxiosInstance().put(url, {
|
|
389
|
+
paymentConfigId,
|
|
390
|
+
newCurrencyId,
|
|
391
|
+
});
|
|
392
|
+
|
|
393
|
+
return response.data;
|
|
394
|
+
};
|
|
395
|
+
|
|
380
396
|
export default {
|
|
381
397
|
saveBrandPageAsync,
|
|
382
398
|
setBrandPageSlugAsync,
|
|
@@ -395,4 +411,5 @@ export default {
|
|
|
395
411
|
checkWebsiteSlugAsync,
|
|
396
412
|
searchLogoTemplatesAsync,
|
|
397
413
|
sendLogoSearchImpressionClickData,
|
|
414
|
+
updatePaymentConfigCurrencyAsync,
|
|
398
415
|
};
|
|
@@ -12,7 +12,7 @@ export default class GettyImagesClient {
|
|
|
12
12
|
`${this.options.mediaBaseUrl}/maker/api/gettyimages/search/videos?query=${query}&page=${pageNo}&perpage=10`;
|
|
13
13
|
|
|
14
14
|
getVideoEndpoint = (videoId) =>
|
|
15
|
-
`${this.options.mediaBaseUrl}/maker/api/gettyimages/video-preview?assetId=${videoId}
|
|
15
|
+
`${this.options.mediaBaseUrl}/maker/api/gettyimages/video-preview?assetId=${videoId}`;
|
|
16
16
|
|
|
17
17
|
async getDefaultCategoriesAsync() {
|
|
18
18
|
try {
|
package/src/helpers/ts.helper.ts
CHANGED
|
@@ -52,33 +52,3 @@ export function sanitiseObject(obj) {
|
|
|
52
52
|
return ac;
|
|
53
53
|
}, {});
|
|
54
54
|
}
|
|
55
|
-
|
|
56
|
-
export const findValuesByKey = (
|
|
57
|
-
obj: any,
|
|
58
|
-
keyToFind: string,
|
|
59
|
-
results: string[] = [],
|
|
60
|
-
) => {
|
|
61
|
-
if (typeof obj !== 'object' || obj === null) {
|
|
62
|
-
return results;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
if (Array.isArray(obj)) {
|
|
66
|
-
for (const item of obj) {
|
|
67
|
-
findValuesByKey(item, keyToFind, results);
|
|
68
|
-
}
|
|
69
|
-
} else {
|
|
70
|
-
for (const key in obj) {
|
|
71
|
-
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
72
|
-
const value = obj[key];
|
|
73
|
-
|
|
74
|
-
if (key === keyToFind && value && typeof value === 'string') {
|
|
75
|
-
results.push(value);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
findValuesByKey(value, keyToFind, results);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
return results;
|
|
84
|
-
};
|
package/src/lib.ts
CHANGED