@wyxos/vibe 5.16.9 → 5.17.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 +2 -0
- package/lib/components/VibeControlledReel.vue.d.ts +24 -0
- package/lib/core/controlledReel.d.ts +41 -0
- package/lib/core/reelScrollTransition.d.ts +2 -1
- package/lib/core/reelViewport.d.ts +2 -0
- package/lib/index.cjs +2 -2
- package/lib/index.d.ts +2 -0
- package/lib/index.js +1211 -1037
- package/lib/style.css +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,6 +5,8 @@ Vibe is an initializable Vue 3 media feed with virtualized masonry and reel layo
|
|
|
5
5
|
Try the [live demo](https://vibe.wyxos.com/) to explore the feed and its controls.
|
|
6
6
|
Read the [full documentation](./docs/index.md) for guided setup, layout and data-loading concepts, and the API reference.
|
|
7
7
|
|
|
8
|
+
For an existing host-owned player and large queue, use the [host-controlled reel](./docs/reference/controlled-reel.md) with a bounded previous/current/next projection and stable media slot.
|
|
9
|
+
|
|
8
10
|
[](https://vibe.wyxos.com/)
|
|
9
11
|
|
|
10
12
|
The preview uses synthetic sample media. Open a masonry card to view it in a reel,
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { VibeControlledReelDirection, VibeControlledReelProps, VibeControlledReelSlotProps } from '../core/controlledReel';
|
|
2
|
+
type __VLS_Slots = {
|
|
3
|
+
default(props: VibeControlledReelSlotProps): unknown;
|
|
4
|
+
previous?(props: VibeControlledReelSlotProps): unknown;
|
|
5
|
+
next?(props: VibeControlledReelSlotProps): unknown;
|
|
6
|
+
};
|
|
7
|
+
declare function navigate(direction: VibeControlledReelDirection): Promise<void>;
|
|
8
|
+
declare const __VLS_base: import("vue").DefineComponent<VibeControlledReelProps, {
|
|
9
|
+
navigate: typeof navigate;
|
|
10
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
|
+
navigationError: (error: unknown) => any;
|
|
12
|
+
}, string, import("vue").PublicProps, Readonly<VibeControlledReelProps> & Readonly<{
|
|
13
|
+
onNavigationError?: ((error: unknown) => any) | undefined;
|
|
14
|
+
}>, {
|
|
15
|
+
label: string;
|
|
16
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
17
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
18
|
+
declare const _default: typeof __VLS_export;
|
|
19
|
+
export default _default;
|
|
20
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
21
|
+
new (): {
|
|
22
|
+
$slots: S;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { VibeItemId } from '../types';
|
|
2
|
+
export type VibeControlledReelDirection = 'next' | 'previous';
|
|
3
|
+
export interface VibeControlledReelItem {
|
|
4
|
+
id: VibeItemId;
|
|
5
|
+
artwork?: string;
|
|
6
|
+
label?: string;
|
|
7
|
+
}
|
|
8
|
+
/** A bounded projection of a host-owned queue. No full queue is required. */
|
|
9
|
+
export interface VibeControlledReelState {
|
|
10
|
+
/** Change whenever source, order, membership or selection invalidates navigation. */
|
|
11
|
+
revision: string | number;
|
|
12
|
+
current: VibeControlledReelItem | null;
|
|
13
|
+
previous?: VibeControlledReelItem | null;
|
|
14
|
+
next?: VibeControlledReelItem | null;
|
|
15
|
+
canPrevious: boolean;
|
|
16
|
+
canNext: boolean;
|
|
17
|
+
/** Zero-based position, when known. */
|
|
18
|
+
position?: number;
|
|
19
|
+
total?: number;
|
|
20
|
+
}
|
|
21
|
+
export interface VibeControlledReelRequest {
|
|
22
|
+
direction: VibeControlledReelDirection;
|
|
23
|
+
snapshot: Readonly<VibeControlledReelState>;
|
|
24
|
+
signal: AbortSignal;
|
|
25
|
+
}
|
|
26
|
+
export interface VibeControlledReelProps {
|
|
27
|
+
state: VibeControlledReelState;
|
|
28
|
+
/** Commit through the host queue, then push state. false declines the intent. */
|
|
29
|
+
onNavigate: (request: VibeControlledReelRequest) => boolean | void | Promise<boolean | void>;
|
|
30
|
+
label?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface VibeControlledReelSlotProps {
|
|
33
|
+
item: VibeControlledReelItem | null;
|
|
34
|
+
pending: boolean;
|
|
35
|
+
}
|
|
36
|
+
export interface VibeControlledReelExpose {
|
|
37
|
+
/** The pushed host state, rather than this promise, acknowledges selection. */
|
|
38
|
+
navigate: (direction: VibeControlledReelDirection) => Promise<void>;
|
|
39
|
+
}
|
|
40
|
+
/** Settle on abort even if an obsolete host callback ignores its signal. */
|
|
41
|
+
export declare function waitForControlledReelNavigation(navigate: VibeControlledReelProps['onNavigate'], context: VibeControlledReelRequest): Promise<boolean | void>;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export declare function
|
|
1
|
+
export declare function prefersReducedReelMotion(): boolean;
|
|
2
|
+
export declare function transitionReelScroll(element: HTMLElement, top: number, immediate: boolean, signal?: AbortSignal): Promise<void>;
|