@streamscloud/embeddable 6.3.7 → 6.3.9

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.
@@ -34,15 +34,17 @@ let { ad, inert = false } = $props();
34
34
  </div>
35
35
  <div class="ad-card__button-container">
36
36
  {#if ad.ctaButton}
37
- <Button
38
- size={ButtonSize.Standard}
39
- on={{ click: () => ad.ctaButton && window.open(ad.ctaButton.url, '_blank') }}
40
- --button--font--size="1em"
41
- --button--font--color={ad.ctaButton.textColor}
42
- --button--background={ad.ctaButton.background}
43
- --button--min-width="100%">
44
- <span class="ad-card__button-text">{ad.ctaButton.text}</span>
45
- </Button>
37
+ <div class="ad-card__button">
38
+ <Button
39
+ size={ButtonSize.Standard}
40
+ on={{ click: () => ad.ctaButton && window.open(ad.ctaButton.url, '_blank') }}
41
+ --button--font--size="1em"
42
+ --button--font--color={ad.ctaButton.textColor}
43
+ --button--background={ad.ctaButton.background}
44
+ --button--min-width="100%">
45
+ <span class="ad-card__button-text">{ad.ctaButton.text}</span>
46
+ </Button>
47
+ </div>
46
48
  {/if}
47
49
  </div>
48
50
  </div>
@@ -60,13 +62,16 @@ let { ad, inert = false } = $props();
60
62
  }
61
63
  }
62
64
  .ad-card {
65
+ --image--object-fit: cover;
66
+ --image--width: auto;
67
+ --image--height: auto;
63
68
  width: 100%;
64
69
  height: max-content;
65
70
  display: flex;
66
71
  flex-direction: column;
67
72
  position: relative;
68
73
  container-type: inline-size;
69
- aspect-ratio: 10/16;
74
+ aspect-ratio: 9/16;
70
75
  color: #000000;
71
76
  background-color: rgba(255, 255, 255, 0.9);
72
77
  border: 0.038125rem solid #f2f2f3;
@@ -93,7 +98,6 @@ let { ad, inert = false } = $props();
93
98
  width: 100%;
94
99
  --image--width: 100%;
95
100
  --image--height: 100%;
96
- --image--object-fit: cover;
97
101
  }
98
102
  .ad-card__info {
99
103
  display: grid;
@@ -128,6 +132,8 @@ let { ad, inert = false } = $props();
128
132
  justify-content: flex-end;
129
133
  align-items: center;
130
134
  min-height: 3rem;
135
+ overflow: hidden;
136
+ min-width: 0;
131
137
  /* Set 'container-type: inline-size;' to reference container*/
132
138
  }
133
139
  @container (width < 230px) {
@@ -142,6 +148,7 @@ let { ad, inert = false } = $props();
142
148
  align-items: end;
143
149
  min-height: 2.5rem;
144
150
  margin-top: 0.125rem;
151
+ min-width: 0px;
145
152
  /* Set 'container-type: inline-size;' to reference container*/
146
153
  }
147
154
  @container (width < 230px) {
@@ -187,12 +194,15 @@ let { ad, inert = false } = $props();
187
194
  }
188
195
  }
189
196
  .ad-card__price {
190
- font-size: 1.875rem;
197
+ font-size: 1.6875rem;
191
198
  font-weight: 700;
192
199
  text-align: right;
193
200
  display: flex;
194
201
  align-items: end;
195
202
  gap: 0.625rem;
203
+ width: 100%;
204
+ min-width: 0;
205
+ white-space: nowrap;
196
206
  /* Set 'container-type: inline-size;' to reference container*/
197
207
  }
198
208
  @container (width < 230px) {
@@ -205,11 +215,15 @@ let { ad, inert = false } = $props();
205
215
  font-weight: 400;
206
216
  font-style: normal;
207
217
  font-size: 0.75rem;
208
- line-height: 1.125rem;
218
+ line-height: 1.09125rem;
209
219
  letter-spacing: 0;
210
220
  text-align: right;
211
221
  color: #6b7280;
212
222
  white-space: nowrap;
223
+ overflow: hidden;
224
+ text-overflow: ellipsis;
225
+ flex: 1 1 auto;
226
+ min-width: 0;
213
227
  /* Set 'container-type: inline-size;' to reference container*/
214
228
  }
215
229
  @container (width < 230px) {
@@ -217,4 +231,11 @@ let { ad, inert = false } = $props();
217
231
  font-size: 0.625rem;
218
232
  line-height: 0.875rem;
219
233
  }
234
+ }
235
+ .ad-card__button {
236
+ width: 100%;
237
+ }
238
+ .ad-card__button :global(*) {
239
+ width: 100%;
240
+ --button--min-width: 100%;
220
241
  }</style>
@@ -3,6 +3,7 @@ import type { IPlayerItemsProvider } from '../../ui/player';
3
3
  export declare class InternalShortVideoPlayerProvider implements IPlayerItemsProvider<ShortVideoViewerModel> {
4
4
  initialData: IPlayerItemsProvider<ShortVideoViewerModel>['initialData'];
5
5
  private ids;
6
+ private idOrder;
6
7
  private initialId?;
7
8
  private graphql;
8
9
  private dataLoader;
@@ -4,21 +4,25 @@ import { CursorDataLoader } from '../../core/data-loaders';
4
4
  import { createLocalGQLClient } from '../../core/graphql';
5
5
  import { mapToShortVideoViewerModel } from '../short-video-viewer';
6
6
  import { GetShortVideosDocument } from './operations.generated';
7
+ const CHUNK_SIZE = 20;
7
8
  export class InternalShortVideoPlayerProvider {
8
9
  initialData;
9
10
  ids;
11
+ idOrder = new Map();
10
12
  initialId;
11
13
  graphql;
12
14
  dataLoader = new CursorDataLoader({
13
15
  loadPage: async (continuationToken) => {
16
+ const startIdIndex = continuationToken.value ? parseInt(continuationToken.value, 10) : 0;
17
+ const endIdIndex = Math.min(startIdIndex + CHUNK_SIZE, this.ids.length);
18
+ const idsChunk = this.ids.slice(startIdIndex, endIdIndex);
14
19
  try {
15
20
  const payload = await this.graphql
16
21
  .query(GetShortVideosDocument, {
17
22
  input: {
18
- limit: 20,
19
- continuationToken,
23
+ limit: idsChunk.length,
20
24
  filter: {
21
- ids: this.ids
25
+ ids: idsChunk
22
26
  }
23
27
  },
24
28
  image_scale: ImageScale.OriginalEncoded
@@ -28,9 +32,14 @@ export class InternalShortVideoPlayerProvider {
28
32
  if (!data) {
29
33
  return null;
30
34
  }
35
+ const items = data.items.map(mapToShortVideoViewerModel).sort((a, b) => {
36
+ const ia = this.idOrder.get(a.id) ?? Number.MAX_SAFE_INTEGER;
37
+ const ib = this.idOrder.get(b.id) ?? Number.MAX_SAFE_INTEGER;
38
+ return ia - ib;
39
+ });
31
40
  return {
32
- items: data.items.map(mapToShortVideoViewerModel),
33
- continuationToken: ContinuationToken.fromPayload(data.continuationToken)
41
+ items,
42
+ continuationToken: ContinuationToken.fromPayload(endIdIndex < this.ids.length ? endIdIndex.toString() : null)
34
43
  };
35
44
  }
36
45
  catch {
@@ -42,6 +51,7 @@ export class InternalShortVideoPlayerProvider {
42
51
  const { ids, graphqlOrigin, initiator, initialId } = input;
43
52
  this.graphql = createLocalGQLClient(graphqlOrigin, initiator ? { 'x-initiator': initiator } : undefined);
44
53
  this.ids = ids;
54
+ ids.forEach((id, idx) => this.idOrder.set(id, idx));
45
55
  this.initialId = initialId;
46
56
  this.initialData = { prefetchedItems: [], startIndex: 0 };
47
57
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamscloud/embeddable",
3
- "version": "6.3.7",
3
+ "version": "6.3.9",
4
4
  "author": "StreamsCloud",
5
5
  "repository": {
6
6
  "type": "git",
@@ -10,7 +10,9 @@
10
10
  "scripts": {
11
11
  "dev": "vite dev --port 3010",
12
12
  "build": "svelte-package --tsconfig ./tsconfig.app.json && prettier --write --plugin prettier-plugin-svelte . && eslint --fix .",
13
- "build-publish": "npm run build && npm publish --access public",
13
+ "publish:prod": "npm run build && npm publish --access public --tag latest",
14
+ "version:dev": "node -e \"const fs=require('fs');const pkg=require('./package.json');const base=(pkg.version.includes('-')?pkg.version.split('-')[0]:pkg.version);pkg.version=base+'-'+Date.now();fs.writeFileSync('package.json',JSON.stringify(pkg,null,2)+'\\n');\"",
15
+ "publish:dev": "npm run build && npm run version:dev && npm publish --tag next && git checkout -- package.json",
14
16
  "pack": "npm run build && npm pack",
15
17
  "preview": "vite preview",
16
18
  "check": "svelte-check --tsconfig ./tsconfig.app.json && tsc -p tsconfig.node.json",