@designcrowd/library.brand-page 5.15.3 → 5.15.4
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-P6321XBu.js → CreatedOnBrandCrowd-de-de-D-JqIBXF.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-en-us-CB2Vbc_1.js → CreatedOnBrandCrowd-en-us-rj1RdP3D.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-es-es-BUzOkzZ1.js → CreatedOnBrandCrowd-es-es-CQjoXEVn.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-fr-BGhklGg-.js → CreatedOnBrandCrowd-fr-ca-BLfDC22k.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-ca-BGhklGg-.js → CreatedOnBrandCrowd-fr-fr-BLfDC22k.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-pt-DjkF8yHg.js → CreatedOnBrandCrowd-pt-br-DA4HMlpw.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-br-DjkF8yHg.js → CreatedOnBrandCrowd-pt-pt-DA4HMlpw.js} +1 -1
- package/lib/src/{CreatedOnDcom-de-de-Blsa8CUj.js → CreatedOnDcom-de-de-DcSzC02I.js} +1 -1
- package/lib/src/{CreatedOnDcom-en-us-CBk25ntF.js → CreatedOnDcom-en-us-Cj099v1g.js} +1 -1
- package/lib/src/{CreatedOnDcom-es-es-D1ghG1-O.js → CreatedOnDcom-es-es-BLMAaoWm.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-ca-C0igjVq3.js → CreatedOnDcom-fr-ca-DT5jxd5X.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-fr-BAO9DjJx.js → CreatedOnDcom-fr-fr-BVT8h3pj.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-br-DIq8gG3f.js → CreatedOnDcom-pt-br-DP4jKxkV.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-pt-De83jTtG.js → CreatedOnDcom-pt-pt-B6K9BtIo.js} +1 -1
- package/lib/src/brand-page/utils/migration/migration-07.js +2 -1
- package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.d.ts +3 -1
- 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/__fixtures__/brand-page-examples.js +0 -2
- package/lib/src/brand-page-maker/constants/config-settings-constant.js +2 -2
- package/lib/src/brand-page-maker/constants/index.js +0 -2
- package/lib/src/brand-page-maker/stores/user/user-store.js +0 -1
- package/lib/src/{bundled-translations-Gwpp-xB6.js → bundled-translations-C35ICQCS.js} +16 -18
- package/lib/src/{bundled-translations.de-DE-CB4KkNf3.js → bundled-translations.de-DE-B3sIK6Yw.js} +11 -13
- package/lib/src/{bundled-translations.es-ES-27tfJoU5.js → bundled-translations.es-ES-CJCflztK.js} +13 -15
- package/lib/src/{bundled-translations.fr-CA-SDhUJ5C0.js → bundled-translations.fr-CA-CtlwKcDs.js} +16 -18
- package/lib/src/{bundled-translations.fr-FR-_THRUXSu.js → bundled-translations.fr-FR-CjDBsRhl.js} +20 -22
- package/lib/src/{bundled-translations.pt-BR-Cet1bnj3.js → bundled-translations.pt-BR-CNuFzR0R.js} +17 -19
- package/lib/src/{bundled-translations.pt-PT-BWuPalqF.js → bundled-translations.pt-PT-D2Ak5M-w.js} +4 -6
- package/lib/src/bundles/bundled-translations.de-DE.json +0 -7
- package/lib/src/bundles/bundled-translations.es-ES.json +0 -7
- package/lib/src/bundles/bundled-translations.fr-CA.json +0 -7
- package/lib/src/bundles/bundled-translations.fr-FR.json +0 -7
- package/lib/src/bundles/bundled-translations.json +0 -7
- package/lib/src/bundles/bundled-translations.pt-BR.json +0 -7
- package/lib/src/bundles/bundled-translations.pt-PT.json +0 -7
- package/lib/src/composables/useTranslate.d.ts +1 -2
- package/lib/src/composables/useTranslate.js +1 -2
- package/lib/src/constants/ui.d.ts +0 -1
- package/lib/src/css/library.brand-page-brandCrowd.min.css +22 -68
- package/lib/src/css/library.brand-page-brandPage.min.css +22 -68
- package/lib/src/css/library.brand-page-designCom.min.css +22 -68
- package/lib/src/css/library.brand-page-preview.min.css +22 -68
- package/lib/src/index.mjs +1 -1
- package/lib/src/{lib-B3T2jOqU.js → lib-DV-z72zv.js} +9928 -10096
- package/lib/src/shared/content-settings/components/content-settings/ContentSettings.stories.js +0 -1
- package/lib/src/shared/content-settings/components/payment-config-field/PaymentConfigField.mixin.d.ts +3 -1
- package/lib/src/shared/content-settings/components/payment-config-field/PaymentConfigField.mixin.js +3 -1
- package/lib/src/shared/content-settings/components/replace-image-base-settings/ReplaceImageBaseSettings.mixin.d.ts +112 -0
- package/lib/src/shared/content-settings/components/replace-image-base-settings/ReplaceImageBaseSettings.mixin.js +135 -0
- package/lib/src/shared/content-settings/models.d.ts +0 -1
- package/lib/src/shared/content-settings/models.js +0 -1
- package/lib/src/shared/ecommerce-settings/store/shop-settings-store.d.ts +3 -1
- package/lib/src/shared/ecommerce-settings/store/shop-settings-store.js +2 -2
- package/lib/src/shared/models.d.ts +0 -1
- package/lib/src/shared/my-uploads/MyMedia.stories.js +0 -1
- package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.d.ts +0 -1
- package/package.json +1 -1
- package/src/brand-page/components/logo/LogoRender.vue +1 -0
- package/src/brand-page/components/shop/FeaturedDisplay.vue +6 -7
- package/src/brand-page/components/shop/PaymentModal.vue +2 -0
- package/src/brand-page/components/shop/ProductDetailModal.vue +1 -2
- package/src/brand-page/components/shop/Shop.vue +31 -12
- package/src/brand-page/components/shop/TextDisplay.vue +6 -7
- package/src/brand-page/components/shop/ThumbnailDisplay.vue +6 -7
- package/src/brand-page/utils/migration/migration-07.ts +2 -1
- package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.stories.ts +0 -1
- package/src/brand-page-maker/components/brand-page-maker/__fixtures__/brand-page-examples.ts +0 -2
- package/src/brand-page-maker/components/shop/AddOrEditProductContainer.vue +8 -3
- package/src/brand-page-maker/constants/config-settings-constant.ts +2 -2
- package/src/brand-page-maker/constants/index.ts +0 -2
- package/src/brand-page-maker/stores/user/user-store.ts +0 -1
- package/src/bundles/bundled-translations.de-DE.json +0 -7
- package/src/bundles/bundled-translations.es-ES.json +0 -7
- package/src/bundles/bundled-translations.fr-CA.json +0 -7
- package/src/bundles/bundled-translations.fr-FR.json +0 -7
- package/src/bundles/bundled-translations.json +0 -7
- package/src/bundles/bundled-translations.pt-BR.json +0 -7
- package/src/bundles/bundled-translations.pt-PT.json +0 -7
- package/src/composables/useTranslate.ts +0 -2
- package/src/constants/ui.ts +0 -1
- package/src/shared/content-settings/components/content-settings/ContentSettings.stories.ts +0 -1
- package/src/shared/content-settings/components/payment-config-field/PaymentConfigField.mixin.ts +3 -1
- package/src/shared/content-settings/components/replace-image-base-settings/ReplaceImageBaseSettings.mixin.ts +168 -0
- package/src/shared/content-settings/components/replace-image-base-settings/ReplaceImageBaseSettings.vue +19 -215
- package/src/shared/content-settings/components/replace-image-base-settings/i18n/replace-image-setting.de-DE.json +0 -1
- package/src/shared/content-settings/components/replace-image-base-settings/i18n/replace-image-setting.es-ES.json +0 -1
- package/src/shared/content-settings/components/replace-image-base-settings/i18n/replace-image-setting.fr-CA.json +0 -1
- package/src/shared/content-settings/components/replace-image-base-settings/i18n/replace-image-setting.fr-FR.json +0 -1
- package/src/shared/content-settings/components/replace-image-base-settings/i18n/replace-image-setting.json +0 -1
- package/src/shared/content-settings/components/replace-image-base-settings/i18n/replace-image-setting.pt-BR.json +0 -1
- package/src/shared/content-settings/components/replace-image-base-settings/i18n/replace-image-setting.pt-PT.json +0 -1
- package/src/shared/content-settings/models.ts +0 -1
- package/src/shared/ecommerce-settings/components/product-config-field/ProductConfigOption.vue +2 -4
- package/src/shared/ecommerce-settings/store/shop-settings-store.ts +4 -2
- package/src/shared/models.ts +0 -1
- package/src/shared/my-uploads/MyMedia.stories.ts +0 -1
- package/src/shared/video-library/VideoLibrary.vue +0 -374
- package/src/shared/video-library/i18n/video-library.de-DE.json +0 -8
- package/src/shared/video-library/i18n/video-library.es-ES.json +0 -8
- package/src/shared/video-library/i18n/video-library.fr-CA.json +0 -8
- package/src/shared/video-library/i18n/video-library.fr-FR.json +0 -8
- package/src/shared/video-library/i18n/video-library.json +0 -8
- package/src/shared/video-library/i18n/video-library.pt-BR.json +0 -8
- package/src/shared/video-library/i18n/video-library.pt-PT.json +0 -8
|
@@ -1,374 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<TextInput
|
|
4
|
-
v-model="searchString"
|
|
5
|
-
size="md"
|
|
6
|
-
icon="search"
|
|
7
|
-
class="tw-py-2 tw-mb-2"
|
|
8
|
-
:placeholder="commonTr('search')"
|
|
9
|
-
:enable-clear="true"
|
|
10
|
-
@input="onSearchText"
|
|
11
|
-
@on-clear="onClearSearch"
|
|
12
|
-
/>
|
|
13
|
-
<div
|
|
14
|
-
v-if="!isLoading && hasVideoLibraryCategories"
|
|
15
|
-
class="tw-grid tw-gap-4 tw-grid-cols-2"
|
|
16
|
-
>
|
|
17
|
-
<figure
|
|
18
|
-
v-for="(videoCategory, idx) in videoLibraryCategories"
|
|
19
|
-
:key="videoCategory.categoryName"
|
|
20
|
-
class="tw-rounded-md"
|
|
21
|
-
>
|
|
22
|
-
<button
|
|
23
|
-
class="c-media-btn tw-p-0 tw-border-none tw-cursor-pointer tw-relative"
|
|
24
|
-
:data-test-video-library-category="videoCategory.categoryName"
|
|
25
|
-
@click="onCategoryClicked(videoCategory.categoryName)"
|
|
26
|
-
>
|
|
27
|
-
<div
|
|
28
|
-
class="c-media-btn__overlay c-media-btn__overlay--category tw-h-100 tw-flex tw-items-center tw-justify-center tw-mb-0.5 tw-capitalize"
|
|
29
|
-
>
|
|
30
|
-
{{ videoCategory.categoryName }}
|
|
31
|
-
</div>
|
|
32
|
-
<video
|
|
33
|
-
:data-test-tag="`video-category-${idx}`"
|
|
34
|
-
:src="getVideoPreview(videoCategory.videos.videos[0].displaySizes)"
|
|
35
|
-
loop
|
|
36
|
-
muted
|
|
37
|
-
playsinline
|
|
38
|
-
class="c-media-btn__img hover:!tw-shadow-[0_0_0_3px] hover:!tw-shadow-info-500"
|
|
39
|
-
@mouseenter="mouseOverPreview"
|
|
40
|
-
@mouseleave="mouseLeavePreview"
|
|
41
|
-
>
|
|
42
|
-
{{ videoLibraryTr('supported') }}
|
|
43
|
-
</video>
|
|
44
|
-
</button>
|
|
45
|
-
</figure>
|
|
46
|
-
</div>
|
|
47
|
-
<div v-if="videoLibrary" class="tw-grid tw-gap-4 tw-grid-cols-2">
|
|
48
|
-
<figure
|
|
49
|
-
v-for="(video, idx) in videoLibrary.videos"
|
|
50
|
-
:key="`${idx}-${video.id}`"
|
|
51
|
-
class="c-media-btn tw-p-0 tw-border-none tw-cursor-pointer tw-relative tw-group"
|
|
52
|
-
>
|
|
53
|
-
<div
|
|
54
|
-
class="c-media-btn__overlay c-media-btn__overlay--video"
|
|
55
|
-
:data-test-video-library-item="`${idx}-${video.id}`"
|
|
56
|
-
@click="onVideoLibraryItemClicked(video)"
|
|
57
|
-
/>
|
|
58
|
-
<div
|
|
59
|
-
v-if="video.isLoading"
|
|
60
|
-
class="tw-absolute tw-inset-0 tw-flex tw-items-center tw-justify-center tw-bg-black tw-bg-opacity-50 tw-rounded-md"
|
|
61
|
-
>
|
|
62
|
-
<Loader />
|
|
63
|
-
</div>
|
|
64
|
-
<img
|
|
65
|
-
v-if="isMobile"
|
|
66
|
-
:src="getImagePreview(video.displaySizes)"
|
|
67
|
-
alt=""
|
|
68
|
-
class="c-media-btn__img hover:!tw-shadow-[0_0_0_3px] hover:!tw-shadow-info-500"
|
|
69
|
-
/>
|
|
70
|
-
<video
|
|
71
|
-
v-else
|
|
72
|
-
:src="getVideoPreview(video.displaySizes)"
|
|
73
|
-
loop
|
|
74
|
-
muted
|
|
75
|
-
playsinline
|
|
76
|
-
class="c-media-btn__img hover:!tw-shadow-[0_0_0_3px] hover:!tw-shadow-info-500"
|
|
77
|
-
@mouseenter="mouseOverPreview"
|
|
78
|
-
@mouseleave="mouseLeavePreview"
|
|
79
|
-
>
|
|
80
|
-
{{ videoLibraryTr('emptyState') }}
|
|
81
|
-
</video>
|
|
82
|
-
</figure>
|
|
83
|
-
</div>
|
|
84
|
-
<p v-if="!isLoading && !hasVideos" class="tw-text-xs">
|
|
85
|
-
{{ commonTr('emptySearchLabel') }}
|
|
86
|
-
</p>
|
|
87
|
-
<div
|
|
88
|
-
v-if="!isLoading && canLoadMoreResults"
|
|
89
|
-
class="tw-mt-4 tw-w-100 tw-text-center"
|
|
90
|
-
>
|
|
91
|
-
<Button
|
|
92
|
-
:label="videoLibraryTr('loadMoreVideos')"
|
|
93
|
-
variant="outline"
|
|
94
|
-
size="small-medium"
|
|
95
|
-
@on-click.stop="getNextPageOfResults"
|
|
96
|
-
/>
|
|
97
|
-
</div>
|
|
98
|
-
<div v-if="isLoading" class="tw-flex tw-justify-center tw-my-8">
|
|
99
|
-
<Loader />
|
|
100
|
-
</div>
|
|
101
|
-
<p class="tw-mt-4 tw-text-xs tw-text-grayscale-600">
|
|
102
|
-
{{ videoLibraryTr('poweredBy') }}
|
|
103
|
-
<a
|
|
104
|
-
href="https://www.gettyimages.com"
|
|
105
|
-
class="maker-anchor tw-no-underline"
|
|
106
|
-
target="_blank"
|
|
107
|
-
>Getty Images</a
|
|
108
|
-
>
|
|
109
|
-
</p>
|
|
110
|
-
</div>
|
|
111
|
-
</template>
|
|
112
|
-
|
|
113
|
-
<script setup lang="ts">
|
|
114
|
-
import { ref, computed, onMounted } from 'vue';
|
|
115
|
-
import GettyImagesClient from '../../clients/gettyimages-client';
|
|
116
|
-
import { commonTr, videoLibraryTr } from '../../composables/useTranslate';
|
|
117
|
-
import { Button, Loader, TextInput } from '@designcrowd/fe-shared-lib';
|
|
118
|
-
import { useUiStore } from '../../brand-page-maker/stores';
|
|
119
|
-
|
|
120
|
-
interface VideoItem {
|
|
121
|
-
id: string;
|
|
122
|
-
isLoading?: boolean;
|
|
123
|
-
displaySizes: Array<{ name: string; uri: string }>;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
interface VideoLibraryData {
|
|
127
|
-
videos: VideoItem[];
|
|
128
|
-
resultCount: number;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
interface Props {
|
|
132
|
-
isMobile?: boolean;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
const props = withDefaults(defineProps<Props>(), {
|
|
136
|
-
isMobile: false,
|
|
137
|
-
});
|
|
138
|
-
|
|
139
|
-
// Store access
|
|
140
|
-
const uiStore = useUiStore();
|
|
141
|
-
const endpoints = computed(() => uiStore.endpoints);
|
|
142
|
-
|
|
143
|
-
// Reactive data
|
|
144
|
-
const searchString = ref('');
|
|
145
|
-
const gettyImagesClient = ref<GettyImagesClient | null>(null);
|
|
146
|
-
const videoLibrary = ref<VideoLibraryData | null>(null);
|
|
147
|
-
const currentVideoLibraryPage = ref(1);
|
|
148
|
-
const videoLibraryCategories = ref<any[] | null>(null);
|
|
149
|
-
const isLoading = ref(true);
|
|
150
|
-
const isSearchReady = ref(false);
|
|
151
|
-
const defaultLibrary = ref<VideoLibraryData | null>(null);
|
|
152
|
-
const isCategorySearch = ref(false);
|
|
153
|
-
const addVideosConcurrentlyLimit = ref(2);
|
|
154
|
-
const numberOfVideosBeingAdded = ref(0);
|
|
155
|
-
|
|
156
|
-
const SEARCH_DEBOUNCE_DELAY = 1500; // 1.5 seconds
|
|
157
|
-
const MIN_SEARCH_LENGTH = 2;
|
|
158
|
-
const VIDEOS_PER_PAGE = 10;
|
|
159
|
-
|
|
160
|
-
const hasVideoLibraryCategories = computed(() => {
|
|
161
|
-
return (
|
|
162
|
-
!isLoading.value &&
|
|
163
|
-
!videoLibrary.value &&
|
|
164
|
-
videoLibraryCategories.value &&
|
|
165
|
-
videoLibraryCategories.value.length > 0
|
|
166
|
-
);
|
|
167
|
-
});
|
|
168
|
-
|
|
169
|
-
const hasVideos = computed(() => {
|
|
170
|
-
return (
|
|
171
|
-
videoLibrary.value &&
|
|
172
|
-
videoLibrary.value.videos &&
|
|
173
|
-
videoLibrary.value.videos.length > 0
|
|
174
|
-
);
|
|
175
|
-
});
|
|
176
|
-
|
|
177
|
-
const canLoadMoreResults = computed(() => {
|
|
178
|
-
return (
|
|
179
|
-
!isLoading.value &&
|
|
180
|
-
videoLibrary.value &&
|
|
181
|
-
currentVideoLibraryPage.value <=
|
|
182
|
-
videoLibrary.value.resultCount / VIDEOS_PER_PAGE
|
|
183
|
-
);
|
|
184
|
-
});
|
|
185
|
-
|
|
186
|
-
// Methods
|
|
187
|
-
const onSearchText = () => {
|
|
188
|
-
if (searchString.value.length >= MIN_SEARCH_LENGTH) {
|
|
189
|
-
setTimeout(() => {
|
|
190
|
-
if (searchString.value.length >= MIN_SEARCH_LENGTH) {
|
|
191
|
-
searchVideos();
|
|
192
|
-
}
|
|
193
|
-
}, SEARCH_DEBOUNCE_DELAY);
|
|
194
|
-
}
|
|
195
|
-
};
|
|
196
|
-
|
|
197
|
-
const onClearSearch = () => {
|
|
198
|
-
resetSearch();
|
|
199
|
-
};
|
|
200
|
-
|
|
201
|
-
const onCategoryClicked = (categoryName: string) => {
|
|
202
|
-
searchVideos(categoryName, true);
|
|
203
|
-
};
|
|
204
|
-
|
|
205
|
-
const getNextPageOfResults = async (): Promise<void> => {
|
|
206
|
-
currentVideoLibraryPage.value += 1;
|
|
207
|
-
|
|
208
|
-
try {
|
|
209
|
-
isLoading.value = true;
|
|
210
|
-
const res = await gettyImagesClient.value!.searchVideosAsync(
|
|
211
|
-
searchString.value,
|
|
212
|
-
currentVideoLibraryPage.value,
|
|
213
|
-
);
|
|
214
|
-
|
|
215
|
-
if (res && res.videos && res.videos.length > 0) {
|
|
216
|
-
videoLibrary.value!.videos = [
|
|
217
|
-
...videoLibrary.value!.videos,
|
|
218
|
-
...res.videos,
|
|
219
|
-
];
|
|
220
|
-
}
|
|
221
|
-
} catch (e) {
|
|
222
|
-
console.error(e);
|
|
223
|
-
} finally {
|
|
224
|
-
isLoading.value = false;
|
|
225
|
-
}
|
|
226
|
-
};
|
|
227
|
-
|
|
228
|
-
const getCategories = async (): Promise<void> => {
|
|
229
|
-
try {
|
|
230
|
-
isLoading.value = true;
|
|
231
|
-
videoLibraryCategories.value =
|
|
232
|
-
await gettyImagesClient.value!.getDefaultCategoriesAsync();
|
|
233
|
-
console.log('videoLibraryCategories', videoLibraryCategories.value);
|
|
234
|
-
} catch (e) {
|
|
235
|
-
console.error(e);
|
|
236
|
-
} finally {
|
|
237
|
-
isLoading.value = false;
|
|
238
|
-
}
|
|
239
|
-
};
|
|
240
|
-
|
|
241
|
-
const resetSearch = (): void => {
|
|
242
|
-
searchString.value = '';
|
|
243
|
-
videoLibrary.value = null;
|
|
244
|
-
getCategories();
|
|
245
|
-
};
|
|
246
|
-
|
|
247
|
-
const searchVideos = async (
|
|
248
|
-
str?: string,
|
|
249
|
-
isCategorySearchParam = false,
|
|
250
|
-
): Promise<void> => {
|
|
251
|
-
try {
|
|
252
|
-
searchString.value = str || searchString.value;
|
|
253
|
-
currentVideoLibraryPage.value = 1;
|
|
254
|
-
isLoading.value = true;
|
|
255
|
-
isCategorySearch.value = isCategorySearchParam;
|
|
256
|
-
|
|
257
|
-
if (searchString.value) {
|
|
258
|
-
videoLibrary.value = null;
|
|
259
|
-
videoLibrary.value = await gettyImagesClient.value!.searchVideosAsync(
|
|
260
|
-
searchString.value,
|
|
261
|
-
1,
|
|
262
|
-
);
|
|
263
|
-
} else {
|
|
264
|
-
videoLibrary.value = defaultLibrary.value;
|
|
265
|
-
}
|
|
266
|
-
} catch (e) {
|
|
267
|
-
console.error(e);
|
|
268
|
-
} finally {
|
|
269
|
-
isLoading.value = false;
|
|
270
|
-
}
|
|
271
|
-
};
|
|
272
|
-
|
|
273
|
-
const mouseOverPreview = (event: Event): void => {
|
|
274
|
-
const target = event.target as HTMLVideoElement;
|
|
275
|
-
target.play();
|
|
276
|
-
};
|
|
277
|
-
|
|
278
|
-
const mouseLeavePreview = (event: Event): void => {
|
|
279
|
-
const target = event.target as HTMLVideoElement;
|
|
280
|
-
target.pause();
|
|
281
|
-
};
|
|
282
|
-
|
|
283
|
-
const onVideoLibraryItemClicked = async (item: VideoItem): Promise<void> => {
|
|
284
|
-
if (item.isLoading) {
|
|
285
|
-
return;
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
if (numberOfVideosBeingAdded.value >= addVideosConcurrentlyLimit.value) {
|
|
289
|
-
window.alert(
|
|
290
|
-
`Maximum number of videos you can add is ${addVideosConcurrentlyLimit.value}`,
|
|
291
|
-
);
|
|
292
|
-
return;
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
setIsLoading(item, true);
|
|
296
|
-
const video = await gettyImagesClient.value!.getVideoByVideoIdAsync(item.id);
|
|
297
|
-
if (!video) {
|
|
298
|
-
window.alert('Error loading getty video, please try again');
|
|
299
|
-
setIsLoading(item, false);
|
|
300
|
-
return;
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
const gettyMediaObject = {
|
|
304
|
-
mediaData: {
|
|
305
|
-
provider: 'getty',
|
|
306
|
-
assetId: item.id,
|
|
307
|
-
},
|
|
308
|
-
imageSrc: video.imagePreviewAsset.uri,
|
|
309
|
-
videoSrc: video.videoPreviewAsset.uri,
|
|
310
|
-
};
|
|
311
|
-
|
|
312
|
-
// Emit the video selection event
|
|
313
|
-
emit('on-select-video', gettyMediaObject);
|
|
314
|
-
|
|
315
|
-
setIsLoading(item, false);
|
|
316
|
-
};
|
|
317
|
-
|
|
318
|
-
const setIsLoading = (item: VideoItem, loading: boolean): void => {
|
|
319
|
-
item.isLoading = loading;
|
|
320
|
-
numberOfVideosBeingAdded.value += loading ? 1 : -1;
|
|
321
|
-
};
|
|
322
|
-
|
|
323
|
-
const getVideoPreview = (
|
|
324
|
-
displaySizes: Array<{ name: string; uri: string }>,
|
|
325
|
-
): string => {
|
|
326
|
-
return displaySizes.find((size) => size.name === 'preview')?.uri || '';
|
|
327
|
-
};
|
|
328
|
-
|
|
329
|
-
const getImagePreview = (
|
|
330
|
-
displaySizes: Array<{ name: string; uri: string }>,
|
|
331
|
-
): string => {
|
|
332
|
-
return displaySizes.find((size) => size.name === 'comp_poster')?.uri || '';
|
|
333
|
-
};
|
|
334
|
-
|
|
335
|
-
const emit = defineEmits<{
|
|
336
|
-
'on-select-video': [video: any];
|
|
337
|
-
}>();
|
|
338
|
-
|
|
339
|
-
onMounted(async () => {
|
|
340
|
-
const gettySettings = {
|
|
341
|
-
mediaBaseUrl: endpoints.value.getGettyEndpoint,
|
|
342
|
-
};
|
|
343
|
-
|
|
344
|
-
gettyImagesClient.value = new GettyImagesClient(gettySettings);
|
|
345
|
-
await getCategories();
|
|
346
|
-
|
|
347
|
-
isSearchReady.value = true;
|
|
348
|
-
});
|
|
349
|
-
</script>
|
|
350
|
-
<style scoped>
|
|
351
|
-
.c-media-btn__img {
|
|
352
|
-
@apply tw-transition-shadow tw-duration-200 tw-ease-out tw-w-full tw-rounded-md;
|
|
353
|
-
aspect-ratio: 1;
|
|
354
|
-
object-fit: cover;
|
|
355
|
-
max-height: 150px;
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
.c-media-btn__overlay {
|
|
359
|
-
@apply tw-absolute tw-left-0 tw-bottom-0 tw-top-0 tw-right-0 tw-text-white tw-rounded-md tw-text-white tw-transition-all tw-duration-200;
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
.c-media-btn__overlay--category {
|
|
363
|
-
background-color: rgba(17, 21, 23, 0.66);
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
.c-media-btn__overlay--video:hover {
|
|
367
|
-
background-color: rgba(17, 21, 23, 0.33);
|
|
368
|
-
}
|
|
369
|
-
.c-media-btn {
|
|
370
|
-
@apply tw-w-full;
|
|
371
|
-
aspect-ratio: 1;
|
|
372
|
-
max-height: 150px;
|
|
373
|
-
}
|
|
374
|
-
</style>
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"videoLibrary" : {
|
|
3
|
-
"poweredBy" : "Alimenté par",
|
|
4
|
-
"emptyState" : "Désolé, votre navigateur ne prend pas en charge les vidéos intégrées.",
|
|
5
|
-
"loadMoreVideos" : "Charger plus de vidéos",
|
|
6
|
-
"supported" : "Désolé, votre navigateur ne prend pas en charge les vidéos intégrées."
|
|
7
|
-
}
|
|
8
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"videoLibrary" : {
|
|
3
|
-
"poweredBy" : "Alimenté par",
|
|
4
|
-
"emptyState" : "Désolé, votre navigateur ne prend pas en charge les vidéos intégrées.",
|
|
5
|
-
"loadMoreVideos" : "Charger plus de vidéos",
|
|
6
|
-
"supported" : "Désolé, votre navigateur ne prend pas en charge les vidéos intégrées."
|
|
7
|
-
}
|
|
8
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"videoLibrary" : {
|
|
3
|
-
"poweredBy" : "Assegurado por",
|
|
4
|
-
"emptyState" : "Lamentamos, mas o seu navegador não suporta vídeos incorporados.",
|
|
5
|
-
"loadMoreVideos" : "Carregar mais vídeos",
|
|
6
|
-
"supported" : "Lamentamos, mas o seu navegador não suporta vídeos incorporados."
|
|
7
|
-
}
|
|
8
|
-
}
|