vlist 2.8.1 → 3.0.0-next.2
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.github.md +114 -44
- package/README.md +56 -44
- package/dist/config.d.ts +3 -5
- package/dist/config.js +1 -1
- package/dist/constants.d.ts +2 -12
- package/dist/core/adapter.d.ts +7 -1
- package/dist/core/create.d.ts +15 -4
- package/dist/core/scroll-source.d.ts +5 -0
- package/dist/core/scroll.d.ts +3 -1
- package/dist/core/types.d.ts +8 -7
- package/dist/index.d.ts +0 -5
- package/dist/index.js +1 -1
- package/dist/internals.js +1 -1
- package/dist/native.d.ts +7 -0
- package/dist/native.js +1 -0
- package/dist/plugins/masonry/renderer.d.ts +3 -1
- package/dist/plugins/scrollbar/scrollbar.d.ts +17 -3
- package/dist/plugins/table/renderer.d.ts +3 -1
- package/dist/size.json +1 -1
- package/dist/synthetic.d.ts +3 -7
- package/dist/synthetic.js +1 -1
- package/dist/types.d.ts +4 -38
- package/dist/vlist-table.css +1 -1
- package/dist/vlist.css +1 -1
- package/package.json +6 -1
- package/dist/plugins/scale/index.d.ts +0 -2
- package/dist/plugins/scale/plugin.d.ts +0 -9
package/dist/core/create.d.ts
CHANGED
|
@@ -7,10 +7,21 @@
|
|
|
7
7
|
import type { VListItem } from "../types";
|
|
8
8
|
import type { CreateVListConfig, VListPlugin, VList } from "./types";
|
|
9
9
|
import type { SizeCache } from "./sizes";
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
import type { BoundedScrollHandler, BoundedScrollConfig } from "./runway";
|
|
11
|
+
import type { ScrollHandler, ScrollHandlerConfig } from "./scroll";
|
|
12
|
+
import { type Emitter } from "../events";
|
|
13
|
+
import type { VListEvents } from "../types";
|
|
14
|
+
/** Create a list with native scrolling. Opt into synthetic input via vlist/synthetic. */
|
|
15
|
+
export declare function createVList<T extends VListItem = VListItem>(config: CreateVListConfig<T>, plugins?: VListPlugin<T>[]): VList<T>;
|
|
16
|
+
/** @internal Shared factory; entries select the input handler. */
|
|
17
|
+
export declare function createCore<T extends VListItem = VListItem>(rawConfig: CreateVListConfig<T>, plugins?: VListPlugin<T>[],
|
|
18
|
+
/** @internal Omitted by the native entry. */
|
|
13
19
|
logicalHandlerFactory?: (config: BoundedScrollConfig & {
|
|
14
20
|
sizeCache: SizeCache;
|
|
15
|
-
}) => BoundedScrollHandler
|
|
21
|
+
}) => BoundedScrollHandler, nativeOptions?: {
|
|
22
|
+
native: (config: ScrollHandlerConfig) => ScrollHandler & {
|
|
23
|
+
commitScroll(pos?: number): void;
|
|
24
|
+
};
|
|
25
|
+
onContentSize: (size: number, emitter: Emitter<VListEvents<T>>) => void;
|
|
26
|
+
}): VList<T>;
|
|
16
27
|
//# sourceMappingURL=create.d.ts.map
|
package/dist/core/scroll.d.ts
CHANGED
|
@@ -28,5 +28,7 @@ export interface ScrollHandlerConfig {
|
|
|
28
28
|
/** Called when scrolling becomes idle */
|
|
29
29
|
readonly onIdle: () => void;
|
|
30
30
|
}
|
|
31
|
-
export declare function createScrollHandler(config: ScrollHandlerConfig): ScrollHandler
|
|
31
|
+
export declare function createScrollHandler(config: ScrollHandlerConfig): ScrollHandler & {
|
|
32
|
+
commitScroll(pos?: number): void;
|
|
33
|
+
};
|
|
32
34
|
//# sourceMappingURL=scroll.d.ts.map
|
package/dist/core/types.d.ts
CHANGED
|
@@ -79,11 +79,15 @@ export interface PluginContext<T extends VListItem = VListItem> {
|
|
|
79
79
|
registerDestroyHandler(handler: () => void): void;
|
|
80
80
|
enableListboxRole(): void;
|
|
81
81
|
setSizeConfig(config: number | ((index: number) => number)): void;
|
|
82
|
-
/**
|
|
83
|
-
|
|
84
|
-
|
|
82
|
+
/** Install an external writer and disable default scroll/wheel listeners. */
|
|
83
|
+
setScrollSource(source: {
|
|
84
|
+
write(px: number): void;
|
|
85
|
+
onContentSize?(px: number): void;
|
|
86
|
+
}): void;
|
|
87
|
+
/** Commit an external position, render synchronously and schedule configured idle. */
|
|
88
|
+
commitScroll(px: number): void;
|
|
85
89
|
/** Request the bounded scroll handler in infinite-loop (wrap) mode (carousel). */
|
|
86
|
-
setBoundedWrap(config: import("./runway").WrapConfig): void;
|
|
90
|
+
setBoundedWrap(config: import("./runway").WrapConfig, createHandler: (config: import("./runway").BoundedScrollConfig) => import("./runway").BoundedScrollHandler): void;
|
|
87
91
|
setVirtualTotalFn(fn: () => number): void;
|
|
88
92
|
setIndexMapFn(fn: (renderIndex: number) => number): void;
|
|
89
93
|
getItems(): readonly T[];
|
|
@@ -104,9 +108,6 @@ export interface PluginContext<T extends VListItem = VListItem> {
|
|
|
104
108
|
smoothScrollTo(target: number | (() => number), duration: number, easing?: (t: number) => number, onComplete?: () => void): void;
|
|
105
109
|
/** Cancel any in-flight smooth-scroll animation on the active handler. */
|
|
106
110
|
cancelScroll(): void;
|
|
107
|
-
/** @deprecated Use setScrollSource in 3.0; removed in 3.0.
|
|
108
|
-
* See https://vlist.io/docs/rfcs/RFC-014-Scroll-Input-Model */
|
|
109
|
-
disableDefaultScroll(): void;
|
|
110
111
|
disableDefaultResize(): void;
|
|
111
112
|
setScrollTarget(target: EventTarget): void;
|
|
112
113
|
setScrollToPosFn(fn: (index: number, sizeCache: import("./sizes").SizeCache, containerSize: number, totalItems: number, align: string) => number): void;
|
package/dist/index.d.ts
CHANGED
|
@@ -39,11 +39,6 @@ export { search, DEFAULT_SEARCH_TEXT } from "./plugins/search";
|
|
|
39
39
|
export type { SearchPluginConfig, SearchText } from "./plugins/search";
|
|
40
40
|
export { carousel, registerPreset, getPreset, resolvePreset, full, hero, heroCenter, multi, uncontained } from "./plugins/carousel";
|
|
41
41
|
export type { CarouselPluginConfig, CarouselVariant, CarouselDirection, CarouselState, SlotConfig, SlotConfigResolver, TextFade } from "./plugins/carousel";
|
|
42
|
-
/** @deprecated Removed in 3.0. Use `scroll: { mode: "synthetic" }` from
|
|
43
|
-
* `vlist/synthetic` (bounded remains available in 2.x).
|
|
44
|
-
* See https://vlist.io/docs/rfcs/RFC-014-Scroll-Input-Model */
|
|
45
|
-
export { scale } from "./plugins/scale";
|
|
46
|
-
export type { ScalePluginConfig } from "./plugins/scale";
|
|
47
42
|
export { createStats } from "./utils/stats";
|
|
48
43
|
export type { Stats, StatsConfig, StatsState } from "./utils/stats";
|
|
49
44
|
export { rebuild } from "./utils/rebuild";
|