@streamscloud/embeddable 5.1.2 → 6.0.0
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/dist/ads/ad-card/mapper.js +1 -1
- package/dist/core/continuation-token.d.ts +1 -0
- package/dist/core/continuation-token.js +3 -0
- package/dist/core/locale.d.ts +0 -1
- package/dist/core/locale.js +0 -12
- package/dist/core/media/media-item-url.service.d.ts +1 -1
- package/dist/core/media/media-item-url.service.js +1 -6
- package/dist/media-center/data-provider/index.d.ts +2 -0
- package/dist/media-center/data-provider/index.js +1 -0
- package/dist/media-center/data-provider/internal-media-center-data-provider.svelte.d.ts +8 -0
- package/dist/media-center/data-provider/internal-media-center-data-provider.svelte.js +44 -0
- package/dist/media-center/data-provider/operations.generated.d.ts +89 -0
- package/dist/media-center/data-provider/operations.generated.js +275 -0
- package/dist/media-center/data-provider/operations.graphql +25 -0
- package/dist/media-center/data-provider/types.d.ts +24 -0
- package/dist/media-center/data-provider/types.js +1 -0
- package/dist/media-center/index.d.ts +1 -0
- package/dist/media-center/index.js +1 -0
- package/dist/media-center/media-center/cmp.media-center.svelte +336 -0
- package/dist/media-center/media-center/cmp.media-center.svelte.d.ts +20 -0
- package/dist/media-center/media-center/index.d.ts +3 -0
- package/dist/media-center/media-center/index.js +2 -0
- package/dist/media-center/media-center/media-center-localization.d.ts +11 -0
- package/dist/media-center/media-center/media-center-localization.js +15 -0
- package/dist/media-center/media-center/overview.svelte +142 -0
- package/dist/media-center/media-center/overview.svelte.d.ts +13 -0
- package/dist/media-center/media-center/short-video-resources-generator.d.ts +8 -0
- package/dist/media-center/media-center/short-video-resources-generator.js +26 -0
- package/dist/media-center/media-center/types.d.ts +10 -0
- package/dist/media-center/media-center/types.js +5 -0
- package/dist/products/product-card/cmp.product-card.svelte +11 -6
- package/dist/products/product-card/mapper.js +3 -3
- package/dist/short-videos/short-video-card/cmp.short-video-card.svelte +118 -0
- package/dist/short-videos/short-video-card/cmp.short-video-card.svelte.d.ts +11 -0
- package/dist/short-videos/short-video-card/index.d.ts +2 -0
- package/dist/short-videos/short-video-card/index.js +1 -0
- package/dist/short-videos/short-video-card/types.d.ts +5 -0
- package/dist/short-videos/short-video-card/types.js +1 -0
- package/dist/short-videos/short-video-viewer/cmp.short-video-controls.svelte +3 -3
- package/dist/short-videos/short-video-viewer/cmp.short-video-controls.svelte.d.ts +2 -2
- package/dist/short-videos/short-video-viewer/cmp.short-video-viewer.svelte +8 -26
- package/dist/short-videos/short-video-viewer/cmp.short-video-viewer.svelte.d.ts +2 -3
- package/dist/short-videos/short-video-viewer/index.d.ts +1 -1
- package/dist/short-videos/short-video-viewer/mapper.js +6 -3
- package/dist/short-videos/short-video-viewer/types.d.ts +8 -6
- package/dist/short-videos/short-video-viewer/ui-manager.svelte.d.ts +0 -5
- package/dist/short-videos/short-video-viewer/ui-manager.svelte.js +0 -11
- package/dist/short-videos/short-videos-player/cmp.short-videos-player.svelte +16 -12
- package/dist/short-videos/short-videos-player/cmp.short-videos-player.svelte.d.ts +5 -15
- package/dist/short-videos/short-videos-player/controls.svelte +34 -3
- package/dist/short-videos/short-videos-player/controls.svelte.d.ts +3 -2
- package/dist/short-videos/short-videos-player/fade-mixins.scss +12 -0
- package/dist/short-videos/short-videos-player/index.d.ts +66 -36
- package/dist/short-videos/short-videos-player/index.js +40 -104
- package/dist/short-videos/short-videos-player/internal-short-video-player-provider.d.ts +17 -0
- package/dist/short-videos/short-videos-player/internal-short-video-player-provider.js +59 -0
- package/dist/short-videos/short-videos-player/operations.generated.d.ts +1 -0
- package/dist/short-videos/short-videos-player/operations.generated.js +2 -1
- package/dist/short-videos/short-videos-player/operations.graphql +1 -0
- package/dist/short-videos/short-videos-player/short-videos-player-view.svelte +36 -55
- package/dist/short-videos/short-videos-player/short-videos-player-view.svelte.d.ts +12 -15
- package/dist/short-videos/short-videos-player/types.d.ts +8 -29
- package/dist/short-videos/short-videos-player/types.js +1 -6
- package/dist/short-videos/short-videos-player/ui-manager.svelte.d.ts +6 -6
- package/dist/short-videos/short-videos-player/ui-manager.svelte.js +28 -16
- package/dist/streams/layout/element-views/cmp.short-video-stream-element.svelte +6 -1
- package/dist/streams/stream-page-viewer/index.d.ts +1 -0
- package/dist/streams/stream-page-viewer/index.js +1 -0
- package/dist/streams/stream-player/controls.svelte +2 -2
- package/dist/streams/stream-player/controls.svelte.d.ts +2 -2
- package/dist/streams/stream-player/index.d.ts +84 -27
- package/dist/streams/stream-player/index.js +46 -48
- package/dist/streams/stream-player/internal-stream-analytics-handler.d.ts +12 -0
- package/dist/streams/stream-player/internal-stream-analytics-handler.js +17 -0
- package/dist/streams/stream-player/internal-stream-player-data-provider.d.ts +10 -0
- package/dist/streams/stream-player/internal-stream-player-data-provider.js +48 -0
- package/dist/streams/stream-player/mapper.js +2 -0
- package/dist/streams/stream-player/operations.generated.d.ts +0 -2
- package/dist/streams/stream-player/operations.generated.js +2 -4
- package/dist/streams/stream-player/operations.graphql +0 -1
- package/dist/streams/stream-player/stream-player-buffer.svelte.d.ts +5 -5
- package/dist/streams/stream-player/stream-player-buffer.svelte.js +12 -27
- package/dist/streams/stream-player/{cmp.stream-player.svelte → stream-player.svelte} +19 -37
- package/dist/streams/stream-player/stream-player.svelte.d.ts +4 -0
- package/dist/streams/stream-player/types.d.ts +40 -0
- package/dist/ui/player/index.d.ts +1 -1
- package/dist/ui/player/player-buffer.svelte.d.ts +3 -3
- package/package.json +5 -1
- package/dist/streams/stream-player/cmp.stream-player.svelte.d.ts +0 -22
|
@@ -3,7 +3,7 @@ export const mapToAdCardModel = (payload) => {
|
|
|
3
3
|
return {
|
|
4
4
|
id: payload.id,
|
|
5
5
|
type: payload.type,
|
|
6
|
-
image: getMediaItemImageUrl(payload.media
|
|
6
|
+
image: payload.media.length ? getMediaItemImageUrl(payload.media[0]) : null,
|
|
7
7
|
title: payload.title,
|
|
8
8
|
description: payload.description,
|
|
9
9
|
price: payload.price,
|
|
@@ -5,6 +5,7 @@ export declare class ContinuationToken {
|
|
|
5
5
|
static init(): ContinuationToken;
|
|
6
6
|
static fromPayload(value: string | null): ContinuationToken;
|
|
7
7
|
static preventLoading(): ContinuationToken;
|
|
8
|
+
toRawFormat(): string | null | undefined;
|
|
8
9
|
toString(): string | null;
|
|
9
10
|
toJSON(): string | null;
|
|
10
11
|
}
|
|
@@ -23,6 +23,9 @@ export class ContinuationToken {
|
|
|
23
23
|
// additional initilizer, to block further loading
|
|
24
24
|
return new ContinuationToken(false, null);
|
|
25
25
|
}
|
|
26
|
+
toRawFormat() {
|
|
27
|
+
return this.canLoadMore ? this.value || undefined : this.value;
|
|
28
|
+
}
|
|
26
29
|
toString() {
|
|
27
30
|
return this.value;
|
|
28
31
|
}
|
package/dist/core/locale.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ export type Locale = 'en' | 'no';
|
|
|
2
2
|
export type LocalizationSchema = {
|
|
3
3
|
[key: string]: Record<Locale, unknown>;
|
|
4
4
|
};
|
|
5
|
-
export declare const getLocale: <T>(input?: Locale | T) => Locale | T;
|
|
6
5
|
export declare const isEn: <T>(input: Locale | T) => input is "en";
|
|
7
6
|
export declare const isNo: <T>(input: Locale | T) => input is "no";
|
|
8
7
|
export declare const isLocale: <T>(input: Locale | T) => input is Locale;
|
package/dist/core/locale.js
CHANGED
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
export const getLocale = (input) => {
|
|
2
|
-
if (input === undefined || input === null) {
|
|
3
|
-
return 'en';
|
|
4
|
-
}
|
|
5
|
-
switch (input) {
|
|
6
|
-
case 'en':
|
|
7
|
-
case 'no':
|
|
8
|
-
return input;
|
|
9
|
-
default:
|
|
10
|
-
return input;
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
1
|
export const isEn = (input) => {
|
|
14
2
|
return input === 'en';
|
|
15
3
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { type MediaItemModel } from './types';
|
|
2
|
-
export declare const getMediaItemImageUrl: (media
|
|
2
|
+
export declare const getMediaItemImageUrl: (media: MediaItemModel) => string;
|
|
@@ -1,8 +1,3 @@
|
|
|
1
1
|
import { MediaType } from '../enums';
|
|
2
2
|
import {} from './types';
|
|
3
|
-
export const getMediaItemImageUrl = (media) =>
|
|
4
|
-
if (!media) {
|
|
5
|
-
return '';
|
|
6
|
-
}
|
|
7
|
-
return media.type === MediaType.Image ? media.url : media.thumbnailUrl;
|
|
8
|
-
};
|
|
3
|
+
export const getMediaItemImageUrl = (media) => (media.type === MediaType.Image ? media.url : media.thumbnailUrl);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { InternalMediaCenterDataProvider } from './internal-media-center-data-provider.svelte';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IMediaCenterDataProvider } from './types';
|
|
2
|
+
export declare class InternalMediaCenterDataProvider implements IMediaCenterDataProvider {
|
|
3
|
+
private readonly mediaPageId;
|
|
4
|
+
private graphql;
|
|
5
|
+
constructor(mediaPageId: string, graphqlOrigin?: string);
|
|
6
|
+
getConfig: IMediaCenterDataProvider['getConfig'];
|
|
7
|
+
getShortVideosCursor: IMediaCenterDataProvider['getShortVideosCursor'];
|
|
8
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { createLocalGQLClient } from '../../core/graphql';
|
|
2
|
+
import { mapToShortVideoViewerModel } from '../../short-videos/short-video-viewer';
|
|
3
|
+
import { GetMediaPageConfigDocument, GetShortVideosDocument } from './operations.generated';
|
|
4
|
+
export class InternalMediaCenterDataProvider {
|
|
5
|
+
mediaPageId;
|
|
6
|
+
graphql;
|
|
7
|
+
constructor(mediaPageId, graphqlOrigin) {
|
|
8
|
+
this.mediaPageId = mediaPageId;
|
|
9
|
+
this.graphql = createLocalGQLClient(graphqlOrigin);
|
|
10
|
+
}
|
|
11
|
+
getConfig = async () => {
|
|
12
|
+
const payload = await this.graphql.query(GetMediaPageConfigDocument, { mediaPageId: this.mediaPageId }).toPromise();
|
|
13
|
+
if (!payload.data?.embedMediaPagePlayerSettings) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
const settings = payload.data.embedMediaPagePlayerSettings;
|
|
17
|
+
return {
|
|
18
|
+
logo: settings.logo?.url || null,
|
|
19
|
+
postCategories: settings.postCategories.map((c) => ({ id: c.id, name: c.name })),
|
|
20
|
+
streamCategories: settings.streamCategories.map((c) => ({ id: c.id, name: c.name }))
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
getShortVideosCursor = async ({ filter, limit, continuationToken }) => {
|
|
24
|
+
const payload = await this.graphql
|
|
25
|
+
.query(GetShortVideosDocument, {
|
|
26
|
+
input: {
|
|
27
|
+
filter: {
|
|
28
|
+
mediaPageId: this.mediaPageId,
|
|
29
|
+
types: ['SHORT_VIDEO'],
|
|
30
|
+
categoryId: filter.categoryId,
|
|
31
|
+
excludeIds: filter.excludeIds
|
|
32
|
+
},
|
|
33
|
+
limit,
|
|
34
|
+
continuationToken
|
|
35
|
+
}
|
|
36
|
+
})
|
|
37
|
+
.toPromise();
|
|
38
|
+
const posts = payload.data?.shortVideos?.items || [];
|
|
39
|
+
return {
|
|
40
|
+
items: posts.map(mapToShortVideoViewerModel),
|
|
41
|
+
continuationToken: payload.data?.shortVideos?.continuationToken || null
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import type * as SchemaTypes from '../../../gql/types';
|
|
2
|
+
import type { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';
|
|
3
|
+
export type GetMediaPageConfigQueryVariables = SchemaTypes.Exact<{
|
|
4
|
+
mediaPageId: SchemaTypes.Scalars['String']['input'];
|
|
5
|
+
}>;
|
|
6
|
+
export type GetMediaPageConfigQuery = {
|
|
7
|
+
embedMediaPagePlayerSettings: {
|
|
8
|
+
logo: {
|
|
9
|
+
url: string;
|
|
10
|
+
} | null;
|
|
11
|
+
postCategories: Array<{
|
|
12
|
+
id: string;
|
|
13
|
+
name: string;
|
|
14
|
+
}>;
|
|
15
|
+
streamCategories: Array<{
|
|
16
|
+
id: string;
|
|
17
|
+
name: string;
|
|
18
|
+
}>;
|
|
19
|
+
} | null;
|
|
20
|
+
};
|
|
21
|
+
export type GetShortVideosQueryVariables = SchemaTypes.Exact<{
|
|
22
|
+
input: SchemaTypes.EmbedPostsInput;
|
|
23
|
+
image_scale?: SchemaTypes.InputMaybe<SchemaTypes.ImageScale>;
|
|
24
|
+
}>;
|
|
25
|
+
export type GetShortVideosQuery = {
|
|
26
|
+
shortVideos: {
|
|
27
|
+
continuationToken: string | null;
|
|
28
|
+
items: Array<{
|
|
29
|
+
id: string;
|
|
30
|
+
enableSocialInteractions: boolean;
|
|
31
|
+
allProducts: Array<{
|
|
32
|
+
id: string;
|
|
33
|
+
title: string;
|
|
34
|
+
shortDescription: string | null;
|
|
35
|
+
link: string | null;
|
|
36
|
+
media: Array<{
|
|
37
|
+
url: string;
|
|
38
|
+
thumbnailUrl: string | null;
|
|
39
|
+
type: SchemaTypes.MediaType;
|
|
40
|
+
}>;
|
|
41
|
+
brand: {
|
|
42
|
+
name: string;
|
|
43
|
+
} | null;
|
|
44
|
+
priceAndAvailability: {
|
|
45
|
+
currency: SchemaTypes.Currency;
|
|
46
|
+
price: number;
|
|
47
|
+
productSalePrices: Array<{
|
|
48
|
+
salePrice: number;
|
|
49
|
+
salePriceEffectiveDateFrom: any | null;
|
|
50
|
+
salePriceEffectiveDateTo: any | null;
|
|
51
|
+
}> | null;
|
|
52
|
+
};
|
|
53
|
+
}>;
|
|
54
|
+
ad: {
|
|
55
|
+
id: string;
|
|
56
|
+
title: string;
|
|
57
|
+
description: string | null;
|
|
58
|
+
price: number | null;
|
|
59
|
+
priceInfo: string | null;
|
|
60
|
+
currency: SchemaTypes.Currency | null;
|
|
61
|
+
type: SchemaTypes.AdType;
|
|
62
|
+
ctaButton: {
|
|
63
|
+
background: string;
|
|
64
|
+
textColor: string;
|
|
65
|
+
text: string;
|
|
66
|
+
url: string;
|
|
67
|
+
border: string;
|
|
68
|
+
} | null;
|
|
69
|
+
media: Array<{
|
|
70
|
+
url: string;
|
|
71
|
+
thumbnailUrl: string | null;
|
|
72
|
+
type: SchemaTypes.MediaType;
|
|
73
|
+
}>;
|
|
74
|
+
} | null;
|
|
75
|
+
postData: {
|
|
76
|
+
media: Array<{
|
|
77
|
+
url: string;
|
|
78
|
+
thumbnailUrl: string | null;
|
|
79
|
+
type: SchemaTypes.MediaType;
|
|
80
|
+
}>;
|
|
81
|
+
shortVideoData: {
|
|
82
|
+
text: string | null;
|
|
83
|
+
} | null;
|
|
84
|
+
};
|
|
85
|
+
}>;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
export declare const GetMediaPageConfigDocument: DocumentNode<GetMediaPageConfigQuery, GetMediaPageConfigQueryVariables>;
|
|
89
|
+
export declare const GetShortVideosDocument: DocumentNode<GetShortVideosQuery, GetShortVideosQueryVariables>;
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
export const GetMediaPageConfigDocument = {
|
|
2
|
+
kind: 'Document',
|
|
3
|
+
definitions: [
|
|
4
|
+
{
|
|
5
|
+
kind: 'OperationDefinition',
|
|
6
|
+
operation: 'query',
|
|
7
|
+
name: { kind: 'Name', value: 'GetMediaPageConfig' },
|
|
8
|
+
variableDefinitions: [
|
|
9
|
+
{
|
|
10
|
+
kind: 'VariableDefinition',
|
|
11
|
+
variable: { kind: 'Variable', name: { kind: 'Name', value: 'mediaPageId' } },
|
|
12
|
+
type: { kind: 'NonNullType', type: { kind: 'NamedType', name: { kind: 'Name', value: 'String' } } }
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
selectionSet: {
|
|
16
|
+
kind: 'SelectionSet',
|
|
17
|
+
selections: [
|
|
18
|
+
{
|
|
19
|
+
kind: 'Field',
|
|
20
|
+
name: { kind: 'Name', value: 'embedMediaPagePlayerSettings' },
|
|
21
|
+
arguments: [
|
|
22
|
+
{
|
|
23
|
+
kind: 'Argument',
|
|
24
|
+
name: { kind: 'Name', value: 'input' },
|
|
25
|
+
value: {
|
|
26
|
+
kind: 'ObjectValue',
|
|
27
|
+
fields: [
|
|
28
|
+
{
|
|
29
|
+
kind: 'ObjectField',
|
|
30
|
+
name: { kind: 'Name', value: 'mediaPageId' },
|
|
31
|
+
value: { kind: 'Variable', name: { kind: 'Name', value: 'mediaPageId' } }
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
selectionSet: {
|
|
38
|
+
kind: 'SelectionSet',
|
|
39
|
+
selections: [
|
|
40
|
+
{
|
|
41
|
+
kind: 'Field',
|
|
42
|
+
name: { kind: 'Name', value: 'logo' },
|
|
43
|
+
selectionSet: { kind: 'SelectionSet', selections: [{ kind: 'Field', name: { kind: 'Name', value: 'url' } }] }
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
kind: 'Field',
|
|
47
|
+
name: { kind: 'Name', value: 'postCategories' },
|
|
48
|
+
selectionSet: {
|
|
49
|
+
kind: 'SelectionSet',
|
|
50
|
+
selections: [
|
|
51
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'id' } },
|
|
52
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'name' } }
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
kind: 'Field',
|
|
58
|
+
name: { kind: 'Name', value: 'streamCategories' },
|
|
59
|
+
selectionSet: {
|
|
60
|
+
kind: 'SelectionSet',
|
|
61
|
+
selections: [
|
|
62
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'id' } },
|
|
63
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'name' } }
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
]
|
|
74
|
+
};
|
|
75
|
+
export const GetShortVideosDocument = {
|
|
76
|
+
kind: 'Document',
|
|
77
|
+
definitions: [
|
|
78
|
+
{
|
|
79
|
+
kind: 'OperationDefinition',
|
|
80
|
+
operation: 'query',
|
|
81
|
+
name: { kind: 'Name', value: 'GetShortVideos' },
|
|
82
|
+
variableDefinitions: [
|
|
83
|
+
{
|
|
84
|
+
kind: 'VariableDefinition',
|
|
85
|
+
variable: { kind: 'Variable', name: { kind: 'Name', value: 'input' } },
|
|
86
|
+
type: { kind: 'NonNullType', type: { kind: 'NamedType', name: { kind: 'Name', value: 'EmbedPostsInput' } } }
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
kind: 'VariableDefinition',
|
|
90
|
+
variable: { kind: 'Variable', name: { kind: 'Name', value: 'image_scale' } },
|
|
91
|
+
type: { kind: 'NamedType', name: { kind: 'Name', value: 'ImageScale' } },
|
|
92
|
+
defaultValue: { kind: 'EnumValue', value: 'ORIGINAL_ENCODED' }
|
|
93
|
+
}
|
|
94
|
+
],
|
|
95
|
+
selectionSet: {
|
|
96
|
+
kind: 'SelectionSet',
|
|
97
|
+
selections: [
|
|
98
|
+
{
|
|
99
|
+
kind: 'Field',
|
|
100
|
+
alias: { kind: 'Name', value: 'shortVideos' },
|
|
101
|
+
name: { kind: 'Name', value: 'embedPosts' },
|
|
102
|
+
arguments: [{ kind: 'Argument', name: { kind: 'Name', value: 'input' }, value: { kind: 'Variable', name: { kind: 'Name', value: 'input' } } }],
|
|
103
|
+
selectionSet: {
|
|
104
|
+
kind: 'SelectionSet',
|
|
105
|
+
selections: [
|
|
106
|
+
{
|
|
107
|
+
kind: 'Field',
|
|
108
|
+
name: { kind: 'Name', value: 'items' },
|
|
109
|
+
selectionSet: {
|
|
110
|
+
kind: 'SelectionSet',
|
|
111
|
+
selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'ShortVideoViewerPayloadFragment' } }]
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'continuationToken' } }
|
|
115
|
+
]
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
kind: 'FragmentDefinition',
|
|
123
|
+
name: { kind: 'Name', value: 'ShortVideoViewerPayloadFragment' },
|
|
124
|
+
typeCondition: { kind: 'NamedType', name: { kind: 'Name', value: 'Post' } },
|
|
125
|
+
selectionSet: {
|
|
126
|
+
kind: 'SelectionSet',
|
|
127
|
+
selections: [
|
|
128
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'id' } },
|
|
129
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'enableSocialInteractions' } },
|
|
130
|
+
{
|
|
131
|
+
kind: 'Field',
|
|
132
|
+
name: { kind: 'Name', value: 'allProducts' },
|
|
133
|
+
selectionSet: {
|
|
134
|
+
kind: 'SelectionSet',
|
|
135
|
+
selections: [
|
|
136
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'id' } },
|
|
137
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'title' } },
|
|
138
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'shortDescription' } },
|
|
139
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'link' } },
|
|
140
|
+
{
|
|
141
|
+
kind: 'Field',
|
|
142
|
+
name: { kind: 'Name', value: 'media' },
|
|
143
|
+
selectionSet: {
|
|
144
|
+
kind: 'SelectionSet',
|
|
145
|
+
selections: [
|
|
146
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'url' } },
|
|
147
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'thumbnailUrl' } },
|
|
148
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'type' } }
|
|
149
|
+
]
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
kind: 'Field',
|
|
154
|
+
name: { kind: 'Name', value: 'brand' },
|
|
155
|
+
selectionSet: { kind: 'SelectionSet', selections: [{ kind: 'Field', name: { kind: 'Name', value: 'name' } }] }
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
kind: 'Field',
|
|
159
|
+
name: { kind: 'Name', value: 'priceAndAvailability' },
|
|
160
|
+
selectionSet: {
|
|
161
|
+
kind: 'SelectionSet',
|
|
162
|
+
selections: [
|
|
163
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'currency' } },
|
|
164
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'price' } },
|
|
165
|
+
{
|
|
166
|
+
kind: 'Field',
|
|
167
|
+
name: { kind: 'Name', value: 'productSalePrices' },
|
|
168
|
+
selectionSet: {
|
|
169
|
+
kind: 'SelectionSet',
|
|
170
|
+
selections: [
|
|
171
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'salePrice' } },
|
|
172
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'salePriceEffectiveDateFrom' } },
|
|
173
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'salePriceEffectiveDateTo' } }
|
|
174
|
+
]
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
]
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
]
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
kind: 'Field',
|
|
185
|
+
name: { kind: 'Name', value: 'ad' },
|
|
186
|
+
selectionSet: {
|
|
187
|
+
kind: 'SelectionSet',
|
|
188
|
+
selections: [
|
|
189
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'id' } },
|
|
190
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'title' } },
|
|
191
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'description' } },
|
|
192
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'price' } },
|
|
193
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'priceInfo' } },
|
|
194
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'currency' } },
|
|
195
|
+
{
|
|
196
|
+
kind: 'Field',
|
|
197
|
+
name: { kind: 'Name', value: 'ctaButton' },
|
|
198
|
+
selectionSet: {
|
|
199
|
+
kind: 'SelectionSet',
|
|
200
|
+
selections: [
|
|
201
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'background' } },
|
|
202
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'textColor' } },
|
|
203
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'text' } },
|
|
204
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'url' } },
|
|
205
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'border' } }
|
|
206
|
+
]
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'type' } },
|
|
210
|
+
{
|
|
211
|
+
kind: 'Field',
|
|
212
|
+
name: { kind: 'Name', value: 'media' },
|
|
213
|
+
selectionSet: {
|
|
214
|
+
kind: 'SelectionSet',
|
|
215
|
+
selections: [
|
|
216
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'url' } },
|
|
217
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'thumbnailUrl' } },
|
|
218
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'type' } }
|
|
219
|
+
]
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
]
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
kind: 'Field',
|
|
227
|
+
name: { kind: 'Name', value: 'postData' },
|
|
228
|
+
selectionSet: {
|
|
229
|
+
kind: 'SelectionSet',
|
|
230
|
+
selections: [
|
|
231
|
+
{
|
|
232
|
+
kind: 'Field',
|
|
233
|
+
name: { kind: 'Name', value: 'media' },
|
|
234
|
+
selectionSet: {
|
|
235
|
+
kind: 'SelectionSet',
|
|
236
|
+
selections: [
|
|
237
|
+
{
|
|
238
|
+
kind: 'Field',
|
|
239
|
+
name: { kind: 'Name', value: 'url' },
|
|
240
|
+
arguments: [
|
|
241
|
+
{
|
|
242
|
+
kind: 'Argument',
|
|
243
|
+
name: { kind: 'Name', value: 'scale' },
|
|
244
|
+
value: { kind: 'Variable', name: { kind: 'Name', value: 'image_scale' } }
|
|
245
|
+
}
|
|
246
|
+
]
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
kind: 'Field',
|
|
250
|
+
name: { kind: 'Name', value: 'thumbnailUrl' },
|
|
251
|
+
arguments: [
|
|
252
|
+
{
|
|
253
|
+
kind: 'Argument',
|
|
254
|
+
name: { kind: 'Name', value: 'scale' },
|
|
255
|
+
value: { kind: 'Variable', name: { kind: 'Name', value: 'image_scale' } }
|
|
256
|
+
}
|
|
257
|
+
]
|
|
258
|
+
},
|
|
259
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'type' } }
|
|
260
|
+
]
|
|
261
|
+
}
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
kind: 'Field',
|
|
265
|
+
name: { kind: 'Name', value: 'shortVideoData' },
|
|
266
|
+
selectionSet: { kind: 'SelectionSet', selections: [{ kind: 'Field', name: { kind: 'Name', value: 'text' } }] }
|
|
267
|
+
}
|
|
268
|
+
]
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
]
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
]
|
|
275
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
query GetMediaPageConfig($mediaPageId: String!) {
|
|
2
|
+
embedMediaPagePlayerSettings(input: { mediaPageId: $mediaPageId }) {
|
|
3
|
+
logo {
|
|
4
|
+
url
|
|
5
|
+
}
|
|
6
|
+
postCategories {
|
|
7
|
+
id
|
|
8
|
+
name
|
|
9
|
+
}
|
|
10
|
+
streamCategories {
|
|
11
|
+
id
|
|
12
|
+
name
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
# noinspection GraphQLSchemaValidation
|
|
18
|
+
query GetShortVideos($input: EmbedPostsInput!, $image_scale: ImageScale = ORIGINAL_ENCODED) {
|
|
19
|
+
shortVideos: embedPosts(input: $input) {
|
|
20
|
+
items {
|
|
21
|
+
...ShortVideoViewerPayloadFragment
|
|
22
|
+
}
|
|
23
|
+
continuationToken
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ShortVideoViewerModel } from '../../short-videos/short-video-viewer';
|
|
2
|
+
export interface IMediaCenterDataProvider {
|
|
3
|
+
getConfig: () => Promise<MediaCenterConfig | null>;
|
|
4
|
+
getShortVideosCursor: (input: {
|
|
5
|
+
filter: {
|
|
6
|
+
categoryId?: string;
|
|
7
|
+
excludeIds?: string[];
|
|
8
|
+
};
|
|
9
|
+
limit: number;
|
|
10
|
+
continuationToken?: string | null;
|
|
11
|
+
}) => Promise<{
|
|
12
|
+
items: ShortVideoViewerModel[];
|
|
13
|
+
continuationToken: string | null;
|
|
14
|
+
}>;
|
|
15
|
+
}
|
|
16
|
+
export type MediaCenterConfig = {
|
|
17
|
+
logo: string | null;
|
|
18
|
+
postCategories: MediaCenterCategoryModel[];
|
|
19
|
+
streamCategories: MediaCenterCategoryModel[];
|
|
20
|
+
};
|
|
21
|
+
export type MediaCenterCategoryModel = {
|
|
22
|
+
id: string;
|
|
23
|
+
name: string;
|
|
24
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { IMediaCenterDataProvider } from './data-provider';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|