vlist 2.0.1 → 2.0.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 CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  The virtual list library for every framework. Ultra efficient, batteries-included, and accessible with composable plugins — in 7.7 KB.
4
4
 
5
- **v2.0.0** — [Changelog](./CHANGELOG.md) · **v2 is a ground-up rewrite** with a new plugin API. Coming from v1? See [Migration Guide](https://vlist.io/docs/migration).
5
+ **v2.0.2** — [Changelog](./CHANGELOG.md) · **v2 is a ground-up rewrite** with a new plugin API. Coming from v1? See [Migration Guide](https://vlist.io/docs/migration).
6
6
 
7
7
  [![npm version](https://img.shields.io/npm/v/vlist.svg)](https://www.npmjs.com/package/vlist)
8
8
  [![bundle size](https://img.shields.io/bundlephobia/minzip/vlist)](https://bundlephobia.com/package/vlist)
@@ -14,7 +14,7 @@ The virtual list library for every framework. Ultra efficient, batteries-include
14
14
  - **7.7 KB gzipped** — composable plugins with perfect tree-shaking
15
15
  - **Constant memory** — ~0.1 MB overhead at any scale, from 10K to 1M+ items
16
16
  - **Grid, masonry, table, groups, data, selection, sortable, transition, scale** — all opt-in
17
- - **Vertical & horizontal** single axis-neutral code path, every plugin works in both orientations
17
+ - **Axis-neutral** vertical and horizontal scrolling through a single code path, all plugins work in both orientations
18
18
 
19
19
  **18 interactive examples, docs & benchmarks → [vlist.io](https://vlist.io)**
20
20
 
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  The virtual list library for every framework. Ultra efficient, batteries-included, and accessible with composable plugins — in 7.7 KB.
4
4
 
5
- **v2.0.0** — [Changelog](https://github.com/floor/vlist/blob/main/CHANGELOG.md) · **v2 is a ground-up rewrite** with a new plugin API. Coming from v1? See [Migration Guide](https://vlist.io/docs/migration).
5
+ **v2.0.2** — [Changelog](https://github.com/floor/vlist/blob/main/CHANGELOG.md) · **v2 is a ground-up rewrite** with a new plugin API. Coming from v1? See [Migration Guide](https://vlist.io/docs/migration).
6
6
 
7
7
  [![npm version](https://img.shields.io/npm/v/vlist.svg)](https://www.npmjs.com/package/vlist)
8
8
  [![bundle size](https://img.shields.io/bundlephobia/minzip/vlist)](https://bundlephobia.com/package/vlist)
@@ -13,7 +13,7 @@ The virtual list library for every framework. Ultra efficient, batteries-include
13
13
  - **Zero dependencies** — framework-agnostic core, tiny adapters for Vue, Svelte, Solid, React
14
14
  - **7.7 KB gzipped** — composable plugins with perfect tree-shaking
15
15
  - **Constant memory** — ~0.1 MB overhead at any scale, from 10K to 1M+ items
16
- - **Vertical & horizontal** single axis-neutral code path, every plugin works in both orientations
16
+ - **Axis-neutral** vertical and horizontal scrolling through a single code path, all plugins work in both orientations
17
17
 
18
18
  ## Install
19
19
 
@@ -4,5 +4,5 @@
4
4
  */
5
5
  import type { DOMStructure } from "./types";
6
6
  export declare function resolveContainer(container: HTMLElement | string): HTMLElement;
7
- export declare function createDOMStructure(container: HTMLElement, classPrefix: string, horizontal: boolean, interactive: boolean, ariaLabel?: string): DOMStructure;
7
+ export declare function createDOMStructure(container: HTMLElement, classPrefix: string, isX: boolean, interactive: boolean, ariaLabel?: string): DOMStructure;
8
8
  //# sourceMappingURL=dom.d.ts.map
@@ -13,5 +13,5 @@ export { createDOMStructure, resolveContainer } from "./dom";
13
13
  export { createScrollHandler } from "./scroll";
14
14
  export type { SizeCache } from "./sizes";
15
15
  export type { ScrollHandler, ScrollHandlerConfig } from "./scroll";
16
- export type { CalculateHook, CommitHook, AfterScrollHook, IdleHook, ResizeHook, CompiledHooks, ResolvedConfig, DOMStructure, ElementPool, VisibleRangeFn, PluginContext, VListPlugin, VList, CreateVListConfig, } from "./types";
16
+ export type { Axis, AxisConfig, CalculateHook, CommitHook, AfterScrollHook, IdleHook, ResizeHook, CompiledHooks, ResolvedConfig, DOMStructure, ElementPool, VisibleRangeFn, PluginContext, VListPlugin, VList, CreateVListConfig, } from "./types";
17
17
  //# sourceMappingURL=index.d.ts.map
@@ -21,9 +21,9 @@ export interface RenderConfig {
21
21
  readonly placeholderClass: string;
22
22
  readonly replacedClass: string;
23
23
  readonly translateProp: "translateX(" | "translateY(";
24
+ readonly sizeProp: "width" | "height";
24
25
  readonly itemRole: "option" | "listitem";
25
26
  readonly interactive: boolean;
26
- readonly horizontal: boolean;
27
27
  readonly startPadding: number;
28
28
  readonly gap: number;
29
29
  readonly hasCrossPad: boolean;
@@ -34,7 +34,7 @@ export interface RenderConfig {
34
34
  readonly oddClass: string;
35
35
  readonly emitter: Emitter<VListEvents> | null;
36
36
  }
37
- export declare function createRenderConfig(classPrefix: string, horizontal: boolean, interactive: boolean, startPadding: number, crossPadStart: number, crossPadEnd: number, oddClass: string, gap: number, emitter?: Emitter<VListEvents> | null): RenderConfig;
37
+ export declare function createRenderConfig(classPrefix: string, isX: boolean, interactive: boolean, startPadding: number, crossPadStart: number, crossPadEnd: number, oddClass: string, gap: number, emitter?: Emitter<VListEvents> | null): RenderConfig;
38
38
  /**
39
39
  * Calculate visible range and fill EngineState buffers.
40
40
  * Zero allocation — all writes go into pre-allocated TypedArrays.
@@ -18,7 +18,7 @@ export interface ScrollHandler {
18
18
  export interface ScrollHandlerConfig {
19
19
  readonly state: EngineState;
20
20
  readonly viewport: HTMLElement;
21
- readonly horizontal: boolean;
21
+ readonly isX: boolean;
22
22
  readonly wheelEnabled: boolean;
23
23
  readonly idleTimeout: number;
24
24
  /** Override the event target for scroll/wheel listeners (default: viewport) */
@@ -25,9 +25,15 @@ export interface CompiledHooks {
25
25
  readonly idle: readonly IdleHook[];
26
26
  readonly resize: readonly ResizeHook[];
27
27
  }
28
+ export type Axis = "x" | "y";
29
+ export interface AxisConfig {
30
+ readonly primary: Axis;
31
+ readonly cross?: Axis;
32
+ }
28
33
  export interface ResolvedConfig {
34
+ readonly axis: AxisConfig;
35
+ readonly hasCrossAxis: boolean;
29
36
  readonly overscan: number;
30
- readonly horizontal: boolean;
31
37
  readonly reverse: boolean;
32
38
  readonly classPrefix: string;
33
39
  readonly interactive: boolean;
package/dist/index.d.ts CHANGED
@@ -38,5 +38,5 @@ export type { SortablePluginConfig } from "./plugins/sortable";
38
38
  export { createStats } from "./utils/stats";
39
39
  export type { Stats, StatsConfig, StatsState } from "./utils/stats";
40
40
  export type { VListItem, VListEvents, ItemConfig, ItemTemplate, ItemState, SelectionMode, SelectionConfig, SelectionState, ScrollbarConfig, ScrollbarPadding, ScrollbarOptions, ScrollConfig, ScrollToOptions, ScrollSnapshot, VListAdapter, AdapterParams, AdapterResponse, Range, ViewportState, EventHandler, Unsubscribe, GridConfig, MasonryConfig, GroupsConfig, GroupHeaderConfig, GridSizeContext, GridHeightContext, } from "./types";
41
- export type { VList, VListPlugin, PluginContext, CreateVListConfig, CompiledHooks, ResolvedConfig, DOMStructure, ElementPool, } from "./core/types";
41
+ export type { Axis, AxisConfig, VList, VListPlugin, PluginContext, CreateVListConfig, CompiledHooks, ResolvedConfig, DOMStructure, ElementPool, } from "./core/types";
42
42
  //# sourceMappingURL=index.d.ts.map