@streamscloud/embeddable 14.1.0 → 14.1.1

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.
@@ -6,13 +6,15 @@ let { context, locale = 'en', on } = $props();
6
6
  const localization = $derived(new MediaCenterHeaderLocalization(locale));
7
7
  const headerMounted = (node) => {
8
8
  const heightResizeObserver = new ResizeObserver(() => {
9
+ var _a;
9
10
  const headerHeight = node.clientHeight;
10
- on === null || on === void 0 ? void 0 : on.headerHeightChanged(headerHeight);
11
+ (_a = on === null || on === void 0 ? void 0 : on.headerHeightChanged) === null || _a === void 0 ? void 0 : _a.call(on, headerHeight);
11
12
  });
12
13
  heightResizeObserver.observe(node);
13
14
  return {
14
15
  destroy: () => {
15
- on === null || on === void 0 ? void 0 : on.headerHeightChanged(0);
16
+ var _a;
17
+ (_a = on === null || on === void 0 ? void 0 : on.headerHeightChanged) === null || _a === void 0 ? void 0 : _a.call(on, 0);
16
18
  heightResizeObserver.disconnect();
17
19
  }
18
20
  };
@@ -19,14 +19,16 @@ let scrollAreaRef = $state(null);
19
19
  const headerMounted = (node) => {
20
20
  headerRef = node;
21
21
  const heightResizeObserver = new ResizeObserver(() => {
22
+ var _a;
22
23
  const headerHeight = node.clientHeight;
23
- on === null || on === void 0 ? void 0 : on.headerHeightChanged(headerHeight);
24
+ (_a = on === null || on === void 0 ? void 0 : on.headerHeightChanged) === null || _a === void 0 ? void 0 : _a.call(on, headerHeight);
24
25
  calcHeaderGridProportions();
25
26
  });
26
27
  heightResizeObserver.observe(node);
27
28
  return {
28
29
  destroy: () => {
29
- on === null || on === void 0 ? void 0 : on.headerHeightChanged(0);
30
+ var _a;
31
+ (_a = on === null || on === void 0 ? void 0 : on.headerHeightChanged) === null || _a === void 0 ? void 0 : _a.call(on, 0);
30
32
  heightResizeObserver.disconnect();
31
33
  }
32
34
  };
@@ -360,8 +360,8 @@ const stopActivityTracking = () => {
360
360
  </div>
361
361
  {/snippet}
362
362
  <ChunksProgress
363
- allChunkItems={buffer.activeChunk.chunkItems.map((i) => i.model.id)}
364
- activeChunkItem={buffer.activeChunk.activeChunkItem.model.id}
363
+ totalItems={buffer.activeChunk.model.pagesCount}
364
+ activeItemIndex={buffer.activeChunk.activeItemIndex}
365
365
  chunkInfo={info} />
366
366
  </div>
367
367
  {/if}
@@ -1,16 +1,15 @@
1
- <script lang="ts">let { allChunkItems, activeChunkItem, chunkInfo } = $props();
2
- let currentIndex = $derived(allChunkItems.indexOf(activeChunkItem));
1
+ <script lang="ts">let { totalItems, activeItemIndex, chunkInfo } = $props();
3
2
  export {};
4
3
  </script>
5
4
 
6
5
  <div class="chunks-progress">
7
6
  <div
8
7
  class="chunks"
9
- class:chunks--few={allChunkItems.length <= 3}
10
- class:chunks--common={allChunkItems.length > 3 && allChunkItems.length <= 6}
11
- class:chunks--many={allChunkItems.length > 6}>
12
- {#each allChunkItems as chunk, i (chunk)}
13
- <div class="chunk" class:active={i <= currentIndex} aria-label={chunk}></div>
8
+ class:chunks--few={totalItems <= 3}
9
+ class:chunks--common={totalItems > 3 && totalItems <= 6}
10
+ class:chunks--many={totalItems > 6}>
11
+ {#each Array(totalItems) as _, i (i)}
12
+ <div class="chunk" class:active={i <= activeItemIndex} aria-label={`Item ${i}`}></div>
14
13
  {/each}
15
14
  </div>
16
15
 
@@ -1,7 +1,7 @@
1
1
  import type { Snippet } from 'svelte';
2
2
  type Props = {
3
- allChunkItems: string[];
4
- activeChunkItem: string;
3
+ totalItems: number;
4
+ activeItemIndex: number;
5
5
  chunkInfo?: Snippet;
6
6
  };
7
7
  declare const Cmp: import("svelte").Component<Props, {}, "">;
@@ -122,8 +122,6 @@ export class PlayerChunksManager {
122
122
  ? this.provider.initialData.startItemIndex
123
123
  : 0;
124
124
  this.setActiveChunkIndex(firstFilledChunkIndex, initialStartItemIndex);
125
- // Start background warm-up after initialization
126
- this.warmUp();
127
125
  };
128
126
  setActiveChunkIndex = async (index, chunkItemIndex) => {
129
127
  this._activeChunkIndex = index;
@@ -148,6 +146,8 @@ export class PlayerChunksManager {
148
146
  }
149
147
  else {
150
148
  this.activeChunk.setActiveItemIndex(this.activeChunk.chunkItems.indexOf(nextItem));
149
+ // Don't wait for warm up to be finished, it runs in the background
150
+ this.warmUp();
151
151
  }
152
152
  };
153
153
  warmUp = async () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamscloud/embeddable",
3
- "version": "14.1.0",
3
+ "version": "14.1.1",
4
4
  "author": "StreamsCloud",
5
5
  "repository": {
6
6
  "type": "git",