chore: merge dev into v2 (#36770)

Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com>
Co-authored-by: usrnk1 <7547651+usrnk1@users.noreply.github.com>
Co-authored-by: Aarav Sareen <96787824+arvsrn@users.noreply.github.com>
Co-authored-by: Luke Parker <10430890+Hona@users.noreply.github.com>
Co-authored-by: Brendan Allan <git@brendonovich.dev>
Co-authored-by: Kit Langton <kit.langton@gmail.com>
Co-authored-by: James Long <longster@gmail.com>
Co-authored-by: Adam <2363879+adamdotdevin@users.noreply.github.com>
Co-authored-by: opencode-agent[bot] <219766164+opencode-agent[bot]@users.noreply.github.com>
Co-authored-by: Jay <53023+jayair@users.noreply.github.com>
Co-authored-by: Simon Klee <hello@simonklee.dk>
Co-authored-by: Jay <air@live.ca>
Co-authored-by: Jack <jack@anoma.ly>
Co-authored-by: David Hill <1879069+iamdavidhill@users.noreply.github.com>
Co-authored-by: Brendan Allan <14191578+Brendonovich@users.noreply.github.com>
Co-authored-by: opencode <opencode@sst.dev>
Co-authored-by: Aiden Cline <aidenpcline@gmail.com>
Co-authored-by: James Long <jlongster@users.noreply.github.com>
Co-authored-by: Dustin Deus <deusdustin@gmail.com>
Co-authored-by: 冯基魁 <56265583+fengjikui@users.noreply.github.com>
Co-authored-by: Frank <frank@anoma.ly>
Co-authored-by: Aiden Cline <rekram1-node@users.noreply.github.com>
Co-authored-by: Victor Navarro <vn4varro@gmail.com>
Co-authored-by: Dax Raad <d@ironbay.co>
Co-authored-by: Dax <mail@thdxr.com>
Co-authored-by: Nabs <nabil@instafork.com>
Co-authored-by: Vladimir Glafirov <vglafirov@gitlab.com>
Co-authored-by: AidenGeunGeun <eastlandwyvern@gmail.com>
Co-authored-by: Mark <geraint0923@users.noreply.github.com>
This commit is contained in:
opencode-agent[bot] 2026-07-14 09:58:18 -05:00 committed by GitHub
commit 634386fe0f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
116 changed files with 3764 additions and 1016 deletions

View file

@ -1,45 +0,0 @@
diff --git a/dist/cjs/index.cjs b/dist/cjs/index.cjs
index 7e97823ea769398ccd9cf449b178c77675ed252c..d75183f11421af0e20e4e8a996af99c300ad936d 100644
--- a/dist/cjs/index.cjs
+++ b/dist/cjs/index.cjs
@@ -39,7 +39,9 @@ function createVirtualizerBase(options) {
(_a = options.onChange) == null ? void 0 : _a.call(options, instance2, sync);
}
}));
- virtualizer.measure();
+ virtualizer._willUpdate();
+ setVirtualItems(store.reconcile(instance.getVirtualItems(), { key: "index" }));
+ setTotalSize(instance.getTotalSize());
});
return virtualizer;
}
diff --git a/dist/esm/index.js b/dist/esm/index.js
index 1d525463775fef3e8ece6ab191061ef9d0a36d73..14c680a2088c49a33959d8118cf32ee599ab83c2 100644
--- a/dist/esm/index.js
+++ b/dist/esm/index.js
@@ -38,7 +38,9 @@ function createVirtualizerBase(options) {
(_a = options.onChange) == null ? void 0 : _a.call(options, instance2, sync);
}
}));
- virtualizer.measure();
+ virtualizer._willUpdate();
+ setVirtualItems(reconcile(instance.getVirtualItems(), { key: "index" }));
+ setTotalSize(instance.getTotalSize());
});
return virtualizer;
}
diff --git a/src/index.tsx b/src/index.tsx
index 69ac34fd70753b9bd00683c2540be7f62630f8f2..9f16672aa0f4a044aa2b35754d385d7d8031f743 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -81,7 +81,9 @@ function createVirtualizerBase<
},
}),
)
- virtualizer.measure()
+ virtualizer._willUpdate()
+ setVirtualItems(reconcile(instance.getVirtualItems(), { key: 'index' }))
+ setTotalSize(instance.getTotalSize())
})
return virtualizer

View file

@ -1,105 +0,0 @@
diff --git a/dist/cjs/index.cjs b/dist/cjs/index.cjs
index df75d0cf0347b62906e04e454d4f4ef062ed5c48..e5110715b049c6c8b992bd1375a7432df7c0182e 100644
--- a/dist/cjs/index.cjs
+++ b/dist/cjs/index.cjs
@@ -526,6 +526,7 @@ class Virtualizer {
this.scrollOffset = this.scrollOffset ?? (typeof this.options.initialOffset === "function" ? this.options.initialOffset() : this.options.initialOffset);
return this.scrollOffset;
};
+ this.getLogicalScrollOffset = () => this.getScrollOffset() + this.scrollAdjustments;
this.getFurthestMeasurement = (measurements, index) => {
const furthestMeasurementsFound = /* @__PURE__ */ new Map();
const furthestMeasurements = /* @__PURE__ */ new Map();
@@ -715,10 +716,12 @@ class Virtualizer {
this.options.lanes
],
(measurements, outerSize, scrollOffset, lanes) => {
+ const maxScrollOffset = Math.max(this.getTotalSize() - outerSize, 0);
+ const effectiveScrollOffset = Math.min(Math.max(scrollOffset, 0), maxScrollOffset);
return this.range = measurements.length > 0 && outerSize > 0 ? calculateRange({
measurements,
outerSize,
- scrollOffset,
+ scrollOffset: effectiveScrollOffset,
lanes,
// Pass the typed array so binary search + forward-walk can
// read start/end directly from Float64Array, skipping the
diff --git a/dist/cjs/index.d.cts b/dist/cjs/index.d.cts
index c61ee17752565253f795c7fc7d57e86237ecbb52..705bb7e3a121b040fb1a3e7890179eaa3e9b219e 100644
--- a/dist/cjs/index.d.cts
+++ b/dist/cjs/index.d.cts
@@ -108,6 +108,7 @@ export declare class Virtualizer<TScrollElement extends Element | Window, TItemE
scrollRect: Rect | null;
scrollOffset: number | null;
scrollDirection: ScrollDirection | null;
+ getLogicalScrollOffset: () => number;
private scrollAdjustments;
private _iosDeferredAdjustment;
private _iosTouching;
diff --git a/dist/esm/index.d.ts b/dist/esm/index.d.ts
index b03abab604eb6578f6f56ff92c489259cfaf8f19..0495f372ea000dffc416c4f56809946f7ba73099 100644
--- a/dist/esm/index.d.ts
+++ b/dist/esm/index.d.ts
@@ -108,6 +108,7 @@ export declare class Virtualizer<TScrollElement extends Element | Window, TItemE
scrollRect: Rect | null;
scrollOffset: number | null;
scrollDirection: ScrollDirection | null;
+ getLogicalScrollOffset: () => number;
private scrollAdjustments;
private _iosDeferredAdjustment;
private _iosTouching;
diff --git a/dist/esm/index.js b/dist/esm/index.js
index e384cf7541978a2782b9dca68146e869b16ac3f2..77af22006325377bf9ca0052a3554f881f9e75fe 100644
--- a/dist/esm/index.js
+++ b/dist/esm/index.js
@@ -524,6 +524,7 @@ class Virtualizer {
this.scrollOffset = this.scrollOffset ?? (typeof this.options.initialOffset === "function" ? this.options.initialOffset() : this.options.initialOffset);
return this.scrollOffset;
};
+ this.getLogicalScrollOffset = () => this.getScrollOffset() + this.scrollAdjustments;
this.getFurthestMeasurement = (measurements, index) => {
const furthestMeasurementsFound = /* @__PURE__ */ new Map();
const furthestMeasurements = /* @__PURE__ */ new Map();
@@ -713,10 +714,12 @@ class Virtualizer {
this.options.lanes
],
(measurements, outerSize, scrollOffset, lanes) => {
+ const maxScrollOffset = Math.max(this.getTotalSize() - outerSize, 0);
+ const effectiveScrollOffset = Math.min(Math.max(scrollOffset, 0), maxScrollOffset);
return this.range = measurements.length > 0 && outerSize > 0 ? calculateRange({
measurements,
outerSize,
- scrollOffset,
+ scrollOffset: effectiveScrollOffset,
lanes,
// Pass the typed array so binary search + forward-walk can
// read start/end directly from Float64Array, skipping the
diff --git a/src/index.ts b/src/index.ts
index d35b3e0695a9c85b261bc1a4fbe23c0a60d5b204..c504e630a60a3a7791345622bb02754b1308fd86 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -1047,6 +1047,8 @@ export class Virtualizer<
return this.scrollOffset
}
+ getLogicalScrollOffset = () => this.getScrollOffset() + this.scrollAdjustments
+
private getFurthestMeasurement = (
measurements: Array<VirtualItem>,
index: number,
@@ -1334,12 +1336,14 @@ export class Virtualizer<
this.options.lanes,
],
(measurements, outerSize, scrollOffset, lanes) => {
+ const maxScrollOffset = Math.max(this.getTotalSize() - outerSize, 0)
+ const effectiveScrollOffset = Math.min(Math.max(scrollOffset, 0), maxScrollOffset)
return (this.range =
measurements.length > 0 && outerSize > 0
? calculateRange({
measurements,
outerSize,
- scrollOffset,
+ scrollOffset: effectiveScrollOffset,
lanes,
// Pass the typed array so binary search + forward-walk can
// read start/end directly from Float64Array, skipping the

View file

@ -0,0 +1,108 @@
diff --git a/dist/cjs/index.cjs b/dist/cjs/index.cjs
index 52ae6ca12f8d1c650ee7f1bd55573ee7d4f8b65f..830f646f5bd80f4e00f442291ad6e4c6c508630d 100644
--- a/dist/cjs/index.cjs
+++ b/dist/cjs/index.cjs
@@ -716,17 +716,20 @@ class Virtualizer {
this.getMeasurements(),
this.getSize(),
this.getScrollOffset(),
- this.options.lanes
+ this.options.lanes,
+ this.options.paddingEnd
],
- (measurements, outerSize, scrollOffset, lanes) => {
+ (measurements, outerSize, scrollOffset, lanes, _paddingEnd) => {
if (measurements.length === 0 || outerSize === 0) {
this.range = null;
return null;
}
+ const maxScrollOffset = Math.max(this.options.scrollMargin + this.getTotalSize() - outerSize, 0);
+ const effectiveScrollOffset = Math.min(Math.max(scrollOffset, 0), maxScrollOffset);
this.range = calculateRangeImpl(
measurements,
outerSize,
- scrollOffset,
+ effectiveScrollOffset,
lanes,
// Pass the typed array so binary search + forward-walk can read
// start/end directly from Float64Array, skipping the Proxy traps.
diff --git a/dist/cjs/index.d.cts b/dist/cjs/index.d.cts
index c61ee17752565253f795c7fc7d57e86237ecbb52..430c622a18c69407df9f1ca82ee9440e9be287b7 100644
--- a/dist/cjs/index.d.cts
+++ b/dist/cjs/index.d.cts
@@ -144,7 +144,7 @@ export declare class Virtualizer<TScrollElement extends Element | Window, TItemE
startIndex: number;
endIndex: number;
} | null;
- updateDeps(newDeps: [VirtualItem[], number, number, number]): void;
+ updateDeps(newDeps: [VirtualItem[], number, number, number, number]): void;
};
getVirtualIndexes: {
(): number[];
diff --git a/dist/esm/index.d.ts b/dist/esm/index.d.ts
index b03abab604eb6578f6f56ff92c489259cfaf8f19..940310f9215ba5bf666c5b71e92dddbbbc85635d 100644
--- a/dist/esm/index.d.ts
+++ b/dist/esm/index.d.ts
@@ -144,7 +144,7 @@ export declare class Virtualizer<TScrollElement extends Element | Window, TItemE
startIndex: number;
endIndex: number;
} | null;
- updateDeps(newDeps: [VirtualItem[], number, number, number]): void;
+ updateDeps(newDeps: [VirtualItem[], number, number, number, number]): void;
};
getVirtualIndexes: {
(): number[];
diff --git a/dist/esm/index.js b/dist/esm/index.js
index 3032c0ca457582be3f47923cba1f7d92c848745c..6e52124048fb3bc7b7ee37e763354b33593a6285 100644
--- a/dist/esm/index.js
+++ b/dist/esm/index.js
@@ -714,17 +714,20 @@ class Virtualizer {
this.getMeasurements(),
this.getSize(),
this.getScrollOffset(),
- this.options.lanes
+ this.options.lanes,
+ this.options.paddingEnd
],
- (measurements, outerSize, scrollOffset, lanes) => {
+ (measurements, outerSize, scrollOffset, lanes, _paddingEnd) => {
if (measurements.length === 0 || outerSize === 0) {
this.range = null;
return null;
}
+ const maxScrollOffset = Math.max(this.options.scrollMargin + this.getTotalSize() - outerSize, 0);
+ const effectiveScrollOffset = Math.min(Math.max(scrollOffset, 0), maxScrollOffset);
this.range = calculateRangeImpl(
measurements,
outerSize,
- scrollOffset,
+ effectiveScrollOffset,
lanes,
// Pass the typed array so binary search + forward-walk can read
// start/end directly from Float64Array, skipping the Proxy traps.
diff --git a/src/index.ts b/src/index.ts
index 7ad79aacd591c3a4f7855c91b2727a59a9579bca..201406779ee85d2f2e5b01a8ea284aa9a5f694e2 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -1367,16 +1367,19 @@ export class Virtualizer<
this.getSize(),
this.getScrollOffset(),
this.options.lanes,
+ this.options.paddingEnd,
],
- (measurements, outerSize, scrollOffset, lanes) => {
+ (measurements, outerSize, scrollOffset, lanes, _paddingEnd) => {
if (measurements.length === 0 || outerSize === 0) {
this.range = null
return null
}
+ const maxScrollOffset = Math.max(this.options.scrollMargin + this.getTotalSize() - outerSize, 0)
+ const effectiveScrollOffset = Math.min(Math.max(scrollOffset, 0), maxScrollOffset)
this.range = calculateRangeImpl(
measurements,
outerSize,
- scrollOffset,
+ effectiveScrollOffset,
lanes,
// Pass the typed array so binary search + forward-walk can read
// start/end directly from Float64Array, skipping the Proxy traps.