@wyxos/vibe 5.8.1 → 5.8.3
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 +6 -4
- package/lib/components/MediaCard.vue.d.ts +1 -0
- package/lib/components/{useFeedReplacementPreload.d.ts → useVisiblePostPreload.d.ts} +3 -2
- package/lib/core/mediaCardOptions.d.ts +1 -1
- package/lib/core/visiblePostPreload.d.ts +22 -0
- package/lib/index.cjs +2 -1
- package/lib/index.js +384 -316
- package/package.json +1 -1
- package/lib/core/feedReplacementPreload.d.ts +0 -3
package/README.md
CHANGED
|
@@ -99,7 +99,7 @@ const vibe = createVibe({
|
|
|
99
99
|
height: 48,
|
|
100
100
|
},
|
|
101
101
|
mediaCard: {
|
|
102
|
-
feedPreload: '
|
|
102
|
+
feedPreload: 'visible-post',
|
|
103
103
|
videoMuted: true,
|
|
104
104
|
},
|
|
105
105
|
})
|
|
@@ -122,9 +122,11 @@ active again. Set `mediaCard.videoMuted` to explicitly override the initial
|
|
|
122
122
|
state in either layout. Users can still change mute and volume through the
|
|
123
123
|
timed-media controls.
|
|
124
124
|
|
|
125
|
-
Set `mediaCard.feedPreload` to `
|
|
126
|
-
|
|
127
|
-
|
|
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.
|
|
128
130
|
|
|
129
131
|
Applications that need audio continuity can pass `initialReelAudioState` with
|
|
130
132
|
`volume`, `muted`, and `lastAudibleVolume`, then persist user changes through
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { VibeItem, VibeLayout, VibeMediaCardOptions, VibeMediaSource } from '../types';
|
|
2
|
-
interface
|
|
2
|
+
interface VisiblePostPreloadOptions {
|
|
3
|
+
inViewport: () => boolean;
|
|
3
4
|
item: () => VibeItem;
|
|
4
5
|
layout: () => VibeLayout;
|
|
5
6
|
mediaCard: () => VibeMediaCardOptions | undefined;
|
|
@@ -7,5 +8,5 @@ interface FeedReplacementPreloadOptions {
|
|
|
7
8
|
mediaReady: () => boolean;
|
|
8
9
|
mediaSource: () => VibeMediaSource;
|
|
9
10
|
}
|
|
10
|
-
export declare function
|
|
11
|
+
export declare function useVisiblePostPreload(options: VisiblePostPreloadOptions): void;
|
|
11
12
|
export {};
|
|
@@ -6,7 +6,7 @@ export interface VibeCardChromeStyle {
|
|
|
6
6
|
}
|
|
7
7
|
export interface VibeMediaCardOptions {
|
|
8
8
|
error?: VibeMediaError;
|
|
9
|
-
feedPreload?: 'none' | '
|
|
9
|
+
feedPreload?: 'none' | 'visible-post';
|
|
10
10
|
footer?: VibeCardChromeStyle;
|
|
11
11
|
header?: VibeCardChromeStyle;
|
|
12
12
|
videoMuted?: boolean;
|
|
@@ -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 {};
|