@wyxos/vibe 3.0.4 → 3.0.5
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 +44 -48
- package/lib/components/FullscreenSurface.vue.d.ts +18 -7
- package/lib/components/Layout.vue.d.ts +5 -3
- package/lib/components/ListSurface.vue.d.ts +9 -5
- package/lib/components/viewer-core/autoResolveHelpers.d.ts +1 -1
- package/lib/components/viewer-core/removalState.d.ts +5 -4
- package/lib/components/viewer-core/surfaceSlots.d.ts +1 -1
- package/lib/components/viewer-core/surfaceStatus.d.ts +18 -0
- package/lib/components/viewer-core/useController.d.ts +11 -14
- package/lib/components/viewer-core/useDataSource.d.ts +17 -41
- package/lib/components/viewer-core/useMasonryList.d.ts +0 -2
- package/lib/components/viewer-core/useViewer.d.ts +22 -10
- package/lib/index.cjs +1 -1
- package/lib/index.d.ts +10 -5
- package/lib/index.js +997 -980
- package/lib/style.css +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -65,7 +65,7 @@ async function resolve({ cursor, pageSize }: VibeResolveParams): Promise<VibeRes
|
|
|
65
65
|
</template>
|
|
66
66
|
```
|
|
67
67
|
|
|
68
|
-
Optional
|
|
68
|
+
Optional pacing props:
|
|
69
69
|
|
|
70
70
|
```vue
|
|
71
71
|
<VibeLayout
|
|
@@ -74,6 +74,7 @@ Optional auto-mode pacing props:
|
|
|
74
74
|
:fill-delay-step-ms="1000"
|
|
75
75
|
:show-end-badge="false"
|
|
76
76
|
:show-status-badges="false"
|
|
77
|
+
surface-mode="fullscreen"
|
|
77
78
|
/>
|
|
78
79
|
```
|
|
79
80
|
|
|
@@ -81,9 +82,10 @@ Optional auto-mode pacing props:
|
|
|
81
82
|
- `fill-delay-step-ms`: extra delay added for each additional chained fill request in the same fill cycle
|
|
82
83
|
- defaults: `2000` and `1000`
|
|
83
84
|
- `show-end-badge`: controls the fullscreen `End reached` badge when the feed is exhausted
|
|
84
|
-
- `show-status-badges`: controls the built-in
|
|
85
|
+
- `show-status-badges`: controls the built-in lifecycle status overlays in list and fullscreen
|
|
86
|
+
- `surface-mode`: optionally lets the parent drive the desktop fullscreen/list surface explicitly
|
|
85
87
|
|
|
86
|
-
Optional
|
|
88
|
+
Optional feed strategy:
|
|
87
89
|
|
|
88
90
|
```vue
|
|
89
91
|
<VibeLayout
|
|
@@ -95,12 +97,30 @@ Optional auto-mode feed strategy:
|
|
|
95
97
|
- `dynamic` is the default
|
|
96
98
|
- `static` reloads the current boundary cursor before advancing when the currently visible boundary page is underfilled
|
|
97
99
|
|
|
100
|
+
Optional seeded hydration:
|
|
101
|
+
|
|
102
|
+
```vue
|
|
103
|
+
<VibeLayout
|
|
104
|
+
:resolve="resolve"
|
|
105
|
+
:initial-state="{
|
|
106
|
+
cursor: 'page-10',
|
|
107
|
+
items: restoredItems,
|
|
108
|
+
nextCursor: 'page-11',
|
|
109
|
+
previousCursor: 'page-9',
|
|
110
|
+
activeIndex: 4,
|
|
111
|
+
}"
|
|
112
|
+
/>
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
- use `initialState` when the app already knows a restored slice of the feed
|
|
116
|
+
- `resolve` is optional if you only need a seeded snapshot
|
|
117
|
+
- when `resolve` is present, Vibe continues paging from the seeded cursors
|
|
118
|
+
|
|
98
119
|
## What Vibe does
|
|
99
120
|
|
|
100
121
|
- Desktop masonry list with virtualization and staged page growth
|
|
101
122
|
- Fullscreen viewer with swipe, wheel, keyboard, and custom media controls
|
|
102
|
-
-
|
|
103
|
-
- Controlled mode for advanced/manual integrations
|
|
123
|
+
- Library-owned loading and pagination, optionally seeded from `initialState`
|
|
104
124
|
- Remove, restore, and undo by item `id`
|
|
105
125
|
- Grid customization through slots for icons, overlays, and footer UI
|
|
106
126
|
- Built-in loading and preload error states, including explicit `404` when known
|
|
@@ -134,9 +154,7 @@ Notes:
|
|
|
134
154
|
- Grid layout prefers `preview.width/height`, then root `width/height`, then a square fallback tile
|
|
135
155
|
- `other` is intentionally broad so the consuming app can layer its own subtypes and icon logic on top
|
|
136
156
|
|
|
137
|
-
## Loading
|
|
138
|
-
|
|
139
|
-
### Auto mode
|
|
157
|
+
## Loading
|
|
140
158
|
|
|
141
159
|
Use `resolve` when you want Vibe to own the paging loop:
|
|
142
160
|
|
|
@@ -172,7 +190,7 @@ async function resolve({ cursor, pageSize }: VibeResolveParams): Promise<VibeRes
|
|
|
172
190
|
</template>
|
|
173
191
|
```
|
|
174
192
|
|
|
175
|
-
|
|
193
|
+
Vibe owns:
|
|
176
194
|
|
|
177
195
|
- loaded items
|
|
178
196
|
- active index
|
|
@@ -181,7 +199,7 @@ In this mode, Vibe owns:
|
|
|
181
199
|
- duplicate cursor protection
|
|
182
200
|
- initial retry state
|
|
183
201
|
|
|
184
|
-
|
|
202
|
+
Vibe also supports two feed strategies:
|
|
185
203
|
|
|
186
204
|
- `dynamic`:
|
|
187
205
|
- default behavior
|
|
@@ -195,43 +213,19 @@ Auto mode also supports two feed strategies:
|
|
|
195
213
|
- if it is, Vibe reloads that same cursor in place first
|
|
196
214
|
- only once that boundary page is full again will the next edge hit advance to the next or previous cursor
|
|
197
215
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
Use controlled mode when the app needs to own item aggregation or paging policy:
|
|
216
|
+
You can also seed the viewer from a known snapshot:
|
|
201
217
|
|
|
202
218
|
```vue
|
|
203
|
-
<
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
async function requestNextPage() {
|
|
214
|
-
// app-owned fetch and append
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
async function requestPreviousPage() {
|
|
218
|
-
// app-owned fetch and prepend
|
|
219
|
-
}
|
|
220
|
-
</script>
|
|
221
|
-
|
|
222
|
-
<template>
|
|
223
|
-
<VibeLayout
|
|
224
|
-
:items="items"
|
|
225
|
-
:active-index="activeIndex"
|
|
226
|
-
:loading="loading"
|
|
227
|
-
:has-next-page="hasNextPage"
|
|
228
|
-
:has-previous-page="hasPreviousPage"
|
|
229
|
-
pagination-detail="P10-12 · V11"
|
|
230
|
-
:request-next-page="requestNextPage"
|
|
231
|
-
:request-previous-page="requestPreviousPage"
|
|
232
|
-
@update:active-index="activeIndex = $event"
|
|
233
|
-
/>
|
|
234
|
-
</template>
|
|
219
|
+
<VibeLayout
|
|
220
|
+
:resolve="resolve"
|
|
221
|
+
:initial-state="{
|
|
222
|
+
cursor: 'page-10',
|
|
223
|
+
items: restoredItems,
|
|
224
|
+
nextCursor: 'page-11',
|
|
225
|
+
previousCursor: 'page-9',
|
|
226
|
+
activeIndex: 4,
|
|
227
|
+
}"
|
|
228
|
+
/>
|
|
235
229
|
```
|
|
236
230
|
|
|
237
231
|
## Slots
|
|
@@ -329,14 +323,14 @@ type VibeStatus = {
|
|
|
329
323
|
fillTargetCount: number | null
|
|
330
324
|
hasNextPage: boolean
|
|
331
325
|
hasPreviousPage: boolean
|
|
332
|
-
isAutoMode: boolean
|
|
333
326
|
itemCount: number
|
|
334
327
|
loadState: 'failed' | 'loaded' | 'loading'
|
|
335
|
-
mode: 'dynamic' | 'static'
|
|
328
|
+
mode: 'dynamic' | 'static'
|
|
336
329
|
nextCursor: string | null
|
|
337
|
-
phase: 'failed' | 'filling' | 'idle' | 'loading' | '
|
|
330
|
+
phase: 'failed' | 'filling' | 'idle' | 'initializing' | 'loading' | 'refreshing'
|
|
338
331
|
previousCursor: string | null
|
|
339
332
|
removedCount: number
|
|
333
|
+
removedIds: readonly string[]
|
|
340
334
|
surfaceMode: 'fullscreen' | 'list'
|
|
341
335
|
}
|
|
342
336
|
```
|
|
@@ -347,6 +341,7 @@ Example:
|
|
|
347
341
|
vibe.value?.remove(['item-2', 'item-5'])
|
|
348
342
|
vibe.value?.undo()
|
|
349
343
|
console.log(vibe.value?.status.itemCount)
|
|
344
|
+
console.log(vibe.value?.status.removedIds)
|
|
350
345
|
```
|
|
351
346
|
|
|
352
347
|
## Events
|
|
@@ -354,6 +349,7 @@ console.log(vibe.value?.status.itemCount)
|
|
|
354
349
|
`VibeLayout` emits:
|
|
355
350
|
|
|
356
351
|
- `update:activeIndex`
|
|
352
|
+
- `update:surfaceMode`
|
|
357
353
|
- `asset-loads`
|
|
358
354
|
- `asset-errors`
|
|
359
355
|
|
|
@@ -2,14 +2,23 @@ import type { Component } from 'vue';
|
|
|
2
2
|
import type { VibeViewerItem } from './viewer';
|
|
3
3
|
import type { VibeAssetErrorReporter, VibeAssetLoadReporter } from './viewer-core/assetErrors';
|
|
4
4
|
import type { VibeFullscreenStatusSlotProps, VibeSurfaceSlotProps } from './viewer-core/surfaceSlots';
|
|
5
|
-
import type {
|
|
5
|
+
import type { VibeLoadPhase } from './viewer-core/useViewer';
|
|
6
6
|
import './viewer-core/fullscreenMediaBar.css';
|
|
7
|
-
|
|
7
|
+
interface FullscreenSurfaceProps {
|
|
8
8
|
active?: boolean;
|
|
9
|
+
activeIndex?: number;
|
|
10
|
+
errorMessage?: string | null;
|
|
11
|
+
hasNextPage?: boolean;
|
|
12
|
+
items: VibeViewerItem[];
|
|
13
|
+
loading?: boolean;
|
|
14
|
+
paginationDetail?: string | null;
|
|
15
|
+
phase?: VibeLoadPhase | null;
|
|
9
16
|
reportAssetError?: VibeAssetErrorReporter | null;
|
|
10
17
|
reportAssetLoad?: VibeAssetLoadReporter | null;
|
|
11
18
|
showBackToList?: boolean;
|
|
12
|
-
|
|
19
|
+
showEndBadge?: boolean;
|
|
20
|
+
showStatusBadges?: boolean;
|
|
21
|
+
}
|
|
13
22
|
type __VLS_Slots = {
|
|
14
23
|
'fullscreen-aside'?: (props: VibeSurfaceSlotProps) => unknown;
|
|
15
24
|
'fullscreen-header-actions'?: (props: VibeSurfaceSlotProps) => unknown;
|
|
@@ -20,19 +29,21 @@ type __VLS_Slots = {
|
|
|
20
29
|
item: VibeViewerItem;
|
|
21
30
|
}) => unknown;
|
|
22
31
|
};
|
|
23
|
-
declare const __VLS_base: import("vue").DefineComponent<
|
|
32
|
+
declare const __VLS_base: import("vue").DefineComponent<FullscreenSurfaceProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
24
33
|
"update:activeIndex": (value: number) => any;
|
|
25
34
|
"back-to-list": () => any;
|
|
26
|
-
}, string, import("vue").PublicProps, Readonly<
|
|
35
|
+
}, string, import("vue").PublicProps, Readonly<FullscreenSurfaceProps> & Readonly<{
|
|
27
36
|
"onUpdate:activeIndex"?: ((value: number) => any) | undefined;
|
|
28
37
|
"onBack-to-list"?: (() => any) | undefined;
|
|
29
38
|
}>, {
|
|
30
39
|
loading: boolean;
|
|
31
|
-
activeIndex: number;
|
|
32
|
-
hasNextPage: boolean;
|
|
33
40
|
paginationDetail: string | null;
|
|
34
41
|
showEndBadge: boolean;
|
|
35
42
|
showStatusBadges: boolean;
|
|
43
|
+
activeIndex: number;
|
|
44
|
+
errorMessage: string | null;
|
|
45
|
+
hasNextPage: boolean;
|
|
46
|
+
phase: VibeLoadPhase | null;
|
|
36
47
|
showBackToList: boolean;
|
|
37
48
|
active: boolean;
|
|
38
49
|
reportAssetError: VibeAssetErrorReporter | null;
|
|
@@ -2,7 +2,7 @@ import { type Component } from 'vue';
|
|
|
2
2
|
import type { VibeViewerItem } from './viewer';
|
|
3
3
|
import { type VibeAssetErrorEvent, type VibeAssetLoadEvent } from './viewer-core/assetErrors';
|
|
4
4
|
import type { VibeFullscreenStatusSlotProps, VibeGridStatusSlotProps, VibeSurfaceSlotProps } from './viewer-core/surfaceSlots';
|
|
5
|
-
import type { VibeHandle } from './viewer-core/useViewer';
|
|
5
|
+
import type { VibeHandle, VibeProps } from './viewer-core/useViewer';
|
|
6
6
|
type __VLS_Slots = {
|
|
7
7
|
'fullscreen-aside'?: (props: VibeSurfaceSlotProps) => unknown;
|
|
8
8
|
'fullscreen-header-actions'?: (props: VibeSurfaceSlotProps) => unknown;
|
|
@@ -23,12 +23,14 @@ type __VLS_Slots = {
|
|
|
23
23
|
item: VibeViewerItem;
|
|
24
24
|
}) => unknown;
|
|
25
25
|
};
|
|
26
|
-
declare const __VLS_base: import("vue").DefineComponent<
|
|
26
|
+
declare const __VLS_base: import("vue").DefineComponent<VibeProps, VibeHandle, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
27
27
|
"update:activeIndex": (value: number) => any;
|
|
28
|
+
"update:surfaceMode": (value: "fullscreen" | "list") => any;
|
|
28
29
|
"asset-errors": (errors: VibeAssetErrorEvent[]) => any;
|
|
29
30
|
"asset-loads": (loads: VibeAssetLoadEvent[]) => any;
|
|
30
|
-
}, string, import("vue").PublicProps, Readonly<
|
|
31
|
+
}, string, import("vue").PublicProps, Readonly<VibeProps> & Readonly<{
|
|
31
32
|
"onUpdate:activeIndex"?: ((value: number) => any) | undefined;
|
|
33
|
+
"onUpdate:surfaceMode"?: ((value: "fullscreen" | "list") => any) | undefined;
|
|
32
34
|
"onAsset-errors"?: ((errors: VibeAssetErrorEvent[]) => any) | undefined;
|
|
33
35
|
"onAsset-loads"?: ((loads: VibeAssetLoadEvent[]) => any) | undefined;
|
|
34
36
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -2,22 +2,24 @@ import type { Component } from 'vue';
|
|
|
2
2
|
import type { VibeViewerItem } from './viewer';
|
|
3
3
|
import type { VibeAssetErrorReporter, VibeAssetLoadReporter } from './viewer-core/assetErrors';
|
|
4
4
|
import type { VibeGridStatusSlotProps } from './viewer-core/surfaceSlots';
|
|
5
|
+
import type { VibeLoadPhase } from './viewer-core/useViewer';
|
|
5
6
|
type __VLS_Props = {
|
|
6
7
|
active?: boolean;
|
|
7
8
|
activeIndex?: number;
|
|
8
9
|
allowExhaustedNextPageRefresh?: boolean;
|
|
9
10
|
commitPendingAppend?: (() => void | Promise<void>) | null;
|
|
11
|
+
errorMessage?: string | null;
|
|
10
12
|
hasNextPage?: boolean;
|
|
11
13
|
hasPreviousPage?: boolean;
|
|
12
14
|
items: VibeViewerItem[];
|
|
13
15
|
loading?: boolean;
|
|
14
16
|
pendingAppendItems?: VibeViewerItem[];
|
|
15
17
|
paginationDetail?: string | null;
|
|
18
|
+
phase?: VibeLoadPhase | null;
|
|
16
19
|
reportAssetError?: VibeAssetErrorReporter | null;
|
|
17
20
|
reportAssetLoad?: VibeAssetLoadReporter | null;
|
|
18
21
|
requestNextPage?: (() => void | Promise<void>) | null;
|
|
19
22
|
requestPreviousPage?: (() => void | Promise<void>) | null;
|
|
20
|
-
restoreToken: number;
|
|
21
23
|
showStatusBadges?: boolean;
|
|
22
24
|
};
|
|
23
25
|
type __VLS_Slots = {
|
|
@@ -44,19 +46,21 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
|
|
|
44
46
|
"onOpen-fullscreen"?: ((index: number) => any) | undefined;
|
|
45
47
|
}>, {
|
|
46
48
|
loading: boolean;
|
|
49
|
+
paginationDetail: string | null;
|
|
50
|
+
showStatusBadges: boolean;
|
|
47
51
|
activeIndex: number;
|
|
52
|
+
errorMessage: string | null;
|
|
48
53
|
hasNextPage: boolean;
|
|
54
|
+
phase: VibeLoadPhase | null;
|
|
49
55
|
hasPreviousPage: boolean;
|
|
50
|
-
paginationDetail: string | null;
|
|
51
|
-
requestNextPage: (() => void | Promise<void>) | null;
|
|
52
|
-
requestPreviousPage: (() => void | Promise<void>) | null;
|
|
53
|
-
showStatusBadges: boolean;
|
|
54
56
|
active: boolean;
|
|
55
57
|
reportAssetError: VibeAssetErrorReporter | null;
|
|
56
58
|
reportAssetLoad: VibeAssetLoadReporter | null;
|
|
57
59
|
allowExhaustedNextPageRefresh: boolean;
|
|
58
60
|
commitPendingAppend: (() => void | Promise<void>) | null;
|
|
59
61
|
pendingAppendItems: VibeViewerItem[];
|
|
62
|
+
requestNextPage: (() => void | Promise<void>) | null;
|
|
63
|
+
requestPreviousPage: (() => void | Promise<void>) | null;
|
|
60
64
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
61
65
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
62
66
|
declare const _default: typeof __VLS_export;
|
|
@@ -13,7 +13,7 @@ export type ResolveFn = (params: {
|
|
|
13
13
|
previousPage?: string | null;
|
|
14
14
|
}>;
|
|
15
15
|
export type VibeAutoDirection = 'backward' | 'forward';
|
|
16
|
-
export declare function isActiveLoadPhase(phase: VibeLoadPhase): phase is "filling" | "
|
|
16
|
+
export declare function isActiveLoadPhase(phase: VibeLoadPhase): phase is "filling" | "initializing" | "refreshing" | "loading";
|
|
17
17
|
export declare function normalizePageSize(value: number | undefined): number;
|
|
18
18
|
export declare function getCursorKey(cursor: string | null): string;
|
|
19
19
|
export declare function clamp(value: number, min: number, max: number): number;
|
|
@@ -2,7 +2,8 @@ export interface VibeRemoveResult {
|
|
|
2
2
|
ids: string[];
|
|
3
3
|
}
|
|
4
4
|
export type VibeFeedMode = 'dynamic' | 'static';
|
|
5
|
-
export type VibeLoadPhase = 'failed' | 'filling' | 'idle' | 'loading' | '
|
|
5
|
+
export type VibeLoadPhase = 'failed' | 'filling' | 'idle' | 'initializing' | 'loading' | 'refreshing';
|
|
6
|
+
export type VibeSurfaceMode = 'fullscreen' | 'list';
|
|
6
7
|
export interface VibeStatus {
|
|
7
8
|
activeIndex: number;
|
|
8
9
|
currentCursor: string | null;
|
|
@@ -12,15 +13,15 @@ export interface VibeStatus {
|
|
|
12
13
|
fillTargetCount: number | null;
|
|
13
14
|
hasNextPage: boolean;
|
|
14
15
|
hasPreviousPage: boolean;
|
|
15
|
-
isAutoMode: boolean;
|
|
16
16
|
itemCount: number;
|
|
17
17
|
loadState: 'failed' | 'loaded' | 'loading';
|
|
18
|
-
mode: VibeFeedMode
|
|
18
|
+
mode: VibeFeedMode;
|
|
19
19
|
nextCursor: string | null;
|
|
20
20
|
phase: VibeLoadPhase;
|
|
21
21
|
previousCursor: string | null;
|
|
22
22
|
removedCount: number;
|
|
23
|
-
|
|
23
|
+
removedIds: readonly string[];
|
|
24
|
+
surfaceMode: VibeSurfaceMode;
|
|
24
25
|
}
|
|
25
26
|
export interface VibeHandle {
|
|
26
27
|
cancel: () => void;
|
|
@@ -7,7 +7,7 @@ export type VibeSurfaceSlotProps = {
|
|
|
7
7
|
paginationDetail: string | null;
|
|
8
8
|
total: number;
|
|
9
9
|
};
|
|
10
|
-
export type VibeSurfaceStatusKind = 'end' | 'loading-more';
|
|
10
|
+
export type VibeSurfaceStatusKind = 'end' | 'failed' | 'filling' | 'initializing' | 'loading-more' | 'refreshing';
|
|
11
11
|
export type VibeFullscreenStatusSlotProps = VibeSurfaceSlotProps & {
|
|
12
12
|
kind: VibeSurfaceStatusKind;
|
|
13
13
|
message: string;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { VibeLoadPhase } from './removalState';
|
|
2
|
+
import type { VibeSurfaceStatusKind } from './surfaceSlots';
|
|
3
|
+
export interface VibeSurfaceStatus {
|
|
4
|
+
kind: VibeSurfaceStatusKind;
|
|
5
|
+
message: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function resolveVibeSurfacePhase(options: {
|
|
8
|
+
itemCount: number;
|
|
9
|
+
loading: boolean;
|
|
10
|
+
phase?: VibeLoadPhase | null;
|
|
11
|
+
}): VibeLoadPhase;
|
|
12
|
+
export declare function getVibeSurfaceStatus(options: {
|
|
13
|
+
errorMessage?: string | null;
|
|
14
|
+
hasItems: boolean;
|
|
15
|
+
hasNextPage: boolean;
|
|
16
|
+
phase: VibeLoadPhase;
|
|
17
|
+
surface: 'fullscreen' | 'grid';
|
|
18
|
+
}): VibeSurfaceStatus | null;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
+
import type { VibeSurfaceMode } from './removalState';
|
|
1
2
|
import { type VibeEmit, type VibeProps } from './useDataSource';
|
|
2
3
|
export declare const DESKTOP_BREAKPOINT_PX = 1024;
|
|
3
|
-
type VibeDesktopSurface = 'fullscreen' | 'list';
|
|
4
4
|
export declare function useController(props: Readonly<VibeProps>, emit: VibeEmit): {
|
|
5
5
|
cancel: () => void;
|
|
6
6
|
isDesktop: import("vue").ComputedRef<boolean>;
|
|
7
|
-
listRestoreToken: import("vue").Ref<number, number>;
|
|
8
7
|
loadNext: () => Promise<void>;
|
|
9
8
|
loadPrevious: () => Promise<void>;
|
|
10
9
|
openFullscreen: (index: number) => void;
|
|
@@ -20,38 +19,37 @@ export declare function useController(props: Readonly<VibeProps>, emit: VibeEmit
|
|
|
20
19
|
readonly fillTargetCount: number | null;
|
|
21
20
|
readonly hasNextPage: boolean;
|
|
22
21
|
readonly hasPreviousPage: boolean;
|
|
23
|
-
readonly isAutoMode: boolean;
|
|
24
22
|
readonly itemCount: number;
|
|
25
23
|
readonly loadState: "failed" | "loaded" | "loading";
|
|
26
|
-
readonly mode: import("./removalState").VibeFeedMode
|
|
24
|
+
readonly mode: import("./removalState").VibeFeedMode;
|
|
27
25
|
readonly nextCursor: string | null;
|
|
28
26
|
readonly phase: import("./removalState").VibeLoadPhase;
|
|
29
27
|
readonly previousCursor: string | null;
|
|
30
28
|
readonly removedCount: number;
|
|
31
|
-
readonly
|
|
29
|
+
readonly removedIds: readonly string[];
|
|
30
|
+
readonly surfaceMode: VibeSurfaceMode;
|
|
32
31
|
};
|
|
33
|
-
surfaceMode: import("vue").ComputedRef<
|
|
32
|
+
surfaceMode: import("vue").ComputedRef<VibeSurfaceMode>;
|
|
34
33
|
activeIndex: import("vue").ComputedRef<number>;
|
|
35
34
|
canRefreshExhaustedNextPage: import("vue").ComputedRef<boolean>;
|
|
36
35
|
canRetryInitialLoad: import("vue").ComputedRef<boolean>;
|
|
37
36
|
clearRemoved: () => void;
|
|
38
37
|
commitPendingAppend: () => Promise<void>;
|
|
39
38
|
currentCursor: import("vue").ComputedRef<string | null>;
|
|
40
|
-
errorMessage: import("vue").
|
|
41
|
-
fillCollectedCount: import("vue").
|
|
42
|
-
fillDelayRemainingMs: import("vue").
|
|
43
|
-
fillTargetCount: import("vue").
|
|
39
|
+
errorMessage: import("vue").Ref<string | null, string | null>;
|
|
40
|
+
fillCollectedCount: import("vue").Ref<number | null, number | null>;
|
|
41
|
+
fillDelayRemainingMs: import("vue").Ref<number | null, number | null>;
|
|
42
|
+
fillTargetCount: import("vue").Ref<number | null, number | null>;
|
|
44
43
|
getRemovedIds: () => string[];
|
|
45
44
|
hasNextPage: import("vue").ComputedRef<boolean>;
|
|
46
45
|
hasPreviousPage: import("vue").ComputedRef<boolean>;
|
|
47
|
-
isAutoMode: import("vue").ComputedRef<boolean>;
|
|
48
46
|
items: import("vue").ComputedRef<import("../viewer").VibeViewerItem[]>;
|
|
49
47
|
loading: import("vue").ComputedRef<boolean>;
|
|
50
|
-
mode: import("vue").ComputedRef<import("./removalState").VibeFeedMode
|
|
48
|
+
mode: import("vue").ComputedRef<import("./removalState").VibeFeedMode>;
|
|
51
49
|
nextCursor: import("vue").ComputedRef<string | null>;
|
|
52
50
|
paginationDetail: import("vue").ComputedRef<string | null>;
|
|
53
51
|
pendingAppendItems: import("vue").ComputedRef<import("../viewer").VibeViewerItem[]>;
|
|
54
|
-
phase: import("vue").
|
|
52
|
+
phase: import("vue").Ref<import("./removalState").VibeLoadPhase, import("./removalState").VibeLoadPhase>;
|
|
55
53
|
prefetchNextPage: () => Promise<void>;
|
|
56
54
|
prefetchPreviousPage: () => Promise<void>;
|
|
57
55
|
previousCursor: import("vue").ComputedRef<string | null>;
|
|
@@ -69,4 +67,3 @@ export declare function useController(props: Readonly<VibeProps>, emit: VibeEmit
|
|
|
69
67
|
ids: string[];
|
|
70
68
|
} | null;
|
|
71
69
|
};
|
|
72
|
-
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { VibeViewerItem } from '../viewer';
|
|
2
2
|
export type { VibeHandle, VibeRemoveResult } from './removalState';
|
|
3
|
-
export type { VibeFeedMode, VibeLoadPhase } from './removalState';
|
|
3
|
+
export type { VibeFeedMode, VibeLoadPhase, VibeSurfaceMode } from './removalState';
|
|
4
4
|
export interface VibeResolveParams {
|
|
5
5
|
cursor: string | null;
|
|
6
6
|
pageSize: number;
|
|
@@ -18,46 +18,23 @@ export interface VibeInitialState {
|
|
|
18
18
|
previousCursor?: string | null;
|
|
19
19
|
activeIndex?: number;
|
|
20
20
|
}
|
|
21
|
-
interface
|
|
22
|
-
hasPreviousPage?: boolean;
|
|
23
|
-
paginationDetail?: string | null;
|
|
24
|
-
requestNextPage?: (() => void | Promise<void>) | null;
|
|
25
|
-
requestPreviousPage?: (() => void | Promise<void>) | null;
|
|
26
|
-
showEndBadge?: boolean;
|
|
27
|
-
showStatusBadges?: boolean;
|
|
28
|
-
}
|
|
29
|
-
export interface VibeControlledProps extends VibeSharedProps {
|
|
30
|
-
items: VibeViewerItem[];
|
|
31
|
-
activeIndex?: number;
|
|
32
|
-
fillDelayMs?: never;
|
|
33
|
-
fillDelayStepMs?: never;
|
|
34
|
-
initialState?: never;
|
|
35
|
-
loading?: boolean;
|
|
36
|
-
hasNextPage?: boolean;
|
|
37
|
-
mode?: never;
|
|
38
|
-
resolve?: never;
|
|
39
|
-
initialCursor?: never;
|
|
40
|
-
pageSize?: never;
|
|
41
|
-
}
|
|
42
|
-
export interface VibeAutoProps extends VibeSharedProps {
|
|
43
|
-
resolve: (params: VibeResolveParams) => Promise<VibeResolveResult>;
|
|
21
|
+
export interface VibeProps {
|
|
44
22
|
fillDelayMs?: number;
|
|
45
23
|
fillDelayStepMs?: number;
|
|
46
24
|
initialCursor?: string | null;
|
|
47
25
|
initialState?: VibeInitialState;
|
|
48
26
|
mode?: import('./removalState').VibeFeedMode;
|
|
49
27
|
pageSize?: number;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
28
|
+
paginationDetail?: string | null;
|
|
29
|
+
resolve?: (params: VibeResolveParams) => Promise<VibeResolveResult>;
|
|
30
|
+
showEndBadge?: boolean;
|
|
31
|
+
showStatusBadges?: boolean;
|
|
32
|
+
surfaceMode?: import('./removalState').VibeSurfaceMode;
|
|
33
|
+
}
|
|
34
|
+
export interface VibeEmit {
|
|
35
|
+
(event: 'update:activeIndex', value: number): void;
|
|
36
|
+
(event: 'update:surfaceMode', value: import('./removalState').VibeSurfaceMode): void;
|
|
58
37
|
}
|
|
59
|
-
export type VibeProps = VibeControlledProps | VibeAutoProps;
|
|
60
|
-
export type VibeEmit = (event: 'update:activeIndex', value: number) => void;
|
|
61
38
|
export declare function useDataSource(props: Readonly<VibeProps>, emit: VibeEmit): {
|
|
62
39
|
activeIndex: import("vue").ComputedRef<number>;
|
|
63
40
|
canRefreshExhaustedNextPage: import("vue").ComputedRef<boolean>;
|
|
@@ -66,23 +43,22 @@ export declare function useDataSource(props: Readonly<VibeProps>, emit: VibeEmit
|
|
|
66
43
|
clearRemoved: () => void;
|
|
67
44
|
commitPendingAppend: () => Promise<void>;
|
|
68
45
|
currentCursor: import("vue").ComputedRef<string | null>;
|
|
69
|
-
errorMessage: import("vue").
|
|
70
|
-
fillCollectedCount: import("vue").
|
|
71
|
-
fillDelayRemainingMs: import("vue").
|
|
72
|
-
fillTargetCount: import("vue").
|
|
46
|
+
errorMessage: import("vue").Ref<string | null, string | null>;
|
|
47
|
+
fillCollectedCount: import("vue").Ref<number | null, number | null>;
|
|
48
|
+
fillDelayRemainingMs: import("vue").Ref<number | null, number | null>;
|
|
49
|
+
fillTargetCount: import("vue").Ref<number | null, number | null>;
|
|
73
50
|
getRemovedIds: () => string[];
|
|
74
51
|
hasNextPage: import("vue").ComputedRef<boolean>;
|
|
75
52
|
hasPreviousPage: import("vue").ComputedRef<boolean>;
|
|
76
|
-
isAutoMode: import("vue").ComputedRef<boolean>;
|
|
77
53
|
items: import("vue").ComputedRef<VibeViewerItem[]>;
|
|
78
54
|
loading: import("vue").ComputedRef<boolean>;
|
|
79
55
|
loadNext: () => Promise<void>;
|
|
80
56
|
loadPrevious: () => Promise<void>;
|
|
81
|
-
mode: import("vue").ComputedRef<import("./removalState").VibeFeedMode
|
|
57
|
+
mode: import("vue").ComputedRef<import("./removalState").VibeFeedMode>;
|
|
82
58
|
nextCursor: import("vue").ComputedRef<string | null>;
|
|
83
59
|
paginationDetail: import("vue").ComputedRef<string | null>;
|
|
84
60
|
pendingAppendItems: import("vue").ComputedRef<VibeViewerItem[]>;
|
|
85
|
-
phase: import("vue").
|
|
61
|
+
phase: import("vue").Ref<import("./removalState").VibeLoadPhase, import("./removalState").VibeLoadPhase>;
|
|
86
62
|
prefetchNextPage: () => Promise<void>;
|
|
87
63
|
prefetchPreviousPage: () => Promise<void>;
|
|
88
64
|
previousCursor: import("vue").ComputedRef<string | null>;
|
|
@@ -13,12 +13,10 @@ export declare function useVibeMasonryList(options: {
|
|
|
13
13
|
commitPendingAppend: Ref<(() => void | Promise<void>) | null | undefined>;
|
|
14
14
|
requestNextPage: Ref<(() => void | Promise<void>) | null | undefined>;
|
|
15
15
|
requestPreviousPage: Ref<(() => void | Promise<void>) | null | undefined>;
|
|
16
|
-
restoreToken: Ref<number>;
|
|
17
16
|
setActiveIndex: (index: number) => void;
|
|
18
17
|
}): {
|
|
19
18
|
columnWidth: import("vue").ComputedRef<number>;
|
|
20
19
|
containerHeight: import("vue").ComputedRef<number>;
|
|
21
|
-
footerStatusMessage: import("vue").ComputedRef<"Loading the first page" | "Loading more items" | "End of list" | null>;
|
|
22
20
|
getCardStyle: (index: number) => {
|
|
23
21
|
height: string;
|
|
24
22
|
width: string;
|
|
@@ -1,20 +1,30 @@
|
|
|
1
1
|
import { type Ref } from 'vue';
|
|
2
|
+
import type { VibeViewerItem } from '../viewer';
|
|
2
3
|
import type { VibeAssetErrorReporter, VibeAssetLoadReporter } from './assetErrors';
|
|
3
4
|
import { formatPlaybackTime } from './format';
|
|
4
|
-
import {
|
|
5
|
-
export type { VibeResolveParams, VibeResolveResult,
|
|
5
|
+
import type { VibeLoadPhase } from './removalState';
|
|
6
|
+
export type { VibeResolveParams, VibeResolveResult, VibeEmit, VibeFeedMode, VibeHandle, VibeInitialState, VibeLoadPhase, VibeProps, VibeSurfaceMode, } from './useDataSource';
|
|
6
7
|
export type { VibeAssetErrorKind } from './loadError';
|
|
7
8
|
export type { VibeStatus } from './removalState';
|
|
8
9
|
export type { VibeAssetErrorEvent, VibeAssetErrorReporter, VibeAssetErrorSurface, VibeAssetLoadEvent, VibeAssetLoadReporter, VibeAssetLoadSurface } from './assetErrors';
|
|
9
|
-
export
|
|
10
|
+
export interface VibeViewerProps {
|
|
11
|
+
activeIndex?: number;
|
|
12
|
+
errorMessage?: string | null;
|
|
13
|
+
hasNextPage?: boolean;
|
|
14
|
+
items: VibeViewerItem[];
|
|
15
|
+
loading?: boolean;
|
|
16
|
+
paginationDetail?: string | null;
|
|
17
|
+
phase?: VibeLoadPhase | null;
|
|
18
|
+
}
|
|
19
|
+
export declare function useViewer(props: Readonly<VibeViewerProps>, emit: (event: 'update:activeIndex', value: number) => void, options?: {
|
|
10
20
|
enabled?: Ref<boolean>;
|
|
11
21
|
onAssetError?: VibeAssetErrorReporter;
|
|
12
22
|
onAssetLoad?: VibeAssetLoadReporter;
|
|
13
23
|
}): {
|
|
14
|
-
activeItem: import("vue").ComputedRef<
|
|
24
|
+
activeItem: import("vue").ComputedRef<VibeViewerItem>;
|
|
15
25
|
activeAssetErrorKind: import("vue").ComputedRef<import("./loadError").VibeAssetErrorKind | null>;
|
|
16
26
|
activeMediaDuration: import("vue").ComputedRef<number>;
|
|
17
|
-
activeMediaItem: import("vue").ComputedRef<
|
|
27
|
+
activeMediaItem: import("vue").ComputedRef<VibeViewerItem | null>;
|
|
18
28
|
activeMediaProgress: import("vue").ComputedRef<number>;
|
|
19
29
|
activeMediaState: import("vue").ComputedRef<import("./assetState").MediaUiState>;
|
|
20
30
|
canRetryAsset: (id: string) => boolean;
|
|
@@ -24,13 +34,13 @@ export declare function useViewer(props: Readonly<VibeProps>, emit: (event: 'upd
|
|
|
24
34
|
getAssetErrorLabel: (id: string) => "404" | "Load error" | null;
|
|
25
35
|
getAssetRenderKey: (id: string) => string;
|
|
26
36
|
formatPlaybackTime: typeof formatPlaybackTime;
|
|
27
|
-
getImageSource: (item:
|
|
37
|
+
getImageSource: (item: VibeViewerItem) => string;
|
|
28
38
|
getSlideStyle: (index: number) => import("vue").CSSProperties;
|
|
29
39
|
hasNextPage: import("vue").ComputedRef<boolean>;
|
|
30
40
|
isAtEnd: import("vue").ComputedRef<boolean>;
|
|
31
|
-
isAudio: (item:
|
|
32
|
-
isVisual: (item:
|
|
33
|
-
items: import("vue").ComputedRef<
|
|
41
|
+
isAudio: (item: VibeViewerItem) => boolean;
|
|
42
|
+
isVisual: (item: VibeViewerItem) => boolean;
|
|
43
|
+
items: import("vue").ComputedRef<VibeViewerItem[]>;
|
|
34
44
|
loading: import("vue").ComputedRef<boolean>;
|
|
35
45
|
mediaStates: Ref<Record<string, import("./assetState").MediaUiState>, Record<string, import("./assetState").MediaUiState>>;
|
|
36
46
|
isImageReady: (id: string) => boolean;
|
|
@@ -56,6 +66,8 @@ export declare function useViewer(props: Readonly<VibeProps>, emit: (event: 'upd
|
|
|
56
66
|
retryInitialLoad: () => Promise<void>;
|
|
57
67
|
retryAsset: (id: string) => Promise<void>;
|
|
58
68
|
stageRef: Ref<HTMLElement | null, HTMLElement | null>;
|
|
59
|
-
|
|
69
|
+
statusKind: import("vue").ComputedRef<import("./surfaceSlots").VibeSurfaceStatusKind | null>;
|
|
70
|
+
statusMessage: import("vue").ComputedRef<string | null>;
|
|
60
71
|
paginationDetail: import("vue").ComputedRef<string | null>;
|
|
72
|
+
phase: import("vue").ComputedRef<VibeLoadPhase>;
|
|
61
73
|
};
|