@wyxos/vibe 5.13.4 → 5.15.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.
@@ -1,3 +1,4 @@
1
+ import type { MediaFailure } from '../core/mediaFailure';
1
2
  import type { MasonryFeedProps } from '../core/feed';
2
3
  import type { VibeItemId } from '../types';
3
4
  declare function loadIfNearBottom(): void;
@@ -11,6 +12,7 @@ declare const __VLS_export: import("vue").DefineComponent<MasonryFeedProps, {
11
12
  loadMore: () => any;
12
13
  retryEnd: () => any;
13
14
  activate: (postId: VibeItemId, input: "keyboard" | "pointer") => any;
15
+ mediaError: (postId: VibeItemId, failure: MediaFailure) => any;
14
16
  mediaChange: (postId: VibeItemId, mediaIndex: number) => any;
15
17
  fullyVisible: (postId: VibeItemId, mediaIndex: number) => any;
16
18
  visible: (postId: VibeItemId, mediaIndex: number) => any;
@@ -20,6 +22,7 @@ declare const __VLS_export: import("vue").DefineComponent<MasonryFeedProps, {
20
22
  onLoadMore?: (() => any) | undefined;
21
23
  onRetryEnd?: (() => any) | undefined;
22
24
  onActivate?: ((postId: VibeItemId, input: "keyboard" | "pointer") => any) | undefined;
25
+ onMediaError?: ((postId: VibeItemId, failure: MediaFailure) => any) | undefined;
23
26
  onMediaChange?: ((postId: VibeItemId, mediaIndex: number) => any) | undefined;
24
27
  onFullyVisible?: ((postId: VibeItemId, mediaIndex: number) => any) | undefined;
25
28
  onVisible?: ((postId: VibeItemId, mediaIndex: number) => any) | undefined;
@@ -1,3 +1,4 @@
1
+ import type { MediaFailure } from '../core/mediaFailure';
1
2
  import { type CSSProperties } from 'vue';
2
3
  import { type MediaPreviewState } from '../core/mediaPreview';
3
4
  import type { VibeCardRegion, VibeItem, VibeLayout, VibeMediaSource, VibeMediaCardOptions, VibeReelAudioState } from '../types';
@@ -30,6 +31,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
30
31
  error: (mediaIndex: number) => any;
31
32
  ended: (mediaIndex: number) => any;
32
33
  activate: (input: "keyboard" | "pointer") => any;
34
+ mediaError: (failure: MediaFailure) => any;
33
35
  mediaChange: (mediaIndex: number) => any;
34
36
  reelAudioChange: (state: VibeReelAudioState) => any;
35
37
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
@@ -37,6 +39,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
37
39
  onError?: ((mediaIndex: number) => any) | undefined;
38
40
  onEnded?: ((mediaIndex: number) => any) | undefined;
39
41
  onActivate?: ((input: "keyboard" | "pointer") => any) | undefined;
42
+ onMediaError?: ((failure: MediaFailure) => any) | undefined;
40
43
  onMediaChange?: ((mediaIndex: number) => any) | undefined;
41
44
  onReelAudioChange?: ((state: VibeReelAudioState) => any) | undefined;
42
45
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -1,3 +1,4 @@
1
+ import type { MediaFailure } from '../core/mediaFailure';
1
2
  import { type ReelFeedProps } from '../core/feed';
2
3
  import type { VibeItemId, VibeReelAudioState } from '../types';
3
4
  declare function loadIfNearBottom(): void;
@@ -20,6 +21,7 @@ declare const __VLS_export: import("vue").DefineComponent<ReelFeedProps, {
20
21
  error: (postId: VibeItemId, mediaIndex: number) => any;
21
22
  loadMore: () => any;
22
23
  retryEnd: () => any;
24
+ mediaError: (postId: VibeItemId, failure: MediaFailure) => any;
23
25
  mediaChange: (postId: VibeItemId, mediaIndex: number) => any;
24
26
  reelAudioChange: (state: VibeReelAudioState) => any;
25
27
  activeChange: (postId: VibeItemId) => any;
@@ -29,6 +31,7 @@ declare const __VLS_export: import("vue").DefineComponent<ReelFeedProps, {
29
31
  onError?: ((postId: VibeItemId, mediaIndex: number) => any) | undefined;
30
32
  onLoadMore?: (() => any) | undefined;
31
33
  onRetryEnd?: (() => any) | undefined;
34
+ onMediaError?: ((postId: VibeItemId, failure: MediaFailure) => any) | undefined;
32
35
  onMediaChange?: ((postId: VibeItemId, mediaIndex: number) => any) | undefined;
33
36
  onReelAudioChange?: ((state: VibeReelAudioState) => any) | undefined;
34
37
  onActiveChange?: ((postId: VibeItemId) => any) | undefined;
@@ -1,3 +1,4 @@
1
+ import type { MediaFailure } from '../core/mediaFailure';
1
2
  import type { ReelLayoutProps } from '../core/feed';
2
3
  import type { VibeItemId, VibeReelAudioState } from '../types';
3
4
  declare function changeActiveMedia(direction: -1 | 1): boolean;
@@ -18,6 +19,7 @@ declare const __VLS_export: import("vue").DefineComponent<ReelLayoutProps, {
18
19
  error: (postId: VibeItemId, mediaIndex: number) => any;
19
20
  loadMore: () => any;
20
21
  retryEnd: () => any;
22
+ mediaError: (postId: VibeItemId, failure: MediaFailure) => any;
21
23
  mediaChange: (postId: VibeItemId, mediaIndex: number) => any;
22
24
  reelAudioChange: (state: VibeReelAudioState) => any;
23
25
  activeChange: (postId: VibeItemId) => any;
@@ -28,6 +30,7 @@ declare const __VLS_export: import("vue").DefineComponent<ReelLayoutProps, {
28
30
  onError?: ((postId: VibeItemId, mediaIndex: number) => any) | undefined;
29
31
  onLoadMore?: (() => any) | undefined;
30
32
  onRetryEnd?: (() => any) | undefined;
33
+ onMediaError?: ((postId: VibeItemId, failure: MediaFailure) => any) | undefined;
31
34
  onMediaChange?: ((postId: VibeItemId, mediaIndex: number) => any) | undefined;
32
35
  onReelAudioChange?: ((state: VibeReelAudioState) => any) | undefined;
33
36
  onActiveChange?: ((postId: VibeItemId) => 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, VibeReelAudioState, VibeReelItemTarget, VibeReelNavigationResult } from '../types';
3
+ import type { VibeCardRegion, VibeFeedFooter, VibeFeedFooterActions, VibeItemId, VibeMediaCardOptions, VibeMediaErrorContext, VibeMediaLifecycleContext, VibeReelInfoSheetOptions, VibeReelAudioState, VibeReelItemTarget, VibeReelNavigationResult } from '../types';
4
4
  import type { VibeItemRemovalOptions } from '../core/itemRemovalOptions';
5
5
  type __VLS_Props = {
6
6
  canRetryEnd: boolean;
@@ -20,7 +20,11 @@ declare function moveActiveReelPost(direction: -1 | 1): boolean;
20
20
  declare function navigateToReelItem(target: VibeReelItemTarget): VibeReelNavigationResult;
21
21
  declare function getAutoScrollElement(): HTMLElement | null;
22
22
  declare function startItemRemoval(postIds: readonly VibeItemId[], options?: VibeItemRemovalOptions): number;
23
+ declare function cancelItemRemoval(): void;
24
+ declare function animateItemRemoval(postIds: readonly VibeItemId[], signal: AbortSignal): Promise<void>;
23
25
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
26
+ animateItemRemoval: typeof animateItemRemoval;
27
+ cancelItemRemoval: typeof cancelItemRemoval;
24
28
  changeActiveReelMedia: typeof changeActiveReelMedia;
25
29
  getAutoScrollElement: typeof getAutoScrollElement;
26
30
  loadIfNearBottom: typeof loadIfNearBottom;
@@ -33,6 +37,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
33
37
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
34
38
  loadMore: () => any;
35
39
  retryEnd: () => any;
40
+ mediaError: (context: VibeMediaErrorContext) => any;
36
41
  reelAudioChange: (state: VibeReelAudioState) => any;
37
42
  retryForward: () => any;
38
43
  activeReelChange: (postId: VibeItemId) => any;
@@ -46,6 +51,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
46
51
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
47
52
  onLoadMore?: (() => any) | undefined;
48
53
  onRetryEnd?: (() => any) | undefined;
54
+ onMediaError?: ((context: VibeMediaErrorContext) => any) | undefined;
49
55
  onReelAudioChange?: ((state: VibeReelAudioState) => any) | undefined;
50
56
  onRetryForward?: (() => any) | undefined;
51
57
  onActiveReelChange?: ((postId: VibeItemId) => any) | undefined;
@@ -1,13 +1,16 @@
1
+ import type { MediaFailure } from '../core/mediaFailure';
1
2
  import type { MediaPreviewState } from '../core/mediaPreview';
2
3
  import type { VibeRuntimeState } from '../core/runtime';
3
- import type { VibeItemId, VibeMediaLifecycleContext } from '../types';
4
+ import type { VibeItemId, VibeLayout, VibeMediaErrorContext, VibeMediaLifecycleContext } from '../types';
4
5
  interface MediaLifecycleEvents {
6
+ error: (context: VibeMediaErrorContext) => void;
5
7
  fullyVisible: (context: VibeMediaLifecycleContext) => void;
6
8
  ready: (context: VibeMediaLifecycleContext) => void;
7
9
  reelChange: (context: VibeMediaLifecycleContext) => void;
8
10
  visible: (context: VibeMediaLifecycleContext) => void;
9
11
  }
10
12
  export declare function useMediaLifecycle(state: VibeRuntimeState, events: MediaLifecycleEvents): {
13
+ markMediaError: (postId: VibeItemId, failure: MediaFailure, layout: VibeLayout) => void;
11
14
  markMasonryFullyVisible: (postId: VibeItemId, mediaIndex: number) => void;
12
15
  markMasonryVisible: (postId: VibeItemId, mediaIndex: number) => void;
13
16
  markPreviewError: (postId: VibeItemId, mediaIndex: number) => void;
@@ -2,13 +2,13 @@ import type { MediaPreviewState } from '../core/mediaPreview';
2
2
  interface MediaReadinessOptions {
3
3
  identity: () => string;
4
4
  mediaIndex: () => number;
5
- onError: (mediaIndex: number) => void;
5
+ onError: (mediaIndex: number, confirmedFailure: boolean) => void;
6
6
  onReady: (mediaIndex: number) => void;
7
7
  previewState: () => MediaPreviewState;
8
8
  }
9
9
  export declare function useMediaReadiness(options: MediaReadinessOptions): {
10
10
  effectivePreviewState: import("vue").ComputedRef<MediaPreviewState>;
11
- failSourceAttempt: (event?: Event) => void;
11
+ failSourceAttempt: (event?: Event, confirmedFailure?: boolean) => void;
12
12
  imageElement: import("vue").ShallowRef<HTMLImageElement | null, HTMLImageElement | null>;
13
13
  markSourceReady: (event?: Event) => void;
14
14
  noteSourceActivity: (event: Event) => void;
@@ -53,6 +53,8 @@ export interface ReelLayoutProps extends ReelFeedProps {
53
53
  origin: VibeReelOrigin;
54
54
  }
55
55
  export interface VibeSurfaceExpose {
56
+ animateItemRemoval: (postIds: readonly VibeItemId[], signal: AbortSignal) => Promise<void>;
57
+ cancelItemRemoval: () => void;
56
58
  changeActiveReelMedia: (direction: -1 | 1) => boolean;
57
59
  getAutoScrollElement: () => HTMLElement | null;
58
60
  loadIfNearBottom: () => Promise<void>;
@@ -0,0 +1,10 @@
1
+ import type { VibeRuntimeState } from './runtime';
2
+ interface LoadingLockActions {
3
+ getPending: () => Promise<void> | null;
4
+ hasPendingSession: () => boolean;
5
+ loadIfNearBottom: () => Promise<void> | undefined;
6
+ loadNext: () => Promise<void>;
7
+ resumeFill: () => Promise<void>;
8
+ }
9
+ export declare function setLoadingLock(state: VibeRuntimeState, locked: boolean, actions: LoadingLockActions): void;
10
+ export {};
@@ -0,0 +1,6 @@
1
+ import type { VibeMediaLifecycleContext, VibeMediaSource } from '../types';
2
+ export interface VibeMediaErrorContext extends VibeMediaLifecycleContext {
3
+ source: VibeMediaSource;
4
+ src: string;
5
+ }
6
+ export type MediaFailure = Pick<VibeMediaErrorContext, 'mediaIndex' | 'source' | 'src'>;
@@ -0,0 +1,22 @@
1
+ import type { VibeSurfaceExpose } from './feed';
2
+ import type { VibeRuntimeState } from './runtime';
3
+ import type { VibePage } from '../types';
4
+ export interface VibePageReplacementOptions {
5
+ /** Scroll masonry to its beginning after the outgoing cards leave. */
6
+ resetScroll?: boolean;
7
+ }
8
+ interface PageReplacementOptions {
9
+ commit: (page: VibePage) => void;
10
+ prepare: () => Promise<void>;
11
+ state: VibeRuntimeState;
12
+ surface: () => VibeSurfaceExpose | null;
13
+ }
14
+ export declare class PageReplacementController {
15
+ private readonly options;
16
+ private controller;
17
+ constructor(options: PageReplacementOptions);
18
+ isActive(): boolean;
19
+ cancel(): void;
20
+ replace(pageValue: VibePage, options?: VibePageReplacementOptions): Promise<void>;
21
+ }
22
+ export {};
@@ -1,4 +1,4 @@
1
- import { type ComputedRef } from 'vue';
1
+ import { type ComputedRef, type WatchHandle } from 'vue';
2
2
  import type { VibeAutoScrollState, VibeAutofillState, VibeCursor, VibeFillState, VibeItem, VibeItemId, VibeLayout, VibeMediaSource, VibeReelAutoAdvanceState, VibeReelForwardState, VibeReelInfoSheetState, VibeState } from '../types';
3
3
  export interface VibeRuntimeState {
4
4
  activeReelPostId: VibeItemId | null;
@@ -28,4 +28,5 @@ export interface VibeRuntimeState {
28
28
  total: number | null;
29
29
  }
30
30
  export declare function createItemSnapshot(state: VibeRuntimeState): ComputedRef<readonly VibeItem[]>;
31
+ export declare function watchStateSnapshots(state: VibeRuntimeState, items: ComputedRef<readonly VibeItem[]>, onStateChange: (state: VibeState) => void): WatchHandle;
31
32
  export declare function snapshotState(state: VibeRuntimeState, items?: readonly VibeItem[]): VibeState;