@wyxos/vibe 5.7.1 → 5.8.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
@@ -121,6 +121,14 @@ active again. Set `mediaCard.videoMuted` to explicitly override the initial
121
121
  state in either layout. Users can still change mute and volume through the
122
122
  timed-media controls.
123
123
 
124
+ Applications that need audio continuity can pass `initialReelAudioState` with
125
+ `volume`, `muted`, and `lastAudibleVolume`, then persist user changes through
126
+ `onReelAudioStateChange`. Every reel card in that Vibe instance shares the
127
+ state. `getReelAudioState()` returns a snapshot and `setReelAudioState()` applies
128
+ an external update without invoking the callback, which lets applications sync
129
+ several Vibe instances without an echo loop. Masonry's forced mute behavior is
130
+ unchanged.
131
+
124
132
  Masonry virtualization keeps the existing 800px/1.5-viewport overscan by
125
133
  default. Consumers can opt into a capped window while retaining every loaded
126
134
  item and the same removal, restoration, reel, and pagination behavior:
@@ -6,16 +6,16 @@ declare const __VLS_export: import("vue").DefineComponent<MasonryFeedProps, {
6
6
  getScrollElement: typeof getScrollElement;
7
7
  loadIfNearBottom: typeof loadIfNearBottom;
8
8
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
9
- error: (postId: VibeItemId, mediaIndex: number) => any;
10
9
  ready: (postId: VibeItemId, mediaIndex: number) => any;
10
+ error: (postId: VibeItemId, mediaIndex: number) => any;
11
11
  loadMore: () => any;
12
12
  retryEnd: () => any;
13
13
  activate: (postId: VibeItemId, input: "keyboard" | "pointer") => any;
14
14
  mediaChange: (postId: VibeItemId, mediaIndex: number) => any;
15
15
  visible: (postId: VibeItemId, mediaIndex: number) => any;
16
16
  }, string, import("vue").PublicProps, Readonly<MasonryFeedProps> & Readonly<{
17
- onError?: ((postId: VibeItemId, mediaIndex: number) => any) | undefined;
18
17
  onReady?: ((postId: VibeItemId, mediaIndex: number) => any) | undefined;
18
+ onError?: ((postId: VibeItemId, mediaIndex: number) => any) | undefined;
19
19
  onLoadMore?: (() => any) | undefined;
20
20
  onRetryEnd?: (() => any) | undefined;
21
21
  onActivate?: ((postId: VibeItemId, input: "keyboard" | "pointer") => any) | undefined;
@@ -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,21 +20,24 @@ 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
  };
26
27
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
27
- error: (mediaIndex: number) => any;
28
28
  ready: (mediaIndex: number) => any;
29
+ error: (mediaIndex: number) => any;
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
- onError?: ((mediaIndex: number) => any) | undefined;
34
35
  onReady?: ((mediaIndex: number) => any) | undefined;
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;
@@ -0,0 +1,14 @@
1
+ import type { Component } from 'vue';
2
+ type __VLS_Props = {
3
+ component?: Component;
4
+ label: string;
5
+ retrying: boolean;
6
+ status: string;
7
+ };
8
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
9
+ retry: () => any;
10
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
11
+ onRetry?: (() => any) | undefined;
12
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
+ declare const _default: typeof __VLS_export;
14
+ 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;
@@ -16,19 +16,21 @@ declare const __VLS_export: import("vue").DefineComponent<ReelFeedProps, {
16
16
  transitionActiveMedia: typeof transitionActiveMedia;
17
17
  transitionActivePost: typeof transitionActivePost;
18
18
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
19
- error: (postId: VibeItemId, mediaIndex: number) => any;
20
19
  ready: (postId: VibeItemId, mediaIndex: number) => any;
20
+ error: (postId: VibeItemId, mediaIndex: number) => any;
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<{
27
- onError?: ((postId: VibeItemId, mediaIndex: number) => any) | undefined;
28
28
  onReady?: ((postId: VibeItemId, mediaIndex: number) => any) | undefined;
29
+ onError?: ((postId: VibeItemId, mediaIndex: number) => any) | undefined;
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;
@@ -14,20 +14,22 @@ declare const __VLS_export: import("vue").DefineComponent<ReelLayoutProps, {
14
14
  transitionActiveMedia: typeof transitionActiveMedia;
15
15
  transitionActivePost: typeof transitionActivePost;
16
16
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
17
- error: (postId: VibeItemId, mediaIndex: number) => any;
18
17
  ready: (postId: VibeItemId, mediaIndex: number) => any;
18
+ error: (postId: VibeItemId, mediaIndex: number) => any;
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;
25
26
  }, string, import("vue").PublicProps, Readonly<ReelLayoutProps> & Readonly<{
26
- onError?: ((postId: VibeItemId, mediaIndex: number) => any) | undefined;
27
27
  onReady?: ((postId: VibeItemId, mediaIndex: number) => any) | undefined;
28
+ onError?: ((postId: VibeItemId, mediaIndex: number) => any) | undefined;
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,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 {};
@@ -13,6 +13,7 @@ export declare function useMediaReadiness(options: MediaReadinessOptions): {
13
13
  markSourceReady: (event?: Event) => void;
14
14
  noteSourceActivity: (event: Event) => void;
15
15
  retrySource: () => void;
16
+ retrying: import("vue").ShallowRef<boolean, boolean>;
16
17
  sourceGeneration: import("vue").ShallowRef<number, number>;
17
18
  videoElement: import("vue").ShallowRef<HTMLVideoElement | null, HTMLVideoElement | null>;
18
19
  };
@@ -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,17 @@
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
+ footer?: VibeCardChromeStyle;
10
+ header?: VibeCardChromeStyle;
11
+ videoMuted?: boolean;
12
+ }
13
+ export interface VibeReelAudioState {
14
+ lastAudibleVolume: number;
15
+ muted: boolean;
16
+ volume: number;
17
+ }
@@ -1,3 +1,13 @@
1
+ import type { Component } from 'vue';
1
2
  export type MediaPreviewState = 'loading' | 'ready' | 'error';
3
+ export interface VibeMediaError {
4
+ component: Component;
5
+ }
6
+ export interface VibeMediaErrorProps {
7
+ label: string;
8
+ retry: () => void;
9
+ retrying: boolean;
10
+ status: string;
11
+ }
2
12
  export declare function mediaErrorStatus(src: string): string;
3
13
  export declare function mediaErrorLabel(src: string): string;
@@ -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
+ }