@wyxos/vibe 5.8.2 → 5.8.4

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/README.md CHANGED
@@ -99,6 +99,7 @@ const vibe = createVibe({
99
99
  height: 48,
100
100
  },
101
101
  mediaCard: {
102
+ feedPreload: 'visible-post',
102
103
  videoMuted: true,
103
104
  },
104
105
  })
@@ -121,6 +122,12 @@ active again. Set `mediaCard.videoMuted` to explicitly override the initial
121
122
  state in either layout. Users can still change mute and volume through the
122
123
  timed-media controls.
123
124
 
125
+ Set `mediaCard.feedPreload` to `'visible-post'` to warm every other preview in
126
+ a grouped masonry card after its visible media is ready. Only cards in the
127
+ exact viewport qualify: images are fetched at low priority and decoded, while
128
+ video or audio sources load metadata without preloading their full bodies.
129
+ The default is `'none'`, and reel loading is unchanged.
130
+
124
131
  Applications that need audio continuity can pass `initialReelAudioState` with
125
132
  `volume`, `muted`, and `lastAudibleVolume`, then persist user changes through
126
133
  `onReelAudioStateChange`. Every reel card in that Vibe instance shares the
@@ -8,6 +8,7 @@ type __VLS_Props = {
8
8
  cardHeader?: VibeCardRegion;
9
9
  entering: boolean;
10
10
  fetchPriority: 'high' | 'low';
11
+ inViewport?: boolean;
11
12
  index: number;
12
13
  item: VibeItem;
13
14
  itemStyle?: CSSProperties;
@@ -0,0 +1,11 @@
1
+ import type { VibeItem, VibeMediaAsset, VibeMediaCardOptions, VibeMediaSource } from '../types';
2
+ type __VLS_Props = {
3
+ item: VibeItem;
4
+ mediaCard?: VibeMediaCardOptions;
5
+ mediaIndex: number;
6
+ mediaItem: VibeMediaAsset;
7
+ mediaSource: VibeMediaSource;
8
+ };
9
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
10
+ declare const _default: typeof __VLS_export;
11
+ export default _default;
@@ -11,6 +11,6 @@ interface MediaLoadingOptions {
11
11
  export declare function useMediaLoading(options: MediaLoadingOptions): {
12
12
  imageLoading: import("vue").ComputedRef<"lazy" | "eager">;
13
13
  mediaIsTimed: import("vue").ComputedRef<boolean>;
14
- videoPreload: import("vue").ComputedRef<"metadata" | "auto" | "none">;
14
+ videoPreload: import("vue").ComputedRef<"none" | "metadata" | "auto">;
15
15
  };
16
16
  export {};
@@ -0,0 +1,12 @@
1
+ import type { VibeItem, VibeLayout, VibeMediaCardOptions, VibeMediaSource } from '../types';
2
+ interface VisiblePostPreloadOptions {
3
+ inViewport: () => boolean;
4
+ item: () => VibeItem;
5
+ layout: () => VibeLayout;
6
+ mediaCard: () => VibeMediaCardOptions | undefined;
7
+ mediaIndex: () => number;
8
+ mediaReady: () => boolean;
9
+ mediaSource: () => VibeMediaSource;
10
+ }
11
+ export declare function useVisiblePostPreload(options: VisiblePostPreloadOptions): void;
12
+ export {};
@@ -1,3 +1,4 @@
1
+ import type { Component } from 'vue';
1
2
  import type { VibeMediaError } from './mediaPreview';
2
3
  export interface VibeCardChromeStyle {
3
4
  background?: 'default' | 'transparent';
@@ -6,8 +7,12 @@ export interface VibeCardChromeStyle {
6
7
  }
7
8
  export interface VibeMediaCardOptions {
8
9
  error?: VibeMediaError;
10
+ feedPreload?: 'none' | 'visible-post';
9
11
  footer?: VibeCardChromeStyle;
10
12
  header?: VibeCardChromeStyle;
13
+ overlay?: {
14
+ component: Component;
15
+ };
11
16
  videoMuted?: boolean;
12
17
  }
13
18
  export interface VibeReelAudioState {
@@ -0,0 +1,22 @@
1
+ import type { VibeItem, VibeMediaSource } from '../types';
2
+ export declare const VISIBLE_POST_PRELOAD_CONCURRENCY = 6;
3
+ export declare const VISIBLE_POST_TIMED_PRELOAD_CONCURRENCY = 2;
4
+ export interface VisiblePostPreloadTarget {
5
+ key: string;
6
+ src: string;
7
+ timed: boolean;
8
+ }
9
+ type EntryState = 'queued' | 'loading' | 'ready' | 'failed';
10
+ export declare function visiblePostPreloadTargets(item: VibeItem, mediaIndex: number, mediaSource: VibeMediaSource): VisiblePostPreloadTarget[];
11
+ export declare function acquireVisiblePostPreload(target: VisiblePostPreloadTarget): () => void;
12
+ export declare function visiblePostPreloadSchedulerSnapshot(): {
13
+ active: number;
14
+ activeTimed: number;
15
+ entries: Array<{
16
+ key: string;
17
+ refs: number;
18
+ state: EntryState;
19
+ }>;
20
+ };
21
+ export declare function resetVisiblePostPreloadSchedulerForTests(): void;
22
+ export {};