@aiquants/virtualscroll 3.10.0 → 3.11.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/CHANGELOG.md +59 -0
- package/README.md +41 -12
- package/dist/ScrollBar.d.cts +7 -6
- package/dist/ScrollBar.d.ts +7 -6
- package/dist/ScrollBar.d.ts.map +1 -1
- package/dist/VirtualGrid.d.ts.map +1 -1
- package/dist/VirtualScroll.d.cts +119 -14
- package/dist/VirtualScroll.d.ts +119 -14
- package/dist/VirtualScroll.d.ts.map +1 -1
- package/dist/cli.js +26 -47
- package/dist/index.cjs +1 -1
- package/dist/index.js +2323 -2371
- package/dist/logger.d.cts +1 -16
- package/dist/logger.d.ts +1 -16
- package/dist/logger.d.ts.map +1 -1
- package/dist/useFenwickMapTree.d.cts +21 -1
- package/dist/useFenwickMapTree.d.ts +21 -1
- package/dist/useFenwickMapTree.d.ts.map +1 -1
- package/dist/useLruCache.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/ScrollBar.tsx +28 -10
- package/src/VirtualGrid.tsx +21 -19
- package/src/VirtualScroll.tsx +402 -209
- package/src/logger.ts +1 -25
- package/src/useFenwickMapTree.ts +60 -98
- package/src/useLruCache.ts +14 -8
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,65 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `@aiquants/virtualscroll` are documented here.
|
|
4
4
|
|
|
5
|
+
## 3.11.0 (2026-10-05)
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- **`scrollToIndex(index, { align: "nearest" })` — 行を見せる操作**: 行が表示域にまるごと入る最短の距離だけスクロールし、既に
|
|
10
|
+
まるごと入っていれば何もしない (状態を書かず、確定を足さない)。上にかかる行は上端を、下にかかる行は下端を表示域の端へ着地させ、
|
|
11
|
+
表示域より高い行は上端を揃える。見えている端へ戻るピル (`enableScrollToTopBottomButtons`) が覆う端 (その端からピルの向こう側
|
|
12
|
+
まで。画面から測るので文字の大きさに従う — 既定の文字で 31px、200 % で 47px) は表示域に数えない。着地は `"top"` / `"bottom"`
|
|
13
|
+
の揃えとして保つので、後でピルが隠れても何も動かない。`"nearest"` は `offset` を取らない (型が許さず、型の無い呼び出しには
|
|
14
|
+
`RangeError`)。ホストが自分のフォーカスのモデルを持つまま、フォーカスした行を見せるのに使う (README「Revealing a row」)。
|
|
15
|
+
- **スクロールバーとつまみの値の文字 (`aria-valuetext`)**: `aria-valuenow` / `aria-valuemax` は論理 px のままで、長い一覧では
|
|
16
|
+
数千万になり読み上げても位置が分からない。バー (`role="scrollbar"`) とつまみ (`role="slider"`) は、スクロールの割合を
|
|
17
|
+
`locale` の `Intl.NumberFormat` の小数なしの百分率で持つ (en・ja とも `"25%"`。スクロールできないバーは `"0%"`、中身が縮んで
|
|
18
|
+
一時的に最大位置を越えた位置は `"100%"`)。数の書式なのでラベルのカタログのキーは足さない。ポインタ専用
|
|
19
|
+
(`enableArrowButtonTabStops: false`) のバーは支援技術から隠れるので持たない。
|
|
20
|
+
- **`FenwickMapTree.revision`**: 木が保持する値か要素数が変わるたびに上がり、それ以外では変わらない版。木は同一性を保ったまま
|
|
21
|
+
中身が変わるので、接頭辞和から何かを導く呼び出し側は 2 回の読み取りを比べて古さを判定する。
|
|
22
|
+
|
|
23
|
+
### Changed
|
|
24
|
+
|
|
25
|
+
- **フォーカスの移動と行のキー移動は、行を最短で見せる**: `focusItemAtIndex(index)` (`ensureVisible` 既定) と
|
|
26
|
+
`behaviorOptions.enableKeyboardNavigation` の矢印 / Page キー、Escape 行復帰は、`scrollToIndex(index, { align: "nearest" })` と
|
|
27
|
+
同じ規則で行を見せる。従来は表示域の外へかかる行を上端へ揃えたので、下端の行から下へキーを押すと一覧が 1 画面ぶん飛んだ。
|
|
28
|
+
- **ポインタ専用の矢印はキーを受けない**: `enableArrowButtonTabStops: false` の下の矢印は、スクリプトがフォーカスしても Enter /
|
|
29
|
+
Space でスクロールせず、既定の動作も取り消さない (バーは支援技術から隠れ、キーボードのスクロールはホストが持つ)。既定の矢印は
|
|
30
|
+
変わらない。
|
|
31
|
+
- **`ScrollBarProps["onScroll"]` の第 2 引数は必ず渡る**: バーは要求を解いた元の位置をいつも渡していたので、型を省略可から必須へ
|
|
32
|
+
改めた (`onScroll` を実装する側は変更不要)。
|
|
33
|
+
- **網羅率のつめ車の対象に `scripts` を加えた**: `vitest.config.ts` の `COVERAGE_INCLUDE` は `src/**/*.{ts,tsx}` と
|
|
34
|
+
`scripts/**/*.mjs` で、つめ車のスクリプトと入口も分岐・関数とも 100 % の下限で測る。下限を上げた (`useFenwickMapTree.ts`・
|
|
35
|
+
`useLruCache.ts`・`logger.ts`・`cli.server.ts`・`tapScrollCircleSampleVisual.tsx` は 100、`VirtualGrid.tsx` は分岐 98 と関数 100、
|
|
36
|
+
`VirtualScroll.tsx` は分岐 95 と関数 96)。届かない分岐は試験を足し、到達しない分岐は消した (`getLowestSetBit` の 0 と、その呼び出し
|
|
37
|
+
側の打ち切り・`_findIndexLarge` の空の木・`reset` の種の打ち切り・`_modeOrMedian` と標本化の空の入力・同じ計算どうしを比べる
|
|
38
|
+
「Inconsistent Fenwick Tree state」の整合の検査・`useLruCache` の刈り込みの安全弁・`Logger` の使われない `setPrefix` と静的な
|
|
39
|
+
`info`・`VirtualGrid` の総幅と列の左端の死んだ既定値)。
|
|
40
|
+
|
|
41
|
+
### Fixed
|
|
42
|
+
|
|
43
|
+
- **差の和が 0 の測り直しの組で、行が古い上端と高さのまま残っていた**: 描いた行を置き直す合図が中身の寸法 (総和) の変化だけ
|
|
44
|
+
だったので、同じバッチの `updateItemSize` の差が打ち消し合う (総和が変わらない) と、行は古い木の上端と高さで描かれたままになった
|
|
45
|
+
(例: 行 1 を +20、行 3 を −20 で、行 2〜4 が古い上端のまま)。描画範囲の memo は木に依存していなかったので、表示域の中の行が
|
|
46
|
+
縮んでも新しく見える行が描かれず (overscan 0 で 300px の空白)、`getRange()` も古い範囲を返した。木を描画の外で変える経路
|
|
47
|
+
(`updateItemSize`・高さの照合・`scrollToIndex` の具現化) は木の版 (`FenwickMapTree.revision`) が動いたときだけ木の版数を進め、
|
|
48
|
+
木を読む memo (描画範囲・描いた行・`getRange()`) はどれもそれに依存するので、総和が変わるかどうかによらず次の確定で置き直す。
|
|
49
|
+
差の和が 0 のバッチが足す確定はちょうど 1 回。
|
|
50
|
+
- **端へ戻るピルが、キーで見せた端の行を覆っていた**: ピルは表示域の端の行の上に描かれ、行を見せる処理はピルを数えなかったので、
|
|
51
|
+
キーで端の行へ進むと行がピルの下に残った (320 × 640・文字 200 % で Bottom ピルが行の中心を覆った)。見せる処理はどれも
|
|
52
|
+
ピルが覆う端を表示域に数えない (上の Added と Changed)。
|
|
53
|
+
- **行が `Number.MAX_SAFE_INTEGER` 以上の一覧の描画範囲が、先頭の可視行を別の規則で決めていた**: 巨大な一覧の経路
|
|
54
|
+
(`computeRenderingRangesHuge`) は位置 0 では先頭の行を、末尾では最後の行を無条件に選び、先頭の行の隠れた量も数えなかったので、
|
|
55
|
+
高さ 0 の先頭行・末尾の高さ 0 の行・行の途中の位置で通常の経路と違う範囲を返した。先頭の可視行を通常の経路と同じ
|
|
56
|
+
`resolveVisibleStartRow` で決め、前方の走査もその行の隠れた量から数える。
|
|
57
|
+
- **`VirtualGrid` がアンマウントの後に読み上げを予約していた**: 埋め込みの一覧はアンマウントで待っていた範囲の通知を同期で
|
|
58
|
+
配り、それはグリッド自身の後始末の後に届くので、ライブリージョンがアンマウントの後に消費側の `buildMessage` を呼んでいた。
|
|
59
|
+
アンマウントの後は読み上げを予約しない。
|
|
60
|
+
- **文書**: `FenwickMapTree.rebuildTree({ materialize: true })` は全行ではなく初期の窓だけを具現化する (リセットと同じ) ことを
|
|
61
|
+
docstring に書いた。「`tabIndex=-1` の矢印もスクリプトからフォーカスすればキーで動く」という約束は、既定の矢印だけの約束へ
|
|
62
|
+
改めた (上の Changed)。
|
|
63
|
+
|
|
5
64
|
## 3.10.0 (2026-10-05)
|
|
6
65
|
|
|
7
66
|
### Added
|
package/README.md
CHANGED
|
@@ -235,12 +235,12 @@ Measured in Chromium 148 (1280×800, ratio 1, overscan 15, rows whose text ends
|
|
|
235
235
|
pixels, at most one blended pixel, floor(2 × ratio) gap pixels and floor(2 × ratio) outline pixels.
|
|
236
236
|
- The scrollbar thumb moves the same way. Its wrapper stays at `top: 0` (`left: 0` on a horizontal bar) and is
|
|
237
237
|
moved by a 2D translate (`translateY`, `translateX` on a horizontal bar) snapped to the same device-pixel
|
|
238
|
-
grid, with no transition, so a step writes only that `transform` and the slider's
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
9
|
|
243
|
-
unsnapped offset.
|
|
238
|
+
grid, with no transition, so a step writes only that `transform` and the slider's value attributes
|
|
239
|
+
(`aria-valuenow`, and `aria-valuetext` when the whole percent changes), and the thumb adds no layout. A
|
|
240
|
+
thumb positioned by `top` adds a layout from the document root to every step: in Chromium, 60 steps of
|
|
241
|
+
40 px that kept the rendering window (200,000 rows of 160 px inside nested flex columns beside a 600-row
|
|
242
|
+
sidebar) ran 60 layouts in 13.9 ms with the thumb moved by `top`, and 30 layouts in 9.1 ms with the thumb
|
|
243
|
+
held still. `thumbPosition` in the `renderThumbOverlay` props stays the exact, unsnapped offset.
|
|
244
244
|
|
|
245
245
|
## Position changes the list makes on its own
|
|
246
246
|
|
|
@@ -523,6 +523,11 @@ for the bar and `verticalScrollThumb` / `horizontalScrollThumb` for the thumb (s
|
|
|
523
523
|
[Localization](#localization)). Assistive technology appends the role itself, so the bar's name
|
|
524
524
|
carries only what tells the two bars of a grid apart.
|
|
525
525
|
|
|
526
|
+
The value counts px, which runs to tens of millions on a long list, so the bar and the thumb also
|
|
527
|
+
carry `aria-valuetext`: the scroll fraction as a whole percent formatted for the bar's `locale`
|
|
528
|
+
(`Intl.NumberFormat` with `style: "percent"`, `"25%"` in `en` and `ja`). A bar with nothing to scroll
|
|
529
|
+
reads `"0%"`, and a position briefly past the end (after the content shrinks) reads `"100%"`.
|
|
530
|
+
|
|
526
531
|
The bar's two arrow buttons are Tab stops by default, because they are the only scrolling control a
|
|
527
532
|
keyboard user can reach with Tab: the pane moves its content by transform (there is no native
|
|
528
533
|
scroller for the browser to make focusable) and the rows are not Tab stops. Focus an arrow and
|
|
@@ -547,7 +552,9 @@ The bar then becomes what a native scrollbar is, a pointer-only control:
|
|
|
547
552
|
- The bar carries `aria-hidden="true"`, so assistive technology meets no scrollbar and no slider for
|
|
548
553
|
this viewport; your keyboard model is the one it announces.
|
|
549
554
|
- Nothing in the bar is a Tab stop: the arrows get `tabIndex={-1}`, and the bar and the thumb wrapper
|
|
550
|
-
carry no `tabindex`.
|
|
555
|
+
carry no `tabindex`. The arrows answer the pointer only: even when a script focuses one, Enter and
|
|
556
|
+
Space do nothing there (they are not default-prevented either), so the hidden bar never scrolls
|
|
557
|
+
alongside your keyboard model. The bar carries no `aria-valuetext` either.
|
|
551
558
|
- A press anywhere on the bar, with any button and on a disabled arrow too, cancels the press's
|
|
552
559
|
default action, so it never moves focus: neither onto a part of the bar nor away from where your
|
|
553
560
|
app put it. The press itself, its pointer events and its click still reach the part.
|
|
@@ -560,6 +567,25 @@ The bar then becomes what a native scrollbar is, a pointer-only control:
|
|
|
560
567
|
The option has one name and one meaning everywhere: `ScrollBar` and `ScrollPane` props, and
|
|
561
568
|
`scrollBarOptions` of `VirtualScroll` and `VirtualGrid` (the grid applies it to both of its bars).
|
|
562
569
|
|
|
570
|
+
## Revealing a row
|
|
571
|
+
|
|
572
|
+
One rule brings a row into view, whoever asks: `scrollToIndex(index, { align: "nearest" })`, `focusItemAtIndex(index)` and
|
|
573
|
+
the row keyboard steps of `behaviorOptions.enableKeyboardNavigation` (Arrow / Page keys, and the Escape row-return). It scrolls
|
|
574
|
+
the least distance that puts the row wholly inside the viewport, and nothing at all when it already is: a row above lands with
|
|
575
|
+
its top at the top, a row below with its bottom at the bottom, and a row taller than the viewport with its top at the top — the
|
|
576
|
+
way a native list scrolls to its focused option.
|
|
577
|
+
|
|
578
|
+
The auto-hiding Top / Bottom pills (`scrollBarOptions.enableScrollToTopBottomButtons`) are drawn over the first and last
|
|
579
|
+
visible rows. While a pill shows, the edge it covers — from that edge to the pill's far side, measured on screen and divided
|
|
580
|
+
back by any ancestor `transform` scale, so it follows the text size — does not count as inside: a row there is revealed below
|
|
581
|
+
the Top pill or above the Bottom pill. The landing is kept like a `"top"` / `"bottom"` alignment, so nothing moves when the
|
|
582
|
+
pill hides. `"top"`, `"bottom"` and `"center"` keep aligning to the viewport itself, pill or not.
|
|
583
|
+
|
|
584
|
+
```tsx
|
|
585
|
+
// keep your own focus model, let the list bring the focused row into view
|
|
586
|
+
handle.scrollToIndex(focusedIndex, { align: "nearest" })
|
|
587
|
+
```
|
|
588
|
+
|
|
563
589
|
## Screen-reader live region
|
|
564
590
|
|
|
565
591
|
Virtualization removes off-screen rows from the DOM, so a screen-reader user scrolling the list
|
|
@@ -603,6 +629,9 @@ catalog in English (`"en"`, the default) and Japanese (`"ja"`):
|
|
|
603
629
|
| `scrollToBottom` | VirtualScroll scroll-to-bottom pill (`enableScrollToTopBottomButtons`) | Bottom | 末尾へ |
|
|
604
630
|
| `noItems` | VirtualScroll empty state (`itemCount === 0`; also VirtualGrid with no scroll rows) | No items | 項目がありません |
|
|
605
631
|
|
|
632
|
+
`locale` also formats the scroll bar's value text (`aria-valuetext`, the scroll fraction as a whole percent through
|
|
633
|
+
`Intl.NumberFormat`). That is a number format, not a catalog string, so it has no key and `labels` cannot override it.
|
|
634
|
+
|
|
606
635
|
Pick the language with `locale` and override single keys with `labels`, which are laid over the
|
|
607
636
|
catalog of `locale`:
|
|
608
637
|
|
|
@@ -882,7 +911,7 @@ exists in the DOM.
|
|
|
882
911
|
| `enableTrackClick` | `boolean` | Enable clicking the scrollbar track (default: true) |
|
|
883
912
|
| `enableArrowButtons` | `boolean` | Enable arrow buttons on the scrollbar (default: true) |
|
|
884
913
|
| `enableArrowButtonTabStops` | `boolean` | Whether the scrollbar is the keyboard user's scrolling control (default: true: a named scrollbar and thumb, the two arrows in the Tab order). Set `false` when your app already owns keyboard scrolling of the list: the bar and the scroll-to-edge pills become pointer-only (`aria-hidden`, no Tab stop, a press never moves focus) and pointer scrolling is unchanged. See [Scrollbar accessibility and the Tab order](#scrollbar-accessibility-and-the-tab-order) |
|
|
885
|
-
| `enableScrollToTopBottomButtons` | `boolean` | Enable the auto-hiding Top/Bottom pills (texts from `labels.scrollToTop` / `labels.scrollToBottom`; default: false) |
|
|
914
|
+
| `enableScrollToTopBottomButtons` | `boolean` | Enable the auto-hiding Top/Bottom pills (texts from `labels.scrollToTop` / `labels.scrollToBottom`; default: false). A pill is drawn over the rows at its edge; while it shows, every reveal keeps rows out from under it (see [Revealing a row](#revealing-a-row)) |
|
|
886
915
|
| `renderThumbOverlay` | `(props: ScrollBarThumbOverlayRenderProps) => ReactNode` | Render prop to anchor custom UI near the scrollbar thumb |
|
|
887
916
|
| `tapScrollCircleOptions` | `ScrollBarTapCircleOptions` | Customization for the auxiliary tap scroll circle |
|
|
888
917
|
|
|
@@ -892,7 +921,7 @@ exists in the DOM.
|
|
|
892
921
|
| --- | --- | --- |
|
|
893
922
|
| `enablePointerDrag` | `boolean` | Enable dragging the content area to scroll (default: true). ⚠️ Setting this to `false` removes the only way to scroll on touch devices — the pane is transform-based and has no native scroller. Use `pointerDragInputs` to exclude a single pointer type instead. |
|
|
894
923
|
| `pointerDragInputs` | `readonly ("mouse" \| "pen" \| "touch")[]` | Pointer types allowed to drag-scroll the content area (default: all three). `touch-action: none` is applied only when `"touch"` or `"pen"` is included. |
|
|
895
|
-
| `enableKeyboardNavigation` | `boolean` | Enable keyboard navigation (default: true). Arrow / Page keys move row focus. ⚠️ They fire **only when the row wrapper itself is the event target** — focus inside a row (a `role="slider"` cell, a link, a nested scroll region) keeps its own keys |
|
|
924
|
+
| `enableKeyboardNavigation` | `boolean` | Enable keyboard navigation (default: true). Arrow / Page keys move row focus and reveal the focused row (see [Revealing a row](#revealing-a-row)). ⚠️ They fire **only when the row wrapper itself is the event target** — focus inside a row (a `role="slider"` cell, a link, a nested scroll region) keeps its own keys |
|
|
896
925
|
| `enableEscapeRowReturn` | `boolean` | Opt-in (default: false): pressing `Escape` while focus sits on an element **inside** a row returns focus to the row wrapper. Listens in the bubble phase and respects `preventDefault` / `stopPropagation` / IME composition, so widgets inside the row keep first claim on their own `Escape`. Requires `enableKeyboardNavigation` |
|
|
897
926
|
| `wheelSpeedMultiplier` | `number` | Multiplier for mouse wheel scrolling speed (default: 1) |
|
|
898
927
|
| `inertiaOptions` | `ScrollPaneInertiaOptions` | Physics tuning for drag inertia |
|
|
@@ -908,16 +937,16 @@ exists in the DOM.
|
|
|
908
937
|
| `scrollBy` | `(delta: number) => number` | Scroll **by a delta** with the pane's own wheel semantics (float accumulation, no anchor). Use this — not `scrollTo` — to bridge continuous input from outside the pane. Returns the applied **logical** position |
|
|
909
938
|
| `applyWheel` | `(event: WheelEvent) => boolean` | Apply one wheel event with the pane's own rules; returns whether it was consumed. The single entry point for wheel input originating outside the pane — normally reached through `useWheelBridge` |
|
|
910
939
|
| *(ScrollPaneHandle only)* `scrollTo` | `(pos, dimsOverride?)` | The pane-level jump. `dimsOverride` is an explicit clamp-space for callers that know **fresher-than-committed** dims (the layout-shift compensation passes `committed + delta`). Do not pass it casually — a wrong override clamps against dims that are not on screen |
|
|
911
|
-
| `scrollToIndex` | `(index: number, options?: { align?: "top" \| "bottom" \| "center"; offset?: number }) => void` | Scroll to specific item index with optional alignment and offset. Lands exactly on the aligned position (clamped to the content); a `"top"` (default) or `"bottom"` alignment is remembered there, so the device-pixel snap keeps that edge — see [Device-pixel snapping](#device-pixel-snapping) |
|
|
940
|
+
| `scrollToIndex` | `(index: number, options?: { align?: "top" \| "bottom" \| "center"; offset?: number } \| { align: "nearest" }) => void` | Scroll to specific item index with optional alignment and offset. Lands exactly on the aligned position (clamped to the content); a `"top"` (default) or `"bottom"` alignment is remembered there, so the device-pixel snap keeps that edge — see [Device-pixel snapping](#device-pixel-snapping). `"top"`, `"bottom"` and `"center"` align to the viewport itself. `"nearest"` is the reveal: the least scroll that brings the row wholly into view, keeping it out from under a visible scroll-to-edge pill, and nothing at all when the row is already wholly in view — see [Revealing a row](#revealing-a-row). `"nearest"` takes no `offset` (passing one throws a `RangeError`) |
|
|
912
941
|
| `getScrollPosition` | `() => number` | Get current **logical** scroll position (2.0.0; `-1` when the pane is not connected) |
|
|
913
942
|
| `getContentSize` | `() => number` | Get total content size (insets included). Returns the `-1` sentinel while the pane is unconnected |
|
|
914
943
|
| `getViewportSize` | `() => number` | Get viewport size. Returns the `-1` sentinel while the pane is unconnected |
|
|
915
|
-
| `focusItemAtIndex` | `(index: number, options?: { ensureVisible?: boolean }) => void` | Focus
|
|
944
|
+
| `focusItemAtIndex` | `(index: number, options?: { ensureVisible?: boolean }) => void` | Focus the row at an index (with `enableKeyboardNavigation`). With `ensureVisible` (default `true`) the row is first revealed exactly like `scrollToIndex(index, { align: "nearest" })`; with `false` a rendered row takes focus without scrolling |
|
|
916
945
|
| `getRange` | `() => VirtualScrollRange` | Get current range information (updated one render behind) |
|
|
917
946
|
| `getScrollAnchor` | `() => { index: number; offsetPx: number } \| null` | Capture the current top visible row anchor for exact restore via `initialScrollAnchor` (`null` when `itemCount` is 0) |
|
|
918
947
|
| `getFenwickTreeTotalHeight` | `() => number` | Total content height managed by the Fenwick tree (insets excluded) |
|
|
919
948
|
| `getFenwickSize` | `() => number` | Item count managed by the Fenwick tree |
|
|
920
|
-
| `updateItemSize` | `(index: number, size: number) => void` | Manually update one item's size (with layout-shift compensation: a row above the first visible row moves the position by the same delta before this returns, reported through `onScrollAdjust` as `"item-resize"`). `getItemHeight(index)` must return the same value afterwards |
|
|
949
|
+
| `updateItemSize` | `(index: number, size: number) => void` | Manually update one item's size (with layout-shift compensation: a row above the first visible row moves the position by the same delta before this returns, reported through `onScrollAdjust` as `"item-resize"`). `getItemHeight(index)` must return the same value afterwards. Every change of a row height made through `updateItemSize` or found by the height reconciliation re-places the rendered rows and re-resolves the rendering range (and `getRange()`) in the next commit, whether or not the total changes — a batch of calls whose changes cancel out included, at the cost of one commit |
|
|
921
950
|
|
|
922
951
|
**Coordinate system (2.0.0)**: every position the handle and callbacks accept or return is
|
|
923
952
|
**logical** (content px, insets excluded) — `onScroll` / `onRangeChange` / `initialScroll*` /
|
package/dist/ScrollBar.d.cts
CHANGED
|
@@ -72,8 +72,8 @@ export type ScrollBarProps = {
|
|
|
72
72
|
viewportSize: number;
|
|
73
73
|
/** The current scroll position. / 現在のスクロール位置。 */
|
|
74
74
|
scrollPosition: number;
|
|
75
|
-
/** A callback function invoked to adjust scroll position. Accepts next position or updater. /
|
|
76
|
-
onScroll?: (scrollPosition: number | ((prevPosition: number) => number), prevPosition
|
|
75
|
+
/** A callback function invoked to adjust scroll position. Accepts next position or updater, and always receives the position the bar resolved the request from. / スクロール位置を調整するためのコールバック。次位置または更新関数と、バーが要求を解いた元の位置 (必ず渡す) を受け取る。 */
|
|
76
|
+
onScroll?: (scrollPosition: number | ((prevPosition: number) => number), prevPosition: number) => number | undefined;
|
|
77
77
|
/** Whether grabbing the scrollbar thumb is allowed. / スクロールバーのつまみ操作を許可するかどうか。 */
|
|
78
78
|
enableThumbDrag?: boolean;
|
|
79
79
|
/** Whether clicking on the track moves the scrollbar. / スクロールバーのトラッククリック操作を許可するかどうか。 */
|
|
@@ -153,10 +153,11 @@ export type ScrollBarProps = {
|
|
|
153
153
|
/** The index of the last visible item. / 最後の可視アイテムのインデックス。 */
|
|
154
154
|
visibleEndIndex?: number;
|
|
155
155
|
/**
|
|
156
|
-
* UI chrome locale of the built-in accessible names of the bar, its thumb and its arrows
|
|
157
|
-
* unsupported value throws a RangeError at render; no
|
|
158
|
-
*
|
|
159
|
-
*
|
|
156
|
+
* UI chrome locale of the built-in accessible names of the bar, its thumb and its arrows, and of the percentage the bar
|
|
157
|
+
* and the thumb announce as their value text (default `"en"`). An unsupported value throws a RangeError at render; no
|
|
158
|
+
* language negotiation happens.
|
|
159
|
+
* バー・つまみ・矢印の内蔵アクセシブルネームと、バーとつまみが値の文字として知らせる百分率の UI クロームロケール (既定
|
|
160
|
+
* `"en"`)。非対応値は描画時に RangeError、言語ネゴシエーションなし。
|
|
160
161
|
*/
|
|
161
162
|
locale?: VirtualScrollLocale;
|
|
162
163
|
/**
|
package/dist/ScrollBar.d.ts
CHANGED
|
@@ -72,8 +72,8 @@ export type ScrollBarProps = {
|
|
|
72
72
|
viewportSize: number;
|
|
73
73
|
/** The current scroll position. / 現在のスクロール位置。 */
|
|
74
74
|
scrollPosition: number;
|
|
75
|
-
/** A callback function invoked to adjust scroll position. Accepts next position or updater. /
|
|
76
|
-
onScroll?: (scrollPosition: number | ((prevPosition: number) => number), prevPosition
|
|
75
|
+
/** A callback function invoked to adjust scroll position. Accepts next position or updater, and always receives the position the bar resolved the request from. / スクロール位置を調整するためのコールバック。次位置または更新関数と、バーが要求を解いた元の位置 (必ず渡す) を受け取る。 */
|
|
76
|
+
onScroll?: (scrollPosition: number | ((prevPosition: number) => number), prevPosition: number) => number | undefined;
|
|
77
77
|
/** Whether grabbing the scrollbar thumb is allowed. / スクロールバーのつまみ操作を許可するかどうか。 */
|
|
78
78
|
enableThumbDrag?: boolean;
|
|
79
79
|
/** Whether clicking on the track moves the scrollbar. / スクロールバーのトラッククリック操作を許可するかどうか。 */
|
|
@@ -153,10 +153,11 @@ export type ScrollBarProps = {
|
|
|
153
153
|
/** The index of the last visible item. / 最後の可視アイテムのインデックス。 */
|
|
154
154
|
visibleEndIndex?: number;
|
|
155
155
|
/**
|
|
156
|
-
* UI chrome locale of the built-in accessible names of the bar, its thumb and its arrows
|
|
157
|
-
* unsupported value throws a RangeError at render; no
|
|
158
|
-
*
|
|
159
|
-
*
|
|
156
|
+
* UI chrome locale of the built-in accessible names of the bar, its thumb and its arrows, and of the percentage the bar
|
|
157
|
+
* and the thumb announce as their value text (default `"en"`). An unsupported value throws a RangeError at render; no
|
|
158
|
+
* language negotiation happens.
|
|
159
|
+
* バー・つまみ・矢印の内蔵アクセシブルネームと、バーとつまみが値の文字として知らせる百分率の UI クロームロケール (既定
|
|
160
|
+
* `"en"`)。非対応値は描画時に RangeError、言語ネゴシエーションなし。
|
|
160
161
|
*/
|
|
161
162
|
locale?: VirtualScrollLocale;
|
|
162
163
|
/**
|
package/dist/ScrollBar.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScrollBar.d.ts","sourceRoot":"","sources":["../src/ScrollBar.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAA;AAIrD,OAAO,
|
|
1
|
+
{"version":3,"file":"ScrollBar.d.ts","sourceRoot":"","sources":["../src/ScrollBar.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAA;AAIrD,OAAO,EAA0D,KAAK,2BAA2B,EAA4B,KAAK,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAG1K,OAAO,EAA8E,KAAK,0BAA0B,EAAE,MAAM,uBAAuB,CAAA;AAwEnJ;;;;GAIG;AACH,MAAM,MAAM,yBAAyB,GAAG;IACpC,oEAAoE;IACpE,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,mDAAmD;IACnD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,uDAAuD;IACvD,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,qDAAqD;IACrD,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,4DAA4D;IAC5D,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,mFAAmF;IACnF,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,iFAAiF;IACjF,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,iFAAiF;IACjF,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,wEAAwE;IACxE,OA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E,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,MAAM,CAAC;QAAC,cAAc,EAAE,MAAM,CAAC;QAAC,oBAAoB,EAAE,MAAM,CAAC;QAAC,qBAAqB,EAAE,MAAM,CAAA;KAAE,CAAA;IACtO,2LAA2L;IAC3L,UAAU,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAA;IACtC,wSAAwS;IACxS,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,aAAa,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI,CAAA;CAC5E,CAAA;AA8BD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,sBAAsB,GAC/B,IAAI,MAAM,EACV,eAAe,MAAM,EACrB,cAAc,MAAM,EACpB,UAAU,MAAM,EAChB,aAAa,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,EACpC,SAAS,UAAU,CAAC,OAAO,iBAAiB,CAAC,EAC7C,YAAY,MAAM,EAClB,YAAY,MAAM,KACnB;IAAE,iBAAiB,EAAE,MAAM,CAAC;IAAC,eAAe,EAAE,MAAM,CAAC;IAAC,eAAe,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAkBzH,CAAA;AA87CD;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAmC,CAAC,CAAC,EAAE,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAA;CAAE,KAAK,SAAS,CAAA"}
|
package/dist/VirtualScroll.d.cts
CHANGED
|
@@ -134,21 +134,47 @@ export type VirtualScrollHandle = {
|
|
|
134
134
|
/**
|
|
135
135
|
* Scrolls to a specific item index, landing exactly on the aligned position (clamped to the content). A `"top"`
|
|
136
136
|
* (default) or `"bottom"` alignment is remembered at that position, so the device-pixel snap of the items wrapper
|
|
137
|
-
* keeps the aligned edge there (see the README's device-pixel snapping section).
|
|
137
|
+
* keeps the aligned edge there (see the README's device-pixel snapping section). `"top"`, `"bottom"` and `"center"`
|
|
138
|
+
* align to the viewport itself, and `offset` (px) is subtracted from the aligned position.
|
|
139
|
+
*
|
|
140
|
+
* `"nearest"` is the reveal, the rule focus moves and the row keyboard steps use too: it scrolls the least distance that
|
|
141
|
+
* brings the row wholly into the viewport, minus the edge a visible scroll-to-edge pill covers (from that edge to the
|
|
142
|
+
* pill's far side), and does nothing when the row already lies wholly inside. A row above lands with its top at the
|
|
143
|
+
* band's top, a row below with its bottom at the band's bottom, and a row taller than the band with its top at the
|
|
144
|
+
* band's top; the landing is kept like a `"top"` / `"bottom"` alignment, so a pill that hides later moves nothing.
|
|
145
|
+
* `"nearest"` takes no `offset`.
|
|
138
146
|
*
|
|
139
147
|
* 指定したアイテムインデックスへスクロールする処理。揃えた位置 (中身の範囲へクランプ) へ厳密に着地する。`"top"` (既定) と
|
|
140
148
|
* `"bottom"` の揃えはその位置で覚えるので、そこでは行ラッパーの装置の画素への揃えが揃えた端を守る (README の装置の画素への
|
|
141
|
-
* 揃えの節を参照)
|
|
149
|
+
* 揃えの節を参照)。`"top"`・`"bottom"`・`"center"` は表示域そのものに揃え、`offset` (px) を揃えた位置から引く。
|
|
150
|
+
*
|
|
151
|
+
* `"nearest"` は見せる操作で、フォーカスの移動と行のキー移動も同じ規則を使う。行が表示域から、見えている端へ戻るピルが覆う
|
|
152
|
+
* 端 (その端からピルの向こう側まで) を除いた帯にまるごと入る最短の距離だけスクロールし、既にまるごと入っていれば何もしない。
|
|
153
|
+
* 上の行は上端を帯の上端へ、下の行は下端を帯の下端へ、帯より高い行は上端を帯の上端へ着地させ、着地は `"top"` / `"bottom"`
|
|
154
|
+
* の揃えと同じく保つので、後でピルが隠れても何も動かない。`"nearest"` は `offset` を取らない。
|
|
155
|
+
*
|
|
156
|
+
* @throws {RangeError} When `"nearest"` comes with an `offset` / `"nearest"` に `offset` を渡したとき
|
|
142
157
|
*/
|
|
143
158
|
scrollToIndex: (index: number, options?: {
|
|
144
159
|
align?: "top" | "bottom" | "center";
|
|
145
160
|
offset?: number;
|
|
161
|
+
} | {
|
|
162
|
+
align: "nearest";
|
|
163
|
+
offset?: never;
|
|
146
164
|
}) => void;
|
|
147
165
|
/** Gets the total height managed by the Fenwick Tree / Fenwick Tree で管理されている総高さを取得 */
|
|
148
166
|
getFenwickTreeTotalHeight: () => number;
|
|
149
167
|
/** Gets the number of items in the Fenwick Tree / Fenwick Tree 内のアイテム数を取得 */
|
|
150
168
|
getFenwickSize: () => number;
|
|
151
|
-
/**
|
|
169
|
+
/**
|
|
170
|
+
* Focuses the row at the specified index (with `behaviorOptions.enableKeyboardNavigation`). With `ensureVisible` (default
|
|
171
|
+
* `true`) it first reveals the row like `scrollToIndex(index, { align: "nearest" })`, so a row a visible scroll-to-edge
|
|
172
|
+
* pill covers is brought out from under it; with `false` it focuses a rendered row without scrolling.
|
|
173
|
+
*
|
|
174
|
+
* 指定したインデックスの行へフォーカスする処理 (`behaviorOptions.enableKeyboardNavigation` のとき)。`ensureVisible` (既定
|
|
175
|
+
* `true`) では先に `scrollToIndex(index, { align: "nearest" })` と同じく行を見せるので、見えている端へ戻るピルが覆う行は
|
|
176
|
+
* その下から出る。`false` では描いてある行をスクロールせずにフォーカスする。
|
|
177
|
+
*/
|
|
152
178
|
focusItemAtIndex: (index: number, options?: {
|
|
153
179
|
ensureVisible?: boolean;
|
|
154
180
|
}) => void;
|
|
@@ -428,12 +454,13 @@ export type VirtualScrollProps<T> = {
|
|
|
428
454
|
liveRegion?: VirtualScrollLiveRegionOptions;
|
|
429
455
|
/**
|
|
430
456
|
* UI chrome locale of the built-in strings (default `"en"`): the scrollbar's accessible names
|
|
431
|
-
* (the bar, its thumb and its arrows), the scroll-to-edge pills and the empty-state text
|
|
457
|
+
* (the bar, its thumb and its arrows), the scroll-to-edge pills and the empty-state text, and of the
|
|
458
|
+
* percentage the bar and its thumb carry as their value text. Live-region wording is not affected (see
|
|
432
459
|
* {@link VirtualScrollLiveRegionOptions.format}). An unsupported value throws a RangeError at
|
|
433
460
|
* render; no language negotiation happens.
|
|
434
|
-
* 内蔵文言 (スクロールバーのアクセシブルネーム — バー・つまみ・矢印 —、端スクロールピル、空状態文言)
|
|
435
|
-
* (既定 `"en"`)。ライブリージョンの文言には影響しない
|
|
436
|
-
* 参照)。非対応値は描画時に RangeError、言語ネゴシエーションなし。
|
|
461
|
+
* 内蔵文言 (スクロールバーのアクセシブルネーム — バー・つまみ・矢印 —、端スクロールピル、空状態文言) と、バーとつまみが
|
|
462
|
+
* 値の文字として持つ百分率の UI クロームロケール (既定 `"en"`)。ライブリージョンの文言には影響しない
|
|
463
|
+
* ({@link VirtualScrollLiveRegionOptions.format} 参照)。非対応値は描画時に RangeError、言語ネゴシエーションなし。
|
|
437
464
|
*/
|
|
438
465
|
locale?: VirtualScrollLocale;
|
|
439
466
|
/**
|
|
@@ -625,6 +652,57 @@ export type AlignedEdge = {
|
|
|
625
652
|
/** Pane position (PANE coordinates) where the aligned row sits at that edge / 揃えた行がその端にあるペイン位置 (ペイン座標) */
|
|
626
653
|
readonly panePosition: number;
|
|
627
654
|
};
|
|
655
|
+
/**
|
|
656
|
+
* The parts of the viewport that something drawn over the rows covers — the visible scroll-to-edge pill — as px from each
|
|
657
|
+
* edge to the far side of what covers it. Module-level export (NOT in the package barrel), the parameter type of
|
|
658
|
+
* `resolveRevealAlignment`.
|
|
659
|
+
*
|
|
660
|
+
* 行の上に描いたもの (見えている端へ戻るピル) が覆う表示域の部分。各端から覆うものの向こう側までの px。モジュールレベル
|
|
661
|
+
* export (バレル非公開)。`resolveRevealAlignment` の引数の型。
|
|
662
|
+
*/
|
|
663
|
+
export type ObscuredInsets = {
|
|
664
|
+
/** Covered px from the top edge / 上端から覆われた px */
|
|
665
|
+
readonly top: number;
|
|
666
|
+
/** Covered px from the bottom edge / 下端から覆われた px */
|
|
667
|
+
readonly bottom: number;
|
|
668
|
+
};
|
|
669
|
+
/**
|
|
670
|
+
* How a reveal lands a row: with its top at the top of the band the obscured insets leave (`"top"`) or with its bottom at the
|
|
671
|
+
* band's bottom (`"bottom"`), as the alignment and the `offset` `scrollToIndex` subtracts from the position aligned to the
|
|
672
|
+
* viewport's edge. Module-level export (NOT in the package barrel), the return type of `resolveRevealAlignment`.
|
|
673
|
+
*
|
|
674
|
+
* 見せる操作が行を着地させる揃え。覆われた部分を除いた帯の上端へ行の上端を (`"top"`)、帯の下端へ行の下端を (`"bottom"`) 置く
|
|
675
|
+
* 揃えと、表示域の端に揃えた位置から `scrollToIndex` が引く `offset`。モジュールレベル export (バレル非公開)。
|
|
676
|
+
* `resolveRevealAlignment` の戻り値の型。
|
|
677
|
+
*/
|
|
678
|
+
export type RevealAlignment = {
|
|
679
|
+
/** The edge of the band the row lands at / 行が着地する帯の端 */
|
|
680
|
+
readonly align: "top" | "bottom";
|
|
681
|
+
/** Px subtracted from the position aligned to the viewport's edge (the covered px; negative at the bottom) / 表示域の端に揃えた位置から引く px (覆われた px。下端では負) */
|
|
682
|
+
readonly offset: number;
|
|
683
|
+
};
|
|
684
|
+
/**
|
|
685
|
+
* Resolves the reveal of a row — the one rule of `scrollToIndex` with `align: "nearest"`, of `focusItemAtIndex` and of the
|
|
686
|
+
* row keyboard steps: the least scroll that brings the row wholly into the band of the viewport the obscured insets leave.
|
|
687
|
+
* A row above the band lands with its top at the band's top, a row below with its bottom at the band's bottom, and a row
|
|
688
|
+
* taller than the band with its top at the band's top. A row within `EDGE_POSITION_TOLERANCE` of the band counts as inside.
|
|
689
|
+
* Module-level export (NOT in the package barrel).
|
|
690
|
+
*
|
|
691
|
+
* 行を見せる操作を解決する処理。`align: "nearest"` の `scrollToIndex`・`focusItemAtIndex`・行のキー移動に共通のただ 1 つの
|
|
692
|
+
* 規則で、覆われた部分を除いた表示域の帯へ行をまるごと入れる最短のスクロール。帯より上の行は上端を帯の上端へ、下の行は
|
|
693
|
+
* 下端を帯の下端へ、帯より高い行は上端を帯の上端へ着地させる。帯から `EDGE_POSITION_TOLERANCE` 以内の行は中にあるとみなす。
|
|
694
|
+
* モジュールレベル export (バレル非公開)。
|
|
695
|
+
*
|
|
696
|
+
* @param row - The row's logical top and bottom (px) / 行の論理上端と論理下端 (px)
|
|
697
|
+
* @param position - Logical scroll position (px) / 論理スクロール位置 (px)
|
|
698
|
+
* @param viewportSize - Viewport size (px) / 表示域の高さ (px)
|
|
699
|
+
* @param insets - The obscured insets / 覆われた部分
|
|
700
|
+
* @returns How to land the row, or `null` when it already lies wholly inside the band / 行の着地のさせ方 (既に帯にまるごと入っていれば `null`)
|
|
701
|
+
*/
|
|
702
|
+
export declare const resolveRevealAlignment: (row: {
|
|
703
|
+
readonly top: number;
|
|
704
|
+
readonly bottom: number;
|
|
705
|
+
}, position: number, viewportSize: number, insets: ObscuredInsets) => RevealAlignment | null;
|
|
628
706
|
/**
|
|
629
707
|
* Chooses the edge the items-wrapper translate keeps when it is snapped to the device-pixel grid
|
|
630
708
|
* (`snapToDevicePixelGrid`), so that aligned content never loses part of its edge gutter to the snap:
|
|
@@ -659,11 +737,6 @@ export type AlignedEdge = {
|
|
|
659
737
|
* @returns The edge the snapped translate keeps / 揃えた平行移動が守る端
|
|
660
738
|
*/
|
|
661
739
|
export declare const resolveItemsWrapperSnapEdge: (panePosition: number, maxPanePosition: number, alignedEdge: AlignedEdge | null) => DevicePixelSnapEdge;
|
|
662
|
-
/**
|
|
663
|
-
* Retrieves a high-resolution timestamp when available.
|
|
664
|
-
*
|
|
665
|
-
* 高精度タイムスタンプを可能なら取得。
|
|
666
|
-
*/
|
|
667
740
|
/**
|
|
668
741
|
* The first visible row at a logical scroll position (`resolveVisibleStartRow`).
|
|
669
742
|
*
|
|
@@ -683,7 +756,8 @@ export type VisibleStartRow = {
|
|
|
683
756
|
type VisibleStartRowTree = Pick<ReturnType<typeof useFenwickMapTree>, "findIndexAtOrAfter" | "prefixSum">;
|
|
684
757
|
/**
|
|
685
758
|
* Resolves the first visible row at a logical scroll position by the visible-start boundary rule — the one rule that
|
|
686
|
-
* `scrollTo` pins, `getScrollAnchor` reports, `updateItemSize` compensates above and `computeRenderingRanges` renders from
|
|
759
|
+
* `scrollTo` pins, `getScrollAnchor` reports, `updateItemSize` compensates above and `computeRenderingRanges` renders from
|
|
760
|
+
* (on both of its paths, `computeRenderingRangesHuge` included):
|
|
687
761
|
*
|
|
688
762
|
* - the row whose span contains the position: `top <= position < top + height`;
|
|
689
763
|
* - a row whose bottom equals the position lies entirely above the viewport, so the next row starts exactly there and is the
|
|
@@ -694,7 +768,8 @@ type VisibleStartRowTree = Pick<ReturnType<typeof useFenwickMapTree>, "findIndex
|
|
|
694
768
|
* Module-level export (NOT in the package barrel).
|
|
695
769
|
*
|
|
696
770
|
* 先頭の可視行を、可視の先頭の境界の規則で論理スクロール位置から解決する処理。`scrollTo` が留め、`getScrollAnchor` が知らせ、
|
|
697
|
-
* `updateItemSize` がその上の変化を補正し、`computeRenderingRanges`
|
|
771
|
+
* `updateItemSize` がその上の変化を補正し、`computeRenderingRanges` が (`computeRenderingRangesHuge` を含む両方の経路で) 描き
|
|
772
|
+
* 始める、ただ 1 つの規則。
|
|
698
773
|
*
|
|
699
774
|
* - 位置を含む行 (`上端 <= 位置 < 上端 + 高さ`)。
|
|
700
775
|
* - 下端が位置に一致する行は丸ごとビューポートの上にあるので、ちょうどそこから始まる次の行がオフセット 0 で先頭の可視行。
|
|
@@ -709,6 +784,36 @@ type VisibleStartRowTree = Pick<ReturnType<typeof useFenwickMapTree>, "findIndex
|
|
|
709
784
|
* @returns The first visible row and its logical top / 先頭の可視行とその論理上端
|
|
710
785
|
*/
|
|
711
786
|
export declare const resolveVisibleStartRow: (fenwickTree: VisibleStartRowTree, position: number, itemCount: number) => VisibleStartRow;
|
|
787
|
+
/**
|
|
788
|
+
* Computes the rendering ranges of a list of `Number.MAX_SAFE_INTEGER` rows or more. The first visible row comes from the one
|
|
789
|
+
* visible-start boundary rule, `resolveVisibleStartRow`, exactly as in `computeRenderingRanges`, and the forward scan starts at
|
|
790
|
+
* that row's hidden offset as there; only then are the indices converted to `bigint`. The scans keep their own `bigint` loops
|
|
791
|
+
* because past 2^53 an index cannot be stepped by 1 in `number` (`x + 1 === x`, so a `number` loop over zero-height rows would
|
|
792
|
+
* never end); the tree's own lookups take `number` indices, so in that range the start row is as exact as the tree's answer.
|
|
793
|
+
* Below 2^53 both paths resolve every row boundary, zero-height rows at position 0 and the end clamp to the same ranges.
|
|
794
|
+
* Module-level export (NOT in the package barrel), for the spec that pins that agreement.
|
|
795
|
+
*
|
|
796
|
+
* `Number.MAX_SAFE_INTEGER` 行以上の一覧の描画範囲を求める処理。先頭の可視行は `computeRenderingRanges` とまったく同じく、ただ
|
|
797
|
+
* 1 つの可視の先頭の境界の規則 `resolveVisibleStartRow` から得て、前方の走査も同じくその行の隠れた量から始め、そのあとで添字を
|
|
798
|
+
* `bigint` へ変える。走査が `bigint` の繰り返しを持つのは、2^53 を越えると `number` では添字を 1 ずつ進められない
|
|
799
|
+
* (`x + 1 === x` なので、高さ 0 の行を `number` で走査すると終わらない) ため。木の引き当ては `number` の添字を取るので、その範囲の
|
|
800
|
+
* 先頭の行は木の答えと同じ精度。2^53 未満では、どちらの経路もどの行の境界・位置 0 の高さ 0 の行・末尾のクランプでも同じ範囲を
|
|
801
|
+
* 返す。モジュールレベル export (バレル非公開)。その一致を固定する spec のため。
|
|
802
|
+
*
|
|
803
|
+
* @param effectiveScrollPosition - Logical scroll position, clamped to the content (px) / 中身へクランプした論理スクロール位置 (px)
|
|
804
|
+
* @param viewportSize - Height of the viewport (px) / 表示域の高さ (px)
|
|
805
|
+
* @param overscanCount - Rows rendered beyond each edge / 端の外に描く行の数
|
|
806
|
+
* @param itemSize - Number of rows / 行の数
|
|
807
|
+
* @param getItemHeight - Height of a row / 行の高さ
|
|
808
|
+
* @param fenwickTree - The row-height tree / 行の高さの木
|
|
809
|
+
* @returns The rendering and visible ranges / 描画範囲と可視範囲
|
|
810
|
+
*/
|
|
811
|
+
export declare const computeRenderingRangesHuge: (effectiveScrollPosition: number, viewportSize: number, overscanCount: number, itemSize: number, getItemHeight: (index: number) => number, fenwickTree: ReturnType<typeof useFenwickMapTree>) => {
|
|
812
|
+
renderingStartIndex: number;
|
|
813
|
+
renderingEndIndex: number;
|
|
814
|
+
visibleStartIndex: number;
|
|
815
|
+
visibleEndIndex: number;
|
|
816
|
+
};
|
|
712
817
|
/**
|
|
713
818
|
* Calculates rendering boundaries from current scroll metrics. The visible rows start at the row `resolveVisibleStartRow`
|
|
714
819
|
* resolves.
|