@wyxos/vibe 2.2.5 → 3.0.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.
Files changed (75) hide show
  1. package/README.md +451 -95
  2. package/lib/components/FullscreenHeader.vue.d.ts +25 -0
  3. package/lib/components/FullscreenMediaBar.vue.d.ts +14 -0
  4. package/lib/components/FullscreenSurface.vue.d.ts +46 -0
  5. package/lib/components/Layout.vue.d.ts +42 -0
  6. package/lib/components/ListCard.vue.d.ts +44 -0
  7. package/lib/components/ListSurface.vue.d.ts +64 -0
  8. package/lib/components/viewer-core/assetErrors.d.ts +30 -0
  9. package/lib/components/viewer-core/assetState.d.ts +12 -0
  10. package/lib/components/viewer-core/autoBuckets.d.ts +18 -0
  11. package/lib/components/viewer-core/autoResolveHelpers.d.ts +19 -0
  12. package/lib/components/viewer-core/autoResolveState.d.ts +50 -0
  13. package/lib/components/viewer-core/dom.d.ts +2 -0
  14. package/lib/components/viewer-core/fillDelay.d.ts +9 -0
  15. package/lib/components/viewer-core/format.d.ts +1 -0
  16. package/lib/components/viewer-core/itemIdentity.d.ts +6 -0
  17. package/lib/components/viewer-core/listCardAsset.d.ts +4 -0
  18. package/lib/components/viewer-core/listPreview.d.ts +10 -0
  19. package/lib/components/viewer-core/loadError.d.ts +4 -0
  20. package/lib/components/viewer-core/masonryLayout.d.ts +37 -0
  21. package/lib/components/viewer-core/masonryViewport.d.ts +7 -0
  22. package/lib/components/viewer-core/media.d.ts +4 -0
  23. package/lib/components/viewer-core/mediaPlayback.d.ts +1 -0
  24. package/lib/components/viewer-core/removalState.d.ts +50 -0
  25. package/lib/components/viewer-core/slotContent.d.ts +2 -0
  26. package/lib/components/viewer-core/surfaceSlots.d.ts +22 -0
  27. package/lib/components/viewer-core/theme.d.ts +3 -0
  28. package/lib/components/viewer-core/useActivation.d.ts +8 -0
  29. package/lib/components/viewer-core/useAssetLoadQueue.d.ts +22 -0
  30. package/lib/components/viewer-core/useAutoResolveSource.d.ts +51 -0
  31. package/lib/components/viewer-core/useController.d.ts +71 -0
  32. package/lib/components/viewer-core/useDataSource.d.ts +100 -0
  33. package/lib/components/viewer-core/useEdgeBoundary.d.ts +16 -0
  34. package/lib/components/viewer-core/useFullscreen.d.ts +1 -0
  35. package/lib/components/viewer-core/useMasonryList.d.ts +43 -0
  36. package/lib/components/viewer-core/useMasonryMotion.d.ts +29 -0
  37. package/lib/components/viewer-core/useMedia.d.ts +40 -0
  38. package/lib/components/viewer-core/useViewer.d.ts +61 -0
  39. package/lib/components/viewer-core/virtualization.d.ts +14 -0
  40. package/lib/components/viewer.d.ts +16 -0
  41. package/lib/index.cjs +1 -1
  42. package/lib/index.d.ts +58 -5
  43. package/lib/index.js +3202 -1486
  44. package/lib/style.css +3 -0
  45. package/package.json +86 -83
  46. package/lib/App.vue.d.ts +0 -3
  47. package/lib/apple-touch-icon-114x114.png +0 -0
  48. package/lib/apple-touch-icon-120x120.png +0 -0
  49. package/lib/apple-touch-icon-144x144.png +0 -0
  50. package/lib/apple-touch-icon-152x152.png +0 -0
  51. package/lib/apple-touch-icon-180x180.png +0 -0
  52. package/lib/apple-touch-icon-57x57.png +0 -0
  53. package/lib/apple-touch-icon-60x60.png +0 -0
  54. package/lib/apple-touch-icon-72x72.png +0 -0
  55. package/lib/apple-touch-icon-76x76.png +0 -0
  56. package/lib/components/Masonry.vue.d.ts +0 -68
  57. package/lib/components/MasonryItem.vue.d.ts +0 -3
  58. package/lib/components/MasonryLoader.vue.d.ts +0 -27
  59. package/lib/components/MasonryVideoControls.vue.d.ts +0 -30
  60. package/lib/components/masonryItemRegistry.d.ts +0 -24
  61. package/lib/favicon-128x128.png +0 -0
  62. package/lib/favicon-16x16.png +0 -0
  63. package/lib/favicon-256x256.png +0 -0
  64. package/lib/favicon-32x32.png +0 -0
  65. package/lib/favicon-48x48.png +0 -0
  66. package/lib/favicon-64x64.png +0 -0
  67. package/lib/favicon.ico +0 -0
  68. package/lib/logo-dark.svg +0 -36
  69. package/lib/logo-light.svg +0 -29
  70. package/lib/logo.svg +0 -32
  71. package/lib/manifest.json +0 -41
  72. package/lib/masonry/backfill.d.ts +0 -53
  73. package/lib/masonry/layout.d.ts +0 -13
  74. package/lib/masonry/layoutEngine.d.ts +0 -33
  75. package/lib/masonry/types.d.ts +0 -95
@@ -0,0 +1,44 @@
1
+ import type { Component } from 'vue';
2
+ import type { VibeViewerItem } from './viewer';
3
+ import type { VibeAssetErrorReporter, VibeAssetLoadReporter } from './viewer-core/assetErrors';
4
+ type __VLS_Props = {
5
+ active?: boolean;
6
+ index?: number;
7
+ item: VibeViewerItem;
8
+ reportAssetError?: VibeAssetErrorReporter | null;
9
+ reportAssetLoad?: VibeAssetLoadReporter | null;
10
+ surfaceActive?: boolean;
11
+ };
12
+ type __VLS_Slots = {
13
+ 'grid-item-overlay'?: (props: {
14
+ active: boolean;
15
+ focused: boolean;
16
+ hovered: boolean;
17
+ index: number;
18
+ item: VibeViewerItem;
19
+ openFullscreen: () => void;
20
+ }) => unknown;
21
+ 'item-icon'?: (props: {
22
+ icon: Component;
23
+ item: VibeViewerItem;
24
+ }) => unknown;
25
+ };
26
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
27
+ open: () => any;
28
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
29
+ onOpen?: (() => any) | undefined;
30
+ }>, {
31
+ active: boolean;
32
+ reportAssetError: VibeAssetErrorReporter | null;
33
+ reportAssetLoad: VibeAssetLoadReporter | null;
34
+ index: number;
35
+ surfaceActive: boolean;
36
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
37
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
38
+ declare const _default: typeof __VLS_export;
39
+ export default _default;
40
+ type __VLS_WithSlots<T, S> = T & {
41
+ new (): {
42
+ $slots: S;
43
+ };
44
+ };
@@ -0,0 +1,64 @@
1
+ import type { Component } from 'vue';
2
+ import type { VibeViewerItem } from './viewer';
3
+ import type { VibeAssetErrorReporter, VibeAssetLoadReporter } from './viewer-core/assetErrors';
4
+ import type { VibeGridStatusSlotProps } from './viewer-core/surfaceSlots';
5
+ type __VLS_Props = {
6
+ active?: boolean;
7
+ activeIndex?: number;
8
+ commitPendingAppend?: (() => void | Promise<void>) | null;
9
+ hasNextPage?: boolean;
10
+ hasPreviousPage?: boolean;
11
+ items: VibeViewerItem[];
12
+ loading?: boolean;
13
+ pendingAppendItems?: VibeViewerItem[];
14
+ paginationDetail?: string | null;
15
+ reportAssetError?: VibeAssetErrorReporter | null;
16
+ reportAssetLoad?: VibeAssetLoadReporter | null;
17
+ requestNextPage?: (() => void | Promise<void>) | null;
18
+ requestPreviousPage?: (() => void | Promise<void>) | null;
19
+ restoreToken: number;
20
+ };
21
+ type __VLS_Slots = {
22
+ 'grid-footer'?: () => unknown;
23
+ 'grid-item-overlay'?: (props: {
24
+ active: boolean;
25
+ focused: boolean;
26
+ hovered: boolean;
27
+ index: number;
28
+ item: VibeViewerItem;
29
+ openFullscreen: () => void;
30
+ }) => unknown;
31
+ 'grid-status'?: (props: VibeGridStatusSlotProps) => unknown;
32
+ 'item-icon'?: (props: {
33
+ icon: Component;
34
+ item: VibeViewerItem;
35
+ }) => unknown;
36
+ };
37
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
38
+ "update:activeIndex": (value: number) => any;
39
+ "open-fullscreen": (index: number) => any;
40
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
41
+ "onUpdate:activeIndex"?: ((value: number) => any) | undefined;
42
+ "onOpen-fullscreen"?: ((index: number) => any) | undefined;
43
+ }>, {
44
+ loading: boolean;
45
+ activeIndex: number;
46
+ hasNextPage: boolean;
47
+ hasPreviousPage: boolean;
48
+ paginationDetail: string | null;
49
+ requestNextPage: (() => void | Promise<void>) | null;
50
+ requestPreviousPage: (() => void | Promise<void>) | null;
51
+ active: boolean;
52
+ reportAssetError: VibeAssetErrorReporter | null;
53
+ reportAssetLoad: VibeAssetLoadReporter | null;
54
+ commitPendingAppend: (() => void | Promise<void>) | null;
55
+ pendingAppendItems: VibeViewerItem[];
56
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
57
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
58
+ declare const _default: typeof __VLS_export;
59
+ export default _default;
60
+ type __VLS_WithSlots<T, S> = T & {
61
+ new (): {
62
+ $slots: S;
63
+ };
64
+ };
@@ -0,0 +1,30 @@
1
+ import type { VibeViewerItem } from '../viewer';
2
+ import type { VibeAssetErrorKind } from './loadError';
3
+ export type VibeAssetErrorSurface = 'fullscreen' | 'grid';
4
+ export type VibeAssetLoadSurface = VibeAssetErrorSurface;
5
+ export interface VibeAssetErrorEvent {
6
+ item: VibeViewerItem;
7
+ occurrenceKey: string;
8
+ url: string;
9
+ kind: VibeAssetErrorKind;
10
+ surface: VibeAssetErrorSurface;
11
+ }
12
+ export interface VibeAssetLoadEvent {
13
+ item: VibeViewerItem;
14
+ occurrenceKey: string;
15
+ surface: VibeAssetLoadSurface;
16
+ url: string;
17
+ }
18
+ export type VibeAssetErrorReporter = (error: VibeAssetErrorEvent) => void;
19
+ export type VibeAssetLoadReporter = (load: VibeAssetLoadEvent) => void;
20
+ export declare const DEFAULT_ASSET_ERROR_BATCH_WINDOW_MS = 150;
21
+ export declare function createAssetErrorBatchReporter(emitErrors: (errors: VibeAssetErrorEvent[]) => void, batchWindowMs?: number): {
22
+ flush: () => void;
23
+ report: (entry: VibeAssetErrorEvent) => void;
24
+ stop: () => void;
25
+ };
26
+ export declare function createAssetLoadBatchReporter(emitLoads: (loads: VibeAssetLoadEvent[]) => void, batchWindowMs?: number): {
27
+ flush: () => void;
28
+ report: (entry: VibeAssetLoadEvent) => void;
29
+ stop: () => void;
30
+ };
@@ -0,0 +1,12 @@
1
+ import type { VibeAssetErrorKind } from './loadError';
2
+ export interface MediaUiState {
3
+ currentTime: number;
4
+ duration: number;
5
+ paused: boolean;
6
+ ready: boolean;
7
+ errorKind: VibeAssetErrorKind | null;
8
+ }
9
+ export declare const DEFAULT_MEDIA_UI_STATE: MediaUiState;
10
+ export declare function createMediaUiState(): MediaUiState;
11
+ export declare function isImageElementReady(element: HTMLImageElement): boolean;
12
+ export declare function syncMediaUiState(state: MediaUiState, media: HTMLMediaElement, eventType?: string): void;
@@ -0,0 +1,18 @@
1
+ import type { VibeViewerItem } from '../viewer';
2
+ export interface VibeAutoBucket {
3
+ cursor: string | null;
4
+ items: VibeViewerItem[];
5
+ nextCursor: string | null;
6
+ previousCursor: string | null;
7
+ }
8
+ export declare function flattenVibeBuckets(buckets: VibeAutoBucket[]): VibeViewerItem[];
9
+ export declare function filterRemovedItems(items: VibeViewerItem[], removedIds: Set<string>): VibeViewerItem[];
10
+ export declare function getVibeBucketVisibleItems(bucket: VibeAutoBucket, removedIds: Set<string>): VibeViewerItem[];
11
+ export declare function getVibeBucketVisibleCount(bucket: VibeAutoBucket, removedIds: Set<string>): number;
12
+ export declare function getVibeVisibleItemCount(buckets: VibeAutoBucket[], removedIds: Set<string>): number;
13
+ export declare function getVibeCursorAtVisibleIndex(buckets: VibeAutoBucket[], removedIds: Set<string>, index: number): string | null;
14
+ export declare function replaceVibeBucketAtCursor(buckets: VibeAutoBucket[], cursor: string | null, nextBucket: VibeAutoBucket): VibeAutoBucket[];
15
+ export declare function resolveVibeBucketItems(nextItems: VibeViewerItem[], previousItems: VibeViewerItem[], sequence: number): {
16
+ items: VibeViewerItem[];
17
+ nextSequence: number;
18
+ };
@@ -0,0 +1,19 @@
1
+ import type { VibeViewerItem } from '../viewer';
2
+ import type { VibeLoadPhase } from './removalState';
3
+ export declare const DEFAULT_PAGE_SIZE = 25;
4
+ export declare const PREFETCH_OFFSET = 3;
5
+ export declare const INITIAL_CURSOR_KEY = "__vibe_initial_cursor__";
6
+ export type ResolveFn = (params: {
7
+ cursor: string | null;
8
+ pageSize: number;
9
+ signal?: AbortSignal;
10
+ }) => Promise<{
11
+ items: VibeViewerItem[];
12
+ nextPage: string | null;
13
+ previousPage?: string | null;
14
+ }>;
15
+ export type VibeAutoDirection = 'backward' | 'forward';
16
+ export declare function isActiveLoadPhase(phase: VibeLoadPhase): phase is "filling" | "loading" | "reloading";
17
+ export declare function normalizePageSize(value: number | undefined): number;
18
+ export declare function getCursorKey(cursor: string | null): string;
19
+ export declare function clamp(value: number, min: number, max: number): number;
@@ -0,0 +1,50 @@
1
+ import type { VibeViewerItem } from '../viewer';
2
+ import { type VibeAutoBucket } from './autoBuckets';
3
+ import { type VibeAutoDirection } from './autoResolveHelpers';
4
+ export interface VibeCollectedBuckets {
5
+ buckets: VibeAutoBucket[];
6
+ canceled: boolean;
7
+ visibleCount: number;
8
+ }
9
+ export interface VibeInitialAutoState {
10
+ activeIndex?: number;
11
+ cursor: string | null;
12
+ items: VibeViewerItem[];
13
+ nextCursor?: string | null;
14
+ previousCursor?: string | null;
15
+ }
16
+ export declare function isAbortError(error: unknown): boolean;
17
+ export declare function createAutoResolveBucket(options: {
18
+ cursor: string | null;
19
+ nextCursor: string | null;
20
+ nextItems: VibeViewerItem[];
21
+ previousCursor: string | null;
22
+ previousItems: VibeViewerItem[];
23
+ sequence: number;
24
+ }): {
25
+ bucket: {
26
+ cursor: string | null;
27
+ items: VibeViewerItem[];
28
+ nextCursor: string | null;
29
+ previousCursor: string | null;
30
+ };
31
+ nextSequence: number;
32
+ };
33
+ export declare function finalizeCollectedBuckets(buckets: VibeAutoBucket[], direction: VibeAutoDirection, removedIds: Set<string>, canceled: boolean): VibeCollectedBuckets | null;
34
+ export declare function hydrateAutoResolveState(options: {
35
+ initialState: VibeInitialAutoState;
36
+ removedIds: Set<string>;
37
+ sequence: number;
38
+ }): {
39
+ activeIndex: number;
40
+ buckets: {
41
+ cursor: string | null;
42
+ items: VibeViewerItem[];
43
+ nextCursor: string | null;
44
+ previousCursor: string | null;
45
+ }[];
46
+ nextSequence: number;
47
+ };
48
+ export declare function getActiveOccurrenceKey(items: VibeViewerItem[], activeIndex: number): string | null;
49
+ export declare function getSyncedActiveIndex(items: VibeViewerItem[], activeIndex: number, anchorOccurrenceKey?: string | null): number;
50
+ export declare function isStaticBoundaryUnderfilled(bucket: VibeAutoBucket | null, removedIds: Set<string>, pageSize: number): boolean;
@@ -0,0 +1,2 @@
1
+ export declare function isEditableTarget(target: EventTarget | null): boolean;
2
+ export declare function isInteractiveTarget(target: EventTarget | null): boolean;
@@ -0,0 +1,9 @@
1
+ export declare const DEFAULT_DYNAMIC_FILL_DELAY_MS = 1000;
2
+ export declare const DEFAULT_DYNAMIC_FILL_DELAY_STEP_MS = 250;
3
+ export declare function getDynamicFillDelayMs(fillRequestIndex: number, baseDelayMs?: number, stepDelayMs?: number): number;
4
+ export declare function normalizeDynamicFillDelayMs(value: number | undefined, fallback: number): number;
5
+ export declare function useFillDelayCountdown(): {
6
+ clear: (resolvePending?: boolean) => void;
7
+ remainingMs: import("vue").Ref<number | null, number | null>;
8
+ wait: (delayMs: number) => Promise<void>;
9
+ };
@@ -0,0 +1 @@
1
+ export declare function formatPlaybackTime(value: number): string;
@@ -0,0 +1,6 @@
1
+ import type { VibeViewerItem } from '../viewer';
2
+ export declare function getVibeOccurrenceKey(item: VibeViewerItem): string;
3
+ export declare function reconcileVibeOccurrenceKeys(nextItems: VibeViewerItem[], previousItems: VibeViewerItem[], nextSequence: number): {
4
+ items: VibeViewerItem[];
5
+ nextSequence: number;
6
+ };
@@ -0,0 +1,4 @@
1
+ export declare function abortListCardImageLoad(image: HTMLImageElement | null): void;
2
+ export declare function abortListCardVideoLoad(video: HTMLVideoElement | null): void;
3
+ export declare function isListCardWithinViewport(itemBounds: DOMRectReadOnly | DOMRect, viewportBounds: DOMRectReadOnly | DOMRect | null): boolean;
4
+ export declare function normalizeListCardAssetUrl(url: string | null): string | null;
@@ -0,0 +1,10 @@
1
+ import type { VibeViewerItem } from '../viewer';
2
+ export type VibeListRenderableKind = 'image' | 'video' | 'fallback';
3
+ export interface VibeListRenderableAsset {
4
+ kind: VibeListRenderableKind;
5
+ url: string | null;
6
+ width: number;
7
+ height: number;
8
+ label: string;
9
+ }
10
+ export declare function getListRenderableAsset(item: VibeViewerItem): VibeListRenderableAsset;
@@ -0,0 +1,4 @@
1
+ export type VibeAssetErrorKind = 'generic' | 'not-found';
2
+ export declare function getVibeAssetErrorLabel(kind: VibeAssetErrorKind): "404" | "Load error";
3
+ export declare function canRetryVibeAssetError(kind: VibeAssetErrorKind | null | undefined): kind is "generic";
4
+ export declare function resolveVibeAssetErrorKind(url: string): Promise<VibeAssetErrorKind>;
@@ -0,0 +1,37 @@
1
+ import type { VibeViewerItem } from '../viewer';
2
+ export type LayoutPosition = {
3
+ x: number;
4
+ y: number;
5
+ };
6
+ export interface VibeMasonryDimensions {
7
+ width: number;
8
+ height: number;
9
+ source: 'preview' | 'original' | 'fallback';
10
+ }
11
+ export interface VibeMasonryLayoutResult {
12
+ positions: LayoutPosition[];
13
+ heights: number[];
14
+ buckets: Map<number, number[]>;
15
+ contentHeight: number;
16
+ indexById: Map<string, number>;
17
+ }
18
+ export declare function getMasonryDimensions(item: VibeViewerItem): VibeMasonryDimensions;
19
+ export declare function getColumnCount(containerWidth: number, itemWidth: number): number;
20
+ export declare function getColumnWidth(containerWidth: number, columnCount: number, fallbackItemWidth: number, gapX?: number): number;
21
+ export declare function estimateItemHeight(item: VibeViewerItem, columnWidth: number): number;
22
+ export declare function buildMasonryLayout(items: VibeViewerItem[], options: {
23
+ columnCount: number;
24
+ columnWidth: number;
25
+ gapX: number;
26
+ gapY: number;
27
+ bucketPx: number;
28
+ }): VibeMasonryLayoutResult;
29
+ export declare function getVisibleIndicesFromBuckets(options: {
30
+ itemCount: number;
31
+ viewportHeight: number;
32
+ scrollTop: number;
33
+ overscanPx: number;
34
+ bucketPx: number;
35
+ buckets: Map<number, number[]>;
36
+ }): number[];
37
+ export declare function snapshotPositionsById(items: VibeViewerItem[], indexById: Map<string, number>, positions: LayoutPosition[]): Map<string, LayoutPosition>;
@@ -0,0 +1,7 @@
1
+ export declare function getVibeMasonryViewportHeight(viewport: HTMLElement | null, fallbackHeight: number): number;
2
+ export declare function getVibeMasonryViewportWidth(viewport: HTMLElement | null, fallbackWidth: number, itemWidth: number): number;
3
+ export declare function getVibeMasonryDistanceFromBottom(viewport: HTMLElement | null, scrollTop: number, viewportHeight: number, containerHeight: number): number;
4
+ export declare function getVibeMasonryScrollbarThumbStyle(scrollbarThumbHeight: number, scrollbarThumbTop: number): {
5
+ height: string;
6
+ transform: string;
7
+ };
@@ -0,0 +1,4 @@
1
+ import type { Component } from 'vue';
2
+ import type { VibeViewerType } from '../viewer';
3
+ export declare function getItemIcon(type: VibeViewerType): Component;
4
+ export declare function getItemLabel(type: VibeViewerType): string;
@@ -0,0 +1 @@
1
+ export declare function playMediaElement(media: HTMLMediaElement): void;
@@ -0,0 +1,50 @@
1
+ export interface VibeRemoveResult {
2
+ ids: string[];
3
+ }
4
+ export type VibeFeedMode = 'dynamic' | 'static';
5
+ export type VibeLoadPhase = 'failed' | 'filling' | 'idle' | 'loading' | 'reloading';
6
+ export interface VibeStatus {
7
+ activeIndex: number;
8
+ currentCursor: string | null;
9
+ errorMessage: string | null;
10
+ fillCollectedCount: number | null;
11
+ fillDelayRemainingMs: number | null;
12
+ fillTargetCount: number | null;
13
+ hasNextPage: boolean;
14
+ hasPreviousPage: boolean;
15
+ isAutoMode: boolean;
16
+ itemCount: number;
17
+ loadState: 'failed' | 'loaded' | 'loading';
18
+ mode: VibeFeedMode | null;
19
+ nextCursor: string | null;
20
+ phase: VibeLoadPhase;
21
+ previousCursor: string | null;
22
+ removedCount: number;
23
+ surfaceMode: 'fullscreen' | 'list';
24
+ }
25
+ export interface VibeHandle {
26
+ cancel: () => void;
27
+ clearRemoved: () => void;
28
+ getRemovedIds: () => string[];
29
+ loadNext: () => Promise<void>;
30
+ loadPrevious: () => Promise<void>;
31
+ remove: (ids: string | string[]) => VibeRemoveResult;
32
+ restore: (ids: string | string[]) => VibeRemoveResult;
33
+ retry: () => Promise<void>;
34
+ status: Readonly<VibeStatus>;
35
+ undo: () => VibeRemoveResult | null;
36
+ }
37
+ export declare function useVibeRemovalState(): {
38
+ clearRemoved: () => void;
39
+ getRemovedIds: () => string[];
40
+ remove: (ids: string | string[]) => {
41
+ ids: string[];
42
+ };
43
+ removedIds: import("vue").Ref<Set<string> & Omit<Set<string>, keyof Set<any>>, Set<string> | (Set<string> & Omit<Set<string>, keyof Set<any>>)>;
44
+ restore: (ids: string | string[]) => {
45
+ ids: string[];
46
+ };
47
+ undo: () => {
48
+ ids: string[];
49
+ } | null;
50
+ };
@@ -0,0 +1,2 @@
1
+ import { type VNodeArrayChildren } from 'vue';
2
+ export declare function hasRenderableSlotContent(children: VNodeArrayChildren | unknown): boolean;
@@ -0,0 +1,22 @@
1
+ import type { VibeViewerItem } from '../viewer';
2
+ export type VibeSurfaceSlotProps = {
3
+ hasNextPage: boolean;
4
+ index: number;
5
+ item: VibeViewerItem;
6
+ loading: boolean;
7
+ paginationDetail: string | null;
8
+ total: number;
9
+ };
10
+ export type VibeSurfaceStatusKind = 'end' | 'loading-more';
11
+ export type VibeFullscreenStatusSlotProps = VibeSurfaceSlotProps & {
12
+ kind: VibeSurfaceStatusKind;
13
+ message: string;
14
+ };
15
+ export type VibeGridStatusSlotProps = {
16
+ activeIndex: number;
17
+ kind: VibeSurfaceStatusKind;
18
+ loading: boolean;
19
+ message: string;
20
+ paginationDetail: string | null;
21
+ total: number;
22
+ };
@@ -0,0 +1,3 @@
1
+ import type { VibeViewerType } from '../viewer';
2
+ export declare function getStageToneClass(type: VibeViewerType): string;
3
+ export declare function getSlideToneClass(type: VibeViewerType): string;
@@ -0,0 +1,8 @@
1
+ import { type Ref } from 'vue';
2
+ export declare function useActivation(options: {
3
+ enabled: Ref<boolean>;
4
+ onDisable: () => void;
5
+ onEnable: () => Promise<void> | void;
6
+ onKeydown: (event: KeyboardEvent) => void;
7
+ onResize: () => void;
8
+ }): void;
@@ -0,0 +1,22 @@
1
+ export interface VibeAssetLoadQueueLimits {
2
+ maxGlobal: number;
3
+ maxPerDomain: number;
4
+ maxVideoPerDomain: number;
5
+ }
6
+ export interface VibeAssetLoadRequest {
7
+ assetType: 'image' | 'video';
8
+ getPriority: () => number;
9
+ onGrant: () => void;
10
+ url: string;
11
+ }
12
+ export interface VibeAssetLoadLease {
13
+ cancel: () => void;
14
+ refresh: () => void;
15
+ release: () => void;
16
+ }
17
+ export declare function createAssetLoadQueue(limits?: VibeAssetLoadQueueLimits): {
18
+ request: (options: VibeAssetLoadRequest) => VibeAssetLoadLease;
19
+ };
20
+ export declare const defaultAssetLoadQueue: {
21
+ request: (options: VibeAssetLoadRequest) => VibeAssetLoadLease;
22
+ };
@@ -0,0 +1,51 @@
1
+ import { type Ref } from 'vue';
2
+ import type { VibeViewerItem } from '../viewer';
3
+ import type { VibeFeedMode, VibeLoadPhase } from './removalState';
4
+ import { type ResolveFn } from './autoResolveHelpers';
5
+ type VibeAutoEmit = (event: 'update:activeIndex', value: number) => void;
6
+ export declare function useAutoResolveSource(options: {
7
+ emit: VibeAutoEmit;
8
+ fillDelayMs?: number;
9
+ fillDelayStepMs?: number;
10
+ initialCursor?: string | null;
11
+ initialState?: {
12
+ activeIndex?: number;
13
+ cursor: string | null;
14
+ items: VibeViewerItem[];
15
+ nextCursor?: string | null;
16
+ previousCursor?: string | null;
17
+ };
18
+ mode?: VibeFeedMode;
19
+ pageSize?: number;
20
+ removedIds: Ref<Set<string>>;
21
+ resolve?: ResolveFn;
22
+ }): {
23
+ activeIndex: import("vue").ComputedRef<number>;
24
+ canRetryInitialLoad: import("vue").ComputedRef<boolean>;
25
+ cancel: () => void;
26
+ commitPendingAppend: () => Promise<void>;
27
+ currentCursor: import("vue").ComputedRef<string | null>;
28
+ errorMessage: Ref<string | null, string | null>;
29
+ fillCollectedCount: Ref<number | null, number | null>;
30
+ fillDelayRemainingMs: Ref<number | null, number | null>;
31
+ fillTargetCount: Ref<number | null, number | null>;
32
+ hasNextPage: import("vue").ComputedRef<boolean>;
33
+ hasPreviousPage: import("vue").ComputedRef<boolean>;
34
+ items: import("vue").ComputedRef<VibeViewerItem[]>;
35
+ loading: import("vue").ComputedRef<boolean>;
36
+ mode: import("vue").ComputedRef<VibeFeedMode>;
37
+ nextCursor: import("vue").ComputedRef<string | null>;
38
+ pendingAppendItems: import("vue").ComputedRef<VibeViewerItem[]>;
39
+ phase: Ref<VibeLoadPhase, VibeLoadPhase>;
40
+ prefetchNextPage: () => Promise<void>;
41
+ prefetchPreviousPage: () => Promise<void>;
42
+ previousCursor: import("vue").ComputedRef<string | null>;
43
+ retryInitialLoad: () => Promise<void>;
44
+ retry: () => Promise<void>;
45
+ setActiveIndex: (nextIndex: number) => void;
46
+ setAutoPrefetchEnabled: (nextValue: boolean) => void;
47
+ syncActiveIndexAfterVisibilityChange: (anchorOccurrenceKey?: string | null) => void;
48
+ getActiveOccurrenceKey: () => string | null;
49
+ maybeCommitPendingAppendWhenFilteredOut: () => void;
50
+ };
51
+ export {};
@@ -0,0 +1,71 @@
1
+ import { type VibeEmit, type VibeProps } from './useDataSource';
2
+ export declare const DESKTOP_BREAKPOINT_PX = 1024;
3
+ type VibeDesktopSurface = 'fullscreen' | 'list';
4
+ export declare function useController(props: Readonly<VibeProps>, emit: VibeEmit): {
5
+ cancel: () => void;
6
+ isDesktop: import("vue").ComputedRef<boolean>;
7
+ listRestoreToken: import("vue").Ref<number, number>;
8
+ loadNext: () => Promise<void>;
9
+ loadPrevious: () => Promise<void>;
10
+ openFullscreen: (index: number) => void;
11
+ returnToList: () => void;
12
+ retry: () => Promise<void>;
13
+ showBackToList: import("vue").ComputedRef<boolean>;
14
+ status: {
15
+ readonly activeIndex: number;
16
+ readonly currentCursor: string | null;
17
+ readonly errorMessage: string | null;
18
+ readonly fillCollectedCount: number | null;
19
+ readonly fillDelayRemainingMs: number | null;
20
+ readonly fillTargetCount: number | null;
21
+ readonly hasNextPage: boolean;
22
+ readonly hasPreviousPage: boolean;
23
+ readonly isAutoMode: boolean;
24
+ readonly itemCount: number;
25
+ readonly loadState: "failed" | "loaded" | "loading";
26
+ readonly mode: import("./removalState").VibeFeedMode | null;
27
+ readonly nextCursor: string | null;
28
+ readonly phase: import("./removalState").VibeLoadPhase;
29
+ readonly previousCursor: string | null;
30
+ readonly removedCount: number;
31
+ readonly surfaceMode: "fullscreen" | "list";
32
+ };
33
+ surfaceMode: import("vue").ComputedRef<VibeDesktopSurface>;
34
+ activeIndex: import("vue").ComputedRef<number>;
35
+ canRetryInitialLoad: import("vue").ComputedRef<boolean>;
36
+ clearRemoved: () => void;
37
+ commitPendingAppend: () => Promise<void>;
38
+ currentCursor: import("vue").ComputedRef<string | null>;
39
+ errorMessage: import("vue").ComputedRef<string | null>;
40
+ fillCollectedCount: import("vue").ComputedRef<number | null>;
41
+ fillDelayRemainingMs: import("vue").ComputedRef<number | null>;
42
+ fillTargetCount: import("vue").ComputedRef<number | null>;
43
+ getRemovedIds: () => string[];
44
+ hasNextPage: import("vue").ComputedRef<boolean>;
45
+ hasPreviousPage: import("vue").ComputedRef<boolean>;
46
+ isAutoMode: import("vue").ComputedRef<boolean>;
47
+ items: import("vue").ComputedRef<import("../viewer").VibeViewerItem[]>;
48
+ loading: import("vue").ComputedRef<boolean>;
49
+ mode: import("vue").ComputedRef<import("./removalState").VibeFeedMode | null>;
50
+ nextCursor: import("vue").ComputedRef<string | null>;
51
+ paginationDetail: import("vue").ComputedRef<string | null>;
52
+ pendingAppendItems: import("vue").ComputedRef<import("../viewer").VibeViewerItem[]>;
53
+ phase: import("vue").ComputedRef<import("./removalState").VibeLoadPhase>;
54
+ prefetchNextPage: () => Promise<void>;
55
+ prefetchPreviousPage: () => Promise<void>;
56
+ previousCursor: import("vue").ComputedRef<string | null>;
57
+ removedCount: import("vue").ComputedRef<number>;
58
+ remove: (ids: string | string[]) => {
59
+ ids: string[];
60
+ };
61
+ restore: (ids: string | string[]) => {
62
+ ids: string[];
63
+ };
64
+ retryInitialLoad: () => Promise<void>;
65
+ setActiveIndex: (nextIndex: number) => void;
66
+ setAutoPrefetchEnabled: (nextValue: boolean) => void;
67
+ undo: () => {
68
+ ids: string[];
69
+ } | null;
70
+ };
71
+ export {};