vlist 3.0.0-next.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 +53 -54
- package/README.md +53 -54
- package/dist/config.d.ts +3 -4
- package/dist/config.js +1 -1
- package/dist/core/create.d.ts +1 -2
- package/dist/core/types.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/native.d.ts +6 -10
- package/dist/native.js +1 -1
- package/dist/size.json +1 -1
- package/dist/synthetic.d.ts +3 -3
- package/dist/synthetic.js +1 -1
- package/dist/types.d.ts +5 -2
- package/package.json +1 -1
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.
|
|
4
4
|
|
|
5
|
-
**v3.0.0-next.
|
|
5
|
+
**v3.0.0-next.2** (prerelease on the npm `next` tag) — Native scrolling by default, opt-in `vlist/synthetic`, and removal of deprecated scroll configuration and plugin hooks. See the [changelog](https://github.com/floor/vlist/blob/next/CHANGELOG.md).
|
|
6
6
|
|
|
7
7
|
[](https://www.npmjs.com/package/vlist)
|
|
8
8
|
[](https://bundlephobia.com/package/vlist)
|
|
@@ -11,7 +11,7 @@ The virtual list library for every framework. Ultra efficient, batteries-include
|
|
|
11
11
|
|
|
12
12
|
- **Accessible** — WAI-ARIA, 2D keyboard navigation, focus recovery, screen-reader DOM ordering
|
|
13
13
|
- **Zero dependencies** — framework-agnostic core with tiny adapters for Vue, Svelte, Solid, React
|
|
14
|
-
- **
|
|
14
|
+
- **9.3 KB gzipped (3.0 prerelease)** — composable plugins with perfect tree-shaking
|
|
15
15
|
- **Constant memory** — ~0.1 MB overhead at any scale, from 10K to 1M+ items
|
|
16
16
|
- **Tree, grid, masonry, carousel, table, groups, data, selection, search, sortable, transition** — all opt-in
|
|
17
17
|
- **Axis-neutral** — vertical and horizontal scrolling through a single code path, all plugins work in both orientations
|
|
@@ -46,11 +46,11 @@ npm install vlist@next # 3.0 prerelease; latest stays on 2.8
|
|
|
46
46
|
npm install vlist vlist-vue # or vlist-svelte / vlist-solidjs / vlist-react
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
-
Adapters use
|
|
49
|
+
Adapters use native scrolling by default. With an adapter that forwards `factory`, select synthetic input explicitly:
|
|
50
50
|
|
|
51
51
|
```ts
|
|
52
52
|
import { useVList } from "vlist-react";
|
|
53
|
-
import { createVList } from "vlist/
|
|
53
|
+
import { createVList } from "vlist/synthetic";
|
|
54
54
|
|
|
55
55
|
useVList({
|
|
56
56
|
factory: createVList,
|
|
@@ -59,7 +59,7 @@ useVList({
|
|
|
59
59
|
});
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
-
The same factory option is available to the other adapters. `vlist/config` defaults to
|
|
62
|
+
The same factory option is available to the other adapters. `vlist/config` defaults to native scrolling. The factory is structural configuration: changing it requires recreating the list.
|
|
63
63
|
|
|
64
64
|
## Quick Start
|
|
65
65
|
|
|
@@ -108,10 +108,21 @@ const list = createVList({
|
|
|
108
108
|
|
|
109
109
|
## Scroll input
|
|
110
110
|
|
|
111
|
-
|
|
111
|
+
Native scrolling is the default: import `createVList` and plugins from `vlist`. This preserves browser scrollbars, native touch momentum, boundary handoff and native assistive-technology scrolling. Carousel, sortable and horizontal RTL lists work with this factory. Carousel supplies its private wrap runway only when the plugin is imported; bounded scrolling is no longer a public mode.
|
|
112
|
+
|
|
113
|
+
| Entry | Input model | Use |
|
|
114
|
+
|---|---|---|
|
|
115
|
+
| `vlist` | Native (default) | Browser scrolling and all supported plugins |
|
|
116
|
+
| `vlist/synthetic` | Synthetic (opt-in) | Huge lists and application-owned touch motion |
|
|
117
|
+
| `vlist/native` | Alias of `vlist` (deprecated) | Compatibility with `3.0.0-next.1`; use `vlist` for new code |
|
|
118
|
+
|
|
119
|
+
### Synthetic input
|
|
120
|
+
|
|
121
|
+
Select synthetic input by importing its factory; there is no `scroll.mode` option. Plugins still come from `vlist`.
|
|
112
122
|
|
|
113
123
|
```typescript
|
|
114
|
-
import { createVList
|
|
124
|
+
import { createVList } from 'vlist/synthetic'
|
|
125
|
+
import { scrollbar } from 'vlist'
|
|
115
126
|
import 'vlist/styles'
|
|
116
127
|
|
|
117
128
|
const list = createVList({
|
|
@@ -121,69 +132,57 @@ const list = createVList({
|
|
|
121
132
|
}, [scrollbar()])
|
|
122
133
|
```
|
|
123
134
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
```typescript
|
|
127
|
-
import { createVList } from 'vlist/native'
|
|
128
|
-
import { carousel } from 'vlist'
|
|
129
|
-
|
|
130
|
-
const list = createVList({
|
|
131
|
-
container: '#slides',
|
|
132
|
-
orientation: 'horizontal',
|
|
133
|
-
items: slides,
|
|
134
|
-
item: { width: 320, template: renderSlide },
|
|
135
|
-
}, [carousel()])
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
`page()` uses native document scrolling through an external source with either entry. Its content must fit the 16,777,216 px document element limit; creation throws above that limit when the size is known, and later growth warns once. A deferred custom renderer whose size is first committed during rendering also warns once. Use default viewport scrolling for larger lists. Native viewport lists warn once when content exceeds their browser-size safety limit.
|
|
135
|
+
`page()` uses native document scrolling through an external source with either entry. Its content must fit the 16,777,216 px document element limit; creation throws above that limit when the size is known, and later growth warns once. A deferred custom renderer whose size is first committed during rendering also warns once. Use `vlist/synthetic` viewport scrolling for larger lists. Default native viewport lists warn once when content exceeds their browser-size safety limit, pointing to that entry.
|
|
139
136
|
|
|
140
|
-
|
|
137
|
+
Synthetic input limitations:
|
|
141
138
|
|
|
142
|
-
-
|
|
143
|
-
- Same-axis touch stops at either boundary with no parent handoff, including gestures starting inside an edge-pinned list. Use
|
|
144
|
-
-
|
|
139
|
+
- `carousel()`, `sortable()` and horizontal RTL lists throw with instructions to use `vlist`. Vertical lists and tables support `dir="rtl"`, including cross-axis wheel movement, aligned table headers and keyboard column navigation.
|
|
140
|
+
- Same-axis touch stops at either boundary with no parent handoff, including gestures starting inside an edge-pinned list. Use the native default when boundary gestures must scroll the parent page.
|
|
141
|
+
- There is no native main-axis scrollbar. Add `scrollbar()` for an accessible custom scrollbar. The synthetic entry rejects the `"native"` and `"none"` scrollbar strings.
|
|
145
142
|
- Inertia initializes its frame clock on the first frame after release, adding up to one frame of release latency.
|
|
146
143
|
- Wheel input at an edge is left to the page when it cannot move the list. Native cross-axis scrolling remains available.
|
|
147
144
|
|
|
148
|
-
Measurement corrections from autosize preserve ongoing motion. Existing plugin conflicts still apply. See the [scroll input contract](https://vlist.io/docs/rfcs/RFC-014-Scroll-Input-Model).
|
|
145
|
+
Measurement corrections from autosize preserve ongoing synthetic motion. Existing plugin conflicts still apply. See the [scroll input contract](https://vlist.io/docs/rfcs/RFC-014-Scroll-Input-Model).
|
|
149
146
|
|
|
150
147
|
## Migrating to 3.0
|
|
151
148
|
|
|
152
|
-
|
|
149
|
+
`3.0.0-next.1` used synthetic input by default. `3.0.0-next.2` restores the 2.x default. Import `vlist/synthetic` explicitly to retain synthetic behavior across these prereleases. `vlist/native` remains a deprecated compatibility alias; its `NativeScrollConfig` and `NativeCreateVListConfig` types alias the standard `ScrollConfig` and `CreateVListConfig`.
|
|
150
|
+
|
|
151
|
+
| 2.x option or API | 3.0 replacement |
|
|
153
152
|
|---|---|
|
|
154
|
-
| `scroll.mode` (all values, both entries) | Omit it. `vlist` provides
|
|
155
|
-
| `scroll.runway` (both entries) | Remove it.
|
|
156
|
-
|
|
|
153
|
+
| `scroll.mode` (all values, both entries) | Omit it. `vlist` provides native scrolling; import `vlist/synthetic` for synthetic input. |
|
|
154
|
+
| `scroll.runway` (both entries) | Remove it. For huge lists use `vlist/synthetic`, which needs no native runway. |
|
|
155
|
+
| `scroll.scrollbar: "native"` or `"none"` | Retained in default `ScrollConfig`. With synthetic input, omit the string and optionally install `scrollbar()`. |
|
|
157
156
|
| `PluginContext.setScrollFns`, `disableDefaultScroll` | Use `setScrollSource` to supply an external position source and commit callback. |
|
|
158
|
-
| `scale()` and `ScalePluginConfig` | Remove
|
|
157
|
+
| `scale()` and `ScalePluginConfig` | Remove them; use `vlist/synthetic` for the full logical range. Config no longer installs a scale stub. |
|
|
159
158
|
|
|
160
|
-
Removed
|
|
159
|
+
Removed mode/runway options throw a migration error before creating DOM. `vlist/config` retains scrollbar omission/options convenience and its top-level `scrollbar: "none"` option. `baseOffset` stays private engine state; plugins use `ctx.scroll.getRenderOrigin()`. Custom wrap providers now supply their handler factory as the second argument of `ctx.setBoundedWrap`.
|
|
161
160
|
|
|
162
161
|
## Plugins
|
|
163
162
|
|
|
164
163
|
| Entry / export | Minified | Gzipped |
|
|
165
164
|
|---|---:|---:|
|
|
166
|
-
| **Base (`vlist`)** |
|
|
167
|
-
| `vlist/synthetic`
|
|
168
|
-
| `vlist/native` |
|
|
169
|
-
| `a11y()` |
|
|
170
|
-
| `selection()` |
|
|
171
|
-
| `data()` |
|
|
172
|
-
| `scrollbar()` |
|
|
173
|
-
| `sortable()` |
|
|
174
|
-
| `groups()` |
|
|
175
|
-
| `page()` |
|
|
176
|
-
| `snapshots()` |
|
|
177
|
-
| `transition()` |
|
|
178
|
-
| `autosize()` |
|
|
179
|
-
| `grid()` |
|
|
180
|
-
| `table()` |
|
|
181
|
-
| `masonry()` |
|
|
182
|
-
| `tree()` |
|
|
183
|
-
| `search()` |
|
|
184
|
-
| `carousel()` |
|
|
185
|
-
|
|
186
|
-
Sizes are tree-shaken totals from `bun run size`, not additive plugin costs. Plugin rows
|
|
165
|
+
| **Base (`vlist`)** | 25.4 KB | 9.3 KB |
|
|
166
|
+
| `vlist/synthetic` | 31.1 KB | 11.4 KB |
|
|
167
|
+
| `vlist/native` (alias) | 25.4 KB | 9.3 KB |
|
|
168
|
+
| `a11y()` | 28.7 KB | 10.5 KB |
|
|
169
|
+
| `selection()` | 34.8 KB | 12.1 KB |
|
|
170
|
+
| `data()` | 39.0 KB | 14.1 KB |
|
|
171
|
+
| `scrollbar()` | 33.6 KB | 12.2 KB |
|
|
172
|
+
| `sortable()` | 34.9 KB | 12.2 KB |
|
|
173
|
+
| `groups()` | 41.3 KB | 14.6 KB |
|
|
174
|
+
| `page()` | 27.9 KB | 10.2 KB |
|
|
175
|
+
| `snapshots()` | 28.7 KB | 10.4 KB |
|
|
176
|
+
| `transition()` | 32.1 KB | 11.3 KB |
|
|
177
|
+
| `autosize()` | 28.5 KB | 10.3 KB |
|
|
178
|
+
| `grid()` | 32.5 KB | 11.8 KB |
|
|
179
|
+
| `table()` | 43.8 KB | 15.2 KB |
|
|
180
|
+
| `masonry()` | 36.8 KB | 13.4 KB |
|
|
181
|
+
| `tree()` | 40.6 KB | 14.3 KB |
|
|
182
|
+
| `search()` | 34.5 KB | 12.4 KB |
|
|
183
|
+
| `carousel()` | 38.0 KB | 13.7 KB |
|
|
184
|
+
|
|
185
|
+
Sizes are tree-shaken totals from `bun run size`, not additive plugin costs. Plugin rows include the native default factory plus that plugin. The base is **9,523 bytes gzipped**, below the 9.9 KB target; synthetic input is **11,687 bytes** before plugins. The alias row measures the same source factory; the distributed alias re-exports it without duplicating the implementation.
|
|
187
186
|
|
|
188
187
|
## Examples
|
|
189
188
|
|
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.
|
|
4
4
|
|
|
5
|
-
**v3.0.0-next.
|
|
5
|
+
**v3.0.0-next.2** (prerelease on the npm `next` tag) — Native scrolling by default, opt-in `vlist/synthetic`, and removal of deprecated scroll configuration and plugin hooks. See the [changelog](https://github.com/floor/vlist/blob/next/CHANGELOG.md).
|
|
6
6
|
|
|
7
7
|
[](https://www.npmjs.com/package/vlist)
|
|
8
8
|
[](https://bundlephobia.com/package/vlist)
|
|
@@ -11,7 +11,7 @@ The virtual list library for every framework. Ultra efficient, batteries-include
|
|
|
11
11
|
|
|
12
12
|
- **Accessible** — WAI-ARIA, 2D keyboard navigation, focus recovery, screen-reader DOM ordering
|
|
13
13
|
- **Zero dependencies** — framework-agnostic core, tiny adapters for Vue, Svelte, Solid, React
|
|
14
|
-
- **
|
|
14
|
+
- **9.3 KB gzipped (3.0 prerelease)** — composable plugins with perfect tree-shaking
|
|
15
15
|
- **Constant memory** — ~0.1 MB overhead at any scale, from 10K to 1M+ items
|
|
16
16
|
- **Axis-neutral** — vertical and horizontal scrolling through a single code path, all plugins work in both orientations
|
|
17
17
|
|
|
@@ -55,10 +55,21 @@ const list = createVList({ container: '#app', items, item: { height: 200, templa
|
|
|
55
55
|
|
|
56
56
|
## Scroll input
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
Native scrolling is the default: import `createVList` and plugins from `vlist`. This preserves browser scrollbars, native touch momentum, boundary handoff and native assistive-technology scrolling. Carousel, sortable and horizontal RTL lists work with this factory. Carousel supplies its private wrap runway only when the plugin is imported; bounded scrolling is no longer a public mode.
|
|
59
|
+
|
|
60
|
+
| Entry | Input model | Use |
|
|
61
|
+
|---|---|---|
|
|
62
|
+
| `vlist` | Native (default) | Browser scrolling and all supported plugins |
|
|
63
|
+
| `vlist/synthetic` | Synthetic (opt-in) | Huge lists and application-owned touch motion |
|
|
64
|
+
| `vlist/native` | Alias of `vlist` (deprecated) | Compatibility with `3.0.0-next.1`; use `vlist` for new code |
|
|
65
|
+
|
|
66
|
+
### Synthetic input
|
|
67
|
+
|
|
68
|
+
Select synthetic input by importing its factory; there is no `scroll.mode` option. Plugins still come from `vlist`.
|
|
59
69
|
|
|
60
70
|
```typescript
|
|
61
|
-
import { createVList
|
|
71
|
+
import { createVList } from 'vlist/synthetic'
|
|
72
|
+
import { scrollbar } from 'vlist'
|
|
62
73
|
import 'vlist/styles'
|
|
63
74
|
|
|
64
75
|
const list = createVList({
|
|
@@ -68,69 +79,57 @@ const list = createVList({
|
|
|
68
79
|
}, [scrollbar()])
|
|
69
80
|
```
|
|
70
81
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
```typescript
|
|
74
|
-
import { createVList } from 'vlist/native'
|
|
75
|
-
import { carousel } from 'vlist'
|
|
76
|
-
|
|
77
|
-
const list = createVList({
|
|
78
|
-
container: '#slides',
|
|
79
|
-
orientation: 'horizontal',
|
|
80
|
-
items: slides,
|
|
81
|
-
item: { width: 320, template: renderSlide },
|
|
82
|
-
}, [carousel()])
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
`page()` uses native document scrolling through an external source with either entry. Its content must fit the 16,777,216 px document element limit; creation throws above that limit when the size is known, and later growth warns once. A deferred custom renderer whose size is first committed during rendering also warns once. Use default viewport scrolling for larger lists. Native viewport lists warn once when content exceeds their browser-size safety limit.
|
|
82
|
+
`page()` uses native document scrolling through an external source with either entry. Its content must fit the 16,777,216 px document element limit; creation throws above that limit when the size is known, and later growth warns once. A deferred custom renderer whose size is first committed during rendering also warns once. Use `vlist/synthetic` viewport scrolling for larger lists. Default native viewport lists warn once when content exceeds their browser-size safety limit, pointing to that entry.
|
|
86
83
|
|
|
87
|
-
|
|
84
|
+
Synthetic input limitations:
|
|
88
85
|
|
|
89
|
-
-
|
|
90
|
-
- Same-axis touch stops at either boundary with no parent handoff, including gestures starting inside an edge-pinned list. Use
|
|
91
|
-
-
|
|
86
|
+
- `carousel()`, `sortable()` and horizontal RTL lists throw with instructions to use `vlist`. Vertical lists and tables support `dir="rtl"`, including cross-axis wheel movement, aligned table headers and keyboard column navigation.
|
|
87
|
+
- Same-axis touch stops at either boundary with no parent handoff, including gestures starting inside an edge-pinned list. Use the native default when boundary gestures must scroll the parent page.
|
|
88
|
+
- There is no native main-axis scrollbar. Add `scrollbar()` for an accessible custom scrollbar. The synthetic entry rejects the `"native"` and `"none"` scrollbar strings.
|
|
92
89
|
- Inertia initializes its frame clock on the first frame after release, adding up to one frame of release latency.
|
|
93
90
|
- Wheel input at an edge is left to the page when it cannot move the list. Native cross-axis scrolling remains available.
|
|
94
91
|
|
|
95
|
-
Measurement corrections from autosize preserve ongoing motion. Existing plugin conflicts still apply. See the [scroll input contract](https://vlist.io/docs/rfcs/RFC-014-Scroll-Input-Model).
|
|
92
|
+
Measurement corrections from autosize preserve ongoing synthetic motion. Existing plugin conflicts still apply. See the [scroll input contract](https://vlist.io/docs/rfcs/RFC-014-Scroll-Input-Model).
|
|
96
93
|
|
|
97
94
|
## Migrating to 3.0
|
|
98
95
|
|
|
99
|
-
|
|
96
|
+
`3.0.0-next.1` used synthetic input by default. `3.0.0-next.2` restores the 2.x default. Import `vlist/synthetic` explicitly to retain synthetic behavior across these prereleases. `vlist/native` remains a deprecated compatibility alias; its `NativeScrollConfig` and `NativeCreateVListConfig` types alias the standard `ScrollConfig` and `CreateVListConfig`.
|
|
97
|
+
|
|
98
|
+
| 2.x option or API | 3.0 replacement |
|
|
100
99
|
|---|---|
|
|
101
|
-
| `scroll.mode` (all values, both entries) | Omit it. `vlist` provides
|
|
102
|
-
| `scroll.runway` (both entries) | Remove it.
|
|
103
|
-
|
|
|
100
|
+
| `scroll.mode` (all values, both entries) | Omit it. `vlist` provides native scrolling; import `vlist/synthetic` for synthetic input. |
|
|
101
|
+
| `scroll.runway` (both entries) | Remove it. For huge lists use `vlist/synthetic`, which needs no native runway. |
|
|
102
|
+
| `scroll.scrollbar: "native"` or `"none"` | Retained in default `ScrollConfig`. With synthetic input, omit the string and optionally install `scrollbar()`. |
|
|
104
103
|
| `PluginContext.setScrollFns`, `disableDefaultScroll` | Use `setScrollSource` to supply an external position source and commit callback. |
|
|
105
|
-
| `scale()` and `ScalePluginConfig` | Remove
|
|
104
|
+
| `scale()` and `ScalePluginConfig` | Remove them; use `vlist/synthetic` for the full logical range. Config no longer installs a scale stub. |
|
|
106
105
|
|
|
107
|
-
Removed
|
|
106
|
+
Removed mode/runway options throw a migration error before creating DOM. `vlist/config` retains scrollbar omission/options convenience and its top-level `scrollbar: "none"` option. `baseOffset` stays private engine state; plugins use `ctx.scroll.getRenderOrigin()`. Custom wrap providers now supply their handler factory as the second argument of `ctx.setBoundedWrap`.
|
|
108
107
|
|
|
109
108
|
## Plugins
|
|
110
109
|
|
|
111
110
|
| Entry / export | Minified | Gzipped |
|
|
112
111
|
|---|---:|---:|
|
|
113
|
-
| **Base (`vlist`)** |
|
|
114
|
-
| `vlist/synthetic`
|
|
115
|
-
| `vlist/native` |
|
|
116
|
-
| `a11y()` |
|
|
117
|
-
| `selection()` |
|
|
118
|
-
| `data()` |
|
|
119
|
-
| `scrollbar()` |
|
|
120
|
-
| `sortable()` |
|
|
121
|
-
| `groups()` |
|
|
122
|
-
| `page()` |
|
|
123
|
-
| `snapshots()` |
|
|
124
|
-
| `transition()` |
|
|
125
|
-
| `autosize()` |
|
|
126
|
-
| `grid()` |
|
|
127
|
-
| `table()` |
|
|
128
|
-
| `masonry()` |
|
|
129
|
-
| `tree()` |
|
|
130
|
-
| `search()` |
|
|
131
|
-
| `carousel()` |
|
|
132
|
-
|
|
133
|
-
Sizes are tree-shaken totals from `bun run size`, not additive plugin costs. Plugin rows
|
|
112
|
+
| **Base (`vlist`)** | 25.4 KB | 9.3 KB |
|
|
113
|
+
| `vlist/synthetic` | 31.1 KB | 11.4 KB |
|
|
114
|
+
| `vlist/native` (alias) | 25.4 KB | 9.3 KB |
|
|
115
|
+
| `a11y()` | 28.7 KB | 10.5 KB |
|
|
116
|
+
| `selection()` | 34.8 KB | 12.1 KB |
|
|
117
|
+
| `data()` | 39.0 KB | 14.1 KB |
|
|
118
|
+
| `scrollbar()` | 33.6 KB | 12.2 KB |
|
|
119
|
+
| `sortable()` | 34.9 KB | 12.2 KB |
|
|
120
|
+
| `groups()` | 41.3 KB | 14.6 KB |
|
|
121
|
+
| `page()` | 27.9 KB | 10.2 KB |
|
|
122
|
+
| `snapshots()` | 28.7 KB | 10.4 KB |
|
|
123
|
+
| `transition()` | 32.1 KB | 11.3 KB |
|
|
124
|
+
| `autosize()` | 28.5 KB | 10.3 KB |
|
|
125
|
+
| `grid()` | 32.5 KB | 11.8 KB |
|
|
126
|
+
| `table()` | 43.8 KB | 15.2 KB |
|
|
127
|
+
| `masonry()` | 36.8 KB | 13.4 KB |
|
|
128
|
+
| `tree()` | 40.6 KB | 14.3 KB |
|
|
129
|
+
| `search()` | 34.5 KB | 12.4 KB |
|
|
130
|
+
| `carousel()` | 38.0 KB | 13.7 KB |
|
|
131
|
+
|
|
132
|
+
Sizes are tree-shaken totals from `bun run size`, not additive plugin costs. Plugin rows include the native default factory plus that plugin. The base is **9,523 bytes gzipped**, below the 9.9 KB target; synthetic input is **11,687 bytes** before plugins. The alias row measures the same source factory; the distributed alias re-exports it without duplicating the implementation.
|
|
134
133
|
|
|
135
134
|
## Framework Adapters
|
|
136
135
|
|
|
@@ -141,11 +140,11 @@ Sizes are tree-shaken totals from `bun run size`, not additive plugin costs. Plu
|
|
|
141
140
|
| SolidJS | [`vlist-solidjs`](https://github.com/floor/vlist-solidjs) | 0.5 KB |
|
|
142
141
|
| React | [`vlist-react`](https://github.com/floor/vlist-react) | 0.6 KB |
|
|
143
142
|
|
|
144
|
-
Adapters use
|
|
143
|
+
Adapters use native scrolling by default. With an adapter that forwards `factory`, select synthetic input explicitly:
|
|
145
144
|
|
|
146
145
|
```ts
|
|
147
146
|
import { useVList } from "vlist-react";
|
|
148
|
-
import { createVList } from "vlist/
|
|
147
|
+
import { createVList } from "vlist/synthetic";
|
|
149
148
|
|
|
150
149
|
useVList({
|
|
151
150
|
factory: createVList,
|
|
@@ -154,7 +153,7 @@ useVList({
|
|
|
154
153
|
});
|
|
155
154
|
```
|
|
156
155
|
|
|
157
|
-
The same factory option is available to the other adapters. `vlist/config` defaults to
|
|
156
|
+
The same factory option is available to the other adapters. `vlist/config` defaults to native scrolling. The factory is structural configuration: changing it requires recreating the list.
|
|
158
157
|
|
|
159
158
|
## Docs & Examples
|
|
160
159
|
|
package/dist/config.d.ts
CHANGED
|
@@ -15,9 +15,8 @@
|
|
|
15
15
|
* lean and tree-shakeable; only consumers that opt into the batteries-included
|
|
16
16
|
* config (the adapters) pull in this module and, with it, every plugin it wires.
|
|
17
17
|
*/
|
|
18
|
-
import type { VListItem, GroupsConfig, VListAdapter } from "./types";
|
|
18
|
+
import type { VListItem, GroupsConfig, VListAdapter, ScrollConfig } from "./types";
|
|
19
19
|
import { createVList } from "./core/create";
|
|
20
|
-
import type { NativeScrollConfig } from "./native";
|
|
21
20
|
import type { CreateVListConfig, VList, VListPlugin } from "./core/types";
|
|
22
21
|
import type { DataPluginConfig } from "./plugins/data";
|
|
23
22
|
import type { GridPluginConfig } from "./plugins/grid";
|
|
@@ -33,8 +32,8 @@ export type VListFactory<T extends VListItem = VListItem> = typeof createVList<T
|
|
|
33
32
|
* translated into plugins by {@link resolvePlugins}.
|
|
34
33
|
*/
|
|
35
34
|
export interface VListConfig<T extends VListItem = VListItem> extends Omit<CreateVListConfig<T>, "container" | "scroll"> {
|
|
36
|
-
/**
|
|
37
|
-
scroll?:
|
|
35
|
+
/** Scroll options; select synthetic input with a factory from vlist/synthetic. */
|
|
36
|
+
scroll?: ScrollConfig;
|
|
38
37
|
/** List factory; defaults to core createVList. Fixed for this instance. */
|
|
39
38
|
factory?: VListFactory<T>;
|
|
40
39
|
/** Layout mode. Wires the grid or masonry plugin from `grid`/`masonry`. */
|