itube-specs 0.0.765 → 0.0.766
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/composables/fetch/use-fetch-categories-by-letter.ts +4 -4
- package/composables/fetch/use-fetch-categories-by-name.ts +4 -4
- package/composables/fetch/use-fetch-categories-by-phrase.ts +4 -4
- package/composables/fetch/use-fetch-categories-group-by-letter.ts +3 -3
- package/composables/fetch/use-fetch-categories-related.ts +4 -4
- package/composables/fetch/use-fetch-channels-by-model.ts +4 -4
- package/composables/fetch/use-fetch-channels-by-name.ts +4 -4
- package/composables/fetch/use-fetch-channels-by-network-name.ts +4 -4
- package/composables/fetch/use-fetch-channels.ts +4 -4
- package/composables/fetch/use-fetch-dictionaries-countries.ts +4 -4
- package/composables/fetch/use-fetch-dictionaries-genders.ts +4 -4
- package/composables/fetch/use-fetch-footer-categories.ts +4 -4
- package/composables/fetch/use-fetch-groups-categories-lazy.ts +2 -2
- package/composables/fetch/use-fetch-groups-categories.ts +4 -4
- package/composables/fetch/use-fetch-model-by-name.ts +4 -4
- package/composables/fetch/use-fetch-models-by-category.ts +4 -4
- package/composables/fetch/use-fetch-models-by-channel.ts +4 -4
- package/composables/fetch/use-fetch-models-by-letter.ts +4 -4
- package/composables/fetch/use-fetch-models-by-phrases.ts +4 -4
- package/composables/fetch/use-fetch-models-by-tag.ts +4 -4
- package/composables/fetch/use-fetch-models-related.ts +4 -4
- package/composables/fetch/use-fetch-models.ts +4 -4
- package/composables/fetch/use-fetch-multi-suggest.ts +4 -4
- package/composables/fetch/use-fetch-playlists-by-id.ts +3 -3
- package/composables/fetch/use-fetch-playlists-by-niche.ts +4 -4
- package/composables/fetch/use-fetch-playlists-get-videos-by-id.ts +3 -3
- package/composables/fetch/use-fetch-popular-tags-by-channel-name.ts +4 -4
- package/composables/fetch/use-fetch-popular-tags-by-model-name.ts +4 -4
- package/composables/fetch/use-fetch-related-searches.ts +4 -4
- package/composables/fetch/use-fetch-related-videos.ts +4 -4
- package/composables/fetch/use-fetch-top-chips-models.ts +4 -4
- package/composables/fetch/use-fetch-top-models.ts +3 -3
- package/composables/fetch/use-fetch-top-random-categories.ts +4 -4
- package/composables/fetch/use-fetch-top-random-full.ts +5 -5
- package/composables/fetch/use-fetch-video-referer-phrases.ts +4 -4
- package/composables/fetch/use-fetch-video.ts +4 -4
- package/composables/fetch/use-fetch-videos-by-categories.ts +4 -4
- package/composables/fetch/use-fetch-videos-by-channel.ts +4 -4
- package/composables/fetch/use-fetch-videos-by-model-and-channel.ts +4 -4
- package/composables/fetch/use-fetch-videos-by-model-and-tag.ts +4 -4
- package/composables/fetch/use-fetch-videos-by-model.ts +4 -4
- package/composables/fetch/use-fetch-videos-by-tag.ts +4 -4
- package/composables/fetch/use-fetch-videos-search-by-niche.ts +4 -4
- package/composables/fetch/use-fetch-videos.ts +4 -4
- package/composables/use-auth-popup.ts +4 -4
- package/composables/use-generate-link.ts +3 -3
- package/composables/use-playlist-add.ts +2 -2
- package/composables/use-playlist-edit.ts +5 -5
- package/lib/contact-forms-scheme.ts +6 -6
- package/lib/report-forms-scheme.ts +6 -6
- package/nuxt.config.ts +1 -1
- package/package.json +1 -1
- package/runtime/constants/async-data.ts +61 -0
- package/runtime/constants/auth-step.ts +7 -0
- package/runtime/constants/contacts-subjects.ts +9 -0
- package/runtime/constants/languages.ts +22 -0
- package/runtime/constants/niche.ts +8 -0
- package/runtime/constants/playlist-step.ts +7 -0
- package/runtime/constants/playlist-type.ts +6 -0
- package/runtime/constants/report-forms-subjects.ts +9 -0
- package/runtime/constants/thumb-size.ts +7 -0
- package/runtime/index.ts +9 -9
- package/runtime/utils/cleaners/clean-category-card.ts +1 -1
- package/runtime/utils/cleaners/clean-category-info.ts +1 -1
- package/runtime/utils/cleaners/clean-channel-card.ts +1 -1
- package/runtime/utils/cleaners/clean-channel-info.ts +1 -1
- package/runtime/utils/cleaners/clean-model-card.ts +1 -1
- package/runtime/utils/cleaners/clean-model-info.ts +1 -1
- package/runtime/utils/cleaners/clean-playlist-card.ts +1 -1
- package/runtime/utils/cleaners/clean-user-playlists-card.ts +1 -1
- package/runtime/utils/cleaners/clean-video-card.ts +1 -1
- package/runtime/utils/converters/convert-model-card-to-chips.ts +1 -1
- package/types/contacts-form.d.ts +2 -2
- package/types/contacts-scheme.d.ts +2 -2
- package/types/playlist-card.d.ts +2 -2
- package/types/playlist-data.d.ts +2 -2
- package/types/playlist-short.d.ts +2 -2
- package/types/raw/raw-playlist-card.d.ts +2 -2
- package/types/raw/raw-playlist-data.d.ts +2 -2
- package/types/raw/raw-playlist-user.d.ts +2 -2
- package/types/raw/raw-thumbs-urls.d.ts +1 -1
- package/types/report-form.d.ts +2 -2
- package/types/report-scheme.d.ts +2 -2
- package/types/thumbs-urls.d.ts +1 -1
- package/runtime/enums/async-data.ts +0 -59
- package/runtime/enums/auth-step.ts +0 -5
- package/runtime/enums/contacts-subjects.ts +0 -7
- package/runtime/enums/languages.ts +0 -20
- package/runtime/enums/niche.ts +0 -6
- package/runtime/enums/playlist-step.ts +0 -5
- package/runtime/enums/playlist-type.ts +0 -4
- package/runtime/enums/report-forms-subjects.ts +0 -7
- package/runtime/enums/thumb-size.ts +0 -5
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
1
|
+
import type { Language } from '../../runtime';
|
|
2
|
+
import { AsyncData } from '../../runtime';
|
|
3
3
|
import type { ICategoryCard } from '../../types';
|
|
4
4
|
|
|
5
5
|
export const useFetchTopRandomFull = async (
|
|
6
6
|
apiMethod: (...args: any[]) => Promise<Array<ICategoryCard>>
|
|
7
7
|
) => {
|
|
8
|
-
const lang = useLang() as
|
|
9
|
-
const key =
|
|
8
|
+
const lang = useLang() as Language;
|
|
9
|
+
const key = AsyncData.CategoriesTopRandomFull;
|
|
10
10
|
const stateKey = computed(() => `data-${key}-${lang}`);
|
|
11
11
|
|
|
12
12
|
const { data, status, error } = await useAsyncData<Array<ICategoryCard>>(
|
|
13
|
-
|
|
13
|
+
AsyncData.CategoriesTopRandomFull,
|
|
14
14
|
() => useApiFetcher<Array<ICategoryCard>>(
|
|
15
15
|
stateKey.value,
|
|
16
16
|
apiMethod,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
1
|
+
import type { Language } from '../../runtime';
|
|
2
|
+
import { AsyncData } from '../../runtime';
|
|
3
3
|
|
|
4
4
|
export const useFetchVideoRefererPhrases = async (
|
|
5
5
|
apiMethod: (...args: any[]) => Promise<string[]>) => {
|
|
6
|
-
const lang = useLang() as
|
|
6
|
+
const lang = useLang() as Language;
|
|
7
7
|
const slug = useSlug();
|
|
8
|
-
const key =
|
|
8
|
+
const key = AsyncData.RefererPhrases;
|
|
9
9
|
const stateKey = computed(() => `data-${key}-${slug.value}-${lang}`);
|
|
10
10
|
|
|
11
11
|
const { data, status, error } = await useAsyncData<string[]>(
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
1
|
+
import type { Language } from '../../runtime';
|
|
2
|
+
import { AsyncData } from '../../runtime';
|
|
3
3
|
import type { IVideoData } from '../../types';
|
|
4
4
|
|
|
5
5
|
export const useFetchVideo = async (
|
|
6
6
|
apiMethod: (...args: any[]) => Promise<IVideoData>,
|
|
7
7
|
) => {
|
|
8
|
-
const lang = useLang() as
|
|
8
|
+
const lang = useLang() as Language;
|
|
9
9
|
const slug = useSlug();
|
|
10
|
-
const key =
|
|
10
|
+
const key = AsyncData.Video;
|
|
11
11
|
const stateKey = computed(() => `data-${key}-${slug.value}-${lang}`);
|
|
12
12
|
|
|
13
13
|
const headers: Record<string, string> = {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
1
|
+
import type { Language } from '../../runtime';
|
|
2
|
+
import { AsyncData, getSelectedQuery } from '../../runtime';
|
|
3
3
|
import type { IVideoCard, PaginatedResponse } from '../../types';
|
|
4
4
|
import { useRoute } from 'vue-router';
|
|
5
5
|
import { selectAddedItems, selectDurationItems, sortItemsDefault } from '../../lib';
|
|
@@ -10,9 +10,9 @@ export const useFetchVideosByCategories = async (
|
|
|
10
10
|
const route = useRoute();
|
|
11
11
|
const mobile = !!useState<boolean>('isMobile').value;
|
|
12
12
|
const perPage = mobile ? 12 : 48;
|
|
13
|
-
const lang = useLang() as
|
|
13
|
+
const lang = useLang() as Language;
|
|
14
14
|
const slug = useSlug();
|
|
15
|
-
const key =
|
|
15
|
+
const key = AsyncData.VideosByCategory;
|
|
16
16
|
const stateKey = computed(() => `data-${key}-${slug.value}-${JSON.stringify(route.query)}-${lang}`);
|
|
17
17
|
const filters = computed(() => useGetVideosFilterRequest(route, selectDurationItems, selectAddedItems));
|
|
18
18
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
1
|
+
import type { Language } from '../../runtime';
|
|
2
|
+
import { AsyncData, getSelectedQuery } from '../../runtime';
|
|
3
3
|
import type { IVideoCard, PaginatedResponse } from '../../types';
|
|
4
4
|
import { selectAddedItems, selectDurationItems, sortItemsDefault } from '../../lib';
|
|
5
5
|
import { useRoute } from 'vue-router';
|
|
@@ -8,10 +8,10 @@ export const useFetchVideosByChannel = async (apiMethod: (...args: any[]) => Pro
|
|
|
8
8
|
const route = useRoute();
|
|
9
9
|
const mobile = !!useState<boolean>('isMobile').value;
|
|
10
10
|
const perPage = mobile ? 12 : 48;
|
|
11
|
-
const lang = useLang() as
|
|
11
|
+
const lang = useLang() as Language;
|
|
12
12
|
const slug = useSlug('channel');
|
|
13
13
|
const filters = computed(() => useGetVideosFilterRequest(route, selectDurationItems, selectAddedItems));
|
|
14
|
-
const key =
|
|
14
|
+
const key = AsyncData.VideosByChannel;
|
|
15
15
|
const stateKey = computed(() => `data-${key}-${slug.value}-${JSON.stringify(route.query)}-${lang}`);
|
|
16
16
|
|
|
17
17
|
const { data, status, error } = await useAsyncData<PaginatedResponse<IVideoCard>>(
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import { convertString,
|
|
1
|
+
import type { Language } from '../../runtime';
|
|
2
|
+
import { convertString, AsyncData, getSelectedQuery } from '../../runtime';
|
|
3
3
|
import type { IVideoCard, PaginatedResponse } from '../../types';
|
|
4
4
|
import { selectAddedItems, selectDurationItems, sortItemsDefault } from '../../lib';
|
|
5
5
|
import { useRoute } from 'vue-router';
|
|
6
6
|
|
|
7
7
|
export const useFetchVideosByModelAndChannel = async (apiMethod: (...args: any[]) => Promise<PaginatedResponse<IVideoCard>>) => {
|
|
8
8
|
const route = useRoute();
|
|
9
|
-
const lang = useLang() as
|
|
9
|
+
const lang = useLang() as Language;
|
|
10
10
|
const mobile = !!useState<boolean>('isMobile').value;
|
|
11
11
|
const perPage = mobile ? 12 : 48;
|
|
12
12
|
const slug = useSlug();
|
|
@@ -16,7 +16,7 @@ export const useFetchVideosByModelAndChannel = async (apiMethod: (...args: any[]
|
|
|
16
16
|
return Array.isArray(slug) ? slug[0] : slug;
|
|
17
17
|
});
|
|
18
18
|
const filters = computed(() => useGetVideosFilterRequest(route, selectDurationItems, selectAddedItems));
|
|
19
|
-
const key =
|
|
19
|
+
const key = AsyncData.VideosByModelAndChannel;
|
|
20
20
|
const stateKey = computed(() => `data-${key}-${slug.value}-${channel.value}-${JSON.stringify(route.query)}-${lang}`);
|
|
21
21
|
|
|
22
22
|
const { data, status, error } = await useAsyncData<PaginatedResponse<IVideoCard>>(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import { convertString,
|
|
1
|
+
import type { Language } from '../../runtime';
|
|
2
|
+
import { convertString, AsyncData, getSelectedQuery } from '../../runtime';
|
|
3
3
|
import type { IVideoCard, PaginatedResponse } from '../../types';
|
|
4
4
|
import { selectAddedItems, selectDurationItems, sortItemsDefault } from '../../lib';
|
|
5
5
|
import { useRoute } from 'vue-router';
|
|
@@ -8,7 +8,7 @@ export const useFetchVideosByModelAndTag = async (apiMethod: (...args: any[]) =>
|
|
|
8
8
|
const route = useRoute();
|
|
9
9
|
const mobile = !!useState<boolean>('isMobile').value;
|
|
10
10
|
const perPage = mobile ? 12 : 48;
|
|
11
|
-
const lang = useLang() as
|
|
11
|
+
const lang = useLang() as Language;
|
|
12
12
|
const slug = useSlug();
|
|
13
13
|
const tag = computed(() => {
|
|
14
14
|
const tagRaw = route.params['tag'];
|
|
@@ -16,7 +16,7 @@ export const useFetchVideosByModelAndTag = async (apiMethod: (...args: any[]) =>
|
|
|
16
16
|
return Array.isArray(slug) ? slug[0] : slug;
|
|
17
17
|
});
|
|
18
18
|
const filters = computed(() => useGetVideosFilterRequest(route, selectDurationItems, selectAddedItems));
|
|
19
|
-
const key =
|
|
19
|
+
const key = AsyncData.VideosByModelAndTag;
|
|
20
20
|
const stateKey = computed(() => `data-${key}-${slug.value}-${tag.value}-${JSON.stringify(route.query)}-${lang}`);
|
|
21
21
|
|
|
22
22
|
const { data, status, error } = await useAsyncData<PaginatedResponse<IVideoCard>>(
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
1
|
+
import type { Language } from '../../runtime';
|
|
2
|
+
import { AsyncData, getSelectedQuery } from '../../runtime';
|
|
3
3
|
import type { IVideoCard, PaginatedResponse } from '../../types';
|
|
4
4
|
import { selectAddedItems, selectDurationItems, sortItemsDefault } from '../../lib';
|
|
5
5
|
import { useRoute } from 'vue-router';
|
|
6
6
|
|
|
7
7
|
export const useFetchVideosByModel = async (apiMethod: (...args: any[]) => Promise<PaginatedResponse<IVideoCard>>) => {
|
|
8
8
|
const route = useRoute();
|
|
9
|
-
const lang = useLang() as
|
|
9
|
+
const lang = useLang() as Language;
|
|
10
10
|
const mobile = !!useState<boolean>('isMobile').value;
|
|
11
11
|
const perPage = mobile ? 12 : 48;
|
|
12
12
|
const slug = useSlug();
|
|
13
13
|
const filters = computed(() => useGetVideosFilterRequest(route, selectDurationItems, selectAddedItems));
|
|
14
|
-
const key =
|
|
14
|
+
const key = AsyncData.ModelsVideos;
|
|
15
15
|
const stateKey = computed(() => `data-${key}-${slug.value}-${JSON.stringify(route.query)}-${lang}`);
|
|
16
16
|
|
|
17
17
|
const { data, status, error } = await useAsyncData<PaginatedResponse<IVideoCard>>(
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
1
|
+
import type { Language } from '../../runtime';
|
|
2
|
+
import { AsyncData, getSelectedQuery } from '../../runtime';
|
|
3
3
|
import { selectAddedItems, selectDurationItems, sortItemsDefault } from '../../lib';
|
|
4
4
|
import { useRoute } from 'vue-router';
|
|
5
5
|
import type { IVideoCard, PaginatedResponse } from '../../types';
|
|
6
6
|
|
|
7
7
|
export const useFetchVideosByTag = async (apiMethod: (...args: any[]) => Promise<PaginatedResponse<IVideoCard>>) => {
|
|
8
8
|
const route = useRoute();
|
|
9
|
-
const lang = useLang() as
|
|
9
|
+
const lang = useLang() as Language;
|
|
10
10
|
const mobile = !!useState<boolean>('isMobile').value;
|
|
11
11
|
const perPage = mobile ? 12 : 48;
|
|
12
12
|
const slug = useSlug('tag');
|
|
13
13
|
const filters = computed(() => useGetVideosFilterRequest(route, selectDurationItems, selectAddedItems));
|
|
14
|
-
const key =
|
|
14
|
+
const key = AsyncData.VideosByTag;
|
|
15
15
|
const stateKey = computed(() => `data-${key}-${slug.value}-${JSON.stringify(route.query)}-${lang}`);
|
|
16
16
|
|
|
17
17
|
const { data, status, error } = await useAsyncData<PaginatedResponse<IVideoCard>>(
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
1
|
+
import type { Language } from '../../runtime';
|
|
2
|
+
import { AsyncData } from '../../runtime';
|
|
3
3
|
import type { IVideoCard, PaginatedResponse } from '../../types';
|
|
4
4
|
import { useRoute } from 'vue-router';
|
|
5
5
|
|
|
6
6
|
export const useFetchVideosSearchByNiche = async (apiMethod: (...args: any[]) => Promise<PaginatedResponse<IVideoCard>>) => {
|
|
7
|
-
const lang = useLang() as
|
|
7
|
+
const lang = useLang() as Language;
|
|
8
8
|
const mobile = !!useState<boolean>('isMobile').value;
|
|
9
9
|
const perPage = mobile ? 12 : 48;
|
|
10
10
|
const route = useRoute();
|
|
11
11
|
const slug = useSlug();
|
|
12
|
-
const key =
|
|
12
|
+
const key = AsyncData.VideosBySearch;
|
|
13
13
|
const stateKey = computed(() => `data-${key}-${slug.value}-${JSON.stringify(route.query)}-${lang}`);
|
|
14
14
|
|
|
15
15
|
const { data, status, error } = await useAsyncData<PaginatedResponse<IVideoCard>>(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { selectDurationItems, sortItemsDefault, selectAddedItems } from '../../lib';
|
|
2
|
-
import type {
|
|
3
|
-
import {
|
|
2
|
+
import type { Language } from '../../runtime';
|
|
3
|
+
import { AsyncData, getSelectedQuery } from '../../runtime';
|
|
4
4
|
import type { IVideoCard, PaginatedResponse } from '../../types';
|
|
5
5
|
import { useRoute } from 'vue-router';
|
|
6
6
|
|
|
@@ -11,9 +11,9 @@ export const useFetchVideos = async (
|
|
|
11
11
|
|
|
12
12
|
const mobile = !!useState<boolean>('isMobile').value;
|
|
13
13
|
const perPage = mobile ? 12 : 48;
|
|
14
|
-
const lang = useLang() as
|
|
14
|
+
const lang = useLang() as Language;
|
|
15
15
|
const filters = computed(() => useGetVideosFilterRequest(route, selectDurationItems, selectAddedItems));
|
|
16
|
-
const key =
|
|
16
|
+
const key = AsyncData.Videos;
|
|
17
17
|
const stateKey = computed(() => `data-${key}-${JSON.stringify(route.query)}-${lang}`);
|
|
18
18
|
|
|
19
19
|
const { data, status, error } = await useAsyncData<PaginatedResponse<IVideoCard>>(
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AuthSteps } from '../runtime';
|
|
2
2
|
|
|
3
|
-
/** Управляет состоянием попапа авторизации: открытие на нужном шаге
|
|
3
|
+
/** Управляет состоянием попапа авторизации: открытие на нужном шаге AuthSteps, закрытие, дополнительный текст. */
|
|
4
4
|
export const useAuthPopup = () => {
|
|
5
5
|
const isAuthPopupOpen = useState('auth-popup-open', () => false);
|
|
6
|
-
const currentStep = useState<
|
|
6
|
+
const currentStep = useState<AuthSteps>('auth-popup-step', () => AuthSteps.Registration);
|
|
7
7
|
const additionalText = useState<string | undefined>('auth-popup-text', () => undefined);
|
|
8
8
|
|
|
9
|
-
const openAuthPopup = (step:
|
|
9
|
+
const openAuthPopup = (step: AuthSteps, text?: string) => {
|
|
10
10
|
isAuthPopupOpen.value = true;
|
|
11
11
|
currentStep.value = step;
|
|
12
12
|
additionalText.value = text;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Language, Niche } from '~/runtime';
|
|
2
2
|
|
|
3
3
|
/** Возвращает generateLink — генерирует путь с учётом текущей ниши и локали. */
|
|
4
4
|
export const useGenerateLink = () => {
|
|
@@ -11,11 +11,11 @@ export const useGenerateLink = () => {
|
|
|
11
11
|
* @param localeArg - локаль
|
|
12
12
|
* @returns string - корректный путь для <NuxtLink> и navigateTo()
|
|
13
13
|
*/
|
|
14
|
-
const generateLink = (path: string, localeArg?:
|
|
14
|
+
const generateLink = (path: string, localeArg?: Language): string => {
|
|
15
15
|
const cleanPath = path.startsWith('/') ? path : `/${path}`
|
|
16
16
|
|
|
17
17
|
const defaultNiche = useAppConfig().defaultNiche;
|
|
18
|
-
const projectNiches = useAppConfig().niches as
|
|
18
|
+
const projectNiches = useAppConfig().niches as Niche[];
|
|
19
19
|
const isOneNiche = projectNiches.length === 1;
|
|
20
20
|
|
|
21
21
|
const withNiche =
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Ref } from 'vue';
|
|
2
2
|
import type { IVideoData, IVideoCard } from '../types';
|
|
3
|
-
import {
|
|
3
|
+
import { AuthSteps } from '../runtime';
|
|
4
4
|
|
|
5
5
|
/** Управляет состоянием попапа добавления видео в плейлист; при неавторизованном пользователе открывает попап авторизации. */
|
|
6
6
|
export const usePlaylistAdd = () => {
|
|
@@ -19,7 +19,7 @@ export const usePlaylistAdd = () => {
|
|
|
19
19
|
onBack.value = onBackCallback ?? null;
|
|
20
20
|
} else {
|
|
21
21
|
const authPopupText = 'register_first';
|
|
22
|
-
openAuthPopup(
|
|
22
|
+
openAuthPopup(AuthSteps.Registration, authPopupText);
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
25
|
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PlaylistStep } from '../runtime';
|
|
2
2
|
import type { IVideoCard, IPlaylistCard } from '../types';
|
|
3
3
|
|
|
4
|
-
/** Управляет состоянием попапа редактирования плейлиста: шаги
|
|
4
|
+
/** Управляет состоянием попапа редактирования плейлиста: шаги PlaylistStep, выбранный плейлист, возврат назад. */
|
|
5
5
|
export const usePlaylistEdit = () => {
|
|
6
6
|
const deletedVideo = useState<IVideoCard | null | undefined>('playlist-edit-deleted-video', () => null);
|
|
7
7
|
const selectedPlaylist = useState<IPlaylistCard | undefined>('playlist-edit-selected', () => undefined);
|
|
8
8
|
const isPlaylistEditOpen = useState('playlist-edit-open', () => false);
|
|
9
9
|
const isBackToEdit = useState('playlist-edit-back', () => false);
|
|
10
|
-
const currentStep = useState<
|
|
10
|
+
const currentStep = useState<PlaylistStep>('playlist-edit-step', () => PlaylistStep.Edit);
|
|
11
11
|
|
|
12
|
-
const openPlaylistEdit = (step:
|
|
12
|
+
const openPlaylistEdit = (step: PlaylistStep, back: boolean = false, playlist?: IPlaylistCard, videoCard?: IVideoCard) => {
|
|
13
13
|
selectedPlaylist.value = playlist;
|
|
14
14
|
isPlaylistEditOpen.value = true;
|
|
15
15
|
currentStep.value = step;
|
|
@@ -19,7 +19,7 @@ export const usePlaylistEdit = () => {
|
|
|
19
19
|
|
|
20
20
|
const closePlaylistEdit = () => {
|
|
21
21
|
if (isBackToEdit.value) {
|
|
22
|
-
openPlaylistEdit(
|
|
22
|
+
openPlaylistEdit(PlaylistStep.Edit, false, selectedPlaylist.value);
|
|
23
23
|
} else {
|
|
24
24
|
isPlaylistEditOpen.value = false;
|
|
25
25
|
isBackToEdit.value = false;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ContactsSubjects } from '../runtime';
|
|
2
2
|
import type { IContactScheme } from '../types';
|
|
3
3
|
import { reportReasonsItems } from '../lib';
|
|
4
4
|
|
|
5
5
|
export const contactFormsScheme: Array<IContactScheme> = [
|
|
6
6
|
{
|
|
7
|
-
subject:
|
|
7
|
+
subject: ContactsSubjects.Feedback,
|
|
8
8
|
},
|
|
9
9
|
{
|
|
10
|
-
subject:
|
|
10
|
+
subject: ContactsSubjects.Bugs,
|
|
11
11
|
items: [
|
|
12
12
|
{
|
|
13
13
|
type: 'text',
|
|
@@ -19,7 +19,7 @@ export const contactFormsScheme: Array<IContactScheme> = [
|
|
|
19
19
|
]
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
|
-
subject:
|
|
22
|
+
subject: ContactsSubjects.DMCA,
|
|
23
23
|
items: [
|
|
24
24
|
{
|
|
25
25
|
type: 'text',
|
|
@@ -75,7 +75,7 @@ export const contactFormsScheme: Array<IContactScheme> = [
|
|
|
75
75
|
]
|
|
76
76
|
},
|
|
77
77
|
{
|
|
78
|
-
subject:
|
|
78
|
+
subject: ContactsSubjects.Report,
|
|
79
79
|
items: [
|
|
80
80
|
...(reportReasonsItems).map((value, index) => ({
|
|
81
81
|
type: 'radio',
|
|
@@ -93,6 +93,6 @@ export const contactFormsScheme: Array<IContactScheme> = [
|
|
|
93
93
|
],
|
|
94
94
|
},
|
|
95
95
|
{
|
|
96
|
-
subject:
|
|
96
|
+
subject: ContactsSubjects.Advertising,
|
|
97
97
|
},
|
|
98
98
|
]
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReportFormsSubjects } from '../runtime';
|
|
2
2
|
import type { IReportScheme } from '../types';
|
|
3
3
|
import { reportReasonsItems } from './contacts/report-reasons-items';
|
|
4
4
|
import { reportIssueItems } from './contacts/report-issue-items';
|
|
@@ -7,7 +7,7 @@ import { reportMalwareItems } from './contacts/report-malware-items';
|
|
|
7
7
|
|
|
8
8
|
export const reportFormsScheme: Array<IReportScheme> = [
|
|
9
9
|
{
|
|
10
|
-
subject:
|
|
10
|
+
subject: ReportFormsSubjects.DMCA,
|
|
11
11
|
title: 'dmca_title',
|
|
12
12
|
items: [
|
|
13
13
|
{
|
|
@@ -92,7 +92,7 @@ export const reportFormsScheme: Array<IReportScheme> = [
|
|
|
92
92
|
]
|
|
93
93
|
},
|
|
94
94
|
{
|
|
95
|
-
subject:
|
|
95
|
+
subject: ReportFormsSubjects.Inappropriate,
|
|
96
96
|
title: 'inappropriate_title',
|
|
97
97
|
text: 'inappropriate_text',
|
|
98
98
|
hasReason: true,
|
|
@@ -132,7 +132,7 @@ export const reportFormsScheme: Array<IReportScheme> = [
|
|
|
132
132
|
]
|
|
133
133
|
},
|
|
134
134
|
{
|
|
135
|
-
subject:
|
|
135
|
+
subject: ReportFormsSubjects.Issue,
|
|
136
136
|
title: 'issue_title',
|
|
137
137
|
text: 'issue_text',
|
|
138
138
|
hasReason: true,
|
|
@@ -172,7 +172,7 @@ export const reportFormsScheme: Array<IReportScheme> = [
|
|
|
172
172
|
],
|
|
173
173
|
},
|
|
174
174
|
{
|
|
175
|
-
subject:
|
|
175
|
+
subject: ReportFormsSubjects.Wrong,
|
|
176
176
|
title: 'wrong_title',
|
|
177
177
|
text: 'wrong_text',
|
|
178
178
|
hasReason: true,
|
|
@@ -204,7 +204,7 @@ export const reportFormsScheme: Array<IReportScheme> = [
|
|
|
204
204
|
],
|
|
205
205
|
},
|
|
206
206
|
{
|
|
207
|
-
subject:
|
|
207
|
+
subject: ReportFormsSubjects.Malware,
|
|
208
208
|
title: 'malware_title',
|
|
209
209
|
text: 'malware_text',
|
|
210
210
|
hasReason: true,
|
package/nuxt.config.ts
CHANGED
package/package.json
CHANGED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export const AsyncData = {
|
|
2
|
+
Videos: 'videos',
|
|
3
|
+
Video: 'video',
|
|
4
|
+
VideosByTag: 'videos-by-tag',
|
|
5
|
+
VideosByChannel: 'videos-by-channel',
|
|
6
|
+
VideosByCategory: 'videos-by-category',
|
|
7
|
+
VideosByModel: 'videos-by-model',
|
|
8
|
+
VideosBySearch: 'videos-by-search',
|
|
9
|
+
ModelsVideos: 'models-videos',
|
|
10
|
+
ModelsByPhrases: 'models-phrases',
|
|
11
|
+
Models: 'models',
|
|
12
|
+
ModelsByFirstLetter: 'models-by-first-letter',
|
|
13
|
+
ModelsByFirstLetterChips: 'models-by-first-letter-chips',
|
|
14
|
+
RelatedVideos: 'related-videos',
|
|
15
|
+
RefererPhrases: 'referer-phrases-video',
|
|
16
|
+
AsideVideos: 'aside-videos',
|
|
17
|
+
TopModels: 'top-models',
|
|
18
|
+
TopModelsMore: 'top-models-more',
|
|
19
|
+
TopChipsModels: 'top-chips-models',
|
|
20
|
+
Model: 'model',
|
|
21
|
+
ModelSTop: 'models-top',
|
|
22
|
+
ModelsByName: 'models-by-name',
|
|
23
|
+
Channels: 'channels',
|
|
24
|
+
Channel: 'channel',
|
|
25
|
+
ChannelByName: 'channel-by-name',
|
|
26
|
+
ChannelsByNetworkName: 'channel-by-network-name',
|
|
27
|
+
Categories: 'categories',
|
|
28
|
+
CategoriesByPhrase: 'categories-by-phrase',
|
|
29
|
+
CategoriesByName: 'categories-by-name',
|
|
30
|
+
GroupsCategoriesFilter: 'groups-categories-filter',
|
|
31
|
+
GroupsCategoriesByLetter: 'groups-categories-by-letter',
|
|
32
|
+
GroupsCategoriesByLetterChips: 'groups-categories-by-letter-chips',
|
|
33
|
+
RelatedSearch: 'related-search',
|
|
34
|
+
MultiSuggestSearch: 'multi-suggest-search',
|
|
35
|
+
MultiSuggestRouteSearch: 'multi-suggest-route-search',
|
|
36
|
+
CategoriesByLetter: 'categories-by-letter',
|
|
37
|
+
CategoriesTopRandom: 'categories-top-random',
|
|
38
|
+
CategoriesRelated: 'categories-related',
|
|
39
|
+
CategoriesTopRandomFull: 'categories-top-random-full',
|
|
40
|
+
CategoriesTopRandomFooter: 'categories-top-random-footer',
|
|
41
|
+
Countries: 'countries',
|
|
42
|
+
Genders: 'genders',
|
|
43
|
+
GetPlaylists: 'get-playlists',
|
|
44
|
+
GetPlaylistsVideo: 'get-playlists-video',
|
|
45
|
+
GetPlaylistsByNiche: 'get-playlists-by-niche',
|
|
46
|
+
GetPlaylistsLikeNiche: 'get-playlists-like-niche',
|
|
47
|
+
PostPlaylists: 'post-playlists',
|
|
48
|
+
Profile: 'profile',
|
|
49
|
+
PlaylistById: 'playlist-by-id',
|
|
50
|
+
SetPlaylistView: 'set-playlist-view',
|
|
51
|
+
PopularTagsByModel: 'popular-tags-by-model',
|
|
52
|
+
PopularTagsByChannel: 'popular-tags-by-channel',
|
|
53
|
+
ChannelsByModel: 'channels-by-model',
|
|
54
|
+
VideosByModelAndChannel: 'videos-by-model-and-channel',
|
|
55
|
+
VideosByModelAndTag: 'videos-by-model-and-tag',
|
|
56
|
+
ModelsByCategory: 'models-by-category',
|
|
57
|
+
ModelsByChannel: 'models-by-channel',
|
|
58
|
+
ModelsByTag: 'models-by-tag',
|
|
59
|
+
} as const;
|
|
60
|
+
|
|
61
|
+
export type AsyncData = typeof AsyncData[keyof typeof AsyncData];
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export const Language = {
|
|
2
|
+
English: 'en',
|
|
3
|
+
German: 'de',
|
|
4
|
+
Spanish: 'es',
|
|
5
|
+
Korean: 'ko',
|
|
6
|
+
Japanese: 'ja',
|
|
7
|
+
Italian: 'it',
|
|
8
|
+
French: 'fr',
|
|
9
|
+
Russian: 'ru',
|
|
10
|
+
Chinese: 'zh',
|
|
11
|
+
} as const;
|
|
12
|
+
|
|
13
|
+
export type Language = typeof Language[keyof typeof Language];
|
|
14
|
+
|
|
15
|
+
const languageHeaderMap: Partial<Record<Language, string>> = {
|
|
16
|
+
[Language.Japanese]: 'jp',
|
|
17
|
+
[Language.Chinese]: 'ch',
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export function toHeaderLanguage(lang: Language): string {
|
|
21
|
+
return languageHeaderMap[lang] ?? lang;
|
|
22
|
+
}
|
package/runtime/index.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './
|
|
6
|
-
export * from './
|
|
7
|
-
export * from './
|
|
8
|
-
export * from './
|
|
9
|
-
export * from './
|
|
1
|
+
export * from './constants/playlist-type';
|
|
2
|
+
export * from './constants/contacts-subjects';
|
|
3
|
+
export * from './constants/async-data';
|
|
4
|
+
export * from './constants/auth-step';
|
|
5
|
+
export * from './constants/languages';
|
|
6
|
+
export * from './constants/niche';
|
|
7
|
+
export * from './constants/report-forms-subjects';
|
|
8
|
+
export * from './constants/playlist-step';
|
|
9
|
+
export * from './constants/thumb-size';
|
|
10
10
|
export * from './utils/format-date';
|
|
11
11
|
export * from './utils/format-number';
|
|
12
12
|
export * from './utils/format-time';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IRawCategoryCard, ICategoryCard } from '../../../types';
|
|
2
|
-
import { ThumbSize } from '../../
|
|
2
|
+
import { ThumbSize } from '../../constants/thumb-size';
|
|
3
3
|
|
|
4
4
|
/** Нормализует сырую карточку категории к типу ICategoryCard. */
|
|
5
5
|
export const cleanCategoryCard = (card: IRawCategoryCard): ICategoryCard => ({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IRawCategoryInfo, ICardInfo } from '../../../types';
|
|
2
|
-
import { ThumbSize } from '../../
|
|
2
|
+
import { ThumbSize } from '../../constants/thumb-size';
|
|
3
3
|
import { convertCategoriesToChips } from '../converters/convert-categories-to-chips';
|
|
4
4
|
|
|
5
5
|
/** Нормализует сырые данные страницы категории к типу ICardInfo. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IChannelCard, IRawChannelCard } from '../../../types';
|
|
2
|
-
import { ThumbSize } from '../../
|
|
2
|
+
import { ThumbSize } from '../../constants/thumb-size';
|
|
3
3
|
|
|
4
4
|
/** Нормализует сырую карточку канала к типу IChannelCard. */
|
|
5
5
|
export const cleanChannelCard = (card: IRawChannelCard): IChannelCard => ({
|