@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
|
@@ -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) {
|
|
@@ -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
|
@@ -6,10 +6,7 @@ import type {
|
|
|
6
6
|
ReplaceImageSettingsTabId,
|
|
7
7
|
} from '../../models';
|
|
8
8
|
import { ReplaceImageSettingsTabIds } from '../../models';
|
|
9
|
-
import type {
|
|
10
|
-
MediaBaseSelectedPayload,
|
|
11
|
-
UserMediaItemWithDimensions,
|
|
12
|
-
} from '../../../my-uploads/models';
|
|
9
|
+
import type { UserMediaItemWithDimensions } from '../../../my-uploads/models';
|
|
13
10
|
import { useUiContentSettingsStore } from '../../store';
|
|
14
11
|
import {
|
|
15
12
|
useBrandPageMakerUserStore,
|
|
@@ -240,13 +237,5 @@ export default defineComponent({
|
|
|
240
237
|
});
|
|
241
238
|
this.contentSettingsStore.popMode();
|
|
242
239
|
},
|
|
243
|
-
onVideoSelected(videoPayload: MediaBaseSelectedPayload) {
|
|
244
|
-
this.contentSettingsStore.setSelectedItemMedia(
|
|
245
|
-
this.selectedItemId,
|
|
246
|
-
videoPayload,
|
|
247
|
-
);
|
|
248
|
-
|
|
249
|
-
this.contentSettingsStore.popMode();
|
|
250
|
-
},
|
|
251
240
|
},
|
|
252
241
|
});
|
|
@@ -50,7 +50,6 @@
|
|
|
50
50
|
"addImageButtonTitle": "Add image",
|
|
51
51
|
"addImageHeaderTitle": "Add image",
|
|
52
52
|
"imageReplaceTitle": "Replace image",
|
|
53
|
-
"replaceMediaTitle": "Replace media",
|
|
54
53
|
|
|
55
54
|
"imageGalleryAddButtonTitle": "Add images",
|
|
56
55
|
"imageGalleryReplaceTitle": "Add image",
|
|
@@ -185,9 +184,6 @@
|
|
|
185
184
|
"mediaTypeImage": "image",
|
|
186
185
|
"mediaTypeShape": "shape",
|
|
187
186
|
|
|
188
|
-
"media": "Media",
|
|
189
|
-
"addMediaTitle": "Add media",
|
|
190
|
-
|
|
191
187
|
"firstNameLabel": "First name",
|
|
192
188
|
"lastNameLabel": "Last name",
|
|
193
189
|
"emailAddressLabel": "Email address",
|
|
@@ -5,7 +5,6 @@ import BrandPageIcon from '../../../../brand-page/components/icon/Icon.vue';
|
|
|
5
5
|
import type { ContentItemFieldSettings } from '../../models';
|
|
6
6
|
import { isURL } from '../../../../utils/validator.util';
|
|
7
7
|
import { commonTr } from '../../../../composables/useTranslate';
|
|
8
|
-
import { useVideoStore } from '../../../../brand-page-maker/stores/video/video-store';
|
|
9
8
|
|
|
10
9
|
const ACCEPTED_MIME_TYPES = 'image/png, image/jpeg, image/svg+xml';
|
|
11
10
|
|
|
@@ -48,16 +47,6 @@ export default defineComponent({
|
|
|
48
47
|
required: false,
|
|
49
48
|
default: undefined,
|
|
50
49
|
},
|
|
51
|
-
mediaViewModel: {
|
|
52
|
-
type: Object,
|
|
53
|
-
required: false,
|
|
54
|
-
default: undefined,
|
|
55
|
-
},
|
|
56
|
-
content: {
|
|
57
|
-
type: Object,
|
|
58
|
-
required: false,
|
|
59
|
-
default: undefined,
|
|
60
|
-
},
|
|
61
50
|
},
|
|
62
51
|
emits: ['update:modelValue', 'on-intent-image-replace'],
|
|
63
52
|
data() {
|
|
@@ -72,24 +61,6 @@ export default defineComponent({
|
|
|
72
61
|
|
|
73
62
|
imageUrl: {
|
|
74
63
|
get(): string {
|
|
75
|
-
if (
|
|
76
|
-
this.content?.type === 'banner-section' &&
|
|
77
|
-
this.content?.media?.type === 'getty-video' &&
|
|
78
|
-
this.name === 'imageUrl'
|
|
79
|
-
) {
|
|
80
|
-
const gettyToken = this.content?.media.gettyToken;
|
|
81
|
-
|
|
82
|
-
if (gettyToken) {
|
|
83
|
-
const videoStore = useVideoStore();
|
|
84
|
-
|
|
85
|
-
const videoUrls = videoStore.getVideoUrlsForToken(gettyToken);
|
|
86
|
-
|
|
87
|
-
if (videoUrls?.previewImageUrl) {
|
|
88
|
-
return videoUrls.previewImageUrl;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
64
|
return this.imgValue;
|
|
94
65
|
},
|
|
95
66
|
set(newVal: string): void {
|
|
@@ -104,7 +75,7 @@ export default defineComponent({
|
|
|
104
75
|
addTitle(): string {
|
|
105
76
|
return this.mediaType === 'shape'
|
|
106
77
|
? commonTr('addShapeLabel')
|
|
107
|
-
: commonTr('
|
|
78
|
+
: commonTr('addImageLabel');
|
|
108
79
|
},
|
|
109
80
|
},
|
|
110
81
|
watch: {
|
|
@@ -122,7 +93,6 @@ export default defineComponent({
|
|
|
122
93
|
},
|
|
123
94
|
|
|
124
95
|
onRemove() {
|
|
125
|
-
this.content.media = undefined;
|
|
126
96
|
this.imgValue = '';
|
|
127
97
|
this.imageUrl = '';
|
|
128
98
|
},
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
<UnsplashLibrary @on-select-image="onDesignSelected" />
|
|
67
67
|
</div>
|
|
68
68
|
<div v-if="tab.id === 'VIDEO_LIBRARY'">
|
|
69
|
-
<VideoLibrary @on-select-video="
|
|
69
|
+
<VideoLibrary @on-select-video="onDesignSelected" />
|
|
70
70
|
</div>
|
|
71
71
|
<div v-if="tab.id === 'SHAPE_LIBRARY'">
|
|
72
72
|
<ShapeLibrary @on-select-image="onShapeSelected" />
|
|
@@ -91,10 +91,7 @@ import type {
|
|
|
91
91
|
ReplaceImageSettingsTabId,
|
|
92
92
|
ReplaceImageSettingsBase,
|
|
93
93
|
} from '../../models';
|
|
94
|
-
import type {
|
|
95
|
-
MediaBaseSelectedPayload,
|
|
96
|
-
UserMediaItemWithDimensions,
|
|
97
|
-
} from '../../../my-uploads/models';
|
|
94
|
+
import type { UserMediaItemWithDimensions } from '../../../my-uploads/models';
|
|
98
95
|
import {
|
|
99
96
|
useBrandPageContainerStore,
|
|
100
97
|
useBrandPageMakerUserStore,
|
|
@@ -179,7 +176,6 @@ const emit = defineEmits<{
|
|
|
179
176
|
aspectRatio: number;
|
|
180
177
|
},
|
|
181
178
|
];
|
|
182
|
-
'on-video-selected': [videoPayload: MediaBaseSelectedPayload];
|
|
183
179
|
}>();
|
|
184
180
|
|
|
185
181
|
const containerStore = useBrandPageContainerStore();
|
|
@@ -264,10 +260,6 @@ const onDesignSelected = (image: UserMediaItemWithDimensions) => {
|
|
|
264
260
|
emit('on-design-selected', image);
|
|
265
261
|
};
|
|
266
262
|
|
|
267
|
-
const onVideoSelected = (videoPayload: MediaBaseSelectedPayload) => {
|
|
268
|
-
emit('on-video-selected', videoPayload);
|
|
269
|
-
};
|
|
270
|
-
|
|
271
263
|
const switchActiveTab = (id: string) => {
|
|
272
264
|
tabs.value.forEach((tab: Tab) => {
|
|
273
265
|
tab.active = tab.id === id;
|
|
@@ -12,7 +12,6 @@ import type {
|
|
|
12
12
|
ValidateResult,
|
|
13
13
|
} from '../../brand-page-maker/models';
|
|
14
14
|
import type { UserState } from '../../brand-page-maker/stores';
|
|
15
|
-
import type { MediaBaseSelectedPayload } from '../my-uploads/models';
|
|
16
15
|
|
|
17
16
|
export interface ContentItemFieldSettings {
|
|
18
17
|
errorMessage: string;
|
|
@@ -51,7 +50,6 @@ export interface ContentReplaceImageSettings<TContent>
|
|
|
51
50
|
index?: number,
|
|
52
51
|
) => void;
|
|
53
52
|
}
|
|
54
|
-
|
|
55
53
|
export interface ReplaceImageSettingsBase {
|
|
56
54
|
tabs: ReplaceImageSettingsTabId[];
|
|
57
55
|
buttonTitleAdd: string;
|
|
@@ -75,7 +73,6 @@ export interface SetContentMediaPayload {
|
|
|
75
73
|
mediaType?: string;
|
|
76
74
|
size?: string;
|
|
77
75
|
imageLink: string;
|
|
78
|
-
media?: MediaBaseSelectedPayload;
|
|
79
76
|
}
|
|
80
77
|
|
|
81
78
|
export interface ContentItem<TContent> {
|
|
@@ -38,7 +38,6 @@ import {
|
|
|
38
38
|
useUiStore,
|
|
39
39
|
useBrandPageMakerUserStore,
|
|
40
40
|
useBrandPageMakerStore,
|
|
41
|
-
useVideoStore,
|
|
42
41
|
} from '../../../brand-page-maker/stores';
|
|
43
42
|
import { useUiSideBarStore } from '../../side-bar/store';
|
|
44
43
|
import {
|
|
@@ -52,12 +51,6 @@ import {
|
|
|
52
51
|
} from '../../../brand-page-maker/validators';
|
|
53
52
|
import { vueDeepMerge } from '../../../helpers/vue.helper';
|
|
54
53
|
|
|
55
|
-
import type {
|
|
56
|
-
GettyVideoMediaSelectedPayload,
|
|
57
|
-
MediaBaseSelectedPayload,
|
|
58
|
-
} from '../../my-uploads/models';
|
|
59
|
-
import {} from '../../../brand-page-maker/stores/video';
|
|
60
|
-
|
|
61
54
|
const DEFAULT_TEXT_COLOR_DEPENDENT_TYPES: readonly ContentType[] = [
|
|
62
55
|
'profile',
|
|
63
56
|
'text',
|
|
@@ -273,58 +266,6 @@ export const useUiContentSettingsStore = defineStore('uiContentSettings', {
|
|
|
273
266
|
this.selectedItemIndex ?? undefined,
|
|
274
267
|
);
|
|
275
268
|
},
|
|
276
|
-
_setSelectedItemMedia(
|
|
277
|
-
selectedItemId: string | null,
|
|
278
|
-
mediaPayload: MediaBaseSelectedPayload,
|
|
279
|
-
): void {
|
|
280
|
-
const selectedItem = this.items.find((i) => i.id === selectedItemId);
|
|
281
|
-
|
|
282
|
-
if (!selectedItem) {
|
|
283
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
284
|
-
throw new Error(
|
|
285
|
-
'unable to locate the selected item for setting video',
|
|
286
|
-
);
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
return;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
if (!this.selectedItemFieldName) {
|
|
293
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
294
|
-
throw new Error('selectedItemFieldName should be defined');
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
return;
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
const replaceImageSettings =
|
|
301
|
-
selectedItem.settings.fields[this.selectedItemFieldName]
|
|
302
|
-
.replaceImageSettings;
|
|
303
|
-
|
|
304
|
-
if (!replaceImageSettings) {
|
|
305
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
306
|
-
throw new Error('replaceImageSettings should be an object');
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
return;
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
replaceImageSettings.setContentMedia(selectedItem.settings.content, {
|
|
313
|
-
media: mediaPayload,
|
|
314
|
-
});
|
|
315
|
-
|
|
316
|
-
if (mediaPayload.type === 'getty-video') {
|
|
317
|
-
const gettyPayload = mediaPayload as GettyVideoMediaSelectedPayload;
|
|
318
|
-
const videoStore = useVideoStore();
|
|
319
|
-
|
|
320
|
-
videoStore.setVideoUrlsWithToken(
|
|
321
|
-
gettyPayload.token,
|
|
322
|
-
gettyPayload.videoSrc,
|
|
323
|
-
gettyPayload.imageSrc,
|
|
324
|
-
gettyPayload.assetId,
|
|
325
|
-
);
|
|
326
|
-
}
|
|
327
|
-
},
|
|
328
269
|
_setItems({ items }: { items: ContentItem<any>[] }): void {
|
|
329
270
|
this.items = items;
|
|
330
271
|
},
|
|
@@ -767,15 +708,6 @@ export const useUiContentSettingsStore = defineStore('uiContentSettings', {
|
|
|
767
708
|
this.onContentChanged();
|
|
768
709
|
},
|
|
769
710
|
|
|
770
|
-
setSelectedItemMedia(
|
|
771
|
-
selectedItemId: string | null,
|
|
772
|
-
mediaPayload: MediaBaseSelectedPayload,
|
|
773
|
-
) {
|
|
774
|
-
this._setSelectedItemMedia(selectedItemId, mediaPayload);
|
|
775
|
-
|
|
776
|
-
this.onContentChanged();
|
|
777
|
-
},
|
|
778
|
-
|
|
779
711
|
setItems(payload: { items: ContentItem<Content>[] }) {
|
|
780
712
|
if (process.env.NODE_ENV !== 'production') {
|
|
781
713
|
const idCountMap = payload.items.reduce<Record<string, number>>(
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import type { MediaTypes } from '../../brand-page';
|
|
2
|
-
|
|
3
1
|
interface UserMediaItemMedia {
|
|
4
2
|
token: string;
|
|
5
3
|
userToken: string;
|
|
@@ -22,17 +20,3 @@ export interface UserMediaItemWithDimensions extends UserMediaItem {
|
|
|
22
20
|
width: number;
|
|
23
21
|
height: number;
|
|
24
22
|
}
|
|
25
|
-
|
|
26
|
-
export interface MediaBaseSelectedPayload {
|
|
27
|
-
type: MediaTypes;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export interface GettyVideoMediaSelectedPayload
|
|
31
|
-
extends MediaBaseSelectedPayload {
|
|
32
|
-
assetId: string;
|
|
33
|
-
token: string;
|
|
34
|
-
mimeType: string;
|
|
35
|
-
autoPlay: boolean;
|
|
36
|
-
imageSrc: string;
|
|
37
|
-
videoSrc: string;
|
|
38
|
-
}
|
|
@@ -76,20 +76,12 @@
|
|
|
76
76
|
class="c-media-btn__img hover:!tw-shadow-[0_0_0_3px] hover:!tw-shadow-info-500"
|
|
77
77
|
@mouseenter="mouseOverPreview"
|
|
78
78
|
@mouseleave="mouseLeavePreview"
|
|
79
|
-
@click="onVideoLibraryItemClicked(video)"
|
|
80
79
|
>
|
|
81
80
|
{{ videoLibraryTr('emptyState') }}
|
|
82
81
|
</video>
|
|
83
82
|
</figure>
|
|
84
83
|
</div>
|
|
85
|
-
<p
|
|
86
|
-
v-if="
|
|
87
|
-
!isLoading &&
|
|
88
|
-
((!hasVideoLibraryCategories && isCategoryView) ||
|
|
89
|
-
(!hasVideos && !isCategoryView))
|
|
90
|
-
"
|
|
91
|
-
class="tw-text-xs"
|
|
92
|
-
>
|
|
84
|
+
<p v-if="!isLoading && !hasVideos" class="tw-text-xs">
|
|
93
85
|
{{ commonTr('emptySearchLabel') }}
|
|
94
86
|
</p>
|
|
95
87
|
<div
|
|
@@ -123,14 +115,7 @@ import { ref, computed, onMounted } from 'vue';
|
|
|
123
115
|
import GettyImagesClient from '../../clients/gettyimages-client';
|
|
124
116
|
import { commonTr, videoLibraryTr } from '../../composables/useTranslate';
|
|
125
117
|
import { Button, Loader, TextInput } from '@designcrowd/fe-shared-lib';
|
|
126
|
-
import {
|
|
127
|
-
useUiStore,
|
|
128
|
-
type GettyVideoEditorViewModelResponse,
|
|
129
|
-
} from '../../brand-page-maker/stores';
|
|
130
|
-
import type {
|
|
131
|
-
GettyVideoMediaSelectedPayload,
|
|
132
|
-
MediaBaseSelectedPayload,
|
|
133
|
-
} from '../my-uploads/models';
|
|
118
|
+
import { useUiStore } from '../../brand-page-maker/stores';
|
|
134
119
|
|
|
135
120
|
interface VideoItem {
|
|
136
121
|
id: string;
|
|
@@ -165,8 +150,6 @@ const isLoading = ref(true);
|
|
|
165
150
|
const isSearchReady = ref(false);
|
|
166
151
|
const defaultLibrary = ref<VideoLibraryData | null>(null);
|
|
167
152
|
const isCategorySearch = ref(false);
|
|
168
|
-
const isCategoryView = ref(false);
|
|
169
|
-
|
|
170
153
|
const addVideosConcurrentlyLimit = ref(2);
|
|
171
154
|
const numberOfVideosBeingAdded = ref(0);
|
|
172
155
|
|
|
@@ -217,7 +200,6 @@ const onClearSearch = () => {
|
|
|
217
200
|
|
|
218
201
|
const onCategoryClicked = (categoryName: string) => {
|
|
219
202
|
searchVideos(categoryName, true);
|
|
220
|
-
isCategoryView.value = false;
|
|
221
203
|
};
|
|
222
204
|
|
|
223
205
|
const getNextPageOfResults = async (): Promise<void> => {
|
|
@@ -248,11 +230,11 @@ const getCategories = async (): Promise<void> => {
|
|
|
248
230
|
isLoading.value = true;
|
|
249
231
|
videoLibraryCategories.value =
|
|
250
232
|
await gettyImagesClient.value!.getDefaultCategoriesAsync();
|
|
233
|
+
console.log('videoLibraryCategories', videoLibraryCategories.value);
|
|
251
234
|
} catch (e) {
|
|
252
235
|
console.error(e);
|
|
253
236
|
} finally {
|
|
254
237
|
isLoading.value = false;
|
|
255
|
-
isCategoryView.value = true;
|
|
256
238
|
}
|
|
257
239
|
};
|
|
258
240
|
|
|
@@ -285,7 +267,6 @@ const searchVideos = async (
|
|
|
285
267
|
console.error(e);
|
|
286
268
|
} finally {
|
|
287
269
|
isLoading.value = false;
|
|
288
|
-
isCategoryView.value = false;
|
|
289
270
|
}
|
|
290
271
|
};
|
|
291
272
|
|
|
@@ -312,26 +293,24 @@ const onVideoLibraryItemClicked = async (item: VideoItem): Promise<void> => {
|
|
|
312
293
|
}
|
|
313
294
|
|
|
314
295
|
setIsLoading(item, true);
|
|
315
|
-
const video
|
|
316
|
-
await gettyImagesClient.value!.getVideoByVideoIdAsync(item.id);
|
|
296
|
+
const video = await gettyImagesClient.value!.getVideoByVideoIdAsync(item.id);
|
|
317
297
|
if (!video) {
|
|
318
298
|
window.alert('Error loading getty video, please try again');
|
|
319
299
|
setIsLoading(item, false);
|
|
320
300
|
return;
|
|
321
301
|
}
|
|
322
302
|
|
|
323
|
-
const
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
303
|
+
const gettyMediaObject = {
|
|
304
|
+
mediaData: {
|
|
305
|
+
provider: 'getty',
|
|
306
|
+
assetId: item.id,
|
|
307
|
+
},
|
|
327
308
|
imageSrc: video.imagePreviewAsset.uri,
|
|
328
309
|
videoSrc: video.videoPreviewAsset.uri,
|
|
329
|
-
mimeType: 'video/mp4',
|
|
330
|
-
autoPlay: false,
|
|
331
310
|
};
|
|
332
311
|
|
|
333
312
|
// Emit the video selection event
|
|
334
|
-
emit('on-select-video',
|
|
313
|
+
emit('on-select-video', gettyMediaObject);
|
|
335
314
|
|
|
336
315
|
setIsLoading(item, false);
|
|
337
316
|
};
|
|
@@ -354,7 +333,7 @@ const getImagePreview = (
|
|
|
354
333
|
};
|
|
355
334
|
|
|
356
335
|
const emit = defineEmits<{
|
|
357
|
-
'on-select-video': [
|
|
336
|
+
'on-select-video': [video: any];
|
|
358
337
|
}>();
|
|
359
338
|
|
|
360
339
|
onMounted(async () => {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './video-store';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './video-store';
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export type VideoUrlData = {
|
|
2
|
-
videoUrl: string;
|
|
3
|
-
previewImageUrl: string;
|
|
4
|
-
assetId: string;
|
|
5
|
-
};
|
|
6
|
-
type VideoUrls = Record<string, VideoUrlData>;
|
|
7
|
-
export interface videoStoreState {
|
|
8
|
-
videoUrls: VideoUrls;
|
|
9
|
-
gettyImagesKeyPrefix: string;
|
|
10
|
-
}
|
|
11
|
-
export declare const useVideoStore: import("pinia").StoreDefinition<"video", videoStoreState, {
|
|
12
|
-
getVideoUrlsForToken: (state: {
|
|
13
|
-
videoUrls: VideoUrls;
|
|
14
|
-
gettyImagesKeyPrefix: string;
|
|
15
|
-
} & import("pinia").PiniaCustomStateProperties<videoStoreState>) => (token: string) => VideoUrlData;
|
|
16
|
-
getS3VideoUrlsForToken: (state: {
|
|
17
|
-
videoUrls: VideoUrls;
|
|
18
|
-
gettyImagesKeyPrefix: string;
|
|
19
|
-
} & import("pinia").PiniaCustomStateProperties<videoStoreState>) => (token: string) => {
|
|
20
|
-
videoUrl: string;
|
|
21
|
-
previewImageUrl: string;
|
|
22
|
-
};
|
|
23
|
-
}, {
|
|
24
|
-
setVideoUrlsWithToken(token: string, videoUrl: string, previewImageUrl: string, assetId: string): void;
|
|
25
|
-
setGettyImageKeyPrefix(prefix: string): void;
|
|
26
|
-
}>;
|
|
27
|
-
export {};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { defineStore } from 'pinia';
|
|
2
|
-
const CDN_GETTY_S3_URL_PREFIX = 'https://bc-getty-media.brandcrowd.com';
|
|
3
|
-
export const useVideoStore = defineStore('video', {
|
|
4
|
-
state: () => ({
|
|
5
|
-
videoUrls: {},
|
|
6
|
-
gettyImagesKeyPrefix: '',
|
|
7
|
-
}),
|
|
8
|
-
actions: {
|
|
9
|
-
setVideoUrlsWithToken(token, videoUrl, previewImageUrl, assetId) {
|
|
10
|
-
this.videoUrls[token] = { videoUrl, previewImageUrl, assetId };
|
|
11
|
-
},
|
|
12
|
-
setGettyImageKeyPrefix(prefix) {
|
|
13
|
-
this.gettyImagesKeyPrefix = prefix;
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
getters: {
|
|
17
|
-
getVideoUrlsForToken: (state) => (token) => {
|
|
18
|
-
return state.videoUrls[token];
|
|
19
|
-
},
|
|
20
|
-
getS3VideoUrlsForToken: (state) => (token) => {
|
|
21
|
-
return {
|
|
22
|
-
videoUrl: `${CDN_GETTY_S3_URL_PREFIX}/public/${state.gettyImagesKeyPrefix}/${token}/${token}_preview`,
|
|
23
|
-
previewImageUrl: `${CDN_GETTY_S3_URL_PREFIX}/public/${state.gettyImagesKeyPrefix}/${token}/${token}_preview_thumb`,
|
|
24
|
-
};
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
});
|