@wyxos/vibe 4.5.1 → 4.5.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.
@@ -3,12 +3,16 @@ import type { VibeItemId } 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;
6
+ declare function transitionActivePost(postId: VibeItemId): Promise<boolean>;
7
+ declare function transitionActiveMedia(direction: -1 | 1): Promise<boolean>;
6
8
  declare const __VLS_export: import("vue").DefineComponent<ReelFeedProps, {
7
9
  activeIndex: import("vue").ShallowRef<number, number>;
8
10
  activePostId: import("vue").ComputedRef<VibeItemId>;
9
11
  changeActiveMedia: typeof changeActiveMedia;
10
12
  loadIfNearBottom: typeof loadIfNearBottom;
11
13
  moveActivePost: typeof moveActivePost;
14
+ transitionActiveMedia: typeof transitionActiveMedia;
15
+ transitionActivePost: typeof transitionActivePost;
12
16
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
13
17
  ready: (postId: VibeItemId, mediaIndex: number) => any;
14
18
  error: (postId: VibeItemId, mediaIndex: number) => any;
@@ -3,10 +3,14 @@ import type { VibeItemId } 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;
6
+ declare function transitionActiveMedia(direction: -1 | 1): Promise<boolean>;
7
+ declare function transitionActivePost(postId: VibeItemId): Promise<boolean>;
6
8
  declare const __VLS_export: import("vue").DefineComponent<ReelLayoutProps, {
7
9
  changeActiveMedia: typeof changeActiveMedia;
8
10
  loadIfNearBottom: typeof loadIfNearBottom;
9
11
  moveActivePost: typeof moveActivePost;
12
+ transitionActiveMedia: typeof transitionActiveMedia;
13
+ transitionActivePost: typeof transitionActivePost;
10
14
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
11
15
  ready: (postId: VibeItemId, mediaIndex: number) => any;
12
16
  error: (postId: VibeItemId, mediaIndex: number) => any;
@@ -21,6 +21,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
21
21
  loadIfNearBottom: typeof loadIfNearBottom;
22
22
  moveActiveReelPost: typeof moveActiveReelPost;
23
23
  startItemRemoval: typeof startItemRemoval;
24
+ transitionActiveReelMedia: (direction: -1 | 1) => Promise<boolean>;
25
+ transitionActiveReelPost: (postId: VibeItemId) => Promise<boolean>;
24
26
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
25
27
  loadMore: () => any;
26
28
  retryEnd: () => any;
@@ -1,4 +1,3 @@
1
- import type { VibeRouteSync } from './vibeRouting';
2
1
  import type { VibeRuntimeState } from './runtime';
3
- import type { VibeItemPlacement } from '../types';
4
- export declare function restoreActiveItemAfterRemoval(state: VibeRuntimeState, routing: VibeRouteSync, placements: readonly VibeItemPlacement[], activeIndex: number, closeMasonryReel: () => void): void;
2
+ import type { VibeItem, VibeItemId, VibeItemPlacement } from '../types';
3
+ export declare function restoreActiveItemAfterRemoval(state: VibeRuntimeState, placements: readonly VibeItemPlacement[], activeIndex: number, activate: (postId: VibeItemId) => void, loadForward: (postIndex: number, item: VibeItem) => void): void;
@@ -1,16 +1,13 @@
1
+ import type { ReelForwardController } from './reelForwardController';
1
2
  import type { VibeRuntimeState } from './runtime';
2
3
  import type { VibeItemId, VibeMediaRemoval, VibeMediaTarget } from '../types';
3
4
  interface ExactMediaRemovalControllerOptions {
4
- loadNext: () => Promise<void>;
5
5
  onActivate: (postId: VibeItemId) => void;
6
- retryEnd: () => Promise<void>;
6
+ reelForward: ReelForwardController;
7
7
  state: VibeRuntimeState;
8
8
  }
9
9
  export declare class ExactMediaRemovalController {
10
10
  private readonly options;
11
- private forward;
12
- private forwardPromise;
13
- private forwardVersion;
14
11
  private generation;
15
12
  private readonly metadata;
16
13
  private readonly state;
@@ -18,13 +15,9 @@ export declare class ExactMediaRemovalController {
18
15
  remove(target: VibeMediaTarget): VibeMediaRemoval | null;
19
16
  reset(): void;
20
17
  restore(removal: VibeMediaRemoval): boolean;
21
- retryForward(): Promise<void>;
22
18
  private advanceFromRemovedPost;
23
- private clearForwardState;
24
19
  private isReelOpen;
25
20
  private restoreIntoPost;
26
- private startForwardRequest;
27
- private loadForward;
28
21
  private updateMediaIndexAfterRemoval;
29
22
  }
30
23
  export {};
@@ -25,6 +25,14 @@ export interface MasonryFeedProps extends FeedRendererProps {
25
25
  removalDelays?: ReadonlyMap<VibeItemId, number>;
26
26
  suspended?: boolean;
27
27
  }
28
+ export interface FeedRendererExpose {
29
+ changeActiveMedia?: (direction: -1 | 1) => boolean;
30
+ getScrollElement?: () => HTMLElement | null;
31
+ loadIfNearBottom: () => void;
32
+ moveActivePost?: (direction: -1 | 1) => boolean;
33
+ transitionActiveMedia?: (direction: -1 | 1) => Promise<boolean>;
34
+ transitionActivePost?: (postId: VibeItemId) => Promise<boolean>;
35
+ }
28
36
  export interface ReelFeedProps extends FeedRendererProps {
29
37
  initialPostId?: VibeItemId | null;
30
38
  mediaSource?: VibeMediaSource;
@@ -45,6 +53,8 @@ export interface VibeSurfaceExpose {
45
53
  loadIfNearBottom: () => Promise<void>;
46
54
  moveActiveReelPost: (direction: -1 | 1) => boolean;
47
55
  startItemRemoval: (postIds: readonly VibeItemId[]) => number;
56
+ transitionActiveReelMedia: (direction: -1 | 1) => Promise<boolean>;
57
+ transitionActiveReelPost: (postId: VibeItemId) => Promise<boolean>;
48
58
  }
49
59
  export declare const LOAD_MORE_THRESHOLD = 240;
50
60
  export declare function isNearFeedBottom(element: HTMLElement): boolean;
@@ -2,7 +2,9 @@ import type { VibeRuntimeState } from './runtime';
2
2
  import type { VibeItemId, VibeItemPlacement, VibeRemoval } from '../types';
3
3
  interface ItemRemovalControllerOptions {
4
4
  historyLimit?: number;
5
- onItemsRemoved: (placements: readonly VibeItemPlacement[], activeIndex: number) => void;
5
+ onItemsRemoved: (removal: VibeRemoval, placements: readonly VibeItemPlacement[], activeIndex: number) => void;
6
+ onRemovalRestored: (removal: VibeRemoval) => void;
7
+ prepareRemoval: (postIds: readonly VibeItemId[]) => Promise<void>;
6
8
  startRemoval: (postIds: readonly VibeItemId[]) => number;
7
9
  state: VibeRuntimeState;
8
10
  }
@@ -0,0 +1,24 @@
1
+ import type { VibeRuntimeState } from './runtime';
2
+ import type { VibeItem, VibeItemId } from '../types';
3
+ interface ReelForwardControllerOptions {
4
+ loadNext: () => Promise<void>;
5
+ onActivate: (postId: VibeItemId) => void;
6
+ retryEnd: () => Promise<void>;
7
+ state: VibeRuntimeState;
8
+ }
9
+ export declare class ReelForwardController {
10
+ private readonly options;
11
+ private forward;
12
+ private forwardPromise;
13
+ private forwardVersion;
14
+ private readonly state;
15
+ constructor(options: ReelForwardControllerOptions);
16
+ start(token: object, postIndex: number, item: VibeItem): void;
17
+ cancel(token: object): VibeItem | null;
18
+ reset(): void;
19
+ retry(): Promise<void>;
20
+ private clearState;
21
+ private startForwardRequest;
22
+ private loadForward;
23
+ }
24
+ export {};
@@ -0,0 +1,21 @@
1
+ import type { VibeRuntimeState } from './runtime';
2
+ import type { VibeItemId, VibeMediaTarget } from '../types';
3
+ interface ReelRemovalTransitionControllerOptions {
4
+ state: VibeRuntimeState;
5
+ transitionMedia: (direction: -1 | 1) => Promise<boolean>;
6
+ transitionPost: (postId: VibeItemId) => Promise<boolean>;
7
+ }
8
+ export declare class ReelRemovalTransitionController {
9
+ private readonly options;
10
+ private generation;
11
+ private pending;
12
+ constructor(options: ReelRemovalTransitionControllerOptions);
13
+ prepareItems(postIds: readonly VibeItemId[]): Promise<void>;
14
+ prepareMedia(target: VibeMediaTarget): Promise<void>;
15
+ reset(): void;
16
+ private preparePosts;
17
+ private isReelActive;
18
+ private nextSurvivor;
19
+ private serialize;
20
+ }
21
+ export {};
@@ -0,0 +1 @@
1
+ export declare function transitionReelScroll(element: HTMLElement, top: number, immediate: boolean): Promise<void>;
@@ -0,0 +1,23 @@
1
+ import { ExactMediaRemovalController } from './exactMediaRemovalController';
2
+ import { ItemRemovalController } from './itemRemovalController';
3
+ import { ReelForwardController } from './reelForwardController';
4
+ import { ReelRemovalTransitionController } from './reelRemovalTransitionController';
5
+ import type { VibeSurfaceExpose } from './feed';
6
+ import type { VibeRuntimeState } from './runtime';
7
+ import type { VibeItemId } from '../types';
8
+ interface RemovalControllerOptions {
9
+ historyLimit: number | undefined;
10
+ loadNext: () => Promise<void>;
11
+ onActivate: (postId: VibeItemId) => void;
12
+ retryEnd: () => Promise<void>;
13
+ state: VibeRuntimeState;
14
+ surface: () => VibeSurfaceExpose | null;
15
+ }
16
+ export interface RemovalControllers {
17
+ exactMediaRemoval: ExactMediaRemovalController;
18
+ itemRemoval: ItemRemovalController;
19
+ reelForward: ReelForwardController;
20
+ reelRemoval: ReelRemovalTransitionController;
21
+ }
22
+ export declare function createRemovalControllers(options: RemovalControllerOptions): RemovalControllers;
23
+ export {};