@streamscloud/embeddable 8.2.0 → 9.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/cmp.ad-card.svelte +8 -5
- package/dist/ads/ad-card/cmp.ad-card.svelte.d.ts +2 -0
- package/dist/content-player/cmp.content-player.svelte +1 -0
- package/dist/content-player/content-player-config.svelte.d.ts +8 -0
- package/dist/content-player/content-player-config.svelte.js +9 -1
- package/dist/content-player/controls-and-attachments.svelte +1 -0
- package/dist/core/enums.d.ts +5 -1
- package/dist/core/enums.js +4 -0
- package/dist/marketing-tracking/index.d.ts +2 -0
- package/dist/marketing-tracking/index.js +1 -0
- package/dist/marketing-tracking/service.d.ts +11 -0
- package/dist/marketing-tracking/service.js +35 -0
- package/dist/marketing-tracking/types.d.ts +5 -0
- package/dist/media-center/config/internal-media-center-analytics-handler.d.ts +3 -2
- package/dist/media-center/config/internal-media-center-analytics-handler.js +1 -0
- package/dist/media-center/config/internal-media-center-config.d.ts +1 -1
- package/dist/media-center/config/internal-media-center-config.js +11 -11
- package/dist/media-center/config/operations.generated.d.ts +4 -4
- package/dist/media-center/config/operations.generated.js +5 -8
- package/dist/media-center/config/operations.graphql +3 -3
- package/dist/media-center/config/types.d.ts +7 -5
- package/dist/media-center/config/types.js +1 -1
- package/dist/media-center/media-center/cmp.media-center.svelte +74 -17
- package/dist/media-center/media-center/cmp.media-center.svelte.d.ts +3 -3
- package/dist/media-center/media-center/discover-panel-handler.svelte.d.ts +5 -2
- package/dist/media-center/media-center/discover-panel-handler.svelte.js +8 -3
- package/dist/media-center/media-center/discover-panel.svelte +1 -1
- package/dist/media-center/media-center/discover-panel.svelte.d.ts +2 -2
- package/dist/media-center/media-center/post-player-provider-generator.d.ts +8 -0
- package/dist/media-center/media-center/{short-video-resources-generator.js → post-player-provider-generator.js} +8 -3
- package/dist/media-center/media-center/types.d.ts +1 -1
- package/dist/posts/attachments/cmp.attachments.svelte +14 -2
- package/dist/posts/attachments/cmp.attachments.svelte.d.ts +2 -0
- package/dist/posts/handlers/index.d.ts +1 -0
- package/dist/posts/handlers/index.js +1 -0
- package/dist/{short-videos/short-videos-player/internal-short-video-analytics-handler.d.ts → posts/handlers/internal-post-analytics-handler.d.ts} +3 -2
- package/dist/{short-videos/short-videos-player/internal-short-video-analytics-handler.js → posts/handlers/internal-post-analytics-handler.js} +2 -1
- package/dist/posts/model/post-model.d.ts +2 -0
- package/dist/posts/model/post-model.js +3 -0
- package/dist/posts/model/types.d.ts +2 -1
- package/dist/posts/model/types.js +1 -1
- package/dist/posts/post-viewer/attachments-horizontal.svelte +5 -4
- package/dist/posts/post-viewer/attachments-horizontal.svelte.d.ts +2 -0
- package/dist/posts/post-viewer/cmp.post-viewer.svelte +13 -2
- package/dist/posts/post-viewer/cmp.post-viewer.svelte.d.ts +2 -0
- package/dist/posts/post-viewer/mapper.js +18 -1
- package/dist/{short-videos/short-videos-player/cmp.short-videos-player.svelte → posts/posts-player/cmp.posts-player.svelte} +3 -3
- package/dist/posts/posts-player/cmp.posts-player.svelte.d.ts +4 -0
- package/dist/posts/posts-player/index.d.ts +31 -17
- package/dist/posts/posts-player/index.js +48 -31
- package/dist/posts/posts-player/mapper.d.ts +3 -0
- package/dist/{short-videos/short-videos-player → posts/posts-player}/mapper.js +2 -2
- package/dist/posts/posts-player/operations.generated.d.ts +80 -0
- package/dist/posts/posts-player/operations.generated.js +229 -0
- package/dist/posts/posts-player/operations.graphql +7 -0
- package/dist/posts/posts-player/posts-player-view.svelte +38 -4
- package/dist/posts/posts-player/posts-player-view.svelte.d.ts +5 -1
- package/dist/posts/posts-player/types.d.ts +7 -1
- package/dist/products/product-card/cmp.product-card.svelte +10 -7
- package/dist/products/product-card/cmp.product-card.svelte.d.ts +2 -0
- package/dist/products/product-card/mapper.d.ts +3 -1
- package/dist/products/product-card/mapper.js +2 -2
- package/dist/short-videos/data-providers/index.d.ts +1 -0
- package/dist/short-videos/data-providers/index.js +1 -0
- package/dist/short-videos/{short-videos-player/internal-short-video-player-provider.d.ts → data-providers/internal-short-video-player-items-provider.d.ts} +4 -4
- package/dist/short-videos/{short-videos-player/internal-short-video-player-provider.js → data-providers/internal-short-video-player-items-provider.js} +3 -3
- package/dist/short-videos/{short-videos-player → data-providers}/operations.generated.d.ts +0 -78
- package/dist/short-videos/{short-videos-player → data-providers}/operations.generated.js +2 -234
- package/dist/short-videos/{short-videos-player → data-providers}/operations.graphql +1 -9
- package/dist/short-videos/short-videos-player/index.d.ts +13 -62
- package/dist/short-videos/short-videos-player/index.js +76 -30
- package/dist/streams/layout/cmp.slot-content.svelte +14 -6
- package/dist/streams/layout/cmp.slot-content.svelte.d.ts +2 -0
- package/dist/streams/layout/element-views/cmp.container-stream-element.svelte +7 -2
- package/dist/streams/layout/element-views/cmp.container-stream-element.svelte.d.ts +2 -0
- package/dist/streams/layout/element-views/cmp.short-video-stream-element.svelte +8 -2
- package/dist/streams/layout/element-views/cmp.short-video-stream-element.svelte.d.ts +2 -0
- package/dist/streams/layout/element-views/cmp.stream-element.svelte +3 -2
- package/dist/streams/layout/element-views/cmp.stream-element.svelte.d.ts +2 -0
- package/dist/streams/layout/index.d.ts +1 -0
- package/dist/streams/layout/models/mapper.js +2 -1
- package/dist/streams/layout/serializer.svelte.js +0 -1
- package/dist/streams/layout/types.d.ts +4 -0
- package/dist/streams/layout/types.js +1 -0
- package/dist/streams/stream-page-viewer/cmp.stream-page-viewer.svelte +2 -2
- package/dist/streams/stream-page-viewer/cmp.stream-page-viewer.svelte.d.ts +2 -0
- package/dist/streams/stream-player/stream-player-view.svelte +15 -3
- package/dist/ui/player-slider/player-buffer.svelte.d.ts +1 -0
- package/dist/ui/swipe-indicator/cmp.swipe-indicator.svelte +7 -8
- package/package.json +1 -1
- package/dist/media-center/media-center/short-video-resources-generator.d.ts +0 -8
- package/dist/short-videos/short-videos-player/cmp.short-videos-player.svelte.d.ts +0 -4
- package/dist/short-videos/short-videos-player/mapper.d.ts +0 -3
- package/dist/short-videos/short-videos-player/short-videos-player-view.svelte +0 -82
- package/dist/short-videos/short-videos-player/short-videos-player-view.svelte.d.ts +0 -8
- package/dist/short-videos/short-videos-player/types.d.ts +0 -26
- /package/dist/{short-videos/short-videos-player → marketing-tracking}/types.js +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { getMediaItemImageUrl } from '../../core/media';
|
|
2
2
|
import { shouldUseSalePrice } from '../price-helper';
|
|
3
|
-
export const mapToProductCard = (payload,
|
|
3
|
+
export const mapToProductCard = (payload, options) => {
|
|
4
4
|
const effectiveSalePrice = payload.priceAndAvailability.productSalePrices?.find((x) => shouldUseSalePrice({
|
|
5
5
|
price: payload.priceAndAvailability.price,
|
|
6
6
|
salePrice: x.salePrice,
|
|
7
7
|
effectiveDateFrom: x.salePriceEffectiveDateFrom,
|
|
8
8
|
effectiveDateTo: x.salePriceEffectiveDateTo,
|
|
9
|
-
referenceDate
|
|
9
|
+
referenceDate: options?.referenceDate
|
|
10
10
|
}));
|
|
11
11
|
return {
|
|
12
12
|
id: payload.id,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { InternalShortVideoPlayerItemsProvider } from './internal-short-video-player-items-provider';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { InternalShortVideoPlayerItemsProvider } from './internal-short-video-player-items-provider';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { type PostPlayerModel } from '../../posts/posts-player';
|
|
1
2
|
import type { IPlayerItemsProvider } from '../../ui/player-slider';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
initialData: IPlayerItemsProvider<ShortVideoPlayerModel>['initialData'];
|
|
3
|
+
export declare class InternalShortVideoPlayerItemsProvider implements IPlayerItemsProvider<PostPlayerModel> {
|
|
4
|
+
initialData: IPlayerItemsProvider<PostPlayerModel>['initialData'];
|
|
5
5
|
private ids;
|
|
6
6
|
private idOrder;
|
|
7
7
|
private initialId?;
|
|
@@ -13,6 +13,6 @@ export declare class InternalShortVideoPlayerProvider implements IPlayerItemsPro
|
|
|
13
13
|
graphqlOrigin?: string;
|
|
14
14
|
initialId?: string;
|
|
15
15
|
});
|
|
16
|
-
loadMore: () => Promise<
|
|
16
|
+
loadMore: () => Promise<PostPlayerModel[]>;
|
|
17
17
|
prefetch: () => Promise<void>;
|
|
18
18
|
}
|
|
@@ -2,10 +2,10 @@ import { ImageScale } from '../..';
|
|
|
2
2
|
import { ContinuationToken } from '../../core/continuation-token';
|
|
3
3
|
import { CursorDataLoader } from '../../core/data-loaders';
|
|
4
4
|
import { createLocalGQLClient } from '../../core/graphql';
|
|
5
|
-
import {
|
|
5
|
+
import { mapToPostPlayerModel } from '../../posts/posts-player';
|
|
6
6
|
import { GetShortVideosDocument } from './operations.generated';
|
|
7
7
|
const CHUNK_SIZE = 20;
|
|
8
|
-
export class
|
|
8
|
+
export class InternalShortVideoPlayerItemsProvider {
|
|
9
9
|
initialData;
|
|
10
10
|
ids;
|
|
11
11
|
idOrder = new Map();
|
|
@@ -32,7 +32,7 @@ export class InternalShortVideoPlayerProvider {
|
|
|
32
32
|
if (!data) {
|
|
33
33
|
return null;
|
|
34
34
|
}
|
|
35
|
-
const items = data.items.map(
|
|
35
|
+
const items = data.items.map(mapToPostPlayerModel).sort((a, b) => {
|
|
36
36
|
const ia = this.idOrder.get(a.id) ?? Number.MAX_SAFE_INTEGER;
|
|
37
37
|
const ib = this.idOrder.get(b.id) ?? Number.MAX_SAFE_INTEGER;
|
|
38
38
|
return ia - ib;
|
|
@@ -86,82 +86,4 @@ export type GetShortVideosQuery = {
|
|
|
86
86
|
}>;
|
|
87
87
|
};
|
|
88
88
|
};
|
|
89
|
-
export type ShortVideosPlayerPayloadFragment = {
|
|
90
|
-
id: string;
|
|
91
|
-
enableSocialInteractions: boolean;
|
|
92
|
-
ownerProfile: {
|
|
93
|
-
id: string;
|
|
94
|
-
type: SchemaTypes.ProfileType;
|
|
95
|
-
};
|
|
96
|
-
allProducts: Array<{
|
|
97
|
-
id: string;
|
|
98
|
-
title: string;
|
|
99
|
-
shortDescription: string | null;
|
|
100
|
-
link: string | null;
|
|
101
|
-
media: Array<{
|
|
102
|
-
url: string;
|
|
103
|
-
thumbnailUrl: string | null;
|
|
104
|
-
type: SchemaTypes.MediaType;
|
|
105
|
-
}>;
|
|
106
|
-
brand: {
|
|
107
|
-
name: string;
|
|
108
|
-
} | null;
|
|
109
|
-
priceAndAvailability: {
|
|
110
|
-
currency: SchemaTypes.Currency;
|
|
111
|
-
price: number;
|
|
112
|
-
productSalePrices: Array<{
|
|
113
|
-
salePrice: number;
|
|
114
|
-
salePriceEffectiveDateFrom: any | null;
|
|
115
|
-
salePriceEffectiveDateTo: any | null;
|
|
116
|
-
}> | null;
|
|
117
|
-
};
|
|
118
|
-
}>;
|
|
119
|
-
ad: {
|
|
120
|
-
id: string;
|
|
121
|
-
title: string;
|
|
122
|
-
description: string | null;
|
|
123
|
-
price: number | null;
|
|
124
|
-
priceInfo: string | null;
|
|
125
|
-
currency: SchemaTypes.Currency | null;
|
|
126
|
-
type: SchemaTypes.AdType;
|
|
127
|
-
ctaButton: {
|
|
128
|
-
background: string;
|
|
129
|
-
textColor: string;
|
|
130
|
-
text: string;
|
|
131
|
-
url: string;
|
|
132
|
-
border: string;
|
|
133
|
-
} | null;
|
|
134
|
-
media: Array<{
|
|
135
|
-
url: string;
|
|
136
|
-
thumbnailUrl: string | null;
|
|
137
|
-
type: SchemaTypes.MediaType;
|
|
138
|
-
}>;
|
|
139
|
-
} | null;
|
|
140
|
-
postData: {
|
|
141
|
-
media: Array<{
|
|
142
|
-
url: string;
|
|
143
|
-
thumbnailUrl: string | null;
|
|
144
|
-
type: SchemaTypes.MediaType;
|
|
145
|
-
}>;
|
|
146
|
-
articleData: {
|
|
147
|
-
title: string;
|
|
148
|
-
kicker: string | null;
|
|
149
|
-
articleId: string;
|
|
150
|
-
} | null;
|
|
151
|
-
mediaData: {
|
|
152
|
-
text: string | null;
|
|
153
|
-
} | null;
|
|
154
|
-
momentData: {
|
|
155
|
-
text: string | null;
|
|
156
|
-
} | null;
|
|
157
|
-
shortVideoData: {
|
|
158
|
-
text: string | null;
|
|
159
|
-
} | null;
|
|
160
|
-
videoData: {
|
|
161
|
-
title: string | null;
|
|
162
|
-
text: string | null;
|
|
163
|
-
} | null;
|
|
164
|
-
};
|
|
165
|
-
};
|
|
166
|
-
export declare const ShortVideosPlayerPayloadFragmentDoc: DocumentNode<ShortVideosPlayerPayloadFragment, unknown>;
|
|
167
89
|
export declare const GetShortVideosDocument: DocumentNode<GetShortVideosQuery, GetShortVideosQueryVariables>;
|
|
@@ -1,232 +1,3 @@
|
|
|
1
|
-
export const ShortVideosPlayerPayloadFragmentDoc = {
|
|
2
|
-
kind: 'Document',
|
|
3
|
-
definitions: [
|
|
4
|
-
{
|
|
5
|
-
kind: 'FragmentDefinition',
|
|
6
|
-
name: { kind: 'Name', value: 'ShortVideosPlayerPayloadFragment' },
|
|
7
|
-
typeCondition: { kind: 'NamedType', name: { kind: 'Name', value: 'Post' } },
|
|
8
|
-
selectionSet: {
|
|
9
|
-
kind: 'SelectionSet',
|
|
10
|
-
selections: [
|
|
11
|
-
{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'PostViewerPayloadFragment' } },
|
|
12
|
-
{
|
|
13
|
-
kind: 'Field',
|
|
14
|
-
name: { kind: 'Name', value: 'ownerProfile' },
|
|
15
|
-
selectionSet: {
|
|
16
|
-
kind: 'SelectionSet',
|
|
17
|
-
selections: [
|
|
18
|
-
{ kind: 'Field', name: { kind: 'Name', value: 'id' } },
|
|
19
|
-
{ kind: 'Field', name: { kind: 'Name', value: 'type' } }
|
|
20
|
-
]
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
]
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
kind: 'FragmentDefinition',
|
|
28
|
-
name: { kind: 'Name', value: 'PostViewerPayloadFragment' },
|
|
29
|
-
typeCondition: { kind: 'NamedType', name: { kind: 'Name', value: 'Post' } },
|
|
30
|
-
selectionSet: {
|
|
31
|
-
kind: 'SelectionSet',
|
|
32
|
-
selections: [
|
|
33
|
-
{ kind: 'Field', name: { kind: 'Name', value: 'id' } },
|
|
34
|
-
{ kind: 'Field', name: { kind: 'Name', value: 'enableSocialInteractions' } },
|
|
35
|
-
{
|
|
36
|
-
kind: 'Field',
|
|
37
|
-
name: { kind: 'Name', value: 'allProducts' },
|
|
38
|
-
selectionSet: {
|
|
39
|
-
kind: 'SelectionSet',
|
|
40
|
-
selections: [
|
|
41
|
-
{ kind: 'Field', name: { kind: 'Name', value: 'id' } },
|
|
42
|
-
{ kind: 'Field', name: { kind: 'Name', value: 'title' } },
|
|
43
|
-
{ kind: 'Field', name: { kind: 'Name', value: 'shortDescription' } },
|
|
44
|
-
{ kind: 'Field', name: { kind: 'Name', value: 'link' } },
|
|
45
|
-
{
|
|
46
|
-
kind: 'Field',
|
|
47
|
-
name: { kind: 'Name', value: 'media' },
|
|
48
|
-
selectionSet: {
|
|
49
|
-
kind: 'SelectionSet',
|
|
50
|
-
selections: [
|
|
51
|
-
{
|
|
52
|
-
kind: 'Field',
|
|
53
|
-
name: { kind: 'Name', value: 'url' },
|
|
54
|
-
arguments: [{ kind: 'Argument', name: { kind: 'Name', value: 'scale' }, value: { kind: 'EnumValue', value: 'SMALL' } }]
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
kind: 'Field',
|
|
58
|
-
name: { kind: 'Name', value: 'thumbnailUrl' },
|
|
59
|
-
arguments: [{ kind: 'Argument', name: { kind: 'Name', value: 'scale' }, value: { kind: 'EnumValue', value: 'SMALL' } }]
|
|
60
|
-
},
|
|
61
|
-
{ kind: 'Field', name: { kind: 'Name', value: 'type' } }
|
|
62
|
-
]
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
kind: 'Field',
|
|
67
|
-
name: { kind: 'Name', value: 'brand' },
|
|
68
|
-
selectionSet: { kind: 'SelectionSet', selections: [{ kind: 'Field', name: { kind: 'Name', value: 'name' } }] }
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
kind: 'Field',
|
|
72
|
-
name: { kind: 'Name', value: 'priceAndAvailability' },
|
|
73
|
-
selectionSet: {
|
|
74
|
-
kind: 'SelectionSet',
|
|
75
|
-
selections: [
|
|
76
|
-
{ kind: 'Field', name: { kind: 'Name', value: 'currency' } },
|
|
77
|
-
{ kind: 'Field', name: { kind: 'Name', value: 'price' } },
|
|
78
|
-
{
|
|
79
|
-
kind: 'Field',
|
|
80
|
-
name: { kind: 'Name', value: 'productSalePrices' },
|
|
81
|
-
selectionSet: {
|
|
82
|
-
kind: 'SelectionSet',
|
|
83
|
-
selections: [
|
|
84
|
-
{ kind: 'Field', name: { kind: 'Name', value: 'salePrice' } },
|
|
85
|
-
{ kind: 'Field', name: { kind: 'Name', value: 'salePriceEffectiveDateFrom' } },
|
|
86
|
-
{ kind: 'Field', name: { kind: 'Name', value: 'salePriceEffectiveDateTo' } }
|
|
87
|
-
]
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
]
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
]
|
|
94
|
-
}
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
kind: 'Field',
|
|
98
|
-
name: { kind: 'Name', value: 'ad' },
|
|
99
|
-
selectionSet: {
|
|
100
|
-
kind: 'SelectionSet',
|
|
101
|
-
selections: [
|
|
102
|
-
{ kind: 'Field', name: { kind: 'Name', value: 'id' } },
|
|
103
|
-
{ kind: 'Field', name: { kind: 'Name', value: 'title' } },
|
|
104
|
-
{ kind: 'Field', name: { kind: 'Name', value: 'description' } },
|
|
105
|
-
{ kind: 'Field', name: { kind: 'Name', value: 'price' } },
|
|
106
|
-
{ kind: 'Field', name: { kind: 'Name', value: 'priceInfo' } },
|
|
107
|
-
{ kind: 'Field', name: { kind: 'Name', value: 'currency' } },
|
|
108
|
-
{
|
|
109
|
-
kind: 'Field',
|
|
110
|
-
name: { kind: 'Name', value: 'ctaButton' },
|
|
111
|
-
selectionSet: {
|
|
112
|
-
kind: 'SelectionSet',
|
|
113
|
-
selections: [
|
|
114
|
-
{ kind: 'Field', name: { kind: 'Name', value: 'background' } },
|
|
115
|
-
{ kind: 'Field', name: { kind: 'Name', value: 'textColor' } },
|
|
116
|
-
{ kind: 'Field', name: { kind: 'Name', value: 'text' } },
|
|
117
|
-
{ kind: 'Field', name: { kind: 'Name', value: 'url' } },
|
|
118
|
-
{ kind: 'Field', name: { kind: 'Name', value: 'border' } }
|
|
119
|
-
]
|
|
120
|
-
}
|
|
121
|
-
},
|
|
122
|
-
{ kind: 'Field', name: { kind: 'Name', value: 'type' } },
|
|
123
|
-
{
|
|
124
|
-
kind: 'Field',
|
|
125
|
-
name: { kind: 'Name', value: 'media' },
|
|
126
|
-
selectionSet: {
|
|
127
|
-
kind: 'SelectionSet',
|
|
128
|
-
selections: [
|
|
129
|
-
{
|
|
130
|
-
kind: 'Field',
|
|
131
|
-
name: { kind: 'Name', value: 'url' },
|
|
132
|
-
arguments: [{ kind: 'Argument', name: { kind: 'Name', value: 'scale' }, value: { kind: 'EnumValue', value: 'SMALL' } }]
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
kind: 'Field',
|
|
136
|
-
name: { kind: 'Name', value: 'thumbnailUrl' },
|
|
137
|
-
arguments: [{ kind: 'Argument', name: { kind: 'Name', value: 'scale' }, value: { kind: 'EnumValue', value: 'SMALL' } }]
|
|
138
|
-
},
|
|
139
|
-
{ kind: 'Field', name: { kind: 'Name', value: 'type' } }
|
|
140
|
-
]
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
]
|
|
144
|
-
}
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
kind: 'Field',
|
|
148
|
-
name: { kind: 'Name', value: 'postData' },
|
|
149
|
-
selectionSet: {
|
|
150
|
-
kind: 'SelectionSet',
|
|
151
|
-
selections: [
|
|
152
|
-
{
|
|
153
|
-
kind: 'Field',
|
|
154
|
-
name: { kind: 'Name', value: 'media' },
|
|
155
|
-
selectionSet: {
|
|
156
|
-
kind: 'SelectionSet',
|
|
157
|
-
selections: [
|
|
158
|
-
{
|
|
159
|
-
kind: 'Field',
|
|
160
|
-
name: { kind: 'Name', value: 'url' },
|
|
161
|
-
arguments: [
|
|
162
|
-
{
|
|
163
|
-
kind: 'Argument',
|
|
164
|
-
name: { kind: 'Name', value: 'scale' },
|
|
165
|
-
value: { kind: 'Variable', name: { kind: 'Name', value: 'image_scale' } }
|
|
166
|
-
}
|
|
167
|
-
]
|
|
168
|
-
},
|
|
169
|
-
{
|
|
170
|
-
kind: 'Field',
|
|
171
|
-
name: { kind: 'Name', value: 'thumbnailUrl' },
|
|
172
|
-
arguments: [
|
|
173
|
-
{
|
|
174
|
-
kind: 'Argument',
|
|
175
|
-
name: { kind: 'Name', value: 'scale' },
|
|
176
|
-
value: { kind: 'Variable', name: { kind: 'Name', value: 'image_scale' } }
|
|
177
|
-
}
|
|
178
|
-
]
|
|
179
|
-
},
|
|
180
|
-
{ kind: 'Field', name: { kind: 'Name', value: 'type' } }
|
|
181
|
-
]
|
|
182
|
-
}
|
|
183
|
-
},
|
|
184
|
-
{
|
|
185
|
-
kind: 'Field',
|
|
186
|
-
name: { kind: 'Name', value: 'articleData' },
|
|
187
|
-
selectionSet: {
|
|
188
|
-
kind: 'SelectionSet',
|
|
189
|
-
selections: [
|
|
190
|
-
{ kind: 'Field', name: { kind: 'Name', value: 'title' } },
|
|
191
|
-
{ kind: 'Field', name: { kind: 'Name', value: 'kicker' } },
|
|
192
|
-
{ kind: 'Field', name: { kind: 'Name', value: 'articleId' } }
|
|
193
|
-
]
|
|
194
|
-
}
|
|
195
|
-
},
|
|
196
|
-
{
|
|
197
|
-
kind: 'Field',
|
|
198
|
-
name: { kind: 'Name', value: 'mediaData' },
|
|
199
|
-
selectionSet: { kind: 'SelectionSet', selections: [{ kind: 'Field', name: { kind: 'Name', value: 'text' } }] }
|
|
200
|
-
},
|
|
201
|
-
{
|
|
202
|
-
kind: 'Field',
|
|
203
|
-
name: { kind: 'Name', value: 'momentData' },
|
|
204
|
-
selectionSet: { kind: 'SelectionSet', selections: [{ kind: 'Field', name: { kind: 'Name', value: 'text' } }] }
|
|
205
|
-
},
|
|
206
|
-
{
|
|
207
|
-
kind: 'Field',
|
|
208
|
-
name: { kind: 'Name', value: 'shortVideoData' },
|
|
209
|
-
selectionSet: { kind: 'SelectionSet', selections: [{ kind: 'Field', name: { kind: 'Name', value: 'text' } }] }
|
|
210
|
-
},
|
|
211
|
-
{
|
|
212
|
-
kind: 'Field',
|
|
213
|
-
name: { kind: 'Name', value: 'videoData' },
|
|
214
|
-
selectionSet: {
|
|
215
|
-
kind: 'SelectionSet',
|
|
216
|
-
selections: [
|
|
217
|
-
{ kind: 'Field', name: { kind: 'Name', value: 'title' } },
|
|
218
|
-
{ kind: 'Field', name: { kind: 'Name', value: 'text' } }
|
|
219
|
-
]
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
]
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
]
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
]
|
|
229
|
-
};
|
|
230
1
|
export const GetShortVideosDocument = {
|
|
231
2
|
kind: 'Document',
|
|
232
3
|
definitions: [
|
|
@@ -261,10 +32,7 @@ export const GetShortVideosDocument = {
|
|
|
261
32
|
{
|
|
262
33
|
kind: 'Field',
|
|
263
34
|
name: { kind: 'Name', value: 'items' },
|
|
264
|
-
selectionSet: {
|
|
265
|
-
kind: 'SelectionSet',
|
|
266
|
-
selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'ShortVideosPlayerPayloadFragment' } }]
|
|
267
|
-
}
|
|
35
|
+
selectionSet: { kind: 'SelectionSet', selections: [{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'PostsPlayerPayloadFragment' } }] }
|
|
268
36
|
},
|
|
269
37
|
{ kind: 'Field', name: { kind: 'Name', value: 'continuationToken' } }
|
|
270
38
|
]
|
|
@@ -477,7 +245,7 @@ export const GetShortVideosDocument = {
|
|
|
477
245
|
},
|
|
478
246
|
{
|
|
479
247
|
kind: 'FragmentDefinition',
|
|
480
|
-
name: { kind: 'Name', value: '
|
|
248
|
+
name: { kind: 'Name', value: 'PostsPlayerPayloadFragment' },
|
|
481
249
|
typeCondition: { kind: 'NamedType', name: { kind: 'Name', value: 'Post' } },
|
|
482
250
|
selectionSet: {
|
|
483
251
|
kind: 'SelectionSet',
|
|
@@ -2,16 +2,8 @@
|
|
|
2
2
|
query GetShortVideos($input: EmbedPostsInput!, $image_scale: ImageScale = ORIGINAL_ENCODED) {
|
|
3
3
|
shortVideos: embedPosts(input: $input) {
|
|
4
4
|
items {
|
|
5
|
-
...
|
|
5
|
+
...PostsPlayerPayloadFragment
|
|
6
6
|
}
|
|
7
7
|
continuationToken
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
|
-
|
|
11
|
-
fragment ShortVideosPlayerPayloadFragment on Post {
|
|
12
|
-
...PostViewerPayloadFragment
|
|
13
|
-
ownerProfile {
|
|
14
|
-
id
|
|
15
|
-
type
|
|
16
|
-
}
|
|
17
|
-
}
|
|
@@ -1,27 +1,12 @@
|
|
|
1
|
+
import type { Locale } from '../../core/locale';
|
|
1
2
|
import { type IMediaCenterConfig } from '../../media-center/config/types';
|
|
2
|
-
import type { IPostSocialInteractionsHandler } from '../../posts/social-interactions';
|
|
3
3
|
import type { IPlayerItemsProvider } from '../../ui/player-slider';
|
|
4
|
-
|
|
5
|
-
import { mapToShortVideoPlayerModel } from './mapper';
|
|
6
|
-
import type { IShortVideoAnalyticsHandler, ShortVideoPlayerModel, ShortVideoPlayerSettings } from './types';
|
|
7
|
-
export { ShortVideosPlayer, type ShortVideoPlayerModel };
|
|
8
|
-
export type { IMediaCenterConfig, IPlayerItemsProvider, IShortVideoAnalyticsHandler };
|
|
9
|
-
export { mapToShortVideoPlayerModel };
|
|
4
|
+
export type { IMediaCenterConfig, IPlayerItemsProvider };
|
|
10
5
|
/**
|
|
11
6
|
* Opens the short videos player modal.
|
|
12
7
|
*
|
|
13
|
-
* Two overloads (mutually exclusive):
|
|
14
|
-
* - Provider mode: openShortVideosPlayer({ shortVideosProvider, mediaCenterConfig?, ...common })
|
|
15
|
-
* - IDs mode: openShortVideosPlayer({ ids, initiator, graphqlOrigin?, initialId?, mediaPageId?, ...common })
|
|
16
|
-
*
|
|
17
8
|
* @param init Configuration options.
|
|
18
9
|
*
|
|
19
|
-
* Provider mode (overload 1)
|
|
20
|
-
* @param {IPlayerItemsProvider<ShortVideoPlayerModel>} init.shortVideosProvider
|
|
21
|
-
* Provider that supplies short-video items to the player.
|
|
22
|
-
* @param {IMediaCenterConfig} [init.mediaCenterConfig]
|
|
23
|
-
* Optional media-center config.
|
|
24
|
-
*
|
|
25
10
|
* IDs mode (overload 2)
|
|
26
11
|
* @param {string[]} init.ids
|
|
27
12
|
* List of short-video IDs to display.
|
|
@@ -34,22 +19,18 @@ export { mapToShortVideoPlayerModel };
|
|
|
34
19
|
* @param {string} [init.mediaPageId]
|
|
35
20
|
* Optional media page ID used to construct an internal media-center config.
|
|
36
21
|
*
|
|
37
|
-
*
|
|
22
|
+
* Player settings
|
|
38
23
|
* @param {IPostSocialInteractionsHandler} [init.socialInteractionsHandler]
|
|
39
24
|
* Handler for social interactions (like, share, etc.).
|
|
40
|
-
* @param
|
|
25
|
+
* @param [init.playerSettings]
|
|
41
26
|
* Player UI and behavior settings.
|
|
42
27
|
*
|
|
43
28
|
* Fields of ContentPlayerSettings:
|
|
44
|
-
* - {boolean} [disableBackground]
|
|
45
|
-
* If true, hides the player's background image.
|
|
46
29
|
* - {boolean} [hideCloseButton]
|
|
47
30
|
* If true, hides the close button.
|
|
48
31
|
* - {Locale} [locale='en']
|
|
49
32
|
* Localization for the player UI. Supported values: 'en' | 'no'.
|
|
50
33
|
* If omitted, the default locale 'en' is used.
|
|
51
|
-
* - {boolean} [showStreamsCloudWatermark]
|
|
52
|
-
* If true, shows the StreamsCloud watermark.
|
|
53
34
|
*
|
|
54
35
|
* Events
|
|
55
36
|
* @param {{ playerClosed?: () => void; videoActivated?: (id: string) => void }} [init.on]
|
|
@@ -61,70 +42,40 @@ export { mapToShortVideoPlayerModel };
|
|
|
61
42
|
*
|
|
62
43
|
* @returns {void}
|
|
63
44
|
*
|
|
64
|
-
* @example <caption>Provider mode</caption>
|
|
65
|
-
* ```ts
|
|
66
|
-
* import { openShortVideosPlayer } from '@streamscloud/embeddable/short-videos-player';
|
|
67
|
-
*
|
|
68
|
-
* openShortVideosPlayer({
|
|
69
|
-
* shortVideosProvider: myShortVideosProvider,
|
|
70
|
-
* mediaCenterConfig: mymediaCenterConfig,
|
|
71
|
-
* playerSettings: {
|
|
72
|
-
* // Locale is 'en' by default; set 'no' to switch to Norwegian:
|
|
73
|
-
* locale: 'no',
|
|
74
|
-
* disableBackground: false,
|
|
75
|
-
* hideCloseButton: false,
|
|
76
|
-
* showStreamsCloudWatermark: true,
|
|
77
|
-
* },
|
|
78
|
-
* on: {
|
|
79
|
-
* playerClosed: () => console.log('Player closed'),
|
|
80
|
-
* videoActivated: (id) => console.log('Activated', id)
|
|
81
|
-
* }
|
|
82
|
-
* });
|
|
83
|
-
* ```
|
|
84
|
-
*
|
|
85
45
|
* @example <caption>IDs mode</caption>
|
|
86
46
|
* ```ts
|
|
87
47
|
* import { openShortVideosPlayer } from '@streamscloud/embeddable/short-videos-player';
|
|
88
48
|
*
|
|
89
49
|
* openShortVideosPlayer({
|
|
90
50
|
* ids: ['id1', 'id2', 'id3'],
|
|
91
|
-
* initiator: '
|
|
51
|
+
* initiator: 'campaign-autumn',
|
|
92
52
|
* graphqlOrigin: 'https://graphql.example.com',
|
|
93
53
|
* initialId: 'id2',
|
|
94
54
|
* mediaPageId: 'media-page-123',
|
|
95
55
|
* playerSettings: {
|
|
96
|
-
* locale
|
|
97
|
-
*
|
|
56
|
+
* // Default locale is 'en'; set 'no' to switch to Norwegian:
|
|
57
|
+
* locale: 'no',
|
|
58
|
+
* disableBackground: false,
|
|
98
59
|
* hideCloseButton: false,
|
|
99
|
-
* showStreamsCloudWatermark:
|
|
60
|
+
* showStreamsCloudWatermark: true,
|
|
100
61
|
* },
|
|
101
62
|
* on: {
|
|
102
63
|
* playerClosed: () => console.log('Player closed'),
|
|
103
|
-
* videoActivated: (id) => console.log('Activated', id)
|
|
104
64
|
* }
|
|
105
65
|
* });
|
|
106
66
|
* ```
|
|
107
67
|
*/
|
|
108
|
-
export declare function openShortVideosPlayer(init: {
|
|
109
|
-
shortVideosProvider: IPlayerItemsProvider<ShortVideoPlayerModel>;
|
|
110
|
-
mediaCenterConfig?: IMediaCenterConfig;
|
|
111
|
-
analyticsHandler?: IShortVideoAnalyticsHandler;
|
|
112
|
-
socialInteractionsHandler?: IPostSocialInteractionsHandler;
|
|
113
|
-
playerSettings?: ShortVideoPlayerSettings;
|
|
114
|
-
on?: {
|
|
115
|
-
playerClosed?: () => void;
|
|
116
|
-
videoActivated?: (id: string) => void;
|
|
117
|
-
};
|
|
118
|
-
}): void;
|
|
119
68
|
export declare function openShortVideosPlayer(init: {
|
|
120
69
|
ids: string[];
|
|
121
70
|
initiator: string;
|
|
122
71
|
graphqlOrigin?: string;
|
|
123
72
|
initialId?: string;
|
|
124
73
|
mediaPageId?: string;
|
|
125
|
-
playerSettings?:
|
|
74
|
+
playerSettings?: {
|
|
75
|
+
hideCloseButton?: boolean;
|
|
76
|
+
locale?: Locale;
|
|
77
|
+
};
|
|
126
78
|
on?: {
|
|
127
79
|
playerClosed?: () => void;
|
|
128
|
-
videoActivated?: (id: string) => void;
|
|
129
80
|
};
|
|
130
81
|
}): void;
|