@streamscloud/embeddable 6.1.0 → 6.2.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.
@@ -29,3 +29,9 @@ export declare enum ImageScale {
29
29
  OriginalEncoded = "ORIGINAL_ENCODED",
30
30
  Small = "SMALL"
31
31
  }
32
+ export declare enum PostType {
33
+ ShortVideo = "SHORT_VIDEO"
34
+ }
35
+ export declare enum Status {
36
+ Published = "PUBLISHED"
37
+ }
@@ -35,3 +35,11 @@ export var ImageScale;
35
35
  ImageScale["OriginalEncoded"] = "ORIGINAL_ENCODED";
36
36
  ImageScale["Small"] = "SMALL";
37
37
  })(ImageScale || (ImageScale = {}));
38
+ export var PostType;
39
+ (function (PostType) {
40
+ PostType["ShortVideo"] = "SHORT_VIDEO";
41
+ })(PostType || (PostType = {}));
42
+ export var Status;
43
+ (function (Status) {
44
+ Status["Published"] = "PUBLISHED";
45
+ })(Status || (Status = {}));
@@ -1,3 +1,4 @@
1
+ import { PostType, Status } from '../../core/enums';
1
2
  import { createLocalGQLClient } from '../../core/graphql';
2
3
  import { mapToShortVideoViewerModel } from '../../short-videos/short-video-viewer';
3
4
  import { GetMediaPageConfigDocument, GetShortVideosDocument } from './operations.generated';
@@ -26,7 +27,8 @@ export class InternalMediaCenterDataProvider {
26
27
  input: {
27
28
  filter: {
28
29
  mediaPageId: this.mediaPageId,
29
- types: ['SHORT_VIDEO'],
30
+ types: [PostType.ShortVideo],
31
+ statuses: [Status.Published],
30
32
  categoryId: filter.categoryId,
31
33
  excludeIds: filter.excludeIds
32
34
  },
@@ -143,8 +143,16 @@ export const GetShortVideosDocument = {
143
143
  selectionSet: {
144
144
  kind: 'SelectionSet',
145
145
  selections: [
146
- { kind: 'Field', name: { kind: 'Name', value: 'url' } },
147
- { kind: 'Field', name: { kind: 'Name', value: 'thumbnailUrl' } },
146
+ {
147
+ kind: 'Field',
148
+ name: { kind: 'Name', value: 'url' },
149
+ arguments: [{ kind: 'Argument', name: { kind: 'Name', value: 'scale' }, value: { kind: 'EnumValue', value: 'SMALL' } }]
150
+ },
151
+ {
152
+ kind: 'Field',
153
+ name: { kind: 'Name', value: 'thumbnailUrl' },
154
+ arguments: [{ kind: 'Argument', name: { kind: 'Name', value: 'scale' }, value: { kind: 'EnumValue', value: 'SMALL' } }]
155
+ },
148
156
  { kind: 'Field', name: { kind: 'Name', value: 'type' } }
149
157
  ]
150
158
  }
@@ -213,8 +221,16 @@ export const GetShortVideosDocument = {
213
221
  selectionSet: {
214
222
  kind: 'SelectionSet',
215
223
  selections: [
216
- { kind: 'Field', name: { kind: 'Name', value: 'url' } },
217
- { kind: 'Field', name: { kind: 'Name', value: 'thumbnailUrl' } },
224
+ {
225
+ kind: 'Field',
226
+ name: { kind: 'Name', value: 'url' },
227
+ arguments: [{ kind: 'Argument', name: { kind: 'Name', value: 'scale' }, value: { kind: 'EnumValue', value: 'SMALL' } }]
228
+ },
229
+ {
230
+ kind: 'Field',
231
+ name: { kind: 'Name', value: 'thumbnailUrl' },
232
+ arguments: [{ kind: 'Argument', name: { kind: 'Name', value: 'scale' }, value: { kind: 'EnumValue', value: 'SMALL' } }]
233
+ },
218
234
  { kind: 'Field', name: { kind: 'Name', value: 'type' } }
219
235
  ]
220
236
  }
@@ -89,6 +89,7 @@ const selectCategory = (categoryId) => {
89
89
  Utils.assertUnreachable(mediaCenterMode);
90
90
  }
91
91
  selectedCategoryId = categoryId;
92
+ overviewOpened = false;
92
93
  };
93
94
  const activateSelectedShortVideoFeed = (shortVideo) => {
94
95
  if (!dataProvider || !shortVideoProps) {
@@ -331,6 +332,7 @@ const onScrollMounted = (node) => {
331
332
  .media-center__category-button {
332
333
  pointer-events: auto;
333
334
  font-size: 0.875rem;
335
+ line-height: 1;
334
336
  padding: 0.5rem 1.5rem;
335
337
  white-space: nowrap;
336
338
  width: auto;
@@ -6,7 +6,7 @@ let { shortVideo, localization: localizationInit = 'en', on } = $props();
6
6
  const localization = $derived(new ShortVideoAttachmentsLocalization(localizationInit));
7
7
  </script>
8
8
 
9
- {#if shortVideo.products.length || shortVideo.ad}
9
+ {#if shortVideo.hasAttachments}
10
10
  <div class="short-video-attachments">
11
11
  {#if shortVideo.ad}
12
12
  <AdCard ad={shortVideo.ad} />
@@ -18,6 +18,7 @@ export const mapToShortVideoViewerModel = (payload) => {
18
18
  text: payload.postData.shortVideoData.text,
19
19
  enableSocialInteractions: payload.enableSocialInteractions,
20
20
  heading: null,
21
+ hasAttachments: !!(payload.allProducts.length || payload.ad),
21
22
  ad: payload.ad ? mapToShortVideoAdCardModel(payload.ad) : null,
22
23
  products: payload.allProducts.map((x) => mapToShortVideoProductCard(x))
23
24
  // uncomment if you want to test many products behavior
@@ -26,8 +26,16 @@ export const ShortVideoViewerPayloadFragmentDoc = {
26
26
  selectionSet: {
27
27
  kind: 'SelectionSet',
28
28
  selections: [
29
- { kind: 'Field', name: { kind: 'Name', value: 'url' } },
30
- { kind: 'Field', name: { kind: 'Name', value: 'thumbnailUrl' } },
29
+ {
30
+ kind: 'Field',
31
+ name: { kind: 'Name', value: 'url' },
32
+ arguments: [{ kind: 'Argument', name: { kind: 'Name', value: 'scale' }, value: { kind: 'EnumValue', value: 'SMALL' } }]
33
+ },
34
+ {
35
+ kind: 'Field',
36
+ name: { kind: 'Name', value: 'thumbnailUrl' },
37
+ arguments: [{ kind: 'Argument', name: { kind: 'Name', value: 'scale' }, value: { kind: 'EnumValue', value: 'SMALL' } }]
38
+ },
31
39
  { kind: 'Field', name: { kind: 'Name', value: 'type' } }
32
40
  ]
33
41
  }
@@ -96,8 +104,16 @@ export const ShortVideoViewerPayloadFragmentDoc = {
96
104
  selectionSet: {
97
105
  kind: 'SelectionSet',
98
106
  selections: [
99
- { kind: 'Field', name: { kind: 'Name', value: 'url' } },
100
- { kind: 'Field', name: { kind: 'Name', value: 'thumbnailUrl' } },
107
+ {
108
+ kind: 'Field',
109
+ name: { kind: 'Name', value: 'url' },
110
+ arguments: [{ kind: 'Argument', name: { kind: 'Name', value: 'scale' }, value: { kind: 'EnumValue', value: 'SMALL' } }]
111
+ },
112
+ {
113
+ kind: 'Field',
114
+ name: { kind: 'Name', value: 'thumbnailUrl' },
115
+ arguments: [{ kind: 'Argument', name: { kind: 'Name', value: 'scale' }, value: { kind: 'EnumValue', value: 'SMALL' } }]
116
+ },
101
117
  { kind: 'Field', name: { kind: 'Name', value: 'type' } }
102
118
  ]
103
119
  }
@@ -7,8 +7,8 @@ fragment ShortVideoViewerPayloadFragment on Post {
7
7
  shortDescription
8
8
  link
9
9
  media {
10
- url
11
- thumbnailUrl
10
+ url(scale: SMALL)
11
+ thumbnailUrl(scale: SMALL)
12
12
  type
13
13
  }
14
14
  brand {
@@ -40,8 +40,8 @@ fragment ShortVideoViewerPayloadFragment on Post {
40
40
  }
41
41
  type
42
42
  media {
43
- url
44
- thumbnailUrl
43
+ url(scale: SMALL)
44
+ thumbnailUrl(scale: SMALL)
45
45
  type
46
46
  }
47
47
  }
@@ -14,6 +14,7 @@ export type ShortVideoViewerModel = {
14
14
  enableSocialInteractions: boolean;
15
15
  products: ShortVideoProductCardModel[];
16
16
  ad: ShortVideoAdCardModel | null;
17
+ hasAttachments: boolean;
17
18
  };
18
19
  export type ShortVideoViewerHeadingModel = {
19
20
  image: string | null;
@@ -44,7 +44,7 @@ const changeShowAttachments = () => {
44
44
  <img src={playerLogo} class="short-videos-player-controls__logo-img" alt="Player Logo" />
45
45
  </div>
46
46
  {/if}
47
- {#if shortVideo && uiManager.showAttachments}
47
+ {#if shortVideo?.hasAttachments && uiManager.showAttachments}
48
48
  <div class="short-videos-player-controls__short-video-attachments" transition:slideHorizontally|local>
49
49
  <ShortVideoViewerAttachments
50
50
  shortVideo={shortVideo}
@@ -69,8 +69,16 @@ export const GetShortVideosDocument = {
69
69
  selectionSet: {
70
70
  kind: 'SelectionSet',
71
71
  selections: [
72
- { kind: 'Field', name: { kind: 'Name', value: 'url' } },
73
- { kind: 'Field', name: { kind: 'Name', value: 'thumbnailUrl' } },
72
+ {
73
+ kind: 'Field',
74
+ name: { kind: 'Name', value: 'url' },
75
+ arguments: [{ kind: 'Argument', name: { kind: 'Name', value: 'scale' }, value: { kind: 'EnumValue', value: 'SMALL' } }]
76
+ },
77
+ {
78
+ kind: 'Field',
79
+ name: { kind: 'Name', value: 'thumbnailUrl' },
80
+ arguments: [{ kind: 'Argument', name: { kind: 'Name', value: 'scale' }, value: { kind: 'EnumValue', value: 'SMALL' } }]
81
+ },
74
82
  { kind: 'Field', name: { kind: 'Name', value: 'type' } }
75
83
  ]
76
84
  }
@@ -139,8 +147,16 @@ export const GetShortVideosDocument = {
139
147
  selectionSet: {
140
148
  kind: 'SelectionSet',
141
149
  selections: [
142
- { kind: 'Field', name: { kind: 'Name', value: 'url' } },
143
- { kind: 'Field', name: { kind: 'Name', value: 'thumbnailUrl' } },
150
+ {
151
+ kind: 'Field',
152
+ name: { kind: 'Name', value: 'url' },
153
+ arguments: [{ kind: 'Argument', name: { kind: 'Name', value: 'scale' }, value: { kind: 'EnumValue', value: 'SMALL' } }]
154
+ },
155
+ {
156
+ kind: 'Field',
157
+ name: { kind: 'Name', value: 'thumbnailUrl' },
158
+ arguments: [{ kind: 'Argument', name: { kind: 'Name', value: 'scale' }, value: { kind: 'EnumValue', value: 'SMALL' } }]
159
+ },
144
160
  { kind: 'Field', name: { kind: 'Name', value: 'type' } }
145
161
  ]
146
162
  }
@@ -17,6 +17,7 @@ export const mapToShortVideoViewerModel = (model) => {
17
17
  viewsCount: model.header.postViewsCount
18
18
  },
19
19
  enableSocialInteractions: model.enableSocialInteractions,
20
+ hasAttachments: !!(model.products.length || model.ad),
20
21
  ad: model.ad ? mapToAdViewModel(model.ad) : null,
21
22
  products: model.products.map(mapToProductCardModel)
22
23
  // uncomment if you want to test many products behavior
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamscloud/embeddable",
3
- "version": "6.1.0",
3
+ "version": "6.2.0",
4
4
  "author": "StreamsCloud",
5
5
  "repository": {
6
6
  "type": "git",