@wyxos/vibe 2.2.4 → 3.0.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 +451 -95
- package/lib/components/FullscreenHeader.vue.d.ts +25 -0
- package/lib/components/FullscreenMediaBar.vue.d.ts +14 -0
- package/lib/components/FullscreenSurface.vue.d.ts +46 -0
- package/lib/components/Layout.vue.d.ts +42 -0
- package/lib/components/ListCard.vue.d.ts +44 -0
- package/lib/components/ListSurface.vue.d.ts +64 -0
- package/lib/components/viewer-core/assetErrors.d.ts +30 -0
- package/lib/components/viewer-core/assetState.d.ts +12 -0
- package/lib/components/viewer-core/autoBuckets.d.ts +18 -0
- package/lib/components/viewer-core/autoResolveHelpers.d.ts +19 -0
- package/lib/components/viewer-core/autoResolveState.d.ts +50 -0
- package/lib/components/viewer-core/dom.d.ts +2 -0
- package/lib/components/viewer-core/fillDelay.d.ts +9 -0
- package/lib/components/viewer-core/format.d.ts +1 -0
- package/lib/components/viewer-core/itemIdentity.d.ts +6 -0
- package/lib/components/viewer-core/listCardAsset.d.ts +4 -0
- package/lib/components/viewer-core/listPreview.d.ts +10 -0
- package/lib/components/viewer-core/loadError.d.ts +4 -0
- package/lib/components/viewer-core/masonryLayout.d.ts +37 -0
- package/lib/components/viewer-core/masonryViewport.d.ts +7 -0
- package/lib/components/viewer-core/media.d.ts +4 -0
- package/lib/components/viewer-core/mediaPlayback.d.ts +1 -0
- package/lib/components/viewer-core/removalState.d.ts +50 -0
- package/lib/components/viewer-core/slotContent.d.ts +2 -0
- package/lib/components/viewer-core/surfaceSlots.d.ts +22 -0
- package/lib/components/viewer-core/theme.d.ts +3 -0
- package/lib/components/viewer-core/useActivation.d.ts +8 -0
- package/lib/components/viewer-core/useAssetLoadQueue.d.ts +22 -0
- package/lib/components/viewer-core/useAutoResolveSource.d.ts +51 -0
- package/lib/components/viewer-core/useController.d.ts +71 -0
- package/lib/components/viewer-core/useDataSource.d.ts +100 -0
- package/lib/components/viewer-core/useEdgeBoundary.d.ts +16 -0
- package/lib/components/viewer-core/useFullscreen.d.ts +1 -0
- package/lib/components/viewer-core/useMasonryList.d.ts +43 -0
- package/lib/components/viewer-core/useMasonryMotion.d.ts +29 -0
- package/lib/components/viewer-core/useMedia.d.ts +39 -0
- package/lib/components/viewer-core/useViewer.d.ts +61 -0
- package/lib/components/viewer-core/virtualization.d.ts +14 -0
- package/lib/components/viewer.d.ts +16 -0
- package/lib/index.cjs +1 -1
- package/lib/index.d.ts +58 -5
- package/lib/index.js +3196 -1485
- package/lib/style.css +3 -0
- package/package.json +86 -83
- package/lib/App.vue.d.ts +0 -3
- package/lib/apple-touch-icon-114x114.png +0 -0
- package/lib/apple-touch-icon-120x120.png +0 -0
- package/lib/apple-touch-icon-144x144.png +0 -0
- package/lib/apple-touch-icon-152x152.png +0 -0
- package/lib/apple-touch-icon-180x180.png +0 -0
- package/lib/apple-touch-icon-57x57.png +0 -0
- package/lib/apple-touch-icon-60x60.png +0 -0
- package/lib/apple-touch-icon-72x72.png +0 -0
- package/lib/apple-touch-icon-76x76.png +0 -0
- package/lib/components/Masonry.vue.d.ts +0 -68
- package/lib/components/MasonryItem.vue.d.ts +0 -3
- package/lib/components/MasonryLoader.vue.d.ts +0 -27
- package/lib/components/MasonryVideoControls.vue.d.ts +0 -30
- package/lib/components/masonryItemRegistry.d.ts +0 -24
- package/lib/favicon-128x128.png +0 -0
- package/lib/favicon-16x16.png +0 -0
- package/lib/favicon-256x256.png +0 -0
- package/lib/favicon-32x32.png +0 -0
- package/lib/favicon-48x48.png +0 -0
- package/lib/favicon-64x64.png +0 -0
- package/lib/favicon.ico +0 -0
- package/lib/logo-dark.svg +0 -36
- package/lib/logo-light.svg +0 -29
- package/lib/logo.svg +0 -32
- package/lib/manifest.json +0 -41
- package/lib/masonry/backfill.d.ts +0 -53
- package/lib/masonry/layout.d.ts +0 -13
- package/lib/masonry/layoutEngine.d.ts +0 -33
- package/lib/masonry/types.d.ts +0 -95
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import type { VibeViewerItem } from '../viewer';
|
|
2
|
+
export type { VibeHandle, VibeRemoveResult } from './removalState';
|
|
3
|
+
export type { VibeFeedMode, VibeLoadPhase } from './removalState';
|
|
4
|
+
export interface VibeResolveParams {
|
|
5
|
+
cursor: string | null;
|
|
6
|
+
pageSize: number;
|
|
7
|
+
signal?: AbortSignal;
|
|
8
|
+
}
|
|
9
|
+
export interface VibeResolveResult {
|
|
10
|
+
items: VibeViewerItem[];
|
|
11
|
+
nextPage: string | null;
|
|
12
|
+
previousPage?: string | null;
|
|
13
|
+
}
|
|
14
|
+
export interface VibeInitialState {
|
|
15
|
+
items: VibeViewerItem[];
|
|
16
|
+
cursor: string | null;
|
|
17
|
+
nextCursor?: string | null;
|
|
18
|
+
previousCursor?: string | null;
|
|
19
|
+
activeIndex?: number;
|
|
20
|
+
}
|
|
21
|
+
interface VibeSharedProps {
|
|
22
|
+
hasPreviousPage?: boolean;
|
|
23
|
+
paginationDetail?: string | null;
|
|
24
|
+
requestNextPage?: (() => void | Promise<void>) | null;
|
|
25
|
+
requestPreviousPage?: (() => void | Promise<void>) | null;
|
|
26
|
+
}
|
|
27
|
+
export interface VibeControlledProps extends VibeSharedProps {
|
|
28
|
+
items: VibeViewerItem[];
|
|
29
|
+
activeIndex?: number;
|
|
30
|
+
fillDelayMs?: never;
|
|
31
|
+
fillDelayStepMs?: never;
|
|
32
|
+
initialState?: never;
|
|
33
|
+
loading?: boolean;
|
|
34
|
+
hasNextPage?: boolean;
|
|
35
|
+
mode?: never;
|
|
36
|
+
resolve?: never;
|
|
37
|
+
initialCursor?: never;
|
|
38
|
+
pageSize?: never;
|
|
39
|
+
}
|
|
40
|
+
export interface VibeAutoProps {
|
|
41
|
+
resolve: (params: VibeResolveParams) => Promise<VibeResolveResult>;
|
|
42
|
+
fillDelayMs?: number;
|
|
43
|
+
fillDelayStepMs?: number;
|
|
44
|
+
initialCursor?: string | null;
|
|
45
|
+
initialState?: VibeInitialState;
|
|
46
|
+
mode?: import('./removalState').VibeFeedMode;
|
|
47
|
+
pageSize?: number;
|
|
48
|
+
items?: never;
|
|
49
|
+
activeIndex?: never;
|
|
50
|
+
hasPreviousPage?: never;
|
|
51
|
+
loading?: never;
|
|
52
|
+
hasNextPage?: never;
|
|
53
|
+
paginationDetail?: never;
|
|
54
|
+
requestNextPage?: never;
|
|
55
|
+
requestPreviousPage?: never;
|
|
56
|
+
}
|
|
57
|
+
export type VibeProps = VibeControlledProps | VibeAutoProps;
|
|
58
|
+
export type VibeEmit = (event: 'update:activeIndex', value: number) => void;
|
|
59
|
+
export declare function useDataSource(props: Readonly<VibeProps>, emit: VibeEmit): {
|
|
60
|
+
activeIndex: import("vue").ComputedRef<number>;
|
|
61
|
+
canRetryInitialLoad: import("vue").ComputedRef<boolean>;
|
|
62
|
+
cancel: () => void;
|
|
63
|
+
clearRemoved: () => void;
|
|
64
|
+
commitPendingAppend: () => Promise<void>;
|
|
65
|
+
currentCursor: import("vue").ComputedRef<string | null>;
|
|
66
|
+
errorMessage: import("vue").ComputedRef<string | null>;
|
|
67
|
+
fillCollectedCount: import("vue").ComputedRef<number | null>;
|
|
68
|
+
fillDelayRemainingMs: import("vue").ComputedRef<number | null>;
|
|
69
|
+
fillTargetCount: import("vue").ComputedRef<number | null>;
|
|
70
|
+
getRemovedIds: () => string[];
|
|
71
|
+
hasNextPage: import("vue").ComputedRef<boolean>;
|
|
72
|
+
hasPreviousPage: import("vue").ComputedRef<boolean>;
|
|
73
|
+
isAutoMode: import("vue").ComputedRef<boolean>;
|
|
74
|
+
items: import("vue").ComputedRef<VibeViewerItem[]>;
|
|
75
|
+
loading: import("vue").ComputedRef<boolean>;
|
|
76
|
+
loadNext: () => Promise<void>;
|
|
77
|
+
loadPrevious: () => Promise<void>;
|
|
78
|
+
mode: import("vue").ComputedRef<import("./removalState").VibeFeedMode | null>;
|
|
79
|
+
nextCursor: import("vue").ComputedRef<string | null>;
|
|
80
|
+
paginationDetail: import("vue").ComputedRef<string | null>;
|
|
81
|
+
pendingAppendItems: import("vue").ComputedRef<VibeViewerItem[]>;
|
|
82
|
+
phase: import("vue").ComputedRef<import("./removalState").VibeLoadPhase>;
|
|
83
|
+
prefetchNextPage: () => Promise<void>;
|
|
84
|
+
prefetchPreviousPage: () => Promise<void>;
|
|
85
|
+
previousCursor: import("vue").ComputedRef<string | null>;
|
|
86
|
+
removedCount: import("vue").ComputedRef<number>;
|
|
87
|
+
remove: (ids: string | string[]) => {
|
|
88
|
+
ids: string[];
|
|
89
|
+
};
|
|
90
|
+
restore: (ids: string | string[]) => {
|
|
91
|
+
ids: string[];
|
|
92
|
+
};
|
|
93
|
+
retry: () => Promise<void>;
|
|
94
|
+
retryInitialLoad: () => Promise<void>;
|
|
95
|
+
setActiveIndex: (nextIndex: number) => void;
|
|
96
|
+
setAutoPrefetchEnabled: (nextValue: boolean) => void;
|
|
97
|
+
undo: () => {
|
|
98
|
+
ids: string[];
|
|
99
|
+
} | null;
|
|
100
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type Ref } from 'vue';
|
|
2
|
+
export type VibeMasonryEdgeDirection = 'bottom' | 'top';
|
|
3
|
+
export declare function useEdgeBoundary(options: {
|
|
4
|
+
direction: VibeMasonryEdgeDirection;
|
|
5
|
+
hasPage: Ref<boolean>;
|
|
6
|
+
isAtBoundary: () => boolean;
|
|
7
|
+
loading: Ref<boolean>;
|
|
8
|
+
requestPage: Ref<(() => void | Promise<void>) | null | undefined>;
|
|
9
|
+
getAnimationLockMs: (addedItemCount: number) => number;
|
|
10
|
+
}): {
|
|
11
|
+
maybeRequestPage: () => void;
|
|
12
|
+
onItemsMutated: (addedItemCount: number) => void;
|
|
13
|
+
onLoadingChange: (isLoading: boolean) => void;
|
|
14
|
+
onWheel: (event: WheelEvent) => void;
|
|
15
|
+
syncBoundary: () => void;
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useViewer as useFullscreen } from './useViewer';
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type Ref } from 'vue';
|
|
2
|
+
import type { VibeViewerItem } from '../viewer';
|
|
3
|
+
export declare function useVibeMasonryList(options: {
|
|
4
|
+
active: Ref<boolean>;
|
|
5
|
+
items: Ref<VibeViewerItem[]>;
|
|
6
|
+
activeIndex: Ref<number>;
|
|
7
|
+
loading: Ref<boolean>;
|
|
8
|
+
hasNextPage: Ref<boolean>;
|
|
9
|
+
hasPreviousPage: Ref<boolean>;
|
|
10
|
+
paginationDetail: Ref<string | null>;
|
|
11
|
+
pendingAppendItems: Ref<VibeViewerItem[]>;
|
|
12
|
+
commitPendingAppend: Ref<(() => void | Promise<void>) | null | undefined>;
|
|
13
|
+
requestNextPage: Ref<(() => void | Promise<void>) | null | undefined>;
|
|
14
|
+
requestPreviousPage: Ref<(() => void | Promise<void>) | null | undefined>;
|
|
15
|
+
restoreToken: Ref<number>;
|
|
16
|
+
setActiveIndex: (index: number) => void;
|
|
17
|
+
}): {
|
|
18
|
+
columnWidth: import("vue").ComputedRef<number>;
|
|
19
|
+
containerHeight: import("vue").ComputedRef<number>;
|
|
20
|
+
footerStatusMessage: import("vue").ComputedRef<"Loading the first page" | "Loading more items" | "End of list" | null>;
|
|
21
|
+
getCardStyle: (index: number) => {
|
|
22
|
+
height: string;
|
|
23
|
+
width: string;
|
|
24
|
+
transition: string | undefined;
|
|
25
|
+
transitionDelay: string | undefined;
|
|
26
|
+
transform: string;
|
|
27
|
+
};
|
|
28
|
+
getScrollbarThumbStyle: () => {
|
|
29
|
+
height: string;
|
|
30
|
+
transform: string;
|
|
31
|
+
};
|
|
32
|
+
onScroll: () => void;
|
|
33
|
+
onWheel: (event: WheelEvent) => void;
|
|
34
|
+
paginationLabel: import("vue").ComputedRef<string>;
|
|
35
|
+
renderedItems: import("vue").ComputedRef<{
|
|
36
|
+
item: VibeViewerItem;
|
|
37
|
+
index: number;
|
|
38
|
+
}[]>;
|
|
39
|
+
resolvedActiveIndex: import("vue").ComputedRef<number>;
|
|
40
|
+
scrollToIndex: (index: number, alignment: "center" | "nearest") => void;
|
|
41
|
+
showScrollbar: import("vue").ComputedRef<boolean>;
|
|
42
|
+
scrollViewportRef: Ref<HTMLElement | null, HTMLElement | null>;
|
|
43
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type ComputedRef, type Ref } from 'vue';
|
|
2
|
+
import type { VibeViewerItem } from '../viewer';
|
|
3
|
+
import type { LayoutPosition } from './masonryLayout';
|
|
4
|
+
export type VibeMasonryEnterDirection = 'bottom' | 'top';
|
|
5
|
+
export declare function getVibeMasonryEnterOrder(itemIds: string[], direction: VibeMasonryEnterDirection): string[];
|
|
6
|
+
export declare function getVibeMasonryEnterDuration(itemCount: number): number;
|
|
7
|
+
export declare function getVibeMasonryEnterStartY(options: {
|
|
8
|
+
direction: VibeMasonryEnterDirection;
|
|
9
|
+
itemHeight: number;
|
|
10
|
+
columnWidth: number;
|
|
11
|
+
scrollTop: number;
|
|
12
|
+
viewportHeight: number;
|
|
13
|
+
}): number;
|
|
14
|
+
export declare function useMasonryMotion(options: {
|
|
15
|
+
items: Ref<VibeViewerItem[]>;
|
|
16
|
+
visibleIndices: ComputedRef<number[]>;
|
|
17
|
+
positions: Ref<LayoutPosition[]>;
|
|
18
|
+
heights: Ref<number[]>;
|
|
19
|
+
indexById: Ref<Map<string, number>>;
|
|
20
|
+
columnWidth: ComputedRef<number>;
|
|
21
|
+
scrollTop: Ref<number>;
|
|
22
|
+
viewportHeight: Ref<number>;
|
|
23
|
+
}): {
|
|
24
|
+
getCardTransform: (index: number) => string;
|
|
25
|
+
getCardTransition: (itemId: string) => string | undefined;
|
|
26
|
+
getCardTransitionDelay: (itemId: string) => string | undefined;
|
|
27
|
+
markEnter: (items: VibeViewerItem[], direction?: VibeMasonryEnterDirection) => void;
|
|
28
|
+
playFlipMoveAnimation: (oldPositionsById: Map<string, LayoutPosition>, skipIds?: Set<string>, durationMs?: number) => void;
|
|
29
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type Ref } from 'vue';
|
|
2
|
+
import type { VibeViewerItem } from '../viewer';
|
|
3
|
+
import type { VibeAssetErrorReporter, VibeAssetLoadReporter } from './assetErrors';
|
|
4
|
+
import { type MediaUiState } from './assetState';
|
|
5
|
+
import { type VibeAssetErrorKind } from './loadError';
|
|
6
|
+
export declare function useMedia(options: {
|
|
7
|
+
activeItem: Ref<VibeViewerItem | null>;
|
|
8
|
+
activeMediaItem: Ref<VibeViewerItem | null>;
|
|
9
|
+
isEnabled: Ref<boolean>;
|
|
10
|
+
itemCount: Ref<number>;
|
|
11
|
+
onAssetError?: VibeAssetErrorReporter;
|
|
12
|
+
onAssetLoad?: VibeAssetLoadReporter;
|
|
13
|
+
}): {
|
|
14
|
+
activeAssetErrorKind: import("vue").ComputedRef<VibeAssetErrorKind | null>;
|
|
15
|
+
activeMediaDuration: import("vue").ComputedRef<number>;
|
|
16
|
+
activeMediaProgress: import("vue").ComputedRef<number>;
|
|
17
|
+
activeMediaState: import("vue").ComputedRef<MediaUiState>;
|
|
18
|
+
getAssetErrorKind: (id: string) => VibeAssetErrorKind | null;
|
|
19
|
+
getAssetErrorLabel: (id: string) => "404" | "Load error" | null;
|
|
20
|
+
getAssetRenderKey: (id: string) => string;
|
|
21
|
+
getImageSource: (item: VibeViewerItem) => string;
|
|
22
|
+
isImageReady: (id: string) => boolean;
|
|
23
|
+
isMediaReady: (id: string) => boolean;
|
|
24
|
+
canRetryAsset: (id: string) => boolean;
|
|
25
|
+
mediaStates: Ref<Record<string, MediaUiState>, Record<string, MediaUiState>>;
|
|
26
|
+
onAudioCoverClick: (event: MouseEvent, id: string, suppressMediaToggleUntil: number) => void;
|
|
27
|
+
onImageError: (id: string, url: string) => Promise<void>;
|
|
28
|
+
onImageLoad: (id: string, url: string) => void;
|
|
29
|
+
onMediaError: (id: string, url: string) => Promise<void>;
|
|
30
|
+
onMediaEvent: (id: string, event: Event) => void;
|
|
31
|
+
onMediaSeekInput: (event: Event) => void;
|
|
32
|
+
onVideoClick: (event: MouseEvent, id: string, suppressMediaToggleUntil: number) => void;
|
|
33
|
+
registerAudioElement: (id: string, element: unknown) => void;
|
|
34
|
+
registerImageElement: (id: string, element: unknown) => void;
|
|
35
|
+
registerVideoElement: (id: string, element: unknown) => void;
|
|
36
|
+
resetMediaState: () => void;
|
|
37
|
+
retryAsset: (id: string) => Promise<void>;
|
|
38
|
+
syncMediaPlayback: () => Promise<void>;
|
|
39
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { type Ref } from 'vue';
|
|
2
|
+
import type { VibeAssetErrorReporter, VibeAssetLoadReporter } from './assetErrors';
|
|
3
|
+
import { formatPlaybackTime } from './format';
|
|
4
|
+
import { type VibeProps } from './useDataSource';
|
|
5
|
+
export type { VibeResolveParams, VibeResolveResult, VibeAutoProps, VibeControlledProps, VibeEmit, VibeFeedMode, VibeHandle, VibeInitialState, VibeLoadPhase, VibeProps, } from './useDataSource';
|
|
6
|
+
export type { VibeAssetErrorKind } from './loadError';
|
|
7
|
+
export type { VibeStatus } from './removalState';
|
|
8
|
+
export type { VibeAssetErrorEvent, VibeAssetErrorReporter, VibeAssetErrorSurface, VibeAssetLoadEvent, VibeAssetLoadReporter, VibeAssetLoadSurface } from './assetErrors';
|
|
9
|
+
export declare function useViewer(props: Readonly<VibeProps>, emit: (event: 'update:activeIndex', value: number) => void, options?: {
|
|
10
|
+
enabled?: Ref<boolean>;
|
|
11
|
+
onAssetError?: VibeAssetErrorReporter;
|
|
12
|
+
onAssetLoad?: VibeAssetLoadReporter;
|
|
13
|
+
}): {
|
|
14
|
+
activeItem: import("vue").ComputedRef<import("../viewer").VibeViewerItem>;
|
|
15
|
+
activeAssetErrorKind: import("vue").ComputedRef<import("./loadError").VibeAssetErrorKind | null>;
|
|
16
|
+
activeMediaDuration: import("vue").ComputedRef<number>;
|
|
17
|
+
activeMediaItem: import("vue").ComputedRef<import("../viewer").VibeViewerItem | null>;
|
|
18
|
+
activeMediaProgress: import("vue").ComputedRef<number>;
|
|
19
|
+
activeMediaState: import("vue").ComputedRef<import("./assetState").MediaUiState>;
|
|
20
|
+
canRetryAsset: (id: string) => boolean;
|
|
21
|
+
canRetryInitialLoad: import("vue").ComputedRef<boolean>;
|
|
22
|
+
errorMessage: import("vue").ComputedRef<string | null>;
|
|
23
|
+
getAssetErrorKind: (id: string) => import("./loadError").VibeAssetErrorKind | null;
|
|
24
|
+
getAssetErrorLabel: (id: string) => "404" | "Load error" | null;
|
|
25
|
+
getAssetRenderKey: (id: string) => string;
|
|
26
|
+
formatPlaybackTime: typeof formatPlaybackTime;
|
|
27
|
+
getImageSource: (item: import("../viewer").VibeViewerItem) => string;
|
|
28
|
+
getSlideStyle: (index: number) => import("vue").CSSProperties;
|
|
29
|
+
hasNextPage: import("vue").ComputedRef<boolean>;
|
|
30
|
+
isAtEnd: import("vue").ComputedRef<boolean>;
|
|
31
|
+
isAudio: (item: import("../viewer").VibeViewerItem) => boolean;
|
|
32
|
+
isVisual: (item: import("../viewer").VibeViewerItem) => boolean;
|
|
33
|
+
items: import("vue").ComputedRef<import("../viewer").VibeViewerItem[]>;
|
|
34
|
+
loading: import("vue").ComputedRef<boolean>;
|
|
35
|
+
mediaStates: Ref<Record<string, import("./assetState").MediaUiState>, Record<string, import("./assetState").MediaUiState>>;
|
|
36
|
+
isImageReady: (id: string) => boolean;
|
|
37
|
+
isMediaReady: (id: string) => boolean;
|
|
38
|
+
onAudioCoverClick: (event: MouseEvent, id: string) => void;
|
|
39
|
+
onImageError: (id: string, url: string) => Promise<void>;
|
|
40
|
+
onImageLoad: (id: string, url: string) => void;
|
|
41
|
+
onMediaEvent: (id: string, event: Event) => void;
|
|
42
|
+
onMediaError: (id: string, url: string) => Promise<void>;
|
|
43
|
+
onMediaSeekInput: (event: Event) => void;
|
|
44
|
+
onPointerCancel: (event: PointerEvent) => void;
|
|
45
|
+
onPointerDown: (event: PointerEvent) => void;
|
|
46
|
+
onPointerMove: (event: PointerEvent) => void;
|
|
47
|
+
onPointerUp: (event: PointerEvent) => void;
|
|
48
|
+
onVideoClick: (event: MouseEvent, id: string) => void;
|
|
49
|
+
onWheel: (event: WheelEvent) => void;
|
|
50
|
+
registerAudioElement: (id: string, element: unknown) => void;
|
|
51
|
+
registerImageElement: (id: string, element: unknown) => void;
|
|
52
|
+
registerVideoElement: (id: string, element: unknown) => void;
|
|
53
|
+
renderedItems: import("vue").ComputedRef<import("./virtualization").VibeRenderedItem[]>;
|
|
54
|
+
renderedRange: import("vue").ComputedRef<import("./virtualization").VibeRenderedRange>;
|
|
55
|
+
resolvedActiveIndex: import("vue").ComputedRef<number>;
|
|
56
|
+
retryInitialLoad: () => Promise<void>;
|
|
57
|
+
retryAsset: (id: string) => Promise<void>;
|
|
58
|
+
stageRef: Ref<HTMLElement | null, HTMLElement | null>;
|
|
59
|
+
statusMessage: import("vue").ComputedRef<"Loading the first page" | "Loading more items" | "End of feed" | null>;
|
|
60
|
+
paginationDetail: import("vue").ComputedRef<string | null>;
|
|
61
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { CSSProperties } from 'vue';
|
|
2
|
+
import type { VibeViewerItem } from '../viewer';
|
|
3
|
+
export interface VibeRenderedRange {
|
|
4
|
+
start: number;
|
|
5
|
+
end: number;
|
|
6
|
+
}
|
|
7
|
+
export interface VibeRenderedItem {
|
|
8
|
+
item: VibeViewerItem;
|
|
9
|
+
index: number;
|
|
10
|
+
}
|
|
11
|
+
export declare const VIBE_WINDOW_OVERSCAN = 2;
|
|
12
|
+
export declare function getRenderedRange(activeIndex: number, totalItems: number, overscan?: number): VibeRenderedRange;
|
|
13
|
+
export declare function getRenderedItems(items: VibeViewerItem[], activeIndex: number, overscan?: number): VibeRenderedItem[];
|
|
14
|
+
export declare function getVirtualSlideStyle(index: number, activeIndex: number, viewportHeight: number, dragOffset: number, isDragging: boolean): CSSProperties;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type VibeViewerType = 'image' | 'video' | 'audio' | 'other';
|
|
2
|
+
export interface VibeViewerAsset {
|
|
3
|
+
url: string;
|
|
4
|
+
width?: number;
|
|
5
|
+
height?: number;
|
|
6
|
+
}
|
|
7
|
+
export interface VibeViewerItem {
|
|
8
|
+
id: string;
|
|
9
|
+
type: VibeViewerType;
|
|
10
|
+
title?: string;
|
|
11
|
+
url: string;
|
|
12
|
+
preview?: VibeViewerAsset;
|
|
13
|
+
width?: number;
|
|
14
|
+
height?: number;
|
|
15
|
+
[key: string]: unknown;
|
|
16
|
+
}
|