@wyxos/vibe 5.4.0 → 5.5.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 +4 -0
- package/lib/components/VibeSurface.vue.d.ts +2 -1
- package/lib/core/feed.d.ts +2 -1
- package/lib/core/itemRemovalController.d.ts +3 -2
- package/lib/core/itemRemovalOptions.d.ts +3 -0
- package/lib/core/masonryOptions.d.ts +3 -0
- package/lib/core/masonryViewportIndex.d.ts +16 -0
- package/lib/index.cjs +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +604 -538
- package/lib/types.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -125,6 +125,7 @@ item and the same removal, restoration, reel, and pagination behavior:
|
|
|
125
125
|
|
|
126
126
|
```ts
|
|
127
127
|
masonry: {
|
|
128
|
+
minColumnWidth: 400,
|
|
128
129
|
overscan: {
|
|
129
130
|
minimumPx: 600,
|
|
130
131
|
viewportMultiplier: 0.5,
|
|
@@ -133,6 +134,9 @@ masonry: {
|
|
|
133
134
|
},
|
|
134
135
|
```
|
|
135
136
|
|
|
137
|
+
`minColumnWidth` defaults to `240` CSS pixels. Raising it produces fewer,
|
|
138
|
+
larger masonry columns without constraining the feed container.
|
|
139
|
+
|
|
136
140
|
Low-priority images in that overscan window use native lazy loading, and
|
|
137
141
|
low-priority masonry videos defer metadata until they reach the real viewport.
|
|
138
142
|
Reel preload behavior remains unchanged.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { VibeMasonryOptions } from '../core/masonryOptions';
|
|
2
2
|
import { type VibeRuntimeState } from '../core/runtime';
|
|
3
3
|
import type { VibeCardRegion, VibeFeedFooter, VibeFeedFooterActions, VibeItemId, VibeMediaCardOptions, VibeMediaLifecycleContext, VibeReelInfoSheetOptions, VibeReelItemTarget, VibeReelNavigationResult } from '../types';
|
|
4
|
+
import type { VibeItemRemovalOptions } from '../core/itemRemovalOptions';
|
|
4
5
|
type __VLS_Props = {
|
|
5
6
|
canRetryEnd: boolean;
|
|
6
7
|
cardFooter?: VibeCardRegion;
|
|
@@ -17,7 +18,7 @@ declare function changeActiveReelMedia(direction: -1 | 1): boolean;
|
|
|
17
18
|
declare function moveActiveReelPost(direction: -1 | 1): boolean;
|
|
18
19
|
declare function navigateToReelItem(target: VibeReelItemTarget): VibeReelNavigationResult;
|
|
19
20
|
declare function getAutoScrollElement(): HTMLElement | null;
|
|
20
|
-
declare function startItemRemoval(postIds: readonly VibeItemId[]): number;
|
|
21
|
+
declare function startItemRemoval(postIds: readonly VibeItemId[], options?: VibeItemRemovalOptions): number;
|
|
21
22
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
22
23
|
changeActiveReelMedia: typeof changeActiveReelMedia;
|
|
23
24
|
getAutoScrollElement: typeof getAutoScrollElement;
|
package/lib/core/feed.d.ts
CHANGED
|
@@ -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 { VibeItemRemovalOptions } from './itemRemovalOptions';
|
|
2
3
|
import type { VibeMasonryOptions } from './masonryOptions';
|
|
3
4
|
import type { MediaPreviewState } from './mediaPreview';
|
|
4
5
|
export interface FeedRendererProps {
|
|
@@ -56,7 +57,7 @@ export interface VibeSurfaceExpose {
|
|
|
56
57
|
loadIfNearBottom: () => Promise<void>;
|
|
57
58
|
moveActiveReelPost: (direction: -1 | 1) => boolean;
|
|
58
59
|
navigateToReelItem: (target: VibeReelItemTarget) => VibeReelNavigationResult;
|
|
59
|
-
startItemRemoval: (postIds: readonly VibeItemId[]) => number;
|
|
60
|
+
startItemRemoval: (postIds: readonly VibeItemId[], options?: VibeItemRemovalOptions) => number;
|
|
60
61
|
transitionActiveReelMedia: (direction: -1 | 1) => Promise<boolean>;
|
|
61
62
|
transitionActiveReelPost: (postId: VibeItemId) => Promise<boolean>;
|
|
62
63
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { VibeRuntimeState } from './runtime';
|
|
2
2
|
import type { VibeItemId, VibeItemPlacement, VibeRemoval } from '../types';
|
|
3
|
+
import type { VibeItemRemovalOptions } from './itemRemovalOptions';
|
|
3
4
|
interface ItemRemovalControllerOptions {
|
|
4
5
|
historyLimit?: number;
|
|
5
6
|
onItemsRemoved: (removal: VibeRemoval, placements: readonly VibeItemPlacement[], activeIndex: number) => void;
|
|
6
7
|
onRemovalRestored: (removal: VibeRemoval) => void;
|
|
7
8
|
prepareRemoval: (postIds: readonly VibeItemId[]) => Promise<void>;
|
|
8
|
-
startRemoval: (postIds: readonly VibeItemId[]) => number;
|
|
9
|
+
startRemoval: (postIds: readonly VibeItemId[], options?: VibeItemRemovalOptions) => number;
|
|
9
10
|
state: VibeRuntimeState;
|
|
10
11
|
}
|
|
11
12
|
export declare class ItemRemovalController {
|
|
@@ -19,7 +20,7 @@ export declare class ItemRemovalController {
|
|
|
19
20
|
private readonly stopItemsWatcher;
|
|
20
21
|
constructor(options: ItemRemovalControllerOptions);
|
|
21
22
|
destroy(): void;
|
|
22
|
-
remove(postIds: readonly VibeItemId[]): Promise<VibeRemoval>;
|
|
23
|
+
remove(postIds: readonly VibeItemId[], options?: VibeItemRemovalOptions): Promise<VibeRemoval>;
|
|
23
24
|
reset(): void;
|
|
24
25
|
restoreItems(placements: readonly VibeItemPlacement[]): void;
|
|
25
26
|
restoreRemoval(removal: VibeRemoval): boolean;
|
|
@@ -4,9 +4,12 @@ export interface VibeMasonryOverscanOptions {
|
|
|
4
4
|
viewportMultiplier?: number;
|
|
5
5
|
}
|
|
6
6
|
export interface VibeMasonryOptions {
|
|
7
|
+
minColumnWidth?: number;
|
|
7
8
|
overscan?: VibeMasonryOverscanOptions;
|
|
8
9
|
}
|
|
10
|
+
export declare const DEFAULT_MASONRY_MIN_COLUMN_WIDTH = 240;
|
|
9
11
|
export declare const DEFAULT_MASONRY_OVERSCAN_MINIMUM_PX = 800;
|
|
10
12
|
export declare const DEFAULT_MASONRY_OVERSCAN_VIEWPORT_MULTIPLIER = 1.5;
|
|
13
|
+
export declare function resolveMasonryMinColumnWidth(options: VibeMasonryOptions | undefined): number;
|
|
11
14
|
export declare function resolveMasonryOverscan(options: VibeMasonryOptions | undefined, viewportHeight: number): number;
|
|
12
15
|
export declare function validateMasonryOptions(options?: VibeMasonryOptions): void;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { MasonryPosition, MasonryViewportOptions } from './masonry';
|
|
2
|
+
interface MasonryViewportIndexEntry {
|
|
3
|
+
bottom: number;
|
|
4
|
+
index: number;
|
|
5
|
+
top: number;
|
|
6
|
+
}
|
|
7
|
+
export interface MasonryViewportIndex {
|
|
8
|
+
columns: readonly (readonly MasonryViewportIndexEntry[])[];
|
|
9
|
+
}
|
|
10
|
+
export interface MasonryViewportQuery {
|
|
11
|
+
indices: number[];
|
|
12
|
+
inspected: number;
|
|
13
|
+
}
|
|
14
|
+
export declare function createMasonryViewportIndex(items: readonly MasonryPosition[], sourceIndices?: readonly number[]): MasonryViewportIndex;
|
|
15
|
+
export declare function queryMasonryViewportIndex(index: MasonryViewportIndex, options: MasonryViewportOptions): MasonryViewportQuery;
|
|
16
|
+
export {};
|