@wyxos/vibe 5.8.2 → 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 +7 -0
- package/lib/components/MediaCard.vue.d.ts +1 -0
- package/lib/components/useMediaLoading.d.ts +1 -1
- package/lib/components/useVisiblePostPreload.d.ts +12 -0
- package/lib/core/mediaCardOptions.d.ts +1 -0
- package/lib/core/visiblePostPreload.d.ts +22 -0
- package/lib/index.cjs +2 -1
- package/lib/index.js +415 -305
- package/package.json +1 -1
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
|
|
@@ -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<"
|
|
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 {};
|
|
@@ -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 {};
|