react-virtual-renderer 1.1.3 → 1.1.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/dist/App.d.ts.map +1 -1
- package/dist/App.js +65 -3
- package/dist/App.js.map +1 -1
- package/dist/components/VirtualGrid.d.ts +30 -0
- package/dist/components/VirtualGrid.d.ts.map +1 -1
- package/dist/components/VirtualGrid.js +147 -117
- package/dist/components/VirtualGrid.js.map +1 -1
- package/dist/components/VirtualList.d.ts +0 -4
- package/dist/components/VirtualList.d.ts.map +1 -1
- package/dist/components/VirtualList.js +76 -86
- package/dist/components/VirtualList.js.map +1 -1
- package/dist/components/VirtualLiveRegion.d.ts +12 -0
- package/dist/components/VirtualLiveRegion.d.ts.map +1 -0
- package/dist/components/VirtualLiveRegion.js +27 -0
- package/dist/components/VirtualLiveRegion.js.map +1 -0
- package/dist/core/FenwickTree.d.ts +47 -0
- package/dist/core/FenwickTree.d.ts.map +1 -0
- package/dist/core/FenwickTree.js +206 -0
- package/dist/core/FenwickTree.js.map +1 -0
- package/dist/core/GridLayoutEngine.d.ts +64 -0
- package/dist/core/GridLayoutEngine.d.ts.map +1 -0
- package/dist/core/GridLayoutEngine.js +153 -0
- package/dist/core/GridLayoutEngine.js.map +1 -0
- package/dist/core/GroupedListEngine.d.ts +21 -0
- package/dist/core/GroupedListEngine.d.ts.map +1 -0
- package/dist/core/GroupedListEngine.js +22 -0
- package/dist/core/GroupedListEngine.js.map +1 -0
- package/dist/core/ListController.d.ts +31 -0
- package/dist/core/ListController.d.ts.map +1 -0
- package/dist/core/ListController.js +71 -0
- package/dist/core/ListController.js.map +1 -0
- package/dist/core/MeasurementSystem.d.ts +1 -1
- package/dist/core/MeasurementSystem.d.ts.map +1 -1
- package/dist/core/MeasurementSystem.js +22 -10
- package/dist/core/MeasurementSystem.js.map +1 -1
- package/dist/core/VirtualizationEngine.d.ts +24 -13
- package/dist/core/VirtualizationEngine.d.ts.map +1 -1
- package/dist/core/VirtualizationEngine.js +50 -87
- package/dist/core/VirtualizationEngine.js.map +1 -1
- package/dist/examples/DynamicHeightLists.d.ts +2 -0
- package/dist/examples/DynamicHeightLists.d.ts.map +1 -0
- package/dist/examples/DynamicHeightLists.js +42 -0
- package/dist/examples/DynamicHeightLists.js.map +1 -0
- package/dist/examples/FixedGrid.d.ts +2 -0
- package/dist/examples/FixedGrid.d.ts.map +1 -0
- package/dist/examples/FixedGrid.js +40 -0
- package/dist/examples/FixedGrid.js.map +1 -0
- package/dist/examples/GroupedContactList.d.ts +2 -0
- package/dist/examples/GroupedContactList.d.ts.map +1 -0
- package/dist/examples/GroupedContactList.js +20 -0
- package/dist/examples/GroupedContactList.js.map +1 -0
- package/dist/examples/InfiniteScrollLists.d.ts +2 -0
- package/dist/examples/InfiniteScrollLists.d.ts.map +1 -0
- package/dist/examples/InfiniteScrollLists.js +93 -0
- package/dist/examples/InfiniteScrollLists.js.map +1 -0
- package/dist/examples/MasonaryGrid.d.ts +2 -0
- package/dist/examples/MasonaryGrid.d.ts.map +1 -0
- package/dist/examples/MasonaryGrid.js +36 -0
- package/dist/examples/MasonaryGrid.js.map +1 -0
- package/dist/examples/PerfHarness.d.ts +2 -0
- package/dist/examples/PerfHarness.d.ts.map +1 -0
- package/dist/examples/PerfHarness.js +131 -0
- package/dist/examples/PerfHarness.js.map +1 -0
- package/dist/hooks/useBidirectionalInfiniteScroll.d.ts +32 -0
- package/dist/hooks/useBidirectionalInfiniteScroll.d.ts.map +1 -0
- package/dist/hooks/useBidirectionalInfiniteScroll.js +89 -0
- package/dist/hooks/useBidirectionalInfiniteScroll.js.map +1 -0
- package/dist/hooks/useInfiniteScroll.d.ts +36 -12
- package/dist/hooks/useInfiniteScroll.d.ts.map +1 -1
- package/dist/hooks/useInfiniteScroll.js +46 -45
- package/dist/hooks/useInfiniteScroll.js.map +1 -1
- package/dist/hooks/useRevoingTabIndex.d.ts +11 -0
- package/dist/hooks/useRevoingTabIndex.d.ts.map +1 -0
- package/dist/hooks/useRevoingTabIndex.js +28 -0
- package/dist/hooks/useRevoingTabIndex.js.map +1 -0
- package/dist/hooks/useVirtualAllyProps.d.ts +23 -0
- package/dist/hooks/useVirtualAllyProps.d.ts.map +1 -0
- package/dist/hooks/useVirtualAllyProps.js +25 -0
- package/dist/hooks/useVirtualAllyProps.js.map +1 -0
- package/dist/hooks/useVirtualList.d.ts +2 -0
- package/dist/hooks/useVirtualList.d.ts.map +1 -1
- package/dist/hooks/useVirtualList.js +12 -4
- package/dist/hooks/useVirtualList.js.map +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/main.js +4 -4
- package/dist/main.js.map +1 -1
- package/dist/types.d.ts +10 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,10 +1,26 @@
|
|
|
1
|
+
import { FenwickTree } from './FenwickTree';
|
|
2
|
+
/**
|
|
3
|
+
* Core offset/range math shared by VirtualList and VirtualGrid.
|
|
4
|
+
*
|
|
5
|
+
* PERFORMANCE: previously this held a plain prefix-sum array and a
|
|
6
|
+
* `dirty` flag, rebuilding the WHOLE array (O(n)) the next time
|
|
7
|
+
* anything was read after any single item's size changed. Every read
|
|
8
|
+
* (getItemOffset, getTotalSize, the binary search for visible range)
|
|
9
|
+
* paid that O(n) cost whenever a measurement had landed since the last
|
|
10
|
+
* read - which, for a dynamic-height list, is essentially every scroll
|
|
11
|
+
* frame.
|
|
12
|
+
*
|
|
13
|
+
* This version is backed by a FenwickTree (see FenwickTree.ts). There
|
|
14
|
+
* is no dirty flag and no rebuild: every operation below is O(log n),
|
|
15
|
+
* full stop, regardless of how many items have been re-measured.
|
|
16
|
+
*/
|
|
1
17
|
export class VirtualizationEngine {
|
|
2
18
|
constructor(estimatedItemSize = 35) {
|
|
3
|
-
Object.defineProperty(this, "
|
|
19
|
+
Object.defineProperty(this, "tree", {
|
|
4
20
|
enumerable: true,
|
|
5
21
|
configurable: true,
|
|
6
22
|
writable: true,
|
|
7
|
-
value:
|
|
23
|
+
value: void 0
|
|
8
24
|
});
|
|
9
25
|
Object.defineProperty(this, "estimatedItemSize", {
|
|
10
26
|
enumerable: true,
|
|
@@ -18,117 +34,64 @@ export class VirtualizationEngine {
|
|
|
18
34
|
writable: true,
|
|
19
35
|
value: 0
|
|
20
36
|
});
|
|
21
|
-
// prefix sum cache
|
|
22
|
-
Object.defineProperty(this, "prefix", {
|
|
23
|
-
enumerable: true,
|
|
24
|
-
configurable: true,
|
|
25
|
-
writable: true,
|
|
26
|
-
value: [0]
|
|
27
|
-
});
|
|
28
|
-
Object.defineProperty(this, "dirty", {
|
|
29
|
-
enumerable: true,
|
|
30
|
-
configurable: true,
|
|
31
|
-
writable: true,
|
|
32
|
-
value: true
|
|
33
|
-
});
|
|
34
37
|
this.estimatedItemSize = estimatedItemSize;
|
|
38
|
+
this.tree = new FenwickTree(0);
|
|
35
39
|
}
|
|
36
40
|
setItemCount(count) {
|
|
37
|
-
|
|
38
|
-
* FIX: previously this unconditionally set `dirty = true`
|
|
39
|
-
* on every call, even when the count hadn't changed. Since
|
|
40
|
-
* getVisibleRange() calls setItemCount() on every single
|
|
41
|
-
* invocation (i.e. every scroll frame), that forced a full
|
|
42
|
-
* O(n) prefix-sum rebuild every frame regardless of whether
|
|
43
|
-
* anything actually changed.
|
|
44
|
-
*
|
|
45
|
-
* Now we only mark dirty when the count actually differs.
|
|
46
|
-
* Measurement updates still mark dirty via recordItemSize(),
|
|
47
|
-
* so cache invalidation on real changes is unaffected.
|
|
48
|
-
*/
|
|
49
|
-
if (this.itemCount === count) {
|
|
41
|
+
if (this.itemCount === count)
|
|
50
42
|
return;
|
|
51
|
-
|
|
43
|
+
this.tree.resize(count, this.estimatedItemSize);
|
|
52
44
|
this.itemCount = count;
|
|
53
|
-
this.dirty = true;
|
|
54
45
|
}
|
|
55
46
|
recordItemSize(index, size) {
|
|
56
|
-
if (
|
|
47
|
+
if (index < 0 || index >= this.itemCount)
|
|
57
48
|
return;
|
|
58
|
-
this.
|
|
59
|
-
this.dirty = true;
|
|
49
|
+
this.tree.update(index, size);
|
|
60
50
|
}
|
|
61
51
|
/**
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
* until they are re-measured and recordItemSize() is called
|
|
66
|
-
* again for them.
|
|
52
|
+
* Invalidate cached measurements from `fromIndex` onward
|
|
53
|
+
* (inclusive), or everything if omitted. Affected indices fall
|
|
54
|
+
* back to `estimatedItemSize` until re-measured.
|
|
67
55
|
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
56
|
+
* Each reset index is a single O(log n) point update - so
|
|
57
|
+
* invalidating a suffix of k items is O(k log n), not a full
|
|
58
|
+
* array rebuild. A full invalidate (no fromIndex) is the one
|
|
59
|
+
* intentionally O(n) path in this class, reserved for "the whole
|
|
60
|
+
* dataset changed" situations, not the scroll hot path.
|
|
71
61
|
*/
|
|
72
62
|
invalidateFrom(fromIndex) {
|
|
73
63
|
if (fromIndex === undefined) {
|
|
74
|
-
this.
|
|
75
|
-
this.dirty = true;
|
|
64
|
+
this.tree.resetAll(this.estimatedItemSize);
|
|
76
65
|
return;
|
|
77
66
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
for (const key of Object.keys(this.itemSizeMap)) {
|
|
82
|
-
const index = Number(key);
|
|
83
|
-
if (index >= fromIndex) {
|
|
84
|
-
delete this.itemSizeMap[index];
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
this.dirty = true;
|
|
88
|
-
}
|
|
89
|
-
rebuildPrefix() {
|
|
90
|
-
let sum = 0;
|
|
91
|
-
this.prefix = [0];
|
|
92
|
-
for (let i = 0; i < this.itemCount; i++) {
|
|
93
|
-
sum += this.itemSizeMap[i] ?? this.estimatedItemSize;
|
|
94
|
-
this.prefix[i + 1] = sum;
|
|
67
|
+
const start = Math.max(0, fromIndex);
|
|
68
|
+
for (let i = start; i < this.itemCount; i++) {
|
|
69
|
+
this.tree.update(i, this.estimatedItemSize);
|
|
95
70
|
}
|
|
96
|
-
this.dirty = false;
|
|
97
71
|
}
|
|
98
72
|
getItemSize(index) {
|
|
99
|
-
|
|
73
|
+
if (index < 0 || index >= this.itemCount)
|
|
74
|
+
return this.estimatedItemSize;
|
|
75
|
+
return this.tree.getValue(index);
|
|
100
76
|
}
|
|
101
77
|
getItemOffset(index) {
|
|
102
|
-
|
|
103
|
-
this.rebuildPrefix();
|
|
104
|
-
return this.prefix[index] ?? 0;
|
|
78
|
+
return this.tree.prefixSum(Math.max(0, index));
|
|
105
79
|
}
|
|
106
80
|
getTotalSize() {
|
|
107
|
-
|
|
108
|
-
this.rebuildPrefix();
|
|
109
|
-
return this.prefix[this.itemCount] || 0;
|
|
110
|
-
}
|
|
111
|
-
binarySearch(offset) {
|
|
112
|
-
if (this.dirty)
|
|
113
|
-
this.rebuildPrefix();
|
|
114
|
-
let low = 0;
|
|
115
|
-
let high = this.itemCount - 1;
|
|
116
|
-
while (low <= high) {
|
|
117
|
-
const mid = (low + high) >> 1;
|
|
118
|
-
const value = this.prefix[mid];
|
|
119
|
-
if (value === offset)
|
|
120
|
-
return mid;
|
|
121
|
-
if (value < offset)
|
|
122
|
-
low = mid + 1;
|
|
123
|
-
else
|
|
124
|
-
high = mid - 1;
|
|
125
|
-
}
|
|
126
|
-
return Math.max(0, low - 1);
|
|
81
|
+
return this.tree.total();
|
|
127
82
|
}
|
|
128
83
|
getVisibleRange(scrollOffset, containerSize, itemCount, overscan = 5) {
|
|
129
84
|
this.setItemCount(itemCount);
|
|
130
|
-
|
|
131
|
-
|
|
85
|
+
if (itemCount === 0) {
|
|
86
|
+
return {
|
|
87
|
+
startIndex: 0,
|
|
88
|
+
endIndex: -1,
|
|
89
|
+
overscanStartIndex: 0,
|
|
90
|
+
overscanEndIndex: -1,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
const start = this.tree.findIndexAtOffset(scrollOffset);
|
|
94
|
+
const end = this.tree.findIndexAtOffset(scrollOffset + containerSize);
|
|
132
95
|
return {
|
|
133
96
|
startIndex: Math.max(0, start - overscan),
|
|
134
97
|
endIndex: Math.min(itemCount - 1, end + overscan),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VirtualizationEngine.js","sourceRoot":"","sources":["../../src/core/VirtualizationEngine.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"VirtualizationEngine.js","sourceRoot":"","sources":["../../src/core/VirtualizationEngine.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C;;;;;;;;;;;;;;GAcG;AACH,MAAM,OAAO,oBAAoB;IAK7B,YAAY,iBAAiB,GAAG,EAAE;QAJ1B;;;;;WAAkB;QAClB;;;;;WAA0B;QAC1B;;;;mBAAY,CAAC;WAAC;QAGlB,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;QAC3C,IAAI,CAAC,IAAI,GAAG,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC;IACnC,CAAC;IAED,YAAY,CAAC,KAAa;QACtB,IAAI,IAAI,CAAC,SAAS,KAAK,KAAK;YAAE,OAAO;QACrC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,iBAAiB,CAAC,CAAC;QAChD,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;IAC3B,CAAC;IAED,cAAc,CAAC,KAAa,EAAE,IAAY;QACtC,IAAI,KAAK,GAAG,CAAC,IAAI,KAAK,IAAI,IAAI,CAAC,SAAS;YAAE,OAAO;QACjD,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAClC,CAAC;IAED;;;;;;;;;;OAUG;IACH,cAAc,CAAC,SAAkB;QAC7B,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;YAC1B,IAAI,CAAC,IAAI,CAA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AAK,KAAK,EAAE,CAAC;YACtB,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAAC,CAAC;QACtD,CAAC;QAED,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IAC/B,CAAC;CACJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DynamicHeightLists.d.ts","sourceRoot":"","sources":["../../src/examples/DynamicHeightLists.tsx"],"names":[],"mappings":"AAqDA,MAAM,CAAC,OAAO,UAAU,wBAAwB,4CAyD/C"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { VirtualList } from "../components/VirtualList";
|
|
4
|
+
async function fetchRealComments(signal) {
|
|
5
|
+
const res = await fetch("https://jsonplaceholder.typicode.com/comments", { signal });
|
|
6
|
+
if (!res.ok)
|
|
7
|
+
throw new Error(`Failed to fetch comments: ${res.status}`);
|
|
8
|
+
return res.json();
|
|
9
|
+
}
|
|
10
|
+
function tileToTargetSize(source, targetCount) {
|
|
11
|
+
return Array.from({ length: targetCount }, (_, i) => {
|
|
12
|
+
const src = source[i % source.length];
|
|
13
|
+
return { id: i, author: src.email, body: src.body };
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
const TARGET_COUNT = 50000;
|
|
17
|
+
export default function DynamicHeightListExample() {
|
|
18
|
+
const [comments, setComments] = React.useState(null);
|
|
19
|
+
const [error, setError] = React.useState(null);
|
|
20
|
+
const listRef = React.useRef(null);
|
|
21
|
+
React.useEffect(() => {
|
|
22
|
+
const controller = new AbortController();
|
|
23
|
+
fetchRealComments(controller.signal)
|
|
24
|
+
.then((raw) => setComments(tileToTargetSize(raw, TARGET_COUNT)))
|
|
25
|
+
.catch((err) => {
|
|
26
|
+
if (!controller.signal.aborted) {
|
|
27
|
+
setError(err instanceof Error ? err.message : "Failed to load comments");
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
return () => controller.abort();
|
|
31
|
+
}, []);
|
|
32
|
+
if (error) {
|
|
33
|
+
return _jsx("div", { style: { padding: 16, color: "#b91c1c" }, children: error });
|
|
34
|
+
}
|
|
35
|
+
if (!comments) {
|
|
36
|
+
return _jsx("div", { style: { padding: 16, color: "#888" }, children: "Loading real comment data\u2026" });
|
|
37
|
+
}
|
|
38
|
+
return (_jsxs("div", { children: [_jsx("div", { style: { marginBottom: 8 }, children: _jsx("button", { onClick: () => {
|
|
39
|
+
listRef.current?.scrollTo({ top: 500000, behavior: "smooth" });
|
|
40
|
+
}, children: "Jump deep into the list (tests offset math on unmeasured items)" }) }), _jsx(VirtualList, { ref: listRef, items: comments, height: 600, width: "100%", estimatedItemSize: 90, overscan: 6, itemKey: (_, item) => item.id, itemStyle: { borderBottom: "1px solid #eee", padding: "8px 12px" }, renderItem: ({ item }) => (_jsxs("div", { children: [_jsx("strong", { children: item.author }), _jsx("p", { style: { margin: "4px 0 0" }, children: item.body })] })) })] }));
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=DynamicHeightLists.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DynamicHeightLists.js","sourceRoot":"","sources":["../../src/examples/DynamicHeightLists.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAqCxD,KAAK,UAAU,iBAAiB,CAAC,MAAmB;IAChD,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,+CAA+C,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;IACrF,IAAI,CAAC,GAAG,CAAC,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,6BAA6B,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;IACxE,OAAO,GAAG,CAAC,IAAI,EAAE,CAAC;AACtB,CAA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Grid.d.ts","sourceRoot":"","sources":["../../src/examples/FixedGrid.tsx"],"names":[],"mappings":"AAoDA,MAAM,CAAC,OAAO,UAAU,gBAAgB,4CAwDvC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { VirtualGrid } from "../components/VirtualGrid";
|
|
4
|
+
async function fetchRealProducts(signal) {
|
|
5
|
+
const res = await fetch("https://dummyjson.com/products?limit=194", { signal });
|
|
6
|
+
if (!res.ok)
|
|
7
|
+
throw new Error(`Failed to fetch products: ${res.status}`);
|
|
8
|
+
const data = await res.json();
|
|
9
|
+
return data.products;
|
|
10
|
+
}
|
|
11
|
+
function tileToTargetSize(source, targetCount) {
|
|
12
|
+
return Array.from({ length: targetCount }, (_, i) => {
|
|
13
|
+
const src = source[i % source.length];
|
|
14
|
+
return { id: i, name: src.title, price: src.price, thumbnail: src.thumbnail };
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
const TARGET_COUNT = 200000;
|
|
18
|
+
export default function FixedGridExample() {
|
|
19
|
+
const [products, setProducts] = React.useState(null);
|
|
20
|
+
const [error, setError] = React.useState(null);
|
|
21
|
+
React.useEffect(() => {
|
|
22
|
+
const controller = new AbortController();
|
|
23
|
+
fetchRealProducts(controller.signal)
|
|
24
|
+
.then((raw) => setProducts(tileToTargetSize(raw, TARGET_COUNT)))
|
|
25
|
+
.catch((err) => {
|
|
26
|
+
if (!controller.signal.aborted) {
|
|
27
|
+
setError(err instanceof Error ? err.message : "Failed to load products");
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
return () => controller.abort();
|
|
31
|
+
}, []);
|
|
32
|
+
if (error) {
|
|
33
|
+
return _jsx("div", { style: { padding: 16, color: "#b91c1c" }, children: error });
|
|
34
|
+
}
|
|
35
|
+
if (!products) {
|
|
36
|
+
return _jsx("div", { style: { padding: 16, color: "#888" }, children: "Loading real product data\u2026" });
|
|
37
|
+
}
|
|
38
|
+
return (_jsx(VirtualGrid, { items: products, layout: "grid", columnCount: "auto", rowHeight: 220, gap: 16, height: 700, width: "100%", overscan: 8, itemKey: (_, item) => item.id, itemStyle: { borderRadius: 8, overflow: "hidden", border: "1px solid #eee" }, renderItem: ({ item }) => (_jsxs("div", { style: { display: "flex", flexDirection: "column", height: "100%" }, children: [_jsx("img", { src: item.thumbnail, alt: item.name, loading: "lazy", style: { flex: 1, width: "100%", objectFit: "cover" } }), _jsxs("div", { style: { padding: 8 }, children: [_jsx("div", { style: { fontWeight: 600, whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" }, children: item.name }), _jsxs("div", { style: { color: "#555" }, children: ["$", item.price.toFixed(2)] })] })] })) }));
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=FixedGrid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FixedGrid.js","sourceRoot":"","sources":["../../src/examples/FixedGrid.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAmCxD,KAAK,UAAU,iBAAiB,CAAC,MAAmB;IAChD,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,0CAA0C,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;IAChF,IAAI,CAAC,GAAG,CAAC,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,6BAA6B,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;IACxE,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;IAC9B,OAAO,IAAI,CAAC,QAAQ,CAAC;AACzB,CAAC;AAED,SAAS,gBAAgB,CAAC,MAAoB,EAAE,WAAmB;IAC/D,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QA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AAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAO,IAC3D,IACJ,CACT,GACH,CACL,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GroupedContactList.d.ts","sourceRoot":"","sources":["../../src/examples/GroupedContactList.tsx"],"names":[],"mappings":"AAcA,MAAM,CAAC,OAAO,UAAU,yBAAyB,4CAkChD"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// examples/GroupedContactList.tsx
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { VirtualList } from '../components/VirtualList';
|
|
5
|
+
import { flattenGroups } from '../core/GroupedListEngine';
|
|
6
|
+
const FIRST_NAMES = [
|
|
7
|
+
'Amara', 'Beatrix', 'Cyrus', 'Dahlia', 'Elias', 'Farah', 'Gideon', 'Harlow',
|
|
8
|
+
'Ines', 'Jasper', 'Kira', 'Lior', 'Marisol', 'Noor', 'Otis', 'Priya',
|
|
9
|
+
'Quinn', 'Rosalind', 'Soren', 'Talia', 'Uma', 'Vance', 'Willa', 'Xiomara',
|
|
10
|
+
'Yusuf', 'Zara',
|
|
11
|
+
];
|
|
12
|
+
export default function GroupedContactListExample() {
|
|
13
|
+
const contacts = React.useMemo(() => Array.from({ length: 5000 }, (_, i) => {
|
|
14
|
+
const first = FIRST_NAMES[i % FIRST_NAMES.length];
|
|
15
|
+
return { id: i, name: `${first} ${String(i).padStart(4, '0')}` };
|
|
16
|
+
}).sort((a, b) => a.name.localeCompare(b.name)), []);
|
|
17
|
+
const { rows, stickyIndices } = React.useMemo(() => flattenGroups({ items: contacts, getGroupKey: (c) => c.name[0].toUpperCase() }), [contacts]);
|
|
18
|
+
return (_jsx(VirtualList, { items: rows, height: 600, width: "100%", estimatedItemSize: 44, stickyIndices: stickyIndices, itemKey: (_, row) => (row.type === 'header' ? `h-${row.groupKey}` : row.item.id), renderItem: ({ item: row }) => row.type === 'header' ? (_jsx("div", { style: { background: '#f8f9fa', fontWeight: 700, padding: '6px 12px' }, children: row.groupKey })) : (_jsx("div", { style: { padding: '10px 12px' }, children: row.item.name })) }));
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=GroupedContactList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GroupedContactList.js","sourceRoot":"","sources":["../../src/examples/GroupedContactList.tsx"],"names":[],"mappings":";AAAA,kCAAkC;AAClC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAI1D,MAAM,WAAW,GAAG;IAChB,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ;IAC3E,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO;IACpE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS;IACzE,OAAO,EAAE,MAAM;CAClB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,yBAAyB;IAC7C,MAAM,QAAQ,GAAc,KAAK,CAAC,OAAO,CACrC,GAAG,EAAE,CACD,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QAClC,MAAM,KAAK,GAAG,WAAW,CAAC,CAAC,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;QAClD,OAAO,EAAE,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,GAAG,KAAK,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC;IACrE,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
+
{"version":3,"file":"InfiniteScrollLists.d.ts","sourceRoot":"","sources":["../../src/examples/InfiniteScrollLists.tsx"],"names":[],"mappings":"AA6EA,MAAM,CAAC,OAAO,UAAU,qBAAqB,4CA4H5C"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { VirtualList } from "../components/VirtualList";
|
|
4
|
+
import { useInfiniteScroll } from "../hooks/useInfiniteScroll";
|
|
5
|
+
const PAGE_SIZE = 20;
|
|
6
|
+
async function fetchPostsPage(skip, signal) {
|
|
7
|
+
const res = await fetch(`https://dummyjson.com/posts?limit=${PAGE_SIZE}&skip=${skip}`, { signal });
|
|
8
|
+
if (!res.ok)
|
|
9
|
+
throw new Error(`Failed to fetch posts: ${res.status}`);
|
|
10
|
+
return res.json();
|
|
11
|
+
}
|
|
12
|
+
function normalizePost(raw) {
|
|
13
|
+
const reactions = typeof raw.reactions === "number"
|
|
14
|
+
? { likes: raw.reactions, dislikes: 0 }
|
|
15
|
+
: raw.reactions;
|
|
16
|
+
return {
|
|
17
|
+
id: raw.id,
|
|
18
|
+
title: raw.title,
|
|
19
|
+
body: raw.body,
|
|
20
|
+
tags: raw.tags,
|
|
21
|
+
likes: reactions.likes,
|
|
22
|
+
dislikes: reactions.dislikes,
|
|
23
|
+
views: raw.views,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export default function InfiniteScrollExample() {
|
|
27
|
+
const [items, setItems] = React.useState([]);
|
|
28
|
+
const [total, setTotal] = React.useState(null);
|
|
29
|
+
const [isLoading, setIsLoading] = React.useState(false);
|
|
30
|
+
const [error, setError] = React.useState(null);
|
|
31
|
+
const containerRef = React.useRef(null);
|
|
32
|
+
const abortRef = React.useRef(null);
|
|
33
|
+
const hasMore = total === null || items.length < total;
|
|
34
|
+
const loadMore = React.useCallback(async () => {
|
|
35
|
+
if (total !== null && items.length >= total)
|
|
36
|
+
return;
|
|
37
|
+
const controller = new AbortController();
|
|
38
|
+
abortRef.current = controller;
|
|
39
|
+
setIsLoading(true);
|
|
40
|
+
setError(null);
|
|
41
|
+
try {
|
|
42
|
+
const data = await fetchPostsPage(items.length, controller.signal);
|
|
43
|
+
setItems((prev) => [...prev, ...data.posts.map(normalizePost)]);
|
|
44
|
+
setTotal(data.total);
|
|
45
|
+
}
|
|
46
|
+
catch (err) {
|
|
47
|
+
if (!controller.signal.aborted) {
|
|
48
|
+
setError(err instanceof Error ? err.message : "Failed to load more posts");
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
finally {
|
|
52
|
+
if (!controller.signal.aborted)
|
|
53
|
+
setIsLoading(false);
|
|
54
|
+
}
|
|
55
|
+
}, [items.length, total]);
|
|
56
|
+
React.useEffect(() => {
|
|
57
|
+
loadMore();
|
|
58
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
59
|
+
}, []);
|
|
60
|
+
React.useEffect(() => {
|
|
61
|
+
return () => {
|
|
62
|
+
abortRef.current?.abort();
|
|
63
|
+
};
|
|
64
|
+
}, []);
|
|
65
|
+
const { sentinelRef } = useInfiniteScroll({
|
|
66
|
+
onLoadMore: loadMore,
|
|
67
|
+
isLoading,
|
|
68
|
+
enabled: hasMore,
|
|
69
|
+
root: containerRef,
|
|
70
|
+
rootMargin: "400px",
|
|
71
|
+
});
|
|
72
|
+
return (_jsxs("div", { children: [error && (_jsxs("div", { style: { padding: 8, color: "#b91c1c", fontSize: 13 }, children: [error, " \u2014", " ", _jsx("button", { onClick: () => loadMore(), style: { textDecoration: "underline" }, children: "retry" })] })), _jsx(VirtualList, { ref: containerRef, items: items, height: 600, width: "100%", estimatedItemSize: 140, itemKey: (_, item) => item.id, itemStyle: {
|
|
73
|
+
display: "flex",
|
|
74
|
+
flexDirection: "column",
|
|
75
|
+
gap: 6,
|
|
76
|
+
padding: "14px 16px",
|
|
77
|
+
borderBottom: "1px solid #eee",
|
|
78
|
+
}, renderItem: ({ item }) => (_jsxs(_Fragment, { children: [_jsx("div", { style: { fontWeight: 600, fontSize: 15 }, children: item.title }), _jsx("p", { style: { margin: 0, color: "#555", lineHeight: 1.5 }, children: item.body }), _jsx("div", { style: { display: "flex", gap: 6, flexWrap: "wrap", marginTop: 4 }, children: item.tags.map((tag) => (_jsxs("span", { style: {
|
|
79
|
+
fontSize: 12,
|
|
80
|
+
padding: "2px 8px",
|
|
81
|
+
borderRadius: 999,
|
|
82
|
+
background: "#f1f3f5",
|
|
83
|
+
color: "#495057",
|
|
84
|
+
}, children: ["#", tag] }, tag))) }), _jsxs("div", { style: { display: "flex", gap: 16, fontSize: 12, color: "#888", marginTop: 4 }, children: [_jsxs("span", { children: ["\uD83D\uDC4D ", item.likes] }), _jsxs("span", { children: ["\uD83D\uDC4E ", item.dislikes] }), _jsxs("span", { children: ["\uD83D\uDC41 ", item.views.toLocaleString(), " views"] })] })] })),
|
|
85
|
+
// sentinel is now ALWAYS mounted, independent of virtualization -
|
|
86
|
+
// this is the actual fix, not the renderItem branch above
|
|
87
|
+
footer: hasMore ? (_jsx("div", { ref: sentinelRef, style: { height: 1, width: "100%" } })) : null }), _jsx("div", { style: { textAlign: "center", padding: 12, color: "#888", fontSize: 13 }, children: isLoading
|
|
88
|
+
? "Loading more…"
|
|
89
|
+
: hasMore
|
|
90
|
+
? `Loaded ${items.length} of ${total ?? "…"} posts`
|
|
91
|
+
: `That's everything (${items.length} posts)` })] }));
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=InfiniteScrollLists.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InfiniteScrollLists.js","sourceRoot":"","sources":["../../src/examples/InfiniteScrollLists.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;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SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,EAAE,YACxE,SAAS;oBACN,CAAC,CAAC,eAAe;oBACjB,CAAC,CAAC,OAAO;wBACL,CAAC,CAAC,UAAU,KAAK,CAAC,MAAM,OAAO,KAAK,IAAI,GAAG,QAAQ;wBACnD,CAAC,CAAC,sBAAsB,KAAK,CAAC,MAAM,SAAS,GACnD,IACJ,CACT,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MasonaryGrid.d.ts","sourceRoot":"","sources":["../../src/examples/MasonaryGrid.tsx"],"names":[],"mappings":"AAoDA,MAAM,CAAC,OAAO,UAAU,kBAAkB,4CAiDzC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { VirtualGrid } from "../components/VirtualGrid";
|
|
4
|
+
/**
|
|
5
|
+
* Plain data generator - NOT a component or hook, so it must not call
|
|
6
|
+
* useState/useEffect/etc. (that was the bug in the previous version:
|
|
7
|
+
* a bare `[images] = useState(...)` inside a regular function violates
|
|
8
|
+
* the Rules of Hooks and silently breaks - hooks only run inside a
|
|
9
|
+
* component body or another hook).
|
|
10
|
+
*/
|
|
11
|
+
function makePhotos(startId, count) {
|
|
12
|
+
return Array.from({ length: count }, (_, i) => {
|
|
13
|
+
const id = startId + i;
|
|
14
|
+
// deterministic pseudo-random height per id, stable across re-renders -
|
|
15
|
+
// matches picsum's own {width}/{height} path so the requested image
|
|
16
|
+
// dimensions always equal the space we've reserved for it
|
|
17
|
+
const height = 220 + (id % 6) * 60;
|
|
18
|
+
return {
|
|
19
|
+
id,
|
|
20
|
+
url: `https://picsum.photos/500/${height}?random=${id}`,
|
|
21
|
+
title: `Beautiful Image ${id + 1}`,
|
|
22
|
+
height,
|
|
23
|
+
};
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
export default function MasonryGridExample() {
|
|
27
|
+
const [photos, setPhotos] = React.useState(() => makePhotos(0, 200));
|
|
28
|
+
const rowHeightForIndex = React.useCallback((index) => photos[index]?.height ?? 220, [photos]);
|
|
29
|
+
return (_jsxs("div", { children: [_jsx("div", { style: { marginBottom: 8, display: "flex", gap: 8, alignItems: "center" }, children: _jsxs("button", { onClick: () => setPhotos((prev) => [...prev, ...makePhotos(prev.length, 20)]), children: ["Load 20 more (", photos.length, " total) - watch this stay fast even at 50k+"] }) }), _jsx(VirtualGrid, { items: photos, layout: "masonry", columnCount: 5, rowHeight: rowHeightForIndex, gap: 12, height: 700, width: "100%", overscan: 6, itemKey: (_, item) => item.id, itemStyle: { borderRadius: 8, overflow: "hidden", background: "#eee" }, renderItem: ({ item }) => (_jsx("img", { src: item.url, alt: item.title, loading: "lazy", width: 500, height: item.height, style: {
|
|
30
|
+
width: "100%",
|
|
31
|
+
height: "100%",
|
|
32
|
+
objectFit: "cover",
|
|
33
|
+
display: "block",
|
|
34
|
+
} })) })] }));
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=MasonaryGrid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MasonaryGrid.js","sourceRoot":"","sources":["../../src/examples/MasonaryGrid.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AA4BxD;;;;;;GAMG;AACH,SAAS,UAAU,CAAC,OAAe,EAAE,KAAa;IAC9C,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QAC1C,MAAM,EAAE,GAAG,OAAO,GAAG,CAAC,CAAC;QACvB,wEAAwE;QACxE,oEAAoE;QACpE,0DAA0D;QAC1D,MAAM,MAAM,GAAG,GAAG,G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