@wyxos/vibe 5.7.2 → 5.8.1

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: 'replacement',
102
103
  videoMuted: true,
103
104
  },
104
105
  })
@@ -121,6 +122,18 @@ 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 `replacement` to warm the exact preview source
126
+ that a grouped masonry card will show after its current media item is removed.
127
+ The default is `none`, so consumers opt in to the additional request.
128
+
129
+ Applications that need audio continuity can pass `initialReelAudioState` with
130
+ `volume`, `muted`, and `lastAudibleVolume`, then persist user changes through
131
+ `onReelAudioStateChange`. Every reel card in that Vibe instance shares the
132
+ state. `getReelAudioState()` returns a snapshot and `setReelAudioState()` applies
133
+ an external update without invoking the callback, which lets applications sync
134
+ several Vibe instances without an echo loop. Masonry's forced mute behavior is
135
+ unchanged.
136
+
124
137
  Masonry virtualization keeps the existing 800px/1.5-viewport overscan by
125
138
  default. Consumers can opt into a capped window while retaining every loaded
126
139
  item and the same removal, restoration, reel, and pagination behavior:
@@ -1,6 +1,6 @@
1
1
  import { type CSSProperties } from 'vue';
2
2
  import { type MediaPreviewState } from '../core/mediaPreview';
3
- import type { VibeCardRegion, VibeItem, VibeLayout, VibeMediaSource, VibeMediaCardOptions } from '../types';
3
+ import type { VibeCardRegion, VibeItem, VibeLayout, VibeMediaSource, VibeMediaCardOptions, VibeReelAudioState } from '../types';
4
4
  type __VLS_Props = {
5
5
  active?: boolean;
6
6
  advanceOnMediaEnd?: boolean;
@@ -20,6 +20,7 @@ type __VLS_Props = {
20
20
  mediaSource?: VibeMediaSource;
21
21
  previewState: MediaPreviewState;
22
22
  reelControlsTarget?: HTMLElement | null;
23
+ reelAudioState?: VibeReelAudioState;
23
24
  stationaryReelControls?: boolean;
24
25
  total: number | null;
25
26
  };
@@ -29,12 +30,14 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
29
30
  ended: (mediaIndex: number) => any;
30
31
  activate: (input: "keyboard" | "pointer") => any;
31
32
  mediaChange: (mediaIndex: number) => any;
33
+ reelAudioChange: (state: VibeReelAudioState) => any;
32
34
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
33
35
  onReady?: ((mediaIndex: number) => any) | undefined;
34
36
  onError?: ((mediaIndex: number) => any) | undefined;
35
37
  onEnded?: ((mediaIndex: number) => any) | undefined;
36
38
  onActivate?: ((input: "keyboard" | "pointer") => any) | undefined;
37
39
  onMediaChange?: ((mediaIndex: number) => any) | undefined;
40
+ onReelAudioChange?: ((state: VibeReelAudioState) => any) | undefined;
38
41
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
39
42
  declare const _default: typeof __VLS_export;
40
43
  export default _default;
@@ -1,5 +1,5 @@
1
- import type { ReelFeedProps } from '../core/feed';
2
- import type { VibeItemId } from '../types';
1
+ import { type ReelFeedProps } from '../core/feed';
2
+ import type { VibeItemId, VibeReelAudioState } from '../types';
3
3
  declare function loadIfNearBottom(): void;
4
4
  declare function changeActiveMedia(direction: -1 | 1): boolean;
5
5
  declare function moveActivePost(direction: -1 | 1): boolean;
@@ -21,6 +21,7 @@ declare const __VLS_export: import("vue").DefineComponent<ReelFeedProps, {
21
21
  loadMore: () => any;
22
22
  retryEnd: () => any;
23
23
  mediaChange: (postId: VibeItemId, mediaIndex: number) => any;
24
+ reelAudioChange: (state: VibeReelAudioState) => any;
24
25
  activeChange: (postId: VibeItemId) => any;
25
26
  retryForward: () => any;
26
27
  }, string, import("vue").PublicProps, Readonly<ReelFeedProps> & Readonly<{
@@ -29,6 +30,7 @@ declare const __VLS_export: import("vue").DefineComponent<ReelFeedProps, {
29
30
  onLoadMore?: (() => any) | undefined;
30
31
  onRetryEnd?: (() => any) | undefined;
31
32
  onMediaChange?: ((postId: VibeItemId, mediaIndex: number) => any) | undefined;
33
+ onReelAudioChange?: ((state: VibeReelAudioState) => any) | undefined;
32
34
  onActiveChange?: ((postId: VibeItemId) => any) | undefined;
33
35
  onRetryForward?: (() => any) | undefined;
34
36
  }>, {
@@ -1,5 +1,5 @@
1
1
  import type { ReelLayoutProps } from '../core/feed';
2
- import type { VibeItemId } from '../types';
2
+ import type { VibeItemId, VibeReelAudioState } from '../types';
3
3
  declare function changeActiveMedia(direction: -1 | 1): boolean;
4
4
  declare function loadIfNearBottom(): void;
5
5
  declare function moveActivePost(direction: -1 | 1): boolean;
@@ -19,6 +19,7 @@ declare const __VLS_export: import("vue").DefineComponent<ReelLayoutProps, {
19
19
  loadMore: () => any;
20
20
  retryEnd: () => any;
21
21
  mediaChange: (postId: VibeItemId, mediaIndex: number) => any;
22
+ reelAudioChange: (state: VibeReelAudioState) => any;
22
23
  activeChange: (postId: VibeItemId) => any;
23
24
  retryForward: () => any;
24
25
  closeInfoSheet: () => any;
@@ -28,6 +29,7 @@ declare const __VLS_export: import("vue").DefineComponent<ReelLayoutProps, {
28
29
  onLoadMore?: (() => any) | undefined;
29
30
  onRetryEnd?: (() => any) | undefined;
30
31
  onMediaChange?: ((postId: VibeItemId, mediaIndex: number) => any) | undefined;
32
+ onReelAudioChange?: ((state: VibeReelAudioState) => any) | undefined;
31
33
  onActiveChange?: ((postId: VibeItemId) => any) | undefined;
32
34
  onRetryForward?: (() => any) | undefined;
33
35
  onCloseInfoSheet?: (() => any) | undefined;
@@ -1,6 +1,6 @@
1
1
  import type { VibeMasonryOptions } from '../core/masonryOptions';
2
2
  import { type VibeRuntimeState } from '../core/runtime';
3
- import type { VibeCardRegion, VibeFeedFooter, VibeFeedFooterActions, VibeItemId, VibeMediaCardOptions, VibeMediaLifecycleContext, VibeReelInfoSheetOptions, VibeReelItemTarget, VibeReelNavigationResult } from '../types';
3
+ import type { VibeCardRegion, VibeFeedFooter, VibeFeedFooterActions, VibeItemId, VibeMediaCardOptions, VibeMediaLifecycleContext, VibeReelInfoSheetOptions, VibeReelAudioState, VibeReelItemTarget, VibeReelNavigationResult } from '../types';
4
4
  import type { VibeItemRemovalOptions } from '../core/itemRemovalOptions';
5
5
  type __VLS_Props = {
6
6
  canRetryEnd: boolean;
@@ -11,6 +11,7 @@ type __VLS_Props = {
11
11
  mediaCard?: VibeMediaCardOptions;
12
12
  masonry?: VibeMasonryOptions;
13
13
  reelInfoSheet?: VibeReelInfoSheetOptions;
14
+ reelAudioState: VibeReelAudioState;
14
15
  state: VibeRuntimeState;
15
16
  };
16
17
  declare function loadIfNearBottom(): Promise<void>;
@@ -31,6 +32,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
31
32
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
32
33
  loadMore: () => any;
33
34
  retryEnd: () => any;
35
+ reelAudioChange: (state: VibeReelAudioState) => any;
34
36
  retryForward: () => any;
35
37
  activeReelChange: (postId: VibeItemId) => any;
36
38
  closeReel: () => any;
@@ -42,6 +44,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
42
44
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
43
45
  onLoadMore?: (() => any) | undefined;
44
46
  onRetryEnd?: (() => any) | undefined;
47
+ onReelAudioChange?: ((state: VibeReelAudioState) => any) | undefined;
45
48
  onRetryForward?: (() => any) | undefined;
46
49
  onActiveReelChange?: ((postId: VibeItemId) => any) | undefined;
47
50
  onCloseReel?: (() => any) | undefined;
@@ -0,0 +1,11 @@
1
+ import type { VibeItem, VibeLayout, VibeMediaCardOptions, VibeMediaSource } from '../types';
2
+ interface FeedReplacementPreloadOptions {
3
+ item: () => VibeItem;
4
+ layout: () => VibeLayout;
5
+ mediaCard: () => VibeMediaCardOptions | undefined;
6
+ mediaIndex: () => number;
7
+ mediaReady: () => boolean;
8
+ mediaSource: () => VibeMediaSource;
9
+ }
10
+ export declare function useFeedReplacementPreload(options: FeedReplacementPreloadOptions): void;
11
+ export {};
@@ -0,0 +1,19 @@
1
+ import { type Ref } from 'vue';
2
+ import type { VibeLayout, VibeMediaCardOptions, VibeReelAudioState } from '../types';
3
+ interface MediaCardAudioOptions {
4
+ active: () => boolean | undefined;
5
+ layout: () => VibeLayout;
6
+ mediaCard: () => VibeMediaCardOptions | undefined;
7
+ onChange: (state: VibeReelAudioState) => void;
8
+ reelAudioState: () => VibeReelAudioState | undefined;
9
+ videoElement: Ref<HTMLVideoElement | null>;
10
+ }
11
+ export declare function useMediaCardAudio(options: MediaCardAudioOptions): {
12
+ apply: () => void;
13
+ setVolume: (volume: number) => void;
14
+ sync: (video: HTMLVideoElement, syncMuted: boolean) => void;
15
+ toggleMute: () => void;
16
+ videoIsMuted: import("vue").ShallowRef<boolean, boolean>;
17
+ videoVolume: import("vue").ShallowRef<number, number>;
18
+ };
19
+ export {};
@@ -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 {};
@@ -1,4 +1,4 @@
1
- import type { VibeCardRegion, VibeFeedFooter, VibeFeedFooterActions, VibeItem, VibeItemId, VibeMediaSource, VibeMediaCardOptions, VibeReelAutoAdvanceState, VibeReelForwardState, VibeReelInfoSheetOptions, VibeReelItemTarget, VibeReelNavigationResult, VibeReelOrigin, VibeState } from '../types';
1
+ import type { VibeCardRegion, VibeFeedFooter, VibeFeedFooterActions, VibeItem, VibeItemId, VibeMediaSource, VibeMediaCardOptions, VibeReelAutoAdvanceState, VibeReelAudioState, VibeReelForwardState, VibeReelInfoSheetOptions, VibeReelItemTarget, VibeReelNavigationResult, VibeReelOrigin, VibeState } from '../types';
2
2
  import type { VibeItemRemovalOptions } from './itemRemovalOptions';
3
3
  import type { VibeMasonryOptions } from './masonryOptions';
4
4
  import type { MediaPreviewState } from './mediaPreview';
@@ -17,6 +17,7 @@ export interface FeedRendererProps {
17
17
  mediaIndices: ReadonlyMap<VibeItemId, number>;
18
18
  nextPageError: boolean;
19
19
  previewStates: ReadonlyMap<string, MediaPreviewState>;
20
+ reelAudioState?: VibeReelAudioState;
20
21
  state?: VibeState;
21
22
  total: number | null;
22
23
  }
@@ -0,0 +1,3 @@
1
+ import type { VibeItem, VibeMediaSource, VibeMediaVariant } from '../types';
2
+ export declare function replacementFeedVariant(item: VibeItem, mediaIndex: number, mediaSource: VibeMediaSource): VibeMediaVariant | null;
3
+ export declare function preloadFeedVariant(variant: VibeMediaVariant): () => void;
@@ -0,0 +1,18 @@
1
+ import type { VibeMediaError } from './mediaPreview';
2
+ export interface VibeCardChromeStyle {
3
+ background?: 'default' | 'transparent';
4
+ paddingX?: number;
5
+ paddingY?: number;
6
+ }
7
+ export interface VibeMediaCardOptions {
8
+ error?: VibeMediaError;
9
+ feedPreload?: 'none' | 'replacement';
10
+ footer?: VibeCardChromeStyle;
11
+ header?: VibeCardChromeStyle;
12
+ videoMuted?: boolean;
13
+ }
14
+ export interface VibeReelAudioState {
15
+ lastAudibleVolume: number;
16
+ muted: boolean;
17
+ volume: number;
18
+ }
@@ -0,0 +1,3 @@
1
+ import type { VibeReelAudioState } from '../types';
2
+ export declare const DEFAULT_REEL_AUDIO_STATE: VibeReelAudioState;
3
+ export declare function normalizeReelAudioState(state: Partial<VibeReelAudioState> | null | undefined, fallback?: VibeReelAudioState): VibeReelAudioState;
@@ -0,0 +1,8 @@
1
+ import type { CreateVibeOptions, VibeReelAudioState } from '../types';
2
+ export declare class VibeReelAudioController {
3
+ private readonly options;
4
+ readonly state: VibeReelAudioState;
5
+ constructor(options: CreateVibeOptions);
6
+ get(): VibeReelAudioState;
7
+ set(state: VibeReelAudioState, notify?: boolean): void;
8
+ }