@wyxos/vibe 5.3.1 → 5.4.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
@@ -119,6 +119,24 @@ active again. Set `mediaCard.videoMuted` to explicitly override the initial
119
119
  state in either layout. Users can still change mute and volume through the
120
120
  timed-media controls.
121
121
 
122
+ Masonry virtualization keeps the existing 800px/1.5-viewport overscan by
123
+ default. Consumers can opt into a capped window while retaining every loaded
124
+ item and the same removal, restoration, reel, and pagination behavior:
125
+
126
+ ```ts
127
+ masonry: {
128
+ overscan: {
129
+ minimumPx: 600,
130
+ viewportMultiplier: 0.5,
131
+ maximumPx: 1_000,
132
+ },
133
+ },
134
+ ```
135
+
136
+ Low-priority images in that overscan window use native lazy loading, and
137
+ low-priority masonry videos defer metadata until they reach the real viewport.
138
+ Reel preload behavior remains unchanged.
139
+
122
140
  When a feed item has entries in `item.items`, Vibe treats the parent media as
123
141
  position one and the nested entries as the remaining positions. Masonry cards
124
142
  show looping previous/next controls on hover or keyboard focus. Reel layout
@@ -1,3 +1,4 @@
1
+ import type { VibeMasonryOptions } from '../core/masonryOptions';
1
2
  import { type VibeRuntimeState } from '../core/runtime';
2
3
  import type { VibeCardRegion, VibeFeedFooter, VibeFeedFooterActions, VibeItemId, VibeMediaCardOptions, VibeMediaLifecycleContext, VibeReelInfoSheetOptions, VibeReelItemTarget, VibeReelNavigationResult } from '../types';
3
4
  type __VLS_Props = {
@@ -7,6 +8,7 @@ type __VLS_Props = {
7
8
  feedFooter?: VibeFeedFooter;
8
9
  feedFooterActions: VibeFeedFooterActions;
9
10
  mediaCard?: VibeMediaCardOptions;
11
+ masonry?: VibeMasonryOptions;
10
12
  reelInfoSheet?: VibeReelInfoSheetOptions;
11
13
  state: VibeRuntimeState;
12
14
  };
@@ -0,0 +1,14 @@
1
+ import { type ShallowRef } from 'vue';
2
+ import type { VibeLayout } from '../types';
3
+ interface MediaLoadingOptions {
4
+ fetchPriority: () => 'high' | 'low';
5
+ layout: () => VibeLayout;
6
+ mediaSource: () => string;
7
+ videoElement: ShallowRef<HTMLVideoElement | null>;
8
+ }
9
+ export declare function useMediaLoading(options: MediaLoadingOptions): {
10
+ imageLoading: import("vue").ComputedRef<"lazy" | "eager">;
11
+ mediaIsTimed: import("vue").ComputedRef<boolean>;
12
+ videoPreload: import("vue").ComputedRef<"metadata" | "auto" | "none">;
13
+ };
14
+ export {};
@@ -1,4 +1,5 @@
1
1
  import type { VibeCardRegion, VibeFeedFooter, VibeFeedFooterActions, VibeItem, VibeItemId, VibeMediaSource, VibeMediaCardOptions, VibeReelAutoAdvanceState, VibeReelForwardState, VibeReelInfoSheetOptions, VibeReelItemTarget, VibeReelNavigationResult, VibeReelOrigin, VibeState } from '../types';
2
+ import type { VibeMasonryOptions } from './masonryOptions';
2
3
  import type { MediaPreviewState } from './mediaPreview';
3
4
  export interface FeedRendererProps {
4
5
  canRetryEnd: boolean;
@@ -23,6 +24,7 @@ export interface MasonryFeedProps extends FeedRendererProps {
23
24
  entryDelays: ReadonlyMap<VibeItemId, number>;
24
25
  leavingPostIds?: ReadonlySet<VibeItemId>;
25
26
  removalDelays?: ReadonlyMap<VibeItemId, number>;
27
+ masonry?: VibeMasonryOptions;
26
28
  suspended?: boolean;
27
29
  }
28
30
  export interface FeedRendererExpose {
@@ -0,0 +1,12 @@
1
+ export interface VibeMasonryOverscanOptions {
2
+ maximumPx?: number;
3
+ minimumPx?: number;
4
+ viewportMultiplier?: number;
5
+ }
6
+ export interface VibeMasonryOptions {
7
+ overscan?: VibeMasonryOverscanOptions;
8
+ }
9
+ export declare const DEFAULT_MASONRY_OVERSCAN_MINIMUM_PX = 800;
10
+ export declare const DEFAULT_MASONRY_OVERSCAN_VIEWPORT_MULTIPLIER = 1.5;
11
+ export declare function resolveMasonryOverscan(options: VibeMasonryOptions | undefined, viewportHeight: number): number;
12
+ export declare function validateMasonryOptions(options?: VibeMasonryOptions): void;
@@ -1,3 +1,4 @@
1
+ import { type ComputedRef } from 'vue';
1
2
  import type { VibeAutoScrollState, VibeAutofillState, VibeCursor, VibeFillState, VibeItem, VibeItemId, VibeLayout, VibeReelAutoAdvanceState, VibeReelForwardState, VibeReelInfoSheetState, VibeState } from '../types';
2
3
  export interface VibeRuntimeState {
3
4
  activeReelPostId: VibeItemId | null;
@@ -25,4 +26,5 @@ export interface VibeRuntimeState {
25
26
  reelOrigin: 'masonry' | null;
26
27
  total: number | null;
27
28
  }
28
- export declare function snapshotState(state: VibeRuntimeState): VibeState;
29
+ export declare function createItemSnapshot(state: VibeRuntimeState): ComputedRef<readonly VibeItem[]>;
30
+ export declare function snapshotState(state: VibeRuntimeState, items?: readonly VibeItem[]): VibeState;