@aiquants/virtualscroll 3.0.0 → 3.1.1
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 +47 -0
- package/README.md +68 -0
- package/dist/ScrollBar.d.ts.map +1 -1
- package/dist/ScrollPane.d.ts.map +1 -1
- package/dist/VirtualScroll.d.cts +88 -0
- package/dist/VirtualScroll.d.ts +88 -0
- package/dist/VirtualScroll.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1497 -1429
- package/dist/residualQuantizer.d.cts +95 -0
- package/dist/residualQuantizer.d.ts +96 -0
- package/dist/residualQuantizer.d.ts.map +1 -0
- package/dist/styles/virtualscroll.css +1 -1
- package/dist/styles/virtualscroll.standalone.css +1 -1
- package/dist/utils.d.cts +15 -0
- package/dist/utils.d.ts +15 -0
- package/dist/utils.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/ScrollBar.tsx +3 -30
- package/src/ScrollPane.tsx +16 -3
- package/src/VirtualScroll.tsx +216 -3
- package/src/index.ts +3 -0
- package/src/residualQuantizer.ts +133 -0
- package/src/styles/virtualscroll.css +15 -0
- package/src/utils.ts +42 -0
package/dist/index.js
CHANGED
|
@@ -1,7 +1,26 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { twMerge as
|
|
4
|
-
|
|
1
|
+
import { jsx as ne, jsxs as Tt, Fragment as rr } from "react/jsx-runtime";
|
|
2
|
+
import Nr, { memo as zr, forwardRef as nr, useState as je, useRef as g, useCallback as S, useImperativeHandle as ir, useMemo as _e, useLayoutEffect as Ze, useEffect as X, useId as Vr } from "react";
|
|
3
|
+
import { twMerge as zt } from "tailwind-merge";
|
|
4
|
+
const xn = (r) => {
|
|
5
|
+
const { quantum: e, resetOnDirectionChange: t = !0 } = r;
|
|
6
|
+
if (!(Number.isFinite(e) && e > 0))
|
|
7
|
+
throw new TypeError(`[createResidualQuantizer] quantum must be a finite positive number, received ${e}`);
|
|
8
|
+
let n = 0;
|
|
9
|
+
return {
|
|
10
|
+
push: (i) => {
|
|
11
|
+
if (!Number.isFinite(i) || Math.abs(i) > Number.MAX_SAFE_INTEGER)
|
|
12
|
+
return 0;
|
|
13
|
+
t && n !== 0 && i !== 0 && Math.sign(i) !== Math.sign(n) && (n = 0), n += i;
|
|
14
|
+
const s = Math.trunc(n / e) * e + 0;
|
|
15
|
+
return n -= s, s;
|
|
16
|
+
},
|
|
17
|
+
peekResidue: () => n,
|
|
18
|
+
reset: () => {
|
|
19
|
+
n = 0;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
class y {
|
|
5
24
|
level;
|
|
6
25
|
prefix;
|
|
7
26
|
impl;
|
|
@@ -14,7 +33,7 @@ class T {
|
|
|
14
33
|
constructor(e = 2, t = "[virtualscroll]", n = console) {
|
|
15
34
|
this.level = e, this.prefix = t, this.impl = n;
|
|
16
35
|
}
|
|
17
|
-
static instance = new
|
|
36
|
+
static instance = new y(2, "[virtualscroll]");
|
|
18
37
|
/**
|
|
19
38
|
* @method setLevel
|
|
20
39
|
* @description Updates the current log level for the static instance.
|
|
@@ -22,7 +41,7 @@ class T {
|
|
|
22
41
|
* @param {LogLevel} level - The new log level.
|
|
23
42
|
*/
|
|
24
43
|
static setLevel(e) {
|
|
25
|
-
|
|
44
|
+
y.instance.setLevel(e);
|
|
26
45
|
}
|
|
27
46
|
/**
|
|
28
47
|
* @method setLevel
|
|
@@ -40,7 +59,7 @@ class T {
|
|
|
40
59
|
* @param {ILogger} impl - The new logger implementation.
|
|
41
60
|
*/
|
|
42
61
|
static setImplementation(e) {
|
|
43
|
-
|
|
62
|
+
y.instance.setImplementation(e);
|
|
44
63
|
}
|
|
45
64
|
/**
|
|
46
65
|
* @method setImplementation
|
|
@@ -58,7 +77,7 @@ class T {
|
|
|
58
77
|
* @param {string} prefix - The new prefix.
|
|
59
78
|
*/
|
|
60
79
|
static setPrefix(e) {
|
|
61
|
-
|
|
80
|
+
y.instance.setPrefix(e);
|
|
62
81
|
}
|
|
63
82
|
/**
|
|
64
83
|
* @method setPrefix
|
|
@@ -77,7 +96,7 @@ class T {
|
|
|
77
96
|
* @returns {boolean} True if a message at `level` would be emitted. / `level` のメッセージが出力されるなら true。
|
|
78
97
|
*/
|
|
79
98
|
static isEnabled(e) {
|
|
80
|
-
return
|
|
99
|
+
return y.instance.isEnabled(e);
|
|
81
100
|
}
|
|
82
101
|
/**
|
|
83
102
|
* @method isEnabled
|
|
@@ -122,41 +141,41 @@ class T {
|
|
|
122
141
|
return typeof e == "string" ? [`${this.prefix} ${e}`] : [this.prefix, e];
|
|
123
142
|
}
|
|
124
143
|
static debug(e, ...t) {
|
|
125
|
-
|
|
144
|
+
y.instance.debug(e, ...t);
|
|
126
145
|
}
|
|
127
146
|
debug(e, ...t) {
|
|
128
|
-
this.level <= 0 && this.impl.debug(...this.formatMessage(
|
|
147
|
+
this.level <= 0 && this.impl.debug(...this.formatMessage(y.resolveLazy(e)), ...t.map(y.resolveLazy));
|
|
129
148
|
}
|
|
130
149
|
static info(e, ...t) {
|
|
131
|
-
|
|
150
|
+
y.instance.info(e, ...t);
|
|
132
151
|
}
|
|
133
152
|
info(e, ...t) {
|
|
134
|
-
this.level <= 1 && this.impl.info(...this.formatMessage(
|
|
153
|
+
this.level <= 1 && this.impl.info(...this.formatMessage(y.resolveLazy(e)), ...t.map(y.resolveLazy));
|
|
135
154
|
}
|
|
136
155
|
static warn(e, ...t) {
|
|
137
|
-
|
|
156
|
+
y.instance.warn(e, ...t);
|
|
138
157
|
}
|
|
139
158
|
warn(e, ...t) {
|
|
140
|
-
this.level <= 2 && this.impl.warn(...this.formatMessage(
|
|
159
|
+
this.level <= 2 && this.impl.warn(...this.formatMessage(y.resolveLazy(e)), ...t.map(y.resolveLazy));
|
|
141
160
|
}
|
|
142
161
|
static error(e, ...t) {
|
|
143
|
-
|
|
162
|
+
y.instance.error(e, ...t);
|
|
144
163
|
}
|
|
145
164
|
error(e, ...t) {
|
|
146
|
-
this.level <= 3 && this.impl.error(...this.formatMessage(
|
|
165
|
+
this.level <= 3 && this.impl.error(...this.formatMessage(y.resolveLazy(e)), ...t.map(y.resolveLazy));
|
|
147
166
|
}
|
|
148
167
|
}
|
|
149
|
-
const
|
|
168
|
+
const fr = {
|
|
150
169
|
active: !1,
|
|
151
170
|
offsetX: 0,
|
|
152
171
|
offsetY: 0,
|
|
153
172
|
distance: 0,
|
|
154
173
|
direction: 0,
|
|
155
174
|
pointerId: null
|
|
156
|
-
},
|
|
175
|
+
}, jt = 6, Cr = 8, Dr = ({ dragState: r, normalizedDistance: e }) => {
|
|
157
176
|
const t = 1 + e * 0.18, n = 0.16 + e * 0.24, i = 0.38 + e * 0.28, s = r.active ? "80ms ease-out" : "220ms ease";
|
|
158
|
-
return /* @__PURE__ */
|
|
159
|
-
/* @__PURE__ */
|
|
177
|
+
return /* @__PURE__ */ Tt(rr, { children: [
|
|
178
|
+
/* @__PURE__ */ ne(
|
|
160
179
|
"div",
|
|
161
180
|
{
|
|
162
181
|
className: "aqvs-tap-scroll-circle-visual-outer",
|
|
@@ -168,7 +187,7 @@ const rr = {
|
|
|
168
187
|
}
|
|
169
188
|
}
|
|
170
189
|
),
|
|
171
|
-
/* @__PURE__ */
|
|
190
|
+
/* @__PURE__ */ ne(
|
|
172
191
|
"div",
|
|
173
192
|
{
|
|
174
193
|
className: "aqvs-tap-scroll-circle-inner",
|
|
@@ -181,154 +200,160 @@ const rr = {
|
|
|
181
200
|
}
|
|
182
201
|
)
|
|
183
202
|
] });
|
|
184
|
-
},
|
|
185
|
-
|
|
186
|
-
const [
|
|
203
|
+
}, Sr = zr(
|
|
204
|
+
nr(({ onDragChange: r, className: e, maxVisualDistance: t = 160, size: n = 40, style: i, opacity: s = 1, renderVisual: a }, m) => {
|
|
205
|
+
const [d, b] = je(fr), x = g(null), T = g(null), C = g({ x: 0, y: 0 }), h = g(null), L = g(0), U = S(
|
|
187
206
|
(v) => {
|
|
188
207
|
b(v), r(v);
|
|
189
208
|
},
|
|
190
209
|
[r]
|
|
191
|
-
),
|
|
192
|
-
(v,
|
|
193
|
-
const { x: qe, y:
|
|
194
|
-
let
|
|
195
|
-
const
|
|
196
|
-
ze === 0 ?
|
|
197
|
-
active:
|
|
198
|
-
offsetX:
|
|
199
|
-
offsetY:
|
|
210
|
+
), D = S(
|
|
211
|
+
(v, K, de = !1) => {
|
|
212
|
+
const { x: qe, y: Xe } = C.current, V = v - qe, ke = K - Xe, $e = Math.abs(ke), ze = $e < jt ? 0 : ke < 0 ? -1 : 1, Fe = L.current;
|
|
213
|
+
let Ue = ze;
|
|
214
|
+
const De = jt + Cr;
|
|
215
|
+
ze === 0 ? Fe !== 0 && $e < De ? Ue = Fe : (Ue = 0, de || (L.current = 0)) : ze !== Fe && Fe !== 0 && $e < De ? Ue = Fe : L.current = ze, U({
|
|
216
|
+
active: de || $e >= jt,
|
|
217
|
+
offsetX: V,
|
|
218
|
+
offsetY: ke,
|
|
200
219
|
distance: $e,
|
|
201
|
-
direction:
|
|
202
|
-
pointerId:
|
|
220
|
+
direction: Ue,
|
|
221
|
+
pointerId: x.current
|
|
203
222
|
});
|
|
204
223
|
},
|
|
205
|
-
[
|
|
206
|
-
),
|
|
224
|
+
[U]
|
|
225
|
+
), le = S((v) => {
|
|
207
226
|
if (v === null)
|
|
208
227
|
return;
|
|
209
|
-
const
|
|
210
|
-
|
|
211
|
-
}, []),
|
|
228
|
+
const K = h.current;
|
|
229
|
+
K?.hasPointerCapture(v) && K.releasePointerCapture(v);
|
|
230
|
+
}, []), ce = S(
|
|
212
231
|
(v = !1) => {
|
|
213
|
-
v &&
|
|
232
|
+
v && le(x.current), x.current = null, T.current = null, L.current = 0, U(fr);
|
|
214
233
|
},
|
|
215
|
-
[
|
|
216
|
-
),
|
|
234
|
+
[U, le]
|
|
235
|
+
), te = S(
|
|
217
236
|
(v) => {
|
|
218
|
-
if (
|
|
219
|
-
|
|
237
|
+
if (x.current !== null && x.current !== v.pointerId) {
|
|
238
|
+
T.current = { pointerId: v.pointerId, clientX: v.clientX, clientY: v.clientY }, v.preventDefault(), v.stopPropagation();
|
|
220
239
|
return;
|
|
221
240
|
}
|
|
222
241
|
v.preventDefault(), v.stopPropagation();
|
|
223
|
-
const
|
|
224
|
-
|
|
242
|
+
const K = h.current ?? v.currentTarget, { left: de, top: qe, width: Xe, height: V } = K.getBoundingClientRect();
|
|
243
|
+
C.current = { x: de + Xe / 2, y: qe + V / 2 }, x.current = v.pointerId;
|
|
225
244
|
try {
|
|
226
|
-
|
|
245
|
+
K.setPointerCapture(v.pointerId);
|
|
227
246
|
} catch {
|
|
228
247
|
}
|
|
229
|
-
|
|
248
|
+
D(v.clientX, v.clientY, !0);
|
|
230
249
|
},
|
|
231
|
-
[
|
|
232
|
-
),
|
|
250
|
+
[D]
|
|
251
|
+
), se = S(
|
|
233
252
|
(v) => {
|
|
234
|
-
if (
|
|
235
|
-
|
|
253
|
+
if (x.current !== v.pointerId) {
|
|
254
|
+
T.current !== null && T.current.pointerId === v.pointerId && (T.current = { pointerId: v.pointerId, clientX: v.clientX, clientY: v.clientY });
|
|
236
255
|
return;
|
|
237
256
|
}
|
|
238
|
-
v.preventDefault(),
|
|
257
|
+
v.preventDefault(), D(v.clientX, v.clientY);
|
|
239
258
|
},
|
|
240
|
-
[
|
|
241
|
-
),
|
|
259
|
+
[D]
|
|
260
|
+
), ue = S(
|
|
242
261
|
(v) => {
|
|
243
|
-
if (
|
|
244
|
-
|
|
262
|
+
if (x.current !== v.pointerId) {
|
|
263
|
+
T.current !== null && T.current.pointerId === v.pointerId && (T.current = null);
|
|
245
264
|
return;
|
|
246
265
|
}
|
|
247
266
|
v.preventDefault(), v.stopPropagation();
|
|
248
|
-
const
|
|
249
|
-
if (
|
|
250
|
-
|
|
251
|
-
const
|
|
267
|
+
const K = T.current;
|
|
268
|
+
if (T.current = null, K !== null) {
|
|
269
|
+
le(v.pointerId);
|
|
270
|
+
const de = h.current;
|
|
252
271
|
let qe = !0;
|
|
253
|
-
if (
|
|
272
|
+
if (de !== null && typeof de.setPointerCapture == "function")
|
|
254
273
|
try {
|
|
255
|
-
|
|
256
|
-
} catch (
|
|
257
|
-
(typeof
|
|
274
|
+
de.setPointerCapture(K.pointerId);
|
|
275
|
+
} catch (Xe) {
|
|
276
|
+
(typeof Xe == "object" && Xe !== null && "name" in Xe ? Xe.name : void 0) === "NotFoundError" && (qe = !1);
|
|
258
277
|
}
|
|
259
278
|
if (qe) {
|
|
260
|
-
|
|
279
|
+
x.current = K.pointerId, D(K.clientX, K.clientY, !0);
|
|
261
280
|
return;
|
|
262
281
|
}
|
|
263
282
|
}
|
|
264
|
-
|
|
283
|
+
ce(!0);
|
|
265
284
|
},
|
|
266
|
-
[
|
|
267
|
-
),
|
|
285
|
+
[ce, le, D]
|
|
286
|
+
), R = S(
|
|
268
287
|
(v) => {
|
|
269
|
-
v.target === v.currentTarget &&
|
|
288
|
+
v.target === v.currentTarget && x.current === v.pointerId && ce(!1);
|
|
270
289
|
},
|
|
271
|
-
[
|
|
290
|
+
[ce]
|
|
272
291
|
);
|
|
273
|
-
|
|
274
|
-
|
|
292
|
+
ir(
|
|
293
|
+
m,
|
|
275
294
|
() => ({
|
|
276
295
|
reset: () => {
|
|
277
|
-
|
|
296
|
+
ce(!0);
|
|
278
297
|
},
|
|
279
298
|
getElement: () => h.current
|
|
280
299
|
}),
|
|
281
|
-
[
|
|
300
|
+
[ce]
|
|
282
301
|
);
|
|
283
|
-
const
|
|
284
|
-
dragState:
|
|
285
|
-
normalizedDistance:
|
|
286
|
-
sizeScale:
|
|
302
|
+
const F = Math.min(Math.max(s, 0), 1), w = n / 64, j = Math.min(d.distance, t) / t, Z = d.direction * j * 10 * w, W = a ?? Dr, pe = {
|
|
303
|
+
dragState: d,
|
|
304
|
+
normalizedDistance: j,
|
|
305
|
+
sizeScale: w,
|
|
287
306
|
size: n,
|
|
288
|
-
opacity:
|
|
289
|
-
},
|
|
307
|
+
opacity: F
|
|
308
|
+
}, A = {
|
|
290
309
|
...i,
|
|
291
310
|
width: n,
|
|
292
311
|
height: n,
|
|
293
|
-
transform: `translateY(${
|
|
312
|
+
transform: `translateY(${Z}px)`
|
|
294
313
|
};
|
|
295
|
-
return
|
|
314
|
+
return A.opacity = F, /* @__PURE__ */ ne(
|
|
296
315
|
"div",
|
|
297
316
|
{
|
|
298
317
|
ref: h,
|
|
299
318
|
"data-testid": "virtual-scroll-tap-circle",
|
|
300
|
-
className:
|
|
301
|
-
style:
|
|
319
|
+
className: zt("aqvs-tap-scroll-circle", e),
|
|
320
|
+
style: A,
|
|
302
321
|
tabIndex: -1,
|
|
303
|
-
onPointerDown:
|
|
304
|
-
onPointerMove:
|
|
305
|
-
onPointerUp:
|
|
306
|
-
onPointerCancel:
|
|
307
|
-
onLostPointerCapture:
|
|
322
|
+
onPointerDown: te,
|
|
323
|
+
onPointerMove: se,
|
|
324
|
+
onPointerUp: ue,
|
|
325
|
+
onPointerCancel: ue,
|
|
326
|
+
onLostPointerCapture: R,
|
|
308
327
|
role: "presentation",
|
|
309
|
-
children:
|
|
328
|
+
children: W(pe)
|
|
310
329
|
}
|
|
311
330
|
);
|
|
312
331
|
})
|
|
313
332
|
);
|
|
314
|
-
|
|
315
|
-
const
|
|
333
|
+
Sr.displayName = "TapScrollCircle";
|
|
334
|
+
const ie = (r, e, t) => Math.max(e, Math.min(t, r)), Tr = (r, e) => {
|
|
335
|
+
const t = e === "x", n = r.getBoundingClientRect(), i = t ? n.width : n.height, s = (x) => {
|
|
336
|
+
const T = Number.parseFloat(x);
|
|
337
|
+
return Number.isFinite(T) ? T : 0;
|
|
338
|
+
}, a = window.getComputedStyle(r), m = s(t ? a.width : a.height), d = m > 0 ? m + s(t ? a.paddingLeft : a.paddingTop) + s(t ? a.paddingRight : a.paddingBottom) + s(t ? a.borderLeftWidth : a.borderTopWidth) + s(t ? a.borderRightWidth : a.borderBottomWidth) : 0, b = d > 0 ? d : t ? r.offsetWidth : r.offsetHeight;
|
|
339
|
+
return b <= 0 || i <= 0 ? 1 : i / b;
|
|
340
|
+
}, tr = "virtualscroll:tap-scroll-cancel", mr = 20, Ar = 250, Lr = 60, Or = 20, _r = 20, wr = {
|
|
316
341
|
/** 速度が最大に達する引き距離 (px)。`maxVisualDistance` の既定値。 */
|
|
317
342
|
maxDistance: 240,
|
|
318
343
|
/** 最小速度倍率 (ビューポート比)。 */
|
|
319
344
|
minSpeedMultiplier: 0.2
|
|
320
|
-
},
|
|
345
|
+
}, kr = wr.maxDistance, pr = { active: !1, offsetX: 0, offsetY: 0, distance: 0, direction: 0, pointerId: null }, Zt = 2.2, Fr = 8, Yr = 120, Br = 1 / 10, ut = {
|
|
321
346
|
enabled: !0,
|
|
322
347
|
size: 40,
|
|
323
348
|
offsetX: -80,
|
|
324
349
|
offsetY: 0,
|
|
325
350
|
className: void 0,
|
|
326
|
-
maxVisualDistance:
|
|
327
|
-
minSpeedMultiplier:
|
|
351
|
+
maxVisualDistance: kr,
|
|
352
|
+
minSpeedMultiplier: wr.minSpeedMultiplier,
|
|
328
353
|
opacity: 0.9,
|
|
329
354
|
renderVisual: void 0,
|
|
330
355
|
maxSpeedCurve: void 0
|
|
331
|
-
},
|
|
356
|
+
}, Hr = (r) => r ? {
|
|
332
357
|
mainSizeKey: "width",
|
|
333
358
|
crossSizeKey: "height",
|
|
334
359
|
positionKey: "left",
|
|
@@ -348,70 +373,70 @@ const le = (r, e, t) => Math.max(e, Math.min(t, r)), Gt = "virtualscroll:tap-scr
|
|
|
348
373
|
arrowIcons: ["▲", "▼"],
|
|
349
374
|
directionClass: "aqvs-scrollbar-vertical",
|
|
350
375
|
orientation: "vertical"
|
|
351
|
-
},
|
|
352
|
-
const t = r?.maxSpeedMultiplier, n = typeof t == "number" ? t :
|
|
376
|
+
}, qr = (r, e) => {
|
|
377
|
+
const t = r?.maxSpeedMultiplier, n = typeof t == "number" ? t : Kr(e);
|
|
353
378
|
return {
|
|
354
|
-
enabled: r?.enabled ??
|
|
355
|
-
size: r?.size ??
|
|
356
|
-
offsetX: r?.offsetX ??
|
|
357
|
-
offsetY: r?.offsetY ??
|
|
358
|
-
className: r?.className ??
|
|
359
|
-
maxVisualDistance: r?.maxVisualDistance ??
|
|
379
|
+
enabled: r?.enabled ?? ut.enabled,
|
|
380
|
+
size: r?.size ?? ut.size,
|
|
381
|
+
offsetX: r?.offsetX ?? ut.offsetX,
|
|
382
|
+
offsetY: r?.offsetY ?? ut.offsetY,
|
|
383
|
+
className: r?.className ?? ut.className,
|
|
384
|
+
maxVisualDistance: r?.maxVisualDistance ?? ut.maxVisualDistance,
|
|
360
385
|
maxSpeedMultiplier: n,
|
|
361
|
-
minSpeedMultiplier: Math.max(r?.minSpeedMultiplier ??
|
|
362
|
-
opacity:
|
|
363
|
-
renderVisual: r?.renderVisual ??
|
|
364
|
-
maxSpeedCurve: r?.maxSpeedCurve ??
|
|
386
|
+
minSpeedMultiplier: Math.max(r?.minSpeedMultiplier ?? ut.minSpeedMultiplier, 0),
|
|
387
|
+
opacity: ie(r?.opacity ?? ut.opacity, 0, 1),
|
|
388
|
+
renderVisual: r?.renderVisual ?? ut.renderVisual,
|
|
389
|
+
maxSpeedCurve: r?.maxSpeedCurve ?? ut.maxSpeedCurve
|
|
365
390
|
};
|
|
366
|
-
},
|
|
367
|
-
const i = g(null), s = g(null), a = g(null),
|
|
391
|
+
}, Xr = ({ isDragging: r, isThumbHovered: e, enableThumbDrag: t }) => _e(() => t ? r ? "dragging" : e ? "hover" : "idle" : "disabled", [t, r, e]), $r = ({ canUseArrowButtons: r, enableArrowButtons: e, resetTapScroll: t, scrollByStep: n }) => {
|
|
392
|
+
const i = g(null), s = g(null), a = g(null), m = S(() => {
|
|
368
393
|
i.current !== null && (window.clearInterval(i.current), i.current = null), s.current !== null && (window.clearTimeout(s.current), s.current = null), a.current !== null && (window.removeEventListener("pointerup", a.current), window.removeEventListener("pointercancel", a.current), window.removeEventListener("blur", a.current), a.current = null);
|
|
369
|
-
}, []),
|
|
370
|
-
|
|
371
|
-
}, [
|
|
372
|
-
(
|
|
394
|
+
}, []), d = S(() => {
|
|
395
|
+
m();
|
|
396
|
+
}, [m]), b = S(
|
|
397
|
+
(T) => (C) => {
|
|
373
398
|
if (!r)
|
|
374
399
|
return;
|
|
375
|
-
|
|
400
|
+
C.cancelable && C.preventDefault(), C.stopPropagation(), t(), m(), n(T), s.current = window.setTimeout(() => {
|
|
376
401
|
i.current = window.setInterval(() => {
|
|
377
|
-
n(
|
|
378
|
-
},
|
|
379
|
-
},
|
|
380
|
-
const h = () =>
|
|
402
|
+
n(T);
|
|
403
|
+
}, Lr);
|
|
404
|
+
}, Ar);
|
|
405
|
+
const h = () => m();
|
|
381
406
|
a.current = h, window.addEventListener("pointerup", h), window.addEventListener("pointercancel", h), window.addEventListener("blur", h);
|
|
382
407
|
},
|
|
383
|
-
[r,
|
|
384
|
-
),
|
|
385
|
-
(
|
|
386
|
-
e && (
|
|
408
|
+
[r, m, t, n]
|
|
409
|
+
), x = S(
|
|
410
|
+
(T) => (C) => {
|
|
411
|
+
e && (C.key === "Enter" || C.key === " " || C.key === "Spacebar") && (C.preventDefault(), n(T));
|
|
387
412
|
},
|
|
388
413
|
[e, n]
|
|
389
414
|
);
|
|
390
|
-
return
|
|
391
|
-
r ||
|
|
392
|
-
}, [r,
|
|
393
|
-
|
|
394
|
-
}, [
|
|
395
|
-
},
|
|
396
|
-
const
|
|
397
|
-
let
|
|
415
|
+
return X(() => {
|
|
416
|
+
r || m();
|
|
417
|
+
}, [r, m]), X(() => () => {
|
|
418
|
+
m();
|
|
419
|
+
}, [m]), { handleArrowPointerDown: b, handleArrowPointerUp: d, handleArrowKeyDown: x };
|
|
420
|
+
}, Ur = 700, It = (r, e) => typeof r == "number" && Number.isFinite(r) ? r : e, Wr = ({ distance: r, maxDistance: e, viewportSize: t, minSpeedMultiplier: n, maxSpeedMultiplier: i, hasCustomMaxSpeedMultiplier: s, curve: a }) => {
|
|
421
|
+
const m = Math.max(It(r, 0), 0), d = It(e, 0), b = d > 0 ? Math.min(m, d) / d : 1, x = Math.max(It(t, 0), 0), T = Math.max(It(n, 0), 0), C = Math.max(It(i, 0), 0), h = Math.max(x * T, 40), L = s ? h : 1200, U = Math.max(x * C, L), D = a ? Math.max(It(a.exponentialScale, C), 0) : 0, le = a ? Math.min(U, Math.max(x * D, h)) : U, ce = Math.max(le, h);
|
|
422
|
+
let te = b ** 1.1;
|
|
398
423
|
if (a) {
|
|
399
|
-
const
|
|
400
|
-
if (
|
|
401
|
-
|
|
424
|
+
const ue = Math.min(Math.max(It(a.exponentialSteepness, 0), 0), Ur);
|
|
425
|
+
if (ue === 0)
|
|
426
|
+
te = b;
|
|
402
427
|
else {
|
|
403
|
-
const
|
|
404
|
-
|
|
428
|
+
const R = Math.expm1(ue) || 1;
|
|
429
|
+
te = Math.min(Math.max(Math.expm1(ue * b) / R, 0), 1);
|
|
405
430
|
}
|
|
406
431
|
}
|
|
407
|
-
const
|
|
408
|
-
return h + (
|
|
409
|
-
},
|
|
432
|
+
const se = Math.min(Math.max(It(a?.easedOffset, 0), 0), 1);
|
|
433
|
+
return h + (ce - h) * (se + (1 - se) * te);
|
|
434
|
+
}, Kr = (r) => {
|
|
410
435
|
if (!r || r <= 0)
|
|
411
|
-
return
|
|
412
|
-
const e = Math.max(1, r), t = Math.log10(e), n =
|
|
413
|
-
return
|
|
414
|
-
},
|
|
436
|
+
return Zt;
|
|
437
|
+
const e = Math.max(1, r), t = Math.log10(e), n = Zt + t * Fr;
|
|
438
|
+
return ie(n, Zt, Yr);
|
|
439
|
+
}, Gr = ({
|
|
415
440
|
contentSize: r,
|
|
416
441
|
viewportSize: e,
|
|
417
442
|
scrollPosition: t,
|
|
@@ -419,248 +444,239 @@ const le = (r, e, t) => Math.max(e, Math.min(t, r)), Gt = "virtualscroll:tap-scr
|
|
|
419
444
|
enableThumbDrag: i = !0,
|
|
420
445
|
enableTrackClick: s = !0,
|
|
421
446
|
enableArrowButtons: a = !0,
|
|
422
|
-
horizontal:
|
|
423
|
-
scrollBarWidth:
|
|
447
|
+
horizontal: m = !1,
|
|
448
|
+
scrollBarWidth: d = 12,
|
|
424
449
|
className: b,
|
|
425
|
-
ariaControls:
|
|
426
|
-
tapScrollCircleOptions:
|
|
427
|
-
itemCount:
|
|
450
|
+
ariaControls: x,
|
|
451
|
+
tapScrollCircleOptions: T,
|
|
452
|
+
itemCount: C,
|
|
428
453
|
renderThumbOverlay: h,
|
|
429
|
-
visibleStartIndex:
|
|
430
|
-
visibleEndIndex:
|
|
454
|
+
visibleStartIndex: L,
|
|
455
|
+
visibleEndIndex: U
|
|
431
456
|
}) => {
|
|
432
|
-
const [
|
|
457
|
+
const [D, le] = je(!1), [ce, te] = je(!1), [se, ue] = je(!1), R = g(null), F = g({
|
|
433
458
|
pointerId: null,
|
|
434
459
|
startThumbPosition: 0,
|
|
435
460
|
startClientX: 0,
|
|
436
461
|
startClientY: 0,
|
|
437
462
|
scale: 1,
|
|
438
463
|
captureTarget: null
|
|
439
|
-
}),
|
|
440
|
-
enabled:
|
|
441
|
-
size:
|
|
464
|
+
}), w = g({ pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1 }), j = g(t), Z = g(n), W = g(pr), pe = g(null), A = g(null), v = g(null), K = g(0), de = g(0), qe = _e(() => qr(T, C), [C, T]), Xe = _e(() => Hr(m), [m]), {
|
|
465
|
+
enabled: V,
|
|
466
|
+
size: ke,
|
|
442
467
|
offsetX: $e,
|
|
443
468
|
offsetY: ze,
|
|
444
|
-
className:
|
|
445
|
-
maxVisualDistance:
|
|
446
|
-
maxSpeedMultiplier:
|
|
447
|
-
minSpeedMultiplier:
|
|
448
|
-
opacity:
|
|
449
|
-
renderVisual:
|
|
450
|
-
maxSpeedCurve:
|
|
451
|
-
} = qe,
|
|
469
|
+
className: Fe,
|
|
470
|
+
maxVisualDistance: Ue,
|
|
471
|
+
maxSpeedMultiplier: De,
|
|
472
|
+
minSpeedMultiplier: Me,
|
|
473
|
+
opacity: Ve,
|
|
474
|
+
renderVisual: be,
|
|
475
|
+
maxSpeedCurve: Ie
|
|
476
|
+
} = qe, G = g({
|
|
452
477
|
viewportSize: e,
|
|
453
478
|
maxScrollPosition: Math.max(r - e, 0),
|
|
454
479
|
scrollBarVisible: r > e,
|
|
455
|
-
effectiveTapMaxDistance: Math.max(
|
|
456
|
-
tapCircleMaxSpeedMultiplier:
|
|
457
|
-
tapCircleMinSpeedMultiplier:
|
|
458
|
-
tapCircleMaxSpeedCurve:
|
|
459
|
-
tapScrollCircleOptions:
|
|
480
|
+
effectiveTapMaxDistance: Math.max(Ue, 1),
|
|
481
|
+
tapCircleMaxSpeedMultiplier: De,
|
|
482
|
+
tapCircleMinSpeedMultiplier: Me,
|
|
483
|
+
tapCircleMaxSpeedCurve: Ie,
|
|
484
|
+
tapScrollCircleOptions: T,
|
|
460
485
|
effectiveTrackLength: 0,
|
|
461
486
|
onScroll: n,
|
|
462
487
|
scrollPosition: t
|
|
463
|
-
}), { mainSizeKey:
|
|
464
|
-
|
|
465
|
-
|
|
488
|
+
}), { mainSizeKey: Qe, crossSizeKey: We, positionKey: dt, selectDelta: it, getPointerCoordinate: E, arrowLabels: gt, arrowIcons: re, directionClass: N, orientation: st } = Xe, Ke = Math.max(Ue, 1), ft = e / r, Ae = Math.max(e - d * 2, 0), f = ft * Ae, P = Math.min(Math.max(mr, f || 0), Ae || mr), q = r - e, B = Math.max(Ae - P, 0), Q = q <= 0 || B <= 0 ? 0 : ie(t / q * B, 0, B), Se = Q + P / 2, J = r > e || D, xe = J && a;
|
|
489
|
+
Ze(() => {
|
|
490
|
+
G.current = {
|
|
466
491
|
viewportSize: e,
|
|
467
|
-
maxScrollPosition:
|
|
468
|
-
scrollBarVisible:
|
|
469
|
-
effectiveTapMaxDistance:
|
|
470
|
-
tapCircleMaxSpeedMultiplier:
|
|
471
|
-
tapCircleMinSpeedMultiplier:
|
|
472
|
-
tapCircleMaxSpeedCurve:
|
|
473
|
-
tapScrollCircleOptions:
|
|
474
|
-
effectiveTrackLength:
|
|
492
|
+
maxScrollPosition: q,
|
|
493
|
+
scrollBarVisible: J,
|
|
494
|
+
effectiveTapMaxDistance: Ke,
|
|
495
|
+
tapCircleMaxSpeedMultiplier: De,
|
|
496
|
+
tapCircleMinSpeedMultiplier: Me,
|
|
497
|
+
tapCircleMaxSpeedCurve: Ie,
|
|
498
|
+
tapScrollCircleOptions: T,
|
|
499
|
+
effectiveTrackLength: B,
|
|
475
500
|
onScroll: n,
|
|
476
501
|
scrollPosition: t
|
|
477
502
|
};
|
|
478
|
-
}),
|
|
479
|
-
|
|
480
|
-
}, [t]),
|
|
481
|
-
|
|
482
|
-
}, [n]),
|
|
483
|
-
i ||
|
|
503
|
+
}), Ze(() => {
|
|
504
|
+
j.current = t;
|
|
505
|
+
}, [t]), Ze(() => {
|
|
506
|
+
Z.current = n;
|
|
507
|
+
}, [n]), X(() => {
|
|
508
|
+
i || te(!1);
|
|
484
509
|
}, [i]);
|
|
485
|
-
const
|
|
486
|
-
const
|
|
487
|
-
if (
|
|
488
|
-
const
|
|
489
|
-
if (typeof
|
|
490
|
-
return
|
|
510
|
+
const Pe = Xr({ isDragging: D, isThumbHovered: ce, enableThumbDrag: i }), $ = S((l, I) => {
|
|
511
|
+
const z = G.current, H = I ?? j.current;
|
|
512
|
+
if (Z.current) {
|
|
513
|
+
const nt = Z.current(l, H);
|
|
514
|
+
if (typeof nt == "number" && Number.isFinite(nt))
|
|
515
|
+
return j.current = nt, nt;
|
|
491
516
|
}
|
|
492
|
-
const
|
|
493
|
-
return
|
|
494
|
-
}, []),
|
|
517
|
+
const ge = typeof l == "function" ? l(H) : l, Ne = Math.max(z.maxScrollPosition, 0), rt = z.scrollBarVisible ? ie(ge, 0, Ne) : 0;
|
|
518
|
+
return j.current = rt, rt;
|
|
519
|
+
}, []), ye = S(
|
|
495
520
|
(l) => {
|
|
496
|
-
const
|
|
497
|
-
if (!
|
|
498
|
-
const
|
|
499
|
-
return { nextPosition:
|
|
521
|
+
const I = G.current, z = j.current;
|
|
522
|
+
if (!I.scrollBarVisible || I.maxScrollPosition <= 0) {
|
|
523
|
+
const at = $(0, z), pt = at - z;
|
|
524
|
+
return { nextPosition: at, actualDelta: pt, reachedBoundary: !0 };
|
|
500
525
|
}
|
|
501
526
|
if (l === 0)
|
|
502
|
-
return { nextPosition:
|
|
503
|
-
const
|
|
504
|
-
return { nextPosition:
|
|
527
|
+
return { nextPosition: z, actualDelta: 0, reachedBoundary: !1 };
|
|
528
|
+
const ge = $((at) => ie(at + l, 0, I.maxScrollPosition), z), Ne = ge - z, rt = l < 0 && z + l <= 0, nt = l > 0 && z + l >= I.maxScrollPosition, mt = l < 0 && (ge <= 0 || rt && Ne === 0) || l > 0 && (ge >= I.maxScrollPosition || nt && Ne === 0);
|
|
529
|
+
return { nextPosition: ge, actualDelta: Ne, reachedBoundary: mt };
|
|
505
530
|
},
|
|
506
|
-
[
|
|
507
|
-
),
|
|
508
|
-
(l,
|
|
509
|
-
l.current +=
|
|
510
|
-
const
|
|
511
|
-
|
|
512
|
-
const
|
|
513
|
-
return l.current -=
|
|
531
|
+
[$]
|
|
532
|
+
), Ce = S(
|
|
533
|
+
(l, I) => {
|
|
534
|
+
l.current += I;
|
|
535
|
+
const z = Math.max(G.current.maxScrollPosition, 0);
|
|
536
|
+
z > 0 && (l.current = ie(l.current, -z, z));
|
|
537
|
+
const H = ye(l.current);
|
|
538
|
+
return l.current -= H.actualDelta, H.reachedBoundary && (l.current = 0), H;
|
|
514
539
|
},
|
|
515
|
-
[
|
|
516
|
-
),
|
|
517
|
-
|
|
518
|
-
}, []),
|
|
519
|
-
|
|
520
|
-
}, [
|
|
540
|
+
[ye]
|
|
541
|
+
), fe = S(() => {
|
|
542
|
+
A.current !== null && (window.cancelAnimationFrame(A.current), A.current = null), v.current = null, K.current = 0, de.current = 0;
|
|
543
|
+
}, []), Re = S(() => {
|
|
544
|
+
W.current = { ...pr }, ue(!1), pe.current?.reset(), fe();
|
|
545
|
+
}, [fe]), Je = S(
|
|
521
546
|
(l) => {
|
|
522
|
-
const
|
|
523
|
-
if (!
|
|
524
|
-
|
|
547
|
+
const I = W.current, z = G.current;
|
|
548
|
+
if (!I.active || I.direction === 0) {
|
|
549
|
+
fe();
|
|
525
550
|
return;
|
|
526
551
|
}
|
|
527
|
-
if (!
|
|
528
|
-
|
|
552
|
+
if (!z.scrollBarVisible || z.maxScrollPosition <= 0) {
|
|
553
|
+
fe();
|
|
529
554
|
return;
|
|
530
555
|
}
|
|
531
|
-
const
|
|
532
|
-
if (v.current = l,
|
|
533
|
-
|
|
556
|
+
const H = v.current ?? l, ge = Math.max((l - H) / 1e3, 0), Ne = Math.min(ge, Br);
|
|
557
|
+
if (v.current = l, Ne <= 0) {
|
|
558
|
+
A.current = window.requestAnimationFrame(Je);
|
|
534
559
|
return;
|
|
535
560
|
}
|
|
536
|
-
const
|
|
537
|
-
distance:
|
|
538
|
-
maxDistance:
|
|
539
|
-
viewportSize:
|
|
540
|
-
minSpeedMultiplier:
|
|
541
|
-
maxSpeedMultiplier:
|
|
542
|
-
hasCustomMaxSpeedMultiplier: typeof
|
|
543
|
-
curve:
|
|
561
|
+
const rt = Wr({
|
|
562
|
+
distance: I.distance,
|
|
563
|
+
maxDistance: z.effectiveTapMaxDistance,
|
|
564
|
+
viewportSize: z.viewportSize,
|
|
565
|
+
minSpeedMultiplier: z.tapCircleMinSpeedMultiplier,
|
|
566
|
+
maxSpeedMultiplier: z.tapCircleMaxSpeedMultiplier,
|
|
567
|
+
hasCustomMaxSpeedMultiplier: typeof z.tapScrollCircleOptions?.maxSpeedMultiplier == "number",
|
|
568
|
+
curve: z.tapCircleMaxSpeedCurve
|
|
544
569
|
});
|
|
545
|
-
|
|
546
|
-
const { reachedBoundary:
|
|
547
|
-
if (
|
|
548
|
-
|
|
570
|
+
de.current !== I.direction && (de.current = I.direction, K.current = 0);
|
|
571
|
+
const { reachedBoundary: nt } = Ce(K, I.direction * rt * Ne);
|
|
572
|
+
if (nt) {
|
|
573
|
+
fe();
|
|
549
574
|
return;
|
|
550
575
|
}
|
|
551
|
-
|
|
576
|
+
A.current = window.requestAnimationFrame(Je);
|
|
552
577
|
},
|
|
553
|
-
[
|
|
554
|
-
),
|
|
555
|
-
|
|
556
|
-
}, [
|
|
557
|
-
|
|
558
|
-
const l =
|
|
559
|
-
!l.active || l.direction === 0 ||
|
|
560
|
-
}, [r, e,
|
|
561
|
-
|
|
562
|
-
}, [
|
|
563
|
-
const
|
|
578
|
+
[Ce, fe]
|
|
579
|
+
), Le = S(() => {
|
|
580
|
+
A.current === null && (v.current = null, K.current = 0, A.current = window.requestAnimationFrame(Je));
|
|
581
|
+
}, [Je]);
|
|
582
|
+
X(() => {
|
|
583
|
+
const l = W.current;
|
|
584
|
+
!l.active || l.direction === 0 || Le();
|
|
585
|
+
}, [r, e, Le]), X(() => () => {
|
|
586
|
+
fe();
|
|
587
|
+
}, [fe]);
|
|
588
|
+
const ot = S(
|
|
564
589
|
(l) => {
|
|
565
|
-
|
|
590
|
+
W.current = l, ue(l.active), l.active && l.direction !== 0 ? Le() : fe();
|
|
566
591
|
},
|
|
567
|
-
[
|
|
592
|
+
[Le, fe]
|
|
568
593
|
);
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
}, [
|
|
572
|
-
const l = (
|
|
573
|
-
const
|
|
574
|
-
|
|
594
|
+
X(() => {
|
|
595
|
+
V || Re();
|
|
596
|
+
}, [Re, V]), X(() => {
|
|
597
|
+
const l = (I) => {
|
|
598
|
+
const H = I.detail?.paneId;
|
|
599
|
+
H && x && H !== x || Re();
|
|
575
600
|
};
|
|
576
|
-
return window.addEventListener(
|
|
577
|
-
window.removeEventListener(
|
|
601
|
+
return window.addEventListener(tr, l), () => {
|
|
602
|
+
window.removeEventListener(tr, l);
|
|
578
603
|
};
|
|
579
|
-
}, [
|
|
580
|
-
if (!
|
|
604
|
+
}, [x, Re]), X(() => {
|
|
605
|
+
if (!V)
|
|
581
606
|
return;
|
|
582
|
-
const l = (
|
|
583
|
-
if (!
|
|
607
|
+
const l = (I) => {
|
|
608
|
+
if (!W.current.active || W.current.pointerId === I.pointerId)
|
|
584
609
|
return;
|
|
585
|
-
const
|
|
586
|
-
if (!(
|
|
587
|
-
|
|
610
|
+
const z = I.target;
|
|
611
|
+
if (!(z instanceof Node)) {
|
|
612
|
+
Re();
|
|
588
613
|
return;
|
|
589
614
|
}
|
|
590
|
-
|
|
615
|
+
pe.current?.getElement()?.contains(z) || Re();
|
|
591
616
|
};
|
|
592
617
|
return document.addEventListener("pointerdown", l, !0), () => {
|
|
593
618
|
document.removeEventListener("pointerdown", l, !0);
|
|
594
619
|
};
|
|
595
|
-
}, [
|
|
596
|
-
const
|
|
597
|
-
if (!
|
|
620
|
+
}, [Re, V]);
|
|
621
|
+
const we = (l) => {
|
|
622
|
+
if (!J || B <= 0 || q <= 0)
|
|
598
623
|
return 0;
|
|
599
|
-
const
|
|
600
|
-
return
|
|
601
|
-
},
|
|
602
|
-
const { scrollBarVisible:
|
|
603
|
-
if (
|
|
624
|
+
const I = ie(l, 0, B);
|
|
625
|
+
return ie(I / B * q, 0, q);
|
|
626
|
+
}, et = S((l) => {
|
|
627
|
+
const { scrollBarVisible: I, effectiveTrackLength: z, maxScrollPosition: H } = G.current;
|
|
628
|
+
if (y.debug("[ScrollBar] calculateScrollPositionFromThumb", () => ({ thumbPos: l, trackLen: z, maxScroll: H })), z <= 0 || H <= 0)
|
|
604
629
|
return null;
|
|
605
|
-
const
|
|
606
|
-
return
|
|
607
|
-
}, []),
|
|
608
|
-
(l) => {
|
|
609
|
-
const x = l.getBoundingClientRect(), R = c ? x.width : x.height, D = (lt) => {
|
|
610
|
-
const Ye = Number.parseFloat(lt);
|
|
611
|
-
return Number.isFinite(Ye) ? Ye : 0;
|
|
612
|
-
}, $ = window.getComputedStyle(l), ye = D(c ? $.width : $.height), Re = ye > 0 ? ye + D(c ? $.paddingLeft : $.paddingTop) + D(c ? $.paddingRight : $.paddingBottom) + D(c ? $.borderLeftWidth : $.borderTopWidth) + D(c ? $.borderRightWidth : $.borderBottomWidth) : 0, Ee = Re > 0 ? Re : c ? l.offsetWidth : l.offsetHeight;
|
|
613
|
-
return Ee <= 0 || R <= 0 ? 1 : R / Ee;
|
|
614
|
-
},
|
|
615
|
-
[c]
|
|
616
|
-
), y = S(
|
|
630
|
+
const ge = ie(l, 0, z);
|
|
631
|
+
return ie(ge / z * H, 0, H);
|
|
632
|
+
}, []), p = S((l) => Tr(l, m ? "x" : "y"), [m]), M = S(
|
|
617
633
|
(l) => {
|
|
618
|
-
const
|
|
619
|
-
if (
|
|
634
|
+
const I = F.current;
|
|
635
|
+
if (I.pointerId !== l.pointerId)
|
|
620
636
|
return;
|
|
621
|
-
const
|
|
622
|
-
|
|
623
|
-
delta:
|
|
624
|
-
startThumbPosition:
|
|
637
|
+
const z = l.clientX - I.startClientX, H = l.clientY - I.startClientY, ge = it(z, H) / (I.scale || 1);
|
|
638
|
+
y.debug("[ScrollBar] handleThumbPointerMove", () => ({
|
|
639
|
+
delta: ge,
|
|
640
|
+
startThumbPosition: I.startThumbPosition,
|
|
625
641
|
clientY: l.clientY,
|
|
626
|
-
startClientY:
|
|
627
|
-
metrics:
|
|
642
|
+
startClientY: I.startClientY,
|
|
643
|
+
metrics: G.current
|
|
628
644
|
}));
|
|
629
|
-
const
|
|
630
|
-
|
|
645
|
+
const Ne = et(I.startThumbPosition + ge);
|
|
646
|
+
Ne !== null && $(Ne), l.cancelable && l.preventDefault();
|
|
631
647
|
},
|
|
632
|
-
[it,
|
|
633
|
-
),
|
|
648
|
+
[it, et, $]
|
|
649
|
+
), oe = S(
|
|
634
650
|
(l) => {
|
|
635
|
-
const
|
|
636
|
-
if (
|
|
651
|
+
const I = F.current;
|
|
652
|
+
if (I.pointerId !== l.pointerId)
|
|
637
653
|
return;
|
|
638
|
-
document.removeEventListener("pointermove",
|
|
639
|
-
const
|
|
640
|
-
if (
|
|
641
|
-
const
|
|
642
|
-
l.clientX >=
|
|
654
|
+
document.removeEventListener("pointermove", M), document.removeEventListener("pointerup", oe), document.removeEventListener("pointercancel", oe);
|
|
655
|
+
const z = I.captureTarget;
|
|
656
|
+
if (z?.hasPointerCapture?.(l.pointerId) && z.releasePointerCapture(l.pointerId), F.current = { pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1, captureTarget: null }, le(!1), R.current) {
|
|
657
|
+
const H = R.current.getBoundingClientRect();
|
|
658
|
+
l.clientX >= H.left && l.clientX <= H.right && l.clientY >= H.top && l.clientY <= H.bottom || te(!1);
|
|
643
659
|
} else
|
|
644
|
-
|
|
660
|
+
te(!1);
|
|
645
661
|
},
|
|
646
|
-
[
|
|
662
|
+
[M]
|
|
647
663
|
);
|
|
648
|
-
|
|
649
|
-
document.removeEventListener("pointermove",
|
|
650
|
-
}, [
|
|
651
|
-
const tt = g(0),
|
|
664
|
+
X(() => () => {
|
|
665
|
+
document.removeEventListener("pointermove", M), document.removeEventListener("pointerup", oe), document.removeEventListener("pointercancel", oe);
|
|
666
|
+
}, [M, oe]);
|
|
667
|
+
const tt = g(0), Ee = g(0), Vt = S(
|
|
652
668
|
(l) => {
|
|
653
|
-
const
|
|
654
|
-
|
|
669
|
+
const I = Math.max(Math.round(G.current.viewportSize / _r), Or);
|
|
670
|
+
Ee.current !== l && (Ee.current = l, tt.current = 0), Ce(tt, l * I);
|
|
655
671
|
},
|
|
656
|
-
[
|
|
657
|
-
), { handleArrowPointerDown:
|
|
658
|
-
canUseArrowButtons:
|
|
672
|
+
[Ce]
|
|
673
|
+
), { handleArrowPointerDown: lt, handleArrowPointerUp: Ye, handleArrowKeyDown: bt } = $r({
|
|
674
|
+
canUseArrowButtons: xe,
|
|
659
675
|
enableArrowButtons: a,
|
|
660
|
-
resetTapScroll:
|
|
661
|
-
scrollByStep:
|
|
662
|
-
}),
|
|
663
|
-
if (!
|
|
676
|
+
resetTapScroll: Re,
|
|
677
|
+
scrollByStep: Vt
|
|
678
|
+
}), Pt = (l) => {
|
|
679
|
+
if (!J)
|
|
664
680
|
return;
|
|
665
681
|
if (!i) {
|
|
666
682
|
l.preventDefault(), l.stopPropagation();
|
|
@@ -668,25 +684,25 @@ const le = (r, e, t) => Math.max(e, Math.min(t, r)), Gt = "virtualscroll:tap-scr
|
|
|
668
684
|
}
|
|
669
685
|
if (l.pointerType === "mouse" && l.button !== 0 || l.ctrlKey)
|
|
670
686
|
return;
|
|
671
|
-
|
|
672
|
-
const
|
|
673
|
-
let
|
|
674
|
-
if (
|
|
687
|
+
Re();
|
|
688
|
+
const I = l.currentTarget, z = p(I);
|
|
689
|
+
let H = null;
|
|
690
|
+
if (I.setPointerCapture)
|
|
675
691
|
try {
|
|
676
|
-
|
|
692
|
+
I.setPointerCapture(l.pointerId), H = I;
|
|
677
693
|
} catch {
|
|
678
|
-
|
|
694
|
+
H = null;
|
|
679
695
|
}
|
|
680
|
-
|
|
696
|
+
F.current = {
|
|
681
697
|
pointerId: l.pointerId,
|
|
682
|
-
startThumbPosition:
|
|
698
|
+
startThumbPosition: Q,
|
|
683
699
|
startClientX: l.clientX,
|
|
684
700
|
startClientY: l.clientY,
|
|
685
|
-
scale:
|
|
686
|
-
captureTarget:
|
|
687
|
-
}, document.addEventListener("pointermove",
|
|
688
|
-
},
|
|
689
|
-
if (!
|
|
701
|
+
scale: z,
|
|
702
|
+
captureTarget: H
|
|
703
|
+
}, document.addEventListener("pointermove", M), document.addEventListener("pointerup", oe), document.addEventListener("pointercancel", oe), le(!0), te(!0), l.preventDefault(), l.stopPropagation();
|
|
704
|
+
}, Ft = (l) => {
|
|
705
|
+
if (!J)
|
|
690
706
|
return;
|
|
691
707
|
if (!s) {
|
|
692
708
|
l.preventDefault(), l.stopPropagation();
|
|
@@ -694,168 +710,168 @@ const le = (r, e, t) => Math.max(e, Math.min(t, r)), Gt = "virtualscroll:tap-scr
|
|
|
694
710
|
}
|
|
695
711
|
if (l.pointerType === "mouse" && l.button !== 0 || l.ctrlKey)
|
|
696
712
|
return;
|
|
697
|
-
const
|
|
698
|
-
|
|
699
|
-
const
|
|
700
|
-
if (
|
|
713
|
+
const I = l.currentTarget, z = I.getBoundingClientRect(), H = E(l), ge = p(I), Ne = (H - (m ? z.left : z.top)) / ge;
|
|
714
|
+
Re();
|
|
715
|
+
const rt = Ne - P / 2, nt = we(rt);
|
|
716
|
+
if ($(nt), I.setPointerCapture)
|
|
701
717
|
try {
|
|
702
|
-
|
|
718
|
+
I.setPointerCapture(l.pointerId);
|
|
703
719
|
} catch {
|
|
704
720
|
}
|
|
705
|
-
|
|
721
|
+
w.current = {
|
|
706
722
|
pointerId: l.pointerId,
|
|
707
|
-
startThumbPosition:
|
|
723
|
+
startThumbPosition: rt,
|
|
708
724
|
startClientX: l.clientX,
|
|
709
725
|
startClientY: l.clientY,
|
|
710
|
-
scale:
|
|
726
|
+
scale: ge
|
|
711
727
|
}, l.preventDefault(), l.stopPropagation();
|
|
712
|
-
},
|
|
713
|
-
|
|
714
|
-
},
|
|
715
|
-
const
|
|
716
|
-
if (
|
|
728
|
+
}, ct = () => {
|
|
729
|
+
w.current = { pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1 };
|
|
730
|
+
}, yt = (l) => {
|
|
731
|
+
const I = w.current;
|
|
732
|
+
if (I.pointerId !== l.pointerId)
|
|
717
733
|
return;
|
|
718
734
|
if (l.pointerType === "mouse" && l.buttons === 0) {
|
|
719
|
-
|
|
735
|
+
ct();
|
|
720
736
|
return;
|
|
721
737
|
}
|
|
722
|
-
const
|
|
723
|
-
|
|
724
|
-
},
|
|
725
|
-
if (
|
|
738
|
+
const z = l.clientX - I.startClientX, H = l.clientY - I.startClientY, ge = it(z, H) / (I.scale || 1), Ne = we(I.startThumbPosition + ge);
|
|
739
|
+
$(Ne), l.cancelable && l.preventDefault();
|
|
740
|
+
}, Yt = (l) => {
|
|
741
|
+
if (w.current.pointerId !== l.pointerId)
|
|
726
742
|
return;
|
|
727
|
-
const
|
|
728
|
-
|
|
729
|
-
},
|
|
730
|
-
if (
|
|
743
|
+
const I = l.currentTarget;
|
|
744
|
+
I.hasPointerCapture?.(l.pointerId) && I.releasePointerCapture(l.pointerId), ct(), l.preventDefault(), l.stopPropagation();
|
|
745
|
+
}, Ct = (l) => {
|
|
746
|
+
if (w.current.pointerId !== l.pointerId)
|
|
731
747
|
return;
|
|
732
|
-
const
|
|
733
|
-
|
|
734
|
-
},
|
|
735
|
-
l.target === l.currentTarget &&
|
|
736
|
-
},
|
|
737
|
-
const
|
|
748
|
+
const I = l.currentTarget;
|
|
749
|
+
I.hasPointerCapture?.(l.pointerId) && I.releasePointerCapture(l.pointerId), ct();
|
|
750
|
+
}, Bt = (l) => {
|
|
751
|
+
l.target === l.currentTarget && w.current.pointerId === l.pointerId && ct();
|
|
752
|
+
}, he = _e(() => ie((se ? 1 : 0.8) * Ve, 0, 1), [se, Ve]), xt = _e(() => {
|
|
753
|
+
const I = `calc(50% - ${ke / 2}px + ${ze}px)`;
|
|
738
754
|
return {
|
|
739
755
|
left: $e,
|
|
740
|
-
top:
|
|
756
|
+
top: I
|
|
741
757
|
};
|
|
742
|
-
}, [$e, ze,
|
|
758
|
+
}, [$e, ze, ke]), Dt = (l, I, z, H) => /* @__PURE__ */ ne(
|
|
743
759
|
"button",
|
|
744
760
|
{
|
|
745
761
|
type: "button",
|
|
746
762
|
tabIndex: 0,
|
|
747
763
|
className: "aqvs-scrollbar-arrow-button",
|
|
748
764
|
style: {
|
|
749
|
-
[
|
|
750
|
-
[
|
|
765
|
+
[Qe]: d,
|
|
766
|
+
[We]: d
|
|
751
767
|
},
|
|
752
|
-
"aria-label":
|
|
753
|
-
onPointerDown:
|
|
754
|
-
onPointerUp:
|
|
755
|
-
onPointerLeave:
|
|
756
|
-
onPointerCancel:
|
|
757
|
-
onKeyDown:
|
|
768
|
+
"aria-label": I,
|
|
769
|
+
onPointerDown: lt(l),
|
|
770
|
+
onPointerUp: Ye,
|
|
771
|
+
onPointerLeave: Ye,
|
|
772
|
+
onPointerCancel: Ye,
|
|
773
|
+
onKeyDown: bt(l),
|
|
758
774
|
"aria-disabled": !a,
|
|
759
|
-
disabled: !
|
|
760
|
-
children: /* @__PURE__ */
|
|
775
|
+
disabled: !xe,
|
|
776
|
+
children: /* @__PURE__ */ ne("span", { "aria-hidden": "true", children: z })
|
|
761
777
|
},
|
|
762
|
-
|
|
763
|
-
),
|
|
764
|
-
orientation:
|
|
778
|
+
H
|
|
779
|
+
), At = h && J ? {
|
|
780
|
+
orientation: st,
|
|
765
781
|
scrollPosition: t,
|
|
766
|
-
maxScrollPosition:
|
|
782
|
+
maxScrollPosition: q,
|
|
767
783
|
contentSize: r,
|
|
768
784
|
viewportSize: e,
|
|
769
|
-
thumbSize:
|
|
770
|
-
thumbPosition:
|
|
771
|
-
thumbCenter:
|
|
772
|
-
trackSize:
|
|
773
|
-
isDragging:
|
|
774
|
-
isTapScrollActive:
|
|
775
|
-
visibleStartIndex:
|
|
776
|
-
visibleEndIndex:
|
|
785
|
+
thumbSize: P,
|
|
786
|
+
thumbPosition: Q,
|
|
787
|
+
thumbCenter: Se,
|
|
788
|
+
trackSize: Ae,
|
|
789
|
+
isDragging: D,
|
|
790
|
+
isTapScrollActive: se,
|
|
791
|
+
visibleStartIndex: L,
|
|
792
|
+
visibleEndIndex: U
|
|
777
793
|
} : null;
|
|
778
|
-
return /* @__PURE__ */
|
|
794
|
+
return /* @__PURE__ */ Tt(
|
|
779
795
|
"div",
|
|
780
796
|
{
|
|
781
|
-
className:
|
|
797
|
+
className: zt("aqvs-scrollbar", N, b),
|
|
782
798
|
style: {
|
|
783
|
-
[
|
|
784
|
-
[
|
|
799
|
+
[Qe]: e,
|
|
800
|
+
[We]: d
|
|
785
801
|
},
|
|
786
|
-
"data-visible":
|
|
802
|
+
"data-visible": J ? "true" : "false",
|
|
787
803
|
role: "scrollbar",
|
|
788
804
|
tabIndex: -1,
|
|
789
|
-
"aria-controls":
|
|
805
|
+
"aria-controls": x,
|
|
790
806
|
"aria-valuenow": t,
|
|
791
807
|
"aria-valuemin": 0,
|
|
792
|
-
"aria-valuemax":
|
|
793
|
-
"aria-orientation":
|
|
808
|
+
"aria-valuemax": q,
|
|
809
|
+
"aria-orientation": m ? "horizontal" : "vertical",
|
|
794
810
|
children: [
|
|
795
|
-
!
|
|
796
|
-
|
|
811
|
+
!m && J && V && /* @__PURE__ */ ne(
|
|
812
|
+
Sr,
|
|
797
813
|
{
|
|
798
|
-
ref:
|
|
799
|
-
className:
|
|
800
|
-
size:
|
|
801
|
-
maxVisualDistance:
|
|
802
|
-
style:
|
|
803
|
-
opacity:
|
|
804
|
-
renderVisual:
|
|
805
|
-
onDragChange:
|
|
814
|
+
ref: pe,
|
|
815
|
+
className: zt("aqvs-scrollbar-tap-circle-wrapper", Fe),
|
|
816
|
+
size: ke,
|
|
817
|
+
maxVisualDistance: Ke,
|
|
818
|
+
style: xt,
|
|
819
|
+
opacity: he,
|
|
820
|
+
renderVisual: be,
|
|
821
|
+
onDragChange: ot
|
|
806
822
|
},
|
|
807
823
|
"tap-circle"
|
|
808
824
|
),
|
|
809
|
-
|
|
810
|
-
/* @__PURE__ */
|
|
825
|
+
Dt(-1, gt[0], re[0], "arrow-start"),
|
|
826
|
+
/* @__PURE__ */ Tt(
|
|
811
827
|
"div",
|
|
812
828
|
{
|
|
813
829
|
className: "aqvs-scrollbar-track",
|
|
814
830
|
style: {
|
|
815
|
-
borderRadius:
|
|
831
|
+
borderRadius: d / 2
|
|
816
832
|
},
|
|
817
|
-
onPointerDown:
|
|
818
|
-
onPointerMove:
|
|
819
|
-
onPointerUp:
|
|
820
|
-
onPointerCancel:
|
|
821
|
-
onLostPointerCapture:
|
|
833
|
+
onPointerDown: Ft,
|
|
834
|
+
onPointerMove: yt,
|
|
835
|
+
onPointerUp: Yt,
|
|
836
|
+
onPointerCancel: Ct,
|
|
837
|
+
onLostPointerCapture: Bt,
|
|
822
838
|
"aria-disabled": !s,
|
|
823
839
|
children: [
|
|
824
|
-
|
|
825
|
-
/* @__PURE__ */
|
|
840
|
+
At && /* @__PURE__ */ ne("div", { className: "aqvs-scrollbar-overlay", "aria-hidden": !0, children: h?.(At) }, "overlay"),
|
|
841
|
+
/* @__PURE__ */ ne(
|
|
826
842
|
"div",
|
|
827
843
|
{
|
|
828
844
|
className: "aqvs-scrollbar-thumb-wrapper",
|
|
829
845
|
style: {
|
|
830
|
-
[
|
|
831
|
-
[
|
|
832
|
-
...
|
|
846
|
+
[Qe]: P,
|
|
847
|
+
[dt]: Q,
|
|
848
|
+
...m ? { top: 0, bottom: 0 } : { left: 0, right: 0 }
|
|
833
849
|
},
|
|
834
|
-
"data-visible":
|
|
835
|
-
onPointerDown:
|
|
850
|
+
"data-visible": J || D ? "true" : "false",
|
|
851
|
+
onPointerDown: Pt,
|
|
836
852
|
role: "slider",
|
|
837
|
-
"aria-orientation":
|
|
853
|
+
"aria-orientation": m ? "horizontal" : "vertical",
|
|
838
854
|
"aria-valuenow": t,
|
|
839
855
|
"aria-valuemin": 0,
|
|
840
|
-
"aria-valuemax":
|
|
856
|
+
"aria-valuemax": q,
|
|
841
857
|
"aria-disabled": !i,
|
|
842
858
|
tabIndex: -1,
|
|
843
|
-
children: /* @__PURE__ */
|
|
859
|
+
children: /* @__PURE__ */ ne(
|
|
844
860
|
"div",
|
|
845
861
|
{
|
|
846
|
-
ref:
|
|
847
|
-
className:
|
|
862
|
+
ref: R,
|
|
863
|
+
className: zt("aqvs-scrollbar-thumb", m ? "aqvs-scrollbar-thumb-horizontal" : "aqvs-scrollbar-thumb-vertical"),
|
|
848
864
|
"data-testid": "aqvs-scrollbar-thumb",
|
|
849
|
-
"data-thumb-state":
|
|
865
|
+
"data-thumb-state": Pe,
|
|
850
866
|
style: {
|
|
851
|
-
borderRadius:
|
|
867
|
+
borderRadius: d - 1,
|
|
852
868
|
cursor: i ? "pointer" : "default"
|
|
853
869
|
},
|
|
854
870
|
onMouseEnter: () => {
|
|
855
|
-
i &&
|
|
871
|
+
i && te(!0);
|
|
856
872
|
},
|
|
857
873
|
onMouseLeave: () => {
|
|
858
|
-
i &&
|
|
874
|
+
i && te(!1);
|
|
859
875
|
}
|
|
860
876
|
},
|
|
861
877
|
"thumb"
|
|
@@ -867,11 +883,11 @@ const le = (r, e, t) => Math.max(e, Math.min(t, r)), Gt = "virtualscroll:tap-scr
|
|
|
867
883
|
},
|
|
868
884
|
"track"
|
|
869
885
|
),
|
|
870
|
-
|
|
886
|
+
Dt(1, gt[1], re[1], "arrow-end")
|
|
871
887
|
]
|
|
872
888
|
}
|
|
873
889
|
);
|
|
874
|
-
},
|
|
890
|
+
}, jr = 16, hr = (r, e, t) => e === 1 ? r * jr : e === 2 ? r * t : r, Zr = (r, e) => {
|
|
875
891
|
const t = r.shiftKey && r.deltaX === 0, n = t ? r.deltaY : r.deltaX, i = t ? 0 : r.deltaY, s = n !== 0 && Math.abs(n) >= Math.abs(i);
|
|
876
892
|
return {
|
|
877
893
|
// ❗ ズームでもデルタは潰さない。ここは**事実だけ**を報告し、「横取りしない」という
|
|
@@ -880,21 +896,21 @@ const le = (r, e, t) => Math.max(e, Math.min(t, r)), Gt = "virtualscroll:tap-scr
|
|
|
880
896
|
// どのテストも検出できなくなる (変異解析で実証済み)。
|
|
881
897
|
isZoomGesture: r.ctrlKey,
|
|
882
898
|
isHorizontalDominant: s,
|
|
883
|
-
horizontalDelta:
|
|
884
|
-
verticalDelta:
|
|
899
|
+
horizontalDelta: hr(n, r.deltaMode, e),
|
|
900
|
+
verticalDelta: hr(i, r.deltaMode, e)
|
|
885
901
|
};
|
|
886
|
-
},
|
|
887
|
-
|
|
888
|
-
},
|
|
902
|
+
}, Mr = /* @__PURE__ */ new WeakSet(), gr = (r) => {
|
|
903
|
+
Mr.add(r);
|
|
904
|
+
}, Qr = (r) => Mr.has(r), Jr = ["mouse", "pen", "touch"], Qt = (r, e) => !(r === "mouse" || r === "pen" || r === "touch") || e.includes(r), en = (r) => r === "mouse" || r === "pen", _t = {
|
|
889
905
|
maxVelocity: 6,
|
|
890
906
|
minVelocity: 0.02,
|
|
891
907
|
deceleration: 25e-4,
|
|
892
908
|
velocitySampleWindow: 90,
|
|
893
909
|
startVelocityThreshold: 0.04
|
|
894
|
-
},
|
|
910
|
+
}, qt = (r, e, t) => {
|
|
895
911
|
for (const [n, i, s] of e)
|
|
896
912
|
t === "add" ? r.addEventListener(n, i, s) : r.removeEventListener(n, i, s);
|
|
897
|
-
},
|
|
913
|
+
}, tn = nr(
|
|
898
914
|
({
|
|
899
915
|
children: r,
|
|
900
916
|
contentSize: e,
|
|
@@ -903,239 +919,239 @@ const le = (r, e, t) => Math.max(e, Math.min(t, r)), Gt = "virtualscroll:tap-scr
|
|
|
903
919
|
scrollBarWidth: i = 12,
|
|
904
920
|
enableThumbDrag: s = !0,
|
|
905
921
|
enableTrackClick: a = !0,
|
|
906
|
-
enableArrowButtons:
|
|
907
|
-
enablePointerDrag:
|
|
908
|
-
pointerDragInputs: b =
|
|
909
|
-
onScroll:
|
|
910
|
-
className:
|
|
911
|
-
testId:
|
|
922
|
+
enableArrowButtons: m = !0,
|
|
923
|
+
enablePointerDrag: d = !0,
|
|
924
|
+
pointerDragInputs: b = Jr,
|
|
925
|
+
onScroll: x,
|
|
926
|
+
className: T,
|
|
927
|
+
testId: C,
|
|
912
928
|
style: h,
|
|
913
|
-
background:
|
|
914
|
-
tapScrollCircleOptions:
|
|
915
|
-
inertiaOptions:
|
|
916
|
-
itemCount:
|
|
917
|
-
renderThumbOverlay:
|
|
918
|
-
wheelSpeedMultiplier:
|
|
919
|
-
overscrollBehavior:
|
|
920
|
-
onWheelHorizontal:
|
|
921
|
-
contentInsets:
|
|
922
|
-
visibleStartIndex:
|
|
923
|
-
visibleEndIndex:
|
|
924
|
-
renderOverlay:
|
|
925
|
-
initialScrollPosition:
|
|
926
|
-
contentProps:
|
|
927
|
-
},
|
|
928
|
-
const
|
|
929
|
-
|
|
930
|
-
if (!
|
|
929
|
+
background: L,
|
|
930
|
+
tapScrollCircleOptions: U,
|
|
931
|
+
inertiaOptions: D,
|
|
932
|
+
itemCount: le,
|
|
933
|
+
renderThumbOverlay: ce,
|
|
934
|
+
wheelSpeedMultiplier: te = 1,
|
|
935
|
+
overscrollBehavior: se = "auto",
|
|
936
|
+
onWheelHorizontal: ue,
|
|
937
|
+
contentInsets: R,
|
|
938
|
+
visibleStartIndex: F,
|
|
939
|
+
visibleEndIndex: w,
|
|
940
|
+
renderOverlay: j,
|
|
941
|
+
initialScrollPosition: Z = 0,
|
|
942
|
+
contentProps: W
|
|
943
|
+
}, pe) => {
|
|
944
|
+
const A = g(Number.isFinite(Z) ? Math.max(0, Z) : 0), v = g(null), K = g(null), de = t === void 0, [qe, Xe] = je(0), V = t ?? qe, ke = g(null);
|
|
945
|
+
Ze(() => {
|
|
946
|
+
if (!de)
|
|
931
947
|
return;
|
|
932
|
-
const
|
|
933
|
-
if (!
|
|
948
|
+
const f = K.current;
|
|
949
|
+
if (!f)
|
|
934
950
|
return;
|
|
935
|
-
const
|
|
936
|
-
const
|
|
937
|
-
if (
|
|
938
|
-
|
|
951
|
+
const P = () => {
|
|
952
|
+
const B = f.offsetHeight;
|
|
953
|
+
if (B > 0) {
|
|
954
|
+
Xe((Q) => Q === B ? Q : B);
|
|
939
955
|
return;
|
|
940
956
|
}
|
|
941
|
-
|
|
957
|
+
f.offsetParent !== null && e > 0 && ke.current !== "zero" && (ke.current = "zero", y.warn("[ScrollPane] The self-measured viewport is 0px. Give the scroll pane's host element a definite height (e.g. h-full, flex-1 + min-h-0, an explicit px height), or pass viewportSize explicitly."));
|
|
942
958
|
};
|
|
943
|
-
if (
|
|
959
|
+
if (P(), typeof ResizeObserver != "function")
|
|
944
960
|
return;
|
|
945
|
-
const
|
|
946
|
-
return
|
|
947
|
-
|
|
961
|
+
const q = new ResizeObserver(P);
|
|
962
|
+
return q.observe(f), () => {
|
|
963
|
+
q.disconnect();
|
|
948
964
|
};
|
|
949
|
-
}, [e,
|
|
950
|
-
|
|
951
|
-
}, [
|
|
952
|
-
if (
|
|
965
|
+
}, [e, de]), Ze(() => {
|
|
966
|
+
de && n?.(qe);
|
|
967
|
+
}, [de, qe, n]), Ze(() => {
|
|
968
|
+
if (de)
|
|
953
969
|
return;
|
|
954
|
-
const
|
|
955
|
-
if (!
|
|
970
|
+
const f = v.current;
|
|
971
|
+
if (!f)
|
|
956
972
|
return;
|
|
957
|
-
const
|
|
958
|
-
const
|
|
959
|
-
if (
|
|
973
|
+
const P = () => {
|
|
974
|
+
const B = f.clientHeight;
|
|
975
|
+
if (B <= 0 || Math.abs(B - V) <= 1)
|
|
960
976
|
return;
|
|
961
|
-
const
|
|
962
|
-
|
|
963
|
-
`[ScrollPane] viewportSize=${
|
|
977
|
+
const Q = `${V}/${B}`;
|
|
978
|
+
ke.current !== Q && (ke.current = Q, y.warn(
|
|
979
|
+
`[ScrollPane] viewportSize=${V} but the host band is ${B}px. The clip window, max scroll position, thumb mapping, rendered row count and scrollability all derive from viewportSize, so they are now wrong. Omit viewportSize to let the pane measure itself.`
|
|
964
980
|
));
|
|
965
981
|
};
|
|
966
|
-
if (
|
|
982
|
+
if (P(), typeof ResizeObserver != "function")
|
|
967
983
|
return;
|
|
968
|
-
const
|
|
969
|
-
return
|
|
970
|
-
|
|
984
|
+
const q = new ResizeObserver(P);
|
|
985
|
+
return q.observe(f), () => {
|
|
986
|
+
q.disconnect();
|
|
971
987
|
};
|
|
972
|
-
}, [
|
|
973
|
-
const $e = g(
|
|
974
|
-
|
|
975
|
-
$e.current =
|
|
976
|
-
}, [
|
|
988
|
+
}, [de, V]);
|
|
989
|
+
const $e = g(ue);
|
|
990
|
+
X(() => {
|
|
991
|
+
$e.current = ue;
|
|
992
|
+
}, [ue]);
|
|
977
993
|
const ze = g({
|
|
978
994
|
frame: null,
|
|
979
995
|
velocity: 0,
|
|
980
996
|
lastTimestamp: null,
|
|
981
997
|
generation: 0
|
|
982
|
-
}),
|
|
998
|
+
}), Fe = _e(
|
|
983
999
|
() => ({
|
|
984
|
-
maxVelocity:
|
|
985
|
-
minVelocity:
|
|
986
|
-
deceleration:
|
|
987
|
-
velocitySampleWindow:
|
|
988
|
-
startVelocityThreshold:
|
|
1000
|
+
maxVelocity: D?.maxVelocity ?? _t.maxVelocity,
|
|
1001
|
+
minVelocity: D?.minVelocity ?? _t.minVelocity,
|
|
1002
|
+
deceleration: D?.deceleration ?? _t.deceleration,
|
|
1003
|
+
velocitySampleWindow: D?.velocitySampleWindow ?? _t.velocitySampleWindow,
|
|
1004
|
+
startVelocityThreshold: D?.startVelocityThreshold ?? _t.startVelocityThreshold
|
|
989
1005
|
}),
|
|
990
|
-
[
|
|
991
|
-
),
|
|
992
|
-
top: Math.max(0,
|
|
993
|
-
bottom: Math.max(0,
|
|
994
|
-
}), [
|
|
995
|
-
|
|
1006
|
+
[D]
|
|
1007
|
+
), Ue = _e(() => ({
|
|
1008
|
+
top: Math.max(0, R?.top ?? 0),
|
|
1009
|
+
bottom: Math.max(0, R?.bottom ?? 0)
|
|
1010
|
+
}), [R]);
|
|
1011
|
+
y.debug("[ScrollPane] ScrollPane rendered", () => ({
|
|
996
1012
|
contentSize: e,
|
|
997
|
-
viewportSize:
|
|
1013
|
+
viewportSize: V,
|
|
998
1014
|
scrollBarWidth: i,
|
|
999
|
-
className:
|
|
1015
|
+
className: T,
|
|
1000
1016
|
style: h,
|
|
1001
|
-
tapScrollCircleOptions:
|
|
1002
|
-
inertiaOptions:
|
|
1003
|
-
enablePointerDrag:
|
|
1004
|
-
contentInsets:
|
|
1017
|
+
tapScrollCircleOptions: U,
|
|
1018
|
+
inertiaOptions: D,
|
|
1019
|
+
enablePointerDrag: d,
|
|
1020
|
+
contentInsets: Ue
|
|
1005
1021
|
}));
|
|
1006
|
-
const
|
|
1007
|
-
(
|
|
1008
|
-
let
|
|
1009
|
-
|
|
1010
|
-
const { contentSize:
|
|
1011
|
-
if (
|
|
1012
|
-
return
|
|
1013
|
-
const
|
|
1014
|
-
if (!Number.isFinite(
|
|
1015
|
-
return
|
|
1016
|
-
const
|
|
1017
|
-
return
|
|
1022
|
+
const De = g({ contentSize: e, viewportSize: V }), Me = _e(() => e > V, [e, V]), Ve = S(
|
|
1023
|
+
(f, P) => {
|
|
1024
|
+
let q = P ?? De.current;
|
|
1025
|
+
P && !(Number.isFinite(P.contentSize) && Number.isFinite(P.viewportSize)) && (y.warn("[ScrollPane] scrollTo received non-finite dimsOverride; falling back to the committed dims", { dimsOverride: P }), q = De.current);
|
|
1026
|
+
const { contentSize: B, viewportSize: Q } = q, Se = B > Q, J = A.current;
|
|
1027
|
+
if (y.debug("[ScrollPane] scrollTo called", () => ({ newPosition: f, contentSize: B, viewportSize: Q, currentIsScrollable: Se, prevPosition: J })), !Se)
|
|
1028
|
+
return A.current !== 0 && (A.current = 0, x?.(0, J)), A.current;
|
|
1029
|
+
const xe = typeof f == "function" ? f(A.current) : f;
|
|
1030
|
+
if (!Number.isFinite(xe))
|
|
1031
|
+
return y.warn("[ScrollPane] scrollTo received a non-finite position; keeping the current position", { nextPosition: xe }), A.current;
|
|
1032
|
+
const Pe = Math.max(B - Q, 0), $ = ie(xe, 0, Pe);
|
|
1033
|
+
return A.current !== $ && (A.current = $, x?.($, J)), A.current;
|
|
1018
1034
|
},
|
|
1019
|
-
[
|
|
1020
|
-
),
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
}, [
|
|
1024
|
-
const
|
|
1025
|
-
const
|
|
1026
|
-
|
|
1027
|
-
}, []),
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
}, [
|
|
1031
|
-
|
|
1035
|
+
[x]
|
|
1036
|
+
), be = g(Ve);
|
|
1037
|
+
X(() => {
|
|
1038
|
+
be.current = Ve;
|
|
1039
|
+
}, [Ve]);
|
|
1040
|
+
const Ie = S(() => {
|
|
1041
|
+
const f = ze.current;
|
|
1042
|
+
f.generation += 1, f.frame !== null && cancelAnimationFrame(f.frame), f.frame = null, f.velocity = 0, f.lastTimestamp = null;
|
|
1043
|
+
}, []), G = g(Ie);
|
|
1044
|
+
X(() => {
|
|
1045
|
+
G.current = Ie;
|
|
1046
|
+
}, [Ie]), X(() => () => {
|
|
1047
|
+
G.current();
|
|
1032
1048
|
}, []);
|
|
1033
|
-
const
|
|
1034
|
-
(
|
|
1035
|
-
if (!
|
|
1049
|
+
const Qe = S(
|
|
1050
|
+
(f) => {
|
|
1051
|
+
if (!Me)
|
|
1036
1052
|
return;
|
|
1037
|
-
const { maxVelocity:
|
|
1038
|
-
if (Math.abs(
|
|
1053
|
+
const { maxVelocity: P, minVelocity: q, deceleration: B, startVelocityThreshold: Q } = Fe, Se = ie(f, -P, P);
|
|
1054
|
+
if (Math.abs(Se) < Q)
|
|
1039
1055
|
return;
|
|
1040
|
-
|
|
1041
|
-
const
|
|
1042
|
-
const
|
|
1043
|
-
if (
|
|
1056
|
+
Ie(), ze.current.velocity = Se, ze.current.lastTimestamp = null;
|
|
1057
|
+
const J = ze.current.generation, xe = (Pe) => {
|
|
1058
|
+
const $ = ze.current;
|
|
1059
|
+
if ($.generation !== J)
|
|
1044
1060
|
return;
|
|
1045
|
-
if (
|
|
1046
|
-
|
|
1061
|
+
if ($.lastTimestamp === null) {
|
|
1062
|
+
$.lastTimestamp = Pe, $.frame = requestAnimationFrame(xe);
|
|
1047
1063
|
return;
|
|
1048
1064
|
}
|
|
1049
|
-
const
|
|
1050
|
-
if (
|
|
1051
|
-
|
|
1065
|
+
const ye = Pe - $.lastTimestamp;
|
|
1066
|
+
if ($.lastTimestamp = Pe, ye <= 0) {
|
|
1067
|
+
$.frame = requestAnimationFrame(xe);
|
|
1052
1068
|
return;
|
|
1053
1069
|
}
|
|
1054
|
-
const
|
|
1055
|
-
let
|
|
1056
|
-
const
|
|
1057
|
-
|
|
1058
|
-
const
|
|
1059
|
-
if (
|
|
1070
|
+
const Ce = $.velocity;
|
|
1071
|
+
let fe = Ce;
|
|
1072
|
+
const Re = B * ye;
|
|
1073
|
+
Ce > 0 ? fe = Math.max(0, Ce - Re) : Ce < 0 && (fe = Math.min(0, Ce + Re));
|
|
1074
|
+
const Le = (Ce + fe) / 2 * ye, ot = A.current;
|
|
1075
|
+
if (Le !== 0 && be.current((tt) => tt + Le), ze.current.generation !== J)
|
|
1060
1076
|
return;
|
|
1061
|
-
const
|
|
1062
|
-
|
|
1063
|
-
const
|
|
1064
|
-
if (Math.abs(
|
|
1065
|
-
|
|
1077
|
+
const we = A.current, { contentSize: et, viewportSize: p } = De.current, M = Math.max(et - p, 0);
|
|
1078
|
+
$.velocity = fe;
|
|
1079
|
+
const oe = we === ot || we <= 0 && fe <= 0 || we >= M && fe >= 0;
|
|
1080
|
+
if (Math.abs(fe) < q || oe) {
|
|
1081
|
+
Ie();
|
|
1066
1082
|
return;
|
|
1067
1083
|
}
|
|
1068
|
-
|
|
1084
|
+
$.frame = requestAnimationFrame(xe);
|
|
1069
1085
|
};
|
|
1070
|
-
ze.current.frame = requestAnimationFrame(
|
|
1086
|
+
ze.current.frame = requestAnimationFrame(xe);
|
|
1071
1087
|
},
|
|
1072
|
-
[
|
|
1073
|
-
),
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
}, [
|
|
1077
|
-
|
|
1078
|
-
}, [e,
|
|
1079
|
-
const
|
|
1080
|
-
if (!
|
|
1081
|
-
const
|
|
1082
|
-
|
|
1088
|
+
[Me, Fe, Ie]
|
|
1089
|
+
), We = g(Qe);
|
|
1090
|
+
X(() => {
|
|
1091
|
+
We.current = Qe;
|
|
1092
|
+
}, [Qe]), Ze(() => {
|
|
1093
|
+
De.current = { contentSize: e, viewportSize: V };
|
|
1094
|
+
}, [e, V]), Ze(() => {
|
|
1095
|
+
const f = K.current;
|
|
1096
|
+
if (!f) return;
|
|
1097
|
+
const P = () => {
|
|
1098
|
+
f.scrollTop !== 0 && (y.debug("[ScrollPane] Native scroll detected, resetting to 0", () => ({ scrollTop: f.scrollTop })), f.scrollTop = 0), f.scrollLeft !== 0 && (f.scrollLeft = 0);
|
|
1083
1099
|
};
|
|
1084
|
-
return
|
|
1085
|
-
}, []),
|
|
1086
|
-
if (
|
|
1087
|
-
|
|
1088
|
-
const
|
|
1089
|
-
|
|
1100
|
+
return f.addEventListener("scroll", P), () => f.removeEventListener("scroll", P);
|
|
1101
|
+
}, []), Ze(() => {
|
|
1102
|
+
if (Me) {
|
|
1103
|
+
y.debug("[ScrollPane] Adjusting scroll position due to content or viewport size change", () => ({ contentSize: e, viewportSize: V, scrollPosition: A.current }));
|
|
1104
|
+
const f = ie(e - V, 0, e);
|
|
1105
|
+
A.current > f && Ve(f);
|
|
1090
1106
|
} else
|
|
1091
|
-
|
|
1092
|
-
}, [
|
|
1093
|
-
const
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
}, [
|
|
1107
|
+
Ve(0);
|
|
1108
|
+
}, [Me, Ve, e, V]);
|
|
1109
|
+
const dt = g({ isScrollable: Me, viewportSize: V, wheelSpeedMultiplier: te, overscrollBehavior: se });
|
|
1110
|
+
Ze(() => {
|
|
1111
|
+
dt.current = { isScrollable: Me, viewportSize: V, wheelSpeedMultiplier: te, overscrollBehavior: se };
|
|
1112
|
+
}, [Me, V, te, se]);
|
|
1097
1113
|
const it = S(
|
|
1098
|
-
(
|
|
1099
|
-
if (
|
|
1114
|
+
(f) => {
|
|
1115
|
+
if (Qr(f))
|
|
1100
1116
|
return !1;
|
|
1101
|
-
const { isScrollable:
|
|
1102
|
-
if (
|
|
1117
|
+
const { isScrollable: P, viewportSize: q, wheelSpeedMultiplier: B, overscrollBehavior: Q } = dt.current, Se = Zr(f, q);
|
|
1118
|
+
if (Se.isZoomGesture)
|
|
1103
1119
|
return !1;
|
|
1104
|
-
if (
|
|
1105
|
-
return $e.current ? (
|
|
1106
|
-
if (!
|
|
1120
|
+
if (Se.isHorizontalDominant)
|
|
1121
|
+
return $e.current ? (gr(f), f.preventDefault(), Ie(), $e.current(Se.horizontalDelta), !0) : !1;
|
|
1122
|
+
if (!P || Se.verticalDelta === 0)
|
|
1107
1123
|
return !1;
|
|
1108
|
-
let
|
|
1109
|
-
if (
|
|
1110
|
-
const
|
|
1111
|
-
if (
|
|
1124
|
+
let J = Se.verticalDelta;
|
|
1125
|
+
if (B !== 1 && (J *= B), Q !== "contain") {
|
|
1126
|
+
const xe = A.current, Pe = Math.max(De.current.contentSize - q, 0);
|
|
1127
|
+
if (J > 0 && xe >= Pe || J < 0 && xe <= 0)
|
|
1112
1128
|
return !1;
|
|
1113
1129
|
}
|
|
1114
|
-
return
|
|
1130
|
+
return gr(f), f.preventDefault(), Ie(), y.debug("[ScrollPane] wheel event", () => ({ deltaY: J, scrollPosition: A.current, wheelSpeedMultiplier: B, deltaMode: f.deltaMode, scrollTop: K.current?.scrollTop })), Ve((xe) => xe + J), !0;
|
|
1115
1131
|
},
|
|
1116
|
-
[
|
|
1132
|
+
[Ve, Ie]
|
|
1117
1133
|
);
|
|
1118
|
-
|
|
1119
|
-
const
|
|
1120
|
-
it(
|
|
1121
|
-
},
|
|
1122
|
-
|
|
1123
|
-
},
|
|
1124
|
-
return
|
|
1125
|
-
|
|
1134
|
+
X(() => {
|
|
1135
|
+
const f = (B) => {
|
|
1136
|
+
it(B);
|
|
1137
|
+
}, P = () => {
|
|
1138
|
+
Ie();
|
|
1139
|
+
}, q = v.current;
|
|
1140
|
+
return q && (q.addEventListener("wheel", f, { passive: !1 }), q.addEventListener("pointerdown", P, { capture: !0, passive: !0 })), () => {
|
|
1141
|
+
q && (q.removeEventListener("wheel", f), q.removeEventListener("pointerdown", P, { capture: !0 }));
|
|
1126
1142
|
};
|
|
1127
|
-
}, [it,
|
|
1128
|
-
|
|
1143
|
+
}, [it, Ie]), ir(
|
|
1144
|
+
pe,
|
|
1129
1145
|
() => ({
|
|
1130
|
-
scrollTo: (
|
|
1131
|
-
getScrollPosition: () =>
|
|
1146
|
+
scrollTo: (f, P) => (Ie(), Ve(f, P)),
|
|
1147
|
+
getScrollPosition: () => A.current,
|
|
1132
1148
|
getContentSize: () => e,
|
|
1133
|
-
getViewportSize: () =>
|
|
1149
|
+
getViewportSize: () => V,
|
|
1134
1150
|
applyWheel: it
|
|
1135
1151
|
}),
|
|
1136
|
-
[
|
|
1152
|
+
[Ve, e, V, Ie, it]
|
|
1137
1153
|
);
|
|
1138
|
-
const
|
|
1154
|
+
const E = Vr(), gt = W?.id ?? E, re = g({
|
|
1139
1155
|
pointerType: "",
|
|
1140
1156
|
pointerId: null,
|
|
1141
1157
|
startClientY: 0,
|
|
@@ -1143,152 +1159,153 @@ const le = (r, e, t) => Math.max(e, Math.min(t, r)), Gt = "virtualscroll:tap-scr
|
|
|
1143
1159
|
isDragging: !1,
|
|
1144
1160
|
shouldCancelNextClick: !1,
|
|
1145
1161
|
clickResetTimer: null,
|
|
1146
|
-
velocitySamples: []
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1162
|
+
velocitySamples: [],
|
|
1163
|
+
scale: 1
|
|
1164
|
+
}), N = g(d), st = g(b);
|
|
1165
|
+
X(() => {
|
|
1166
|
+
N.current = d;
|
|
1167
|
+
}, [d]), X(() => {
|
|
1168
|
+
st.current = b;
|
|
1152
1169
|
}, [b]);
|
|
1153
|
-
const
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
}, [
|
|
1157
|
-
const
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
}, [
|
|
1161
|
-
const
|
|
1162
|
-
if (
|
|
1170
|
+
const Ke = g(Me);
|
|
1171
|
+
X(() => {
|
|
1172
|
+
Ke.current = Me;
|
|
1173
|
+
}, [Me]);
|
|
1174
|
+
const ft = g(Fe);
|
|
1175
|
+
X(() => {
|
|
1176
|
+
ft.current = Fe;
|
|
1177
|
+
}, [Fe]), X(() => {
|
|
1178
|
+
const f = re.current;
|
|
1179
|
+
if (d && Me && (f.pointerId === null || Qt(f.pointerType, b)) || f.pointerId === null)
|
|
1163
1180
|
return;
|
|
1164
|
-
const
|
|
1165
|
-
|
|
1166
|
-
const
|
|
1167
|
-
|
|
1168
|
-
}, [
|
|
1169
|
-
const
|
|
1170
|
-
if (!
|
|
1181
|
+
const P = K.current;
|
|
1182
|
+
f.clickResetTimer !== null && (window.clearTimeout(f.clickResetTimer), f.clickResetTimer = null);
|
|
1183
|
+
const q = f.isDragging && f.shouldCancelNextClick, B = f.pointerId;
|
|
1184
|
+
f.pointerId = null, f.pointerType = "", f.startClientY = 0, f.startScroll = 0, f.isDragging = !1, f.shouldCancelNextClick = q, f.velocitySamples = [], f.scale = 1, P?.hasPointerCapture(B) && P.releasePointerCapture(B);
|
|
1185
|
+
}, [d, b, Me]), X(() => {
|
|
1186
|
+
const f = K.current;
|
|
1187
|
+
if (!f)
|
|
1171
1188
|
return;
|
|
1172
|
-
const
|
|
1173
|
-
const
|
|
1174
|
-
|
|
1175
|
-
},
|
|
1176
|
-
const
|
|
1177
|
-
|
|
1178
|
-
},
|
|
1179
|
-
const
|
|
1180
|
-
|
|
1181
|
-
const tt =
|
|
1182
|
-
|
|
1183
|
-
},
|
|
1184
|
-
const
|
|
1185
|
-
|
|
1186
|
-
},
|
|
1187
|
-
const
|
|
1188
|
-
if (!
|
|
1189
|
-
if (
|
|
1189
|
+
const P = 6, q = () => typeof performance < "u" && typeof performance.now == "function" ? performance.now() : Date.now(), B = () => {
|
|
1190
|
+
const p = re.current;
|
|
1191
|
+
p.pointerId = null, p.pointerType = "", p.startClientY = 0, p.startScroll = 0, p.isDragging = !1, p.velocitySamples = [], p.scale = 1;
|
|
1192
|
+
}, Q = () => {
|
|
1193
|
+
const p = re.current;
|
|
1194
|
+
p.clickResetTimer !== null && (window.clearTimeout(p.clickResetTimer), p.clickResetTimer = null);
|
|
1195
|
+
}, Se = (p) => {
|
|
1196
|
+
const M = re.current, oe = q();
|
|
1197
|
+
M.velocitySamples.push({ clientY: p, time: oe });
|
|
1198
|
+
const tt = ft.current.velocitySampleWindow;
|
|
1199
|
+
M.velocitySamples = M.velocitySamples.filter((Ee) => oe - Ee.time <= tt);
|
|
1200
|
+
}, J = (p) => p instanceof HTMLElement && p.closest("[data-scrollpane-ignore-drag='true']") !== null, xe = (p) => {
|
|
1201
|
+
const M = re.current;
|
|
1202
|
+
M.shouldCancelNextClick && (p.preventDefault(), p.stopPropagation(), M.shouldCancelNextClick = !1);
|
|
1203
|
+
}, Pe = (p) => {
|
|
1204
|
+
const M = re.current;
|
|
1205
|
+
if (!M.isDragging) {
|
|
1206
|
+
if (M.isDragging = !0, M.shouldCancelNextClick = !0, !f.hasPointerCapture(p.pointerId))
|
|
1190
1207
|
try {
|
|
1191
|
-
|
|
1208
|
+
f.setPointerCapture(p.pointerId);
|
|
1192
1209
|
} catch {
|
|
1193
1210
|
}
|
|
1194
|
-
|
|
1211
|
+
Se(p.clientY);
|
|
1195
1212
|
}
|
|
1196
|
-
},
|
|
1197
|
-
const
|
|
1198
|
-
|
|
1199
|
-
},
|
|
1200
|
-
const
|
|
1201
|
-
if (
|
|
1213
|
+
}, $ = (p) => p.isTrusted || p.target === f, ye = (p) => {
|
|
1214
|
+
const M = re.current;
|
|
1215
|
+
f.hasPointerCapture(p) && f.releasePointerCapture(p), M.shouldCancelNextClick = !1, Q(), B();
|
|
1216
|
+
}, Ce = (p) => {
|
|
1217
|
+
const M = re.current;
|
|
1218
|
+
if (M.pointerId !== p.pointerId)
|
|
1202
1219
|
return;
|
|
1203
|
-
if (
|
|
1204
|
-
|
|
1220
|
+
if (p.buttons === 0 && en(p.pointerType)) {
|
|
1221
|
+
ye(p.pointerId);
|
|
1205
1222
|
return;
|
|
1206
1223
|
}
|
|
1207
|
-
if (!(
|
|
1224
|
+
if (!(N.current && Ke.current) || !Qt(p.pointerType, st.current) || !M.isDragging && (Math.abs(p.clientY - M.startClientY) < P || (Pe(p), !M.isDragging)))
|
|
1208
1225
|
return;
|
|
1209
|
-
|
|
1210
|
-
const
|
|
1211
|
-
|
|
1212
|
-
},
|
|
1213
|
-
const
|
|
1214
|
-
return
|
|
1215
|
-
const
|
|
1216
|
-
|
|
1226
|
+
Se(p.clientY);
|
|
1227
|
+
const oe = (p.clientY - M.startClientY) / (M.scale || 1), tt = M.startScroll - oe;
|
|
1228
|
+
be.current(tt), p.cancelable && p.preventDefault();
|
|
1229
|
+
}, fe = () => {
|
|
1230
|
+
const p = re.current;
|
|
1231
|
+
return p.pointerId !== null || !p.shouldCancelNextClick ? !1 : (Q(), p.clickResetTimer = window.setTimeout(() => {
|
|
1232
|
+
const M = re.current;
|
|
1233
|
+
M.shouldCancelNextClick = !1, M.clickResetTimer = null;
|
|
1217
1234
|
}, 0), !0);
|
|
1218
|
-
},
|
|
1219
|
-
const
|
|
1220
|
-
if (
|
|
1221
|
-
|
|
1235
|
+
}, Re = (p) => {
|
|
1236
|
+
const M = re.current;
|
|
1237
|
+
if (M.pointerId !== p.pointerId) {
|
|
1238
|
+
fe();
|
|
1222
1239
|
return;
|
|
1223
1240
|
}
|
|
1224
|
-
|
|
1225
|
-
let
|
|
1226
|
-
if (
|
|
1227
|
-
const
|
|
1228
|
-
if (
|
|
1229
|
-
const
|
|
1230
|
-
|
|
1241
|
+
M.isDragging && M.shouldCancelNextClick && p.cancelable && (p.preventDefault(), p.stopPropagation()), M.isDragging && Se(p.clientY);
|
|
1242
|
+
let oe = 0;
|
|
1243
|
+
if (M.isDragging && M.velocitySamples.length >= 2) {
|
|
1244
|
+
const Ee = M.velocitySamples, Vt = ft.current.velocitySampleWindow, lt = Ee[Ee.length - 1], Ye = Ee.find((bt) => lt.time - bt.time <= Vt) ?? Ee[0];
|
|
1245
|
+
if (lt && Ye && lt.time !== Ye.time) {
|
|
1246
|
+
const bt = lt.clientY - Ye.clientY, Pt = lt.time - Ye.time;
|
|
1247
|
+
oe = -(bt / Pt) / (M.scale || 1);
|
|
1231
1248
|
}
|
|
1232
1249
|
}
|
|
1233
|
-
|
|
1234
|
-
const
|
|
1235
|
-
|
|
1250
|
+
Q(), M.shouldCancelNextClick && (M.clickResetTimer = window.setTimeout(() => {
|
|
1251
|
+
const Ee = re.current;
|
|
1252
|
+
Ee.shouldCancelNextClick = !1, Ee.clickResetTimer = null;
|
|
1236
1253
|
}, 0));
|
|
1237
|
-
const tt =
|
|
1238
|
-
|
|
1239
|
-
},
|
|
1240
|
-
if (
|
|
1241
|
-
if (!
|
|
1254
|
+
const tt = ft.current.startVelocityThreshold;
|
|
1255
|
+
B(), f.hasPointerCapture(p.pointerId) && f.releasePointerCapture(p.pointerId), Math.abs(oe) >= tt && We.current?.(oe);
|
|
1256
|
+
}, Je = (p) => {
|
|
1257
|
+
if (re.current.pointerId !== null) {
|
|
1258
|
+
if (!p.isPrimary || p.pointerType !== re.current.pointerType)
|
|
1242
1259
|
return;
|
|
1243
|
-
|
|
1260
|
+
ye(re.current.pointerId);
|
|
1244
1261
|
}
|
|
1245
|
-
if (
|
|
1262
|
+
if (re.current.shouldCancelNextClick && (Q(), re.current.shouldCancelNextClick = !1), !(N.current && Ke.current) || !Qt(p.pointerType, st.current) || p.button !== 0 && p.pointerType === "mouse" || p.ctrlKey || p.metaKey || p.altKey || J(p.target))
|
|
1246
1263
|
return;
|
|
1247
|
-
window.dispatchEvent(new CustomEvent(
|
|
1248
|
-
const
|
|
1249
|
-
|
|
1250
|
-
},
|
|
1251
|
-
if (
|
|
1252
|
-
|
|
1264
|
+
window.dispatchEvent(new CustomEvent(tr, { detail: { paneId: E } })), G.current?.();
|
|
1265
|
+
const M = re.current;
|
|
1266
|
+
Q(), M.pointerId = p.pointerId, M.pointerType = p.pointerType, M.startClientY = p.clientY, M.startScroll = A.current, M.scale = Tr(f, "y"), M.isDragging = !1, M.shouldCancelNextClick = !1, M.velocitySamples = [];
|
|
1267
|
+
}, Le = (p) => {
|
|
1268
|
+
if (re.current.pointerId !== p.pointerId) {
|
|
1269
|
+
fe();
|
|
1253
1270
|
return;
|
|
1254
1271
|
}
|
|
1255
|
-
|
|
1256
|
-
},
|
|
1257
|
-
["click",
|
|
1258
|
-
["pointerdown",
|
|
1259
|
-
["lostpointercapture", (
|
|
1260
|
-
|
|
1272
|
+
$(p) && ye(p.pointerId);
|
|
1273
|
+
}, we = [
|
|
1274
|
+
["click", xe, !0],
|
|
1275
|
+
["pointerdown", Je, { passive: !1 }],
|
|
1276
|
+
["lostpointercapture", (p) => {
|
|
1277
|
+
p.target !== f || re.current.pointerId !== p.pointerId || ye(p.pointerId);
|
|
1261
1278
|
}, void 0]
|
|
1262
|
-
],
|
|
1263
|
-
["pointermove",
|
|
1264
|
-
["pointerup",
|
|
1265
|
-
["pointercancel",
|
|
1279
|
+
], et = [
|
|
1280
|
+
["pointermove", Ce, { passive: !1 }],
|
|
1281
|
+
["pointerup", Re, void 0],
|
|
1282
|
+
["pointercancel", Le, void 0]
|
|
1266
1283
|
];
|
|
1267
|
-
return
|
|
1268
|
-
|
|
1269
|
-
const
|
|
1270
|
-
|
|
1284
|
+
return qt(f, we, "add"), qt(window, et, "add"), () => {
|
|
1285
|
+
qt(f, we, "remove"), qt(window, et, "remove");
|
|
1286
|
+
const p = re.current;
|
|
1287
|
+
p.pointerId !== null && f.hasPointerCapture(p.pointerId) && f.releasePointerCapture(p.pointerId), Q(), B();
|
|
1271
1288
|
};
|
|
1272
|
-
}, [
|
|
1273
|
-
const
|
|
1274
|
-
(
|
|
1275
|
-
[
|
|
1289
|
+
}, [E]);
|
|
1290
|
+
const Ae = S(
|
|
1291
|
+
(f) => (Ie(), Ve(f)),
|
|
1292
|
+
[Ve, Ie]
|
|
1276
1293
|
);
|
|
1277
|
-
return /* @__PURE__ */
|
|
1278
|
-
/* @__PURE__ */
|
|
1294
|
+
return /* @__PURE__ */ Tt("div", { ref: v, "data-testid": C, "data-self-measured": de ? "true" : void 0, className: zt("aqvs-scroll-pane", T), style: h, children: [
|
|
1295
|
+
/* @__PURE__ */ Tt(
|
|
1279
1296
|
"div",
|
|
1280
1297
|
{
|
|
1281
|
-
ref:
|
|
1282
|
-
className:
|
|
1298
|
+
ref: K,
|
|
1299
|
+
className: zt("aqvs-scroll-pane-content"),
|
|
1283
1300
|
"data-testid": "aqvs-scroll-pane-content",
|
|
1284
1301
|
style: {
|
|
1285
1302
|
// ❗ 自己計測モードでは高さを書かない。CSS の `height: 100%` (= ルートの確定高さ) が
|
|
1286
1303
|
// レイアウトを所有することで、「計測した値を書き戻して自分のサイズを変える」
|
|
1287
1304
|
// フィードバックループが構造的に起こらず、初回 paint の時点でも帯は実寸で正しい
|
|
1288
1305
|
// (数値の反映だけが 1 コミット遅れる)。明示モードは従来どおり px を書く。
|
|
1289
|
-
height:
|
|
1290
|
-
paddingTop:
|
|
1291
|
-
paddingBottom:
|
|
1306
|
+
height: de ? void 0 : V,
|
|
1307
|
+
paddingTop: Ue.top,
|
|
1308
|
+
paddingBottom: Ue.bottom,
|
|
1292
1309
|
// スクロール不能時 (contentSize <= viewportSize) は touch-action を通常に戻し、
|
|
1293
1310
|
// 短いリスト上のタッチがページ全体のパンを妨げるデッドゾーン化を防ぐ。
|
|
1294
1311
|
// 直接操作 (指・ペン) のドラッグを許可していない場合も付けない。
|
|
@@ -1302,102 +1319,102 @@ const le = (r, e, t) => Math.max(e, Math.min(t, r)), Gt = "virtualscroll:tap-scr
|
|
|
1302
1319
|
// 同一条件で揃えてあるため状態としても一貫している。
|
|
1303
1320
|
// 非同期コンテンツを先読みして確保する挙動は意図的に入れていない
|
|
1304
1321
|
// (空のペインがページのパンを殺すデッドゾーンになり、そちらの実害の方が大きいため)。
|
|
1305
|
-
...
|
|
1322
|
+
...d && Me && b.some((f) => f === "touch" || f === "pen") ? { touchAction: "none" } : {}
|
|
1306
1323
|
},
|
|
1307
|
-
...
|
|
1308
|
-
id:
|
|
1324
|
+
...W,
|
|
1325
|
+
id: gt,
|
|
1309
1326
|
children: [
|
|
1310
|
-
|
|
1311
|
-
r(
|
|
1327
|
+
L,
|
|
1328
|
+
r(A.current)
|
|
1312
1329
|
]
|
|
1313
1330
|
}
|
|
1314
1331
|
),
|
|
1315
|
-
/* @__PURE__ */
|
|
1316
|
-
|
|
1332
|
+
/* @__PURE__ */ ne(
|
|
1333
|
+
Gr,
|
|
1317
1334
|
{
|
|
1318
1335
|
contentSize: e,
|
|
1319
|
-
viewportSize:
|
|
1320
|
-
scrollPosition:
|
|
1321
|
-
onScroll:
|
|
1336
|
+
viewportSize: V,
|
|
1337
|
+
scrollPosition: A.current,
|
|
1338
|
+
onScroll: Ae,
|
|
1322
1339
|
enableThumbDrag: s,
|
|
1323
1340
|
enableTrackClick: a,
|
|
1324
|
-
enableArrowButtons:
|
|
1341
|
+
enableArrowButtons: m,
|
|
1325
1342
|
scrollBarWidth: i,
|
|
1326
|
-
ariaControls:
|
|
1327
|
-
tapScrollCircleOptions:
|
|
1328
|
-
itemCount:
|
|
1329
|
-
renderThumbOverlay:
|
|
1330
|
-
visibleStartIndex:
|
|
1331
|
-
visibleEndIndex:
|
|
1343
|
+
ariaControls: gt,
|
|
1344
|
+
tapScrollCircleOptions: U,
|
|
1345
|
+
itemCount: le,
|
|
1346
|
+
renderThumbOverlay: ce,
|
|
1347
|
+
visibleStartIndex: F,
|
|
1348
|
+
visibleEndIndex: w
|
|
1332
1349
|
},
|
|
1333
1350
|
"scrollbar"
|
|
1334
1351
|
),
|
|
1335
|
-
|
|
1352
|
+
j?.()
|
|
1336
1353
|
] });
|
|
1337
1354
|
}
|
|
1338
|
-
),
|
|
1339
|
-
const i = Math.max(n / 2, 1), s = 1 + e * 0.65, a = Math.max(0.65, 1 - e * 0.25),
|
|
1340
|
-
return /* @__PURE__ */
|
|
1341
|
-
/* @__PURE__ */
|
|
1355
|
+
), br = (r, e, t) => Math.min(Math.max(r, e), t), vn = ({ dragState: r, normalizedDistance: e, sizeScale: t, size: n }) => {
|
|
1356
|
+
const i = Math.max(n / 2, 1), s = 1 + e * 0.65, a = Math.max(0.65, 1 - e * 0.25), m = r.direction * e * 26 * t, d = 0.8 + e * 0.18, b = 3 * t, x = 6 * t, T = 22 * t, C = Math.abs(m) + x, h = m > 0 ? b : -Math.abs(m) - b, L = Math.max(2.5, 3 * t), U = br(r.offsetX, -i, i), D = br(r.offsetY, -i, i), le = i * 0.35, ce = U / i * le, te = D / i * le, se = ce * 0.45, ue = te * 0.45, R = Math.max(T * 0.38, 6), F = 0.65 + e * 0.2, w = r.active;
|
|
1357
|
+
return /* @__PURE__ */ Tt(rr, { children: [
|
|
1358
|
+
/* @__PURE__ */ ne(
|
|
1342
1359
|
"div",
|
|
1343
1360
|
{
|
|
1344
1361
|
className: "aqvs-tap-scroll-circle-gradient",
|
|
1345
1362
|
style: {
|
|
1346
1363
|
transform: `scale(${a}, ${s})`,
|
|
1347
|
-
transition:
|
|
1364
|
+
transition: w ? "40ms transform ease-out" : "200ms ease transform"
|
|
1348
1365
|
}
|
|
1349
1366
|
}
|
|
1350
1367
|
),
|
|
1351
|
-
/* @__PURE__ */
|
|
1368
|
+
/* @__PURE__ */ ne(
|
|
1352
1369
|
"div",
|
|
1353
1370
|
{
|
|
1354
1371
|
className: "aqvs-sample-visual-pupil",
|
|
1355
1372
|
style: {
|
|
1356
|
-
width:
|
|
1357
|
-
height:
|
|
1358
|
-
transform: `translate(calc(-50% + ${
|
|
1359
|
-
transition:
|
|
1373
|
+
width: T,
|
|
1374
|
+
height: T,
|
|
1375
|
+
transform: `translate(calc(-50% + ${ce}px), calc(-50% + ${te}px)) scale(${a}, ${d * s})`,
|
|
1376
|
+
transition: w ? "70ms transform ease-out" : "200ms ease transform"
|
|
1360
1377
|
}
|
|
1361
1378
|
}
|
|
1362
1379
|
),
|
|
1363
|
-
/* @__PURE__ */
|
|
1380
|
+
/* @__PURE__ */ ne(
|
|
1364
1381
|
"div",
|
|
1365
1382
|
{
|
|
1366
1383
|
className: "aqvs-sample-visual-highlight",
|
|
1367
1384
|
style: {
|
|
1368
|
-
width:
|
|
1369
|
-
height:
|
|
1370
|
-
transform: `translate(calc(-50% + ${
|
|
1371
|
-
opacity:
|
|
1385
|
+
width: R,
|
|
1386
|
+
height: R,
|
|
1387
|
+
transform: `translate(calc(-50% + ${se}px), calc(-50% + ${ue}px)) scale(${a}, ${s})`,
|
|
1388
|
+
opacity: F,
|
|
1372
1389
|
boxShadow: "0 0 8px rgba(255,255,255,0.45)",
|
|
1373
|
-
transition:
|
|
1390
|
+
transition: w ? "120ms opacity 150ms, 120ms transform ease-out ease-out" : "220ms ease transform, 240ms opacity ease"
|
|
1374
1391
|
}
|
|
1375
1392
|
}
|
|
1376
1393
|
),
|
|
1377
|
-
/* @__PURE__ */
|
|
1394
|
+
/* @__PURE__ */ ne(
|
|
1378
1395
|
"div",
|
|
1379
1396
|
{
|
|
1380
1397
|
className: "aqvs-sample-visual-rod",
|
|
1381
1398
|
style: {
|
|
1382
|
-
width:
|
|
1383
|
-
height:
|
|
1399
|
+
width: L,
|
|
1400
|
+
height: C,
|
|
1384
1401
|
transform: `translate(-50%, ${h}px)`,
|
|
1385
1402
|
opacity: e,
|
|
1386
|
-
transition:
|
|
1403
|
+
transition: w ? "40ms height, 60ms opacity ease-out ease-out" : "200ms ease height, 120ms ease opacity"
|
|
1387
1404
|
}
|
|
1388
1405
|
}
|
|
1389
1406
|
)
|
|
1390
1407
|
] });
|
|
1391
|
-
},
|
|
1408
|
+
}, Xt = 100, rn = (r) => {
|
|
1392
1409
|
if (!Number.isFinite(r))
|
|
1393
1410
|
return 0n;
|
|
1394
1411
|
const e = Math.trunc(r);
|
|
1395
1412
|
return e <= 0 ? 0n : BigInt(e);
|
|
1396
|
-
},
|
|
1413
|
+
}, Jt = (r, e) => {
|
|
1397
1414
|
if (!Number.isFinite(r))
|
|
1398
1415
|
throw new Error(`valueFn returned a non-finite value at index ${e}: ${r}`);
|
|
1399
1416
|
return r;
|
|
1400
|
-
},
|
|
1417
|
+
}, Nt = (r) => {
|
|
1401
1418
|
if (r <= 0 || !Number.isFinite(r))
|
|
1402
1419
|
return 0;
|
|
1403
1420
|
const e = Math.trunc(r);
|
|
@@ -1472,25 +1489,25 @@ class St {
|
|
|
1472
1489
|
}
|
|
1473
1490
|
let s = 0, a;
|
|
1474
1491
|
if (i > 0) {
|
|
1475
|
-
const
|
|
1492
|
+
const m = n?.sampleRange ?? {
|
|
1476
1493
|
from: 0,
|
|
1477
|
-
to: Math.min(
|
|
1494
|
+
to: Math.min(Xt - 1, i - 1)
|
|
1478
1495
|
};
|
|
1479
|
-
let
|
|
1480
|
-
if (
|
|
1481
|
-
s = St._sampleBaseValueStrided(t, i,
|
|
1496
|
+
let d = Math.max(0, Math.trunc(m.from)), b = Math.min(Math.trunc(m.to), i - 1);
|
|
1497
|
+
if (d > b && (d = 0, b = Math.min(Xt - 1, i - 1)), i > Xt)
|
|
1498
|
+
s = St._sampleBaseValueStrided(t, i, Xt), n?.materialize && (a = { from: d, values: St._collectValidatedValues(t, d, b) });
|
|
1482
1499
|
else {
|
|
1483
|
-
const
|
|
1484
|
-
s = St._modeOrMedian([...
|
|
1500
|
+
const x = St._collectValidatedValues(t, d, b);
|
|
1501
|
+
s = St._modeOrMedian([...x]), n?.materialize && (a = { from: d, values: x });
|
|
1485
1502
|
}
|
|
1486
1503
|
}
|
|
1487
1504
|
if (this.size = i, this.tree = /* @__PURE__ */ new Map(), this.deltas = /* @__PURE__ */ new Map(), this.total = void 0, this.valueFn = t, this.baseValue = s, a)
|
|
1488
|
-
for (let
|
|
1489
|
-
const
|
|
1490
|
-
if (
|
|
1505
|
+
for (let m = 0; m < a.values.length; m++) {
|
|
1506
|
+
const d = a.from + m;
|
|
1507
|
+
if (d >= this.size)
|
|
1491
1508
|
break;
|
|
1492
|
-
const b = a.values[
|
|
1493
|
-
b !== 0 && (this.deltas.set(
|
|
1509
|
+
const b = a.values[m] - this.baseValue;
|
|
1510
|
+
b !== 0 && (this.deltas.set(d, b), this._updateTree(d, b));
|
|
1494
1511
|
}
|
|
1495
1512
|
this.total = this.getTotal();
|
|
1496
1513
|
}
|
|
@@ -1521,7 +1538,7 @@ class St {
|
|
|
1521
1538
|
static _collectValidatedValues(e, t, n) {
|
|
1522
1539
|
const i = [];
|
|
1523
1540
|
for (let s = t; s <= n; s++)
|
|
1524
|
-
i.push(
|
|
1541
|
+
i.push(Jt(e(s), s));
|
|
1525
1542
|
return i;
|
|
1526
1543
|
}
|
|
1527
1544
|
/**
|
|
@@ -1535,22 +1552,22 @@ class St {
|
|
|
1535
1552
|
static _modeOrMedian(e) {
|
|
1536
1553
|
if (e.length === 0)
|
|
1537
1554
|
return 0;
|
|
1538
|
-
e.sort((a,
|
|
1555
|
+
e.sort((a, m) => a - m);
|
|
1539
1556
|
const t = Math.floor(e.length / 2);
|
|
1540
1557
|
let n;
|
|
1541
1558
|
e.length % 2 === 0 ? n = Math.floor((e[t - 1] + e[t]) / 2) : n = e[t];
|
|
1542
1559
|
const i = /* @__PURE__ */ new Map();
|
|
1543
1560
|
let s = 0;
|
|
1544
1561
|
for (const a of e) {
|
|
1545
|
-
const
|
|
1546
|
-
i.set(a,
|
|
1562
|
+
const m = (i.get(a) ?? 0) + 1;
|
|
1563
|
+
i.set(a, m), m > s && (s = m);
|
|
1547
1564
|
}
|
|
1548
1565
|
if (s > e.length * 0.2) {
|
|
1549
1566
|
const a = [];
|
|
1550
|
-
for (const [
|
|
1551
|
-
b === s && a.push(
|
|
1552
|
-
const
|
|
1553
|
-
n = Math.floor(
|
|
1567
|
+
for (const [d, b] of i.entries())
|
|
1568
|
+
b === s && a.push(d);
|
|
1569
|
+
const m = a.reduce((d, b) => d + b, 0);
|
|
1570
|
+
n = Math.floor(m / a.length);
|
|
1554
1571
|
}
|
|
1555
1572
|
return n;
|
|
1556
1573
|
}
|
|
@@ -1571,7 +1588,7 @@ class St {
|
|
|
1571
1588
|
i % 2 === 0 && (i += 1);
|
|
1572
1589
|
const s = [];
|
|
1573
1590
|
for (let a = 0; a < t && s.length < n; a += i)
|
|
1574
|
-
s.push(
|
|
1591
|
+
s.push(Jt(e(a), a));
|
|
1575
1592
|
return St._modeOrMedian(s);
|
|
1576
1593
|
}
|
|
1577
1594
|
/**
|
|
@@ -1644,7 +1661,7 @@ class St {
|
|
|
1644
1661
|
let n = e + 1;
|
|
1645
1662
|
for (; n <= this.size; ) {
|
|
1646
1663
|
this.tree.set(n, (this.tree.get(n) ?? 0) + t);
|
|
1647
|
-
const i =
|
|
1664
|
+
const i = Nt(n);
|
|
1648
1665
|
if (i === 0)
|
|
1649
1666
|
break;
|
|
1650
1667
|
n += i;
|
|
@@ -1670,8 +1687,8 @@ class St {
|
|
|
1670
1687
|
throw new Error(`Value must be a finite number: ${s}`);
|
|
1671
1688
|
if (s < 0)
|
|
1672
1689
|
throw new Error("Value cannot be negative.");
|
|
1673
|
-
const a = n.has(i) ? n.get(i) ?? 0 : this.deltas.get(i) ?? 0,
|
|
1674
|
-
|
|
1690
|
+
const a = n.has(i) ? n.get(i) ?? 0 : this.deltas.get(i) ?? 0, m = a + this.baseValue, d = s - m;
|
|
1691
|
+
d !== 0 && t.push({ index: i, change: d }), n.set(i, a + d);
|
|
1675
1692
|
}
|
|
1676
1693
|
return t;
|
|
1677
1694
|
}
|
|
@@ -1688,7 +1705,7 @@ class St {
|
|
|
1688
1705
|
let e = 0, t = this.size;
|
|
1689
1706
|
for (; t > 0; ) {
|
|
1690
1707
|
e += this.tree.get(t) ?? 0;
|
|
1691
|
-
const n =
|
|
1708
|
+
const n = Nt(t);
|
|
1692
1709
|
if (n === 0)
|
|
1693
1710
|
break;
|
|
1694
1711
|
t -= n;
|
|
@@ -1705,7 +1722,7 @@ class St {
|
|
|
1705
1722
|
*/
|
|
1706
1723
|
_materialize(e, t = !0) {
|
|
1707
1724
|
if (this.valueFn) {
|
|
1708
|
-
const n = this.deltas.get(e) ?? 0, s =
|
|
1725
|
+
const n = this.deltas.get(e) ?? 0, s = Jt(this.valueFn(e), e) - this.baseValue;
|
|
1709
1726
|
if (s !== n && (s === 0 ? this.deltas.delete(e) : this.deltas.set(e, s), t)) {
|
|
1710
1727
|
const a = s - n;
|
|
1711
1728
|
this._updateTree(e, a);
|
|
@@ -1726,10 +1743,10 @@ class St {
|
|
|
1726
1743
|
return;
|
|
1727
1744
|
const i = e.ranges;
|
|
1728
1745
|
if (i && i.length > 0) {
|
|
1729
|
-
for (const
|
|
1730
|
-
const
|
|
1731
|
-
for (let
|
|
1732
|
-
this._materialize(
|
|
1746
|
+
for (const m of i) {
|
|
1747
|
+
const d = Math.max(0, Math.trunc(m.from)), b = Math.min(Math.trunc(m.to), this.size - 1);
|
|
1748
|
+
for (let x = d; x <= b; x++)
|
|
1749
|
+
this._materialize(x);
|
|
1733
1750
|
}
|
|
1734
1751
|
if (t === void 0)
|
|
1735
1752
|
return;
|
|
@@ -1766,8 +1783,8 @@ class St {
|
|
|
1766
1783
|
return { index: -1, total: this.total ?? this.getTotal(), cumulative: void 0, currentValue: void 0, safeIndex: void 0 };
|
|
1767
1784
|
if (!i)
|
|
1768
1785
|
break;
|
|
1769
|
-
const
|
|
1770
|
-
if (this._materialize(s), (this.deltas.get(s) ?? 0) ===
|
|
1786
|
+
const m = this.deltas.get(s) ?? 0;
|
|
1787
|
+
if (this._materialize(s), (this.deltas.get(s) ?? 0) === m)
|
|
1771
1788
|
break;
|
|
1772
1789
|
}
|
|
1773
1790
|
const a = this.prefixSum(s);
|
|
@@ -1795,8 +1812,8 @@ class St {
|
|
|
1795
1812
|
for (; s > 0; s >>= 1) {
|
|
1796
1813
|
const a = n + s;
|
|
1797
1814
|
if (a <= this.size) {
|
|
1798
|
-
const
|
|
1799
|
-
(t ? i +
|
|
1815
|
+
const d = (this.tree.get(a) ?? 0) + this.baseValue * s;
|
|
1816
|
+
(t ? i + d < e : i + d <= e) && (n = a, i += d);
|
|
1800
1817
|
}
|
|
1801
1818
|
}
|
|
1802
1819
|
return t ? n : n - 1;
|
|
@@ -1809,20 +1826,20 @@ class St {
|
|
|
1809
1826
|
_findIndexLarge(e, t, n) {
|
|
1810
1827
|
if (this.size === 0)
|
|
1811
1828
|
return { index: -1, total: this.total ?? 0, cumulative: void 0, currentValue: void 0, safeIndex: void 0 };
|
|
1812
|
-
const i =
|
|
1829
|
+
const i = rn(this.size);
|
|
1813
1830
|
if (i === 0n)
|
|
1814
1831
|
return { index: -1, total: this.total ?? 0, cumulative: void 0, currentValue: void 0, safeIndex: void 0 };
|
|
1815
1832
|
this._materializeRanges(t.materializeOption);
|
|
1816
1833
|
const s = t.materializeOption?.materialize === !0;
|
|
1817
1834
|
for (; ; ) {
|
|
1818
|
-
let a = 0n,
|
|
1819
|
-
for (; a <=
|
|
1820
|
-
const h = a +
|
|
1821
|
-
if (
|
|
1822
|
-
if (
|
|
1835
|
+
let a = 0n, m = i - 1n, d, b, x = this.total;
|
|
1836
|
+
for (; a <= m; ) {
|
|
1837
|
+
const h = a + m >> 1n, L = Number(h), U = this.prefixSum(L);
|
|
1838
|
+
if (x = U.total, n ? U.cumulative >= e : U.cumulative <= e)
|
|
1839
|
+
if (d = h, b = U, n) {
|
|
1823
1840
|
if (h === 0n)
|
|
1824
1841
|
break;
|
|
1825
|
-
|
|
1842
|
+
m = h - 1n;
|
|
1826
1843
|
} else
|
|
1827
1844
|
a = h + 1n;
|
|
1828
1845
|
else if (n)
|
|
@@ -1830,21 +1847,21 @@ class St {
|
|
|
1830
1847
|
else {
|
|
1831
1848
|
if (h === 0n)
|
|
1832
1849
|
break;
|
|
1833
|
-
|
|
1850
|
+
m = h - 1n;
|
|
1834
1851
|
}
|
|
1835
1852
|
}
|
|
1836
|
-
const
|
|
1837
|
-
if (s &&
|
|
1838
|
-
const h = this.deltas.get(
|
|
1839
|
-
if (this._materialize(
|
|
1853
|
+
const T = b, C = d !== void 0 ? Number(d) : -1;
|
|
1854
|
+
if (s && C >= 0) {
|
|
1855
|
+
const h = this.deltas.get(C) ?? 0;
|
|
1856
|
+
if (this._materialize(C), (this.deltas.get(C) ?? 0) !== h)
|
|
1840
1857
|
continue;
|
|
1841
1858
|
}
|
|
1842
1859
|
return {
|
|
1843
|
-
index:
|
|
1844
|
-
total:
|
|
1845
|
-
cumulative:
|
|
1846
|
-
currentValue:
|
|
1847
|
-
safeIndex:
|
|
1860
|
+
index: C,
|
|
1861
|
+
total: x,
|
|
1862
|
+
cumulative: T?.cumulative,
|
|
1863
|
+
currentValue: T?.currentValue,
|
|
1864
|
+
safeIndex: T?.safeIndex
|
|
1848
1865
|
};
|
|
1849
1866
|
}
|
|
1850
1867
|
}
|
|
@@ -1861,19 +1878,19 @@ class St {
|
|
|
1861
1878
|
return { cumulative: 0, total: this.total, currentValue: 0, safeIndex: 0 };
|
|
1862
1879
|
if (this.size === 0)
|
|
1863
1880
|
return { cumulative: 0, total: this.total ?? 0, currentValue: 0, safeIndex: 0 };
|
|
1864
|
-
const n =
|
|
1881
|
+
const n = ie(Math.trunc(e), 0, this.size - 1), i = t?.materializeOption;
|
|
1865
1882
|
this._materializeRanges(i, n, !0);
|
|
1866
1883
|
let s = 0, a = n + 1;
|
|
1867
1884
|
for (; a > 0; ) {
|
|
1868
|
-
const
|
|
1869
|
-
s +=
|
|
1870
|
-
const b =
|
|
1885
|
+
const d = this.tree.get(a) ?? 0;
|
|
1886
|
+
s += d;
|
|
1887
|
+
const b = Nt(a);
|
|
1871
1888
|
if (b === 0)
|
|
1872
1889
|
break;
|
|
1873
1890
|
a -= b;
|
|
1874
1891
|
}
|
|
1875
|
-
const
|
|
1876
|
-
return { cumulative: s + this.baseValue * (n + 1), total: this.total, currentValue:
|
|
1892
|
+
const m = i?.materialize ? this.get(n) : (this.deltas.get(n) || 0) + this.baseValue;
|
|
1893
|
+
return { cumulative: s + this.baseValue * (n + 1), total: this.total, currentValue: m, safeIndex: n };
|
|
1877
1894
|
}
|
|
1878
1895
|
/**
|
|
1879
1896
|
* @method get
|
|
@@ -1906,7 +1923,7 @@ class St {
|
|
|
1906
1923
|
else {
|
|
1907
1924
|
this.total = this._computeTreeTotal();
|
|
1908
1925
|
const n = this.prefixSum(this.getSize() - 1);
|
|
1909
|
-
n.cumulative !== n.total &&
|
|
1926
|
+
n.cumulative !== n.total && y.error("Inconsistent Fenwick Tree state");
|
|
1910
1927
|
}
|
|
1911
1928
|
return this.total;
|
|
1912
1929
|
}
|
|
@@ -1930,7 +1947,7 @@ class St {
|
|
|
1930
1947
|
let s = n + 1;
|
|
1931
1948
|
for (; s <= this.size; ) {
|
|
1932
1949
|
t.set(s, (t.get(s) ?? 0) + i);
|
|
1933
|
-
const a =
|
|
1950
|
+
const a = Nt(s);
|
|
1934
1951
|
if (a === 0)
|
|
1935
1952
|
break;
|
|
1936
1953
|
s += a;
|
|
@@ -2013,7 +2030,7 @@ class St {
|
|
|
2013
2030
|
this.size = t, this.rebuildTree();
|
|
2014
2031
|
}
|
|
2015
2032
|
const i = this.prefixSum(this.getSize() - 1);
|
|
2016
|
-
i.cumulative !== i.total &&
|
|
2033
|
+
i.cumulative !== i.total && y.error("Inconsistent Fenwick Tree state");
|
|
2017
2034
|
}
|
|
2018
2035
|
/**
|
|
2019
2036
|
* @private
|
|
@@ -2047,14 +2064,14 @@ class St {
|
|
|
2047
2064
|
_propagateDeltaToGrownNodes(e, t, n, i) {
|
|
2048
2065
|
let s = e + 1;
|
|
2049
2066
|
for (; s <= n; ) {
|
|
2050
|
-
const a =
|
|
2067
|
+
const a = Nt(s);
|
|
2051
2068
|
if (a === 0)
|
|
2052
2069
|
break;
|
|
2053
2070
|
s += a;
|
|
2054
2071
|
}
|
|
2055
2072
|
for (; s <= i; ) {
|
|
2056
2073
|
this.tree.set(s, (this.tree.get(s) ?? 0) + t);
|
|
2057
|
-
const a =
|
|
2074
|
+
const a = Nt(s);
|
|
2058
2075
|
if (a === 0)
|
|
2059
2076
|
break;
|
|
2060
2077
|
s += a;
|
|
@@ -2148,20 +2165,20 @@ class St {
|
|
|
2148
2165
|
return this._findIndex(e, t ?? {}, !1);
|
|
2149
2166
|
}
|
|
2150
2167
|
}
|
|
2151
|
-
const
|
|
2168
|
+
const nn = (r, e) => {
|
|
2152
2169
|
const t = r?.sampleRange, n = e?.sampleRange;
|
|
2153
2170
|
return t === n ? !1 : t && n ? t.from !== n.from || t.to !== n.to : !0;
|
|
2154
|
-
},
|
|
2171
|
+
}, sn = (r, e, t) => {
|
|
2155
2172
|
const n = Number.isFinite(r) && r > 0 ? Math.trunc(r) : 0, i = g(null), s = g({ size: n, valueOrFn: e, options: t });
|
|
2156
2173
|
i.current === null && (i.current = new St(n, e, t));
|
|
2157
|
-
const a = i.current,
|
|
2158
|
-
if (b ||
|
|
2159
|
-
const
|
|
2160
|
-
|
|
2161
|
-
} else
|
|
2174
|
+
const a = i.current, m = s.current, d = m.size !== n, b = m.valueOrFn !== e, x = nn(m.options, t), T = m.size === 0 && n > 0 && (!i.current || i.current.base === 0);
|
|
2175
|
+
if (b || x) {
|
|
2176
|
+
const C = t?.resetOnValueFnChange ?? !0;
|
|
2177
|
+
x || b && C || T ? (t?.debug && y.debug("[useFenwickMapTree] reset", { valueOrFnChanged: b, optionsChanged: x }), a.reset(n, e, t)) : (d && (t?.debug && y.debug("[useFenwickMapTree] resize (with valueFn change)", { from: m.size, to: n }), a.changeSize(n)), t?.debug && y.debug("[useFenwickMapTree] setValueFn (no reset)", { valueOrFnChanged: b }), a.setValueFn(e, { reset: !1 })), s.current = { size: n, valueOrFn: e, options: t };
|
|
2178
|
+
} else d && (t?.debug && y.debug("[useFenwickMapTree] resize", { from: m.size, to: n }), T ? a.reset(n, e, t) : a.changeSize(n), s.current = { size: n, valueOrFn: e, options: t });
|
|
2162
2179
|
return a;
|
|
2163
2180
|
};
|
|
2164
|
-
class
|
|
2181
|
+
class on {
|
|
2165
2182
|
key;
|
|
2166
2183
|
value;
|
|
2167
2184
|
prev = null;
|
|
@@ -2170,7 +2187,7 @@ class Kr {
|
|
|
2170
2187
|
this.key = e, this.value = t;
|
|
2171
2188
|
}
|
|
2172
2189
|
}
|
|
2173
|
-
class
|
|
2190
|
+
class er {
|
|
2174
2191
|
head = null;
|
|
2175
2192
|
tail = null;
|
|
2176
2193
|
/**
|
|
@@ -2211,225 +2228,225 @@ class jt {
|
|
|
2211
2228
|
this.remove(e), this.addToTail(e);
|
|
2212
2229
|
}
|
|
2213
2230
|
}
|
|
2214
|
-
function
|
|
2215
|
-
const e = g(/* @__PURE__ */ new Map()), t = g(new
|
|
2216
|
-
|
|
2231
|
+
function an(r) {
|
|
2232
|
+
const e = g(/* @__PURE__ */ new Map()), t = g(new er()), n = Math.floor(r), i = g(n);
|
|
2233
|
+
X(() => {
|
|
2217
2234
|
if (i.current = n, Number.isNaN(n) || n < 0) {
|
|
2218
|
-
|
|
2235
|
+
y.warn(`useLruCache: invalid capacity ${r}; the cache will not store any entries.`), e.current.clear(), t.current = new er();
|
|
2219
2236
|
return;
|
|
2220
2237
|
}
|
|
2221
2238
|
if (Number.isFinite(n))
|
|
2222
2239
|
for (; e.current.size > n; ) {
|
|
2223
|
-
const
|
|
2224
|
-
if (
|
|
2225
|
-
e.current.delete(
|
|
2240
|
+
const x = t.current.removeHead();
|
|
2241
|
+
if (x)
|
|
2242
|
+
e.current.delete(x.key);
|
|
2226
2243
|
else
|
|
2227
2244
|
break;
|
|
2228
2245
|
}
|
|
2229
2246
|
}, [r, n]);
|
|
2230
|
-
const s = S((
|
|
2231
|
-
const
|
|
2232
|
-
if (
|
|
2233
|
-
return t.current.moveToTail(
|
|
2234
|
-
}, []), a = S((
|
|
2235
|
-
const
|
|
2236
|
-
if (Number.isNaN(
|
|
2247
|
+
const s = S((x) => {
|
|
2248
|
+
const T = e.current.get(x);
|
|
2249
|
+
if (T)
|
|
2250
|
+
return t.current.moveToTail(T), T.value;
|
|
2251
|
+
}, []), a = S((x, T) => {
|
|
2252
|
+
const C = i.current;
|
|
2253
|
+
if (Number.isNaN(C) || C <= 0)
|
|
2237
2254
|
return;
|
|
2238
|
-
let h = e.current.get(
|
|
2255
|
+
let h = e.current.get(x);
|
|
2239
2256
|
if (h)
|
|
2240
|
-
h.value =
|
|
2257
|
+
h.value = T, t.current.moveToTail(h);
|
|
2241
2258
|
else {
|
|
2242
|
-
if (e.current.size >=
|
|
2243
|
-
const
|
|
2244
|
-
|
|
2259
|
+
if (e.current.size >= C) {
|
|
2260
|
+
const L = t.current.removeHead();
|
|
2261
|
+
L && e.current.delete(L.key);
|
|
2245
2262
|
}
|
|
2246
|
-
h = new
|
|
2263
|
+
h = new on(x, T), e.current.set(x, h), t.current.addToTail(h);
|
|
2247
2264
|
}
|
|
2248
|
-
}, []),
|
|
2249
|
-
const
|
|
2250
|
-
|
|
2265
|
+
}, []), m = S((x) => e.current.has(x), []), d = S((x) => {
|
|
2266
|
+
const T = e.current.get(x);
|
|
2267
|
+
T && (t.current.remove(T), e.current.delete(x));
|
|
2251
2268
|
}, []), b = S(() => {
|
|
2252
|
-
e.current.clear(), t.current = new
|
|
2269
|
+
e.current.clear(), t.current = new er();
|
|
2253
2270
|
}, []);
|
|
2254
|
-
return
|
|
2271
|
+
return _e(() => ({ get: s, set: a, has: m, remove: d, clear: b }), [s, a, m, d, b]);
|
|
2255
2272
|
}
|
|
2256
|
-
const
|
|
2257
|
-
const { get: r, set: e, has: t, clear: n } =
|
|
2258
|
-
return
|
|
2259
|
-
},
|
|
2273
|
+
const ln = 1e4, In = () => {
|
|
2274
|
+
const { get: r, set: e, has: t, clear: n } = an(ln);
|
|
2275
|
+
return _e(() => ({ get: r, set: e, has: t, clear: n }), [r, e, t, n]);
|
|
2276
|
+
}, Sn = (r, e) => {
|
|
2260
2277
|
const t = g(e), n = g(r);
|
|
2261
|
-
|
|
2278
|
+
Ze(() => {
|
|
2262
2279
|
t.current = e, n.current = r;
|
|
2263
2280
|
}, [e, r]);
|
|
2264
2281
|
const i = g(/* @__PURE__ */ new WeakMap());
|
|
2265
2282
|
return S((s) => {
|
|
2266
2283
|
if (!s || i.current.has(s))
|
|
2267
2284
|
return;
|
|
2268
|
-
const a = (
|
|
2269
|
-
t.current?.enableBridge !== !1 && n.current.current?.applyWheel(
|
|
2285
|
+
const a = (m) => {
|
|
2286
|
+
t.current?.enableBridge !== !1 && n.current.current?.applyWheel(m);
|
|
2270
2287
|
};
|
|
2271
2288
|
return s.addEventListener("wheel", a, { passive: !1 }), i.current.set(s, a), () => {
|
|
2272
2289
|
i.current.get(s) === a && (s.removeEventListener("wheel", a), i.current.delete(s));
|
|
2273
2290
|
};
|
|
2274
2291
|
}, []);
|
|
2275
|
-
},
|
|
2292
|
+
}, ve = (r, e) => e <= 0 ? 0 : ie(r, 0, e - 1), xr = (r) => ({
|
|
2276
2293
|
top: Math.max(0, r?.top ?? 0),
|
|
2277
2294
|
bottom: Math.max(0, r?.bottom ?? 0)
|
|
2278
|
-
}),
|
|
2295
|
+
}), Ge = (r, e) => r <= e ? 0 : r - e, Mt = (r, e) => r <= 0 ? 0 : r + e, $t = 1e3, vr = 2e3, cn = 1048576, un = 40, kt = (r) => {
|
|
2279
2296
|
if (!Number.isFinite(r)) return 0n;
|
|
2280
2297
|
const e = Math.trunc(r);
|
|
2281
2298
|
return e <= 0 ? 0n : BigInt(e);
|
|
2282
|
-
},
|
|
2283
|
-
const
|
|
2284
|
-
if (
|
|
2299
|
+
}, dn = (r, e, t, n, i, s, a, m) => {
|
|
2300
|
+
const d = kt(n);
|
|
2301
|
+
if (d === 0n)
|
|
2285
2302
|
return { renderingStartIndex: 0, renderingEndIndex: 0, visibleStartIndex: 0, visibleEndIndex: 0 };
|
|
2286
|
-
const b = (
|
|
2303
|
+
const b = (R) => R < 0n ? 0n : R >= d ? d - 1n : R, x = { materializeOption: { materialize: !1 } }, { index: T, cumulative: C } = s.findIndexAtOrAfter(r, x);
|
|
2287
2304
|
let h;
|
|
2288
|
-
|
|
2289
|
-
const
|
|
2290
|
-
const
|
|
2291
|
-
if (!Number.isSafeInteger(
|
|
2305
|
+
T === -1 ? h = d - 1n : (C === r ? h = kt(T + 1) : h = kt(T), h >= d && (h = d - 1n)), r <= 0 && (h = 0n), m && r >= a && (h = d - 1n);
|
|
2306
|
+
const L = (R) => {
|
|
2307
|
+
const F = Number(R);
|
|
2308
|
+
if (!Number.isSafeInteger(F))
|
|
2292
2309
|
return null;
|
|
2293
|
-
const { cumulative:
|
|
2294
|
-
if (!Number.isFinite(
|
|
2310
|
+
const { cumulative: w } = s.prefixSum(F, { materializeOption: { materialize: !1 } });
|
|
2311
|
+
if (!Number.isFinite(w))
|
|
2295
2312
|
return null;
|
|
2296
|
-
const { index:
|
|
2297
|
-
if (
|
|
2313
|
+
const { index: j } = s.findIndexAtOrAfter(w + 0.5, { materializeOption: { materialize: !1 } });
|
|
2314
|
+
if (j === -1)
|
|
2298
2315
|
return null;
|
|
2299
|
-
const
|
|
2300
|
-
return
|
|
2301
|
-
},
|
|
2302
|
-
let
|
|
2303
|
-
for (;
|
|
2304
|
-
const
|
|
2305
|
-
if (
|
|
2316
|
+
const Z = kt(j);
|
|
2317
|
+
return Z > R ? Z : null;
|
|
2318
|
+
}, U = (R) => {
|
|
2319
|
+
let F = 0, w = R, j = R, Z = 0n, W = 0;
|
|
2320
|
+
for (; w < d && F < e; ) {
|
|
2321
|
+
const pe = Number(w), A = i(pe);
|
|
2322
|
+
if (F += A, j = w, w += 1n, Z += 1n, !Number.isFinite(A) || A < 0)
|
|
2306
2323
|
break;
|
|
2307
|
-
if (
|
|
2308
|
-
if (
|
|
2309
|
-
const v =
|
|
2310
|
-
if (v !== null && v >
|
|
2311
|
-
|
|
2312
|
-
else if (v !== null && v ===
|
|
2313
|
-
|
|
2324
|
+
if (A === 0) {
|
|
2325
|
+
if (W += 1, W > $t) {
|
|
2326
|
+
const v = L(j);
|
|
2327
|
+
if (v !== null && v > w)
|
|
2328
|
+
w = v, W = 0;
|
|
2329
|
+
else if (v !== null && v === w && i(Number(w)) > 0)
|
|
2330
|
+
W = 0;
|
|
2314
2331
|
else
|
|
2315
2332
|
break;
|
|
2316
2333
|
}
|
|
2317
2334
|
} else
|
|
2318
|
-
|
|
2335
|
+
W = 0;
|
|
2319
2336
|
}
|
|
2320
|
-
return
|
|
2337
|
+
return Z === 0n && (j = R), { height: F, end: j };
|
|
2321
2338
|
};
|
|
2322
|
-
let { height:
|
|
2323
|
-
if (
|
|
2324
|
-
let
|
|
2325
|
-
for (;
|
|
2326
|
-
|
|
2327
|
-
const
|
|
2328
|
-
if (
|
|
2339
|
+
let { height: D, end: le } = U(h);
|
|
2340
|
+
if (D < e && h > 0n) {
|
|
2341
|
+
let R = h, F = D, w = 0;
|
|
2342
|
+
for (; R > 0n && F < e; ) {
|
|
2343
|
+
R -= 1n;
|
|
2344
|
+
const Z = Number(R), W = i(Z);
|
|
2345
|
+
if (F += W, !Number.isFinite(W) || W < 0)
|
|
2329
2346
|
break;
|
|
2330
|
-
if (
|
|
2331
|
-
if (
|
|
2332
|
-
const
|
|
2333
|
-
if (!Number.isSafeInteger(
|
|
2347
|
+
if (W === 0) {
|
|
2348
|
+
if (w += 1, w > $t) {
|
|
2349
|
+
const pe = Number(R);
|
|
2350
|
+
if (!Number.isSafeInteger(pe))
|
|
2334
2351
|
break;
|
|
2335
|
-
const { cumulative:
|
|
2336
|
-
if (!Number.isFinite(
|
|
2352
|
+
const { cumulative: A } = s.prefixSum(pe, { materializeOption: { materialize: !1 } });
|
|
2353
|
+
if (!Number.isFinite(A))
|
|
2337
2354
|
break;
|
|
2338
|
-
const { index: v } = s.findIndexAtOrAfter(
|
|
2339
|
-
if (
|
|
2340
|
-
|
|
2341
|
-
else if (
|
|
2342
|
-
|
|
2355
|
+
const { index: v } = s.findIndexAtOrAfter(A - 0.5, { materializeOption: { materialize: !1 } }), K = v === -1 ? -1n : kt(v);
|
|
2356
|
+
if (K >= 0n && K < R)
|
|
2357
|
+
R = K + 1n, w = 0;
|
|
2358
|
+
else if (K === R && R >= 1n && i(Number(R - 1n)) > 0)
|
|
2359
|
+
w = 0;
|
|
2343
2360
|
else
|
|
2344
2361
|
break;
|
|
2345
2362
|
}
|
|
2346
2363
|
} else
|
|
2347
|
-
|
|
2364
|
+
w = 0;
|
|
2348
2365
|
}
|
|
2349
|
-
h = b(
|
|
2350
|
-
const
|
|
2351
|
-
|
|
2366
|
+
h = b(R);
|
|
2367
|
+
const j = U(h);
|
|
2368
|
+
D = j.height, le = j.end;
|
|
2352
2369
|
}
|
|
2353
|
-
const
|
|
2370
|
+
const ce = b(h), te = b(le), se = b(ce - BigInt(Math.max(0, t))), ue = b(te + BigInt(Math.max(0, t)));
|
|
2354
2371
|
return {
|
|
2355
|
-
renderingStartIndex:
|
|
2356
|
-
renderingEndIndex:
|
|
2357
|
-
visibleStartIndex:
|
|
2358
|
-
visibleEndIndex:
|
|
2372
|
+
renderingStartIndex: ve(Number(se), n),
|
|
2373
|
+
renderingEndIndex: ve(Number(ue), n),
|
|
2374
|
+
visibleStartIndex: ve(Number(ce), n),
|
|
2375
|
+
visibleEndIndex: ve(Number(te), n)
|
|
2359
2376
|
};
|
|
2360
|
-
},
|
|
2377
|
+
}, fn = (r, e, t, n, i, s, a) => {
|
|
2361
2378
|
if (n === 0)
|
|
2362
2379
|
return { renderingStartIndex: 0, renderingEndIndex: 0, visibleStartIndex: 0, visibleEndIndex: 0 };
|
|
2363
|
-
const
|
|
2380
|
+
const m = Number.isFinite(a), d = m ? Math.min(Math.max(0, r), a) : Math.max(0, r);
|
|
2364
2381
|
if (n >= Number.MAX_SAFE_INTEGER)
|
|
2365
|
-
return
|
|
2366
|
-
const { index: b, cumulative:
|
|
2367
|
-
let h =
|
|
2368
|
-
if (b !== -1 &&
|
|
2369
|
-
h =
|
|
2370
|
-
else if (h === b &&
|
|
2371
|
-
|
|
2382
|
+
return dn(d, e, t, n, i, s, a, m);
|
|
2383
|
+
const { index: b, cumulative: x, currentValue: T } = s.findIndexAtOrAfter(d, { materializeOption: { materialize: !1 } }), C = b === -1 ? e <= 0 || (x ?? 0) < d + (T ?? 0) ? n - 1 : 0 : b;
|
|
2384
|
+
let h = ve(C, n), L = 0;
|
|
2385
|
+
if (b !== -1 && x === d)
|
|
2386
|
+
h = ve(b + 1, n), L = 0;
|
|
2387
|
+
else if (h === b && x !== void 0 && T !== void 0)
|
|
2388
|
+
L = x - T - d;
|
|
2372
2389
|
else {
|
|
2373
|
-
const { cumulative:
|
|
2374
|
-
|
|
2390
|
+
const { cumulative: R, currentValue: F } = s.prefixSum(h, { materializeOption: { materialize: !1 } });
|
|
2391
|
+
L = (R ?? 0) - (F ?? 0) - d;
|
|
2375
2392
|
}
|
|
2376
|
-
const
|
|
2377
|
-
let
|
|
2378
|
-
for (;
|
|
2379
|
-
const
|
|
2380
|
-
if (
|
|
2393
|
+
const U = L, D = (R, F) => {
|
|
2394
|
+
let w = R, j = F, Z = 0;
|
|
2395
|
+
for (; w < n && j < e; ) {
|
|
2396
|
+
const W = i(w);
|
|
2397
|
+
if (j += W, w++, !Number.isFinite(W) || W < 0)
|
|
2381
2398
|
break;
|
|
2382
|
-
if (
|
|
2383
|
-
if (
|
|
2384
|
-
const { cumulative:
|
|
2385
|
-
if (
|
|
2386
|
-
|
|
2387
|
-
else if (
|
|
2388
|
-
|
|
2399
|
+
if (W === 0) {
|
|
2400
|
+
if (Z++, Z > $t) {
|
|
2401
|
+
const { cumulative: pe } = s.prefixSum(w - 1, { materializeOption: { materialize: !1 } }), { index: A } = Number.isFinite(pe) ? s.findIndexAtOrAfter(pe + 0.5, { materializeOption: { materialize: !1 } }) : { index: -1 };
|
|
2402
|
+
if (A > w)
|
|
2403
|
+
w = A, Z = 0;
|
|
2404
|
+
else if (A === w && i(w) > 0)
|
|
2405
|
+
Z = 0;
|
|
2389
2406
|
else
|
|
2390
2407
|
break;
|
|
2391
2408
|
}
|
|
2392
2409
|
} else
|
|
2393
|
-
|
|
2410
|
+
Z = 0;
|
|
2394
2411
|
}
|
|
2395
|
-
return { cursor:
|
|
2396
|
-
},
|
|
2397
|
-
let
|
|
2398
|
-
if (
|
|
2399
|
-
let
|
|
2400
|
-
for (;
|
|
2401
|
-
const
|
|
2402
|
-
if (
|
|
2403
|
-
|
|
2412
|
+
return { cursor: w, height: j };
|
|
2413
|
+
}, le = D(h, L);
|
|
2414
|
+
let ce = le.cursor;
|
|
2415
|
+
if (L = le.height, L < e && h > 0) {
|
|
2416
|
+
let R = L + Math.abs(Math.min(0, U)), F = h - 1, w = 0;
|
|
2417
|
+
for (; F >= 0 && R < e; ) {
|
|
2418
|
+
const Z = i(F);
|
|
2419
|
+
if (R += Z, !Number.isFinite(Z) || Z < 0) {
|
|
2420
|
+
F--;
|
|
2404
2421
|
break;
|
|
2405
2422
|
}
|
|
2406
|
-
if (
|
|
2407
|
-
if (
|
|
2408
|
-
const { cumulative:
|
|
2409
|
-
if (
|
|
2410
|
-
|
|
2423
|
+
if (Z === 0) {
|
|
2424
|
+
if (w++, w > $t) {
|
|
2425
|
+
const { cumulative: W } = s.prefixSum(F, { materializeOption: { materialize: !1 } }), { index: pe } = Number.isFinite(W) ? s.findIndexAtOrAfter(W - 0.5, { materializeOption: { materialize: !1 } }) : { index: -1 };
|
|
2426
|
+
if (pe !== -1 && pe < F) {
|
|
2427
|
+
F = pe, w = 0;
|
|
2411
2428
|
continue;
|
|
2412
2429
|
}
|
|
2413
|
-
if (
|
|
2414
|
-
|
|
2430
|
+
if (pe === F && F >= 1 && i(F - 1) > 0)
|
|
2431
|
+
w = 0;
|
|
2415
2432
|
else {
|
|
2416
|
-
|
|
2433
|
+
F--;
|
|
2417
2434
|
break;
|
|
2418
2435
|
}
|
|
2419
2436
|
}
|
|
2420
2437
|
} else
|
|
2421
|
-
|
|
2422
|
-
|
|
2438
|
+
w = 0;
|
|
2439
|
+
F--;
|
|
2423
2440
|
}
|
|
2424
|
-
h =
|
|
2425
|
-
const
|
|
2426
|
-
|
|
2441
|
+
h = ve(F + 1, n);
|
|
2442
|
+
const j = D(h, 0);
|
|
2443
|
+
ce = j.cursor, L = j.height;
|
|
2427
2444
|
}
|
|
2428
|
-
const
|
|
2429
|
-
return { renderingStartIndex:
|
|
2430
|
-
},
|
|
2445
|
+
const te = ve(h - t, n), se = ve(Math.max(ce - 1, h), n), ue = ve(se + t, n);
|
|
2446
|
+
return { renderingStartIndex: te, renderingEndIndex: ue, visibleStartIndex: h, visibleEndIndex: se };
|
|
2447
|
+
}, Ir = (r, e, t) => {
|
|
2431
2448
|
const n = Math.max(0, e ?? 0), i = g({ last: 0, id: null, arg: null }).current;
|
|
2432
|
-
return
|
|
2449
|
+
return X(
|
|
2433
2450
|
() => () => {
|
|
2434
2451
|
if (i.id !== null && (cancelAnimationFrame(i.id), i.id = null), i.arg !== null && r.current) {
|
|
2435
2452
|
try {
|
|
@@ -2444,17 +2461,17 @@ const Gr = 1e4, ln = () => {
|
|
|
2444
2461
|
), S(
|
|
2445
2462
|
(s) => {
|
|
2446
2463
|
if (i.arg = s, i.id !== null) return;
|
|
2447
|
-
const a = (
|
|
2464
|
+
const a = (m) => {
|
|
2448
2465
|
if (i.id = null, i.arg === null) return;
|
|
2449
|
-
const
|
|
2450
|
-
if (n === 0 || i.last === 0 ||
|
|
2466
|
+
const d = m - i.last;
|
|
2467
|
+
if (n === 0 || i.last === 0 || d >= n) {
|
|
2451
2468
|
if (r.current)
|
|
2452
2469
|
try {
|
|
2453
2470
|
t(r.current, i.arg);
|
|
2454
2471
|
} catch (b) {
|
|
2455
2472
|
console.error("[useThrottledInvoker] Error invoking callback", b);
|
|
2456
2473
|
}
|
|
2457
|
-
i.arg = null, i.last =
|
|
2474
|
+
i.arg = null, i.last = m;
|
|
2458
2475
|
}
|
|
2459
2476
|
i.arg !== null && (i.id = requestAnimationFrame(a));
|
|
2460
2477
|
};
|
|
@@ -2462,30 +2479,37 @@ const Gr = 1e4, ln = () => {
|
|
|
2462
2479
|
},
|
|
2463
2480
|
[n, t, r, i]
|
|
2464
2481
|
);
|
|
2465
|
-
},
|
|
2466
|
-
const
|
|
2467
|
-
|
|
2482
|
+
}, mn = Nr.memo(({ index: r, top: e, height: t, item: n, children: i, clipItemHeight: s, enableKeyboardNavigation: a, onKeyDown: m, onEscapeKeyDown: d, onFocus: b, registerItemRef: x }) => {
|
|
2483
|
+
const T = S((D) => x(r, D), [r, x]), C = S((D) => m(D, r), [r, m]), h = S((D) => d?.(D, r), [r, d]), L = S(() => b(r), [r, b]), U = S((D) => {
|
|
2484
|
+
D.currentTarget.focus({ preventScroll: !0 });
|
|
2468
2485
|
}, []);
|
|
2469
|
-
return
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2486
|
+
return (
|
|
2487
|
+
// 行ラッパーの role は消費側の複合ウィジェット契約 (listbox / tree / grid — README「Composite widget
|
|
2488
|
+
// roles」) の所有物で、パッケージが既定 role を課すと衝突する。キー/フォーカス結線は
|
|
2489
|
+
// enableKeyboardNavigation の行ナビゲーション機構そのもの。
|
|
2490
|
+
// biome-ignore lint/a11y/noStaticElementInteractions: role は消費側の複合ウィジェット契約の所有物 (上記)
|
|
2491
|
+
/* @__PURE__ */ ne(
|
|
2492
|
+
"div",
|
|
2493
|
+
{
|
|
2494
|
+
ref: T,
|
|
2495
|
+
"data-index": r,
|
|
2496
|
+
"data-virtualscroll-item": "true",
|
|
2497
|
+
className: "aqvs-item-container",
|
|
2498
|
+
style: {
|
|
2499
|
+
top: e,
|
|
2500
|
+
height: t,
|
|
2501
|
+
overflow: s ? "hidden" : void 0
|
|
2502
|
+
},
|
|
2503
|
+
tabIndex: a ? -1 : void 0,
|
|
2504
|
+
onPointerDown: a ? U : void 0,
|
|
2505
|
+
onKeyDownCapture: a ? C : void 0,
|
|
2506
|
+
onKeyDown: a && d ? h : void 0,
|
|
2507
|
+
onFocusCapture: a ? L : void 0,
|
|
2508
|
+
children: i(n, r)
|
|
2509
|
+
}
|
|
2510
|
+
)
|
|
2487
2511
|
);
|
|
2488
|
-
}),
|
|
2512
|
+
}), pn = ({
|
|
2489
2513
|
itemCount: r,
|
|
2490
2514
|
getItem: e,
|
|
2491
2515
|
getItemKey: t,
|
|
@@ -2493,624 +2517,668 @@ const Gr = 1e4, ln = () => {
|
|
|
2493
2517
|
viewportSize: i,
|
|
2494
2518
|
overscanCount: s = 15,
|
|
2495
2519
|
className: a,
|
|
2496
|
-
testId:
|
|
2497
|
-
onScroll:
|
|
2520
|
+
testId: m,
|
|
2521
|
+
onScroll: d,
|
|
2498
2522
|
onRangeChange: b,
|
|
2499
|
-
children:
|
|
2500
|
-
background:
|
|
2501
|
-
initialScrollIndex:
|
|
2523
|
+
children: x,
|
|
2524
|
+
background: T,
|
|
2525
|
+
initialScrollIndex: C,
|
|
2502
2526
|
initialScrollOffset: h,
|
|
2503
|
-
initialScrollAnchor:
|
|
2504
|
-
callbackThrottleMs:
|
|
2505
|
-
contentInsets:
|
|
2506
|
-
onItemFocus:
|
|
2507
|
-
scrollBarOptions:
|
|
2508
|
-
behaviorOptions:
|
|
2509
|
-
onWheelHorizontal:
|
|
2510
|
-
horizontalKeyInputs:
|
|
2511
|
-
horizontalKeyStep:
|
|
2512
|
-
contentProps:
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2527
|
+
initialScrollAnchor: L,
|
|
2528
|
+
callbackThrottleMs: U = 5,
|
|
2529
|
+
contentInsets: D,
|
|
2530
|
+
onItemFocus: le,
|
|
2531
|
+
scrollBarOptions: ce,
|
|
2532
|
+
behaviorOptions: te,
|
|
2533
|
+
onWheelHorizontal: se,
|
|
2534
|
+
horizontalKeyInputs: ue,
|
|
2535
|
+
horizontalKeyStep: R = un,
|
|
2536
|
+
contentProps: F,
|
|
2537
|
+
liveRegion: w
|
|
2538
|
+
}, j) => {
|
|
2539
|
+
const { width: Z, enableThumbDrag: W, enableTrackClick: pe, enableArrowButtons: A, enableScrollToTopBottomButtons: v, renderThumbOverlay: K, tapScrollCircleOptions: de } = ce ?? {}, { enablePointerDrag: qe, pointerDragInputs: Xe, enableKeyboardNavigation: V = !0, enableEscapeRowReturn: ke = !1, wheelSpeedMultiplier: $e, inertiaOptions: ze, overscrollBehavior: Fe, clipItemHeight: Ue = !1, resetOnGetItemHeightChange: De = !1 } = te ?? {}, [Me, Ve] = je(0), be = i ?? Me, Ie = S((o) => {
|
|
2540
|
+
Ve((c) => c === o ? c : o);
|
|
2541
|
+
}, []), G = g(null), Qe = g({
|
|
2517
2542
|
renderingStartIndex: 0,
|
|
2518
2543
|
renderingEndIndex: 0,
|
|
2519
2544
|
visibleStartIndex: 0,
|
|
2520
2545
|
visibleEndIndex: 0,
|
|
2521
2546
|
scrollPosition: 0,
|
|
2522
2547
|
totalHeight: 0
|
|
2523
|
-
}),
|
|
2524
|
-
|
|
2525
|
-
if (
|
|
2526
|
-
|
|
2548
|
+
}), We = g(L && r > 0 ? { index: ie(Math.trunc(L.index), 0, r - 1), align: "top", offset: -Math.max(0, L.offsetPx ?? 0) } : null), dt = g(!1), it = g(!0);
|
|
2549
|
+
X(() => {
|
|
2550
|
+
if (it.current) {
|
|
2551
|
+
it.current = !1;
|
|
2527
2552
|
return;
|
|
2528
2553
|
}
|
|
2529
|
-
|
|
2530
|
-
}, [
|
|
2531
|
-
const
|
|
2532
|
-
const
|
|
2533
|
-
return { from: Math.max(0,
|
|
2534
|
-
}),
|
|
2554
|
+
De && (We.current = null);
|
|
2555
|
+
}, [De, n]);
|
|
2556
|
+
const E = _e(() => xr(D), [D]), [gt] = je(() => {
|
|
2557
|
+
const c = L?.index ?? C, u = typeof c == "number" && Number.isFinite(c) ? Math.max(0, Math.trunc(c)) : 0;
|
|
2558
|
+
return { from: Math.max(0, u - 50), to: u + 50 };
|
|
2559
|
+
}), re = _e(
|
|
2535
2560
|
// 目的: Fenwick Tree のオプション設定
|
|
2536
2561
|
// 依存関係: resetOnGetItemHeightChange, initialSampleRange (マウント時固定)
|
|
2537
2562
|
// itemCount には依存させない (依存させると追記のたびに options 参照が変わり、計測済み高さが全消去される)。
|
|
2538
2563
|
// この useMemo により sampleRange を毎レンダー新規生成しない = 参照同一性由来の破壊的 reset を防ぐ。
|
|
2539
2564
|
() => ({
|
|
2540
|
-
sampleRange:
|
|
2541
|
-
resetOnValueFnChange:
|
|
2565
|
+
sampleRange: gt,
|
|
2566
|
+
resetOnValueFnChange: De,
|
|
2542
2567
|
materialize: !0
|
|
2543
2568
|
}),
|
|
2544
|
-
[
|
|
2545
|
-
),
|
|
2546
|
-
let o = 0,
|
|
2547
|
-
if (
|
|
2548
|
-
const
|
|
2549
|
-
o =
|
|
2550
|
-
} else if (typeof
|
|
2551
|
-
const
|
|
2552
|
-
o =
|
|
2553
|
-
} else typeof h == "number" && (o =
|
|
2554
|
-
return { position: o, total:
|
|
2555
|
-
}), [
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
}, [
|
|
2559
|
-
const
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
}, [b,
|
|
2563
|
-
const
|
|
2569
|
+
[De, gt]
|
|
2570
|
+
), N = sn(r, n, re), [st] = je(() => {
|
|
2571
|
+
let o = 0, c = 0;
|
|
2572
|
+
if (L && r > 0) {
|
|
2573
|
+
const u = ie(Math.trunc(L.index), 0, r - 1), O = Math.max(0, L.offsetPx ?? 0), _ = ie(u - s * 2, 0, r - 1), k = ie(u + s * 2, 0, r - 1), Y = u > 0 || O > 0 ? { materializeOption: { materialize: !0, ranges: [{ from: _, to: k }] } } : void 0, { cumulative: ee, total: Te, currentValue: me } = N.prefixSum(u, Y), ae = Math.max(ee - me + O, 0);
|
|
2574
|
+
o = Mt(ae, E.top), c = Te ?? N.getTotal();
|
|
2575
|
+
} else if (typeof C == "number") {
|
|
2576
|
+
const u = ie(C, 0, r - 1), O = ie(u - s * 2, 0, r - 1), _ = ie(u + s * 2, 0, r - 1), k = C > 0 ? { materializeOption: { materialize: !0, ranges: [{ from: O, to: _ }] } } : void 0, { cumulative: Y, total: ee, currentValue: Te } = N.prefixSum(C, k), me = Math.max(Y - Te, 0);
|
|
2577
|
+
o = Mt(me, E.top), c = ee ?? N.getTotal();
|
|
2578
|
+
} else typeof h == "number" && (o = Mt(Math.max(h, 0), E.top)), c = N.getTotal();
|
|
2579
|
+
return { position: o, total: c };
|
|
2580
|
+
}), [Ke, ft] = je(st.position), [Ae, f] = je(st.total), P = g(st.position), q = g(E.top), B = g(d ?? void 0), Q = g(b ?? void 0), Se = g(se), J = (ue?.length ?? 0) > 0, xe = !!se;
|
|
2581
|
+
X(() => {
|
|
2582
|
+
J && (V || y.warn("[VirtualScroll] horizontalKeyInputs is set but behaviorOptions.enableKeyboardNavigation is false; horizontal keyboard scrolling is disabled because the row key handler is not mounted."), xe || y.warn("[VirtualScroll] horizontalKeyInputs is set but onWheelHorizontal is missing; horizontal keyboard scrolling is disabled because the package does not own the horizontal axis."), Number.isFinite(R) && R > 0 || y.warn(`[VirtualScroll] horizontalKeyStep must be a finite positive number, received ${R}. Horizontal arrow keys are left untouched.`));
|
|
2583
|
+
}, [J, xe, V, R]);
|
|
2584
|
+
const Pe = g(/* @__PURE__ */ new Map()), $ = g(null), ye = g(null), [Ce, fe] = je(null), [Re, Je] = je(!1), Le = g(null), ot = g(!1), we = g(0), et = g(!1), p = g(!1), M = g(r);
|
|
2585
|
+
M.current !== r && (M.current = r, p.current = !0), Ze(() => {
|
|
2586
|
+
B.current = d ?? void 0, Q.current = b ?? void 0, Se.current = se;
|
|
2587
|
+
}, [b, d, se]);
|
|
2588
|
+
const oe = S(
|
|
2564
2589
|
(o) => {
|
|
2565
|
-
if (
|
|
2590
|
+
if (V && o && typeof o.focus == "function")
|
|
2566
2591
|
try {
|
|
2567
2592
|
o.focus({ preventScroll: !0 });
|
|
2568
2593
|
} catch {
|
|
2569
2594
|
o.focus();
|
|
2570
2595
|
}
|
|
2571
2596
|
},
|
|
2572
|
-
[
|
|
2573
|
-
),
|
|
2574
|
-
o(
|
|
2575
|
-
}, []),
|
|
2576
|
-
o(
|
|
2577
|
-
}, []),
|
|
2578
|
-
|
|
2579
|
-
const
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
}), []),
|
|
2583
|
-
|
|
2584
|
-
}, [
|
|
2585
|
-
const
|
|
2586
|
-
(o,
|
|
2587
|
-
if (!
|
|
2588
|
-
|
|
2597
|
+
[V]
|
|
2598
|
+
), tt = S((o, { position: c, totalHeight: u }) => {
|
|
2599
|
+
o(c, u);
|
|
2600
|
+
}, []), Ee = Ir(B, U, tt), Vt = S((o, c) => {
|
|
2601
|
+
o(c);
|
|
2602
|
+
}, []), lt = Ir(Q, U, Vt), Ye = g(E.top);
|
|
2603
|
+
Ye.current = E.top;
|
|
2604
|
+
const bt = g(Ee);
|
|
2605
|
+
bt.current = Ee, X(() => (dt.current = !1, () => {
|
|
2606
|
+
dt.current = !0, Le.current && (clearTimeout(Le.current), Le.current = null);
|
|
2607
|
+
}), []), X(() => {
|
|
2608
|
+
V || (Pe.current.clear(), $.current = null, ye.current = null);
|
|
2609
|
+
}, [V]);
|
|
2610
|
+
const Pt = S(
|
|
2611
|
+
(o, c) => {
|
|
2612
|
+
if (!c) {
|
|
2613
|
+
Pe.current.delete(o);
|
|
2589
2614
|
return;
|
|
2590
2615
|
}
|
|
2591
|
-
|
|
2616
|
+
V && (Pe.current.set(o, c), $.current === o && ($.current = null, ye.current = o, oe(c)));
|
|
2592
2617
|
},
|
|
2593
|
-
[
|
|
2594
|
-
),
|
|
2618
|
+
[V, oe]
|
|
2619
|
+
), Ft = 0.01, ct = g({
|
|
2595
2620
|
rafId: null,
|
|
2596
2621
|
loopActive: !1,
|
|
2597
2622
|
idleFrames: 0,
|
|
2598
|
-
lastRenderedPosition:
|
|
2623
|
+
lastRenderedPosition: st.position
|
|
2599
2624
|
}), yt = S(() => {
|
|
2600
|
-
const o =
|
|
2625
|
+
const o = ct.current;
|
|
2601
2626
|
o.rafId !== null && typeof cancelAnimationFrame == "function" && cancelAnimationFrame(o.rafId), o.rafId = null, o.loopActive = !1, o.idleFrames = 0;
|
|
2602
2627
|
}, []);
|
|
2603
|
-
|
|
2628
|
+
X(
|
|
2604
2629
|
() => () => {
|
|
2605
2630
|
yt();
|
|
2606
2631
|
},
|
|
2607
2632
|
[yt]
|
|
2608
2633
|
);
|
|
2609
|
-
const
|
|
2610
|
-
}),
|
|
2611
|
-
const o =
|
|
2634
|
+
const Yt = g(() => {
|
|
2635
|
+
}), Ct = S(() => {
|
|
2636
|
+
const o = ct.current;
|
|
2612
2637
|
o.rafId = null;
|
|
2613
|
-
const
|
|
2614
|
-
if (
|
|
2638
|
+
const c = P.current, u = Ge(c, Ye.current), O = N.getTotal();
|
|
2639
|
+
if (ft((k) => Math.abs(k - c) < Ft ? k : c), Math.abs(o.lastRenderedPosition - c) >= Ft ? (bt.current({ position: u, totalHeight: O }), o.lastRenderedPosition = c, o.idleFrames = 0) : o.idleFrames += 1, o.idleFrames >= 2) {
|
|
2615
2640
|
yt();
|
|
2616
2641
|
return;
|
|
2617
2642
|
}
|
|
2618
2643
|
if (typeof requestAnimationFrame == "function") {
|
|
2619
|
-
o.rafId = requestAnimationFrame((
|
|
2644
|
+
o.rafId = requestAnimationFrame((k) => Yt.current(k));
|
|
2620
2645
|
return;
|
|
2621
2646
|
}
|
|
2622
2647
|
o.loopActive = !1;
|
|
2623
|
-
}, [
|
|
2624
|
-
|
|
2625
|
-
const
|
|
2626
|
-
const o =
|
|
2648
|
+
}, [N, yt]);
|
|
2649
|
+
Yt.current = Ct;
|
|
2650
|
+
const Bt = S(() => {
|
|
2651
|
+
const o = ct.current;
|
|
2627
2652
|
if (o.idleFrames = 0, !o.loopActive) {
|
|
2628
2653
|
if (o.loopActive = !0, typeof requestAnimationFrame == "function") {
|
|
2629
|
-
o.rafId = requestAnimationFrame(
|
|
2654
|
+
o.rafId = requestAnimationFrame(Ct);
|
|
2630
2655
|
return;
|
|
2631
2656
|
}
|
|
2632
2657
|
o.loopActive = !1;
|
|
2633
2658
|
}
|
|
2634
|
-
}, [
|
|
2635
|
-
(o,
|
|
2636
|
-
const
|
|
2637
|
-
if (
|
|
2638
|
-
|
|
2659
|
+
}, [Ct]), he = S(
|
|
2660
|
+
(o, c) => {
|
|
2661
|
+
const u = c?.immediate ?? !1, O = Ge(o, E.top);
|
|
2662
|
+
if (P.current = o, u) {
|
|
2663
|
+
ct.current.lastRenderedPosition = o, ct.current.idleFrames = 0, ft(o), Ee({ position: O, totalHeight: N.getTotal() });
|
|
2639
2664
|
return;
|
|
2640
2665
|
}
|
|
2641
|
-
|
|
2666
|
+
Bt();
|
|
2642
2667
|
},
|
|
2643
|
-
[
|
|
2644
|
-
),
|
|
2645
|
-
const
|
|
2646
|
-
if (!
|
|
2668
|
+
[Bt, N, E.top, Ee]
|
|
2669
|
+
), xt = S((o, c = 0) => {
|
|
2670
|
+
const u = G.current;
|
|
2671
|
+
if (!u)
|
|
2647
2672
|
return o;
|
|
2648
|
-
const
|
|
2649
|
-
|
|
2650
|
-
const
|
|
2651
|
-
return
|
|
2652
|
-
}, []),
|
|
2653
|
-
|
|
2654
|
-
if (!
|
|
2655
|
-
if (
|
|
2656
|
-
const o =
|
|
2657
|
-
|
|
2673
|
+
const O = u.getScrollPosition();
|
|
2674
|
+
we.current += 1;
|
|
2675
|
+
const _ = u.getContentSize() + c, k = u.getViewportSize(), Y = u.scrollTo(o, { contentSize: _, viewportSize: k });
|
|
2676
|
+
return Y === O && (we.current = Math.max(0, we.current - 1)), Math.abs(Y - o) > 0.5 && (et.current = !0), Y;
|
|
2677
|
+
}, []), Dt = g(!1);
|
|
2678
|
+
X(() => {
|
|
2679
|
+
if (!Dt.current)
|
|
2680
|
+
if (Dt.current = !0, L == null && typeof C != "number" && typeof h == "number") {
|
|
2681
|
+
const o = Mt(Math.max(h, 0), E.top), c = Math.abs(o - P.current) > 0.5;
|
|
2682
|
+
he(o, { immediate: !0 }), c && G.current?.scrollTo(o);
|
|
2658
2683
|
} else
|
|
2659
|
-
|
|
2660
|
-
}, [
|
|
2661
|
-
const o =
|
|
2662
|
-
if (
|
|
2663
|
-
|
|
2684
|
+
he(P.current, { immediate: !0 });
|
|
2685
|
+
}, [L, C, h, E.top, he]), X(() => {
|
|
2686
|
+
const o = N.getTotal();
|
|
2687
|
+
if (Ae !== o) {
|
|
2688
|
+
f(o);
|
|
2664
2689
|
return;
|
|
2665
2690
|
}
|
|
2666
|
-
if (
|
|
2667
|
-
|
|
2668
|
-
const
|
|
2669
|
-
if (
|
|
2670
|
-
const
|
|
2671
|
-
|
|
2691
|
+
if (et.current) {
|
|
2692
|
+
et.current = !1;
|
|
2693
|
+
const c = G.current;
|
|
2694
|
+
if (c && Math.abs(c.getScrollPosition() - P.current) > 0.5) {
|
|
2695
|
+
const u = xt(P.current);
|
|
2696
|
+
et.current = !1, he(u, { immediate: !0 });
|
|
2672
2697
|
}
|
|
2673
2698
|
}
|
|
2674
|
-
}, [
|
|
2675
|
-
if (
|
|
2676
|
-
const { index: o, align:
|
|
2677
|
-
if (
|
|
2678
|
-
const
|
|
2679
|
-
let
|
|
2680
|
-
|
|
2681
|
-
const
|
|
2682
|
-
Math.abs(
|
|
2683
|
-
from:
|
|
2684
|
-
to:
|
|
2685
|
-
targetIndex:
|
|
2686
|
-
}),
|
|
2699
|
+
}, [N, Ae, r, xt, he]), X(() => {
|
|
2700
|
+
if (We.current !== null) {
|
|
2701
|
+
const { index: o, align: c, offset: u } = We.current, O = ve(o, r), { cumulative: _, currentValue: k } = N.prefixSum(O, { materializeOption: { materialize: !1 } });
|
|
2702
|
+
if (_ !== void 0 && k !== void 0) {
|
|
2703
|
+
const Y = Math.max(_ - k, 0);
|
|
2704
|
+
let ee = Y;
|
|
2705
|
+
c === "bottom" ? ee = _ - be : c === "center" && (ee = Y + k / 2 - be / 2), u && (ee -= u), ee = Math.max(0, ee);
|
|
2706
|
+
const Te = Math.max(0, Ae + E.top + E.bottom - be), me = Math.min(Mt(ee, E.top), Te);
|
|
2707
|
+
Math.abs(me - P.current) > 1 && (y.debug("[VirtualScroll] Drift correction", {
|
|
2708
|
+
from: P.current,
|
|
2709
|
+
to: me,
|
|
2710
|
+
targetIndex: O
|
|
2711
|
+
}), we.current === 0 && (we.current += 1), G.current?.scrollTo(me), he(me, { immediate: !0 }));
|
|
2687
2712
|
}
|
|
2688
2713
|
}
|
|
2689
|
-
|
|
2690
|
-
}, [
|
|
2691
|
-
const o =
|
|
2692
|
-
if (o ===
|
|
2714
|
+
p.current = !1;
|
|
2715
|
+
}, [Ae, N, r, E.top, he, be, E.bottom]), X(() => {
|
|
2716
|
+
const o = q.current;
|
|
2717
|
+
if (o === E.top || (q.current = E.top, We.current))
|
|
2693
2718
|
return;
|
|
2694
|
-
const
|
|
2695
|
-
|
|
2696
|
-
}, [
|
|
2697
|
-
const
|
|
2698
|
-
(o,
|
|
2719
|
+
const c = Ge(P.current, o), u = Mt(c, E.top);
|
|
2720
|
+
P.current = u, G.current?.scrollTo(u), he(u, { immediate: !0 });
|
|
2721
|
+
}, [E.top, he]);
|
|
2722
|
+
const At = S(
|
|
2723
|
+
(o, c) => {
|
|
2699
2724
|
if (r === 0)
|
|
2700
2725
|
return;
|
|
2701
|
-
const
|
|
2702
|
-
|
|
2703
|
-
let
|
|
2704
|
-
if (
|
|
2705
|
-
const
|
|
2706
|
-
|
|
2726
|
+
const u = ve(o, r), O = N.get(u), _ = c - O, k = N.update(u, c);
|
|
2727
|
+
k !== void 0 && f(k), y.debug("[VirtualScroll] Updated item size manually", { index: u, size: c, total: k });
|
|
2728
|
+
let Y = We.current ? We.current.index : null;
|
|
2729
|
+
if (Y === null) {
|
|
2730
|
+
const ee = P.current, Te = xr(D).top, me = Ge(ee, Te), { index: ae, cumulative: Be } = N.findIndexAtOrAfter(me, { materializeOption: { materialize: !1 } });
|
|
2731
|
+
Y = Be !== void 0 && Be === me ? ae + 1 : ae;
|
|
2707
2732
|
}
|
|
2708
|
-
if (
|
|
2709
|
-
const
|
|
2710
|
-
|
|
2733
|
+
if (Y !== -1 && u < Y && _ !== 0) {
|
|
2734
|
+
const ee = P.current, Te = ee + _;
|
|
2735
|
+
xt(Te, _), he(Te, { immediate: !0 }), y.debug("[VirtualScroll] Adjusted scroll for layout shift (manual update)", { from: ee, to: Te, causedByIndex: u, delta: _, activeVisibleStartIndex: Y });
|
|
2711
2736
|
}
|
|
2712
2737
|
},
|
|
2713
|
-
[
|
|
2714
|
-
),
|
|
2715
|
-
(o,
|
|
2716
|
-
if (!
|
|
2738
|
+
[N, r, xt, he, D]
|
|
2739
|
+
), l = S(
|
|
2740
|
+
(o, c) => {
|
|
2741
|
+
if (!G.current || r === 0)
|
|
2717
2742
|
return;
|
|
2718
|
-
const
|
|
2719
|
-
if (
|
|
2743
|
+
const u = ve(o, r), O = ve(u - s * 2, r), _ = ve(u + s * 2, r), { cumulative: k, total: Y, currentValue: ee } = N.prefixSum(u, { materializeOption: { materialize: !0, ranges: [{ from: O, to: _ }] } });
|
|
2744
|
+
if (y.debug("[VirtualScroll] Scrolling to index:", u, "ItemBottom:", k, "Total height:", Y, "ItemHeight:", ee, "safeIndexFrom:", O, "safeIndexTo:", _), !Y)
|
|
2720
2745
|
return;
|
|
2721
|
-
const
|
|
2722
|
-
let
|
|
2723
|
-
|
|
2724
|
-
const
|
|
2725
|
-
|
|
2726
|
-
index:
|
|
2727
|
-
align:
|
|
2728
|
-
offset:
|
|
2746
|
+
const Te = Math.max(k - ee, 0);
|
|
2747
|
+
let me = Te;
|
|
2748
|
+
c?.align === "bottom" ? me = k - be : c?.align === "center" && (me = Te + ee / 2 - be / 2), c?.offset && (me -= c.offset), me = Math.max(0, me);
|
|
2749
|
+
const ae = Mt(me, E.top), Be = G.current?.getContentSize() ?? Y + E.top + E.bottom, Oe = Math.max(0, Be - be), He = Math.min(ae, Oe);
|
|
2750
|
+
We.current = {
|
|
2751
|
+
index: u,
|
|
2752
|
+
align: c?.align,
|
|
2753
|
+
offset: c?.offset
|
|
2729
2754
|
};
|
|
2730
|
-
const
|
|
2731
|
-
|
|
2755
|
+
const Ot = G.current?.getScrollPosition() ?? -1, Gt = Math.abs(Ot - He) > 0.5;
|
|
2756
|
+
ot.current = !1, we.current = 0, Gt && (ot.current = !0, we.current += 1, G.current?.scrollTo(He)), f(Y), he(He, { immediate: !0 }), y.debug("[VirtualScroll] Setting scroll position to:", He, { original: ae, max: Oe });
|
|
2732
2757
|
},
|
|
2733
|
-
[
|
|
2734
|
-
),
|
|
2735
|
-
|
|
2736
|
-
const o =
|
|
2737
|
-
!o || r === 0 || (
|
|
2738
|
-
}, [r,
|
|
2739
|
-
const
|
|
2758
|
+
[N, s, r, E.top, E.bottom, be, he]
|
|
2759
|
+
), I = g(L && r === 0 ? L : null);
|
|
2760
|
+
X(() => {
|
|
2761
|
+
const o = I.current;
|
|
2762
|
+
!o || r === 0 || (I.current = null, l(ie(Math.trunc(o.index), 0, r - 1), { align: "top", offset: -Math.max(0, o.offsetPx ?? 0) }));
|
|
2763
|
+
}, [r, l]);
|
|
2764
|
+
const z = S(
|
|
2740
2765
|
(o) => {
|
|
2741
|
-
if (!
|
|
2766
|
+
if (!G.current || r === 0)
|
|
2742
2767
|
return;
|
|
2743
|
-
const
|
|
2744
|
-
|
|
2768
|
+
const c = N.getTotal(), u = ie(Math.floor(o), 0, c), { index: O, cumulative: _, currentValue: k } = N.findIndexAtOrAfter(u, { materializeOption: { materialize: !1 } }), ee = (_ ?? 0) - (k ?? 0) - u;
|
|
2769
|
+
l(O, { offset: ee });
|
|
2745
2770
|
},
|
|
2746
|
-
[
|
|
2747
|
-
),
|
|
2771
|
+
[N, r, l]
|
|
2772
|
+
), H = S(() => {
|
|
2748
2773
|
if (r === 0)
|
|
2749
2774
|
return null;
|
|
2750
|
-
const o =
|
|
2751
|
-
if (
|
|
2775
|
+
const o = Ge(P.current, E.top), { index: c, cumulative: u, currentValue: O } = N.findIndexAtOrAfter(o, { materializeOption: { materialize: !1 } });
|
|
2776
|
+
if (c === -1)
|
|
2752
2777
|
return { index: r - 1, offsetPx: 0 };
|
|
2753
|
-
if (
|
|
2754
|
-
return { index:
|
|
2755
|
-
const
|
|
2756
|
-
return { index:
|
|
2757
|
-
}, [
|
|
2778
|
+
if (u === o)
|
|
2779
|
+
return { index: ie(c + 1, 0, r - 1), offsetPx: 0 };
|
|
2780
|
+
const _ = (u ?? 0) - (O ?? 0);
|
|
2781
|
+
return { index: c, offsetPx: Math.max(0, o - _) };
|
|
2782
|
+
}, [N, r, E.top]), ge = S(
|
|
2758
2783
|
(o) => {
|
|
2759
|
-
const
|
|
2760
|
-
|
|
2761
|
-
const
|
|
2762
|
-
return
|
|
2784
|
+
const c = Ge(P.current, E.top), u = typeof o == "function" ? o(c) : o;
|
|
2785
|
+
z(u);
|
|
2786
|
+
const O = G.current?.getScrollPosition(), _ = typeof O == "number" ? O : P.current;
|
|
2787
|
+
return he(_), Ge(_, Ye.current);
|
|
2763
2788
|
},
|
|
2764
|
-
[
|
|
2765
|
-
),
|
|
2766
|
-
const
|
|
2767
|
-
if (!
|
|
2768
|
-
return
|
|
2769
|
-
const
|
|
2770
|
-
return
|
|
2771
|
-
}, []),
|
|
2772
|
-
(o,
|
|
2773
|
-
|
|
2774
|
-
const
|
|
2775
|
-
|
|
2776
|
-
const
|
|
2777
|
-
|
|
2778
|
-
const
|
|
2779
|
-
if (
|
|
2780
|
-
if (
|
|
2789
|
+
[E.top, z, he]
|
|
2790
|
+
), Ne = S((o) => {
|
|
2791
|
+
const c = G.current;
|
|
2792
|
+
if (!c)
|
|
2793
|
+
return Ge(P.current, Ye.current);
|
|
2794
|
+
const u = c.scrollTo((O) => O + o);
|
|
2795
|
+
return Ge(u, Ye.current);
|
|
2796
|
+
}, []), rt = S((o) => G.current?.applyWheel(o) ?? !1, []), nt = S(
|
|
2797
|
+
(o, c) => {
|
|
2798
|
+
y.debug("[VirtualScroll] Scroll position changed:", o);
|
|
2799
|
+
const u = ot.current;
|
|
2800
|
+
u && (ot.current = !1);
|
|
2801
|
+
const O = we.current > 0;
|
|
2802
|
+
O && (we.current = 0);
|
|
2803
|
+
const _ = p.current && M.current === r;
|
|
2804
|
+
if (u || O || _ || (We.current = null), he(o), v) {
|
|
2805
|
+
if (u || O)
|
|
2781
2806
|
return;
|
|
2782
|
-
const
|
|
2783
|
-
if (
|
|
2784
|
-
const
|
|
2785
|
-
|
|
2786
|
-
|
|
2807
|
+
const k = o - c;
|
|
2808
|
+
if (y.debug("[VirtualScroll] Scroll diff:", k, "New:", o, "Prev:", c), Math.abs(k) > 1) {
|
|
2809
|
+
const Y = k > 0 ? "down" : "up";
|
|
2810
|
+
fe(Y), Je(!0), y.debug("[VirtualScroll] Showing scroll buttons. Direction:", Y), Le.current && clearTimeout(Le.current), Le.current = setTimeout(() => {
|
|
2811
|
+
Je(!1), y.debug("[VirtualScroll] Hiding scroll buttons");
|
|
2787
2812
|
}, 2e3);
|
|
2788
2813
|
}
|
|
2789
2814
|
}
|
|
2790
2815
|
},
|
|
2791
|
-
[
|
|
2792
|
-
),
|
|
2793
|
-
const o =
|
|
2794
|
-
return
|
|
2795
|
-
...
|
|
2796
|
-
scrollPosition:
|
|
2816
|
+
[he, v, r]
|
|
2817
|
+
), mt = _e(() => Ge(Ke, E.top), [E.top, Ke]), at = _e(() => {
|
|
2818
|
+
const o = N.getTotal(), c = fn(mt, be, s, r, n, N, o);
|
|
2819
|
+
return y.debug("[VirtualScroll] Calculated rendering range:", () => ({
|
|
2820
|
+
...c,
|
|
2821
|
+
scrollPosition: mt,
|
|
2797
2822
|
renderingContentSize: o,
|
|
2798
2823
|
overscanCount: s,
|
|
2799
|
-
viewportSize:
|
|
2800
|
-
})),
|
|
2801
|
-
}, [
|
|
2802
|
-
(o,
|
|
2803
|
-
if (!
|
|
2824
|
+
viewportSize: be
|
|
2825
|
+
})), c;
|
|
2826
|
+
}, [mt, be, s, r, n, N]), { renderingStartIndex: pt, renderingEndIndex: wt, visibleStartIndex: vt, visibleEndIndex: Rt } = at, ht = S(
|
|
2827
|
+
(o, c) => {
|
|
2828
|
+
if (!V || r === 0)
|
|
2804
2829
|
return;
|
|
2805
|
-
const
|
|
2806
|
-
if (!(
|
|
2807
|
-
const
|
|
2808
|
-
|
|
2830
|
+
const u = ve(o, r);
|
|
2831
|
+
if (!(c?.ensureVisible ?? !0)) {
|
|
2832
|
+
const Oe = Pe.current.get(u);
|
|
2833
|
+
Oe && ($.current = null, ye.current = u, oe(Oe));
|
|
2809
2834
|
return;
|
|
2810
2835
|
}
|
|
2811
|
-
const
|
|
2812
|
-
if (
|
|
2813
|
-
|
|
2814
|
-
const
|
|
2815
|
-
|
|
2836
|
+
const _ = N.prefixSum(u, { materializeOption: { materialize: !1 } }), k = _.currentValue, Y = Math.max(_.cumulative - k, 0), ee = Y + k, Te = Ge(P.current, E.top), me = Te + be;
|
|
2837
|
+
if (Y < Te || ee > me) {
|
|
2838
|
+
l(u);
|
|
2839
|
+
const Oe = Pe.current.get(u);
|
|
2840
|
+
Oe ? ($.current = null, ye.current = u, oe(Oe)) : $.current = u;
|
|
2816
2841
|
return;
|
|
2817
2842
|
}
|
|
2818
|
-
const Be =
|
|
2843
|
+
const Be = Pe.current.get(u);
|
|
2819
2844
|
if (Be) {
|
|
2820
|
-
|
|
2845
|
+
$.current = null, ye.current = u, oe(Be);
|
|
2821
2846
|
return;
|
|
2822
2847
|
}
|
|
2823
|
-
|
|
2848
|
+
$.current = u;
|
|
2824
2849
|
},
|
|
2825
|
-
[
|
|
2826
|
-
),
|
|
2827
|
-
(o,
|
|
2828
|
-
if (!(!
|
|
2850
|
+
[V, r, N, E.top, l, oe, be]
|
|
2851
|
+
), sr = S(
|
|
2852
|
+
(o, c) => {
|
|
2853
|
+
if (!(!V || o.defaultPrevented) && !(o.altKey || o.metaKey || o.ctrlKey) && o.target === o.currentTarget && !o.currentTarget.isContentEditable) {
|
|
2829
2854
|
if (o.key === "ArrowLeft" || o.key === "ArrowRight") {
|
|
2830
|
-
const
|
|
2831
|
-
if (!
|
|
2855
|
+
const u = Se.current;
|
|
2856
|
+
if (!u || o.shiftKey || !ue?.includes("arrow") || !(Number.isFinite(R) && R > 0))
|
|
2832
2857
|
return;
|
|
2833
|
-
o.preventDefault(),
|
|
2858
|
+
o.preventDefault(), u(o.key === "ArrowLeft" ? -R : R);
|
|
2834
2859
|
return;
|
|
2835
2860
|
}
|
|
2836
2861
|
if (o.key === "ArrowDown") {
|
|
2837
|
-
|
|
2862
|
+
c < r - 1 && (o.preventDefault(), ht(c + 1));
|
|
2838
2863
|
return;
|
|
2839
2864
|
}
|
|
2840
2865
|
if (o.key === "ArrowUp") {
|
|
2841
|
-
|
|
2866
|
+
c > 0 && (o.preventDefault(), ht(c - 1));
|
|
2842
2867
|
return;
|
|
2843
2868
|
}
|
|
2844
2869
|
if (o.key === "PageDown") {
|
|
2845
|
-
if (
|
|
2870
|
+
if (c < r - 1) {
|
|
2846
2871
|
o.preventDefault();
|
|
2847
|
-
const { visibleStartIndex:
|
|
2848
|
-
|
|
2872
|
+
const { visibleStartIndex: u, visibleEndIndex: O } = Qe.current, _ = Math.max(O - u + 1, 1), k = Math.max(_, 1), Y = ve(Math.min(c + k, r - 1), r);
|
|
2873
|
+
ht(Y);
|
|
2849
2874
|
}
|
|
2850
2875
|
return;
|
|
2851
2876
|
}
|
|
2852
|
-
if (o.key === "PageUp" &&
|
|
2877
|
+
if (o.key === "PageUp" && c > 0) {
|
|
2853
2878
|
o.preventDefault();
|
|
2854
|
-
const { visibleStartIndex:
|
|
2855
|
-
|
|
2879
|
+
const { visibleStartIndex: u, visibleEndIndex: O } = Qe.current, _ = Math.max(O - u + 1, 1), k = Math.max(_, 1), Y = ve(c - k, r);
|
|
2880
|
+
ht(Y);
|
|
2856
2881
|
}
|
|
2857
2882
|
}
|
|
2858
2883
|
},
|
|
2859
|
-
[
|
|
2860
|
-
),
|
|
2884
|
+
[V, r, ht, ue, R]
|
|
2885
|
+
), or = S(
|
|
2886
|
+
/**
|
|
2887
|
+
* Returns focus from an element inside the row back to the row wrapper on Escape.
|
|
2888
|
+
* 行内要素の Escape で行ラッパーへフォーカスを戻す処理。
|
|
2889
|
+
*
|
|
2890
|
+
* @param event - Keyboard event (bubble phase on the row wrapper) / 行ラッパー bubble フェーズのキーイベント
|
|
2891
|
+
* @param index - Row index / 行インデックス
|
|
2892
|
+
*/
|
|
2893
|
+
(o, c) => {
|
|
2894
|
+
if (o.key !== "Escape" || o.defaultPrevented || o.nativeEvent.isComposing || o.target === o.currentTarget)
|
|
2895
|
+
return;
|
|
2896
|
+
const u = o.target;
|
|
2897
|
+
u instanceof HTMLInputElement || u instanceof HTMLTextAreaElement || u instanceof HTMLSelectElement || u.isContentEditable || (o.preventDefault(), ht(c));
|
|
2898
|
+
},
|
|
2899
|
+
[ht]
|
|
2900
|
+
), ar = S(
|
|
2861
2901
|
(o) => {
|
|
2862
|
-
if (!
|
|
2902
|
+
if (!V)
|
|
2863
2903
|
return;
|
|
2864
|
-
const
|
|
2865
|
-
|
|
2904
|
+
const c = ve(o, r);
|
|
2905
|
+
$.current = null, ye.current = c, le?.(c);
|
|
2866
2906
|
},
|
|
2867
|
-
[
|
|
2907
|
+
[V, r, le]
|
|
2868
2908
|
);
|
|
2869
|
-
|
|
2870
|
-
const o =
|
|
2871
|
-
|
|
2872
|
-
renderingStartIndex:
|
|
2873
|
-
renderingEndIndex:
|
|
2874
|
-
visibleStartIndex:
|
|
2875
|
-
visibleEndIndex:
|
|
2876
|
-
scrollPositionState:
|
|
2877
|
-
paneScrollPosition:
|
|
2878
|
-
logicalScrollPosition:
|
|
2879
|
-
contentSize:
|
|
2909
|
+
X(() => {
|
|
2910
|
+
const o = G.current?.getScrollPosition() ?? 0, c = P.current, u = Ge(c, E.top);
|
|
2911
|
+
y.debug("[VirtualScroll] Range change effect triggered", () => ({
|
|
2912
|
+
renderingStartIndex: pt,
|
|
2913
|
+
renderingEndIndex: wt,
|
|
2914
|
+
visibleStartIndex: vt,
|
|
2915
|
+
visibleEndIndex: Rt,
|
|
2916
|
+
scrollPositionState: Ke,
|
|
2917
|
+
paneScrollPosition: c,
|
|
2918
|
+
logicalScrollPosition: u,
|
|
2919
|
+
contentSize: Ae,
|
|
2880
2920
|
scrollPaneScrollPosition: o
|
|
2881
|
-
})),
|
|
2882
|
-
renderingStartIndex:
|
|
2883
|
-
renderingEndIndex:
|
|
2884
|
-
visibleStartIndex:
|
|
2885
|
-
visibleEndIndex:
|
|
2886
|
-
scrollPosition:
|
|
2887
|
-
totalHeight:
|
|
2921
|
+
})), lt({
|
|
2922
|
+
renderingStartIndex: pt,
|
|
2923
|
+
renderingEndIndex: wt,
|
|
2924
|
+
visibleStartIndex: vt,
|
|
2925
|
+
visibleEndIndex: Rt,
|
|
2926
|
+
scrollPosition: u,
|
|
2927
|
+
totalHeight: Ae
|
|
2888
2928
|
});
|
|
2889
|
-
}, [
|
|
2890
|
-
const
|
|
2891
|
-
if (!
|
|
2929
|
+
}, [Ae, wt, pt, E.top, lt, Ke, Rt, vt]);
|
|
2930
|
+
const Pr = S(() => {
|
|
2931
|
+
if (!v)
|
|
2892
2932
|
return null;
|
|
2893
|
-
const o =
|
|
2894
|
-
return /* @__PURE__ */
|
|
2933
|
+
const o = Re && Ce !== null;
|
|
2934
|
+
return /* @__PURE__ */ ne("div", { className: "aqvs-scroll-to-edge-overlay", "data-visible": o, inert: !o, children: Ce === "up" ? /* @__PURE__ */ ne("div", { className: "aqvs-scroll-to-edge-button-container aqvs-scroll-to-edge-button-container-top", children: /* @__PURE__ */ ne(
|
|
2895
2935
|
"button",
|
|
2896
2936
|
{
|
|
2897
2937
|
type: "button",
|
|
2898
2938
|
className: "aqvs-scroll-to-edge-button",
|
|
2899
2939
|
tabIndex: o ? 0 : -1,
|
|
2900
|
-
onClick: (
|
|
2901
|
-
|
|
2940
|
+
onClick: (u) => {
|
|
2941
|
+
u.stopPropagation(), ot.current = !0, l(0), Je(!1);
|
|
2902
2942
|
},
|
|
2903
2943
|
children: "Top"
|
|
2904
2944
|
}
|
|
2905
|
-
) }) : /* @__PURE__ */
|
|
2945
|
+
) }) : /* @__PURE__ */ ne("div", { className: "aqvs-scroll-to-edge-button-container aqvs-scroll-to-edge-button-container-bottom", children: /* @__PURE__ */ ne(
|
|
2906
2946
|
"button",
|
|
2907
2947
|
{
|
|
2908
2948
|
type: "button",
|
|
2909
2949
|
className: "aqvs-scroll-to-edge-button",
|
|
2910
2950
|
tabIndex: o ? 0 : -1,
|
|
2911
|
-
onClick: (
|
|
2912
|
-
|
|
2951
|
+
onClick: (u) => {
|
|
2952
|
+
u.stopPropagation(), ot.current = !0, l(r - 1), Je(!1);
|
|
2913
2953
|
},
|
|
2914
2954
|
children: "Bottom"
|
|
2915
2955
|
}
|
|
2916
2956
|
) }) });
|
|
2917
|
-
}, [
|
|
2957
|
+
}, [v, Re, Ce, l, r]), Ut = g(0), { visibleItems: Wt, renderAnchor: Kt } = _e(() => {
|
|
2918
2958
|
if (r === 0)
|
|
2919
2959
|
return {
|
|
2920
|
-
visibleItems: /* @__PURE__ */
|
|
2960
|
+
visibleItems: /* @__PURE__ */ ne("div", { className: "aqvs-no-items-container", children: /* @__PURE__ */ ne("div", { className: "aqvs-no-items-text", children: "No items" }) }),
|
|
2921
2961
|
renderAnchor: 0
|
|
2922
2962
|
};
|
|
2923
|
-
const o =
|
|
2924
|
-
Number.isFinite(
|
|
2925
|
-
const
|
|
2926
|
-
let
|
|
2927
|
-
for (let
|
|
2928
|
-
if (
|
|
2929
|
-
|
|
2963
|
+
const o = ve(pt, r), c = ve(wt, r), { cumulative: u, currentValue: O } = N.prefixSum(o, { materializeOption: { materialize: !1 } }), _ = u - O;
|
|
2964
|
+
Number.isFinite(_) && Math.abs(_ - Ut.current) > cn && (Ut.current = _);
|
|
2965
|
+
const k = Ut.current, Y = [], ee = [];
|
|
2966
|
+
let Te = 0, me = _;
|
|
2967
|
+
for (let ae = o; ae <= c; ae++) {
|
|
2968
|
+
if (ee.length >= vr) {
|
|
2969
|
+
y.warn("[VirtualScroll] Rendered item count reached the safety cap; truncating render window.", { cap: vr, safeRenderingStartIndex: o, safeRenderingEndIndex: c });
|
|
2930
2970
|
break;
|
|
2931
2971
|
}
|
|
2932
|
-
const Be = n(
|
|
2933
|
-
He !== 0 &&
|
|
2934
|
-
const
|
|
2935
|
-
|
|
2936
|
-
/* @__PURE__ */
|
|
2937
|
-
|
|
2972
|
+
const Be = n(ae), Oe = N.get(ae), He = Be - Oe;
|
|
2973
|
+
He !== 0 && Y.push({ index: ae, value: Be });
|
|
2974
|
+
const Ot = me + Te, Gt = t ? t(ae) : ae;
|
|
2975
|
+
ee.push(
|
|
2976
|
+
/* @__PURE__ */ ne(
|
|
2977
|
+
mn,
|
|
2938
2978
|
{
|
|
2939
|
-
index:
|
|
2940
|
-
top:
|
|
2979
|
+
index: ae,
|
|
2980
|
+
top: Ot - k,
|
|
2941
2981
|
height: Be,
|
|
2942
|
-
item: e(
|
|
2943
|
-
clipItemHeight:
|
|
2944
|
-
enableKeyboardNavigation:
|
|
2945
|
-
onKeyDown:
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2982
|
+
item: e(ae),
|
|
2983
|
+
clipItemHeight: Ue,
|
|
2984
|
+
enableKeyboardNavigation: V,
|
|
2985
|
+
onKeyDown: sr,
|
|
2986
|
+
onEscapeKeyDown: ke ? or : void 0,
|
|
2987
|
+
onFocus: ar,
|
|
2988
|
+
registerItemRef: Pt,
|
|
2989
|
+
children: x
|
|
2949
2990
|
},
|
|
2950
|
-
|
|
2991
|
+
Gt
|
|
2951
2992
|
)
|
|
2952
|
-
),
|
|
2993
|
+
), Te += He, me += Oe;
|
|
2953
2994
|
}
|
|
2954
|
-
return
|
|
2955
|
-
if (
|
|
2995
|
+
return Y.length > 0 && Promise.resolve().then(() => {
|
|
2996
|
+
if (dt.current)
|
|
2956
2997
|
return;
|
|
2957
|
-
let
|
|
2958
|
-
for (const He of
|
|
2959
|
-
if (He.index <
|
|
2960
|
-
const
|
|
2961
|
-
|
|
2998
|
+
let ae = 0;
|
|
2999
|
+
for (const He of Y)
|
|
3000
|
+
if (He.index < vt) {
|
|
3001
|
+
const Ot = N.get(He.index);
|
|
3002
|
+
ae += He.value - Ot;
|
|
2962
3003
|
}
|
|
2963
|
-
const Be =
|
|
2964
|
-
if (
|
|
3004
|
+
const Be = N.updates(Y);
|
|
3005
|
+
if (dt.current || typeof Be != "number")
|
|
2965
3006
|
return;
|
|
2966
|
-
|
|
2967
|
-
const
|
|
2968
|
-
if (
|
|
2969
|
-
const He =
|
|
2970
|
-
|
|
2971
|
-
} else
|
|
2972
|
-
}), { visibleItems:
|
|
3007
|
+
f(Be), y.debug("[VirtualScroll] Updated heights for items", Y, "New total height:", Be);
|
|
3008
|
+
const Oe = G.current?.getScrollPosition() ?? P.current;
|
|
3009
|
+
if (ae !== 0) {
|
|
3010
|
+
const He = Oe + ae;
|
|
3011
|
+
xt(He, ae), he(He, { immediate: !0 }), y.debug("[VirtualScroll] Adjusted scroll for layout shift (auto update)", { from: Oe, to: He, shiftAmount: ae });
|
|
3012
|
+
} else Oe !== P.current && he(Oe);
|
|
3013
|
+
}), { visibleItems: ee, renderAnchor: k };
|
|
2973
3014
|
}, [
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
3015
|
+
x,
|
|
3016
|
+
Ue,
|
|
3017
|
+
Ae,
|
|
3018
|
+
V,
|
|
2978
3019
|
r,
|
|
2979
|
-
|
|
3020
|
+
N,
|
|
2980
3021
|
e,
|
|
2981
3022
|
t,
|
|
2982
3023
|
n,
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
3024
|
+
ar,
|
|
3025
|
+
sr,
|
|
3026
|
+
ke,
|
|
3027
|
+
or,
|
|
3028
|
+
xt,
|
|
3029
|
+
Pt,
|
|
3030
|
+
wt,
|
|
3031
|
+
pt,
|
|
3032
|
+
he,
|
|
3033
|
+
vt
|
|
3034
|
+
]), yr = S(
|
|
2992
3035
|
(o) => {
|
|
2993
|
-
const
|
|
2994
|
-
if (
|
|
3036
|
+
const c = (U ?? 0) > 0, u = Math.abs(o - Ke), O = c && u > 0.5 ? Ke : o, _ = Ge(O, E.top);
|
|
3037
|
+
if (y.debug("[VirtualScroll] Rendering visible items", () => ({
|
|
2995
3038
|
currentScrollPosition: o,
|
|
2996
|
-
effectiveScrollPosition:
|
|
2997
|
-
renderingStartIndex:
|
|
2998
|
-
renderingEndIndex:
|
|
3039
|
+
effectiveScrollPosition: _,
|
|
3040
|
+
renderingStartIndex: pt,
|
|
3041
|
+
renderingEndIndex: wt,
|
|
2999
3042
|
itemCount: r,
|
|
3000
|
-
viewportSize:
|
|
3001
|
-
callbackThrottleMs:
|
|
3002
|
-
diff:
|
|
3003
|
-
rawEffectiveScrollPosition:
|
|
3043
|
+
viewportSize: be,
|
|
3044
|
+
callbackThrottleMs: U,
|
|
3045
|
+
diff: u,
|
|
3046
|
+
rawEffectiveScrollPosition: O
|
|
3004
3047
|
})), r === 0)
|
|
3005
|
-
return
|
|
3006
|
-
const
|
|
3048
|
+
return Wt;
|
|
3049
|
+
const k = E.top + Kt - O, Y = E.bottom > 0 ? /* @__PURE__ */ ne(
|
|
3007
3050
|
"div",
|
|
3008
3051
|
{
|
|
3009
3052
|
className: "aqvs-bottom-inset",
|
|
3010
3053
|
style: {
|
|
3011
3054
|
// ラッパー座標での bottom インセット位置 = コンテンツ総高さ (最終行の下端) - アンカー。
|
|
3012
|
-
top:
|
|
3013
|
-
height:
|
|
3055
|
+
top: N.getTotal() - Kt,
|
|
3056
|
+
height: E.bottom
|
|
3014
3057
|
}
|
|
3015
3058
|
},
|
|
3016
3059
|
"virtualscroll-bottom-inset"
|
|
3017
3060
|
) : null;
|
|
3018
|
-
return
|
|
3019
|
-
containerTop:
|
|
3020
|
-
logicalScrollPosition:
|
|
3021
|
-
resolvedInsets:
|
|
3022
|
-
effectiveScrollPosition:
|
|
3023
|
-
})), /* @__PURE__ */
|
|
3024
|
-
|
|
3025
|
-
|
|
3061
|
+
return y.debug("[VirtualScroll] Rendering items", () => ({
|
|
3062
|
+
containerTop: k,
|
|
3063
|
+
logicalScrollPosition: mt,
|
|
3064
|
+
resolvedInsets: E,
|
|
3065
|
+
effectiveScrollPosition: _
|
|
3066
|
+
})), /* @__PURE__ */ Tt("div", { className: "aqvs-items-wrapper", style: { top: 0, transform: `translateY(${k}px)`, willChange: "transform" }, children: [
|
|
3067
|
+
Wt,
|
|
3068
|
+
Y
|
|
3026
3069
|
] });
|
|
3027
3070
|
},
|
|
3028
|
-
[
|
|
3029
|
-
),
|
|
3071
|
+
[U, r, N, mt, Kt, wt, pt, E, Ke, be, Wt]
|
|
3072
|
+
), lr = _e(
|
|
3030
3073
|
() => ({
|
|
3031
|
-
renderingStartIndex:
|
|
3032
|
-
renderingEndIndex:
|
|
3033
|
-
visibleStartIndex:
|
|
3034
|
-
visibleEndIndex:
|
|
3035
|
-
scrollPosition:
|
|
3036
|
-
totalHeight:
|
|
3074
|
+
renderingStartIndex: at.renderingStartIndex,
|
|
3075
|
+
renderingEndIndex: at.renderingEndIndex,
|
|
3076
|
+
visibleStartIndex: at.visibleStartIndex,
|
|
3077
|
+
visibleEndIndex: at.visibleEndIndex,
|
|
3078
|
+
scrollPosition: mt,
|
|
3079
|
+
totalHeight: N.getTotal()
|
|
3037
3080
|
// contentSize (State) ではなく最新値を反映
|
|
3038
3081
|
}),
|
|
3039
3082
|
// contentSize を依存に含めることで、updateItemSize/updates 等で木の総高さが変わった際に
|
|
3040
3083
|
// (fenwickTree は安定参照のため getTotal() の変化だけでは再計算されない) 総高さを再取得する。
|
|
3041
|
-
[
|
|
3084
|
+
[at, mt, N, Ae]
|
|
3042
3085
|
);
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
}, [
|
|
3046
|
-
|
|
3086
|
+
X(() => {
|
|
3087
|
+
Qe.current = lr;
|
|
3088
|
+
}, [lr]);
|
|
3089
|
+
const [Rr, cr] = je(""), ur = g(w);
|
|
3090
|
+
Ze(() => {
|
|
3091
|
+
ur.current = w;
|
|
3092
|
+
}, [w]);
|
|
3093
|
+
const Et = w?.debounceMs ?? 400, Ht = Number.isFinite(Et) && Et >= 0, Lt = w !== void 0;
|
|
3094
|
+
X(() => {
|
|
3095
|
+
Lt && !Ht && y.warn(`[VirtualScroll] liveRegion.debounceMs must be a finite number >= 0, received ${Et}. Announcements are disabled.`);
|
|
3096
|
+
}, [Lt, Ht, Et]), X(() => {
|
|
3097
|
+
if (!(Lt && Ht)) {
|
|
3098
|
+
cr("");
|
|
3099
|
+
return;
|
|
3100
|
+
}
|
|
3101
|
+
const o = setTimeout(() => {
|
|
3102
|
+
const c = ur.current?.format;
|
|
3103
|
+
if (!c)
|
|
3104
|
+
return;
|
|
3105
|
+
const u = c({ visibleStartIndex: vt, visibleEndIndex: Rt, itemCount: r });
|
|
3106
|
+
cr(u);
|
|
3107
|
+
}, Et);
|
|
3108
|
+
return () => clearTimeout(o);
|
|
3109
|
+
}, [Lt, Ht, Et, vt, Rt, r]), ir(
|
|
3110
|
+
j,
|
|
3047
3111
|
() => ({
|
|
3048
3112
|
getScrollPosition: () => {
|
|
3049
|
-
const o =
|
|
3050
|
-
return typeof o == "number" ?
|
|
3113
|
+
const o = G.current?.getScrollPosition();
|
|
3114
|
+
return typeof o == "number" ? Ge(o, Ye.current) : -1;
|
|
3051
3115
|
},
|
|
3052
|
-
getContentSize: () =>
|
|
3053
|
-
getViewportSize: () =>
|
|
3054
|
-
scrollTo:
|
|
3055
|
-
scrollBy:
|
|
3056
|
-
applyWheel:
|
|
3057
|
-
scrollToIndex:
|
|
3058
|
-
getFenwickTreeTotalHeight: () =>
|
|
3059
|
-
getFenwickSize: () =>
|
|
3060
|
-
focusItemAtIndex:
|
|
3061
|
-
getRange: () =>
|
|
3062
|
-
getScrollAnchor:
|
|
3063
|
-
updateItemSize:
|
|
3116
|
+
getContentSize: () => G.current?.getContentSize() ?? -1,
|
|
3117
|
+
getViewportSize: () => G.current?.getViewportSize() ?? -1,
|
|
3118
|
+
scrollTo: ge,
|
|
3119
|
+
scrollBy: Ne,
|
|
3120
|
+
applyWheel: rt,
|
|
3121
|
+
scrollToIndex: l,
|
|
3122
|
+
getFenwickTreeTotalHeight: () => N.getTotal(),
|
|
3123
|
+
getFenwickSize: () => N.getSize(),
|
|
3124
|
+
focusItemAtIndex: ht,
|
|
3125
|
+
getRange: () => Qe.current,
|
|
3126
|
+
getScrollAnchor: H,
|
|
3127
|
+
updateItemSize: At
|
|
3064
3128
|
}),
|
|
3065
|
-
[
|
|
3129
|
+
[ge, Ne, rt, l, N, ht, H, At]
|
|
3066
3130
|
);
|
|
3067
|
-
const
|
|
3068
|
-
|
|
3069
|
-
Xr,
|
|
3131
|
+
const Er = N.getTotal() + E.top + E.bottom, dr = /* @__PURE__ */ ne(
|
|
3132
|
+
tn,
|
|
3070
3133
|
{
|
|
3071
|
-
ref:
|
|
3072
|
-
contentSize:
|
|
3134
|
+
ref: G,
|
|
3135
|
+
contentSize: Er,
|
|
3073
3136
|
viewportSize: i,
|
|
3074
|
-
onViewportSizeChange:
|
|
3137
|
+
onViewportSizeChange: Ie,
|
|
3075
3138
|
className: a,
|
|
3076
|
-
testId:
|
|
3077
|
-
onScroll:
|
|
3078
|
-
background:
|
|
3079
|
-
tapScrollCircleOptions:
|
|
3080
|
-
inertiaOptions:
|
|
3081
|
-
overscrollBehavior:
|
|
3139
|
+
testId: m,
|
|
3140
|
+
onScroll: nt,
|
|
3141
|
+
background: T,
|
|
3142
|
+
tapScrollCircleOptions: de,
|
|
3143
|
+
inertiaOptions: ze,
|
|
3144
|
+
overscrollBehavior: Fe,
|
|
3082
3145
|
itemCount: r,
|
|
3083
3146
|
scrollBarWidth: Z,
|
|
3084
|
-
enableThumbDrag:
|
|
3085
|
-
enableTrackClick:
|
|
3086
|
-
enableArrowButtons:
|
|
3087
|
-
enablePointerDrag:
|
|
3088
|
-
pointerDragInputs:
|
|
3089
|
-
renderThumbOverlay:
|
|
3090
|
-
wheelSpeedMultiplier:
|
|
3091
|
-
onWheelHorizontal:
|
|
3092
|
-
contentInsets:
|
|
3093
|
-
contentProps:
|
|
3094
|
-
visibleStartIndex:
|
|
3095
|
-
visibleEndIndex:
|
|
3096
|
-
renderOverlay:
|
|
3097
|
-
initialScrollPosition:
|
|
3098
|
-
children:
|
|
3147
|
+
enableThumbDrag: W,
|
|
3148
|
+
enableTrackClick: pe,
|
|
3149
|
+
enableArrowButtons: A,
|
|
3150
|
+
enablePointerDrag: qe,
|
|
3151
|
+
pointerDragInputs: Xe,
|
|
3152
|
+
renderThumbOverlay: K,
|
|
3153
|
+
wheelSpeedMultiplier: $e,
|
|
3154
|
+
onWheelHorizontal: se,
|
|
3155
|
+
contentInsets: E,
|
|
3156
|
+
contentProps: F,
|
|
3157
|
+
visibleStartIndex: vt,
|
|
3158
|
+
visibleEndIndex: Rt,
|
|
3159
|
+
renderOverlay: Pr,
|
|
3160
|
+
initialScrollPosition: st.position,
|
|
3161
|
+
children: yr
|
|
3099
3162
|
}
|
|
3100
3163
|
);
|
|
3101
|
-
|
|
3164
|
+
return Lt ? /* @__PURE__ */ Tt(rr, { children: [
|
|
3165
|
+
dr,
|
|
3166
|
+
/* @__PURE__ */ ne("div", { className: "aqvs-live-region", role: "status", "aria-live": "polite", "aria-atomic": "true", "data-aqvs-live-region": "", children: Rr })
|
|
3167
|
+
] }) : dr;
|
|
3168
|
+
}, Tn = nr(pn);
|
|
3102
3169
|
export {
|
|
3103
3170
|
St as FenwickMapTree,
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3171
|
+
Gr as ScrollBar,
|
|
3172
|
+
tn as ScrollPane,
|
|
3173
|
+
wr as TAP_SCROLL_SPEED_DEFAULTS,
|
|
3174
|
+
Tn as VirtualScroll,
|
|
3175
|
+
Kr as computeAutoTapScrollMaxSpeedMultiplier,
|
|
3176
|
+
Wr as computeTapScrollSpeed,
|
|
3177
|
+
xn as createResidualQuantizer,
|
|
3178
|
+
ie as minmax,
|
|
3179
|
+
vn as tapScrollCircleSampleVisual,
|
|
3180
|
+
sn as useFenwickMapTree,
|
|
3181
|
+
In as useHeightCache,
|
|
3182
|
+
an as useLruCache,
|
|
3183
|
+
Sn as useWheelBridge
|
|
3116
3184
|
};
|