@streamscloud/embeddable 3.2.7 → 3.3.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.
@@ -11,12 +11,13 @@ const localization = $derived(new ShortVideoDetailsLocalization(localizationInit
11
11
  <div class="short-video-details" transition:slideHorizontally|local data-theme="dark">
12
12
  <div class="short-video-details__sliding-container">
13
13
  <div class="short-video-details__content">
14
- <div class="short-video-details__heading">
15
- <ShortVideoHeading
16
- model={shortVideo.heading}
17
- localization={{ viewsCount: localization.viewsCount, timeAgoLocalization: localization.timeAgoLocalization }} />
18
- </div>
19
-
14
+ {#if shortVideo.heading}
15
+ <div class="short-video-details__heading">
16
+ <ShortVideoHeading
17
+ model={shortVideo.heading}
18
+ localization={{ viewsCount: localization.viewsCount, timeAgoLocalization: localization.timeAgoLocalization }} />
19
+ </div>
20
+ {/if}
20
21
  {#if shortVideo.text}
21
22
  <p class="short-video-details__text">
22
23
  {shortVideo.text}
@@ -4,9 +4,11 @@ let { model, localization } = $props();
4
4
  </script>
5
5
 
6
6
  <div class="short-video-description">
7
- <div class="short-video-description__heading">
8
- <ShortVideoHeading model={model.heading} localization={localization} />
9
- </div>
7
+ {#if model.heading}
8
+ <div class="short-video-description__heading">
9
+ <ShortVideoHeading model={model.heading} localization={localization} />
10
+ </div>
11
+ {/if}
10
12
  <div class="short-video-description__text">
11
13
  {#if model.text}
12
14
  <LineClamp value={model.text} maxLines={2} />
@@ -10,7 +10,7 @@ export type ShortVideoViewerModel = {
10
10
  thumbnailUrl: string;
11
11
  };
12
12
  text?: string | null;
13
- heading: ShortVideoViewerHeadingModel;
13
+ heading: ShortVideoViewerHeadingModel | null;
14
14
  products: ShortVideoViewerProductModel[];
15
15
  ad: ShortVideoViewerAdModel | null;
16
16
  };
@@ -10,7 +10,7 @@ export const mapToShortVideoViewerModel = (model) => {
10
10
  thumbnailUrl: model.media.thumbnailUrl
11
11
  },
12
12
  text: model.text,
13
- heading: {
13
+ heading: model.header && {
14
14
  image: model.header.sourceImage,
15
15
  name: model.header.sourceName,
16
16
  displayDate: model.header.postDisplayDate,
@@ -5,7 +5,7 @@ export type StreamLayoutShortVideoModel = {
5
5
  id: string;
6
6
  media: StreamLayoutMediaItemModel;
7
7
  text: string | null;
8
- header: StreamLayoutPostHeaderModel;
8
+ header: StreamLayoutPostHeaderModel | null;
9
9
  enableSocialInteractions: boolean;
10
10
  bookmarksCount: number;
11
11
  products: StreamLayoutShortVideoProductModel[];
@@ -8,7 +8,7 @@ export declare class StreamPlayerBuffer implements IPlayerBuffer<StreamPageViewe
8
8
  readonly canLoadNext: boolean;
9
9
  readonly canLoadPrevious: boolean;
10
10
  readonly navigationDisabled: boolean;
11
- readonly animationDuration = 1200;
11
+ readonly animationDuration = 300;
12
12
  private _pagesLoader;
13
13
  private _currentIndex;
14
14
  private _loaded;
@@ -12,7 +12,7 @@ export class StreamPlayerBuffer {
12
12
  canLoadNext = $derived(this.currentIndex < this.loaded.length - 1);
13
13
  canLoadPrevious = $derived(this.currentIndex > 0);
14
14
  navigationDisabled = $derived(!this.canLoadNext && !this.canLoadPrevious);
15
- animationDuration = 1200;
15
+ animationDuration = 300;
16
16
  _pagesLoader;
17
17
  _currentIndex = $state(-1);
18
18
  _loaded = $state.raw([]);
@@ -23,7 +23,7 @@ export class StreamPlayerBuffer {
23
23
  const payload = await graphql
24
24
  .query(GetStreamPagesDocument, {
25
25
  input: {
26
- limit: 2,
26
+ limit: 10,
27
27
  continuationToken,
28
28
  filter: {
29
29
  streamId
@@ -5,7 +5,7 @@ let { buffer, children, on } = $props();
5
5
  let slidesRef;
6
6
  let sliderHeight = $state(0);
7
7
  let swipeTransition = $state(0);
8
- let cssAnimationDuration = $state(buffer.animationDuration * 0.75);
8
+ let cssAnimationDuration = $state(buffer.animationDuration);
9
9
  let resizeObserver;
10
10
  let activeIndex = $state.raw(buffer.currentIndex);
11
11
  const actualTransition = $derived(-sliderHeight * activeIndex);
@@ -81,7 +81,7 @@ onMount(() => {
81
81
  if (e.deltaY < 0 && buffer.canLoadPrevious) {
82
82
  buffer.loadPrevious();
83
83
  }
84
- }, buffer.animationDuration + 250));
84
+ }, buffer.animationDuration));
85
85
  slidesRef.addEventListener('transitionend', (e) => {
86
86
  if (e.target !== slidesRef) {
87
87
  return;
@@ -8,7 +8,7 @@ export declare class PlayerBuffer<T extends {
8
8
  readonly canLoadNext: boolean;
9
9
  readonly canLoadPrevious: boolean;
10
10
  readonly navigationDisabled: boolean;
11
- readonly animationDuration = 1200;
11
+ readonly animationDuration = 300;
12
12
  private _currentIndex;
13
13
  private _loaded;
14
14
  private loadMoreFn;
@@ -6,7 +6,7 @@ export class PlayerBuffer {
6
6
  canLoadNext = $derived(this.currentIndex < this.loaded.length - 1);
7
7
  canLoadPrevious = $derived(this.currentIndex > 0);
8
8
  navigationDisabled = $derived(!this.canLoadNext && !this.canLoadPrevious);
9
- animationDuration = 1200;
9
+ animationDuration = 300;
10
10
  _currentIndex = $state(-1);
11
11
  _loaded = $state.raw([]);
12
12
  loadMoreFn;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamscloud/embeddable",
3
- "version": "3.2.7",
3
+ "version": "3.3.0",
4
4
  "author": "StreamsCloud",
5
5
  "repository": "https://github.com/StreamsCloud/streamscloud-frontend-packages.git",
6
6
  "type": "module",