@wyxos/vibe 5.16.8 → 5.17.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.
package/README.md CHANGED
@@ -5,6 +5,8 @@ Vibe is an initializable Vue 3 media feed with virtualized masonry and reel layo
5
5
  Try the [live demo](https://vibe.wyxos.com/) to explore the feed and its controls.
6
6
  Read the [full documentation](./docs/index.md) for guided setup, layout and data-loading concepts, and the API reference.
7
7
 
8
+ For an existing host-owned player and large queue, use the [host-controlled reel](./docs/reference/controlled-reel.md) with a bounded previous/current/next projection and stable media slot.
9
+
8
10
  [![Vibe demo: scroll a masonry feed, open a card in the reel, and press Escape to return to the same scroll position.](https://raw.githubusercontent.com/wyxos/vibe/master/docs/assets/vibe-demo.gif)](https://vibe.wyxos.com/)
9
11
 
10
12
  The preview uses synthetic sample media. Open a masonry card to view it in a reel,
@@ -3,7 +3,7 @@ type __VLS_Props = {
3
3
  index: number;
4
4
  item: VibeItem;
5
5
  layout: VibeLayout;
6
- loadedCount: number | (() => number);
6
+ loadedCount: number;
7
7
  mediaIndex: number;
8
8
  mediaSource?: VibeMediaSource;
9
9
  placement: 'footer' | 'header';
@@ -16,7 +16,7 @@ type __VLS_Props = {
16
16
  interactive?: boolean;
17
17
  leaving?: boolean;
18
18
  layout: VibeLayout;
19
- loadedCount: number | (() => number);
19
+ loadedCount: number;
20
20
  mediaIndex: number;
21
21
  mediaCard?: VibeMediaCardOptions;
22
22
  mediaSource?: VibeMediaSource;
@@ -0,0 +1,24 @@
1
+ import type { VibeControlledReelDirection, VibeControlledReelProps, VibeControlledReelSlotProps } from '../core/controlledReel';
2
+ type __VLS_Slots = {
3
+ default(props: VibeControlledReelSlotProps): unknown;
4
+ previous?(props: VibeControlledReelSlotProps): unknown;
5
+ next?(props: VibeControlledReelSlotProps): unknown;
6
+ };
7
+ declare function navigate(direction: VibeControlledReelDirection): Promise<void>;
8
+ declare const __VLS_base: import("vue").DefineComponent<VibeControlledReelProps, {
9
+ navigate: typeof navigate;
10
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
11
+ navigationError: (error: unknown) => any;
12
+ }, string, import("vue").PublicProps, Readonly<VibeControlledReelProps> & Readonly<{
13
+ onNavigationError?: ((error: unknown) => any) | undefined;
14
+ }>, {
15
+ label: string;
16
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
17
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
18
+ declare const _default: typeof __VLS_export;
19
+ export default _default;
20
+ type __VLS_WithSlots<T, S> = T & {
21
+ new (): {
22
+ $slots: S;
23
+ };
24
+ };
@@ -0,0 +1,4 @@
1
+ type PlaybackAction = 'load-requested' | 'play-requested' | 'play-resolved' | 'play-rejected';
2
+ /** Numeric/media evidence belongs to the consumer; this event exposes fixed lifecycle categories only. */
3
+ export declare function emitMediaPlaybackDiagnostic(media: HTMLMediaElement, action: PlaybackAction, error?: unknown): void;
4
+ export {};
@@ -17,9 +17,9 @@ export declare function useMediaLifecycle(state: VibeRuntimeState, events: Media
17
17
  markPreviewReady: (postId: VibeItemId, mediaIndex: number) => void;
18
18
  markReelError: (postId: VibeItemId, mediaIndex: number) => void;
19
19
  markReelReady: (postId: VibeItemId, mediaIndex: number) => void;
20
- originalStates: import("vue").ShallowRef<import("vue").ShallowReactive<Map<string, MediaPreviewState>>, import("vue").ShallowReactive<Map<string, MediaPreviewState>>>;
21
- previewStates: import("vue").ShallowRef<import("vue").ShallowReactive<Map<string, MediaPreviewState>>, import("vue").ShallowReactive<Map<string, MediaPreviewState>>>;
22
- reelStates: import("vue").ComputedRef<import("vue").ShallowReactive<Map<string, MediaPreviewState>>>;
20
+ originalStates: import("vue").ShallowRef<ReadonlyMap<string, MediaPreviewState>, ReadonlyMap<string, MediaPreviewState>>;
21
+ previewStates: import("vue").ShallowRef<ReadonlyMap<string, MediaPreviewState>, ReadonlyMap<string, MediaPreviewState>>;
22
+ reelStates: import("vue").ComputedRef<ReadonlyMap<string, MediaPreviewState>>;
23
23
  resetMediaLifecycle: () => void;
24
24
  };
25
25
  export {};
@@ -7,6 +7,7 @@ interface MediaLoadingOptions {
7
7
  mediaSource: () => string;
8
8
  mediaType: () => VibeMediaType | undefined;
9
9
  mediaElement: ShallowRef<HTMLMediaElement | null>;
10
+ playbackAllowed: () => boolean;
10
11
  }
11
12
  export declare function useMediaLoading(options: MediaLoadingOptions): {
12
13
  imageLoading: import("vue").ComputedRef<"lazy" | "eager">;
@@ -0,0 +1,41 @@
1
+ import type { VibeItemId } from '../types';
2
+ export type VibeControlledReelDirection = 'next' | 'previous';
3
+ export interface VibeControlledReelItem {
4
+ id: VibeItemId;
5
+ artwork?: string;
6
+ label?: string;
7
+ }
8
+ /** A bounded projection of a host-owned queue. No full queue is required. */
9
+ export interface VibeControlledReelState {
10
+ /** Change whenever source, order, membership or selection invalidates navigation. */
11
+ revision: string | number;
12
+ current: VibeControlledReelItem | null;
13
+ previous?: VibeControlledReelItem | null;
14
+ next?: VibeControlledReelItem | null;
15
+ canPrevious: boolean;
16
+ canNext: boolean;
17
+ /** Zero-based position, when known. */
18
+ position?: number;
19
+ total?: number;
20
+ }
21
+ export interface VibeControlledReelRequest {
22
+ direction: VibeControlledReelDirection;
23
+ snapshot: Readonly<VibeControlledReelState>;
24
+ signal: AbortSignal;
25
+ }
26
+ export interface VibeControlledReelProps {
27
+ state: VibeControlledReelState;
28
+ /** Commit through the host queue, then push state. false declines the intent. */
29
+ onNavigate: (request: VibeControlledReelRequest) => boolean | void | Promise<boolean | void>;
30
+ label?: string;
31
+ }
32
+ export interface VibeControlledReelSlotProps {
33
+ item: VibeControlledReelItem | null;
34
+ pending: boolean;
35
+ }
36
+ export interface VibeControlledReelExpose {
37
+ /** The pushed host state, rather than this promise, acknowledges selection. */
38
+ navigate: (direction: VibeControlledReelDirection) => Promise<void>;
39
+ }
40
+ /** Settle on abort even if an obsolete host callback ignores its signal. */
41
+ export declare function waitForControlledReelNavigation(navigate: VibeControlledReelProps['onNavigate'], context: VibeControlledReelRequest): Promise<boolean | void>;
@@ -21,7 +21,6 @@ interface CollectFrontendFillOptions {
21
21
  initialCursor: VibeCursor;
22
22
  loadPage: VibePageLoader;
23
23
  onCollection?: (collection: FrontendFillCollection) => void;
24
- onPage?: (collection: FrontendFillCollection) => void;
25
24
  onDelayChange: (snapshot: RequestDelaySnapshot) => void;
26
25
  onProgress: (progress: FrontendFillProgress) => void;
27
26
  options: VibeFrontendFillOptions;
@@ -33,5 +32,5 @@ export declare function validateFillTarget(target: VibeFillTarget): VibeFillTarg
33
32
  export declare function validateFillOptions(options?: VibeFillOptions): void;
34
33
  export declare function createFillState(options?: VibeFillOptions, initialSession?: VibeFillSessionSnapshot, useConfiguredSession?: boolean): VibeFillState;
35
34
  export declare function isFillActive(state: VibeFillState): boolean;
36
- export declare function collectFrontendFill({ existingItems, getLoadedItemCount, initialCursor, loadPage, onCollection, onPage, onDelayChange, onProgress, options, shouldPause, signal, target, }: CollectFrontendFillOptions): Promise<FrontendFillResult>;
35
+ export declare function collectFrontendFill({ existingItems, getLoadedItemCount, initialCursor, loadPage, onCollection, onDelayChange, onProgress, options, shouldPause, signal, target, }: CollectFrontendFillOptions): Promise<FrontendFillResult>;
37
36
  export {};
@@ -7,7 +7,5 @@ export interface LoadedPageRecord {
7
7
  }
8
8
  export declare function validatePage(page: VibePage): VibePage;
9
9
  export declare function appendUniqueItems(current: readonly VibeItem[], incoming: readonly VibeItem[]): VibeItem[];
10
- export declare function takeUniqueItems(postIds: Set<VibeItemId>, incoming: readonly VibeItem[]): VibeItem[];
11
- export declare function appendUniqueItemsIfChanged(current: VibeItem[], incoming: readonly VibeItem[]): VibeItem[];
12
10
  export declare function reconcilePageItems(current: readonly VibeItem[], incoming: readonly VibeItem[]): VibeItem[];
13
11
  export declare function pageCurrentCursor(page: VibePage): VibeCursor;
@@ -1 +1,2 @@
1
- export declare function transitionReelScroll(element: HTMLElement, top: number, immediate: boolean): Promise<void>;
1
+ export declare function prefersReducedReelMotion(): boolean;
2
+ export declare function transitionReelScroll(element: HTMLElement, top: number, immediate: boolean, signal?: AbortSignal): Promise<void>;
@@ -0,0 +1,2 @@
1
+ /** Shared native scroll-snap selection rule for feed and controlled reels. */
2
+ export declare function reelIndexAtScrollOffset(top: number, height: number, count: number): number;