@virtual-content/core 0.1.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/LICENSE +21 -0
- package/README.md +39 -0
- package/dist/index.cjs +1433 -0
- package/dist/index.d.cts +422 -0
- package/dist/index.d.ts +422 -0
- package/dist/index.js +1395 -0
- package/package.json +51 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 eykettle
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# @virtual-content/core
|
|
2
|
+
|
|
3
|
+
Framework-independent virtual content engine package.
|
|
4
|
+
|
|
5
|
+
This package provides the core virtualizer, geometry helpers, layout engines, range calculation,
|
|
6
|
+
anchor correction, and shared types.
|
|
7
|
+
|
|
8
|
+
The current public line is `0.1.x`. The package is usable, but the API is still pre-1.0 and may
|
|
9
|
+
receive small contract adjustments before `1.0.0`.
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
pnpm add @virtual-content/core
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Entry Point
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
import { Virtualizer, createRect } from "@virtual-content/core";
|
|
21
|
+
import type { VirtualContentOptions } from "@virtual-content/core";
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Use this package directly when building a framework adapter, a custom renderer, or non-DOM virtual
|
|
25
|
+
content logic. Solid applications should usually install `@virtual-content/solid` instead.
|
|
26
|
+
|
|
27
|
+
Current layout engines:
|
|
28
|
+
|
|
29
|
+
- `LinearBandEngine` for `linear` and current `grid` layouts.
|
|
30
|
+
- `SpatialRectEngine` for `masonry` and `free` layouts.
|
|
31
|
+
|
|
32
|
+
Current `grid` support is band virtualization. The public layout API keeps `lanes` and
|
|
33
|
+
`gap.cross` as target grid design fields, but item-level lane placement is not implemented yet.
|
|
34
|
+
For spatial layouts, `range.maxItems` is the implemented materialization cap; `range.maxPx` is
|
|
35
|
+
currently limited to linear and grid band ranges.
|
|
36
|
+
|
|
37
|
+
The beta layout contract treats `layout.gap` as virtual item or band spacing and
|
|
38
|
+
`layout.padding` as scrollable content canvas inset. These values belong in core geometry rather
|
|
39
|
+
than adapter CSS so range calculation, scroll targets, total size, and anchor correction agree.
|