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